Files
JiboSDK/lib/jibo-sdk.js
2026-03-22 03:21:45 +02:00

23 lines
459 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* jibo-sdk - Jibo's SDK plugin for Atom
* @version v3.9.10
* @license Copyright (c) 2017, Jibo, Inc. All rights reserved.
* All use of the Jibo SDK is subject to the Jibo SDK End User License Agreement (EULA)
* distributed herewith. If you did not receive a copy of the EULA, you may view a
* copy at https://developers.jibo.com/license.
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.jiboSdk=e()}}(function(){return function e(t,o,i){function n(r,s){if(!o[r]){if(!t[r]){var l="function"==typeof require&&require;if(!s&&l)return l(r,!0);if(a)return a(r,!0);var d=new Error("Cannot find module '"+r+"'");throw d.code="MODULE_NOT_FOUND",d}var c=o[r]={exports:{}};t[r][0].call(c.exports,function(e){var o=t[r][1][e];return n(o?o:e)},c,c.exports,e,t,o,i)}return o[r].exports}for(var a="function"==typeof require&&require,r=0;r<i.length;r++)n(i[r]);return n}({1:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("path"),a=e("jibo"),r=e("../atom-react/core/react-editor"),s=e("./views/editor"),l=e("./models/animation-model"),d=e("../common/tree-view-helper"),c=e("./audio/multi-audio-playback"),u=e("jibo-analytics"),h=function(t){function o(e){var o=t.call(this,"AnimationEditor",e,!1)||this,i=o.getUiState();o.layout=i?i:[];var n=a.utils.PathUtils.findRoot(e);return o.animationModel=new l.default(o,n),o.animationModel.audio=new c.default(o.animationModel,n),o}return i(o,t),o.createNewFile=function(){var t=d.default.getFolderPathWithDirectory(d.default.getFolderPathOfSelection(),"animations");if(!t)return void alert("You must have a valid project loaded in order to create a new animation.");var i=atom.getCurrentWindow(),n=e("remote"),a=n.dialog||n.require("dialog");a.showSaveDialog(i,{title:"New Animation",defaultPath:t,filters:o.getDialogFilter()},function(e){e&&(o.isValidDirectory(e)?(l.default.createNewFile(e),atom.workspace.open(e),u.default.event("animation-editor","new",{})):alert('You must save animations under the "animations" folder.'))})},o.isValidDirectory=function(e){var t=n.normalize("/animations/");return!!e.includes(t)},o.getDialogFilter=function(){return[{name:"Animation",extensions:["keys"]}]},o.prototype.serialize=function(){return this.saveUiState(this.layout),t.prototype.serialize.call(this)},o.prototype.dispose=function(){this.saveUiState(this.layout),t.prototype.dispose.call(this),this.animationModel.dispose(),this.animationModel.audio.dispose()},o.prototype.onPaneActivated=function(){var e=this;setTimeout(function(){e.container.childNodes[0]&&e.container.childNodes[0].focus()},1)},o.prototype.focus=function(){this.container.childNodes[0]&&this.container.childNodes[0].focus()},o.prototype.onPaneDeactivated=function(){},o.prototype.getReactClass=function(){return s.default},o.prototype.saveFile=function(e){return o.isValidDirectory(e)?(this.animationModel.saveFile(e),this.animationModel.backup(),u.default.event("animation-editor","saved",{}),!0):(alert('You must save animations under the "animations" folder.'),!1)},o.prototype.reload=function(){this.animationModel.reloadFile(this.uri)},o.prototype.getSaveDialogOptions=function(){return{title:"Animation Save As",filters:o.getDialogFilter()}},o}(r.default);atom.deserializers.add({deserialize:r.default.deserialize.bind(h),name:"AnimationEditor"}),Object.defineProperty(o,"__esModule",{value:!0}),o.default=h},{"../atom-react/core/react-editor":55,"../common/tree-view-helper":109,"./audio/multi-audio-playback":4,"./models/animation-model":9,"./views/editor":12,jibo:void 0,"jibo-analytics":void 0,path:void 0,remote:void 0}],2:[function(e,t,o){"use strict";function i(e){for(var t=2*r+e.length,o=a.createBuffer(e.numberOfChannels,t,e.sampleRate),i=0;i<e.numberOfChannels;i++){for(var n=e.getChannelData(i),s=new Float32Array(2*r+n.length),l=0,d=0;d<r;d++)s[l]=0,l++;for(var d=0;d<n.length;d++)s[l]=n[d],l++;for(var d=0;d<r;d++)s[l]=0,l++;o.copyToChannel(s,i)}return o}function n(e){for(var t=new Float32Array(e.length),o=a.createBuffer(1,e.length,e.sampleRate),i=-r,n=0;n<e.length;n++)t[n]=i,i++;return o.getChannelData(0).set(t),o}var a=new AudioContext,r=44100,s=function(){function e(e,t){void 0===t&&(t=!1),this.url=e,this.reverse=t,this.scriptNode=a.createScriptProcessor(256,1,1),this.scriptNode.onaudioprocess=this.processAudio.bind(this),this._currentTime=0,this.started=!1,this.callbacks=[]}return Object.defineProperty(e.prototype,"bufferTime",{get:function(){return r/this.buffer.sampleRate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._currentTime},set:function(e){this.stop(),this.createNodes(),this.sourceNode.start(0,e+this.bufferTime),this.counterNode.start(0,e+this.bufferTime),this.started=!0,this._currentTime=e,this.playbackRate=1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"playbackRate",{get:function(){return this.sourceNode.playbackRate.value},set:function(e){this.sourceNode.playbackRate.value=e,this.counterNode.playbackRate.value=e},enumerable:!0,configurable:!0}),e.prototype.getSamples=function(e){this.originalBufferArray?e(this.originalBufferArray,this.sampleRate):this.callbacks.push(e)},e.prototype.processAudio=function(e){var t=e.inputBuffer.getChannelData(0),o=t[t.length-1]||0;this._currentTime=this.duration*o/this.numSamples,this.onCurrentTime&&this.onCurrentTime(this._currentTime)},e.prototype.play=function(){this.started=!0,this.sourceNode.start(),this.counterNode.start()},e.prototype.stop=function(){this.started&&(this.sourceNode.stop(),this.counterNode.stop()),this.started=!1},e.prototype.createNodes=function(){this.sourceNode&&this.counterNode&&(this.sourceNode.disconnect(),this.counterNode.disconnect()),this.sourceNode=a.createBufferSource(),this.sourceNode.buffer=this.buffer,this.sourceNode.connect(a.destination),this.counterNode=a.createBufferSource(),this.counterNode.buffer=this.counterBuffer,this.counterNode.connect(this.scriptNode),this.scriptNode.connect(a.destination)},e.prototype.dispose=function(){this.stop(),this.scriptNode.onaudioprocess=null,this.sourceNode&&this.counterNode&&(this.sourceNode.disconnect(),this.counterNode.disconnect()),this.scriptNode.disconnect(),this.scriptNode=null,this.sourceNode=null,this.counterNode=null,this.disposed=!0},e.prototype.onLoad=function(e,t){var o=this;a.decodeAudioData(e.response,function(e){if(o.duration=e.length/e.sampleRate,o.sampleRate=e.sampleRate,o.numSamples=e.length,o.buffer=i(e),o.counterBuffer=n(o.buffer),o.originalBufferArray=e.getChannelData(0),o.reverse){o._currentTime=o.duration;for(var a=0;a<o.buffer.numberOfChannels;a++)Array.prototype.reverse.call(o.buffer.getChannelData(a))}o.disposed||(o.createNodes(),t())})},e.prototype.load=function(e){var t=new XMLHttpRequest;t.open("GET",this.url,!0),t.responseType="arraybuffer",t.onload=this.onLoad.bind(this,t,e),t.send()},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=s},{}],3:[function(e,t,o){"use strict";var i=e("./pid-audio-controller"),n=e("path"),a=function(){function e(e,t,o){this.model=e,this.handleDown=!1,this.wasInRange=!1,this.startTime=o.time/this.model.state.keyframes.framerate;var a=n.resolve(t,"audio",o.value.AudioEvent.file);this.audio=new i.default(a),this.audio.load(this.onLoaded.bind(this))}return e.prototype.startUpdateLoop=function(){this.doUpdate=!0,this.lastUpdate=(new Date).getTime(),this.update()},e.prototype.stopUpdateLoop=function(){this.doUpdate=!1},Object.defineProperty(e.prototype,"target",{get:function(){var e=this.model.uiState.currentKeyframe/this.model.state.keyframes.framerate;return e-this.startTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInRange",{get:function(){return this.target>-.5&&this.target<this.audio.duration+.5},enumerable:!0,configurable:!0}),e.prototype.onLoaded=function(){this.loaded=!0,this.startUpdateLoop()},e.prototype.onToggleTimeScrub=function(e){this.handleDown=e,this.loaded&&(e&&this.isInRange?(this.wasInRange=!0,this.audio.playAtTime(this.target),this.audio.reset()):(this.wasInRange=!1,this.audio.stop()))},e.prototype.onTogglePlay=function(e){this.isPlaying=e,this.loaded&&(this.lastTarget=this.target,e&&this.isInRange?(this.wasInRange=!0,this.audio.playAtTime(this.target)):e||(this.wasInRange=!1,this.audio.stop()))},e.prototype.onTimeScrub=function(){if(this.loaded&&this.handleDown){var e=this.isInRange;e&&!this.wasInRange?(this.audio.playAtTime(this.target),this.audio.reset()):!e&&this.wasInRange&&this.audio.stop(),this.wasInRange=e}},e.prototype.onDataChanged=function(){if(this.loaded&&this.isPlaying){var e=this.isInRange;e&&!this.wasInRange?this.audio.playAtTime(this.target):!e&&this.wasInRange?this.audio.stop():e&&this.lastTarget>this.target&&this.audio.playAtTime(this.target),this.lastTarget=this.target,this.wasInRange=e}},e.prototype.update=function(){if(this.doUpdate){requestAnimationFrame(this.update.bind(this));var e=(new Date).getTime();if(e-this.lastUpdate<100)return;this.lastUpdate=e,this.handleDown&&this.isInRange&&this.wasInRange?this.audio.target=this.target:this.audio&&this.audio.reset()}},e.prototype.dispose=function(){this.stopUpdateLoop(),this.audio.dispose(),this.audio=null,this.model=null},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{"./pid-audio-controller":5,path:void 0}],4:[function(e,t,o){"use strict";var i=e("./audio-playback"),n=function(){function e(e,t){this.model=e,this.root=t,this.playbacks=[],this.rebuild(),this.onPropsChanged=this.onPropsChanged.bind(this),this.onDataChanged=this.onDataChanged.bind(this),this.onTogglePlay=this.onTogglePlay.bind(this),this.onToggleTimeScrub=this.onToggleTimeScrub.bind(this),this.onTimeScrub=this.onTimeScrub.bind(this),this.model.on("onpropertieschanged",this.onPropsChanged),this.model.on("ondatachanged",this.onDataChanged),this.model.on("toggle-play",this.onTogglePlay),this.model.on("toggle-time-scrub",this.onToggleTimeScrub),this.model.on("drag-keyframe",this.onTimeScrub)}return e.prototype.onToggleTimeScrub=function(e){this.playbacks.forEach(function(t){t.onToggleTimeScrub(e)})},e.prototype.onTogglePlay=function(e){this.playbacks.forEach(function(t){t.onTogglePlay(e)})},e.prototype.onTimeScrub=function(){this.playbacks.forEach(function(e){e.onTimeScrub()})},e.prototype.onDataChanged=function(){this.playbacks.forEach(function(e){e.onDataChanged()})},e.prototype.rebuild=function(){var e=this;this.playbacks.forEach(function(e){e.dispose()}),this.playbacks=[],this.map={};var t=this.model.getLayersOfType("Audio Event");t.forEach(function(t){t.visible&&!t.locked&&(e.map[t.id]=[],t.keyframes.forEach(function(o){if(o.value.AudioEvent.file&&o.value.AudioEvent.file.length>0){var n=new i.default(e.model,e.root,o);e.playbacks.push(n),e.map[t.id][o.time]=n}}))})},e.prototype.onPropsChanged=function(){this.rebuild()},e.prototype.dispose=function(){this.playbacks.forEach(function(e){e.dispose()}),this.model.removeListener("ondatachanged",this.onDataChanged),this.model.removeListener("toggle-play",this.onTogglePlay),this.model.removeListener("toggle-time-scrub",this.onToggleTimeScrub),this.model.removeListener("time-scrub",this.onTimeScrub),this.playbacks=[]},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"./audio-playback":3}],5:[function(e,t,o){"use strict";var i=e("node-pid-controller"),n=e("./two-way-controller"),a=function(){function e(e){this.pid=new i(5,1,.02,!1),this._target=0,this.pid.setTarget(this._target),this.audio=new n.default(e),this.isPlaying=!1}return e.prototype.load=function(e){var t=this;this.audio.load(function(){t.isPlaying=!0,e()})},e.prototype.playAtTime=function(e,t){void 0===t&&(t=1),this.audio.playAtTime(e,t)},e.prototype.stop=function(){this.isPlaying=!1,this.audio.stop()},Object.defineProperty(e.prototype,"target",{set:function(e){var t=this.audio.currentTime-e,o=this.pid.update(t);this.audio.playbackRate=o},enumerable:!0,configurable:!0}),e.prototype.zeroPid=function(){this.pid.update(0)},Object.defineProperty(e.prototype,"currentTime",{get:function(){return this.audio.currentTime},set:function(e){this.audio.currentTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this.audio.duration},enumerable:!0,configurable:!0}),e.prototype.getSamples=function(e){return this.audio.getSamples(e)},e.prototype.reset=function(){this.pid.reset()},e.prototype.dispose=function(){this.audio.dispose(),this.audio=null,this.pid=null},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{"./two-way-controller":6,"node-pid-controller":void 0}],6:[function(e,t,o){"use strict";var i=e("./audio-controller"),n=e("async"),a={FORWARD:0,REVERSE:1},r=function(){function e(e){this.forward=new i.default(e),this.reverse=new i.default(e,!0),this.direction=a.FORWARD,this.forward.onCurrentTime=this.onCurrentTime.bind(this),this._currentTime=0}return Object.defineProperty(e.prototype,"duration",{get:function(){return this.forward.duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._currentTime},set:function(e){this._currentTime=e,this.reverse.currentTime=this.forward.duration-e,this.forward.currentTime=e,this.direction===a.REVERSE?this.forward.stop():this.reverse.stop()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(e){this._playbackRate=e,e>=0&&this.direction===a.REVERSE?(this.direction=a.FORWARD,this.forward.currentTime=this._currentTime,this.forward.onCurrentTime=this.onCurrentTime.bind(this),this.reverse.onCurrentTime=null,this.reverse.stop()):e<0&&this.direction===a.FORWARD&&(this.direction=a.REVERSE,this.reverse.currentTime=this.forward.duration-this._currentTime,this.reverse.onCurrentTime=this.onCurrentTime.bind(this),this.forward.onCurrentTime=null,this.forward.stop()),this.direction===a.FORWARD?this.forward.playbackRate=e:this.direction===a.REVERSE&&(this.reverse.playbackRate=-e)},enumerable:!0,configurable:!0}),e.prototype.load=function(e){var t=this;n.parallel([function(e){t.forward.load(e)},function(e){t.reverse.load(e)}],e)},e.prototype.stop=function(e){void 0===e&&(e=0),this.currentTime=e,this.forward.stop(),this.reverse.stop()},e.prototype.onCurrentTime=function(e){this.direction===a.REVERSE?this._currentTime=this.forward.duration-e:this._currentTime=e},e.prototype.playAtTime=function(e,t){void 0===t&&(t=1),this._currentTime=e||0,this._playbackRate=t,this.direction===a.REVERSE&&(this.direction=a.FORWARD,this.forward.onCurrentTime=this.onCurrentTime.bind(this),this.reverse.onCurrentTime=null,this.reverse.stop()),this.forward.currentTime=this._currentTime,this.forward.playbackRate=this._playbackRate},e.prototype.dispose=function(){this.forward.onCurrentTime=null,this.forward.dispose(),this.reverse.onCurrentTime=null,this.reverse.dispose(),this.forward=null,this.reverse=null},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./audio-controller":2,async:void 0}],7:[function(e,t,o){"use strict";var i=e("animation-utilities"),n=e("atom"),a=e("animation-utilities"),r=e("./dof-controller"),s=e("../views/three-debug"),l=new a.JiboConfig,d=function(){function e(e){this.animationModel=e,this.disposable=new n.CompositeDisposable}return e.prototype.dispose=function(){this.disposable.dispose()},e.prototype.onMouseDown=function(e){this.container.focus(),this.onMouseChange(e)},e.prototype.onMouseChange=function(e){this.renderer&&(this.animationModel.keyframeSelection.isMultiSelect()||!this.animationModel.isLayerOfTypeSelected("Body")?(this.container.childNodes[1].pointerEvents="none",this.container.childNodes[1].style.cursor="not-allowed"):(this.container.childNodes[1].pointerEvents="",this.container.childNodes[1].style.cursor="pointer"))},e.prototype._getThreeColorFromConfig=function(e){var t=atom.config.get("jibo-sdk."+e);return new i.THREE.Color(t.red/255,t.green/255,t.blue/255)},e.prototype._updateBackgroundColor=function(){var e=this._getThreeColorFromConfig("AnimationEditorBackgroundColor");this.renderer.setBackgroundColor(e.r,e.g,e.b,1)},e.prototype._updateGridColor=function(){this.renderer.setGrid(.05,6,this._getThreeColorFromConfig("AnimationEditorGridColor"))},e.prototype.getPaddedValueString=function(e){var t=e<10?"0":"";return t+e},e.prototype.setCamera=function(e){var t=this,o=.35,n=.5,a=new i.THREE.Vector3(0,0,.15);this.renderer.scene._controls.reset();var r={front:function(){t.renderer.setCamera(new i.THREE.Vector3(n,0,o),a,45)},back:function(){t.renderer.setCamera(new i.THREE.Vector3(-n,0,o),a,45)},left:function(){t.renderer.setCamera(new i.THREE.Vector3(0,n,o),a,45)},right:function(){t.renderer.setCamera(new i.THREE.Vector3(0,-n,o),a,45)}};r[e]()},e.prototype.initialize=function(e,t){var o=this;this.container=e,e.addEventListener("mousemove",this.onMouseChange.bind(this),!0),e.addEventListener("mousedown",this.onMouseDown.bind(this),!0),e.addEventListener("mouseup",this.onMouseChange.bind(this),!0),a.RobotInfo.createInfo(l,function(n){a.visualize.createRobotRenderer(n,e,a.visualize.DisplayType.BODY,function(a){a&&(o.renderer=a,o.robotInfo=n,o.dofValues=n.getDefaultDOFValues(),o.debug=new s.default(o.renderer.scene.getScene()),a.setCamera(new i.THREE.Vector3(.5,0,.35),new i.THREE.Vector3(0,0,.15),45),o.dofController=r.default.createWithRenderer(o.renderer,e,r.default.ControllerType.BODY,n),o.dofController.setDOFValues(o.dofValues),o.listenForChanges(),o._updateBackgroundColor(),o.disposable.add(atom.config.observe("jibo-sdk.AnimationEditorBackgroundColor",function(){o._updateBackgroundColor()})),o._updateGridColor(),o.disposable.add(atom.config.observe("jibo-sdk.AnimationEditorGridColor",function(){o._updateGridColor()})),t(null))})})},e.prototype.listenForChanges=function(){var e=this,t=this;this.dofController.on(r.default.EventType.DOF_VALUES_CHANGED,function(o,i){var n=e.animationModel.getLayersOfType("Body");0!==n.length&&"Body"===e.animationModel.getSelectedLayer().type&&(i.topSection_r&&t.animationModel.updateSelectedLayerPropertiesRelative({Head:i.topSection_r/Math.PI*180}),i.middleSection_r&&t.animationModel.updateSelectedLayerPropertiesRelative({Torso:i.middleSection_r/Math.PI*180}),i.bottomSection_r&&t.animationModel.updateSelectedLayerPropertiesRelative({Pelvis:i.bottomSection_r/Math.PI*180}))}),this.dofController.on(r.default.EventType.DOF_SELECTION_CHANGED,function(e,t){1!==t.length}),this.dofController.on(r.default.EventType.DOF_MANIPULATION_ENDED,function(){t.animationModel.addRedoUndoEntry()})},e.prototype.updateDofValues=function(e){this.dofValues=e,this.dofController&&this.dofController.setDOFValues(this.dofValues)},e.prototype.update=function(){this.renderer&&this.renderer.display(this.dofValues)},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=d},{"../views/three-debug":45,"./dof-controller":8,"animation-utilities":void 0,atom:void 0}],8:[function(e,t,o){"use strict";var i=e("animation-utilities"),n={DOF_VALUES_CHANGED:"DOF_VALUES_CHANGED",DOF_SELECTION_CHANGED:"DOF_SELECTION_CHANGED",DOF_MANIPULATION_ENDED:"DOF_MANIPULATION_ENDED"},a={BODY:"BODY"},r=function(e,t,o,i){if(o!==a.BODY)throw new Error("DOFController: unsupported controller type: "+o);return new c(e,t,o,i)},s="topSection_r",l="middleSection_r",d="bottomSection_r",c=function(e,t,o,a){this.renderer=e,this.scene=e.scene,this.controllerType=o,this.robotInfo=a,e.setGrid(.1,4,new i.THREE.Color(.2,.2,.2)),this.dofValues={};for(var r=a.getDOFNames(),c=0;c<r.length;c++)this.dofValues[r[c]]=0;this.selectedDOFs=[],this.eventListeners={},this.eventListeners[n.DOF_VALUES_CHANGED]=[],this.eventListeners[n.DOF_SELECTION_CHANGED]=[],this.eventListeners[n.DOF_MANIPULATION_ENDED]=[],this.lockingMode=!1;var u=this,h=!1,m=null,f=!1,v=!1,y=!1,g=function(t){if(3===t.which)return!1;var o=!t.altKey&&!t.metaKey&&!t.ctrlKey;return o?e.scene._controls.enabled=!1:e.scene._controls.enabled=!0,o},b=function(e,t){var o;if(t){if(null!==u.getSelectedDOFs()&&u.getSelectedDOFs().length>0){o=u.getSelectedDOFs()[0],v=!0;var i=.5*e.movementX*Math.PI/180,a=u.dofValues[o]+i,r={};r[o]=a,e.shiftKey&&(o===l&&(r[s]=u.dofValues[s]-i),o===d&&(r[l]=u.dofValues[l]-i)),u.setDOFValues(r),u._fireEvent(n.DOF_VALUES_CHANGED,r)}}else o=p(e,m,u.scene.getScene(),u.scene.getCamera()),o&&(u.setSelectedDOFs([o]),u._fireEvent(n.DOF_SELECTION_CHANGED,u.getSelectedDOFs()))},k=function(e){y&&f&&g(e)&&b(e,!0)},S=function(){y&&(y=!1,f&&(v&&(v=!1,u._fireEvent(n.DOF_MANIPULATION_ENDED)),null!==u.getSelectedDOFs()&&u.getSelectedDOFs().length>0&&(u.setSelectedDOFs([]),u._fireEvent(n.DOF_SELECTION_CHANGED,u.getSelectedDOFs()))))},w=function(e){y=!0,f&&g(e)&&b(e,!1)};this.detachFromContainer=function(e){void 0!==e&&e!==!0||u.renderer.detachFromContainer(),null!==m&&(m.removeEventListener("mousemove",k,h),m.removeEventListener("mouseup",S,h),m.removeEventListener("mouseleave",S,h),m.removeEventListener("mousedown",w,h),v&&(v=!1,u._fireEvent(n.DOF_MANIPULATION_ENDED)),null!==u.getSelectedDOFs()&&u.getSelectedDOFs().length>0&&(u.setSelectedDOFs([]),u._fireEvent(n.DOF_SELECTION_CHANGED,u.getSelectedDOFs())),f=!1,m=null)},this.attachToContainer=function(e,t){u.detachFromContainer(t),m=void 0!==e?e:null,null!==m&&(void 0!==t&&t!==!0||u.renderer.attachToContainer(m),m.addEventListener("mousemove",k,h),m.addEventListener("mouseup",S,h),m.addEventListener("mouseleave",S,h),m.addEventListener("mousedown",w,h),f=!0)},this.dispose=function(e){u.detachFromContainer(!1),null!==u.renderer&&(void 0!==e&&e!==!0||u.renderer.dispose(),u.renderer=null),u.scene=null,u.robotInfo=null,u.eventListeners=null},this.attachToContainer(t,!1)};c.prototype.getDOFValues=function(){return this.dofValues},c.prototype.setDOFValues=function(e){for(var t=Object.keys(e),o=0;o<t.length;o++)this.dofValues[t[o]]=e[t[o]];this.renderer.display(this.dofValues)},c.prototype.getSelectedDOFs=function(){return this.selectedDOFs},c.prototype.setSelectedDOFs=function(e){this.selectedDOFs=e},c.prototype.on=function(e,t){var o=this.eventListeners[e];if(void 0===o)throw new Error("DOFController: unsupported event type: "+e);o.push(t)},c.prototype.setLockingMode=function(e){this.lockingMode=e},c.prototype._fireEvent=function(e){var t=this.eventListeners[e];if(void 0===t)throw new Error("DOFController: unsupported event type: "+e);for(var o=[this],i=1;i<arguments.length;i++)o.push(arguments[i]);for(var n=0;n<t.length;n++)t[n].apply(null,o)};var u={};u[s]=["headMeshMesh","maskMeshMesh","screenMeshBillboardMesh"],u[l]=["torsoMeshMesh"],u[d]=["pelvisMeshMesh","lightringMeshMesh"];var h={};!function(){for(var e=Object.keys(u),t=0;t<e.length;t++)for(var o=u[e[t]],i=0;i<o.length;i++)h[o[i]]=e[t]}();var p=function(e,t,o,n){var a=i.MouseCoordinateWrangler.getLocalCoordinatesNDCCentered(e,t),r=new i.THREE.Raycaster;r.linePrecision=.01,r.setFromCamera(a,n);var s=r.intersectObject(o,!0);if(s.length>0){var l=h[s[0].object.name];return l||null}return null};Object.defineProperty(o,"__esModule",{value:!0}),o.default={EventType:n,ControllerType:a,createWithRenderer:r}},{"animation-utilities":void 0}],9:[function(e,t,o){"use strict";function i(e,t,o){var i=[t,0];return w.apply(i,E.call(arguments,2)),M.apply(e,i),e}var n=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},a=e("events"),r=e("jibo-keyframes"),s=r.JiboKeyframeInfo,l=e("lodash"),d=e("../../common/undo-redo"),c=e("../../common/clipboard"),u=e("animation-utilities"),h=e("./keyframe-selection"),p=e("fs"),m=e("path"),f=e("crypto"),v=e("./keyframes-compositer"),y="win32"===process.platform?process.env.HOMEPATH:process.env.HOME,g=m.resolve(y,".jibo");p.existsSync(g)||p.mkdirSync(g);var b=m.resolve(g,"temp");p.existsSync(b)||p.mkdirSync(b);var k=function(e){function t(t,o){var i=e.call(this)||this;i.setMaxListeners(100),i.limits={},i.editor=t,i.projectRoot=o,i.compositer=new v.default(m.dirname(i.editor.uri)),i.state={selection:{layers:[null]}},i.keyframeSelection=new h.default(i),i.uiState={currentTime:0,currentKeyframe:0,isPlaying:!1},i.getDofLimits(),i._reloadFile(t.uri);var n=f.createHash("md5");n.update(t.uri);var a=n.digest("hex"),r=m.basename(a),s=b+"/"+r+".backup";return p.existsSync(s)||i.backup(),i.undoRedo=new d.default(i),i}return n(t,e),t.createNewFile=function(e){var t=r.runtime.create(s);r.runtime.save(e,t)},t.prototype.dispose=function(){delete this.state,delete this.uiState,this.requestAnimationID&&window.cancelAnimationFrame(this.requestAnimationID)},t.prototype.getCompositedKeyframes=function(){return this.compositer.compositeKeyframes(this.state.keyframes)},t.prototype.getDofLimits=function(){var e=this,t=new u.JiboConfig;u.RobotInfo.createInfo(t,function(t){t.getBodyDOFNames().forEach(function(o){var i=r.channels.dofNameToDisplayName(o);e.limits[i]={};var n=t.getDOFInfo(o),a=n.getLimit("velocity"),s=n.getLimit("acceleration");e.limits[i].velocityLimit=a,e.limits[i].accelerationLimit=s}),e.robotInfo=t,e.emit("onpropertieschanged")})},t.prototype.setLimit=function(e,t){this.limits.exceedsVelLimit=e,this.limits.exceedsAccelLimit=t},t.prototype.getKeyframeInfo=function(){return s},t.prototype.getLayer=function(e){for(var t=0;t<this.state.keyframes.layers.length;t++)if(this.state.keyframes.layers[t].id===e)return this.state.keyframes.layers[t];return null},t.prototype.getLayersOfType=function(e){e=Array.isArray(e)?e:[e];var t=l.filter(this.state.keyframes.layers,function(t){return l.includes(e,t.type)});return t},t.prototype.getCompositedLayersOfType=function(e){e=Array.isArray(e)?e:[e];var t=l.filter(this.getCompositedKeyframes().layers,function(t){return l.includes(e,t.type)});return t},t.prototype.isLayerOfTypeSelected=function(e){return e=Array.isArray(e)?e:[e],l.includes(e,this.keyframeSelection.getSelectionLayerType())},t.prototype.deleteLayerById=function(e){for(var t=this.getSelectedLayer().id,o=0;o<this.state.keyframes.layers.length;o++)if(this.state.keyframes.layers[o].id===e)return this.state.keyframes.layers.splice(o,1),0===this.state.keyframes.layers.length?this.state.selection.layers[0]=null:t===e&&this.setSelection(this.state.keyframes.layers[0].id),this.syncOverrides(),this.emit("ondatachanged"),void this.emit("onpropertieschanged")},t.prototype.setLayerName=function(e,t){var o=this.getLayer(e);o.name=t,this.emit("ondatachanged"),this.emit("onpropertieschanged")},t.prototype.generateID=function(){return Math.floor(0x12ab3babf5f80c00*Math.random()).toString(16)},t.prototype._findNameForLayer=function(e){if(null===this.getLayerByName(e))return e;for(var t=1;t<1e5;t++){var o=e+" #"+t;if(null===this.getLayerByName(o))return o}},t.prototype.addLayer=function(e,t){var o={id:r.generateId(),name:t||this._findNameForLayer(e),type:e,visible:!0,locked:!1,keyframes:[]};"Overlay"===e&&o.keyframes.push({time:0,value:this.getDefaultPropsForLayerType(e)}),this.state.keyframes.layers.push(o),this.syncOverrides(),1===this.state.keyframes.layers.length&&this.setSelection(this.state.keyframes.layers[0].id),this.emit("ondatachanged"),this.emit("onpropertieschanged")},t.prototype._addLayerFromData=function(e){var t={id:r.generateId(),name:e.name,type:e.type,visible:e.visible,locked:e.locked,keyframes:l.cloneDeep(e.keyframes)};return this.state.keyframes.layers.push(t),t.id},t.prototype.undo=function(){this.undoRedo.undo(),this.emit("onpropertieschanged")},t.prototype.redo=function(){this.undoRedo.redo(),this.emit("onpropertieschanged")},t.prototype.cut=function(){this.copy(),this.keyframeSelection.deleteKeyframes()},t.prototype.cutKeyByTime=function(e,t){this.copyKeyByTime(e,t),this.deleteKeyByTime(e,t)},t.prototype.cutLayer=function(e){this.copyLayer(e),this.deleteLayerById(e),this.emit("onpropertieschanged"),this.emit("ondatachanged")},t.prototype.copy=function(){var e=this,t=this.getSelectedLayer();if(null!==t){var o=l.findIndex(t.keyframes,function(t){return t.time===e.uiState.currentKeyframe});this._copyKey(t,o)}},t.prototype.copyKeyByTime=function(e,t){var o=this.getLayer(e),i=l.findIndex(o.keyframes,function(e){return e.time===t});this._copyKey(o,i)},t.prototype._copyKey=function(e,t){if(null!==e&&t!==-1){var o={type:"keyframe",layerType:e.type,value:l.cloneDeep(e.keyframes[t].value)};c.default.animationData=JSON.stringify(o)}},t.prototype.copyLayer=function(e){var t=this.getLayer(e),o={type:"layer",object:l.cloneDeep(t)};c.default.animationData=JSON.stringify(o)},t.prototype.canPasteLayer=function(){if(void 0!==c.default.animationData){var e=JSON.parse(c.default.animationData),t="layer"===e.type;return t}return!1},t.prototype.paste=function(){this._pasteKey(this.getSelectedLayer(),this.uiState.currentKeyframe)},t.prototype._pasteKey=function(e,t){},t.prototype.pasteKeyByTime=function(e,t){var o=this.getLayer(e);this._pasteKey(o,t)},t.prototype.pasteLayer=function(e){if(this.canPasteLayer()){var t=JSON.parse(c.default.animationData),o=this._addLayerFromData(t.object);this.reorderToAfterLayer(o,e),this.syncOverrides(),this.emit("ondatachanged"),this.emit("onpropertieschanged"),this.addRedoUndoEntry()}},t.prototype.getData=function(){return this.state},t.prototype.getMutationFunctionNames=function(){return["reloadFile","addRedoUndoEntry","upsertKeyframes","resetKeyframes","setLayerName","addLayer","insertBlankFrame","deleteFrame","deleteLayerById","deleteKeysByLayerId","deleteKeyByTime","addKeyByTime"]},t.prototype.reload=function(e){var t=this.state.selection.layers[0];this.state=e;var o=this.getSelectedLayer();o||(0!==this.state.keyframes.layers.length?this.state.selection.layers[0]=this.state.keyframes.layers[0].id:this.state.selection.layers[0]=null),this.uiState.currentKeyframe>=this.state.keyframes.duration&&this.setKeyframe(this.state.keyframes.duration-1),this.isPlaying()&&this.togglePlay(),t!==this.state.selection.layers[0]&&this.emit("layerselected")},t.prototype.reloadFile=function(){this._reloadFile(this.editor.uri)},t.prototype._reloadFile=function(e){var t=this;return this.state?(this.state.keyframes=r.runtime.load(e,s),this.state.overrides={},this.state.keyframes.layers.forEach(function(e){t.state.overrides[e.id]={}}),this.syncOverrides(),this.reload(this.state),this.emit("ondatachanged"),void this.emit("onpropertieschanged")):(console.warn("attempting to reload destroyed AM for ",this),"")},t.prototype.getDuration=function(){return this.state.keyframes.duration},t.prototype.setDuration=function(e,t,o){return this.state.keyframes.duration=this.multiplier&&!t?Math.ceil(e*this.multiplier):e,o&&(this.state.keyframes.layers.forEach(function(t){var o=l.findIndex(t.keyframes,function(t){return t.time>=e});o!==-1&&(t.keyframes=t.keyframes.slice(0,o))}),this.uiState.currentKeyframe>=this.state.keyframes.duration&&this.setKeyframe(this.state.keyframes.duration-1),this.keyframeSelection.validateSelection()),this.emit("ondatachanged"),this.emit("onpropertieschanged"),this.state.keyframes.duration},t.prototype.setKeyframes=function(){var e=this;this.multiplier&&(this.state.keyframes.layers.forEach(function(t){t.keyframes.forEach(function(t){t.time=Math.floor(t.time*e.multiplier)})}),this.syncOverrides(),this.emit("ondatachanged"),this.emit("onpropertieschanged"))},t.prototype.setScale=function(e){e!==this.state.keyframes.scale&&(this.state.keyframes.scale&&(this.multiplier=e/this.state.keyframes.scale),this.state.keyframes.scale=e)},t.prototype.insertBlankFrame=function(e){var t=this,o=[];this.keyframeSelection.forEachLayerSelected(!0,function(e){o.push(t.getLayer(e))});var i=this.keyframeSelection.getLengthSelected();this.setDuration(this.state.keyframes.duration+i,!0,!0),o.forEach(function(t){t.keyframes.forEach(function(t){t.time>=e&&(t.time+=i)})}),this.emit("ondatachanged"),this.emit("onpropertieschanged")},t.prototype.deleteFrame=function(e){var t=this,o=[];this.keyframeSelection.forEachLayerSelected(!0,function(e){o.push(t.getLayer(e))});var i=this.keyframeSelection.getLengthSelected();o.forEach(function(o){for(var n=0;n<o.keyframes.length;n++){var a=o.keyframes[n];a.time>e+i?a.time-=i:a.time>=e&&a.time<e+i&&(t._deleteKeyframe(o,a),
n-=1)}}),this.emit("ondatachanged"),this.emit("onpropertieschanged")},t.prototype.setSelection=function(e){this.state.selection.layers[0]=e,this.keyframeSelection.validateSelection(),this.emit("ondatachanged"),this.emit("layerselected")},t.prototype.getSelectedLayer=function(){for(var e=this.state.selection.layers[0],t=0;t<this.state.keyframes.layers.length;t++)if(this.state.keyframes.layers[t].id===e)return this.state.keyframes.layers[t];return null},t.prototype.getSelectedLayerProperties=function(){var e=this.getSelectedLayer();return this.state.overrides[e.id]},t.prototype.reorderToBeforeLayer=function(e,t){var o=this.getLayer(e),i=l.indexOf(this.state.keyframes.layers,o);this.state.keyframes.layers.splice(i,1);var n=this.getLayer(t),a=l.indexOf(this.state.keyframes.layers,n);this.state.keyframes.layers.splice(a,0,o),this.emit("ondatachanged")},t.prototype.reorderToAfterLayer=function(e,t){var o=this.getLayer(e),i=l.indexOf(this.state.keyframes.layers,o);this.state.keyframes.layers.splice(i,1);var n=this.getLayer(t),a=l.indexOf(this.state.keyframes.layers,n);this.state.keyframes.layers.splice(a+1,0,o),this.emit("ondatachanged")},t.prototype.getLayerIndex=function(e){return l.indexOf(this.state.keyframes.layers,this.getLayer(e))},t.prototype.getLayerCount=function(){return this.state.keyframes.layers.length},t.prototype.getLayerByIndex=function(e){return this.state.keyframes.layers[e]},t.prototype.getLayerByName=function(e){var t=l.findIndex(this.state.keyframes.layers,function(t){return t.name===e});return t!==-1?this.state.keyframes.layers[t]:null},t.prototype.isPreviousLayer=function(e,t){var o=this.getLayerIndex(e),i=this.getLayerIndex(t);return o===i-1},t.prototype.isNextLayer=function(e,t){var o=this.getLayerIndex(e),i=this.getLayerIndex(t);return o===i+1},t.prototype.updateSelectedLayerProperties=function(e){var t=this.getSelectedLayer(),o=t.id;this.state.overrides[o]=l.merge({},this.getOverridesOrDefaults(t),l.cloneDeep(e)),this.emit("ondatachanged")},t.prototype.updateSelectedLayerPropertiesRelative=function(e){var t=this.getDefaultPropsForLayerType(this.getSelectedLayer().type);e=r.runtime.computeRelativePropValues(this.getSelectedLayer(),this.state.keyframes,s,this.uiState.currentTime,e,t),this.updateSelectedLayerProperties(e)},t.prototype.getOverridesOrDefaults=function(e){return l.cloneDeep(this.state.overrides[e.id])||this.getDefaultPropsForLayerType(e.type)},t.prototype.addRedoUndoEntry=function(){},t.prototype.backup=function(){var e=f.createHash("md5");e.update(this.editor.uri);var t=e.digest("hex"),o=m.basename(t),i=b+"/"+o+".backup";this.saveFile(i)},t.prototype.toggleLayerVisibility=function(e){var t=this.getLayer(e);t.visible=!t.visible,this.emit("ondatachanged"),this.emit("onpropertieschanged"),this.addRedoUndoEntry()},t.prototype.toggleLayerLocked=function(e){var t=this.getLayer(e);t.locked=!t.locked,this.emit("ondatachanged"),this.emit("onpropertieschanged"),this.addRedoUndoEntry()},t.prototype.updateAnimationDBData=function(e,t){this.state.keyframes.animdb||(this.state.keyframes.animdb={}),this.state.keyframes.animdb[e]=t,this.emit("ondatachanged"),this.emit("onpropertieschanged"),this.addRedoUndoEntry()},t.prototype.deleteKeyByTime=function(e,t){var o=this.getLayer(e),i=l.find(o.keyframes,function(e){return e.time===t});this._deleteKeyframe(o,i)&&(this.syncOverrides(),this.emit("ondatachanged"),this.emit("onpropertieschanged"))},t.prototype._deleteKeyByTime=function(e,t){var o=this,i=this.getLayer(e);l.remove(i.keyframes,function(e){return o.syncOverrides(),o.emit("ondatachanged"),o.emit("onpropertieschanged"),e.time===t})},t.prototype._deleteKeyframe=function(e,t){return!!t&&(l.remove(e.keyframes,function(e){return e===t}),!0)},t.prototype.deleteKeysByLayerId=function(e){var t=this.getLayer(e),o=0!==t.keyframes.length;t.keyframes=[],o&&(this.syncOverrides(),this.emit("ondatachanged"),this.emit("onpropertieschanged"))},t.prototype.upsertKeyframes=function(e){var t=this,o=e?this.state.keyframes.layers:[this.getLayer(this.state.selection.layers[0])],i=[];o.forEach(function(e){var o=e.id;if(!e.locked){var n=l.find(e.keyframes,function(e){return e.time===t.uiState.currentKeyframe});n?(n.value=l.cloneDeep(t.state.overrides[o]),i.push(e)):t._addKeyframe(e,t.uiState.currentKeyframe)}}),0!==i.length&&this.emit("onkeyframeupsert",{keyframeTime:this.uiState.currentKeyframe,layers:i}),this.emit("ondatachanged"),this.emit("onpropertieschanged")},t.prototype.addKeyByTime=function(e,t){var o=this.getLayer(e);this._addKeyframe(o,t),this.emit("ondatachanged"),this.emit("onpropertieschanged")},t.prototype._addKeyframe=function(e,t){for(var o=!1,n={time:t,value:this.getOverridesOrDefaults(e)},a=0;a<e.keyframes.length;a++)if(e.keyframes[a].time>t){e.keyframes=i(e.keyframes,a,n),o=!0;break}o||e.keyframes.push(n),this.addRedoUndoEntry()},t.prototype.keyframeExists=function(e,t){var o=this.getLayer(e);return!!o&&l.findIndex(o.keyframes,function(e){return t===e.time})!==-1},t.prototype.getKeyframe=function(e,t){var o=this.getLayer(e);if(o){var i=l.findIndex(o.keyframes,function(e){return t===e.time});if(t!==-1)return o.keyframes[i]}return null},t.prototype.moveKeyframe=function(e,t,o,i,n,a){var r=this.getLayer(e),s=this.getLayer(o),d=l.findIndex(r.keyframes,function(e){return e.time===t}),c=r.keyframes[d];a||r.keyframes.splice(d,1),this.upsertKeyframe(s,i,c.value),this.syncOverrides(),n!==!1&&(this.emit("ondatachanged"),this.emit("onpropertieschanged"))},t.prototype.upsertKeyframe=function(e,t,o){var n=l.findIndex(e.keyframes,function(e){return e.time===t}),a={value:l.cloneDeep(o),time:t};if(n!==-1)e.keyframes[n]=a;else if(0===e.keyframes.length||e.keyframes[e.keyframes.length-1].time<t)e.keyframes.push(a);else{var r=l.findIndex(e.keyframes,function(e){return e.time>t});e.keyframes=i(e.keyframes,r,a)}},t.prototype.resetKeyframes=function(){for(var e in this.state.overrides)this.state.overrides[e]=this.getDefaultPropsForLayerType(this.getLayer(e).type)},t.prototype.syncOverrides=function(){var e=this;this.state.overrides={},this.state.keyframes.layers.forEach(function(t){var o=r.runtime.evaluateLayer(t,e.state.keyframes,s,e.uiState.currentTime);e.state.overrides[t.id]=o})},t.prototype.evaluateAllDOFLayers=function(){var e=this.getCompositedKeyframes(),t=r.runtime.evaluateAllDOFLayers(e,s,this.uiState.currentTime,this.state.overrides);return t},t.prototype.evaluateAllLayersFiltered=function(e){var t=r.runtime.evaluateAllLayersFiltered(this.state.keyframes,s,this.uiState.currentTime,e,!0,this.state.overrides);return t},t.prototype.getDefaultPropsForLayerType=function(e){var t=s.layerTypes[e].getInfo(),o={};for(var i in t.properties)o[i]=l.cloneDeep(t.properties[i].defaultValue);return o},t.prototype.saveFile=function(e){this.state?(r.runtime.save(e,this.state.keyframes),this.emit("save")):console.error("Attempting to save destroyed AM for uri ",this.editor.uri)},t.prototype.isLayerSelected=function(e){for(var t=0;t<this.state.selection.layers.length;t++)if(this.state.selection.layers[t]===e)return!0;return!1},t.prototype.isPlaying=function(){return this.uiState.isPlaying},t.prototype.playLoop=function(){var e=(new Date).getTime(),t=(e-this.lastLoopTime)/1e3;for(this.lastLoopTime=e,this.uiState.currentTime+=t;this.uiState.currentTime>this.state.keyframes.duration/this.state.keyframes.framerate;)this.uiState.currentTime-=this.state.keyframes.duration/this.state.keyframes.framerate;var o=Math.floor(this.uiState.currentTime*this.state.keyframes.framerate);this.uiState.currentKeyframe!==o&&this.setKeyframe(o,!0),this.requestAnimationID=window.requestAnimationFrame(this.playLoop.bind(this))},t.prototype.togglePlay=function(){this.isPlaying()?(window.cancelAnimationFrame(this.requestAnimationID),this.requestAnimationID=void 0):(this.lastLoopTime=(new Date).getTime(),this.requestAnimationID=window.requestAnimationFrame(this.playLoop.bind(this))),this.uiState.isPlaying=!this.uiState.isPlaying,this.emit("ondatachanged"),this.emit("toggle-play",this.uiState.isPlaying)},t.prototype.getCurrentTime=function(){return this.uiState.currentTime},t.prototype.stepTimeForward=function(){this.isPlaying()&&this.togglePlay(),this.setKeyframe((this.uiState.currentKeyframe+1)%this.state.keyframes.duration)},t.prototype.stepTimeBackward=function(){this.isPlaying()&&this.togglePlay(),0===this.uiState.currentKeyframe?this.setKeyframe(this.state.keyframes.duration-1):this.setKeyframe(this.uiState.currentKeyframe-1)},t.prototype.nextLayer=function(){if(!(this.state.keyframes.layers.length<2))for(var e=0;e<this.state.keyframes.layers.length;e++)if(this.state.keyframes.layers[e]===this.getSelectedLayer())return this.keyframeSelection._clearSelection(),this.setSelection(this.state.keyframes.layers[(e+1)%this.state.keyframes.layers.length].id),void this.addRedoUndoEntry()},t.prototype.previousLayer=function(){if(!(this.state.keyframes.layers.length<2))for(var e=0;e<this.state.keyframes.layers.length;e++)if(this.state.keyframes.layers[e]===this.getSelectedLayer()){this.keyframeSelection._clearSelection();var t=e>0?e-1:this.state.keyframes.layers.length-1;return this.setSelection(this.state.keyframes.layers[t].id),void this.addRedoUndoEntry()}},t.prototype.canMoveUp=function(e){if(this.state.keyframes.layers.length<2)return!1;var t=this.getLayerIndex(e),o=t>0?t-1:t;return t!==o},t.prototype.canMoveDown=function(e){if(this.state.keyframes.layers.length<2)return!1;var t=this.getLayerIndex(e),o=t<this.state.keyframes.layers.length-1?t+1:t;return t!==o},t.prototype.moveUp=function(e){if(this.canMoveUp(e)){var t=this.getLayerIndex(e)-1;this.reorderToBeforeLayer(e,this.getLayerByIndex(t).id),this.addRedoUndoEntry()}},t.prototype.moveDown=function(e){if(this.canMoveDown(e)){var t=this.getLayerIndex(e)+1;this.reorderToAfterLayer(e,this.getLayerByIndex(t).id),this.addRedoUndoEntry()}},t.prototype.goToNextKeyframe=function(){var e=this,t=Number.MAX_SAFE_INTEGER,o=this.state.selection.layers[0],i=this.getLayer(o);0!==i.keyframes.length&&(i.keyframes.forEach(function(o){o.time<=e.uiState.currentKeyframe||o.time>t||(t=o.time)}),t===Number.MAX_SAFE_INTEGER?this.setKeyframe(0):this.setKeyframe(t))},t.prototype.goToPrevKeyframe=function(){var e=this,t=-1,o=this.state.selection.layers[0],i=this.getLayer(o);0!==i.keyframes.length&&(i.keyframes.forEach(function(o){o.time>=e.uiState.currentKeyframe||o.time<t||(t=o.time)}),t===-1?(this.uiState.currentKeyframe=this.state.keyframes.duration,this.goToPrevKeyframe()):this.setKeyframe(t))},t.prototype.setKeyframe=function(e,t){void 0===t&&(t=!1),e!==this.uiState.currentKeyframe&&(this.uiState.currentKeyframe=e,t||(this.uiState.currentTime=e/this.state.keyframes.framerate),this.syncOverrides(),this.emit("ondatachanged"))},t}(a.EventEmitter),S=Array.prototype,w=S.push,E=S.slice,M=S.splice;Object.defineProperty(o,"__esModule",{value:!0}),o.default=k},{"../../common/clipboard":97,"../../common/undo-redo":110,"./keyframe-selection":10,"./keyframes-compositer":11,"animation-utilities":void 0,crypto:void 0,events:void 0,fs:void 0,"jibo-keyframes":void 0,lodash:void 0,path:void 0}],10:[function(e,t,o){"use strict";var i=e("lodash"),n=e("../../common/clipboard"),a={NORMAL:"NORMAL",TOGGLE:"TOGGLE"},r=function(){function t(e){this.animationModel=e,this.reset()}return t.prototype.reset=function(){this.animationModel.state.selection.keyframes={selected:{}},this.anchor={layerIndex:null,keyframeIndex:null}},t.prototype.validateSelection=function(){var e=this;for(var t in this.getState().selected){if(null===this.animationModel.getLayer(t))return void delete this.getState().selected[t];this.getState().selected[t]=i.filter(this.getState().selected[t],function(t){return t.time<e.animationModel.getDuration()})}},t.prototype.canDeleteKeyframes=function(){var e=this,t=!1;return this.forEachSelected(!0,!0,function(o,i){e.animationModel.keyframeExists(o,i)===!0&&(t=!0)}),t},t.prototype.canPasteAtLayer=function(e){var t=this.animationModel.getLayerIndex(e),o=this.animationModel.getLayerByIndex(t).type,i=this.getLayerMaps(e);if(!i)return!1;var n=i.srcLayers;return!this.isMultiSelect()&&1===n.length&&n[0].type===o},t.prototype.canPasteKeyframes=function(e,t){var o=this.getLayerMaps(e);if(!o)return!1;var i=this.intersectLayerMaps(o.srcMap,o.dstMap);return 0===i.length||t&&this.addLayersIfOkay(i)===!0},t.prototype.getLayerMaps=function(e){if("undefined"!=typeof n.default.animationData){var t=JSON.parse(n.default.animationData);if("keyframes"===t.type){for(var o=t.value,i=this.layersTolayerMap(o),a=this.animationModel.getLayerIndex(e),r=this.animationModel.getLayerCount(),s=[],l=a;l<r;l++){var d=this.animationModel.getLayerByIndex(l);d.locked||s.push(d)}var c=this.layersTolayerMap(s);return{srcMap:i,dstMap:c,srcLayers:o,dstLayers:s}}}},t.prototype.layersTolayerMap=function(e){for(var t={},o=0,i=e;o<i.length;o++){var n=i[o],a=n.type;a in t||(t[a]={}),n.name in t[a]?console.warn("Keyframes copy found non-unique layer name: "+n.name+" -- that layer will be ignored."):t[a][n.name]=n}return t},t.prototype.intersectLayerMaps=function(e,t){var o=[];for(var i in e){var n=i in t?t[i]:{};for(var a in e[i])a in n||o.push(e[i][a])}return o},t.prototype.addLayersIfOkay=function(t){for(var o=atom.getCurrentWindow(),i=e("remote"),n=i.dialog||i.require("dialog"),a="Your paste will add: ",r=0,s=t;r<s.length;r++){var l=s[r],d="aeiouy".indexOf(l.type.toLocaleLowerCase()[0])>=0?"an":"a";a+="\n "+d+" "+l.type+" layer called "+l.name}a+="\nWhat should we do?";var c=n.showMessageBox(o,{type:"question",buttons:["Cancel the Paste","Add the Extra Layers","Ignore the Extra Layers"],defaultId:1,title:"Clipboard has Extra Layers",message:a});if(0===c)return!1;if(1===c)for(var u=0,h=t;u<h.length;u++){var l=h[u];this.animationModel.addLayer(l.type,l.name)}return!0},t.prototype.forEachLayerSelected=function(e,t){var o=this,n=[];for(var a in this.getState().selected)n.push(a);n=i.sortBy(n,function(t){return e?o.animationModel.getLayerIndex(t):-o.animationModel.getLayerIndex(t)}),n.forEach(function(e){t(e)})},t.prototype.forEachSelected=function(e,t,o){var n=this;this.forEachLayerSelected(e,function(e){t?i.forEach(n.getState().selected[e],function(t,i){o(e,t,i)}):i.forEachRight(n.getState().selected[e],function(t,i){o(e,t,i)})})},t.prototype.getState=function(){return this.animationModel.state.selection.keyframes},t.prototype.includesKeyframes=function(){var e=function(e){for(var o=t.animationModel.getLayer(e),n=t.getState().selected[e],a=function(e){if(i.findIndex(o.keyframes,function(t){return t.time===n[e]})!==-1)return{value:!0}},r=0;r<n.length;r++){var s=a(r);if("object"==typeof s)return s}},t=this;for(var o in this.getState().selected){var n=e(o);if("object"==typeof n)return n.value}return!1},t.prototype.getSelectionLayerType=function(){if(this.isMultiSelect())throw new Error("Don't call KeyframeSelection.getSelectionLayerType() when KeyframeSelection.isMultiSelect() is true");var e=this.getCurrentKeyframe().layerId,t=e?this.animationModel.getLayer(e):void 0;return t?t.type:void 0},t.prototype.getCurrentKeyframe=function(){if(!this.isMultiSelect()){for(var e in this.getState().selected)if(this.getState().selected[e].length)return{keyframeIndex:this.getState().selected[e][0],layerId:e};var t=this.animationModel.getSelectedLayer();return{keyframeIndex:this.animationModel.uiState.currentTime,layerId:t?t.id:void 0}}throw new Error("KeyframeSelection.getCurrentKeyframe() should only be called when there aren't multiple keyframes selected")},t.prototype.getLengthSelected=function(){if(!this.isMultiSelect())return 1;var e=0,t=1e3;return this.forEachSelected(!1,!1,function(o,i){i>e?e=i:i<t&&(t=i)}),e-t+1},t.prototype.isSingleSelect=function(){return!this.isMultiSelect()},t.prototype.isMultiSelect=function(){var e=0;for(var t in this.getState().selected)if(e+=this.getState().selected[t].length,e>=2)return!0;return!1},t.prototype.isAnchor=function(e,t){return this.animationModel.getLayerIndex(e)===this.getState().anchor.layerIndex&&t===this.getState().anchor.keyframeIndex},t.prototype.isSelected=function(e,t){return"undefined"!=typeof this.getState().selected[e]&&i.findIndex(this.getState().selected[e],function(e){return e===t})!==-1},t.prototype.onClick=function(e,t,o){this.onMouseDown(e,t,o)},t.prototype.onMouseDown=function(e,t,o,i){void 0===i&&(i=!1),1!==e.nativeEvent.which&&(e.preventDefault(),e.stopPropagation());var n=a.NORMAL;if("win32"===process.platform?e.nativeEvent.ctrlKey&&(n=a.TOGGLE):e.nativeEvent.metaKey&&(n=a.TOGGLE),"click"!==e.type||!this.isSingleSelect()&&n!==a.TOGGLE){var r=this.isSelected(t,o);if("click"===e.type||n!==a.NORMAL||e.nativeEvent.shiftKey!==!1||!r){n===a.NORMAL&&("click"===e.type||e.nativeEvent.shiftKey===!0||r===!1&&"click"!==e.type&&e.nativeEvent.shiftKey!==!0)&&(this.animationModel.setKeyframe(o),this.animationModel.setSelection(t),this._clearSelection(),i=!0);var s=this.animationModel.getLayerIndex(t);if(e.nativeEvent.shiftKey===!1)this._addKeyframe(t,o,n)&&(i=!0);else for(var l=Math.min(this.anchor.layerIndex,s),d=Math.max(this.anchor.layerIndex,s),c=l;c<=d;c++)for(var u=Math.min(this.anchor.keyframeIndex,o),h=Math.max(this.anchor.keyframeIndex,o),p=u;p<=h;p++)this._addKeyframe(this.animationModel.getLayerByIndex(c).id,p,n)&&(i=!0);e.nativeEvent.shiftKey===!1&&(this.anchor.layerIndex=s,this.anchor.keyframeIndex=o);var m=this.animationModel.getLayerByIndex(s);m!==this.animationModel.getSelectedLayer()&&(this.animationModel.setSelection(t),i=!0),i&&(this.animationModel.addRedoUndoEntry(),this.animationModel.emit("ondatachanged"))}}},t.prototype.clearSelection=function(){this._clearSelection()&&(this.animationModel.addRedoUndoEntry(),this.animationModel.emit("ondatachanged"))},t.prototype.selectAll=function(){this._clearSelection();for(var e=0;e<this.animationModel.state.keyframes.layers.length;e++){var t=this.animationModel.state.keyframes.layers[e];this.getState().selected[t.id]=[];for(var o=0;o<this.animationModel.state.keyframes.duration;o++)this.getState().selected[t.id][o]=o}this.animationModel.emit("ondatachanged"),this.animationModel.addRedoUndoEntry()},t.prototype.deleteKeyframes=function(){this._deleteKeyframes();var e=!1;this._clearSelection()&&(e=!0),e&&(this.animationModel.syncOverrides(),this.animationModel.addRedoUndoEntry(),this.animationModel.emit("ondatachanged"),this.animationModel.emit("onpropertieschanged"))},t.prototype.moveSelection=function(e,t,o){var i=this,n=this,a=t.keyframeIndex-e.keyframeIndex,r=this.animationModel.getLayerIndex(t.layerId)-this.animationModel.getLayerIndex(e.layerId),s=!1,l={};if(this.forEachLayerSelected(!0,function(e){var t=i.animationModel.getLayerIndex(e),o=t+r;return o<0||o>=i.animationModel.getLayerCount()?void(l[e]=!0):void(i.animationModel.getLayerByIndex(t).type!==i.animationModel.getLayerByIndex(o).type&&(s=!0))}),!s){var d=a<0,c=r<0;if(this.forEachSelected(c,d,function(e,t,s){var l=i.animationModel.getLayerIndex(e)+r,d=i.animationModel.getLayerByIndex(l).id,c=t+a;i.animationModel.keyframeExists(e,t)&&(l>=0&&l<=n.animationModel.getLayerCount()-1&&c>=0&&c<=n.animationModel.getDuration()-1?n.animationModel.moveKeyframe(e,t,d,c,!0,o):o||n.animationModel._deleteKeyByTime(e,t));var u=i.getState().selected[e];u[s]=u[s]+a}),t.layerId!==e.layerId){for(var u in l)delete this.getState().selected[u];var h={};for(var u in this.getState().selected){var p=this.animationModel.getLayerIndex(u);h[this.animationModel.getLayerByIndex(p+r).id]=this.getState().selected[u]}this.getState().selected=h}this.animationModel.setSelection(t.layerId),this.animationModel.addRedoUndoEntry(),this.animationModel.emit("ondatachanged"),this.animationModel.emit("onpropertieschanged")}},t.prototype.cutSelectedKeyframes=function(){this.copySelectedKeyframes(),this.deleteKeyframes()},t.prototype.copySelectedKeyframes=function(){var e,t=this;if(this.isMultiSelect())e=this.getState().selected;else{var o=this.getCurrentKeyframe();if(void 0===o.layerId)return;e={},e[o.layerId]=[o.keyframeIndex]}var a=this.animationModel.getDuration()-1,r=this.animationModel.getLayerCount()-1;for(var s in e)r=Math.min(r,this.animationModel.getLayerIndex(s)),e[s].forEach(function(e){a=Math.min(a,e)});var l=[],d=function(o){var n=c.animationModel.getLayer(o),s={layerType:n.type,type:n.type,name:n.name,layerIndex:c.animationModel.getLayerIndex(o)-r,keyframes:[]};e[o].forEach(function(e){var n=t.animationModel.getKeyframe(o,e);n?s.keyframes.push({keyframeIndex:e-a,value:i.cloneDeep(n.value)}):s.keyframes.push({keyframeIndex:e-a,value:null})}),l.push(s)},c=this;for(var s in e)d(s);if(l=i.sortBy(l,function(e){return e.layerIndex}),l.length){var u={type:"keyframes",value:l};n.default.animationData=JSON.stringify(u)}},t.prototype.pasteKeyframes=function(e,t){var o=this.animationModel.getLayerByIndex(0).id;if(this.canPasteKeyframes(o,!0)!==!1){var i=this._clearSelection(),n=this.getLayerMaps(o),r=n.srcMap,s=n.dstMap,l=this.getFinalDurationOfCopy(r,s,t)+1;this.possiblyExtendDuration(l);var d=this.animationModel.getDuration(),c=[];for(var u in r){var h=r[u],p=s[u]||{};for(var m in h)if(m in p)for(var f=h[m],v=p[m],y=0,g=f.keyframes;y<g.length;y++){var b=g[y],k=b.keyframeIndex+t;if(k>=d)break;null!==b.value&&this.animationModel.upsertKeyframe(v,k,b.value),i=!0,c.push({id:v.id,index:k})}}i&&(this.animationModel.syncOverrides(),this.animationModel.emit("ondatachanged"),this.animationModel.emit("onpropertieschanged"),this.animationModel.addRedoUndoEntry());for(var S=0,w=c;S<w.length;S++){var E=w[S];this._addKeyframe(E.id,E.index,a.NORMAL)}}},t.prototype.pasteKeyframesAtLayer=function(e,t){if(this.canPasteAtLayer(e)!==!1){var o=this._clearSelection(),i=this.getLayerMaps(e),n=i.srcLayers,r=i.dstLayers,s=this.getFinalDurationOfSingleLayer(n,t)+1;this.possiblyExtendDuration(s);for(var l=this.animationModel.getDuration(),d=[],c=n[0],u=r[0],h=0,p=c.keyframes;h<p.length;h++){var m=p[h],f=m.keyframeIndex+t;if(f>=l)break;null!==m.value&&this.animationModel.upsertKeyframe(u,f,m.value),o=!0,d.push({id:u.id,index:f})}o&&(this.animationModel.syncOverrides(),this.animationModel.emit("ondatachanged"),this.animationModel.emit("onpropertieschanged"),this.animationModel.addRedoUndoEntry());for(var v=0,y=d;v<y.length;v++){var g=y[v];this._addKeyframe(g.id,g.index,a.NORMAL)}}},t.prototype.possiblyExtendDuration=function(t){var o=this.animationModel.getDuration();if(t>o){var i=atom.getCurrentWindow(),n=e("remote"),a=n.dialog||n.require("dialog"),r=t-o,s="You are pasting keyframes beyond the end of your animation. Would you like to extend the animation by "+r+" frames to make it fit?",l=a.showMessageBox(i,{type:"question",buttons:["No","Yes"],defaultId:1,title:"Paste Duration Exceeds Model",message:s});if(0===l)return!1;this.animationModel.setDuration(t,!0,!0)}},t.prototype.getFinalDurationOfCopy=function(e,t,o){var i=0;for(var n in e){var a=e[n],r=t[n]||{};for(var s in a)if(s in r){var l=a[s],d=l.keyframes[l.keyframes.length-1];i=Math.max(i,d.keyframeIndex)}}return i+o},t.prototype.getFinalDurationOfSingleLayer=function(e,t){var o=e[0],i=o.keyframes[o.keyframes.length-1].keyframeIndex;return i+t},t.prototype._clearSelection=function(){var e=!1;for(var t in this.getState().selected)this.getState().selected[t].length&&(e=!0);return this.getState().selected={},e},t.prototype._addKeyframe=function(e,t,o){var n,r=o===a.TOGGLE&&this.isSelected(e,t);if(r){if("undefined"==typeof this.getState().selected[e])return!1;n=this.getState().selected[e].length,i.remove(this.getState().selected[e],function(e){return e===t})}else{if("undefined"==typeof this.getState().selected[e])return this.getState().selected[e]=[t],!0;n=this.getState().selected[e].length,this.getState().selected[e].push(t),this.getState().selected[e].sort(function(e,t){return e-t}),this.getState().selected[e]=i.uniq(this.getState().selected[e])}return n!==this.getState().selected[e].length},t.prototype.hasLockedLayer=function(e){for(var t=e?[e]:Object.keys(this.getState().selected),o=0,i=t;o<i.length;o++){var n=i[o];if(this.animationModel.getLayer(n).locked)return!0}return!1},t.prototype._deleteKeyframes=function(){var e=function(e){var o=t.getState().selected[e],n=t.animationModel.getLayer(e);n.keyframes=i.filter(n.keyframes,function(e){return i.findIndex(o,function(t){return t===e.time})===-1})},t=this;for(var o in this.getState().selected)e(o)},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"../../common/clipboard":97,lodash:void 0,remote:void 0}],11:[function(e,t,o){"use strict";var i=e("jibo-keyframes"),n=e("jibo-keyframes"),a=e("path"),r=e("fs"),s=function(){function e(e){this.basepath=e,this.cache={},this.watchedFiles={}}return e.prototype.compositeKeyframes=function(e){var t=JSON.stringify(e);if(!(t in this.cache)){e=JSON.parse(t),this.cache[t]=this.processReferencesInKeyframes(e);Object.keys(this.cache).length}return this.cache[t]},e.prototype.nestedLoad=function(e,t){var o=i.runtime.load(e,n.JiboKeyframeInfo);return this.watchForChanges(e),this.hasCircularReference(o,t)?(console.warn("Circular reference detected in file: "+e),o):(this.fixLayerIds(o,t),this.dereferenceKeyframes(o))},e.prototype.watchForChanges=function(e){var t=this;e in this.watchedFiles||(this.watchedFiles[e]=!0,r.watch(e,function(e,o){t.cache={}}))},e.prototype.processReferencesInKeyframes=function(e){var t=this.dereferenceKeyframes(e);return this.removeHoldSafesInReferences(t),t},e.prototype.dereferenceKeyframes=function(e){for(var t=this.getKeyFileReferences(e),o=0,i=t;o<i.length;o++){var n=i[o];if(r.existsSync(n.url)&&r.statSync(n.url).isFile()){n.frames=this.nestedLoad(n.url,n.parentId);var a=n.holdFinalPose?n.nextRefStart:n.timeOffset+n.frames.duration;this.timeshift(n.frames,n.timeOffset,a,n.containerDuration-1),this.composite(n.layerNumber,e,n.frames)}else console.warn("Could not find referenced keys file "+n.url+" -- ignored.")}return this.removeReferenceLayers(e),e},e.prototype.getKeyFileReferences=function(e){for(var t=[],o=this.basepath,i=0;i<e.layers.length;i++){var n=e.layers[i];if("Reference"===n.type&&n.visible)for(var r=0;r<n.keyframes.length;r++){var s=n.keyframes[r],l=n.keyframes.length===r+1,d=l?1/0:n.keyframes[r+1].time;t.push({url:a.join(o,s.value.KeysFileReference.file),parentId:n.id,holdFinalPose:s.value.HoldFinalPose,containerDuration:e.duration,layerNumber:i,atEnd:l,nextRefStart:d,timeOffset:s.time})}}return t.reverse(),t},e.prototype.removeHoldSafesInReferences=function(e){for(var t=0,o=e.layers;t<o.length;t++){var i=o[t];if("Event"===i.type&&this.isReferencedLayer(i))for(var n=0,a=i.keyframes;n<a.length;n++){var r=a[n];"HOLD_SAFE"===r.value.Event.name&&(r.value.Event.name="REFERENCED_HOLD_SAFE")}}},e.prototype.removeReferenceLayers=function(e){for(var t=e.layers.length-1;t>=0;t--){var o=e.layers[t];"Reference"===o.type&&e.layers.splice(t,1)}},e.prototype.timeshift=function(e,t,o,i){for(var n=0,a=e.layers;n<a.length;n++){var r=a[n];void 0===r.validFrom?(r.validFrom=t,r.validUpto=o,r.holdAfter=i):(r.validFrom+=t,r.validUpto+=t,r.holdAfter+=t),r.validUpto>o&&(r.validUpto=o),r.holdAfter>i&&(r.holdAfter=i);for(var s=0,l=r.keyframes;s<l.length;s++){var d=l[s];d.time+=t}}},e.prototype.composite=function(e,t,o){for(var i=o.layers.length-1;i>=0;i--)t.layers.splice(e,0,o.layers[i])},e.prototype.fixLayerIds=function(e,t){for(var o=0,i=0,n=e.layers;i<n.length;i++){var a=n[i];a.id=t+"-"+a.id+"."+o,o++}},e.prototype.isReferencedLayer=function(e){return e.id.indexOf("-")>=0},e.prototype.hasCircularReference=function(e,t){for(var o=0,i=e.layers;o<i.length;o++){var n=i[o];if(t.indexOf(n.id)>=0)return!0}return!1},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=s},{fs:void 0,"jibo-keyframes":void 0,path:void 0}],12:[function(e,t,o){"use strict";var i=e("react"),n=e("./visualizer"),a=e("./timeline"),r=e("../../atom-react/mixins/pane-resize-event-mixin"),s=e("../../common/layout/layout"),l=e("../../common/layout/h-layout"),d=e("../../common/layout/v-layout"),c=e("./properties"),u=e("./pixi/pixi-view"),h=e("atom"),p=e("lodash"),m=e("fs"),f=e("jibo"),v=e("jibo-keyframes").JiboKeyframeInfo,y=i.createClass({displayName:"editor",mixins:[r.default],getInitialState:function(){return{visualizerWidth:0,visualizerHeight:0,timelineWidth:0,timelineHeight:0,focusOnProps:!0}},componentWillMount:function(){var e=this,t=this;this.props.editor.animationModel.on("ondatachanged",function(){t.forceUpdate()}),this.props.editor.animationModel.on("onpropertieschanged",function(){e.checkModified()}),this.props.editor.animationModel.on("save",function(){e.checkModified()})},checkModified:function(){var e=this;try{m.readFile(this.props.editor.uri,"utf8",function(t,o){var i=JSON.parse(o);v.onLoad(i),e.props.editor.animationModel.state&&(p.isEqual(i,e.props.editor.animationModel.state.keyframes)?e.props.editor.setModifiedStatus(!1):e.props.editor.setModifiedStatus(!0))})}catch(e){console.warn("error reading keyframes file, ",e)}},componentDidMount:function(){var e=this;this.setupPaneResizeEventMixin(),this.disposables=new h.CompositeDisposable,this.disposables.add(atom.commands.add(this.getDOMNode(),{"jibo-sdk:select-all-keyframes":this.selectAllKeyframes,"jibo-sdk:clear-keyframe-selection":this.clearKeyframeSelection,"jibo-sdk:upsert-keyframe":this.ifAllowed(this.upsertKeyframe),"jibo-sdk:upsert-all":this.upsertAllKeyframes,"jibo-sdk:reset-keyframes":this.ifAllowed(this.resetKeyframes),"jibo-sdk:delete":this.ifAllowed(this.deletePressed),"jibo-sdk:insert-blank-frame":this.ifAllowed(this.insertBlankFrame),"jibo-sdk:delete-frame":this.ifAllowed(this.deleteFrame),"jibo-sdk:start-playing":this.startPlaying,"jibo-sdk:stop-playing":this.stopPlaying,"jibo-sdk:step-backward":this.stepBackward,"jibo-sdk:step-forward":this.stepForward,"jibo-sdk:next-layer":this.nextLayer,"jibo-sdk:previous-layer":this.previousLayer,"core:undo":this.undo,"core:redo":this.redo,"core:cut":this.ifAllowed(this.cut),"core:copy":this.copy,"core:paste":this.ifAllowed(this.paste),"jibo-sdk:lose-focus":this.setEditorFocus,"jibo-sdk:upsert-and-save":this.ifAllowed(this.upsertAndSave)}));var t=this;requestAnimationFrame(function(){t.setState({visualizerWidth:Math.floor(e.props.paneWidth/2)-4,visualizerHeight:Math.floor(e.props.paneHeight/2)-4,timelineWidth:Math.floor(e.props.paneWidth/2)-4,timelineHeight:Math.floor(e.props.paneHeight/2)-20})}),this.onFocusInCB=this.onFocusIn.bind(this),this.getDOMNode().addEventListener("focusin",this.onFocusInCB,!0),this.onFocusOutCB=this.onFocusOut.bind(this),this.getDOMNode().addEventListener("focusout",this.onFocusOutCB,!0)},ifAllowed:function(e){var t=this;return function(o){t.props.editor.animationModel.keyframeSelection.hasLockedLayer()||e(o)}},onFocusIn:function(){},onFocusOut:function(e){this.props.editor.isPaneActive()!==!1&&(null!==e.relatedTarget&&e.relatedTarget!==document.getElementsByClassName("workspace")[0]||this.getDOMNode().focus())},startPlaying:function(){this.props.editor.animationModel.togglePlay()},stopPlaying:function(){this.props.editor.animationModel.isPlaying()&&this.props.editor.animationModel.togglePlay()},stepBackward:function(){this.props.editor.animationModel.stepTimeBackward(),this.props.editor.animationModel.keyframeSelection.clearSelection()},stepForward:function(){this.props.editor.animationModel.stepTimeForward(),this.props.editor.animationModel.keyframeSelection.clearSelection()},nextLayer:function(){this.props.editor.animationModel.nextLayer()},previousLayer:function(){this.props.editor.animationModel.previousLayer()},undo:function(){this.props.editor.animationModel.undo()},redo:function(){this.props.editor.animationModel.redo()},cut:function(){this.props.editor.animationModel.keyframeSelection.cutSelectedKeyframes()},copy:function(){this.props.editor.animationModel.keyframeSelection.copySelectedKeyframes()},paste:function(){if(this.props.editor.animationModel.keyframeSelection.isSingleSelect()){var e=this.props.editor.animationModel.keyframeSelection.getCurrentKeyframe();this.props.editor.animationModel.keyframeSelection.pasteKeyframes(e.layerId,e.keyframeIndex)}},deletePressed:function(){
this.props.editor.animationModel.keyframeSelection.deleteKeyframes()},selectAllKeyframes:function(){this.props.editor.animationModel.keyframeSelection.selectAll()},clearKeyframeSelection:function(){this.props.editor.animationModel.keyframeSelection.clearSelection()},upsertKeyframe:function(){this.props.editor.animationModel.keyframeSelection.isSingleSelect()&&this.props.editor.animationModel.upsertKeyframes()},upsertAllKeyframes:function(){this.props.editor.animationModel.keyframeSelection.isSingleSelect()&&this.props.editor.animationModel.upsertKeyframes(!0)},resetKeyframes:function(){this.props.editor.animationModel.keyframeSelection.isSingleSelect()&&this.props.editor.animationModel.resetKeyframes()},upsertAndSave:function(){this.props.editor.animationModel.keyframeSelection.isSingleSelect()&&this.upsertKeyframe(),atom.commands.dispatch(this.getDOMNode(),"core:save")},insertBlankFrame:function(){var e=1e4;this.props.editor.animationModel.keyframeSelection.forEachSelected(!0,!0,function(t,o){o<e&&(e=o)}),this.props.editor.animationModel.insertBlankFrame(e)},deleteFrame:function(){var e=1e4;this.props.editor.animationModel.keyframeSelection.forEachSelected(!0,!0,function(t,o){o<e&&(e=o)}),this.props.editor.animationModel.deleteFrame(e)},setEditorFocus:function(){this.getDOMNode().focus()},componentWillUnmount:function(){this.cleanupPaneResizeEventMixin(),this.disposables.dispose(),this.getDOMNode().removeEventListener("focusout",this.onFocusOutCB),this.getDOMNode().removeEventListener("focusin",this.onFocusInCB)},onInnerHLayoutResize:function(e){this.setState({visualizerWidth:e[0],timelineWidth:this.state.timelineWidth})},onHLayoutResize:function(e){this.setState({visualizerWidth:e[0],timelineWidth:e[0]})},onVLayoutResize:function(e){this.setState({visualizerHeight:e[0],timelineHeight:e[1]})},onCreated:function(e){this.setState({face:e})},render:function(){var e=f.utils.PathUtils.findRoot(this.props.editor.uri);return i.createElement("div",{tabIndex:1},i.createElement(s.default,{ref:"topLevel",width:this.props.paneWidth,height:this.props.paneHeight-40,serialized:this.props.editor.layout},i.createElement(l.default,{onLayoutResize:this.onHLayoutResize},i.createElement(d.default,{onLayoutResize:this.onVLayoutResize},i.createElement(l.default,{onLayoutResize:this.onInnerHLayoutResize},i.createElement(n.default,{animationModel:this.props.editor.animationModel,width:this.state.visualizerWidth,height:this.state.visualizerHeight,onCreated:this.onCreated}),i.createElement(u.default,{face:this.state.face,projectRoot:e,animationModel:this.props.editor.animationModel})),i.createElement(a.default,{playbackTime:this.props.editor.animationModel.uiState.currentKeyframe,onLabelonDoubleClick:this.onLabelonDoubleClick,animationModel:this.props.editor.animationModel,width:this.state.timelineWidth,height:this.state.timelineHeight,visualizerWidth:this.state.visualizerWidth,visualizerHeight:this.state.visualizerHeight})),i.createElement(c.default,{paneHeight:this.props.paneHeight,animationModel:this.props.editor.animationModel}))))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=y},{"../../atom-react/mixins/pane-resize-event-mixin":58,"../../common/layout/h-layout":103,"../../common/layout/layout":104,"../../common/layout/v-layout":105,"./pixi/pixi-view":25,"./properties":27,"./timeline":47,"./visualizer":48,atom:void 0,fs:void 0,jibo:void 0,"jibo-keyframes":void 0,lodash:void 0,react:void 0}],13:[function(e,t,o){"use strict";function i(e){var t,o,i,n,a=0,r=e[2];e[2]=e[3],e[3]=r;for(var s=0;s<e.length;s++)t=e[s].x,o=e[s].y,s===e.length-1?(i=e[0].x,n=e[0].y):(i=e[s+1].x,n=e[s+1].y),a+=t*n-i*o;return a<0}function n(e,t,o,i){var n=.5*parseInt(i.offsetWidth),a=.5*parseInt(i.offsetHeight);t.updateMatrixWorld(),t.geometry.boundingBox||t.geometry.computeBoundingBox();for(var r,s=[new e.Vector3(t.geometry.boundingBox.max.x,t.geometry.boundingBox.max.y,t.geometry.boundingBox.max.z),new e.Vector3(t.geometry.boundingBox.min.x,t.geometry.boundingBox.max.y,t.geometry.boundingBox.max.z),new e.Vector3(t.geometry.boundingBox.max.x,t.geometry.boundingBox.min.y,t.geometry.boundingBox.min.z),new e.Vector3(t.geometry.boundingBox.min.x,t.geometry.boundingBox.min.y,t.geometry.boundingBox.min.z)],l=[],d=0;d<s.length;d++)r=s[d].applyMatrix4(t.matrixWorld),r.project(o),r.x=r.x*n+n,r.y=-(r.y*a)+a,l.push({x:Math.floor(r.x),y:Math.floor(r.y)});return l}function a(e){return[e[4]*e[8]-e[5]*e[7],e[2]*e[7]-e[1]*e[8],e[1]*e[5]-e[2]*e[4],e[5]*e[6]-e[3]*e[8],e[0]*e[8]-e[2]*e[6],e[2]*e[3]-e[0]*e[5],e[3]*e[7]-e[4]*e[6],e[1]*e[6]-e[0]*e[7],e[0]*e[4]-e[1]*e[3]]}function r(e,t){for(var o=Array(9),i=0;3!==i;++i)for(var n=0;3!==n;++n){for(var a=0,r=0;3!==r;++r)a+=e[3*i+r]*t[3*r+n];o[3*i+n]=a}return o}function s(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}function l(e,t,o,i,n,l,d,c){var u=[e,o,n,t,i,l,1,1,1],h=s(a(u),[d,c,1]);return r(u,[h[0],0,0,0,h[1],0,0,0,h[2]])}function d(e,t,o,i,n,s,d,c,u,h,p,m,f,v,y,g){var b=l(e,t,n,s,u,h,f,v),k=l(o,i,d,c,p,m,y,g);return r(k,a(b))}function c(e,t,o,i,n,a,r,s,l){for(var c=e.offsetWidth-p.SCREEN_EPSILON,u=e.offsetHeight-p.SCREEN_EPSILON,h=d(0,0,t,o,c,0,i,n,0,u,a,r,c,u,s,l),m=0;9!==m;++m)h[m]=h[m]/h[8];h=[h[0],h[3],0,h[6],h[1],h[4],0,h[7],0,0,1,0,h[2],h[5],0,h[8]];var f="matrix3d("+h.join(", ")+")";e.style.transform=f}function u(e,t){c(t,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7])}var h=e("animation-utilities"),p={SCREEN_WIDTH:1280,SCREEN_HEIGHT:720,SCREEN_EPSILON:16},m=!1,f=[],v=function(){function e(e,t,o){var a=this;if(this.containerHTMLElement=e,this.robotRenderer=t,this.faceHTMLElement=o,this.faceHTMLElement.style.position="absolute",this.faceHTMLElement.style.width=p.SCREEN_WIDTH+p.SCREEN_EPSILON+"px",this.faceHTMLElement.style.height=p.SCREEN_HEIGHT+p.SCREEN_EPSILON+"px",this.faceHTMLElement.border=p.SCREEN_EPSILON+"px solid red",this.faceHTMLElement.style.transformOrigin="0px 0px 0px",this.faceHTMLElement.style.top="0px",this.faceHTMLElement.style.left="0px",t.scene._camera.near=.001,t.scene._camera.updateProjectionMatrix(),m)for(var r=["red","green","purple","blue"],s=0;s<4;s++)f.push(document.createElement("div")),f[s].style.position="absolute",f[s].style.width="5px",f[s].style.height="5px",f[s].style.background=r[s],this.containerHTMLElement.firstChild?this.containerHTMLElement.insertBefore(f[s],e.firstChild):this.containerHTMLElement.appendChild(f[s]);this.robotRenderer.scene._postRenderCallbacks.push(function(){var t=a.robotRenderer.scene._scene.children[4].children[0].children[1].children[1].children[0].children[2].children[0],o=a.robotRenderer.scene._camera,r=n(h.THREE,t,o,e);if(m)for(var s=0;s<f.length;s++)f[s].style.marginLeft=Math.floor(r[s].x)+"px",f[s].style.marginTop=Math.floor(r[s].y)+"px";u([r[0].x,r[0].y,r[1].x,r[1].y,r[2].x,r[2].y,r[3].x,r[3].y],a.faceHTMLElement),a.faceHTMLElement.style.zIndex=i(r)?"-1":"0"})}return e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=v},{"animation-utilities":void 0}],14:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("atom");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n.createClass({getInitialState:function(){return{mode:"str",disabled:!0}},componentDidMount:function(){this.subs=new a.CompositeDisposable,this.subs.add(atom.tooltips.add(n.findDOMNode(this.refs.str),{title:"Move & Resize"})),this.subs.add(atom.tooltips.add(n.findDOMNode(this.refs.vertex),{title:"Reshape"})),this.subs.add(atom.tooltips.add(n.findDOMNode(this.refs.rotation),{title:"Rotate"}))},componentWillUnmount:function(){this.subs.dispose()},render:function(){var e="btn selected",t="btn",o={};return this.props.disabled&&(o.disabled=!0),n.createElement("div",{className:"eye-mode"},n.createElement("div",{className:"btn-group",style:{margin:5}},n.createElement("button",i({ref:"str"},o,{tabIndex:300,className:"str"===this.state.mode?e:t,onClick:this.onClick.bind(this,"str")}),n.createElement("i",{className:"fa fa-arrows"})),n.createElement("button",i({ref:"vertex"},o,{tabIndex:301,className:"vertex"===this.state.mode?e:t,onClick:this.onClick.bind(this,"vertex")}),n.createElement("i",{className:"fa fa-crosshairs"})),n.createElement("button",i({ref:"rotation"},o,{tabIndex:302,className:"rotation"===this.state.mode?e:t,onClick:this.onClick.bind(this,"rotation")}),n.createElement("i",{className:"fa fa-undo"}))))},onClick:function(e){this.state.mode=e,this.setState(this.state),this.props.onSelect(e)}})},{atom:void 0,react:void 0}],15:[function(e,t,o){"use strict";function i(e,t){var o=u.default.getAncestor(e.target,".animation-channel-keyframe-slot"),i=o?o.keyframeSlotView.props:void 0;return i&&t(i.animationModel.keyframeSelection,i.layerId)}var n,a,r,s=e("react"),l=e("react/addons").addons.PureRenderMixin,d=e("jquery"),c=e("atom"),u=e("../../common/find-node"),h=new AudioContext,p=e("path"),m=!1,f=s.createClass({displayName:"keyframe-slot",mixins:[l],componentDidMount:function(){this.disposable=new c.CompositeDisposable,this.disposable.add(atom.commands.add(this.getDOMNode(),{"jibo-sdk:delete-keyframe":this.ifAllowed(this._deleteKeyframe),"jibo-sdk:add-keyframe":this.ifAllowed(this._addKeyframe),"jibo-sdk:insert-blank-frame":this.ifAllowed(this._insertBlankFrame),"jibo-sdk:delete-frame":this.ifAllowed(this._deleteFrame),"jibo-sdk:cut-keyframe":this.ifAllowed(this._cutKeyframe),"jibo-sdk:copy-keyframe":this._copyKeyframe,"jibo-sdk:paste-keyframe":this.ifAllowed(this._pasteKeyframe),"jibo-sdk:paste-keyframe-at-layer":this.ifAllowed(this._pasteKeyframeAtLayer)})),this.getDOMNode().keyframeSlotView=this,this.onDropCB=this.onDrop.bind(this),this.getDOMNode().addEventListener("drop",this.onDropCB,!0),this.renderWaveform(this.props)},ifAllowed:function(e){var t=this;return function(o){t.props.animationModel.keyframeSelection.hasLockedLayer()||e(o)}},componentWillUnmount:function(){this.disposable.dispose(),this.getDOMNode().removeEventListener("drop",this.onDropCB)},onMouseDown:function(e){1===e.nativeEvent.which&&this.props.animationModel.keyframeSelection.onMouseDown(e,this.props.layerId,this.props.keyframeIndex)},onMouseClick:function(e){1===e.nativeEvent.which&&this.props.animationModel.keyframeSelection.onClick(e,this.props.layerId,this.props.keyframeIndex)},componentWillReceiveProps:function(e){this.props.exists||e.exists!==!0?this.props.exists!==!0||e.exists?"undefined"!=typeof e.upserted&&d(this.getDOMNode().childNodes[0]).stop(!0,!0).css({display:"inline-block",backgroundColor:"white"}).fadeIn(100).fadeOut(200):d(this.getDOMNode().childNodes[0]).stop(!0,!0).css({backgroundColor:"#AF2B2B",display:"inline-block"}).fadeIn(100).fadeOut(200):d(this.getDOMNode().childNodes[0]).stop(!0,!0).css({backgroundColor:"#1F8BFF",display:"inline-block"}).fadeIn(200).fadeOut(200),this.renderWaveform(e)},renderWaveform:function(e){var t=this,o=e.animationModel,i=o.getLayer(e.layerId);if("Audio Event"===i.type&&e.exists){for(var n=null,a=0;a<i.keyframes.length;a++)if(i.keyframes[a].time===e.keyframeIndex){n=i.keyframes[a];break}var r=n.time/o.state.keyframes.framerate,l=o.audio.root,d=n.value.AudioEvent.file;if(!(d&&d.length>0))return;if(d===this.file)return;this.file=d;var c=p.resolve(l,"audio",d);this.clearCanvas();var u=new XMLHttpRequest;u.open("GET",c,!0),u.responseType="arraybuffer",u.onload=function(){h.decodeAudioData(u.response,function(e){var i=e.getChannelData(0),n=s.findDOMNode(t.refs.canvas),a=Math.min(o.state.keyframes.duration/o.state.keyframes.framerate-r,e.length/e.sampleRate);n.width=18*a*30,n.height=40;var l=n.getContext("2d");l.beginPath(),l.moveTo(0,20);for(var d=1/540,c=0,u=0;u<a;u+=d){var h=Math.floor(u*e.sampleRate);if(h<e.length){var p=i[h];l.lineTo(c,25*p+20)}c++}l.strokeStyle="#ffffff",l.stroke()})},u.send()}else{var m=s.findDOMNode(this.refs.canvas);m.width=0}},onDragStart:function(e){if(this.props.animationModel.keyframeSelection.isSelected(this.props.layerId,this.props.keyframeIndex)===!1)return void e.preventDefault();var t=s.findDOMNode(this.refs.canvas);t.width=0,t.height=0,m=e.nativeEvent.shiftKey,r=m,e.dataTransfer.setData("animation-editor/keyframe-drop",JSON.stringify({layerId:this.props.layerId,keyframeIndex:this.props.keyframeIndex})),a={layerId:this.props.layerId,keyframeIndex:this.props.keyframeIndex},e.dataTransfer.effectAllowed="move"},onDragEnter:function(e){var t=this,o=this,i=e.dataTransfer.getData("animation-editor/keyframe-drop");if(""!==i){this.props.animationModel.setKeyframe(this.props.keyframeIndex),[].forEach.call(document.querySelectorAll(".animation-channel-keyframe-slot.drag-over"),function(e){e.classList.remove("drag-over")}),[].forEach.call(document.querySelectorAll(".animation-channel-keyframe-slot.drag-over-empty"),function(e){e.classList.remove("drag-over-empty")}),[].forEach.call(document.querySelectorAll(".animation-channel-keyframe-slot.drag-over-mismatched"),function(e){e.classList.remove("drag-over-mismatched")}),i=JSON.parse(i);var r=this.props.keyframeIndex-a.keyframeIndex,s=this.props.animationModel.getLayerIndex(this.props.layerId)-this.props.animationModel.getLayerIndex(a.layerId);this.props.animationModel.keyframeSelection.forEachSelected(!0,!0,function(e,i){var n=i+r,a=t.props.animationModel.getLayerIndex(e),l=a+s;n<0||n>=o.props.animationModel.getDuration()||l<0||l>=o.props.animationModel.getLayerCount()||(t.props.animationModel.getLayerByIndex(a).type!==t.props.animationModel.getLayerByIndex(l).type?o.getDOMNode().parentNode.parentNode.parentNode.childNodes[1+l].childNodes[0].childNodes[n].classList.add("drag-over-mismatched"):t.props.animationModel.keyframeExists(e,i)?o.getDOMNode().parentNode.parentNode.parentNode.childNodes[1+l].childNodes[0].childNodes[n].classList.add("drag-over"):o.getDOMNode().parentNode.parentNode.parentNode.childNodes[1+l].childNodes[0].childNodes[n].classList.add("drag-over-empty"))}),n={layerId:this.props.layerId,keyframeIndex:this.props.keyframeIndex}}},onDragLeave:function(){delete this.getDOMNode().style.background},clearDragOverClasses:function(){for(var e=document.getElementsByClassName("animation-channel-keyframes"),t=0;t<e.length;t++)for(var o=0;o<e[t].childNodes.length;o++){var i=e[t].childNodes[o];i.classList.remove("drag-over"),i.classList.remove("drag-over-empty"),i.classList.remove("drag-over-mismatched")}},onDrop:function(){r=!0},onDragEnd:function(e){n&&!this.props.animationModel.keyframeSelection.hasLockedLayer(n.layerId)&&r&&e.nativeEvent.target.classList.contains("animation-channel-keyframe-slot")&&this.props.animationModel.keyframeSelection.moveSelection(a,n,m),n=null,this.clearDragOverClasses(),document.querySelector(".active .animation-editor").childNodes[0].focus()},clearCanvas:function(){var e=s.findDOMNode(this.refs.canvas),t=e.getContext("2d");t.clearRect(0,0,e.width,e.height)},render:function(){var e={},t="animation-channel-keyframe-slot native-key-bindings";return this.props.selected&&(t+=" selected"),t+=this.props.exists?" exists":" not-exists",this.props.marker&&(t+=" marker"),this.props.shadowed&&(t+=" shadowed-"+this.props.shadowed),this.props.exceedsLimit&&(t+=" exceeds"),s.createElement("span",{draggable:!0,style:e,onDragStart:this.ifAllowed(this.onDragStart),onDragEnd:this.onDragEnd,onDrop:this.onDrop,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onClickCapture:this.onMouseClick,onMouseDownCapture:this.onMouseDown,className:t},s.createElement("span",{className:"slot-effect"}),s.createElement("span",{style:{position:"relative",width:0,height:0}},s.createElement("canvas",{width:0,height:0,ref:"canvas",style:{pointerEvents:"none",position:"absolute"}})))},_deleteKeyframe:function(){this.props.animationModel.keyframeSelection.deleteKeyframes()},_addKeyframe:function(){this.props.animationModel.addKeyByTime(this.props.layerId,this.props.keyframeIndex)},_cutKeyframe:function(){this.props.animationModel.keyframeSelection.cutSelectedKeyframes()},_copyKeyframe:function(){this.props.animationModel.keyframeSelection.copySelectedKeyframes()},_pasteKeyframe:function(){this.props.animationModel.keyframeSelection.pasteKeyframes(this.props.layerId,this.props.keyframeIndex)},_pasteKeyframeAtLayer:function(){this.props.animationModel.keyframeSelection.pasteKeyframesAtLayer(this.props.layerId,this.props.keyframeIndex)},_insertBlankFrame:function(){this.props.animationModel.insertBlankFrame(this.props.keyframeIndex)},_deleteFrame:function(){this.props.animationModel.deleteFrame(this.props.keyframeIndex)}});atom.contextMenu.add({".animation-channel-keyframe-slot.selected.exists":[{label:"Set Keyframe",command:"jibo-sdk:upsert-keyframe"}],".animation-channel-keyframe-slot.selected":[{label:"Delete Keyframe(s)",command:"jibo-sdk:delete-keyframe",shouldDisplay:function(e){return i(e,function(e){return e.canDeleteKeyframes()&&!e.hasLockedLayer()})}},{label:"Insert Blank Frame",command:"jibo-sdk:insert-blank-frame",shouldDisplay:function(e){return i(e,function(e){return!e.hasLockedLayer()})}},{label:"Delete Frame",command:"jibo-sdk:delete-frame",shouldDisplay:function(e){return i(e,function(e){return!e.hasLockedLayer()})}},{type:"separator"},{label:"Cut",command:"jibo-sdk:cut-keyframe",shouldDisplay:function(e){return i(e,function(e){return!e.hasLockedLayer()})}},{label:"Copy",command:"jibo-sdk:copy-keyframe"}],".animation-channel-keyframe-slot.not-exists":[{label:"Add Keyframe",command:"jibo-sdk:add-keyframe",shouldDisplay:function(e){return i(e,function(e){return!e.hasLockedLayer()})}},{type:"separator"}],".animation-channel-keyframe-slot":[{label:"Paste",command:"jibo-sdk:paste-keyframe",shouldDisplay:function(e){return i(e,function(e){return!e.hasLockedLayer()})}},{label:"Paste to selected layer",command:"jibo-sdk:paste-keyframe-at-layer",shouldDisplay:function(e){return i(e,function(e,t){return e.canPasteAtLayer(t)&&!e.hasLockedLayer()})}}]}),Object.defineProperty(o,"__esModule",{value:!0}),o.default=f},{"../../common/find-node":99,atom:void 0,jquery:void 0,path:void 0,react:void 0,"react/addons":void 0}],16:[function(e,t,o){"use strict";var i,n,a,r=e("react"),s=e("atom"),l=e("../../common/find-node"),d=r.createClass({displayName:"layer-label",getInitialState:function(){return{editingName:!1}},componentDidMount:function(){var e=r.findDOMNode(this.refs.label);this.onKeyDownCB=this.onKeyDown.bind(this),e.addEventListener("keydown",this.onKeyDownCB),this.disposable=new s.CompositeDisposable,this.disposable.add(atom.commands.add(this.getDOMNode(),{"jibo-sdk:delete-anim-layer":this._deleteLayer,"jibo-sdk:toggle-layer-lock":this._toggleLocked,"jibo-sdk:toggle-layer-visibility":this._toggleVisibility,"jibo-sdk:delete-all-keys":this.deleteAllKeys,"jibo-sdk:move-layer-up":this.moveUp,"jibo-sdk:move-layer-down":this.moveDown,"jibo-sdk:cut-layer":this._cutLayer,"jibo-sdk:copy-layer":this._copyLayer,"jibo-sdk:paste-layer":this._pasteLayer})),this.getDOMNode().layerLabelView=this,this.disposable.add(atom.tooltips.add(r.findDOMNode(this.refs.delete),{title:"Delete Layer"})),this.disposable.add(atom.tooltips.add(r.findDOMNode(this.refs.locked),{title:"Lock/Unlock Layer"})),this.disposable.add(atom.tooltips.add(r.findDOMNode(this.refs.showhide),{title:"Show/Hide Layer"}));var t=this.props.animationModel.getLayer(this.props.layerId),o=t.type+" layer";this.disposable.add(atom.tooltips.add(r.findDOMNode(this.refs.showhide),{title:o}))},componentWillUnmount:function(){var e=r.findDOMNode(this.refs.label);e.removeEventListener("keydown",this.onKeyDownCB),this.disposable.dispose()},componentWillReceiveProps:function(e){this.synchronizeLabelText(e)},onKeyDown:function(e){var t=r.findDOMNode(this.refs.label);if(13===e.which)this.setLayerName(),t.blur();else if(27===e.which)this.synchronizeLabelText(this.props),t.blur();else if(9===e.which){var o=void 0;o=e.shiftKey?t.parentNode.previousSibling:t.parentNode.nextSibling,o&&(o.getElementsByTagName("input")[0].disabled=!1,o.getElementsByTagName("input")[0].focus(),o.getElementsByTagName("input")[0].select(),e.preventDefault(),e.stopPropagation())}},onBlur:function(){var e=r.findDOMNode(this.refs.label);e.disabled=!0,this.setState({editingName:!1}),this.setLayerName()},onFocus:function(){this.setState({editingName:!0}),this.selectLayer(!0);var e=r.findDOMNode(this.refs.label);setTimeout(function(){e.select()},10)},setLayerName:function(){var e=r.findDOMNode(this.refs.label);""===e.value&&this.synchronizeLabelText(this.props),this.props.animationModel.getLayer(this.props.layerId).name!==e.value&&this.props.animationModel.setLayerName(this.props.layerId,e.value)},synchronizeLabelText:function(){var e=r.findDOMNode(this.refs.label),t=e.selectionStart,o=e.selectionEnd,i=e===document.activeElement;e.value=this.props.animationModel.getLayer(this.props.layerId).name,i&&(e.focus(),e.setSelectionRange(t,o))},onClick:function(){this.selectLayer(!0)},toggleVisibility:function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),this.selectLayer(),this._toggleVisibility())},_toggleVisibility:function(){this.props.animationModel.toggleLayerVisibility(this.props.layerId)},selectLayer:function(e){var t=this.props.animationModel.getLayer(this.props.layerId);t!==this.props.animationModel.getSelectedLayer()&&(this.props.animationModel.keyframeSelection._clearSelection(),this.props.animationModel.setSelection(this.props.layerId),e&&this.props.animationModel.addRedoUndoEntry())},toggleLocked:function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),this.selectLayer(),this._toggleLocked())},_toggleLocked:function(){this.props.animationModel.toggleLayerLocked(this.props.layerId)},deleteLayer:function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),this._deleteLayer())},_deleteLayer:function(){this.props.animationModel.deleteLayerById(this.props.layerId)},deleteAllKeys:function(){this.props.animationModel.deleteKeysByLayerId(this.props.layerId)},onLabelMouseDown:function(e){if(0===e.button){e.stopPropagation();var t=r.findDOMNode(this.refs.label);t!==document.activeElement,this.props.animationModel.isLayerSelected(this.props.layerId)===!1&&this.selectLayer(!0)}},onLabelClick:function(e){e.stopPropagation();var t=r.findDOMNode(this.refs.label);t!==document.activeElement&&e.preventDefault()},onLabelDoubleClick:function(){},startEditing:function(){var e=this,t=r.findDOMNode(this.refs.label);t!==document.activeElement&&setTimeout(function(){t.disabled=!1,e.setState({editingName:!0}),t.focus(),t.select()},10)},moveUp:function(){this.props.animationModel.moveUp(this.props.layerId)},moveDown:function(){this.props.animationModel.moveDown(this.props.layerId)},_cutLayer:function(){this.props.animationModel.cutLayer(this.props.layerId)},_copyLayer:function(){this.props.animationModel.copyLayer(this.props.layerId)},_pasteLayer:function(){this.props.animationModel.pasteLayer(this.props.layerId)},onDragStart:function(e){e.dataTransfer.setData("animation-editor/layer-drop",this.props.layerId),e.dataTransfer.effectAllowed="move"},onDragEnterTop:function(e){var t=e.dataTransfer.getData("animation-editor/layer-drop");if(""!==t&&this.props.layerId!==t&&!this.props.animationModel.isPreviousLayer(t,this.props.layerId)){var o=r.findDOMNode(this.refs.dropTop);o.className="drop-top drag-over",this.onDropEnter(e,!0)}},onDragEnterBottom:function(e){var t=e.dataTransfer.getData("animation-editor/layer-drop");if(""!==t&&this.props.layerId!==t&&!this.props.animationModel.isNextLayer(t,this.props.layerId)){var o=r.findDOMNode(this.refs.dropBottom);o.className="drop-bottom drag-over",this.onDropEnter(e,!1)}},onDropEnter:function(e,t){var o=e.dataTransfer.getData("animation-editor/layer-drop");""!==o&&o!==this.props.layerId&&(t?(n=o,i=this.props.layerId,a=t):(n=o,i=this.props.layerId,a=t))},onDragLeaveTop:function(){var e=r.findDOMNode(this.refs.dropTop);e.className="drop-top"},onDragLeaveBottom:function(){var e=r.findDOMNode(this.refs.dropBottom);e.className="drop-bottom"},clearDragOverClasses:function(){for(var e=this.getDOMNode().parentNode.getElementsByClassName("drop-top"),t=0;t<e.length;t++)e[t].className="drop-top";for(var o=this.getDOMNode().parentNode.getElementsByClassName("drop-bottom"),t=0;t<o.length;t++)o[t].className="drop-bottom"},onDragEnd:function(){this.clearDragOverClasses(),i&&(a?this.props.animationModel.reorderToBeforeLayer(n,i):this.props.animationModel.reorderToAfterLayer(n,i),i=null,document.querySelector(".active .animation-editor").childNodes[0].focus(),this.props.animationModel.addRedoUndoEntry())},render:function(){var e=this.props.animationModel.getLayer(this.props.layerId),t={parent:{opacity:e.locked||!e.visible?.2:1},label:{left:65,width:161,position:"absolute",marginTop:11},dropTop:{width:270,height:20,cursor:"default",position:"absolute"},dropBottom:{width:270,height:20,marginTop:20,cursor:"default",position:"absolute"}},o="animation-channel-label native-key-bindings";this.props.animationModel.isLayerSelected(e.id)&&(o+=" selected"),this.props.odd&&(o+=" odd");var i;i=e.locked?r.createElement("i",{ref:"locked",className:"fa fa-lock locked",onMouseDownCapture:this.toggleLocked}):r.createElement("i",{ref:"locked",className:"fa fa-unlock locked",onMouseDownCapture:this.toggleLocked});var n;n=e.visible?r.createElement("i",{ref:"showhide",className:"fa fa-eye visible",onMouseDownCapture:this.toggleVisibility}):r.createElement("i",{ref:"showhide",className:"fa fa-times visible",onMouseDownCapture:this.toggleVisibility});var a=e.type+" layer";return r.createElement("div",{draggable:!0,title:a,onDragStart:this.onDragStart,onMouseMove:this.onMouseMove,onDragEnd:this.onDragEnd,onClick:this.onClick,style:t.parent,className:o},r.createElement("div",{title:a,ref:"dropTop",onDragEnter:this.onDragEnterTop,onDragLeave:this.onDragLeaveTop,style:t.dropTop,className:"drop-top",onMouseDownCapture:this.onLabelMouseDown}),r.createElement("div",{title:a,ref:"dropBottom",onDragEnter:this.onDragEnterBottom,onDragLeave:this.onDragLeaveBottom,style:t.dropBottom,className:"drop-bottom",onMouseDownCapture:this.onLabelMouseDown}),r.createElement("div",{className:"flags"},n,i),r.createElement("input",{disabled:!0,className:"native-key-bindings",tabIndex:this.props.tabIndex,style:t.label,ref:"label",onFocus:this.onFocus,onBlur:this.onBlur,onDoubleClickCapture:this.onLabelDoubleClick,onClickCapture:this.onLabelClick,onMouseDownCapture:this.onLabelMouseDown,type:"text",defaultValue:e.name}),r.createElement("i",{ref:"delete",className:"fa fa-times delete",onMouseDownCapture:this.deleteLayer}))}});atom.contextMenu.add({"atom-pane .animation-channel-label":[{label:"Delete",command:"jibo-sdk:delete-anim-layer"},{type:"separator"},{label:"Delete All Keys",command:"jibo-sdk:delete-all-keys",shouldDisplay:function(e){var t=l.default.getAncestor(e.target,".animation-channel-label"),o=t&&t.layerLabelView.props,i=o?o.animationModel.getLayer(o.layerId):void 0;return!!i&&(0!==i.keyframes.length&&!i.locked)}},{type:"separator"},{label:"Move Up",command:"jibo-sdk:move-layer-up",shouldDisplay:function(e){var t=l.default.getAncestor(e.target,".animation-channel-label"),o=t&&t.layerLabelView.props;return o&&o.animationModel.canMoveUp(o.layerId)}},{label:"Move Down",command:"jibo-sdk:move-layer-down",shouldDisplay:function(e){var t=l.default.getAncestor(e.target,".animation-channel-label"),o=t&&t.layerLabelView.props;return o&&o.animationModel.canMoveDown(o.layerId)}},{type:"separator"},{command:"jibo-sdk:toggle-layer-lock",created:function(e){var t=l.default.getAncestor(e.target,".animation-channel-label"),o=t?t.layerLabelView.props:void 0;o&&o.animationModel.getLayer(o.layerId).locked?this.label="Unlock Layer":this.label="Lock Layer"}},{command:"jibo-sdk:toggle-layer-visibility",created:function(e){var t=l.default.getAncestor(e.target,".animation-channel-label"),o=t?t.layerLabelView.props:void 0;o&&o.animationModel.getLayer(o.layerId).visible?this.label="Hide Layer":this.label="Show Layer"}},{type:"separator"},{label:"Cut",command:"jibo-sdk:cut-layer"},{label:"Copy",command:"jibo-sdk:copy-layer"},{label:"Paste",command:"jibo-sdk:paste-layer",shouldDisplay:function(e){var t=l.default.getAncestor(e.target,".animation-channel-label");return t&&t.layerLabelView.props.animationModel.canPasteLayer()}}]}),Object.defineProperty(o,"__esModule",{value:!0}),o.default=d},{"../../common/find-node":99,atom:void 0,react:void 0}],17:[function(e,t,o){"use strict";var i=e("react"),n=e("./keyframe-slot"),a=i.createClass({displayName:"layer",getInitialState:function(){var e=this;return this.props.animationModel.on("onpropertieschanged",function(){e.forceUpdate()}),{}},shouldComponentUpdate:function(e){return this.props.latestHash!==e.latestHash||this.props.totalFrames!==e.totalFrames||"undefined"!=typeof e.upserted||"undefined"!=typeof e.selected},render:function(){for(var e={width:this.props.totalWidth,height:40,opacity:this.props.locked?.4:1},t=[],o=0,a=0;o<this.props.totalFrames;){var r=!(!this.props.keyframesExceeded||"Body"!==this.props.type)&&this.props.keyframesExceeded[o],s=o%5===0,l=this.props.animationModel.keyframeSelection.isSelected(this.props.layerId,o),d=this.props.referenceMarks&&this.props.referenceMarks[this.props.layerId]&&this.props.referenceMarks[this.props.layerId][o],c=void 0;"undefined"!=typeof this.props.upserted&&this.props.upserted===o&&(c=this.props.upserted),a<this.props.keyframes.length&&this.props.keyframes[a].time===o?(t.push(i.createElement(n.default,{animationModel:this.props.animationModel,key:o,keyframeIndex:o,layerId:this.props.layerId,exceedsLimit:r,shadowed:d,marker:s,selected:l,exists:!0,upserted:c})),a++):t.push(i.createElement(n.default,{animationModel:this.props.animationModel,key:o,keyframeIndex:o,layerId:this.props.layerId,exceedsLimit:r,shadowed:d,marker:s,selected:l})),o++}return i.createElement("div",{style:e,className:"animation-channel"},i.createElement("div",{className:"animation-channel-keyframes"},t))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{"./keyframe-slot":15,react:void 0}],18:[function(e,t,o){"use strict";var i=e("animation-utilities"),n=e("../pixi-view"),a=function(){function e(e,t,o,i){this.renderer=e,this.animationModel=o,i?this.eye=this.renderer.eye.eyeOverlay.eyeMesh:this.eye=this.renderer.eye.eye.eyeMesh,this.onMouseDown=this.onMouseDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onRotate=this.onRotate.bind(this),this.renderer.view.addEventListener("mousedown",this.onMouseDown),document.addEventListener("mouseup",this.onMouseUp);var n=this.animationModel.getSelectedLayerProperties();this.lastAngle=n.Rotate}return e.prototype.refresh=function(){},e.prototype.renderToTop=function(){this.top=!0},e.prototype.onMouseUp=function(){this.renderer.view.removeEventListener("mousemove",this.onRotate),this.startedManipulation&&(this.startedManipulation=!1,this.animationModel.addRedoUndoEntry())},e.prototype.getMouseAngle=function(e){var t=new i.THREE.Vector2(1,0),o=new i.THREE.Vector2(this.renderer.eye.eye.x,this.renderer.eye.eye.y),n=e.sub(o).normalize();return n.y<0?2*Math.PI-Math.acos(t.dot(n)):Math.acos(t.dot(n))},e.prototype.onMouseDown=function(e){var t=new i.THREE.Vector2(n.WIDTH*e.offsetX/this.renderer.view.offsetWidth,n.HEIGHT*e.offsetY/this.renderer.view.offsetHeight);this.tempInitialAngle=this.getMouseAngle(t),this.tempInitialRotation=this.eye.rotation,this.renderer.view.addEventListener("mousemove",this.onRotate)},e.prototype.onRotate=function(e){this.startedManipulation=!0;var t=new i.THREE.Vector2(n.WIDTH*e.offsetX/this.renderer.view.offsetWidth,n.HEIGHT*e.offsetY/this.renderer.view.offsetHeight),o=this.getMouseAngle(t),a=this.tempInitialAngle-o,r=(this.tempInitialRotation+a)/Math.PI*180-this.lastAngle;r>120||r<-120?(this.lastAngle=(this.tempInitialRotation+a)/Math.PI*180-r,this.tempInitialRotation=this.lastAngle*Math.PI/180,this.tempInitialAngle=o):this.lastAngle=(this.tempInitialRotation+a)/Math.PI*180,this.animationModel.updateSelectedLayerPropertiesRelative({
Rotate:this.lastAngle})},e.prototype.dispose=function(){this.renderer.view.removeEventListener("mousedown",this.onMouseDown),document.removeEventListener("mouseup",this.onMouseUp),this.disposed=!0},e.prototype.scaleSpheres=function(){},e.prototype.display=function(){},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{"../pixi-view":25,"animation-utilities":void 0}],19:[function(e,t,o){"use strict";var i=e("jibo-keyframes"),n=e("animation-utilities"),a=e("../pixi-view"),r=function(){function e(e,t,o,a){var r=this;this.matrix=new PIXI.Matrix,this.matrix.identity(),this.renderer=e,this.robotInfo=t,this.screenWidth=this.robotInfo.getEyeScreenInfo().getWidth(),this.screenHeight=this.robotInfo.getEyeScreenInfo().getHeight(),this.animationModel=o,this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onEyeDown=this.onEyeDown.bind(this),this.onEyeMove=this.onEyeMove.bind(this),this.onEyeUp=this.onEyeUp.bind(this),this.stage=new PIXI.Container,this.renderToTop(),this.spheres=[],this.prefix=a?"overlay_vertexJoint":"vertexJoint",this.defaultVertexPositions=n.EyeKinematicsHelper.verticesForDOFValues(t.getDefaultDOFValues(),t);var s=0;Object.keys(this.defaultVertexPositions).forEach(function(e){if(0===e.indexOf(r.prefix)){if(e===r.prefix+"8"&&(r.defaultHeight=i.conversion.toPixelsY(r.defaultVertexPositions[e].y)),e===r.prefix+"6"&&(r.defaultWidth=i.conversion.toPixelsX(r.defaultVertexPositions[e].x)),e!==r.prefix+"5"){var t=r.defaultVertexPositions[e];t.x=i.conversion.toPixelsX(t.x),t.y=i.conversion.toPixelsY(t.y),r.createSphere(t,e,s)}s++}}),this.eye=a?this.renderer.eye.eyeOverlay:this.renderer.eye.eye,this.eye.interactive=!0,this.eye.on("mousedown",this.onEyeDown)}return e.prototype.onEyeDown=function(e){var t=a.WIDTH*e.data.originalEvent.offsetX/this.renderer.view.offsetWidth,o=a.HEIGHT*e.data.originalEvent.offsetY/this.renderer.view.offsetHeight;t/=this.renderer.eye.zoom,o/=this.renderer.eye.zoom,this.delta=new PIXI.Point(t-this.stage.x,o-this.stage.y),this.renderer.view.addEventListener("mousemove",this.onEyeMove),document.addEventListener("mouseup",this.onEyeUp)},e.prototype.onEyeMove=function(e){var t=a.WIDTH*e.offsetX/this.renderer.view.offsetWidth,o=a.HEIGHT*e.offsetY/this.renderer.view.offsetHeight;t/=this.renderer.eye.zoom,o/=this.renderer.eye.zoom,t-=.5*a.WIDTH+this.delta.x,o-=.5*a.HEIGHT+this.delta.y;var i={};i.Translate={x:t,y:o},this.animationModel.updateSelectedLayerPropertiesRelative(i)},e.prototype.onEyeUp=function(){this.renderer.view.removeEventListener("mousemove",this.onEyeMove),document.removeEventListener("mouseup",this.onEyeUp)},e.prototype.refresh=function(){var e=this;this.spheres.forEach(function(t){t.scale.x=1/e.renderer.eye.zoom/e.stage.scale.x,t.scale.y=1/e.renderer.eye.zoom/e.stage.scale.y})},e.prototype.renderToTop=function(){this.renderer.eye.addChild(this.stage)},e.prototype.createSphere=function(e,t,o){var i=17,n=new PIXI.Graphics;n.beginFill(10027008),n.drawCircle(0,0,i),n.name=t,n.interactive=!0,n.x=e.x,n.y=e.y;var a;switch(o){case 3:case 5:a="";break;case 1:case 7:a="";break;case 0:case 2:case 6:case 8:a=""}var r=new PIXI.Text(a,{fontFamily:"fontawesome",fontSize:24,fill:"#aaaaaa"});r.x=-.5*r.width,r.y=-.5*r.height,n.addChild(r),n.scale.x=1/this.renderer.eye.zoom,n.scale.y=1/this.renderer.eye.zoom,this.stage.addChild(n),this.spheres.push(n);var s=this.spheres.length-1;n.on("mousedown",this.onMouseDown.bind(this,s))},e.prototype.onMouseMove=function(e){var t=a.WIDTH*e.offsetX/this.renderer.view.offsetWidth,o=a.HEIGHT*e.offsetY/this.renderer.view.offsetHeight,i=this.renderer.eye.toLocal(new PIXI.Point(t,o));i.x-=this.stage.x,i.y-=this.stage.y,this.matrix.identity(),this.matrix.rotate(-this.stage.rotation),i=this.matrix.apply(i);var n=Math.abs(i.x)/this.defaultWidth,r=Math.abs(i.y)/this.defaultHeight,s=this.animationModel.getSelectedLayerProperties(),l={};switch(this.index){case 0:case 2:case 5:case 7:this.shiftKey&&(n>r?r=n/this.originalScaleRatio:n=r*this.originalScaleRatio),l.Scale={x:n,y:r};break;case 1:case 6:l.Scale={x:s.Scale.x,y:r};break;default:l.Scale={x:n,y:s.Scale.y}}this.animationModel.updateSelectedLayerPropertiesRelative(l)},e.prototype.onMouseDown=function(e,t){if(this.shiftKey=t.data.originalEvent.shiftKey,this.shiftKey){var o=this.animationModel.getSelectedLayerProperties();this.originalScaleRatio=o.Scale.x/o.Scale.y}t.stopPropagation(),this.index=e,this.renderer.view.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)},e.prototype.onMouseUp=function(){this.renderer.view.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)},e.prototype.dispose=function(){var e=this;this.stage.parent.removeChild(this.stage),this.spheres.forEach(function(t){t.removeListener("mousedown",e.onMouseDown)}),this.eye.removeListener("mousedown",this.onEyeDown)},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"../pixi-view":25,"animation-utilities":void 0,"jibo-keyframes":void 0}],20:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("jibo-keyframes"),a=e("./scale-translate-controller-base"),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.display=function(e){this.dofValues=e,this.stage.x=n.conversion.toPixelsX(e.overlay_textureSubRootBn_t+.5*this.screenWidth),this.stage.y=-n.conversion.toPixelsX(e.overlay_textureSubRootBn_t_2-.5*this.screenHeight),this.stage.rotation=-e.overlay_textureSubRootBn_r,this.stage.rotation=-e.overlay_textureSubRootBn_r;var t=this.animationModel.getSelectedLayerProperties();void 0!==t&&(this.stage.scale.x=t.Scale.x,this.stage.scale.y=t.Scale.y),this.refresh()},t}(a.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./scale-translate-controller-base":19,"jibo-keyframes":void 0}],21:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("jibo-keyframes"),a=e("./scale-translate-controller-base"),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.display=function(e){this.dofValues=e,this.stage.x=n.conversion.toPixelsX(e.eyeSubRootBn_t+.5*this.screenWidth),this.stage.y=-n.conversion.toPixelsX(e.eyeSubRootBn_t_2-.5*this.screenHeight),this.stage.rotation=-e.eyeSubRootBn_r,this.stage.rotation=-e.eyeSubRootBn_r;var t=this.animationModel.getSelectedLayerProperties();this.stage.scale.x=t.Scale.x,this.stage.scale.y=t.Scale.y,this.refresh()},t}(a.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./scale-translate-controller-base":19,"jibo-keyframes":void 0}],22:[function(e,t,o){"use strict";var i=e("../pixi-view"),n=function(){function e(e,t,o,i){this.renderer=e,this.robotInfo=t,this.screenWidth=this.robotInfo.getEyeScreenInfo().getWidth(),this.screenHeight=this.robotInfo.getEyeScreenInfo().getHeight(),this.animationModel=o,this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.prefix=i?"overlay_vertexJoint":"vertexJoint",this.spheres=[],this.vertexToPropMap={},this.stage=new PIXI.Container,this.renderToTop();for(var n=1;n<10;n++){var a=""+this.prefix+n;this.vertexToPropMap[a]="Vertex "+n,this.createSphere(a,n)}}return e.prototype.refresh=function(){var e=this;this.spheres.forEach(function(t){t.scale.x=1/e.renderer.eye.zoom,t.scale.y=1/e.renderer.eye.zoom})},e.prototype.renderToTop=function(){this.renderer.eye.addChild(this.stage)},e.prototype.createSphere=function(e,t){var o=new PIXI.Graphics;o.beginFill(10027008),o.drawCircle(0,0,17),o.name=e,o.interactive=!0;var i=new PIXI.Text(t,{fontFamily:"Lucida Grande",fontSize:24,fontWeight:"bold",fill:"#aaaaaa"});i.x=-.5*i.width,i.y=-.5*i.height,o.addChild(i),o.scale.x=1/this.renderer.eye.zoom,o.scale.y=1/this.renderer.eye.zoom,this.stage.addChild(o),this.spheres.push(o),o.on("mousedown",this.onMouseDown)},e.prototype.onMouseMove=function(e){var t=i.WIDTH*e.offsetX/this.renderer.view.offsetWidth,o=i.HEIGHT*e.offsetY/this.renderer.view.offsetHeight,n=this.stage.toLocal(new PIXI.Point(t,o)),a=this.vertexToPropMap[this.currentTarget.name],r=this.animationModel.getSelectedLayerProperties(),s={};s[a]={x:n.x/r.Scale.x,y:n.y/r.Scale.y},this.animationModel.updateSelectedLayerPropertiesRelative(s)},e.prototype.onMouseDown=function(e){this.currentTarget=e.target,this.downPosition=this.currentTarget.position,this.renderer.view.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)},e.prototype.onMouseUp=function(){document.removeEventListener("mouseup",this.onMouseUp),this.renderer.view.removeEventListener("mousemove",this.onMouseMove)},e.prototype.dispose=function(){var e=this;this.stage.parent.removeChild(this.stage),this.spheres.forEach(function(t){t.removeListener("mousedown",e.onMouseDown)})},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"../pixi-view":25}],23:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("jibo-keyframes"),a=e("./vertex-controller-base"),r=function(e){function t(t,o,i){return e.call(this,t,o,i,!1)||this}return i(t,e),t.prototype.display=function(e){this.dofValues=e,this.stage.x=n.conversion.toPixelsX(e.eyeSubRootBn_t+.5*this.screenWidth),this.stage.y=-n.conversion.toPixelsX(e.eyeSubRootBn_t_2-.5*this.screenHeight),this.stage.rotation=-e.eyeSubRootBn_r,this.spheres[0].x=n.conversion.toPixelsX(e.vertexJoint1_t),this.spheres[0].y=n.conversion.toPixelsY(e.vertexJoint1_t_2),this.spheres[1].x=n.conversion.toPixelsX(e.vertexJoint2_t),this.spheres[1].y=n.conversion.toPixelsY(e.vertexJoint2_t_2),this.spheres[2].x=n.conversion.toPixelsX(e.vertexJoint3_t),this.spheres[2].y=n.conversion.toPixelsY(e.vertexJoint3_t_2),this.spheres[3].x=n.conversion.toPixelsX(e.vertexJoint4_t),this.spheres[3].y=n.conversion.toPixelsY(e.vertexJoint4_t_2),this.spheres[4].x=n.conversion.toPixelsX(e.vertexJoint5_t),this.spheres[4].y=n.conversion.toPixelsY(e.vertexJoint5_t_2),this.spheres[5].x=n.conversion.toPixelsX(e.vertexJoint6_t),this.spheres[5].y=n.conversion.toPixelsY(e.vertexJoint6_t_2),this.spheres[6].x=n.conversion.toPixelsX(e.vertexJoint7_t),this.spheres[6].y=n.conversion.toPixelsY(e.vertexJoint7_t_2),this.spheres[7].x=n.conversion.toPixelsX(e.vertexJoint8_t),this.spheres[7].y=n.conversion.toPixelsY(e.vertexJoint8_t_2),this.spheres[8].x=n.conversion.toPixelsX(e.vertexJoint9_t),this.spheres[8].y=n.conversion.toPixelsY(e.vertexJoint9_t_2),this.refresh()},t}(a.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./vertex-controller-base":22,"jibo-keyframes":void 0}],24:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("jibo-keyframes"),a=e("./vertex-controller-base"),r=function(e){function t(t,o,i){return e.call(this,t,o,i,!0)||this}return i(t,e),t.prototype.display=function(e){this.dofValues=e,this.stage.x=n.conversion.toPixelsX(e.overlay_textureSubRootBn_t+.5*this.screenWidth),this.stage.y=-n.conversion.toPixelsX(e.overlay_textureSubRootBn_t_2-.5*this.screenHeight),this.stage.rotation=-e.overlay_textureSubRootBn_r,this.spheres[0].x=n.conversion.toPixelsX(e.overlay_vertexJoint1_t),this.spheres[0].y=n.conversion.toPixelsY(e.overlay_vertexJoint1_t_2),this.spheres[1].x=n.conversion.toPixelsX(e.overlay_vertexJoint2_t),this.spheres[1].y=n.conversion.toPixelsY(e.overlay_vertexJoint2_t_2),this.spheres[2].x=n.conversion.toPixelsX(e.overlay_vertexJoint3_t),this.spheres[2].y=n.conversion.toPixelsY(e.overlay_vertexJoint3_t_2),this.spheres[3].x=n.conversion.toPixelsX(e.overlay_vertexJoint4_t),this.spheres[3].y=n.conversion.toPixelsY(e.overlay_vertexJoint4_t_2),this.spheres[4].x=n.conversion.toPixelsX(e.overlay_vertexJoint5_t),this.spheres[4].y=n.conversion.toPixelsY(e.overlay_vertexJoint5_t_2),this.spheres[5].x=n.conversion.toPixelsX(e.overlay_vertexJoint6_t),this.spheres[5].y=n.conversion.toPixelsY(e.overlay_vertexJoint6_t_2),this.spheres[6].x=n.conversion.toPixelsX(e.overlay_vertexJoint7_t),this.spheres[6].y=n.conversion.toPixelsY(e.overlay_vertexJoint7_t_2),this.spheres[7].x=n.conversion.toPixelsX(e.overlay_vertexJoint8_t),this.spheres[7].y=n.conversion.toPixelsY(e.overlay_vertexJoint8_t_2),this.spheres[8].x=n.conversion.toPixelsX(e.overlay_vertexJoint9_t),this.spheres[8].y=n.conversion.toPixelsY(e.overlay_vertexJoint9_t_2),this.refresh()},t}(a.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./vertex-controller-base":22,"jibo-keyframes":void 0}],25:[function(e,t,o){"use strict";var i=e("react"),n=e("path"),a=e("fs"),r=e("module"),s=e("deep-diff").diff,l=e("lodash"),d=e("jibo"),c=e("jibo"),u=c.FaceRenderer,h=c.timer,p=e("animation-utilities"),m=e("../face/mode-select"),f=e("./controllers/vertex-controller-eye"),v=e("./controllers/vertex-controller-overlay"),y=e("./controllers/scale-translate-controller-eye"),g=e("./controllers/scale-translate-controller-eye-overlay"),b=e("./controllers/rotation-controller"),k=e("jibo-keyframes"),S=1280,w=720,E=S/w,M=new p.JiboConfig,C={vertex:v.default,str:g.default,rotation:b.default},x={vertex:f.default,str:y.default,rotation:b.default};o.WIDTH=S,o.HEIGHT=w,Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"layout-child",getInitialState:function(){return this.updateFace=this.updateFace.bind(this),this.face=null,this.currentScale=1,this.doUpdate=!0,this.onDataChanged=this.onDataChanged.bind(this),this.previousLayers=[],this.instances={},this.animations={},this.watchers={},{disabled:!0,mode:"str"}},render:function(){var e={width:this.props.width,height:this.props.height};return this.pixiRenderer&&this.setCanvasStyle(this.pixiRenderer.view),i.createElement("div",{ref:"container",className:"pixi-container",style:e,onWheel:this.onWheel},i.createElement(m.default,{disabled:this.state.disabled,onSelect:this.onSelectMode}))},onWheel:function(e){var t=e.nativeEvent.wheelDelta/2400;this.currentScale-=t,this.currentScale>1&&(this.currentScale=1),this.currentScale<.1&&(this.currentScale=.1),this.pixiRenderer.eye.zoom=this.currentScale,this.controller&&this.controller.refresh()},onSelectMode:function(e){this.controller&&(this.controller.dispose(),this.controller=null),this.state.mode=e,this.props.animationModel.isLayerOfTypeSelected("Eye")?this.controller=new x[e](this.pixiRenderer,this.robotInfo,this.props.animationModel,!1):this.controller=new C[e](this.pixiRenderer,this.robotInfo,this.props.animationModel,!0),this.lastLayerType=this.props.animationModel.keyframeSelection.getSelectionLayerType(),this.controller.display(this.getDOFs())},setCanvasStyle:function(e){e.style.position="relative";var t=this.props.height-40;if(E<this.props.width/t){e.style.height=t+"px";var o=E*t;e.style.width=o+"px",e.style.left=.5*(this.props.width-o)+"px",e.style.right=.5*(this.props.width-o)+"px"}else{var i=this.props.width/E;e.style.height=i+"px",e.style.width=this.props.width+"px",e.style.top=.5*(i-i)+"px",e.style.bottom=.5*(i-i)+"px"}},componentWillUnmount:function(){this.doUpdate=!1,this.pixiRenderer.off("postrender",this.updateFace),this.pixiRenderer.destroy(),this.pixiRenderer=null,this.face=null,this.props.animationModel.removeListener("ondatachanged",this.onDataChanged);for(var e in this.watchers){var t=this.watchers[e];t.removeAllListeners()}},getRoot:function(){return n.join(this.props.projectRoot,"timelines")},componentWillReceiveProps:function(e){!this.face&&e.face&&(this.face=e.face)},componentDidMount:function(){var e=this;p.RobotInfo.createInfo(M,function(t){e.robotInfo=t;var o=i.findDOMNode(e.refs.container);h.start(),e.pixiRenderer=new u(h,!1),e.pixiRenderer.preserveDrawingBuffer=!0,e.pixiRenderer.init(o),e.pixiRenderer.eye.active=!0,e.pixiRenderer.stage.addChild(e.pixiRenderer.eye),e.doUpdate=!0,e.setCanvasStyle(e.pixiRenderer.view),e.props.animationModel.on("ondatachanged",e.onDataChanged),e.onDataChanged(),e.pixiRenderer.on("postrender",e.updateFace),e.renderEyeDisplay(e.getDOFs())})},updateFace:function(){this.face.getContext("2d").drawImage(this.pixiRenderer.view,0,0)},requireAnimate:function(e){var o=new r(e,t);return o.load(e),o.exports},loadPixi:function(){},onReload:function(e){var t=this;console.log("reload",e);var o=this.instances[e],i={};for(var n in o){i[n]=i[n]||[];var a=o[n];for(var r in a){i[n].push({value:{Pixi:e},time:r});var s=a[r];this.pixiRenderer.eye.removeChild(s.container)}}var l=function(e){i[e].forEach(function(o){t.addKeyframe(e,o)})};for(var n in i)l(n);this.controller&&this.controller.renderToTop()},addKeyframe:function(e,t){var o=this;try{var i=t.value.Pixi,r=n.join(this.getRoot(),i);if(!this.watchers[i]){var s=a.watch(r);s.on("change",this.onReload.bind(this,i)),this.watchers[i]=s}var l=this.requireAnimate(r),c=new PIXI.Container;this.pixiRenderer.eye.addChild(c),PIXI.animate.load(l.stage,c,function(n){var a=d.rendering.animation.KeysAnimation.FRAMERATE;n.framerate!==a&&console.warn("Animation framerate for %s must be 30 FPS, it will be automatically changed.",r),n.framerate=a,o.instances[i]=o.instances[i]||{},o.instances[i][e]=o.instances[i][e]||{},o.instances[i][e][t.time]={instance:n,container:c,attach:!!t.value["Attach To Eye"],offset:t.value["Frame Offset"]||0,width:l.width,height:l.height};var s=o.getDOFs();o.renderPixi(s)},n.dirname(r))}catch(e){console.log("Error loading pixi",e)}},removeKeyframe:function(e,t){var o=t.value.Pixi,i=this.instances[o][e][t.time];delete this.instances[o][e][t.time],i&&this.pixiRenderer.eye.removeChild(i.container)},addAllKeyframes:function(){for(var e=this.props.animationModel,t=e.getCompositedKeyframes().layers,o=0;o<t.length;o++){var i=t[o];if(i.visible)if("Eye"===i.type)this.pixiRenderer.eye.addChild(this.pixiRenderer.eye.eye),this.pixiRenderer.eye.addChild(this.pixiRenderer.eye.eyeOverlay);else if("Pixi"===i.type)for(var n=0;n<i.keyframes.length;n++){var a=i.keyframes[n];this.addKeyframe(i.id,a)}}this.controller&&this.controller.renderToTop()},removeAllKeyframes:function(){for(var e in this.instances){var t=this.instances[e];for(var o in t){var i=t[o];for(var n in i){var a=i[n].container;this.pixiRenderer.eye.removeChild(a)}}}this.instances={}},getDOFs:function(){var e=this.props.animationModel.evaluateAllDOFLayers(),t=l.cloneDeep(this.robotInfo.getDefaultDOFValues());return t.overlayVisibilityBn_r=!1,e=l.extend(t,l.cloneDeep(e)),e.eyeTextureInfixBn_r=n.resolve(this.props.animationModel.projectRoot,e.eyeTextureInfixBn_r),e.overlayTextureInfixBn_r=n.resolve(this.props.animationModel.projectRoot,e.overlayTextureInfixBn_r),e.screenBGTextureInfixBn_r=n.resolve(this.props.animationModel.projectRoot,e.screenBGTextureInfixBn_r),e},onDataChanged:function(){var e=this.props.animationModel.getSelectedLayer(),t=this.state.disabled;if(this.props.animationModel.keyframeSelection.isMultiSelect()||!this.props.animationModel.isLayerOfTypeSelected(["Eye","Overlay"])||!e.visible||e.locked)this.controller&&(this.controller.dispose(),this.controller=null),this.setState({disabled:!0});else{this.setState({disabled:!1});var o=this.props.animationModel.keyframeSelection.getSelectionLayerType(),i=!1;"Eye"===o?i=this.controller instanceof x[this.state.mode]==!1:"Overlay"===o&&(i=this.controller instanceof C[this.state.mode]==!1),(i||t===!0||this.lastLayerType!==o)&&this.onSelectMode(this.state.mode)}if(this.robotInfo){var n=this.props.animationModel,a=n.getCompositedLayersOfType(["Pixi","Eye","Overlay"]);if(0!==a.length){var r=s(this.previousLayers,a);r&&(this.removeAllKeyframes(),this.addAllKeyframes(),this.previousLayers=l.cloneDeep(a));var d=this.getDOFs();this.renderPixi(d),this.controller&&this.controller.display(d),this.renderEyeDisplay(d)}}},renderEyeDisplay:function(e){this.pixiRenderer.eye.display([0,0],e)},renderPixi:function(e){var t=this.props.animationModel,o=t.uiState.currentKeyframe,i=t.state.keyframes.framerate;for(var n in this.instances){var a=this.instances[n];for(var r in a){var s=a[r];for(var l in s){var d=s[l].instance,c=d.framerate,u=c/i,h=parseInt(l),p=o-h,m=Math.floor(u*p),f=s[l].offset;f=/^\d+$/.test(f)?parseInt(f):d._labelDict&&d._labelDict[f]?d._labelDict[f]:0,d.gotoAndStop(f+m);var v=s[l].attach;v?(d.pivot.x=s[l].width/2,d.pivot.y=s[l].height/2,d.x=k.conversion.toPixelsX(e.eyeSubRootBn_t)+d.pivot.x,d.y=-k.conversion.toPixelsX(e.eyeSubRootBn_t_2)+d.pivot.y,d.rotation=-e.eyeSubRootBn_r):(d.pivot.x=0,d.pivot.y=0)}}}}})},{"../face/mode-select":14,"./controllers/rotation-controller":18,"./controllers/scale-translate-controller-eye":21,"./controllers/scale-translate-controller-eye-overlay":20,"./controllers/vertex-controller-eye":23,"./controllers/vertex-controller-overlay":24,"animation-utilities":void 0,"deep-diff":void 0,fs:void 0,jibo:void 0,"jibo-keyframes":void 0,lodash:void 0,module:void 0,path:void 0,react:void 0}],26:[function(e,t,o){"use strict";var i=e("react"),n=e("./settings"),a=e("atom"),r=i.createClass({displayName:"playback-controls",getInitialState:function(){return{showSettings:!1}},onPlayPause:function(){this.props.animationModel.togglePlay()},onStepForward:function(){this.props.animationModel.stepTimeForward()},onStepBackward:function(){this.props.animationModel.stepTimeBackward()},onGoToNextKeyframe:function(){this.props.animationModel.goToNextKeyframe()},onGoToPrevKeyframe:function(){this.props.animationModel.goToPrevKeyframe()},onSettings:function(){this.setState({showSettings:!0})},onSettingsFinished:function(){this.setState({showSettings:!1})},render:function(){var e=this.props.animationModel.isPlaying()?i.createElement("i",{ref:"pausePlaying",className:"fa fa-pause",onClick:this.onPlayPause}):i.createElement("i",{ref:"startPlaying",className:"fa fa-play",onClick:this.onPlayPause}),t={marginLeft:(this.props.timelineWidth-297)/2},o=this.state.showSettings?i.createElement(n.default,{onFinished:this.onSettingsFinished,animationModel:this.props.animationModel}):void 0;return i.createElement("div",{style:t,className:"animation-editor-playback-controls"},i.createElement("i",{ref:"goToPrevKeyframe",className:"fa fa-fast-backward",onClick:this.onGoToPrevKeyframe}),i.createElement("i",{ref:"stepTimeBackward",className:"fa fa-step-backward",onClick:this.onStepBackward}),e,i.createElement("i",{ref:"stepTimeForward",className:"fa fa-step-forward",onClick:this.onStepForward}),i.createElement("i",{ref:"goToNextKeyframe",className:"fa fa-fast-forward",onClick:this.onGoToNextKeyframe}),i.createElement("i",{ref:"settings",className:"fa fa-gear",onClick:this.onSettings}),o)},componentDidMount:function(){this.subs=new a.CompositeDisposable;var e=i.findDOMNode(this.refs.startPlaying),t=i.findDOMNode(this.refs.pausePlaying),o=e?e:t;this.subs.add(atom.tooltips.add(o,{title:"Play/Pause"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.goToPrevKeyframe),{title:"Previous Keyframe"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.goToNextKeyframe),{title:"Next Keyframe"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.stepTimeForward),{title:"Next Frame"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.stepTimeBackward),{title:"Previous Frame"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.settings),{title:"Settings"}))},componentWillUnmount:function(){this.subs.dispose()}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./settings":44,atom:void 0,react:void 0}],27:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/components/float-input-view"),a=e("./properties/texture-input"),r=e("./properties/rgb-input"),s=e("./properties/pixi-input"),l=e("./properties/event-input"),d=e("./properties/offset-input"),c=e("./properties/audio-input"),u=e("./properties/keysref-input"),h=e("../../atom-react/components/jibo-combo-box"),p=e("../../behavior-editor/arguments/boolean-view"),m=e("path"),f=0,v=i.createClass({displayName:"properties",onPropertyChange:function(e,t){var o={};o[e]=t,this.props.animationModel.updateSelectedLayerProperties(o),this.props.animationModel.addRedoUndoEntry()},onVector2Change:function(e,t,o){var i={};i[e]={},i[e][t]=o,this.props.animationModel.updateSelectedLayerProperties(i),this.props.animationModel.addRedoUndoEntry()},vector2Input:function(e,t,o,a){var r=this,s="Scale"===e?4:1;return i.createElement("div",{style:{float:"right",display:"flex"}},i.createElement("div",{className:"btn",style:{marginRight:5},onClick:function(){r.onVector2Change(e,"x",a.x),r.onVector2Change(e,"y",a.y)}},i.createElement("i",{className:"fa fa-refresh"})),i.createElement("div",{style:{float:"left"}},[i.createElement(n.default,{style:{clear:"both",maxWidth:150},onChange:this.onVector2Change.bind(this,e,"x"),value:t.x,precision:s,tabIndex:o}),i.createElement(n.default,{style:{clear:"both",maxWidth:150},onChange:this.onVector2Change.bind(this,e,"y"),value:t.y,precision:s,tabIndex:o+1})]))},rgbInput:function(e,t,o,i){return r.default(e,t,o,i,this.props.animationModel)},offsetInput:function(e,t){var o=this.onPropertyChange.bind(this,e);return d.default(o,t)},floatInput:function(e,t,o,a){var r=this;return i.createElement("div",{style:{float:"right",display:"flex"}},i.createElement("div",{className:"btn",style:{marginRight:5},onClick:function(){r.onPropertyChange(e,a)}},i.createElement("i",{className:"fa fa-refresh"})),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onPropertyChange.bind(this,e),value:t,precision:2,tabIndex:o}))},textureInput:function(e,t){var o=this;return a.default(function(t){o.onPropertyChange(e,t),o.props.animationModel.editor.focus()},t,this.props.animationModel.projectRoot,this.props.animationModel.uri)},pixiInput:function(e,t){var o=this;return s.default(function(t){o.onPropertyChange(e,t),o.props.animationModel.editor.focus()},t,this.props.animationModel.projectRoot)},eventInput:function(e,t){var o=this.onPropertyChange.bind(this,e);return l.default(o,t)},audioInput:function(e,t){var o=this;return c.default(function(t){o.onPropertyChange(e,t),o.props.animationModel.editor.focus()},t,this.props.animationModel.projectRoot)},keysrefInput:function(e,t){var o=this;return u.default(function(t){o.onPropertyChange(e,t),o.props.animationModel.editor.focus()},t,this.props.animationModel.projectRoot,m.dirname(this.props.animationModel.editor.uri))},enumInput:function(e,t,o,n,a){var r=this;return i.createElement("div",{style:{float:"right",marginRight:5}},i.createElement(h.default,{key:f++,data:o,init:t?t:a,onSelected:function(t){r.onPropertyChange(e,t),r.props.animationModel.editor.focus()}}))},boolInput:function(e,t){var o=this,n=p.default(t,f++,function(t){o.onPropertyChange(e,t)});return i.createElement("div",{style:{float:"right",marginRight:5}},n)},renderProperties:function(){var e=this,t=this.props.animationModel.getKeyframeInfo(),o=this.props.animationModel.getSelectedLayer(),n=t.layerTypes[o.type].getInfo(),a=[],r=1;for(var s in n.properties){var l=n.properties[s].type,d=n.properties[s].label||s,c=n.properties[s].defaultValue,u=c;void 0!==this.props.animationModel.state.overrides[o.id]&&(u=this.props.animationModel.state.overrides[o.id][s]);var h=1;if(u&&(h=Object.keys(u).length?Object.keys(u).length:1),"string"==typeof l)try{a.push(i.createElement("h3",{style:{paddingTop:7,marginBottom:7,marginRight:4,clear:"both",textAlign:"right"}},d)),a.push(this[l+"Input"](s,u,r,c))}catch(e){}else"object"==typeof l&&"enum"===l.name&&(a.push(i.createElement("h3",{style:{paddingTop:7,marginBottom:7,marginRight:4,clear:"both",textAlign:"right"}},d)),a.push(this.enumInput(s,u,l.values,r,c)));r+=h}a.push(i.createElement("div",{style:{clear:"both"}})),a.push(i.createElement("div",{style:{float:"right",marginTop:7},className:"btn",onClick:function(){var t={};for(var o in n.properties)t[o]=n.properties[o].defaultValue;e.props.animationModel.updateSelectedLayerProperties(t),e.props.animationModel.addRedoUndoEntry()}},"Reset All")),a.push(i.createElement("div",{style:{clear:"both"}}));var p=[],m=this.props.animationModel.limits.exceedsVelLimit,f=this.props.animationModel.limits.exceedsAccelLimit;if((m||f)&&"Body"===n.layerType){m&&p.push("velocity"),f&&p.push("acceleration");var v=p.join(" and ");a.push(i.createElement("p",{className:"text-warning",style:{marginTop:7,whiteSpace:"normal",color:"#A83131"}},"Warning: an animation you have created exceeds Jibo's internal motor ",v," limits. Your animation may appear slower on Jibo than in the simulator, or you may hurt Jibo using this animation."))}return a},render:function(){var e,t={properties:{},panel:{minHeight:this.props.paneHeight-60}},o=this.props.animationModel.getSelectedLayer();return null===o||o.locked||!o.visible||this.props.animationModel.keyframeSelection.isMultiSelect()?e=i.createElement("div",{style:{height:200}}):(e=[i.createElement("h2",{style:{textAlign:"right"}},o.name)],e=e.concat(this.renderProperties())),i.createElement("div",{style:t.properties,className:"animation-editor-properties native-key-bindings"},i.createElement("atom-panel",{className:"top native-key-bindings"},i.createElement("div",{className:"padded native-key-bindings"},i.createElement("div",{style:t.panel,className:"inset-panel native-key-bindings"},i.createElement("div",{className:"panel-heading native-key-bindings"},"Properties"),i.createElement("div",{className:"panel-body padded native-key-bindings"},e)))))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=v},{"../../atom-react/components/float-input-view":50,"../../atom-react/components/jibo-combo-box":53,"../../behavior-editor/arguments/boolean-view":62,"./properties/audio-input":28,"./properties/event-input":37,"./properties/keysref-input":38,"./properties/offset-input":39,"./properties/pixi-input":40,"./properties/rgb-input":41,"./properties/texture-input":42,path:void 0,react:void 0}],28:[function(e,t,o){"use strict";var i=e("react"),n=e("fs"),a=e("path"),r=e("../../../common/modals/choose-file-modal"),s=e("../../../atom-react/mixins/modal-mixin"),l=e("atom"),d=e("../../../common/atom-editor"),c=i.createClass({mixins:[s.default],getInitialState:function(){var e={file:this.props.content.file};return e},componentWillReceiveProps:function(e){e.content.file!==this.state.file&&this.setState({file:e.content.file})},getRoot:function(){return a.resolve(this.props.projectRoot)},getUri:function(){var e=this.state.file.split("://");if(1===e.length){var t=a.resolve(this.props.projectRoot,"audio",this.state.file);return t}if(2===e.length){var t=a.resolve(this.props.projectRoot,"node_modules",e[0],"audio",e[1]);return t}},render:function(){var e=this,t={};try{n.statSync(this.getUri())}catch(e){t={disabled:!0}}var o=t.disabled?i.createElement("div",{className:"error-messages"},"No audio file by that name"):null;return i.createElement("div",{style:{width:"100%"}},i.createElement("div",{className:"block"},i.createElement("div",{className:"fileBlock"},i.createElement("button",{ref:"chooseAudio",style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),i.createElement(d.default,{ref:"audioEditor",content:this.state.file,onDidChange:function(t){e.state.file=t},mini:!0,tooltip:{title:"Current Audio"},onConfirm:function(){e.props.onChange({file:e.state.file})}})),o,i.createElement("br",null)))},onChoose:function(){var e=this;this.createModal(i.createElement(r.default,{root:this.getRoot(),uri:this.getUri(),settings:Object.assign({},r.AudioSettings,{restrictPath:"audio"}),onChoose:function(t,o){
e.setState({file:o}),e.props.onChange({file:o})},onClose:function(){e.destroyModal()}}))},componentDidMount:function(){this.subs=new l.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.chooseAudio),{title:"Choose Audio"}))},componentWillUnmount:function(){this.subs.dispose()}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(c,{onChange:e,content:t,projectRoot:o})}},{"../../../atom-react/mixins/modal-mixin":57,"../../../common/atom-editor":96,"../../../common/modals/choose-file-modal":107,atom:void 0,fs:void 0,path:void 0,react:void 0}],29:[function(e,t,o){"use strict";var i=e("react"),n=e("region"),a=e("./utils/common"),r=e("./utils/validate"),s=e("./defaultColor"),l=e("./utils/toStringValue"),d=e("atom");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass(Object.assign({displayName:"HueSpectrum",getDefaultProps:function(){return{height:300,width:30,pointerSize:3,defaultColor:s.default}},getInitialState:function(){return{h:0}},componentDidUpdate:function(){},componentDidMount:function(){this.updateDragPositionIf(),this.subs=new d.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.huePicker),{title:"Hue Picker"}))},componentWillUnmount:function(){this.subs.dispose()},updateDragPositionIf:function(){this.props.height||this.setState({})},render:function(){this.hsv=this.toColorValue(this.state.value||this.props.value||this.props.defaultValue||this.props.defaultColor),360!==this.state.h||this.hsv.h||(this.hsv.h=360);var e=Object.assign({},this.props.style);this.props.height&&(e.height=this.props.height),this.props.width&&(e.width=this.props.width);var t={height:this.props.pointerSize},o=this.getDragPosition();return null!==o&&(t.top=o,t.display="block"),i.createElement("div",{ref:"huePicker",className:"cp-hue-spectrum",style:e,onMouseDown:this.onMouseDown},i.createElement("div",{className:"cp-hue-drag",style:t},i.createElement("div",{className:"inner"})))},getDragPosition:function(e){if(e=e||this.hsv,!this.props.height&&!this.isMounted())return null;var t=this.props.height||n.fromDOM(this.getDOMNode()).getHeight(),o=this.props.pointerSize,i=Math.round(e.h*t/360),a=Math.round(o/2);return i-a},updateColor:function(e){e=r.default(e),this.hsv.h=360*e.y/e.height,0!==this.hsv.h&&(this.state.h=this.hsv.h),this.state.h=0!==this.hsv.h?this.hsv.h:0},toStringValue:l.default},a.default))},{"./defaultColor":31,"./utils/common":34,"./utils/toStringValue":35,"./utils/validate":36,atom:void 0,react:void 0,region:void 0}],30:[function(e,t,o){"use strict";var i=e("react"),n=e("region"),a=e("./utils/color"),r=a.default.fromRatio,s=e("./utils/common"),l=e("./utils/validate"),d=e("./defaultColor"),c=e("./utils/toStringValue"),u=e("atom");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass(Object.assign({displayName:"SaturationSpectrum",getDefaultProps:function(){return{height:300,width:300,pointerSize:7,defaultColor:d.default}},getInitialState:function(){return{pointerTop:null,pointerLeft:null}},componentDidUpdate:function(){},componentDidMount:function(){this.updateDragPositionIf(),this.subs=new u.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.saturationPicker),{title:"Saturation Picker"}))},componentWillUnmount:function(){this.subs.dispose()},updateDragPositionIf:function(){this.props.height&&this.props.width||this.setState({})},getDragPosition:function(e){e=e||this.hsv;var t=this.props.width,o=this.props.height,i=t&&o;if(!i&&!this.isMounted())return null;var a;i||(a=n.fromDOM(this.getDOMNode()),o=o||a.getHeight(),t=t||a.getWidth());var r=e.s*t,s=o-e.v*o,l=this.props.pointerSize,d=Math.floor(l/2);return this.props.value&&this.state.mouseDown,{left:r-d,top:s-d}},prepareBackgroundColor:function(e){var t=e,o=r({h:t.h%360/360,s:1,v:1});return o.toRgbString()},prepareProps:function(e,t){var o=Object.assign({},e),i=t.value||o.value||o.defaultValue||o.defaultColor;return o.color=i,this.hsv=this.toColorValue(i),o.style=this.prepareStyle(o),o.className=this.prepareClassName(o),o},prepareClassName:function(e){var t=e.className||"";return t+=" cp-saturation-spectrum"},prepareStyle:function(e){var t=e.style||{};return e.height&&(t.height=e.height),e.width&&(t.width=e.width),t.backgroundColor=this.prepareBackgroundColor(this.hsv),t},render:function(){var e=this.p=this.prepareProps(this.props,this.state),t={width:this.props.pointerSize,height:this.props.pointerSize},o=this.getDragPosition();return o&&(t.top=o.top,t.left=o.left,t.display="block"),i.createElement("div",{ref:"saturationPicker",className:e.className,style:e.style,onMouseDown:this.onMouseDown},i.createElement("div",{className:"cp-saturation-white"},i.createElement("div",{className:"cp-saturation-black"})),i.createElement("div",{className:"cp-saturation-drag",style:t},i.createElement("div",{className:"inner"})))},getSaturationForPoint:function(e){return e.x/e.width},getColorValueForPoint:function(e){return(e.height-e.y)/e.height},updateColor:function(e){e=l.default(e),this.hsv.s=this.getSaturationForPoint(e),this.hsv.v=this.getColorValueForPoint(e)},toStringValue:c.default},s.default))},{"./defaultColor":31,"./utils/color":33,"./utils/common":34,"./utils/toStringValue":35,"./utils/validate":36,atom:void 0,react:void 0,region:void 0}],31:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default="red"},{}],32:[function(e,t,o){"use strict";function i(){}var n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a=e("react"),r=e("./utils/color"),s=r.default.toHsv,l=e("./HueSpectrum"),d=e("./SaturationSpectrum"),c=e("./defaultColor"),u=e("./utils/toStringValue"),h=a.createClass({displayName:"ColorPicker",getDefaultProps:function(){return{defaultColor:c.default,saturationWidth:300,saturationHeight:300,hueHeight:null,hueWidth:30,hueMargin:10}},getInitialState:function(){return{value:this.props.defaultValue}},prepareClassName:function(e){var t=e.className||"";return t+=" cp"},prepareProps:function(e){return e.className=this.prepareClassName(e),e},render:function(){var e=this.prepareProps(Object.assign({},this.props)),t=this.props.hueStyle||{};t.marginLeft=this.props.hueMargin;var o=e.value?this.toColorValue(this.props.value):null,i=o?null:this.toColorValue(this.state.value||e.defaultValue||e.defaultColor),r={onDrag:this.handleSaturationDrag,onChange:this.handleSaturationChange,onMouseDown:this.handleSaturationMouseDown,height:e.saturationHeight,width:e.saturationWidth,inPicker:!0},s={onDrag:this.handleHueDrag,onChange:this.handleHueChange,height:e.hueHeight||e.saturationHeight,width:e.hueWidth,inPicker:!0,style:t};return this.state.dragHue&&((o||i).h=this.state.dragHue),o?(r.value=Object.assign({},o),s.value=Object.assign({},o)):(r.defaultValue=Object.assign({},i),s.defaultValue=Object.assign({},i)),a.createElement("div",n({},e),a.createElement(d.default,n({},r)),a.createElement(l.default,n({},s)))},toColorValue:function(e){return"string"==typeof e?s(e):e},toStringValue:u.default,handleChange:function(e){this.state.dragHue=null,e=Object.assign({},e);var t=this.toStringValue(e);(this.props.onChange||i)(t,e)},handleSaturationChange:function(e){this.handleChange(e)},handleHueChange:function(e){this.handleChange(e)},handleHueDrag:function(e){this.handleDrag(e)},handleSaturationDrag:function(e){this.handleDrag(e)},handleDrag:function(e){this.props.value||this.setState({value:e}),(this.props.onDrag||i)(this.toStringValue(e),e)},handleSaturationMouseDown:function(e){this.setState({dragHue:e.h})}});h.HueSpectrum=l.default,h.SaturationSpectrum=d.default,Object.defineProperty(o,"__esModule",{value:!0}),o.default=h},{"./HueSpectrum":29,"./SaturationSpectrum":30,"./defaultColor":31,"./utils/color":33,"./utils/toStringValue":35,react:void 0}],33:[function(e,t,o){"use strict";function i(e){return l(e)}function n(e){var t=i(e).toHsl().h;return i({h:t,s:100,l:50,a:1})}function a(e){return l.fromRatio(e)}function r(e,t){return t>1&&(t/=100),e=i(e).toRgb(),e.a=t,i(e)}function s(e){return i(e).toHsv()}var l=e("tinycolor2");"undefined"!=typeof window&&(window.tinycolor=l),o.toColor=i,o.toPure=n,o.fromRatio=a,o.toAlpha=r,o.toHsv=s;var d={toColor:i,toPure:n,fromRatio:a,toAlpha:r,toHsv:s};"undefined"!=typeof window&&(window.color=d),Object.defineProperty(o,"__esModule",{value:!0}),o.default=d},{tinycolor2:void 0}],34:[function(e,t,o){"use strict";function i(){}var n=e("region"),a=e("drag-helper"),r=e("./color");Object.defineProperty(o,"__esModule",{value:!0}),o.default={toColorValue:function(e){return"string"==typeof e?r.toHsv(e):{h:e.h,s:e.s,v:e.v,a:e.a}},onMouseDown:function(e){e.preventDefault();var t=n.fromDOM(this.getDOMNode()),o=this.getEventInfo(e,t);a(e,{scope:this,constrainTo:t,onDragStart:function(e,i){i.initialPoint=o,i.minLeft=0,i.maxLeft=t.width,this.handleDragStart(e)},onDrag:function(e,o){var i=this.getEventInfo(e,t);this.updateColor(i),this.handleDrag(e,o)},onDrop:function(e,o){var i=this.getEventInfo(e,t);this.updateColor(i),this.handleDrop(e,o)}}),this.updateColor(o),this.handleMouseDown(e,{initialPoint:o})},handleMouseDown:function(e,t){(this.props.onMouseDown||i).apply(this,this.getColors()),this.handleDrag(e,t)},handleUpdate:function(e,t){var o=t.diff||{top:0,left:0},i=t.initialPoint;if(i){var n,a=void 0;a=i.x+o.left,n=i.y+o.top,a=Math.max(a,t.minLeft),a=Math.min(a,t.maxLeft),this.state.top=n,this.state.left=a,this.state.mouseDown={x:a,y:n,width:i.width,height:i.height}}this.props.inPicker||this.props.value||this.setState({value:this.hsv})},handleDragStart:function(){},handleDrag:function(e,t){this.handleUpdate(e,t),(this.props.onDrag||i).apply(this,this.getColors())},handleDrop:function(e,t){this.handleUpdate(e,t),this.state.mouseDown=!1,(this.props.onChange||i).apply(this,this.getColors())},getColors:function(){var e=this.props.inPicker?this.hsv:this.toStringValue(this.hsv),t=[e];return this.props.inPicker||t.push(Object.assign({},this.hsv)),t},getEventInfo:function(e,t){t=t||n.fromDOM(this.getDOMNode());var o=e.clientX-t.left,i=e.clientY-t.top;return{x:o,y:i,width:t.getWidth(),height:t.getHeight()}}}},{"./color":33,"drag-helper":void 0,region:void 0}],35:[function(e,t,o){"use strict";var i=e("tinycolor2");Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e){return e=i(Object.assign({},e)),1===e.toRgb().a?e.toHexString():e.toRgbString()}},{tinycolor2:void 0}],36:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e){var t=e.height,o=e.width;return e.x<0&&(e.x=0),e.x>=o&&(e.x=o),e.y<0&&(e.y=0),e.y>=t&&(e.y=t),e}},{}],37:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=e("../../../common/atom-editor"),r=i.createClass({getInitialState:function(){var e={name:this.props.content.name,payload:this.props.content.payload};return e},componentWillReceiveProps:function(e){e.content.name===this.state.name&&e.content.payload===this.state.payload||this.setState({payload:e.content.payload,name:e.content.name})},componentDidMount:function(){this.subs=new n.CompositeDisposable,this.subs.add(atom.tooltips.add(this.refs.nameEditor.getDOM(),{title:"Event Name"})),this.subs.add(atom.tooltips.add(this.refs.payloadEditor.getDOM(),{title:"Event Payload"}))},componentWillUnmount:function(){this.subs.dispose()},render:function(){var e=this,t="";if(this.state.payload.length>0)try{JSON.parse(this.state.payload)}catch(e){t="Not valid JSON:\n"+e}return i.createElement("div",{className:"event-editor",style:{width:"100%"}},i.createElement("div",{style:{display:"flex",clear:"both",marginTop:15,marginBottom:15}},i.createElement("div",{style:{fontSize:14,marginRight:15}},"Name"),i.createElement(a.default,{mini:!0,ref:"nameEditor",style:{width:"100%"},content:this.state.name,onDidChange:function(t){e.state.name=t,e.props.onChange({name:e.state.name,payload:e.state.payload})}})),i.createElement("div",{style:{fontSize:14,marginRight:15,marginBottom:5}},"Payload"),i.createElement(a.default,{ref:"payloadEditor",style:{height:250,width:"100%"},content:this.state.payload,grammar:"source.json",onDidChange:function(t){e.state.payload=t,e.props.onChange({name:e.state.name,payload:e.state.payload})}}),i.createElement("div",{className:"error-messages"},t))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t){return i.createElement(r,{onChange:e,content:t})}},{"../../../common/atom-editor":96,atom:void 0,react:void 0}],38:[function(e,t,o){"use strict";var i=e("react"),n=e("fs"),a=e("path"),r=e("normalize-path"),s=e("../../../behavior-editor/modals/choose-animation-modal"),l=e("../../../atom-react/mixins/modal-mixin"),d=e("atom"),c=e("../../../common/atom-editor"),u=i.createClass({mixins:[l.default],getInitialState:function(){var e={file:this.props.content.file};return e},componentWillReceiveProps:function(e){e.content.file!==this.state.file&&this.setState({file:e.content.file})},getRoot:function(){return a.resolve(this.props.projectRoot,"animations")},getUri:function(){var e=this.state.file.split("://");if(1===e.length){var t=a.resolve(this.props.sourceFileDir,this.state.file);return t}if(2===e.length){var t=a.resolve(this.props.projectRoot,"node_modules",e[0],"animations",e[1]);return t}},render:function(){var e=this,t={};try{n.statSync(this.getUri())}catch(e){t={disabled:!0}}var o=t.disabled?i.createElement("div",{className:"error-messages"},"No keys file by that name"):null;return i.createElement("div",{style:{width:"100%"}},i.createElement("div",{className:"block"},i.createElement("div",{className:"fileBlock"},i.createElement("button",{ref:"chooseKeys",style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),i.createElement(c.default,{ref:"keyrefsEditor",mini:!0,content:this.state.file,tooltip:{title:"Current Keys File"},onDidChange:function(t){e.state.file=t},onConfirm:function(){e.props.onChange({file:e.state.file})}})),o,i.createElement("br",null)))},onChoose:function(){var e=this;this.createModal(i.createElement(s.default,{root:this.getRoot(),uri:this.getUri(),onChoose:function(t){var o=a.resolve(e.props.projectRoot,"animations",r(t));t=r(a.relative(e.props.sourceFileDir,o)),e.setState({file:t}),e.props.onChange({file:t})},onClose:function(){e.destroyModal()}}))},componentDidMount:function(){this.subs=new d.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.chooseKeys),{title:"Choose Keys File"}))},componentWillUnmount:function(){this.subs.dispose()}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,n){return i.createElement(u,{onChange:e,content:t,projectRoot:o,sourceFileDir:n})}},{"../../../atom-react/mixins/modal-mixin":57,"../../../behavior-editor/modals/choose-animation-modal":82,"../../../common/atom-editor":96,atom:void 0,fs:void 0,"normalize-path":void 0,path:void 0,react:void 0}],39:[function(e,t,o){"use strict";var i=e("react"),n=e("../../../common/atom-editor"),a=i.createClass({getInitialState:function(){return{offset:this.props.offset}},componentWillReceiveProps:function(e){e.offset!==this.state.offset&&this.setState({offset:e.offset})},render:function(){var e=this;return i.createElement("div",{className:"event-editor",style:{width:"100%"}},i.createElement(n.default,{mini:!0,ref:"offsetEditor",style:{width:"100%"},content:this.state.offset,tooltip:{title:"Frame Offset"},onDidChange:function(t){e.state.offset=t,e.props.onChange(e.state.text)}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t){return i.createElement(a,{onChange:e,offset:t})}},{"../../../common/atom-editor":96,react:void 0}],40:[function(e,t,o){"use strict";var i=e("react"),n=e("fs"),a=e("path"),r=e("normalize-path"),s=e("../../../common/modals/choose-pixi-modal"),l=e("../../../atom-react/mixins/modal-mixin"),d=e("atom"),c=e("../../../common/atom-editor"),u=i.createClass({mixins:[l.default],getInitialState:function(){var e={file:this.props.content};return e},componentWillReceiveProps:function(e){e.content!==this.state.file&&this.setState({file:e.content})},getRoot:function(){return a.resolve(this.props.projectRoot,"timelines")},getUri:function(){var e=this.state.file.split("://");if(1===e.length){var t=a.resolve(this.props.projectRoot,"timelines",this.state.file);return t}if(2===e.length){var t=a.resolve(this.props.projectRoot,"node_modules",e[0],"timelines",e[1]);return t}},render:function(){var e=this,t={};try{n.statSync(this.getUri())}catch(e){t={disabled:!0}}var o=t.disabled?i.createElement("div",{className:"error-messages"},"No pixi file by that name"):null;return i.createElement("div",{style:{width:"100%"}},i.createElement("div",{className:"block"},i.createElement("div",{className:"fileBlock"},i.createElement("button",{ref:"chooseAudio",style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),i.createElement(c.default,{ref:"pixiEditor",mini:!0,content:this.state.file,onDidChange:function(t){e.state.file=t},tooltip:{title:"Choose Pixi File"},onConfirm:function(){e.props.onChange({file:e.state.file})}})),o,i.createElement("br",null)))},onChoose:function(){var e=this;this.createModal(i.createElement(s.default,{root:this.getRoot(),uri:this.getUri(),onChoose:function(t){t=r(t),e.setState({file:t}),e.props.onChange(t)},onClose:function(){e.destroyModal()}}))},componentDidMount:function(){this.subs=new d.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.chooseAudio),{title:"Choose Pixi File"}))},componentWillUnmount:function(){this.subs.dispose()}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(u,{onChange:e,content:t,projectRoot:o})}},{"../../../atom-react/mixins/modal-mixin":57,"../../../common/atom-editor":96,"../../../common/modals/choose-pixi-modal":108,atom:void 0,fs:void 0,"normalize-path":void 0,path:void 0,react:void 0}],41:[function(e,t,o){"use strict";var i=e("react"),n=e("../../../atom-react/components/float-input-view"),a=e("./color-picker/index"),r=e("color-space/rgb"),s=e("color-space/hsv"),l=e("color-string"),d=e("atom"),c=e("../../../common/atom-editor"),u=i.createClass({getInitialState:function(){var e=[Math.floor(this.props.value.r),Math.floor(this.props.value.g),Math.floor(this.props.value.b)];return{color:l.hexString(e),value:this.props.value}},updateFromDrag:function(e,t){var o=s.rgb([Math.round(t.h),Math.round(100*t.s),Math.round(100*t.v)]),i={r:Math.round(o[0]),g:Math.round(o[1]),b:Math.round(o[2])},n={};n[this.props.propName]=i,this.props.animationModel.updateSelectedLayerProperties(n)},updateFromHexString:function(e){var t=l.getRgb(e);if(t){var o={};o[this.props.propName]={r:t[0],g:t[1],b:t[2]},this.props.animationModel.updateSelectedLayerProperties(o)}else this.refs.editor.setText(this.state.color)},updateFromHsv:function(e){var t=s.rgb(e),o={r:Math.round(t[0]),g:Math.round(t[1]),b:Math.round(t[2])},i={};i[this.props.propName]=o,this.props.animationModel.updateSelectedLayerProperties(i)},_hsvFromState:function(){var e=r.hsv([this.state.value.r,this.state.value.g,this.state.value.b]);return e},_clamp:function(e){return e},onRChange:function(e){var t={};t[this.props.propName]={r:this._clamp(e,0,255),g:this.state.g,b:this.state.b},this.props.animationModel.updateSelectedLayerProperties(t)},onGChange:function(e){var t={};t[this.props.propName]={r:this.state.r,g:this._clamp(e,0,255),b:this.state.b},this.props.animationModel.updateSelectedLayerProperties(t)},onBChange:function(e){var t={};t[this.props.propName]={r:this.state.r,g:this.state.g,b:this._clamp(e,0,255)},this.props.animationModel.updateSelectedLayerProperties(t)},onHChange:function(e){var t=this._hsvFromState();t[0]=this._clamp(Math.round(e),0,360),this.updateFromHsv(t)},onSChange:function(e){var t=this._hsvFromState();t[1]=this._clamp(Math.round(e),0,100),this.updateFromHsv(t)},onVChange:function(e){var t=this._hsvFromState();t[2]=this._clamp(Math.round(e),0,100),this.updateFromHsv(t)},componentWillReceiveProps:function(e){var t=[Math.round(e.value.r),Math.round(e.value.g),Math.round(e.value.b)],o=l.hexString(t);this.setState({color:o,value:{r:t[0],g:t[1],b:t[2]}})},componentWillUnmount:function(){this.subs.dispose()},componentDidMount:function(){this.subs=new d.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.reset),{title:"Reset Color"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.rgb),{title:"RGB Color"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.hsv),{title:"HSV Color"}))},onRgbConfirm:function(){var e=this.refs.editor.getText();this.updateFromHexString(e)},render:function(){var e=this,t=this.props.propName,o=this.props.tabIndex,r=this.props.defaultValue,s=this._hsvFromState();return i.createElement("div",{className:"hsv-input",style:{float:"right"}},i.createElement(a.default,{saturationWidth:150,saturationHeight:150,value:this.state.color,width:150,onDrag:this.updateFromDrag}),i.createElement("div",{style:{display:"flex",float:"right",clear:"both",marginTop:15}},i.createElement("div",{style:{fontSize:14,margin:2}},"rgb"),i.createElement(c.default,{mini:!0,ref:"editor",tooltip:{title:"RGB Color"},onBlur:this.onRgbConfirm,style:{width:150,float:"left"},content:this.state.color,onConfirm:function(){e.refs.editor.blur()}})),i.createElement("div",{style:{display:"flex",float:"right",clear:"both",marginTop:15}},i.createElement("div",{ref:"reset",className:"btn",style:{marginRight:5},onClick:function(){var o={};o[t]=r,e.props.animationModel.updateSelectedLayerProperties(o),e.props.animationModel.addRedoUndoEntry()}},i.createElement("i",{className:"fa fa-refresh"})),i.createElement("div",{style:{float:"left"}},[i.createElement("div",{ref:"rgb"},i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"r"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onRChange,value:this.state.value.r,precision:0,tabIndex:o})),i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"g"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onGChange,value:this.state.value.g,precision:0,tabIndex:o+1})),i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"b"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onBChange,value:this.state.value.b,precision:0,tabIndex:o+2}))),i.createElement("div",{style:{height:10}}),i.createElement("div",{ref:"hsv"},i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"h"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onHChange,value:s[0],precision:0,tabIndex:o+3})),i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"s"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onSChange,value:s[1],precision:0,tabIndex:o+4})),i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"v"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onVChange,value:s[2],precision:0,tabIndex:o+5})))])))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,n,a){return i.createElement(u,{propName:e,value:t,tabIndex:o,defaultValue:n,animationModel:a})}},{"../../../atom-react/components/float-input-view":50,"../../../common/atom-editor":96,"./color-picker/index":32,atom:void 0,"color-space/hsv":void 0,"color-space/rgb":void 0,"color-string":void 0,react:void 0}],42:[function(e,t,o){"use strict";var i=e("react"),n=e("../../../atom-react/mixins/modal-mixin"),a=e("path"),r=e("fs"),s=e("../../../common/modals/choose-file-modal"),l=e("normalize-path"),d=e("atom"),c=e("../../../common/atom-editor"),u=i.createClass({mixins:[n.default],getInitialState:function(){var e=this.getDisplayValue(this.props.content);return{content:this.props.content,displayValue:e}},componentWillReceiveProps:function(e){var t=e.content,o=this.getDisplayValue(t);this.setState({content:t,displayValue:o})},render:function(){var e=this,t={};try{r.statSync(this.getUri())}catch(e){t={disabled:!0}}var o=t.disabled?i.createElement("div",{className:"error-messages"},"No texture file by that name"):null;return i.createElement("div",{style:{width:"100%"}},i.createElement("div",{className:"block"},i.createElement("div",{className:"fileBlock"},i.createElement("button",{ref:"chooseTexture",style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),i.createElement(c.default,{onBlur:this.onBlur,ref:"editor",mini:!0,content:this.state.displayValue,onDidChange:function(t){e.state.content=e.getDataValue(t),e.state.displayValue=t},onConfirm:function(){e.props.onChange(e.state.content),document.querySelector("atom-pane.pane.active .animation-editor").childNodes[0].focus()}})),o,i.createElement("br",null)))},getUri:function(){return a.resolve(this.props.projectRoot,this.state.content)},getDisplayValue:function(e){var t=e.split("/");if("node_modules"===t[0]){var o=t[1],i=a.join("node_modules",o,"animations","textures");return i=l(a.relative(i,e)),o+"://"+i}if(""===e)return"";var i=a.join("animations","textures");return i=a.relative(i,e),l(i)},getDataValue:function(e){var t=e.split("://");if(1===t.length){var o=a.join("animations","textures",e);return l(o)}if(2===t.length){var o=a.join("node_modules",t[0],"animations","textures",t[1]);return l(o)}return""},onChoose:function(){var e=this;this.createModal(i.createElement(s.default,{root:this.props.projectRoot,uri:this.getUri(),settings:Object.assign({},s.TextureSettings,{restrictPath:"animations/textures"}),onChoose:function(t){var o=l(t),i=e.getDisplayValue(o);e.setState({content:o,displayValue:i}),e.props.onChange(o),document.querySelector("atom-pane.pane.active .animation-editor").childNodes[0].focus()},onClose:function(){e.destroyModal()}}))},onBlur:function(){this.props.onChange(this.state.content),document.querySelector("atom-pane.pane.active .animation-editor").childNodes[0].focus()},componentWillUnmount:function(){this.subs.dispose()},componentDidMount:function(){this.subs=new d.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.chooseTexture),{title:"Change Texture"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.editor),{title:"Current Texture"}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,n){return i.createElement(u,{key:100,content:t,onChange:e,projectRoot:o,animationPath:n})}},{"../../../atom-react/mixins/modal-mixin":57,"../../../common/atom-editor":96,"../../../common/modals/choose-file-modal":107,atom:void 0,fs:void 0,"normalize-path":void 0,path:void 0,react:void 0}],43:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=i.createClass({displayName:"settings-item",onFocus:function(){this.refs.input.getDOMNode().select()},componentDidMount:function(){var e=this;this.disposables=new n.CompositeDisposable,this.disposables.add(atom.commands.add(this.refs.input.getDOMNode(),{"jibo-sdk:confirm":function(){e.props.onConfirm()},"jibo-sdk:escape":function(){e.props.onCancel()}}))},componentWillUnmount:function(){this.disposables.dispose()},render:function(){return i.createElement("div",null,i.createElement("label",null,this.props.label),i.createElement("br",null),i.createElement("input",{ref:"input",style:{width:122},onFocus:this.onFocus,className:"native-key-bindings",tabIndex:this.props.tabIndex,type:this.props.type,step:this.props.step,onMouseDown:this.props.onMouseDown,onChange:this.props.onChange,value:this.props.value,min:this.props.min}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{atom:void 0,react:void 0}],44:[function(e,t,o){"use strict";var i=e("react"),n=e("./settings-item"),a=i.createClass({displayName:"settings",getInitialState:function(){return{duration:this.props.animationModel.state.keyframes.duration,scale:this.props.animationModel.state.keyframes.scale,lastScale:this.props.animationModel.state.keyframes.scale}},componentDidMount:function(){this.getDOMNode().childNodes[1].childNodes[0].childNodes[2].focus()},onFinished:function(){if(this.state.duration!==this.props.animationModel.state.keyframes.duration)this.props.animationModel.setDuration(this.state.duration,!0,!0),this.props.animationModel.addRedoUndoEntry(),this.props.onFinished();else if(this.state.scale!==this.props.animationModel.state.keyframes.scale){if(0===this.state.scale)return this.setState({scale:this.state.lastScale}),void this.props.onFinished();this.setState({lastScale:this.state.scale}),this.props.animationModel.setScale(this.state.scale),this.props.animationModel.setDuration(this.state.duration,!1,!0),this.props.animationModel.setKeyframes(),this.props.animationModel.addRedoUndoEntry(),this.props.onFinished()}else this.props.onFinished()},onDurationChange:function(e){if(/^\d+$/.test(e.target.value)){var t=parseInt(e.target.value);this.setState({duration:t})}},onScaleChange:function(e){var t=e.target.value;this.setState({scale:t})},onMouseDown:function(){if(this.state.duration!==this.props.animationModel.state.keyframes.duration)this.props.animationModel.setDuration(this.state.duration,!0,!0),this.props.animationModel.addRedoUndoEntry();else if(this.state.scale!==this.props.animationModel.state.keyframes.scale){if(0===this.state.scale)return void this.setState({scale:this.state.lastScale});this.setState({lastScale:this.state.scale}),this.props.animationModel.setScale(this.state.scale);var e=this.props.animationModel.setDuration(this.state.duration,!1,!0);this.props.animationModel.setKeyframes(),this.props.animationModel.addRedoUndoEntry(),this.setState({duration:e})}},onConfirm:function(){this.onFinished()},onCancel:function(){this.props.onFinished()},render:function(){var e=i.createElement(n.default,{label:"Animation Duration",type:"number",step:"0.01",tabIndex:1,onCancel:this.onCancel,onConfirm:this.onConfirm,onMouseDown:this.onMouseDown,onChange:this.onDurationChange,value:this.state.duration,min:1}),t=i.createElement(n.default,{label:"Scale",type:"number",step:"0.01",tabIndex:2,onCancel:this.onCancel,onConfirm:this.onConfirm,onMouseDown:this.onMouseDown,onChange:this.onScaleChange,value:this.state.scale,min:0});return i.createElement("div",{className:"animation-settings native-key-bindings"},i.createElement("div",{onMouseDown:this.onFinished,className:"settings-mousetrap"}),i.createElement("div",{className:"settings-container",onKeyUp:this.onKeyPress,style:{height:"auto"}},e,t))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{"./settings-item":43,react:void 0}],45:[function(e,t,o){"use strict";var i=e("animation-utilities"),n=function(){function e(e){this.scene=e,this.debugObjects={}}return e.prototype.removeIfExists=function(e){this.debugObjects[e]&&(this.scene.remove(this.debugObjects[e]),delete this.debugObjects[e])},e.prototype.addByName=function(e,t){this.removeIfExists(e),this.debugObjects[e]=t,this.scene.add(t)},e.prototype.coerceIfMatrix=function(e){return e instanceof i.THREE.Matrix4?(new i.THREE.Vector3).setFromMatrixPosition(e):e.clone()},e.prototype.info=function(e,t){t=t||"",console.log(t+" name: "+e.name+" ( "+e.position.x+", "+e.position.y+", "+e.position.z+" )");for(var o=0;o<e.children.length;o++)this.info(e.children[o],t+" ")},e.prototype.cube=function(e,t,o,n){var a=new i.THREE.BoxGeometry(o,o,o),r=new i.THREE.MeshBasicMaterial({color:n}),s=new i.THREE.Mesh(a,r),l=this.coerceIfMatrix(t);s.position.x=l.x,s.position.y=l.y,s.position.z=l.z,this.addByName(e,s)},e.prototype.axis=function(e,t,o){var n=new i.THREE.AxisHelper(o);n.applyMatrix(t),this.addByName(e,n)},e.prototype.bounds=function(e,t,o){var n=new i.THREE.BoundingBoxHelper(t,o);n.update(),this.addByName(e,n)},e.prototype.wireframes=function(e,t,o){try{var n=new i.THREE.WireframeHelper(t,o);
this.addByName(e,n)}catch(e){console.log("edges error: "+e)}},e.prototype.clear=function(){for(var e in this.debugObjects)this.scene.remove(this.debugObjects[e]);this.debugObjects={}},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"animation-utilities":void 0}],46:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/components/jibo-combo-box"),a=e("atom"),r=i.createClass({displayName:"time-notches",onNewLayer:function(e){this.props.animationModel.addLayer(e.value),document.querySelector(".active .animation-editor").childNodes[0].focus()},componentDidMount:function(){this.subs=new a.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.addLayer),{title:"Add Layer"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.scrubber),{title:"Scrubber"}))},componentWillUnmount:function(){this.subs.dispose()},render:function(){for(var e=this.props.animationModel.state.keyframes.duration,t=this.props.animationModel.state.keyframes.framerate,o=this.props.animationModel.state.keyframes.duration/t,a=this.props.animationModel.uiState.currentKeyframe,r=[],s=Math.floor(this.props.totalFrames/5)+1,l=0;l<s;l++)r.push(i.createElement("span",{key:l,className:"animation-timeline-notch"},5*l));var d=22,c={container:{width:Math.max(5*s*18+this.props.labelWidth+20,this.props.width),height:d,position:"absolute",marginTop:this.props.offset.y,background:"#363636",borderBottom:"thin solid #444444",zIndex:10},indicator:{marginLeft:18*a,height:20,display:null===this.props.animationModel.getSelectedLayer()?"none":"inline-block"},displayAnchor:{width:this.props.labelWidth-13,marginRight:13,height:d,float:"left",position:"relative"},display:{width:this.props.labelWidth,paddingRight:13,height:d-1,position:"absolute",marginLeft:this.props.offset.x,background:"#363636",zIndex:2},notches:{width:18*s*5,height:d,float:"left",marginLeft:270},miniLine:{height:4,width:2,opacity:.7,position:"absolute",marginTop:18,marginLeft:7,background:"red"}},u=this.props.animationModel.getKeyframeInfo(),h=Object.keys(u.layerTypes),p=[];h.forEach(function(e){p.push({label:e,display:function(){return i.createElement("i",{className:"fa fa-plus-square",style:{fontSize:17}})},value:e})});var m=p[0];return i.createElement("div",{style:c.container,className:"animation-timeline-notches-container"},i.createElement("div",{style:this.displayAnchor},i.createElement("div",{style:c.display,className:"time-display"},i.createElement("div",{ref:"addLayer",style:{float:"left"},className:"new-layer"},i.createElement(n.default,{hideButton:!0,data:p,init:m,onSelected:this.onNewLayer})),i.createElement("span",{className:"frames"},a," of ",e,", "),i.createElement("span",{className:"frame-rate"},t,"fps, "),i.createElement("span",{className:"seconds"},o.toFixed(1),"s"))),i.createElement("div",{style:c.notches,className:"animation-timeline-notches"},i.createElement("div",{ref:"scrubber",style:c.indicator,className:"animation-timeline-indicator",onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},i.createElement("div",{className:"animation-timeline-indicator-handle"},i.createElement("div",{style:c.miniLine}))),r))},onMouseDown:function(){this.props.animationModel.emit("toggle-time-scrub",!0),this.onMouseUpBind=this.onMouseUp.bind(this),document.addEventListener("mouseup",this.onMouseUpBind)},onMouseUp:function(){this.props.animationModel.emit("toggle-time-scrub",!1),document.removeEventListener("mouseup",this.onMouseUpBind)}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"../../atom-react/components/jibo-combo-box":53,atom:void 0,react:void 0}],47:[function(e,t,o){"use strict";var i=e("react"),n=e("./layer"),a=e("./layer-label"),r=e("./time-notches"),s=e("fs"),l=e("path"),d=e("jquery"),c=e("lodash"),u=e("jibo-keyframes"),h=e("jibo-keyframes").JiboKeyframeInfo,p=e("./playback-controls"),m=i.createClass({displayName:"layout-child",getInitialState:function(){var e=this;return this.props.animationModel.on("onpropertieschanged",function(){e.setLimits(),e.markReferences(),e.forceUpdate()}),{headerOffset:{x:0,y:0},labelsOffset:0}},componentDidMount:function(){this.getDOMNode().addEventListener("scroll",this.onScroll.bind(this)),this.onKeyframeUpsertCB=this.onKeyframeUpsert.bind(this),this.props.animationModel.on("onkeyframeupsert",this.onKeyframeUpsertCB),this.keyframesUpserted=void 0},componentWillUnmount:function(){this.props.animationModel.removeListener("onkeyframeupsert",this.onKeyframeUpsertCB)},componentWillReceiveProps:function(e){if(e.playbackTime!==this.props.playbackTime){var t=18*e.playbackTime+270;0===e.playbackTime&&this.props.playbackTime===this.props.animationModel.state.keyframes.duration-1?this.getDOMNode().scrollLeft=0:e.playbackTime>this.props.playbackTime?this.getDOMNode().scrollLeft+this.getDOMNode().offsetWidth<t&&(this.getDOMNode().scrollLeft=t-270):e.playbackTime<this.props.playbackTime&&this.getDOMNode().scrollLeft+270>t&&(this.getDOMNode().scrollLeft=t-this.getDOMNode().offsetWidth)}},onScroll:function(){this.setState({labelsOffset:this.getDOMNode().scrollLeft,headerOffset:{x:this.getDOMNode().scrollLeft,y:this.getDOMNode().scrollTop}})},onMouseMove:function(e){return 0===e.buttons?void this.onMouseUp():(this.setTimeFromMousePosition({nativeEvent:e}),void this.props.animationModel.emit("drag-keyframe"))},onMouseUp:function(){document.removeEventListener("mousemove",this.onMouseMoveBind),document.removeEventListener("mouseup",this.onMouseUpBind)},onMouseDown:function(e){1===e.nativeEvent.which&&(this.onMouseMoveBind=this.onMouseMove.bind(this),this.onMouseUpBind=this.onMouseUp.bind(this),document.addEventListener("mousemove",this.onMouseMoveBind),document.addEventListener("mouseup",this.onMouseUpBind),this.setTimeFromMousePosition(e))},setTimeFromMousePosition:function(e){var t=d(this.getDOMNode()).find(".animation-timeline-notch").offset(),o=Math.floor((e.nativeEvent.clientX-t.left)/18);o=Math.max(o,0),o=Math.min(o,this.props.animationModel.state.keyframes.duration-1),this.props.animationModel.setKeyframe(o)},onKeyframeUpsert:function(e){this.keyframesUpserted=e},evaluateFiltered:function(e,t){return u.runtime.evaluateAllLayersFiltered(e,h,t,function(e){return"Body"===e.type})},toRadians:function(e){return Math.PI*e/180},markReferences:function(){this.referenceMarks={};for(var e=0,t=this.props.animationModel.state.keyframes.layers;e<t.length;e++){var o=t[e];if("Reference"===o.type)for(var i=0;i<o.keyframes.length;i++){var n=o.keyframes[i],a=o.keyframes.length===i+1,r=a?this.props.animationModel.state.keyframes.duration:o.keyframes[i+1].time,s=o.keyframes[i].value.HoldFinalPose?r:0;this.addReferenceMarks(o.id,n.time,this.getDuration(n.value.KeysFileReference.file),s)}}},addReferenceMarks:function(e,t,o,i){e in this.referenceMarks||(this.referenceMarks[e]={});for(var n=t;n<t+o;n++)this.referenceMarks[e][n]="dark";for(var n=t+o;n<i;n++)this.referenceMarks[e][n]="light"},getDuration:function(e){var t=l.dirname(this.props.animationModel.editor.uri),o=l.join(t,e),i=s.readFileSync(o,"utf8"),n=JSON.parse(i);return n.duration},setLimits:function(){var e=this.props.animationModel.state.keyframes,t=1/e.framerate,o=0,i=this.props.animationModel.limits,n=this.props.animationModel.state.keyframes.duration,a=!1,r=!1;this.keyframesExceeded=[];for(var s=0;s<n;s++){var l=!1,d=this.evaluateFiltered(e,o),c=void 0,u=void 0;s>0&&s<n-1&&(c=this.evaluateFiltered(e,o+t),u=this.evaluateFiltered(e,o-t));for(var h in d.Body){var p=0,m=0;if(c){p=(this.toRadians(c.Body[h])-this.toRadians(d.Body[h]))/t;var f=(this.toRadians(d.Body[h])-this.toRadians(u.Body[h]))/t;m=(p-f)/t}i[h]&&Math.abs(p)>i[h].velocityLimit&&(a=!0,l=!0),i[h]&&Math.abs(m)>i[h].accelerationLimit&&(r=!0,l=!0)}this.keyframesExceeded.push(l),o+=t}this.props.animationModel.setLimit(a,r)},render:function(){var e=this,t=this.props.animationModel.state.keyframes.duration,o=18*(t+1),s=40*this.props.animationModel.state.keyframes.layers.length,l=Math.floor(t/5)+1,d=270,u={timeline:{width:this.props.width,height:this.props.height,background:"#404040"},container:{width:d+5*l*18+20,height:s+22},headerAnchor:{position:"relative",width:d+5*l*18+20,height:22},labelsAnchor:{position:"relative",width:d,height:s,float:"left",zIndex:2},labels:{position:"absolute",marginLeft:this.state.labelsOffset},channelsContainer:{width:o,height:s,float:"left",zIndex:1},channels:{width:o},indicator:{position:"absolute",marginLeft:18*this.props.animationModel.uiState.currentKeyframe+9-this.state.labelsOffset,height:this.props.height-22,zIndex:1,display:null===this.props.animationModel.getSelectedLayer()?"none":"inline-block"}},h=this.props.animationModel,m=this,f=[],v=[],y=0,g=this.props.animationModel.state.keyframes;return g.layers.forEach(function(r){var s;void 0!==m.keyframesUpserted&&c.indexOf(m.keyframesUpserted.layers,r)!==-1&&(s=m.keyframesUpserted.keyframeTime),f.push(i.createElement(n.default,{key:r.id,type:r.type,keyframesExceeded:e.keyframesExceeded,upserted:s,referenceMarks:e.referenceMarks,totalWidth:o,layerId:r.id,animationModel:h,totalFrames:t,keyframes:r.keyframes,latestHash:e.props.animationModel.undoRedo.latestHash})),v.push(i.createElement(a.default,{tabIndex:200+y,animationModel:h,odd:y++%2===0,key:r.id,layerId:r.id}))}),this.keyframesUpserted=void 0,i.createElement("div",{style:u.timeline,className:"animation-timeline"},i.createElement(p.default,{animationModel:this.props.animationModel,timelineWidth:this.props.width,timelineHeight:this.props.height}),i.createElement("div",{ref:"timeline",style:u.container,className:"animation-timeline-container"},i.createElement("div",{style:u.headerAnchor,onMouseDownCapture:this.onMouseDown},i.createElement(r.default,{offset:this.state.headerOffset,channelWidth:o,width:this.props.width,height:this.props.height+22,labelWidth:d,totalFrames:t,animationModel:this.props.animationModel})),i.createElement("div",{style:u.labelsAnchor},i.createElement("div",{ref:"layerContainer",style:u.labels,className:"animation-channel-labels-container"},v)),i.createElement("div",{style:u.channelsContainer},i.createElement("div",{style:u.channels,className:"animation-timeline-channels"},i.createElement("div",{style:u.indicator,className:"animation-timeline-indicator-line"}),f))))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=m},{"./layer":17,"./layer-label":16,"./playback-controls":26,"./time-notches":46,fs:void 0,"jibo-keyframes":void 0,jquery:void 0,lodash:void 0,path:void 0,react:void 0}],48:[function(e,t,o){"use strict";var i=e("react"),n=e("../controllers/animation-controller"),a=e("lodash"),r=e("path"),s=e("../../atom-react/components/jibo-combo-box"),l=e("atom"),d=e("../../atom-react/mixins/modal-mixin"),c=e("./face-on-body"),u=e("../../atom-react/components/float-input-view"),h=e("../../common/atom-editor"),p=i.createClass({getInitialState:function(){return this.props.model.state.keyframes.animdb||(this.props.model.state.keyframes.animdb={}),this.props.name=this.props.model.state.keyframes.animdb.name||"",this.props.scaleMin=this.props.model.state.keyframes.animdb.scaleMin||1,this.props.scaleMax=this.props.model.state.keyframes.animdb.scaleMax||1,this.props.speedMin=this.props.model.state.keyframes.animdb.speedMin||1,this.props.speedMax=this.props.model.state.keyframes.animdb.speedMax||1,this.props.categories=this.props.model.state.keyframes.animdb.categories||"",this.props.meta=this.props.model.state.keyframes.animdb.meta||"",{name:this.props.name,scaleMin:this.props.scaleMin,scaleMax:this.props.scaleMax,speedMin:this.props.speedMin,speedMax:this.props.speedMax,categories:this.props.categories,meta:this.props.meta}},onPropertyChange:function(e,t){this.props[e]=t,this.props.model.updateAnimationDBData(e,t)},render:function(){var e=this,t=i.createElement("div",{className:"block"},i.createElement("div",{className:"panel-heading"},i.createElement("h1",null,"Animation DB Settings")),i.createElement("div",{style:{align:"right"}},i.createElement("h2",null,"Name (default is key file name)"),i.createElement(h.default,{ref:"nameEditor",mini:!0,content:this.props.name,onDidChange:function(t){e.props.name=t,e.props.model.updateAnimationDBData("name",e.props.name)},onConfirm:function(){e.props.onChange(e.props.name),document.querySelector("atom-pane.pane.active .animation-editor").childNodes[0].focus()}}),i.createElement("h2",null,"Scale Bounds (max/min)"),i.createElement(u.default,{style:{clear:"both",maxWidth:150},onChange:function(t){e.onPropertyChange("scaleMax",t)},value:this.props.scaleMax,precision:4,tabIndex:1}),i.createElement(u.default,{style:{clear:"both",maxWidth:150},onChange:function(t){e.onPropertyChange("scaleMin",t)},value:this.props.scaleMin,precision:4,tabIndex:2}),i.createElement("h2",null,"Speed Bounds (max/min)"),i.createElement(u.default,{style:{clear:"both",maxWidth:150},onChange:function(t){e.onPropertyChange("speedMax",t)},value:this.props.speedMax,precision:4,tabIndex:1}),i.createElement(u.default,{style:{clear:"both",maxWidth:150},onChange:function(t){e.onPropertyChange("speedMin",t)},value:this.props.speedMin,precision:4,tabIndex:2}),i.createElement("h2",null,"Categories (comma separated list)"),i.createElement(h.default,{ref:"categoriesEditor",mini:!0,content:this.props.categories,onDidChange:function(t){e.props.categories=t,e.props.model.updateAnimationDBData("categories",e.props.categories)},onConfirm:function(){e.props.onChange(e.props.categories),document.querySelector("atom-pane.pane.active .animation-editor").childNodes[0].focus()}}),i.createElement("h2",null,"Meta tags (comma separated list)"),i.createElement(h.default,{ref:"metaEditor",mini:!0,content:this.props.meta,onDidChange:function(t){e.props.meta=t,e.props.model.updateAnimationDBData("meta",e.props.meta)}})),i.createElement("div",{style:{align:"center"}},i.createElement("button",{className:"btn",onClick:this.props.onClose},"Close")));return t}}),m=[{label:"Front",display:"front",value:"front"},{label:"Back",display:"back",value:"back"},{label:"Left",display:"left",value:"left"},{label:"Right",display:"right",value:"right"}],f=i.createClass({displayName:"layout-child",mixins:[d.default],componentWillMount:function(){var e=this;this.controller=new n.default(this.props.animationModel),this.lastWidth=this.props.width,this.lastHeight=this.props.height,this.requestAnimationID=window.requestAnimationFrame(function(){e.updateLoop()})},updateLoop:function(){var e=this;if(this.controller.renderer){var t=this.props.animationModel.evaluateAllDOFLayers();t=a.extend({},a.cloneDeep(this.controller.robotInfo.getDefaultDOFValues()),a.cloneDeep(t)),this.resolveTexture(t,"eyeTextureInfixBn_r"),this.resolveTexture(t,"overlayTextureInfixBn_r"),this.resolveTexture(t,"screenBGTextureInfixBn_r"),this.controller.updateDofValues(t),this.controller.update()}this.requestAnimationID=window.requestAnimationFrame(function(){e.updateLoop()})},resolveTexture:function(e,t){e[t]="file://"+r.resolve(this.props.animationModel.projectRoot,e[t])},componentDidMount:function(){var e=this,t=i.findDOMNode(this.refs.preview);this.controller.initialize(t,function(){e.faceOnBody=new c.default(e.refs.faceContainer.getDOMNode(),e.controller.renderer,e.face)}),t.addEventListener("contextmenu",function(e){return"CANVAS"!==e.target.tagName||(e.preventDefault(),e.stopPropagation(),!1)},!1),this.subs=new l.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.viewAngle),{title:"Body View Angle"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.reset),{title:"Reset Body View"})),this.face=document.createElement("canvas"),this.face.width=1280,this.face.height=720,this.refs.faceContainer.getDOMNode().appendChild(this.face),this.props.onCreated(this.face)},componentWillUnmount:function(){this.requestAnimationID&&window.cancelAnimationFrame(this.requestAnimationID),this.controller.dispose(),this.subs.dispose()},onMouseDown:function(){return!1},onMouseDownCapture:function(){return!1},onChangeCamera:function(e){this.controller.setCamera(e.value)},onBackgroundColor:function(){},onReset:function(){this.controller.setCamera(m[0].value)},onAnimDBProperties:function(){var e=this,t=this.props.animationModel.editor.animationModel;this.createModal(i.createElement(p,{model:t,onClose:function(){e.destroyModal()}}))},render:function(){this.controller&&this.controller.renderer&&(this.lastWidth!==this.props.width||this.lastHeight!==this.props.height)&&(this.controller.renderer.scene.handleResize(),this.lastWidth=this.props.width,this.lastHeight=this.props.height);var e={preview:{width:this.props.width,height:this.props.height},reset:{position:"absolute",marginLeft:90,marginTop:10},comboBox:{position:"absolute",margin:10},animdb:{position:"absolute",marginLeft:170,marginTop:10},face:{width:this.props.width,height:this.props.height,overflow:"hidden",position:"absolute",pointerEvents:"none"}},t=null;return i.createElement("div",{style:e.preview,tabIndex:1,ref:"preview",className:"animation-preview"},i.createElement("div",{style:e.face,ref:"faceContainer"}),i.createElement("div",{className:"block",style:e.reset},i.createElement("button",{ref:"reset",className:"btn icon icon-sync inline-block-tight",onClick:this.onReset},"Reset")),i.createElement("div",{style:e.comboBox},i.createElement(s.default,{ref:"viewAngle",data:m,init:m[0],onSelected:this.onChangeCamera})),t)}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=f},{"../../atom-react/components/float-input-view":50,"../../atom-react/components/jibo-combo-box":53,"../../atom-react/mixins/modal-mixin":57,"../../common/atom-editor":96,"../controllers/animation-controller":7,"./face-on-body":13,atom:void 0,lodash:void 0,path:void 0,react:void 0}],49:[function(e,t,o){"use strict";var i=e("react/lib/ReactInjection"),n={isCustomAttribute:function(e){return-1!==["mini","gutter-hidden","placeholder-text"].indexOf(e)},Properties:{mini:null,"gutter-hidden":null,"placeholder-text":null},DOMAttributeNames:{},DOMPropertyNames:{}};i.DOMProperty.injectDOMPropertyConfig(n),Object.defineProperty(o,"__esModule",{value:!0}),o.default={activate:function(){},deactivate:function(){}}},{"react/lib/ReactInjection":void 0}],50:[function(e,t,o){"use strict";var i=e("react"),n=i.createClass({displayName:"float-input-view",getDefaultProps:function(){return{style:{width:"100%"},tabIndex:-1,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,defaultValue:0,value:0,precision:20,onChange:function(){}}},getInitialState:function(){return{value:this.toPrecision(this.props.value)}},componentWillMount:function(){this.textValue=this.props.value},componentWillReceiveProps:function(e){var t=this.toPrecision(e.value),o=this.getDOMNode().childNodes[0];this.textValue!==t&&(this.textValue=t,o.value=t,this.setState({value:t}))},toPrecision:function(e){return"number"!=typeof e?0:parseFloat(e.toFixed(this.props.precision))},onFocus:function(){this.getDOMNode().childNodes[0].select(),this.becameSelected=!0},onMouseUp:function(e){this.becameSelected===!0&&(this.becameSelected=!1,e.preventDefault(),e.stopPropagation())},render:function(){var e={width:"100%"};return i.createElement("div",{className:"native-key-bindings",tabIndex:-1},i.createElement("input",{onFocus:this.onFocus,onKeyPress:this.onKeyPress,className:"native-key-bindings",style:Object.assign({},e,this.props.style),tabIndex:this.props.tabIndex,type:"number",onMouseUpCapture:this.onMouseUp,onChange:this.onChange,defaultValue:this.state.value,min:this.props.min,max:this.props.max,onKeyDown:this.onKeyDown,step:"any"}))},onKeyDown:function(){},onKeyPress:function(e){13===e.nativeEvent.keyCode&&(this.getDOMNode().childNodes[0].value=this.state.value)},onChange:function(e){var t=e.target.value;0!==t.length&&(t=parseFloat(t),t=Math.max(this.props.min,t),t=Math.min(this.props.max,t),t=this.toPrecision(t),t!==this.state.value&&(this.setState({value:t}),this.textValue=t,this.props.onChange(t)))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{react:void 0}],51:[function(e,t,o){"use strict";var i=e("react"),n=i.createClass({getDefaultProps:function(){return{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,tabIndex:-1,defaultValue:0,value:0,precision:0,onChange:function(){}}},getInitialState:function(){return{value:this.toPrecision(this.props.value)}},componentWillMount:function(){this.textValue=this.props.value},componentWillReceiveProps:function(e){var t=this.toPrecision(e.value),o=this.getDOMNode().childNodes[0];this.textValue!==t&&(this.textValue=t,o.value=t,this.setState({value:t}))},toPrecision:function(e){return"number"!=typeof e?0:parseFloat(e.toFixed(this.props.precision))},render:function(){var e={width:"100%"};return i.createElement("div",{className:"native-key-bindings",tabIndex:-1},i.createElement("input",{onKeyPress:this.onKeyPress,className:"native-key-bindings",style:Object.assign({},e,this.props.style),tabIndex:this.props.tabIndex,type:"number",onChange:this.onChange,defaultValue:this.state.value,min:this.props.min,max:this.props.max,step:"any"}))},onKeyPress:function(e){13===e.nativeEvent.keyCode&&(this.getDOMNode().childNodes[0].value=this.state.value)},onChange:function(e){var t=e.target.value;0!==t.length&&(t=parseFloat(t),t=Math.max(this.props.min,t),t=Math.min(this.props.max,t),t=this.toPrecision(t),t!==this.state.value&&(this.setState({value:t}),this.textValue=t,this.props.onChange(t)))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{react:void 0}],52:[function(e,t,o){"use strict";var i=e("react"),n=e("jquery"),a=i.createClass({getInitialState:function(){return{hoveredElement:void 0}},onMouseOver:function(e){this.state.hoveredElement=e,this.setState(this.state)},onMouseOut:function(){this.state.hoveredElement=void 0,this.setState(this.state)},onClick:function(e){this.props.onSelect(e)},render:function(){var e=this,t=[];return this.props.data.forEach(function(o,n){var a="list-item";o===e.state.hoveredElement&&(a+=" selected");var r={},s=null;"string"==typeof o.label?(r={marginLeft:0},s=o.label):s=o.label(),t.push(i.createElement("li",{key:n,className:a,onMouseOver:e.onMouseOver.bind(e,o),onMouseOut:e.onMouseOut.bind(e,o),onClick:e.onClick.bind(e,o)},i.createElement("span",{style:r},s)))}),i.createElement("ul",{className:"list-group"},t)}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({getInitialState:function(){return{clickHandler:this.clickHandler.bind(this)}},render:function(){var e=null;if(this.props.current.display)if("function"==typeof this.props.current.display)e=this.props.current.display();else{var t=null;t=this.props.titleDisplay?this.props.titleDisplay:this.props.current.display,e="  "+t,e=[i.createElement("i",{className:"fa fa-caret-down",style:{fontSize:20}}),e]}var o="combo-box btn";return this.props.hideButton&&(o="combo-box"),i.createElement("div",null,i.createElement("div",{ref:"button",className:o,onClick:this.onClick},e))},removeList:function(){n(document).off("click",this.state.clickHandler),this.node.remove(),this.node=null},onSelect:function(e){this.props.keepFocusAfterClick||this.removeList(),this.props.onSelected(e)},clickHandler:function(e){0===n(e.target).closest(this.node).length&&this.removeList()},onClick:function(e){if(e.preventDefault(),e.stopPropagation(),this.node)this.removeList();else{var t=i.findDOMNode(this.refs.button),o=t.getBoundingClientRect();this.node=n("<div />").addClass("combo-box-list").css({left:o.left+"px",top:o.bottom+"px"}).appendTo(document.body),n(document).on("click",this.state.clickHandler),i.render(i.createElement(a,{data:this.props.data,onSelect:this.onSelect}),this.node[0])}}})},{jquery:void 0,react:void 0}],53:[function(e,t,o){"use strict";var i=e("react"),n=e("jquery"),a=i.createClass({getInitialState:function(){return{hoveredElement:void 0}},onMouseOver:function(e){this.state.hoveredElement=e,this.setState(this.state)},onMouseOut:function(){this.state.hoveredElement=void 0,this.setState(this.state)},onClick:function(e){this.props.onSelect(e)},render:function(){var e=this,t=[];return this.props.data.forEach(function(o,n){var a="list-item";o===e.state.hoveredElement&&(a+=" selected");var r={},s=null;"string"==typeof o.label?(r={marginLeft:5},s=o.label):s=o.label(),t.push(i.createElement("li",{key:n,className:a,onMouseOver:e.onMouseOver.bind(e,o),onMouseOut:e.onMouseOut.bind(e,o),onClick:e.onClick.bind(e,o)},i.createElement("span",{style:r},s)))}),i.createElement("ul",{className:"list-group"},t)}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({getInitialState:function(){return{clickHandler:this.clickHandler.bind(this),current:this.props.init}},render:function(){var e=null;if(this.state.current.display)if("function"==typeof this.state.current.display)e=this.state.current.display();else{var t=null;t=this.props.titleDisplay?this.props.titleDisplay:this.state.current.display,e="  "+t,e=[i.createElement("i",{className:"fa fa-caret-down",style:{fontSize:20}}),e]}var o="combo-box btn";return this.props.hideButton&&(o="combo-box"),i.createElement("div",null,i.createElement("div",{ref:"button",className:o,onClick:this.onClick},e))},removeList:function(){n(document).off("click",this.state.clickHandler),this.node.remove(),this.node=null},onSelect:function(e){this.state.current=e,this.setState(this.state),this.props.keepFocusAfterClick||this.removeList(),this.props.onSelected(e)},clickHandler:function(e){0===n(e.target).closest(this.node).length&&this.removeList()},onClick:function(e){if(e.preventDefault(),e.stopPropagation(),this.node)this.removeList();else{var t=i.findDOMNode(this.refs.button),o=t.getBoundingClientRect();this.node=n("<div />").addClass("combo-box-list").css({left:o.left+"px",top:o.bottom+"px"}).appendTo(document.body),n(document).on("click",this.state.clickHandler),i.render(i.createElement(a,{data:this.props.data,onSelect:this.onSelect}),this.node[0])}}})},{jquery:void 0,react:void 0}],54:[function(e,t,o){"use strict";function i(e,t){var o={};if(o[t])return o[t];var i=function(o){function i(){return null!==o&&o.apply(this,arguments)||this}return n(i,o),i.content=function(){return this.div({class:t.match(/[A-Z][a-z]+/g).map(function(e){return e.toLowerCase()}).join("-")})},i.prototype.detached=function(){return s.unmountComponentAtNode(this[0]),this.editor.dispose(),this.disposables.dispose()},i.prototype.initialize=function(t){this.disposables=new r.CompositeDisposable,this.editor=t,t.shouldScroll&&(this[0].style.overflow="auto");var o=s.createElement(e,{parent:this[0],editor:t,paneWidth:this[0].offsetWidth,paneHeight:this[0].offsetHeight});if(this.editor.container=this[0],s.render(o,this[0]),this.disposables.add(atom.workspace.onDidChangeActivePaneItem(this.onActivePaneChange.bind(this))),atom.workspace.getActivePaneItem()===this.editor)return this.onActivePaneChange(null)},i.prototype.onActivePaneChange=function(e){var o=null;return e&&(o=e.__displayName||e.constructor.name),e&&o!==t?this.editor.active===!0?(this.editor.active=!1,this.editor.onPaneDeactivated()):void 0:(this.editor.active=!0,this.editor.onPaneActivated())},i}(a.View);return o[t]=i,i}var n=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},a=e("atom-space-pen-views"),r=e("atom"),s=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{atom:void 0,"atom-space-pen-views":void 0,react:void 0}],55:[function(e,t,o){"use strict";var i=e("path"),n=e("fs"),a=e("./atom-view-react-bridge"),r=e("atom"),s=e("atom"),l=function(){function e(e,t,o){var n=this;this.__displayName=e,this.emitter=new s.Emitter,this.modifiedStatus=!1,this.shouldScroll=o,this.uri=i.normalize(t),this.tabTitle=i.parse(t).base,this.file=new r.File(this.uri),this.ignoreFirstReload=!0,this.onDidChangeDisposable=this.file.onDidChange(function(){return n.ignoreFirstReload?void(n.ignoreFirstReload=!1):n.shouldPromptToSave()?void(n.ignoreFirstReload=!0):(n.reload(),void(n.ignoreFirstReload=!0))}),this.onDidRenameDisposable=this.file.onDidRename(function(){n.uri=n.file.getPath(),n.tabTitle=i.parse(n.uri).base,n.emitter.emit("did-change-title",{})}),this.active=!1,this.container=null}return e.prototype.dispose=function(){this.onDidChangeDisposable.dispose(),this.onDidRenameDisposable.dispose()},e.prototype.isPaneActive=function(){return this.active},e.prototype.onPaneActivated=function(){},e.prototype.onPaneDeactivated=function(){},e.prototype.getTitle=function(){return this.tabTitle},e.prototype.isModified=function(){return this.modifiedStatus},e.prototype.shouldPromptToSave=function(){return this.modifiedStatus},e.prototype.onDidChangeModified=function(e){return this.emitter.on("did-change-modified",e)},e.prototype.getReactClass=function(){throw new Error("Override "+this.__displayName+".getReactClass()")},e.prototype.getViewClass=function(){return a.default(this.getReactClass(),this.__displayName)},e.prototype.getURI=function(){return this.uri},e.prototype.getPath=function(){return this.uri},e.getProjectRoot=function(e){e=i.normalize(e).toLowerCase();for(var t=atom.project.getPaths(),o=0;o<t.length;o++){var n=i.normalize(t[o]);if("."===e||e.includes(n.toLowerCase()))return n}return null},e.prototype.onDidChangeTitle=function(e){return this.emitter.on("did-change-title",e)},e.prototype.setModifiedStatus=function(e){if(this.modifiedStatus=e,this.emitter.emit("did-change-modified",e),e){var t=atom.workspace.getActivePane();t.getPendingItem()===this&&t.clearPendingItem()}},e.prototype.terminatePendingState=function(){var e=atom.workspace.getActivePane();e.getPendingItem()===this&&e.clearPendingItem()},e.prototype.serialize=function(){return{filePath:this.uri,shouldScroll:this.shouldScroll,tabTitle:this.tabTitle,deserializer:this.__displayName}},e.deserialize=function(e){var t=this;return 0===e.filePath.search("atom:/")||n.existsSync(e.filePath)?new t(e.filePath):void console.warn("Could not deserialize ReactEditor for path '"+e.filePath+"' because that file no longer exists")},e.prototype.save=function(){this.saveFile(this.uri)&&(this.ignoreFirstReload=!0,this.setModifiedStatus(!1))},e.prototype.saveAs=function(e){this.saveFile(e)&&(this.ignoreFirstReload=!0,this.uri=i.normalize(e),this.tabTitle=i.parse(e).base,this.emitter.emit("did-change-title",this.getTitle()))},e.prototype.saveFile=function(e){throw new Error("Override JiboEditor.saveFile()")},e.prototype.undo=function(){console.log("undo")},e.prototype.redo=function(){console.log("redo")},e.prototype.saveUiState=function(e){atom.config.set("jibo-sdk."+this.__displayName,JSON.stringify(e))},e.prototype.getUiState=function(){var e=atom.config.get("jibo-sdk."+this.__displayName);if(e)return JSON.parse(e)},e.prototype.reload=function(){},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=l},{"./atom-view-react-bridge":54,atom:void 0,fs:void 0,path:void 0}],56:[function(e,t,o){"use strict";var i=e("fs"),n=e("./atom-view-react-bridge"),a=function(){function e(e,t,o,i){this.__displayName=e,this.uri=t,this.shouldScroll=o,this.tabTitle=i}return e.deserialize=function(t){return 0===t.filePath.search("atom:/")||i.existsSync(t.filePath)?new e(t.deserializer,t.uri,t.shouldScroll,t.tabTitle):void console.warn("Could not deserialize pane for for path '"+t.filePath+"' because that file no longer exists")},e.prototype.dispose=function(){},e.prototype.getTitle=function(){return this.tabTitle},e.prototype.getReactClass=function(){throw new Error("Override ReactEditor.getReactClass()")},e.prototype.getURI=function(){return this.uri},e.prototype.getPath=function(){return this.uri},e.prototype.serialize=function(){return{uri:this.uri,tabTitle:this.tabTitle,shouldScroll:this.shouldScroll,deserializer:this.__displayName}},e.prototype.saveUiState=function(e){atom.config.set("jibo-sdk."+this.__displayName,JSON.stringify(e))},e.prototype.getUiState=function(){var e=atom.config.get("jibo-sdk."+this.__displayName);if(e)return JSON.parse(e)},e.prototype.onPaneActivated=function(){},e.prototype.onPaneDeactivated=function(){},
e.prototype.getViewClass=function(){return n.default(this.getReactClass(),this.__displayName)},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{"./atom-view-react-bridge":54,fs:void 0}],57:[function(e,t,o){"use strict";var i=e("jquery"),n=e("react"),a=[],r={createModal:function(e,t){this._modalContainer=i("<div/>"),t&&(this._modalContainer.width(t),this._modalContainer.addClass("modal-background")),n.render(e,this._modalContainer[0]),this.state=this.state?this.state:{},this.state.modalPanel=atom.workspace.addModalPanel({item:this._modalContainer}),a.push(this.state.modalPanel)},destroyModal:function(){if(n.unmountComponentAtNode(this._modalContainer[0]),this.state.modalPanel){for(var e=a.length-1;e>=0;--e)if(a[e]===this.state.modalPanel){a.splice(e,1);break}this.state.modalPanel.destroy(),this.state.modalPanel=void 0,a.length&&a[a.length-1].show()}}};Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{jquery:void 0,react:void 0}],58:[function(e,t,o){"use strict";function i(e){var t=a(e).parents(".pane");return 0===t.size()&&(t=a(".item-views")),{width:t.width(),height:t.height()}}function n(e){var t=i(e.getDOMNode());e.setProps({paneWidth:t.width,paneHeight:t.height})}var a=e("jquery"),r={setupPaneResizeEventMixin:function(){function e(t){try{var o=i(t.getDOMNode());o.width===t.props.paneWidth&&o.height===t.props.paneHeight||n(t),t.requestID=window.requestAnimationFrame(function(){e(t)})}catch(e){console.log(e)}}e(this)},cleanupPaneResizeEventMixin:function(){window.cancelAnimationFrame(this.requestID)}};Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{jquery:void 0}],59:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("../../atom-react/mixins/modal-mixin"),r=e("path"),s=e("fs"),l=e("../../common/animation/animation-visualizer"),d=e("../modals/choose-animation-name-modal"),c=e("../../common/atom-editor"),u=e("jibo"),h=n.createClass({getInitialState:function(){return{uri:this.props.uri}},render:function(){return n.createElement("div",{className:"block"},n.createElement("div",{className:"panel-heading"},n.createElement("h1",{style:{textAlign:"center"}},r.parse(this.props.uri).base)),n.createElement(l.default,{style:{width:"100%",height:300},uri:this.state.uri}),n.createElement("button",{className:"btn",onClick:this.props.onClose},"Close"))}}),p=n.createClass({displayName:"animation-view",mixins:[a.default],getInitialState:function(){return{content:this.props.content}},render:function(){var e=this,t=this.getUri(),o=t&&s.existsSync(t)?{}:{disabled:!0},a=o.disabled?n.createElement("div",{className:"error-messages"},"No animation by that name"):null;return n.createElement("div",{style:{width:"100%"}},n.createElement("div",{className:"block"},n.createElement("div",{className:"fileBlock"},n.createElement("button",{style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),n.createElement(c.default,{ref:"editor",mini:!0,content:this.state.content,onDidChange:function(t){e.state.content=t,e.props.onChange(t),e.setState(e.state)}})),a,n.createElement("div",{className:"btn-group",style:{marginTop:5}},n.createElement("button",i({},o,{className:"btn",onClick:this.onPreview}),"Preview"))))},getRoot:function(){var e=r.resolve(this.props.projectRoot,"animations");return e},getAnimPath:function(e){var t=u.animDB.getAnimByName(e);return t?r.join(t.resourceRoot,t.meta.path):void 0},getUri:function(){return this.getAnimPath(this.state.content)},onPreview:function(){var e=this;this.createModal(n.createElement(h,{uri:this.getUri(),onClose:function(){e.destroyModal()}}))},onChoose:function(){var e=this;this.createModal(n.createElement(d.default,{onChoose:function(t){e.props.onChange(t),e.setState({content:t})},onClose:function(){e.destroyModal()}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,i){return n.createElement(p,{key:t,content:e,onChange:o,projectRoot:i})}},{"../../atom-react/mixins/modal-mixin":57,"../../common/animation/animation-visualizer":94,"../../common/atom-editor":96,"../modals/choose-animation-name-modal":83,fs:void 0,jibo:void 0,path:void 0,react:void 0}],60:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("../../atom-react/mixins/modal-mixin"),r=e("path"),s=e("fs"),l=e("../../common/animation/animation-visualizer"),d=e("../../common/modals/choose-file-modal"),c=e("../../common/atom-editor"),u=n.createClass({getInitialState:function(){return{uri:this.props.uri}},render:function(){return n.createElement("div",{className:"block"},n.createElement("div",{className:"panel-heading"},n.createElement("h1",{style:{textAlign:"center"}},r.parse(this.props.uri).base)),n.createElement(l.default,{style:{width:"100%",height:300},uri:this.state.uri}),n.createElement("button",{className:"btn",onClick:this.props.onClose},"Close"))}}),h=n.createClass({displayName:"animation-view",mixins:[a.default],getInitialState:function(){return{content:this.props.content}},render:function(){var e=this,t=s.existsSync(this.getUri())?{}:{disabled:!0},o=s.existsSync(this.getUri().replace(".anim",".keys"))?{}:{disabled:!0};o.disabled||(o=this.state.content.split("://").length>1?{disabled:!0}:{});var a=t.disabled?n.createElement("div",{className:"error-messages"},"No animation by that name"):null;return n.createElement("div",{style:{width:"100%"}},n.createElement("div",{className:"block"},n.createElement("div",{className:"fileBlock"},n.createElement("button",{style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),n.createElement(c.default,{ref:"editor",mini:!0,content:this.state.content,onDidChange:function(t){e.state.content=t,e.props.onChange(t),e.setState(e.state)}})),a,n.createElement("div",{className:"btn-group",style:{marginTop:5}},n.createElement("button",i({},o,{className:"btn",onClick:this.onEdit}),"Edit"),n.createElement("button",i({},t,{className:"btn",onClick:this.onPreview}),"Preview"))))},onEdit:function(){atom.workspace.open(this.getUri().replace(".anim",".keys"))},getUri:function(){var e=this.state.content.split("://");if(1===e.length){var t=r.resolve(this.props.projectRoot,"animations",this.state.content);return t}if(2===e.length){var t=r.resolve(this.props.projectRoot,"node_modules",e[0],"animations",e[1]);return t}},onPreview:function(){var e=this;this.createModal(n.createElement(u,{uri:this.getUri(),onClose:function(){e.destroyModal()}}))},onChoose:function(){var e=this;this.createModal(n.createElement(d.default,{root:this.props.projectRoot,uri:this.getUri(),settings:Object.assign({},d.AnimationSettings,{restrictPath:"animations"}),onChoose:function(t,o){e.props.onChange(o),e.setState({content:o})},onClose:function(){e.destroyModal()}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,i){return n.createElement(h,{key:t,content:e,onChange:o,projectRoot:i})}},{"../../atom-react/mixins/modal-mixin":57,"../../common/animation/animation-visualizer":94,"../../common/atom-editor":96,"../../common/modals/choose-file-modal":107,fs:void 0,path:void 0,react:void 0}],61:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/mixins/modal-mixin"),a=e("path"),r=e("fs"),s=e("../../common/modals/choose-file-modal"),l=e("../../common/atom-editor"),d=i.createClass({mixins:[n.default],getInitialState:function(){return{key:0,content:this.props.content}},render:function(){var e=this,t={};try{var o=r.statSync(this.getUri()).isFile();o||(t.disabled=!0)}catch(e){t={disabled:!0}}var n=t.disabled?i.createElement("div",{className:"error-messages"},"No audio file by that name"):null;return i.createElement("div",{style:{width:"100%"}},i.createElement("div",{className:"block"},i.createElement("div",{className:"fileBlock"},i.createElement("button",{style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),i.createElement(l.default,{ref:"editor",mini:!0,content:this.state.content,onDidChange:function(t){e.state.content=t,e.props.onChange(t),e.setState(e.state)}})),n,i.createElement("audio",{key:this.state.key++,controls:!0,style:{width:"100%",marginTop:5,marginBottom:5}},i.createElement("source",{src:this.getUri(),type:"audio/mpeg"})),i.createElement("br",null)))},getRoot:function(){return a.resolve(this.props.projectRoot)},getUri:function(){var e=this.state.content.split("://");if(1===e.length){var t=a.resolve(this.props.projectRoot,"audio",this.state.content);return t}if(2===e.length){var t=a.resolve(this.props.projectRoot,"node_modules",e[0],"audio",e[1]);return t}},onChoose:function(){var e=this;this.createModal(i.createElement(s.default,{root:this.getRoot(),uri:this.getUri(),settings:Object.assign({},s.AudioSettings,{restrictPath:"audio"}),onChoose:function(t,o){e.props.onChange(o),e.state.content=o,e.setState(e.state)},onClose:function(){e.destroyModal()}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,n){return i.createElement(d,{key:t,content:e,onChange:o,projectRoot:n})}},{"../../atom-react/mixins/modal-mixin":57,"../../common/atom-editor":96,"../../common/modals/choose-file-modal":107,fs:void 0,path:void 0,react:void 0}],62:[function(e,t,o){"use strict";var i=e("react"),n=i.createClass({displayName:"boolean-view",getInitialState:function(){return{content:this.props.content}},render:function(){var e="btn selected",t="btn";return i.createElement("div",{className:"block"},i.createElement("div",{className:"btn-group"},i.createElement("button",{className:this.state.content?e:t,onClick:this.toggle},"True"),i.createElement("button",{className:this.state.content?t:e,onClick:this.toggle},"False")))},toggle:function(){this.state.content=!this.state.content,this.setState(this.state),this.props.onChange(this.state.content)}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(n,{key:t,content:e,onChange:o})}},{react:void 0}],63:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/components/jibo-combo-box");Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){for(var a=[],r={label:"None",display:"None",value:""},s=0;s<t.length;s++)if(t[s].value===e){r=t[s];break}for(var l=t.length,s=0;s<l;s++){var d=t[s];d.value===e.value&&(r.label=d.label,r.display=d.display,r.value=d.value),a.push({label:d.label,display:d.display,value:d.value})}return i.createElement(n.default,{data:a,init:r,onSelected:function(e){o(e.value)}})}},{"../../atom-react/components/jibo-combo-box":53,react:void 0}],64:[function(e,t,o){"use strict";var i=e("react"),n=e("../../common/atom-editor"),a=i.createClass({getInitialState:function(){var e={isExpanded:!0};return e},render:function(){var e=this;return i.createElement(n.default,{ref:"editor",style:{width:"100%"},grammar:"source.js",content:this.props.content,onDidChange:function(t){e.props.onChange(t)}})}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(a,{key:t,content:e,onChange:o})}},{"../../common/atom-editor":96,react:void 0}],65:[function(e,t,o){"use strict";var i=e("./animation-view"),n=e("./animation-name-view"),a=e("./audio-view"),r=e("./boolean-view"),s=e("./enum-view"),l=e("./function-view"),d=e("./int-view"),c=e("./number-view"),u=e("./rule-view"),h=e("./mim-view"),p=e("./ssml-view"),m=e("./string-view"),f=e("./subtree-view"),v=e("./label-view");Object.defineProperty(o,"__esModule",{value:!0}),o.default={animation:i.default,animationname:n.default,audio:a.default,boolean:r.default,enum:s.default,function:l.default,int:d.default,number:c.default,rule:u.default,mim:h.default,ssml:p.default,string:m.default,subtree:f.default,label:v.default}},{"./animation-name-view":59,"./animation-view":60,"./audio-view":61,"./boolean-view":62,"./enum-view":63,"./function-view":64,"./int-view":66,"./label-view":67,"./mim-view":68,"./number-view":69,"./rule-view":70,"./ssml-view":71,"./string-view":72,"./subtree-view":73}],66:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/components/integer-input-view");Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(n.default,{style:{maxWidth:100},key:t,value:e,min:0,onChange:o})}},{"../../atom-react/components/integer-input-view":51,react:void 0}],67:[function(e,t,o){"use strict";var i=e("react"),n=i.createClass({render:function(){return i.createElement("div",{style:{width:"100%"}},i.createElement("p",null,this.props.content))},onChange:function(e){console.log(e.nativeEvent)},componentWillUnmount:function(){this.disposable&&this.disposable.dispose()}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(n,{key:t,content:e,onChange:o})}},{react:void 0}],68:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("../../atom-react/mixins/modal-mixin"),r=e("path"),s=e("fs"),l=e("../../common/modals/choose-file-modal"),d=e("../../mim-editor/mim-editor"),c=e("../../common/atom-editor"),u=n.createClass({mixins:[a.default],getInitialState:function(){return{key:0,content:this.props.content}},render:function(){var e=this,t={};try{var o=s.statSync(this.getUri()).isFile();o||(t.disabled=!0)}catch(e){t={disabled:!0}}var a=t.disabled?n.createElement("div",{className:"error-messages"},"No mim file by that name"):null;return n.createElement("div",{style:{width:"100%"}},n.createElement("div",{className:"block"},n.createElement("div",{className:"fileBlock"},n.createElement("button",{style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),n.createElement(c.default,{ref:"editor",mini:!0,content:this.state.content,onDidChange:function(t){e.state.content=t,e.props.onChange(t),e.setState(e.state)}})),a,n.createElement("div",{className:"btn-group",style:{marginTop:5}},n.createElement("button",i({},t,{className:"btn",onClick:this.onOpen}),"Edit"),n.createElement("button",{className:"btn",onClick:this.onNew},"New"))))},getRoot:function(){return this.props.projectRoot},getUri:function(){var e=this.state.content||"",t=e.split("://");if(1===t.length){var o=r.resolve(this.props.projectRoot,e);return o}if(2===t.length){var o=r.resolve(this.props.projectRoot,"node_modules",t[0],t[1]);return o}},onOpen:function(){atom.workspace.open(this.getUri())},onNew:function(){var e=this;d.default.createNewFile(function(t){e.setState({content:t})})},onChoose:function(){var e=this;this.createModal(n.createElement(l.default,{root:this.getRoot(),uri:this.getUri(),settings:l.MimSettings,onChoose:function(t,o){e.props.onChange(o),e.state.content=o,e.setState(e.state)},onClose:function(){e.destroyModal()}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,i){return n.createElement(u,{key:t,content:e,onChange:o,projectRoot:i})}},{"../../atom-react/mixins/modal-mixin":57,"../../common/atom-editor":96,"../../common/modals/choose-file-modal":107,"../../mim-editor/mim-editor":137,fs:void 0,path:void 0,react:void 0}],69:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/components/float-input-view");Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(n.default,{key:t,value:e,onChange:o})}},{"../../atom-react/components/float-input-view":50,react:void 0}],70:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/mixins/modal-mixin"),a=e("path"),r=e("fs"),s=e("../../common/modals/choose-file-modal"),l=e("../../common/atom-editor"),d=i.createClass({mixins:[n.default],getDefaultProps:function(){return{key:0,onChange:null,content:"",projectRoot:"",allowedNonFiles:[]}},getInitialState:function(){return{key:0,content:this.props.content}},componentWillReceiveProps:function(e){this.setState({content:e.content})},render:function(){var e=this,t=!1;try{this.props.allowedNonFiles.indexOf(this.state.content)===-1&&(t=!r.statSync(this.getUri()).isFile())}catch(e){t=!0}var o=t?i.createElement("div",{className:"error-messages"},"No rule file by that name"):null;return i.createElement("div",{style:{width:"100%"}},i.createElement("div",{className:"block"},i.createElement("div",{className:"fileBlock"},i.createElement("button",{style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),i.createElement(l.default,{ref:"editor",mini:!0,content:this.state.content,onDidStopChanging:function(t){e.state.content=t,e.props.onChange(t),e.setState(e.state)}})),o,i.createElement("br",null)))},getUri:function(){var e=this.state.content.split("://");if(1===e.length){var t=a.resolve(this.props.projectRoot,this.state.content);return r.existsSync(t)||(t=a.resolve(this.props.projectRoot,this.state.content),a.extname(t)||(t+=".rule")),t}if(2===e.length){var t=a.resolve(this.props.projectRoot,"node_modules",e[0],e[1]);return t}},onChoose:function(){var e=this;this.createModal(i.createElement(s.default,{root:this.props.projectRoot,uri:this.getUri(),settings:s.RuleSettings,onChoose:function(t,o){e.props.onChange(o),e.state.content=o,e.setState(e.state)},onClose:function(){e.destroyModal()}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,n,a){return i.createElement(d,{key:t,content:e,onChange:o,projectRoot:n,allowedNonFiles:a})}},{"../../atom-react/mixins/modal-mixin":57,"../../common/atom-editor":96,"../../common/modals/choose-file-modal":107,fs:void 0,path:void 0,react:void 0}],71:[function(e,t,o){"use strict";var i=e("react"),n=e("../../toolbar/run-configuration"),a=e("../../common/atom-editor"),r=i.createClass({onMouseDown:function(){var e=this;if(!this.speaking){var t={duration_stretch:1,locale:"en-us",mode:"text",outputMode:"stream",pitch:.42,pitchBandwidth:.25,prompt:this.refs.editor.getText(),voice:"griffin"},o="http://"+n.default.host+":8089/";this.speaking=!0,this._send(o+"tts_stop","GET",{},function(){e._send(o+"tts_speak","POST",t,function(){e.speaking=!1})})}},_send:function(e,t,o,i){var n=new XMLHttpRequest;n.open(t,e,!0),n.onreadystatechange=function(){4!==n.readyState||204!==n.status&&200!==n.status?4===n.readyState&&0===n.status&&i():i()},n.send(JSON.stringify(o))},render:function(){var e=this;return i.createElement("div",null,i.createElement(a.default,{ref:"editor",style:{height:200,width:"100%"},content:this.props.content,grammar:"source.xml",onDidChange:function(t){e.props.onChange(t)}}),i.createElement("div",{className:"block"},i.createElement("button",{onMouseDown:this.onMouseDown,className:"btn inline-block-tight"},i.createElement("i",{className:"fa fa-volume-up"}),"Test Speech")))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(r,{key:t,content:e,onChange:o})}},{"../../common/atom-editor":96,"../../toolbar/run-configuration":167,react:void 0}],72:[function(e,t,o){"use strict";var i=e("react"),n=e("../../common/atom-editor"),a=i.createClass({displayName:"string-view",render:function(){var e=this;return i.createElement("div",{style:{width:"100%"}},i.createElement(n.default,{ref:"editor",mini:!0,content:this.props.content,onDidChange:function(t){e.props.onChange(t)}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o){return i.createElement(a,{key:t,content:e,onChange:o})}},{"../../common/atom-editor":96,react:void 0}],73:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("../../atom-react/mixins/modal-mixin"),r=e("path"),s=e("fs"),l=e("mkdirp"),d=e("../../common/modals/choose-file-modal"),c=e("../behavior-editor"),u=e("../../common/atom-editor"),h=n.createClass({displayName:"subtree-view",mixins:[a.default],getInitialState:function(){return{key:0,content:this.props.content}},render:function(){var e=this,t={};try{s.statSync(this.getUri())}catch(e){try{s.statSync(this.getUri()+".bt")}catch(e){t={disabled:!0}}}var o=t.disabled?n.createElement("div",{className:"error-messages"},"No tree by that name"):null;return t.disabled||(t=this.state.content.split("://").length>1?{disabled:!0}:{}),n.createElement("div",{style:{width:"100%"}},n.createElement("div",{className:"block"},n.createElement("div",{className:"fileBlock"},n.createElement("button",{style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),n.createElement(u.default,{ref:"editor",mini:!0,content:this.state.content,onDidChange:function(t){e.state.content=t,e.props.onChange(t),e.setState(e.state)}})),o,n.createElement("div",{className:"btn-group",style:{marginTop:5}},n.createElement("button",i({},t,{className:"btn",onClick:this.onOpen}),"Edit"),n.createElement("button",{className:"btn",onClick:this.onNew},"New"))))},createNewTree:function(e,t){var o=this.props.model.createNewElement(this.props.model.schema[t]),i=r.resolve(this.props.projectRoot,"behaviors",e),n={};n[o.id]=o,l.sync(r.dirname(i)),s.writeFileSync(i,JSON.stringify(n,null," "),"utf8"),atom.workspace.open(i)},onNew:function(){var e=this;c.default.createNewFile(function(t){t=e.props.model.findRelativePathToUri(t,{dropExtension:!0}),e.refs.editor.setText(t)})},getUri:function(){var e,t=this.state.content.split("://");return 1===t.length?e=r.resolve(r.dirname(this.props.model.uri),this.state.content):2===t.length&&(e=r.resolve(this.props.projectRoot,"node_modules",t[0],"behaviors",t[1])),r.extname(e)||(e+=".bt"),s.existsSync(e)||(e=r.resolve(this.props.projectRoot,"src/behaviors",this.state.content),r.extname(e)||(e+=".bt")),e},onOpen:function(){atom.workspace.open(this.getUri())},onChoose:function(){var e=this;this.createModal(n.createElement(d.default,{root:this.props.root,uri:this.getUri(),settings:d.BTSettings,onChoose:function(t,o){var i=e.props.model.findRelativePathToUri(t,{dropExtension:!0});e.props.onChange(i),e.state.content=i,e.setState(e.state)},onCancel:function(){},onClose:function(){e.destroyModal()}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,i,a){return n.createElement(h,{key:t,content:e,onChange:o,projectRoot:i,model:a})}},{"../../atom-react/mixins/modal-mixin":57,"../../common/atom-editor":96,"../../common/modals/choose-file-modal":107,"../behavior-editor":76,fs:void 0,mkdirp:void 0,path:void 0,react:void 0}],74:[function(e,t,o){"use strict";var i=e("react"),n=e("./arguments");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({propTypes:{behavior:i.PropTypes.object.isRequired,schema:i.PropTypes.object.isRequired},getDefaultProps:function(){return{}},getInitialState:function(){return{key:0}},onChange:function(e,t,o){e[t]=o},onChangeState:function(e,t,o){this.onChange(e,t,o),this.state.key++,this.setState(this.state)},render:function(){var e=[];if(this.props.behavior&&this.props.behavior.options){var t=this.props.model.getSchemaByElement(this.props.behavior);t&&this.render_options(e,t.options)}var o=this.props.isBehaviorArgs?"Behavior Arguments":"Decorator Arguments";return i.createElement("div",{className:"right-pane",ref:"rightPane"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},o)),i.createElement("div",{className:"arguments-scroll-container"},e))},render_options:function(e,t){if(void 0!==t)for(var o=0,i=t;o<i.length;o++){var n=i[o];this.render_option(e,n)}},render_option:function(e,t){var o=this.props.behavior.options,a=t.field;void 0===o[a]&&(o[a]=t.defaultValue);var r,s=o[a],l=t.type,d=[];if(Array.isArray(l)){if("enum"===l[0]){for(var c=l.slice(1),u=0,h=c;u<h.length;u++){var p=h[u];if(p.value===s){d=p.options||[];break}}r=n.default.enum(s,c,this.onChangeState.bind(this,o,a)),r.key=this.state.key++}}else r=n.default[l.toLowerCase()](s,this.state.key++,this.onChange.bind(this,o,a),this.props.projectRoot,this.props.model);e.push(i.createElement("p",{key:this.state.key++},a+": "+t.description)),e.push(r),e.push(i.createElement("hr",{key:this.state.key++}));for(var m=0,f=d;m<f.length;m++){var v=f[m];this.render_option(e,v)}}})},{"./arguments":65,react:void 0}],75:[function(e,t,o){"use strict";var i=e("react"),n=e("./tree-view"),a=e("./decorator-model"),r=e("marked"),s=e("../common/layout/layout"),l=e("../common/layout/h-layout"),d=e("../common/layout/v-layout"),c=e("./behavior-arguments-view"),u=e("../atom-react/mixins/pane-resize-event-mixin"),h=e("../atom-react/mixins/modal-mixin"),p=e("atom"),m=e("../common/undo-redo"),f=e("./modals/behavior-selector-modal");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"BehaviorEditorView",mixins:[u.default,h.default],getInitialState:function(){var e=this.props.editor.schema,t=this.props.editor.model;return t.on("ondatachanged",this.onModelChanged),this.undoredo=new m.default(t),{schema:e,model:t,decoratorModel:new a.default(t),behavior:t.getRoot(),hoveredBehavior:void 0,hoveredDecorator:void 0,lastHovered:void 0,decoratorTreeKey:0}},onBehaviorRowHover:function(e){this.state.hoveredBehavior=e,this.state.lastHovered=this.state.hoveredBehavior},onBehaviorRowHoverLeave:function(){this.state.lastHovered=this.state.hoveredBehavior,this.state.hoveredBehavior=void 0},onDecoratorRowHover:function(e){this.state.hoveredDecorator=e,this.state.lastHovered=this.state.hoveredDecorator},onDecoratorRowHoverLeave:function(){this.state.lastHovered=this.state.hoveredDecorator,this.state.hoveredDecorator=void 0},addDecorator:function(){var e=this;if(this.state.lastHovered){var t=this.state.lastHovered.props.element;this.chooseDecorator(function(o,i){e.state.model.addDecoratorAbove(t,0,o,i)})}},addSiblingAbove:function(){var e=this;if(this.state.lastHovered)if(this.state.lastHovered.props.isBehavior){var t=this.state.lastHovered.props.element,o=this.state.lastHovered.props.row;this.chooseBehavior(function(i,n){e.state.model.addSiblingAbove(t,o,i,n)})}else{var i=this.state.decoratorModel.owner,n=this.state.lastHovered.props.row;this.chooseDecorator(function(t,o){e.state.model.addDecoratorAbove(i,n,t,o)})}},addSiblingBelow:function(){var e=this;if(this.state.lastHovered)if(this.state.lastHovered.props.isBehavior){var t=this.state.lastHovered.props.element,o=this.state.lastHovered.props.row;this.chooseBehavior(function(i,n){e.state.model.addSiblingBelow(t,o,i,n)})}else{var i=this.state.decoratorModel.owner,n=this.state.lastHovered.props.row;this.chooseDecorator(function(t,o){e.state.model.addDecoratorBelow(i,n,t,o)})}},addChild:function(){var e=this;if(this.state.lastHovered){var t=this.state.lastHovered.props.element;this.chooseBehavior(function(o,i){e.state.model.addChild(t,o,i)})}},swap:function(){var e=this;if(this.state.lastHovered){var t=this.state.lastHovered.props.element;this.chooseBehavior(function(o,i){e.state.model.swap(t,o,i)})}},moveUp:function(){if(this.state.lastHovered){var e=this.state.lastHovered.props.row,t=this.state.lastHovered.props.element;this.state.lastHovered.props.isBehavior?this.state.model.moveUp(t,e):this.state.decoratorModel.moveUp(t,e)}},moveDown:function(){if(this.state.lastHovered){var e=this.state.lastHovered.props.row,t=this.state.lastHovered.props.element;this.state.lastHovered.props.isBehavior?this.state.model.moveDown(t,e):this.state.decoratorModel.moveDown(t,e)}},editDescription:function(){if(this.state.lastHovered){var e=this.state.lastHovered.props.element;this.state.lastHovered.props.isBehavior?this._editBehaviorDescription(e):this._editDecoratorDescription(e)}},onModelChanged:function(){this.props.editor.checkModified(),this.setState(this.state)},onBehaviorRowSelected:function(e){e!==this.state.model.behavior&&(this.state.model.setRenderDescription(void 0),this.state.decoratorModel.setRenderDescription(void 0)),this.state.model.setSelectedElement(e),this.setState(this.state)},onDecoratorRowSelected:function(e){e!==this.state.model.behavior&&(this.state.model.setRenderDescription(void 0),this.state.decoratorModel.setRenderDescription(void 0)),this.state.decoratorModel.setSelectedElement(e),this.setState(this.state)},onRowDoubleClicked:function(e){this._editBehaviorDescription(e.props.element)},_editBehaviorDescription:function(e){this.state.model.setRenderDescription(e),this.state.decoratorModel.setRenderDescription(void 0),this.setState(this.state)},onDecoratorRowDoubleClicked:function(e){this._editDecoratorDescription(e.props.element)},_editDecoratorDescription:function(e){this.state.model.setRenderDescription(void 0),this.state.decoratorModel.setRenderDescription(e),this.setState(this.state)},dispose:function(){this.saveUiState(this.layout)},serialize:function(){this.saveUiState(this.layout)},render:function(){if(this.state.model.installJibo){var e="Please make sure the jibo module is installed in this project using `npm install jibo --save`.\nOtherwise, the behavior editor cannot render the behaviors.";return i.createElement("ul",{className:"background-message centered"},i.createElement("div",{style:{padding:20},dangerouslySetInnerHTML:{__html:r(e,{sanitize:!0})}}))}var t=this.state.model.getData();if(void 0===t){var o="Error parsing JSON data. This is likely caused by hand-editing behavior tree JSON or unresolved merge conflicts.";return i.createElement("ul",{className:"background-message centered"},i.createElement("li",null,o))}var a=this.props.editor,u=a.getNewSchema(a.uri),h={},p={};if(Object.keys(t).forEach(function(e){if("meta"!==e){var o=t[e],i=o["asset-pack"]?o["asset-pack"]:"core";u[i]?u[i].schema[o.class]||(p[o.class]=!0):h[i]=!0}}),h=Object.keys(h),p=Object.keys(p),h.length>0||p.length>0){var m=null;if(h.length){var f=[];h.forEach(function(e){f.push(i.createElement("li",{style:{paddingLeft:15},className:"list-item"},i.createElement("span",{className:"icon icon-file-submodule"},e)))}),m=[i.createElement("h1",null,"Missing Asset Packs"),i.createElement("h2",null,"Make sure these following asset packs are in the package.json and have been installed"),{assetPacksList:f}]}var v=null;if(p.length){var y=[];p.forEach(function(e){y.push(i.createElement("li",{style:{paddingLeft:15},className:"list-item"},i.createElement("span",{className:"icon icon-file-text"},e)))}),v=[i.createElement("h1",null,"Missing Behaviors"),i.createElement("h2",null,"Make sure the following behaviors are included in your schemas folder"),{behaviorList:y}]}return i.createElement("div",null,i.createElement("ul",{className:"list-group",style:{paddingLeft:20}},m,v))}return i.createElement("div",{tabIndex:-1},i.createElement(s.default,{ref:"topLevel",width:this.props.paneWidth,height:this.props.paneHeight-40,serialized:this.props.editor.layout},i.createElement(l.default,null,i.createElement(d.default,null,i.createElement(n.default,{showRoot:!0,model:this.state.model,onRowSelected:this.onBehaviorRowSelected,onRowDoubleClicked:this.onRowDoubleClicked,onRowHover:this.onBehaviorRowHover,onRowHoverLeave:this.onBehaviorRowHoverLeave,rowClassName:"behavior",isBehavior:!0}),i.createElement(n.default,{key:this.state.decoratorTreeKey,showRoot:!1,model:this.state.decoratorModel,onRowSelected:this.onDecoratorRowSelected,onRowDoubleClicked:this.onDecoratorRowDoubleClicked,onRowHover:this.onDecoratorRowHover,onRowHoverLeave:this.onDecoratorRowHoverLeave,rowClassName:"decorator",isBehavior:!1})),i.createElement(d.default,null,i.createElement(c.default,{schema:this.state.schema,model:this.state.model,behavior:this.state.model.getSelectedBehavior(),isBehaviorArgs:!0,projectRoot:this.props.editor.projectRoot}),i.createElement(c.default,{schema:this.state.schema,model:this.state.model,behavior:this.state.model.getSelectedDecorator(),isBehaviorArgs:!1,projectRoot:this.props.editor.projectRoot})))))},chooseBehavior:function(e){
var t=this;this.createModal(i.createElement(f.default,{schema:this.state.schema,types:["leaf","composite"],onChoose:function(t,o){e(t,o)},onClose:function(){t.destroyModal()}}))},chooseDecorator:function(e){var t=this;this.createModal(i.createElement(f.default,{schema:this.state.schema,types:["decorator"],onChoose:function(t,o){e(t,o)},onClose:function(){t.destroyModal()}}))},undo:function(){this.undoredo.undo()},redo:function(){this.undoredo.redo()},componentDidMount:function(){var e=this;this.setupPaneResizeEventMixin(),this.disposable=new p.CompositeDisposable,this.disposable.add(atom.commands.add(this.getDOMNode(),{"jibo-sdk:add-decorator":this.addDecorator,"jibo-sdk:add-sibling-above":this.addSiblingAbove,"jibo-sdk:add-sibling-below":this.addSiblingBelow,"jibo-sdk:add-child":this.addChild,"jibo-sdk:swap-behavior":this.swap,"jibo-sdk:move-up-behavior":this.moveUp,"jibo-sdk:move-down-behavior":this.moveDown,"jibo-sdk:edit-description":this.editDescription,"core:undo":this.undo,"core:redo":this.redo})),this.modifiedInterval=setInterval(function(){e.props.editor.checkModified()},100),this.state.model.setSelectedElement(this.state.model.getRoot())},componentWillUnmount:function(){clearInterval(this.modifiedInterval),this.disposable.dispose(),this.cleanupPaneResizeEventMixin()}})},{"../atom-react/mixins/modal-mixin":57,"../atom-react/mixins/pane-resize-event-mixin":58,"../common/layout/h-layout":103,"../common/layout/layout":104,"../common/layout/v-layout":105,"../common/undo-redo":110,"./behavior-arguments-view":74,"./decorator-model":78,"./modals/behavior-selector-modal":81,"./tree-view":91,atom:void 0,marked:void 0,react:void 0}],76:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("fs"),a=e("path"),r=e("../atom-react/core/react-editor"),s=e("./behavior-editor-view"),l=e("./tree-model"),d=e("../common/tree-view-helper"),c=e("lodash"),u=e("./schema-reader"),h=e("./behavior-reader"),p=e("../common/get-asset-packs"),m=e("jibo"),f=e("crypto"),v=e("jibo-analytics"),y="win32"===process.platform?process.env.HOMEPATH:process.env.HOME,g=a.resolve(y,".jibo");n.existsSync(g)||n.mkdirSync(g);var b=a.resolve(g,"temp");n.existsSync(b)||n.mkdirSync(b);var k=function(t){function o(e){var o=t.call(this,"BehaviorEditor",e,!1)||this;o.projectRoot=m.utils.PathUtils.findRoot(e),o.ignoreNextSave=!1,o.schema=(new u.default).getNewSchema(e),o.data=new h.default(o.schema).read(e);var i=o.getUiState();return o.layout=i?i:[],o.model=new l.default(o.data,o.schema,e),o.lastSaved=JSON.stringify(o.model.data),o.onReload=o.onReload.bind(o),o.loadAnimDB(o.projectRoot),o}return i(o,t),o.createNewFile=function(t){var i=d.default.getFolderPathWithDirectory(d.default.getFolderPathOfSelection(),"src/behaviors");if(!i)return void alert("You must have a valid project loaded in order to create a new behavior tree file.");var n=atom.getCurrentWindow(),a=e("remote"),r=a.dialog||a.require("dialog");r.showSaveDialog(n,{title:"New Behavior Tree",defaultPath:i,filters:o.getDialogFilter()},function(e){if(e){if(o.isValidDirectory(e)){var i=(new u.default).getNewSchema(e);l.default.createNewFile(e,i.core.schema.Sequence),atom.workspace.open(e),v.default.event("behavior-editor","new",{})}else alert('You must save behavior trees under the "src/behaviors" folder.');t&&t(e)}})},o.isValidDirectory=function(e){var t=a.normalize("/src/behaviors/");return!!e.includes(t)},o.getDialogFilter=function(){return[{name:"Behavior Tree",extensions:["bt"]}]},o.prototype.loadAnimDB=function(e){var t=p.getAssetPackDictionary(e)["jibo-anim-db-animations"];m.animDB._animDB||m.animDB.init(m,t&&t.root+"/animdb.json")},o.prototype.backup=function(e){var t=c.cloneDeep(this.model.data),o=f.createHash("md5");o.update(e);for(var i=o.digest("hex"),r=a.basename(i),s=b+"/"+r+".backup",l=Object.keys(t),d=0;d<l.length;d++)for(var u=t[l[d]],h=0;h<u.args.length;h++)"string"==typeof u.args[h]&&(0===u.args[h].indexOf("function")||u.args[h].indexOf("=>")>=0)&&(u.args[h]=u.args[h].split("\n"));n.writeFileSync(s,JSON.stringify(t,null," "),"utf8")},o.prototype.saveFile=function(e){if(!o.isValidDirectory(e))return alert('You must save behavior trees under the "src/behaviors" folder.'),!1;this.ignoreNextSave=!0,this.lastSaved=JSON.stringify(this.model.data);for(var t=c.cloneDeep(this.model.data),i=Object.keys(t),a=0;a<i.length;a++)if("meta"!==i[a])for(var r=t[i[a]],s=Object.keys(r.options),l=0;l<s.length;l++){var d=s[l];"string"==typeof r.options[d]&&(0===r.options[d].indexOf("function")||r.options[d].indexOf("=>")>=0)&&(r.options[d]=r.options[d].split("\n"))}return n.writeFileSync(e,JSON.stringify(t,null," "),"utf8"),v.default.event("behavior-editor","saved",{}),!0},o.prototype.checkModified=function(){var e=JSON.stringify(this.model.data);return e!==this.lastSaved?(this.setModifiedStatus(!0),!0):(this.setModifiedStatus(!1),!1)},o.prototype.serialize=function(){return this.saveUiState(this.layout),t.prototype.serialize.call(this)},o.prototype.dispose=function(){this.saveUiState(this.layout),t.prototype.dispose.call(this)},o.prototype.getReactClass=function(){return s.default},o.prototype.getNewSchema=function(e){return(new u.default).getNewSchema(e)},o.prototype.onReload=function(){this.reload()},o.prototype.reload=function(e){return void 0===e&&(e=this.uri),this.ignoreNextSave?void(this.ignoreNextSave=!1):(this.data=new h.default(this.schema).read(e),this.model.reload(this.data),void this.model.emit("ondatachanged"))},o.prototype.getSaveDialogOptions=function(){return{title:"Behavior Save As",filters:o.getDialogFilter()}},o}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=k,atom.deserializers.add({deserialize:r.default.deserialize.bind(k),name:"BehaviorEditor"})},{"../atom-react/core/react-editor":55,"../common/get-asset-packs":100,"../common/tree-view-helper":109,"./behavior-editor-view":75,"./behavior-reader":77,"./schema-reader":84,"./tree-model":85,crypto:void 0,fs:void 0,jibo:void 0,"jibo-analytics":void 0,lodash:void 0,path:void 0,remote:void 0}],77:[function(e,t,o){"use strict";var i=e("fs"),n=function(){function t(e){this.schema=e}return t.prototype._getSchemaByElement=function(e){if(!e["asset-pack"]){var t=this.schema.core.schema[e.class];return t||(t=this.schema.project.schema[e.class]),t}var o=e["asset-pack"];return this.schema[o].schema[e.class]},t.prototype._update01=function(t){var o=this;if(!t.meta){var i=e("behaviorify/lib/core");t.meta={version:1},Object.keys(t).forEach(function(e){if("meta"!==e){var n=t[e],a=o._getSchemaByElement(n),r={};a.options.forEach(function(t,o){i[e]?r[i[e][o]]=n.args[o]:r[t.field]=n.args[o]}),delete n.args,n.options=r}})}},t.prototype._update=function(e){this._update01(e)},t.prototype.read=function(e){var t;try{t=JSON.parse(i.readFileSync(e,"utf8"))}catch(e){return void console.error(e)}return this._update(t),Object.keys(t).forEach(function(e){if("meta"!==e){var o=t[e];Object.keys(o.options).forEach(function(e){Array.isArray(o.options[e])&&(o.options[e]=o.options[e].join("\n"))})}}),t},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"behaviorify/lib/core":void 0,fs:void 0}],78:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a=e("./event-emitter"),r=e("./description-editor"),s=e("react"),l=function(e){function t(t){var o=e.call(this)||this;return o.model=t,o.root={id:"root"},o._clearDescription(),o}return i(t,e),Object.defineProperty(t.prototype,"owner",{get:function(){return this.model.selectedElement},enumerable:!0,configurable:!0}),t.prototype.setSelectedElement=function(e){this.model.setSelectedDecorator(e)},t.prototype.isSelected=function(e){return e&&this.model.selectedDecorator&&e.id===this.model.selectedDecorator.id},t.prototype.getParent=function(e){if(e!==this.root)return this.root},t.prototype.getHeaderLabel=function(e){switch(e){case 0:return"";case 1:return"";case 2:return"Decorator Type";case 3:return"Description"}},t.prototype.moveRow=function(e,t,o){var i=this.owner,n=0;for(n=0;n<i.decorators.length&&i.decorators[n]!==e.id;n++);i.decorators.splice(n,1),i.decorators.splice(o,0,e.id),this.model.emit("ondatachanged")},t.prototype.moveUp=function(e,t){this.canMoveUp(e,t)&&(this.moveRow(e,void 0,t-1),this.model.addRedoUndoEntry())},t.prototype.canMoveUp=function(e,t){return 0!==t},t.prototype.moveDown=function(e,t){this.canMoveDown(e,t)&&(this.moveRow(e,void 0,t+1),this.model.addRedoUndoEntry())},t.prototype.canMoveDown=function(e,t){return t<this.owner.decorators.length-1},t.prototype.getRowCount=function(){return this.model.selectedElement&&this.model.selectedElement.decorators?this.model.selectedElement.decorators.length:0},t.prototype.getColumnCount=function(){return 4},t.prototype.hasChildren=function(e){return!!e&&"root"===e.id},t.prototype.isSkipped=function(e){return e.skipped},t.prototype.shouldNotIndent=function(e){return 0===e},t.prototype.getChildElement=function(e,t){return this.model.data[this.model.selectedElement.decorators[t]]},t.prototype.canHaveChildren=function(e){return!!e&&"root"===e.id},t.prototype.deleteDecorator=function(e,t){this.model.selectedElement&&this.model.deleteDecorator(this.model.selectedElement,t)},t.prototype.deleteRow=function(e,t){this.deleteDecorator(e,t)},t.prototype.setRenderDescription=function(e){this._setAndClearDescriptionElement(),this.description.element=e,this.description.newValue=void 0},t.prototype._setAndClearDescriptionElement=function(){void 0!==this.description.element&&this.description.newValue!==this.description.element.name&&(this.description.element.name=this.description.newValue,this.model.addRedoUndoEntry()),this._clearDescription()},t.prototype._clearDescription=function(){this.description={element:void 0,newValue:void 0}},t.prototype.getLabel=function(e,t,o,i){var a=this;if(!e)return"";if(0===t)return String(i);if("root"===e.id)return"";switch(t){case 1:var l=e.class,d="",c={};this.isSelected(e)&&(d="row-selected-text");var u={};return e.skipped?(u={className:"fa fa-eye-slash",style:{color:"#555555"}},c={"font-style":"italic",color:"#555555"}):u={className:"fa fa-bell",style:{color:"#cd0a0a"}},s.createElement("p",{className:d,style:c},s.createElement("i",n({},u))," ",l);case 2:return e===this.description.element?s.createElement(r.default,{content:e.name,onChange:function(e){a.description.newValue=e},width:o,onConfirm:function(){a._setAndClearDescriptionElement(),a.model.emit("ondatachanged")}}):e.name}},t.prototype.up=function(){this.model.upDecorator()},t.prototype.down=function(){this.model.downDecorator()},t.prototype.copy=function(){this.model.copyDecorator()},t.prototype.cut=function(){this.model.cutDecorator()},t.prototype.paste=function(){this.model.pasteDecorator()},t.prototype.skip=function(){this.model.skipDecorator(),this.model.addRedoUndoEntry()},t.prototype.getRoot=function(){return this.root},t}(a.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=l},{"./description-editor":79,"./event-emitter":80,react:void 0}],79:[function(e,t,o){"use strict";var i=e("react"),n=e("../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({render:function(){var e=this;return i.createElement(n.default,{style:{width:this.props.width,height:"25px"},ref:"editor",mini:!0,content:this.props.content,onDidChange:function(t){e.props.onChange(t)},onConfirm:function(){e.props.onConfirm()}})},componentDidMount:function(){var e=this.refs.editor;e.focus()}})},{"../common/atom-editor":96,react:void 0}],80:[function(e,t,o){"use strict";var i=function(){function e(){this._events={}}return e.prototype.on=function(e,t){if("function"!=typeof t)throw new TypeError;var o=this._events[e]||(this._events[e]=[]);return o.indexOf(t)!==-1?this:(o.push(t),this)},e.prototype.once=function(e,t){function o(){i.off(e,o),t.apply(null,arguments)}var i=this;return this.on(e,o)},e.prototype.off=function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];0===t.length&&(this._events[e]=null);var i=t[0];if("function"!=typeof i)throw new TypeError;var n=this._events[e];if(!n||!n.length)return this;var a=n.indexOf(i);return a===-1?this:(n.splice(a,1),this)},e.prototype.emit=function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var i=this._events[e];return!(!i||!i.length)&&(i.forEach(function(e){return e.apply(null,t)}),!0)},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{}],81:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=e("marked"),r=e("../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({onChoose:function(){this.props.onChoose(this.state.currentAssetPackId,this.state.currentBehavior),this.props.onClose()},onCancel:function(){this.props.onClose()},getLength:function(){return Object.keys(this.behaviorToIndexMap).length},_moveUp:function(){var e=this._getIndexFromBehaviorName(this.state.currentBehavior.class);0===e?e=this.getLength()-1:e--;var t=this._getBehaviorNameFromIndex(e),o=this.props.schema[this.state.currentAssetPackId].schema[t];void 0===t&&t===this.state.currentBehavior.class||this.setState({currentBehavior:o})},_moveDown:function(){var e=this._getIndexFromBehaviorName(this.state.currentBehavior.class);e===this.getLength()-1?e=0:e++;var t=this._getBehaviorNameFromIndex(e),o=this.props.schema[this.state.currentAssetPackId].schema[t];void 0===t&&t===this.state.currentBehavior.class||this.setState({currentBehavior:o})},_getIndexFromBehaviorName:function(e){return this.behaviorToIndexMap[e]},_getBehaviorNameFromIndex:function(e){for(var t in this.behaviorToIndexMap)if(this.behaviorToIndexMap[t]===e)return t},getInitialState:function(){return{currentAssetPackId:"core",currentBehavior:"",filter:""}},onAssetPackSelected:function(e){this.state.currentBehavior=void 0,this.setState({currentAssetPackId:e})},onBehaviorSelected:function(e){this.setState({currentBehavior:e})},getPanelHeading:function(e){return i.createElement("div",{className:"panel-heading",style:{padding:"0px",width:"100%",height:30}},i.createElement("p",{style:{textAlign:"center",marginTop:"4px",marginBottom:"4px"}},e))},render:function(){var e=this;this.behaviorToIndexMap={};for(var t=[],o=Object.keys(this.props.schema),n=[],s=0;s<o.length;s++){var l=o[s],d=this.props.schema[l],c="list-item";if(this.state.currentAssetPackId===l){c+=" selected";var u=Object.keys(d.schema);u=u.sort();for(var h=[],p=!1,m=0,f=0;f<u.length;f++){var v=u[f];v.toLowerCase().includes(this.state.filter.toLowerCase())?this.props.types.indexOf(d.schema[v].type)!==-1&&(this.behaviorToIndexMap[v]=m++,h.push(v)):this.state.currentBehavior&&this.state.currentBehavior.class===v&&(p=!0)}u=h;for(var y=function(t){var o=u[t],a=d.schema[o],r="list-item";g.state.currentBehavior&&!p||0!==t?g.state.currentBehavior.class===o&&(r+=" selected"):(g.state.currentBehavior=a,r+=" selected"),n.push(i.createElement("li",{className:r,onClick:g.onBehaviorSelected.bind(g,a),onDoubleClick:function(){e.onBehaviorSelected(a),e.onChoose()}},i.createElement("span",null,o)))},g=this,f=0;f<u.length;f++)y(f)}t.push(i.createElement("li",{className:c,onClick:this.onAssetPackSelected.bind(this,l)},i.createElement("span",null,d.displayName)))}var b=this.state.currentBehavior&&this.state.currentBehavior.description?a(this.state.currentBehavior.description,{sanitize:!0}):"",k="Behavior";this.props.types.indexOf("decorator")>-1&&(k="Decorator");var S="Choose a "+k;return i.createElement("div",{className:"behavior-selector-modal asset-selector-modal",ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},S)),i.createElement("label",{style:{marginLeft:10}},"Search"),i.createElement(r.default,{ref:"editor",style:{marginLeft:10,marginRight:10,marginBottom:10},mini:!0,content:this.state.filter,onDidChange:function(t){e.setState({filter:t})}}),i.createElement("div",{className:"contents"},i.createElement("div",{className:"list-contents"},this.getPanelHeading("Asset Pack"),i.createElement("div",{className:"list-group asset-pack",ref:"assetPackList"},t)),i.createElement("div",{className:"list-contents"},this.getPanelHeading(k),i.createElement("ul",{className:"list-group schema-list",ref:"schemaList"},n)),i.createElement("div",{className:"description-contents"},this.getPanelHeading("Description"),i.createElement("div",{className:"behavior-description"},i.createElement("div",{dangerouslySetInnerHTML:{__html:b}})))),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onChoose},"Choose"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},onLeft:function(){var e=i.findDOMNode(this.refs.assetPackList);e.focus()},onRight:function(){var e=i.findDOMNode(this.refs.schemaList);e.focus()},componentDidMount:function(){var e=this,t=this.refs.editor,o=i.findDOMNode(this.refs.schemaList),a=i.findDOMNode(this.refs.assetPackList);setTimeout(function(){t.focus(),o.setAttribute("tabIndex","0"),a.setAttribute("tabIndex","1"),e.disposable=new n.CompositeDisposable,e.disposable.add(atom.commands.add(o,{"jibo-sdk:up":e._moveUp,"jibo-sdk:down":e._moveDown,"jibo-sdk:confirm":e.onChoose,"jibo-sdk:left":e.onLeft})),e.disposable.add(atom.commands.add(a,{"jibo-sdk:right":e.onRight})),e.disposable.add(atom.commands.add(e.getDOMNode(),{"jibo-sdk:escape":e.onCancel})),e.disposable.add(atom.commands.add(t.getDOM(),"jibo-sdk:confirm",function(){e.onChoose()}))},100)},componentWillUnmount:function(){this.disposable.dispose()}})},{"../../common/atom-editor":96,atom:void 0,marked:void 0,react:void 0}],82:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=e("../../common/directory-tree-view"),r=e("path"),s=e("normalize-path"),l=e("../../common/get-asset-packs"),d=e("../../common/animation/animation-visualizer"),c=e("../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({onChoose:function(){var e=this.state.currentAssetPack,t=r.join(e.root,"animations"),o=r.relative(t,this.state.currentAnimation);o=s(o),"project"!==this.state.currentAssetPack.id&&(o=e.id+"://"+o),this.props.onChoose(o),this.props.onClose()},onCancel:function(){this.props.onClose()},getLength:function(){return Object.keys(this.behaviorToIndexMap).length},getInitialState:function(){return{currentAssetPack:{id:"project"},currentAnimation:"",filter:""}},onAssetPackSelected:function(e){this.setState({currentAssetPack:e})},onSelected:function(e){this.setState({currentAnimation:e})},getPanelHeading:function(e){return i.createElement("div",{className:"panel-heading",style:{padding:"0px",width:"100%",height:30}},i.createElement("p",{style:{textAlign:"center",marginTop:"4px",marginBottom:"4px"}},e))},render:function(){for(var e,t=this,o=l.default(this.props.root),n=[],s=0;s<o.length;s++){var u=o[s],h="list-item";this.state.currentAssetPack.id===u.id&&(this.state.currentAssetPack=u,e=u,h+=" selected"),n.push(i.createElement("li",{className:h,onClick:this.onAssetPackSelected.bind(this,u)},i.createElement("span",null,u.name)))}return i.createElement("div",{className:"asset-selector-modal",ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Choose an Animation")),i.createElement("label",{style:{marginLeft:10}},"Search"),i.createElement(c.default,{ref:"editor",style:{marginLeft:10,marginRight:10,marginBottom:10},mini:!0,content:this.state.filter,onDidChange:function(e){t.setState({filter:e})}}),i.createElement("div",{className:"contents"},i.createElement("div",{className:"list-contents"},this.getPanelHeading("Asset Pack"),i.createElement("div",{className:"list-group asset-pack",ref:"assetPackList"},n)),i.createElement("div",{className:"list-contents"},this.getPanelHeading("Animation"),i.createElement("div",{className:"asset-list"},i.createElement(a.default,{uri:r.resolve(e.root,"animations"),onChosen:function(e){t.onSelected(e),t.onChoose()},onSelected:this.onSelected,extension:[".keys",".anim"],filter:this.state.filter,hideEmpty:!0}))),i.createElement("div",{className:"preview-contents"},this.getPanelHeading("Preview"),i.createElement("div",{className:"asset-preview"},i.createElement(d.default,{uri:this.state.currentAnimation,style:{width:"100%",height:"100%"}})))),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onChoose},"Choose"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},onLeft:function(){var e=i.findDOMNode(this.refs.assetPackList);e.focus()},onRight:function(){var e=i.findDOMNode(this.refs.schemaList);e.focus()},componentDidMount:function(){var e=this,t=this.refs.editor;setTimeout(function(){t.focus(),e.getDOMNode().setAttribute("tabIndex",0),e.disposable=new n.CompositeDisposable,e.disposable.add(atom.commands.add(e.getDOMNode(),{"jibo-sdk:escape":e.onCancel,"jibo-sdk:confirm":e.onChoose}))},100)},componentWillUnmount:function(){this.disposable.dispose()}})},{"../../common/animation/animation-visualizer":94,"../../common/atom-editor":96,"../../common/directory-tree-view":98,"../../common/get-asset-packs":100,atom:void 0,"normalize-path":void 0,path:void 0,react:void 0}],83:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=e("path"),r=e("../../common/animation/animation-visualizer"),s=e("jibo"),l=e("../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({onChoose:function(){this.props.onChoose(this.state.currentName),this.props.onClose()},onCancel:function(){this.props.onClose()},onNameSelected:function(e){this.setState({currentAnimation:this.getAnimPath(e),currentName:e})},getInitialState:function(){return{currentName:"",currentAnimation:"",filter:null}},getPanelHeading:function(e){return i.createElement("div",{className:"panel-heading",style:{padding:"0px",width:"100%",height:30}},i.createElement("p",{style:{textAlign:"center",marginTop:"4px",marginBottom:"4px"}},e))},getAnimPath:function(e){var t=s.animDB.getAnimByName(e);return a.join(t.resourceRoot,t.meta.path)},getAnimationList:function(){for(var e=[],t=0,o=this.animationNames;t<o.length;t++){var n=o[t],a="list-item";(!this.state.filter||n.indexOf(this.state.filter)>=0)&&(this.state.currentName===n&&(a+=" selected"),e.push(i.createElement("li",{className:a,onDoubleClick:this.onChoose.bind(this),onClick:this.onNameSelected.bind(this,n)},i.createElement("span",null,n))))}return e},render:function(){var e=this,t=this.getAnimationList();return i.createElement("div",{className:"asset-selector-modal",ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Choose an Animation")),i.createElement("label",{style:{marginLeft:10}},"Search"),i.createElement(l.default,{ref:"editor",style:{marginLeft:10,marginRight:10,marginBottom:10},mini:!0,content:this.state.filter,onDidChange:function(t){e.setState({filter:t})}}),i.createElement("div",{className:"contents"},i.createElement("div",{className:"name-list-contents"},this.getPanelHeading("Animation Name"),i.createElement("div",{className:"list-group asset-pack",ref:"assetPackList"},t)),i.createElement("div",{className:"preview-contents"},this.getPanelHeading("Preview"),i.createElement("div",{className:"asset-preview"},i.createElement(r.default,{uri:this.state.currentAnimation,style:{width:"100%",height:"100%"}})))),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onChoose},"Choose"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},componentWillMount:function(){this.animationNames=s.animDB.getAnimationNames()},componentDidMount:function(){var e=this,t=this.refs.editor;setTimeout(function(){t.focus(),e.getDOMNode().setAttribute("tabIndex","0"),e.disposable=new n.CompositeDisposable,e.disposable.add(atom.commands.add(e.getDOMNode(),{"jibo-sdk:escape":e.onCancel,"jibo-sdk:confirm":e.onChoose}))},100)},componentWillUnmount:function(){this.disposable.dispose()}})},{"../../common/animation/animation-visualizer":94,"../../common/atom-editor":96,atom:void 0,jibo:void 0,path:void 0,react:void 0}],84:[function(e,t,o){"use strict";function i(t){if(!t.meta){var o=e("behaviorify/lib/core"),i=Object.keys(t);i.forEach(function(e){var i=t[e],n=i.meta&&i.meta.length>0?i.meta:[];n.forEach(function(e,t){e.type=i.args[t]}),i.options=n,delete i.meta,delete i.args,o[e]&&i.options.forEach(function(t,n){i.options[n].field=o[e][n]})})}}function n(e){i(e)}var a=e("../atom-react/core/react-editor"),r=e("fs"),s=e("path"),l=function(){function t(e){this.SchemaPaths=["node_modules/jibo/schema/schema.json","node_modules/jibo/schema/schema-base.json"],e&&(this.SchemaPaths=this.SchemaPaths.concat(e))}return t.prototype._requireWithDescriptions=function(e){var t;try{t=JSON.parse(r.readFileSync(e,"utf8")),n(t),delete t.meta,Object.keys(t).forEach(function(o){var i=t[o];if(i.description&&i.description.url){var n=s.resolve(s.dirname(e),i.description.url);try{i.description=r.readFileSync(n,"utf8")}catch(e){i.description=""}}})}catch(t){console.warn("Could not read "+e),console.warn(t)}return t},t.prototype._generateSchemaObject=function(e,t){var o={};return e.forEach(function(e){o=Object.assign(o,e)}),Object.keys(o).forEach(function(e){o[e].class=e,o[e].assetPack=t}),o},t.prototype._addProjectSchema=function(e,t,o){var i=s.resolve(o,"schemas"),n=[];try{r.lstatSync(i);for(var a=r.readdirSync(i),l=0;l<a.length;l++)if(".json"===s.extname(a[l])){var d=s.resolve(i,a[l]);n.push(this._requireWithDescriptions(d))}}catch(e){console.warn("no schema folder detected "+e.message)}this.schemaProjects[t]={displayName:e,schema:this._generateSchemaObject(n,t)}},t.prototype.getNewSchema=function(t){var o=this,i=a.default.getProjectRoot(t);i||(i=a.default.getProjectRoot(""));var n=[];this.SchemaPaths.forEach(function(e){e.startsWith("/")||(e=s.join(i,e));var t=o._requireWithDescriptions(e);t&&n.push(t)}),this.schemaProjects={core:{displayName:"Core",schema:this._generateSchemaObject(n,"core")}},this._addProjectSchema("Project Behaviors","project",i);var l=s.resolve(i,"node_modules"),d=[];try{d=r.readdirSync(l)}catch(e){console.warn("no node_modules folder detected "+e.message)}for(var c=0;c<d.length;c++)try{var u=e(s.resolve(l,d[c],"package.json"));if(u.jibo&&"asset-pack"===u.jibo.type){var h=s.resolve(l,d[c]);this._addProjectSchema(u.jibo["display-name"],u.name,h)}}catch(e){}return this.schemaProjects},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=l},{"../atom-react/core/react-editor":55,"behaviorify/lib/core":void 0,fs:void 0,path:void 0}],85:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a=e("./event-emitter"),r=e("../atom-react/core/react-editor"),s=e("./description-editor"),l=e("fs"),d=e("../common/clipboard"),c=e("path"),u=e("node-uuid"),h=e("slash"),p=e("react"),m=function(e){function t(t,o,i){var n=e.call(this)||this;return n.data=t,n.schema=o,n.uri=i,n.selectionState={},n.selectedElement=void 0,n.selectedDecorator=void 0,n._clearDescription(),n.reload(t),n}return i(t,e),t.getDefaultValueForType=function(e,t){var o={int:0,number:0,animation:"null",audio:"null",function:"() => {\n}",string:"null",boolean:!1,enum:"null"};return t?t:o[e]},t.createNewFile=function(e,o){var i={id:1,class:o.class,name:""};i.args=[],o.args&&o.args.forEach(function(e,n){var a=o.meta[n].defaultValue;if(Array.isArray(e)){var r=e;e=e[0],"enum"===e&&void 0===a&&(a=r[1].value)}i.args.push(t.getDefaultValueForType(e.toLowerCase(),a))});var n={};n[i.id]=i,l.writeFileSync(e,JSON.stringify(n,null," "),"utf8")},t.prototype.findRelativePathToUri=function(e,t){var o=c.relative(c.dirname(this.uri),e);if("."!==o[0]&&(o="./"+o),t&&t.dropExtension===!0){var i=c.extname(o);""!==i&&(o=o.replace(RegExp("\\"+i+"$"),""))}return h(o)},t.prototype.getSchemaByElement=function(e){if(!e["asset-pack"]){var t=this.schema.core.schema[e.class];return t||(t=this.schema.project.schema[e.class]),t}var o=e["asset-pack"];return this.schema[o].schema[e.class]},t.prototype.addRedoUndoEntry=function(){},t.prototype.getMutationFunctionNames=function(){return["moveUp","moveDown","addRedoUndoEntry"]},t.prototype.reload=function(e){var t=this;this.data=e,this.projectRoot=r.default.getProjectRoot(this.uri);var o=c.join(this.projectRoot,"node_modules","jibo");if(!l.existsSync(o))return void(this.installJibo=!0);this.installJibo=!1,this.nextId=0;var i=void 0===e?[]:Object.keys(e);i.forEach(function(o){if("meta"!==o){var i=e[o];t.nextId=Math.max(t.nextId,i.id)}});for(var n=0;n<i.length;n++)if("meta"!==i[n]){var a=e[i[n]],s=this.getSchemaByElement(a).type;if("leaf"===s||"composite"===s){for(this.root=a;this.root.parent;)this.root=e[this.root.parent];break}}this._clearDescription(),this._validateSelections()},t.prototype._validateSelections=function(){var e=this,t=Object.keys(this.selectionState);if(t.forEach(function(t){var o=e.data[t],i=e.data[e.selectionState[t]];void 0!==o&&void 0!==i||(e.selectionState[o]=void 0)}),void 0!==this.selectedElement){var o=this.data[this.selectedElement.id];if(void 0===o)this.setSelectedElement(this.getRoot());else if(this.setSelectedElement(o),void 0!==this.selectedDecorator&&void 0===this.data[this.selectedDecorator.id]){var i=this._getFirstDecorator(this.selectedElement);this.setSelectedDecorator(i)}}},t.prototype.getData=function(){return this.data},t.prototype.setSelectedElement=function(e){this.selectedElement=e;var t=void 0;void 0!==e&&(t=void 0!==this.selectionState[e.id]?this.selectionState[e.id]:this._getFirstDecorator(e)),this.setSelectedDecorator(t)},t.prototype.getSelectedBehavior=function(){return this.selectedElement},t.prototype.setSelectedDecorator=function(e){this.selectedDecorator=e,this._setSelectionState(this.selectedElement,e)&&this.emit("ondatachanged")},t.prototype.getSelectedDecorator=function(){return this.selectedDecorator},t.prototype._getFirstDecorator=function(e){if(void 0!==e){var t=void 0;if(this.data[e.id].decorators&&this.data[e.id].decorators.length>0){var o=this.data[e.id].decorators[0];t=this.data[o]}return t}},t.prototype._setSelectionState=function(e,t){return void 0!==e&&this.selectionState[e.id]!==t&&(this.selectionState[e.id]=t,!0)},t.prototype.setRenderDescription=function(e){this._setAndClearDescriptionElement(),this.description.element=e,this.description.newValue=void 0},t.prototype._setAndClearDescriptionElement=function(){this.description.element&&"string"==typeof this.description.newValue&&(this.description.element.name=this.description.newValue,this.addRedoUndoEntry()),this._clearDescription()},t.prototype._clearDescription=function(){this.description={element:void 0,newValue:void 0}},t.prototype.isSelected=function(e){return this.selectedElement&&e.id===this.selectedElement.id},t.prototype.createNewElement=function(e,o,i){var n={id:u.v4(),class:o.class,name:"",options:{}};return n["asset-pack"]=e,i&&(n.parent=i.id),o.options&&o.options.forEach(function(e){var o=e.defaultValue,i=e.field,a=e.type;if(Array.isArray(a)){var r=a;
a=a[0],"enum"===a&&void 0===o&&(o=r[1].value)}n.options[i]=t.getDefaultValueForType(a.toLowerCase(),o)}),n},t.prototype.deleteRow=function(e,t){var o=this;if("undefined"==typeof e&&(e=this.selectedElement),"undefined"==typeof t){var i=this.data[e.parent];t=i.children.indexOf(e.id)}var n=e.parent,a=this.data[n],r=this.isSelected(e);this.selectionState[e.id]=void 0;for(var s=[a.children.splice(t,1)[0]];s.length>0;){var l=s.pop();r||(r=this.isSelected(this.data[l])),this.data[l].decorators&&this.data[l].decorators.forEach(function(e){delete o.data[e]}),this.data[l].children&&(s=s.concat(this.data[l].children)),delete this.data[l]}r&&this.setSelectedElement(a),this.addRedoUndoEntry(),this.emit("ondatachanged")},t.prototype.addDecoratorAbove=function(e,t,o,i){e.decorators=e.decorators?e.decorators:[];var n=this.createNewElement(o,i);e.decorators.splice(t,0,n.id),this.data[n.id]=n,this.selectedElement===e&&this.setSelectedDecorator(n),this.addRedoUndoEntry(),this.emit("ondatachanged")},t.prototype.addDecoratorBelow=function(e,t,o,i){this.addDecoratorAbove(e,t+1,o,i)},t.prototype.deleteDecorator=function(e,t){if("undefined"==typeof e&&(e=this.selectedElement),"undefined"==typeof t){var o=this.data[e.parent];t=o.children.indexOf(e.id)}var i=e.decorators.splice(t,1)[0];this.selectedDecorator&&i===this.selectedDecorator.id&&(this.selectedDecorator=void 0),delete this.data[i];var n=this._getFirstDecorator(e);this.setSelectedDecorator(n),this.addRedoUndoEntry(),this.emit("ondatachanged")},t.prototype.addSiblingAbove=function(e,t,o,i){var n=this.getParent(e),a=this.createNewElement(o,i,n);this.data[a.id]=a,n.children.splice(t,0,a.id),this.addRedoUndoEntry(),this.setSelectedElement(a)},t.prototype.addSiblingBelow=function(e,t,o,i){this.addSiblingAbove(e,t+1,o,i)},t.prototype.addChild=function(e,t,o){var i=this.createNewElement(t,o,e);e.children=e.children?e.children:[],e.children.unshift(i.id),this.data[i.id]=i,this.setSelectedElement(i),this.addRedoUndoEntry(),this.emit("ondatachanged")},t.prototype.skip=function(e){e.skipped=!e.skipped,this.addRedoUndoEntry(),this.getParent(e)?this.emit("ondatachanged"):e.skipped=!1,this.addRedoUndoEntry()},t.prototype.swap=function(e,t,o){var i=this.getParent(e),n=this.getRoot()===e,a=this.createNewElement(t,o,i);a.parent=void 0===i?void 0:i.id,a.id=e.id,a.children=e.children,a.decorators=e.decorators,this.data[a.id]=a,n&&(this.root=a),this.setSelectedElement(a),this.addRedoUndoEntry(),this.emit("ondatachanged")},t.prototype.moveUp=function(e,t){var o=t-1,i=this.data[e.parent];i.children.splice(t,1),i.children.splice(o,0,e.id),this.addRedoUndoEntry(),this.emit("ondatachanged")},t.prototype.canMoveUp=function(e,t){return 0!==t},t.prototype.isSkipped=function(e){return e.skipped},t.prototype.moveDown=function(e,t){if(this.canMoveDown(e,t)){var o=t+1,i=this.data[e.parent];i.children.splice(t,1),i.children.splice(o,0,e.id),this.emit("ondatachanged")}},t.prototype.canMoveDown=function(e,t){var o=this.data[e.parent];return t<o.children.length-1},t.prototype.moveRow=function(e,t,o){var i=e.parent,n=this.data[i],a=n.children.indexOf(e.id);n.id===t.id&&a<o&&o--,n.children.splice(a,1),t.children=t.children?t.children:[],t.children.splice(o,0,e.id),e.parent=t.id,this.addRedoUndoEntry(),this.emit("ondatachanged")},t.prototype.canPaste=function(){return void 0!==d.default.behaviorData},t.prototype._getTreeRoot=function(e){var t,o=Object.keys(e);if(1===o.length)return e[o[0]];for(var i=0;i<o.length;i++){var n=o[i],a=e[n],r=this.getSchemaByElement(a).type;if("decorator"!==r){t=a;break}}for(;e[t.parent];)t=e[t.parent];return t},t.prototype.paste=function(){if(d.default.behaviorData){var e=JSON.parse(d.default.behaviorData),t=Object.keys(e),o=this.getSchemaByElement(this._getTreeRoot(e)).type;"decorator"!==o?this._pasteBehavior(e):this._pasteDecorator(e,t),this.addRedoUndoEntry()}},t.prototype._pasteBehavior=function(e){var t,o=this.getSchemaByElement(this.selectedElement).type,i=0;"leaf"===o?(t=this.getParent(this.selectedElement),i=t.children.indexOf(this.selectedElement.id)+1):"composite"===o&&(t=this.selectedElement);var n={},a=[];Object.keys(e).forEach(function(t){var o=e[t],i=o.id,r=u.v4();n[i]=r,o.id=r,a.push(o)}),e={},a.forEach(function(t){t.parent=n[t.parent],t.children&&t.children.forEach(function(e,o){t.children[o]=n[e]}),t.decorators&&t.decorators.forEach(function(e,o){t.decorators[o]=n[e]}),e[t.id]=t});for(var r,s=0;s<a.length;s++){var l=a[s],d=this.getSchemaByElement(l).type;if("decorator"!==d){r=l;break}}for(;e[r.parent];)r=e[r.parent];r.parent=t.id,t.children=t.children?t.children:[],t.children.splice(i,0,r.id),Object.assign(this.data,e),this.setSelectedElement(r)},t.prototype.pasteDecorator=function(){if(d.default.behaviorData){var e=JSON.parse(d.default.behaviorData),t=Object.keys(e);1===t.length&&"decorator"===this.getSchemaByElement(e[t[0]]).type&&this._pasteDecorator(e,t)}},t.prototype._pasteDecorator=function(e,t){var o=this.selectedElement;if(void 0!==o){var i=t[0],n=e[i],a=0;o.decorators&&this.selectedDecorator&&(a=o.decorators.indexOf(this.selectedDecorator.id)+1),n.id=u.v4(),o.decorators=o.decorators?o.decorators:[],o.decorators.splice(a,0,n.id),this.data[n.id]=n,this.setSelectedDecorator(n)}},t.prototype.copy=function(){var e=this;if(void 0!==this.selectedElement){for(var t={},o=[this.selectedElement.id],i=function(){var i=o.pop(),a=n.data[i];a.decorators&&a.decorators.forEach(function(o,i){var n=a.decorators[i],r=e.data[n];t[r.id]=r}),t[i]=a,a.children&&(o=o.concat(a.children))},n=this;o.length>0;)i();d.default.behaviorData=JSON.stringify(t)}},t.prototype.copyDecorator=function(){if(void 0!==this.selectedDecorator){var e=this.selectedDecorator.id,t=this.data[e],o={};o[e]=t,d.default.behaviorData=JSON.stringify(o)}},t.prototype.cut=function(){if(void 0!==this.selectedElement){this.copy();var e=this.selectedElement,t=this.data[e.parent],o=t.children.indexOf(e.id),i=t;if(this.deleteRow(e,o),t.children.length>0){o=Math.max(0,o-1);var n=t.children[o];i=this.data[n]}this.addRedoUndoEntry(),this.setSelectedElement(i)}},t.prototype.cutDecorator=function(){if(void 0!==this.selectedDecorator&&void 0!==this.selectedElement){this.copyDecorator();var e=this.selectedDecorator,t=this.selectedElement.decorators.indexOf(e.id);this.addRedoUndoEntry(),this.deleteDecorator(this.selectedElement,t)}},t.prototype.skipDecorator=function(){if(void 0!==this.selectedDecorator&&void 0!==this.selectedElement){var e=this.selectedDecorator;e.skipped=!e.skipped,this.emit("ondatachanged"),this.addRedoUndoEntry()}},t.prototype.up=function(){if(void 0!==this.selectedElement){var e=this.selectedElement,t=this.data[e.parent];if(t){var o=t.children.indexOf(e.id);if(0===o)this.setSelectedElement(t);else{for(o--,e=this.data[t.children[o]];e.children&&0!==e.children.length;)e=this.data[e.children[e.children.length-1]];this.setSelectedElement(e)}this.emit("ondatachanged")}}},t.prototype.upDecorator=function(){if(this.selectedDecorator){var e=this.selectedElement.decorators.indexOf(this.selectedDecorator.id);e>0&&(e--,this.setSelectedDecorator(this.data[this.selectedElement.decorators[e]]),this.emit("ondatachanged"))}},t.prototype.down=function(){if(void 0!==this.selectedElement){var e,t=!1,o=this.selectedElement,i=this.data[o.parent];if(i&&(e=i.children.indexOf(o.id)),o.children&&o.children.length>0)this.setSelectedElement(this.data[o.children[0]]),t=!0;else if(i&&e<i.children.length-1)e++,this.setSelectedElement(this.data[i.children[e]]),t=!0;else for(;i&&this.getParent(i);)if(o=i,i=this.getParent(o),e=i.children.indexOf(o.id),e<i.children.length-1){e++,this.setSelectedElement(this.data[i.children[e]]),t=!0;break}t&&this.emit("ondatachanged")}},t.prototype.downDecorator=function(){if(this.selectedDecorator){var e=this.selectedElement.decorators.indexOf(this.selectedDecorator.id);e<this.selectedElement.decorators.length-1&&(e++,this.setSelectedDecorator(this.data[this.selectedElement.decorators[e]]))}},Object.defineProperty(t.prototype,"behavior",{get:function(){return this.selectedDecorator?this.selectedDecorator:this.selectedElement},enumerable:!0,configurable:!0}),t.prototype.getParent=function(e){var t=e.parent,o=this.data[t];return o},t.prototype.shouldSkip=function(e){return void 0!==e&&(!!e.skipped||this.shouldSkip(this.getParent(e)))},t.prototype.getHeaderLabel=function(e){switch(e){case 0:return"";case 1:return"";case 2:return"Behavior Type";case 3:return"Description"}},t.prototype.getRowCount=function(e){return e.children.length},t.prototype.getColumnCount=function(){return 4},t.prototype.canHaveChildren=function(e){return"composite"===this.getSchemaByElement(e).type},t.prototype.hasChildren=function(e){return e.children&&e.children.length>0},t.prototype.getChildElement=function(e,t){return this.data[e.children[t]]},t.prototype.shouldNotIndent=function(e){return 0===e},t.prototype.getLabel=function(e,t,o,i){var a=this;switch(t){case 0:return String(i);case 1:return"";case 2:var r=[];r.push(e.class),e.decorators&&e.decorators.length>0&&(r.push(" *("),e.decorators.forEach(function(t,o){var i={};a.data[t].skipped&&(i={"font-style":"italic",color:"#555555"}),r.push(p.createElement("span",{style:i},a.data[t].class)),o!==e.decorators.length-1&&r.push(", ")}),r.push(")"));var l="";this.isSelected(e)&&(l="row-selected-text");var d={},c="";"leaf"===this.getSchemaByElement(e).type?(d.className="icon-stack-base fa fa-leaf",c="green"):"composite"===this.getSchemaByElement(e).type&&(d.className="fa fa-sitemap",c="lightblue"),this.shouldSkip(e)&&(d.className="fa fa-eye-slash",c="#555555"),d.style={color:c};var u=this.shouldSkip(e)?{"font-style":"italic",color:"#555555"}:{};return p.createElement("p",{className:l,style:u},p.createElement("i",n({},d))," ",r);case 3:return e===this.description.element?p.createElement(s.default,{content:e.name,onChange:function(e){a.description.newValue=e},width:o,onConfirm:function(){a._setAndClearDescriptionElement(),a.emit("ondatachanged")}}):e.name}},t.prototype.getRoot=function(){return this.root},t}(a.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=m},{"../atom-react/core/react-editor":55,"../common/clipboard":97,"./description-editor":79,"./event-emitter":80,fs:void 0,"node-uuid":void 0,path:void 0,react:void 0,slash:void 0}],86:[function(e,t,o){"use strict";var i=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"TreeViewHeader",onMouseDown:function(e,t){t.preventDefault(),this.props.parentReact.onSeparatorDown(e,t)},render:function(){for(var e=[],t=0;t<this.props.columnWidths.length;t++){var o=this.props.model.getHeaderLabel(t),n=void 0,a={};t<this.props.columnWidths.length-1?(a.width=this.props.columnWidths[t],t>1?n=i.createElement("div",{onMouseDown:this.onMouseDown.bind(this,t),className:"separator"}):a.width=20):(a.width="100%",n=i.createElement("div",null)),e.push(i.createElement("div",{key:t,style:a,className:"cell"},i.createElement("h1",{style:{display:"inline-block"}},o),n))}return i.createElement("div",{className:"row-wrapper-header"},e)}})},{react:void 0}],87:[function(e,t,o){"use strict";var i=e("react"),n=e("./tree-view-row"),a=e("./tree-view-parent"),r=i.createClass({getInitialState:function(){return{isExpanded:!0}},onToggleExpanded:function(){this.state.isExpanded=!this.state.isExpanded,this.setState(this.state)},render:function(){var e=[];if(this.props.showRoot&&e.push(i.createElement(a.default,{row:this.props.row,isRoot:this.props.isRoot,key:0,columnWidths:this.props.columnWidths,element:this.props.element,model:this.props.model,depth:this.props.depth,treeView:this.props.treeView,onToggleExpanded:this.onToggleExpanded,isExpanded:this.state.isExpanded,rowClassName:this.props.rowClassName,isBehavior:this.props.isBehavior})),this.props.model.hasChildren(this.props.element))for(var t=0;t<this.props.model.getRowCount(this.props.element);t++){var o=this.props.model.getChildElement(this.props.element,t);this.props.model.hasChildren(o)?e.push(i.createElement(r,{row:t,key:t+1,showRoot:!0,isHidden:!this.state.isExpanded,columnWidths:this.props.columnWidths,model:this.props.model,element:o,depth:this.props.depth+1,treeView:this.props.treeView,rowClassName:this.props.rowClassName,isBehavior:this.props.isBehavior})):e.push(i.createElement(n.default,{row:t,key:t+1,isHidden:!this.state.isExpanded,columnWidths:this.props.columnWidths,element:o,model:this.props.model,depth:this.props.depth+1,treeView:this.props.treeView,rowClassName:this.props.rowClassName,isBehavior:this.props.isBehavior}))}var s=this.props.isHidden?{display:"none"}:{};return i.createElement("div",{className:"tree-view-level",style:s},e)},getDefaultProps:function(){return{value:"default value"}}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./tree-view-parent":88,"./tree-view-row":90,react:void 0}],88:[function(e,t,o){"use strict";var i=e("./tree-view-row-mixin"),n=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n.createClass({mixins:[i.default],get isParent(){return!0},get doRenderArrow(){return!0},onArrowUp:function(e){e.preventDefault(),this.props.onToggleExpanded()},onArrowOver:function(){this.isSelectable=!1},onArrowOut:function(){this.isSelectable=!0}})},{"./tree-view-row-mixin":89,react:void 0}],89:[function(e,t,o){"use strict";var i=e("react"),n=e("jquery"),a=e("../common/find-node"),r=e("atom"),s=30;Object.defineProperty(o,"__esModule",{value:!0}),o.default={getInitialState:function(){return{}},getLine:function(e){var t=this.props.model.data[e.parent];if(!t)return 1;var o=this.getOlderSibling(e);return o?1+this.getLine(o)+this.getTotalChildren(o):1+this.getLine(t)},getOlderSibling:function(e){var t=this.props.model.data[e.parent];if(t)for(var o=0;o<t.children.length;o++)if(t.children[o]===e.id&&o>0)return this.props.model.data[t.children[o-1]]},getTotalChildren:function(e){var t=this;if(e.children!==[]&&e.children){var o=0;return e.children.forEach(function(e){e=t.props.model.data[e],o+=1+t.getTotalChildren(e)}),o}return 0},getDecoratorLine:function(e){for(var t=this.props.model.owner.decorators,o=0;o<t.length;o++)if(t[o]===e.id)return o+1},render:function(){for(var e=[],t=0;t<this.props.columnWidths.length;t++){var o=s*this.props.depth;this.props.model.shouldNotIndent(t)&&(o=0);var n={width:this.props.columnWidths[t],left:o},a=this.props.model.owner?this.getDecoratorLine(this.props.element):this.getLine(this.props.element),r=this.props.model.getLabel(this.props.element,t,this.props.columnWidths[t]-o-20,a),l={display:"inline-block","font-style":"italic",color:"#555555"},d=this.props.element.skipped?l:{display:"inline-block"},c="";this.props.model.isSelected(this.props.element)&&(c="row-selected-text");var u=null;if(this.doRenderArrow&&1===t){var h="arrow";h+=this.props.isExpanded?" fa fa-caret-down":" fa fa-caret-right",u=i.createElement("i",{className:h,onMouseUp:this.onArrowUp,onMouseOver:this.onArrowOver,onMouseOut:this.onArrowOut})}"string"==typeof r&&(r=i.createElement("p",{className:c,style:d},r)),e.push(i.createElement("div",{key:t,style:n,className:"cell"},u,r))}var p="row-wrapper";p+=" "+this.props.rowClassName,this.props.isRoot||(p+=" row-wrapper-not-root"),this.props.model.isSelected(this.props.element)&&(p+=" row-wrapper-selected"),this.props.model.canHaveChildren(this.props.element)&&(p+=" row-wrapper-parent");var m=this.props.isHidden?{display:"none"}:{},f=this.props.model.canHaveChildren(this.props.element)?null:i.createElement("div",{onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,className:"drop-bar",ref:"dragBar"});return i.createElement("div",{ref:"rowWrapper",draggable:!0,style:m,onClick:this.onClick,onDoubleClick:this.onDoubleClick,onDragStart:this.onDragStart,className:p,onMouseOut:this.onMouseOut,onMouseOver:this.onMouseOver},e,f)},componentDidMount:function(){var e=i.findDOMNode(this.refs.dragBar);e&&(this.onDropSiblingCB=this.onDropBelowSibling.bind(this),e.addEventListener("drop",this.onDropSiblingCB));var t=i.findDOMNode(this.refs.rowWrapper);this.onDropParentCB=this.onDropParent.bind(this),t.addEventListener("drop",this.onDropParentCB),this.disposable=new r.CompositeDisposable,this.disposable.add(atom.commands.add(this.getDOMNode(),{"jibo-sdk:delete-behavior":this.deleteRow,"jibo-sdk:skip-behavior":this.skip})),this.getDOMNode().treeRowView=this},componentWillUnmount:function(){var e=i.findDOMNode(this.refs.dragBar);e&&e.removeEventListener("drop",this.onDropSiblingCB);var t=i.findDOMNode(this.refs.rowWrapper);t.removeEventListener("drop",this.onDropParentDB),this.disposable.dispose()},canMoveUp:function(){return this.props.model.canMoveUp(this.props.element,this.props.row)},canMoveDown:function(){return this.props.model.canMoveDown(this.props.element,this.props.row)},isSkipped:function(){return this.props.model.isSkipped(this.props.element)},skip:function(){return this.props.model.skip(this.props.element)},onDragEnter:function(){var e=n(i.findDOMNode(this.refs.dragBar));e.css("background-color","#93c3cd")},onDragLeave:function(){var e=n(i.findDOMNode(this.refs.dragBar));e.css("background-color","")},onDragStart:function(){this.props.treeView.onDragStart(this.props.element)},onDropParent:function(e){e.preventDefault(),e.stopPropagation(),this.props.model.canHaveChildren(this.props.element)&&this.props.treeView.onDropParent(this.props.element)},onDropBelowSibling:function(e){e.preventDefault(),e.stopPropagation();var t=n(i.findDOMNode(this.refs.dragBar));t.css("background-color",""),this.props.treeView.onDropBelowSibling(this.props.element,this.props.row)},onDoubleClick:function(){this.props.treeView.onRowDoubleClicked(this)},onClick:function(){this.props.treeView.rowSelected(this)},onMouseOver:function(){this.props.treeView.rowHover(this)},onMouseOut:function(){this.props.treeView.rowHoverLeave(this)},deleteRow:function(){this.props.isBehavior?this.props.model.deleteRow(this.props.element,this.props.row):this.props.model.deleteDecorator(this.props.element,this.props.row)}},atom.contextMenu.add({".row-wrapper.behavior":[{label:"Add Decorator",command:"jibo-sdk:add-decorator"},{label:"Swap",command:"jibo-sdk:swap-behavior"}],".row-wrapper-parent":[{label:"Add Child",command:"jibo-sdk:add-child"}],".row-wrapper-not-root":[{label:"Add Sibling Above",command:"jibo-sdk:add-sibling-above"},{label:"Add Sibling Below",command:"jibo-sdk:add-sibling-below"},{label:"Delete",command:"jibo-sdk:delete-behavior"},{label:"Edit Description",command:"jibo-sdk:edit-description"},{type:"separator"},{created:function(e){var t=a.default.getAncestor(e.target,".row-wrapper");t&&t.treeRowView.isSkipped()?this.label="Unskip":this.label="Skip"},command:"jibo-sdk:skip-behavior"},{type:"separator"},{label:"Move Up",command:"jibo-sdk:move-up-behavior",shouldDisplay:function(e){var t=a.default.getAncestor(e.target,".row-wrapper");return t&&t.treeRowView.canMoveUp()}},{label:"Move Down",command:"jibo-sdk:move-down-behavior",shouldDisplay:function(e){var t=a.default.getAncestor(e.target,".row-wrapper");return t&&t.treeRowView.canMoveDown()}},{type:"separator"},{label:"Cut",command:"core:cut"},{label:"Copy",command:"core:copy"}],".row-wrapper-parent:not(.row-wrapper-not-root)":[{label:"Edit Description",command:"jibo-sdk:edit-description"},{type:"separator"},{label:"Copy",command:"core:copy"}],".arguments-scroll-container":[{label:"Paste",command:"core:paste",shouldDisplay:function(){return!0}}]})},{"../common/find-node":99,atom:void 0,jquery:void 0,react:void 0}],90:[function(e,t,o){"use strict";var i=e("./tree-view-row-mixin"),n=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n.createClass({mixins:[i.default],get isParent(){return!1},get doRenderArrow(){return!1}})},{"./tree-view-row-mixin":89,react:void 0}],91:[function(e,t,o){"use strict";var i=e("react"),n=e("./tree-view-level"),a=e("./tree-view-header"),r=e("../common/listen"),s=e("atom");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"TreeView",getInitialState:function(){for(var e=this.props.model.getColumnCount(),t=[20,20],o=0;o<e-1;o++)t.push(300);return{columnWidths:t}},onSeparatorDown:function(e,t){var o=this,i=t.nativeEvent.clientX,n=this.state.columnWidths[e],a=[r.default(document.body,"mouseup",function(){a.forEach(function(e){e.dispose()})}),r.default(document.body,"mousemove",function(t){var a=t.clientX-i;o.state.columnWidths[e]=n+a,o.setState(o.state)})]},onDragStart:function(e){this.state.dragElement=e},isValidDrop:function(e,t){for(var o=this.props.model;t;){if(e===t)return!1;t=o.getParent(t)}return!0},onDropParent:function(e){this.isValidDrop(this.state.dragElement,e)&&this.props.model.moveRow(this.state.dragElement,e,0)},onDropBelowSibling:function(e,t){var o=this.props.model.getParent(e);this.isValidDrop(this.state.dragElement,e)&&this.props.model.moveRow(this.state.dragElement,o,t+1)},onRowDoubleClicked:function(e){this.props.onRowDoubleClicked(e)},rowSelected:function(e){this.selectedRow&&this.selectedRow.setState(this.selectedRow.state),this.selectedRow=e,this.selectedRow.setState(this.selectedRow.state),this.props.onRowSelected(e.props.element)},rowHover:function(e){this.props.onRowHover(e)},rowHoverLeave:function(e){this.props.onRowHoverLeave(e)},up:function(){this.props.model.up()},down:function(){this.props.model.down()},cut:function(){this.props.model.cut()},copy:function(){this.props.model.copy()},paste:function(){this.props.model.paste()},skip:function(){this.props.model.model?this.props.model.skip(this.props.model.model.selectedDecorator):this.props.model.skip(this.props.model.selectedElement)},delete:function(){var e=this.selectedRow.props.row;if(this.props.model.model){var t=this.props.model.model.selectedDecorator;this.props.model.deleteRow(t,e)}else{var t=this.props.model.selectedElement;this.props.model.deleteRow(t,e)}},render:function(){for(var e=this.props.width,t=0;t<this.state.columnWidths.length-1;t++)e-=this.state.columnWidths[t];return this.state.columnWidths[this.state.columnWidths.length-1]=e,this.state.element=this.props.model.getRoot(),i.createElement("div",{className:"tree-grid-view",tabIndex:0},i.createElement(a.default,{parentReact:this,model:this.props.model,columnWidths:this.state.columnWidths}),i.createElement("div",{className:"arguments-scroll-container"},i.createElement(n.default,{row:0,showRoot:this.props.showRoot,columnWidths:this.state.columnWidths,model:this.props.model,element:this.state.element,depth:0,treeView:this,isRoot:!0,rowClassName:this.props.rowClassName,isBehavior:this.props.isBehavior})))},componentDidMount:function(){this.disposable=new s.CompositeDisposable,this.disposable.add(atom.commands.add(this.getDOMNode(),{"jibo-sdk:up":this.up,"jibo-sdk:down":this.down,"core:cut":this.cut,"core:copy":this.copy,"core:paste":this.paste,"jibo-sdk:skip-selected":this.skip,"jibo-sdk:delete-bt-elem":this.delete}))},componentWillUnmount:function(){this.disposable.dispose()}})},{"../common/listen":106,"./tree-view-header":86,"./tree-view-level":87,atom:void 0,react:void 0}],92:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("../atom-react/core/react-pane"),a=e("./cheat-sheet-view"),r=function(e){function t(t,o){var i=e.call(this,"CheatSheetTab",t,o,"Jibo Cheat Sheet")||this,n=i.getUiState();return i.layout=n?n:[],i}return i(t,e),t.prototype.getReactClass=function(){return a.default},t}(n.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"../atom-react/core/react-pane":56,"./cheat-sheet-view":93}],93:[function(e,t,o){"use strict";var i=e("react"),n=e("fs"),a=e("marked"),r=e("../get-base-path");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({render:function(){var e=n.readFileSync(r.default("resources/docs","cheat-sheet.md"),"utf8"),t=a(e,{sanitize:!0}),o={margin:20};return i.createElement("div",{style:o,dangerouslySetInnerHTML:{__html:t}})}})},{"../get-base-path":128,fs:void 0,marked:void 0,react:void 0}],94:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("./animation");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n.createClass({getInitialState:function(){return{}},render:function(){return n.createElement("div",i({ref:"container"},{style:this.props.style}))},componentWillReceiveProps:function(e){this.nextProps=e,this.animation.initialized?this.playAnimation(e.uri):this.animation.on("init",this.onNextPropsInit)},playAnimation:function(e){var t=n.findDOMNode(this.refs.container);this.animation.attach(t),this.animation.createAnimation(e,function(e){e&&e.play()})},onNextPropsInit:function(){this.playAnimation(this.nextProps.uri)},onInit:function(){this.playAnimation(this.props.uri)},componentDidMount:function(){this.animation=new a.default,this.animation.on("init",this.onInit),this.animation.init()},componentWillUnmount:function(){this.animation.detach()}})},{"./animation":95,react:void 0}],95:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("path"),a=e("animation-utilities"),r=e("events"),s=e("jibo-keyframes"),l=e("../../atom-react/core/react-editor"),d=function(e){function t(){var t=e.call(this)||this;return t.config=new a.JiboConfig,t.initialized=!1,t}return i(t,e),t.prototype.createNewRenderer=function(e){var t=this;a.visualize.createRobotRenderer(this.robotInfo,null,a.visualize.DisplayType.BODY,function(o){o&&(o.setBackgroundColor(63/255,169/255,245/255),a.TimelineBuilder.connectRenderer(t.timeline,o),e(o))})},t.prototype.attach=function(e){this.renderer.attachToContainer(e)},t.prototype.init=function(){var e=this;a.RobotInfo.createInfo(this.config,function(t){a.TimelineBuilder.createTimeline(t,function(o){e.timeline=o,e.robotInfo=t,e.factory=a.animate.createAnimationUtilities(o,t),e.factory.setDefaultTransition(null),e.createNewRenderer(function(t){e.renderer=t,a.TimelineBuilder.connectRenderer(o,t),e.initialized=!0,e.emit("init")})})})},t.prototype.createAnimation=function(e,t){var o=this,i=n.extname(e);if(".anim"===i)this.factory.createAnimationBuilder(e,function(e){t(e)},!0);else if(".keys"===i){var a=l.default.getProjectRoot(e);s.keysToAnimObjectAsync(e,function(e){var i=null;e&&(i=o.factory.createAnimationBuilderFromData(e,a)),t(i)})}},t.prototype.detach=function(){this.renderer&&this.renderer.detachFromContainer()},t}(r.EventEmitter);Object.defineProperty(o,"__esModule",{value:!0}),o.default=d},{"../../atom-react/core/react-editor":55,"animation-utilities":void 0,events:void 0,"jibo-keyframes":void 0,path:void 0}],96:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("atom");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n.createClass({getDefaultProps:function(){return{content:"",placeholderText:"",className:"",advanced:{},onChange:null}},render:function(){var e=this.props,t={className:e.className,tabIndex:e.tabIndex,style:e.style||{},onBlur:e.onBlur};e.placeholderText&&(t["placeholder-text"]=e.placeholderText),e.mini&&(t.mini=!0),e.hideGutter&&(t["gutter-hidden"]=!0);var o=n.createElement("atom-text-editor",i({ref:"editor"},t));return o},componentWillReceiveProps:function(e){var t=n.findDOMNode(this.refs.editor);t.onBlur=e.onBlur;var o=t.getModel();o.getText()!==e.content&&(this.ignoreNextChange=!0,o.setText(e.content||""))},componentDidMount:function(){var e=this,t=this.props,o=n.findDOMNode(this.refs.editor),i=o.getModel();if(this.ignoreNextChange=!0,i.setText(t.content||""),this.disposable=new a.CompositeDisposable,this.disposable.add(i.onDidStopChanging(function(){return e.ignoreNextChange?void(e.ignoreNextChange=!1):void(e.props.onDidStopChanging&&e.props.onDidStopChanging(i.getText()))})),this.disposable.add(i.onDidChange(function(t){e.ignoreNextChange||e.props.onDidChange&&e.props.onDidChange(i.getText())})),this.props.onConfirm&&this.disposable.add(atom.commands.add(o,"core:confirm",function(){e.props.onConfirm&&e.props.onConfirm()})),t.tooltip&&this.disposable.add(atom.tooltips.add(o,t.tooltip)),t.grammar){var r=atom.grammars.getGrammars();1===r.length?this.disposable.add(atom.grammars.onDidAddGrammar(function(o){o.scopeName===t.grammar&&(i.setGrammar(o),e.applyAdvancedSettings())})):(i.setGrammar(atom.grammars.grammarForScopeName(t.grammar)),this.applyAdvancedSettings())}else this.applyAdvancedSettings()},applyAdvancedSettings:function(){var e=this.props,t=n.findDOMNode(this.refs.editor),o=t.getModel();e.advanced.hasOwnProperty("softWrap")&&o.setSoftWrapped(e.advanced.softWrap),e.advanced.hasOwnProperty("hideInvisibles")&&setTimeout(function(){o.update({showInvisibles:e.advanced.hideInvisibles})},0)},componentWillUnmount:function(){this.disposable&&this.disposable.dispose()},getText:function(){var e=n.findDOMNode(this.refs.editor);return e.getModel().getText()},setText:function(e){var t=n.findDOMNode(this.refs.editor);this.ignoreNextChange=!0,t.getModel().setText(e||"")},focus:function(){var e=n.findDOMNode(this.refs.editor);e.focus()},blur:function(){var e=n.findDOMNode(this.refs.editor);e.blur()},getDOM:function(){return n.findDOMNode(this.refs.editor)}})},{atom:void 0,react:void 0}],97:[function(e,t,o){"use strict";var i=function(){function e(){}return e.prototype.clear=function(){this._behaviorData=void 0,this._animationData=void 0},Object.defineProperty(e.prototype,"behaviorData",{get:function(){return this._behaviorData},set:function(e){this.clear(),this._behaviorData=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animationData",{get:function(){return this._animationData},set:function(e){this.clear(),this._animationData=e},enumerable:!0,configurable:!0}),e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=new i},{}],98:[function(e,t,o){"use strict";var i=e("path"),n=e("fs"),a=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=a.createClass({propTypes:{uri:a.PropTypes.string.isRequired,extension:a.PropTypes.string.isRequired,selected:a.PropTypes.string},getInitialState:function(){return{selectedItem:this.props.selected,collapsedDirectoried:{}}},uriContains:function(e,t){var o=n.readFileSync(e,"utf8");return o.search(RegExp(t))>=0},createFile:function(e){var t=i.parse(e).base;if(this.props.filter&&!t.toLowerCase().includes(this.props.filter.toLowerCase()))return null;if(this.props.contentFilter&&!this.uriContains(e,this.props.contentFilter))return null;var o=this.state.selectedItem===e?"list-item selected-item":"list-item";return a.createElement("ul",{className:"list-tree"},a.createElement("li",{onClick:this.onSelected.bind(this,e),onDoubleClick:this.onChosen.bind(this,e),className:o},a.createElement("span",{className:"icon icon-file-text"},t)))},onSelected:function(e){this.props.onSelected(e),this.state.selectedItem=e,this.setState(this.state)},onChosen:function(e){this.state.selectedItem=e,this.setState(this.state),this.props.onChosen(e)},onCollapsed:function(e){this.state.collapsedDirectoried[e]?delete this.state.collapsedDirectoried[e]:this.state.collapsedDirectoried[e]=!0,this.setState(this.state)},createDirectory:function(e,t,o){var r=this;void 0===t&&(t=!1),void 0===o&&(o=!1);var s=i.parse(e).base;if(".git"===s||"node_modules"===s)return null;var l=n.readdirSync(e),d=[];if(l.forEach(function(t){var a=i.resolve(e,t),s=n.lstatSync(a);if(s.isDirectory())d.push(r.createDirectory(a,!1,o));else if(r.props.extension instanceof Array)for(var l=0;l<r.props.extension.length;l++){var c=r.props.extension[l];if(i.extname(t)===c.toLowerCase()){
d.push(r.createFile(a));break}}else r.props.extension&&i.extname(t)===r.props.extension.toLowerCase()&&d.push(r.createFile(a))}),o&&!t){for(var c=!0,u=0;u<d.length;++u)if(d[u]){c=!1;break}if(c)return null}var h=this.state.collapsedDirectoried[e]?"list-nested-item collapsed":"list-nested-item";return t?a.createElement("ul",{className:"list-group"},d):a.createElement("ul",{className:"list-tree has-collapsable-children"},a.createElement("li",{className:h},a.createElement("div",{onClick:this.onCollapsed.bind(this,e),className:"list-item"},a.createElement("span",{className:"icon icon-file-directory"},s)),d))},render:function(){var e=null;try{n.statSync(this.props.uri),e=this.createDirectory(this.props.uri,!0,!!this.props.hideEmpty)}catch(t){e=null}return a.createElement("div",{className:"jibo-list-tree"},e)}})},{fs:void 0,path:void 0,react:void 0}],99:[function(e,t,o){"use strict";function i(e,t){if(!e||!e.nodeType||"string"!=typeof t)return null;t=t.split("."),1===t.length?t.push(null):t[0]||(t[0]=null);do{if(!t[0]&&!t[1])break;var o=!t[0]||t[0].toLowerCase()===e.nodeName.toLowerCase(),i=!t[1]||e.className.toLowerCase().search(t[1].toLowerCase())!==-1;if(o&&i)break;e=e.parentNode}while(e);return e}Object.defineProperty(o,"__esModule",{value:!0}),o.default={getAncestor:i}},{}],100:[function(e,t,o){"use strict";function i(e,t){if(void 0===t&&(t=""),""===e)return"";var o=e.split("/");if("node_modules"===o[0]){var i=o[1],n=d.join("node_modules",i,t);return n=c(d.relative(n,e)),i+"://"+n}var n=d.normalize(t);return n=d.relative(n,e),c(n)}function n(e,t){void 0===t&&(t="");var o=e.split("://");if(1===o.length){var i=d.join(t,e);return c(i)}if(2===o.length){var i=d.join("node_modules",o[0],t,o[1]);return c(i)}return""}function a(e){for(var t=r(e),o={},i=0,n=t;i<n.length;i++){var a=n[i];o[a.id]=a}return o}function r(t){var o=[],i=s.default.getProjectRoot(t);i||(i=s.default.getProjectRoot("")),o.push({root:i,id:"project",name:"Project"});for(var n=d.resolve(i,"node_modules"),a=l.readdirSync(n),r=0;r<a.length;r++){var c=void 0;try{c=e(d.resolve(n,a[r],"package.json"))}catch(e){continue}if(c.jibo&&"asset-pack"===c.jibo.type){var u=d.resolve(n,a[r]);o.push({root:u,id:c.name,name:c.jibo["display-name"]})}}return o}var s=e("../atom-react/core/react-editor"),l=e("fs"),d=e("path"),c=e("normalize-path");o.relativeUriToAssetPackUri=i,o.assetPackUriToRelativeUri=n,o.getAssetPackDictionary=a,o.getAssetPacks=r,Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"../atom-react/core/react-editor":55,fs:void 0,"normalize-path":void 0,path:void 0}],101:[function(e,t,o){"use strict";function i(){var e=a.default.getFilePathOfSelection();return e?(r=!1,void atom.workspace.open(e)):void alert("Can't Open Folders as JSON")}function n(){var e=r;return r=!0,e}var a=e("./tree-view-helper"),r=!0;Object.defineProperty(o,"__esModule",{value:!0}),o.default={open:i,useDefaultEditor:n}},{"./tree-view-helper":109}],102:[function(e,t,o){"use strict";function i(){return{handleSize:8,propTypes:{onLayoutResize:n.PropTypes.func},getDefaultProps:function(){return{supportedChildren:{HLayout:!0,VLayout:!0,TreeView:!0,"layout-child":!0}}},handleResize:function(){this.forceUpdate()},getInitialState:function(){var e=this.props.serialized,t=[];if(e.length>0)for(var o=0;o<e.length;o++)t[o]=e[o].size;else if(Array.isArray(this.props.children))for(var i=this.props.children.length,n=this.handleSize*(i-1),a=this.getSize()-n,o=0;o<i;o++){var r=a/i;this.props.serialized[o]={size:r,children:[]},t.push(r)}else{var r=this.getSize();this.props.serialized[0]={size:r,children:[]},t.push(r)}return{sizes:t,serialized:this.props.serialized}},componentDidMount:function(){},onMouseMove:function(e,t){t.preventDefault(),t.stopPropagation();var o=this.getEventPosition(t)-this.start,i=this.startSizes[0]+this.startSizes[1];this.state.sizes[e]=s(this.startSizes[0]+o,0,i),this.state.sizes[e+1]=s(this.startSizes[1]-o,0,i),this.state.serialized[e].size=this.state.sizes[e],this.state.serialized[e+1].size=this.state.sizes[e+1],this.props.onLayoutResize&&this.props.onLayoutResize(this.state.sizes),this.setState(this.state)},onMouseUp:function(){this.state.disposables.forEach(function(e){e.dispose()});for(var e=document.getElementsByClassName("animation-preview"),t=0;t<e.length;t++)e[t].style.pointerEvents=""},onHandleDown:function(e,t){var o=this;if(1===t.nativeEvent.which){t.nativeEvent.preventDefault(),this.start=this.getEventPosition(t.nativeEvent),this.startSizes=[this.state.sizes[e],this.state.sizes[e+1]],this.state.disposables=[a.default(document.body,"mouseup",this.onMouseUp),a.default(document.body,"mousemove",function(t){o.onMouseMove(e,t)})];for(var i=document.getElementsByClassName("animation-preview"),n=0;n<i.length;n++)i[n].style.pointerEvents="none"}},render:function(){for(var e=this,t=this.props.children.slice(),o=this.state.sizes.reduce(function(e,t){return e+t},0),i=this.handleSize*(t.length-1),a=(this.getSize()-i)/o,s=0;s<this.state.sizes.length;s++)this.state.sizes[s]*=a;for(var l=0,s=0;s<t.length;s++){var d=t[s],c=this.state.sizes[s];if(d&&d.type&&this.props.supportedChildren[d.type.displayName]){var u=this.getProps(c,this.props.width,this.props.height);"HLayout"!==d.type.displayName&&"VLayout"!==d.type.displayName||(u.serialized=this.state.serialized[s].children),d=r(d,u)}t[s]=n.createElement("div",{key:l++,className:this.getContainerClass(),style:this.getProps(c,this.props.width,c,this.props.height)},d)}var h=[];return t.forEach(function(o,i){h.push(o),i<t.length-1&&h.push(n.createElement("div",{key:l++,className:"layout-handle",onMouseDown:function(t){e.onHandleDown(i,t)},style:e.getHandleStyle()}))}),n.createElement("div",{className:this.getLayoutClass()},h)}}}var n=e("react"),a=e("../listen"),r=e("react/lib/cloneWithProps"),s=e("clamp");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../listen":106,clamp:void 0,react:void 0,"react/lib/cloneWithProps":void 0}],103:[function(e,t,o){"use strict";var i=e("react"),n=e("./abstract-layout"),a=function(){return{getContainerClass:function(){return"h-child-container"},getLayoutClass:function(){return"h-layout"},getSize:function(){return this.props.width},getProps:function(e){return{width:e,height:this.props.height}},getEventPosition:function(e){return e.clientX},getHandleStyle:function(){return{float:"left",width:this.handleSize,height:this.props.height,cursor:"ew-resize"}},displayName:"HLayout"}};Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass(Object.assign(n.default(),a()))},{"./abstract-layout":102,react:void 0}],104:[function(e,t,o){"use strict";var i=e("react"),n=e("react/lib/cloneWithProps");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"VLayout",getInitialState:function(){return{serialized:this.props.serialized}},propTypes:{width:i.PropTypes.number.isRequired,height:i.PropTypes.number.isRequired},render:function(){var e=this.props.children;return"VLayout"!==e.type.displayName&&"HLayout"!==e.type.displayName||(e=n(e,{height:this.props.height,width:this.props.width,serialized:this.state.serialized})),i.createElement("div",{className:"layout"},e)}})},{react:void 0,"react/lib/cloneWithProps":void 0}],105:[function(e,t,o){"use strict";var i=e("react"),n=e("./abstract-layout"),a=function(){return{getContainerClass:function(){return"v-child-container"},getLayoutClass:function(){return"layout"},getSize:function(){return this.props.height},getProps:function(e){return{width:this.props.width,height:e}},getEventPosition:function(e){return e.clientY},getHandleStyle:function(){return{width:"100%",height:this.handleSize,cursor:"ns-resize"}},displayName:"VLayout"}};Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass(Object.assign(n.default(),a()))},{"./abstract-layout":102,react:void 0}],106:[function(e,t,o){"use strict";function i(e,t,o){var i=n.isFunction(e.on)?e.on:e.addEventListener;return i.apply(e,[t,o]),{dispose:function(){var i=n.isFunction(e.off)?e.off:e.removeEventListener;i.apply(e,[t,o])}}}var n=e("jquery");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{jquery:void 0}],107:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=e("../directory-tree-view"),r=e("../animation/animation-visualizer"),s=e("path"),l=e("../get-asset-packs"),d=e("fs"),c=e("isbinaryfile"),u=e("../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({onChoose:function(){var e=this.state.currentAssetPack,t=this.props.settings.restrictPath||"",o=s.join(e.root,t),i=s.relative(o,this.state.currentFile);i="project"===this.state.currentAssetPack.id?s.join(t,i):s.join("node_modules",this.state.currentAssetPack.id,t,i);var n=i;this.props.settings.uriFilter&&(n=this.props.settings.uriFilter(i,o)),this.props.onChoose(n,l.relativeUriToAssetPackUri(i,t)),this.props.onClose()},onCancel:function(){this.props.onCancel&&this.props.onCancel(),this.props.onClose()},getDefaultProps:function(){return{root:"",uri:"",settings:{restrictPath:"",extensions:[],fileTypeName:null,previewType:null},onChoose:null,onClose:null}},getInitialState:function(){var e="project",t=void 0,o=this.props.uri;if(o.indexOf("://")>0){var i=this.props.uri.split("://");e=i[0],t=s.resolve(this.props.root,"node_modules",i[0]),o=s.resolve(this.props.root,l.assetPackUriToRelativeUri(o,this.props.settings.restrictPath||""))}else{var i=s.relative(this.props.root,o).split(s.sep);"node_modules"===i[0]&&(e=i[1],t=s.resolve(this.props.root,i[0],i[1]),o=s.resolve(this.props.root,o))}return{currentAssetPack:{id:e,root:t},currentFile:o,filter:"",key:0}},onAssetPackSelected:function(e){this.setState({currentAssetPack:e})},onSelected:function(e){this.setState({currentFile:e})},getPanelHeading:function(e){return i.createElement("div",{className:"panel-heading",style:{padding:"0px",width:"100%",height:30}},i.createElement("p",{style:{textAlign:"center",marginTop:"4px",marginBottom:"4px"}},e))},getPreview:function(){var e=this,t=function(t){return i.createElement("div",{className:"preview-contents"},e.getPanelHeading("Preview"),i.createElement("div",{className:"asset-preview"},t))},o=null,n=this.props.settings.previewType;if(n){switch(n){case"text":var a="";if(this.state.currentFile)try{if(c.sync(this.state.currentFile))return t("No Preview Available");a=d.readFileSync(this.state.currentFile,"utf8")}catch(e){}o=i.createElement("pre",null,a);break;case"image":o=i.createElement("img",{key:this.state.key++,controls:!0,style:{width:"100%",padding:15},src:this.state.currentFile});break;case"audio":o=i.createElement("audio",{key:this.state.key++,controls:!0,style:{width:"100%",marginTop:"auto",marginBottom:"auto"}},i.createElement("source",{src:this.state.currentFile,type:"audio/mpeg"}));break;case"jiboAnim":o=i.createElement(r.default,{uri:this.state.currentFile,style:{width:"100%",height:"100%"}});break;default:o="No Preview Available"}o=t(o)}return o},render:function(){for(var e,t=this,o=l.default(this.props.root),n=[],r=0;r<o.length;r++){var d=o[r],c="list-item";this.state.currentAssetPack.id===d.id&&(this.state.currentAssetPack=d,e=d,c+=" selected"),n.push(i.createElement("li",{className:c,onClick:this.onAssetPackSelected.bind(this,d)},i.createElement("span",null,d.name)))}var h=this.props.settings;return i.createElement("div",{className:"asset-selector-modal",style:h.previewType?{}:{width:480,marginLeft:"auto",marginRight:"auto"},ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},h.fileTypeName?"Choose a "+h.fileTypeName:"Choose a File")),i.createElement("label",{style:{marginLeft:10}},"Search"),i.createElement(u.default,{ref:"editor",style:{marginLeft:10,marginRight:10,marginBottom:10},mini:!0,content:this.state.filter,onDidChange:function(e){t.setState({filter:e})}}),i.createElement("div",{className:"contents"},i.createElement("div",{className:"list-contents"},this.getPanelHeading("Asset Pack"),i.createElement("div",{className:"list-group asset-pack",ref:"assetPackList"},n)),i.createElement("div",{className:"list-contents"},this.getPanelHeading(h.fileTypeName||"File"),i.createElement("div",{className:"asset-list"},i.createElement(a.default,{uri:s.resolve(e.root,h.restrictPath||""),selected:this.state.currentFile,onChosen:function(e){t.onSelected(e),t.onChoose()},onSelected:this.onSelected,extension:h.extensions,filter:this.state.filter,contentFilter:h.contentFilter,hideEmpty:!0}))),this.getPreview()),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onChoose},"Choose"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},onLeft:function(){var e=i.findDOMNode(this.refs.assetPackList);e.focus()},onRight:function(){var e=i.findDOMNode(this.refs.schemaList);e.focus()},componentDidMount:function(){var e=this,t=this.refs.editor;setTimeout(function(){t.focus(),e.getDOMNode().setAttribute("tabIndex","0"),e.disposable=new n.CompositeDisposable,e.disposable.add(atom.commands.add(e.getDOMNode(),{"jibo-sdk:escape":e.onCancel,"jibo-sdk:confirm":e.onChoose}))},100)},componentWillUnmount:function(){this.disposable.dispose()}}),o.RuleSettings={extensions:[".grm",".fst",".rule",".nli"],previewType:"text",previewGrammar:"source.rule",fileTypeName:"Rule"},o.AudioSettings={extensions:[".mp3",".wav",".m4a"],previewType:"audio",fileTypeName:"Audio File"},o.TextureSettings={extensions:[".png",".jpg",".jpeg"],previewType:"image",fileTypeName:"Texture File"},o.ImageSettings={extensions:[".png",".jpg",".jpeg",".gif"],previewType:"image",fileTypeName:"Image"},o.AnimationSettings={extensions:[".keys",".anim"],previewType:"jiboAnim",fileTypeName:"Animation"},o.JsonSettings={extensions:[".json"],previewType:"text",previewGrammar:"source.json",fileTypeName:"JSON File"},o.ViewConfigSettings={extensions:[".json"],previewType:"text",previewGrammar:"source.json",fileTypeName:"View Config File",contentFilter:/\"viewConfig\":/},o.MimSettings={extensions:[".mim"],previewType:"text",fileTypeName:"Mim"},o.BTSettings={extensions:[".bt"],previewType:null,fileTypeName:"Behavior Tree",uriFilter:function(e,t){return s.resolve(t,e)}}},{"../../common/atom-editor":96,"../animation/animation-visualizer":94,"../directory-tree-view":98,"../get-asset-packs":100,atom:void 0,fs:void 0,isbinaryfile:void 0,path:void 0,react:void 0}],108:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=e("../../common/directory-tree-view"),r=e("path"),s=e("normalize-path"),l=e("../../common/get-asset-packs"),d=e("module"),c=e("../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({onChoose:function(){var e=this.state.currentAssetPack,t=r.join(e.root,"timelines"),o=r.relative(t,this.state.currentPixi);o=s(o),"project"!==this.state.currentAssetPack.id&&(o=e.id+"://"+o),this.props.onChoose(o),this.props.onClose()},onCancel:function(){this.props.onClose()},getInitialState:function(){return{currentAssetPack:{id:"project"},currentPixi:"",filter:"",key:0}},onAssetPackSelected:function(e){this.setState({currentAssetPack:e})},onSelected:function(e){var t=this;this.instance&&(this.stage.removeChild(this.instance),this.instance=null);try{var o=this.requireAnimate(e);if(o.stage){var i=r.dirname(e);PIXI.animate.load(o.stage,this.stage,function(e){t.instance=e},i)}}catch(e){console.warn("Invalid pixi file",e)}this.setState({currentPixi:e})},getPanelHeading:function(e){return i.createElement("div",{className:"panel-heading",style:{padding:"0px",width:"100%",height:30}},i.createElement("p",{style:{textAlign:"center",marginTop:"4px",marginBottom:"4px"}},e))},render:function(){for(var e,t=this,o=l.default(this.props.root),n=[],s=0;s<o.length;s++){var d=o[s],u="list-item";this.state.currentAssetPack.id===d.id&&(this.state.currentAssetPack=d,e=d,u+=" selected"),n.push(i.createElement("li",{className:u,onClick:this.onAssetPackSelected.bind(this,d)},i.createElement("span",null,d.name)))}return i.createElement("div",{className:"asset-selector-modal",ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Choose a Pixi File")),i.createElement("label",{style:{marginLeft:10}},"Search"),i.createElement(c.default,{ref:"editor",style:{marginLeft:10,marginRight:10,marginBottom:10},mini:!0,content:this.state.filter,onDidChange:function(e){t.setState({filter:e})}}),i.createElement("div",{className:"contents"},i.createElement("div",{className:"list-contents"},this.getPanelHeading("Asset Pack"),i.createElement("div",{className:"list-group asset-pack",ref:"assetPackList"},n)),i.createElement("div",{className:"list-contents"},this.getPanelHeading("Pixi Animate File"),i.createElement("div",{className:"asset-list"},i.createElement(a.default,{uri:r.resolve(e.root,"timelines"),onChosen:function(e){t.onSelected(e),t.onChoose()},onSelected:this.onSelected,extension:[".js"],filter:this.state.filter,hideEmpty:!0}))),i.createElement("div",{className:"preview-contents"},this.getPanelHeading("Preview"),i.createElement("div",{ref:"container",className:"asset-preview"},i.createElement("canvas",{ref:"stage",style:{width:"100%"}})))),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onChoose},"Choose"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},onLeft:function(){var e=i.findDOMNode(this.refs.assetPackList);e.focus()},onRight:function(){var e=i.findDOMNode(this.refs.schemaList);e.focus()},requireAnimate:function(e){var o=new d(e,t);return o.load(e),o.exports},update:function(){this.renderer.render(this.stage),this.doUpdate&&requestAnimationFrame(this.update)},componentDidMount:function(){var e=this,t=i.findDOMNode(this.refs.stage);this.renderer=PIXI.autoDetectRenderer(1280,720,{view:i.findDOMNode(this.refs.stage),backgroundColor:0,antialias:!0,autoResize:!0}),t.style.width="100%",t.style.height="",this.stage=new PIXI.Container,this.doUpdate=!0,this.update();var o=this.refs.editor;setTimeout(function(){o.focus(),e.getDOMNode().setAttribute("tabIndex",0),e.disposable=new n.CompositeDisposable,e.disposable.add(atom.commands.add(e.getDOMNode(),{"jibo-sdk:escape":e.onCancel,"jibo-sdk:confirm":e.onChoose}))},100)},componentWillUnmount:function(){this.doUpdate=!1,this.disposable.dispose()}})},{"../../common/atom-editor":96,"../../common/directory-tree-view":98,"../../common/get-asset-packs":100,atom:void 0,module:void 0,"normalize-path":void 0,path:void 0,react:void 0}],109:[function(e,t,o){"use strict";var i=e("jquery"),n=e("path"),a=e("../atom-react/core/react-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default={getFilePathOfSelection:function(){var e=i(".tree-view-scroller .file.entry.list-item.selected > span");if(1!==e.length)return null;var t=e[0].getAttribute("data-path");return t?t:null},getFolderPathOfSelection:function(){var e=this.getFilePathOfSelection();if(e)return n.dirname(e);var t=i(".tree-view-scroller .directory.selected > .list-item > span.icon");if(1!==t.length)return null;var o=t[0].getAttribute("data-path");return o?o:null},getFolderPathWithDirectory:function(e,t){e&&(e=n.normalize(e));var o=n.normalize("/"+t+"/");if(e)e.includes(o)||(e=n.resolve(a.default.getProjectRoot(e),t));else{var i=a.default.getProjectRoot("");if(!i)return null;e=n.resolve(i,t)}return e}}},{"../atom-react/core/react-editor":55,jquery:void 0,path:void 0}],110:[function(e,t,o){"use strict";var i=e("crypto"),n=function(){function e(e,t){this.model=e,this.debugMode=t,this.debugMode=t,this.model=e;var o=[],i=[];this.undoStack=o,this.redoStack=i;var n=e.getMutationFunctionNames(),a=this.copy;this.latestHash="";var r=this;n.forEach(function(n){var s=e[n];e[n]=function(){s.apply(e,arguments);var n=a(e.getData());r.hashData(n),o[o.length-1]!==n&&(t&&(console.log("added entry"),console.log(JSON.stringify(e.getData(),null,"\t"))),o.push(n),this.emit("ondatachanged")),i.length=0}});var s=a(e.getData());o.push(s),this.hashData(s)}return e.prototype.restore=function(){this.undoStack.length>0&&this.model.reload(JSON.parse(this.undoStack[this.undoStack.length-1]))},e.prototype.undo=function(){if(this.undoStack.length>1){var e=this.undoStack.pop();this.redoStack.push(e);var t=JSON.parse(this.undoStack[this.undoStack.length-1]);this.hashData(this.undoStack[this.undoStack.length-1]),this.model.reload(t),this.debugMode&&(console.log("undone"),console.log(JSON.stringify(t,null,"\t"))),this.model.emit("ondatachanged")}},e.prototype.redo=function(){if(this.redoStack.length>0){var e=this.redoStack.pop();this.undoStack.push(e),this.hashData(e);var t=JSON.parse(e);this.model.reload(t),this.debugMode&&(console.log("redone"),console.log(JSON.stringify(t,null,"\t"))),this.model.emit("ondatachanged")}},e.prototype.hashData=function(e){if(void 0!==e){var t=i.createHash("sha1");t.update(e),this.latestHash=t.digest("hex")}},e.prototype.isSame=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},e.prototype.copy=function(e){return JSON.stringify(e)},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{crypto:void 0}],111:[function(e,t,o){"use strict";var i=e("./subflow-view"),n=e("./picture-view");Object.defineProperty(o,"__esModule",{value:!0}),o.default={subflow:i.default,image:n.default}},{"./picture-view":112,"./subflow-view":113}],112:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("../../atom-react/mixins/modal-mixin"),r=e("path"),s=e("fs"),l=e("mkdirp"),d=e("../../common/modals/choose-file-modal"),c=e("../../common/atom-editor"),u=n.createClass({mixins:[a.default],getInitialState:function(){return{key:0,content:this.props.content}},render:function(){var e=this,t={};try{var o=this.getUri();if(!o.startsWith("http")){var a=s.statSync(this.getUri()).isFile();a||(t.disabled=!0)}}catch(e){t={disabled:!0}}var r=t.disabled?n.createElement("div",{className:"error-messages"},"No image by that name"):null;return n.createElement("div",{style:{width:"100%"}},n.createElement("div",{className:"block"},n.createElement("div",{className:"fileBlock"},n.createElement("button",{style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),n.createElement(c.default,{ref:"editor",mini:!0,content:this.state.content,onDidChange:function(t){e.state.content=t,e.props.onChange(t),e.setState(e.state)}})),r,n.createElement("div",{className:"btn-group",style:{marginTop:5}},n.createElement("button",i({},t,{className:"btn",onClick:this.onOpen}),"Edit"))))},createNewTree:function(e,t){var o=this.props.model.createNewElement(this.props.model.schema[t]),i=r.resolve(this.props.projectRoot,"pictures",e),n={};n[o.id]=o,l.sync(r.dirname(i)),s.writeFileSync(i,JSON.stringify(n,null," "),"utf8"),atom.workspace.open(i)},getRoot:function(){var e=r.resolve(this.props.projectRoot,"pictures");return e},getUri:function(){var e,t=this.state.content.split("://");return 1===t.length||this.state.content.startsWith("http")?(e=this.state.content,e.startsWith("http")||e.startsWith("/")||(e=r.resolve(this.props.projectRoot,this.state.content))):2===t.length&&(e=r.resolve(this.props.projectRoot,"node_modules",t[0],t[1])),e},onOpen:function(){atom.workspace.open(this.getUri())},onChoose:function(){var e=this;this.createModal(n.createElement(d.default,{root:this.getRoot(),uri:this.getUri(),settings:d.ImageSettings,onChoose:function(t){e.props.onChange(t),e.state.content=t,e.setState(e.state)},onCancel:function(){},onClose:function(){e.destroyModal()}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,i,a){return n.createElement(u,{key:t,content:e,onChange:o,projectRoot:i,model:a})}},{"../../atom-react/mixins/modal-mixin":57,"../../common/atom-editor":96,"../../common/modals/choose-file-modal":107,fs:void 0,mkdirp:void 0,path:void 0,react:void 0}],113:[function(e,t,o){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n=e("react"),a=e("../../atom-react/mixins/modal-mixin"),r=e("path"),s=e("fs"),l=e("mkdirp"),d=e("../modals/choose-flow-modal"),c=e("../flow-editor"),u=e("../../common/atom-editor"),h=n.createClass({mixins:[a.default],getInitialState:function(){return{key:0,content:this.props.content}},render:function(){var e=this,t={};try{s.statSync(this.getUri())}catch(e){try{s.statSync(this.getUri()+".flow")}catch(e){t={disabled:!0}}}var o=t.disabled?n.createElement("div",{className:"error-messages"},"No flow by that name"):null;return t.disabled||(t=this.state.content.split("://").length>1?{disabled:!0}:{}),n.createElement("div",{style:{width:"100%"}},n.createElement("div",{className:"block"},n.createElement("div",{className:"fileBlock"},n.createElement("button",{style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),n.createElement(u.default,{ref:"editor",mini:!0,content:this.state.content,onDidChange:function(t){e.state.content=t,e.props.onChange(t),e.setState(e.state)}})),o,n.createElement("div",{className:"btn-group",style:{marginTop:5}},n.createElement("button",i({},t,{className:"btn",onClick:this.onOpen}),"Edit"),n.createElement("button",{className:"btn",onClick:this.onNew},"New"))))},createNewTree:function(e,t){var o=this.props.model.createNewElement(this.props.model.schema[t]),i=r.resolve(this.props.projectRoot,"flows",e),n={};n[o.id]=o,l.sync(r.dirname(i)),s.writeFileSync(i,JSON.stringify(n,null," "),"utf8"),atom.workspace.open(i)},onNew:function(){var e=this;c.default.createNewFile(function(t){var o=n.findDOMNode(e.refs.editor);t=e.props.model.findRelativePathToUri(t,{dropExtension:!0}),o.getModel().setText(t)})},getRoot:function(){var e=r.resolve(this.props.projectRoot,"flows");return e},getUri:function(){var e,t=this.state.content.split("://");return 1===t.length?e=r.resolve(r.dirname(this.props.model.uri),this.state.content):2===t.length&&(e=r.resolve(this.props.projectRoot,"node_modules",t[0],"flows",t[1])),r.extname(e)||(e+=".flow"),s.existsSync(e)||(e=r.resolve(this.props.projectRoot,"src/flows",this.state.content),r.extname(e)||(e+=".flow")),e},onOpen:function(){atom.workspace.open(this.getUri())},onChoose:function(){var e=this;this.createModal(n.createElement(d.default,{root:this.getRoot(),uri:this.getUri(),onChoose:function(t,o){var i=e.props.model.findRelativePathToUri(o,{dropExtension:!0});e.props.onChange(i),e.state.content=i,e.setState(e.state)},onCancel:function(){},onClose:function(){e.destroyModal()}}))}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,t,o,i,a){return n.createElement(h,{key:t,content:e,onChange:o,projectRoot:i,model:a})}},{"../../atom-react/mixins/modal-mixin":57,"../../common/atom-editor":96,"../flow-editor":114,"../modals/choose-flow-modal":117,fs:void 0,mkdirp:void 0,path:void 0,react:void 0}],114:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("../atom-react/core/react-editor"),a=e("./views/flow-editor-view"),r=e("../common/tree-view-helper"),s=e("./flow-model"),l=e("jibo"),d={},c=function(t){function o(e){var o=t.call(this,"FlowEditor",e,!1)||this;o.uri=e,o.projectRoot=l.utils.PathUtils.findRoot(e);var i=o.getUiState();return o.layout=i?i:[],o.model=new s.default(e,o.projectRoot),o.lastSaved=JSON.stringify(o.model.data),d[e]=o,o}return i(o,t),o.getProcedureParameters=function(e){for(var t in d)if(t===e&&d[t].model.surface){for(var o in d[t].model.surface.model.nodeDataArray){var i=d[t].model.surface.model.nodeDataArray[o];if("Flow.Begin"===i.class)return i.options.inputParameters}return""}var n,a=l.flow.FlowRootFactory.create(e);try{n=a.getStartActivity()}catch(e){console.warn(e)}return n?n.options.inputParameters.join("\n"):""},o.createNewFile=function(t){var i=r.default.getFolderPathWithDirectory(r.default.getFolderPathOfSelection(),"src/flows"),n=atom.getCurrentWindow(),a=e("remote"),l=a.dialog||a.require("dialog");l.showSaveDialog(n,{title:"New Flow",defaultPath:i,filters:o.getDialogFilter()},function(e){e&&(o.isValidDirectory()?(s.default.createNewFile(e),atom.workspace.open(e)):alert('You must save flows under the "src/flows" folder.'),t&&t(e))})},o.isValidDirectory=function(){return!0},o.getDialogFilter=function(){return[{name:"Flows",extensions:["flow"]}]},o.prototype.showModified=function(e){this.setModifiedStatus(e)},o.prototype.serialize=function(){return this.saveUiState(this.layout),t.prototype.serialize.call(this)},o.prototype.dispose=function(){this.saveUiState(this.layout),t.prototype.dispose.call(this);for(var e in d)if(this===d[e]){delete d[e];break}},o.prototype.onPaneDeactivated=function(){this.model.onPaneDeactivated()},o.prototype.getReactClass=function(){return a.default},o.prototype.setSelectedShape=function(e){this.editor.setState({selectedShape:e})},o.prototype.saveFile=function(e){return o.isValidDirectory()?(this.model.saveToFile(e),!0):(alert('You must save flows under the "flows" folder.'),!1)},o.prototype.reload=function(){},o.prototype.getSaveDialogOptions=function(){return{title:"Save Flow As",filters:o.getDialogFilter()}},o.prototype.setSelectedBufferRange=function(e){var t=e[0][0];this.model.navigateToShapeOnLine(this.uri,t)},o}(n.default);atom.deserializers.add({deserialize:n.default.deserialize.bind(c),name:"FlowEditor"}),Object.defineProperty(o,"__esModule",{value:!0}),o.default=c},{"../atom-react/core/react-editor":55,"../common/tree-view-helper":109,"./flow-model":115,"./views/flow-editor-view":124,jibo:void 0,remote:void 0}],115:[function(e,t,o){"use strict";var i=e("fs"),n=e("path"),a=e("../behavior-editor/schema-reader"),r=e("slash"),s=e("glob"),l=e("find-root"),d=e("../common/get-asset-packs"),c=e("jibo"),u='\n{\n "class": "go.GraphLinksModel",\n "dataFormat": "flow-1",\n "nodeKeyProperty": "id",\n "nodeCategoryProperty": "class",\n "linkFromPortIdProperty": "fromPort",\n "linkToPortIdProperty": "toPort",\n "nodeDataArray": [],\n "linkDataArray": []}\n',h=function(){function e(e,t){this.uri=e,this.projectRoot=t,this.schema=this.loadSchemas(e),this.loadAnimDB(t)}return e.createNewFile=function(e){var t=JSON.parse(u),o=JSON.stringify(t,null," ");i.writeFileSync(e,o)},e.prototype.loadAnimDB=function(e){var t=d.getAssetPackDictionary(e)["jibo-anim-db-animations"];c.animDB._animDB||c.animDB.init(c,t&&t.root+"/animdb.json")},e.prototype.findRelativePathToUri=function(e,t){var o=n.relative(n.dirname(this.uri),e);if("."!==o[0]&&(o="./"+o),t&&t.dropExtension===!0){var i=n.extname(o);""!==i&&(o=o.replace(RegExp("\\"+i+"$"),""))}return r(o)},e.prototype.clearObsoleteOptions=function(e,t){for(var o=this.getSchemaByElement(e).options,i=0,n=o;i<n.length;i++){var a=n[i];this.getSchemaByElementField(t,a.field)||delete e.options[a.field]}},e.prototype.loadSchemas=function(e){var t=["node_modules/jibo/schema/schema-flow.json"],o=new a.default(t).getNewSchema(e);if(!this.hasPaletteSchemas(o)){var i=n.join(l(__dirname),"resources/externals/backward-compatibility/schemas"),r=s.sync(i+"/*.json");o=new a.default(r).getNewSchema(e)}return o},e.prototype.hasPaletteSchemas=function(e){for(var t in e)for(var o in e[t].schema){var i=e[t].schema[o];if(i.paletteInfo&&i.paletteInfo.uses&&i.paletteInfo.uses.indexOf("flow")!==-1)return!0}return!1},e.prototype.getSchemaByElementField=function(e,t){for(var o=this.getSchemaByElement(e).options,i=0,n=o;i<n.length;i++){var a=n[i];if(a.field===t)return a}},e.prototype.getSchemaByElement=function(e){var t=e.class;if(!e["asset-pack"]){var o=this.schema.core.schema[t];return o||(o=this.schema.project.schema[t]),o}var i=e["asset-pack"];return this.schema[i].schema[t];
},e.prototype.getFlowSchemas=function(){var e=[];for(var t in this.schema)for(var o in this.schema[t].schema){var i=this.schema[t].schema[o];i.paletteInfo&&i.paletteInfo.uses&&i.paletteInfo.uses.indexOf("flow")!==-1&&e.push(i)}return e},e.prototype.setSurface=function(e,t){this.surface=e,void 0===global.jiboFlowEditorTabs&&(global.jiboFlowEditorTabs={}),global.jiboFlowEditorTabs[this.uri]={palette:t,diagram:e}},e.prototype.navigateToShapeOnLine=function(e,t){var o,n=i.readFileSync(e,"utf8").split("\n");for(o=t;o>=0&&!(n[o].indexOf('"class": ')>=0);o--);if(o>=0)for(var a=o;a<n.length;a++)if(n[a].indexOf('"id": ')>=0){var r=n[a],s=r.split(":"),l=s[1].replace(/[ ",]/g,""),d=this.surface.findNodeForKey(l);this.surface.select(d),this.surface.commandHandler.scrollToPart(d),this.surface.select(d);break}},e.prototype.onPaneDeactivated=function(){},e.prototype.listifyOptions=function(e){for(var t=e.nodeDataArray,o=0;o<t.length;o++){var i=t[o];if(i.options)for(var n=Object.keys(i.options),a=0;a<n.length;a++){var r=n[a];"string"==typeof i.options[r]&&(0===i.options[r].indexOf("function")||i.options[r].indexOf("=>")>=0)&&(i.options[r]=i.options[r].split("\n"))}}return e},e.prototype.saveToFile=function(e){var t=this.surface.model.toJson(),o=JSON.parse(t);o=this.listifyOptions(o),i.writeFileSync(e,JSON.stringify(o,null," "),"utf8"),this.surface.isModified=!1},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=h},{"../behavior-editor/schema-reader":84,"../common/get-asset-packs":100,"find-root":void 0,fs:void 0,glob:void 0,jibo:void 0,path:void 0,slash:void 0}],116:[function(e,t,o){"use strict";var i=e("../atom-react/core/react-editor"),n=e("../common/tree-view-helper"),a=e("jibo-dev"),r=e("path"),s=function(){function e(){}return e.preflight=function(){var e=i.default.getProjectRoot(""),t=n.default.getFilePathOfSelection();if(!t||!t.endsWith(".flow"))return void alert("Cannot preflight "+t);var o=new a.FlowLint(e,t);o.run();var s=r.resolve(e,"preflight.log");o.writeReportToFile(s),atom.workspace.open(s)},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=s},{"../atom-react/core/react-editor":55,"../common/tree-view-helper":109,"jibo-dev":void 0,path:void 0}],117:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=e("../../common/directory-tree-view"),r=e("path"),s=e("normalize-path"),l=e("../../common/get-asset-packs"),d=e("../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({onChoose:function(){var e=this.state.currentAssetPack,t=r.join(e.root,"src/flows"),o=r.relative(t,this.state.currentFlow);o=s(o),"project"!==this.state.currentAssetPack.id&&(o=e.id+"://"+o),this.props.onChoose(o,this.state.currentFlow),this.props.onClose()},onCancel:function(){this.props.onCancel(),this.props.onClose()},getLength:function(){return Object.keys(this.behaviorToIndexMap).length},getInitialState:function(){return{currentAssetPack:{id:"project"},currentFlow:"",filter:""}},onAssetPackSelected:function(e){this.setState({currentAssetPack:e})},onSelected:function(e){this.setState({currentFlow:e})},getPanelHeading:function(e){return i.createElement("div",{className:"panel-heading",style:{padding:"0px",width:"100%",height:30}},i.createElement("p",{style:{textAlign:"center",marginTop:"4px",marginBottom:"4px"}},e))},render:function(){for(var e,t=this,o=l.default(this.props.root),n=[],s=0;s<o.length;s++){var c=o[s],u="list-item";this.state.currentAssetPack.id===c.id&&(this.state.currentAssetPack=c,e=c,u+=" selected"),n.push(i.createElement("li",{className:u,onClick:this.onAssetPackSelected.bind(this,c)},i.createElement("span",null,c.name)))}var h="";return this.state.currentFlow,i.createElement("div",{className:"asset-selector-modal",ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Choose a Flow File")),i.createElement("label",{style:{marginLeft:10}},"Search"),i.createElement(d.default,{ref:"editor",style:{marginLeft:10,marginRight:10,marginBottom:10},mini:!0,content:this.state.filter,onDidChange:function(e){t.setState({filter:e})}}),i.createElement("div",{className:"contents"},i.createElement("div",{className:"list-contents"},this.getPanelHeading("Asset Pack"),i.createElement("div",{className:"list-group asset-pack",ref:"assetPackList"},n)),i.createElement("div",{className:"list-contents"},this.getPanelHeading("Flow"),i.createElement("div",{className:"asset-list"},i.createElement(a.default,{uri:r.resolve(e.root,"src/flows"),onChosen:function(e){t.onSelected(e),t.onChoose()},onSelected:this.onSelected,extension:[".flow"],filter:this.state.filter,hideEmpty:!0}))),i.createElement("div",{className:"preview-contents"},this.getPanelHeading("Preview"),i.createElement("div",{className:"asset-preview"},i.createElement("pre",null,h)))),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onChoose},"Choose"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},onLeft:function(){var e=i.findDOMNode(this.refs.assetPackList);e.focus()},onRight:function(){var e=i.findDOMNode(this.refs.schemaList);e.focus()},componentDidMount:function(){var e=this,t=this.refs.editor;setTimeout(function(){t.focus(),e.getDOMNode().setAttribute("tabIndex",0),e.disposable=new n.CompositeDisposable,e.disposable.add(atom.commands.add(e.getDOMNode(),{"jibo-sdk:escape":e.onCancel,"jibo-sdk:confirm":e.onChoose}))},100)},componentWillUnmount:function(){this.disposable.dispose()}})},{"../../common/atom-editor":96,"../../common/directory-tree-view":98,"../../common/get-asset-packs":100,atom:void 0,"normalize-path":void 0,path:void 0,react:void 0}],118:[function(e,t,o){"use strict";var i=e("./go");o.GuidedDraggingTool=function(){i.default.DraggingTool.call(this);var e=i.default.GraphObject.make,t={layerName:"Tool",isInDocumentBounds:!1},o={stroke:"gray",isGeometryPositioned:!0};this.guidelineHtop=e(i.default.Part,t,e(i.default.Shape,o,{geometryString:"M0 0 100 0"})),this.guidelineHbottom=e(i.default.Part,t,e(i.default.Shape,o,{geometryString:"M0 0 100 0"})),this.guidelineHcenter=e(i.default.Part,t,e(i.default.Shape,o,{geometryString:"M0 0 100 0"})),this.guidelineVleft=e(i.default.Part,t,e(i.default.Shape,o,{geometryString:"M0 0 0 100"})),this.guidelineVright=e(i.default.Part,t,e(i.default.Shape,o,{geometryString:"M0 0 0 100"})),this.guidelineVcenter=e(i.default.Part,t,e(i.default.Shape,o,{geometryString:"M0 0 0 100"})),this._guidelineSnapDistance=6,this._isGuidelineEnabled=!0,this._horizontalGuidelineColor="gray",this._verticalGuidelineColor="gray",this._centerGuidelineColor="gray",this._guidelineWidth=1,this._searchDistance=1e3,this._isGuidelineSnapEnabled=!0},i.default.Diagram.inherit(o.GuidedDraggingTool,i.default.DraggingTool),o.GuidedDraggingTool.prototype.clearGuidelines=function(){this.diagram.remove(this.guidelineHbottom),this.diagram.remove(this.guidelineHcenter),this.diagram.remove(this.guidelineHtop),this.diagram.remove(this.guidelineVleft),this.diagram.remove(this.guidelineVright),this.diagram.remove(this.guidelineVcenter)},o.GuidedDraggingTool.prototype.doDeactivate=function(){i.default.DraggingTool.prototype.doDeactivate.call(this),this.clearGuidelines()},o.GuidedDraggingTool.prototype.doDragOver=function(){this.clearGuidelines();var e=(this.copiedParts||this.draggedParts).iterator;e.next();var t=e.key;this.showHorizontalMatches(t,this.isGuidelineEnabled,!1),this.showVerticalMatches(t,this.isGuidelineEnabled,!1)},o.GuidedDraggingTool.prototype.doDropOnto=function(){var e=(this.copiedParts||this.draggedParts).iterator,t=e.next();if(!t)return void console.log("GuidedDraggingTool.doDropOnto -- empty selection.");var o=e.key,i=this.diagram.lastInput,n=this.isGuidelineSnapEnabled&&!i.shift;this.showHorizontalMatches(o,this.isGuidelineEnabled,n),this.showVerticalMatches(o,this.isGuidelineEnabled,n)},o.GuidedDraggingTool.prototype.showHorizontalMatches=function(e,t,o){if(e instanceof i.default.Part){var n=e.actualBounds,a=n.y,r=n.y+n.height/2,s=n.y+n.height,l=this.guidelineSnapDistance,d=this.searchDistance,c=n.copy();c.inflate(d,l+1);var u,h,p=this.diagram.findObjectsIn(c,function(e){return e.part},function(e){return e instanceof i.default.Part&&!(e instanceof i.default.Link)&&e.isTopLevel&&!e.layer.isTemporary},!0),m=l,f=null;if(p.each(function(t){if(t!==e){var o=t.actualBounds,n=o.y,l=o.y+o.height/2,d=o.y+o.height;Math.abs(r-l)<m&&(m=Math.abs(r-l),f=t,u=i.default.Spot.Center,h=i.default.Spot.Center),Math.abs(a-n)<m?(m=Math.abs(a-n),f=t,u=i.default.Spot.Top,h=i.default.Spot.Top):Math.abs(a-d)<m&&(m=Math.abs(a-d),f=t,u=i.default.Spot.Top,h=i.default.Spot.Bottom),Math.abs(s-n)<m?(m=Math.abs(s-n),f=t,u=i.default.Spot.Bottom,h=i.default.Spot.Top):Math.abs(s-d)<m&&(m=Math.abs(s-d),f=t,u=i.default.Spot.Bottom,h=i.default.Spot.Bottom)}}),null!==f){var v=f.actualBounds,y=Math.min(n.x,v.x)-10,g=Math.max(n.x+n.width,v.x+v.width)+10,b=(new i.default.Point).setRectSpot(v,h);u===i.default.Spot.Center?(o&&e.move(new i.default.Point(n.x,b.y-n.height/2)),t&&(this.guidelineHcenter.position=new i.default.Point(y,b.y),this.guidelineHcenter.elt(0).width=g-y,this.diagram.add(this.guidelineHcenter))):u===i.default.Spot.Top?(o&&e.move(new i.default.Point(n.x,b.y)),t&&(this.guidelineHtop.position=new i.default.Point(y,b.y),this.guidelineHtop.elt(0).width=g-y,this.diagram.add(this.guidelineHtop))):u===i.default.Spot.Bottom&&(o&&e.move(new i.default.Point(n.x,b.y-n.height)),t&&(this.guidelineHbottom.position=new i.default.Point(y,b.y),this.guidelineHbottom.elt(0).width=g-y,this.diagram.add(this.guidelineHbottom)))}}},o.GuidedDraggingTool.prototype.showVerticalMatches=function(e,t,o){if(e instanceof i.default.Part){var n=e.actualBounds,a=n.x,r=n.x+n.width/2,s=n.x+n.width,l=this.guidelineSnapDistance,d=this.searchDistance,c=n.copy();c.inflate(l+1,d);var u,h,p=this.diagram.findObjectsIn(c,function(e){return e.part},function(e){return e instanceof i.default.Part&&!(e instanceof i.default.Link)&&e.isTopLevel&&!e.layer.isTemporary},!0),m=l,f=null;if(p.each(function(t){if(t!==e){var o=t.actualBounds,n=o.x,l=o.x+o.width/2,d=o.x+o.width;Math.abs(r-l)<m&&(m=Math.abs(r-l),f=t,u=i.default.Spot.Center,h=i.default.Spot.Center),Math.abs(a-n)<m?(m=Math.abs(a-n),f=t,u=i.default.Spot.Left,h=i.default.Spot.Left):Math.abs(a-d)<m&&(m=Math.abs(a-d),f=t,u=i.default.Spot.Left,h=i.default.Spot.Right),Math.abs(s-n)<m?(m=Math.abs(s-n),f=t,u=i.default.Spot.Right,h=i.default.Spot.Left):Math.abs(s-d)<m&&(m=Math.abs(s-d),f=t,u=i.default.Spot.Right,h=i.default.Spot.Right)}}),null!==f){var v=f.actualBounds,y=Math.min(n.y,v.y)-10,g=Math.max(n.y+n.height,v.y+v.height)+10,b=(new i.default.Point).setRectSpot(v,h);u===i.default.Spot.Center?(o&&e.move(new i.default.Point(b.x-n.width/2,n.y)),t&&(this.guidelineVcenter.position=new i.default.Point(b.x,y),this.guidelineVcenter.elt(0).height=g-y,this.diagram.add(this.guidelineVcenter))):u===i.default.Spot.Left?(o&&e.move(new i.default.Point(b.x,n.y)),t&&(this.guidelineVleft.position=new i.default.Point(b.x,y),this.guidelineVleft.elt(0).height=g-y,this.diagram.add(this.guidelineVleft))):u===i.default.Spot.Right&&(o&&e.move(new i.default.Point(b.x-n.width,n.y)),t&&(this.guidelineVright.position=new i.default.Point(b.x,y),this.guidelineVright.elt(0).height=g-y,this.diagram.add(this.guidelineVright)))}}},Object.defineProperty(o.GuidedDraggingTool.prototype,"guidelineSnapDistance",{get:function(){return this._guidelineSnapDistance},set:function(e){if("number"!=typeof e||isNaN(e)||e<0)throw new Error("new value for GuidedDraggingTool.guidelineSnapDistance must be a non-negative number.");this._guidelineSnapDistance!==e&&(this._guidelineSnapDistance=e)}}),Object.defineProperty(o.GuidedDraggingTool.prototype,"isGuidelineEnabled",{get:function(){return this._isGuidelineEnabled},set:function(e){if("boolean"!=typeof e)throw new Error("new value for GuidedDraggingTool.isGuidelineEnabled must be a boolean value.");this._isGuidelineEnabled!==e&&(this._isGuidelineEnabled=e)}}),Object.defineProperty(o.GuidedDraggingTool.prototype,"horizontalGuidelineColor",{get:function(){return this._horizontalGuidelineColor},set:function(e){this._horizontalGuidelineColor!==e&&(this._horizontalGuidelineColor=e,this.guidelineHbottom.elements.first().stroke=this._horizontalGuidelineColor,this.guidelineHtop.elements.first().stroke=this._horizontalGuidelineColor)}}),Object.defineProperty(o.GuidedDraggingTool.prototype,"verticalGuidelineColor",{get:function(){return this._verticalGuidelineColor},set:function(e){this._verticalGuidelineColor!==e&&(this._verticalGuidelineColor=e,this.guidelineVleft.elements.first().stroke=this._verticalGuidelineColor,this.guidelineVright.elements.first().stroke=this._verticalGuidelineColor)}}),Object.defineProperty(o.GuidedDraggingTool.prototype,"centerGuidelineColor",{get:function(){return this._centerGuidelineColor},set:function(e){this._centerGuidelineColor!==e&&(this._centerGuidelineColor=e,this.guidelineVcenter.elements.first().stroke=this._centerGuidelineColor,this.guidelineHcenter.elements.first().stroke=this._centerGuidelineColor)}}),Object.defineProperty(o.GuidedDraggingTool.prototype,"guidelineWidth",{get:function(){return this._guidelineWidth},set:function(e){if("number"!=typeof e||isNaN(e)||e<0)throw new Error("New value for GuidedDraggingTool.guidelineWidth must be a non-negative number.");this._guidelineWidth!==e&&(this._guidelineWidth=e,this.guidelineVcenter.elements.first().strokeWidth=e,this.guidelineHcenter.elements.first().strokeWidth=e,this.guidelineVleft.elements.first().strokeWidth=e,this.guidelineVright.elements.first().strokeWidth=e,this.guidelineHbottom.elements.first().strokeWidth=e,this.guidelineHtop.elements.first().strokeWidth=e)}}),Object.defineProperty(o.GuidedDraggingTool.prototype,"searchDistance",{get:function(){return this._searchDistance},set:function(e){if("number"!=typeof e||isNaN(e)||e<=0)throw new Error("new value for GuidedDraggingTool.searchDistance must be a positive number.");this._searchDistance!==e&&(this._searchDistance=e)}}),Object.defineProperty(o.GuidedDraggingTool.prototype,"isGuidelineSnapEnabled",{get:function(){return this._isGuidelineSnapEnabled},set:function(e){if("boolean"!=typeof e)throw new Error("new value for GuidedDraggingTool.isGuidelineSnapEnabled must be a boolean.");this._isGuidelineSnapEnabled!==e&&(this._isGuidelineSnapEnabled=e)}})},{"./go":125}],119:[function(e,t,o){"use strict";var i={Background:"#21252B",Candy:"#FC2D80",Firecracker:"#FD362F",Grape:"#8952D6",Grass:"#6BC137",Hotrod:"#FF5B24",JiboBlue:"#1CC1D9",Limeade:"#8EDD40",Metro:"#495361",Nebula:"#5E47D1",Pearl:"#FFFFFF",Tangerine:"#FF8921",Tennis:"#00AB75",Topaz:"#FBC230",Twilight:"#3C78D6",White:"#FFFFFF"};Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{}],120:[function(e,t,o){"use strict";var i=e("./go");o.LinkLabelDraggingTool=function(){i.default.Tool.call(this),this.name="LinkLabelDragging",this.label=null,this._offset=new i.default.Point,this._originalOffset=null},i.default.Diagram.inherit(o.LinkLabelDraggingTool,i.default.Tool),o.LinkLabelDraggingTool.prototype.canStart=function(){if(!i.default.Tool.prototype.canStart.call(this))return!1;var e=this.diagram;if(null===e)return!1;var t=e.lastInput;return!!t.left&&(!!this.isBeyondDragSize()&&null!==this.findLabel())},o.LinkLabelDraggingTool.prototype.findLabel=function(){var e=this.diagram,t=e.lastInput,o=e.findObjectAt(t.documentPoint,null,null);if(null===o||!(o.part instanceof i.default.Link))return null;for(;o.panel!==o.part;)o=o.panel;return 0===o.segmentIndex||o.segmentIndex===-1?null:o},o.LinkLabelDraggingTool.prototype.doActivate=function(){this.startTransaction("Shifted Label"),this.label=this.findLabel(),null!==this.label&&(this._offset=this.diagram.firstInput.documentPoint.copy().subtract(this.label.getDocumentPoint(i.default.Spot.Center)),this._originalOffset=this.label.segmentOffset.copy()),i.default.Tool.prototype.doActivate.call(this)},o.LinkLabelDraggingTool.prototype.doDeactivate=function(){i.default.Tool.prototype.doDeactivate.call(this),this.stopTransaction()},o.LinkLabelDraggingTool.prototype.doStop=function(){this.label=null,i.default.Tool.prototype.doStop.call(this)},o.LinkLabelDraggingTool.prototype.doCancel=function(){null!==this.label&&(this.label.segmentOffset=this._originalOffset),i.default.Tool.prototype.doCancel.call(this)},o.LinkLabelDraggingTool.prototype.doMouseMove=function(){this.isActive&&this.updateSegmentOffset()},o.LinkLabelDraggingTool.prototype.doMouseUp=function(){this.isActive&&(this.updateSegmentOffset(),this.transactionResult="Shifted Label",this.stopTool())},o.LinkLabelDraggingTool.prototype.updateSegmentOffset=function(){var e=this.label;if(null!==e){var t=e.part;if(t instanceof i.default.Link){var o=this.diagram.lastInput.documentPoint,n=e.segmentIndex,a=t.pointsCount;if(n<-a||n>=a){var r=t.midPoint,s=new i.default.Point(o.x-this._offset.x-r.x,o.y-this._offset.y-r.y);e.segmentOffset=s.rotate(-t.midAngle)}else{var l=e.segmentFraction,d=void 0,c=void 0;if(n>=0)d=t.getPoint(n),c=n<a-1?t.getPoint(n+1):d;else{var u=a+n;d=t.getPoint(u),c=u>0?t.getPoint(u-1):d}var h=d.x+(c.x-d.x)*l,p=d.y+(c.y-d.y)*l,s=new i.default.Point(o.x-this._offset.x-h,o.y-this._offset.y-p),m=n>=0?d.directionPoint(c):c.directionPoint(d);e.segmentOffset=s.rotate(-m)}}}}},{"./go":125}],121:[function(e,t,o){"use strict";var i=e("./go");o.LinkShiftingTool=function(){i.default.Tool.call(this),this.name="LinkShifting";var e=new i.default.Shape;e.geometryString="F1 M0 0 L8 0 M8 4 L0 4",e.fill=null,e.stroke="dodgerblue",e.background="lightblue",e.cursor="pointer",e.segmentIndex=0,e.segmentFraction=1,e.segmentOrientation=i.default.Link.OrientAlong,this._fromHandleArchetype=e,e=new i.default.Shape,e.geometryString="F1 M0 0 L8 0 M8 4 L0 4",e.fill=null,e.stroke="dodgerblue",e.background="lightblue",e.cursor="pointer",e.segmentIndex=-1,e.segmentFraction=1,e.segmentOrientation=i.default.Link.OrientAlong,this._toHandleArchetype=e,this._handle=null,this._originalPoints=null},i.default.Diagram.inherit(o.LinkShiftingTool,i.default.Tool),o.LinkShiftingTool.prototype.updateAdornments=function(e){if(null!==e&&e instanceof i.default.Link){var t=e,o="LinkShiftingFrom",n=null;if(t.isSelected&&this.diagram&&!this.diagram.isReadOnly){var a=t.selectionObject;if(null!==a&&t.actualBounds.isReal()&&t.isVisible()&&a.actualBounds.isReal()&&a.isVisibleObject()){var r=t.computeSpot(!0);(r.isSide()||r.isSpot())&&(n=t.findAdornment(o),null===n&&(n=this.makeAdornment(a,!1),n.category=o,t.addAdornment(o,n)))}}if(null===n&&t.removeAdornment(o),o="LinkShiftingTo",n=null,t.isSelected&&this.diagram&&!this.diagram.isReadOnly){var a=t.selectionObject;if(null!==a&&t.actualBounds.isReal()&&t.isVisible()&&a.actualBounds.isReal()&&a.isVisibleObject()){var r=t.computeSpot(!1);(r.isSide()||r.isSpot())&&(n=t.findAdornment(o),null===n&&(n=this.makeAdornment(a,!0),n.category=o,t.addAdornment(o,n)))}}null===n&&t.removeAdornment(o)}},o.LinkShiftingTool.prototype.makeAdornment=function(e,t){var o=new i.default.Adornment;o.type=i.default.Panel.Link;var n=t?this._toHandleArchetype:this._fromHandleArchetype;return null!==n&&o.add(n.copy()),o.adornedObject=e,o},o.LinkShiftingTool.prototype.canStart=function(){if(!this.isEnabled)return!1;var e=this.diagram;if(null===e||e.isReadOnly||e.isModelReadOnly)return!1;if(!e.lastInput.left)return!1;var t=this.findToolHandleAt(e.firstInput.documentPoint,"LinkShiftingFrom");return null===t&&(t=this.findToolHandleAt(e.firstInput.documentPoint,"LinkShiftingTo")),null!==t},o.LinkShiftingTool.prototype.doActivate=function(){var e=this.diagram;if(null!==e){var t=this.findToolHandleAt(e.firstInput.documentPoint,"LinkShiftingFrom");if(null===t&&(t=this.findToolHandleAt(e.firstInput.documentPoint,"LinkShiftingTo")),null!==t){var o=t.part,n=o.adornedObject.part;n instanceof i.default.Link&&(this._handle=t,this._originalPoints=n.points.copy(),this.startTransaction(this.name),e.isMouseCaptured=!0,e.currentCursor="pointer",this.isActive=!0)}}},o.LinkShiftingTool.prototype.doDeactivate=function(){this.isActive=!1;var e=this.diagram;null!==e&&(e.isMouseCaptured=!1,e.currentCursor="",this.stopTransaction())},o.LinkShiftingTool.prototype.doStop=function(){this._handle=null,this._originalPoints=null},o.LinkShiftingTool.prototype.doCancel=function(){var e=this._handle.part,t=e.adornedObject.part;t.points=this._originalPoints,this.stopTool()},o.LinkShiftingTool.prototype.doMouseMove=function(){this.isActive&&this.doReshape(this.diagram.lastInput.documentPoint)},o.LinkShiftingTool.prototype.doMouseUp=function(){this.isActive&&(this.doReshape(this.diagram.lastInput.documentPoint),this.transactionResult=this.name),this.stopTool()},o.LinkShiftingTool.prototype.doReshape=function(e){var t=this._handle.part,o=t.adornedObject.part,n="LinkShiftingFrom"===t.category,a=null;a=n?o.fromPort:o.toPort;var r=new i.default.Rect(a.getDocumentPoint(i.default.Spot.TopLeft),a.getDocumentPoint(i.default.Spot.BottomRight)),s=r.width>0?(e.x-r.x)/r.width:0,l=r.height>0?(e.y-r.y)/r.height:0,d=void 0,c=void 0;s<=0?(d=0,c=l<=0?0:l>=1?1:l):s>=1?(d=1,c=l<=0?0:l>=1?1:l):l<=0?(d=s,c=0):l>=1?(d=s,c=1):s>l?s>1-l?(d=1,c=l):(d=s,c=0):s>1-l?(d=s,c=1):(d=0,c=l),void 0!==d&&void 0!==c&&(n?o.fromSpot=new i.default.Spot(d,c):o.toSpot=new i.default.Spot(d,c))}},{"./go":125}],122:[function(e,t,o){"use strict";var i=e("./go");o.ResizeMultipleTool=function(){i.default.ResizingTool.call(this),this.name="ResizeMultiple"},i.default.Diagram.inherit(o.ResizeMultipleTool,i.default.ResizingTool),o.ResizeMultipleTool.prototype.resize=function(e){var t=this.diagram;null!==t&&t.selection.each(function(t){if(!(t instanceof i.default.Link||t instanceof i.default.Group||t.data&&t.data.clazz.startsWith("Flow.Begin"))){var o=t.resizeObject,n=t.position.copy(),a=o.getDocumentAngle(),r=o.getDocumentScale(),s=Math.PI*a/180,l=Math.cos(s),d=Math.sin(s),c=e.width-o.naturalBounds.width,u=e.height-o.naturalBounds.height,h=a>0&&a<180?1:0,p=a>90&&a<270?1:0,m=a>180&&a<360?1:0;n.x+=r*((e.x+c*p)*l-(e.y+u*h)*d),n.y+=r*((e.x+c*m)*d+(e.y+u*p)*l),o.desiredSize=e.size,t.position=n}})}},{"./go":125}],123:[function(e,t,o){"use strict";var i=e("react"),n=e("../../behavior-editor/arguments"),a=e("../arguments"),r=e("./JiboColors"),s=e("./go");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"layout-child",propTypes:{shape:i.PropTypes.object.isRequired,schema:i.PropTypes.object.isRequired},getDefaultProps:function(){return{}},getInitialState:function(){return{key:0}},onChange:function(e,t,o){var i=this.props.model.surface.model;i.startTransaction("field value change"),i.setDataProperty(e,t,o),i.commitTransaction("field value change")},onChangeState:function(e,t,o){this.onChange(e,t,o),this.state.key++,this.setState(this.state)},getObject:function(e){var t=this.props.shape.data;if(t._isPaletteNode)return{};void 0===e&&(e="options");for(var o=0,i=e.split(".");o<i.length;o++){var n=i[o];0!==n.length&&(t=t[n])}return t},render:function(){var e=[],t=this.props.shape;if(t instanceof s.default.Node){var o=this.props.model.getSchemaByElement(t.data);if(o){if(t.data._isPaletteNode)e.push(i.createElement("p",{key:this.state.key++,style:{marginTop:"6px",marginBottom:"6px"}},"Description: ",o.description)),e.push(i.createElement("hr",{key:this.state.key++}));else if("Flow.Comment"!==t.data.class&&"Flow.Picture"!==t.data.class){var n=[{location:"",type:"string",field:"name",description:"Name of the activity",defaultValue:""}];this.render_options(e,n)}this.render_options(e,o.options)}}else if(t instanceof s.default.Link){var a=void 0===t.fromNode||void 0===t.fromNode.data||!t.fromNode.data.class.startsWith("Flow.Begin");if(a){var l=[{location:"",type:"string",field:"text",description:"Link transition value",defaultValue:""}];this.render_options(e,l)}}return i.createElement("div",null,i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{key:this.state.key++,style:{color:r.default.Tennis,textAlign:"center",marginTop:"6px",marginBottom:"6px"}},this.props.title),i.createElement("h3",{key:this.state.key++,style:{color:r.default.Limeade,textAlign:"center",marginTop:"6px",marginBottom:"6px"}},this.props.subtitle)),i.createElement("div",{className:"arguments-scroll-container"},e))},render_options:function(e,t){if(void 0!==t)for(var o=0,i=t;o<i.length;o++){var n=i[o];this.render_option(e,n)}},render_option:function(e,t){var o=this.getObject(t.location),r=t.field;void 0===o[r]&&(o[r]=t.defaultValue);var s,l=o[r],d=t.type,c=[],u=Object.assign({},n.default,a.default);if(Array.isArray(d)){if("enum"===d[0]){for(var h=d.slice(1),p=0,m=h;p<m.length;p++){var f=m[p];if(f.value===l){c=f.options||[];break}}s=u.enum(l,h,this.onChangeState.bind(this,o,r)),s.key=this.state.key++}}else s=u[d.toLowerCase()](l,this.state.key++,this.onChange.bind(this,o,r),this.props.projectRoot,this.props.model);e.push(i.createElement("p",{key:this.state.key++},r+": "+t.description)),e.push(s),e.push(i.createElement("hr",{key:this.state.key++}));for(var v=0,y=c;v<y.length;v++){var g=y[v];this.render_option(e,g)}}})},{"../../behavior-editor/arguments":65,"../arguments":111,"./JiboColors":119,"./go":125,react:void 0}],124:[function(e,t,o){"use strict";function i(e){var t,o;e.linkTemplate.curve=t=a(),e.linkTemplate.routing=o=n(),e.model.startTransaction("update-link-type"),e.links.each(function(e){e.curve=t,e.routing=o,e.invalidateRoute()}),e.model.commitTransaction("update-link-type")}function n(){return r()?s()?z.default.Link.AvoidsNodes:z.default.Link.Orthogonal:z.default.Link.Normal}function a(){return r()?z.default.Link.JumpGap:z.default.Link.None}function r(){return atom.config.get("jibo-sdk.FlowEditorUseOrthogonalLinks")}function s(){return atom.config.get("jibo-sdk.FlowEditorRouteLinksAroundNodes")}function l(e){var t=!1,o=e.lastInput,i="";i+=o.meta?"meta-":"",i+=o.control?"control-":"",i+=o.shift?"shift-":"",i+=o.key;for(var n=0,a=ne;n<a.length;n++){var r=a[n];if(i===r.key){r.method(e),t=!0;break}}return t}function d(e){var t=e.lastInput,o=0,i=0;if(t.control||t.meta)o=1,i=1;else if(null!==e.grid){var n=e.grid.gridCellSize;i=n.width,o=n.height}e.startTransaction("arrowKeyMove"),e.selection.each(function(e){e instanceof z.default.Node&&("Up"===t.key?e.move(new z.default.Point(e.actualBounds.x,e.actualBounds.y-o)):"Down"===t.key?e.move(new z.default.Point(e.actualBounds.x,e.actualBounds.y+o)):"Left"===t.key?e.move(new z.default.Point(e.actualBounds.x-i,e.actualBounds.y)):"Right"===t.key&&e.move(new z.default.Point(e.actualBounds.x+i,e.actualBounds.y)))}),x(e),e.commitTransaction("arrowKeyMove")}function c(e){var t=[];e.selection.each(function(e){t.push(e)}),e.model.startTransaction("minimize-shape");for(var o=0,i=t;o<i.length;o++){var n=i[o],a=n.findObject("activity-shape");a&&("Flow.Picture"===a.part.data.class?a.part.desiredSize=new z.default.Size(this.paletteIconWidth+30,NaN):a.part.desiredSize=new z.default.Size(NaN,NaN))}e.model.commitTransaction("minimize-shape")}function u(e){var t=[];e.selection.each(function(e){t.push(e)}),e.model.startTransaction("normalize-link");for(var o=0,i=t;o<i.length;o++){var n=i[o];if(n instanceof z.default.Link){n.toSpot=z.default.Spot.Default,n.fromSpot=z.default.Spot.Default;var a=n.findObject("LABEL");a.segmentOffset=new z.default.Point(0,0)}}x(e),e.model.commitTransaction("normalize-link")}function h(e){e.model.startTransaction("auto-layout"),e.layout=W(z.default.ForceDirectedLayout,{isOngoing:!1}),e.model.commitTransaction("auto-layout")}function p(e){var t=[];e.selection.each(function(e){t.push(e)}),e.model.startTransaction("link-shapes");for(var o=0;o<t.length-1;o++)e.toolManager.linkingTool.insertLink(t[o],null,t[o+1],null);e.model.commitTransaction("link-shapes")}function m(e){for(var t="",o=e.toLowerCase(),i=0;i<e.length;i++)e[i]!==o[i]&&(t+=" "),t+=e[i];return t.trim()}function f(e){for(var t="",o=L.readFileSync(e,"utf8"),i=0,n=o.split("\n");i<n.length;i++){var a=n[i];a.indexOf("${")>=0&&(t+="// "+a+"\n")}return t}function v(e,t,o,i,n){n.data.options.inputParameters=H.default.getProcedureParameters(t),n.data.options.subflowId=e.model.findRelativePathToUri(t,{dropExtension:!0}),o.startTransaction("set-name"),o.setDataProperty(n.data,"name",j.basename(i,".flow")),o.commitTransaction("set-name")}function y(e,t,o,i,n){n.data.options.behaviorPath=e.model.findRelativePathToUri(i,{dropExtension:!0}),o.startTransaction("set-name"),o.setDataProperty(n.data,"name",j.basename(i,".bt")),o.commitTransaction("set-name")}function g(e,t,o,i,n){o.startTransaction("set-name"),o.setDataProperty(n.data,"url",i),o.commitTransaction("set-name")}function b(e,t,o,i,n){var a=j.resolve(t,i);e.getSchemaByElementField(n.data,"getMimPath")?n.data.options.getMimPath=k(e,j.relative(t,a),n):(n.data.options.mimPath=R(j.relative(t,a)),L.existsSync(a)&&L.statSync(a).isFile()&&(n.data.options.getPromptData=S(e,a,n),"Mim.Announcement"!==n.data.class&&(n.data.options.onSuccess=w(e,a,n)),o.startTransaction("set-name"),o.setDataProperty(n.data,"name",E(i)),o.commitTransaction("set-name")))}function k(e,t,o){var i=e.getSchemaByElementField(o.data,"getMimPath").defaultValue;return i.replace(/return ['"][^'"]+['"];?/,"return '"+R(t)+"';")}function S(e,t,o){var i=e.getSchemaByElementField(o.data,"getPromptData").defaultValue,n=f(t);return i+"\n"+n+"\n"}function w(e,t,o){var i=e.getSchemaByElementField(o.data,"onSuccess").defaultValue,n=M(t,"rule_slots");return i+"\n//Transitions: "+n+"\n"}function E(e){var t=j.basename(e,".mim");return m(t)}function M(e,t){var o=L.readFileSync(e,"utf8");return C(o,t)}function C(e,t){for(var o,i=e.split("\n"),n=0;n<i.length;n++)if(i[n].indexOf(t)!==-1){var a=i[n].split(":");if(2===a.length){o=a[1].replace(/.*["'](.*)["'].*/,"$1");break}}return o}function x(e){e.model.startTransaction("fixup-links"),e.links.each(function(e){e.invalidateRoute()}),e.model.commitTransaction("fixup-links")}function D(e){for(var t=!1,o=0,i=e.nodeDataArray;o<i.length;o++){var n=i[o],a=N(e,n);t=t||a}return t}function N(e,t){var o=!1;"Flow.Begin-Async"===t.class&&(e.setDataProperty(t,"class","Flow.Begin-Parallel"),o=!0),t.clazz||(e.setDataProperty(t,"clazz",t.class),o=!0);var i=t.options;return t.class.startsWith("Mim")&&i.mimId&&!i.mimPath&&(i.mimPath="mims/en-us/"+i.mimId+".mim",delete i.mimId,o=!0),t.class.startsWith("Mim")&&i.onResults&&!i.onSuccess&&(i.onSuccess=i.onResults,delete i.onResults,o=!0),o}function P(e,t,o,i){var n=this.diagram.lastInput,a=this.isGridSnapEnabled;return n.shift&&(this.isGridSnapEnabled=!a),i=z.default.DraggingTool.prototype.computeMove.call(this,e,t,o,i),this.isGridSnapEnabled=a,i}function _(){var e=document.createElement("div");e.innerHTML="<br><style>.gsfBackground {\n border-color: #f8887b;\n font-size: 16px;\n margin-bottom: 10px;\n}\n</style>",e.style.display="none",document.body.appendChild(e)}var O=e("react"),T=e("../../atom-react/mixins/pane-resize-event-mixin"),L=e("fs"),j=e("path"),R=e("normalize-path"),I=e("node-uuid"),B=e("../../common/modals/choose-file-modal"),A=e("../modals/choose-flow-modal"),F=e("jquery"),H=e("../flow-editor"),U=e("./JiboColors"),z=e("./go");_();var W=z.default.GraphObject.make,V=e("./LinkLabelDraggingTool"),K=e("./LinkShiftingTool"),G=e("./GuidedDraggingTool"),J=e("./ResizeMultipleTool"),q=e("../../common/layout/layout"),X=e("../../common/layout/h-layout"),Y=e("./flow-arguments-view"),Q=e("./procedure-view"),$=e("atom"),Z=O.createClass({displayName:"FlowEditorView",mixins:[T.default],versionUpModified:!1,shapeProperties:{},paletteIconWidth:140,getInitialState:function(){return{selectedShape:null,tempSelectedShape:null,diagram:null,key:0}},componentDidMount:function(){this.setupPaneResizeEventMixin(),this.disposables=new $.CompositeDisposable,this.disposables.add(atom.commands.add(this.getDOMNode(),{"jibo-sdk:align-shape-tops":this.alignShapeTops,"jibo-sdk:align-shape-middles":this.alignShapeMiddles,"jibo-sdk:align-shape-bottoms":this.alignShapeBottoms,
"jibo-sdk:align-shape-lefts":this.alignShapeLefts,"jibo-sdk:align-shape-centers":this.alignShapeCenters,"jibo-sdk:align-shape-rights":this.alignShapeRights,"jibo-sdk:align-shape-widths":this.alignShapeWidths,"jibo-sdk:align-shape-heights":this.alignShapeHeights,"jibo-sdk:distribute-shapes-vertically":this.distributeShapesVertically,"jibo-sdk:distribute-shapes-horizontally":this.distributeShapesHorizontally,"jibo-sdk:distribute-shapes-tops":this.distributeShapesTops,"jibo-sdk:distribute-shapes-middles":this.distributeShapesMiddles,"jibo-sdk:distribute-shapes-bottoms":this.distributeShapesBottoms,"jibo-sdk:distribute-shapes-lefts":this.distributeShapesLefts,"jibo-sdk:distribute-shapes-centers":this.distributeShapesCenters,"jibo-sdk:distribute-shapes-rights":this.distributeShapesRights,"jibo-sdk:toggle-grid":this.toggleGrid,"jibo-sdk:toggle-alignment-guide":this.toggleAlignmentGuide,"jibo-sdk:toggle-snap-into-position":this.toggleSnapIntoPosition,"core:undo":this.undo,"core:redo":this.redo,"core:cut":this.cut,"core:copy":this.copy,"core:paste":this.paste}));var e=O.findDOMNode(this.refs.palette),t=O.findDOMNode(this.refs.diagram);this.initializeSurface(e,t)},componentWillUnmount:function(){this.cleanupPaneResizeEventMixin(),this.disposables.dispose()},componentWillReceiveProps:function(){this.requestDiagramUpdate()},dispose:function(){this.saveUiState(this.layout)},serialize:function(){this.saveUiState(this.layout)},onInnerHLayoutResize:function(){},onHLayoutResize:function(){},onVLayoutResize:function(){},undo:function(){},redo:function(){},cut:function(){},copy:function(){},paste:function(){},render:function(){var e=this,t={border:"solid 1px gray",height:"100%"},o=this.state.diagram,i=[],n=this.state.selectedShape||this.state.tempSelectedShape,a=this.state.selectedShape instanceof z.default.Node||this.state.selectedShape instanceof z.default.Link,r=this.state.tempSelectedShape instanceof z.default.Node;return!o||a&&!r||i.push(O.createElement(Q.default,{model:this.props.editor.model,setParentsSelectedShape:function(t){e.setState({tempSelectedShape:t,selectedShape:null})},diagram:o,projectRoot:this.props.editor.projectRoot})),(a||r)&&(0!==i.length&&i.push(O.createElement("hr",{key:this.state.key++})),i.push(O.createElement(Y.default,{title:n?n.data.name:"",subtitle:n?n.data.class:"",model:this.props.editor.model,shape:n,projectRoot:this.props.editor.projectRoot}))),O.createElement("div",{tabIndex:-1},O.createElement(q.default,{width:this.props.paneWidth,height:this.props.paneHeight-40,ref:"topLevel",serialized:this.props.editor.layout},O.createElement(X.default,{onLayoutResize:this.onLayoutResize},O.createElement("div",{style:t,ref:"palette"}),O.createElement("div",{className:"native-key-bindings",style:t,ref:"diagram"}),O.createElement("div",{className:"right-pane",ref:"rightPane"},O.createElement("div",{className:"arguments-scroll-container"},i)))))},onLayoutResize:function(){this.requestDiagramUpdate()},initializeSurface:function(e,t){this.loadShapeProperties();var o=this.setupDiagram(t),i=this.setupPalette(e);this.setupNodeTemplates(o,!1),this.setupNodeTemplates(i,!0),this.loadPalette(i),this.setupLinkTemplates(o);var n=this.loadFromFile(this.props.editor.uri);this.versionUpModified=D(n),o.model=n,this.props.editor.model.setSurface(o,i),this.setState({selectedShape:void 0,diagram:o}),this.requestDiagramUpdate=function(){o.requestUpdate(),i.requestUpdate()},this.requestDiagramUpdate()},requestDiagramUpdate:function(){},setupDiagram:function(e){var t=this,o=W(z.default.Diagram,e,{allowDrop:!0,allowResize:!0,initialContentAlignment:z.default.Spot.Center,LinkDrawn:this.showLinkLabel,LinkRelinked:this.showLinkLabel,"animationManager.isEnabled":!1,"undoManager.isEnabled":!0,resizingTool:new J.ResizeMultipleTool,draggingTool:new G.GuidedDraggingTool,"draggingTool.horizontalGuidelineColor":"blue","draggingTool.verticalGuidelineColor":"blue","draggingTool.centerGuidelineColor":"green","draggingTool.guidelineWidth":1}),n="#2B3856",a="#151B54";return o.grid=W(z.default.Panel,"Grid",{name:"GRID",visible:!1,gridCellSize:new z.default.Size(10,10),gridOrigin:new z.default.Point(0,0)},W(z.default.Shape,"LineH",{stroke:a,strokeWidth:.5,interval:1}),W(z.default.Shape,"LineH",{stroke:a,strokeWidth:.5,interval:5}),W(z.default.Shape,"LineH",{stroke:n,strokeWidth:1,interval:10}),W(z.default.Shape,"LineV",{stroke:a,strokeWidth:.5,interval:1}),W(z.default.Shape,"LineV",{stroke:a,strokeWidth:.5,interval:5}),W(z.default.Shape,"LineV",{stroke:n,strokeWidth:1,interval:10})),e.style.position="relative",o.addDiagramListener("ObjectDoubleClicked",function(e){var i=e.subject.part;if(i instanceof z.default.Node){var n=i.data,a=void 0,r=j.parse(t.props.editor.getURI()).dir;"Flow.Subflow"===n.class?a=j.resolve(r,n.options.subflowId+".flow"):n.class.startsWith("Mim")&&n.options.mimPath?a=j.resolve(t.props.editor.projectRoot,n.options.mimPath):"Subtree"!==n.class&&"Flow.Subtree"!==n.class||(a=j.resolve(r,n.options.behaviorPath+".bt")),a&&L.existsSync(a)&&atom.workspace.open(a)}else if(i instanceof z.default.Link){var s=i.findObject("link-label");s&&o.commandHandler.editTextBlock(s)}}),o.addDiagramListener("Modified",function(){var e=o.isModified||t.versionUpModified;t.versionUpModified=!1,t.props.editor.showModified(e)}),o.addDiagramListener("ExternalObjectsDropped",function(e){var i=[];e.subject.each(function(e){i.push(e)}),o.toolManager.draggingTool.clearGuidelines();for(var n=function(e){return e.data._deleteOnDrop?(e.diagram.commandHandler.deleteSelection(),"continue"):(delete e.data.key,delete e.data.paletteOrdering,delete e.data._isPaletteNode,e.data.options={},t.displayShape(e.part),void t.chooseNameOrTargetOfActivity(o,e.part,function(){},function(){e.diagram.commandHandler.deleteSelection()}))},a=0,r=i;a<r.length;a++){var s=r[a];n(s)}}),o.addDiagramListener("ClipboardPasted",function(e){var t=[];e.subject.each(function(e){t.push(e)});for(var i=0,n=t;i<n.length;i++){var a=n[i];if(a instanceof z.default.Link)a.invalidateRoute();else if(a.location=new z.default.Point(a.location.x+10,a.location.y+10),a.data&&a.data.options){var r=JSON.parse(JSON.stringify(a.data.options));o.model.setDataProperty(a.data,"options",r)}}o.selectCollection(t)}),o.addDiagramListener("SelectionCopied",function(e){var t=[];e.subject.each(function(e){t.push(e)});for(var i=0,n=t;i<n.length;i++){var a=n[i];if(a.data&&a.data.options){var r=JSON.parse(JSON.stringify(a.data.options));o.model.setDataProperty(a.data,"options",r)}}o.selectCollection(t)}),o.addDiagramListener("ChangedSelection",function(){var e=[];o.selection.each(function(t){e.push(t)}),1===e.length&&e[0].data&&!e[0].data._isPaletteNode?t.displayShape(e[0]):t.displayShape(void 0)}),o.addDiagramListener("BackgroundSingleClicked",function(){t.displayShape(void 0)}),o.addDiagramListener("TextEdited",function(){if(1===o.selection.count){var e=o.selection.first();t.displayShape(e)}}),o.addDiagramListener("SelectionMoved",function(e){x(e.diagram)}),o.addDiagramListener("InitialLayoutCompleted",function(){x(o)}),o.commandHandler.doKeyDown=function(){l(o)||z.default.CommandHandler.prototype.doKeyDown.call(o.commandHandler)},o.toolManager.textEditingTool.doBlur=function(){var e=o.toolManager.textEditingTool;null!==e.textBlock&&e.doCancel()},atom.config.observe("jibo-sdk.FlowEditorSnapIntoPosition",function(e){"boolean"==typeof e&&(o.toolManager.draggingTool.isGridSnapEnabled=e,o.toolManager.resizingTool.isGridSnapEnabled=e)}),atom.config.observe("jibo-sdk.FlowEditorShowGridLines",function(e){"boolean"==typeof e&&(o.grid.visible=e)}),atom.config.observe("jibo-sdk.FlowEditorShowAlignmentGuides",function(e){"boolean"==typeof e&&(o.toolManager.draggingTool.isGuidelineEnabled=e)}),atom.config.observe("jibo-sdk.FlowEditorUseOrthogonalLinks",function(e){i(o)}),atom.config.observe("jibo-sdk.FlowEditorRouteLinksAroundNodes",function(e){i(o)}),o.toolManager.draggingTool.computeMove=P,o.toolManager.mouseDownTools.add(new K.LinkShiftingTool),o.toolManager.mouseMoveTools.insertAt(0,new V.LinkLabelDraggingTool),o.toolManager.textEditingTool.doBlur=function(){var e=o.toolManager.textEditingTool;null!==e.textBlock&&e.doCancel()},o},isTargetTypeActivity:function(e){var t=e.data;return t.class.startsWith("Mim")||"Flow.Subflow"===t.class||"Flow.Subtree"===t.class},chooseNameOrTargetOfActivity:function(e,t,o,i){var n=this,a=t.data;if(a.class.startsWith("Mim")){var r=new oe(this.props.editor.projectRoot,function(i,a){b(n.props.editor.model,n.props.editor.projectRoot,e.model,i,t),n.displayShape(t),o()},function(){i()}),s=a.class.replace(/^Mim./,"mim_type.*").toLowerCase();r.createModal(s)}else if("Flow.Subflow"===a.class){var l=this.props.editor.projectRoot+"/src",r=new ee(l,function(i,a){v(n.props.editor,a,e.model,i,t),n.displayShape(t),o()},function(){i()});r.createModal()}else if("Flow.Subtree"===a.class){var l=this.props.editor.projectRoot+"/src",r=new te(l,function(i,a){y(n.props.editor,a,e.model,i,t),n.displayShape(t),o()},function(){i()});r.createModal()}else if("Flow.Picture"===a.class){var l=this.props.editor.projectRoot+"/src",r=new ie(l,function(i,a){g(n.props.editor,a,e.model,i,t),n.displayShape(t),o()},function(){i()});r.createModal()}else{var d=t.findObject("node-label");d&&e.commandHandler.editTextBlock(d),o()}},setupNodeTemplates:function(e,t){function o(e){return void 0!==e.name&&""!==e.name}var i=this,n=U.default.Metro,a=U.default.Background,r=72;e.nodeTemplateMap.add("",W(z.default.Node,"Auto",this.nodeStyle(t),W(z.default.Panel,"Auto",W(z.default.Shape,"RoundedRectangle",{cursor:"pointer",name:"activity-shape",fill:a,minSize:t?new z.default.Size(this.paletteIconWidth,NaN):new z.default.Size(NaN,NaN),strokeWidth:3},new z.default.Binding("fill","isHighlighted",function(e){return e?"red":a}).ofObject(),new z.default.Binding("stroke","",function(e){return i.getPropertyForShape(e.clazz,"color")}),new z.default.Binding("figure","",function(e){return i.getPropertyForShape(e.clazz,"figure")})),W(z.default.Panel,"Vertical",{margin:3,cursor:"move",stretch:z.default.GraphObject.Horizontal},W(z.default.TextBlock,{name:"node-label",font:"11pt Helvetica, Arial, sans-serif",stroke:U.default.White,margin:new z.default.Margin(8,8,0,8),wrap:z.default.TextBlock.WrapDesiredSize,textAlign:"center",editable:!0,isMultiline:!1,fromLinkable:!1,toLinkable:!1},new z.default.Binding("visible","",o),new z.default.Binding("text","name").makeTwoWay()),W(z.default.TextBlock,{font:"8pt Helvetica, Arial, sans-serif",margin:3,wrap:z.default.TextBlock.None,editable:!1,fromLinkable:!1,toLinkable:!1},new z.default.Binding("stroke","",function(e){return i.getPropertyForShape(e.clazz,"color")}),new z.default.Binding("text","clazz")))),new z.default.Binding("fromLinkable","",function(e){return"Flow.End"!==e.class&&"Flow.Throw"!==e.class}))),e.nodeTemplateMap.add("Flow.Begin-Parallel",W(z.default.Node,"Spot",this.nodeStyle(t),{resizable:!1,toLinkable:!1},W(z.default.Panel,"Auto",W(z.default.Shape,"Circle",{cursor:"pointer",desiredSize:new z.default.Size(r,r),stroke:n,strokeWidth:3,fill:a}),W(z.default.TextBlock,"Parallel\nBegin",{cursor:"move",font:"12pt Helvetica, Arial, sans-serif",stroke:this.getPropertyForShape("Flow.Begin-Parallel","color"),textAlign:"center",fromLinkable:!1,toLinkable:!1},new z.default.Binding("text"))),{fromMaxLinks:1})),e.nodeTemplateMap.add("Flow.Begin",W(z.default.Node,"Spot",this.nodeStyle(t),{resizable:!1,toLinkable:!1},W(z.default.Panel,"Auto",W(z.default.Shape,"Circle",{cursor:"pointer",desiredSize:new z.default.Size(r,r),stroke:n,strokeWidth:3,fill:a}),W(z.default.TextBlock,"Begin",{cursor:"move",font:"15pt Helvetica, Arial, sans-serif",stroke:this.getPropertyForShape("Flow.Begin","color"),textAlign:"center",fromLinkable:!1,toLinkable:!1},new z.default.Binding("text"))),{fromMaxLinks:1})),e.nodeTemplateMap.add("Flow.Comment",W(z.default.Node,"Auto",this.nodeStyle(t),{cursor:"move"},{fromLinkable:!1,toLinkable:!1},W(z.default.Shape,"RoundedRectangle",{name:"activity-shape",minSize:t?new z.default.Size(this.paletteIconWidth,NaN):new z.default.Size(NaN,NaN),fill:a,stroke:n,strokeWidth:2}),W(z.default.TextBlock,{name:"node-label",margin:5,wrap:z.default.TextBlock.WrapFit,textAlign:"left",editable:!0,font:"italic 12pt Helvetica, Arial, sans-serif",stroke:this.getPropertyForShape("Flow.Comment","color")},new z.default.Binding("text").makeTwoWay()))),t?e.nodeTemplateMap.add("Flow.Picture",W(z.default.Node,"Auto",this.nodeStyle(t),{cursor:"move"},{fromLinkable:!1,toLinkable:!1},W(z.default.Shape,"RoundedRectangle",{name:"activity-shape",minSize:new z.default.Size(this.paletteIconWidth,NaN),fill:a,stroke:n,strokeWidth:2}),W(z.default.TextBlock,{name:"node-label",margin:5,wrap:z.default.TextBlock.WrapFit,textAlign:"left",editable:!0,font:"italic 12pt Helvetica, Arial, sans-serif",stroke:U.default.White},new z.default.Binding("text")))):e.nodeTemplateMap.add("Flow.Picture",W(z.default.Node,"Auto",this.nodeStyle(t),{cursor:"move",fromLinkable:!1,toLinkable:!1},W(z.default.Shape,"RoundedRectangle",{name:"activity-shape",fill:a,stroke:n,strokeWidth:2}),W(z.default.Panel,"Table",{stretch:z.default.GraphObject.Fill,margin:10},W(z.default.TextBlock,"",{text:"picture",font:"italic 12pt Helvetica, Arial, sans-serif",row:0,textAlign:"center",stroke:"white",editable:!0,alignment:z.default.Spot.BottomLeft,minSize:new z.default.Size(NaN,20)},new z.default.Binding("text","title").makeTwoWay(),new z.default.Binding("visible","",function(e){return!!e.title}),new z.default.Binding("width","desiredSize",function(e){return isNaN(e.width)?i.paletteIconWidth:e.width-30}).ofObject()),W(z.default.Panel,"Viewbox",{row:1,stretch:z.default.GraphObject.Fill},W(z.default.Picture,{imageStretch:z.default.GraphObject.UniformToFill},new z.default.Binding("source","url",function(e){return e.startsWith("http")||e.startsWith("/")||(e=i.props.editor.projectRoot+"/"+e),e}))),W(z.default.TextBlock,"",{row:2,stroke:"white",editable:!0,alignment:z.default.Spot.BottomLeft,minSize:new z.default.Size(NaN,20)},new z.default.Binding("text","caption").makeTwoWay(),new z.default.Binding("visible","",function(e){return!!e.caption}),new z.default.Binding("width","desiredSize",function(e){return isNaN(e.width)?i.paletteIconWidth:e.width-30}).ofObject()))))},nodeStyle:function(e){var t={mouseDragEnter:this.mouseDragEnterReplacement,mouseDragLeave:this.mouseDragLeaveReplacement,mouseDrop:this.mouseDropInReplacement.bind(this),resizable:!0,fromSpot:z.default.Spot.AllSides,toSpot:z.default.Spot.AllSides,fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0};return e&&(t.locationSpot=z.default.Spot.Center),[t,new z.default.Binding("desiredSize","size",z.default.Size.parse).makeTwoWay(z.default.Size.stringify),new z.default.Binding("location","loc",z.default.Point.parse).makeTwoWay(z.default.Point.stringify)]},setLinkingSpotForShape:function(){return z.default.Spot.AllSides},mouseDragEnterReplacement:function(e,t){var o=t.diagram.selection.first();if(o){var i=o.part;if(!i.data||!i.data._isPaletteNode)return}e.handled=!0,t.isSelected=!0},mouseDragLeaveReplacement:function(e,t){t.isSelected=!1},mouseDropInReplacement:function(e,t){var o=this,i=t.diagram.selection.first();if(i){var n=i.part,a=t.part;n.data._isPaletteNode&&"Flow.Comment"!==n.data.class&&!a.data._isPaletteNode&&(n.data._deleteOnDrop=!0,t.diagram.model.startTransaction("drop-in replacement"),this.props.editor.model.clearObsoleteOptions(a.data,n.data),t.diagram.model.setCategoryForNodeData(a.data,n.data.class),t.diagram.model.setDataProperty(a.data,"clazz",n.data.class),this.chooseNameOrTargetOfActivity(t.diagram,a,function(){t.diagram.model.commitTransaction("drop-in replacement"),o.displayShape(a)},function(){t.diagram.undoManager.rollbackTransaction()}))}},setupLinkTemplates:function(e){function t(e){return(!e.fromNode||!e.fromNode.part.data.class.startsWith("Flow.Begin"))&&(!!e.isSelected||"undefined"!=typeof e.data.text&&""!==e.data.text)}var o="#363B46",i="#FFFFFF";e.model.startTransaction("setup-link-templates"),e.linkTemplate=W(z.default.Link,{routing:n(),curve:a(),corner:5,toShortLength:4,relinkableFrom:!0,relinkableTo:!0,layerName:"Background",mouseDragEnter:this.mouseDragEnterHighlight,mouseDragLeave:this.mouseDragLeaveHighlight,mouseDrop:this.mouseDropInsert,mouseEnter:function(e,t){t.findObject("HIGHLIGHT").stroke="rgba(30,144,255,0.2)"},mouseLeave:function(e,t){t.findObject("HIGHLIGHT").stroke="transparent"}},new z.default.Binding("fromSpot").makeTwoWay(),new z.default.Binding("toSpot").makeTwoWay(),W(z.default.Shape,{isPanelMain:!0,strokeWidth:8,stroke:"transparent",name:"HIGHLIGHT"}),W(z.default.Shape,{isPanelMain:!0,stroke:"gray",strokeWidth:2}),W(z.default.Shape,{toArrow:"standard",stroke:"gray",fill:"gray",scale:1.1}),W(z.default.Panel,"Auto",{cursor:"pointer",name:"LABEL",segmentIndex:1,segmentFraction:.2},new z.default.Binding("visible","text",function(e,o){return t(o.part)}),new z.default.Binding("visible","isSelected",function(e,o){return t(o.part)}).ofObject(),W(z.default.Shape,"RoundedRectangle",{fill:o,stroke:null}),W(z.default.TextBlock,"",{name:"link-label",textAlign:"center",font:"10pt helvetica, arial, sans-serif",stroke:i,editable:!0,isMultiline:!1},new z.default.Binding("text","text").makeTwoWay()),new z.default.Binding("segmentOffset","segmentOffset",z.default.Point.parse).makeTwoWay(z.default.Point.stringify)));for(var r=0,s=[e.toolManager.linkingTool,e.toolManager.relinkingTool];r<s.length;r++){var l=s[r],d=l;d.temporaryLink.routing=z.default.Link.Normal,d.temporaryLink.curve=z.default.Link.Normal,d.temporaryLink.path.stroke="white";var c=d.temporaryLink.elt(1);c.stroke="white",c.fill="white",d.temporaryLink.path.strokeWidth=2,d.portGravity=50,d.direction=z.default.LinkingTool.ForwardsOnly}e.model.commitTransaction("setup-link-templates")},mouseDragEnterHighlight:function(e,t){t.findObject("HIGHLIGHT").stroke="rgba(30,144,255,0.2)";var o=t.diagram.selection.first();if(o){var i=o.part;if(!i.data||!i.data._isPaletteNode)return}e.handled=!0,t.isSelected=!0},mouseDragLeaveHighlight:function(e,t){t.isSelected=!1},mouseDropInsert:function(e,t){var o=t.diagram.selection.first();if(o){var i=o.part;i.data._isPaletteNode&&(t.diagram.model.startTransaction("insert-activity"),e.diagram.toolManager.linkingTool.insertLink(i,null,t.toNode,null),t.toNode=i,t.diagram.model.commitTransaction("insert-activity"))}},setupPalette:function(e){var t=this,o=W(z.default.Palette,e,{"animationManager.isEnabled":!1,maxSelectionCount:1,allowZoom:!1,initialContentAlignment:z.default.Spot.Center,model:new z.default.GraphLinksModel,layout:W(z.default.GridLayout,{alignment:z.default.GridLayout.Location,comparer:function(e,t){return e.part.data.paletteOrdering-t.part.data.paletteOrdering}})});return o.model.dataFormat="flow-1",o.model.nodeCategoryProperty="class",o.addDiagramListener("ObjectSingleClicked",function(e){var o=e.subject.part;o.data.options={},t.displayShape(o)}),o},displayShape:function(e){this.setState({selectedShape:e,tempSelectedShape:null})},setFigureForSchema:function(e){var t=e.paletteInfo.figure?e.paletteInfo.figure:"RoundedRectangle";this.setPropertyForShape(e.class,"figure",t)},setGeometryForSchema:function(e){e.paletteInfo.geometry&&(this.deletePropertyForShape(e.class,"figure"),this.setPropertyForShape(e.class,"geometry",e.paletteInfo.geometry))},setColorsForSchema:function(e){var t=U.default.JiboBlue,o=U.default.JiboBlue;e.paletteInfo.color&&(o=t=e.paletteInfo.color),e.paletteInfo.stroke&&(o=e.paletteInfo.stroke),this.setPropertyForShape(e.class,"color",this.jiboColorify(t)),this.setPropertyForShape(e.class,"stroke",this.jiboColorify(o))},jiboColorify:function(e){return e in U.default&&(e=U.default[e]),e},setPropertyForShape:function(e,t,o){var i=this.shapeProperties[e];i||(i=this.shapeProperties[e]={}),i[t]=o},deletePropertyForShape:function(e,t){this.shapeProperties[e]&&delete this.shapeProperties[e][t]},getPropertyForShape:function(e,t){return this.shapeProperties[e][t]},loadShapeProperties:function(){for(var e=this.props.editor.model.getFlowSchemas(),t=0,o=e;t<o.length;t++){var i=o[t];this.setColorsForSchema(i),this.setFigureForSchema(i),this.setGeometryForSchema(i)}},loadPalette:function(e){for(var t=1e3,o=[],i=this.props.editor.model.getFlowSchemas(),n=0,a=i;n<a.length;n++){var r=a[n],s={class:r.class,clazz:r.class,"asset-pack":r.assetPack};s.text=r.paletteInfo.text,s.title=r.paletteInfo.title,s.paletteOrdering=r.paletteInfo.order?r.paletteInfo.order:t++,s._isPaletteNode=!0,o.push(s)}e.model.nodeDataArray=o},stringifyOptions:function(e){for(var t=e.nodeDataArray,o=0;o<t.length;o++){var i=t[o];if(i.options)for(var n=Object.keys(i.options),a=0;a<n.length;a++){var r=n[a];Array.isArray(i.options[r])&&(i.options[r]=i.options[r].join("\n"))}}},removePoints:function(e){for(var t=0,o=e.linkDataArray;t<o.length;t++){var i=o[t];delete i.points}},loadFromFile:function(e){var t=L.readFileSync(e,"utf8"),o=JSON.parse(t);this.stringifyOptions(o),this.removePoints(o);var i=z.default.Model.fromJson(o);return i.makeUniqueKeyFunction=function(){return I.v4()},i},showLinkLabel:function(e){var t=e.subject.findObject("LABEL");null!==t&&(t.visible=!(e.subject.fromNode&&e.subject.fromNode.data.clazz.startsWith("Flow.Begin")))},alignShapeTops:function(){var e=this.findInSelection("min",function(e){return e.actualBounds.y});this.moveSelection(function(e){return e.actualBounds.x},function(){return e})},alignShapeMiddles:function(){var e,t=this.state.diagram.selection.first();t&&(e=t.actualBounds.centerY),this.moveSelection(function(e){return e.actualBounds.x},function(t){return e-t.actualBounds.height/2})},alignShapeBottoms:function(){var e=this.findInSelection("max",function(e){return e.actualBounds.bottom});this.moveSelection(function(e){return e.actualBounds.x},function(t){return e-t.actualBounds.height})},alignShapeLefts:function(){var e=this.findInSelection("min",function(e){return e.actualBounds.x});this.moveSelection(function(){return e},function(e){return e.actualBounds.y})},alignShapeCenters:function(){var e,t=this.state.diagram.selection.first();t&&(e=t.actualBounds.x+t.actualBounds.width/2),this.moveSelection(function(t){return e-t.actualBounds.width/2},function(e){return e.actualBounds.y})},alignShapeRights:function(){var e=this.findInSelection("max",function(e){return e.actualBounds.x+e.actualBounds.width});this.moveSelection(function(t){return e-t.actualBounds.width},function(e){return e.actualBounds.y})},alignShapeWidths:function(){var e=this.findInSelection("max",function(e){return e.actualBounds.width},{noBegins:!0});this.updateSelection(function(t){t.desiredSize=new z.default.Size(e,t.actualBounds.height,e)},{noBegins:!0})},alignShapeHeights:function(){var e=this.findInSelection("max",function(e){return e.actualBounds.height},{noBegins:!0});this.updateSelection(function(t){t.desiredSize=new z.default.Size(t.actualBounds.width,e)},{noBegins:!0})},distributeShapesVertically:function(){var e=this.findInSelection("sum",function(){return 1});if(!(e<2)){var t=this.findInSelection("min",function(e){return e.actualBounds.top}),o=this.findInSelection("max",function(e){return e.actualBounds.bottom}),i=this.findInSelection("sum",function(e){return e.actualBounds.height}),n=o-t,a=(n-i)/(e-1),r=t;this.updateSelection(function(e){e.moveTo(e.actualBounds.x,r),r+=e.actualBounds.height+a},{sortVertically:!0})}},distributeShapesTops:function(){var e=this.findInSelection("sum",function(){return 1});if(!(e<2)){var t=this.findInSelection("min",function(e){return e.actualBounds.top}),o=this.findInSelection("max",function(e){return e.actualBounds.top}),i=o-t,n=i/(e-1),a=t;this.updateSelection(function(e){e.moveTo(e.actualBounds.x,a),a+=n},{sortVertically:!0})}},distributeShapesMiddles:function(){var e=this.findInSelection("sum",function(){return 1});if(!(e<2)){var t=this.findInSelection("min",function(e){return e.actualBounds.centerY}),o=this.findInSelection("max",function(e){return e.actualBounds.centerY}),i=o-t,n=i/(e-1),a=t;this.updateSelection(function(e){e.moveTo(e.actualBounds.x,a-e.actualBounds.height/2),a+=n},{sortVertically:!0})}},distributeShapesBottoms:function(){var e=this.findInSelection("sum",function(){return 1});if(!(e<2)){var t=this.findInSelection("min",function(e){return e.actualBounds.bottom}),o=this.findInSelection("max",function(e){return e.actualBounds.bottom}),i=o-t,n=i/(e-1),a=t;this.updateSelection(function(e){e.moveTo(e.actualBounds.x,a-e.actualBounds.height),a+=n},{sortVertically:!0})}},distributeShapesHorizontally:function(){var e=this.findInSelection("sum",function(){return 1});if(!(e<2)){var t=this.findInSelection("min",function(e){return e.actualBounds.left}),o=this.findInSelection("max",function(e){return e.actualBounds.right}),i=this.findInSelection("sum",function(e){return e.actualBounds.width}),n=o-t,a=(n-i)/(e-1),r=t;this.updateSelection(function(e){e.moveTo(r,e.actualBounds.y),r+=e.actualBounds.width+a},{sortHorizontally:!0})}},distributeShapesLefts:function(){var e=this.findInSelection("sum",function(){return 1});if(!(e<2)){var t=this.findInSelection("min",function(e){return e.actualBounds.left}),o=this.findInSelection("max",function(e){return e.actualBounds.left}),i=o-t,n=i/(e-1),a=t;this.updateSelection(function(e){e.moveTo(a,e.actualBounds.y),a+=n},{sortHorizontally:!0})}},distributeShapesCenters:function(){var e=this.findInSelection("sum",function(){return 1});if(!(e<2)){var t=this.findInSelection("min",function(e){return e.actualBounds.centerX}),o=this.findInSelection("max",function(e){return e.actualBounds.centerX}),i=o-t,n=i/(e-1),a=t;this.updateSelection(function(e){e.moveTo(a-e.actualBounds.width/2,e.actualBounds.y),a+=n},{sortHorizontally:!0})}},distributeShapesRights:function(){var e=this.findInSelection("sum",function(){return 1});if(!(e<2)){var t=this.findInSelection("min",function(e){return e.actualBounds.right}),o=this.findInSelection("max",function(e){return e.actualBounds.right}),i=o-t,n=i/(e-1),a=t;this.updateSelection(function(e){e.moveTo(a-e.actualBounds.width,e.actualBounds.y),a+=n},{sortHorizontally:!0})}},findInSelection:function(e,t,o){switch(e){case"min":return this.reduceSelection(function(e,o){return Math.min(e,t(o))},1/0,o);case"max":return this.reduceSelection(function(e,o){return Math.max(e,t(o))},-(1/0),o);case"sum":return this.reduceSelection(function(e,o){return e+t(o)},0,o)}},reduceSelection:function(e,t,o){var i=[];return this.state.diagram.selection.each(function(e){e instanceof z.default.Link||o&&o.noBegins&&e.part.data.class.startsWith("Flow.Begin")||i.push(e)}),i.reduce(e,t)},moveSelection:function(e,t){this.updateSelection(function(o){return o.move(new z.default.Point(e(o),t(o)))})},updateSelection:function(e,t){this.state.diagram.startTransaction("setting alignments");var o=[];this.state.diagram.selection.each(function(e){e instanceof z.default.Link||t&&t.noBegins&&e.part.data.class.startsWith("Flow.Begin")||o.push(e)}),t&&t.sortVertically&&o.sort(function(e,t){return e.actualBounds.y-t.actualBounds.y}),t&&t.sortHorizontally&&o.sort(function(e,t){return e.actualBounds.x-t.actualBounds.x});for(var i=0,n=o;i<n.length;i++){var a=n[i];e(a)}x(this.state.diagram),this.state.diagram.commitTransaction("setting alignments")},toggleSnapIntoPosition:function(){var e=atom.config.get("jibo-sdk.FlowEditorSnapIntoPosition");atom.config.set("jibo-sdk.FlowEditorSnapIntoPosition",!e)},toggleGrid:function(){var e=atom.config.get("jibo-sdk.FlowEditorShowGridLines");atom.config.set("jibo-sdk.FlowEditorShowGridLines",!e)},toggleAlignmentGuide:function(){var e=atom.config.get("jibo-sdk.FlowEditorShowAlignmentGuides");atom.config.set("jibo-sdk.FlowEditorShowAlignmentGuides",!e)}}),ee=function(){function e(e,t,o){this.root=e,this.onChoose=t,this.onCancel=o,this.state={}}return e.prototype.createModal=function(){var e=this;this._modalContainer=F("<div/>");var t=O.createElement(A.default,{root:this.root,onChoose:this.onChoose,onCancel:this.onCancel,onClose:function(){e.destroyModal()}});O.render(t,this._modalContainer[0]),this.state.modalPanel=atom.workspace.addModalPanel({item:this._modalContainer})},e.prototype.destroyModal=function(){O.unmountComponentAtNode(this._modalContainer[0]),this.state.modalPanel&&(this.state.modalPanel.destroy(),this.state.modalPanel=void 0)},e}(),te=function(){function e(e,t,o){this.root=e,this.onChoose=t,this.onCancel=o,this.state={}}return e.prototype.createModal=function(){var e=this;this._modalContainer=F("<div/>");var t=O.createElement(B.default,{root:this.root,settings:B.BTSettings,onChoose:this.onChoose,onCancel:this.onCancel,onClose:function(){e.destroyModal()}});O.render(t,this._modalContainer[0]),this.state.modalPanel=atom.workspace.addModalPanel({item:this._modalContainer})},e.prototype.destroyModal=function(){O.unmountComponentAtNode(this._modalContainer[0]),this.state.modalPanel&&(this.state.modalPanel.destroy(),this.state.modalPanel=void 0)},e}(),oe=function(){function e(e,t,o){this.root=e,this.onChoose=t,this.onCancel=o,this.state={}}return e.prototype.createModal=function(e){var t=this;this._modalContainer=F("<div/>");var o=O.createElement(B.default,{root:this.root,settings:Object.assign({},B.MimSettings,{contentFilter:e}),onChoose:this.onChoose,onCancel:this.onCancel,onClose:function(){t.destroyModal()}});O.render(o,this._modalContainer[0]),this.state.modalPanel=atom.workspace.addModalPanel({item:this._modalContainer})},e.prototype.destroyModal=function(){O.unmountComponentAtNode(this._modalContainer[0]),this.state.modalPanel&&(this.state.modalPanel.destroy(),this.state.modalPanel=void 0)},e}(),ie=function(){function e(e,t,o){this.root=e,this.onChoose=t,this.onCancel=o,this.state={}}return e.prototype.createModal=function(){var e=this;this._modalContainer=F("<div/>");var t=O.createElement(B.default,{root:this.root,settings:B.ImageSettings,onChoose:this.onChoose,onCancel:this.onCancel,onClose:function(){e.destroyModal()}});O.render(t,this._modalContainer[0]),this.state.modalPanel=atom.workspace.addModalPanel({item:this._modalContainer})},e.prototype.destroyModal=function(){O.unmountComponentAtNode(this._modalContainer[0]),this.state.modalPanel&&(this.state.modalPanel.destroy(),this.state.modalPanel=void 0)},e}(),ne=[{key:"control-M",method:c},{key:"control-N",method:u},{key:"control-L",method:h},{key:"control-T",method:p},{key:"Up",method:d},{key:"Down",method:d},{key:"Left",method:d},{key:"Right",method:d},{key:"meta-Up",method:d},{key:"meta-Down",method:d},{key:"meta-Left",method:d},{key:"meta-Right",method:d}];Object.defineProperty(o,"__esModule",{value:!0}),o.default=Z},{"../../atom-react/mixins/pane-resize-event-mixin":58,"../../common/layout/h-layout":103,"../../common/layout/layout":104,"../../common/modals/choose-file-modal":107,"../flow-editor":114,"../modals/choose-flow-modal":117,"./GuidedDraggingTool":118,"./JiboColors":119,"./LinkLabelDraggingTool":120,"./LinkShiftingTool":121,"./ResizeMultipleTool":122,"./flow-arguments-view":123,"./go":125,"./procedure-view":126,atom:void 0,fs:void 0,jquery:void 0,"node-uuid":void 0,"normalize-path":void 0,path:void 0,react:void 0}],125:[function(e,t,o){"use strict";var i,n=e("path"),a=e("find-root");i=e(n.join(a(__dirname),"resources/externals/go")),Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"find-root":void 0,path:void 0}],126:[function(e,t,o){"use strict";var i=e("react"),n=e("./JiboColors");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"layout-child",currentScale:1,propTypes:{diagram:i.PropTypes.object.isRequired},getDefaultProps:function(){return{}},getInitialState:function(){return{key:0}},onChange:function(e,t,o){var i=this.props.model.surface.model;i.startTransaction("field value change"),i.setDataProperty(e,t,o),i.commitTransaction("field value change")},handleMouseOver:function(){},handleMouseEnter:function(e){this.currentScale=this.props.diagram.scale,this.props.diagram.scrollToRect(e.actualBounds),this.props.diagram.scale=this.currentScale;var t=this.props.model.surface.model;
t.startTransaction("highlight change"),e.isHighlighted=!0},handleMouseLeave:function(e){this.props.diagram.scale=this.currentScale,e.diagram.undoManager.rollbackTransaction();var t=[];this.props.diagram.selection.each(function(e){t.push(e)}),0!==t.length&&this.props.diagram.scrollToRect(t[0].actualBounds)},handleClick:function(e){this.props.setParentsSelectedShape(e)},handleDoubleClick:function(e){this.props.diagram.scale=this.currentScale,e.diagram.undoManager.rollbackTransaction(),this.props.diagram.clearSelection(),this.props.diagram.select(e)},refCallback:function(e,t){var o=this;e&&(e.getDOMNode().ondblclick=function(){return o.handleDoubleClick(t)})},render:function(){var e=[],t=this.findReferences("blackboard"),o=this.findReferences("notepad\\.params"),n=this.findReferences("notepad","notepad\\.params");return this.populate(e,"Blackboard",t),this.populate(e,"Input Parameters",o),this.populate(e,"Notepad",n),i.createElement("div",null,e)},populate:function(e,t,o){for(var a=this,r=[],s="",l=function(e){var t=e.node,o={width:"100%"};e.isAssignment&&(o.color="white");var l="";e.varName!==s&&(s=l=e.varName);var c={padding:"2px"},u=i.createElement("tr",{key:d.state.key++},i.createElement("td",{key:d.state.key++,style:Object.assign({},c,{color:n.default.Limeade})},l),i.createElement("td",{key:d.state.key++,style:c},i.createElement("div",{onMouseEnter:function(){a.handleMouseEnter(t)},onMouseLeave:function(){a.handleMouseLeave(t)},ref:function(e){return a.refCallback(e,t)},onClick:function(){a.handleClick(t)},style:o},e.line)));r.push(u)},d=this,c=0,u=o;c<u.length;c++){var h=u[c];l(h)}0!==r.length&&e.push(i.createElement("div",null,i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{color:n.default.Tennis,textAlign:"center",marginTop:"6px",marginBottom:"6px"}},t)),i.createElement("div",{className:"arguments-scroll-container"},i.createElement("table",{key:this.state.key++},r))))},findReferences:function(e,t){var o=RegExp(e+"[\\.a-zA-Z_0-9]*"),i=RegExp(e+"\\.([a-zA-Z_0-9]*)"),n=t?RegExp(t):/NeverToBeMatchedPisan!/,a=[],r=[];this.props.diagram.nodes.each(function(e){r.push(e)});for(var s=0,l=r;s<l.length;s++){var d=l[s];if(d.data&&d.data.options)for(var c=0,u=Object.keys(d.data.options);c<u.length;c++){var h=u[c],p=d.data.options[h];if("string"==typeof p)for(var m=p.split("\n"),f=0,v=m;f<v.length;f++){var y=v[f],g=y.match(o);if(g&&!y.match(n)){var b=y.match(i),k="";b&&b[1]&&(k=b[1]),a.push({node:d,line:y,varName:k,sortKey:y.substr(g.index),isAssignment:this.isAssignment(g,y)})}}}}return a.sort(function(e,t){return e.sortKey.localeCompare(t.sortKey)}),a},isAssignment:function(e,t){var o=t.substr(e.index+e[0].length),i=o.trim();return i.startsWith("=")&&!i.startsWith("==")}})},{"./JiboColors":119,react:void 0}],127:[function(e,t,o){"use strict";var i=e("child_process"),n=e("../get-base-path"),a=e("jibo-cli"),r=e("crypto"),s=a.getElectronPath(),l="cmajghqmadhnadjcjhamajdhda";Object.defineProperty(o,"__esModule",{value:!0}),o.default={isUserLoggedIn:function(){var e=!0;return!e||"true"===localStorage.getItem(l)},showDialog:function(e){var t=this;r.randomBytes(48,function(o,a){var r=a.toString("hex"),d=i.spawn(s,[n.default("resources/gating/m.js")],{cwd:n.default("resources/gating"),env:{token:r}});d.stdout.on("data",function(e){var t=e.toString();t===r&&localStorage.setItem(l,"true")}),d.on("close",function(){e(null,t.isUserLoggedIn())})})}}},{"../get-base-path":128,child_process:void 0,crypto:void 0,"jibo-cli":void 0}],128:[function(e,t,o){"use strict";function i(e,t){var o=n.sep+"jibo-sdk",i=__dirname.substr(0,__dirname.indexOf(o)+o.length);return n.join(i,e||"",t||"")}var n=e("path");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{path:void 0}],129:[function(e,t,o){"use strict";function i(e){var t=d.parse(e);return null!==t.port?t.host.slice(0,-(t.port.length+1)):t.host}var n=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},a=e("path"),r=e("jibo-cli"),s=e("../toolbar/run-configuration"),l=e("events"),d=e("url-parse-as-address"),c=e("jibo-analytics"),u=function(e){function t(){var t=e.call(this)||this;t.isPlaying=!1;var o=t;return r.launcher.on("exit",function(){o.isPlaying=!1,o.emit("exit")}),t}return n(t,e),t.prototype.play=function(){this.emit("start"),this.isPlaying=!0;var e=s.default.runDir;e=e.replace("${project}",atom.project.getPaths()[0]);var t=a.resolve(e,"index.html");if("remote"===s.default.type){var o="http://"+i(s.default.host)+":8181/registry";r.launcher.play(t,o),c.default.event("toolbar","play",{mode:"remote"})}else r.launcher.play(t),c.default.event("toolbar","play",{mode:"local"})},t.prototype.stop=function(){r.launcher.stop(),c.default.event("toolbar","stop",{})},t.prototype.togglePlayer=function(){this.isPlaying?this.stop():this.play()},t}(l.EventEmitter);o.Launcher=u,Object.defineProperty(o,"__esModule",{value:!0}),o.default=new u},{"../toolbar/run-configuration":167,events:void 0,"jibo-analytics":void 0,"jibo-cli":void 0,path:void 0,"url-parse-as-address":void 0}],130:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/mixins/modal-mixin"),a=e("path"),r=e("fs"),s=e("../../common/modals/choose-file-modal"),l=e("atom"),d=e("../../common/get-asset-packs");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({mixins:[n.default],getInitialState:function(){return{file:d.assetPackUriToRelativeUri(this.props.file||"",this.props.settings.restrictPath),assetPackUri:this.props.file}},componentWillReceiveProps:function(e){var t=e.file,o=d.assetPackUriToRelativeUri(t,this.props.settings.restrictPath);this.setState({file:o,assetPackUri:t}),this.refs.editor.getDOMNode().getModel().setText(t)},render:function(){var e=!1;try{e=!r.statSync(this.getAbsoluteUri()).isFile}catch(t){e=!0}var t=e?i.createElement("div",{className:"error-messages"},"No File Found"):null;return i.createElement("div",{style:{width:"100%"}},i.createElement("div",{className:"block"},i.createElement("div",{className:"fileBlock"},i.createElement("button",{ref:"chooseFile",style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),i.createElement("atom-text-editor",{onBlur:this.onBlur,ref:"editor",mini:!0},this.state.assetPackUri)),t,i.createElement("br",null)))},getAbsoluteUri:function(){return a.resolve(this.props.projectRoot,this.state.file)},onChoose:function(){var e=this;this.createModal(i.createElement(s.default,{root:this.props.projectRoot,uri:this.getAbsoluteUri(),settings:this.props.settings,onChoose:function(t,o){e.setState({file:t,assetPackUri:o}),e.props.onChange(o),e.refs.editor.getDOMNode().getModel().setText(o)},onClose:function(){e.destroyModal()}}))},onBlur:function(){this.props.onChange(this.state.assetPackUri)},componentWillUnmount:function(){this.disposable.dispose()},componentDidMount:function(){var e=this,t=i.findDOMNode(this.refs.editor),o=t.getModel();o.onDidChange(function(){e.setState({file:d.assetPackUriToRelativeUri(o.getText(),e.props.settings.restrictPath),assetPackUri:o.getText()})}),this.disposable=new l.CompositeDisposable,this.disposable.add(atom.commands.add(t,"core:confirm",function(){e.props.onChange(e.state.assetPackUri)})),this.disposable.add(atom.tooltips.add(i.findDOMNode(this.refs.chooseFile),{title:"Change "+(this.props.settings.fileTypeName||"File")})),this.disposable.add(atom.tooltips.add(i.findDOMNode(this.refs.editor),{title:"Current "+(this.props.settings.fileTypeName||"File")}))}})},{"../../atom-react/mixins/modal-mixin":57,"../../common/get-asset-packs":100,"../../common/modals/choose-file-modal":107,atom:void 0,fs:void 0,path:void 0,react:void 0}],131:[function(e,t,o){"use strict";var i=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({render:function(){var e="";switch(this.props.icon){case"add":e="fa fa-plus-square";break;case"delete":e="fa fa-remove"}var t=null;this.props.label&&(t="  "+this.props.label),t=[i.createElement("i",{className:e,style:{fontSize:20,verticalAlign:"middle"}}),t];var o="btn",n={marginTop:4};return i.createElement("div",{ref:"button",className:o,style:n,onClick:this.onClick},t)},onClick:function(e){e.preventDefault(),e.stopPropagation(),this.props.onClick()}})},{react:void 0}],132:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default=[{displayName:"MIM Type",dataName:"mim_type",type:"dropdown",params:{data:"mimTypes"},description:"The type of the MIM.",mimTypes:["AN","OR","Q"]},{displayName:"Rule Name",dataName:"rule_name",type:"rule",description:"The name of the rule to be used by the MIM in a Question or Optional Response MIM.",mimTypes:["OR","Q"]},{displayName:"GUI",dataName:"gui",type:"guiSelector",description:"Graphical User Interface that is displayed during the MIM",mimTypes:["OR","Q"]},{displayName:"Listen Timeout",dataName:"timeout",type:"number",params:{min:1,max:15},description:"Seconds before the listen stops automatically in a Question or Optional Response MIM.",mimTypes:["OR","Q"]},{displayName:"No Match Errors to Trigger GUI",dataName:"no_matches_for_gui",type:"integer",params:{min:0,max:5},description:"Number of No Match errors before the GUI is displayed as an alternative to speaking.",mimTypes:["Q"]},{displayName:"No Input Errors to Trigger GUI",dataName:"no_inputs_for_gui",type:"integer",params:{min:0,max:5},description:"Number of No Input errors before the GUI is displayed as an alternative to speaking.",mimTypes:["Q"]},{displayName:"Ignore No Match Errors",dataName:"ignore_no_match",type:"boolean",description:"If no match errors should be ignored. Mainly useful for GUI focused MIMs where background noise or incorrect speech should not end the MIM/GUI.",mimTypes:["OR"]},{displayName:"Barge In",dataName:"barge_in",type:"boolean",description:"If the user can interrupt Jibo's speech with their response. (Not yet implemented)",mimTypes:["OR","Q"]},{displayName:"Speech Auto-tagging",dataName:"es_auto_tagging",type:"boolean",description:"If the embodied speech system should automatically parse the prompt to add animations and emotion (tags in the prompt override this).",mimTypes:["AN","OR","Q"]},{displayName:"Parse Against All Results",dataName:"parse_all_asr",type:"boolean",description:"If the NLU parsing should happen against all ASR results instead of just the best result, to increase chances of the user's intent being handled.",mimTypes:["OR","Q"]},{displayName:"Thanks Handling",dataName:"thanks_handling",type:"dropdown",params:{data:"thanksOptions"},description:'How the MIM handles a user saying "thank you"',mimTypes:["OR"]},{displayName:"Notes",dataName:"notes",type:"text",params:{height:100},description:"Notes on this MIM. Not used at runtime."}]},{}],133:[function(e,t,o){"use strict";function i(e){var t=n.cloneDeep(e);"announce"===t.mim_type&&(t.mim_type="announcement"),t.rule_slots&&(t.notes="Rule slots: "+t.rule_slots+"\n"+(t.notes||""),delete t.rule_slots),t.hasOwnProperty("num_tries_for_gui")&&(t.no_inputs_for_gui=t.no_matches_for_gui=t.num_tries_for_gui,delete t.num_tries_for_gui);for(var o=0;o<t.prompts.length;++o){var i=t.prompts[o];"Mixed"!==i.media_type&&"SFX"!==i.media_type&&"MP3"!==i.media_type||(i.media_type="TTS"),"Silence"===i.prompt_sub_category&&(i.media_type="silence")}if(t.hasOwnProperty("sample_utterances")){if(t.sample_utterances){for(var a={title:"",buttons:[]},r=t.sample_utterances.split(","),o=0;o<r.length;++o){var s=r[o].trim(),l={label:s,color:"default",icon:"",utterance:s,notes:""};"yes"===s.toLowerCase()?(l.color="confirm",l.icon="jibo://resources/actionIcons/ok.png"):"no"===s.toLowerCase()&&(l.color="cancel",l.icon="jibo://resources/actionIcons/cancel.png"),a.buttons.push(l)}t.gui={type:"Menu",data:a}}else t.gui||(t.gui=null);delete t.sample_utterances}return t}var n=e("lodash");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{lodash:void 0}],134:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("events"),a=e("fs"),r=e("path"),s=e("lodash"),l=e("../common/undo-redo"),d=e("./schema-main"),c=e("./schema-prompt"),u=e("./mim-prompt-model"),h=e("./mim-data-deprecation"),p=e("./mim-data-sanitizer"),m=[{display:"Announcement",label:"Announcement",value:"announcement"},{display:"Question",label:"Question",value:"question"},{display:"Optional Response",label:"Optional Response",value:"optional-response"}],f=[{display:"Ignore",label:"Ignore",value:"ignore"},{display:"Respond and Listen",label:"Respond and Listen",value:"respondAndListen"},{display:"Respond and End",label:"Respond and End",value:"respondAndEnd"}],v=function(e){function t(t,o){var i=e.call(this)||this;return i.invalidJSON=!1,i.lastUri=null,i.editor=t,i.state=null,i.promptModels=[],i.dataOnDisk=null,i.filename=null,i.onPromptChangedCB=i.onPromptChanged.bind(i),i._readFile(o),i.undoRedo=new l.default(i),i}return i(t,e),t.prototype.updateDiskVersion=function(){this.dataOnDisk=s.cloneDeep(this.state)},t.prototype.changePath=function(e){this.filename=r.basename(e,r.extname(e)),this.lastUri=e,this.emit("forcererender")},Object.defineProperty(t.prototype,"isModified",{get:function(){var e=this.state,t=this.dataOnDisk;for(var o in d.default)if(e[o]!==t[o])return!0;if(!t.prompts||e.prompts.length!==t.prompts.length)return!0;for(var i=0;i<e.prompts.length;++i){var n=e.prompts[i],a=t.prompts[i];for(var o in c.default)if(n[o]!==a[o])return!0}return!1},enumerable:!0,configurable:!0}),t.prototype._readFile=function(e){var t;try{t=JSON.parse(a.readFileSync(e,"utf8"))}catch(e){return console.error(e),void(this.invalidJSON=!0)}this.invalidJSON=!1,this.dataOnDisk=s.cloneDeep(t),t=p.default(t),this.state=h.default(t),t.prompts&&Array.isArray(t.prompts)||(t.prompts=[]),this.filename=r.basename(e,r.extname(e)),this.lastUri=e,this._generatePromptModels()},t.prototype._generatePromptModels=function(){for(var e=0;e<this.promptModels.length;++e)this.promptModels[e].dispose();this.promptModels.length=0;for(var e=0;e<this.state.prompts.length;++e){var t=new u.default(this.state.prompts[e],this);t.on("onpropertieschanged",this.onPromptChangedCB),this.promptModels.push(t)}},t.prototype.onPromptChanged=function(){this.addRedoUndoEntry(),this.emit("onpropertieschanged")},t.prototype.reloadFile=function(e){this._readFile(e||this.lastUri),this.addRedoUndoEntry(),this.emit("onpropertieschanged"),this.emit("forcererender")},Object.defineProperty(t.prototype,"mimTypes",{get:function(){return m},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"thanksOptions",{get:function(){return f},enumerable:!0,configurable:!0}),t.prototype.getProperty=function(e){if("mim_type"===e){for(var t=0;t<m.length;++t)if(m[t].value===this.state.mim_type)return m[t];return m[0]}if("thanks_handling"===e){for(var t=0;t<f.length;++t)if(f[t].value===this.state.thanks_handling)return f[t];return f[0]}return this.state[e]},t.prototype.updateProperty=function(e,t){var o=this.state[e];if(this.state[e]=t,"mim_type"===e){for(var i=0;i<this.promptModels.length;++i){var n=this.promptModels[i];n.onMimTypeChange(o,t)}t===m[0].value&&(this.state.rule_name=""),this.emit("forcererender")}},t.prototype.addNewPrompt=function(){var e=u.default.generateDefaultData(this),t=new u.default(e,this);this.state.prompts.push(e),this.promptModels.push(t),this.addRedoUndoEntry(),this.emit("onpropertieschanged"),this.emit("forcererender")},t.prototype.removePrompt=function(e){for(var t=0;t<this.promptModels.length;++t)if(this.promptModels[t]===e){this.state.prompts.splice(t,1),this.promptModels.splice(t,1);break}e.dispose(),this.addRedoUndoEntry(),this.emit("onpropertieschanged"),this.emit("forcererender")},t.prototype.getData=function(){return this.state},t.prototype.getMutationFunctionNames=function(){return["updateProperty","addRedoUndoEntry"]},t.prototype.addRedoUndoEntry=function(){},t.prototype.reload=function(e){if(null===e)throw"Data was null in reload?";this.state=e,this._generatePromptModels(),this.emit("forcererender")},t.prototype.undo=function(){this.undoRedo.undo(),this.emit("onpropertieschanged")},t.prototype.redo=function(){this.undoRedo.redo(),this.emit("onpropertieschanged")},t}(n.EventEmitter);Object.defineProperty(o,"__esModule",{value:!0}),o.default=v},{"../common/undo-redo":110,"./mim-data-deprecation":133,"./mim-data-sanitizer":135,"./mim-prompt-model":139,"./schema-main":158,"./schema-prompt":159,events:void 0,fs:void 0,lodash:void 0,path:void 0}],135:[function(e,t,o){"use strict";function i(e){var t=r.cloneDeep(e);for(var o in n.default)typeof t[o]!==n.default[o].type&&(t[o]=n.default[o].default);if(t.prompts&&Array.isArray(t.prompts))for(var i=0;i<t.prompts.length;++i){var s=t.prompts[i];for(var o in a.default)typeof s[o]!==a.default[o].type&&(s[o]=a.default[o].default)}else t.prompts=[];return t}var n=e("./schema-main"),a=e("./schema-prompt"),r=e("lodash");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"./schema-main":158,"./schema-prompt":159,lodash:void 0}],136:[function(e,t,o){"use strict";var i=e("atom"),n=e("react"),a=e("./mim-option"),r=e("./mim-prompt"),s=e("./components/icon-button"),l=e("./global-layout");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n.createClass({displayName:"MimEditorView",getInitialState:function(){return{}},render:function(){var e=this.props.editor.model;if(e.invalidJSON){var t="Error parsing JSON data. This is likely caused by hand-editing MIM JSON or unresolved merge conflicts.";return n.createElement("ul",{className:"background-message centered"},n.createElement("li",null,t))}for(var o=[],i=0;i<l.default.length;++i)o.push(n.createElement(a.default,{model:e,option:l.default[i]}));for(var d=[],i=0;i<e.promptModels.length;++i)d.push(n.createElement(r.default,{model:e.promptModels[i]}));var c="mim-editor-frame mim-type-"+e.state.mim_type;return n.createElement("div",{style:{width:"100%",height:"100%"}},n.createElement("div",{className:c},n.createElement("div",{className:"left-pane"},n.createElement("label",{className:"mim-title"},n.createElement("div",{className:"setting-title"},"MIM Id:"),n.createElement("div",{className:"mim-id"},e.filename)),o),n.createElement("div",{className:"right-pane"},n.createElement("div",{className:"prompt-pane-container"},n.createElement("div",{className:"prompt-list-header"},n.createElement("div",{className:"prompt-list-title"},"Prompts:"),n.createElement(s.default,{icon:"add",label:"Add Prompt",onClick:this.onAddPrompt})),n.createElement("div",{className:"prompt-list-outer"},n.createElement("div",{className:"prompt-list-inner"},n.createElement("div",{className:"prompt-list"},d)))))))},componentWillMount:function(){var e=this;this.props.editor.model.on("ondatachanged",function(){e.checkModified()}),this.props.editor.model.on("forcererender",function(){e.setState(e.state)}),this.props.editor.model.on("onpropertieschanged",function(){e.checkModified()}),this.props.editor.model.on("save",function(){e.checkModified()})},checkModified:function(){this.props.editor.setModifiedStatus(this.props.editor.model.isModified)},componentDidMount:function(){var e=this,t=function(){return atom.workspace.getActivePaneItem()===e.props.editor};this.disposables=new i.CompositeDisposable,this.disposables.add(atom.commands.add("atom-workspace",{"core:undo":function(o){t()&&(o.preventDefault(),o.stopPropagation(),e.undo())},"core:redo":function(o){t()&&(o.preventDefault(),o.stopPropagation(),e.redo())}}),atom.commands.add("atom-text-editor",{"core:undo":function(o){t()&&(o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation(),e.undo())},"core:redo":function(o){t()&&(o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation(),e.redo())}}))},componentWillUnmount:function(){this.disposables.dispose()},undo:function(){this.props.editor.model.undo()},redo:function(){this.props.editor.model.redo()},onAddPrompt:function(){this.props.editor.model.addNewPrompt()}})},{"./components/icon-button":131,"./global-layout":132,"./mim-option":138,"./mim-prompt":140,atom:void 0,react:void 0}],137:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("../atom-react/core/react-editor"),a=e("./mim-editor-view"),r=e("./mim-data-model"),s=e("../common/tree-view-helper"),l=e("fs"),d=e("path"),c=e("jibo"),u=e("./schema-main"),h=e("./mim-data-sanitizer"),p=function(t){function o(e){var o=t.call(this,"MimEditor",e,!1)||this;return o.projectRoot=c.utils.PathUtils.findRoot(e),o.reloadsToIgnore=0,o.onDidChangeDisposable.dispose(),o.onDidChangeDisposable=o.file.onDidChange(function(){o.reload()}),o.onDidChangeTitleDisposable=o.onDidChangeTitle(o.onTitleChange.bind(o)),o.model=new r.default(o,e),o}return i(o,t),o.getDialogFilter=function(){return[{name:"MIM file",extensions:["mim"]}]},o.createNewFile=function(t){var i=atom.getCurrentWindow(),n=e("remote"),a=n.dialog||n.require("dialog");a.showSaveDialog(i,{title:"New MIM File",defaultPath:s.default.getFolderPathOfSelection(),filters:o.getDialogFilter()},function(e){if(e){var o={};for(var i in u.default)o[i]=u.default[i].default;if(o.prompts=[],l.writeFileSync(e,JSON.stringify(o,null,"\t"),"utf8"),atom.workspace.open(e),t){var n=c.utils.PathUtils.findRoot(e);t(d.relative(n,e))}}})},o.prototype.saveFile=function(e){this.reloadsToIgnore=2;var t=h.default(this.model.state);return l.writeFileSync(e,JSON.stringify(t,null,"\t"),"utf8"),this.model.updateDiskVersion(),!0},o.prototype.reload=function(){var t=this;if(this.reloadsToIgnore)return void this.reloadsToIgnore--;if(this.model.isModified){var o=atom.getCurrentWindow(),i=e("remote"),n=i.dialog||i.require("dialog");n.showMessageBox(o,{type:"question",buttons:["No","Yes"],defaultId:1,title:"File changed on disk",message:this.uri+" has changed on the disk. Do you wish to discard your changes and reload the file from the disk?"},function(e){1===e&&t.model.reloadFile()})}else this.model.reloadFile()},o.prototype.onTitleChange=function(){this.model.changePath(this.uri)},o.prototype.getReactClass=function(){return a.default},o}(n.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=p,atom.deserializers.add({deserialize:n.default.deserialize.bind(p),name:"MimEditor"})},{"../atom-react/core/react-editor":55,"../common/tree-view-helper":109,"./mim-data-model":134,"./mim-data-sanitizer":135,"./mim-editor-view":136,"./schema-main":158,fs:void 0,jibo:void 0,path:void 0,remote:void 0}],138:[function(e,t,o){"use strict";var i=e("react"),n=e("./options/mim-checkbox"),a=e("./options/mim-number"),r=e("./options/mim-combo-box"),s=e("./options/mim-string"),l=e("./options/mim-text"),d=e("../behavior-editor/arguments/rule-view"),c=e("./options/gui-selector"),u=["$factory:yes_no","$handle:crew","$handle:loop"];Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"MimOption",getInitialState:function(){return{}},render:function(){var e=this.props.model,t=this.props.option;this.tooltip=t.description;var o=t.dataName,h=e.getProperty(o),p=t.displayName,m=null,f=t.type;"boolean"===f?m=i.createElement(n.default,{isVisible:h,onChange:function(t){e.updateProperty(o,t)}}):"number"===f||"integer"===f?m=i.createElement(a.default,{type:f,value:h||0,min:t.params.min,max:t.params.max,onChange:function(t){e.updateProperty(o,t)}}):"dropdown"===f?m=i.createElement(r.default,{data:e[t.params.data],init:h,onSelected:function(t){e.updateProperty(o,t.value)}}):"string"===f?m=i.createElement(s.default,{content:h,grammar:t.params?t.params.grammar:null,onChange:function(t){e.updateProperty(o,t)}}):"text"===f?m=i.createElement(l.default,{content:h,grammar:t.params?t.params.grammar:null,height:t.params.height,onChange:function(t){e.updateProperty(o,t)}}):"rule"===f?m=d.default(h,0,function(t){e.updateProperty(o,t)},e.editor.projectRoot,u):"guiSelector"===f&&(m=i.createElement(c.default,{content:h,projectRoot:e.editor.projectRoot,onChange:function(t){e.updateProperty(o,t)}}));var v={paddingLeft:10},y="mim-setting";if(t.mimTypes){y+=" needs-mim-type";for(var g=0;g<t.mimTypes.length;++g)y+=" works-with-type-"+t.mimTypes[g]}t.promptCat&&(y+=" "+t.promptCat);var b="setting-title";return t.short&&(b+=" short"),i.createElement("div",{className:y},i.createElement("div",{style:v},i.createElement("div",{ref:"name",className:b},p),i.createElement("div",{className:"option"},m)))},componentDidMount:function(){if(this.tooltip){var e=i.findDOMNode(this.refs.name);this.tooltip=atom.tooltips.add(e,{title:this.tooltip})}},componentWillUnmount:function(){this.tooltip&&this.tooltip.dispose&&(this.tooltip.dispose(),this.tooltip=null)}})},{"../behavior-editor/arguments/rule-view":70,"./options/gui-selector":151,"./options/mim-checkbox":152,"./options/mim-combo-box":153,"./options/mim-number":154,"./options/mim-string":155,"./options/mim-text":156,react:void 0}],139:[function(e,t,o){"use strict";function i(e,t){for(var o=0;o<e.length;++o)if(e[o].value===t)return e[o];return t?{display:t,label:t,value:t}:e[0]}var n=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},a=e("events"),r=e("./schema-prompt"),s={announcement:[{display:"Entry-Core",label:"Entry-Core",value:"Entry-Core"}],"optional-response":[{display:"Entry-Core",label:"Entry-Core",value:"Entry-Core"},{display:"Response",label:"Response",value:"Response"}],question:[{display:"Entry-Core",label:"Entry-Core",value:"Entry-Core"},{display:"Errors",label:"Errors",value:"Errors"}]},l={announcement:{"Entry-Core":[{display:"Announcement",label:"Announcement",value:"AN"},{display:"Verbose",label:"Verbose",value:"Verbose"},{display:"Truncated",label:"Truncated",value:"Truncated"}],Errors:[{display:"No Input (not used)",label:"No Input (not used)",value:"NI"},{display:"No Match (not used)",label:"No Match (not used)",value:"NM"}]},"optional-response":{"Entry-Core":[{display:"Announcement",label:"Announcement",value:"AN"},{display:"Verbose",label:"Verbose",value:"Verbose"},{display:"Truncated",label:"Truncated",value:"Truncated"}],Response:[{display:"Thanks",label:"Thanks",value:"Thanks"}],Errors:[{display:"No Input (not used)",label:"No Input (not used)",value:"NI"},{display:"No Match (not used)",label:"No Match (not used)",value:"NM"}]},question:{"Entry-Core":[{display:"Question",label:"Question",value:"Q"},{display:"Verbose",label:"Verbose",value:"Verbose"},{display:"Truncated",label:"Truncated",value:"Truncated"},{display:"Hold/Return",label:"Hold/Return",value:"HoldReturn"}],Errors:[{display:"No Input",label:"No Input",value:"NI"},{display:"No Match",label:"No Match",value:"NM"}]}},d=[{display:"TTS",label:"TTS",value:"TTS"},{display:"Silence",label:"Silence",value:"silence"}],c={AN:"works-with-type-AN works-with-type-OR",Q:"works-with-type-Q",NI:"works-with-type-Q",NM:"works-with-type-Q",HoldReturn:"works-with-type-Q",Verbose:"works-with-type-AN works-with-type-OR works-with-type-Q",Truncated:"works-with-type-AN works-with-type-OR works-with-type-Q",Thanks:"works-with-type-OR"},u=function(e){function t(t,o){var i=e.call(this)||this;return i.state=t,i.parentModel=o,i}return n(t,e),t.generateDefaultData=function(e){var t={};for(var o in r.default)if("prompt_sub_category"===o){var i=l[e.state.mim_type],n=void 0;i&&(n=i[r.default.prompt_category.default]),n||(n=l.announcement["Entry-Core"]),t[o]=n[0].value}else t[o]=r.default[o].default;return t},Object.defineProperty(t.prototype,"editor",{get:function(){return this.parentModel.editor},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"promptCategories",{get:function(){return s[this.parentModel.state.mim_type]||s.announcement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"promptSubCategories",{get:function(){var e,t=l[this.parentModel.state.mim_type];return t&&(e=t[this.state.prompt_category]),e||(e=l.announcement["Entry-Core"]),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mediaTypes",{get:function(){return d},enumerable:!0,configurable:!0}),t.prototype.getProperty=function(e){if("prompt_category"===e)return i(this.promptCategories,this.state.prompt_category);if("prompt_sub_category"===e){var t=void 0,o=l[this.parentModel.state.mim_type];if(o&&(t=o[this.state.prompt_category]),!t){var n=this.state.prompt_sub_category;return{display:n,label:n,value:n}}return i(t,this.state.prompt_sub_category)}return"media"===e?i(d,this.state.media):this.state[e]},t.prototype.updateProperty=function(e,t){if(this.state[e]=t,"prompt_category"===e){var o=void 0,i=l[this.parentModel.state.mim_type];if(i&&(o=i[this.state.prompt_category]),!o)return;this.state.prompt_sub_category=o[0].value,this.emit("forcererender")}else"prompt_sub_category"===e&&this.emit("forcererender");this.emit("onpropertieschanged")},t.prototype.onMimTypeChange=function(e,t){var o=-1,i=l[e];if(i){var n=i[this.state.prompt_category];if(n)for(var a=0;a<n.length;++a)if(this.state.prompt_sub_category===n[a].value){o=a;break}}if(o>=0){var r=l[t][this.state.prompt_category];o<r.length?this.state.prompt_sub_category=r[o].value:this.state.prompt_sub_category=r[0].value}},t.prototype.onRemovePrompt=function(){this.parentModel.removePrompt(this)},t.prototype.getCssTypes=function(){return c[this.state.prompt_sub_category]},t.prototype.dispose=function(){this.removeAllListeners(),this.state=this.parentModel=null},t}(a.EventEmitter);Object.defineProperty(o,"__esModule",{value:!0}),o.default=u},{"./schema-prompt":159,events:void 0}],140:[function(e,t,o){"use strict";var i=e("react"),n=e("./mim-option"),a=e("./components/icon-button"),r=e("./prompt-layout");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"MimEditorView",getInitialState:function(){return{}},componentWillMount:function(){var e=this;this.rerenderListener=function(){e.setState(e.state)},this.props.model.on("forcererender",this.rerenderListener)},componentWillUnmount:function(){this.props.model.removeListener("forcererender",this.rerenderListener)},render:function(){for(var e=this.props.model,t=[],o=0;o<r.default.length;++o){for(var s=[],l=r.default[o],d=0;d<l.length;++d)"delete"===l[d].dataName?s.push(i.createElement("div",{className:"delete-button-wrapper"},i.createElement(a.default,{icon:"delete",label:"Delete Prompt",onClick:this.onDeletePrompt}))):s.push(i.createElement(n.default,{model:e,option:l[d]}));t.push(i.createElement("div",{className:"row"},s))}var c="mim-prompt needs-mim-type "+e.getCssTypes();return c+=" prompt-type-"+e.state.prompt_category,i.createElement("div",{className:c},t)},onDeletePrompt:function(){this.props.model.onRemovePrompt()}})},{"./components/icon-button":131,"./mim-option":138,"./prompt-layout":157,react:void 0}],141:[function(e,t,o){"use strict";var i=e("react"),n=e("atom");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({onDone:function(){var e=i.findDOMNode(this.refs.editor),t=e.getModel();this.props.onDone(t.getText()),this.props.onClose()},onCancel:function(){this.props.onClose()},getPanelHeading:function(e){return i.createElement("div",{className:"panel-heading",style:{padding:"0px",width:"100%",height:30}},i.createElement("p",{style:{textAlign:"center",marginTop:"4px",marginBottom:"4px"}},e))},render:function(){return i.createElement("div",{className:"mim-menu-modal",ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Javascript View Config Setup")),i.createElement("div",{className:"contents"},i.createElement("atom-text-editor",{ref:"editor",style:{width:"100%",height:"100%"}},this.props.data||"")),i.createElement("div",{
className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onDone},"Done"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},componentDidMount:function(){var e=this;setTimeout(function(){for(var t=i.findDOMNode(e.refs.editor),o=t.getModel(),a=atom.grammars.getGrammars(),r=0;r<a.length;r++){var s=a[r];if("source.js"===s.scopeName){o.setGrammar(s);break}}e.getDOMNode().setAttribute("tabIndex","0"),e.disposable=new n.CompositeDisposable,e.disposable.add(atom.commands.add(e.getDOMNode(),{"jibo-sdk:escape":e.onCancel,"jibo-sdk:confirm":e.onDone}))},100)},componentWillUnmount:function(){this.disposable.dispose()}})},{atom:void 0,react:void 0}],142:[function(e,t,o){"use strict";var i=function(){function e(e,t){this.data=e,this.parentModel=t}return e.generateDefaultData=function(){return{label:"",color:"default",icon:"",utterance:"",notes:""}},e.prototype.getProperty=function(e){return this.data[e]},e.prototype.updateProperty=function(e,t){this.data[e]=t},e.prototype.delete=function(){this.parentModel.removeButton(this)},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{}],143:[function(e,t,o){"use strict";var i=e("react"),n=e("../../options/mim-string"),a=e("./texture-input"),r=e("./color-selector");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"ButtonOption",getInitialState:function(){return{}},render:function(){var e=this,t=this.props.option,o=t.dataName,s=t.displayName,l=null,d=t.type;"string"===d?l=i.createElement(n.default,{content:this.props.model.getProperty(o),grammar:null,onChange:function(t){e.props.model.updateProperty(o,t)}}):"image"===d?l=i.createElement(a.default,{content:this.props.model.getProperty(o),projectRoot:this.props.projectRoot,onChange:function(t){e.props.model.updateProperty(o,t)}}):"gradient"===d&&(l=i.createElement(r.default,{content:this.props.model.getProperty(o),onChange:function(t){e.props.model.updateProperty(o,t)}}));var c="button-option",u="option-title";return i.createElement("div",{className:c},i.createElement("div",{ref:"name",className:u},s),i.createElement("div",{className:"option"},l))},componentDidMount:function(){if(this.props.option.description){var e=i.findDOMNode(this.refs.name);this.tooltip=atom.tooltips.add(e,{title:this.props.option.description})}},componentWillUnmount:function(){this.tooltip&&(this.tooltip.dispose(),this.tooltip=null)}})},{"../../options/mim-string":155,"./color-selector":145,"./texture-input":149,react:void 0}],144:[function(e,t,o){"use strict";var i=e("react"),n=e("../../../atom-react/components/float-input-view"),a=e("../../../animation-editor/views/properties/color-picker/index"),r=e("color-space/rgb"),s=e("color-space/hsv"),l=e("color-string"),d=e("atom"),c=e("../../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({getInitialState:function(){var e=l.getRgb(this.props.value);return{color:this.props.value,value:{r:e[0],g:e[1],b:e[2]}}},updateFromDrag:function(e,t){var o=s.rgb([Math.round(t.h),Math.round(100*t.s),Math.round(100*t.v)]),i={r:Math.round(o[0]),g:Math.round(o[1]),b:Math.round(o[2])};this.updateColor(e,i)},updateFromHexString:function(e){var t=l.getRgb(e);t?this.setState({color:e,value:{r:t[0],g:t[1],b:t[2]}}):this.refs.editor.setText(this.state.color)},updateFromHsv:function(e){var t=s.rgb(e),o={r:Math.round(t[0]),g:Math.round(t[1]),b:Math.round(t[2])};this.updateColor(l.hexString(t),o)},_hsvFromState:function(){var e=r.hsv([this.state.value.r,this.state.value.g,this.state.value.b]);return e},_clamp:function(e){return e},onRChange:function(e){var t={r:this._clamp(e,0,255),g:this.state.value.g,b:this.state.value.b},o=l.hexString([t.r,t.g,t.b]);this.updateColor(o,t)},onGChange:function(e){var t={r:this.state.value.r,g:this._clamp(e,0,255),b:this.state.value.b},o=l.hexString([t.r,t.g,t.b]);this.updateColor(o,t)},onBChange:function(e){var t={r:this.state.value.r,g:this.state.value.g,b:this._clamp(e,0,255)},o=l.hexString([t.r,t.g,t.b]);this.updateColor(o,t)},onHChange:function(e){var t=this._hsvFromState();t[0]=this._clamp(Math.round(e),0,360),this.updateFromHsv(t)},onSChange:function(e){var t=this._hsvFromState();t[1]=this._clamp(Math.round(e),0,100),this.updateFromHsv(t)},onVChange:function(e){var t=this._hsvFromState();t[2]=this._clamp(Math.round(e),0,100),this.updateFromHsv(t)},updateColor:function(e,t){var o=i.findDOMNode(this.refs.editor);o.getModel().setText(e),this.setState({color:e,value:t})},componentWillReceiveProps:function(e){var t=e.value,o=l.getRgb(t);this.setState({color:t,value:{r:o[0],g:o[1],b:o[2]}})},componentWillUnmount:function(){this.subs.dispose()},componentDidMount:function(){this.subs=new d.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.editor),{title:"RGB Color"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.rgb),{title:"RGB Color"})),this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.hsv),{title:"HSV Color"}))},onRgbConfirm:function(){var e=this.refs.editor,t=e.getText();this.updateFromHexString(t)},render:function(){var e=this,t=0,o=this._hsvFromState();return i.createElement("div",{className:"mim-menu-modal",ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Menu Setup")),i.createElement("div",{className:"contents"},i.createElement("div",{className:"hsv-input",style:{float:"right"}},i.createElement(a.default,{saturationWidth:150,saturationHeight:150,value:this.state.color,width:150,onDrag:this.updateFromDrag}),i.createElement("div",{style:{display:"flex",float:"right",clear:"both",marginTop:15}},i.createElement("div",{style:{fontSize:14,margin:2}},"rgb"),i.createElement(c.default,{mini:!0,ref:"editor",onBlur:this.onRgbConfirm,style:{width:150,float:"left"},content:this.state.color,onConfirm:function(){e.refs.editor.blur()}})),i.createElement("div",{style:{display:"flex",float:"right",clear:"both",marginTop:15}},i.createElement("div",{style:{float:"left"}},[i.createElement("div",{ref:"rgb"},i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"r"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onRChange,value:this.state.value.r,precision:0,tabIndex:t})),i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"g"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onGChange,value:this.state.value.g,precision:0,tabIndex:t+1})),i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"b"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onBChange,value:this.state.value.b,precision:0,tabIndex:t+2}))),i.createElement("div",{style:{height:10}}),i.createElement("div",{ref:"hsv"},i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"h"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onHChange,value:o[0],precision:0,tabIndex:t+3})),i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"s"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onSChange,value:o[1],precision:0,tabIndex:t+4})),i.createElement("div",{style:{display:"flex"}},i.createElement("div",{style:{fontSize:14,margin:2,width:10}},"v"),i.createElement(n.default,{step:1,style:{clear:"both",maxWidth:150},onChange:this.onVChange,value:o[2],precision:0,tabIndex:t+5})))])))),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onDone},"Done"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},onDone:function(){this.props.onChoose(this.state.color),this.props.onClose()},onCancel:function(){this.props.onClose()}})},{"../../../animation-editor/views/properties/color-picker/index":32,"../../../atom-react/components/float-input-view":50,"../../../common/atom-editor":96,atom:void 0,"color-space/hsv":void 0,"color-space/rgb":void 0,"color-string":void 0,react:void 0}],145:[function(e,t,o){"use strict";var i=e("react"),n=e("../../../atom-react/mixins/modal-mixin"),a=e("../../options/mim-combo-box"),r=e("./color-modal"),s=[{display:"Default",label:"Default",value:"default"},{display:"Confirm",label:"Confirm",value:"confirm"},{display:"Cancel",label:"Cancel",value:"cancel"},{display:"Custom",label:"Custom",value:"custom"}],l={default:["#25F2FB","#107799"],confirm:["#A3FF4A","#2A7922"],cancel:["#FD362F","#990024"]};Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({mixins:[n.default],getInitialState:function(){return{color:this.props.content}},render:function(){var e,t,o=[];if("string"==typeof this.state.color){for(var n=0;n<s.length;++n)if(s[n].value===this.state.color){e=s[n],t=l[this.state.color];break}e||(e=s[0],t=l[e.value]),o.push(i.createElement("div",null,i.createElement("div",{style:{width:20,height:20,backgroundColor:t[0]}}))),o.push(i.createElement("div",null,i.createElement("div",{style:{width:20,height:20,backgroundColor:t[1]}})))}else e=s[3],t=this.state.color,o.push(i.createElement("button",{className:"btn",onClick:this.onEditFirst},i.createElement("div",{style:{width:20,height:20,backgroundColor:t[0]}}))),o.push(i.createElement("button",{className:"btn",onClick:this.onEditSecond},i.createElement("div",{style:{width:20,height:20,backgroundColor:t[1]}})));return i.createElement("div",null,i.createElement("div",{style:{display:"block",textAlign:"center"}},i.createElement(a.default,{data:s,init:e,onSelected:this.onDropdownSelected})),i.createElement("div",{className:"color-preview"},o))},onDropdownSelected:function(e){var t=null;switch(e.value){case"custom":t="string"==typeof this.state.color?l.default.slice():this.state.color;break;default:t=e.value}this.props.onChange(t),this.setState({color:t})},onEditFirst:function(){var e=this;this.createModal(i.createElement(r.default,{value:this.state.color[0],onClose:function(){e.destroyModal()},onChoose:function(t){var o=e.state.color;o[0]=t,e.props.onChange(o),e.setState({color:o})}}))},onEditSecond:function(){var e=this;this.createModal(i.createElement(r.default,{value:this.state.color[1],onClose:function(){e.destroyModal()},onChoose:function(t){var o=e.state.color;o[1]=t,e.props.onChange(o),e.setState({color:o})}}))}})},{"../../../atom-react/mixins/modal-mixin":57,"../../options/mim-combo-box":153,"./color-modal":144,react:void 0}],146:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default=[{dataName:"delete"},{displayName:"Label",dataName:"label",type:"string",description:"Label displayed for this button."},{displayName:"Color",dataName:"color",type:"gradient",description:"Color used for the button art."},{displayName:"Icon",dataName:"icon",type:"image",description:"Icon used for the button art."},{displayName:"Utterance",dataName:"utterance",type:"string",description:"Utterance used, parsed by MIM rule."},{displayName:"Notes",dataName:"notes",type:"string",description:"Notes about the button. Not used at runtime."}]},{}],147:[function(e,t,o){"use strict";var i=e("react"),n=e("./button-option"),a=e("../../components/icon-button"),r=e("./layout");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({displayName:"MimEditorView",getInitialState:function(){return{}},render:function(){for(var e=[],t=0;t<r.default.length;++t)"delete"===r.default[t].dataName?e.push(i.createElement("div",{className:"delete-button-wrapper"},i.createElement(a.default,{icon:"delete",label:"",onClick:this.onDeleteButton}))):e.push(i.createElement("div",{className:"column"},i.createElement(n.default,{model:this.props.model,option:r.default[t],projectRoot:this.props.projectRoot})));var o="button-entry";return i.createElement("div",{className:o},e)},onDeleteButton:function(){this.props.model.delete()}})},{"../../components/icon-button":131,"./button-option":143,"./layout":146,react:void 0}],148:[function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=e("events"),a=e("./button-model"),r=function(e){function t(t){var o=e.call(this)||this;o.data=t?JSON.parse(JSON.stringify(t)):{},o.buttons=[],o.data.buttons||(o.data.buttons=[]);for(var i=0;i<o.data.buttons.length;++i)o.buttons.push(new a.default(o.data.buttons[i],o));return o}return i(t,e),t.prototype.getProperty=function(e){return this.data[e]},t.prototype.updateProperty=function(e,t){this.data[e]=t},t.prototype.addButton=function(){var e=a.default.generateDefaultData();this.data.buttons.push(e),this.buttons.push(new a.default(e,this)),this.emit("forcererender")},t.prototype.removeButton=function(e){for(var t=0;t<this.buttons.length;++t)if(this.buttons[t]===e){this.buttons.splice(t,1),this.data.buttons.splice(t,1);break}this.emit("forcererender")},t}(n.EventEmitter);Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./button-model":142,events:void 0}],149:[function(e,t,o){"use strict";var i=e("react"),n=e("../../../atom-react/mixins/modal-mixin"),a=e("path"),r=e("fs"),s=e("../../../common/modals/choose-file-modal"),l=e("normalize-path"),d=e("atom"),c=e("../../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({mixins:[n.default],getInitialState:function(){return{content:this.getDataValue(this.props.content),displayValue:this.props.content}},componentWillReceiveProps:function(e){var t=e.content,o=this.getDataValue(t);this.setState({content:o,displayValue:t})},render:function(){var e=this,t={};try{r.statSync(this.getUri())}catch(e){t={disabled:!0}}var o=t.disabled?i.createElement("div",{className:"error-messages"},"No Image Found"):null;return i.createElement("div",{style:{width:"100%"}},i.createElement("div",{className:"block"},i.createElement("div",{className:"fileBlock"},i.createElement("button",{ref:"chooseTexture",style:{float:"right"},className:"btn",onClick:this.onChoose},"..."),i.createElement(c.default,{onBlur:this.onBlur,ref:"editor",mini:!0,content:this.state.displayValue,onDidChange:function(t){e.setState({content:e.getDataValue(t),displayValue:t})},tooltip:{title:"Current Texture"},onConfirm:function(){e.props.onChange(e.state.displayValue)}})),o,i.createElement("br",null)))},getUri:function(){return a.resolve(this.props.projectRoot,this.state.content)},getDisplayValue:function(e){var t=e.split(a.sep);if("node_modules"===t[0]){var o=t[1],i=a.join("node_modules",o);return i=l(a.relative(i,e)),o+"://"+i}return""===e?"":l(e)},getDataValue:function(e){var t=e.split("://");if(1===t.length){var o=a.join(e);return l(o)}if(2===t.length){var o=a.join("node_modules",t[0],t[1]);return l(o)}return""},onChoose:function(){var e=this;this.createModal(i.createElement(s.default,{root:this.props.projectRoot,uri:this.getUri(),settings:s.TextureSettings,onChoose:function(t){var o=l(t),i=e.getDisplayValue(o);e.setState({content:o,displayValue:i}),e.props.onChange(i)},onClose:function(){e.destroyModal()}}))},onBlur:function(){this.props.onChange(this.state.displayValue)},componentWillUnmount:function(){this.subs.dispose()},componentDidMount:function(){this.subs=new d.CompositeDisposable,this.subs.add(atom.tooltips.add(i.findDOMNode(this.refs.chooseTexture),{title:"Change Texture"}))}})},{"../../../atom-react/mixins/modal-mixin":57,"../../../common/atom-editor":96,"../../../common/modals/choose-file-modal":107,atom:void 0,fs:void 0,"normalize-path":void 0,path:void 0,react:void 0}],150:[function(e,t,o){"use strict";var i=e("react"),n=e("atom"),a=e("../components/icon-button"),r=e("../options/mim-string"),s=e("./menu/menu-model"),l=e("./menu/menu-button-entry"),d=e("../options/mim-checkbox");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({onDone:function(){this.props.onDone(this.state.model.data),this.props.onClose()},onCancel:function(){this.props.onClose()},getInitialState:function(){return{model:new s.default(this.props.data)}},getPanelHeading:function(e){return i.createElement("div",{className:"panel-heading",style:{padding:"0px",width:"100%",height:30}},i.createElement("p",{style:{textAlign:"center",marginTop:"4px",marginBottom:"4px"}},e))},render:function(){for(var e=this,t=this.state.model,o=[],n=0;n<t.buttons.length;++n)o.push(i.createElement(l.default,{model:t.buttons[n],projectRoot:this.props.projectRoot}));return i.createElement("div",{className:"mim-menu-modal",ref:"modal"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Menu Setup")),i.createElement("div",{className:"contents"},i.createElement("div",{className:"list-header"},i.createElement("div",{className:"list-title"},"Menu Title:"),i.createElement(r.default,{content:t.data.title||"",onChange:function(t){e.state.model.data.title=t}})),i.createElement("div",{className:"list-header"},i.createElement("div",{className:"list-title"},"Allow Swipe Down to Close:"),i.createElement(d.default,{isVisible:!!t.data.allowSwipe,onChange:function(t){e.state.model.data.allowSwipe=t}})),i.createElement("div",{className:"list-header"},i.createElement("div",{className:"list-title"},"Buttons:"),i.createElement(a.default,{icon:"add",label:"Add Button",onClick:this.onAddButton})),i.createElement("div",{className:"list-outer"},i.createElement("div",{className:"list-inner"},i.createElement("div",{className:"list"},o)))),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",onClick:this.onDone},"Done"),i.createElement("button",{className:"btn",onClick:this.onCancel},"Cancel")))},onAddButton:function(){this.state.model.addButton()},componentWillMount:function(){var e=this;this.state.model.on("forcererender",function(){e.setState(e.state)})},componentDidMount:function(){var e=this;setTimeout(function(){e.getDOMNode().setAttribute("tabIndex","0"),e.disposable=new n.CompositeDisposable,e.disposable.add(atom.commands.add(e.getDOMNode(),{"jibo-sdk:escape":e.onCancel,"jibo-sdk:confirm":e.onDone}))},100)},componentWillUnmount:function(){this.disposable.dispose()}})},{"../components/icon-button":131,"../options/mim-checkbox":152,"../options/mim-string":155,"./menu/menu-button-entry":147,"./menu/menu-model":148,atom:void 0,react:void 0}],151:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/mixins/modal-mixin"),a=e("./mim-combo-box"),r=e("../modals/simple-menu-modal"),s=e("../components/file-selector"),l=e("../../common/modals/choose-file-modal"),d=e("../modals/javascript-menu-modal"),c=e("./mim-checkbox"),u=[{display:"None",label:"None",value:null},{display:"Menu",label:"Menu",value:"Menu"},{display:"View Config File",label:"View Config File",value:"File"},{display:"Javascript",label:"Javascript",value:"Javascript"}];Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({mixins:[n.default],getInitialState:function(){var e=this.props.content,t=e?e.type:null,o=u[0];if(t)for(var i=0;i<u.length;++i)if(u[i].value===t){o=u[i];break}return{guiType:o,currentData:e?e.data:null,pause:!e||!e.hasOwnProperty("pause")||!!e.pause}},componentWillReceiveProps:function(e){var t=e.content?e.content.type:null,o=u[0];if(t)for(var i=0;i<u.length;++i)if(u[i].value===t){o=u[i];break}this.setState({guiType:o,currentData:e.content?e.content.data:null,pause:!this.props.content||!!this.props.content.pause})},render:function(){var e=this,t=null,o=this.state.guiType.value;"Menu"===o||"Javascript"===o?t=i.createElement("button",{className:"btn",onClick:this.onEdit},"Edit"):"File"===o&&(t=i.createElement(s.default,{projectRoot:this.props.projectRoot,file:this.state.currentData,settings:l.ViewConfigSettings,onChange:function(t){e.state.currentData=t,e.props.onChange({type:o,data:t,pause:e.state.pause})}}));var n="none";return o&&(n="block"),i.createElement("div",null,i.createElement("div",{style:{display:"block"}},i.createElement(a.default,{data:u,init:this.state.guiType,onSelected:this.onDropdownSelected})),i.createElement("div",null,t),i.createElement("div",{className:"mim-gui-option",style:{display:n}},i.createElement("div",{ref:"pause",className:"setting-title"},"Pause Parent View"),i.createElement(c.default,{isVisible:this.state.pause,onChange:function(t){e.state.pause=t,e.props.onChange({type:e.state.guiType.value,data:e.state.currentData,pause:e.state.pause})}})))},onDropdownSelected:function(e){var t=null;switch(e.value){case"Menu":case"Javascript":t={type:e.value,data:null,pause:this.state.pause};break;case"File":t={type:e.value,data:"",pause:this.state.pause}}this.props.onChange(t),this.setState({guiType:e,currentData:null,pause:this.state.pause})},onEdit:function(){var e=this;"Menu"===this.state.guiType.value?this.createModal(i.createElement(r.default,{data:this.state.currentData,projectRoot:this.props.projectRoot,onClose:function(){e.destroyModal()},onDone:function(t){e.state.currentData=t,e.props.onChange({type:e.state.guiType.value,data:t})}})):"Javascript"===this.state.guiType.value&&this.createModal(i.createElement(d.default,{data:this.state.currentData,onClose:function(){e.destroyModal()},onDone:function(t){e.state.currentData=t,e.props.onChange({type:e.state.guiType.value,data:t})}}))},componentDidMount:function(){var e=i.findDOMNode(this.refs.pause);this.pauseTooltip=atom.tooltips.add(e,{title:"If the previous view should be paused underneath instead of removed entirely. The Eye view will always be removed."})},componentWillUnmount:function(){this.pauseTooltip&&(this.pauseTooltip.dispose(),this.pauseTooltip=null)}})},{"../../atom-react/mixins/modal-mixin":57,"../../common/modals/choose-file-modal":107,"../components/file-selector":130,"../modals/javascript-menu-modal":141,"../modals/simple-menu-modal":150,"./mim-checkbox":152,"./mim-combo-box":153,react:void 0}],152:[function(e,t,o){"use strict";var i=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({getInitialState:function(){return{isVisible:this.props.isVisible}},componentWillReceiveProps:function(e){this.setState({isVisible:e.isVisible})},render:function(){var e={cursor:"pointer",marginTop:8};return i.createElement("input",{className:"checkbox",id:"velocityBoxLabel",type:"checkbox",checked:this.state.isVisible,label:this.props.label,style:e,onClick:this.onClick})},onClick:function(){this.props.onChange(!this.state.isVisible),this.setState({isVisible:!this.state.isVisible})}})},{react:void 0}],153:[function(e,t,o){"use strict";var i=e("react"),n=e("jquery"),a=i.createClass({getInitialState:function(){return{hoveredElement:void 0}},onMouseOver:function(e){this.state.hoveredElement=e,this.setState(this.state)},onMouseOut:function(){this.state.hoveredElement=void 0,this.setState(this.state)},onClick:function(e){this.props.onSelect(e)},render:function(){var e=this,t=[];return this.props.data.forEach(function(o,n){var a="list-item";o===e.state.hoveredElement&&(a+=" selected");var r={},s=null;"string"==typeof o.label?(r={marginLeft:5},s=o.label):s=o.label(),t.push(i.createElement("li",{key:n,className:a,onMouseOver:e.onMouseOver.bind(e,o),onMouseOut:e.onMouseOut.bind(e,o),onClick:e.onClick.bind(e,o)},i.createElement("span",{style:r},s)))}),i.createElement("ul",{className:"list-group"},t)}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({getInitialState:function(){return{clickHandler:this.clickHandler.bind(this),current:this.props.init}},componentWillReceiveProps:function(e){this.state.current=e.init,this.setState(this.state)},render:function(){var e=null;if(this.state.current.display)if("function"==typeof this.state.current.display)e=this.state.current.display();else{var t=null;t=this.props.titleDisplay?this.props.titleDisplay:this.state.current.display,e=[i.createElement("i",{className:"fa fa-caret-down",style:{fontSize:20,marginRight:"5px"}}),t]}var o="combo-box btn";this.props.hideButton&&(o="combo-box");var n={marginTop:4};return i.createElement("div",{ref:"button",className:o,style:n,onClick:this.onClick},e)},removeList:function(){n(document).off("click",this.state.clickHandler),this.node.remove(),this.node=null},onSelect:function(e){this.state.current=e,this.setState(this.state),this.props.keepFocusAfterClick||this.removeList(),this.props.onSelected(e)},clickHandler:function(e){0===n(e.target).closest(this.node).length&&this.removeList()},onClick:function(e){if(e.preventDefault(),e.stopPropagation(),this.node)this.removeList();else{var t=i.findDOMNode(this.refs.button),o=t.getBoundingClientRect();this.node=n("<div />").addClass("combo-box-list").css({left:o.left+"px",top:o.bottom+"px"}).appendTo(document.body),n(document).on("click",this.state.clickHandler),i.render(i.createElement(a,{data:this.props.data,onSelect:this.onSelect}),this.node[0])}}})},{jquery:void 0,react:void 0}],154:[function(e,t,o){"use strict";var i=e("react"),n=e("../../atom-react/components/float-input-view"),a=e("../../atom-react/components/integer-input-view");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({getInitialState:function(){return{value:this.props.value}},componentWillReceiveProps:function(e){this.setState({value:e.value})},render:function(){var e={marginTop:4,height:20,width:50,display:"inline"},t="number"===this.props.type?i.createElement(n.default,{min:this.props.min,max:this.props.max,value:this.state.value,onChange:this.props.onChange,style:e}):i.createElement(a.default,{min:this.props.min,max:this.props.max,value:this.state.value,onChange:this.props.onChange,style:e});return t}})},{"../../atom-react/components/float-input-view":50,"../../atom-react/components/integer-input-view":51,react:void 0}],155:[function(e,t,o){"use strict";var i=e("react"),n=e("../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({render:function(){return i.createElement("div",{style:{width:"100%"}},i.createElement(n.default,{ref:"editor",mini:!0,content:this.props.content,grammar:this.props.grammar,advanced:{softWrap:!0},onDidStopChanging:this.props.onChange}))},componentWillReceiveProps:function(e){var t=this.refs.editor;t.setText(e.content),t.props.onDidStopChanging=e.onChange}})},{"../../common/atom-editor":96,react:void 0}],156:[function(e,t,o){"use strict";var i=e("react"),n=e("../../common/atom-editor");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({render:function(){return i.createElement("div",{style:{width:"100%"}},i.createElement(n.default,{ref:"editor",hideGutter:!0,style:{minHeight:this.props.height},content:this.props.content,grammar:this.props.grammar,advanced:{softWrap:!0,hideInvisibles:!0},onDidStopChanging:this.props.onChange}))},componentWillReceiveProps:function(e){var t=this.refs.editor;t.setText(e.content),t.props.onDidStopChanging=e.onChange}})},{"../../common/atom-editor":96,react:void 0}],157:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default=[[{displayName:"Prompt ID",dataName:"prompt_id",type:"string",description:"Unique identifier for this prompt, to assist error messages in telling you where something went wrong when debugging."},{dataName:"delete"}],[{displayName:"Prompt Category",dataName:"prompt_category",type:"dropdown",params:{data:"promptCategories"},description:"The main category for the prompt"},{displayName:"Prompt Subcategory",dataName:"prompt_sub_category",type:"dropdown",params:{data:"promptSubCategories"},description:"The sub category for the prompt. Some main categories will only have one sub category."}],[{displayName:"Weight",dataName:"weight",type:"number",params:{min:0},description:"Weighting for randomization - larger numbers will be picked more than smaller numbers. 0 disables the prompt."},{displayName:"Index",dataName:"index",type:"integer",params:{min:1},description:"Index of the prompt. Represents order in which prompts should be used, given repetitions of MIM errors.",promptCat:"prompt-cat-error-only",short:!0},{displayName:"Media",dataName:"media",type:"dropdown",params:{data:"mediaTypes"},description:"The type of media. TTS handles all SFX, animations, and TTS. If you are sure you want nothing to happen, Silence is available.",short:!0}],[{displayName:"Condition",dataName:"condition",type:"string",description:"Condition for which the prompt should be usable. This is standard Javascript, as though in an if() expression.",params:{grammar:"source.js"}}],[{displayName:"Prompt",dataName:"prompt",type:"string",params:{grammar:"text.mim-esml"},description:"The prompt text. Standard text, with optional ESML tags and ${} wrapping Javascript for dynamic insertion."}]]},{}],158:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default={mim_type:{type:"string",default:"announcement",values:["announcement","question","optional-response"]},rule_name:{type:"string",default:""},gui:{type:"object",default:null},timeout:{type:"number",default:6},no_matches_for_gui:{type:"number",default:0},no_inputs_for_gui:{type:"number",default:0},ignore_no_match:{type:"boolean",default:!1},barge_in:{type:"boolean",default:!0},es_auto_tagging:{type:"boolean",default:!0},parse_all_asr:{type:"boolean",default:!1},thanks_handling:{type:"string",default:"ignore",values:["ignore","respondAndListen","respondAndEnd"]},notes:{type:"string",default:""}}},{}],159:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default={prompt_category:{type:"string",default:"Entry-Core",values:["Entry-Core","Error"]},prompt_sub_category:{type:"string",default:"AN",values:["AN","Q","NI","NM","HoldReturn","Truncated","Verbose","Thanks"]},index:{type:"number",default:1},condition:{type:"string",default:""},prompt:{type:"string",default:""},media:{type:"string",default:"TTS",values:["TTS","silence"]},prompt_id:{type:"string",default:""},weight:{type:"number",default:1}}},{}],160:[function(e,t,o){"use strict";var i=e("react"),n=e("jibo-cli"),a=e("jquery"),r=e("path"),s=e("fs"),l=e("atom"),d=e("../atom-react/components/jibo-combo-box"),c=e("jibo-analytics"),u=e("../common/atom-editor"),h=i.createClass({getInitialState:function(){return this.data=[{label:"Create Skill",display:"Skill",value:{template:"behavior-template",fields:[{label:"Package.json name",ref:"packageName"}]}},{label:"Create Asset Pack",display:"Asset Pack",value:{template:"asset-pack-template",fields:[{label:"Package.json name",ref:"packageName"},{label:"Asset Pack Title",ref:"titleName"}]}}],{step:0,type:this.data[0].value}},onChangeConfiguration:function(e){this.setState({type:e.value})},getFieldValue:function(e){var t=this.refs[e];return t?t.getText():""},createInputField:function(e,t,o){var n=this;return i.createElement("div",{className:"block"},i.createElement("label",null,e),i.createElement(u.default,{ref:t,tabIndex:o,mini:!0,content:"",onDidChange:function(e){var o=i.findDOMNode(n.refs.generateButton);n.fields[t]=e.length>0,o.disabled=!n.areFieldsFilledIn()}}))},render:function(){var e=this;switch(this.state.step){case 0:var t=[];return this.state.type.fields.forEach(function(o,i){t.push(e.createInputField(o.label,o.ref,i))}),i.createElement("div",{className:"block package-generator"},i.createElement("div",{className:"panel-heading"},i.createElement("h1",{style:{textAlign:"center"}},"New Jibo Skill")),i.createElement("div",{className:"block"},i.createElement("label",null,"Type"),i.createElement(d.default,{data:this.data,init:this.data[0],onSelected:this.onChangeConfiguration})),t,i.createElement("hr",null),i.createElement("div",{className:"btn-group"},i.createElement("button",{className:"btn",ref:"generateButton",onClick:this.onChoose},"Generate"),i.createElement("button",{className:"btn",onClick:this.props.onClose
},"Cancel")));case 1:return i.createElement("div",{className:"inline-block",style:{display:"flex"}},i.createElement("i",{className:"fa fa-cog fa-spin fa-5x"}),i.createElement("label",{style:{margin:"auto",fontSize:23}},"Installing node dependencies"))}},areFieldsFilledIn:function(){for(var e=Object.keys(this.fields),t=!0,o=0;o<e.length;o++){var i=e[o];t=t&&this.fields[i]}return t},onUpdate:function(){var e=this;if(0===this.state.step){var t=this.state.type.fields[0].ref,o=this.refs[t];o.focus(),this.fields={};var n=i.findDOMNode(this.refs.generateButton);this.state.type.fields.forEach(function(t){e.fields[t.ref]=!1}),n.disabled=!0}},componentDidUpdate:function(){this.onUpdate()},componentDidMount:function(){var e=this;this.onUpdate(),this.disposable=new l.CompositeDisposable,this.disposable.add(atom.commands.add(this.getDOMNode(),{"jibo-sdk:escape":this.props.onClose})),this.disposable.add(atom.commands.add(this.getDOMNode(),{"core:confirm":function(){e.areFieldsFilledIn()&&e.onChoose()}}))},componentWillUnmount:function(){this.disposable.dispose()},onChoose:function(){var e=this;this.state.step++;var t=this.getPackagesDirectory(),o=this.getFieldValue("packageName");o=r.normalize(o);var i=this.getFieldValue("titleName"),a=r.resolve(t,o),s=o.split(r.sep),l=s.length>0?s[s.length-1]:o;this.setState(this.state),n.packageGenerator(this.state.type.template,a,l,i,function(){e.props.onClose(),atom.open({pathsToOpen:[a]}),c.default.event("new-project",e.state.type.template,{})})},getPackagesDirectory:function(){return atom.config.get("core.projectHome")||process.env.ATOM_REPOS_HOME||r.join(s.getHomeDirectory(),"github")}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(){var e=a("<div/>"),t=atom.workspace.addModalPanel({item:e});i.render(i.createElement(h,{onClose:function(){t.destroy()}}),e[0])}},{"../atom-react/components/jibo-combo-box":53,"../common/atom-editor":96,atom:void 0,fs:void 0,"jibo-analytics":void 0,"jibo-cli":void 0,jquery:void 0,path:void 0,react:void 0}],161:[function(e,t,o){"use strict";function i(e){var t=r.normalize("/rules/");return!!e.includes(t)}function n(){var t=s.default.getFolderPathWithDirectory(s.default.getFolderPathOfSelection(),"src/rules");if(!t)return void alert("You must have a valid project loaded in order to create a new .rule file.");var o=atom.getCurrentWindow(),n=e("remote"),r=n.dialog||n.require("dialog");r.showSaveDialog(o,{title:"New Rule",defaultPath:t,filters:[{name:"Rules",extensions:["rule"]}]},function(e){if(e)if(i(e)){var t="TopRule = $* (hello world){what='hello'} $*;";a.writeFileSync(e,t,"utf8"),atom.workspace.open(e),l.default.event("rules-editor","new",{})}else alert('You must save rule files under the "src/rules" folder.')})}var a=e("fs"),r=e("path"),s=e("../common/tree-view-helper"),l=e("jibo-analytics");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"../common/tree-view-helper":109,fs:void 0,"jibo-analytics":void 0,path:void 0,remote:void 0}],162:[function(e,t,o){"use strict";var i=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({getInitialState:function(){return{hover:!1}},render:function(){var e={marginTop:-20,width:10,height:20},t=null;return this.state.hover&&(t=i.createElement("span",{className:"badge badge-info",style:{fontSize:15}},this.props.message)),i.createElement("div",null,i.createElement("div",{onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,style:e}),t)},onMouseOver:function(){this.setState({hover:!0})},onMouseOut:function(){this.setState({hover:!1})}})},{react:void 0}],163:[function(e,t,o){"use strict";var i=e("react");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({getInitialState:function(){return{hover:!1}},render:function(){var e={marginLeft:-50,marginTop:-25,width:30,height:25},t=null;return this.state.hover&&(t=i.createElement("span",{className:"badge badge-info",style:{fontSize:15}},this.props.message)),i.createElement("div",null,i.createElement("div",{onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,style:e}),t)},onMouseOver:function(){this.setState({hover:!0})},onMouseOut:function(){this.setState({hover:!1})}})},{react:void 0}],164:[function(e,t,o){"use strict";function i(){var t=r(__dirname),o=a.join(t,"parser/build/Release/jsjibonlu.jibo"),i=a.join(t,"parser/build/Release/jsjibonlu.node");n.existsSync(o)&&n.renameSync(o,i);var s;try{s=e(i);var l=a.join(t,"parser","deps","data");s.set_data_dir(l);var d=a.join(t,"resources/crew/dummy-crew.rule"),c=n.readFileSync(d,"utf8");s.compile_fst_from_text(c,"handle:crew")}catch(e){console.warn("Error importing jibo-parser. The Rule Tester Panel will not work.")}return s}var n=e("fs"),a=e("path"),r=e("find-root");Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"find-root":void 0,fs:void 0,path:void 0}],165:[function(e,t,o){"use strict";var i=e("path"),n=e("react"),a=e("./error-popup"),r=e("./gutter-popup"),s=e("./jibo-parser"),l=function(){function e(){this.start(),this.nlu=s.default()}return e.prototype.onChange=function(){this.marker&&(this.marker.destroy(),this.lineNumber&&this.lineNumber.parentNode&&this.lineNumber.parentNode.removeChild(this.lineNumber));var e=this.editor.getText();try{this.nlu&&this.nlu.syntax_check(e)}catch(e){var t=JSON.parse(e.message);if(t.info.line){var o=[[t.info.line-1,t.info.column-1],[t.info.line-1,t.info.column]];this.marker=this.editor.markBufferRange(o,{invalidate:"never"}),this.editor.decorateMarker(this.marker,{type:"highlight",class:"jibo-highlight-red"}),this.editor.decorateMarker(this.marker,{type:"line-number",class:"jibo-line-number-red"});var i=document.createElement("div");n.render(n.createElement(a.default,{message:t.info.msg,marker:this.marker}),i),this.editor.decorateMarker(this.marker,{type:"overlay",item:i})}else{var o=[[0,0],[0,1]];this.marker=this.editor.markBufferRange(o,{invalidate:"never"}),this.editor.decorateMarker(this.marker,{type:"line-number",class:"jibo-line-number-red"});var i=document.createElement("div");n.render(n.createElement(r.default,{message:t.info.msg,marker:this.marker}),i),this.editor.decorateMarker(this.marker,{type:"overlay",item:i})}console.log(t)}},e.prototype.start=function(){var e=this;atom.workspace.observeActivePaneItem(function(t){if(t&&t.constructor&&"TextEditor"===t.constructor.name){var o=i.extname(t.getPath());e.dispoable&&e.dispoable.dispose(),".nli"!==o&&".rule"!==o&&".grm"!==o||(e.editor=t,e.dispoable=t.onDidStopChanging(e.onChange.bind(e)))}})},e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=new l},{"./error-popup":162,"./gutter-popup":163,"./jibo-parser":164,path:void 0,react:void 0}],166:[function(e,t,o){"use strict";var i=e("react"),n=e("parser-download"),a=e("./jibo-parser"),r=e("path"),s=e("find-root"),l=a.default(),d={};Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({addDisposable:function(e){this.disposables.push(e)},getInitialState:function(){return this.disposables=[],{result:"",compileTime:0,parseTime:0}},compile:function(){if(l){var e=i.findDOMNode(this.refs.json);this.parser=null,l.remove_from_memory("handle:1");try{var t=performance.now(),o=l.compile_fst_from_text(this.props.editor.getText(),"handle:1"),n=performance.now();this.parser=l.build_sentence_parser(o),this.setState({compileTime:n-t})}catch(t){e.getModel().setText("[]"),this.setState({compileTime:0,parseTime:0})}}},onDownload:function(){var e=this,t={force32:!0,version:"2.0.0",type:process.versions.modules,temp:r.join(s(__dirname),"tmp"),dir:r.join(s(__dirname),"parser"),rename:!0,logger:function(e){console.log("[parser-download]",e)}};n(t,function(t){t&&console.error(t),l=a.default(),e.setState({})})},parse:function(){var e=i.findDOMNode(this.refs.json),t=i.findDOMNode(this.refs.editor);if(this.parser){var o=performance.now();try{var n=this.parser.parse_sentence(t.getModel().getText()),a=performance.now();this.setState({parseTime:a-o}),n=JSON.parse(n),n=JSON.stringify(n,null,4),e.getModel().setText(n)}catch(t){e.getModel().setText("[]"),this.setState({compileTime:0,parseTime:0})}}else e.getModel().setText("[]"),this.setState({compileTime:0,parseTime:0})},render:function(){var e={width:"100%",height:"100%",display:"flex",flexDirection:"column"};return l?i.createElement("div",{style:e,ref:"container"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Test ",this.props.editor.getTitle())),i.createElement("atom-text-editor",{ref:"editor",style:{marginLeft:10,marginRight:10,marginBottom:10,marginTop:20},mini:!0,"placeholder-text":"Enter test sentence here"}),i.createElement("div",{className:"text-info",style:{margin:10}},i.createElement("span",{className:"icon icon-graph"})," ","compile time: "+this.state.compileTime.toFixed(2)+"ms, parse time: "+this.state.parseTime.toFixed(2)+"ms"),i.createElement("div",{className:"json-container"},i.createElement("atom-text-editor",{"gutter-hidden":!0,ref:"json",style:{height:"100%"}})),i.createElement("div",{style:{height:26}})):i.createElement("div",{style:e,ref:"container"},i.createElement("div",{className:"panel-heading",style:{padding:"0px"}},i.createElement("h2",{style:{textAlign:"center",marginTop:"6px",marginBottom:"6px"}},"Test ",this.props.editor.getTitle())),i.createElement("div",{className:"text-center highlight-warning",style:{margin:"10px"}},"The Rule Tester Panel is currently disabled because the NLU Parser module is out of date. This can happen when updating to a newer version of Atom."),i.createElement("div",{className:"text-center"},i.createElement("button",{className:"btn btn-lg",style:{marginBottom:"6px"},onClick:this.onDownload},"Click To Update"),i.createElement("p",null,i.createElement("em",null,"Please refresh current .rule file after updating"))),i.createElement("div",{style:{height:26}}))},componentDidMount:function(){var e=this;if(l){var t=i.findDOMNode(this.refs.editor),o=i.findDOMNode(this.refs.json),n=i.findDOMNode(this.refs.container);n.addResizeListener=function(){console.log(n.clientWidth,n.clientHeight)};for(var a=!1,r=atom.grammars.getGrammars(),s=0;s<r.length;s++){var c=r[s];if("JSON"===c.name){o.getModel().setGrammar(c),a=!0;break}}if(!a)var u=atom.grammars.onDidAddGrammar(function(e){"JSON"===e.name&&(o.getModel().setGrammar(e),u.dispose())});var h=d[this.props.editor.getPath()];h?(t.getModel().setText(h),this.compile(),this.parse()):o.getModel().setText("[]"),this.addDisposable(this.props.editor.onDidStopChanging(function(){e.compile(),e.parse()})),this.addDisposable(t.getModel().onDidStopChanging(function(){d[e.props.editor.getPath()]=t.getModel().getText(),e.parse()}))}},componentWillUnmount:function(){this.disposables.forEach(function(e){e.dispose()})}})},{"./jibo-parser":164,"find-root":void 0,"parser-download":void 0,path:void 0,react:void 0}],167:[function(e,t,o){"use strict";var i="RunConfiguration",n=function(){function e(){}return Object.defineProperty(e.prototype,"runDir",{get:function(){return atom.config.get("jibo-sdk."+i+".run-dir")},set:function(e){atom.config.set("jibo-sdk."+i+".run-dir",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return atom.config.get("jibo-sdk."+i+".type")},set:function(e){atom.config.set("jibo-sdk."+i+".type",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"host",{get:function(){return atom.config.get("jibo-sdk."+i+".host")},set:function(e){atom.config.set("jibo-sdk."+i+".host",e)},enumerable:!0,configurable:!0}),e}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=new n},{}],168:[function(e,t,o){"use strict";var i=e("react"),n=e("../atom-react/components/jibo-combo-box-unidirectional"),a=e("./run-configuration"),r=e("../launcher/launcher"),s=e("atom"),l=e("lodash"),d=e("../common/atom-editor"),c=i.createClass({render:function(){var e=this;return i.createElement(d.default,{className:"inline-block",ref:"editor",style:{width:300},mini:!0,content:this.props.initValue,onDidChange:function(t){e.props.onSetValue(t)}})},componentDidMount:function(){var e=this.refs.editor;e&&this.props.onSetValue(e.getText())}});Object.defineProperty(o,"__esModule",{value:!0}),o.default=i.createClass({componentDidMount:function(){var e=this,t=this;this.disposable=new s.CompositeDisposable;var o=["RunConfiguration.type","RunConfiguration.host","RunConfiguration.run-dir"];o.forEach(function(o){var n="jibo-sdk."+o;e.disposable.add(atom.config.observe(n,function(){"jibo-sdk.RunConfiguration.run-dir"===n&&t.refs.rundir?i.findDOMNode(t.refs.rundir).getModel().setText(atom.config.get(n)):"jibo-sdk.RunConfiguration.host"===n&&t.refs.host?i.findDOMNode(t.refs.host).getModel().setText(atom.config.get(n)):t.forceUpdate()}))})},componentWillUnmount:function(){this.disposable.dispose()},getInitialState:function(){return r.default.on("exit",this.onExit.bind(this)),r.default.on("start",this.onStart.bind(this)),{isPlaying:r.default.isPlaying}},onExit:function(){this.state.isPlaying=!1,this.setState(this.state)},onStart:function(){this.state.isPlaying=!0,this.setState(this.state)},render:function(){var e=[{label:"Run Locally",display:"local",value:"local"},{label:"Run Remotely",display:"remote",value:"remote"}],t=null,o=l.find(e,function(e){return a.default.type===e.value});"remote"===a.default.type&&(t=[i.createElement("p",{style:{margin:5,whiteSpace:"nowrap"}},"Robot Host URL "),i.createElement(c,{tabIndex:1,ref:"host",initValue:a.default.host,onSetValue:function(e){a.default.host=e}})]);var r={toolbar:{display:"flex",minWidth:664},logo:{width:90,height:27,margin:"1px 0px auto 10px"},beta:{color:"#e2c08d",margin:"0px 10px 0px 0px"},close:{padding:7,cursor:"pointer",fontSize:"1.1em"}},s=this.state.isPlaying?"fa fa-stop":"fa fa-play";return i.createElement("div",{className:"inline-block jibo-tool-bar",style:r.toolbar},i.createElement("img",{style:r.logo,src:"atom://jibo-sdk/resources/images/jibo.png"}),i.createElement("p",{style:r.beta},"(Beta) "),i.createElement("div",{className:"btn inline-block",onClick:this.state.isPlaying?this.onStop:this.onPlay},i.createElement("i",{className:s,style:{color:this.state.isPlaying?"red":"green",fontSize:15}})),i.createElement(n.default,{data:e,current:o,onSelected:this.onChangeConfiguration}),t,i.createElement("p",{style:{margin:5,whiteSpace:"nowrap"}},"Run Directory "),i.createElement(c,{tabIndex:2,ref:"rundir",initValue:a.default.runDir,onSetValue:function(e){a.default.runDir=e}}),i.createElement("span",{className:"btn inline-block",onClick:this.onOpenPackageSettings},i.createElement("span",null,"Settings "),i.createElement("i",{className:"fa fa-edit"})))},onOpenPackageSettings:function(){atom.workspace.open("atom://config/packages/jibo-sdk").then(function(){var e=document.querySelector(".package-detail.panels-item");e&&(e.scrollTop=380)})},onPlay:function(){r.default.play()},onStop:function(){r.default.stop()},onChangeConfiguration:function(e){a.default.type=e.value}})},{"../atom-react/components/jibo-combo-box-unidirectional":52,"../common/atom-editor":96,"../launcher/launcher":129,"./run-configuration":167,atom:void 0,lodash:void 0,react:void 0}],169:[function(e,t,o){"use strict";var i=console.log;console.log=function(){},console.log=i;var n=e("loophole");global.Function=n.Function;var a=e("lodash"),r=e("path"),s=e("./animation-editor/animation-editor"),l=e("./behavior-editor/behavior-editor"),d=e("./mim-editor/mim-editor"),c=e("./flow-editor/flow-editor"),u=e("./flow-editor/flow-preflight-runner"),h=e("./common/json-opener"),p=e("./package-generator/package-generator-modal"),m=e("./launcher/launcher"),f=e("jquery"),v=e("react"),y=e("./toolbar/toolbar"),g=e("./atom-react/atom-integration"),b=e("./cheat-sheet/cheat-sheat-tab"),k=e("atom"),S=e("./rules/rule-tester-panel"),w=e("./gating/login"),E=e("./rules/create-new-rule"),M=e("jibo-analytics"),C=function(){function t(){this.config={AnimationEditorBackgroundColor:{type:"color",default:"#4C4C4C",description:"The background color in the Animation Editor"},AnimationEditorGridColor:{type:"color",default:"#E5E5E5",description:"The grid color in the Animation Editor"},"RunConfiguration.type":{type:"string",enum:["local","remote"],default:"local",description:"Which mode to use when running/debugging your skill."},"RunConfiguration.host":{type:"string",default:"",description:"The host or ip of the robot you want to target."},"RunConfiguration.run-dir":{type:"string",default:"${project}",description:"The directory to run your skill from if it's not the root of your opened project."},DisableRunSkillShortcut:{type:"boolean",default:!1,description:"Disable the shortcut for running skills, if you prefer it binding to built in the [Symbol-Viewer](https://github.com/atom/symbols-view#symbols-view-package-) toggle."},FlowEditorShowGridLines:{type:"boolean",default:!1,description:"Show the grid on the Flow Editor diagram."},FlowEditorShowAlignmentGuides:{type:"boolean",default:!1,description:"Show guidelines when shape edges or centers align during positioning."},FlowEditorSnapIntoPosition:{type:"boolean",default:!1,description:"Snap all shape movement and resizing operations to quantized positions."},FlowEditorUseOrthogonalLinks:{type:"boolean",default:!0,description:"Links between nodes are composed of orthogonal (horizontal and vertical) segments instead of straight lines. (Non orthogonal mode is experimental)"},FlowEditorRouteLinksAroundNodes:{type:"boolean",default:!0,description:"When using orthogonal links (only), route links around nodes. (Non route-around mode is experimental)"}}}return t.prototype.toggleRulePane=function(e,t){var o=this;if(void 0===e&&(e=!1),this.rulePaneDisposable&&this.rulePaneDisposable.destroy(),e){var i=document.createElement("div");i.setAttribute("class","rule-panel"),v.render(v.createElement(S.default,{editor:t,onClose:function(){o.destroyModal()}}),i),this.rulePaneDisposable=atom.workspace.addRightPanel({item:i,priority:1})}},t.prototype.activate=function(){var t=this;this.disposable=new k.CompositeDisposable;var o=!1,i=!1,n=function(){g.default.activate(),null===localStorage.getItem("jibo-userid")&&localStorage.setItem("jibo-userid",Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)),M.default.init("UA-51278302-7",localStorage.getItem("jibo-userid")),t.disposable.add(atom.workspace.addOpener(function(e){return t.openURI(e)})),t.disposable.add(atom.commands.add("atom-workspace",{"jibo-sdk:new-project":function(){p.default()},"jibo-sdk:open-as-json":function(){h.default.open()},"jibo-sdk:new-animation-file":function(){s.default.createNewFile()},"jibo-sdk:new-behavior-tree-file":function(){l.default.createNewFile()},"jibo-sdk:new-mim-file":function(){d.default.createNewFile()},"jibo-sdk:new-flow-file":function(){c.default.createNewFile()},"jibo-sdk:preflight-flow":function(){u.default.preflight()},"jibo-sdk:new-rule-file":function(){E.default()},"jibo-sdk:play":function(){m.default.play()},"jibo-sdk:stop":function(){m.default.stop()},"jibo-sdk:cheat-sheet":function(){atom.workspace.open("atom://jibo-cheat-sheet")},"jibo-sdk:run-skill":function(e){return atom.config.get("jibo-sdk.DisableRunSkillShortcut")?void e.abortKeyBinding():void m.default.togglePlayer()}}));var i=f("<div/>");i.addClass("toolbar"),v.render(v.createElement(y.default,null),i[0]),t.toolbarPanel=atom.workspace.addTopPanel({item:i});var n=function(e){var o=null;if(e&&(o=e.__displayName||(e.constructor?e.constructor.name:null)),"TextEditor"===o){var i=r.extname(e.getPath());if(".nli"===i||".rule"===i||".grm"===i)return t.editor=e,void t.toggleRulePane(!0,e)}t.toggleRulePane(!1)};atom.workspace.observeActivePaneItem(function(e){n(e)}),n(atom.workspace.getActiveTextEditor()),e("./rules/rule-grammar"),o=!0},a=function(){return w.default.isUserLoggedIn()?void n():(i=!0,void w.default.showDialog(function(e,t){return i=!1,e?void console.log(e):void(t&&n())}))};a(),this.disposable.add(atom.commands.add("atom-workspace",{"jibo-sdk:login":function(){return o?void alert("You are already logged in"):void(i||a())}}))},t.prototype.deactivate=function(){this.toolbarPanel&&this.toolbarPanel.destroy(),this.disposable.dispose(),g.default.deactivate()},t.prototype.openURI=function(e){if(h.default.useDefaultEditor()!==!1){if("atom://jibo-cheat-sheet"===e)return new b.default(e,!0);var t={".keys":s.default,".bt":l.default,".mim":d.default,".flow":c.default},o=r.extname(e).toLowerCase();if(a.has(t,o)){var i={".anim":"animation-preview",".keys":"animation-editor",".bt":"behavior-editor",".mim":"mim-editor",".flow":"flow-editor"};return M.default.event(i[o],"opened",{}),new t[o](e)}}},t}();t.exports=new C},{"./animation-editor/animation-editor":1,"./atom-react/atom-integration":49,"./behavior-editor/behavior-editor":76,"./cheat-sheet/cheat-sheat-tab":92,"./common/json-opener":101,"./flow-editor/flow-editor":114,"./flow-editor/flow-preflight-runner":116,"./gating/login":127,"./launcher/launcher":129,"./mim-editor/mim-editor":137,"./package-generator/package-generator-modal":160,"./rules/create-new-rule":161,"./rules/rule-grammar":165,"./rules/rule-tester-panel":166,"./toolbar/toolbar":168,atom:void 0,"jibo-analytics":void 0,jquery:void 0,lodash:void 0,loophole:void 0,path:void 0,react:void 0}]},{},[169])(169)});