handler-playable-sdk 0.3.2 → 0.3.4

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.
Files changed (36) hide show
  1. package/dist/AssetEditorModal-DBAGQINC.js +1 -0
  2. package/dist/AssetTextures-AZY5VKWH.js +1 -0
  3. package/dist/ConfigOverride-DFTDUTRQ.js +1 -0
  4. package/dist/chunk-C2CEUBBT.js +1325 -0
  5. package/dist/chunk-DEUORFXE.js +1 -0
  6. package/dist/chunk-DHSGG7NF.js +1 -0
  7. package/dist/chunk-E6WJCS24.js +46 -0
  8. package/dist/chunk-PWGHKK3J.js +1 -0
  9. package/dist/chunk-Q7FPWOA3.js +1 -0
  10. package/dist/config-7DI6U2YD.js +1 -0
  11. package/dist/index.cjs +1360 -0
  12. package/dist/index.css +4537 -1
  13. package/dist/index.d.cts +892 -0
  14. package/dist/index.d.ts +494 -39
  15. package/dist/index.js +1 -1
  16. package/dist/{loader-object-centric-C1QteFfG.d.mts → loader-object-centric-Ce6MVkQw.d.cts} +1 -1
  17. package/dist/{loader-object-centric-C1QteFfG.d.ts → loader-object-centric-Ce6MVkQw.d.ts} +1 -1
  18. package/dist/pixi/index.cjs +256 -0
  19. package/dist/pixi/index.css +4537 -1
  20. package/dist/pixi/{index.d.mts → index.d.cts} +156 -144
  21. package/dist/pixi/index.d.ts +156 -144
  22. package/dist/pixi/index.js +1 -27
  23. package/dist/three/index.cjs +363 -0
  24. package/dist/three/index.css +4537 -1
  25. package/dist/three/index.js +1 -134
  26. package/package.json +29 -18
  27. package/dist/ConfigOverride-6YH2ILBJ.mjs +0 -1
  28. package/dist/chunk-BDZGKN5O.mjs +0 -1
  29. package/dist/chunk-GYW3GFXA.mjs +0 -830
  30. package/dist/chunk-HN7I4BLB.mjs +0 -1
  31. package/dist/config-QLS2MDB6.mjs +0 -1
  32. package/dist/index.d.mts +0 -437
  33. package/dist/index.mjs +0 -1
  34. package/dist/pixi/index.mjs +0 -1
  35. package/dist/three/index.mjs +0 -118
  36. /package/dist/three/{index.d.mts → index.d.cts} +0 -0
@@ -0,0 +1,363 @@
1
+ "use strict";var Lg=Object.create;var $n=Object.defineProperty;var Rg=Object.getOwnPropertyDescriptor;var Mg=Object.getOwnPropertyNames;var Ig=Object.getPrototypeOf,Og=Object.prototype.hasOwnProperty;var Ge=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fc=(e,t)=>{for(var i in t)$n(e,i,{get:t[i],enumerable:!0})},hc=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Mg(t))!Og.call(e,r)&&r!==i&&$n(e,r,{get:()=>t[r],enumerable:!(n=Rg(t,r))||n.enumerable});return e};var qe=(e,t,i)=>(i=e!=null?Lg(Ig(e)):{},hc(t||!e||!e.__esModule?$n(i,"default",{value:e,enumerable:!0}):i,e)),Pg=e=>hc($n({},"__esModule",{value:!0}),e);var We,xa=Ge(()=>{"use strict";We=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()}};We.store=new Map});function Bg(){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 Fg(){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 Ng(){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 Hg(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${B}`),Object.keys(Ye).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(Ye)),Ye;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),Ye={...window.INLINE_ASSETS},Ye;if(!(B==="publish"&&Le!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),Ye;if(!wa){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),wa=(async()=>{try{try{let a=await fetch(t+"?t="+Date.now());if(a.ok){let o=(await a.text()).match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(o){let d=new Function("return "+o[1])();return console.log("[AssetLoader] Loaded INLINE_ASSETS via fetch:",Object.keys(d)),d}}}catch(a){console.warn("[AssetLoader] Fetch loading 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 Ye=await wa,console.log("[AssetLoader] Final inline assets cache:",Object.keys(Ye)),Ye}function _a(e){return e===null||typeof e!="object"||(Object.freeze(e),Object.values(e).forEach(t=>_a(t))),e}function $g(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),Ve.Texture.from(n)}function Ea(e,t){Hc.set(e,t)}var Ve,Fc,Nc,Lt,B,Le,ut,Ye,wa,Hc,Rt,Wn=Ge(()=>{"use strict";Ve=require("pixi.js");xa();Fc=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Nc=Bg(),Lt=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,B=Nc?"publish":Fc,Le=Lt==null?void 0:Lt.assetsInlined;Lt!=null&&Lt.buildMode&&(B=Lt.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${B}`));ut=Ng();ut!=null&&ut.buildMode&&(B=ut.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${B}`));(ut==null?void 0:ut.assetsInlined)!==void 0&&(Le=ut.assetsInlined);Fg().then(e=>{e!=null&&e.buildMode&&e.buildMode!==B&&(B=e.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${B}`)),(e==null?void 0:e.assetsInlined)!==void 0&&(Le=e.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${Fc}, Runtime: ${Nc?"publish":"dev"}, Effective: ${B}`);Ye={},wa=null;Hc=new Map;Rt=class{static async load(t,i,n,r){let a=`${t}:${i.path}`,s=We.get(a);if(s!==void 0)return s;console.log(`[AssetLoader] Loading asset: ${t}, type: ${i.type}, Effective mode: ${B}`),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 Hg(),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 p=f[f.length-1].split(".")[0];o[p]&&(d=o[p],console.log(`[AssetLoader] Found inline data for ${t} using assetName: ${p}`))}}if(console.log("[AssetLoader] Inline data for",t,":",d?"FOUND":"NOT FOUND"),B==="publish"&&Le!==!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=Hc.get(i.type);if(c)try{let f=await c(i.path,d,t,n);return We.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=_a(f);break;default:throw new Error(`Unknown asset type: ${i.type}`)}return We.set(a,f),f}catch(f){return this.handleFailure(t,i.type,f)}}static async loadImage(t,i){let n=B==="publish",r=n&&Le!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${B}, 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 Ve.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 Ve.Assets.load(i)}catch(a){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",a),await Ve.Assets.load(t)}return await Ve.Assets.load(t)}static async loadJSON(t,i){let n=B==="publish",r=n&&Le!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${B}, 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(B==="dev"){let a=i==="image"?$g():_a({__placeholder:!0,type:i});return We.set(t+":"+((n==null?void 0:n.path)||"missing"),a),a}throw n}};Ea("image",async(e,t)=>{let i=B==="publish",n=i&&Le!==!1,r=B==="brand",a=i&&Le===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${B}, 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 Ve.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}"`))),Ve.Assets.load(t||s)});Ea("json",async(e,t)=>{let i=B==="publish",n=i&&Le!==!1,r=B==="brand",a=i&&Le===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${B}, 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()})});var Aa,Yg,Yn,$i=Ge(()=>{"use strict";Wn();Aa=class{constructor(){this.textures=new Map;this.readyPromise=null;this.config=null;this.app=null}init(t,i){this.textures.clear(),this.readyPromise=null,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 r;console.log("[AssetTextures] Loading all assets...");let n=[];for(let[a,s]of t.objects.entries()){let o=(r=s.render)==null?void 0:r.asset;if(!o)continue;let d=(async()=>{var l;try{let c=(l=s.identity)==null?void 0:l.id;console.log(`[AssetTextures] Loading ${o.type}: ${a} (${c})`);let f=await Rt.load(a,o,i,c);this.textures.set(a,f),console.log(`[AssetTextures] \u2713 Loaded: ${a}`)}catch(c){console.error(`[AssetTextures] \u2717 Failed to load: ${a}`,c)}})();n.push(d)}await Promise.all(n),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}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())}},Yg=new Aa,Yn=new Proxy(Yg,{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 gm,pt=Ge(()=>{"use strict";gm="handler_preview_override_mode";if(typeof window!="undefined"){let e=window.localStorage.getItem(gm);window.__enableConfigOverrides=e===null?!0:e==="true"}});var Wc,Ot,n_,La=Ge(()=>{"use strict";pt();Wc=null,Ot="dev";if(typeof window!="undefined"){let e=window.__BUILD_SETTINGS__;if(e!=null&&e.buildMode)Wc=e,Ot=e.buildMode,console.log("[CONFIG] Loaded inline build settings:",e,"buildMode:",Ot);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);Wc=i,Ot=i.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",i,"buildMode:",Ot)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",Ot)}catch(t){console.log("[CONFIG] Failed to load build-settings.json:",t instanceof Error?t.message:String(t))}}console.log("[CONFIG] Final buildMode:",Ot);n_=Ot==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var Ra=Ge(()=>{"use strict"});var Vc=Ge(()=>{"use strict";Ra();La()});var Ma=Ge(()=>{"use strict";La();Ra();Vc()});var qi=E((h1,Ia)=>{"use strict";typeof process=="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Ia.exports={nextTick:Sm}:Ia.exports=process;function Sm(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 Jc=E((g1,Zc)=>{"use strict";var Am={}.toString;Zc.exports=Array.isArray||function(e){return Am.call(e)=="[object Array]"}});var Oa=E((m1,Qc)=>{"use strict";Qc.exports=require("stream")});var Wi=E((Pa,td)=>{"use strict";var ir=require("buffer"),Je=ir.Buffer;function ed(e,t){for(var i in e)t[i]=e[i]}Je.from&&Je.alloc&&Je.allocUnsafe&&Je.allocUnsafeSlow?td.exports=ir:(ed(ir,Pa),Pa.Buffer=ti);function ti(e,t,i){return Je(e,t,i)}ed(Je,ti);ti.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Je(e,t,i)};ti.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=Je(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};ti.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Je(e)};ti.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ir.SlowBuffer(e)}});var ii=E(K=>{"use strict";function Cm(e){return Array.isArray?Array.isArray(e):nr(e)==="[object Array]"}K.isArray=Cm;function Tm(e){return typeof e=="boolean"}K.isBoolean=Tm;function km(e){return e===null}K.isNull=km;function Lm(e){return e==null}K.isNullOrUndefined=Lm;function Rm(e){return typeof e=="number"}K.isNumber=Rm;function Mm(e){return typeof e=="string"}K.isString=Mm;function Im(e){return typeof e=="symbol"}K.isSymbol=Im;function Om(e){return e===void 0}K.isUndefined=Om;function Pm(e){return nr(e)==="[object RegExp]"}K.isRegExp=Pm;function Dm(e){return typeof e=="object"&&e!==null}K.isObject=Dm;function jm(e){return nr(e)==="[object Date]"}K.isDate=jm;function zm(e){return nr(e)==="[object Error]"||e instanceof Error}K.isError=zm;function Bm(e){return typeof e=="function"}K.isFunction=Bm;function Fm(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}K.isPrimitive=Fm;K.isBuffer=require("buffer").Buffer.isBuffer;function nr(e){return Object.prototype.toString.call(e)}});var id=E((y1,Da)=>{"use strict";typeof Object.create=="function"?Da.exports=function(t,i){i&&(t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Da.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 ni=E((v1,za)=>{"use strict";try{if(ja=require("util"),typeof ja.inherits!="function")throw"";za.exports=ja.inherits}catch{za.exports=id()}var ja});var rd=E((x1,Ba)=>{"use strict";function Nm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var nd=Wi().Buffer,Yi=require("util");function Hm(e,t,i){e.copy(t,i)}Ba.exports=(function(){function e(){Nm(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 nd.alloc(0);for(var n=nd.allocUnsafe(i>>>0),r=this.head,a=0;r;)Hm(r.data,n,a),a+=r.data.length,r=r.next;return n},e})();Yi&&Yi.inspect&&Yi.inspect.custom&&(Ba.exports.prototype[Yi.inspect.custom]=function(){var e=Yi.inspect({length:this.length});return this.constructor.name+" "+e})});var Fa=E((w1,ad)=>{"use strict";var rr=qi();function $m(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,rr.nextTick(ar,this,e)):rr.nextTick(ar,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,rr.nextTick(ar,i,a)):rr.nextTick(ar,i,a):t&&t(a)}),this)}function Um(){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 ar(e,t){e.emit("error",t)}ad.exports={destroy:$m,undestroy:Um}});var od=E((_1,sd)=>{"use strict";sd.exports=require("util").deprecate});var Ha=E((E1,gd)=>{"use strict";var Pt=qi();gd.exports=$;function cd(e){var t=this;this.next=null,this.entry=null,this.finish=function(){ob(t,e)}}var Gm=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Pt.nextTick,ri;$.WritableState=Xi;var dd=Object.create(ii());dd.inherits=ni();var qm={deprecate:od()},ud=Oa(),or=Wi().Buffer,Wm=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Ym(e){return or.from(e)}function Vm(e){return or.isBuffer(e)||e instanceof Wm}var pd=Fa();dd.inherits($,ud);function Xm(){}function Xi(e,t){ri=ri||Dt(),e=e||{};var i=t instanceof ri;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){ib(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 cd(this)}Xi.prototype.getBuffer=function(){for(var t=this.bufferedRequest,i=[];t;)i.push(t),t=t.next;return i};(function(){try{Object.defineProperty(Xi.prototype,"buffer",{get:qm.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var sr;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(sr=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(e){return sr.call(this,e)?!0:this!==$?!1:e&&e._writableState instanceof Xi}})):sr=function(e){return e instanceof this};function $(e){if(ri=ri||Dt(),!sr.call($,this)&&!(this instanceof ri))return new $(e);this._writableState=new Xi(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)),ud.call(this)}$.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Km(e,t){var i=new Error("write after end");e.emit("error",i),Pt.nextTick(t,i)}function Zm(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),Pt.nextTick(n,a),r=!1),r}$.prototype.write=function(e,t,i){var n=this._writableState,r=!1,a=!n.objectMode&&Vm(e);return a&&!or.isBuffer(e)&&(e=Ym(e)),typeof t=="function"&&(i=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof i!="function"&&(i=Xm),n.ended?Km(this,i):(a||Zm(this,n,e,i))&&(n.pendingcb++,r=Qm(this,n,a,e,t,i)),r};$.prototype.cork=function(){var e=this._writableState;e.corked++};$.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&fd(this,e))};$.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 Jm(e,t,i){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=or.from(t,i)),t}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Qm(e,t,i,n,r,a){if(!i){var s=Jm(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 Na(e,t,!1,o,n,r,a);return d}function Na(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 eb(e,t,i,n,r){--t.pendingcb,i?(Pt.nextTick(r,n),Pt.nextTick(Vi,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(r(n),e._writableState.errorEmitted=!0,e.emit("error",n),Vi(e,t))}function tb(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function ib(e,t){var i=e._writableState,n=i.sync,r=i.writecb;if(tb(i),t)eb(e,i,n,t,r);else{var a=hd(i);!a&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&fd(e,i),n?Gm(ld,e,i,a,r):ld(e,i,a,r)}}function ld(e,t,i,n){i||nb(e,t),t.pendingcb--,n(),Vi(e,t)}function nb(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function fd(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,Na(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 cd(t),t.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,c=i.callback,f=t.objectMode?1:d.length;if(Na(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}$.prototype._write=function(e,t,i){i(new Error("_write() is not implemented"))};$.prototype._writev=null;$.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||sb(this,n,i)};function hd(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function rb(e,t){e._final(function(i){t.pendingcb--,i&&e.emit("error",i),t.prefinished=!0,e.emit("prefinish"),Vi(e,t)})}function ab(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Pt.nextTick(rb,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Vi(e,t){var i=hd(t);return i&&(ab(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),i}function sb(e,t,i){t.ending=!0,Vi(e,t),i&&(t.finished?Pt.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}function ob(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($.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});$.prototype.destroy=pd.destroy;$.prototype._undestroy=pd.undestroy;$.prototype._destroy=function(e,t){this.end(),t(e)}});var Dt=E((S1,vd)=>{"use strict";var md=qi(),lb=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};vd.exports=Qe;var bd=Object.create(ii());bd.inherits=ni();var yd=Ga(),Ua=Ha();bd.inherits(Qe,yd);for($a=lb(Ua.prototype),lr=0;lr<$a.length;lr++)cr=$a[lr],Qe.prototype[cr]||(Qe.prototype[cr]=Ua.prototype[cr]);var $a,cr,lr;function Qe(e){if(!(this instanceof Qe))return new Qe(e);yd.call(this,e),Ua.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",cb)}Object.defineProperty(Qe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cb(){this.allowHalfOpen||this._writableState.ended||md.nextTick(db,this)}function db(e){e.end()}Object.defineProperty(Qe.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)}});Qe.prototype._destroy=function(e,t){this.push(null),this.end(),md.nextTick(t,e)}});var Ya=E(wd=>{"use strict";var Wa=Wi().Buffer,xd=Wa.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 ub(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 pb(e){var t=ub(e);if(typeof t!="string"&&(Wa.isEncoding===xd||!xd(e)))throw new Error("Unknown encoding: "+e);return t||e}wd.StringDecoder=Ki;function Ki(e){this.encoding=pb(e);var t;switch(this.encoding){case"utf16le":this.text=yb,this.end=vb,t=4;break;case"utf8":this.fillLast=gb,t=4;break;case"base64":this.text=xb,this.end=wb,t=3;break;default:this.write=_b,this.end=Eb;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Wa.allocUnsafe(t)}Ki.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||""};Ki.prototype.end=bb;Ki.prototype.text=mb;Ki.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 qa(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function fb(e,t,i){var n=t.length-1;if(n<i)return 0;var r=qa(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=qa(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=qa(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}function hb(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 gb(e){var t=this.lastTotal-this.lastNeed,i=hb(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 mb(e,t){var i=fb(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 bb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function yb(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 vb(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 xb(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 wb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function _b(e){return e.toString(this.encoding)}function Eb(e){return e&&e.length?this.write(e):""}});var Ga=E((T1,Od)=>{"use strict";var si=qi();Od.exports=D;var Sb=Jc(),Zi;D.ReadableState=kd;var C1=require("events").EventEmitter,Ad=function(e,t){return e.listeners(t).length},Ja=Oa(),Ji=Wi().Buffer,Ab=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Cb(e){return Ji.from(e)}function Tb(e){return Ji.isBuffer(e)||e instanceof Ab}var Cd=Object.create(ii());Cd.inherits=ni();var Va=require("util"),I=void 0;Va&&Va.debuglog?I=Va.debuglog("stream"):I=function(){};var kb=rd(),Td=Fa(),ai;Cd.inherits(D,Ja);var Xa=["error","close","destroy","pause","resume"];function Lb(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):Sb(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}function kd(e,t){Zi=Zi||Dt(),e=e||{};var i=t instanceof Zi;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 kb,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&&(ai||(ai=Ya().StringDecoder),this.decoder=new ai(e.encoding),this.encoding=e.encoding)}function D(e){if(Zi=Zi||Dt(),!(this instanceof D))return new D(e);this._readableState=new kd(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Ja.call(this)}Object.defineProperty(D.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});D.prototype.destroy=Td.destroy;D.prototype._undestroy=Td.undestroy;D.prototype._destroy=function(e,t){this.push(null),t(e)};D.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=Ji.from(e,t),t=""),n=!0),Ld(this,e,t,!1,n)};D.prototype.unshift=function(e){return Ld(this,e,null,!0,!1)};function Ld(e,t,i,n,r){var a=e._readableState;if(t===null)a.reading=!1,Ob(e,a);else{var s;r||(s=Rb(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Ji.prototype&&(t=Cb(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Ka(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?Ka(e,a,t,!1):Rd(e,a)):Ka(e,a,t,!1))):n||(a.reading=!1)}return Mb(a)}function Ka(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&&dr(e)),Rd(e,t)}function Rb(e,t){var i;return!Tb(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i}function Mb(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}D.prototype.isPaused=function(){return this._readableState.flowing===!1};D.prototype.setEncoding=function(e){return ai||(ai=Ya().StringDecoder),this._readableState.decoder=new ai(e),this._readableState.encoding=e,this};var _d=8388608;function Ib(e){return e>=_d?e=_d:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Ed(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=Ib(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}D.prototype.read=function(e){I("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 I("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Za(this):dr(this),null;if(e=Ed(e,t),e===0&&t.ended)return t.length===0&&Za(this),null;var n=t.needReadable;I("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,I("length less than watermark",n)),t.ended||t.reading?(n=!1,I("reading or ended",n)):n&&(I("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Ed(i,t)));var r;return e>0?r=Md(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&&Za(this)),r!==null&&this.emit("data",r),r};function Ob(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,dr(e)}}function dr(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(I("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?si.nextTick(Sd,e):Sd(e))}function Sd(e){I("emit readable"),e.emit("readable"),Qa(e)}function Rd(e,t){t.readingMore||(t.readingMore=!0,si.nextTick(Pb,e,t))}function Pb(e,t){for(var i=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(I("maybeReadMore read 0"),e.read(0),i!==t.length);)i=t.length;t.readingMore=!1}D.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};D.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,I("pipe count=%d opts=%j",n.pipesCount,t);var r=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=r?o:x;n.endEmitted?si.nextTick(a):i.once("end",a),e.on("unpipe",s);function s(m,y){I("onunpipe"),m===i&&y&&y.hasUnpiped===!1&&(y.hasUnpiped=!0,c())}function o(){I("onend"),e.end()}var d=Db(i);e.on("drain",d);var l=!1;function c(){I("cleanup"),e.removeListener("close",v),e.removeListener("finish",h),e.removeListener("drain",d),e.removeListener("error",u),e.removeListener("unpipe",s),i.removeListener("end",o),i.removeListener("end",x),i.removeListener("data",p),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var f=!1;i.on("data",p);function p(m){I("ondata"),f=!1;var y=e.write(m);y===!1&&!f&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&Id(n.pipes,e)!==-1)&&!l&&(I("false write response, pause",n.awaitDrain),n.awaitDrain++,f=!0),i.pause())}function u(m){I("onerror",m),x(),e.removeListener("error",u),Ad(e,"error")===0&&e.emit("error",m)}Lb(e,"error",u);function v(){e.removeListener("finish",h),x()}e.once("close",v);function h(){I("onfinish"),e.removeListener("close",v),x()}e.once("finish",h);function x(){I("unpipe"),i.unpipe(e)}return e.emit("pipe",i),n.flowing||(I("pipe resume"),i.resume()),e};function Db(e){return function(){var t=e._readableState;I("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Ad(e,"data")&&(t.flowing=!0,Qa(e))}}D.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=Id(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)};D.prototype.on=function(e,t){var i=Ja.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&&dr(this):si.nextTick(jb,this))}return i};D.prototype.addListener=D.prototype.on;function jb(e){I("readable nexttick read 0"),e.read(0)}D.prototype.resume=function(){var e=this._readableState;return e.flowing||(I("resume"),e.flowing=!0,zb(this,e)),this};function zb(e,t){t.resumeScheduled||(t.resumeScheduled=!0,si.nextTick(Bb,e,t))}function Bb(e,t){t.reading||(I("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Qa(e),t.flowing&&!t.reading&&e.read(0)}D.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Qa(e){var t=e._readableState;for(I("flow",t.flowing);t.flowing&&e.read()!==null;);}D.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;e.on("end",function(){if(I("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(I("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<Xa.length;a++)e.on(Xa[a],this.emit.bind(this,Xa[a]));return this._read=function(s){I("wrapped _read",s),n&&(n=!1,e.resume())},this};Object.defineProperty(D.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});D._fromList=Md;function Md(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=Fb(e,t.buffer,t.decoder),i}function Fb(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?Nb(e,t):Hb(e,t),n}function Nb(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 Hb(e,t){var i=Ji.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 Za(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,si.nextTick($b,t,e))}function $b(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Id(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}});var es=E((k1,jd)=>{"use strict";jd.exports=et;var ur=Dt(),Dd=Object.create(ii());Dd.inherits=ni();Dd.inherits(et,ur);function Ub(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 et(e){if(!(this instanceof et))return new et(e);ur.call(this,e),this._transformState={afterTransform:Ub.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",Gb)}function Gb(){var e=this;typeof this._flush=="function"?this._flush(function(t,i){Pd(e,t,i)}):Pd(this,null,null)}et.prototype.push=function(e,t){return this._transformState.needTransform=!1,ur.prototype.push.call(this,e,t)};et.prototype._transform=function(e,t,i){throw new Error("_transform() is not implemented")};et.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)}};et.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};et.prototype._destroy=function(e,t){var i=this;ur.prototype._destroy.call(this,e,function(n){t(n),i.emit("close")})};function Pd(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 Nd=E((L1,Fd)=>{"use strict";Fd.exports=Qi;var zd=es(),Bd=Object.create(ii());Bd.inherits=ni();Bd.inherits(Qi,zd);function Qi(e){if(!(this instanceof Qi))return new Qi(e);zd.call(this,e)}Qi.prototype._transform=function(e,t,i){i(null,e)}});var ts=E((Y,pr)=>{"use strict";var Re=require("stream");process.env.READABLE_STREAM==="disable"&&Re?(pr.exports=Re,Y=pr.exports=Re.Readable,Y.Readable=Re.Readable,Y.Writable=Re.Writable,Y.Duplex=Re.Duplex,Y.Transform=Re.Transform,Y.PassThrough=Re.PassThrough,Y.Stream=Re):(Y=pr.exports=Ga(),Y.Stream=Re||Y,Y.Readable=Y,Y.Writable=Ha(),Y.Duplex=Dt(),Y.Transform=es(),Y.PassThrough=Nd())});var tt=E(ae=>{"use strict";ae.base64=!0;ae.array=!0;ae.string=!0;ae.arraybuffer=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined";ae.nodebuffer=typeof Buffer!="undefined";ae.uint8array=typeof Uint8Array!="undefined";if(typeof ArrayBuffer=="undefined")ae.blob=!1;else{is=new ArrayBuffer(0);try{ae.blob=new Blob([is],{type:"application/zip"}).size===0}catch{try{Hd=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,ns=new Hd,ns.append(is),ae.blob=ns.getBlob("application/zip").size===0}catch{ae.blob=!1}}}var is,Hd,ns;try{ae.nodestream=!!ts().Readable}catch{ae.nodestream=!1}});var as=E(rs=>{"use strict";var qb=F(),Wb=tt(),Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";rs.encode=function(e){for(var t=[],i,n,r,a,s,o,d,l=0,c=e.length,f=c,p=qb.getTypeOf(e)!=="string";l<e.length;)f=c-l,p?(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(Me.charAt(a)+Me.charAt(s)+Me.charAt(o)+Me.charAt(d));return t.join("")};rs.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)===Me.charAt(64)&&f--,e.charAt(e.length-2)===Me.charAt(64)&&f--,f%1!==0)throw new Error("Invalid base64 input, bad content length.");var p;for(Wb.uint8array?p=new Uint8Array(f|0):p=new Array(f|0);d<e.length;)r=Me.indexOf(e.charAt(d++)),a=Me.indexOf(e.charAt(d++)),s=Me.indexOf(e.charAt(d++)),o=Me.indexOf(e.charAt(d++)),t=r<<2|a>>4,i=(a&15)<<4|s>>2,n=(s&3)<<6|o,p[l++]=t,s!==64&&(p[l++]=i),o!==64&&(p[l++]=n);return p}});var en=E((I1,$d)=>{"use strict";$d.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 Wd=E((O1,qd)=>{"use strict";var Ud=global.MutationObserver||global.WebKitMutationObserver,oi;process.browser?Ud?(ss=0,Gd=new Ud(tn),os=global.document.createTextNode(""),Gd.observe(os,{characterData:!0}),oi=function(){os.data=ss=++ss%2}):!global.setImmediate&&typeof global.MessageChannel!="undefined"?(ls=new global.MessageChannel,ls.port1.onmessage=tn,oi=function(){ls.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?oi=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){tn(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:oi=function(){setTimeout(tn,0)}:oi=function(){process.nextTick(tn)};var ss,Gd,os,ls,cs,nn=[];function tn(){cs=!0;for(var e,t,i=nn.length;i;){for(t=nn,nn=[],e=-1;++e<i;)t[e]();i=nn.length}cs=!1}qd.exports=Yb;function Yb(e){nn.push(e)===1&&!cs&&oi()}});var Qd=E((P1,Jd)=>{"use strict";var Yd=Wd();function li(){}var Z={},Vd=["REJECTED"],ds=["FULFILLED"],Xd=["PENDING"];process.browser||(rn=["UNHANDLED"]);var rn;Jd.exports=ft;function ft(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=Xd,this.queue=[],this.outcome=void 0,process.browser||(this.handled=rn),e!==li&&Kd(this,e)}ft.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)}};ft.prototype.catch=function(e){return this.then(null,e)};ft.prototype.then=function(e,t){if(typeof e!="function"&&this.state===ds||typeof t!="function"&&this.state===Vd)return this;var i=new this.constructor(li);if(process.browser||this.handled===rn&&(this.handled=null),this.state!==Xd){var n=this.state===ds?e:t;us(i,n,this.outcome)}else this.queue.push(new an(i,e,t));return i};function an(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)}an.prototype.callFulfilled=function(e){Z.resolve(this.promise,e)};an.prototype.otherCallFulfilled=function(e){us(this.promise,this.onFulfilled,e)};an.prototype.callRejected=function(e){Z.reject(this.promise,e)};an.prototype.otherCallRejected=function(e){us(this.promise,this.onRejected,e)};function us(e,t,i){Yd(function(){var n;try{n=t(i)}catch(r){return Z.reject(e,r)}n===e?Z.reject(e,new TypeError("Cannot resolve promise with itself")):Z.resolve(e,n)})}Z.resolve=function(e,t){var i=Zd(Vb,t);if(i.status==="error")return Z.reject(e,i.value);var n=i.value;if(n)Kd(e,n);else{e.state=ds,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e};Z.reject=function(e,t){e.state=Vd,e.outcome=t,process.browser||e.handled===rn&&Yd(function(){e.handled===rn&&process.emit("unhandledRejection",t,e)});for(var i=-1,n=e.queue.length;++i<n;)e.queue[i].callRejected(t);return e};function Vb(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function Kd(e,t){var i=!1;function n(o){i||(i=!0,Z.reject(e,o))}function r(o){i||(i=!0,Z.resolve(e,o))}function a(){t(r,n)}var s=Zd(a);s.status==="error"&&n(s.value)}function Zd(e,t){var i={};try{i.value=e(t),i.status="success"}catch(n){i.status="error",i.value=n}return i}ft.resolve=Xb;function Xb(e){return e instanceof this?e:Z.resolve(new this(li),e)}ft.reject=Kb;function Kb(e){var t=new this(li);return Z.reject(t,e)}ft.all=Zb;function Zb(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(li);++s<i;)d(e[s],s);return o;function d(l,c){t.resolve(l).then(f,function(p){n||(n=!0,Z.reject(o,p))});function f(p){r[c]=p,++a===i&&!n&&(n=!0,Z.resolve(o,r))}}}ft.race=Jb;function Jb(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(li);++r<i;)s(e[r]);return a;function s(o){t.resolve(o).then(function(d){n||(n=!0,Z.resolve(a,d))},function(d){n||(n=!0,Z.reject(a,d))})}}});var ci=E((D1,eu)=>{"use strict";var ps=null;typeof Promise!="undefined"?ps=Promise:ps=Qd();eu.exports={Promise:ps}});var iu=E(tu=>{"use strict";(function(e,t){"use strict";if(e.setImmediate)return;var i=1,n={},r=!1,a=e.document,s;function o(y){typeof y!="function"&&(y=new Function(""+y));for(var b=new Array(arguments.length-1),g=0;g<b.length;g++)b[g]=arguments[g+1];var w={callback:y,args:b};return n[i]=w,s(i),i++}function d(y){delete n[y]}function l(y){var b=y.callback,g=y.args;switch(g.length){case 0:b();break;case 1:b(g[0]);break;case 2:b(g[0],g[1]);break;case 3:b(g[0],g[1],g[2]);break;default:b.apply(t,g);break}}function c(y){if(r)setTimeout(c,0,y);else{var b=n[y];if(b){r=!0;try{l(b)}finally{d(y),r=!1}}}}function f(){s=function(y){process.nextTick(function(){c(y)})}}function p(){if(e.postMessage&&!e.importScripts){var y=!0,b=e.onmessage;return e.onmessage=function(){y=!1},e.postMessage("","*"),e.onmessage=b,y}}function u(){var y="setImmediate$"+Math.random()+"$",b=function(g){g.source===e&&typeof g.data=="string"&&g.data.indexOf(y)===0&&c(+g.data.slice(y.length))};e.addEventListener?e.addEventListener("message",b,!1):e.attachEvent("onmessage",b),s=function(g){e.postMessage(y+g,"*")}}function v(){var y=new MessageChannel;y.port1.onmessage=function(b){var g=b.data;c(g)},s=function(b){y.port2.postMessage(b)}}function h(){var y=a.documentElement;s=function(b){var g=a.createElement("script");g.onreadystatechange=function(){c(b),g.onreadystatechange=null,y.removeChild(g),g=null},y.appendChild(g)}}function x(){s=function(y){setTimeout(c,0,y)}}var m=Object.getPrototypeOf&&Object.getPrototypeOf(e);m=m&&m.setTimeout?m:e,{}.toString.call(e.process)==="[object process]"?f():p()?u():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?h():x(),m.setImmediate=o,m.clearImmediate=d})(typeof self=="undefined"?typeof global=="undefined"?tu:global:self)});var F=E(U=>{"use strict";var ht=tt(),Qb=as(),di=en(),fs=ci();iu();function ey(e){var t=null;return ht.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),hr(e,t)}U.newBlob=function(e,t){U.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 sn(e){return e}function hr(e,t){for(var i=0;i<e.length;++i)t[i]=e.charCodeAt(i)&255;return t}var fr={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 ht.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return ht.nodebuffer&&String.fromCharCode.apply(null,di.allocBuffer(1)).length===1}catch{return!1}})()}};function on(e){var t=65536,i=U.getTypeOf(e),n=!0;if(i==="uint8array"?n=fr.applyCanBeUsed.uint8array:i==="nodebuffer"&&(n=fr.applyCanBeUsed.nodebuffer),n)for(;t>1;)try{return fr.stringifyByChunk(e,i,t)}catch{t=Math.floor(t/2)}return fr.stringifyByChar(e)}U.applyFromCharCode=on;function gr(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}var gt={};gt.string={string:sn,array:function(e){return hr(e,new Array(e.length))},arraybuffer:function(e){return gt.string.uint8array(e).buffer},uint8array:function(e){return hr(e,new Uint8Array(e.length))},nodebuffer:function(e){return hr(e,di.allocBuffer(e.length))}};gt.array={string:on,array:sn,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return di.newBufferFrom(e)}};gt.arraybuffer={string:function(e){return on(new Uint8Array(e))},array:function(e){return gr(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:sn,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return di.newBufferFrom(new Uint8Array(e))}};gt.uint8array={string:on,array:function(e){return gr(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:sn,nodebuffer:function(e){return di.newBufferFrom(e)}};gt.nodebuffer={string:on,array:function(e){return gr(e,new Array(e.length))},arraybuffer:function(e){return gt.nodebuffer.uint8array(e).buffer},uint8array:function(e){return gr(e,new Uint8Array(e.length))},nodebuffer:sn};U.transformTo=function(e,t){if(t||(t=""),!e)return t;U.checkSupport(e);var i=U.getTypeOf(t),n=gt[i][e](t);return n};U.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("/")};U.getTypeOf=function(e){if(typeof e=="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(ht.nodebuffer&&di.isBuffer(e))return"nodebuffer";if(ht.uint8array&&e instanceof Uint8Array)return"uint8array";if(ht.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"};U.checkSupport=function(e){var t=ht[e.toLowerCase()];if(!t)throw new Error(e+" is not supported by this platform")};U.MAX_VALUE_16BITS=65535;U.MAX_VALUE_32BITS=-1;U.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};U.delay=function(e,t,i){setImmediate(function(){e.apply(i||null,t||[])})};U.inherits=function(e,t){var i=function(){};i.prototype=t.prototype,e.prototype=new i};U.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};U.prepareContent=function(e,t,i,n,r){var a=fs.Promise.resolve(t).then(function(s){var o=ht.blob&&(s instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(s))!==-1);return o&&typeof FileReader!="undefined"?new fs.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=U.getTypeOf(s);return o?(o==="arraybuffer"?s=U.transformTo("uint8array",s):o==="string"&&(r?s=Qb.decode(s):i&&n!==!0&&(s=ey(s))),s):fs.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var se=E((B1,ru)=>{"use strict";function nu(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}nu.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}};ru.exports=nu});var pi=E(mt=>{"use strict";var ui=F(),jt=tt(),ty=en(),mr=se(),ln=new Array(256);for(it=0;it<256;it++)ln[it]=it>=252?6:it>=248?5:it>=240?4:it>=224?3:it>=192?2:1;var it;ln[254]=ln[254]=1;var iy=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(jt.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},ny=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+ln[e[i]]>t?i:t},ry=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=ln[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),ui.applyFromCharCode(s)};mt.utf8encode=function(t){return jt.nodebuffer?ty.newBufferFrom(t,"utf-8"):iy(t)};mt.utf8decode=function(t){return jt.nodebuffer?ui.transformTo("nodebuffer",t).toString("utf-8"):(t=ui.transformTo(jt.uint8array?"uint8array":"array",t),ry(t))};function br(){mr.call(this,"utf-8 decode"),this.leftOver=null}ui.inherits(br,mr);br.prototype.processChunk=function(e){var t=ui.transformTo(jt.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(jt.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=ny(t),r=t;n!==t.length&&(jt.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:mt.utf8decode(r),meta:e.meta})};br.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:mt.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};mt.Utf8DecodeWorker=br;function hs(){mr.call(this,"utf-8 encode")}ui.inherits(hs,mr);hs.prototype.processChunk=function(e){this.push({data:mt.utf8encode(e.data),meta:e.meta})};mt.Utf8EncodeWorker=hs});var lu=E((N1,ou)=>{"use strict";var au=se(),su=F();function gs(e){au.call(this,"ConvertWorker to "+e),this.destType=e}su.inherits(gs,au);gs.prototype.processChunk=function(e){this.push({data:su.transformTo(this.destType,e.data),meta:e.meta})};ou.exports=gs});var uu=E((H1,du)=>{"use strict";var cu=ts().Readable,ay=F();ay.inherits(ms,cu);function ms(e,t,i){cu.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)})}ms.prototype._read=function(){this._helper.resume()};du.exports=ms});var bs=E(($1,hu)=>{"use strict";var zt=F(),sy=lu(),oy=se(),ly=as(),cy=tt(),dy=ci(),pu=null;if(cy.nodestream)try{pu=uu()}catch{}function uy(e,t,i){switch(e){case"blob":return zt.newBlob(zt.transformTo("arraybuffer",t),i);case"base64":return ly.encode(t);default:return zt.transformTo(e,t)}}function py(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 fy(e,t){return new dy.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=uy(s,py(a,r),o);i(d)}catch(l){n(l)}r=[]}).resume()})}function fu(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,zt.checkSupport(n),this._worker=e.pipe(new sy(n)),e.lock()}catch(r){this._worker=new oy("error"),this._worker.error(r)}}fu.prototype={accumulate:function(e){return fy(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(){zt.delay(t,arguments,i)}),this},resume:function(){return zt.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(zt.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new pu(this,{objectMode:this._outputType!=="nodebuffer"},e)}};hu.exports=fu});var ys=E(_e=>{"use strict";_e.base64=!1;_e.binary=!1;_e.dir=!1;_e.createFolders=!0;_e.date=null;_e.compression=null;_e.compressionOptions=null;_e.comment=null;_e.unixPermissions=null;_e.dosPermissions=null});var vs=E((G1,gu)=>{"use strict";var yr=F(),vr=se(),hy=16*1024;function fi(e){vr.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=yr.getTypeOf(i),t.isPaused||t._tickAndRepeat()},function(i){t.error(i)})}yr.inherits(fi,vr);fi.prototype.cleanUp=function(){vr.prototype.cleanUp.call(this),this.data=null};fi.prototype.resume=function(){return vr.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,yr.delay(this._tickAndRepeat,[],this)),!0):!1};fi.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(yr.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};fi.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=hy,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}})};gu.exports=fi});var xr=E((q1,bu)=>{"use strict";var gy=F();function my(){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 mu=my();function by(e,t,i,n){var r=mu,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 yy(e,t,i,n){var r=mu,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}bu.exports=function(t,i){if(typeof t=="undefined"||!t.length)return 0;var n=gy.getTypeOf(t)!=="string";return n?by(i|0,t,t.length,0):yy(i|0,t,t.length,0)}});var ws=E((W1,vu)=>{"use strict";var yu=se(),vy=xr(),xy=F();function xs(){yu.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}xy.inherits(xs,yu);xs.prototype.processChunk=function(e){this.streamInfo.crc32=vy(e.data,this.streamInfo.crc32||0),this.push(e)};vu.exports=xs});var wu=E((Y1,xu)=>{"use strict";var wy=F(),_s=se();function Es(e){_s.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}wy.inherits(Es,_s);Es.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}_s.prototype.processChunk.call(this,e)};xu.exports=Es});var wr=E((V1,Su)=>{"use strict";var _u=ci(),Eu=vs(),_y=ws(),Ss=wu();function As(e,t,i,n,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=n,this.compressedContent=r}As.prototype={getContentWorker:function(){var e=new Eu(_u.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Ss("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 Eu(_u.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};As.createWorkerFrom=function(e,t,i){return e.pipe(new _y).pipe(new Ss("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new Ss("compressedSize")).withStreamInfo("compression",t)};Su.exports=As});var ku=E((X1,Tu)=>{"use strict";var Ey=bs(),Sy=vs(),Cs=pi(),Ts=wr(),Au=se(),ks=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}};ks.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 Cs.Utf8EncodeWorker)),!r&&n&&(t=t.pipe(new Cs.Utf8DecodeWorker))}catch(a){t=new Au("error"),t.error(a)}return new Ey(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 Ts&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new Cs.Utf8EncodeWorker)),Ts.createWorkerFrom(i,e,t)},_decompressWorker:function(){return this._data instanceof Ts?this._data.getContentWorker():this._data instanceof Au?this._data:new Sy(this._data)}};var Cu=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Ay=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(_r=0;_r<Cu.length;_r++)ks.prototype[Cu[_r]]=Ay;var _r;Tu.exports=ks});var nt=E(J=>{"use strict";var Cy=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function Ty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}J.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)Ty(i,n)&&(e[n]=i[n])}}return e};J.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var ky={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}},Ly={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)}};J.setTyped=function(e){e?(J.Buf8=Uint8Array,J.Buf16=Uint16Array,J.Buf32=Int32Array,J.assign(J,ky)):(J.Buf8=Array,J.Buf16=Array,J.Buf32=Array,J.assign(J,Ly))};J.setTyped(Cy)});var Zu=E(mi=>{"use strict";var Ry=nt(),My=4,Lu=0,Ru=1,Iy=2;function gi(e){for(var t=e.length;--t>=0;)e[t]=0}var Oy=0,ju=1,Py=2,Dy=3,jy=258,Ds=29,hn=256,dn=hn+1+Ds,hi=30,js=19,zu=2*dn+1,Bt=15,Ls=16,zy=7,zs=256,Bu=16,Fu=17,Nu=18,Os=[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],Er=[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],By=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Hu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Fy=512,rt=new Array((dn+2)*2);gi(rt);var cn=new Array(hi*2);gi(cn);var un=new Array(Fy);gi(un);var pn=new Array(jy-Dy+1);gi(pn);var Bs=new Array(Ds);gi(Bs);var Sr=new Array(hi);gi(Sr);function Rs(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 $u,Uu,Gu;function Ms(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function qu(e){return e<256?un[e]:un[256+(e>>>7)]}function fn(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function ie(e,t,i){e.bi_valid>Ls-i?(e.bi_buf|=t<<e.bi_valid&65535,fn(e,e.bi_buf),e.bi_buf=t>>Ls-e.bi_valid,e.bi_valid+=i-Ls):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function Ie(e,t,i){ie(e,i[t*2],i[t*2+1])}function Wu(e,t){var i=0;do i|=e&1,e>>>=1,i<<=1;while(--t>0);return i>>>1}function Ny(e){e.bi_valid===16?(fn(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 Hy(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,p,u,v,h=0;for(p=0;p<=Bt;p++)e.bl_count[p]=0;for(i[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<zu;l++)c=e.heap[l],p=i[i[c*2+1]*2+1]+1,p>d&&(p=d,h++),i[c*2+1]=p,!(c>n)&&(e.bl_count[p]++,u=0,c>=o&&(u=s[c-o]),v=i[c*2],e.opt_len+=v*(p+u),a&&(e.static_len+=v*(r[c*2+1]+u)));if(h!==0){do{for(p=d-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[d]--,h-=2}while(h>0);for(p=d;p!==0;p--)for(c=e.bl_count[p];c!==0;)f=e.heap[--l],!(f>n)&&(i[f*2+1]!==p&&(e.opt_len+=(p-i[f*2+1])*i[f*2],i[f*2+1]=p),c--)}}function Yu(e,t,i){var n=new Array(Bt+1),r=0,a,s;for(a=1;a<=Bt;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]=Wu(n[o]++,o))}}function $y(){var e,t,i,n,r,a=new Array(Bt+1);for(i=0,n=0;n<Ds-1;n++)for(Bs[n]=i,e=0;e<1<<Os[n];e++)pn[i++]=n;for(pn[i-1]=n,r=0,n=0;n<16;n++)for(Sr[n]=r,e=0;e<1<<Er[n];e++)un[r++]=n;for(r>>=7;n<hi;n++)for(Sr[n]=r<<7,e=0;e<1<<Er[n]-7;e++)un[256+r++]=n;for(t=0;t<=Bt;t++)a[t]=0;for(e=0;e<=143;)rt[e*2+1]=8,e++,a[8]++;for(;e<=255;)rt[e*2+1]=9,e++,a[9]++;for(;e<=279;)rt[e*2+1]=7,e++,a[7]++;for(;e<=287;)rt[e*2+1]=8,e++,a[8]++;for(Yu(rt,dn+1,a),e=0;e<hi;e++)cn[e*2+1]=5,cn[e*2]=Wu(e,5);$u=new Rs(rt,Os,hn+1,dn,Bt),Uu=new Rs(cn,Er,0,hi,Bt),Gu=new Rs(new Array(0),By,0,js,zy)}function Vu(e){var t;for(t=0;t<dn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<hi;t++)e.dyn_dtree[t*2]=0;for(t=0;t<js;t++)e.bl_tree[t*2]=0;e.dyn_ltree[zs*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Xu(e){e.bi_valid>8?fn(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 Uy(e,t,i,n){Xu(e),n&&(fn(e,i),fn(e,~i)),Ry.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}function Mu(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 Is(e,t,i){for(var n=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&Mu(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!Mu(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function Iu(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?Ie(e,r,t):(s=pn[r],Ie(e,s+hn+1,t),o=Os[s],o!==0&&(r-=Bs[s],ie(e,r,o)),n--,s=qu(n),Ie(e,s,i),o=Er[s],o!==0&&(n-=Sr[s],ie(e,n,o)));while(a<e.last_lit);Ie(e,zs,t)}function Ps(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=zu,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--)Is(e,i,s);l=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Is(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++,Is(e,i,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Hy(e,t),Yu(i,d,e.bl_count)}function Ou(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[Bu*2]++):o<=10?e.bl_tree[Fu*2]++:e.bl_tree[Nu*2]++,o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4))}function Pu(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 Ie(e,a,e.bl_tree);while(--o!==0);else a!==0?(a!==r&&(Ie(e,a,e.bl_tree),o--),Ie(e,Bu,e.bl_tree),ie(e,o-3,2)):o<=10?(Ie(e,Fu,e.bl_tree),ie(e,o-3,3)):(Ie(e,Nu,e.bl_tree),ie(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 Gy(e){var t;for(Ou(e,e.dyn_ltree,e.l_desc.max_code),Ou(e,e.dyn_dtree,e.d_desc.max_code),Ps(e,e.bl_desc),t=js-1;t>=3&&e.bl_tree[Hu[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function qy(e,t,i,n){var r;for(ie(e,t-257,5),ie(e,i-1,5),ie(e,n-4,4),r=0;r<n;r++)ie(e,e.bl_tree[Hu[r]*2+1],3);Pu(e,e.dyn_ltree,t-1),Pu(e,e.dyn_dtree,i-1)}function Wy(e){var t=4093624447,i;for(i=0;i<=31;i++,t>>>=1)if(t&1&&e.dyn_ltree[i*2]!==0)return Lu;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Ru;for(i=32;i<hn;i++)if(e.dyn_ltree[i*2]!==0)return Ru;return Lu}var Du=!1;function Yy(e){Du||($y(),Du=!0),e.l_desc=new Ms(e.dyn_ltree,$u),e.d_desc=new Ms(e.dyn_dtree,Uu),e.bl_desc=new Ms(e.bl_tree,Gu),e.bi_buf=0,e.bi_valid=0,Vu(e)}function Ku(e,t,i,n){ie(e,(Oy<<1)+(n?1:0),3),Uy(e,t,i,!0)}function Vy(e){ie(e,ju<<1,3),Ie(e,zs,rt),Ny(e)}function Xy(e,t,i,n){var r,a,s=0;e.level>0?(e.strm.data_type===Iy&&(e.strm.data_type=Wy(e)),Ps(e,e.l_desc),Ps(e,e.d_desc),s=Gy(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?Ku(e,t,i,n):e.strategy===My||a===r?(ie(e,(ju<<1)+(n?1:0),3),Iu(e,rt,cn)):(ie(e,(Py<<1)+(n?1:0),3),qy(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Iu(e,e.dyn_ltree,e.dyn_dtree)),Vu(e),n&&Xu(e)}function Ky(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[(pn[i]+hn+1)*2]++,e.dyn_dtree[qu(t)*2]++),e.last_lit===e.lit_bufsize-1}mi._tr_init=Yy;mi._tr_stored_block=Ku;mi._tr_flush_block=Xy;mi._tr_tally=Ky;mi._tr_align=Vy});var Fs=E((J1,Ju)=>{"use strict";function Zy(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}Ju.exports=Zy});var Ns=E((Q1,Qu)=>{"use strict";function Jy(){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 Qy=Jy();function ev(e,t,i,n){var r=Qy,a=n+i;e^=-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}Qu.exports=ev});var Ar=E((eE,ep)=>{"use strict";ep.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 cp=E(De=>{"use strict";var Q=nt(),me=Zu(),rp=Fs(),bt=Ns(),tv=Ar(),$t=0,iv=1,nv=3,_t=4,tp=5,Pe=0,ip=1,be=-2,rv=-3,Hs=-5,av=-1,sv=1,Cr=2,ov=3,lv=4,cv=0,dv=2,Rr=8,uv=9,pv=15,fv=8,hv=29,gv=256,Us=gv+1+hv,mv=30,bv=19,yv=2*Us+1,vv=15,R=3,xt=258,Ee=xt+R+1,xv=32,Mr=42,Gs=69,Tr=73,kr=91,Lr=103,Ft=113,mn=666,W=1,bn=2,Nt=3,vi=4,wv=3;function wt(e,t){return e.msg=tv[t],t}function np(e){return(e<<1)-(e>4?9:0)}function vt(e){for(var t=e.length;--t>=0;)e[t]=0}function yt(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),i!==0&&(Q.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 V(e,t){me._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,yt(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function gn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function _v(e,t,i,n){var r=e.avail_in;return r>n&&(r=n),r===0?0:(e.avail_in-=r,Q.arraySet(t,e.input,e.next_in,r,i),e.state.wrap===1?e.adler=rp(e.adler,t,r,i):e.state.wrap===2&&(e.adler=bt(e.adler,t,r,i)),e.next_in+=r,e.total_in+=r,r)}function ap(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-Ee?e.strstart-(e.w_size-Ee):0,l=e.window,c=e.w_mask,f=e.prev,p=e.strstart+xt,u=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]!==u||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<p);if(a=xt-(p-n),n=p-xt,a>s){if(e.match_start=t,s=a,a>=o)break;u=l[n+s-1],v=l[n+s]}}while((t=f[t&c])>d&&--i!==0);return s<=e.lookahead?s:e.lookahead}function Ht(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-Ee)){Q.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=_v(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<Ee&&e.strm.avail_in!==0)}function Ev(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ht(e),e.lookahead===0&&t===$t)return W;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,V(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Ee&&(V(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===_t?(V(e,!0),e.strm.avail_out===0?Nt:vi):(e.strstart>e.block_start&&(V(e,!1),e.strm.avail_out===0),W)}function $s(e,t){for(var i,n;;){if(e.lookahead<Ee){if(Ht(e),e.lookahead<Ee&&t===$t)return W;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-Ee&&(e.match_length=ap(e,i)),e.match_length>=R)if(n=me._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=me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(V(e,!1),e.strm.avail_out===0))return W}return e.insert=e.strstart<R-1?e.strstart:R-1,t===_t?(V(e,!0),e.strm.avail_out===0?Nt:vi):e.last_lit&&(V(e,!1),e.strm.avail_out===0)?W:bn}function bi(e,t){for(var i,n,r;;){if(e.lookahead<Ee){if(Ht(e),e.lookahead<Ee&&t===$t)return W;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-Ee&&(e.match_length=ap(e,i),e.match_length<=5&&(e.strategy===sv||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=me._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&&(V(e,!1),e.strm.avail_out===0))return W}else if(e.match_available){if(n=me._tr_tally(e,0,e.window[e.strstart-1]),n&&V(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return W}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=me._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<R-1?e.strstart:R-1,t===_t?(V(e,!0),e.strm.avail_out===0?Nt:vi):e.last_lit&&(V(e,!1),e.strm.avail_out===0)?W:bn}function Sv(e,t){for(var i,n,r,a,s=e.window;;){if(e.lookahead<=xt){if(Ht(e),e.lookahead<=xt&&t===$t)return W;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+xt;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=xt-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=R?(i=me._tr_tally(e,1,e.match_length-R),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(V(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===_t?(V(e,!0),e.strm.avail_out===0?Nt:vi):e.last_lit&&(V(e,!1),e.strm.avail_out===0)?W:bn}function Av(e,t){for(var i;;){if(e.lookahead===0&&(Ht(e),e.lookahead===0)){if(t===$t)return W;break}if(e.match_length=0,i=me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(V(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===_t?(V(e,!0),e.strm.avail_out===0?Nt:vi):e.last_lit&&(V(e,!1),e.strm.avail_out===0)?W:bn}function Oe(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 yi;yi=[new Oe(0,0,0,0,Ev),new Oe(4,4,8,4,$s),new Oe(4,5,16,8,$s),new Oe(4,6,32,32,$s),new Oe(4,4,16,16,bi),new Oe(8,16,32,32,bi),new Oe(8,16,128,128,bi),new Oe(8,32,128,256,bi),new Oe(32,128,258,1024,bi),new Oe(32,258,258,4096,bi)];function Cv(e){e.window_size=2*e.w_size,vt(e.head),e.max_lazy_match=yi[e.level].max_lazy,e.good_match=yi[e.level].good_length,e.nice_match=yi[e.level].nice_length,e.max_chain_length=yi[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 Tv(){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=Rr,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 Q.Buf16(yv*2),this.dyn_dtree=new Q.Buf16((2*mv+1)*2),this.bl_tree=new Q.Buf16((2*bv+1)*2),vt(this.dyn_ltree),vt(this.dyn_dtree),vt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Q.Buf16(vv+1),this.heap=new Q.Buf16(2*Us+1),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Q.Buf16(2*Us+1),vt(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 sp(e){var t;return!e||!e.state?wt(e,be):(e.total_in=e.total_out=0,e.data_type=dv,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Mr:Ft,e.adler=t.wrap===2?0:1,t.last_flush=$t,me._tr_init(t),Pe)}function op(e){var t=sp(e);return t===Pe&&Cv(e.state),t}function kv(e,t){return!e||!e.state||e.state.wrap!==2?be:(e.state.gzhead=t,Pe)}function lp(e,t,i,n,r,a){if(!e)return be;var s=1;if(t===av&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>uv||i!==Rr||n<8||n>15||t<0||t>9||a<0||a>lv)return wt(e,be);n===8&&(n=9);var o=new Tv;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 Q.Buf8(o.w_size*2),o.head=new Q.Buf16(o.hash_size),o.prev=new Q.Buf16(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Q.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,op(e)}function Lv(e,t){return lp(e,t,Rr,pv,fv,cv)}function Rv(e,t){var i,n,r,a;if(!e||!e.state||t>tp||t<0)return e?wt(e,be):be;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===mn&&t!==_t)return wt(e,e.avail_out===0?Hs:be);if(n.strm=e,i=n.last_flush,n.last_flush=t,n.status===Mr)if(n.wrap===2)e.adler=0,M(n,31),M(n,139),M(n,8),n.gzhead?(M(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)),M(n,n.gzhead.time&255),M(n,n.gzhead.time>>8&255),M(n,n.gzhead.time>>16&255),M(n,n.gzhead.time>>24&255),M(n,n.level===9?2:n.strategy>=Cr||n.level<2?4:0),M(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(M(n,n.gzhead.extra.length&255),M(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=bt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Gs):(M(n,0),M(n,0),M(n,0),M(n,0),M(n,0),M(n,n.level===9?2:n.strategy>=Cr||n.level<2?4:0),M(n,wv),n.status=Ft);else{var s=Rr+(n.w_bits-8<<4)<<8,o=-1;n.strategy>=Cr||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,s|=o<<6,n.strstart!==0&&(s|=xv),s+=31-s%31,n.status=Ft,gn(n,s),n.strstart!==0&&(gn(n,e.adler>>>16),gn(n,e.adler&65535)),e.adler=1}if(n.status===Gs)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=bt(e.adler,n.pending_buf,n.pending-r,r)),yt(e),r=n.pending,n.pending===n.pending_buf_size));)M(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>r&&(e.adler=bt(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Tr)}else n.status=Tr;if(n.status===Tr)if(n.gzhead.name){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=bt(e.adler,n.pending_buf,n.pending-r,r)),yt(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,M(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=bt(e.adler,n.pending_buf,n.pending-r,r)),a===0&&(n.gzindex=0,n.status=kr)}else n.status=kr;if(n.status===kr)if(n.gzhead.comment){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=bt(e.adler,n.pending_buf,n.pending-r,r)),yt(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,M(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=bt(e.adler,n.pending_buf,n.pending-r,r)),a===0&&(n.status=Lr)}else n.status=Lr;if(n.status===Lr&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&yt(e),n.pending+2<=n.pending_buf_size&&(M(n,e.adler&255),M(n,e.adler>>8&255),e.adler=0,n.status=Ft)):n.status=Ft),n.pending!==0){if(yt(e),e.avail_out===0)return n.last_flush=-1,Pe}else if(e.avail_in===0&&np(t)<=np(i)&&t!==_t)return wt(e,Hs);if(n.status===mn&&e.avail_in!==0)return wt(e,Hs);if(e.avail_in!==0||n.lookahead!==0||t!==$t&&n.status!==mn){var d=n.strategy===Cr?Av(n,t):n.strategy===ov?Sv(n,t):yi[n.level].func(n,t);if((d===Nt||d===vi)&&(n.status=mn),d===W||d===Nt)return e.avail_out===0&&(n.last_flush=-1),Pe;if(d===bn&&(t===iv?me._tr_align(n):t!==tp&&(me._tr_stored_block(n,0,0,!1),t===nv&&(vt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),yt(e),e.avail_out===0))return n.last_flush=-1,Pe}return t!==_t?Pe:n.wrap<=0?ip:(n.wrap===2?(M(n,e.adler&255),M(n,e.adler>>8&255),M(n,e.adler>>16&255),M(n,e.adler>>24&255),M(n,e.total_in&255),M(n,e.total_in>>8&255),M(n,e.total_in>>16&255),M(n,e.total_in>>24&255)):(gn(n,e.adler>>>16),gn(n,e.adler&65535)),yt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Pe:ip)}function Mv(e){var t;return!e||!e.state?be:(t=e.state.status,t!==Mr&&t!==Gs&&t!==Tr&&t!==kr&&t!==Lr&&t!==Ft&&t!==mn?wt(e,be):(e.state=null,t===Ft?wt(e,rv):Pe))}function Iv(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!==Mr||n.lookahead))return be;for(s===1&&(e.adler=rp(e.adler,t,i,0)),n.wrap=0,i>=n.w_size&&(s===0&&(vt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new Q.Buf8(n.w_size),Q.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,Ht(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,Ht(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,Pe}De.deflateInit=Lv;De.deflateInit2=lp;De.deflateReset=op;De.deflateResetKeep=sp;De.deflateSetHeader=kv;De.deflate=Rv;De.deflateEnd=Mv;De.deflateSetDictionary=Iv;De.deflateInfo="pako deflate (from Nodeca project)"});var qs=E(xi=>{"use strict";var Ir=nt(),dp=!0,up=!0;try{String.fromCharCode.apply(null,[0])}catch{dp=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{up=!1}var yn=new Ir.Buf8(256);for(at=0;at<256;at++)yn[at]=at>=252?6:at>=248?5:at>=240?4:at>=224?3:at>=192?2:1;var at;yn[254]=yn[254]=1;xi.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 Ir.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 pp(e,t){if(t<65534&&(e.subarray&&up||!e.subarray&&dp))return String.fromCharCode.apply(null,Ir.shrinkBuf(e,t));for(var i="",n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i}xi.buf2binstring=function(e){return pp(e,e.length)};xi.binstring2buf=function(e){for(var t=new Ir.Buf8(e.length),i=0,n=t.length;i<n;i++)t[i]=e.charCodeAt(i);return t};xi.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=yn[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 pp(o,n)};xi.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+yn[e[i]]>t?i:t}});var Ws=E((nE,fp)=>{"use strict";function Ov(){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}fp.exports=Ov});var bp=E(wn=>{"use strict";var vn=cp(),xn=nt(),Vs=qs(),Xs=Ar(),Pv=Ws(),mp=Object.prototype.toString,Dv=0,Ys=4,wi=0,hp=1,gp=2,jv=-1,zv=0,Bv=8;function Ut(e){if(!(this instanceof Ut))return new Ut(e);this.options=xn.assign({level:jv,method:Bv,chunkSize:16384,windowBits:15,memLevel:8,strategy:zv,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 Pv,this.strm.avail_out=0;var i=vn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==wi)throw new Error(Xs[i]);if(t.header&&vn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Vs.string2buf(t.dictionary):mp.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,i=vn.deflateSetDictionary(this.strm,n),i!==wi)throw new Error(Xs[i]);this._dict_set=!0}}Ut.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?Ys:Dv,typeof e=="string"?i.input=Vs.string2buf(e):mp.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 xn.Buf8(n),i.next_out=0,i.avail_out=n),r=vn.deflate(i,a),r!==hp&&r!==wi)return this.onEnd(r),this.ended=!0,!1;(i.avail_out===0||i.avail_in===0&&(a===Ys||a===gp))&&(this.options.to==="string"?this.onData(Vs.buf2binstring(xn.shrinkBuf(i.output,i.next_out))):this.onData(xn.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||i.avail_out===0)&&r!==hp);return a===Ys?(r=vn.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===wi):(a===gp&&(this.onEnd(wi),i.avail_out=0),!0)};Ut.prototype.onData=function(e){this.chunks.push(e)};Ut.prototype.onEnd=function(e){e===wi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=xn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ks(e,t){var i=new Ut(t);if(i.push(e,!0),i.err)throw i.msg||Xs[i.err];return i.result}function Fv(e,t){return t=t||{},t.raw=!0,Ks(e,t)}function Nv(e,t){return t=t||{},t.gzip=!0,Ks(e,t)}wn.Deflate=Ut;wn.deflate=Ks;wn.deflateRaw=Fv;wn.gzip=Nv});var vp=E((aE,yp)=>{"use strict";var Or=30,Hv=12;yp.exports=function(t,i){var n,r,a,s,o,d,l,c,f,p,u,v,h,x,m,y,b,g,w,C,S,A,T,L,_;n=t.state,r=t.next_in,L=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,p=n.wnext,u=n.window,v=n.hold,h=n.bits,x=n.lencode,m=n.distcode,y=(1<<n.lenbits)-1,b=(1<<n.distbits)-1;e:do{h<15&&(v+=L[r++]<<h,h+=8,v+=L[r++]<<h,h+=8),g=x[v&y];t:for(;;){if(w=g>>>24,v>>>=w,h-=w,w=g>>>16&255,w===0)_[s++]=g&65535;else if(w&16){C=g&65535,w&=15,w&&(h<w&&(v+=L[r++]<<h,h+=8),C+=v&(1<<w)-1,v>>>=w,h-=w),h<15&&(v+=L[r++]<<h,h+=8,v+=L[r++]<<h,h+=8),g=m[v&b];i:for(;;){if(w=g>>>24,v>>>=w,h-=w,w=g>>>16&255,w&16){if(S=g&65535,w&=15,h<w&&(v+=L[r++]<<h,h+=8,h<w&&(v+=L[r++]<<h,h+=8)),S+=v&(1<<w)-1,S>l){t.msg="invalid distance too far back",n.mode=Or;break e}if(v>>>=w,h-=w,w=s-o,S>w){if(w=S-w,w>f&&n.sane){t.msg="invalid distance too far back",n.mode=Or;break e}if(A=0,T=u,p===0){if(A+=c-w,w<C){C-=w;do _[s++]=u[A++];while(--w);A=s-S,T=_}}else if(p<w){if(A+=c+p-w,w-=p,w<C){C-=w;do _[s++]=u[A++];while(--w);if(A=0,p<C){w=p,C-=w;do _[s++]=u[A++];while(--w);A=s-S,T=_}}}else if(A+=p-w,w<C){C-=w;do _[s++]=u[A++];while(--w);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((w&64)===0){g=m[(g&65535)+(v&(1<<w)-1)];continue i}else{t.msg="invalid distance code",n.mode=Or;break e}break}}else if((w&64)===0){g=x[(g&65535)+(v&(1<<w)-1)];continue t}else if(w&32){n.mode=Hv;break e}else{t.msg="invalid literal/length code",n.mode=Or;break e}break}}while(r<a&&s<d);C=h>>3,r-=C,h-=C<<3,v&=(1<<h)-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=h}});var Cp=E((sE,Ap)=>{"use strict";var xp=nt(),_i=15,wp=852,_p=592,Ep=0,Zs=1,Sp=2,$v=[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],Uv=[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],Gv=[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],qv=[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];Ap.exports=function(t,i,n,r,a,s,o,d){var l=d.bits,c=0,f=0,p=0,u=0,v=0,h=0,x=0,m=0,y=0,b=0,g,w,C,S,A,T=null,L=0,_,O=new xp.Buf16(_i+1),z=new xp.Buf16(_i+1),le=null,te=0,ne,xe,Ne;for(c=0;c<=_i;c++)O[c]=0;for(f=0;f<r;f++)O[i[n+f]]++;for(v=l,u=_i;u>=1&&O[u]===0;u--);if(v>u&&(v=u),u===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,d.bits=1,0;for(p=1;p<u&&O[p]===0;p++);for(v<p&&(v=p),m=1,c=1;c<=_i;c++)if(m<<=1,m-=O[c],m<0)return-1;if(m>0&&(t===Ep||u!==1))return-1;for(z[1]=0,c=1;c<_i;c++)z[c+1]=z[c]+O[c];for(f=0;f<r;f++)i[n+f]!==0&&(o[z[i[n+f]]++]=f);if(t===Ep?(T=le=o,_=19):t===Zs?(T=$v,L-=257,le=Uv,te-=257,_=256):(T=Gv,le=qv,_=-1),b=0,f=0,c=p,A=s,h=v,x=0,C=-1,y=1<<v,S=y-1,t===Zs&&y>wp||t===Sp&&y>_p)return 1;for(;;){ne=c-x,o[f]<_?(xe=0,Ne=o[f]):o[f]>_?(xe=le[te+o[f]],Ne=T[L+o[f]]):(xe=96,Ne=0),g=1<<c-x,w=1<<h,p=w;do w-=g,a[A+(b>>x)+w]=ne<<24|xe<<16|Ne|0;while(w!==0);for(g=1<<c-1;b&g;)g>>=1;if(g!==0?(b&=g-1,b+=g):b=0,f++,--O[c]===0){if(c===u)break;c=i[n+o[f]]}if(c>v&&(b&S)!==C){for(x===0&&(x=v),A+=p,h=c-x,m=1<<h;h+x<u&&(m-=O[h+x],!(m<=0));)h++,m<<=1;if(y+=1<<h,t===Zs&&y>wp||t===Sp&&y>_p)return 1;C=b&S,a[C]=v<<24|h<<16|A-s|0}}return b!==0&&(a[A+b]=c-x<<24|64<<16|0),d.bits=v,0}});var lf=E(Se=>{"use strict";var oe=nt(),no=Fs(),je=Ns(),Wv=vp(),_n=Cp(),Yv=0,Jp=1,Qp=2,Tp=4,Vv=5,Pr=6,Gt=0,Xv=1,Kv=2,ye=-2,ef=-3,ro=-4,Zv=-5,kp=8,tf=1,Lp=2,Rp=3,Mp=4,Ip=5,Op=6,Pp=7,Dp=8,jp=9,zp=10,zr=11,st=12,Js=13,Bp=14,Qs=15,Fp=16,Np=17,Hp=18,$p=19,Dr=20,jr=21,Up=22,Gp=23,qp=24,Wp=25,Yp=26,eo=27,Vp=28,Xp=29,j=30,ao=31,Jv=32,Qv=852,e0=592,t0=15,i0=t0;function Kp(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function n0(){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 oe.Buf16(320),this.work=new oe.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function nf(e){var t;return!e||!e.state?ye:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=tf,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new oe.Buf32(Qv),t.distcode=t.distdyn=new oe.Buf32(e0),t.sane=1,t.back=-1,Gt)}function rf(e){var t;return!e||!e.state?ye:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,nf(e))}function af(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))?ye:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,rf(e))}function sf(e,t){var i,n;return e?(n=new n0,e.state=n,n.window=null,i=af(e,t),i!==Gt&&(e.state=null),i):ye}function r0(e){return sf(e,i0)}var Zp=!0,to,io;function a0(e){if(Zp){var t;for(to=new oe.Buf32(512),io=new oe.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(_n(Jp,e.lens,0,288,to,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;_n(Qp,e.lens,0,32,io,0,e.work,{bits:5}),Zp=!1}e.lencode=to,e.lenbits=9,e.distcode=io,e.distbits=5}function of(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 oe.Buf8(a.wsize)),n>=a.wsize?(oe.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),oe.arraySet(a.window,t,i-n,r,a.wnext),n-=r,n?(oe.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 s0(e,t){var i,n,r,a,s,o,d,l,c,f,p,u,v,h,x=0,m,y,b,g,w,C,S,A,T=new oe.Buf8(4),L,_,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 ye;i=e.state,i.mode===st&&(i.mode=Js),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,p=d,A=Gt;e:for(;;)switch(i.mode){case tf:if(i.wrap===0){i.mode=Js;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=je(i.check,T,2,0),l=0,c=0,i.mode=Lp;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=j;break}if((l&15)!==kp){e.msg="unknown compression method",i.mode=j;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=j;break}i.dmax=1<<S,e.adler=i.check=1,i.mode=l&512?zp:st,l=0,c=0;break;case Lp:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.flags=l,(i.flags&255)!==kp){e.msg="unknown compression method",i.mode=j;break}if(i.flags&57344){e.msg="unknown header flags set",i.mode=j;break}i.head&&(i.head.text=l>>8&1),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,i.check=je(i.check,T,2,0)),l=0,c=0,i.mode=Rp;case Rp: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=je(i.check,T,4,0)),l=0,c=0,i.mode=Mp;case Mp: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=je(i.check,T,2,0)),l=0,c=0,i.mode=Ip;case Ip: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=je(i.check,T,2,0)),l=0,c=0}else i.head&&(i.head.extra=null);i.mode=Op;case Op:if(i.flags&1024&&(u=i.length,u>o&&(u=o),u&&(i.head&&(S=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),oe.arraySet(i.head.extra,n,a,u,S)),i.flags&512&&(i.check=je(i.check,n,u,a)),o-=u,a+=u,i.length-=u),i.length))break e;i.length=0,i.mode=Pp;case Pp:if(i.flags&2048){if(o===0)break e;u=0;do S=n[a+u++],i.head&&S&&i.length<65536&&(i.head.name+=String.fromCharCode(S));while(S&&u<o);if(i.flags&512&&(i.check=je(i.check,n,u,a)),o-=u,a+=u,S)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=Dp;case Dp:if(i.flags&4096){if(o===0)break e;u=0;do S=n[a+u++],i.head&&S&&i.length<65536&&(i.head.comment+=String.fromCharCode(S));while(S&&u<o);if(i.flags&512&&(i.check=je(i.check,n,u,a)),o-=u,a+=u,S)break e}else i.head&&(i.head.comment=null);i.mode=jp;case jp: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=j;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=st;break;case zp:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}e.adler=i.check=Kp(l),l=0,c=0,i.mode=zr;case zr: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,Kv;e.adler=i.check=1,i.mode=st;case st:if(t===Vv||t===Pr)break e;case Js:if(i.last){l>>>=c&7,c-=c&7,i.mode=eo;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=Bp;break;case 1:if(a0(i),i.mode=Dr,t===Pr){l>>>=2,c-=2;break e}break;case 2:i.mode=Np;break;case 3:e.msg="invalid block type",i.mode=j}l>>>=2,c-=2;break;case Bp: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=j;break}if(i.length=l&65535,l=0,c=0,i.mode=Qs,t===Pr)break e;case Qs:i.mode=Fp;case Fp:if(u=i.length,u){if(u>o&&(u=o),u>d&&(u=d),u===0)break e;oe.arraySet(r,n,a,u,s),o-=u,a+=u,d-=u,s+=u,i.length-=u;break}i.mode=st;break;case Np: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=j;break}i.have=0,i.mode=Hp;case Hp: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,L={bits:i.lenbits},A=_n(Yv,i.lens,0,19,i.lencode,0,i.work,L),i.lenbits=L.bits,A){e.msg="invalid code lengths set",i.mode=j;break}i.have=0,i.mode=$p;case $p:for(;i.have<i.nlen+i.ndist;){for(;x=i.lencode[l&(1<<i.lenbits)-1],m=x>>>24,y=x>>>16&255,b=x&65535,!(m<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(b<16)l>>>=m,c-=m,i.lens[i.have++]=b;else{if(b===16){for(_=m+2;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l>>>=m,c-=m,i.have===0){e.msg="invalid bit length repeat",i.mode=j;break}S=i.lens[i.have-1],u=3+(l&3),l>>>=2,c-=2}else if(b===17){for(_=m+3;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=m,c-=m,S=0,u=3+(l&7),l>>>=3,c-=3}else{for(_=m+7;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=m,c-=m,S=0,u=11+(l&127),l>>>=7,c-=7}if(i.have+u>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=j;break}for(;u--;)i.lens[i.have++]=S}}if(i.mode===j)break;if(i.lens[256]===0){e.msg="invalid code -- missing end-of-block",i.mode=j;break}if(i.lenbits=9,L={bits:i.lenbits},A=_n(Jp,i.lens,0,i.nlen,i.lencode,0,i.work,L),i.lenbits=L.bits,A){e.msg="invalid literal/lengths set",i.mode=j;break}if(i.distbits=6,i.distcode=i.distdyn,L={bits:i.distbits},A=_n(Qp,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,L),i.distbits=L.bits,A){e.msg="invalid distances set",i.mode=j;break}if(i.mode=Dr,t===Pr)break e;case Dr:i.mode=jr;case jr: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,Wv(e,p),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===st&&(i.back=-1);break}for(i.back=0;x=i.lencode[l&(1<<i.lenbits)-1],m=x>>>24,y=x>>>16&255,b=x&65535,!(m<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(y&&(y&240)===0){for(g=m,w=y,C=b;x=i.lencode[C+((l&(1<<g+w)-1)>>g)],m=x>>>24,y=x>>>16&255,b=x&65535,!(g+m<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,i.back+=g}if(l>>>=m,c-=m,i.back+=m,i.length=b,y===0){i.mode=Yp;break}if(y&32){i.back=-1,i.mode=st;break}if(y&64){e.msg="invalid literal/length code",i.mode=j;break}i.extra=y&15,i.mode=Up;case Up: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=Gp;case Gp:for(;x=i.distcode[l&(1<<i.distbits)-1],m=x>>>24,y=x>>>16&255,b=x&65535,!(m<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((y&240)===0){for(g=m,w=y,C=b;x=i.distcode[C+((l&(1<<g+w)-1)>>g)],m=x>>>24,y=x>>>16&255,b=x&65535,!(g+m<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,i.back+=g}if(l>>>=m,c-=m,i.back+=m,y&64){e.msg="invalid distance code",i.mode=j;break}i.offset=b,i.extra=y&15,i.mode=qp;case qp: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=j;break}i.mode=Wp;case Wp:if(d===0)break e;if(u=p-d,i.offset>u){if(u=i.offset-u,u>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=j;break}u>i.wnext?(u-=i.wnext,v=i.wsize-u):v=i.wnext-u,u>i.length&&(u=i.length),h=i.window}else h=r,v=s-i.offset,u=i.length;u>d&&(u=d),d-=u,i.length-=u;do r[s++]=h[v++];while(--u);i.length===0&&(i.mode=jr);break;case Yp:if(d===0)break e;r[s++]=i.length,d--,i.mode=jr;break;case eo:if(i.wrap){for(;c<32;){if(o===0)break e;o--,l|=n[a++]<<c,c+=8}if(p-=d,e.total_out+=p,i.total+=p,p&&(e.adler=i.check=i.flags?je(i.check,r,p,s-p):no(i.check,r,p,s-p)),p=d,(i.flags?l:Kp(l))!==i.check){e.msg="incorrect data check",i.mode=j;break}l=0,c=0}i.mode=Vp;case Vp: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=j;break}l=0,c=0}i.mode=Xp;case Xp:A=Xv;break e;case j:A=ef;break e;case ao:return ro;case Jv:default:return ye}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||p!==e.avail_out&&i.mode<j&&(i.mode<eo||t!==Tp))&&of(e,e.output,e.next_out,p-e.avail_out)?(i.mode=ao,ro):(f-=e.avail_in,p-=e.avail_out,e.total_in+=f,e.total_out+=p,i.total+=p,i.wrap&&p&&(e.adler=i.check=i.flags?je(i.check,r,p,e.next_out-p):no(i.check,r,p,e.next_out-p)),e.data_type=i.bits+(i.last?64:0)+(i.mode===st?128:0)+(i.mode===Dr||i.mode===Qs?256:0),(f===0&&p===0||t===Tp)&&A===Gt&&(A=Zv),A)}function o0(e){if(!e||!e.state)return ye;var t=e.state;return t.window&&(t.window=null),e.state=null,Gt}function l0(e,t){var i;return!e||!e.state||(i=e.state,(i.wrap&2)===0)?ye:(i.head=t,t.done=!1,Gt)}function c0(e,t){var i=t.length,n,r,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==zr)?ye:n.mode===zr&&(r=1,r=no(r,t,i,0),r!==n.check)?ef:(a=of(e,t,i,i),a?(n.mode=ao,ro):(n.havedict=1,Gt))}Se.inflateReset=rf;Se.inflateReset2=af;Se.inflateResetKeep=nf;Se.inflateInit=r0;Se.inflateInit2=sf;Se.inflate=s0;Se.inflateEnd=o0;Se.inflateGetHeader=l0;Se.inflateSetDictionary=c0;Se.inflateInfo="pako inflate (from Nodeca project)"});var so=E((lE,cf)=>{"use strict";cf.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 uf=E((cE,df)=>{"use strict";function d0(){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}df.exports=d0});var ff=E(Sn=>{"use strict";var Ei=lf(),En=nt(),Br=qs(),H=so(),oo=Ar(),u0=Ws(),p0=uf(),pf=Object.prototype.toString;function qt(e){if(!(this instanceof qt))return new qt(e);this.options=En.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 u0,this.strm.avail_out=0;var i=Ei.inflateInit2(this.strm,t.windowBits);if(i!==H.Z_OK)throw new Error(oo[i]);if(this.header=new p0,Ei.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Br.string2buf(t.dictionary):pf.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=Ei.inflateSetDictionary(this.strm,t.dictionary),i!==H.Z_OK)))throw new Error(oo[i])}qt.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?H.Z_FINISH:H.Z_NO_FLUSH,typeof e=="string"?i.input=Br.binstring2buf(e):pf.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 En.Buf8(n),i.next_out=0,i.avail_out=n),a=Ei.inflate(i,H.Z_NO_FLUSH),a===H.Z_NEED_DICT&&r&&(a=Ei.inflateSetDictionary(this.strm,r)),a===H.Z_BUF_ERROR&&c===!0&&(a=H.Z_OK,c=!1),a!==H.Z_STREAM_END&&a!==H.Z_OK)return this.onEnd(a),this.ended=!0,!1;i.next_out&&(i.avail_out===0||a===H.Z_STREAM_END||i.avail_in===0&&(s===H.Z_FINISH||s===H.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=Br.utf8border(i.output,i.next_out),d=i.next_out-o,l=Br.buf2string(i.output,o),i.next_out=d,i.avail_out=n-d,d&&En.arraySet(i.output,i.output,o,d,0),this.onData(l)):this.onData(En.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!==H.Z_STREAM_END);return a===H.Z_STREAM_END&&(s=H.Z_FINISH),s===H.Z_FINISH?(a=Ei.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===H.Z_OK):(s===H.Z_SYNC_FLUSH&&(this.onEnd(H.Z_OK),i.avail_out=0),!0)};qt.prototype.onData=function(e){this.chunks.push(e)};qt.prototype.onEnd=function(e){e===H.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=En.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function lo(e,t){var i=new qt(t);if(i.push(e,!0),i.err)throw i.msg||oo[i.err];return i.result}function f0(e,t){return t=t||{},t.raw=!0,lo(e,t)}Sn.Inflate=qt;Sn.inflate=lo;Sn.inflateRaw=f0;Sn.ungzip=lo});var mf=E((uE,gf)=>{"use strict";var h0=nt().assign,g0=bp(),m0=ff(),b0=so(),hf={};h0(hf,g0,m0,b0);gf.exports=hf});var yf=E(Nr=>{"use strict";var y0=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",v0=mf(),bf=F(),Fr=se(),x0=y0?"uint8array":"array";Nr.magic="\b\0";function Wt(e,t){Fr.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}bf.inherits(Wt,Fr);Wt.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(bf.transformTo(x0,e.data),!1)};Wt.prototype.flush=function(){Fr.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};Wt.prototype.cleanUp=function(){Fr.prototype.cleanUp.call(this),this._pako=null};Wt.prototype._createPako=function(){this._pako=new v0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};Nr.compressWorker=function(e){return new Wt("Deflate",e)};Nr.uncompressWorker=function(){return new Wt("Inflate",{})}});var uo=E(co=>{"use strict";var vf=se();co.STORE={magic:"\0\0",compressWorker:function(){return new vf("STORE compression")},uncompressWorker:function(){return new vf("STORE decompression")}};co.DEFLATE=yf()});var po=E(Yt=>{"use strict";Yt.LOCAL_FILE_HEADER="PK";Yt.CENTRAL_FILE_HEADER="PK";Yt.CENTRAL_DIRECTORY_END="PK";Yt.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";Yt.ZIP64_CENTRAL_DIRECTORY_END="PK";Yt.DATA_DESCRIPTOR="PK\x07\b"});var Ef=E((gE,_f)=>{"use strict";var Si=F(),Ai=se(),fo=pi(),xf=xr(),Hr=po(),P=function(e,t){var i="",n;for(n=0;n<t;n++)i+=String.fromCharCode(e&255),e=e>>>8;return i},w0=function(e,t){var i=e;return e||(i=t?16893:33204),(i&65535)<<16},_0=function(e){return(e||0)&63},wf=function(e,t,i,n,r,a){var s=e.file,o=e.compression,d=a!==fo.utf8encode,l=Si.transformTo("string",a(s.name)),c=Si.transformTo("string",fo.utf8encode(s.name)),f=s.comment,p=Si.transformTo("string",a(f)),u=Si.transformTo("string",fo.utf8encode(f)),v=c.length!==s.name.length,h=u.length!==f.length,x,m,y="",b="",g="",w=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||h)&&(A|=2048);var T=0,L=0;w&&(T|=16),r==="UNIX"?(L=798,T|=w0(s.unixPermissions,w)):(L=20,T|=_0(s.dosPermissions,w)),x=C.getUTCHours(),x=x<<6,x=x|C.getUTCMinutes(),x=x<<5,x=x|C.getUTCSeconds()/2,m=C.getUTCFullYear()-1980,m=m<<4,m=m|C.getUTCMonth()+1,m=m<<5,m=m|C.getUTCDate(),v&&(b=P(1,1)+P(xf(l),4)+c,y+="up"+P(b.length,2)+b),h&&(g=P(1,1)+P(xf(p),4)+u,y+="uc"+P(g.length,2)+g);var _="";_+=`
2
+ \0`,_+=P(A,2),_+=o.magic,_+=P(x,2),_+=P(m,2),_+=P(S.crc32,4),_+=P(S.compressedSize,4),_+=P(S.uncompressedSize,4),_+=P(l.length,2),_+=P(y.length,2);var O=Hr.LOCAL_FILE_HEADER+_+l+y,z=Hr.CENTRAL_FILE_HEADER+P(L,2)+_+P(p.length,2)+"\0\0\0\0"+P(T,4)+P(n,4)+l+y+p;return{fileRecord:O,dirRecord:z}},E0=function(e,t,i,n,r){var a="",s=Si.transformTo("string",r(n));return a=Hr.CENTRAL_DIRECTORY_END+"\0\0\0\0"+P(e,2)+P(e,2)+P(t,4)+P(i,4)+P(s.length,2)+s,a},S0=function(e){var t="";return t=Hr.DATA_DESCRIPTOR+P(e.crc32,4)+P(e.compressedSize,4)+P(e.uncompressedSize,4),t};function Ae(e,t,i,n){Ai.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=[]}Si.inherits(Ae,Ai);Ae.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,Ai.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-n-1))/i:100}}))};Ae.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var i=wf(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0};Ae.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,i=wf(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:S0(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};Ae.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=E0(this.dirRecords.length,i,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})};Ae.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};Ae.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};Ae.prototype.resume=function(){if(!Ai.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};Ae.prototype.error=function(e){var t=this._sources;if(!Ai.prototype.error.call(this,e))return!1;for(var i=0;i<t.length;i++)try{t[i].error(e)}catch{}return!0};Ae.prototype.lock=function(){Ai.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};_f.exports=Ae});var Af=E(Sf=>{"use strict";var A0=uo(),C0=Ef(),T0=function(e,t){var i=e||t,n=A0[i];if(!n)throw new Error(i+" is not a valid compression method !");return n};Sf.generateWorker=function(e,t,i){var n=new C0(t.streamFiles,i,t.platform,t.encodeFileName),r=0;try{e.forEach(function(a,s){r++;var o=T0(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 Tf=E((bE,Cf)=>{"use strict";var k0=F(),$r=se();function An(e,t){$r.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}k0.inherits(An,$r);An.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()})};An.prototype.pause=function(){return $r.prototype.pause.call(this)?(this._stream.pause(),!0):!1};An.prototype.resume=function(){return $r.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};Cf.exports=An});var zf=E((yE,jf)=>{"use strict";var L0=pi(),Cn=F(),Mf=se(),R0=bs(),If=ys(),kf=wr(),M0=ku(),I0=Af(),Lf=en(),O0=Tf(),Of=function(e,t,i){var n=Cn.getTypeOf(t),r,a=Cn.extend(i||{},If);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=Pf(e)),a.createFolders&&(r=P0(e))&&Df.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 kf&&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 kf||t instanceof Mf?d=t:Lf.isNode&&Lf.isStream(t)?d=new O0(e,t):d=Cn.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new M0(e,d,a);this.files[e]=l},P0=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},Pf=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},Df=function(e,t){return t=typeof t!="undefined"?t:If.createFolders,e=Pf(e),this.files[e]||Of.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function Rf(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var D0={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(Rf(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,Of.call(this,e,t,i);return this},folder:function(e){if(!e)return this;if(Rf(e))return this.filter(function(r,a){return a.dir&&e.test(r)});var t=this.root+e,i=Df.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=Cn.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:L0.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.");Cn.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=I0.generateWorker(this,i,n)}catch(r){t=new Mf("error"),t.error(r)}return new R0(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)}};jf.exports=D0});var ho=E((vE,Ff)=>{"use strict";var j0=F();function Bf(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}Bf.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 j0.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))}};Ff.exports=Bf});var go=E((xE,Hf)=>{"use strict";var Nf=ho(),z0=F();function Ci(e){Nf.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}z0.inherits(Ci,Nf);Ci.prototype.byteAt=function(e){return this.data[this.zero+e]};Ci.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};Ci.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]};Ci.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};Hf.exports=Ci});var Gf=E((wE,Uf)=>{"use strict";var $f=ho(),B0=F();function Ti(e){$f.call(this,e)}B0.inherits(Ti,$f);Ti.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};Ti.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};Ti.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};Ti.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};Uf.exports=Ti});var bo=E((_E,Wf)=>{"use strict";var qf=go(),F0=F();function mo(e){qf.call(this,e)}F0.inherits(mo,qf);mo.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};Wf.exports=mo});var Xf=E((EE,Vf)=>{"use strict";var Yf=bo(),N0=F();function yo(e){Yf.call(this,e)}N0.inherits(yo,Yf);yo.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};Vf.exports=yo});var vo=E((SE,Zf)=>{"use strict";var Ur=F(),Kf=tt(),H0=go(),$0=Gf(),U0=Xf(),G0=bo();Zf.exports=function(e){var t=Ur.getTypeOf(e);return Ur.checkSupport(t),t==="string"&&!Kf.uint8array?new $0(e):t==="nodebuffer"?new U0(e):Kf.uint8array?new G0(Ur.transformTo("uint8array",e)):new H0(Ur.transformTo("array",e))}});var th=E((AE,eh)=>{"use strict";var xo=vo(),Et=F(),q0=wr(),Jf=xr(),Gr=pi(),qr=uo(),W0=tt(),Y0=0,V0=3,X0=function(e){for(var t in qr)if(Object.prototype.hasOwnProperty.call(qr,t)&&qr[t].magic===e)return qr[t];return null};function Qf(e,t){this.options=e,this.loadOptions=t}Qf.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=X0(this.compressionMethod),t===null)throw new Error("Corrupted zip : compression "+Et.pretty(this.compressionMethod)+" unknown (inner file : "+Et.transformTo("string",this.fileName)+")");this.decompressed=new q0(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===Y0&&(this.dosPermissions=this.externalFileAttributes&63),e===V0&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=xo(this.extraFields[1].value);this.uncompressedSize===Et.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===Et.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===Et.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===Et.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=W0.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Gr.utf8decode(this.fileName),this.fileCommentStr=Gr.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var i=Et.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var n=this.findExtraFieldUnicodeComment();if(n!==null)this.fileCommentStr=n;else{var r=Et.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=xo(e.value);return t.readInt(1)!==1||Jf(this.fileName)!==t.readInt(4)?null:Gr.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=xo(e.value);return t.readInt(1)!==1||Jf(this.fileComment)!==t.readInt(4)?null:Gr.utf8decode(t.readData(e.length-5))}return null}};eh.exports=Qf});var rh=E((CE,nh)=>{"use strict";var K0=vo(),ot=F(),Ce=po(),Z0=th(),J0=tt();function ih(e){this.files=[],this.loadOptions=e}ih.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 ("+ot.pretty(t)+", expected "+ot.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=J0.uint8array?"uint8array":"array",i=ot.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(Ce.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(Ce.CENTRAL_FILE_HEADER);)e=new Z0({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(Ce.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,Ce.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(Ce.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===ot.MAX_VALUE_16BITS||this.diskWithCentralDirStart===ot.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===ot.MAX_VALUE_16BITS||this.centralDirRecords===ot.MAX_VALUE_16BITS||this.centralDirSize===ot.MAX_VALUE_32BITS||this.centralDirOffset===ot.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(Ce.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(Ce.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Ce.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Ce.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(Ce.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,Ce.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=K0(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};nh.exports=ih});var oh=E((TE,sh)=>{"use strict";var wo=F(),Wr=ci(),Q0=pi(),ex=rh(),tx=ws(),ah=en();function ix(e){return new Wr.Promise(function(t,i){var n=e.decompressed.getContentWorker().pipe(new tx);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()})}sh.exports=function(e,t){var i=this;return t=wo.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:Q0.utf8decode}),ah.isNode&&ah.isStream(e)?Wr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):wo.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(n){var r=new ex(t);return r.load(n),r}).then(function(r){var a=[Wr.Promise.resolve(r)],s=r.files;if(t.checkCRC32)for(var o=0;o<s.length;o++)a.push(ix(s[o]));return Wr.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=wo.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 ch=E((kE,lh)=>{"use strict";function ve(){if(!(this instanceof ve))return new ve;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 ve;for(var t in this)typeof this[t]!="function"&&(e[t]=this[t]);return e}}ve.prototype=zf();ve.prototype.loadAsync=oh();ve.support=tt();ve.defaults=ys();ve.version="3.10.1";ve.loadAsync=function(e,t){return new ve().loadAsync(e,t)};ve.external=ci();lh.exports=ve});var gh={};fc(gh,{AssetEditorModal:()=>ko});var ko,Lo=Ge(()=>{"use strict";ko=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
+ <div class="asset-editor-card">
4
+ <div class="asset-editor-header">
5
+ <div>
6
+ <div class="asset-editor-title">Edit Asset: ${t}</div>
7
+ <div class="asset-editor-subtitle">Current: ${i||"None"}</div>
8
+ </div>
9
+ <button class="asset-editor-close" data-modal-close>\xD7</button>
10
+ </div>
11
+
12
+ <div class="asset-editor-tabs">
13
+ <button class="asset-editor-tab active" data-tab="library">\u{1F4DA} Library</button>
14
+ <button class="asset-editor-tab" data-tab="ai">\u2728 AI Edit</button>
15
+ <button class="asset-editor-tab" data-tab="upload">\u{1F4E4} Upload</button>
16
+ </div>
17
+
18
+ <div class="asset-editor-body">
19
+ <div class="asset-editor-tab-panel active" data-tab-panel="library">
20
+ <p class="asset-editor-hint">Library tab - Select from existing assets</p>
21
+ <p class="asset-editor-hint">TODO: Integrate with LibraryPanel</p>
22
+ </div>
23
+
24
+ <div class="asset-editor-tab-panel" data-tab-panel="ai">
25
+ <div class="asset-editor-ai-controls">
26
+ <button class="debug-btn primary" data-ai-generate>
27
+ \u2728 Generate New Image
28
+ </button>
29
+ <button class="debug-btn" data-ai-edit>
30
+ \u{1F3A8} Edit Current Image
31
+ </button>
32
+ </div>
33
+ </div>
34
+
35
+ <div class="asset-editor-tab-panel" data-tab-panel="upload">
36
+ <p class="asset-editor-hint">Upload tab - Upload new file</p>
37
+ <input type="file" accept="image/*" data-file-upload />
38
+ <p class="asset-editor-hint">TODO: Implement file upload</p>
39
+ </div>
40
+ </div>
41
+
42
+ <div class="asset-editor-actions">
43
+ <button class="debug-btn" data-modal-close>Cancel</button>
44
+ <button class="debug-btn primary" data-modal-apply>Apply</button>
45
+ </div>
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 Dx={};fc(Dx,{AspectClass:()=>Ho,GameObject:()=>Dn,GameObjectManager:()=>ta,Renderer:()=>Pn,ResponsiveUISystem:()=>ji,Transform:()=>On,animateHandClick:()=>Ph,animatePanelEntrance:()=>Oh,createBrushTexture:()=>Hh,createEndGamePanel:()=>Ih,createHandTutorial:()=>Dh,createThreeBase:()=>Lh,createTutorialLabel:()=>jh,getAspectClass:()=>ea,getRegisteredFontIds:()=>Mh,loadAsset:()=>Go,loadCharacterFrames:()=>Nh,registerFont:()=>Rh,resolveFont:()=>Be,resolveFontWeight:()=>Fe,updateHandAnimation:()=>zh});module.exports=Pg(Dx);var Te=qe(require("three"),1);var dt={};function Un(e,t,i=!1){dt[e]||(dt[e]=[]),dt[e].push({fn:t,once:i})}function ha(e,t){if(dt[e]){if(!t){delete dt[e];return}dt[e]=dt[e].filter(i=>i.fn!==t)}}function Gn(e,...t){let i=dt[e];if(i)for(let n of[...i])n.fn(...t),n.once&&ha(e,n.fn)}function fe(e,t){Un(e,t,!0)}var G=null,we=[],Zt=null;function bc(e){G=e,we=[],Zt!==null&&(clearTimeout(Zt),Zt=null)}function yc(){var e,t,i;return{endpoint:(G==null?void 0:G.endpoint)||"",transport:(G==null?void 0:G.transport)||"beacon",batchSize:(e=G==null?void 0:G.batchSize)!=null?e:10,flushIntervalMs:(t=G==null?void 0:G.flushIntervalMs)!=null?t:300,maxQueue:(i=G==null?void 0:G.maxQueue)!=null?i:200,debug:!!(G!=null&&G.debug)}}async function gc(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 ga(e,t){let i=yc();if(t&&i.endpoint){if(we.push(e),we.length>i.maxQueue&&(we=we.slice(we.length-i.maxQueue)),we.length>=i.batchSize){mc();return}Zt===null&&(Zt=window.setTimeout(()=>{Zt=null,mc()},i.flushIntervalMs))}}async function mc(){let e=yc();if(!e.endpoint||we.length===0)return;let t=we.splice(0,e.batchSize);await gc(e.endpoint,{events:t},e.transport,e.debug),we.length>0&&await gc(e.endpoint,{events:we.splice(0,e.batchSize)},e.transport,e.debug)}var he=0,Dg=he++,vc=he++,xc=he++,wc=he++,_c=he++,Ec=he++,Sc=he++,Ac=he++,Cc=he++,Tc=he++,kc=he++,Lc=he++,N=Dg;function Rc(){return N===vc}function Mc(){return N===xc}function Ic(){return N===wc}function Oc(){return N===_c}function Jt(){return N===Ec}function Qt(){return N===Sc}function Pc(){return N===Ac}function Dc(){return N===Cc}function jc(){return N===Tc}function ma(){return N===kc}function ba(){return N===Lc}function zc(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),N=vc;return}catch{}else if(e==="dapi")try{dapi.isReady(),N=xc;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(N=wc)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(N=_c)}catch{}else if(t==="mintegral")window.gameReady&&(N=Ec);else if(t==="tapjoy")window.TJ_API&&(N=Sc);else if(t==="tiktok")window.openAppStore&&(N=Ac);else if(t==="smadex")try{window.smxTracking&&(N=Cc)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(N=Tc)}catch{}else t==="vungle"?N=kc:(e==="nucleo"||t==="nucleo")&&(N=Lc)}var qn=qe(require("lottie-web"),1),Bc=qn.default;typeof window!="undefined"&&(window.lottie=qn.default,window.__baseLottie=qn.default);var jg=require("pixi.js");var ya=require("pixi.js");var zg=null;function va(e){zg=e}Wn();xa();var Ni=require("pixi.js");Wn();var Ug=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Sa=Ug;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&&(Sa=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${Sa}`))}}catch{}var Mt=class{static async create(t,i,n){var d,l,c,f,p,u,v;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${Sa}`);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 h=new Ni.Container;return this.applyTransform(h,i==null?void 0:i.transform),h}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 Rt.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 Ni.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:",(p=s==null?void 0:s.constructor)==null?void 0:p.name,s),s&&(((u=s.constructor)==null?void 0:u.name)==="Container"||s instanceof Ni.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[r.path,`/assets/${r.path}`,`assets/${r.path}`,`../assets/${r.path}`],x=!1;for(let m of h)try{let y=await fetch(m);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",m,"type:",(v=o==null?void 0:o.constructor)==null?void 0:v.name),x=!0;break}}catch{continue}x||(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])))}};var Hi=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 Wg=qe(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Wg);$i();var Vn=require("pixi.js");$i();var Ca=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Hi}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 Mt.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 Mt.create(t,i,this.app);this.instanceCache.set(t,n)}}get(t){return this.instanceCache.get(t)}},Vg=new Ca,Xg=new Proxy(Vg,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});$i();var $c=require("pixi.js"),Xe={width:400,height:600,designWidth:400,scaleFactor:1},Kn={scale:1,position:1},ka=[];function Jg(e,t,i,n,r,a,s){ka.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function Qg(){ka.forEach(({element:e,originalScale:t,positionHelper:i,heightPercent:n})=>{let r=t*Xe.scaleFactor;i(e,Xe.width,Xe.height,n,r,!0,!1)})}function Ta(e,t){console.log(`[SCREEN] updateScreenState called: ${e}x${t}`),Xe.width=e,Xe.height=t,Xe.scaleFactor=Math.min(e/Xe.designWidth,1.15),Kn.scale=Xe.scaleFactor,Kn.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Kn.scale.toFixed(3)}`),Qg()}var Gi={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 em(e,t,i){let n=Gi[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function tm(){return Gi}var im={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 Xn(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function Zn(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:Xn(e[0],t.x),y:Xn(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:Xn(n.x,t.x),y:Xn(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=im[n])!=null?i:t}return t}function Uc(e,t,i,n={}){var u,v,h,x,m,y;let r=Zn(i),a=(u=n.inset)!=null?u:{},s=(v=n.padding)!=null?v:{x:0,y:0},o=((h=a.left)!=null?h:0)+s.x,d=((x=a.right)!=null?x:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,c=((y=a.bottom)!=null?y:0)+s.y,f=Math.max(0,e-o-d),p=Math.max(0,t-l-c);return{x:o+f*r.x,y:l+p*r.y}}function Gc(e,t,i,n={}){var h,x,m,y,b,g;let r=(h=n.inset)!=null?h:{},a=(x=n.padding)!=null?x:{x:0,y:0},s=((m=r.left)!=null?m:0)+a.x,o=((y=r.right)!=null?y:0)+a.x,d=((b=r.top)!=null?b:0)+a.y,l=((g=r.bottom)!=null?g:0)+a.y,c=Math.max(0,e-s-o),f=Math.max(0,t-d-l),p=Zn(i,{x:.5,y:.5}),u=Math.min(Math.max(p.x,0),1),v=Math.min(Math.max(p.y,0),1);return{x:s+c*u,y:d+f*v}}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=em,window.getDebugConfig=tm,window.copyConfig=fm,window.applyConfig=Ui,window.applyConfigForRatio=hm,window.positionAtBottom=qc,window.positionAtTop=am,window.positionAtCenter=sm,window.positionAtLeft=om,window.positionAtRight=lm,window.positionAtBottomLeft=cm,window.positionAtBottomRight=dm,window.positionAtTopLeft=um,window.positionAtTopRight=pm,window.applyPositionContract=rm,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 Jn(e,t,i=0){return e*t+i}function Qn(e,t,i=0){return e*(1-t)+i}function er(e,t,i=0){return e*t+i}function tr(e,t,i=0){return e*(1-t)+i}function ge(e,t=0){return e/2+t}function nm(e,t){return e*t}function rm(e,t,i,n){var s,o,d,l,c,f,p,u,v,h,x,m,y,b,g,w,C,S,A,T;let r=0,a=0;switch(n.type){case"top":r=ge(t,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),a=Jn(i,n.percent,(l=(d=n.offset)==null?void 0:d.y)!=null?l:0);break;case"bottom":r=ge(t,(f=(c=n.offset)==null?void 0:c.x)!=null?f:0),a=Qn(i,n.percent,(u=(p=n.offset)==null?void 0:p.y)!=null?u:0);break;case"left":r=er(t,n.percent,(h=(v=n.offset)==null?void 0:v.x)!=null?h:0),a=ge(i,(m=(x=n.offset)==null?void 0:x.y)!=null?m:0);break;case"right":r=tr(t,n.percent,(b=(y=n.offset)==null?void 0:y.x)!=null?b:0),a=ge(i,(w=(g=n.offset)==null?void 0:g.y)!=null?w:0);break;case"center":r=ge(t,(S=(C=n.offset)==null?void 0:C.x)!=null?S:0),a=ge(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 qc(e,t,i,n=.2,r=1,a=!0,s=!1){let o=nm(i,n),d=Qn(i,n/2);Ke(e,ge(t),d);let l=a?r*Xe.scaleFactor:r;Ze(e,l),s&&!ka.find(c=>c.element===e)&&Jg(e,qc,t,i,n,r,a)}function am(e,t,i,n=.1,r=1){Ke(e,ge(t),Jn(i,n)),Ze(e,r)}function sm(e,t,i,n=0,r=0,a=1){Ke(e,ge(t,n),ge(i,r)),Ze(e,a)}function om(e,t,i,n=.1,r=1){Ke(e,er(t,n),ge(i)),Ze(e,r)}function lm(e,t,i,n=.1,r=1){Ke(e,tr(t,n),ge(i)),Ze(e,r)}function cm(e,t,i,n=.05,r=.05,a=1){Ke(e,er(t,r),Qn(i,n)),Ze(e,a)}function dm(e,t,i,n=.05,r=.05,a=1){Ke(e,tr(t,r),Qn(i,n)),Ze(e,a)}function um(e,t,i,n=.05,r=.05,a=1){Ke(e,er(t,r),Jn(i,n)),Ze(e,a)}function pm(e,t,i,n=.05,r=.05,a=1){Ke(e,tr(t,r),Jn(i,n)),Ze(e,a)}function Ke(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 Ze(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 It={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 fm(e){return e&&It[e]?JSON.parse(JSON.stringify(It[e])):JSON.parse(JSON.stringify(Gi))}function Ui(e){Object.keys(e).forEach(t=>{let i=t;Gi[i]&&e[i]&&Object.assign(Gi[i],e[i])}),console.log("Config applied:",e)}function hm(e,t){let i=e/t;i>1.6?(Ui(It.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(Ui(It.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(Ui(It.square),console.log("Applied SQUARE config for ratio:",i)):(Ui(It.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=It,e.resolveAnchorVec2=e.resolveAnchorVec2||Zn,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||Uc,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||Gc}Ma();function q(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var E_=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:q(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:q(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:q(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:q(360,780)}],S_=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:q(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:q(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:q(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:q(412,915)}],A_=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:q(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:q(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:q(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:q(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:q(800,1280)}],Xc=[{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:q(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:q(768,1024),mraidScale:.7}];var C_=[...Xc];var _m=Xc[0];pt();var sx=qe(ch(),1);function nx(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 rx(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 ax(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 _o(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 nx(r),s=await ax(a),o=rx(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 Yr(e,t=30){try{console.log("[ImageUtils] Removing background color...");let i=await new Promise((f,p)=>{let u=new Image;u.onload=()=>f(u),u.onerror=()=>p(new Error("Failed to load image")),u.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 p=s[f],u=s[f+1],v=s[f+2],h=!1;for(let x of d)if(Math.sqrt(Math.pow(p-x.r,2)+Math.pow(u-x.g,2)+Math.pow(v-x.b,2))<t){h=!0;break}h&&(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 dh=require("@google/genai");async function Eo(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 m=0;m<i.length;m++){let y=i[m];if(!y.base64||!y.mimeType)throw new Error(`Image ${m+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${m+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${m+1} has invalid MIME type: ${y.mimeType}`)}let f=new dh.GoogleGenAI({apiKey:e}),p="gemini-2.5-flash",u=[t];i.length>0&&i.forEach((m,y)=>{u.push({inlineData:{data:m.base64,mimeType:m.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${m.mimeType}, size: ${Math.round(m.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:p,contents:u}),h="",x=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(x)for(let m of x)m.text&&(h+=m.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}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 uh=require("@google/genai");async function Vr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new uh.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 ox=require("pixi.js");$i();pt();var fh=require("pixi.js");var lx=require("pixi.js");pt();function gx(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 mx(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 bx(e){return`
48
+ Analyze these screenshots of a brand or game and extract its "Brand DNA".
49
+
50
+ Provide a concise summary (2-3 sentences) covering:
51
+ 1. Primary and secondary brand colors.
52
+ 2. The overall aesthetic "vibe" (e.g., minimalist, neon, glossy, retro, corporate).
53
+ 3. Common UI patterns (e.g., rounded buttons, flat icons).
54
+
55
+ Then, list the exact hex color codes (#RRGGBB) found in the screenshots.
56
+
57
+ FORMAT:
58
+ Summary: [Your summary here]
59
+ Palette: [#RRGGBB, #RRGGBB, ...]
60
+
61
+ ${e?`
62
+ ADDITIONAL RULES/NOTES:
63
+ ${e}`:""}
64
+ `.trim()}function hh(){let e=[],t="",i=null;return{async addSources(n){let r=[];for(let a of n){let s=await gx(a),o=mx(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=bx(r),o=e.map(p=>({base64:p.base64,mimeType:p.mimeType})),d=await Eo(n,s,o,{model:a}),l=t,c=[],f=d.split(`
65
+ `);for(let p of f)if(p.toLowerCase().startsWith("summary:"))l=p.slice(8).trim();else if(p.toLowerCase().includes("palette:")){let u=p.match(/#[0-9A-Fa-f]{6}/g);u&&u.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 Vt="handler_api_key_";var ki=class{static setKey(t,i,n){try{let r={key:this.encryptKey(i),created:Date.now(),lastUsed:Date.now(),label:n||t},a=`${Vt}${t}`;localStorage.setItem(a,JSON.stringify(r))}catch(r){console.error("[ApiKeyStorage] Failed to store API key:",r)}}static getKey(t){try{let i=`${Vt}${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=`${Vt}${t}`;return localStorage.getItem(i)!==null}static removeKey(t){try{let i=`${Vt}${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(Vt)){let r=n.substring(Vt.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(Vt)&&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}}},So=()=>ki.getKey("gemini"),Ao=(e,t)=>ki.setKey("gemini",e,t),yx=()=>ki.hasKey("gemini");window.ApiKeyStorage=ki;window.getGeminiApiKey=So;window.setGeminiApiKey=Ao;window.hasGeminiApiKey=yx;var To=class{constructor(){this.modal=null;this.options=null;this.analyzer=hh();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
+ <div class="ai-modal-card">
68
+ <div class="ai-modal-header">
69
+ <div class="ai-modal-actions">
70
+ <button class="ai-modal-gallery" type="button" data-action="gallery">
71
+ \u{1F5BC}\uFE0F Gallery
72
+ </button>
73
+ </div>
74
+ <div>
75
+ <div class="ai-modal-title">AI Image Editor</div>
76
+ <div class="ai-modal-subtitle">${((i=this.options)==null?void 0:i.objectId)||"Unknown Object"}</div>
77
+ </div>
78
+ <button class="ai-modal-close" type="button" data-action="close">\xD7</button>
79
+ </div>
80
+
81
+ <div class="ai-modal-body">
82
+ <!-- PROMPT INPUT -->
83
+ <div class="ai-section">
84
+ <label class="ai-label">Prompt</label>
85
+ <textarea
86
+ class="ai-textarea"
87
+ placeholder="Describe the image you want to generate..."
88
+ rows="3"
89
+ >${this.currentPrompt}</textarea>
90
+ </div>
91
+
92
+ <!-- STRENGTH CONTROLS -->
93
+ <div class="ai-section">
94
+ <div class="ai-row ai-strength">
95
+ <label class="ai-label">Creativity</label>
96
+ <input
97
+ type="range"
98
+ class="ai-input"
99
+ min="0.1"
100
+ max="1.0"
101
+ step="0.1"
102
+ value="0.8"
103
+ data-strength="creativity"
104
+ />
105
+ <span class="ai-strength-value">0.8</span>
106
+ </div>
107
+ </div>
108
+
109
+ <!-- BRAND DNA -->
110
+ <div class="ai-section">
111
+ <div class="ai-row">
112
+ <input type="checkbox" id="ai-use-dna" checked />
113
+ <label for="ai-use-dna" class="ai-label">Apply Brand DNA</label>
114
+ </div>
115
+ </div>
116
+
117
+ <!-- PREVIEW AREA -->
118
+ <div class="ai-section">
119
+ <div class="ai-preview" data-preview>
120
+ <div class="ai-preview-placeholder">
121
+ Generated images will appear here
122
+ </div>
123
+ </div>
124
+ </div>
125
+
126
+ <!-- LOADING INDICATOR -->
127
+ <div class="ai-loading hidden" data-loading>
128
+ <div class="ai-loading-ring"></div>
129
+ <div class="ai-loading-text">Generating image...</div>
130
+ </div>
131
+
132
+ <!-- GALLERY (hidden by default) -->
133
+ <div class="ai-gallery hidden" data-gallery>
134
+ <div class="ai-gallery-grid" data-gallery-grid></div>
135
+ </div>
136
+ </div>
137
+
138
+ <!-- ACTION BUTTONS -->
139
+ <div class="ai-modal-actions">
140
+ <button class="ai-btn" data-action="cancel">Cancel</button>
141
+ <button class="ai-btn" data-action="generate" disabled>Generate</button>
142
+ <button class="ai-btn primary" data-action="apply" disabled>Apply</button>
143
+ </div>
144
+ </div>
145
+ `,this.modal=t,this.attachEventListeners(),this.updatePromptFromDna()}attachEventListeners(){var n;if(!this.modal)return;this.promptInput=this.modal.querySelector(".ai-textarea"),this.generateBtn=this.modal.querySelector('[data-action="generate"]'),this.loadingEl=this.modal.querySelector("[data-loading]"),this.galleryEl=this.modal.querySelector("[data-gallery]"),this.previewEl=this.modal.querySelector("[data-preview]"),(n=this.promptInput)==null||n.addEventListener("input",()=>{var r;this.currentPrompt=((r=this.promptInput)==null?void 0:r.value)||"",this.updateGenerateButton()});let t=this.modal.querySelector('[data-strength="creativity"]'),i=this.modal.querySelector(".ai-strength-value");t==null||t.addEventListener("input",()=>{i.textContent=t.value}),this.modal.addEventListener("click",r=>{var o;let a=r.target;switch(a.dataset.action||((o=a.closest("[data-action]"))==null?void 0:o.getAttribute("data-action"))){case"generate":this.generateImage();break;case"apply":this.applySelectedImage();break;case"gallery":this.toggleGallery();break;case"close":case"cancel":this.close();break}}),this.modal.addEventListener("click",r=>{let a=r.target;if(a.classList.contains("ai-gallery-item")||a.closest(".ai-gallery-item")){let s=a.closest(".ai-gallery-item"),o=parseInt(s.dataset.index||"-1");o>=0&&this.selectImage(o)}}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()}),this.updateGenerateButton()}updateGenerateButton(){if(!this.generateBtn)return;let t=this.currentPrompt.trim().length>0;this.generateBtn.disabled=!t||this.isGenerating}async updatePromptFromDna(){var i;let t=(i=this.modal)==null?void 0:i.querySelector("#ai-use-dna");if(t!=null&&t.checked)try{let n=this.analyzer.getResult();if(n!=null&&n.summary&&this.promptInput){let r=`${this.currentPrompt}
146
+
147
+ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}catch(n){console.warn("[AiEditorModal] Failed to apply brand DNA:",n)}}async generateImage(){var t,i,n,r;if(!(!this.options||this.isGenerating)){this.isGenerating=!0,this.updateGenerateButton(),(t=this.loadingEl)==null||t.classList.remove("hidden"),(i=this.previewEl)==null||i.classList.add("hidden");try{let a=this.getApiKey();if(!a){alert("Please set your Gemini API key first. You can do this in the AI Creative Suite panel.");return}let s=[];if(this.options.currentValue&&this.options.currentValue.startsWith("data:"))try{let l=await _o(this.options.currentValue);l&&(s=[{base64:l.base64,mimeType:l.mimeType}])}catch(l){console.warn("[AiEditorModal] Failed to load current image:",l)}let o=await Vr(a,this.currentPrompt,s,{aspectRatio:"1:1"}),d=await Yr(o);this.generatedImages.push(d||o),this.selectedImageIndex=this.generatedImages.length-1,this.updateGallery(),this.updatePreview(),this.updateApplyButton()}catch(a){console.error("[AiEditorModal] Generation failed:",a),alert(`Generation failed: ${a instanceof Error?a.message:"Unknown error"}`)}finally{this.isGenerating=!1,(n=this.loadingEl)==null||n.classList.add("hidden"),(r=this.previewEl)==null||r.classList.remove("hidden"),this.updateGenerateButton()}}}updateGallery(){if(!this.galleryEl)return;let t=this.galleryEl.querySelector("[data-gallery-grid]");t&&(t.innerHTML=this.generatedImages.map((i,n)=>`
148
+ <div class="ai-gallery-item ${n===this.selectedImageIndex?"active":""}" data-index="${n}">
149
+ <img class="ai-gallery-thumb" src="${i}" alt="Generated ${n+1}" />
150
+ <div class="ai-gallery-label">#${n+1}</div>
151
+ </div>
152
+ `).join(""))}updatePreview(){if(!this.previewEl||this.selectedImageIndex<0)return;let t=this.generatedImages[this.selectedImageIndex];this.previewEl.innerHTML=`<img src="${t}" alt="Selected image" />`}selectImage(t){t<0||t>=this.generatedImages.length||(this.selectedImageIndex=t,this.updateGallery(),this.updatePreview(),this.updateApplyButton())}toggleGallery(){this.galleryEl&&this.galleryEl.classList.toggle("hidden")}updateApplyButton(){var i;let t=(i=this.modal)==null?void 0:i.querySelector('[data-action="apply"]');t&&(t.disabled=this.selectedImageIndex<0)}applySelectedImage(){var i;if(this.selectedImageIndex<0||!((i=this.options)!=null&&i.onApply))return;let t=this.generatedImages[this.selectedImageIndex];this.options.onApply(t),this.close()}getApiKey(){let t=So();if(t)return t;try{let i=this.analyzer.getResult();if(i&&i.apiKey)return Ao(i.apiKey,"From Brand DNA"),i.apiKey}catch(i){console.warn("[AiEditorModal] Failed to get API key from brand DNA:",i)}return null}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.options=null}},Co=null;window.__openAiEditor=function(e,t,i,n){Co||(Co=new To),Co.open({objectId:e,initialPrompt:t,currentValue:i,path:n==null?void 0:n.path,onApply:r=>{if(n!=null&&n.path){let a=window.updateManager;if(a)a.updateProperty(e,n.path,r);else{let s=window.getEditableObjectConfig,o=s==null?void 0:s(e);if(o){let d=n.path.split("."),l=o;for(let c=0;c<d.length-1;c++)l[d[c]]||(l[d[c]]={}),l=l[d[c]];l[d[d.length-1]]=r}}}window.dispatchEvent(new CustomEvent("inspector:refresh"))}})};Lo();var Ro=class{constructor(){this.modal=null;this.options=null}open(t){this.options=t,this.createModal(),document.body.appendChild(this.modal)}createModal(){if(!this.options)return;let{assetPath:t,assetType:i,objectId:n}=this.options,r=n||"Asset Preview",a=document.createElement("div");a.className="asset-preview-modal",a.innerHTML=`
153
+ <div class="asset-preview-card">
154
+ <div class="asset-preview-header">
155
+ <div class="asset-preview-title">${r}</div>
156
+ <button class="asset-preview-close" data-action="close">\xD7</button>
157
+ </div>
158
+
159
+ <div class="asset-preview-meta">
160
+ <div>Type: ${i.toUpperCase()}</div>
161
+ <div>Path: ${t||"None"}</div>
162
+ </div>
163
+
164
+ <div class="asset-preview-body">
165
+ ${this.renderAssetContent(t,i)}
166
+ </div>
167
+
168
+ <div class="asset-preview-actions">
169
+ <button class="asset-preview-change" data-action="change">Change Asset</button>
170
+ ${i==="image"?'<button class="asset-preview-ai" data-action="edit">\u2728 AI Edit</button>':""}
171
+ </div>
172
+ </div>
173
+ `,this.modal=a,this.attachEventListeners()}renderAssetContent(t,i){if(!t)return'<div class="asset-preview-placeholder">No asset selected</div>';switch(i){case"image":return`<img src="${this.resolveAssetUrl(t)}" alt="Asset preview" style="max-width: 100%; max-height: 400px; object-fit: contain;" />`;case"audio":let r=this.resolveAssetUrl(t);return`
174
+ <audio controls style="width: 100%;">
175
+ <source src="${r}" type="audio/mpeg">
176
+ <source src="${r}" type="audio/wav">
177
+ Your browser does not support the audio element.
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(()=>(Lo(),gh)).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 Ro().open(e)};var Mo=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
+ <div class="asset-crop-card">
181
+ <div class="asset-crop-header">
182
+ <div>
183
+ <div class="asset-crop-title">Crop Image</div>
184
+ <div class="asset-crop-subtitle">Drag to reposition, scroll to zoom</div>
185
+ </div>
186
+ <button class="asset-crop-close" data-action="close">\xD7</button>
187
+ </div>
188
+
189
+ <div class="asset-crop-body">
190
+ <div class="asset-crop-column">
191
+ <div class="asset-crop-canvas-container">
192
+ <canvas class="asset-crop-canvas"></canvas>
193
+ </div>
194
+
195
+ <div class="asset-crop-controls">
196
+ <div class="asset-crop-zoom">
197
+ <label class="asset-crop-label">Zoom</label>
198
+ <input type="range" min="0.1" max="3" step="0.1" value="1" class="asset-crop-zoom-slider" />
199
+ <span class="asset-crop-zoom-value">1.0x</span>
200
+ </div>
201
+
202
+ <div class="asset-crop-aspect">
203
+ <label class="asset-crop-label">Aspect Ratio</label>
204
+ <select class="asset-crop-aspect-select">
205
+ <option value="free">Free</option>
206
+ <option value="1:1">Square (1:1)</option>
207
+ <option value="4:3">Standard (4:3)</option>
208
+ <option value="16:9">Widescreen (16:9)</option>
209
+ <option value="3:2">Photo (3:2)</option>
210
+ </select>
211
+ </div>
212
+
213
+ <button class="asset-crop-reset" data-action="reset">Reset</button>
214
+ </div>
215
+ </div>
216
+
217
+ <div class="asset-crop-column">
218
+ <div class="asset-crop-preview">
219
+ <div class="asset-crop-preview-label">Preview</div>
220
+ <canvas class="asset-crop-preview-canvas"></canvas>
221
+ </div>
222
+ </div>
223
+ </div>
224
+
225
+ <div class="asset-crop-actions">
226
+ <button class="asset-crop-apply" data-action="cancel">Cancel</button>
227
+ <button class="asset-crop-apply primary" data-action="apply">Apply Crop</button>
228
+ </div>
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 Mo().open(e)};pt();pt();var mh=qe(require("lottie-web"),1);va(Bc);typeof window!="undefined"&&!window.lottie&&(window.lottie=mh.default);Ma();pt();var Io="0.3.1",vx=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"]),Eh={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"},Sh=Math.random().toString(36).slice(2),Mi=null,Li={...Eh},Ah="web_embed",jo={},kn,Oo=!1,Tn=!1,Rn=!1,Ch=!1,No=1,Kr=0,Qr=!1,lt=!1,Ri="",Ii=Math.floor(window.innerWidth),Oi=Math.floor(window.innerHeight),zo=Ii>Oi,ct=!1,Ln=!1,bh=!1,yh=!1,Po=!1,Zr=null,Xt=null,Bo=!1,Fo=!1,Xr=new Map;function Th(){if(!Xt)return null;let e=Date.now()-Xt;return!Number.isFinite(e)||e<0?null:e}function Do(e){if(Bo)return;let t=Th();t!==null&&(Bo=!0,k("session_time",{duration_ms:t,reason:e}))}function vh(){if(Mi)return Mi;let e=document.createElement("div");return e.id="handler-root",e.setAttribute("data-handler-root","true"),document.body.appendChild(e),Mi=e,e}function Jr(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function kh(e,t){return{event_name:e,ts:Date.now(),session_id:Sh,deployment_id:Li.deployment_id,variant_id:Li.variant_id,export_profile_id:Li.profile_id,instance_id:Li.instance_id||"default",env:Ah==="mraid"?"mraid":"web",attribution:kn,payload:t}}function k(e,t){let i=Jr(e),n=kh(i,t);ga(n,!!jo.analytics),Gn(i,n),i!==e&&Gn(e,n)}function Mn(){Zr&&(Zr(Ii,Oi),Zr=null)}function Pi(e){No=e,k("volume",e)}function Di(e){e&&(Ch=!0),!Rn&&(Rn=!0,k("pause"),Pi(0))}function In(e){!e&&Ch||Rn&&(Rn=!1,k("resume"),Pi(No))}function St(e,t){Ii=Math.floor(e||window.innerWidth),Oi=Math.floor(t||window.innerHeight),zo=Ii>Oi,k("resize",{width:Ii,height:Oi})}function xx(){if(Rc())try{let e=mraid.getMaxSize();St(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?In():Di()};if(mraid.addEventListener("viewableChange",t),mraid.addEventListener("stateChange",t),mraid.addEventListener("sizeChange",()=>{let i=mraid.getMaxSize();St(i.width,i.height)}),mraid.getAudioVolume){let i=mraid.getAudioVolume();Pi(i?1:0)}if(mraid.addEventListener("audioVolumeChange",i=>{i!==null&&Pi(i>0?1:0)}),mraid.addEventListener("error",(i,n)=>{console.warn("mraid error:",i,"action:",n)}),Qr=!0,mraid.isViewable()&&mraid.getState()!=="hidden")ct=!0,k("boot"),k("view"),k("ready"),lt=!0,Mn();else{let i=()=>{ct=!0,k("boot"),k("view"),k("ready"),lt=!0,Mn()};mraid.addEventListener("ready",i)}}catch(e){console.warn("MRAID hook skipped",e)}}function wx(){if(Mc())try{let e=dapi.getScreenSize();St(e.width,e.height),dapi.addEventListener("viewableChange",i=>{i.isViewable?In():Di()}),dapi.addEventListener("adResized",i=>{let n=dapi.getScreenSize();St(i.width||n.width,i.height||n.height)});let t=dapi.getAudioVolume();if(Pi(t?1:0),dapi.addEventListener("audioVolumeChange",i=>Pi(i?1:0)),Qr=!0,dapi.isViewable())ct=!0,k("boot"),k("view"),k("ready"),lt=!0,Mn();else{let i=()=>{ct=!0,k("boot"),k("view"),k("ready"),lt=!0,Mn()};dapi.addEventListener("ready",i)}}catch(e){console.warn("DAPI hook skipped",e)}}function xh(){let e=()=>{ct||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(ct=!0,k("boot"),k("view"),k("ready"),lt=!0,Mn(),Ln&&(Ln=!1,ze.start()))};window.addEventListener("resize",()=>St()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(In(),e()):Di()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),Qr=!0}function _x(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(bh=!0),!(bh&&t instanceof MouseEvent)&&(Kr+=1,Fo||(Fo=!0,k("first_interaction",{count:Kr})),k("interaction",Kr))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function wh(e){var n,r,a,s,o,d,l,c,f,p,u,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(Qt())(a=(r=window.TJ_API)==null?void 0:r.click)==null||a.call(r);else if(Ic())(o=(s=window.FbPlayableAd)==null?void 0:s.onCTAClick)==null||o.call(s);else if(jc())(l=(d=window.ScPlayableAd)==null?void 0:d.onCTAClick)==null||l.call(d);else if(Dc())try{(f=(c=window.smxTracking)==null?void 0:c.redirect)==null||f.call(c)}catch(h){console.warn("Smadex redirect failed",h)}else if(Oc()){let h=window.ExitApi;h&&typeof h.exit=="function"?h.exit(e||Ri||""):e&&window.open(e)}else Jt()?(p=window.install)==null||p.call(window):Pc()?(u=window.openAppStore)==null||u.call(window):ma()?(v=parent==null?void 0:parent.postMessage)==null||v.call(parent,"download","*"):e&&window.open(e)}function Ex(){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;fe("view",()=>t(i.mraid_viewable)),fe("start",()=>t(i.game_viewable)),fe("engagement",()=>t(i.engagement));let n=()=>t(i.complete);fe("complete",n),Un("engagement",r=>{var a;((a=r==null?void 0:r.payload)==null?void 0:a.count)>3&&n()}),fe("cta_click",()=>t(i.click))}else if(e==="inmobi"){let i=window.INMOBI_DSPMACROS;if(!i)return;fe("view",()=>t(i.Ad_Load_Start)),fe("start",()=>t(i.Ad_Viewable)),fe("engagement",()=>t(i.First_Engagement)),fe("complete",()=>t(i.Gameplay_Complete)),fe("cta_click",()=>t(i.DSP_Click)),fe("start",()=>{[5,10,15,20,25,30].forEach(n=>setTimeout(()=>t(i[`Spent_${n}_Seconds`]),n*1e3))})}}function Sx(){if(!Qt())return;let e=window.TJ_API;e&&e.setPlayableAPI&&e.setPlayableAPI({skipAd:()=>{try{ze.finish()}catch(t){console.warn("Tapjoy skip failed",t)}}})}function _h(){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 Ax(){Jt()&&(window.mintGameStart=()=>{In(!0),St()},window.mintGameClose=()=>{Di(!0)})}function Cx(){if(!ba())return;let e=window.NUC;!e||!e.trigger||(ze.on("cta_click",()=>{var t,i;return(i=(t=e.trigger).convert)==null?void 0:i.call(t,Ri)}),ze.on("complete",()=>{var t,i;return(i=(t=e.trigger).tryAgain)==null?void 0:i.call(t)}))}var ze={init(e={},t){var i;if(Ah=e.profile||"web_embed",jo=e.consent||{},Li={...Eh,...e.ids||{}},Mi=e.rootEl||Mi,kn=void 0,bc((i=e.telemetry)!=null&&i.endpoint?e.telemetry:null),Xt=null,Bo=!1,Fo=!1,Xr.clear(),Ri=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(Zr=t),k("init"),document.body.oncontextmenu=()=>!1,vh(),kx(Mi),zc(),xx(),wx(),!Qr){if(document.readyState==="complete")xh();else if(!yh){yh=!0;let n=()=>{xh(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}_x(),Ex(),Sx(),Ax(),Cx(),console.log(`%c @handler/playable-sdk %c v${Io} `,"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;"),ct&&!lt&&(k("boot"),k("view"),k("ready"),Ln&&(Ln=!1,ze.start()),lt=!0),lt=ct},getRoot(){return vh()},get version(){return Io},get maxWidth(){return Ii},get maxHeight(){return Oi},get isLandscape(){return zo},get isReady(){return lt},get isStarted(){return Oo},get isPaused(){return Rn},get isFinished(){return Tn},get volume(){return No},get interactions(){return Kr},on(e,t){Un(Jr(e),t)},off(e,t){ha(Jr(e),t)},start(){var e,t;if(!Oo){if(!ct){Ln=!0;return}if(Oo=!0,Xt||(Xt=Date.now()),k("start"),St(),Jt())Di(),(e=window.gameReady)==null||e.call(window);else if(Qt()){let i=window.TJ_API;(t=i==null?void 0:i.setPlayableBuild)==null||t.call(i,{orientation:zo?"landscape":"portrait",buildID:Io})}}},finish(){var e,t;Tn||(Tn=!0,k("complete"),Do("complete"),Jt()?(e=window.gameEnd)==null||e.call(window):ma()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):Qt()&&_h())},install(e){if(!Tn){Tn=!0,Qt()?(_h(),setTimeout(()=>ze.install(e),300)):(k("complete"),setTimeout(()=>ze.install(e),0));return}Po||(Po=!0,setTimeout(()=>Po=!1,500),k("cta_click"),k("conversion"),Do("cta"),wh(e||Ri))},emit(e,t){let i=Jr(e);if(!vx.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=kh(i,t);ga(n,!!jo.analytics),Gn(i,n)},gameStart(){ze.start()},gameEnd(){ze.finish()},ctaClick(e,t){k("cta_click",{url:e||Ri,manual:!0}),(t==null?void 0:t.open)!==!1&&wh(e||Ri)},ctaShow(e){k("cta_show",e)},ctaDismiss(e){k("cta_dismiss",e)},getGameTimeMs(){return Th()},endSession(e="manual"){Do(e)},setAttribution(e){kn=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(Tx(`${Sh}:${e}`))%t.length,n=t[i];return kn={...kn||{},experiment_id:e},Li.variant_id=n,k("ab_assign",{experiment_id:e,variant_id:n}),n},levelStart(e,t){Xt||(Xt=Date.now()),k("level_start",{level_id:e,...t})},levelComplete(e,t){k("level_complete",{level_id:e,...t})},levelFail(e,t){k("level_fail",{level_id:e,...t})},checkpoint(e,t){k("checkpoint",{checkpoint_id:e,...t})},reward(e,t){k("reward",{reward_id:e,...t})},tutorialStart(e,t){k("tutorial_start",{step_id:e,...t})},tutorialComplete(e,t){k("tutorial_complete",{step_id:e,...t})},tutorialSkip(e,t){k("tutorial_skip",{step_id:e,...t})},timerStart(e){e&&Xr.set(e,Date.now())},timerEnd(e,t="custom",i){if(!e)return;let n=Xr.get(e);if(!n)return;Xr.delete(e);let r=Date.now()-n;if(!(!Number.isFinite(r)||r<0)){if(t==="custom"){k("engagement",{action:"timer",key:e,duration_ms:r,...i});return}k(t,{key:e,duration_ms:r,...i})}},fps(e,t){k("fps",{value:e,...t})},memory(e,t){k("memory",{bytes:e,...t})},assetLoadStart(e,t){k("asset_load_start",{asset_id:e,...t})},assetLoadComplete(e,t){k("asset_load_complete",{asset_id:e,...t})},reportError(e,t,i){k("error",{code:e,message:t,...i})},retry(){var e,t,i;if(Jt())(e=window.gameRetry)==null||e.call(window);else if(ba()){let n=window.NUC;(i=(t=n==null?void 0:n.trigger)==null?void 0:t.tryAgain)==null||i.call(t)}k("engagement",{action:"retry"})},pause(){Di(!0)},resume(){In(!0)},resize(e,t){St(e,t)}},ei=ze;function Tx(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 kx(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
231
+ (function(){
232
+ var events = ['touchstart','touchend','mousedown','keydown'];
233
+ function unlock(){
234
+ if(window.AudioContext && AudioContext.prototype.resume){
235
+ if(!window.__handler_audio_ctx){
236
+ window.__handler_audio_ctx = new AudioContext();
237
+ }
238
+ if(window.__handler_audio_ctx.state === 'suspended'){
239
+ window.__handler_audio_ctx.resume();
240
+ }
241
+ }
242
+ events.forEach(function(e){ document.removeEventListener(e, unlock); });
243
+ }
244
+ events.forEach(function(e){ document.addEventListener(e, unlock, false); });
245
+ })();
246
+ `,e.appendChild(t)}var Ho=(n=>(n[n.PHONE_TALL=0]="PHONE_TALL",n[n.TABLET=1]="TABLET",n[n.LANDSCAPE=2]="LANDSCAPE",n))(Ho||{});function ea(e,t){let i=e/t;return i<=.62?0:i<=.85?1:2}var ji=class{constructor(t,i){this.root=t,this.stage=i,this.uiFrame=document.createElement("div"),this.uiFrame.style.position="absolute",this.uiFrame.style.top="0",this.uiFrame.style.bottom="0",this.uiFrame.style.left="50%",this.uiFrame.style.transform="translateX(-50%)",this.uiFrame.style.width="100%",this.uiFrame.style.maxWidth="420px",this.uiFrame.style.pointerEvents="none",this.stage.appendChild(this.uiFrame),this.uiContainer=document.createElement("div"),this.uiContainer.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","justify-content:flex-start","gap:12px","pointer-events:none","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),this.uiFrame.appendChild(this.uiContainer),this.updateLayout()}getUIFrame(){return this.uiFrame}getUIContainer(){return this.uiContainer}updateLayout(){let t=this.stage.getBoundingClientRect(),i=ea(t.width,t.height);i===0?this.uiFrame.style.maxWidth="420px":i===1?this.uiFrame.style.maxWidth="520px":this.uiFrame.style.maxWidth="640px"}getAspectClass(){let t=this.stage.getBoundingClientRect();return ea(t.width,t.height)}};async function Lh(e,t={}){let i=()=>{let b=e.getBoundingClientRect(),g=Math.floor(b.width),w=Math.floor(b.height);return(g<=0||!isFinite(g)||g!==g)&&(g=e.clientWidth||window.innerWidth||320),(w<=0||!isFinite(w)||w!==w)&&(w=e.clientHeight||window.innerHeight||480),(g<=0||!isFinite(g)||g!==g)&&(g=320),(w<=0||!isFinite(w)||w!==w)&&(w=480),console.log("[THREE-BASE] getSize result:",{width:g,height:w,boundingRect:{width:b.width,height:b.height},clientSize:{width:e.clientWidth,height:e.clientHeight},styleWidth:e.style.width,styleHeight:e.style.height,note:"Using boundingRect as primary source (actual rendered size)"}),{width:g,height:w}},n=e.style.width&&!e.style.width.includes("%"),r=e.style.height&&!e.style.height.includes("%");e.style.position||(e.style.position="relative"),e.style.display||(e.style.display="block"),e.style.width=e.style.width||"100%",e.style.height=e.style.height||"100%",e.style.minWidth="100%",e.style.minHeight="100%",e.style.maxWidth="100%",e.style.maxHeight="100%",e.style.boxSizing="border-box",e.style.overflow="hidden",e.style.margin="0",e.style.padding="0",e.style.border="none";let a=t.background||"linear-gradient(160deg, #0d1020, #0f1c2f)";e.style.setProperty("background",a,"important"),e.style.setProperty("background-size","cover","important"),e.style.setProperty("background-position","center","important"),e.style.setProperty("background-repeat","no-repeat","important");let s=document.createElement("div");s.style.cssText=`
247
+ position: absolute !important;
248
+ inset: 0 !important;
249
+ width: 100% !important;
250
+ height: 100% !important;
251
+ min-width: 100% !important;
252
+ min-height: 100% !important;
253
+ max-width: 100% !important;
254
+ max-height: 100% !important;
255
+ display: block !important;
256
+ background: ${a} !important;
257
+ background-size: cover !important;
258
+ background-position: center !important;
259
+ background-repeat: no-repeat !important;
260
+ color: var(--h-text, #f4f6ff);
261
+ font-family: var(--h-font-main, "Inter", "Helvetica Neue", Arial, sans-serif);
262
+ box-sizing: border-box !important;
263
+ margin: 0 !important;
264
+ padding: 0 !important;
265
+ border: none !important;
266
+ overflow: hidden !important;
267
+ `,e.appendChild(s);let o=document.createElement("div");o.setAttribute("style",["position:absolute","inset:0","width:100%","height:100%","min-width:100%","min-height:100%","max-width:100%","max-height:100%","pointer-events:auto","box-sizing:border-box","margin:0","padding:0","overflow:hidden"].join(";")),s.appendChild(o);let d=new Te.Scene,{width:l,height:c}=i(),f=new Te.AmbientLight(16777215,.6);d.add(f);let p=new Te.DirectionalLight(16777215,.8);p.position.set(5,5,5),p.castShadow=!1,d.add(p);let u=new Te.DirectionalLight(16777215,.3);u.position.set(-5,0,5),d.add(u);let v=new Te.PerspectiveCamera(55,l/c,.1,100);v.position.set(0,0,3.2),v.lookAt(0,0,0),v.updateMatrixWorld();let h=new Te.WebGLRenderer({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});h.setPixelRatio(window.devicePixelRatio||1),h.setSize(l,c),h.setClearColor(0,0),h.domElement.style.position="absolute",h.domElement.style.top="0",h.domElement.style.left="0",h.domElement.style.right="0",h.domElement.style.bottom="0",h.domElement.style.width="100%",h.domElement.style.height="100%",h.domElement.style.minWidth="100%",h.domElement.style.minHeight="100%",h.domElement.style.maxWidth="100%",h.domElement.style.maxHeight="100%",h.domElement.style.display="block",h.domElement.style.pointerEvents="auto",h.domElement.style.margin="0",h.domElement.style.padding="0",h.domElement.style.boxSizing="border-box",o.appendChild(h.domElement);let x=b=>{var _;let g=e.getBoundingClientRect(),w=window.getComputedStyle(e);console.log("[THREE-BASE] applySize called:",{providedSize:b,rootRect:{width:g.width,height:g.height},clientSize:{width:e.clientWidth,height:e.clientHeight},styleSize:{width:e.style.width,height:e.style.height},computedStyle:{width:w.width,height:w.height,transform:w.transform,scale:w.scale},rendererCurrentSize:{width:h.domElement.width,height:h.domElement.height},rendererStyleSize:{width:h.domElement.style.width,height:h.domElement.style.height},stackTrace:(_=new Error().stack)==null?void 0:_.split(`
268
+ `).slice(1,4).join(`
269
+ `)});let C=g.width,S=g.height;if((C<=0||!isFinite(C))&&(console.warn("[THREE-BASE] Invalid boundingRect.width, using clientWidth fallback",{boundingRectWidth:g.width,clientWidth:e.clientWidth}),C=e.clientWidth||window.innerWidth||320),(S<=0||!isFinite(S))&&(console.warn("[THREE-BASE] Invalid boundingRect.height, using clientHeight fallback",{boundingRectHeight:g.height,clientHeight:e.clientHeight}),S=e.clientHeight||window.innerHeight||480),typeof(b==null?void 0:b.width)=="number"&&b.width>0){let O=Math.abs(b.width-g.width),z=g.width*.1;O>z?console.warn("[THREE-BASE] Provided width ignored (too different from container):",{provided:b.width,container:g.width,difference:O,tolerance:z,willUse:"container size (boundingRect)"}):(C=b.width,console.log("[THREE-BASE] Using provided width (within tolerance):",{provided:b.width,container:g.width}))}if(typeof(b==null?void 0:b.height)=="number"&&b.height>0){let O=Math.abs(b.height-g.height),z=g.height*.1;O>z?console.warn("[THREE-BASE] Provided height ignored (too different from container):",{provided:b.height,container:g.height,difference:O,tolerance:z,willUse:"container size (boundingRect)"}):(S=b.height,console.log("[THREE-BASE] Using provided height (within tolerance):",{provided:b.height,container:g.height}))}(C<=0||S<=0||!isFinite(C)||!isFinite(S))&&(console.warn("[THREE-BASE] Invalid size in applySize, using fallback",{newWidth:C,newHeight:S,size:b,rootRect:g}),C=g.width||e.clientWidth||320,S=g.height||e.clientHeight||480);let A=Math.floor(C),T=Math.floor(S);console.log("[THREE-BASE] applySize setting renderer size:",{finalWidth:A,finalHeight:T,aspectRatio:A/T,beforeRendererSize:{width:h.domElement.width,height:h.domElement.height},beforeRendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height}}),h.setSize(A,T),h.setPixelRatio(window.devicePixelRatio||1),v.aspect=A/T,v.updateProjectionMatrix();let L=e.getBoundingClientRect();console.log("[THREE-BASE] applySize after setting:",{rendererSize:{width:h.domElement.width,height:h.domElement.height},rendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height},containerRect:{width:L.width,height:L.height},cameraAspect:v.aspect,matches:{width:Math.abs(h.domElement.width-L.width)<1,height:Math.abs(h.domElement.height-L.height)<1},sizeDifference:{width:h.domElement.width-L.width,height:h.domElement.height-L.height}})};requestAnimationFrame(()=>{requestAnimationFrame(()=>{x()})});let m=!1;ei.on("pause",()=>{m=!0,document.querySelectorAll("audio").forEach(g=>g.pause())}),ei.on("resume",()=>{m=!1,document.querySelectorAll("audio").forEach(g=>{g.currentTime>0&&!g.ended&&g.play().catch(()=>{})})});let y=new ji(e,s);return ei.on("resize",({payload:b})=>{console.log("[THREE-BASE] Handler resize event received:",{payload:b,timestamp:Date.now(),rootRect:e.getBoundingClientRect()}),x({width:b==null?void 0:b.width,height:b==null?void 0:b.height}),y.updateLayout()}),window.addEventListener("resize",()=>{console.log("[THREE-BASE] Window resize event received:",{timestamp:Date.now(),windowSize:{width:window.innerWidth,height:window.innerHeight},rootRect:e.getBoundingClientRect()}),x(),y.updateLayout()}),{scene:d,camera:v,renderer:h,uiSystem:y,applySize:x}}var ee=qe(require("three"),1),On=class{constructor(t){var i,n;this.position=(t==null?void 0:t.position)||{x:0,y:0},this.scale=(i=t==null?void 0:t.scale)!=null?i:1,this.rotation=(n=t==null?void 0:t.rotation)!=null?n:0}update(t){t.position!==void 0&&(this.position={...t.position}),t.scale!==void 0&&(this.scale=t.scale),t.rotation!==void 0&&(this.rotation=t.rotation)}syncToThree(t){let i=t.position.z,n=i===0||!isFinite(i)?.5:i;t.position.set(this.position.x,this.position.y,n),t.scale.set(this.scale,this.scale,this.scale),t.rotation.z=this.rotation}},Pn=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)}syncToThree(t){if(t.renderOrder=this.z_index,t.visible=this.visible,t instanceof ee.Mesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(i=>{i instanceof ee.Material&&(i.opacity=this.alpha,i.transparent=this.alpha<1)}):t.material instanceof ee.Material&&(t.material.opacity=this.alpha,t.material.transparent=this.alpha<1)),this.tint!==null&&t instanceof ee.Mesh&&t.material){let i=typeof this.tint=="string"?new ee.Color(this.tint):new ee.Color(this.tint);Array.isArray(t.material)?t.material.forEach(n=>{(n instanceof ee.MeshBasicMaterial||n instanceof ee.MeshStandardMaterial)&&n.color.copy(i)}):(t.material instanceof ee.MeshBasicMaterial||t.material instanceof ee.MeshStandardMaterial)&&t.material.color.copy(i)}}},Dn=class{constructor(t,i,n,r){this.instanceId=t,this.objectConfig=i,this.threeObject=n,this._config=r,this.transform=new On(r.transform),this.renderer=new Pn(r.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(t){this._config=t,t.transform&&this.transform.update(t.transform),t.render&&this.renderer.update(t.render),this.sync()}getComponent(t){return this._config[t]}getPosition(){return{...this.transform.position}}setPosition(t,i){this.transform.position={x:t,y:i},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToThree(this.threeObject)}},ta=class{constructor(t){this.objects=new Map;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}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){this.objects.delete(t)}clear(){this.objects.clear()}};var ia={"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 Be(e){let t=ia[e];return t?t.family:(console.warn(`Font ID "${e}" not found in registry, using fallback`),"Arial, sans-serif")}function Fe(e){var i;let t=ia[e];return t&&(i=t.weight)!=null?i:"400"}function Rh(e,t){ia[e]=t}function Mh(){return Object.keys(ia)}var zi=qe(require("three"),1);function Kt(e){return{element:e,get alpha(){return parseFloat(e.style.opacity||"1")},set alpha(t){e.style.opacity=t.toString()},get visible(){return e.style.display!=="none"},set visible(t){e.style.display=t?"":"none"},position:{set(t,i){e.style.left=`${t}px`,e.style.top=`${i}px`},get x(){return parseFloat(e.style.left||"0")},get y(){return parseFloat(e.style.top||"0")}},scale:{set(t,i){e.style.transform=`scale(${t})`},get x(){let t=e.style.transform.match(/scale\(([^)]+)\)/);return t?parseFloat(t[1]):1}}}}function Ih(e,t,i,n){var sl,ol,ll,cl,dl,ul,pl,fl,hl,gl,ml,bl,yl,vl,xl,wl,_l,El,Sl,Al,Cl,Tl,kl,Ll,Rl,Ml,Il,Ol,Pl,Dl,jl,zl,Bl,Fl,Nl,Hl,$l,Ul,Gl,ql,Wl,Yl,Vl,Xl,Kl,Zl,Jl,Ql,ec,tc,ic,nc,rc,ac,sc,oc,lc,cc,dc,uc,pc;let r=e.objects.get("ui_endgame_1"),a=e.objects.get("ui_endgame_logo_1"),s=e.objects.get("ui_endgame_title_1"),o=e.objects.get("ui_endgame_subtitle_1"),d=e.objects.get("ui_endgame_footer_1"),l=e.objects.get("ui_endgame_cta_1"),c=e.objects.get("ui_endgame_cta_hint_1"),f=e.objects.get("ui_endgame_hand_1"),p=e.engine.runtime||{},u=((sl=r==null?void 0:r.gameplay)==null?void 0:sl.tuning)||{},v=(r==null?void 0:r.render)||{},h=n.getBoundingClientRect(),x=h.width>0?h.width*.9:320,m=h.height>0?h.height*.85:400,y=Math.min((ol=u.panel_width)!=null?ol:320,x),b=Math.min((ll=u.panel_height)!=null?ll:400,m),g=(cl=u.panel_padding)!=null?cl:32,w=(dl=u.panel_radius)!=null?dl:24,C=v.background_color||u.panel_bg_color||"#1a0a0a",S=v.background_alpha!==void 0&&v.background_alpha!==null?v.background_alpha:(ul=u.panel_bg_alpha)!=null?ul:.98,A=v.border_color||u.panel_border_color||"#ffffff",T=(pl=u.panel_border_width)!=null?pl:2,L=(fl=u.panel_border_alpha)!=null?fl:.3,_=document.createElement("div");_.style.cssText=`
270
+ position: absolute;
271
+ width: ${y}px;
272
+ height: ${b}px;
273
+ background: ${C};
274
+ opacity: ${S};
275
+ border: ${T}px solid ${A};
276
+ border-opacity: ${L};
277
+ border-radius: ${w}px;
278
+ display: block;
279
+ transform: translate(-50%, -50%);
280
+ opacity: 0;
281
+ visibility: hidden;
282
+ pointer-events: auto;
283
+ left: 50%;
284
+ top: 50%;
285
+ z-index: 1000;
286
+ box-sizing: border-box;
287
+ padding: ${g}px;
288
+ `,n.appendChild(_);let O=Kt(_);O.element=_;let z=((hl=a==null?void 0:a.gameplay)==null?void 0:hl.tuning)||{},le=(a==null?void 0:a.transform)||{},te=(gl=z.logo_size)!=null?gl:56,ne=(ml=le.scale)!=null?ml:1,xe=(yl=(bl=le.offset)==null?void 0:bl.y)!=null?yl:-130,Ne=(vl=z.logo_alpha)!=null?vl:1,$h=new zi.SpriteMaterial({map:i||void 0,transparent:!0,alphaTest:.1}),ke=new zi.Sprite($h);ke.position.set(0,xe,0),ke.material.opacity=0;let jn=0,zn=0;if(i){let re=i.image;jn=(re==null?void 0:re.width)||100,zn=(re==null?void 0:re.height)||100}if(jn>0&&zn>0){let re=jn/zn,pa,fa;re>1?(pa=te,fa=te/re):(fa=te,pa=te*re);let Tg=pa/jn*ne,kg=fa/zn*ne;ke.scale.set(Tg,kg,1)}else{let re=te/100*ne;ke.scale.set(re,re,1)}ke.targetAlpha=Ne,ke.baseScaleX=ke.scale.x,ke.baseScaleY=ke.scale.y;let ce=s==null?void 0:s.ui,He=((xl=s==null?void 0:s.gameplay)==null?void 0:xl.tuning)||{},Uh=(ce==null?void 0:ce.text)||"MISSION ACCOMPLISHED",qo=(ce==null?void 0:ce.font)||"brand.heading",ra=(ce==null?void 0:ce.fontSize)||24,Gh=(wl=ce==null?void 0:ce.letterSpacing)!=null?wl:1,Bn=(_l=s==null?void 0:s.render)==null?void 0:_l.tint,qh=typeof Bn=="string"?Bn:Bn?`#${Bn.toString(16).padStart(6,"0")}`:"#00FF88",Wh=y-g*2-30,Yh=He.font_weight_override?He.font_weight_override:Fe(qo),At=document.createElement("div");At.textContent=Uh,At.style.cssText=`
289
+ font-family: ${Be(qo)};
290
+ font-size: ${ra}px;
291
+ font-weight: ${Yh};
292
+ color: ${qh};
293
+ text-align: center;
294
+ letter-spacing: ${Gh}px;
295
+ -webkit-text-stroke: ${(El=He.stroke_width)!=null?El:2}px ${He.stroke_color||"#000000"};
296
+ text-shadow: ${(Sl=He.shadow_distance)!=null?Sl:4}px ${(Al=He.shadow_distance)!=null?Al:4}px ${(Cl=He.shadow_blur)!=null?Cl:8}px rgba(0,0,0,${(Tl=He.shadow_alpha)!=null?Tl:.9});
297
+ opacity: 0;
298
+ position: absolute;
299
+ transform: translate(-50%, -50%);
300
+ white-space: nowrap;
301
+ max-width: ${Wh}px;
302
+ `;let Wo=g+30,Vh=((kl=u.title_offset_y)!=null?kl:Wo+ra/2)+((Ll=He.animation_start_y_offset)!=null?Ll:-20);At.style.top=`${Vh}px`,At.style.left="50%";let Yo=Kt(At);Yo.element=At,_.appendChild(At);let de=o==null?void 0:o.ui,Vo=((Rl=o==null?void 0:o.gameplay)==null?void 0:Rl.tuning)||{},Xh=(de==null?void 0:de.text)||"RESCUE COMPLETE",Xo=(de==null?void 0:de.font)||"brand.body",aa=(de==null?void 0:de.fontSize)||11,Kh=(Ml=de==null?void 0:de.letterSpacing)!=null?Ml:.5,Fn=(Il=o==null?void 0:o.render)==null?void 0:Il.tint,Zh=typeof Fn=="string"?Fn:Fn?`#${Fn.toString(16).padStart(6,"0")}`:"#B0B0B0",Ct=document.createElement("div");Ct.textContent=Xh,Ct.style.cssText=`
303
+ font-family: ${Be(Xo)};
304
+ font-size: ${aa}px;
305
+ font-weight: ${Fe(Xo)};
306
+ color: ${Zh};
307
+ text-align: center;
308
+ letter-spacing: ${Kh}px;
309
+ opacity: 0;
310
+ position: absolute;
311
+ transform: translate(-50%, -50%);
312
+ white-space: nowrap;
313
+ `;let Ko=Wo+ra+15,Jh=((Ol=u.subtitle_offset_y)!=null?Ol:Ko+aa/2)+((Pl=Vo.animation_start_y_offset)!=null?Pl:-10);Ct.style.top=`${Jh}px`,Ct.style.left="50%";let sa=Kt(Ct);sa.element=Ct,sa.animationStartYOffset=(Dl=Vo.animation_start_y_offset)!=null?Dl:-10,_.appendChild(Ct);let $e=d==null?void 0:d.ui,Zo=((jl=d==null?void 0:d.gameplay)==null?void 0:jl.tuning)||{},Qh=($e==null?void 0:$e.text)||((zl=p.ui)==null?void 0:zl.cta_hint)||"Continue the adventure!",Jo=($e==null?void 0:$e.font)||"brand.body",Qo=($e==null?void 0:$e.fontSize)||16,Nn=(Bl=d==null?void 0:d.render)==null?void 0:Bl.tint,eg=typeof Nn=="string"?Nn:Nn?`#${Nn.toString(16).padStart(6,"0")}`:"#FFFFFF",tg=(Fl=Zo.max_width)!=null?Fl:y-g*2,ig=(Nl=Zo.line_height)!=null?Nl:1.4,Tt=document.createElement("div");Tt.textContent=Qh,Tt.style.cssText=`
314
+ font-family: ${Be(Jo)};
315
+ font-size: ${Qo}px;
316
+ font-weight: ${Fe(Jo)};
317
+ color: ${eg};
318
+ text-align: center;
319
+ opacity: 0;
320
+ position: absolute;
321
+ transform: translate(-50%, -50%);
322
+ max-width: ${tg}px;
323
+ line-height: ${ig};
324
+ word-wrap: break-word;
325
+ `;let ng=Ko+aa+30,rg=(Hl=u.footer_offset_y)!=null?Hl:ng+Qo/2;Tt.style.top=`${rg}px`,Tt.style.left="50%";let oa=Kt(Tt);oa.element=Tt;let ag=(($l=d==null?void 0:d.render)==null?void 0:$l.alpha)!==void 0&&((Ul=d==null?void 0:d.render)==null?void 0:Ul.alpha)!==null?d.render.alpha:1;oa.targetAlpha=ag,_.appendChild(Tt);let Ue=((Gl=l==null?void 0:l.gameplay)==null?void 0:Gl.tuning)||{},ue=l==null?void 0:l.ui,sg=(ql=Ue.button_width)!=null?ql:260,el=(Wl=Ue.button_height)!=null?Wl:56,og=(Yl=Ue.button_radius)!=null?Yl:16,lg=Ue.button_bg_color||((Vl=p.theme)==null?void 0:Vl.cta_background)||"#ffb43b",cg=(Xl=Ue.button_bg_alpha)!=null?Xl:1,dg=Ue.button_border_color||"#ffffff",ug=(Kl=Ue.button_border_width)!=null?Kl:2,Bx=(Zl=Ue.button_border_alpha)!=null?Zl:.2,la=(Jl=u.cta_offset_y)!=null?Jl:b*.7,X=document.createElement("button");X.style.cssText=`
326
+ width: ${sg}px;
327
+ height: ${el}px;
328
+ background: ${lg};
329
+ opacity: ${cg};
330
+ border: ${ug}px solid ${dg};
331
+ border-radius: ${og}px;
332
+ cursor: pointer;
333
+ opacity: 0;
334
+ position: absolute;
335
+ transform: translate(-50%, -50%);
336
+ box-shadow: inset 0 0 1px rgba(0,0,0,0.15);
337
+ `,X.style.top=`${la}px`,X.style.left="50%";let ca=Kt(X);ca.element=X,ca.addEventListener=X.addEventListener.bind(X),_.appendChild(X);let pg=(ue==null?void 0:ue.text)||((Ql=p.ui)==null?void 0:Ql.cta_label_end)||"DOWNLOAD",tl=(ue==null?void 0:ue.font)||"brand.heading",fg=(ue==null?void 0:ue.fontSize)||20,hg=Ue.button_text_color||((ec=p.theme)==null?void 0:ec.cta_text)||"#1a0a0a";X.textContent=pg,X.style.fontFamily=Be(tl),X.style.fontSize=`${fg}px`,X.style.fontWeight=String(Fe(tl)),X.style.color=hg,X.style.letterSpacing=`${(tc=ue==null?void 0:ue.letterSpacing)!=null?tc:1}px`;let il=Kt(X);il.element=X;let pe=c==null?void 0:c.ui,nl=((ic=c==null?void 0:c.gameplay)==null?void 0:ic.tuning)||{},gg=(pe==null?void 0:pe.text)||"Play the full game",rl=(pe==null?void 0:pe.font)||"brand.body",mg=(pe==null?void 0:pe.fontSize)||11,bg=(nc=pe==null?void 0:pe.letterSpacing)!=null?nc:0,Hn=(rc=c==null?void 0:c.render)==null?void 0:rc.tint,yg=typeof Hn=="string"?Hn:Hn?`#${Hn.toString(16).padStart(6,"0")}`:"#CCCCCC",kt=document.createElement("div");kt.textContent=gg,kt.style.cssText=`
338
+ font-family: ${Be(rl)};
339
+ font-size: ${mg}px;
340
+ font-weight: ${Fe(rl)};
341
+ color: ${yg};
342
+ text-align: center;
343
+ letter-spacing: ${bg}px;
344
+ opacity: 0;
345
+ position: absolute;
346
+ transform: translate(-50%, -50%);
347
+ white-space: nowrap;
348
+ `;let vg=la+el/2+20,xg=b-g-10,wg=Math.min(vg+((ac=nl.animation_start_y_offset)!=null?ac:5),xg);kt.style.top=`${wg}px`,kt.style.left="50%";let da=Kt(kt);da.element=kt,da.animationStartYOffset=(sc=nl.animation_start_y_offset)!=null?sc:5,_.appendChild(kt);let ua=((oc=f==null?void 0:f.gameplay)==null?void 0:oc.tuning)||{},_g=(lc=ua.hand_offset_x)!=null?lc:50,Eg=(cc=ua.hand_offset_y)!=null?cc:50,Sg=(uc=(dc=f==null?void 0:f.transform)==null?void 0:dc.scale)!=null?uc:.1875,Ag=(pc=ua.hand_scale_multiplier)!=null?pc:2.5,Cg=new zi.SpriteMaterial({map:t||void 0,transparent:!0,alphaTest:.1}),Fi=new zi.Sprite(Cg),al=Sg*Ag*100;return Fi.scale.set(al,al,1),Fi.position.set(_g,la+Eg,0),Fi.material.opacity=0,Fi.visible=!1,{panel:O,logo:ke,title:Yo,subtitle:sa,footer:oa,ctaButton:ca,ctaText:il,ctaHint:da,hand:Fi}}function Oh(e,t,i){var C,S,A,T,L,_,O,z;let n=t.objects.get("ui_endgame_1"),r=((C=n==null?void 0:n.gameplay)==null?void 0:C.tuning)||{},a=(S=r.animation_duration_ms)!=null?S:800,s=(A=r.fade_in_duration_ms)!=null?A:600,o=(T=r.scale_animation_intensity)!=null?T:.1,d=(L=r.logo_animation_delay_ms)!=null?L:100,l=(_=r.title_animation_delay_ms)!=null?_:200,c=(O=r.footer_animation_delay_ms)!=null?O:300,f=(z=r.cta_animation_delay_ms)!=null?z:400,{panel:p,logo:u,title:v,subtitle:h,footer:x,ctaButton:m,ctaText:y,ctaHint:b}=e;p.visible=!0,p.element.style.visibility="visible";let g=Date.now(),w=()=>{let le=Date.now()-g,te=Math.min(le/s,1),ne=1-Math.pow(1-te,3);p.alpha=ne,p.element.style.opacity=ne.toString();let xe=1+o*(1-ne);p.element.style.transform=`translate(-50%, -50%) scale(${xe})`,te<1?requestAnimationFrame(w):(setTimeout(()=>Lx(u,a,t),d),setTimeout(()=>{Rx(v,a),setTimeout(()=>Mx(h,a),50)},l),setTimeout(()=>Ix(x,a),c),setTimeout(()=>{Ox(m,y,a),setTimeout(()=>Px(b,a),50),i&&i()},f))};w()}function Lx(e,t,i){var p,u,v,h,x;let n=i==null?void 0:i.objects.get("ui_endgame_logo_1"),a=(u=(((p=n==null?void 0:n.gameplay)==null?void 0:p.tuning)||{}).animation_start_scale)!=null?u:1.2,s=Date.now(),o=e.material.opacity,d=(v=e.targetAlpha)!=null?v:1,l=(h=e.baseScaleX)!=null?h:e.scale.x,c=(x=e.baseScaleY)!=null?x:e.scale.y,f=()=>{let m=Date.now()-s,y=Math.min(m/t,1),b=1-Math.pow(1-y,2);e.material.opacity=o+(d-o)*b;let g=a+(1-a)*b;e.scale.set(l*g,c*g,1),y<1&&requestAnimationFrame(f)};f()}function Rx(e,t){let i=Date.now(),n=parseFloat(e.element.style.opacity||"0"),r=parseFloat(e.element.style.top||"0"),a=()=>{let s=Date.now()-i,o=Math.min(s/t,1),d=1-Math.pow(1-o,2);e.element.style.opacity=(n+(1-n)*d).toString(),e.element.style.top=`${r-20*(1-d)}px`,o<1&&requestAnimationFrame(a)};a()}function Mx(e,t){var o;let i=Date.now(),n=parseFloat(e.element.style.opacity||"0"),r=parseFloat(e.element.style.top||"0"),a=r-((o=e.animationStartYOffset)!=null?o:-10),s=()=>{let d=Date.now()-i,l=Math.min(d/t,1),c=1-Math.pow(1-l,2);e.element.style.opacity=(n+(1-n)*c).toString(),e.element.style.top=`${r+(a-r)*c}px`,l<1&&requestAnimationFrame(s)};s()}function Ix(e,t){var s;let i=Date.now(),n=parseFloat(e.element.style.opacity||"0"),r=(s=e.targetAlpha)!=null?s:1,a=()=>{let o=Date.now()-i,d=Math.min(o/t,1),l=1-Math.pow(1-d,2);e.element.style.opacity=(n+(r-n)*l).toString(),d<1&&requestAnimationFrame(a)};a()}function Ox(e,t,i){let n=Date.now(),r=parseFloat(e.element.style.opacity||"0"),a=()=>{let s=Date.now()-n,o=Math.min(s/i,1),d=1-Math.pow(1-o,2);e.element.style.opacity=(r+(1-r)*d).toString(),t.element.style.opacity=(r+(1-r)*d).toString(),e.element.style.transform=`translate(-50%, -50%) scale(${1+.1*(1-d)})`,o<1&&requestAnimationFrame(a)};a()}function Px(e,t){var o;let i=Date.now(),n=parseFloat(e.element.style.opacity||"0"),r=parseFloat(e.element.style.top||"0"),a=r-((o=e.animationStartYOffset)!=null?o:5),s=()=>{let d=Date.now()-i,l=Math.min(d/t,1),c=1-Math.pow(1-l,2);e.element.style.opacity=(n+(1-n)*c).toString(),e.element.style.top=`${r+(a-r)*c}px`,l<1&&requestAnimationFrame(s)};s()}function Ph(e,t,i,n){var c,f,p,u;let r=i.objects.get("ui_endgame_hand_1"),a=((c=r==null?void 0:r.gameplay)==null?void 0:c.tuning)||{},s=(f=a.click_animation_duration_ms)!=null?f:600,o=(p=a.click_delay_ms)!=null?p:2e3,d=(u=a.click_repeat_delay_ms)!=null?u:3e3,l=()=>{var S,A;e.visible=!0,e.material.opacity=1;let v=e.position.x,h=e.position.y,x=(S=a.hand_offset_x)!=null?S:50,m=(A=a.hand_offset_y)!=null?A:50,y=t.element.getBoundingClientRect(),b=x,g=m,w=Date.now(),C=()=>{var ne,xe,Ne;let T=Date.now()-w,L=Math.min(T/s,1),_=L<.5?2*L*L:1-Math.pow(-2*L+2,2)/2;e.position.set(v+(b-v)*_,h+(g-h)*_,0);let O=(xe=(ne=r==null?void 0:r.transform)==null?void 0:ne.scale)!=null?xe:.1875,z=(Ne=a.hand_scale_multiplier)!=null?Ne:2.5,le=O*z*100,te=le+le*.2*Math.sin(L*Math.PI);e.scale.set(te,te,1),L<1?requestAnimationFrame(C):(t.element.style.transform="translate(-50%, -50%) scale(0.95)",setTimeout(()=>{t.element.style.transform="translate(-50%, -50%) scale(1)",n()},100),setTimeout(()=>{e.material.opacity=0,setTimeout(()=>{e.position.set(v,h,0),l()},d)},500))};C()};setTimeout(l,o)}var na=qe(require("three"),1);function Dh(e,t,i){var u,v,h,x,m,y,b;let n=t.objects.get("hand_tutorial_1"),r=((u=n==null?void 0:n.gameplay)==null?void 0:u.tuning)||{},a=(n==null?void 0:n.render)||{},s=(n==null?void 0:n.transform)||{},o=new na.SpriteMaterial({map:e||void 0,transparent:!0,alphaTest:.1}),d=new na.Sprite(o),l=s.position||{},c=(v=l==null?void 0:l.z)!=null?v:0;d.position.set(i.x+((h=l==null?void 0:l.x)!=null?h:0),i.y+((x=l==null?void 0:l.y)!=null?x:0),c),d.material.opacity=a.alpha!==void 0&&a.alpha!==null?a.alpha:0,d.visible=a.visible!==void 0&&a.visible!==null?a.visible:!1;let f=(m=r.hand_scale_multiplier)!=null?m:2.5,p=(y=s.scale)!=null?y:.1875;return d.scale.set(p*f*100,p*f*100,1),d.renderOrder=(b=a.z_index)!=null?b:99999,d}function jh(e){var v,h,x,m,y,b,g,w,C;let t=e.objects.get("ui_tutorial_1"),i=t==null?void 0:t.ui,n=(t==null?void 0:t.render)||{},r=((v=e.engine.runtime)==null?void 0:v.ui_styles)||{},a=((h=e.engine.runtime)==null?void 0:h.ui)||{},s=(i==null?void 0:i.text)||a.tutorial_label||a.label_text||"CLEAN!",o=(i==null?void 0:i.font)||"brand.warning",d=(i==null?void 0:i.fontSize)||r.label_font_size||52,l=(m=i==null?void 0:i.letterSpacing)!=null?m:(x=r.label_letter_spacing)!=null?x:-1,c=(i==null?void 0:i.align)||"center",f=n.tint,p=typeof f=="string"?f:f?`#${f.toString(16).padStart(6,"0")}`:r.label_fill||"#FFF1C1",u=document.createElement("div");return u.textContent=s,u.style.cssText=`
349
+ font-family: ${Be(o)};
350
+ font-size: ${d}px;
351
+ font-weight: ${Fe(o)};
352
+ color: ${p};
353
+ text-align: ${c};
354
+ letter-spacing: ${l}px;
355
+ text-shadow: ${(y=r.label_shadow_distance)!=null?y:2}px ${(b=r.label_shadow_distance)!=null?b:2}px ${(g=r.label_shadow_blur)!=null?g:4}px rgba(0,0,0,${(w=r.label_shadow_alpha)!=null?w:.8});
356
+ -webkit-text-stroke: ${r.label_stroke||"#8B0000"} 2px;
357
+ opacity: ${(C=n.alpha)!=null?C:0};
358
+ visibility: ${n.visible!==!1?"visible":"hidden"};
359
+ pointer-events: none;
360
+ position: absolute;
361
+ transform: translate(-50%, -50%);
362
+ white-space: nowrap;
363
+ `,u}function zh(e,t,i,n,r){var d,l,c,f,p,u,v;let a=r.objects.get("hand_tutorial_1"),s=((d=a==null?void 0:a.gameplay)==null?void 0:d.tuning)||{},o=(a==null?void 0:a.transform)||{};if(!n){let h=(l=s.animation_duration)!=null?l:1.5,x=i%h/h,m=x<.5?2*x*x:-1+(4-2*x)*x,y=(c=s.x_offset)!=null?c:0,b=(f=s.y_offset)!=null?f:0,g=(p=s.animation_range)!=null?p:40,w=g*.7,C=g,S=t.x+y+w,A=t.y+b+C,T=S+w,L=A+C;e.position.set(S+(T-S)*m,A+(L-A)*m,0);let _=(u=o.scale)!=null?u:.1875,O=(v=s.hand_scale_multiplier)!=null?v:2.5,z=_*O*100;e.scale.set(z,z,1)}}var Bi=qe(require("three"),1),Bh=new Bi.TextureLoader,$o=null,Uo=null;async function Fh(){if($o)return $o;if(!Uo){let i=(()=>{if(typeof window!="undefined")try{return new URL("inline-assets.js",window.location.href).href}catch{return"./inline-assets.js"}return"./inline-assets.js"})();Uo=fetch(i).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.text()}).then(n=>{let r=n.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(r)return new Function("return "+r[1])();throw new Error("INLINE_ASSETS export not found")}).then(n=>n?n.INLINE_ASSETS?n.INLINE_ASSETS:(console.warn("[assets] Module does not have INLINE_ASSETS export. Module keys:",Object.keys(n)),{}):(console.warn("[assets] Module import returned undefined"),{})).catch(n=>(console.warn("[assets] Failed to load inline-assets.js:",n),{}))}let e=await Uo;return $o=e||{},e||{}}async function Go(e,t,i=16777215,n=!1){try{let a=(await Fh())[e];return await Bh.loadAsync(a||e)}catch{console.warn(`Asset missing: ${e}. Using placeholder.`);let a=document.createElement("canvas");a.width=64,a.height=64;let s=a.getContext("2d");return s&&(s.fillStyle=`#${i.toString(16).padStart(6,"0")}`,n?s.fillRect(0,0,30,60):(s.beginPath(),s.arc(32,32,30,0,Math.PI*2),s.fill(),s.fillRect(27,32,10,40))),new Bi.CanvasTexture(a)}}async function Nh(e,t,i){var h,x;let r=(await Fh())[e]||e,a;try{a=await Bh.loadAsync(r),console.log("[character] loaded sheet",{path:e,sourceUsed:r})}catch(m){let g=((i.gameplay.character_sheet||{}).fallback_color||"#ff00ff").replace("#","");a=await Go(e,t,parseInt(g,16),!0),console.warn("[character] fallback loadAsset used",{path:e,err:m})}if(!a)return[];let s=i.gameplay.character_sheet||{},o=(h=s.cols)!=null?h:3,d=(x=s.rows)!=null?x:2,l=a.image,c=(l==null?void 0:l.width)||0,f=(l==null?void 0:l.height)||0,p=c/o,u=f/d;if(!Number.isFinite(p)||!Number.isFinite(u)||p<=0||u<=0)return[a];let v=[];for(let m=0;m<d;m++)for(let y=0;y<o;y++){let b=document.createElement("canvas");b.width=p,b.height=u;let g=b.getContext("2d");g&&l&&g.drawImage(l,y*p,m*u,p,u,0,0,p,u),v.push(new Bi.CanvasTexture(b))}return v.length>2&&v.push(...v.slice(1,-1).reverse()),console.log("[character] frames prepared",{count:v.length}),v}function Hh(e,t){var f,p,u,v;let i=t.gameplay.brush||{},n=t.theme.brush_color||"#ffffff",r=(f=i.radius)!=null?f:20,a=(p=i.inner_radius)!=null?p:15,s=(u=i.alpha)!=null?u:.8,o=(v=i.inner_alpha)!=null?v:.3,d=i.inner_color||"#ffffff",l=document.createElement("canvas");l.width=r*2,l.height=r*2;let c=l.getContext("2d");return c&&(c.clearRect(0,0,l.width,l.height),c.beginPath(),c.arc(r,r,r,0,Math.PI*2),c.fillStyle=n,c.globalAlpha=s,c.fill(),c.beginPath(),c.arc(r,r,a,0,Math.PI*2),c.fillStyle=d,c.globalAlpha=o,c.fill()),new Bi.CanvasTexture(l)}0&&(module.exports={AspectClass,GameObject,GameObjectManager,Renderer,ResponsiveUISystem,Transform,animateHandClick,animatePanelEntrance,createBrushTexture,createEndGamePanel,createHandTutorial,createThreeBase,createTutorialLabel,getAspectClass,getRegisteredFontIds,loadAsset,loadCharacterFrames,registerFont,resolveFont,resolveFontWeight,updateHandAnimation});