varhY=Object.create;varM6=Object.defineProperty;varmY=Object.getOwnPropertyDescriptor;vargY=Object.getOwnPropertyNames;varyY=Object.getPrototypeOf,vY=Object.prototype.hasOwnProperty;varC=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Dx=(n,e)=>{for(varline)M6(n,l,{get:e[l],enumerable:!0})},Lx=(n,e,l,t)=>{if(e&&typeofe=="object"||typeofe=="function")for(letrofgY(e))!vY.call(n,r)&&r!==l&&M6(n,r,{get:()=>e[r],enumerable:!(t=mY(e,r))||t.enumerable});returnn};varSt=(n,e,l)=>(l=n!=null?hY(yY(n)):{},Lx(e||!n||!n.__esModule?M6(l,"default",{value:n,enumerable:!0}):l,n)),_Y=n=>Lx(M6({},"__esModule",{value:!0}),n);varMx=C((vbe,Fx)=>{"use strict";functionEY(n){vare=newn,l=e;functiont(){vari=e;returni.next?e=i.next:(e=newn,l=e),i.next=null,i}functionr(i){l.next=i,l=i}return{get:t,release:r}}Fx.exports=EY});varDp=C((_be,Pp)=>{"use strict";varbY=Mx();function$x(n,e,l){if(typeofn=="function"&&(l=e,e=n,n=null),!(l>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");vart=bY(TY),r=null,i=null,s=0,u=null,a={push:_,drain:m3,saturated:m3,pause:f,paused:!1,getconcurrency(){returnl},setconcurrency(w){if(!(w>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");if(l=w,!a.paused)for(;r&&s<l;)s++,T()},running:c,resume:h,idle:g,length:p,getQueue:m,unshift:S,empty:m3,kill:x,killAndDrain:v,error:b};returna;functionc(){returns}functionf(){a.paused=!0}functionp(){for(varw=r,N=0;w;)w=w.next,N++;returnN}functionm(){for(varw=r,N=[];w;)N.push(w.value),w=w.next;returnN}functionh(){if(a.paused)for(a.paused=!1;r&&s<l;)s++,T()}functiong(){returns===0&&a.length()===0}function_(w,N){varO=t.get();O.context=n,O.release=T,O.value=w,O.callback=N||m3,O.errorHandler=u,s>=l||a.paused?i?(i.next=O,i=O):(r=O,i=O,a.saturated()):(s++,e.call(n,O.value,O.worked))}functionS(w,N){varO=t.get();O.context=n,O.release=T,O.value=w,O.callback=N||m3,O.errorHandler=u,s>=l||a.paused?r?(O.next=r,r=O):(r=O,i=O,a.saturated()):(s++,e.call(n,O.value,O.worked))}functionT(w){w&&t.release(w);varN=r;N&&s<=l?a.paused?s--:(i===r&&(i=null),r=N.next,N.next=null,e.call(n,N.value,N.worked),i===null&&a.empty()):--s===0&&a.drain()}functionx(){r=null,i=null,a.drain=m3}functionv(){r=null,i=null,a.drain(),a.drain=m3}functionb(w){u=w}}functionm3(){}functionTY(){this.value=null,this.callback=m3,this.next=null,this.release=m3,this.context=null,this.errorHandler=null;varn=this;this.worked=function(l,t){varr=n.callback,i=n.errorHandler,s=n.value;n.value=null,n.callback=m3,n.errorHandler&&i(l,s),r.call(n.context,l,t),n.release(n)}}functionSY(n,e,l){typeofn=="function"&&(l=e,e=n,n=null);functiont(f,p){e.call(this,f).then(function(m){p(null,m)},p)}varr=$x(n,t,l),i=r.push,s=r.unshift;returnr.push=u,r.unshift=a,r.drained=c,r;functionu(f){varp=newPromise(function(m,h){i(f,function(g,_){if(g){h(g);return}m(_)})});returnp.catch(m3),p}functiona(f){varp=newPromise(function(m,h){s(f,function(g,_){if(g){h(g);return}m(_)})});returnp.catch(m3),p}functionc(){if(r.idle())returnnewPromise(function(m){m()});varf=r.drain,p=newPromise(function(m){r.drain=function(){f(),m()}});returnp}}Pp.exports=$x;Pp.exports.promise=SY});varFp=C((Ebe,jx)=>{"use strict";var{inherits:xY,format:Lp}=require("util");functionou(n,e,l=Error){if(!n)thrownewError("Avvio error code must not be empty");if(!e)thrownewError("Avvio base error message must not be empty");functiont(r,i,s){if(!new.target)returnnewt(r,i,s);Error.captureStackTrace(this,t),this.code=n,this.message=e,this.name="AvvioError",r&&i&&s?this.message=Lp(e,r,i,s):r&&i?this.message=Lp(e,r,i):r?this.message=Lp(e,r):this.message=e}returnt.prototype[Symbol.toStringTag]="Error",t.prototype.toString=function(){return`${this.name} [${this.code}]: ${this.message}`},xY(t,l),t}jx.exports={createError:ou,AVV_ERR_EXPOSE_ALREADY_DEFINED:ou("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' () is already defined, specify an expose option"),AVV_ERR_CALLBACK_NOT_FN:ou("AVV_ERR_CALLBACK_NOT_FN","Callback for '%s' hook is not a function. Received: '%s'"),AVV_ERR_PLUGIN_NO
deps:${l}}`};var Sie={keyword:"dependencies",type:"object",schemaType:"object",error:_r.error,code(n){let[e,l]=xie(n);XN(n,e),WN(n,l)}};function xie({schema:n}){let e={},l={};for(let t in n){if(t==="__proto__")continue;let r=Array.isArray(n[t])?e:l;r[t]=n[t]}return[e,l]}function XN(n,e=n.schema){let{gen:l,data:t,it:r}=n;if(Object.keys(e).length===0)return;let i=l.let("missing");for(let s in e){let u=e[s];if(u.length===0)continue;let a=(0,k0.propertyInData)(l,t,s,r.opts.ownProperties);n.setParams({property:s,depsCount:u.length,deps:u.join(", ")}),r.allErrors?l.if(a,()=>{for(let c of u)(0,k0.checkReportMissingProp)(n,c)}):(l.if((0,Sm._)`${a}&&(${(0,k0.checkMissingProp)(n,u,i)})`),(0,k0.reportMissingProp)(n,i),l.else())}}_r.validatePropertyDeps=XN;function WN(n,e=n.schema){let{gen:l,data:t,keyword:r,it:i}=n,s=l.name("valid");for(let u in e)(0,Tie.alwaysValidSchema)(i,e[u])||(l.if((0,k0.propertyInData)(l,t,u,i.opts.ownProperties),()=>{let a=n.subschema({keyword:r,schemaProp:u},s);n.mergeValidEvaluated(a,s)},()=>l.var(s,!0)),n.ok(s))}_r.validateSchemaDeps=WN;_r.default=Sie});var JN=C(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var YN=Ze(),Aie=En(),wie={message:"property name must be valid",params:({params:n})=>(0,YN._)`{propertyName:${n.propertyName}}`},Rie={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:wie,code(n){let{gen:e,schema:l,data:t,it:r}=n;if((0,Aie.alwaysValidSchema)(r,l))return;let i=e.name("valid");e.forIn("key",t,s=>{n.setParams({propertyName:s}),n.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),e.if((0,YN.not)(i),()=>{n.error(!0),r.allErrors||e.break()})}),n.ok(i)}};xm.default=Rie});var wm=C(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var H8=Wt(),V3=Ze(),Oie=v3(),q8=En(),Nie={message:"must NOT have additional properties",params:({params:n})=>(0,V3._)`{additionalProperty:${n.additionalProperty}}`},Iie={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Nie,code(n){let{gen:e,schema:l,parentSchema:t,data:r,errsCount:i,it:s}=n;if(!i)throw new Error("ajv implementation error");let{allErrors:u,opts:a}=s;if(s.props=!0,a.removeAdditional!=="all"&&(0,q8.alwaysValidSchema)(s,l))return;let c=(0,H8.allSchemaProperties)(t.properties),f=(0,H8.allSchemaProperties)(t.patternProperties);p(),n.ok((0,V3._)`${i}===${Oie.default.errors}`);function p(){e.forIn("key",r,S=>{!c.length&&!f.length?g(S):e.if(m(S),()=>g(S))})}function m(S){let T;if(c.length>8){let x=(0,q8.schemaRefOrVal)(s,t.properties,"properties");T=(0,H8.isOwnProperty)(e,x,S)}else c.length?T=(0,V3.or)(...c.map(x=>(0,V3._)`${S}===${x}`)):T=V3.nil;return f.length&&(T=(0,V3.or)(T,...f.map(x=>(0,V3._)`${(0,H8.usePattern)(n,x)}.test(${S})`))),(0,V3.not)(T)}function h(S){e.code((0,V3._)`delete${r}[${S}]`)}function g(S){if(a.removeAdditional==="all"||a.removeAdditional&&l===!1){h(S);return}if(l===!1){n.setParams({additionalProperty:S}),n.error(),u||e.break();return}if(typeof l=="object"&&!(0,q8.alwaysValidSchema)(s,l)){let T=e.name("valid");a.removeAdditional==="failing"?(_(S,T,!1),e.if((0,V3.not)(T),()=>{n.reset(),h(S)})):(_(S,T),u||e.if((0,V3.not)(T),()=>e.break()))}}function _(S,T,x){let v={keyword:"additionalProperties",dataProp:S,dataPropType:q8.Type.Str};x===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(v,T)}}};Am.default=Iie});var eI=C(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});var Cie=Za(),QN=Wt(),Rm=En(),ZN=wm(),kie={keyword:"properties",type:"object",schemaType:"object",code(n){let{gen:e,schema:l,parentSchema:t,data:r,it:i}=n;i.opts.removeAdditional==="all"&&t.additionalProperties===void 0&&ZN.default.code(new Cie.KeywordCxt(i,ZN.default,"additionalProperties"));let s=(0,QN.allSchemaProperties)(l);for(let p of s)i.definedProperties.add(p);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Rm.mergeEvaluated.props(e,(0,Rm.toHash)(s),i.props));let u=s.filter(p=>!(0,Rm.alwaysValidSchema)(i,l[p]));if(u.le
`;let u=new J1e(e),a=new Q1e(e.ajv);for(let f of l.validatorSchemasIds){let p=l.refResolver.getSchema(f);a.addSchema(p,f);let m=l.refResolver.getSchemaDependencies(f);for(let[h,g]of Object.entries(m))a.addSchema(g,h)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:a,serializer:u,code:`validator
${s}`,ajv:a.ajv};let c=new Function("validator","serializer",s);return e.mode==="standalone"?tg()(c,l,u,a):c(a,u)}var n5e=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],l5e=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],t5e=["maxLength","minLength","pattern"],r5e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function TD(n){for(var e of n5e)if(e in n)return"object";for(var e of l5e)if(e in n)return"array";for(var e of t5e)if(e in n)return"string";for(var e of r5e)if(e in n)return"number";return n.type}function i5e(n,e){let l=e.schema,t=Object.keys(l.properties||{}),r=`
`,r}function s5e(n,e){let l="",t=e.schema,r=t.required||[],i=e.getPropertyLocation("properties"),s=[],u=[];if(t.properties)for(let c of Object.keys(t.properties)){if(r.indexOf(c)===-1)continue;let f=i.getPropertyLocation(c);f.schema.$ref&&(f=yo(n,e,f.schema.$ref));let p=JSON.stringify(c);f.schema.default===void 0&&(l+=`if(obj[${p}]===undefined)thrownewError('${p} is required!')
`;let a=n.wrapObjects;if(n.wrapObjects=!0,t.properties)for(let c of Object.keys(t.properties)){let f=i.getPropertyLocation(c);f.schema.$ref&&(f=yo(n,e,f.schema.$ref));let p=JSON.stringify(c);if(u.indexOf(c)!==-1)l+=`
${e}`)}function W9(n,e,l,t){if((n.isLeafNode||t.commonPrefix!==!1)&&(l=l||"(empty root node)",e=e[l]={},n.isLeafNode&&(e[AF]=o9e(n,l,t)),l=""),n.staticChildren)for(let r of Object.values(n.staticChildren))W9(r,e,l+r.prefix,t);if(n.parametricChildren)for(let r of Object.values(n.parametricChildren)){let i=Array.from(r.nodePaths).join("|");W9(r,e,l+i,t)}n.wildcardChild&&W9(n.wildcardChild,e,"*",t)}function c9e(n,e){let l={};return W9(n,l,n.prefix,e),wF(l)}OF.exports={prettyPrintTree:c9e}});var CF=C((zAe,IF)=>{"use strict";var f9e=X9(),tv=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,l){let t=l.params,r=l.opts.constraints||{},i={params:t,constraints:r,handler:l.handler,store:l.store||null,_createParamsObject:this._compileCreateParamsObject(t)},s=Object.keys(r);s.length===0&&(this.unconstrainedHandler=i);for(let a of s)this.constraints.includes(a)||(a==="version"?this.constraints.unshift(a):this.constraints.push(a));let u=s.includes(f9e.name);if(!u&&this.handlers.length>=32)throw new Error("find-my-way supports a maximum of 32 route handlers per node when there are constraints, limit reached");this.handlers.push(i),this.handlers.sort((a,c)=>Object.keys(a.constraints).length-Object.keys(c.constraints).length),u||this._compileGetHandlerMatchingConstraints(e,r)}_compileCreateParamsObject(e){let l=[];for(let t=0;t<e.length;t++)l.push(`'${e[t]}':paramsArray[${t}]`);return new Function("paramsArray",`return{${l.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,l){for(let t=0;t<this.handlers.length;t++){let i=this.handlers[t].constraints[l];if(i!==void 0){let s=e.get(i)||0;s|=1<<t,e.set(i,s)}}}_constrainedIndexBitmask(e){let l=0;for(let t=0;t<this.handlers.length;t++)this.handlers[t].constraints[e]!==void 0&&(l|=1<<t);return~l}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let t of this.constraints){let r=e.newStoreForConstraint(t);this.constrainedHandlerStores[t]=r,this._buildConstraintStore(r,t)}let l=[];l.push(`
`)}for(let t in e.strategies)e.strategies[t].mustMatchWhenDerived&&!this.constraints.includes(t)&&l.push(`if(derivedConstraints.${t}!==undefined)returnnull`);l.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",l.join(`
`))}};IF.exports=tv});var PF=C((GAe,kF)=>{"use strict";var p9e=CF(),e7={STATIC:0,PARAMETRIC:1,WILDCARD:2},K9=class{constructor(){this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}addRoute(e,l){this.routes===null&&(this.routes=[]),this.handlerStorage===null&&(this.handlerStorage=new p9e),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(l,e)}},Y9=class extends K9{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,l){let t=this.staticChildren[e.charAt(l)];return t===void 0||!t.matchPrefix(e,l)?null:t}getStaticChild(e,l=0){if(e.length===l)return this;let t=this.findStaticMatchingChild(e,l);return t?t.getStaticChild(e,l+t.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let l=this.staticChildren[e.charAt(0)];if(l){let r=1;for(;r<l.prefix.length;r++)if(e.charCodeAt(r)!==l.prefix.charCodeAt(r)){l=l.split(this,r);break}return l.createStaticChild(e.slice(r))}let t=e.charAt(0);return this.staticChildren[t]=new J9(e),this.staticChildren[t]}},J9=class n extends Y9{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=e7.STATIC,this._compilePrefixMatch()}getParametricChild(e){let l=e&&e.source,t=this.parametricChildren.find(r=>(r.regex&&r.regex.source)===l);return t||null}createParametricChild(e,l,t){let r=this.getParametricChild(e);return r?(r.nodePaths.add(t),r):(r=new Q9(e,l,t),this.parametricChildren.push(r),this.parametricChildren.sort((i,s)=>i.isRegex?s.isRegex?i.staticSuffix===null?1:s.staticSuffix===null?-1:s.staticSuffix.endsWith(i.staticSuffix)?1:i.staticSuffix.endsWith(s.staticSuffix)?-1:0:-1:1),r)}getWildcardChild(){return this.wildcardChild?this.wildcardChild:null}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new Z9,this.wildcardChild}split(e,l){let t=this.prefix.slice(0,l),r=this.prefix.slice(l);this.prefix=r,this._compilePrefixMatch();let i=new n(t);return i.staticChildren[r.charAt(0)]=this,e.staticChildren[t.charAt(0)]=i,i}getNextNode(e,l,t,r){let i=this.findStaticMatchingChild(e,l),s=0;if(i===null){if(this.parametricChildren.length===0)return this.wildcardChild;i=this.parametricChildren[0],s=1}this.wildcardChild!==null&&t.push({paramsCount:r,brotherPathIndex:l,brotherNode:this.wildcardChild});for(let u=this.parametricChildren.length-1;u>=s;u--)t.push({paramsCount:r,brotherPathIndex:l,brotherNode:this.parametricChildren[u]});return i}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let l=1;l<this.prefix.length;l++){let t=this.prefix.charCodeAt(l);e.push(`path.charCodeAt(i+${l})===${t}`)}this.matchPrefix=new Function("path","i",`return${e.join(" && ")}`)}},Q9=class extends Y9{constructor(e,l,t){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=l||null,this.kind=e7.PARAMETRIC,this.nodePaths=new Set([t])}getNextNode(e,l){return this.findStaticMatchingChild(e,l)}},Z9=class extends K9{constructor(){super(),this.kind=e7.WILDCARD}getNextNode(){return null}};kF.exports={StaticNode:J9,ParametricNode:Q9,WildcardNode:Z9,NODE_TYPES:e7}});var LF=C((XAe,DF)=>{"use strict";var d9e=require("assert");function h1(){if(!(this instanceof h1))return new h1;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}h1.prototype.set=function(n,e){if(typeof n!="string")throw new TypeError("Version should be a string");let[l,t,r]=n.split(".");return l=Number(l)||0,t=Number(t)||0,r=Number(r)||0,l>=this.maxMajor&&(this.maxMajor=l,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),t>=(this.maxMinors[l]||0)&&(this.maxMinors[l]=t,this.store[`${l}.x`]=e,this.store[`${l}.x.x`]=e),r>=(this.store[`${l}.${t}`]||0)&&(this.maxPatches[`${l}.${t}`]=r,this.store[`${l}.${t}.x`]=e),this.store[`${l}.${t}.${r}`]=e,this};h1.prototype.get=function(n){return this.store[n]};DF.exports={name:"version",mustMatchWhenDerived:!0,storage:h1,validate(n){d9e(typeof n=="string","Version should be a string")}}});var MF=C((WAe,FF)=>{"use strict";var h9e=require("assert");function m9e(){let n={},e=[];return{get:l=>{let t=n[l];if(t)return t;for
`)).bind(this)}};$F.exports=iv});var BF=C((YAe,UF)=>{"use strict";var v9e=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];UF.exports=v9e});var VF=C((JAe,qF)=>{"use strict";function HF(n,e){return n===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:n===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:n===52&&e===48?"@":null}function _9e(n,e){let l=!1,t=!1,r="";for(let s=1;s<n.length;s++){let u=n.charCodeAt(s);if(u===37){let a=n.charCodeAt(s+1),c=n.charCodeAt(s+2);HF(a,c)===null?l=!0:(t=!0,a===50&&c===53&&(l=!0,n=n.slice(0,s+1)+"25"+n.slice(s+1),s+=2),s+=2)}else if(u===63||u===35||u===59&&e){r=n.slice(s+1),n=n.slice(0,s);break}}return{path:l?decodeURI(n):n,querystring:r,shouldDecodeParam:t}}function E9e(n){let e=n.indexOf("%");if(e===-1)return n;let l="",t=e;for(let r=e;r<n.length;r++)if(n.charCodeAt(r)===37){let i=n.charCodeAt(r+1),s=n.charCodeAt(r+2),u=HF(i,s);l+=n.slice(t,r)+u,t=r+3}return n.slice(0,e)+l+n.slice(t)}qF.exports={safeDecodeURI:_9e,safeDecodeURIComponent:E9e}});var fv=C((QAe,JF)=>{"use strict";var ct=require("assert"),b9e=fF(),n7=bF(),av=Ja(),{prettyPrintTree:T9e}=NF(),{StaticNode:zF,NODE_TYPES:sv}=PF(),S9e=jF(),Io=BF(),uv=X9(),{safeDecodeURI:x9e,safeDecodeURIComponent:GF}=VF(),XF=/^https?:\/\/.*?\//,Fu=/(\/:[^/()]*?)\?(\/?)/;if(!n7(XF))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!n7(Fu))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function Gl(n){if(!(this instanceof Gl))return new Gl(n);n=n||{},this._opts=n,n.defaultRoute?(ct(typeof n.defaultRoute=="function","The default route must be a function"),this.defaultRoute=n.defaultRoute):this.defaultRoute=null,n.onBadUrl?(ct(typeof n.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=n.onBadUrl):this.onBadUrl=null,n.buildPrettyMeta?(ct(typeof n.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=n.buildPrettyMeta):this.buildPrettyMeta=A9e,n.querystringParser?(ct(typeof n.querystringParser=="function","querystringParser must be a function"),this.querystringParser=n.querystringParser):this.querystringParser=e=>e===""?{}:b9e.parse(e),this.caseSensitive=n.caseSensitive===void 0?!0:n.caseSensitive,this.ignoreTrailingSlash=n.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=n.ignoreDuplicateSlashes||!1,this.maxParamLength=n.maxParamLength||100,this.allowUnsafeRegex=n.allowUnsafeRegex||!1,this.constrainer=new S9e(n.constraints),this.useSemicolonDelimiter=n.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}Gl.prototype.on=function(e,l,t,r,i){typeof t=="function"&&(r!==void 0&&(i=r),r=t,t={}),ct(typeof l=="string","Path should be a string"),ct(l.length>0,"The path could not be empty"),ct(l[0]==="/"||l[0]==="*","The first character of a path should be `/` or `*`"),ct(typeof r=="function","Handler should be a function");let s=l.match(Fu);if(s){ct(l.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let c=l.replace(Fu,"$1$2"),f=l.replace(Fu,"$2");this.on(e,c,t,r,i),this.on(e,f,t,r,i);return}let u=l;this.ignoreDuplicateSlashes&&(l=ov(l)),this.ignoreTrailingSlash&&(l=cv(l));let a=Array.isArray(e)?e:[e];for(let c of a)ct(typeof c=="string","Method should be a string"),ct(Io.includes(c),`Method'${c}'isnotanhttpmethod.`),this._on(c,l,t,r,i,u)};Gl.prototype._on=function(e,l,t,r,i){let s={};t.constraints!==void 0&&(ct(typeof t.constraints=="object"&&t.constraints!==null,"Constraints should be an object"),Object.keys(t.constraints).length!==0&&(s=t.constraints)),this.constrainer.validateConstraints(s),this.constrainer.noteUsage(s),this.trees[e]===void 0&&(this.trees[e]=new zF("/"));let u=l;if(u==="*"&&this.trees[e].prefix.length!==0){let m=this.trees[e]
`;Jn.DEFAULT_CONTENT_TYPE="application/octet-stream";Jn.prototype.append=function(n,e,l){l=l||{},typeof l=="string"&&(l={filename:l});var t=mb.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),Tz.isArray(e)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(n,e,l),i=this._multiPartFooter();t(r),t(e),t(i),this._trackLength(r,e,l)};Jn.prototype._trackLength=function(n,e,l){var t=0;l.knownLength!=null?t+=+l.knownLength:Buffer.isBuffer(e)?t=e.length:typeof e=="string"&&(t=Buffer.byteLength(e)),this._valueLength+=t,this._overheadLength+=Buffer.byteLength(n)+Jn.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof Qve))&&(l.knownLength||this._valuesToMeasure.push(e))};Jn.prototype._lengthRetriever=function(n,e){n.hasOwnProperty("fd")?n.end!=null&&n.end!=1/0&&n.start!=null?e(null,n.end+1-(n.start?n.start:0)):Jve.stat(n.path,function(l,t){var r;if(l){e(l);return}r=t.size-(n.start?n.start:0),e(null,r)}):n.hasOwnProperty("httpVersion")?e(null,+n.headers["content-length"]):n.hasOwnProperty("httpModule")?(n.on("response",function(l){n.pause(),e(null,+l.headers["content-length"])}),n.resume()):e("Unknown stream")};Jn.prototype._multiPartHeader=function(n,e,l){if(typeof l.header=="string")return l.header;var t=this._getContentDisposition(e,l),r=this._getContentType(e,l),i="",s={"Content-Disposition":["form-data",'name="'+n+'"'].concat(t||[]),"Content-Type":[].concat(r||[])};typeof l.header=="object"&&hb(s,l.header);var u;for(var a in s)s.hasOwnProperty(a)&&(u=s[a],u!=null&&(Array.isArray(u)||(u=[u]),u.length&&(i+=a+": "+u.join("; ")+Jn.LINE_BREAK)));return"--"+this.getBoundary()+Jn.LINE_BREAK+i+Jn.LINE_BREAK};Jn.prototype._getContentDisposition=function(n,e){var l,t;return typeof e.filepath=="string"?l=pb.normalize(e.filepath).replace(/\\/g,"/"):e.filename||n.name||n.path?l=pb.basename(e.filename||n.name||n.path):n.readable&&n.hasOwnProperty("httpVersion")&&(l=pb.basename(n.client._httpMessage.path||"")),l&&(t='filename="'+l+'"'),t};Jn.prototype._getContentType=function(n,e){var l=e.contentType;return!l&&n.name&&(l=db.lookup(n.name)),!l&&n.path&&(l=db.lookup(n.path)),!l&&n.readable&&n.hasOwnProperty("httpVersion")&&(l=n.headers["content-type"]),!l&&(e.filepath||e.filename)&&(l=db.lookup(e.filepath||e.filename)),!l&&typeof n=="object"&&(l=Jn.DEFAULT_CONTENT_TYPE),l};Jn.prototype._multiPartFooter=function(){return function(n){var e=Jn.LINE_BREAK,l=this._streams.length===0;l&&(e+=this._lastBoundary()),n(e)}.bind(this)};Jn.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Jn.LINE_BREAK};Jn.prototype.getHeaders=function(n){var e,l={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in n)n.hasOwnProperty(e)&&(l[e.toLowerCase()]=n[e]);return l};Jn.prototype.setBoundary=function(n){this._boundary=n};Jn.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Jn.prototype.getBuffer=function(){for(var n=new Buffer.alloc(0),e=this.getBoundary(),l=0,t=this._streams.length;l<t;l++)typeof this._streams[l]!="function"&&(Buffer.isBuffer(this._streams[l])?n=Buffer.concat([n,this._streams[l]]):n=Buffer.concat([n,Buffer.from(this._streams[l])]),(typeof this._streams[l]!="string"||this._streams[l].substring(2,e.length+2)!==e)&&(n=Buffer.concat([n,Buffer.from(Jn.LINE_BREAK)])));return Buffer.concat([n,Buffer.from(this._lastBoundary())])};Jn.prototype._generateBoundary=function(){for(var n="--------------------------",e=0;e<24;e++)n+=Math.floor(Math.random()*10).toString(16);this._boundary=n};Jn.prototype.getLengthSync=function(){var n=this._overheadLength+this._valueLength;return this._streams.length&&(n+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),n};Jn.prototype.hasKnownLength=function(){var n=!0;return this._valuesToMeasure.length&&(n=!1),n};Jn.prototype.getLength=function(n){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure
`,p.message,p.stack);var m=new Error("tunneling socket could not be established, cause="+p.message);m.code="ECONNRESET",e.request.emit("error",m),t.removeSocket(r)}};Ii.prototype.removeSocket=function(e){var l=this.sockets.indexOf(e);if(l!==-1){this.sockets.splice(l,1);var t=this.requests.shift();t&&this.createSocket(t,function(r){t.request.onSocket(r)})}};function RG(n,e){var l=this;Ii.prototype.createSocket.call(l,n,function(t){var r=n.request.getHeader("host"),i=Yb({},l.options,{socket:t,servername:r?r.replace(/:.*$/,""):n.host}),s=J_e.connect(0,i);l.sockets[l.sockets.indexOf(t)]=s,e(s)})}function OG(n,e,l){return typeof n=="string"?{host:n,port:e,localAddress:l}:n}function Yb(n){for(var e=1,l=arguments.length;e<l;++e){var t=arguments[e];if(typeof t=="object")for(var r=Object.keys(t),i=0,s=r.length;i<s;++i){var u=r[i];t[u]!==void 0&&(n[u]=t[u])}}return n}var Os;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?Os=function(){var n=Array.prototype.slice.call(arguments);typeof n[0]=="string"?n[0]="TUNNEL: "+n[0]:n.unshift("TUNNEL:"),console.error.apply(console,n)}:Os=function(){};N4.debug=Os});var CG=C((Cke,IG)=>{IG.exports=NG()});var EW=C(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.removeTrailingChar=ha.merge=void 0;var ZEe=(...n)=>{let e={};return n.forEach(function(l){var t;for(t in l)t in e&&e[t]===null?e[t]=l[t]:t in e&&Array.isArray(e[t])?e[t]=e[t].concat(l[t]):t in e&&typeof e[t]=="object"?e[t]=(0,ha.merge)(e[t],l[t]):e[t]=l[t]}),e};ha.merge=ZEe;var ebe=(n,e)=>n.length>1&&n.endsWith(e)?n.substring(0,n.length-1):n;ha.removeTrailingChar=ebe});var C4=C(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.DataError=Gs.DatabaseError=Gs.NestedError=void 0;var z5=class extends Error{inner;id;constructor(e,l,t){super(e),this.inner=t,this.id=l,this.name=this.constructor.name}toString(){let e=this.name+": "+this.message;return this.inner?e+`:
`+this.inner:e}};Gs.NestedError=z5;var AT=class extends z5{};Gs.DatabaseError=AT;var wT=class extends z5{};Gs.DataError=wT});var CT=C(I2=>{"use strict";Object.defineProperty(I2,"__esModule",{value:!0});I2.getArrayIndicies=I2.validateArrayIndex=I2.validateArrayIndicies=I2.isInt=I2.ArrayInfo=I2.arrayRegex=void 0;var Rf=C4(),nbe=()=>/^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;I2.arrayRegex=nbe;var RT={},OT=class n{property;index=0;append=!1;indicies=[];constructor(e,l){this.property=e;let t=l[0]??0;if(this.append=t===""||l[l.length-1]==="",this.indicies=l,NT(t))this.index=parseInt(t);else if(!this.append)throw new Rf.DataError("Only numerical values accepted for array index",200)}static processArray(e){if(typeof e>"u")return null;if(RT[e])return RT[e];let t=(0,I2.arrayRegex)().exec(e.trim());if(t!=null){let r=t[1],i="["+t[2].toString()+"]",s=IT(i);return bW(s),RT[e]=new n(r,s)}return null}getIndex(e,l){if(this.append)return-1;let t=this.index;if(t==-1){let r=l?e:e[this.property];return r.length===0?0:r.length-1}return t}getData(e){if(this.append)throw new Rf.DataError("Can't get data when appending",100);let{index:l,dataForProperty:t}=this.getArrayDataAndIndexFromProperty(e);return t[l]}setData(e,l){if(this.append){let t=e[this.property];this.indicies.forEach(r=>{r!==""&&(r=+r,r===-1&&(r=t.length-1),t=t[+r])}),t.push(l)}else{let{index:t,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);t===-1?r.push(l):r[t]=l}}delete(e){if(this.append)throw new Rf.DataError("Can't delete an appended data",10);let{index:l,dataForProperty:t}=this.getArrayDataAndIndexFromProperty(e);t.splice(l,1)}isValid(e){let{index:l,dataForProperty:t}=this.getArrayDataAndIndexFromProperty(e);return t.hasOwnProperty(l)}getArrayDataAndIndexFromProperty(e){let l=0,t=e instanceof Array?e:e[this.property]??e;if(this.indicies.length>0){l=+this.indicies[this.indicies.length-1];for(let r=0;r<this.indicies.length-1;r++){let i=+this.indicies[r];i===-1&&(i=t.length-1),t=t[i]}l===-1&&(l=t.length-1)}return{index:l,dataForProperty:t}}isMultiDimensional(){return this.indicies.length>1}};I2.ArrayInfo=OT;function NT(n){return!isNaN(n)&&Number(n)==n&&!isNaN(parseInt(n,10))}I2.isInt=NT;function bW(n){let e=n.filter(l=>l==="");if(e.length>1)throw Error("Only one append index is supported for nested arrays");if(e.length===1&&n[n.length-1]!=="")throw Error("Append index must be at the end of the nested array")}I2.validateArrayIndicies=bW;function TW(n){if(n.length!==0&&!NT(n))throw new Rf.DataError("Only numerical values accepted for array index",200)}I2.validateArrayIndex=TW;function IT(n){if(n.length===0)return[];if(n.charAt(0)!=="[")throw new Error("Invalid array syntax detected");let e=n.substring(1,n.indexOf("]"));TW(e);let l=e.length+2;return[e,...IT(n.substring(l))]}I2.getArrayIndicies=IT});var AW=C(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.DBParentData=void 0;var SW=CT(),xW=C4(),kT=class{parent;data;db;dataPath;constructor(e,l,t,r){this.parent=r,this.data=e,this.db=l,this.dataPath=t}checkArray(e=!1){let l=SW.ArrayInfo.processArray(this.parent);if(l&&(!l.append||e)&&!l.isValid(this.data))throw new xW.DataError("DataPath: /"+this.dataPath+". Can't find index "+l.index+" in array "+l.property,10);return l}getData(){if(this.parent===void 0)return this.data;let e=this.checkArray();return e?e.getData(this.data):this.data[this.parent]}setData(e){if(this.parent===void 0){this.db.resetData(e);return}let l=SW.ArrayInfo.processArray(this.parent);if(l){if(!this.data.hasOwnProperty(l.property))this.data[l.property]=[];else if(!Array.isArray(this.data[l.property]))throw new xW.DataError("DataPath: /"+this.dataPath+". "+l.property+" is not an array.",11);l.setData(this.data,e)}else this.data[this.parent]=e}delete(){if(this.parent===void 0){this.db.resetData({});return}let e=this.checkArray(!0);e?e.delete(this.data):delete this.data[this.parent]}};Of.DBParentData=kT});var RW=C((YDe,wW)=>{wW.exports=function(){"use strict";function n(){this.readers=0,this.queue=[]}function e(i,s,u){var a;typeof i!="function"?(r.hasOwnProperty(i)
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},Yj={};function Jj(n,e){var l=e.getSiblings(n);return l.length<=1||(n=l.indexOf(n))<0||n===l.length-1?[]:l.slice(n+1).filter(e.isTag)}function m_(n){return{xmlMode:!!n.xmlMode,lowerCaseAttributeNames:!!n.lowerCaseAttributeNames,lowerCaseTags:!!n.lowerCaseTags,quirksMode:!!n.quirksMode,cacheResults:!!n.cacheResults,pseudos:n.pseudos,adapter:n.adapter,equals:n.equals}}var Gv=(n,e,l,t,r)=>{let i=r(e,m_(l),t);return i===wn.trueFunc?n:i===wn.falseFunc?wn.falseFunc:s=>i(s)&&n(s)},Xv={is:Gv,matches:Gv,where:Gv,not(n,e,l,t,r){let i=r(e,m_(l),t);return i===wn.falseFunc?n:i===wn.trueFunc?wn.falseFunc:s=>!i(s)&&n(s)},has(n,e,l,t,r){let i=l.adapter,s=m_(l),u=(s.relativeSelector=!0,e.some(f=>f.some(d_))?[Yj]:void 0),a=r(e,s,u);if(a===wn.falseFunc)return wn.falseFunc;let c=function(f,p){return f===wn.falseFunc?wn.falseFunc:m=>p.isTag(m)&&f(m)}(a,i);if(u&&a!==wn.trueFunc){let{shouldTestNextSiblings:f=!1}=a;return h=>{if(!n(h))return!1;u[0]=h;var m=i.getChildren(h),h=f?[...m,...Jj(h,i)]:m;return i.existsOne(c,h)}}return f=>n(f)&&i.existsOne(c,i.getChildren(f))}};function Wv(n,e){return(n=e.getParent(n))&&e.isTag(n)?n:null}function Ffe(n,e,l,t,r){let{adapter:i,equals:s}=l;switch(e.type){case en.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case en.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case en.Attribute:if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return l.xmlMode&&!l.lowerCaseAttributeNames||(e.name=e.name.toLowerCase()),kfe[e.action](n,e,l);case en.Pseudo:return function(u,a,c,f,p){let{name:m,data:h}=a;if(Array.isArray(h)){if(m in Xv)return Xv[m](u,h,c,f,p);throw new Error(`Unknownpseudo-class:${m}(${h})`)}let g=(a=c.pseudos)==null?void 0:a[m],_=typeof g=="string"?g:Lfe[m];if(typeof _=="string"){if(h!=null)throw new Error(`Pseudo${m}doesn'thaveanyarguments`);let S=K7(_);return Xv.is(u,S,c,f,p)}if(typeof g=="function")return F$(g,m,h,1),S=>g(S,h)&&u(S);if(m in h_)return h_[m](u,h,c,f);if(m in L$){let S=L$[m];return F$(S,m,h,2),T=>S(T,c,h)&&u(T)}throw new Error("Unknown pseudo-class :"+m)}(n,e,l,t,r);case en.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let u=e.name;return l.xmlMode&&!l.lowerCaseTags||(u=u.toLowerCase()),function(a){return i.getName(a)===u&&n(a)}}case en.Descendant:{if(l.cacheResults===!1||typeof WeakSet>"u")return function(a){let c=a;for(;c=Wv(c,i);)if(n(c))return!0;return!1};let u=new WeakSet;return function(a){let c=a;for(;c=Wv(c,i);)if(!u.has(c)){if(i.isTag(c)&&n(c))return!0;u.add(c)}return!1}}case"_flexibleDescendant":return function(u){let a=u;do if(n(a))return!0;while(a=Wv(a,i));return!1};case en.Parent:return function(u){return i.getChildren(u).some(a=>i.isTag(a)&&n(a))};case en.Child:return function(u){return(u=i.getParent(u))!=null&&i.isTag(u)&&n(u)};case en.Sibling:return function(u){var a=i.getSiblings(u);for(let f=0;f<a.length;f++){var c=a[f];if(s(u,c))break;if(i.isTag(c)&&n(c))return!0}return!1};case en.Adjacent:return i.prevElementSibling?function(u){return(u=i.prevElementSibling(u))!=null&&n(u)}:function(u){var a=i.getSiblings(u);let c;for(let p=0;p<a.length;p++){var f=a[p];if(s(u,f))break;i.isTag(f)&&(c=f)}return!!c&&n(c)};case en.Universal:if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not ye
`)}}):{name:t,value:r.replace($$,`\r
`)}}).toArray()}}),F1=function(n,e,l){if(this.length=0,this.options=l,this._root=e,n){for(var t=0;t<n.length;t++)this[t]=n[t];this.length=n.length}},X_=(F1.prototype.cheerio="[cheerio object]",F1.prototype.splice=Array.prototype.splice,F1.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(F1.prototype,Tfe,tpe,ope,cpe,ppe),function(n,e){return(X_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(l,t){l.__proto__=t}:function(l,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(l[r]=t[r])}))(n,e)}),dpe=function(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function l(){this.constructor=n}X_(n,e),n.prototype=e===null?Object.create(e):(l.prototype=e.prototype,new l)},M1=function(){return(M1=Object.assign||function(n){for(var e,l=1,t=arguments.length;l<t;l++)for(var r in e=arguments[l])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}).apply(this,arguments)},hpe=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ul="\uFFFD",j$=(function(n){n[n.EOF=-1]="EOF",n[n.NULL=0]="NULL",n[n.TABULATION=9]="TABULATION",n[n.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",n[n.LINE_FEED=10]="LINE_FEED",n[n.FORM_FEED=12]="FORM_FEED",n[n.SPACE=32]="SPACE",n[n.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",n[n.QUOTATION_MARK=34]="QUOTATION_MARK",n[n.NUMBER_SIGN=35]="NUMBER_SIGN",n[n.AMPERSAND=38]="AMPERSAND",n[n.APOSTROPHE=39]="APOSTROPHE",n[n.HYPHEN_MINUS=45]="HYPHEN_MINUS",n[n.SOLIDUS=47]="SOLIDUS",n[n.DIGIT_0=48]="DIGIT_0",n[n.DIGIT_9=57]="DIGIT_9",n[n.SEMICOLON=59]="SEMICOLON",n[n.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",n[n.EQUALS_SIGN=61]="EQUALS_SIGN",n[n.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",n[n.QUESTION_MARK=63]="QUESTION_MARK",n[n.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",n[n.LATIN_CAPITAL_F=70]="LATIN_CAPITAL_F",n[n.LATIN_CAPITAL_X=88]="LATIN_CAPITAL_X",n[n.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",n[n.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",n[n.GRAVE_ACCENT=96]="GRAVE_ACCENT",n[n.LATIN_SMALL_A=97]="LATIN_SMALL_A",n[n.LATIN_SMALL_F=102]="LATIN_SMALL_F",n[n.LATIN_SMALL_X=120]="LATIN_SMALL_X",n[n.LATIN_SMALL_Z=122]="LATIN_SMALL_Z",n[n.REPLACEMENT_CHARACTER=65533]="REPLACEMENT_CHARACTER"}(P=P||{}),"--"),U$="[CDATA[",B$="doctype",Do="script",mpe="public",gpe="system";function pU(n){return 55296<=n&&n<=57343}function dU(n){return n!==32&&n!==10&&n!==13&&n!==9&&n!==12&&1<=n&&n<=31||127<=n&&n<=159}function hU(n){return 64976<=n&&n<=65007||hpe.has(n)}(function(n){n.controlCharacterInInputStream="control-character-in-input-stream",n.noncharacterInInputStream="noncharacter-in-input-stream",n.surrogateInInputStream="surrogate-in-input-stream",n.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",n.endTagWithAttributes="end-tag-with-attributes",n.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",n.unexpectedSolidusInTag="unexpected-solidus-in-tag",n.unexpectedNullCharacter="unexpected-null-character",n.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",n.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",n.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",n.missingEndTagName="missing-end-tag-name",n.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",n.unknownNamedCharacterReference="unknown-named-character-reference",n.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",n.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",n.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",n.eofBeforeTagName="eof-before-tag-name",n.eofInTag="eof-in-tag",n.missingAttributeValue="missing-attribute-value",n.missingWhitespaceBetweenAttributes="missin
`,this.firstUpdate&&(j+=" "),this.message=j+(this.message||""),this.firstUpdate=!1,this},b}function c(T){return l.toString.call(T)==="[object Function]"}function f(T){return l.toString.call(T)==="[object Array]"}function p(T){return l.toString.call(T)==="[object String]"}function m(T){return l.toString.call(T)==="[object Object]"}function h(T){var x=function(v){return v?typeof v=="string"?v.split("."):[v]:[]}(T);return function(v){for(var b=v,w=0;w<x.length;w++){var N=x[w];if(!s(b,N))return;b=b[N]}return b}}function g(T){return Array.prototype.slice.call(T)}function _(T,x,v){return Array.prototype.indexOf.call(T||[],x,v)}function S(T){var x,v=[];for(x in T)s(T,x)&&v.push(x);return v}i.hasOwnProp=s,i._prettifyError=function(T,x,v){return(v=v.Update?v:new i.TemplateError(v)).Update(T),x||(T=v,(v=new Error(T.message)).name=T.name),v},Object.setPrototypeOf?Object.setPrototypeOf(a.prototype,Error.prototype):a.prototype=Object.create(Error.prototype,{constructor:{value:a}}),i.TemplateError=a,i.escape=function(T){return T.replace(r,u)},i.isFunction=c,i.isArray=f,i.isString=p,i.isObject=m,i.getAttrGetter=h,i.groupBy=function(T,x,v){for(var b={},w=c(x)?x:h(x),N=0;N<T.length;N++){var O=T[N],k=w(O,N);if(k===void 0&&v===!0)throw new TypeError('groupby: attribute "'+x+'" resolved to undefined');(b[k]||(b[k]=[])).push(O)}return b},i.toArray=g,i.without=function(T){var x=[];if(T)for(var v=T.length,b=g(arguments).slice(1),w=-1;++w<v;)_(b,T[w])===-1&&x.push(T[w]);return x},i.repeat=function(T,x){for(var v="",b=0;b<x;b++)v+=T;return v},i.each=function(T,x,v){if(T!=null){if(e.forEach&&T.forEach===e.forEach)T.forEach(x,v);else if(T.length===+T.length)for(var b=0,w=T.length;b<w;b++)x.call(v,T[b],b,T)}},i.map=function(T,x){var v=[];if(T!=null){if(e.map&&T.map===e.map)return T.map(x);for(var b=0;b<T.length;b++)v[v.length]=x(T[b],b);T.length===+T.length&&(v.length=T.length)}return v},i.asyncIter=function(T,x,v){var b=-1;(function w(){++b<T.length?x(T[b],b,w,v):v()})()},i.asyncFor=function(T,x,v){var b=S(T||{}),w=b.length,N=-1;(function O(){var k=b[++N];N<w?x(k,T[k],N,w,O):v()})()},i.indexOf=_,i.keys=S,i._entries=function(T){return S(T).map(function(x){return[x,T[x]]})},i._values=function(T){return S(T).map(function(x){return T[x]})},i._assign=i.extend=function(T,x){return T=T||{},S(x).forEach(function(v){T[v]=x[v]}),T},i.inOperator=function(T,x){if(f(x)||p(x))return x.indexOf(T)!==-1;if(m(x))return T in x;throw new Error('Cannot use "in" operator to search for "'+T+'" in unexpected types.')}});function jU(){throw new Error("setTimeout has not been defined")}function UU(){throw new Error("clearTimeout has not been defined")}var fs=jU,ps=UU;function BU(n){if(fs===setTimeout)return setTimeout(n,0);if((fs===jU||!fs)&&setTimeout)return(fs=setTimeout)(n,0);try{return fs(n,0)}catch{try{return fs.call(null,n,0)}catch{return fs.call(this,n,0)}}}typeof xi.setTimeout=="function"&&(fs=setTimeout),typeof xi.clearTimeout=="function"&&(ps=clearTimeout);var zu,wi=[],Yo=!1,N7=-1;function dde(){Yo&&zu&&(Yo=!1,zu.length?wi=zu.concat(wi):N7=-1,wi.length)&&HU()}function HU(){if(!Yo){var n=BU(dde);Yo=!0;for(var e=wi.length;e;){for(zu=wi,wi=[];++N7<e;)zu&&zu[N7].run();N7=-1,e=wi.length}zu=null,Yo=!1,function(l){if(ps===clearTimeout)return clearTimeout(l);if((ps===UU||!ps)&&clearTimeout)return(ps=clearTimeout)(l);try{ps(l)}catch{try{return ps.call(null,l)}catch{return ps.call(this,l)}}}(n)}}function qU(n,e){this.fun=n,this.array=e}function Ju(){}qU.prototype.run=function(){this.fun.apply(null,this.array)};var hde=Ju,mde=Ju,gde=Ju,yde=Ju,vde=Ju,_de=Ju,Ede=Ju,Uo=xi.performance||{},bde=Uo.now||Uo.mozNow||Uo.msNow||Uo.oNow||Uo.webkitNow||function(){return new Date().getTime()},Tde=new Date,vs={nextTick:function(n){var e=new Array(arguments.length-1);if(1<arguments.length)for(var l=1;l<arguments.length;l++)e[l-1]=arguments[l];wi.push(new qU(n,e)),wi.length!==1||Yo||BU(HU)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:hde,addListener:mde,once:gde,off:yde,removeListener:vde,removeAllListeners:_de,emit:Ede,binding:function(n){throw new Error("process.
`?this.forward():this.back())),O2(ZU,h,l,t);if(h=(h=this._extractString(this.tags.VARIABLE_END))||this._extractString("-"+this.tags.VARIABLE_END))return this.in_code=!1,O2(nB,h,l,t);if(r==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var i="";!this.isFinished();){if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}i+=this.current(),this.forward()}for(var s=["g","i","m","y"],u="";!this.isFinished()&&s.indexOf(this.current())!==-1;)u+=this.current(),this.forward();return O2(yB,{body:i,flags:u},l,t)}if(Sj.indexOf(r)!==-1){this.forward();var a,c=["==","===","!=","!==","<=",">=","//","**"],f=r+this.current();switch(ke.indexOf(c,f)!==-1&&(this.forward(),ke.indexOf(c,(r=f)+this.current())!==-1)&&(r=f+this.current(),this.forward()),r){case"(":a=tB;break;case")":a=rB;break;case"[":a=iB;break;case"]":a=sB;break;case"{":a=uB;break;case"}":a=aB;break;case",":a=cB;break;case":":a=fB;break;case"~":a=pB;break;case"|":a=dB;break;default:a=oB}return O2(a,r,l,t)}if((h=this._extractUntil(Tj+Sj)).match(/^[-+]?[0-9]+$/))return this.current()==="."?(this.forward(),c=this._extract("0123456789"),O2(hB,h+"."+c,l,t)):O2("int",h,l,t);if(h.match(/^(true|false)$/))return O2(mB,h,l,t);if(h==="none"||h==="null")return O2(P_,h,l,t);if(h)return O2(gB,h,l,t);throw new Error("Unexpected value while parsing: "+h)}var p,m=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if(h=(h=this._extractString(this.tags.BLOCK_START+"-"))||this._extractString(this.tags.BLOCK_START))return this.in_code=!0,O2(QU,h,l,t);if(h=(h=this._extractString(this.tags.VARIABLE_START+"-"))||this._extractString(this.tags.VARIABLE_START))return this.in_code=!0,O2(eB,h,l,t);var h="",g=!1;for(this._matches(this.tags.COMMENT_START)&&(g=!0,h=this._extractString(this.tags.COMMENT_START));(p=this._extractUntil(m))!==null;){if(h+=p,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!g){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&0<this.colno&&this.colno<=h.length){var _=h.slice(-this.colno);if(/^\s+$/.test(_)&&!(h=h.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!g)throw new Error("unexpected end of comment");h+=this._extractString(this.tags.COMMENT_END);break}h+=this.current(),this.forward()}if(p===null&&g)throw new Error("expected end of comment, got end of file");return O2(g?lB:JU,h,l,t)},e._parseString=function(l){this.forward();for(var t="";!this.isFinished()&&this.current()!==l;){var r=this.current();if(r==="\\")switch(this.forward(),this.current()){case"n":t+=`
`))})},t.compileRoot=function(r,i){var s=this,u=(i&&this.fail("compileRoot: root node can't have frame"),i=new n_,this._emitFuncBegin(r,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(r,i),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0,[]);(i=r.findAll(z.Block)).forEach(function(a,c){var f=a.name.value;if(u.indexOf(f)!==-1)throw new Error('Block "'+f+'" defined more than once.');u.push(f),s._emitFuncBegin(a,"b_"+f),f=new n_,s._emitLine("var frame = frame.push(true);"),s.compile(a.body,f),s._emitFuncEnd()}),this._emitLine("return {"),i.forEach(function(a,c){a="b_"+a.name.value,s._emitLine(a+": "+a+",")}),this._emitLine(`root:root
};`)},t.compile=function(r,i){var s=this["compile"+r.typename];s?s.call(this,r,i):this.fail("compile: Cannot compile node: "+r.typename,r.lineno,r.colno)},t.getCode=function(){return this.codebuf.join("")},l}(l4.Obj),Ohe={compile:function(s,e,l,t,r){var i=new Nj(t,(r=r===void 0?{}:r).throwOnUndefined),s=(l||[]).map(function(u){return u.preprocess}).filter(function(u){return!!u}).reduce(function(u,a){return a(u)},s);return i.compile(She.transform(Ehe.parse(s,l,r),e,t)),i.getCode()},Compiler:Nj},Nhe=an(function(n){function e(h,g){return h==null||h===!1?g:h}function l(h){return h!=h}function t(h){var g=(h=e(h,"")).toLowerCase();return on.copySafeness(h,g.charAt(0).toUpperCase()+g.slice(1))}function r(h){if(ke.isString(h))return h.split("");if(ke.isObject(h))return ke._entries(h||{}).map(function(g){return{key:g[0],value:g[1]}});if(ke.isArray(h))return h;throw new ke.TemplateError("list filter: type not iterable")}function i(h){return function(g,_,S){var T=this,x=T.env.getTest(_=_===void 0?"truthy":_);return ke.toArray(g).filter(function(v){return x.call(T,v,S)===h})}}function s(h){return on.copySafeness(h,h.replace(/^\s*|\s*$/g,""))}(n=n.exports={}).abs=Math.abs,n.batch=function(h,g,_){for(var S=[],T=[],x=0;x<h.length;x++)x%g==0&&T.length&&(S.push(T),T=[]),T.push(h[x]);if(T.length){if(_)for(x=T.length;x<g;x++)T.push(_);S.push(T)}return S},n.capitalize=t,n.center=function(h,g){var _;return(h=e(h,"")).length>=(g=g||80)?h:(g-=h.length,_=ke.repeat(" ",g/2-g%2),g=ke.repeat(" ",g/2),on.copySafeness(h,_+h+g))},n.default=function(h,g,_){return _?h||g:h!==void 0?h:g},n.dictsort=function(h,g,_){if(!ke.isObject(h))throw new ke.TemplateError("dictsort filter: val must be an object");var S,T,x=[];for(T in h)x.push([T,h[T]]);if(_===void 0||_==="key")S=0;else{if(_!=="value")throw new ke.TemplateError("dictsort filter: You can only sort by either key or value");S=1}return x.sort(function(v,b){return v=v[S],b=b[S],g||(ke.isString(v)&&(v=v.toUpperCase()),ke.isString(b)&&(b=b.toUpperCase())),b<v?1:v===b?0:-1}),x},n.dump=function(h,g){return JSON.stringify(h,null,g)},n.escape=function(h){return h instanceof on.SafeString?h:on.markSafe(ke.escape((h=h??"").toString()))},n.safe=function(h){return h instanceof on.SafeString?h:on.markSafe((h=h??"").toString())},n.first=function(h){return h[0]},n.forceescape=function(h){return on.markSafe(ke.escape((h=h??"").toString()))},n.groupby=function(h,g){return ke.groupBy(h,g,this.env.opts.throwOnUndefined)},n.indent=function(h,x,_){if((h=e(h,""))==="")return"";x=x||4;var S=h.split(`
`):_.replace(/\s+/gi," ");return on.copySafeness(h,S)},n.title=function(h){var g=(h=e(h,"")).split(" ").map(t);return on.copySafeness(h,g.join(" "))},n.trim=s,n.truncate=function(h,g,_,S){var T=h;return(h=e(h,"")).length<=(g=g||255)?h:(h=_?h.substring(0,g):((_=h.lastIndexOf(" ",g))===-1&&(_=g),h.substring(0,_)),on.copySafeness(T,h+=S??"..."))},n.upper=function(h){return(h=e(h,"")).toUpperCase()},n.urlencode=function(h){var g=encodeURIComponent;return ke.isString(h)?g(h):(ke.isArray(h)?h:ke._entries(h)).map(function(T){var S=T[0],T=T[1];return g(S)+"="+g(T)}).join("&")};var u=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,a=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,c=/^https?:\/\/.*$/,f=/^www\./,p=/\.(?:org|net|com)(?:\:|\/|$)/,m=(n.urlize=function(h,g,_){l(g)&&(g=1/0);varS=_===!0?' rel="nofollow"':"";returnh.split(/(\s+)/).filter(function(T){returnT&&T.length}).map(function(T){varx=T.match(u),v=(x=x?x[1]:T).substr(0,g);returnc.test(x)?'<a href="'+x+'"'+S+">"+v+"</a>":f.test(x)?'<a href="http://'+x+'"'+S+">"+v+"</a>":a.test(x)?'<a href="mailto:'+x+'">'+x+"</a>":p.test(x)?'<a href="http://'+x+'"'+S+">"+v+"</a>":T}).join("")},n.wordcount=function(h){return(h=(h=e(h,""))?h.match(/\w+/g):null)?h.length:null},n.float=function(h,g){returnl(h=parseFloat(h))?g:h},on.makeMacro(["value","default","base"],[],function(h,g,_){return_===void0&&(_=10),l(h=parseInt(h,_))?g:h}));n.int=m,n.d=n.default,n.e=n.escape}),z7={};functionPB(n,e){for(varl=0,t=n.length-1;0<=t;t--){varr=n[t];r==="."?n.splice(t,1):r===".."?(n.splice(t,1),l++):l&&(n.splice(t,1),l--)}if(e)for(;l--;)n.unshift("..");returnn}varIhe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l_=function(n){returnIhe.exec(n).slice(1)};functiont_(){for(varn="",e=!1,l=arguments.length-1;-1<=l&&!e;l--){vart=0<=l?arguments[l]:"/";if(typeoft!="string")thrownewTypeError("Arguments to path.resolve must be strings");t&&(n=t+"/"+n,e=t.charAt(0)==="/")}return(e?"/":"")+PB(nE(n.split("/"),function(r){return!!r}),!e).join("/")||"."}functionIj(n){vare=DB(n),l=Che(n,-1)==="/";return(n=(n=PB(nE(n.split("/"),function(t){return!!t}),!e).join("/"))||e?n:".")&&l&&(n+="/"),(e?"/":"")+n}functionDB(n){returnn.charAt(0)==="/"}varJo={extname:function(n){returnl_(n)[3]},basename:function(n,e){returnn=l_(n)[2],e&&n.substr(-1*e.length)===e?n.substr(0,n.length-e.length):n},dirname:function(l){vare=(l=l_(l))[0],l=l[1];returne||l?e+(l&&l.substr(0,l.length-1)):"."},sep:"/",delimiter:":",relative:function(n,e){functionl(c){for(varf=0;f<c.length&&c[f]==="";f++);for(varp=c.length-1;0<=p&&c[p]==="";p--);returnp<f?[]:c.slice(f,p-f+1)}n=t_(n).substr(1),e=t_(e).substr(1);for(vart=l(n.split("/")),r=l(e.split("/")),i=Math.min(t.length,r.length),s=i,u=0;u<i;u++)if(t[u]!==r[u]){s=u;break}for(vara=[],u=s;u<t.length;u++)a.push("..");return(a=a.concat(r.slice(s))).join("/")},join:function(){returnIj(nE(Array.prototype.slice.call(arguments,0),function(n,e){if(typeofn!="string")thrownewTypeError("Arguments to path.join must be strings");returnn}).join("/"))},isAbsolute:DB,normalize:Ij,resolve:t_};functionnE(n,e){if(n.filter)returnn.filter(e);for(varl=[],t=0;t<n.length;t++)e(n[t],t,n)&&l.push(n[t]);returnl}varChe="ab".substr(-1)==="b"?function(n,e,l){returnn.substr(e,l)}:function(n,e,l){returne<0&&(e=n.length+e),n.substr(e,l)};functionLB(n,e){return(LB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,t){returnl.__proto__=t,l})(n,e)}varlE=function(n){vare;functionl(){returnn.apply(this,arguments)||this}e=n,(t=l).prototype=Object.create(e.prototype),LB(t.prototype.constructor=t,e);vart=l.prototype;returnt.resolve=function(r,i){returnJo.resolve(Jo.dirname(r),i)},t.isRelative=function(r){returnr.indexOf("./")===0||r.indexOf("../")===0},l}(l4.EmitterObj);functionFB(n,e){return(FB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,t){returnl.__proto__=t,l})(n,e)}varkhe=function(n){vare,l;functiont(r){vari;return(i=n.call(this)||this).precompiled=r||{},i}returnl=n,(e=t).prototype=Object.create(l.prototype),FB(e.prototype.co
`)){let a=u.trim();if(a)if(a.startsWith("#")){if(a.startsWith("#EXT")){let c=ame(a,i);c&&s.push(c)}}else s.push(a)}return s.length!==0&&s[0].name==="EXTM3U"||Le("The EXTM3U tag MUST be the first line."),s}(n,e),t=ome(l,e);return t.source=n,t}var cme=["#EXTINF","#EXT-X-BYTERANGE","#EXT-X-DISCONTINUITY","#EXT-X-STREAM-INF","#EXT-X-CUE-OUT","#EXT-X-CUE-IN","#EXT-X-KEY","#EXT-X-MAP"],fme=["#EXT-X-MEDIA"],_E=class extends Array{constructor(e){super(),this.baseUri=e}push(...e){for(let l of e)if(l.startsWith("#"))if(cme.some(t=>l.startsWith(t)))super.push(l);else{if(this.includes(l)){if(fme.some(t=>l.startsWith(t)))continue;Le(`Redundantitem(${l})`)}super.push(l)}else super.push(l);return this.length}};function SE(n,e){let l=1e3;e&&(l=Math.pow(10,e));let t=Math.round(n*l)/l;return e?t.toFixed(e):t}function pme(n){let e=[`DATA-ID="${n.id}"`];return n.language&&e.push(`LANGUAGE="${n.language}"`),n.value?e.push(`VALUE="${n.value}"`):n.uri&&e.push(`URI="${n.uri}"`),`#EXT-X-SESSION-DATA:${e.join(",")}`}function cH(n,e){let l=e?"#EXT-X-SESSION-KEY":"#EXT-X-KEY",t=[`METHOD=${n.method}`];return n.uri&&t.push(`URI="${n.uri}"`),n.iv&&(n.iv.length!==16&&Le("IV must be a 128-bit unsigned integer"),t.push(`IV=${uH(n.iv)}`)),n.format&&t.push(`KEYFORMAT="${n.format}"`),n.formatVersion&&t.push(`KEYFORMATVERSIONS="${n.formatVersion}"`),`${l}:${t.join(",")}`}function dme(n,e){let l=e.isIFrameOnly?"#EXT-X-I-FRAME-STREAM-INF":"#EXT-X-STREAM-INF",t=[`BANDWIDTH=${e.bandwidth}`];if(e.averageBandwidth&&t.push(`AVERAGE-BANDWIDTH=${e.averageBandwidth}`),e.isIFrameOnly&&t.push(`URI="${e.uri}"`),e.codecs&&t.push(`CODECS="${e.codecs}"`),e.resolution&&t.push(`RESOLUTION=${e.resolution.width}x${e.resolution.height}`),e.frameRate&&t.push(`FRAME-RATE=${SE(e.frameRate,3)}`),e.hdcpLevel&&t.push(`HDCP-LEVEL=${e.hdcpLevel}`),e.audio.length>0){t.push(`AUDIO="${e.audio[0].groupId}"`);for(let r of e.audio)n.push(Sc(r))}if(e.video.length>0){t.push(`VIDEO="${e.video[0].groupId}"`);for(let r of e.video)n.push(Sc(r))}if(e.subtitles.length>0){t.push(`SUBTITLES="${e.subtitles[0].groupId}"`);for(let r of e.subtitles)n.push(Sc(r))}if(Zhe().allowClosedCaptionsNone&&e.closedCaptions.length===0)t.push("CLOSED-CAPTIONS=NONE");else if(e.closedCaptions.length>0){t.push(`CLOSED-CAPTIONS="${e.closedCaptions[0].groupId}"`);for(let r of e.closedCaptions)n.push(Sc(r))}if(e.score&&t.push(`SCORE=${e.score}`),e.allowedCpc){let r=[];for(let{format:i,cpcList:s}of e.allowedCpc)r.push(`${i}:${s.join("/")}`);t.push(`ALLOWED-CPC="${r.join(",")}"`)}e.videoRange&&t.push(`VIDEO-RANGE=${e.videoRange}`),e.stableVariantId&&t.push(`STABLE-VARIANT-ID="${e.stableVariantId}"`),e.programId&&t.push(`PROGRAM-ID=${e.programId}`),n.push(`${l}:${t.join(",")}`),e.isIFrameOnly||n.push(`${e.uri}`)}function Sc(n){let e=[`TYPE=${n.type}`,`GROUP-ID="${n.groupId}"`,`NAME="${n.name}"`];return n.isDefault!==void 0&&e.push("DEFAULT="+(n.isDefault?"YES":"NO")),n.autoselect!==void 0&&e.push("AUTOSELECT="+(n.autoselect?"YES":"NO")),n.forced!==void 0&&e.push("FORCED="+(n.forced?"YES":"NO")),n.language&&e.push(`LANGUAGE="${n.language}"`),n.assocLanguage&&e.push(`ASSOC-LANGUAGE="${n.assocLanguage}"`),n.instreamId&&e.push(`INSTREAM-ID="${n.instreamId}"`),n.characteristics&&e.push(`CHARACTERISTICS="${n.characteristics}"`),n.channels&&e.push(`CHANNELS="${n.channels}"`),n.uri&&e.push(`URI="${n.uri}"`),`#EXT-X-MEDIA:${e.join(",")}`}function hme(n,e,l,t,r=1,i=null){let s=!1,u="";if(e.discontinuity&&n.push("#EXT-X-DISCONTINUITY"),e.key){let c=cH(e.key);c!==l&&(n.push(c),l=c)}if(e.map){let c=function(f){let p=[`URI="${f.uri}"`];return f.byterange&&p.push(`BYTERANGE="${mE(f.byterange)}"`),`#EXT-X-MAP:${p.join(",")}`}(e.map);c!==t&&(n.push(c),t=c)}if(e.programDateTime&&n.push(`#EXT-X-PROGRAM-DATE-TIME:${hE(e.programDateTime)}`),e.dateRange&&n.push(function(c){let f=[`ID="${c.id}"`];c.start&&f.push(`START-DATE="${hE(c.start)}"`),c.end&&f.push(`END-DATE="${hE(c.end)}"`),c.duration&&f.push(`DURATION=${c.duration}`),c.plannedDuration&&f.push(`PLANNED-DURATION=${c.plannedDuration}`),c.classId&&f.push(`CLASS="${c.classId}"`),c.endOnNext&&
`)}var pH="hls_cache",Mc=[],ea={},d5={},Zu={},Fc="";function mme(n,e){if(Mc.push(n),ea[n]=e,Mc.length>5){let l=Mc.shift();gme(l)}}function gme(n){delete ea[n],delete Mc[n],new JSFile(pH+"/"+n).delete()}function yme(n,e){if(e.variants)for(let l of e.variants)l.uri.startsWith("http")||(l.uri=xE(n,l.uri));if(e.segments)for(let l of e.segments)l.uri.startsWith("http")||(l.uri=xE(n,l.uri)),l.key&&l.key.uri&&!l.key.uri.startsWith("http")&&(l.key.uri=xE(n,l.key.uri));return e}async function dH(n,e){let l=md5X(n);if(ea[l])return ea[l];let t={},r=n;for(;t=await req(r,{headers:e,redirect:0}),t.headers.location;)r=t.headers.location;if(t.code==200){var i=t.content;let s=yme(r,oH(i));return mme(l,{code:t.code,plist:s,key:l,headers:t.headers}),ea[l]}return{}}async function hH(n,e,l){if(!ea[n])return{};let r=ea[n].plist.segments,i=!Zu[n];if(i){Zu[n]={};for(let f of r){let p=md5X(f.uri+f.mediaSequenceNumber.toString());Zu[n][p]={file:pH+"/"+n+"/"+p,uri:f.uri,key:p,index:f.mediaSequenceNumber,order:f.mediaSequenceNumber,state:-1,read:!1}}}for(let f in Zu[n]){let p=Zu[n][f];p.index>=e?p.order=p.index-e:p.order=r.length-e+p.index}i&&vme(n,5,l);let s=r[e],u=md5X(s.uri+s.mediaSequenceNumber.toString()),a=Zu[n][u];if(a.state==1||a.state==-1){let f=new JSFile(a.file);if(await f.exist())return a.state=1,{buffer:3,code:200,headers:{connection:"close","content-type":"video/mp2t"},content:f};a.state=-1}if(a.state==-1&&mH(n,a,l),a.state==0){var c=new JSProxyStream;c.head(200,{connection:"close","content-type":"video/mp2t"});let f=0;return a.read=!0,new Promise(async function(p,m){let h=new JSFile(a.file+".dl");await h.open("r"),async function g(){let _=await h.size();if(_>f){var S=await h.read(_-f,f);await c.write(S),f=_}if(a.state==1||a.state<0){c.done(),await h.close(),await h.delete(),a.read=!1,p();return}setTimeout(g,5)}()}),{buffer:3,content:c}}}async function mH(n,e,l){if(e.state>=0||!d5[n])return;if(e.state=0,await new JSFile(e.file).exist()){e.state=1;return}let t=new JSFile(e.file+".dl");await t.open("w");let r=await req(e.uri,{buffer:3,headers:l,stream:t,timeout:[5e3,1e4]});if(r.error||r.code>=300){await t.close(),e.read||await t.delete(),e.state=-1;return}await t.close(),e.read?await t.copy(e.file):await t.move(e.file),e.state=1}async function vme(n,e,l){Fc&&Fc!=n&&delete d5[Fc],Fc=n,d5[n]=!0;for(let t=0;t<e&&d5[n];t++)new Promise(function(r,i){(async function s(){if(!d5[n]){r();return}let u=de.pickBy(Zu[n],function(c){return c.state==-1}),a=de.minBy(Object.values(u),function(c){return c.order});if(!a){r();return}await mH(n,a,l),setTimeout(s,5)})()})}function xE(n,e){var l=n.split("/"),t=e.split("/");l.pop();for(var r=0;r<t.length;r++)t[r]!="."&&(t[r]==".."?l.pop():l.push(t[r]));return l.join("/")}function gH(n){let e=[];return Array.from(n.danmuku).forEach(l=>{let t=Number(l[0]),r=l[4];e.push(`<dp="${t},1,25,16777215,1659282294,0,8b53b65c,1108899274487246080"><![CDATA[${r}]]></d>`)}),String.raw`<?xmlversion="1.0"encoding="UTF-8"?><i><chatserver>chat.bilibili.com</chatserver><chatid>52175602</chatid><mission>0</mission><maxlimit>1000</maxlimit><state>0</state><real_name>0</real_name><source>k-v</source>`+e.join("")+"</i>"}var$c=class{constructor(){this.siteUrl="https://search.youku.com",this.reconnectTimes=0,this.maxReconnectTimes=5,this.jadeLog=newA3(this.getAppName(),"DEBUG")}getAppName(){return"\u5F39\u5E55"}getHeader(){return{"User-Agent":Lr,Referer:this.siteUrl+"/"}}asyncreconnnect(e,l,t,r,i,s){returnawaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u8BF7\u68C0\u67E5url:"+e+",\u4E24\u79D2\u540E\u91CD\u8BD5"),Z3(2),this.reconnectTimes<this.maxReconnectTimes?(this.reconnectTimes=this.reconnectTimes+1,awaitthis.fetch(e,l,t,r,i,s)):(awaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u91CD\u8FDE\u5931\u8D25"),null)}asyncgetResponse(e,l,t,r,i,s,u){returnu.headers.location!==void0?r?(awaitthis.jadeLog.debug(`\u8FD4\u56DE\u91CD\u5B9A\u5411\u8FDE\u63A5:${u.headers.location}`),u.headers.location):this.fetch(u.headers.location,l,t,r,i,s):u.content.length>0?(this.reconnectTimes=0,i?{cookie:u.headers["set-cookie"],content:u.cont
`).forEach(function(s){r=s.indexOf(":"),l=s.substring(0,r).trim().toLowerCase(),t=s.substring(r+1).trim(),!(!l||e[l]&&c_e[l])&&(l==="set-cookie"?e[l]?e[l].push(t):e[l]=[t]:e[l]=e[l]?e[l]+", "+t:t)}),e};var Mz=Symbol("internals");function C5(n){return n&&String(n).trim().toLowerCase()}function yf(n){return n===!1||n==null?n:X.isArray(n)?n.map(yf):String(n)}function f_e(n){let e=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,t;for(;t=l.exec(n);)e[t[1]]=t[2];return e}var p_e=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());functionTb(n,e,l,t,r){if(X.isFunction(t))returnt.call(this,e,l);if(r&&(e=l),!!X.isString(e)){if(X.isString(t))returne.indexOf(t)!==-1;if(X.isRegExp(t))returnt.test(e)}}functiond_e(n){returnn.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,l,t)=>l.toUpperCase()+t)}functionh_e(n,e){letl=X.toCamelCase(" "+e);["get","set","has"].forEach(t=>{Object.defineProperty(n,t+l,{value:function(r,i,s){returnthis[t].call(this,e,r,i,s)},configurable:!0})})}varA4=class{constructor(e){e&&this.set(e)}set(e,l,t){letr=this;functioni(u,a,c){letf=C5(a);if(!f)thrownewError("header name must be a non-empty string");letp=X.findKey(r,f);(!p||r[p]===void0||c===!0||c===void0&&r[p]!==!1)&&(r[p||a]=yf(u))}lets=(u,a)=>X.forEach(u,(c,f)=>i(c,f,a));returnX.isPlainObject(e)||einstanceofthis.constructor?s(e,l):X.isString(e)&&(e=e.trim())&&!p_e(e)?s(Fz(e),l):e!=null&&i(l,e,t),this}get(e,l){if(e=C5(e),e){lett=X.findKey(this,e);if(t){letr=this[t];if(!l)returnr;if(l===!0)returnf_e(r);if(X.isFunction(l))returnl.call(this,r,t);if(X.isRegExp(l))returnl.exec(r);thrownewTypeError("parser must be boolean|regexp|function")}}}has(e,l){if(e=C5(e),e){lett=X.findKey(this,e);return!!(t&&this[t]!==void0&&(!l||Tb(this,this[t],t,l)))}return!1}delete(e,l){lett=this,r=!1;functioni(s){if(s=C5(s),s){letu=X.findKey(t,s);u&&(!l||Tb(t,t[u],u,l))&&(deletet[u],r=!0)}}returnX.isArray(e)?e.forEach(i):i(e),r}clear(e){letl=Object.keys(this),t=l.length,r=!1;for(;t--;){leti=l[t];(!e||Tb(this,this[i],i,e,!0))&&(deletethis[i],r=!0)}returnr}normalize(e){letl=this,t={};returnX.forEach(this,(r,i)=>{lets=X.findKey(t,i);if(s){l[s]=yf(r),deletel[i];return}letu=e?d_e(i):String(i).trim();u!==i&&deletel[i],l[u]=yf(r),t[u]=!0}),this}concat(...e){returnthis.constructor.concat(this,...e)}toJSON(e){letl=Object.create(null);returnX.forEach(this,(t,r)=>{t!=null&&t!==!1&&(l[r]=e&&X.isArray(t)?t.join(", "):t)}),l}[Symbol.iterator](){returnObject.entries(this.toJSON())[Symbol.iterator]()}toString(){returnObject.entries(this.toJSON()).map(([e,l])=>e+": "+l).join(`
`,F_e=U5.encode(ws),M_e=2,Ub=class{constructor(e,l){let{escapeName:t}=this.constructor,r=X.isString(l),i=`Content-Disposition:form-data;name="${t(e)}"${!r&&l.name?`; filename="${t(l.name)}"`:""}${ws}`;r?l=U5.encode(String(l).replace(/\r?\n|\r\n?/g,ws)):i+=`Content-Type:${l.type||"application/octet-stream"}${ws}`,this.headers=U5.encode(i+ws),this.contentLength=r?l.byteLength:l.size,this.size=this.headers.byteLength+this.contentLength+M_e,this.name=e,this.value=l}async*encode(){yield this.headers;let{value:e}=this;X.isTypedArray(e)?yield e:yield*Ef(e),yield F_e}static escapeName(e){return String(e).replace(/[\r\n"]/g,l=>({"\r":"%0D","\n":"%0A",'"':"%22"})[l])}},$_e=(n,e,l)=>{let{tag:t="form-data-boundary",size:r=25,boundary:i=t+"-"+X.generateString(r,L_e)}=l||{};if(!X.isFormData(n))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let s=U5.encode("--"+i+ws),u=U5.encode("--"+i+"--"+ws+ws),a=u.byteLength,c=Array.from(n.entries()).map(([p,m])=>{let h=new Ub(p,m);return a+=h.size,h});a+=s.byteLength*c.length,a=X.toFiniteNumber(a);let f={"Content-Type":`multipart/form-data;boundary=${i}`};return Number.isFinite(a)&&(f["Content-Length"]=a),e&&e(f),Qz.Readable.from(async function*(){for(let p of c)yield s,yield*p.encode();yield u}())},Zz=$_e;var eG=St(require("stream"),1),Bb=class extends eG.default.Transform{__transform(e,l,t){this.push(e),t()}_transform(e,l,t){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,l)}this.__transform(e,l,t)}},nG=Bb;var j_e=(n,e)=>X.isAsyncFn(n)?function(...l){let t=l.pop();n.apply(this,l).then(r=>{try{e?t(null,...e(r)):t(null,r)}catch(i){t(i)}},t)}:n,lG=j_e;var tG={flush:Oi.default.constants.Z_SYNC_FLUSH,finishFlush:Oi.default.constants.Z_SYNC_FLUSH},U_e={flush:Oi.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Oi.default.constants.BROTLI_OPERATION_FLUSH},rG=X.isFunction(Oi.default.createBrotliDecompress),{http:B_e,https:H_e}=fG.default,q_e=/https:?/,iG=Nt.protocols.map(n=>n+":");function V_e(n,e){n.beforeRedirects.proxy&&n.beforeRedirects.proxy(n),n.beforeRedirects.config&&n.beforeRedirects.config(n,e)}function dG(n,e,l){let t=e;if(!t&&t!==!1){let r=(0,uG.getProxyForUrl)(l);r&&(t=new URL(r))}if(t){if(t.username&&(t.auth=(t.username||"")+":"+(t.password||"")),t.auth){(t.auth.username||t.auth.password)&&(t.auth=(t.auth.username||"")+":"+(t.auth.password||""));let i=Buffer.from(t.auth,"utf8").toString("base64");n.headers["Proxy-Authorization"]="Basic "+i}n.headers.host=n.hostname+(n.port?":"+n.port:"");let r=t.hostname||t.host;n.hostname=r,n.host=r,n.port=t.port,n.path=l,t.protocol&&(n.protocol=t.protocol.includes(":")?t.protocol:`${t.protocol}:`)}n.beforeRedirects.proxy=function(i){dG(i,e,i.href)}}var z_e=typeof process<"u"&&X.kindOf(process)==="process",G_e=n=>new Promise((e,l)=>{let t,r,i=(a,c)=>{r||(r=!0,t&&t(a,c))},s=a=>{i(a),e(a)},u=a=>{i(a,!0),l(a)};n(s,u,a=>t=a).catch(u)}),X_e=({address:n,family:e})=>{if(!X.isString(n))throw TypeError("address must be a string");return{address:n,family:e||(n.indexOf(".")<0?6:4)}},sG=(n,e)=>X_e(X.isObject(n)?n:{address:n,family:e}),hG=z_e&&function(e){return G_e(async function(t,r,i){let{data:s,lookup:u,family:a}=e,{responseType:c,responseEncoding:f}=e,p=e.method.toUpperCase(),m,h=!1,g;if(u){let ue=lG(u,ve=>X.isArray(ve)?ve:[ve]);u=(ve,q,re)=>{ue(ve,q,(te,ne,Bl)=>{if(te)return re(te);let Rn=X.isArray(ne)?ne.map(Ge=>sG(Ge)):[sG(ne,Bl)];q.all?re(te,Rn):re(te,Rn[0].address,Rn[0].family)})}}let _=new pG.default,S=()=>{e.cancelToken&&e.cancelToken.unsubscribe(T),e.signal&&e.signal.removeEventListener("abort",T),_.removeAllListeners()};i((ue,ve)=>{m=!0,ve&&(h=!0,S())});function T(ue){_.emit("abort",!ue||ue.type?new nr(null,e,g):ue)}_.once("abort",r),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(T),e.signal&&(e.signal.aborted?T():e.signal.addEventListener("abort",T)));let x=aa(e.baseURL,e.url),v=new URL(x,"http://localhost"),b=v.protocol||iG[0];if(b==="data:"){let ue;if(p!=="GET")return As(t,r,{st
`+i.map(_G).join(`
`):" "+_G(i[0]):"as no adapter specified";throw new Fe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return t},adapters:Hb};function qb(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new nr(null,n)}function Tf(n){return qb(n),n.headers=It.from(n.headers),n.data=k5.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),bf.getAdapter(n.adapter||x4.adapter)(n).then(function(t){return qb(n),t.data=k5.call(n,n.transformResponse,t),t.headers=It.from(t.headers),t},function(t){return P5(t)||(qb(n),t&&t.response&&(t.response.data=k5.call(n,n.transformResponse,t.response),t.response.headers=It.from(t.response.headers))),Promise.reject(t)})}var EG=n=>n instanceof It?n.toJSON():n;function Ni(n,e){e=e||{};let l={};function t(c,f,p){return X.isPlainObject(c)&&X.isPlainObject(f)?X.merge.call({caseless:p},c,f):X.isPlainObject(f)?X.merge({},f):X.isArray(f)?f.slice():f}function r(c,f,p){if(X.isUndefined(f)){if(!X.isUndefined(c))return t(void 0,c,p)}else return t(c,f,p)}function i(c,f){if(!X.isUndefined(f))return t(void 0,f)}function s(c,f){if(X.isUndefined(f)){if(!X.isUndefined(c))return t(void 0,c)}else return t(void 0,f)}function u(c,f,p){if(p in e)return t(c,f);if(p in n)return t(void 0,c)}let a={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(c,f)=>r(EG(c),EG(f),!0)};return X.forEach(Object.keys(Object.assign({},n,e)),function(f){let p=a[f]||r,m=p(n[f],e[f],f);X.isUndefined(m)&&p!==u||(l[f]=m)}),l}var Vb={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Vb[n]=function(t){return typeof t===n||"a"+(e<1?"n ":" ")+n}});var bG={};Vb.transitional=function(e,l,t){function r(i,s){return"[Axios v"+ca+"] Transitional option '"+i+"'"+s+(t?". "+t:"")}return(i,s,u)=>{if(e===!1)throw new Fe(r(s," has been removed"+(l?" in "+l:"")),Fe.ERR_DEPRECATED);return l&&!bG[s]&&(bG[s]=!0,console.warn(r(s," has been deprecated since v"+l+" and will be removed in the near future"))),e?e(i,s,u):!0}};function Y_e(n,e,l){if(typeof n!="object")throw new Fe("options must be an object",Fe.ERR_BAD_OPTION_VALUE);let t=Object.keys(n),r=t.length;for(;r-- >0;){let i=t[r],s=e[i];if(s){let u=n[i],a=u===void 0||s(u,i,n);if(a!==!0)throw new Fe("option "+i+" must be "+a,Fe.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new Fe("Unknown option "+i,Fe.ERR_BAD_OPTION)}}var Sf={assertOptions:Y_e,validators:Vb};var Rs=Sf.validators,R4=class{constructor(e){this.defaults=e,this.interceptors={request:new vb,response:new vb}}async request(e,l){try{return await this._request(e,l)}catch(t){if(t instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;let i=r.stack?r.stack.replace(/^.+\n/,""):"";t.stack?i&&!String(t.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.stack+=`