How to use physicals method in wpt

Best JavaScript code snippet using wpt

core_45_Challenge_Room.js

Source:core_45_Challenge_Room.js Github

copy

Full Screen

1/**2 * @license3 * Copyright 2020 Google LLC4 *5 * Licensed under the Apache License, Version 2.0 (the "License");6 * you may not use this file except in compliance with the License.7 * You may obtain a copy of the License at8 *9 * http://www.apache.org/licenses/LICENSE-2.010 *11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */17/**18 * @fileoverview Challenge room demo for Code City.19 */20//////////////////////////////////////////////////////////////////////21// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!22//////////////////////////////////////////////////////////////////////23$.physicals['Challenge room'] = (new 'Object.create')($.room);24Object.setOwnerOf($.physicals['Challenge room'], $.physicals.Neil);25$.physicals['Challenge room'].name = 'Challenge room';26$.physicals['Challenge room'].location = null;27$.physicals['Challenge room'].contents_ = [];28$.physicals['Challenge room'].contents_[0] = (new 'Object.create')($.thing);29$.physicals['Challenge room'].contents_[1] = (new 'Object.create')($.container);30$.physicals['Challenge room'].contents_[2] = (new 'Object.create')($.thing);31$.physicals['Challenge room'].contents_.forObj = $.physicals['Challenge room'];32Object.defineProperty($.physicals['Challenge room'].contents_, 'forObj', {writable: false, enumerable: false, configurable: false});33$.physicals['Challenge room'].contents_.forKey = 'contents_';34Object.defineProperty($.physicals['Challenge room'].contents_, 'forKey', {writable: false, enumerable: false, configurable: false});35$.physicals['Challenge room'].reset = function reset(cmd) {36 this.switch.state = false;37 this.switch.movable = true;38 this.switch.moveTo(this);39 this.switch.movable = false;40 for (var x = 0; x < 1000; x++) {41 this.safe.setOpen(true, x);42 }43 this.food.moveTo(this.safe);44 this.food.svgText = this.food.svgTextReset;45 this.safe.setOpen(false);46 this.safe.crack = this.safe.crackReset;47 this.chest.movable = true;48 this.chest.moveTo(this);49 this.chest.movable = false;50 this.chest.setOpen(true);51 this.safe.moveTo(this.chest);52 this.chest.setOpen(false);53 this.girl.movable = true;54 this.girl.moveTo(this);55 this.girl.movable = false;56 this.girl.attempts = 0;57 if (cmd) {58 this.sendScene(cmd.user, true);59 this.narrate(cmd.user.name + ' resets ' + String(this) + '.', cmd.user);60 cmd.user.narrate('You reset ' + String(this) + '.');61 }62};63Object.setOwnerOf($.physicals['Challenge room'].reset, $.physicals.Neil);64Object.setOwnerOf($.physicals['Challenge room'].reset.prototype, $.physicals.Neil);65$.physicals['Challenge room'].reset.verb = 'reset';66$.physicals['Challenge room'].reset.dobj = 'none';67$.physicals['Challenge room'].reset.prep = 'none';68$.physicals['Challenge room'].reset.iobj = 'none';69$.physicals['Challenge room'].chest = $.physicals['Challenge room'].contents_[1];70$.physicals['Challenge room'].safe = (new 'Object.create')($.container);71$.physicals['Challenge room'].girl = $.physicals['Challenge room'].contents_[2];72$.physicals['Challenge room'].food = (new 'Object.create')($.thing);73$.physicals['Challenge room'].switch = $.physicals['Challenge room'].contents_[0];74$.physicals['Challenge room'].svgTextNight = '<rect class="fillBlack strokeNone" height="100" width="2000" x="-1000" y="0"/>\n<line class="strokeWhite" x1="-1000" x2="1000" y1="90" y2="90"/>';75$.physicals['Challenge room'].getContents = function getContents() {76 $.physical.validate.call(this);77 if (this.switch.state) {78 return this.contents_.slice();79 } else {80 var contents = [];81 for (var i = 0, o; (o = this.contents_[i]); i++) {82 if (o === this.switch || $.user.isPrototypeOf(o)) {83 contents.push(o);84 }85 }86 return contents;87 }88};89Object.setOwnerOf($.physicals['Challenge room'].getContents, $.physicals.Neil);90$.physicals['Challenge room'].description = function description() {91 return this.switch.state ? 'Can you solve the challenge?' : 'It\'s dark in here.';92};93Object.setOwnerOf($.physicals['Challenge room'].description, $.physicals.Neil);94$.physicals['Challenge room'].svgTextDay = '<line x1="-1000" y1="90" x2="1000" y2="90" />';95$.physicals['Challenge room'].svgText = function svgText() {96 return this.switch.state ? this.svgTextDay : this.svgTextNight;97};98Object.setOwnerOf($.physicals['Challenge room'].svgText, $.physicals.Neil);99$.physicals['light switch'] = $.physicals['Challenge room'].switch;100Object.setOwnerOf($.physicals['light switch'], $.physicals.Neil);101$.physicals['light switch'].name = 'light switch';102$.physicals['light switch'].location = $.physicals['Challenge room'];103$.physicals['light switch'].contents_ = [];104$.physicals['light switch'].contents_.forObj = $.physicals['light switch'];105Object.defineProperty($.physicals['light switch'].contents_, 'forObj', {writable: false, enumerable: false, configurable: false});106$.physicals['light switch'].contents_.forKey = 'contents_';107Object.defineProperty($.physicals['light switch'].contents_, 'forKey', {writable: false, enumerable: false, configurable: false});108$.physicals['light switch'].svgText = function svgText() {109 return this.state ? this.svgTextDay : this.svgTextNight;110};111Object.setOwnerOf($.physicals['light switch'].svgText, $.physicals.Neil);112Object.setOwnerOf($.physicals['light switch'].svgText.prototype, $.physicals.Maximilian);113$.physicals['light switch'].state = false;114$.physicals['light switch'].flip = function flip(newState, user) {115 var onOff = newState ? 'on' : 'off';116 if (this.state === newState) {117 user.narrate('The switch is already ' + onOff + '.');118 } else {119 this.state = newState;120 this.home.updateScene(true);121 user.narrate('You turn ' + onOff + ' the switch.');122 this.home.narrate(String(user) + ' turns ' + onOff + ' the switch.', user);123 }124};125Object.setOwnerOf($.physicals['light switch'].flip, $.physicals.Neil);126Object.setOwnerOf($.physicals['light switch'].flip.prototype, $.physicals.Neil);127$.physicals['light switch'].flipOn1 = function flipOn1(cmd) {128 this.flip(true, cmd.user);129};130Object.setOwnerOf($.physicals['light switch'].flipOn1, $.physicals.Maximilian);131Object.setOwnerOf($.physicals['light switch'].flipOn1.prototype, $.physicals.Maximilian);132$.physicals['light switch'].flipOn1.verb = 'flip|turn|switch';133$.physicals['light switch'].flipOn1.dobj = 'this';134$.physicals['light switch'].flipOn1.prep = 'on top of/on/onto/upon';135$.physicals['light switch'].flipOn1.iobj = 'none';136$.physicals['light switch'].flipOn2 = function flipOn2(cmd) {137 this.flip(true, cmd.user);138};139Object.setOwnerOf($.physicals['light switch'].flipOn2, $.physicals.Maximilian);140Object.setOwnerOf($.physicals['light switch'].flipOn2.prototype, $.physicals.Maximilian);141$.physicals['light switch'].flipOn2.verb = 'flip|turn|switch';142$.physicals['light switch'].flipOn2.dobj = 'none';143$.physicals['light switch'].flipOn2.prep = 'on top of/on/onto/upon';144$.physicals['light switch'].flipOn2.iobj = 'this';145$.physicals['light switch'].flipOff2 = function flipOff2(cmd) {146 this.flip(false, cmd.user);147};148Object.setOwnerOf($.physicals['light switch'].flipOff2, $.physicals.Maximilian);149Object.setOwnerOf($.physicals['light switch'].flipOff2.prototype, $.physicals.Maximilian);150$.physicals['light switch'].flipOff2.verb = 'flip|turn|switch';151$.physicals['light switch'].flipOff2.dobj = 'none';152$.physicals['light switch'].flipOff2.prep = 'off/off of';153$.physicals['light switch'].flipOff2.iobj = 'this';154$.physicals['light switch'].flipOff1 = function flipOff1(cmd) {155 this.flip(false, cmd.user);156};157Object.setOwnerOf($.physicals['light switch'].flipOff1, $.physicals.Maximilian);158Object.setOwnerOf($.physicals['light switch'].flipOff1.prototype, $.physicals.Maximilian);159$.physicals['light switch'].flipOff1.verb = 'flip|turn|switch';160$.physicals['light switch'].flipOff1.dobj = 'this';161$.physicals['light switch'].flipOff1.prep = 'off/off of';162$.physicals['light switch'].flipOff1.iobj = 'none';163$.physicals['light switch'].home = $.physicals['Challenge room'];164$.physicals['light switch'].svgTextNight = '<g transform="scale(0.7) translate(0, 20)">\n <rect class="fillGrey" height="25" width="15" x="0" y="30"/>\n <rect class="strokeWhite" height="12" width="7" x="4" y="36.5"/>\n <rect class="strokeBlack fillBlack" height="5" width="5" x="5" y="42.5"/>\n</g>';165$.physicals['light switch'].getCommands = function getCommands(who) {166 var commands = $.thing.getCommands.call(this, who);167 if (this.state) {168 commands.push('turn off ' + String(this));169 } else {170 commands.push('turn on ' + String(this));171 }172 return commands;173};174Object.setOwnerOf($.physicals['light switch'].getCommands, $.physicals.Neil);175Object.setOwnerOf($.physicals['light switch'].getCommands.prototype, $.physicals.Maximilian);176$.physicals['light switch'].aliases = [];177Object.setOwnerOf($.physicals['light switch'].aliases, $.physicals.Maximilian);178$.physicals['light switch'].aliases[0] = 'lightswitch';179$.physicals['light switch'].aliases[1] = 'switch';180$.physicals['light switch'].movable = false;181$.physicals['light switch'].svgTextDay = '<g transform="scale(0.7) translate(0, 20)">\n<rect class="fillWhite" height="25" width="15" x="0" y="30"/>\n<rect class="strokeGrey" height="12" width="7" x="4" y="36.5"/>\n<rect class="strokeBlack fillBlack" height="5" width="5" x="5" y="37.5"/>\n</g>';182$.physicals.chest = $.physicals['Challenge room'].chest;183Object.setOwnerOf($.physicals.chest, $.physicals.Neil);184$.physicals.chest.name = 'chest';185$.physicals.chest.location = $.physicals['Challenge room'];186$.physicals.chest.contents_ = [];187$.physicals.chest.contents_[0] = $.physicals.chest.location.safe;188$.physicals.chest.contents_.forObj = $.physicals.chest;189Object.defineProperty($.physicals.chest.contents_, 'forObj', {writable: false, enumerable: false, configurable: false});190$.physicals.chest.contents_.forKey = 'contents_';191Object.defineProperty($.physicals.chest.contents_, 'forKey', {writable: false, enumerable: false, configurable: false});192$.physicals.chest.svgTextClosed = '<path class="fillWhite" d="m8.78171,99.14543l12.33676,-7.40208l0,-26.08348l-12.33676,7.40204l0,26.08352z"/>\n<rect class="fillWhite" height="26.08352" width="42.65004" x="-33.86834" y="73.06191"/>\n<path class="fillWhite" d="m8.78171,73.06191c0.012,-5.65236 4.56828,-12.11368 8.04808,-12.25748l-42.65004,0c-3.47988,0.14376 -8.03608,6.60512 -8.04808,12.25748l42.65004,0z"/>\n<path class="fillWhite" d="m8.78171,73.06191c0.012,-5.65236 4.56828,-12.11368 8.04808,-12.25748c2.01644,-0.08336 4.22136,-0.01604 4.28868,4.85544l-12.33676,7.40204z"/>\n<rect class="fillWhite" height="7.30404" width="5.35632" x="-15.22148" y="70.20479"/>\n';193$.physicals.chest.svgTextOpen = '<rect class="fillGrey" height="26.08352" width="42.65004" x="-31.15279" y="65.38134"/>\n<path class="fillWhite" d="m-0.83951,98.86694l12.33676,-7.40208l0,-26.08348l-12.33676,7.40208l0,26.08348z"/>\n<path class="fillGrey" d="m-43.48955,72.78346l12.33676,-7.40208l0,26.08348l-12.33676,7.40208l0,-26.08348z"/>\n<path class="fillGrey" d="m-31.15279,65.38134l42.65004,0m0,0l-10.5744,-17.624l-42.65004,0l10.5744,17.624"/>\n<path class="fillWhite" d="m0.92285,47.75738c11.34116,-0.37904 15.45816,10.68644 10.5744,17.624l-10.5744,-17.624z"/>\n<path class="fillGrey" d="m-41.72719,47.75738c11.34116,-0.37904 15.45816,10.68644 10.5744,17.624l-10.5744,-17.624z"/>\n<rect class="fillWhite" height="26.08352" width="42.65004" x="-43.48956" y="72.78346"/>\n';194$.physicals.chest.isOpen = false;195$.physicals.chest.description = 'A steamer chest with a very heavy lid.';196$.physicals.chest.TIME = 5000;197$.physicals.chest.lastTime_ = 1597444509970;198$.physicals.chest.lastUser_ = $.physicals.Neil;199$.physicals.chest.open = function open(cmd) {200 if (this.isOpen) {201 cmd.user.narrate($.utils.string.capitalize(String(cmd.dobj)) + ' is already open.');202 return;203 }204 if (this.location !== cmd.user.location && this.location !== cmd.user) {205 cmd.user.narrate($.utils.string.capitalize(String(cmd.dobj)) + ' is not here.');206 return;207 }208 if (this.lastUser_ === cmd.user || this.lastTime_ + this.TIME < Date.now()) {209 cmd.user.narrate('You try to open the chest, but the lid is too heavy for one person.');210 if (cmd.user.location) {211 cmd.user.location.narrate(String(cmd.user) + ' tries to open the chest, but the lid is too heavy for one person.', cmd.user);212 }213 this.lastUser_ = cmd.user;214 this.lastTime_ = Date.now();215 return;216 }217 if (!this.setOpen(true)) {218 cmd.user.narrate('You can\'t open ' + String(cmd.dobj));219 return;220 }221 if (cmd.user.location) {222 cmd.user.location.narrate(String(cmd.user) + ' helps ' + String(this.lastUser_.name) + ' to opens ' + String(cmd.dobj) + '.', cmd.user);223 }224 cmd.user.narrate('You help ' + String(this.lastUser_) + ' to open ' + String(cmd.dobj) + '.');225 this.look(cmd);226 this.lastUser_ = null;227 this.lastTime_ = 0;228};229Object.setOwnerOf($.physicals.chest.open, $.physicals.Neil);230Object.setOwnerOf($.physicals.chest.open.prototype, $.physicals.Maximilian);231$.physicals.chest.open.verb = 'open';232$.physicals.chest.open.dobj = 'this';233$.physicals.chest.open.prep = 'none';234$.physicals.chest.open.iobj = 'none';235$.physicals.chest.movable = false;236$.physicals.chest.toFloor = true;237$.physicals.chest.setOpen = function setOpen(newState) {238 this.isOpen = Boolean(newState);239 if ($.room.isPrototypeOf(this.location)) {240 this.location.updateScene(true);241 }242 return true;243};244Object.setOwnerOf($.physicals.chest.setOpen, $.physicals.Neil);245Object.setOwnerOf($.physicals.chest.setOpen.prototype, $.physicals.Maximilian);246$.physicals.safe = $.physicals.chest.location.safe;247Object.setOwnerOf($.physicals.safe, $.physicals.Neil);248$.physicals.safe.name = 'safe';249$.physicals.safe.location = $.physicals.chest;250$.physicals.safe.contents_ = [];251$.physicals.safe.contents_[0] = $.physicals.chest.location.food;252$.physicals.safe.contents_.forObj = $.physicals.safe;253Object.defineProperty($.physicals.safe.contents_, 'forObj', {writable: false, enumerable: false, configurable: false});254$.physicals.safe.contents_.forKey = 'contents_';255Object.defineProperty($.physicals.safe.contents_, 'forKey', {writable: false, enumerable: false, configurable: false});256$.physicals.safe.isOpen = false;257$.physicals.safe.description = 'The safe is secured with a three digit combination: open safe with xxx';258$.physicals.safe.open = function open(cmd) {259 cmd.user.narrate('You need a three-digit combination to open the safe: open ' + String(cmd.dobj) + ' with xxx');260};261Object.setOwnerOf($.physicals.safe.open, $.physicals.Maximilian);262Object.setOwnerOf($.physicals.safe.open.prototype, $.physicals.Maximilian);263$.physicals.safe.open.verb = 'open';264$.physicals.safe.open.dobj = 'this';265$.physicals.safe.open.prep = 'none';266$.physicals.safe.open.iobj = 'none';267$.physicals.safe.openWith = function openWith(cmd) {268 if (this.isOpen) {269 cmd.user.narrate($.utils.string.capitalize(String(cmd.dobj)) + ' is already open.');270 return;271 }272 if (this.location !== cmd.user.location && this.location !== cmd.user) {273 cmd.user.narrate($.utils.string.capitalize(String(cmd.dobj)) + ' is not here.');274 return;275 }276 if (!this.setOpen(true, cmd.iobjstr)) {277 cmd.user.narrate('"' + cmd.iobjstr + '" is not the correct combination.');278 return;279 }280 if (cmd.user.location) {281 cmd.user.location.narrate(cmd.user.name + ' opens ' + String(cmd.dobj) + '.', cmd.user);282 }283 cmd.user.narrate('You open ' + String(cmd.dobj) + '.');284 this.look(cmd);285};286Object.setOwnerOf($.physicals.safe.openWith, $.physicals.Maximilian);287Object.setOwnerOf($.physicals.safe.openWith.prototype, $.physicals.Maximilian);288$.physicals.safe.openWith.verb = 'open';289$.physicals.safe.openWith.dobj = 'this';290$.physicals.safe.openWith.prep = 'with/using';291$.physicals.safe.openWith.iobj = 'any';292$.physicals.safe.setOpen = function setOpen(newState, combo) {293 if (newState && this.combo !== $.utils.string.hash('md5', String(combo))) {294 return false;295 }296 return $.container.setOpen.call(this, newState);297};298Object.setOwnerOf($.physicals.safe.setOpen, $.physicals.Neil);299Object.setOwnerOf($.physicals.safe.setOpen.prototype, $.physicals.Maximilian);300$.physicals.safe.combo = 'e94550c93cd70fe748e6982b3439ad3b';301$.physicals.safe.svgTextClosed = '<path class="fillWhite" d="m0,80l10,-10l20,0l0,20l-10,10"/>\n<line x1="20" x2="30" y1="80" y2="70"/>\n<rect class="fillWhite" height="20" width="20" x="0" y="80"/>\n<circle class="fillWhite" cx="10" cy="90" fill-opacity="null" r="4"/>\n<circle class="fillWhite" cx="10" cy="90" fill-opacity="null" r="2"/>';302$.physicals.safe.svgTextOpen = '<rect class="fillGrey" height="20" width="20" x="0" y="65"/>\n<path class="fillGrey" d="m0,85l-10,10l0,-20l10,-10l0,20z"/>\n<path class="fillWhite" d="m0,65l-10,10l20,0l10,-10l-20,0z"/>\n<path class="fillGrey" d="m0,85l-10,10l20,0l10,-10l-20,0z"/>\n<path class="fillWhite" d="m20,85l-10,10l0,-20l10,-10l0,20z"/>\n<path class="fillWhite" d="m-10,95l-12.5,4.5l0,-20l12.5,-4.5l0,20z"/>';303$.physicals.safe.getCommands = function getCommands(who) {304 var commands = $.container.getCommands.call(this, who);305 commands.push('crack ' + String(this));306 return commands;307};308Object.setOwnerOf($.physicals.safe.getCommands, $.physicals.Neil);309Object.setOwnerOf($.physicals.safe.getCommands.prototype, $.physicals.Maximilian);310$.physicals.safe.crack = function crack(cmd) {311 cmd.user.narrate('The "crack" function has not been programmed. ' +312 'To do so, visit: https://google.codecity.world/blocklySafe');313 // API information: To open the safe with combo 123, use:314 // this.setOpen(true, 123);315 // Have fun!316};317Object.setOwnerOf($.physicals.safe.crack, $.physicals.Neil);318Object.setOwnerOf($.physicals.safe.crack.prototype, $.physicals.Neil);319$.physicals.safe.crack.verb = 'crack';320$.physicals.safe.crack.dobj = 'this';321$.physicals.safe.crack.prep = 'none';322$.physicals.safe.crack.iobj = 'none';323$.physicals.safe.crackReset = $.physicals.safe.crack;324$.physicals.safe.toFloor = true;325$.physicals.food = $.physicals.chest.location.food;326Object.setOwnerOf($.physicals.food, $.physicals.Neil);327$.physicals.food.name = 'food';328$.physicals.food.location = $.physicals.safe;329$.physicals.food.contents_ = [];330$.physicals.food.contents_.forObj = $.physicals.food;331Object.defineProperty($.physicals.food.contents_, 'forObj', {writable: false, enumerable: false, configurable: false});332$.physicals.food.contents_.forKey = 'contents_';333Object.defineProperty($.physicals.food.contents_, 'forKey', {writable: false, enumerable: false, configurable: false});334$.physicals.food.svgText = '<path d="M-7,80L-5,97C-5,100.5,5,100.5,5,97L7,80" class="fillWhite"/>\n<ellipse class="fillWhite" cx="0" cy="80" rx="7" ry="3"/>\n';335$.physicals.food.give = function give(cmd) {336 if (cmd.iobj !== this.girl) {337 return $.thing.give.call(this, cmd);338 }339 if (this.location !== cmd.user && this.location !== cmd.user.location) {340 cmd.user.narrate("You can't reach " + String(this) + ".");341 return;342 }343 cmd.user.narrate('You offer ' + String(this) + ' to ' + String(cmd.iobj) + '.');344 if (cmd.user.location) {345 cmd.user.location.narrate(346 String(cmd.user) + ' offers ' + String(this) + ' to ' + String(cmd.iobj) + '.',347 [cmd.user, cmd.iobj]);348 }349 var matches = $.utils.imageMatch.recog($.utils.object.getValue(this, 'svgText'));350 var ok = this.girl.foodList.includes(matches[0]);351 if (!ok) {352 this.girl.attempts++;353 }354 var name = matches[0] || 'nothing I\'ve ever seen before.';355 suspend(1);356 var text = 'It looks like a ' + name + '; ' +357 (ok ? 'delicious!'358 : (this.girl.attempts < 3 ?359 'I won\'t eat that!' :360 (Math.random() >= 0.5 ?361 'that won\'t keep the doctor away!' : 'some fruit would be nice!'362 )363 )364 );365 var alt = 'The girl says, "' + text +'"';366 var memo = {367 type: 'say',368 source: this.girl,369 where: this.girl.location,370 text: text,371 alt: alt372 };373 this.girl.location.sendMemo(memo);374 if (ok) {375 suspend(10);376 memo.text = 'Thank you so much. Congratulations on solving the challenge room. Don\'t forget to turn out the light when you leave.';377 memo.alt = 'The girl says, "' + text + '"';378 this.girl.location.sendMemo(memo);379 }380};381Object.setOwnerOf($.physicals.food.give, $.physicals.Neil);382Object.setOwnerOf($.physicals.food.give.prototype, $.physicals.Maximilian);383$.physicals.food.give.verb = 'give';384$.physicals.food.give.dobj = 'this';385$.physicals.food.give.prep = 'at/to';386$.physicals.food.give.iobj = 'any';387$.physicals.food.girl = $.physicals.chest.location.girl;388$.physicals.food.redraw = function inspect(cmd) {389 // Open this object in the SVG editor.390 var selector = $.Selector.for(this);391 if (!selector) {392 cmd.user.narrate('Unfortuantely the code editor does not know how to locate ' + String(this) + ' yet.');393 return;394 }395 var link = '/code?' + encodeURIComponent(String(selector) + '.svgText');396 cmd.user.readMemo({type: "link", href: link});397};398Object.setOwnerOf($.physicals.food.redraw, $.physicals.Neil);399Object.setOwnerOf($.physicals.food.redraw.prototype, $.physicals.Neil);400$.physicals.food.redraw.verb = 'redraw';401$.physicals.food.redraw.dobj = 'this';402$.physicals.food.redraw.prep = 'none';403$.physicals.food.redraw.iobj = 'none';404$.physicals.food.getCommands = function getCommands(who) {405 var commands = $.thing.getCommands.call(this, who);406 commands.push('redraw ' + this.name);407 commands.push('give ' + this.name + ' to girl');408 return commands;409};410Object.setOwnerOf($.physicals.food.getCommands, $.physicals.Neil);411Object.setOwnerOf($.physicals.food.getCommands.prototype, $.physicals.Maximilian);412$.physicals.food.svgTextReset = '<path d="M-7,80L-5,97C-5,100.5,5,100.5,5,97L7,80" class="fillWhite"/>\n<ellipse class="fillWhite" cx="0" cy="80" rx="7" ry="3"/>\n';413$.physicals.girl = $.physicals.food.girl;414Object.setOwnerOf($.physicals.girl, $.physicals.Neil);415$.physicals.girl.name = 'girl';416$.physicals.girl.location = $.physicals.chest.location;417$.physicals.girl.contents_ = [];418$.physicals.girl.contents_.forObj = $.physicals.girl;419Object.defineProperty($.physicals.girl.contents_, 'forObj', {writable: false, enumerable: false, configurable: false});420$.physicals.girl.contents_.forKey = 'contents_';421Object.defineProperty($.physicals.girl.contents_, 'forKey', {writable: false, enumerable: false, configurable: false});422$.physicals.girl.description = 'She looks REALLY hungry.';423$.physicals.girl.svgText = ' <path class="strokeBlack fillWhite" d="m2.453,58.76115c0.73095,3.31014 -2.35649,7.10927 -5.354,8.76109c-3.17381,1.74899 -7.60044,1.39996 -10.87024,-0.16224c-3.89018,-1.8586 -4.25816,-7.46777 -1.78467,-11.27585c4.68192,-6.68127 17.99054,-3.7308 18.00891,2.677z"/>\n <path class="strokeBlack" d="m-16.09721,99.2163c3.36481,-7.19263 6.5246,-13.66499 10.11895,-18.35067"/>\n <path class="strokeBlack" d="m-0.44477,99.64677c-9.09273,-22.01297 -4.01634,-23.24778 -4.74121,-31.69803"/>\n <path class="strokeBlack" d="m-13.91994,82.09774c2.68081,-3.84038 5.03799,-6.45099 8.73396,-14.149"/>\n <path class="strokeBlack" d="m0.06683,83.05226c-1.60238,-5.21011 -3.01935,-10.5245 -5.25281,-15.10352"/>\n <path d="m-14.01461,54.54284c0.75415,1.15486 2.0631,1.98765 3.24485,2.67701c0.47974,0.27984 0.94301,0.68546 1.46019,0.89233c0.31757,0.12703 0.65772,0.19293 0.97345,0.32448c1.07714,0.44881 2.08283,1.16779 3.24485,1.37907c0.13302,0.02418 0.27123,-0.01492 0.40561,0c0.38566,0.04285 0.77922,0.24336 1.13569,0.24336"/>\n <path d="m-5.9836,52.51481c0.74483,-0.31304 1.53299,-0.30212 2.27139,-0.48672c0.15429,-0.03857 0.42557,0.07114 0.56785,0c0.12707,-0.06354 0.48109,-0.16506 0.64897,-0.08112c0.14832,0.07416 0.35064,0.22242 0.48673,0.32448c0.43016,0.32262 0.44211,0.88422 0.64897,1.29794c0.03303,0.06607 0.08112,0.58378 0.08112,0.40561"/>\n <path d="m1.31731,62.33048c0.43264,0.45969 1.2145,0.75334 1.29794,1.37906c0.06323,0.4742 -0.6672,0.68707 -0.97346,1.05458c-0.10094,0.12113 -0.18125,0.26068 -0.24336,0.40561c-0.29413,0.68629 1.28191,-0.86126 1.05457,0.73009c-0.06209,0.43463 -0.21269,0.45803 -0.16224,0.81121c0.03529,0.24702 0.29281,0.64509 0.24336,0.89233c-0.06369,0.31844 -0.29802,0.38001 -0.4056,0.64897c-0.09622,0.24055 0.10639,0.37236 0.16224,0.56785c0.06686,0.234 0.04773,0.49145 0,0.73009c-0.02668,0.13339 -0.264,0.52658 -0.16224,0.73009c0.15102,0.30205 0.24336,0.5276 0.24336,0.89234"/>\n <path d="m-0.224,64.03403c-0.10816,1.5413 -0.35309,3.07908 -0.32448,4.62391c0.0054,0.28999 0.79206,-0.74774 0.97345,-0.32448c0.06479,0.15118 0.0122,0.33738 0.08112,0.48672c0.26892,0.58265 0.56113,0.66686 1.05458,1.05458c0.16606,0.13048 0.35707,0.2389 0.48672,0.40561c0.39433,0.50698 -0.33175,0.90203 -0.56784,1.21681c-0.01622,0.02164 0.01913,0.062 0,0.08112c-0.01913,0.01913 -0.10574,0.01119 -0.08112,0c0.32001,-0.14546 0.64897,-0.2704 0.97345,-0.4056"/>\n <path d="m-12.31106,54.3806c0.10816,0.78417 0.15276,1.57977 0.32448,2.35252c0.14503,0.65262 0.78935,1.03271 1.21682,1.46018c0.89247,0.89247 1.60741,2.10315 2.83925,2.59588c0.52708,0.21083 1.08387,0.32516 1.62242,0.48673c0.13948,0.04184 0.26282,0.13368 0.40561,0.16224c0.208,0.0416 0.44096,-0.0416 0.64897,0c0.05929,0.01185 0.1026,0.07118 0.16224,0.08112c0.74304,0.12384 1.98436,-0.17316 2.677,0c0.2974,0.07435 0.57553,0.24336 0.89233,0.24336"/>\n <path d="m-9.55294,52.59594c0.84943,1.18919 1.80426,3.05911 3.16373,4.05606c0.63617,0.46652 1.49601,0.62632 2.19027,0.97345c0.5421,0.27105 1.04109,0.69855 1.62243,0.89234c0.1308,0.0436 0.2748,0.03752 0.40561,0.08112c0.02837,0.0095 1.28554,0.55545 1.29793,0.56784c0.01913,0.01913 -0.02704,0.08112 0,0.08112c0.02704,0 0,-0.05408 0,-0.08112"/>\n <path d="m-5.9836,52.51481c1.12593,1.36843 2.49316,2.58149 3.97494,3.56934c0.48793,0.32528 1.36995,0.8021 1.78466,1.21682c0.33582,0.33581 0.60781,0.77004 0.89234,1.05457"/>\n <path d="m-11.33761,53.08266c1.71049,2.44802 3.93723,3.65235 6.24634,5.19176c0.14712,0.09808 1.56809,1.18927 1.62242,1.29794c0.02418,0.04837 -0.03824,0.124 0,0.16224c0.08847,0.08847 0.28927,0.20814 0.40561,0.32449c0.05408,0.05408 0.23796,0.17306 0.16224,0.16224c-0.22074,-0.03153 -0.43264,-0.10816 -0.64897,-0.16224"/>\n <path d="m-10.73298,52.87959c0.89005,0.11134 1.65855,0.54411 2.35602,0.91623c0.73717,0.3933 1.519,0.72961 2.19895,1.28272c0.68926,0.56068 1.27485,1.23876 1.88482,1.88482c0.62557,0.66258 0.9644,1.39162 1.58189,1.95096l0.35249,0.66021l0.56998,0.67853"/>\n <path d="m-11.51833,53.9267c0.31414,0.81536 1.01217,1.3372 1.71972,1.88482c0.68395,0.52935 1.34166,1.11774 2.10227,1.52496c0.75403,0.40369 1.63512,0.53793 2.48691,0.83665c0.81962,0.28743 1.57976,0.69046 2.35602,0.98922c0.79129,0.30455 1.49215,0.80729 2.34363,1.06204l0.58412,0.50859"/>\n <path d="m-7.32985,52.6178c0.99476,0.3637 1.84934,0.61397 2.46191,1.13805c0.72862,0.62335 1.26086,1.25095 1.83128,1.95759c0.56185,0.69602 0.9057,1.57104 1.36405,2.29703c0.4745,0.75157 0.87135,1.49733 0.88726,2.35602c0.01697,0.91607 -0.45528,1.8844 0.00118,2.70755c0.39036,0.70396 1.73213,0.62234 2.07072,1.39856c0.35303,0.80931 -0.24322,1.61348 -0.62666,2.41222c-0.3626,0.75533 -0.23298,1.59712 0.13922,2.23891c0.41908,0.72262 0.24799,1.68778 -0.17086,2.24032l-0.36645,0.42164"/>\n <path d="m-4.18849,53.14136c1.04712,0.30541 1.68764,0.85101 2.43455,1.38744c0.69793,0.50125 1.39936,1.12401 1.49215,1.95497c0.10322,0.92445 0.05804,1.80531 0,2.70855c-0.05579,0.86819 -0.58125,1.83307 -0.20942,2.30401c0.54283,0.68753 1.93388,0.40047 2.29424,1.17382c0.37992,0.81533 -0.14714,1.82877 -0.77592,2.46946c-0.60234,0.61375 -1.59314,0.68797 -2.20663,1.30017c-0.51848,0.51739 0.27888,1.25655 1.02862,1.75938l0.41501,0.67133l0.23944,0.80663l0,0.8726"/>\n <path d="m-8.11519,53.66492c1.07749,0 1.99914,0.03017 2.75415,0.39812c0.79851,0.38915 1.5245,0.88042 2.20589,1.42055c0.66151,0.52436 1.28744,1.11145 1.90419,1.55266c0.68114,0.48727 1.46063,0.84077 1.77334,1.51017c0.3778,0.80873 -0.04902,1.79345 0.26414,2.54066c0.28977,0.6914 0.73924,1.32269 0.9346,2.16178c0.20276,0.87092 -0.41037,1.95579 0.11134,2.6274c0.28441,0.36613 0.90021,0.90364 1.03216,1.74153c0.13587,0.86279 0.01492,1.78007 -0.41627,2.46191l-0.3541,0.69324l0,0.87627"/>\n <path d="m-10.73299,53.9267c1.07714,0 1.96335,0 2.87958,0c0.87627,0 1.65156,0.3908 2.43338,0.52356c0.88278,0.14991 1.795,-0.15591 2.67134,0c0.74723,0.13295 1.48342,0.52356 2.31863,0.61588l0.69184,0.39943"/>\n <path d="m-10.99477,54.45026c0.91623,0 1.79642,-0.13239 2.69633,0c0.79007,0.11623 1.67562,0.02064 2.53927,0.26178c0.76641,0.21399 1.41629,0.85779 2.0199,1.33124c0.61388,0.48152 1.47675,0.50122 2.35567,0.50122c0.91802,0 1.83448,-0.05702 2.43617,0.39267c0.55872,0.41758 0.51811,1.34747 0.51811,2.2401c0,0.88172 0.34046,1.55133 0.74171,2.29742c0.38559,0.71698 0.56579,1.50296 0.56719,2.41344c0.0013,0.84869 0,1.76632 0,2.65637c0,0.89005 0,1.78011 0,2.66737l0.22997,0.68342"/>\n <path d="m-12.30367,54.71204c0.51693,0.63491 1.08044,1.19886 1.58565,1.74014c0.52846,0.5662 0.98368,1.23125 1.56235,1.81344c0.59642,0.60005 1.25942,1.18218 1.93717,1.42024c0.85293,0.29959 1.6166,0.34467 2.30262,0.52356c0.81872,0.2135 1.74605,0.10109 2.42897,0.52356c0.64377,0.39825 1.26623,1.01143 1.43861,1.75511c0.2007,0.86587 -0.00998,1.77671 -0.16828,2.60284c-0.16169,0.84379 -0.51695,1.63445 -0.3541,2.50628c0.13298,0.71191 0.52321,1.43839 0.6349,2.28866l0.19407,0.75114l0.40558,0.56718l0.33613,0.61588"/>\n';424$.physicals.girl.get = function get(cmd) {425 cmd.user.narrate('That\'s probably not appropriate.');426 if (cmd.user.location) {427 cmd.user.location.narrate(String(cmd.user) + ' tries to pick up ' + String(this) + '.', cmd.user);428 }429};430Object.setOwnerOf($.physicals.girl.get, $.physicals.Neil);431Object.setOwnerOf($.physicals.girl.get.prototype, $.physicals.Maximilian);432$.physicals.girl.get.verb = 'get|take';433$.physicals.girl.get.dobj = 'this';434$.physicals.girl.get.prep = 'none';435$.physicals.girl.get.iobj = 'none';436$.physicals.girl.food = $.physicals.food;437$.physicals.girl.foodList = [];438$.physicals.girl.foodList[0] = 'Açaí';439$.physicals.girl.foodList[1] = 'Ackee';440$.physicals.girl.foodList[2] = 'Apple';441$.physicals.girl.foodList[3] = 'Apricot';442$.physicals.girl.foodList[4] = 'Avocado';443$.physicals.girl.foodList[5] = 'Banana';444$.physicals.girl.foodList[6] = 'Bilberry';445$.physicals.girl.foodList[7] = 'Blackberry';446$.physicals.girl.foodList[8] = 'Blackcurrant';447$.physicals.girl.foodList[9] = 'Black sapote';448$.physicals.girl.foodList[10] = 'Blueberry';449$.physicals.girl.foodList[11] = 'Boysenberry';450$.physicals.girl.foodList[12] = 'Breadfruit';451$.physicals.girl.foodList[13] = "Buddha's hand";452$.physicals.girl.foodList[14] = 'Cactus pear';453$.physicals.girl.foodList[15] = 'Crab apple';454$.physicals.girl.foodList[16] = 'Currant';455$.physicals.girl.foodList[17] = 'Cherry';456$.physicals.girl.foodList[18] = 'Cherimoya';457$.physicals.girl.foodList[19] = 'Chico fruit';458$.physicals.girl.foodList[20] = 'Cloudberry';459$.physicals.girl.foodList[21] = 'Coconut';460$.physicals.girl.foodList[22] = 'Cranberry';461$.physicals.girl.foodList[23] = 'Damson';462$.physicals.girl.foodList[24] = 'Date';463$.physicals.girl.foodList[25] = 'Dragonfruit';464$.physicals.girl.foodList[26] = 'Durian';465$.physicals.girl.foodList[27] = 'Elderberry';466$.physicals.girl.foodList[28] = 'Feijoa';467$.physicals.girl.foodList[29] = 'Fig';468$.physicals.girl.foodList[30] = 'Goji berry';469$.physicals.girl.foodList[31] = 'Gooseberry';470$.physicals.girl.foodList[32] = 'Grape';471$.physicals.girl.foodList[33] = 'Grewia asiatica';472$.physicals.girl.foodList[34] = 'Raisin';473$.physicals.girl.foodList[35] = 'Grapefruit';474$.physicals.girl.foodList[36] = 'Guava';475$.physicals.girl.foodList[37] = 'Hala Fruit';476$.physicals.girl.foodList[38] = 'Honeyberry';477$.physicals.girl.foodList[39] = 'Huckleberry';478$.physicals.girl.foodList[40] = 'Jabuticaba';479$.physicals.girl.foodList[41] = 'Jackfruit';480$.physicals.girl.foodList[42] = 'Jambul';481$.physicals.girl.foodList[43] = 'Japanese plum';482$.physicals.girl.foodList[44] = 'Jostaberry';483$.physicals.girl.foodList[45] = 'Jujube';484$.physicals.girl.foodList[46] = 'Juniper berry';485$.physicals.girl.foodList[47] = 'Kiwano';486$.physicals.girl.foodList[48] = 'Kiwifruit';487$.physicals.girl.foodList[49] = 'Kumquat';488$.physicals.girl.foodList[50] = 'Lemon';489$.physicals.girl.foodList[51] = 'Lime';490$.physicals.girl.foodList[52] = 'Loganberry';491$.physicals.girl.foodList[53] = 'Loquat';492$.physicals.girl.foodList[54] = 'Longan';493$.physicals.girl.foodList[55] = 'Lychee';494$.physicals.girl.foodList[56] = 'Mango';495$.physicals.girl.foodList[57] = 'Mangosteen';496$.physicals.girl.foodList[58] = 'Marionberry';497$.physicals.girl.foodList[59] = 'Melon';498$.physicals.girl.foodList[60] = 'Cantaloupe';499$.physicals.girl.foodList[61] = 'Galia melon';500$.physicals.girl.foodList[62] = 'Honeydew';501$.physicals.girl.foodList[63] = 'Watermelon';502$.physicals.girl.foodList[64] = 'Miracle fruit';503$.physicals.girl.foodList[65] = 'Monstera Delisiousa';504$.physicals.girl.foodList[66] = 'Mulberry';505$.physicals.girl.foodList[67] = 'Nance';506$.physicals.girl.foodList[68] = 'Nectarine';507$.physicals.girl.foodList[69] = 'Orange';508$.physicals.girl.foodList[70] = 'Blood orange';509$.physicals.girl.foodList[71] = 'Clementine';510$.physicals.girl.foodList[72] = 'Mandarine';511$.physicals.girl.foodList[73] = 'Tangerine';512$.physicals.girl.foodList[74] = 'Papaya';513$.physicals.girl.foodList[75] = 'Passionfruit';514$.physicals.girl.foodList[76] = 'Peach';515$.physicals.girl.foodList[77] = 'Pear';516$.physicals.girl.foodList[78] = 'Persimmon';517$.physicals.girl.foodList[79] = 'Plantain';518$.physicals.girl.foodList[80] = 'Plum';519$.physicals.girl.foodList[81] = 'Prune';520$.physicals.girl.foodList[82] = 'Pineapple';521$.physicals.girl.foodList[83] = 'Pineberry';522$.physicals.girl.foodList[84] = 'Plumcot';523$.physicals.girl.foodList[85] = 'Pomegranate';524$.physicals.girl.foodList[86] = 'Pomelo';525$.physicals.girl.foodList[87] = 'Purple mangosteen';526$.physicals.girl.foodList[88] = 'Quince';527$.physicals.girl.foodList[89] = 'Raspberry';528$.physicals.girl.foodList[90] = 'Salmonberry';529$.physicals.girl.foodList[91] = 'Rambutan';530$.physicals.girl.foodList[92] = 'Redcurrant';531$.physicals.girl.foodList[93] = 'Salal berry';532$.physicals.girl.foodList[94] = 'Salak';533$.physicals.girl.foodList[95] = 'Satsuma';534$.physicals.girl.foodList[96] = 'Soursop';535$.physicals.girl.foodList[97] = 'Star apple';536$.physicals.girl.foodList[98] = 'Star fruit';537$.physicals.girl.foodList[99] = 'Strawberry';538$.physicals.girl.foodList[100] = 'Surinam cherry';539$.physicals.girl.foodList[101] = 'Tamarillo';540$.physicals.girl.foodList[102] = 'Tamarind';541$.physicals.girl.foodList[103] = 'Tangelo';542$.physicals.girl.foodList[104] = 'Tayberry';543$.physicals.girl.foodList[105] = 'Ugli fruit';544$.physicals.girl.foodList[106] = 'White currant';545$.physicals.girl.foodList[107] = 'White sapote';546$.physicals.girl.foodList[108] = 'Yuzu';547$.physicals.girl.foodList[109] = 'Bell pepper';548$.physicals.girl.foodList[110] = 'Chile pepper';549$.physicals.girl.foodList[111] = 'Corn kernel';550$.physicals.girl.foodList[112] = 'Cucumber';551$.physicals.girl.foodList[113] = 'Eggplant';552$.physicals.girl.foodList[114] = 'Jalapeño';553$.physicals.girl.foodList[115] = 'Olive';554$.physicals.girl.foodList[116] = 'Pea';555$.physicals.girl.foodList[117] = 'Pumpkin';556$.physicals.girl.foodList[118] = 'Squash';557$.physicals.girl.foodList[119] = 'Tomato';558$.physicals.girl.foodList[120] = 'Zucchini';559$.physicals.girl.foodList[121] = 'asparagus';560$.physicals.girl.foodList[122] = 'apple';561$.physicals.girl.foodList[123] = 'avocado';562$.physicals.girl.foodList[124] = 'alfalfa';563$.physicals.girl.foodList[125] = 'almond';564$.physicals.girl.foodList[126] = 'arugula';565$.physicals.girl.foodList[127] = 'artichoke';566$.physicals.girl.foodList[128] = 'applesauce';567$.physicals.girl.foodList[129] = 'antelope';568$.physicals.girl.foodList[130] = 'bruscetta';569$.physicals.girl.foodList[131] = 'bacon';570$.physicals.girl.foodList[132] = 'black beans';571$.physicals.girl.foodList[133] = 'bagels';572$.physicals.girl.foodList[134] = 'baked beans';573$.physicals.girl.foodList[135] = 'bbq';574$.physicals.girl.foodList[136] = 'bison';575$.physicals.girl.foodList[137] = 'barley';576$.physicals.girl.foodList[138] = 'beer';577$.physicals.girl.foodList[139] = 'bisque';578$.physicals.girl.foodList[140] = 'bluefish';579$.physicals.girl.foodList[141] = 'bread';580$.physicals.girl.foodList[142] = 'broccoli';581$.physicals.girl.foodList[143] = 'buritto';582$.physicals.girl.foodList[144] = 'babaganoosh';583$.physicals.girl.foodList[145] = 'cabbage';584$.physicals.girl.foodList[146] = 'cake';585$.physicals.girl.foodList[147] = 'carrots';586$.physicals.girl.foodList[148] = 'carne asada';587$.physicals.girl.foodList[149] = 'celery';588$.physicals.girl.foodList[150] = 'cheese';589$.physicals.girl.foodList[151] = 'chicken';590$.physicals.girl.foodList[152] = 'catfish';591$.physicals.girl.foodList[153] = 'cheeseburger';592$.physicals.girl.foodList[154] = 'chips';593$.physicals.girl.foodList[155] = 'chocolate';594$.physicals.girl.foodList[156] = 'chowder';595$.physicals.girl.foodList[157] = 'clams';596$.physicals.girl.foodList[158] = 'coffee';597$.physicals.girl.foodList[159] = 'cookie';598$.physicals.girl.foodList[160] = 'corn';599$.physicals.girl.foodList[161] = 'cupcake';600$.physicals.girl.foodList[162] = 'crab';601$.physicals.girl.foodList[163] = 'curry';602$.physicals.girl.foodList[164] = 'cereal';603$.physicals.girl.foodList[165] = 'chimichanga';604$.physicals.girl.foodList[166] = 'dates';605$.physicals.girl.foodList[167] = 'dips';606$.physicals.girl.foodList[168] = 'duck';607$.physicals.girl.foodList[169] = 'dumpling';608$.physicals.girl.foodList[170] = 'donuts';609$.physicals.girl.foodList[171] = 'eggs';610$.physicals.girl.foodList[172] = 'enchilada';611$.physicals.girl.foodList[173] = 'eggroll';612$.physicals.girl.foodList[174] = 'english muffin';613$.physicals.girl.foodList[175] = 'edamame';614$.physicals.girl.foodList[176] = 'eel sushi';615$.physicals.girl.foodList[177] = 'fajita';616$.physicals.girl.foodList[178] = 'falafel';617$.physicals.girl.foodList[179] = 'fish';618$.physicals.girl.foodList[180] = 'franks';619$.physicals.girl.foodList[181] = 'fondu';620$.physicals.girl.foodList[182] = 'french toast';621$.physicals.girl.foodList[183] = 'french dip';622$.physicals.girl.foodList[184] = 'garlic';623$.physicals.girl.foodList[185] = 'ginger';624$.physicals.girl.foodList[186] = 'gnocchi';625$.physicals.girl.foodList[187] = 'goose';626$.physicals.girl.foodList[188] = 'granola';627$.physicals.girl.foodList[189] = 'grapes';628$.physicals.girl.foodList[190] = 'green beans';629$.physicals.girl.foodList[191] = 'guacamole';630$.physicals.girl.foodList[192] = 'gumbo';631$.physicals.girl.foodList[193] = 'grits';632$.physicals.girl.foodList[194] = 'graham crackers';633$.physicals.girl.foodList[195] = 'ham';634$.physicals.girl.foodList[196] = 'halibut';635$.physicals.girl.foodList[197] = 'hamburger';636$.physicals.girl.foodList[198] = 'honey';637$.physicals.girl.foodList[199] = 'huenos rancheros';638$.physicals.girl.foodList[200] = 'hash browns';639$.physicals.girl.foodList[201] = 'hot dogs';640$.physicals.girl.foodList[202] = 'haiku roll';641$.physicals.girl.foodList[203] = 'hummus';642$.physicals.girl.foodList[204] = 'ice cream';643$.physicals.girl.foodList[205] = 'irish stew';644$.physicals.girl.foodList[206] = 'indian food';645$.physicals.girl.foodList[207] = 'italian bread';646$.physicals.girl.foodList[208] = 'jambalaya';647$.physicals.girl.foodList[209] = 'jelly';648$.physicals.girl.foodList[210] = 'jam';649$.physicals.girl.foodList[211] = 'jerky';650$.physicals.girl.foodList[212] = 'jalapeño';651$.physicals.girl.foodList[213] = 'kale';652$.physicals.girl.foodList[214] = 'kabobs';653$.physicals.girl.foodList[215] = 'ketchup';654$.physicals.girl.foodList[216] = 'kiwi';655$.physicals.girl.foodList[217] = 'kidney beans';656$.physicals.girl.foodList[218] = 'kingfish';657$.physicals.girl.foodList[219] = 'lobster';658$.physicals.girl.foodList[220] = 'lamb';659$.physicals.girl.foodList[221] = 'linguine';660$.physicals.girl.foodList[222] = 'lasagna';661$.physicals.girl.foodList[223] = 'meatballs';662$.physicals.girl.foodList[224] = 'moose';663$.physicals.girl.foodList[225] = 'milk';664$.physicals.girl.foodList[226] = 'milkshake';665$.physicals.girl.foodList[227] = 'noodles';666$.physicals.girl.foodList[228] = 'ostrich';667$.physicals.girl.foodList[229] = 'pizza';668$.physicals.girl.foodList[230] = 'pepperoni';669$.physicals.girl.foodList[231] = 'porter';670$.physicals.girl.foodList[232] = 'pancakes';671$.physicals.girl.foodList[233] = 'quesadilla';672$.physicals.girl.foodList[234] = 'quiche';673$.physicals.girl.foodList[235] = 'reuben';674$.physicals.girl.foodList[236] = 'spinach';675$.physicals.girl.foodList[237] = 'spaghetti';676$.physicals.girl.foodList[238] = 'tater tots';677$.physicals.girl.foodList[239] = 'toast';678$.physicals.girl.foodList[240] = 'venison';679$.physicals.girl.foodList[241] = 'waffles';680$.physicals.girl.foodList[242] = 'wine';681$.physicals.girl.foodList[243] = 'walnuts';682$.physicals.girl.foodList[244] = 'yogurt';683$.physicals.girl.foodList[245] = 'ziti';684$.physicals.girl.foodList[246] = 'zucchini';685$.physicals.girl.foodList[247] = 'string bean';686$.physicals.girl.foodList[248] = 'birthday cake';687$.physicals.girl.foodList[249] = 'pear';688$.physicals.girl.foodList[250] = 'steak';689$.physicals.girl.foodList[251] = 'peanut';690$.physicals.girl.foodList[252] = 'hot dog';691$.physicals.girl.willAccept = function willAccept(what, src) {692 /* Returns true iff this is willing to accept what arriving from src.693 *694 * This function (or its overrides) MUST NOT have any kind of695 * observable side-effect (making noise, causing some other action,696 * etc.).697 */698 return what === this.food;699};700Object.setOwnerOf($.physicals.girl.willAccept, $.physicals.Maximilian);701Object.setOwnerOf($.physicals.girl.willAccept.prototype, $.physicals.Maximilian);702$.physicals.girl.movable = false;...

Full Screen

Full Screen

PhysiologicalConstants.js

Source:PhysiologicalConstants.js Github

copy

Full Screen

1import 'date-fns';2import React, { useState, useEffect, useRef } from 'react';3import PropTypes from 'prop-types';4import { makeStyles } from '@material-ui/styles';5import {6 Divider,7 Typography,8 Grid,9 FormControlLabel,10 Checkbox,11 TextField,12 RadioGroup,13 Radio,14 FormControl,15 Button,16 Table,17 TableBody,18 TableCell,19 TableHead,20 TableRow, 21} from '@material-ui/core';22import Swal from 'sweetalert2'23import PerfectScrollbar from 'react-perfect-scrollbar';24import moment from "moment"25const useStyles = {26 root: {},27 horizontalGroup:{width: 'auto', height: 'auto', display: 'flex', flexWrap: 'nowrap',28 flexDirection: 'row'}29};30const doStyles = makeStyles((theme) => ({31 root: {32 flexGrow: 1,33 },34 paper: {35 padding: theme.spacing(1),36 textAlign: 'center',37 color: theme.palette.text.secondary,38 },39 floatingLabelFocusStyle: {40 color: "#C6C0BF"41 }42 }));43const PhysiologicalConstants = props => {44 const { saveOrUpdatePhysiologicalConstant, selectedPhysiologicalConstant } = props45 //console.log("selectedPhysiologicalConstant",selectedPhysiologicalConstant)46 47 const frmCompleteService = useRef();48 49 const classes = doStyles();50 useEffect(() => {51 if(selectedPhysiologicalConstant){52 setValues({ ...selectedPhysiologicalConstant })53 }else{54 setValues(initialVlues)55 }56 },[selectedPhysiologicalConstant]); 57 58 const handleChange = event => {59 60 //console.log(event,event.target)61 //console.log(event.target.name,event.target.value,event.target.checked,event.target.type)62 if( event.target.type === "checkbox" )63 {64 setData(event.target.name,event.target.checked)65 }66 else{67 setData(event.target.name,event.target.value)68 }69 };70 const initialVlues = {71 bloodPressure: "",72 heartRate: "",73 respiratoryRate: "",74 oxygenSaturation: "",75 heartBeat: "",76 temperature: "",77 weight: "",78 height: "",79 hidrationStatus: "",80 physicalsEye: "",81 physicalsEars: "",82 physicalsLinfaticmodules: "",83 physicalsSkinandanexes: "",84 physicalsLocomotion: "",85 physicalsMusclesqueletal: "",86 physicalsNervoussystem: "",87 physicalsCardiovascularsystem: "",88 physicalsRespiratorysystem: "",89 physicalsDigestivesystem: "",90 physicalsGenitourinarysystem: "",91 }92 const [values, setValues] = useState(initialVlues)93 const [ saveMode, setSaveMode ] = useState(initialVlues)94 //const [values, setValues] = useState(props.physiologicalConstant)95 //console.log("values",values)96 const setData = (key , value) => {97 setValues({98 ...values,99 [key]:value100 })101 102 }103 const errors = new Array(19)104 const rules = (key,value) =>{105 switch(key){106 case "physicalsEye":107 errors[10] = value.length > 0 && value.length < 15 ?108 "El estado de los ojos debe tener mas de 15 carácteres" : false 109 return errors[10]110 case "physicalsEars":111 errors[11] = value.length > 0 && value.length < 15 ?112 "El estado de los oidos debe tener mas de 15 carácteres" : false 113 return errors[11]114 case "physicalsLinfaticmodules":115 errors[12] = value.length > 0 && value.length < 15 ?116 "El estado de los modulos linfaticos debe tener mas de 15 carácteres" : false 117 return errors[12]118 case "physicalsSkinandanexes":119 errors[13] = value.length > 0 && value.length < 15 ?120 "El estado de la piel y anexos debe tener mas de 15 carácteres" : false 121 return errors[13]122 case "physicalsLocomotion":123 errors[14] = value.length > 0 && value.length < 15 ?124 "El estado de la locomoción debe tener mas de 15 carácteres" : false 125 return errors[14]126 case "physicalsMusclesqueletal":127 errors[15] = value.length > 0 && value.length < 15 ?128 "El estado de musculo esquelético debe tener mas de 15 carácteres" : false 129 return errors[15]130 131 case "physicalsNervoussystem":132 errors[16] = value.length > 0 && value.length < 15 ?133 "El estado del sistema nervioso debe tener mas de 15 carácteres" : false 134 return errors[16]135 case "physicalsCardiovascularsystem":136 errors[17] = value.length > 0 && value.length < 15 ?137 "El estado del sistema cardiovascular debe tener mas de 15 carácteres" : false 138 return errors[17]139 case "physicalsRespiratorysystem":140 errors[18] = value.length > 0 && value.length < 15 ?141 "El estado del sistema respiratorio debe tener mas de 15 carácteres" : false 142 return errors[18]143 case "physicalsDigestivesystem":144 errors[18] = value.length > 0 && value.length < 15 ?145 "El estado del sistema digestivo debe tener mas de 15 carácteres" : false 146 return errors[18]147 case "physicalsGenitourinarysystem":148 errors[19] = value.length > 0 && value.length < 15 ?149 "El estado del sistema genitourinario debe tener mas de 15 carácteres" : false 150 return errors[19]151 152 153 default:154 return true155 } 156 }157 return (158 <Grid lg={12} md={12} xs={12}>159 <form onSubmit={(e)=>{160 e.preventDefault()161 console.log("form submit")162 console.info("values",values)163 let errorValidation = false164 errors.forEach(data => {165 if(data != false){ errorValidation = true }166 })167 if(errorValidation)168 {169 Swal.fire({170 icon: 'warning',171 title: 'Espera',172 text: "Tienes error en los datos suministrados, revisalos", 173 })174 }else{ 175 176 console.log("saveMode",saveMode)177 if(saveMode === 1){178 179 saveOrUpdatePhysiologicalConstant({ ...values, _id:selectedPhysiologicalConstant.id })180 }181 if(saveMode === 2){182 props.physiologicalConstants.map( pc => console.log("pc",pc) )183 delete values.id184 delete values._id185 console.log("values",values)186 //saveOrUpdatePhysiologicalConstant(values)187 }188 189 }190 191 }} >192 <Grid193 container194 direction="row"195 justify="center"196 alignItems="center"197 >198 <Typography variant="subtitle2">Signos vitales</Typography>199 200 <Grid lg={12} md={12} xs={12}>201 <Divider/>202 </Grid> 203 <Grid lg={4} md={4} xs={12} >204 <TextField className={classes.paper}205 fullWidth206 label="Presión sanguinea"207 margin="dense"208 name="bloodPressure"209 variant="outlined"210 InputLabelProps={{211 className: classes.floatingLabelFocusStyle,212 }}213 onChange={handleChange}214 value={values.bloodPressure}215 type="number"216 required217 min={0}218 />219 </Grid>220 <Grid lg={4} md={4} xs={12} >221 <TextField className={classes.paper}222 fullWidth223 label="Frecuencia cardiaca"224 margin="dense"225 name="heartRate"226 variant="outlined"227 InputLabelProps={{228 className: classes.floatingLabelFocusStyle,229 }}230 onChange={handleChange}231 value={values.heartRate}232 type="number"233 required234 min={0}235 />236 </Grid>237 <Grid lg={4} md={4} xs={12} >238 <TextField className={classes.paper}239 fullWidth240 label="Frecuencia respiratoria X minuto"241 margin="dense"242 name="respiratoryRate"243 variant="outlined"244 InputLabelProps={{245 className: classes.floatingLabelFocusStyle,246 }}247 onChange={handleChange}248 value={values.respiratoryRate}249 type="number"250 required251 min={0}252 />253 </Grid>254 </Grid>255 <Grid256 container257 direction="row"258 justify="center"259 alignItems="center"260 >261 <Grid lg={4} md={4} xs={12} >262 <TextField className={classes.paper}263 fullWidth264 label="Saturación de oxigeno (SpO2)"265 margin="dense"266 name="oxygenSaturation"267 variant="outlined"268 InputLabelProps={{269 className: classes.floatingLabelFocusStyle,270 }}271 onChange={handleChange}272 value={values.oxygenSaturation}273 type="number"274 required275 min={0}276 />277 </Grid>278 <Grid lg={4} md={4} xs={12} >279 <TextField className={classes.paper}280 fullWidth281 label="PULSO"282 margin="dense"283 name="heartBeat"284 variant="outlined"285 InputLabelProps={{286 className: classes.floatingLabelFocusStyle,287 }}288 onChange={handleChange}289 value={values.heartBeat}290 type="number"291 required292 min={0}293 />294 </Grid>295 <Grid lg={4} md={4} xs={12} >296 <TextField className={classes.paper}297 fullWidth298 label="TEMPERATURA (grados centigrados)"299 margin="dense"300 name="temperature"301 variant="outlined"302 InputLabelProps={{303 className: classes.floatingLabelFocusStyle,304 }}305 onChange={handleChange}306 value={values.temperature}307 type="number"308 required309 min={0}310 />311 </Grid>312 313 </Grid>314 <Grid315 container316 direction="row"317 justify="center"318 alignItems="center"319 > 320 321 <Grid lg={4} md={4} xs={12} >322 <TextField className={classes.paper}323 fullWidth324 label="PESO"325 margin="dense"326 name="weight"327 variant="outlined"328 InputLabelProps={{329 className: classes.floatingLabelFocusStyle,330 }}331 onChange={handleChange}332 value={values.weight}333 type="number"334 required335 min={0}336 />337 </Grid>338 <Grid lg={4} md={4} xs={12} >339 <TextField className={classes.paper}340 fullWidth341 label="ALTURA"342 margin="dense"343 name="height"344 variant="outlined"345 InputLabelProps={{346 className: classes.floatingLabelFocusStyle,347 }}348 onChange={handleChange}349 value={values.height}350 type="number"351 required352 min={0}353 />354 </Grid>355 <Grid lg={4} md={4} xs={12} >356 <TextField className={classes.paper}357 fullWidth358 label="INDICE DE MASA CORPORAL (IMC)"359 margin="dense"360 name="imc"361 variant="outlined"362 InputLabelProps={{363 className: classes.floatingLabelFocusStyle,364 }}365 value={ values.height > 0 && values.weight / ( values.height * values.height ) || 0 }366 readOnly={true}367 />368 </Grid>369 </Grid>370 <Typography variant="subtitle2">Estado de hidratación</Typography>371 <Divider/>372 <Grid container direction="row" justify="center" alignItems="center">373 <FormControl component="fieldset">374 <RadioGroup style={useStyles.horizontalGroup}375 name="hidrationStatus" onChange={handleChange}376 value={ values.hidrationStatus }377 aria-label="customerBenefit">378 379 <FormControlLabel value="Normal" control={<Radio/>} 380 label="Normal" />381 <FormControlLabel value="0-5%" control={<Radio/>}382 label="Deshidr. 0-5%" />383 <FormControlLabel value="6-7%" control={<Radio/>} 384 label="Deshidr. 6-7%" />385 <FormControlLabel value="8-9%" control={<Radio/>} 386 label="Deshidr. 8-9%" />387 <FormControlLabel value="+10%" control={<Radio/>} 388 label="Deshidr. +10%" />389 390 </RadioGroup>391 </FormControl>392 </Grid>393 <Typography variant="subtitle2">Estado físico (Solo comentar si hay algo anormal)</Typography> 394 <Divider/>395 <TextField396 fullWidth397 label="Ojos"398 margin="dense"399 name="physicalsEye"400 variant="outlined"401 multiline402 rows={3}403 InputLabelProps={{404 className: classes.floatingLabelFocusStyle,405 }}406 onChange={handleChange}407 value={values.physicalsEye}408 helperText={rules("physicalsEye",values.physicalsEye)}409 error = {rules("physicalsEye",values.physicalsEye)}410 />411 <TextField412 fullWidth413 label="Oidos"414 margin="dense"415 name="physicalsEars"416 variant="outlined"417 multiline418 rows={3}419 InputLabelProps={{420 className: classes.floatingLabelFocusStyle,421 }}422 onChange={handleChange}423 value={values.physicalsEars}424 helperText={rules("physicalsEars",values.physicalsEars)}425 error = {rules("physicalsEars",values.physicalsEars)}426 />427 <TextField428 fullWidth429 label="Modulos Linfáticos"430 margin="dense"431 name="physicalsLinfaticmodules"432 variant="outlined"433 multiline434 rows={3}435 InputLabelProps={{436 className: classes.floatingLabelFocusStyle,437 }}438 onChange={handleChange}439 value={values.physicalsLinfaticmodules}440 helperText={rules("physicalsLinfaticmodules",values.physicalsLinfaticmodules)}441 error = {rules("physicalsLinfaticmodules",values.physicalsLinfaticmodules)}442 />443 <TextField444 fullWidth445 label="Piel y anexos"446 margin="dense"447 name="physicalsSkinandanexes"448 variant="outlined"449 multiline450 rows={3}451 InputLabelProps={{452 className: classes.floatingLabelFocusStyle,453 }}454 onChange={handleChange}455 value={values.physicalsSkinandanexes}456 helperText={rules("physicalsSkinandanexes",values.physicalsSkinandanexes)}457 error = {rules("physicalsSkinandanexes",values.physicalsSkinandanexes)}458 />459 <TextField460 fullWidth461 label="Locomoción"462 margin="dense"463 name="physicalsLocomotion"464 variant="outlined"465 multiline466 rows={3}467 InputLabelProps={{468 className: classes.floatingLabelFocusStyle,469 }}470 onChange={handleChange}471 value={values.physicalsLocomotion}472 helperText={rules("physicalsLocomotion",values.physicalsLocomotion)}473 error = {rules("physicalsLocomotion",values.physicalsLocomotion)}474 />475 <TextField476 fullWidth477 label="Musculo esqueletico"478 margin="dense"479 name="physicalsMusclesqueletal"480 variant="outlined"481 multiline482 rows={3}483 InputLabelProps={{484 className: classes.floatingLabelFocusStyle,485 }}486 onChange={handleChange}487 value={values.physicalsMusclesqueletal}488 helperText={rules("physicalsMusclesqueletal",values.physicalsMusclesqueletal)}489 error = {rules("physicalsMusclesqueletal",values.physicalsMusclesqueletal)}490 />491 <TextField492 fullWidth493 label="Sistema nervioso"494 margin="dense"495 name="physicalsNervoussystem"496 variant="outlined"497 multiline498 rows={3}499 InputLabelProps={{500 className: classes.floatingLabelFocusStyle,501 }}502 onChange={handleChange}503 value={values.physicalsNervoussystem}504 helperText={rules("physicalsNervoussystem",values.physicalsNervoussystem)}505 error = {rules("physicalsNervoussystem",values.physicalsNervoussystem)}506 />507 <TextField508 fullWidth509 label="Sistema cardiovascular"510 margin="dense"511 name="physicalsCardiovascularsystem"512 variant="outlined"513 multiline514 rows={3}515 InputLabelProps={{516 className: classes.floatingLabelFocusStyle,517 }}518 onChange={handleChange}519 value={values.physicalsCardiovascularsystem}520 helperText={rules("physicalsCardiovascularsystem",values.physicalsCardiovascularsystem)}521 error = {rules("physicalsCardiovascularsystem",values.physicalsCardiovascularsystem)}522 />523 <TextField524 fullWidth525 label="Sistema respiratorio"526 margin="dense"527 name="physicalsRespiratorysystem"528 variant="outlined"529 multiline530 rows={3}531 InputLabelProps={{532 className: classes.floatingLabelFocusStyle,533 }}534 onChange={handleChange}535 value={values.physicalsRespiratorysystem}536 helperText={rules("physicalsRespiratorysystem",values.physicalsRespiratorysystem)}537 error = {rules("physicalsCardiovascularsystem",values.physicalsRespiratorysystem)}538 />539 <TextField540 fullWidth541 label="Sistema digestivo"542 margin="dense"543 name="physicalsDigestivesystem"544 variant="outlined"545 multiline546 rows={3}547 InputLabelProps={{548 className: classes.floatingLabelFocusStyle,549 }}550 onChange={handleChange}551 value={values.physicalsDigestivesystem}552 helperText={rules("physicalsDigestivesystem",values.physicalsDigestivesystem)}553 error = {rules("physicalsDigestivesystem",values.physicalsDigestivesystem)}554 />555 <TextField556 fullWidth557 label="Sistema genitourinario"558 margin="dense"559 name="physicalsGenitourinarysystem"560 variant="outlined"561 multiline562 rows={3}563 InputLabelProps={{564 className: classes.floatingLabelFocusStyle,565 }}566 onChange={handleChange}567 value={values.physicalsGenitourinarysystem}568 helperText={rules("physicalsGenitourinarysystem",values.physicalsGenitourinarysystem)}569 error = {rules("physicalsGenitourinarysystem",values.physicalsGenitourinarysystem)}570 />571 <Typography variant="subtitle2">Lista de constantes registradas</Typography>572 <Divider/> 573 <Grid lg={12} md={12} xs={12}>574 <PerfectScrollbar>575 <div className={classes.inner}>576 <Table>577 <TableHead>578 <TableRow>579 <TableCell>Fecha</TableCell> 580 <TableCell>Actitud</TableCell>581 <TableCell>Condición corporal</TableCell>582 <TableCell>Hidratación</TableCell>583 <TableCell>Pulso</TableCell>584 <TableCell>Temperatura</TableCell>585 <TableCell>Peso</TableCell> 586 <TableCell>Opciones</TableCell>587 </TableRow>588 </TableHead>589 <TableBody> 590 591 {592 props.physiologicalConstants ? 593 props.physiologicalConstants.slice(0).reverse().map( constant => (594 <TableRow>595 <TableCell>{constant.date.split(" ")[0]}</TableCell>596 <TableCell>{constant.attitude}</TableCell>597 <TableCell>{constant.bodyCondition}</TableCell>598 <TableCell>{constant.hidrationStatus}</TableCell>599 <TableCell>{constant.heartBeat}</TableCell>600 <TableCell>{constant.temperature}</TableCell>601 <TableCell>{constant.weight}</TableCell>602 <TableCell><Button color="secondary"onClick={()=>{603 604 Swal.fire({605 title: '¿ Esta seguro ?',606 text: "Esto modificara los datos del formulario, si esta creando una constante y no ha guardado cambios, guardelos",607 icon: 'warning',608 showCancelButton: true,609 confirmButtonColor: '#3085d6',610 cancelButtonColor: '#d33',611 confirmButtonText: 'Ok'612 }).then((result) => {613 if (result.value) {614 setValues(constant)615 }616 })617 }} >Ver info completa</Button></TableCell>618 </TableRow>619 )) : null620 }621 622 623 </TableBody>624 </Table>625 </div>626 </PerfectScrollbar>627 </Grid> 628 629 <button ref={frmCompleteService} style={{visibility:"hidden"}} type="submit"> click here </button>630 </form>631 <Typography variant="subtitle2">Opciones</Typography>632 <Divider/> 633 <Grid container direction="row" justify="space-evenly" alignItems="center"> 634 <Button color="primary" variant="contained" style={{marginTop:"10px"}} 635 onClick={()=>{636 setSaveMode(1)637 window.setTimeout( ()=>{638 frmCompleteService.current.click()639 },600)640 }} >641 Guardar642 </Button>643 <Button color="primary" variant="contained" style={{marginTop:"10px"}}644 onClick={()=>{645 646 let checkDay647 props.physiologicalConstants.map( pConstant => {648 checkDay = moment(pConstant.date?.split(" ")[0]).isSame(moment(), 'day')649 })650 if(checkDay){651 return Swal.fire("Espera","Ya hubo una constante fisiológica creada hoy no puede crear mas pero si editarla","warning")652 } 653 if(props.physiologicalConstants.length == 0){654 return Swal.fire("Espera","Debe haber al menos una constante fisiológica guardada para continuar","warning")655 }656 Swal.fire({657 title: '¿Esta seguro?',658 text: "Esto creara un nuevo registro de constante fisiológicas si desea cambiar el actual solo haga click en guardar",659 icon: 'warning',660 showCancelButton: true,661 confirmButtonColor: '#3085d6',662 cancelButtonColor: '#d33',663 confirmButtonText: 'Si, adelante'664 }).then((result) => {665 if (result.isConfirmed) {666 setSaveMode(2)667 props.setIdPCToSave(null)668 window.setTimeout( ()=>{669 frmCompleteService.current.click() 670 },600) 671 }672 })673 674 }}675 >676 Crear nuevas constantes fisiológicas677 </Button>678 </Grid>679 </Grid> 680 );681};682PhysiologicalConstants.propTypes = {683 className: PropTypes.string684};...

Full Screen

Full Screen

physicals-tab.component.ts

Source:physicals-tab.component.ts Github

copy

Full Screen

1import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';2import { FormBuilder } from '@angular/forms';3import { MatDialog, MatSidenav } from '@angular/material';4import { ActivatedRoute } from '@angular/router';5import { BaseFormComponent } from '../../../../../shared/components/base-form-component/base-form-component.component';6import { AllocationSetUp } from '../../../../../shared/entities/allocation-set-up-entity';7import { MasterData } from '../../../../../shared/entities/masterdata.entity';8import { CompanyConfigurationRecord } from '../../../../../shared/services/configuration/dtos/company-configuration-record';9import { ConfigurationService } from '../../../../../shared/services/http-services/configuration.service';10import { ConfirmationDialogComponent } from './../../../../../shared/components/confirmation-dialog/confirmation-dialog.component';11import { User } from './../../../../../shared/entities/user.entity';12import { FormConfigurationProviderService } from './../../../../../shared/services/form-configuration-provider.service';13import { AllocationSetUpComponent } from './allocation-set-up/allocation-set-up.component';14import { MandatoryTradeApprovalComponent } from './mandatory-trade-approval/mandatory-trade-approval.component';15import { PhysicalsMainComponent } from './physicals-main/physicals-main.component';16@Component({17 selector: 'atlas-physicals-tab',18 templateUrl: './physicals-tab.component.html',19 styleUrls: ['./physicals-tab.component.scss'],20})21export class PhysicalsTabComponent extends BaseFormComponent implements OnInit {22 @Output() readonly isSideNavOpened = new EventEmitter<boolean>();23 @ViewChild('mainPhysicalsComponent') mainPhysicalsComponent: PhysicalsMainComponent;24 @ViewChild('mainPhysicalsSideNav') mainPhysicalsSideNav: MatSidenav;25 @ViewChild('mandatoryTradeSetUpComponent') mandatoryTradeSetUpComponent: MandatoryTradeApprovalComponent;26 @ViewChild('allocationSetupComponent') allocationSetupComponent: AllocationSetUpComponent;27 @ViewChild('allocationSetUpSideNav') allocationSetUpSideNav: MatSidenav;28 @ViewChild('mandatoryTradeSetUpSideNav') mandatoryTradeSetUpSideNav: MatSidenav;29 formComponents: BaseFormComponent[] = [];30 users: User[] = [];31 isEdit: boolean;32 masterdata: MasterData = new MasterData();33 company: string;34 physicalsMainComponent: string = 'PhysicalsMainComponent';35 allocationSetUpComponent: string = 'AllocationSetUpComponent';36 mandatoryTradeApprovalComponent: string = 'MandatoryTradeApprovalComponent';37 dataList: AllocationSetUp[] = [];38 companyConfigurationRecord: CompanyConfigurationRecord;39 @ViewChild('divAllocate') divAllocate: ElementRef;40 hideAllocationSidenav: boolean;41 hideMandatorySidenav: boolean;42 @Output() readonly businessSectorMandatory = new EventEmitter();43 constructor(protected formConfigurationProvider: FormConfigurationProviderService,44 private route: ActivatedRoute,45 protected dialog: MatDialog,46 protected configurationService: ConfigurationService,47 protected formBuilder: FormBuilder) { super(formConfigurationProvider); }48 ngOnInit() {49 this.company = this.route.snapshot.paramMap.get('companyId');50 this.masterdata = this.route.snapshot.data.masterdata;51 this.isSideNavOpened.emit(false);52 this.formComponents.push(53 this.mainPhysicalsComponent,54 this.mandatoryTradeSetUpComponent,55 this.allocationSetupComponent,56 );57 }58 getFormGroup() {59 this.formGroup = this.formBuilder.group({60 mainPhysicalsGroup: this.mainPhysicalsComponent.getFormGroup(),61 locationGroup: this.mandatoryTradeSetUpComponent.getFormGroup(),62 detailsGroup: this.allocationSetupComponent.getFormGroup(),63 });64 return super.getFormGroup();65 }66 sideNavOpened(event: boolean) {67 this.isSideNavOpened.emit(event);68 }69 onMainPhysicalsTabCliked() {70 this.hideAllocationSidenav = true;71 this.hideMandatorySidenav = true;72 this.isSideNavOpened.emit(true);73 this.mainPhysicalsSideNav.open();74 }75 onAllocationSetUpTabCliked() {76 this.hideAllocationSidenav = false;77 this.hideMandatorySidenav = true;78 this.allocationSetupComponent.readyAllocationSetUpEditor();79 this.isSideNavOpened.emit(true);80 this.allocationSetUpSideNav.open();81 }82 onMandatoyTradeSetUpTabCliked() {83 this.hideMandatorySidenav = false;84 this.hideAllocationSidenav = true;85 this.mandatoryTradeSetUpComponent.readyMandatoryFieldSetUpEditor();86 this.isSideNavOpened.emit(true);87 this.mandatoryTradeSetUpSideNav.open();88 }89 onDiscardClick(value) {90 if (this.isEdit) {91 const confirmDiscardDialog = this.dialog.open(ConfirmationDialogComponent, {92 data: {93 title: 'Discard Changes',94 text: 'You have some modification pending. Close and lose changes?',95 okButton: 'Ok',96 cancelButton: 'Cancel',97 },98 });99 confirmDiscardDialog.afterClosed().subscribe((answer) => {100 if (answer) {101 if (value) {102 this.closeSideNavs(value.selectedOptionName);103 }104 }105 });106 } else {107 if (value) {108 this.closeSideNavs(value.selectedOptionName);109 }110 }111 this.isSideNavOpened.emit(false);112 }113 closeSideNavs(selectedOptionName: string) {114 if (selectedOptionName === this.physicalsMainComponent) {115 this.mainPhysicalsSideNav.close();116 } else if (selectedOptionName === this.allocationSetUpComponent) {117 this.allocationSetUpSideNav.close();118 } else if (selectedOptionName === this.mandatoryTradeApprovalComponent) {119 this.mandatoryTradeSetUpSideNav.close();120 }121 }122 initForm(companyConfigurationRecord: any, isEdit): any {123 this.isEdit = isEdit;124 this.companyConfigurationRecord = companyConfigurationRecord;125 this.formComponents.forEach((comp) => {126 companyConfigurationRecord = comp.initForm(companyConfigurationRecord, isEdit);127 });128 return companyConfigurationRecord;129 }130 populateEntity(entity: any): any {131 this.formComponents.forEach((comp) => {132 entity = comp.populateEntity(entity);133 });134 return entity;135 }136 onBusinessMandatory(value) {137 this.mainPhysicalsComponent.checkBusinessSector(value);138 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2wptoolkit.physicals(function(err, data) {3 if (err) {4 console.log(err);5 } else {6 console.log(data);7 }8});9{ cpu: 10 { '0': 11 { processor: 0,12 model_name: 'Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz',13 power_management: '' },14 { processor: 1,15 model_name: 'Intel(R

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptool = require('wptool');2var wp = new wptool();3wp.physicals(function(data) {4 console.log(data);5});6var wptool = require('wptool');7var wp = new wptool();8wp.physicals(function(data) {9 console.log(data);10});11var wptool = require('wptool');12var wp = new wptool();13wp.physicals(function(data) {14 console.log(data);15});16var wptool = require('wptool');17var wp = new wptool();18wp.physicals(function(data) {19 console.log(data);20});21var wptool = require('wptool');22var wp = new wptool();23wp.physicals(function(data) {24 console.log(data);25});26var wptool = require('wptool');27var wp = new wptool();28wp.physicals(function(data) {29 console.log(data);30});31var wptool = require('wptool');32var wp = new wptool();33wp.physicals(function(data) {34 console.log(data);35});36var wptool = require('wptool');37var wp = new wptool();38wp.physicals(function(data) {39 console.log(data);40});41var wptool = require('wptool');42var wp = new wptool();43wp.physicals(function(data) {44 console.log(data);45});46var wptool = require('wptool');47var wp = new wptool();48wp.physicals(function(data) {49 console.log(data);50});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolbox = require('wptoolbox');2var physicals = wptoolbox.physicals;3var fs = require('fs');4var phys = new physicals();5var file = fs.readFileSync('data.csv', 'utf8');6var data = phys.parse(file);7phys.add(data);8var result = phys.get();9console.log(result);10console.log(phys.toCSV(result));11console.log(JSON.stringify(result));12console.log(phys.toXML(result));13console.log(phys.toHTML(result));14var result = phys.get({years: [2014, 2015]});15var result = phys.get({years: [2014, 2015], columns: ['2014', '2015', 'Country']});16var result = phys.get({years: [2014, 2015], columns: ['2014', '2015', 'Country'], states: ['United States', 'Canada']});17var result = phys.get({years: [2014, 2015], columns: ['2014', '2015', 'Country'], states: ['United States', 'Canada'], countries: ['United States', 'Canada']});18var result = phys.get({years: [2014, 2015], columns: ['2014', '2015', 'Country'], states: ['United States', 'Canada'], countries: ['United States', 'Canada

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptool = require('wptool');2wp.physicals(function (err, data) {3 console.log(data);4});5var wptool = require('wptool');6wp.physicals(function (err, data) {7 console.log(data);8});9var wptool = require('wptool');10wp.physicals(function (err, data) {11 console.log(data);12});13var wptool = require('wptool');14wp.physicals(function (err, data) {15 console.log(data);16});17var wptool = require('wptool');18wp.physicals(function (err, data) {19 console.log(data);20});21var wptool = require('wptool');22wp.physicals(function (err, data) {23 console.log(data);24});25var wptool = require('wptool');26wp.physicals(function (err, data) {27 console.log(data);28});29var wptool = require('wptool');30wp.physicals(function (err, data) {31 console.log(data);32});33var wptool = require('wptool');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolbox = require('wptoolbox');2wptoolbox.physicals('test.js', function(err, data) {3 console.log(data);4});5{ dev: 16777220,6 ctime: '2014-12-16T07:52:02.000Z' }7Copyright (c) 2014 WPTeam

Full Screen

Using AI Code Generation

copy

Full Screen

1wpt.physicals(function(err, data) {2 console.log(data);3});4wpt.physicals({5}, function(err, data) {6 console.log(data);7});8wpt.physicals({9}, function(err, data) {10 console.log(data);11});12wpt.physicals(function(err, data) {13 console.log(data);14});15wpt.physicals({16}, function(err, data) {17 console.log(data);18});19wpt.physicals(function(err, data) {20 console.log(data);21});22wpt.physicals({23}, function(err, data) {24 console.log(data);25});26wpt.physicals(function(err, data) {27 console.log(data);28});29wpt.physicals({30}, function(err, data) {31 console.log(data);32});33wpt.physicals(function(err, data) {34 console.log(data);35});36wpt.physicals({37}, function(err, data) {38 console.log(data);39});40wpt.physicals(function(err, data) {41 console.log(data);42});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful