handler-playable-sdk 0.3.13 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SXURSNAQ.js → chunk-NYX6PJFK.js} +63 -34
- package/dist/index.cjs +60 -31
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +9 -9
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +35 -35
- package/dist/three/index.js +1 -1
- package/package.json +2 -2
package/dist/pixi/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Ff=Object.create;var Un=Object.defineProperty;var Hf=Object.getOwnPropertyDescriptor;var $f=Object.getOwnPropertyNames;var Uf=Object.getPrototypeOf,qf=Object.prototype.hasOwnProperty;var Ue=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rl=(e,t)=>{for(var i in t)Un(e,i,{get:t[i],enumerable:!0})},al=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $f(t))!qf.call(e,r)&&r!==i&&Un(e,r,{get:()=>t[r],enumerable:!(n=Hf(t,r))||n.enumerable});return e};var qn=(e,t,i)=>(i=e!=null?Ff(Uf(e)):{},al(t||!e||!e.__esModule?Un(i,"default",{value:e,enumerable:!0}):i,e)),Gf=e=>al(Un({},"__esModule",{value:!0}),e);var Xf,ot=Ue(()=>{"use strict";Xf="handler_preview_override_mode";if(typeof window!="undefined"){let e=window.localStorage.getItem(Xf);window.__enableConfigOverrides=e===null?!0:e==="true"}});var Dl,At,Xv,fa=Ue(()=>{"use strict";ot();Dl=null,At="dev";if(typeof window!="undefined"){let e=window.__BUILD_SETTINGS__;if(e!=null&&e.buildMode)Dl=e,At=e.buildMode,console.log("[CONFIG] Loaded inline build settings:",e,"buildMode:",At);else try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let i=JSON.parse(t.responseText);Dl=i,At=i.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",i,"buildMode:",At)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",At)}catch(t){console.log("[CONFIG] Failed to load build-settings.json:",t instanceof Error?t.message:String(t))}}console.log("[CONFIG] Final buildMode:",At);Xv=At==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var ha=Ue(()=>{"use strict"});var Nl=Ue(()=>{"use strict";ha();fa()});var ga=Ue(()=>{"use strict";fa();ha();Nl()});var Ui=E((ow,ma)=>{"use strict";typeof process=="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?ma.exports={nextTick:sh}:ma.exports=process;function sh(e,t,i,n){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,a,s;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,i)});case 4:return process.nextTick(function(){e.call(null,t,i,n)});default:for(a=new Array(r-1),s=0;s<a.length;)a[s++]=arguments[s];return process.nextTick(function(){e.apply(null,a)})}}});var Hl=E((lw,Fl)=>{"use strict";var oh={}.toString;Fl.exports=Array.isArray||function(e){return oh.call(e)=="[object Array]"}});var ba=E((cw,$l)=>{"use strict";$l.exports=require("stream")});var qi=E((ya,ql)=>{"use strict";var Vn=require("buffer"),qe=Vn.Buffer;function Ul(e,t){for(var i in e)t[i]=e[i]}qe.from&&qe.alloc&&qe.allocUnsafe&&qe.allocUnsafeSlow?ql.exports=Vn:(Ul(Vn,ya),ya.Buffer=Yt);function Yt(e,t,i){return qe(e,t,i)}Ul(qe,Yt);Yt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return qe(e,t,i)};Yt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=qe(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};Yt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return qe(e)};Yt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Vn.SlowBuffer(e)}});var Vt=E(te=>{"use strict";function lh(e){return Array.isArray?Array.isArray(e):Kn(e)==="[object Array]"}te.isArray=lh;function ch(e){return typeof e=="boolean"}te.isBoolean=ch;function dh(e){return e===null}te.isNull=dh;function uh(e){return e==null}te.isNullOrUndefined=uh;function ph(e){return typeof e=="number"}te.isNumber=ph;function fh(e){return typeof e=="string"}te.isString=fh;function hh(e){return typeof e=="symbol"}te.isSymbol=hh;function gh(e){return e===void 0}te.isUndefined=gh;function mh(e){return Kn(e)==="[object RegExp]"}te.isRegExp=mh;function bh(e){return typeof e=="object"&&e!==null}te.isObject=bh;function yh(e){return Kn(e)==="[object Date]"}te.isDate=yh;function vh(e){return Kn(e)==="[object Error]"||e instanceof Error}te.isError=vh;function xh(e){return typeof e=="function"}te.isFunction=xh;function wh(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}te.isPrimitive=wh;te.isBuffer=require("buffer").Buffer.isBuffer;function Kn(e){return Object.prototype.toString.call(e)}});var Gl=E((uw,va)=>{"use strict";typeof Object.create=="function"?va.exports=function(t,i){i&&(t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:va.exports=function(t,i){if(i){t.super_=i;var n=function(){};n.prototype=i.prototype,t.prototype=new n,t.prototype.constructor=t}}});var Kt=E((pw,wa)=>{"use strict";try{if(xa=require("util"),typeof xa.inherits!="function")throw"";wa.exports=xa.inherits}catch{wa.exports=Gl()}var xa});var Yl=E((fw,_a)=>{"use strict";function _h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Wl=qi().Buffer,Gi=require("util");function Eh(e,t,i){e.copy(t,i)}_a.exports=(function(){function e(){_h(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(i){var n={data:i,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(i){var n={data:i,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(this.length!==0){var i=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,i}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(i){if(this.length===0)return"";for(var n=this.head,r=""+n.data;n=n.next;)r+=i+n.data;return r},e.prototype.concat=function(i){if(this.length===0)return Wl.alloc(0);for(var n=Wl.allocUnsafe(i>>>0),r=this.head,a=0;r;)Eh(r.data,n,a),a+=r.data.length,r=r.next;return n},e})();Gi&&Gi.inspect&&Gi.inspect.custom&&(_a.exports.prototype[Gi.inspect.custom]=function(){var e=Gi.inspect({length:this.length});return this.constructor.name+" "+e})});var Ea=E((hw,Vl)=>{"use strict";var Xn=Ui();function Sh(e,t){var i=this,n=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return n||r?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Xn.nextTick(Zn,this,e)):Xn.nextTick(Zn,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,Xn.nextTick(Zn,i,a)):Xn.nextTick(Zn,i,a):t&&t(a)}),this)}function Ah(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Zn(e,t){e.emit("error",t)}Vl.exports={destroy:Sh,undestroy:Ah}});var Xl=E((gw,Kl)=>{"use strict";Kl.exports=require("util").deprecate});var Aa=E((mw,rc)=>{"use strict";var Ct=Ui();rc.exports=V;function Jl(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Uh(t,e)}}var Ch=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Ct.nextTick,Xt;V.WritableState=Yi;var Ql=Object.create(Vt());Ql.inherits=Kt();var Th={deprecate:Xl()},ec=ba(),Qn=qi().Buffer,kh=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Lh(e){return Qn.from(e)}function Oh(e){return Qn.isBuffer(e)||e instanceof kh}var tc=Ea();Ql.inherits(V,ec);function Ih(){}function Yi(e,t){Xt=Xt||Tt(),e=e||{};var i=t instanceof Xt;this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=e.writableHighWaterMark,a=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:i&&(r||r===0)?this.highWaterMark=r:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=e.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){Nh(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Jl(this)}Yi.prototype.getBuffer=function(){for(var t=this.bufferedRequest,i=[];t;)i.push(t),t=t.next;return i};(function(){try{Object.defineProperty(Yi.prototype,"buffer",{get:Th.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Jn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Jn=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(e){return Jn.call(this,e)?!0:this!==V?!1:e&&e._writableState instanceof Yi}})):Jn=function(e){return e instanceof this};function V(e){if(Xt=Xt||Tt(),!Jn.call(V,this)&&!(this instanceof Xt))return new V(e);this._writableState=new Yi(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),ec.call(this)}V.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Mh(e,t){var i=new Error("write after end");e.emit("error",i),Ct.nextTick(t,i)}function Rh(e,t,i,n){var r=!0,a=!1;return i===null?a=new TypeError("May not write null values to stream"):typeof i!="string"&&i!==void 0&&!t.objectMode&&(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),Ct.nextTick(n,a),r=!1),r}V.prototype.write=function(e,t,i){var n=this._writableState,r=!1,a=!n.objectMode&&Oh(e);return a&&!Qn.isBuffer(e)&&(e=Lh(e)),typeof t=="function"&&(i=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof i!="function"&&(i=Ih),n.ended?Mh(this,i):(a||Rh(this,n,e,i))&&(n.pendingcb++,r=jh(this,n,a,e,t,i)),r};V.prototype.cork=function(){var e=this._writableState;e.corked++};V.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&ic(this,e))};V.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function Ph(e,t,i){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Qn.from(t,i)),t}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function jh(e,t,i,n,r,a){if(!i){var s=Ph(t,n,r);n!==s&&(i=!0,r="buffer",n=s)}var o=t.objectMode?1:n.length;t.length+=o;var d=t.length<t.highWaterMark;if(d||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Sa(e,t,!1,o,n,r,a);return d}function Sa(e,t,i,n,r,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,i?e._writev(r,t.onwrite):e._write(r,a,t.onwrite),t.sync=!1}function Dh(e,t,i,n,r){--t.pendingcb,i?(Ct.nextTick(r,n),Ct.nextTick(Wi,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(r(n),e._writableState.errorEmitted=!0,e.emit("error",n),Wi(e,t))}function zh(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function Nh(e,t){var i=e._writableState,n=i.sync,r=i.writecb;if(zh(i),t)Dh(e,i,n,t,r);else{var a=nc(i);!a&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&ic(e,i),n?Ch(Zl,e,i,a,r):Zl(e,i,a,r)}}function Zl(e,t,i,n){i||Bh(e,t),t.pendingcb--,n(),Wi(e,t)}function Bh(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function ic(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,r=new Array(n),a=t.corkedRequestsFree;a.entry=i;for(var s=0,o=!0;i;)r[s]=i,i.isBuf||(o=!1),i=i.next,s+=1;r.allBuffers=o,Sa(e,t,!0,t.length,r,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Jl(t),t.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,c=i.callback,f=t.objectMode?1:d.length;if(Sa(e,t,!1,f,d,l,c),i=i.next,t.bufferedRequestCount--,t.writing)break}i===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}V.prototype._write=function(e,t,i){i(new Error("_write() is not implemented"))};V.prototype._writev=null;V.prototype.end=function(e,t,i){var n=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||$h(this,n,i)};function nc(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function Fh(e,t){e._final(function(i){t.pendingcb--,i&&e.emit("error",i),t.prefinished=!0,e.emit("prefinish"),Wi(e,t)})}function Hh(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Ct.nextTick(Fh,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Wi(e,t){var i=nc(t);return i&&(Hh(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),i}function $h(e,t,i){t.ending=!0,Wi(e,t),i&&(t.finished?Ct.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}function Uh(e,t,i){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(i),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(V.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});V.prototype.destroy=tc.destroy;V.prototype._undestroy=tc.undestroy;V.prototype._destroy=function(e,t){this.end(),t(e)}});var Tt=E((bw,lc)=>{"use strict";var ac=Ui(),qh=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};lc.exports=Ge;var sc=Object.create(Vt());sc.inherits=Kt();var oc=ka(),Ta=Aa();sc.inherits(Ge,oc);for(Ca=qh(Ta.prototype),er=0;er<Ca.length;er++)tr=Ca[er],Ge.prototype[tr]||(Ge.prototype[tr]=Ta.prototype[tr]);var Ca,tr,er;function Ge(e){if(!(this instanceof Ge))return new Ge(e);oc.call(this,e),Ta.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",Gh)}Object.defineProperty(Ge.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Gh(){this.allowHalfOpen||this._writableState.ended||ac.nextTick(Wh,this)}function Wh(e){e.end()}Object.defineProperty(Ge.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});Ge.prototype._destroy=function(e,t){this.push(null),this.end(),ac.nextTick(t,e)}});var Ia=E(dc=>{"use strict";var Oa=qi().Buffer,cc=Oa.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Yh(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Vh(e){var t=Yh(e);if(typeof t!="string"&&(Oa.isEncoding===cc||!cc(e)))throw new Error("Unknown encoding: "+e);return t||e}dc.StringDecoder=Vi;function Vi(e){this.encoding=Vh(e);var t;switch(this.encoding){case"utf16le":this.text=eg,this.end=tg,t=4;break;case"utf8":this.fillLast=Zh,t=4;break;case"base64":this.text=ig,this.end=ng,t=3;break;default:this.write=rg,this.end=ag;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Oa.allocUnsafe(t)}Vi.prototype.write=function(e){if(e.length===0)return"";var t,i;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""};Vi.prototype.end=Qh;Vi.prototype.text=Jh;Vi.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function La(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Kh(e,t,i){var n=t.length-1;if(n<i)return 0;var r=La(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=La(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=La(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}function Xh(e,t,i){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Zh(e){var t=this.lastTotal-this.lastNeed,i=Xh(this,e,t);if(i!==void 0)return i;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Jh(e,t){var i=Kh(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function Qh(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function eg(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function tg(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function ig(e,t){var i=(e.length-t)%3;return i===0?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function ng(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function rg(e){return e.toString(this.encoding)}function ag(e){return e&&e.length?this.write(e):""}});var ka=E((xw,_c)=>{"use strict";var Jt=Ui();_c.exports=F;var sg=Hl(),Ki;F.ReadableState=bc;var vw=require("events").EventEmitter,hc=function(e,t){return e.listeners(t).length},Da=ba(),Xi=qi().Buffer,og=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function lg(e){return Xi.from(e)}function cg(e){return Xi.isBuffer(e)||e instanceof og}var gc=Object.create(Vt());gc.inherits=Kt();var Ma=require("util"),j=void 0;Ma&&Ma.debuglog?j=Ma.debuglog("stream"):j=function(){};var dg=Yl(),mc=Ea(),Zt;gc.inherits(F,Da);var Ra=["error","close","destroy","pause","resume"];function ug(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):sg(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}function bc(e,t){Ki=Ki||Tt(),e=e||{};var i=t instanceof Ki;this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=e.readableHighWaterMark,a=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:i&&(r||r===0)?this.highWaterMark=r:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new dg,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Zt||(Zt=Ia().StringDecoder),this.decoder=new Zt(e.encoding),this.encoding=e.encoding)}function F(e){if(Ki=Ki||Tt(),!(this instanceof F))return new F(e);this._readableState=new bc(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Da.call(this)}Object.defineProperty(F.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});F.prototype.destroy=mc.destroy;F.prototype._undestroy=mc.undestroy;F.prototype._destroy=function(e,t){this.push(null),t(e)};F.prototype.push=function(e,t){var i=this._readableState,n;return i.objectMode?n=!0:typeof e=="string"&&(t=t||i.defaultEncoding,t!==i.encoding&&(e=Xi.from(e,t),t=""),n=!0),yc(this,e,t,!1,n)};F.prototype.unshift=function(e){return yc(this,e,null,!0,!1)};function yc(e,t,i,n,r){var a=e._readableState;if(t===null)a.reading=!1,gg(e,a);else{var s;r||(s=pg(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Xi.prototype&&(t=lg(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Pa(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!i?(t=a.decoder.write(t),a.objectMode||t.length!==0?Pa(e,a,t,!1):vc(e,a)):Pa(e,a,t,!1))):n||(a.reading=!1)}return fg(a)}function Pa(e,t,i,n){t.flowing&&t.length===0&&!t.sync?(e.emit("data",i),e.read(0)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&ir(e)),vc(e,t)}function pg(e,t){var i;return!cg(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i}function fg(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}F.prototype.isPaused=function(){return this._readableState.flowing===!1};F.prototype.setEncoding=function(e){return Zt||(Zt=Ia().StringDecoder),this._readableState.decoder=new Zt(e),this._readableState.encoding=e,this};var uc=8388608;function hg(e){return e>=uc?e=uc:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function pc(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=hg(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}F.prototype.read=function(e){j("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return j("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ja(this):ir(this),null;if(e=pc(e,t),e===0&&t.ended)return t.length===0&&ja(this),null;var n=t.needReadable;j("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,j("length less than watermark",n)),t.ended||t.reading?(n=!1,j("reading or ended",n)):n&&(j("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=pc(i,t)));var r;return e>0?r=xc(e,t):r=null,r===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&ja(this)),r!==null&&this.emit("data",r),r};function gg(e,t){if(!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,ir(e)}}function ir(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(j("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Jt.nextTick(fc,e):fc(e))}function fc(e){j("emit readable"),e.emit("readable"),za(e)}function vc(e,t){t.readingMore||(t.readingMore=!0,Jt.nextTick(mg,e,t))}function mg(e,t){for(var i=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(j("maybeReadMore read 0"),e.read(0),i!==t.length);)i=t.length;t.readingMore=!1}F.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};F.prototype.pipe=function(e,t){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,j("pipe count=%d opts=%j",n.pipesCount,t);var r=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=r?o:w;n.endEmitted?Jt.nextTick(a):i.once("end",a),e.on("unpipe",s);function s(g,h){j("onunpipe"),g===i&&h&&h.hasUnpiped===!1&&(h.hasUnpiped=!0,c())}function o(){j("onend"),e.end()}var d=bg(i);e.on("drain",d);var l=!1;function c(){j("cleanup"),e.removeListener("close",v),e.removeListener("finish",m),e.removeListener("drain",d),e.removeListener("error",p),e.removeListener("unpipe",s),i.removeListener("end",o),i.removeListener("end",w),i.removeListener("data",u),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var f=!1;i.on("data",u);function u(g){j("ondata"),f=!1;var h=e.write(g);h===!1&&!f&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&wc(n.pipes,e)!==-1)&&!l&&(j("false write response, pause",n.awaitDrain),n.awaitDrain++,f=!0),i.pause())}function p(g){j("onerror",g),w(),e.removeListener("error",p),hc(e,"error")===0&&e.emit("error",g)}ug(e,"error",p);function v(){e.removeListener("finish",m),w()}e.once("close",v);function m(){j("onfinish"),e.removeListener("close",v),w()}e.once("finish",m);function w(){j("unpipe"),i.unpipe(e)}return e.emit("pipe",i),n.flowing||(j("pipe resume"),i.resume()),e};function bg(e){return function(){var t=e._readableState;j("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&hc(e,"data")&&(t.flowing=!0,za(e))}}F.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<r;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=wc(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i),this)};F.prototype.on=function(e,t){var i=Da.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&ir(this):Jt.nextTick(yg,this))}return i};F.prototype.addListener=F.prototype.on;function yg(e){j("readable nexttick read 0"),e.read(0)}F.prototype.resume=function(){var e=this._readableState;return e.flowing||(j("resume"),e.flowing=!0,vg(this,e)),this};function vg(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Jt.nextTick(xg,e,t))}function xg(e,t){t.reading||(j("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),za(e),t.flowing&&!t.reading&&e.read(0)}F.prototype.pause=function(){return j("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(j("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function za(e){var t=e._readableState;for(j("flow",t.flowing);t.flowing&&e.read()!==null;);}F.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;e.on("end",function(){if(j("wrapped end"),i.decoder&&!i.ended){var s=i.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(j("wrapped data"),i.decoder&&(s=i.decoder.write(s)),!(i.objectMode&&s==null)&&!(!i.objectMode&&(!s||!s.length))){var o=t.push(s);o||(n=!0,e.pause())}});for(var r in e)this[r]===void 0&&typeof e[r]=="function"&&(this[r]=(function(s){return function(){return e[s].apply(e,arguments)}})(r));for(var a=0;a<Ra.length;a++)e.on(Ra[a],this.emit.bind(this,Ra[a]));return this._read=function(s){j("wrapped _read",s),n&&(n=!1,e.resume())},this};Object.defineProperty(F.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});F._fromList=xc;function xc(e,t){if(t.length===0)return null;var i;return t.objectMode?i=t.buffer.shift():!e||e>=t.length?(t.decoder?i=t.buffer.join(""):t.buffer.length===1?i=t.buffer.head.data:i=t.buffer.concat(t.length),t.buffer.clear()):i=wg(e,t.buffer,t.decoder),i}function wg(e,t,i){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=i?_g(e,t):Eg(e,t),n}function _g(e,t){var i=t.head,n=1,r=i.data;for(e-=r.length;i=i.next;){var a=i.data,s=e>a.length?a.length:e;if(s===a.length?r+=a:r+=a.slice(0,e),e-=s,e===0){s===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=a.slice(s));break}++n}return t.length-=n,r}function Eg(e,t){var i=Xi.allocUnsafe(e),n=t.head,r=1;for(n.data.copy(i),e-=n.data.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(a.copy(i,i.length-e,0,s),e-=s,e===0){s===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++r}return t.length-=r,i}function ja(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Jt.nextTick(Sg,t,e))}function Sg(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function wc(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}});var Na=E((ww,Ac)=>{"use strict";Ac.exports=We;var nr=Tt(),Sc=Object.create(Vt());Sc.inherits=Kt();Sc.inherits(We,nr);function Ag(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,t!=null&&this.push(t),n(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function We(e){if(!(this instanceof We))return new We(e);nr.call(this,e),this._transformState={afterTransform:Ag.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Cg)}function Cg(){var e=this;typeof this._flush=="function"?this._flush(function(t,i){Ec(e,t,i)}):Ec(this,null,null)}We.prototype.push=function(e,t){return this._transformState.needTransform=!1,nr.prototype.push.call(this,e,t)};We.prototype._transform=function(e,t,i){throw new Error("_transform() is not implemented")};We.prototype._write=function(e,t,i){var n=this._transformState;if(n.writecb=i,n.writechunk=e,n.writeencoding=t,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}};We.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};We.prototype._destroy=function(e,t){var i=this;nr.prototype._destroy.call(this,e,function(n){t(n),i.emit("close")})};function Ec(e,t,i){if(t)return e.emit("error",t);if(i!=null&&e.push(i),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Lc=E((_w,kc)=>{"use strict";kc.exports=Zi;var Cc=Na(),Tc=Object.create(Vt());Tc.inherits=Kt();Tc.inherits(Zi,Cc);function Zi(e){if(!(this instanceof Zi))return new Zi(e);Cc.call(this,e)}Zi.prototype._transform=function(e,t,i){i(null,e)}});var Ba=E((Q,rr)=>{"use strict";var Me=require("stream");process.env.READABLE_STREAM==="disable"&&Me?(rr.exports=Me,Q=rr.exports=Me.Readable,Q.Readable=Me.Readable,Q.Writable=Me.Writable,Q.Duplex=Me.Duplex,Q.Transform=Me.Transform,Q.PassThrough=Me.PassThrough,Q.Stream=Me):(Q=rr.exports=ka(),Q.Stream=Me||Q,Q.Readable=Q,Q.Writable=Aa(),Q.Duplex=Tt(),Q.Transform=Na(),Q.PassThrough=Lc())});var Ye=E(ce=>{"use strict";ce.base64=!0;ce.array=!0;ce.string=!0;ce.arraybuffer=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined";ce.nodebuffer=typeof Buffer!="undefined";ce.uint8array=typeof Uint8Array!="undefined";if(typeof ArrayBuffer=="undefined")ce.blob=!1;else{Fa=new ArrayBuffer(0);try{ce.blob=new Blob([Fa],{type:"application/zip"}).size===0}catch{try{Oc=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,Ha=new Oc,Ha.append(Fa),ce.blob=Ha.getBlob("application/zip").size===0}catch{ce.blob=!1}}}var Fa,Oc,Ha;try{ce.nodestream=!!Ba().Readable}catch{ce.nodestream=!1}});var Ua=E($a=>{"use strict";var Tg=$(),kg=Ye(),Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";$a.encode=function(e){for(var t=[],i,n,r,a,s,o,d,l=0,c=e.length,f=c,u=Tg.getTypeOf(e)!=="string";l<e.length;)f=c-l,u?(i=e[l++],n=l<c?e[l++]:0,r=l<c?e[l++]:0):(i=e.charCodeAt(l++),n=l<c?e.charCodeAt(l++):0,r=l<c?e.charCodeAt(l++):0),a=i>>2,s=(i&3)<<4|n>>4,o=f>1?(n&15)<<2|r>>6:64,d=f>2?r&63:64,t.push(Re.charAt(a)+Re.charAt(s)+Re.charAt(o)+Re.charAt(d));return t.join("")};$a.decode=function(e){var t,i,n,r,a,s,o,d=0,l=0,c="data:";if(e.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");e=e.replace(/[^A-Za-z0-9+/=]/g,"");var f=e.length*3/4;if(e.charAt(e.length-1)===Re.charAt(64)&&f--,e.charAt(e.length-2)===Re.charAt(64)&&f--,f%1!==0)throw new Error("Invalid base64 input, bad content length.");var u;for(kg.uint8array?u=new Uint8Array(f|0):u=new Array(f|0);d<e.length;)r=Re.indexOf(e.charAt(d++)),a=Re.indexOf(e.charAt(d++)),s=Re.indexOf(e.charAt(d++)),o=Re.indexOf(e.charAt(d++)),t=r<<2|a>>4,i=(a&15)<<4|s>>2,n=(s&3)<<6|o,u[l++]=t,s!==64&&(u[l++]=i),o!==64&&(u[l++]=n);return u}});var Ji=E((Aw,Ic)=>{"use strict";Ic.exports={isNode:typeof Buffer!="undefined",newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e=="number")throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on=="function"&&typeof e.pause=="function"&&typeof e.resume=="function"}}});var jc=E((Cw,Pc)=>{"use strict";var Mc=global.MutationObserver||global.WebKitMutationObserver,Qt;process.browser?Mc?(qa=0,Rc=new Mc(Qi),Ga=global.document.createTextNode(""),Rc.observe(Ga,{characterData:!0}),Qt=function(){Ga.data=qa=++qa%2}):!global.setImmediate&&typeof global.MessageChannel!="undefined"?(Wa=new global.MessageChannel,Wa.port1.onmessage=Qi,Qt=function(){Wa.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?Qt=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){Qi(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:Qt=function(){setTimeout(Qi,0)}:Qt=function(){process.nextTick(Qi)};var qa,Rc,Ga,Wa,Ya,en=[];function Qi(){Ya=!0;for(var e,t,i=en.length;i;){for(t=en,en=[],e=-1;++e<i;)t[e]();i=en.length}Ya=!1}Pc.exports=Lg;function Lg(e){en.push(e)===1&&!Ya&&Qt()}});var $c=E((Tw,Hc)=>{"use strict";var Dc=jc();function ei(){}var ie={},zc=["REJECTED"],Va=["FULFILLED"],Nc=["PENDING"];process.browser||(tn=["UNHANDLED"]);var tn;Hc.exports=lt;function lt(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=Nc,this.queue=[],this.outcome=void 0,process.browser||(this.handled=tn),e!==ei&&Bc(this,e)}lt.prototype.finally=function(e){if(typeof e!="function")return this;var t=this.constructor;return this.then(i,n);function i(r){function a(){return r}return t.resolve(e()).then(a)}function n(r){function a(){throw r}return t.resolve(e()).then(a)}};lt.prototype.catch=function(e){return this.then(null,e)};lt.prototype.then=function(e,t){if(typeof e!="function"&&this.state===Va||typeof t!="function"&&this.state===zc)return this;var i=new this.constructor(ei);if(process.browser||this.handled===tn&&(this.handled=null),this.state!==Nc){var n=this.state===Va?e:t;Ka(i,n,this.outcome)}else this.queue.push(new nn(i,e,t));return i};function nn(e,t,i){this.promise=e,typeof t=="function"&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof i=="function"&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}nn.prototype.callFulfilled=function(e){ie.resolve(this.promise,e)};nn.prototype.otherCallFulfilled=function(e){Ka(this.promise,this.onFulfilled,e)};nn.prototype.callRejected=function(e){ie.reject(this.promise,e)};nn.prototype.otherCallRejected=function(e){Ka(this.promise,this.onRejected,e)};function Ka(e,t,i){Dc(function(){var n;try{n=t(i)}catch(r){return ie.reject(e,r)}n===e?ie.reject(e,new TypeError("Cannot resolve promise with itself")):ie.resolve(e,n)})}ie.resolve=function(e,t){var i=Fc(Og,t);if(i.status==="error")return ie.reject(e,i.value);var n=i.value;if(n)Bc(e,n);else{e.state=Va,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e};ie.reject=function(e,t){e.state=zc,e.outcome=t,process.browser||e.handled===tn&&Dc(function(){e.handled===tn&&process.emit("unhandledRejection",t,e)});for(var i=-1,n=e.queue.length;++i<n;)e.queue[i].callRejected(t);return e};function Og(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function Bc(e,t){var i=!1;function n(o){i||(i=!0,ie.reject(e,o))}function r(o){i||(i=!0,ie.resolve(e,o))}function a(){t(r,n)}var s=Fc(a);s.status==="error"&&n(s.value)}function Fc(e,t){var i={};try{i.value=e(t),i.status="success"}catch(n){i.status="error",i.value=n}return i}lt.resolve=Ig;function Ig(e){return e instanceof this?e:ie.resolve(new this(ei),e)}lt.reject=Mg;function Mg(e){var t=new this(ei);return ie.reject(t,e)}lt.all=Rg;function Rg(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var i=e.length,n=!1;if(!i)return this.resolve([]);for(var r=new Array(i),a=0,s=-1,o=new this(ei);++s<i;)d(e[s],s);return o;function d(l,c){t.resolve(l).then(f,function(u){n||(n=!0,ie.reject(o,u))});function f(u){r[c]=u,++a===i&&!n&&(n=!0,ie.resolve(o,r))}}}lt.race=Pg;function Pg(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var i=e.length,n=!1;if(!i)return this.resolve([]);for(var r=-1,a=new this(ei);++r<i;)s(e[r]);return a;function s(o){t.resolve(o).then(function(d){n||(n=!0,ie.resolve(a,d))},function(d){n||(n=!0,ie.reject(a,d))})}}});var ti=E((kw,Uc)=>{"use strict";var Xa=null;typeof Promise!="undefined"?Xa=Promise:Xa=$c();Uc.exports={Promise:Xa}});var Gc=E(qc=>{"use strict";(function(e,t){"use strict";if(e.setImmediate)return;var i=1,n={},r=!1,a=e.document,s;function o(h){typeof h!="function"&&(h=new Function(""+h));for(var x=new Array(arguments.length-1),y=0;y<x.length;y++)x[y]=arguments[y+1];var b={callback:h,args:x};return n[i]=b,s(i),i++}function d(h){delete n[h]}function l(h){var x=h.callback,y=h.args;switch(y.length){case 0:x();break;case 1:x(y[0]);break;case 2:x(y[0],y[1]);break;case 3:x(y[0],y[1],y[2]);break;default:x.apply(t,y);break}}function c(h){if(r)setTimeout(c,0,h);else{var x=n[h];if(x){r=!0;try{l(x)}finally{d(h),r=!1}}}}function f(){s=function(h){process.nextTick(function(){c(h)})}}function u(){if(e.postMessage&&!e.importScripts){var h=!0,x=e.onmessage;return e.onmessage=function(){h=!1},e.postMessage("","*"),e.onmessage=x,h}}function p(){var h="setImmediate$"+Math.random()+"$",x=function(y){y.source===e&&typeof y.data=="string"&&y.data.indexOf(h)===0&&c(+y.data.slice(h.length))};e.addEventListener?e.addEventListener("message",x,!1):e.attachEvent("onmessage",x),s=function(y){e.postMessage(h+y,"*")}}function v(){var h=new MessageChannel;h.port1.onmessage=function(x){var y=x.data;c(y)},s=function(x){h.port2.postMessage(x)}}function m(){var h=a.documentElement;s=function(x){var y=a.createElement("script");y.onreadystatechange=function(){c(x),y.onreadystatechange=null,h.removeChild(y),y=null},h.appendChild(y)}}function w(){s=function(h){setTimeout(c,0,h)}}var g=Object.getPrototypeOf&&Object.getPrototypeOf(e);g=g&&g.setTimeout?g:e,{}.toString.call(e.process)==="[object process]"?f():u()?p():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?m():w(),g.setImmediate=o,g.clearImmediate=d})(typeof self=="undefined"?typeof global=="undefined"?qc:global:self)});var $=E(K=>{"use strict";var ct=Ye(),jg=Ua(),ii=Ji(),Za=ti();Gc();function Dg(e){var t=null;return ct.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),sr(e,t)}K.newBlob=function(e,t){K.checkSupport("blob");try{return new Blob([e],{type:t})}catch{try{var i=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,n=new i;return n.append(e),n.getBlob(t)}catch{throw new Error("Bug : can't construct the Blob.")}}};function rn(e){return e}function sr(e,t){for(var i=0;i<e.length;++i)t[i]=e.charCodeAt(i)&255;return t}var ar={stringifyByChunk:function(e,t,i){var n=[],r=0,a=e.length;if(a<=i)return String.fromCharCode.apply(null,e);for(;r<a;)t==="array"||t==="nodebuffer"?n.push(String.fromCharCode.apply(null,e.slice(r,Math.min(r+i,a)))):n.push(String.fromCharCode.apply(null,e.subarray(r,Math.min(r+i,a)))),r+=i;return n.join("")},stringifyByChar:function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},applyCanBeUsed:{uint8array:(function(){try{return ct.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return ct.nodebuffer&&String.fromCharCode.apply(null,ii.allocBuffer(1)).length===1}catch{return!1}})()}};function an(e){var t=65536,i=K.getTypeOf(e),n=!0;if(i==="uint8array"?n=ar.applyCanBeUsed.uint8array:i==="nodebuffer"&&(n=ar.applyCanBeUsed.nodebuffer),n)for(;t>1;)try{return ar.stringifyByChunk(e,i,t)}catch{t=Math.floor(t/2)}return ar.stringifyByChar(e)}K.applyFromCharCode=an;function or(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}var dt={};dt.string={string:rn,array:function(e){return sr(e,new Array(e.length))},arraybuffer:function(e){return dt.string.uint8array(e).buffer},uint8array:function(e){return sr(e,new Uint8Array(e.length))},nodebuffer:function(e){return sr(e,ii.allocBuffer(e.length))}};dt.array={string:an,array:rn,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return ii.newBufferFrom(e)}};dt.arraybuffer={string:function(e){return an(new Uint8Array(e))},array:function(e){return or(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:rn,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return ii.newBufferFrom(new Uint8Array(e))}};dt.uint8array={string:an,array:function(e){return or(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:rn,nodebuffer:function(e){return ii.newBufferFrom(e)}};dt.nodebuffer={string:an,array:function(e){return or(e,new Array(e.length))},arraybuffer:function(e){return dt.nodebuffer.uint8array(e).buffer},uint8array:function(e){return or(e,new Uint8Array(e.length))},nodebuffer:rn};K.transformTo=function(e,t){if(t||(t=""),!e)return t;K.checkSupport(e);var i=K.getTypeOf(t),n=dt[i][e](t);return n};K.resolve=function(e){for(var t=e.split("/"),i=[],n=0;n<t.length;n++){var r=t[n];r==="."||r===""&&n!==0&&n!==t.length-1||(r===".."?i.pop():i.push(r))}return i.join("/")};K.getTypeOf=function(e){if(typeof e=="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(ct.nodebuffer&&ii.isBuffer(e))return"nodebuffer";if(ct.uint8array&&e instanceof Uint8Array)return"uint8array";if(ct.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"};K.checkSupport=function(e){var t=ct[e.toLowerCase()];if(!t)throw new Error(e+" is not supported by this platform")};K.MAX_VALUE_16BITS=65535;K.MAX_VALUE_32BITS=-1;K.pretty=function(e){var t="",i,n;for(n=0;n<(e||"").length;n++)i=e.charCodeAt(n),t+="\\x"+(i<16?"0":"")+i.toString(16).toUpperCase();return t};K.delay=function(e,t,i){setImmediate(function(){e.apply(i||null,t||[])})};K.inherits=function(e,t){var i=function(){};i.prototype=t.prototype,e.prototype=new i};K.extend=function(){var e={},t,i;for(t=0;t<arguments.length;t++)for(i in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],i)&&typeof e[i]=="undefined"&&(e[i]=arguments[t][i]);return e};K.prepareContent=function(e,t,i,n,r){var a=Za.Promise.resolve(t).then(function(s){var o=ct.blob&&(s instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(s))!==-1);return o&&typeof FileReader!="undefined"?new Za.Promise(function(d,l){var c=new FileReader;c.onload=function(f){d(f.target.result)},c.onerror=function(f){l(f.target.error)},c.readAsArrayBuffer(s)}):s});return a.then(function(s){var o=K.getTypeOf(s);return o?(o==="arraybuffer"?s=K.transformTo("uint8array",s):o==="string"&&(r?s=jg.decode(s):i&&n!==!0&&(s=Dg(s))),s):Za.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var de=E((Iw,Yc)=>{"use strict";function Wc(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}Wc.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return this.isFinished?!1:(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var i=0;i<this._listeners[e].length;i++)this._listeners[e][i].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(i){t.processChunk(i)}),e.on("end",function(){t.end()}),e.on("error",function(i){t.error(i)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};Yc.exports=Wc});var ri=E(ut=>{"use strict";var ni=$(),kt=Ye(),zg=Ji(),lr=de(),sn=new Array(256);for(Ve=0;Ve<256;Ve++)sn[Ve]=Ve>=252?6:Ve>=248?5:Ve>=240?4:Ve>=224?3:Ve>=192?2:1;var Ve;sn[254]=sn[254]=1;var Ng=function(e){var t,i,n,r,a,s=e.length,o=0;for(r=0;r<s;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(kt.uint8array?t=new Uint8Array(o):t=new Array(o),a=0,r=0;a<o;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|i&63):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|i&63):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|i&63);return t},Bg=function(e,t){var i;for(t=t||e.length,t>e.length&&(t=e.length),i=t-1;i>=0&&(e[i]&192)===128;)i--;return i<0||i===0?t:i+sn[e[i]]>t?i:t},Fg=function(e){var t,i,n,r,a=e.length,s=new Array(a*2);for(i=0,t=0;t<a;){if(n=e[t++],n<128){s[i++]=n;continue}if(r=sn[n],r>4){s[i++]=65533,t+=r-1;continue}for(n&=r===2?31:r===3?15:7;r>1&&t<a;)n=n<<6|e[t++]&63,r--;if(r>1){s[i++]=65533;continue}n<65536?s[i++]=n:(n-=65536,s[i++]=55296|n>>10&1023,s[i++]=56320|n&1023)}return s.length!==i&&(s.subarray?s=s.subarray(0,i):s.length=i),ni.applyFromCharCode(s)};ut.utf8encode=function(t){return kt.nodebuffer?zg.newBufferFrom(t,"utf-8"):Ng(t)};ut.utf8decode=function(t){return kt.nodebuffer?ni.transformTo("nodebuffer",t).toString("utf-8"):(t=ni.transformTo(kt.uint8array?"uint8array":"array",t),Fg(t))};function cr(){lr.call(this,"utf-8 decode"),this.leftOver=null}ni.inherits(cr,lr);cr.prototype.processChunk=function(e){var t=ni.transformTo(kt.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(kt.uint8array){var i=t;t=new Uint8Array(i.length+this.leftOver.length),t.set(this.leftOver,0),t.set(i,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=Bg(t),r=t;n!==t.length&&(kt.uint8array?(r=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(r=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:ut.utf8decode(r),meta:e.meta})};cr.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:ut.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};ut.Utf8DecodeWorker=cr;function Ja(){lr.call(this,"utf-8 encode")}ni.inherits(Ja,lr);Ja.prototype.processChunk=function(e){this.push({data:ut.utf8encode(e.data),meta:e.meta})};ut.Utf8EncodeWorker=Ja});var Zc=E((Rw,Xc)=>{"use strict";var Vc=de(),Kc=$();function Qa(e){Vc.call(this,"ConvertWorker to "+e),this.destType=e}Kc.inherits(Qa,Vc);Qa.prototype.processChunk=function(e){this.push({data:Kc.transformTo(this.destType,e.data),meta:e.meta})};Xc.exports=Qa});var ed=E((Pw,Qc)=>{"use strict";var Jc=Ba().Readable,Hg=$();Hg.inherits(es,Jc);function es(e,t,i){Jc.call(this,t),this._helper=e;var n=this;e.on("data",function(r,a){n.push(r)||n._helper.pause(),i&&i(a)}).on("error",function(r){n.emit("error",r)}).on("end",function(){n.push(null)})}es.prototype._read=function(){this._helper.resume()};Qc.exports=es});var ts=E((jw,nd)=>{"use strict";var Lt=$(),$g=Zc(),Ug=de(),qg=Ua(),Gg=Ye(),Wg=ti(),td=null;if(Gg.nodestream)try{td=ed()}catch{}function Yg(e,t,i){switch(e){case"blob":return Lt.newBlob(Lt.transformTo("arraybuffer",t),i);case"base64":return qg.encode(t);default:return Lt.transformTo(e,t)}}function Vg(e,t){var i,n=0,r=null,a=0;for(i=0;i<t.length;i++)a+=t[i].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(r=new Uint8Array(a),i=0;i<t.length;i++)r.set(t[i],n),n+=t[i].length;return r;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}function Kg(e,t){return new Wg.Promise(function(i,n){var r=[],a=e._internalType,s=e._outputType,o=e._mimeType;e.on("data",function(d,l){r.push(d),t&&t(l)}).on("error",function(d){r=[],n(d)}).on("end",function(){try{var d=Yg(s,Vg(a,r),o);i(d)}catch(l){n(l)}r=[]}).resume()})}function id(e,t,i){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string";break}try{this._internalType=n,this._outputType=t,this._mimeType=i,Lt.checkSupport(n),this._worker=e.pipe(new $g(n)),e.lock()}catch(r){this._worker=new Ug("error"),this._worker.error(r)}}id.prototype={accumulate:function(e){return Kg(this,e)},on:function(e,t){var i=this;return e==="data"?this._worker.on(e,function(n){t.call(i,n.data,n.meta)}):this._worker.on(e,function(){Lt.delay(t,arguments,i)}),this},resume:function(){return Lt.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Lt.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new td(this,{objectMode:this._outputType!=="nodebuffer"},e)}};nd.exports=id});var is=E(Se=>{"use strict";Se.base64=!1;Se.binary=!1;Se.dir=!1;Se.createFolders=!0;Se.date=null;Se.compression=null;Se.compressionOptions=null;Se.comment=null;Se.unixPermissions=null;Se.dosPermissions=null});var ns=E((zw,rd)=>{"use strict";var dr=$(),ur=de(),Xg=16*1024;function ai(e){ur.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(i){t.dataIsReady=!0,t.data=i,t.max=i&&i.length||0,t.type=dr.getTypeOf(i),t.isPaused||t._tickAndRepeat()},function(i){t.error(i)})}dr.inherits(ai,ur);ai.prototype.cleanUp=function(){ur.prototype.cleanUp.call(this),this.data=null};ai.prototype.resume=function(){return ur.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,dr.delay(this._tickAndRepeat,[],this)),!0):!1};ai.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(dr.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};ai.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=Xg,t=null,i=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,i);break;case"uint8array":t=this.data.subarray(this.index,i);break;case"array":case"nodebuffer":t=this.data.slice(this.index,i);break}return this.index=i,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})};rd.exports=ai});var pr=E((Nw,sd)=>{"use strict";var Zg=$();function Jg(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[i]=e}return t}var ad=Jg();function Qg(e,t,i,n){var r=ad,a=n+i;e=e^-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}function em(e,t,i,n){var r=ad,a=n+i;e=e^-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t.charCodeAt(s))&255];return e^-1}sd.exports=function(t,i){if(typeof t=="undefined"||!t.length)return 0;var n=Zg.getTypeOf(t)!=="string";return n?Qg(i|0,t,t.length,0):em(i|0,t,t.length,0)}});var as=E((Bw,ld)=>{"use strict";var od=de(),tm=pr(),im=$();function rs(){od.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}im.inherits(rs,od);rs.prototype.processChunk=function(e){this.streamInfo.crc32=tm(e.data,this.streamInfo.crc32||0),this.push(e)};ld.exports=rs});var dd=E((Fw,cd)=>{"use strict";var nm=$(),ss=de();function os(e){ss.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}nm.inherits(os,ss);os.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}ss.prototype.processChunk.call(this,e)};cd.exports=os});var fr=E((Hw,fd)=>{"use strict";var ud=ti(),pd=ns(),rm=as(),ls=dd();function cs(e,t,i,n,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=n,this.compressedContent=r}cs.prototype={getContentWorker:function(){var e=new pd(ud.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new ls("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new pd(ud.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};cs.createWorkerFrom=function(e,t,i){return e.pipe(new rm).pipe(new ls("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new ls("compressedSize")).withStreamInfo("compression",t)};fd.exports=cs});var bd=E(($w,md)=>{"use strict";var am=ts(),sm=ns(),ds=ri(),us=fr(),hd=de(),ps=function(e,t,i){this.name=e,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=t,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}};ps.prototype={internalStream:function(e){var t=null,i="string";try{if(!e)throw new Error("No output type specified.");i=e.toLowerCase();var n=i==="string"||i==="text";(i==="binarystring"||i==="text")&&(i="string"),t=this._decompressWorker();var r=!this._dataBinary;r&&!n&&(t=t.pipe(new ds.Utf8EncodeWorker)),!r&&n&&(t=t.pipe(new ds.Utf8DecodeWorker))}catch(a){t=new hd("error"),t.error(a)}return new am(t,i,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof us&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new ds.Utf8EncodeWorker)),us.createWorkerFrom(i,e,t)},_decompressWorker:function(){return this._data instanceof us?this._data.getContentWorker():this._data instanceof hd?this._data:new sm(this._data)}};var gd=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],om=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(hr=0;hr<gd.length;hr++)ps.prototype[gd[hr]]=om;var hr;md.exports=ps});var Ke=E(se=>{"use strict";var lm=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function cm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}se.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if(typeof i!="object")throw new TypeError(i+"must be non-object");for(var n in i)cm(i,n)&&(e[n]=i[n])}}return e};se.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var dm={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray){e.set(t.subarray(i,i+n),r);return}for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){var t,i,n,r,a,s;for(n=0,t=0,i=e.length;t<i;t++)n+=e[t].length;for(s=new Uint8Array(n),r=0,t=0,i=e.length;t<i;t++)a=e[t],s.set(a,r),r+=a.length;return s}},um={arraySet:function(e,t,i,n,r){for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){return[].concat.apply([],e)}};se.setTyped=function(e){e?(se.Buf8=Uint8Array,se.Buf16=Uint16Array,se.Buf32=Int32Array,se.assign(se,dm)):(se.Buf8=Array,se.Buf16=Array,se.Buf32=Array,se.assign(se,um))};se.setTyped(lm)});var Fd=E(li=>{"use strict";var pm=Ke(),fm=4,yd=0,vd=1,hm=2;function oi(e){for(var t=e.length;--t>=0;)e[t]=0}var gm=0,Ad=1,mm=2,bm=3,ym=258,vs=29,pn=256,ln=pn+1+vs,si=30,xs=19,Cd=2*ln+1,Ot=15,fs=16,vm=7,ws=256,Td=16,kd=17,Ld=18,bs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],gr=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],xm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Od=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],wm=512,Xe=new Array((ln+2)*2);oi(Xe);var on=new Array(si*2);oi(on);var cn=new Array(wm);oi(cn);var dn=new Array(ym-bm+1);oi(dn);var _s=new Array(vs);oi(_s);var mr=new Array(si);oi(mr);function hs(e,t,i,n,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}var Id,Md,Rd;function gs(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Pd(e){return e<256?cn[e]:cn[256+(e>>>7)]}function un(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function le(e,t,i){e.bi_valid>fs-i?(e.bi_buf|=t<<e.bi_valid&65535,un(e,e.bi_buf),e.bi_buf=t>>fs-e.bi_valid,e.bi_valid+=i-fs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function Pe(e,t,i){le(e,i[t*2],i[t*2+1])}function jd(e,t){var i=0;do i|=e&1,e>>>=1,i<<=1;while(--t>0);return i>>>1}function _m(e){e.bi_valid===16?(un(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Em(e,t){var i=t.dyn_tree,n=t.max_code,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,d=t.stat_desc.max_length,l,c,f,u,p,v,m=0;for(u=0;u<=Ot;u++)e.bl_count[u]=0;for(i[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Cd;l++)c=e.heap[l],u=i[i[c*2+1]*2+1]+1,u>d&&(u=d,m++),i[c*2+1]=u,!(c>n)&&(e.bl_count[u]++,p=0,c>=o&&(p=s[c-o]),v=i[c*2],e.opt_len+=v*(u+p),a&&(e.static_len+=v*(r[c*2+1]+p)));if(m!==0){do{for(u=d-1;e.bl_count[u]===0;)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[d]--,m-=2}while(m>0);for(u=d;u!==0;u--)for(c=e.bl_count[u];c!==0;)f=e.heap[--l],!(f>n)&&(i[f*2+1]!==u&&(e.opt_len+=(u-i[f*2+1])*i[f*2],i[f*2+1]=u),c--)}}function Dd(e,t,i){var n=new Array(Ot+1),r=0,a,s;for(a=1;a<=Ot;a++)n[a]=r=r+i[a-1]<<1;for(s=0;s<=t;s++){var o=e[s*2+1];o!==0&&(e[s*2]=jd(n[o]++,o))}}function Sm(){var e,t,i,n,r,a=new Array(Ot+1);for(i=0,n=0;n<vs-1;n++)for(_s[n]=i,e=0;e<1<<bs[n];e++)dn[i++]=n;for(dn[i-1]=n,r=0,n=0;n<16;n++)for(mr[n]=r,e=0;e<1<<gr[n];e++)cn[r++]=n;for(r>>=7;n<si;n++)for(mr[n]=r<<7,e=0;e<1<<gr[n]-7;e++)cn[256+r++]=n;for(t=0;t<=Ot;t++)a[t]=0;for(e=0;e<=143;)Xe[e*2+1]=8,e++,a[8]++;for(;e<=255;)Xe[e*2+1]=9,e++,a[9]++;for(;e<=279;)Xe[e*2+1]=7,e++,a[7]++;for(;e<=287;)Xe[e*2+1]=8,e++,a[8]++;for(Dd(Xe,ln+1,a),e=0;e<si;e++)on[e*2+1]=5,on[e*2]=jd(e,5);Id=new hs(Xe,bs,pn+1,ln,Ot),Md=new hs(on,gr,0,si,Ot),Rd=new hs(new Array(0),xm,0,xs,vm)}function zd(e){var t;for(t=0;t<ln;t++)e.dyn_ltree[t*2]=0;for(t=0;t<si;t++)e.dyn_dtree[t*2]=0;for(t=0;t<xs;t++)e.bl_tree[t*2]=0;e.dyn_ltree[ws*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Nd(e){e.bi_valid>8?un(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Am(e,t,i,n){Nd(e),n&&(un(e,i),un(e,~i)),pm.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}function xd(e,t,i,n){var r=t*2,a=i*2;return e[r]<e[a]||e[r]===e[a]&&n[t]<=n[i]}function ms(e,t,i){for(var n=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&xd(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!xd(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function wd(e,t,i){var n,r,a=0,s,o;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],r=e.pending_buf[e.l_buf+a],a++,n===0?Pe(e,r,t):(s=dn[r],Pe(e,s+pn+1,t),o=bs[s],o!==0&&(r-=_s[s],le(e,r,o)),n--,s=Pd(n),Pe(e,s,i),o=gr[s],o!==0&&(n-=mr[s],le(e,n,o)));while(a<e.last_lit);Pe(e,ws,t)}function ys(e,t){var i=t.dyn_tree,n=t.stat_desc.static_tree,r=t.stat_desc.has_stree,a=t.stat_desc.elems,s,o,d=-1,l;for(e.heap_len=0,e.heap_max=Cd,s=0;s<a;s++)i[s*2]!==0?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):i[s*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=d<2?++d:0,i[l*2]=1,e.depth[l]=0,e.opt_len--,r&&(e.static_len-=n[l*2+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)ms(e,i,s);l=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ms(e,i,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,i[l*2]=i[s*2]+i[o*2],e.depth[l]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,i[s*2+1]=i[o*2+1]=l,e.heap[1]=l++,ms(e,i,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Em(e,t),Dd(i,d,e.bl_count)}function _d(e,t,i){var n,r=-1,a,s=t[1],o=0,d=7,l=4;for(s===0&&(d=138,l=3),t[(i+1)*2+1]=65535,n=0;n<=i;n++)a=s,s=t[(n+1)*2+1],!(++o<d&&a===s)&&(o<l?e.bl_tree[a*2]+=o:a!==0?(a!==r&&e.bl_tree[a*2]++,e.bl_tree[Td*2]++):o<=10?e.bl_tree[kd*2]++:e.bl_tree[Ld*2]++,o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4))}function Ed(e,t,i){var n,r=-1,a,s=t[1],o=0,d=7,l=4;for(s===0&&(d=138,l=3),n=0;n<=i;n++)if(a=s,s=t[(n+1)*2+1],!(++o<d&&a===s)){if(o<l)do Pe(e,a,e.bl_tree);while(--o!==0);else a!==0?(a!==r&&(Pe(e,a,e.bl_tree),o--),Pe(e,Td,e.bl_tree),le(e,o-3,2)):o<=10?(Pe(e,kd,e.bl_tree),le(e,o-3,3)):(Pe(e,Ld,e.bl_tree),le(e,o-11,7));o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4)}}function Cm(e){var t;for(_d(e,e.dyn_ltree,e.l_desc.max_code),_d(e,e.dyn_dtree,e.d_desc.max_code),ys(e,e.bl_desc),t=xs-1;t>=3&&e.bl_tree[Od[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Tm(e,t,i,n){var r;for(le(e,t-257,5),le(e,i-1,5),le(e,n-4,4),r=0;r<n;r++)le(e,e.bl_tree[Od[r]*2+1],3);Ed(e,e.dyn_ltree,t-1),Ed(e,e.dyn_dtree,i-1)}function km(e){var t=4093624447,i;for(i=0;i<=31;i++,t>>>=1)if(t&1&&e.dyn_ltree[i*2]!==0)return yd;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return vd;for(i=32;i<pn;i++)if(e.dyn_ltree[i*2]!==0)return vd;return yd}var Sd=!1;function Lm(e){Sd||(Sm(),Sd=!0),e.l_desc=new gs(e.dyn_ltree,Id),e.d_desc=new gs(e.dyn_dtree,Md),e.bl_desc=new gs(e.bl_tree,Rd),e.bi_buf=0,e.bi_valid=0,zd(e)}function Bd(e,t,i,n){le(e,(gm<<1)+(n?1:0),3),Am(e,t,i,!0)}function Om(e){le(e,Ad<<1,3),Pe(e,ws,Xe),_m(e)}function Im(e,t,i,n){var r,a,s=0;e.level>0?(e.strm.data_type===hm&&(e.strm.data_type=km(e)),ys(e,e.l_desc),ys(e,e.d_desc),s=Cm(e),r=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=r&&(r=a)):r=a=i+5,i+4<=r&&t!==-1?Bd(e,t,i,n):e.strategy===fm||a===r?(le(e,(Ad<<1)+(n?1:0),3),wd(e,Xe,on)):(le(e,(mm<<1)+(n?1:0),3),Tm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),wd(e,e.dyn_ltree,e.dyn_dtree)),zd(e),n&&Nd(e)}function Mm(e,t,i){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=i&255,e.last_lit++,t===0?e.dyn_ltree[i*2]++:(e.matches++,t--,e.dyn_ltree[(dn[i]+pn+1)*2]++,e.dyn_dtree[Pd(t)*2]++),e.last_lit===e.lit_bufsize-1}li._tr_init=Lm;li._tr_stored_block=Bd;li._tr_flush_block=Im;li._tr_tally=Mm;li._tr_align=Om});var Es=E((Gw,Hd)=>{"use strict";function Rm(e,t,i,n){for(var r=e&65535|0,a=e>>>16&65535|0,s=0;i!==0;){s=i>2e3?2e3:i,i-=s;do r=r+t[n++]|0,a=a+r|0;while(--s);r%=65521,a%=65521}return r|a<<16|0}Hd.exports=Rm});var Ss=E((Ww,$d)=>{"use strict";function Pm(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[i]=e}return t}var jm=Pm();function Dm(e,t,i,n){var r=jm,a=n+i;e^=-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}$d.exports=Dm});var br=E((Yw,Ud)=>{"use strict";Ud.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Jd=E(ze=>{"use strict";var oe=Ke(),be=Fd(),Yd=Es(),pt=Ss(),zm=br(),Pt=0,Nm=1,Bm=3,bt=4,qd=5,De=0,Gd=1,ye=-2,Fm=-3,As=-5,Hm=-1,$m=1,yr=2,Um=3,qm=4,Gm=0,Wm=2,_r=8,Ym=9,Vm=15,Km=8,Xm=29,Zm=256,Ts=Zm+1+Xm,Jm=30,Qm=19,eb=2*Ts+1,tb=15,R=3,gt=258,Ae=gt+R+1,ib=32,Er=42,ks=69,vr=73,xr=91,wr=103,It=113,hn=666,J=1,gn=2,Mt=3,ui=4,nb=3;function mt(e,t){return e.msg=zm[t],t}function Wd(e){return(e<<1)-(e>4?9:0)}function ht(e){for(var t=e.length;--t>=0;)e[t]=0}function ft(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),i!==0&&(oe.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,t.pending===0&&(t.pending_out=0))}function ee(e,t){be._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ft(e.strm)}function P(e,t){e.pending_buf[e.pending++]=t}function fn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function rb(e,t,i,n){var r=e.avail_in;return r>n&&(r=n),r===0?0:(e.avail_in-=r,oe.arraySet(t,e.input,e.next_in,r,i),e.state.wrap===1?e.adler=Yd(e.adler,t,r,i):e.state.wrap===2&&(e.adler=pt(e.adler,t,r,i)),e.next_in+=r,e.total_in+=r,r)}function Vd(e,t){var i=e.max_chain_length,n=e.strstart,r,a,s=e.prev_length,o=e.nice_match,d=e.strstart>e.w_size-Ae?e.strstart-(e.w_size-Ae):0,l=e.window,c=e.w_mask,f=e.prev,u=e.strstart+gt,p=l[n+s-1],v=l[n+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do if(r=t,!(l[r+s]!==v||l[r+s-1]!==p||l[r]!==l[n]||l[++r]!==l[n+1])){n+=2,r++;do;while(l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&n<u);if(a=gt-(u-n),n=u-gt,a>s){if(e.match_start=t,s=a,a>=o)break;p=l[n+s-1],v=l[n+s]}}while((t=f[t&c])>d&&--i!==0);return s<=e.lookahead?s:e.lookahead}function Rt(e){var t=e.w_size,i,n,r,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ae)){oe.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,i=n;do r=e.head[--i],e.head[i]=r>=t?r-t:0;while(--n);n=t,i=n;do r=e.prev[--i],e.prev[i]=r>=t?r-t:0;while(--n);a+=t}if(e.strm.avail_in===0)break;if(n=rb(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=R)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+R-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<R)););}while(e.lookahead<Ae&&e.strm.avail_in!==0)}function ab(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Rt(e),e.lookahead===0&&t===Pt)return J;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,ee(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Ae&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):(e.strstart>e.block_start&&(ee(e,!1),e.strm.avail_out===0),J)}function Cs(e,t){for(var i,n;;){if(e.lookahead<Ae){if(Rt(e),e.lookahead<Ae&&t===Pt)return J;if(e.lookahead===0)break}if(i=0,e.lookahead>=R&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),i!==0&&e.strstart-i<=e.w_size-Ae&&(e.match_length=Vd(e,i)),e.match_length>=R)if(n=be._tr_tally(e,e.strstart-e.match_start,e.match_length-R),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=R){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=be._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=e.strstart<R-1?e.strstart:R-1,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:gn}function ci(e,t){for(var i,n,r;;){if(e.lookahead<Ae){if(Rt(e),e.lookahead<Ae&&t===Pt)return J;if(e.lookahead===0)break}if(i=0,e.lookahead>=R&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=R-1,i!==0&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-Ae&&(e.match_length=Vd(e,i),e.match_length<=5&&(e.strategy===$m||e.match_length===R&&e.strstart-e.match_start>4096)&&(e.match_length=R-1)),e.prev_length>=R&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-R,n=be._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-R),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=R-1,e.strstart++,n&&(ee(e,!1),e.strm.avail_out===0))return J}else if(e.match_available){if(n=be._tr_tally(e,0,e.window[e.strstart-1]),n&&ee(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return J}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=be._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<R-1?e.strstart:R-1,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:gn}function sb(e,t){for(var i,n,r,a,s=e.window;;){if(e.lookahead<=gt){if(Rt(e),e.lookahead<=gt&&t===Pt)return J;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=R&&e.strstart>0&&(r=e.strstart-1,n=s[r],n===s[++r]&&n===s[++r]&&n===s[++r])){a=e.strstart+gt;do;while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<a);e.match_length=gt-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=R?(i=be._tr_tally(e,1,e.match_length-R),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=be._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:gn}function ob(e,t){for(var i;;){if(e.lookahead===0&&(Rt(e),e.lookahead===0)){if(t===Pt)return J;break}if(e.match_length=0,i=be._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:gn}function je(e,t,i,n,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=n,this.func=r}var di;di=[new je(0,0,0,0,ab),new je(4,4,8,4,Cs),new je(4,5,16,8,Cs),new je(4,6,32,32,Cs),new je(4,4,16,16,ci),new je(8,16,32,32,ci),new je(8,16,128,128,ci),new je(8,32,128,256,ci),new je(32,128,258,1024,ci),new je(32,258,258,4096,ci)];function lb(e){e.window_size=2*e.w_size,ht(e.head),e.max_lazy_match=di[e.level].max_lazy,e.good_match=di[e.level].good_length,e.nice_match=di[e.level].nice_length,e.max_chain_length=di[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=R-1,e.match_available=0,e.ins_h=0}function cb(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_r,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new oe.Buf16(eb*2),this.dyn_dtree=new oe.Buf16((2*Jm+1)*2),this.bl_tree=new oe.Buf16((2*Qm+1)*2),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new oe.Buf16(tb+1),this.heap=new oe.Buf16(2*Ts+1),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new oe.Buf16(2*Ts+1),ht(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Kd(e){var t;return!e||!e.state?mt(e,ye):(e.total_in=e.total_out=0,e.data_type=Wm,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Er:It,e.adler=t.wrap===2?0:1,t.last_flush=Pt,be._tr_init(t),De)}function Xd(e){var t=Kd(e);return t===De&&lb(e.state),t}function db(e,t){return!e||!e.state||e.state.wrap!==2?ye:(e.state.gzhead=t,De)}function Zd(e,t,i,n,r,a){if(!e)return ye;var s=1;if(t===Hm&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>Ym||i!==_r||n<8||n>15||t<0||t>9||a<0||a>qm)return mt(e,ye);n===8&&(n=9);var o=new cb;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+R-1)/R),o.window=new oe.Buf8(o.w_size*2),o.head=new oe.Buf16(o.hash_size),o.prev=new oe.Buf16(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new oe.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=i,Xd(e)}function ub(e,t){return Zd(e,t,_r,Vm,Km,Gm)}function pb(e,t){var i,n,r,a;if(!e||!e.state||t>qd||t<0)return e?mt(e,ye):ye;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===hn&&t!==bt)return mt(e,e.avail_out===0?As:ye);if(n.strm=e,i=n.last_flush,n.last_flush=t,n.status===Er)if(n.wrap===2)e.adler=0,P(n,31),P(n,139),P(n,8),n.gzhead?(P(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),P(n,n.gzhead.time&255),P(n,n.gzhead.time>>8&255),P(n,n.gzhead.time>>16&255),P(n,n.gzhead.time>>24&255),P(n,n.level===9?2:n.strategy>=yr||n.level<2?4:0),P(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(P(n,n.gzhead.extra.length&255),P(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=pt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ks):(P(n,0),P(n,0),P(n,0),P(n,0),P(n,0),P(n,n.level===9?2:n.strategy>=yr||n.level<2?4:0),P(n,nb),n.status=It);else{var s=_r+(n.w_bits-8<<4)<<8,o=-1;n.strategy>=yr||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,s|=o<<6,n.strstart!==0&&(s|=ib),s+=31-s%31,n.status=It,fn(n,s),n.strstart!==0&&(fn(n,e.adler>>>16),fn(n,e.adler&65535)),e.adler=1}if(n.status===ks)if(n.gzhead.extra){for(r=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),ft(e),r=n.pending,n.pending===n.pending_buf_size));)P(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=vr)}else n.status=vr;if(n.status===vr)if(n.gzhead.name){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),ft(e),r=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,P(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),a===0&&(n.gzindex=0,n.status=xr)}else n.status=xr;if(n.status===xr)if(n.gzhead.comment){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),ft(e),r=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,P(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),a===0&&(n.status=wr)}else n.status=wr;if(n.status===wr&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ft(e),n.pending+2<=n.pending_buf_size&&(P(n,e.adler&255),P(n,e.adler>>8&255),e.adler=0,n.status=It)):n.status=It),n.pending!==0){if(ft(e),e.avail_out===0)return n.last_flush=-1,De}else if(e.avail_in===0&&Wd(t)<=Wd(i)&&t!==bt)return mt(e,As);if(n.status===hn&&e.avail_in!==0)return mt(e,As);if(e.avail_in!==0||n.lookahead!==0||t!==Pt&&n.status!==hn){var d=n.strategy===yr?ob(n,t):n.strategy===Um?sb(n,t):di[n.level].func(n,t);if((d===Mt||d===ui)&&(n.status=hn),d===J||d===Mt)return e.avail_out===0&&(n.last_flush=-1),De;if(d===gn&&(t===Nm?be._tr_align(n):t!==qd&&(be._tr_stored_block(n,0,0,!1),t===Bm&&(ht(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),ft(e),e.avail_out===0))return n.last_flush=-1,De}return t!==bt?De:n.wrap<=0?Gd:(n.wrap===2?(P(n,e.adler&255),P(n,e.adler>>8&255),P(n,e.adler>>16&255),P(n,e.adler>>24&255),P(n,e.total_in&255),P(n,e.total_in>>8&255),P(n,e.total_in>>16&255),P(n,e.total_in>>24&255)):(fn(n,e.adler>>>16),fn(n,e.adler&65535)),ft(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?De:Gd)}function fb(e){var t;return!e||!e.state?ye:(t=e.state.status,t!==Er&&t!==ks&&t!==vr&&t!==xr&&t!==wr&&t!==It&&t!==hn?mt(e,ye):(e.state=null,t===It?mt(e,Fm):De))}function hb(e,t){var i=t.length,n,r,a,s,o,d,l,c;if(!e||!e.state||(n=e.state,s=n.wrap,s===2||s===1&&n.status!==Er||n.lookahead))return ye;for(s===1&&(e.adler=Yd(e.adler,t,i,0)),n.wrap=0,i>=n.w_size&&(s===0&&(ht(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new oe.Buf8(n.w_size),oe.arraySet(c,t,i-n.w_size,n.w_size,0),t=c,i=n.w_size),o=e.avail_in,d=e.next_in,l=e.input,e.avail_in=i,e.next_in=0,e.input=t,Rt(n);n.lookahead>=R;){r=n.strstart,a=n.lookahead-(R-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+R-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++;while(--a);n.strstart=r,n.lookahead=R-1,Rt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=R-1,n.match_available=0,e.next_in=d,e.input=l,e.avail_in=o,n.wrap=s,De}ze.deflateInit=ub;ze.deflateInit2=Zd;ze.deflateReset=Xd;ze.deflateResetKeep=Kd;ze.deflateSetHeader=db;ze.deflate=pb;ze.deflateEnd=fb;ze.deflateSetDictionary=hb;ze.deflateInfo="pako deflate (from Nodeca project)"});var Ls=E(pi=>{"use strict";var Sr=Ke(),Qd=!0,eu=!0;try{String.fromCharCode.apply(null,[0])}catch{Qd=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{eu=!1}var mn=new Sr.Buf8(256);for(Ze=0;Ze<256;Ze++)mn[Ze]=Ze>=252?6:Ze>=248?5:Ze>=240?4:Ze>=224?3:Ze>=192?2:1;var Ze;mn[254]=mn[254]=1;pi.string2buf=function(e){var t,i,n,r,a,s=e.length,o=0;for(r=0;r<s;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Sr.Buf8(o),a=0,r=0;a<o;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|i&63):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|i&63):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|i&63);return t};function tu(e,t){if(t<65534&&(e.subarray&&eu||!e.subarray&&Qd))return String.fromCharCode.apply(null,Sr.shrinkBuf(e,t));for(var i="",n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i}pi.buf2binstring=function(e){return tu(e,e.length)};pi.binstring2buf=function(e){for(var t=new Sr.Buf8(e.length),i=0,n=t.length;i<n;i++)t[i]=e.charCodeAt(i);return t};pi.buf2string=function(e,t){var i,n,r,a,s=t||e.length,o=new Array(s*2);for(n=0,i=0;i<s;){if(r=e[i++],r<128){o[n++]=r;continue}if(a=mn[r],a>4){o[n++]=65533,i+=a-1;continue}for(r&=a===2?31:a===3?15:7;a>1&&i<s;)r=r<<6|e[i++]&63,a--;if(a>1){o[n++]=65533;continue}r<65536?o[n++]=r:(r-=65536,o[n++]=55296|r>>10&1023,o[n++]=56320|r&1023)}return tu(o,n)};pi.utf8border=function(e,t){var i;for(t=t||e.length,t>e.length&&(t=e.length),i=t-1;i>=0&&(e[i]&192)===128;)i--;return i<0||i===0?t:i+mn[e[i]]>t?i:t}});var Os=E((Xw,iu)=>{"use strict";function gb(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}iu.exports=gb});var su=E(vn=>{"use strict";var bn=Jd(),yn=Ke(),Ms=Ls(),Rs=br(),mb=Os(),au=Object.prototype.toString,bb=0,Is=4,fi=0,nu=1,ru=2,yb=-1,vb=0,xb=8;function jt(e){if(!(this instanceof jt))return new jt(e);this.options=yn.assign({level:yb,method:xb,chunkSize:16384,windowBits:15,memLevel:8,strategy:vb,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new mb,this.strm.avail_out=0;var i=bn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==fi)throw new Error(Rs[i]);if(t.header&&bn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Ms.string2buf(t.dictionary):au.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,i=bn.deflateSetDictionary(this.strm,n),i!==fi)throw new Error(Rs[i]);this._dict_set=!0}}jt.prototype.push=function(e,t){var i=this.strm,n=this.options.chunkSize,r,a;if(this.ended)return!1;a=t===~~t?t:t===!0?Is:bb,typeof e=="string"?i.input=Ms.string2buf(e):au.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(i.avail_out===0&&(i.output=new yn.Buf8(n),i.next_out=0,i.avail_out=n),r=bn.deflate(i,a),r!==nu&&r!==fi)return this.onEnd(r),this.ended=!0,!1;(i.avail_out===0||i.avail_in===0&&(a===Is||a===ru))&&(this.options.to==="string"?this.onData(Ms.buf2binstring(yn.shrinkBuf(i.output,i.next_out))):this.onData(yn.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||i.avail_out===0)&&r!==nu);return a===Is?(r=bn.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===fi):(a===ru&&(this.onEnd(fi),i.avail_out=0),!0)};jt.prototype.onData=function(e){this.chunks.push(e)};jt.prototype.onEnd=function(e){e===fi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=yn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ps(e,t){var i=new jt(t);if(i.push(e,!0),i.err)throw i.msg||Rs[i.err];return i.result}function wb(e,t){return t=t||{},t.raw=!0,Ps(e,t)}function _b(e,t){return t=t||{},t.gzip=!0,Ps(e,t)}vn.Deflate=jt;vn.deflate=Ps;vn.deflateRaw=wb;vn.gzip=_b});var lu=E((Jw,ou)=>{"use strict";var Ar=30,Eb=12;ou.exports=function(t,i){var n,r,a,s,o,d,l,c,f,u,p,v,m,w,g,h,x,y,b,C,S,A,T,M,_;n=t.state,r=t.next_in,M=t.input,a=r+(t.avail_in-5),s=t.next_out,_=t.output,o=s-(i-t.avail_out),d=s+(t.avail_out-257),l=n.dmax,c=n.wsize,f=n.whave,u=n.wnext,p=n.window,v=n.hold,m=n.bits,w=n.lencode,g=n.distcode,h=(1<<n.lenbits)-1,x=(1<<n.distbits)-1;e:do{m<15&&(v+=M[r++]<<m,m+=8,v+=M[r++]<<m,m+=8),y=w[v&h];t:for(;;){if(b=y>>>24,v>>>=b,m-=b,b=y>>>16&255,b===0)_[s++]=y&65535;else if(b&16){C=y&65535,b&=15,b&&(m<b&&(v+=M[r++]<<m,m+=8),C+=v&(1<<b)-1,v>>>=b,m-=b),m<15&&(v+=M[r++]<<m,m+=8,v+=M[r++]<<m,m+=8),y=g[v&x];i:for(;;){if(b=y>>>24,v>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,m<b&&(v+=M[r++]<<m,m+=8,m<b&&(v+=M[r++]<<m,m+=8)),S+=v&(1<<b)-1,S>l){t.msg="invalid distance too far back",n.mode=Ar;break e}if(v>>>=b,m-=b,b=s-o,S>b){if(b=S-b,b>f&&n.sane){t.msg="invalid distance too far back",n.mode=Ar;break e}if(A=0,T=p,u===0){if(A+=c-b,b<C){C-=b;do _[s++]=p[A++];while(--b);A=s-S,T=_}}else if(u<b){if(A+=c+u-b,b-=u,b<C){C-=b;do _[s++]=p[A++];while(--b);if(A=0,u<C){b=u,C-=b;do _[s++]=p[A++];while(--b);A=s-S,T=_}}}else if(A+=u-b,b<C){C-=b;do _[s++]=p[A++];while(--b);A=s-S,T=_}for(;C>2;)_[s++]=T[A++],_[s++]=T[A++],_[s++]=T[A++],C-=3;C&&(_[s++]=T[A++],C>1&&(_[s++]=T[A++]))}else{A=s-S;do _[s++]=_[A++],_[s++]=_[A++],_[s++]=_[A++],C-=3;while(C>2);C&&(_[s++]=_[A++],C>1&&(_[s++]=_[A++]))}}else if((b&64)===0){y=g[(y&65535)+(v&(1<<b)-1)];continue i}else{t.msg="invalid distance code",n.mode=Ar;break e}break}}else if((b&64)===0){y=w[(y&65535)+(v&(1<<b)-1)];continue t}else if(b&32){n.mode=Eb;break e}else{t.msg="invalid literal/length code",n.mode=Ar;break e}break}}while(r<a&&s<d);C=m>>3,r-=C,m-=C<<3,v&=(1<<m)-1,t.next_in=r,t.next_out=s,t.avail_in=r<a?5+(a-r):5-(r-a),t.avail_out=s<d?257+(d-s):257-(s-d),n.hold=v,n.bits=m}});var gu=E((Qw,hu)=>{"use strict";var cu=Ke(),hi=15,du=852,uu=592,pu=0,js=1,fu=2,Sb=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Ab=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Cb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Tb=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];hu.exports=function(t,i,n,r,a,s,o,d){var l=d.bits,c=0,f=0,u=0,p=0,v=0,m=0,w=0,g=0,h=0,x=0,y,b,C,S,A,T=null,M=0,_,O=new cu.Buf16(hi+1),k=new cu.Buf16(hi+1),I=null,D=0,z,ne,he;for(c=0;c<=hi;c++)O[c]=0;for(f=0;f<r;f++)O[i[n+f]]++;for(v=l,p=hi;p>=1&&O[p]===0;p--);if(v>p&&(v=p),p===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,d.bits=1,0;for(u=1;u<p&&O[u]===0;u++);for(v<u&&(v=u),g=1,c=1;c<=hi;c++)if(g<<=1,g-=O[c],g<0)return-1;if(g>0&&(t===pu||p!==1))return-1;for(k[1]=0,c=1;c<hi;c++)k[c+1]=k[c]+O[c];for(f=0;f<r;f++)i[n+f]!==0&&(o[k[i[n+f]]++]=f);if(t===pu?(T=I=o,_=19):t===js?(T=Sb,M-=257,I=Ab,D-=257,_=256):(T=Cb,I=Tb,_=-1),x=0,f=0,c=u,A=s,m=v,w=0,C=-1,h=1<<v,S=h-1,t===js&&h>du||t===fu&&h>uu)return 1;for(;;){z=c-w,o[f]<_?(ne=0,he=o[f]):o[f]>_?(ne=I[D+o[f]],he=T[M+o[f]]):(ne=96,he=0),y=1<<c-w,b=1<<m,u=b;do b-=y,a[A+(x>>w)+b]=z<<24|ne<<16|he|0;while(b!==0);for(y=1<<c-1;x&y;)y>>=1;if(y!==0?(x&=y-1,x+=y):x=0,f++,--O[c]===0){if(c===p)break;c=i[n+o[f]]}if(c>v&&(x&S)!==C){for(w===0&&(w=v),A+=u,m=c-w,g=1<<m;m+w<p&&(g-=O[m+w],!(g<=0));)m++,g<<=1;if(h+=1<<m,t===js&&h>du||t===fu&&h>uu)return 1;C=x&S,a[C]=v<<24|m<<16|A-s|0}}return x!==0&&(a[A+x]=c-w<<24|64<<16|0),d.bits=v,0}});var Xu=E(Ce=>{"use strict";var ue=Ke(),Hs=Es(),Ne=Ss(),kb=lu(),xn=gu(),Lb=0,Hu=1,$u=2,mu=4,Ob=5,Cr=6,Dt=0,Ib=1,Mb=2,ve=-2,Uu=-3,$s=-4,Rb=-5,bu=8,qu=1,yu=2,vu=3,xu=4,wu=5,_u=6,Eu=7,Su=8,Au=9,Cu=10,Lr=11,Je=12,Ds=13,Tu=14,zs=15,ku=16,Lu=17,Ou=18,Iu=19,Tr=20,kr=21,Mu=22,Ru=23,Pu=24,ju=25,Du=26,Ns=27,zu=28,Nu=29,H=30,Us=31,Pb=32,jb=852,Db=592,zb=15,Nb=zb;function Bu(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Bb(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ue.Buf16(320),this.work=new ue.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Gu(e){var t;return!e||!e.state?ve:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=qu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new ue.Buf32(jb),t.distcode=t.distdyn=new ue.Buf32(Db),t.sane=1,t.back=-1,Dt)}function Wu(e){var t;return!e||!e.state?ve:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Gu(e))}function Yu(e,t){var i,n;return!e||!e.state||(n=e.state,t<0?(i=0,t=-t):(i=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?ve:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,Wu(e))}function Vu(e,t){var i,n;return e?(n=new Bb,e.state=n,n.window=null,i=Yu(e,t),i!==Dt&&(e.state=null),i):ve}function Fb(e){return Vu(e,Nb)}var Fu=!0,Bs,Fs;function Hb(e){if(Fu){var t;for(Bs=new ue.Buf32(512),Fs=new ue.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(xn(Hu,e.lens,0,288,Bs,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;xn($u,e.lens,0,32,Fs,0,e.work,{bits:5}),Fu=!1}e.lencode=Bs,e.lenbits=9,e.distcode=Fs,e.distbits=5}function Ku(e,t,i,n){var r,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new ue.Buf8(a.wsize)),n>=a.wsize?(ue.arraySet(a.window,t,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>n&&(r=n),ue.arraySet(a.window,t,i-n,r,a.wnext),n-=r,n?(ue.arraySet(a.window,t,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}function $b(e,t){var i,n,r,a,s,o,d,l,c,f,u,p,v,m,w=0,g,h,x,y,b,C,S,A,T=new ue.Buf8(4),M,_,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return ve;i=e.state,i.mode===Je&&(i.mode=Ds),s=e.next_out,r=e.output,d=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,l=i.hold,c=i.bits,f=o,u=d,A=Dt;e:for(;;)switch(i.mode){case qu:if(i.wrap===0){i.mode=Ds;break}for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.wrap&2&&l===35615){i.check=0,T[0]=l&255,T[1]=l>>>8&255,i.check=Ne(i.check,T,2,0),l=0,c=0,i.mode=yu;break}if(i.flags=0,i.head&&(i.head.done=!1),!(i.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=H;break}if((l&15)!==bu){e.msg="unknown compression method",i.mode=H;break}if(l>>>=4,c-=4,S=(l&15)+8,i.wbits===0)i.wbits=S;else if(S>i.wbits){e.msg="invalid window size",i.mode=H;break}i.dmax=1<<S,e.adler=i.check=1,i.mode=l&512?Cu:Je,l=0,c=0;break;case yu:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.flags=l,(i.flags&255)!==bu){e.msg="unknown compression method",i.mode=H;break}if(i.flags&57344){e.msg="unknown header flags set",i.mode=H;break}i.head&&(i.head.text=l>>8&1),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,i.check=Ne(i.check,T,2,0)),l=0,c=0,i.mode=vu;case vu:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.head&&(i.head.time=l),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,i.check=Ne(i.check,T,4,0)),l=0,c=0,i.mode=xu;case xu:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.head&&(i.head.xflags=l&255,i.head.os=l>>8),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,i.check=Ne(i.check,T,2,0)),l=0,c=0,i.mode=wu;case wu:if(i.flags&1024){for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.length=l,i.head&&(i.head.extra_len=l),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,i.check=Ne(i.check,T,2,0)),l=0,c=0}else i.head&&(i.head.extra=null);i.mode=_u;case _u:if(i.flags&1024&&(p=i.length,p>o&&(p=o),p&&(i.head&&(S=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),ue.arraySet(i.head.extra,n,a,p,S)),i.flags&512&&(i.check=Ne(i.check,n,p,a)),o-=p,a+=p,i.length-=p),i.length))break e;i.length=0,i.mode=Eu;case Eu:if(i.flags&2048){if(o===0)break e;p=0;do S=n[a+p++],i.head&&S&&i.length<65536&&(i.head.name+=String.fromCharCode(S));while(S&&p<o);if(i.flags&512&&(i.check=Ne(i.check,n,p,a)),o-=p,a+=p,S)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=Su;case Su:if(i.flags&4096){if(o===0)break e;p=0;do S=n[a+p++],i.head&&S&&i.length<65536&&(i.head.comment+=String.fromCharCode(S));while(S&&p<o);if(i.flags&512&&(i.check=Ne(i.check,n,p,a)),o-=p,a+=p,S)break e}else i.head&&(i.head.comment=null);i.mode=Au;case Au:if(i.flags&512){for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l!==(i.check&65535)){e.msg="header crc mismatch",i.mode=H;break}l=0,c=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=Je;break;case Cu:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}e.adler=i.check=Bu(l),l=0,c=0,i.mode=Lr;case Lr:if(i.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,Mb;e.adler=i.check=1,i.mode=Je;case Je:if(t===Ob||t===Cr)break e;case Ds:if(i.last){l>>>=c&7,c-=c&7,i.mode=Ns;break}for(;c<3;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}switch(i.last=l&1,l>>>=1,c-=1,l&3){case 0:i.mode=Tu;break;case 1:if(Hb(i),i.mode=Tr,t===Cr){l>>>=2,c-=2;break e}break;case 2:i.mode=Lu;break;case 3:e.msg="invalid block type",i.mode=H}l>>>=2,c-=2;break;case Tu:for(l>>>=c&7,c-=c&7;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=H;break}if(i.length=l&65535,l=0,c=0,i.mode=zs,t===Cr)break e;case zs:i.mode=ku;case ku:if(p=i.length,p){if(p>o&&(p=o),p>d&&(p=d),p===0)break e;ue.arraySet(r,n,a,p,s),o-=p,a+=p,d-=p,s+=p,i.length-=p;break}i.mode=Je;break;case Lu:for(;c<14;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.nlen=(l&31)+257,l>>>=5,c-=5,i.ndist=(l&31)+1,l>>>=5,c-=5,i.ncode=(l&15)+4,l>>>=4,c-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=H;break}i.have=0,i.mode=Ou;case Ou:for(;i.have<i.ncode;){for(;c<3;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.lens[O[i.have++]]=l&7,l>>>=3,c-=3}for(;i.have<19;)i.lens[O[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,M={bits:i.lenbits},A=xn(Lb,i.lens,0,19,i.lencode,0,i.work,M),i.lenbits=M.bits,A){e.msg="invalid code lengths set",i.mode=H;break}i.have=0,i.mode=Iu;case Iu:for(;i.have<i.nlen+i.ndist;){for(;w=i.lencode[l&(1<<i.lenbits)-1],g=w>>>24,h=w>>>16&255,x=w&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(x<16)l>>>=g,c-=g,i.lens[i.have++]=x;else{if(x===16){for(_=g+2;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l>>>=g,c-=g,i.have===0){e.msg="invalid bit length repeat",i.mode=H;break}S=i.lens[i.have-1],p=3+(l&3),l>>>=2,c-=2}else if(x===17){for(_=g+3;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,S=0,p=3+(l&7),l>>>=3,c-=3}else{for(_=g+7;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,S=0,p=11+(l&127),l>>>=7,c-=7}if(i.have+p>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=H;break}for(;p--;)i.lens[i.have++]=S}}if(i.mode===H)break;if(i.lens[256]===0){e.msg="invalid code -- missing end-of-block",i.mode=H;break}if(i.lenbits=9,M={bits:i.lenbits},A=xn(Hu,i.lens,0,i.nlen,i.lencode,0,i.work,M),i.lenbits=M.bits,A){e.msg="invalid literal/lengths set",i.mode=H;break}if(i.distbits=6,i.distcode=i.distdyn,M={bits:i.distbits},A=xn($u,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,M),i.distbits=M.bits,A){e.msg="invalid distances set",i.mode=H;break}if(i.mode=Tr,t===Cr)break e;case Tr:i.mode=kr;case kr:if(o>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,kb(e,u),s=e.next_out,r=e.output,d=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,l=i.hold,c=i.bits,i.mode===Je&&(i.back=-1);break}for(i.back=0;w=i.lencode[l&(1<<i.lenbits)-1],g=w>>>24,h=w>>>16&255,x=w&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(h&&(h&240)===0){for(y=g,b=h,C=x;w=i.lencode[C+((l&(1<<y+b)-1)>>y)],g=w>>>24,h=w>>>16&255,x=w&65535,!(y+g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,i.back+=y}if(l>>>=g,c-=g,i.back+=g,i.length=x,h===0){i.mode=Du;break}if(h&32){i.back=-1,i.mode=Je;break}if(h&64){e.msg="invalid literal/length code",i.mode=H;break}i.extra=h&15,i.mode=Mu;case Mu:if(i.extra){for(_=i.extra;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=Ru;case Ru:for(;w=i.distcode[l&(1<<i.distbits)-1],g=w>>>24,h=w>>>16&255,x=w&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((h&240)===0){for(y=g,b=h,C=x;w=i.distcode[C+((l&(1<<y+b)-1)>>y)],g=w>>>24,h=w>>>16&255,x=w&65535,!(y+g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,i.back+=y}if(l>>>=g,c-=g,i.back+=g,h&64){e.msg="invalid distance code",i.mode=H;break}i.offset=x,i.extra=h&15,i.mode=Pu;case Pu:if(i.extra){for(_=i.extra;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=H;break}i.mode=ju;case ju:if(d===0)break e;if(p=u-d,i.offset>p){if(p=i.offset-p,p>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=H;break}p>i.wnext?(p-=i.wnext,v=i.wsize-p):v=i.wnext-p,p>i.length&&(p=i.length),m=i.window}else m=r,v=s-i.offset,p=i.length;p>d&&(p=d),d-=p,i.length-=p;do r[s++]=m[v++];while(--p);i.length===0&&(i.mode=kr);break;case Du:if(d===0)break e;r[s++]=i.length,d--,i.mode=kr;break;case Ns:if(i.wrap){for(;c<32;){if(o===0)break e;o--,l|=n[a++]<<c,c+=8}if(u-=d,e.total_out+=u,i.total+=u,u&&(e.adler=i.check=i.flags?Ne(i.check,r,u,s-u):Hs(i.check,r,u,s-u)),u=d,(i.flags?l:Bu(l))!==i.check){e.msg="incorrect data check",i.mode=H;break}l=0,c=0}i.mode=zu;case zu:if(i.wrap&&i.flags){for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l!==(i.total&4294967295)){e.msg="incorrect length check",i.mode=H;break}l=0,c=0}i.mode=Nu;case Nu:A=Ib;break e;case H:A=Uu;break e;case Us:return $s;case Pb:default:return ve}return e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,(i.wsize||u!==e.avail_out&&i.mode<H&&(i.mode<Ns||t!==mu))&&Ku(e,e.output,e.next_out,u-e.avail_out)?(i.mode=Us,$s):(f-=e.avail_in,u-=e.avail_out,e.total_in+=f,e.total_out+=u,i.total+=u,i.wrap&&u&&(e.adler=i.check=i.flags?Ne(i.check,r,u,e.next_out-u):Hs(i.check,r,u,e.next_out-u)),e.data_type=i.bits+(i.last?64:0)+(i.mode===Je?128:0)+(i.mode===Tr||i.mode===zs?256:0),(f===0&&u===0||t===mu)&&A===Dt&&(A=Rb),A)}function Ub(e){if(!e||!e.state)return ve;var t=e.state;return t.window&&(t.window=null),e.state=null,Dt}function qb(e,t){var i;return!e||!e.state||(i=e.state,(i.wrap&2)===0)?ve:(i.head=t,t.done=!1,Dt)}function Gb(e,t){var i=t.length,n,r,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Lr)?ve:n.mode===Lr&&(r=1,r=Hs(r,t,i,0),r!==n.check)?Uu:(a=Ku(e,t,i,i),a?(n.mode=Us,$s):(n.havedict=1,Dt))}Ce.inflateReset=Wu;Ce.inflateReset2=Yu;Ce.inflateResetKeep=Gu;Ce.inflateInit=Fb;Ce.inflateInit2=Vu;Ce.inflate=$b;Ce.inflateEnd=Ub;Ce.inflateGetHeader=qb;Ce.inflateSetDictionary=Gb;Ce.inflateInfo="pako inflate (from Nodeca project)"});var qs=E((t0,Zu)=>{"use strict";Zu.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Qu=E((i0,Ju)=>{"use strict";function Wb(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Ju.exports=Wb});var tp=E(_n=>{"use strict";var gi=Xu(),wn=Ke(),Or=Ls(),Y=qs(),Gs=br(),Yb=Os(),Vb=Qu(),ep=Object.prototype.toString;function zt(e){if(!(this instanceof zt))return new zt(e);this.options=wn.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yb,this.strm.avail_out=0;var i=gi.inflateInit2(this.strm,t.windowBits);if(i!==Y.Z_OK)throw new Error(Gs[i]);if(this.header=new Vb,gi.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Or.string2buf(t.dictionary):ep.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=gi.inflateSetDictionary(this.strm,t.dictionary),i!==Y.Z_OK)))throw new Error(Gs[i])}zt.prototype.push=function(e,t){var i=this.strm,n=this.options.chunkSize,r=this.options.dictionary,a,s,o,d,l,c=!1;if(this.ended)return!1;s=t===~~t?t:t===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof e=="string"?i.input=Or.binstring2buf(e):ep.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(i.avail_out===0&&(i.output=new wn.Buf8(n),i.next_out=0,i.avail_out=n),a=gi.inflate(i,Y.Z_NO_FLUSH),a===Y.Z_NEED_DICT&&r&&(a=gi.inflateSetDictionary(this.strm,r)),a===Y.Z_BUF_ERROR&&c===!0&&(a=Y.Z_OK,c=!1),a!==Y.Z_STREAM_END&&a!==Y.Z_OK)return this.onEnd(a),this.ended=!0,!1;i.next_out&&(i.avail_out===0||a===Y.Z_STREAM_END||i.avail_in===0&&(s===Y.Z_FINISH||s===Y.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=Or.utf8border(i.output,i.next_out),d=i.next_out-o,l=Or.buf2string(i.output,o),i.next_out=d,i.avail_out=n-d,d&&wn.arraySet(i.output,i.output,o,d,0),this.onData(l)):this.onData(wn.shrinkBuf(i.output,i.next_out))),i.avail_in===0&&i.avail_out===0&&(c=!0)}while((i.avail_in>0||i.avail_out===0)&&a!==Y.Z_STREAM_END);return a===Y.Z_STREAM_END&&(s=Y.Z_FINISH),s===Y.Z_FINISH?(a=gi.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Y.Z_OK):(s===Y.Z_SYNC_FLUSH&&(this.onEnd(Y.Z_OK),i.avail_out=0),!0)};zt.prototype.onData=function(e){this.chunks.push(e)};zt.prototype.onEnd=function(e){e===Y.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=wn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ws(e,t){var i=new zt(t);if(i.push(e,!0),i.err)throw i.msg||Gs[i.err];return i.result}function Kb(e,t){return t=t||{},t.raw=!0,Ws(e,t)}_n.Inflate=zt;_n.inflate=Ws;_n.inflateRaw=Kb;_n.ungzip=Ws});var rp=E((r0,np)=>{"use strict";var Xb=Ke().assign,Zb=su(),Jb=tp(),Qb=qs(),ip={};Xb(ip,Zb,Jb,Qb);np.exports=ip});var sp=E(Mr=>{"use strict";var ey=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",ty=rp(),ap=$(),Ir=de(),iy=ey?"uint8array":"array";Mr.magic="\b\0";function Nt(e,t){Ir.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}ap.inherits(Nt,Ir);Nt.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(ap.transformTo(iy,e.data),!1)};Nt.prototype.flush=function(){Ir.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};Nt.prototype.cleanUp=function(){Ir.prototype.cleanUp.call(this),this._pako=null};Nt.prototype._createPako=function(){this._pako=new ty[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};Mr.compressWorker=function(e){return new Nt("Deflate",e)};Mr.uncompressWorker=function(){return new Nt("Inflate",{})}});var Vs=E(Ys=>{"use strict";var op=de();Ys.STORE={magic:"\0\0",compressWorker:function(){return new op("STORE compression")},uncompressWorker:function(){return new op("STORE decompression")}};Ys.DEFLATE=sp()});var Ks=E(Bt=>{"use strict";Bt.LOCAL_FILE_HEADER="PK";Bt.CENTRAL_FILE_HEADER="PK";Bt.CENTRAL_DIRECTORY_END="PK";Bt.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";Bt.ZIP64_CENTRAL_DIRECTORY_END="PK";Bt.DATA_DESCRIPTOR="PK\x07\b"});var up=E((l0,dp)=>{"use strict";var mi=$(),bi=de(),Xs=ri(),lp=pr(),Rr=Ks(),N=function(e,t){var i="",n;for(n=0;n<t;n++)i+=String.fromCharCode(e&255),e=e>>>8;return i},ny=function(e,t){var i=e;return e||(i=t?16893:33204),(i&65535)<<16},ry=function(e){return(e||0)&63},cp=function(e,t,i,n,r,a){var s=e.file,o=e.compression,d=a!==Xs.utf8encode,l=mi.transformTo("string",a(s.name)),c=mi.transformTo("string",Xs.utf8encode(s.name)),f=s.comment,u=mi.transformTo("string",a(f)),p=mi.transformTo("string",Xs.utf8encode(f)),v=c.length!==s.name.length,m=p.length!==f.length,w,g,h="",x="",y="",b=s.dir,C=s.date,S={crc32:0,compressedSize:0,uncompressedSize:0};(!t||i)&&(S.crc32=e.crc32,S.compressedSize=e.compressedSize,S.uncompressedSize=e.uncompressedSize);var A=0;t&&(A|=8),!d&&(v||m)&&(A|=2048);var T=0,M=0;b&&(T|=16),r==="UNIX"?(M=798,T|=ny(s.unixPermissions,b)):(M=20,T|=ry(s.dosPermissions,b)),w=C.getUTCHours(),w=w<<6,w=w|C.getUTCMinutes(),w=w<<5,w=w|C.getUTCSeconds()/2,g=C.getUTCFullYear()-1980,g=g<<4,g=g|C.getUTCMonth()+1,g=g<<5,g=g|C.getUTCDate(),v&&(x=N(1,1)+N(lp(l),4)+c,h+="up"+N(x.length,2)+x),m&&(y=N(1,1)+N(lp(u),4)+p,h+="uc"+N(y.length,2)+y);var _="";_+=`
|
|
2
|
-
\0`,_+=N(A,2),_+=o.magic,_+=N(w,2),_+=N(g,2),_+=N(S.crc32,4),_+=N(S.compressedSize,4),_+=N(S.uncompressedSize,4),_+=N(l.length,2),_+=N(h.length,2);var O=Rr.LOCAL_FILE_HEADER+_+l+h,k=Rr.CENTRAL_FILE_HEADER+N(M,2)+_+N(u.length,2)+"\0\0\0\0"+N(T,4)+N(n,4)+l+h+u;return{fileRecord:O,dirRecord:k}},ay=function(e,t,i,n,r){var a="",s=mi.transformTo("string",r(n));return a=Rr.CENTRAL_DIRECTORY_END+"\0\0\0\0"+N(e,2)+N(e,2)+N(t,4)+N(i,4)+N(s.length,2)+s,a},sy=function(e){var t="";return t=Rr.DATA_DESCRIPTOR+N(e.crc32,4)+N(e.compressedSize,4)+N(e.uncompressedSize,4),t};function Te(e,t,i,n){bi.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}mi.inherits(Te,bi);Te.prototype.push=function(e){var t=e.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,bi.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-n-1))/i:100}}))};Te.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var i=cp(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0};Te.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,i=cp(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:sy(e),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};Te.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var i=this.bytesWritten-e,n=ay(this.dirRecords.length,i,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})};Te.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};Te.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(i){t.processChunk(i)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(i){t.error(i)}),this};Te.prototype.resume=function(){if(!bi.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};Te.prototype.error=function(e){var t=this._sources;if(!bi.prototype.error.call(this,e))return!1;for(var i=0;i<t.length;i++)try{t[i].error(e)}catch{}return!0};Te.prototype.lock=function(){bi.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};dp.exports=Te});var fp=E(pp=>{"use strict";var oy=Vs(),ly=up(),cy=function(e,t){var i=e||t,n=oy[i];if(!n)throw new Error(i+" is not a valid compression method !");return n};pp.generateWorker=function(e,t,i){var n=new ly(t.streamFiles,i,t.platform,t.encodeFileName),r=0;try{e.forEach(function(a,s){r++;var o=cy(s.options.compression,t.compression),d=s.options.compressionOptions||t.compressionOptions||{},l=s.dir,c=s.date;s._compressWorker(o,d).withStreamInfo("file",{name:a,dir:l,date:c,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(n)}),n.entriesCount=r}catch(a){n.error(a)}return n}});var gp=E((d0,hp)=>{"use strict";var dy=$(),Pr=de();function En(e,t){Pr.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}dy.inherits(En,Pr);En.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(i){t.push({data:i,meta:{percent:0}})}).on("error",function(i){t.isPaused?this.generatedError=i:t.error(i)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})};En.prototype.pause=function(){return Pr.prototype.pause.call(this)?(this._stream.pause(),!0):!1};En.prototype.resume=function(){return Pr.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};hp.exports=En});var Ap=E((u0,Sp)=>{"use strict";var uy=ri(),Sn=$(),vp=de(),py=ts(),xp=is(),mp=fr(),fy=bd(),hy=fp(),bp=Ji(),gy=gp(),wp=function(e,t,i){var n=Sn.getTypeOf(t),r,a=Sn.extend(i||{},xp);a.date=a.date||new Date,a.compression!==null&&(a.compression=a.compression.toUpperCase()),typeof a.unixPermissions=="string"&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&a.unixPermissions&16384&&(a.dir=!0),a.dosPermissions&&a.dosPermissions&16&&(a.dir=!0),a.dir&&(e=_p(e)),a.createFolders&&(r=my(e))&&Ep.call(this,r,!0);var s=n==="string"&&a.binary===!1&&a.base64===!1;(!i||typeof i.binary=="undefined")&&(a.binary=!s);var o=t instanceof mp&&t.uncompressedSize===0;(o||a.dir||!t||t.length===0)&&(a.base64=!1,a.binary=!0,t="",a.compression="STORE",n="string");var d=null;t instanceof mp||t instanceof vp?d=t:bp.isNode&&bp.isStream(t)?d=new gy(e,t):d=Sn.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new fy(e,d,a);this.files[e]=l},my=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},_p=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},Ep=function(e,t){return t=typeof t!="undefined"?t:xp.createFolders,e=_p(e),this.files[e]||wp.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function yp(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var by={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,i,n;for(t in this.files)n=this.files[t],i=t.slice(this.root.length,t.length),i&&t.slice(0,this.root.length)===this.root&&e(i,n)},filter:function(e){var t=[];return this.forEach(function(i,n){e(i,n)&&t.push(n)}),t},file:function(e,t,i){if(arguments.length===1)if(yp(e)){var n=e;return this.filter(function(a,s){return!s.dir&&n.test(a)})}else{var r=this.files[this.root+e];return r&&!r.dir?r:null}else e=this.root+e,wp.call(this,e,t,i);return this},folder:function(e){if(!e)return this;if(yp(e))return this.filter(function(r,a){return a.dir&&e.test(r)});var t=this.root+e,i=Ep.call(this,t),n=this.clone();return n.root=i.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||(e.slice(-1)!=="/"&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var i=this.filter(function(r,a){return a.name.slice(0,e.length)===e}),n=0;n<i.length;n++)delete this.files[i[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,i={};try{if(i=Sn.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:uy.utf8encode}),i.type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),i.type==="binarystring"&&(i.type="string"),!i.type)throw new Error("No output type specified.");Sn.checkSupport(i.type),(i.platform==="darwin"||i.platform==="freebsd"||i.platform==="linux"||i.platform==="sunos")&&(i.platform="UNIX"),i.platform==="win32"&&(i.platform="DOS");var n=i.comment||this.comment||"";t=hy.generateWorker(this,i,n)}catch(r){t=new vp("error"),t.error(r)}return new py(t,i.type||"string",i.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return e=e||{},e.type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};Sp.exports=by});var Zs=E((p0,Tp)=>{"use strict";var yy=$();function Cp(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}Cp.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t=0,i;for(this.checkOffset(e),i=this.index+e-1;i>=this.index;i--)t=(t<<8)+this.byteAt(i);return this.index+=e,t},readString:function(e){return yy.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}};Tp.exports=Cp});var Js=E((f0,Lp)=>{"use strict";var kp=Zs(),vy=$();function yi(e){kp.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}vy.inherits(yi,kp);yi.prototype.byteAt=function(e){return this.data[this.zero+e]};yi.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),i=e.charCodeAt(1),n=e.charCodeAt(2),r=e.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===i&&this.data[a+2]===n&&this.data[a+3]===r)return a-this.zero;return-1};yi.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),i=e.charCodeAt(1),n=e.charCodeAt(2),r=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&i===a[1]&&n===a[2]&&r===a[3]};yi.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Lp.exports=yi});var Mp=E((h0,Ip)=>{"use strict";var Op=Zs(),xy=$();function vi(e){Op.call(this,e)}xy.inherits(vi,Op);vi.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};vi.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};vi.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};vi.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Ip.exports=vi});var eo=E((g0,Pp)=>{"use strict";var Rp=Js(),wy=$();function Qs(e){Rp.call(this,e)}wy.inherits(Qs,Rp);Qs.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Pp.exports=Qs});var zp=E((m0,Dp)=>{"use strict";var jp=eo(),_y=$();function to(e){jp.call(this,e)}_y.inherits(to,jp);to.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Dp.exports=to});var io=E((b0,Bp)=>{"use strict";var jr=$(),Np=Ye(),Ey=Js(),Sy=Mp(),Ay=zp(),Cy=eo();Bp.exports=function(e){var t=jr.getTypeOf(e);return jr.checkSupport(t),t==="string"&&!Np.uint8array?new Sy(e):t==="nodebuffer"?new Ay(e):Np.uint8array?new Cy(jr.transformTo("uint8array",e)):new Ey(jr.transformTo("array",e))}});var Up=E((y0,$p)=>{"use strict";var no=io(),yt=$(),Ty=fr(),Fp=pr(),Dr=ri(),zr=Vs(),ky=Ye(),Ly=0,Oy=3,Iy=function(e){for(var t in zr)if(Object.prototype.hasOwnProperty.call(zr,t)&&zr[t].magic===e)return zr[t];return null};function Hp(e,t){this.options=e,this.loadOptions=t}Hp.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(e){var t,i;if(e.skip(22),this.fileNameLength=e.readInt(2),i=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(i),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(t=Iy(this.compressionMethod),t===null)throw new Error("Corrupted zip : compression "+yt.pretty(this.compressionMethod)+" unknown (inner file : "+yt.transformTo("string",this.fileName)+")");this.decompressed=new Ty(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===Ly&&(this.dosPermissions=this.externalFileAttributes&63),e===Oy&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=no(this.extraFields[1].value);this.uncompressedSize===yt.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===yt.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===yt.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===yt.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t=e.index+this.extraFieldsLength,i,n,r;for(this.extraFields||(this.extraFields={});e.index+4<t;)i=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[i]={id:i,length:n,value:r};e.setIndex(t)},handleUTF8:function(){var e=ky.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Dr.utf8decode(this.fileName),this.fileCommentStr=Dr.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var i=yt.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var n=this.findExtraFieldUnicodeComment();if(n!==null)this.fileCommentStr=n;else{var r=yt.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=no(e.value);return t.readInt(1)!==1||Fp(this.fileName)!==t.readInt(4)?null:Dr.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=no(e.value);return t.readInt(1)!==1||Fp(this.fileComment)!==t.readInt(4)?null:Dr.utf8decode(t.readData(e.length-5))}return null}};$p.exports=Hp});var Wp=E((v0,Gp)=>{"use strict";var My=io(),Qe=$(),ke=Ks(),Ry=Up(),Py=Ye();function qp(e){this.files=[],this.loadOptions=e}qp.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+Qe.pretty(t)+", expected "+Qe.pretty(e)+")")}},isSignature:function(e,t){var i=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4),r=n===t;return this.reader.setIndex(i),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=Py.uint8array?"uint8array":"array",i=Qe.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,t=0,i,n,r;t<e;)i=this.reader.readInt(2),n=this.reader.readInt(4),r=this.reader.readData(n),this.zip64ExtensibleData[i]={id:i,length:n,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(ke.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(ke.CENTRAL_FILE_HEADER);)e=new Ry({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(ke.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,ke.LOCAL_FILE_HEADER);throw t?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(e);var i=e;if(this.checkSignature(ke.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Qe.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Qe.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Qe.MAX_VALUE_16BITS||this.centralDirRecords===Qe.MAX_VALUE_16BITS||this.centralDirSize===Qe.MAX_VALUE_32BITS||this.centralDirOffset===Qe.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(ke.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(ke.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,ke.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(ke.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(ke.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=i-n;if(r>0)this.isSignature(i,ke.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=My(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};Gp.exports=qp});var Kp=E((x0,Vp)=>{"use strict";var ro=$(),Nr=ti(),jy=ri(),Dy=Wp(),zy=as(),Yp=Ji();function Ny(e){return new Nr.Promise(function(t,i){var n=e.decompressed.getContentWorker().pipe(new zy);n.on("error",function(r){i(r)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}Vp.exports=function(e,t){var i=this;return t=ro.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:jy.utf8decode}),Yp.isNode&&Yp.isStream(e)?Nr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):ro.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(n){var r=new Dy(t);return r.load(n),r}).then(function(r){var a=[Nr.Promise.resolve(r)],s=r.files;if(t.checkCRC32)for(var o=0;o<s.length;o++)a.push(Ny(s[o]));return Nr.Promise.all(a)}).then(function(r){for(var a=r.shift(),s=a.files,o=0;o<s.length;o++){var d=s[o],l=d.fileNameStr,c=ro.resolve(d.fileNameStr);i.file(c,d.decompressed,{binary:!0,optimizedBinaryString:!0,date:d.date,dir:d.dir,comment:d.fileCommentStr.length?d.fileCommentStr:null,unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions,createFolders:t.createFolders}),d.dir||(i.file(c).unsafeOriginalName=l)}return a.zipComment.length&&(i.comment=a.zipComment),i})}});var Zp=E((w0,Xp)=>{"use strict";function xe(){if(!(this instanceof xe))return new xe;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new xe;for(var t in this)typeof this[t]!="function"&&(e[t]=this[t]);return e}}xe.prototype=Ap();xe.prototype.loadAsync=Kp();xe.support=Ye();xe.defaults=is();xe.version="3.10.1";xe.loadAsync=function(e,t){return new xe().loadAsync(e,t)};xe.external=ti();Xp.exports=xe});var Be,oo=Ue(()=>{"use strict";Be=class{static get(t){var i;return(i=this.store.get(t))==null?void 0:i.data}static set(t,i){this.store.set(t,{data:i})}static has(t){return this.store.has(t)}static clear(){this.store.clear()}};Be.store=new Map});function Uy(){var e,t;try{let i=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((t=(e=document.querySelector("script"))==null?void 0:e.textContent)==null?void 0:t.includes("inline-assets.js"))||window.INLINE_ASSETS),n=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(i&&!n)}catch{return!1}}async function qy(){try{if(typeof window!="undefined"){let e=await fetch("./build-settings.json");if(e.ok){let t=await e.json();return console.log("[AssetLoader] Loaded build settings:",t),t}}}catch{}return null}function Gy(){try{if(typeof window!="undefined"){let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",t),t}}}catch{}return null}async function Wy(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${U}`),Object.keys(et).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(et)),et;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),et={...window.INLINE_ASSETS},et;if(!(U==="publish"&&Fe!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),et;if(!lo){let t=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",t),lo=(async()=>{try{try{let a=await import(t+"?t="+Date.now());if(a.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(a.INLINE_ASSETS)),a.INLINE_ASSETS}catch(a){console.warn("[AssetLoader] ES module import failed, trying text parse:",a)}let i=await fetch(t);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);let n=await i.text();console.log("[AssetLoader] Received JS code, length:",n.length);let r=n.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(r)try{let a=r[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let s=new Function("return "+a)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(s)),s}catch(a){return console.warn("[AssetLoader] Failed to parse inline assets:",a),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",n.substring(0,500)),{}}catch(i){return console.warn("[AssetLoader] Failed to load inline assets:",i),{}}})()}return et=await lo,console.log("[AssetLoader] Final inline assets cache:",Object.keys(et)),et}function co(e){return e===null||typeof e!="object"||(Object.freeze(e),Object.values(e).forEach(t=>co(t))),e}function Yy(e=64,t=64,i=16711680){let n=document.createElement("canvas");n.width=e,n.height=t;let r=n.getContext("2d");return r.fillStyle=`#${i.toString(16).padStart(6,"0")}`,r.fillRect(0,0,e,t),r.strokeStyle="#000",r.strokeRect(0,0,e,t),r.fillStyle="#fff",r.font="10px sans-serif",r.textAlign="center",r.fillText("MISSING",e/2,t/2),tt.Texture.from(n)}function Hr(e,t){rf.set(e,t)}var tt,tf,nf,Ft,U,Fe,vt,et,lo,rf,xt,$r=Ue(()=>{"use strict";tt=require("pixi.js");oo();tf=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",nf=Uy(),Ft=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,U=nf?"publish":tf,Fe=Ft==null?void 0:Ft.assetsInlined;Ft!=null&&Ft.buildMode&&(U=Ft.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${U}`));vt=Gy();vt!=null&&vt.buildMode&&(U=vt.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${U}`));(vt==null?void 0:vt.assetsInlined)!==void 0&&(Fe=vt.assetsInlined);qy().then(e=>{e!=null&&e.buildMode&&e.buildMode!==U&&(U=e.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${U}`)),(e==null?void 0:e.assetsInlined)!==void 0&&(Fe=e.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${tf}, Runtime: ${nf?"publish":"dev"}, Effective: ${U}`);et={},lo=null;rf=new Map;xt=class{static async load(t,i,n,r){let a=`${t}:${i.path}`,s=Be.get(a);if(s!==void 0)return s;console.log(`[AssetLoader] Loading asset: ${t}, type: ${i.type}, Effective mode: ${U}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await Wy(),d=o[t];if(!d&&r&&(d=o[r],d&&console.log(`[AssetLoader] Found inline data for ${t} using configId: ${r}`)),!d&&i.path){let f=i.path.split("/");if(f.length>=2){let u=f[f.length-1].split(".")[0];o[u]&&(d=o[u],console.log(`[AssetLoader] Found inline data for ${t} using assetName: ${u}`))}}if(console.log("[AssetLoader] Inline data for",t,":",d?"FOUND":"NOT FOUND"),U==="publish"&&Fe!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!d))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${t}, path: ${i.path}`);let c=rf.get(i.type);if(c)try{let f=await c(i.path,d,t,n);return Be.set(a,f),f}catch(f){return this.handleFailure(t,i.type,f)}try{let f;switch(i.type){case"image":f=await this.loadImage(i.path,d);break;case"json":f=await this.loadJSON(i.path,d),f=co(f);break;default:throw new Error(`Unknown asset type: ${i.type}`)}return Be.set(a,f),f}catch(f){return this.handleFailure(t,i.type,f)}}static async loadImage(t,i){let n=U==="publish",r=n&&Fe!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${U}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),r){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${t}`);if(typeof i!="string"||!i.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof i}`);try{return await tt.Assets.load(i)}catch(a){throw console.error("[AssetLoader] Failed to load texture from data URI:",a),a}}if(i&&typeof i=="string"&&i.startsWith("data:"))try{return await tt.Assets.load(i)}catch(a){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",a),await tt.Assets.load(t)}return await tt.Assets.load(t)}static async loadJSON(t,i){let n=U==="publish",r=n&&Fe!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${U}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),r){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}if(i){if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}let a=await fetch(t);if(!a.ok)throw new Error(`JSON fetch failed: ${t}`);return a.json()}static handleFailure(t,i,n){if(U==="dev"){let a=i==="image"?Yy():co({__placeholder:!0,type:i});return Be.set(t+":"+((n==null?void 0:n.path)||"missing"),a),a}throw n}};Hr("image",async(e,t)=>{let i=U==="publish",n=i&&Fe!==!1,r=U==="brand",a=i&&Fe===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${U}, isPublishMode: ${i}, isBrandMode: ${r}, inlineData: ${t?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof t!="string"||!t.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof t}`);return tt.Assets.load(t)}let s=e;return(r||a)&&e&&!e.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=e,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${e}" as-is`)):(s=`assets/${e}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${e}" -> "${s}"`))),tt.Assets.load(t||s)});Hr("json",async(e,t)=>{let i=U==="publish",n=i&&Fe!==!1,r=U==="brand",a=i&&Fe===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${U}, isPublishMode: ${i}, isBrandMode: ${r}, inlineData: ${t?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);return typeof t=="object"&&t!==null?t:typeof t=="string"&&t.startsWith("data:")?JSON.parse(atob(t.split(",")[1])):JSON.parse(t)}let s=e;if((r||a)&&e&&!e.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=e,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${e}" as-is`)):(s=`assets/${e}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${e}" -> "${s}"`))),t)return typeof t=="object"&&t!==null?t:typeof t=="string"&&t.startsWith("data:")?JSON.parse(atob(t.split(",")[1])):JSON.parse(t);let o=await fetch(s);if(!o.ok)throw new Error(`JSON fetch failed: ${e}`);return o.json()})});function Ur(e,t){af.init(e,t),typeof window!="undefined"&&(window.__AssetTextures=wt)}var uo,af,wt,An=Ue(()=>{"use strict";$r();uo=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(t,i){if(this.config===t&&this.app===i&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(n=>{this.priorityReadyResolve=n}),this.config=t,this.app=i,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let t=this.config,i=this.app;return this.readyPromise=(async()=>{var s;console.log("[AssetTextures] Loading all assets...");let n=new Set(["background_loading_1"]),r=[],a=[];for(let[o,d]of t.objects.entries()){let l=(s=d.render)==null?void 0:s.asset;if(!l)continue;let c=async()=>{var f;try{let u=(f=d.identity)==null?void 0:f.id;console.log(`[AssetTextures] Loading ${l.type}: ${o} (${u})`);let p=await xt.load(o,l,i,u);this.textures.set(o,p),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(u){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,u)}finally{this.attempted.add(o);try{for(let u of Array.from(this.waiters))u()}catch{}}};n.has(o)?r.push(c()):a.push(c())}r.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(r),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(a),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(t,i={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let r=Array.from(new Set((t||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var d,l,c,f;try{let u=(c=(l=(d=this.config)==null?void 0:d.objects)==null?void 0:l.get)==null?void 0:c.call(l,o);return!!((f=u==null?void 0:u.render)!=null&&f.asset)}catch{return!1}});if(r.length===0)return;this.ready().catch(()=>{});let a=()=>r.every(o=>this.textures.has(o)||this.attempted.has(o));if(a())return;let s=typeof i.timeoutMs=="number"?i.timeoutMs:15e3;await new Promise(o=>{let d=!1,l=()=>{d||a()&&(d=!0,this.waiters.delete(l),o())};this.waiters.add(l),l(),s>0&&setTimeout(()=>{d||(d=!0,this.waiters.delete(l),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:r}),o())},s)})}get(t){return this.textures.get(t)}set(t,i){this.textures.set(t,i),console.log(`[AssetTextures] Updated texture: ${t}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},af=new uo,wt=new Proxy(af,{get(e,t){return t in e&&typeof e[t]=="function"?e[t].bind(e):e.get(t)},set(e,t,i){return e.set(t,i),!0}})});var lf={};rl(lf,{AssetEditorModal:()=>mo});var mo,bo=Ue(()=>{"use strict";mo=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(t,i,n,r){this.currentObjectId=t,this.currentPath=i,this.currentAsset=n,this.onApplyCallback=r,this.createModal(t,n),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(t,i){let n=document.createElement("div");n.className="asset-editor-modal",n.innerHTML=`
|
|
1
|
+
"use strict";var Hf=Object.create;var Un=Object.defineProperty;var $f=Object.getOwnPropertyDescriptor;var Uf=Object.getOwnPropertyNames;var qf=Object.getPrototypeOf,Gf=Object.prototype.hasOwnProperty;var Ue=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rl=(e,t)=>{for(var i in t)Un(e,i,{get:t[i],enumerable:!0})},al=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Uf(t))!Gf.call(e,r)&&r!==i&&Un(e,r,{get:()=>t[r],enumerable:!(n=$f(t,r))||n.enumerable});return e};var qn=(e,t,i)=>(i=e!=null?Hf(qf(e)):{},al(t||!e||!e.__esModule?Un(i,"default",{value:e,enumerable:!0}):i,e)),Wf=e=>al(Un({},"__esModule",{value:!0}),e);var Jf,ot=Ue(()=>{"use strict";Jf="handler_preview_override_mode";if(typeof window!="undefined"){let e=window.localStorage.getItem(Jf);window.__enableConfigOverrides=e===null?!0:e==="true"}});var zl,At,Qv,fa=Ue(()=>{"use strict";ot();zl=null,At="dev";if(typeof window!="undefined"){let e=window.__BUILD_SETTINGS__;if(e!=null&&e.buildMode)zl=e,At=e.buildMode,console.log("[CONFIG] Loaded inline build settings:",e,"buildMode:",At);else try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let i=JSON.parse(t.responseText);zl=i,At=i.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",i,"buildMode:",At)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",At)}catch(t){console.log("[CONFIG] Failed to load build-settings.json:",t instanceof Error?t.message:String(t))}}console.log("[CONFIG] Final buildMode:",At);Qv=At==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var ha=Ue(()=>{"use strict"});var Bl=Ue(()=>{"use strict";ha();fa()});var ga=Ue(()=>{"use strict";fa();ha();Bl()});var Ui=E((fw,ma)=>{"use strict";typeof process=="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?ma.exports={nextTick:lh}:ma.exports=process;function lh(e,t,i,n){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,a,s;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,i)});case 4:return process.nextTick(function(){e.call(null,t,i,n)});default:for(a=new Array(r-1),s=0;s<a.length;)a[s++]=arguments[s];return process.nextTick(function(){e.apply(null,a)})}}});var $l=E((hw,Hl)=>{"use strict";var ch={}.toString;Hl.exports=Array.isArray||function(e){return ch.call(e)=="[object Array]"}});var ba=E((gw,Ul)=>{"use strict";Ul.exports=require("stream")});var qi=E((ya,Gl)=>{"use strict";var Vn=require("buffer"),qe=Vn.Buffer;function ql(e,t){for(var i in e)t[i]=e[i]}qe.from&&qe.alloc&&qe.allocUnsafe&&qe.allocUnsafeSlow?Gl.exports=Vn:(ql(Vn,ya),ya.Buffer=Yt);function Yt(e,t,i){return qe(e,t,i)}ql(qe,Yt);Yt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return qe(e,t,i)};Yt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=qe(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};Yt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return qe(e)};Yt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Vn.SlowBuffer(e)}});var Vt=E(te=>{"use strict";function dh(e){return Array.isArray?Array.isArray(e):Kn(e)==="[object Array]"}te.isArray=dh;function uh(e){return typeof e=="boolean"}te.isBoolean=uh;function ph(e){return e===null}te.isNull=ph;function fh(e){return e==null}te.isNullOrUndefined=fh;function hh(e){return typeof e=="number"}te.isNumber=hh;function gh(e){return typeof e=="string"}te.isString=gh;function mh(e){return typeof e=="symbol"}te.isSymbol=mh;function bh(e){return e===void 0}te.isUndefined=bh;function yh(e){return Kn(e)==="[object RegExp]"}te.isRegExp=yh;function vh(e){return typeof e=="object"&&e!==null}te.isObject=vh;function xh(e){return Kn(e)==="[object Date]"}te.isDate=xh;function wh(e){return Kn(e)==="[object Error]"||e instanceof Error}te.isError=wh;function _h(e){return typeof e=="function"}te.isFunction=_h;function Eh(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}te.isPrimitive=Eh;te.isBuffer=require("buffer").Buffer.isBuffer;function Kn(e){return Object.prototype.toString.call(e)}});var Wl=E((bw,va)=>{"use strict";typeof Object.create=="function"?va.exports=function(t,i){i&&(t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:va.exports=function(t,i){if(i){t.super_=i;var n=function(){};n.prototype=i.prototype,t.prototype=new n,t.prototype.constructor=t}}});var Kt=E((yw,wa)=>{"use strict";try{if(xa=require("util"),typeof xa.inherits!="function")throw"";wa.exports=xa.inherits}catch{wa.exports=Wl()}var xa});var Vl=E((vw,_a)=>{"use strict";function Sh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Yl=qi().Buffer,Gi=require("util");function Ah(e,t,i){e.copy(t,i)}_a.exports=(function(){function e(){Sh(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(i){var n={data:i,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(i){var n={data:i,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(this.length!==0){var i=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,i}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(i){if(this.length===0)return"";for(var n=this.head,r=""+n.data;n=n.next;)r+=i+n.data;return r},e.prototype.concat=function(i){if(this.length===0)return Yl.alloc(0);for(var n=Yl.allocUnsafe(i>>>0),r=this.head,a=0;r;)Ah(r.data,n,a),a+=r.data.length,r=r.next;return n},e})();Gi&&Gi.inspect&&Gi.inspect.custom&&(_a.exports.prototype[Gi.inspect.custom]=function(){var e=Gi.inspect({length:this.length});return this.constructor.name+" "+e})});var Ea=E((xw,Kl)=>{"use strict";var Xn=Ui();function Ch(e,t){var i=this,n=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return n||r?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Xn.nextTick(Zn,this,e)):Xn.nextTick(Zn,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,Xn.nextTick(Zn,i,a)):Xn.nextTick(Zn,i,a):t&&t(a)}),this)}function Th(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Zn(e,t){e.emit("error",t)}Kl.exports={destroy:Ch,undestroy:Th}});var Zl=E((ww,Xl)=>{"use strict";Xl.exports=require("util").deprecate});var Aa=E((_w,ac)=>{"use strict";var Ct=Ui();ac.exports=V;function Ql(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Gh(t,e)}}var kh=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Ct.nextTick,Xt;V.WritableState=Yi;var ec=Object.create(Vt());ec.inherits=Kt();var Lh={deprecate:Zl()},tc=ba(),Qn=qi().Buffer,Oh=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Ih(e){return Qn.from(e)}function Mh(e){return Qn.isBuffer(e)||e instanceof Oh}var ic=Ea();ec.inherits(V,tc);function Rh(){}function Yi(e,t){Xt=Xt||Tt(),e=e||{};var i=t instanceof Xt;this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=e.writableHighWaterMark,a=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:i&&(r||r===0)?this.highWaterMark=r:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=e.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){Fh(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Ql(this)}Yi.prototype.getBuffer=function(){for(var t=this.bufferedRequest,i=[];t;)i.push(t),t=t.next;return i};(function(){try{Object.defineProperty(Yi.prototype,"buffer",{get:Lh.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Jn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Jn=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(e){return Jn.call(this,e)?!0:this!==V?!1:e&&e._writableState instanceof Yi}})):Jn=function(e){return e instanceof this};function V(e){if(Xt=Xt||Tt(),!Jn.call(V,this)&&!(this instanceof Xt))return new V(e);this._writableState=new Yi(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),tc.call(this)}V.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Ph(e,t){var i=new Error("write after end");e.emit("error",i),Ct.nextTick(t,i)}function jh(e,t,i,n){var r=!0,a=!1;return i===null?a=new TypeError("May not write null values to stream"):typeof i!="string"&&i!==void 0&&!t.objectMode&&(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),Ct.nextTick(n,a),r=!1),r}V.prototype.write=function(e,t,i){var n=this._writableState,r=!1,a=!n.objectMode&&Mh(e);return a&&!Qn.isBuffer(e)&&(e=Ih(e)),typeof t=="function"&&(i=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof i!="function"&&(i=Rh),n.ended?Ph(this,i):(a||jh(this,n,e,i))&&(n.pendingcb++,r=zh(this,n,a,e,t,i)),r};V.prototype.cork=function(){var e=this._writableState;e.corked++};V.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&nc(this,e))};V.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function Dh(e,t,i){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Qn.from(t,i)),t}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function zh(e,t,i,n,r,a){if(!i){var s=Dh(t,n,r);n!==s&&(i=!0,r="buffer",n=s)}var o=t.objectMode?1:n.length;t.length+=o;var d=t.length<t.highWaterMark;if(d||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Sa(e,t,!1,o,n,r,a);return d}function Sa(e,t,i,n,r,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,i?e._writev(r,t.onwrite):e._write(r,a,t.onwrite),t.sync=!1}function Nh(e,t,i,n,r){--t.pendingcb,i?(Ct.nextTick(r,n),Ct.nextTick(Wi,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(r(n),e._writableState.errorEmitted=!0,e.emit("error",n),Wi(e,t))}function Bh(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function Fh(e,t){var i=e._writableState,n=i.sync,r=i.writecb;if(Bh(i),t)Nh(e,i,n,t,r);else{var a=rc(i);!a&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&nc(e,i),n?kh(Jl,e,i,a,r):Jl(e,i,a,r)}}function Jl(e,t,i,n){i||Hh(e,t),t.pendingcb--,n(),Wi(e,t)}function Hh(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function nc(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,r=new Array(n),a=t.corkedRequestsFree;a.entry=i;for(var s=0,o=!0;i;)r[s]=i,i.isBuf||(o=!1),i=i.next,s+=1;r.allBuffers=o,Sa(e,t,!0,t.length,r,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Ql(t),t.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,c=i.callback,f=t.objectMode?1:d.length;if(Sa(e,t,!1,f,d,l,c),i=i.next,t.bufferedRequestCount--,t.writing)break}i===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}V.prototype._write=function(e,t,i){i(new Error("_write() is not implemented"))};V.prototype._writev=null;V.prototype.end=function(e,t,i){var n=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||qh(this,n,i)};function rc(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function $h(e,t){e._final(function(i){t.pendingcb--,i&&e.emit("error",i),t.prefinished=!0,e.emit("prefinish"),Wi(e,t)})}function Uh(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Ct.nextTick($h,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Wi(e,t){var i=rc(t);return i&&(Uh(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),i}function qh(e,t,i){t.ending=!0,Wi(e,t),i&&(t.finished?Ct.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}function Gh(e,t,i){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(i),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(V.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});V.prototype.destroy=ic.destroy;V.prototype._undestroy=ic.undestroy;V.prototype._destroy=function(e,t){this.end(),t(e)}});var Tt=E((Ew,cc)=>{"use strict";var sc=Ui(),Wh=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};cc.exports=Ge;var oc=Object.create(Vt());oc.inherits=Kt();var lc=ka(),Ta=Aa();oc.inherits(Ge,lc);for(Ca=Wh(Ta.prototype),er=0;er<Ca.length;er++)tr=Ca[er],Ge.prototype[tr]||(Ge.prototype[tr]=Ta.prototype[tr]);var Ca,tr,er;function Ge(e){if(!(this instanceof Ge))return new Ge(e);lc.call(this,e),Ta.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",Yh)}Object.defineProperty(Ge.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Yh(){this.allowHalfOpen||this._writableState.ended||sc.nextTick(Vh,this)}function Vh(e){e.end()}Object.defineProperty(Ge.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});Ge.prototype._destroy=function(e,t){this.push(null),this.end(),sc.nextTick(t,e)}});var Ia=E(uc=>{"use strict";var Oa=qi().Buffer,dc=Oa.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Kh(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Xh(e){var t=Kh(e);if(typeof t!="string"&&(Oa.isEncoding===dc||!dc(e)))throw new Error("Unknown encoding: "+e);return t||e}uc.StringDecoder=Vi;function Vi(e){this.encoding=Xh(e);var t;switch(this.encoding){case"utf16le":this.text=ig,this.end=ng,t=4;break;case"utf8":this.fillLast=Qh,t=4;break;case"base64":this.text=rg,this.end=ag,t=3;break;default:this.write=sg,this.end=og;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Oa.allocUnsafe(t)}Vi.prototype.write=function(e){if(e.length===0)return"";var t,i;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""};Vi.prototype.end=tg;Vi.prototype.text=eg;Vi.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function La(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Zh(e,t,i){var n=t.length-1;if(n<i)return 0;var r=La(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=La(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=La(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}function Jh(e,t,i){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Qh(e){var t=this.lastTotal-this.lastNeed,i=Jh(this,e,t);if(i!==void 0)return i;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function eg(e,t){var i=Zh(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function tg(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function ig(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function ng(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function rg(e,t){var i=(e.length-t)%3;return i===0?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function ag(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function sg(e){return e.toString(this.encoding)}function og(e){return e&&e.length?this.write(e):""}});var ka=E((Cw,Ec)=>{"use strict";var Jt=Ui();Ec.exports=F;var lg=$l(),Ki;F.ReadableState=yc;var Aw=require("events").EventEmitter,gc=function(e,t){return e.listeners(t).length},Da=ba(),Xi=qi().Buffer,cg=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function dg(e){return Xi.from(e)}function ug(e){return Xi.isBuffer(e)||e instanceof cg}var mc=Object.create(Vt());mc.inherits=Kt();var Ma=require("util"),j=void 0;Ma&&Ma.debuglog?j=Ma.debuglog("stream"):j=function(){};var pg=Vl(),bc=Ea(),Zt;mc.inherits(F,Da);var Ra=["error","close","destroy","pause","resume"];function fg(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):lg(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}function yc(e,t){Ki=Ki||Tt(),e=e||{};var i=t instanceof Ki;this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=e.readableHighWaterMark,a=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:i&&(r||r===0)?this.highWaterMark=r:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new pg,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Zt||(Zt=Ia().StringDecoder),this.decoder=new Zt(e.encoding),this.encoding=e.encoding)}function F(e){if(Ki=Ki||Tt(),!(this instanceof F))return new F(e);this._readableState=new yc(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Da.call(this)}Object.defineProperty(F.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});F.prototype.destroy=bc.destroy;F.prototype._undestroy=bc.undestroy;F.prototype._destroy=function(e,t){this.push(null),t(e)};F.prototype.push=function(e,t){var i=this._readableState,n;return i.objectMode?n=!0:typeof e=="string"&&(t=t||i.defaultEncoding,t!==i.encoding&&(e=Xi.from(e,t),t=""),n=!0),vc(this,e,t,!1,n)};F.prototype.unshift=function(e){return vc(this,e,null,!0,!1)};function vc(e,t,i,n,r){var a=e._readableState;if(t===null)a.reading=!1,bg(e,a);else{var s;r||(s=hg(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Xi.prototype&&(t=dg(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Pa(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!i?(t=a.decoder.write(t),a.objectMode||t.length!==0?Pa(e,a,t,!1):xc(e,a)):Pa(e,a,t,!1))):n||(a.reading=!1)}return gg(a)}function Pa(e,t,i,n){t.flowing&&t.length===0&&!t.sync?(e.emit("data",i),e.read(0)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&ir(e)),xc(e,t)}function hg(e,t){var i;return!ug(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i}function gg(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}F.prototype.isPaused=function(){return this._readableState.flowing===!1};F.prototype.setEncoding=function(e){return Zt||(Zt=Ia().StringDecoder),this._readableState.decoder=new Zt(e),this._readableState.encoding=e,this};var pc=8388608;function mg(e){return e>=pc?e=pc:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function fc(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=mg(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}F.prototype.read=function(e){j("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return j("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ja(this):ir(this),null;if(e=fc(e,t),e===0&&t.ended)return t.length===0&&ja(this),null;var n=t.needReadable;j("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,j("length less than watermark",n)),t.ended||t.reading?(n=!1,j("reading or ended",n)):n&&(j("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=fc(i,t)));var r;return e>0?r=wc(e,t):r=null,r===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&ja(this)),r!==null&&this.emit("data",r),r};function bg(e,t){if(!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,ir(e)}}function ir(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(j("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Jt.nextTick(hc,e):hc(e))}function hc(e){j("emit readable"),e.emit("readable"),za(e)}function xc(e,t){t.readingMore||(t.readingMore=!0,Jt.nextTick(yg,e,t))}function yg(e,t){for(var i=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(j("maybeReadMore read 0"),e.read(0),i!==t.length);)i=t.length;t.readingMore=!1}F.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};F.prototype.pipe=function(e,t){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,j("pipe count=%d opts=%j",n.pipesCount,t);var r=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=r?o:w;n.endEmitted?Jt.nextTick(a):i.once("end",a),e.on("unpipe",s);function s(g,h){j("onunpipe"),g===i&&h&&h.hasUnpiped===!1&&(h.hasUnpiped=!0,c())}function o(){j("onend"),e.end()}var d=vg(i);e.on("drain",d);var l=!1;function c(){j("cleanup"),e.removeListener("close",v),e.removeListener("finish",m),e.removeListener("drain",d),e.removeListener("error",p),e.removeListener("unpipe",s),i.removeListener("end",o),i.removeListener("end",w),i.removeListener("data",u),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var f=!1;i.on("data",u);function u(g){j("ondata"),f=!1;var h=e.write(g);h===!1&&!f&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&_c(n.pipes,e)!==-1)&&!l&&(j("false write response, pause",n.awaitDrain),n.awaitDrain++,f=!0),i.pause())}function p(g){j("onerror",g),w(),e.removeListener("error",p),gc(e,"error")===0&&e.emit("error",g)}fg(e,"error",p);function v(){e.removeListener("finish",m),w()}e.once("close",v);function m(){j("onfinish"),e.removeListener("close",v),w()}e.once("finish",m);function w(){j("unpipe"),i.unpipe(e)}return e.emit("pipe",i),n.flowing||(j("pipe resume"),i.resume()),e};function vg(e){return function(){var t=e._readableState;j("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&gc(e,"data")&&(t.flowing=!0,za(e))}}F.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<r;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=_c(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i),this)};F.prototype.on=function(e,t){var i=Da.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&ir(this):Jt.nextTick(xg,this))}return i};F.prototype.addListener=F.prototype.on;function xg(e){j("readable nexttick read 0"),e.read(0)}F.prototype.resume=function(){var e=this._readableState;return e.flowing||(j("resume"),e.flowing=!0,wg(this,e)),this};function wg(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Jt.nextTick(_g,e,t))}function _g(e,t){t.reading||(j("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),za(e),t.flowing&&!t.reading&&e.read(0)}F.prototype.pause=function(){return j("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(j("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function za(e){var t=e._readableState;for(j("flow",t.flowing);t.flowing&&e.read()!==null;);}F.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;e.on("end",function(){if(j("wrapped end"),i.decoder&&!i.ended){var s=i.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(j("wrapped data"),i.decoder&&(s=i.decoder.write(s)),!(i.objectMode&&s==null)&&!(!i.objectMode&&(!s||!s.length))){var o=t.push(s);o||(n=!0,e.pause())}});for(var r in e)this[r]===void 0&&typeof e[r]=="function"&&(this[r]=(function(s){return function(){return e[s].apply(e,arguments)}})(r));for(var a=0;a<Ra.length;a++)e.on(Ra[a],this.emit.bind(this,Ra[a]));return this._read=function(s){j("wrapped _read",s),n&&(n=!1,e.resume())},this};Object.defineProperty(F.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});F._fromList=wc;function wc(e,t){if(t.length===0)return null;var i;return t.objectMode?i=t.buffer.shift():!e||e>=t.length?(t.decoder?i=t.buffer.join(""):t.buffer.length===1?i=t.buffer.head.data:i=t.buffer.concat(t.length),t.buffer.clear()):i=Eg(e,t.buffer,t.decoder),i}function Eg(e,t,i){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=i?Sg(e,t):Ag(e,t),n}function Sg(e,t){var i=t.head,n=1,r=i.data;for(e-=r.length;i=i.next;){var a=i.data,s=e>a.length?a.length:e;if(s===a.length?r+=a:r+=a.slice(0,e),e-=s,e===0){s===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=a.slice(s));break}++n}return t.length-=n,r}function Ag(e,t){var i=Xi.allocUnsafe(e),n=t.head,r=1;for(n.data.copy(i),e-=n.data.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(a.copy(i,i.length-e,0,s),e-=s,e===0){s===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++r}return t.length-=r,i}function ja(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Jt.nextTick(Cg,t,e))}function Cg(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function _c(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}});var Na=E((Tw,Cc)=>{"use strict";Cc.exports=We;var nr=Tt(),Ac=Object.create(Vt());Ac.inherits=Kt();Ac.inherits(We,nr);function Tg(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,t!=null&&this.push(t),n(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function We(e){if(!(this instanceof We))return new We(e);nr.call(this,e),this._transformState={afterTransform:Tg.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",kg)}function kg(){var e=this;typeof this._flush=="function"?this._flush(function(t,i){Sc(e,t,i)}):Sc(this,null,null)}We.prototype.push=function(e,t){return this._transformState.needTransform=!1,nr.prototype.push.call(this,e,t)};We.prototype._transform=function(e,t,i){throw new Error("_transform() is not implemented")};We.prototype._write=function(e,t,i){var n=this._transformState;if(n.writecb=i,n.writechunk=e,n.writeencoding=t,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}};We.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};We.prototype._destroy=function(e,t){var i=this;nr.prototype._destroy.call(this,e,function(n){t(n),i.emit("close")})};function Sc(e,t,i){if(t)return e.emit("error",t);if(i!=null&&e.push(i),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Oc=E((kw,Lc)=>{"use strict";Lc.exports=Zi;var Tc=Na(),kc=Object.create(Vt());kc.inherits=Kt();kc.inherits(Zi,Tc);function Zi(e){if(!(this instanceof Zi))return new Zi(e);Tc.call(this,e)}Zi.prototype._transform=function(e,t,i){i(null,e)}});var Ba=E((Q,rr)=>{"use strict";var Me=require("stream");process.env.READABLE_STREAM==="disable"&&Me?(rr.exports=Me,Q=rr.exports=Me.Readable,Q.Readable=Me.Readable,Q.Writable=Me.Writable,Q.Duplex=Me.Duplex,Q.Transform=Me.Transform,Q.PassThrough=Me.PassThrough,Q.Stream=Me):(Q=rr.exports=ka(),Q.Stream=Me||Q,Q.Readable=Q,Q.Writable=Aa(),Q.Duplex=Tt(),Q.Transform=Na(),Q.PassThrough=Oc())});var Ye=E(ce=>{"use strict";ce.base64=!0;ce.array=!0;ce.string=!0;ce.arraybuffer=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined";ce.nodebuffer=typeof Buffer!="undefined";ce.uint8array=typeof Uint8Array!="undefined";if(typeof ArrayBuffer=="undefined")ce.blob=!1;else{Fa=new ArrayBuffer(0);try{ce.blob=new Blob([Fa],{type:"application/zip"}).size===0}catch{try{Ic=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,Ha=new Ic,Ha.append(Fa),ce.blob=Ha.getBlob("application/zip").size===0}catch{ce.blob=!1}}}var Fa,Ic,Ha;try{ce.nodestream=!!Ba().Readable}catch{ce.nodestream=!1}});var Ua=E($a=>{"use strict";var Lg=$(),Og=Ye(),Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";$a.encode=function(e){for(var t=[],i,n,r,a,s,o,d,l=0,c=e.length,f=c,u=Lg.getTypeOf(e)!=="string";l<e.length;)f=c-l,u?(i=e[l++],n=l<c?e[l++]:0,r=l<c?e[l++]:0):(i=e.charCodeAt(l++),n=l<c?e.charCodeAt(l++):0,r=l<c?e.charCodeAt(l++):0),a=i>>2,s=(i&3)<<4|n>>4,o=f>1?(n&15)<<2|r>>6:64,d=f>2?r&63:64,t.push(Re.charAt(a)+Re.charAt(s)+Re.charAt(o)+Re.charAt(d));return t.join("")};$a.decode=function(e){var t,i,n,r,a,s,o,d=0,l=0,c="data:";if(e.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");e=e.replace(/[^A-Za-z0-9+/=]/g,"");var f=e.length*3/4;if(e.charAt(e.length-1)===Re.charAt(64)&&f--,e.charAt(e.length-2)===Re.charAt(64)&&f--,f%1!==0)throw new Error("Invalid base64 input, bad content length.");var u;for(Og.uint8array?u=new Uint8Array(f|0):u=new Array(f|0);d<e.length;)r=Re.indexOf(e.charAt(d++)),a=Re.indexOf(e.charAt(d++)),s=Re.indexOf(e.charAt(d++)),o=Re.indexOf(e.charAt(d++)),t=r<<2|a>>4,i=(a&15)<<4|s>>2,n=(s&3)<<6|o,u[l++]=t,s!==64&&(u[l++]=i),o!==64&&(u[l++]=n);return u}});var Ji=E((Iw,Mc)=>{"use strict";Mc.exports={isNode:typeof Buffer!="undefined",newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e=="number")throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on=="function"&&typeof e.pause=="function"&&typeof e.resume=="function"}}});var Dc=E((Mw,jc)=>{"use strict";var Rc=global.MutationObserver||global.WebKitMutationObserver,Qt;process.browser?Rc?(qa=0,Pc=new Rc(Qi),Ga=global.document.createTextNode(""),Pc.observe(Ga,{characterData:!0}),Qt=function(){Ga.data=qa=++qa%2}):!global.setImmediate&&typeof global.MessageChannel!="undefined"?(Wa=new global.MessageChannel,Wa.port1.onmessage=Qi,Qt=function(){Wa.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?Qt=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){Qi(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:Qt=function(){setTimeout(Qi,0)}:Qt=function(){process.nextTick(Qi)};var qa,Pc,Ga,Wa,Ya,en=[];function Qi(){Ya=!0;for(var e,t,i=en.length;i;){for(t=en,en=[],e=-1;++e<i;)t[e]();i=en.length}Ya=!1}jc.exports=Ig;function Ig(e){en.push(e)===1&&!Ya&&Qt()}});var Uc=E((Rw,$c)=>{"use strict";var zc=Dc();function ei(){}var ie={},Nc=["REJECTED"],Va=["FULFILLED"],Bc=["PENDING"];process.browser||(tn=["UNHANDLED"]);var tn;$c.exports=lt;function lt(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=Bc,this.queue=[],this.outcome=void 0,process.browser||(this.handled=tn),e!==ei&&Fc(this,e)}lt.prototype.finally=function(e){if(typeof e!="function")return this;var t=this.constructor;return this.then(i,n);function i(r){function a(){return r}return t.resolve(e()).then(a)}function n(r){function a(){throw r}return t.resolve(e()).then(a)}};lt.prototype.catch=function(e){return this.then(null,e)};lt.prototype.then=function(e,t){if(typeof e!="function"&&this.state===Va||typeof t!="function"&&this.state===Nc)return this;var i=new this.constructor(ei);if(process.browser||this.handled===tn&&(this.handled=null),this.state!==Bc){var n=this.state===Va?e:t;Ka(i,n,this.outcome)}else this.queue.push(new nn(i,e,t));return i};function nn(e,t,i){this.promise=e,typeof t=="function"&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof i=="function"&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}nn.prototype.callFulfilled=function(e){ie.resolve(this.promise,e)};nn.prototype.otherCallFulfilled=function(e){Ka(this.promise,this.onFulfilled,e)};nn.prototype.callRejected=function(e){ie.reject(this.promise,e)};nn.prototype.otherCallRejected=function(e){Ka(this.promise,this.onRejected,e)};function Ka(e,t,i){zc(function(){var n;try{n=t(i)}catch(r){return ie.reject(e,r)}n===e?ie.reject(e,new TypeError("Cannot resolve promise with itself")):ie.resolve(e,n)})}ie.resolve=function(e,t){var i=Hc(Mg,t);if(i.status==="error")return ie.reject(e,i.value);var n=i.value;if(n)Fc(e,n);else{e.state=Va,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e};ie.reject=function(e,t){e.state=Nc,e.outcome=t,process.browser||e.handled===tn&&zc(function(){e.handled===tn&&process.emit("unhandledRejection",t,e)});for(var i=-1,n=e.queue.length;++i<n;)e.queue[i].callRejected(t);return e};function Mg(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function Fc(e,t){var i=!1;function n(o){i||(i=!0,ie.reject(e,o))}function r(o){i||(i=!0,ie.resolve(e,o))}function a(){t(r,n)}var s=Hc(a);s.status==="error"&&n(s.value)}function Hc(e,t){var i={};try{i.value=e(t),i.status="success"}catch(n){i.status="error",i.value=n}return i}lt.resolve=Rg;function Rg(e){return e instanceof this?e:ie.resolve(new this(ei),e)}lt.reject=Pg;function Pg(e){var t=new this(ei);return ie.reject(t,e)}lt.all=jg;function jg(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var i=e.length,n=!1;if(!i)return this.resolve([]);for(var r=new Array(i),a=0,s=-1,o=new this(ei);++s<i;)d(e[s],s);return o;function d(l,c){t.resolve(l).then(f,function(u){n||(n=!0,ie.reject(o,u))});function f(u){r[c]=u,++a===i&&!n&&(n=!0,ie.resolve(o,r))}}}lt.race=Dg;function Dg(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var i=e.length,n=!1;if(!i)return this.resolve([]);for(var r=-1,a=new this(ei);++r<i;)s(e[r]);return a;function s(o){t.resolve(o).then(function(d){n||(n=!0,ie.resolve(a,d))},function(d){n||(n=!0,ie.reject(a,d))})}}});var ti=E((Pw,qc)=>{"use strict";var Xa=null;typeof Promise!="undefined"?Xa=Promise:Xa=Uc();qc.exports={Promise:Xa}});var Wc=E(Gc=>{"use strict";(function(e,t){"use strict";if(e.setImmediate)return;var i=1,n={},r=!1,a=e.document,s;function o(h){typeof h!="function"&&(h=new Function(""+h));for(var x=new Array(arguments.length-1),y=0;y<x.length;y++)x[y]=arguments[y+1];var b={callback:h,args:x};return n[i]=b,s(i),i++}function d(h){delete n[h]}function l(h){var x=h.callback,y=h.args;switch(y.length){case 0:x();break;case 1:x(y[0]);break;case 2:x(y[0],y[1]);break;case 3:x(y[0],y[1],y[2]);break;default:x.apply(t,y);break}}function c(h){if(r)setTimeout(c,0,h);else{var x=n[h];if(x){r=!0;try{l(x)}finally{d(h),r=!1}}}}function f(){s=function(h){process.nextTick(function(){c(h)})}}function u(){if(e.postMessage&&!e.importScripts){var h=!0,x=e.onmessage;return e.onmessage=function(){h=!1},e.postMessage("","*"),e.onmessage=x,h}}function p(){var h="setImmediate$"+Math.random()+"$",x=function(y){y.source===e&&typeof y.data=="string"&&y.data.indexOf(h)===0&&c(+y.data.slice(h.length))};e.addEventListener?e.addEventListener("message",x,!1):e.attachEvent("onmessage",x),s=function(y){e.postMessage(h+y,"*")}}function v(){var h=new MessageChannel;h.port1.onmessage=function(x){var y=x.data;c(y)},s=function(x){h.port2.postMessage(x)}}function m(){var h=a.documentElement;s=function(x){var y=a.createElement("script");y.onreadystatechange=function(){c(x),y.onreadystatechange=null,h.removeChild(y),y=null},h.appendChild(y)}}function w(){s=function(h){setTimeout(c,0,h)}}var g=Object.getPrototypeOf&&Object.getPrototypeOf(e);g=g&&g.setTimeout?g:e,{}.toString.call(e.process)==="[object process]"?f():u()?p():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?m():w(),g.setImmediate=o,g.clearImmediate=d})(typeof self=="undefined"?typeof global=="undefined"?Gc:global:self)});var $=E(K=>{"use strict";var ct=Ye(),zg=Ua(),ii=Ji(),Za=ti();Wc();function Ng(e){var t=null;return ct.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),sr(e,t)}K.newBlob=function(e,t){K.checkSupport("blob");try{return new Blob([e],{type:t})}catch{try{var i=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,n=new i;return n.append(e),n.getBlob(t)}catch{throw new Error("Bug : can't construct the Blob.")}}};function rn(e){return e}function sr(e,t){for(var i=0;i<e.length;++i)t[i]=e.charCodeAt(i)&255;return t}var ar={stringifyByChunk:function(e,t,i){var n=[],r=0,a=e.length;if(a<=i)return String.fromCharCode.apply(null,e);for(;r<a;)t==="array"||t==="nodebuffer"?n.push(String.fromCharCode.apply(null,e.slice(r,Math.min(r+i,a)))):n.push(String.fromCharCode.apply(null,e.subarray(r,Math.min(r+i,a)))),r+=i;return n.join("")},stringifyByChar:function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},applyCanBeUsed:{uint8array:(function(){try{return ct.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return ct.nodebuffer&&String.fromCharCode.apply(null,ii.allocBuffer(1)).length===1}catch{return!1}})()}};function an(e){var t=65536,i=K.getTypeOf(e),n=!0;if(i==="uint8array"?n=ar.applyCanBeUsed.uint8array:i==="nodebuffer"&&(n=ar.applyCanBeUsed.nodebuffer),n)for(;t>1;)try{return ar.stringifyByChunk(e,i,t)}catch{t=Math.floor(t/2)}return ar.stringifyByChar(e)}K.applyFromCharCode=an;function or(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}var dt={};dt.string={string:rn,array:function(e){return sr(e,new Array(e.length))},arraybuffer:function(e){return dt.string.uint8array(e).buffer},uint8array:function(e){return sr(e,new Uint8Array(e.length))},nodebuffer:function(e){return sr(e,ii.allocBuffer(e.length))}};dt.array={string:an,array:rn,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return ii.newBufferFrom(e)}};dt.arraybuffer={string:function(e){return an(new Uint8Array(e))},array:function(e){return or(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:rn,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return ii.newBufferFrom(new Uint8Array(e))}};dt.uint8array={string:an,array:function(e){return or(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:rn,nodebuffer:function(e){return ii.newBufferFrom(e)}};dt.nodebuffer={string:an,array:function(e){return or(e,new Array(e.length))},arraybuffer:function(e){return dt.nodebuffer.uint8array(e).buffer},uint8array:function(e){return or(e,new Uint8Array(e.length))},nodebuffer:rn};K.transformTo=function(e,t){if(t||(t=""),!e)return t;K.checkSupport(e);var i=K.getTypeOf(t),n=dt[i][e](t);return n};K.resolve=function(e){for(var t=e.split("/"),i=[],n=0;n<t.length;n++){var r=t[n];r==="."||r===""&&n!==0&&n!==t.length-1||(r===".."?i.pop():i.push(r))}return i.join("/")};K.getTypeOf=function(e){if(typeof e=="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(ct.nodebuffer&&ii.isBuffer(e))return"nodebuffer";if(ct.uint8array&&e instanceof Uint8Array)return"uint8array";if(ct.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"};K.checkSupport=function(e){var t=ct[e.toLowerCase()];if(!t)throw new Error(e+" is not supported by this platform")};K.MAX_VALUE_16BITS=65535;K.MAX_VALUE_32BITS=-1;K.pretty=function(e){var t="",i,n;for(n=0;n<(e||"").length;n++)i=e.charCodeAt(n),t+="\\x"+(i<16?"0":"")+i.toString(16).toUpperCase();return t};K.delay=function(e,t,i){setImmediate(function(){e.apply(i||null,t||[])})};K.inherits=function(e,t){var i=function(){};i.prototype=t.prototype,e.prototype=new i};K.extend=function(){var e={},t,i;for(t=0;t<arguments.length;t++)for(i in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],i)&&typeof e[i]=="undefined"&&(e[i]=arguments[t][i]);return e};K.prepareContent=function(e,t,i,n,r){var a=Za.Promise.resolve(t).then(function(s){var o=ct.blob&&(s instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(s))!==-1);return o&&typeof FileReader!="undefined"?new Za.Promise(function(d,l){var c=new FileReader;c.onload=function(f){d(f.target.result)},c.onerror=function(f){l(f.target.error)},c.readAsArrayBuffer(s)}):s});return a.then(function(s){var o=K.getTypeOf(s);return o?(o==="arraybuffer"?s=K.transformTo("uint8array",s):o==="string"&&(r?s=zg.decode(s):i&&n!==!0&&(s=Ng(s))),s):Za.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var de=E((zw,Vc)=>{"use strict";function Yc(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}Yc.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return this.isFinished?!1:(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var i=0;i<this._listeners[e].length;i++)this._listeners[e][i].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(i){t.processChunk(i)}),e.on("end",function(){t.end()}),e.on("error",function(i){t.error(i)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};Vc.exports=Yc});var ri=E(ut=>{"use strict";var ni=$(),kt=Ye(),Bg=Ji(),lr=de(),sn=new Array(256);for(Ve=0;Ve<256;Ve++)sn[Ve]=Ve>=252?6:Ve>=248?5:Ve>=240?4:Ve>=224?3:Ve>=192?2:1;var Ve;sn[254]=sn[254]=1;var Fg=function(e){var t,i,n,r,a,s=e.length,o=0;for(r=0;r<s;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(kt.uint8array?t=new Uint8Array(o):t=new Array(o),a=0,r=0;a<o;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|i&63):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|i&63):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|i&63);return t},Hg=function(e,t){var i;for(t=t||e.length,t>e.length&&(t=e.length),i=t-1;i>=0&&(e[i]&192)===128;)i--;return i<0||i===0?t:i+sn[e[i]]>t?i:t},$g=function(e){var t,i,n,r,a=e.length,s=new Array(a*2);for(i=0,t=0;t<a;){if(n=e[t++],n<128){s[i++]=n;continue}if(r=sn[n],r>4){s[i++]=65533,t+=r-1;continue}for(n&=r===2?31:r===3?15:7;r>1&&t<a;)n=n<<6|e[t++]&63,r--;if(r>1){s[i++]=65533;continue}n<65536?s[i++]=n:(n-=65536,s[i++]=55296|n>>10&1023,s[i++]=56320|n&1023)}return s.length!==i&&(s.subarray?s=s.subarray(0,i):s.length=i),ni.applyFromCharCode(s)};ut.utf8encode=function(t){return kt.nodebuffer?Bg.newBufferFrom(t,"utf-8"):Fg(t)};ut.utf8decode=function(t){return kt.nodebuffer?ni.transformTo("nodebuffer",t).toString("utf-8"):(t=ni.transformTo(kt.uint8array?"uint8array":"array",t),$g(t))};function cr(){lr.call(this,"utf-8 decode"),this.leftOver=null}ni.inherits(cr,lr);cr.prototype.processChunk=function(e){var t=ni.transformTo(kt.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(kt.uint8array){var i=t;t=new Uint8Array(i.length+this.leftOver.length),t.set(this.leftOver,0),t.set(i,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=Hg(t),r=t;n!==t.length&&(kt.uint8array?(r=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(r=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:ut.utf8decode(r),meta:e.meta})};cr.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:ut.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};ut.Utf8DecodeWorker=cr;function Ja(){lr.call(this,"utf-8 encode")}ni.inherits(Ja,lr);Ja.prototype.processChunk=function(e){this.push({data:ut.utf8encode(e.data),meta:e.meta})};ut.Utf8EncodeWorker=Ja});var Jc=E((Bw,Zc)=>{"use strict";var Kc=de(),Xc=$();function Qa(e){Kc.call(this,"ConvertWorker to "+e),this.destType=e}Xc.inherits(Qa,Kc);Qa.prototype.processChunk=function(e){this.push({data:Xc.transformTo(this.destType,e.data),meta:e.meta})};Zc.exports=Qa});var td=E((Fw,ed)=>{"use strict";var Qc=Ba().Readable,Ug=$();Ug.inherits(es,Qc);function es(e,t,i){Qc.call(this,t),this._helper=e;var n=this;e.on("data",function(r,a){n.push(r)||n._helper.pause(),i&&i(a)}).on("error",function(r){n.emit("error",r)}).on("end",function(){n.push(null)})}es.prototype._read=function(){this._helper.resume()};ed.exports=es});var ts=E((Hw,rd)=>{"use strict";var Lt=$(),qg=Jc(),Gg=de(),Wg=Ua(),Yg=Ye(),Vg=ti(),id=null;if(Yg.nodestream)try{id=td()}catch{}function Kg(e,t,i){switch(e){case"blob":return Lt.newBlob(Lt.transformTo("arraybuffer",t),i);case"base64":return Wg.encode(t);default:return Lt.transformTo(e,t)}}function Xg(e,t){var i,n=0,r=null,a=0;for(i=0;i<t.length;i++)a+=t[i].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(r=new Uint8Array(a),i=0;i<t.length;i++)r.set(t[i],n),n+=t[i].length;return r;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}function Zg(e,t){return new Vg.Promise(function(i,n){var r=[],a=e._internalType,s=e._outputType,o=e._mimeType;e.on("data",function(d,l){r.push(d),t&&t(l)}).on("error",function(d){r=[],n(d)}).on("end",function(){try{var d=Kg(s,Xg(a,r),o);i(d)}catch(l){n(l)}r=[]}).resume()})}function nd(e,t,i){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string";break}try{this._internalType=n,this._outputType=t,this._mimeType=i,Lt.checkSupport(n),this._worker=e.pipe(new qg(n)),e.lock()}catch(r){this._worker=new Gg("error"),this._worker.error(r)}}nd.prototype={accumulate:function(e){return Zg(this,e)},on:function(e,t){var i=this;return e==="data"?this._worker.on(e,function(n){t.call(i,n.data,n.meta)}):this._worker.on(e,function(){Lt.delay(t,arguments,i)}),this},resume:function(){return Lt.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Lt.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new id(this,{objectMode:this._outputType!=="nodebuffer"},e)}};rd.exports=nd});var is=E(Se=>{"use strict";Se.base64=!1;Se.binary=!1;Se.dir=!1;Se.createFolders=!0;Se.date=null;Se.compression=null;Se.compressionOptions=null;Se.comment=null;Se.unixPermissions=null;Se.dosPermissions=null});var ns=E((Uw,ad)=>{"use strict";var dr=$(),ur=de(),Jg=16*1024;function ai(e){ur.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(i){t.dataIsReady=!0,t.data=i,t.max=i&&i.length||0,t.type=dr.getTypeOf(i),t.isPaused||t._tickAndRepeat()},function(i){t.error(i)})}dr.inherits(ai,ur);ai.prototype.cleanUp=function(){ur.prototype.cleanUp.call(this),this.data=null};ai.prototype.resume=function(){return ur.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,dr.delay(this._tickAndRepeat,[],this)),!0):!1};ai.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(dr.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};ai.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=Jg,t=null,i=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,i);break;case"uint8array":t=this.data.subarray(this.index,i);break;case"array":case"nodebuffer":t=this.data.slice(this.index,i);break}return this.index=i,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})};ad.exports=ai});var pr=E((qw,od)=>{"use strict";var Qg=$();function em(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[i]=e}return t}var sd=em();function tm(e,t,i,n){var r=sd,a=n+i;e=e^-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}function im(e,t,i,n){var r=sd,a=n+i;e=e^-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t.charCodeAt(s))&255];return e^-1}od.exports=function(t,i){if(typeof t=="undefined"||!t.length)return 0;var n=Qg.getTypeOf(t)!=="string";return n?tm(i|0,t,t.length,0):im(i|0,t,t.length,0)}});var as=E((Gw,cd)=>{"use strict";var ld=de(),nm=pr(),rm=$();function rs(){ld.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}rm.inherits(rs,ld);rs.prototype.processChunk=function(e){this.streamInfo.crc32=nm(e.data,this.streamInfo.crc32||0),this.push(e)};cd.exports=rs});var ud=E((Ww,dd)=>{"use strict";var am=$(),ss=de();function os(e){ss.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}am.inherits(os,ss);os.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}ss.prototype.processChunk.call(this,e)};dd.exports=os});var fr=E((Yw,hd)=>{"use strict";var pd=ti(),fd=ns(),sm=as(),ls=ud();function cs(e,t,i,n,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=n,this.compressedContent=r}cs.prototype={getContentWorker:function(){var e=new fd(pd.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new ls("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new fd(pd.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};cs.createWorkerFrom=function(e,t,i){return e.pipe(new sm).pipe(new ls("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new ls("compressedSize")).withStreamInfo("compression",t)};hd.exports=cs});var yd=E((Vw,bd)=>{"use strict";var om=ts(),lm=ns(),ds=ri(),us=fr(),gd=de(),ps=function(e,t,i){this.name=e,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=t,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}};ps.prototype={internalStream:function(e){var t=null,i="string";try{if(!e)throw new Error("No output type specified.");i=e.toLowerCase();var n=i==="string"||i==="text";(i==="binarystring"||i==="text")&&(i="string"),t=this._decompressWorker();var r=!this._dataBinary;r&&!n&&(t=t.pipe(new ds.Utf8EncodeWorker)),!r&&n&&(t=t.pipe(new ds.Utf8DecodeWorker))}catch(a){t=new gd("error"),t.error(a)}return new om(t,i,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof us&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new ds.Utf8EncodeWorker)),us.createWorkerFrom(i,e,t)},_decompressWorker:function(){return this._data instanceof us?this._data.getContentWorker():this._data instanceof gd?this._data:new lm(this._data)}};var md=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],cm=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(hr=0;hr<md.length;hr++)ps.prototype[md[hr]]=cm;var hr;bd.exports=ps});var Ke=E(se=>{"use strict";var dm=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function um(e,t){return Object.prototype.hasOwnProperty.call(e,t)}se.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if(typeof i!="object")throw new TypeError(i+"must be non-object");for(var n in i)um(i,n)&&(e[n]=i[n])}}return e};se.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var pm={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray){e.set(t.subarray(i,i+n),r);return}for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){var t,i,n,r,a,s;for(n=0,t=0,i=e.length;t<i;t++)n+=e[t].length;for(s=new Uint8Array(n),r=0,t=0,i=e.length;t<i;t++)a=e[t],s.set(a,r),r+=a.length;return s}},fm={arraySet:function(e,t,i,n,r){for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){return[].concat.apply([],e)}};se.setTyped=function(e){e?(se.Buf8=Uint8Array,se.Buf16=Uint16Array,se.Buf32=Int32Array,se.assign(se,pm)):(se.Buf8=Array,se.Buf16=Array,se.Buf32=Array,se.assign(se,fm))};se.setTyped(dm)});var Hd=E(li=>{"use strict";var hm=Ke(),gm=4,vd=0,xd=1,mm=2;function oi(e){for(var t=e.length;--t>=0;)e[t]=0}var bm=0,Cd=1,ym=2,vm=3,xm=258,vs=29,pn=256,ln=pn+1+vs,si=30,xs=19,Td=2*ln+1,Ot=15,fs=16,wm=7,ws=256,kd=16,Ld=17,Od=18,bs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],gr=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Id=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Em=512,Xe=new Array((ln+2)*2);oi(Xe);var on=new Array(si*2);oi(on);var cn=new Array(Em);oi(cn);var dn=new Array(xm-vm+1);oi(dn);var _s=new Array(vs);oi(_s);var mr=new Array(si);oi(mr);function hs(e,t,i,n,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}var Md,Rd,Pd;function gs(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function jd(e){return e<256?cn[e]:cn[256+(e>>>7)]}function un(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function le(e,t,i){e.bi_valid>fs-i?(e.bi_buf|=t<<e.bi_valid&65535,un(e,e.bi_buf),e.bi_buf=t>>fs-e.bi_valid,e.bi_valid+=i-fs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function Pe(e,t,i){le(e,i[t*2],i[t*2+1])}function Dd(e,t){var i=0;do i|=e&1,e>>>=1,i<<=1;while(--t>0);return i>>>1}function Sm(e){e.bi_valid===16?(un(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Am(e,t){var i=t.dyn_tree,n=t.max_code,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,d=t.stat_desc.max_length,l,c,f,u,p,v,m=0;for(u=0;u<=Ot;u++)e.bl_count[u]=0;for(i[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Td;l++)c=e.heap[l],u=i[i[c*2+1]*2+1]+1,u>d&&(u=d,m++),i[c*2+1]=u,!(c>n)&&(e.bl_count[u]++,p=0,c>=o&&(p=s[c-o]),v=i[c*2],e.opt_len+=v*(u+p),a&&(e.static_len+=v*(r[c*2+1]+p)));if(m!==0){do{for(u=d-1;e.bl_count[u]===0;)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[d]--,m-=2}while(m>0);for(u=d;u!==0;u--)for(c=e.bl_count[u];c!==0;)f=e.heap[--l],!(f>n)&&(i[f*2+1]!==u&&(e.opt_len+=(u-i[f*2+1])*i[f*2],i[f*2+1]=u),c--)}}function zd(e,t,i){var n=new Array(Ot+1),r=0,a,s;for(a=1;a<=Ot;a++)n[a]=r=r+i[a-1]<<1;for(s=0;s<=t;s++){var o=e[s*2+1];o!==0&&(e[s*2]=Dd(n[o]++,o))}}function Cm(){var e,t,i,n,r,a=new Array(Ot+1);for(i=0,n=0;n<vs-1;n++)for(_s[n]=i,e=0;e<1<<bs[n];e++)dn[i++]=n;for(dn[i-1]=n,r=0,n=0;n<16;n++)for(mr[n]=r,e=0;e<1<<gr[n];e++)cn[r++]=n;for(r>>=7;n<si;n++)for(mr[n]=r<<7,e=0;e<1<<gr[n]-7;e++)cn[256+r++]=n;for(t=0;t<=Ot;t++)a[t]=0;for(e=0;e<=143;)Xe[e*2+1]=8,e++,a[8]++;for(;e<=255;)Xe[e*2+1]=9,e++,a[9]++;for(;e<=279;)Xe[e*2+1]=7,e++,a[7]++;for(;e<=287;)Xe[e*2+1]=8,e++,a[8]++;for(zd(Xe,ln+1,a),e=0;e<si;e++)on[e*2+1]=5,on[e*2]=Dd(e,5);Md=new hs(Xe,bs,pn+1,ln,Ot),Rd=new hs(on,gr,0,si,Ot),Pd=new hs(new Array(0),_m,0,xs,wm)}function Nd(e){var t;for(t=0;t<ln;t++)e.dyn_ltree[t*2]=0;for(t=0;t<si;t++)e.dyn_dtree[t*2]=0;for(t=0;t<xs;t++)e.bl_tree[t*2]=0;e.dyn_ltree[ws*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Bd(e){e.bi_valid>8?un(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Tm(e,t,i,n){Bd(e),n&&(un(e,i),un(e,~i)),hm.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}function wd(e,t,i,n){var r=t*2,a=i*2;return e[r]<e[a]||e[r]===e[a]&&n[t]<=n[i]}function ms(e,t,i){for(var n=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&wd(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!wd(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function _d(e,t,i){var n,r,a=0,s,o;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],r=e.pending_buf[e.l_buf+a],a++,n===0?Pe(e,r,t):(s=dn[r],Pe(e,s+pn+1,t),o=bs[s],o!==0&&(r-=_s[s],le(e,r,o)),n--,s=jd(n),Pe(e,s,i),o=gr[s],o!==0&&(n-=mr[s],le(e,n,o)));while(a<e.last_lit);Pe(e,ws,t)}function ys(e,t){var i=t.dyn_tree,n=t.stat_desc.static_tree,r=t.stat_desc.has_stree,a=t.stat_desc.elems,s,o,d=-1,l;for(e.heap_len=0,e.heap_max=Td,s=0;s<a;s++)i[s*2]!==0?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):i[s*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=d<2?++d:0,i[l*2]=1,e.depth[l]=0,e.opt_len--,r&&(e.static_len-=n[l*2+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)ms(e,i,s);l=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ms(e,i,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,i[l*2]=i[s*2]+i[o*2],e.depth[l]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,i[s*2+1]=i[o*2+1]=l,e.heap[1]=l++,ms(e,i,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Am(e,t),zd(i,d,e.bl_count)}function Ed(e,t,i){var n,r=-1,a,s=t[1],o=0,d=7,l=4;for(s===0&&(d=138,l=3),t[(i+1)*2+1]=65535,n=0;n<=i;n++)a=s,s=t[(n+1)*2+1],!(++o<d&&a===s)&&(o<l?e.bl_tree[a*2]+=o:a!==0?(a!==r&&e.bl_tree[a*2]++,e.bl_tree[kd*2]++):o<=10?e.bl_tree[Ld*2]++:e.bl_tree[Od*2]++,o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4))}function Sd(e,t,i){var n,r=-1,a,s=t[1],o=0,d=7,l=4;for(s===0&&(d=138,l=3),n=0;n<=i;n++)if(a=s,s=t[(n+1)*2+1],!(++o<d&&a===s)){if(o<l)do Pe(e,a,e.bl_tree);while(--o!==0);else a!==0?(a!==r&&(Pe(e,a,e.bl_tree),o--),Pe(e,kd,e.bl_tree),le(e,o-3,2)):o<=10?(Pe(e,Ld,e.bl_tree),le(e,o-3,3)):(Pe(e,Od,e.bl_tree),le(e,o-11,7));o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4)}}function km(e){var t;for(Ed(e,e.dyn_ltree,e.l_desc.max_code),Ed(e,e.dyn_dtree,e.d_desc.max_code),ys(e,e.bl_desc),t=xs-1;t>=3&&e.bl_tree[Id[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Lm(e,t,i,n){var r;for(le(e,t-257,5),le(e,i-1,5),le(e,n-4,4),r=0;r<n;r++)le(e,e.bl_tree[Id[r]*2+1],3);Sd(e,e.dyn_ltree,t-1),Sd(e,e.dyn_dtree,i-1)}function Om(e){var t=4093624447,i;for(i=0;i<=31;i++,t>>>=1)if(t&1&&e.dyn_ltree[i*2]!==0)return vd;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return xd;for(i=32;i<pn;i++)if(e.dyn_ltree[i*2]!==0)return xd;return vd}var Ad=!1;function Im(e){Ad||(Cm(),Ad=!0),e.l_desc=new gs(e.dyn_ltree,Md),e.d_desc=new gs(e.dyn_dtree,Rd),e.bl_desc=new gs(e.bl_tree,Pd),e.bi_buf=0,e.bi_valid=0,Nd(e)}function Fd(e,t,i,n){le(e,(bm<<1)+(n?1:0),3),Tm(e,t,i,!0)}function Mm(e){le(e,Cd<<1,3),Pe(e,ws,Xe),Sm(e)}function Rm(e,t,i,n){var r,a,s=0;e.level>0?(e.strm.data_type===mm&&(e.strm.data_type=Om(e)),ys(e,e.l_desc),ys(e,e.d_desc),s=km(e),r=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=r&&(r=a)):r=a=i+5,i+4<=r&&t!==-1?Fd(e,t,i,n):e.strategy===gm||a===r?(le(e,(Cd<<1)+(n?1:0),3),_d(e,Xe,on)):(le(e,(ym<<1)+(n?1:0),3),Lm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),_d(e,e.dyn_ltree,e.dyn_dtree)),Nd(e),n&&Bd(e)}function Pm(e,t,i){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=i&255,e.last_lit++,t===0?e.dyn_ltree[i*2]++:(e.matches++,t--,e.dyn_ltree[(dn[i]+pn+1)*2]++,e.dyn_dtree[jd(t)*2]++),e.last_lit===e.lit_bufsize-1}li._tr_init=Im;li._tr_stored_block=Fd;li._tr_flush_block=Rm;li._tr_tally=Pm;li._tr_align=Mm});var Es=E((Zw,$d)=>{"use strict";function jm(e,t,i,n){for(var r=e&65535|0,a=e>>>16&65535|0,s=0;i!==0;){s=i>2e3?2e3:i,i-=s;do r=r+t[n++]|0,a=a+r|0;while(--s);r%=65521,a%=65521}return r|a<<16|0}$d.exports=jm});var Ss=E((Jw,Ud)=>{"use strict";function Dm(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[i]=e}return t}var zm=Dm();function Nm(e,t,i,n){var r=zm,a=n+i;e^=-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}Ud.exports=Nm});var br=E((Qw,qd)=>{"use strict";qd.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Qd=E(ze=>{"use strict";var oe=Ke(),be=Hd(),Vd=Es(),pt=Ss(),Bm=br(),Pt=0,Fm=1,Hm=3,bt=4,Gd=5,De=0,Wd=1,ye=-2,$m=-3,As=-5,Um=-1,qm=1,yr=2,Gm=3,Wm=4,Ym=0,Vm=2,_r=8,Km=9,Xm=15,Zm=8,Jm=29,Qm=256,Ts=Qm+1+Jm,eb=30,tb=19,ib=2*Ts+1,nb=15,R=3,gt=258,Ae=gt+R+1,rb=32,Er=42,ks=69,vr=73,xr=91,wr=103,It=113,hn=666,J=1,gn=2,Mt=3,ui=4,ab=3;function mt(e,t){return e.msg=Bm[t],t}function Yd(e){return(e<<1)-(e>4?9:0)}function ht(e){for(var t=e.length;--t>=0;)e[t]=0}function ft(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),i!==0&&(oe.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,t.pending===0&&(t.pending_out=0))}function ee(e,t){be._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ft(e.strm)}function P(e,t){e.pending_buf[e.pending++]=t}function fn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function sb(e,t,i,n){var r=e.avail_in;return r>n&&(r=n),r===0?0:(e.avail_in-=r,oe.arraySet(t,e.input,e.next_in,r,i),e.state.wrap===1?e.adler=Vd(e.adler,t,r,i):e.state.wrap===2&&(e.adler=pt(e.adler,t,r,i)),e.next_in+=r,e.total_in+=r,r)}function Kd(e,t){var i=e.max_chain_length,n=e.strstart,r,a,s=e.prev_length,o=e.nice_match,d=e.strstart>e.w_size-Ae?e.strstart-(e.w_size-Ae):0,l=e.window,c=e.w_mask,f=e.prev,u=e.strstart+gt,p=l[n+s-1],v=l[n+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do if(r=t,!(l[r+s]!==v||l[r+s-1]!==p||l[r]!==l[n]||l[++r]!==l[n+1])){n+=2,r++;do;while(l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&n<u);if(a=gt-(u-n),n=u-gt,a>s){if(e.match_start=t,s=a,a>=o)break;p=l[n+s-1],v=l[n+s]}}while((t=f[t&c])>d&&--i!==0);return s<=e.lookahead?s:e.lookahead}function Rt(e){var t=e.w_size,i,n,r,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ae)){oe.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,i=n;do r=e.head[--i],e.head[i]=r>=t?r-t:0;while(--n);n=t,i=n;do r=e.prev[--i],e.prev[i]=r>=t?r-t:0;while(--n);a+=t}if(e.strm.avail_in===0)break;if(n=sb(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=R)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+R-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<R)););}while(e.lookahead<Ae&&e.strm.avail_in!==0)}function ob(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Rt(e),e.lookahead===0&&t===Pt)return J;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,ee(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Ae&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):(e.strstart>e.block_start&&(ee(e,!1),e.strm.avail_out===0),J)}function Cs(e,t){for(var i,n;;){if(e.lookahead<Ae){if(Rt(e),e.lookahead<Ae&&t===Pt)return J;if(e.lookahead===0)break}if(i=0,e.lookahead>=R&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),i!==0&&e.strstart-i<=e.w_size-Ae&&(e.match_length=Kd(e,i)),e.match_length>=R)if(n=be._tr_tally(e,e.strstart-e.match_start,e.match_length-R),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=R){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=be._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=e.strstart<R-1?e.strstart:R-1,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:gn}function ci(e,t){for(var i,n,r;;){if(e.lookahead<Ae){if(Rt(e),e.lookahead<Ae&&t===Pt)return J;if(e.lookahead===0)break}if(i=0,e.lookahead>=R&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=R-1,i!==0&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-Ae&&(e.match_length=Kd(e,i),e.match_length<=5&&(e.strategy===qm||e.match_length===R&&e.strstart-e.match_start>4096)&&(e.match_length=R-1)),e.prev_length>=R&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-R,n=be._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-R),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=R-1,e.strstart++,n&&(ee(e,!1),e.strm.avail_out===0))return J}else if(e.match_available){if(n=be._tr_tally(e,0,e.window[e.strstart-1]),n&&ee(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return J}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=be._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<R-1?e.strstart:R-1,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:gn}function lb(e,t){for(var i,n,r,a,s=e.window;;){if(e.lookahead<=gt){if(Rt(e),e.lookahead<=gt&&t===Pt)return J;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=R&&e.strstart>0&&(r=e.strstart-1,n=s[r],n===s[++r]&&n===s[++r]&&n===s[++r])){a=e.strstart+gt;do;while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<a);e.match_length=gt-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=R?(i=be._tr_tally(e,1,e.match_length-R),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=be._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:gn}function cb(e,t){for(var i;;){if(e.lookahead===0&&(Rt(e),e.lookahead===0)){if(t===Pt)return J;break}if(e.match_length=0,i=be._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===bt?(ee(e,!0),e.strm.avail_out===0?Mt:ui):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:gn}function je(e,t,i,n,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=n,this.func=r}var di;di=[new je(0,0,0,0,ob),new je(4,4,8,4,Cs),new je(4,5,16,8,Cs),new je(4,6,32,32,Cs),new je(4,4,16,16,ci),new je(8,16,32,32,ci),new je(8,16,128,128,ci),new je(8,32,128,256,ci),new je(32,128,258,1024,ci),new je(32,258,258,4096,ci)];function db(e){e.window_size=2*e.w_size,ht(e.head),e.max_lazy_match=di[e.level].max_lazy,e.good_match=di[e.level].good_length,e.nice_match=di[e.level].nice_length,e.max_chain_length=di[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=R-1,e.match_available=0,e.ins_h=0}function ub(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_r,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new oe.Buf16(ib*2),this.dyn_dtree=new oe.Buf16((2*eb+1)*2),this.bl_tree=new oe.Buf16((2*tb+1)*2),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new oe.Buf16(nb+1),this.heap=new oe.Buf16(2*Ts+1),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new oe.Buf16(2*Ts+1),ht(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Xd(e){var t;return!e||!e.state?mt(e,ye):(e.total_in=e.total_out=0,e.data_type=Vm,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Er:It,e.adler=t.wrap===2?0:1,t.last_flush=Pt,be._tr_init(t),De)}function Zd(e){var t=Xd(e);return t===De&&db(e.state),t}function pb(e,t){return!e||!e.state||e.state.wrap!==2?ye:(e.state.gzhead=t,De)}function Jd(e,t,i,n,r,a){if(!e)return ye;var s=1;if(t===Um&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>Km||i!==_r||n<8||n>15||t<0||t>9||a<0||a>Wm)return mt(e,ye);n===8&&(n=9);var o=new ub;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+R-1)/R),o.window=new oe.Buf8(o.w_size*2),o.head=new oe.Buf16(o.hash_size),o.prev=new oe.Buf16(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new oe.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=i,Zd(e)}function fb(e,t){return Jd(e,t,_r,Xm,Zm,Ym)}function hb(e,t){var i,n,r,a;if(!e||!e.state||t>Gd||t<0)return e?mt(e,ye):ye;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===hn&&t!==bt)return mt(e,e.avail_out===0?As:ye);if(n.strm=e,i=n.last_flush,n.last_flush=t,n.status===Er)if(n.wrap===2)e.adler=0,P(n,31),P(n,139),P(n,8),n.gzhead?(P(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),P(n,n.gzhead.time&255),P(n,n.gzhead.time>>8&255),P(n,n.gzhead.time>>16&255),P(n,n.gzhead.time>>24&255),P(n,n.level===9?2:n.strategy>=yr||n.level<2?4:0),P(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(P(n,n.gzhead.extra.length&255),P(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=pt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ks):(P(n,0),P(n,0),P(n,0),P(n,0),P(n,0),P(n,n.level===9?2:n.strategy>=yr||n.level<2?4:0),P(n,ab),n.status=It);else{var s=_r+(n.w_bits-8<<4)<<8,o=-1;n.strategy>=yr||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,s|=o<<6,n.strstart!==0&&(s|=rb),s+=31-s%31,n.status=It,fn(n,s),n.strstart!==0&&(fn(n,e.adler>>>16),fn(n,e.adler&65535)),e.adler=1}if(n.status===ks)if(n.gzhead.extra){for(r=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),ft(e),r=n.pending,n.pending===n.pending_buf_size));)P(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=vr)}else n.status=vr;if(n.status===vr)if(n.gzhead.name){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),ft(e),r=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,P(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),a===0&&(n.gzindex=0,n.status=xr)}else n.status=xr;if(n.status===xr)if(n.gzhead.comment){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),ft(e),r=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,P(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=pt(e.adler,n.pending_buf,n.pending-r,r)),a===0&&(n.status=wr)}else n.status=wr;if(n.status===wr&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ft(e),n.pending+2<=n.pending_buf_size&&(P(n,e.adler&255),P(n,e.adler>>8&255),e.adler=0,n.status=It)):n.status=It),n.pending!==0){if(ft(e),e.avail_out===0)return n.last_flush=-1,De}else if(e.avail_in===0&&Yd(t)<=Yd(i)&&t!==bt)return mt(e,As);if(n.status===hn&&e.avail_in!==0)return mt(e,As);if(e.avail_in!==0||n.lookahead!==0||t!==Pt&&n.status!==hn){var d=n.strategy===yr?cb(n,t):n.strategy===Gm?lb(n,t):di[n.level].func(n,t);if((d===Mt||d===ui)&&(n.status=hn),d===J||d===Mt)return e.avail_out===0&&(n.last_flush=-1),De;if(d===gn&&(t===Fm?be._tr_align(n):t!==Gd&&(be._tr_stored_block(n,0,0,!1),t===Hm&&(ht(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),ft(e),e.avail_out===0))return n.last_flush=-1,De}return t!==bt?De:n.wrap<=0?Wd:(n.wrap===2?(P(n,e.adler&255),P(n,e.adler>>8&255),P(n,e.adler>>16&255),P(n,e.adler>>24&255),P(n,e.total_in&255),P(n,e.total_in>>8&255),P(n,e.total_in>>16&255),P(n,e.total_in>>24&255)):(fn(n,e.adler>>>16),fn(n,e.adler&65535)),ft(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?De:Wd)}function gb(e){var t;return!e||!e.state?ye:(t=e.state.status,t!==Er&&t!==ks&&t!==vr&&t!==xr&&t!==wr&&t!==It&&t!==hn?mt(e,ye):(e.state=null,t===It?mt(e,$m):De))}function mb(e,t){var i=t.length,n,r,a,s,o,d,l,c;if(!e||!e.state||(n=e.state,s=n.wrap,s===2||s===1&&n.status!==Er||n.lookahead))return ye;for(s===1&&(e.adler=Vd(e.adler,t,i,0)),n.wrap=0,i>=n.w_size&&(s===0&&(ht(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new oe.Buf8(n.w_size),oe.arraySet(c,t,i-n.w_size,n.w_size,0),t=c,i=n.w_size),o=e.avail_in,d=e.next_in,l=e.input,e.avail_in=i,e.next_in=0,e.input=t,Rt(n);n.lookahead>=R;){r=n.strstart,a=n.lookahead-(R-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+R-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++;while(--a);n.strstart=r,n.lookahead=R-1,Rt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=R-1,n.match_available=0,e.next_in=d,e.input=l,e.avail_in=o,n.wrap=s,De}ze.deflateInit=fb;ze.deflateInit2=Jd;ze.deflateReset=Zd;ze.deflateResetKeep=Xd;ze.deflateSetHeader=pb;ze.deflate=hb;ze.deflateEnd=gb;ze.deflateSetDictionary=mb;ze.deflateInfo="pako deflate (from Nodeca project)"});var Ls=E(pi=>{"use strict";var Sr=Ke(),eu=!0,tu=!0;try{String.fromCharCode.apply(null,[0])}catch{eu=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{tu=!1}var mn=new Sr.Buf8(256);for(Ze=0;Ze<256;Ze++)mn[Ze]=Ze>=252?6:Ze>=248?5:Ze>=240?4:Ze>=224?3:Ze>=192?2:1;var Ze;mn[254]=mn[254]=1;pi.string2buf=function(e){var t,i,n,r,a,s=e.length,o=0;for(r=0;r<s;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Sr.Buf8(o),a=0,r=0;a<o;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|i&63):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|i&63):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|i&63);return t};function iu(e,t){if(t<65534&&(e.subarray&&tu||!e.subarray&&eu))return String.fromCharCode.apply(null,Sr.shrinkBuf(e,t));for(var i="",n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i}pi.buf2binstring=function(e){return iu(e,e.length)};pi.binstring2buf=function(e){for(var t=new Sr.Buf8(e.length),i=0,n=t.length;i<n;i++)t[i]=e.charCodeAt(i);return t};pi.buf2string=function(e,t){var i,n,r,a,s=t||e.length,o=new Array(s*2);for(n=0,i=0;i<s;){if(r=e[i++],r<128){o[n++]=r;continue}if(a=mn[r],a>4){o[n++]=65533,i+=a-1;continue}for(r&=a===2?31:a===3?15:7;a>1&&i<s;)r=r<<6|e[i++]&63,a--;if(a>1){o[n++]=65533;continue}r<65536?o[n++]=r:(r-=65536,o[n++]=55296|r>>10&1023,o[n++]=56320|r&1023)}return iu(o,n)};pi.utf8border=function(e,t){var i;for(t=t||e.length,t>e.length&&(t=e.length),i=t-1;i>=0&&(e[i]&192)===128;)i--;return i<0||i===0?t:i+mn[e[i]]>t?i:t}});var Os=E((i0,nu)=>{"use strict";function bb(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}nu.exports=bb});var ou=E(vn=>{"use strict";var bn=Qd(),yn=Ke(),Ms=Ls(),Rs=br(),yb=Os(),su=Object.prototype.toString,vb=0,Is=4,fi=0,ru=1,au=2,xb=-1,wb=0,_b=8;function jt(e){if(!(this instanceof jt))return new jt(e);this.options=yn.assign({level:xb,method:_b,chunkSize:16384,windowBits:15,memLevel:8,strategy:wb,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yb,this.strm.avail_out=0;var i=bn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==fi)throw new Error(Rs[i]);if(t.header&&bn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Ms.string2buf(t.dictionary):su.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,i=bn.deflateSetDictionary(this.strm,n),i!==fi)throw new Error(Rs[i]);this._dict_set=!0}}jt.prototype.push=function(e,t){var i=this.strm,n=this.options.chunkSize,r,a;if(this.ended)return!1;a=t===~~t?t:t===!0?Is:vb,typeof e=="string"?i.input=Ms.string2buf(e):su.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(i.avail_out===0&&(i.output=new yn.Buf8(n),i.next_out=0,i.avail_out=n),r=bn.deflate(i,a),r!==ru&&r!==fi)return this.onEnd(r),this.ended=!0,!1;(i.avail_out===0||i.avail_in===0&&(a===Is||a===au))&&(this.options.to==="string"?this.onData(Ms.buf2binstring(yn.shrinkBuf(i.output,i.next_out))):this.onData(yn.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||i.avail_out===0)&&r!==ru);return a===Is?(r=bn.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===fi):(a===au&&(this.onEnd(fi),i.avail_out=0),!0)};jt.prototype.onData=function(e){this.chunks.push(e)};jt.prototype.onEnd=function(e){e===fi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=yn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ps(e,t){var i=new jt(t);if(i.push(e,!0),i.err)throw i.msg||Rs[i.err];return i.result}function Eb(e,t){return t=t||{},t.raw=!0,Ps(e,t)}function Sb(e,t){return t=t||{},t.gzip=!0,Ps(e,t)}vn.Deflate=jt;vn.deflate=Ps;vn.deflateRaw=Eb;vn.gzip=Sb});var cu=E((r0,lu)=>{"use strict";var Ar=30,Ab=12;lu.exports=function(t,i){var n,r,a,s,o,d,l,c,f,u,p,v,m,w,g,h,x,y,b,C,S,A,T,M,_;n=t.state,r=t.next_in,M=t.input,a=r+(t.avail_in-5),s=t.next_out,_=t.output,o=s-(i-t.avail_out),d=s+(t.avail_out-257),l=n.dmax,c=n.wsize,f=n.whave,u=n.wnext,p=n.window,v=n.hold,m=n.bits,w=n.lencode,g=n.distcode,h=(1<<n.lenbits)-1,x=(1<<n.distbits)-1;e:do{m<15&&(v+=M[r++]<<m,m+=8,v+=M[r++]<<m,m+=8),y=w[v&h];t:for(;;){if(b=y>>>24,v>>>=b,m-=b,b=y>>>16&255,b===0)_[s++]=y&65535;else if(b&16){C=y&65535,b&=15,b&&(m<b&&(v+=M[r++]<<m,m+=8),C+=v&(1<<b)-1,v>>>=b,m-=b),m<15&&(v+=M[r++]<<m,m+=8,v+=M[r++]<<m,m+=8),y=g[v&x];i:for(;;){if(b=y>>>24,v>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,m<b&&(v+=M[r++]<<m,m+=8,m<b&&(v+=M[r++]<<m,m+=8)),S+=v&(1<<b)-1,S>l){t.msg="invalid distance too far back",n.mode=Ar;break e}if(v>>>=b,m-=b,b=s-o,S>b){if(b=S-b,b>f&&n.sane){t.msg="invalid distance too far back",n.mode=Ar;break e}if(A=0,T=p,u===0){if(A+=c-b,b<C){C-=b;do _[s++]=p[A++];while(--b);A=s-S,T=_}}else if(u<b){if(A+=c+u-b,b-=u,b<C){C-=b;do _[s++]=p[A++];while(--b);if(A=0,u<C){b=u,C-=b;do _[s++]=p[A++];while(--b);A=s-S,T=_}}}else if(A+=u-b,b<C){C-=b;do _[s++]=p[A++];while(--b);A=s-S,T=_}for(;C>2;)_[s++]=T[A++],_[s++]=T[A++],_[s++]=T[A++],C-=3;C&&(_[s++]=T[A++],C>1&&(_[s++]=T[A++]))}else{A=s-S;do _[s++]=_[A++],_[s++]=_[A++],_[s++]=_[A++],C-=3;while(C>2);C&&(_[s++]=_[A++],C>1&&(_[s++]=_[A++]))}}else if((b&64)===0){y=g[(y&65535)+(v&(1<<b)-1)];continue i}else{t.msg="invalid distance code",n.mode=Ar;break e}break}}else if((b&64)===0){y=w[(y&65535)+(v&(1<<b)-1)];continue t}else if(b&32){n.mode=Ab;break e}else{t.msg="invalid literal/length code",n.mode=Ar;break e}break}}while(r<a&&s<d);C=m>>3,r-=C,m-=C<<3,v&=(1<<m)-1,t.next_in=r,t.next_out=s,t.avail_in=r<a?5+(a-r):5-(r-a),t.avail_out=s<d?257+(d-s):257-(s-d),n.hold=v,n.bits=m}});var mu=E((a0,gu)=>{"use strict";var du=Ke(),hi=15,uu=852,pu=592,fu=0,js=1,hu=2,Cb=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Tb=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],kb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Lb=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];gu.exports=function(t,i,n,r,a,s,o,d){var l=d.bits,c=0,f=0,u=0,p=0,v=0,m=0,w=0,g=0,h=0,x=0,y,b,C,S,A,T=null,M=0,_,O=new du.Buf16(hi+1),k=new du.Buf16(hi+1),I=null,D=0,z,ne,he;for(c=0;c<=hi;c++)O[c]=0;for(f=0;f<r;f++)O[i[n+f]]++;for(v=l,p=hi;p>=1&&O[p]===0;p--);if(v>p&&(v=p),p===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,d.bits=1,0;for(u=1;u<p&&O[u]===0;u++);for(v<u&&(v=u),g=1,c=1;c<=hi;c++)if(g<<=1,g-=O[c],g<0)return-1;if(g>0&&(t===fu||p!==1))return-1;for(k[1]=0,c=1;c<hi;c++)k[c+1]=k[c]+O[c];for(f=0;f<r;f++)i[n+f]!==0&&(o[k[i[n+f]]++]=f);if(t===fu?(T=I=o,_=19):t===js?(T=Cb,M-=257,I=Tb,D-=257,_=256):(T=kb,I=Lb,_=-1),x=0,f=0,c=u,A=s,m=v,w=0,C=-1,h=1<<v,S=h-1,t===js&&h>uu||t===hu&&h>pu)return 1;for(;;){z=c-w,o[f]<_?(ne=0,he=o[f]):o[f]>_?(ne=I[D+o[f]],he=T[M+o[f]]):(ne=96,he=0),y=1<<c-w,b=1<<m,u=b;do b-=y,a[A+(x>>w)+b]=z<<24|ne<<16|he|0;while(b!==0);for(y=1<<c-1;x&y;)y>>=1;if(y!==0?(x&=y-1,x+=y):x=0,f++,--O[c]===0){if(c===p)break;c=i[n+o[f]]}if(c>v&&(x&S)!==C){for(w===0&&(w=v),A+=u,m=c-w,g=1<<m;m+w<p&&(g-=O[m+w],!(g<=0));)m++,g<<=1;if(h+=1<<m,t===js&&h>uu||t===hu&&h>pu)return 1;C=x&S,a[C]=v<<24|m<<16|A-s|0}}return x!==0&&(a[A+x]=c-w<<24|64<<16|0),d.bits=v,0}});var Zu=E(Ce=>{"use strict";var ue=Ke(),Hs=Es(),Ne=Ss(),Ob=cu(),xn=mu(),Ib=0,$u=1,Uu=2,bu=4,Mb=5,Cr=6,Dt=0,Rb=1,Pb=2,ve=-2,qu=-3,$s=-4,jb=-5,yu=8,Gu=1,vu=2,xu=3,wu=4,_u=5,Eu=6,Su=7,Au=8,Cu=9,Tu=10,Lr=11,Je=12,Ds=13,ku=14,zs=15,Lu=16,Ou=17,Iu=18,Mu=19,Tr=20,kr=21,Ru=22,Pu=23,ju=24,Du=25,zu=26,Ns=27,Nu=28,Bu=29,H=30,Us=31,Db=32,zb=852,Nb=592,Bb=15,Fb=Bb;function Fu(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Hb(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ue.Buf16(320),this.work=new ue.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Wu(e){var t;return!e||!e.state?ve:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Gu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new ue.Buf32(zb),t.distcode=t.distdyn=new ue.Buf32(Nb),t.sane=1,t.back=-1,Dt)}function Yu(e){var t;return!e||!e.state?ve:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Wu(e))}function Vu(e,t){var i,n;return!e||!e.state||(n=e.state,t<0?(i=0,t=-t):(i=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?ve:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,Yu(e))}function Ku(e,t){var i,n;return e?(n=new Hb,e.state=n,n.window=null,i=Vu(e,t),i!==Dt&&(e.state=null),i):ve}function $b(e){return Ku(e,Fb)}var Hu=!0,Bs,Fs;function Ub(e){if(Hu){var t;for(Bs=new ue.Buf32(512),Fs=new ue.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(xn($u,e.lens,0,288,Bs,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;xn(Uu,e.lens,0,32,Fs,0,e.work,{bits:5}),Hu=!1}e.lencode=Bs,e.lenbits=9,e.distcode=Fs,e.distbits=5}function Xu(e,t,i,n){var r,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new ue.Buf8(a.wsize)),n>=a.wsize?(ue.arraySet(a.window,t,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>n&&(r=n),ue.arraySet(a.window,t,i-n,r,a.wnext),n-=r,n?(ue.arraySet(a.window,t,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}function qb(e,t){var i,n,r,a,s,o,d,l,c,f,u,p,v,m,w=0,g,h,x,y,b,C,S,A,T=new ue.Buf8(4),M,_,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return ve;i=e.state,i.mode===Je&&(i.mode=Ds),s=e.next_out,r=e.output,d=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,l=i.hold,c=i.bits,f=o,u=d,A=Dt;e:for(;;)switch(i.mode){case Gu:if(i.wrap===0){i.mode=Ds;break}for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.wrap&2&&l===35615){i.check=0,T[0]=l&255,T[1]=l>>>8&255,i.check=Ne(i.check,T,2,0),l=0,c=0,i.mode=vu;break}if(i.flags=0,i.head&&(i.head.done=!1),!(i.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=H;break}if((l&15)!==yu){e.msg="unknown compression method",i.mode=H;break}if(l>>>=4,c-=4,S=(l&15)+8,i.wbits===0)i.wbits=S;else if(S>i.wbits){e.msg="invalid window size",i.mode=H;break}i.dmax=1<<S,e.adler=i.check=1,i.mode=l&512?Tu:Je,l=0,c=0;break;case vu:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.flags=l,(i.flags&255)!==yu){e.msg="unknown compression method",i.mode=H;break}if(i.flags&57344){e.msg="unknown header flags set",i.mode=H;break}i.head&&(i.head.text=l>>8&1),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,i.check=Ne(i.check,T,2,0)),l=0,c=0,i.mode=xu;case xu:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.head&&(i.head.time=l),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,i.check=Ne(i.check,T,4,0)),l=0,c=0,i.mode=wu;case wu:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.head&&(i.head.xflags=l&255,i.head.os=l>>8),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,i.check=Ne(i.check,T,2,0)),l=0,c=0,i.mode=_u;case _u:if(i.flags&1024){for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.length=l,i.head&&(i.head.extra_len=l),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,i.check=Ne(i.check,T,2,0)),l=0,c=0}else i.head&&(i.head.extra=null);i.mode=Eu;case Eu:if(i.flags&1024&&(p=i.length,p>o&&(p=o),p&&(i.head&&(S=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),ue.arraySet(i.head.extra,n,a,p,S)),i.flags&512&&(i.check=Ne(i.check,n,p,a)),o-=p,a+=p,i.length-=p),i.length))break e;i.length=0,i.mode=Su;case Su:if(i.flags&2048){if(o===0)break e;p=0;do S=n[a+p++],i.head&&S&&i.length<65536&&(i.head.name+=String.fromCharCode(S));while(S&&p<o);if(i.flags&512&&(i.check=Ne(i.check,n,p,a)),o-=p,a+=p,S)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=Au;case Au:if(i.flags&4096){if(o===0)break e;p=0;do S=n[a+p++],i.head&&S&&i.length<65536&&(i.head.comment+=String.fromCharCode(S));while(S&&p<o);if(i.flags&512&&(i.check=Ne(i.check,n,p,a)),o-=p,a+=p,S)break e}else i.head&&(i.head.comment=null);i.mode=Cu;case Cu:if(i.flags&512){for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l!==(i.check&65535)){e.msg="header crc mismatch",i.mode=H;break}l=0,c=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=Je;break;case Tu:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}e.adler=i.check=Fu(l),l=0,c=0,i.mode=Lr;case Lr:if(i.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,Pb;e.adler=i.check=1,i.mode=Je;case Je:if(t===Mb||t===Cr)break e;case Ds:if(i.last){l>>>=c&7,c-=c&7,i.mode=Ns;break}for(;c<3;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}switch(i.last=l&1,l>>>=1,c-=1,l&3){case 0:i.mode=ku;break;case 1:if(Ub(i),i.mode=Tr,t===Cr){l>>>=2,c-=2;break e}break;case 2:i.mode=Ou;break;case 3:e.msg="invalid block type",i.mode=H}l>>>=2,c-=2;break;case ku:for(l>>>=c&7,c-=c&7;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=H;break}if(i.length=l&65535,l=0,c=0,i.mode=zs,t===Cr)break e;case zs:i.mode=Lu;case Lu:if(p=i.length,p){if(p>o&&(p=o),p>d&&(p=d),p===0)break e;ue.arraySet(r,n,a,p,s),o-=p,a+=p,d-=p,s+=p,i.length-=p;break}i.mode=Je;break;case Ou:for(;c<14;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.nlen=(l&31)+257,l>>>=5,c-=5,i.ndist=(l&31)+1,l>>>=5,c-=5,i.ncode=(l&15)+4,l>>>=4,c-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=H;break}i.have=0,i.mode=Iu;case Iu:for(;i.have<i.ncode;){for(;c<3;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.lens[O[i.have++]]=l&7,l>>>=3,c-=3}for(;i.have<19;)i.lens[O[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,M={bits:i.lenbits},A=xn(Ib,i.lens,0,19,i.lencode,0,i.work,M),i.lenbits=M.bits,A){e.msg="invalid code lengths set",i.mode=H;break}i.have=0,i.mode=Mu;case Mu:for(;i.have<i.nlen+i.ndist;){for(;w=i.lencode[l&(1<<i.lenbits)-1],g=w>>>24,h=w>>>16&255,x=w&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(x<16)l>>>=g,c-=g,i.lens[i.have++]=x;else{if(x===16){for(_=g+2;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l>>>=g,c-=g,i.have===0){e.msg="invalid bit length repeat",i.mode=H;break}S=i.lens[i.have-1],p=3+(l&3),l>>>=2,c-=2}else if(x===17){for(_=g+3;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,S=0,p=3+(l&7),l>>>=3,c-=3}else{for(_=g+7;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,S=0,p=11+(l&127),l>>>=7,c-=7}if(i.have+p>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=H;break}for(;p--;)i.lens[i.have++]=S}}if(i.mode===H)break;if(i.lens[256]===0){e.msg="invalid code -- missing end-of-block",i.mode=H;break}if(i.lenbits=9,M={bits:i.lenbits},A=xn($u,i.lens,0,i.nlen,i.lencode,0,i.work,M),i.lenbits=M.bits,A){e.msg="invalid literal/lengths set",i.mode=H;break}if(i.distbits=6,i.distcode=i.distdyn,M={bits:i.distbits},A=xn(Uu,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,M),i.distbits=M.bits,A){e.msg="invalid distances set",i.mode=H;break}if(i.mode=Tr,t===Cr)break e;case Tr:i.mode=kr;case kr:if(o>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,Ob(e,u),s=e.next_out,r=e.output,d=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,l=i.hold,c=i.bits,i.mode===Je&&(i.back=-1);break}for(i.back=0;w=i.lencode[l&(1<<i.lenbits)-1],g=w>>>24,h=w>>>16&255,x=w&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(h&&(h&240)===0){for(y=g,b=h,C=x;w=i.lencode[C+((l&(1<<y+b)-1)>>y)],g=w>>>24,h=w>>>16&255,x=w&65535,!(y+g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,i.back+=y}if(l>>>=g,c-=g,i.back+=g,i.length=x,h===0){i.mode=zu;break}if(h&32){i.back=-1,i.mode=Je;break}if(h&64){e.msg="invalid literal/length code",i.mode=H;break}i.extra=h&15,i.mode=Ru;case Ru:if(i.extra){for(_=i.extra;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=Pu;case Pu:for(;w=i.distcode[l&(1<<i.distbits)-1],g=w>>>24,h=w>>>16&255,x=w&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((h&240)===0){for(y=g,b=h,C=x;w=i.distcode[C+((l&(1<<y+b)-1)>>y)],g=w>>>24,h=w>>>16&255,x=w&65535,!(y+g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,i.back+=y}if(l>>>=g,c-=g,i.back+=g,h&64){e.msg="invalid distance code",i.mode=H;break}i.offset=x,i.extra=h&15,i.mode=ju;case ju:if(i.extra){for(_=i.extra;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=H;break}i.mode=Du;case Du:if(d===0)break e;if(p=u-d,i.offset>p){if(p=i.offset-p,p>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=H;break}p>i.wnext?(p-=i.wnext,v=i.wsize-p):v=i.wnext-p,p>i.length&&(p=i.length),m=i.window}else m=r,v=s-i.offset,p=i.length;p>d&&(p=d),d-=p,i.length-=p;do r[s++]=m[v++];while(--p);i.length===0&&(i.mode=kr);break;case zu:if(d===0)break e;r[s++]=i.length,d--,i.mode=kr;break;case Ns:if(i.wrap){for(;c<32;){if(o===0)break e;o--,l|=n[a++]<<c,c+=8}if(u-=d,e.total_out+=u,i.total+=u,u&&(e.adler=i.check=i.flags?Ne(i.check,r,u,s-u):Hs(i.check,r,u,s-u)),u=d,(i.flags?l:Fu(l))!==i.check){e.msg="incorrect data check",i.mode=H;break}l=0,c=0}i.mode=Nu;case Nu:if(i.wrap&&i.flags){for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l!==(i.total&4294967295)){e.msg="incorrect length check",i.mode=H;break}l=0,c=0}i.mode=Bu;case Bu:A=Rb;break e;case H:A=qu;break e;case Us:return $s;case Db:default:return ve}return e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,(i.wsize||u!==e.avail_out&&i.mode<H&&(i.mode<Ns||t!==bu))&&Xu(e,e.output,e.next_out,u-e.avail_out)?(i.mode=Us,$s):(f-=e.avail_in,u-=e.avail_out,e.total_in+=f,e.total_out+=u,i.total+=u,i.wrap&&u&&(e.adler=i.check=i.flags?Ne(i.check,r,u,e.next_out-u):Hs(i.check,r,u,e.next_out-u)),e.data_type=i.bits+(i.last?64:0)+(i.mode===Je?128:0)+(i.mode===Tr||i.mode===zs?256:0),(f===0&&u===0||t===bu)&&A===Dt&&(A=jb),A)}function Gb(e){if(!e||!e.state)return ve;var t=e.state;return t.window&&(t.window=null),e.state=null,Dt}function Wb(e,t){var i;return!e||!e.state||(i=e.state,(i.wrap&2)===0)?ve:(i.head=t,t.done=!1,Dt)}function Yb(e,t){var i=t.length,n,r,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Lr)?ve:n.mode===Lr&&(r=1,r=Hs(r,t,i,0),r!==n.check)?qu:(a=Xu(e,t,i,i),a?(n.mode=Us,$s):(n.havedict=1,Dt))}Ce.inflateReset=Yu;Ce.inflateReset2=Vu;Ce.inflateResetKeep=Wu;Ce.inflateInit=$b;Ce.inflateInit2=Ku;Ce.inflate=qb;Ce.inflateEnd=Gb;Ce.inflateGetHeader=Wb;Ce.inflateSetDictionary=Yb;Ce.inflateInfo="pako inflate (from Nodeca project)"});var qs=E((o0,Ju)=>{"use strict";Ju.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var ep=E((l0,Qu)=>{"use strict";function Vb(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Qu.exports=Vb});var ip=E(_n=>{"use strict";var gi=Zu(),wn=Ke(),Or=Ls(),Y=qs(),Gs=br(),Kb=Os(),Xb=ep(),tp=Object.prototype.toString;function zt(e){if(!(this instanceof zt))return new zt(e);this.options=wn.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Kb,this.strm.avail_out=0;var i=gi.inflateInit2(this.strm,t.windowBits);if(i!==Y.Z_OK)throw new Error(Gs[i]);if(this.header=new Xb,gi.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Or.string2buf(t.dictionary):tp.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=gi.inflateSetDictionary(this.strm,t.dictionary),i!==Y.Z_OK)))throw new Error(Gs[i])}zt.prototype.push=function(e,t){var i=this.strm,n=this.options.chunkSize,r=this.options.dictionary,a,s,o,d,l,c=!1;if(this.ended)return!1;s=t===~~t?t:t===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof e=="string"?i.input=Or.binstring2buf(e):tp.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(i.avail_out===0&&(i.output=new wn.Buf8(n),i.next_out=0,i.avail_out=n),a=gi.inflate(i,Y.Z_NO_FLUSH),a===Y.Z_NEED_DICT&&r&&(a=gi.inflateSetDictionary(this.strm,r)),a===Y.Z_BUF_ERROR&&c===!0&&(a=Y.Z_OK,c=!1),a!==Y.Z_STREAM_END&&a!==Y.Z_OK)return this.onEnd(a),this.ended=!0,!1;i.next_out&&(i.avail_out===0||a===Y.Z_STREAM_END||i.avail_in===0&&(s===Y.Z_FINISH||s===Y.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=Or.utf8border(i.output,i.next_out),d=i.next_out-o,l=Or.buf2string(i.output,o),i.next_out=d,i.avail_out=n-d,d&&wn.arraySet(i.output,i.output,o,d,0),this.onData(l)):this.onData(wn.shrinkBuf(i.output,i.next_out))),i.avail_in===0&&i.avail_out===0&&(c=!0)}while((i.avail_in>0||i.avail_out===0)&&a!==Y.Z_STREAM_END);return a===Y.Z_STREAM_END&&(s=Y.Z_FINISH),s===Y.Z_FINISH?(a=gi.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Y.Z_OK):(s===Y.Z_SYNC_FLUSH&&(this.onEnd(Y.Z_OK),i.avail_out=0),!0)};zt.prototype.onData=function(e){this.chunks.push(e)};zt.prototype.onEnd=function(e){e===Y.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=wn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ws(e,t){var i=new zt(t);if(i.push(e,!0),i.err)throw i.msg||Gs[i.err];return i.result}function Zb(e,t){return t=t||{},t.raw=!0,Ws(e,t)}_n.Inflate=zt;_n.inflate=Ws;_n.inflateRaw=Zb;_n.ungzip=Ws});var ap=E((d0,rp)=>{"use strict";var Jb=Ke().assign,Qb=ou(),ey=ip(),ty=qs(),np={};Jb(np,Qb,ey,ty);rp.exports=np});var op=E(Mr=>{"use strict";var iy=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",ny=ap(),sp=$(),Ir=de(),ry=iy?"uint8array":"array";Mr.magic="\b\0";function Nt(e,t){Ir.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}sp.inherits(Nt,Ir);Nt.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(sp.transformTo(ry,e.data),!1)};Nt.prototype.flush=function(){Ir.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};Nt.prototype.cleanUp=function(){Ir.prototype.cleanUp.call(this),this._pako=null};Nt.prototype._createPako=function(){this._pako=new ny[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};Mr.compressWorker=function(e){return new Nt("Deflate",e)};Mr.uncompressWorker=function(){return new Nt("Inflate",{})}});var Vs=E(Ys=>{"use strict";var lp=de();Ys.STORE={magic:"\0\0",compressWorker:function(){return new lp("STORE compression")},uncompressWorker:function(){return new lp("STORE decompression")}};Ys.DEFLATE=op()});var Ks=E(Bt=>{"use strict";Bt.LOCAL_FILE_HEADER="PK";Bt.CENTRAL_FILE_HEADER="PK";Bt.CENTRAL_DIRECTORY_END="PK";Bt.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";Bt.ZIP64_CENTRAL_DIRECTORY_END="PK";Bt.DATA_DESCRIPTOR="PK\x07\b"});var pp=E((h0,up)=>{"use strict";var mi=$(),bi=de(),Xs=ri(),cp=pr(),Rr=Ks(),N=function(e,t){var i="",n;for(n=0;n<t;n++)i+=String.fromCharCode(e&255),e=e>>>8;return i},ay=function(e,t){var i=e;return e||(i=t?16893:33204),(i&65535)<<16},sy=function(e){return(e||0)&63},dp=function(e,t,i,n,r,a){var s=e.file,o=e.compression,d=a!==Xs.utf8encode,l=mi.transformTo("string",a(s.name)),c=mi.transformTo("string",Xs.utf8encode(s.name)),f=s.comment,u=mi.transformTo("string",a(f)),p=mi.transformTo("string",Xs.utf8encode(f)),v=c.length!==s.name.length,m=p.length!==f.length,w,g,h="",x="",y="",b=s.dir,C=s.date,S={crc32:0,compressedSize:0,uncompressedSize:0};(!t||i)&&(S.crc32=e.crc32,S.compressedSize=e.compressedSize,S.uncompressedSize=e.uncompressedSize);var A=0;t&&(A|=8),!d&&(v||m)&&(A|=2048);var T=0,M=0;b&&(T|=16),r==="UNIX"?(M=798,T|=ay(s.unixPermissions,b)):(M=20,T|=sy(s.dosPermissions,b)),w=C.getUTCHours(),w=w<<6,w=w|C.getUTCMinutes(),w=w<<5,w=w|C.getUTCSeconds()/2,g=C.getUTCFullYear()-1980,g=g<<4,g=g|C.getUTCMonth()+1,g=g<<5,g=g|C.getUTCDate(),v&&(x=N(1,1)+N(cp(l),4)+c,h+="up"+N(x.length,2)+x),m&&(y=N(1,1)+N(cp(u),4)+p,h+="uc"+N(y.length,2)+y);var _="";_+=`
|
|
2
|
+
\0`,_+=N(A,2),_+=o.magic,_+=N(w,2),_+=N(g,2),_+=N(S.crc32,4),_+=N(S.compressedSize,4),_+=N(S.uncompressedSize,4),_+=N(l.length,2),_+=N(h.length,2);var O=Rr.LOCAL_FILE_HEADER+_+l+h,k=Rr.CENTRAL_FILE_HEADER+N(M,2)+_+N(u.length,2)+"\0\0\0\0"+N(T,4)+N(n,4)+l+h+u;return{fileRecord:O,dirRecord:k}},oy=function(e,t,i,n,r){var a="",s=mi.transformTo("string",r(n));return a=Rr.CENTRAL_DIRECTORY_END+"\0\0\0\0"+N(e,2)+N(e,2)+N(t,4)+N(i,4)+N(s.length,2)+s,a},ly=function(e){var t="";return t=Rr.DATA_DESCRIPTOR+N(e.crc32,4)+N(e.compressedSize,4)+N(e.uncompressedSize,4),t};function Te(e,t,i,n){bi.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}mi.inherits(Te,bi);Te.prototype.push=function(e){var t=e.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,bi.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-n-1))/i:100}}))};Te.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var i=dp(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0};Te.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,i=dp(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:ly(e),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};Te.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var i=this.bytesWritten-e,n=oy(this.dirRecords.length,i,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})};Te.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};Te.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(i){t.processChunk(i)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(i){t.error(i)}),this};Te.prototype.resume=function(){if(!bi.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};Te.prototype.error=function(e){var t=this._sources;if(!bi.prototype.error.call(this,e))return!1;for(var i=0;i<t.length;i++)try{t[i].error(e)}catch{}return!0};Te.prototype.lock=function(){bi.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};up.exports=Te});var hp=E(fp=>{"use strict";var cy=Vs(),dy=pp(),uy=function(e,t){var i=e||t,n=cy[i];if(!n)throw new Error(i+" is not a valid compression method !");return n};fp.generateWorker=function(e,t,i){var n=new dy(t.streamFiles,i,t.platform,t.encodeFileName),r=0;try{e.forEach(function(a,s){r++;var o=uy(s.options.compression,t.compression),d=s.options.compressionOptions||t.compressionOptions||{},l=s.dir,c=s.date;s._compressWorker(o,d).withStreamInfo("file",{name:a,dir:l,date:c,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(n)}),n.entriesCount=r}catch(a){n.error(a)}return n}});var mp=E((m0,gp)=>{"use strict";var py=$(),Pr=de();function En(e,t){Pr.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}py.inherits(En,Pr);En.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(i){t.push({data:i,meta:{percent:0}})}).on("error",function(i){t.isPaused?this.generatedError=i:t.error(i)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})};En.prototype.pause=function(){return Pr.prototype.pause.call(this)?(this._stream.pause(),!0):!1};En.prototype.resume=function(){return Pr.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};gp.exports=En});var Cp=E((b0,Ap)=>{"use strict";var fy=ri(),Sn=$(),xp=de(),hy=ts(),wp=is(),bp=fr(),gy=yd(),my=hp(),yp=Ji(),by=mp(),_p=function(e,t,i){var n=Sn.getTypeOf(t),r,a=Sn.extend(i||{},wp);a.date=a.date||new Date,a.compression!==null&&(a.compression=a.compression.toUpperCase()),typeof a.unixPermissions=="string"&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&a.unixPermissions&16384&&(a.dir=!0),a.dosPermissions&&a.dosPermissions&16&&(a.dir=!0),a.dir&&(e=Ep(e)),a.createFolders&&(r=yy(e))&&Sp.call(this,r,!0);var s=n==="string"&&a.binary===!1&&a.base64===!1;(!i||typeof i.binary=="undefined")&&(a.binary=!s);var o=t instanceof bp&&t.uncompressedSize===0;(o||a.dir||!t||t.length===0)&&(a.base64=!1,a.binary=!0,t="",a.compression="STORE",n="string");var d=null;t instanceof bp||t instanceof xp?d=t:yp.isNode&&yp.isStream(t)?d=new by(e,t):d=Sn.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new gy(e,d,a);this.files[e]=l},yy=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},Ep=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},Sp=function(e,t){return t=typeof t!="undefined"?t:wp.createFolders,e=Ep(e),this.files[e]||_p.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function vp(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var vy={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,i,n;for(t in this.files)n=this.files[t],i=t.slice(this.root.length,t.length),i&&t.slice(0,this.root.length)===this.root&&e(i,n)},filter:function(e){var t=[];return this.forEach(function(i,n){e(i,n)&&t.push(n)}),t},file:function(e,t,i){if(arguments.length===1)if(vp(e)){var n=e;return this.filter(function(a,s){return!s.dir&&n.test(a)})}else{var r=this.files[this.root+e];return r&&!r.dir?r:null}else e=this.root+e,_p.call(this,e,t,i);return this},folder:function(e){if(!e)return this;if(vp(e))return this.filter(function(r,a){return a.dir&&e.test(r)});var t=this.root+e,i=Sp.call(this,t),n=this.clone();return n.root=i.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||(e.slice(-1)!=="/"&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var i=this.filter(function(r,a){return a.name.slice(0,e.length)===e}),n=0;n<i.length;n++)delete this.files[i[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,i={};try{if(i=Sn.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:fy.utf8encode}),i.type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),i.type==="binarystring"&&(i.type="string"),!i.type)throw new Error("No output type specified.");Sn.checkSupport(i.type),(i.platform==="darwin"||i.platform==="freebsd"||i.platform==="linux"||i.platform==="sunos")&&(i.platform="UNIX"),i.platform==="win32"&&(i.platform="DOS");var n=i.comment||this.comment||"";t=my.generateWorker(this,i,n)}catch(r){t=new xp("error"),t.error(r)}return new hy(t,i.type||"string",i.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return e=e||{},e.type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};Ap.exports=vy});var Zs=E((y0,kp)=>{"use strict";var xy=$();function Tp(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}Tp.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t=0,i;for(this.checkOffset(e),i=this.index+e-1;i>=this.index;i--)t=(t<<8)+this.byteAt(i);return this.index+=e,t},readString:function(e){return xy.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}};kp.exports=Tp});var Js=E((v0,Op)=>{"use strict";var Lp=Zs(),wy=$();function yi(e){Lp.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}wy.inherits(yi,Lp);yi.prototype.byteAt=function(e){return this.data[this.zero+e]};yi.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),i=e.charCodeAt(1),n=e.charCodeAt(2),r=e.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===i&&this.data[a+2]===n&&this.data[a+3]===r)return a-this.zero;return-1};yi.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),i=e.charCodeAt(1),n=e.charCodeAt(2),r=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&i===a[1]&&n===a[2]&&r===a[3]};yi.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Op.exports=yi});var Rp=E((x0,Mp)=>{"use strict";var Ip=Zs(),_y=$();function vi(e){Ip.call(this,e)}_y.inherits(vi,Ip);vi.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};vi.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};vi.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};vi.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Mp.exports=vi});var eo=E((w0,jp)=>{"use strict";var Pp=Js(),Ey=$();function Qs(e){Pp.call(this,e)}Ey.inherits(Qs,Pp);Qs.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};jp.exports=Qs});var Np=E((_0,zp)=>{"use strict";var Dp=eo(),Sy=$();function to(e){Dp.call(this,e)}Sy.inherits(to,Dp);to.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};zp.exports=to});var io=E((E0,Fp)=>{"use strict";var jr=$(),Bp=Ye(),Ay=Js(),Cy=Rp(),Ty=Np(),ky=eo();Fp.exports=function(e){var t=jr.getTypeOf(e);return jr.checkSupport(t),t==="string"&&!Bp.uint8array?new Cy(e):t==="nodebuffer"?new Ty(e):Bp.uint8array?new ky(jr.transformTo("uint8array",e)):new Ay(jr.transformTo("array",e))}});var qp=E((S0,Up)=>{"use strict";var no=io(),yt=$(),Ly=fr(),Hp=pr(),Dr=ri(),zr=Vs(),Oy=Ye(),Iy=0,My=3,Ry=function(e){for(var t in zr)if(Object.prototype.hasOwnProperty.call(zr,t)&&zr[t].magic===e)return zr[t];return null};function $p(e,t){this.options=e,this.loadOptions=t}$p.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(e){var t,i;if(e.skip(22),this.fileNameLength=e.readInt(2),i=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(i),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(t=Ry(this.compressionMethod),t===null)throw new Error("Corrupted zip : compression "+yt.pretty(this.compressionMethod)+" unknown (inner file : "+yt.transformTo("string",this.fileName)+")");this.decompressed=new Ly(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===Iy&&(this.dosPermissions=this.externalFileAttributes&63),e===My&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=no(this.extraFields[1].value);this.uncompressedSize===yt.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===yt.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===yt.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===yt.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t=e.index+this.extraFieldsLength,i,n,r;for(this.extraFields||(this.extraFields={});e.index+4<t;)i=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[i]={id:i,length:n,value:r};e.setIndex(t)},handleUTF8:function(){var e=Oy.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Dr.utf8decode(this.fileName),this.fileCommentStr=Dr.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var i=yt.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var n=this.findExtraFieldUnicodeComment();if(n!==null)this.fileCommentStr=n;else{var r=yt.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=no(e.value);return t.readInt(1)!==1||Hp(this.fileName)!==t.readInt(4)?null:Dr.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=no(e.value);return t.readInt(1)!==1||Hp(this.fileComment)!==t.readInt(4)?null:Dr.utf8decode(t.readData(e.length-5))}return null}};Up.exports=$p});var Yp=E((A0,Wp)=>{"use strict";var Py=io(),Qe=$(),ke=Ks(),jy=qp(),Dy=Ye();function Gp(e){this.files=[],this.loadOptions=e}Gp.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+Qe.pretty(t)+", expected "+Qe.pretty(e)+")")}},isSignature:function(e,t){var i=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4),r=n===t;return this.reader.setIndex(i),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=Dy.uint8array?"uint8array":"array",i=Qe.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,t=0,i,n,r;t<e;)i=this.reader.readInt(2),n=this.reader.readInt(4),r=this.reader.readData(n),this.zip64ExtensibleData[i]={id:i,length:n,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(ke.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(ke.CENTRAL_FILE_HEADER);)e=new jy({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(ke.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,ke.LOCAL_FILE_HEADER);throw t?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(e);var i=e;if(this.checkSignature(ke.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Qe.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Qe.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Qe.MAX_VALUE_16BITS||this.centralDirRecords===Qe.MAX_VALUE_16BITS||this.centralDirSize===Qe.MAX_VALUE_32BITS||this.centralDirOffset===Qe.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(ke.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(ke.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,ke.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(ke.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(ke.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=i-n;if(r>0)this.isSignature(i,ke.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=Py(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};Wp.exports=Gp});var Xp=E((C0,Kp)=>{"use strict";var ro=$(),Nr=ti(),zy=ri(),Ny=Yp(),By=as(),Vp=Ji();function Fy(e){return new Nr.Promise(function(t,i){var n=e.decompressed.getContentWorker().pipe(new By);n.on("error",function(r){i(r)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}Kp.exports=function(e,t){var i=this;return t=ro.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:zy.utf8decode}),Vp.isNode&&Vp.isStream(e)?Nr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):ro.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(n){var r=new Ny(t);return r.load(n),r}).then(function(r){var a=[Nr.Promise.resolve(r)],s=r.files;if(t.checkCRC32)for(var o=0;o<s.length;o++)a.push(Fy(s[o]));return Nr.Promise.all(a)}).then(function(r){for(var a=r.shift(),s=a.files,o=0;o<s.length;o++){var d=s[o],l=d.fileNameStr,c=ro.resolve(d.fileNameStr);i.file(c,d.decompressed,{binary:!0,optimizedBinaryString:!0,date:d.date,dir:d.dir,comment:d.fileCommentStr.length?d.fileCommentStr:null,unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions,createFolders:t.createFolders}),d.dir||(i.file(c).unsafeOriginalName=l)}return a.zipComment.length&&(i.comment=a.zipComment),i})}});var Jp=E((T0,Zp)=>{"use strict";function xe(){if(!(this instanceof xe))return new xe;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new xe;for(var t in this)typeof this[t]!="function"&&(e[t]=this[t]);return e}}xe.prototype=Cp();xe.prototype.loadAsync=Xp();xe.support=Ye();xe.defaults=is();xe.version="3.10.1";xe.loadAsync=function(e,t){return new xe().loadAsync(e,t)};xe.external=ti();Zp.exports=xe});var Be,oo=Ue(()=>{"use strict";Be=class{static get(t){var i;return(i=this.store.get(t))==null?void 0:i.data}static set(t,i){this.store.set(t,{data:i})}static has(t){return this.store.has(t)}static clear(){this.store.clear()}};Be.store=new Map});function Gy(){var e,t;try{let i=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((t=(e=document.querySelector("script"))==null?void 0:e.textContent)==null?void 0:t.includes("inline-assets.js"))||window.INLINE_ASSETS),n=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(i&&!n)}catch{return!1}}async function Wy(){try{if(typeof window!="undefined"){let e=await fetch("./build-settings.json");if(e.ok){let t=await e.json();return console.log("[AssetLoader] Loaded build settings:",t),t}}}catch{}return null}function Yy(){try{if(typeof window!="undefined"){let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",t),t}}}catch{}return null}async function Vy(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${U}`),Object.keys(et).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(et)),et;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),et={...window.INLINE_ASSETS},et;if(!(U==="publish"&&Fe!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),et;if(!lo){let t=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",t),lo=(async()=>{try{try{let a=await import(t+"?t="+Date.now());if(a.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(a.INLINE_ASSETS)),a.INLINE_ASSETS}catch(a){console.warn("[AssetLoader] ES module import failed, trying text parse:",a)}let i=await fetch(t);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);let n=await i.text();console.log("[AssetLoader] Received JS code, length:",n.length);let r=n.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(r)try{let a=r[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let s=new Function("return "+a)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(s)),s}catch(a){return console.warn("[AssetLoader] Failed to parse inline assets:",a),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",n.substring(0,500)),{}}catch(i){return console.warn("[AssetLoader] Failed to load inline assets:",i),{}}})()}return et=await lo,console.log("[AssetLoader] Final inline assets cache:",Object.keys(et)),et}function co(e){return e===null||typeof e!="object"||(Object.freeze(e),Object.values(e).forEach(t=>co(t))),e}function Ky(e=64,t=64,i=16711680){let n=document.createElement("canvas");n.width=e,n.height=t;let r=n.getContext("2d");return r.fillStyle=`#${i.toString(16).padStart(6,"0")}`,r.fillRect(0,0,e,t),r.strokeStyle="#000",r.strokeRect(0,0,e,t),r.fillStyle="#fff",r.font="10px sans-serif",r.textAlign="center",r.fillText("MISSING",e/2,t/2),tt.Texture.from(n)}function Hr(e,t){af.set(e,t)}var tt,nf,rf,Ft,U,Fe,vt,et,lo,af,xt,$r=Ue(()=>{"use strict";tt=require("pixi.js");oo();nf=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",rf=Gy(),Ft=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,U=rf?"publish":nf,Fe=Ft==null?void 0:Ft.assetsInlined;Ft!=null&&Ft.buildMode&&(U=Ft.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${U}`));vt=Yy();vt!=null&&vt.buildMode&&(U=vt.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${U}`));(vt==null?void 0:vt.assetsInlined)!==void 0&&(Fe=vt.assetsInlined);Wy().then(e=>{e!=null&&e.buildMode&&e.buildMode!==U&&(U=e.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${U}`)),(e==null?void 0:e.assetsInlined)!==void 0&&(Fe=e.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${nf}, Runtime: ${rf?"publish":"dev"}, Effective: ${U}`);et={},lo=null;af=new Map;xt=class{static async load(t,i,n,r){let a=`${t}:${i.path}`,s=Be.get(a);if(s!==void 0)return s;console.log(`[AssetLoader] Loading asset: ${t}, type: ${i.type}, Effective mode: ${U}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await Vy(),d=o[t];if(!d&&r&&(d=o[r],d&&console.log(`[AssetLoader] Found inline data for ${t} using configId: ${r}`)),!d&&i.path){let f=i.path.split("/");if(f.length>=2){let u=f[f.length-1].split(".")[0];o[u]&&(d=o[u],console.log(`[AssetLoader] Found inline data for ${t} using assetName: ${u}`))}}if(console.log("[AssetLoader] Inline data for",t,":",d?"FOUND":"NOT FOUND"),U==="publish"&&Fe!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!d))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${t}, path: ${i.path}`);let c=af.get(i.type);if(c)try{let f=await c(i.path,d,t,n);return Be.set(a,f),f}catch(f){return this.handleFailure(t,i.type,f)}try{let f;switch(i.type){case"image":f=await this.loadImage(i.path,d);break;case"json":f=await this.loadJSON(i.path,d),f=co(f);break;default:throw new Error(`Unknown asset type: ${i.type}`)}return Be.set(a,f),f}catch(f){return this.handleFailure(t,i.type,f)}}static async loadImage(t,i){let n=U==="publish",r=n&&Fe!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${U}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),r){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${t}`);if(typeof i!="string"||!i.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof i}`);try{return await tt.Assets.load(i)}catch(a){throw console.error("[AssetLoader] Failed to load texture from data URI:",a),a}}if(i&&typeof i=="string"&&i.startsWith("data:"))try{return await tt.Assets.load(i)}catch(a){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",a),await tt.Assets.load(t)}return await tt.Assets.load(t)}static async loadJSON(t,i){let n=U==="publish",r=n&&Fe!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${U}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),r){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}if(i){if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}let a=await fetch(t);if(!a.ok)throw new Error(`JSON fetch failed: ${t}`);return a.json()}static handleFailure(t,i,n){if(U==="dev"){let a=i==="image"?Ky():co({__placeholder:!0,type:i});return Be.set(t+":"+((n==null?void 0:n.path)||"missing"),a),a}throw n}};Hr("image",async(e,t)=>{let i=U==="publish",n=i&&Fe!==!1,r=U==="brand",a=i&&Fe===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${U}, isPublishMode: ${i}, isBrandMode: ${r}, inlineData: ${t?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof t!="string"||!t.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof t}`);return tt.Assets.load(t)}let s=e;return(r||a)&&e&&!e.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=e,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${e}" as-is`)):(s=`assets/${e}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${e}" -> "${s}"`))),tt.Assets.load(t||s)});Hr("json",async(e,t)=>{let i=U==="publish",n=i&&Fe!==!1,r=U==="brand",a=i&&Fe===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${U}, isPublishMode: ${i}, isBrandMode: ${r}, inlineData: ${t?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);return typeof t=="object"&&t!==null?t:typeof t=="string"&&t.startsWith("data:")?JSON.parse(atob(t.split(",")[1])):JSON.parse(t)}let s=e;if((r||a)&&e&&!e.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=e,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${e}" as-is`)):(s=`assets/${e}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${e}" -> "${s}"`))),t)return typeof t=="object"&&t!==null?t:typeof t=="string"&&t.startsWith("data:")?JSON.parse(atob(t.split(",")[1])):JSON.parse(t);let o=await fetch(s);if(!o.ok)throw new Error(`JSON fetch failed: ${e}`);return o.json()})});function Ur(e,t){sf.init(e,t),typeof window!="undefined"&&(window.__AssetTextures=wt)}var uo,sf,wt,An=Ue(()=>{"use strict";$r();uo=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(t,i){if(this.config===t&&this.app===i&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(n=>{this.priorityReadyResolve=n}),this.config=t,this.app=i,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let t=this.config,i=this.app;return this.readyPromise=(async()=>{var s;console.log("[AssetTextures] Loading all assets...");let n=new Set(["background_loading_1"]),r=[],a=[];for(let[o,d]of t.objects.entries()){let l=(s=d.render)==null?void 0:s.asset;if(!l)continue;let c=async()=>{var f;try{let u=(f=d.identity)==null?void 0:f.id;console.log(`[AssetTextures] Loading ${l.type}: ${o} (${u})`);let p=await xt.load(o,l,i,u);this.textures.set(o,p),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(u){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,u)}finally{this.attempted.add(o);try{for(let u of Array.from(this.waiters))u()}catch{}}};n.has(o)?r.push(c()):a.push(c())}r.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(r),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(a),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(t,i={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let r=Array.from(new Set((t||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var d,l,c,f;try{let u=(c=(l=(d=this.config)==null?void 0:d.objects)==null?void 0:l.get)==null?void 0:c.call(l,o);return!!((f=u==null?void 0:u.render)!=null&&f.asset)}catch{return!1}});if(r.length===0)return;this.ready().catch(()=>{});let a=()=>r.every(o=>this.textures.has(o)||this.attempted.has(o));if(a())return;let s=typeof i.timeoutMs=="number"?i.timeoutMs:15e3;await new Promise(o=>{let d=!1,l=()=>{d||a()&&(d=!0,this.waiters.delete(l),o())};this.waiters.add(l),l(),s>0&&setTimeout(()=>{d||(d=!0,this.waiters.delete(l),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:r}),o())},s)})}get(t){return this.textures.get(t)}set(t,i){this.textures.set(t,i),console.log(`[AssetTextures] Updated texture: ${t}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},sf=new uo,wt=new Proxy(sf,{get(e,t){return t in e&&typeof e[t]=="function"?e[t].bind(e):e.get(t)},set(e,t,i){return e.set(t,i),!0}})});var cf={};rl(cf,{AssetEditorModal:()=>mo});var mo,bo=Ue(()=>{"use strict";mo=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(t,i,n,r){this.currentObjectId=t,this.currentPath=i,this.currentAsset=n,this.onApplyCallback=r,this.createModal(t,n),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(t,i){let n=document.createElement("div");n.className="asset-editor-modal",n.innerHTML=`
|
|
3
3
|
<div class="asset-editor-card">
|
|
4
4
|
<div class="asset-editor-header">
|
|
5
5
|
<div>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
|
-
`,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Nv={};rl(Nv,{AssetCache:()=>Be,AssetLoader:()=>xt,AssetSystem:()=>Qr,AssetTextures:()=>wt,Assets:()=>Pf,BaseSystem:()=>Oi,GameEngine:()=>Jr,GameObject:()=>Dn,GameObjectManager:()=>ki,ObjectFactory:()=>_t,Renderer:()=>jn,RuntimeObjectRegistry:()=>Ii,Transform:()=>Pn,applyScreenAnchor:()=>ia,basePixi:()=>Of,clearResponsiveElements:()=>Df,createPixiBase:()=>Xr,getRegisteredFontIds:()=>Cf,globalResponsiveMultipliers:()=>Nn,initAssetTextures:()=>Ur,initAssets:()=>jf,layout:()=>Nf,playLottieOverlay:()=>kf,registerFont:()=>Af,registerType:()=>Hr,resolveAnchorVec2:()=>Bn,resolveFont:()=>Ef,resolveFontWeight:()=>Sf,resolveScreenAnchorPoint:()=>Mi,resolveScreenRatioPoint:()=>Ri,runInitSequence:()=>Bf,setLottieInstance:()=>qr,spawnSceneFromConfig:()=>Mf,updateScreenState:()=>ta});module.exports=Gf(Nv);var _f=require("pixi.js");var st={};function Gn(e,t,i=!1){st[e]||(st[e]=[]),st[e].push({fn:t,once:i})}function ca(e,t){if(st[e]){if(!t){delete st[e];return}st[e]=st[e].filter(i=>i.fn!==t)}}function Wn(e,...t){let i=st[e];if(i)for(let n of[...i])n.fn(...t),n.once&&ca(e,n.fn)}function ge(e,t){Gn(e,t,!0)}var X=null,Ee=[],qt=null;function ll(e){X=e,Ee=[],qt!==null&&(clearTimeout(qt),qt=null)}function cl(){var e,t,i;return{endpoint:(X==null?void 0:X.endpoint)||"",transport:(X==null?void 0:X.transport)||"beacon",batchSize:(e=X==null?void 0:X.batchSize)!=null?e:10,flushIntervalMs:(t=X==null?void 0:X.flushIntervalMs)!=null?t:300,maxQueue:(i=X==null?void 0:X.maxQueue)!=null?i:200,debug:!!(X!=null&&X.debug)}}async function sl(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function da(e,t){let i=cl();if(t&&i.endpoint){if(Ee.push(e),Ee.length>i.maxQueue&&(Ee=Ee.slice(Ee.length-i.maxQueue)),Ee.length>=i.batchSize){ol();return}qt===null&&(qt=window.setTimeout(()=>{qt=null,ol()},i.flushIntervalMs))}}async function ol(){let e=cl();if(!e.endpoint||Ee.length===0)return;let t=Ee.splice(0,e.batchSize);await sl(e.endpoint,{events:t},e.transport,e.debug),Ee.length>0&&await sl(e.endpoint,{events:Ee.splice(0,e.batchSize)},e.transport,e.debug)}function dl(e){return Math.max(0,Math.min(1,e))}function Wf(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function $i(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Yf(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function ul(e,t,i){try{e[t]=i}catch{}}function Vf(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function pl(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function fl(e,t){let i=Vf(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function hl(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=c=>{var u;e.add(c);let f=(u=t.get(c.target))!=null?u:new Set;f.add(c),t.set(c.target,f),n()},a=c=>{e.delete(c);let f=t.get(c.target);f&&(f.delete(c),f.size===0&&t.delete(c.target))},s=c=>{c.killed||(c.killed=!0,a(c))},o=()=>{var f,u;let c=$i();for(let p of Array.from(e)){if(p.killed||p.paused)continue;let v=c-p.startMs-p.delayMs;if(v<0)continue;let m=p.durationMs>0?v/p.durationMs:1,w=dl(m),g=p.repeat>=0?p.repeat+1:1,h=p.repeat>0?Math.min(Math.floor(m),g-1):0;if(p.repeat>0&&m>=1){let b=m-h;w=dl(b)}let x=p.ease(w);p.yoyo&&h%2===1&&(x=1-x);for(let b of p.props)ul(p.target,b.key,b.from+(b.to-b.from)*x);p.scaleFrom&&p.scaleTo&&pl(p.target,{x:p.scaleFrom.x+(p.scaleTo.x-p.scaleFrom.x)*x,y:p.scaleFrom.y+(p.scaleTo.y-p.scaleFrom.y)*x});try{(f=p.onUpdate)==null||f.call(p)}catch{}if(m>=g){s(p);try{(u=p.onComplete)==null||u.call(p)}catch{}}}},d=(c,f,u)=>{var b;let p=Math.max(0,(typeof f.duration=="number"?f.duration:.5)*1e3),v=Math.max(0,(typeof f.delay=="number"?f.delay:0)*1e3+((b=u==null?void 0:u.delayMsOverride)!=null?b:0)),m=Wf(f.ease),w=typeof f.repeat=="number"?Math.max(0,f.repeat|0):0,g=f.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let C of Object.keys(f)){if(h.has(C))continue;let S=f[C];typeof S=="number"&&x.push({key:C,from:Yf(c,C),to:S})}let y=fl(c,f);return{target:c,startMs:$i(),delayMs:v,durationMs:p,ease:m,props:x,scaleFrom:y.from,scaleTo:y.to,repeat:w,yoyo:g,onUpdate:typeof f.onUpdate=="function"?f.onUpdate:void 0,onComplete:typeof f.onComplete=="function"?f.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(c,f){let u=d(c,f);return r(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=$i())},resume:()=>{var m;if(!u.paused)return;let p=(m=u.pauseAtMs)!=null?m:$i(),v=$i()-p;u.startMs+=v,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(c,f,u){return l.set(c,f),l.to(c,u)},set(c,f){if(!c||!f)return;for(let p of Object.keys(f)){let v=f[p];p==="scale"||p==="scaleX"||p==="scaleY"||typeof v=="number"&&ul(c,p,v)}let u=fl(c,f);u.to&&pl(c,u.to)},killTweensOf(c){let f=t.get(c);if(f)for(let u of Array.from(f))s(u)},timeline(c={}){let f=[],u=0,p=!1,v=[],m=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let x=typeof h=="string"?h.trim():"";return x.startsWith("+=")?u+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):u},w=h=>{f.push(h);let x=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);u=Math.max(u,h.atMs+x)},g={to(h,x,y){return w({kind:"to",target:h,vars:x,atMs:m(y)}),g},fromTo(h,x,y,b){return w({kind:"fromTo",target:h,vars:y,from:x,atMs:m(b)}),g},play(){var h,x;if(p)return g;p=!0,v=[];for(let y of f)y.kind==="fromTo"&&l.set(y.target,(h=y.from)!=null?h:{}),v.push(l.to(y.target,{...y.vars,delay:y.atMs/1e3+((x=y.vars.delay)!=null?x:0)}));return g},pause(){for(let h of v)h.pause();return g},kill(){for(let h of v)h.kill();v=[],p=!1}};return c.paused||g.play(),g}};return l}function gl(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=hl()}catch{}}var me=0,Kf=me++,ml=me++,bl=me++,yl=me++,vl=me++,xl=me++,wl=me++,_l=me++,El=me++,Sl=me++,Al=me++,Cl=me++,q=Kf;function Tl(){return q===ml}function kl(){return q===bl}function Ll(){return q===yl}function Ol(){return q===vl}function Gt(){return q===xl}function Wt(){return q===wl}function Il(){return q===_l}function Ml(){return q===El}function Rl(){return q===Sl}function ua(){return q===Al}function pa(){return q===Cl}function Pl(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),q=ml;return}catch{}else if(e==="dapi")try{dapi.isReady(),q=bl;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(q=yl)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(q=vl)}catch{}else if(t==="mintegral")window.gameReady&&(q=xl);else if(t==="tapjoy")window.TJ_API&&(q=wl);else if(t==="tiktok")window.openAppStore&&(q=_l);else if(t==="smadex")try{window.smxTracking&&(q=El)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(q=Sl)}catch{}else t==="vungle"?q=Al:(e==="nucleo"||t==="nucleo")&&(q=Cl)}var Yn=qn(require("lottie-web"),1),jl=Yn.default;typeof window!="undefined"&&(window.lottie=Yn.default,window.__baseLottie=Yn.default);ga();function Z(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var mx=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:Z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:Z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:Z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:Z(360,780)}],bx=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:Z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:Z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:Z(412,915)}],yx=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:Z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:Z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:Z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:Z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:Z(800,1280)}],Bl=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:Z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:Z(768,1024),mraidScale:.7}];var vx=[...Bl];var nh=Bl[0];ot();var $y=qn(Zp(),1);function By(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function Fy(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}async function Hy(e){return await new Promise(t=>{let i=new Image;i.onload=()=>t({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>t(null),i.src=e})}async function ao(e){var t,i;try{console.log("[ImageUtils] Fetching image data from URL:",e);let n=await fetch(e);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,e),null;let r=await n.blob();console.log("[ImageUtils] Blob received, size:",r.size,"type:",r.type);let a=await By(r),s=await Hy(a),o=Fy(a);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:a,width:(t=s==null?void 0:s.width)!=null?t:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Br(e,t=30){try{console.log("[ImageUtils] Removing background color...");let i=await new Promise((f,u)=>{let p=new Image;p.onload=()=>f(p),p.onerror=()=>u(new Error("Failed to load image")),p.src=e}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let r=n.getContext("2d");if(!r)return console.error("[ImageUtils] Failed to get canvas context"),e;r.drawImage(i,0,0);let a=r.getImageData(0,0,n.width,n.height),s=a.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(f=>({r:s[f.offset],g:s[f.offset+1],b:s[f.offset+2]})),l=0;for(let f=0;f<s.length;f+=4){let u=s[f],p=s[f+1],v=s[f+2],m=!1;for(let w of d)if(Math.sqrt(Math.pow(u-w.r,2)+Math.pow(p-w.g,2)+Math.pow(v-w.b,2))<t){m=!0;break}m&&(s[f+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${t})`),r.putImageData(a,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),e}}var Jp=require("@google/genai");async function so(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let g=0;g<i.length;g++){let h=i[g];if(!h.base64||!h.mimeType)throw new Error(`Image ${g+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${g+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${g+1} has invalid MIME type: ${h.mimeType}`)}let f=new Jp.GoogleGenAI({apiKey:e}),u="gemini-2.5-flash",p=[t];i.length>0&&i.forEach((g,h)=>{p.push({inlineData:{data:g.base64,mimeType:g.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${g.mimeType}, size: ${Math.round(g.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${t.length}`);let v=await f.models.generateContent({model:u,contents:p}),m="",w=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(w)for(let g of w)g.text&&(m+=g.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}catch(f){throw console.error("[Gemini] API error:",f),(o=f.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=f.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=f.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(c=f.message)!=null&&c.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):f}}var Qp=require("@google/genai");async function Fr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new Qp.GoogleGenAI({apiKey:e}),a=[{text:t}];i.length>0&&i.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),a.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await r.models.generateContent({model:"gemini-2.5-flash-image",contents:a});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(r){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(r,Object.getOwnPropertyNames(r),2)),r}}var Vy=require("pixi.js");An();ot();var sf=require("pixi.js");var Ky=require("pixi.js");ot();function iv(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function nv(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}function rv(e){return`
|
|
47
|
+
`,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Fv={};rl(Fv,{AssetCache:()=>Be,AssetLoader:()=>xt,AssetSystem:()=>Qr,AssetTextures:()=>wt,Assets:()=>jf,BaseSystem:()=>Oi,GameEngine:()=>Jr,GameObject:()=>Dn,GameObjectManager:()=>ki,ObjectFactory:()=>_t,Renderer:()=>jn,RuntimeObjectRegistry:()=>Ii,Transform:()=>Pn,applyScreenAnchor:()=>ia,basePixi:()=>If,clearResponsiveElements:()=>zf,createPixiBase:()=>Xr,getRegisteredFontIds:()=>Tf,globalResponsiveMultipliers:()=>Nn,initAssetTextures:()=>Ur,initAssets:()=>Df,layout:()=>Bf,playLottieOverlay:()=>Lf,registerFont:()=>Cf,registerType:()=>Hr,resolveAnchorVec2:()=>Bn,resolveFont:()=>Sf,resolveFontWeight:()=>Af,resolveScreenAnchorPoint:()=>Mi,resolveScreenRatioPoint:()=>Ri,runInitSequence:()=>Ff,setLottieInstance:()=>qr,spawnSceneFromConfig:()=>Rf,updateScreenState:()=>ta});module.exports=Wf(Fv);var Ef=require("pixi.js");var st={};function Gn(e,t,i=!1){st[e]||(st[e]=[]),st[e].push({fn:t,once:i})}function ca(e,t){if(st[e]){if(!t){delete st[e];return}st[e]=st[e].filter(i=>i.fn!==t)}}function Wn(e,...t){let i=st[e];if(i)for(let n of[...i])n.fn(...t),n.once&&ca(e,n.fn)}function ge(e,t){Gn(e,t,!0)}var X=null,Ee=[],qt=null;function ll(e){X=e,Ee=[],qt!==null&&(clearTimeout(qt),qt=null)}function cl(){var e,t,i;return{endpoint:(X==null?void 0:X.endpoint)||"",transport:(X==null?void 0:X.transport)||"beacon",batchSize:(e=X==null?void 0:X.batchSize)!=null?e:10,flushIntervalMs:(t=X==null?void 0:X.flushIntervalMs)!=null?t:300,maxQueue:(i=X==null?void 0:X.maxQueue)!=null?i:200,debug:!!(X!=null&&X.debug)}}async function sl(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function da(e,t){let i=cl();if(t&&i.endpoint){if(Ee.push(e),Ee.length>i.maxQueue&&(Ee=Ee.slice(Ee.length-i.maxQueue)),Ee.length>=i.batchSize){ol();return}qt===null&&(qt=window.setTimeout(()=>{qt=null,ol()},i.flushIntervalMs))}}async function ol(){let e=cl();if(!e.endpoint||Ee.length===0)return;let t=Ee.splice(0,e.batchSize);await sl(e.endpoint,{events:t},e.transport,e.debug),Ee.length>0&&await sl(e.endpoint,{events:Ee.splice(0,e.batchSize)},e.transport,e.debug)}function dl(e){return Math.max(0,Math.min(1,e))}function Yf(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function $i(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Vf(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function ul(e,t,i){try{e[t]=i}catch{}}function Kf(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function pl(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function fl(e,t){let i=Kf(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function hl(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=c=>{var u;e.add(c);let f=(u=t.get(c.target))!=null?u:new Set;f.add(c),t.set(c.target,f),n()},a=c=>{e.delete(c);let f=t.get(c.target);f&&(f.delete(c),f.size===0&&t.delete(c.target))},s=c=>{c.killed||(c.killed=!0,a(c))},o=()=>{var f,u;let c=$i();for(let p of Array.from(e)){if(p.killed||p.paused)continue;let v=c-p.startMs-p.delayMs;if(v<0)continue;let m=p.durationMs>0?v/p.durationMs:1,w=dl(m),g=p.repeat>=0?p.repeat+1:1,h=p.repeat>0?Math.min(Math.floor(m),g-1):0;if(p.repeat>0&&m>=1){let b=m-h;w=dl(b)}let x=p.ease(w);p.yoyo&&h%2===1&&(x=1-x);for(let b of p.props)ul(p.target,b.key,b.from+(b.to-b.from)*x);p.scaleFrom&&p.scaleTo&&pl(p.target,{x:p.scaleFrom.x+(p.scaleTo.x-p.scaleFrom.x)*x,y:p.scaleFrom.y+(p.scaleTo.y-p.scaleFrom.y)*x});try{(f=p.onUpdate)==null||f.call(p)}catch{}if(m>=g){s(p);try{(u=p.onComplete)==null||u.call(p)}catch{}}}},d=(c,f,u)=>{var b;let p=Math.max(0,(typeof f.duration=="number"?f.duration:.5)*1e3),v=Math.max(0,(typeof f.delay=="number"?f.delay:0)*1e3+((b=u==null?void 0:u.delayMsOverride)!=null?b:0)),m=Yf(f.ease),w=typeof f.repeat=="number"?Math.max(0,f.repeat|0):0,g=f.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let C of Object.keys(f)){if(h.has(C))continue;let S=f[C];typeof S=="number"&&x.push({key:C,from:Vf(c,C),to:S})}let y=fl(c,f);return{target:c,startMs:$i(),delayMs:v,durationMs:p,ease:m,props:x,scaleFrom:y.from,scaleTo:y.to,repeat:w,yoyo:g,onUpdate:typeof f.onUpdate=="function"?f.onUpdate:void 0,onComplete:typeof f.onComplete=="function"?f.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(c,f){let u=d(c,f);return r(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=$i())},resume:()=>{var m;if(!u.paused)return;let p=(m=u.pauseAtMs)!=null?m:$i(),v=$i()-p;u.startMs+=v,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(c,f,u){return l.set(c,f),l.to(c,u)},set(c,f){if(!c||!f)return;for(let p of Object.keys(f)){let v=f[p];p==="scale"||p==="scaleX"||p==="scaleY"||typeof v=="number"&&ul(c,p,v)}let u=fl(c,f);u.to&&pl(c,u.to)},killTweensOf(c){let f=t.get(c);if(f)for(let u of Array.from(f))s(u)},timeline(c={}){let f=[],u=0,p=!1,v=[],m=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let x=typeof h=="string"?h.trim():"";return x.startsWith("+=")?u+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):u},w=h=>{f.push(h);let x=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);u=Math.max(u,h.atMs+x)},g={to(h,x,y){return w({kind:"to",target:h,vars:x,atMs:m(y)}),g},fromTo(h,x,y,b){return w({kind:"fromTo",target:h,vars:y,from:x,atMs:m(b)}),g},play(){var h,x;if(p)return g;p=!0,v=[];for(let y of f)y.kind==="fromTo"&&l.set(y.target,(h=y.from)!=null?h:{}),v.push(l.to(y.target,{...y.vars,delay:y.atMs/1e3+((x=y.vars.delay)!=null?x:0)}));return g},pause(){for(let h of v)h.pause();return g},kill(){for(let h of v)h.kill();v=[],p=!1}};return c.paused||g.play(),g}};return l}function gl(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=hl()}catch{}}var ml={name:"handler-playable-sdk",version:"0.3.16",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"}},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json",lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",sharp:"^0.34.5"}};var me=0,Zf=me++,bl=me++,yl=me++,vl=me++,xl=me++,wl=me++,_l=me++,El=me++,Sl=me++,Al=me++,Cl=me++,Tl=me++,q=Zf;function kl(){return q===bl}function Ll(){return q===yl}function Ol(){return q===vl}function Il(){return q===xl}function Gt(){return q===wl}function Wt(){return q===_l}function Ml(){return q===El}function Rl(){return q===Sl}function Pl(){return q===Al}function ua(){return q===Cl}function pa(){return q===Tl}function jl(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),q=bl;return}catch{}else if(e==="dapi")try{dapi.isReady(),q=yl;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(q=vl)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(q=xl)}catch{}else if(t==="mintegral")window.gameReady&&(q=wl);else if(t==="tapjoy")window.TJ_API&&(q=_l);else if(t==="tiktok")window.openAppStore&&(q=El);else if(t==="smadex")try{window.smxTracking&&(q=Sl)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(q=Al)}catch{}else t==="vungle"?q=Cl:(e==="nucleo"||t==="nucleo")&&(q=Tl)}var Yn=qn(require("lottie-web"),1),Dl=Yn.default;typeof window!="undefined"&&(window.lottie=Yn.default,window.__baseLottie=Yn.default);ga();function Z(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var vx=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:Z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:Z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:Z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:Z(360,780)}],xx=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:Z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:Z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:Z(412,915)}],wx=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:Z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:Z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:Z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:Z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:Z(800,1280)}],Fl=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:Z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:Z(768,1024),mraidScale:.7}];var _x=[...Fl];var ah=Fl[0];ot();var qy=qn(Jp(),1);function Hy(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function $y(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}async function Uy(e){return await new Promise(t=>{let i=new Image;i.onload=()=>t({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>t(null),i.src=e})}async function ao(e){var t,i;try{console.log("[ImageUtils] Fetching image data from URL:",e);let n=await fetch(e);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,e),null;let r=await n.blob();console.log("[ImageUtils] Blob received, size:",r.size,"type:",r.type);let a=await Hy(r),s=await Uy(a),o=$y(a);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:a,width:(t=s==null?void 0:s.width)!=null?t:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Br(e,t=30){try{console.log("[ImageUtils] Removing background color...");let i=await new Promise((f,u)=>{let p=new Image;p.onload=()=>f(p),p.onerror=()=>u(new Error("Failed to load image")),p.src=e}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let r=n.getContext("2d");if(!r)return console.error("[ImageUtils] Failed to get canvas context"),e;r.drawImage(i,0,0);let a=r.getImageData(0,0,n.width,n.height),s=a.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(f=>({r:s[f.offset],g:s[f.offset+1],b:s[f.offset+2]})),l=0;for(let f=0;f<s.length;f+=4){let u=s[f],p=s[f+1],v=s[f+2],m=!1;for(let w of d)if(Math.sqrt(Math.pow(u-w.r,2)+Math.pow(p-w.g,2)+Math.pow(v-w.b,2))<t){m=!0;break}m&&(s[f+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${t})`),r.putImageData(a,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),e}}var Qp=require("@google/genai");async function so(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let g=0;g<i.length;g++){let h=i[g];if(!h.base64||!h.mimeType)throw new Error(`Image ${g+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${g+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${g+1} has invalid MIME type: ${h.mimeType}`)}let f=new Qp.GoogleGenAI({apiKey:e}),u="gemini-2.5-flash",p=[t];i.length>0&&i.forEach((g,h)=>{p.push({inlineData:{data:g.base64,mimeType:g.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${g.mimeType}, size: ${Math.round(g.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${t.length}`);let v=await f.models.generateContent({model:u,contents:p}),m="",w=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(w)for(let g of w)g.text&&(m+=g.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}catch(f){throw console.error("[Gemini] API error:",f),(o=f.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=f.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=f.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(c=f.message)!=null&&c.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):f}}var ef=require("@google/genai");async function Fr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new ef.GoogleGenAI({apiKey:e}),a=[{text:t}];i.length>0&&i.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),a.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await r.models.generateContent({model:"gemini-2.5-flash-image",contents:a});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(r){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(r,Object.getOwnPropertyNames(r),2)),r}}var Xy=require("pixi.js");An();ot();var of=require("pixi.js");var Zy=require("pixi.js");ot();function rv(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function av(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}function sv(e){return`
|
|
48
48
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
49
49
|
|
|
50
50
|
Provide a concise summary (2-3 sentences) covering:
|
|
@@ -61,9 +61,9 @@ Palette: [#RRGGBB, #RRGGBB, ...]
|
|
|
61
61
|
${e?`
|
|
62
62
|
ADDITIONAL RULES/NOTES:
|
|
63
63
|
${e}`:""}
|
|
64
|
-
`.trim()}function
|
|
64
|
+
`.trim()}function lf(){let e=[],t="",i=null;return{async addSources(n){let r=[];for(let a of n){let s=await rv(a),o=av(s),d={id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,name:a.name,base64:o.base64,mimeType:o.mimeType,dataUrl:s};e.push(d),r.push(d)}return r},getSources(){return e.slice()},async analyze(n,r,a){if(e.length===0)throw new Error("No screenshots to analyze.");let s=sv(r),o=e.map(u=>({base64:u.base64,mimeType:u.mimeType})),d=await so(n,s,o,{model:a}),l=t,c=[],f=d.split(`
|
|
65
65
|
`);for(let u of f)if(u.toLowerCase().startsWith("summary:"))l=u.slice(8).trim();else if(u.toLowerCase().includes("palette:")){let p=u.match(/#[0-9A-Fa-f]{6}/g);p&&p.forEach(v=>{c.includes(v.toUpperCase())||c.push(v.toUpperCase())})}return(!l||l===t)&&(l=d.split(`
|
|
66
|
-
Palette:`)[0].replace(/^Summary:\s*/i,"").trim()),i={summary:l,palette:c.slice(0,10)},i},setSummary(n){t=n,i&&(i={...i,summary:n})},getResult(){return i}}}var Ht="handler_api_key_";var xi=class{static setKey(t,i,n){try{let r={key:this.encryptKey(i),created:Date.now(),lastUsed:Date.now(),label:n||t},a=`${Ht}${t}`;localStorage.setItem(a,JSON.stringify(r))}catch(r){console.error("[ApiKeyStorage] Failed to store API key:",r)}}static getKey(t){try{let i=`${Ht}${t}`,n=localStorage.getItem(i);if(!n)return null;let r=JSON.parse(n);return r.lastUsed=Date.now(),localStorage.setItem(i,JSON.stringify(r)),this.decryptKey(r.key)}catch(i){return console.error("[ApiKeyStorage] Failed to retrieve API key:",i),null}}static hasKey(t){let i=`${Ht}${t}`;return localStorage.getItem(i)!==null}static removeKey(t){try{let i=`${Ht}${t}`;localStorage.removeItem(i)}catch(i){console.error("[ApiKeyStorage] Failed to remove API key:",i)}}static getStoredServices(){let t=[];try{for(let i=0;i<localStorage.length;i++){let n=localStorage.key(i);if(n&&n.startsWith(Ht)){let r=n.substring(Ht.length),a=localStorage.getItem(n);if(a){let s=JSON.parse(a);t.push({service:r,label:s.label,created:s.created,lastUsed:s.lastUsed})}}}}catch(i){console.error("[ApiKeyStorage] Failed to get stored services:",i)}return t.sort((i,n)=>n.lastUsed-i.lastUsed)}static clearAll(){try{let t=[];for(let i=0;i<localStorage.length;i++){let n=localStorage.key(i);n&&n.startsWith(Ht)&&t.push(n)}t.forEach(i=>localStorage.removeItem(i))}catch(t){console.error("[ApiKeyStorage] Failed to clear API keys:",t)}}static encryptKey(t){try{let n="handler_preview_salt_2024"+t;return btoa(n)}catch(i){return console.warn("[ApiKeyStorage] Encryption failed, storing as-is:",i),t}}static decryptKey(t){try{let i=atob(t),n="handler_preview_salt_2024";return i.startsWith(n)?i.substring(n.length):i}catch(i){return console.warn("[ApiKeyStorage] Decryption failed, returning as-is:",i),t}}},po=()=>xi.getKey("gemini"),fo=(e,t)=>xi.setKey("gemini",e,t),
|
|
66
|
+
Palette:`)[0].replace(/^Summary:\s*/i,"").trim()),i={summary:l,palette:c.slice(0,10)},i},setSummary(n){t=n,i&&(i={...i,summary:n})},getResult(){return i}}}var Ht="handler_api_key_";var xi=class{static setKey(t,i,n){try{let r={key:this.encryptKey(i),created:Date.now(),lastUsed:Date.now(),label:n||t},a=`${Ht}${t}`;localStorage.setItem(a,JSON.stringify(r))}catch(r){console.error("[ApiKeyStorage] Failed to store API key:",r)}}static getKey(t){try{let i=`${Ht}${t}`,n=localStorage.getItem(i);if(!n)return null;let r=JSON.parse(n);return r.lastUsed=Date.now(),localStorage.setItem(i,JSON.stringify(r)),this.decryptKey(r.key)}catch(i){return console.error("[ApiKeyStorage] Failed to retrieve API key:",i),null}}static hasKey(t){let i=`${Ht}${t}`;return localStorage.getItem(i)!==null}static removeKey(t){try{let i=`${Ht}${t}`;localStorage.removeItem(i)}catch(i){console.error("[ApiKeyStorage] Failed to remove API key:",i)}}static getStoredServices(){let t=[];try{for(let i=0;i<localStorage.length;i++){let n=localStorage.key(i);if(n&&n.startsWith(Ht)){let r=n.substring(Ht.length),a=localStorage.getItem(n);if(a){let s=JSON.parse(a);t.push({service:r,label:s.label,created:s.created,lastUsed:s.lastUsed})}}}}catch(i){console.error("[ApiKeyStorage] Failed to get stored services:",i)}return t.sort((i,n)=>n.lastUsed-i.lastUsed)}static clearAll(){try{let t=[];for(let i=0;i<localStorage.length;i++){let n=localStorage.key(i);n&&n.startsWith(Ht)&&t.push(n)}t.forEach(i=>localStorage.removeItem(i))}catch(t){console.error("[ApiKeyStorage] Failed to clear API keys:",t)}}static encryptKey(t){try{let n="handler_preview_salt_2024"+t;return btoa(n)}catch(i){return console.warn("[ApiKeyStorage] Encryption failed, storing as-is:",i),t}}static decryptKey(t){try{let i=atob(t),n="handler_preview_salt_2024";return i.startsWith(n)?i.substring(n.length):i}catch(i){return console.warn("[ApiKeyStorage] Decryption failed, returning as-is:",i),t}}},po=()=>xi.getKey("gemini"),fo=(e,t)=>xi.setKey("gemini",e,t),ov=()=>xi.hasKey("gemini");window.ApiKeyStorage=xi;window.getGeminiApiKey=po;window.setGeminiApiKey=fo;window.hasGeminiApiKey=ov;var go=class{constructor(){this.modal=null;this.options=null;this.analyzer=lf();this.currentPrompt="";this.isGenerating=!1;this.generatedImages=[];this.selectedImageIndex=-1;this.promptInput=null;this.generateBtn=null;this.loadingEl=null;this.galleryEl=null;this.previewEl=null}open(t){this.options=t,this.currentPrompt=t.initialPrompt||"",this.generatedImages=[],this.selectedImageIndex=-1,this.isGenerating=!1,this.createModal(),document.body.appendChild(this.modal),setTimeout(()=>{var i,n;(i=this.promptInput)==null||i.focus(),(n=this.promptInput)==null||n.select()},100)}createModal(){var i;let t=document.createElement("div");t.className="ai-modal",t.innerHTML=`
|
|
67
67
|
<div class="ai-modal-card">
|
|
68
68
|
<div class="ai-modal-header">
|
|
69
69
|
<div class="ai-modal-actions">
|
|
@@ -176,7 +176,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
176
176
|
<source src="${r}" type="audio/wav">
|
|
177
177
|
Your browser does not support the audio element.
|
|
178
178
|
</audio>
|
|
179
|
-
`;case"text":return`<pre style="background: rgba(0,0,0,0.2); padding: 16px; border-radius: 8px; max-height: 300px; overflow-y: auto; white-space: pre-wrap;">${t}</pre>`;default:return`<div class="asset-preview-placeholder">Cannot preview ${i} assets</div>`}}resolveAssetUrl(t){return t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("/")?t:`/raw/${t}`}attachEventListeners(){if(!this.modal)return;this.modal.addEventListener("click",n=>{let r=n.target;(r.dataset.action==="close"||r===this.modal)&&this.close()});let t=this.modal.querySelector('[data-action="change"]');t&&t.addEventListener("click",()=>{this.openAssetEditor()});let i=this.modal.querySelector('[data-action="edit"]');i&&i.addEventListener("click",()=>{this.openAiEditor(),this.close()})}openAssetEditor(){this.options&&Promise.resolve().then(()=>(bo(),
|
|
179
|
+
`;case"text":return`<pre style="background: rgba(0,0,0,0.2); padding: 16px; border-radius: 8px; max-height: 300px; overflow-y: auto; white-space: pre-wrap;">${t}</pre>`;default:return`<div class="asset-preview-placeholder">Cannot preview ${i} assets</div>`}}resolveAssetUrl(t){return t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("/")?t:`/raw/${t}`}attachEventListeners(){if(!this.modal)return;this.modal.addEventListener("click",n=>{let r=n.target;(r.dataset.action==="close"||r===this.modal)&&this.close()});let t=this.modal.querySelector('[data-action="change"]');t&&t.addEventListener("click",()=>{this.openAssetEditor()});let i=this.modal.querySelector('[data-action="edit"]');i&&i.addEventListener("click",()=>{this.openAiEditor(),this.close()})}openAssetEditor(){this.options&&Promise.resolve().then(()=>(bo(),cf)).then(({AssetEditorModal:t})=>{new t().show(this.options.objectId||"unknown",this.options.propertyPath||"",this.options.assetPath,n=>{var r;(r=this.options)!=null&&r.onChange&&this.options.onChange(n),this.close()})})}openAiEditor(){if(!this.options||this.options.assetType!=="image")return;let t=window.__openAiEditor;typeof t=="function"&&t(this.options.objectId||"asset","Edit this image asset",this.options.assetPath,{path:this.options.propertyPath,onApply:i=>{var n;(n=this.options)!=null&&n.onChange&&this.options.onChange(i)}})}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.options=null}};window.openAssetPreview=function(e){new yo().open(e)};var vo=class{constructor(){this.modal=null;this.canvas=null;this.ctx=null;this.image=null;this.options=null;this.cropX=0;this.cropY=0;this.cropWidth=100;this.cropHeight=100;this.scale=1;this.panX=0;this.panY=0;this.isDragging=!1;this.dragStartX=0;this.dragStartY=0;this.lastPanX=0;this.lastPanY=0}open(t){this.options=t,this.createModal(),this.loadImage(),document.body.appendChild(this.modal)}createModal(){let t=document.createElement("div");t.className="asset-crop-modal",t.innerHTML=`
|
|
180
180
|
<div class="asset-crop-card">
|
|
181
181
|
<div class="asset-crop-header">
|
|
182
182
|
<div>
|
|
@@ -227,7 +227,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
227
227
|
<button class="asset-crop-apply primary" data-action="apply">Apply Crop</button>
|
|
228
228
|
</div>
|
|
229
229
|
</div>
|
|
230
|
-
`,this.modal=t,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var n;if(!this.image||!this.canvas)return;let t=this.image.width/this.image.height,i=this.canvas.width/this.canvas.height;t>i?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*i,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/i,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(t){if(!this.image)return;let i=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,r=this.cropY+this.cropHeight/2;t>i?(this.cropWidth=Math.min(this.image.width,this.cropHeight*t),this.cropHeight=this.cropWidth/t):(this.cropHeight=Math.min(this.image.height,this.cropWidth/t),this.cropWidth=this.cropHeight*t),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,r-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let t=this.canvas.width/this.cropWidth,i=this.canvas.height/this.cropHeight;this.scale=Math.min(t,i)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let t=this.panX,i=this.panY,n=this.cropWidth*this.scale,r=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(t,i,n,r),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(t,i,n,r),this.ctx.fillStyle="#ffffff";let a=8;[[t,i],[t+n-a,i],[t,i+r-a],[t+n-a,i+r-a]].forEach(([o,d])=>{var l;(l=this.ctx)==null||l.fillRect(o,d,a,a)})}updatePreview(){if(!this.modal||!this.image)return;let t=this.modal.querySelector(".asset-crop-preview-canvas");if(!t)return;let i=t.getContext("2d");if(!i)return;let n=150;t.width=n,t.height=n;let r=n/this.cropWidth,a=n/this.cropHeight,s=Math.min(r,a),o=this.cropWidth*s,d=this.cropHeight*s,l=(n-o)/2,c=(n-d)/2;i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,l,c,o,d)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let t=this.modal.querySelector(".asset-crop-zoom-slider");t==null||t.addEventListener("input",n=>{let r=parseFloat(n.target.value);this.setZoom(r)});let i=this.modal.querySelector(".asset-crop-aspect-select");i==null||i.addEventListener("change",n=>{let r=n.target.value;this.setAspectRatio(r)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(t){this.isDragging=!0,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(t){if(!this.isDragging)return;let i=t.clientX-this.dragStartX,n=t.clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(t){t.preventDefault();let i=t.deltaY>0?.9:1.1;this.setZoom(this.scale*i)}handleTouchStart(t){t.touches.length===1&&(this.isDragging=!0,this.dragStartX=t.touches[0].clientX,this.dragStartY=t.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(t){if(!this.isDragging||t.touches.length!==1)return;t.preventDefault();let i=t.touches[0].clientX-this.dragStartX,n=t.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(t){this.scale=Math.max(.1,Math.min(3,t)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(t){let i;switch(t){case"1:1":i=1;break;case"4:3":i=4/3;break;case"16:9":i=16/9;break;case"3:2":i=3/2;break;default:i=void 0}i&&this.applyAspectRatio(i),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let t=this.modal.querySelector(".asset-crop-zoom-value"),i=this.modal.querySelector(".asset-crop-zoom-slider");t&&(t.textContent=`${this.scale.toFixed(1)}x`),i&&(i.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let t=this.cropWidth*this.scale,i=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-t,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-i,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var r;if(!this.image||!((r=this.options)!=null&&r.onCrop))return;let t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return;t.width=this.cropWidth,t.height=this.cropHeight,i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=t.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let t=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,t!=null&&t.onCancel&&t.onCancel()}};window.openAssetCrop=function(e){new vo().open(e)};ot();var Cn=require("pixi.js");$r();var sv=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",xo=sv;if(typeof window!="undefined")try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);t!=null&&t.buildMode&&(xo=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${xo}`))}}catch{}var _t=class{static async create(t,i,n){var d,l,c,f,u,p,v;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${xo}`);let r=(d=i==null?void 0:i.render)==null?void 0:d.asset;if(!r){console.log(`[ObjectFactory] No asset definition for: ${t}, returning empty container`);let m=new Cn.Container;return this.applyTransform(m,i==null?void 0:i.transform),m}let a=(l=i==null?void 0:i.identity)==null?void 0:l.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${t}, configId: ${a}, type: ${r.type}, path: ${r.path}`);let s=await xt.load(t,r,n,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${t}, rawAsset type: ${(c=s==null?void 0:s.constructor)==null?void 0:c.name}`);let o;if(r.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",t),o=new Cn.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(f=o==null?void 0:o.constructor)==null?void 0:f.name),this.applyTransform(o,i==null?void 0:i.transform);else if(r.type==="json")if(console.log("[ObjectFactory] JSON asset for",t,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((p=s.constructor)==null?void 0:p.name)==="Container"||s instanceof Cn.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let m=[r.path,`/assets/${r.path}`,`assets/${r.path}`,`../assets/${r.path}`],w=!1;for(let g of m)try{let h=await fetch(g);if(h.ok){o=await h.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",g,"type:",(v=o==null?void 0:o.constructor)==null?void 0:v.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};ot();var cf=qn(require("lottie-web"),1);qr(jl);typeof window!="undefined"&&!window.lottie&&(window.lottie=cf.default);ga();ot();var wo="0.3.12",ov=new Set(["init","boot","view","ready","start","pause","resume","complete","error","engagement","first_interaction","retry","cta_show","cta_click","cta_dismiss","clickout","conversion","session_time","level_time","load_time","level_start","level_complete","level_fail","checkpoint","reward","tutorial_start","tutorial_complete","tutorial_skip","ab_assign","fps","memory","asset_load_start","asset_load_complete"]);gl();var mf={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},bf=Math.random().toString(36).slice(2),Ei=null,wi={...mf},yf="web_embed",Ao={},Ln,_o=!1,kn=!1,In=!1,vf=!1,Lo=1,Wr=0,Kr=!1,it=!1,_i="",Si=Math.floor(window.innerWidth),Ai=Math.floor(window.innerHeight),Co=Si>Ai,nt=!1,On=!1,df=!1,uf=!1,Eo=!1,Yr=null,$t=null,To=!1,ko=!1,Gr=new Map;function xf(){if(!$t)return null;let e=Date.now()-$t;return!Number.isFinite(e)||e<0?null:e}function So(e){if(To)return;let t=xf();t!==null&&(To=!0,L("session_time",{duration_ms:t,reason:e}))}function pf(){if(Ei)return Ei;let e=document.createElement("div");return e.id="handler-root",e.setAttribute("data-handler-root","true"),document.body.appendChild(e),Ei=e,e}function Vr(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function wf(e,t){return{event_name:e,ts:Date.now(),session_id:bf,deployment_id:wi.deployment_id,variant_id:wi.variant_id,export_profile_id:wi.profile_id,instance_id:wi.instance_id||"default",env:yf==="mraid"?"mraid":"web",attribution:Ln,payload:t}}function L(e,t){let i=Vr(e),n=wf(i,t);da(n,!!Ao.analytics),Wn(i,n),i!==e&&Wn(e,n)}function Mn(){Yr&&(Yr(Si,Ai),Yr=null)}function Ci(e){Lo=e,L("volume",e)}function Ti(e){e&&(vf=!0),!In&&(In=!0,L("pause"),Ci(0))}function Rn(e){!e&&vf||In&&(In=!1,L("resume"),Ci(Lo))}function Et(e,t){Si=Math.floor(e||window.innerWidth),Ai=Math.floor(t||window.innerHeight),Co=Si>Ai,L("resize",{width:Si,height:Ai})}function lv(){if(Tl())try{let e=mraid.getMaxSize();Et(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?Rn():Ti()};if(mraid.addEventListener("viewableChange",t),mraid.addEventListener("stateChange",t),mraid.addEventListener("sizeChange",()=>{let i=mraid.getMaxSize();Et(i.width,i.height)}),mraid.getAudioVolume){let i=mraid.getAudioVolume();Ci(i?1:0)}if(mraid.addEventListener("audioVolumeChange",i=>{i!==null&&Ci(i>0?1:0)}),mraid.addEventListener("error",(i,n)=>{console.warn("mraid error:",i,"action:",n)}),Kr=!0,mraid.isViewable()&&mraid.getState()!=="hidden")nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn();else{let i=()=>{nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn()};mraid.addEventListener("ready",i)}}catch(e){console.warn("MRAID hook skipped",e)}}function cv(){if(kl())try{let e=dapi.getScreenSize();Et(e.width,e.height),dapi.addEventListener("viewableChange",i=>{i.isViewable?Rn():Ti()}),dapi.addEventListener("adResized",i=>{let n=dapi.getScreenSize();Et(i.width||n.width,i.height||n.height)});let t=dapi.getAudioVolume();if(Ci(t?1:0),dapi.addEventListener("audioVolumeChange",i=>Ci(i?1:0)),Kr=!0,dapi.isViewable())nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn();else{let i=()=>{nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn()};dapi.addEventListener("ready",i)}}catch(e){console.warn("DAPI hook skipped",e)}}function ff(){let e=()=>{nt||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn(),On&&(On=!1,He.start()))};window.addEventListener("resize",()=>Et()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(Rn(),e()):Ti()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),Kr=!0}function dv(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(df=!0),!(df&&t instanceof MouseEvent)&&(Wr+=1,ko||(ko=!0,L("first_interaction",{count:Wr})),L("interaction",Wr))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function hf(e){var n,r,a,s,o,d,l,c,f,u,p,v;let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(n=window.ExitApi)==null||n.exit();return}catch{}if(t==="mraid"&&typeof mraid!="undefined")mraid.open(e||"");else if(t==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Wt())(a=(r=window.TJ_API)==null?void 0:r.click)==null||a.call(r);else if(Ll())(o=(s=window.FbPlayableAd)==null?void 0:s.onCTAClick)==null||o.call(s);else if(Rl())(l=(d=window.ScPlayableAd)==null?void 0:d.onCTAClick)==null||l.call(d);else if(Ml())try{(f=(c=window.smxTracking)==null?void 0:c.redirect)==null||f.call(c)}catch(m){console.warn("Smadex redirect failed",m)}else if(Ol()){let m=window.ExitApi;m&&typeof m.exit=="function"?m.exit(e||_i||""):e&&window.open(e)}else Gt()?(u=window.install)==null||u.call(window):Il()?(p=window.openAppStore)==null||p.call(window):ua()?(v=parent==null?void 0:parent.postMessage)==null||v.call(parent,"download","*"):e&&window.open(e)}function uv(){let e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",t=i=>{if(!i)return;let n=new Image;n.src=i};if(e==="bigabid"){let i=window.BIGABID_BIDTIMEMACROS;if(!i)return;ge("view",()=>t(i.mraid_viewable)),ge("start",()=>t(i.game_viewable)),ge("engagement",()=>t(i.engagement));let n=()=>t(i.complete);ge("complete",n),Gn("engagement",r=>{var a;((a=r==null?void 0:r.payload)==null?void 0:a.count)>3&&n()}),ge("cta_click",()=>t(i.click))}else if(e==="inmobi"){let i=window.INMOBI_DSPMACROS;if(!i)return;ge("view",()=>t(i.Ad_Load_Start)),ge("start",()=>t(i.Ad_Viewable)),ge("engagement",()=>t(i.First_Engagement)),ge("complete",()=>t(i.Gameplay_Complete)),ge("cta_click",()=>t(i.DSP_Click)),ge("start",()=>{[5,10,15,20,25,30].forEach(n=>setTimeout(()=>t(i[`Spent_${n}_Seconds`]),n*1e3))})}}function pv(){if(!Wt())return;let e=window.TJ_API;e&&e.setPlayableAPI&&e.setPlayableAPI({skipAd:()=>{try{He.finish()}catch(t){console.warn("Tapjoy skip failed",t)}}})}function gf(){var t,i,n;let e=window.TJ_API;(t=e==null?void 0:e.objectiveComplete)==null||t.call(e),(i=e==null?void 0:e.playableFinished)==null||i.call(e),(n=e==null?void 0:e.gameplayFinished)==null||n.call(e)}function fv(){Gt()&&(window.mintGameStart=()=>{Rn(!0),Et()},window.mintGameClose=()=>{Ti(!0)})}function hv(){if(!pa())return;let e=window.NUC;!e||!e.trigger||(He.on("cta_click",()=>{var t,i;return(i=(t=e.trigger).convert)==null?void 0:i.call(t,_i)}),He.on("complete",()=>{var t,i;return(i=(t=e.trigger).tryAgain)==null?void 0:i.call(t)}))}var He={init(e={},t){var i;if(yf=e.profile||"web_embed",Ao=e.consent||{},wi={...mf,...e.ids||{}},Ei=e.rootEl||Ei,Ln=void 0,ll((i=e.telemetry)!=null&&i.endpoint?e.telemetry:null),$t=null,To=!1,ko=!1,Gr.clear(),_i=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(Yr=t),L("init"),document.body.oncontextmenu=()=>!1,pf(),mv(Ei),Pl(),lv(),cv(),!Kr){if(document.readyState==="complete")ff();else if(!uf){uf=!0;let n=()=>{ff(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}dv(),uv(),pv(),fv(),hv(),console.log(`%c @handler/playable-sdk %c v${wo} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),nt&&!it&&(L("boot"),L("view"),L("ready"),On&&(On=!1,He.start()),it=!0),it=nt},getRoot(){return pf()},get version(){return wo},get maxWidth(){return Si},get maxHeight(){return Ai},get isLandscape(){return Co},get isReady(){return it},get isStarted(){return _o},get isPaused(){return In},get isFinished(){return kn},get volume(){return Lo},get interactions(){return Wr},on(e,t){Gn(Vr(e),t)},off(e,t){ca(Vr(e),t)},start(){var e,t;if(!_o){if(!nt){On=!0;return}if(_o=!0,$t||($t=Date.now()),L("start"),Et(),Gt())Ti(),(e=window.gameReady)==null||e.call(window);else if(Wt()){let i=window.TJ_API;(t=i==null?void 0:i.setPlayableBuild)==null||t.call(i,{orientation:Co?"landscape":"portrait",buildID:wo})}}},finish(){var e,t;kn||(kn=!0,L("complete"),So("complete"),Gt()?(e=window.gameEnd)==null||e.call(window):ua()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):Wt()&&gf())},install(e){if(!kn){kn=!0,Wt()?(gf(),setTimeout(()=>He.install(e),300)):(L("complete"),setTimeout(()=>He.install(e),0));return}Eo||(Eo=!0,setTimeout(()=>Eo=!1,500),L("cta_click"),L("conversion"),So("cta"),hf(e||_i))},emit(e,t){let i=Vr(e);if(!ov.has(i)&&i!=="resize"&&i!=="volume"&&!i.startsWith("custom."))throw new Error(`Event ${e} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let n=wf(i,t);da(n,!!Ao.analytics),Wn(i,n)},gameStart(){He.start()},gameEnd(){He.finish()},ctaClick(e,t){L("cta_click",{url:e||_i,manual:!0}),(t==null?void 0:t.open)!==!1&&hf(e||_i)},ctaShow(e){L("cta_show",e)},ctaDismiss(e){L("cta_dismiss",e)},getGameTimeMs(){return xf()},endSession(e="manual"){So(e)},setAttribution(e){Ln=e},abTest(e,t){if(!e)throw new Error("abTest requires experimentId");if(!Array.isArray(t)||t.length<2)throw new Error("abTest requires at least 2 variants");let i=Math.abs(gv(`${bf}:${e}`))%t.length,n=t[i];return Ln={...Ln||{},experiment_id:e},wi.variant_id=n,L("ab_assign",{experiment_id:e,variant_id:n}),n},levelStart(e,t){$t||($t=Date.now()),L("level_start",{level_id:e,...t})},levelComplete(e,t){L("level_complete",{level_id:e,...t})},levelFail(e,t){L("level_fail",{level_id:e,...t})},checkpoint(e,t){L("checkpoint",{checkpoint_id:e,...t})},reward(e,t){L("reward",{reward_id:e,...t})},tutorialStart(e,t){L("tutorial_start",{step_id:e,...t})},tutorialComplete(e,t){L("tutorial_complete",{step_id:e,...t})},tutorialSkip(e,t){L("tutorial_skip",{step_id:e,...t})},timerStart(e){e&&Gr.set(e,Date.now())},timerEnd(e,t="custom",i){if(!e)return;let n=Gr.get(e);if(!n)return;Gr.delete(e);let r=Date.now()-n;if(!(!Number.isFinite(r)||r<0)){if(t==="custom"){L("engagement",{action:"timer",key:e,duration_ms:r,...i});return}L(t,{key:e,duration_ms:r,...i})}},fps(e,t){L("fps",{value:e,...t})},memory(e,t){L("memory",{bytes:e,...t})},assetLoadStart(e,t){L("asset_load_start",{asset_id:e,...t})},assetLoadComplete(e,t){L("asset_load_complete",{asset_id:e,...t})},reportError(e,t,i){L("error",{code:e,message:t,...i})},retry(){var e,t,i;if(Gt())(e=window.gameRetry)==null||e.call(window);else if(pa()){let n=window.NUC;(i=(t=n==null?void 0:n.trigger)==null?void 0:t.tryAgain)==null||i.call(t)}L("engagement",{action:"retry"})},pause(){Ti(!0)},resume(){Rn(!0)},resize(e,t){Et(e,t)}},Tn=He;function gv(e){let t=2166136261;for(let i=0;i<e.length;i++)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return t|0}function mv(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
|
|
230
|
+
`,this.modal=t,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var n;if(!this.image||!this.canvas)return;let t=this.image.width/this.image.height,i=this.canvas.width/this.canvas.height;t>i?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*i,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/i,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(t){if(!this.image)return;let i=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,r=this.cropY+this.cropHeight/2;t>i?(this.cropWidth=Math.min(this.image.width,this.cropHeight*t),this.cropHeight=this.cropWidth/t):(this.cropHeight=Math.min(this.image.height,this.cropWidth/t),this.cropWidth=this.cropHeight*t),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,r-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let t=this.canvas.width/this.cropWidth,i=this.canvas.height/this.cropHeight;this.scale=Math.min(t,i)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let t=this.panX,i=this.panY,n=this.cropWidth*this.scale,r=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(t,i,n,r),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(t,i,n,r),this.ctx.fillStyle="#ffffff";let a=8;[[t,i],[t+n-a,i],[t,i+r-a],[t+n-a,i+r-a]].forEach(([o,d])=>{var l;(l=this.ctx)==null||l.fillRect(o,d,a,a)})}updatePreview(){if(!this.modal||!this.image)return;let t=this.modal.querySelector(".asset-crop-preview-canvas");if(!t)return;let i=t.getContext("2d");if(!i)return;let n=150;t.width=n,t.height=n;let r=n/this.cropWidth,a=n/this.cropHeight,s=Math.min(r,a),o=this.cropWidth*s,d=this.cropHeight*s,l=(n-o)/2,c=(n-d)/2;i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,l,c,o,d)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let t=this.modal.querySelector(".asset-crop-zoom-slider");t==null||t.addEventListener("input",n=>{let r=parseFloat(n.target.value);this.setZoom(r)});let i=this.modal.querySelector(".asset-crop-aspect-select");i==null||i.addEventListener("change",n=>{let r=n.target.value;this.setAspectRatio(r)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(t){this.isDragging=!0,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(t){if(!this.isDragging)return;let i=t.clientX-this.dragStartX,n=t.clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(t){t.preventDefault();let i=t.deltaY>0?.9:1.1;this.setZoom(this.scale*i)}handleTouchStart(t){t.touches.length===1&&(this.isDragging=!0,this.dragStartX=t.touches[0].clientX,this.dragStartY=t.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(t){if(!this.isDragging||t.touches.length!==1)return;t.preventDefault();let i=t.touches[0].clientX-this.dragStartX,n=t.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(t){this.scale=Math.max(.1,Math.min(3,t)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(t){let i;switch(t){case"1:1":i=1;break;case"4:3":i=4/3;break;case"16:9":i=16/9;break;case"3:2":i=3/2;break;default:i=void 0}i&&this.applyAspectRatio(i),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let t=this.modal.querySelector(".asset-crop-zoom-value"),i=this.modal.querySelector(".asset-crop-zoom-slider");t&&(t.textContent=`${this.scale.toFixed(1)}x`),i&&(i.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let t=this.cropWidth*this.scale,i=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-t,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-i,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var r;if(!this.image||!((r=this.options)!=null&&r.onCrop))return;let t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return;t.width=this.cropWidth,t.height=this.cropHeight,i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=t.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let t=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,t!=null&&t.onCancel&&t.onCancel()}};window.openAssetCrop=function(e){new vo().open(e)};ot();var Cn=require("pixi.js");$r();var lv=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",xo=lv;if(typeof window!="undefined")try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);t!=null&&t.buildMode&&(xo=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${xo}`))}}catch{}var _t=class{static async create(t,i,n){var d,l,c,f,u,p,v;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${xo}`);let r=(d=i==null?void 0:i.render)==null?void 0:d.asset;if(!r){console.log(`[ObjectFactory] No asset definition for: ${t}, returning empty container`);let m=new Cn.Container;return this.applyTransform(m,i==null?void 0:i.transform),m}let a=(l=i==null?void 0:i.identity)==null?void 0:l.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${t}, configId: ${a}, type: ${r.type}, path: ${r.path}`);let s=await xt.load(t,r,n,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${t}, rawAsset type: ${(c=s==null?void 0:s.constructor)==null?void 0:c.name}`);let o;if(r.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",t),o=new Cn.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(f=o==null?void 0:o.constructor)==null?void 0:f.name),this.applyTransform(o,i==null?void 0:i.transform);else if(r.type==="json")if(console.log("[ObjectFactory] JSON asset for",t,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((p=s.constructor)==null?void 0:p.name)==="Container"||s instanceof Cn.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let m=[r.path,`/assets/${r.path}`,`assets/${r.path}`,`../assets/${r.path}`],w=!1;for(let g of m)try{let h=await fetch(g);if(h.ok){o=await h.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",g,"type:",(v=o==null?void 0:o.constructor)==null?void 0:v.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};ot();var df=qn(require("lottie-web"),1);qr(Dl);typeof window!="undefined"&&!window.lottie&&(window.lottie=df.default);ga();ot();var wo=ml.version,cv=new Set(["init","boot","view","ready","start","pause","resume","complete","error","engagement","first_interaction","retry","cta_show","cta_click","cta_dismiss","clickout","conversion","session_time","level_time","load_time","level_start","level_complete","level_fail","checkpoint","reward","tutorial_start","tutorial_complete","tutorial_skip","ab_assign","fps","memory","asset_load_start","asset_load_complete"]);gl();var bf={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},yf=Math.random().toString(36).slice(2),Ei=null,wi={...bf},vf="web_embed",Ao={},Ln,_o=!1,kn=!1,In=!1,xf=!1,Lo=1,Wr=0,Kr=!1,it=!1,_i="",Si=Math.floor(window.innerWidth),Ai=Math.floor(window.innerHeight),Co=Si>Ai,nt=!1,On=!1,uf=!1,pf=!1,Eo=!1,Yr=null,$t=null,To=!1,ko=!1,Gr=new Map;function wf(){if(!$t)return null;let e=Date.now()-$t;return!Number.isFinite(e)||e<0?null:e}function So(e){if(To)return;let t=wf();t!==null&&(To=!0,L("session_time",{duration_ms:t,reason:e}))}function ff(){if(Ei)return Ei;let e=document.createElement("div");return e.id="handler-root",e.setAttribute("data-handler-root","true"),document.body.appendChild(e),Ei=e,e}function Vr(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function _f(e,t){return{event_name:e,ts:Date.now(),session_id:yf,deployment_id:wi.deployment_id,variant_id:wi.variant_id,export_profile_id:wi.profile_id,instance_id:wi.instance_id||"default",env:vf==="mraid"?"mraid":"web",attribution:Ln,payload:t}}function L(e,t){let i=Vr(e),n=_f(i,t);da(n,!!Ao.analytics),Wn(i,n),i!==e&&Wn(e,n)}function Mn(){Yr&&(Yr(Si,Ai),Yr=null)}function Ci(e){Lo=e,L("volume",e)}function Ti(e){e&&(xf=!0),!In&&(In=!0,L("pause"),Ci(0))}function Rn(e){!e&&xf||In&&(In=!1,L("resume"),Ci(Lo))}function Et(e,t){Si=Math.floor(e||window.innerWidth),Ai=Math.floor(t||window.innerHeight),Co=Si>Ai,L("resize",{width:Si,height:Ai})}function dv(){if(kl())try{let e=mraid.getMaxSize();Et(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?Rn():Ti()};if(mraid.addEventListener("viewableChange",t),mraid.addEventListener("stateChange",t),mraid.addEventListener("sizeChange",()=>{let i=mraid.getMaxSize();Et(i.width,i.height)}),mraid.getAudioVolume){let i=mraid.getAudioVolume();Ci(i?1:0)}if(mraid.addEventListener("audioVolumeChange",i=>{i!==null&&Ci(i>0?1:0)}),mraid.addEventListener("error",(i,n)=>{console.warn("mraid error:",i,"action:",n)}),Kr=!0,mraid.isViewable()&&mraid.getState()!=="hidden")nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn();else{let i=()=>{nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn()};mraid.addEventListener("ready",i)}}catch(e){console.warn("MRAID hook skipped",e)}}function uv(){if(Ll())try{let e=dapi.getScreenSize();Et(e.width,e.height),dapi.addEventListener("viewableChange",i=>{i.isViewable?Rn():Ti()}),dapi.addEventListener("adResized",i=>{let n=dapi.getScreenSize();Et(i.width||n.width,i.height||n.height)});let t=dapi.getAudioVolume();if(Ci(t?1:0),dapi.addEventListener("audioVolumeChange",i=>Ci(i?1:0)),Kr=!0,dapi.isViewable())nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn();else{let i=()=>{nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn()};dapi.addEventListener("ready",i)}}catch(e){console.warn("DAPI hook skipped",e)}}function hf(){let e=()=>{nt||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(nt=!0,L("boot"),L("view"),L("ready"),it=!0,Mn(),On&&(On=!1,He.start()))};window.addEventListener("resize",()=>Et()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(Rn(),e()):Ti()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),Kr=!0}function pv(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(uf=!0),!(uf&&t instanceof MouseEvent)&&(Wr+=1,ko||(ko=!0,L("first_interaction",{count:Wr})),L("interaction",Wr))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function gf(e){var n,r,a,s,o,d,l,c,f,u,p,v;let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(n=window.ExitApi)==null||n.exit();return}catch{}if(t==="mraid"&&typeof mraid!="undefined")mraid.open(e||"");else if(t==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Wt())(a=(r=window.TJ_API)==null?void 0:r.click)==null||a.call(r);else if(Ol())(o=(s=window.FbPlayableAd)==null?void 0:s.onCTAClick)==null||o.call(s);else if(Pl())(l=(d=window.ScPlayableAd)==null?void 0:d.onCTAClick)==null||l.call(d);else if(Rl())try{(f=(c=window.smxTracking)==null?void 0:c.redirect)==null||f.call(c)}catch(m){console.warn("Smadex redirect failed",m)}else if(Il()){let m=window.ExitApi;m&&typeof m.exit=="function"?m.exit(e||_i||""):e&&window.open(e)}else Gt()?(u=window.install)==null||u.call(window):Ml()?(p=window.openAppStore)==null||p.call(window):ua()?(v=parent==null?void 0:parent.postMessage)==null||v.call(parent,"download","*"):e&&window.open(e)}function fv(){let e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",t=i=>{if(!i)return;let n=new Image;n.src=i};if(e==="bigabid"){let i=window.BIGABID_BIDTIMEMACROS;if(!i)return;ge("view",()=>t(i.mraid_viewable)),ge("start",()=>t(i.game_viewable)),ge("engagement",()=>t(i.engagement));let n=()=>t(i.complete);ge("complete",n),Gn("engagement",r=>{var a;((a=r==null?void 0:r.payload)==null?void 0:a.count)>3&&n()}),ge("cta_click",()=>t(i.click))}else if(e==="inmobi"){let i=window.INMOBI_DSPMACROS;if(!i)return;ge("view",()=>t(i.Ad_Load_Start)),ge("start",()=>t(i.Ad_Viewable)),ge("engagement",()=>t(i.First_Engagement)),ge("complete",()=>t(i.Gameplay_Complete)),ge("cta_click",()=>t(i.DSP_Click)),ge("start",()=>{[5,10,15,20,25,30].forEach(n=>setTimeout(()=>t(i[`Spent_${n}_Seconds`]),n*1e3))})}}function hv(){if(!Wt())return;let e=window.TJ_API;e&&e.setPlayableAPI&&e.setPlayableAPI({skipAd:()=>{try{He.finish()}catch(t){console.warn("Tapjoy skip failed",t)}}})}function mf(){var t,i,n;let e=window.TJ_API;(t=e==null?void 0:e.objectiveComplete)==null||t.call(e),(i=e==null?void 0:e.playableFinished)==null||i.call(e),(n=e==null?void 0:e.gameplayFinished)==null||n.call(e)}function gv(){Gt()&&(window.mintGameStart=()=>{Rn(!0),Et()},window.mintGameClose=()=>{Ti(!0)})}function mv(){if(!pa())return;let e=window.NUC;!e||!e.trigger||(He.on("cta_click",()=>{var t,i;return(i=(t=e.trigger).convert)==null?void 0:i.call(t,_i)}),He.on("complete",()=>{var t,i;return(i=(t=e.trigger).tryAgain)==null?void 0:i.call(t)}))}var He={init(e={},t){var i;if(vf=e.profile||"web_embed",Ao=e.consent||{},wi={...bf,...e.ids||{}},Ei=e.rootEl||Ei,Ln=void 0,ll((i=e.telemetry)!=null&&i.endpoint?e.telemetry:null),$t=null,To=!1,ko=!1,Gr.clear(),_i=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(Yr=t),L("init"),document.body.oncontextmenu=()=>!1,ff(),yv(Ei),jl(),dv(),uv(),!Kr){if(document.readyState==="complete")hf();else if(!pf){pf=!0;let n=()=>{hf(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}pv(),fv(),hv(),gv(),mv(),console.log(`%c @handler/playable-sdk %c v${wo} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),nt&&!it&&(L("boot"),L("view"),L("ready"),On&&(On=!1,He.start()),it=!0),it=nt},getRoot(){return ff()},get version(){return wo},get maxWidth(){return Si},get maxHeight(){return Ai},get isLandscape(){return Co},get isReady(){return it},get isStarted(){return _o},get isPaused(){return In},get isFinished(){return kn},get volume(){return Lo},get interactions(){return Wr},on(e,t){Gn(Vr(e),t)},off(e,t){ca(Vr(e),t)},start(){var e,t;if(!_o){if(!nt){On=!0;return}if(_o=!0,$t||($t=Date.now()),L("start"),Et(),Gt())Ti(),(e=window.gameReady)==null||e.call(window);else if(Wt()){let i=window.TJ_API;(t=i==null?void 0:i.setPlayableBuild)==null||t.call(i,{orientation:Co?"landscape":"portrait",buildID:wo})}}},finish(){var e,t;kn||(kn=!0,L("complete"),So("complete"),Gt()?(e=window.gameEnd)==null||e.call(window):ua()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):Wt()&&mf())},install(e){if(!kn){kn=!0,Wt()?(mf(),setTimeout(()=>He.install(e),300)):(L("complete"),setTimeout(()=>He.install(e),0));return}Eo||(Eo=!0,setTimeout(()=>Eo=!1,500),L("cta_click"),L("conversion"),So("cta"),gf(e||_i))},emit(e,t){let i=Vr(e);if(!cv.has(i)&&i!=="resize"&&i!=="volume"&&!i.startsWith("custom."))throw new Error(`Event ${e} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let n=_f(i,t);da(n,!!Ao.analytics),Wn(i,n)},gameStart(){He.start()},gameEnd(){He.finish()},ctaClick(e,t){L("cta_click",{url:e||_i,manual:!0}),(t==null?void 0:t.open)!==!1&&gf(e||_i)},ctaShow(e){L("cta_show",e)},ctaDismiss(e){L("cta_dismiss",e)},getGameTimeMs(){return wf()},endSession(e="manual"){So(e)},setAttribution(e){Ln=e},abTest(e,t){if(!e)throw new Error("abTest requires experimentId");if(!Array.isArray(t)||t.length<2)throw new Error("abTest requires at least 2 variants");let i=Math.abs(bv(`${yf}:${e}`))%t.length,n=t[i];return Ln={...Ln||{},experiment_id:e},wi.variant_id=n,L("ab_assign",{experiment_id:e,variant_id:n}),n},levelStart(e,t){$t||($t=Date.now()),L("level_start",{level_id:e,...t})},levelComplete(e,t){L("level_complete",{level_id:e,...t})},levelFail(e,t){L("level_fail",{level_id:e,...t})},checkpoint(e,t){L("checkpoint",{checkpoint_id:e,...t})},reward(e,t){L("reward",{reward_id:e,...t})},tutorialStart(e,t){L("tutorial_start",{step_id:e,...t})},tutorialComplete(e,t){L("tutorial_complete",{step_id:e,...t})},tutorialSkip(e,t){L("tutorial_skip",{step_id:e,...t})},timerStart(e){e&&Gr.set(e,Date.now())},timerEnd(e,t="custom",i){if(!e)return;let n=Gr.get(e);if(!n)return;Gr.delete(e);let r=Date.now()-n;if(!(!Number.isFinite(r)||r<0)){if(t==="custom"){L("engagement",{action:"timer",key:e,duration_ms:r,...i});return}L(t,{key:e,duration_ms:r,...i})}},fps(e,t){L("fps",{value:e,...t})},memory(e,t){L("memory",{bytes:e,...t})},assetLoadStart(e,t){L("asset_load_start",{asset_id:e,...t})},assetLoadComplete(e,t){L("asset_load_complete",{asset_id:e,...t})},reportError(e,t,i){L("error",{code:e,message:t,...i})},retry(){var e,t,i;if(Gt())(e=window.gameRetry)==null||e.call(window);else if(pa()){let n=window.NUC;(i=(t=n==null?void 0:n.trigger)==null?void 0:t.tryAgain)==null||i.call(t)}L("engagement",{action:"retry"})},pause(){Ti(!0)},resume(){Rn(!0)},resize(e,t){Et(e,t)}},Tn=He;function bv(e){let t=2166136261;for(let i=0;i<e.length;i++)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return t|0}function yv(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
|
|
231
231
|
(function(){
|
|
232
232
|
var events = ['touchstart','touchend','mousedown','keydown'];
|
|
233
233
|
function unlock(){
|
|
@@ -243,7 +243,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
243
243
|
}
|
|
244
244
|
events.forEach(function(e){ document.addEventListener(e, unlock, false); });
|
|
245
245
|
})();
|
|
246
|
-
`,e.appendChild(t)}async function Xr(e,t={}){let i=new _f.Application;await i.init({resizeTo:e,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let n=s=>{var f,u,p,v;if(!i.renderer)return;let o=(f=s==null?void 0:s.width)!=null?f:e.clientWidth,d=(u=s==null?void 0:s.height)!=null?u:e.clientHeight,l=o&&o>0?o:(p=window.innerWidth)!=null?p:320,c=d&&d>0?d:(v=window.innerHeight)!=null?v:480;i.renderer.resize(l,c)};e.innerHTML="",e.style.position="relative",e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="stretch",e.style.width="100%",e.style.height="100dvh",e.style.minHeight="100vh",e.style.maxWidth="100%",e.style.maxHeight="100%",e.style.boxSizing="border-box",e.style.overflow="hidden",t.background&&(e.style.background=t.background),e.appendChild(i.canvas),n();let r=document.createElement("div");return r.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","justify-content:flex-start","gap:12px","pointer-events:none","font-family:Arial,sans-serif","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),e.appendChild(r),Tn.on("pause",()=>{i.ticker.stop(),document.querySelectorAll("audio").forEach(o=>o.pause())}),Tn.on("resume",()=>{i.ticker.start(),document.querySelectorAll("audio").forEach(o=>{o.currentTime>0&&!o.ended&&o.play().catch(()=>{})})}),Tn.on("resize",({payload:s})=>{n({width:s==null?void 0:s.width,height:s==null?void 0:s.height})}),window.addEventListener("resize",()=>n()),requestAnimationFrame(()=>n()),new ResizeObserver(s=>{let o=s[0];if(o&&o.contentRect.width>0&&o.contentRect.height>0){let d=Math.round(o.contentRect.width),l=Math.round(o.contentRect.height);if(n({width:d,height:l}),typeof window!="undefined"&&window.gameApp&&window.gameObjectManager){let c={width:d,height:l,dpr:Math.max(1,Math.floor(window.devicePixelRatio||1)),presetId:"auto-resize",isLandscape:d>l};window.dispatchEvent(new CustomEvent("handler-preview:screen",{detail:c}))}}}).observe(e),{app:i,stage:i.stage,overlay:r,applySize:n}}var pe=require("pixi.js"),Pn=class{constructor(t){var r,a;let i=t==null?void 0:t.position,n=t==null?void 0:t.offset;this._basePosition={x:typeof(i==null?void 0:i.x)=="number"?i.x:0,y:typeof(i==null?void 0:i.y)=="number"?i.y:0},this._offset={x:typeof(n==null?void 0:n.x)=="number"?n.x:0,y:typeof(n==null?void 0:n.y)=="number"?n.y:0},this.position={x:this._basePosition.x+this._offset.x,y:this._basePosition.y+this._offset.y},this.scale=(r=t==null?void 0:t.scale)!=null?r:1,this.rotation=(a=t==null?void 0:t.rotation)!=null?a:0}update(t){let i=t.position,n=t.offset;i!==void 0&&(this._basePosition={x:typeof(i==null?void 0:i.x)=="number"?i.x:0,y:typeof(i==null?void 0:i.y)=="number"?i.y:0}),n!==void 0&&(this._offset={x:typeof(n==null?void 0:n.x)=="number"?n.x:0,y:typeof(n==null?void 0:n.y)=="number"?n.y:0}),(i!==void 0||n!==void 0)&&(this.position={x:this._basePosition.x+this._offset.x,y:this._basePosition.y+this._offset.y}),t.scale!==void 0&&(this.scale=t.scale),t.rotation!==void 0&&(this.rotation=t.rotation)}syncToPixi(t){t&&(t.position.set(this.position.x,this.position.y),t.scale.set(this.scale),t.rotation=this.rotation)}},jn=class{constructor(t){var i,n,r,a;this.z_index=(i=t==null?void 0:t.z_index)!=null?i:0,this.alpha=(n=t==null?void 0:t.alpha)!=null?n:1,this.visible=(r=t==null?void 0:t.visible)!=null?r:!0,this.tint=(a=t==null?void 0:t.tint)!=null?a:null}update(t){t.z_index!==void 0&&(this.z_index=t.z_index),t.alpha!==void 0&&(this.alpha=t.alpha),t.visible!==void 0&&(this.visible=t.visible),t.tint!==void 0&&(this.tint=t.tint)}syncToPixi(t,i){if(!t)return;if(t.zIndex=this.z_index,i!=null&&i.startsWith("ui_endgame_")||(t.alpha=this.alpha),t.visible=this.visible,this.tint!==null&&"tint"in t&&(t.tint=this.tint),i&&"texture"in t)try{let{AssetTextures:r}=require("handler-playable-sdk/pixi");if(r&&r[i]){let a=r[i];a&&(t.texture=a)}}catch{}}},Dn=class{constructor(t,i,n,r){this._tickerCleanup=null;this.onRebuildRequired=null;this.instanceId=t,this.objectConfig=i,this.pixiObject=n,this._config=r,this.transform=new Pn(r.transform),this.renderer=new jn(r.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject,this.instanceId),this.applyAnchor(),this.applyEffectsScale(),this.applyEffects(),this.syncTextProperties(),(!this._initialized||this._shouldReplayIntro)&&(this.applyIntro(),this._initialized=!0,this._shouldReplayIntro=!1),this.applyMotion()}syncTextProperties(){var i;if(!this.pixiObject||!("text"in this.pixiObject))return;let t=(i=this._config)==null?void 0:i.ui;t&&(t.text!==void 0&&this.pixiObject.text!==t.text&&(this.pixiObject.text=t.text),this.pixiObject.style&&(t.fontSize!==void 0&&(this.pixiObject.style.fontSize=t.fontSize),t.color!==void 0&&(this.pixiObject.style.fill=t.color),t.align!==void 0&&(this.pixiObject.style.align=t.align)))}destroy(){this._tickerCleanup&&(this._tickerCleanup(),this._tickerCleanup=null),this._introTicker&&(pe.Ticker.shared.remove(this._introTicker),this._introTicker=null),this.pixiObject&&this.pixiObject.parent&&this.pixiObject.parent.removeChild(this.pixiObject)}updateConfig(t){var d,l,c,f,u,p,v,m,w,g,h;let i=(l=(d=this._config)==null?void 0:d.motion)==null?void 0:l.intro,n=(c=t==null?void 0:t.motion)==null?void 0:c.intro;n!=null&&n.enabled&&JSON.stringify(i)!==JSON.stringify(n)&&(this._shouldReplayIntro=!0);let r=(p=(u=(f=this._config)==null?void 0:f.render)==null?void 0:u.asset)==null?void 0:p.type,a=(m=(v=t==null?void 0:t.render)==null?void 0:v.asset)==null?void 0:m.type,s=(g=(w=this._config)==null?void 0:w.ui)==null?void 0:g.renderMode,o=(h=t==null?void 0:t.ui)==null?void 0:h.renderMode;if((r!==a||s!==o)&&(console.log(`[GameObject] Rebuild required for ${this.instanceId}: type changed from ${r}/${s} to ${a}/${o}`),this.onRebuildRequired)){this.onRebuildRequired(this,t);return}this._config=t,t.transform&&this.transform.update(t.transform),t.render&&this.renderer.update(t.render),this.sync()}applyAnchor(){var r,a,s,o;if(!this.pixiObject||!("anchor"in this.pixiObject)||!this.pixiObject.anchor)return;let t=(a=(r=this._config)==null?void 0:r.render)==null?void 0:a.anchor,i=(o=(s=this._config)==null?void 0:s.transform)==null?void 0:o.anchor,n=t&&typeof t=="object"?t:i&&typeof i=="object"?i:null;n&&typeof n.x=="number"&&typeof n.y=="number"&&this.pixiObject.anchor.set(n.x,n.y)}applyEffectsScale(){var a,s,o;if(!((a=this.pixiObject)!=null&&a.scale))return;let t=(s=this._config)==null?void 0:s.effects,i=typeof(t==null?void 0:t.scale_x)=="number"?t.scale_x:1,n=typeof(t==null?void 0:t.scale_y)=="number"?t.scale_y:1;if(i===1&&n===1)return;let r=(o=this.transform.scale)!=null?o:1;typeof this.pixiObject.scale.set=="function"?this.pixiObject.scale.set(r*i,r*n):(this.pixiObject.scale.x=r*i,this.pixiObject.scale.y=r*n)}applyEffects(){var n,r,a,s,o,d,l,c,f;if(!this.pixiObject)return;let t=(n=this._config)==null?void 0:n.effects;if(!t||t.enabled===!1){this.pixiObject.filters=null;return}let i=[];if((r=t.blur)!=null&&r.enabled){let u=new pe.BlurFilter;u.blur=(a=t.blur.strength)!=null?a:4,i.push(u)}if((s=t.shadow)!=null&&s.enabled){let u=t.shadow,p=new pe.BlurFilter;p.blur=(o=u.blur)!=null?o:4,p.blendMode="multiply",i.push(p),(u.offsetX!==0||u.offsetY!==0)&&console.warn("[Effects] Drop shadow offset requires pixi-filters. Install: npm install pixi-filters")}if((d=t.glow)!=null&&d.enabled){let u=t.glow,p=new pe.BlurFilter;if(p.blur=(l=u.blur)!=null?l:8,i.push(p),u.color){let v=new pe.ColorMatrixFilter,m=typeof u.color=="string"?parseInt(u.color.replace("#",""),16):u.color;v.tint(m),i.push(v)}}(c=t.stroke)!=null&&c.enabled&&console.warn("[Effects] Stroke/outline effect requires pixi-filters. Install: npm install pixi-filters"),(f=t.distortion)!=null&&f.enabled&&console.warn("[Effects] Distortion effect requires pixi-filters or a displacement map. Install: npm install pixi-filters"),this.pixiObject.filters=i.length>0?i:null}applyIntro(){var c,f,u,p,v,m,w;let t=(c=this._config)==null?void 0:c.motion;if(!t||!((f=t.intro)!=null&&f.enabled)||!this.pixiObject)return;let i=t.intro,n=(i.duration||0)/1e3,r=(i.delay||0)/1e3,a=this.transform.position.y,s=this.transform.scale*(((p=(u=this._config)==null?void 0:u.effects)==null?void 0:p.scale_x)||1),o=this.transform.scale*(((m=(v=this._config)==null?void 0:v.effects)==null?void 0:m.scale_y)||1);if(this.pixiObject.alpha=(w=i.startAlpha)!=null?w:0,i.startScale!==void 0&&this.pixiObject.scale.set(s*i.startScale,o*i.startScale),i.startYOffset!==void 0&&(this.pixiObject.y=a+(i.startYOffset||0)),this._introTicker&&pe.Ticker.shared.remove(this._introTicker),n<=0&&r<=0){this.pixiObject.alpha=this.renderer.alpha,this.pixiObject.y=this.transform.position.y,this.pixiObject.scale.set(s,o);return}let d=0,l=g=>{var T,M,_,O,k,I;if(d+=g.deltaTime/60,d<r)return;let h=n>0?Math.min(1,(d-r)/n):1,x=1-Math.pow(1-h,3),y=this.renderer.alpha,b=this.transform.scale*(((M=(T=this._config)==null?void 0:T.effects)==null?void 0:M.scale_x)||1),C=this.transform.scale*(((O=(_=this._config)==null?void 0:_.effects)==null?void 0:O.scale_y)||1),S=this.transform.position.y,A=this.transform.position.x;if(this.pixiObject.alpha=((k=i.startAlpha)!=null?k:0)+(y-((I=i.startAlpha)!=null?I:0))*x,i.startScale!==void 0){let D=i.startScale+(1-i.startScale)*x;this.pixiObject.scale.set(b*D,C*D)}i.startYOffset!==void 0&&(this.pixiObject.y=S+i.startYOffset+(S-(S+i.startYOffset))*x),h>=1&&(pe.Ticker.shared.remove(l),this._introTicker=null,this.pixiObject.alpha=y,this.pixiObject.x=A,this.pixiObject.y=S,this.pixiObject.scale.set(b,C))};this._introTicker=l,pe.Ticker.shared.add(l)}applyMotion(){var r,a,s;let t=(r=this._config)==null?void 0:r.motion,i=t&&t.enabled!==!1,n=JSON.stringify(t);if(!(this._lastMotionStr===n&&this._tickerCleanup)){if(this._lastMotionStr=n,!i){this._tickerCleanup&&(this._tickerCleanup(),this._tickerCleanup=null);return}if(this._tickerCleanup&&this._tickerCleanup(),(a=t.pulse)!=null&&a.enabled||(s=t.swing)!=null&&s.enabled){let o=0,d=l=>{var m,w,g,h,x,y,b,C,S,A,T;o+=l.deltaTime*.05;let c=this.transform.scale,f=c*(((w=(m=this._config)==null?void 0:m.effects)==null?void 0:w.scale_x)||1),u=c*(((h=(g=this._config)==null?void 0:g.effects)==null?void 0:h.scale_y)||1),p=this.transform.position.x,v=this.transform.position.y;if((x=t.pulse)!=null&&x.enabled){let M=(y=t.pulse.intensity)!=null?y:.1,_=(b=t.pulse.speed)!=null?b:1,k=1+Math.sin(o*_)*M;(C=this.pixiObject.scale)!=null&&C.set?this.pixiObject.scale.set(f*k,u*k):this.pixiObject.scale&&(this.pixiObject.scale.x=f*k,this.pixiObject.scale.y=u*k)}if((S=t.swing)!=null&&S.enabled){let M=(A=t.swing.amplitude)!=null?A:10,_=(T=t.swing.speed)!=null?T:1,O=Math.sin(o*_)*M;t.swing.axis==="vertical"?this.pixiObject.y=v+O:t.swing.axis==="both"?(this.pixiObject.x=p+O,this.pixiObject.y=v+O):this.pixiObject.x=p+O}};pe.Ticker.shared.add(d),this._tickerCleanup=()=>{var l,c,f,u,p;if(pe.Ticker.shared.remove(d),this.pixiObject){let v=this.transform.scale*(((c=(l=this._config)==null?void 0:l.effects)==null?void 0:c.scale_x)||1),m=this.transform.scale*(((u=(f=this._config)==null?void 0:f.effects)==null?void 0:u.scale_y)||1);this.pixiObject.x=this.transform.position.x,this.pixiObject.y=this.transform.position.y,(p=this.pixiObject.scale)!=null&&p.set?this.pixiObject.scale.set(v,m):this.pixiObject.scale&&(this.pixiObject.scale.x=v,this.pixiObject.scale.y=m)}}}}}getComponent(t){return this._config[t]}getPosition(){return{...this.transform.position}}setPosition(t,i){this.transform.position={x:t,y:i},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToPixi(this.pixiObject)}},ki=class{constructor(t){this.objects=new Map;this.onObjectRebuildRequired=null;this.config=t}create(t,i){let n=this.config.objects.get(t);if(!n)throw new Error(`Object config not found: ${t}`);let r=new Dn(t,n.object_config||t,i,n);return this.objects.set(t,r),r.onRebuildRequired=async(a,s)=>{if(this.onObjectRebuildRequired){console.log(`[GameObjectManager] Triggering rebuild for ${t}`);let o=await this.onObjectRebuildRequired(t,s);o&&this.objects.get(t)===o&&console.log(`[GameObjectManager] \u2705 Rebuilt ${t} successfully`)}else console.warn(`[GameObjectManager] Rebuild required for ${t} but no factory provided`),a.updateConfig(s)},r}get(t){return this.objects.get(t)}updateConfig(t){this.config=t;for(let[i,n]of this.objects.entries()){let r=t.objects.get(i);r&&n.updateConfig(r)}}getAll(){return Array.from(this.objects.values())}remove(t){let i=this.objects.get(t);i&&i.destroy(),this.objects.delete(t)}clear(){for(let t of this.objects.values())t.destroy();this.objects.clear()}};var Zr={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function Ef(e){let t=Zr[e];return t?t.family:(console.warn(`Font ID "${e}" not found in registry, using fallback`),"Arial, sans-serif")}function Sf(e){var i;let t=Zr[e];return t&&(i=t.weight)!=null?i:"400"}function Af(e,t){Zr[e]=t}function Cf(){return Object.keys(Zr)}var Li=null;function bv(){return console.log("[LottieOverlay] getLottie called, lottieLib cached?",!!Li),console.log("[LottieOverlay] window.lottie exists?",typeof window!="undefined"&&!!window.lottie),Li||(typeof window!="undefined"&&window.lottie?(Li=window.lottie,console.log("[LottieOverlay] \u2705 Found window.lottie, cached it")):(console.warn("[LottieOverlay] \u274C lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),console.log("[LottieOverlay] window keys:",typeof window!="undefined"?Object.keys(window).filter(e=>e.toLowerCase().includes("lottie")):"no window"),Li=null)),Li}function yv(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e.replace(/^\.\//,"")}`}function vv(e){try{let t=new XMLHttpRequest;return t.open("GET",yv(e),!1),t.send(null),t.status<200||t.status>=300||!t.responseText?null:JSON.parse(t.responseText)}catch{return null}}function Tf(e){return!e||typeof e!="object"||!Array.isArray(e.layers)?null:(Array.isArray(e.assets)||(e.assets=[]),Array.isArray(e.chars)||(e.chars=[]),e)}function qr(e){Li=e}function kf(e,t,i,n){var C,S,A,T,M,_,O,k,I,D,z,ne,he,Pi,ji,Di,zi,Ni,Bi;let r=i.objects.get(e);if(!r)return console.warn(`[LottieOverlay] Object config not found: ${e}`),null;let a=((C=r.effects)==null?void 0:C.lottie)||{},s=r.transform||{},o=r.render||{};if(a.enabled===!1||o.visible===!1)return null;let d=n==null?void 0:n[e],l=Tf(d);if(!l){let Oe=(A=(S=r.render)==null?void 0:S.asset)==null?void 0:A.path;if(typeof Oe=="string"&&Oe.toLowerCase().endsWith(".json")){let Fn=vv(Oe);if(l=Tf(Fn),l)try{n[e]=l}catch{}}}if(!l){let Oe=d&&typeof d=="object"?Object.prototype.toString.call(d):typeof d;return console.warn(`[LottieOverlay] Lottie JSON invalid for: ${e}`,{kind:Oe}),null}let c=bv();if(!c)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${e}`),null;let f=(T=a.width)!=null?T:300,u=(M=a.height)!=null?M:300,p=(_=s.scale)!=null?_:1,v=((k=(O=s.position)==null?void 0:O.x)!=null?k:0)+((D=(I=s.offset)==null?void 0:I.x)!=null?D:0),m=((ne=(z=s.position)==null?void 0:z.y)!=null?ne:0)+((Pi=(he=s.offset)==null?void 0:he.y)!=null?Pi:0),w=(ji=s.rotation)!=null?ji:0,g=(Di=o.z_index)!=null?Di:100,h=(zi=o.alpha)!=null?zi:1,x=document.createElement("div");x.style.cssText=`
|
|
246
|
+
`,e.appendChild(t)}async function Xr(e,t={}){let i=new Ef.Application;await i.init({resizeTo:e,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let n=s=>{var f,u,p,v;if(!i.renderer)return;let o=(f=s==null?void 0:s.width)!=null?f:e.clientWidth,d=(u=s==null?void 0:s.height)!=null?u:e.clientHeight,l=o&&o>0?o:(p=window.innerWidth)!=null?p:320,c=d&&d>0?d:(v=window.innerHeight)!=null?v:480;i.renderer.resize(l,c)};e.innerHTML="",e.style.position="relative",e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="stretch",e.style.width="100%",e.style.height="100dvh",e.style.minHeight="100vh",e.style.maxWidth="100%",e.style.maxHeight="100%",e.style.boxSizing="border-box",e.style.overflow="hidden",t.background&&(e.style.background=t.background),e.appendChild(i.canvas),n();let r=document.createElement("div");return r.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","justify-content:flex-start","gap:12px","pointer-events:none","font-family:Arial,sans-serif","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),e.appendChild(r),Tn.on("pause",()=>{i.ticker.stop(),document.querySelectorAll("audio").forEach(o=>o.pause())}),Tn.on("resume",()=>{i.ticker.start(),document.querySelectorAll("audio").forEach(o=>{o.currentTime>0&&!o.ended&&o.play().catch(()=>{})})}),Tn.on("resize",({payload:s})=>{n({width:s==null?void 0:s.width,height:s==null?void 0:s.height})}),window.addEventListener("resize",()=>n()),requestAnimationFrame(()=>n()),new ResizeObserver(s=>{let o=s[0];if(o&&o.contentRect.width>0&&o.contentRect.height>0){let d=Math.round(o.contentRect.width),l=Math.round(o.contentRect.height);if(n({width:d,height:l}),typeof window!="undefined"&&window.gameApp&&window.gameObjectManager){let c={width:d,height:l,dpr:Math.max(1,Math.floor(window.devicePixelRatio||1)),presetId:"auto-resize",isLandscape:d>l};window.dispatchEvent(new CustomEvent("handler-preview:screen",{detail:c}))}}}).observe(e),{app:i,stage:i.stage,overlay:r,applySize:n}}var pe=require("pixi.js"),Pn=class{constructor(t){var r,a;let i=t==null?void 0:t.position,n=t==null?void 0:t.offset;this._basePosition={x:typeof(i==null?void 0:i.x)=="number"?i.x:0,y:typeof(i==null?void 0:i.y)=="number"?i.y:0},this._offset={x:typeof(n==null?void 0:n.x)=="number"?n.x:0,y:typeof(n==null?void 0:n.y)=="number"?n.y:0},this.position={x:this._basePosition.x+this._offset.x,y:this._basePosition.y+this._offset.y},this.scale=(r=t==null?void 0:t.scale)!=null?r:1,this.rotation=(a=t==null?void 0:t.rotation)!=null?a:0}update(t){let i=t.position,n=t.offset;i!==void 0&&(this._basePosition={x:typeof(i==null?void 0:i.x)=="number"?i.x:0,y:typeof(i==null?void 0:i.y)=="number"?i.y:0}),n!==void 0&&(this._offset={x:typeof(n==null?void 0:n.x)=="number"?n.x:0,y:typeof(n==null?void 0:n.y)=="number"?n.y:0}),(i!==void 0||n!==void 0)&&(this.position={x:this._basePosition.x+this._offset.x,y:this._basePosition.y+this._offset.y}),t.scale!==void 0&&(this.scale=t.scale),t.rotation!==void 0&&(this.rotation=t.rotation)}syncToPixi(t){t&&(t.position.set(this.position.x,this.position.y),t.scale.set(this.scale),t.rotation=this.rotation)}},jn=class{constructor(t){var i,n,r,a;this.z_index=(i=t==null?void 0:t.z_index)!=null?i:0,this.alpha=(n=t==null?void 0:t.alpha)!=null?n:1,this.visible=(r=t==null?void 0:t.visible)!=null?r:!0,this.tint=(a=t==null?void 0:t.tint)!=null?a:null}update(t){t.z_index!==void 0&&(this.z_index=t.z_index),t.alpha!==void 0&&(this.alpha=t.alpha),t.visible!==void 0&&(this.visible=t.visible),t.tint!==void 0&&(this.tint=t.tint)}syncToPixi(t,i){if(!t)return;if(t.zIndex=this.z_index,i!=null&&i.startsWith("ui_endgame_")||(t.alpha=this.alpha),t.visible=this.visible,this.tint!==null&&"tint"in t&&(t.tint=this.tint),i&&"texture"in t)try{let{AssetTextures:r}=require("handler-playable-sdk/pixi");if(r&&r[i]){let a=r[i];a&&(t.texture=a)}}catch{}}},Dn=class{constructor(t,i,n,r){this._tickerCleanup=null;this.onRebuildRequired=null;this.instanceId=t,this.objectConfig=i,this.pixiObject=n,this._config=r,this.transform=new Pn(r.transform),this.renderer=new jn(r.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject,this.instanceId),this.applyAnchor(),this.applyEffectsScale(),this.applyEffects(),this.syncTextProperties(),(!this._initialized||this._shouldReplayIntro)&&(this.applyIntro(),this._initialized=!0,this._shouldReplayIntro=!1),this.applyMotion()}syncTextProperties(){var i;if(!this.pixiObject||!("text"in this.pixiObject))return;let t=(i=this._config)==null?void 0:i.ui;t&&(t.text!==void 0&&this.pixiObject.text!==t.text&&(this.pixiObject.text=t.text),this.pixiObject.style&&(t.fontSize!==void 0&&(this.pixiObject.style.fontSize=t.fontSize),t.color!==void 0&&(this.pixiObject.style.fill=t.color),t.align!==void 0&&(this.pixiObject.style.align=t.align)))}destroy(){this._tickerCleanup&&(this._tickerCleanup(),this._tickerCleanup=null),this._introTicker&&(pe.Ticker.shared.remove(this._introTicker),this._introTicker=null),this.pixiObject&&this.pixiObject.parent&&this.pixiObject.parent.removeChild(this.pixiObject)}updateConfig(t){var d,l,c,f,u,p,v,m,w,g,h;let i=(l=(d=this._config)==null?void 0:d.motion)==null?void 0:l.intro,n=(c=t==null?void 0:t.motion)==null?void 0:c.intro;n!=null&&n.enabled&&JSON.stringify(i)!==JSON.stringify(n)&&(this._shouldReplayIntro=!0);let r=(p=(u=(f=this._config)==null?void 0:f.render)==null?void 0:u.asset)==null?void 0:p.type,a=(m=(v=t==null?void 0:t.render)==null?void 0:v.asset)==null?void 0:m.type,s=(g=(w=this._config)==null?void 0:w.ui)==null?void 0:g.renderMode,o=(h=t==null?void 0:t.ui)==null?void 0:h.renderMode;if((r!==a||s!==o)&&(console.log(`[GameObject] Rebuild required for ${this.instanceId}: type changed from ${r}/${s} to ${a}/${o}`),this.onRebuildRequired)){this.onRebuildRequired(this,t);return}this._config=t,t.transform&&this.transform.update(t.transform),t.render&&this.renderer.update(t.render),this.sync()}applyAnchor(){var r,a,s,o;if(!this.pixiObject||!("anchor"in this.pixiObject)||!this.pixiObject.anchor)return;let t=(a=(r=this._config)==null?void 0:r.render)==null?void 0:a.anchor,i=(o=(s=this._config)==null?void 0:s.transform)==null?void 0:o.anchor,n=t&&typeof t=="object"?t:i&&typeof i=="object"?i:null;n&&typeof n.x=="number"&&typeof n.y=="number"&&this.pixiObject.anchor.set(n.x,n.y)}applyEffectsScale(){var a,s,o;if(!((a=this.pixiObject)!=null&&a.scale))return;let t=(s=this._config)==null?void 0:s.effects,i=typeof(t==null?void 0:t.scale_x)=="number"?t.scale_x:1,n=typeof(t==null?void 0:t.scale_y)=="number"?t.scale_y:1;if(i===1&&n===1)return;let r=(o=this.transform.scale)!=null?o:1;typeof this.pixiObject.scale.set=="function"?this.pixiObject.scale.set(r*i,r*n):(this.pixiObject.scale.x=r*i,this.pixiObject.scale.y=r*n)}applyEffects(){var n,r,a,s,o,d,l,c,f;if(!this.pixiObject)return;let t=(n=this._config)==null?void 0:n.effects;if(!t||t.enabled===!1){this.pixiObject.filters=null;return}let i=[];if((r=t.blur)!=null&&r.enabled){let u=new pe.BlurFilter;u.blur=(a=t.blur.strength)!=null?a:4,i.push(u)}if((s=t.shadow)!=null&&s.enabled){let u=t.shadow,p=new pe.BlurFilter;p.blur=(o=u.blur)!=null?o:4,p.blendMode="multiply",i.push(p),(u.offsetX!==0||u.offsetY!==0)&&console.warn("[Effects] Drop shadow offset requires pixi-filters. Install: npm install pixi-filters")}if((d=t.glow)!=null&&d.enabled){let u=t.glow,p=new pe.BlurFilter;if(p.blur=(l=u.blur)!=null?l:8,i.push(p),u.color){let v=new pe.ColorMatrixFilter,m=typeof u.color=="string"?parseInt(u.color.replace("#",""),16):u.color;v.tint(m),i.push(v)}}(c=t.stroke)!=null&&c.enabled&&console.warn("[Effects] Stroke/outline effect requires pixi-filters. Install: npm install pixi-filters"),(f=t.distortion)!=null&&f.enabled&&console.warn("[Effects] Distortion effect requires pixi-filters or a displacement map. Install: npm install pixi-filters"),this.pixiObject.filters=i.length>0?i:null}applyIntro(){var c,f,u,p,v,m,w;let t=(c=this._config)==null?void 0:c.motion;if(!t||!((f=t.intro)!=null&&f.enabled)||!this.pixiObject)return;let i=t.intro,n=(i.duration||0)/1e3,r=(i.delay||0)/1e3,a=this.transform.position.y,s=this.transform.scale*(((p=(u=this._config)==null?void 0:u.effects)==null?void 0:p.scale_x)||1),o=this.transform.scale*(((m=(v=this._config)==null?void 0:v.effects)==null?void 0:m.scale_y)||1);if(this.pixiObject.alpha=(w=i.startAlpha)!=null?w:0,i.startScale!==void 0&&this.pixiObject.scale.set(s*i.startScale,o*i.startScale),i.startYOffset!==void 0&&(this.pixiObject.y=a+(i.startYOffset||0)),this._introTicker&&pe.Ticker.shared.remove(this._introTicker),n<=0&&r<=0){this.pixiObject.alpha=this.renderer.alpha,this.pixiObject.y=this.transform.position.y,this.pixiObject.scale.set(s,o);return}let d=0,l=g=>{var T,M,_,O,k,I;if(d+=g.deltaTime/60,d<r)return;let h=n>0?Math.min(1,(d-r)/n):1,x=1-Math.pow(1-h,3),y=this.renderer.alpha,b=this.transform.scale*(((M=(T=this._config)==null?void 0:T.effects)==null?void 0:M.scale_x)||1),C=this.transform.scale*(((O=(_=this._config)==null?void 0:_.effects)==null?void 0:O.scale_y)||1),S=this.transform.position.y,A=this.transform.position.x;if(this.pixiObject.alpha=((k=i.startAlpha)!=null?k:0)+(y-((I=i.startAlpha)!=null?I:0))*x,i.startScale!==void 0){let D=i.startScale+(1-i.startScale)*x;this.pixiObject.scale.set(b*D,C*D)}i.startYOffset!==void 0&&(this.pixiObject.y=S+i.startYOffset+(S-(S+i.startYOffset))*x),h>=1&&(pe.Ticker.shared.remove(l),this._introTicker=null,this.pixiObject.alpha=y,this.pixiObject.x=A,this.pixiObject.y=S,this.pixiObject.scale.set(b,C))};this._introTicker=l,pe.Ticker.shared.add(l)}applyMotion(){var r,a,s;let t=(r=this._config)==null?void 0:r.motion,i=t&&t.enabled!==!1,n=JSON.stringify(t);if(!(this._lastMotionStr===n&&this._tickerCleanup)){if(this._lastMotionStr=n,!i){this._tickerCleanup&&(this._tickerCleanup(),this._tickerCleanup=null);return}if(this._tickerCleanup&&this._tickerCleanup(),(a=t.pulse)!=null&&a.enabled||(s=t.swing)!=null&&s.enabled){let o=0,d=l=>{var m,w,g,h,x,y,b,C,S,A,T;o+=l.deltaTime*.05;let c=this.transform.scale,f=c*(((w=(m=this._config)==null?void 0:m.effects)==null?void 0:w.scale_x)||1),u=c*(((h=(g=this._config)==null?void 0:g.effects)==null?void 0:h.scale_y)||1),p=this.transform.position.x,v=this.transform.position.y;if((x=t.pulse)!=null&&x.enabled){let M=(y=t.pulse.intensity)!=null?y:.1,_=(b=t.pulse.speed)!=null?b:1,k=1+Math.sin(o*_)*M;(C=this.pixiObject.scale)!=null&&C.set?this.pixiObject.scale.set(f*k,u*k):this.pixiObject.scale&&(this.pixiObject.scale.x=f*k,this.pixiObject.scale.y=u*k)}if((S=t.swing)!=null&&S.enabled){let M=(A=t.swing.amplitude)!=null?A:10,_=(T=t.swing.speed)!=null?T:1,O=Math.sin(o*_)*M;t.swing.axis==="vertical"?this.pixiObject.y=v+O:t.swing.axis==="both"?(this.pixiObject.x=p+O,this.pixiObject.y=v+O):this.pixiObject.x=p+O}};pe.Ticker.shared.add(d),this._tickerCleanup=()=>{var l,c,f,u,p;if(pe.Ticker.shared.remove(d),this.pixiObject){let v=this.transform.scale*(((c=(l=this._config)==null?void 0:l.effects)==null?void 0:c.scale_x)||1),m=this.transform.scale*(((u=(f=this._config)==null?void 0:f.effects)==null?void 0:u.scale_y)||1);this.pixiObject.x=this.transform.position.x,this.pixiObject.y=this.transform.position.y,(p=this.pixiObject.scale)!=null&&p.set?this.pixiObject.scale.set(v,m):this.pixiObject.scale&&(this.pixiObject.scale.x=v,this.pixiObject.scale.y=m)}}}}}getComponent(t){return this._config[t]}getPosition(){return{...this.transform.position}}setPosition(t,i){this.transform.position={x:t,y:i},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToPixi(this.pixiObject)}},ki=class{constructor(t){this.objects=new Map;this.onObjectRebuildRequired=null;this.config=t}create(t,i){let n=this.config.objects.get(t);if(!n)throw new Error(`Object config not found: ${t}`);let r=new Dn(t,n.object_config||t,i,n);return this.objects.set(t,r),r.onRebuildRequired=async(a,s)=>{if(this.onObjectRebuildRequired){console.log(`[GameObjectManager] Triggering rebuild for ${t}`);let o=await this.onObjectRebuildRequired(t,s);o&&this.objects.get(t)===o&&console.log(`[GameObjectManager] \u2705 Rebuilt ${t} successfully`)}else console.warn(`[GameObjectManager] Rebuild required for ${t} but no factory provided`),a.updateConfig(s)},r}get(t){return this.objects.get(t)}updateConfig(t){this.config=t;for(let[i,n]of this.objects.entries()){let r=t.objects.get(i);r&&n.updateConfig(r)}}getAll(){return Array.from(this.objects.values())}remove(t){let i=this.objects.get(t);i&&i.destroy(),this.objects.delete(t)}clear(){for(let t of this.objects.values())t.destroy();this.objects.clear()}};var Zr={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function Sf(e){let t=Zr[e];return t?t.family:(console.warn(`Font ID "${e}" not found in registry, using fallback`),"Arial, sans-serif")}function Af(e){var i;let t=Zr[e];return t&&(i=t.weight)!=null?i:"400"}function Cf(e,t){Zr[e]=t}function Tf(){return Object.keys(Zr)}var Li=null;function vv(){return console.log("[LottieOverlay] getLottie called, lottieLib cached?",!!Li),console.log("[LottieOverlay] window.lottie exists?",typeof window!="undefined"&&!!window.lottie),Li||(typeof window!="undefined"&&window.lottie?(Li=window.lottie,console.log("[LottieOverlay] \u2705 Found window.lottie, cached it")):(console.warn("[LottieOverlay] \u274C lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),console.log("[LottieOverlay] window keys:",typeof window!="undefined"?Object.keys(window).filter(e=>e.toLowerCase().includes("lottie")):"no window"),Li=null)),Li}function xv(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e.replace(/^\.\//,"")}`}function wv(e){try{let t=new XMLHttpRequest;return t.open("GET",xv(e),!1),t.send(null),t.status<200||t.status>=300||!t.responseText?null:JSON.parse(t.responseText)}catch{return null}}function kf(e){return!e||typeof e!="object"||!Array.isArray(e.layers)?null:(Array.isArray(e.assets)||(e.assets=[]),Array.isArray(e.chars)||(e.chars=[]),e)}function qr(e){Li=e}function Lf(e,t,i,n){var C,S,A,T,M,_,O,k,I,D,z,ne,he,Pi,ji,Di,zi,Ni,Bi;let r=i.objects.get(e);if(!r)return console.warn(`[LottieOverlay] Object config not found: ${e}`),null;let a=((C=r.effects)==null?void 0:C.lottie)||{},s=r.transform||{},o=r.render||{};if(a.enabled===!1||o.visible===!1)return null;let d=n==null?void 0:n[e],l=kf(d);if(!l){let Oe=(A=(S=r.render)==null?void 0:S.asset)==null?void 0:A.path;if(typeof Oe=="string"&&Oe.toLowerCase().endsWith(".json")){let Fn=wv(Oe);if(l=kf(Fn),l)try{n[e]=l}catch{}}}if(!l){let Oe=d&&typeof d=="object"?Object.prototype.toString.call(d):typeof d;return console.warn(`[LottieOverlay] Lottie JSON invalid for: ${e}`,{kind:Oe}),null}let c=vv();if(!c)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${e}`),null;let f=(T=a.width)!=null?T:300,u=(M=a.height)!=null?M:300,p=(_=s.scale)!=null?_:1,v=((k=(O=s.position)==null?void 0:O.x)!=null?k:0)+((D=(I=s.offset)==null?void 0:I.x)!=null?D:0),m=((ne=(z=s.position)==null?void 0:z.y)!=null?ne:0)+((Pi=(he=s.offset)==null?void 0:he.y)!=null?Pi:0),w=(ji=s.rotation)!=null?ji:0,g=(Di=o.z_index)!=null?Di:100,h=(zi=o.alpha)!=null?zi:1,x=document.createElement("div");x.style.cssText=`
|
|
247
247
|
position: absolute;
|
|
248
248
|
top: calc(50% + ${m}px);
|
|
249
249
|
left: calc(50% + ${v}px);
|
|
@@ -253,4 +253,4 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
253
253
|
pointer-events: none;
|
|
254
254
|
z-index: ${g};
|
|
255
255
|
opacity: ${h};
|
|
256
|
-
`,t.appendChild(x);let y;try{y=c.loadAnimation({container:x,renderer:a.renderer||"svg",loop:(Ni=a.loop)!=null?Ni:!1,autoplay:(Bi=a.autoplay)!=null?Bi:!0,animationData:l})}catch(Oe){return x.parentNode&&x.parentNode.removeChild(x),console.warn(`[LottieOverlay] Failed to start animation: ${e}`,Oe),null}a.speed!==void 0&&y.setSpeed(a.speed);let b=()=>{y.destroy(),x.parentNode&&x.parentNode.removeChild(x)};return a.loop||y.addEventListener("complete",b),{animation:y,cleanup:b}}$r();oo();var Jr=class{constructor(t,i,n){this.systems=[];this.totalTime=0;this.context=null;this.root=t,this.config=i,this.destinationUrl=n}async createApp(t){if(this.context)return{app:this.app,gameObjectManager:this.gameObjectManager};let{app:i,stage:n}=await Xr(this.root,{background:t.background_color,text:t.text_color,primary:t.cta_background,cta_text:t.cta_text});this.app=i,this.stage=n,this.gameObjectManager=new ki(this.config),this.stage.eventMode="passive",this.stage.interactive=!1,this.stage.interactiveChildren=!0,this.stage.sortableChildren=!0,this.context={app:this.app,stage:this.stage,config:this.config,gameObjectManager:this.gameObjectManager,destinationUrl:this.destinationUrl,root:this.root,engine:this};for(let r of this.systems)r.setContext(this.context);return{app:this.app,gameObjectManager:this.gameObjectManager}}async initSystems(){if(!this.context)throw new Error("[GameEngine] createApp() must be called before initSystems()");for(let t of this.systems)t.init&&await t.init()}async init(t){return await this.createApp(t),await this.initSystems(),{app:this.app,gameObjectManager:this.gameObjectManager}}registerSystems(t){this.systems.push(...t)}async start(){for(let t of this.systems)t.onStart&&await t.onStart();this.app.ticker.add(this.update.bind(this)),window.addEventListener("handler-preview:screen",t=>{let{width:i,height:n}=t.detail;this.resize(i,n)})}update(t){let i=t.deltaTime/60;this.totalTime+=i;for(let n of this.systems)n.update&&n.update(i,this.totalTime)}resize(t,i){for(let n of this.systems)n.onResize&&n.onResize(t,i)}updateConfig(t){this.config=t;for(let i of this.systems)i.context.config=t,i.onConfigUpdate&&i.onConfigUpdate(t)}destroy(){for(let t of this.systems)t.onDestroy&&t.onDestroy();this.app.ticker.remove(this.update.bind(this)),this.app.destroy(!0,{children:!0,texture:!1})}getApp(){return this.app}getGameObjectManager(){return this.gameObjectManager}getTotalTime(){return this.totalTime}getSystem(t){let i=this.systems.find(n=>n instanceof t);if(!i)throw new Error(`System ${t.name} not found!`);return i}};var Oi=class{setContext(t){this.context=t}};var Ii=class{constructor(){this.config=null}init(t){this.config=t}get(t){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(t)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(t){return this.config?this.config.objects.has(t):!1}};var Lf=qn(require("pixi.js"),1),Of=Lf;typeof window!="undefined"&&(window.__basePixi=Lf);An();var rt=require("pixi.js");An();var If=e=>e*Math.PI/180;function xv(e,t){var s,o,d,l,c;let i=t.ui;if(!(i!=null&&i.text))return null;let n="#ffffff";(s=t.render)!=null&&s.tint&&(n=t.render.tint);let r=new rt.TextStyle({fontFamily:(o=i.font)!=null?o:"Arial",fontSize:(d=i.fontSize)!=null?d:16,fill:n,align:(l=i.align)!=null?l:"center",letterSpacing:(c=i.letterSpacing)!=null?c:0}),a=new rt.Text({text:i.text,style:r});return a.label=e,a}function Mf(e){var c,f,u,p,v,m,w,g,h,x;let{stage:t,mainContainer:i,activeConfig:n,gameObjectManager:r,allowList:a,denyList:s}=e,o={},d={},l={};i.sortableChildren=!0;for(let[y,b]of n.objects.entries()){if(s!=null&&s.has(y)||a&&!a.has(y)||(b==null?void 0:b.enabled)===!1)continue;let C=(f=(c=b==null?void 0:b.render)==null?void 0:c.asset)==null?void 0:f.path,S=(p=(u=b==null?void 0:b.render)==null?void 0:u.asset)==null?void 0:p.type,A=!!(C&&S==="image"),T=!!((v=b==null?void 0:b.ui)!=null&&v.text),M=T?(m=b==null?void 0:b.ui)==null?void 0:m.renderMode:void 0,_;if(M==="png"&&A?_="png":M==="text"&&T?_="text":A?_="png":T?_="text":_="skip",_!=="skip"){if(_==="text"){let O=xv(y,b);if(!O)continue;let k=b.render;O.alpha=typeof(k==null?void 0:k.alpha)=="number"?k.alpha:1,O.visible=(k==null?void 0:k.visible)!==!1,O.zIndex=typeof(k==null?void 0:k.z_index)=="number"?k.z_index:0,k!=null&&k.anchor&&typeof k.anchor.x=="number"&&typeof k.anchor.y=="number"?O.anchor.set(k.anchor.x,k.anchor.y):O.anchor.set(.5,.5);let I=b.transform,D=(I==null?void 0:I.position)||(I==null?void 0:I.offset);D&&O.position.set((w=D.x)!=null?w:0,(g=D.y)!=null?g:0);let z=typeof(I==null?void 0:I.scale)=="number"?I.scale:1;O.scale.set(z,z);let ne=typeof(I==null?void 0:I.rotation)=="number"?I.rotation:0;O.rotation=If(ne),O.parent||i.addChild(O);try{r.create(y,O)}catch{}o[y]=O,l[y]=O}else if(_==="png"){let O=wt[y]||(typeof rt.Texture!="undefined"?rt.Texture.EMPTY:void 0),k=new rt.Sprite(O);k.label=y;let I=b.render;k.alpha=typeof(I==null?void 0:I.alpha)=="number"?I.alpha:1,k.visible=(I==null?void 0:I.visible)!==!1,k.zIndex=typeof(I==null?void 0:I.z_index)=="number"?I.z_index:0,I!=null&&I.anchor&&typeof I.anchor.x=="number"&&typeof I.anchor.y=="number"&&k.anchor.set(I.anchor.x,I.anchor.y);let D=b.transform,z=(D==null?void 0:D.position)||(D==null?void 0:D.offset);z&&k.position.set((h=z.x)!=null?h:0,(x=z.y)!=null?x:0);let ne=typeof(D==null?void 0:D.scale)=="number"?D.scale:1;k.scale.set(ne,ne);let he=typeof(D==null?void 0:D.rotation)=="number"?D.rotation:0;k.rotation=If(he),k.parent||i.addChild(k);try{r.create(y,k)}catch{}o[y]=k,d[y]=k}}}return i.parent||t.addChild(i),{objects:o,sprites:d,texts:l}}var Oo=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ii}init(t,i){this.registry.init(t),this.app=i}updateConfig(t){this.registry.init(t),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));if(i.length===0)return;let n=async r=>{r.length&&(console.log("[Assets] Loading objects:",r),await Promise.all(r.map(async a=>{var o;let s=this.registry.get(a);if(!s){console.warn("[Assets] No config found for object:",a);return}try{let d=await _t.create(a,s,this.app);this.instanceCache.set(a,d),console.log("[Assets] Loaded object:",a,(o=d==null?void 0:d.constructor)==null?void 0:o.name)}catch(d){console.error("[Assets] Failed to load object:",a,d)}})))};return this.readyPromise=(async()=>{await n(i);let r=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));r.length>0&&(console.warn("[Assets] Retrying missing assets:",r),await n(r)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(t){let i=this.registry.get(t);if(i){let n=await _t.create(t,i,this.app);this.instanceCache.set(t,n)}}get(t){return this.instanceCache.get(t)}},Rf=new Oo,Pf=new Proxy(Rf,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});function jf(e,t){Rf.init(e,t)}An();var Qr=class extends Oi{async init(){Ur(this.context.config,this.context.app),await wt.ready(),console.log("[AssetSystem] All assets preloaded and ready")}async onStart(){}onConfigUpdate(){console.log("[AssetSystem] Config updated - systems will refresh textures")}};var na=require("pixi.js"),at={width:400,height:600,designWidth:400,scaleFactor:1},Nn={scale:1,position:1},ra=[];function wv(e,t,i,n,r,a,s){ra.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function _v(){ra.forEach(({element:e,originalScale:t,positionHelper:i,heightPercent:n})=>{let r=t*at.scaleFactor;i(e,at.width,at.height,n,r,!0,!1)})}function Df(){ra.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function ta(e,t){console.log(`[SCREEN] updateScreenState called: ${e}x${t}`),at.width=e,at.height=t,at.scaleFactor=Math.min(e/at.designWidth,1.15),Nn.scale=at.scaleFactor,Nn.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Nn.scale.toFixed(3)}`),_v()}var G={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Ev(e,t,i){let n=G[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function Sv(){return G}var Av={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function ea(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function Bn(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:ea(e[0],t.x),y:ea(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:ea(n.x,t.x),y:ea(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=Av[n])!=null?i:t}return t}function Mi(e,t,i,n={}){var p,v,m,w,g,h;let r=Bn(i),a=(p=n.inset)!=null?p:{},s=(v=n.padding)!=null?v:{x:0,y:0},o=((m=a.left)!=null?m:0)+s.x,d=((w=a.right)!=null?w:0)+s.x,l=((g=a.top)!=null?g:0)+s.y,c=((h=a.bottom)!=null?h:0)+s.y,f=Math.max(0,e-o-d),u=Math.max(0,t-l-c);return{x:o+f*r.x,y:l+u*r.y}}function Ri(e,t,i,n={}){var m,w,g,h,x,y;let r=(m=n.inset)!=null?m:{},a=(w=n.padding)!=null?w:{x:0,y:0},s=((g=r.left)!=null?g:0)+a.x,o=((h=r.right)!=null?h:0)+a.x,d=((x=r.top)!=null?x:0)+a.y,l=((y=r.bottom)!=null?y:0)+a.y,c=Math.max(0,e-s-o),f=Math.max(0,t-d-l),u=Bn(i,{x:.5,y:.5}),p=Math.min(Math.max(u.x,0),1),v=Math.min(Math.max(u.y,0),1);return{x:s+c*p,y:d+f*v}}function ia(e,t,i,n={}){var c,f,u;if(!e)return;let r=n.positionRatio?Ri(t,i,n.positionRatio,{inset:n.inset,padding:n.screenPadding}):Mi(t,i,n.anchor,{inset:n.inset,padding:n.screenPadding}),a=(c=n.offset)!=null?c:{x:0,y:0},s=r.x+a.x,o=r.y+a.y;e.anchor&&n.renderAnchor&&e.anchor.set(n.renderAnchor.x,n.renderAnchor.y),Le(e,s,o);let d=(f=n.scale)!=null?f:1,l=(u=n.scaleMultiplier)!=null?u:1;(n.scale!==void 0||n.scaleMultiplier!==void 0)&&$e(e,d*l)}if(typeof window!="undefined"){let e=window.innerWidth,t=window.innerHeight,i=()=>{let n=window.innerWidth,r=window.innerHeight;(n!==e||r!==t)&&(e=n,t=r,ta(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),ta(window.innerWidth,window.innerHeight),window.updateDebugConfig=Ev,window.getDebugConfig=Sv,window.copyConfig=Dv,window.applyConfig=zn,window.applyConfigForRatio=zv,window.positionAtBottom=zf,window.positionAtTop=kv,window.positionAtCenter=Lv,window.positionAtLeft=Ov,window.positionAtRight=Iv,window.positionAtBottomLeft=Mv,window.positionAtBottomRight=Rv,window.positionAtTopLeft=Pv,window.positionAtTopRight=jv,window.applyPositionContract=Tv,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function aa(e,t,i=0){return e*t+i}function sa(e,t,i=0){return e*(1-t)+i}function oa(e,t,i=0){return e*t+i}function la(e,t,i=0){return e*(1-t)+i}function we(e,t=0){return e/2+t}function Cv(e,t){return e*t}function Tv(e,t,i,n){var s,o,d,l,c,f,u,p,v,m,w,g,h,x,y,b,C,S,A,T;let r=0,a=0;switch(n.type){case"top":r=we(t,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),a=aa(i,n.percent,(l=(d=n.offset)==null?void 0:d.y)!=null?l:0);break;case"bottom":r=we(t,(f=(c=n.offset)==null?void 0:c.x)!=null?f:0),a=sa(i,n.percent,(p=(u=n.offset)==null?void 0:u.y)!=null?p:0);break;case"left":r=oa(t,n.percent,(m=(v=n.offset)==null?void 0:v.x)!=null?m:0),a=we(i,(g=(w=n.offset)==null?void 0:w.y)!=null?g:0);break;case"right":r=la(t,n.percent,(x=(h=n.offset)==null?void 0:h.x)!=null?x:0),a=we(i,(b=(y=n.offset)==null?void 0:y.y)!=null?b:0);break;case"center":r=we(t,(S=(C=n.offset)==null?void 0:C.x)!=null?S:0),a=we(i,(T=(A=n.offset)==null?void 0:A.y)!=null?T:0);break}e.position?e.position.set(r,a):(e.x=r,e.y=a),n.scale!==void 0&&n.scale!==1&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(n.scale,n.scale):(e.scale.x=n.scale,e.scale.y=n.scale))}function zf(e,t,i,n=.2,r=1,a=!0,s=!1){let o=Cv(i,n),d=sa(i,n/2);Le(e,we(t),d);let l=a?r*at.scaleFactor:r;$e(e,l),s&&!ra.find(c=>c.element===e)&&wv(e,zf,t,i,n,r,a)}function kv(e,t,i,n=.1,r=1){Le(e,we(t),aa(i,n)),$e(e,r)}function Lv(e,t,i,n=0,r=0,a=1){Le(e,we(t,n),we(i,r)),$e(e,a)}function Ov(e,t,i,n=.1,r=1){Le(e,oa(t,n),we(i)),$e(e,r)}function Iv(e,t,i,n=.1,r=1){Le(e,la(t,n),we(i)),$e(e,r)}function Mv(e,t,i,n=.05,r=.05,a=1){Le(e,oa(t,r),sa(i,n)),$e(e,a)}function Rv(e,t,i,n=.05,r=.05,a=1){Le(e,la(t,r),sa(i,n)),$e(e,a)}function Pv(e,t,i,n=.05,r=.05,a=1){Le(e,oa(t,r),aa(i,n)),$e(e,a)}function jv(e,t,i,n=.05,r=.05,a=1){Le(e,la(t,r),aa(i,n)),$e(e,a)}function Le(e,t,i){e&&e.position?typeof e.position.set=="function"?e.position.set(t,i):(e.position.x=t,e.position.y=i):e&&(e.x=t,e.y=i)}function $e(e,t){t!==1&&e&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(t,t):e.scale.x!==void 0&&e.scale.y!==void 0&&(e.scale.x=t,e.scale.y=t))}var Ut={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function Dv(e){return e&&Ut[e]?JSON.parse(JSON.stringify(Ut[e])):JSON.parse(JSON.stringify(G))}function zn(e){Object.keys(e).forEach(t=>{let i=t;G[i]&&e[i]&&Object.assign(G[i],e[i])}),console.log("Config applied:",e)}function zv(e,t){let i=e/t;i>1.6?(zn(Ut.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(zn(Ut.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(zn(Ut.square),console.log("Applied SQUARE config for ratio:",i)):(zn(Ut.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ut,e.resolveAnchorVec2=e.resolveAnchorVec2||Bn,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||Mi,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||Ri}var fe=null;function Nf(e,t,i,n,r,a={}){var ne,he,Pi,ji,Di,zi,Ni,Bi,Oe,Fn,Io,Mo,Ro,Po,jo,Do,zo,No,Bo,Fo,Ho,$o,Uo,qo,Go,Wo,Yo,Vo,Ko,Xo,Zo,Jo,Qo,el,tl,il,nl;let s=(ne=a.enableDebugLogs)!=null?ne:!1;s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:n.width,height:n.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",i),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",a));let{mainContainer:o,label:d,background:l,backgroundTexture:c,app:f}=e;if(!f||!f.renderer){s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:f.renderer.width,height:f.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:f.screen.width,height:f.screen.height}));let u=n.width,p=n.height;s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:u,baseHeight:p});let v=u*G.layout.screen_scale_x,m=p*G.layout.screen_scale_y,w=u/2,g=t.engine.runtime||{},h=g.layout||{};s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:G.layout.screen_scale_x,screen_scale_y:G.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:v,height:m,midX:w}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",g),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",h));let x=h.design_width_portrait||400,y=v/x;y=Math.min(y,1.15);let b=y*((he=G.engine.scale)!=null?he:1),C=(Pi=a.skipMainContainerTransform)!=null?Pi:!1;!C&&o&&o.scale&&(typeof o.scale.set=="function"?o.scale.set(b):(o.scale.x=b,o.scale.y=b));let S=(ji=h.main_container_anchor)!=null?ji:"center",A=(Di=h.main_container_position_ratio)!=null?Di:{x:.5,y:.5},T=(zi=h.main_container_offset)!=null?zi:{x:0,y:0},M=h.main_container_position_ratio?Ri(u,p,A):Mi(u,p,S),_=M.x+T.x+G.layout.position_offset.x,O=M.y+T.y+G.layout.position_offset.y;if(!C&&o&&o.position&&(typeof o.position.set=="function"?o.position.set(_,O):(o.position.x=_,o.position.y=O)),r&&(o!=null&&o.toLocal))for(let[re,ae]of t.objects.entries()){let W=ae==null?void 0:ae.transform;if(!W||((Ni=W.position_mode)!=null?Ni:"static")!=="static")continue;let B=(Bi=r.get)==null?void 0:Bi.call(r,re),Ie=((Oe=B==null?void 0:B.getDisplayObject)==null?void 0:Oe.call(B))||(B==null?void 0:B.pixiObject)||B;if(!Ie||Ie.parent!==o)continue;let Fi=W.position_ratio!=null?Ri(u,p,W.position_ratio):Mi(u,p,(Fn=W.anchor)!=null?Fn:"center"),Hn=o.toLocal(new na.Point(Fi.x,Fi.y)),$n=(Io=W.position)!=null?Io:{x:0,y:0},Hi=Hn.x+$n.x,St=Hn.y+$n.y;typeof(B==null?void 0:B.setPosition)=="function"?B.setPosition(Hi,St):(Le(Ie,Hi,St),(Mo=B==null?void 0:B.transform)!=null&&Mo.position&&(B.transform.position.x=Hi,B.transform.position.y=St))}let k=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,D=((k==null?void 0:k.buildMode)||(typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"dev"))==="dev";if(G.layout.debug_rect_visible&&D){(!fe||fe.parent!==f.stage)&&(fe==null||fe.destroy(),fe=new na.Graphics,fe.zIndex=9999,f.stage.addChild(fe)),fe.clear();let re=G.layout.debug_rect_scale_x,ae=G.layout.debug_rect_scale_y,W=(u-4)*re,_e=(p-4)*ae,B=(u-W)/2,Ie=(p-_e)/2;s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:u,baseHeight:p,rectW:W,rectH:_e,offsetX:B,offsetY:Ie}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+B,y:2+Ie,width:W,height:_e})),fe.rect(2+B,2+Ie,W,_e).stroke({width:G.layout.debug_rect_thickness,color:G.layout.debug_rect_color})}else fe&&(fe.destroy(),fe=null);let z=((Ro=e.label)==null?void 0:Ro.config)||t.objects.get("label_1")||t.objects.get("ui_tutorial_1");if(d&&d.position&&z){let re=(Po=z==null?void 0:z.render)==null?void 0:Po.anchor,ae=(Do=(jo=z==null?void 0:z.transform)==null?void 0:jo.anchor)!=null?Do:"center",W=(zo=z==null?void 0:z.transform)==null?void 0:zo.position_ratio,_e=((No=z==null?void 0:z.transform)==null?void 0:No.offset)||{x:0,y:0};ia(d,u,p,{anchor:ae,positionRatio:W,offset:{x:_e.x*b,y:_e.y*b},renderAnchor:re})}if(d&&d.alpha>0){let re=1+Math.sin(i*G.engine.label_pulse_speed)*G.engine.label_pulse_intensity,ae=(Fo=(Bo=z==null?void 0:z.transform)==null?void 0:Bo.scale)!=null?Fo:1,W=re*b*ae;d.scale&&(typeof d.scale.set=="function"?d.scale.set(W):(d.scale.x=W,d.scale.y=W))}if(s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING ====="),l){s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Ho=l.constructor)==null?void 0:Ho.name)),l.alpha=((Uo=($o=g.background)==null?void 0:$o.alpha)!=null?Uo:.98)*G.engine.background_alpha,s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha);let re=t.objects.get("background_1");s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",re);let ae=(re==null?void 0:re.transform)||{};s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",ae);let W=ae.offset||{x:0,y:0},_e=((Go=(qo=g.background)==null?void 0:qo.offset_y)!=null?Go:0)+G.engine.background_offset_y,B=(Yo=(Wo=re==null?void 0:re.render)==null?void 0:Wo.anchor)!=null?Yo:{x:.5,y:.5},Ie=(Vo=ae.anchor)!=null?Vo:"center",Fi=ae.position_ratio;if(s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:W,bgRuntimeOffsetY:_e,bgRenderAnchor:B,bgScreenAnchor:Ie,bgPositionRatio:Fi,baseWidth:u,baseHeight:p,finalScale:b}),ia(l,u,p,{anchor:Ie,positionRatio:Fi,offset:{x:W.x*b,y:W.y*b+_e},renderAnchor:B}),s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Ko=l.scale)==null?void 0:Ko.x,scaleY:(Xo=l.scale)==null?void 0:Xo.y,anchorX:(Zo=l.anchor)==null?void 0:Zo.x,anchorY:(Jo=l.anchor)==null?void 0:Jo.y,pivotX:(Qo=l.pivot)==null?void 0:Qo.x,pivotY:(el=l.pivot)==null?void 0:el.y,width:l.width,height:l.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background texture dimensions:",{textureWidth:c==null?void 0:c.width,textureHeight:c==null?void 0:c.height})),c){let Hn=Math.max(v/c.width,m/c.height),$n=(il=(tl=g.background)==null?void 0:tl.scale_multiplier)!=null?il:1.05,Hi=(nl=ae.scale)!=null?nl:1,St=Hn*$n*G.engine.background_scale*Hi;l.scale&&(typeof l.scale.set=="function"?l.scale.set(St):(l.scale.x=St,l.scale.y=St))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-v/2,-m/2,v,m).fill({color:1444375}))}}function Bf(e){var o,d,l;let{setState:t,updateLabelAlpha:i,updateHandAlpha:n,config:r,states:a}=e,s=((d=(o=r.engine)==null?void 0:o.runtime)==null?void 0:d.timeline)||{};t(a.showHook),setTimeout(()=>{i(1),n(1),t(a.waitInput),console.log("[GAME] \u23F3 Game ready for user input - tutorial shown")},(l=s.tutorial_delay_ms)!=null?l:1500)}0&&(module.exports={AssetCache,AssetLoader,AssetSystem,AssetTextures,Assets,BaseSystem,GameEngine,GameObject,GameObjectManager,ObjectFactory,Renderer,RuntimeObjectRegistry,Transform,applyScreenAnchor,basePixi,clearResponsiveElements,createPixiBase,getRegisteredFontIds,globalResponsiveMultipliers,initAssetTextures,initAssets,layout,playLottieOverlay,registerFont,registerType,resolveAnchorVec2,resolveFont,resolveFontWeight,resolveScreenAnchorPoint,resolveScreenRatioPoint,runInitSequence,setLottieInstance,spawnSceneFromConfig,updateScreenState});
|
|
256
|
+
`,t.appendChild(x);let y;try{y=c.loadAnimation({container:x,renderer:a.renderer||"svg",loop:(Ni=a.loop)!=null?Ni:!1,autoplay:(Bi=a.autoplay)!=null?Bi:!0,animationData:l})}catch(Oe){return x.parentNode&&x.parentNode.removeChild(x),console.warn(`[LottieOverlay] Failed to start animation: ${e}`,Oe),null}a.speed!==void 0&&y.setSpeed(a.speed);let b=()=>{y.destroy(),x.parentNode&&x.parentNode.removeChild(x)};return a.loop||y.addEventListener("complete",b),{animation:y,cleanup:b}}$r();oo();var Jr=class{constructor(t,i,n){this.systems=[];this.totalTime=0;this.context=null;this.root=t,this.config=i,this.destinationUrl=n}async createApp(t){if(this.context)return{app:this.app,gameObjectManager:this.gameObjectManager};let{app:i,stage:n}=await Xr(this.root,{background:t.background_color,text:t.text_color,primary:t.cta_background,cta_text:t.cta_text});this.app=i,this.stage=n,this.gameObjectManager=new ki(this.config),this.stage.eventMode="passive",this.stage.interactive=!1,this.stage.interactiveChildren=!0,this.stage.sortableChildren=!0,this.context={app:this.app,stage:this.stage,config:this.config,gameObjectManager:this.gameObjectManager,destinationUrl:this.destinationUrl,root:this.root,engine:this};for(let r of this.systems)r.setContext(this.context);return{app:this.app,gameObjectManager:this.gameObjectManager}}async initSystems(){if(!this.context)throw new Error("[GameEngine] createApp() must be called before initSystems()");for(let t of this.systems)t.init&&await t.init()}async init(t){return await this.createApp(t),await this.initSystems(),{app:this.app,gameObjectManager:this.gameObjectManager}}registerSystems(t){this.systems.push(...t)}async start(){for(let t of this.systems)t.onStart&&await t.onStart();this.app.ticker.add(this.update.bind(this)),window.addEventListener("handler-preview:screen",t=>{let{width:i,height:n}=t.detail;this.resize(i,n)})}update(t){let i=t.deltaTime/60;this.totalTime+=i;for(let n of this.systems)n.update&&n.update(i,this.totalTime)}resize(t,i){for(let n of this.systems)n.onResize&&n.onResize(t,i)}updateConfig(t){this.config=t;for(let i of this.systems)i.context.config=t,i.onConfigUpdate&&i.onConfigUpdate(t)}destroy(){for(let t of this.systems)t.onDestroy&&t.onDestroy();this.app.ticker.remove(this.update.bind(this)),this.app.destroy(!0,{children:!0,texture:!1})}getApp(){return this.app}getGameObjectManager(){return this.gameObjectManager}getTotalTime(){return this.totalTime}getSystem(t){let i=this.systems.find(n=>n instanceof t);if(!i)throw new Error(`System ${t.name} not found!`);return i}};var Oi=class{setContext(t){this.context=t}};var Ii=class{constructor(){this.config=null}init(t){this.config=t}get(t){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(t)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(t){return this.config?this.config.objects.has(t):!1}};var Of=qn(require("pixi.js"),1),If=Of;typeof window!="undefined"&&(window.__basePixi=Of);An();var rt=require("pixi.js");An();var Mf=e=>e*Math.PI/180;function _v(e,t){var s,o,d,l,c;let i=t.ui;if(!(i!=null&&i.text))return null;let n="#ffffff";(s=t.render)!=null&&s.tint&&(n=t.render.tint);let r=new rt.TextStyle({fontFamily:(o=i.font)!=null?o:"Arial",fontSize:(d=i.fontSize)!=null?d:16,fill:n,align:(l=i.align)!=null?l:"center",letterSpacing:(c=i.letterSpacing)!=null?c:0}),a=new rt.Text({text:i.text,style:r});return a.label=e,a}function Rf(e){var c,f,u,p,v,m,w,g,h,x;let{stage:t,mainContainer:i,activeConfig:n,gameObjectManager:r,allowList:a,denyList:s}=e,o={},d={},l={};i.sortableChildren=!0;for(let[y,b]of n.objects.entries()){if(s!=null&&s.has(y)||a&&!a.has(y)||(b==null?void 0:b.enabled)===!1)continue;let C=(f=(c=b==null?void 0:b.render)==null?void 0:c.asset)==null?void 0:f.path,S=(p=(u=b==null?void 0:b.render)==null?void 0:u.asset)==null?void 0:p.type,A=!!(C&&S==="image"),T=!!((v=b==null?void 0:b.ui)!=null&&v.text),M=T?(m=b==null?void 0:b.ui)==null?void 0:m.renderMode:void 0,_;if(M==="png"&&A?_="png":M==="text"&&T?_="text":A?_="png":T?_="text":_="skip",_!=="skip"){if(_==="text"){let O=_v(y,b);if(!O)continue;let k=b.render;O.alpha=typeof(k==null?void 0:k.alpha)=="number"?k.alpha:1,O.visible=(k==null?void 0:k.visible)!==!1,O.zIndex=typeof(k==null?void 0:k.z_index)=="number"?k.z_index:0,k!=null&&k.anchor&&typeof k.anchor.x=="number"&&typeof k.anchor.y=="number"?O.anchor.set(k.anchor.x,k.anchor.y):O.anchor.set(.5,.5);let I=b.transform,D=(I==null?void 0:I.position)||(I==null?void 0:I.offset);D&&O.position.set((w=D.x)!=null?w:0,(g=D.y)!=null?g:0);let z=typeof(I==null?void 0:I.scale)=="number"?I.scale:1;O.scale.set(z,z);let ne=typeof(I==null?void 0:I.rotation)=="number"?I.rotation:0;O.rotation=Mf(ne),O.parent||i.addChild(O);try{r.create(y,O)}catch{}o[y]=O,l[y]=O}else if(_==="png"){let O=wt[y]||(typeof rt.Texture!="undefined"?rt.Texture.EMPTY:void 0),k=new rt.Sprite(O);k.label=y;let I=b.render;k.alpha=typeof(I==null?void 0:I.alpha)=="number"?I.alpha:1,k.visible=(I==null?void 0:I.visible)!==!1,k.zIndex=typeof(I==null?void 0:I.z_index)=="number"?I.z_index:0,I!=null&&I.anchor&&typeof I.anchor.x=="number"&&typeof I.anchor.y=="number"&&k.anchor.set(I.anchor.x,I.anchor.y);let D=b.transform,z=(D==null?void 0:D.position)||(D==null?void 0:D.offset);z&&k.position.set((h=z.x)!=null?h:0,(x=z.y)!=null?x:0);let ne=typeof(D==null?void 0:D.scale)=="number"?D.scale:1;k.scale.set(ne,ne);let he=typeof(D==null?void 0:D.rotation)=="number"?D.rotation:0;k.rotation=Mf(he),k.parent||i.addChild(k);try{r.create(y,k)}catch{}o[y]=k,d[y]=k}}}return i.parent||t.addChild(i),{objects:o,sprites:d,texts:l}}var Oo=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ii}init(t,i){this.registry.init(t),this.app=i}updateConfig(t){this.registry.init(t),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));if(i.length===0)return;let n=async r=>{r.length&&(console.log("[Assets] Loading objects:",r),await Promise.all(r.map(async a=>{var o;let s=this.registry.get(a);if(!s){console.warn("[Assets] No config found for object:",a);return}try{let d=await _t.create(a,s,this.app);this.instanceCache.set(a,d),console.log("[Assets] Loaded object:",a,(o=d==null?void 0:d.constructor)==null?void 0:o.name)}catch(d){console.error("[Assets] Failed to load object:",a,d)}})))};return this.readyPromise=(async()=>{await n(i);let r=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));r.length>0&&(console.warn("[Assets] Retrying missing assets:",r),await n(r)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(t){let i=this.registry.get(t);if(i){let n=await _t.create(t,i,this.app);this.instanceCache.set(t,n)}}get(t){return this.instanceCache.get(t)}},Pf=new Oo,jf=new Proxy(Pf,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});function Df(e,t){Pf.init(e,t)}An();var Qr=class extends Oi{async init(){Ur(this.context.config,this.context.app),await wt.ready(),console.log("[AssetSystem] All assets preloaded and ready")}async onStart(){}onConfigUpdate(){console.log("[AssetSystem] Config updated - systems will refresh textures")}};var na=require("pixi.js"),at={width:400,height:600,designWidth:400,scaleFactor:1},Nn={scale:1,position:1},ra=[];function Ev(e,t,i,n,r,a,s){ra.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function Sv(){ra.forEach(({element:e,originalScale:t,positionHelper:i,heightPercent:n})=>{let r=t*at.scaleFactor;i(e,at.width,at.height,n,r,!0,!1)})}function zf(){ra.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function ta(e,t){console.log(`[SCREEN] updateScreenState called: ${e}x${t}`),at.width=e,at.height=t,at.scaleFactor=Math.min(e/at.designWidth,1.15),Nn.scale=at.scaleFactor,Nn.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Nn.scale.toFixed(3)}`),Sv()}var G={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Av(e,t,i){let n=G[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function Cv(){return G}var Tv={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function ea(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function Bn(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:ea(e[0],t.x),y:ea(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:ea(n.x,t.x),y:ea(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=Tv[n])!=null?i:t}return t}function Mi(e,t,i,n={}){var p,v,m,w,g,h;let r=Bn(i),a=(p=n.inset)!=null?p:{},s=(v=n.padding)!=null?v:{x:0,y:0},o=((m=a.left)!=null?m:0)+s.x,d=((w=a.right)!=null?w:0)+s.x,l=((g=a.top)!=null?g:0)+s.y,c=((h=a.bottom)!=null?h:0)+s.y,f=Math.max(0,e-o-d),u=Math.max(0,t-l-c);return{x:o+f*r.x,y:l+u*r.y}}function Ri(e,t,i,n={}){var m,w,g,h,x,y;let r=(m=n.inset)!=null?m:{},a=(w=n.padding)!=null?w:{x:0,y:0},s=((g=r.left)!=null?g:0)+a.x,o=((h=r.right)!=null?h:0)+a.x,d=((x=r.top)!=null?x:0)+a.y,l=((y=r.bottom)!=null?y:0)+a.y,c=Math.max(0,e-s-o),f=Math.max(0,t-d-l),u=Bn(i,{x:.5,y:.5}),p=Math.min(Math.max(u.x,0),1),v=Math.min(Math.max(u.y,0),1);return{x:s+c*p,y:d+f*v}}function ia(e,t,i,n={}){var c,f,u;if(!e)return;let r=n.positionRatio?Ri(t,i,n.positionRatio,{inset:n.inset,padding:n.screenPadding}):Mi(t,i,n.anchor,{inset:n.inset,padding:n.screenPadding}),a=(c=n.offset)!=null?c:{x:0,y:0},s=r.x+a.x,o=r.y+a.y;e.anchor&&n.renderAnchor&&e.anchor.set(n.renderAnchor.x,n.renderAnchor.y),Le(e,s,o);let d=(f=n.scale)!=null?f:1,l=(u=n.scaleMultiplier)!=null?u:1;(n.scale!==void 0||n.scaleMultiplier!==void 0)&&$e(e,d*l)}if(typeof window!="undefined"){let e=window.innerWidth,t=window.innerHeight,i=()=>{let n=window.innerWidth,r=window.innerHeight;(n!==e||r!==t)&&(e=n,t=r,ta(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),ta(window.innerWidth,window.innerHeight),window.updateDebugConfig=Av,window.getDebugConfig=Cv,window.copyConfig=Nv,window.applyConfig=zn,window.applyConfigForRatio=Bv,window.positionAtBottom=Nf,window.positionAtTop=Ov,window.positionAtCenter=Iv,window.positionAtLeft=Mv,window.positionAtRight=Rv,window.positionAtBottomLeft=Pv,window.positionAtBottomRight=jv,window.positionAtTopLeft=Dv,window.positionAtTopRight=zv,window.applyPositionContract=Lv,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function aa(e,t,i=0){return e*t+i}function sa(e,t,i=0){return e*(1-t)+i}function oa(e,t,i=0){return e*t+i}function la(e,t,i=0){return e*(1-t)+i}function we(e,t=0){return e/2+t}function kv(e,t){return e*t}function Lv(e,t,i,n){var s,o,d,l,c,f,u,p,v,m,w,g,h,x,y,b,C,S,A,T;let r=0,a=0;switch(n.type){case"top":r=we(t,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),a=aa(i,n.percent,(l=(d=n.offset)==null?void 0:d.y)!=null?l:0);break;case"bottom":r=we(t,(f=(c=n.offset)==null?void 0:c.x)!=null?f:0),a=sa(i,n.percent,(p=(u=n.offset)==null?void 0:u.y)!=null?p:0);break;case"left":r=oa(t,n.percent,(m=(v=n.offset)==null?void 0:v.x)!=null?m:0),a=we(i,(g=(w=n.offset)==null?void 0:w.y)!=null?g:0);break;case"right":r=la(t,n.percent,(x=(h=n.offset)==null?void 0:h.x)!=null?x:0),a=we(i,(b=(y=n.offset)==null?void 0:y.y)!=null?b:0);break;case"center":r=we(t,(S=(C=n.offset)==null?void 0:C.x)!=null?S:0),a=we(i,(T=(A=n.offset)==null?void 0:A.y)!=null?T:0);break}e.position?e.position.set(r,a):(e.x=r,e.y=a),n.scale!==void 0&&n.scale!==1&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(n.scale,n.scale):(e.scale.x=n.scale,e.scale.y=n.scale))}function Nf(e,t,i,n=.2,r=1,a=!0,s=!1){let o=kv(i,n),d=sa(i,n/2);Le(e,we(t),d);let l=a?r*at.scaleFactor:r;$e(e,l),s&&!ra.find(c=>c.element===e)&&Ev(e,Nf,t,i,n,r,a)}function Ov(e,t,i,n=.1,r=1){Le(e,we(t),aa(i,n)),$e(e,r)}function Iv(e,t,i,n=0,r=0,a=1){Le(e,we(t,n),we(i,r)),$e(e,a)}function Mv(e,t,i,n=.1,r=1){Le(e,oa(t,n),we(i)),$e(e,r)}function Rv(e,t,i,n=.1,r=1){Le(e,la(t,n),we(i)),$e(e,r)}function Pv(e,t,i,n=.05,r=.05,a=1){Le(e,oa(t,r),sa(i,n)),$e(e,a)}function jv(e,t,i,n=.05,r=.05,a=1){Le(e,la(t,r),sa(i,n)),$e(e,a)}function Dv(e,t,i,n=.05,r=.05,a=1){Le(e,oa(t,r),aa(i,n)),$e(e,a)}function zv(e,t,i,n=.05,r=.05,a=1){Le(e,la(t,r),aa(i,n)),$e(e,a)}function Le(e,t,i){e&&e.position?typeof e.position.set=="function"?e.position.set(t,i):(e.position.x=t,e.position.y=i):e&&(e.x=t,e.y=i)}function $e(e,t){t!==1&&e&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(t,t):e.scale.x!==void 0&&e.scale.y!==void 0&&(e.scale.x=t,e.scale.y=t))}var Ut={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function Nv(e){return e&&Ut[e]?JSON.parse(JSON.stringify(Ut[e])):JSON.parse(JSON.stringify(G))}function zn(e){Object.keys(e).forEach(t=>{let i=t;G[i]&&e[i]&&Object.assign(G[i],e[i])}),console.log("Config applied:",e)}function Bv(e,t){let i=e/t;i>1.6?(zn(Ut.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(zn(Ut.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(zn(Ut.square),console.log("Applied SQUARE config for ratio:",i)):(zn(Ut.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ut,e.resolveAnchorVec2=e.resolveAnchorVec2||Bn,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||Mi,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||Ri}var fe=null;function Bf(e,t,i,n,r,a={}){var ne,he,Pi,ji,Di,zi,Ni,Bi,Oe,Fn,Io,Mo,Ro,Po,jo,Do,zo,No,Bo,Fo,Ho,$o,Uo,qo,Go,Wo,Yo,Vo,Ko,Xo,Zo,Jo,Qo,el,tl,il,nl;let s=(ne=a.enableDebugLogs)!=null?ne:!1;s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:n.width,height:n.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",i),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",a));let{mainContainer:o,label:d,background:l,backgroundTexture:c,app:f}=e;if(!f||!f.renderer){s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:f.renderer.width,height:f.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:f.screen.width,height:f.screen.height}));let u=n.width,p=n.height;s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:u,baseHeight:p});let v=u*G.layout.screen_scale_x,m=p*G.layout.screen_scale_y,w=u/2,g=t.engine.runtime||{},h=g.layout||{};s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:G.layout.screen_scale_x,screen_scale_y:G.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:v,height:m,midX:w}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",g),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",h));let x=h.design_width_portrait||400,y=v/x;y=Math.min(y,1.15);let b=y*((he=G.engine.scale)!=null?he:1),C=(Pi=a.skipMainContainerTransform)!=null?Pi:!1;!C&&o&&o.scale&&(typeof o.scale.set=="function"?o.scale.set(b):(o.scale.x=b,o.scale.y=b));let S=(ji=h.main_container_anchor)!=null?ji:"center",A=(Di=h.main_container_position_ratio)!=null?Di:{x:.5,y:.5},T=(zi=h.main_container_offset)!=null?zi:{x:0,y:0},M=h.main_container_position_ratio?Ri(u,p,A):Mi(u,p,S),_=M.x+T.x+G.layout.position_offset.x,O=M.y+T.y+G.layout.position_offset.y;if(!C&&o&&o.position&&(typeof o.position.set=="function"?o.position.set(_,O):(o.position.x=_,o.position.y=O)),r&&(o!=null&&o.toLocal))for(let[re,ae]of t.objects.entries()){let W=ae==null?void 0:ae.transform;if(!W||((Ni=W.position_mode)!=null?Ni:"static")!=="static")continue;let B=(Bi=r.get)==null?void 0:Bi.call(r,re),Ie=((Oe=B==null?void 0:B.getDisplayObject)==null?void 0:Oe.call(B))||(B==null?void 0:B.pixiObject)||B;if(!Ie||Ie.parent!==o)continue;let Fi=W.position_ratio!=null?Ri(u,p,W.position_ratio):Mi(u,p,(Fn=W.anchor)!=null?Fn:"center"),Hn=o.toLocal(new na.Point(Fi.x,Fi.y)),$n=(Io=W.position)!=null?Io:{x:0,y:0},Hi=Hn.x+$n.x,St=Hn.y+$n.y;typeof(B==null?void 0:B.setPosition)=="function"?B.setPosition(Hi,St):(Le(Ie,Hi,St),(Mo=B==null?void 0:B.transform)!=null&&Mo.position&&(B.transform.position.x=Hi,B.transform.position.y=St))}let k=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,D=((k==null?void 0:k.buildMode)||(typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"dev"))==="dev";if(G.layout.debug_rect_visible&&D){(!fe||fe.parent!==f.stage)&&(fe==null||fe.destroy(),fe=new na.Graphics,fe.zIndex=9999,f.stage.addChild(fe)),fe.clear();let re=G.layout.debug_rect_scale_x,ae=G.layout.debug_rect_scale_y,W=(u-4)*re,_e=(p-4)*ae,B=(u-W)/2,Ie=(p-_e)/2;s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:u,baseHeight:p,rectW:W,rectH:_e,offsetX:B,offsetY:Ie}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+B,y:2+Ie,width:W,height:_e})),fe.rect(2+B,2+Ie,W,_e).stroke({width:G.layout.debug_rect_thickness,color:G.layout.debug_rect_color})}else fe&&(fe.destroy(),fe=null);let z=((Ro=e.label)==null?void 0:Ro.config)||t.objects.get("label_1")||t.objects.get("ui_tutorial_1");if(d&&d.position&&z){let re=(Po=z==null?void 0:z.render)==null?void 0:Po.anchor,ae=(Do=(jo=z==null?void 0:z.transform)==null?void 0:jo.anchor)!=null?Do:"center",W=(zo=z==null?void 0:z.transform)==null?void 0:zo.position_ratio,_e=((No=z==null?void 0:z.transform)==null?void 0:No.offset)||{x:0,y:0};ia(d,u,p,{anchor:ae,positionRatio:W,offset:{x:_e.x*b,y:_e.y*b},renderAnchor:re})}if(d&&d.alpha>0){let re=1+Math.sin(i*G.engine.label_pulse_speed)*G.engine.label_pulse_intensity,ae=(Fo=(Bo=z==null?void 0:z.transform)==null?void 0:Bo.scale)!=null?Fo:1,W=re*b*ae;d.scale&&(typeof d.scale.set=="function"?d.scale.set(W):(d.scale.x=W,d.scale.y=W))}if(s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING ====="),l){s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Ho=l.constructor)==null?void 0:Ho.name)),l.alpha=((Uo=($o=g.background)==null?void 0:$o.alpha)!=null?Uo:.98)*G.engine.background_alpha,s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha);let re=t.objects.get("background_1");s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",re);let ae=(re==null?void 0:re.transform)||{};s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",ae);let W=ae.offset||{x:0,y:0},_e=((Go=(qo=g.background)==null?void 0:qo.offset_y)!=null?Go:0)+G.engine.background_offset_y,B=(Yo=(Wo=re==null?void 0:re.render)==null?void 0:Wo.anchor)!=null?Yo:{x:.5,y:.5},Ie=(Vo=ae.anchor)!=null?Vo:"center",Fi=ae.position_ratio;if(s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:W,bgRuntimeOffsetY:_e,bgRenderAnchor:B,bgScreenAnchor:Ie,bgPositionRatio:Fi,baseWidth:u,baseHeight:p,finalScale:b}),ia(l,u,p,{anchor:Ie,positionRatio:Fi,offset:{x:W.x*b,y:W.y*b+_e},renderAnchor:B}),s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Ko=l.scale)==null?void 0:Ko.x,scaleY:(Xo=l.scale)==null?void 0:Xo.y,anchorX:(Zo=l.anchor)==null?void 0:Zo.x,anchorY:(Jo=l.anchor)==null?void 0:Jo.y,pivotX:(Qo=l.pivot)==null?void 0:Qo.x,pivotY:(el=l.pivot)==null?void 0:el.y,width:l.width,height:l.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background texture dimensions:",{textureWidth:c==null?void 0:c.width,textureHeight:c==null?void 0:c.height})),c){let Hn=Math.max(v/c.width,m/c.height),$n=(il=(tl=g.background)==null?void 0:tl.scale_multiplier)!=null?il:1.05,Hi=(nl=ae.scale)!=null?nl:1,St=Hn*$n*G.engine.background_scale*Hi;l.scale&&(typeof l.scale.set=="function"?l.scale.set(St):(l.scale.x=St,l.scale.y=St))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-v/2,-m/2,v,m).fill({color:1444375}))}}function Ff(e){var o,d,l;let{setState:t,updateLabelAlpha:i,updateHandAlpha:n,config:r,states:a}=e,s=((d=(o=r.engine)==null?void 0:o.runtime)==null?void 0:d.timeline)||{};t(a.showHook),setTimeout(()=>{i(1),n(1),t(a.waitInput),console.log("[GAME] \u23F3 Game ready for user input - tutorial shown")},(l=s.tutorial_delay_ms)!=null?l:1500)}0&&(module.exports={AssetCache,AssetLoader,AssetSystem,AssetTextures,Assets,BaseSystem,GameEngine,GameObject,GameObjectManager,ObjectFactory,Renderer,RuntimeObjectRegistry,Transform,applyScreenAnchor,basePixi,clearResponsiveElements,createPixiBase,getRegisteredFontIds,globalResponsiveMultipliers,initAssetTextures,initAssets,layout,playLottieOverlay,registerFont,registerType,resolveAnchorVec2,resolveFont,resolveFontWeight,resolveScreenAnchorPoint,resolveScreenRatioPoint,runInitSequence,setLottieInstance,spawnSceneFromConfig,updateScreenState});
|