PageSourceSearch

https://app.marketingevolution.com/assets/DashboardView-DFKNlqEN.js

js marketingevolution.com collected 2026-09-24 15:23:05 UTC 359,400 bytes, 2,028 lines download raw bytes

1import{q as ve,t as At}from"./@mui/system-B6wAwYdQ.js";import{bc as hr,ba as pr,bf as mr,bd as gr,be as vr,bg as yr,bb as br}from"./app-design-system-DtaKcdW2.js";import{m as _r}from"./index-DGoP0GGw.js";import{g as wr,J as Er}from"./@mui/material-BYB1fIha.js";import"./libphonenumber-js-FniRj3IU.js";import"./aws-amplify-6dlz1eh8.js";import"./app-foundation-kKDrgwPr.js";import"./@mui/x-date-pickers-pro-BtcfQAzC.js";import"./apexcharts-CMCMsJKb.js";import"./@mui/x-data-grid-pro-CSWJl3TV.js";import"./@react-awesome-query-builder/mui-DqHwnbb5.js";import"./echarts-BxdhZ3Bo.js";import"./react-leaflet-Bjtm3UlO.js";import"./xlsx-DFH0qU2H.js";import"./@tshepomgaga/aws-sfn-graph-DB1I8jVl.js";const xr=async l=>{const k=await fetch(l,{mode:"cors",cache:"reload"});if(!k.ok)throw new Error(`Failed to fetch image (status ${k.status})`);const i=k.headers.get("content-type")??"application/octet-stream",h=await k.arrayBuffer();return{data:new Uint8Array(h),contentType:i}},Ar=({data:l,contentType:k})=>{let i="";for(let d=0;d<l.length;d+=32768){const n=l.subarray(d,d+32768);i+=String.fromCharCode(...n)}return`data:${k};base64,${btoa(i)}`};var Sr=Object.create,Bt=Object.defineProperty,Tr=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyNames,Cr=Object.getPrototypeOf,Or=Object.prototype.hasOwnProperty,Pt=(l,k)=>()=>(l&&(k=l(l=0)),k),se=(l,k)=>()=>(k||(l((k={exports:{}}).exports,k),l=null),k.exports),Rr=(l,k,i,h)=>{if(k&&typeof k=="object"||typeof k=="function")for(var d=kr(k),n=0,a=d.length,r;n<a;n++)r=d[n],!Or.call(l,r)&&r!==i&&Bt(l,r,{get:(f=>k[f]).bind(null,r),enumerable:!(h=Tr(k,r))||h.enumerable});return l},dt=(l,k,i)=>(i=l!=null?Sr(Cr(l)):{},Rr(Bt(i,"default",{value:l,enumerable:!0}),l)),Je=(l=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(l,{get:(k,i)=>(typeof require<"u"?require:k)[i]}):l)(function(l){if(typeof require<"u")return require.apply(this,arguments);throw Error('Calling `require` for "'+l+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function He(l){"@babel/helpers - typeof";return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},He(l)}function Nr(l,k){if(He(l)!="object"||!l)return l;var i=l[Symbol.toPrimitive];if(i!==void 0){var h=i.call(l,k);if(He(h)!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(l)}function Ir(l){var k=Nr(l,"string");return He(k)=="symbol"?k:k+""}function Te(l,k,i){return(k=Ir(k))in l?Object.defineProperty(l,k,{value:i,enumerable:!0,configurable:!0,writable:!0}):l[k]=i,l}var lt=class{constructor(l){Te(this,"rootKey",void 0),this.rootKey=l}},Dr=Object.seal({}),Lt=class extends lt{constructor(l){super(l),Te(this,"root",void 0),this.root=new Array}prepForXml(l){var k;l.stack.push(this);const i=this.root.map(h=>h instanceof lt?h.prepForXml(l):h).filter(h=>h!==void 0);return l.stack.pop(),{[this.rootKey]:i.length?i.length===1&&(!((k=i[0])===null||k===void 0)&&k._attr)?i[0]:i:Dr}}addChildElement(l){return this.root.push(l),this}};function St(l,k){var i=Object.keys(l);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(l);k&&(h=h.filter(function(d){return Object.getOwnPropertyDescriptor(l,d).enumerable})),i.push.apply(i,h)}return i}function Pe(l){for(var k=1;k<arguments.length;k++){var i=arguments[k]!=null?arguments[k]:{};k%2?St(Object(i),!0).forEach(function(h){Te(l,h,i[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(i)):St(Object(i)).forEach(function(h){Object.defineProperty(l,h,Object.getOwnPropertyDescriptor(i,h))})}return l}var Fr=class extends lt{constructor(l){super("_attr"),Te(this,"root",void 0),this.root=l}prepForXml(l){return{_attr:Object.values(this.root).filter(({value:k})=>k!==void 0).reduce((k,{key:i,value:h})=>Pe(Pe({},k),{},{[i]:h}),{})}}},ht=se(((l,k)=>{var i=typeof Reflect=="object"?Reflect:null,h=i&&typeof i.apply=="function"?i.apply:function(D,U,w){return Function.prototype.apply.call(D,U,w)},d;i&&typeof i.ownKeys=="function"?d=i.ownKeys:Object.getOwnPropertySymbols?d=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:d=function(D){return Object.getOwnPropertyNames(D)};function n(c){console&&console.warn&&console.warn(c)}var a=Number.isNaN||function(D){return D!==D};function r(){r.init.call(this)}k.exports=r,k.exports.once=_,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var f=10;function R(c){if(typeof c!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof c)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(c){if(typeof c!="number"||c<0||a(c))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+c+".");f=c}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||a(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function C(c){return c._maxListeners===void 0?r.defaultMaxListeners:c._maxListeners}r.prototype.getMaxListeners=function(){return C(this)},r.prototype.emit=function(D){for(var U=[],w=1;w<arguments.length;w++)U.push(arguments[w]);var q=D==="error",Q=this._events;if(Q!==void 0)q=q&&Q.error===void 0;else if(!q)return!1;if(q){var I;if(U.length>0&&(I=U[0]),I instanceof Error)throw I;var W=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw W.context=I,W}var E=Q[D];if(E===void 0)return!1;if(typeof E=="function")h(E,this,U);else for(var H=E.length,J=S(E,H),w=0;w<H;++w)h(J[w],this,U);return!0};function A(c,D,U,w){var q,Q,I;if(R(U),Q=c._events,Q===void 0?(Q=c._events=Object.create(null),c._eventsCount=0):(Q.newListener!==void 0&&(c.emit
1("newListener",D,U.listener?U.listener:U),Q=c._events),I=Q[D]),I===void 0)I=Q[D]=U,++c._eventsCount;else if(typeof I=="function"?I=Q[D]=w?[U,I]:[I,U]:w?I.unshift(U):I.push(U),q=C(c),q>0&&I.length>q&&!I.warned){I.warned=!0;var W=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");W.name="MaxListenersExceededWarning",W.emitter=c,W.type=D,W.count=I.length,n(W)}return c}r.prototype.addListener=function(D,U){return A(this,D,U,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(D,U){return A(this,D,U,!0)};function N(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(c,D,U){var w={fired:!1,wrapFn:void 0,target:c,type:D,listener:U},q=N.bind(w);return q.listener=U,w.wrapFn=q,q}r.prototype.once=function(D,U){return R(U),this.on(D,p(this,D,U)),this},r.prototype.prependOnceListener=function(D,U){return R(U),this.prependListener(D,p(this,D,U)),this},r.prototype.removeListener=function(D,U){var w,q,Q,I,W;if(R(U),q=this._events,q===void 0)return this;if(w=q[D],w===void 0)return this;if(w===U||w.listener===U)--this._eventsCount===0?this._events=Object.create(null):(delete q[D],q.removeListener&&this.emit("removeListener",D,w.listener||U));else if(typeof w!="function"){for(Q=-1,I=w.length-1;I>=0;I--)if(w[I]===U||w[I].listener===U){W=w[I].listener,Q=I;break}if(Q<0)return this;Q===0?w.shift():O(w,Q),w.length===1&&(q[D]=w[0]),q.removeListener!==void 0&&this.emit("removeListener",D,W||U)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(D){var U,w=this._events,q;if(w===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete w[D]),this;if(arguments.length===0){var Q=Object.keys(w),I;for(q=0;q<Q.length;++q)I=Q[q],I!=="removeListener"&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(U=w[D],typeof U=="function")this.removeListener(D,U);else if(U!==void 0)for(q=U.length-1;q>=0;q--)this.removeListener(D,U[q]);return this};function m(c,D,U){var w=c._events;if(w===void 0)return[];var q=w[D];return q===void 0?[]:typeof q=="function"?U?[q.listener||q]:[q]:U?v(q):S(q,q.length)}r.prototype.listeners=function(D){return m(this,D,!0)},r.prototype.rawListeners=function(D){return m(this,D,!1)},r.listenerCount=function(c,D){return typeof c.listenerCount=="function"?c.listenerCount(D):g.call(c,D)},r.prototype.listenerCount=g;function g(c){var D=this._events;if(D!==void 0){var U=D[c];if(typeof U=="function")return 1;if(U!==void 0)return U.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?d(this._events):[]};function S(c,D){for(var U=new Array(D),w=0;w<D;++w)U[w]=c[w];return U}function O(c,D){for(;D+1<c.length;D++)c[D]=c[D+1];c.pop()}function v(c){for(var D=new Array(c.length),U=0;U<D.length;++U)D[U]=c[U].listener||c[U];return D}function _(c,D){return new Promise(function(U,w){function q(I){c.removeListener(D,Q),w(I)}function Q(){typeof c.removeListener=="function"&&c.removeListener("error",q),U([].slice.call(arguments))}b(c,D,Q,{once:!0}),D!=="error"&&x(c,q,{once:!0})})}function x(c,D,U){typeof c.on=="function"&&b(c,"error",D,U)}function b(c,D,U,w){if(typeof c.on=="function")w.once?c.once(D,U):c.on(D,U);else if(typeof c.addEventListener=="function")c.addEventListener(D,function q(Q){w.once&&c.removeEventListener(D,q),U(Q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof c)}})),Ce=se(((l,k)=>{typeof Object.create=="function"?k.exports=function(h,d){d&&(h.super_=d,h.prototype=Object.create(d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}))}:k.exports=function(h,d){if(d){h.super_=d;var n=function(){};n.prototype=d.prototype,h.prototype=new n,h.prototype.constructor=h}}})),ye,Me=Pt((()=>{ye=globalThis||self}));
1function Br(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function ut(){throw new Error("setTimeout has not been defined")}function ct(){throw new Error("clearTimeout has not been defined")}function Mt(l){if(_e===setTimeout)return setTimeout(l,0);if((_e===ut||!_e)&&setTimeout)return _e=setTimeout,setTimeout(l,0);try{return _e(l,0)}catch{try{return _e.call(null,l,0)}catch{return _e.call(this,l,0)}}}function Pr(l){if(we===clearTimeout)return clearTimeout(l);if((we===ct||!we)&&clearTimeout)return we=clearTimeout,clearTimeout(l);try{return we(l)}catch{try{return we.call(null,l)}catch{return we.call(this,l)}}}function Lr(){!Ne||!Re||(Ne=!1,Re.length?Ee=Re.concat(Ee):qe=-1,Ee.length&&Ut())}function Ut(){if(!Ne){var l=Mt(Lr);Ne=!0;for(var k=Ee.length;k;){for(Re=Ee,Ee=[];++qe<k;)Re&&Re[qe].run();qe=-1,k=Ee.length}Re=null,Ne=!1,Pr(l)}}function Tt(l,k){this.fun=l,this.array=k}function Se(){}var nt,pe,_e,we,Ee,Ne,Re,qe,kt,de,Oe=Pt((()=>{nt={exports:{}},pe=nt.exports={},(function(){try{typeof setTimeout=="function"?_e=setTimeout:_e=ut}catch{_e=ut}try{typeof clearTimeout=="function"?we=clearTimeout:we=ct}catch{we=ct}})(),Ee=[],Ne=!1,qe=-1,pe.nextTick=function(l){var k=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)k[i-1]=arguments[i];Ee.push(new Tt(l,k)),Ee.length===1&&!Ne&&Mt(Ut)},Tt.prototype.run=function(){this.fun.apply(null,this.array)},pe.title="browser",pe.browser=!0,pe.env={},pe.argv=[],pe.version="",pe.versions={},pe.on=Se,pe.addListener=Se,pe.once=Se,pe.off=Se,pe.removeListener=Se,pe.removeAllListeners=Se,pe.emit=Se,pe.prependListener=Se,pe.prependOnceListener=Se,pe.listeners=function(l){return[]},pe.binding=function(l){throw new Error("process.binding is not supported")},pe.cwd=function(){return"/"},pe.chdir=function(l){throw new Error("process.chdir is not supported")},pe.umask=function(){return 0},kt=nt.exports,de=Br(kt)})),jt=se(((l,k)=>{k.exports=ht().EventEmitter})),Mr=se((l=>{l.byteLength=f,l.toByteArray=C,l.fromByteArray=p;for(var k=[],i=[],h=typeof Uint8Array<"u"?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=d.length;n<a;++n)k[n]=d[n],i[d.charCodeAt(n)]=n;i[45]=62,i[95]=63;function r(m){var g=m.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=m.indexOf("=");S===-1&&(S=g);var O=S===g?0:4-S%4;return[S,O]}function f(m){var g=r(m),S=g[0],O=g[1];return(S+O)*3/4-O}function R(m,g,S){return(g+S)*3/4-S}function C(m){var g,S=r(m),O=S[0],v=S[1],_=new h(R(m,O,v)),x=0,b=v>0?O-4:O,c;for(c=0;c<b;c+=4)g=i[m.charCodeAt(c)]<<18|i[m.charCodeAt(c+1)]<<12|i[m.charCodeAt(c+2)]<<6|i[m.charCodeAt(c+3)],_[x++]=g>>16&255,_[x++]=g>>8&255,_[x++]=g&255;return v===2&&(g=i[m.charCodeAt(c)]<<2|i[m.charCodeAt(c+1)]>>4,_[x++]=g&255),v===1&&(g=i[m.charCodeAt(c)]<<10|i[m.charCodeAt(c+1)]<<4|i[m.charCodeAt(c+2)]>>2,_[x++]=g>>8&255,_[x++]=g&255),_}function A(m){return k[m>>18&63]+k[m>>12&63]+k[m>>6&63]+k[m&63]}function N(m,g,S){for(var O,v=[],_=g;_<S;_+=3)O=(m[_]<<16&16711680)+(m[_+1]<<8&65280)+(m[_+2]&255),v.push(A(O));return v.join("")}function p(m){for(var g,S=m.length,O=S%3,v=[],_=16383,x=0,b=S-O;x<b;x+=_)v.push(N(m,x,x+_>b?b:x+_));return O===1?(g=m[S-1],v.push(k[g>>2]+k[g<<4&63]+"==")):O===2&&(g=(m[S-2]<<8)+m[S-1],v.push(k[g>>10]+k[g>>4&63]+k[g<<2&63]+"=")),v.join("")}})),Ur=se((l=>{l.read=function(k,i,h,d,n){var a,r,f=n*8-d-1,R=(1<<f)-1,C=R>>1,A=-7,N=h?n-1:0,p=h?-1:1,m=k[i+N];for(N+=p,a=m&(1<<-A)-1,m>>=-A,A+=f;A>0;a=a*256+k[i+N],N+=p,A-=8);for(r=a&(1<<-A)-1,a>>=-A,A+=d;A>0;r=r*256+k[i+N],N+=p,A-=8);if(a===0)a=1-C;else{if(a===R)return r?NaN:(m?-1:1)*(1/0);r=r+Math.pow(2,d),a=a-C}return(m?-1:1)*r*Math.pow(2,a-d)},l.write=function(k,i,h,d,n,a){var r,f,R,C=a*8-n-1,A=(1<<C)-1,N=A>>1,p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=d?0:a-1,g=d?1:-1,S=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(f=isNaN(i)?1:0,r=A):(r=Math.floor(Math.log(i)/Math.LN2),i*(R=Math.pow(2,-r))<1&&(r--,R*=2),r+N>=1?i+=p/R:i+=p*Math.pow(2,1-N),i*R>=2&&(r++,R/=2),r+N>=A?(f=0,r=A):r+N>=1?(f=(i*R-1)*Math.pow(2,n),r=r+N):(f=i*Math.pow(2,N-1)*Math.pow(2,n),r=0));n>=8;k[h+m]=f&255,m+=g,f/=256,n-=8);for(r=r<<n|f,C+=n;C>0;k[h+m]=r&255,m+=g,r/=256,C-=8);k[h+m-g]|=S*128}}));var Qe=se((l=>{var k=Mr(),i=Ur(),h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;l.Buffer=r,l.SlowBuffer=v,l.INSPECT_MAX_BYTES=50;var d=2147483647;l.kMaxLength=d,r.TYPED_ARRAY_SUPPORT=n(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function n(){try{var T=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(T,e),T.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function a(T){if(T>
vendor: 18,036 bytes, line 1
1d)throw new RangeError('The value "'+T+'" is invalid for option "size"');var e=new Uint8Array(T);return Object.setPrototypeOf(e,r.prototype),e}function r(T,e,t){if(typeof T=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return A(T)}return f(T,e,t)}r.poolSize=8192;function f(T,e,t){if(typeof T=="string")return N(T,e);if(ArrayBuffer.isView(T))return m(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(P(T,ArrayBuffer)||T&&P(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(P(T,SharedArrayBuffer)||T&&P(T.buffer,SharedArrayBuffer)))return g(T,e,t);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var u=T.valueOf&&T.valueOf();if(u!=null&&u!==T)return r.from(u,e,t);var L=S(T);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return r.from(T[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}r.from=function(T,e,t){return f(T,e,t)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function R(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function C(T,e,t){return R(T),T<=0?a(T):e!==void 0?typeof t=="string"?a(T).fill(e,t):a(T).fill(e):a(T)}r.alloc=function(T,e,t){return C(T,e,t)};function A(T){return R(T),a(T<0?0:O(T)|0)}r.allocUnsafe=function(T){return A(T)},r.allocUnsafeSlow=function(T){return A(T)};function N(T,e){if((typeof e!="string"||e==="")&&(e="utf8"),!r.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=_(T,e)|0,u=a(t),L=u.write(T,e);return L!==t&&(u=u.slice(0,L)),u}function p(T){for(var e=T.length<0?0:O(T.length)|0,t=a(e),u=0;u<e;u+=1)t[u]=T[u]&255;return t}function m(T){if(P(T,Uint8Array)){var e=new Uint8Array(T);return g(e.buffer,e.byteOffset,e.byteLength)}return p(T)}function g(T,e,t){if(e<0||T.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var u;return e===void 0&&t===void 0?u=new Uint8Array(T):t===void 0?u=new Uint8Array(T,e):u=new Uint8Array(T,e,t),Object.setPrototypeOf(u,r.prototype),u}function S(T){if(r.isBuffer(T)){var e=O(T.length)|0,t=a(e);return t.length===0||T.copy(t,0,0,e),t}if(T.length!==void 0)return typeof T.length!="number"||o(T.length)?a(0):p(T);if(T.type==="Buffer"&&Array.isArray(T.data))return p(T.data)}function O(T){if(T>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return T|0}function v(T){return+T!=T&&(T=0),r.alloc(+T)}r.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==r.prototype},r.compare=function(e,t){if(P(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),P(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var u=e.length,L=t.length,G=0,z=Math.min(u,L);G<z;++G)if(e[G]!==t[G]){u=e[G],L=t[G];break}return u<L?-1:L<u?1:0},r.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return r.alloc(0);var u;if(t===void 0)for(t=0,u=0;u<e.length;++u)t+=e[u].length;var L=r.allocUnsafe(t),G=0;for(u=0;u<e.length;++u){var z=e[u];if(P(z,Uint8Array))G+z.length>L.length?r.from(z).copy(L,G):Uint8Array.prototype.set.call(L,z,G);else if(r.isBuffer(z))z.copy(L,G);else throw new TypeError('"list" argument must be an Array of Buffers');G+=z.length}return L};function _(T,e){if(r.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||P(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);var t=T.length,u=arguments.length>2&&arguments[2]===!0;if(!u&&t===0)return 0;for(var L=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return s(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return re(T).length;default:if(L)return u?-1:s(T).length;e=(""+e).toLowerCase(),L=!0}}r.byteLength=_;function x(T,e,t){var u=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(T||(T="utf8");;)switch(T){case"hex":return $(this,e,t);case"utf8":case"utf-8":return E(this,e,t);case"ascii":return Y(this,e,t);case"latin1":case"binary":return ae(this,e,t);case"base64":return W(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,e,t);default:if(u)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),u=!0}}r.prototype._isBuffer=!0;function b(T,e,t){var u=T[e];T[e]=T[t],T[t]=u}r.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)b(this,t,t+1);return this},r.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},r.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},r.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?E(this,0,e):x.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:r.compare(this,e)===0},r.prototype.inspect=function(){var e="",t=l.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},h&&(r.prototype[h]=r.prototype.inspect),r.prototype.compare=function(e,t,u,L,G){if(P(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),!r.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),u===void 0&&(u=e?e.length:0),L===void 0&&(L=0),G===void 0&&(G=this.length),t<0||u>e.length||L<0||G>this.length)throw new RangeError("out of range index");if(L>=G&&t>=u)return 0;if(L>=G)return-1;if(t>=u)return 1;if(t>>>=0,u>>>=0,L>>>=0,G>>>=0,this===e)return 0;for(var z=G-L,ne=u-t,oe=Math.min(z,ne),ie=this.slice(L,G),le=e.slice(t,u),ce=0;ce<oe;++ce)if(ie[ce]!==le[ce]){z=ie[ce],ne=le[ce];break}return z<ne?-1:ne<z?1:0};function c(T,e,t,u,L){if(T.length===0)return-1;if(typeof t=="string"?(u=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,o(t)&&(t=L?0:T.length-1),t<0&&(t=T.length+t),t>=T.length){if(L)return-1;t=T.length-1}else if(t<0)if(L)t=0;else return-1;if(typeof e=="string"&&(e=r.from(e,u)),r.isBuffer(e))return e.length===0?-1:D(T,e,t,u,L);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(T,e,t):Uint8Array.prototype.lastIndexOf.call(T,e,t):D(T,[e],t,u,L);throw new TypeError("val must be string, number or Buffer")}function D(T,e,t,u,L){var G=1,z=T.length,ne=e.length;if(u!==void 0&&(u=String(u).toLowerCase(),u==="ucs2"||u==="ucs-2"||u==="utf16le"||u==="utf-16le")){if(T.length<2||e.length<2)return-1;G=2,z/=2,ne/=2,t/=2}function oe(ge,ke){return G===1?ge[ke]:ge.readUInt16BE(ke*G)}var ie;if(L){var le=-1;for(ie=t;ie<z;ie++)if(oe(T,ie)===oe(e,le===-1?0:ie-le)){if(le===-1&&(le=ie),ie-le+1===ne)return le*G}else le!==-1&&(ie-=ie-le),le=-1}else for(t+ne>z&&(t=z-ne),ie=t;ie>=0;ie--){for(var ce=!0,fe=0;fe<ne;fe++)if(oe(T,ie+fe)!==oe(e,fe)){ce=!1;break}if(ce)return ie}return-1}r.prototype.includes=function(e,t,u){return this.indexOf(e,t,u)!==-1},r.prototype.indexOf=function(e,t,u){return c(this,e,t,u,!0)},r.prototype.lastIndexOf=function(e,t,u){return c(this,e,t,u,!1)};function U(T,e,t,u){t=Number(t)||0;var L=T.length-t;u?(u=Number(u),u>L&&(u=L)):u=L;var G=e.length;u>G/2&&(u=G/2);for(var z=0;z<u;++z){var ne=parseInt(e.substr(z*2,2),16);if(o(ne))return z;T[t+z]=ne}return z}function w(T,e,t,u){return B(s(e,T.length-t),T,t,u)}function q(T,e,t,u){return B(j(e),T,t,u)}function Q(T,e,t,u){return B(re(e),T,t,u)}function I(T,e,t,u){return B(M(e,T.length-t),T,t,u)}r.prototype.write=function(e,t,u,L){if(t===void 0)L="utf8",u=this.length,t=0;else if(u===void 0&&typeof t=="string")L=t,u=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(u)?(u=u>>>0,L===void 0&&(L="utf8")):(L=u,u=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var G=this.length-t;if((u===void 0||u>G)&&(u=G),e.length>0&&(u<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");L||(L="utf8");for(var z=!1;;)switch(L){case"hex":return U(this,e,t,u);case"utf8":case"utf-8":return w(this,e,t,u);case"ascii":case"latin1":case"binary":return q(this,e,t,u);case"base64":return Q(this,e,t,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,u);default:if(z)throw new TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),z=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function W(T,e,t){return e===0&&t===T.length?k.fromByteArray(T):k.fromByteArray(T.slice(e,t))}function E(T,e,t){t=Math.min(T.length,t);for(var u=[],L=e;L<t;){var G=T[L],z=null,ne=G>239?4:G>223?3:G>191?2:1;if(L+ne<=t){var oe,ie,le,ce;switch(ne){case 1:G<128&&(z=G);break;case 2:oe=T[L+1],(oe&192)===128&&(ce=(G&31)<<6|oe&63,ce>127&&(z=ce));break;case 3:oe=T[L+1],ie=T[L+2],(oe&192)===128&&(ie&192)===128&&(ce=(G&15)<<12|(oe&63)<<6|ie&63,ce>2047&&(ce<55296||ce>57343)&&(z=ce));break;case 4:oe=T[L+1],ie=T[L+2],le=T[L+3],(oe&192)===128&&(ie&192)===128&&(le&192)===128&&(ce=(G&15)<<18|(oe&63)<<12|(ie&63)<<6|le&63,ce>65535&&ce<1114112&&(z=ce))}}z===null?(z=65533,ne=1):z>65535&&(z-=65536,u.push(z>>>10&1023|55296),z=56320|z&1023),u.push(z),L+=ne}return J(u)}var H=4096;function J(T){var e=T.length;if(e<=H)return String.fromCharCode.apply(String,T);for(var t="",u=0;u<e;)t+=String.fromCharCode.apply(String,T.slice(u,u+=H));return t}function Y(T,e,t){var u="";t=Math.min(T.length,t);for(var L=e;L<t;++L)u+=String.fromCharCode(T[L]&127);return u}function ae(T,e,t){var u="";t=Math.min(T.length,t);for(var L=e;L<t;++L)u+=String.fromCharCode(T[L]);return u}function $(T,e,t){var u=T.length;(!e||e<0)&&(e=0),(!t||t<0||t>u)&&(t=u);for(var L="",G=e;G<t;++G)L+=K[T[G]];return L}function ee(T,e,t){for(var u=T.slice(e,t),L="",G=0;G<u.length-1;G+=2)L+=String.fromCharCode(u[G]+u[G+1]*256);return L}r.prototype.slice=function(e,t){var u=this.length;e=~~e,t=t===void 0?u:~~t,e<0?(e+=u,e<0&&(e=0)):e>u&&(e=u),t<0?(t+=u,t<0&&(t=0)):t>u&&(t=u),t<e&&(t=e);var L=this.subarray(e,t);return Object.setPrototypeOf(L,r.prototype),L};function V(T,e,t){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+e>t)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(e,t,u){e=e>>>0,t=t>>>0,u||V(e,t,this.length);for(var L=this[e],G=1,z=0;++z<t&&(G*=256);)L+=this[e+z]*G;return L},r.prototype.readUintBE=r.prototype.readUIntBE=function(e,t,u){e=e>>>0,t=t>>>0,u||V(e,t,this.length);for(var L=this[e+--t],G=1;t>0&&(G*=256);)L+=this[e+--t]*G;return L},r.prototype.readUint8=r.prototype.readUInt8=function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||V(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||V(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||V(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,u){e=e>>>0,t=t>>>0,u||V(e,t,this.length);for(var L=this[e],G=1,z=0;++z<t&&(G*=256);)L+=this[e+z]*G;return G*=128,L>=G&&(L-=Math.pow(2,8*t)),L},r.prototype.readIntBE=function(e,t,u){e=e>>>0,t=t>>>0,u||V(e,t,this.length);for(var L=t,G=1,z=this[e+--L];L>0&&(G*=256);)z+=this[e+--L]*G;return G*=128,z>=G&&(z-=Math.pow(2,8*t)),z},r.prototype.readInt8=function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},r.prototype.readInt16LE=function(e,t){e=e>>>0,t||V(e,2,this.length);var u=this[e]|this[e+1]<<8;return u&32768?u|4294901760:u},r.prototype.readInt16BE=function(e,t){e=e>>>0,t||V(e,2,this.length);var u=this[e+1]|this[e]<<8;return u&32768?u|4294901760:u},r.prototype.readInt32LE=function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return e=e>>>0,t||V(e,4,this.length),i.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return e=e>>>0,t||V(e,4,this.length),i.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||V(e,8,this.length),i.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||V(e,8,this.length),i.read(this,e,!1,52,8)};function F(T,e,t,u,L,G){if(!r.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>L||e<G)throw new RangeError('"value" argument is out of bounds');if(t+u>T.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(e,t,u,L){if(e=+e,t=t>>>0,u=u>>>0,!L){var G=Math.pow(2,8*u)-1;F(this,e,t,u,G,0)}var z=1,ne=0;for(this[t]=e&255;++ne<u&&(z*=256);)this[t+ne]=e/z&255;return t+u},r.prototype.writeUintBE=r.prototype.writeUIntBE=function(e,t,u,L){if(e=+e,t=t>>>0,u=u>>>0,!L){var G=Math.pow(2,8*u)-1;F(this,e,t,u,G,0)}var z=u-1,ne=1;for(this[t+z]=e&255;--z>=0&&(ne*=256);)this[t+z]=e/ne&255;return t+u},r.prototype.writeUint8=r.prototype.writeUInt8=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,1,255,0),this[t]=e&255,t+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},r.prototype.writeIntLE=function(e,t,u,L){if(e=+e,t=t>>>0,!L){var G=Math.pow(2,8*u-1);F(this,e,t,u,G-1,-G)}var z=0,ne=1,oe=0;for(this[t]=e&255;++z<u&&(ne*=256);)e<0&&oe===0&&this[t+z-1]!==0&&(oe=1),this[t+z]=(e/ne>>0)-oe&255;return t+u},r.prototype.writeIntBE=function(e,t,u,L){if(e=+e,t=t>>>0,!L){var G=Math.pow(2,8*u-1);F(this,e,t,u,G-1,-G)}var z=u-1,ne=1,oe=0;for(this[t+z]=e&255;--z>=0&&(ne*=256);)e<0&&oe===0&&this[t+z+1]!==0&&(oe=1),this[t+z]=(e/ne>>0)-oe&255;return t+u},r.prototype.writeInt8=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},r.prototype.writeInt16LE=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},r.prototype.writeInt16BE=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},r.prototype.writeInt32LE=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},r.prototype.writeInt32BE=function(e,t,u){return e=+e,t=t>>>0,u||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Z(T,e,t,u,L,G){if(t+u>T.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function X(T,e,t,u,L){return e=+e,t=t>>>0,L||Z(T,e,t,4),i.write(T,e,t,u,23,4),t+4}r.prototype.writeFloatLE=function(e,t,u){return X(this,e,t,!0,u)},r.prototype.writeFloatBE=function(e,t,u){return X(this,e,t,!1,u)};function te(T,e,t,u,L){return e=+e,t=t>>>0,L||Z(T,e,t,8),i.write(T,e,t,u,52,8),t+8}r.prototype.writeDoubleLE=function(e,t,u){return te(this,e,t,!0,u)},r.prototype.writeDoubleBE=function(e,t,u){return te(this,e,t,!1,u)},r.prototype.copy=function(e,t,u,L){if(!r.isBuffer(e))throw new TypeError("argument should be a Buffer");if(u||(u=0),!L&&L!==0&&(L=this.length),t>=e.length&&(t=e.length),t||(t=0),L>0&&L<u&&(L=u),L===u||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(u<0||u>=this.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("sourceEnd out of bounds");L>this.length&&(L=this.length),e.length-t<L-u&&(L=e.length-t+u);var G=L-u;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,u,L):Uint8Array.prototype.set.call(e,this.subarray(u,L),t),G},r.prototype.fill=function(e,t,u,L){if(typeof e=="string"){if(typeof t=="string"?(L=t,t=0,u=this.length):typeof u=="string"&&(L=u,u=this.length),L!==void 0&&typeof L!="str
1ing")throw new TypeError("encoding must be a string");if(typeof L=="string"&&!r.isEncoding(L))throw new TypeError("Unknown encoding: "+L);if(e.length===1){var G=e.charCodeAt(0);(L==="utf8"&&G<128||L==="latin1")&&(e=G)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<u)throw new RangeError("Out of range index");if(u<=t)return this;t=t>>>0,u=u===void 0?this.length:u>>>0,e||(e=0);var z;if(typeof e=="number")for(z=t;z<u;++z)this[z]=e;else{var ne=r.isBuffer(e)?e:r.from(e,L),oe=ne.length;if(oe===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(z=0;z<u-t;++z)this[z+t]=ne[z%oe]}return this};var ue=/[^+/0-9A-Za-z-_]/g;function y(T){if(T=T.split("=")[0],T=T.trim().replace(ue,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function s(T,e){e=e||1/0;for(var t,u=T.length,L=null,G=[],z=0;z<u;++z){if(t=T.charCodeAt(z),t>55295&&t<57344){if(!L){if(t>56319){(e-=3)>-1&&G.push(239,191,189);continue}else if(z+1===u){(e-=3)>-1&&G.push(239,191,189);continue}L=t;continue}if(t<56320){(e-=3)>-1&&G.push(239,191,189),L=t;continue}t=(L-55296<<10|t-56320)+65536}else L&&(e-=3)>-1&&G.push(239,191,189);if(L=null,t<128){if((e-=1)<0)break;G.push(t)}else if(t<2048){if((e-=2)<0)break;G.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;G.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;G.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return G}function j(T){for(var e=[],t=0;t<T.length;++t)e.push(T.charCodeAt(t)&255);return e}function M(T,e){for(var t,u,L,G=[],z=0;z<T.length&&!((e-=2)<0);++z)t=T.charCodeAt(z),u=t>>8,L=t%256,G.push(L),G.push(u);return G}function re(T){return k.toByteArray(y(T))}function B(T,e,t,u){for(var L=0;L<u&&!(L+t>=e.length||L>=T.length);++L)e[L+t]=T[L];return L}function P(T,e){return T instanceof e||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===e.name}function o(T){return T!==T}var K=(function(){for(var T="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var u=t*16,L=0;L<16;++L)e[u+L]=T[t]+T[L];return e})()})),zt=se(((l,k)=>{k.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var h={},d=Symbol("test"),n=Object(d);if(typeof d=="string"||Object.prototype.toString.call(d)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;h[d]=a;for(var r in h)return!1;if(typeof Object.keys=="function"&&Object.keys(h).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(h).length!==0)return!1;var f=Object.getOwnPropertySymbols(h);if(f.length!==1||f[0]!==d||!Object.prototype.propertyIsEnumerable.call(h,d))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var R=Object.getOwnPropertyDescriptor(h,d);if(R.value!==a||R.enumerable!==!0)return!1}return!0}})),pt=se(((l,k)=>{var i=zt();k.exports=function(){return i()&&!!Symbol.toStringTag}})),Wt=se(((l,k)=>{k.exports=Object})),jr=se(((l,k)=>{k.exports=Error})),zr=se(((l,k)=>{k.exports=EvalError})),Wr=se(((l,k)=>{k.exports=RangeError})),qr=se(((l,k)=>{k.exports=ReferenceError})),qt=se(((l,k)=>{k.exports=SyntaxError})),et=se(((l,k)=>{k.exports=TypeError})),Hr=se(((l,k)=>{k.exports=URIError})),Gr=se(((l,k)=>{k.exports=Math.abs})),Kr=se(((l,k)=>{k.exports=Math.floor})),Vr=se(((l,k)=>{k.exports=Math.max})),Yr=se(((l,k)=>{k.exports=Math.min})),Zr=se(((l,k)=>{k.exports=Math.pow})),$r=se(((l,k)=>{k.exports=Math.round})),Xr=se(((l,k)=>{k.exports=Number.isNaN||function(h){return h!==h}})),Jr=se(((l,k)=>{var i=Xr();k.exports=function(d){return i(d)||d===0?d:d<0?-1:1}})),Qr=se(((l,k)=>{k.exports=Object.getOwnPropertyDescriptor})),Ge=se(((l,k)=>{var i=Qr();if(i)try{i([],"length")}catch{i=null}k.exports=i})),tt=se(((l,k)=>{var i=Object.defineProperty||!1;if(i)try{i({},"a",{value:1})}catch{i=!1}k.exports=i})),en=se(((l,k)=>{var i=typeof Symbol<"u"&&Symbol,h=zt();k.exports=function(){return typeof i!="function"||typeof Symbol!="function"||typeof i("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:h()}})),Ht=se(((l,k)=>{k.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null})),Gt=se(((l,k)=>{k.exports=Wt().getPrototypeOf||null})),tn=se(((l,k)=>{var i="Function.prototype.bind called on incompatible ",h=Object.prototype.toString,d=Math.max,n="[object Function]",a=function(C,A){for(var N=[],p=0;p<C.length;p+=1)N[p]=C[p];for(var m=0;m<A.length;m+=1)N[m+C.length]=A[m];return N},r=function(C,A){for(var N=[],p=A,m=0;p<C.length;p+=1,m+=1)N[m]=C[p];return N},f=function(R,C){for(var A="",N=0;N<R.length;N+=1)A+=R[N],N+1<R.length&&(A+=C);return A};k.exports=function(C){var A=this;if(typeof A!="function"||h.apply(A)!==n)throw new TypeError(i+A);
1for(var N=r(arguments,1),p,m=function(){if(this instanceof p){var _=A.apply(this,a(N,arguments));return Object(_)===_?_:this}return A.apply(C,a(N,arguments))},g=d(0,A.length-N.length),S=[],O=0;O<g;O++)S[O]="$"+O;if(p=Function("binder","return function ("+f(S,",")+"){ return binder.apply(this,arguments); }")(m),A.prototype){var v=function(){};v.prototype=A.prototype,p.prototype=new v,v.prototype=null}return p}})),Ke=se(((l,k)=>{var i=tn();k.exports=Function.prototype.bind||i})),mt=se(((l,k)=>{k.exports=Function.prototype.call})),gt=se(((l,k)=>{k.exports=Function.prototype.apply})),rn=se(((l,k)=>{k.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply})),Kt=se(((l,k)=>{var i=Ke(),h=gt(),d=mt();k.exports=rn()||i.call(d,h)})),vt=se(((l,k)=>{var i=Ke(),h=et(),d=mt(),n=Kt();k.exports=function(r){if(r.length<1||typeof r[0]!="function")throw new h("a function is required");return n(i,d,r)}})),nn=se(((l,k)=>{var i=vt(),h=Ge(),d;try{d=[].__proto__===Array.prototype}catch(f){if(!f||typeof f!="object"||!("code"in f)||f.code!=="ERR_PROTO_ACCESS")throw f}var n=!!d&&h&&h(Object.prototype,"__proto__"),a=Object,r=a.getPrototypeOf;k.exports=n&&typeof n.get=="function"?i([n.get]):typeof r=="function"?function(R){return r(R==null?R:a(R))}:!1})),Vt=se(((l,k)=>{var i=Ht(),h=Gt(),d=nn();k.exports=i?function(a){return i(a)}:h?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return h(a)}:d?function(a){return d(a)}:null})),an=se(((l,k)=>{var i=Function.prototype.call,h=Object.prototype.hasOwnProperty;k.exports=Ke().call(i,h)})),Yt=se(((l,k)=>{var i,h=Wt(),d=jr(),n=zr(),a=Wr(),r=qr(),f=qt(),R=et(),C=Hr(),A=Gr(),N=Kr(),p=Vr(),m=Yr(),g=Zr(),S=$r(),O=Jr(),v=Function,_=function(M){try{return v('"use strict"; return ('+M+").constructor;")()}catch{}},x=Ge(),b=tt(),c=function(){throw new R},D=x?(function(){try{return arguments.callee,c}catch{try{return x(arguments,"callee").get}catch{return c}}})():c,U=en()(),w=Vt(),q=Gt(),Q=Ht(),I=gt(),W=mt(),E={},H=typeof Uint8Array>"u"||!w?i:w(Uint8Array),J={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?i:ArrayBuffer,"%ArrayIteratorPrototype%":U&&w?w([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":typeof Atomics>"u"?i:Atomics,"%BigInt%":typeof BigInt>"u"?i:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?i:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":d,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?i:Float16Array,"%Float32Array%":typeof Float32Array>"u"?i:Float32Array,"%Float64Array%":typeof Float64Array>"u"?i:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?i:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":E,"%Int8Array%":typeof Int8Array>"u"?i:Int8Array,"%Int16Array%":typeof Int16Array>"u"?i:Int16Array,"%Int32Array%":typeof Int32Array>
vendor: 6,759 bytes, line 1
1"u"?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":U&&w?w(w([][Symbol.iterator]())):i,"%JSON%":typeof JSON=="object"?JSON:i,"%Map%":typeof Map>"u"?i:Map,"%MapIteratorPrototype%":typeof Map>"u"||!U||!w?i:w(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":h,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?i:Promise,"%Proxy%":typeof Proxy>"u"?i:Proxy,"%RangeError%":a,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?i:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?i:Set,"%SetIteratorPrototype%":typeof Set>"u"||!U||!w?i:w(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":U&&w?w(""[Symbol.iterator]()):i,"%Symbol%":U?Symbol:i,"%SyntaxError%":f,"%ThrowTypeError%":D,"%TypedArray%":H,"%TypeError%":R,"%Uint8Array%":typeof Uint8Array>"u"?i:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?i:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?i:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?i:Uint32Array,"%URIError%":C,"%WeakMap%":typeof WeakMap>"u"?i:WeakMap,"%WeakRef%":typeof WeakRef>"u"?i:WeakRef,"%WeakSet%":typeof WeakSet>"u"?i:WeakSet,"%Function.prototype.call%":W,"%Function.prototype.apply%":I,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":q,"%Math.abs%":A,"%Math.floor%":N,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":S,"%Math.sign%":O,"%Reflect.getPrototypeOf%":Q};if(w)try{null.error}catch(M){J["%Error.prototype%"]=w(w(M))}var Y=function M(re){var B;if(re==="%AsyncFunction%")B=_("async function () {}");else if(re==="%GeneratorFunction%")B=_("function* () {}");else if(re==="%AsyncGeneratorFunction%")B=_("async function* () {}");else if(re==="%AsyncGenerator%"){var P=M("%AsyncGeneratorFunction%");P&&(B=P.prototype)}else if(re==="%AsyncIteratorPrototype%"){var o=M("%AsyncGenerator%");o&&w&&(B=w(o.prototype))}return J[re]=B,B},ae={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$=Ke(),ee=an(),V=$.call(W,Array.prototype.concat),F=$.call(I,Array.prototype.splice),Z=$.call(W,String.prototype.replace),X=$.call(W,String.prototype.slice),te=$.call(W,RegExp.prototype.exec),ue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,y=/\\(\\)?/g,s=function(re){var B=X(re,0,1),P=X(re,-1);if(B==="%"&&P!=="%")throw new f("invalid intrinsic syntax, expected closing `%`");if(P==="%"&&B!=="%")throw new f("invalid intrinsic syntax, expected opening `%`");var o=[];return Z(re,ue,function(K,T,e,t){o[o.length]=e?Z(t,y,"$1"):T||K}),o},j=function(re,B){var P=re,o;if(ee(ae,P)&&(o=ae[P],P="%"+o[0]+"%"),ee(J,P)){var K=J[P];if(K===E&&(K=Y(P)),typeof K>"u"&&!B)throw new R("intrinsic "+re+" exists, but is not available. Please file an issue!");return{alias:o,name:P,value:K}}throw new f("intrinsic "+re+" does not exist!")};k.exports=function(re,B){if(typeof re!="string"||re.length===0)throw new R("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof B!="boolean")throw new R('"allowMissing" argument must be a boolean');if(te(/^%?[^%]*%?$/,re)===null)throw new f("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var P=s(re),o=P.length>0?P[0]:"",K=j("%"+o+"%",B),T=K.name,e=K.value,t=!1,u=K.alias;u&&(o=u[0],F(P,V([0,1],u)));for(var L=1,G=!0;L<P.length;L+=1){var z=P[L],ne=X(z,0,1),oe=X(z,-1);if((ne==='"'||ne==="'"||ne==="`"||oe==='"'||oe==="'"||oe==="`")&&ne!==oe)throw new f("property names with quotes must have matching quotes");if((z==="constructor"||!G)&&(t=!0),o+="."+z,T="%"+o+"%",ee(J,T))e=J[T];else if(e!=null){if(!(z in e)){if(!B)throw new R("base intrinsic for "+re+" exists, but the property is not available.");return}if(x&&L+1>=P.length){var ie=x(e,z);G=!!ie,G&&"get"in ie&&!("originalValue"in ie.get)?e=ie.get:e=e[z]}else G=ee(e,z),e=e[z];G&&!t&&(J[T]=e)}}return e}})),Zt=se(((l,k)=>{var i=Yt(),h=vt(),d=h([i("%String.prototype.indexOf%")]);k.exports=function(a,r){var f=i(a,!!r);return typeof f=="function"&&d(a,".prototype.")>-1?h([f]):f}})),on=se(((l,k)=>{var i=pt()(),h=Zt()("Object.prototype.toString"),d=function(f){return i&&f&&typeof f=="object"&&Symbol.toStringTag in f?!1:
1h(f)==="[object Arguments]"},n=function(f){return d(f)?!0:f!==null&&typeof f=="object"&&"length"in f&&typeof f.length=="number"&&f.length>=0&&h(f)!=="[object Array]"&&"callee"in f&&h(f.callee)==="[object Function]"},a=(function(){return d(arguments)})();d.isLegacyArguments=n,k.exports=a?d:n})),sn=se(((l,k)=>{var i=Object.prototype.toString,h=Function.prototype.toString,d=/^\s*(?:function)?\*/,n=pt()(),a=Object.getPrototypeOf,r=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},f;k.exports=function(C){if(typeof C!="function")return!1;if(d.test(h.call(C)))return!0;if(!n)return i.call(C)==="[object GeneratorFunction]";if(!a)return!1;if(typeof f>"u"){var A=r();f=A?a(A):!1}return a(C)===f}})),ln=se(((l,k)=>{var i=Function.prototype.toString,h=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,d,n;if(typeof h=="function"&&typeof Object.defineProperty=="function")try{d=Object.defineProperty({},"length",{get:function(){throw n}}),n={},h(function(){throw 42},null,d)}catch(x){x!==n&&(h=null)}else h=null;var a=/^\s*class\b/,r=function(b){try{var c=i.call(b);return a.test(c)}catch{return!1}},f=function(b){try{return r(b)?!1:(i.call(b),!0)}catch{return!1}},R=Object.prototype.toString,C="[object Object]",A="[object Function]",N="[object GeneratorFunction]",p="[object HTMLAllCollection]",m="[object HTML document.all class]",g="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,O=!(0 in[,]),v=function(){return!1};if(typeof document=="object"){var _=document.all;R.call(_)===R.call(document.all)&&(v=function(b){if((O||!b)&&(typeof b>"u"||typeof b=="object"))try{var c=R.call(b);return(c===p||c===m||c===g||c===C)&&b("")==null}catch{}return!1})}k.exports=h?function(b){if(v(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{h(b,null,d)}catch(c){if(c!==n)return!1}return!r(b)&&f(b)}:function(b){if(v(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(S)return f(b);if(r(b))return!1;var c=R.call(b);return c!==A&&c!==N&&!/^\[object HTML/.test(c)?!1:f(b)}})),un=se(((l,k)=>{var i=ln(),h=Object.prototype.toString,d=Object.prototype.hasOwnProperty,n=function(C,A,N){for(var p=0,m=C.length;p<m;p++)d.call(C,p)&&(N==null?A(C[p],p,C):A.call(N,C[p],p,C))},a=function(C,A,N){for(var p=0,m=C.length;p<m;p++)N==null?A(C.charAt(p),p,C):A.call(N,C.charAt(p),p,C)},r=function(C,A,N){for(var p in C)d.call(C,p)&&(N==null?A(C[p],p,C):A.call(N,C[p],p,C))};function f(R){return h.call(R)==="[object Array]"}k.exports=function(C,A,N){if(!i(A))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=N),f(C)?n(C,A,p):typeof C=="string"?a(C,A,p):r(C,A,p)}})),cn=se(((l,k)=>{k.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]})),fn=se(((l,k)=>{Me();var i=cn(),h=typeof globalThis>"u"?ye:globalThis;k.exports=function(){for(var n=[],a=0;a<i.length;a++)typeof h[i[a]]=="function"&&(n[n.length]=i[a]);return n}})),dn=se(((l,k)=>{var i=tt(),h=qt(),d=et(),n=Ge();k.exports=function(r,f,R){if(!r||typeof r!="object"&&typeof r!="function")throw new d("`obj` must be an object or a function`");if(typeof f!="string"&&typeof f!="symbol")throw new d("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new d("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new d("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new d("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new d("`loose`, if provided, must be a boolean");var C=arguments.length>3?arguments[3]:null,A=arguments.length>4?arguments[4]:null,N=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,m=!!n&&n(r,f);if(i)i(r,f,{configurable:N===null&&m?m.configurable:!N,enumerable:C===null&&m?m.enumerable:!C,value:R,writable:A===null&&m?m.writable:!A});else if(p||!C&&!A&&!N)r[f]=R;else throw new h("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}})),hn=se(((l,k)=>{var i=tt(),h=function(){return!!i};h.hasArrayLengthDefineBug=function(){if(!i)return null;try{return i([],"length",{value:1}).length!==1}catch{return!0}},k.exports=h})),pn=se(((l,k)=>{var i=Yt(),h=dn(),d=hn()(),n=Ge(),a=et(),r=i("%Math.floor%");k.exports=function(R,C){if(typeof R!="function")throw new a("`fn` is not a function");if(typeof C!="number"||C<0||C>4294967295||r(C)!==C)throw new a("`length` must be a positive 32-bit integer");var A=arguments.length>2&&!!arguments[2],N=!0,p=!0;if("length"in R&&n){var m=n(R,"length");m&&!m.configurable&&(N=!1),m&&!m.writable&&(p=!1)}return(N||p||!A)&&(d?h(R,"length",C,!0,!0):h(R,"length",C)),R}})),mn=se(((l,k)=>{var i=Ke(),h=gt(),d=Kt();k.exports=function(){return d(i,h,arguments)}})),gn=se(((l,k)=>{var i=pn(),h=tt(),d=vt(),n=mn();k.exports=function(r){var f=d(arguments),R=r.length-(arguments.length-1);return i(f,1+(R>0?R:0),!0)},h?h(k.exports,"apply",{value:n}):k.exports.apply=n})),$t=se(((l,k)=>{Me();var i=un(),h=fn(),d=gn(),n=Zt(),a=Ge(),r=Vt(),f=n("Object.prototype.toString"),R=pt()(),C=typeof globalThis>"u"?ye:globalThis,A=h(),N=n("String.prototype.slice"),p=n("Array.prototype.indexOf",!0)||function(v,_){for(var x=0;x<v.length;x+=1)if(v[x]===_)return x;return-1},m={__proto__:null};R&&a&&r?i(A,function(O){var v=new C[O];if(Symbol.toStringTag in v&&r){var _=r(v),x=a(_,Symbol.toStringTag);!x&&_&&(x=a(r(_),Symbol.toStringTag)),m["$"+O]=d(x.get)}}):i(A,function(O){var v=new C[O],_=v.slice||v.set;_&&(m["$"+O]=d(_))});var g=function(v){var _=!1;return i(m,function(x,b){if(!_)try{"$"+x(v)===b&&(_=N(b,1))}catch{}}),_},S=function(v){var _=!1;return i(m,function(x,b){if(!_)try{x(v),_=N(b,1)}catch{}}),_};k.exports=function(v){if(!v||typeof v!="object")return!1;if(!R){var _=N(f(v),8,-1);return p(A,_)>-1?_:_!=="Object"?!1:S(v)}return a?g(v):null}})),vn=se(((l,k)=>{var i=$t();k.exports=function(d){return!!i(d)}})),yn=se((l=>{var k=on(),i=sn(),h=$t(),d=vn();function n(u){return u.call.bind(u)}var a=typeof BigInt<"u",r=typeof Symbol<"u",f=n(Object.prototype.toString),R=n(Number.prototype.valueOf),C=n(String.prototype.valueOf),A=n(Boolean.prototype.valueOf);if(a)var N=n(BigInt.prototype.valueOf);if(r)var p=n(Symbol.prototype.valueOf);function m(u,L){if(typeof u!="object")return!1;try{return L(u),!0}catch{return!1}}l.isArgumentsObject=k,l.isGeneratorFunction=i,l.isTypedArray=d;function g(u){return typeof Promise<"u"&&u instanceof Promise||u!==null&&typeof u=="object"&&typeof u.then=="function"&&typeof u.catch=="function"}l.isPromise=g;function S(u){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(u):d(u)||Z(u)}l.isArrayBufferView=S;function O(u){return h(u)==="Uint8Array"}l.isUint8Array=O;function v(u){return h(u)==="Uint8ClampedArray"}l.isUint8ClampedArray=v;function _(u){return h(u)==="Uint16Array"}l.isUint16Array=_;function x(u){return h(u)==="Uint32Array"}l.isUint32Array=x;function b(u){return h(u)==="Int8Array"}l.isInt8Array=b;function c(u){return h(u)==="Int16Array"}l.isInt16Array=c;function D(u){return h(u)==="Int32Array"}l.isInt32Array=D;function U(u){return h(u)==="Float32Array"}l.isFloat32Array=U;function w(u){return h(u)==="Float64Array"}l.isFloat64Array=w;function q(u){return h(u)==="BigInt64Array"}l.isBigInt64Array=q;function Q(u){return h(u)==="BigUint64Array"}l.isBigUint64Array=Q;function I(u){return f(u)==="[object Map]"}I.working=typeof Map<"u"&&I(new Map);function W(u){return typeof Map>"u"?!1:I.working?I(u):u instanceof Map}l.isMap=W;function E(u){return f(u)==="[object Set]"}E.working=typeof Set<"u"&&E(new Set);function H(u){return typeof Set>"u"?!1:E.working?E(u):u instanceof Set}l.isSet=H;function J(u){return f(u)==="[object WeakMap]"}J.working=typeof WeakMap<"u"&&J(new WeakMap);function Y(u){return typeof WeakMap>"u"?!1:J.working?J(u):u instanceof WeakMap}l.isWeakMap=Y;function ae(u){return f(u)==="[object WeakSet]"}ae.working=typeof WeakSet<"u"&&ae(new WeakSet);function $(u){return ae(u)}l.isWeakSet=$;function ee(u){return f(u)==="[object ArrayBuffer]"}ee.working=typeof ArrayBuffer<"u"&&ee(new ArrayBuffer);function V(u){return typeof ArrayBuffer>"u"?!1:ee.working?ee(u):u instanceof ArrayBuffer}l.isArrayBuffer=V;function F(u){return f(u)==="[object DataView]"}F.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&F(new DataView(new ArrayBuffer(1),0,1));function Z(u){return typeof DataView>"u"?!1:F.working?F(u):u instanceof DataView}l.isDataView=Z;var X=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function te(u){return f(u)==="[object SharedArrayBuffer]"}function ue(u){return typeof X>"u"?!1:(typeof te.working>"u"&&(te.working=te(new X)),te.working?te(u):u instanceof X)}l.isSharedArrayBuffer=ue;function y(u){return f(u)==="[object AsyncFunction]"}l.isAsyncFunction=y;function s(u){return f(u)==="[object Map Iterator]"}l.isMapIterator=s;function j(u){return f(u)==="[object Set Iterator]"}l.isSetIterator=j;function M(u){return f(u)==="[object Generator]"}l.isGeneratorObject=M;function re(u){return f(u)==="[object WebAssembly.Module]"}l.isWebAssemblyCompiledModule=re;function B(u){return m(u,R)}l.isNumberObject=B;function P(u){return m(u,C)}l.isStringObject=P;function o(u){return m(u,A)}l.isBooleanObject=o;function K(u){return a&&m(u,N)}l.isBigIntObject=K;function T(u){return r&&m(u,p)}l.isSymbolObject=T;function e(u){return B(u)||P(u)||o(u)||K(u)||T(u)}l.isBoxedPrimitive=e;function t(u){return typeof Uint8Array<"u"&&(V(u)||ue(u))}l.isAnyArrayBuffer=t,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(u){Object.defineProperty(l,u,{enumerable:!1,value:function(){throw new Error(u+" is not supported in userland")}})})})),bn=se(((l,k)=>{k.exports=function(h){return h&&typeof h=="object"&&typeof h.copy=="function"&&typeof h.fill=="function"&&typeof h.readUInt8=="function"}})),Xt=se((l=>{Oe();var k=Object.getOwnPropertyDescriptors||function(Z){for(var X=Object.keys(Z),te={},ue=0;ue<X.length;ue++)te[X[ue]]=Object.getOwnPropertyDescriptor(Z,X[ue]);return te},i=/%[sdj%]/g;l.format=function(F){if(!b(F)){for(var Z=[],X=0;X<arguments.length;X++)Z.push(a(arguments[X]));return Z.join(" ")}for(var X=1,te=arguments,ue=te.length,y=String(F).replace(i,function(j){if(j==="%%")return"%";if(X>=ue)return j;switch(j){case"%s":return String(te[X++]);case"%d":return Number(te[X++]);case"%j":try{return JSON.stringify(te[X++])}catch{return"[Circular]"}default:return j}}),s=te[X];X<ue;s=te[++X])v(s)||!w(s)?y+=" "+s:y+=" "+a(s);return y},l.deprecate=function(F,Z){if(typeof de<"u"&&de.noDeprecation===!0)return F;if(typeof de>"u")return function(){return l.deprecate(F,Z).apply(this,arguments)};var X=!1;function te(){if(!X){if(de.throwDeprecation)throw new Error(Z);de.traceDeprecation?console.trace(Z):console.error(Z),X=!0}return F.apply(this,arguments)}return te};var h={},d=/^$/;if(de.env.NODE_DEBUG){var n=de.env.NODE_DEBUG;n=n.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),d=new RegExp("^"+n+"$","i")}l.debuglog=function(F){if(F=F.toUpperCase(),!h[F])if(d.test(F)){var Z=de.pid;h[F]=function(){var X=l.format.apply(l,arguments);console.error("%s %d: %s",F,Z,X)}}else h[F]=function(){};return h[F]};function a(F,Z){var X={seen:[],stylize:f};return arguments.length>=3&&(X.depth=arguments[2]),arguments.length>=4&&(X.colors=arguments[3]),O(Z)?X.showHidden=Z:Z&&l._extend(X,Z),D(X.showHidden)&&(X.showHidden=!1),D(X.depth)&&(X.depth=2),D(X.colors)&&(X.colors=!1),D(X.customInspect)&&(X.customInspect=!0),X.colors&&(X.stylize=r),C(X,F,X.depth)}l.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function r(F,Z){var X=a.styles[Z];return X?"\x1B["+a.colors[X][0]+"m"+F+"\x1B["+a.colors[X][1]+"m":F}function f(F,Z){return F}function R(F){var Z={};return F.forEach(function(X,te){Z[X]=!0}),Z}function C(F,Z,X){if(F.customInspect&&Z&&I(Z.inspect)&&Z.inspect!==l.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var te=Z.inspect(X,F);return b(te)||(te=C(F,te,X)),te}var ue=A(F,Z);if(ue)return ue;var y=Object.keys(Z),s=R(y);if(F.showHidden&&(y=Object.getOwnPropertyNames(Z)),Q(Z)&&(y.indexOf("message")>=0||y.indexOf("description")>=0))return N(Z);if(y.length===0){if(I(Z)){var j=Z.name?": "+Z.name:"";return F.stylize("[Function"+j+"]","special")}if(U(Z))return F.stylize(RegExp.prototype.toString.call(Z),"regexp");if(q(Z))return F.stylize(Date.prototype.toString.call(Z),"date");if(Q(Z))return N(Z)}var M="",re=!1,B=["{","}"];if(S(Z)&&(re=!0,B=["[","]"]),I(Z)&&(M=" [Function"+(Z.name?": "+Z.name:"")+"]"),U(Z)&&(M=" "+RegExp.prototype.toString.call(Z)),q(Z)&&(M=" "+Date.prototype.toUTCString.call(Z)),Q(Z)&&(M=" "+N(Z)),y.length===0&&(!re||Z.length==0))return B[0]+M+B[1];if(X<0)return U(Z)?F.stylize(RegExp.prototype.toString.call(Z),"regexp"):F.stylize("[Object]","special");F.seen.push(Z);var P;return re?P=p(F,Z,X,s,y):P=y.map(function(o){return m(F,Z,X,s,o,re)}),F.seen.pop(),g(P,M,B)}function A(F,Z){if(D(Z))return F.stylize("undefined","undefined");if(b(Z)){var X="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return F.stylize(X,"string")}if(x(Z))return F.stylize(""+Z,"number");if(O(Z))return F.stylize(""+Z,"boolean");if(v(Z))return F.stylize("null","null")}function N(F){return"["+Error.prototype.toString.call(F)+"]"}
1function p(F,Z,X,te,ue){for(var y=[],s=0,j=Z.length;s<j;++s)ae(Z,String(s))?y.push(m(F,Z,X,te,String(s),!0)):y.push("");return ue.forEach(function(M){M.match(/^\d+$/)||y.push(m(F,Z,X,te,M,!0))}),y}function m(F,Z,X,te,ue,y){var s,j,M=Object.getOwnPropertyDescriptor(Z,ue)||{value:Z[ue]};if(M.get?M.set?j=F.stylize("[Getter/Setter]","special"):j=F.stylize("[Getter]","special"):M.set&&(j=F.stylize("[Setter]","special")),ae(te,ue)||(s="["+ue+"]"),j||(F.seen.indexOf(M.value)<0?(v(X)?j=C(F,M.value,null):j=C(F,M.value,X-1),j.indexOf(`
2`)>-1&&(y?j=j.split(`
3`).map(function(re){return"  "+re}).join(`
4`).slice(2):j=`
5`+j.split(`
6`).map(function(re){return"   "+re}).join(`
7`))):j=F.stylize("[Circular]","special")),D(s)){if(y&&ue.match(/^\d+$/))return j;s=JSON.stringify(""+ue),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=F.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=F.stylize(s,"string"))}return s+": "+j}function g(F,Z,X){return F.reduce(function(te,ue){return ue.indexOf(`
8`)>=0,te+ue.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?X[0]+(Z===""?"":Z+`
9 `)+" "+F.join(`,
10  `)+" "+X[1]:X[0]+Z+" "+F.join(", ")+" "+X[1]}l.types=yn();function S(F){return Array.isArray(F)}l.isArray=S;function O(F){return typeof F=="boolean"}l.isBoolean=O;function v(F){return F===null}l.isNull=v;function _(F){return F==null}l.isNullOrUndefined=_;function x(F){return typeof F=="number"}l.isNumber=x;function b(F){return typeof F=="string"}l.isString=b;function c(F){return typeof F=="symbol"}l.isSymbol=c;function D(F){return F===void 0}l.isUndefined=D;function U(F){return w(F)&&E(F)==="[object RegExp]"}l.isRegExp=U,l.types.isRegExp=U;function w(F){return typeof F=="object"&&F!==null}l.isObject=w;function q(F){return w(F)&&E(F)==="[object Date]"}l.isDate=q,l.types.isDate=q;function Q(F){return w(F)&&(E(F)==="[object Error]"||F instanceof Error)}l.isError=Q,l.types.isNativeError=Q;function I(F){return typeof F=="function"}l.isFunction=I;function W(F){return F===null||typeof F=="boolean"||typeof F=="number"||typeof F=="string"||typeof F=="symbol"||typeof F>"u"}l.isPrimitive=W,l.isBuffer=bn();function E(F){return Object.prototype.toString.call(F)}function H(F){return F<10?"0"+F.toString(10):F.toString(10)}var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Y(){var F=new Date,Z=[H(F.getHours()),H(F.getMinutes()),H(F.getSeconds())].join(":");return[F.getDate(),J[F.getMonth()],Z].join(" ")}l.log=function(){console.log("%s - %s",Y(),l.format.apply(l,arguments))},l.inherits=Ce(),l._extend=function(F,Z){if(!Z||!w(Z))return F;for(var X=Object.keys(Z),te=X.length;te--;)F[X[te]]=Z[X[te]];return F};function ae(F,Z){return Object.prototype.hasOwnProperty.call(F,Z)}var $=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;l.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if($&&Z[$]){var X=Z[$];if(typeof X!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(X,$,{value:X,enumerable:!1,writable:!1,configurable:!0}),X}function X(){for(var te,ue,y=new Promise(function(M,re){te=M,ue=re}),s=[],j=0;j<arguments.length;j++)s.push(arguments[j]);s.push(function(M,re){M?ue(M):te(re)});try{Z.apply(this,s)}catch(M){ue(M)}return y}return Object.setPrototypeOf(X,Object.getPrototypeOf(Z)),$&&Object.defineProperty(X,$,{value:X,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(X,k(Z))},l.promisify.custom=$;function ee(F,Z){if(!F){var X=new Error("Promise was rejected with a falsy value");X.reason=F,F=X}return Z(F)}function V(F){if(typeof F!="function")throw new TypeError('The "original" argument must be of type Function');function Z(){for(var X=[],te=0;te<arguments.length;te++)X.push(arguments[te]);var ue=X.pop();if(typeof ue!="function")throw new TypeError("The last argument must be of type Function");var y=this,s=function(){return ue.apply(y,arguments)};F.apply(this,X).then(function(j){de.nextTick(s.bind(null,null,j))},function(j){de.nextTick(ee.bind(null,j,s))})}return Object.setPrototypeOf(Z,Object.getPrototypeOf(F)),Object.defineProperties(Z,k(F)),Z}l.callbackify=V})),_n=se(((l,k)=>{function i(m,g){var S=Object.keys(m);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(m);g&&(O=O.filter(function(v){return Object.getOwnPropertyDescriptor(m,v).enumerable})),S.push.apply(S,O)}return S}function h(m){for(var g=1;g<arguments.length;g++){var S=arguments[g]!=null?arguments[g]:{};
10g%2?i(Object(S),!0).forEach(function(O){d(m,O,S[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(S)):i(Object(S)).forEach(function(O){Object.defineProperty(m,O,Object.getOwnPropertyDescriptor(S,O))})}return m}function d(m,g,S){return g=f(g),g in m?Object.defineProperty(m,g,{value:S,enumerable:!0,configurable:!0,writable:!0}):m[g]=S,m}function n(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function a(m,g){for(var S=0;S<g.length;S++){var O=g[S];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(m,f(O.key),O)}}function r(m,g,S){return g&&a(m.prototype,g),Object.defineProperty(m,"prototype",{writable:!1}),m}function f(m){var g=R(m,"string");return typeof g=="symbol"?g:String(g)}function R(m,g){if(typeof m!="object"||m===null)return m;var S=m[Symbol.toPrimitive];if(S!==void 0){var O=S.call(m,g);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(m)}var C=Qe().Buffer,A=Xt().inspect,N=A&&A.custom||"inspect";function p(m,g,S){C.prototype.copy.call(m,g,S)}k.exports=(function(){function m(){n(this,m),this.head=null,this.tail=null,this.length=0}return r(m,[{key:"push",value:function(S){var O={data:S,next:null};this.length>0?this.tail.next=O:this.head=O,this.tail=O,++this.length}},{key:"unshift",value:function(S){var O={data:S,next:this.head};this.length===0&&(this.tail=O),this.head=O,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var O=this.head,v=""+O.data;O=O.next;)v+=S+O.data;return v}},{key:"concat",value:function(S){if(this.length===0)return C.alloc(0);for(var O=C.allocUnsafe(S>>>0),v=this.head,_=0;v;)p(v.data,O,_),_+=v.data.length,v=v.next;return O}},{key:"consume",value:function(S,O){var v;return S<this.head.data.length?(v=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):S===this.head.data.length?v=this.shift():v=O?this._getString(S):this._getBuffer(S),v}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var O=this.head,v=1,_=O.data;for(S-=_.length;O=O.next;){var x=O.data,b=S>x.length?x.length:S;if(b===x.length?_+=x:_+=x.slice(0,S),S-=b,S===0){b===x.length?(++v,O.next?this.head=O.next:this.head=this.tail=null):(this.head=O,O.data=x.slice(b));break}++v}return this.length-=v,_}},{key:"_getBuffer",value:function(S){var O=C.allocUnsafe(S),v=this.head,_=1;for(v.data.copy(O),S-=v.data.length;v=v.next;){var x=v.data,b=S>x.length?x.length:S;if(x.copy(O,O.length-S,0,b),S-=b,S===0){b===x.length?(++_,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=x.slice(b));break}++_}return this.length-=_,O}},{key:N,value:function(S,O){return A(this,h(h({},O),{},{depth:0,customInspect:!1}))}}]),m})()})),Jt=se(((l,k)=>{Oe();function i(f,R){var C=this,A=this._readableState&&this._readableState.destroyed,N=this._writableState&&this._writableState.destroyed;return A||N?(R?R(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,de.nextTick(a,this,f)):de.nextTick(a,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(p){!R&&p?C._writableState?C._writableState.errorEmitted?de.nextTick(d,C):(C._writableState.errorEmitted=!0,de.nextTick(h,C,p)):de.nextTick(h,C,p):R?(de.nextTick(d,C),R(p)):de.nextTick(d,C)}),this)}function h(f,R){a(f,R),d(f)}function d(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function n(){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 a(f,R){f.emit("error",R)}function r(f,R){var C=f._readableState,A=f._writableState;C&&C.autoDestroy||A&&A.autoDestroy?f.destroy(R):f.emit("error",R)}k.exports={destroy:i,undestroy:n,errorOrDestroy:r}})),Ue=se(((l,k)=>{function i(R,C){R.prototype=Object.create(C.prototype),R.prototype.constructor=R,R.__proto__=C}var h={};function d(R,C,A){A||(A=Error);function N(m,g,S){return typeof C=="string"?C:C(m,g,S)}var p=(function(m){i(g,m);function g(S,O,v){return m.call(this,N(S,O,v))||this}return g})(A);p.prototype.name=A.name,p.prototype.code=R,h[R]=p}function n(R,C){if(Array.isArray(R)){var A=R.length;return R=R.map(function(N){return String(N)}),A>2?"one of ".concat(C," ").concat(R.slice(0,A-1).join(", "),", or ")+R[A-1]:A===2?"one of ".concat(C," ").concat(R[0]," or ").concat(R[1]):"of ".concat(C," ").concat(R[0])}else return"of ".concat(C," ").concat(String(R))}function a(R,C,A){return R.substr(0,C.length)===C}function r(R,C,A){return(A===void 0||A>R.length)&&(A=R.length),R.substring(A-C.length,A)===C}function f(R,C,A){return typeof A!="number"&&(A=0),A+C.length>R.length?!1:R.indexOf(C,A)!==-1}d("ERR_INVALID_OPT_VALUE",function(R,C){return'The value "'+C+'" is 
10invalid for option "'+R+'"'},TypeError),d("ERR_INVALID_ARG_TYPE",function(R,C,A){var N;typeof C=="string"&&a(C,"not ")?(N="must not be",C=C.replace(/^not /,"")):N="must be";var p;if(r(R," argument"))p="The ".concat(R," ").concat(N," ").concat(n(C,"type"));else{var m=f(R,".")?"property":"argument";p='The "'.concat(R,'" ').concat(m," ").concat(N," ").concat(n(C,"type"))}return p+=". Received type ".concat(typeof A),p},TypeError),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),d("ERR_METHOD_NOT_IMPLEMENTED",function(R){return"The "+R+" method is not implemented"}),d("ERR_STREAM_PREMATURE_CLOSE","Premature close"),d("ERR_STREAM_DESTROYED",function(R){return"Cannot call "+R+" after a stream was destroyed"}),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),d("ERR_STREAM_WRITE_AFTER_END","write after end"),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_UNKNOWN_ENCODING",function(R){return"Unknown encoding: "+R},TypeError),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),k.exports.codes=h})),Qt=se(((l,k)=>{var i=Ue().codes.ERR_INVALID_OPT_VALUE;function h(n,a,r){return n.highWaterMark!=null?n.highWaterMark:a?n[r]:null}function d(n,a,r,f){var R=h(a,f,r);if(R!=null){if(!(isFinite(R)&&Math.floor(R)===R)||R<0)throw new i(f?r:"highWaterMark",R);return Math.floor(R)}return n.objectMode?16:16*1024}k.exports={getHighWaterMark:d}})),wn=se(((l,k)=>{Me(),k.exports=i;function i(d,n){if(h("noDeprecation"))return d;var a=!1;function r(){if(!a){if(h("throwDeprecation"))throw new Error(n);h("traceDeprecation")?console.trace(n):console.warn(n),a=!0}return d.apply(this,arguments)}return r}function h(d){try{if(!ye.localStorage)return!1}catch{return!1}var n=ye.localStorage[d];return n==null?!1:String(n).toLowerCase()==="true"}})),er=se(((l,k)=>{Me(),Oe(),k.exports=w;function i(y){var s=this;this.next=null,this.entry=null,this.finish=function(){ue(s,y)}}var h;w.WritableState=D;var d={deprecate:wn()},n=jt(),a=Qe().Buffer,r=(typeof ye<"u"?ye:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(y){return a.from(y)}function R(y){return a.isBuffer(y)||y instanceof r}var C=Jt(),A=Qt().getHighWaterMark,N=Ue().codes,p=N.ERR_INVALID_ARG_TYPE,m=N.ERR_METHOD_NOT_IMPLEMENTED,g=N.ERR_MULTIPLE_CALLBACK,S=N.ERR_STREAM_CANNOT_PIPE,O=N.ERR_STREAM_DESTROYED,v=N.ERR_STREAM_NULL_VALUES,_=N.ERR_STREAM_WRITE_AFTER_END,x=N.ERR_UNKNOWN_ENCODING,b=C.errorOrDestroy;Ce()(w,n);function c(){}function D(y,s,j){h=h||Le(),y=y||{},typeof j!="boolean"&&(j=s instanceof h),this.objectMode=!!y.objectMode,j&&(this.objectMode=this.objectMode||!!y.writableObjectMode),this.highWaterMark=A(this,y,"writableHighWaterMark",j),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var M=y.decodeStrings===!1;this.decodeStrings=!M,this.defaultEncoding=y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(re){Y(s,re)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=y.emitClose!==!1,this.autoDestroy=!!y.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}D.prototype.getBuffer=function(){for(var s=this.bufferedRequest,j=[];s;)j.push(s),s=s.next;return j},(function(){try{Object.defineProperty(D.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var U;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(U=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(s){return U.call(this,s)?!0:this!==w?!1:s&&s._writableState instanceof D}})):U=function(s){return s instanceof this};function w(y){h=h||Le();var s=this instanceof h;if(!s&&!U.call(w,this))return new w(y);this._writableState=new D(y,this,s),this.writable=!0,y&&(typeof y.write=="function"&&(this._write=y.write),typeof y.writev=="function"&&(this._writev=y.writev),typeof y.destroy=="function"&&(this._destroy=y.destroy),typeof y.final=="function"&&(this._final=y.final)),n.call(this)}w.prototype.pipe=function(){b(this,new S)};function q(y,s){var j=new _;b(y,j),de.nextTick(s,j)}function Q(y,s,j,M){var re;
10return j===null?re=new v:typeof j!="string"&&!s.objectMode&&(re=new p("chunk",["string","Buffer"],j)),re?(b(y,re),de.nextTick(M,re),!1):!0}w.prototype.write=function(y,s,j){var M=this._writableState,re=!1,B=!M.objectMode&&R(y);return B&&!a.isBuffer(y)&&(y=f(y)),typeof s=="function"&&(j=s,s=null),B?s="buffer":s||(s=M.defaultEncoding),typeof j!="function"&&(j=c),M.ending?q(this,j):(B||Q(this,M,y,j))&&(M.pendingcb++,re=W(this,M,B,y,s,j)),re},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var y=this._writableState;y.corked&&(y.corked--,!y.writing&&!y.corked&&!y.bufferProcessing&&y.bufferedRequest&&ee(this,y))},w.prototype.setDefaultEncoding=function(s){if(typeof s=="string"&&(s=s.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((s+"").toLowerCase())>-1))throw new x(s);return this._writableState.defaultEncoding=s,this},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function I(y,s,j){return!y.objectMode&&y.decodeStrings!==!1&&typeof s=="string"&&(s=a.from(s,j)),s}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function W(y,s,j,M,re,B){if(!j){var P=I(s,M,re);M!==P&&(j=!0,re="buffer",M=P)}var o=s.objectMode?1:M.length;s.length+=o;var K=s.length<s.highWaterMark;if(K||(s.needDrain=!0),s.writing||s.corked){var T=s.lastBufferedRequest;s.lastBufferedRequest={chunk:M,encoding:re,isBuf:j,callback:B,next:null},T?T.next=s.lastBufferedRequest:s.bufferedRequest=s.lastBufferedRequest,s.bufferedRequestCount+=1}else E(y,s,!1,o,M,re,B);return K}function E(y,s,j,M,re,B,P){s.writelen=M,s.writecb=P,s.writing=!0,s.sync=!0,s.destroyed?s.onwrite(new O("write")):j?y._writev(re,s.onwrite):y._write(re,B,s.onwrite),s.sync=!1}function H(y,s,j,M,re){--s.pendingcb,j?(de.nextTick(re,M),de.nextTick(X,y,s),y._writableState.errorEmitted=!0,b(y,M)):(re(M),y._writableState.errorEmitted=!0,b(y,M),X(y,s))}function J(y){y.writing=!1,y.writecb=null,y.length-=y.writelen,y.writelen=0}function Y(y,s){var j=y._writableState,M=j.sync,re=j.writecb;if(typeof re!="function")throw new g;if(J(j),s)H(y,j,M,s,re);else{var B=V(j)||y.destroyed;!B&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&ee(y,j),M?de.nextTick(ae,y,j,B,re):ae(y,j,B,re)}}function ae(y,s,j,M){j||$(y,s),s.pendingcb--,M(),X(y,s)}function $(y,s){s.length===0&&s.needDrain&&(s.needDrain=!1,y.emit("drain"))}function ee(y,s){s.bufferProcessing=!0;var j=s.bufferedRequest;if(y._writev&&j&&j.next){var M=s.bufferedRequestCount,re=new Array(M),B=s.corkedRequestsFree;B.entry=j;for(var P=0,o=!0;j;)re[P]=j,j.isBuf||(o=!1),j=j.next,P+=1;re.allBuffers=o,E(y,s,!0,s.length,re,"",B.finish),s.pendingcb++,s.lastBufferedRequest=null,B.next?(s.corkedRequestsFree=B.next,B.next=null):s.corkedRequestsFree=new i(s),s.bufferedRequestCount=0}else{for(;j;){var K=j.chunk,T=j.encoding,e=j.callback;if(E(y,s,!1,s.objectMode?1:K.length,K,T,e),j=j.next,s.bufferedRequestCount--,s.writing)break}j===null&&(s.lastBufferedRequest=null)}s.bufferedRequest=j,s.bufferProcessing=!1}w.prototype._write=function(y,s,j){j(new m("_write()"))},w.prototype._writev=null,w.prototype.end=function(y,s,j){var M=this._writableState;return typeof y=="function"?(j=y,y=null,s=null):typeof s=="function"&&(j=s,s=null),y!=null&&this.write(y,s),M.corked&&(M.corked=1,this.uncork()),M.ending||te(this,M,j),this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function V(y){return y.ending&&y.length===0&&y.bufferedRequest===null&&!y.finished&&!y.writing}function F(y,s){y._final(function(j){s.pendingcb--,j&&b(y,j),s.prefinished=!0,y.emit("prefinish"),X(y,s)})}function Z(y,s){!s.prefinished&&!s.finalCalled&&(typeof y._final=="function"&&!s.destroyed?(s.pendingcb++,s.finalCalled=!0,de.nextTick(F,y,s)):(s.prefinished=!0,y.emit("prefinish")))}function X(y,s){var j=V(s);if(j&&(Z(y,s),s.pendingcb===0&&(s.finished=!0,y.emit("finish"),s.autoDestroy))){var M=y._readableState;(!M||M.autoDestroy&&M.endEmitted)&&y.destroy()}return j}function te(y,s,j){s.ending=!0,X(y,s),j&&(s.finished?de.nextTick(j):y.once("finish",j)),s.ended=!0,y.writable=!1}function ue(y,s,j){var M=y.entry;for(y.entry=null;M;){var re=M.callback;s.pendingcb--,re(j),M=M.next}s.corkedRequestsFree.next=y}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(s){this._writableState&&(this._writableState.destroyed=s)}}),w.prototype.destroy=C.destroy,w.prototype._undestroy=C.undestroy,w.prototype._destroy=function(y,s){s(y)}})),Le=se(((l,k)=>{Oe();var i=Object.keys||function(A){var N=[];for(var p in A)N.push(p);return N};k.exports=f;var h=tr(),d=er();Ce()(f,h);for(var n=i(d.prototype),a=0;a<n.length;a++){var r=n[a];f.prototype[r]||(f.prototype[r]=d.prototype[r])}function f(A){if(!(this instanceof f))return new f(A);h.call(this,A),d.call(this,A),this.allowHalfOpen=!0,A&&(A.readable===!1&&(this.readable=!1),A.writable===!1&&(this.writable=!1),A.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",R)))}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function R(){this._writableState.ended||de.nextTick(C,this)}function C(A){A.end()}Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(N){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=N,this._writableState.destroyed=N)}})})),En=se(((l,k)=>{var i=Qe(),h=i.Buffer;function d(a,r){for(var f in a)r[f]=a[f]}h.from&&h.alloc&&h.allocUnsafe&&h.allocUnsafeSlow?k.exports=i:(d(i,l),l.Buffer=n);function n(a,r,f){return h(a,r,f)}d(h,n),n.from=function(a,r,f){if(typeof a=="number")throw new TypeError("Argument must not be a number");return h(a,r,f)},n.alloc=function(a,r,f){if(typeof a!="number")throw new TypeError("Argument must be a number");var R=h(a);return r!==void 0?typeof f=="string"?R.fill(r,f):R.fill(r):R.fill(0),R}
10,n.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return h(a)},n.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return i.SlowBuffer(a)}})),ft=se((l=>{var k=En().Buffer,i=k.isEncoding||function(v){switch(v=""+v,v&&v.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 h(v){if(!v)return"utf8";for(var _;;)switch(v){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 v;default:if(_)return;v=(""+v).toLowerCase(),_=!0}}function d(v){var _=h(v);if(typeof _!="string"&&(k.isEncoding===i||!i(v)))throw new Error("Unknown encoding: "+v);return _||v}l.StringDecoder=n;function n(v){this.encoding=d(v);var _;switch(this.encoding){case"utf16le":this.text=N,this.end=p,_=4;break;case"utf8":this.fillLast=R,_=4;break;case"base64":this.text=m,this.end=g,_=3;break;default:this.write=S,this.end=O;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=k.allocUnsafe(_)}n.prototype.write=function(v){if(v.length===0)return"";var _,x;if(this.lastNeed){if(_=this.fillLast(v),_===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x<v.length?_?_+this.text(v,x):this.text(v,x):_||""},n.prototype.end=A,n.prototype.text=C,n.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function a(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function r(v,_,x){var b=_.length-1;if(b<x)return 0;var c=a(_[b]);return c>=0?(c>0&&(v.lastNeed=c-1),c):--b<x||c===-2?0:(c=a(_[b]),c>=0?(c>0&&(v.lastNeed=c-2),c):--b<x||c===-2?0:(c=a(_[b]),c>=0?(c>0&&(c===2?c=0:v.lastNeed=c-3),c):0))}function f(v,_,x){if((_[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return v.lastNeed=2,"�"}}function R(v){var _=this.lastTotal-this.lastNeed,x=f(this,v);if(x!==void 0)return x;if(this.lastNeed<=v.length)return v.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,_,0,v.length),this.lastNeed-=v.length}function C(v,_){var x=r(this,v,_);if(!this.lastNeed)return v.toString("utf8",_);this.lastTotal=x;var b=v.length-(x-this.lastNeed);return v.copy(this.lastChar,0,b),v.toString("utf8",_,b)}function A(v){var _=v&&v.length?this.write(v):"";return this.lastNeed?_+"�":_}function N(v,_){if((v.length-_)%2===0){var x=v.toString("utf16le",_);if(x){var b=x.charCodeAt(x.length-1);if(b>=55296&&b<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",_,v.length-1)}function p(v){var _=v&&v.length?this.write(v):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,x)}return _}function m(v,_){var x=(v.length-_)%3;return x===0?v.toString("base64",_):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",_,v.length-x))}function g(v){var _=v&&v.length?this.write(v):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function S(v){return v.toString(this.encoding)}function O(v){return v&&v.length?this.write(v):""}})),yt=se(((l,k)=>{var i=Ue().codes.ERR_STREAM_PREMATURE_CLOSE;function h(r){var f=!1;return function(){if(!f){f=!0;for(var R=arguments.length,C=new Array(R),A=0;A<R;A++)C[A]=arguments[A];r.apply(this,C)}}}function d(){}function n(r){return r.setHeader&&typeof r.abort=="function"}function a(r,f,R){if(typeof f=="function")return a(r,null,f);f||(f={}),R=h(R||d);var C=f.readable||f.readable!==!1&&r.readable,A=f.writable||f.writable!==!1&&r.writable,N=function(){r.writable||m()},p=r._writableState&&r._writableState.finished,m=function(){A=!1,p=!0,C||R.call(r)},g=r._readableState&&r._readableState.endEmitted,S=function(){C=!1,g=!0,A||R.call(r)},O=function(b){R.call(r,b)},v=function(){var b;if(C&&!g)return(!r._readableState||!r._readableState.ended)&&(b=new i),R.call(r,b);if(A&&!p)return(!r._writableState||!r._writableState.ended)&&(b=new i),R.call(r,b)},_=function(){r.req.on("finish",m)};return n(r)?(r.on("complete",m),r.on("abort",v),r.req?_():r.on("request",_)):A&&!r._writableState&&(r.on("end",N),r.on("close",N)),r.on("end",S),r.on("finish",m),f.error!==!1&&r.on("error",O),r.on("close",v),function(){r.removeListener("complete",m),r.removeListener("abort",v),r.removeListener("request",_),r.req&&r.req.removeListener("finish",m),r.removeListener("end",N),r.removeListener("close",N),r.removeListener("finish",m),r.removeListener("end",S),r.removeListener("error",O),r.removeListener("close",v)}}k.exports=a})),xn=se(((l,k)=>{Oe();var i;function h(x,b,c){return b=d(b),b in x?Object.defineProperty(x,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):x[b]=c,x}function d(x){var b=n(x,"string");return typeof b=="symbol"?b:String(b)}function n(x,b){if(typeof x!="object"||x===null)return x;var c=x[Symbol.toPrimitive];if(c!==void 0){var D=c.call(x,b);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(x)}var a=yt(),r=Symbol("lastResolve"),f=Symbol("lastReject"),R=Symbol("error"),C=Symbol("ended"),A=Symbol("lastPromise"),N=Symbol("handlePromise"),p=Symbol("stream");function m(x,b){return{value:x,done:b}}function g(x){var b=x[r];if(b!==null){var c=x[p].read();c!==null&&(x[A]=null,x[r]=null,x[f]=null,b(m(c,!1)))}}function S(x){de.nextTick(g,x)}function O(x,b){return function(c,D){x.then(function(){if(b[C]){c(m(void 0,!0));return}b[N](c,D)},D)}}var v=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((i={get stream(){return this[p]},next:function(){var b=this,c=this[R];if(c!==null)return Promise.reject(c);if(this[C])return Promise.resolve(m(void 0,!0));if(this[p].destroyed)return new Promise(function(q,Q){de.nextTick(function(){b[R]?Q(b[R]):q(m(void 0,!0))})});var D=this[A],U;if(D)U=new Promise(O(D,this));else{var w=this[p].read();if(w!==null)return Promise.resolve(m(w,!1));U=new Promise(this[N])}return this[A]=U,U}},h(i,Symbol.asyncIterator,function(){return this}),h(i,"return",function(){var b=this;
10return new Promise(function(c,D){b[p].destroy(null,function(U){if(U){D(U);return}c(m(void 0,!0))})})}),i),v);k.exports=function(b){var c,D=Object.create(_,(c={},h(c,p,{value:b,writable:!0}),h(c,r,{value:null,writable:!0}),h(c,f,{value:null,writable:!0}),h(c,R,{value:null,writable:!0}),h(c,C,{value:b._readableState.endEmitted,writable:!0}),h(c,N,{value:function(w,q){var Q=D[p].read();Q?(D[A]=null,D[r]=null,D[f]=null,w(m(Q,!1))):(D[r]=w,D[f]=q)},writable:!0}),c));return D[A]=null,a(b,function(U){if(U&&U.code!=="ERR_STREAM_PREMATURE_CLOSE"){var w=D[f];w!==null&&(D[A]=null,D[r]=null,D[f]=null,w(U)),D[R]=U;return}var q=D[r];q!==null&&(D[A]=null,D[r]=null,D[f]=null,q(m(void 0,!0))),D[C]=!0}),b.on("readable",S.bind(null,D)),D}})),An=se(((l,k)=>{k.exports=function(){throw new Error("Readable.from is not available in the browser")}})),tr=se(((l,k)=>{Me(),Oe(),k.exports=q;var i;q.ReadableState=w,ht().EventEmitter;var h=function(P,o){return P.listeners(o).length},d=jt(),n=Qe().Buffer,a=(typeof ye<"u"?ye:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function r(B){return n.from(B)}function f(B){return n.isBuffer(B)||B instanceof a}var R=Xt(),C;R&&R.debuglog?C=R.debuglog("stream"):C=function(){};var A=_n(),N=Jt(),p=Qt().getHighWaterMark,m=Ue().codes,g=m.ERR_INVALID_ARG_TYPE,S=m.ERR_STREAM_PUSH_AFTER_EOF,O=m.ERR_METHOD_NOT_IMPLEMENTED,v=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,_,x,b;Ce()(q,d);var c=N.errorOrDestroy,D=["error","close","destroy","pause","resume"];function U(B,P,o){if(typeof B.prependListener=="function")return B.prependListener(P,o);!B._events||!B._events[P]?B.on(P,o):Array.isArray(B._events[P])?B._events[P].unshift(o):B._events[P]=[o,B._events[P]]}function w(B,P,o){i=i||Le(),B=B||{},typeof o!="boolean"&&(o=P instanceof i),this.objectMode=!!B.objectMode,o&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=p(this,B,"readableHighWaterMark",o),this.buffer=new A,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.paused=!0,this.emitClose=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(_||(_=ft().StringDecoder),this.decoder=new _(B.encoding),this.encoding=B.encoding)}function q(B){if(i=i||Le(),!(this instanceof q))return new q(B);var P=this instanceof i;this._readableState=new w(B,this,P),this.readable=!0,B&&(typeof B.read=="function"&&(this._read=B.read),typeof B.destroy=="function"&&(this._destroy=B.destroy)),d.call(this)}Object.defineProperty(q.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(P){this._readableState&&(this._readableState.destroyed=P)}}),q.prototype.destroy=N.destroy,q.prototype._undestroy=N.undestroy,q.prototype._destroy=function(B,P){P(B)},q.prototype.push=function(B,P){var o=this._readableState,K;return o.objectMode?K=!0:typeof B=="string"&&(P=P||o.defaultEncoding,P!==o.encoding&&(B=n.from(B,P),P=""),K=!0),Q(this,B,P,!1,K)},q.prototype.unshift=function(B){return Q(this,B,null,!0,!1)};function Q(B,P,o,K,T){C("readableAddChunk",P);var e=B._readableState;if(P===null)e.reading=!1,Y(B,e);else{var t;if(T||(t=W(e,P)),t)c(B,t);else if(e.objectMode||P&&P.length>0)if(typeof P!="string"&&!e.objectMode&&Object.getPrototypeOf(P)!==n.prototype&&(P=r(P)),K)e.endEmitted?c(B,new v):I(B,e,P,!0);else if(e.ended)c(B,new S);else{if(e.destroyed)return!1;e.reading=!1,e.decoder&&!o?(P=e.decoder.write(P),e.objectMode||P.length!==0?I(B,e,P,!1):ee(B,e)):I(B,e,P,!1)}else K||(e.reading=!1,ee(B,e))}return!e.ended&&(e.length<e.highWaterMark||e.length===0)}function I(B,P,o,K){P.flowing&&P.length===0&&!P.sync?(P.awaitDrain=0,B.emit("data",o)):(P.length+=P.objectMode?1:o.length,K?P.buffer.unshift(o):P.buffer.push(o),P.needReadable&&ae(B)),ee(B,P)}function W(B,P){var o;return!f(P)&&typeof P!="string"&&P!==void 0&&!B.objectMode&&(o=new g("chunk",["string","Buffer","Uint8Array"],P)),o}q.prototype.isPaused=function(){return this._readableState.flowing===!1},q.prototype.setEncoding=function(B){_||(_=ft().StringDecoder);var P=new _(B);this._readableState.decoder=P,this._readableState.encoding=this._readableState.decoder.encoding;
10for(var o=this._readableState.buffer.head,K="";o!==null;)K+=P.write(o.data),o=o.next;return this._readableState.buffer.clear(),K!==""&&this._readableState.buffer.push(K),this._readableState.length=K.length,this};var E=1073741824;function H(B){return B>=E?B=E:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}function J(B,P){return B<=0||P.length===0&&P.ended?0:P.objectMode?1:B!==B?P.flowing&&P.length?P.buffer.head.data.length:P.length:(B>P.highWaterMark&&(P.highWaterMark=H(B)),B<=P.length?B:P.ended?P.length:(P.needReadable=!0,0))}q.prototype.read=function(B){C("read",B),B=parseInt(B,10);var P=this._readableState,o=B;if(B!==0&&(P.emittedReadable=!1),B===0&&P.needReadable&&((P.highWaterMark!==0?P.length>=P.highWaterMark:P.length>0)||P.ended))return C("read: emitReadable",P.length,P.ended),P.length===0&&P.ended?j(this):ae(this),null;if(B=J(B,P),B===0&&P.ended)return P.length===0&&j(this),null;var K=P.needReadable;C("need readable",K),(P.length===0||P.length-B<P.highWaterMark)&&(K=!0,C("length less than watermark",K)),P.ended||P.reading?(K=!1,C("reading or ended",K)):K&&(C("do read"),P.reading=!0,P.sync=!0,P.length===0&&(P.needReadable=!0),this._read(P.highWaterMark),P.sync=!1,P.reading||(B=J(o,P)));var T;return B>0?T=s(B,P):T=null,T===null?(P.needReadable=P.length<=P.highWaterMark,B=0):(P.length-=B,P.awaitDrain=0),P.length===0&&(P.ended||(P.needReadable=!0),o!==B&&P.ended&&j(this)),T!==null&&this.emit("data",T),T};function Y(B,P){if(C("onEofChunk"),!P.ended){if(P.decoder){var o=P.decoder.end();o&&o.length&&(P.buffer.push(o),P.length+=P.objectMode?1:o.length)}P.ended=!0,P.sync?ae(B):(P.needReadable=!1,P.emittedReadable||(P.emittedReadable=!0,$(B)))}}function ae(B){var P=B._readableState;C("emitReadable",P.needReadable,P.emittedReadable),P.needReadable=!1,P.emittedReadable||(C("emitReadable",P.flowing),P.emittedReadable=!0,de.nextTick($,B))}function $(B){var P=B._readableState;C("emitReadable_",P.destroyed,P.length,P.ended),!P.destroyed&&(P.length||P.ended)&&(B.emit("readable"),P.emittedReadable=!1),P.needReadable=!P.flowing&&!P.ended&&P.length<=P.highWaterMark,y(B)}function ee(B,P){P.readingMore||(P.readingMore=!0,de.nextTick(V,B,P))}function V(B,P){for(;!P.reading&&!P.ended&&(P.length<P.highWaterMark||P.flowing&&P.length===0);){var o=P.length;if(C("maybeReadMore read 0"),B.read(0),o===P.length)break}P.readingMore=!1}q.prototype._read=function(B){c(this,new O("_read()"))},q.prototype.pipe=function(B,P){var o=this,K=this._readableState;switch(K.pipesCount){case 0:K.pipes=B;break;case 1:K.pipes=[K.pipes,B];break;default:K.pipes.push(B);break}K.pipesCount+=1,C("pipe count=%d opts=%j",K.pipesCount,P);var T=(!P||P.end!==!1)&&B!==de.stdout&&B!==de.stderr?t:le;K.endEmitted?de.nextTick(T):o.once("end",T),B.on("unpipe",e);function e(ce,fe){C("onunpipe"),ce===o&&fe&&fe.hasUnpiped===!1&&(fe.hasUnpiped=!0,G())}function t(){C("onend"),B.end()}var u=F(o);B.on("drain",u);var L=!1;function G(){C("cleanup"),B.removeListener("close",oe),B.removeListener("finish",ie),B.removeListener("drain",u),B.removeListener("error",ne),B.removeListener("unpipe",e),o.removeListener("end",t),o.removeListener("end",le),o.removeListener("data",z),L=!0,K.awaitDrain&&(!B._writableState||B._writableState.needDrain)&&u()}o.on("data",z);function z(ce){C("ondata");var fe=B.write(ce);C("dest.write",fe),fe===!1&&((K.pipesCount===1&&K.pipes===B||K.pipesCount>1&&re(K.pipes,B)!==-1)&&!L&&(C("false write response, pause",K.awaitDrain),K.awaitDrain++),o.pause())}function ne(ce){C("onerror",ce),le(),B.removeListener("error",ne),h(B,"error")===0&&c(B,ce)}U(B,"error",ne);function oe(){B.removeListener("finish",ie),le()}B.once("close",oe);function ie(){C("onfinish"),B.removeListener("close",oe),le()}B.once("finish",ie);function le(){C("unpipe"),o.unpipe(B)}return B.emit("pipe",o),K.flowing||(C("pipe resume"),o.resume()),B};function F(B){return function(){var o=B._readableState;C("pipeOnDrain",o.awaitDrain),o.awaitDrain&&o.awaitDrain--,o.awaitDrain===0&&h(B,"data")&&(o.flowing=!0,y(B))}}q.prototype.unpipe=function(B){var P=this._readableState,o={hasUnpiped:!1};if(P.pipesCount===0)return this;if(P.pipesCount===1)return B&&B!==P.pipes?this:(B||(B=P.pipes),P.pipes=null,P.pipesCount=0,P.flowing=!1,B&&B.emit("unpipe",this,o),this);if(!B){var K=P.pipes,T=P.pipesCount;P.pipes=null,P.pipesCount=0,P.flowing=!1;for(var e=0;e<T;
10e++)K[e].emit("unpipe",this,{hasUnpiped:!1});return this}var t=re(P.pipes,B);return t===-1?this:(P.pipes.splice(t,1),P.pipesCount-=1,P.pipesCount===1&&(P.pipes=P.pipes[0]),B.emit("unpipe",this,o),this)},q.prototype.on=function(B,P){var o=d.prototype.on.call(this,B,P),K=this._readableState;return B==="data"?(K.readableListening=this.listenerCount("readable")>0,K.flowing!==!1&&this.resume()):B==="readable"&&!K.endEmitted&&!K.readableListening&&(K.readableListening=K.needReadable=!0,K.flowing=!1,K.emittedReadable=!1,C("on readable",K.length,K.reading),K.length?ae(this):K.reading||de.nextTick(X,this)),o},q.prototype.addListener=q.prototype.on,q.prototype.removeListener=function(B,P){var o=d.prototype.removeListener.call(this,B,P);return B==="readable"&&de.nextTick(Z,this),o},q.prototype.removeAllListeners=function(B){var P=d.prototype.removeAllListeners.apply(this,arguments);return(B==="readable"||B===void 0)&&de.nextTick(Z,this),P};function Z(B){var P=B._readableState;P.readableListening=B.listenerCount("readable")>0,P.resumeScheduled&&!P.paused?P.flowing=!0:B.listenerCount("data")>0&&B.resume()}function X(B){C("readable nexttick read 0"),B.read(0)}q.prototype.resume=function(){var B=this._readableState;return B.flowing||(C("resume"),B.flowing=!B.readableListening,te(this,B)),B.paused=!1,this};function te(B,P){P.resumeScheduled||(P.resumeScheduled=!0,de.nextTick(ue,B,P))}function ue(B,P){C("resume",P.reading),P.reading||B.read(0),P.resumeScheduled=!1,B.emit("resume"),y(B),P.flowing&&!P.reading&&B.read(0)}q.prototype.pause=function(){return C("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(C("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function y(B){var P=B._readableState;for(C("flow",P.flowing);P.flowing&&B.read()!==null;);}q.prototype.wrap=function(B){var P=this,o=this._readableState,K=!1;B.on("end",function(){if(C("wrapped end"),o.decoder&&!o.ended){var t=o.decoder.end();t&&t.length&&P.push(t)}P.push(null)}),B.on("data",function(t){C("wrapped data"),o.decoder&&(t=o.decoder.write(t)),!(o.objectMode&&t==null)&&(!o.objectMode&&(!t||!t.length)||P.push(t)||(K=!0,B.pause()))});for(var T in B)this[T]===void 0&&typeof B[T]=="function"&&(this[T]=(function(u){return function(){return B[u].apply(B,arguments)}})(T));for(var e=0;e<D.length;e++)B.on(D[e],this.emit.bind(this,D[e]));return this._read=function(t){C("wrapped _read",t),K&&(K=!1,B.resume())},this},typeof Symbol=="function"&&(q.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=xn()),x(this)}),Object.defineProperty(q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(P){this._readableState&&(this._readableState.flowing=P)}}),q._fromList=s,Object.defineProperty(q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function s(B,P){if(P.length===0)return null;var o;return P.objectMode?o=P.buffer.shift():!B||B>=P.length?(P.decoder?o=P.buffer.join(""):P.buffer.length===1?o=P.buffer.first():o=P.buffer.concat(P.length),P.buffer.clear()):o=P.buffer.consume(B,P.decoder),o}function j(B){var P=B._readableState;C("endReadable",P.endEmitted),P.endEmitted||(P.ended=!0,de.nextTick(M,P,B))}function M(B,P){if(C("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&B.length===0&&(B.endEmitted=!0,P.readable=!1,P.emit("end"),B.autoDestroy)){var o=P._writableState;(!o||o.autoDestroy&&o.finished)&&P.destroy()}}typeof Symbol=="function"&&(q.from=function(B,P){return b===void 0&&(b=An()),b(q,B,P)});function re(B,P){for(var o=0,K=B.length;o<K;o++)if(B[o]===P)return o;return-1}})),rr=se(((l,k)=>{k.exports=R;var i=Ue().codes,h=i.ERR_METHOD_NOT_IMPLEMENTED,d=i.ERR_MULTIPLE_CALLBACK,n=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,r=Le();Ce()(R,r);function f(N,p){var m=this._transformState;m.transforming=!1;var g=m.writecb;
10if(g===null)return this.emit("error",new d);m.writechunk=null,m.writecb=null,p!=null&&this.push(p),g(N);var S=this._readableState;S.reading=!1,(S.needReadable||S.length<S.highWaterMark)&&this._read(S.highWaterMark)}function R(N){if(!(this instanceof R))return new R(N);r.call(this,N),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,N&&(typeof N.transform=="function"&&(this._transform=N.transform),typeof N.flush=="function"&&(this._flush=N.flush)),this.on("prefinish",C)}function C(){var N=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(p,m){A(N,p,m)}):A(this,null,null)}R.prototype.push=function(N,p){return this._transformState.needTransform=!1,r.prototype.push.call(this,N,p)},R.prototype._transform=function(N,p,m){m(new h("_transform()"))},R.prototype._write=function(N,p,m){var g=this._transformState;if(g.writecb=m,g.writechunk=N,g.writeencoding=p,!g.transforming){var S=this._readableState;(g.needTransform||S.needReadable||S.length<S.highWaterMark)&&this._read(S.highWaterMark)}},R.prototype._read=function(N){var p=this._transformState;p.writechunk!==null&&!p.transforming?(p.transforming=!0,this._transform(p.writechunk,p.writeencoding,p.afterTransform)):p.needTransform=!0},R.prototype._destroy=function(N,p){r.prototype._destroy.call(this,N,function(m){p(m)})};function A(N,p,m){if(p)return N.emit("error",p);if(m!=null&&N.push(m),N._writableState.length)throw new a;if(N._transformState.transforming)throw new n;return N.push(null)}})),Sn=se(((l,k)=>{k.exports=h;var i=rr();Ce()(h,i);function h(d){if(!(this instanceof h))return new h(d);i.call(this,d)}h.prototype._transform=function(d,n,a){a(null,d)}})),Tn=se(((l,k)=>{var i;function h(m){var g=!1;return function(){g||(g=!0,m.apply(void 0,arguments))}}var d=Ue().codes,n=d.ERR_MISSING_ARGS,a=d.ERR_STREAM_DESTROYED;function r(m){if(m)throw m}function f(m){return m.setHeader&&typeof m.abort=="function"}function R(m,g,S,O){O=h(O);var v=!1;m.on("close",function(){v=!0}),i===void 0&&(i=yt()),i(m,{readable:g,writable:S},function(x){if(x)return O(x);v=!0,O()});var _=!1;return function(x){if(!v&&!_){if(_=!0,f(m))return m.abort();if(typeof m.destroy=="function")return m.destroy();O(x||new a("pipe"))}}}function C(m){m()}function A(m,g){return m.pipe(g)}function N(m){return!m.length||typeof m[m.length-1]!="function"?r:m.pop()}function p(){for(var m=arguments.length,g=new Array(m),S=0;S<m;S++)g[S]=arguments[S];var O=N(g);if(Array.isArray(g[0])&&(g=g[0]),g.length<2)throw new n("streams");var v,_=g.map(function(x,b){var c=b<g.length-1;return R(x,c,b>0,function(D){v||(v=D),D&&_.forEach(C),!c&&(_.forEach(C),O(v))})});return g.reduce(A)}k.exports=p})),bt=se(((l,k)=>{k.exports=h;var i=ht().EventEmitter;Ce()(h,i),h.Readable=tr(),h.Writable=er(),h.Duplex=Le(),h.Transform=rr(),h.PassThrough=Sn(),h.finished=yt(),h.pipeline=Tn(),h.Stream=h;function h(){i.call(this)}h.prototype.pipe=function(d,n){var a=this;function r(m){d.writable&&d.write(m)===!1&&a.pause&&a.pause()}a.on("data",r);function f(){a.readable&&a.resume&&a.resume()}d.on("drain",f),!d._isStdio&&(!n||n.end!==!1)&&(a.on("end",C),a.on("close",A));var R=!1;function C(){R||(R=!0,d.end())}function A(){R||(R=!0,typeof d.destroy=="function"&&d.destroy())}function N(m){if(p(),i.listenerCount(this,"error")===0)throw m}a.on("error",N),d.on("error",N);function p(){a.removeListener("data",r),d.removeListener("drain",f),a.removeListener("end",C),a.removeListener("close",A),a.removeListener("error",N),d.removeListener("error",N),a.removeListener("end",p),a.removeListener("close",p),d.removeListener("close",p)}return a.on("end",p),a.on("close",p),d.on("close",p),d.emit("pipe",a),d}})),kn=se((l=>{(function(k){k.parser=function(y,s){return new h(y,s)},k.SAXParser=h,k.SAXStream=C,k.createStream=R,k.MAX_BUFFER_LENGTH=64*1024;var i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];k.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function h(y,s){if(!(this instanceof h))return new h(y,s);var j=this;n(j),j.q=j.c="",j.bufferCheckPosition=k.MAX_BUFFER_LENGTH,j.opt=s||{},j.opt.lowercase=j.opt.lowercase||j.opt.lowercasetags,j.looseCase=j.opt.lowercase?"toLowerCase":"toUpperCase",j.tags=[],j.closed=j.closedRoot=j.sawRoot=!1,j.tag=j.error=null,j.str
10ict=!!y,j.noscript=!!(y||j.opt.noscript),j.state=w.BEGIN,j.strictEntities=j.opt.strictEntities,j.ENTITIES=j.strictEntities?Object.create(k.XML_ENTITIES):Object.create(k.ENTITIES),j.attribList=[],j.opt.xmlns&&(j.ns=Object.create(g)),j.trackPosition=j.opt.position!==!1,j.trackPosition&&(j.position=j.line=j.column=0),Q(j,"onready")}Object.create||(Object.create=function(y){function s(){}return s.prototype=y,new s}),Object.keys||(Object.keys=function(y){var s=[];for(var j in y)y.hasOwnProperty(j)&&s.push(j);return s});function d(y){for(var s=Math.max(k.MAX_BUFFER_LENGTH,10),j=0,M=0,re=i.length;M<re;M++){var B=y[i[M]].length;if(B>s)switch(i[M]){case"textNode":W(y);break;case"cdata":I(y,"oncdata",y.cdata),y.cdata="";break;case"script":I(y,"onscript",y.script),y.script="";break;default:H(y,"Max buffer length exceeded: "+i[M])}j=Math.max(j,B)}y.bufferCheckPosition=k.MAX_BUFFER_LENGTH-j+y.position}function n(y){for(var s=0,j=i.length;s<j;s++)y[i[s]]=""}function a(y){W(y),y.cdata!==""&&(I(y,"oncdata",y.cdata),y.cdata=""),y.script!==""&&(I(y,"onscript",y.script),y.script="")}h.prototype={end:function(){J(this)},write:ue,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};var r;try{r=bt().Stream}catch{r=function(){}}var f=k.EVENTS.filter(function(y){return y!=="error"&&y!=="end"});function R(y,s){return new C(y,s)}function C(y,s){if(!(this instanceof C))return new C(y,s);r.apply(this),this._parser=new h(y,s),this.writable=!0,this.readable=!0;var j=this;this._parser.onend=function(){j.emit("end")},this._parser.onerror=function(M){j.emit("error",M),j._parser.error=null},this._decoder=null,f.forEach(function(M){Object.defineProperty(j,"on"+M,{get:function(){return j._parser["on"+M]},set:function(re){if(!re)return j.removeAllListeners(M),j._parser["on"+M]=re,re;j.on(M,re)},enumerable:!0,configurable:!1})})}C.prototype=Object.create(r.prototype,{constructor:{value:C}}),C.prototype.write=function(y){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(y)){if
10(!this._decoder){var s=ft().StringDecoder;this._decoder=new s("utf8")}y=this._decoder.write(y)}return this._parser.write(y.toString()),this.emit("data",y),!0},C.prototype.end=function(y){return y&&y.length&&this.write(y),this._parser.end(),!0},C.prototype.on=function(y,s){var j=this;return!j._parser["on"+y]&&f.indexOf(y)!==-1&&(j._parser["on"+y]=function(){var M=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);M.splice(0,0,y),j.emit.apply(j,M)}),r.prototype.on.call(j,y,s)};var A="[CDATA[",N="DOCTYPE",p="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/2000/xmlns/",g={xml:p,xmlns:m},S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,O=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function x(y){return y===" "||y===`
11`||y==="\r"||y==="	"}function b(y){return y==='"'||y==="'"}function c(y){return y===">"||x(y)}function D(y,s){return y.test(s)}function U(y,s){return!D(y,s)}var w=0;k.STATE={BEGIN:w++,BEGIN_WHITESPACE:w++,TEXT:w++,TEXT_ENTITY:w++,OPEN_WAKA:w++,SGML_DECL:w++,SGML_DECL_QUOTED:w++,DOCTYPE:w++,DOCTYPE_QUOTED:w++,DOCTYPE_DTD:w++,DOCTYPE_DTD_QUOTED:w++,COMMENT_STARTING:w++,COMMENT:w++,COMMENT_ENDING:w++,COMMENT_ENDED:w++,CDATA:w++,CDATA_ENDING:w++,CDATA_ENDING_2:w++,PROC_INST:w++,PROC_INST_BODY:w++,PROC_INST_ENDING:w++,OPEN_TAG:w++,OPEN_TAG_SLASH:w++,ATTRIB:w++,ATTRIB_NAME:w++,ATTRIB_NAME_SAW_WHITE:w++,ATTRIB_VALUE:w++,ATTRIB_VALUE_QUOTED:w++,ATTRIB_VALUE_CLOSED:w++,ATTRIB_VALUE_UNQUOTED:w++,ATTRIB_VALUE_ENTITY_Q:w++,ATTRIB_VALUE_ENTITY_U:w++,CLOSE_TAG:w++,CLOSE_TAG_SAW_WHITE:w++,SCRIPT:w++,SCRIPT_ENDING:w++},k.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:1
vendor: 4,122 bytes, lines 11-16
1174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(k.ENTITIES).forEach(function(y){var s=k.ENTITIES[y],j=typeof s=="number"?String.fromCharCode(s):s;k.ENTITIES[y]=j});for(var q in k.STATE)k.STATE[k.STATE[q]]=q;w=k.STATE;function Q(y,s,j){y[s]&&y[s](j)}function I(y,s,j){y.textNode&&W(y),Q(y,s,j)}function W(y){y.textNode=E(y.opt,y.textNode),y.textNode&&Q(y,"ontext",y.textNode),y.textNode=""}function E(y,s){return y.trim&&(s=s.trim()),y.normalize&&(s=s.replace(/\s+/g," ")),s}function H(y,s){return W(y),y.trackPosition&&(s+=`
12Line: `+y.line+`
13Column: `+y.column+`
14Char: `+y.c),s=new Error(s),y.error=s,Q(y,"onerror",s),y}function J(y){return y.sawRoot&&!y.closedRoot&&Y(y,"Unclosed root tag"),y.state!==w.BEGIN&&y.state!==w.BEGIN_WHITESPACE&&y.state!==w.TEXT&&H(y,"Unexpected end"),W(y),y.c="",y.closed=!0,Q(y,"onend"),h.call(y,y.strict,y.opt),y}function Y(y,s){if(typeof y!="object"||!(y instanceof h))throw new Error("bad call to strictFail");y.strict&&H(y,s)}function ae(y){y.strict||(y.tagName=y.tagName[y.looseCase]());var s=y.tags[y.tags.length-1]||y,j=y.tag={name:y.tagName,attributes:{}};y.opt.xmlns&&(j.ns=s.ns),y.attribList.length=0,I(y,"onopentagstart",j)}function $(y,s){var j=y.indexOf(":")<0?["",y]:y.split(":"),M=j[0],re=j[1];return s&&y==="xmlns"&&(M="xmlns",re=""),{prefix:M,local:re}}function ee(y){if(y.strict||(y.attribName=y.attribName[y.looseCase]()),y.attribList.indexOf(y.attribName)!==-1||y.tag.attributes.hasOwnProperty(y.attribName)){y.attribName=y.attribValue="";return}if(y.opt.xmlns){var s=$(y.attribName,!0),j=s.prefix,M=s.local;if(j==="xmlns")if(M==="xml"&&y.attribValue!==p)Y(y,"xml: prefix must be bound to "+p+`
15Actual: `+y.attribValue);else if(M==="xmlns"&&y.attribValue!==m)Y(y,"xmlns: prefix must be bound to "+m+`
16Actual: `+y.attribValue);else{var re=y.tag,B=y.tags[y.tags.length-1]||y;re.ns===B.ns&&(re.ns=Object.create(B.ns)),re.ns[M]=y.attribValue}y.attribList.push([y.attribName,y.attribValue])}else y.tag.attributes[y.attribName]=y.attribValue,I(y,"onattribute",{name:y.attribName,value:y.attribValue});y.attribName=y.attribValue=""}function V(y,s){if(y.opt.xmlns){var j=y.tag,M=$(y.tagName);j.prefix=M.prefix,j.local=M.local,j.uri=j.ns[M.prefix]||"",j.prefix&&!j.uri&&(Y(y,"Unbound namespace prefix: "+JSON.stringify(y.tagName)),j.uri=M.prefix);var re=y.tags[y.tags.length-1]||y;
16j.ns&&re.ns!==j.ns&&Object.keys(j.ns).forEach(function(z){I(y,"onopennamespace",{prefix:z,uri:j.ns[z]})});for(var B=0,P=y.attribList.length;B<P;B++){var o=y.attribList[B],K=o[0],T=o[1],e=$(K,!0),t=e.prefix,u=e.local,L=t===""?"":j.ns[t]||"",G={name:K,value:T,prefix:t,local:u,uri:L};t&&t!=="xmlns"&&!L&&(Y(y,"Unbound namespace prefix: "+JSON.stringify(t)),G.uri=t),y.tag.attributes[K]=G,I(y,"onattribute",G)}y.attribList.length=0}y.tag.isSelfClosing=!!s,y.sawRoot=!0,y.tags.push(y.tag),I(y,"onopentag",y.tag),s||(!y.noscript&&y.tagName.toLowerCase()==="script"?y.state=w.SCRIPT:y.state=w.TEXT,y.tag=null,y.tagName=""),y.attribName=y.attribValue="",y.attribList.length=0}function F(y){if(!y.tagName){Y(y,"Weird empty close tag."),y.textNode+="</>",y.state=w.TEXT;return}if(y.script){if(y.tagName!=="script"){y.script+="</"+y.tagName+">",y.tagName="",y.state=w.SCRIPT;return}I(y,"onscript",y.script),y.script=""}var s=y.tags.length,j=y.tagName;y.strict||(j=j[y.looseCase]());for(var M=j;s--&&y.tags[s].name!==M;)Y(y,"Unexpected close tag");if(s<0){Y(y,"Unmatched closing tag: "+y.tagName),y.textNode+="</"+y.tagName+">",y.state=w.TEXT;return}y.tagName=j;for(var re=y.tags.length;re-- >s;){var B=y.tag=y.tags.pop();y.tagName=y.tag.name,I(y,"onclosetag",y.tagName);var P={};for(var o in B.ns)P[o]=B.ns[o];var K=y.tags[y.tags.length-1]||y;y.opt.xmlns&&B.ns!==K.ns&&Object.keys(B.ns).forEach(function(T){var e=B.ns[T];I(y,"onclosenamespace",{prefix:T,uri:e})})}s===0&&(y.closedRoot=!0),y.tagName=y.attribValue=y.attribName="",y.attribList.length=0,y.state=w.TEXT}function Z(y){var s=y.entity,j=s.toLowerCase(),M,re="";return y.ENTITIES[s]?y.ENTITIES[s]:y.ENTITIES[j]?y.ENTITIES[j]:(s=j,s.charAt(0)==="#"&&(s.charAt(1)==="x"?(s=s.slice(2),M=parseInt(s,16),re=M.toString(16)):(s=s.slice(1),M=parseInt(s,10),re=M.toString(10))),s=s.replace(/^0+/,""),isNaN(M)||re.toLowerCase()!==s?(Y(y,"Invalid character entity"),"&"+y.entity+";"):String.fromCodePoint(M))}function X(y,s){s==="<"?(y.state=w.OPEN_WAKA,y.startTagPosition=y.position):x(s)||(Y(y,"Non-whitespace before first tag."),y.textNode=s,y.state=w.TEXT)}function te(y,s){var j="";return s<y.length&&(j=y.charAt(s)),j}function ue(y){var s=this;if(this.error)throw this.error;if(s.closed)return H(s,"Cannot write after close. Assign an onready handler.");if(y===null)return J(s);typeof y=="object"&&(y=y.toString());for(var j=0,M="";M=te(y,j++),s.c=M,!!M;)switch(s.trackPosition&&(s.position++,M===`
17`?(s.line++,s.column=0):s.column++),s.state){case w.BEGIN:if(s.state=w.BEGIN_WHITESPACE,M==="\uFEFF")continue;X(s,M);continue;case w.BEGIN_WHITESPACE:X(s,M);continue;case w.TEXT:if(s.sawRoot&&!s.closedRoot){for(var re=j-1;M&&M!=="<"&&M!=="&";)M=te(y,j++),M&&s.trackPosition&&(s.position++,M===`
18`?(s.line++,s.column=0):s.column++);s.textNode+=y.substring(re,j-1)}M==="<"&&!(s.sawRoot&&s.closedRoot&&!s.strict)?(s.state=w.OPEN_WAKA,s.startTagPosition=s.position):(!x(M)&&(!s.sawRoot||s.closedRoot)&&Y(s,"Text data outside of root node."),M==="&"?s.state=w.TEXT_ENTITY:s.textNode+=M);continue;case w.SCRIPT:M==="<"?s.state=w.SCRIPT_ENDING:s.script+=M;continue;case w.SCRIPT_ENDING:M==="/"?s.state=w.CLOSE_TAG:(s.script+="<"+M,s.state=w.SCRIPT);continue;case w.OPEN_WAKA:if(M==="!")s.state=w.SGML_DECL,s.sgmlDecl="";else if(!x(M))if(D(S,M))s.state=w.OPEN_TAG,s.tagName=M;else if(M==="/")s.state=w.CLOSE_TAG,s.tagName="";else if(M==="?")s.state=w.PROC_INST,s.procInstName=s.procInstBody="";else{if(Y(s,"Unencoded <"),s.startTagPosition+1<s.position){var B=s.position-s.startTagPosition;M=new Array(B).join(" ")+M}s.textNode+="<"+M,s.state=w.TEXT}continue;case w.SGML_DECL:(s.sgmlDecl+M).toUpperCase()===A?(I(s,"onopencdata"),s.state=w.CDATA,s.sgmlDecl="",s.cdata=""):s.sgmlDecl+M==="--"?(s.state=w.COMMENT,s.comment="",s.sgmlDecl=""):(s.sgmlDecl+M).toUpperCase()===N?(s.state=w.DOCTYPE,(s.doctype||s.sawRoot)&&Y(s,"Inappropriately located doctype declaration"),s.doctype="",s.sgmlDecl=""):M===">"?(I(s,"onsgmldeclaration",s.sgmlDecl),s.sgmlDecl="",s.state=w.TEXT):(b(M)&&(s.state=w.SGML_DECL_QUOTED),s.sgmlDecl+=M);continue;case w.SGML_DECL_QUOTED:M===s.q&&(s.state=w.SGML_DECL,s.q=""),s.sgmlDecl+=M;continue;case w.DOCTYPE:M===">"?(s.state=w.TEXT,I(s,"ondoctype",s.doctype),s.doctype=!0):(s.doctype+=M,M==="["?s.state=w.DOCTYPE_DTD:b(M)&&(s.state=w.DOCTYPE_QUOTED,s.q=M));continue;case w.DOCTYPE_QUOTED:s.doctype+=M,M===s.q&&(s.q="",s.state=w.DOCTYPE);continue;case w.DOCTYPE_DTD:s.doctype+=M,M==="]"?s.state=w.DOCTYPE:b(M)&&(s.state=w.DOCTYPE_DTD_QUOTED,s.q=M);continue;case w.DOCTYPE_DTD_QUOTED:s.doctype+=M,M===s.q&&(s.state=w.DOCTYPE_DTD,s.q="");continue;case w.COMMENT:M==="-"?s.state=w.COMMENT_ENDING:s.comment+=M;continue;case w.COMMENT_ENDING:M==="-"?(s.state=w.COMMENT_ENDED,s.comment=E(s.opt,s.comment),s.comment&&I(s,"oncomment",s.comment),s.comment=""):(s.comment+="-"+M,s.state=w.COMMENT);continue;case w.COMMENT_ENDED:M!==">"?(Y(s,"Malformed comment"),s.comment+="--"+M,s.state=w.COMMENT):s.state=w.TEXT;continue;case w.CDATA:M==="]"?s.state=w.CDATA_ENDING:s.cdata+=M;continue;case w.CDATA_ENDING:M==="]"?s.state=w.CDATA_ENDING_2:(s.cdata+="]"
18+M,s.state=w.CDATA);continue;case w.CDATA_ENDING_2:M===">"?(s.cdata&&I(s,"oncdata",s.cdata),I(s,"onclosecdata"),s.cdata="",s.state=w.TEXT):M==="]"?s.cdata+="]":(s.cdata+="]]"+M,s.state=w.CDATA);continue;case w.PROC_INST:M==="?"?s.state=w.PROC_INST_ENDING:x(M)?s.state=w.PROC_INST_BODY:s.procInstName+=M;continue;case w.PROC_INST_BODY:if(!s.procInstBody&&x(M))continue;M==="?"?s.state=w.PROC_INST_ENDING:s.procInstBody+=M;continue;case w.PROC_INST_ENDING:M===">"?(I(s,"onprocessinginstruction",{name:s.procInstName,body:s.procInstBody}),s.procInstName=s.procInstBody="",s.state=w.TEXT):(s.procInstBody+="?"+M,s.state=w.PROC_INST_BODY);continue;case w.OPEN_TAG:D(O,M)?s.tagName+=M:(ae(s),M===">"?V(s):M==="/"?s.state=w.OPEN_TAG_SLASH:(x(M)||Y(s,"Invalid character in tag name"),s.state=w.ATTRIB));continue;case w.OPEN_TAG_SLASH:M===">"?(V(s,!0),F(s)):(Y(s,"Forward-slash in opening tag not followed by >"),s.state=w.ATTRIB);continue;case w.ATTRIB:if(x(M))continue;M===">"?V(s):M==="/"?s.state=w.OPEN_TAG_SLASH:D(S,M)?(s.attribName=M,s.attribValue="",s.state=w.ATTRIB_NAME):Y(s,"Invalid attribute name");continue;case w.ATTRIB_NAME:M==="="?s.state=w.ATTRIB_VALUE:M===">"?(Y(s,"Attribute without value"),s.attribValue=s.attribName,ee(s),V(s)):x(M)?s.state=w.ATTRIB_NAME_SAW_WHITE:D(O,M)?s.attribName+=M:Y(s,"Invalid attribute name");continue;case w.ATTRIB_NAME_SAW_WHITE:if(M==="=")s.state=w.ATTRIB_VALUE;else{if(x(M))continue;Y(s,"Attribute without value"),s.tag.attributes[s.attribName]="",s.attribValue="",I(s,"onattribute",{name:s.attribName,value:""}),s.attribName="",M===">"?V(s):D(S,M)?(s.attribName=M,s.state=w.ATTRIB_NAME):(Y(s,"Invalid attribute name"),s.state=w.ATTRIB)}continue;case w.ATTRIB_VALUE:if(x(M))continue;b(M)?(s.q=M,s.state=w.ATTRIB_VALUE_QUOTED):(Y(s,"Unquoted attribute value"),s.state=w.ATTRIB_VALUE_UNQUOTED,s.attribValue=M);continue;case w.ATTRIB_VALUE_QUOTED:if(M!==s.q){M==="&"?s.state=w.ATTRIB_VALUE_ENTITY_Q:s.attribValue+=M;continue}ee(s),s.q="",s.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:x(M)?s.state=w.ATTRIB:M===">"?V(s):M==="/"?s.state=w.OPEN_TAG_SLASH:D(S,M)?(Y(s,"No whitespace between attributes"),s.attribName=M,s.attribValue="",s.state=w.ATTRIB_NAME):Y(s,"Invalid attribute name");continue;case w.ATTRIB_VALUE_UNQUOTED:if(!c(M)){M==="&"?s.state=w.ATTRIB_VALUE_ENTITY_U:s.attribValue+=M;continue}ee(s),M===">"?V(s):s.state=w.ATTRIB;continue;case w.CLOSE_TAG:if(s.tagName)M===">"?F(s):D(O,M)?s.tagName+=M:s.script?(s.script+="</"+s.tagName,s.tagName="",s.state=w.SCRIPT):(x(M)||Y(s,"Invalid tagname in closing tag"),s.state=w.CLOSE_TAG_SAW_WHITE);else{if(x(M))continue;U(S,M)?s.script?(s.script+="</"+M,s.state=w.SCRIPT):Y(s,"Invalid tagname in closing tag."):s.tagName=M}continue;case w.CLOSE_TAG_SAW_WHITE:if(x(M))continue;M===">"?F(s):Y(s,"Invalid characters in closing tag");continue;case w.TEXT_ENTITY:case w.ATTRIB_VALUE_ENTITY_Q:case w.ATTRIB_VALUE_ENTITY_U:var P,o;switch(s.state){case w.TEXT_ENTITY:P=w.TEXT,o="textNode";break;case w.ATTRIB_VALUE_ENTITY_Q:P=w.ATTRIB_VALUE_QUOTED,o="attribValue";break;case w.ATTRIB_VALUE_ENTITY_U:P=w.ATTRIB_VALUE_UNQUOTED,o="attribValue";break}M===";"?(s[o]+=Z(s),s.entity="",s.state=P):D(s.entity.length?_:v,M)?s.entity+=M:(Y(s,"Invalid character in entity name"),s[o]+="&"+s.entity+M,s.entity="",s.state=P);continue;default:throw new Error(s,"Unknown state: "+s.state)}return s.position>=s.bufferCheckPosition&&d(s),s}String.fromCodePoint||(function(){var y=String.fromCharCode,s=Math.floor,j=function(){var M=16384,re=[],B,P,o=-1,K=arguments.length;if(!K)return"";for(var T="";++o<K;){var e=Number(arguments[o]);if(!isFinite(e)||e<0||e>1114111||s(e)!==e)throw RangeError("Invalid code point: "+e);e<=65535?re.push(e):(e-=65536,B=(e>>10)+55296,P=e%1024+56320,re.push(B,P)),(o+1===K||re.length>M)&&(T+=y.apply(null,re),re.length=0)}return T};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:j,configurable:!0,writable:!0}):String.fromCodePoint=j})()})(typeof l>"u"?l.sax={}:l)})),_t=se(((l,k)=>{k.exports={isArray:function(i){return Array.isArray?Array.isArray(i):Object.prototype.toString.call(i)==="[object Array]"}}})),wt=se(((l,k)=>{var i=_t().isArray;k.exports={copyOptions:function(h){var d,n={};for(d in h)h.hasOwnProperty(d)&&(n[d]=h[d]);return n},ensureFlagExists:function(h,d){(!(h in d)||typeof d[h]!="boolean")&&(
18d[h]=!1)},ensureSpacesExists:function(h){(!("spaces"in h)||typeof h.spaces!="number"&&typeof h.spaces!="string")&&(h.spaces=0)},ensureAlwaysArrayExists:function(h){(!("alwaysArray"in h)||typeof h.alwaysArray!="boolean"&&!i(h.alwaysArray))&&(h.alwaysArray=!1)},ensureKeyExists:function(h,d){(!(h+"Key"in d)||typeof d[h+"Key"]!="string")&&(d[h+"Key"]=d.compact?"_"+h:h)},checkFnExists:function(h,d){return h+"Fn"in d}}})),nr=se(((l,k)=>{var i=kn(),h=wt(),d=_t().isArray,n,a;function r(_){return n=h.copyOptions(_),h.ensureFlagExists("ignoreDeclaration",n),h.ensureFlagExists("ignoreInstruction",n),h.ensureFlagExists("ignoreAttributes",n),h.ensureFlagExists("ignoreText",n),h.ensureFlagExists("ignoreComment",n),h.ensureFlagExists("ignoreCdata",n),h.ensureFlagExists("ignoreDoctype",n),h.ensureFlagExists("compact",n),h.ensureFlagExists("alwaysChildren",n),h.ensureFlagExists("addParent",n),h.ensureFlagExists("trim",n),h.ensureFlagExists("nativeType",n),h.ensureFlagExists("nativeTypeAttributes",n),h.ensureFlagExists("sanitize",n),h.ensureFlagExists("instructionHasAttributes",n),h.ensureFlagExists("captureSpacesBetweenElements",n),h.ensureAlwaysArrayExists(n),h.ensureKeyExists("declaration",n),h.ensureKeyExists("instruction",n),h.ensureKeyExists("attributes",n),h.ensureKeyExists("text",n),h.ensureKeyExists("comment",n),h.ensureKeyExists("cdata",n),h.ensureKeyExists("doctype",n),h.ensureKeyExists("type",n),h.ensureKeyExists("name",n),h.ensureKeyExists("elements",n),h.ensureKeyExists("parent",n),h.checkFnExists("doctype",n),h.checkFnExists("instruction",n),h.checkFnExists("cdata",n),h.checkFnExists("comment",n),h.checkFnExists("text",n),h.checkFnExists("instructionName",n),h.checkFnExists("elementName",n),h.checkFnExists("attributeName",n),h.checkFnExists("attributeValue",n),h.checkFnExists("attributes",n),n}function f(_){var x=Number(_);if(!isNaN(x))return x;var b=_.toLowerCase();return b==="true"?!0:b==="false"?!1:_}function R(_,x){var b;if(n.compact){if(!a[n[_+"Key"]]&&(d(n.alwaysArray)?n.alwaysArray.indexOf(n[_+"Key"])!==-1:n.alwaysArray)&&(a[n[_+"Key"]]=[]),a[n[_+"Key"]]&&!d(a[n[_+"Key"]])&&(a[n[_+"Key"]]=[a[n[_+"Key"]]]),_+"Fn"in n&&typeof x=="string"&&(x=n[_+"Fn"](x,a)),_==="instruction"&&("instructionFn"in n||"instructionNameFn"in n)){for(b in x)if(x.hasOwnProperty(b))if("instructionFn"in n)x[b]=n.instructionFn(x[b],b,a);else{var c=x[b];delete x[b],x[n.instructionNameFn(b,c,a)]=c}}d(a[n[_+"Key"]])?a[n[_+"Key"]].push(x):a[n[_+"Key"]]=x}else{a[n.elementsKey]||(a[n.elementsKey]=[]);var D={};if(D[n.typeKey]=_,_==="instruction"){for(b in x)if(x.hasOwnProperty(b))break;D[n.nameKey]="instructionNameFn"in n?n.instructionNameFn(b,x,a):b,n.instructionHasAttributes?(D[n.attributesKey]=x[b][n.attributesKey],"instructionFn"in n&&(D[n.attributesKey]=n.instructionFn(D[n.attributesKey],b,a))):("instructionFn"in n&&(x[b]=n.instructionFn(x[b],b,a)),D[n.instructionKey]=x[b])}else _+"Fn"in n&&(x=n[_+"Fn"](x,a)),D[n[_+"Key"]]=x;n.addParent&&(D[n.parentKey]=a),a[n.elementsKey].push(D)}}function C(_){if("attributesFn"in n&&_&&(_=n.attributesFn(_,a)),(n.trim||"attributeValueFn"in n||"attributeNameFn"in n||n.nativeTypeAttributes)&&_){var x;for(x in _)if(_.hasOwnProperty(x)&&(n.trim&&(_[x]=_[x].trim()),n.nativeTypeAttributes&&(_[x]=f(_[x])),"attributeValueFn"in n&&(_[x]=n.attributeValueFn(_[x],x,a)),"attributeNameFn"in n)){var b=_[x];delete _[x],_[n.attributeNameFn(x,_[x],a)]=b}}return _}function A(_){var x={};if(_.body&&(_.name.toLowerCase()==="xml"||n.instructionHasAttributes)){for(var b=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,c;(c=b.exec(_.body))!==null;)x[c[1]]=c[2]||c[3]||c[4];x=C(x)}if(_.name.toLowerCase()==="xml"){if(n.ignoreDeclaration)return;a[n.declarationKey]={},Object.keys(x).length&&(a[n.declarationKey][n.attributesKey]=x),n.addParent&&(a[n.declarationKey][n.parentKey]=a)}else{if(n.ignoreInstruction)return;n.trim&&(_.body=_.body.trim());var D={};n.instructionHasAttributes&&Object.keys(x).length?(D[_.name]={},D[_.name][n.attributesKey]=x):D[_.name]=_.body,R("instruction",D)}}function N(_,x){var b;if(typeof _=="object"&&(x=_.attributes,_=_.name),x=C(x),"elementNameFn"in n&&(_=n.elementNameFn(_,a)),n.compact){if(b={},!n.ignoreAttributes&&x&&Object.keys(x).length){b[n.attributesKey]={};var c;for(c in x)x.hasOwnProperty(c)&&(b[n.attributesKey][c]=x[c])}!(_ in a)&&(d(n.alwaysArray)?n.alwaysArray.indexOf(_)!==-1:n.alwaysArray)&&(a[_]=[]),a[_]&&!
18d(a[_])&&(a[_]=[a[_]]),d(a[_])?a[_].push(b):a[_]=b}else a[n.elementsKey]||(a[n.elementsKey]=[]),b={},b[n.typeKey]="element",b[n.nameKey]=_,!n.ignoreAttributes&&x&&Object.keys(x).length&&(b[n.attributesKey]=x),n.alwaysChildren&&(b[n.elementsKey]=[]),a[n.elementsKey].push(b);b[n.parentKey]=a,a=b}function p(_){n.ignoreText||!_.trim()&&!n.captureSpacesBetweenElements||(n.trim&&(_=_.trim()),n.nativeType&&(_=f(_)),n.sanitize&&(_=_.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),R("text",_))}function m(_){n.ignoreComment||(n.trim&&(_=_.trim()),R("comment",_))}function g(_){var x=a[n.parentKey];n.addParent||delete a[n.parentKey],a=x}function S(_){n.ignoreCdata||(n.trim&&(_=_.trim()),R("cdata",_))}function O(_){n.ignoreDoctype||(_=_.replace(/^ /,""),n.trim&&(_=_.trim()),R("doctype",_))}function v(_){_.note=_}k.exports=function(_,x){var b=i.parser(!0,{}),c={};if(a=c,n=r(x),b.opt={strictEntities:!0},b.onopentag=N,b.ontext=p,b.oncomment=m,b.onclosetag=g,b.onerror=v,b.oncdata=S,b.ondoctype=O,b.onprocessinginstruction=A,b.write(_).close(),c[n.elementsKey]){var D=c[n.elementsKey];delete c[n.elementsKey],c[n.elementsKey]=D,delete c.text}return c}})),Cn=se(((l,k)=>{var i=wt(),h=nr();function d(n){var a=i.copyOptions(n);return i.ensureSpacesExists(a),a}k.exports=function(n,a){var r=d(a),f=h(n,r),R,C="compact"in r&&r.compact?"_parent":"parent";return"addParent"in r&&r.addParent?R=JSON.stringify(f,function(A,N){return A===C?"_":N},r.spaces):R=JSON.stringify(f,null,r.spaces),R.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}})),ir=se(((l,k)=>{var i=wt(),h=_t().isArray,d,n;function a(b){var c=i.copyOptions(b);return i.ensureFlagExists("ignoreDeclaration",c),i.ensureFlagExists("ignoreInstruction",c),i.ensureFlagExists("ignoreAttributes",c),i.ensureFlagExists("ignoreText",c),i.ensureFlagExists("ignoreComment",c),i.ensureFlagExists("ignoreCdata",c),i.ensureFlagExists("ignoreDoctype",c),i.ensureFlagExists("compact",c),i.ensureFlagExists("indentText",c),i.ensureFlagExists("indentCdata",c),i.ensureFlagExists("indentAttributes",c),i.ensureFlagExists("indentInstruction",c),i.ensureFlagExists("fullTagEmptyElement",c),i.ensureFlagExists("noQuotesForNativeAttributes",c),i.ensureSpacesExists(c),typeof c.spaces=="number"&&(c.spaces=Array(c.spaces+1).join(" ")),i.ensureKeyExists("declaration",c),i.ensureKeyExists("instruction",c),i.ensureKeyExists("attributes",c),i.ensureKeyExists("text",c),i.ensureKeyExists("comment",c),i.ensureKeyExists("cdata",c),i.ensureKeyExists("doctype",c),i.ensureKeyExists("type",c),i.ensureKeyExists("name",c),i.ensureKeyExists("elements",c),i.checkFnExists("doctype",c),i.checkFnExists("instruction",c),i.checkFnExists("cdata",c),i.checkFnExists("comment",c),i.checkFnExists("text",c),i.checkFnExists("instructionName",c),i.checkFnExists("elementName",c),i.checkFnExists("attributeName",c),i.checkFnExists("attributeValue",c),i.checkFnExists("attributes",c),i.checkFnExists("fullTagEmptyElement",c),c}function r(b,c,D){return(!D&&b.spaces?`
19`:"")+Array(c+1).join(b.spaces)}function f(b,c,D){if(c.ignoreAttributes)return"";"attributesFn"in c&&(b=c.attributesFn(b,n,d));var U,w,q,Q,I=[];for(U in b)b.hasOwnProperty(U)&&b[U]!==null&&b[U]!==void 0&&(Q=c.noQuotesForNativeAttributes&&typeof b[U]!="string"?"":'"',w=""+b[U],w=w.replace(/"/g,"&quot;"),q="attributeNameFn"in c?c.attributeNameFn(U,w,n,d):U,I.push(c.spaces&&c.indentAttributes?r(c,D+1,!1):" "),I.push(q+"="+Q+("attributeValueFn"in c?c.attributeValueFn(w,U,n,d):w)+Q));
19return b&&Object.keys(b).length&&c.spaces&&c.indentAttributes&&I.push(r(c,D,!1)),I.join("")}function R(b,c,D){return d=b,n="xml",c.ignoreDeclaration?"":"<?xml"+f(b[c.attributesKey],c,D)+"?>"}function C(b,c,D){if(c.ignoreInstruction)return"";var U;for(U in b)if(b.hasOwnProperty(U))break;var w="instructionNameFn"in c?c.instructionNameFn(U,b[U],n,d):U;if(typeof b[U]=="object")return d=b,n=w,"<?"+w+f(b[U][c.attributesKey],c,D)+"?>";var q=b[U]?b[U]:"";return"instructionFn"in c&&(q=c.instructionFn(q,U,n,d)),"<?"+w+(q?" "+q:"")+"?>"}function A(b,c){return c.ignoreComment?"":"<!--"+("commentFn"in c?c.commentFn(b,n,d):b)+"-->"}function N(b,c){return c.ignoreCdata?"":"<![CDATA["+("cdataFn"in c?c.cdataFn(b,n,d):b.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function p(b,c){return c.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in c?c.doctypeFn(b,n,d):b)+">"}function m(b,c){return c.ignoreText?"":(b=""+b,b=b.replace(/&amp;/g,"&"),b=b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in c?c.textFn(b,n,d):b)}function g(b,c){var D;if(b.elements&&b.elements.length)for(D=0;D<b.elements.length;++D)switch(b.elements[D][c.typeKey]){case"text":if(c.indentText)return!0;break;case"cdata":if(c.indentCdata)return!0;break;case"instruction":if(c.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function S(b,c,D){d=b,n=b.name;var U=[],w="elementNameFn"in c?c.elementNameFn(b.name,b):b.name;U.push("<"+w),b[c.attributesKey]&&U.push(f(b[c.attributesKey],c,D));var q=b[c.elementsKey]&&b[c.elementsKey].length||b[c.attributesKey]&&b[c.attributesKey]["xml:space"]==="preserve";return q||("fullTagEmptyElementFn"in c?q=c.fullTagEmptyElementFn(b.name,b):q=c.fullTagEmptyElement),q?(U.push(">"),b[c.elementsKey]&&b[c.elementsKey].length&&(U.push(O(b[c.elementsKey],c,D+1)),d=b,n=b.name),U.push(c.spaces&&g(b,c)?`
20`+Array(D+1).join(c.spaces):""),U.push("</"+w+">")):U.push("/>"),U.join("")}function O(b,c,D,U){return b.reduce(function(w,q){var Q=r(c,D,U&&!w);switch(q.type){case"element":return w+Q+S(q,c,D);case"comment":return w+Q+A(q[c.commentKey],c);case"doctype":return w+Q+p(q[c.doctypeKey],c);case"cdata":return w+(c.indentCdata?Q:"")+N(q[c.cdataKey],c);case"text":return w+(c.indentText?Q:"")+m(q[c.textKey],c);case"instruction":var I={};return I[q[c.nameKey]]=q[c.attributesKey]?q:q[c.instructionKey],w+(c.indentInstruction?Q:"")+C(I,c,D)}},"")}function v(b,c,D){var U;for(U in b)if(b.hasOwnProperty(U))switch(U){case c.parentKey:case c.attributesKey:break;case c.textKey:if(c.indentText||D)return!0;break;case c.cdataKey:if(c.indentCdata||D)return!0;break;case c.instructionKey:if(c.indentInstruction||D)return!0;break;case c.doctypeKey:case c.commentKey:return!0;default:return!0}return!1}function _(b,c,D,U,w){d=b,n=c;var q="elementNameFn"in D?D.elementNameFn(c,b):c;if(typeof b>"u"||b===null||b==="")return"fullTagEmptyElementFn"in D&&D.fullTagEmptyElementFn(c,b)||D.fullTagEmptyElement?"<"+q+"></"+q+">":"<"+q+"/>";var Q=[];if(c){if(Q.push("<"+q),typeof b!="object")return Q.push(">"+m(b,D)+"</"+q+">"),Q.join("");b[D.attributesKey]&&Q.push(f(b[D.attributesKey],D,U));var I=v(b,D,!0)||b[D.attributesKey]&&b[D.attributesKey]["xml:space"]==="preserve";if(I||("fullTagEmptyElementFn"in D?I=D.fullTagEmptyElementFn(c,b):I=D.fullTagEmptyElement),I)Q.push(">");else return Q.push("/>"),Q.join("")}return Q.push(x(b,D,U+1,!1)),d=b,n=c,c&&Q.push((w?r(D,U,!1):"")+"</"+q+">"),Q.join("")}function x(b,c,D,U){var w,q,Q,I=[];for(q in b)if(b.hasOwnProperty(q))for(Q=h(b[q])?b[q]:[b[q]],w=0;w<Q.length;++w){switch(q){case c.declarationKey:I.push(R(Q[w],c,D));break;case c.instructionKey:I.push((c.indentInstruction?r(c,D,U):"")+C(Q[w],c,D));break;case c.attributesKey:case c.parentKey:break;case c.textKey:I.push((c.indentText?r(c,D,U):"")+m(Q[w],c));break;case c.cdataKey:I.push((c.indentCdata?r(c,D,U):"")+N(Q[w],c));break;case c.doctypeKey:I.push(r(c,D,U)+p(Q[w],c));break;case c.commentKey:I.push(r(c,D,U)+A(Q[w],c));break;default:I.push(r(c,D,U)+_(Q[w],q,c,D,v(Q[w],c)))}U=U&&!I.length}return I.join("")}k.exports=function(b,c){c=a(c);var D=[];return d=b,n="_root_",c.compact?D.push(x(b,c,0,!0)):(b[c.declarationKey]&&D.push(R(b[c.declarationKey],c,0)),b[c.elementsKey]&&b[c.elementsKey].length&&D.push(O(b[c.elementsKey],c,0,!D.length))),D.join("")}})),On=se(((l,k)=>{var i=ir();k.exports=function(h,d){h instanceof Buffer&&(h=h.toString());var n=null;if(typeof h=="string")try{n=JSON.parse(h)}
20catch{throw new Error("The JSON structure is invalid")}else n=h;return i(n,d)}}));se(((l,k)=>{k.exports={xml2js:nr(),xml2json:Cn(),js2xml:ir(),json2xml:On()}}))();var Rn=l=>{if(isNaN(l))throw new Error(`Invalid value '${l}' specified. Must be an integer.`);return Math.floor(l)},ar=l=>{const k=Rn(l);if(k<0)throw new Error(`Invalid value '${l}' specified. Must be a positive integer.`);return k},Nn=(l,k)=>{const i=k*2;if(l.length!==i||isNaN(+`0x${l}`))throw new Error(`Invalid hex value '${l}'. Expected ${i} digit hex value`);return l},In=l=>l==="auto"?l:Nn(l.charAt(0)==="#"?l.substring(1):l,3),Dn=ar,Fn=ar,Bn=class extends Lt{constructor({name:l,attributes:k,children:i}){super(l),k&&this.root.push(new Fr(k)),i&&this.root.push(...i)}},Ie=(l,{color:k,size:i,space:h,style:d})=>new Bn({name:l,attributes:{style:{key:"w:val",value:d},color:{key:"w:color",value:k===void 0?void 0:In(k)},size:{key:"w:sz",value:i===void 0?void 0:Dn(i)},space:{key:"w:space",value:h===void 0?void 0:Fn(h)}}}),or={SINGLE:"single",NONE:"none"},Ve=se(((l,k)=>{k.exports=i;function i(h,d){if(!h)throw new Error(d||"Assertion failed")}i.equal=function(d,n,a){if(d!=n)throw new Error(a||"Assertion failed: "+d+" != "+n)}})),xe=se((l=>{var k=Ve();l.inherits=Ce();function i(I,W){return(I.charCodeAt(W)&64512)!==55296||W<0||W+1>=I.length?!1:(I.charCodeAt(W+1)&64512)===56320}function h(I,W){if(Array.isArray(I))return I.slice();if(!I)return[];var E=[];if(typeof I=="string")if(W){if(W==="hex")for(I=I.replace(/[^a-z0-9]+/gi,""),I.length%2!==0&&(I="0"+I),J=0;J<I.length;J+=2)E.push(parseInt(I[J]+I[J+1],16))}else for(var H=0,J=0;J<I.length;J++){var Y=I.charCodeAt(J);Y<128?E[H++]=Y:Y<2048?(E[H++]=Y>>6|192,E[H++]=Y&63|128):i(I,J)?(Y=65536+((Y&1023)<<10)+(I.charCodeAt(++J)&1023),E[H++]=Y>>18|240,E[H++]=Y>>12&63|128,E[H++]=Y>>6&63|128,E[H++]=Y&63|128):(E[H++]=Y>>12|224,E[H++]=Y>>6&63|128,E[H++]=Y&63|128)}else for(J=0;J<I.length;J++)E[J]=I[J]|0;return E}l.toArray=h;function d(I){for(var W="",E=0;E<I.length;E++)W+=r(I[E].toString(16));return W}l.toHex=d;function n(I){return(I>>>24|I>>>8&65280|I<<8&16711680|(I&255)<<24)>>>0}l.htonl=n;function a(I,W){for(var E="",H=0;H<I.length;H++){var J=I[H];W==="little"&&(J=n(J)),E+=f(J.toString(16))}return E}l.toHex32=a;function r(I){return I.length===1?"0"+I:I}l.zero2=r;function f(I){return I.length===7?"0"+I:I.length===6?"00"+I:I.length===5?"000"+I:I.length===4?"0000"+I:I.length===3?"00000"+I:I.length===2?"000000"+I:I.length===1?"0000000"+I:I}l.zero8=f;function R(I,W,E,H){var J=E-W;k(J%4===0);for(var Y=new Array(J/4),ae=0,$=W;ae<Y.length;ae++,$+=4){var ee;H==="big"?ee=I[$]<<24|I[$+1]<<16|I[$+2]<<8|I[$+3]:ee=I[$+3]<<24|I[$+2]<<16|I[$+1]<<8|I[$],Y[ae]=ee>>>0}return Y}l.join32=R;function C(I,W){for(var E=new Array(I.length*4),H=0,J=0;H<I.length;H++,J+=4){var Y=I[H];W==="big"?(E[J]=Y>>>24,E[J+1]=Y>>>16&255,E[J+2]=Y>>>8&255,E[J+3]=Y&255):(E[J+3]=Y>>>24,E[J+2]=Y>>>16&255,E[J+1]=Y>>>8&255,E[J]=Y&255)}return E}l.split32=C;function A(I,W){return I>>>W|I<<32-W}l.rotr32=A;function N(I,W){return I<<W|I>>>32-W}l.rotl32=N;function p(I,W){return I+W>>>0}l.sum32=p;function m(I,W,E){return I+W+E>>>0}l.sum32_3=m;function g(I,W,E,H){return I+W+E+H>>>0}l.sum32_4=g;function S(I,W,E,H,J){return I+W+E+H+J>>>0}l.sum32_5=S;function O(I,W,E,H){var J=I[W],Y=H+I[W+1]>>>0;I[W]=(Y<H?1:0)+E+J>>>0,I[W+1]=Y}l.sum64=O;function v(I,W,E,H){return(W+H>>>0<W?1:0)+I+E>>>0}l.sum64_hi=v;function _(I,W,E,H){return W+H>>>0}l.sum64_lo=_;function x(I,W,E,H,J,Y,ae,$){var ee=0,V=W;return V=V+H>>>0,ee+=V<W?1:0,V=V+Y>>>0,ee+=V<Y?1:0,V=V+$>>>0,ee+=V<$?1:0,I+E+J+ae+ee>>>0}l.sum64_4_hi=x;function b(I,W,E,H,J,Y,ae,$){return W+H+Y+$>>>0}l.sum64_4_lo=b;function c(I,W,E,H,J,Y,ae,$,ee,V){var F=0,Z=W;return Z=Z+H>>>0,F+=Z<W?1:0,Z=Z+Y>>>0,F+=Z<Y?1:0,Z=Z+$>>>0,F+=Z<$?1:0,Z=Z+V>>>0,F+=Z<V?1:0,I+E+J+ae+ee+F>>>0}l.sum64_5_hi=c;function D(I,W,E,H,J,Y,ae,$,ee,V){return W+H+Y+$+V>>>0}l.sum64_5_lo=D;function U(I,W,E){return(W<<32-E|I>>>E)>>>0}l.rotr64_hi=U;function w(I,W,E){return(I<<32-E|W>>>E)>>>0}l.rotr64_lo=w;function q(I,W,E){return I>>>E}l.shr64_hi=q;function Q(I,W,E){return(I<<32-E|W>>>E)>>>0}l.shr64_lo=Q})),Ye=se((l=>{var k=xe(),i=Ve();function h(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}l.BlockHash=h,h.prototype.update=function(n,a){if(n=k.toArray(n,a),this.pending?this.pending=this.pending.concat(n):this.pending=n,this.pendingTotal+=n.length,this.pending.length>=this._delta8){n=this.pending;var r=n.length%this._delta8;this.pending=n.slice(n.length-r,n.length),this.pending.length===0&&(this.pending=null),n=k.join32(n,0,n.length-r,this.endian);for(var f=0;f<n.length;f+=this._delta32)this._update(n,f,f+this._delta32)}return this},h.prototype.digest=function(n){return this.update(this._pad()),i(this.pending===null),this._digest(n)},h.prototype._pad=function(){var n=this.pendingTotal,a=this._delta8,r=a-(n+this.padLength)%a,f=new Array(r+this.padLength);f[0]=128;for(var R=1;R<r;R++)f[R]=0;if(n<<=3,this.endian==="big"){for(var C=8;C<this.padLength;C++)f[R++]=0;f[R++]=0,f[R++]=0,f[R++]=0,f[R++]=0,f[R++]=n>>>24&255,f[R++]=n>>>16&255,f[R++]=n>>>8&255,f[R++]=n&255}else for(f[R++]=n&255,f[R++]=n>>>8&255,f[R++]=n>>>16&255,f[R++]=n>>>24&255,f[R++]=0,f[R++]=0,f[R++]=0,f[R++]=0,C=8;C<this.padLength;C++)f[R++]=0;return f}})),sr=se((l=>{var k=xe().rotr32;function i(C,A,N,p){if(C===0)return h(A,N,p);if(C===1||C===3)return n(A,N,p);if(C===2)return d(A,N,p)}l.ft_1=i;function h(C,A,N){return C&A^~C&N}l.ch32=h;function d(C,A,N){return C&A^C&N^A&N}l.maj32=d;function n(C,A,N){return C^A^N}l.p32=n;function a(C){return k(C,2)^k(C,13)^k(C,22)}l.s0_256=a;function r(C){return k(C,6)^k(C,11)^k(C,25)}l.s1_256=r;function f(C){return k(C,7)^k(C,18)^C>>>3}l.g0_256=f;function R(C){return k(C,17)^k(C,19)^C>>>10}l.g1_256=R})),Pn=se(((l,k)=>{var i=xe(),h=Ye(),d=sr(),n=i.rotl32,a=i.sum32,r=i.sum32_5,f=d.ft_1,R=h.BlockHash,C=[1518500249,1859775393,2400959708,3395469782];function A(){if(!(this instanceof A))return new A;R.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(A,R),k.exports=A,A.blockSize=512,A.outSize=160,A.hmacStrength=80,A.padLength=64,A.prototype._update=function(p,m){for(var g=this.W,S=0;S<16;S++)g[S]=p[m+S];for(;S<g.length;S++)g[S]=n(g[S-3]^g[S-8]^g[S-14]^g[S-16],1);var O=this.h[0],v=this.h[1],_=this.h[2],x=this.h[3],b=this.h[4];for(S=0;S<g.length;S++){var c=~~(S/20),D=r(n(O,5),f(c,v,_,x),b,g[S],C[c]);b=x,x=_,_=n(v,30),v=O,O=D}this.h[0]=a(this.h[0],O),this.h[1]=a(this.h[1],v),this.h[2]=a(this.h[2],_),this.h[3]=a(this.h[3],x),this.h[4]=a(this.h[4],b)},A.prototype._digest=function(p){return p==="hex"?i.toHex32(this.h,"big"):i.split32(this.h,"big")}})),lr=se(((l,k)=>{var i=xe(),h=Ye(),d=sr(),n=Ve(),a=i.sum32,r=i.sum32_4,f=i.sum32_5,R=d.ch32,C=d.maj32,A=d.s0_256,N=d.s1_256,p=d.g0_256,m=d.g1_256,g=h.BlockHash,S=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
20734187,3204031479,3329325298];function O(){if(!(this instanceof O))return new O;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=S,this.W=new Array(64)}i.inherits(O,g),k.exports=O,O.blockSize=512,O.outSize=256,O.hmacStrength=192,O.padLength=64,O.prototype._update=function(_,x){for(var b=this.W,c=0;c<16;c++)b[c]=_[x+c];for(;c<b.length;c++)b[c]=r(m(b[c-2]),b[c-7],p(b[c-15]),b[c-16]);var D=this.h[0],U=this.h[1],w=this.h[2],q=this.h[3],Q=this.h[4],I=this.h[5],W=this.h[6],E=this.h[7];for(n(this.k.length===b.length),c=0;c<b.length;c++){var H=f(E,N(Q),R(Q,I,W),this.k[c],b[c]),J=a(A(D),C(D,U,w));E=W,W=I,I=Q,Q=a(q,H),q=w,w=U,U=D,D=a(H,J)}this.h[0]=a(this.h[0],D),this.h[1]=a(this.h[1],U),this.h[2]=a(this.h[2],w),this.h[3]=a(this.h[3],q),this.h[4]=a(this.h[4],Q),this.h[5]=a(this.h[5],I),this.h[6]=a(this.h[6],W),this.h[7]=a(this.h[7],E)},O.prototype._digest=function(_){return _==="hex"?i.toHex32(this.h,"big"):i.split32(this.h,"big")}})),Ln=se(((l,k)=>{var i=xe(),h=lr();function d(){if(!(this instanceof d))return new d;h.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(d,h),k.exports=d,d.blockSize=512,d.outSize=224,d.hmacStrength=192,d.padLength=64,d.prototype._digest=function(a){return a==="hex"?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}})),ur=se(((l,k)=>{var i=xe(),h=Ye(),d=Ve(),n=i.rotr64_hi,a=i.rotr64_lo,r=i.shr64_hi,f=i.shr64_lo,R=i.sum64,C=i.sum64_hi,A=i.sum64_lo,N=i.sum64_4_hi,p=i.sum64_4_lo,m=i.sum64_5_hi,g=i.sum64_5_lo,S=h.BlockHash,O=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
201126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;S.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=O,this.W=new Array(160)}i.inherits(v,S),k.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(J,Y){for(var ae=this.W,$=0;$<32;$++)ae[$]=J[Y+$];for(;$<ae.length;$+=2){var ee=W(ae[$-4],ae[$-3]),V=E(ae[$-4],ae[$-3]),F=ae[$-14],Z=ae[$-13],X=Q(ae[$-30],ae[$-29]),te=I(ae[$-30],ae[$-29]),ue=ae[$-32],y=ae[$-31];ae[$]=N(ee,V,F,Z,X,te,ue,y),ae[$+1]=p(ee,V,F,Z,X,te,ue,y)}},v.prototype._update=function(J,Y){this._prepareBlock(J,Y);var ae=this.W,$=this.h[0],ee=this.h[1],V=this.h[2],F=this.h[3],Z=this.h[4],X=this.h[5],te=this.h[6],ue=this.h[7],y=this.h[8],s=this.h[9],j=this.h[10],M=this.h[11],re=this.h[12],B=this.h[13],P=this.h[14],o=this.h[15];d(this.k.length===ae.length);for(var K=0;K<ae.length;K+=2){var T=P,e=o,t=w(y,s),u=q(y,s),L=_(y,s,j,M,re),G=x(y,s,j,M,re,B),z=this.k[K],ne=this.k[K+1],oe=ae[K],ie=ae[K+1],le=m(T,e,t,u,L,G,z,ne,oe,ie),ce=g(T,e,t,u,L,G,z,ne,oe,ie);T=D($,ee),e=U($,ee),t=b($,ee,V,F,Z),u=c($,ee,V,F,Z,X);var fe=C(T,e,t,u),ge=A(T,e,t,u);P=re,o=B,re=j,B=M,j=y,M=s,y=C(te,ue,le,ce),s=A(ue,ue,le,ce),te=Z,ue=X,Z=V,X=F,V=$,F=ee,$=C(le,ce,fe,ge),ee=A(le,ce,fe,ge)}R(this.h,0,$,ee),R(this.h,2,V,F),R(this.h,4,Z,X),R(this.h,6,te,ue),R(this.h,8,y,s),R(this.h,10,j,M),R(this.h,12,re,B),R(this.h,14,P,o)},v.prototype._digest=function(J){return J==="hex"?i.toHex32(this.h,"big"):i.split32(this.h,"big")};function _(H,J,Y,ae,$){var ee=H&Y^~H&$;return ee<0&&(ee+=4294967296),ee}function x(H,J,Y,ae,$,ee){var V=J&ae^~J&ee;return V<0&&(V+=4294967296),V}function b(H,J,Y,ae,$){var ee=H&Y^H&$^Y&$;return ee<0&&(ee+=4294967296),ee}function c(H,J,Y,ae,$,ee){var V=J&ae^J&ee^ae&ee;return V<0&&(V+=4294967296),V}function D(H,J){var Y=n(H,J,28),ae=n(J,H,2),$=n(J,H,7),ee=Y^ae^$;return ee<0&&(ee+=4294967296),ee}function U(H,J){var Y=a(H,J,28),ae=a(J,H,2),$=a(J,H,7),ee=Y^ae^$;return ee<0&&(ee+=4294967296),ee}function w(H,J){var Y=n(H,J,14),ae=n(H,J,18),$=n(J,H,9),ee=Y^ae^$;return ee<0&&(ee+=4294967296),ee}function q(H,J){var Y=a(H,J,14),ae=a(H,J,18),$=a(J,H,9),ee=Y^ae^$;return ee<0&&(ee+=4294967296),ee}function Q(H,J){var Y=n(H,J,1),ae=n(H,J,8),$=r(H,J,7),ee=Y^ae^$;return ee<0&&(ee+=4294967296),ee}function I(H,J){var Y=a(H,J,1),ae=a(H,J,8),$=f(H,J,7),ee=Y^ae^$;return ee<0&&(ee+=4294967296),ee}function W(H,J){var Y=n(H,J,19),ae=n(J,H,29),$=r(H,J,6),ee=Y^ae^$;return ee<0&&(ee+=4294967296),ee}function E(H,J){var Y=a(H,J,19),ae=a(J,H,29),$=f(H,J,6),ee=Y^ae^$;return ee<0&&(ee+=4294967296),ee}})),Mn=se(((l,k)=>{var i=xe(),h=ur();function d(){if(!(this instanceof d))return new d;h.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(d,h),k.exports=d,d.blockSize=1024,d.outSize=384,d.hmacStrength=192,d.padLength=128,d.prototype._digest=function(a){return a==="hex"?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}})),Un=se((l=>{l.sha1=Pn(),l.sha224=Ln(),l.sha256=lr(),l.sha384=Mn(),l.sha512=ur()})),jn=se((l=>{var k=xe(),i=Ye(),h=k.rotl32,d=k.sum32,n=k.sum32_3,a=k.sum32_4,r=i.BlockHash;function f(){if(!(this instanceof f))return new f;r.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}k.inherits(f,r),l.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(O,v){for(var _=this.h[0],x=this.h[1],b=this.h[2],c=this.h[3],D=this.h[4],U=_,w=x,q=b,Q=c,I=D,W=0;W<80;W++){var E=d(h(a(_,R(W,x,b,c),O[N[W]+v],C(W)),m[W]),D);_=D,D=c,c=h(b,10),b=x,x=E,E=d(h(a(U,R(79-W,w,q,Q),O[p[W]+v],A(W)),g[W]),I),U=I,I=Q,Q=h(q,10),q=w,w=E}E=n(this.h[1],b,Q),this.h[1]=n(this.h[2],c,I),this.h[2]=n(this.h[3],D,U),this.h[3]=n(this.h[4],_,w),this.h[4]=n(this.h[0],x,q),this.h[0]=E},f.prototype._digest=function(O){return O==="hex"?k.toHex32(this.h,"little"):k.split32(this.h,"little")};function R(S,O,v,_){return S<=15?O^v^_:S<=31?O&v|~O&_:S<=47?(O|~v)^_:S<=63?O&_|v&~_:O^(v|~_)}function C(S){return S<=15?0:S<=31?1518500249:S<=47?1859775393:S<=63?2400959708:2840853838}function A(S){return S<=15?1352829926:S<=31?1548603684:S<=47?1836072691:S<=63?2053994217:0}var N=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]})),zn=se(((l,k)=>{var i=xe(),h=Ve();function d(n,a,r){if(!(this instanceof d))return new d(n,a,r);this.Hash=n,this.blockSize=n.blockSize/8,this.outSize=n.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(a,r))}k.exports=d,d.prototype._init=function(a){a.length>this.blockSize&&(a=new this.Hash().update(a).digest()),h(a.length<=this.blockSize);for(var r=a.length;r<this.blockSize;r++)a.push(0);for(r=0;r<a.length;r++)a[r]^=54;for(this.inner=new this.Hash().update(a),r=0;r<a.length;r++)a[r]^=106;this.outer=new this.Hash().update(a)},d.prototype.update=function(a,r){return this.inner.update(a,r),this},d.prototype.digest=function(a){return this.outer.update(this.inner.digest()),this.outer.digest(a)}}));se((l=>{var k=l;k.utils=xe(),k.common=Ye(),k.sha=Un(),k.ripemd=jn(),k.hmac=zn(),k.sha1=k.sha.sha1,k.sha256=k.sha.sha256,k.sha224=k.sha.sha224,k.sha384=k.sha.sha384,k.sha512=k.sha.sha512,k.ripemd160=k.ripemd.ripemd160}))();var it=l=>new Uint8Array(new TextEncoder().encode(l)),Wn={TOP:"top",CENTER:"center",BOTTOM:"bottom"};Pe(Pe({},Wn),{},{BOTH:"both"});var De={style:or.NONE,size:0,color:"auto"}
20,Fe={style:or.SINGLE,size:4,color:"auto"},qn=class extends Lt{constructor(l){var k,i,h,d,n,a;super("w:tblBorders"),this.root.push(Ie("w:top",(k=l.top)!==null&&k!==void 0?k:Fe)),this.root.push(Ie("w:left",(i=l.left)!==null&&i!==void 0?i:Fe)),this.root.push(Ie("w:bottom",(h=l.bottom)!==null&&h!==void 0?h:Fe)),this.root.push(Ie("w:right",(d=l.right)!==null&&d!==void 0?d:Fe)),this.root.push(Ie("w:insideH",(n=l.insideHorizontal)!==null&&n!==void 0?n:Fe)),this.root.push(Ie("w:insideV",(a=l.insideVertical)!==null&&a!==void 0?a:Fe))}};Te(qn,"NONE",{top:De,bottom:De,left:De,right:De,insideHorizontal:De,insideVertical:De});var Hn=se(((l,k)=>{Me(),Oe();(function(i){typeof l=="object"&&typeof k<"u"?k.exports=i():typeof define=="function"&&define.amd?define([],i):(typeof window<"u"?window:typeof ye<"u"?ye:typeof self<"u"?self:this).JSZip=i()})(function(){return(function i(h,d,n){function a(R,C){if(!d[R]){if(!h[R]){var A=typeof Je=="function"&&Je;if(!C&&A)return A(R,!0);if(r)return r(R,!0);var N=new Error("Cannot find module '"+R+"'");throw N.code="MODULE_NOT_FOUND",N}var p=d[R]={exports:{}};h[R][0].call(p.exports,function(m){var g=h[R][1][m];return a(g||m)},p,p.exports,i,h,d,n)}return d[R].exports}for(var r=typeof Je=="function"&&Je,f=0;f<n.length;f++)a(n[f]);return a})({1:[function(i,h,d){var n=i("./utils"),a=i("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";d.encode=function(f){for(var R,C,A,N,p,m,g,S=[],O=0,v=f.length,_=v,x=n.getTypeOf(f)!=="string";O<f.length;)_=v-O,A=x?(R=f[O++],C=O<v?f[O++]:0,O<v?f[O++]:0):(R=f.charCodeAt(O++),C=O<v?f.charCodeAt(O++):0,O<v?f.charCodeAt(O++):0),N=R>>2,p=(3&R)<<4|C>>4,m=1<_?(15&C)<<2|A>>6:64,g=2<_?63&A:64,S.push(r.charAt(N)+r.charAt(p)+r.charAt(m)+r.charAt(g));return S.join("")},d.decode=function(f){var R,C,A,N,p,m,g=0,S=0,O="data:";if(f.substr(0,O.length)===O)throw new Error("Invalid base64 input, it looks like a data url.");var v,_=3*(f=f.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(f.charAt(f.length-1)===r.charAt(64)&&_--,f.charAt(f.length-2)===r.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=a.uint8array?new Uint8Array(0|_):new Array(0|_);g<f.length;)R=r.indexOf(f.charAt(g++))<<2|(N=r.indexOf(f.charAt(g++)))>>4,C=(15&N)<<4|(p=r.indexOf(f.charAt(g++)))>>2,A=(3&p)<<6|(m=r.indexOf(f.charAt(g++))),v[S++]=R,p!==64&&(v[S++]=C),m!==64&&(v[S++]=A);return v}},{"./support":30,"./utils":32}],2:[function(i,h,d){var n=i("./external"),a=i("./stream/DataWorker"),r=i("./stream/Crc32Probe"),f=i("./stream/DataLengthProbe");function R(C,A,N,p,m){this.compressedSize=C,this.uncompressedSize=A,this.crc32=N,this.compression=p,this.compressedContent=m}R.prototype={getContentWorker:function(){var C=new a(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new f("data_length")),A=this;return C.on("end",function(){if(this.streamInfo.data_length!==A.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),C},getCompressedWorker:function(){return new a(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},R.createWorkerFrom=function(C,A,N){return C.pipe(new r).pipe(new f("uncompressedSize")).pipe(A.compressWorker(N)).pipe(new f("compressedSize")).withStreamInfo("compression",A)},h.exports=R},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,h,d){var n=i("./stream/GenericWorker");d.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},d.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,h,d){var n=i("./utils"),a=(function(){for(var r,f=[],R=0;R<256;R++){r=R;for(var C=0;C<8;C++)r=1&r?3988292384^r>>>1:r>>>1;f[R]=r}return f})();h.exports=function(r,f){return r!==void 0&&r.length?n.getTypeOf(r)!=="string"?(function(R,C,A,N){var p=a,m=N+A;R^=-1;for(var g=N;g<m;g++)R=R>>>8^p[255&(R^C[g])];return-1^R})(0|f,r,r.length,0):(function(R,C,A,N){var p=a,m=N+A;R^=-1;for(var g=N;g<m;g++)R=R>>>
vendor: 34,785 bytes, lines 20-21
208^p[255&(R^C.charCodeAt(g))];return-1^R})(0|f,r,r.length,0):0}},{"./utils":32}],5:[function(i,h,d){d.base64=!1,d.binary=!1,d.dir=!1,d.createFolders=!0,d.date=null,d.compression=null,d.compressionOptions=null,d.comment=null,d.unixPermissions=null,d.dosPermissions=null},{}],6:[function(i,h,d){var n=null;n=typeof Promise<"u"?Promise:i("lie"),h.exports={Promise:n}},{lie:37}],7:[function(i,h,d){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=i("pako"),r=i("./utils"),f=i("./stream/GenericWorker"),R=n?"uint8array":"array";function C(A,N){f.call(this,"FlateWorker/"+A),this._pako=null,this._pakoAction=A,this._pakoOptions=N,this.meta={}}d.magic="\b\0",r.inherits(C,f),C.prototype.processChunk=function(A){this.meta=A.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(R,A.data),!1)},C.prototype.flush=function(){f.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},C.prototype.cleanUp=function(){f.prototype.cleanUp.call(this),this._pako=null},C.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var A=this;this._pako.onData=function(N){A.push({data:N,meta:A.meta})}},d.compressWorker=function(A){return new C("Deflate",A)},d.uncompressWorker=function(){return new C("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,h,d){function n(p,m){var g,S="";for(g=0;g<m;g++)S+=String.fromCharCode(255&p),p>>>=8;return S}function a(p,m,g,S,O,v){var _,x,b=p.file,c=p.compression,D=v!==R.utf8encode,U=r.transformTo("string",v(b.name)),w=r.transformTo("string",R.utf8encode(b.name)),q=b.comment,Q=r.transformTo("string",v(q)),I=r.transformTo("string",R.utf8encode(q)),W=w.length!==b.name.length,E=I.length!==q.length,H="",J="",Y="",ae=b.dir,$=b.date,ee={crc32:0,compressedSize:0,uncompressedSize:0};m&&!g||(ee.crc32=p.crc32,ee.compressedSize=p.compressedSize,ee.uncompressedSize=p.uncompressedSize);var V=0;m&&(V|=8),D||!W&&!E||(V|=2048);var F=0,Z=0;ae&&(F|=16),O==="UNIX"?(Z=798,F|=(function(te,ue){var y=te;return te||(y=ue?16893:33204),(65535&y)<<16})(b.unixPermissions,ae)):(Z=20,F|=(function(te){return 63&(te||0)})(b.dosPermissions)),_=$.getUTCHours(),_<<=6,_|=$.getUTCMinutes(),_<<=5,_|=$.getUTCSeconds()/2,x=$.getUTCFullYear()-1980,x<<=4,x|=$.getUTCMonth()+1,x<<=5,x|=$.getUTCDate(),W&&(J=n(1,1)+n(C(U),4)+w,H+="up"+n(J.length,2)+J),E&&(Y=n(1,1)+n(C(Q),4)+I,H+="uc"+n(Y.length,2)+Y);var X="";return X+=`
21\0`,X+=n(V,2),X+=c.magic,X+=n(_,2),X+=n(x,2),X+=n(ee.crc32,4),X+=n(ee.compressedSize,4),X+=n(ee.uncompressedSize,4),X+=n(U.length,2),X+=n(H.length,2),{fileRecord:A.LOCAL_FILE_HEADER+X+U+H,dirRecord:A.CENTRAL_FILE_HEADER+n(Z,2)+X+n(Q.length,2)+"\0\0\0\0"+n(F,4)+n(S,4)+U+H+Q}}var r=i("../utils"),f=i("../stream/GenericWorker"),R=i("../utf8"),C=i("../crc32"),A=i("../signature");function N(p,m,g,S){f.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=g,this.encodeFileName=S,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(N,f),N.prototype.push=function(p){var m=p.meta.percent||0,g=this.entriesCount,S=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,f.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:g?(m+100*(g-S-1))/g:100}}))},N.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var m=this.streamFiles&&!p.file.dir;if(m){var g=a(p,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},N.prototype.closedSource=function(p){this.accumulate=!1;var m=this.streamFiles&&!p.file.dir,g=a(p,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),m)this.push({data:(function(S){return A.DATA_DESCRIPTOR+n(S.crc32,4)+n(S.compressedSize,4)+n(S.uncompressedSize,4)})(p),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},N.prototype.flush=function(){for(var p=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var g=this.bytesWritten-p,S=(function(O,v,_,x,b){var c=r.transformTo("string",b(x));return A.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(O,2)+n(O,2)+n(v,4)+n(_,4)+n(c.length,2)+c})(this.dirRecords.length,g,p,this.zipComment,this.encodeFileName);this.push({data:S,meta:{percent:100}})},N.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},N.prototype.registerPrevious=function(p){this._sources.push(p);var m=this;return p.on("data",function(g){m.processChunk(g)}),p.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),p.on("error",function(g){m.error(g)}),this},N.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},N.prototype.error=function(p){var m=this._sources;if(!f.prototype.error.call(this,p))return!1;for(var g=0;g<m.length;g++)try{m[g].error(p)}catch{}return!0},N.prototype.lock=function(){f.prototype.lock.call(this);for(var p=this._sources,m=0;m<p.length;m++)p[m].lock()},h.exports=N},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(i,h,d){var n=i("../compressions"),a=i("./ZipFileWorker");d.generateWorker=function(r,f,R){var C=new a(f.streamFiles,R,f.platform,f.encodeFileName),A=0;try{r.forEach(function(N,p){A++;var m=(function(v,_){var x=v||_,b=n[x];if(!b)throw new Error(x+" is not a valid compression method !");return b})(p.options.compression,f.compression),g=p.options.compressionOptions||f.compressionOptions||{},S=p.dir,O=p.date;p._compressWorker(m,g).withStreamInfo("file",{name:N,dir:S,date:O,comment:p.comment||"",unixPermissions:p.unixPermissions,dosPermissions:p.dosPermissions}).pipe(C)}),C.entriesCount=A}catch(N){C.error(N)}return C}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(i,h,d){function n(){if(!(this instanceof n))return new n;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 a=new n;for(var r in this)typeof this[r]!="function"&&(a[r]=this[r]);return a}}(n.prototype=i("./object")).loadAsync=i("./load"),n.support=i("./support"),n.defaults=i("./defaults"),n.version="3.10.1",n.loadAsync=function(a,r){return new n().loadAsync(a,r)},n.external=i("./external"),h.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(i,h,d){var n=i("./utils"),a=i("./external"),r=i("./utf8"),f=i("./zipEntries"),R=i("./stream/Crc32Probe"),C=i("./nodejsUtils");function A(N){return new a.Promise(function(p,m){var g=N.decompressed.getContentWorker().pipe(new R);g.on("error",function(S){m(S)}).on("end",function(){g.streamInfo.crc32!==N.decompressed.crc32?m(new Error("Corrupted zip : CRC32 mismatch")):p()}).resume()})}h.exports=function(N,p){var m=this;return p=n.extend(p||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),C.isNode&&C.isStream(N)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",N,!0,p.optimizedBinaryString,p.base64).then(function(g){var S=new f(p);return S.load(g),S}).then(function(g){var S=[a.Promise.resolve(g)],O=g.files;if(p.checkCRC32)for(var v=0;v<O.length;v++)S.push(A(O[v]));return a.Promise.all(S)}).then(function(g){for(var S=g.shift(),O=S.files,v=0;v<O.length;v++){var _=O[v],x=_.fileNameStr,b=n.resolve(_.fileNameStr);m.file(b,_.decompressed,{binary:!0,optimizedBinaryString:!0,date:_.date,dir:_.dir,comment:_.fileCommentStr.length?_.fileCommentStr:null,unixPermissions:_.unixPermissions,dosPermissions:_.dosPermissions,createFolders:p.createFolders}),_.dir||(m.file(b).unsafeOriginalName=x)}return S.zipComment.length&&(m.comment=S.zipComment),m})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(i,h,d){var n=i("../utils"),a=i("../stream/GenericWorker");function r(f,R){a.call(this,"Nodejs stream input adapter for "+f),this._upstreamEnded=!1,this._bindStream(R)}n.inherits(r,a),r.prototype._bindStream=function(f){var R=this;(this._stream=f).pause(),f.on("data",function(C){R.push({data:C,meta:{percent:0}})}).on("error",function(C){R.isPaused?this.generatedError=C:R.error(C)}).on("end",function(){R.isPaused?R._upstreamEnded=!0:R.end()})},r.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},h.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(i,h,d){var n=i("readable-stream").Readable;function a(r,f,R){n.call(this,f),this._helper=r;var C=this;r.on("data",function(A,N){C.push(A)||C._helper.pause(),R&&R(N)}).on("error",function(A){C.emit("error",A)}).on("end",function(){C.push(null)})}i("../utils").inherits(a,n),a.prototype._read=function(){this._helper.resume()},h.exports=a},{"../utils":32,"readable-stream":16}],14:[function(i,h,d){h.exports={isNode:typeof Buffer<"u",newBufferFrom:function(n,a){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(n,a);if(typeof n=="number")throw new Error('The "data" argument must not be a number');return new Buffer(n,a)},allocBuffer:function(n){if(Buffer.alloc)return Buffer.alloc(n);var a=new Buffer(n);return a.fill(0),a},isBuffer:function(n){return Buffer.isBuffer(n)},isStream:function(n){return n&&typeof n.on=="function"&&typeof n.pause=="function"&&typeof n.resume=="function"}}},{}],15:[function(i,h,d){function n(x,b,c){var D,U=r.getTypeOf(b),w=r.extend(c||{},C);w.date=w.date||new Date,w.compression!==null&&(w.compression=w.compression.toUpperCase()),typeof w.unixPermissions=="string"&&(w.unixPermissions=parseInt(w.unixPermissions,8)),w.unixPermissions&&16384&w.unixPermissions&&(w.dir=!0),w.dosPermissions&&16&w.dosPermissions&&(w.dir=!0),w.dir&&(x=O(x)),w.createFolders&&(D=S(x))&&v.call(this,D,!0);var q=U==="string"&&w.binary===!1&&w.base64===!1;c&&c.binary!==void 0||(w.binary=!q),(b instanceof A&&b.uncompressedSize===0||w.dir||!b||b.length===0)&&(w.base64=!1,w.binary=!0,b="",w.compression="STORE",U="string");var Q=null;Q=b instanceof A||b instanceof f?b:m.isNode&&m.isStream(b)?new g(x,b):r.prepareContent(x,b,w.binary,w.optimizedBinaryString,w.base64);var I=new N(x,Q,w);this.files[x]=I}var a=i("./utf8"),r=i("./utils"),f=i("./stream/GenericWorker"),R=i("./stream/StreamHelper"),C=i("./defaults"),A=i("./compressedObject"),N=i("./zipObject"),p=i("./generate"),m=i("./nodejsUtils"),g=i("./nodejs/NodejsStreamInputAdapter"),S=function(x){x.slice(-1)==="/"&&(x=x.substring(0,x.length-1));var b=x.lastIndexOf("/");return 0<b?x.substring(0,b):""},O=function(x){return x.slice(-1)!=="/"&&(x+="/"),x},v=function(x,b){return b=b!==void 0?b:C.createFolders,x=O(x),this.files[x]||n.call(this,x,null,{dir:!0,createFolders:b}),this.files[x]};function _(x){return Object.prototype.toString.call(x)==="[object RegExp]"}h.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(x){var b,c,D;for(b in this.files)D=this.files[b],(c=b.slice(this.root.length,b.length))&&b.slice(0,this.root.length)===this.root&&x(c,D)},filter:function(x){var b=[];return this.forEach(function(c,D){x(c,D)&&b.push(D)}),b},file:function(x,b,c){if(arguments.length!==1)return x=this.root+x,n.call(this,x,b,c),this;if(_(x)){var D=x;return this.filter(function(w,q){return!q.dir&&D.test(w)})}var U=this.files[this.root+x];return U&&!U.dir?U:null},folder:function(x){if(!x)return this;if(_(x))return this.filter(function(U,w){return w.dir&&x.test(U)});var b=this.root+x,c=v.call(this,b),D=this.clone();return D.root=c.name,D},remove:function(x){x=this.root+x;var b=this.files[x];if(b||(x.slice(-1)!=="/"&&(x+="/"),b=this.files[x]),b&&!b.dir)delete this.files[x];else for(var c=this.filter(function(U,w){return w.name.slice(0,x.length)===x}),D=0;D<c.length;D++)delete this.files[c[D].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(x){var b,c={};try{if((c=r.extend(x||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=c.type.toLowerCase(),c.compression=c.compression.toUpperCase(),c.type==="binarystring"&&(c.type="string"),!c.type)throw new Error("No output type specified.");r.checkSupport(c.type),c.platform!=="darwin"&&c.platform!=="freebsd"&&c.platform!=="linux"&&c.platform!=="sunos"||(c.platform="UNIX"),c.platform==="win32"&&(c.platform="DOS");var D=c.comment||this.comment||"";b=p.generateWorker(this,c,D)}catch(U){(b=new f("error")).error(U)}return new R(b,c.type||"string",c.mimeType)},generateAsync:function(x,b){return this.generateInternalStream(x).accumulate(b)},generateNodeStream:function(x,b){return(x=x||{}).type||(x.type="nodebuffer"),this.generateInternalStream(x).toNodejsStream(b)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(i,h,d){h.exports=i("stream")},{stream:void 0}],17:[function(i,h,d){var n=i("./DataReader");function a(r){n.call(this,r);for(var f=0;f<this.data.length;f++)r[f]=255&r[f]}i("../utils").inherits(a,n),a.prototype.byteAt=function(r){return this.data[this.zero+r]},a.prototype.lastIndexOfSignature=function(r){for(var f=r.charCodeAt(0),R=r.charCodeAt(1),C=r.charCodeAt(2),A=r.charCodeAt(3),N=this.length-4;0<=N;--N)if(this.data[N]===f&&this.data[N+1]===R&&this.data[N+2]===C&&this.data[N+3]===A)return N-this.zero;return-1},a.prototype.readAndCheckSignature=function(r){var f=r.charCodeAt(0),R=r.charCodeAt(1),C=r.charCodeAt(2),A=r.charCodeAt(3),N=this.readData(4);return f===N[0]&&R===N[1]&&C===N[2]&&A===N[3]},a.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var f=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,f},h.exports=a},{"../utils":32,"./DataReader":18}],18:[function(i,h,d){var n=i("../utils");function a(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var f,R=0;for(this.checkOffset(r),f=this.index+r-1;f>=this.index;f--)R=(R<<8)+this.byteAt(f);return this.index+=r,R},readString:function(r){return n.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},h.exports=a},{"../utils":32}],19:[function(i,h,d){var n=i("./Uint8ArrayReader");function a(r){n.call(this,r)}i("../utils").inherits(a,n),a.prototype.readData=function(r){this.checkOffset(r);var f=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,f},h.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,h,d){var n=i("./DataReader");function a(r){n.call(this,r)}i("../utils").inherits(a,n),a.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},a.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},a.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},a.prototype.readData=function(r){this.checkOffset(r);var f=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,f},h.exports=a},{"../utils":32,"./DataReader":18}],21:[function(i,h,d){var n=i("./ArrayReader");function a(r){n.call(this,r)}i("../utils").inherits(a,n),a.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var f=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,f},h.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(i,h,d){var n=i("../utils"),a=i("../support"),r=i("./ArrayReader"),f=i("./StringReader"),R=i("./NodeBufferReader"),C=i("./Uint8ArrayReader");h.exports=function(A){var N=n.getTypeOf(A);return n.checkSupport(N),N!=="string"||a.uint8array?N==="nodebuffer"?new R(A):a.uint8array?new C(n.transformTo("uint8array",A)):new r(n.transformTo("array",A)):new f(A)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,h,d){d.LOCAL_FILE_HEADER="PK��",d.CENTRAL_FILE_HEADER="PK��",d.CENTRAL_DIRECTORY_END="PK��",d.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK�\x07",d.ZIP64_CENTRAL_DIRECTORY_END="PK��",d.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,h,d){var n=i("./GenericWorker"),a=i("../utils");function r(f){n.call(this,"ConvertWorker to "+f),this.destType=f}a.inherits(r,n),r.prototype.processChunk=function(f){this.push({data:a.transformTo(this.destType,f.data),meta:f.meta})},h.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(i,h,d){var n=i("./GenericWorker"),a=i("../crc32");function r(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(r,n),r.prototype.processChunk=function(f){this.streamInfo.crc32=a(f.data,this.streamInfo.crc32||0),this.push(f)},h.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,h,d){var n=i("../utils"),a=i("./GenericWorker");function r(f){a.call(this,"DataLengthProbe for "+f),this.propName=f,this.withStreamInfo(f,0)}n.inherits(r,a),r.prototype.processChunk=function(f){if(f){var R=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=R+f.data.length}a.prototype.processChunk.call(this,f)},h.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(i,h,d){var n=i("../utils"),a=i("./GenericWorker");function r(f){a.call(this,"DataWorker");var R=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,f.then(function(C){R.dataIsReady=!0,R.data=C,R.max=C&&C.length||0,R.type=n.getTypeOf(C),R.isPaused||R._tickAndRepeat()},function(C){R.error(C)})}n.inherits(r,a),r.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var f=null,R=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":f=this.data.substring(this.index,R);break;case"uint8array":f=this.data.subarray(this.index,R);break;case"array":case"nodebuffer":f=this.data.slice(this.index,R)}return this.index=R,this.push({data:f,meta:{percent:this.max?this.index/this.max*100:0}})},h.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(i,h,d){function n(a){this.name=a||"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}n.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,r){return this._listeners[a].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,r){if(this._listeners[a])for(var f=0;f<this._listeners[a].length;f++)this._listeners[a][f].call(this,r)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo,this.mergeStreamInfo(),this.previous=a;var r=this;return a.on("data",function(f){r.processChunk(f)}),a.on("end",function(){r.end()}),a.on("error",function(f){r.error(f)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var a=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,r){return this.extraStreamInfo[a]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},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 a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}},h.exports=n},{}],29:[function(i,h,d){var n=i("../utils"),a=i("./ConvertWorker"),r=i("./GenericWorker"),f=i("../base64"),R=i("../support"),C=i("../external"),A=null;if(R.nodestream)try{A=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function N(m,g){return new C.Promise(function(S,O){var v=[],_=m._internalType,x=m._outputType,b=m._mimeType;m.on("data",function(c,D){v.push(c),g&&g(D)}).on("error",function(c){v=[],O(c)}).on("end",function(){try{S((function(c,D,U){switch(c){case"blob":return n.newBlob(n.transformTo("arraybuffer",D),U);case"base64":return f.encode(D);default:return n.transformTo(c,D)}})(x,(function(c,D){var U,w=0,q=null,Q=0;for(U=0;U<D.length;U++)Q+=D[U].length;switch(c){case"string":return D.join("");case"array":return Array.prototype.concat.apply([],D);case"uint8array":for(q=new Uint8Array(Q),U=0;U<D.length;U++)q.set(D[U],w),w+=D[U].length;return q;case"nodebuffer":return Buffer.concat(D);default:throw new Error("concat : unsupported type '"+c+"'")}})(_,v),b))}catch(c){O(c)}v=[]}).resume()})}function p(m,g,S){var O=g;switch(g){case"blob":case"arraybuffer":O="uint8array";break;case"base64":O="string"}try{this._internalType=O,this._outputType=g,this._mimeType=S,n.checkSupport(O),this._worker=m.pipe(new a(O)),m.lock()}catch(v){this._worker=new r("error"),this._worker.error(v)}}p.prototype={accumulate:function(m){return N(this,m)},on:function(m,g){var S=this;return m==="data"?this._worker.on(m,function(O){g.call(S,O.data,O.meta)}):this._worker.on(m,function(){n.delay(g,arguments,S)}),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(m){if(n.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new A(this,{objectMode:this._outputType!=="nodebuffer"},m)}},h.exports=p},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(i,h,d){if(d.base64=!0,d.array=!0,d.string=!0,d.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",d.nodebuffer=typeof Buffer<"u",d.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")d.blob=!1;else{var n=new ArrayBuffer(0);try{d.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(n),d.blob=a.getBlob("application/zip").size===0}catch{d.blob=!1}}}try{d.nodestream=!!i("readable-stream").Readable}catch{d.nodestream=!1}},{"readable-stream":16}],31:[function(i,h,d){for(var n=i("./utils"),a=i("./support"),r=i("./nodejsUtils"),f=i("./stream/GenericWorker"),R=new Array(256),C=0;C<256;C++)R[C]=252<=C?6:248<=C?5:240<=C?4:224<=C?3:192<=C?2:1;R[254]=R[254]=1;function A(){f.call(this,"utf-8 decode"),this.leftOver=null}function N(){f.call(this,"utf-8 encode")}d.utf8encode=function(p){return a.nodebuffer?r.newBufferFrom(p,"utf-8"):(function(m){var g,S,O,v,_,x=m.length,b=0;for(v=0;v<x;v++)(64512&(S=m.charCodeAt(v)))==55296&&v+1<x&&(64512&(O=m.charCodeAt(v+1)))==56320&&(S=65536+(S-55296<<10)+(O-56320),v++),b+=S<128?1:S<2048?2:S<65536?3:4;for(g=a.uint8array?new Uint8Array(b):new Array(b),v=_=0;_<b;v++)(64512&(S=m.charCodeAt(v)))==55296&&v+1<x&&(64512&(O=m.charCodeAt(v+1)))==56320&&(S=65536+(S-55296<<10)+(O-56320),v++),S<128?g[_++]=S:(S<2048?g[_++]=192|S>>>6:(S<65536?g[_++]=224|S>>>12:(g[_++]=240|S>>>18,g[_++]=128|S>>>12&63),g[_++]=128|S>>>6&63),g[_++]=128|63&S);return g})(p)},d.utf8decode=function(p){return a.nodebuffer?n.transformTo("nodebuffer",p).toString("utf-8"):(function(m){var g,S,O,v,_=m.length,x=new Array(2*_);for(g=S=0;g<_;)if((O=m[g++])<128)x[S++]=O;else if(4<(v=R[O]))x[S++]=65533,g+=v-1;else{for(O&=v===2?31:v===3?15:7;1<v&&g<_;)O=O<<6|63&m[g++],v--;1<v?x[S++]=65533:O<65536?x[S++]=O:(O-=65536,x[S++]=55296|O>>10&1023,x[S++]=56320|1023&O)}return x.length!==S&&(x.subarray?x=x.subarray(0,S):x.length=S),n.applyFromCharCode(x)})(p=n.transformTo(a.uint8array?"uint8array":"array",p))},n.inherits(A,f),A.prototype.processChunk=function(p){var m=n.transformTo(a.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var g=m;(m=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),m.set(g,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var S=(function(v,_){var x;for((_=_||v.length)>v.length&&(_=v.length),x=_-1;0<=x&&(192&v[x])==128;)x--;return x<0||x===0?_:x+R[v[x]]>_?x:_})(m),O=m;S!==m.length&&(a.uint8array?(O=m.subarray(0,S),this.leftOver=m.subarray(S,m.length)):(O=m.slice(0,S),this.leftOver=m.slice(S,m.length))),this.push({data:d.utf8decode(O),meta:p.meta})},A.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:d.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},d.Utf8DecodeWorker=A,n.inherits(N,f),N.prototype.processChunk=function(p){this.push({data:d.utf8encode(p.data),meta:p.meta})},d.Utf8EncodeWorker=N},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,h,d){var n=i("./support"),a=i("./base64"),r=i("./nodejsUtils"),f=i("./external");function R(g){return g}function C(g,S){for(var O=0;O<g.length;++O)S[O]=255&g.charCodeAt(O);return S}i("setimmediate"),d.newBlob=function(g,S){d.checkSupport("blob");try{return new Blob([g],{type:S})}catch{try{var O=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return O.append(g),O.getBlob(S)}catch{throw new Error("Bug : can't construct the Blob.")}}};var A={stringifyByChunk:function(g,S,O){var v=[],_=0,x=g.length;if(x<=O)return String.fromCharCode.apply(null,g);for(;_<x;)S==="array"||S==="nodebuffer"?v.push(String.fromCharCode.apply(null,g.slice(_,Math.min(_+O,x)))):v.push(String.fromCharCode.apply(null,g.subarray(_,Math.min(_+O,x)))),_+=O;return v.join("")},stringifyByChar:function(g){for(var S="",O=0;O<g.length;O++)S+=String.fromCharCode(g[O]);return S},applyCanBeUsed:{uint8array:(function(){try{return n.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return n.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function N(g){var S=65536,O=d.getTypeOf(g),v=!0;if(O==="uint8array"?v=A.applyCanBeUsed.uint8array:O==="nodebuffer"&&(v=A.applyCanBeUsed.nodebuffer),v)for(;1<S;)try{return A.stringifyByChunk(g,O,S)}catch{S=Math.floor(S/2)}return A.stringifyByChar(g)}function p(g,S){for(var O=0;O<g.length;O++)S[O]=g[O];return S}d.applyFromCharCode=N;var m={};m.string={string:R,array:function(g){return C(g,new Array(g.length))},arraybuffer:function(g){return m.string.uint8array(g).buffer},uint8array:function(g){return C(g,new Uint8Array(g.length))},nodebuffer:function(g){return C(g,r.allocBuffer(g.length))}},m.array={string:N,array:R,arraybuffer:function(g){return new Uint8Array(g).buffer},uint8array:function(g){return new Uint8Array(g)},nodebuffer:function(g){return r.newBufferFrom(g)}},m.arraybuffer={string:function(g){return N(new Uint8Array(g))},array:function(g){return p(new Uint8Array(g),new Array(g.byteLength))},arraybuffer:R,uint8array:function(g){return new Uint8Array(g)},nodebuffer:function(g){return r.newBufferFrom(new Uint8Array(g))}},m.uint8array={string:N,array:function(g){return p(g,new Array(g.length))},arraybuffer:function(g){return g.buffer},uint8array:R,nodebuffer:function(g){return r.newBufferFrom(g)}},m.nodebuffer={string:N,array:function(g){return p(g,new Array(g.length))},arraybuffer:function(g){return m.nodebuffer.uint8array(g).buffer},uint8array:function(g){return p(g,new Uint8Array(g.length))},nodebuffer:R},d.transformTo=function(g,S){return S=S||"",g?(d.checkSupport(g),m[d.getTypeOf(S)][g](S)):S},d.resolve=function(g){for(var S=g.split("/"),O=[],v=0;v<S.length;v++){var _=S[v];_==="."||_===""&&v!==0&&v!==S.length-1||(_===".."?O.pop():O.push(_))}return O.join("/")},d.getTypeOf=function(g){return typeof g=="string"?"string":Object.prototype.toString.call(g)==="[object Array]"?"array":n.nodebuffer&&r.isBuffer(g)?"nodebuffer":n.uint8array&&g instanceof Uint8Array?"uint8array":n.arraybuffer&&g instanceof ArrayBuffer?"arraybuffer":void 0},d.checkSupport=function(g){if(!n[g.toLowerCase()])throw new Error(g+" is not supported by this platform")},d.MAX_VALUE_16BITS=65535,d.MAX_VALUE_32BITS=-1,d.pretty=function(g){var S,O,v="";for(O=0;O<(g||"").length;O++)v+="\\x"+((S=g.charCodeAt(O))<16?"0":"")+S.toString(16).toUpperCase();return v},d.delay=function(g,S,O){setImmediate(function(){g.apply(O||null,S||[])})},d.inherits=function(g,S){function O(){}O.prototype=S.prototype,g.prototype=new O},d.extend=function(){var g,S,O={};for(g=0;g<arguments.length;g++)for(S in arguments[g])Object.prototype.hasOwnProperty.call(arguments[g],S)&&O[S]===void 0&&(O[S]=arguments[g][S]);return O},d.prepareContent=function(g,S,O,v,_){return f.Promise.resolve(S).then(function(x){return n.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new f.Promise(function(b,c){var D=new FileReader;D.onload=function(U){b(U.target.result)},D.onerror=function(U){c(U.target.error)},D.readAsArrayBuffer(x)}):x}).then(function(x){var b=d.getTypeOf(x);return b?(b==="arraybuffer"?x=d.transformTo("uint8array",x):b==="string"&&(_?x=a.decode(x):O&&v!==!0&&(x=(function(c){return C(c,n.uint8array?new Uint8Array(c.length):new Array(c.length))})(x))),x):f.Promise.reject(new Error("Can't read the data of '"+g+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(i,h,d){var n=i("./reader/readerFor"),a=i("./utils"),r=i("./signature"),f=i("./zipEntry"),R=i("./support");function C(A){this.files=[],this.loadOptions=A}C.prototype={checkSignature:function(A){if(!this.reader.readAndCheckSignature(A)){this.reader.index-=4;var N=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(N)+", expected "+a.pretty(A)+")")}},isSignature:function(A,N){var p=this.reader.index;this.reader.setIndex(A);var m=this.reader.readString(4)===N;return this.reader.setIndex(p),m},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 A=this.reader.readData(this.zipCommentLength),N=R.uint8array?"uint8array":"array",p=a.transformTo(N,A);this.zipComment=this.loadOptions.decodeFileName(p)},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 A,N,p,m=this.zip64EndOfCentralSize-44;0<m;)A=this.reader.readInt(2),N=this.reader.readInt(4),p=this.reader.readData(N),this.zip64ExtensibleData[A]={id:A,length:N,value:p}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var A,N;for(A=0;A<this.files.length;A++)N=this.files[A],this.reader.setIndex(N.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),N.readLocalPart(this.reader),N.handleUTF8(),N.processAttributes()},readCentralDir:function(){var A;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(A=new f({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(A);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 A=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(A<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip f
21ile ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(A);var N=A;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,(A=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(A),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.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(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var p=this.centralDirOffset+this.centralDirSize;this.zip64&&(p+=20,p+=12+this.zip64EndOfCentralSize);var m=N-p;if(0<m)this.isSignature(N,r.CENTRAL_FILE_HEADER)||(this.reader.zero=m);else if(m<0)throw new Error("Corrupted zip: missing "+Math.abs(m)+" bytes.")},prepareReader:function(A){this.reader=n(A)},load:function(A){this.prepareReader(A),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},h.exports=C},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(i,h,d){var n=i("./reader/readerFor"),a=i("./utils"),r=i("./compressedObject"),f=i("./crc32"),R=i("./utf8"),C=i("./compressions"),A=i("./support");function N(p,m){this.options=p,this.loadOptions=m}N.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(p){var m,g;if(p.skip(22),this.fileNameLength=p.readInt(2),g=p.readInt(2),this.fileName=p.readData(this.fileNameLength),p.skip(g),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((m=(function(S){for(var O in C)if(Object.prototype.hasOwnProperty.call(C,O)&&C[O].magic===S)return C[O];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,m,p.readData(this.compressedSize))},readCentralPart:function(p){this.versionMadeBy=p.readInt(2),p.skip(2),this.bitFlag=p.readInt(2),this.compressionMethod=p.readString(2),this.date=p.readDate(),this.crc32=p.readInt(4),this.compressedSize=p.readInt(4),this.uncompressedSize=p.readInt(4);var m=p.readInt(2);if(this.extraFieldsLength=p.readInt(2),this.fileCommentLength=p.readInt(2),this.diskNumberStart=p.readInt(2),this.internalFileAttributes=p.readInt(2),this.externalFileAttributes=p.readInt(4),this.localHeaderOffset=p.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");p.skip(m),this.readExtraFields(p),this.parseZIP64ExtraField(p),this.fileComment=p.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var p=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),p==0&&(this.dosPermissions=63&this.externalFileAttributes),p==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=n(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&
vendor: 50,381 bytes, line 21
21(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var m,g,S,O=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4<O;)m=p.readInt(2),g=p.readInt(2),S=p.readData(g),this.extraFields[m]={id:m,length:g,value:S};p.setIndex(O)},handleUTF8:function(){var p=A.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=R.utf8decode(this.fileName),this.fileCommentStr=R.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var g=a.transformTo(p,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(g)}var S=this.findExtraFieldUnicodeComment();if(S!==null)this.fileCommentStr=S;else{var O=a.transformTo(p,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(O)}}},findExtraFieldUnicodePath:function(){var p=this.extraFields[28789];if(p){var m=n(p.value);return m.readInt(1)!==1||f(this.fileName)!==m.readInt(4)?null:R.utf8decode(m.readData(p.length-5))}return null},findExtraFieldUnicodeComment:function(){var p=this.extraFields[25461];if(p){var m=n(p.value);return m.readInt(1)!==1||f(this.fileComment)!==m.readInt(4)?null:R.utf8decode(m.readData(p.length-5))}return null}},h.exports=N},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(i,h,d){function n(m,g,S){this.name=m,this.dir=S.dir,this.date=S.date,this.comment=S.comment,this.unixPermissions=S.unixPermissions,this.dosPermissions=S.dosPermissions,this._data=g,this._dataBinary=S.binary,this.options={compression:S.compression,compressionOptions:S.compressionOptions}}var a=i("./stream/StreamHelper"),r=i("./stream/DataWorker"),f=i("./utf8"),R=i("./compressedObject"),C=i("./stream/GenericWorker");n.prototype={internalStream:function(m){var g=null,S="string";try{if(!m)throw new Error("No output type specified.");var O=(S=m.toLowerCase())==="string"||S==="text";S!=="binarystring"&&S!=="text"||(S="string"),g=this._decompressWorker();var v=!this._dataBinary;v&&!O&&(g=g.pipe(new f.Utf8EncodeWorker)),!v&&O&&(g=g.pipe(new f.Utf8DecodeWorker))}catch(_){(g=new C("error")).error(_)}return new a(g,S,"")},async:function(m,g){return this.internalStream(m).accumulate(g)},nodeStream:function(m,g){return this.internalStream(m||"nodebuffer").toNodejsStream(g)},_compressWorker:function(m,g){if(this._data instanceof R&&this._data.compression.magic===m.magic)return this._data.getCompressedWorker();var S=this._decompressWorker();return this._dataBinary||(S=S.pipe(new f.Utf8EncodeWorker)),R.createWorkerFrom(S,m,g)},_decompressWorker:function(){return this._data instanceof R?this._data.getContentWorker():this._data instanceof C?this._data:new r(this._data)}};for(var A=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],N=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},p=0;p<A.length;p++)n.prototype[A[p]]=N;h.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(i,h,d){(function(n){var a,r,f=n.MutationObserver||n.WebKitMutationObserver;if(f){var R=0,C=new f(m),A=n.document.createTextNode("");C.observe(A,{characterData:!0}),a=function(){A.data=R=++R%2}}else if(n.setImmediate||n.MessageChannel===void 0)a="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var g=n.document.createElement("script");g.onreadystatechange=function(){m(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},n.document.documentElement.appendChild(g)}:function(){setTimeout(m,0)};else{var N=new n.MessageChannel;N.port1.onmessage=m,a=function(){N.port2.postMessage(0)}}var p=[];function m(){var g,S;r=!0;for(var O=p.length;O;){for(S=p,p=[],g=-1;++g<O;)S[g]();O=p.length}r=!1}h.exports=function(g){p.push(g)!==1||r||a()}}).call(this,typeof ye<"u"?ye:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(i,h,d){var n=i("immediate");function a(){}var r={},f=["REJECTED"],R=["FULFILLED"],C=["PENDING"];function A(O){if(typeof O!="function")throw new TypeError("resolver must be a function");this.state=C,this.queue=[],this.outcome=void 0,O!==a&&g(this,O)}function N(O,v,_){this.promise=O,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof _=="function"&&(this.onRejected=_,this.callRejected=this.otherCallRejected)}function p(O,v,_){n(function(){var x;try{x=v(_)}catch(b){return r.reject(O,b)}x===O?r.reject(O,new TypeError("Cannot resolve promise with itself")):r.resolve(O,x)})}function m(O){var v=O&&O.then;if(O&&(typeof O=="object"||typeof O=="function")&&typeof v=="function")return function(){v.apply(O,arguments)}}function g(O,v){var _=!1;function x(D){_||(_=!0,r.reject(O,D))}function b(D){_||(_=!0,r.resolve(O,D))}var c=S(function(){v(b,x)});c.status==="error"&&x(c.value)}function S(O,v){var _={};try{_.value=O(v),_.status="success"}catch(x){_.status="error",_.value=x}return _}(h.exports=A).prototype.finally=function(O){if(typeof O!="function")return this;var v=this.constructor;return this.then(function(_){return v.resolve(O()).then(function(){return _})},function(_){return v.resolve(O()).then(function(){throw _})})},A.prototype.catch=function(O){return this.then(null,O)},A.prototype.then=function(O,v){if(typeof O!="function"&&this.state===R||typeof v!="function"&&this.state===f)return this;var _=new this.constructor(a);return this.state!==C?p(_,this.state===R?O:v,this.outcome):this.queue.push(new N(_,O,v)),_},N.prototype.callFulfilled=function(O){r.resolve(this.promise,O)},N.prototype.otherCallFulfilled=function(O){p(this.promise,this.onFulfilled,O)},N.prototype.callRejected=function(O){r.reject(this.promise,O)},N.prototype.otherCallRejected=function(O){p(this.promise,this.onRejected,O)},r.resolve=function(O,v){var _=S(m,v);if(_.status==="error")return r.reject(O,_.value);var x=_.value;if(x)g(O,x);else{O.state=R,O.outcome=v;for(var b=-1,c=O.queue.length;++b<c;)O.queue[b].callFulfilled(v)}return O},r.reject=function(O,v){O.state=f,O.outcome=v;for(var _=-1,x=O.queue.length;++_<x;)O.queue[_].callRejected(v);return O},A.resolve=function(O){return O instanceof this?O:r.resolve(new this(a),O)},A.reject=function(O){var v=new this(a);return r.reject(v,O)},A.all=function(O){var v=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=O.length,x=!1;if(!_)return this.resolve([]);for(var b=new Array(_),c=0,D=-1,U=new this(a);++D<_;)w(O[D],D);return U;function w(q,Q){v.resolve(q).then(function(I){b[Q]=I,++c!==_||x||(x=!0,r.resolve(U,b))},function(I){x||(x=!0,r.reject(U,I))})}},A.race=function(O){var v=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=O.length,x=!1;if(!_)return this.resolve([]);for(var b=-1,c=new this(a);++b<_;)D=O[b],v.resolve(D).then(function(U){x||(x=!0,r.resolve(c,U))},function(U){x||(x=!0,r.reject(c,U))});var D;return c}},{immediate:36}],38:[function(i,h,d){var n={};(0,i("./lib/utils/common").assign)(n,i("./lib/deflate"),i("./lib/inflate"),i("./lib/zlib/constants")),h.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(i,h,d){var n=i("./zlib/deflate"),a=i("./utils/common"),r=i("./utils/strings"),f=i("./zlib/messages"),R=i("./zlib/zstream"),C=Object.prototype.toString,A=0,N=-1,p=0,m=8;function g(O){if(!(this instanceof g))return new g(O);this.options=a.assign({level:N,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},O||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new R,this.strm.avail_out=0;var _=n.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(_!==A)throw new Error(f[_]);if(v.header&&n.deflateSetHeader(this.strm,v.header),v.dictionary){var x;if(x=typeof v.dictionary=="string"?r.string2buf(v.dictionary):C.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(_=n.deflateSetDictionary(this.strm,x))!==A)throw new Error(f[_]);this._dict_set=!0}}function S(O,v){var _=new g(v);if(_.push(O,!0),_.err)throw _.msg||f[_.err];return _.result}g.prototype.push=function(O,v){var _,x,b=this.strm,c=this.options.chunkSize;if(this.ended)return!1;x=v===~~v?v:v===!0?4:0,typeof O=="string"?b.input=r.string2buf(O):C.call(O)==="[object ArrayBuffer]"?b.input=new Uint8Array(O):b.input=O,b.next_in=0,b.avail_in=b.input.length;do{if(b.avail_out===0&&(b.output=new a.Buf8(c),b.next_out=0,b.avail_out=c),(_=n.deflate(b,x))!==1&&_!==A)return this.onEnd(_),!(this.ended=!0);b.avail_out!==0&&(b.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(a.shrinkBuf(b.output,b.next_out))):this.onData(a.shrinkBuf(b.output,b.next_out)))}while((0<b.avail_in||b.avail_out===0)&&_!==1);return x===4?(_=n.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===A):x!==2||(this.onEnd(A),!(b.avail_out=0))},g.prototype.onData=function(O){this.chunks.push(O)},g.prototype.onEnd=function(O){O===A&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=O,this.msg=this.strm.msg},d.Deflate=g,d.deflate=S,d.deflateRaw=function(O,v){return(v=v||{}).raw=!0,S(O,v)},d.gzip=function(O,v){return(v=v||{}).gzip=!0,S(O,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(i,h,d){var n=i("./zlib/inflate"),a=i("./utils/common"),r=i("./utils/strings"),f=i("./zlib/constants"),R=i("./zlib/messages"),C=i("./zlib/zstream"),A=i("./zlib/gzheader"),N=Object.prototype.toString;function p(g){if(!(this instanceof p))return new p(g);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},g||{});var S=this.options;S.raw&&0<=S.windowBits&&S.windowBits<16&&(S.windowBits=-S.windowBits,S.windowBits===0&&(S.windowBits=-15)),!(0<=S.windowBits&&S.windowBits<16)||g&&g.windowBits||(S.windowBits+=32),15<S.windowBits&&S.windowBits<48&&(15&S.windowBits)==0&&(S.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new C,this.strm.avail_out=0;var O=n.inflateInit2(this.strm,S.windowBits);if(O!==f.Z_OK)throw new Error(R[O]);this.header=new A,n.inflateGetHeader(this.strm,this.header)}function m(g,S){var O=new p(S);if(O.push(g,!0),O.err)throw O.msg||R[O.err];return O.result}p.prototype.push=function(g,S){var O,v,_,x,b,c,D=this.strm,U=this.options.chunkSize,w=this.options.dictionary,q=!1;if(this.ended)return!1;v=S===~~S?S:S===!0?f.Z_FINISH:f.Z_NO_FLUSH,typeof g=="string"?D.input=r.binstring2buf(g):N.call(g)==="[object ArrayBuffer]"?D.input=new Uint8Array(g):D.input=g,D.next_in=0,D.avail_in=D.input.length;do{if(D.avail_out===0&&(D.output=new a.Buf8(U),D.next_out=0,D.avail_out=U),(O=n.inflate(D,f.Z_NO_FLUSH))===f.Z_NEED_DICT&&w&&(c=typeof w=="string"?r.string2buf(w):N.call(w)==="[object ArrayBuffer]"?new Uint8Array(w):w,O=n.inflateSetDictionary(this.strm,c)),O===f.Z_BUF_ERROR&&q===!0&&(O=f.Z_OK,q=!1),O!==f.Z_STREAM_END&&O!==f.Z_OK)return this.onEnd(O),!(this.ended=!0);D.next_out&&(D.avail_out!==0&&O!==f.Z_STREAM_END&&(D.avail_in!==0||v!==f.Z_FINISH&&v!==f.Z_SYNC_FLUSH)||(this.options.to==="string"?(_=r.utf8border(D.output,D.next_out),x=D.next_out-_,b=r.buf2string(D.output,_),D.next_out=x,D.avail_out=U-x,x&&a.arraySet(D.output,D.output,_,x,0),this.onData(b)):this.onData(a.shrinkBuf(D.output,D.next_out)))),D.avail_in===0&&D.avail_out===0&&(q=!0)}while((0<D.avail_in||D.avail_out===0)&&O!==f.Z_STREAM_END);return O===f.Z_STREAM_END&&(v=f.Z_FINISH),v===f.Z_FINISH?(O=n.inflateEnd(this.strm),this.onEnd(O),this.ended=!0,O===f.Z_OK):v!==f.Z_SYNC_FLUSH||(this.onEnd(f.Z_OK),!(D.avail_out=0))},p.prototype.onData=function(g){this.chunks.push(g)},p.prototype.onEnd=function(g){g===f.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},d.Inflate=p,d.inflate=m,d.inflateRaw=function(g,S){return(S=S||{}).raw=!0,m(g,S)},d.ungzip=m},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(i,h,d){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";d.assign=function(f){for(var R=Array.prototype.slice.call(arguments,1);R.length;){var C=R.shift();if(C){if(typeof C!="object")throw new TypeError(C+"must be non-object");for(var A in C)C.hasOwnProperty(A)&&(f[A]=C[A])}}return f},d.shrinkBuf=function(f,R){return f.length===R?f:f.subarray?f.subarray(0,R):(f.length=R,f)};var a={arraySet:function(f,R,C,A,N){if(R.subarray&&f.subarray)f.set(R.subarray(C,C+A),N);else for(var p=0;p<A;p++)f[N+p]=R[C+p]},flattenChunks:function(f){var R,C,A,N,p,m;for(R=A=0,C=f.length;R<C;R++)A+=f[R].length;for(m=new Uint8Array(A),R=N=0,C=f.length;R<C;R++)p=f[R],m.set(p,N),N+=p.length;return m}},r={arraySet:function(f,R,C,A,N){for(var p=0;p<A;p++)f[N+p]=R[C+p]},flattenChunks:function(f){return[].concat.apply([],f)}};d.setTyped=function(f){f?(d.Buf8=Uint8Array,d.Buf16=Uint16Array,d.Buf32=Int32Array,d.assign(d,a)):(d.Buf8=Array,d.Buf16=Array,d.Buf32=Array,d.assign(d,r))},d.setTyped(n)},{}],42:[function(i,h,d){var n=i("./common"),a=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var f=new n.Buf8(256),R=0;R<256;R++)f[R]=252<=R?6:248<=R?5:240<=R?4:224<=R?3:192<=R?2:1;function C(A,N){if(N<65537&&(A.subarray&&r||!A.subarray&&a))return String.fromCharCode.apply(null,n.shrinkBuf(A,N));for(var p="",m=0;m<N;m++)p+=String.fromCharCode(A[m]);return p}f[254]=f[254]=1,d.string2buf=function(A){var N,p,m,g,S,O=A.length,v=0;for(g=0;g<O;g++)(64512&(p=A.charCodeAt(g)))==55296&&g+1<O&&(64512&(m=A.charCodeAt(g+1)))==56320&&(p=65536+(p-55296<<10)+(m-56320),g++),v+=p<128?1:p<2048?2:p<65536?3:4;for(N=new n.Buf8(v),g=S=0;S<v;g++)(64512&(p=A.charCodeAt(g)))==55296&&g+1<O&&(64512&(m=A.charCodeAt(g+1)))==56320&&(p=65536+(p-55296<<10)+(m-56320),g++),p<128?N[S++]=p:(p<2048?N[S++]=192|p>>>6:(p<65536?N[S++]=224|p>>>12:(N[S++]=240|p>>>18,N[S++]=128|p>>>12&63),N[S++]=128|p>>>6&63),N[S++]=128|63&p);return N},d.buf2binstring=function(A){return C(A,A.length)},d.binstring2buf=function(A){for(var N=new n.Buf8(A.length),p=0,m=N.length;p<m;p++)N[p]=A.charCodeAt(p);return N},d.buf2string=function(A,N){var p,m,g,S,O=N||A.length,v=new Array(2*O);for(p=m=0;p<O;)if((g=A[p++])<128)v[m++]=g;else if(4<(S=f[g]))v[m++]=65533,p+=S-1;else{for(g&=S===2?31:S===3?15:7;1<S&&p<O;)g=g<<6|63&A[p++],S--;1<S?v[m++]=65533:g<65536?v[m++]=g:(g-=65536,v[m++]=55296|g>>10&1023,v[m++]=56320|1023&g)}return C(v,m)},d.utf8border=function(A,N){var p;for((N=N||A.length)>A.length&&(N=A.length),p=N-1;0<=p&&(192&A[p])==128;)p--;return p<0||p===0?N:p+f[A[p]]>N?p:N}},{"./common":41}],43:[function(i,h,d){h.exports=function(n,a,r,f){for(var R=65535&n|0,C=n>>>16&65535|0,A=0;r!==0;){for(r-=A=2e3<r?2e3:r;C=C+(R=R+a[f++]|0)|0,--A;);R%=65521,C%=65521}return R|C<<16|0}},{}],44:[function(i,h,d){h.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}},{}],45:[function(i,h,d){var n=(function(){for(var a,r=[],f=0;f<256;f++){a=f;for(var R=0;R<8;R++)a=1&a?3988292384^a>>>1:a>>>1;r[f]=a}return r})();h.exports=function(a,r,f,R){var C=n,A=R+f;a^=-1;for(var N=R;N<A;N++)a=a>>>8^C[255&(a^r[N])];return-1^a}},{}],46:[function(i,h,d){var n,a=i("../utils/common"),r=i("./trees"),f=i("./adler32"),R=i("./crc32"),C=i("./messages"),A=0,N=4,p=0,m=-2,g=-1,S=4,O=2,v=8,_=9,x=286,b=30,c=19,D=2*x+1,U=15,w=3,q=258,Q=q+w+1,I=42,W=113,E=1,H=2,J=3,Y=4;function ae(o,K){return o.msg=C[K],K}function $(o){return(o<<1)-(4<o?9:0)}function ee(o){for(var K=o.length;0<=--K;)o[K]=0}function V(o){var K=o.state,T=K.pending;T>o.avail_out&&(T=o.avail_out),T!==0&&(a.arraySet(o.output,K.pending_buf,K.pending_out,T,o.next_out),o.next_out+=T,K.pending_out+=T,o.total_out+=T,o.avail_out-=T,K.pending-=T,K.pending===0&&(K.pending_out=0))}function F(o,K){r._tr_flush_block(o,0<=o.block_start?o.block_start:-1,o.strstart-o.block_start,K),o.block_start=o.strstart,V(o.strm)}function Z(o,K){o.pending_buf[o.pending++]=K}function X(o,K){o.pending_buf[o.pending++]=K>>>8&255,o.pending_buf[o.pending++]=255&K}function te(o,K){var T,e,t=o.max_chain_length,u=o.strstart,L=o.prev_length,G=o.nice_match,z=o.strstart>o.w_size-Q?o.strstart-(o.w_size-Q):0,ne=o.window,oe=o.w_mask,ie=o.prev,le=o.strstart+q,ce=ne[u+L-1],fe=ne[u+L];o.prev_length>=o.good_match&&(t>>=2),G>o.lookahead&&(G=o.lookahead);do if(ne[(T=K)+L]===fe&&ne[T+L-1]===ce&&ne[T]===ne[u]&&ne[++T]===ne[u+1]){u+=2,T++;do;while(ne[++u]===ne[++T]&&ne[++u]===ne[++T]&&ne[++u]===ne[++T]&&ne[++u]===ne[++T]&&ne[++u]===ne[++T]&&ne[++u]===ne[++T]&&ne[++u]===ne[++T]&&ne[++u]===ne[++T]&&u<le);if(e=q-(le-u),u=le-q,L<e){if(o.match_start=K,G<=(L=e))break;ce=ne[u+L-1],fe=ne[u+L]}}while((K=ie[K&oe])>z&&--t!=0);return L<=o.lookahead?L:o.lookahead}function ue(o){var K,T,e,t,u,L,G,z,ne,oe,ie=o.w_size;do{if(t=o.window_size-o.lookahead-o.strstart,o.strstart>=ie+(ie-Q)){for(a.arraySet(o.window,o.window,ie,ie,0),o.match_start-=ie,o.strstart-=ie,o.block_start-=ie,K=T=o.hash_size;e=o.head[--K],o.head[K]=ie<=e?e-ie:0,--T;);for(K=T=ie;e=o.prev[--K],o.prev[K]=ie<=e?e-ie:0,--T;);t+=ie}if(o.strm.avail_in===0)break;if(L=o.strm,G=o.window,z=o.strstart+o.lookahead,ne=t,oe=void 0,oe=L.avail_in,ne<oe&&(oe=ne),T=oe===0?0:(L.avail_in-=oe,a.arraySet(G,L.input,L.next_in,oe,z),L.state.wrap===1?L.adler=f(L.adler,G,oe,z):L.state.wrap===2&&(L.adler=R(L.adler,G,oe,z)),L.next_in+=oe,L.total_in+=oe,oe),o.lookahead+=T,o.lookahead+o.insert>=w)for(u=o.strstart-o.insert,o.ins_h=o.window[u],o.ins_h=(o.ins_h<<o.hash_shift^o.window[u+1])&o.hash_mask;o.insert&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[u+w-1])&o.hash_mask,o.prev[u&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=u,u++,o.insert--,!(o.lookahead+o.insert<w)););}while(o.lookahead<Q&&o.strm.avail_in!==0)}function y(o,K){for(var T,e;;){if(o.lookahead<Q){if(ue(o),o.lookahead<Q&&K===A)return E;if(o.lookahead===0)break}if(T=0,o.lookahead>=w&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+w-1])&o.hash_mask,T=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),T!==0&&o.strstart-T<=o.w_size-Q&&(o.match_length=te(o,T)),o.match_length>=w)if(e=r._tr_tally(o,o.strstart-o.match_start,o.match_length-w),o.lookahead-=o.match_length,o.match_length<=o.max_lazy_match&&o.lookahead>=w){for(o.match_length--;o.strstart++,o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+w-1])&o.hash_mask,T=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart,--o.match_length!=0;);o.strstart++}else o.strstart+=o.match_length,o.match_length=0,o.ins_h=o.window[o.strstart],o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+1])&o.hash_mask;else e=r._tr_tally(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++;if(e&&(F(o,!1),o.strm.avail_out===0))return E}return o.insert=o.strstart<w-1?o.strstart:w-1,K===N?(F(o,!0),o.strm.avail_out===0?J:Y):o.last_lit&&(F(o,!1),o.strm.avail_out===0)?E:H}function s(o,K){for(var T,e,t;;){if(o.lookahead<Q){if(ue(o),o.lookahead<Q&&K===A)return E;if(o.lookahead===0)break}if(T=0,o.lookahead>=w&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+w-1])&o.hash_mask,T=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),o.prev_length=o.match_length,o.prev_match=o.match_start,o.match_length=w-1,T!==0&&o.prev_length<o.max_lazy_match&&o.strstart-T<=o.w_size-Q&&(o.match_length=te(o,T),o.match_length<=5&&(o.strategy===1||o.match_length===w&&4096<o.strstart-o.match_start)&&(o.match_length=w-1)),o.prev_length>=w&&o.match_length<=o.prev_length){for(t=o.strstart+o.lookahead-w,e=r._tr_tally(o,o.strstart-1-o.prev_match,o.prev_length-w),o.lookahead-=o.prev_length-1,o.prev_length-=2;++o.strstart<=t&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+w-1])&o.hash_mask,T=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),--o.prev_length!=0;);if(o.match_available=0,o.match_length=w-1,o.strstart++,e&&(F(o,!1),o.strm.avail_out===0))return E}else if(o.match_available){if((e=r._tr_tally(o,0,o.window[o.strstart-1]))&&F(o,!1),o.strstart++,o.lookahead--,o.strm.avail_out===0)return E}else o.match_available=1,o.strstart++,o.lookahead--}return o.match_available&&(e=r._tr_tally(o,0,o.window[o.strstart-1]),o.match_available=0),o.insert=o.strstart<w-1?o.strstart:w-1,K===N?(F(o,!0),o.strm.avail_out===0?J:Y):o.last_lit&&(F(o,!1),o.strm.avail_out===0)?E:H}function j(o,K,T,e,t){this.good_length=o,this.max_lazy=K,this.nice_length=T,this.max_chain=e,this.func=t}function M(){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=v,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 a.Buf16(2*D),this.dyn_dtree=new a.Buf16(2*(2*b+1)),this.bl_tree=new a.Buf16(2*(2*c+1)),ee(this.dyn_ltree),ee(this.dyn_dtree),ee(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(U+1),this.heap=new a.Buf16(2*x+1),ee(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*x+1),ee(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 re(o){var K;return o&&o.state?(o.total_in=o.total_out=0,o.data_type=O,(K=o.state).pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap?I:W,o.adler=K.wrap===2?0:1,K.last_flush=A,r._tr_init(K),p):ae(o,m)}function B(o){var K=re(o);return K===p&&(function(T){T.window_size=2*T.w_size,ee(T.head),T.max_lazy_match=n[T.level].max_lazy,T.good_match=n[T.level].good_length,T.nice_match=n[T.level].nice_length,T.max_chain_length=n[T.level].max_chain,T.strstart=0,T.block_start=0,T.lookahead=0,T.insert=0,T.match_length=T.prev_length=w-1,T.match_available=0,T.ins_h=0})(o.state),K}function P(o,K,T,e,t,u){if(!o)return m;var L=1;if(K===g&&(K=6),e<0?(L=0,e=-e):15<e&&(L=2,e-=16),t<1||_<t||T!==v||e<8||15<e||K<0||9<K||u<0||S<u)return ae(o,m);e===8&&(e=9);var G=new M;return(o.state=G).strm=o,G.wrap=L,G.gzhead=null,G.w_bits=e,G.w_size=1<<G.w_bits,G.w_mask=G.w_size-1,G.hash_bits=t+7,G.hash_size=1<<G.hash_bits,G.hash_mask=G.hash_size-1,G.hash_shift=~~((G.hash_bits+w-1)/w),G.window=new a.Buf8(2*G.w_size),G.head=new a.Buf16(G.hash_size),G.prev=new a.Buf16(G.w_size),G.lit_bufsize=1<<t+6,G.pending_buf_size=4*G.lit_bufsize,G.pending_buf=new a.Buf8(G.pending_buf_size),G.d_buf=1*G.lit_bufsize,G.l_buf=3*G.lit_bufsize,G.level=K,G.strategy=u,G.method=T,B(o)}n=[new j(0,0,0,0,function(o,K){var T=65535;for(T>o.pending_buf_size-5&&(T=o.pending_buf_size-5);;){if(o.lookahead<=1){if(ue(o),o.lookahead===0&&K===A)return E;if(o.lookahead===0)break}o.strstart+=o.lookahead,o.lookahead=0;var e=o.block_start+T;if((o.strstart===0||o.strstart>=e)&&(o.lookahead=o.strstart-e,o.strstart=e,F(o,!1),o.strm.avail_out===0)||o.strstart-o.block_start>=o.w_size-Q&&(F(o,!1),o.strm.avail_out===0))return E}return o.insert=0,K===N?(F(o,!0),o.strm.avail_out===0?J:Y):(o.strstart>o.block_start&&(F(o,!1),o.strm.avail_out),E)}),new j(4,4,8,4,y),new j(4,5,16,8,y),new j(4,6,32,32,y),new j(4,4,16,16,s),new j(8,16,32,32,s),new j(8,16,128,128,s),new j(8,32,128,256,s),new j(32,128,258,1024,s),new j(32,258,258,4096,s)],d.deflateInit=function(o,K){return P(o,K,v,15,8,0)},d.deflateInit2=P,d.deflateReset=B,d.deflateResetKeep=re,d.deflateSetHeader=function(o,K){return o&&o.state?o.state.wrap!==2?m:(o.state.gzhead=K,p):m},d.deflate=function(o,K){var T,e,t,u;if(!o||!o.state||5<K||K<0)return o?ae(o,m):m;if(e=o.state,!o.output||!o.input&&o.avail_in!==0||e.status===666&&K!==N)return ae(o,o.avail_out===0?-5:m);if(e.strm=o,T=e.last_flush,e.last_flush=K,e.status===I)if(e.wrap===2)o.adler=0,Z(e,31),Z(e,139),Z(e,8),e.gzhead?(Z(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),Z(e,255&e.gzhead.time),Z(e,e.gzhead.time>>8&255),Z(e,e.gzhead.time>>16&255),Z(e,e.gzhead.time>>24&255),Z(e,e.level===9?2:2<=e.strategy||e.level<2?4:0),Z(e,255&e.gzhead.os),e.gzhead.extra&&e.gzhead.extra.length&&(Z(e,255&e.gzhead.extra.length),Z(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(o.adler=R(o.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=69):(Z(e,0),Z(e,0),Z(e,0),Z(e,0),Z(e,0),Z(e,e.level===9?2:2<=e.strategy||e.level<2?4:0),Z(e,3),e.status=W);else{var L=v+(e.w_bits-8<<4)<<8;L|=(2<=e.strategy||e.level<2?0:e.level<6?1:e.level===6?2:3)<<6,e.strstart!==0&&(L|=32),L+=31-L%31,e.status=W,X(e,L),e.strstart!==0&&(X(e,o.adler>>>16),X(e,65535&o.adler)),o.adler=1}if(e.status===69)if(e.gzhead.extra){for(t=e.pending;e.gzindex<(65535&e.gzhead.extra.length)&&(e.pending!==e.pending_buf_size||(e.gzhead.hcrc&&e.pending>t&&(o.adler=R(o.adler,e.pending_buf,e.pending-t,t)),V(o),t=e.pending,e.pending!==e.pending_buf_size));)Z(e,255&e.gzhead.extra[e.gzindex]),e.gzindex++;e.gzhead.hcrc&&e.pending>t&&(o.adler=R(o.adler,e.pending_buf,e.pending-t,t)),e.gzindex===e.gzhead.extra.length&&(e.gzindex=0,e.status=73)}else e.status=73;if(e.status===73)if(e.gzhead.name){t=e.pending;do{if(e.pending===e.pending_buf_size&&(e.gzhead.hcrc&&e.pending>t&&(o.adler=R(o.adler,e.pending_buf,e.pending-t,t)),V(o),t=e.pending,e.pending===e.pending_buf_size)){u=1;break}u=e.gzindex<e.gzhead.name.length?255&e.gzhead.name.charCodeAt(e.gzindex++):0,Z(e,u)}while(u!==0);e.gzhead.hcrc&&e.pending>t&&(o.adler=R(o.adler,e.pending_buf,e.pending-t,t)),u===0&&(e.gzindex=0,e.status=91)}else e.status=91;if(e.status===91)if(e.gzhead.comment){t=e.pending;do{if(e.pending===e.pending_buf_size&&(e.gzhead.hcrc&&e.pending>t&&(o.adler=R(o.adler,e.pending_buf,e.pending-t,t)),V(o),t=e.pending,e.pending===e.pending_buf_size)){u=1;break}u=e.gzindex<e.gzhead.comment.length?255&e.gzhead.comment.charCodeAt(e.gzindex++):0,Z(e,u)}while(u!==0);e.gzhead.hcrc&&e.pending>t&&(o.adler=R(o.adler,e.pending_buf,e.pending-t,t)),u===0&&(e.status=103)}else e.status=103;if(e.status===103&&(e.gzhead.hcrc?(e.pending+2>e.pending_buf_size&&V(o),e.pending+2<=e.pending_buf_size&&(Z(e,255&o.adler),Z(e,o.adler>>8&255),o.adler=0,e.status=W)):e.status=W),e.pending!==0){if(V(o),o.avail_out===0)return e.last_flush=-1,p}else if(o.avail_in===0&&$(K)<=$(T)&&K!==N)return ae(o,-5);if(e.status===666&&o.avail_in!==0)return ae(o,-5);if(o.avail_in!==0||e.lookahead!==0||K!==A&&e.status!==666){var G=e.strategy===2?(function(z,ne){for(var oe;;){if(z.lookahead===0&&(ue(z),z.lookahead===0)){if(ne===A)return E;break}if(z.match_length=0,oe=r._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++,oe&&(F(z,!1),z.strm.avail_out===0))return E}return z.insert=0,ne===N?(F(z,!0),z.strm.avail_out===0?J:Y):z.last_lit&&(F(z,!1),z.strm.avail_out===0)?E:H})(e,K):e.strategy===3?(function(z,ne){for(var oe,ie,le,ce,fe=z.window;;){if(z.lookahead<=q){if(ue(z),z.lookahead<=q&&ne===A)return E;if(z.lookahead===0)break}if(z.match_length=0,z.lookahead>=w&&0<z.strstart&&(ie=fe[le=z.strstart-1])===fe[++le]&&ie===fe[++le]&&ie===fe[++le]){ce=z.strstart+q;do;while(ie===fe[++le]&&ie===fe[++le]&&ie===fe[++le]&&ie===fe[++le]&&ie===fe[++le]&&ie===fe[++le]&&ie===fe[++le]&&ie===fe[++le]&&le<ce);z.match_length=q-(ce-le),z.match_length>z.lookahead&&(z.match_length=z.lookahead)}if(z.match_length>=w?(oe=r._tr_tally(z,1,z.match_length-w),z.lookahead-=z.match_length,z.strstart+=z.match_length,z.match_length=0):(oe=r._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++),oe&&(F(z,!1),z.strm.avail_out===0))return E}return z.insert=0,ne===N?(F(z,!0),z.strm.avail_out===0?J:Y):z.last_lit&&(F(z,!1),z.strm.avail_out===0)?E:H})(e,K):n[e.level].func(e,K);if(G!==J&&G!==Y||(e.status=666),G===E||G===J)return o.avail_out===0&&(e.last_flush=-1),p;if(G===H&&(K===1?r._tr_align(e):K!==5&&(r._tr_stored_block(e,0,0,!1),K===3&&(ee(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),V(o),o.avail_out===0))return e.last_flush=-1,p}return K!==N?p:e.wrap<=0?1:(e.wrap===2?(Z(e,255&o.adler),Z(e,o.adler>>8&255),Z(e,o.adler>>16&255),Z(e,o.adler>>24&255),Z(e,255&o.total_in),Z(e,o.total_in>>8&255),Z(e,o.total_in>>16&255),Z(e,o.total_in>>24&255)):(X(e,o.adler>>>16),X(e,65535&o.adler)),V(o),0<e.wrap&&(e.wrap=-e.wrap),e.pending!==0?p:1)},d.deflateEnd=function(o){var K;return o&&o.state?(K=o.state.status)!==I&&K!==69&&K!==73&&K!==91&&K!==103&&K!==W&&K!==666?ae(o,m):(o.state=null,K===W?ae(o,-3):p):m},d.deflateSetDictionary=function(o,K){var T,e,t,u,L,G,z,ne,oe=K.length;if(!o||!o.state||(u=(T=o.state).wrap)===2||u===1&&T.status!==I||T.lookahead)return m;for(u===1&&(o.adler=f(o.adler,K,oe,0)),T.wrap=0,oe>=T.w_size&&(u===0&&(ee(T.head),T.strstart=0,T.block_start=0,T.insert=0),ne=new a.Buf8(T.w_size),a.arraySet(ne,K,oe-T.w_size,T.w_size,0),K=ne,oe=T.w_size),L=o.avail_in,G=o.next_in,z=o.input,o.avail_in=oe,o.next_in=0,o.input=K,ue(T);T.lookahead>=w;){for(e=T.strstart,t=T.lookahead-(w-1);T.ins_h=(T.ins_h<<T.hash_shift^T.window[e+w-1])&T.hash_mask,T.prev[e&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=e,e++,--t;);T.strstart=e,T.lookahead=w-1,ue(T)}return T.strstart+=T.lookahead,T.block_start=T.strstart,T.insert=T.lookahead,T.lookahead=0,T.match_length=T.prev_length=w-1,T.match_available=0,o.next_in=G,o.input=z,o.avail_in=L,T.wrap=u,p},d.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(i,h,d){h.exports=function(){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}},{}],48:[function(i,h,d){h.exports=function(n,a){var r=n.state,f=n.next_in,R,C,A,N,p,m,g,S,O,v,_,x,b,c,D,U,w,q,Q,I,W,E=n.input,H;R=f+(n.avail_in-5),C=n.next_out,H=n.output,A=C-(a-n.avail_out),N=C+(n.avail_out-257),p=r.dmax,m=r.wsize,g=r.whave,S=r.wnext,O=r.window,v=r.hold,_=r.bits,x=r.lencode,b=r.distcode,c=(1<<r.lenbits)-1,D=(1<<r.distbits)-1;e:do{_<15&&(v+=E[f++]<<_,_+=8,v+=E[f++]<<_,_+=8),U=x[v&c];t:for(;;){if(v>>>=w=U>>>24,_-=w,(w=U>>>16&255)===0)H[C++]=65535&U;else{if(!(16&w)){if((64&w)==0){U=x[(65535&U)+(v&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}n.msg="invalid literal/length code",r.mode=30;break e}q=65535&U,(w&=15)&&(_<w&&(v+=E[f++]<<_,_+=8),q+=v&(1<<w)-1,v>>>=w,_-=w),_<15&&(v+=E[f++]<<_,_+=8,v+=E[f++]<<_,_+=8),U=b[v&D];r:for(;;){if(v>>>=w=U>>>24,_-=w,!(16&(w=U>>>16&255))){if((64&w)==0){U=b[(65535&U)+(v&(1<<w)-1)];continue r}n.msg="invalid distance code",r.mode=30;break e}if(Q=65535&U,_<(w&=15)&&(v+=E[f++]<<_,(_+=8)<w&&(v+=E[f++]<<_,_+=8)),p<(Q+=v&(1<<w)-1)){n.msg="invalid distance too far back",r.mode=30;break e}if(v>>>=w,_-=w,(w=C-A)<Q){if(g<(w=Q-w)&&r.sane){n.msg="invalid distance too far back",r.mode=30;break e}if(W=O,(I=0)===S){if(I+=m-w,w<q){for(q-=w;H[C++]=O[I++],--w;);I=C-Q,W=H}}else if(S<w){if(I+=m+S-w,(w-=S)<q){for(q-=w;H[C++]=O[I++],--w;);if(I=0,S<q){for(q-=w=S;H[C++]=O[I++],--w;);I=C-Q,W=H}}}else if(I+=S-w,w<q){for(q-=w;H[C++]=O[I++],--w;);I=C-Q,W=H}for(;2<q;)H[C++]=W[I++],H[C++]=W[I++],H[C++]=W[I++],q-=3;q&&(H[C++]=W[I++],1<q&&(H[C++]=W[I++]))}else{for(I=C-Q;H[C++]=H[I++],H[C++]=H[I++],H[C++]=H[I++],2<(q-=3););q&&(H[C++]=H[I++],1<q&&(H[C++]=H[I++]))}break}}break}}while(f<R&&C<N);f-=q=_>>3,v&=(1<<(_-=q<<3))-1,n.next_in=f,n.next_out=C,n.avail_in=f<R?R-f+5:5-(f-R),n.avail_out=C<N?N-C+257:257-(C-N),r.hold=v,r.bits=_}},{}],49:[function(i,h,d){var n=i("../utils/common"),a=i("./adler32"),r=i("./crc32"),f=i("./inffast"),R=i("./inftrees"),C=1,A=2,N=0,p=-2,m=1,g=852,S=592;function O(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function v(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(I){var W;return I&&I.state?(W=I.state,I.total_in=I.total_out=W.total=0,I.msg="",W.wrap&&(I.adler=1&W.wrap),W.mode=m,W.last=0,W.havedict=0,W.dmax=32768,W.head=null,W.hold=0,W.bits=0,W.lencode=W.lendyn=new n.Buf32(g),W.distcode=W.distdyn=new n.Buf32(S),W.sane=1,W.back=-1,N):p}function x(I){var W;return I&&I.state?((W=I.state).wsize=0,W.whave=0,W.wnext=0,_(I)):p}function b(I,W){var E,H;return I&&I.state?(H=I.state,W<0?(E=0,W=-W):(E=1+(W>>4),W<48&&(W&=15)),W&&(W<8||15<W)?p:(H.window!==null&&H.wbits!==W&&(H.window=null),H.wrap=E,H.wbits=W,x(I))):p}function c(I,W){var E,H;return I?(H=new v,(I.state=H).window=null,(E=b(I,W))!==N&&(I.state=null),E):p}var D,U,w=!0;function q(I){if(w){var W;for(D=new n.Buf32(512),U=new n.Buf32(32),W=0;W<144;)I.lens[W++]=8;for(;W<256;)I.lens[W++]=9;for(;W<280;)I.lens[W++]=7;for(;W<288;)I.lens[W++]=8;for(R(C,I.lens,0,288,D,0,I.work,{bits:9}),W=0;W<32;)I.lens[W++]=5;R(A,I.lens,0,32,U,0,I.work,{bits:5}),w=!1}I.lencode=D,I.lenbits=9,I.distcode=U,I.distbits=5}function Q(I,W,E,H){var J,Y=I.state;return Y.window===null&&(Y.wsize=1<<Y.wbits,Y.wnext=0,Y.whave=0,Y.window=new n.Buf8(Y.wsize)),H>=Y.wsize?(n.arraySet(Y.window,W,E-Y.wsize,Y.wsize,0),Y.wnext=0,Y.whave=Y.wsize):(H<(J=Y.wsize-Y.wnext)&&(J=H),n.arraySet(Y.window,W,E-H,J,Y.wnext),(H-=J)?(n.arraySet(Y.window,W,E-H,H,0),Y.wnext=H,Y.whave=Y.wsize):(Y.wnext+=J,Y.wnext===Y.wsize&&(Y.wnext=0),Y.whave<Y.wsize&&(Y.whave+=J))),0}d.inflateReset=x,d.inflateReset2=b,d.inflateResetKeep=_,d.inflateInit=function(I){return c(I,15)},d.inflateInit2=c,d.inflate=function(I,W){var E,H,J,Y,ae,$,ee,V,F,Z,X,te,ue,y,s,j,M,re,B,P,o,K,T,e,t=0,u=new n.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return p;(E=I.state).mode===12&&(E.mode=13),ae=I.next_out,J=I.output,ee=I.avail_out,Y=I.next_in,H=I.input,$=I.avail_in,V=E.hold,F=E.bits,Z=$,X=ee,K=N;e:for(;;)switch(E.mode){case m:if(E.wrap===0){E.mode=13;break}for(;F<16;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if(2&E.wrap&&V===35615){u[E.check=0]=255&V,u[1]=V>>>8&255,E.check=r(E.check,u,2,0),F=V=0,E.mode=2;break}if(E.flags=0,E.head&&(E.head.done=!1),!(1&E.wrap)||(((255&V)<<8)+(V>>8))%31){I.msg="incorrect header check",E.mode=30;break}if((15&V)!=8){I.msg="unknown compression method",E.mode=30;break}if(F-=4,o=8+(15&(V>>>=4)),E.wbits===0)E.wbits=o;else if(o>E.wbits){I.msg="invalid window size",E.mode=30;break}E.dmax=1<<o,I.adler=E.check=1,E.mode=512&V?10:12,F=V=0;break;case 2:for(;F<16;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if(E.flags=V,(255&E.flags)!=8){I.msg="unknown compression method",E.mode=30;break}if(57344&E.flags){I.msg="unknown header flags set",E.mode=30;break}E.head&&(E.head.text=V>>8&1),512&E.flags&&(u[0]=255&V,u[1]=V>>>8&255,E.check=r(E.check,u,2,0)),F=V=0,E.mode=3;case 3:for(;F<32;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}E.head&&(E.head.time=V),512&E.flags&&(u[0]=255&V,u[1]=V>>>8&255,u[2]=V>>>16&255,u[3]=V>>>24&255,E.check=r(E.check,u,4,0)),F=V=0,E.mode=4;case 4:for(;F<16;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}E.head&&(E.head.xflags=255&V,E.head.os=V>>8),512&E.flags&&(u[0]=255&V,u[1]=V>>>8&255,E.check=r(E.check,u,2,0)),F=V=0,E.mode=5;case 5:if(1024&E.flags){for(;F<16;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}E.length=V,E.head&&(E.head.extra_len=V),512&E.flags&&(u[0]=255&V,u[1]=V>>>8&255,E.check=r(E.check,u,2,0)),F=V=0}else E.head&&(E.head.extra=null);E.mode=6;case 6:if(1024&E.flags&&($<(te=E.length)&&(te=$),te&&(E.head&&(o=E.head.extra_len-E.length,E.head.extra||(E.head.extra=new Array(E.head.extra_len)),n.arraySet(E.head.extra,H,Y,te,o)),512&E.flags&&(E.check=r(E.check,H,te,Y)),$-=te,Y+=te,E.length-=te),E.length))break e;E.length=0,E.mode=7;case 7:if(2048&E.flags){if($===0)break e;for(te=0;o=H[Y+te++],E.head&&o&&E.length<65536&&(E.head.name+=String.fromCharCode(o)),o&&te<$;);if(512&E.flags&&(E.check=r(E.check,H,te,Y)),$-=te,Y+=te,o)break e}else E.head&&(E.head.name=null);E.length=0,E.mode=8;case 8:if(4096&E.flags){if($===0)break e;for(te=0;o=H[Y+te++],E.head&&o&&E.length<65536&&(E.head.comment+=String.fromCharCode(o)),o&&te<$;);if(512&E.flags&&(E.check=r(E.check,H,te,Y)),$-=te,Y+=te,o)break e}else E.head&&(E.head.comment=null);E.mode=9;case 9:if(512&E.flags){for(;F<16;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if(V!==(65535&E.check)){I.msg="header crc mismatch",E.mode=30;break}F=V=0}E.head&&(E.head.hcrc=E.flags>>9&1,E.head.done=!0),I.adler=E.check=0,E.mode=12;break;case 10:for(;F<32;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}I.adler=E.check=O(V),F=V=0,E.mode=11;case 11:if(E.havedict===0)return I.next_out=ae,I.avail_out=ee,I.next_in=Y,I.avail_in=$,E.hold=V,E.bits=F,2;I.adler=E.check=1,E.mode=12;case 12:if(W===5||W===6)break e;case 13:if(E.last){V>>>=7&F,F-=7&F,E.mode=27;break}for(;F<3;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}switch(E.last=1&V,F-=1,3&(V>>>=1)){case 0:E.mode=14;break;case 1:if(q(E),E.mode=20,W!==6)break;V>>>=2,F-=2;break e;case 2:E.mode=17;break;case 3:I.msg="invalid block type",E.mode=30}V>>>=2,F-=2;break;case 14:for(V>>>=7&F,F-=7&F;F<32;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if((65535&V)!=(V>>>16^65535)){I.msg="invalid stored block lengths",E.mode=30;break}if(E.length=65535&V,F=V=0,E.mode=15,W===6)break e;case 15:E.mode=16;case 16:if(te=E.length){if($<te&&(te=$),ee<te&&(te=ee),te===0)break e;n.arraySet(J,H,Y,te,ae),$-=te,Y+=te,ee-=te,ae+=te,E.length-=te;break}E.mode=12;break;case 17:for(;F<14;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if(E.nlen=257+(31&V),V>>>=5,F-=5,E.ndist=1+(31&V),V>>>=5,F-=5,E.ncode=4+(15&V),V>>>=4,F-=4,286<E.nlen||30<E.ndist){I.msg="too many length or distance symbols",E.mode=30;break}E.have=0,E.mode=18;case 18:for(;E.have<E.ncode;){for(;F<3;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}E.lens[L[E.have++]]=7&V,V>>>=3,F-=3}for(;E.have<19;)E.lens[L[E.have++]]=0;if(E.lencode=E.lendyn,E.lenbits=7,T={bits:E.lenbits},K=R(0,E.lens,0,19,E.lencode,0,E.work,T),E.lenbits=T.bits,K){I.msg="invalid code lengths set",E.mode=30;break}E.have=0,E.mode=19;case 19:for(;E.have<E.nlen+E.ndist;){for(;j=(t=E.lencode[V&(1<<E.lenbits)-1])>>>16&255,M=65535&t,!((s=t>>>24)<=F);){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if(M<16)V>>>=s,F-=s,E.lens[E.have++]=M;else{if(M===16){for(e=s+2;F<e;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if(V>>>=s,F-=s,E.have===0){I.msg="invalid bit length repeat",E.mode=30;break}o=E.lens[E.have-1],te=3+(3&V),V>>>=2,F-=2}else if(M===17){for(e=s+3;F<e;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}F-=s,o=0,te=3+(7&(V>>>=s)),V>>>=3,F-=3}else{for(e=s+7;F<e;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}F-=s,o=0,te=11+(127&(V>>>=s)),V>>>=7,F-=7}if(E.have+te>E.nlen+E.ndist){I.msg="invalid bit length repeat",E.mode=30;break}for(;te--;)E.lens[E.have++]=o}}if(E.mode===30)break;if(E.lens[256]===0){I.msg="invalid code -- missing end-of-block",E.mode=30;break}if(E.lenbits=9,T={bits:E.lenbits},K=R(C,E.lens,0,E.nlen,E.lencode,0,E.work,T),E.lenbits=T.bits,K){I.msg="invalid literal/lengths set",E.mode=30;break}if(E.distbits=6,E.distcode=E.distdyn,T={bits:E.distbits},K=R(A,E.lens,E.nlen,E.ndist,E.distcode,0,E.work,T),E.distbits=T.bits,K){I.msg="invalid distances set",E.mode=30;break}if(E.mode=20,W===6)break e;case 20:E.mode=21;case 21:if(6<=$&&258<=ee){I.next_out=ae,I.avail_out=ee,I.next_in=Y,I.avail_in=$,E.hold=V,E.bits=F,f(I,X),ae=I.next_out,J=I.output,ee=I.avail_out,Y=I.next_in,H=I.input,$=I.avail_in,V=E.hold,F=E.bits,E.mode===12&&(E.back=-1);break}for(E.back=0;j=(t=E.lencode[V&(1<<E.lenbits)-1])>>>16&255,M=65535&t,!((s=t>>>24)<=F);){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if(j&&(240&j)==0){for(re=s,B=j,P=M;j=(t=E.lencode[P+((V&(1<<re+B)-1)>>re)])>>>16&255,M=65535&t,!(re+(s=t>>>24)<=F);){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}V>>>=re,F-=re,E.back+=re}if(V>>>=s,F-=s,E.back+=s,E.length=M,j===0){E.mode=26;break}if(32&j){E.back=-1,E.mode=12;break}if(64&j){I.msg="invalid literal/length code",E.mode=30;break}E.extra=15&j,E.mode=22;case 22:if(E.extra){for(e=E.extra;F<e;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}E.length+=V&(1<<E.extra)-1,V>>>=E.extra,F-=E.extra,E.back+=E.extra}E.was=E.length,E.mode=23;case 23:for(;j=(t=E.distcode[V&(1<<E.distbits)-1])>>>16&255,M=65535&t,!((s=t>>>24)<=F);){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if((240&j)==0){for(re=s,B=j,P=M;j=(t=E.distcode[P+((V&(1<<re+B)-1)>>re)])>>>16&255,M=65535&t,!(re+(s=t>>>24)<=F);){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}V>>>=re,F-=re,E.back+=re}if(V>>>=s,F-=s,E.back+=s,64&j){I.msg="invalid distance code",E.mode=30;break}E.offset=M,E.extra=15&j,E.mode=24;case 24:if(E.extra){for(e=E.extra;F<e;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}E.offset+=V&(1<<E.extra)-1,V>>>=E.extra,F-=E.extra,E.back+=E.extra}if(E.offset>E.dmax){I.msg="invalid distance too far back",E.mode=30;break}E.mode=25;case 25:if(ee===0)break e;if(te=X-ee,E.offset>te){if((te=E.offset-te)>E.whave&&E.sane){I.msg="invalid distance too far back",E.mode=30;break}ue=te>E.wnext?(te-=E.wnext,E.wsize-te):E.wnext-te,te>E.length&&(te=E.length),y=E.window}else y=J,ue=ae-E.offset,te=E.length;for(ee<te&&(te=ee),ee-=te,E.length-=te;J[ae++]=y[ue++],--te;);E.length===0&&(E.mode=21);break;case 26:if(ee===0)break e;J[ae++]=E.length,ee--,E.mode=21;break;case 27:if(E.wrap){for(;F<32;){if($===0)break e;$--,V|=H[Y++]<<F,F+=8}if(X-=ee,I.total_out+=X,E.total+=X,X&&(I.adler=E.check=E.flags?r(E.check,J,X,ae-X):a(E.check,J,X,ae-X)),X=ee,(E.flags?V:O(V))!==E.check){I.msg="incorrect data check",E.mode=30;break}F=V=0}E.mode=28;case 28:if(E.wrap&&E.flags){for(;F<32;){if($===0)break e;$--,V+=H[Y++]<<F,F+=8}if(V!==(4294967295&E.total)){I.msg="incorrect length check",E.mode=30;break}F=V=0}E.mode=29;case 29:K=1;break e;case 30:K=-3;break e;case 31:return-4;default:return p}return I.next_out=ae,I.avail_out=ee,I.next_in=Y,I.avail_in=$,E.hold=V,E.bits=F,(E.wsize||X!==I.avail_out&&E.mode<30&&(E.mode<27||W!==4))&&Q(I,I.output,I.next_out,X-I.avail_out)?(E.mode=31,-4):(Z-=I.avail_in,X-=I.avail_out,I.total_in+=Z,I.total_out+=X,E.total+=X,E.wrap&&X&&(I.adler=E.check=E.flags?r(E.check,J,X,I.next_out-X):a(E.check,J,X,I.next_out-X)),I.data_type=E.bits+(E.last?64:0)+(E.mode===12?128:0)+(E.mode===20||E.mode===15?256:0),(Z==0&&X===0||W===4)&&K===N&&(K=-5),K)},d.inflateEnd=function(I){if(!I||!I.state)return p;var W=I.state;return W.window&&(W.window=null),I.state=null,N},d.inflateGetHeader=function(I,W){var E;return I&&I.state?(2&(E=I.state).wrap)==0?p:((E.head=W).done=!1,N):p},d.inflateSetDictionary=function(I,W){var E,H=W.length;return I&&I.state?(E=I.state).wrap!==0&&E.mode!==11?p:E.mode===11&&a(1,W,H,0)!==E.check?-3:Q(I,W,H,H)?(E.mode=31,-4):(E.havedict=1,N):p},d.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(i,h,d){var n=i("../utils/common"),a=[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],r=[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],f=[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],R=[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];h.exports=function(C,A,N,p,m,g,S,O){var v,_,x,b,c,D,U,w,q,Q=O.bits,I=0,W=0,E=0,H=0,J=0,Y=0,ae=0,$=0,ee=0,V=0,F=null,Z=0,X=new n.Buf16(16),te=new n.Buf16(16),ue=null,y=0;for(I=0;I<=15;I++)X[I]=0;for(W=0;W<p;W++)X[A[N+W]]++;for(J=Q,H=15;1<=H&&X[H]===0;H--);if(H<J&&(J=H),H===0)return m[g++]=20971520,m[g++]=20971520,O.bits=1,0;for(E=1;E<H&&X[E]===0;E++);for(J<E&&(J=E),I=$=1;I<=15;I++)if($<<=1,($-=X[I])<0)return-1;if(0<$&&(C===0||H!==1))return-1;for(te[1]=0,I=1;I<15;I++)te[I+1]=te[I]+X[I];for(W=0;W<p;W++)A[N+W]!==0&&(S[te[A[N+W]]++]=W);if(D=C===0?(F=ue=S,19):C===1?(F=a,Z-=257,ue=r,y-=257,256):(F=f,ue=R,-1),I=E,c=g,ae=W=V=0,x=-1,b=(ee=1<<(Y=J))-1,C===1&&852<ee||C===2&&592<ee)return 1;for(;;){for(U=I-ae,q=S[W]<D?(w=0,S[W]):S[W]>D?(w=ue[y+S[W]],F[Z+S[W]]):(w=96,0),v=1<<I-ae,E=_=1<<Y;m[c+(V>>ae)+(_-=v)]=U<<24|w<<16|q|0,_!==0;);for(v=1<<I-1;V&v;)v>>=1;if(v!==0?(V&=v-1,V+=v):V=0,W++,--X[I]==0){if(I===H)break;I=A[N+S[W]]}if(J<I&&(V&b)!==x){for(ae===0&&(ae=J),c+=E,$=1<<(Y=I-ae);Y+ae<H&&!(($-=X[Y+ae])<=0);)Y++,$<<=1;if(ee+=1<<Y,C===1&&852<ee||C===2&&592<ee)return 1;m[x=V&b]=J<<24|Y<<16|c-g|0}}return V!==0&&(m[c+V]=I-ae<<24|4194304),O.bits=J,0}},{"../utils/common":41}],51:[function(i,h,d){h.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"}},{}],52:[function(i,h,d){var n=i("../utils/common"),a=0,r=1;function f(t){for(var u=t.length;0<=--u;)t[u]=0}var R=0,C=29,A=256,N=A+1+C,p=30,m=19,g=2*N+1,S=15,O=16,v=7,_=256,x=16,b=17,c=18,D=[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],U=[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],w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Q=new Array(2*(N+2));f(Q);var I=new Array(2*p);f(I);var W=new Array(512);f(W);var E=new Array(256);f(E);var H=new Array(C);f(H);var J,Y,ae,$=new Array(p);function ee(t,u,L,G,z){this.static_tree=t,this.extra_bits=u,this.extra_base=L,this.elems=G,this.max_length=z,this.has_stree=t&&t.length}function V(t,u){this.dyn_tree=t,this.max_code=0,this.stat_desc=u}function F(t){return t<256?W[t]:W[256+(t>>>7)]}function Z(t,u){t.pending_buf[t.pending++]=255&u,t.pending_buf[t.pending++]=u>>>8&255}function X(t,u,L){t.bi_valid>O-L?(t.bi_buf|=u<<t.bi_valid&65535,Z(t,t.bi_buf),t.bi_buf=u>>O-t.bi_valid,t.bi_valid+=L-O):(t.bi_buf|=u<<t.bi_valid&65535,t.bi_valid+=L)}function te(t,u,L){X(t,L[2*u],L[2*u+1])}function ue(t,u){for(var L=0;L|=1&t,t>>>=1,L<<=1,0<--u;);return L>>>1}function y(t,u,L){var G,z,ne=new Array(S+1),oe=0;for(G=1;G<=S;G++)ne[G]=oe=oe+L[G-1]<<1;for(z=0;z<=u;z++){var ie=t[2*z+1];ie!==0&&(t[2*z]=ue(ne[ie]++,ie))}}function s(t){var u;for(u=0;u<N;u++)t.dyn_ltree[2*u]=0;for(u=0;u<p;u++)t.dyn_dtree[2*u]=0;for(u=0;u<m;u++)t.bl_tree[2*u]=0;t.dyn_ltree[2*_]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function j(t){8<t.bi_valid?Z(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function M(t,u,L,G){var z=2*u,ne=2*L;return t[z]<t[ne]||t[z]===t[ne]&&G[u]<=G[L]}function re(t,u,L){for(var G=t.heap[L],z=L<<1;z<=t.heap_len&&(z<t.heap_len&&M(u,t.heap[z+1],t.heap[z],t.depth)&&z++,!M(u,G,t.heap[z],t.depth));)t.heap[L]=t.heap[z],L=z,z<<=1;t.heap[L]=G}function B(t,u,L){var G,z,ne,oe,ie=0;if(t.last_lit!==0)for(;G=t.pending_buf[t.d_buf+2*ie]<<8|t.pending_buf[t.d_buf+2*ie+1],z=t.pending_buf[t.l_buf+ie],ie++,G===0?te(t,z,u):(te(t,(ne=E[z])+A+1,u),(oe=D[ne])!==0&&X(t,z-=H[ne],oe),te(t,ne=F(--G),L),(oe=U[ne])!==0&&X(t,G-=$[ne],oe)),ie<t.last_lit;);te(t,_,u)}function P(t,u){var L,G,z,ne=u.dyn_tree,oe=u.stat_desc.static_tree,ie=u.stat_desc.has_stree,le=u.stat_desc.elems,ce=-1;for(t.heap_len=0,t.heap_max=g,L=0;L<le;L++)ne[2*L]!==0?(t.heap[++t.heap_len]=ce=L,t.depth[L]=0):ne[2*L+1]=0;for(;t.heap_len<2;)ne[2*(z=t.heap[++t.heap_len]=ce<2?++ce:0)]=1,t.depth[z]=0,t.opt_len--,ie&&(t.static_len-=oe[2*z+1]);for(u.max_code=ce,L=t.heap_len>>1;1<=L;L--)re(t,ne,L);for(z=le;L=t.heap[1],t.heap[1]=t.heap[t.heap_len--],re(t,ne,1),G=t.heap[1],t.heap[--t.heap_max]=L,t.heap[--t.heap_max]=G,ne[2*z]=ne[2*L]+ne[2*G],t.depth[z]=(t.depth[L]>=t.depth[G]?t.depth[L]:t.depth[G])+1,ne[2*L+1]=ne[2*G+1]=z,t.heap[1]=z++,re(t,ne,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],(function(fe,ge){var ke,be,je,me,$e,rt,Ae=ge.dyn_tree,Et=ge.max_code,cr=ge.stat_desc.static_tree,fr=ge.stat_desc.has_stree,dr=ge.stat_desc.extra_bits,xt=ge.stat_desc.extra_base,ze=ge.stat_desc.max_length,Xe=0;for(me=0;me<=S;me++)fe.bl_count[me]=0;for(Ae[2*fe.heap[fe.heap_max]+1]=0,ke=fe.heap_max+1;ke<g;ke++)ze<(me=Ae[2*Ae[2*(be=fe.heap[ke])+1]+1]+1)&&(me=ze,Xe++),Ae[2*be+1]=me,Et<be||(fe.bl_count[me]++,$e=0,xt<=be&&($e=dr[be-xt]),rt=Ae[2*be],fe.opt_len+=rt*(me+$e),fr&&(fe.static_len+=rt*(cr[2*be+1]+$e)));if(Xe!==0){do{for(me=ze-1;fe.bl_count[me]===0;)me--;fe.bl_count[me]--,fe.bl_count[me+1]+=2,fe.bl_count[ze]--,Xe-=2}while(0<Xe);for(me=ze;me!==0;me--)for(be=fe.bl_count[me];be!==0;)Et<(je=fe.heap[--ke])||(Ae[2*je+1]!==me&&(fe.opt_len+=(me-Ae[2*je+1])*Ae[2*je],Ae[2*je+1]=me),be--)}})(t,u),y(ne,ce,t.bl_count)}function o(t,u,L){var G,z,ne=-1,oe=u[1],ie=0,le=7,ce=4;for(oe===0&&(le=138,ce=3),u[2*(L+1)+1]=65535,G=0;G<=L;G++)z=oe,oe=u[2*(G+1)+1],++ie<le&&z===oe||(ie<ce?t.bl_tree[2*z]+=ie:z!==0?(z!==ne&&t.bl_tree[2*z]++,t.bl_tree[2*x]++):ie<=10?t.bl_tree[2*b]++:t.bl_tree[2*c]++,ne=z,ce=(ie=0)===oe?(le=138,3):z===oe?(le=6,3):(le=7,4))}function K(t,u,L){var G,z,ne=-1,oe=u[1],ie=0,le=7,ce=4;for(oe===0&&(le=138,ce=3),G=0;G<=L;G++)if(z=oe,oe=u[2*(G+1)+1],!(++ie<le&&z===oe)){if(ie<ce)for(;te(t,z,t.bl_tree),--ie!=0;);else z!==0?(z!==ne&&(te(t,z,t.bl_tree),ie--),te(t,x,t.bl_tree),X(t,ie-3,2)):ie<=10?(te(t,b,t.bl_tree),X(t,ie-3,3)):(te(t,c,t.bl_tree),X(t,ie-11,7));ne=z,ce=(ie=0)===oe?(le=138,3):z===oe?(le=6,3):(le=7,4)}}f($);var T=!1;function e(t,u,L,G){X(t,(R<<1)+(G?1:0),3),(function(z,ne,oe,ie){j(z),Z(z,oe),Z(z,~oe),n.arraySet(z.pending_buf,z.window,ne,oe,z.pending),z.pending+=oe})(t,u,L)}d._tr_init=function(t){T||((function(){var u,L,G,z,ne,oe=new Array(S+1);for(z=G=0;z<C-1;z++)for(H[z]=G,u=0;u<1<<D[z];u++)E[G++]=z;for(E[G-1]=z,z=ne=0;z<16;z++)for($[z]=ne,u=0;u<1<<U[z];u++)W[ne++]=z;for(ne>>=7;z<p;z++)for($[z]=ne<<7,u=0;u<1<<U[z]-7;u++)W[256+ne++]=z;for(L=0;L<=S;L++)oe[L]=0;for(u=0;
21u<=143;)Q[2*u+1]=8,u++,oe[8]++;for(;u<=255;)Q[2*u+1]=9,u++,oe[9]++;for(;u<=279;)Q[2*u+1]=7,u++,oe[7]++;for(;u<=287;)Q[2*u+1]=8,u++,oe[8]++;for(y(Q,N+1,oe),u=0;u<p;u++)I[2*u+1]=5,I[2*u]=ue(u,5);J=new ee(Q,D,A+1,N,S),Y=new ee(I,U,0,p,S),ae=new ee(new Array(0),w,0,m,v)})(),T=!0),t.l_desc=new V(t.dyn_ltree,J),t.d_desc=new V(t.dyn_dtree,Y),t.bl_desc=new V(t.bl_tree,ae),t.bi_buf=0,t.bi_valid=0,s(t)},d._tr_stored_block=e,d._tr_flush_block=function(t,u,L,G){var z,ne,oe=0;0<t.level?(t.strm.data_type===2&&(t.strm.data_type=(function(ie){var le,ce=4093624447;for(le=0;le<=31;le++,ce>>>=1)if(1&ce&&ie.dyn_ltree[2*le]!==0)return a;if(ie.dyn_ltree[18]!==0||ie.dyn_ltree[20]!==0||ie.dyn_ltree[26]!==0)return r;for(le=32;le<A;le++)if(ie.dyn_ltree[2*le]!==0)return r;return a})(t)),P(t,t.l_desc),P(t,t.d_desc),oe=(function(ie){var le;for(o(ie,ie.dyn_ltree,ie.l_desc.max_code),o(ie,ie.dyn_dtree,ie.d_desc.max_code),P(ie,ie.bl_desc),le=m-1;3<=le&&ie.bl_tree[2*q[le]+1]===0;le--);return ie.opt_len+=3*(le+1)+5+5+4,le})(t),z=t.opt_len+3+7>>>3,(ne=t.static_len+3+7>>>3)<=z&&(z=ne)):z=ne=L+5,L+4<=z&&u!==-1?e(t,u,L,G):t.strategy===4||ne===z?(X(t,2+(G?1:0),3),B(t,Q,I)):(X(t,4+(G?1:0),3),(function(ie,le,ce,fe){var ge;for(X(ie,le-257,5),X(ie,ce-1,5),X(ie,fe-4,4),ge=0;ge<fe;ge++)X(ie,ie.bl_tree[2*q[ge]+1],3);K(ie,ie.dyn_ltree,le-1),K(ie,ie.dyn_dtree,ce-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,oe+1),B(t,t.dyn_ltree,t.dyn_dtree)),s(t),G&&j(t)},d._tr_tally=function(t,u,L){return t.pending_buf[t.d_buf+2*t.last_lit]=u>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&u,t.pending_buf[t.l_buf+t.last_lit]=255&L,t.last_lit++,u===0?t.dyn_ltree[2*L]++:(t.matches++,u--,t.dyn_ltree[2*(E[L]+A+1)]++,t.dyn_dtree[2*F(u)]++),t.last_lit===t.lit_bufsize-1},d._tr_align=function(t){X(t,2,3),te(t,_,Q),(function(u){u.bi_valid===16?(Z(u,u.bi_buf),u.bi_buf=0,u.bi_valid=0):8<=u.bi_valid&&(u.pending_buf[u.pending++]=255&u.bi_buf,u.bi_buf>>=8,u.bi_valid-=8)})(t)}},{"../utils/common":41}],53:[function(i,h,d){h.exports=function(){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}},{}],54:[function(i,h,d){(function(n){(function(a,r){if(!a.setImmediate){var f,R,C,A,N=1,p={},m=!1,g=a.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(a);S=S&&S.setTimeout?S:a,f={}.toString.call(a.process)==="[object process]"?function(x){de.nextTick(function(){v(x)})}:(function(){if(a.postMessage&&!a.importScripts){var x=!0,b=a.onmessage;return a.onmessage=function(){x=!1},a.postMessage("","*"),a.onmessage=b,x}})()?(A="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",_,!1):a.attachEvent("onmessage",_),function(x){a.postMessage(A+x,"*")}):a.MessageChannel?((C=new MessageChannel).port1.onmessage=function(x){v(x.data)},function(x){C.port2.postMessage(x)}):g&&"onreadystatechange"in g.createElement("script")?(R=g.documentElement,function(x){var b=g.createElement("script");b.onreadystatechange=function(){v(x),b.onreadystatechange=null,R.removeChild(b),b=null},R.appendChild(b)}):function(x){setTimeout(v,0,x)},S.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var b=new Array(arguments.length-1),c=0;c<b.length;c++)b[c]=arguments[c+1];return p[N]={callback:x,args:b},f(N),N++},S.clearImmediate=O}function O(x){delete p[x]}function v(x){if(m)setTimeout(v,0,x);else{var b=p[x];if(b){m=!0;try{(function(c){var D=c.callback,U=c.args;switch(U.length){case 0:D();break;case 1:D(U[0]);break;case 2:D(U[0],U[1]);break;case 3:D(U[0],U[1],U[2]);break;default:D.apply(r,U)}})(b)}finally{O(x),m=!1}}}}function _(x){x.source===a&&typeof x.data=="string"&&x.data.indexOf(A)===0&&v(+x.data.slice(A.length))}})(typeof self>"u"?n===void 0?this:n:self)}).call(this,typeof ye<"u"?ye:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})),Gn=se(((l,k)=>{var i={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;"};function h(d){return d&&d.replace?d.replace(/([&"<>'])/g,function(n,a){return i[a]}):d}k.exports=h})),Kn=se(((l,k)=>{Oe();var i=Gn(),h=bt().Stream,d="    ";function n(A,N){typeof N!="object"&&(N={indent:N});var p=N.stream?new h:null,m="",g=!1,S=N.indent?N.indent===!0?d:N.indent:"",O=!0;function v(D){O?de.nextTick(D):D()}function _(D,U){if(U!==void 0&&(m+=U),D&&!g&&(p=p||new h,g=!0),D&&g){var w=m;v(function(){p.emit("data",w)}),m=""}}function x(D,U){R(_,f(D,S,S?1:0),U)}function b(){if(p){var D=m;
21v(function(){p.emit("data",D),p.emit("end"),p.readable=!1,p.emit("close")})}}function c(D){var U={version:"1.0",encoding:D.encoding||"UTF-8"};D.standalone&&(U.standalone=D.standalone),x({"?xml":{_attr:U}}),m=m.replace("/>","?>")}return v(function(){O=!1}),N.declaration&&c(N.declaration),A&&A.forEach?A.forEach(function(D,U){var w;U+1===A.length&&(w=b),x(D,w)}):x(A,b),p?(p.readable=!0,p):m}function a(){var A={_elem:f(Array.prototype.slice.call(arguments))};return A.push=function(N){if(!this.append)throw new Error("not assigned to a parent!");var p=this,m=this._elem.indent;R(this.append,f(N,m,this._elem.icount+(m?1:0)),function(){p.append(!0)})},A.close=function(N){N!==void 0&&this.push(N),this.end&&this.end()},A}function r(A,N){return new Array(N||0).join(A||"")}function f(A,N,p){p=p||0;var m=r(N,p),g,S=A,O=!1;if(typeof A=="object"&&(g=Object.keys(A)[0],S=A[g],S&&S._elem))return S._elem.name=g,S._elem.icount=p,S._elem.indent=N,S._elem.indents=m,S._elem.interrupt=S,S._elem;var v=[],_=[],x;function b(c){Object.keys(c).forEach(function(D){v.push(C(D,c[D]))})}switch(typeof S){case"object":if(S===null)break;S._attr&&b(S._attr),S._cdata&&_.push(("<![CDATA["+S._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),S.forEach&&(x=!1,_.push(""),S.forEach(function(c){typeof c=="object"?Object.keys(c)[0]=="_attr"?b(c._attr):_.push(f(c,N,p+1)):(_.pop(),x=!0,_.push(i(c)))}),x||_.push(""));break;default:_.push(i(S))}return{name:g,interrupt:O,attributes:v,content:_,icount:p,indents:m,indent:N}}function R(A,N,p){if(typeof N!="object")return A(!1,N);var m=N.interrupt?1:N.content.length;function g(){for(;N.content.length;){var O=N.content.shift();if(O!==void 0){if(S(O))return;R(A,O)}}A(!1,(m>1?N.indents:"")+(N.name?"</"+N.name+">":"")+(N.indent&&!p?`
22`:"")),p&&p()}function S(O){return O.interrupt?(O.interrupt.append=A,O.interrupt.end=g,O.interrupt=!1,A(!0),!0):!1}if(A(!1,N.indents+(N.name?"<"+N.name:"")+(N.attributes.length?" "+N.attributes.join(" "):"")+(m?N.name?">":"":N.name?"/>":"")+(N.indent&&m>1?`
23`:"")),!m)return A(!1,N.indent?`
24`:"");S(N)||g()}function C(A,N){return A+'="'+i(N)+'"'}k.exports=n,k.exports.element=k.exports.Element=a})),Vn=bt(),Yn=dt(Hn()),he=dt(Kn()),We=0,at=32,Zn=32,$n=(l,k)=>{const i=k.replace(/-/g,"");if(i.length!==Zn)throw new Error(`Error: Cannot extract GUID from font filename: ${k}`);const h=i.replace(/(..)/g,"$1 ").trim().split(" ").map(a=>parseInt(a,16));h.reverse();const d=l.slice(We,at).map((a,r)=>a^h[r%h.length]),n=new Uint8Array(We+d.length+Math.max(0,l.length-at));return n.set(l.slice(0,We)),n.set(d,We),n.set(l.slice(at),We+d.length),n},Xn=class{format(l,k={stack:[]}){const i=l.prepForXml(k);if(i)return i;throw Error("XMLComponent did not format correctly")}},Jn=class{replace(l,k,i){let h=l;return k.forEach((d,n)=>{h=h.replace(new RegExp(`{${d.fileName}}`,"g"),(i+n).toString())}),h}getMediaData(l,k){return k.Array.filter(i=>l.search(`{${i.fileName}}`)>0)}},Qn=class{replace(l,k){let i=l;for(const h of k)i=i.replace(new RegExp(`{${h.reference}-${h.instance}}`,"g"),h.numId.toString());return i}},ei=class{constructor(){Te(this,"formatter",void 0),Te(this,"imageReplacer",void 0),Te(this,"numberingReplacer",void 0),this.formatter=new Xn,this.imageReplacer=new Jn,this.numberingReplacer=new Qn}compile(l,k,i=[]){const h=new Yn.default,d=this.xmlifyFile(l,k),n=new Map(Object.entries(d));for(const[,a]of n)if(Array.isArray(a))for(const r of a)h.file(r.path,it(r.data));else h.file(a.path,it(a.data));for(const a of i)h.file(a.path,it(a.data));for(const a of l.Media.Array)a.type!=="svg"?h.file(`word/media/${a.fileName}`,a.data):(h.file(`word/media/${a.fileName}`,a.data),h.file(`word/media/${a.fallback.fileName}`,a.fallback.data));for(const[a,{data:r,fontKey:f}]of l.FontTable.fontOptionsWithKey.entries())h.file(`word/fonts/font${a+1}.odttf`,$n(r,f));return h}xmlifyFile(l,k){const i=l.Document.Relationships.RelationshipCount+1,h=(0,he.default)(this.formatter.format(l.Document.View,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),d=l.Comments.Relationships.RelationshipCount+1,n=(0,he.default)(this.formatter.format(l.Comments,{viewWrapper:{View:l.Comments,Relationships:l.Comments.Relationships},file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=l.FootNotes.Relationships.RelationshipCount+1,r=(0,he.default)(this.formatter.format(l.FootNotes.View,{viewWrapper:l.FootNotes,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),f=this.imageReplacer.getMediaData(h,l.Media),R=this.imageReplacer.getMediaData(n,l.Media),C=this.imageReplacer.getMediaData(r,l.Media);return Pe(Pe({Relationships:{data:(f.forEach((A,N)=>{l.Document.Relationships.addRelationship(i+N,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${A.fileName}`)}),l.Document.Relationships.addRelationship(l.Document.Relationships.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),(0,he.default)(this.formatter.format(l.Document.Relationships,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}})),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{const A=this.imageReplacer.replace(h,f,i);return this.numberingReplacer.replace(A,l.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{const A=(0,he.default)(this.formatter.format(l.Styles,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(A,l.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:(0,he.default)(this.formatter.format(l.CoreProperties,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:(0,he.default)(this.formatter.format(l.Numbering,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:(0,he.default)(this.formatter.format(l.FileRelationships,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:l.Headers.map((A,N)=>{const p=(0,he.default)(this.formatter.format(A.View,{viewWrapper:A,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}});
24return this.imageReplacer.getMediaData(p,l.Media).forEach((m,g)=>{A.Relationships.addRelationship(g,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${m.fileName}`)}),{data:(0,he.default)(this.formatter.format(A.Relationships,{viewWrapper:A,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${N+1}.xml.rels`}}),FooterRelationships:l.Footers.map((A,N)=>{const p=(0,he.default)(this.formatter.format(A.View,{viewWrapper:A,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(p,l.Media).forEach((m,g)=>{A.Relationships.addRelationship(g,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${m.fileName}`)}),{data:(0,he.default)(this.formatter.format(A.Relationships,{viewWrapper:A,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${N+1}.xml.rels`}}),Headers:l.Headers.map((A,N)=>{const p=(0,he.default)(this.formatter.format(A.View,{viewWrapper:A,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),m=this.imageReplacer.getMediaData(p,l.Media),g=this.imageReplacer.replace(p,m,0);return{data:this.numberingReplacer.replace(g,l.Numbering.ConcreteNumbering),path:`word/header${N+1}.xml`}}),Footers:l.Footers.map((A,N)=>{const p=(0,he.default)(this.formatter.format(A.View,{viewWrapper:A,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),m=this.imageReplacer.getMediaData(p,l.Media),g=this.imageReplacer.replace(p,m,0);return{data:this.numberingReplacer.replace(g,l.Numbering.ConcreteNumbering),path:`word/footer${N+1}.xml`}}),ContentTypes:{data:(0,he.default)(this.formatter.format(l.ContentTypes,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:(0,he.default)(this.formatter.format(l.CustomProperties,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:(0,he.default)(this.formatter.format(l.AppProperties,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{const A=this.imageReplacer.replace(r,C,a);return this.numberingReplacer.replace(A,l.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(C.forEach((A,N)=>{l.FootNotes.Relationships.addRelationship(a+N,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${A.fileName}`)}),(0,he.default)(this.formatter.format(l.FootNotes.Relationships,{viewWrapper:l.FootNotes,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}})),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:(0,he.default)(this.formatter.format(l.Endnotes.View,{viewWrapper:l.Endnotes,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),path:"word/endnotes.xml"},EndnotesRelationships:{data:(0,he.default)(this.formatter.format(l.Endnotes.Relationships,{viewWrapper:l.Endnotes,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),path:"word/_rels/endnotes.xml.rels"},Settings:{data:(0,he.default)(this.formatter.format(l.Settings,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:(()=>{const A=this.imageReplacer.replace(n,R,d);return this.numberingReplacer.replace(A,l.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(R.forEach((A,N)=>{l.Comments.Relationships.addRelationship(d+N,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${A.fileName}`)}),(0,he.default)(this.formatter.format(l.Comments.Relationships,{viewWrapper:{View:l.Comments,Relationships:l.Comments.Relationships},file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}})),path:"word/_rels/comments.xml.rels"}},l.CommentsExtended?{CommentsExtended:{data:(0,he.default)(this.formatter.format(l.CommentsExtended,{viewWrapper:{View:l.CommentsExtended,Relationships:l.Comments.Relationships},file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsExtended.xml"}}:{}),{},{FontTable:{data:(0,he.default)(this.formatter.format(l.FontTable.View,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:(0,he.default)(this.formatter.format(l.FontTable.Relationships,{viewWrapper:l.Document,file:l,stack:[]}),{indent:k,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"}})}};function Ct(l,k,i,h,d,n,a){try{var r=l[n](a),f=r.value}catch(R){i(R);return}r.done?k(f):Promise.resolve(f).then(h,d)}function ti(l){return function(){var k=this,i=arguments;return new Promise(function(h,d){var n=l.apply(k,i);function a(f){Ct(n,h,d,a,r,"next",f)}
24function r(f){Ct(n,h,d,a,r,"throw",f)}a(void 0)})}}var ri={WITH_2_BLANKS:"  "},Ot=l=>l===!0?ri.WITH_2_BLANKS:l===!1?void 0:l,ni=class Be{static pack(k,i,h){var d=this;return ti(function*(n,a,r,f=[]){return d.compiler.compile(n,Ot(r),f).generateAsync({type:a,mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})}).apply(this,arguments)}static toString(k,i,h=[]){return Be.pack(k,"string",i,h)}static toBuffer(k,i,h=[]){return Be.pack(k,"nodebuffer",i,h)}static toBase64String(k,i,h=[]){return Be.pack(k,"base64",i,h)}static toBlob(k,i,h=[]){return Be.pack(k,"blob",i,h)}static toArrayBuffer(k,i,h=[]){return Be.pack(k,"arraybuffer",i,h)}static toStream(k,i,h=[]){const d=new Vn.Stream;return this.compiler.compile(k,Ot(i),h).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then(n=>{d.emit("data",n),d.emit("end")}),d}};Te(ni,"compiler",new ei);const ii=100*1024,ai={"image/png":"image/png","image/jpeg":"image/jpeg","image/jpg":"image/jpeg"},oi=async l=>{if(typeof l!="string"||l.length===0)return null;try{const k=await xr(l);if(k.data.length>ii)return null;const i=k.contentType.split(";")[0]?.trim().toLowerCase()??"",h=ai[i];return h===void 0?null:{data:k.data,contentType:h,dataUri:Ar({data:k.data,contentType:h})}}catch{return null}},si=({templateId:l,brandColor:k,mode:i})=>{const h=br[i];if(l==="kpi-overview"){const d=hr({brandColor:k,surface:h,minContrast:gr,fallback:vr[i]});return d===null?{}:{"--brand-accent-rule":d}}if(l==="datasource-tracker"){const d=pr(k,h);if(d===null)return{};const n=mr(d,yr);return n===null?{"--brand-accent":d}:{"--brand-accent":d,"--brand-accent-ink":n}}return{}},li=async l=>(await oi(l))?.dataUri??null,ui={"<":"\\u003c",">":"\\u003e","&":"\\u0026","\u2028":"\\u2028","\u2029":"\\u2029"},ci=/[<>&\u2028\u2029]/g,Rt=l=>{const k=JSON.stringify(l??null);return k===void 0?"null":k.replace(ci,i=>ui[i]??i)},fi="darwin-dashboard-config",di="darwin-dashboard-data",Ze=1,Nt=(l,k,i)=>{const h=`<script type="application/json" id="${k}">`,d=l.indexOf(h);if(d===-1)return l;const n=d+h.length,a=l.indexOf("<\/script>",n);return a===-1?l:`${l.slice(0,n)}
25${i}
26${l.slice(a)}`},hi=({content:l,documentId:k})=>({schema_version:l.schemaVersion,protocol_version:Ze,artifact_type:"dashboard",template_id:l.templateId,template_version:l.templateVersion,document_id:k,config:l.config}),It=({templateHtml:l,content:k,documentId:i})=>{const h=Nt(l,fi,Rt(hi({content:k,documentId:i})));return Nt(h,di,Rt(k.data))},Dt=(l,k)=>({type:"darwin:dashboard:data",protocol_version:Ze,document_id:l,data:k}),ot=(l,k)=>({type:"darwin:dashboard:error",protocol_version:Ze,document_id:l,message:k}),pi=({documentId:l,mode:k,tokens:i,logoDataUri:h})=>({type:"darwin:dashboard:theme",protocol_version:Ze,document_id:l,mode:k,tokens:i,logo_data_uri:h}),mi=l=>typeof l=="object"&&l!==null,st=l=>typeof l=="string"?l:null,gi=(l,k)=>{if(!mi(l)||l.protocol_version!==Ze||l.document_id!==k)return null;const i=st(l.type);return i==="darwin:dashboard:ready"?{type:i,documentId:k,templateId:st(l.template_id),templateVersion:st(l.template_version)}:i==="darwin:dashboard:refresh-request"?{type:i,documentId:k}:null},vi=`<!doctype html>
27<html lang="en">
28<head>
29<meta charset="utf-8">
30<meta name="viewport" content="width=device-width, initial-scale=1">
31<meta http-equiv="Content-Security-Policy"
32      content="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; connect-src 'none'; base-uri 'none'; form-action 'none'">
33<title>Darwin Data Tracker</title>
34<!--
35  ============================================================================
36  Darwin Dashboard Template — "datasource-tracker" v0.1.3 (DRAFT for PO)
37  ============================================================================
38
39  WHAT THIS IS
40  An operational status dashboard: datasource ingestion freshness, statuses,
41  pending actions grouped by target timeslice, and contacts. Self-contained
42  (no external scripts/fonts/network), renders inside a sandboxed <iframe>
43  in the Darwin chat app and standalone when exported.
44
45  The CSP above travels with every exported copy — an exported file has no
46  sandbox, so it is a second security surface. \`sandbox\` does NOT block
47  network egress; this CSP does.
48
49  THE CONTRACT — identical envelope and protocol to kpi-overview:
50    #darwin-dashboard-config  — the frozen envelope + this template's config
51                                (thin: title, engagement, and the natural-
52                                language data_request the orchestrator
53                                replays on refresh).
54    #darwin-dashboard-data    — everything shown; replaced on every refresh.
55  All markup/styles/script are template-owned, never AI-edited. Every
56  data-derived string is inserted with textContent (never innerHTML), and
57  every class name comes from the fixed STATUS/URGENCY maps below — never
58  from data.
59
60  ISLAND ESCAPING (host responsibility): whoever serializes JSON into these
61  islands MUST emit the JSON unicode escapes \\u003c, \\u003e and \\u0026 for the characters
62  < > & (and \\u2028 / \\u2029 for U+2028 / U+2029), or a "<\/script>" inside any
63  AI-written string closes the island early and the remainder becomes live
64  markup. HTML entities are not a substitute: the island is read by
65  JSON.parse, which would hand back the entity text itself.
66
67  ENVELOPE (config island) — frozen across all Darwin dashboard templates:
68    schema_version, artifact_type, template_id, template_version, config
69    document_id, protocol_version  — host-injected at composition time.
70
71  HOST (IFRAME) PROTOCOL — identical to kpi-overview:
72    template -> host : darwin:dashboard:ready            {protocol_version, document_id, template_id, template_version}
73    template -> host : darwin:dashboard:refresh-request  {protocol_version, document_id}   (NO config — the stored row is the source of truth)
74    host -> template : darwin:dashboard:data             {protocol_version, document_id, data}
75    host -> template : darwin:dashboard:error            {protocol_version, document_id, message}
76    host -> template : darwin:dashboard:theme            {protocol_version, document_id, mode, tokens, logo_data_uri}
77  A sandboxed srcdoc iframe has an OPAQUE origin, so the host must post with
78  targetOrigin '*'; binding comes from the iframe element reference plus this
79  template's e.source / document_id / protocol_version checks.
80
81  BRANDING: the client brand accent arrives as the --brand-accent token and
82  dresses chrome only (the header band). --brand-accent-ink is the host's
83  computed white-or-ink foreground for that band. logo_data_uri is a sibling
84  FIELD, not a token (a data URI cannot pass the color-only token validator,
85  and no custom property can feed an <img src>); it is assigned only to
86  img.src, never innerHTML and never inline <svg>.
87
88  DATA SCHEMA (#darwin-dashboard-data)
89    as_of              ISO-8601 UTC timestamp of the status query
90    summary.period_label    display string, e.g. "Week of Jul 7, 2026"
91    summary.next_timeslice  display string, e.g. "Mar 2026"
92    summary.meta[]          [{label, value, ok?}]  header chips (display strings)
93    summary.extras[]        [{label, value, sub?}] extra glance tiles
94    summary.warnings[]      [{text}] banner callouts
95    actions[]          [{label, note?, urgency:'critical'|'upcoming'|'info',
96                         items:[{datasource, db_through:'YYYY-MM-DD',
97                                 owner:{label, tbd?}, needed}]}]
98    datasources[]      [{name, status:'current'|'needs_action'|
99                         'expected_lag'|'inactive', db_through,
100                         owner:{label, tbd?}, note?}]
101    contacts[]         [{name, org, owns:[string], tbd?}]
102
103  STATUS COUNTS ARE DERIVED, NEVER STORED. The glance tiles, the status bar
104  and the legend all reduce datasources[] by status, so there is exactly one
105  source of truth for every count and no two figures on the page can
106  disagree. (Storing them alongside the rows they summarize is the same
107  defect class as two different share denominators.)
108
109  Statuses are a fixed four-state taxonomy mapped to the app's status palette
110  and always rendered as glyph + label, never colour alone.
111
112  Sample data below is illustrative (from a State Farm tracker example).
113  ============================================================================
114-->
115<style>
116  /* Darwin (mevo) theme tokens. --brand-accent defaults to the app accent;
117     the host overrides it per engagement, with --brand-accent-ink as the
118     matching foreground for the band. */
119  :root {
120    color-scheme: light;
121    --page: #f8f9fa;
122    --surface: #ffffff;
123    --surface-2: #f8f9fa;
124    --ink: #2a2736;
125    --ink-2: #5a566a;
126    --muted: #95939f;
127    --grid: #e5e7eb;
128    --border: rgba(104, 97, 135, 0.20);
129    --brand-accent: #8533ff;
130    --brand-accent-ink: #ffffff;
131    --good: #17b26a;    --good-text: #107569;   --good-bg: #ccfbef;
132    --warn: #f79009;    --warn-text: #b54708;   --warn-bg: #fef0c7;
133    --info: #31a3bd;    --info-text: #267189;   --info-bg: #ddeff1;
134    --neutral: #95939f; --neutral-text: #5a566a; --neutral-bg: #f3f4f6;
135    --crit: #f04438;
136  }
137  @media (prefers-color-scheme: dark) {
138    :root:not([data-theme="light"]) {
139      color-scheme: dark;
140      --page: #1e0a3b;
141      --surface: #2a2736;
142      --surface-2: #343046;
143      --ink: #f8f3ff;
144      --ink-2: #c3c1cc;
145      --muted: #95939f;
146      --grid: #343046;
147      --border: rgba(107, 41, 206, 0.20);
148      --brand-accent: #9d5cff;
149      --brand-accent-ink: #1e0a3b;
150      --good: #17b26a;    --good-text: #17b26a;   --good-bg: rgba(23, 178, 106, 0.16);
151      --warn: #f79009;    --warn-text: #f79009;   --warn-bg: rgba(247, 144, 9, 0.16);
152      --info: #31a3bd;    --info-text: #31a3bd;
152   --info-bg: rgba(49, 163, 189, 0.16);
153      --neutral: #95939f; --neutral-text: #95939f; --neutral-bg: rgba(149, 147, 159, 0.16);
154      --crit: #f04438;
155    }
156  }
157  :root[data-theme="dark"] {
158    color-scheme: dark;
159    --page: #1e0a3b;
160    --surface: #2a2736;
161    --surface-2: #343046;
162    --ink: #f8f3ff;
163    --ink-2: #c3c1cc;
164    --muted: #95939f;
165    --grid: #343046;
166    --border: rgba(107, 41, 206, 0.20);
167    --brand-accent: #9d5cff;
168    --brand-accent-ink: #1e0a3b;
169    --good: #17b26a;    --good-text: #17b26a;   --good-bg: rgba(23, 178, 106, 0.16);
170    --warn: #f79009;    --warn-text: #f79009;   --warn-bg: rgba(247, 144, 9, 0.16);
171    --info: #31a3bd;    --info-text: #31a3bd;   --info-bg: rgba(49, 163, 189, 0.16);
172    --neutral: #95939f; --neutral-text: #95939f; --neutral-bg: rgba(149, 147, 159, 0.16);
173    --crit: #f04438;
174  }
175
176  * { box-sizing: border-box; }
177  html, body { margin: 0; }
178  body {
179    background: var(--page);
180    color: var(--ink);
181    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
182  }
183  .wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
184
185  /* ---------- header band: the client-brand chrome ---------- */
186  .head {
187    display: flex; align-items: center;
188    background: var(--brand-accent);       /* canonical hex — never adjusted */
189    color: var(--brand-accent-ink);        /* best ink for the painted band */
190    border-radius: 12px;
191    padding: 14px 18px;
192  }
193  /* Small chrome sits BELOW the band on the normal surface, so it is never
194     measured against a brand colour and needs no opacity tricks. */
195  .subhead {
196    display: flex; flex-wrap: wrap; gap: 10px 16px;
197    align-items: flex-start; justify-content: space-between;
198    margin-top: 12px;
199  }
200  .title-row { display: flex; align-items: center; gap: 12px; }
201  #brand-logo { display: none; max-height: 28px; max-width: 130px; width: auto; }
202  #brand-logo.show { display: block; }
203  .head h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.01em; color: inherit; }  /* 700 + 20px = WCAG large -> 3:1 floor */
204  .chips { display: flex; flex-wrap: wrap; gap: 6px; }
205  .chip {
206    display: inline-flex; align-items: center; gap: 5px;
207    border: 1px solid var(--border); border-radius: 999px;
208    padding: 2px 10px; font-size: 12px;
209    color: var(--ink-2); background: var(--surface);
210  }
211  .chip .k { color: var(--muted); }
212  .refresh-box { text-align: right; }
213  .as-of { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
214  button.refresh {
215    font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
216    color: var(--ink); background: var(--surface);
217    border: 1px solid var(--border);
218    border-radius: 8px; padding: 8px 14px; cursor: pointer;
219  }
220  button.refresh:hover { border-color: var(--muted); }
221  button.refresh:disabled { opacity: 0.55; cursor: default; }
222  .refresh-note { font-size: 12px; color: var(--muted); margin-top: 6px; max-width: 260px; display: none; }
223  .refresh-note.show { display: block; }
224
225  /* ---------- cards ---------- */
226  .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-top: 16px; }
227  .card h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
228  .content { transition: opacity 0.2s ease; }
229  .refreshing .content { opacity: 0.55; }
230
231  /* ---------- glance ---------- */
232  .glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
233  .glance-box { background: var(--surface-2); border: 1px solid var(--grid); border-radius: 10px; padding: 12px 14px; text-align: center; }
234  .glance-val { font-size: 24px; font-weight: 600; line-height: 1.2; }
235  .glance-lbl { font-size: 11px; color: var(--ink-2); margin-top: 3px; }
236  .glance-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
237  .v-good { color: var(--good-text); }
238  .v-warn { color: var(--warn-text); }
239  .v-info { color: var(--info-text); }
240  .v-neutral { color: var(--neutral-text); }
241
242  /* ---------- status bar ---------- */
243  .sbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 14px; gap: 2px; background: var(--surface); }
244  .sbar > div { min-width: 4px; }
245  .sb-good { background: var(--good); }
246  .sb-warn { background: var(--warn); }
247  .sb-info { background: var(--info); }
248  .sb-neutral { background: var(--neutral); }
249  .sbar-legend { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
250  .sbl-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
251  .sbl-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
252  .sbl-item strong { color: var(--ink); font-weight: 600; }
253
254  /* ---------- warnings ---------- */
255  .warn-banner {
256    background: var(--warn-bg); border-left: 3px solid var(--warn);
257    padding: 8px 14px; font-size: 12.5px; color: var(--ink);
258    margin-top: 14px; border-radius: 0 6px 6px 0;
259  }
260  .warn-banner .glyph { font-weight: 700; color: var(--warn-text); margin-right: 6px; }
261
262  /* ---------- action groups ---------- */
263  .ts-hdr {
264    display: flex; align-items: baseline; gap: 8px;
265    font-size: 13px; font-weight: 600; color: var(--ink);
266    padding: 6px 0 6px 10px; margin: 16px 0 4px; border-left: 3px solid var(--neutral);
267  }
268  .ts-hdr:first-of-type { margin-top: 0; }
269  .ts-hdr.u-crit { border-left-color: var(--crit); }
270  .ts-hdr.u-warn { border-left-color: var(--warn); }
271  .ts-hdr.u-info { border-left-color: var(--info); }
272  .ts-hdr .note { font-size: 12px; font-weight: 400; color: var(--muted); }
273  .empty { font-size: 13px; color: var(--muted); }
274
275  /* ---------- tables ---------- */
276  .tbl-scroll { overflow-x: auto; }
277  table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
278  th {
279    background: var(--surface-2); color: var(--muted);
280    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
281    text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap;
282  }
283  td { padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; color: var(--ink-2); }
284  tbody tr:last-child td { border-bottom: none; }
285  td.ds { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
286  td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
287  tr.grp td {
288    background: var(--surface-2); color: var(--ink-2);
289    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px;
290    padding: 5px 10px;
291  }
292  tr.grp .glyph { margin-right: 5px; }
293  .g-good { color: var(--good-text); }
294  .g-warn { color: var(--warn-text); }
295  .g-info { color: var(--info-text); }
296  .g-neutral { color: var(--neutral-text); }
297
298  /* ---------- badges (glyph + label, never colour alone) ---------- */
299  .b { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
300  .b-good { background: var(--good-bg); color: var(--good-text); }
301  .b-warn { background: var(--warn-bg); color: var(--warn-text); }
302  .b-info { background: var(--info-bg); color: var(--info-text); }
303  .b-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
304
305  /* ---------- owner tag ---------- */
306  .owner { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: var(--ink-2); }
307  .owner .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
308  .owner.tbd { color: var(--warn-text); font-style: italic; font-weight: 600; }
309
310  .foot { margin-top: 18px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
311
312  /* fatal error state — never a blank iframe */
313  .fatal { max-width: 560px; margin: 48px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; }
314  .fatal h2 { margin: 0 0 8px; font-size: 16px; }
315  .fatal p { margin: 0; color: var(--ink-2); font-size: 13px; }
316  .fatal code { font-size: 12px; color: var(--muted); }
317
318  @media (max-width: 560px) { .subhead { flex-direction: column; } .refresh-box { text-align: left; } }
319</style>
320</head>
321<body>
322
323<!-- ======= BEGIN DARWIN:CONFIG (envelope + config; AI writes config only) ======= -->
324<script type="application/json" id="darwin-dashboard-config">
325{
326  "schema_version": 1,
327  "protocol_version": 1,
328  "artifact_type": "dashboard",
329  "template_id": "datasource-tracker",
330  "template_version": "0.1.3",
331  "document_id": null,
332  "config": {
333    "title": "Data Tracker",
334    "engagement": { "nice_id": "statefarm", "label": "State Farm" },
335    "data_request": "Current ingestion status for all datasources in the current engagement: DB-through dates, S3 files arrived but not yet ingested, owners and organizations, expected-lag classifications, contacts, and pending actions grouped by target timeslice."
336  }
337}
338<\/script>
339<!-- ======= END DARWIN:CONFIG ======= -->
340
341<!-- ======= BEGIN DARWIN:DATA (replaced on every refresh) ======= -->
342<script type="application/json" id="darwin-dashboard-data">
343{
344  "schema_version": 1,
345  "as_of": "2026-07-07T13:00:00Z",
346  "summary": {
347    "period_label": "Week of Jul 7, 2026",
348    "next_timeslice": "Mar 2026",
349    "meta": [ { "label": "MLS last run", "value": "Feb 2026", "ok": true } ],
350    "extras": [
351      { "label": "KPIs tracked", "value": "8+", "sub": "Binds · Quotes · Digital · Survey + variants" }
352    ],
353    "warnings": [
354      { "text": "Butler-Till contact is [TBD] — please confirm the BT contact name so ownership can be assigned." }
355    ]
356  },
357  "actions": [
358    {
359      "label": "March 2026",
360      "note": "Next target timeslice",
361      "urgency": "critical",
362      "items": [
363        { "datasource": "agg_sa360_search", "db_through": "2026-02-28", "owner": { "label": "TechOps" }, "needed": "S3 file arrived May 14 — ingestion not triggered. Priority: longest wait." },
364        { "datasource": "agg_statefarm_ilp", "db_through": "2026-03-01", "owner": { "label": "TechOps" }, "needed": "S3 file arrived May 5 — ingestion not triggered." },
365        { "datasource": "agg_statefarm_quoteagg", "db_through": "2026-02-28", "owner": { "label": "State Farm" }, "needed": "File was ingested — it just doesn't cover beyond Feb. Need a new file from SF." },
366        { "datasource": "agg_tradedesk_agg", "db_through": "2026-02-27", "owner": { "label": "Butler-Till", "tbd": true }, "needed": "No update since Mar 11. Confirm with BT whether this is an expected silence window." },
367        { "datasource": "agg_butlertill_amazon", "db_through": "2026-01-31", "owner": { "label": "Butler-Till", "tbd": true }, "needed": "Same situation as TTD — confirm expected or escalate." }
368      ]
369    },
370    {
371      "label": "April 2026",
372      "note": "Coming up",
373      "urgency": "upcoming",
374      "items": [
375        { "datasource": "agg_agent_search", "db_through": "2026-04-30", "owner": { "label": "TechOps" }, "needed": "S3 file arrived Jun 25 — trigger ingestion for May/Jun data." },
376        { "datasource": "agg_omd_online", "db_through": "2026-05-31", "owner": { "label": "TechOps" }, "needed": "S3 file arrived Jul 1 — preview to confirm Jun data, then ingest." }
377      ]
378    }
379  ],
380  "datasources": [
381    { "name": "agg_facebook_bt", "status": "current", "db_through": "2026-07-04", "owner": { "label": "Butler-Till", "tbd": true }, "note": "API-fed, auto-ingested" },
382    { "name": "agg_dv360_bt", "status": "current", "db_through": "2026-07-04", "owner": { "label": "Butler-Till", "tbd": true }, "note": "API-fed, auto-ingested" },
383    { "name": "agg_butlertill_search", "status": "current", "db_through": "2026-06-30", "owner": { "label": "Butler-Till", "tbd": true }, "note": "" },
384    { "name": "agg_omd_onlinewk", "status": "current", "db_through": "2026-06-21", "owner": { "label": "OMD" }, "note": "Weekly variant of OMD Online" },
385    { "name": "agg_agent_search", "status": "needs_action", "db_through": "2026-04-30", "owner": { "label": "TechOps" }, "note": "S3 file on hand (Jun 25) — ingest" },
386    { "name": "agg_omd_online", "status": "needs_action", "db_through": "2026-05-31", "owner": { "label": "TechOps" }, "note": "S3 file on hand (Jul 1) — verify & ingest" },
387    { "name": "agg_sa360_search", "status": "needs_action", "db_through": "2026-02-28", "owner": { "label": "TechOps" }, "note": "S3 file on hand (May 14) — ingest, longest lag" },
388    { "name": "agg_statefarm_quoteagg", "status": "needs_action", "db_through": "2026-02-28", "owner": { "label": "State Farm" }, "note": "Awaiting new file from SF — existing file only covers thru Feb" },
389    { "name": "agg_statefarm_ilp", "status": "needs_action", "db_through": "2026-03-01", "owner": { "label": "TechOps" }, "note": "S3 file on hand (May 5) — ingest" },
390    { "name": "agg_tradedesk_agg", "status": "needs_action", "db_through": "2026-02-27", "owner": { "label": "Butler-Till", "tbd": true }, "note": "No update since Mar 11 — confirm silence or escalate" },
391    { "name": "agg_butlertill_amazon", "status": "needs_action", "db_through": "2026-01-31", "owner": { "label": "Butler-Till", "tbd": true }, "note": "No update since Mar 11 — confirm silence or escalate" },
392    { "name": "agg_omd_tv", "status": "expected_lag", "db_through": "2026-03-31", "owner": { "label": "OMD" }, "note": "TV follows broadcast calendar — file received and processed" },
393    { "name": "agg_omd_radio", "status": "expected_lag", "db_through": "2026-04-30", "owner": { "label": "OMD" }, "note": "Radio spans multiple months — file received and processed" },
394    { "name": "log_statefarm_directmail2", "status": "inactive", "db_through": "2026-06-12", "owner": { "label": "State Farm" }, "note": "Date offset applied (+45 days). Low-frequency delivery." },
395    { "name": "log_statefarm_email2", "status": "inactive", "db_through": "2026-04-30", "owner": { "label": "State Farm" }, "note": "Low-frequency delivery, no current action expected." }
396  ],
397  "contacts": [
398    { "name": "John L", "org": "ME TechOps", "owns": ["agg_omd_online", "agg_sa360_search", "pipeline verification"] },
399    { "name": "David L", "org": "ME TechOps", "owns": ["agg_agent_search", "agg_statefarm_ilp", "agg_statefarm_seo"] },
400    { "name": "Andrea R", "org": "State Farm", "owns": ["agg_statefarm_quoteagg", "log_statefarm_directmail2", "log_statefarm_email2"] },
401    { "name": "Christiana E", "org": "OMD", "owns": ["agg_omd_online", "agg_omd_onlinewk", "agg_omd_tv", "agg_omd_radio", "agg_sa360_search"] },
402    { "name": "[TBD]", "org": "Butler-Till", "owns": ["agg_facebook_bt", "agg_dv360_bt", "agg_butlertill_search", "agg_tradedesk_agg", "agg_butlertill_amazon"], "tbd": true }
403  ]
404}
405<\/script>
406<!-- ======= END DARWIN:DATA ======= -->
407
408<main class="wrap" id="app" aria-busy="false">
409  <!-- The brand band carries ONLY the logo and the title. Both are WCAG-large,
410       so the canonical brand hex always clears the 3:1 floor and never needs
411       adjusting. Anything smaller lives in .subhead below, on the normal
412       surface with ordinary ink tokens. See v0.1.3 notes above. -->
413  <header class="head">
414    <div class="title-row">
415      <img id="brand-logo" alt="">
416      <h1 id="dash-title">Data Tracker</h1>
417    </div>
418  </header>
419
420  <div class="subhead">
421    <div class="chips" id="chips"></div>
422    <div class="refresh-box">
423      <div class="as-of" id="as-of" aria-live="polite"></div>
424      <button class="refresh" id="refresh-btn" type="button">Refresh data</button>
425      <div class="refresh-note" id="refresh-note" role="status"></div>
426    </div>
427  </div>
428
429  <div class="content">
430    <section class="card">
431      <h2>At a glance</h2>
432      <div class="glance" id="glance"></div>
433      <div class="sbar" id="sbar" aria-hidden="true"></div>
434      <div class="sbar-legend" id="sbar-legend"></div>
435      <div id="warnings"></div>
436    </section>
437
438    <section class="card">
439      <h2>Actions needed</h2>
440      <div id="actions"></div>
441    </section>
442
443    <section class="card">
444      <h2>All datasources</h2>
445      <div class="tbl-scroll">
446        <table id="ds-table">
447          <thead>
448            <tr><th>Datasource</th><th>Status</th><th>DB Through</th><th>Owner</th><th>Notes</th></tr>
449          </thead>
450          <tbody></tbody>
451   
451     </table>
452      </div>
453    </section>
454
455    <section class="card">
456      <h2>Contacts</h2>
457      <div class="tbl-scroll">
458        <table id="ct-table">
459          <thead><tr><th>Name</th><th>Organization</th><th>Owns</th></tr></thead>
460          <tbody></tbody>
461        </table>
462      </div>
463    </section>
464  </div>
465
466  <footer class="foot">
467    <span id="foot-template"></span>
468    <span>Generated by Darwin &middot; Data refreshes on request</span>
469  </footer>
470</main>
471
472<script>
473(function () {
474  'use strict';
475
476  var PROTOCOL_VERSION = 1;
477  var TEMPLATE_ID = 'datasource-tracker';
478  var PENDING_BACKSTOP_MS = 300000;   /* host owns pending state; this is only a backstop */
479
480  /* Fixed taxonomies. Class names and labels come from here, never from data,
481     so a hostile status value can neither inject a class nor invent a state. */
482  var STATUS = {
483    current:      { cls: 'good',    glyph: '✓', label: 'Current' },
484    needs_action: { cls: 'warn',    glyph: '⚠', label: 'Needs Action' },
485    expected_lag: { cls: 'info',    glyph: '◷', label: 'Expected Lag' },
486    inactive:     { cls: 'neutral', glyph: '○', label: 'Inactive' }
487  };
488  var STATUS_ORDER = ['current', 'needs_action', 'expected_lag', 'inactive'];
489  var URGENCY = { critical: 'crit', upcoming: 'warn', info: 'info' };
490
491  function readIsland(id) {
492    var node = document.getElementById(id);
493    if (!node) return null;
494    try { return JSON.parse(node.textContent); } catch (e) { return null; }
495  }
496
497  function showFatal(detail) {
498    var app = document.getElementById('app');
499    app.textContent = '';
500    app.className = 'fatal';
501    var h = document.createElement('h2');
502    h.textContent = 'This dashboard can’t be displayed';
503    var p = document.createElement('p');
504    p.textContent = 'Its saved configuration or data is incomplete. Ask Darwin in chat to rebuild or refresh it.';
505    var c = document.createElement('p');
506    var code = document.createElement('code');
507    code.textContent = detail;
508    c.appendChild(code);
509    app.appendChild(h); app.appendChild(p); app.appendChild(c);
510  }
511
512  /* ---------- validation (fail closed; renderers may assume shape after this) */
513  function validateEnvelope(env) {
514    if (!env || typeof env !== 'object') return 'config island missing or unparseable';
515    if (env.template_id !== TEMPLATE_ID) return 'template_id is not "' + TEMPLATE_ID + '"';
516    if (!env.config || typeof env.config !== 'object') return 'config missing';
517    return null;
518  }
519  function validateData(d) {
520    if (!d || typeof d !== 'object') return 'data island missing or unparseable';
521    if (!d.summary || typeof d.summary !== 'object') return 'data.summary missing';
522    if (!Array.isArray(d.datasources)) return 'data.datasources is not an array';
523    if (d.actions !== undefined && !Array.isArray(d.actions)) return 'data.actions is not an array';
524    if (d.contacts !== undefined && !Array.isArray(d.contacts)) return 'data.contacts is not an array';
525    return null;
526  }
527
528  /* Normalize every optional/loose branch once, so no renderer has to guess.
529     Unknown status values are dropped rather than rendered as a fifth state. */
530  function arr(v) { return Array.isArray(v) ? v : []; }
531  function str(v) { return v == null ? '' : String(v); }
532  function owner(o) {
533    o = (o && typeof o === 'object') ? o : {};
534    return { label: str(o.label) || 'Unknown', tbd: !!o.tbd };
535  }
536  function sanitizeData(d) {
537    var s = d.summary || {};
538    return {
539      as_of: str(d.as_of),
540      summary: {
541        period_label: str(s.period_label),
542        next_timeslice: str(s.next_timeslice),
543        meta: arr(s.meta).filter(isObj).map(function (m) {
544          return { label: str(m.label), value: str(m.value), ok: !!m.ok };
545        }),
546        extras: arr(s.extras).filter(isObj).map(function (x) {
547          return { label: str(x.label), value: str(x.value), sub: str(x.sub) };
548        }),
549        warnings: arr(s.warnings).filter(isObj).map(function (w) { return { text: str(w.text) }; })
550      },
551      actions: arr(d.actions).filter(isObj).map(function (g) {
552        return {
553          label: str(g.label),
554          note: str(g.note),
555          urgency: URGENCY[g.urgency] ? g.urgency : 'info',
556          items: arr(g.items).filter(isObj).map(function (it) {
557            return {
558              datasource: str(it.datasource),
559              db_through: str(it.db_through),
560              owner: owner(it.owner),
561              needed: str(it.needed)
562            };
563          })
564        };
565      }),
566      datasources: arr(d.datasources).filter(isObj).map(function (r) {
567        return {
568          name: str(r.name),
569          status: STATUS[r.status] ? r.status : null,
570          db_through: str(r.db_through),
571          owner: owner(r.owner),
572          note: str(r.note)
573        };
574      }).filter(function (r) { return r.status !== null; }),
575      contacts: arr(d.contacts).filter(isObj).map(function (c) {
576        return { name: str(c.name), org: str(c.org), owns: arr(c.owns).map(str), tbd: !!c.tbd };
577      })
578    };
579  }
580  function isObj(v) { return v && typeof v === 'object'; }
581
582  var env = readIsland('darwin-dashboard-config');
583  var envError = validateEnvelope(env);
584  if (envError) { showFatal(envError); return; }
585  var cfg = env.config;
586
587  var rawData = readIsland('darwin-dashboard-data');
588  var dataError = validateData(rawData);
589  if (dataError) { showFatal(dataError); return; }
590  var data = sanitizeData(rawData);
591
592  /* ---------- counts are DERIVED, never read from the payload ---------- */
593  function statusCounts() {
594    var counts = {};
595    STATUS_ORDER.forEach(function (id) { counts[id] = 0; });
596    data.datasources.forEach(function (r) { counts[r.status]++; });
597    return counts;
598  }
599
600  /* ---------- owner identity dots (app chartSet, by first appearance) ------
601     Not reset between renders, so an org keeps its colour across refreshes. */
602  var ORG_COLORS = ['#558CE4', '#1BAA7A', '#8A1B9A', '#E17E41', '#6366F1', '#1D9AAA', '#C84992'];
603  var orgColorMap = {};
604  var orgColorNext = 0;
605  function orgColor(label) {
606    if (!(label in orgColorMap)) {
607      orgColorMap[label] = ORG_COLORS[orgColorNext % ORG_COLORS.length];
608      orgColorNext++;
609    }
610    return orgColorMap[label];
611  }
612
613  function el(tag, cls, text) {
614    var n = document.createElement(tag);
615    if (cls) n.className = cls;
616    if (text !== undefined) n.textContent = text;
617    return n;
618  }
619  var MONTHS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
620  function fmtDay(s) {
621    if (!s) return '—';
622    var p = String(s).split('-');
623    if (p.length !== 3 || isNaN(+p[1])) return String(s);
624    return MONTHS[+p[1] - 1] + ' ' + (+p[2]) + ', ' + p[0];
625  }
626  function fmtAsOf(iso) {
627    var d = new Date(iso);
628    if (isNaN(d)) return '';
629    return new Intl.DateTimeFormat('en-US', {
630      month: 'short', day: 'numeric', year: 'numeric',
631      hour: 'numeric', minute: '2-digit', timeZone: 'UTC'
632    }).format(d) + ' UTC';
633  }
634  function ownerTag(o) {
635    var span = el('span', 'owner' + (o.tbd ? ' tbd' : ''));
636    var dot = el('span', 'dot');
637    dot.style.background = o.tbd ? 'var(--warn)' : orgColor(o.label);
638    span.appendChild(dot);
639    span.appendChild(document.createTextNode(o.label + (o.tbd ? ' [TBD]' : '')));
640    return span;
641  }
642  function statusBadge(id) {
643    var s = STATUS[id];
644    var b = el('span', 'b b-' + s.cls);
645    b.appendChild(el('span', null, s.glyph));
646    b.appendChild(el('span', null, s.label));
647    return b;
648  }
649
650  /* ---------- header ---------- */
651  function renderHeader() {
652    var engagement = cfg.engagement && cfg.engagement.label;
653    var fullTitle = engagement ? engagement + ' · ' + (cfg.title || 'Data Tracker') : (cfg.title || 'Data Tracker');
654    document.title = fullTitle;
655    document.getElementById('dash-title').textContent = fullTitle;
656
657    var chips = document.getElementById('chips');
658    chips.textContent = '';
659    var s = data.summary;
660    if (s.period_label) chips.appendChild(el('span', 'chip', s.period_label));
661    if (s.next_timeslice) {
662      var c = el('span', 'chip');
663      c.appendChild(el('span', 'k', 'Next timeslice'));
664      c.appendChild(el('span', null, s.next_timeslice));
665      chips.appendChild(c);
666    }
667    s.meta.forEach(function (m) {
668      var c = el('span', 'chip');
669      c.appendChild(el('span', 'k', m.label));
670      c.appendChild(el('span', null, m.value + (m.ok ? ' ✓' : '')));
671      chips.appendChild(c);
672    });
673    document.getElementById('as-of').textContent = 'Data as of ' + fmtAsOf(data.as_of);
674    document.getElementById('foot-template').textContent =
675      'Template ' + env.template_id + ' v' + env.template_version;
676  }
677
678  /* ---------- glance + status bar + warnings (all from derived counts) ---- */
679  function renderGlance() {
680    var counts = statusCounts();
681    var glance = document.getElementById('glance');
682    glance.textContent = '';
683    STATUS_ORDER.forEach(function (id) {
684      var meta = STATUS[id];
685      var box = el('div', 'glance-box');
686      box.appendChild(el('div', 'glance-val v-' + meta.cls, String(counts[id])));
687      box.appendChild(el('div', 'glance-lbl', meta.glyph + ' ' + meta.label));
688      glance.appendChild(box);
689    });
690    data.summary.extras.forEach(function (x) {
691      var box = el('div', 'glance-box');
692      box.appendChild(el('div', 'glance-val', x.value));
693      box.appendChild(el('div', 'glance-lbl', x.label));
694      if (x.sub) box.appendChild(el('div', 'glance-sub', x.sub));
695      glance.appendChild(box);
696    });
697
698    var total = data.datasources.length;
699    var bar = document.getElementById('sbar');
700    var legend = document.getElementById('sbar-legend');
701    bar.textContent = '';
702    legend.textContent = '';
703    STATUS_ORDER.forEach(function (id) {
704      var meta = STATUS[id];
705      if (total > 0 && counts[id] > 0) {
706        var seg = el('div', 'sb-' + meta.cls);
707        seg.style.width = (counts[id] / total) * 100 + '%';
708        bar.appendChild(seg);
709      }
710      var item = el('div', 'sbl-item');
711      var dot = el('span', 'sbl-dot');
712      dot.style.background = 'var(--' + meta.cls + ')';
713      item.appendChild(dot);
714      var txt = el('span');
715      txt.appendChild(el('strong', null, String(counts[id])));
716      txt.appendChild(document.createTextNode(' ' + meta.label));
717      item.appendChild(txt);
718      legend.appendChild(item);
719    });
720
721    var warnings = document.getElementById('warnings');
722    warnings.textContent = '';
723    data.summary.warnings.forEach(function (w) {
724      var b = el('div', 'warn-banner');
725      b.appendChild(el('span', 'glyph', '⚠'));
726      b.appendChild(document.createTextNode(w.text));
727      warnings.appendChild(b);
728    });
729  }
730
731  /* ---------- actions ---------- */
732  function actionTable(items) {
733    var scroll = el('div', 'tbl-scroll');
734    var table = el('table');
735    var thead = el('thead');
736    var hr = el('tr');
737    ['Datasource', 'DB Through', 'Owner', "What's needed"].forEach(function (h) {
738      hr.appendChild(el('th', null, h));
739    });
740    thead.appendChild(hr);
741    table.appendChild(thead);
742    var tbody = el('tbody');
743    items.forEach(function (it) {
744      var tr = el('tr');
745      tr.appendChild(el('td', 'ds', it.datasource));
746      tr.appendChild(el('td', 'date', fmtDay(it.db_through)));
747      var to = el('td');
748      to.appendChild(ownerTag(it.owner));
749      tr.appendChild(to);
750      tr.appendChild(el('td', null, it.needed));
751      tbody.appendChild(tr);
752    });
753    table.appendChild(tbody);
754    scroll.appendChild(table);
755    return scroll;
756  }
757  function renderActions() {
758    var host = document.getElementById('actions');
759    host.textContent = '';
760    var groups = data.actions.filter(function (g) { return g.items.length; });
761    if (!groups.length) {
762      host.appendChild(el('div', 'empty', 'No pending actions — everything is current.'));
763      return;
764    }
765    groups.forEach(function (g) {
766      var hdr = el('div', 'ts-hdr u-' + URGENCY[g.urgency]);
767      hdr.appendChild(el('span', null, g.label));
768      if (g.note) hdr.appendChild(el('span', 'note', '— ' + g.note));
769      host.appendChild(hdr);
770      host.appendChild(actionTable(g.items));
771    });
772  }
773
774  /* ---------- all datasources ---------- */
775  function renderDatasources() {
776    var tbody = document.querySelector('#ds-table tbody');
777    tbody.textContent = '';
778    STATUS_ORDER.forEach(function (statusId) {
779      var group = data.datasources.filter(function (r) { return r.status === statusId; });
780      if (!group.length) return;
781      var meta = STATUS[statusId];          /* label from the fixed taxonomy */
782      var grp = el('tr', 'grp');
783      var td = el('td');
784      td.colSpan = 5;
785      td.appendChild(el('span', 'glyph g-' + meta.cls, meta.glyph));
786      td.appendChild(document.createTextNode(meta.label));
787      grp.appendChild(td);
788      tbody.appendChild(grp);
789      group.forEach(function (r) {
790        var tr = el('tr');
791        tr.appendChild(el('td', 'ds', r.name));
792        var ts = el('td');
793        ts.appendChild(statusBadge(statusId));
794        tr.appendChild(ts);
795        tr.appendChild(el('td', 'date', fmtDay(r.db_through)));
796        var to = el('td');
797        to.appendChild(ownerTag(r.owner));
798        tr.appendChild(to);
799        tr.appendChild(el('td', null, r.note));
800        tbody.appendChild(tr);
801      });
802    });
803  }
804
805  /* ---------- contacts ---------- */
806  function renderContacts() {
807    var tbody = document.querySelector('#ct-table tbody');
808    tbody.textContent = '';
809    data.contacts.forEach(function (c) {
810      var tr = el('tr');
811      var tn = el('td');
812      var strong = el('strong', null, c.name + (c.tbd ? ' ⚠' : ''));
813      strong.style.color = c.tbd ? 'var(--warn-text)' : 'var(--ink)';
814      tn.appendChild(strong);
815      tr.appendChild(tn);
816      var to = el('td');
817      to.appendChild(ownerTag({ label: c.org || 'Unknown', tbd: c.tbd }));
818      tr.appendChild(to);
819      tr.appendChild(el('td', null, c.owns.join(' · ')));
820      tbody.appendChild(tr);
821    });
822  }
823
824  /* ---------- theme + logo ---------- */
825  var ALLOWED_TOKENS = {
826    '--page': 1, '--surface': 1, '--surface-2': 1, '--ink': 1, '--ink-2': 1,
827    '--muted': 1, '--grid': 1, '--border': 1, '--brand-accent': 1, '--brand-accent-ink': 1,
828    '--good': 1, '--good-text': 1, '--good-bg': 1, '--warn': 1, '--warn-text': 1, '--warn-bg': 1,
829    '--info': 1, '--info-text': 1, '--info-bg': 1, '--neutral': 1, '--neutral-text': 1,
830    '--neutral-bg': 1, '--crit': 1
831  };
832  var COLOR_RE = /^(#[0-9a-fA-F]{3,8}|rgba?\\([\\d\\s.,%\\/]+\\)|hsla?\\([\\d\\s.,%\\/a-z]+\\))$/;
833  var LOGO_RE = /^data:image\\/(png|jpeg|jpg|svg\\+xml);base64,[A-Za-z0-9+\\/=\\s]+$/;
834  var LOGO_MAX_CHARS = 200000;
835
836  function applyTheme(m) {
837    if (m.mode === 'light' || m.mode === 'dark') {
838      document.documentElement.setAttribute('data-theme', m.mode);
839    }
840    if (m.tokens && typeof m.tokens === 'object') {
841      for (var k in m.tokens) {
842        var v = m.tokens[k];
843        if (ALLOWED_TOKENS[k] === 1 && typeof v === 'string' && COLOR_RE.test(v.trim())) {
844          document.documentElement.style.setProperty(k, v.trim());
845        }
846      }
847    }
848    if ('logo_data_uri' in m) applyLogo(m.logo_data_uri);
849  }
850  function applyLogo(uri) {
851    var img = document.getElementById('brand-logo');
852    if (typeof uri === 'string' && uri.length <= LOGO_MAX_CHARS && LOGO_RE.test(uri)) {
853      img.src = uri;                       /* img.src ONLY — never innerHTML */
854      img.alt = (cfg.engagement && cfg.engagement.label) ? cfg.engagement.label + ' logo' : 'Client logo';
855      img.classList.add('show');
856    } else {
857      img.removeAttribute('src');
858      img.classList.remove('show');
859    }
860  }
861
862  /* ---------- refresh protocol ---------- */
863  var refreshing = false;
864  var backstopTimer = null;
865  var btn = document.getElementById('refresh-btn');
866  var note = document.getElementById('refresh-note');
867  var app = document.getElementById('app');
868
869  function isEmbedded() {
870    try { return window.parent && window.parent !== window; } catch (e) { return true; }
871  }
872  function setRefreshing(on, message) {
873    refreshing = on;
874    btn.disabled = on;
875    btn.textContent = on ? 'Refreshing…' : 'Refresh data';
876    app.classList.toggle('refreshing', on);
877    app.setAttribute('aria-busy', on ? 'true' : 'false');
878    note.textContent = message || '';
879    note.classList.toggle('show', !!message);
880    if (!on && backstopTimer) { clearTimeout(backstopTimer); backstopTimer = null; }
881  }
882  function post(msg) {
883    if (!isEmbedded()) return;
884    msg.protocol_version = PROTOCOL_VERSION;
885    msg.document_id = env.document_id || null;
886    try { window.parent.postMessage(msg, '*'); } catch (e) { /* opaque origin */ }
887  }
888
889  btn.addEventListener('click', function () {
890    if (refreshing) return;
891    if (!isEmbedded()) {
892      setRefreshing(false, 'Live refresh is available when this dashboard is opened in Darwin.');
893      return;
894    }
895    setRefreshing(true);
896    post({ type: 'darwin:dashboard:refresh-request' });   /* no config: stored row is the source of truth */
897    backstopTimer = setTimeout(function () {
898      setRefreshing(false, 'This is taking longer than expected. Try again, or ask Darwin in chat to refresh it.');
899    }, PENDING_BACKSTOP_MS);
900  });
901
902  window.addEventListener('message', function (e) {
903    if (e.source !== window.parent) return;
904    var m = e.data;
905    if (!m || typeof m !== 'object' || typeof m.type !== 'string') return;
906    /* Presence AND equality: a message that simply omits these fields is
907       rejected too, so the code matches the contract above. */
908    if (m.protocol_version !== PROTOCOL_VERSION) return;
909    if (env.document_id && m.document_id !== env.document_id) return;
910
911    if (m.type === 'darwin:dashboard:theme') { applyTheme(m); return; }
912
913    if (m.type === 'darwin:dashboard:error') {
914      setRefreshing(false, typeof m.message === 'string' && m.message
915        ? m.message
916        : 'That refresh didn’t complete. Try again, or ask Darwin in chat.');
917      return;
918    }
919
920    if (m.type === 'darwin:dashboard:data') {
921      /* Validate BEFORE replacing state, so a malformed payload can never
922         leave a half-rendered surface behind. */
923      if (validateData(m.data)) {
924        setRefreshing(false, 'The refreshed data couldn’t be read, so the previous view is unchanged.');
925        return;
926      }
927      data = sanitizeData(m.data);
928      setRefreshing(false);
929      renderAll();
930      return;
931    }
932  });
933
934  /* ---------- boot ---------- */
935  function renderAll() {
936    renderHeader();
937    renderGlance();
938    renderActions();
939    renderDatasources();
940    renderContacts();
941  }
942  renderAll();
943
944  post({
945    type: 'darwin:dashboard:ready',
946    template_id: env.template_id,
947    template_version: env.template_version
948  });
949})();
950<\/script>
951</body>
952</html>
953`,yi=`<!doctype html>
954<html lang="en">
955<head>
956<meta charset="utf-8">
957<meta name="viewport" content="width=device-width, initial-scale=1">
958<meta http-equiv="Content-Security-Policy"
959      content="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; connect-src 'none'; base-uri 'none'; form-action 'none'">
960<title>Darwin Dashboard</title>
961<!--
962  ============================================================================
963  Darwin Dashboard Template — "kpi-overview" v0.1.3 (DRAFT for Product Owner)
964  ============================================================================
965
966  WHAT THIS IS
967  A self-contained HTML dashboard (no external scripts, fonts, or network
968  calls) designed to render inside a sandboxed <iframe> in the Darwin chat
969  app, and to keep working when exported/downloaded as a plain .html file.
970
971  The CSP above travels with every exported copy — the exported file has no
972  sandbox, so it is a second security surface, not a freebie. \`sandbox\` does
973  NOT block network egress; this CSP does.
974
975  THE CONTRACT (what the AI writes vs. what this template owns)
976  The assistant/orchestrator writes ONLY the two JSON islands below:
977    1. #darwin-dashboard-config — the canonical envelope + the user's answers
978       (KPI, date range, grouping, comparison). Written at create time,
979       updated on edit.
980    2. #darwin-dashboard-data — the query results. Replaced on every refresh.
981  All markup, styles, and script are template-owned and never AI-edited.
982  Everything data-derived is inserted with textContent (never innerHTML),
983  so the JSON islands cannot inject markup or script.
984
985  ISLAND ESCAPING (host responsibility): whoever serializes JSON into these
986  islands MUST emit the JSON unicode escapes \\u003c, \\u003e and \\u0026 for the characters
987  < > & (and \\u2028 / \\u2029 for U+2028 / U+2029). HTML entities are not a
988  substitute: the island is read by JSON.parse, which would hand back the
989  entity text itself.
990  Otherwise a "<\/script>" inside any AI-written string closes the island
991  early and the remainder becomes live markup — arbitrary script execution
992  in an exported file, which has no sandbox.
993
994  ENVELOPE (config island) — frozen across all Darwin dashboard templates:
995    schema_version, artifact_type, template_id, template_version, config
996    document_id, protocol_version  — host-injected at composition time
997                                     (row metadata; never model-written)
998  config is per-template; this file implements kpi-overview's config schema.
999
1000  HOST (IFRAME) PROTOCOL — window.postMessage
1001    template -> host : { type:'darwin:dashboard:ready', protocol_version,
1002                         document_id, template_id, template_version }
1003    template -> host : { type:'darwin:dashboard:refresh-request',
1004                         protocol_version, document_id }
1005                       NOTE: config is deliberately NOT sent. The stored row
1006                       is the source of truth; the host must ignore any
1007                       client-supplied config on refresh.
1008    host -> template : { type:'darwin:dashboard:data', protocol_version,
1009                         document_id, data:{...} }
1010    host -> template : { type:'darwin:dashboard:error', protocol_version,
1011                         document_id, message }
1012                       Clears pending state. The host MUST send this when a
1013                       refresh fails — including when the websocket said
1014                       "complete" but the follow-up content fetch failed,
1015                       which raises no canvas_error of its own.
1016    host -> template : { type:'darwin:dashboard:theme', protocol_version,
1017                         document_id, mode:'light'|'dark',
1018                         tokens:{ '--brand-accent-rule':'#B31A1A', ... },
1019                         // send only tokens this template consumes
1020                         logo_data_uri:'data:image/png;base64,…' | null }
1021
1022  A sandboxed srcdoc iframe has an OPAQUE origin, so the host must post with
1023  targetOrigin '*'. Binding therefore comes from the iframe element
1024  reference plus this template's checks: e.source === window.parent, a
1025  matching document_id, and a matching protocol_version.
1026
1027  BRANDING vs THEMING (two different things on one message):
1028    - tokens  : the host's theme. Any allowlisted token, color values only.
1029    - Client branding uses TWO tokens, and the distinction matters:
1030        --brand-accent       the canonical brand hex, for FILLED areas.
1031                             THIS TEMPLATE DOES NOT USE OR ACCEPT IT — it has
1032                             no filled brand area. The datasource-tracker's
1033                             header band is the consumer that does.
1034        --brand-accent-rule  the same hue tone-mapped by the host for the
1035                             surface it sits on. For RULES and hairlines —
1036                             this template's header rule. A 3px rule is
1037                             invisible below 3:1 contrast, which is the only
1038                             reason the mapping exists.
1039      Neither may ever reach --series or any other data-mark token: a brand
1040      colour there would silently defeat the palette's contrast and
1041      colorblind-separation gates. Rules that encode MEANING (status,
1042      urgency) keep their semantic colours and take no brand token.
1043    - logo_data_uri is a SIBLING FIELD, not a token: a data URI cannot pass
1044      the color-only token validator, and no CSS custom property can feed an
1045      <img src>. It is assigned only to img.src — never innerHTML, never
1046      inline <svg> (an SVG in <img> cannot run script; the same bytes in the
1047      DOM can).
1048
1049  DATA SCHEMA (#darwin-dashboard-data)
1050    as_of      ISO-8601 UTC timestamp of the query
1051    totals     { previous } — required only when config.comparison is set
1052    timeseries [{ date:'YYYY-MM-DD', value:number }] at config grain
1053    breakdown  [{ key:string, value:number }] by config.group_by.column,
1054               largest first; fold the tail into an "Other" row.
1055               The breakdown sum is the ONE denominator for every share
1056               figure on this page (host validation keeps it reconciled
1057               with the timeseries sum to within 2%).
1058
1059  Sample data below is illustrative only.
1060  ============================================================================
1061-->
1062<style>
1063  /* Darwin (mevo) theme tokens. --brand-accent defaults to the app accent;
1064     the host overrides it per engagement. */
1065  :root {
1066    color-scheme: light;
1067    --page: #f8f9fa;
1068    --surface: #ffffff;
1069    --ink: #2a2736;
1070    --ink-2: #5a566a;
1071    --muted: #95939f;
1072    --grid: #e5e7eb;
1073    --axis: #d2d6db;
1074    --border: rgba(104, 97, 135, 0.20);
1075    --series: #8533ff;
1076    --series-wash: rgba(133, 51, 255, 0.08);
1077    --up: #107569;
1078    --down: #b42318;
1079    --brand-accent-rule: #8533ff;   /* tone-mapped by the host for THIS surface. This template
1080                                       has no filled brand area, so it neither defines nor
1081                                       allowlists --brand-accent: a token with no consumer
1082                                       reads as a working contract that does nothing. */
1083  }
1084  @media (prefers-color-scheme: dark) {
1085    :root:not([data-theme="light"]) {
1086      color-scheme: dark;
1087      --page: #1e0a3b;
1088      --surface: #2a2736;
1089      --ink: #f8f3ff;
1090      --ink-2: #95939f;
1091      --muted: #95939f;
1092      --grid: #343046;
1093      --axis: #49445f;
1094      --border: rgba(107, 41, 206, 0.20);
1095      --series: #9d5cff;
1096      --series-wash: rgba(157, 92, 255, 0.12);
1097      --up: #17b26a;
1098      --down: #f04438;
1099      --brand-accent-rule: #9d5cff;
1100    }
1101  }
1102  :root[data-theme="dark"] {
1103    color-scheme: dark;
1104    --page: #1e0a3b;
1105    --surface: #2a2736;
1106    --ink: #f8f3ff;
1107    --ink-2: #95939f;
1108    --muted: #95939f;
1109    --grid: #343046;
1110    --axis: #49445f;
1111    --border: rgba(107, 41, 206, 0.20);
1112    --series: #9d5cff;
1113    --series-wash: rgba(157, 92, 255, 0.12);
1114    --up: #17b26a;
1115    --down: #f04438;
1116    --brand-accent-rule: #9d5cff;
1117  }
1118
1119  * { box-sizing: border-box; }
1120  html, body { margin: 0; }
1121  body {
1122    background: var(--page);
1123    color: var(--ink);
1124    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
1125  }
1126  .wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
1127
1128  /* ---------- header (brand chrome) ---------- */
1129  .head {
1130    display: flex; flex-wrap: wrap; gap: 12px 16px;
1131    align-items: flex-start; justify-content: space-between;
1132    border-top: 3px solid var(--brand-accent-rule);
1133    padding-top: 14px;
1134  }
1135  .title-row { display: flex; align-items: center; gap: 12px; }
1136  #brand-logo { display: none; max-height: 30px; max-width: 140px; width: auto; }
1137  #brand-logo.show { display: block; }
1138  .head h1 { font-size: 20px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
1139  .chips { display: flex; flex-wrap: wrap; gap: 6px; }
1140  .chip {
1141    display: inline-flex; align-items: center; gap: 5px;
1142    border: 1px solid var(--border); border-radius: 999px;
1143    padding: 2px 10px; font-size: 12px; color: var(--ink-2); background: var(--surface);
1144  }
1145  .chip .k { color: var(--muted); }
1146  .refresh-box { text-align: right; }
1147  .as-of { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
1148  button.refresh {
1149    font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
1150    color: var(--ink); background: var(--surface);
1151    border: 1px solid var(--border); border-radius: 8px;
1152    padding: 8px 14px; cursor: pointer;
1153  }
1154  button.refresh:hover { border-color: var(--muted); }
1155  button.refresh:disabled { opacity: 0.55; cursor: default; }
1156  .refresh-note { font-size: 12px; color: var(--muted); margin-top: 6px; max-width: 260px; display: none; }
1157  .refresh-note.show { display: block; }
1158
1159  /* ---------- stat tiles ---------- */
1160  .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 20px; }
1161  .tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
1162  .tile .label { font-size: 12px; color: var(--ink-2); }
1163  .tile .value { font-size: 26px; font-weight: 600; margin-top: 2px; letter-spacing: -0.01em; }
1164  .tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
1165  .delta { font-size: 13px; font-weight: 600; }
1166  .delta.up { color: var(--up); }
1167  .delta.down { color: var(--down); }
1168  .delta .vs { font-weight: 400; color: var(--muted); }
1169
1170  /* ---------- cards / charts ---------- */
1171  .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 14px; margin-top: 16px; position: relative; }
1172  .card h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
1173  .chart-holder { transition: opacity 0.2s ease; }
1174  .refreshing .chart-holder, .refreshing .tiles { opacity: 0.55; }
1175  #trend-chart { width: 100%; }
1176  #trend-chart:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; border-radius: 6px; }
1177  #trend-chart svg { display: block; width: 100%; height: auto; }
1178  .hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
1179
1180  /* bars */
1181  .bar-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; padding: 5px 0; border-radius: 6px; }
1182  .bar-row:focus-visible { outline: 2px solid var(--series); outline-offset: 1px; }
1183  .bar-label { font-size: 13px; color: var(--ink-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1184  .bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
1185  .bar-fill {
1186    height: 20px; background: var(--series);
1187    border-radius: 0 4px 4px 0;           /* rounded data-end, square baseline */
1188    min-width: 2px; transition: filter 0.1s ease;
1189  }
1190  .bar-row:hover .bar-fill, .bar-row:focus-visible .bar-fill { filter: brightness(1.12); }
1191  .bar-value { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
1192
1193  /* tooltip */
1194  .tip {
1195    position: absolute; z-index: 5; pointer-events: none; display: none;
1196    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
1197    padding: 8px 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
1198    font-size: 12px; min-width: 120px;
1199  }
1200  .tip.show { display: block; }
1201  .tip .t-label { color: var(--muted); margin-bottom: 3px; }
1202  .tip .t-row { display: flex; align-items: center; gap: 7px; }
1203  .tip .t-key { width: 12px; height: 0; border-top: 2px solid var(--series); border-radius: 1px; flex: none; }
1204  .tip .t-val { font-weight: 600; color: var(--ink); }
1205  .tip .t-sub { color: var(--muted); margin-left: 4px; }
1206
1207  /* table view */
1208  details.card summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
1209  .tables { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 12px; }
1210  table { border-collapse: collapse; font-size: 12.5px; }
1211  caption { text-align: left; font-weight: 600; color: var(--ink-2); padding-bottom: 6px; }
1212  th, td { padding: 4px 12px 4px 0; text-align: left; border-bottom: 1px solid var(--grid); }
1213  th { color: var(--muted); font-weight: 500; }
1214  td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
1215
1216  .foot { margin-top: 18px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
1217
1218  /* fatal error state — never a blank iframe */
1219  .fatal { max-width: 560px; margin: 48px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; }
1220  .fatal h2 { margin: 0 0 8px; font-size: 16px; }
1221  .fatal p { margin: 0; color: var(--ink-2); font-size: 13px; }
1222  .fatal code { font-size: 12px; color: var(--muted); }
1223
1224  @media (max-width: 560px) {
1225    .bar-row { grid-template-columns: 96px 1fr; }
1226    .head { flex-direction: column; }
1227    .refresh-box { text-align: left; }
1228  }
1229</style>
1230</head>
1231<body>
1232
1233<!-- ======= BEGIN DARWIN:CONFIG (envelope + config; AI writes config only) ======= -->
1234<script type="application/json" id="darwin-dashboard-config">
1235{
1236  "schema_version": 1,
1237  "protocol_version": 1,
1238  "artifact_type": "dashboard",
1239  "template_id": "kpi-overview",
1240  "template_version": "0.1.3",
1241  "document_id": null,
1242  "config": {
1243    "title": "Media-Driven Revenue Overview",
1244    "engagement": { "nice_id": "acme-insurance", "label": "Acme Insurance" },
1245    "kpi": {
1246      "id": "media_driven_revenue",
1247      "name": "Media-Driven Revenue",
1248      "format": "currency",
1249      "currency": "USD",
1250      "up_is_good": true,
1251      "aggregation": "sum"
1252    },
1253    "date_range": {
1254      "expression": "last 30 days",
1255      "start": "2026-07-07",
1256      "end": "2026-08-05",
1257      "grain": "day",
1258      "reresolve_on_refresh": true
1259    },
1260    "group_by": { "column": "media_channel", "label": "Media Channel" },
1261    "comparison": "previous_period",
1262    "data_request": "Daily Media-Driven Revenue by media channel for the last 30 days, with the prior 30-day total for comparison."
1263  }
1264}
1265<\/script>
1266<!-- ======= END DARWIN:CONFIG ======= -->
1267
1268<!-- ======= BEGIN DARWIN:DATA (replaced on every refresh) ======= -->
1269<script type="application/json" id="darwin-dashboard-data">
1270{
1271  "schema_version": 1,
1272  "as_of": "2026-08-06T14:30:00Z",
1273  "totals": { "previous": 4187300 },
1274  "timeseries": [
1275    { "date": "2026-07-07", "value": 148200 },
1276    { "date": "2026-07-08", "value": 151900 },
1277    { "date": "2026-07-09", "value": 155400 },
1278    { "date": "2026-07-10", "value": 149800 },
1279    { "date": "2026-07-11", "value": 158600 },
1280    { "date": "2026-07-12", "value": 121400 },
1281    { "date": "2026-07-13", "value": 112900 },
1282    { "date": "2026-07-14", "value": 156300 },
1283    { "date": "2026-07-15", "value": 160100 },
1284    { "date": "2026-07-16", "value": 158700 },
1285    { "date": "2026-07-17", "value": 162400 },
1286    { "date": "2026-07-18", "value": 166200 },
1287    { "date": "2026-07-19", "value": 125800 },
1288    { "date": "2026-07-20", "value": 117500 },
1289    { "date": "2026-07-21", "value": 161900 },
1290    { "date": "2026-07-22", "value": 165300 },
1291    { "date": "2026-07-23", "value": 168800 },
1292    { "date": "2026-07-24", "value": 163500 },
1293    { "date": "2026-07-25", "value": 171600 },
1294    { "date": "2026-07-26", "value": 129200 },
1295    { "date": "2026-07-27", "value": 121800 },
1296    { "date": "2026-07-28", "value": 168400 },
1297    { "date": "2026-07-29", "value": 172900 },
1298    { "date": "2026-07-30", "value": 170200 },
1299    { "date": "2026-07-31", "value": 175800 },
1300    { "date": "2026-08-01", "value": 181300 },
1301    { "date": "2026-08-02", "value": 133600 },
1302    { "date": "2026-08-03", "value": 126400 },
1303    { "date": "2026-08-04", "value": 178600 },
1304    { "date": "2026-08-05", "value": 184200 }
1305  ],
1306  "breakdown": [
1307    { "key": "Paid Search", "value": 1552400 },
1308    { "key": "TV", "value": 1131800 },
1309    { "key": "Social", "value": 848900 },
1310    { "key": "Display", "value": 585600 },
1311    { "key": "Streaming Audio", "value": 306200 },
1312    { "key": "Other", "value": 193800 }
1313  ]
1314}
1315<\/script>
1316<!-- ======= END DARWIN:DATA ======= -->
1317
1318<main class="wrap" id="app" aria-busy="false">
1319  <header class="head">
1320    <div>
1321      <div class="title-row">
1322        <img id="brand-logo" alt="">
1323        <h1 id="dash-title">Dashboard</h1>
1324      </div>
1325      <div class="chips" id="chips"></div>
1326    </div>
1327    <div class="refresh-box">
1328      <div class="as-of" id="as-of" aria-live="polite"></div>
1329      <button class="refresh" id="refresh-btn" type="button">Refresh data</button>
1330      <div class="refresh-note" id="refresh-note" role="status"></div>
1331    </div>
1332  </header>
1333
1334  <section class="tiles" id="tiles" aria-label="Key figures"></section>
1335
1336  <section class="card">
1337    <h2 id="trend-title"></h2>
1338    <div class="chart-holder">
1339      <div id="trend-chart" tabindex="0" role="img" aria-describedby="trend-hint"></div>
1340    </div>
1341    <div class="hint" id="trend-hint"></div>
1342    <div class="tip" id="trend-tip" role="status"></div>
1343  </section>
1344
1345  <section class="card">
1346    <h2 id="breakdown-title"></h2>
1347    <div class="chart-holder"><div id="bars"></div></div>
1348    <div class="tip" id="bar-tip" role="status"></div>
1349  </section>
1350
1351  <details class="card">
1352    <summary>View data as table</summary>
1353    <div class="tables">
1354      <table id="table-series">
1355        <caption id="table-series-caption">Values</caption>
1356        <thead><tr><th scope="col" id="table-series-col">Period</th><th scope="col" class="num">Value</th></tr></thead>
1357        <tbody></tbody>
1358      </table>
1359      <table id="table-breakdown">
1360        <caption id="table-breakdown-caption">Breakdown</caption>
1361        <thead><tr><th scope="col" id="table-breakdown-col">Group</th><th scope="col" class="num">Value</th><th scope="col" class="num">Share</th></tr></thead>
1362        <tbody></tbody>
1363      </table>
1364    </div>
1365  </details>
1366
1367  <footer class="foot">
1368    <span id="foot-template"></span>
1369    <span>Generated by Darwin &middot; Data refreshes on request</span>
1370  </footer>
1371</main>
1372
1373<script>
1374(function () {
1375  'use strict';
1376
1377  var PROTOCOL_VERSION = 1;
1378  var TEMPLATE_ID = 'kpi-overview';
1379  /* Host owns pending state; this is only a backstop so a host bug can't
1380     leave the button disabled forever. Matches the orchestrator's inline
1381     canvas turn timeout (canvas_inline_timeout_seconds: 300). */
1382  var PENDING_BACKSTOP_MS = 300000;
1383
1384  /* ---------- islands ---------- */
1385  function readIsland(id) {
1386    var node = document.getElementById(id);
1387    if (!node) return null;
1388    try { return JSON.parse(node.textContent); } catch (e) { return null; }
1389  }
1390
1391  function showFatal(detail) {
1392    var app = document.getElementById('app');
1393    app.textContent = '';
1394    app.className = 'fatal';
1395    var h = document.createElement('h2');
1396    h.textContent = 'This dashboard can’t be displayed';
1397    var p = document.createElement('p');
1398    p.textContent = 'Its saved configuration or data is incomplete. Ask Darwin in chat to rebuild or refresh it.';
1399    var c = document.createElement('p');
1400    var code = document.createElement('code');
1401    code.textContent = detail;
1402    c.appendChild(code);
1403    app.appendChild(h); app.appendChild(p); app.appendChild(c);
1404  }
1405
1406  /* ---------- validation (fail closed even if host validation regresses) --- */
1407  function validateEnvelope(env) {
1408    if (!env || typeof env !== 'object') return 'config island missing or unparseable';
1409    if (env.template_id !== TEMPLATE_ID) return 'template_id is not "' + TEMPLATE_ID + '"';
1410    var c = env.config;
1411    if (!c || typeof c !== 'object') return 'config missing';
1412    if (!c.kpi || typeof c.kpi !== 'object' || !c.kpi.name) return 'config.kpi missing';
1413    if (!c.date_range || !c.date_range.start || !c.date_range.end) return 'config.date_range missing';
1414    if (!c.group_by || !c.group_by.label) return 'config.group_by missing';
1415    return null;
1416  }
1417
1418  function validateData(d) {
1419    if (!d || typeof d !== 'object') return 'data island missing or unparseable';
1420    if (!Array.isArray(d.timeseries)) return 'data.timeseries is not an array';
1421    if (!Array.isArray(d.breakdown)) return 'data.breakdown is not an array';
1422    return null;
1423  }
1424
1425  /* Coerce with Number() and drop non-finite points, so a bad payload
1426     renders a thinner chart rather than a broken one. */
1427  function sanitizeData(d) {
1428    var totals = (d.totals && typeof d.totals === 'object') ? d.totals : {};
1429    var prev = Number(totals.previous);
1430    return {
1431      as_of: typeof d.as_of === 'string' ? d.as_of : '',
1432      totals: { previous: isFinite(prev) ? prev : null },
1433      timeseries: d.timeseries
1434        .filter(function (p) { return p && typeof p === 'object'; })
1435        .map(function (p) { return { date: String(p.date == null ? '' : p.date), value: Number(p.value) }; })
1436        .filter(function (p) { return p.date && isFinite(p.value); }),
1437      breakdown: d.breakdown
1438        .filter(function (r) { return r && typeof r === 'object'; })
1439        .map(function (r) { return { key: String(r.key == null ? '' : r.key), value: Number(r.value) }; })
1440        .filter(function (r) { return isFinite(r.value); })
1441    };
1442  }
1443
1444  var env = readIsland('darwin-dashboard-config');
1445  var envError = validateEnvelope(env);
1446  if (envError) { showFatal(envError); return; }
1447
1448  var cfg = env.config;
1449  var rawData = readIsland('darwin-dashboard-data');
1450  var dataError = validateData(rawData);
1451  if (dataError) { showFatal(dataError); return; }
1452  var data = sanitizeData(rawData);
1453
1454  /* ---------- grain ---------- */
1455  var GRAIN = {
1456    day:   { adj: 'Daily',   one: 'day',   many: 'days' },
1457    week:  { adj: 'Weekly',  one: 'week',  many: 'weeks' },
1458    month: { adj: 'Monthly', one: 'month', many: 'months' }
1459  };
1460  function grain() {
1461    return GRAIN[cfg.date_range && cfg.date_range.grain] || GRAIN.day;
1462  }
1463  function units(n) { var g = grain(); return n === 1 ? g.one : g.many; }
1464
1465  /* ---------- formatting ---------- */
1466  var isCurrency = cfg.kpi.format === 'currency';
1467  var isPercentKpi = cfg.kpi.format === 'percent';
1468  var currency = cfg.kpi.currency || 'USD';
1469
1470  function fmtCompact(v) {
1471    if (isPercentKpi) return v.toFixed(1) + '%';
1472    var opts = { notation: 'compact', maximumFractionDigits: Math.abs(v) >= 1e6 ? 2 : 1 };
1473    if (isCurrency) { opts.style = 'currency'; opts.currency = currency; }
1474    return new Intl.NumberFormat('en-US', opts).format(v);
1475  }
1476  function fmtFull(v) {
1477    if (isPercentKpi) return v.toFixed(2) + '%';
1478    var opts = { maximumFractionDigits: 0 };
1479    if (isCurrency) { opts.style = 'currency'; opts.currency = currency; }
1480    return new Intl.NumberFormat('en-US', opts).format(v);
1481  }
1482  function fmtAxis(v) { return v === 0 ? '0' : fmtCompact(v); }
1483
1484  var MONTHS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
1485  var MONTHS_FULL = ['January','February','March','April','May','June','July','August','September','October','November','December'];
1486  function parseDay(s) {
1487    var p = String(s).split('-');
1488    return { y: +p[0], m: +p[1] - 1, d: +p[2] };
1489  }
1490  /* Axis/short form, by grain. */
1491  function fmtPoint(s) {
1492    var t = parseDay(s);
1493    if (isNaN(t.y)) return String(s);
1494    var g = cfg.date_range.grain;
1495    if (g === 'month') return MONTHS[t.m] + " '" + String(t.y).slice(2);
1496    return MONTHS[t.m] + ' ' + t.d;
1497  }
1498  /* Long form for tooltips, tables and labels, by grain. */
1499  function fmtPointFull(s) {
1500    var t = parseDay(s);
1501    if (isNaN(t.y)) return String(s);
1502    var g = cfg.date_range.grain;
1503    if (g === 'month') return MONTHS_FULL[t.m] + ' ' + t.y;
1504    if (g === 'week') return 'Week of ' + MONTHS[t.m] + ' ' + t.d + ', ' + t.y;
1505    return MONTHS[t.m] + ' ' + t.d + ', ' + t.y;
1506  }
1507  function fmtAsOf(iso) {
1508    var d = new Date(iso);
1509    if (isNaN(d)) return '';
1510    return new Intl.DateTimeFormat('en-US', {
1511      month: 'short', day: 'numeric', year: 'numeric',
1512      hour: 'numeric', minute: '2-digit', timeZone: 'UTC'
1513    }).format(d) + ' UTC';
1514  }
1515
1516  /* ---------- derived figures ----------
1517     The breakdown sum is the single denominator for every share on the page:
1518     bars, the table and the top-group tile all use it, so no two figures can
1519     disagree. Host validation keeps it within 2% of the timeseries sum. */
1520  function derive() {
1521    var ts = data.timeseries, total = 0, peak = null;
1522    for (var i = 0; i < ts.length; i++) {
1523      total += ts[i].value;
1524      if (!peak || ts[i].value > peak.value) peak = ts[i];
1525    }
1526    var breakdownTotal = data.breakdown.reduce(function (s, r) { return s + r.value; }, 0);
1527    var prev = data.totals.previous;
1528    var comparison = comparisonCopy();
1529    var deltaPct = (comparison && prev !== null && prev !== 0) ? ((total - prev) / prev) * 100 : null;
1530    return {
1531      total: total,
1532      breakdownTotal: breakdownTotal,
1533      deltaPct: deltaPct,
1534      comparison: comparison,
1535      peak: peak,
1536      top: data.breakdown.length ? data.breakdown[0] : null,
1537      points: ts.length
1538    };
1539  }
1540
1541  /* comparison is rendered from config, not assumed. Absent/unknown mode or a
1542     missing totals.previous => no delta at all. */
1543  function comparisonCopy() {
1544    var mode = cfg.comparison;
1545    if (!mode) return null;
1546    if (data.totals.previous === null) return null;
1547    if (mode === 'previous_period') {
1548      var n = data.timeseries.length;
1549      return 'vs previous ' + n + ' ' + units(n);
1550    }
1551    if (mode === 'same_period_last_year') return 'vs same period last year';
1552    return null;
1553  }
1554
1555  /* ---------- small DOM helper ---------- */
1556  function el(tag, cls, text) {
1557    var n = document.createElement(tag);
1558    if (cls) n.className = cls;
1559    if (text !== undefined) n.textContent = text;
1560    return n;
1561  }
1562
1563  /* ---------- header ---------- */
1564  function renderHeader() {
1565    var engagement = cfg.engagement && cfg.engagement.label;
1566    var title = cfg.title || 'Dashboard';
1567    var fullTitle = engagement ? engagement + ' · ' + title : title;
1568    document.title = fullTitle;
1569    document.getElementById('dash-title').textContent = fullTitle;
1570
1571    var chips = document.getElementById('chips');
1572    chips.textContent = '';
1573    var kpiChip = el('span', 'chip');
1574    kpiChip.appendChild(el('span', 'k', 'KPI'));
1575    kpiChip.appendChild(el('span', null, cfg.kpi.name));
1576    chips.appendChild(kpiChip);
1577
1578    var rangeChip = el('span', 'chip');
1579    rangeChip.appendChild(el('span', 'k', 'Range'));
1580    rangeChip.appendChild(el('span', null,
1581      fmtPoint(cfg.date_range.start) + ' – ' + fmtPointFull(cfg.date_range.end)));
1582    chips.appendChild(rangeChip);
1583
1584    var byChip = el('span', 'chip');
1585    byChip.appendChild(el('span', 'k', 'By'));
1586    byChip.appendChild(el('span', null, cfg.group_by.label));
1587    chips.appendChild(byChip);
1588
1589    document.getElementById('as-of').textContent = 'Data as of ' + fmtAsOf(data.as_of);
1590    document.getElementById('trend-title').textContent = grain().adj + ' ' + cfg.kpi.name;
1591    document.getElementById('trend-hint').textContent =
1592      'Hover, or focus and use ←/→, to read ' + grain().adj.toLowerCase() +
1593      ' values. Full data in the table below.';
1594    document.getElementById('breakdown-title').textContent = cfg.kpi.name + ' by ' + cfg.group_by.label;
1595    document.getElementById('table-series-caption').textContent = grain().adj + ' values';
1596    document.getElementById('table-series-col').textContent =
1597      grain().one.charAt(0).toUpperCase() + grain().one.slice(1);
1598    document.getElementById('table-breakdown-caption').textContent = 'By ' + cfg.group_by.label.toLowerCase();
1599    document.getElementById('table-breakdown-col').textContent = cfg.group_by.label;
1600    document.getElementById('foot-template').textContent =
1601      'Template ' + env.template_id + ' v' + env.template_version;
1602  }
1603
1604  /* ---------- stat tiles ---------- */
1605  function renderTiles() {
1606    var d = derive();
1607    var tiles = document.getElementById('tiles');
1608    tiles.textContent = '';
1609
1610    var t1 = el('div', 'tile');
1611    t1.appendChild(el('div', 'label', 'Total ' + cfg.kpi.name));
1612    t1.appendChild(el('div', 'value', fmtCompact(d.total)));
1613    if (d.deltaPct !== null) {
1614      var goodUp = cfg.kpi.up_is_good !== false;
1615      var up = d.deltaPct >= 0;
1616      var favorable = (up === goodUp);
1617      var delta = el('div', 'delta ' + (favorable ? 'up' : 'down'));
1618      delta.appendChild(document.createTextNode(
1619        (up ? '▲ +' : '▼ ') + d.deltaPct.toFixed(1) + '% '));
1620      delta.appendChild(el('span', 'vs', d.comparison));
1621      /* Direction and favorability in words — not color and glyph alone. */
1622      delta.setAttribute('aria-label',
1623        (up ? 'Up ' : 'Down ') + Math.abs(d.deltaPct).toFixed(1) + ' percent ' +
1624        d.comparison + ', ' + (favorable ? 'favorable' : 'unfavorable'));
1625      t1.appendChild(delta);
1626    }
1627    tiles.appendChild(t1);
1628
1629    var t2 = el('div', 'tile');
1630    t2.appendChild(el('div', 'label', grain().adj + ' average'));
1631    t2.appendChild(el('div', 'value', d.points ? fmtCompact(d.total / d.points) : '—'));
1632    t2.appendChild(el('div', 'sub', 'across ' + d.points + ' ' + units(d.points)));
1633    tiles.appendChild(t2);
1634
1635    if (d.top) {
1636      var share = d.breakdownTotal ? (d.top.value / d.breakdownTotal) * 100 : 0;
1637      var t3 = el('div', 'tile');
1638      t3.appendChild(el('div', 'label', 'Top ' + cfg.group_by.label.toLowerCase()));
1639      t3.appendChild(el('div', 'value', d.top.key));
1640      t3.appendChild(el('div', 'sub', fmtCompact(d.top.value) + ' · ' + share.toFixed(1) + '% of total'));
1641      tiles.appendChild(t3);
1642    }
1643
1644    if (d.peak) {
1645      var t4 = el('div', 'tile');
1646      t4.appendChild(el('div', 'label', 'Peak ' + grain().one));
1647      t4.appendChild(el('div', 'value', fmtCompact(d.peak.value)));
1648      t4.appendChild(el('div', 'sub', 'on ' + fmtPointFull(d.peak.date)));
1649      tiles.appendChild(t4);
1650    }
1651  }
1652
1653  /* ---------- line chart ---------- */
1654  var SVGNS = 'http://www.w3.org/2000/svg';
1655  function svgEl(tag, attrs) {
1656    var n = document.createElementNS(SVGNS, tag);
1657    for (var k in attrs) n.setAttribute(k, attrs[k]);
1658    return n;
1659  }
1660  function niceMax(v) {
1661    if (v <= 0) return 1;
1662    var p = Math.pow(10, Math.floor(Math.log10(v)));
1663    var n = v / p;
1664    var m = n <= 1 ? 1 : n <= 2 ? 2 : n <= 2.5 ? 2.5 : n <= 5 ? 5 : 10;
1665    return m * p;
1666  }
1667
1668  var trendState = { activeIndex: -1, geom: null };
1669
1670  function renderTrend() {
1671    var host = document.getElementById('trend-chart');
1672    host.textContent = '';
1673    var ts = data.timeseries;
1674    if (!ts.length) { host.textContent = 'No data for this period.'; return; }
1675
1676    var W = Math.max(host.clientWidth || 640, 320);
1677    var H = 260;
1678    var M = { top: 14, right: 64, bottom: 26, left: 52 };
1679    var pw = W - M.left - M.right, ph = H - M.top - M.bottom;
1680
1681    var values = ts.map(function (p) { return p.value; });
1682    var rawMax = Math.max.apply(null, values);
1683    var rawMin = Math.min.apply(null, values);
1684    /* Signed domain when negatives appear, so points never plot outside the
1685       viewBox. (Host validation rejects negatives for v1; this is the
1686       graceful path if one ever slips through.) */
1687    var yMax = niceMax(Math.max(rawMax, 0));
1688    var yMin = rawMin < 0 ? -niceMax(Math.abs(rawMin)) : 0;
1689    var span = (yMax - yMin) || 1;
1690
1691    var xAt = function (i) { return M.left + (ts.length === 1 ? pw / 2 : (i / (ts.length - 1)) * pw); };
1692    var yAt = function (v) { return M.top + ph - ((v - yMin) / span) * ph; };
1693
1694    var svg = svgEl('svg', { viewBox: '0 0 ' + W + ' ' + H, width: W, height: H });
1695    svg.setAttribute('aria-hidden', 'true');
1696
1697    var tickCount = 4;
1698    for (var t = 0; t <= tickCount; t++) {
1699      var v = yMin + (span / tickCount) * t;
1700      var y = yAt(v);
1701      if (Math.abs(v - yMin) > 1e-9) {
1702        svg.appendChild(svgEl('line', { x1: M.left, x2: M.left + pw, y1: y, y2: y, stroke: 'var(--grid)', 'stroke-width': 1 }));
1703      }
1704      var lbl = svgEl('text', { x: M.left - 8, y: y + 4, 'text-anchor': 'end', fill: 'var(--muted)', 'font-size': 11 });
1705      lbl.textContent = fmtAxis(v);
1706      svg.appendChild(lbl);
1707    }
1708
1709    /* Baseline sits at zero, wherever zero falls in the domain. */
1710    var zeroY = yAt(0);
1711    svg.appendChild(svgEl('line', { x1: M.left, x2: M.left + pw, y1: zeroY, y2: zeroY, stroke: 'var(--axis)', 'stroke-width': 1 }));
1712
1713    var step = Math.max(1, Math.round((ts.length - 1) / 4));
1714    for (var i = 0; i < ts.length; i += step) {
1715      var xl = svgEl('text', { x: xAt(i), y: M.top + ph + 18, 'text-anchor': 'middle', fill: 'var(--muted)', 'font-size': 11 });
1716      xl.textContent = fmtPoint(ts[i].date);
1717      svg.appendChild(xl);
1718    }
1719
1720    var dLine = '', dArea = '';
1721    for (var j = 0; j < ts.length; j++) {
1722      var px = xAt(j), py = yAt(ts[j].value);
1723      dLine += (j ? ' L ' : 'M ') + px.toFixed(1) + ' ' + py.toFixed(1);
1724      dArea += (j ? ' L ' : 'M ') + px.toFixed(1) + ' ' + py.toFixed(1);
1725    }
1726    dArea += ' L ' + xAt(ts.length - 1).toFixed(1) + ' ' + zeroY.toFixed(1) +
1727             ' L ' + xAt(0).toFixed(1) + ' ' + zeroY.toFixed(1) + ' Z';
1728    svg.appendChild(svgEl('path', { d: dArea, fill: 'var(--series-wash)' }));
1729    svg.appendChild(svgEl('path', { d: dLine, fill: 'none', stroke: 'var(--series
1729)', 'stroke-width': 2, 'stroke-linejoin': 'round', 'stroke-linecap': 'round' }));
1730
1731    var cross = svgEl('line', { x1: 0, x2: 0, y1: M.top, y2: M.top + ph, stroke: 'var(--axis)', 'stroke-width': 1, visibility: 'hidden' });
1732    svg.appendChild(cross);
1733    var hoverDot = svgEl('circle', { r: 4.5, fill: 'var(--series)', stroke: 'var(--surface)', 'stroke-width': 2, visibility: 'hidden' });
1734    svg.appendChild(hoverDot);
1735
1736    var last = ts[ts.length - 1];
1737    svg.appendChild(svgEl('circle', { cx: xAt(ts.length - 1), cy: yAt(last.value), r: 4.5, fill: 'var(--series)', stroke: 'var(--surface)', 'stroke-width': 2 }));
1738    var endLbl = svgEl('text', { x: xAt(ts.length - 1) + 10, y: yAt(last.value) + 4, fill: 'var(--ink)', 'font-size': 12, 'font-weight': 600 });
1739    endLbl.textContent = fmtCompact(last.value);
1740    svg.appendChild(endLbl);
1741
1742    host.appendChild(svg);
1743    trendState.geom = { xAt: xAt, yAt: yAt, M: M, pw: pw, ph: ph, ts: ts, cross: cross, hoverDot: hoverDot, W: W };
1744
1745    host.setAttribute('aria-label',
1746      grain().adj + ' ' + cfg.kpi.name + ', ' + fmtPointFull(cfg.date_range.start) + ' to ' +
1747      fmtPointFull(cfg.date_range.end) + '. Latest value ' + fmtFull(last.value) +
1748      '. Use left and right arrow keys to inspect each ' + grain().one + '.');
1749  }
1750
1751  function showTrendTip(idx) {
1752    var g = trendState.geom;
1753    if (!g || idx < 0 || idx >= g.ts.length) return;
1754    trendState.activeIndex = idx;
1755    var pt = g.ts[idx];
1756    var host = document.getElementById('trend-chart');
1757    var card = host.closest('.card');
1758    var tip = document.getElementById('trend-tip');
1759
1760    var x = g.xAt(idx), y = g.yAt(pt.value);
1761    g.cross.setAttribute('x1', x); g.cross.setAttribute('x2', x);
1762    g.cross.setAttribute('visibility', 'visible');
1763    g.hoverDot.setAttribute('cx', x); g.hoverDot.setAttribute('cy', y);
1764    g.hoverDot.setAttribute('visibility', 'visible');
1765
1766    tip.textContent = '';
1767    tip.appendChild(el('div', 't-label', fmtPointFull(pt.date)));
1768    var row = el('div', 't-row');
1769    row.appendChild(el('span', 't-key'));
1770    row.appendChild(el('span', 't-val', fmtFull(pt.value)));
1771    tip.appendChild(row);
1772    tip.classList.add('show');
1773
1774    var hostRect = host.getBoundingClientRect();
1775    var cardRect = card.getBoundingClientRect();
1776    var scale = hostRect.width / g.W;
1777    var left = (hostRect.left - cardRect.left) + x * scale + 12;
1778    var top = (hostRect.top - cardRect.top) + y * scale - 10;
1779    if (left + 150 > cardRect.width) left -= 174;
1780    tip.style.left = left + 'px';
1781    tip.style.top = Math.max(4, top) + 'px';
1782  }
1783  function hideTrendTip() {
1784    trendState.activeIndex = -1;
1785    var g = trendState.geom;
1786    if (g) { g.cross.setAttribute('visibility', 'hidden'); g.hoverDot.setAttribute('visibility', 'hidden'); }
1787    document.getElementById('trend-tip').classList.remove('show');
1788  }
1789
1790  function wireTrendInteraction() {
1791    var host = document.getElementById('trend-chart');
1792    host.addEventListener('pointermove', function (e) {
1793      var g = trendState.geom;
1794      if (!g) return;
1795      var rect = host.getBoundingClientRect();
1796      var vx = (e.clientX - rect.left) * (g.W / rect.width);
1797      var idx = Math.round(((vx - g.M.left) / g.pw) * (g.ts.length - 1));
1798      showTrendTip(Math.max(0, Math.min(g.ts.length - 1, idx)));
1799    });
1800    host.addEventListener('pointerleave', hideTrendTip);
1801    host.addEventListener('keydown', function (e) {
1802      var g = trendState.geom;
1803      if (!g) return;
1804      var idx = trendState.activeIndex;
1805      if (e.key === 'ArrowRight') idx = idx < 0 ? g.ts.length - 1 : Math.min(g.ts.length - 1, idx + 1);
1806      else if (e.key === 'ArrowLeft') idx = idx < 0 ? g.ts.length - 1 : Math.max(0, idx - 1);
1807      else if (e.key === 'Escape') { hideTrendTip(); return; }
1808      else return;
1809      e.preventDefault();
1810      showTrendTip(idx);
1811    });
1812    host.addEventListener('blur', hideTrendTip);
1813  }
1814
1815  /* ---------- breakdown bars ---------- */
1816  function renderBars() {
1817    var wrap = document.getElementById('bars');
1818    wrap.textContent = '';
1819    var rows = data.breakdown;
1820    if (!rows.length) { wrap.textContent = 'No breakdown data.'; return; }
1821    var max = Math.max.apply(null, rows.map(function (r) { return Math.abs(r.value); })) || 1;
1822    var total = rows.reduce(function (s, r) { return s + r.value; }, 0);
1823    var tip = document.getElementById('bar-tip');
1824    var card = wrap.closest('.card');
1825
1826    rows.forEach(function (r) {
1827      var row = el('div', 'bar-row');
1828      row.setAttribute('tabindex', '0');
1829      var share = total ? (r.value / total) * 100 : 0;
1830      row.setAttribute('aria-label', r.key + ': ' + fmtFull(r.value) + ', ' + share.toFixed(1) + '% of total');
1831
1832      row.appendChild(el('div', 'bar-label', r.key));
1833      var track = el('div', 'bar-track');
1834      var fill = el('div', 'bar-fill');
1835      /* Negative values are rejected upstream; clamp so one can never
1836         invert the layout, and let the label carry the real number. */
1837      fill.style.width = Math.max(0.5, (Math.max(0, r.value) / max) * 100 * 0.82) + '%';
1838      track.appendChild(fill);
1839      track.appendChild(el('span', 'bar-value', fmtCompact(r.value)));
1840      row.appendChild(track);
1841
1842      function show() {
1843        tip.textContent = '';
1844        tip.appendChild(el('div', 't-label', r.key));
1845        var tr = el('div', 't-row');
1846        tr.appendChild(el('span', 't-key'));
1847        tr.appendChild(el('span', 't-val', fmtFull(r.value)));
1848        tr.appendChild(el('span', 't-sub', share.toFixed(1) + '%'));
1849        tip.appendChild(tr);
1850        tip.classList.add('show');
1851        var rowRect = row.getBoundingClientRect();
1852        var cardRect = card.getBoundingClientRect();
1853        tip.style.left = Math.min(rowRect.width * 0.45, cardRect.width - 170) + 'px';
1854        tip.style.top = (rowRect.top - cardRect.top - 8) + 'px';
1855      }
1856      function hide() { tip.classList.remove('show'); }
1857      row.addEventListener('pointerenter', show);
1858      row.addEventListener('pointerleave', hide);
1859      row.addEventListener('focus', show);
1860      row.addEventListener('blur', hide);
1861      wrap.appendChild(row);
1862    });
1863  }
1864
1865  /* ---------- table view ---------- */
1866  function renderTables() {
1867    var seriesBody = document.querySelector('#table-series tbody');
1868    seriesBody.textContent = '';
1869    data.timeseries.forEach(function (p) {
1870      var tr = document.createElement('tr');
1871      tr.appendChild(el('td', null, fmtPointFull(p.date)));
1872      tr.appendChild(el('td', 'num', fmtFull(p.value)));
1873      seriesBody.appendChild(tr);
1874    });
1875
1876    var bBody = document.querySelector('#table-breakdown tbody');
1877    bBody.textContent = '';
1878    var total = data.breakdown.reduce(function (s, r) { return s + r.value; }, 0);
1879    data.breakdown.forEach(function (r) {
1880      var tr = document.createElement('tr');
1881      tr.appendChild(el('td', null, r.key));
1882      tr.appendChild(el('td', 'num', fmtFull(r.value)));
1883      tr.appendChild(el('td', 'num', total ? ((r.value / total) * 100).toFixed(1) + '%' : '—'));
1884      bBody.appendChild(tr);
1885    });
1886  }
1887
1888  /* ---------- theme + logo (host-controlled chrome) ---------- */
1889  var ALLOWED_TOKENS = {
1890    '--page': 1, '--surface': 1, '--ink': 1, '--ink-2': 1, '--muted': 1,
1891    '--grid': 1, '--axis': 1, '--border': 1, '--series': 1, '--series-wash': 1,
1892    '--up': 1, '--down': 1, '--brand-accent-rule': 1
1893  };
1894  var COLOR_RE = /^(#[0-9a-fA-F]{3,8}|rgba?\\([\\d\\s.,%\\/]+\\)|hsla?\\([\\d\\s.,%\\/a-z]+\\))$/;
1895  var LOGO_RE = /^data:image\\/(png|jpeg|jpg|svg\\+xml);base64,[A-Za-z0-9+\\/=\\s]+$/;
1896  var LOGO_MAX_CHARS = 200000;
1897
1898  function applyTheme(m) {
1899    if (m.mode === 'light' || m.mode === 'dark') {
1900      document.documentElement.setAttribute('data-theme', m.mode);
1901    }
1902    if (m.tokens && typeof m.tokens === 'object') {
1903      for (var k in m.tokens) {
1904        var v = m.tokens[k];
1905        if (ALLOWED_TOKENS[k] === 1 && typeof v === 'string' && COLOR_RE.test(v.trim())) {
1906          document.documentElement.style.setProperty(k, v.trim());
1907        }
1908      }
1909    }
1910    if ('logo_data_uri' in m) applyLogo(m.logo_data_uri);
1911    renderTrend();  /* SVG reads tokens via var(); re-render to be certain */
1912  }
1913
1914  function applyLogo(uri) {
1915    var img = document.getElementById('brand-logo');
1916    if (typeof uri === 'string' && uri.length <= LOGO_MAX_CHARS && LOGO_RE.test(uri)) {
1917      img.src = uri;                       /* img.src ONLY — never innerHTML */
1918      img.alt = (cfg.engagement && cfg.engagement.label) ? cfg.engagement.label + ' logo' : 'Client logo';
1919      img.classList.add('show');
1920    } else {
1921      img.removeAttribute('src');
1922      img.classList.remove('show');
1923    }
1924  }
1925
1926  /* ---------- refresh protocol ---------- */
1927  var refreshing = false;
1928  var backstopTimer = null;
1929  var btn = document.getElementById('refresh-btn');
1930  var note = document.getElementById('refresh-note');
1931  var app = document.getElementById('app');
1932
1933  function isEmbedded() {
1934    try { return window.parent && window.parent !== window; } catch (e) { return true; }
1935  }
1936  function setRefreshing(on, message) {
1937    refreshing = on;
1938    btn.disabled = on;
1939    btn.textContent = on ? 'Refreshing…' : 'Refresh data';
1940    app.classList.toggle('refreshing', on);
1941    app.setAttribute('aria-busy', on ? 'true' : 'false');
1942    note.textContent = message || '';
1943    note.classList.toggle('show', !!message);
1944    if (!on && backstopTimer) { clearTimeout(backstopTimer); backstopTimer = null; }
1945  }
1946
1947  btn.addEventListener('click', function () {
1948    if (refreshing) return;
1949    if (!isEmbedded()) {
1950      setRefreshing(false, 'Live refresh is available when this dashboard is opened in Darwin.');
1951      return;
1952    }
1953    setRefreshing(true);
1954    post({ type: 'darwin:dashboard:refresh-request' });   /* no config: the stored row is the source of truth */
1955    backstopTimer = setTimeout(function () {
1956      setRefreshing(false, 'This is taking longer than expected. Try again, or ask Darwin in chat to refresh it.');
1957    }, PENDING_BACKSTOP_MS);
1958  });
1959
1960  function post(msg) {
1961    if (!isEmbedded()) return;
1962    msg.protocol_version = PROTOCOL_VERSION;
1963    msg.document_id = env.document_id || null;
1964    try { window.parent.postMessage(msg, '*'); } catch (e) { /* opaque origin: nothing to do */ }
1965  }
1966
1967  window.addEventListener('message', function (e) {
1968    /* Opaque origin means origin checks are useless; bind on source,
1969       document and protocol instead. Also stops a hostile page that
1970       embeds an exported copy from driving it. */
1971    if (e.source !== window.parent) return;
1972    var m = e.data;
1973    if (!m || typeof m !== 'object' || typeof m.type !== 'string') return;
1974    /* Presence AND equality: a message that simply omits these fields is
1975       rejected too, so the code matches the contract above. */
1976    if (m.protocol_version !== PROTOCOL_VERSION) return;
1977    if (env.document_id && m.document_id !== env.document_id) return;
1978
1979    if (m.type === 'darwin:dashboard:theme') { applyTheme(m); return; }
1980
1981    if (m.type === 'darwin:dashboard:error') {
1982      setRefreshing(false, typeof m.message === 'string' && m.message
1983        ? m.message
1984        : 'That refresh didn’t complete. Try again, or ask Darwin in chat.');
1985      return;
1986    }
1987
1988    if (m.type === 'darwin:dashboard:data') {
1989      var invalid = validateData(m.data);
1990      if (invalid) {
1991        setRefreshing(false, 'The refreshed data couldn’t be read, so the previous view is unchanged.');
1992        return;
1993      }
1994      data = sanitizeData(m.data);
1995      setRefreshing(false);
1996      renderAll();
1997      return;
1998    }
1999  });
2000
2001  /* ---------- boot ---------- */
2002  function renderAll() {
2003    renderHeader();
2004    renderTiles();
2005    renderTrend();
2006    renderBars();
2007    renderTables();
2008    hideTrendTip();
2009  }
2010  renderAll();
2011  wireTrendInteraction();
2012
2013  var resizeTimer = null;
2014  window.addEventListener('resize', function () {
2015    if (resizeTimer) clearTimeout(resizeTimer);
2016    resizeTimer = setTimeout(renderTrend, 150);
2017  });
2018
2019  post({
2020    type: 'darwin:dashboard:ready',
2021    template_id: env.template_id,
2022    template_version: env.template_version
2023  });
2024})();
2025<\/script>
2026</body>
2027</html>
2028`,bi={"datasource-tracker.html":vi,"kpi-overview.html":yi},_i=_r.templates.flatMap(l=>{const k=bi[l.file];return k===void 0?[]:[{id:l.id,version:l.version,name:l.name,description:l.description,html:k}]}),wi=l=>_i.find(k=>k.id===l),Ei="Refreshing this dashboard is not available yet. Ask Darwin in chat to rebuild it.",Ft="The refreshed data could not be loaded, so this view still shows the previous data. Try again, or ask Darwin in chat.",Mi=({documentId:l,versionId:k,content:i,brandColor:h,logoUrl:d,onRefreshRequest:n,onVersionLoaded:a,pendingVersionId:r,loadVersionContent:f})=>{const C=wr().palette.mode==="dark"?"dark":"light",A=ve.useRef(null),N=wi(i.templateId),[p,m]=ve.useState(()=>({documentId:l,html:N?It({templateHtml:N.html,content:i,documentId:l}):null}));p.documentId!==l&&m({documentId:l,html:N?It({templateHtml:N.html,content:i,documentId:l}):null});const g=ve.useRef(!1),S=ve.useRef([]),O=ve.useCallback(()=>{const w=A.current?.contentWindow;if(!w||!g.current)return;const q=S.current;S.current=[],q.forEach(Q=>w.postMessage(Q,"*"))},[]),v=ve.useCallback(w=>{S.current.push(w),O()},[O]);ve.useEffect(()=>{const w=q=>{const Q=A.current?.contentWindow;if(!Q||q.source!==Q)return;const I=gi(q.data,l);if(I){if(I.type==="darwin:dashboard:ready"){g.current=!0,O();return}if(!n){Q.postMessage(ot(l,Ei),"*");return}n(l)}};return window.addEventListener("message",w),()=>window.removeEventListener("message",w)},[l,O,n]);const _=ve.useRef(k),x=ve.useRef(null),b=ve.useRef(l);b.current!==l&&(b.current=l,g.current=!1,S.current=[],_.current=k,x.current=null);const[c,D]=ve.useState(null);ve.useEffect(()=>{let w=!1;return D(null),li(d).then(q=>{w||D(q)}).catch(()=>{}),()=>{w=!0}},[d]);const U=N?.id;return ve.useEffect(()=>{U!==void 0&&v(pi({documentId:l,mode:C,tokens:si({templateId:U,brandColor:h,mode:C}),logoDataUri:c}))},[h,l,c,C,v,U]),ve.useEffect(()=>{_.current!==k&&(_.current=k,v(Dt(l,i.data)))},[i.data,l,v,k]),ve.useEffect(()=>{let w=!1;const q=()=>{w=!0};if(!r||r===k||x.current===r)return q;x.current=r;const Q=I=>{x.current===I&&(x.current=null)};return f?(f(l,r).then(I=>{w||(_.current=r,v(Dt(l,I.data)),a?.(l,r,I))}).catch(()=>{Q(r),!w&&v(ot(l,Ft))}),q):(Q(r),v(ot(l,Ft)),q)},[l,f,a,r,v,k]),p.html===null?At.jsx(Er,{severity:"info",sx:{borderRadius:0,m:2},children:`This dashboard uses a template this version of the app doesn't have (${i.templateId}). Reload to pick up newer templates, or ask Darwin in chat to rebuild it.`}):At.jsx("iframe",{ref:A,sandbox:"allow-scripts",srcDoc:p.html,style:{border:0,display:"block",height:"100%",width:"100%"},title:`Dashboard: ${i.templateId}`},l)};export{Mi as DashboardView};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.