You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
radium/compiled/radium.min.js

7 lines
172 KiB
JavaScript

!function(){var e,t=function(e,t){return function(){return e.apply(t,arguments)}};window.pass=void 0,e=function(){function e(e){this.resource_manager=e,this.getTileset=t(this.getTileset,this),this.getSprite=t(this.getSprite,this),this.getSound=t(this.getSound,this),this.getObject=t(this.getObject,this),this.getScene=t(this.getScene,this),this.createTileset=t(this.createTileset,this),this.createSprite=t(this.createSprite,this),this.createSound=t(this.createSound,this),this.createObject=t(this.createObject,this),this.createScene=t(this.createScene,this),this.setPreloadScene=t(this.setPreloadScene,this),this.setInitialScene=t(this.setInitialScene,this),this.skipTimers=t(this.skipTimers,this),this.updateTimers=t(this.updateTimers,this),this.iteration=t(this.iteration,this),this.loop=t(this.loop,this),this.start=t(this.start,this),this.updateCanvasSize=t(this.updateCanvasSize,this),this.getSurface=t(this.getSurface,this),this.createSurface=t(this.createSurface,this),this.addCanvas=t(this.addCanvas,this),this.canvases={},this.fps=45,this.last_frameskip_collection=Math.floor(Date.now()),this.frameskip=0,this.current_frameskip=0,this.current_frame=0,this.scenes={},this.objects={},this.sounds={},this.sprites={},this.tilesets={},this.named_timers={},this.unnamed_timers=[],this.ease.engine=this}return e.prototype.addCanvas=function(e,t){return null==t&&(t=""),this.canvases[t]=d.unpackElement(e)},e.prototype.createSurface=function(e){return this.canvases[e]=document.createElement("canvas")},e.prototype.getSurface=function(e){var t;return"string"==typeof e?null!=(t=this.canvases[e])?t.getContext("2d"):void 0:"CANVAS"===e.tagName?e.getContext("2d"):e},e.prototype.updateCanvasSize=function(e,t,n){return e.width=t,e.height=n,e.style.width=""+t+"px",e.style.height=""+n+"px"},e.prototype.start=function(){return this.initial_scene.addTargetSurface(this.canvases[""]),this.loop()},e.prototype.loop=function(){return this.iteration()},e.prototype.iteration=function(){var e,t,n,i,r,s,o,a,u;n=1e3/this.fps,t=Date.now(),r=t+n,this.current_frame+=1,Math.floor(t)>this.last_frameskip_collection&&(this.frameskip=this.current_frameskip,this.current_frameskip=0,this.last_frameskip_collection=Math.floor(t)),this.updateTimers(),u=this.scenes;for(i in u)o=u[i],o.active&&o.iteration();return Date.now()<r?setTimeout(this.iteration,r-Date.now()):(s=Date.now()-r,a=Math.floor(s/n),this.current_frameskip+=a,this.current_frame+=a,this.skipTimers(a),e=s%n,setTimeout(this.iteration,e))},e.prototype.updateTimers=function(){var e,t,n,i,r,s,o,a,u;for(o=this.unnamed_timers.concat(function(){var t,n;t=this.named_timers,n=[];for(e in t)i=t[e],n.push(i);return n}.call(this)),r=0,s=o.length;s>r;r++)t=o[r],t.step();this.unnamed_timers=this.unnamed_timers.filter(function(e){return!e.finished}),a=this.named_timers,u=[];for(n in a)t=a[n],u.push(t.finished?delete this.named_timers[n]:void 0);return u},e.prototype.skipTimers=function(e){var t,n,i,r,s,o,a;for(o=this.unnamed_timers.concat(function(){var e,n;e=this.named_timers,n=[];for(t in e)i=e[t],n.push(i);return n}.call(this)),a=[],r=0,s=o.length;s>r;r++)n=o[r],a.push(n.skip(e));return a},e.prototype.setInitialScene=function(e){return this.initial_scene=e},e.prototype.setPreloadScene=function(e){return this.preload_scene=e},e.prototype.createScene=function(e){var t;return t=new a(this,e),null==this.initial_scene&&(this.initial_scene=t),this.scenes[e]=t},e.prototype.createObject=function(e){return this.objects[e]=new s(this,e)},e.prototype.createSound=function(e,t){return this.sounds[e]=new u(this,e,this.resource_manager.getSound(t))},e.prototype.createSprite=function(e,t){return console.log("gget",this.resource_manager.getImage(t)),this.sprites[e]=new l(this,e,this.resource_manager.getImage(t))},e.prototype.createTileset=function(e,t,n,i){return this.tilesets[e]=new c(this,e,this.resource_manager.getImage(t),n,i)},e.prototype.getScene=function(e){return"string"==typeof e?this.scenes[e]:e},e.prototype.getObject=function(e){return"string"==typeof e?this.objects[e]:e},e.prototype.getSound=function(e){return"string"==typeof e?thi
i=o&&(Y.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+T(e,t,n||(o?"border":"content"),i,s)+"px"}function j(e,t){for(var n,i,r,s=[],o=0,a=e.length;a>o;o++)i=e[o],i.style&&(s[o]=vt.get(i,"olddisplay"),n=i.style.display,t?(s[o]||"none"!==n||(i.style.display=""),""===i.style.display&&wt(i)&&(s[o]=vt.access(i,"olddisplay",x(i.nodeName)))):(r=wt(i),"none"===n&&r||vt.set(i,"olddisplay",r?n:Z.css(i,"display"))));for(o=0;a>o;o++)i=e[o],i.style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?s[o]||"":"none"));return e}function P(e,t,n,i,r){return new P.prototype.init(e,t,n,i,r)}function N(){return setTimeout(function(){Yt=void 0}),Yt=Z.now()}function I(e,t){var n,i=0,r={height:e};for(t=t?1:0;4>i;i+=2-t)n=St[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function C(e,t,n){for(var i,r=(nn[t]||[]).concat(nn["*"]),s=0,o=r.length;o>s;s++)if(i=r[s].call(n,t,e))return i}function A(e,t,n){var i,r,s,o,a,u,l,c,h=this,d={},p=e.style,f=e.nodeType&&wt(e),g=vt.get(e,"fxshow");n.queue||(a=Z._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,h.always(function(){h.always(function(){a.unqueued--,Z.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],l=Z.css(e,"display"),c="none"===l?vt.get(e,"olddisplay")||x(e.nodeName):l,"inline"===c&&"none"===Z.css(e,"float")&&(p.display="inline-block")),n.overflow&&(p.overflow="hidden",h.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(i in t)if(r=t[i],Kt.exec(r)){if(delete t[i],s=s||"toggle"===r,r===(f?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;f=!0}d[i]=g&&g[i]||Z.style(e,i)}else l=void 0;if(Z.isEmptyObject(d))"inline"===("none"===l?x(e.nodeName):l)&&(p.display=l);else{g?"hidden"in g&&(f=g.hidden):g=vt.access(e,"fxshow",{}),s&&(g.hidden=!f),f?Z(e).show():h.done(function(){Z(e).hide()}),h.done(function(){var t;vt.remove(e,"fxshow");for(t in d)Z.style(e,t,d[t])});for(i in d)o=C(f?g[i]:0,i,h),i in g||(g[i]=o.start,f&&(o.end=o.start,o.start="width"===i||"height"===i?1:0))}}function O(e,t){var n,i,r,s,o;for(n in e)if(i=Z.camelCase(n),r=t[i],s=e[n],Z.isArray(s)&&(r=s[1],s=e[n]=s[0]),n!==i&&(e[i]=s,delete e[n]),o=Z.cssHooks[i],o&&"expand"in o){s=o.expand(s),delete e[i];for(n in s)n in e||(e[n]=s[n],t[n]=r)}else t[i]=r}function k(e,t,n){var i,r,s=0,o=tn.length,a=Z.Deferred().always(function(){delete u.elem}),u=function(){if(r)return!1;for(var t=Yt||N(),n=Math.max(0,l.startTime+l.duration-t),i=n/l.duration||0,s=1-i,o=0,u=l.tweens.length;u>o;o++)l.tweens[o].run(s);return a.notifyWith(e,[l,s,n]),1>s&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:Z.extend({},t),opts:Z.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Yt||N(),duration:n.duration,tweens:[],createTween:function(t,n){var i=Z.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(i),i},stop:function(t){var n=0,i=t?l.tweens.length:0;if(r)return this;for(r=!0;i>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(O(c,l.opts.specialEasing);o>s;s++)if(i=tn[s].call(l,e,c,l.opts))return i;return Z.map(c,C,l),Z.isFunction(l.opts.start)&&l.opts.start.call(e,l),Z.fx.timer(Z.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,s=t.toLowerCase().match(pt)||[];if(Z.isFunction(n))for(;i=s[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function M(e,t,n,i){function r(a){var u;return s[a]=!0,Z.each(e[a]||[],function(e,a){var l=a(t,n,i);return"string"!=typeof l||o||s[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),r(l),!1)}),u}var s={},o=e===Sn;return r(t.dataTypes[0])||!s["*"]&&r("*")}function R(e,t){var n,i,r=Z.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i
},lock:function(){return l=void 0,t||h.disable(),this},locked:function(){return!l},fireWith:function(e,t){return!u||n&&!l||(t=t||[],t=[e,t.slice?t.slice():t],i?l.push(t):c(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},Z.extend({Deferred:function(e){var t=[["resolve","done",Z.Callbacks("once memory"),"resolved"],["reject","fail",Z.Callbacks("once memory"),"rejected"],["notify","progress",Z.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Z.Deferred(function(n){Z.each(t,function(t,s){var o=Z.isFunction(e[t])&&e[t];r[s[1]](function(){var e=o&&o.apply(this,arguments);e&&Z.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s[0]+"With"](this===i?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?Z.extend(e,i):i}},r={};return i.pipe=i.then,Z.each(t,function(e,s){var o=s[2],a=s[3];i[s[1]]=o.add,a&&o.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),r[s[0]]=function(){return r[s[0]+"With"](this===r?i:this,arguments),this},r[s[0]+"With"]=o.fireWith}),i.promise(r),e&&e.call(r,r),r},when:function(e){var t,n,i,r=0,s=U.call(arguments),o=s.length,a=1!==o||e&&Z.isFunction(e.promise)?o:0,u=1===a?e:Z.Deferred(),l=function(e,n,i){return function(r){n[e]=this,i[e]=arguments.length>1?U.call(arguments):r,i===t?u.notifyWith(n,i):--a||u.resolveWith(n,i)}};if(o>1)for(t=new Array(o),n=new Array(o),i=new Array(o);o>r;r++)s[r]&&Z.isFunction(s[r].promise)?s[r].promise().done(l(r,i,s)).fail(u.reject).progress(l(r,n,t)):--a;return a||u.resolveWith(i,s),u.promise()}});var gt;Z.fn.ready=function(e){return Z.ready.promise().done(e),this},Z.extend({isReady:!1,readyWait:1,holdReady:function(e){e?Z.readyWait++:Z.ready(!0)},ready:function(e){(e===!0?--Z.readyWait:Z.isReady)||(Z.isReady=!0,e!==!0&&--Z.readyWait>0||(gt.resolveWith(G,[Z]),Z.fn.triggerHandler&&(Z(G).triggerHandler("ready"),Z(G).off("ready"))))}}),Z.ready.promise=function(t){return gt||(gt=Z.Deferred(),"complete"===G.readyState?setTimeout(Z.ready):(G.addEventListener("DOMContentLoaded",o,!1),e.addEventListener("load",o,!1))),gt.promise(t)},Z.ready.promise();var mt=Z.access=function(e,t,n,i,r,s,o){var a=0,u=e.length,l=null==n;if("object"===Z.type(n)){r=!0;for(a in n)Z.access(e,t,a,n[a],!0,s,o)}else if(void 0!==i&&(r=!0,Z.isFunction(i)||(o=!0),l&&(o?(t.call(e,i),t=null):(l=t,t=function(e,t,n){return l.call(Z(e),n)})),t))for(;u>a;a++)t(e[a],n,o?i:i.call(e[a],a,t(e[a],n)));return r?e:l?t.call(e):u?t(e[0],n):s};Z.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},a.uid=1,a.accepts=Z.acceptData,a.prototype={key:function(e){if(!a.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=a.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(i){t[this.expando]=n,Z.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var i,r=this.key(e),s=this.cache[r];if("string"==typeof t)s[t]=n;else if(Z.isEmptyObject(s))Z.extend(this.cache[r],t);else for(i in t)s[i]=t[i];return s},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var i;return void 0===t||t&&"string"==typeof t&&void 0===n?(i=this.get(e,t),void 0!==i?i:this.get(e,Z.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,i,r,s=this.key(e),o=this.cache[s];if(void 0===t)this.cache[s]={};else{Z.isArray(t)?i=t.concat(t.map(Z.camelCase)):(r=Z.camelCase(t),t in o?i=[t,r]:(i=r,i=i in o?[i]:i.match(pt)||[])),n=i.length;for(;n--;)delete o[i[n]]}},hasData:function(e){return!Z.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var vt=new a,yt=new a,_t=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,xt=/([A-Z])/g;Z.extend({hasData:function(e){return yt.hasData(e)||vt.hasData(e)},data:function(e,t,n){return yt.access(e,t,n)},removeData:function(e,t){yt.remove(e,t)},_data:function(e,t,n){return vt.access(e,t,n)},_removeData:functio
o=e?Z.trim(i):"",n.className!==o&&(n.className=o)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):this.each(Z.isFunction(e)?function(n){Z(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,i=0,r=Z(this),s=e.match(pt)||[];t=s[i++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else(n===Tt||"boolean"===n)&&(this.className&&vt.set(this,"__className__",this.className),this.className=this.className||e===!1?"":vt.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;i>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(un," ").indexOf(t)>=0)return!0;return!1}});var ln=/\r/g;Z.fn.extend({val:function(e){var t,n,i,r=this[0];{if(arguments.length)return i=Z.isFunction(e),this.each(function(n){var r;1===this.nodeType&&(r=i?e.call(this,n,Z(this).val()):e,null==r?r="":"number"==typeof r?r+="":Z.isArray(r)&&(r=Z.map(r,function(e){return null==e?"":e+""})),t=Z.valHooks[this.type]||Z.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))});if(r)return t=Z.valHooks[r.type]||Z.valHooks[r.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:(n=r.value,"string"==typeof n?n.replace(ln,""):null==n?"":n)}}}),Z.extend({valHooks:{option:{get:function(e){var t=Z.find.attr(e,"value");return null!=t?t:Z.trim(Z.text(e))}},select:{get:function(e){for(var t,n,i=e.options,r=e.selectedIndex,s="select-one"===e.type||0>r,o=s?null:[],a=s?r+1:i.length,u=0>r?a:s?r:0;a>u;u++)if(n=i[u],!(!n.selected&&u!==r||(Y.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Z.nodeName(n.parentNode,"optgroup"))){if(t=Z(n).val(),s)return t;o.push(t)}return o},set:function(e,t){for(var n,i,r=e.options,s=Z.makeArray(t),o=r.length;o--;)i=r[o],(i.selected=Z.inArray(i.value,s)>=0)&&(n=!0);return n||(e.selectedIndex=-1),s}}}}),Z.each(["radio","checkbox"],function(){Z.valHooks[this]={set:function(e,t){return Z.isArray(t)?e.checked=Z.inArray(Z(e).val(),t)>=0:void 0}},Y.checkOn||(Z.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),Z.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Z.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),Z.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var cn=Z.now(),hn=/\?/;Z.parseJSON=function(e){return JSON.parse(e+"")},Z.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(i){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&Z.error("Invalid XML: "+e),t};var dn,pn,fn=/#.*$/,gn=/([?&])_=[^&]*/,mn=/^(.*?):[ \t]*([^\r\n]*)$/gm,vn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,yn=/^(?:GET|HEAD)$/,_n=/^\/\//,xn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,bn={},Sn={},wn="*/".concat("*");try{pn=location.href}catch(En){pn=G.createElement("a"),pn.href="",pn=pn.href}dn=xn.exec(pn.toLowerCase())||[],Z.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:pn,type:"GET",isLocal:vn.test(dn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":Z.parseJSON,"text xml":Z.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:
}return null},t._getTypeByExtension=function(e){if(null==e)return createjs.LoadQueue.TEXT;switch(e.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.LoadQueue.IMAGE;case"ogg":case"mp3":case"wav":return createjs.LoadQueue.SOUND;case"json":return createjs.LoadQueue.JSON;case"xml":return createjs.LoadQueue.XML;case"css":return createjs.LoadQueue.CSS;case"js":return createjs.LoadQueue.JAVASCRIPT;case"svg":return createjs.LoadQueue.SVG;default:return createjs.LoadQueue.TEXT}},t._sendFileProgress=function(e,t){if(this._isCanceled())return void this._cleanUp();if(this.hasEventListener("fileprogress")){var n=new createjs.Event("fileprogress");n.progress=t,n.loaded=t,n.total=1,n.item=e,this.dispatchEvent(n)}},t._sendFileComplete=function(e,t){if(!this._isCanceled()){var n=new createjs.Event("fileload");n.loader=t,n.item=e,n.result=this._loadedResults[e.id],n.rawResult=this._loadedRawResults[e.id],e.completeHandler&&e.completeHandler(n),this.hasEventListener("fileload")&&this.dispatchEvent(n)}},t._sendFileStart=function(e){var t=new createjs.Event("filestart");t.item=e,this.hasEventListener("filestart")&&this.dispatchEvent(t)},t.toString=function(){return"[PreloadJS LoadQueue]"},createjs.LoadQueue=e;var i=function(){};i.init=function(){var e=navigator.userAgent;i.isFirefox=e.indexOf("Firefox")>-1,i.isOpera=null!=window.opera,i.isChrome=e.indexOf("Chrome")>-1,i.isIOS=e.indexOf("iPod")>-1||e.indexOf("iPhone")>-1||e.indexOf("iPad")>-1},i.init(),createjs.LoadQueue.BrowserDetect=i}(),this.createjs=this.createjs||{},function(){"use strict";var e=function(e){this.init(e)},t=e.prototype=new createjs.AbstractLoader;t._loadTimeout=null,t._tagCompleteProxy=null,t._isAudio=!1,t._tag=null,t._jsonResult=null,t.init=function(e){this._item=e,this._tag=e.tag,this._isAudio=window.HTMLAudioElement&&e.tag instanceof window.HTMLAudioElement,this._tagCompleteProxy=createjs.proxy(this._handleLoad,this)},t.getResult=function(){return this._item.type==createjs.LoadQueue.JSONP||this._item.type==createjs.LoadQueue.MANIFEST?this._jsonResult:this._tag},t.cancel=function(){this.canceled=!0,this._clean()},t.load=function(){var e=this._item,t=this._tag;clearTimeout(this._loadTimeout);var n=createjs.LoadQueue.LOAD_TIMEOUT;0==n&&(n=createjs.LoadQueue.loadTimeout),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),n),this._isAudio&&(t.src=null,t.preload="auto"),t.onerror=createjs.proxy(this._handleError,this),this._isAudio?(t.onstalled=createjs.proxy(this._handleStalled,this),t.addEventListener("canplaythrough",this._tagCompleteProxy,!1)):(t.onload=createjs.proxy(this._handleLoad,this),t.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this));var i=this.buildPath(e.src,e.values);switch(e.type){case createjs.LoadQueue.CSS:t.href=i;break;case createjs.LoadQueue.SVG:t.data=i;break;default:t.src=i}if(e.type==createjs.LoadQueue.JSONP||e.type==createjs.LoadQueue.JSON||e.type==createjs.LoadQueue.MANIFEST){if(null==e.callback)throw new Error("callback is required for loading JSONP requests.");if(null!=window[e.callback])throw new Error('JSONP callback "'+e.callback+'" already exists on window. You need to specify a different callback. Or re-name the current one.');window[e.callback]=createjs.proxy(this._handleJSONPLoad,this)}(e.type==createjs.LoadQueue.SVG||e.type==createjs.LoadQueue.JSONP||e.type==createjs.LoadQueue.JSON||e.type==createjs.LoadQueue.MANIFEST||e.type==createjs.LoadQueue.JAVASCRIPT||e.type==createjs.LoadQueue.CSS)&&(this._startTagVisibility=t.style.visibility,t.style.visibility="hidden",(document.body||document.getElementsByTagName("body")[0]).appendChild(t)),null!=t.load&&t.load()},t._handleJSONPLoad=function(e){this._jsonResult=e},t._handleTimeout=function(){this._clean();var e=new createjs.Event("error");e.text="PRELOAD_TIMEOUT",this._sendError(e)},t._handleStalled=function(){},t._handleError=function(){this._clean();var e=new createjs.Event("error");this._sendError(e)},t._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var e=this.getItem().tag;("loaded"==e.read
},t._cleanUp=function(){this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._delayTimeoutId),clearTimeout(this._soundCompleteTimeout),this._startTime=0,null!=window.createjs&&createjs.Sound._playFinished(this)},t._cleanUpAudioNode=function(e){return e&&(e.stop(0),e.disconnect(this.panNode),e=null),e},t._interrupt=function(){this._cleanUp(),this.playState=createjs.Sound.PLAY_INTERRUPTED,this._paused=!1,this._sendEvent("interrupted")},t._handleSoundReady=function(){if(null!=window.createjs){if(1e3*this._offset>this.getDuration())return void this.playFailed();this._offset<0&&(this._offset=0),this.playState=createjs.Sound.PLAY_SUCCEEDED,this._paused=!1,this.gainNode.connect(this._owner.gainNode);var e=this._owner._arrayBuffers[this.src].duration;this.sourceNode=this._createAndPlayAudioNode(this._owner.context.currentTime-e,this._offset),this._duration=1e3*e,this._startTime=this.sourceNode.startTime-this._offset,this._soundCompleteTimeout=setTimeout(this._endedHandler,1e3*(e-this._offset)),0!=this._remainingLoops&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._startTime,0))}},t._createAndPlayAudioNode=function(e,t){var n=this._owner.context.createBufferSource();return n.buffer=this._owner._arrayBuffers[this.src],n.connect(this.panNode),this._owner.context.currentTime,n.startTime=e+n.buffer.duration,n.start(n.startTime,t,n.buffer.duration-t),n},t.play=function(e,t,n,i,r,s){this._cleanUp(),createjs.Sound._playInstance(this,e,t,n,i,r,s)},t._beginPlaying=function(e,t,n,i){return null!=window.createjs&&this.src?(this._offset=e/1e3,this._remainingLoops=t,this.volume=n,this.pan=i,this._owner.isPreloadComplete(this.src)?(this._handleSoundReady(null),this._sendEvent("succeeded"),1):void this.playFailed()):void 0},t.pause=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED?!1:(this._paused=!0,this._offset=this._owner.context.currentTime-this._startTime,this._cleanUpAudioNode(this.sourceNode),this._cleanUpAudioNode(this._sourceNodeNext),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(),clearTimeout(this._delayTimeoutId),clearTimeout(this._soundCompleteTimeout),!0)},t.resume=function(){return this._paused?(this._handleSoundReady(null),!0):!1},t.stop=function(){return this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this._offset=0,!0},t.setVolume=function(e){return this.volume=e,!0},t._updateVolume=function(){var e=this._muted?0:this._volume;return e!=this.gainNode.gain.value?(this.gainNode.gain.value=e,!0):!1},t.getVolume=function(){return this.volume},t.setMute=function(e){return null==e||void 0==e?!1:(this._muted=e,this._updateVolume(),!0)},t.getMute=function(){return this._muted},t.setPan=function(e){return this.pan=e,this.pan!=e?!1:void 0},t.getPan=function(){return this.pan},t.getPosition=function(){if(this._paused||null==this.sourceNode)var e=this._offset;else var e=this._owner.context.currentTime-this._startTime;return 1e3*e},t.setPosition=function(e){return this._offset=e/1e3,this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._cleanUpAudioNode(this.sourceNode),this._cleanUpAudioNode(this._sourceNodeNext),clearTimeout(this._soundCompleteTimeout)),this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||this._handleSoundReady(null),!0},t.getDuration=function(){return this._duration},t._handleSoundComplete=function(){return this._offset=0,0!=this._remainingLoops?(this._remainingLoops--,this._sourceNodeNext?(this._cleanUpAudioNode(this.sourceNode),this.sourceNode=this._sourceNodeNext,this._startTime=this.sourceNode.startTime,this._sourceNodeNext=this._createAndPlayAudioNode(this._startTime,0),this._soundCompleteTimeout=setTimeout(this._endedHandler,this._duration)):this._handleSoundReady(null),void this._sendEvent("loop")):void(null!=window.createjs&&(this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this._sendEvent("complete")))},