varete=Object.create;varM6=Object.defineProperty;vartte=Object.getOwnPropertyDescriptor;varnte=Object.getOwnPropertyNames;varrte=Object.getPrototypeOf,ite=Object.prototype.hasOwnProperty;vark=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_A=(t,e)=>{for(varnine)M6(t,n,{get:e[n],enumerable:!0})},EA=(t,e,n,r)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofnte(e))!ite.call(t,i)&&i!==n&&M6(t,i,{get:()=>e[i],enumerable:!(r=tte(e,i))||r.enumerable});returnt};varXr=(t,e,n)=>(n=t!=null?ete(rte(t)):{},EA(e||!t||!t.__esModule?M6(n,"default",{value:t,enumerable:!0}):n,t)),lte=t=>EA(M6({},"__esModule",{value:!0}),t);varwA=k((NOe,bA)=>{"use strict";functionste(t){vare=newt,n=e;functionr(){varl=e;returnl.next?e=l.next:(e=newt,n=e),l.next=null,l}functioni(l){n.next=l,n=l}return{get:r,release:i}}bA.exports=ste});varNd=k((COe,Od)=>{"use strict";varate=wA();functionSA(t,e,n){if(typeoft=="function"&&(n=e,e=t,t=null),!(n>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");varr=ate(ote),i=null,l=null,s=0,a=null,o={push:_,drain:Jl,saturated:Jl,pause:c,paused:!1,getconcurrency(){returnn},setconcurrency(x){if(!(x>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");if(n=x,!o.paused)for(;i&&s<n;)s++,w()},running:u,resume:d,idle:y,length:f,getQueue:m,unshift:S,empty:Jl,kill:E,killAndDrain:g,error:v};returno;functionu(){returns}functionc(){o.paused=!0}functionf(){for(varx=i,O=0;x;)x=x.next,O++;returnO}functionm(){for(varx=i,O=[];x;)O.push(x.value),x=x.next;returnO}functiond(){if(o.paused)for(o.paused=!1;i&&s<n;)s++,w()}functiony(){returns===0&&o.length()===0}function_(x,O){varN=r.get();N.context=t,N.release=w,N.value=x,N.callback=O||Jl,N.errorHandler=a,s>=n||o.paused?l?(l.next=N,l=N):(i=N,l=N,o.saturated()):(s++,e.call(t,N.value,N.worked))}functionS(x,O){varN=r.get();N.context=t,N.release=w,N.value=x,N.callback=O||Jl,N.errorHandler=a,s>=n||o.paused?i?(N.next=i,i=N):(i=N,l=N,o.saturated()):(s++,e.call(t,N.value,N.worked))}functionw(x){x&&r.release(x);varO=i;O&&s<=n?o.paused?s--:(l===i&&(l=null),i=O.next,O.next=null,e.call(t,O.value,O.worked),l===null&&o.empty()):--s===0&&o.drain()}functionE(){i=null,l=null,o.drain=Jl}functiong(){i=null,l=null,o.drain(),o.drain=Jl}functionv(x){a=x}}functionJl(){}functionote(){this.value=null,this.callback=Jl,this.next=null,this.release=Jl,this.context=null,this.errorHandler=null;vart=this;this.worked=function(n,r){vari=t.callback,l=t.errorHandler,s=t.value;t.value=null,t.callback=Jl,t.errorHandler&&l(n,s),i.call(t.context,n,r),t.release(t)}}functionute(t,e,n){typeoft=="function"&&(n=e,e=t,t=null);functionr(c,f){e.call(this,c).then(function(m){f(null,m)},f)}vari=SA(t,r,n),l=i.push,s=i.unshift;returni.push=a,i.unshift=o,i.drained=u,i;functiona(c){varf=newPromise(function(m,d){l(c,function(y,_){if(y){d(y);return}m(_)})});returnf.catch(Jl),f}functiono(c){varf=newPromise(function(m,d){s(c,function(y,_){if(y){d(y);return}m(_)})});returnf.catch(Jl),f}functionu(){if(i.idle())returnnewPromise(function(m){m()});varc=i.drain,f=newPromise(function(m){i.drain=function(){c(),m()}});returnf}}Od.exports=SA;Od.exports.promise=ute});varRd=k((ROe,TA)=>{"use strict";var{inherits:cte,format:Cd}=require("util");functionpo(t,e,n=Error){if(!t)thrownewError("Avvio error code must not be empty");if(!e)thrownewError("Avvio base error message must not be empty");functionr(i,l,s){if(!new.target)returnnewr(i,l,s);Error.captureStackTrace(this,r),this.code=t,this.message=e,this.name="AvvioError",i&&l&&s?this.message=Cd(e,i,l,s):i&&l?this.message=Cd(e,i,l):i?this.message=Cd(e,i):this.message=e}returnr.prototype[Symbol.toStringTag]="Error",r.prototype.toString=function(){return`${this.name} [${this.code}]: ${this.message}`},cte(r,n),r}TA.exports={createError:po,AVV_ERR_EXPOSE_ALREADY_DEFINED:po("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' () is already defined, specify an expose option"),AVV_ERR_CALLBACK_NOT_FN:po("AVV_ERR_CALLBACK_NOT_FN","Callbackfor'%s'hookisnotafunction.Received:'%s
deps:${n}}`};var u1e={keyword:"dependencies",type:"object",schemaType:"object",error:Ys.error,code(t){let[e,n]=c1e(t);kI(t,e),DI(t,n)}};function c1e({schema:t}){let e={},n={};for(let r in t){if(r==="__proto__")continue;let i=Array.isArray(t[r])?e:n;i[r]=t[r]}return[e,n]}function kI(t,e=t.schema){let{gen:n,data:r,it:i}=t;if(Object.keys(e).length===0)return;let l=n.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let o=(0,j4.propertyInData)(n,r,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?n.if(o,()=>{for(let u of a)(0,j4.checkReportMissingProp)(t,u)}):(n.if((0,yy._)`${o}&&(${(0,j4.checkMissingProp)(t,a,l)})`),(0,j4.reportMissingProp)(t,l),n.else())}}Ys.validatePropertyDeps=kI;function DI(t,e=t.schema){let{gen:n,data:r,keyword:i,it:l}=t,s=n.name("valid");for(let a in e)(0,o1e.alwaysValidSchema)(l,e[a])||(n.if((0,j4.propertyInData)(n,r,a,l.opts.ownProperties),()=>{let o=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(o,s)},()=>n.var(s,!0)),t.ok(s))}Ys.validateSchemaDeps=DI;Ys.default=u1e});var FI=k(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});var LI=st(),p1e=Nt(),f1e={message:"property name must be valid",params:({params:t})=>(0,LI._)`{propertyName:${t.propertyName}}`},d1e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:f1e,code(t){let{gen:e,schema:n,data:r,it:i}=t;if((0,p1e.alwaysValidSchema)(i,n))return;let l=e.name("valid");e.forIn("key",r,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},l),e.if((0,LI.not)(l),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(l)}};gy.default=d1e});var _y=k(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});var q8=Si(),bs=st(),h1e=Wl(),z8=Nt(),m1e={message:"must NOT have additional properties",params:({params:t})=>(0,bs._)`{additionalProperty:${t.additionalProperty}}`},y1e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:m1e,code(t){let{gen:e,schema:n,parentSchema:r,data:i,errsCount:l,it:s}=t;if(!l)throw new Error("ajv implementation error");let{allErrors:a,opts:o}=s;if(s.props=!0,o.removeAdditional!=="all"&&(0,z8.alwaysValidSchema)(s,n))return;let u=(0,q8.allSchemaProperties)(r.properties),c=(0,q8.allSchemaProperties)(r.patternProperties);f(),t.ok((0,bs._)`${l}===${h1e.default.errors}`);function f(){e.forIn("key",i,S=>{!u.length&&!c.length?y(S):e.if(m(S),()=>y(S))})}function m(S){let w;if(u.length>8){let E=(0,z8.schemaRefOrVal)(s,r.properties,"properties");w=(0,q8.isOwnProperty)(e,E,S)}else u.length?w=(0,bs.or)(...u.map(E=>(0,bs._)`${S}===${E}`)):w=bs.nil;return c.length&&(w=(0,bs.or)(w,...c.map(E=>(0,bs._)`${(0,q8.usePattern)(t,E)}.test(${S})`))),(0,bs.not)(w)}function d(S){e.code((0,bs._)`delete${i}[${S}]`)}function y(S){if(o.removeAdditional==="all"||o.removeAdditional&&n===!1){d(S);return}if(n===!1){t.setParams({additionalProperty:S}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,z8.alwaysValidSchema)(s,n)){let w=e.name("valid");o.removeAdditional==="failing"?(_(S,w,!1),e.if((0,bs.not)(w),()=>{t.reset(),d(S)})):(_(S,w),a||e.if((0,bs.not)(w),()=>e.break()))}}function _(S,w,E){let g={keyword:"additionalProperties",dataProp:S,dataPropType:z8.Type.Str};E===!1&&Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(g,w)}}};vy.default=y1e});var MI=k(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var g1e=r1(),jI=Si(),Ey=Nt(),UI=_y(),v1e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:l}=t;l.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&UI.default.code(new g1e.KeywordCxt(l,UI.default,"additionalProperties"));let s=(0,jI.allSchemaProperties)(n);for(let f of s)l.definedProperties.add(f);l.opts.unevaluated&&s.length&&l.props!==!0&&(l.props=Ey.mergeEvaluated.props(e,(0,Ey.toHash)(s),l.props));let a=s.filter(f=>!(0,Ey.alwaysValidSchema)(l,n[f]));if(a.le
`;let a=new j9e(e),o=new U9e(e.ajv);for(let c of n.validatorSchemasIds){let f=n.refResolver.getSchema(c);o.addSchema(f,c);let m=n.refResolver.getSchemaDependencies(c);for(let[d,y]of Object.entries(m))o.addSchema(y,d)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:o,serializer:a,code:`validator
${s}`,ajv:o.ajv};let u=new Function("validator","serializer",s);return e.mode==="standalone"?Wy()(u,n,a,o):u(o,a)}var B9e=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],H9e=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],V9e=["maxLength","minLength","pattern"],q9e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function aF(t){for(var e of B9e)if(e in t)return"object";for(var e of H9e)if(e in t)return"array";for(var e of V9e)if(e in t)return"string";for(var e of q9e)if(e in t)return"number";return t.type}function z9e(t,e){let n=e.schema,r=Object.keys(n.properties||{}),i=`
`,i}function G9e(t,e){let n="",r=e.schema,i=r.required||[],l=e.getPropertyLocation("properties"),s=[],a=[];if(r.properties)for(let u of Object.keys(r.properties)){if(i.indexOf(u)===-1)continue;let c=l.getPropertyLocation(u);c.schema.$ref&&(c=E1(t,e,c.schema.$ref));let f=JSON.stringify(u);c.schema.default===void 0&&(n+=`if(obj[${f}]===undefined)thrownewError('${f} is required!')
`,a.push(u)),s.push(u)}for(let u of i)s.indexOf(u)===-1&&(n+=`if(obj['${u}']===undefined)thrownewError('"${u}" is required!')
`;let o=t.wrapObjects;if(t.wrapObjects=!0,r.properties)for(let u of Object.keys(r.properties)){let c=l.getPropertyLocation(u);c.schema.$ref&&(c=E1(t,e,c.schema.$ref));let f=JSON.stringify(u);if(a.indexOf(u)!==-1)n+=`
${e}`)}function W9(t,e,n,r){if((t.isLeafNode||r.commonPrefix!==!1)&&(n=n||"(empty root node)",e=e[n]={},t.isLeafNode&&(e[cU]=Xfe(t,n,r)),n=""),t.staticChildren)for(let i of Object.values(t.staticChildren))W9(i,e,n+i.prefix,r);if(t.parametricChildren)for(let i of Object.values(t.parametricChildren)){let l=Array.from(i.nodePaths).join("|");W9(i,e,n+l,r)}t.wildcardChild&&W9(t.wildcardChild,e,"*",r)}function Wfe(t,e){let n={};return W9(t,n,t.prefix,e),pU(n)}dU.exports={prettyPrintTree:Wfe}});var yU=k((tke,mU)=>{"use strict";var Yfe=X9(),Wv=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,n){let r=n.params,i=n.opts.constraints||{},l={params:r,constraints:i,handler:n.handler,store:n.store||null,_createParamsObject:this._compileCreateParamsObject(r)},s=Object.keys(i);s.length===0&&(this.unconstrainedHandler=l);for(let o of s)this.constraints.includes(o)||(o==="version"?this.constraints.unshift(o):this.constraints.push(o));let a=s.includes(Yfe.name);if(!a&&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(l),this.handlers.sort((o,u)=>Object.keys(o.constraints).length-Object.keys(u.constraints).length),a||this._compileGetHandlerMatchingConstraints(e,i)}_compileCreateParamsObject(e){let n=[];for(let r=0;r<e.length;r++)n.push(`'${e[r]}':paramsArray[${r}]`);return new Function("paramsArray",`return{${n.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,n){for(let r=0;r<this.handlers.length;r++){let l=this.handlers[r].constraints[n];if(l!==void 0){let s=e.get(l)||0;s|=1<<r,e.set(l,s)}}}_constrainedIndexBitmask(e){let n=0;for(let r=0;r<this.handlers.length;r++)this.handlers[r].constraints[e]!==void 0&&(n|=1<<r);return~n}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let r of this.constraints){let i=e.newStoreForConstraint(r);this.constrainedHandlerStores[r]=i,this._buildConstraintStore(i,r)}let n=[];n.push(`
`)}for(let r in e.strategies)e.strategies[r].mustMatchWhenDerived&&!this.constraints.includes(r)&&n.push(`if(derivedConstraints.${r}!==undefined)returnnull`);n.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",n.join(`
`))}};mU.exports=Wv});var vU=k((nke,gU)=>{"use strict";var Qfe=yU(),n7={STATIC:0,PARAMETRIC:1,WILDCARD:2},Y9=class{constructor(){this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}addRoute(e,n){this.routes===null&&(this.routes=[]),this.handlerStorage===null&&(this.handlerStorage=new Qfe),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(n,e)}},Q9=class extends Y9{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,n){let r=this.staticChildren[e.charAt(n)];return r===void 0||!r.matchPrefix(e,n)?null:r}getStaticChild(e,n=0){if(e.length===n)return this;let r=this.findStaticMatchingChild(e,n);return r?r.getStaticChild(e,n+r.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let n=this.staticChildren[e.charAt(0)];if(n){let i=1;for(;i<n.prefix.length;i++)if(e.charCodeAt(i)!==n.prefix.charCodeAt(i)){n=n.split(this,i);break}return n.createStaticChild(e.slice(i))}let r=e.charAt(0);return this.staticChildren[r]=new Z9(e),this.staticChildren[r]}},Z9=class t extends Q9{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=n7.STATIC,this._compilePrefixMatch()}getParametricChild(e){let n=e&&e.source,r=this.parametricChildren.find(i=>(i.regex&&i.regex.source)===n);return r||null}createParametricChild(e,n,r){let i=this.getParametricChild(e);return i?(i.nodePaths.add(r),i):(i=new e7(e,n,r),this.parametricChildren.push(i),this.parametricChildren.sort((l,s)=>l.isRegex?s.isRegex?l.staticSuffix===null?1:s.staticSuffix===null?-1:s.staticSuffix.endsWith(l.staticSuffix)?1:l.staticSuffix.endsWith(s.staticSuffix)?-1:0:-1:1),i)}getWildcardChild(){return this.wildcardChild?this.wildcardChild:null}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new t7,this.wildcardChild}split(e,n){let r=this.prefix.slice(0,n),i=this.prefix.slice(n);this.prefix=i,this._compilePrefixMatch();let l=new t(r);return l.staticChildren[i.charAt(0)]=this,e.staticChildren[r.charAt(0)]=l,l}getNextNode(e,n,r,i){let l=this.findStaticMatchingChild(e,n),s=0;if(l===null){if(this.parametricChildren.length===0)return this.wildcardChild;l=this.parametricChildren[0],s=1}this.wildcardChild!==null&&r.push({paramsCount:i,brotherPathIndex:n,brotherNode:this.wildcardChild});for(let a=this.parametricChildren.length-1;a>=s;a--)r.push({paramsCount:i,brotherPathIndex:n,brotherNode:this.parametricChildren[a]});return l}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let n=1;n<this.prefix.length;n++){let r=this.prefix.charCodeAt(n);e.push(`path.charCodeAt(i+${n})===${r}`)}this.matchPrefix=new Function("path","i",`return${e.join(" && ")}`)}},e7=class extends Q9{constructor(e,n,r){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=n||null,this.kind=n7.PARAMETRIC,this.nodePaths=new Set([r])}getNextNode(e,n){return this.findStaticMatchingChild(e,n)}},t7=class extends Y9{constructor(){super(),this.kind=n7.WILDCARD}getNextNode(){return null}};gU.exports={StaticNode:Z9,ParametricNode:e7,WildcardNode:t7,NODE_TYPES:n7}});var EU=k((rke,_U)=>{"use strict";var Zfe=require("assert");function _c(){if(!(this instanceof _c))return new _c;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}_c.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[n,r,i]=t.split(".");return n=Number(n)||0,r=Number(r)||0,i=Number(i)||0,n>=this.maxMajor&&(this.maxMajor=n,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),r>=(this.maxMinors[n]||0)&&(this.maxMinors[n]=r,this.store[`${n}.x`]=e,this.store[`${n}.x.x`]=e),i>=(this.store[`${n}.${r}`]||0)&&(this.maxPatches[`${n}.${r}`]=i,this.store[`${n}.${r}.x`]=e),this.store[`${n}.${r}.${i}`]=e,this};_c.prototype.get=function(t){return this.store[t]};_U.exports={name:"version",mustMatchWhenDerived:!0,storage:_c,validate(t){Zfe(typeof t=="string","Version should be a string")}}});var wU=k((ike,bU)=>{"use strict";var ede=require("assert");function tde(){let t={},e=[];return{get:n=>{let r=t[n];if(r)return r;for
`)).bind(this)}};SU.exports=Qv});var AU=k((ske,xU)=>{"use strict";var ide=["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"];xU.exports=ide});var CU=k((ake,NU)=>{"use strict";function OU(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function lde(t,e){let n=!1,r=!1,i="";for(let s=1;s<t.length;s++){let a=t.charCodeAt(s);if(a===37){let o=t.charCodeAt(s+1),u=t.charCodeAt(s+2);OU(o,u)===null?n=!0:(r=!0,o===50&&u===53&&(n=!0,t=t.slice(0,s+1)+"25"+t.slice(s+1),s+=2),s+=2)}else if(a===63||a===35||a===59&&e){i=t.slice(s+1),t=t.slice(0,s);break}}return{path:n?decodeURI(t):t,querystring:i,shouldDecodeParam:r}}function sde(t){let e=t.indexOf("%");if(e===-1)return t;let n="",r=e;for(let i=e;i<t.length;i++)if(t.charCodeAt(i)===37){let l=t.charCodeAt(i+1),s=t.charCodeAt(i+2),a=OU(l,s);n+=t.slice(r,i)+a,r=i+3}return t.slice(0,e)+n+t.slice(r)}NU.exports={safeDecodeURI:lde,safeDecodeURIComponent:sde}});var i_=k((oke,FU)=>{"use strict";var jr=require("assert"),ade=Wj(),r7=sU(),t_=t1(),{prettyPrintTree:ode}=hU(),{StaticNode:RU,NODE_TYPES:Zv}=vU(),ude=TU(),D1=AU(),e_=X9(),{safeDecodeURI:cde,safeDecodeURIComponent:IU}=CU(),kU=/^https?:\/\/.*?\//,Mo=/(\/:[^/()]*?)\?(\/?)/;if(!r7(kU))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!r7(Mo))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function _r(t){if(!(this instanceof _r))return new _r(t);t=t||{},this._opts=t,t.defaultRoute?(jr(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(jr(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(jr(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=pde,t.querystringParser?(jr(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:ade.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.constrainer=new ude(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}_r.prototype.on=function(e,n,r,i,l){typeof r=="function"&&(i!==void 0&&(l=i),i=r,r={}),jr(typeof n=="string","Path should be a string"),jr(n.length>0,"The path could not be empty"),jr(n[0]==="/"||n[0]==="*","The first character of a path should be `/` or `*`"),jr(typeof i=="function","Handler should be a function");let s=n.match(Mo);if(s){jr(n.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let u=n.replace(Mo,"$1$2"),c=n.replace(Mo,"$2");this.on(e,u,r,i,l),this.on(e,c,r,i,l);return}let a=n;this.ignoreDuplicateSlashes&&(n=n_(n)),this.ignoreTrailingSlash&&(n=r_(n));let o=Array.isArray(e)?e:[e];for(let u of o)jr(typeof u=="string","Method should be a string"),jr(D1.includes(u),`Method'${u}'isnotanhttpmethod.`),this._on(u,n,r,i,l,a)};_r.prototype._on=function(e,n,r,i,l){let s={};r.constraints!==void 0&&(jr(typeof r.constraints=="object"&&r.constraints!==null,"Constraints should be an object"),Object.keys(r.constraints).length!==0&&(s=r.constraints)),this.constrainer.validateConstraints(s),this.constrainer.noteUsage(s),this.trees[e]===void 0&&(this.trees[e]=new RU("/"));let a=n;if(a==="*"&&this.trees[e].prefix.length!==0){let m=this.trees[e]
`;ln.DEFAULT_CONTENT_TYPE="application/octet-stream";ln.prototype.append=function(t,e,n){n=n||{},typeof n=="string"&&(n={filename:n});var r=lw.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),tJ.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,n),l=this._multiPartFooter();r(i),r(e),r(l),this._trackLength(i,e,n)};ln.prototype._trackLength=function(t,e,n){var r=0;n.knownLength!=null?r+=+n.knownLength:Buffer.isBuffer(e)?r=e.length:typeof e=="string"&&(r=Buffer.byteLength(e)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(t)+ln.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof $Se))&&(n.knownLength||this._valuesToMeasure.push(e))};ln.prototype._lengthRetriever=function(t,e){t.hasOwnProperty("fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):MSe.stat(t.path,function(n,r){var i;if(n){e(n);return}i=r.size-(t.start?t.start:0),e(null,i)}):t.hasOwnProperty("httpVersion")?e(null,+t.headers["content-length"]):t.hasOwnProperty("httpModule")?(t.on("response",function(n){t.pause(),e(null,+n.headers["content-length"])}),t.resume()):e("Unknown stream")};ln.prototype._multiPartHeader=function(t,e,n){if(typeof n.header=="string")return n.header;var r=this._getContentDisposition(e,n),i=this._getContentType(e,n),l="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(r||[]),"Content-Type":[].concat(i||[])};typeof n.header=="object"&&iw(s,n.header);var a;for(var o in s)s.hasOwnProperty(o)&&(a=s[o],a!=null&&(Array.isArray(a)||(a=[a]),a.length&&(l+=o+": "+a.join("; ")+ln.LINE_BREAK)));return"--"+this.getBoundary()+ln.LINE_BREAK+l+ln.LINE_BREAK};ln.prototype._getContentDisposition=function(t,e){var n,r;return typeof e.filepath=="string"?n=nw.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t.name||t.path?n=nw.basename(e.filename||t.name||t.path):t.readable&&t.hasOwnProperty("httpVersion")&&(n=nw.basename(t.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r};ln.prototype._getContentType=function(t,e){var n=e.contentType;return!n&&t.name&&(n=rw.lookup(t.name)),!n&&t.path&&(n=rw.lookup(t.path)),!n&&t.readable&&t.hasOwnProperty("httpVersion")&&(n=t.headers["content-type"]),!n&&(e.filepath||e.filename)&&(n=rw.lookup(e.filepath||e.filename)),!n&&typeof t=="object"&&(n=ln.DEFAULT_CONTENT_TYPE),n};ln.prototype._multiPartFooter=function(){return function(t){var e=ln.LINE_BREAK,n=this._streams.length===0;n&&(e+=this._lastBoundary()),t(e)}.bind(this)};ln.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+ln.LINE_BREAK};ln.prototype.getHeaders=function(t){var e,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)t.hasOwnProperty(e)&&(n[e.toLowerCase()]=t[e]);return n};ln.prototype.setBoundary=function(t){this._boundary=t};ln.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};ln.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)typeof this._streams[n]!="function"&&(Buffer.isBuffer(this._streams[n])?t=Buffer.concat([t,this._streams[n]]):t=Buffer.concat([t,Buffer.from(this._streams[n])]),(typeof this._streams[n]!="string"||this._streams[n].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(ln.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};ln.prototype._generateBoundary=function(){for(var t="--------------------------",e=0;e<24;e++)t+=Math.floor(Math.random()*10).toString(16);this._boundary=t};ln.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};ln.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};ln.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure
`,f.message,f.stack);var m=new Error("tunneling socket could not be established, cause="+f.message);m.code="ECONNRESET",e.request.emit("error",m),r.removeSocket(i)}};s2.prototype.removeSocket=function(e){var n=this.sockets.indexOf(e);if(n!==-1){this.sockets.splice(n,1);var r=this.requests.shift();r&&this.createSocket(r,function(i){r.request.onSocket(i)})}};function sK(t,e){var n=this;s2.prototype.createSocket.call(n,t,function(r){var i=t.request.getHeader("host"),l=$w({},n.options,{socket:r,servername:i?i.replace(/:.*$/,""):t.host}),s=MTe.connect(0,l);n.sockets[n.sockets.indexOf(r)]=s,e(s)})}function aK(t,e,n){return typeof t=="string"?{host:t,port:e,localAddress:n}:t}function $w(t){for(var e=1,n=arguments.length;e<n;++e){var r=arguments[e];if(typeof r=="object")for(var i=Object.keys(r),l=0,s=i.length;l<s;++l){var a=i[l];r[a]!==void 0&&(t[a]=r[a])}}return t}var a3;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?a3=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:a3=function(){};D0.debug=a3});var cK=k((OUe,uK)=>{uK.exports=oK()});var sZ=k(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.removeTrailingChar=vu.merge=void 0;var uOe=(...t)=>{let e={};return t.forEach(function(n){var r;for(r in n)r in e&&e[r]===null?e[r]=n[r]:r in e&&Array.isArray(e[r])?e[r]=e[r].concat(n[r]):r in e&&typeof e[r]=="object"?e[r]=(0,vu.merge)(e[r],n[r]):e[r]=n[r]}),e};vu.merge=uOe;var cOe=(t,e)=>t.length>1&&t.endsWith(e)?t.substring(0,t.length-1):t;vu.removeTrailingChar=cOe});var F0=k(K3=>{"use strict";Object.defineProperty(K3,"__esModule",{value:!0});K3.DataError=K3.DatabaseError=K3.NestedError=void 0;var J5=class extends Error{inner;id;constructor(e,n,r){super(e),this.inner=r,this.id=n,this.name=this.constructor.name}toString(){let e=this.name+": "+this.message;return this.inner?e+`:
`+this.inner:e}};K3.NestedError=J5;var cT=class extends J5{};K3.DatabaseError=cT;var pT=class extends J5{};K3.DataError=pT});var yT=k(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.getArrayIndicies=ll.validateArrayIndex=ll.validateArrayIndicies=ll.isInt=ll.ArrayInfo=ll.arrayRegex=void 0;var Ef=F0(),pOe=()=>/^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;ll.arrayRegex=pOe;var fT={},dT=class t{property;index=0;append=!1;indicies=[];constructor(e,n){this.property=e;let r=n[0]??0;if(this.append=r===""||n[n.length-1]==="",this.indicies=n,hT(r))this.index=parseInt(r);else if(!this.append)throw new Ef.DataError("Only numerical values accepted for array index",200)}static processArray(e){if(typeof e>"u")return null;if(fT[e])return fT[e];let r=(0,ll.arrayRegex)().exec(e.trim());if(r!=null){let i=r[1],l="["+r[2].toString()+"]",s=mT(l);return aZ(s),fT[e]=new t(i,s)}return null}getIndex(e,n){if(this.append)return-1;let r=this.index;if(r==-1){let i=n?e:e[this.property];return i.length===0?0:i.length-1}return r}getData(e){if(this.append)throw new Ef.DataError("Can't get data when appending",100);let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);return r[n]}setData(e,n){if(this.append){let r=e[this.property];this.indicies.forEach(i=>{i!==""&&(i=+i,i===-1&&(i=r.length-1),r=r[+i])}),r.push(n)}else{let{index:r,dataForProperty:i}=this.getArrayDataAndIndexFromProperty(e);r===-1?i.push(n):i[r]=n}}delete(e){if(this.append)throw new Ef.DataError("Can't delete an appended data",10);let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);r.splice(n,1)}isValid(e){let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);return r.hasOwnProperty(n)}getArrayDataAndIndexFromProperty(e){let n=0,r=e instanceof Array?e:e[this.property]??e;if(this.indicies.length>0){n=+this.indicies[this.indicies.length-1];for(let i=0;i<this.indicies.length-1;i++){let l=+this.indicies[i];l===-1&&(l=r.length-1),r=r[l]}n===-1&&(n=r.length-1)}return{index:n,dataForProperty:r}}isMultiDimensional(){return this.indicies.length>1}};ll.ArrayInfo=dT;function hT(t){return!isNaN(t)&&Number(t)==t&&!isNaN(parseInt(t,10))}ll.isInt=hT;function aZ(t){let e=t.filter(n=>n==="");if(e.length>1)throw Error("Only one append index is supported for nested arrays");if(e.length===1&&t[t.length-1]!=="")throw Error("Append index must be at the end of the nested array")}ll.validateArrayIndicies=aZ;function oZ(t){if(t.length!==0&&!hT(t))throw new Ef.DataError("Only numerical values accepted for array index",200)}ll.validateArrayIndex=oZ;function mT(t){if(t.length===0)return[];if(t.charAt(0)!=="[")throw new Error("Invalid array syntax detected");let e=t.substring(1,t.indexOf("]"));oZ(e);let n=e.length+2;return[e,...mT(t.substring(n))]}ll.getArrayIndicies=mT});var pZ=k(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.DBParentData=void 0;var uZ=yT(),cZ=F0(),gT=class{parent;data;db;dataPath;constructor(e,n,r,i){this.parent=i,this.data=e,this.db=n,this.dataPath=r}checkArray(e=!1){let n=uZ.ArrayInfo.processArray(this.parent);if(n&&(!n.append||e)&&!n.isValid(this.data))throw new cZ.DataError("DataPath: /"+this.dataPath+". Can't find index "+n.index+" in array "+n.property,10);return n}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 n=uZ.ArrayInfo.processArray(this.parent);if(n){if(!this.data.hasOwnProperty(n.property))this.data[n.property]=[];else if(!Array.isArray(this.data[n.property]))throw new cZ.DataError("DataPath: /"+this.dataPath+". "+n.property+" is not an array.",11);n.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]}};bf.DBParentData=gT});var dZ=k((Pqe,fZ)=>{fZ.exports=function(){"use strict";function t(){this.readers=0,this.queue=[]}function e(l,s,a){var o;typeof l!="function"?(i.hasOwnProperty(l)
)`,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])"},LB={};function FB(t,e){var n=e.getSiblings(t);return n.length<=1||(t=n.indexOf(t))<0||t===n.length-1?[]:n.slice(t+1).filter(e.isTag)}function oE(t){return{xmlMode:!!t.xmlMode,lowerCaseAttributeNames:!!t.lowerCaseAttributeNames,lowerCaseTags:!!t.lowerCaseTags,quirksMode:!!t.quirksMode,cacheResults:!!t.cacheResults,pseudos:t.pseudos,adapter:t.adapter,equals:t.equals}}var M_=(t,e,n,r,i)=>{let l=i(e,oE(n),r);return l===Pt.trueFunc?t:l===Pt.falseFunc?Pt.falseFunc:s=>l(s)&&t(s)},$_={is:M_,matches:M_,where:M_,not(t,e,n,r,i){let l=i(e,oE(n),r);return l===Pt.falseFunc?t:l===Pt.trueFunc?Pt.falseFunc:s=>!l(s)&&t(s)},has(t,e,n,r,i){let l=n.adapter,s=oE(n),a=(s.relativeSelector=!0,e.some(c=>c.some(sE))?[LB]:void 0),o=i(e,s,a);if(o===Pt.falseFunc)return Pt.falseFunc;let u=function(c,f){return c===Pt.falseFunc?Pt.falseFunc:m=>f.isTag(m)&&c(m)}(o,l);if(a&&o!==Pt.trueFunc){let{shouldTestNextSiblings:c=!1}=o;return d=>{if(!t(d))return!1;a[0]=d;var m=l.getChildren(d),d=c?[...m,...FB(d,l)]:m;return l.existsOne(u,d)}}return c=>t(c)&&l.existsOne(u,l.getChildren(c))}};function B_(t,e){return(t=e.getParent(t))&&e.isTag(t)?t:null}function wye(t,e,n,r,i){let{adapter:l,equals:s}=n;switch(e.type){case at.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case at.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case at.Attribute:if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return n.xmlMode&&!n.lowerCaseAttributeNames||(e.name=e.name.toLowerCase()),vye[e.action](t,e,n);case at.Pseudo:return function(a,o,u,c,f){let{name:m,data:d}=o;if(Array.isArray(d)){if(m in $_)return $_[m](a,d,u,c,f);throw new Error(`Unknownpseudo-class:${m}(${d})`)}let y=(o=u.pseudos)==null?void 0:o[m],_=typeof y=="string"?y:bye[m];if(typeof _=="string"){if(d!=null)throw new Error(`Pseudo${m}doesn'thaveanyarguments`);let S=Y7(_);return $_.is(a,S,u,c,f)}if(typeof y=="function")return b$(y,m,d,1),S=>y(S,d)&&a(S);if(m in aE)return aE[m](a,d,u,c);if(m in E$){let S=E$[m];return b$(S,m,d,2),w=>S(w,u,d)&&a(w)}throw new Error("Unknown pseudo-class :"+m)}(t,e,n,r,i);case at.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let a=e.name;return n.xmlMode&&!n.lowerCaseTags||(a=a.toLowerCase()),function(o){return l.getName(o)===a&&t(o)}}case at.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(o){let u=o;for(;u=B_(u,l);)if(t(u))return!0;return!1};let a=new WeakSet;return function(o){let u=o;for(;u=B_(u,l);)if(!a.has(u)){if(l.isTag(u)&&t(u))return!0;a.add(u)}return!1}}case"_flexibleDescendant":return function(a){let o=a;do if(t(o))return!0;while(o=B_(o,l));return!1};case at.Parent:return function(a){return l.getChildren(a).some(o=>l.isTag(o)&&t(o))};case at.Child:return function(a){return(a=l.getParent(a))!=null&&l.isTag(a)&&t(a)};case at.Sibling:return function(a){var o=l.getSiblings(a);for(let c=0;c<o.length;c++){var u=o[c];if(s(a,u))break;if(l.isTag(u)&&t(u))return!0}return!1};case at.Adjacent:return l.prevElementSibling?function(a){return(a=l.prevElementSibling(a))!=null&&t(a)}:function(a){var o=l.getSiblings(a);let u;for(let f=0;f<o.length;f++){var c=o[f];if(s(a,c))break;l.isTag(c)&&(u=c)}return!!u&&t(u)};case at.Universal:if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not ye
`)}}):{name:r,value:i.replace(S$,`\r
`)}}).toArray()}}),Bc=function(t,e,n){if(this.length=0,this.options=n,this._root=e,t){for(var r=0;r<t.length;r++)this[r]=t[r];this.length=t.length}},$E=(Bc.prototype.cheerio="[cheerio object]",Bc.prototype.splice=Array.prototype.splice,Bc.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(Bc.prototype,oye,Vye,Xye,Wye,Qye),function(t,e){return($E=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,r){n.__proto__=r}:function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}))(t,e)}),Zye=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}$E(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)},Hc=function(){return(Hc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},ege=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]),hr="\uFFFD",T$=(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.NUMBER_SIGN=35]="NUMBER_SIGN",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_F=70]="LATIN_CAPITAL_F",t[t.LATIN_CAPITAL_X=88]="LATIN_CAPITAL_X",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_F=102]="LATIN_SMALL_F",t[t.LATIN_SMALL_X=120]="LATIN_SMALL_X",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z",t[t.REPLACEMENT_CHARACTER=65533]="REPLACEMENT_CHARACTER"}(D=D||{}),"--"),x$="[CDATA[",A$="doctype",j1="script",tge="public",nge="system";function YB(t){return 55296<=t&&t<=57343}function QB(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&1<=t&&t<=31||127<=t&&t<=159}function ZB(t){return 64976<=t&&t<=65007||ege.has(t)}(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missin
`,this.firstUpdate&&(U+=" "),this.message=U+(this.message||""),this.firstUpdate=!1,this},v}function u(w){return n.toString.call(w)==="[object Function]"}function c(w){return n.toString.call(w)==="[object Array]"}function f(w){return n.toString.call(w)==="[object String]"}function m(w){return n.toString.call(w)==="[object Object]"}function d(w){var E=function(g){return g?typeof g=="string"?g.split("."):[g]:[]}(w);return function(g){for(var v=g,x=0;x<E.length;x++){var O=E[x];if(!s(v,O))return;v=v[O]}return v}}function y(w){return Array.prototype.slice.call(w)}function _(w,E,g){return Array.prototype.indexOf.call(w||[],E,g)}function S(w){var E,g=[];for(E in w)s(w,E)&&g.push(E);return g}l.hasOwnProp=s,l._prettifyError=function(w,E,g){return(g=g.Update?g:new l.TemplateError(g)).Update(w),E||(w=g,(g=new Error(w.message)).name=w.name),g},Object.setPrototypeOf?Object.setPrototypeOf(o.prototype,Error.prototype):o.prototype=Object.create(Error.prototype,{constructor:{value:o}}),l.TemplateError=o,l.escape=function(w){return w.replace(i,a)},l.isFunction=u,l.isArray=c,l.isString=f,l.isObject=m,l.getAttrGetter=d,l.groupBy=function(w,E,g){for(var v={},x=u(E)?E:d(E),O=0;O<w.length;O++){var N=w[O],R=x(N,O);if(R===void 0&&g===!0)throw new TypeError('groupby: attribute "'+E+'" resolved to undefined');(v[R]||(v[R]=[])).push(N)}return v},l.toArray=y,l.without=function(w){var E=[];if(w)for(var g=w.length,v=y(arguments).slice(1),x=-1;++x<g;)_(v,w[x])===-1&&E.push(w[x]);return E},l.repeat=function(w,E){for(var g="",v=0;v<E;v++)g+=w;return g},l.each=function(w,E,g){if(w!=null){if(e.forEach&&w.forEach===e.forEach)w.forEach(E,g);else if(w.length===+w.length)for(var v=0,x=w.length;v<x;v++)E.call(g,w[v],v,w)}},l.map=function(w,E){var g=[];if(w!=null){if(e.map&&w.map===e.map)return w.map(E);for(var v=0;v<w.length;v++)g[g.length]=E(w[v],v);w.length===+w.length&&(g.length=w.length)}return g},l.asyncIter=function(w,E,g){var v=-1;(function x(){++v<w.length?E(w[v],v,x,g):g()})()},l.asyncFor=function(w,E,g){var v=S(w||{}),x=v.length,O=-1;(function N(){var R=v[++O];O<x?E(R,w[R],O,x,N):g()})()},l.indexOf=_,l.keys=S,l._entries=function(w){return S(w).map(function(E){return[E,w[E]]})},l._values=function(w){return S(w).map(function(E){return w[E]})},l._assign=l.extend=function(w,E){return w=w||{},S(E).forEach(function(g){w[g]=E[g]}),w},l.inOperator=function(w,E){if(c(E)||f(E))return E.indexOf(w)!==-1;if(m(E))return w in E;throw new Error('Cannot use "in" operator to search for "'+w+'" in unexpected types.')}});function TH(){throw new Error("setTimeout has not been defined")}function xH(){throw new Error("clearTimeout has not been defined")}var B2=TH,H2=xH;function AH(t){if(B2===setTimeout)return setTimeout(t,0);if((B2===TH||!B2)&&setTimeout)return(B2=setTimeout)(t,0);try{return B2(t,0)}catch{try{return B2.call(null,t,0)}catch{return B2.call(this,t,0)}}}typeof e2.setTimeout=="function"&&(B2=setTimeout),typeof e2.clearTimeout=="function"&&(H2=clearTimeout);var Ko,n2=[],Z1=!1,I7=-1;function Zge(){Z1&&Ko&&(Z1=!1,Ko.length?n2=Ko.concat(n2):I7=-1,n2.length)&&OH()}function OH(){if(!Z1){var t=AH(Zge);Z1=!0;for(var e=n2.length;e;){for(Ko=n2,n2=[];++I7<e;)Ko&&Ko[I7].run();I7=-1,e=n2.length}Ko=null,Z1=!1,function(n){if(H2===clearTimeout)return clearTimeout(n);if((H2===xH||!H2)&&clearTimeout)return(H2=clearTimeout)(n);try{H2(n)}catch{try{return H2.call(null,n)}catch{return H2.call(this,n)}}}(t)}}function NH(t,e){this.fun=t,this.array=e}function eu(){}NH.prototype.run=function(){this.fun.apply(null,this.array)};var eve=eu,tve=eu,nve=eu,rve=eu,ive=eu,lve=eu,sve=eu,V1=e2.performance||{},ave=V1.now||V1.mozNow||V1.msNow||V1.oNow||V1.webkitNow||function(){return new Date().getTime()},ove=new Date,K2={nextTick:function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];n2.push(new NH(t,e)),n2.length!==1||Z1||AH(OH)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:eve,addListener:tve,once:nve,off:rve,removeListener:ive,removeAllListeners:lve,emit:sve,binding:function(t){throw new Error("process.
`?this.forward():this.back())),rl(UH,d,n,r);if(d=(d=this._extractString(this.tags.VARIABLE_END))||this._extractString("-"+this.tags.VARIABLE_END))return this.in_code=!1,rl($H,d,n,r);if(i==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var l="";!this.isFinished();){if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}l+=this.current(),this.forward()}for(var s=["g","i","m","y"],a="";!this.isFinished()&&s.indexOf(this.current())!==-1;)a+=this.current(),this.forward();return rl(nV,{body:l,flags:a},n,r)}if(oB.indexOf(i)!==-1){this.forward();var o,u=["==","===","!=","!==","<=",">=","//","**"],c=i+this.current();switch(Le.indexOf(u,c)!==-1&&(this.forward(),Le.indexOf(u,(i=c)+this.current())!==-1)&&(i=c+this.current(),this.forward()),i){case"(":o=HH;break;case")":o=VH;break;case"[":o=qH;break;case"]":o=zH;break;case"{":o=GH;break;case"}":o=JH;break;case",":o=XH;break;case":":o=WH;break;case"~":o=YH;break;case"|":o=QH;break;default:o=KH}return rl(o,i,n,r)}if((d=this._extractUntil(aB+oB)).match(/^[-+]?[0-9]+$/))return this.current()==="."?(this.forward(),u=this._extract("0123456789"),rl(ZH,d+"."+u,n,r)):rl("int",d,n,r);if(d.match(/^(true|false)$/))return rl(eV,d,n,r);if(d==="none"||d==="null")return rl(AE,d,n,r);if(d)return rl(tV,d,n,r);throw new Error("Unexpected value while parsing: "+d)}var f,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(d=(d=this._extractString(this.tags.BLOCK_START+"-"))||this._extractString(this.tags.BLOCK_START))return this.in_code=!0,rl(jH,d,n,r);if(d=(d=this._extractString(this.tags.VARIABLE_START+"-"))||this._extractString(this.tags.VARIABLE_START))return this.in_code=!0,rl(MH,d,n,r);var d="",y=!1;for(this._matches(this.tags.COMMENT_START)&&(y=!0,d=this._extractString(this.tags.COMMENT_START));(f=this._extractUntil(m))!==null;){if(d+=f,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!y){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&0<this.colno&&this.colno<=d.length){var _=d.slice(-this.colno);if(/^\s+$/.test(_)&&!(d=d.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!y)throw new Error("unexpected end of comment");d+=this._extractString(this.tags.COMMENT_END);break}d+=this.current(),this.forward()}if(f===null&&y)throw new Error("expected end of comment, got end of file");return rl(y?BH:FH,d,n,r)},e._parseString=function(n){this.forward();for(var r="";!this.isFinished()&&this.current()!==n;){var i=this.current();if(i==="\\")switch(this.forward(),this.current()){case"n":r+=`
`))})},r.compileRoot=function(i,l){var s=this,a=(l&&this.fail("compileRoot: root node can't have frame"),l=new K_,this._emitFuncBegin(i,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(i,l),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,[]);(l=i.findAll(X.Block)).forEach(function(o,u){var c=o.name.value;if(a.indexOf(c)!==-1)throw new Error('Block "'+c+'" defined more than once.');a.push(c),s._emitFuncBegin(o,"b_"+c),c=new K_,s._emitLine("var frame = frame.push(true);"),s.compile(o.body,c),s._emitFuncEnd()}),this._emitLine("return {"),l.forEach(function(o,u){o="b_"+o.name.value,s._emitLine(o+": "+o+",")}),this._emitLine(`root:root
};`)},r.compile=function(i,l){var s=this["compile"+i.typename];s?s.call(this,i,l):this.fail("compile: Cannot compile node: "+i.typename,i.lineno,i.colno)},r.getCode=function(){return this.codebuf.join("")},n}(l0.Obj),h_e={compile:function(s,e,n,r,i){var l=new hB(r,(i=i===void 0?{}:i).throwOnUndefined),s=(n||[]).map(function(a){return a.preprocess}).filter(function(a){return!!a}).reduce(function(a,o){return o(a)},s);return l.compile(u_e.transform(s_e.parse(s,n,i),e,r)),l.getCode()},Compiler:hB},m_e=ht(function(t){function e(d,y){return d==null||d===!1?y:d}function n(d){return d!=d}function r(d){var y=(d=e(d,"")).toLowerCase();return mt.copySafeness(d,y.charAt(0).toUpperCase()+y.slice(1))}function i(d){if(Le.isString(d))return d.split("");if(Le.isObject(d))return Le._entries(d||{}).map(function(y){return{key:y[0],value:y[1]}});if(Le.isArray(d))return d;throw new Le.TemplateError("list filter: type not iterable")}function l(d){return function(y,_,S){var w=this,E=w.env.getTest(_=_===void 0?"truthy":_);return Le.toArray(y).filter(function(g){return E.call(w,g,S)===d})}}function s(d){return mt.copySafeness(d,d.replace(/^\s*|\s*$/g,""))}(t=t.exports={}).abs=Math.abs,t.batch=function(d,y,_){for(var S=[],w=[],E=0;E<d.length;E++)E%y==0&&w.length&&(S.push(w),w=[]),w.push(d[E]);if(w.length){if(_)for(E=w.length;E<y;E++)w.push(_);S.push(w)}return S},t.capitalize=r,t.center=function(d,y){var _;return(d=e(d,"")).length>=(y=y||80)?d:(y-=d.length,_=Le.repeat(" ",y/2-y%2),y=Le.repeat(" ",y/2),mt.copySafeness(d,_+d+y))},t.default=function(d,y,_){return _?d||y:d!==void 0?d:y},t.dictsort=function(d,y,_){if(!Le.isObject(d))throw new Le.TemplateError("dictsort filter: val must be an object");var S,w,E=[];for(w in d)E.push([w,d[w]]);if(_===void 0||_==="key")S=0;else{if(_!=="value")throw new Le.TemplateError("dictsort filter: You can only sort by either key or value");S=1}return E.sort(function(g,v){return g=g[S],v=v[S],y||(Le.isString(g)&&(g=g.toUpperCase()),Le.isString(v)&&(v=v.toUpperCase())),v<g?1:g===v?0:-1}),E},t.dump=function(d,y){return JSON.stringify(d,null,y)},t.escape=function(d){return d instanceof mt.SafeString?d:mt.markSafe(Le.escape((d=d??"").toString()))},t.safe=function(d){return d instanceof mt.SafeString?d:mt.markSafe((d=d??"").toString())},t.first=function(d){return d[0]},t.forceescape=function(d){return mt.markSafe(Le.escape((d=d??"").toString()))},t.groupby=function(d,y){return Le.groupBy(d,y,this.env.opts.throwOnUndefined)},t.indent=function(d,E,_){if((d=e(d,""))==="")return"";E=E||4;var S=d.split(`
`):_.replace(/\s+/gi," ");return mt.copySafeness(d,S)},t.title=function(d){var y=(d=e(d,"")).split(" ").map(r);return mt.copySafeness(d,y.join(" "))},t.trim=s,t.truncate=function(d,y,_,S){var w=d;return(d=e(d,"")).length<=(y=y||255)?d:(d=_?d.substring(0,y):((_=d.lastIndexOf(" ",y))===-1&&(_=y),d.substring(0,_)),mt.copySafeness(w,d+=S??"..."))},t.upper=function(d){return(d=e(d,"")).toUpperCase()},t.urlencode=function(d){var y=encodeURIComponent;return Le.isString(d)?y(d):(Le.isArray(d)?d:Le._entries(d)).map(function(w){var S=w[0],w=w[1];return y(S)+"="+y(w)}).join("&")};var a=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,o=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,u=/^https?:\/\/.*$/,c=/^www\./,f=/\.(?:org|net|com)(?:\:|\/|$)/,m=(t.urlize=function(d,y,_){n(y)&&(y=1/0);varS=_===!0?' rel="nofollow"':"";returnd.split(/(\s+)/).filter(function(w){returnw&&w.length}).map(function(w){varE=w.match(a),g=(E=E?E[1]:w).substr(0,y);returnu.test(E)?'<a href="'+E+'"'+S+">"+g+"</a>":c.test(E)?'<a href="http://'+E+'"'+S+">"+g+"</a>":o.test(E)?'<a href="mailto:'+E+'">'+E+"</a>":f.test(E)?'<a href="http://'+E+'"'+S+">"+g+"</a>":w}).join("")},t.wordcount=function(d){return(d=(d=e(d,""))?d.match(/\w+/g):null)?d.length:null},t.float=function(d,y){returnn(d=parseFloat(d))?y:d},mt.makeMacro(["value","default","base"],[],function(d,y,_){return_===void0&&(_=10),n(d=parseInt(d,_))?y:d}));t.int=m,t.d=t.default,t.e=t.escape}),J7={};functionvV(t,e){for(varn=0,r=t.length-1;0<=r;r--){vari=t[r];i==="."?t.splice(r,1):i===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;)t.unshift("..");returnt}vary_e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,X_=function(t){returny_e.exec(t).slice(1)};functionW_(){for(vart="",e=!1,n=arguments.length-1;-1<=n&&!e;n--){varr=0<=n?arguments[n]:"/";if(typeofr!="string")thrownewTypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,e=r.charAt(0)==="/")}return(e?"/":"")+vV(KE(t.split("/"),function(i){return!!i}),!e).join("/")||"."}functionmB(t){vare=_V(t),n=g_e(t,-1)==="/";return(t=(t=vV(KE(t.split("/"),function(r){return!!r}),!e).join("/"))||e?t:".")&&n&&(t+="/"),(e?"/":"")+t}function_V(t){returnt.charAt(0)==="/"}vare0={extname:function(t){returnX_(t)[3]},basename:function(t,e){returnt=X_(t)[2],e&&t.substr(-1*e.length)===e?t.substr(0,t.length-e.length):t},dirname:function(n){vare=(n=X_(n))[0],n=n[1];returne||n?e+(n&&n.substr(0,n.length-1)):"."},sep:"/",delimiter:":",relative:function(t,e){functionn(u){for(varc=0;c<u.length&&u[c]==="";c++);for(varf=u.length-1;0<=f&&u[f]==="";f--);returnf<c?[]:u.slice(c,f-c+1)}t=W_(t).substr(1),e=W_(e).substr(1);for(varr=n(t.split("/")),i=n(e.split("/")),l=Math.min(r.length,i.length),s=l,a=0;a<l;a++)if(r[a]!==i[a]){s=a;break}for(varo=[],a=s;a<r.length;a++)o.push("..");return(o=o.concat(i.slice(s))).join("/")},join:function(){returnmB(KE(Array.prototype.slice.call(arguments,0),function(t,e){if(typeoft!="string")thrownewTypeError("Arguments to path.join must be strings");returnt}).join("/"))},isAbsolute:_V,normalize:mB,resolve:W_};functionKE(t,e){if(t.filter)returnt.filter(e);for(varn=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);returnn}varg_e="ab".substr(-1)==="b"?function(t,e,n){returnt.substr(e,n)}:function(t,e,n){returne<0&&(e=t.length+e),t.substr(e,n)};functionEV(t,e){return(EV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){returnn.__proto__=r,n})(t,e)}varXE=function(t){vare;functionn(){returnt.apply(this,arguments)||this}e=t,(r=n).prototype=Object.create(e.prototype),EV(r.prototype.constructor=r,e);varr=n.prototype;returnr.resolve=function(i,l){returne0.resolve(e0.dirname(i),l)},r.isRelative=function(i){returni.indexOf("./")===0||i.indexOf("../")===0},n}(l0.EmitterObj);functionbV(t,e){return(bV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){returnn.__proto__=r,n})(t,e)}varv_e=function(t){vare,n;functionr(i){varl;return(l=t.call(this)||this).precompiled=i||{},l}returnn=t,(e=r).prototype=Object.create(n.prototype),bV(e.prototype.co
`)){let o=a.trim();if(o)if(o.startsWith("#")){if(o.startsWith("#EXT")){let u=W_e(o,l);u&&s.push(u)}}else s.push(o)}return s.length!==0&&s[0].name==="EXTM3U"||Be("The EXTM3U tag MUST be the first line."),s}(t,e),r=Y_e(n,e);return r.source=t,r}var Q_e=["#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"],Z_e=["#EXT-X-MEDIA"],cb=class extends Array{constructor(e){super(),this.baseUri=e}push(...e){for(let n of e)if(n.startsWith("#"))if(Q_e.some(r=>n.startsWith(r)))super.push(n);else{if(this.includes(n)){if(Z_e.some(r=>n.startsWith(r)))continue;Be(`Redundantitem(${n})`)}super.push(n)}else super.push(n);return this.length}};function hb(t,e){let n=1e3;e&&(n=Math.pow(10,e));let r=Math.round(t*n)/n;return e?r.toFixed(e):r}function eEe(t){let e=[`DATA-ID="${t.id}"`];return t.language&&e.push(`LANGUAGE="${t.language}"`),t.value?e.push(`VALUE="${t.value}"`):t.uri&&e.push(`URI="${t.uri}"`),`#EXT-X-SESSION-DATA:${e.join(",")}`}function eq(t,e){let n=e?"#EXT-X-SESSION-KEY":"#EXT-X-KEY",r=[`METHOD=${t.method}`];return t.uri&&r.push(`URI="${t.uri}"`),t.iv&&(t.iv.length!==16&&Be("IV must be a 128-bit unsigned integer"),r.push(`IV=${YV(t.iv)}`)),t.format&&r.push(`KEYFORMAT="${t.format}"`),t.formatVersion&&r.push(`KEYFORMATVERSIONS="${t.formatVersion}"`),`${n}:${r.join(",")}`}function tEe(t,e){let n=e.isIFrameOnly?"#EXT-X-I-FRAME-STREAM-INF":"#EXT-X-STREAM-INF",r=[`BANDWIDTH=${e.bandwidth}`];if(e.averageBandwidth&&r.push(`AVERAGE-BANDWIDTH=${e.averageBandwidth}`),e.isIFrameOnly&&r.push(`URI="${e.uri}"`),e.codecs&&r.push(`CODECS="${e.codecs}"`),e.resolution&&r.push(`RESOLUTION=${e.resolution.width}x${e.resolution.height}`),e.frameRate&&r.push(`FRAME-RATE=${hb(e.frameRate,3)}`),e.hdcpLevel&&r.push(`HDCP-LEVEL=${e.hdcpLevel}`),e.audio.length>0){r.push(`AUDIO="${e.audio[0].groupId}"`);for(let i of e.audio)t.push(vp(i))}if(e.video.length>0){r.push(`VIDEO="${e.video[0].groupId}"`);for(let i of e.video)t.push(vp(i))}if(e.subtitles.length>0){r.push(`SUBTITLES="${e.subtitles[0].groupId}"`);for(let i of e.subtitles)t.push(vp(i))}if(B_e().allowClosedCaptionsNone&&e.closedCaptions.length===0)r.push("CLOSED-CAPTIONS=NONE");else if(e.closedCaptions.length>0){r.push(`CLOSED-CAPTIONS="${e.closedCaptions[0].groupId}"`);for(let i of e.closedCaptions)t.push(vp(i))}if(e.score&&r.push(`SCORE=${e.score}`),e.allowedCpc){let i=[];for(let{format:l,cpcList:s}of e.allowedCpc)i.push(`${l}:${s.join("/")}`);r.push(`ALLOWED-CPC="${i.join(",")}"`)}e.videoRange&&r.push(`VIDEO-RANGE=${e.videoRange}`),e.stableVariantId&&r.push(`STABLE-VARIANT-ID="${e.stableVariantId}"`),e.programId&&r.push(`PROGRAM-ID=${e.programId}`),t.push(`${n}:${r.join(",")}`),e.isIFrameOnly||t.push(`${e.uri}`)}function vp(t){let e=[`TYPE=${t.type}`,`GROUP-ID="${t.groupId}"`,`NAME="${t.name}"`];return t.isDefault!==void 0&&e.push("DEFAULT="+(t.isDefault?"YES":"NO")),t.autoselect!==void 0&&e.push("AUTOSELECT="+(t.autoselect?"YES":"NO")),t.forced!==void 0&&e.push("FORCED="+(t.forced?"YES":"NO")),t.language&&e.push(`LANGUAGE="${t.language}"`),t.assocLanguage&&e.push(`ASSOC-LANGUAGE="${t.assocLanguage}"`),t.instreamId&&e.push(`INSTREAM-ID="${t.instreamId}"`),t.characteristics&&e.push(`CHARACTERISTICS="${t.characteristics}"`),t.channels&&e.push(`CHANNELS="${t.channels}"`),t.uri&&e.push(`URI="${t.uri}"`),`#EXT-X-MEDIA:${e.join(",")}`}function nEe(t,e,n,r,i=1,l=null){let s=!1,a="";if(e.discontinuity&&t.push("#EXT-X-DISCONTINUITY"),e.key){let u=eq(e.key);u!==n&&(t.push(u),n=u)}if(e.map){let u=function(c){let f=[`URI="${c.uri}"`];return c.byterange&&f.push(`BYTERANGE="${sb(c.byterange)}"`),`#EXT-X-MAP:${f.join(",")}`}(e.map);u!==r&&(t.push(u),r=u)}if(e.programDateTime&&t.push(`#EXT-X-PROGRAM-DATE-TIME:${lb(e.programDateTime)}`),e.dateRange&&t.push(function(u){let c=[`ID="${u.id}"`];u.start&&c.push(`START-DATE="${lb(u.start)}"`),u.end&&c.push(`END-DATE="${lb(u.end)}"`),u.duration&&c.push(`DURATION=${u.duration}`),u.plannedDuration&&c.push(`PLANNED-DURATION=${u.plannedDuration}`),u.classId&&c.push(`CLASS="${u.classId}"`),u.endOnNext&&
`)}var nq="hls_cache",kp=[],iu={},v5={},ru={},Ip="";function rEe(t,e){if(kp.push(t),iu[t]=e,kp.length>5){let n=kp.shift();iEe(n)}}function iEe(t){delete iu[t],delete kp[t],new JSFile(nq+"/"+t).delete()}function lEe(t,e){if(e.variants)for(let n of e.variants)n.uri.startsWith("http")||(n.uri=mb(t,n.uri));if(e.segments)for(let n of e.segments)n.uri.startsWith("http")||(n.uri=mb(t,n.uri)),n.key&&n.key.uri&&!n.key.uri.startsWith("http")&&(n.key.uri=mb(t,n.key.uri));return e}async function rq(t,e){let n=md5X(t);if(iu[n])return iu[n];let r={},i=t;for(;r=await req(i,{headers:e,redirect:0}),r.headers.location;)i=r.headers.location;if(r.code==200){var l=r.content;let s=lEe(i,ZV(l));return rEe(n,{code:r.code,plist:s,key:n,headers:r.headers}),iu[n]}return{}}async function iq(t,e,n){if(!iu[t])return{};let i=iu[t].plist.segments,l=!ru[t];if(l){ru[t]={};for(let c of i){let f=md5X(c.uri+c.mediaSequenceNumber.toString());ru[t][f]={file:nq+"/"+t+"/"+f,uri:c.uri,key:f,index:c.mediaSequenceNumber,order:c.mediaSequenceNumber,state:-1,read:!1}}}for(let c in ru[t]){let f=ru[t][c];f.index>=e?f.order=f.index-e:f.order=i.length-e+f.index}l&&sEe(t,5,n);let s=i[e],a=md5X(s.uri+s.mediaSequenceNumber.toString()),o=ru[t][a];if(o.state==1||o.state==-1){let c=new JSFile(o.file);if(await c.exist())return o.state=1,{buffer:3,code:200,headers:{connection:"close","content-type":"video/mp2t"},content:c};o.state=-1}if(o.state==-1&&lq(t,o,n),o.state==0){var u=new JSProxyStream;u.head(200,{connection:"close","content-type":"video/mp2t"});let c=0;return o.read=!0,new Promise(async function(f,m){let d=new JSFile(o.file+".dl");await d.open("r"),async function y(){let _=await d.size();if(_>c){var S=await d.read(_-c,c);await u.write(S),c=_}if(o.state==1||o.state<0){u.done(),await d.close(),await d.delete(),o.read=!1,f();return}setTimeout(y,5)}()}),{buffer:3,content:u}}}async function lq(t,e,n){if(e.state>=0||!v5[t])return;if(e.state=0,await new JSFile(e.file).exist()){e.state=1;return}let r=new JSFile(e.file+".dl");await r.open("w");let i=await req(e.uri,{buffer:3,headers:n,stream:r,timeout:[5e3,1e4]});if(i.error||i.code>=300){await r.close(),e.read||await r.delete(),e.state=-1;return}await r.close(),e.read?await r.copy(e.file):await r.move(e.file),e.state=1}async function sEe(t,e,n){Ip&&Ip!=t&&delete v5[Ip],Ip=t,v5[t]=!0;for(let r=0;r<e&&v5[t];r++)new Promise(function(i,l){(async function s(){if(!v5[t]){i();return}let a=B.pickBy(ru[t],function(u){return u.state==-1}),o=B.minBy(Object.values(a),function(u){return u.order});if(!o){i();return}await lq(t,o,n),setTimeout(s,5)})()})}function mb(t,e){var n=t.split("/"),r=e.split("/");n.pop();for(var i=0;i<r.length;i++)r[i]!="."&&(r[i]==".."?n.pop():n.push(r[i]));return n.join("/")}function sq(t){let e=[];return Array.from(t.danmuku).forEach(n=>{let r=Number(n[0]),i=n[4];e.push(`<dp="${r},1,25,16777215,1659282294,0,8b53b65c,1108899274487246080"><![CDATA[${i}]]></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>"}varDp=class{constructor(){this.siteUrl="https://search.youku.com",this.reconnectTimes=0,this.maxReconnectTimes=5,this.jadeLog=newsa(this.getAppName(),"DEBUG")}getAppName(){return"\u5F39\u5E55"}getHeader(){return{"User-Agent":yi,Referer:this.siteUrl+"/"}}asyncreconnnect(e,n,r,i,l,s){returnawaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u8BF7\u68C0\u67E5url:"+e+",\u4E24\u79D2\u540E\u91CD\u8BD5"),Q2(2),this.reconnectTimes<this.maxReconnectTimes?(this.reconnectTimes=this.reconnectTimes+1,awaitthis.fetch(e,n,r,i,l,s)):(awaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u91CD\u8FDE\u5931\u8D25"),null)}asyncgetResponse(e,n,r,i,l,s,a){returna.headers.location!==void0?i?(awaitthis.jadeLog.debug(`\u8FD4\u56DE\u91CD\u5B9A\u5411\u8FDE\u63A5:${a.headers.location}`),a.headers.location):this.fetch(a.headers.location,n,r,i,l,s):a.content.length>0?(this.reconnectTimes=0,l?{cookie:a.headers["set-cookie"],content:a.conten
`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&QSe[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e};var yJ=Symbol("internals");function k5(t){return t&&String(t).trim().toLowerCase()}function of(t){return t===!1||t==null?t:Z.isArray(t)?t.map(of):String(t)}function ZSe(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}var eTe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());functionfw(t,e,n,r,i){if(Z.isFunction(r))returnr.call(this,e,n);if(i&&(e=n),!!Z.isString(e)){if(Z.isString(r))returne.indexOf(r)!==-1;if(Z.isRegExp(r))returnr.test(e)}}functiontTe(t){returnt.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}functionnTe(t,e){letn=Z.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,l,s){returnthis[r].call(this,e,i,l,s)},configurable:!0})})}varC0=class{constructor(e){e&&this.set(e)}set(e,n,r){leti=this;functionl(a,o,u){letc=k5(o);if(!c)thrownewError("header name must be a non-empty string");letf=Z.findKey(i,c);(!f||i[f]===void0||u===!0||u===void0&&i[f]!==!1)&&(i[f||o]=of(a))}lets=(a,o)=>Z.forEach(a,(u,c)=>l(u,c,o));returnZ.isPlainObject(e)||einstanceofthis.constructor?s(e,n):Z.isString(e)&&(e=e.trim())&&!eTe(e)?s(mJ(e),n):e!=null&&l(n,e,r),this}get(e,n){if(e=k5(e),e){letr=Z.findKey(this,e);if(r){leti=this[r];if(!n)returni;if(n===!0)returnZSe(i);if(Z.isFunction(n))returnn.call(this,i,r);if(Z.isRegExp(n))returnn.exec(i);thrownewTypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=k5(e),e){letr=Z.findKey(this,e);return!!(r&&this[r]!==void0&&(!n||fw(this,this[r],r,n)))}return!1}delete(e,n){letr=this,i=!1;functionl(s){if(s=k5(s),s){leta=Z.findKey(r,s);a&&(!n||fw(r,r[a],a,n))&&(deleter[a],i=!0)}}returnZ.isArray(e)?e.forEach(l):l(e),i}clear(e){letn=Object.keys(this),r=n.length,i=!1;for(;r--;){letl=n[r];(!e||fw(this,this[l],l,e,!0))&&(deletethis[l],i=!0)}returni}normalize(e){letn=this,r={};returnZ.forEach(this,(i,l)=>{lets=Z.findKey(r,l);if(s){n[s]=of(i),deleten[l];return}leta=e?tTe(l):String(l).trim();a!==l&&deleten[l],n[a]=of(i),r[a]=!0}),this}concat(...e){returnthis.constructor.concat(this,...e)}toJSON(e){letn=Object.create(null);returnZ.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&Z.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){returnObject.entries(this.toJSON())[Symbol.iterator]()}toString(){returnObject.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`,TTe=B5.encode(l3),xTe=2,Rw=class{constructor(e,n){let{escapeName:r}=this.constructor,i=Z.isString(n),l=`Content-Disposition:form-data;name="${r(e)}"${!i&&n.name?`; filename="${r(n.name)}"`:""}${l3}`;i?n=B5.encode(String(n).replace(/\r?\n|\r\n?/g,l3)):l+=`Content-Type:${n.type||"application/octet-stream"}${l3}`,this.headers=B5.encode(l+l3),this.contentLength=i?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+xTe,this.name=e,this.value=n}async*encode(){yield this.headers;let{value:e}=this;Z.isTypedArray(e)?yield e:yield*pf(e),yield TTe}static escapeName(e){return String(e).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},ATe=(t,e,n)=>{let{tag:r="form-data-boundary",size:i=25,boundary:l=r+"-"+Z.generateString(i,STe)}=n||{};if(!Z.isFormData(t))throw TypeError("FormData instance required");if(l.length<1||l.length>70)throw Error("boundary must be 10-70 characters long");let s=B5.encode("--"+l+l3),a=B5.encode("--"+l+"--"+l3+l3),o=a.byteLength,u=Array.from(t.entries()).map(([f,m])=>{let d=new Rw(f,m);return o+=d.size,d});o+=s.byteLength*u.length,o=Z.toFiniteNumber(o);let c={"Content-Type":`multipart/form-data;boundary=${l}`};return Number.isFinite(o)&&(c["Content-Length"]=o),e&&e(c),IJ.Readable.from(async function*(){for(let f of u)yield s,yield*f.encode();yield a}())},kJ=ATe;var DJ=Xr(require("stream"),1),Iw=class extends DJ.default.Transform{__transform(e,n,r){this.push(e),r()}_transform(e,n,r){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,n)}this.__transform(e,n,r)}},PJ=Iw;var OTe=(t,e)=>Z.isAsyncFn(t)?function(...n){let r=n.pop();t.apply(this,n).then(i=>{try{e?r(null,...e(i)):r(null,i)}catch(l){r(l)}},r)}:t,LJ=OTe;var FJ={flush:i2.default.constants.Z_SYNC_FLUSH,finishFlush:i2.default.constants.Z_SYNC_FLUSH},NTe={flush:i2.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:i2.default.constants.BROTLI_OPERATION_FLUSH},jJ=Z.isFunction(i2.default.createBrotliDecompress),{http:CTe,https:RTe}=qJ.default,ITe=/https:?/,UJ=ni.protocols.map(t=>t+":");function kTe(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function GJ(t,e,n){let r=e;if(!r&&r!==!1){let i=(0,$J.getProxyForUrl)(n);i&&(r=new URL(i))}if(r){if(r.username&&(r.auth=(r.username||"")+":"+(r.password||"")),r.auth){(r.auth.username||r.auth.password)&&(r.auth=(r.auth.username||"")+":"+(r.auth.password||""));let l=Buffer.from(r.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+l}t.headers.host=t.hostname+(t.port?":"+t.port:"");let i=r.hostname||r.host;t.hostname=i,t.host=i,t.port=r.port,t.path=n,r.protocol&&(t.protocol=r.protocol.includes(":")?r.protocol:`${r.protocol}:`)}t.beforeRedirects.proxy=function(l){GJ(l,e,l.href)}}var DTe=typeof process<"u"&&Z.kindOf(process)==="process",PTe=t=>new Promise((e,n)=>{let r,i,l=(o,u)=>{i||(i=!0,r&&r(o,u))},s=o=>{l(o),e(o)},a=o=>{l(o,!0),n(o)};t(s,a,o=>r=o).catch(a)}),LTe=({address:t,family:e})=>{if(!Z.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},MJ=(t,e)=>LTe(Z.isObject(t)?t:{address:t,family:e}),JJ=DTe&&function(e){return PTe(async function(r,i,l){let{data:s,lookup:a,family:o}=e,{responseType:u,responseEncoding:c}=e,f=e.method.toUpperCase(),m,d=!1,y;if(a){let ee=LJ(a,me=>Z.isArray(me)?me:[me]);a=(me,P,G)=>{ee(me,P,(V,q,Qn)=>{if(V)return G(V);let Tt=Z.isArray(q)?q.map(Qe=>MJ(Qe)):[MJ(q,Qn)];P.all?G(V,Tt):G(V,Tt[0].address,Tt[0].family)})}}let _=new zJ.default,S=()=>{e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),_.removeAllListeners()};l((ee,me)=>{m=!0,me&&(d=!0,S())});function w(ee){_.emit("abort",!ee||ee.type?new Is(null,e,y):ee)}_.once("abort",i),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));let E=fu(e.baseURL,e.url),g=new URL(E,"http://localhost"),v=g.protocol||UJ[0];if(v==="data:"){let ee;if(f!=="GET")return i3(r,i,{status:405,stat
`+l.map(QJ).join(`
`):" "+QJ(l[0]):"as no adapter specified";throw new Ve("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:kw};function Dw(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Is(null,t)}function df(t){return Dw(t),t.headers=ri.from(t.headers),t.data=D5.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ff.getAdapter(t.adapter||N0.adapter)(t).then(function(r){return Dw(t),r.data=D5.call(t,t.transformResponse,r),r.headers=ri.from(r.headers),r},function(r){return P5(r)||(Dw(t),r&&r.response&&(r.response.data=D5.call(t,t.transformResponse,r.response),r.response.headers=ri.from(r.response.headers))),Promise.reject(r)})}var ZJ=t=>t instanceof ri?t.toJSON():t;function l2(t,e){e=e||{};let n={};function r(u,c,f){return Z.isPlainObject(u)&&Z.isPlainObject(c)?Z.merge.call({caseless:f},u,c):Z.isPlainObject(c)?Z.merge({},c):Z.isArray(c)?c.slice():c}function i(u,c,f){if(Z.isUndefined(c)){if(!Z.isUndefined(u))return r(void 0,u,f)}else return r(u,c,f)}function l(u,c){if(!Z.isUndefined(c))return r(void 0,c)}function s(u,c){if(Z.isUndefined(c)){if(!Z.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,f){if(f in e)return r(u,c);if(f in t)return r(void 0,u)}let o={url:l,method:l,data:l,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:a,headers:(u,c)=>i(ZJ(u),ZJ(c),!0)};return Z.forEach(Object.keys(Object.assign({},t,e)),function(c){let f=o[c]||i,m=f(t[c],e[c],c);Z.isUndefined(m)&&f!==a||(n[c]=m)}),n}var Pw={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Pw[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});var eK={};Pw.transitional=function(e,n,r){function i(l,s){return"[Axios v"+hu+"] Transitional option '"+l+"'"+s+(r?". "+r:"")}return(l,s,a)=>{if(e===!1)throw new Ve(i(s," has been removed"+(n?" in "+n:"")),Ve.ERR_DEPRECATED);return n&&!eK[s]&&(eK[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(l,s,a):!0}};function UTe(t,e,n){if(typeof t!="object")throw new Ve("options must be an object",Ve.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),i=r.length;for(;i-- >0;){let l=r[i],s=e[l];if(s){let a=t[l],o=a===void 0||s(a,l,t);if(o!==!0)throw new Ve("option "+l+" must be "+o,Ve.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ve("Unknown option "+l,Ve.ERR_BAD_OPTION)}}var hf={assertOptions:UTe,validators:Pw};var s3=hf.validators,I0=class{constructor(e){this.defaults=e,this.interceptors={request:new ow,response:new ow}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;let l=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`}}catch{this.playUrl={content:""}}}async search(e,n){let r=await req(`${this.siteUrl}/user/hm.html?q=${encodeURIComponent(e)}`,{headers:{accept:"application/json","User-Agent":W2,Referer:`${this.siteUrl}/s?q=${encodeURIComponent(e)}`}}),l=(B.isArray(r.headers["set-cookie"])?r.headers["set-cookie"].join(";;;"):r.headers["set-cookie"]).split(";;;"),s={};for(let c of l){let f=c.trim(),m=f.indexOf("="),d=f.substr(0,m);s[d]=f.substr(m+1,f.indexOf(";")-m-1)}let a=await req(`${this.siteUrl}/user/search.html?q=${encodeURIComponent(e)}&so=undefined`,{headers:{accept:"application/json","User-Agent":W2,cookie:"hm="+s.hm,Referer:`${this.siteUrl}/s?q=${encodeURIComponent(e)}`}}),o=JSON.parse(a.content),u=[];for(let c of o)u.push({book_id:c.url_list,book_name:c.articlename,book_pic:c.url_img,book_remarks:c.author});return{tline:2,list:u}}async proxy(e,n){await this.jadeLog.debug(`\u6B63\u5728\u8BBE\u7F6E\u53CD\u5411\u4EE3\u7406segments=${e.join(",")},headers=${JSON.stringify(n)}`);let r=e[0],i=Bi(e[1]);if(r==="img"){await this.jadeLog.debug(`\u53CD\u5411\u4EE3\u7406ID\u4E3A:${i}`);let l=await this.getHtml(this.siteUrl+i),s=await this.parseVodDetailFromDoc(l),a;return B.isEmpty(n)?a=await req(s.book_pic,{buffer:2,headers:{Referer:i,"User-Agent":yi}}):a=await req(s.book_pic,{buffer:2,headers:n}),JSON.stringify({code:a.code,buffer:2,content:a.content,headers:a.headers})}return JSON.stringify({code:500,content:""})}},yn=new Gw;var Jw=class extends ke{constructor(){super()}getName(){return yn.getName()}getAppName(){return yn.getAppName()}getJSName(){return yn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await yn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await yn.initCookie(e.server.config.bilicookie),await yn.spiderInit(e),yn.cfgObj.code=0,yn.catOpenStatus=!0,yn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await yn.setClasses(),this.classes=yn.classes}async setFilterObj(){await yn.setFilterObj(),this.filterObj=yn.filterObj}async setHomeVod(){await yn.setHomeVod(),this.homeVodList=yn.homeVodList}async setCategory(e,n,r,i){await yn.setCategory(e,n,r,i),this.vodList=yn.vodList}async setDetail(e){await yn.setDetail(e),this.vodDetail=yn.vodDetail}async setPlay(e,n,r){await yn.setPlay(e,n,r),this.playUrl=yn.playUrl,this.result=yn.result}async setSearch(e,n,r){await yn.setSearch(e,n,r),this.vodList=yn.vodList,this.result=yn.result}async setProxy(e,n){return await yn.proxy(e,n)}},c3=new Jw;async function kK(t,e){return await c3.init(t,e)}async function DK(t,e){return await c3.home(t,e)}async function fxe(t,e){return await c3.homeVod(t,e)}async function PK(t,e){return await c3.category(t,e)}async function LK(t,e){return await c3.detail(t,e)}async function FK(t,e){return await c3.play(t,e)}async function jK(t,e){return await c3.search(t,e)}async function dxe(t,e){return await c3.proxy(t,e)}var UK={meta:{key:yn.getJSName(),name:yn.getName(),type:yn.getType()},api:async t=>{t.post("/init",kK),t.post("/home",DK),t.post("/category",PK),t.post("/detail",LK),t.post("/play",FK),t.post("/search",jK),t.get("/proxy/:what/:ids/:end",dxe)},spider:{init:kK,home:DK,homeVod:fxe,category:PK,detail:LK,play:FK,search:jK}};var Kw=class extends je{constructor(){super(),this.siteUrl="http://m.dj0898.com"}getName(){return"\u{1F3B5}\u2503\u4E16\u7EAADJ\u97F3\u4E50\u7F51\u2503\u{1F3B5}"}getAppName(){return"\u4E16\u7EAADJ\u97F3\u4E50\u7F51"}getJSName(){return"dj0898_book_open"}getType(){return 10}async parseVodShortListFromDoc(e){let n=[],r=e("ul.djddv_djList > li");for(let i of r){let l=new Al,s=e(i).find("a")[1];l.book_id=s.attribs.href,l.book_pic=e(i).find("img:first")[0].attribs.src;let a=e(i).find("strong:first")[0];l.book_name=a.children[0].data,l.book_remarks="\u{1F3B5}"+e(i).find("font")[5].children[0].data||"",n.push(l)}return n}async parseVodShortListFromDocByCategory(e){let n=e("ul.djddv_djList > li"),r=B.map(n,l=>{let s=e(l).find("a")[1],a=e(l).find("i
`),i=[];for(let m of r)B.isEmpty(m.replaceAll(" ","").replaceAll("/",""))||i.push(m.replaceAll(" ","").replaceAll("/",""));n.type_name=i.slice(0,2).join("*");let l=e('[class="video-info-items"]');n.vod_director=e(l[0]).find("a")[0].children[0].data;let s=e(l[1]).find("a"),a=[];for(let m of s)a.push(m.children[0].data);n.vod_actor=a.join(" * "),n.vod_year=i[2],n.vod_remarks=e(e(l[3]).find(".video-info-item")).text(),n.vod_content=e(e(l[5]).find(".video-info-item")).text(),n.vod_area=i[3],n.vod_content=n.vod_content.replace("[\u6536\u8D77\u90E8\u5206]","").replace("[\u5C55\u5F00\u5168\u90E8]","").replaceAll(" ","").replaceAll(`
`,"");let o=e(e('[class="module-tab-content"]')[0]).find("span"),u=e('[class="module-list module-player-list tab-list sort-list "]'),c=[];for(let m of o)c.push(e(m).text());let f=[];for(let m of u){let d=e(e(m).find('[class="sort-item"]')).find("a"),y=[];for(let _ of d){let S=e(_).text(),w=_.attribs.href,E=S+"$"+w;y.push(E)}f.push(y.join("#"))}return n.vod_play_from=c.join("$$$"),n.vod_play_url=B.values(f).join("$$$"),n}async parseVodShortListFromDocBySearch(e){let n=e(".module-search-item"),r=[];for(let i of n){let l=new Ne;l.vod_id=e(i).find(".video-serial")[0].attribs.href,l.vod_name=e(i).find(".video-serial")[0].attribs.title,l.vod_pic=e(i).find(".module-item-pic > img")[0].attribs["data-src"],l.vod_remarks="",r.push(l)}return r}async setClasses(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!B.isEmpty(e)){let n=Ge(e),r=n(n('[class="nav-menu-items"]')[0]).find("li");for(let i of r.slice(0,6)){let l=n(n(i).find("span")).text();if(l!=="\u9996\u9875"){let a={type_id:n(i).find("a")[0].attribs.href.split("/").slice(-1)[0].split(".")[0],type_name:l};this.classes.push(a)}}}}async getFilter(e){let n=e('[class="scroll-content"]').slice(1),r=[];for(let i=0;i<n.length;i++){let l={key:(i+1).toString(),name:"",value:[]};if(i<n.length-1){l.name=e(e(n[i]).find("a")[0]).text(),l.value.push({n:"\u5168\u90E8",v:"0"});for(let s of e(n[i]).find("a").slice(1))e(e(n[i]).find("a")[0]).text()==="\u5168\u90E8\u7C7B\u578B"?l.value.push({n:e(s).text(),v:s.attribs.href.split("/").slice(-1)[0].split(".")[0]}):l.value.push({n:e(s).text(),v:e(s).text()});r.push(l)}else l.name=e(e(n[i]).find("a")[0]).text(),l.value=[{n:"\u5168\u90E8",v:"0"},{n:e(e(n[i]).find("a")[1]).text(),v:"hits"},{n:e(e(n[i]).find("a")[2]).text(),v:"score"}],r.push(l)}return r}async setFilterObj(){for(let e of this.classes){let n=e.type_id;if(n!=="/"&&n!=="\u6700\u8FD1\u66F4\u65B0"){let r=this.siteUrl+`/vodshow/id/${n}.html`,i=await this.fetch(r,null,this.getHeader());if(i!=null){let l=Ge(i);this.filterObj[n]=await this.getFilter(l)}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!B.isEmpty(e)){let n=Ge(e);this.homeVodList=await this.parseVodShortListFromDoc(n)}}getExtend(e,n,r=""){return e!==void 0&&e!=="0"?r+e:n}async getCateUrl(e,n,r){e=this.getExtend(r[1],e);let i=this.getExtend(r[2],"","/area/"),l=this.getExtend(r[3],"","/lang/"),s=this.getExtend(r[4],"","/year/"),a=this.getExtend(r[5],"","/letter/"),o=this.getExtend(r[6],"","/by/");return this.siteUrl+`/vodshow${o}${i}/id/${e}${l}${a}${s}/page/${n}.html`}async setCategory(e,n,r,i){let l=await this.getCateUrl(e,n,i),s=await this.fetch(l,null,this.getHeader());if(!B.isEmpty(s)){let a=Ge(s);this.vodList=await this.parseVodShortListFromDoc(a);let o=Te(/\$\("\.mac_total"\)\.text\('(\d+)'\)/,s);this.limit=72,o.length>0&&(this.total=parseInt(o)),this.total<=this.limit?this.count=1:this.count=Math.ceil(this.total/this.limit)}}async setDetail(e){let n=this.siteUrl+e,r=await this.fetch(n,null,this.getHeader());if(!B.isEmpty(r)){let i=Ge(r);this.vodDetail=await this.parseVodDetailFromDoc(i)}}async setPlay(e,n,r){let i=await this.fetch(this.siteUrl+n,null,this.getHeader());if(!B.isEmpty(i)){let l=Te(/<script type="text\/javascript">var player_aaaa=(.*?)<\/script>/,i),s=JSON.parse(l);this.playUrl=s.url}}async setSearch(e,n){let r=this.siteUrl+`/vodsearch/wd/${e}.html`,i=await this.fetch(r,null,this.getHeader());if(!B.isEmpty(i)){let l=Ge(i);this.vodList=await this.parseVodShortListFromDocBySearch(l)}}},En=new tS;var nS=class extends ke{constructor(){super()}getName(){return En.getName()}getAppName(){return En.getAppName()}getJSName(){return En.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await En.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await En.initCookie(e.server.config.bilicookie),await En.spiderInit(e),En.cfgObj.code=0,En.catOpenStatus=!0,En.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async
`;n.type_name=e(e(e(i).find('[class="post-meta"]')).find("span")[0]).text(),n.vod_pic=e(i).find("img")[0].attribs.src,n.vod_name=Te(/名称:(.*?)\n/,s),n.vod_actor=Te(/主演:(.*?)\n/,s),n.vod_director=Te(/导演:(.*?)\n/,s),n.vod_area=Te(/地区:(.*?)\n/,s),n.vod_year=Te(/年份:(.*?)\n/,s),n.vod_remarks=Te(/更新:(.*?)\n/,s);let a=e('[class="article-related info"]').find("p");n.vod_content=e(a).text();let o=e('[class="article-related download_url"]'),u=[],c=[];for(let f=0;f<o.length;f++){let m=o[f],d=e(e(m).find("h2")).text().replaceAll(n.vod_name,"");u.push(d.replaceAll("\u4E0B\u8F7D","\u64AD\u653E"));let y=[];for(let _ of e(o[f]).find("a")){let S=e(_).text().replaceAll("\u78C1\u529B\u94FE\u4E0B\u8F7D","").replaceAll(".mp4",""),w=_.attribs.href;y.push(S+"$"+w)}c.push(y.join("#"))}return n.vod_play_from=u.join("$$$"),n.vod_play_url=c.join("$$$"),n}async parseVodShortListFromJson(e){let n=[],r=Ge(e.ajaxtxt),i=r(r("ul")).find("li");for(let l of i){let s=new Ne;s.vod_pic=r(l).find("img")[0].attribs["data-original"],s.vod_name=Te(/《(.*?)》/,r(l).find("img")[0].attribs.alt),s.vod_id=r(l).find("a")[0].attribs.href,s.vod_remarks="\u8BC4\u5206:"+r(r(l).find('[class="rate badge"]')).text(),n.push(s)}return n}async parseVodShortListFromDocByCategory(e){let n=[],r=e(e('[id="list_all"]').find("ul")).find("li");for(let i of r){let l=new Ne;l.vod_id=e(i).find("a")[0].attribs.href,l.vod_name=Te(/《(.*?)》/,e(e(e(i).find('[class="text_info"]')).find("a")[0]).text()),l.vod_pic=e(i).find("img")[0].attribs["data-original"],l.vod_remarks=e(e(i).find('[class="update_time"]')).text(),n.push(l)}return n}async setHomeVod(){let e=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(e)}async setDetail(e){let n=await this.getHtml(this.siteUrl+e);return this.vodDetail=await this.parseVodDetailFromDoc(n),this.vodDetail}async setCategory(e,n,r,i){let l=this.siteUrl+`/list/${e}-${n}.html`,s=await this.getHtml(l);this.vodList=await this.parseVodShortListFromDocByCategory(s)}async setSearch(e,n){let r=this.siteUrl+"/search/",i={wd:e,p:"1",t:"j/tNgwBS2e8O4x9TuIkYuQ=="},l=await this.post(r,i,this.getSearchHeader()),s=Ge(l);this.vodList=await this.parseVodShortListFromDocByCategory(s)}},Nn=new yS;var gS=class extends ke{constructor(){super()}getName(){return Nn.getName()}getAppName(){return Nn.getAppName()}getJSName(){return Nn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await Nn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Nn.initCookie(e.server.config.bilicookie),await Nn.spiderInit(e),Nn.cfgObj.code=0,Nn.catOpenStatus=!0,Nn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Nn.setClasses(),this.classes=Nn.classes}async setFilterObj(){await Nn.setFilterObj(),this.filterObj=Nn.filterObj}async setHomeVod(){await Nn.setHomeVod(),this.homeVodList=Nn.homeVodList}async setCategory(e,n,r,i){await Nn.setCategory(e,n,r,i),this.vodList=Nn.vodList}async setDetail(e){await Nn.setDetail(e),this.vodDetail=Nn.vodDetail}async setPlay(e,n,r){await Nn.setPlay(e,n,r),this.playUrl=Nn.playUrl,this.result=Nn.result}async setSearch(e,n,r){await Nn.setSearch(e,n,r),this.vodList=Nn.vodList,this.result=Nn.result}async setProxy(e,n){return await Nn.proxy(e,n)}},x3=new gS;async function rW(t,e){return await x3.init(t,e)}async function iW(t,e){return await x3.home(t,e)}async function zxe(t,e){return await x3.homeVod(t,e)}async function lW(t,e){return await x3.category(t,e)}async function sW(t,e){return await x3.detail(t,e)}async function aW(t,e){return await x3.play(t,e)}async function oW(t,e){return await x3.search(t,e)}async function Gxe(t,e){return await x3.proxy(t,e)}var uW={meta:{key:Nn.getJSName(),name:Nn.getName(),type:Nn.getType()},api:async t=>{t.post("/init",rW),t.post("/home",iW),t.post("/category",lW),t.post("/detail",sW),t.post("/play",aW),t.post("/search",oW),t.get("/proxy/:what/:ids/:end",Gxe)},spider:{init:rW,home:iW,h
`);r.vod_name=i[0].replaceAll(/<\\?[^>]+>/g,"").replace("\u540D\u79F0\uFF1A","");let l=new Date(n.time);r.vod_remarks=l.toLocaleDateString().replace(/\//g,"-")+" "+l.toTimeString().substr(0,8),r.vod_pic=n.image;let s="";for(let a of i)a.indexOf("\u63CF\u8FF0")>-1&&(r.vod_content=a.replace("\u63CF\u8FF0\uFF1A","").replaceAll(/<\\?[^>]+>/g,"")),a.indexOf("\u6807\u7B7E\uFF1A")>-1&&(r.type_name=a.replace("\u{1F3F7} \u6807\u7B7E\uFF1A","")),a.indexOf("\u94FE\u63A5\uFF1A")>-1&&(s=a.replaceAll(/<\\?[^>]+>/g,"").replace("\u94FE\u63A5\uFF1A",""));try{let a=await wl([s]);r.vod_play_url=a.vod_play_url,r.vod_play_from=a.vod_play_from}catch(a){await this.jadeLog.error(`\u83B7\u53D6\u963F\u91CC\u89C6\u9891\u64AD\u653E\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${a}`)}return r}async parseVodShortListFromDocBySearch(e,n){let r=[],i=JSON.parse(e("script[id=__NEXT_DATA__]")[0].children[0].data).buildId,l=this.siteUrl+"_next/data/"+i+"/search.json?keyword="+encodeURIComponent(n)+"&pan=aliyundrive",s=await this.fetch(l,null,this.getSearchHeader());if(B.isEmpty(s))await this.jadeLog.error("\u641C\u7D22\u9875\u9762\u89E3\u6790\u5931\u8D25",!0);else{let a=JSON.parse(s).pageProps.data.data;for(let o of a){let u=new Ne;u.vod_id=JSON.stringify(o);let c=o.content.split(`
`);u.vod_name=c[0].replaceAll(/<\\?[^>]+>/g,"").replace("\u540D\u79F0\uFF1A","");let f=new Date(o.time);u.vod_remarks=f.toLocaleDateString().replace(/\//g,"-")+" "+f.toTimeString().substr(0,8),u.vod_pic=o.image,r.push(u)}return r}}async setDetail(e){this.vodDetail=await this.parseVodDetailfromJson(e)}async setSearch(e,n){let r=await this.fetch(this.siteUrl,null,this.getHeader());if(!B.isEmpty(r)){let i=Ge(r);this.vodList=await this.parseVodShortListFromDocBySearch(i,e)}}async play(e,n,r){return await Sl(e,n,r)}},Rn=new ES;var bS=class extends ke{constructor(){super()}getName(){return Rn.getName()}getAppName(){return Rn.getAppName()}getJSName(){return Rn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await Rn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Rn.initCookie(e.server.config.bilicookie),await Rn.spiderInit(e),Rn.cfgObj.code=0,Rn.catOpenStatus=!0,Rn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Rn.setClasses(),this.classes=Rn.classes}async setFilterObj(){await Rn.setFilterObj(),this.filterObj=Rn.filterObj}async setHomeVod(){await Rn.setHomeVod(),this.homeVodList=Rn.homeVodList}async setCategory(e,n,r,i){await Rn.setCategory(e,n,r,i),this.vodList=Rn.vodList}async setDetail(e){await Rn.setDetail(e),this.vodDetail=Rn.vodDetail}async setPlay(e,n,r){await Rn.setPlay(e,n,r),this.playUrl=Rn.playUrl,this.result=Rn.result}async setSearch(e,n,r){await Rn.setSearch(e,n,r),this.vodList=Rn.vodList,this.result=Rn.result}async setProxy(e,n){return await Rn.proxy(e,n)}},O3=new bS;async function gW(t,e){return await O3.init(t,e)}async function vW(t,e){return await O3.home(t,e)}async function Xxe(t,e){return await O3.homeVod(t,e)}async function _W(t,e){return await O3.category(t,e)}async function EW(t,e){return await O3.detail(t,e)}async function bW(t,e){return await O3.play(t,e)}async function wW(t,e){return await O3.search(t,e)}async function Wxe(t,e){return await O3.proxy(t,e)}var SW={meta:{key:Rn.getJSName(),name:Rn.getName(),type:Rn.getType()},api:async t=>{t.post("/init",gW),t.post("/home",vW),t.post("/category",_W),t.post("/detail",EW),t.post("/play",bW),t.post("/search",wW),t.get("/proxy/:what/:ids/:end",Wxe)},spider:{init:gW,home:vW,homeVod:Xxe,category:_W,detail:EW,play:bW,search:wW}};var wS=class extends je{constructor(){super(),this.siteUrl="https://www.dygangs.xyz"}getAppName(){return"\u7535\u5F71\u6E2F"}getName(){return"\u{1F3D6}\uFE0F\u2503\u7535\u5F71\u6E2F\u2503\u{1F3D6}\uFE0F"}getJSName(){return"dygangs"}getType(){return 3}async setClasses(){let e=await this.getHtml(),n=e(e('[class="top-nav"]')[0]).find("a");for(let r of n){let i=r.attribs.href.replaceAll(this.siteUrl,""),l=e(r).text();i!=="/"&&this.classes.push(this.getTypeDic(l,i))}}async getFilter(e,n){let r=e('[class="nav-down-2 clearfix"]')[n],i=[];if(r!==void 0){let l="\u6309\u7C7B\u578B",s={key:l,name:l,value:[]};s.name=l,s.value.push({n:"\u5168\u90E8",v:"0"});for(let a of e(r).find("a")){let o=e(a).html(),u=a.attribs.href.split("/").slice(-2)[0];s.value.push({n:o,v:u})}i.push(s)}return i}async setFilterObj(){let e=0;for(let n of this.classes.slice(1,5)){let r=n.type_id;if(r!=="\u6700\u8FD1\u66F4\u65B0"){let i=this.siteUrl+`${r}`,l=await this.getHtml(i);this.filterObj[r]=await this.getFilter(l,e)}e=e+1}}parseVodShortFromElement(e,n){let r=new Ne;return r.vod_id=n.attribs.href,r.vod_name=n.attribs.title,r.vod_pic=e(n).find("img")[0].attribs["data-original"],r.vod_remarks=e(e(n).find("i")[0]).text().replaceAll(" ","").replaceAll(`
`,""),B.isEmpty(r.vod_pic)&&(r.vod_pic=Y2+"/resources/dygang.jpg"),r}async parseVodShortListFromDoc(e){let n=[],r=e('[class="index-tj-l"]').find("li");for(let i of r){let l=e(i).find("a")[0],s=this.parseVodShortFromElement(e,l);n.push(s)}return n}async parseVodShortListFromDocByCategory(e){let n=[],r=e('[class="index-area clearfix"]').find("li");for(let i of r){let l=e(i).find("a")[0],s=this.parseVodShortFromElement(e,l);n.push(s)}return n}async parseVodDetailFromDoc(e){let n=new $e,r=e('[ class="ct mb clearfix"]');n.vod_pic=e(r).find("img")[0].attribs.src,n.vod_name=Te(/◎片 名 (.*?)<br>/,e(r).html()),n.vod_area=Te(/◎产 地 (.*?)<br>/,e(r).html()),n.vod_year=Te(/◎年 代 (.*?)<br>/,e(r).html()),n.type_name=Te(/◎类 别 (.*?)<br>/,e(r).html()),n.vod_remarks=Te(/◎集 数 (.*?)<br>/,e(r).html());let i=Te(/◎主 演 (.*?)<\/p>/s,e(r).html());B.isEmpty(i)&&(i=Te(/◎演 员 (.*?)<\/p>/s,e(r).html()));let l=[];for(let f of i.split(`