/*! For license information please see controlapp.b29a0cb5.js.LICENSE.txt */ (()=>{var e,t={16918:(e,t,n)=>{function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=n(82327),o=[],r=[],s=!1,l=!1,c=[],d=[],p=function(e){return"object"===i(e)&&null!==e?0==Object.keys(e).length:null==e||null==e},u=function(e,t){this._parent=null,this.name=t||"",this.children={},this.type="object",this.value=null,this.active=!0,this.callbacks={value:[],child_added:[],child_removed:[],child_changed:[]},e&&this.set(e)},h=function(e){var t=new u;return t.value=e,t.type="value",t.children=null,t},m=function(e){var t=new u;t.type="array";for(var n=0;n0&&void 0!==arguments[0])||arguments[0])&&g("batch")},u.prototype.endBatch=function(){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s=!1,(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&g("batch");var t=[];r.forEach((function(e){-1==t.indexOf(e)&&t.push(e)})),r=[],e&&t.forEach((function(e){e.notify("value")})),this.removeHeadUndoStack()},u.prototype._emptyNodeNull=function(){l=!0},u.prototype.child=function(e){"string"!=typeof e&&(e=String(e));var t=e.split("/");if(t&&t.length>1){var n=e.indexOf("/"),i=e.substr(n+1);return this.child(t[0]).child(i)}return this.children||(this.children={},this.type="object"),this.children[e]||(this.children[e]=new u,this.children[e].name=e,this.children[e]._parent=this),this.children[e]},u.prototype.push=function(){var e=a.guid();return this.children[e]=new u,this.children[e].name=e,this.children[e]._parent=this,this.children[e]},u.prototype.set=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;return o=[],t&&(g([this,this.val()]),d=[],this.removeHeadUndoStack()),null==e||Array.isArray(e)&&0==e.length||"object"==i(e)&&p(e)?this.remove(t):"object"==i(e)?(Array.isArray(e)?this.type="array":this.type="object",this.update(e,!1,!0,a,n)):this.update(e,!1,!0,a,n),this},u.prototype.setWithPriority=function(e,t){console.warn("setWithPriority is not implemented"),this.set(e)},u.prototype.setPriority=function(e){console.warn("setPriority is not implemented")},u.prototype.update=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0!==e){var l=0==this.active;this.active=!0;var c=this.parent;if(!r||c.active){for(;c;)c.active=!0,c=c.parent;if(o=[],t&&(g([this,this.val()]),d=[],this.removeHeadUndoStack()),"object"==i(e)&&null!=e){var p=f(e),u=!1,h=!1;if("object"==this.type&&Array.isArray(e)||"array"==this.type&&!Array.isArray(e))for(var m in this.children){var v=this.children[m];delete this.children[m],this.notify("child_removed",v)}if(this.children||(this.children={}),this.type="object",Array.isArray(e)&&(this.type="array"),1==n&&e){var y=Object.keys(e);for(var w in this.children)if(-1==y.indexOf(w)){h=!0;var b=this.children[w];this.notify("child_removed",b),b.reset()}}for(var E in p.children)this.children[E]?this.children[E].updateObject(p.children[E],n,s):(u=!0,this.children[E]=p.children[E],this.children[E]._parent=this,this.children[E].name=E,this.notify("child_added",this.children[E]));this.value=null,(u||h||l)&&o.push(this)}else{var x=this.value!==e;this.type="value",(x||l||s)&&(this.children=null,this.value=e,o.push(this))}var S=[];o.forEach((function(e){for(var t=e.parent;t;)-1==S.indexOf(t)&&S.push(t),t=t.parent;-1==S.indexOf(e)&&S.push(e)})),S.forEach((function(e){e.notify("value",null,a)})),S=[],o=[];for(var A=this,I=this.parent;I;)A.notified_child_added_to_parent||(A.notified_child_added_to_parent=!0,A.parent.notify("child_added",A)),A=I,I=I.parent;return this}}},u.prototype.updateObject=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=0==this.active;this.active=!0;var a=!1,r=!1;if("value"==e.type?(a=this.value!==e.value,this.value=e.value,this.type=e.type):"object"!=e.type&&"array"!=e.type||(a=this.value!==e.value,this.children||(this.children={}),this.type=e.type),1==t&&e.children){var s=Object.keys(e.children);for(var l in this.children)if(-1==s.indexOf(l)&&this.children[l]){r=!0;var c=this.children[l];this.notify("child_removed",c),c.reset()}}var d=!1;for(var p in e.children)this.children[p]?this.children[p].updateObject(e.children[p],t,n):(d=!0,this.children[p]=e.children[p],this.children[p]._parent=this,this.children[p].name=p,this.notify("child_added",this.children[p]));(d||a||r||i||n)&&o.push(this)},u.prototype.undo=function(){if(0!=c.length)for(var e=c[c.length-1][0];c.length>0;){var t=v(),n=t[1];if(Array.isArray(n)){var i=n[0],a=n[1];y([i,i.val()],t[0]),i.set(a,!1)}else if("batch"==n){this.beginBatch(!1);for(var o=[],r=v();"batch"!=r[1];)o.push(r),r=v();y("batch",t[0]),o.forEach((function(e){var t=e[1][0],n=e[1][1];y([t,t.val()],e[0]),t.set(n,!1)})),y("batch",r[0]),this.endBatch(!1)}if(0==c.length)break;if(e-c[c.length-1][0]>=this._undoStackTimestampInverval)break}},u.prototype.redo=function(){if(0!=d.length)for(var e=d[d.length-1][0];d.length>0;){var t=w(),n=t[1];if(Array.isArray(n)){var i=n[0],a=n[1];g([i,i.val()],t[0]),i.set(a,!1)}else if("batch"==n){this.beginBatch(!1);var o=[],r=w();for(g("batch",t[0]);"batch"!=r[1];)o.push(r),r=w();o.forEach((function(e){var t=e[1][0],n=e[1][1];g([t,t.val()],e[0]),t.set(n,!1)})),g("batch",r[0]),this.endBatch(!1)}if(0==d.length)break;if(d[d.length-1][0]-e>=this._undoStackTimestampInverval)break}},u.prototype.removeUndo=function(){c=[],d=[]},u.prototype.undoStackCount=function(){return c.length},u.prototype.redoStackCount=function(){return d.length},u.prototype.removeHeadUndoStack=function(){if(!s&&c.length>9999)if(Array.isArray(c[0]))c.splice(0,1);else{var e=0;if("batch"==c[0]){for(e++;"batch"!=c[e];)e++;e++,c.splice(0,e)}}},u.prototype.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if("object"!=this.type||null!=this.value||Array.isArray(this.children)||0!=Object.keys(this.children).length){for(var t in e&&(g([this,this.val()]),d=[],this.removeHeadUndoStack()),this.parent&&this.parent.notify("child_removed",this),this.children){var n=this.children[t];this.notify("child_removed",n)}this.reset();for(var i=this.parent;i;)i.notify("value"),i=i.parent;this.notify("value")}},u.prototype.reset=function(){for(var e in this.active=!1,this.notified_child_added_to_parent=!1,this.children)this.children[e].reset()},u.prototype.notify=function(e,t,n){var i=this;this.callbacks[e].forEach((function(a){"value"==e?s?r.push(i):a(i,!1,n):a(t)}))},u.prototype.get=function(){if("array"==this.type){var e=[];for(var t in this.children){var n=this.children[t].get();this.children[t].active&&(Array.isArray(n)?n.length>0&&e.push(n):"object"==i(n)&&p(n)||e.push(n))}return e}if("object"==this.type){var a={};for(var o in this.children){var r=this.children[o].get();this.children[o].active&&(Array.isArray(r)?r.length>0&&(a[o]=r):"object"==i(r)&&p(r)||(a[o]=r))}return l&&0==Object.keys(a).length?null:a}return this.value},u.prototype.val=function(){return this.get()},u.prototype.exists=function(){return null!=this.get()&&!p(this.get())},u.prototype.once=function(e,t){t&&t(this)},u.prototype.on=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t)if(this.callbacks[e]){if(this.callbacks[e].push(t),n)if("value"==e)t(this,!0);else if("child_added"==e)for(var i in this.children)t(this.children[i]),this.children[i].notified_child_added_to_parent=!0}else console.error("Invalid event");else console.error("Try to bind on empty callback")},u.prototype.off=function(e,t){if(t){var n=this.callbacks[e].indexOf(t);-1!=n&&this.callbacks[e].splice(n,1)}else this.callbacks[e]=[]},u.prototype.toString=function(){for(var e=this.name,t=this.parent;t;)e=t.name+"/"+e,t=t.parent;return e},u.prototype.__defineGetter__("key",(function(){return this.name})),u.prototype.__defineGetter__("ref",(function(){return this.toString()})),u.prototype.__defineGetter__("root",(function(){for(var e=this;e.parent;)e=e.parent;return e})),u.prototype.__defineGetter__("parent",(function(){return this._parent})),e.exports=u},4100:(e,t,n)=>{"use strict";var i=n(40961),a=n.n(i),o=n(40927),r=n.n(o),s=n(74316),l=n(79378),c=n(34357),d=n(15734),p=n.n(d),u=n(17334),h=n.n(u),m=n(37321),f=n.n(m),g=n(73700),v=n(15032),y=n(30310),w=n(9769),b=n(10611);const E={TYPE:y,messages:[],add:function(e,t){return t.title&&!t.description&&(t.description=t.title),t.description&&!t.title&&(t.title=t.description),t&&t.title&&t.description?(0!=this.messages.length&&e==this.messages[0].type&&1==w.compareObject(t,this.messages[0].data)?this.messages[0].count++:this.messages.unshift({id:b.v4(),type:e,data:t,count:1}),this.messages.length>100&&this.messages.pop(),this.onMessageChanged&&this.onMessageChanged(this.messages),this.messages.length):0},delete:function(e){for(var t=0;tt.version?-1:0})),this.appTemplateVersions=n,this.initializeEditor(),this.setState({showBusyIcon:!1})}.bind(this)))},initializeEditor:function(){for(var e=this.appTemplateVersions,t=!1,n=!1,i=null,a=0,o=e.length;at.label?1:0})),n.sort((function(e,t){return e.labelt.label?1:0}));for(var a=null,o=0;o0&&this.state.devices.map(function(n,i){var a=n.name||"";""!=t&&-1==a.toUpperCase().indexOf(t)||e.push(n)}.bind(this)),e.sort((function(e,t){var n=e.name.toLowerCase(),i=t.name.toLowerCase();return ni?1:0})),e},onCheckOutputAttached:function(e){this.setState({checkIfOutputIsAttachedBusy:!0}),this.checkOutputAttachedHandle&&this.checkOutputAttachedHandle.abort(),this.checkOutputAttachedHandle=p().get("/apiv1/devices/"+e).query({access_token:window.singularAccessToken}).end(function(t,n){if(n.headers.location)window.location=n.headers.location;else if(this.loadOutputsHandle=null,t)this.setState({checkIfOutputIsAttachedBusy:!1});else{var i=n.body;i.appinstance_id?this.setState({deviceIsInUse:!0,deviceIsInUseMessage:"The selected device is attached to app ID "+i.appinstance_id+". Do you want to proceed and attach the device to this app?",deviceToBeAttached:e}):this.onExecuteAttachDevice(e)}}.bind(this))},onExecuteAttachDevice:function(e){this.attachDeviceHandle&&this.attachDeviceHandle.abort(),this.attachDeviceHandle=p().put(ee.appendAccessTokenUrl("/apiv1/devices/"+e+"/appinstance")).send({appinstance_id:window.singularAppInstance.id}).end(function(t,n){if(this.attachDeviceHandle=null,t)this.props.onNotification("Error while attaching to device","error",5,"tc"),this.setState({selectedDeviceID:null,deviceToBeAttached:null,checkIfOutputIsAttachedBusy:!1});else{if(n.headers.location)return void(window.location=n.headers.location);this.setState({selectedDeviceID:e,deviceToBeAttached:null,checkIfOutputIsAttachedBusy:!1})}}.bind(this))},onDetachAppExecute:function(){null!=this.state.selectedDeviceID&&(this.setState({loadDevicesBusy:!0}),p().delete(ee.appendAccessTokenUrl("/apiv1/devices/"+this.state.selectedDeviceID+"/appinstance")).set("Content-Type","application/json").end(function(e,t){t.headers.location?window.location=t.headers.location:e?(console.log("error while detaching app: "+e),this.setState({loadDevicesBusy:!1})):(this.setState({selectedDeviceID:null}),this.loadOutputs())}.bind(this)))},onSelectDevice:function(e){"detach"!=e?e!=this.state.selectedDeviceID&&this.onCheckOutputAttached(e):this.setState({confirmDetachOutput:!0})},onCopyClipboard:function(e){this.props.onNotification&&this.props.onNotification(e+" copied to clipboard","success",5,"tc")},render:function(){var e,t,n,i,a,o,s=this;window.singularUser.account.subscription.weboutput_limit;if(this.state.selectedDeviceID||(e=this.getFilteredAndSortedList().map(function(e,t){var n;return n=e.appinstance_id?r().createElement("i",{className:"fa fa-wifi",style:{position:"relative",top:"2px"}}):r().createElement("i",null),r().createElement("li",{key:"device-"+t},r().createElement("a",{onClick:this.onSelectDevice.bind(this,e.id)},r().createElement("div",null,n,r().createElement("span",{style:{width:"150px",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle"}},e.name))))}.bind(this))),this.state.loadDevicesBusy||this.state.checkIfOutputIsAttachedBusy)n=r().createElement("button",{className:"btn btn-white dropdown-toggle",tabIndex:"-1",style:{fontSize:"14px",width:"200px",padding:"0px",margin:"0px"}},r().createElement("img",{style:{height:"28px"},src:"/images/loading-bubbles-blue.svg",className:"loader"}));else{var l,c;if(this.state.selectedDeviceID){var d=this.state.devices.find(function(e){if(e.id==this.state.selectedDeviceID)return e}.bind(this));d?(l=d.name,c=r().createElement("li",{key:"detach"},r().createElement("a",{onClick:this.onSelectDevice.bind(this,"detach")},r().createElement("i",{style:{width:"20px",display:"inline-block"}}),"Detach Current Output"))):l="undefined"}else l="Select Output";n=r().createElement("button",{key:"button_dropdownWebOutputSelector",className:"btn btn-white dropdown-toggle","data-toggle":"dropdown",tabIndex:"-1",style:{paddingTop:"3.75px",paddingBottom:"3.75px"}},r().createElement("div",{style:{width:"calc(100% - 10px)",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},l)),t=r().createElement("ul",{key:"options_dropdownWebOutputSelector",className:"dropdown-menu dropdown-menu-right"},c,e)}return this.state.devices.length&&(i=r().createElement("div",{className:"dropdown dropdown-white"},n,t)),this.state.deviceOnairUrl?(o="Output URL",a=this.state.deviceOnairUrl):(o="App Output URL",a=this.props.appOutputUrl+"?aspect=16:9"),r().createElement("div",{className:"output-selection",style:{display:"flex",alignItems:"center"}},i,this.state.devices.length>0&&r().createElement("button",{tabIndex:"-1",onClick:this.loadOutputs,className:"tool-button",style:{marginRight:"10px",fontSize:"12px"}},r().createElement("i",{className:"fa fa-refresh fa-lg"})),r().createElement(x.A,{text:a,options:{format:"text/plain"},onCopy:this.onCopyClipboard.bind(this,o)},r().createElement("button",{className:"tool-button"},r().createElement("i",{className:"fa fa-clipboard"}))),r().createElement(Q(),{show:this.state.deviceIsInUse,title:"",text:this.state.deviceIsInUseMessage,showCancelButton:!0,onConfirm:function(){s.setState({deviceIsInUse:!1}),s.onExecuteAttachDevice(s.state.deviceToBeAttached)},onCancel:function(){s.setState({deviceIsInUse:!1,checkIfOutputIsAttachedBusy:!1})},onEscapeKey:function(){s.setState({deviceIsInUse:!1,checkIfOutputIsAttachedBusy:!1})},onOutsideClick:function(){s.setState({deviceIsInUse:!1,checkIfOutputIsAttachedBusy:!1})}}),r().createElement(Q(),{show:this.state.confirmDetachOutput,title:"",text:"Are you sure you want to detach the control app?",showCancelButton:!0,onConfirm:function(){s.setState({confirmDetachOutput:!1}),s.onDetachAppExecute()},onCancel:function(){s.setState({confirmDetachOutput:!1})},onEscapeKey:function(){s.setState({confirmDetachOutput:!1})},onOutsideClick:function(){s.setState({confirmDetachOutput:!1})}}))}});var ne=n(59833),ie=n.n(ne),ae=n(16918),oe=n.n(ae),re=n(88534),se=n.n(re),le=n(9769),ce=n(73801),de=n(7259);const pe=r().createClass({displayName:"AppInstanceControl",mixins:[Z()],getInitialState:function(){return this.mainAppSubscribe=null,this.compUpgradeHandle=null,this.accumulatedLogSize=0,this.triggerUpdateLastModify=h()(this.triggerAppLastModify,1e4),this.sendCommandLog=(0,g.n)(5e3,!1,this._sendCommandLog),1==window.singularAppInstance.composition_managed_by_singular&&(this.currentCompTS=null,this.currentCompTSRef=null,this.currentCompExtractOfTheOutput=null,this.currentCompExtractRefId=null),{appLoading:!0,globalBusy:!0,appInstance:null,appOutput:null,selectedOutputType:null,selectedOutputStatus:null,controlAppGeneralError:"",controlAppRepair:"",requestedOutputMode:null,compChanged:!1,appChanged:!1,menuBusy:!1,compExtractId:"",signalStrength:0,payloadWrite:0,payloadTotal:0,storageWrite:0,storageTotal:0,showHeader:!0}},componentWillMount:function(){var e=this;if(window.singularAppInstance.noHeader&&this.setState({showHeader:!1}),window.SingularPreviewSettings={videoType:"default"},null!=this.mainAppSubscribe&&this.props.appRtdbRef.off("value",this.mainAppSubscribe),this.mainAppSubscribe=this.props.appRtdbRef.on("value",(function(){e.triggerUpdateLastModify()})),this.props.appRtdbRef.child("outputs").on("value",(function(t){e.refs.WebOutputSelector&&e.refs.WebOutputSelector.loadOutputs()})),1==window.singularAppInstance.composition_managed_by_singular){var t=function(t){e.checkCompTS(t.val())};this.props.appRtdbRef.child("outputs").on("value",(function(n){var i=n.val(),a=i[Object.keys(i)[0]];null==e.currentCompExtractOfTheOutput||e.currentCompExtractOfTheOutput==a.compExtract?(e.currentCompExtractOfTheOutput=a.compExtract,null==a.compExtract||window.singularAccessToken||(e.props.appRtdbRef.child("compExtracts").child(a.compExtract).child("ts").once("value",(function(t){e.currentCompTS=t.val()})),e.props.appRtdbRef.child("compExtracts").child(a.compExtract).child("refId").once("value",(function(n){e.currentCompExtractRefId=n.val(),p().get("/apiv1/compositions/"+e.currentCompExtractRefId).send().end((function(n,i){if(n)e.currentCompTSRef=null;else if(e.currentCompTSRef&&e.currentCompTSRef.off("value",t),i.body.account_id==window.singularUser.account.accountId)if(null===i.body.datastore){var a=i.body.firebaseUrl;a=a.replace(/https:\/\/.*\.firebaseio.com/gm,"");var o=function(n){e.currentCompTSRef=e.rtdbRef.database.ref(a).child("ts"),e.currentCompTSRef.on("value",t)};null==e.rtdbRef?null==e.props.rtdbRef?s.A.connect((function(t,n){e.rtdbRef=n,o()})):(e.rtdbRef=e.props.rtdbRef,o()):o()}else e.currentCompTSRef=new(oe())(null),new(se())(e.currentCompTSRef,i.body.datastore).then((function(n){e.currentCompTSRef.child("ts").on("value",t)}));else e.currentCompTSRef=null}))})))):window.location.reload()}))}1==window.multipleDBs&&p().post("/multipledatabases/sync").send({path:window.singularStartupDb}).end()},shouldComponentUpdate:function(e,t){return!le.compareObject(e,this.props)||!le.compareObject(t,this.state)},componentDidMount:function(){var e=this;this.setState({globalBusy:!0}),window.addEventListener("message",(function(t){t&&t.data&&(window.singularAppInstance.noHeader||"_singular_show_app_header"!=t.data.event||e.setState({showHeader:t.data.value}),"_singular_upgrade_composition"==t.data.event&&e.upgradeComposition(),"_singular_upgrade_app"==t.data.event&&e.upgradeApp(),"_singular_app_loaded"==t.data.event&&(e.sendMessageToApp("_singular_upgrade_app_ready",e.state.appChanged),e.sendMessageToApp("_singular_upgrade_composition_ready",e.state.compChanged)))}));var t=a().findDOMNode(this.refs.iframeApp);t.onload=function(){var e=this,n=function(t){e.setState({controlAppGeneralError:"The app is broken and cannot be loaded. "})},i=function(i){ie().createSingularApp((function(i){try{t.contentWindow.singularAppInit&&t.contentWindow.singularAppInit(i);var a,o=i.listOutputs();if(o&&o.length&&(a=o[0]),null==i.getOutput(a.id).getComposition())throw"error";if(e.setState({globalBusy:!1,appInstance:i,appOutput:a?i.getOutput(a.id):null}),a&&a.id){var r=function(e){var t=e.val();t&&this.setState({attachedDevice:t.deviceId,attachedDeviceData:null,compExtractId:t.compExtract||null})}.bind(e);e.props.appRtdbRef.child("outputs").child(a.id).on("value",h()(r,200))}else e.setState({controlAppGeneralError:"This app doesn't have an output defined and cannot be loaded. "})}catch(e){n()}}),e.log)};57==window.singularAppInstance.apptemplate.id?this.props.appRtdbRef.once("value",(function(t){var a=t.val();if(!a.compExtracts&&a.storage&&a.storage.composition&&null!=a.storage.composition.refId){var o=le.appendAccessTokenUrl("/apiv1/compositions/".concat(a.storage.composition.refId));fetch(o).then((function(t){404==t.status?n():e.setState({controlAppRepair:"The app is broken. Do you want to try to repair it?",repairCompId:a.storage.composition.refId})})).catch((function(e){n()}))}else i()})):i()}.bind(this),window.commandLog=function(t,n){e.accumulatedLogSize+=t,e.sendCommandLog()},window.firebaseWriteTime=function(t,n,i){i&&console.warn("Singular Control App SDK: Real Time Database Timeout while writing ",n),t&&(e.setState({signalStrength:parseInt(t)}),e.sendMessageToApp("_singular_database_stats",{time:t,tag:n,timeout:i}),window.singularAppLogDatabaseOperations&&console.log("Database write: "+t+"ms ",n,i))},window.reportPayloadWrite=function(t,n){e.setState({payloadWrite:t,payloadTotal:n}),e.sendMessageToApp("_singular_payload_stats",{payloadWrite:t,payloadTotal:n}),window.singularAppLogDatabaseOperations&&console.log("Payload write: "+t+" / "+n)},window.reportStorageWrite=function(t,n){e.setState({storageWrite:t,storageTotal:n}),e.sendMessageToApp("_singular_storage_stats",{storageWrite:t,storageTotal:n}),window.singularAppLogDatabaseOperations&&console.log("Storage write: "+t+" / "+n)},window.singularAppInstance.apptemplate&&"published"!=window.singularAppInstance.apptemplate.status&&"development"!=window.singularAppInstance.apptemplate.status&&(this.setState({appChanged:!0}),this.sendMessageToApp("_singular_upgrade_app_ready",!0))},_sendCommandLog:function(){var e="";window.singularAccessToken&&(e="?access_token="+window.singularAccessToken),p().post("/apiv1/appinstances/"+window.singularAppInstance.id+"/logger"+e).send({size:this.accumulatedLogSize}).end(),this.accumulatedLogSize=0},triggerAppLastModify:function(){var e=this,t="";window.singularAccessToken&&(t="?access_token="+window.singularAccessToken),p().put("/apiv1/appinstances/"+window.singularAppInstance.id+"/metadata"+t).send().end((function(t,n){t&&e.onNotification("Failed to update app metadata","error",5,"tc")}))},sendMessageToApp:function(e,t){var n=a().findDOMNode(this.refs.iframeApp);n&&n.contentWindow&&n.contentWindow.postMessage&&n.contentWindow.postMessage({event:e,value:t},"*")},checkCompTS:function(e){this.currentCompTS!=e?(this.currentCompTS=e,this.setState({compChanged:!0}),this.sendMessageToApp("_singular_upgrade_composition_ready",!0)):(this.setState({compChanged:!1,menuBusy:!1,globalBusy:!1}),this.sendMessageToApp("_singular_upgrade_composition_ready",!1))},activateGlobalBusy:function(e){this.setState({globalBusy:e})},onSupport:function(){zE.identify({name:window.singularUser.name,email:window.singularUser.email}),zE.activate({hideOnClose:!0})},onIframeLoadCompleted:function(){this.setState({appLoading:!1})},openAnalytics:function(){window.open(window.location.href.replace("/control","/analytics"))},openDeveloperTools:function(){this.refs.AppInstanceDeveloperPanel&&this.refs.AppInstanceDeveloperPanel.open()},openAppInstanceSharePanel:function(){this.refs.AppInstanceSharePanel&&this.refs.AppInstanceSharePanel.open()},openAppInstancePreviewConfig:function(){this.refs.AppInstancePreviewConfig&&this.refs.AppInstancePreviewConfig.open()},openShareOutputPanel:function(e){this.refs.ShareOutputPanel&&this.refs.ShareOutputPanel.open(e)},fetchDeviceData:function(e){p().get(le.appendAccessTokenUrl("/apiv1/devices/"+e)).send().end(function(e,t){e||this.setState({attachedDeviceData:t.body})}.bind(this))},upgradeApp:function(){this.setState({globalBusy:!0}),p().put("/apiv1/appinstances/"+window.singularAppInstance.id+"/apptemplateversion").send({version:"published"}).end(function(e,t){if(e);else{if(t.headers.location)return void(window.location=t.headers.location);window.location.reload()}}.bind(this))},upgradeComposition:function(){var e=this;this.compUpgradeHandle&&this.compUpgradeHandle.abort(),this.setState({menuBusy:!0,compChanged:!1,globalBusy:!0}),this.compUpgradeHandle=p().put("/apiv1/appinstances/"+window.singularAppInstance.id+"/composition").send({refId:this.currentCompExtractRefId,keepPayload:!0}).end((function(t,n){if(e.compUpgradeHandle=null,t)window.location.reload();else{if(n.headers.location)return void(window.location=n.headers.location);e.currentCompExtractOfTheOutput=null,window.location.reload()}}))},editComposition:function(){var e=this;this.setState({menuBusy:!0}),ce.editComposition(window.singularAppInstance.id,window.singularAppInstance.name,(function(t,n){e.setState({menuBusy:!1}),t?e.onNotification(t,"error",5,"tc"):window.open("/compositions/"+n.compId+"/edit")}))},onNotification:function(e,t,n,i){this.refs&&this.refs.notificationSystem&&this.refs.notificationSystem.addNotification({message:e,level:t,autoDismiss:n,position:i})},render:function(){var e,t,n,i,a,o,s,l,c,d,p,u,h,m=this,g=window.singularAppInstance.apptemplate,y="/apptemplates/"+g.id+"/serve/"+g.version+"/app.html?";window.singularAppInstance.theme&&("light"==window.singularAppInstance.theme?y+="theme=grabyo&":y+="theme="+window.singularAppInstance.theme+"&"),window.singularAppInstance.uiLayout&&(y+="layout="+window.singularAppInstance.uiLayout),1!=window.singularUser.account.permission.permDevTool||window.singularUser.isAccessToken||(e=r().createElement(B,{activateGlobalBusy:this.activateGlobalBusy,appInstance:window.singularAppInstance,ref:"AppInstanceDeveloperPanel"}),t=r().createElement("li",{onClick:this.openDeveloperTools},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-item-icon"},r().createElement("i",{className:"fa fa-bug"}))," ","Developer Tools")))),this.state.appOutput&&(n=this.state.appOutput.getUrl(),window.singularAppInstance.fid&&(i=de.encode(window.singularAppInstance.fid),n=window.singularUrlBase+"output/"+i+"/"+this.state.appOutput.name)),(window.singularUser.isImpersonated||0==window.singularUser.account.accountId||"enterprise"==window.singularUser.account.subscription.subscription_plan&&!window.singularUser.isAccessToken)&&(a=r().createElement("li",{onClick:this.openAnalytics},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-item-icon"},r().createElement("i",{className:"fa fa-line-chart"}))," ","Analytics")))),window.singularUser.isAccessToken||(o=r().createElement(C,{ref:"AppInstanceSharePanel",onNotification:this.onNotification}),s=r().createElement("li",{onClick:this.openAppInstanceSharePanel},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-item-icon"},r().createElement("i",{className:"fa fa-share-alt"}))," ","Manage Access")))),this.state.appChanged&&(l=r().createElement("li",{onClick:this.upgradeApp},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-notification-bubble inline"},r().createElement("i",{className:"fa fa-exclamation"}))," ","Update App")))),this.state.compChanged&&(c=r().createElement("li",{onClick:this.upgradeComposition},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-notification-bubble inline"},r().createElement("i",{className:"fa fa-exclamation"}))," ","Update Composition")))),1!=window.singularAppInstance.composition_managed_by_singular||window.singularUser.isAccessToken||(d=r().createElement("li",{onClick:this.editComposition},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-item-icon"},r().createElement("i",{className:"fa fa-edit"}))," ","Edit Composition")))),p=0==this.state.menuBusy?r().createElement("button",{className:"tool-button",tabIndex:"-1","data-toggle":"dropdown"},r().createElement("i",{className:"fa fa-ellipsis-v"})):r().createElement("button",{className:"tool-button",tabIndex:"-1"},r().createElement("img",{style:{width:"20px",height:"100%"},src:"/images/loading-bubbles.svg",className:"loader"})),(d||l||c)&&(u=r().createElement("li",{className:"separator"})),window.singularUser.account&&"singular"==window.singularUser.account.brand&&(h=r().createElement("button",{className:"tool-button",tabIndex:"-1",onClick:this.onSupport},r().createElement("i",{className:"fa fa-life-ring"})));var w,b,E,x=r().createElement("div",{style:{display:"flex",height:"100%",alignItems:"center"}},r().createElement(te,{ref:"WebOutputSelector",appOutputUrl:n,onNotification:this.onNotification}),h,r().createElement("div",{className:"btn-group"},r().createElement("div",{className:"btn-group dropdown-white main-menu",role:"group"},void 0,p,r().createElement("ul",{className:"dropdown-menu dropdown-menu-right",style:{overflow:"hidden",top:"32px",width:"160px"}},r().createElement("li",{onClick:this.openShareOutputPanel.bind(this,"url")},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-item-icon"},r().createElement("i",{className:"fa fa-link"}))," ","Output URL"))),r().createElement("li",{onClick:this.openShareOutputPanel.bind(this,"embed")},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-item-icon"},r().createElement("i",{className:"fa fa-code"}))," ","Embed Code"))),s,r().createElement("li",{className:"separator"}),d,l,c,u,r().createElement("li",{onClick:this.openAppInstancePreviewConfig},r().createElement("a",null,r().createElement("div",{className:"menu-item-wrapper"},r().createElement("div",{className:"menu-item-icon"},r().createElement("i",{className:"fa fa-eye"}))," ","Preview Settings"))),t,a,void 0))),o,e,r().createElement(Y,{ref:"AppInstancePreviewConfig"}),r().createElement(J.A,{url:n,token:i,ref:"ShareOutputPanel",onNotification:this.onNotification})),S="/";window.singularUser&&window.singularUser.isAccessToken&&window.singularUser.account&&7519==window.singularUser.account.accountId&&(S="https://singular.live",w=r().createElement("button",{onClick:function(){return window.open("https://app.singular.live/users/signup","_blank")},style:{background:"#2DC3F7",color:"#ffffff",fontSize:"16px",padding:"2px 10px",border:"1px",cursor:"pointer",margin:"0px 10px"},tabIndex:"-1"},"Signup")),b=!this.state.signalStrength||this.state.signalStrength<0?"#b6b6b6":this.state.signalStrength<700?"#00b300":this.state.signalStrength<1800?"#f7892e":"#c03636",E=this.state.signalStrength<0?"Network latency will not be measured":this.state.signalStrength?"Network latency "+le.numberWithCommas(this.state.signalStrength)+" milliseconds":"Network latency not measured yet";var A,I,N=0;return this.state.showHeader&&0==this.state.appLoading&&(A=r().createElement("header",{className:"header",style:{display:"flex",alignItems:"center",padding:"0px",height:"40px",border:"0px"}},r().createElement("a",{href:S,tabIndex:"-1",style:{marginLeft:"10px"}},r().createElement("span",{className:"logo"})),w,r().createElement(_(),{placement:"bottom",delayShow:500,overlay:r().createElement(U(),{id:"signalStrength"},E)},r().createElement("div",{style:{padding:"0px 10px",color:b}},r().createElement("i",{className:"fa fa-signal"}))),function(){var e="Playload write / total "+le.humanFileSize(m.state.payloadWrite)+" / "+le.humanFileSize(m.state.payloadTotal)+"\nStorage write / total "+le.humanFileSize(m.state.storageWrite)+" / "+le.humanFileSize(m.state.storageTotal);m.state.payloadWrite||m.state.storageWrite||m.state.payloadTotal||m.state.storageTotal||(e="No data written yet");var t,n=Math.round((m.state.payloadTotal+m.state.storageTotal)/4194304*1e3)/10;return t=n<50?"gauge-ok":n<75?"gauge-warning":"gauge-error",r().createElement(_(),{placement:"right",overlay:r().createElement(U(),{id:"storage-size-info"},e)},r().createElement("div",{className:"storage-size"},r().createElement("div",{className:"storage-size-gauge "+t,style:{width:n+"%"}}),r().createElement("div",{className:"storage-size-label"},n.toFixed(1)+"%")))}(),r().createElement("div",{style:{padding:"0px 10px",fontSize:"16px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"}},window.singularAppInstance.name),r().createElement("div",{style:{flexGrow:"1"}},r().createElement(v.A,null)),r().createElement("div",{className:"app-header-tools"},x)),N=40),1!=this.state.globalBusy&&1!=this.state.appLoading||(I=r().createElement("div",{style:{width:"100%",height:"100%",backgroundColor:"#333",zIndex:"2",position:"absolute"}},r().createElement("img",{style:{position:"absolute",margin:"auto",top:"0",left:"0",bottom:"0",right:"0"},src:"/images/loading-bubbles-blue.svg",className:"loader"}))),r().createElement("div",{id:"app-instance",className:"height-100p",style:{overflow:"hidden"}},I,r().createElement(f(),{ref:"notificationSystem",style:!1}),A,r().createElement("div",{style:{width:"100%",height:"calc(100% - "+N+"px)"}},r().createElement("iframe",{title:"Control App Instance",ref:"iframeApp",src:y,style:{border:"0px",overflow:"hidden",left:"0px",top:"0px",width:"0px",height:"0px",maxWidth:"100%",maxHeight:"100%",minWidth:"100%",minHeight:"100%"},allowFullScreen:!0,onLoad:function(e){setTimeout((function(){m.onIframeLoadCompleted()}),1e3)}})),r().createElement(Q(),{show:""!==this.state.controlAppGeneralError,title:"",text:this.state.controlAppGeneralError,onConfirm:function(){window.location.href="/dashboard"},onCancel:function(){window.location.href="/dashboard"},onEscapeKey:function(){window.location.href="/dashboard"},onOutsideClick:function(){window.location.href="/dashboard"}}),r().createElement(Q(),{show:""!==this.state.controlAppRepair,title:"",text:this.state.controlAppRepair,showCancelButton:!0,confirmButtonText:"Try to repair",cancelButtonText:"Cancel",onConfirm:function(){fetch(le.appendAccessTokenUrl("/apiv1/appinstances/".concat(window.singularAppInstance.id,"/composition")),{method:"PUT",body:JSON.stringify({refId:m.state.repairCompId}),headers:{"Content-Type":"application/json"}}).then((function(e){window.location.reload()}))},onCancel:function(){window.location.href="/dashboard"},onEscapeKey:function(){window.location.href="/dashboard"},onOutsideClick:function(){window.location.href="/dashboard"}}))}});var ue=n(86479),he=n(9769);const me=r().createClass({displayName:"AppInstanceAnalytics",mixins:[Z()],getInitialState:function(){return{globalBusy:!0,appInstance:null,appOutput:null}},componentWillMount:function(){},shouldComponentUpdate:function(e,t){return!he.compareObject(e,this.props)||!he.compareObject(t,this.state)},componentDidMount:function(){},onNotification:function(e,t,n,i){this.refs.notificationSystem.addNotification({message:e,level:t,autoDismiss:n,position:i})},render:function(){return r().createElement("div",{id:"app-instance",className:"height-100p singular-browser-content",style:{overflow:"hidden",left:"0px",width:"100%"}},r().createElement(f(),{ref:"notificationSystem",style:!1}),r().createElement("header",{className:"header",style:{display:"flex",alignItems:"center",padding:"0px",height:"40px",border:"0px"}},r().createElement("a",{href:"/",tabIndex:"-1",style:{marginLeft:"10px"}},r().createElement("span",{className:"logo"})),r().createElement("div",{style:{padding:"0px 10px",fontSize:"16px"}},window.singularAppInstance.name)),r().createElement("div",{className:"portal-content",style:{width:"100%",height:"calc(100% - 40px)",borderTop:"solid 1px #00000033",background:"var(--main-bg-color)",paddingLeft:"10px"}},r().createElement(ue.A,{mode:"app",appId:String(window.appInstance),onNotification:this.onNotification})))}});var fe=n(24510);const ge=r().createClass({displayName:"DataStoreOnlineStatus",getInitialState:function(){return this.intervalHandle=null,this.offlineTimer=1,{message:null,initializing:!0}},componentDidMount:function(){this.setStatus(!0)},setStatus:function(e){var t=this;e?(this.offlineTimer=1,this.setState({message:null,initializing:!1}),this.intervalHandle&&(clearInterval(this.intervalHandle),this.intervalHandle=null)):this.state.initializing||(this.intervalHandle=setInterval((function(){t.setState({message:"Lost connection. Trying to reconnect ... "+t.offlineTimer+" s"}),t.offlineTimer++}),1e3))},render:function(){return null===this.state.message?null:r().createElement("div",{className:"conntecting-status"},r().createElement("div",{className:"connecting-status-wrapper"},r().createElement("div",{className:"connecting-status-content"},r().createElement("div",{className:"message"},this.state.message))))}});var ve=n(56574),ye=n.n(ve);function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,a,o,r,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return be(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?be(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n0&&window.singularAppControlData.compExtracts&&Object.keys(window.singularAppControlData.compExtracts).length>1)for(var u=0,h=Object.entries(window.singularAppControlData.compExtracts);u0?ye().uploadCompositionJSON(JSON.stringify(window.singularAppControlData),"app-".concat(window.singularAppInstance.id,"-").concat(Date.now()),"bak",(function(e){var n={};s.forEach((function(e){delete window.singularAppControlData.compExtracts[e],Ie.child("compExtracts").child(e).remove(),n["compExtracts.".concat(e)]=null})),Object.keys(n).length>0&&t(n),i()})):i()}else i();n((function(e){"connect"==e?Ae.setStatus(!0):"disconnect"==e&&Ae.setStatus(!1)}))})),window.singularUser.isAccessToken||s.A.connect((function(e,t){if(t){var n=document.createElement("div");n.id="__logout__",document.body.appendChild(n),a().render(r().createElement(fe.A,null),n)}else a().render(r().createElement(c.A,null),Ee)}))}else s.A.connect((function(e,t){if(t){if(a().render(r().createElement(l.A,null),Ee),t.once("value",(function(e){var n=function(e){a().render(r().createElement(pe,{rtdbRef:t,appRtdbRef:t}),xe)};window.singularAppControlData=e.val();var i=[],o=[];if(0==window.singularAppInstance.composition_managed_by_singular){for(var s=0,l=Object.entries(window.singularAppControlData.outputs);s0&&window.singularAppControlData.compExtracts&&Object.keys(window.singularAppControlData.compExtracts).length>1)for(var p=0,u=Object.entries(window.singularAppControlData.compExtracts);p0?ye().uploadCompositionJSON(JSON.stringify(window.singularAppControlData),"app-".concat(window.singularAppInstance.id,"-").concat(Date.now()),"bak",(function(e){o.forEach((function(e){delete window.singularAppControlData.compExtracts[e],t.child("compExtracts").child(e).remove()})),n()})):n()}else n()})),!window.singularUser.isAccessToken){var n=document.createElement("div");n.id="__logout__",document.body.appendChild(n),a().render(r().createElement(fe.A,null),n)}}else a().render(r().createElement(c.A,null),Ee)}))}var Ne=document.getElementById("appInstanceAnalytics");if(Ne&&(a().render(r().createElement(me,null),Ne),!window.singularUser.isAccessToken)){var Ce=document.createElement("div");Ce.id="__logout__",document.body.appendChild(Ce),a().render(r().createElement(fe.A,null),Ce)}},33287:(e,t,n)=>{var i=n(57437);e.exports={getDefaultLayout:function(e){return{visible:!0,left:0,leftUnit:"%",top:0,topUnit:"%",zPos:0,width:100,widthUnit:"%",height:100,heightUnit:"%",lockSize:!0,scaleX:100,scaleY:100,lockScale:!0,rotateX:0,rotateY:0,rotateZ:0,skewX:0,skewY:0,behavior:[],updateAnimation:{active:!1,alwaysExecute:!1,in:{duration:.5,effect:"fade",property:"none",easing:{easing:"power1",inOut:"out"}},out:{duration:.5,effect:"fade",property:"none",easing:{easing:"power1",inOut:"in"}},offset:.5},anchor:{x:50,y:50},zindex:e}},getRotateFromLayout:function(e){return{x:e.rotateX,y:e.rotateY,z:e.rotateZ}},getScaleFromLayout:function(e){return{x:e.scaleX/100,y:e.scaleY/100,z:(e.scaleX+e.scaleY)/200}},getCSSTransform:function(e,t){var n="",i={translateZ:0,rotateX:0,rotateY:0,rotateZ:0,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0},a=!1;t&&t.perspectiveActive&&(a=!0);var o=e.zPos||0;return 0==a&&(o=0),i.translateZ=o,0!=i.translateZ&&(n+="translateZ("+i.translateZ+"px) "),i.scaleX=e.scaleX/100,1!=i.scaleX&&(n+="scaleX("+i.scaleX+") "),i.scaleY=e.scaleY/100,1!=i.scaleY&&(n+="scaleY("+i.scaleY+") "),a&&(i.scaleZ=(Number(e.scaleX)+Number(e.scaleY))/200,1!=i.scaleZ&&(n+="scaleZ("+i.scaleZ+") ")),i.rotateX=0==a?0:e.rotateX,0!=i.rotateX&&(n+="rotateX("+i.rotateX+"deg) "),i.rotateY=0==a?0:e.rotateY,0!=i.rotateY&&(n+="rotateY("+i.rotateY+"deg) "),i.rotateZ=e.rotateZ,0!=i.rotateZ&&(n+="rotateZ("+i.rotateZ+"deg) "),i.skewX=e.skewX,i.skewY=e.skewY,0==i.skewX&&0==i.skewY||(i.skewX=Math.min(Math.max(i.skewX,-89.9),89.9),i.skewY=Math.min(Math.max(i.skewY,-89.9),89.9),n+="skew("+i.skewX+"deg, "+i.skewY+"deg) "),{transform:n,transformObj:i}},layoutToStyle:function(e,t,n,i,a){return i||(i={}),this.layoutToStyleTransform(e,t,n,i,a),this.layoutToStyleEffect(e,t,n,i),this.layoutGetShadow(e,t,n,i),this.layoutGetMaskStyle(e,t,n,i),this.layoutGetBlur(e,t,n,i),this.layoutGetBlendModeStyle(e,t,n,i),i},layoutToStyleTransform:function(e,t,n,a,o){a||(a={}),e.visible&&"0"!==e.visible&&"false"!==e.visible?a.visibility="inherit":a.visibility="hidden";var r=this.getCSSTransform(e,t).transform;a.transform=r;var s=e.leftUnit||"%",l=e.topUnit||"%",c=e.widthUnit||"%",d=e.heightUnit||"%",p=e.width,u=e.height,h=(100-p)*e.anchor.x/100,m=(100-u)*e.anchor.y/100,f=Number(e.left)+h;f&&(a.left=f+s);var g=Number(e.top)+m;if(g&&(a.top=g+l),a.width=e.width+c,a.height=e.height+d,50==e.anchor.x&&50==e.anchor.y||(a.transformOrigin=e.anchor.x+"% "+e.anchor.y+"%"),t&&t.perspectiveActive&&(a.transformStyle="preserve-3d"),void 0!==e.groupClipChildren&&1==e.groupClipChildren&&(a.overflow="hidden",void 0!==e.groupBorderRadiusMode))if(e.groupBorderRadiusMode){var v=e.groupBorderRadiusValueTL*o.width/100;a.borderRadius=v+"px"}else{var y=e.groupBorderRadiusValueTL||0,w=e.groupBorderRadiusValueTR||0,b=e.groupBorderRadiusValueBL||0,E=e.groupBorderRadiusValueBR||0,x=y*o.width/100,S=w*o.width/100,A=b*o.width/100,I=E*o.width/100;a.borderRadius=x+"px "+S+"px "+A+"px "+I+"px"}return a.zIndex=-e.zindex,a.position="absolute",void 0!==e.opacity&&e.opacity!=i.opacity&&(a.opacity=e.opacity/100),a},layoutToStyleEffect:function(e,t,n,a){return a||(a={}),a.filter="",void 0!==e.filterBrightness&&e.filterBrightness!=i.filterBrightness&&(a.filter+=" brightness("+e.filterBrightness+"%)"),void 0!==e.filterContrast&&e.filterContrast!=i.filterContrast&&(a.filter+=" contrast("+e.filterContrast+"%)"),void 0!==e.filterGrayscale&&e.filterGrayscale!=i.filterGrayscale&&(a.filter+=" grayscale("+e.filterGrayscale+"%)"),void 0!==e.filterHueRotate&&e.filterHueRotate!=i.filterHueRotate&&(a.filter+=" hue-rotate("+e.filterHueRotate+"deg)"),void 0!==e.filterInvert&&e.filterInvert!=i.filterInvert&&(a.filter+=" invert("+e.filterInvert+"%)"),void 0!==e.filterSaturate&&e.filterSaturate!=i.filterSaturate&&(a.filter+=" saturate("+e.filterSaturate+"%)"),void 0!==e.filterSepia&&e.filterSepia!=i.filterSepia&&(a.filter+=" sepia("+e.filterSepia+"%)"),""!==a.filter&&(a.WebkitFilter=a.filter),t&&t.perspectiveActive&&(a.transformStyle="preserve-3d",e.backfaceVisibility||(a.backfaceVisibility="hidden")),a},layoutGetShadow:function(e,t,n,a){if(a||(a={}),void 0!==e.filterDropShadowMode&&e.filterDropShadowMode!=i.filterDropShadowMode){var o=e.filterDropShadowX||i.filterDropShadowX,r=e.filterDropShadowY||i.filterDropShadowY,s=e.filterDropShadowBlur||i.filterDropShadowBlur,l=e.filterDropShadowSpread||i.filterDropShadowSpread,c=e.filterDropShadowColor||i.filterDropShadowColor,d=e.filterDropShadowInset?"inset":"";"box"==e.filterDropShadowMode?a.boxShadow=d+" "+o+"px "+r+"px "+s+"px "+l+"px rgba("+c.r+","+c.g+","+c.b+","+c.a+")":(void 0===a.filter&&(a.filter=""),a.filter+=" drop-shadow("+o+"px "+r+"px "+s+"px rgba("+c.r+","+c.g+","+c.b+","+c.a+")) ",a.filter&&(a.WebkitFilter=a.filter))}return a},layoutGetMaskStyle:function(e,t,n,i){return i},layoutGetBlur:function(e,t,n,a){return void 0!==a&&""!=a||(a={}),void 0!==e.filterBlur&&e.filterBlur!=i.filterBlur&&(void 0===a.filter&&(a.filter=""),a.filter+="blur("+e.filterBlur+"px)",a.filter&&(a.WebkitFilter=a.filter)),a},layoutGetBlendModeStyle:function(e,t,n,i){return{}}}},89634:(e,t,n)=>{"use strict";e.exports=n(92007),e.exports.Panel=n(46784)},71906:(e,t,n)=>{"use strict";"undefined"==typeof window?e.exports=function(){return null}:e.exports=n(10062)},59833:function(e,t,n){var i;function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,a,o,r,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n0?a[0].comps.push(n):t.push({name:i.name,comps:[n]})}return t}(i),s=[];if("In"==n)for(var l=0;l0||f.length>0)&&(t="update")}n[i]=j(o);var g=JSON.stringify(d).length;window.commandLog&&window.commandLog(g,"storage"),e.child("storage").child(i)[t](d);var v={};if("set"==t)v["storage.".concat(i.replace(new RegExp("/","g"),"."))]=d;else if("update"==t)for(var y="storage.".concat(i.replace(new RegExp("/","g"),"."),"."),w=0,b=Object.entries(d);w0?W(n[0].id).remove((function(){t()})):e&&e()};t()},getAppInstanceInfo:function(){return g},ServerDate:f,registerWindow:function(e){e.addEventListener("message",(function(e){if(("_singular_composition_payload_changed"===e.data.event||"_singular_composition_payload_sdk"===e.data.event)&&e.data.compExtract&&e.data.compExtract&&n.compExtracts[e.data.compExtract]){var t=n.compExtracts[e.data.compExtract].compositions[e.data.params.compId||e.data.params.compositionId];t.dataSources.composition.controlNode.payload=o(!0,t.dataSources.composition.controlNode.payload,e.data.params.payload)}}))}});return K},{createWithAppInstanceKey:function(e,t,n,i,a,o){if(n){window.singularAppUsername=i,window.singularAppPasswd=a,window.singularUrlBase=t,window.singularAccessToken=o;var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4==this.readyState)if(200==this.status)try{var e=JSON.parse(this.responseText);window.singularAppInstance=e.appInstance;var t={apiKey:"AIzaSyAio3OzdJyS0XSVm8_AiUqa7Ux5z716RrA",authDomain:"fiery-torch-2122.firebaseapp.com",databaseURL:"https://fiery-torch-2122.firebaseio.com",storageBucket:"fiery-torch-2122.appspot.com"},i=firebase.initializeApp(t),a=i.database().ref().child(e.firebaseUrl.replace(t.databaseURL,""));i.auth().signInWithCustomToken(e.firebaseToken).then((function(){a.once("value",(function(e){window.singularAppControlData=e.val();var t=d(a,(function(e){console.log(JSON.stringify(e))}));n(t)}))})).catch((function(e){n(void 0)}))}catch(e){n(void 0)}else n(void 0)},r.open("POST",t+"apiv1/apptemplates/virtualappinstance",!0),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.send("key="+e)}},createSingularApp:function(e,t){if(window.singularDataStoreSBRef){var n=window.singularDataStoreSBRef;e(d(n,t))}else n=window.singularRtdbCoreRef.child(window.singularStartupDb),e(d(n,t))}});void 0===(i=function(){return g}.call(t,n,t,e))||(e.exports=i)}).call(this)}},n={};function i(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=t,i.amdO={},e=[],i.O=(t,n,a,o)=>{if(!n){var r=1/0;for(d=0;d=o)&&Object.keys(i.O).every((e=>i.O[e](n[l])))?n.splice(l--,1):(s=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,a,o]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e={983:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var a,o,[r,s,l]=n,c=0;if(r.some((t=>0!==e[t]))){for(a in s)i.o(s,a)&&(i.m[a]=s[a]);if(l)var d=l(i)}for(t&&t(n);ci(4100)));a=i.O(a)})();