handler-playable-sdk 0.3.13 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SXURSNAQ.js → chunk-NYX6PJFK.js} +63 -34
- package/dist/index.cjs +60 -31
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +9 -9
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +35 -35
- package/dist/three/index.js +1 -1
- package/package.json +2 -2
package/dist/three/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Dg=Object.create;var Un=Object.defineProperty;var jg=Object.getOwnPropertyDescriptor;var zg=Object.getOwnPropertyNames;var Bg=Object.getPrototypeOf,Fg=Object.prototype.hasOwnProperty;var qe=(e,t)=>()=>(e&&(t=e(e=0)),t);var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hc=(e,t)=>{for(var i in t)Un(e,i,{get:t[i],enumerable:!0})},gc=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of zg(t))!Fg.call(e,r)&&r!==i&&Un(e,r,{get:()=>t[r],enumerable:!(n=jg(t,r))||n.enumerable});return e};var Ge=(e,t,i)=>(i=e!=null?Dg(Bg(e)):{},gc(t||!e||!e.__esModule?Un(i,"default",{value:e,enumerable:!0}):i,e)),Ng=e=>gc(Un({},"__esModule",{value:!0}),e);var We,wa=qe(()=>{"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 Yg(){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 Vg(){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 Xg(){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 Kg(){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(!_a){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),_a=(async()=>{try{try{let a=await import(t+"?t="+Date.now());if(a.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(a.INLINE_ASSETS)),a.INLINE_ASSETS}catch(a){console.warn("[AssetLoader] ES module import failed, trying text parse:",a)}let i=await fetch(t);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);let n=await i.text();console.log("[AssetLoader] Received JS code, length:",n.length);let r=n.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(r)try{let a=r[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let s=new Function("return "+a)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(s)),s}catch(a){return console.warn("[AssetLoader] Failed to parse inline assets:",a),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",n.substring(0,500)),{}}catch(i){return console.warn("[AssetLoader] Failed to load inline assets:",i),{}}})()}return Ye=await _a,console.log("[AssetLoader] Final inline assets cache:",Object.keys(Ye)),Ye}function Ea(e){return e===null||typeof e!="object"||(Object.freeze(e),Object.values(e).forEach(t=>Ea(t))),e}function Zg(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 Sa(e,t){Vc.set(e,t)}var Ve,Wc,Yc,Lt,B,Le,ut,Ye,_a,Vc,Rt,Yn=qe(()=>{"use strict";Ve=require("pixi.js");wa();Wc=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Yc=Yg(),Lt=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,B=Yc?"publish":Wc,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=Xg();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);Vg().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: ${Wc}, Runtime: ${Yc?"publish":"dev"}, Effective: ${B}`);Ye={},_a=null;Vc=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 Kg(),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=Vc.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=Ea(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"?Zg():Ea({__placeholder:!0,type:i});return We.set(t+":"+((n==null?void 0:n.path)||"missing"),a),a}throw n}};Sa("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)});Sa("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 Ca,im,Vn,Ui=qe(()=>{"use strict";Yn();Ca=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(t,i){if(this.config===t&&this.app===i&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(n=>{this.priorityReadyResolve=n}),this.config=t,this.app=i,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let t=this.config,i=this.app;return this.readyPromise=(async()=>{var s;console.log("[AssetTextures] Loading all assets...");let n=new Set(["background_loading_1"]),r=[],a=[];for(let[o,d]of t.objects.entries()){let l=(s=d.render)==null?void 0:s.asset;if(!l)continue;let c=async()=>{var f;try{let p=(f=d.identity)==null?void 0:f.id;console.log(`[AssetTextures] Loading ${l.type}: ${o} (${p})`);let u=await Rt.load(o,l,i,p);this.textures.set(o,u),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(p){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,p)}finally{this.attempted.add(o);try{for(let p of Array.from(this.waiters))p()}catch{}}};n.has(o)?r.push(c()):a.push(c())}r.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(r),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(a),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(t,i={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let r=Array.from(new Set((t||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var d,l,c,f;try{let p=(c=(l=(d=this.config)==null?void 0:d.objects)==null?void 0:l.get)==null?void 0:c.call(l,o);return!!((f=p==null?void 0:p.render)!=null&&f.asset)}catch{return!1}});if(r.length===0)return;this.ready().catch(()=>{});let a=()=>r.every(o=>this.textures.has(o)||this.attempted.has(o));if(a())return;let s=typeof i.timeoutMs=="number"?i.timeoutMs:15e3;await new Promise(o=>{let d=!1,l=()=>{d||a()&&(d=!0,this.waiters.delete(l),o())};this.waiters.add(l),l(),s>0&&setTimeout(()=>{d||(d=!0,this.waiters.delete(l),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:r}),o())},s)})}get(t){return this.textures.get(t)}set(t,i){this.textures.set(t,i),console.log(`[AssetTextures] Updated texture: ${t}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},im=new Ca,Vn=new Proxy(im,{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 Sm,pt=qe(()=>{"use strict";Sm="handler_preview_override_mode";if(typeof window!="undefined"){let e=window.localStorage.getItem(Sm);window.__enableConfigOverrides=e===null?!0:e==="true"}});var Qc,It,m_,Ra=qe(()=>{"use strict";pt();Qc=null,It="dev";if(typeof window!="undefined"){let e=window.__BUILD_SETTINGS__;if(e!=null&&e.buildMode)Qc=e,It=e.buildMode,console.log("[CONFIG] Loaded inline build settings:",e,"buildMode:",It);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);Qc=i,It=i.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",i,"buildMode:",It)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",It)}catch(t){console.log("[CONFIG] Failed to load build-settings.json:",t instanceof Error?t.message:String(t))}}console.log("[CONFIG] Final buildMode:",It);m_=It==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var Ma=qe(()=>{"use strict"});var td=qe(()=>{"use strict";Ma();Ra()});var Oa=qe(()=>{"use strict";Ra();Ma();td()});var Wi=S((T1,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:Pm}:Ia.exports=process;function Pm(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 rd=S((k1,nd)=>{"use strict";var Dm={}.toString;nd.exports=Array.isArray||function(e){return Dm.call(e)=="[object Array]"}});var Pa=S((L1,ad)=>{"use strict";ad.exports=require("stream")});var Yi=S((Da,od)=>{"use strict";var nr=require("buffer"),Je=nr.Buffer;function sd(e,t){for(var i in e)t[i]=e[i]}Je.from&&Je.alloc&&Je.allocUnsafe&&Je.allocUnsafeSlow?od.exports=nr:(sd(nr,Da),Da.Buffer=ti);function ti(e,t,i){return Je(e,t,i)}sd(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 nr.SlowBuffer(e)}});var ii=S(K=>{"use strict";function jm(e){return Array.isArray?Array.isArray(e):rr(e)==="[object Array]"}K.isArray=jm;function zm(e){return typeof e=="boolean"}K.isBoolean=zm;function Bm(e){return e===null}K.isNull=Bm;function Fm(e){return e==null}K.isNullOrUndefined=Fm;function Nm(e){return typeof e=="number"}K.isNumber=Nm;function Hm(e){return typeof e=="string"}K.isString=Hm;function $m(e){return typeof e=="symbol"}K.isSymbol=$m;function Um(e){return e===void 0}K.isUndefined=Um;function qm(e){return rr(e)==="[object RegExp]"}K.isRegExp=qm;function Gm(e){return typeof e=="object"&&e!==null}K.isObject=Gm;function Wm(e){return rr(e)==="[object Date]"}K.isDate=Wm;function Ym(e){return rr(e)==="[object Error]"||e instanceof Error}K.isError=Ym;function Vm(e){return typeof e=="function"}K.isFunction=Vm;function Xm(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}K.isPrimitive=Xm;K.isBuffer=require("buffer").Buffer.isBuffer;function rr(e){return Object.prototype.toString.call(e)}});var ld=S((M1,ja)=>{"use strict";typeof Object.create=="function"?ja.exports=function(t,i){i&&(t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ja.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=S((O1,Ba)=>{"use strict";try{if(za=require("util"),typeof za.inherits!="function")throw"";Ba.exports=za.inherits}catch{Ba.exports=ld()}var za});var dd=S((I1,Fa)=>{"use strict";function Km(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var cd=Yi().Buffer,Vi=require("util");function Zm(e,t,i){e.copy(t,i)}Fa.exports=(function(){function e(){Km(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 cd.alloc(0);for(var n=cd.allocUnsafe(i>>>0),r=this.head,a=0;r;)Zm(r.data,n,a),a+=r.data.length,r=r.next;return n},e})();Vi&&Vi.inspect&&Vi.inspect.custom&&(Fa.exports.prototype[Vi.inspect.custom]=function(){var e=Vi.inspect({length:this.length});return this.constructor.name+" "+e})});var Na=S((P1,ud)=>{"use strict";var ar=Wi();function Jm(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,ar.nextTick(sr,this,e)):ar.nextTick(sr,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,ar.nextTick(sr,i,a)):ar.nextTick(sr,i,a):t&&t(a)}),this)}function Qm(){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 sr(e,t){e.emit("error",t)}ud.exports={destroy:Jm,undestroy:Qm}});var fd=S((D1,pd)=>{"use strict";pd.exports=require("util").deprecate});var $a=S((j1,wd)=>{"use strict";var Pt=Wi();wd.exports=$;function gd(e){var t=this;this.next=null,this.entry=null,this.finish=function(){bb(t,e)}}var eb=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Pt.nextTick,ri;$.WritableState=Ki;var md=Object.create(ii());md.inherits=ni();var tb={deprecate:fd()},bd=Pa(),lr=Yi().Buffer,ib=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function nb(e){return lr.from(e)}function rb(e){return lr.isBuffer(e)||e instanceof ib}var yd=Na();md.inherits($,bd);function ab(){}function Ki(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){pb(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 gd(this)}Ki.prototype.getBuffer=function(){for(var t=this.bufferedRequest,i=[];t;)i.push(t),t=t.next;return i};(function(){try{Object.defineProperty(Ki.prototype,"buffer",{get:tb.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var or;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(or=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(e){return or.call(this,e)?!0:this!==$?!1:e&&e._writableState instanceof Ki}})):or=function(e){return e instanceof this};function $(e){if(ri=ri||Dt(),!or.call($,this)&&!(this instanceof ri))return new $(e);this._writableState=new Ki(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)),bd.call(this)}$.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function sb(e,t){var i=new Error("write after end");e.emit("error",i),Pt.nextTick(t,i)}function ob(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&&rb(e);return a&&!lr.isBuffer(e)&&(e=nb(e)),typeof t=="function"&&(i=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof i!="function"&&(i=ab),n.ended?sb(this,i):(a||ob(this,n,e,i))&&(n.pendingcb++,r=cb(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&&vd(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 lb(e,t,i){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=lr.from(t,i)),t}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cb(e,t,i,n,r,a){if(!i){var s=lb(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 Ha(e,t,!1,o,n,r,a);return d}function Ha(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 db(e,t,i,n,r){--t.pendingcb,i?(Pt.nextTick(r,n),Pt.nextTick(Xi,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(r(n),e._writableState.errorEmitted=!0,e.emit("error",n),Xi(e,t))}function ub(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function pb(e,t){var i=e._writableState,n=i.sync,r=i.writecb;if(ub(i),t)db(e,i,n,t,r);else{var a=xd(i);!a&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&vd(e,i),n?eb(hd,e,i,a,r):hd(e,i,a,r)}}function hd(e,t,i,n){i||fb(e,t),t.pendingcb--,n(),Xi(e,t)}function fb(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function vd(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,Ha(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 gd(t),t.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,c=i.callback,f=t.objectMode?1:d.length;if(Ha(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||mb(this,n,i)};function xd(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function hb(e,t){e._final(function(i){t.pendingcb--,i&&e.emit("error",i),t.prefinished=!0,e.emit("prefinish"),Xi(e,t)})}function gb(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Pt.nextTick(hb,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Xi(e,t){var i=xd(t);return i&&(gb(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),i}function mb(e,t,i){t.ending=!0,Xi(e,t),i&&(t.finished?Pt.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}function bb(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=yd.destroy;$.prototype._undestroy=yd.undestroy;$.prototype._destroy=function(e,t){this.end(),t(e)}});var Dt=S((z1,Ad)=>{"use strict";var _d=Wi(),yb=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};Ad.exports=Qe;var Ed=Object.create(ii());Ed.inherits=ni();var Sd=Ga(),qa=$a();Ed.inherits(Qe,Sd);for(Ua=yb(qa.prototype),cr=0;cr<Ua.length;cr++)dr=Ua[cr],Qe.prototype[dr]||(Qe.prototype[dr]=qa.prototype[dr]);var Ua,dr,cr;function Qe(e){if(!(this instanceof Qe))return new Qe(e);Sd.call(this,e),qa.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",vb)}Object.defineProperty(Qe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function vb(){this.allowHalfOpen||this._writableState.ended||_d.nextTick(xb,this)}function xb(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(),_d.nextTick(t,e)}});var Va=S(Td=>{"use strict";var Ya=Yi().Buffer,Cd=Ya.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 wb(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 _b(e){var t=wb(e);if(typeof t!="string"&&(Ya.isEncoding===Cd||!Cd(e)))throw new Error("Unknown encoding: "+e);return t||e}Td.StringDecoder=Zi;function Zi(e){this.encoding=_b(e);var t;switch(this.encoding){case"utf16le":this.text=kb,this.end=Lb,t=4;break;case"utf8":this.fillLast=Ab,t=4;break;case"base64":this.text=Rb,this.end=Mb,t=3;break;default:this.write=Ob,this.end=Ib;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ya.allocUnsafe(t)}Zi.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||""};Zi.prototype.end=Tb;Zi.prototype.text=Cb;Zi.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 Wa(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Eb(e,t,i){var n=t.length-1;if(n<i)return 0;var r=Wa(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=Wa(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=Wa(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}function Sb(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 Ab(e){var t=this.lastTotal-this.lastNeed,i=Sb(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 Cb(e,t){var i=Eb(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 Tb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function kb(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 Lb(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 Rb(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 Mb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Ob(e){return e.toString(this.encoding)}function Ib(e){return e&&e.length?this.write(e):""}});var Ga=S((N1,Fd)=>{"use strict";var si=Wi();Fd.exports=D;var Pb=rd(),Ji;D.ReadableState=Pd;var F1=require("events").EventEmitter,Md=function(e,t){return e.listeners(t).length},Qa=Pa(),Qi=Yi().Buffer,Db=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function jb(e){return Qi.from(e)}function zb(e){return Qi.isBuffer(e)||e instanceof Db}var Od=Object.create(ii());Od.inherits=ni();var Xa=require("util"),O=void 0;Xa&&Xa.debuglog?O=Xa.debuglog("stream"):O=function(){};var Bb=dd(),Id=Na(),ai;Od.inherits(D,Qa);var Ka=["error","close","destroy","pause","resume"];function Fb(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):Pb(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}function Pd(e,t){Ji=Ji||Dt(),e=e||{};var i=t instanceof Ji;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 Bb,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=Va().StringDecoder),this.decoder=new ai(e.encoding),this.encoding=e.encoding)}function D(e){if(Ji=Ji||Dt(),!(this instanceof D))return new D(e);this._readableState=new Pd(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Qa.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=Id.destroy;D.prototype._undestroy=Id.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=Qi.from(e,t),t=""),n=!0),Dd(this,e,t,!1,n)};D.prototype.unshift=function(e){return Dd(this,e,null,!0,!1)};function Dd(e,t,i,n,r){var a=e._readableState;if(t===null)a.reading=!1,Ub(e,a);else{var s;r||(s=Nb(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Qi.prototype&&(t=jb(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Za(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?Za(e,a,t,!1):jd(e,a)):Za(e,a,t,!1))):n||(a.reading=!1)}return Hb(a)}function Za(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&&ur(e)),jd(e,t)}function Nb(e,t){var i;return!zb(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i}function Hb(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=Va().StringDecoder),this._readableState.decoder=new ai(e),this._readableState.encoding=e,this};var kd=8388608;function $b(e){return e>=kd?e=kd:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Ld(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=$b(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}D.prototype.read=function(e){O("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 O("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Ja(this):ur(this),null;if(e=Ld(e,t),e===0&&t.ended)return t.length===0&&Ja(this),null;var n=t.needReadable;O("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,O("length less than watermark",n)),t.ended||t.reading?(n=!1,O("reading or ended",n)):n&&(O("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Ld(i,t)));var r;return e>0?r=zd(e,t):r=null,r===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&Ja(this)),r!==null&&this.emit("data",r),r};function Ub(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,ur(e)}}function ur(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(O("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?si.nextTick(Rd,e):Rd(e))}function Rd(e){O("emit readable"),e.emit("readable"),es(e)}function jd(e,t){t.readingMore||(t.readingMore=!0,si.nextTick(qb,e,t))}function qb(e,t){for(var i=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(O("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,O("pipe count=%d opts=%j",n.pipesCount,t);var r=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=r?o:w;n.endEmitted?si.nextTick(a):i.once("end",a),e.on("unpipe",s);function s(y,m){O("onunpipe"),y===i&&m&&m.hasUnpiped===!1&&(m.hasUnpiped=!0,c())}function o(){O("onend"),e.end()}var d=Gb(i);e.on("drain",d);var l=!1;function c(){O("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",w),i.removeListener("data",p),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var f=!1;i.on("data",p);function p(y){O("ondata"),f=!1;var m=e.write(y);m===!1&&!f&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&Bd(n.pipes,e)!==-1)&&!l&&(O("false write response, pause",n.awaitDrain),n.awaitDrain++,f=!0),i.pause())}function u(y){O("onerror",y),w(),e.removeListener("error",u),Md(e,"error")===0&&e.emit("error",y)}Fb(e,"error",u);function v(){e.removeListener("finish",h),w()}e.once("close",v);function h(){O("onfinish"),e.removeListener("close",v),w()}e.once("finish",h);function w(){O("unpipe"),i.unpipe(e)}return e.emit("pipe",i),n.flowing||(O("pipe resume"),i.resume()),e};function Gb(e){return function(){var t=e._readableState;O("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Md(e,"data")&&(t.flowing=!0,es(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=Bd(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=Qa.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&&ur(this):si.nextTick(Wb,this))}return i};D.prototype.addListener=D.prototype.on;function Wb(e){O("readable nexttick read 0"),e.read(0)}D.prototype.resume=function(){var e=this._readableState;return e.flowing||(O("resume"),e.flowing=!0,Yb(this,e)),this};function Yb(e,t){t.resumeScheduled||(t.resumeScheduled=!0,si.nextTick(Vb,e,t))}function Vb(e,t){t.reading||(O("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),es(e),t.flowing&&!t.reading&&e.read(0)}D.prototype.pause=function(){return O("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(O("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function es(e){var t=e._readableState;for(O("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(O("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(O("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<Ka.length;a++)e.on(Ka[a],this.emit.bind(this,Ka[a]));return this._read=function(s){O("wrapped _read",s),n&&(n=!1,e.resume())},this};Object.defineProperty(D.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});D._fromList=zd;function zd(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=Xb(e,t.buffer,t.decoder),i}function Xb(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?Kb(e,t):Zb(e,t),n}function Kb(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 Zb(e,t){var i=Qi.allocUnsafe(e),n=t.head,r=1;for(n.data.copy(i),e-=n.data.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(a.copy(i,i.length-e,0,s),e-=s,e===0){s===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++r}return t.length-=r,i}function Ja(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,si.nextTick(Jb,t,e))}function Jb(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Bd(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}});var ts=S((H1,$d)=>{"use strict";$d.exports=et;var pr=Dt(),Hd=Object.create(ii());Hd.inherits=ni();Hd.inherits(et,pr);function Qb(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);pr.call(this,e),this._transformState={afterTransform:Qb.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",ey)}function ey(){var e=this;typeof this._flush=="function"?this._flush(function(t,i){Nd(e,t,i)}):Nd(this,null,null)}et.prototype.push=function(e,t){return this._transformState.needTransform=!1,pr.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;pr.prototype._destroy.call(this,e,function(n){t(n),i.emit("close")})};function Nd(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 Wd=S(($1,Gd)=>{"use strict";Gd.exports=en;var Ud=ts(),qd=Object.create(ii());qd.inherits=ni();qd.inherits(en,Ud);function en(e){if(!(this instanceof en))return new en(e);Ud.call(this,e)}en.prototype._transform=function(e,t,i){i(null,e)}});var is=S((Y,fr)=>{"use strict";var Re=require("stream");process.env.READABLE_STREAM==="disable"&&Re?(fr.exports=Re,Y=fr.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=fr.exports=Ga(),Y.Stream=Re||Y,Y.Readable=Y,Y.Writable=$a(),Y.Duplex=Dt(),Y.Transform=ts(),Y.PassThrough=Wd())});var tt=S(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{ns=new ArrayBuffer(0);try{ae.blob=new Blob([ns],{type:"application/zip"}).size===0}catch{try{Yd=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,rs=new Yd,rs.append(ns),ae.blob=rs.getBlob("application/zip").size===0}catch{ae.blob=!1}}}var ns,Yd,rs;try{ae.nodestream=!!is().Readable}catch{ae.nodestream=!1}});var ss=S(as=>{"use strict";var ty=F(),iy=tt(),Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";as.encode=function(e){for(var t=[],i,n,r,a,s,o,d,l=0,c=e.length,f=c,p=ty.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("")};as.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(iy.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 tn=S((G1,Vd)=>{"use strict";Vd.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 Jd=S((W1,Zd)=>{"use strict";var Xd=global.MutationObserver||global.WebKitMutationObserver,oi;process.browser?Xd?(os=0,Kd=new Xd(nn),ls=global.document.createTextNode(""),Kd.observe(ls,{characterData:!0}),oi=function(){ls.data=os=++os%2}):!global.setImmediate&&typeof global.MessageChannel!="undefined"?(cs=new global.MessageChannel,cs.port1.onmessage=nn,oi=function(){cs.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?oi=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){nn(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:oi=function(){setTimeout(nn,0)}:oi=function(){process.nextTick(nn)};var os,Kd,ls,cs,ds,rn=[];function nn(){ds=!0;for(var e,t,i=rn.length;i;){for(t=rn,rn=[],e=-1;++e<i;)t[e]();i=rn.length}ds=!1}Zd.exports=ny;function ny(e){rn.push(e)===1&&!ds&&oi()}});var au=S((Y1,ru)=>{"use strict";var Qd=Jd();function li(){}var Z={},eu=["REJECTED"],us=["FULFILLED"],tu=["PENDING"];process.browser||(an=["UNHANDLED"]);var an;ru.exports=ft;function ft(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=tu,this.queue=[],this.outcome=void 0,process.browser||(this.handled=an),e!==li&&iu(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===us||typeof t!="function"&&this.state===eu)return this;var i=new this.constructor(li);if(process.browser||this.handled===an&&(this.handled=null),this.state!==tu){var n=this.state===us?e:t;ps(i,n,this.outcome)}else this.queue.push(new sn(i,e,t));return i};function sn(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)}sn.prototype.callFulfilled=function(e){Z.resolve(this.promise,e)};sn.prototype.otherCallFulfilled=function(e){ps(this.promise,this.onFulfilled,e)};sn.prototype.callRejected=function(e){Z.reject(this.promise,e)};sn.prototype.otherCallRejected=function(e){ps(this.promise,this.onRejected,e)};function ps(e,t,i){Qd(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=nu(ry,t);if(i.status==="error")return Z.reject(e,i.value);var n=i.value;if(n)iu(e,n);else{e.state=us,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=eu,e.outcome=t,process.browser||e.handled===an&&Qd(function(){e.handled===an&&process.emit("unhandledRejection",t,e)});for(var i=-1,n=e.queue.length;++i<n;)e.queue[i].callRejected(t);return e};function ry(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function iu(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=nu(a);s.status==="error"&&n(s.value)}function nu(e,t){var i={};try{i.value=e(t),i.status="success"}catch(n){i.status="error",i.value=n}return i}ft.resolve=ay;function ay(e){return e instanceof this?e:Z.resolve(new this(li),e)}ft.reject=sy;function sy(e){var t=new this(li);return Z.reject(t,e)}ft.all=oy;function oy(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=ly;function ly(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=S((V1,su)=>{"use strict";var fs=null;typeof Promise!="undefined"?fs=Promise:fs=au();su.exports={Promise:fs}});var lu=S(ou=>{"use strict";(function(e,t){"use strict";if(e.setImmediate)return;var i=1,n={},r=!1,a=e.document,s;function o(m){typeof m!="function"&&(m=new Function(""+m));for(var b=new Array(arguments.length-1),g=0;g<b.length;g++)b[g]=arguments[g+1];var x={callback:m,args:b};return n[i]=x,s(i),i++}function d(m){delete n[m]}function l(m){var b=m.callback,g=m.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(m){if(r)setTimeout(c,0,m);else{var b=n[m];if(b){r=!0;try{l(b)}finally{d(m),r=!1}}}}function f(){s=function(m){process.nextTick(function(){c(m)})}}function p(){if(e.postMessage&&!e.importScripts){var m=!0,b=e.onmessage;return e.onmessage=function(){m=!1},e.postMessage("","*"),e.onmessage=b,m}}function u(){var m="setImmediate$"+Math.random()+"$",b=function(g){g.source===e&&typeof g.data=="string"&&g.data.indexOf(m)===0&&c(+g.data.slice(m.length))};e.addEventListener?e.addEventListener("message",b,!1):e.attachEvent("onmessage",b),s=function(g){e.postMessage(m+g,"*")}}function v(){var m=new MessageChannel;m.port1.onmessage=function(b){var g=b.data;c(g)},s=function(b){m.port2.postMessage(b)}}function h(){var m=a.documentElement;s=function(b){var g=a.createElement("script");g.onreadystatechange=function(){c(b),g.onreadystatechange=null,m.removeChild(g),g=null},m.appendChild(g)}}function w(){s=function(m){setTimeout(c,0,m)}}var y=Object.getPrototypeOf&&Object.getPrototypeOf(e);y=y&&y.setTimeout?y:e,{}.toString.call(e.process)==="[object process]"?f():p()?u():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?h():w(),y.setImmediate=o,y.clearImmediate=d})(typeof self=="undefined"?typeof global=="undefined"?ou:global:self)});var F=S(U=>{"use strict";var ht=tt(),cy=ss(),di=tn(),hs=ci();lu();function dy(e){var t=null;return ht.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),gr(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 on(e){return e}function gr(e,t){for(var i=0;i<e.length;++i)t[i]=e.charCodeAt(i)&255;return t}var hr={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 ln(e){var t=65536,i=U.getTypeOf(e),n=!0;if(i==="uint8array"?n=hr.applyCanBeUsed.uint8array:i==="nodebuffer"&&(n=hr.applyCanBeUsed.nodebuffer),n)for(;t>1;)try{return hr.stringifyByChunk(e,i,t)}catch{t=Math.floor(t/2)}return hr.stringifyByChar(e)}U.applyFromCharCode=ln;function mr(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}var gt={};gt.string={string:on,array:function(e){return gr(e,new Array(e.length))},arraybuffer:function(e){return gt.string.uint8array(e).buffer},uint8array:function(e){return gr(e,new Uint8Array(e.length))},nodebuffer:function(e){return gr(e,di.allocBuffer(e.length))}};gt.array={string:ln,array:on,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 ln(new Uint8Array(e))},array:function(e){return mr(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:on,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return di.newBufferFrom(new Uint8Array(e))}};gt.uint8array={string:ln,array:function(e){return mr(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:on,nodebuffer:function(e){return di.newBufferFrom(e)}};gt.nodebuffer={string:ln,array:function(e){return mr(e,new Array(e.length))},arraybuffer:function(e){return gt.nodebuffer.uint8array(e).buffer},uint8array:function(e){return mr(e,new Uint8Array(e.length))},nodebuffer:on};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=hs.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 hs.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=cy.decode(s):i&&n!==!0&&(s=dy(s))),s):hs.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var se=S((Z1,du)=>{"use strict";function cu(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}cu.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}};du.exports=cu});var pi=S(mt=>{"use strict";var ui=F(),jt=tt(),uy=tn(),br=se(),cn=new Array(256);for(it=0;it<256;it++)cn[it]=it>=252?6:it>=248?5:it>=240?4:it>=224?3:it>=192?2:1;var it;cn[254]=cn[254]=1;var py=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},fy=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+cn[e[i]]>t?i:t},hy=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=cn[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?uy.newBufferFrom(t,"utf-8"):py(t)};mt.utf8decode=function(t){return jt.nodebuffer?ui.transformTo("nodebuffer",t).toString("utf-8"):(t=ui.transformTo(jt.uint8array?"uint8array":"array",t),hy(t))};function yr(){br.call(this,"utf-8 decode"),this.leftOver=null}ui.inherits(yr,br);yr.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=fy(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})};yr.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:mt.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};mt.Utf8DecodeWorker=yr;function gs(){br.call(this,"utf-8 encode")}ui.inherits(gs,br);gs.prototype.processChunk=function(e){this.push({data:mt.utf8encode(e.data),meta:e.meta})};mt.Utf8EncodeWorker=gs});var hu=S((Q1,fu)=>{"use strict";var uu=se(),pu=F();function ms(e){uu.call(this,"ConvertWorker to "+e),this.destType=e}pu.inherits(ms,uu);ms.prototype.processChunk=function(e){this.push({data:pu.transformTo(this.destType,e.data),meta:e.meta})};fu.exports=ms});var bu=S((eE,mu)=>{"use strict";var gu=is().Readable,gy=F();gy.inherits(bs,gu);function bs(e,t,i){gu.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)})}bs.prototype._read=function(){this._helper.resume()};mu.exports=bs});var ys=S((tE,xu)=>{"use strict";var zt=F(),my=hu(),by=se(),yy=ss(),vy=tt(),xy=ci(),yu=null;if(vy.nodestream)try{yu=bu()}catch{}function wy(e,t,i){switch(e){case"blob":return zt.newBlob(zt.transformTo("arraybuffer",t),i);case"base64":return yy.encode(t);default:return zt.transformTo(e,t)}}function _y(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 Ey(e,t){return new xy.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=wy(s,_y(a,r),o);i(d)}catch(l){n(l)}r=[]}).resume()})}function vu(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 my(n)),e.lock()}catch(r){this._worker=new by("error"),this._worker.error(r)}}vu.prototype={accumulate:function(e){return Ey(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 yu(this,{objectMode:this._outputType!=="nodebuffer"},e)}};xu.exports=vu});var vs=S(_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 xs=S((nE,wu)=>{"use strict";var vr=F(),xr=se(),Sy=16*1024;function fi(e){xr.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=vr.getTypeOf(i),t.isPaused||t._tickAndRepeat()},function(i){t.error(i)})}vr.inherits(fi,xr);fi.prototype.cleanUp=function(){xr.prototype.cleanUp.call(this),this.data=null};fi.prototype.resume=function(){return xr.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,vr.delay(this._tickAndRepeat,[],this)),!0):!1};fi.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(vr.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};fi.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=Sy,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}})};wu.exports=fi});var wr=S((rE,Eu)=>{"use strict";var Ay=F();function Cy(){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 _u=Cy();function Ty(e,t,i,n){var r=_u,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 ky(e,t,i,n){var r=_u,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}Eu.exports=function(t,i){if(typeof t=="undefined"||!t.length)return 0;var n=Ay.getTypeOf(t)!=="string";return n?Ty(i|0,t,t.length,0):ky(i|0,t,t.length,0)}});var _s=S((aE,Au)=>{"use strict";var Su=se(),Ly=wr(),Ry=F();function ws(){Su.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Ry.inherits(ws,Su);ws.prototype.processChunk=function(e){this.streamInfo.crc32=Ly(e.data,this.streamInfo.crc32||0),this.push(e)};Au.exports=ws});var Tu=S((sE,Cu)=>{"use strict";var My=F(),Es=se();function Ss(e){Es.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}My.inherits(Ss,Es);Ss.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}Es.prototype.processChunk.call(this,e)};Cu.exports=Ss});var _r=S((oE,Ru)=>{"use strict";var ku=ci(),Lu=xs(),Oy=_s(),As=Tu();function Cs(e,t,i,n,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=n,this.compressedContent=r}Cs.prototype={getContentWorker:function(){var e=new Lu(ku.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new As("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 Lu(ku.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};Cs.createWorkerFrom=function(e,t,i){return e.pipe(new Oy).pipe(new As("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new As("compressedSize")).withStreamInfo("compression",t)};Ru.exports=Cs});var Pu=S((lE,Iu)=>{"use strict";var Iy=ys(),Py=xs(),Ts=pi(),ks=_r(),Mu=se(),Ls=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}};Ls.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 Ts.Utf8EncodeWorker)),!r&&n&&(t=t.pipe(new Ts.Utf8DecodeWorker))}catch(a){t=new Mu("error"),t.error(a)}return new Iy(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 ks&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new Ts.Utf8EncodeWorker)),ks.createWorkerFrom(i,e,t)},_decompressWorker:function(){return this._data instanceof ks?this._data.getContentWorker():this._data instanceof Mu?this._data:new Py(this._data)}};var Ou=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Dy=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(Er=0;Er<Ou.length;Er++)Ls.prototype[Ou[Er]]=Dy;var Er;Iu.exports=Ls});var nt=S(J=>{"use strict";var jy=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function zy(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)zy(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 By={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}},Fy={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,By)):(J.Buf8=Array,J.Buf16=Array,J.Buf32=Array,J.assign(J,Fy))};J.setTyped(jy)});var np=S(mi=>{"use strict";var Ny=nt(),Hy=4,Du=0,ju=1,$y=2;function gi(e){for(var t=e.length;--t>=0;)e[t]=0}var Uy=0,$u=1,qy=2,Gy=3,Wy=258,js=29,gn=256,un=gn+1+js,hi=30,zs=19,Uu=2*un+1,Bt=15,Rs=16,Yy=7,Bs=256,qu=16,Gu=17,Wu=18,Ps=[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],Sr=[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],Vy=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Yu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Xy=512,rt=new Array((un+2)*2);gi(rt);var dn=new Array(hi*2);gi(dn);var pn=new Array(Xy);gi(pn);var fn=new Array(Wy-Gy+1);gi(fn);var Fs=new Array(js);gi(Fs);var Ar=new Array(hi);gi(Ar);function Ms(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 Vu,Xu,Ku;function Os(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Zu(e){return e<256?pn[e]:pn[256+(e>>>7)]}function hn(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>Rs-i?(e.bi_buf|=t<<e.bi_valid&65535,hn(e,e.bi_buf),e.bi_buf=t>>Rs-e.bi_valid,e.bi_valid+=i-Rs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function Oe(e,t,i){ie(e,i[t*2],i[t*2+1])}function Ju(e,t){var i=0;do i|=e&1,e>>>=1,i<<=1;while(--t>0);return i>>>1}function Ky(e){e.bi_valid===16?(hn(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 Zy(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<Uu;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 Qu(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]=Ju(n[o]++,o))}}function Jy(){var e,t,i,n,r,a=new Array(Bt+1);for(i=0,n=0;n<js-1;n++)for(Fs[n]=i,e=0;e<1<<Ps[n];e++)fn[i++]=n;for(fn[i-1]=n,r=0,n=0;n<16;n++)for(Ar[n]=r,e=0;e<1<<Sr[n];e++)pn[r++]=n;for(r>>=7;n<hi;n++)for(Ar[n]=r<<7,e=0;e<1<<Sr[n]-7;e++)pn[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(Qu(rt,un+1,a),e=0;e<hi;e++)dn[e*2+1]=5,dn[e*2]=Ju(e,5);Vu=new Ms(rt,Ps,gn+1,un,Bt),Xu=new Ms(dn,Sr,0,hi,Bt),Ku=new Ms(new Array(0),Vy,0,zs,Yy)}function ep(e){var t;for(t=0;t<un;t++)e.dyn_ltree[t*2]=0;for(t=0;t<hi;t++)e.dyn_dtree[t*2]=0;for(t=0;t<zs;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Bs*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function tp(e){e.bi_valid>8?hn(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 Qy(e,t,i,n){tp(e),n&&(hn(e,i),hn(e,~i)),Ny.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}function zu(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&&zu(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!zu(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function Bu(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?Oe(e,r,t):(s=fn[r],Oe(e,s+gn+1,t),o=Ps[s],o!==0&&(r-=Fs[s],ie(e,r,o)),n--,s=Zu(n),Oe(e,s,i),o=Sr[s],o!==0&&(n-=Ar[s],ie(e,n,o)));while(a<e.last_lit);Oe(e,Bs,t)}function Ds(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=Uu,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],Zy(e,t),Qu(i,d,e.bl_count)}function Fu(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[qu*2]++):o<=10?e.bl_tree[Gu*2]++:e.bl_tree[Wu*2]++,o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4))}function Nu(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 Oe(e,a,e.bl_tree);while(--o!==0);else a!==0?(a!==r&&(Oe(e,a,e.bl_tree),o--),Oe(e,qu,e.bl_tree),ie(e,o-3,2)):o<=10?(Oe(e,Gu,e.bl_tree),ie(e,o-3,3)):(Oe(e,Wu,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 ev(e){var t;for(Fu(e,e.dyn_ltree,e.l_desc.max_code),Fu(e,e.dyn_dtree,e.d_desc.max_code),Ds(e,e.bl_desc),t=zs-1;t>=3&&e.bl_tree[Yu[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function tv(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[Yu[r]*2+1],3);Nu(e,e.dyn_ltree,t-1),Nu(e,e.dyn_dtree,i-1)}function iv(e){var t=4093624447,i;for(i=0;i<=31;i++,t>>>=1)if(t&1&&e.dyn_ltree[i*2]!==0)return Du;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return ju;for(i=32;i<gn;i++)if(e.dyn_ltree[i*2]!==0)return ju;return Du}var Hu=!1;function nv(e){Hu||(Jy(),Hu=!0),e.l_desc=new Os(e.dyn_ltree,Vu),e.d_desc=new Os(e.dyn_dtree,Xu),e.bl_desc=new Os(e.bl_tree,Ku),e.bi_buf=0,e.bi_valid=0,ep(e)}function ip(e,t,i,n){ie(e,(Uy<<1)+(n?1:0),3),Qy(e,t,i,!0)}function rv(e){ie(e,$u<<1,3),Oe(e,Bs,rt),Ky(e)}function av(e,t,i,n){var r,a,s=0;e.level>0?(e.strm.data_type===$y&&(e.strm.data_type=iv(e)),Ds(e,e.l_desc),Ds(e,e.d_desc),s=ev(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?ip(e,t,i,n):e.strategy===Hy||a===r?(ie(e,($u<<1)+(n?1:0),3),Bu(e,rt,dn)):(ie(e,(qy<<1)+(n?1:0),3),tv(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Bu(e,e.dyn_ltree,e.dyn_dtree)),ep(e),n&&tp(e)}function sv(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[(fn[i]+gn+1)*2]++,e.dyn_dtree[Zu(t)*2]++),e.last_lit===e.lit_bufsize-1}mi._tr_init=nv;mi._tr_stored_block=ip;mi._tr_flush_block=av;mi._tr_tally=sv;mi._tr_align=rv});var Ns=S((uE,rp)=>{"use strict";function ov(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}rp.exports=ov});var Hs=S((pE,ap)=>{"use strict";function lv(){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 cv=lv();function dv(e,t,i,n){var r=cv,a=n+i;e^=-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}ap.exports=dv});var Cr=S((fE,sp)=>{"use strict";sp.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 gp=S(De=>{"use strict";var Q=nt(),me=np(),dp=Ns(),bt=Hs(),uv=Cr(),$t=0,pv=1,fv=3,_t=4,op=5,Pe=0,lp=1,be=-2,hv=-3,$s=-5,gv=-1,mv=1,Tr=2,bv=3,yv=4,vv=0,xv=2,Mr=8,wv=9,_v=15,Ev=8,Sv=29,Av=256,qs=Av+1+Sv,Cv=30,Tv=19,kv=2*qs+1,Lv=15,R=3,xt=258,Ee=xt+R+1,Rv=32,Or=42,Gs=69,kr=73,Lr=91,Rr=103,Ft=113,bn=666,W=1,yn=2,Nt=3,vi=4,Mv=3;function wt(e,t){return e.msg=uv[t],t}function cp(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 mn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Ov(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=dp(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 up(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=Ov(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 Iv(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 Us(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=up(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:yn}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=up(e,i),e.match_length<=5&&(e.strategy===mv||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:yn}function Pv(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:yn}function Dv(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:yn}function Ie(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 Ie(0,0,0,0,Iv),new Ie(4,4,8,4,Us),new Ie(4,5,16,8,Us),new Ie(4,6,32,32,Us),new Ie(4,4,16,16,bi),new Ie(8,16,32,32,bi),new Ie(8,16,128,128,bi),new Ie(8,32,128,256,bi),new Ie(32,128,258,1024,bi),new Ie(32,258,258,4096,bi)];function jv(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 zv(){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=Mr,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(kv*2),this.dyn_dtree=new Q.Buf16((2*Cv+1)*2),this.bl_tree=new Q.Buf16((2*Tv+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(Lv+1),this.heap=new Q.Buf16(2*qs+1),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Q.Buf16(2*qs+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 pp(e){var t;return!e||!e.state?wt(e,be):(e.total_in=e.total_out=0,e.data_type=xv,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Or:Ft,e.adler=t.wrap===2?0:1,t.last_flush=$t,me._tr_init(t),Pe)}function fp(e){var t=pp(e);return t===Pe&&jv(e.state),t}function Bv(e,t){return!e||!e.state||e.state.wrap!==2?be:(e.state.gzhead=t,Pe)}function hp(e,t,i,n,r,a){if(!e)return be;var s=1;if(t===gv&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>wv||i!==Mr||n<8||n>15||t<0||t>9||a<0||a>yv)return wt(e,be);n===8&&(n=9);var o=new zv;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,fp(e)}function Fv(e,t){return hp(e,t,Mr,_v,Ev,vv)}function Nv(e,t){var i,n,r,a;if(!e||!e.state||t>op||t<0)return e?wt(e,be):be;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===bn&&t!==_t)return wt(e,e.avail_out===0?$s:be);if(n.strm=e,i=n.last_flush,n.last_flush=t,n.status===Or)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>=Tr||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>=Tr||n.level<2?4:0),M(n,Mv),n.status=Ft);else{var s=Mr+(n.w_bits-8<<4)<<8,o=-1;n.strategy>=Tr||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,s|=o<<6,n.strstart!==0&&(s|=Rv),s+=31-s%31,n.status=Ft,mn(n,s),n.strstart!==0&&(mn(n,e.adler>>>16),mn(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=kr)}else n.status=kr;if(n.status===kr)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=Lr)}else n.status=Lr;if(n.status===Lr)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=Rr)}else n.status=Rr;if(n.status===Rr&&(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&&cp(t)<=cp(i)&&t!==_t)return wt(e,$s);if(n.status===bn&&e.avail_in!==0)return wt(e,$s);if(e.avail_in!==0||n.lookahead!==0||t!==$t&&n.status!==bn){var d=n.strategy===Tr?Dv(n,t):n.strategy===bv?Pv(n,t):yi[n.level].func(n,t);if((d===Nt||d===vi)&&(n.status=bn),d===W||d===Nt)return e.avail_out===0&&(n.last_flush=-1),Pe;if(d===yn&&(t===pv?me._tr_align(n):t!==op&&(me._tr_stored_block(n,0,0,!1),t===fv&&(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?lp:(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)):(mn(n,e.adler>>>16),mn(n,e.adler&65535)),yt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Pe:lp)}function Hv(e){var t;return!e||!e.state?be:(t=e.state.status,t!==Or&&t!==Gs&&t!==kr&&t!==Lr&&t!==Rr&&t!==Ft&&t!==bn?wt(e,be):(e.state=null,t===Ft?wt(e,hv):Pe))}function $v(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!==Or||n.lookahead))return be;for(s===1&&(e.adler=dp(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=Fv;De.deflateInit2=hp;De.deflateReset=fp;De.deflateResetKeep=pp;De.deflateSetHeader=Bv;De.deflate=Nv;De.deflateEnd=Hv;De.deflateSetDictionary=$v;De.deflateInfo="pako deflate (from Nodeca project)"});var Ws=S(xi=>{"use strict";var Ir=nt(),mp=!0,bp=!0;try{String.fromCharCode.apply(null,[0])}catch{mp=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{bp=!1}var vn=new Ir.Buf8(256);for(at=0;at<256;at++)vn[at]=at>=252?6:at>=248?5:at>=240?4:at>=224?3:at>=192?2:1;var at;vn[254]=vn[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 yp(e,t){if(t<65534&&(e.subarray&&bp||!e.subarray&&mp))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 yp(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=vn[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 yp(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+vn[e[i]]>t?i:t}});var Ys=S((mE,vp)=>{"use strict";function Uv(){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}vp.exports=Uv});var Ep=S(_n=>{"use strict";var xn=gp(),wn=nt(),Xs=Ws(),Ks=Cr(),qv=Ys(),_p=Object.prototype.toString,Gv=0,Vs=4,wi=0,xp=1,wp=2,Wv=-1,Yv=0,Vv=8;function Ut(e){if(!(this instanceof Ut))return new Ut(e);this.options=wn.assign({level:Wv,method:Vv,chunkSize:16384,windowBits:15,memLevel:8,strategy:Yv,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 qv,this.strm.avail_out=0;var i=xn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==wi)throw new Error(Ks[i]);if(t.header&&xn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Xs.string2buf(t.dictionary):_p.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,i=xn.deflateSetDictionary(this.strm,n),i!==wi)throw new Error(Ks[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?Vs:Gv,typeof e=="string"?i.input=Xs.string2buf(e):_p.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(i.avail_out===0&&(i.output=new wn.Buf8(n),i.next_out=0,i.avail_out=n),r=xn.deflate(i,a),r!==xp&&r!==wi)return this.onEnd(r),this.ended=!0,!1;(i.avail_out===0||i.avail_in===0&&(a===Vs||a===wp))&&(this.options.to==="string"?this.onData(Xs.buf2binstring(wn.shrinkBuf(i.output,i.next_out))):this.onData(wn.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||i.avail_out===0)&&r!==xp);return a===Vs?(r=xn.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===wi):(a===wp&&(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=wn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Zs(e,t){var i=new Ut(t);if(i.push(e,!0),i.err)throw i.msg||Ks[i.err];return i.result}function Xv(e,t){return t=t||{},t.raw=!0,Zs(e,t)}function Kv(e,t){return t=t||{},t.gzip=!0,Zs(e,t)}_n.Deflate=Ut;_n.deflate=Zs;_n.deflateRaw=Xv;_n.gzip=Kv});var Ap=S((yE,Sp)=>{"use strict";var Pr=30,Zv=12;Sp.exports=function(t,i){var n,r,a,s,o,d,l,c,f,p,u,v,h,w,y,m,b,g,x,E,A,C,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,w=n.lencode,y=n.distcode,m=(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=w[v&m];t:for(;;){if(x=g>>>24,v>>>=x,h-=x,x=g>>>16&255,x===0)_[s++]=g&65535;else if(x&16){E=g&65535,x&=15,x&&(h<x&&(v+=L[r++]<<h,h+=8),E+=v&(1<<x)-1,v>>>=x,h-=x),h<15&&(v+=L[r++]<<h,h+=8,v+=L[r++]<<h,h+=8),g=y[v&b];i:for(;;){if(x=g>>>24,v>>>=x,h-=x,x=g>>>16&255,x&16){if(A=g&65535,x&=15,h<x&&(v+=L[r++]<<h,h+=8,h<x&&(v+=L[r++]<<h,h+=8)),A+=v&(1<<x)-1,A>l){t.msg="invalid distance too far back",n.mode=Pr;break e}if(v>>>=x,h-=x,x=s-o,A>x){if(x=A-x,x>f&&n.sane){t.msg="invalid distance too far back",n.mode=Pr;break e}if(C=0,T=u,p===0){if(C+=c-x,x<E){E-=x;do _[s++]=u[C++];while(--x);C=s-A,T=_}}else if(p<x){if(C+=c+p-x,x-=p,x<E){E-=x;do _[s++]=u[C++];while(--x);if(C=0,p<E){x=p,E-=x;do _[s++]=u[C++];while(--x);C=s-A,T=_}}}else if(C+=p-x,x<E){E-=x;do _[s++]=u[C++];while(--x);C=s-A,T=_}for(;E>2;)_[s++]=T[C++],_[s++]=T[C++],_[s++]=T[C++],E-=3;E&&(_[s++]=T[C++],E>1&&(_[s++]=T[C++]))}else{C=s-A;do _[s++]=_[C++],_[s++]=_[C++],_[s++]=_[C++],E-=3;while(E>2);E&&(_[s++]=_[C++],E>1&&(_[s++]=_[C++]))}}else if((x&64)===0){g=y[(g&65535)+(v&(1<<x)-1)];continue i}else{t.msg="invalid distance code",n.mode=Pr;break e}break}}else if((x&64)===0){g=w[(g&65535)+(v&(1<<x)-1)];continue t}else if(x&32){n.mode=Zv;break e}else{t.msg="invalid literal/length code",n.mode=Pr;break e}break}}while(r<a&&s<d);E=h>>3,r-=E,h-=E<<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 Op=S((vE,Mp)=>{"use strict";var Cp=nt(),_i=15,Tp=852,kp=592,Lp=0,Js=1,Rp=2,Jv=[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],Qv=[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],ex=[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],tx=[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];Mp.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,w=0,y=0,m=0,b=0,g,x,E,A,C,T=null,L=0,_,I=new Cp.Buf16(_i+1),z=new Cp.Buf16(_i+1),le=null,te=0,ne,xe,Ne;for(c=0;c<=_i;c++)I[c]=0;for(f=0;f<r;f++)I[i[n+f]]++;for(v=l,u=_i;u>=1&&I[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&&I[p]===0;p++);for(v<p&&(v=p),y=1,c=1;c<=_i;c++)if(y<<=1,y-=I[c],y<0)return-1;if(y>0&&(t===Lp||u!==1))return-1;for(z[1]=0,c=1;c<_i;c++)z[c+1]=z[c]+I[c];for(f=0;f<r;f++)i[n+f]!==0&&(o[z[i[n+f]]++]=f);if(t===Lp?(T=le=o,_=19):t===Js?(T=Jv,L-=257,le=Qv,te-=257,_=256):(T=ex,le=tx,_=-1),b=0,f=0,c=p,C=s,h=v,w=0,E=-1,m=1<<v,A=m-1,t===Js&&m>Tp||t===Rp&&m>kp)return 1;for(;;){ne=c-w,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-w,x=1<<h,p=x;do x-=g,a[C+(b>>w)+x]=ne<<24|xe<<16|Ne|0;while(x!==0);for(g=1<<c-1;b&g;)g>>=1;if(g!==0?(b&=g-1,b+=g):b=0,f++,--I[c]===0){if(c===u)break;c=i[n+o[f]]}if(c>v&&(b&A)!==E){for(w===0&&(w=v),C+=p,h=c-w,y=1<<h;h+w<u&&(y-=I[h+w],!(y<=0));)h++,y<<=1;if(m+=1<<h,t===Js&&m>Tp||t===Rp&&m>kp)return 1;E=b&A,a[E]=v<<24|h<<16|C-s|0}}return b!==0&&(a[C+b]=c-w<<24|64<<16|0),d.bits=v,0}});var hf=S(Se=>{"use strict";var oe=nt(),ro=Ns(),je=Hs(),ix=Ap(),En=Op(),nx=0,af=1,sf=2,Ip=4,rx=5,Dr=6,qt=0,ax=1,sx=2,ye=-2,of=-3,ao=-4,ox=-5,Pp=8,lf=1,Dp=2,jp=3,zp=4,Bp=5,Fp=6,Np=7,Hp=8,$p=9,Up=10,Br=11,st=12,Qs=13,qp=14,eo=15,Gp=16,Wp=17,Yp=18,Vp=19,jr=20,zr=21,Xp=22,Kp=23,Zp=24,Jp=25,Qp=26,to=27,ef=28,tf=29,j=30,so=31,lx=32,cx=852,dx=592,ux=15,px=ux;function nf(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function fx(){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 cf(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=lf,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(cx),t.distcode=t.distdyn=new oe.Buf32(dx),t.sane=1,t.back=-1,qt)}function df(e){var t;return!e||!e.state?ye:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,cf(e))}function uf(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,df(e))}function pf(e,t){var i,n;return e?(n=new fx,e.state=n,n.window=null,i=uf(e,t),i!==qt&&(e.state=null),i):ye}function hx(e){return pf(e,px)}var rf=!0,io,no;function gx(e){if(rf){var t;for(io=new oe.Buf32(512),no=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(En(af,e.lens,0,288,io,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;En(sf,e.lens,0,32,no,0,e.work,{bits:5}),rf=!1}e.lencode=io,e.lenbits=9,e.distcode=no,e.distbits=5}function ff(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 mx(e,t){var i,n,r,a,s,o,d,l,c,f,p,u,v,h,w=0,y,m,b,g,x,E,A,C,T=new oe.Buf8(4),L,_,I=[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=Qs),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,C=qt;e:for(;;)switch(i.mode){case lf:if(i.wrap===0){i.mode=Qs;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=Dp;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)!==Pp){e.msg="unknown compression method",i.mode=j;break}if(l>>>=4,c-=4,A=(l&15)+8,i.wbits===0)i.wbits=A;else if(A>i.wbits){e.msg="invalid window size",i.mode=j;break}i.dmax=1<<A,e.adler=i.check=1,i.mode=l&512?Up:st,l=0,c=0;break;case Dp:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.flags=l,(i.flags&255)!==Pp){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=jp;case jp: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=zp;case zp: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=Bp;case Bp: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=Fp;case Fp:if(i.flags&1024&&(u=i.length,u>o&&(u=o),u&&(i.head&&(A=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,A)),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=Np;case Np:if(i.flags&2048){if(o===0)break e;u=0;do A=n[a+u++],i.head&&A&&i.length<65536&&(i.head.name+=String.fromCharCode(A));while(A&&u<o);if(i.flags&512&&(i.check=je(i.check,n,u,a)),o-=u,a+=u,A)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=Hp;case Hp:if(i.flags&4096){if(o===0)break e;u=0;do A=n[a+u++],i.head&&A&&i.length<65536&&(i.head.comment+=String.fromCharCode(A));while(A&&u<o);if(i.flags&512&&(i.check=je(i.check,n,u,a)),o-=u,a+=u,A)break e}else i.head&&(i.head.comment=null);i.mode=$p;case $p: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 Up:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}e.adler=i.check=nf(l),l=0,c=0,i.mode=Br;case Br: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,sx;e.adler=i.check=1,i.mode=st;case st:if(t===rx||t===Dr)break e;case Qs:if(i.last){l>>>=c&7,c-=c&7,i.mode=to;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=qp;break;case 1:if(gx(i),i.mode=jr,t===Dr){l>>>=2,c-=2;break e}break;case 2:i.mode=Wp;break;case 3:e.msg="invalid block type",i.mode=j}l>>>=2,c-=2;break;case qp: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=eo,t===Dr)break e;case eo:i.mode=Gp;case Gp: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 Wp: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=Yp;case Yp:for(;i.have<i.ncode;){for(;c<3;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.lens[I[i.have++]]=l&7,l>>>=3,c-=3}for(;i.have<19;)i.lens[I[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,L={bits:i.lenbits},C=En(nx,i.lens,0,19,i.lencode,0,i.work,L),i.lenbits=L.bits,C){e.msg="invalid code lengths set",i.mode=j;break}i.have=0,i.mode=Vp;case Vp:for(;i.have<i.nlen+i.ndist;){for(;w=i.lencode[l&(1<<i.lenbits)-1],y=w>>>24,m=w>>>16&255,b=w&65535,!(y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(b<16)l>>>=y,c-=y,i.lens[i.have++]=b;else{if(b===16){for(_=y+2;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l>>>=y,c-=y,i.have===0){e.msg="invalid bit length repeat",i.mode=j;break}A=i.lens[i.have-1],u=3+(l&3),l>>>=2,c-=2}else if(b===17){for(_=y+3;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,A=0,u=3+(l&7),l>>>=3,c-=3}else{for(_=y+7;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,A=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++]=A}}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},C=En(af,i.lens,0,i.nlen,i.lencode,0,i.work,L),i.lenbits=L.bits,C){e.msg="invalid literal/lengths set",i.mode=j;break}if(i.distbits=6,i.distcode=i.distdyn,L={bits:i.distbits},C=En(sf,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,L),i.distbits=L.bits,C){e.msg="invalid distances set",i.mode=j;break}if(i.mode=jr,t===Dr)break e;case jr:i.mode=zr;case zr: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,ix(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;w=i.lencode[l&(1<<i.lenbits)-1],y=w>>>24,m=w>>>16&255,b=w&65535,!(y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(m&&(m&240)===0){for(g=y,x=m,E=b;w=i.lencode[E+((l&(1<<g+x)-1)>>g)],y=w>>>24,m=w>>>16&255,b=w&65535,!(g+y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,i.back+=g}if(l>>>=y,c-=y,i.back+=y,i.length=b,m===0){i.mode=Qp;break}if(m&32){i.back=-1,i.mode=st;break}if(m&64){e.msg="invalid literal/length code",i.mode=j;break}i.extra=m&15,i.mode=Xp;case Xp: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=Kp;case Kp:for(;w=i.distcode[l&(1<<i.distbits)-1],y=w>>>24,m=w>>>16&255,b=w&65535,!(y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((m&240)===0){for(g=y,x=m,E=b;w=i.distcode[E+((l&(1<<g+x)-1)>>g)],y=w>>>24,m=w>>>16&255,b=w&65535,!(g+y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,i.back+=g}if(l>>>=y,c-=y,i.back+=y,m&64){e.msg="invalid distance code",i.mode=j;break}i.offset=b,i.extra=m&15,i.mode=Zp;case Zp: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=Jp;case Jp: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=zr);break;case Qp:if(d===0)break e;r[s++]=i.length,d--,i.mode=zr;break;case to: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):ro(i.check,r,p,s-p)),p=d,(i.flags?l:nf(l))!==i.check){e.msg="incorrect data check",i.mode=j;break}l=0,c=0}i.mode=ef;case ef: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=tf;case tf:C=ax;break e;case j:C=of;break e;case so:return ao;case lx: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<to||t!==Ip))&&ff(e,e.output,e.next_out,p-e.avail_out)?(i.mode=so,ao):(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):ro(i.check,r,p,e.next_out-p)),e.data_type=i.bits+(i.last?64:0)+(i.mode===st?128:0)+(i.mode===jr||i.mode===eo?256:0),(f===0&&p===0||t===Ip)&&C===qt&&(C=ox),C)}function bx(e){if(!e||!e.state)return ye;var t=e.state;return t.window&&(t.window=null),e.state=null,qt}function yx(e,t){var i;return!e||!e.state||(i=e.state,(i.wrap&2)===0)?ye:(i.head=t,t.done=!1,qt)}function vx(e,t){var i=t.length,n,r,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Br)?ye:n.mode===Br&&(r=1,r=ro(r,t,i,0),r!==n.check)?of:(a=ff(e,t,i,i),a?(n.mode=so,ao):(n.havedict=1,qt))}Se.inflateReset=df;Se.inflateReset2=uf;Se.inflateResetKeep=cf;Se.inflateInit=hx;Se.inflateInit2=pf;Se.inflate=mx;Se.inflateEnd=bx;Se.inflateGetHeader=yx;Se.inflateSetDictionary=vx;Se.inflateInfo="pako inflate (from Nodeca project)"});var oo=S((wE,gf)=>{"use strict";gf.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 bf=S((_E,mf)=>{"use strict";function xx(){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}mf.exports=xx});var vf=S(An=>{"use strict";var Ei=hf(),Sn=nt(),Fr=Ws(),H=oo(),lo=Cr(),wx=Ys(),_x=bf(),yf=Object.prototype.toString;function Gt(e){if(!(this instanceof Gt))return new Gt(e);this.options=Sn.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 wx,this.strm.avail_out=0;var i=Ei.inflateInit2(this.strm,t.windowBits);if(i!==H.Z_OK)throw new Error(lo[i]);if(this.header=new _x,Ei.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Fr.string2buf(t.dictionary):yf.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(lo[i])}Gt.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=Fr.binstring2buf(e):yf.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 Sn.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=Fr.utf8border(i.output,i.next_out),d=i.next_out-o,l=Fr.buf2string(i.output,o),i.next_out=d,i.avail_out=n-d,d&&Sn.arraySet(i.output,i.output,o,d,0),this.onData(l)):this.onData(Sn.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)};Gt.prototype.onData=function(e){this.chunks.push(e)};Gt.prototype.onEnd=function(e){e===H.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Sn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function co(e,t){var i=new Gt(t);if(i.push(e,!0),i.err)throw i.msg||lo[i.err];return i.result}function Ex(e,t){return t=t||{},t.raw=!0,co(e,t)}An.Inflate=Gt;An.inflate=co;An.inflateRaw=Ex;An.ungzip=co});var _f=S((SE,wf)=>{"use strict";var Sx=nt().assign,Ax=Ep(),Cx=vf(),Tx=oo(),xf={};Sx(xf,Ax,Cx,Tx);wf.exports=xf});var Sf=S(Hr=>{"use strict";var kx=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",Lx=_f(),Ef=F(),Nr=se(),Rx=kx?"uint8array":"array";Hr.magic="\b\0";function Wt(e,t){Nr.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}Ef.inherits(Wt,Nr);Wt.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(Ef.transformTo(Rx,e.data),!1)};Wt.prototype.flush=function(){Nr.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};Wt.prototype.cleanUp=function(){Nr.prototype.cleanUp.call(this),this._pako=null};Wt.prototype._createPako=function(){this._pako=new Lx[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};Hr.compressWorker=function(e){return new Wt("Deflate",e)};Hr.uncompressWorker=function(){return new Wt("Inflate",{})}});var po=S(uo=>{"use strict";var Af=se();uo.STORE={magic:"\0\0",compressWorker:function(){return new Af("STORE compression")},uncompressWorker:function(){return new Af("STORE decompression")}};uo.DEFLATE=Sf()});var fo=S(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 Lf=S((kE,kf)=>{"use strict";var Si=F(),Ai=se(),ho=pi(),Cf=wr(),$r=fo(),P=function(e,t){var i="",n;for(n=0;n<t;n++)i+=String.fromCharCode(e&255),e=e>>>8;return i},Mx=function(e,t){var i=e;return e||(i=t?16893:33204),(i&65535)<<16},Ox=function(e){return(e||0)&63},Tf=function(e,t,i,n,r,a){var s=e.file,o=e.compression,d=a!==ho.utf8encode,l=Si.transformTo("string",a(s.name)),c=Si.transformTo("string",ho.utf8encode(s.name)),f=s.comment,p=Si.transformTo("string",a(f)),u=Si.transformTo("string",ho.utf8encode(f)),v=c.length!==s.name.length,h=u.length!==f.length,w,y,m="",b="",g="",x=s.dir,E=s.date,A={crc32:0,compressedSize:0,uncompressedSize:0};(!t||i)&&(A.crc32=e.crc32,A.compressedSize=e.compressedSize,A.uncompressedSize=e.uncompressedSize);var C=0;t&&(C|=8),!d&&(v||h)&&(C|=2048);var T=0,L=0;x&&(T|=16),r==="UNIX"?(L=798,T|=Mx(s.unixPermissions,x)):(L=20,T|=Ox(s.dosPermissions,x)),w=E.getUTCHours(),w=w<<6,w=w|E.getUTCMinutes(),w=w<<5,w=w|E.getUTCSeconds()/2,y=E.getUTCFullYear()-1980,y=y<<4,y=y|E.getUTCMonth()+1,y=y<<5,y=y|E.getUTCDate(),v&&(b=P(1,1)+P(Cf(l),4)+c,m+="up"+P(b.length,2)+b),h&&(g=P(1,1)+P(Cf(p),4)+u,m+="uc"+P(g.length,2)+g);var _="";_+=`
|
|
2
|
-
\0`,_+=P(C,2),_+=o.magic,_+=P(w,2),_+=P(y,2),_+=P(A.crc32,4),_+=P(A.compressedSize,4),_+=P(A.uncompressedSize,4),_+=P(l.length,2),_+=P(m.length,2);var I=$r.LOCAL_FILE_HEADER+_+l+m,z=$r.CENTRAL_FILE_HEADER+P(L,2)+_+P(p.length,2)+"\0\0\0\0"+P(T,4)+P(n,4)+l+m+p;return{fileRecord:I,dirRecord:z}},Ix=function(e,t,i,n,r){var a="",s=Si.transformTo("string",r(n));return a=$r.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},Px=function(e){var t="";return t=$r.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=Tf(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=Tf(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:Px(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=Ix(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()};kf.exports=Ae});var Mf=S(Rf=>{"use strict";var Dx=po(),jx=Lf(),zx=function(e,t){var i=e||t,n=Dx[i];if(!n)throw new Error(i+" is not a valid compression method !");return n};Rf.generateWorker=function(e,t,i){var n=new jx(t.streamFiles,i,t.platform,t.encodeFileName),r=0;try{e.forEach(function(a,s){r++;var o=zx(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 If=S((RE,Of)=>{"use strict";var Bx=F(),Ur=se();function Cn(e,t){Ur.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}Bx.inherits(Cn,Ur);Cn.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()})};Cn.prototype.pause=function(){return Ur.prototype.pause.call(this)?(this._stream.pause(),!0):!1};Cn.prototype.resume=function(){return Ur.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};Of.exports=Cn});var Uf=S((ME,$f)=>{"use strict";var Fx=pi(),Tn=F(),zf=se(),Nx=ys(),Bf=vs(),Pf=_r(),Hx=Pu(),$x=Mf(),Df=tn(),Ux=If(),Ff=function(e,t,i){var n=Tn.getTypeOf(t),r,a=Tn.extend(i||{},Bf);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=Nf(e)),a.createFolders&&(r=qx(e))&&Hf.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 Pf&&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 Pf||t instanceof zf?d=t:Df.isNode&&Df.isStream(t)?d=new Ux(e,t):d=Tn.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new Hx(e,d,a);this.files[e]=l},qx=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},Nf=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},Hf=function(e,t){return t=typeof t!="undefined"?t:Bf.createFolders,e=Nf(e),this.files[e]||Ff.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function jf(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var Gx={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(jf(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,Ff.call(this,e,t,i);return this},folder:function(e){if(!e)return this;if(jf(e))return this.filter(function(r,a){return a.dir&&e.test(r)});var t=this.root+e,i=Hf.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=Tn.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:Fx.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.");Tn.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=$x.generateWorker(this,i,n)}catch(r){t=new zf("error"),t.error(r)}return new Nx(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)}};$f.exports=Gx});var go=S((OE,Gf)=>{"use strict";var Wx=F();function qf(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}qf.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 Wx.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))}};Gf.exports=qf});var mo=S((IE,Yf)=>{"use strict";var Wf=go(),Yx=F();function Ci(e){Wf.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}Yx.inherits(Ci,Wf);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};Yf.exports=Ci});var Kf=S((PE,Xf)=>{"use strict";var Vf=go(),Vx=F();function Ti(e){Vf.call(this,e)}Vx.inherits(Ti,Vf);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};Xf.exports=Ti});var yo=S((DE,Jf)=>{"use strict";var Zf=mo(),Xx=F();function bo(e){Zf.call(this,e)}Xx.inherits(bo,Zf);bo.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};Jf.exports=bo});var th=S((jE,eh)=>{"use strict";var Qf=yo(),Kx=F();function vo(e){Qf.call(this,e)}Kx.inherits(vo,Qf);vo.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};eh.exports=vo});var xo=S((zE,nh)=>{"use strict";var qr=F(),ih=tt(),Zx=mo(),Jx=Kf(),Qx=th(),ew=yo();nh.exports=function(e){var t=qr.getTypeOf(e);return qr.checkSupport(t),t==="string"&&!ih.uint8array?new Jx(e):t==="nodebuffer"?new Qx(e):ih.uint8array?new ew(qr.transformTo("uint8array",e)):new Zx(qr.transformTo("array",e))}});var oh=S((BE,sh)=>{"use strict";var wo=xo(),Et=F(),tw=_r(),rh=wr(),Gr=pi(),Wr=po(),iw=tt(),nw=0,rw=3,aw=function(e){for(var t in Wr)if(Object.prototype.hasOwnProperty.call(Wr,t)&&Wr[t].magic===e)return Wr[t];return null};function ah(e,t){this.options=e,this.loadOptions=t}ah.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=aw(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 tw(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===nw&&(this.dosPermissions=this.externalFileAttributes&63),e===rw&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=wo(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=iw.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=wo(e.value);return t.readInt(1)!==1||rh(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=wo(e.value);return t.readInt(1)!==1||rh(this.fileComment)!==t.readInt(4)?null:Gr.utf8decode(t.readData(e.length-5))}return null}};sh.exports=ah});var dh=S((FE,ch)=>{"use strict";var sw=xo(),ot=F(),Ce=fo(),ow=oh(),lw=tt();function lh(e){this.files=[],this.loadOptions=e}lh.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=lw.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 ow({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=sw(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};ch.exports=lh});var fh=S((NE,ph)=>{"use strict";var _o=F(),Yr=ci(),cw=pi(),dw=dh(),uw=_s(),uh=tn();function pw(e){return new Yr.Promise(function(t,i){var n=e.decompressed.getContentWorker().pipe(new uw);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()})}ph.exports=function(e,t){var i=this;return t=_o.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:cw.utf8decode}),uh.isNode&&uh.isStream(e)?Yr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):_o.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(n){var r=new dw(t);return r.load(n),r}).then(function(r){var a=[Yr.Promise.resolve(r)],s=r.files;if(t.checkCRC32)for(var o=0;o<s.length;o++)a.push(pw(s[o]));return Yr.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=_o.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 gh=S((HE,hh)=>{"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=Uf();ve.prototype.loadAsync=fh();ve.support=tt();ve.defaults=vs();ve.version="3.10.1";ve.loadAsync=function(e,t){return new ve().loadAsync(e,t)};ve.external=ci();hh.exports=ve});var wh={};hc(wh,{AssetEditorModal:()=>Lo});var Lo,Ro=qe(()=>{"use strict";Lo=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(t,i,n,r){this.currentObjectId=t,this.currentPath=i,this.currentAsset=n,this.onApplyCallback=r,this.createModal(t,n),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(t,i){let n=document.createElement("div");n.className="asset-editor-modal",n.innerHTML=`
|
|
1
|
+
"use strict";var Dg=Object.create;var Un=Object.defineProperty;var zg=Object.getOwnPropertyDescriptor;var Bg=Object.getOwnPropertyNames;var Fg=Object.getPrototypeOf,Hg=Object.prototype.hasOwnProperty;var qe=(e,t)=>()=>(e&&(t=e(e=0)),t);var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hc=(e,t)=>{for(var i in t)Un(e,i,{get:t[i],enumerable:!0})},gc=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bg(t))!Hg.call(e,r)&&r!==i&&Un(e,r,{get:()=>t[r],enumerable:!(n=zg(t,r))||n.enumerable});return e};var Ge=(e,t,i)=>(i=e!=null?Dg(Fg(e)):{},gc(t||!e||!e.__esModule?Un(i,"default",{value:e,enumerable:!0}):i,e)),Ng=e=>gc(Un({},"__esModule",{value:!0}),e);var We,wa=qe(()=>{"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 Xg(){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 Kg(){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 Zg(){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 Jg(){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(!_a){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),_a=(async()=>{try{try{let a=await import(t+"?t="+Date.now());if(a.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(a.INLINE_ASSETS)),a.INLINE_ASSETS}catch(a){console.warn("[AssetLoader] ES module import failed, trying text parse:",a)}let i=await fetch(t);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);let n=await i.text();console.log("[AssetLoader] Received JS code, length:",n.length);let r=n.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(r)try{let a=r[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let s=new Function("return "+a)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(s)),s}catch(a){return console.warn("[AssetLoader] Failed to parse inline assets:",a),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",n.substring(0,500)),{}}catch(i){return console.warn("[AssetLoader] Failed to load inline assets:",i),{}}})()}return Ye=await _a,console.log("[AssetLoader] Final inline assets cache:",Object.keys(Ye)),Ye}function Ea(e){return e===null||typeof e!="object"||(Object.freeze(e),Object.values(e).forEach(t=>Ea(t))),e}function Qg(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 Sa(e,t){Xc.set(e,t)}var Ve,Yc,Vc,Lt,B,Le,ut,Ye,_a,Xc,Rt,Yn=qe(()=>{"use strict";Ve=require("pixi.js");wa();Yc=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Vc=Xg(),Lt=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,B=Vc?"publish":Yc,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=Zg();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);Kg().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: ${Yc}, Runtime: ${Vc?"publish":"dev"}, Effective: ${B}`);Ye={},_a=null;Xc=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 Jg(),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=Xc.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=Ea(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"?Qg():Ea({__placeholder:!0,type:i});return We.set(t+":"+((n==null?void 0:n.path)||"missing"),a),a}throw n}};Sa("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)});Sa("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 Ca,rm,Vn,Ui=qe(()=>{"use strict";Yn();Ca=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(t,i){if(this.config===t&&this.app===i&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(n=>{this.priorityReadyResolve=n}),this.config=t,this.app=i,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let t=this.config,i=this.app;return this.readyPromise=(async()=>{var s;console.log("[AssetTextures] Loading all assets...");let n=new Set(["background_loading_1"]),r=[],a=[];for(let[o,d]of t.objects.entries()){let l=(s=d.render)==null?void 0:s.asset;if(!l)continue;let c=async()=>{var f;try{let p=(f=d.identity)==null?void 0:f.id;console.log(`[AssetTextures] Loading ${l.type}: ${o} (${p})`);let u=await Rt.load(o,l,i,p);this.textures.set(o,u),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(p){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,p)}finally{this.attempted.add(o);try{for(let p of Array.from(this.waiters))p()}catch{}}};n.has(o)?r.push(c()):a.push(c())}r.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(r),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(a),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(t,i={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let r=Array.from(new Set((t||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var d,l,c,f;try{let p=(c=(l=(d=this.config)==null?void 0:d.objects)==null?void 0:l.get)==null?void 0:c.call(l,o);return!!((f=p==null?void 0:p.render)!=null&&f.asset)}catch{return!1}});if(r.length===0)return;this.ready().catch(()=>{});let a=()=>r.every(o=>this.textures.has(o)||this.attempted.has(o));if(a())return;let s=typeof i.timeoutMs=="number"?i.timeoutMs:15e3;await new Promise(o=>{let d=!1,l=()=>{d||a()&&(d=!0,this.waiters.delete(l),o())};this.waiters.add(l),l(),s>0&&setTimeout(()=>{d||(d=!0,this.waiters.delete(l),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:r}),o())},s)})}get(t){return this.textures.get(t)}set(t,i){this.textures.set(t,i),console.log(`[AssetTextures] Updated texture: ${t}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},rm=new Ca,Vn=new Proxy(rm,{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 Cm,pt=qe(()=>{"use strict";Cm="handler_preview_override_mode";if(typeof window!="undefined"){let e=window.localStorage.getItem(Cm);window.__enableConfigOverrides=e===null?!0:e==="true"}});var ed,It,v_,Ra=qe(()=>{"use strict";pt();ed=null,It="dev";if(typeof window!="undefined"){let e=window.__BUILD_SETTINGS__;if(e!=null&&e.buildMode)ed=e,It=e.buildMode,console.log("[CONFIG] Loaded inline build settings:",e,"buildMode:",It);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);ed=i,It=i.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",i,"buildMode:",It)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",It)}catch(t){console.log("[CONFIG] Failed to load build-settings.json:",t instanceof Error?t.message:String(t))}}console.log("[CONFIG] Final buildMode:",It);v_=It==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var Ma=qe(()=>{"use strict"});var id=qe(()=>{"use strict";Ma();Ra()});var Oa=qe(()=>{"use strict";Ra();Ma();id()});var Wi=S((I1,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:Dm}:Ia.exports=process;function Dm(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 ad=S((P1,rd)=>{"use strict";var zm={}.toString;rd.exports=Array.isArray||function(e){return zm.call(e)=="[object Array]"}});var Pa=S((j1,sd)=>{"use strict";sd.exports=require("stream")});var Yi=S((ja,ld)=>{"use strict";var nr=require("buffer"),Je=nr.Buffer;function od(e,t){for(var i in e)t[i]=e[i]}Je.from&&Je.alloc&&Je.allocUnsafe&&Je.allocUnsafeSlow?ld.exports=nr:(od(nr,ja),ja.Buffer=ti);function ti(e,t,i){return Je(e,t,i)}od(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 nr.SlowBuffer(e)}});var ii=S(K=>{"use strict";function Bm(e){return Array.isArray?Array.isArray(e):rr(e)==="[object Array]"}K.isArray=Bm;function Fm(e){return typeof e=="boolean"}K.isBoolean=Fm;function Hm(e){return e===null}K.isNull=Hm;function Nm(e){return e==null}K.isNullOrUndefined=Nm;function $m(e){return typeof e=="number"}K.isNumber=$m;function Um(e){return typeof e=="string"}K.isString=Um;function qm(e){return typeof e=="symbol"}K.isSymbol=qm;function Gm(e){return e===void 0}K.isUndefined=Gm;function Wm(e){return rr(e)==="[object RegExp]"}K.isRegExp=Wm;function Ym(e){return typeof e=="object"&&e!==null}K.isObject=Ym;function Vm(e){return rr(e)==="[object Date]"}K.isDate=Vm;function Xm(e){return rr(e)==="[object Error]"||e instanceof Error}K.isError=Xm;function Km(e){return typeof e=="function"}K.isFunction=Km;function Zm(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}K.isPrimitive=Zm;K.isBuffer=require("buffer").Buffer.isBuffer;function rr(e){return Object.prototype.toString.call(e)}});var cd=S((z1,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=S((B1,Ba)=>{"use strict";try{if(za=require("util"),typeof za.inherits!="function")throw"";Ba.exports=za.inherits}catch{Ba.exports=cd()}var za});var ud=S((F1,Fa)=>{"use strict";function Jm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var dd=Yi().Buffer,Vi=require("util");function Qm(e,t,i){e.copy(t,i)}Fa.exports=(function(){function e(){Jm(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 dd.alloc(0);for(var n=dd.allocUnsafe(i>>>0),r=this.head,a=0;r;)Qm(r.data,n,a),a+=r.data.length,r=r.next;return n},e})();Vi&&Vi.inspect&&Vi.inspect.custom&&(Fa.exports.prototype[Vi.inspect.custom]=function(){var e=Vi.inspect({length:this.length});return this.constructor.name+" "+e})});var Ha=S((H1,pd)=>{"use strict";var ar=Wi();function eb(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,ar.nextTick(sr,this,e)):ar.nextTick(sr,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,ar.nextTick(sr,i,a)):ar.nextTick(sr,i,a):t&&t(a)}),this)}function tb(){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 sr(e,t){e.emit("error",t)}pd.exports={destroy:eb,undestroy:tb}});var hd=S((N1,fd)=>{"use strict";fd.exports=require("util").deprecate});var $a=S(($1,_d)=>{"use strict";var Pt=Wi();_d.exports=$;function md(e){var t=this;this.next=null,this.entry=null,this.finish=function(){vb(t,e)}}var ib=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Pt.nextTick,ri;$.WritableState=Ki;var bd=Object.create(ii());bd.inherits=ni();var nb={deprecate:hd()},yd=Pa(),lr=Yi().Buffer,rb=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function ab(e){return lr.from(e)}function sb(e){return lr.isBuffer(e)||e instanceof rb}var vd=Ha();bd.inherits($,yd);function ob(){}function Ki(e,t){ri=ri||jt(),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){hb(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 md(this)}Ki.prototype.getBuffer=function(){for(var t=this.bufferedRequest,i=[];t;)i.push(t),t=t.next;return i};(function(){try{Object.defineProperty(Ki.prototype,"buffer",{get:nb.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var or;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(or=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(e){return or.call(this,e)?!0:this!==$?!1:e&&e._writableState instanceof Ki}})):or=function(e){return e instanceof this};function $(e){if(ri=ri||jt(),!or.call($,this)&&!(this instanceof ri))return new $(e);this._writableState=new Ki(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)),yd.call(this)}$.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function lb(e,t){var i=new Error("write after end");e.emit("error",i),Pt.nextTick(t,i)}function cb(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&&sb(e);return a&&!lr.isBuffer(e)&&(e=ab(e)),typeof t=="function"&&(i=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof i!="function"&&(i=ob),n.ended?lb(this,i):(a||cb(this,n,e,i))&&(n.pendingcb++,r=ub(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&&xd(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 db(e,t,i){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=lr.from(t,i)),t}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ub(e,t,i,n,r,a){if(!i){var s=db(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 pb(e,t,i,n,r){--t.pendingcb,i?(Pt.nextTick(r,n),Pt.nextTick(Xi,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(r(n),e._writableState.errorEmitted=!0,e.emit("error",n),Xi(e,t))}function fb(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function hb(e,t){var i=e._writableState,n=i.sync,r=i.writecb;if(fb(i),t)pb(e,i,n,t,r);else{var a=wd(i);!a&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&xd(e,i),n?ib(gd,e,i,a,r):gd(e,i,a,r)}}function gd(e,t,i,n){i||gb(e,t),t.pendingcb--,n(),Xi(e,t)}function gb(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function xd(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 md(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||yb(this,n,i)};function wd(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function mb(e,t){e._final(function(i){t.pendingcb--,i&&e.emit("error",i),t.prefinished=!0,e.emit("prefinish"),Xi(e,t)})}function bb(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Pt.nextTick(mb,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Xi(e,t){var i=wd(t);return i&&(bb(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),i}function yb(e,t,i){t.ending=!0,Xi(e,t),i&&(t.finished?Pt.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}function vb(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=vd.destroy;$.prototype._undestroy=vd.undestroy;$.prototype._destroy=function(e,t){this.end(),t(e)}});var jt=S((U1,Cd)=>{"use strict";var Ed=Wi(),xb=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};Cd.exports=Qe;var Sd=Object.create(ii());Sd.inherits=ni();var Ad=Ga(),qa=$a();Sd.inherits(Qe,Ad);for(Ua=xb(qa.prototype),cr=0;cr<Ua.length;cr++)dr=Ua[cr],Qe.prototype[dr]||(Qe.prototype[dr]=qa.prototype[dr]);var Ua,dr,cr;function Qe(e){if(!(this instanceof Qe))return new Qe(e);Ad.call(this,e),qa.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",wb)}Object.defineProperty(Qe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function wb(){this.allowHalfOpen||this._writableState.ended||Ed.nextTick(_b,this)}function _b(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(),Ed.nextTick(t,e)}});var Va=S(kd=>{"use strict";var Ya=Yi().Buffer,Td=Ya.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 Eb(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 Sb(e){var t=Eb(e);if(typeof t!="string"&&(Ya.isEncoding===Td||!Td(e)))throw new Error("Unknown encoding: "+e);return t||e}kd.StringDecoder=Zi;function Zi(e){this.encoding=Sb(e);var t;switch(this.encoding){case"utf16le":this.text=Rb,this.end=Mb,t=4;break;case"utf8":this.fillLast=Tb,t=4;break;case"base64":this.text=Ob,this.end=Ib,t=3;break;default:this.write=Pb,this.end=jb;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ya.allocUnsafe(t)}Zi.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||""};Zi.prototype.end=Lb;Zi.prototype.text=kb;Zi.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 Wa(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Ab(e,t,i){var n=t.length-1;if(n<i)return 0;var r=Wa(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=Wa(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=Wa(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}function Cb(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 Tb(e){var t=this.lastTotal-this.lastNeed,i=Cb(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 kb(e,t){var i=Ab(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 Lb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Rb(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 Mb(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 Ob(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 Ib(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Pb(e){return e.toString(this.encoding)}function jb(e){return e&&e.length?this.write(e):""}});var Ga=S((W1,Hd)=>{"use strict";var si=Wi();Hd.exports=j;var Db=ad(),Ji;j.ReadableState=jd;var G1=require("events").EventEmitter,Od=function(e,t){return e.listeners(t).length},Qa=Pa(),Qi=Yi().Buffer,zb=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Bb(e){return Qi.from(e)}function Fb(e){return Qi.isBuffer(e)||e instanceof zb}var Id=Object.create(ii());Id.inherits=ni();var Xa=require("util"),O=void 0;Xa&&Xa.debuglog?O=Xa.debuglog("stream"):O=function(){};var Hb=ud(),Pd=Ha(),ai;Id.inherits(j,Qa);var Ka=["error","close","destroy","pause","resume"];function Nb(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):Db(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}function jd(e,t){Ji=Ji||jt(),e=e||{};var i=t instanceof Ji;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 Hb,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=Va().StringDecoder),this.decoder=new ai(e.encoding),this.encoding=e.encoding)}function j(e){if(Ji=Ji||jt(),!(this instanceof j))return new j(e);this._readableState=new jd(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Qa.call(this)}Object.defineProperty(j.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});j.prototype.destroy=Pd.destroy;j.prototype._undestroy=Pd.undestroy;j.prototype._destroy=function(e,t){this.push(null),t(e)};j.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=Qi.from(e,t),t=""),n=!0),Dd(this,e,t,!1,n)};j.prototype.unshift=function(e){return Dd(this,e,null,!0,!1)};function Dd(e,t,i,n,r){var a=e._readableState;if(t===null)a.reading=!1,Gb(e,a);else{var s;r||(s=$b(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Qi.prototype&&(t=Bb(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Za(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?Za(e,a,t,!1):zd(e,a)):Za(e,a,t,!1))):n||(a.reading=!1)}return Ub(a)}function Za(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&&ur(e)),zd(e,t)}function $b(e,t){var i;return!Fb(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i}function Ub(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}j.prototype.isPaused=function(){return this._readableState.flowing===!1};j.prototype.setEncoding=function(e){return ai||(ai=Va().StringDecoder),this._readableState.decoder=new ai(e),this._readableState.encoding=e,this};var Ld=8388608;function qb(e){return e>=Ld?e=Ld:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Rd(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=qb(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}j.prototype.read=function(e){O("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 O("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Ja(this):ur(this),null;if(e=Rd(e,t),e===0&&t.ended)return t.length===0&&Ja(this),null;var n=t.needReadable;O("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,O("length less than watermark",n)),t.ended||t.reading?(n=!1,O("reading or ended",n)):n&&(O("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Rd(i,t)));var r;return e>0?r=Bd(e,t):r=null,r===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&Ja(this)),r!==null&&this.emit("data",r),r};function Gb(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,ur(e)}}function ur(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(O("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?si.nextTick(Md,e):Md(e))}function Md(e){O("emit readable"),e.emit("readable"),es(e)}function zd(e,t){t.readingMore||(t.readingMore=!0,si.nextTick(Wb,e,t))}function Wb(e,t){for(var i=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(O("maybeReadMore read 0"),e.read(0),i!==t.length);)i=t.length;t.readingMore=!1}j.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};j.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,O("pipe count=%d opts=%j",n.pipesCount,t);var r=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=r?o:w;n.endEmitted?si.nextTick(a):i.once("end",a),e.on("unpipe",s);function s(y,m){O("onunpipe"),y===i&&m&&m.hasUnpiped===!1&&(m.hasUnpiped=!0,c())}function o(){O("onend"),e.end()}var d=Yb(i);e.on("drain",d);var l=!1;function c(){O("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",w),i.removeListener("data",p),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var f=!1;i.on("data",p);function p(y){O("ondata"),f=!1;var m=e.write(y);m===!1&&!f&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&Fd(n.pipes,e)!==-1)&&!l&&(O("false write response, pause",n.awaitDrain),n.awaitDrain++,f=!0),i.pause())}function u(y){O("onerror",y),w(),e.removeListener("error",u),Od(e,"error")===0&&e.emit("error",y)}Nb(e,"error",u);function v(){e.removeListener("finish",h),w()}e.once("close",v);function h(){O("onfinish"),e.removeListener("close",v),w()}e.once("finish",h);function w(){O("unpipe"),i.unpipe(e)}return e.emit("pipe",i),n.flowing||(O("pipe resume"),i.resume()),e};function Yb(e){return function(){var t=e._readableState;O("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Od(e,"data")&&(t.flowing=!0,es(e))}}j.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=Fd(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)};j.prototype.on=function(e,t){var i=Qa.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&&ur(this):si.nextTick(Vb,this))}return i};j.prototype.addListener=j.prototype.on;function Vb(e){O("readable nexttick read 0"),e.read(0)}j.prototype.resume=function(){var e=this._readableState;return e.flowing||(O("resume"),e.flowing=!0,Xb(this,e)),this};function Xb(e,t){t.resumeScheduled||(t.resumeScheduled=!0,si.nextTick(Kb,e,t))}function Kb(e,t){t.reading||(O("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),es(e),t.flowing&&!t.reading&&e.read(0)}j.prototype.pause=function(){return O("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(O("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function es(e){var t=e._readableState;for(O("flow",t.flowing);t.flowing&&e.read()!==null;);}j.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;e.on("end",function(){if(O("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(O("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<Ka.length;a++)e.on(Ka[a],this.emit.bind(this,Ka[a]));return this._read=function(s){O("wrapped _read",s),n&&(n=!1,e.resume())},this};Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});j._fromList=Bd;function Bd(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=Zb(e,t.buffer,t.decoder),i}function Zb(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?Jb(e,t):Qb(e,t),n}function Jb(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 Qb(e,t){var i=Qi.allocUnsafe(e),n=t.head,r=1;for(n.data.copy(i),e-=n.data.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(a.copy(i,i.length-e,0,s),e-=s,e===0){s===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++r}return t.length-=r,i}function Ja(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,si.nextTick(ey,t,e))}function ey(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Fd(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}});var ts=S((Y1,Ud)=>{"use strict";Ud.exports=et;var pr=jt(),$d=Object.create(ii());$d.inherits=ni();$d.inherits(et,pr);function ty(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);pr.call(this,e),this._transformState={afterTransform:ty.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",iy)}function iy(){var e=this;typeof this._flush=="function"?this._flush(function(t,i){Nd(e,t,i)}):Nd(this,null,null)}et.prototype.push=function(e,t){return this._transformState.needTransform=!1,pr.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;pr.prototype._destroy.call(this,e,function(n){t(n),i.emit("close")})};function Nd(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 Yd=S((V1,Wd)=>{"use strict";Wd.exports=en;var qd=ts(),Gd=Object.create(ii());Gd.inherits=ni();Gd.inherits(en,qd);function en(e){if(!(this instanceof en))return new en(e);qd.call(this,e)}en.prototype._transform=function(e,t,i){i(null,e)}});var is=S((Y,fr)=>{"use strict";var Re=require("stream");process.env.READABLE_STREAM==="disable"&&Re?(fr.exports=Re,Y=fr.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=fr.exports=Ga(),Y.Stream=Re||Y,Y.Readable=Y,Y.Writable=$a(),Y.Duplex=jt(),Y.Transform=ts(),Y.PassThrough=Yd())});var tt=S(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{ns=new ArrayBuffer(0);try{ae.blob=new Blob([ns],{type:"application/zip"}).size===0}catch{try{Vd=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,rs=new Vd,rs.append(ns),ae.blob=rs.getBlob("application/zip").size===0}catch{ae.blob=!1}}}var ns,Vd,rs;try{ae.nodestream=!!is().Readable}catch{ae.nodestream=!1}});var ss=S(as=>{"use strict";var ny=F(),ry=tt(),Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";as.encode=function(e){for(var t=[],i,n,r,a,s,o,d,l=0,c=e.length,f=c,p=ny.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("")};as.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(ry.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 tn=S((Z1,Xd)=>{"use strict";Xd.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 Qd=S((J1,Jd)=>{"use strict";var Kd=global.MutationObserver||global.WebKitMutationObserver,oi;process.browser?Kd?(os=0,Zd=new Kd(nn),ls=global.document.createTextNode(""),Zd.observe(ls,{characterData:!0}),oi=function(){ls.data=os=++os%2}):!global.setImmediate&&typeof global.MessageChannel!="undefined"?(cs=new global.MessageChannel,cs.port1.onmessage=nn,oi=function(){cs.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?oi=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){nn(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:oi=function(){setTimeout(nn,0)}:oi=function(){process.nextTick(nn)};var os,Zd,ls,cs,ds,rn=[];function nn(){ds=!0;for(var e,t,i=rn.length;i;){for(t=rn,rn=[],e=-1;++e<i;)t[e]();i=rn.length}ds=!1}Jd.exports=ay;function ay(e){rn.push(e)===1&&!ds&&oi()}});var su=S((Q1,au)=>{"use strict";var eu=Qd();function li(){}var Z={},tu=["REJECTED"],us=["FULFILLED"],iu=["PENDING"];process.browser||(an=["UNHANDLED"]);var an;au.exports=ft;function ft(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=iu,this.queue=[],this.outcome=void 0,process.browser||(this.handled=an),e!==li&&nu(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===us||typeof t!="function"&&this.state===tu)return this;var i=new this.constructor(li);if(process.browser||this.handled===an&&(this.handled=null),this.state!==iu){var n=this.state===us?e:t;ps(i,n,this.outcome)}else this.queue.push(new sn(i,e,t));return i};function sn(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)}sn.prototype.callFulfilled=function(e){Z.resolve(this.promise,e)};sn.prototype.otherCallFulfilled=function(e){ps(this.promise,this.onFulfilled,e)};sn.prototype.callRejected=function(e){Z.reject(this.promise,e)};sn.prototype.otherCallRejected=function(e){ps(this.promise,this.onRejected,e)};function ps(e,t,i){eu(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=ru(sy,t);if(i.status==="error")return Z.reject(e,i.value);var n=i.value;if(n)nu(e,n);else{e.state=us,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=tu,e.outcome=t,process.browser||e.handled===an&&eu(function(){e.handled===an&&process.emit("unhandledRejection",t,e)});for(var i=-1,n=e.queue.length;++i<n;)e.queue[i].callRejected(t);return e};function sy(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function nu(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=ru(a);s.status==="error"&&n(s.value)}function ru(e,t){var i={};try{i.value=e(t),i.status="success"}catch(n){i.status="error",i.value=n}return i}ft.resolve=oy;function oy(e){return e instanceof this?e:Z.resolve(new this(li),e)}ft.reject=ly;function ly(e){var t=new this(li);return Z.reject(t,e)}ft.all=cy;function cy(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=dy;function dy(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=S((eE,ou)=>{"use strict";var fs=null;typeof Promise!="undefined"?fs=Promise:fs=su();ou.exports={Promise:fs}});var cu=S(lu=>{"use strict";(function(e,t){"use strict";if(e.setImmediate)return;var i=1,n={},r=!1,a=e.document,s;function o(m){typeof m!="function"&&(m=new Function(""+m));for(var b=new Array(arguments.length-1),g=0;g<b.length;g++)b[g]=arguments[g+1];var x={callback:m,args:b};return n[i]=x,s(i),i++}function d(m){delete n[m]}function l(m){var b=m.callback,g=m.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(m){if(r)setTimeout(c,0,m);else{var b=n[m];if(b){r=!0;try{l(b)}finally{d(m),r=!1}}}}function f(){s=function(m){process.nextTick(function(){c(m)})}}function p(){if(e.postMessage&&!e.importScripts){var m=!0,b=e.onmessage;return e.onmessage=function(){m=!1},e.postMessage("","*"),e.onmessage=b,m}}function u(){var m="setImmediate$"+Math.random()+"$",b=function(g){g.source===e&&typeof g.data=="string"&&g.data.indexOf(m)===0&&c(+g.data.slice(m.length))};e.addEventListener?e.addEventListener("message",b,!1):e.attachEvent("onmessage",b),s=function(g){e.postMessage(m+g,"*")}}function v(){var m=new MessageChannel;m.port1.onmessage=function(b){var g=b.data;c(g)},s=function(b){m.port2.postMessage(b)}}function h(){var m=a.documentElement;s=function(b){var g=a.createElement("script");g.onreadystatechange=function(){c(b),g.onreadystatechange=null,m.removeChild(g),g=null},m.appendChild(g)}}function w(){s=function(m){setTimeout(c,0,m)}}var y=Object.getPrototypeOf&&Object.getPrototypeOf(e);y=y&&y.setTimeout?y:e,{}.toString.call(e.process)==="[object process]"?f():p()?u():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?h():w(),y.setImmediate=o,y.clearImmediate=d})(typeof self=="undefined"?typeof global=="undefined"?lu:global:self)});var F=S(U=>{"use strict";var ht=tt(),uy=ss(),di=tn(),hs=ci();cu();function py(e){var t=null;return ht.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),gr(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 on(e){return e}function gr(e,t){for(var i=0;i<e.length;++i)t[i]=e.charCodeAt(i)&255;return t}var hr={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 ln(e){var t=65536,i=U.getTypeOf(e),n=!0;if(i==="uint8array"?n=hr.applyCanBeUsed.uint8array:i==="nodebuffer"&&(n=hr.applyCanBeUsed.nodebuffer),n)for(;t>1;)try{return hr.stringifyByChunk(e,i,t)}catch{t=Math.floor(t/2)}return hr.stringifyByChar(e)}U.applyFromCharCode=ln;function mr(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}var gt={};gt.string={string:on,array:function(e){return gr(e,new Array(e.length))},arraybuffer:function(e){return gt.string.uint8array(e).buffer},uint8array:function(e){return gr(e,new Uint8Array(e.length))},nodebuffer:function(e){return gr(e,di.allocBuffer(e.length))}};gt.array={string:ln,array:on,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 ln(new Uint8Array(e))},array:function(e){return mr(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:on,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return di.newBufferFrom(new Uint8Array(e))}};gt.uint8array={string:ln,array:function(e){return mr(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:on,nodebuffer:function(e){return di.newBufferFrom(e)}};gt.nodebuffer={string:ln,array:function(e){return mr(e,new Array(e.length))},arraybuffer:function(e){return gt.nodebuffer.uint8array(e).buffer},uint8array:function(e){return mr(e,new Uint8Array(e.length))},nodebuffer:on};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=hs.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 hs.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=uy.decode(s):i&&n!==!0&&(s=py(s))),s):hs.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var se=S((nE,uu)=>{"use strict";function du(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}du.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}};uu.exports=du});var pi=S(mt=>{"use strict";var ui=F(),Dt=tt(),fy=tn(),br=se(),cn=new Array(256);for(it=0;it<256;it++)cn[it]=it>=252?6:it>=248?5:it>=240?4:it>=224?3:it>=192?2:1;var it;cn[254]=cn[254]=1;var hy=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(Dt.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},gy=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+cn[e[i]]>t?i:t},my=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=cn[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 Dt.nodebuffer?fy.newBufferFrom(t,"utf-8"):hy(t)};mt.utf8decode=function(t){return Dt.nodebuffer?ui.transformTo("nodebuffer",t).toString("utf-8"):(t=ui.transformTo(Dt.uint8array?"uint8array":"array",t),my(t))};function yr(){br.call(this,"utf-8 decode"),this.leftOver=null}ui.inherits(yr,br);yr.prototype.processChunk=function(e){var t=ui.transformTo(Dt.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(Dt.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=gy(t),r=t;n!==t.length&&(Dt.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})};yr.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:mt.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};mt.Utf8DecodeWorker=yr;function gs(){br.call(this,"utf-8 encode")}ui.inherits(gs,br);gs.prototype.processChunk=function(e){this.push({data:mt.utf8encode(e.data),meta:e.meta})};mt.Utf8EncodeWorker=gs});var gu=S((aE,hu)=>{"use strict";var pu=se(),fu=F();function ms(e){pu.call(this,"ConvertWorker to "+e),this.destType=e}fu.inherits(ms,pu);ms.prototype.processChunk=function(e){this.push({data:fu.transformTo(this.destType,e.data),meta:e.meta})};hu.exports=ms});var yu=S((sE,bu)=>{"use strict";var mu=is().Readable,by=F();by.inherits(bs,mu);function bs(e,t,i){mu.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)})}bs.prototype._read=function(){this._helper.resume()};bu.exports=bs});var ys=S((oE,wu)=>{"use strict";var zt=F(),yy=gu(),vy=se(),xy=ss(),wy=tt(),_y=ci(),vu=null;if(wy.nodestream)try{vu=yu()}catch{}function Ey(e,t,i){switch(e){case"blob":return zt.newBlob(zt.transformTo("arraybuffer",t),i);case"base64":return xy.encode(t);default:return zt.transformTo(e,t)}}function Sy(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 Ay(e,t){return new _y.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=Ey(s,Sy(a,r),o);i(d)}catch(l){n(l)}r=[]}).resume()})}function xu(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 yy(n)),e.lock()}catch(r){this._worker=new vy("error"),this._worker.error(r)}}xu.prototype={accumulate:function(e){return Ay(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 vu(this,{objectMode:this._outputType!=="nodebuffer"},e)}};wu.exports=xu});var vs=S(_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 xs=S((cE,_u)=>{"use strict";var vr=F(),xr=se(),Cy=16*1024;function fi(e){xr.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=vr.getTypeOf(i),t.isPaused||t._tickAndRepeat()},function(i){t.error(i)})}vr.inherits(fi,xr);fi.prototype.cleanUp=function(){xr.prototype.cleanUp.call(this),this.data=null};fi.prototype.resume=function(){return xr.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,vr.delay(this._tickAndRepeat,[],this)),!0):!1};fi.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(vr.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};fi.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=Cy,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}})};_u.exports=fi});var wr=S((dE,Su)=>{"use strict";var Ty=F();function ky(){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 Eu=ky();function Ly(e,t,i,n){var r=Eu,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 Ry(e,t,i,n){var r=Eu,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}Su.exports=function(t,i){if(typeof t=="undefined"||!t.length)return 0;var n=Ty.getTypeOf(t)!=="string";return n?Ly(i|0,t,t.length,0):Ry(i|0,t,t.length,0)}});var _s=S((uE,Cu)=>{"use strict";var Au=se(),My=wr(),Oy=F();function ws(){Au.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Oy.inherits(ws,Au);ws.prototype.processChunk=function(e){this.streamInfo.crc32=My(e.data,this.streamInfo.crc32||0),this.push(e)};Cu.exports=ws});var ku=S((pE,Tu)=>{"use strict";var Iy=F(),Es=se();function Ss(e){Es.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}Iy.inherits(Ss,Es);Ss.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}Es.prototype.processChunk.call(this,e)};Tu.exports=Ss});var _r=S((fE,Mu)=>{"use strict";var Lu=ci(),Ru=xs(),Py=_s(),As=ku();function Cs(e,t,i,n,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=n,this.compressedContent=r}Cs.prototype={getContentWorker:function(){var e=new Ru(Lu.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new As("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 Ru(Lu.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};Cs.createWorkerFrom=function(e,t,i){return e.pipe(new Py).pipe(new As("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new As("compressedSize")).withStreamInfo("compression",t)};Mu.exports=Cs});var ju=S((hE,Pu)=>{"use strict";var jy=ys(),Dy=xs(),Ts=pi(),ks=_r(),Ou=se(),Ls=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}};Ls.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 Ts.Utf8EncodeWorker)),!r&&n&&(t=t.pipe(new Ts.Utf8DecodeWorker))}catch(a){t=new Ou("error"),t.error(a)}return new jy(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 ks&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new Ts.Utf8EncodeWorker)),ks.createWorkerFrom(i,e,t)},_decompressWorker:function(){return this._data instanceof ks?this._data.getContentWorker():this._data instanceof Ou?this._data:new Dy(this._data)}};var Iu=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],zy=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(Er=0;Er<Iu.length;Er++)Ls.prototype[Iu[Er]]=zy;var Er;Pu.exports=Ls});var nt=S(J=>{"use strict";var By=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function Fy(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)Fy(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 Hy={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}},Ny={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,Hy)):(J.Buf8=Array,J.Buf16=Array,J.Buf32=Array,J.assign(J,Ny))};J.setTyped(By)});var rp=S(mi=>{"use strict";var $y=nt(),Uy=4,Du=0,zu=1,qy=2;function gi(e){for(var t=e.length;--t>=0;)e[t]=0}var Gy=0,Uu=1,Wy=2,Yy=3,Vy=258,Ds=29,gn=256,un=gn+1+Ds,hi=30,zs=19,qu=2*un+1,Bt=15,Rs=16,Xy=7,Bs=256,Gu=16,Wu=17,Yu=18,Ps=[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],Sr=[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],Ky=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Vu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Zy=512,rt=new Array((un+2)*2);gi(rt);var dn=new Array(hi*2);gi(dn);var pn=new Array(Zy);gi(pn);var fn=new Array(Vy-Yy+1);gi(fn);var Fs=new Array(Ds);gi(Fs);var Ar=new Array(hi);gi(Ar);function Ms(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 Xu,Ku,Zu;function Os(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Ju(e){return e<256?pn[e]:pn[256+(e>>>7)]}function hn(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>Rs-i?(e.bi_buf|=t<<e.bi_valid&65535,hn(e,e.bi_buf),e.bi_buf=t>>Rs-e.bi_valid,e.bi_valid+=i-Rs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function Oe(e,t,i){ie(e,i[t*2],i[t*2+1])}function Qu(e,t){var i=0;do i|=e&1,e>>>=1,i<<=1;while(--t>0);return i>>>1}function Jy(e){e.bi_valid===16?(hn(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 Qy(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<qu;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 ep(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]=Qu(n[o]++,o))}}function ev(){var e,t,i,n,r,a=new Array(Bt+1);for(i=0,n=0;n<Ds-1;n++)for(Fs[n]=i,e=0;e<1<<Ps[n];e++)fn[i++]=n;for(fn[i-1]=n,r=0,n=0;n<16;n++)for(Ar[n]=r,e=0;e<1<<Sr[n];e++)pn[r++]=n;for(r>>=7;n<hi;n++)for(Ar[n]=r<<7,e=0;e<1<<Sr[n]-7;e++)pn[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(ep(rt,un+1,a),e=0;e<hi;e++)dn[e*2+1]=5,dn[e*2]=Qu(e,5);Xu=new Ms(rt,Ps,gn+1,un,Bt),Ku=new Ms(dn,Sr,0,hi,Bt),Zu=new Ms(new Array(0),Ky,0,zs,Xy)}function tp(e){var t;for(t=0;t<un;t++)e.dyn_ltree[t*2]=0;for(t=0;t<hi;t++)e.dyn_dtree[t*2]=0;for(t=0;t<zs;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Bs*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function ip(e){e.bi_valid>8?hn(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 tv(e,t,i,n){ip(e),n&&(hn(e,i),hn(e,~i)),$y.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}function Bu(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&&Bu(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!Bu(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function Fu(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?Oe(e,r,t):(s=fn[r],Oe(e,s+gn+1,t),o=Ps[s],o!==0&&(r-=Fs[s],ie(e,r,o)),n--,s=Ju(n),Oe(e,s,i),o=Sr[s],o!==0&&(n-=Ar[s],ie(e,n,o)));while(a<e.last_lit);Oe(e,Bs,t)}function js(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=qu,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],Qy(e,t),ep(i,d,e.bl_count)}function Hu(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[Gu*2]++):o<=10?e.bl_tree[Wu*2]++:e.bl_tree[Yu*2]++,o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4))}function Nu(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 Oe(e,a,e.bl_tree);while(--o!==0);else a!==0?(a!==r&&(Oe(e,a,e.bl_tree),o--),Oe(e,Gu,e.bl_tree),ie(e,o-3,2)):o<=10?(Oe(e,Wu,e.bl_tree),ie(e,o-3,3)):(Oe(e,Yu,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 iv(e){var t;for(Hu(e,e.dyn_ltree,e.l_desc.max_code),Hu(e,e.dyn_dtree,e.d_desc.max_code),js(e,e.bl_desc),t=zs-1;t>=3&&e.bl_tree[Vu[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function nv(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[Vu[r]*2+1],3);Nu(e,e.dyn_ltree,t-1),Nu(e,e.dyn_dtree,i-1)}function rv(e){var t=4093624447,i;for(i=0;i<=31;i++,t>>>=1)if(t&1&&e.dyn_ltree[i*2]!==0)return Du;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return zu;for(i=32;i<gn;i++)if(e.dyn_ltree[i*2]!==0)return zu;return Du}var $u=!1;function av(e){$u||(ev(),$u=!0),e.l_desc=new Os(e.dyn_ltree,Xu),e.d_desc=new Os(e.dyn_dtree,Ku),e.bl_desc=new Os(e.bl_tree,Zu),e.bi_buf=0,e.bi_valid=0,tp(e)}function np(e,t,i,n){ie(e,(Gy<<1)+(n?1:0),3),tv(e,t,i,!0)}function sv(e){ie(e,Uu<<1,3),Oe(e,Bs,rt),Jy(e)}function ov(e,t,i,n){var r,a,s=0;e.level>0?(e.strm.data_type===qy&&(e.strm.data_type=rv(e)),js(e,e.l_desc),js(e,e.d_desc),s=iv(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?np(e,t,i,n):e.strategy===Uy||a===r?(ie(e,(Uu<<1)+(n?1:0),3),Fu(e,rt,dn)):(ie(e,(Wy<<1)+(n?1:0),3),nv(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Fu(e,e.dyn_ltree,e.dyn_dtree)),tp(e),n&&ip(e)}function lv(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[(fn[i]+gn+1)*2]++,e.dyn_dtree[Ju(t)*2]++),e.last_lit===e.lit_bufsize-1}mi._tr_init=av;mi._tr_stored_block=np;mi._tr_flush_block=ov;mi._tr_tally=lv;mi._tr_align=sv});var Hs=S((bE,ap)=>{"use strict";function cv(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}ap.exports=cv});var Ns=S((yE,sp)=>{"use strict";function dv(){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 uv=dv();function pv(e,t,i,n){var r=uv,a=n+i;e^=-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}sp.exports=pv});var Cr=S((vE,op)=>{"use strict";op.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 mp=S(je=>{"use strict";var Q=nt(),me=rp(),up=Hs(),bt=Ns(),fv=Cr(),$t=0,hv=1,gv=3,_t=4,lp=5,Pe=0,cp=1,be=-2,mv=-3,$s=-5,bv=-1,yv=1,Tr=2,vv=3,xv=4,wv=0,_v=2,Mr=8,Ev=9,Sv=15,Av=8,Cv=29,Tv=256,qs=Tv+1+Cv,kv=30,Lv=19,Rv=2*qs+1,Mv=15,R=3,xt=258,Ee=xt+R+1,Ov=32,Or=42,Gs=69,kr=73,Lr=91,Rr=103,Ft=113,bn=666,W=1,yn=2,Ht=3,vi=4,Iv=3;function wt(e,t){return e.msg=fv[t],t}function dp(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 mn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Pv(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=up(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 pp(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 Nt(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=Pv(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 jv(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Nt(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?Ht:vi):(e.strstart>e.block_start&&(V(e,!1),e.strm.avail_out===0),W)}function Us(e,t){for(var i,n;;){if(e.lookahead<Ee){if(Nt(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=pp(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?Ht:vi):e.last_lit&&(V(e,!1),e.strm.avail_out===0)?W:yn}function bi(e,t){for(var i,n,r;;){if(e.lookahead<Ee){if(Nt(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=pp(e,i),e.match_length<=5&&(e.strategy===yv||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?Ht:vi):e.last_lit&&(V(e,!1),e.strm.avail_out===0)?W:yn}function Dv(e,t){for(var i,n,r,a,s=e.window;;){if(e.lookahead<=xt){if(Nt(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?Ht:vi):e.last_lit&&(V(e,!1),e.strm.avail_out===0)?W:yn}function zv(e,t){for(var i;;){if(e.lookahead===0&&(Nt(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?Ht:vi):e.last_lit&&(V(e,!1),e.strm.avail_out===0)?W:yn}function Ie(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 Ie(0,0,0,0,jv),new Ie(4,4,8,4,Us),new Ie(4,5,16,8,Us),new Ie(4,6,32,32,Us),new Ie(4,4,16,16,bi),new Ie(8,16,32,32,bi),new Ie(8,16,128,128,bi),new Ie(8,32,128,256,bi),new Ie(32,128,258,1024,bi),new Ie(32,258,258,4096,bi)];function Bv(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 Fv(){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=Mr,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(Rv*2),this.dyn_dtree=new Q.Buf16((2*kv+1)*2),this.bl_tree=new Q.Buf16((2*Lv+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(Mv+1),this.heap=new Q.Buf16(2*qs+1),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Q.Buf16(2*qs+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 fp(e){var t;return!e||!e.state?wt(e,be):(e.total_in=e.total_out=0,e.data_type=_v,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Or:Ft,e.adler=t.wrap===2?0:1,t.last_flush=$t,me._tr_init(t),Pe)}function hp(e){var t=fp(e);return t===Pe&&Bv(e.state),t}function Hv(e,t){return!e||!e.state||e.state.wrap!==2?be:(e.state.gzhead=t,Pe)}function gp(e,t,i,n,r,a){if(!e)return be;var s=1;if(t===bv&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>Ev||i!==Mr||n<8||n>15||t<0||t>9||a<0||a>xv)return wt(e,be);n===8&&(n=9);var o=new Fv;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,hp(e)}function Nv(e,t){return gp(e,t,Mr,Sv,Av,wv)}function $v(e,t){var i,n,r,a;if(!e||!e.state||t>lp||t<0)return e?wt(e,be):be;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===bn&&t!==_t)return wt(e,e.avail_out===0?$s:be);if(n.strm=e,i=n.last_flush,n.last_flush=t,n.status===Or)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>=Tr||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>=Tr||n.level<2?4:0),M(n,Iv),n.status=Ft);else{var s=Mr+(n.w_bits-8<<4)<<8,o=-1;n.strategy>=Tr||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,s|=o<<6,n.strstart!==0&&(s|=Ov),s+=31-s%31,n.status=Ft,mn(n,s),n.strstart!==0&&(mn(n,e.adler>>>16),mn(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=kr)}else n.status=kr;if(n.status===kr)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=Lr)}else n.status=Lr;if(n.status===Lr)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=Rr)}else n.status=Rr;if(n.status===Rr&&(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&&dp(t)<=dp(i)&&t!==_t)return wt(e,$s);if(n.status===bn&&e.avail_in!==0)return wt(e,$s);if(e.avail_in!==0||n.lookahead!==0||t!==$t&&n.status!==bn){var d=n.strategy===Tr?zv(n,t):n.strategy===vv?Dv(n,t):yi[n.level].func(n,t);if((d===Ht||d===vi)&&(n.status=bn),d===W||d===Ht)return e.avail_out===0&&(n.last_flush=-1),Pe;if(d===yn&&(t===hv?me._tr_align(n):t!==lp&&(me._tr_stored_block(n,0,0,!1),t===gv&&(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?cp:(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)):(mn(n,e.adler>>>16),mn(n,e.adler&65535)),yt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Pe:cp)}function Uv(e){var t;return!e||!e.state?be:(t=e.state.status,t!==Or&&t!==Gs&&t!==kr&&t!==Lr&&t!==Rr&&t!==Ft&&t!==bn?wt(e,be):(e.state=null,t===Ft?wt(e,mv):Pe))}function qv(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!==Or||n.lookahead))return be;for(s===1&&(e.adler=up(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,Nt(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,Nt(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}je.deflateInit=Nv;je.deflateInit2=gp;je.deflateReset=hp;je.deflateResetKeep=fp;je.deflateSetHeader=Hv;je.deflate=$v;je.deflateEnd=Uv;je.deflateSetDictionary=qv;je.deflateInfo="pako deflate (from Nodeca project)"});var Ws=S(xi=>{"use strict";var Ir=nt(),bp=!0,yp=!0;try{String.fromCharCode.apply(null,[0])}catch{bp=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{yp=!1}var vn=new Ir.Buf8(256);for(at=0;at<256;at++)vn[at]=at>=252?6:at>=248?5:at>=240?4:at>=224?3:at>=192?2:1;var at;vn[254]=vn[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 vp(e,t){if(t<65534&&(e.subarray&&yp||!e.subarray&&bp))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 vp(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=vn[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 vp(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+vn[e[i]]>t?i:t}});var Ys=S((_E,xp)=>{"use strict";function Gv(){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}xp.exports=Gv});var Sp=S(_n=>{"use strict";var xn=mp(),wn=nt(),Xs=Ws(),Ks=Cr(),Wv=Ys(),Ep=Object.prototype.toString,Yv=0,Vs=4,wi=0,wp=1,_p=2,Vv=-1,Xv=0,Kv=8;function Ut(e){if(!(this instanceof Ut))return new Ut(e);this.options=wn.assign({level:Vv,method:Kv,chunkSize:16384,windowBits:15,memLevel:8,strategy:Xv,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 Wv,this.strm.avail_out=0;var i=xn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==wi)throw new Error(Ks[i]);if(t.header&&xn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Xs.string2buf(t.dictionary):Ep.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,i=xn.deflateSetDictionary(this.strm,n),i!==wi)throw new Error(Ks[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?Vs:Yv,typeof e=="string"?i.input=Xs.string2buf(e):Ep.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(i.avail_out===0&&(i.output=new wn.Buf8(n),i.next_out=0,i.avail_out=n),r=xn.deflate(i,a),r!==wp&&r!==wi)return this.onEnd(r),this.ended=!0,!1;(i.avail_out===0||i.avail_in===0&&(a===Vs||a===_p))&&(this.options.to==="string"?this.onData(Xs.buf2binstring(wn.shrinkBuf(i.output,i.next_out))):this.onData(wn.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||i.avail_out===0)&&r!==wp);return a===Vs?(r=xn.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===wi):(a===_p&&(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=wn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Zs(e,t){var i=new Ut(t);if(i.push(e,!0),i.err)throw i.msg||Ks[i.err];return i.result}function Zv(e,t){return t=t||{},t.raw=!0,Zs(e,t)}function Jv(e,t){return t=t||{},t.gzip=!0,Zs(e,t)}_n.Deflate=Ut;_n.deflate=Zs;_n.deflateRaw=Zv;_n.gzip=Jv});var Cp=S((SE,Ap)=>{"use strict";var Pr=30,Qv=12;Ap.exports=function(t,i){var n,r,a,s,o,d,l,c,f,p,u,v,h,w,y,m,b,g,x,E,A,C,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,w=n.lencode,y=n.distcode,m=(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=w[v&m];t:for(;;){if(x=g>>>24,v>>>=x,h-=x,x=g>>>16&255,x===0)_[s++]=g&65535;else if(x&16){E=g&65535,x&=15,x&&(h<x&&(v+=L[r++]<<h,h+=8),E+=v&(1<<x)-1,v>>>=x,h-=x),h<15&&(v+=L[r++]<<h,h+=8,v+=L[r++]<<h,h+=8),g=y[v&b];i:for(;;){if(x=g>>>24,v>>>=x,h-=x,x=g>>>16&255,x&16){if(A=g&65535,x&=15,h<x&&(v+=L[r++]<<h,h+=8,h<x&&(v+=L[r++]<<h,h+=8)),A+=v&(1<<x)-1,A>l){t.msg="invalid distance too far back",n.mode=Pr;break e}if(v>>>=x,h-=x,x=s-o,A>x){if(x=A-x,x>f&&n.sane){t.msg="invalid distance too far back",n.mode=Pr;break e}if(C=0,T=u,p===0){if(C+=c-x,x<E){E-=x;do _[s++]=u[C++];while(--x);C=s-A,T=_}}else if(p<x){if(C+=c+p-x,x-=p,x<E){E-=x;do _[s++]=u[C++];while(--x);if(C=0,p<E){x=p,E-=x;do _[s++]=u[C++];while(--x);C=s-A,T=_}}}else if(C+=p-x,x<E){E-=x;do _[s++]=u[C++];while(--x);C=s-A,T=_}for(;E>2;)_[s++]=T[C++],_[s++]=T[C++],_[s++]=T[C++],E-=3;E&&(_[s++]=T[C++],E>1&&(_[s++]=T[C++]))}else{C=s-A;do _[s++]=_[C++],_[s++]=_[C++],_[s++]=_[C++],E-=3;while(E>2);E&&(_[s++]=_[C++],E>1&&(_[s++]=_[C++]))}}else if((x&64)===0){g=y[(g&65535)+(v&(1<<x)-1)];continue i}else{t.msg="invalid distance code",n.mode=Pr;break e}break}}else if((x&64)===0){g=w[(g&65535)+(v&(1<<x)-1)];continue t}else if(x&32){n.mode=Qv;break e}else{t.msg="invalid literal/length code",n.mode=Pr;break e}break}}while(r<a&&s<d);E=h>>3,r-=E,h-=E<<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 Ip=S((AE,Op)=>{"use strict";var Tp=nt(),_i=15,kp=852,Lp=592,Rp=0,Js=1,Mp=2,ex=[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],tx=[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],ix=[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],nx=[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];Op.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,w=0,y=0,m=0,b=0,g,x,E,A,C,T=null,L=0,_,I=new Tp.Buf16(_i+1),z=new Tp.Buf16(_i+1),le=null,te=0,ne,xe,He;for(c=0;c<=_i;c++)I[c]=0;for(f=0;f<r;f++)I[i[n+f]]++;for(v=l,u=_i;u>=1&&I[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&&I[p]===0;p++);for(v<p&&(v=p),y=1,c=1;c<=_i;c++)if(y<<=1,y-=I[c],y<0)return-1;if(y>0&&(t===Rp||u!==1))return-1;for(z[1]=0,c=1;c<_i;c++)z[c+1]=z[c]+I[c];for(f=0;f<r;f++)i[n+f]!==0&&(o[z[i[n+f]]++]=f);if(t===Rp?(T=le=o,_=19):t===Js?(T=ex,L-=257,le=tx,te-=257,_=256):(T=ix,le=nx,_=-1),b=0,f=0,c=p,C=s,h=v,w=0,E=-1,m=1<<v,A=m-1,t===Js&&m>kp||t===Mp&&m>Lp)return 1;for(;;){ne=c-w,o[f]<_?(xe=0,He=o[f]):o[f]>_?(xe=le[te+o[f]],He=T[L+o[f]]):(xe=96,He=0),g=1<<c-w,x=1<<h,p=x;do x-=g,a[C+(b>>w)+x]=ne<<24|xe<<16|He|0;while(x!==0);for(g=1<<c-1;b&g;)g>>=1;if(g!==0?(b&=g-1,b+=g):b=0,f++,--I[c]===0){if(c===u)break;c=i[n+o[f]]}if(c>v&&(b&A)!==E){for(w===0&&(w=v),C+=p,h=c-w,y=1<<h;h+w<u&&(y-=I[h+w],!(y<=0));)h++,y<<=1;if(m+=1<<h,t===Js&&m>kp||t===Mp&&m>Lp)return 1;E=b&A,a[E]=v<<24|h<<16|C-s|0}}return b!==0&&(a[C+b]=c-w<<24|64<<16|0),d.bits=v,0}});var gf=S(Se=>{"use strict";var oe=nt(),ro=Hs(),De=Ns(),rx=Cp(),En=Ip(),ax=0,sf=1,of=2,Pp=4,sx=5,jr=6,qt=0,ox=1,lx=2,ye=-2,lf=-3,ao=-4,cx=-5,jp=8,cf=1,Dp=2,zp=3,Bp=4,Fp=5,Hp=6,Np=7,$p=8,Up=9,qp=10,Br=11,st=12,Qs=13,Gp=14,eo=15,Wp=16,Yp=17,Vp=18,Xp=19,Dr=20,zr=21,Kp=22,Zp=23,Jp=24,Qp=25,ef=26,to=27,tf=28,nf=29,D=30,so=31,dx=32,ux=852,px=592,fx=15,hx=fx;function rf(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function gx(){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 df(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=cf,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(ux),t.distcode=t.distdyn=new oe.Buf32(px),t.sane=1,t.back=-1,qt)}function uf(e){var t;return!e||!e.state?ye:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,df(e))}function pf(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,uf(e))}function ff(e,t){var i,n;return e?(n=new gx,e.state=n,n.window=null,i=pf(e,t),i!==qt&&(e.state=null),i):ye}function mx(e){return ff(e,hx)}var af=!0,io,no;function bx(e){if(af){var t;for(io=new oe.Buf32(512),no=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(En(sf,e.lens,0,288,io,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;En(of,e.lens,0,32,no,0,e.work,{bits:5}),af=!1}e.lencode=io,e.lenbits=9,e.distcode=no,e.distbits=5}function hf(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 yx(e,t){var i,n,r,a,s,o,d,l,c,f,p,u,v,h,w=0,y,m,b,g,x,E,A,C,T=new oe.Buf8(4),L,_,I=[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=Qs),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,C=qt;e:for(;;)switch(i.mode){case cf:if(i.wrap===0){i.mode=Qs;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=De(i.check,T,2,0),l=0,c=0,i.mode=Dp;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=D;break}if((l&15)!==jp){e.msg="unknown compression method",i.mode=D;break}if(l>>>=4,c-=4,A=(l&15)+8,i.wbits===0)i.wbits=A;else if(A>i.wbits){e.msg="invalid window size",i.mode=D;break}i.dmax=1<<A,e.adler=i.check=1,i.mode=l&512?qp:st,l=0,c=0;break;case Dp:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.flags=l,(i.flags&255)!==jp){e.msg="unknown compression method",i.mode=D;break}if(i.flags&57344){e.msg="unknown header flags set",i.mode=D;break}i.head&&(i.head.text=l>>8&1),i.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,i.check=De(i.check,T,2,0)),l=0,c=0,i.mode=zp;case zp: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=De(i.check,T,4,0)),l=0,c=0,i.mode=Bp;case Bp: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=De(i.check,T,2,0)),l=0,c=0,i.mode=Fp;case Fp: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=De(i.check,T,2,0)),l=0,c=0}else i.head&&(i.head.extra=null);i.mode=Hp;case Hp:if(i.flags&1024&&(u=i.length,u>o&&(u=o),u&&(i.head&&(A=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,A)),i.flags&512&&(i.check=De(i.check,n,u,a)),o-=u,a+=u,i.length-=u),i.length))break e;i.length=0,i.mode=Np;case Np:if(i.flags&2048){if(o===0)break e;u=0;do A=n[a+u++],i.head&&A&&i.length<65536&&(i.head.name+=String.fromCharCode(A));while(A&&u<o);if(i.flags&512&&(i.check=De(i.check,n,u,a)),o-=u,a+=u,A)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=$p;case $p:if(i.flags&4096){if(o===0)break e;u=0;do A=n[a+u++],i.head&&A&&i.length<65536&&(i.head.comment+=String.fromCharCode(A));while(A&&u<o);if(i.flags&512&&(i.check=De(i.check,n,u,a)),o-=u,a+=u,A)break e}else i.head&&(i.head.comment=null);i.mode=Up;case Up: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=D;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 qp:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}e.adler=i.check=rf(l),l=0,c=0,i.mode=Br;case Br: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,lx;e.adler=i.check=1,i.mode=st;case st:if(t===sx||t===jr)break e;case Qs:if(i.last){l>>>=c&7,c-=c&7,i.mode=to;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=Gp;break;case 1:if(bx(i),i.mode=Dr,t===jr){l>>>=2,c-=2;break e}break;case 2:i.mode=Yp;break;case 3:e.msg="invalid block type",i.mode=D}l>>>=2,c-=2;break;case Gp: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=D;break}if(i.length=l&65535,l=0,c=0,i.mode=eo,t===jr)break e;case eo:i.mode=Wp;case Wp: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 Yp: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=D;break}i.have=0,i.mode=Vp;case Vp:for(;i.have<i.ncode;){for(;c<3;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.lens[I[i.have++]]=l&7,l>>>=3,c-=3}for(;i.have<19;)i.lens[I[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,L={bits:i.lenbits},C=En(ax,i.lens,0,19,i.lencode,0,i.work,L),i.lenbits=L.bits,C){e.msg="invalid code lengths set",i.mode=D;break}i.have=0,i.mode=Xp;case Xp:for(;i.have<i.nlen+i.ndist;){for(;w=i.lencode[l&(1<<i.lenbits)-1],y=w>>>24,m=w>>>16&255,b=w&65535,!(y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(b<16)l>>>=y,c-=y,i.lens[i.have++]=b;else{if(b===16){for(_=y+2;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l>>>=y,c-=y,i.have===0){e.msg="invalid bit length repeat",i.mode=D;break}A=i.lens[i.have-1],u=3+(l&3),l>>>=2,c-=2}else if(b===17){for(_=y+3;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,A=0,u=3+(l&7),l>>>=3,c-=3}else{for(_=y+7;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,A=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=D;break}for(;u--;)i.lens[i.have++]=A}}if(i.mode===D)break;if(i.lens[256]===0){e.msg="invalid code -- missing end-of-block",i.mode=D;break}if(i.lenbits=9,L={bits:i.lenbits},C=En(sf,i.lens,0,i.nlen,i.lencode,0,i.work,L),i.lenbits=L.bits,C){e.msg="invalid literal/lengths set",i.mode=D;break}if(i.distbits=6,i.distcode=i.distdyn,L={bits:i.distbits},C=En(of,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,L),i.distbits=L.bits,C){e.msg="invalid distances set",i.mode=D;break}if(i.mode=Dr,t===jr)break e;case Dr:i.mode=zr;case zr: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,rx(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;w=i.lencode[l&(1<<i.lenbits)-1],y=w>>>24,m=w>>>16&255,b=w&65535,!(y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(m&&(m&240)===0){for(g=y,x=m,E=b;w=i.lencode[E+((l&(1<<g+x)-1)>>g)],y=w>>>24,m=w>>>16&255,b=w&65535,!(g+y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,i.back+=g}if(l>>>=y,c-=y,i.back+=y,i.length=b,m===0){i.mode=ef;break}if(m&32){i.back=-1,i.mode=st;break}if(m&64){e.msg="invalid literal/length code",i.mode=D;break}i.extra=m&15,i.mode=Kp;case Kp: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=Zp;case Zp:for(;w=i.distcode[l&(1<<i.distbits)-1],y=w>>>24,m=w>>>16&255,b=w&65535,!(y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((m&240)===0){for(g=y,x=m,E=b;w=i.distcode[E+((l&(1<<g+x)-1)>>g)],y=w>>>24,m=w>>>16&255,b=w&65535,!(g+y<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,i.back+=g}if(l>>>=y,c-=y,i.back+=y,m&64){e.msg="invalid distance code",i.mode=D;break}i.offset=b,i.extra=m&15,i.mode=Jp;case Jp: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=D;break}i.mode=Qp;case Qp: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=D;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=zr);break;case ef:if(d===0)break e;r[s++]=i.length,d--,i.mode=zr;break;case to: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?De(i.check,r,p,s-p):ro(i.check,r,p,s-p)),p=d,(i.flags?l:rf(l))!==i.check){e.msg="incorrect data check",i.mode=D;break}l=0,c=0}i.mode=tf;case tf: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=D;break}l=0,c=0}i.mode=nf;case nf:C=ox;break e;case D:C=lf;break e;case so:return ao;case dx: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<D&&(i.mode<to||t!==Pp))&&hf(e,e.output,e.next_out,p-e.avail_out)?(i.mode=so,ao):(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?De(i.check,r,p,e.next_out-p):ro(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===eo?256:0),(f===0&&p===0||t===Pp)&&C===qt&&(C=cx),C)}function vx(e){if(!e||!e.state)return ye;var t=e.state;return t.window&&(t.window=null),e.state=null,qt}function xx(e,t){var i;return!e||!e.state||(i=e.state,(i.wrap&2)===0)?ye:(i.head=t,t.done=!1,qt)}function wx(e,t){var i=t.length,n,r,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Br)?ye:n.mode===Br&&(r=1,r=ro(r,t,i,0),r!==n.check)?lf:(a=hf(e,t,i,i),a?(n.mode=so,ao):(n.havedict=1,qt))}Se.inflateReset=uf;Se.inflateReset2=pf;Se.inflateResetKeep=df;Se.inflateInit=mx;Se.inflateInit2=ff;Se.inflate=yx;Se.inflateEnd=vx;Se.inflateGetHeader=xx;Se.inflateSetDictionary=wx;Se.inflateInfo="pako inflate (from Nodeca project)"});var oo=S((TE,mf)=>{"use strict";mf.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 yf=S((kE,bf)=>{"use strict";function _x(){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}bf.exports=_x});var xf=S(An=>{"use strict";var Ei=gf(),Sn=nt(),Fr=Ws(),N=oo(),lo=Cr(),Ex=Ys(),Sx=yf(),vf=Object.prototype.toString;function Gt(e){if(!(this instanceof Gt))return new Gt(e);this.options=Sn.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 Ex,this.strm.avail_out=0;var i=Ei.inflateInit2(this.strm,t.windowBits);if(i!==N.Z_OK)throw new Error(lo[i]);if(this.header=new Sx,Ei.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Fr.string2buf(t.dictionary):vf.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=Ei.inflateSetDictionary(this.strm,t.dictionary),i!==N.Z_OK)))throw new Error(lo[i])}Gt.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?N.Z_FINISH:N.Z_NO_FLUSH,typeof e=="string"?i.input=Fr.binstring2buf(e):vf.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 Sn.Buf8(n),i.next_out=0,i.avail_out=n),a=Ei.inflate(i,N.Z_NO_FLUSH),a===N.Z_NEED_DICT&&r&&(a=Ei.inflateSetDictionary(this.strm,r)),a===N.Z_BUF_ERROR&&c===!0&&(a=N.Z_OK,c=!1),a!==N.Z_STREAM_END&&a!==N.Z_OK)return this.onEnd(a),this.ended=!0,!1;i.next_out&&(i.avail_out===0||a===N.Z_STREAM_END||i.avail_in===0&&(s===N.Z_FINISH||s===N.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=Fr.utf8border(i.output,i.next_out),d=i.next_out-o,l=Fr.buf2string(i.output,o),i.next_out=d,i.avail_out=n-d,d&&Sn.arraySet(i.output,i.output,o,d,0),this.onData(l)):this.onData(Sn.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!==N.Z_STREAM_END);return a===N.Z_STREAM_END&&(s=N.Z_FINISH),s===N.Z_FINISH?(a=Ei.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===N.Z_OK):(s===N.Z_SYNC_FLUSH&&(this.onEnd(N.Z_OK),i.avail_out=0),!0)};Gt.prototype.onData=function(e){this.chunks.push(e)};Gt.prototype.onEnd=function(e){e===N.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Sn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function co(e,t){var i=new Gt(t);if(i.push(e,!0),i.err)throw i.msg||lo[i.err];return i.result}function Ax(e,t){return t=t||{},t.raw=!0,co(e,t)}An.Inflate=Gt;An.inflate=co;An.inflateRaw=Ax;An.ungzip=co});var Ef=S((RE,_f)=>{"use strict";var Cx=nt().assign,Tx=Sp(),kx=xf(),Lx=oo(),wf={};Cx(wf,Tx,kx,Lx);_f.exports=wf});var Af=S(Nr=>{"use strict";var Rx=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",Mx=Ef(),Sf=F(),Hr=se(),Ox=Rx?"uint8array":"array";Nr.magic="\b\0";function Wt(e,t){Hr.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}Sf.inherits(Wt,Hr);Wt.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(Sf.transformTo(Ox,e.data),!1)};Wt.prototype.flush=function(){Hr.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};Wt.prototype.cleanUp=function(){Hr.prototype.cleanUp.call(this),this._pako=null};Wt.prototype._createPako=function(){this._pako=new Mx[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 po=S(uo=>{"use strict";var Cf=se();uo.STORE={magic:"\0\0",compressWorker:function(){return new Cf("STORE compression")},uncompressWorker:function(){return new Cf("STORE decompression")}};uo.DEFLATE=Af()});var fo=S(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 Rf=S((PE,Lf)=>{"use strict";var Si=F(),Ai=se(),ho=pi(),Tf=wr(),$r=fo(),P=function(e,t){var i="",n;for(n=0;n<t;n++)i+=String.fromCharCode(e&255),e=e>>>8;return i},Ix=function(e,t){var i=e;return e||(i=t?16893:33204),(i&65535)<<16},Px=function(e){return(e||0)&63},kf=function(e,t,i,n,r,a){var s=e.file,o=e.compression,d=a!==ho.utf8encode,l=Si.transformTo("string",a(s.name)),c=Si.transformTo("string",ho.utf8encode(s.name)),f=s.comment,p=Si.transformTo("string",a(f)),u=Si.transformTo("string",ho.utf8encode(f)),v=c.length!==s.name.length,h=u.length!==f.length,w,y,m="",b="",g="",x=s.dir,E=s.date,A={crc32:0,compressedSize:0,uncompressedSize:0};(!t||i)&&(A.crc32=e.crc32,A.compressedSize=e.compressedSize,A.uncompressedSize=e.uncompressedSize);var C=0;t&&(C|=8),!d&&(v||h)&&(C|=2048);var T=0,L=0;x&&(T|=16),r==="UNIX"?(L=798,T|=Ix(s.unixPermissions,x)):(L=20,T|=Px(s.dosPermissions,x)),w=E.getUTCHours(),w=w<<6,w=w|E.getUTCMinutes(),w=w<<5,w=w|E.getUTCSeconds()/2,y=E.getUTCFullYear()-1980,y=y<<4,y=y|E.getUTCMonth()+1,y=y<<5,y=y|E.getUTCDate(),v&&(b=P(1,1)+P(Tf(l),4)+c,m+="up"+P(b.length,2)+b),h&&(g=P(1,1)+P(Tf(p),4)+u,m+="uc"+P(g.length,2)+g);var _="";_+=`
|
|
2
|
+
\0`,_+=P(C,2),_+=o.magic,_+=P(w,2),_+=P(y,2),_+=P(A.crc32,4),_+=P(A.compressedSize,4),_+=P(A.uncompressedSize,4),_+=P(l.length,2),_+=P(m.length,2);var I=$r.LOCAL_FILE_HEADER+_+l+m,z=$r.CENTRAL_FILE_HEADER+P(L,2)+_+P(p.length,2)+"\0\0\0\0"+P(T,4)+P(n,4)+l+m+p;return{fileRecord:I,dirRecord:z}},jx=function(e,t,i,n,r){var a="",s=Si.transformTo("string",r(n));return a=$r.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},Dx=function(e){var t="";return t=$r.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=kf(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=kf(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:Dx(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=jx(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()};Lf.exports=Ae});var Of=S(Mf=>{"use strict";var zx=po(),Bx=Rf(),Fx=function(e,t){var i=e||t,n=zx[i];if(!n)throw new Error(i+" is not a valid compression method !");return n};Mf.generateWorker=function(e,t,i){var n=new Bx(t.streamFiles,i,t.platform,t.encodeFileName),r=0;try{e.forEach(function(a,s){r++;var o=Fx(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 Pf=S((DE,If)=>{"use strict";var Hx=F(),Ur=se();function Cn(e,t){Ur.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}Hx.inherits(Cn,Ur);Cn.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()})};Cn.prototype.pause=function(){return Ur.prototype.pause.call(this)?(this._stream.pause(),!0):!1};Cn.prototype.resume=function(){return Ur.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};If.exports=Cn});var qf=S((zE,Uf)=>{"use strict";var Nx=pi(),Tn=F(),Bf=se(),$x=ys(),Ff=vs(),jf=_r(),Ux=ju(),qx=Of(),Df=tn(),Gx=Pf(),Hf=function(e,t,i){var n=Tn.getTypeOf(t),r,a=Tn.extend(i||{},Ff);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=Nf(e)),a.createFolders&&(r=Wx(e))&&$f.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 jf&&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 jf||t instanceof Bf?d=t:Df.isNode&&Df.isStream(t)?d=new Gx(e,t):d=Tn.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new Ux(e,d,a);this.files[e]=l},Wx=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},Nf=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},$f=function(e,t){return t=typeof t!="undefined"?t:Ff.createFolders,e=Nf(e),this.files[e]||Hf.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function zf(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var Yx={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(zf(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,Hf.call(this,e,t,i);return this},folder:function(e){if(!e)return this;if(zf(e))return this.filter(function(r,a){return a.dir&&e.test(r)});var t=this.root+e,i=$f.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=Tn.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:Nx.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.");Tn.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=qx.generateWorker(this,i,n)}catch(r){t=new Bf("error"),t.error(r)}return new $x(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)}};Uf.exports=Yx});var go=S((BE,Wf)=>{"use strict";var Vx=F();function Gf(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}Gf.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 Vx.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))}};Wf.exports=Gf});var mo=S((FE,Vf)=>{"use strict";var Yf=go(),Xx=F();function Ci(e){Yf.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}Xx.inherits(Ci,Yf);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};Vf.exports=Ci});var Zf=S((HE,Kf)=>{"use strict";var Xf=go(),Kx=F();function Ti(e){Xf.call(this,e)}Kx.inherits(Ti,Xf);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};Kf.exports=Ti});var yo=S((NE,Qf)=>{"use strict";var Jf=mo(),Zx=F();function bo(e){Jf.call(this,e)}Zx.inherits(bo,Jf);bo.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};Qf.exports=bo});var ih=S(($E,th)=>{"use strict";var eh=yo(),Jx=F();function vo(e){eh.call(this,e)}Jx.inherits(vo,eh);vo.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};th.exports=vo});var xo=S((UE,rh)=>{"use strict";var qr=F(),nh=tt(),Qx=mo(),ew=Zf(),tw=ih(),iw=yo();rh.exports=function(e){var t=qr.getTypeOf(e);return qr.checkSupport(t),t==="string"&&!nh.uint8array?new ew(e):t==="nodebuffer"?new tw(e):nh.uint8array?new iw(qr.transformTo("uint8array",e)):new Qx(qr.transformTo("array",e))}});var lh=S((qE,oh)=>{"use strict";var wo=xo(),Et=F(),nw=_r(),ah=wr(),Gr=pi(),Wr=po(),rw=tt(),aw=0,sw=3,ow=function(e){for(var t in Wr)if(Object.prototype.hasOwnProperty.call(Wr,t)&&Wr[t].magic===e)return Wr[t];return null};function sh(e,t){this.options=e,this.loadOptions=t}sh.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=ow(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 nw(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===aw&&(this.dosPermissions=this.externalFileAttributes&63),e===sw&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=wo(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=rw.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=wo(e.value);return t.readInt(1)!==1||ah(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=wo(e.value);return t.readInt(1)!==1||ah(this.fileComment)!==t.readInt(4)?null:Gr.utf8decode(t.readData(e.length-5))}return null}};oh.exports=sh});var uh=S((GE,dh)=>{"use strict";var lw=xo(),ot=F(),Ce=fo(),cw=lh(),dw=tt();function ch(e){this.files=[],this.loadOptions=e}ch.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=dw.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 cw({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=lw(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};dh.exports=ch});var hh=S((WE,fh)=>{"use strict";var _o=F(),Yr=ci(),uw=pi(),pw=uh(),fw=_s(),ph=tn();function hw(e){return new Yr.Promise(function(t,i){var n=e.decompressed.getContentWorker().pipe(new fw);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()})}fh.exports=function(e,t){var i=this;return t=_o.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:uw.utf8decode}),ph.isNode&&ph.isStream(e)?Yr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):_o.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(n){var r=new pw(t);return r.load(n),r}).then(function(r){var a=[Yr.Promise.resolve(r)],s=r.files;if(t.checkCRC32)for(var o=0;o<s.length;o++)a.push(hw(s[o]));return Yr.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=_o.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 mh=S((YE,gh)=>{"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=qf();ve.prototype.loadAsync=hh();ve.support=tt();ve.defaults=vs();ve.version="3.10.1";ve.loadAsync=function(e,t){return new ve().loadAsync(e,t)};ve.external=ci();gh.exports=ve});var _h={};hc(_h,{AssetEditorModal:()=>Lo});var Lo,Ro=qe(()=>{"use strict";Lo=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(t,i,n,r){this.currentObjectId=t,this.currentPath=i,this.currentAsset=n,this.onApplyCallback=r,this.createModal(t,n),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(t,i){let n=document.createElement("div");n.className="asset-editor-modal",n.innerHTML=`
|
|
3
3
|
<div class="asset-editor-card">
|
|
4
4
|
<div class="asset-editor-header">
|
|
5
5
|
<div>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
|
-
`,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Gw={};hc(Gw,{AspectClass:()=>$o,GameObject:()=>jn,GameObjectManager:()=>ia,Renderer:()=>Dn,ResponsiveUISystem:()=>ji,Transform:()=>Pn,animateHandClick:()=>Nh,animatePanelEntrance:()=>Fh,createBrushTexture:()=>Yh,createEndGamePanel:()=>Bh,createHandTutorial:()=>Hh,createThreeBase:()=>Dh,createTutorialLabel:()=>$h,getAspectClass:()=>ta,getRegisteredFontIds:()=>zh,loadAsset:()=>Go,loadCharacterFrames:()=>Wh,registerFont:()=>jh,resolveFont:()=>Be,resolveFontWeight:()=>Fe,updateHandAnimation:()=>Uh});module.exports=Ng(Gw);var Te=Ge(require("three"),1);var dt={};function qn(e,t,i=!1){dt[e]||(dt[e]=[]),dt[e].push({fn:t,once:i})}function ga(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&&ga(e,n.fn)}function fe(e,t){qn(e,t,!0)}var q=null,we=[],Zt=null;function yc(e){q=e,we=[],Zt!==null&&(clearTimeout(Zt),Zt=null)}function vc(){var e,t,i;return{endpoint:(q==null?void 0:q.endpoint)||"",transport:(q==null?void 0:q.transport)||"beacon",batchSize:(e=q==null?void 0:q.batchSize)!=null?e:10,flushIntervalMs:(t=q==null?void 0:q.flushIntervalMs)!=null?t:300,maxQueue:(i=q==null?void 0:q.maxQueue)!=null?i:200,debug:!!(q!=null&&q.debug)}}async function mc(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 ma(e,t){let i=vc();if(t&&i.endpoint){if(we.push(e),we.length>i.maxQueue&&(we=we.slice(we.length-i.maxQueue)),we.length>=i.batchSize){bc();return}Zt===null&&(Zt=window.setTimeout(()=>{Zt=null,bc()},i.flushIntervalMs))}}async function bc(){let e=vc();if(!e.endpoint||we.length===0)return;let t=we.splice(0,e.batchSize);await mc(e.endpoint,{events:t},e.transport,e.debug),we.length>0&&await mc(e.endpoint,{events:we.splice(0,e.batchSize)},e.transport,e.debug)}function xc(e){return Math.max(0,Math.min(1,e))}function Hg(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function Ni(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function $g(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function wc(e,t,i){try{e[t]=i}catch{}}function Ug(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function _c(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function Ec(e,t){let i=Ug(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function Sc(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=c=>{var p;e.add(c);let f=(p=t.get(c.target))!=null?p:new Set;f.add(c),t.set(c.target,f),n()},a=c=>{e.delete(c);let f=t.get(c.target);f&&(f.delete(c),f.size===0&&t.delete(c.target))},s=c=>{c.killed||(c.killed=!0,a(c))},o=()=>{var f,p;let c=Ni();for(let u of Array.from(e)){if(u.killed||u.paused)continue;let v=c-u.startMs-u.delayMs;if(v<0)continue;let h=u.durationMs>0?v/u.durationMs:1,w=xc(h),y=u.repeat>=0?u.repeat+1:1,m=u.repeat>0?Math.min(Math.floor(h),y-1):0;if(u.repeat>0&&h>=1){let x=h-m;w=xc(x)}let b=u.ease(w);u.yoyo&&m%2===1&&(b=1-b);for(let x of u.props)wc(u.target,x.key,x.from+(x.to-x.from)*b);u.scaleFrom&&u.scaleTo&&_c(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*b,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*b});try{(f=u.onUpdate)==null||f.call(u)}catch{}if(h>=y){s(u);try{(p=u.onComplete)==null||p.call(u)}catch{}}}},d=(c,f,p)=>{var x;let u=Math.max(0,(typeof f.duration=="number"?f.duration:.5)*1e3),v=Math.max(0,(typeof f.delay=="number"?f.delay:0)*1e3+((x=p==null?void 0:p.delayMsOverride)!=null?x:0)),h=Hg(f.ease),w=typeof f.repeat=="number"?Math.max(0,f.repeat|0):0,y=f.yoyo===!0,m=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),b=[];for(let E of Object.keys(f)){if(m.has(E))continue;let A=f[E];typeof A=="number"&&b.push({key:E,from:$g(c,E),to:A})}let g=Ec(c,f);return{target:c,startMs:Ni(),delayMs:v,durationMs:u,ease:h,props:b,scaleFrom:g.from,scaleTo:g.to,repeat:w,yoyo:y,onUpdate:typeof f.onUpdate=="function"?f.onUpdate:void 0,onComplete:typeof f.onComplete=="function"?f.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(c,f){let p=d(c,f);return r(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Ni())},resume:()=>{var h;if(!p.paused)return;let u=(h=p.pauseAtMs)!=null?h:Ni(),v=Ni()-u;p.startMs+=v,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(c,f,p){return l.set(c,f),l.to(c,p)},set(c,f){if(!c||!f)return;for(let u of Object.keys(f)){let v=f[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof v=="number"&&wc(c,u,v)}let p=Ec(c,f);p.to&&_c(c,p.to)},killTweensOf(c){let f=t.get(c);if(f)for(let p of Array.from(f))s(p)},timeline(c={}){let f=[],p=0,u=!1,v=[],h=m=>{if(typeof m=="number")return Math.max(0,m*1e3);let b=typeof m=="string"?m.trim():"";return b.startsWith("+=")?p+Math.max(0,Number(b.slice(2))*1e3||0):b?Math.max(0,Number(b)*1e3||0):p},w=m=>{f.push(m);let b=Math.max(0,(typeof m.vars.duration=="number"?m.vars.duration:.5)*1e3);p=Math.max(p,m.atMs+b)},y={to(m,b,g){return w({kind:"to",target:m,vars:b,atMs:h(g)}),y},fromTo(m,b,g,x){return w({kind:"fromTo",target:m,vars:g,from:b,atMs:h(x)}),y},play(){var m,b;if(u)return y;u=!0,v=[];for(let g of f)g.kind==="fromTo"&&l.set(g.target,(m=g.from)!=null?m:{}),v.push(l.to(g.target,{...g.vars,delay:g.atMs/1e3+((b=g.vars.delay)!=null?b:0)}));return y},pause(){for(let m of v)m.pause();return y},kill(){for(let m of v)m.kill();v=[],u=!1}};return c.paused||y.play(),y}};return l}function Ac(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=Sc()}catch{}}var he=0,qg=he++,Cc=he++,Tc=he++,kc=he++,Lc=he++,Rc=he++,Mc=he++,Oc=he++,Ic=he++,Pc=he++,Dc=he++,jc=he++,N=qg;function zc(){return N===Cc}function Bc(){return N===Tc}function Fc(){return N===kc}function Nc(){return N===Lc}function Jt(){return N===Rc}function Qt(){return N===Mc}function Hc(){return N===Oc}function $c(){return N===Ic}function Uc(){return N===Pc}function ba(){return N===Dc}function ya(){return N===jc}function qc(){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=Cc;return}catch{}else if(e==="dapi")try{dapi.isReady(),N=Tc;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(N=kc)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(N=Lc)}catch{}else if(t==="mintegral")window.gameReady&&(N=Rc);else if(t==="tapjoy")window.TJ_API&&(N=Mc);else if(t==="tiktok")window.openAppStore&&(N=Oc);else if(t==="smadex")try{window.smxTracking&&(N=Ic)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(N=Pc)}catch{}else t==="vungle"?N=Dc:(e==="nucleo"||t==="nucleo")&&(N=jc)}var Wn=Ge(require("lottie-web"),1),Gc=Wn.default;typeof window!="undefined"&&(window.lottie=Wn.default,window.__baseLottie=Wn.default);var Gg=require("pixi.js");var va=require("pixi.js");var Wg=null;function xa(e){Wg=e}Yn();wa();var Hi=require("pixi.js");Yn();var Jg=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Aa=Jg;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&&(Aa=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${Aa}`))}}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__: ${Aa}`);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 Hi.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 Hi.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 Hi.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}`],w=!1;for(let y of h)try{let m=await fetch(y);if(m.ok){o=await m.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",y,"type:",(v=o==null?void 0:o.constructor)==null?void 0:v.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};var $i=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 tm=Ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=tm);Ui();var Xn=require("pixi.js");Ui();var Ta=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new $i}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)}},nm=new Ta,rm=new Proxy(nm,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});Ui();var Xc=require("pixi.js"),Xe={width:400,height:600,designWidth:400,scaleFactor:1},Zn={scale:1,position:1},La=[];function om(e,t,i,n,r,a,s){La.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function lm(){La.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 ka(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),Zn.scale=Xe.scaleFactor,Zn.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Zn.scale.toFixed(3)}`),lm()}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 cm(e,t,i){let n=Gi[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function dm(){return Gi}var um={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 Kn(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function Jn(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:Kn(e[0],t.x),y:Kn(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:Kn(n.x,t.x),y:Kn(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=um[n])!=null?i:t}return t}function Kc(e,t,i,n={}){var u,v,h,w,y,m;let r=Jn(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=((w=a.right)!=null?w:0)+s.x,l=((y=a.top)!=null?y:0)+s.y,c=((m=a.bottom)!=null?m: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 Zc(e,t,i,n={}){var h,w,y,m,b,g;let r=(h=n.inset)!=null?h:{},a=(w=n.padding)!=null?w:{x:0,y:0},s=((y=r.left)!=null?y:0)+a.x,o=((m=r.right)!=null?m: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=Jn(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,ka(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),ka(window.innerWidth,window.innerHeight),window.updateDebugConfig=cm,window.getDebugConfig=dm,window.copyConfig=_m,window.applyConfig=qi,window.applyConfigForRatio=Em,window.positionAtBottom=Jc,window.positionAtTop=hm,window.positionAtCenter=gm,window.positionAtLeft=mm,window.positionAtRight=bm,window.positionAtBottomLeft=ym,window.positionAtBottomRight=vm,window.positionAtTopLeft=xm,window.positionAtTopRight=wm,window.applyPositionContract=fm,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 Qn(e,t,i=0){return e*t+i}function er(e,t,i=0){return e*(1-t)+i}function tr(e,t,i=0){return e*t+i}function ir(e,t,i=0){return e*(1-t)+i}function ge(e,t=0){return e/2+t}function pm(e,t){return e*t}function fm(e,t,i,n){var s,o,d,l,c,f,p,u,v,h,w,y,m,b,g,x,E,A,C,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=Qn(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=er(i,n.percent,(u=(p=n.offset)==null?void 0:p.y)!=null?u:0);break;case"left":r=tr(t,n.percent,(h=(v=n.offset)==null?void 0:v.x)!=null?h:0),a=ge(i,(y=(w=n.offset)==null?void 0:w.y)!=null?y:0);break;case"right":r=ir(t,n.percent,(b=(m=n.offset)==null?void 0:m.x)!=null?b:0),a=ge(i,(x=(g=n.offset)==null?void 0:g.y)!=null?x:0);break;case"center":r=ge(t,(A=(E=n.offset)==null?void 0:E.x)!=null?A:0),a=ge(i,(T=(C=n.offset)==null?void 0:C.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 Jc(e,t,i,n=.2,r=1,a=!0,s=!1){let o=pm(i,n),d=er(i,n/2);Ke(e,ge(t),d);let l=a?r*Xe.scaleFactor:r;Ze(e,l),s&&!La.find(c=>c.element===e)&&om(e,Jc,t,i,n,r,a)}function hm(e,t,i,n=.1,r=1){Ke(e,ge(t),Qn(i,n)),Ze(e,r)}function gm(e,t,i,n=0,r=0,a=1){Ke(e,ge(t,n),ge(i,r)),Ze(e,a)}function mm(e,t,i,n=.1,r=1){Ke(e,tr(t,n),ge(i)),Ze(e,r)}function bm(e,t,i,n=.1,r=1){Ke(e,ir(t,n),ge(i)),Ze(e,r)}function ym(e,t,i,n=.05,r=.05,a=1){Ke(e,tr(t,r),er(i,n)),Ze(e,a)}function vm(e,t,i,n=.05,r=.05,a=1){Ke(e,ir(t,r),er(i,n)),Ze(e,a)}function xm(e,t,i,n=.05,r=.05,a=1){Ke(e,tr(t,r),Qn(i,n)),Ze(e,a)}function wm(e,t,i,n=.05,r=.05,a=1){Ke(e,ir(t,r),Qn(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 Ot={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 _m(e){return e&&Ot[e]?JSON.parse(JSON.stringify(Ot[e])):JSON.parse(JSON.stringify(Gi))}function qi(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 Em(e,t){let i=e/t;i>1.6?(qi(Ot.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(qi(Ot.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(qi(Ot.square),console.log("Applied SQUARE config for ratio:",i)):(qi(Ot.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ot,e.resolveAnchorVec2=e.resolveAnchorVec2||Jn,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||Kc,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||Zc}Oa();function G(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var j_=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:G(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:G(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:G(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:G(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:G(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:G(360,780)}],z_=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:G(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:G(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:G(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:G(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:G(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:G(412,915)}],B_=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:G(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:G(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:G(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:G(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:G(800,1280)}],id=[{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:G(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:G(768,1024),mraidScale:.7}];var F_=[...id];var Mm=id[0];pt();var mw=Ge(gh(),1);function fw(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 hw(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 gw(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 Eo(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 fw(r),s=await gw(a),o=hw(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 Vr(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 w of d)if(Math.sqrt(Math.pow(p-w.r,2)+Math.pow(u-w.g,2)+Math.pow(v-w.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 mh=require("@google/genai");async function So(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let y=0;y<i.length;y++){let m=i[y];if(!m.base64||!m.mimeType)throw new Error(`Image ${y+1} is missing required data`);if(m.base64.length<1e3&&console.warn(`Image ${y+1} data appears very small, may be corrupted`),!m.mimeType.startsWith("image/"))throw new Error(`Image ${y+1} has invalid MIME type: ${m.mimeType}`)}let f=new mh.GoogleGenAI({apiKey:e}),p="gemini-2.5-flash",u=[t];i.length>0&&i.forEach((y,m)=>{u.push({inlineData:{data:y.base64,mimeType:y.mimeType}}),console.log(`[Gemini] Added image ${m+1}: ${y.mimeType}, size: ${Math.round(y.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="",w=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(w)for(let y of w)y.text&&(h+=y.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 bh=require("@google/genai");async function Xr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new bh.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 bw=require("pixi.js");Ui();pt();var vh=require("pixi.js");var yw=require("pixi.js");pt();function Aw(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 Cw(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 Tw(e){return`
|
|
47
|
+
`,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Yw={};hc(Yw,{AspectClass:()=>$o,GameObject:()=>Dn,GameObjectManager:()=>ia,Renderer:()=>jn,ResponsiveUISystem:()=>Di,Transform:()=>Pn,animateHandClick:()=>Nh,animatePanelEntrance:()=>Hh,createBrushTexture:()=>Vh,createEndGamePanel:()=>Fh,createHandTutorial:()=>$h,createThreeBase:()=>Dh,createTutorialLabel:()=>Uh,getAspectClass:()=>ta,getRegisteredFontIds:()=>Bh,loadAsset:()=>Go,loadCharacterFrames:()=>Yh,registerFont:()=>zh,resolveFont:()=>Be,resolveFontWeight:()=>Fe,updateHandAnimation:()=>qh});module.exports=Ng(Yw);var Te=Ge(require("three"),1);var dt={};function qn(e,t,i=!1){dt[e]||(dt[e]=[]),dt[e].push({fn:t,once:i})}function ga(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&&ga(e,n.fn)}function fe(e,t){qn(e,t,!0)}var q=null,we=[],Zt=null;function yc(e){q=e,we=[],Zt!==null&&(clearTimeout(Zt),Zt=null)}function vc(){var e,t,i;return{endpoint:(q==null?void 0:q.endpoint)||"",transport:(q==null?void 0:q.transport)||"beacon",batchSize:(e=q==null?void 0:q.batchSize)!=null?e:10,flushIntervalMs:(t=q==null?void 0:q.flushIntervalMs)!=null?t:300,maxQueue:(i=q==null?void 0:q.maxQueue)!=null?i:200,debug:!!(q!=null&&q.debug)}}async function mc(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 ma(e,t){let i=vc();if(t&&i.endpoint){if(we.push(e),we.length>i.maxQueue&&(we=we.slice(we.length-i.maxQueue)),we.length>=i.batchSize){bc();return}Zt===null&&(Zt=window.setTimeout(()=>{Zt=null,bc()},i.flushIntervalMs))}}async function bc(){let e=vc();if(!e.endpoint||we.length===0)return;let t=we.splice(0,e.batchSize);await mc(e.endpoint,{events:t},e.transport,e.debug),we.length>0&&await mc(e.endpoint,{events:we.splice(0,e.batchSize)},e.transport,e.debug)}function xc(e){return Math.max(0,Math.min(1,e))}function $g(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function Hi(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ug(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function wc(e,t,i){try{e[t]=i}catch{}}function qg(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function _c(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function Ec(e,t){let i=qg(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function Sc(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=c=>{var p;e.add(c);let f=(p=t.get(c.target))!=null?p:new Set;f.add(c),t.set(c.target,f),n()},a=c=>{e.delete(c);let f=t.get(c.target);f&&(f.delete(c),f.size===0&&t.delete(c.target))},s=c=>{c.killed||(c.killed=!0,a(c))},o=()=>{var f,p;let c=Hi();for(let u of Array.from(e)){if(u.killed||u.paused)continue;let v=c-u.startMs-u.delayMs;if(v<0)continue;let h=u.durationMs>0?v/u.durationMs:1,w=xc(h),y=u.repeat>=0?u.repeat+1:1,m=u.repeat>0?Math.min(Math.floor(h),y-1):0;if(u.repeat>0&&h>=1){let x=h-m;w=xc(x)}let b=u.ease(w);u.yoyo&&m%2===1&&(b=1-b);for(let x of u.props)wc(u.target,x.key,x.from+(x.to-x.from)*b);u.scaleFrom&&u.scaleTo&&_c(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*b,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*b});try{(f=u.onUpdate)==null||f.call(u)}catch{}if(h>=y){s(u);try{(p=u.onComplete)==null||p.call(u)}catch{}}}},d=(c,f,p)=>{var x;let u=Math.max(0,(typeof f.duration=="number"?f.duration:.5)*1e3),v=Math.max(0,(typeof f.delay=="number"?f.delay:0)*1e3+((x=p==null?void 0:p.delayMsOverride)!=null?x:0)),h=$g(f.ease),w=typeof f.repeat=="number"?Math.max(0,f.repeat|0):0,y=f.yoyo===!0,m=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),b=[];for(let E of Object.keys(f)){if(m.has(E))continue;let A=f[E];typeof A=="number"&&b.push({key:E,from:Ug(c,E),to:A})}let g=Ec(c,f);return{target:c,startMs:Hi(),delayMs:v,durationMs:u,ease:h,props:b,scaleFrom:g.from,scaleTo:g.to,repeat:w,yoyo:y,onUpdate:typeof f.onUpdate=="function"?f.onUpdate:void 0,onComplete:typeof f.onComplete=="function"?f.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(c,f){let p=d(c,f);return r(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Hi())},resume:()=>{var h;if(!p.paused)return;let u=(h=p.pauseAtMs)!=null?h:Hi(),v=Hi()-u;p.startMs+=v,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(c,f,p){return l.set(c,f),l.to(c,p)},set(c,f){if(!c||!f)return;for(let u of Object.keys(f)){let v=f[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof v=="number"&&wc(c,u,v)}let p=Ec(c,f);p.to&&_c(c,p.to)},killTweensOf(c){let f=t.get(c);if(f)for(let p of Array.from(f))s(p)},timeline(c={}){let f=[],p=0,u=!1,v=[],h=m=>{if(typeof m=="number")return Math.max(0,m*1e3);let b=typeof m=="string"?m.trim():"";return b.startsWith("+=")?p+Math.max(0,Number(b.slice(2))*1e3||0):b?Math.max(0,Number(b)*1e3||0):p},w=m=>{f.push(m);let b=Math.max(0,(typeof m.vars.duration=="number"?m.vars.duration:.5)*1e3);p=Math.max(p,m.atMs+b)},y={to(m,b,g){return w({kind:"to",target:m,vars:b,atMs:h(g)}),y},fromTo(m,b,g,x){return w({kind:"fromTo",target:m,vars:g,from:b,atMs:h(x)}),y},play(){var m,b;if(u)return y;u=!0,v=[];for(let g of f)g.kind==="fromTo"&&l.set(g.target,(m=g.from)!=null?m:{}),v.push(l.to(g.target,{...g.vars,delay:g.atMs/1e3+((b=g.vars.delay)!=null?b:0)}));return y},pause(){for(let m of v)m.pause();return y},kill(){for(let m of v)m.kill();v=[],u=!1}};return c.paused||y.play(),y}};return l}function Ac(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=Sc()}catch{}}var Cc={name:"handler-playable-sdk",version:"0.3.16",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"}},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json",lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",sharp:"^0.34.5"}};var he=0,Wg=he++,Tc=he++,kc=he++,Lc=he++,Rc=he++,Mc=he++,Oc=he++,Ic=he++,Pc=he++,jc=he++,Dc=he++,zc=he++,H=Wg;function Bc(){return H===Tc}function Fc(){return H===kc}function Hc(){return H===Lc}function Nc(){return H===Rc}function Jt(){return H===Mc}function Qt(){return H===Oc}function $c(){return H===Ic}function Uc(){return H===Pc}function qc(){return H===jc}function ba(){return H===Dc}function ya(){return H===zc}function Gc(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),H=Tc;return}catch{}else if(e==="dapi")try{dapi.isReady(),H=kc;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(H=Lc)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(H=Rc)}catch{}else if(t==="mintegral")window.gameReady&&(H=Mc);else if(t==="tapjoy")window.TJ_API&&(H=Oc);else if(t==="tiktok")window.openAppStore&&(H=Ic);else if(t==="smadex")try{window.smxTracking&&(H=Pc)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(H=jc)}catch{}else t==="vungle"?H=Dc:(e==="nucleo"||t==="nucleo")&&(H=zc)}var Wn=Ge(require("lottie-web"),1),Wc=Wn.default;typeof window!="undefined"&&(window.lottie=Wn.default,window.__baseLottie=Wn.default);var Yg=require("pixi.js");var va=require("pixi.js");var Vg=null;function xa(e){Vg=e}Yn();wa();var Ni=require("pixi.js");Yn();var em=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Aa=em;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&&(Aa=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${Aa}`))}}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__: ${Aa}`);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}`],w=!1;for(let y of h)try{let m=await fetch(y);if(m.ok){o=await m.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",y,"type:",(v=o==null?void 0:o.constructor)==null?void 0:v.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};var $i=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 nm=Ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=nm);Ui();var Xn=require("pixi.js");Ui();var Ta=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new $i}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)}},am=new Ta,sm=new Proxy(am,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});Ui();var Kc=require("pixi.js"),Xe={width:400,height:600,designWidth:400,scaleFactor:1},Zn={scale:1,position:1},La=[];function cm(e,t,i,n,r,a,s){La.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function dm(){La.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 ka(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),Zn.scale=Xe.scaleFactor,Zn.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Zn.scale.toFixed(3)}`),dm()}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 um(e,t,i){let n=Gi[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function pm(){return Gi}var fm={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 Kn(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function Jn(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:Kn(e[0],t.x),y:Kn(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:Kn(n.x,t.x),y:Kn(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=fm[n])!=null?i:t}return t}function Zc(e,t,i,n={}){var u,v,h,w,y,m;let r=Jn(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=((w=a.right)!=null?w:0)+s.x,l=((y=a.top)!=null?y:0)+s.y,c=((m=a.bottom)!=null?m: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 Jc(e,t,i,n={}){var h,w,y,m,b,g;let r=(h=n.inset)!=null?h:{},a=(w=n.padding)!=null?w:{x:0,y:0},s=((y=r.left)!=null?y:0)+a.x,o=((m=r.right)!=null?m: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=Jn(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,ka(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),ka(window.innerWidth,window.innerHeight),window.updateDebugConfig=um,window.getDebugConfig=pm,window.copyConfig=Sm,window.applyConfig=qi,window.applyConfigForRatio=Am,window.positionAtBottom=Qc,window.positionAtTop=mm,window.positionAtCenter=bm,window.positionAtLeft=ym,window.positionAtRight=vm,window.positionAtBottomLeft=xm,window.positionAtBottomRight=wm,window.positionAtTopLeft=_m,window.positionAtTopRight=Em,window.applyPositionContract=gm,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 Qn(e,t,i=0){return e*t+i}function er(e,t,i=0){return e*(1-t)+i}function tr(e,t,i=0){return e*t+i}function ir(e,t,i=0){return e*(1-t)+i}function ge(e,t=0){return e/2+t}function hm(e,t){return e*t}function gm(e,t,i,n){var s,o,d,l,c,f,p,u,v,h,w,y,m,b,g,x,E,A,C,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=Qn(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=er(i,n.percent,(u=(p=n.offset)==null?void 0:p.y)!=null?u:0);break;case"left":r=tr(t,n.percent,(h=(v=n.offset)==null?void 0:v.x)!=null?h:0),a=ge(i,(y=(w=n.offset)==null?void 0:w.y)!=null?y:0);break;case"right":r=ir(t,n.percent,(b=(m=n.offset)==null?void 0:m.x)!=null?b:0),a=ge(i,(x=(g=n.offset)==null?void 0:g.y)!=null?x:0);break;case"center":r=ge(t,(A=(E=n.offset)==null?void 0:E.x)!=null?A:0),a=ge(i,(T=(C=n.offset)==null?void 0:C.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=hm(i,n),d=er(i,n/2);Ke(e,ge(t),d);let l=a?r*Xe.scaleFactor:r;Ze(e,l),s&&!La.find(c=>c.element===e)&&cm(e,Qc,t,i,n,r,a)}function mm(e,t,i,n=.1,r=1){Ke(e,ge(t),Qn(i,n)),Ze(e,r)}function bm(e,t,i,n=0,r=0,a=1){Ke(e,ge(t,n),ge(i,r)),Ze(e,a)}function ym(e,t,i,n=.1,r=1){Ke(e,tr(t,n),ge(i)),Ze(e,r)}function vm(e,t,i,n=.1,r=1){Ke(e,ir(t,n),ge(i)),Ze(e,r)}function xm(e,t,i,n=.05,r=.05,a=1){Ke(e,tr(t,r),er(i,n)),Ze(e,a)}function wm(e,t,i,n=.05,r=.05,a=1){Ke(e,ir(t,r),er(i,n)),Ze(e,a)}function _m(e,t,i,n=.05,r=.05,a=1){Ke(e,tr(t,r),Qn(i,n)),Ze(e,a)}function Em(e,t,i,n=.05,r=.05,a=1){Ke(e,ir(t,r),Qn(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 Ot={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 Sm(e){return e&&Ot[e]?JSON.parse(JSON.stringify(Ot[e])):JSON.parse(JSON.stringify(Gi))}function qi(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 Am(e,t){let i=e/t;i>1.6?(qi(Ot.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(qi(Ot.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(qi(Ot.square),console.log("Applied SQUARE config for ratio:",i)):(qi(Ot.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ot,e.resolveAnchorVec2=e.resolveAnchorVec2||Jn,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||Zc,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||Jc}Oa();function G(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var F_=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:G(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:G(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:G(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:G(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:G(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:G(360,780)}],H_=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:G(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:G(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:G(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:G(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:G(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:G(412,915)}],N_=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:G(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:G(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:G(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:G(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:G(800,1280)}],nd=[{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:G(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:G(768,1024),mraidScale:.7}];var $_=[...nd];var Im=nd[0];pt();var yw=Ge(mh(),1);function gw(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 mw(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 bw(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 Eo(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 gw(r),s=await bw(a),o=mw(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 Vr(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 w of d)if(Math.sqrt(Math.pow(p-w.r,2)+Math.pow(u-w.g,2)+Math.pow(v-w.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 bh=require("@google/genai");async function So(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let y=0;y<i.length;y++){let m=i[y];if(!m.base64||!m.mimeType)throw new Error(`Image ${y+1} is missing required data`);if(m.base64.length<1e3&&console.warn(`Image ${y+1} data appears very small, may be corrupted`),!m.mimeType.startsWith("image/"))throw new Error(`Image ${y+1} has invalid MIME type: ${m.mimeType}`)}let f=new bh.GoogleGenAI({apiKey:e}),p="gemini-2.5-flash",u=[t];i.length>0&&i.forEach((y,m)=>{u.push({inlineData:{data:y.base64,mimeType:y.mimeType}}),console.log(`[Gemini] Added image ${m+1}: ${y.mimeType}, size: ${Math.round(y.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="",w=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(w)for(let y of w)y.text&&(h+=y.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 yh=require("@google/genai");async function Xr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new yh.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 vw=require("pixi.js");Ui();pt();var xh=require("pixi.js");var xw=require("pixi.js");pt();function Tw(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 kw(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 Lw(e){return`
|
|
48
48
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
49
49
|
|
|
50
50
|
Provide a concise summary (2-3 sentences) covering:
|
|
@@ -61,9 +61,9 @@ Palette: [#RRGGBB, #RRGGBB, ...]
|
|
|
61
61
|
${e?`
|
|
62
62
|
ADDITIONAL RULES/NOTES:
|
|
63
63
|
${e}`:""}
|
|
64
|
-
`.trim()}function
|
|
64
|
+
`.trim()}function wh(){let e=[],t="",i=null;return{async addSources(n){let r=[];for(let a of n){let s=await Tw(a),o=kw(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=Lw(r),o=e.map(p=>({base64:p.base64,mimeType:p.mimeType})),d=await So(n,s,o,{model:a}),l=t,c=[],f=d.split(`
|
|
65
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}}},Ao=()=>ki.getKey("gemini"),Co=(e,t)=>ki.setKey("gemini",e,t),
|
|
66
|
+
Palette:`)[0].replace(/^Summary:\s*/i,"").trim()),i={summary:l,palette:c.slice(0,10)},i},setSummary(n){t=n,i&&(i={...i,summary:n})},getResult(){return i}}}var 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}}},Ao=()=>ki.getKey("gemini"),Co=(e,t)=>ki.setKey("gemini",e,t),Rw=()=>ki.hasKey("gemini");window.ApiKeyStorage=ki;window.getGeminiApiKey=Ao;window.setGeminiApiKey=Co;window.hasGeminiApiKey=Rw;var ko=class{constructor(){this.modal=null;this.options=null;this.analyzer=wh();this.currentPrompt="";this.isGenerating=!1;this.generatedImages=[];this.selectedImageIndex=-1;this.promptInput=null;this.generateBtn=null;this.loadingEl=null;this.galleryEl=null;this.previewEl=null}open(t){this.options=t,this.currentPrompt=t.initialPrompt||"",this.generatedImages=[],this.selectedImageIndex=-1,this.isGenerating=!1,this.createModal(),document.body.appendChild(this.modal),setTimeout(()=>{var i,n;(i=this.promptInput)==null||i.focus(),(n=this.promptInput)==null||n.select()},100)}createModal(){var i;let t=document.createElement("div");t.className="ai-modal",t.innerHTML=`
|
|
67
67
|
<div class="ai-modal-card">
|
|
68
68
|
<div class="ai-modal-header">
|
|
69
69
|
<div class="ai-modal-actions">
|
|
@@ -176,7 +176,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
176
176
|
<source src="${r}" type="audio/wav">
|
|
177
177
|
Your browser does not support the audio element.
|
|
178
178
|
</audio>
|
|
179
|
-
`;case"text":return`<pre style="background: rgba(0,0,0,0.2); padding: 16px; border-radius: 8px; max-height: 300px; overflow-y: auto; white-space: pre-wrap;">${t}</pre>`;default:return`<div class="asset-preview-placeholder">Cannot preview ${i} assets</div>`}}resolveAssetUrl(t){return t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("/")?t:`/raw/${t}`}attachEventListeners(){if(!this.modal)return;this.modal.addEventListener("click",n=>{let r=n.target;(r.dataset.action==="close"||r===this.modal)&&this.close()});let t=this.modal.querySelector('[data-action="change"]');t&&t.addEventListener("click",()=>{this.openAssetEditor()});let i=this.modal.querySelector('[data-action="edit"]');i&&i.addEventListener("click",()=>{this.openAiEditor(),this.close()})}openAssetEditor(){this.options&&Promise.resolve().then(()=>(Ro(),
|
|
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(()=>(Ro(),_h)).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 Mo().open(e)};var Oo=class{constructor(){this.modal=null;this.canvas=null;this.ctx=null;this.image=null;this.options=null;this.cropX=0;this.cropY=0;this.cropWidth=100;this.cropHeight=100;this.scale=1;this.panX=0;this.panY=0;this.isDragging=!1;this.dragStartX=0;this.dragStartY=0;this.lastPanX=0;this.lastPanY=0}open(t){this.options=t,this.createModal(),this.loadImage(),document.body.appendChild(this.modal)}createModal(){let t=document.createElement("div");t.className="asset-crop-modal",t.innerHTML=`
|
|
180
180
|
<div class="asset-crop-card">
|
|
181
181
|
<div class="asset-crop-header">
|
|
182
182
|
<div>
|
|
@@ -227,7 +227,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
227
227
|
<button class="asset-crop-apply primary" data-action="apply">Apply Crop</button>
|
|
228
228
|
</div>
|
|
229
229
|
</div>
|
|
230
|
-
`,this.modal=t,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var n;if(!this.image||!this.canvas)return;let t=this.image.width/this.image.height,i=this.canvas.width/this.canvas.height;t>i?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*i,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/i,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(t){if(!this.image)return;let i=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,r=this.cropY+this.cropHeight/2;t>i?(this.cropWidth=Math.min(this.image.width,this.cropHeight*t),this.cropHeight=this.cropWidth/t):(this.cropHeight=Math.min(this.image.height,this.cropWidth/t),this.cropWidth=this.cropHeight*t),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,r-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let t=this.canvas.width/this.cropWidth,i=this.canvas.height/this.cropHeight;this.scale=Math.min(t,i)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let t=this.panX,i=this.panY,n=this.cropWidth*this.scale,r=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(t,i,n,r),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(t,i,n,r),this.ctx.fillStyle="#ffffff";let a=8;[[t,i],[t+n-a,i],[t,i+r-a],[t+n-a,i+r-a]].forEach(([o,d])=>{var l;(l=this.ctx)==null||l.fillRect(o,d,a,a)})}updatePreview(){if(!this.modal||!this.image)return;let t=this.modal.querySelector(".asset-crop-preview-canvas");if(!t)return;let i=t.getContext("2d");if(!i)return;let n=150;t.width=n,t.height=n;let r=n/this.cropWidth,a=n/this.cropHeight,s=Math.min(r,a),o=this.cropWidth*s,d=this.cropHeight*s,l=(n-o)/2,c=(n-d)/2;i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,l,c,o,d)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let t=this.modal.querySelector(".asset-crop-zoom-slider");t==null||t.addEventListener("input",n=>{let r=parseFloat(n.target.value);this.setZoom(r)});let i=this.modal.querySelector(".asset-crop-aspect-select");i==null||i.addEventListener("change",n=>{let r=n.target.value;this.setAspectRatio(r)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(t){this.isDragging=!0,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(t){if(!this.isDragging)return;let i=t.clientX-this.dragStartX,n=t.clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(t){t.preventDefault();let i=t.deltaY>0?.9:1.1;this.setZoom(this.scale*i)}handleTouchStart(t){t.touches.length===1&&(this.isDragging=!0,this.dragStartX=t.touches[0].clientX,this.dragStartY=t.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(t){if(!this.isDragging||t.touches.length!==1)return;t.preventDefault();let i=t.touches[0].clientX-this.dragStartX,n=t.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(t){this.scale=Math.max(.1,Math.min(3,t)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(t){let i;switch(t){case"1:1":i=1;break;case"4:3":i=4/3;break;case"16:9":i=16/9;break;case"3:2":i=3/2;break;default:i=void 0}i&&this.applyAspectRatio(i),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let t=this.modal.querySelector(".asset-crop-zoom-value"),i=this.modal.querySelector(".asset-crop-zoom-slider");t&&(t.textContent=`${this.scale.toFixed(1)}x`),i&&(i.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let t=this.cropWidth*this.scale,i=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-t,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-i,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var r;if(!this.image||!((r=this.options)!=null&&r.onCrop))return;let t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return;t.width=this.cropWidth,t.height=this.cropHeight,i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=t.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let t=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,t!=null&&t.onCancel&&t.onCancel()}};window.openAssetCrop=function(e){new Oo().open(e)};pt();pt();var _h=Ge(require("lottie-web"),1);xa(Gc);typeof window!="undefined"&&!window.lottie&&(window.lottie=_h.default);Oa();pt();var Io="0.3.12",Lw=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"]);Ac();var Lh={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"},Rh=Math.random().toString(36).slice(2),Mi=null,Li={...Lh},Mh="web_embed",zo={},Ln,Po=!1,kn=!1,Mn=!1,Oh=!1,Ho=1,Zr=0,ea=!1,lt=!1,Ri="",Oi=Math.floor(window.innerWidth),Ii=Math.floor(window.innerHeight),Bo=Oi>Ii,ct=!1,Rn=!1,Eh=!1,Sh=!1,Do=!1,Jr=null,Xt=null,Fo=!1,No=!1,Kr=new Map;function Ih(){if(!Xt)return null;let e=Date.now()-Xt;return!Number.isFinite(e)||e<0?null:e}function jo(e){if(Fo)return;let t=Ih();t!==null&&(Fo=!0,k("session_time",{duration_ms:t,reason:e}))}function Ah(){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 Qr(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function Ph(e,t){return{event_name:e,ts:Date.now(),session_id:Rh,deployment_id:Li.deployment_id,variant_id:Li.variant_id,export_profile_id:Li.profile_id,instance_id:Li.instance_id||"default",env:Mh==="mraid"?"mraid":"web",attribution:Ln,payload:t}}function k(e,t){let i=Qr(e),n=Ph(i,t);ma(n,!!zo.analytics),Gn(i,n),i!==e&&Gn(e,n)}function On(){Jr&&(Jr(Oi,Ii),Jr=null)}function Pi(e){Ho=e,k("volume",e)}function Di(e){e&&(Oh=!0),!Mn&&(Mn=!0,k("pause"),Pi(0))}function In(e){!e&&Oh||Mn&&(Mn=!1,k("resume"),Pi(Ho))}function St(e,t){Oi=Math.floor(e||window.innerWidth),Ii=Math.floor(t||window.innerHeight),Bo=Oi>Ii,k("resize",{width:Oi,height:Ii})}function Rw(){if(zc())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)}),ea=!0,mraid.isViewable()&&mraid.getState()!=="hidden")ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On();else{let i=()=>{ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On()};mraid.addEventListener("ready",i)}}catch(e){console.warn("MRAID hook skipped",e)}}function Mw(){if(Bc())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)),ea=!0,dapi.isViewable())ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On();else{let i=()=>{ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On()};dapi.addEventListener("ready",i)}}catch(e){console.warn("DAPI hook skipped",e)}}function Ch(){let e=()=>{ct||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On(),Rn&&(Rn=!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),ea=!0}function Ow(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(Eh=!0),!(Eh&&t instanceof MouseEvent)&&(Zr+=1,No||(No=!0,k("first_interaction",{count:Zr})),k("interaction",Zr))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function Th(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(Fc())(o=(s=window.FbPlayableAd)==null?void 0:s.onCTAClick)==null||o.call(s);else if(Uc())(l=(d=window.ScPlayableAd)==null?void 0:d.onCTAClick)==null||l.call(d);else if($c())try{(f=(c=window.smxTracking)==null?void 0:c.redirect)==null||f.call(c)}catch(h){console.warn("Smadex redirect failed",h)}else if(Nc()){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):Hc()?(u=window.openAppStore)==null||u.call(window):ba()?(v=parent==null?void 0:parent.postMessage)==null||v.call(parent,"download","*"):e&&window.open(e)}function Iw(){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),qn("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 Pw(){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 kh(){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 Dw(){Jt()&&(window.mintGameStart=()=>{In(!0),St()},window.mintGameClose=()=>{Di(!0)})}function jw(){if(!ya())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(Mh=e.profile||"web_embed",zo=e.consent||{},Li={...Lh,...e.ids||{}},Mi=e.rootEl||Mi,Ln=void 0,yc((i=e.telemetry)!=null&&i.endpoint?e.telemetry:null),Xt=null,Fo=!1,No=!1,Kr.clear(),Ri=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(Jr=t),k("init"),document.body.oncontextmenu=()=>!1,Ah(),Bw(Mi),qc(),Rw(),Mw(),!ea){if(document.readyState==="complete")Ch();else if(!Sh){Sh=!0;let n=()=>{Ch(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}Ow(),Iw(),Pw(),Dw(),jw(),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"),Rn&&(Rn=!1,ze.start()),lt=!0),lt=ct},getRoot(){return Ah()},get version(){return Io},get maxWidth(){return Oi},get maxHeight(){return Ii},get isLandscape(){return Bo},get isReady(){return lt},get isStarted(){return Po},get isPaused(){return Mn},get isFinished(){return kn},get volume(){return Ho},get interactions(){return Zr},on(e,t){qn(Qr(e),t)},off(e,t){ga(Qr(e),t)},start(){var e,t;if(!Po){if(!ct){Rn=!0;return}if(Po=!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:Bo?"landscape":"portrait",buildID:Io})}}},finish(){var e,t;kn||(kn=!0,k("complete"),jo("complete"),Jt()?(e=window.gameEnd)==null||e.call(window):ba()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):Qt()&&kh())},install(e){if(!kn){kn=!0,Qt()?(kh(),setTimeout(()=>ze.install(e),300)):(k("complete"),setTimeout(()=>ze.install(e),0));return}Do||(Do=!0,setTimeout(()=>Do=!1,500),k("cta_click"),k("conversion"),jo("cta"),Th(e||Ri))},emit(e,t){let i=Qr(e);if(!Lw.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=Ph(i,t);ma(n,!!zo.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&&Th(e||Ri)},ctaShow(e){k("cta_show",e)},ctaDismiss(e){k("cta_dismiss",e)},getGameTimeMs(){return Ih()},endSession(e="manual"){jo(e)},setAttribution(e){Ln=e},abTest(e,t){if(!e)throw new Error("abTest requires experimentId");if(!Array.isArray(t)||t.length<2)throw new Error("abTest requires at least 2 variants");let i=Math.abs(zw(`${Rh}:${e}`))%t.length,n=t[i];return Ln={...Ln||{},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&&Kr.set(e,Date.now())},timerEnd(e,t="custom",i){if(!e)return;let n=Kr.get(e);if(!n)return;Kr.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(ya()){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 zw(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 Bw(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
|
|
230
|
+
`,this.modal=t,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var n;if(!this.image||!this.canvas)return;let t=this.image.width/this.image.height,i=this.canvas.width/this.canvas.height;t>i?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*i,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/i,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(t){if(!this.image)return;let i=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,r=this.cropY+this.cropHeight/2;t>i?(this.cropWidth=Math.min(this.image.width,this.cropHeight*t),this.cropHeight=this.cropWidth/t):(this.cropHeight=Math.min(this.image.height,this.cropWidth/t),this.cropWidth=this.cropHeight*t),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,r-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let t=this.canvas.width/this.cropWidth,i=this.canvas.height/this.cropHeight;this.scale=Math.min(t,i)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let t=this.panX,i=this.panY,n=this.cropWidth*this.scale,r=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(t,i,n,r),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(t,i,n,r),this.ctx.fillStyle="#ffffff";let a=8;[[t,i],[t+n-a,i],[t,i+r-a],[t+n-a,i+r-a]].forEach(([o,d])=>{var l;(l=this.ctx)==null||l.fillRect(o,d,a,a)})}updatePreview(){if(!this.modal||!this.image)return;let t=this.modal.querySelector(".asset-crop-preview-canvas");if(!t)return;let i=t.getContext("2d");if(!i)return;let n=150;t.width=n,t.height=n;let r=n/this.cropWidth,a=n/this.cropHeight,s=Math.min(r,a),o=this.cropWidth*s,d=this.cropHeight*s,l=(n-o)/2,c=(n-d)/2;i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,l,c,o,d)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let t=this.modal.querySelector(".asset-crop-zoom-slider");t==null||t.addEventListener("input",n=>{let r=parseFloat(n.target.value);this.setZoom(r)});let i=this.modal.querySelector(".asset-crop-aspect-select");i==null||i.addEventListener("change",n=>{let r=n.target.value;this.setAspectRatio(r)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(t){this.isDragging=!0,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(t){if(!this.isDragging)return;let i=t.clientX-this.dragStartX,n=t.clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(t){t.preventDefault();let i=t.deltaY>0?.9:1.1;this.setZoom(this.scale*i)}handleTouchStart(t){t.touches.length===1&&(this.isDragging=!0,this.dragStartX=t.touches[0].clientX,this.dragStartY=t.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(t){if(!this.isDragging||t.touches.length!==1)return;t.preventDefault();let i=t.touches[0].clientX-this.dragStartX,n=t.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(t){this.scale=Math.max(.1,Math.min(3,t)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(t){let i;switch(t){case"1:1":i=1;break;case"4:3":i=4/3;break;case"16:9":i=16/9;break;case"3:2":i=3/2;break;default:i=void 0}i&&this.applyAspectRatio(i),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let t=this.modal.querySelector(".asset-crop-zoom-value"),i=this.modal.querySelector(".asset-crop-zoom-slider");t&&(t.textContent=`${this.scale.toFixed(1)}x`),i&&(i.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let t=this.cropWidth*this.scale,i=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-t,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-i,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var r;if(!this.image||!((r=this.options)!=null&&r.onCrop))return;let t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return;t.width=this.cropWidth,t.height=this.cropHeight,i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=t.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let t=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,t!=null&&t.onCancel&&t.onCancel()}};window.openAssetCrop=function(e){new Oo().open(e)};pt();pt();var Eh=Ge(require("lottie-web"),1);xa(Wc);typeof window!="undefined"&&!window.lottie&&(window.lottie=Eh.default);Oa();pt();var Io=Cc.version,Mw=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"]);Ac();var Rh={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"},Mh=Math.random().toString(36).slice(2),Mi=null,Li={...Rh},Oh="web_embed",zo={},Ln,Po=!1,kn=!1,Mn=!1,Ih=!1,No=1,Zr=0,ea=!1,lt=!1,Ri="",Oi=Math.floor(window.innerWidth),Ii=Math.floor(window.innerHeight),Bo=Oi>Ii,ct=!1,Rn=!1,Sh=!1,Ah=!1,jo=!1,Jr=null,Xt=null,Fo=!1,Ho=!1,Kr=new Map;function Ph(){if(!Xt)return null;let e=Date.now()-Xt;return!Number.isFinite(e)||e<0?null:e}function Do(e){if(Fo)return;let t=Ph();t!==null&&(Fo=!0,k("session_time",{duration_ms:t,reason:e}))}function Ch(){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 Qr(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function jh(e,t){return{event_name:e,ts:Date.now(),session_id:Mh,deployment_id:Li.deployment_id,variant_id:Li.variant_id,export_profile_id:Li.profile_id,instance_id:Li.instance_id||"default",env:Oh==="mraid"?"mraid":"web",attribution:Ln,payload:t}}function k(e,t){let i=Qr(e),n=jh(i,t);ma(n,!!zo.analytics),Gn(i,n),i!==e&&Gn(e,n)}function On(){Jr&&(Jr(Oi,Ii),Jr=null)}function Pi(e){No=e,k("volume",e)}function ji(e){e&&(Ih=!0),!Mn&&(Mn=!0,k("pause"),Pi(0))}function In(e){!e&&Ih||Mn&&(Mn=!1,k("resume"),Pi(No))}function St(e,t){Oi=Math.floor(e||window.innerWidth),Ii=Math.floor(t||window.innerHeight),Bo=Oi>Ii,k("resize",{width:Oi,height:Ii})}function Ow(){if(Bc())try{let e=mraid.getMaxSize();St(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?In():ji()};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)}),ea=!0,mraid.isViewable()&&mraid.getState()!=="hidden")ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On();else{let i=()=>{ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On()};mraid.addEventListener("ready",i)}}catch(e){console.warn("MRAID hook skipped",e)}}function Iw(){if(Fc())try{let e=dapi.getScreenSize();St(e.width,e.height),dapi.addEventListener("viewableChange",i=>{i.isViewable?In():ji()}),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)),ea=!0,dapi.isViewable())ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On();else{let i=()=>{ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On()};dapi.addEventListener("ready",i)}}catch(e){console.warn("DAPI hook skipped",e)}}function Th(){let e=()=>{ct||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(ct=!0,k("boot"),k("view"),k("ready"),lt=!0,On(),Rn&&(Rn=!1,ze.start()))};window.addEventListener("resize",()=>St()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(In(),e()):ji()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),ea=!0}function Pw(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(Sh=!0),!(Sh&&t instanceof MouseEvent)&&(Zr+=1,Ho||(Ho=!0,k("first_interaction",{count:Zr})),k("interaction",Zr))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function kh(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(Hc())(o=(s=window.FbPlayableAd)==null?void 0:s.onCTAClick)==null||o.call(s);else if(qc())(l=(d=window.ScPlayableAd)==null?void 0:d.onCTAClick)==null||l.call(d);else if(Uc())try{(f=(c=window.smxTracking)==null?void 0:c.redirect)==null||f.call(c)}catch(h){console.warn("Smadex redirect failed",h)}else if(Nc()){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):$c()?(u=window.openAppStore)==null||u.call(window):ba()?(v=parent==null?void 0:parent.postMessage)==null||v.call(parent,"download","*"):e&&window.open(e)}function jw(){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),qn("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 Dw(){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 Lh(){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 zw(){Jt()&&(window.mintGameStart=()=>{In(!0),St()},window.mintGameClose=()=>{ji(!0)})}function Bw(){if(!ya())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(Oh=e.profile||"web_embed",zo=e.consent||{},Li={...Rh,...e.ids||{}},Mi=e.rootEl||Mi,Ln=void 0,yc((i=e.telemetry)!=null&&i.endpoint?e.telemetry:null),Xt=null,Fo=!1,Ho=!1,Kr.clear(),Ri=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(Jr=t),k("init"),document.body.oncontextmenu=()=>!1,Ch(),Hw(Mi),Gc(),Ow(),Iw(),!ea){if(document.readyState==="complete")Th();else if(!Ah){Ah=!0;let n=()=>{Th(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}Pw(),jw(),Dw(),zw(),Bw(),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"),Rn&&(Rn=!1,ze.start()),lt=!0),lt=ct},getRoot(){return Ch()},get version(){return Io},get maxWidth(){return Oi},get maxHeight(){return Ii},get isLandscape(){return Bo},get isReady(){return lt},get isStarted(){return Po},get isPaused(){return Mn},get isFinished(){return kn},get volume(){return No},get interactions(){return Zr},on(e,t){qn(Qr(e),t)},off(e,t){ga(Qr(e),t)},start(){var e,t;if(!Po){if(!ct){Rn=!0;return}if(Po=!0,Xt||(Xt=Date.now()),k("start"),St(),Jt())ji(),(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:Bo?"landscape":"portrait",buildID:Io})}}},finish(){var e,t;kn||(kn=!0,k("complete"),Do("complete"),Jt()?(e=window.gameEnd)==null||e.call(window):ba()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):Qt()&&Lh())},install(e){if(!kn){kn=!0,Qt()?(Lh(),setTimeout(()=>ze.install(e),300)):(k("complete"),setTimeout(()=>ze.install(e),0));return}jo||(jo=!0,setTimeout(()=>jo=!1,500),k("cta_click"),k("conversion"),Do("cta"),kh(e||Ri))},emit(e,t){let i=Qr(e);if(!Mw.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=jh(i,t);ma(n,!!zo.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&&kh(e||Ri)},ctaShow(e){k("cta_show",e)},ctaDismiss(e){k("cta_dismiss",e)},getGameTimeMs(){return Ph()},endSession(e="manual"){Do(e)},setAttribution(e){Ln=e},abTest(e,t){if(!e)throw new Error("abTest requires experimentId");if(!Array.isArray(t)||t.length<2)throw new Error("abTest requires at least 2 variants");let i=Math.abs(Fw(`${Mh}:${e}`))%t.length,n=t[i];return Ln={...Ln||{},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&&Kr.set(e,Date.now())},timerEnd(e,t="custom",i){if(!e)return;let n=Kr.get(e);if(!n)return;Kr.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(ya()){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(){ji(!0)},resume(){In(!0)},resize(e,t){St(e,t)}},ei=ze;function Fw(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 Hw(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
|
|
231
231
|
(function(){
|
|
232
232
|
var events = ['touchstart','touchend','mousedown','keydown'];
|
|
233
233
|
function unlock(){
|
|
@@ -243,7 +243,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
243
243
|
}
|
|
244
244
|
events.forEach(function(e){ document.addEventListener(e, unlock, false); });
|
|
245
245
|
})();
|
|
246
|
-
`,e.appendChild(t)}var $o=(n=>(n[n.PHONE_TALL=0]="PHONE_TALL",n[n.TABLET=1]="TABLET",n[n.LANDSCAPE=2]="LANDSCAPE",n))($o||{});function ta(e,t){let i=e/t;return i<=.62?0:i<=.85?1:2}var
|
|
246
|
+
`,e.appendChild(t)}var $o=(n=>(n[n.PHONE_TALL=0]="PHONE_TALL",n[n.TABLET=1]="TABLET",n[n.LANDSCAPE=2]="LANDSCAPE",n))($o||{});function ta(e,t){let i=e/t;return i<=.62?0:i<=.85?1:2}var Di=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=ta(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 ta(t.width,t.height)}};async function Dh(e,t={}){let i=()=>{let b=e.getBoundingClientRect(),g=Math.floor(b.width),x=Math.floor(b.height);return(g<=0||!isFinite(g)||g!==g)&&(g=e.clientWidth||window.innerWidth||320),(x<=0||!isFinite(x)||x!==x)&&(x=e.clientHeight||window.innerHeight||480),(g<=0||!isFinite(g)||g!==g)&&(g=320),(x<=0||!isFinite(x)||x!==x)&&(x=480),console.log("[THREE-BASE] getSize result:",{width:g,height:x,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:x}},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
247
|
position: absolute !important;
|
|
248
248
|
inset: 0 !important;
|
|
249
249
|
width: 100% !important;
|
|
@@ -266,7 +266,7 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
266
266
|
overflow: hidden !important;
|
|
267
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 w=b=>{var _;let g=e.getBoundingClientRect(),x=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:x.width,height:x.height,transform:x.transform,scale:x.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
268
|
`).slice(1,4).join(`
|
|
269
|
-
`)});let E=g.width,A=g.height;if((E<=0||!isFinite(E))&&(console.warn("[THREE-BASE] Invalid boundingRect.width, using clientWidth fallback",{boundingRectWidth:g.width,clientWidth:e.clientWidth}),E=e.clientWidth||window.innerWidth||320),(A<=0||!isFinite(A))&&(console.warn("[THREE-BASE] Invalid boundingRect.height, using clientHeight fallback",{boundingRectHeight:g.height,clientHeight:e.clientHeight}),A=e.clientHeight||window.innerHeight||480),typeof(b==null?void 0:b.width)=="number"&&b.width>0){let I=Math.abs(b.width-g.width),z=g.width*.1;I>z?console.warn("[THREE-BASE] Provided width ignored (too different from container):",{provided:b.width,container:g.width,difference:I,tolerance:z,willUse:"container size (boundingRect)"}):(E=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 I=Math.abs(b.height-g.height),z=g.height*.1;I>z?console.warn("[THREE-BASE] Provided height ignored (too different from container):",{provided:b.height,container:g.height,difference:I,tolerance:z,willUse:"container size (boundingRect)"}):(A=b.height,console.log("[THREE-BASE] Using provided height (within tolerance):",{provided:b.height,container:g.height}))}(E<=0||A<=0||!isFinite(E)||!isFinite(A))&&(console.warn("[THREE-BASE] Invalid size in applySize, using fallback",{newWidth:E,newHeight:A,size:b,rootRect:g}),E=g.width||e.clientWidth||320,A=g.height||e.clientHeight||480);let C=Math.floor(E),T=Math.floor(A);console.log("[THREE-BASE] applySize setting renderer size:",{finalWidth:C,finalHeight:T,aspectRatio:C/T,beforeRendererSize:{width:h.domElement.width,height:h.domElement.height},beforeRendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height}}),h.setSize(C,T),h.setPixelRatio(window.devicePixelRatio||1),v.aspect=C/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(()=>{w()})});let y=!1;ei.on("pause",()=>{y=!0,document.querySelectorAll("audio").forEach(g=>g.pause())}),ei.on("resume",()=>{y=!1,document.querySelectorAll("audio").forEach(g=>{g.currentTime>0&&!g.ended&&g.play().catch(()=>{})})});let m=new
|
|
269
|
+
`)});let E=g.width,A=g.height;if((E<=0||!isFinite(E))&&(console.warn("[THREE-BASE] Invalid boundingRect.width, using clientWidth fallback",{boundingRectWidth:g.width,clientWidth:e.clientWidth}),E=e.clientWidth||window.innerWidth||320),(A<=0||!isFinite(A))&&(console.warn("[THREE-BASE] Invalid boundingRect.height, using clientHeight fallback",{boundingRectHeight:g.height,clientHeight:e.clientHeight}),A=e.clientHeight||window.innerHeight||480),typeof(b==null?void 0:b.width)=="number"&&b.width>0){let I=Math.abs(b.width-g.width),z=g.width*.1;I>z?console.warn("[THREE-BASE] Provided width ignored (too different from container):",{provided:b.width,container:g.width,difference:I,tolerance:z,willUse:"container size (boundingRect)"}):(E=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 I=Math.abs(b.height-g.height),z=g.height*.1;I>z?console.warn("[THREE-BASE] Provided height ignored (too different from container):",{provided:b.height,container:g.height,difference:I,tolerance:z,willUse:"container size (boundingRect)"}):(A=b.height,console.log("[THREE-BASE] Using provided height (within tolerance):",{provided:b.height,container:g.height}))}(E<=0||A<=0||!isFinite(E)||!isFinite(A))&&(console.warn("[THREE-BASE] Invalid size in applySize, using fallback",{newWidth:E,newHeight:A,size:b,rootRect:g}),E=g.width||e.clientWidth||320,A=g.height||e.clientHeight||480);let C=Math.floor(E),T=Math.floor(A);console.log("[THREE-BASE] applySize setting renderer size:",{finalWidth:C,finalHeight:T,aspectRatio:C/T,beforeRendererSize:{width:h.domElement.width,height:h.domElement.height},beforeRendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height}}),h.setSize(C,T),h.setPixelRatio(window.devicePixelRatio||1),v.aspect=C/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(()=>{w()})});let y=!1;ei.on("pause",()=>{y=!0,document.querySelectorAll("audio").forEach(g=>g.pause())}),ei.on("resume",()=>{y=!1,document.querySelectorAll("audio").forEach(g=>{g.currentTime>0&&!g.ended&&g.play().catch(()=>{})})});let m=new Di(e,s);return ei.on("resize",({payload:b})=>{console.log("[THREE-BASE] Handler resize event received:",{payload:b,timestamp:Date.now(),rootRect:e.getBoundingClientRect()}),w({width:b==null?void 0:b.width,height:b==null?void 0:b.height}),m.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()}),w(),m.updateLayout()}),{scene:d,camera:v,renderer:h,uiSystem:m,applySize:w}}var ee=Ge(require("three"),1),Pn=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}},jn=class{constructor(t){var i,n,r,a;this.z_index=(i=t==null?void 0:t.z_index)!=null?i:0,this.alpha=(n=t==null?void 0:t.alpha)!=null?n:1,this.visible=(r=t==null?void 0:t.visible)!=null?r:!0,this.tint=(a=t==null?void 0:t.tint)!=null?a:null}update(t){t.z_index!==void 0&&(this.z_index=t.z_index),t.alpha!==void 0&&(this.alpha=t.alpha),t.visible!==void 0&&(this.visible=t.visible),t.tint!==void 0&&(this.tint=t.tint)}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 Pn(r.transform),this.renderer=new jn(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)}},ia=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 na={"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=na[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=na[e];return t&&(i=t.weight)!=null?i:"400"}function zh(e,t){na[e]=t}function Bh(){return Object.keys(na)}var zi=Ge(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 Fh(e,t,i,n){var 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,Ol,Il,Pl,jl,Dl,zl,Bl,Fl,Hl,Nl,$l,Ul,ql,Gl,Wl,Yl,Vl,Xl,Kl,Zl,Jl,Ql,ec,tc,ic,nc,rc,ac,sc,oc,lc,cc,dc,uc,pc,fc;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=((ol=r==null?void 0:r.gameplay)==null?void 0:ol.tuning)||{},v=(r==null?void 0:r.render)||{},h=n.getBoundingClientRect(),w=h.width>0?h.width*.9:320,y=h.height>0?h.height*.85:400,m=Math.min((ll=u.panel_width)!=null?ll:320,w),b=Math.min((cl=u.panel_height)!=null?cl:400,y),g=(dl=u.panel_padding)!=null?dl:32,x=(ul=u.panel_radius)!=null?ul:24,E=v.background_color||u.panel_bg_color||"#1a0a0a",A=v.background_alpha!==void 0&&v.background_alpha!==null?v.background_alpha:(pl=u.panel_bg_alpha)!=null?pl:.98,C=v.border_color||u.panel_border_color||"#ffffff",T=(fl=u.panel_border_width)!=null?fl:2,L=(hl=u.panel_border_alpha)!=null?hl:.3,_=document.createElement("div");_.style.cssText=`
|
|
270
270
|
position: absolute;
|
|
271
271
|
width: ${m}px;
|
|
272
272
|
height: ${b}px;
|
|
@@ -285,67 +285,67 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
285
285
|
z-index: 1000;
|
|
286
286
|
box-sizing: border-box;
|
|
287
287
|
padding: ${g}px;
|
|
288
|
-
`,n.appendChild(_);let I=Kt(_);I.element=_;let z=((gl=a==null?void 0:a.gameplay)==null?void 0:gl.tuning)||{},le=(a==null?void 0:a.transform)||{},te=(ml=z.logo_size)!=null?ml:56,ne=(bl=le.scale)!=null?bl:1,xe=(vl=(yl=le.offset)==null?void 0:yl.y)!=null?vl:-130,
|
|
288
|
+
`,n.appendChild(_);let I=Kt(_);I.element=_;let z=((gl=a==null?void 0:a.gameplay)==null?void 0:gl.tuning)||{},le=(a==null?void 0:a.transform)||{},te=(ml=z.logo_size)!=null?ml:56,ne=(bl=le.scale)!=null?bl:1,xe=(vl=(yl=le.offset)==null?void 0:yl.y)!=null?vl:-130,He=(xl=z.logo_alpha)!=null?xl:1,Xh=new zi.SpriteMaterial({map:i||void 0,transparent:!0,alphaTest:.1}),ke=new zi.Sprite(Xh);ke.position.set(0,xe,0),ke.material.opacity=0;let zn=0,Bn=0;if(i){let re=i.image;zn=(re==null?void 0:re.width)||100,Bn=(re==null?void 0:re.height)||100}if(zn>0&&Bn>0){let re=zn/Bn,fa,ha;re>1?(fa=te,ha=te/re):(ha=te,fa=te*re);let Pg=fa/zn*ne,jg=ha/Bn*ne;ke.scale.set(Pg,jg,1)}else{let re=te/100*ne;ke.scale.set(re,re,1)}ke.targetAlpha=He,ke.baseScaleX=ke.scale.x,ke.baseScaleY=ke.scale.y;let ce=s==null?void 0:s.ui,Ne=((wl=s==null?void 0:s.gameplay)==null?void 0:wl.tuning)||{},Kh=(ce==null?void 0:ce.text)||"MISSION ACCOMPLISHED",Wo=(ce==null?void 0:ce.font)||"brand.heading",aa=(ce==null?void 0:ce.fontSize)||24,Zh=(_l=ce==null?void 0:ce.letterSpacing)!=null?_l:1,Fn=(El=s==null?void 0:s.render)==null?void 0:El.tint,Jh=typeof Fn=="string"?Fn:Fn?`#${Fn.toString(16).padStart(6,"0")}`:"#00FF88",Qh=m-g*2-30,eg=Ne.font_weight_override?Ne.font_weight_override:Fe(Wo),At=document.createElement("div");At.textContent=Kh,At.style.cssText=`
|
|
289
289
|
font-family: ${Be(Wo)};
|
|
290
290
|
font-size: ${aa}px;
|
|
291
|
-
font-weight: ${
|
|
292
|
-
color: ${
|
|
291
|
+
font-weight: ${eg};
|
|
292
|
+
color: ${Jh};
|
|
293
293
|
text-align: center;
|
|
294
|
-
letter-spacing: ${
|
|
295
|
-
-webkit-text-stroke: ${(Sl=
|
|
296
|
-
text-shadow: ${(Al=
|
|
294
|
+
letter-spacing: ${Zh}px;
|
|
295
|
+
-webkit-text-stroke: ${(Sl=Ne.stroke_width)!=null?Sl:2}px ${Ne.stroke_color||"#000000"};
|
|
296
|
+
text-shadow: ${(Al=Ne.shadow_distance)!=null?Al:4}px ${(Cl=Ne.shadow_distance)!=null?Cl:4}px ${(Tl=Ne.shadow_blur)!=null?Tl:8}px rgba(0,0,0,${(kl=Ne.shadow_alpha)!=null?kl:.9});
|
|
297
297
|
opacity: 0;
|
|
298
298
|
position: absolute;
|
|
299
299
|
transform: translate(-50%, -50%);
|
|
300
300
|
white-space: nowrap;
|
|
301
|
-
max-width: ${
|
|
302
|
-
`;let Yo=g+30,
|
|
301
|
+
max-width: ${Qh}px;
|
|
302
|
+
`;let Yo=g+30,tg=((Ll=u.title_offset_y)!=null?Ll:Yo+aa/2)+((Rl=Ne.animation_start_y_offset)!=null?Rl:-20);At.style.top=`${tg}px`,At.style.left="50%";let Vo=Kt(At);Vo.element=At,_.appendChild(At);let de=o==null?void 0:o.ui,Xo=((Ml=o==null?void 0:o.gameplay)==null?void 0:Ml.tuning)||{},ig=(de==null?void 0:de.text)||"RESCUE COMPLETE",Ko=(de==null?void 0:de.font)||"brand.body",sa=(de==null?void 0:de.fontSize)||11,ng=(Ol=de==null?void 0:de.letterSpacing)!=null?Ol:.5,Hn=(Il=o==null?void 0:o.render)==null?void 0:Il.tint,rg=typeof Hn=="string"?Hn:Hn?`#${Hn.toString(16).padStart(6,"0")}`:"#B0B0B0",Ct=document.createElement("div");Ct.textContent=ig,Ct.style.cssText=`
|
|
303
303
|
font-family: ${Be(Ko)};
|
|
304
304
|
font-size: ${sa}px;
|
|
305
305
|
font-weight: ${Fe(Ko)};
|
|
306
|
-
color: ${
|
|
306
|
+
color: ${rg};
|
|
307
307
|
text-align: center;
|
|
308
|
-
letter-spacing: ${
|
|
308
|
+
letter-spacing: ${ng}px;
|
|
309
309
|
opacity: 0;
|
|
310
310
|
position: absolute;
|
|
311
311
|
transform: translate(-50%, -50%);
|
|
312
312
|
white-space: nowrap;
|
|
313
|
-
`;let Zo=Yo+aa+15,
|
|
313
|
+
`;let Zo=Yo+aa+15,ag=((Pl=u.subtitle_offset_y)!=null?Pl:Zo+sa/2)+((jl=Xo.animation_start_y_offset)!=null?jl:-10);Ct.style.top=`${ag}px`,Ct.style.left="50%";let oa=Kt(Ct);oa.element=Ct,oa.animationStartYOffset=(Dl=Xo.animation_start_y_offset)!=null?Dl:-10,_.appendChild(Ct);let $e=d==null?void 0:d.ui,Jo=((zl=d==null?void 0:d.gameplay)==null?void 0:zl.tuning)||{},sg=($e==null?void 0:$e.text)||((Bl=p.ui)==null?void 0:Bl.cta_hint)||"Continue the adventure!",Qo=($e==null?void 0:$e.font)||"brand.body",el=($e==null?void 0:$e.fontSize)||16,Nn=(Fl=d==null?void 0:d.render)==null?void 0:Fl.tint,og=typeof Nn=="string"?Nn:Nn?`#${Nn.toString(16).padStart(6,"0")}`:"#FFFFFF",lg=(Hl=Jo.max_width)!=null?Hl:m-g*2,cg=(Nl=Jo.line_height)!=null?Nl:1.4,Tt=document.createElement("div");Tt.textContent=sg,Tt.style.cssText=`
|
|
314
314
|
font-family: ${Be(Qo)};
|
|
315
315
|
font-size: ${el}px;
|
|
316
316
|
font-weight: ${Fe(Qo)};
|
|
317
|
-
color: ${
|
|
317
|
+
color: ${og};
|
|
318
318
|
text-align: center;
|
|
319
319
|
opacity: 0;
|
|
320
320
|
position: absolute;
|
|
321
321
|
transform: translate(-50%, -50%);
|
|
322
|
-
max-width: ${
|
|
323
|
-
line-height: ${
|
|
322
|
+
max-width: ${lg}px;
|
|
323
|
+
line-height: ${cg};
|
|
324
324
|
word-wrap: break-word;
|
|
325
|
-
`;let
|
|
326
|
-
width: ${
|
|
325
|
+
`;let dg=Zo+sa+30,ug=($l=u.footer_offset_y)!=null?$l:dg+el/2;Tt.style.top=`${ug}px`,Tt.style.left="50%";let la=Kt(Tt);la.element=Tt;let pg=((Ul=d==null?void 0:d.render)==null?void 0:Ul.alpha)!==void 0&&((ql=d==null?void 0:d.render)==null?void 0:ql.alpha)!==null?d.render.alpha:1;la.targetAlpha=pg,_.appendChild(Tt);let Ue=((Gl=l==null?void 0:l.gameplay)==null?void 0:Gl.tuning)||{},ue=l==null?void 0:l.ui,fg=(Wl=Ue.button_width)!=null?Wl:260,tl=(Yl=Ue.button_height)!=null?Yl:56,hg=(Vl=Ue.button_radius)!=null?Vl:16,gg=Ue.button_bg_color||((Xl=p.theme)==null?void 0:Xl.cta_background)||"#ffb43b",mg=(Kl=Ue.button_bg_alpha)!=null?Kl:1,bg=Ue.button_border_color||"#ffffff",yg=(Zl=Ue.button_border_width)!=null?Zl:2,Kw=(Jl=Ue.button_border_alpha)!=null?Jl:.2,ca=(Ql=u.cta_offset_y)!=null?Ql:b*.7,X=document.createElement("button");X.style.cssText=`
|
|
326
|
+
width: ${fg}px;
|
|
327
327
|
height: ${tl}px;
|
|
328
|
-
background: ${
|
|
329
|
-
opacity: ${
|
|
330
|
-
border: ${
|
|
331
|
-
border-radius: ${
|
|
328
|
+
background: ${gg};
|
|
329
|
+
opacity: ${mg};
|
|
330
|
+
border: ${yg}px solid ${bg};
|
|
331
|
+
border-radius: ${hg}px;
|
|
332
332
|
cursor: pointer;
|
|
333
333
|
opacity: 0;
|
|
334
334
|
position: absolute;
|
|
335
335
|
transform: translate(-50%, -50%);
|
|
336
336
|
box-shadow: inset 0 0 1px rgba(0,0,0,0.15);
|
|
337
|
-
`,X.style.top=`${ca}px`,X.style.left="50%";let da=Kt(X);da.element=X,da.addEventListener=X.addEventListener.bind(X),_.appendChild(X);let
|
|
337
|
+
`,X.style.top=`${ca}px`,X.style.left="50%";let da=Kt(X);da.element=X,da.addEventListener=X.addEventListener.bind(X),_.appendChild(X);let vg=(ue==null?void 0:ue.text)||((ec=p.ui)==null?void 0:ec.cta_label_end)||"DOWNLOAD",il=(ue==null?void 0:ue.font)||"brand.heading",xg=(ue==null?void 0:ue.fontSize)||20,wg=Ue.button_text_color||((tc=p.theme)==null?void 0:tc.cta_text)||"#1a0a0a";X.textContent=vg,X.style.fontFamily=Be(il),X.style.fontSize=`${xg}px`,X.style.fontWeight=String(Fe(il)),X.style.color=wg,X.style.letterSpacing=`${(ic=ue==null?void 0:ue.letterSpacing)!=null?ic:1}px`;let nl=Kt(X);nl.element=X;let pe=c==null?void 0:c.ui,rl=((nc=c==null?void 0:c.gameplay)==null?void 0:nc.tuning)||{},_g=(pe==null?void 0:pe.text)||"Play the full game",al=(pe==null?void 0:pe.font)||"brand.body",Eg=(pe==null?void 0:pe.fontSize)||11,Sg=(rc=pe==null?void 0:pe.letterSpacing)!=null?rc:0,$n=(ac=c==null?void 0:c.render)==null?void 0:ac.tint,Ag=typeof $n=="string"?$n:$n?`#${$n.toString(16).padStart(6,"0")}`:"#CCCCCC",kt=document.createElement("div");kt.textContent=_g,kt.style.cssText=`
|
|
338
338
|
font-family: ${Be(al)};
|
|
339
|
-
font-size: ${
|
|
339
|
+
font-size: ${Eg}px;
|
|
340
340
|
font-weight: ${Fe(al)};
|
|
341
|
-
color: ${
|
|
341
|
+
color: ${Ag};
|
|
342
342
|
text-align: center;
|
|
343
|
-
letter-spacing: ${
|
|
343
|
+
letter-spacing: ${Sg}px;
|
|
344
344
|
opacity: 0;
|
|
345
345
|
position: absolute;
|
|
346
346
|
transform: translate(-50%, -50%);
|
|
347
347
|
white-space: nowrap;
|
|
348
|
-
`;let
|
|
348
|
+
`;let Cg=ca+tl/2+20,Tg=b-g-10,kg=Math.min(Cg+((sc=rl.animation_start_y_offset)!=null?sc:5),Tg);kt.style.top=`${kg}px`,kt.style.left="50%";let ua=Kt(kt);ua.element=kt,ua.animationStartYOffset=(oc=rl.animation_start_y_offset)!=null?oc:5,_.appendChild(kt);let pa=((lc=f==null?void 0:f.gameplay)==null?void 0:lc.tuning)||{},Lg=(cc=pa.hand_offset_x)!=null?cc:50,Rg=(dc=pa.hand_offset_y)!=null?dc:50,Mg=(pc=(uc=f==null?void 0:f.transform)==null?void 0:uc.scale)!=null?pc:.1875,Og=(fc=pa.hand_scale_multiplier)!=null?fc:2.5,Ig=new zi.SpriteMaterial({map:t||void 0,transparent:!0,alphaTest:.1}),Fi=new zi.Sprite(Ig),sl=Mg*Og*100;return Fi.scale.set(sl,sl,1),Fi.position.set(Lg,ca+Rg,0),Fi.material.opacity=0,Fi.visible=!1,{panel:I,logo:ke,title:Vo,subtitle:oa,footer:la,ctaButton:da,ctaText:nl,ctaHint:ua,hand:Fi}}function Hh(e,t,i){var E,A,C,T,L,_,I,z;let n=t.objects.get("ui_endgame_1"),r=((E=n==null?void 0:n.gameplay)==null?void 0:E.tuning)||{},a=(A=r.animation_duration_ms)!=null?A:800,s=(C=r.fade_in_duration_ms)!=null?C: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=(I=r.footer_animation_delay_ms)!=null?I:300,f=(z=r.cta_animation_delay_ms)!=null?z:400,{panel:p,logo:u,title:v,subtitle:h,footer:w,ctaButton:y,ctaText:m,ctaHint:b}=e;p.visible=!0,p.element.style.visibility="visible";let g=Date.now(),x=()=>{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(x):(setTimeout(()=>Nw(u,a,t),d),setTimeout(()=>{$w(v,a),setTimeout(()=>Uw(h,a),50)},l),setTimeout(()=>qw(w,a),c),setTimeout(()=>{Gw(y,m,a),setTimeout(()=>Ww(b,a),50),i&&i()},f))};x()}function Nw(e,t,i){var p,u,v,h,w;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=(w=e.baseScaleY)!=null?w:e.scale.y,f=()=>{let y=Date.now()-s,m=Math.min(y/t,1),b=1-Math.pow(1-m,2);e.material.opacity=o+(d-o)*b;let g=a+(1-a)*b;e.scale.set(l*g,c*g,1),m<1&&requestAnimationFrame(f)};f()}function $w(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 Uw(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 qw(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 Gw(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 Ww(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 Nh(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 A,C;e.visible=!0,e.material.opacity=1;let v=e.position.x,h=e.position.y,w=(A=a.hand_offset_x)!=null?A:50,y=(C=a.hand_offset_y)!=null?C:50,m=t.element.getBoundingClientRect(),b=w,g=y,x=Date.now(),E=()=>{var ne,xe,He;let T=Date.now()-x,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 I=(xe=(ne=r==null?void 0:r.transform)==null?void 0:ne.scale)!=null?xe:.1875,z=(He=a.hand_scale_multiplier)!=null?He:2.5,le=I*z*100,te=le+le*.2*Math.sin(L*Math.PI);e.scale.set(te,te,1),L<1?requestAnimationFrame(E):(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))};E()};setTimeout(l,o)}var ra=Ge(require("three"),1);function $h(e,t,i){var u,v,h,w,y,m,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 ra.SpriteMaterial({map:e||void 0,transparent:!0,alphaTest:.1}),d=new ra.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+((w=l==null?void 0:l.y)!=null?w: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=(y=r.hand_scale_multiplier)!=null?y:2.5,p=(m=s.scale)!=null?m:.1875;return d.scale.set(p*f*100,p*f*100,1),d.renderOrder=(b=a.z_index)!=null?b:99999,d}function Uh(e){var v,h,w,y,m,b,g,x,E;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=(y=i==null?void 0:i.letterSpacing)!=null?y:(w=r.label_letter_spacing)!=null?w:-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
349
|
font-family: ${Be(o)};
|
|
350
350
|
font-size: ${d}px;
|
|
351
351
|
font-weight: ${Fe(o)};
|
|
@@ -360,4 +360,4 @@ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}c
|
|
|
360
360
|
position: absolute;
|
|
361
361
|
transform: translate(-50%, -50%);
|
|
362
362
|
white-space: nowrap;
|
|
363
|
-
`,u}function
|
|
363
|
+
`,u}function qh(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,w=i%h/h,y=w<.5?2*w*w:-1+(4-2*w)*w,m=(c=s.x_offset)!=null?c:0,b=(f=s.y_offset)!=null?f:0,g=(p=s.animation_range)!=null?p:40,x=g*.7,E=g,A=t.x+m+x,C=t.y+b+E,T=A+x,L=C+E;e.position.set(A+(T-A)*y,C+(L-C)*y,0);let _=(u=o.scale)!=null?u:.1875,I=(v=s.hand_scale_multiplier)!=null?v:2.5,z=_*I*100;e.scale.set(z,z,1)}}var Bi=Ge(require("three"),1),Gh=new Bi.TextureLoader,Uo=null,qo=null;async function Wh(){if(Uo)return Uo;if(!qo){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"})();qo=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 qo;return Uo=e||{},e||{}}async function Go(e,t,i=16777215,n=!1){try{let a=(await Wh())[e];return await Gh.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 Yh(e,t,i){var h,w;let r=(await Wh())[e]||e,a;try{a=await Gh.loadAsync(r),console.log("[character] loaded sheet",{path:e,sourceUsed:r})}catch(y){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:y})}if(!a)return[];let s=i.gameplay.character_sheet||{},o=(h=s.cols)!=null?h:3,d=(w=s.rows)!=null?w: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 y=0;y<d;y++)for(let m=0;m<o;m++){let b=document.createElement("canvas");b.width=p,b.height=u;let g=b.getContext("2d");g&&l&&g.drawImage(l,m*p,y*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 Vh(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});
|