diff --git a/assets/huegasm-9f87ba5d113b89c8739f2b848cdef120.js b/assets/huegasm-348acaeb3c68c4ad413e984dab013efd.js similarity index 96% rename from assets/huegasm-9f87ba5d113b89c8739f2b848cdef120.js rename to assets/huegasm-348acaeb3c68c4ad413e984dab013efd.js index 9a68a87..b3a509a 100644 --- a/assets/huegasm-9f87ba5d113b89c8739f2b848cdef120.js +++ b/assets/huegasm-348acaeb3c68c4ad413e984dab013efd.js @@ -12,11 +12,11 @@ function o(e){var o=e[0] return o&&"function"==typeof o.cancelAll||Ember.assert("The first argument passed to the `cancel-all` helper should be a Task or TaskGroup (without quotes); you passed "+o,!1),(0,t.taskHelperClosure)("cancel-all","cancelAll",[o,n])}e.default=Ember.Helper.helper(o)}),define("huegasm/helpers/ember-power-select-is-group",["exports","ember-power-select/helpers/ember-power-select-is-group"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"emberPowerSelectIsGroup",{enumerable:!0,get:function(){return t.emberPowerSelectIsGroup}})}),define("huegasm/helpers/ember-power-select-is-selected",["exports","ember-power-select/helpers/ember-power-select-is-selected"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"emberPowerSelectIsSelected",{enumerable:!0,get:function(){return t.emberPowerSelectIsSelected}})}),define("huegasm/helpers/ember-power-select-true-string-if-present",["exports","ember-power-select/helpers/ember-power-select-true-string-if-present"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"emberPowerSelectTrueStringIfPresent",{enumerable:!0,get:function(){return t.emberPowerSelectTrueStringIfPresent}})}),define("huegasm/helpers/eq",["exports","ember-truth-helpers/helpers/equal"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"equal",{enumerable:!0,get:function(){return t.equal}})}),define("huegasm/helpers/fixed-grid-layout",["exports","ember-collection/layouts/grid"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Helper.helper(function(e,n){return new t.default(e[0],e[1])})}),define("huegasm/helpers/gt",["exports","ember-truth-helpers/helpers/gt"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"gt",{enumerable:!0,get:function(){return t.gt}})}) define("huegasm/helpers/gte",["exports","ember-truth-helpers/helpers/gte"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"gte",{enumerable:!0,get:function(){return t.gte}})}),define("huegasm/helpers/inline-svg",["exports","ember-inline-svg/helpers/inline-svg","huegasm/svgs"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}) var o=function(){return function(e,t){if(Array.isArray(e))return e -if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,s=!1,a=void 0 -try{for(var i,r=e[Symbol.iterator]();!(o=(i=r.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{!o&&r.return&&r.return()}finally{if(s)throw a}}return n}(e,t) +if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,s=!1,i=void 0 +try{for(var a,r=e[Symbol.iterator]();!(o=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{!o&&r.return&&r.return()}finally{if(s)throw i}}return n}(e,t) throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=void 0 -s=Ember.Helper&&Ember.Helper.helper?Ember.Helper.helper(function(e,s){var a=o(e,1)[0] -return(0,t.inlineSvg)(n.default,a,s)}):Ember.Handlebars.makeBoundHelper(function(e,o){return(0,t.inlineSvg)(n.default,e,o.hash||{})}),e.default=s}),define("huegasm/helpers/is-array",["exports","ember-truth-helpers/helpers/is-array"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"isArray",{enumerable:!0,get:function(){return t.isArray}})}),define("huegasm/helpers/is-equal",["exports","ember-truth-helpers/helpers/is-equal"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"isEqual",{enumerable:!0,get:function(){return t.isEqual}})}),define("huegasm/helpers/lt",["exports","ember-truth-helpers/helpers/lt"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"lt",{enumerable:!0,get:function(){return t.lt}})}),define("huegasm/helpers/lte",["exports","ember-truth-helpers/helpers/lte"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"lte",{enumerable:!0,get:function(){return t.lte}})}),define("huegasm/helpers/mixed-grid-layout",["exports","ember-collection/layouts/mixed-grid"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Helper.helper(function(e,n){return new t.default(e[0])})}),define("huegasm/helpers/not-eq",["exports","ember-truth-helpers/helpers/not-equal"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"notEq",{enumerable:!0,get:function(){return t.notEq}})}),define("huegasm/helpers/not",["exports","ember-truth-helpers/helpers/not"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"not",{enumerable:!0,get:function(){return t.not}})}),define("huegasm/helpers/or",["exports","ember-truth-helpers/helpers/or"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"or",{enumerable:!0,get:function(){return t.or}})}),define("huegasm/helpers/percentage-columns-layout",["exports","ember-collection/layouts/percentage-columns"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Helper.helper(function(e,n){return new t.default(e[0],e[1],e[2])})}),define("huegasm/helpers/perform",["exports","ember-concurrency/-helpers"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.performHelper=n +s=Ember.Helper&&Ember.Helper.helper?Ember.Helper.helper(function(e,s){var i=o(e,1)[0] +return(0,t.inlineSvg)(n.default,i,s)}):Ember.Handlebars.makeBoundHelper(function(e,o){return(0,t.inlineSvg)(n.default,e,o.hash||{})}),e.default=s}),define("huegasm/helpers/is-array",["exports","ember-truth-helpers/helpers/is-array"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"isArray",{enumerable:!0,get:function(){return t.isArray}})}),define("huegasm/helpers/is-equal",["exports","ember-truth-helpers/helpers/is-equal"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"isEqual",{enumerable:!0,get:function(){return t.isEqual}})}),define("huegasm/helpers/lt",["exports","ember-truth-helpers/helpers/lt"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"lt",{enumerable:!0,get:function(){return t.lt}})}),define("huegasm/helpers/lte",["exports","ember-truth-helpers/helpers/lte"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"lte",{enumerable:!0,get:function(){return t.lte}})}),define("huegasm/helpers/mixed-grid-layout",["exports","ember-collection/layouts/mixed-grid"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Helper.helper(function(e,n){return new t.default(e[0])})}),define("huegasm/helpers/not-eq",["exports","ember-truth-helpers/helpers/not-equal"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"notEq",{enumerable:!0,get:function(){return t.notEq}})}),define("huegasm/helpers/not",["exports","ember-truth-helpers/helpers/not"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"not",{enumerable:!0,get:function(){return t.not}})}),define("huegasm/helpers/or",["exports","ember-truth-helpers/helpers/or"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"or",{enumerable:!0,get:function(){return t.or}})}),define("huegasm/helpers/percentage-columns-layout",["exports","ember-collection/layouts/percentage-columns"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Helper.helper(function(e,n){return new t.default(e[0],e[1],e[2])})}),define("huegasm/helpers/perform",["exports","ember-concurrency/-helpers"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.performHelper=n function n(e,n){return(0,t.taskHelperClosure)("perform","perform",e,n)}e.default=Ember.Helper.helper(n)}),define("huegasm/helpers/task",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) e.default=Ember.Helper.helper(function(e){var t,n=(t=e,Array.isArray(t)?t:Array.from(t)),o=n[0],s=n.slice(1) return o._curry.apply(o,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1){var s=e.get("multipleBridgeIps") t.forEach(function(e){s.pushObject(e.internalipaddress)}),o="multiple"}else o="fail" e.set("bridgeFindStatus",o)}).fail(function(){e.set("bridgeFindStatus","fail")})},pingBridgeUser:function(){var e=this,t=this.get("bridgeIp"),n=this.get("bridgeUserNamePingIntervalProgress"),o=this.get("bridgeUsernamePingMaxTime") null!==t&&n<100?(r.ajax("http://"+t+"/api",{data:JSON.stringify({devicetype:"huegasm"}),contentType:"application/json",type:"POST"}).done(function(t,n){e.isDestroyed||"success"!==n||t[0].error||(e.clearBridgePingIntervalHandle(),e.get("storage").set("huegasm.bridgeUsername",t[0].success.username),e.set("bridgeUsername",t[0].success.username))}).fail(function(){e.clearBridgePingIntervalHandle(),e.setProperties({bridgeConnectError:!0,bridgeConnectMessage:l('Your network and/or computer security settings are preventing Huegasm from connecting to your Hue bridge.
Feel free to contact us at huegasm.app@gmail.com if this is unexpected and you need help debugging the problem.')})}),this.incrementProperty("bridgeUserNamePingIntervalProgress",this.get("bridgeUsernamePingIntervalTime")/o*100)):this.clearBridgePingIntervalHandle()},clearBridgePingIntervalHandle:function(){clearInterval(this.get("bridgePingIntervalHandle")),this.set("bridgePingIntervalHandle",null)},actions:{retry:function(){this.onBridgeIpChange()},chooseBridge:function(e){this.set("bridgeIp",e),this.get("storage").set("huegasm.bridgeIp",e)},findBridgeByIp:function(){var e=this,t=this.get("manualBridgeIp") -"trial"===t.toLowerCase()||"offline"===t.toLowerCase()?this.setProperties({trial:!0,bridgeIp:"trial",bridgeUsername:"trial"}):r.ajax("http://"+t+"/api",{data:JSON.stringify({devicetype:"huegasm"}),contentType:"application/json",type:"POST"}).fail(function(){e.set("manualBridgeIpNotFound",!0),i(e,function(){this.set("manualBridgeIpNotFound",!1)},5e3)}).then(function(){e.send("chooseBridge",t)})}}})}),define("huegasm/pods/components/bridge-finder/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"V7xhQEDN",block:'{"symbols":["bridge"],"statements":[[4,"unless",[[20,["bridgeUsername"]]],null,{"statements":[[4,"if",[[20,["bridgeIp"]]],null,{"statements":[[4,"unless",[[20,["bridgeConnectError"]]],null,{"statements":[[0," "],[6,"svg"],[9,"version","1.2"],[9,"baseProfile","tiny"],[9,"id","press-bridge-button-img"],[9,"x","0px"],[9,"y","0px"],[9,"viewBox","0 0 345.5 335.5"],[9,"xml:space","preserve","http://www.w3.org/XML/1998/namespace"],[7],[0,"\\n "],[6,"path"],[9,"style"," fill: white; stroke: black;"],[9,"d","M164.7,288.7c8.3-21.9,40.4-18.1,40.4-18.1l-56.2-88.5c-16.7-0.6-30-14.3-30-31.1c0-17.2,13.9-31.2,31.2-31.2\\n c17.2,0,31.2,13.9,31.2,31.2c0,5.2-1.3,10.1-3.5,14.4c3.6,5.8,10.6,17.1,18.1,29.3l6,9.8c-7.2-11.8-0.9-20.7,5.3-23.3\\n c14-9.1,21.4,5.1,21.4,5.1l5.3,8.7c-5.3-8.7-4.8-16.3,2.8-20.7c0,0,4.8-3.4,9.4-2.7c5.1,0.8,11.8,6.2,19.6,19.7\\n c0.3,0.6,0.6,1.1,0.9,1.6c-2.4-5.9-6-19.8,6.4-25.9c12.2-5.2,18.8,3.1,18.8,3.1s2.2,3.2,5.6,8.4c1.8-9.3,2.7-18.8,2.7-28.6\\n C300,67.1,232.8,0,150,0C67.1,0,0,67.1,0,150s67.1,150,150,150c4.6,0,9.1-0.2,13.6-0.6C162.2,295.5,163.5,290.9,164.7,288.7z\\n M150,66.6c6.5,0,11.8,5.3,11.8,11.8c0,6.5-5.3,11.8-11.8,11.8c-6.5,0-11.8-5.3-11.8-11.8C138.2,71.9,143.5,66.6,150,66.6z\\n M79.7,161.8c-6.5,0-11.8-5.3-11.8-11.8c0-6.5,5.3-11.8,11.8-11.8c6.5,0,11.8,5.3,11.8,11.8C91.5,156.5,86.2,161.8,79.7,161.8z\\n M98.3,110c-6.5,0-11.8-5.3-11.8-11.8c0-6.5,5.3-11.8,11.8-11.8c6.5,0,11.8,5.3,11.8,11.8C110.1,104.7,104.8,110,98.3,110z"],[7],[8],[0,"\\n "],[6,"path"],[9,"style"," fill: white; stroke: #8089ff; stroke-width: 5px;"],[9,"d","M150.8,154.6c10.6-6.4,16.8-2.8,20.4,1.2c0.3-1.5,0.5-3.1,0.5-4.7c0-12-9.7-21.8-21.8-21.8c-12,0-21.8,9.7-21.8,21.8\\n c0,9.7,6.4,17.9,15.1,20.7C141.8,166.6,142.2,159.8,150.8,154.6z"],[7],[8],[0,"\\n "],[6,"path"],[9,"style"," fill: white; "],[9,"stroke","#000000"],[9,"stroke-width","7"],[9,"stroke-linecap","round"],[9,"stroke-linejoin","round"],[9,"stroke-miterlimit","10"],[9,"d","\\n M265.5,191.4c8.9,15.5-12.7-14.5,7.2-24.3c12.2-5.2,18.8,3.1,18.8,3.1s34.7,51.1,47.6,79.2c9.6,35.8-7,57.4-32.7,74\\n c-25.7,16.6-46,6.2-65.4-4.8c-19.4-11-47-13.6-64.2-12.8c-17.2,0.8-14.5-12.8-12.2-17.1c8.3-21.9,40.4-18.1,40.4-18.1L147.6,180\\n c0,0-12.9-15.6,3.2-25.4c16.1-9.7,22.2,3.7,24.3,6.6c0.9,1.3,10.2,16.4,20.6,33.3l6,9.8c-7.2-11.8-0.9-20.7,5.3-23.3\\n c14-9.1,21.4,5.1,21.4,5.1l5.3,8.7c-5.3-8.7-4.8-16.3,2.8-20.7c0,0,4.8-3.4,9.4-2.7C251,172.4,257.8,177.8,265.5,191.4z"],[7],[8],[0,"\\n "],[6,"line"],[9,"fill","none"],[9,"stroke","#000000"],[9,"stroke-width","7"],[9,"stroke-linecap","round"],[9,"stroke-linejoin","round"],[9,"stroke-miterlimit","10"],[9,"x1","266.9"],[9,"y1","194.1"],[9,"x2","278.3"],[9,"y2","213.9"],[7],[8],[0,"\\n "],[6,"line"],[9,"fill","none"],[9,"stroke","#000000"],[9,"stroke-width","7"],[9,"stroke-linecap","round"],[9,"stroke-linejoin","round"],[9,"stroke-miterlimit","10"],[9,"x1","233.1"],[9,"y1","194.1"],[9,"x2","252.9"],[9,"y2","227"],[7],[8],[0,"\\n "],[6,"line"],[9,"fill","none"],[9,"stroke","#000000"],[9,"stroke-width","7"],[9,"stroke-linecap","round"],[9,"stroke-linejoin","round"],[9,"stroke-miterlimit","10"],[9,"x1","200.6"],[9,"y1","203"],[9,"x2","226"],[9,"y2","241.6"],[7],[8],[0,"\\n "],[8],[0,"\\n\\n "],[1,[25,"paper-progress-linear",null,[["warn","value"],[true,[20,["bridgeUserNamePingIntervalProgress"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[20,["isAuthenticating"]]],null,{"statements":[[0," "],[6,"p"],[7],[0,"\\n Your bridge IP is "],[6,"b"],[7],[1,[18,"bridgeIp"],false],[8],[0,"\\n "],[6,"br"],[7],[8],[0," Press the button on your bridge to authenticate Huegasm.\\n "],[8],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[20,["bridgeConnectError"]]],null,{"statements":[[0," "],[1,[18,"bridgeConnectMessage"],false],[0,"\\n"]],"parameters":[]},{"statements":[[0," "],[6,"p"],[7],[0,"You failed to press the button in time. "],[6,"a"],[9,"class","no-text-decoration"],[9,"href","#"],[3,"action",[[19,0,[]],"retry"]],[7],[0,"RETRY"],[8],[8],[0,"\\n"]],"parameters":[]}]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"unless",[[20,["bridgeFindStatus"]]],null,{"statements":[[0," "],[1,[25,"paper-progress-circular",null,[["diameter"],[100]]],false],[0,"\\n "],[6,"p"],[7],[0,"Trying to find your bridge\'s IP."],[8],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[20,["bridgeFindMultiple"]]],null,{"statements":[[0," "],[6,"p"],[7],[0,"Multiple Hue bridges were found on your network. "],[6,"br"],[7],[8],[0," Please select the one you want to use with Huegasm."],[8],[0,"\\n\\n "],[6,"div"],[9,"id","bridge-button-group"],[7],[0,"\\n"],[4,"each",[[20,["multipleBridgeIps"]]],null,{"statements":[[0," "],[1,[25,"paper-radio",null,[["value","label","onChange"],[[19,1,[]],[19,1,[]],[25,"action",[[19,0,[]],"chooseBridge"],null]]]],false],[0,"\\n"]],"parameters":[1]},null],[0," "],[8],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[20,["bridgeFindFail"]]],null,{"statements":[[0," "],[6,"p"],[7],[0,"A hue bridge could not be automatically found on your network. "],[6,"br"],[7],[8],[0," Enter one manually? "],[6,"br"],[7],[8],[0,"(or type "],[6,"b"],[7],[0,"offline"],[8],[0," to look around)\\n "],[8],[0,"\\n\\n "],[6,"span"],[9,"id","bridge-input"],[7],[0,"\\n "],[1,[25,"paper-input",null,[["label","value","onChange"],["Hue bridge IP address",[20,["manualBridgeIp"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["manualBridgeIp"]]],null]],null]]]],false],[0,"\\n\\n "],[6,"div"],[7],[0,"\\n "],[1,[25,"paper-button",null,[["onClick","raised","primary","label"],[[25,"action",[[19,0,[]],"findBridgeByIp"],null],true,true,"Find"]]],false],[0,"\\n "],[8],[0,"\\n "],[8],[0,"\\n\\n"],[4,"if",[[20,["manualBridgeIpNotFound"]]],null,{"statements":[[0," "],[6,"p"],[9,"class","bg-danger"],[7],[0,"\\n Could not find a bridge with that IP address.\\n "],[8],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]}]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/bridge-finder/template.hbs"}})}),define("huegasm/pods/components/hue-controls/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) -var t=Ember.A,n=Ember.Component,o=Ember.computed,s=Ember.isEmpty,a=Ember.isNone,i=Ember.run,r=i.later,l=i.scheduleOnce,c=Ember.inject,p=Ember.$ -e.default=n.extend({classNames:["container-fluid"],elementId:"hue-controls",lightsData:null,firstVisitApp:!0,activeLights:t(),tabList:["Lights","Music"],selectedTab:1,pauseLightUpdates:!1,displayNextFailure:!0,notify:c.service(),dimmerOnClass:o("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn md-menu-origin":"md-menu-origin"}),ready:o("lightsData","trial",function(){return this.get("trial")||!a(this.get("lightsData"))}),apiURL:o("bridgeIp","bridgeUsername",function(){return"http://"+this.get("bridgeIp")+"/api/"+this.get("bridgeUsername")}),tabData:o("tabList","selectedTab",function(){var e=[],t=this.get("selectedTab") +"trial"===t.toLowerCase()||"offline"===t.toLowerCase()?this.setProperties({trial:!0,bridgeIp:"trial",bridgeUsername:"trial"}):r.ajax("http://"+t+"/api",{data:JSON.stringify({devicetype:"huegasm"}),contentType:"application/json",type:"POST"}).fail(function(){e.set("manualBridgeIpNotFound",!0),a(e,function(){this.set("manualBridgeIpNotFound",!1)},5e3)}).then(function(){e.send("chooseBridge",t)})}}})}),define("huegasm/pods/components/bridge-finder/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"V7xhQEDN",block:'{"symbols":["bridge"],"statements":[[4,"unless",[[20,["bridgeUsername"]]],null,{"statements":[[4,"if",[[20,["bridgeIp"]]],null,{"statements":[[4,"unless",[[20,["bridgeConnectError"]]],null,{"statements":[[0," "],[6,"svg"],[9,"version","1.2"],[9,"baseProfile","tiny"],[9,"id","press-bridge-button-img"],[9,"x","0px"],[9,"y","0px"],[9,"viewBox","0 0 345.5 335.5"],[9,"xml:space","preserve","http://www.w3.org/XML/1998/namespace"],[7],[0,"\\n "],[6,"path"],[9,"style"," fill: white; stroke: black;"],[9,"d","M164.7,288.7c8.3-21.9,40.4-18.1,40.4-18.1l-56.2-88.5c-16.7-0.6-30-14.3-30-31.1c0-17.2,13.9-31.2,31.2-31.2\\n c17.2,0,31.2,13.9,31.2,31.2c0,5.2-1.3,10.1-3.5,14.4c3.6,5.8,10.6,17.1,18.1,29.3l6,9.8c-7.2-11.8-0.9-20.7,5.3-23.3\\n c14-9.1,21.4,5.1,21.4,5.1l5.3,8.7c-5.3-8.7-4.8-16.3,2.8-20.7c0,0,4.8-3.4,9.4-2.7c5.1,0.8,11.8,6.2,19.6,19.7\\n c0.3,0.6,0.6,1.1,0.9,1.6c-2.4-5.9-6-19.8,6.4-25.9c12.2-5.2,18.8,3.1,18.8,3.1s2.2,3.2,5.6,8.4c1.8-9.3,2.7-18.8,2.7-28.6\\n C300,67.1,232.8,0,150,0C67.1,0,0,67.1,0,150s67.1,150,150,150c4.6,0,9.1-0.2,13.6-0.6C162.2,295.5,163.5,290.9,164.7,288.7z\\n M150,66.6c6.5,0,11.8,5.3,11.8,11.8c0,6.5-5.3,11.8-11.8,11.8c-6.5,0-11.8-5.3-11.8-11.8C138.2,71.9,143.5,66.6,150,66.6z\\n M79.7,161.8c-6.5,0-11.8-5.3-11.8-11.8c0-6.5,5.3-11.8,11.8-11.8c6.5,0,11.8,5.3,11.8,11.8C91.5,156.5,86.2,161.8,79.7,161.8z\\n M98.3,110c-6.5,0-11.8-5.3-11.8-11.8c0-6.5,5.3-11.8,11.8-11.8c6.5,0,11.8,5.3,11.8,11.8C110.1,104.7,104.8,110,98.3,110z"],[7],[8],[0,"\\n "],[6,"path"],[9,"style"," fill: white; stroke: #8089ff; stroke-width: 5px;"],[9,"d","M150.8,154.6c10.6-6.4,16.8-2.8,20.4,1.2c0.3-1.5,0.5-3.1,0.5-4.7c0-12-9.7-21.8-21.8-21.8c-12,0-21.8,9.7-21.8,21.8\\n c0,9.7,6.4,17.9,15.1,20.7C141.8,166.6,142.2,159.8,150.8,154.6z"],[7],[8],[0,"\\n "],[6,"path"],[9,"style"," fill: white; "],[9,"stroke","#000000"],[9,"stroke-width","7"],[9,"stroke-linecap","round"],[9,"stroke-linejoin","round"],[9,"stroke-miterlimit","10"],[9,"d","\\n M265.5,191.4c8.9,15.5-12.7-14.5,7.2-24.3c12.2-5.2,18.8,3.1,18.8,3.1s34.7,51.1,47.6,79.2c9.6,35.8-7,57.4-32.7,74\\n c-25.7,16.6-46,6.2-65.4-4.8c-19.4-11-47-13.6-64.2-12.8c-17.2,0.8-14.5-12.8-12.2-17.1c8.3-21.9,40.4-18.1,40.4-18.1L147.6,180\\n c0,0-12.9-15.6,3.2-25.4c16.1-9.7,22.2,3.7,24.3,6.6c0.9,1.3,10.2,16.4,20.6,33.3l6,9.8c-7.2-11.8-0.9-20.7,5.3-23.3\\n c14-9.1,21.4,5.1,21.4,5.1l5.3,8.7c-5.3-8.7-4.8-16.3,2.8-20.7c0,0,4.8-3.4,9.4-2.7C251,172.4,257.8,177.8,265.5,191.4z"],[7],[8],[0,"\\n "],[6,"line"],[9,"fill","none"],[9,"stroke","#000000"],[9,"stroke-width","7"],[9,"stroke-linecap","round"],[9,"stroke-linejoin","round"],[9,"stroke-miterlimit","10"],[9,"x1","266.9"],[9,"y1","194.1"],[9,"x2","278.3"],[9,"y2","213.9"],[7],[8],[0,"\\n "],[6,"line"],[9,"fill","none"],[9,"stroke","#000000"],[9,"stroke-width","7"],[9,"stroke-linecap","round"],[9,"stroke-linejoin","round"],[9,"stroke-miterlimit","10"],[9,"x1","233.1"],[9,"y1","194.1"],[9,"x2","252.9"],[9,"y2","227"],[7],[8],[0,"\\n "],[6,"line"],[9,"fill","none"],[9,"stroke","#000000"],[9,"stroke-width","7"],[9,"stroke-linecap","round"],[9,"stroke-linejoin","round"],[9,"stroke-miterlimit","10"],[9,"x1","200.6"],[9,"y1","203"],[9,"x2","226"],[9,"y2","241.6"],[7],[8],[0,"\\n "],[8],[0,"\\n\\n "],[1,[25,"paper-progress-linear",null,[["warn","value"],[true,[20,["bridgeUserNamePingIntervalProgress"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[20,["isAuthenticating"]]],null,{"statements":[[0," "],[6,"p"],[7],[0,"\\n Your bridge IP is "],[6,"b"],[7],[1,[18,"bridgeIp"],false],[8],[0,"\\n "],[6,"br"],[7],[8],[0," Press the button on your bridge to authenticate Huegasm.\\n "],[8],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[20,["bridgeConnectError"]]],null,{"statements":[[0," "],[1,[18,"bridgeConnectMessage"],false],[0,"\\n"]],"parameters":[]},{"statements":[[0," "],[6,"p"],[7],[0,"You failed to press the button in time. "],[6,"a"],[9,"class","no-text-decoration"],[9,"href","#"],[3,"action",[[19,0,[]],"retry"]],[7],[0,"RETRY"],[8],[8],[0,"\\n"]],"parameters":[]}]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"unless",[[20,["bridgeFindStatus"]]],null,{"statements":[[0," "],[1,[25,"paper-progress-circular",null,[["diameter"],[100]]],false],[0,"\\n "],[6,"p"],[7],[0,"Trying to find your bridge\'s IP."],[8],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[20,["bridgeFindMultiple"]]],null,{"statements":[[0," "],[6,"p"],[7],[0,"Multiple Hue bridges were found on your network. "],[6,"br"],[7],[8],[0," Please select the one you want to use with Huegasm."],[8],[0,"\\n\\n "],[6,"div"],[9,"id","bridge-button-group"],[7],[0,"\\n"],[4,"each",[[20,["multipleBridgeIps"]]],null,{"statements":[[0," "],[1,[25,"paper-radio",null,[["value","label","onChange"],[[19,1,[]],[19,1,[]],[25,"action",[[19,0,[]],"chooseBridge"],null]]]],false],[0,"\\n"]],"parameters":[1]},null],[0," "],[8],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[20,["bridgeFindFail"]]],null,{"statements":[[0," "],[6,"p"],[7],[0,"A hue bridge could not be automatically found on your network. "],[6,"br"],[7],[8],[0," Enter one manually? "],[6,"br"],[7],[8],[0,"(or type "],[6,"b"],[7],[0,"offline"],[8],[0," to look around)\\n "],[8],[0,"\\n\\n "],[6,"span"],[9,"id","bridge-input"],[7],[0,"\\n "],[1,[25,"paper-input",null,[["label","value","onChange"],["Hue bridge IP address",[20,["manualBridgeIp"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["manualBridgeIp"]]],null]],null]]]],false],[0,"\\n\\n "],[6,"div"],[7],[0,"\\n "],[1,[25,"paper-button",null,[["onClick","raised","primary","label"],[[25,"action",[[19,0,[]],"findBridgeByIp"],null],true,true,"Find"]]],false],[0,"\\n "],[8],[0,"\\n "],[8],[0,"\\n\\n"],[4,"if",[[20,["manualBridgeIpNotFound"]]],null,{"statements":[[0," "],[6,"p"],[9,"class","bg-danger"],[7],[0,"\\n Could not find a bridge with that IP address.\\n "],[8],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]}]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/bridge-finder/template.hbs"}})}),define("huegasm/pods/components/hue-controls/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) +var t=Ember.A,n=Ember.Component,o=Ember.computed,s=Ember.isEmpty,i=Ember.isNone,a=Ember.run,r=a.later,l=a.scheduleOnce,c=Ember.inject,p=Ember.$ +e.default=n.extend({classNames:["container-fluid"],elementId:"hue-controls",lightsData:null,firstVisitApp:!0,activeLights:t(),tabList:["Lights","Music"],selectedTab:1,pauseLightUpdates:!1,displayNextFailure:!0,notify:c.service(),dimmerOnClass:o("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn md-menu-origin":"md-menu-origin"}),ready:o("lightsData","trial",function(){return this.get("trial")||!i(this.get("lightsData"))}),apiURL:o("bridgeIp","bridgeUsername",function(){return"http://"+this.get("bridgeIp")+"/api/"+this.get("bridgeUsername")}),tabData:o("tabList","selectedTab",function(){var e=[],t=this.get("selectedTab") return this.get("tabList").forEach(function(n,o){var s=!1 -o===t&&(s=!0),e.push({name:n,selected:s})}),e}),didInsertElement:function(){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){new MutationObserver(function(e){!e.every(function(e){return s(e.addedNodes)||a(e.addedNodes[0].classList)||e.addedNodes[0].classList.contains("tooltip")})&&l("afterRender",function(){p(".bootstrap-tooltip").tooltip()})}).observe(p("#hue-controls")[0],{childList:!0,subtree:!0})}},init:function(){this._super.apply(this,arguments) +o===t&&(s=!0),e.push({name:n,selected:s})}),e}),didInsertElement:function(){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){new MutationObserver(function(e){!e.every(function(e){return s(e.addedNodes)||i(e.addedNodes[0].classList)||e.addedNodes[0].classList.contains("tooltip")})&&l("afterRender",function(){p(".bootstrap-tooltip").tooltip()})}).observe(p("#hue-controls")[0],{childList:!0,subtree:!0})}},init:function(){this._super.apply(this,arguments) var e=this.get("storage"),t=e.get("huegasm.firstVisitApp1") -this.set("canTryChrome",/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)),s(t)||this.set("firstVisitApp",!1),this.get("trial")||(this.updateLightData(),setInterval(this.updateLightData.bind(this),3e3)),a(e.get("huegasm.selectedTab"))||this.set("selectedTab",this.get("storage").get("huegasm.selectedTab"))},updateLightData:function(){var e=this,t=function(){a(e.get("lightsData"))?e.send("clearBridge"):e.get("displayNextFailure")&&(e.get("notify").warning({html:''}),e.set("displayNextFailure",!1),r(e,function(){e.set("displayNextFailure",!0)},3e4))} -this.get("pauseLightUpdates")||p.get(this.get("apiURL")+"/lights",function(n,o){a(n[0])||a(n[0].error)?"success"===o&&JSON.stringify(e.get("lightsData"))!==JSON.stringify(n)&&e.set("lightsData",n):t()}).fail(t)},actions:{tryAndroid:function(){window.open("https://play.google.com/store/apps/details?id=com.hoboman313.huegasm","_blank")},tryExtension:function(){chrome.webstore.install("https://chrome.google.com/webstore/detail/mbjanbdhcpohhfecjgbdpcfhnnbofooj")},changeTab:function(e){var t=this.get("tabList").indexOf(e) +this.set("canTryChrome",/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)),s(t)||this.set("firstVisitApp",!1),this.get("trial")||(this.updateLightData(),setInterval(this.updateLightData.bind(this),3e3)),i(e.get("huegasm.selectedTab"))||this.set("selectedTab",this.get("storage").get("huegasm.selectedTab"))},updateLightData:function(){var e=this,t=function(){i(e.get("lightsData"))?e.send("clearBridge"):e.get("displayNextFailure")&&(e.get("notify").warning({html:''}),e.set("displayNextFailure",!1),r(e,function(){e.set("displayNextFailure",!0)},3e4))} +this.get("pauseLightUpdates")||p.get(this.get("apiURL")+"/lights",function(n,o){i(n[0])||i(n[0].error)?"success"===o&&JSON.stringify(e.get("lightsData"))!==JSON.stringify(n)&&e.set("lightsData",n):t()}).fail(t)},actions:{tryAndroid:function(){window.open("https://play.google.com/store/apps/details?id=com.hoboman313.huegasm","_blank")},tryExtension:function(){chrome.webstore.install("https://chrome.google.com/webstore/detail/mbjanbdhcpohhfecjgbdpcfhnnbofooj")},changeTab:function(e){var t=this.get("tabList").indexOf(e) this.set("selectedTab",t),this.get("storage").set("huegasm.selectedTab",t)},clearBridge:function(){var e=this.get("storage") e.remove("huegasm.bridgeUsername"),e.remove("huegasm.bridgeIp"),location.reload()},toggleDimmer:function(){this.sendAction("toggleDimmer")},toggleLightsIcons:function(){this.sendAction("toggleLightsIcons")},clearAllSettings:function(){this.get("storage").clear(),location.reload()},email:function(){window.open("mailto:huegasm.app@gmail.com","_blank")},startIntro:function(){var e=this,t=introJs(),n=p("#player-bottom") this.get("dimmerOn")&&this.send("toggleDimmer"),t.setOptions({steps:[{intro:"Welcome! This short tutorial will introduce you to Huegasm."},{element:"#music-tab",intro:"This is the music player. You'll use this to play music and synchronize it with your active lights.

TIP: Control which lights are active through the Lights tab."},{element:"#playlist",intro:"You can add and select music to play from your playlist here. You may listen to local audio files, online audio streams or stream music from SoundCloud.

TIP: Songs added through Soundcloud will be saved for when you visit this page again."},{element:p("#playlist md-menu")[0],intro:'You can add songs from SoundCloud by copy and pasting the URL shown here'},{element:"#player-area",intro:"The audio playback may be controlled with the controls here. Basic music visualization effects may be shown here by selecting them from the menu (eyeball icon in the bottom right)."},{element:"#beat-option-row",intro:"Sensitivity - The sensitivity of the beat detector (higher sensitivity results in more registered beats)
Color Range - The color range that the lights may change to on beat.
Brightness Range - The minimum (off-beat) and maximum (on-beat) brightness of the lights.
Flashing Transitions - Quickly flash the lights on beat
Colorloop - Slowly cycle the lights through all the colors while the music is playing
Ambience - When turned on, your lights will sporadically change color.
Blackout - When turned on, your lghts will turn off after flashing on a detected beat.

TIP: Your sensitivity settings are saved per song as indicated by the red star icon in the top left corner.",position:"top"},{element:"#beat-container",intro:"An interactive speaker that will bump when a beat is registered.

TIP: Click on the center of the speaker to simulate a beat.",position:"top"},{element:"#lights-tab",intro:"This is the lights tab. Here you'll be able to change various light properties:
Power - Turn the selected lights on/off
Brightness - The brightness level of the selected lights
Color - The color of the selected lights
Strobe - Selected lights will flash in sequential order
Colorloop - Selected lights will slowly cycle through all the colors
Randomize Hues - Randomize the hues (colors) of your selected lights
"},{element:"#active-lights",intro:"These icons represent the hue lights in your system. Active lights will be controlled by the application while the inactive lights will have a red X over them and will not be controlled.
You may toggle a light's state by clicking on it."},{element:p("#navigation .ember-basic-dropdown-trigger")[0],intro:"A few miscellaneous settings can be found here.

WARNING: clearing application settings will restore the application to its original state. This will even delete your playlist and any saved song beat preferences."},{intro:"And that's it...Hope you enjoy the application. ;)"}]}),t.onexit(function(){p("body").velocity("scroll",{duration:200})}),t.onchange(function(e){""===e.id||"music-tab"===e.id||"playlist"===e.id||"player-area"===e.id||"beat-option-row"===e.id||"beat-option-button-group"===e.id||"beat-container"===e.id||"using-mic-audio-tooltip"===e.id||"MD-MENU"===e.nodeName?p(".navigation-item").eq(1).click():p(".navigation-item").eq(0).click(),"music-tab"===e.id||"playlist"===e.id||"player-area"===e.id?n.hide():"beat-option-row"===e.id||"beat-option-button-group"===e.id||"beat-container"===e.id?n.show():"dimmer"===e.id&&p(document).click()}),t.onafterchange(function(t){"\x3c!----\x3e"===p(t).html()&&p(".introjs-nextbutton").click(),""===t.id?r(e,function(){p("body").velocity("scroll")},500):r(e,function(){p(".introjs-tooltip").velocity("scroll",{offset:-100})},500)}).start()},closeNotificationModal:function(){this.set("firstVisitApp",!1),this.get("storage").set("huegasm.firstVisitApp1",!1)}}})}),define("huegasm/pods/components/hue-controls/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"DqQ4EK6t",block:'{"symbols":["menu","content","tab"],"statements":[[4,"if",[[20,["ready"]]],null,{"statements":[[0," "],[6,"div"],[9,"id","navigation"],[9,"class","row"],[7],[0,"\\n "],[6,"div"],[9,"class","col-sm-10 col-sm-offset-1 col-xs-12"],[7],[0,"\\n"],[4,"each",[[20,["tabData"]]],null,{"statements":[[0," "],[6,"span"],[10,"class",[26,["navigation-item pointer text-uppercase ",[25,"if",[[19,3,["selected"]],"active"],null]]]],[3,"action",[[19,0,[]],"changeTab",[19,3,["name"]]]],[7],[1,[19,3,["name"]],false],[8],[0,"\\n"]],"parameters":[3]},null],[0,"\\n"],[4,"paper-menu",null,null,{"statements":[[4,"component",[[19,1,["trigger"]]],null,{"statements":[[4,"paper-button",null,[["iconButton"],[true]],{"statements":[[0," "],[1,[25,"paper-icon",["settings-icon"],[["class","size"],[[25,"concat",[[20,["dimmerOnClass"]]," no-blue-shadow"],null],28]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0," \\n"],[4,"component",[[19,1,["content"]]],[["width"],[3]],{"statements":[[4,"if",[[20,["canTryChrome"]]],null,{"statements":[[4,"component",[[19,2,["menu-item"]]],[["class","onClick"],["hidden-xs","tryExtension"]],{"statements":[[0," "],[1,[25,"paper-icon",["extension"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," Try the Chrome Extension\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"],[4,"component",[[19,2,["menu-item"]]],[["class","onClick"],["visible-xs","tryAndroid"]],{"statements":[[0," "],[1,[25,"paper-icon",["extension"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," Try the Android Extension\\n"]],"parameters":[]},null],[0,"\\n"],[4,"component",[[19,2,["menu-item"]]],[["onClick"],["toggleDimmer"]],{"statements":[[0," "],[1,[25,"paper-icon",["highlight"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," Dark Mode: "],[6,"strong"],[7],[1,[25,"if",[[20,["dimmerOn"]],"On","Off"],null],false],[8],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"component",[[19,2,["menu-item"]]],[["onClick"],["toggleLightsIcons"]],{"statements":[[0," "],[1,[25,"paper-icon",["lightbulb outline"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," Active Lights: "],[6,"strong"],[7],[1,[25,"if",[[20,["lightsIconsOn"]],"Icons","Text"],null],false],[8],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[0,"\\n"],[4,"component",[[19,2,["menu-item"]]],[["onClick"],["startIntro"]],{"statements":[[0," "],[1,[25,"paper-icon",["cached"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," Restart Tutorial\\n"]],"parameters":[]},null],[0,"\\n"],[4,"component",[[19,2,["menu-item"]]],[["onClick"],["clearAllSettings"]],{"statements":[[0," "],[1,[25,"paper-icon",["settings backup restore"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," Reset Settings\\n"]],"parameters":[]},null],[0,"\\n"],[4,"component",[[19,2,["menu-item"]]],[["onClick"],["email"]],{"statements":[[0," "],[1,[25,"paper-icon",["email"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," Contact\\n"]],"parameters":[]},null]],"parameters":[2]},null]],"parameters":[1]},null],[0," "],[8],[0,"\\n "],[8],[0,"\\n\\n "],[1,[25,"light-group",null,[["lightsData","activeLights","syncLight","apiURL","dimmerOn","lightsIconsOn","storage","pauseLightUpdates"],[[20,["lightsData"]],[20,["activeLights"]],[20,["syncLight"]],[20,["apiURL"]],[20,["dimmerOn"]],[20,["lightsIconsOn"]],[20,["storage"]],[20,["pauseLightUpdates"]]]]],false],[0,"\\n\\n "],[6,"div"],[9,"id","huegasm-content"],[9,"class","row"],[7],[0,"\\n "],[1,[25,"lights-tab",null,[["active","apiURL","lightsData","activeLights","syncLight","trial","colorLoopOn","dimmerOn","playing","pauseLightUpdates"],[[25,"eq",[[20,["selectedTab"]],0],null],[20,["apiURL"]],[20,["lightsData"]],[20,["activeLights"]],[20,["syncLight"]],[20,["trial"]],[20,["colorLoopOn"]],[20,["dimmerOn"]],[20,["playing"]],[20,["pauseLightUpdates"]]]]],false],[0,"\\n\\n "],[1,[25,"music-tab",null,[["active","apiURL","lightsData","activeLights","pauseLightUpdates","dimmerOn","storage","colorLoopOn","playing","action"],[[25,"eq",[[20,["selectedTab"]],1],null],[20,["apiURL"]],[20,["lightsData"]],[20,["activeLights"]],[20,["pauseLightUpdates"]],[20,["dimmerOn"]],[20,["storage"]],[20,["colorLoopOn"]],[20,["playing"]],"startIntro"]]],false],[0,"\\n "],[8],[0,"\\n\\n"],[4,"if",[[20,["firstVisitApp"]]],null,{"statements":[[4,"paper-dialog",null,[["fullscreen","onClose","origin","clickOutsideToClose"],[[20,["fullscreen"]],[25,"action",[[19,0,[]],"closeNotificationModal"],null],[20,["dialogOrigin"]],true]],{"statements":[[4,"paper-dialog-content",null,null,{"statements":[[0," "],[6,"p"],[9,"class","promo-title"],[7],[0,"\\n Check out the "],[6,"a"],[9,"href","https://chrome.google.com/webstore/detail/huegasm-for-philips-hue-l/mbjanbdhcpohhfecjgbdpcfhnnbofooj"],[9,"target","_blank"],[7],[0,"Huegasm Chrome extension"],[8],[0,"\\n "],[8],[0,"\\n "],[6,"p"],[9,"class","promo-text"],[7],[0,"\\n "],[6,"a"],[9,"href","https://chrome.google.com/webstore/detail/huegasm-for-philips-hue-l/mbjanbdhcpohhfecjgbdpcfhnnbofooj"],[9,"target","_blank"],[7],[0,"\\n Huegasm Chrome"],[8],[0," allows for listening for music from either a Chrome tab, microphone or your entire system.\\n "],[6,"br"],[7],[8],[0,"In addition, you will be able to sync the color of your screen to your lights.\\n\\n "],[6,"a"],[9,"href","https://chrome.google.com/webstore/detail/huegasm-for-philips-hue-l/mbjanbdhcpohhfecjgbdpcfhnnbofooj"],[9,"target","_blank"],[7],[0,"\\n "],[6,"img"],[9,"class","promo-img hidden-xs"],[9,"src","assets/images/promo-c0e47948d528375db1ee3a1f6c91dd8d.png"],[7],[8],[0,"\\n "],[8],[0,"\\n "],[8],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-dialog-actions",null,[["class"],["layout-row"]],{"statements":[[0," "],[6,"span"],[9,"class","flex"],[7],[8],[0,"\\n "],[4,"paper-button",null,[["primary","onClick"],[true,[25,"action",[[19,0,[]],"closeNotificationModal"],null]]],{"statements":[[0,"OK"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]},{"statements":[[0," "],[1,[25,"paper-progress-circular",null,[["diameter"],[100]]],false],[0,"\\n"]],"parameters":[]}],[0,"\\n"],[1,[25,"ember-notify",null,[["messageStyle","closeAfter"],["bootstrap",5000]]],false]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/hue-controls/template.hbs"}})}),define("huegasm/pods/components/huegasm-app/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) @@ -65,80 +65,80 @@ var e=this.get("storage") n(e.get("huegasm.bridgeIp"))||n(e.get("huegasm.bridgeUsername"))||this.setProperties({bridgeIp:e.get("huegasm.bridgeIp"),bridgeUsername:e.get("huegasm.bridgeUsername")})},actions:{toggleDimmer:function(){this.sendAction("toggleDimmer")},toggleLightsIcons:function(){this.sendAction("toggleLightsIcons")},isReady:function(){this.set("ready",!0),o("html, body").velocity("scroll")}}})}),define("huegasm/pods/components/huegasm-app/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"5G7XKC/9",block:'{"symbols":[],"statements":[[4,"if",[[20,["bridgeUsername"]]],null,{"statements":[[0," "],[1,[25,"hue-controls",null,[["bridgeIp","bridgeUsername","trial","dimmerOn","lightsIconsOn","storage","toggleDimmer","toggleLightsIcons"],[[20,["bridgeIp"]],[20,["bridgeUsername"]],[20,["trial"]],[20,["dimmerOn"]],[20,["lightsIconsOn"]],[20,["storage"]],"toggleDimmer","toggleLightsIcons"]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[20,["ready"]]],null,{"statements":[[0," "],[1,[25,"bridge-finder",null,[["bridgeIp","bridgeUsername","trial","storage"],[[20,["bridgeIp"]],[20,["bridgeUsername"]],[20,["trial"]],[20,["storage"]]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[0," "],[6,"div"],[9,"class","ready-block"],[7],[0,"\\n "],[6,"div"],[9,"id","intro-background"],[7],[0,"\\n "],[6,"div"],[9,"id","intro-wrapper"],[7],[0,"\\n "],[6,"p"],[9,"id","intro"],[7],[0,"\\n Your lights meet your music\\n "],[8],[0,"\\n "],[6,"p"],[9,"id","intro-paragraph"],[7],[0,"\\n Huegasm is a free web application for managing and synchronizing your "],[6,"a"],[9,"target","_blank"],[9,"href","http://www2.meethue.com"],[7],[0,"Philips Hue lights"],[8],[0," with the beat of your music.\\n "],[8],[0,"\\n "],[8],[0,"\\n "],[8],[0,"\\n\\n "],[6,"p"],[7],[0,"Click "],[6,"a"],[9,"href","#"],[3,"action",[[19,0,[]],"isReady"]],[7],[0,"START"],[8],[0," to get started using Huegasm."],[8],[0,"\\n\\n "],[6,"div"],[9,"class","relative"],[7],[0,"\\n "],[1,[25,"paper-button",null,[["raised","primary","warn","onClick","class","label"],[true,true,true,[25,"action",[[19,0,[]],"isReady"],null],"go-button center-block","START"]]],false],[0,"\\n "],[6,"a"],[9,"href","https://www.youtube.com/watch?v=zi9J6Qg-MPw"],[9,"class","video-icon"],[9,"target","_blank"],[7],[0,"\\n "],[1,[25,"paper-icon",["ondemand video"],[["size"],[28]]],false],[0,"\\n "],[8],[0,"\\n "],[8],[0,"\\n "],[8],[0,"\\n"]],"parameters":[]}]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/huegasm-app/template.hbs"}})}),define("huegasm/pods/components/huegasm-footer/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) var t=Ember.Component,n=Ember.computed e.default=t.extend({tagName:"footer",elementId:"footer",year:n(function(){return(new Date).getFullYear()})})}),define("huegasm/pods/components/huegasm-footer/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"+QhMLCJl",block:'{"symbols":[],"statements":[[6,"a"],[9,"href","https://chrome.google.com/webstore/detail/huegasm-for-philips-hue-l/mbjanbdhcpohhfecjgbdpcfhnnbofooj"],[9,"target","_blank"],[9,"rel","noopener noreferrer"],[9,"class","hidden-xs"],[7],[0,"\\n "],[6,"img"],[9,"src","assets/images/chrome-store-badge-1b0249927e76051b36b062700a7422e5.png"],[9,"alt","Available in the Chrome Web Store"],[7],[8],[0,"\\n"],[8],[0,"\\n\\n"],[6,"div"],[9,"id","footer-text"],[7],[0,"\\n © "],[1,[18,"year"],false],[0,"\\n\\n "],[6,"a"],[9,"href","http://www.nidratech.com/"],[9,"target","_blank"],[9,"rel","noopener noreferrer"],[7],[0,"\\n Nidratech Ltd\\n "],[8],[0,"\\n"],[8],[0,"\\n\\n"],[6,"a"],[9,"href","https://play.google.com/store/apps/details?id=com.hoboman313.huegasm"],[9,"target","_blank"],[9,"rel","noopener noreferrer"],[7],[0,"\\n "],[6,"img"],[9,"src","assets/images/google-play-badge-4be08e3cf4d01124257db037380272ea.png"],[9,"alt","Get it on the Google Play Store"],[7],[8],[0,"\\n"],[8]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/huegasm-footer/template.hbs"}})}),define("huegasm/pods/components/light-group/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) -var t=Ember.A,n=Ember.Component,o=Ember.computed,s=Ember.isEmpty,a=Ember.isNone,i=Ember.observer,r=Ember.$ -e.default=n.extend({elementId:"active-lights",classNames:["light-group"],isHovering:!1,activeLights:t(),lightsList:o("lightsData","activeLights.[]","dimmerOn",function(){var e=this.get("lightsData"),n=this.get("activeLights"),o=this.get("dimmerOn"),s=t(),a=void 0,i=void 0 -for(var r in e)if(i="light-active",e.hasOwnProperty(r)&&e[r].state.reachable){switch(e[r].modelid){case"BSB001":a="bridge_v1" +var t=Ember.A,n=Ember.Component,o=Ember.computed,s=Ember.isEmpty,i=Ember.isNone,a=Ember.observer,r=Ember.$ +e.default=n.extend({elementId:"active-lights",classNames:["light-group"],isHovering:!1,activeLights:t(),lightsList:o("lightsData","activeLights.[]","dimmerOn",function(){var e=this.get("lightsData"),n=this.get("activeLights"),o=this.get("dimmerOn"),s=t(),i=void 0,a=void 0 +for(var r in e)if(a="light-active",e.hasOwnProperty(r)&&e[r].state.reachable){switch(e[r].modelid){case"BSB001":i="bridge_v1" break -case"BSB002":a="bridge_v2" +case"BSB002":i="bridge_v2" break -case"LCT001":case"LCT007":case"LCT010":case"LCT014":case"LTW010":case"LTW001":case"LTW004":case"LTW015":case"LWB004":case"LWB006":a="white_and_color_e27" +case"LCT001":case"LCT007":case"LCT010":case"LCT014":case"LTW010":case"LTW001":case"LTW004":case"LTW015":case"LWB004":case"LWB006":i="white_and_color_e27" break -case"LWB010":case"LWB014":a="white_e27" +case"LWB010":case"LWB014":i="white_e27" break -case"LCT002":a="br30" +case"LCT002":i="br30" break -case"LCT011":case"LTW011":a="br30_slim" +case"LCT011":case"LTW011":i="br30_slim" break -case"LCT003":a="gu10" +case"LCT003":i="gu10" break -case"LTW013":a="gu10_perfectfit" +case"LTW013":i="gu10_perfectfit" break -case"LST002":case"LST001":a="lightstrip" +case"LST002":case"LST001":i="lightstrip" break -case"LLC006":case"LLC010":a="iris" +case"LLC006":case"LLC010":i="iris" break -case"LLC005":case"LLC011":case"LLC012":case"LLC007":a="bloom" +case"LLC005":case"LLC011":case"LLC012":case"LLC007":i="bloom" break -case"LLC014":a="aura" +case"LLC014":i="aura" break -case"LLC013":a="storylight" +case"LLC013":i="storylight" break -case"LLC020":a="go" +case"LLC020":i="go" break -case"HBL001":case"HBL002":case"HBL003":a="beyond_ceiling_pendant_table" +case"HBL001":case"HBL002":case"HBL003":i="beyond_ceiling_pendant_table" break -case"HIL001":case"HIL002":a="impulse" +case"HIL001":case"HIL002":i="impulse" break -case"HEL001":case"HEL002":a="entity" +case"HEL001":case"HEL002":i="entity" break -case"HML001":case"HML002":case"HML003":case"HML004":case"HML005":a="phoenix_ceiling" +case"HML001":case"HML002":case"HML003":case"HML004":case"HML005":i="phoenix_ceiling" break -case"HML006":a="phoenix_down" +case"HML006":i="phoenix_down" break -case"LTP003":a="pendant_square" +case"LTP003":i="pendant_square" break -case"LTP002":a="pendant_round" +case"LTP002":i="pendant_round" break -case"LTP001":a="pendant_oval" +case"LTP001":i="pendant_oval" break -case"LDF002":case"LTF002":case"LTF001":case"LTC001":case"LTC002":case"LDF001":a="ceiling_square" +case"LDF002":case"LTF002":case"LTF001":case"LTC001":case"LTC002":case"LDF001":i="ceiling_square" break -case"LTC003":case"LTD001":a="ceiling_round" +case"LTC003":case"LTD001":i="ceiling_round" break -case"LDD002":a="floor" +case"LDD002":i="floor" break -case"LDD001":a="table" +case"LDD001":i="table" break -case"LDT001":case"MWM001":a="recessed" +case"LDT001":case"MWM001":i="recessed" break -case"SWT001":a="tap" +case"SWT001":i="tap" break -case"RWL021":a="hds" +case"RWL021":i="hds" break -case"SML001":a="motion_sensor" +case"SML001":i="motion_sensor" break -default:a="white_e27"}a=o?"assets/images/lights/filled/"+a+".svg":"assets/images/lights/outline/"+a+".svg",n.includes(r)||(i="light-inactive"),s.push({src:a,name:e[r].name,id:r,data:e[r],activeClass:i})}return s}),onActiveLightsChange:i("activeLights.[]",function(){this.get("storage").set("huegasm.activeLights",this.get("activeLights"))}),init:function(){this._super.apply(this,arguments) +default:i="white_e27"}i=o?"assets/images/lights/filled/"+i+".svg":"assets/images/lights/outline/"+i+".svg",n.includes(r)||(a="light-inactive"),s.push({src:i,name:e[r].name,id:r,data:e[r],activeClass:a})}return s}),onActiveLightsChange:a("activeLights.[]",function(){this.get("storage").set("huegasm.activeLights",this.get("activeLights"))}),init:function(){this._super.apply(this,arguments) var e=this.get("lightsData"),t=this.get("activeLights"),n=this.get("storage").get("huegasm.activeLights") -if(a(n))for(var o in e)e.hasOwnProperty(o)&&e[o].state.reachable&&t.pushObject(o) -else n.forEach(function(n){!a(e)&&e.hasOwnProperty(n)&&e[n].state.reachable&&t.pushObject(n)})},actions:{clickLight:function(e){var t=this.get("activeLights");-1!==t.indexOf(e)?t.removeObject(e):(t.pushObject(e),this.set("syncLight",e))},lightStartHover:function(e){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){var t=this.get("activeLights"),n=this.get("lightsList").filter(function(n){return"unreachable"!==n.activeClass&&n.id===e[0]&&-1!==t.indexOf(e)}) +if(i(n))for(var o in e)e.hasOwnProperty(o)&&e[o].state.reachable&&t.pushObject(o) +else n.forEach(function(n){!i(e)&&e.hasOwnProperty(n)&&e[n].state.reachable&&t.pushObject(n)})},actions:{clickLight:function(e){var t=this.get("activeLights");-1!==t.indexOf(e)?t.removeObject(e):(t.pushObject(e),this.set("syncLight",e))},lightStartHover:function(e){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){var t=this.get("activeLights"),n=this.get("lightsList").filter(function(n){return"unreachable"!==n.activeClass&&n.id===e[0]&&-1!==t.indexOf(e)}) s(n)||!0===this.get("noHover")||r.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({alert:"lselect"}),contentType:"application/json",type:"PUT"}),this.setProperties({pauseLightUpdates:!0,isHovering:!0})}},lightStopHover:function(e){if(!window.matchMedia||window.matchMedia("(min-width: 768px)").matches){var t=this.get("lightsList").filter(function(t){return"unreachable"!==t.activeClass&&t.id===e[0]}) s(t)||!0===this.get("noHover")||r.ajax(this.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({alert:"none"}),contentType:"application/json",type:"PUT"}),this.setProperties({pauseLightUpdates:!1,isHovering:!1})}}}})}) define("huegasm/pods/components/light-group/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"jKTCPR4u",block:'{"symbols":["light"],"statements":[[4,"each",[[20,["lightsList"]]],null,{"statements":[[4,"if",[[20,["lightsIconsOn"]]],null,{"statements":[[0," "],[6,"div"],[10,"class",[26,[[19,1,["activeClass"]]," bootstrap-tooltip toggleable-light"]]],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[10,"data-title",[19,1,["name"]],null],[3,"action",[[19,0,[]],"clickLight",[19,1,["id"]]]],[3,"action",[[19,0,[]],"lightStartHover",[19,1,["id"]]],[["on"],["mouseEnter"]]],[3,"action",[[19,0,[]],"lightStopHover",[19,1,["id"]]],[["on"],["mouseLeave"]]],[7],[0,"\\n "],[1,[25,"inline-svg",[[19,1,["src"]]],[["class"],["hue-light"]]],false],[0,"\\n "],[8],[0,"\\n"]],"parameters":[]},{"statements":[[0," "],[6,"div"],[10,"class",[26,[[19,1,["activeClass"]]," light-text toggleable-light"]]],[3,"action",[[19,0,[]],"clickLight",[19,1,["id"]]]],[3,"action",[[19,0,[]],"lightStartHover",[19,1,["id"]]],[["on"],["mouseEnter"]]],[3,"action",[[19,0,[]],"lightStopHover",[19,1,["id"]]],[["on"],["mouseLeave"]]],[7],[0,"\\n "],[6,"div"],[9,"class","light-text-content"],[7],[1,[19,1,["name"]],false],[8],[0,"\\n "],[8],[0,"\\n"]],"parameters":[]}]],"parameters":[1]},null]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/light-group/template.hbs"}})}),define("huegasm/pods/components/lights-tab/color-picker/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) var t=Ember.Component,n=Ember.$,o=Ember.run.next -e.default=t.extend({elementId:"color-picker",rgb:null,canvas:null,canvasContext:null,pressingDown:!1,mouseUp:function(){this.set("pressingDown",!1)},mouseMove:function(e){this.get("pressingDown")&&this.mouseDown(e)},mouseDown:function(e){var t=n(this.get("canvas")).offset(),s=Math.floor(e.pageX-t.left),a=Math.floor(e.pageY-t.top),i=this.get("canvasContext").getImageData(s,a,1,1).data -this.set("pressingDown",!0),0===i[0]&&0===i[1]&&0===i[2]||(this.setProperties({rgb:[i[0],i[1],i[2]],showPointer:!0}),o(function(){n("#picker-pointer").css({opacity:1,top:a,left:s,background:"rgb("+i[0]+","+i[1]+","+i[2]+")"})}))},didInsertElement:function(){var e=n("#picker")[0],t=e.getContext("2d"),o=new Image +e.default=t.extend({elementId:"color-picker",rgb:null,canvas:null,canvasContext:null,pressingDown:!1,touchStop:function(){this.set("pressingDown",!1)},touchMove:function(e){this.get("pressingDown")&&this.mouseDown(e)},touchStart:function(){this.set("pressingDown",!0)},mouseUp:function(){this.set("pressingDown",!1)},mouseMove:function(e){this.get("pressingDown")&&this.mouseDown(e)},mouseDown:function(e){var t=n(this.get("canvas")).offset(),s=void 0===e.pageX?e.originalEvent.touches[0].pageX:e.pageX,i=void 0===e.pageY?e.originalEvent.touches[0].pageY:e.pageY,a=Math.floor(s-t.left),r=Math.floor(i-t.top),l=this.get("canvasContext").getImageData(a,r,1,1).data +this.set("pressingDown",!0),0===l[0]&&0===l[1]&&0===l[2]||(this.setProperties({rgb:[l[0],l[1],l[2]],showPointer:!0}),o(function(){n("#picker-pointer").css({opacity:1,top:r,left:a,background:"rgb("+l[0]+","+l[1]+","+l[2]+")"})}))},didInsertElement:function(){var e=n("#picker")[0],t=e.getContext("2d"),o=new Image o.src="assets/images/colormap-2fe3739fe706b50c2d8bda8c50831b49.png",o.onload=function(){t.drawImage(o,0,0,o.width,o.height)},this.setProperties({canvas:e,canvasContext:t})}})}),define("huegasm/pods/components/lights-tab/color-picker/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"6EGy4Dm2",block:'{"symbols":[],"statements":[[6,"canvas"],[9,"id","picker"],[9,"width","256"],[9,"height","256"],[7],[0,"\\n"],[8],[0,"\\n\\n"],[4,"if",[[20,["showPointer"]]],null,{"statements":[[0," "],[6,"div"],[9,"id","picker-pointer"],[7],[8],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/lights-tab/color-picker/template.hbs"}})}),define("huegasm/pods/components/lights-tab/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) -var t=Ember.Component,n=Ember.observer,o=Ember.computed,s=Ember.on,a=Ember.run,i=a.later,r=a.throttle,l=Ember.$,c=Ember.isEmpty +var t=Ember.Component,n=Ember.observer,o=Ember.computed,s=Ember.on,i=Ember.run,a=i.later,r=i.throttle,l=Ember.$,c=Ember.isEmpty e.default=t.extend({classNames:["col-sm-10","col-sm-offset-1","col-xs-12"],classNameBindings:["active::hidden"],elementId:"lights-tab",rgb:[255,255,255],lightsOn:!1,colorLoopOn:!1,lightsOnTxt:o("lightsOn",function(){return this.get("lightsOn")?"On":"Off"}),colorloopOnTxt:o("colorLoopOn",function(){return this.get("colorLoopOn")?"On":"Off"}),lightsBrightness:o("lightsData","activeLights.[]",function(){var e=this.get("lightsData"),t=this.get("activeLights"),n=0 return t.forEach(function(t){n+=e[t].state.bri}),n/t.length}),brightnessControlDisabled:o.not("lightsOn"),onColorLoopOnChange:n("colorLoopOn",function(){var e=this,t=this.get("lightsData"),n=this.get("activeLights"),o=this.get("colorLoopOn"),s=o?"colorloop":"none" o!==n.some(function(e){return"colorloop"===t[e].state.effect})&&n.forEach(function(t){e.get("lightsData")[t].state.effect!==s&&l.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({effect:s}),contentType:"application/json",type:"PUT"})})}),changeLightsColor:function(){var e=this.getProperties("activeLights","apiURL","xy"),t=e.activeLights,n=e.apiURL,o=e.xy @@ -148,51 +148,51 @@ if(!c(e)&&(t.forEach(function(t){var o=e[t] o&&o.state&&o.state.xy&&(null===n&&(n=[0,0]),n[0]+=o.state.xy[0],n[1]+=o.state.xy[1])}),n)){var o=cieToRgb(n[0]/t.length,n[1]/t.length) l(".color").css("background","rgb("+Math.abs(o[0])+","+Math.abs(o[1])+","+Math.abs(o[2])+")")}}),systemLightsOnChange:s("init",n("lightsData.@each.state.on","activeLights.[]",function(){if(!this.get("strobeOn")){var e=this.getProperties("lightsData","activeLights"),t=e.lightsData,n=e.activeLights this.set("lightsOn",n.some(function(e){return!0===t[e].state.on}))}})),onLightsOnChange:n("lightsOn",function(){var e=this.get("activeLights").length -this.set("lightsOnDisabled",!0),r(this,this.changeLightsOnOff,69*e,!1)}),changeLightsOnOff:function(){var e=this,t=this.getProperties("lightsData","activeLights","lightsOn","apiURL"),n=t.lightsData,o=t.activeLights,s=t.lightsOn,a=t.apiURL,r=o.some(function(e){return!0===n[e].state.on}) -i(this,function(){e.set("lightsOnDisabled",!1)},800),s!==r&&o.forEach(function(e){l.ajax(a+"/lights/"+e+"/state",{data:JSON.stringify({on:s}),contentType:"application/json",type:"PUT"})})},changeLightsBrightness:function(){var e=this,t=this.getProperties("lightsData","lightsBrightness","activeLights"),n=t.lightsData,o=t.lightsBrightness,s=t.activeLights,a=!1 -s.forEach(function(e){a+=n[e].state.bri}),a/=s.length,o!==a&&s.forEach(function(t){l.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({bri:o}),contentType:"application/json",type:"PUT"})})},onBrightnessChanged:n("lightsBrightness",function(){var e=this.get("activeLights").length +this.set("lightsOnDisabled",!0),r(this,this.changeLightsOnOff,69*e,!1)}),changeLightsOnOff:function(){var e=this,t=this.getProperties("lightsData","activeLights","lightsOn","apiURL"),n=t.lightsData,o=t.activeLights,s=t.lightsOn,i=t.apiURL,r=o.some(function(e){return!0===n[e].state.on}) +a(this,function(){e.set("lightsOnDisabled",!1)},800),s!==r&&o.forEach(function(e){l.ajax(i+"/lights/"+e+"/state",{data:JSON.stringify({on:s}),contentType:"application/json",type:"PUT"})})},changeLightsBrightness:function(){var e=this,t=this.getProperties("lightsData","lightsBrightness","activeLights"),n=t.lightsData,o=t.lightsBrightness,s=t.activeLights,i=!1 +s.forEach(function(e){i+=n[e].state.bri}),i/=s.length,o!==i&&s.forEach(function(t){l.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({bri:o}),contentType:"application/json",type:"PUT"})})},onBrightnessChanged:n("lightsBrightness",function(){var e=this.get("activeLights").length r(this,this.changeLightsBrightness,69*e,!1)}),onSyncLightsChanged:n("syncLight",function(){var e={on:this.get("lightsOn"),bri:this.get("lightsBrightness"),effect:this.get("colorLoopOn")?"colorloop":"none"},t=this.get("rgb"),n=this.get("syncLight") 255!==t[0]&&255!==t[1]&&255!==t[2]&&(e.xy=this.rgbToXy(t[0],t[1],t[2])),e.transitiontime=0,l.ajax(this.get("apiURL")+"/lights/"+n+"/state",{data:JSON.stringify(e),contentType:"application/json",type:"PUT"})}),didInsertElement:function(){this.onActiveLightsChange()},strobeOn:!1,strobeOnInervalHandle:null,preStrobeOnLightsDataCache:null,nextLightIdx:0,onStrobeOnChange:n("strobeOn",function(){var e=this,t=this.get("lightsData"),n=this.get("strobeOn") if(n){this.set("preStrobeOnLightsDataCache",t) var o={transitiontime:0} for(var s in t)t.hasOwnProperty(s)&&(t[s].state.on&&(o.on=!1),l.ajax(this.get("apiURL")+"/lights/"+s+"/state",{data:JSON.stringify(o),contentType:"application/json",type:"PUT"})) -this.set("strobeOnInervalHandle",setInterval(this.strobeStep.bind(this),500))}else{var a=this.get("preStrobeOnLightsDataCache"),r=function(t){l.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({on:a[t].state.on,sat:a[t].state.sat}),contentType:"application/json",type:"PUT"})} -for(var c in t)t.hasOwnProperty(c)&&i(this,r,c,2e3) -i(this,this.onColorLoopOnChange,2e3),clearInterval(this.get("strobeOnInervalHandle"))}this.set("pauseLightUpdates",n)}),strobeStep:function(){var e=this.get("nextLightIdx")%this.get("activeLights").length,t=this.get("activeLights")[e],n={on:!0,transitiontime:0,alert:"select"} +this.set("strobeOnInervalHandle",setInterval(this.strobeStep.bind(this),500))}else{var i=this.get("preStrobeOnLightsDataCache"),r=function(t){l.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({on:i[t].state.on,sat:i[t].state.sat}),contentType:"application/json",type:"PUT"})} +for(var c in t)t.hasOwnProperty(c)&&a(this,r,c,2e3) +a(this,this.onColorLoopOnChange,2e3),clearInterval(this.get("strobeOnInervalHandle"))}this.set("pauseLightUpdates",n)}),strobeStep:function(){var e=this.get("nextLightIdx")%this.get("activeLights").length,t=this.get("activeLights")[e],n={on:!0,transitiontime:0,alert:"select"} this.get("colorLoopOn")&&(n.hue=Math.floor(65535*Math.random())),l.ajax(this.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify(n),contentType:"application/json",type:"PUT"}),l.ajax(this.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify({on:!1,transitiontime:0}),contentType:"application/json",type:"PUT"}),this.set("nextLightIdx",++e)},strobeOnTxt:o("strobeOn",function(){return this.get("strobeOn")?"On":"Off"}),dimmerOnClass:o("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn":null}),actions:{toggleDimmer:function(){this.sendAction("toggleDimmer")},randomizeHues:function(){var e=this l(".dice").velocity({scale:1.1},100).velocity({scale:1},100),this.get("activeLights").forEach(function(t){var n={hue:Math.floor(65535*Math.random())} -!1===e.get("lightsData")[t].state.on&&(n.on=!0),l.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify(n),contentType:"application/json",type:"PUT"})}),i(function(){e.onActiveLightsChange()},1e3)}}})}),define("huegasm/pods/components/lights-tab/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"r7PTII4M",block:'{"symbols":["menu","content"],"statements":[[4,"paper-list",null,null,{"statements":[[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["power-settings-new"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","Turn the selected lights on/off"],[7],[0,"Power"],[8],[0,"\\n "],[1,[25,"paper-switch",null,[["value","onChange","disabled","skipProxy","label"],[[20,["lightsOn"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["lightsOn"]]],null]],null],[25,"or",[[20,["trial"]],[20,["playing"]],[20,["lightsOnDisabled"]]],null],[20,["trial"]],[20,["lightsOnTxt"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["brightness-4"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","layout flex-60 bootstrap-tooltip lights-control-tooltip"],[9,"data-title","The brightness level of the selected lights"],[7],[0,"Brightness"],[8],[0,"\\n "],[1,[25,"paper-slider",null,[["class","step","min","max","value","onChange","disabled"],["flex",10,1,254,[20,["lightsBrightness"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["lightsBrightness"]]],null]],null],[20,["brightnessControlDisabled"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,[["elementId"],["color-row"]],{"statements":[[0," "],[1,[25,"paper-icon",["color-lens"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","The color of the selected lights"],[7],[0,"Color"],[8],[0,"\\n\\n"],[4,"paper-menu",null,[["offset"],["0 -50"]],{"statements":[[4,"component",[[19,1,["trigger"]]],null,{"statements":[[4,"paper-button",null,[["iconButton"],[false]],{"statements":[[0," "],[1,[25,"paper-button",null,[["raised","class","disabled"],[true,"color",[25,"or",[[20,["trial"]],[20,["playing"]]],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"component",[[19,1,["content"]]],[["class","width"],["color-content",0]],{"statements":[[4,"component",[[19,2,["menu-item"]]],null,{"statements":[[0," "],[1,[25,"lights-tab/color-picker",null,[["lightsData","activeLights","rgb"],[[20,["lightsData"]],[20,["activeLights"]],[20,["rgb"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[2]},null]],"parameters":[1]},null]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["flare"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","Selected lights will flash in sequential order"],[7],[0,"Strobe"],[8],[0,"\\n "],[1,[25,"paper-switch",null,[["value","onChange","disabled","skipProxy","label"],[[20,["strobeOn"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["strobeOn"]]],null]],null],[25,"or",[[20,["trial"]],[20,["playing"]]],null],[20,["trial"]],[20,["strobeOnTxt"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["color-lens"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," "],[1,[25,"paper-icon",["loop"],[["id","class"],["loop-addition",[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","Selected lights will slowly cycle through all the colors"],[7],[0,"Colorloop"],[8],[0,"\\n "],[1,[25,"paper-switch",null,[["value","onChange","disabled","skipProxy","label"],[[20,["colorLoopOn"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["colorLoopOn"]]],null]],null],[25,"or",[[20,["trial"]],[20,["playing"]]],null],[20,["trial"]],[20,["colorloopOnTxt"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["shuffle"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","Randomize the hues (colors) of your selected lights."],[7],[0,"Randomize Hues"],[8],[0,"\\n\\n "],[6,"svg"],[9,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[9,"viewBox","0 0 512 512"],[9,"class","dice"],[3,"action",[[19,0,[]],"randomizeHues"]],[7],[0,"\\n "],[6,"path"],[9,"d","M0 0h512v512H0z"],[9,"fill","none"],[7],[8],[0,"\\n "],[6,"g"],[9,"transform","translate(0,0)"],[9,"style","touch-action: none;"],[7],[0,"\\n "],[6,"path"],[9,"fill","rgba(82, 67, 67, 0.9)"],[9,"d","M255.76 44.764c-6.176 0-12.353 1.384-17.137 4.152L85.87 137.276c-9.57 5.536-9.57 14.29 0 19.826l152.753 88.36c9.57 5.536 24.703 5.536 34.272 0l152.753-88.36c9.57-5.535 9.57-14.29 0-19.825l-152.753-88.36c-4.785-2.77-10.96-4.153-17.135-4.153zm.926 82.855a31.953 18.96 0 0 1 22.127 32.362 31.953 18.96 0 1 1-45.188-26.812 31.953 18.96 0 0 1 23.06-5.55zM75.67 173.84c-5.753-.155-9.664 4.336-9.664 12.28v157.696c0 11.052 7.57 24.163 17.14 29.69l146.93 84.848c9.57 5.526 17.14 1.156 17.14-9.895V290.76c0-11.052-7.57-24.16-17.14-29.688l-146.93-84.847c-2.69-1.555-5.225-2.327-7.476-2.387zm360.773.002c-2.25.06-4.783.83-7.474 2.385l-146.935 84.847c-9.57 5.527-17.14 18.638-17.14 29.69v157.7c0 11.05 7.57 15.418 17.14 9.89L428.97 373.51c9.57-5.527 17.137-18.636 17.137-29.688v-157.7c0-7.942-3.91-12.432-9.664-12.278zM89.297 195.77a31.236 18.008 58.094 0 1 33.818 41.183 31.236 18.008 58.094 1 1-45-25.98 31.236 18.008 58.094 0 1 11.182-15.203zm221.52 64.664A18.008 31.236 31.906 0 1 322 275.637a18.008 31.236 31.906 0 1-45 25.98 18.008 31.236 31.906 0 1 33.818-41.183zM145.296 289.1a31.236 18.008 58.094 0 1 33.818 41.183 31.236 18.008 58.094 0 1-45-25.98 31.236 18.008 58.094 0 1 11.182-15.203zm277.523 29.38A18.008 31.236 31.906 0 1 434 333.684a18.008 31.236 31.906 0 1-45 25.98 18.008 31.236 31.906 0 1 33.818-41.184zm-221.52 64.663a31.236 18.008 58.094 0 1 33.817 41.183 31.236 18.008 58.094 1 1-45-25.98 31.236 18.008 58.094 0 1 11.182-15.203z"],[7],[8],[0,"\\n "],[8],[0,"\\n "],[8],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/lights-tab/template.hbs"}})}),define("huegasm/pods/components/music-tab/add-soundcloud-sound-modal/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) -var t=Ember.Component,n=Ember.observer,o=Ember.computed,s=Ember.isEmpty,a=Ember.isNone,i=Ember.run.later,r=Ember.$ -e.default=t.extend({url:null,onIsShowingModalChange:n("isShowingModal",function(){this.get("isShowingModal")&&(this.set("url",null),i(function(){r("md-input-container input").focus()},500))}),saveDisabled:o("url",function(){return a(this.get("url"))||s(this.get("url").trim())}),didInsertElement:function(){var e=this +!1===e.get("lightsData")[t].state.on&&(n.on=!0),l.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify(n),contentType:"application/json",type:"PUT"})}),a(function(){e.onActiveLightsChange()},1e3)}}})}),define("huegasm/pods/components/lights-tab/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"r7PTII4M",block:'{"symbols":["menu","content"],"statements":[[4,"paper-list",null,null,{"statements":[[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["power-settings-new"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","Turn the selected lights on/off"],[7],[0,"Power"],[8],[0,"\\n "],[1,[25,"paper-switch",null,[["value","onChange","disabled","skipProxy","label"],[[20,["lightsOn"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["lightsOn"]]],null]],null],[25,"or",[[20,["trial"]],[20,["playing"]],[20,["lightsOnDisabled"]]],null],[20,["trial"]],[20,["lightsOnTxt"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["brightness-4"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","layout flex-60 bootstrap-tooltip lights-control-tooltip"],[9,"data-title","The brightness level of the selected lights"],[7],[0,"Brightness"],[8],[0,"\\n "],[1,[25,"paper-slider",null,[["class","step","min","max","value","onChange","disabled"],["flex",10,1,254,[20,["lightsBrightness"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["lightsBrightness"]]],null]],null],[20,["brightnessControlDisabled"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,[["elementId"],["color-row"]],{"statements":[[0," "],[1,[25,"paper-icon",["color-lens"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","The color of the selected lights"],[7],[0,"Color"],[8],[0,"\\n\\n"],[4,"paper-menu",null,[["offset"],["0 -50"]],{"statements":[[4,"component",[[19,1,["trigger"]]],null,{"statements":[[4,"paper-button",null,[["iconButton"],[false]],{"statements":[[0," "],[1,[25,"paper-button",null,[["raised","class","disabled"],[true,"color",[25,"or",[[20,["trial"]],[20,["playing"]]],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"component",[[19,1,["content"]]],[["class","width"],["color-content",0]],{"statements":[[4,"component",[[19,2,["menu-item"]]],null,{"statements":[[0," "],[1,[25,"lights-tab/color-picker",null,[["lightsData","activeLights","rgb"],[[20,["lightsData"]],[20,["activeLights"]],[20,["rgb"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[2]},null]],"parameters":[1]},null]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["flare"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","Selected lights will flash in sequential order"],[7],[0,"Strobe"],[8],[0,"\\n "],[1,[25,"paper-switch",null,[["value","onChange","disabled","skipProxy","label"],[[20,["strobeOn"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["strobeOn"]]],null]],null],[25,"or",[[20,["trial"]],[20,["playing"]]],null],[20,["trial"]],[20,["strobeOnTxt"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["color-lens"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0," "],[1,[25,"paper-icon",["loop"],[["id","class"],["loop-addition",[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","Selected lights will slowly cycle through all the colors"],[7],[0,"Colorloop"],[8],[0,"\\n "],[1,[25,"paper-switch",null,[["value","onChange","disabled","skipProxy","label"],[[20,["colorLoopOn"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["colorLoopOn"]]],null]],null],[25,"or",[[20,["trial"]],[20,["playing"]]],null],[20,["trial"]],[20,["colorloopOnTxt"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-item",null,null,{"statements":[[0," "],[1,[25,"paper-icon",["shuffle"],[["class"],[[20,["dimmerOnClass"]]]]],false],[0,"\\n "],[6,"p"],[9,"data-toggle","tooltip"],[9,"data-placement","top auto"],[9,"class","bootstrap-tooltip lights-control-tooltip"],[9,"data-title","Randomize the hues (colors) of your selected lights."],[7],[0,"Randomize Hues"],[8],[0,"\\n\\n "],[6,"svg"],[9,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[9,"viewBox","0 0 512 512"],[9,"class","dice"],[3,"action",[[19,0,[]],"randomizeHues"]],[7],[0,"\\n "],[6,"path"],[9,"d","M0 0h512v512H0z"],[9,"fill","none"],[7],[8],[0,"\\n "],[6,"g"],[9,"transform","translate(0,0)"],[9,"style","touch-action: none;"],[7],[0,"\\n "],[6,"path"],[9,"fill","rgba(82, 67, 67, 0.9)"],[9,"d","M255.76 44.764c-6.176 0-12.353 1.384-17.137 4.152L85.87 137.276c-9.57 5.536-9.57 14.29 0 19.826l152.753 88.36c9.57 5.536 24.703 5.536 34.272 0l152.753-88.36c9.57-5.535 9.57-14.29 0-19.825l-152.753-88.36c-4.785-2.77-10.96-4.153-17.135-4.153zm.926 82.855a31.953 18.96 0 0 1 22.127 32.362 31.953 18.96 0 1 1-45.188-26.812 31.953 18.96 0 0 1 23.06-5.55zM75.67 173.84c-5.753-.155-9.664 4.336-9.664 12.28v157.696c0 11.052 7.57 24.163 17.14 29.69l146.93 84.848c9.57 5.526 17.14 1.156 17.14-9.895V290.76c0-11.052-7.57-24.16-17.14-29.688l-146.93-84.847c-2.69-1.555-5.225-2.327-7.476-2.387zm360.773.002c-2.25.06-4.783.83-7.474 2.385l-146.935 84.847c-9.57 5.527-17.14 18.638-17.14 29.69v157.7c0 11.05 7.57 15.418 17.14 9.89L428.97 373.51c9.57-5.527 17.137-18.636 17.137-29.688v-157.7c0-7.942-3.91-12.432-9.664-12.278zM89.297 195.77a31.236 18.008 58.094 0 1 33.818 41.183 31.236 18.008 58.094 1 1-45-25.98 31.236 18.008 58.094 0 1 11.182-15.203zm221.52 64.664A18.008 31.236 31.906 0 1 322 275.637a18.008 31.236 31.906 0 1-45 25.98 18.008 31.236 31.906 0 1 33.818-41.183zM145.296 289.1a31.236 18.008 58.094 0 1 33.818 41.183 31.236 18.008 58.094 0 1-45-25.98 31.236 18.008 58.094 0 1 11.182-15.203zm277.523 29.38A18.008 31.236 31.906 0 1 434 333.684a18.008 31.236 31.906 0 1-45 25.98 18.008 31.236 31.906 0 1 33.818-41.184zm-221.52 64.663a31.236 18.008 58.094 0 1 33.817 41.183 31.236 18.008 58.094 1 1-45-25.98 31.236 18.008 58.094 0 1 11.182-15.203z"],[7],[8],[0,"\\n "],[8],[0,"\\n "],[8],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/lights-tab/template.hbs"}})}),define("huegasm/pods/components/music-tab/add-soundcloud-sound-modal/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) +var t=Ember.Component,n=Ember.observer,o=Ember.computed,s=Ember.isEmpty,i=Ember.isNone,a=Ember.run.later,r=Ember.$ +e.default=t.extend({url:null,onIsShowingModalChange:n("isShowingModal",function(){this.get("isShowingModal")&&(this.set("url",null),a(function(){r("md-input-container input").focus()},500))}),saveDisabled:o("url",function(){return i(this.get("url"))||s(this.get("url").trim())}),didInsertElement:function(){var e=this r(document).keypress(function(t){e.get("saveDisabled")||13!==t.which||e.send("add")})},actions:{close:function(){this.sendAction()},add:function(){this.sendAction("action",this.get("url"))}}})}),define("huegasm/pods/components/music-tab/add-soundcloud-sound-modal/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"Vnfli3w0",block:'{"symbols":[],"statements":[[4,"if",[[20,["isShowingModal"]]],null,{"statements":[[4,"paper-dialog",null,[["fullscreen","onClose","origin","clickOutsideToClose"],[[20,["fullscreen"]],[25,"action",[[19,0,[]],"close"],null],[20,["dialogOrigin"]],true]],{"statements":[[4,"paper-dialog-content",null,null,{"statements":[[0," "],[6,"p"],[7],[0,"Enter a "],[6,"a"],[9,"href","https://soundcloud.com"],[9,"target","_blank"],[9,"rel","noopener noreferrer"],[7],[0,"SoundCloud"],[8],[0," track or playlist/set URL"],[8],[0,"\\n "],[6,"p"],[7],[0,"ex. https://soundcloud.com/mrsuicidesheep/tracks"],[8],[0,"\\n\\n "],[1,[25,"paper-input",null,[["label","class","icon","value","onChange"],["SoundCloud URL","full-width","search",[20,["url"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["url"]]],null]],null]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-dialog-actions",null,[["class"],["layout-row"]],{"statements":[[0," "],[6,"span"],[9,"class","flex"],[7],[8],[0,"\\n "],[1,[25,"paper-button",null,[["onClick","label"],[[25,"action",[[19,0,[]],"close"],null],"Close"]]],false],[0," \\n "],[1,[25,"paper-button",null,[["class","onClick","disabled","primary","label"],["pull-right",[25,"action",[[19,0,[]],"add"],null],[20,["saveDisabled"]],true,"Add Music"]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/music-tab/add-soundcloud-sound-modal/template.hbs"}})}),define("huegasm/pods/components/music-tab/add-url-sound-modal/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) -var t=Ember.Component,n=Ember.observer,o=Ember.computed,s=Ember.isEmpty,a=Ember.isNone,i=Ember.run.later,r=Ember.$ -e.default=t.extend({url:null,onIsShowingModalChange:n("isShowingModal",function(){this.get("isShowingModal")&&(this.set("url",null),i(function(){r("md-input-container input").focus()},500))}),saveDisabled:o("url",function(){return a(this.get("url"))||s(this.get("url").trim())}),didInsertElement:function(){var e=this +var t=Ember.Component,n=Ember.observer,o=Ember.computed,s=Ember.isEmpty,i=Ember.isNone,a=Ember.run.later,r=Ember.$ +e.default=t.extend({url:null,onIsShowingModalChange:n("isShowingModal",function(){this.get("isShowingModal")&&(this.set("url",null),a(function(){r("md-input-container input").focus()},500))}),saveDisabled:o("url",function(){return i(this.get("url"))||s(this.get("url").trim())}),didInsertElement:function(){var e=this r(document).keypress(function(t){e.get("saveDisabled")||13!==t.which||e.send("add")})},actions:{close:function(){this.sendAction()},add:function(){this.sendAction("action",this.get("url"))}}})}),define("huegasm/pods/components/music-tab/add-url-sound-modal/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"h/K92ZAz",block:'{"symbols":[],"statements":[[4,"if",[[20,["isShowingModal"]]],null,{"statements":[[4,"paper-dialog",null,[["fullscreen","onClose","origin","clickOutsideToClose"],[[20,["fullscreen"]],[25,"action",[[19,0,[]],"close"],null],[20,["dialogOrigin"]],true]],{"statements":[[4,"paper-dialog-content",null,null,{"statements":[[0," "],[6,"p"],[7],[0,"Enter a direct audio stream URL."],[8],[0,"\\n "],[6,"p"],[7],[0,"ex. http://uk6.internet-radio.com:8213/;stream"],[8],[0,"\\n\\n "],[1,[25,"paper-input",null,[["label","class","icon","value","onChange"],["URL","full-width","search",[20,["url"]],[25,"action",[[19,0,[]],[25,"mut",[[20,["url"]]],null]],null]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"paper-dialog-actions",null,[["class"],["layout-row"]],{"statements":[[0," "],[6,"span"],[9,"class","flex"],[7],[8],[0,"\\n "],[1,[25,"paper-button",null,[["onClick","label"],[[25,"action",[[19,0,[]],"close"],null],"Close"]]],false],[0," \\n "],[1,[25,"paper-button",null,[["class","onClick","disabled","primary","label"],["pull-right",[25,"action",[[19,0,[]],"add"],null],[20,["saveDisabled"]],true,"Add Music"]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"huegasm/pods/components/music-tab/add-url-sound-modal/template.hbs"}})}),define("huegasm/pods/components/music-tab/component",["exports","huegasm/pods/components/music-tab/mixins/helpers","huegasm/pods/components/music-tab/mixins/visualizer"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}) -var o=Ember.Component,s=Ember.observer,a=Ember.isEmpty,i=Ember.isNone,r=Ember.$,l=Ember.run,c=l.later,p=l.next +var o=Ember.Component,s=Ember.observer,i=Ember.isEmpty,a=Ember.isNone,r=Ember.$,l=Ember.run,c=l.later,p=l.next e.default=o.extend(t.default,n.default,{updatePageTitle:s("playQueuePointer",function(){var e="Huegasm",t=this.get("playQueuePointer"),n=this.get("playQueue") if(-1!==t){var o=n[t] o.title?(e=o.title,o.artist&&(e+=" - "+o.artist)):e=o.fileName,e+="- Huegasm"}document.title=e}),changePlayerControl:function(e,t,n){this.set(e,t),"threshold"===e&&this.get("kick").set({threshold:t}),n&&-1!==this.get("playQueuePointer")&&this.saveSongBeatPreferences(),this.get("storage").set("huegasm."+e,t)},saveSongBeatPreferences:function(){var e=this.get("playQueue")[this.get("playQueuePointer")] -if(e){var t=a(e.artist)?e.fileName:e.artist+"-"+e.title,n=this.get("songBeatPreferences") -n[t]={threshold:this.get("threshold")},this.set("usingBeatPreferences",!0),this.get("storage").set("huegasm.songBeatPreferences",n)}},loadSongBeatPreferences:function(){var e=this.get("playQueue")[this.get("playQueuePointer")],t=a(e.artist)?e.fileName:e.artist+"-"+e.title,n=this.get("songBeatPreferences")[t],o=this.get("oldBeatPrefCache"),s=null -i(n)?i(o)||(this.changePlayerControl("threshold",o.threshold),this.set("usingBeatPreferences",!1)):(s={threshold:this.get("threshold")},this.changePlayerControl("threshold",n.threshold),this.set("usingBeatPreferences",!0)),this.set("oldBeatPrefCache",s)},clearCurrentAudio:function(e){var t=this.get("dancer") +if(e){var t=i(e.artist)?e.fileName:e.artist+"-"+e.title,n=this.get("songBeatPreferences") +n[t]={threshold:this.get("threshold")},this.set("usingBeatPreferences",!0),this.get("storage").set("huegasm.songBeatPreferences",n)}},loadSongBeatPreferences:function(){var e=this.get("playQueue")[this.get("playQueuePointer")],t=i(e.artist)?e.fileName:e.artist+"-"+e.title,n=this.get("songBeatPreferences")[t],o=this.get("oldBeatPrefCache"),s=null +a(n)?a(o)||(this.changePlayerControl("threshold",o.threshold),this.set("usingBeatPreferences",!1)):(s={threshold:this.get("threshold")},this.changePlayerControl("threshold",n.threshold),this.set("usingBeatPreferences",!0)),this.set("oldBeatPrefCache",s)},clearCurrentAudio:function(e){var t=this.get("dancer") t.audio.pause&&t.pause(),e&&this.set("playQueuePointer",-1),this.setProperties({timeElapsed:0,timeTotal:0,playing:!1})},dragOver:function(){var e=this.get("dragLeaveTimeoutHandle") this.set("dragging",!0),e&&clearTimeout(e)},dragLeave:function(){var e=this -this.set("dragLeaveTimeoutHandle",setTimeout(function(){e.set("dragging",!1)},500))},simulateKick:function(){var e=this,t=this.get("activeLights"),n=this.get("lightsData"),o=null,s=this.get("flashingTransitions"),a=function(t,o,a,l){var c={bri:o,transitiontime:0} -s||(c.transitiontime=1),i(l)||(c.hue=l),e.get("blackoutMode")?(c.on=a,delete c[o]):!1===n[t].state.on&&(c.on=!0),r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify(c),contentType:"application/json",type:"PUT"})},l=100 +this.set("dragLeaveTimeoutHandle",setTimeout(function(){e.set("dragging",!1)},500))},simulateKick:function(){var e=this,t=this.get("activeLights"),n=this.get("lightsData"),o=null,s=this.get("flashingTransitions"),i=function(t,o,i,l){var c={bri:o,transitiontime:0} +s||(c.transitiontime=1),a(l)||(c.hue=l),e.get("blackoutMode")?(c.on=i,delete c[o]):!1===n[t].state.on&&(c.on=!0),r.ajax(e.get("apiURL")+"/lights/"+t+"/state",{data:JSON.stringify(c),contentType:"application/json",type:"PUT"})},l=100 if(t.length>0){var p=this.get("lastLightBopIndex"),u=void 0,d=this.get("brightnessRange"),h=void 0 if(u=Math.floor(Math.random()*t.length),t.length>1)for(;u===p;)u=Math.floor(Math.random()*t.length) if(h=t[u],this.set("lastLightBopIndex",u),!this.get("colorLoopOn")){var m=this.get("hueRange") -o=Math.floor(Math.random()*(m[1]-m[0]+1)+m[0])}s&&(l=80),c(this,function(){a(h,d[1],!0),c(e,a,h,d[0],!1,o,l)},this.get("beatDelay"))}this.set("paused",!0),c(this,function(){this.set("paused",!1)},200),r("#beat-speaker-center-outer").velocity({blur:3},100).velocity({blur:0},100),r("#beat-speaker-center-inner").velocity({scale:1.05},100).velocity({scale:1},100)},doAmbience:function(e){var t=this,n=this.get("activeLights") +o=Math.floor(Math.random()*(m[1]-m[0]+1)+m[0])}s&&(l=80),c(this,function(){i(h,d[1],!0),c(e,i,h,d[0],!1,o,l)},this.get("beatDelay"))}this.set("paused",!0),c(this,function(){this.set("paused",!1)},200),r("#beat-speaker-center-outer").velocity({blur:3},100).velocity({blur:0},100),r("#beat-speaker-center-inner").velocity({scale:1.05},100).velocity({scale:1},100)},doAmbience:function(e){var t=this,n=this.get("activeLights") if(e>.01&&!this.pauseAmbience&&n.length>0){var o=function(e,n){r.ajax(t.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify(n),contentType:"application/json",type:"PUT"})},s=Math.floor(Math.random()*n.length) if(n.length>1)for(;s===this.lastAmbienceLightIndex;)s=Math.floor(Math.random()*n.length) -var a=n[s],i=this.get("hueRange"),l=this.get("brightnessRange"),c=Math.floor(Math.random()*(i[1]-i[0]+1)+i[0]) -this.lastAmbienceLightIndex=s,o(a,{bri:Math.floor(l[1]/1.4),hue:c,transitiontime:Math.floor(4*Math.random())+4}),setTimeout(function(){c=Math.floor(Math.random()*(i[1]-i[0]+1)+i[0]),o(a,{bri:l[0],hue:c,transitiontime:Math.floor(4*Math.random())+4})},1e3),this.pauseAmbience=!0 +var i=n[s],a=this.get("hueRange"),l=this.get("brightnessRange"),c=Math.floor(Math.random()*(a[1]-a[0]+1)+a[0]) +this.lastAmbienceLightIndex=s,o(i,{bri:Math.floor(l[1]/1.4),hue:c,transitiontime:Math.floor(4*Math.random())+4}),setTimeout(function(){c=Math.floor(Math.random()*(a[1]-a[0]+1)+a[0]),o(i,{bri:l[0],hue:c,transitiontime:Math.floor(4*Math.random())+4})},1e3),this.pauseAmbience=!0 var p=Math.floor(1e3+2e3/n.length) setTimeout(function(){t.pauseAmbience=!1},p)}},init:function(){var e=this this._super.apply(this,arguments),window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia var t=new Dancer,n=this.get("storage"),o=t.createKick({threshold:this.get("threshold"),onKick:function(t,n){!1===e.get("paused")&&e.simulateKick(t,n)},offKick:function(t){e.get("ambienceMode")&&e.doAmbience(t)}}) -o.on(),this.setProperties({dancer:t,kick:o}),["volume","shuffle","repeat","volumeMuted","threshold","ambienceMode","blackoutMode","playerBottomDisplayed","songBeatPreferences","firstVisit","currentVisName","playQueue","playQueuePointer","flashingTransitions","hueRange","brightnessRange","beatDelay"].forEach(function(t){if(!i(n.get("huegasm."+t))){var o=n.get("huegasm."+t) -i(e.actions[t+"Changed"])?e.set(t,o):e.send(t+"Changed",o)}}),this.set("oldPlayQueueLength",this.get("playQueue.length")),SC.initialize({client_id:this.get("SC_CLIENT_ID")})},didInsertElement:function(){var e=this +o.on(),this.setProperties({dancer:t,kick:o}),["volume","shuffle","repeat","volumeMuted","threshold","ambienceMode","blackoutMode","playerBottomDisplayed","songBeatPreferences","firstVisit","currentVisName","playQueue","playQueuePointer","flashingTransitions","hueRange","brightnessRange","beatDelay"].forEach(function(t){if(!a(n.get("huegasm."+t))){var o=n.get("huegasm."+t) +a(e.actions[t+"Changed"])?e.set(t,o):e.send(t+"Changed",o)}}),this.set("oldPlayQueueLength",this.get("playQueue.length")),SC.initialize({client_id:this.get("SC_CLIENT_ID")})},didInsertElement:function(){var e=this this._super() var t=this r("#file-input").on("change",function(){var e=this.files @@ -205,65 +205,65 @@ else if("track"===n.kind)if(!0===n.streamable){var s=null n.artwork_url?s=n.artwork_url.replace("large","t67x67"):n.user.avatar_url&&(s=n.user.avatar_url),r.get(s).done(function(){t.get("playQueue").pushObject({url:n.stream_url+"?client_id="+t.get("SC_CLIENT_ID"),fileName:n.title+" - "+n.user.username,artist:n.user.username,scUrl:n.permalink_url,title:n.title,picture:s})}).fail(function(){t.get("playQueue").pushObject({url:n.stream_url+"?client_id="+t.get("SC_CLIENT_ID"),fileName:n.title+" - "+n.user.username,artist:n.user.username,scUrl:n.permalink_url,title:n.title})})}else o.push(n.title) else"playlist"===n.kind&&(!0===n.streamable?n.tracks.forEach(e):o.push(n.title))},o=[] e instanceof Array?e.forEach(n):n(e),o.length>0&&t.get("notify").alert({html:t.get("notStreamableHtml")(o)}),-1===t.get("playQueuePointer")&&(t.get("firstVisit")?t.send("goToSong",0):t.send("next"))},function(){t.get("notify").alert({html:t.get("urlNotFoundHtml")(e)})}),this.set("isShowingAddSoundCloudModal",!1)},toggleIsShowingAddSoundCloudModal:function(){this.toggleProperty("isShowingAddSoundCloudModal")},toggleIsShowingAddUrlModal:function(){this.toggleProperty("isShowingAddUrlModal")},slideTogglePlayerBottom:function(){var e=this.$("#player-bottom") -e.velocity(e.is(":visible")?"slideUp":"slideDown",{duration:300}),this.changePlayerControl("playerBottomDisplayed",!this.get("playerBottomDisplayed"))},goToSong:function(e,t,n){var o=this,s=this.get("dancer"),a=this.get("playQueue") -if(s.audio&&this.clearCurrentAudio(!0),!i(a[e])){var l=new Audio +e.velocity(e.is(":visible")?"slideUp":"slideDown",{duration:300}),this.changePlayerControl("playerBottomDisplayed",!this.get("playerBottomDisplayed"))},goToSong:function(e,t,n){var o=this,s=this.get("dancer"),i=this.get("playQueue") +if(s.audio&&this.clearCurrentAudio(!0),!a(i[e])){var l=new Audio l.src=this.get("playQueue")[e].url,l.crossOrigin="anonymous",l.oncanplay=function(){o.set("timeTotal",Math.floor(l.duration)),o.set("soundCloudFuckUps",0)},l.onerror=function(e){var t=o.get("playQueuePointer"),n=o.get("playQueue")[t] -o.get("soundCloudFuckUps")>=o.get("maxSoundCloudFuckUps")?(o.get("notify").alert({html:o.get("tooManySoundCloudFuckUps")}),o.send("play"),o.set("soundCloudFuckUps",0)):(n.local?o.send("removeAudio",t):o.send("next",!0),2===e.target.error.code?o.get("notify").alert({html:o.get("failedToDecodeFileHtml")(n.fileName)}):o.get("notify").alert({html:o.get("failedToPlayFileHtml")(n.fileName)}),o.set("usingBeatPreferences",!1),o.incrementProperty("soundCloudFuckUps"))},l.ontimeupdate=function(){o.set("timeElapsed",Math.floor(l.currentTime))},l.onended=function(){o.send("next")},s.load(l,1),this.set("playQueuePointer",e),this.loadSongBeatPreferences(),t&&this.send("play"),n&&p(this,function(){r(".track"+e).velocity("scroll",{container:r("#play-list-area"),duration:200})})}},removeAudio:function(e){this.get("playQueue").removeAt(e),r("body .tooltip").remove(),this.get("dancer").audio&&this.clearCurrentAudio(!0)},playerAreaPlay:function(){a(r("#player-controls:hover"))&&-1!==this.get("playQueuePointer")&&(this.send("play"),r("#play-notification").velocity({opacity:.8,scale:1},0).velocity({opacity:0,scale:3},500))},play:function(e){var t=this,n=this.get("dancer"),o=this.get("playQueuePointer"),s=this.get("playing"),a=this.get("lightsData") +o.get("soundCloudFuckUps")>=o.get("maxSoundCloudFuckUps")?(o.get("notify").alert({html:o.get("tooManySoundCloudFuckUps")}),o.send("play"),o.set("soundCloudFuckUps",0)):(n.local?o.send("removeAudio",t):o.send("next",!0),2===e.target.error.code?o.get("notify").alert({html:o.get("failedToDecodeFileHtml")(n.fileName)}):o.get("notify").alert({html:o.get("failedToPlayFileHtml")(n.fileName)}),o.set("usingBeatPreferences",!1),o.incrementProperty("soundCloudFuckUps"))},l.ontimeupdate=function(){o.set("timeElapsed",Math.floor(l.currentTime))},l.onended=function(){o.send("next")},s.load(l,1),this.set("playQueuePointer",e),this.loadSongBeatPreferences(),t&&this.send("play"),n&&p(this,function(){r(".track"+e).velocity("scroll",{container:r("#play-list-area"),duration:200})})}},removeAudio:function(e){this.get("playQueue").removeAt(e),r("body .tooltip").remove(),this.get("dancer").audio&&this.clearCurrentAudio(!0)},playerAreaPlay:function(){i(r("#player-controls:hover"))&&-1!==this.get("playQueuePointer")&&(this.send("play"),r("#play-notification").velocity({opacity:.8,scale:1},0).velocity({opacity:0,scale:3},500))},play:function(e){var t=this,n=this.get("dancer"),o=this.get("playQueuePointer"),s=this.get("playing"),i=this.get("lightsData") if(-1!==o){if(s){n.pause() -var i=this.get("preMusicLightsDataCache"),l=function(e){r.ajax(t.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({on:i[e].state.on,hue:i[e].state.hue,bri:i[e].state.bri}),contentType:"application/json",type:"PUT"})} -for(var p in a)a.hasOwnProperty(p)&&c(this,l,p,1e3) +var a=this.get("preMusicLightsDataCache"),l=function(e){r.ajax(t.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify({on:a[e].state.on,hue:a[e].state.hue,bri:a[e].state.bri}),contentType:"application/json",type:"PUT"})} +for(var p in i)i.hasOwnProperty(p)&&c(this,l,p,1e3) e||this.set("timeElapsed",Math.floor(n.getTime()))}else{var u=this.get("timeTotal") if(this.get("volumeMuted")?n.setVolume(0):n.setVolume(this.get("volume")/100),this.get("timeElapsed")===u&&0!==u)return void this.send("next",!0) -r(window).trigger("resize"),this.set("preMusicLightsDataCache",a),n.play()}this.set("pauseLightUpdates",!s),this.toggleProperty("playing")}},volumeChanged:function(e){this.changePlayerControl("volume",e),this.get("playing")&&this.get("dancer").setVolume(e/100),this.get("volume")>0&&this.get("volumeMuted")&&this.changePlayerControl("volumeMuted",!1)},next:function(e){var t=this.get("playQueuePointer"),n=this.get("playQueue"),o=t+1,s=this.get("repeat"),a=this.get("shuffle") +r(window).trigger("resize"),this.set("preMusicLightsDataCache",i),n.play()}this.set("pauseLightUpdates",!s),this.toggleProperty("playing")}},volumeChanged:function(e){this.changePlayerControl("volume",e),this.get("playing")&&this.get("dancer").setVolume(e/100),this.get("volume")>0&&this.get("volumeMuted")&&this.changePlayerControl("volumeMuted",!1)},next:function(e){var t=this.get("playQueuePointer"),n=this.get("playQueue"),o=t+1,s=this.get("repeat"),i=this.get("shuffle") if(2===s)o=-1===t&&n.length>0?0:t -else if(a){var i=this.get("shufflePlayed") -if(i.length===n.length)return i.clear(),void this.send("play",!0) -do{o=Math.floor(Math.random()*n.length)}while(i.includes(n[o].url)) -i.pushObject(n[o].url)}else if(o>n.length-1){if(1!==s&&!e)return void this.send("play",!0) +else if(i){var a=this.get("shufflePlayed") +if(a.length===n.length)return a.clear(),void this.send("play",!0) +do{o=Math.floor(Math.random()*n.length)}while(a.includes(n[o].url)) +a.pushObject(n[o].url)}else if(o>n.length-1){if(1!==s&&!e)return void this.send("play",!0) o%=n.length}this.send("goToSong",o,!0,!0)},previous:function(){if(this.get("timeElapsed")>5)this.send("seekChanged",0) else{var e=this.get("playQueuePointer"),t=this.get("playQueue") -if(this.get("shuffle")&&!i(t[e])){var n=this.get("shufflePlayed"),o=this.get("shufflePlayed").indexOf(t[e].url),s=0 +if(this.get("shuffle")&&!a(t[e])){var n=this.get("shufflePlayed"),o=this.get("shufflePlayed").indexOf(t[e].url),s=0 n.length>0&&-1!==o&&((e=o-1)<0&&(e=n.length-1),t.some(function(t){return t.url===n[e]?(e=s,!0):(s++,!1)}))}else--e<0&&(e=t.length-1) this.send("goToSong",e,!0,!0)}},seekChanged:function(e){var t=this.get("dancer") -t.audio&&(t.audio.currentTime=Math.floor(this.get("timeTotal")*e/100))},volumeMutedChanged:function(e){var t=this.get("dancer"),n=i(e)?!this.get("volumeMuted"):e -this.changePlayerControl("volumeMuted",n),this.get("playing")&&(n?t.setVolume(0):t.setVolume(this.get("volume")/100))},addLocalAudio:function(){r("#file-input").click()},handleNewURL:function(e){e&&this.get("playQueue").pushObject({fileName:e,url:e,title:e,local:!0}),this.set("isShowingAddUrlModal",!1)},shuffleChanged:function(e){this.changePlayerControl("shuffle",i(e)?!this.get("shuffle"):e)},repeatChanged:function(e){this.changePlayerControl("repeat",i(e)?(this.get("repeat")+1)%3:e)},playerBottomDisplayedChanged:function(e){this.changePlayerControl("playerBottomDisplayed",e)},thresholdChanged:function(e){this.changePlayerControl("threshold",e,!0)},brightnessRangeChanged:function(e){this.changePlayerControl("brightnessRange",e)},hueRangeChanged:function(e){this.changePlayerControl("hueRange",e)},playQueuePointerChanged:function(e){this.send("goToSong",e,!1,!0)},clickSpeaker:function(){this.simulateKick(1)},dropFiles:function(e){this.setProperties({dragging:!1,draggingOverPlayListArea:!1}),this.send("handleNewFiles",e)},playerListAreaDragOver:function(){this.set("draggingOverPlayListArea",!0)},playerListAreaDragLeave:function(){this.set("draggingOverPlayListArea",!1)},handleNewFiles:function(e){var t=this,n=this.get("playQueue"),o=function(){var e=ID3.getAllTags("local"),o=null -if(e.picture){for(var s="",a=0;aSoundCloud user URLs are not supported.',tooManySoundCloudFuckUps:'',notStreamableHtml:function(e){return'"},urlNotFoundHtml:function(e){return'"},failedToPlayFileHtml:function(e){return'"},failedToDecodeFileHtml:function(e){return'"},scUrl:o("playQueuePointer","playQueue.[]",function(){var e=null,t=this.get("playQueue")[this.get("playQueuePointer")] return t&&t.scUrl&&(e=t.scUrl),e}),playQueueEmpty:o.empty("playQueue"),playQueueNotEmpty:o.notEmpty("playQueue"),playQueueMultiple:o("playQueue.[]",function(){return this.get("playQueue").length>1}),seekPosition:o("timeElapsed","timeTotal",function(){var e=this.get("timeTotal"),t=this.get("timeElapsed") return 0===e?0:t/e*100}),largeArtworkPic:o("playQueuePointer","currentVisName",function(){var e="",t=this.get("currentVisName"),n=this.get("playQueuePointer"),o=this.get("playQueue") -if(-1!==n&&"None"===t){var a=o[n] -s(a.picture)||(e=a.picture,a.scUrl&&(e=e.replace("67x67","500x500")))}return e}),repeatIcon:o("repeat",function(){return 2===this.get("repeat")?"repeat-one":"repeat"}),playingIcon:o("playing",function(){return this.get("playing")?"pause":this.get("timeElapsed")===this.get("timeTotal")&&0!==this.get("timeTotal")?"replay":"play-arrow"}),playListAreaClass:o("dragging","draggingOverPlayListArea","dimmerOn",function(){var e="pointer" +if(-1!==n&&"None"===t){var i=o[n] +s(i.picture)||(e=i.picture,i.scUrl&&(e=e.replace("67x67","500x500")))}return e}),repeatIcon:o("repeat",function(){return 2===this.get("repeat")?"repeat-one":"repeat"}),playingIcon:o("playing",function(){return this.get("playing")?"pause":this.get("timeElapsed")===this.get("timeTotal")&&0!==this.get("timeTotal")?"replay":"play-arrow"}),playListAreaClass:o("dragging","draggingOverPlayListArea","dimmerOn",function(){var e="pointer" return this.get("dragging")&&(e+=" drag-here-highlight"),this.get("draggingOverPlayListArea")&&(e+=" dragging-over"),this.get("dimmerOn")&&(e+=" dimmerOn"),e}),dimmerOnClass:o("dimmerOn",function(){return this.get("dimmerOn")?"dimmerOn":null}),volumeMutedClass:o("volumeMuted",function(){var e="player-control-icon volumeButton" return this.get("volumeMuted")&&(e+=" active"),e}),repeatClass:o("repeat",function(){return 0!==this.get("repeat")?"player-control-icon active":"player-control-icon"}),shuffleClass:o("shuffle",function(){return this.get("shuffle")?"player-control-icon active":"player-control-icon"}),volumeIcon:o("volumeMuted","volume",function(){var e=this.get("volume") return this.get("volumeMuted")?"volume-off":e>=70?"volume-up":e>10?"volume-down":"volume-mute"}),beatDetectionAreaArrowIcon:o("playerBottomDisplayed",function(){return this.get("playerBottomDisplayed")?"keyboard-arrow-up":"keyboard-arrow-down"}),timeElapsedTxt:o("timeElapsed",function(){return this.formatTime(this.get("timeElapsed"))}),timeTotalTxt:o("timeTotal",function(){var e=this.get("timeTotal") return this.formatTime(e===1/0?null:e)}),onPlayQueueChange:n("playQueue.length",function(){var e=this,t=this.get("playQueue.length") -t>this.get("oldPlayQueueLength")&&a.once(this,function(){a.next(e,function(){i(".track"+(t-1)).velocity("scroll",{container:i("#play-list-area"),duration:200})})}),this.set("oldPlayQueueLength",t)}),playerAreaClickIcon:o("playing",function(){return this.get("playing")?"play-arrow":"pause"}),onOptionChange:n("flashingTransitions","playQueue.[]","playQueuePointer","ambienceMode","blackoutMode",function(e,t){var n=this +t>this.get("oldPlayQueueLength")&&i.once(this,function(){i.next(e,function(){a(".track"+(t-1)).velocity("scroll",{container:a("#play-list-area"),duration:200})})}),this.set("oldPlayQueueLength",t)}),playerAreaClickIcon:o("playing",function(){return this.get("playing")?"play-arrow":"pause"}),onOptionChange:n("flashingTransitions","playQueue.[]","playQueuePointer","ambienceMode","blackoutMode",function(e,t){var n=this t=t.replace(".[]","") var o=this.get(t) if("playQueue"===t)o=o.filter(function(e){return!e.url.startsWith("blob:")}) -else if("blackoutMode"===t){var a={on:!0} -o&&(this.set("ambienceMode",!1),a.on=!1),this.get("playing")&&this.get("activeLights").forEach(function(e){i.ajax(n.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify(a),contentType:"application/json",type:"PUT"})})}else o&&"ambienceMode"===t&&this.set("blackoutMode",!1) +else if("blackoutMode"===t){var i={on:!0} +o&&(this.set("ambienceMode",!1),i.on=!1),this.get("playing")&&this.get("activeLights").forEach(function(e){a.ajax(n.get("apiURL")+"/lights/"+e+"/state",{data:JSON.stringify(i),contentType:"application/json",type:"PUT"})})}else o&&"ambienceMode"===t&&this.set("blackoutMode",!1) s(o)||this.get("storage").set("huegasm."+t,o)}),onRepeatChange:l("init",n("repeat",function(){var e="Repeat all" 1===this.get("repeat")?e="Repeat one":2===this.get("repeat")&&(e="Repeat off"),this.changeTooltipText("repeat",e)})),onShuffleChange:l("init",n("shuffle",function(){var e="Shuffle" this.get("shuffle")&&(this.get("shufflePlayed").clear(),e="Unshuffle"),this.changeTooltipText("shuffle",e)})),onVolumeMutedChange:l("init",n("volumeMuted",function(){var e="Mute",t=this.get("volumeMuted"),n=this.get("dancer"),o=0 t?(e="Unmute",o=0):o=this.get("volume")/100,this.get("playing")&&n.setVolume(o),this.changeTooltipText("volumeMuted",e)})),onPrevChange:l("init",n("timeElapsed","playQueueNotEmpty","playQueue.[]",function(){if(this.get("playQueueNotEmpty")){var e="Previous";(this.get("timeElapsed")>5||1===this.get("playQueue").length)&&(e="Replay"),this.changeTooltipText("prev",e)}})),onPlayingChange:l("init",n("playing",function(){var e="Play" -this.get("playing")?e="Pause":this.get("timeElapsed")===this.get("timeTotal")&&0!==this.get("timeTotal")&&(e="Replay"),this.changeTooltipText("playing",e)})),changeTooltipText:function(e,t){i("#"+e+"Tooltip + .tooltip .tooltip-inner").html(t),i("#"+e+"Tooltip").attr("data-original-title",t),s(this.get(e+"TooltipTxt"))&&this.set(e+"TooltipTxt",t)},formatTime:function(e){return null!==e?this.pad(Math.floor(e/60),2)+":"+this.pad(e%60,2):e},pad:function(e,t){return("000000000"+e).substr(-t)}})}),define("huegasm/pods/components/music-tab/mixins/visualizer",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) +this.get("playing")?e="Pause":this.get("timeElapsed")===this.get("timeTotal")&&0!==this.get("timeTotal")&&(e="Replay"),this.changeTooltipText("playing",e)})),changeTooltipText:function(e,t){a("#"+e+"Tooltip + .tooltip .tooltip-inner").html(t),a("#"+e+"Tooltip").attr("data-original-title",t),s(this.get(e+"TooltipTxt"))&&this.set(e+"TooltipTxt",t)},formatTime:function(e){return null!==e?this.pad(Math.floor(e/60),2)+":"+this.pad(e%60,2):e},pad:function(e,t){return("000000000"+e).substr(-t)}})}),define("huegasm/pods/components/music-tab/mixins/visualizer",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) var t=Ember.Mixin,n=Ember.observer,o=Ember.$ e.default=t.create({currentVisName:"None",visNames:["None","Bars","Wave"],onCurrentVisNameChange:n("currentVisName",function(){var e=this.get("currentVisName") if("None"===e){var t=o("#visualization")[0] -t.getContext("2d").clearRect(0,0,t.width,t.height)}this.get("storage").set("huegasm.currentVisName",e)}),didInsertElement:function(){var e=this,t=this.get("dancer"),n=o("#visualization")[0],s=o("#player-area"),a=n.getContext("2d"),i=s.height(),r=void 0 -n.height=i +t.getContext("2d").clearRect(0,0,t.width,t.height)}this.get("storage").set("huegasm.currentVisName",e)}),didInsertElement:function(){var e=this,t=this.get("dancer"),n=o("#visualization")[0],s=o("#player-area"),i=n.getContext("2d"),a=s.height(),r=void 0 +n.height=a var l=function(){r=s.width(),n.width=r} -l(),o(window).on("resize",l),t.bind("update",function(){var n=e.get("currentVisName"),o=a.createLinearGradient(0,0,0,i),s=document.hidden||document.msHidden||document.webkitHidden||document.mozHidden -if("None"!==n&&!s&&e.get("active"))if(a.clearRect(0,0,r,i),"Wave"===n){o.addColorStop(.6,"white"),o.addColorStop(0,"#0036FA"),a.lineWidth=1,a.strokeStyle=o +l(),o(window).on("resize",l),t.bind("update",function(){var n=e.get("currentVisName"),o=i.createLinearGradient(0,0,0,a),s=document.hidden||document.msHidden||document.webkitHidden||document.mozHidden +if("None"!==n&&!s&&e.get("active"))if(i.clearRect(0,0,r,a),"Wave"===n){o.addColorStop(.6,"white"),o.addColorStop(0,"#0036FA"),i.lineWidth=1,i.strokeStyle=o var l=t.getWaveform() -a.beginPath(),a.moveTo(0,i/2) -for(var c=0,p=l.length;cs.clientHeight&&(r(s,{position:"fixed",width:"100%",top:-o+"px"}),r(e,{overflowY:"scroll"})) -s.clientWidth\n
\n ') -return s.appendChild(e[0]),e.on("wheel",i),e.on("touchmove",i),o.on("keydown",a),function(){e.off("wheel"),e.off("touchmove"),e[0].parentNode.removeChild(e[0]),o.off("keydown",a),delete t.disableScrollAround._enableScrolling} -function a(e){}function i(e){e.preventDefault()}}() -return t.disableScrollAround._enableScrolling=function(){--t.disableScrollAround._count||(a(),i(),delete t.disableScrollAround._enableScrolling)} +s.clientWidth\n
\n ') +return s.appendChild(e[0]),e.on("wheel",a),e.on("touchmove",a),o.on("keydown",i),function(){e.off("wheel"),e.off("touchmove"),e[0].parentNode.removeChild(e[0]),o.off("keydown",i),delete t.disableScrollAround._enableScrolling} +function i(e){}function a(e){e.preventDefault()}}() +return t.disableScrollAround._enableScrolling=function(){--t.disableScrollAround._count||(i(),a(),delete t.disableScrollAround._enableScrolling)} function r(e,t){for(var n in t)e.style[n]=t[n]}},enableScrolling:function(){var e=this.disableScrollAround._enableScrolling e&&e()},supplant:function(e,t,n){return n=n||/\{([^\{\}]*)\}/g,e.replace(n,function(e,n){var o=n.split("."),s=t -try{for(var a in o)o.hasOwnProperty(a)&&(s=s[o[a]])}catch(t){s=e}return"string"==typeof s||"number"==typeof s?s:e})},nextTick:function(e,t,n,o,s){for(;!s&&n',beyond_ceiling_pendant_table:'',bloom:'',br30:'',br30_slim:'',bridge_v1:'',bridge_v2:'',ceiling_round:'',ceiling_square:'',entity:'',floor:'',go:'',gu10:'',gu10_perfectfit:'',hds:'',impulse:'',iris:'',lightstrip:'',motion_sensor:'',pendant_oval:'',pendant_round:'',pendant_square:'',phoenix_ceiling:'',phoenix_down:'',recessed:'',storylight:'',table:'',tap:'',white_and_color_e27:'',white_e27:''},outline:{aura:'',beyond_ceiling_pendant_table:'',bloom:'',br30:'',br30_slim:'',bridge_v1:'',bridge_v2:'',ceiling_round:'',ceiling_square:'',entity:'',floor:'',go:'',gu10:'',gu10_perfectfit:'',hds:'',impulse:'',iris:'',lightstrip:'',motion_sensor:'',par16:'',pendant_oval:'',pendant_round:'',pendant_square:'',phoenix_ceiling:'',phoenix_ceiling_2:'',phoenix_down:'',phoenix_pendant:'',phoenix_table:'',phoenix_wall:'',recessed:'',storylight:'',table:'',tap:'',white_and_color_e27:'',white_e27:''}}}},"safari-pinned-tab":''}}),define("huegasm/templates/application",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"sESP0Z+T",block:'{"symbols":[],"statements":[[1,[18,"welcome-page"],false],[0,"\\n"],[0,"\\n"],[1,[18,"outlet"],false]],"hasEval":false}',meta:{moduleName:"huegasm/templates/application.hbs"}})}),define("huegasm/templates/components/transition-group",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"Z/BMdkzA",block:'{"symbols":["&default"],"statements":[[11,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"huegasm/templates/components/transition-group.hbs"}})}),define("huegasm/utils/clamp",["exports","ember-paper/utils/clamp"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("huegasm/config/environment",[],function(){try{var e="huegasm/config/environment",t=document.querySelector('meta[name="'+e+'"]').getAttribute("content"),n={default:JSON.parse(unescape(t))} -return Object.defineProperty(n,"__esModule",{value:!0}),n}catch(t){throw new Error('Could not read config from meta tag with name "'+e+'".')}}),runningTests||require("huegasm/app").default.create({name:"huegasm",version:"1.0.0+52e9e290"}) +return Object.defineProperty(n,"__esModule",{value:!0}),n}catch(t){throw new Error('Could not read config from meta tag with name "'+e+'".')}}),runningTests||require("huegasm/app").default.create({name:"huegasm",version:"1.0.0+4cc00639"}) diff --git a/index.html b/index.html index dacfb30..605108a 100644 --- a/index.html +++ b/index.html @@ -27,7 +27,7 @@ - + @@ -63,7 +63,7 @@ - +