varEse=Object.create;varN8=Object.defineProperty;varxse=Object.getOwnPropertyDescriptor;varbse=Object.getOwnPropertyNames;varwse=Object.getPrototypeOf,Sse=Object.prototype.hasOwnProperty;vark=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),IO=(t,e)=>{for(varnine)N8(t,n,{get:e[n],enumerable:!0})},RO=(t,e,n,r)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofbse(e))!Sse.call(t,i)&&i!==n&&N8(t,i,{get:()=>e[i],enumerable:!(r=xse(e,i))||r.enumerable});returnt};varDr=(t,e,n)=>(n=t!=null?Ese(wse(t)):{},RO(e||!t||!t.__esModule?N8(n,"default",{value:t,enumerable:!0}):n,t)),Tse=t=>RO(N8({},"__esModule",{value:!0}),t);varDO=k((WDe,kO)=>{"use strict";functionAse(t){vare=newt,n=e;functionr(){vars=e;returns.next?e=s.next:(e=newt,n=e),s.next=null,s}functioni(s){n.next=s,n=s}return{get:r,release:i}}kO.exports=Ase});varOm=k((XDe,Cm)=>{"use strict";varCse=DO();functionPO(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=Cse(Ose),i=null,s=null,l=0,a=null,o={push:x,drain:hl,saturated:hl,pause:c,paused:!1,getconcurrency(){returnn},setconcurrency(S){if(!(S>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");if(n=S,!o.paused)for(;i&&l<n;)l++,_()},running:u,resume:h,idle:m,length:f,getQueue:d,unshift:b,empty:hl,kill:E,killAndDrain:v,error:g};returno;functionu(){returnl}functionc(){o.paused=!0}functionf(){for(varS=i,A=0;S;)S=S.next,A++;returnA}functiond(){for(varS=i,A=[];S;)A.push(S.value),S=S.next;returnA}functionh(){if(o.paused)for(o.paused=!1;i&&l<n;)l++,_()}functionm(){returnl===0&&o.length()===0}functionx(S,A){varC=r.get();C.context=t,C.release=_,C.value=S,C.callback=A||hl,C.errorHandler=a,l>=n||o.paused?s?(s.next=C,s=C):(i=C,s=C,o.saturated()):(l++,e.call(t,C.value,C.worked))}functionb(S,A){varC=r.get();C.context=t,C.release=_,C.value=S,C.callback=A||hl,C.errorHandler=a,l>=n||o.paused?i?(C.next=i,i=C):(i=C,s=C,o.saturated()):(l++,e.call(t,C.value,C.worked))}function_(S){S&&r.release(S);varA=i;A&&l<=n?o.paused?l--:(s===i&&(s=null),i=A.next,A.next=null,e.call(t,A.value,A.worked),s===null&&o.empty()):--l===0&&o.drain()}functionE(){i=null,s=null,o.drain=hl}functionv(){i=null,s=null,o.drain(),o.drain=hl}functiong(S){a=S}}functionhl(){}functionOse(){this.value=null,this.callback=hl,this.next=null,this.release=hl,this.context=null,this.errorHandler=null;vart=this;this.worked=function(n,r){vari=t.callback,s=t.errorHandler,l=t.value;t.value=null,t.callback=hl,t.errorHandler&&s(n,l),i.call(t.context,n,r),t.release(t)}}functionNse(t,e,n){typeoft=="function"&&(n=e,e=t,t=null);functionr(c,f){e.call(this,c).then(function(d){f(null,d)},f)}vari=PO(t,r,n),s=i.push,l=i.unshift;returni.push=a,i.unshift=o,i.drained=u,i;functiona(c){varf=newPromise(function(d,h){s(c,function(m,x){if(m){h(m);return}d(x)})});returnf.catch(hl),f}functiono(c){varf=newPromise(function(d,h){l(c,function(m,x){if(m){h(m);return}d(x)})});returnf.catch(hl),f}functionu(){if(i.idle())returnnewPromise(function(d){d()});varc=i.drain,f=newPromise(function(d){i.drain=function(){c(),d()}});returnf}}Cm.exports=PO;Cm.exports.promise=Nse});varIm=k((YDe,LO)=>{"use strict";var{inherits:Ise,format:Nm}=require("util");functionB3(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,s,l){if(!new.target)returnnewr(i,s,l);Error.captureStackTrace(this,r),this.code=t,this.message=e,this.name="AvvioError",i&&s&&l?this.message=Nm(e,i,s,l):i&&s?this.message=Nm(e,i,s):i?this.message=Nm(e,i):this.message=e}returnr.prototype[Symbol.toStringTag]="Error",r.prototype.toString=function(){return`${this.name} [${this.code}]: ${this.message}`},Ise(r,n),r}LO.exports={createError:B3,AVV_ERR_EXPOSE_ALREADY_DEFINED:B3("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' () is already defined, specify an expose option"),AVV_ERR_CALLBACK_NOT_FN:B3("AVV_ERR_CALLBACK_NOT_FN","Callbackfor'%s'hookisnotafunction.Received:'%s
deps:${n}}`};var N5e={keyword:"dependencies",type:"object",schemaType:"object",error:ga.error,code(t){let[e,n]=I5e(t);qD(t,e),VD(t,n)}};function I5e({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 qD(t,e=t.schema){let{gen:n,data:r,it:i}=t;if(Object.keys(e).length===0)return;let s=n.let("missing");for(let l in e){let a=e[l];if(a.length===0)continue;let o=(0,wc.propertyInData)(n,r,l,i.opts.ownProperties);t.setParams({property:l,depsCount:a.length,deps:a.join(", ")}),i.allErrors?n.if(o,()=>{for(let u of a)(0,wc.checkReportMissingProp)(t,u)}):(n.if((0,yv._)`${o}&&(${(0,wc.checkMissingProp)(t,a,s)})`),(0,wc.reportMissingProp)(t,s),n.else())}}ga.validatePropertyDeps=qD;function VD(t,e=t.schema){let{gen:n,data:r,keyword:i,it:s}=t,l=n.name("valid");for(let a in e)(0,O5e.alwaysValidSchema)(s,e[a])||(n.if((0,wc.propertyInData)(n,r,a,s.opts.ownProperties),()=>{let o=t.subschema({keyword:i,schemaProp:a},l);t.mergeValidEvaluated(o,l)},()=>n.var(l,!0)),t.ok(l))}ga.validateSchemaDeps=VD;ga.default=N5e});var KD=k(gv=>{"use strict";Object.defineProperty(gv,"__esModule",{value:!0});var GD=ht(),R5e=Pt(),k5e={message:"property name must be valid",params:({params:t})=>(0,GD._)`{propertyName:${t.propertyName}}`},D5e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:k5e,code(t){let{gen:e,schema:n,data:r,it:i}=t;if((0,R5e.alwaysValidSchema)(i,n))return;let s=e.name("valid");e.forIn("key",r,l=>{t.setParams({propertyName:l}),t.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},s),e.if((0,GD.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};gv.default=D5e});var _v=k(vv=>{"use strict";Object.defineProperty(vv,"__esModule",{value:!0});var P9=Ii(),Vl=ht(),P5e=yl(),L9=Pt(),L5e={message:"must NOT have additional properties",params:({params:t})=>(0,Vl._)`{additionalProperty:${t.additionalProperty}}`},F5e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:L5e,code(t){let{gen:e,schema:n,parentSchema:r,data:i,errsCount:s,it:l}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:o}=l;if(l.props=!0,o.removeAdditional!=="all"&&(0,L9.alwaysValidSchema)(l,n))return;let u=(0,P9.allSchemaProperties)(r.properties),c=(0,P9.allSchemaProperties)(r.patternProperties);f(),t.ok((0,Vl._)`${s}===${P5e.default.errors}`);function f(){e.forIn("key",i,b=>{!u.length&&!c.length?m(b):e.if(d(b),()=>m(b))})}function d(b){let _;if(u.length>8){let E=(0,L9.schemaRefOrVal)(l,r.properties,"properties");_=(0,P9.isOwnProperty)(e,E,b)}else u.length?_=(0,Vl.or)(...u.map(E=>(0,Vl._)`${b}===${E}`)):_=Vl.nil;return c.length&&(_=(0,Vl.or)(_,...c.map(E=>(0,Vl._)`${(0,P9.usePattern)(t,E)}.test(${b})`))),(0,Vl.not)(_)}function h(b){e.code((0,Vl._)`delete${i}[${b}]`)}function m(b){if(o.removeAdditional==="all"||o.removeAdditional&&n===!1){h(b);return}if(n===!1){t.setParams({additionalProperty:b}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,L9.alwaysValidSchema)(l,n)){let _=e.name("valid");o.removeAdditional==="failing"?(x(b,_,!1),e.if((0,Vl.not)(_),()=>{t.reset(),h(b)})):(x(b,_),a||e.if((0,Vl.not)(_),()=>e.break()))}}function x(b,_,E){let v={keyword:"additionalProperties",dataProp:b,dataPropType:L9.Type.Str};E===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(v,_)}}};vv.default=F5e});var XD=k(xv=>{"use strict";Object.defineProperty(xv,"__esModule",{value:!0});var B5e=R0(),JD=Ii(),Ev=Pt(),WD=_v(),M5e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:s}=t;s.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&WD.default.code(new B5e.KeywordCxt(s,WD.default,"additionalProperties"));let l=(0,JD.allSchemaProperties)(n);for(let f of l)s.definedProperties.add(f);s.opts.unevaluated&&l.length&&s.props!==!0&&(s.props=Ev.mergeEvaluated.props(e,(0,Ev.toHash)(l),s.props));let a=l.filter(f=>!(0,Ev.alwaysValidSchema)(s,n[f]));if(a.le
`;let a=new rde(e),o=new ide(e.ajv);for(let c of n.validatorSchemasIds){let f=n.refResolver.getSchema(c);o.addSchema(f,c);let d=n.refResolver.getSchemaDependencies(c);for(let[h,m]of Object.entries(d))o.addSchema(m,h)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:o,serializer:a,code:`validator
${l}`,ajv:o.ajv};let u=new Function("validator","serializer",l);return e.mode==="standalone"?Xv()(u,n,a,o):u(o,a)}var ade=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],ode=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],ude=["maxLength","minLength","pattern"],cde=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function vM(t){for(var e of ade)if(e in t)return"object";for(var e of ode)if(e in t)return"array";for(var e of ude)if(e in t)return"string";for(var e of cde)if(e in t)return"number";return t.type}function fde(t,e){let n=e.schema,r=Object.keys(n.properties||{}),i=`
`,i}function pde(t,e){let n="",r=e.schema,i=r.required||[],s=e.getPropertyLocation("properties"),l=[],a=[];if(r.properties)for(let u of Object.keys(r.properties)){if(i.indexOf(u)===-1)continue;let c=s.getPropertyLocation(u);c.schema.$ref&&(c=J0(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)),l.push(u)}for(let u of i)l.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=s.getPropertyLocation(u);c.schema.$ref&&(c=J0(t,e,c.schema.$ref));let f=JSON.stringify(u);if(a.indexOf(u)!==-1)n+=`
${e}`)}function j7(t,e,n,r){if((t.isLeafNode||r.commonPrefix!==!1)&&(n=n||"(empty root node)",e=e[n]={},t.isLeafNode&&(e[xj]=mge(t,n,r)),n=""),t.staticChildren)for(let i of Object.values(t.staticChildren))j7(i,e,n+i.prefix,r);if(t.parametricChildren)for(let i of Object.values(t.parametricChildren)){let s=Array.from(i.nodePaths).join("|");j7(i,e,n+s,r)}t.wildcardChild&&j7(t.wildcardChild,e,"*",r)}function yge(t,e){let n={};return j7(t,n,t.prefix,e),bj(n)}Sj.exports={prettyPrintTree:yge}});var Cj=k((bMe,Aj)=>{"use strict";var gge=U7(),XE=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||{},s={params:r,constraints:i,handler:n.handler,store:n.store||null,_createParamsObject:this._compileCreateParamsObject(r)},l=Object.keys(i);l.length===0&&(this.unconstrainedHandler=s);for(let o of l)this.constraints.includes(o)||(o==="version"?this.constraints.unshift(o):this.constraints.push(o));let a=l.includes(gge.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(s),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 s=this.handlers[r].constraints[n];if(s!==void 0){let l=e.get(s)||0;l|=1<<r,e.set(s,l)}}}_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(`
`))}};Aj.exports=XE});var Nj=k((wMe,Oj)=>{"use strict";var vge=Cj(),G7={STATIC:0,PARAMETRIC:1,WILDCARD:2},$7=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 vge),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(n,e)}},H7=class extends $7{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 q7(e),this.staticChildren[r]}},q7=class t extends H7{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=G7.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 V7(e,n,r),this.parametricChildren.push(i),this.parametricChildren.sort((s,l)=>s.isRegex?l.isRegex?s.staticSuffix===null?1:l.staticSuffix===null?-1:l.staticSuffix.endsWith(s.staticSuffix)?1:s.staticSuffix.endsWith(l.staticSuffix)?-1:0:-1:1),i)}getWildcardChild(){return this.wildcardChild?this.wildcardChild:null}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new z7,this.wildcardChild}split(e,n){let r=this.prefix.slice(0,n),i=this.prefix.slice(n);this.prefix=i,this._compilePrefixMatch();let s=new t(r);return s.staticChildren[i.charAt(0)]=this,e.staticChildren[r.charAt(0)]=s,s}getNextNode(e,n,r,i){let s=this.findStaticMatchingChild(e,n),l=0;if(s===null){if(this.parametricChildren.length===0)return this.wildcardChild;s=this.parametricChildren[0],l=1}this.wildcardChild!==null&&r.push({paramsCount:i,brotherPathIndex:n,brotherNode:this.wildcardChild});for(let a=this.parametricChildren.length-1;a>=l;a--)r.push({paramsCount:i,brotherPathIndex:n,brotherNode:this.parametricChildren[a]});return s}_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(" && ")}`)}},V7=class extends H7{constructor(e,n,r){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=n||null,this.kind=G7.PARAMETRIC,this.nodePaths=new Set([r])}getNextNode(e,n){return this.findStaticMatchingChild(e,n)}},z7=class extends $7{constructor(){super(),this.kind=G7.WILDCARD}getNextNode(){return null}};Oj.exports={StaticNode:q7,ParametricNode:V7,WildcardNode:z7,NODE_TYPES:G7}});var Rj=k((SMe,Ij)=>{"use strict";var _ge=require("assert");function s5(){if(!(this instanceof s5))return new s5;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}s5.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};s5.prototype.get=function(t){return this.store[t]};Ij.exports={name:"version",mustMatchWhenDerived:!0,storage:s5,validate(t){_ge(typeof t=="string","Version should be a string")}}});var Dj=k((TMe,kj)=>{"use strict";var Ege=require("assert");function xge(){let t={},e=[];return{get:n=>{let r=t[n];if(r)return r;for
`)).bind(this)}};Pj.exports=QE});var Bj=k((CMe,Fj)=>{"use strict";var Sge=["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"];Fj.exports=Sge});var jj=k((OMe,Uj)=>{"use strict";function Mj(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 Tge(t,e){let n=!1,r=!1,i="";for(let l=1;l<t.length;l++){let a=t.charCodeAt(l);if(a===37){let o=t.charCodeAt(l+1),u=t.charCodeAt(l+2);Mj(o,u)===null?n=!0:(r=!0,o===50&&u===53&&(n=!0,t=t.slice(0,l+1)+"25"+t.slice(l+1),l+=2),l+=2)}else if(a===63||a===35||a===59&&e){i=t.slice(l+1),t=t.slice(0,l);break}}return{path:n?decodeURI(t):t,querystring:i,shouldDecodeParam:r}}function Age(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 s=t.charCodeAt(i+1),l=t.charCodeAt(i+2),a=Mj(s,l);n+=t.slice(r,i)+a,r=i+3}return t.slice(0,e)+n+t.slice(r)}Uj.exports={safeDecodeURI:Tge,safeDecodeURIComponent:Age}});var ix=k((NMe,Kj)=>{"use strict";var Hr=require("assert"),Cge=aj(),K7=gj(),tx=N0(),{prettyPrintTree:Oge}=Tj(),{StaticNode:$j,NODE_TYPES:ZE}=Nj(),Nge=Lj(),a1=Bj(),ex=U7(),{safeDecodeURI:Ige,safeDecodeURIComponent:Hj}=jj(),qj=/^https?:\/\/.*?\//,cu=/(\/:[^/()]*?)\?(\/?)/;if(!K7(qj))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!K7(cu))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function Ar(t){if(!(this instanceof Ar))return new Ar(t);t=t||{},this._opts=t,t.defaultRoute?(Hr(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(Hr(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(Hr(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=Rge,t.querystringParser?(Hr(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:Cge.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 Nge(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}Ar.prototype.on=function(e,n,r,i,s){typeof r=="function"&&(i!==void 0&&(s=i),i=r,r={}),Hr(typeof n=="string","Path should be a string"),Hr(n.length>0,"The path could not be empty"),Hr(n[0]==="/"||n[0]==="*","The first character of a path should be `/` or `*`"),Hr(typeof i=="function","Handler should be a function");let l=n.match(cu);if(l){Hr(n.length===l.index+l[0].length,"Optional Parameter needs to be the last parameter of the path");let u=n.replace(cu,"$1$2"),c=n.replace(cu,"$2");this.on(e,u,r,i,s),this.on(e,c,r,i,s);return}let a=n;this.ignoreDuplicateSlashes&&(n=nx(n)),this.ignoreTrailingSlash&&(n=rx(n));let o=Array.isArray(e)?e:[e];for(let u of o)Hr(typeof u=="string","Method should be a string"),Hr(a1.includes(u),`Method'${u}'isnotanhttpmethod.`),this._on(u,n,r,i,s,a)};Ar.prototype._on=function(e,n,r,i,s){let l={};r.constraints!==void 0&&(Hr(typeof r.constraints=="object"&&r.constraints!==null,"Constraints should be an object"),Object.keys(r.constraints).length!==0&&(l=r.constraints)),this.constrainer.validateConstraints(l),this.constrainer.noteUsage(l),this.trees[e]===void 0&&(this.trees[e]=new $j("/"));let a=n;if(a==="*"&&this.trees[e].prefix.length!==0){let d=this.trees[e]
`+this.inner:e}};x3.NestedError=M6;var bA=class extends M6{};x3.DatabaseError=bA;var wA=class extends M6{};x3.DataError=wA});var OA=k(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.getArrayIndicies=_s.validateArrayIndex=_s.validateArrayIndicies=_s.isInt=_s.ArrayInfo=_s.arrayRegex=void 0;var bd=x4(),RDe=()=>/^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;_s.arrayRegex=RDe;var SA={},TA=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,AA(r))this.index=parseInt(r);else if(!this.append)throw new bd.DataError("Only numerical values accepted for array index",200)}static processArray(e){if(typeof e>"u")return null;if(SA[e])return SA[e];let r=(0,_s.arrayRegex)().exec(e.trim());if(r!=null){let i=r[1],s="["+r[2].toString()+"]",l=CA(s);return Cre(l),SA[e]=new t(i,l)}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 bd.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 bd.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 s=+this.indicies[i];s===-1&&(s=r.length-1),r=r[s]}n===-1&&(n=r.length-1)}return{index:n,dataForProperty:r}}isMultiDimensional(){return this.indicies.length>1}};_s.ArrayInfo=TA;function AA(t){return!isNaN(t)&&Number(t)==t&&!isNaN(parseInt(t,10))}_s.isInt=AA;function Cre(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")}_s.validateArrayIndicies=Cre;function Ore(t){if(t.length!==0&&!AA(t))throw new bd.DataError("Only numerical values accepted for array index",200)}_s.validateArrayIndex=Ore;function CA(t){if(t.length===0)return[];if(t.charAt(0)!=="[")throw new Error("Invalid array syntax detected");let e=t.substring(1,t.indexOf("]"));Ore(e);let n=e.length+2;return[e,...CA(t.substring(n))]}_s.getArrayIndicies=CA});var Rre=k(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.DBParentData=void 0;var Nre=OA(),Ire=x4(),NA=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=Nre.ArrayInfo.processArray(this.parent);if(n&&(!n.append||e)&&!n.isValid(this.data))throw new Ire.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=Nre.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 Ire.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]}};wd.DBParentData=NA});var Dre=k((yYe,kre)=>{kre.exports=function(){"use strict";function t(){this.readers=0,this.queue=[]}function e(s,l,a){var o;typeof s!="function"?(i.h
)`,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])"},Gq={};function Kq(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 ob(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 Ux=(t,e,n,r,i)=>{let s=i(e,ob(n),r);return s===jt.trueFunc?t:s===jt.falseFunc?jt.falseFunc:l=>s(l)&&t(l)},jx={is:Ux,matches:Ux,where:Ux,not(t,e,n,r,i){let s=i(e,ob(n),r);return s===jt.falseFunc?t:s===jt.trueFunc?jt.falseFunc:l=>!s(l)&&t(l)},has(t,e,n,r,i){let s=n.adapter,l=ob(n),a=(l.relativeSelector=!0,e.some(c=>c.some(lb))?[Gq]:void 0),o=i(e,l,a);if(o===jt.falseFunc)return jt.falseFunc;let u=function(c,f){return c===jt.falseFunc?jt.falseFunc:d=>f.isTag(d)&&c(d)}(o,s);if(a&&o!==jt.trueFunc){let{shouldTestNextSiblings:c=!1}=o;return h=>{if(!t(h))return!1;a[0]=h;var d=s.getChildren(h),h=c?[...d,...Kq(h,s)]:d;return s.existsOne(u,h)}}return c=>t(c)&&s.existsOne(u,s.getChildren(c))}};function $x(t,e){return(t=e.getParent(t))&&e.isTag(t)?t:null}function HEe(t,e,n,r,i){let{adapter:s,equals:l}=n;switch(e.type){case dt.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case dt.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case dt.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()),MEe[e.action](t,e,n);case dt.Pseudo:return function(a,o,u,c,f){let{name:d,data:h}=o;if(Array.isArray(h)){if(d in jx)return jx[d](a,h,u,c,f);throw new Error(`Unknownpseudo-class:${d}(${h})`)}let m=(o=u.pseudos)==null?void 0:o[d],x=typeof m=="string"?m:$Ee[d];if(typeof x=="string"){if(h!=null)throw new Error(`Pseudo${d}doesn'thaveanyarguments`);let b=Hf(x);return jx.is(a,b,u,c,f)}if(typeof m=="function")return kH(m,d,h,1),b=>m(b,h)&&a(b);if(d in ab)return ab[d](a,h,u,c);if(d in RH){let b=RH[d];return kH(b,d,h,2),_=>b(_,u,h)&&a(_)}throw new Error("Unknown pseudo-class :"+d)}(t,e,n,r,i);case dt.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 s.getName(o)===a&&t(o)}}case dt.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(o){let u=o;for(;u=$x(u,s);)if(t(u))return!0;return!1};let a=new WeakSet;return function(o){let u=o;for(;u=$x(u,s);)if(!a.has(u)){if(s.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=$x(o,s));return!1};case dt.Parent:return function(a){return s.getChildren(a).some(o=>s.isTag(o)&&t(o))};case dt.Child:return function(a){return(a=s.getParent(a))!=null&&s.isTag(a)&&t(a)};case dt.Sibling:return function(a){var o=s.getSiblings(a);for(let c=0;c<o.length;c++){var u=o[c];if(l(a,u))break;if(s.isTag(u)&&t(u))return!0}return!1};case dt.Adjacent:return s.prevElementSibling?function(a){return(a=s.prevElementSibling(a))!=null&&t(a)}:function(a){var o=s.getSiblings(a);let u;for(let f=0;f<o.length;f++){var c=o[f];if(l(a,c))break;s.isTag(c)&&(u=c)}return!!u&&t(u)};case dt.Universal:if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not ye
`)}}):{name:r,value:i.replace(PH,`\r
`)}}).toArray()}}),C5=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}},jb=(C5.prototype.cheerio="[cheerio object]",C5.prototype.splice=Array.prototype.splice,C5.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(C5.prototype,OEe,uxe,mxe,yxe,vxe),function(t,e){return(jb=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)}),_xe=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}jb(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)},O5=function(){return(O5=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)},Exe=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]),Er="\uFFFD",LH=(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"}(H=H||{}),"--"),FH="[CDATA[",BH="doctype",f1="script",xxe="public",bxe="system";function oV(t){return 55296<=t&&t<=57343}function uV(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&1<=t&&t<=31||127<=t&&t<=159}function cV(t){return 64976<=t&&t<=65007||Exe.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&&(D+=" "),this.message=D+(this.message||""),this.firstUpdate=!1,this},g}function u(_){return n.toString.call(_)==="[object Function]"}function c(_){return n.toString.call(_)==="[object Array]"}function f(_){return n.toString.call(_)==="[object String]"}function d(_){return n.toString.call(_)==="[object Object]"}function h(_){var E=function(v){return v?typeof v=="string"?v.split("."):[v]:[]}(_);return function(v){for(var g=v,S=0;S<E.length;S++){var A=E[S];if(!l(g,A))return;g=g[A]}return g}}function m(_){return Array.prototype.slice.call(_)}function x(_,E,v){return Array.prototype.indexOf.call(_||[],E,v)}function b(_){var E,v=[];for(E in _)l(_,E)&&v.push(E);return v}s.hasOwnProp=l,s._prettifyError=function(_,E,v){return(v=v.Update?v:new s.TemplateError(v)).Update(_),E||(_=v,(v=new Error(_.message)).name=_.name),v},Object.setPrototypeOf?Object.setPrototypeOf(o.prototype,Error.prototype):o.prototype=Object.create(Error.prototype,{constructor:{value:o}}),s.TemplateError=o,s.escape=function(_){return _.replace(i,a)},s.isFunction=u,s.isArray=c,s.isString=f,s.isObject=d,s.getAttrGetter=h,s.groupBy=function(_,E,v){for(var g={},S=u(E)?E:h(E),A=0;A<_.length;A++){var C=_[A],N=S(C,A);if(N===void 0&&v===!0)throw new TypeError('groupby: attribute "'+E+'" resolved to undefined');(g[N]||(g[N]=[])).push(C)}return g},s.toArray=m,s.without=function(_){var E=[];if(_)for(var v=_.length,g=m(arguments).slice(1),S=-1;++S<v;)x(g,_[S])===-1&&E.push(_[S]);return E},s.repeat=function(_,E){for(var v="",g=0;g<E;g++)v+=_;return v},s.each=function(_,E,v){if(_!=null){if(e.forEach&&_.forEach===e.forEach)_.forEach(E,v);else if(_.length===+_.length)for(var g=0,S=_.length;g<S;g++)E.call(v,_[g],g,_)}},s.map=function(_,E){var v=[];if(_!=null){if(e.map&&_.map===e.map)return _.map(E);for(var g=0;g<_.length;g++)v[v.length]=E(_[g],g);_.length===+_.length&&(v.length=_.length)}return v},s.asyncIter=function(_,E,v){var g=-1;(function S(){++g<_.length?E(_[g],g,S,v):v()})()},s.asyncFor=function(_,E,v){var g=b(_||{}),S=g.length,A=-1;(function C(){var N=g[++A];A<S?E(N,_[N],A,S,C):v()})()},s.indexOf=x,s.keys=b,s._entries=function(_){return b(_).map(function(E){return[E,_[E]]})},s._values=function(_){return b(_).map(function(E){return _[E]})},s._assign=s.extend=function(_,E){return _=_||{},b(E).forEach(function(v){_[v]=E[v]}),_},s.inOperator=function(_,E){if(c(E)||f(E))return E.indexOf(_)!==-1;if(d(E))return _ in E;throw new Error('Cannot use "in" operator to search for "'+_+'" in unexpected types.')}});function FV(){throw new Error("setTimeout has not been defined")}function BV(){throw new Error("clearTimeout has not been defined")}var uo=FV,co=BV;function MV(t){if(uo===setTimeout)return setTimeout(t,0);if((uo===FV||!uo)&&setTimeout)return(uo=setTimeout)(t,0);try{return uo(t,0)}catch{try{return uo.call(null,t,0)}catch{return uo.call(this,t,0)}}}typeof E2.setTimeout=="function"&&(uo=setTimeout),typeof E2.clearTimeout=="function"&&(co=clearTimeout);var _u,b2=[],C1=!1,bf=-1;function _be(){C1&&_u&&(C1=!1,_u.length?b2=_u.concat(b2):bf=-1,b2.length)&&UV()}function UV(){if(!C1){var t=MV(_be);C1=!0;for(var e=b2.length;e;){for(_u=b2,b2=[];++bf<e;)_u&&_u[bf].run();bf=-1,e=b2.length}_u=null,C1=!1,function(n){if(co===clearTimeout)return clearTimeout(n);if((co===BV||!co)&&clearTimeout)return(co=clearTimeout)(n);try{co(n)}catch{try{return co.call(null,n)}catch{return co.call(this,n)}}}(t)}}function jV(t,e){this.fun=t,this.array=e}function Tu(){}jV.prototype.run=function(){this.fun.apply(null,this.array)};var Ebe=Tu,xbe=Tu,bbe=Tu,wbe=Tu,Sbe=Tu,Tbe=Tu,Abe=Tu,g1=E2.performance||{},Cbe=g1.now||g1.mozNow||g1.msNow||g1.oNow||g1.webkitNow||function(){return new Date().getTime()},Obe=new Date,go={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];b2.push(new jV(t,e)),b2.length!==1||C1||MV(UV)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ebe,addListener:xbe,once:bbe,off:wbe,removeListener:Sbe,removeAllListeners:Tbe,emit:Abe,binding:function(t){throw new Error("process.
`?this.forward():this.back())),ds(XV,h,n,r);if(h=(h=this._extractString(this.tags.VARIABLE_END))||this._extractString("-"+this.tags.VARIABLE_END))return this.in_code=!1,ds(QV,h,n,r);if(i==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var s="";!this.isFinished();){if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}s+=this.current(),this.forward()}for(var l=["g","i","m","y"],a="";!this.isFinished()&&l.indexOf(this.current())!==-1;)a+=this.current(),this.forward();return ds(dz,{body:s,flags:a},n,r)}if(_q.indexOf(i)!==-1){this.forward();var o,u=["==","===","!=","!==","<=",">=","//","**"],c=i+this.current();switch(je.indexOf(u,c)!==-1&&(this.forward(),je.indexOf(u,(i=c)+this.current())!==-1)&&(i=c+this.current(),this.forward()),i){case"(":o=ez;break;case")":o=tz;break;case"[":o=nz;break;case"]":o=rz;break;case"{":o=iz;break;case"}":o=sz;break;case",":o=az;break;case":":o=oz;break;case"~":o=uz;break;case"|":o=cz;break;default:o=lz}return ds(o,i,n,r)}if((h=this._extractUntil(vq+_q)).match(/^[-+]?[0-9]+$/))return this.current()==="."?(this.forward(),u=this._extract("0123456789"),ds(fz,h+"."+u,n,r)):ds("int",h,n,r);if(h.match(/^(true|false)$/))return ds(pz,h,n,r);if(h==="none"||h==="null")return ds(Ab,h,n,r);if(h)return ds(hz,h,n,r);throw new Error("Unexpected value while parsing: "+h)}var f,d=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,ds(WV,h,n,r);if(h=(h=this._extractString(this.tags.VARIABLE_START+"-"))||this._extractString(this.tags.VARIABLE_START))return this.in_code=!0,ds(YV,h,n,r);var h="",m=!1;for(this._matches(this.tags.COMMENT_START)&&(m=!0,h=this._extractString(this.tags.COMMENT_START));(f=this._extractUntil(d))!==null;){if(h+=f,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!m){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&0<this.colno&&this.colno<=h.length){var x=h.slice(-this.colno);if(/^\s+$/.test(x)&&!(h=h.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!m)throw new Error("unexpected end of comment");h+=this._extractString(this.tags.COMMENT_END);break}h+=this.current(),this.forward()}if(f===null&&m)throw new Error("expected end of comment, got end of file");return ds(m?ZV:JV,h,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.forEach(function(a){var l=a[0],a=a[1];h1("["+l+"] =>",n+2),t(a,n+4)}))}};function Tz(t,e){return(Tz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n})(t,e)}te.Node,te.Root,te.NodeList,te.Value,te.Literal,te.Group,te.Pair,te.Dict,te.Output,te.Capture,te.TemplateData,te.If,te.IfAsync,te.InlineIf,te.For,te.AsyncEach,te.AsyncAll,te.Macro,te.Caller,te.Import,te.FromImport,te.FunCall,te.Filter,te.FilterAsync,te.KeywordArgs,te.Block,te.Super,te.Extends,te.Include,te.Switch,te.Case,te.LookupVal,te.BinOp,te.In,te.Is,te.Or,te.And,te.Not,te.Add,te.Concat,te.Sub,te.Mul,te.Div,te.FloorDiv,te.Mod,te.Pow,te.Neg,te.Pos,te.Compare,te.CompareOperand,te.CallExtension,te.CallExtensionAsync,te.printNodes;var wq=function(t){var e;function n(){return t.apply(this,arguments)||this}e=t,(r=n).prototype=Object.create(e.prototype),Tz(r.prototype.constructor=r,e);var r=n.prototype;return r.init=function(i){this.tokens=i,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},r.nextToken=function(i){var s;if(this.peeked){if(i||this.peeked.type!==Xe.TOKEN_WHITESPACE)return s=this.peeked,this.peeked=null,s;this.peeked=null}if(s=this.tokens.nextToken(),!i)for(;s&&s.type===Xe.TOKEN_WHITESPACE;)s=this.tokens.nextToken();return s},r.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},r.pushToken=function(i){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=i},r.error=function(i,s,l){var a;return s!==void 0&&l!==void 0||(s=(a=this.peekToken()||{}).lineno,l=a.colno),s!==void 0&&(s+=1),l!==void 0&&(l+=1),new je.TemplateError(i,s,l)},r.fail=function(i,s,l){throw this.error(i,s,l)},r.skip=function(i){var s=this.nextToken();return!(!s||s.type!==i)||(this.pushToken(s),!1)},r.expect=function(i){var s=this.nextToken();return s.type!==i&&this.fail("expected "+i+", got "+s.type,s.lineno,s.colno),s},r.skipValue=function(i,s){var l=this.nextToken();return!(!l||l.type!==i||l.value!==s)||(this.pushToken(l),!1)},r.skipSymbol=function(i){return this.skipValue(Xe.TOKEN_SYMBOL,i)},r.advanceAfterBlockEnd=function(i){var s;return i||((s=this.peekToken())||this.fail("unexpected end of file"),s.type!==Xe.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),i=this.nextToken().value),(s=this.nextToken())&&s.type===Xe.TOKEN_BLOCK_END?s.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+i+" statement"),s},r.advanceAfterVariableEnd=function(){var i=this.nextToken();i&&i.type===Xe.TOKEN_VARIABLE_END?this.dropLeadingWhitespace=i.value.charAt(i.value.length-this.tokens.tags.VARIABLE_END.length-1)==="-":(this.pushToken(i),this.fail("expected variable end"))},r.parseFor=function(){var i,s,l=this.peekToken();if(this.skipSymbol("for")?(i=new te.For(l.lineno,l.colno),s="endfor"):this.skipSymbol("asyncEach")?(i=new te.AsyncEach(l.lineno,l.colno),s="endeach"):this.skipSymbol("asyncAll")?(i=new te.AsyncAll(l.lineno,l.colno),s="endall"):this.fail("parseFor: expected for{Async}",l.lineno,l.colno),i.name=this.parsePrimary(),i.name instanceof te.Symbol||this.fail("parseFor: variable name expected for loop"),this.peekToken().type===Xe.TOKEN_COMMA){var a=i.name;for(i.name=new te.Array(a.lineno,a.colno),i.name.addChild(a);this.skip(Xe.TOKEN_COMMA);){var o=this.parsePrimary();i.name.addChild(o)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',l.lineno,l.colno),i.arr=this.parseExpression(),this.advanceAfterBlockEnd(l.value),i.body=this.parseUntilBlocks(s,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),i.else_=this.parseUntilBlocks(s)),this.advanceAfterBlockEnd(),i},r.parseMacro=function(){var i=this.peekToken(),l=(this.skipSymbol("macro")||this.fail("expected macro"),this.parsePrimary(!0)),s=this.parseSignature(),l=new te.Macro(i.lineno,i.colno,l,s);return this.advanceAfterBlockEnd(i.value),l.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),l},r.parseCall=function(){var i=this.peekToken(),o
`))})},r.compileRoot=function(i,s){var l=this,a=(s&&this.fail("compileRoot: root node can't have frame"),s=new Jx,this._emitFuncBegin(i,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(i,s),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,[]);(s=i.findAll(te.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),l._emitFuncBegin(o,"b_"+c),c=new Jx,l._emitLine("var frame = frame.push(true);"),l.compile(o.body,c),l._emitFuncEnd()}),this._emitLine("return {"),s.forEach(function(o,u){o="b_"+o.name.value,l._emitLine(o+": "+o+",")}),this._emitLine(`root:root
};`)},r.compile=function(i,s){var l=this["compile"+i.typename];l?l.call(this,i,s):this.fail("compile: Cannot compile node: "+i.typename,i.lineno,i.colno)},r.getCode=function(){return this.codebuf.join("")},n}(D1.Obj),Pwe={compile:function(l,e,n,r,i){var s=new Tq(r,(i=i===void 0?{}:i).throwOnUndefined),l=(n||[]).map(function(a){return a.preprocess}).filter(function(a){return!!a}).reduce(function(a,o){return o(a)},l);return s.compile(Nwe.transform(Awe.parse(l,n,i),e,r)),s.getCode()},Compiler:Tq},Lwe=xt(function(t){function e(h,m){return h==null||h===!1?m:h}function n(h){return h!=h}function r(h){var m=(h=e(h,"")).toLowerCase();return bt.copySafeness(h,m.charAt(0).toUpperCase()+m.slice(1))}function i(h){if(je.isString(h))return h.split("");if(je.isObject(h))return je._entries(h||{}).map(function(m){return{key:m[0],value:m[1]}});if(je.isArray(h))return h;throw new je.TemplateError("list filter: type not iterable")}function s(h){return function(m,x,b){var _=this,E=_.env.getTest(x=x===void 0?"truthy":x);return je.toArray(m).filter(function(v){return E.call(_,v,b)===h})}}function l(h){return bt.copySafeness(h,h.replace(/^\s*|\s*$/g,""))}(t=t.exports={}).abs=Math.abs,t.batch=function(h,m,x){for(var b=[],_=[],E=0;E<h.length;E++)E%m==0&&_.length&&(b.push(_),_=[]),_.push(h[E]);if(_.length){if(x)for(E=_.length;E<m;E++)_.push(x);b.push(_)}return b},t.capitalize=r,t.center=function(h,m){var x;return(h=e(h,"")).length>=(m=m||80)?h:(m-=h.length,x=je.repeat(" ",m/2-m%2),m=je.repeat(" ",m/2),bt.copySafeness(h,x+h+m))},t.default=function(h,m,x){return x?h||m:h!==void 0?h:m},t.dictsort=function(h,m,x){if(!je.isObject(h))throw new je.TemplateError("dictsort filter: val must be an object");var b,_,E=[];for(_ in h)E.push([_,h[_]]);if(x===void 0||x==="key")b=0;else{if(x!=="value")throw new je.TemplateError("dictsort filter: You can only sort by either key or value");b=1}return E.sort(function(v,g){return v=v[b],g=g[b],m||(je.isString(v)&&(v=v.toUpperCase()),je.isString(g)&&(g=g.toUpperCase())),g<v?1:v===g?0:-1}),E},t.dump=function(h,m){return JSON.stringify(h,null,m)},t.escape=function(h){return h instanceof bt.SafeString?h:bt.markSafe(je.escape((h=h??"").toString()))},t.safe=function(h){return h instanceof bt.SafeString?h:bt.markSafe((h=h??"").toString())},t.first=function(h){return h[0]},t.forceescape=function(h){return bt.markSafe(je.escape((h=h??"").toString()))},t.groupby=function(h,m){return je.groupBy(h,m,this.env.opts.throwOnUndefined)},t.indent=function(h,E,x){if((h=e(h,""))==="")return"";E=E||4;var b=h.split(`
`):x.replace(/\s+/gi," ");return bt.copySafeness(h,b)},t.title=function(h){var m=(h=e(h,"")).split(" ").map(r);return bt.copySafeness(h,m.join(" "))},t.trim=l,t.truncate=function(h,m,x,b){var _=h;return(h=e(h,"")).length<=(m=m||255)?h:(h=x?h.substring(0,m):((x=h.lastIndexOf(" ",m))===-1&&(x=m),h.substring(0,x)),bt.copySafeness(_,h+=b??"..."))},t.upper=function(h){return(h=e(h,"")).toUpperCase()},t.urlencode=function(h){var m=encodeURIComponent;return je.isString(h)?m(h):(je.isArray(h)?h:je._entries(h)).map(function(_){var b=_[0],_=_[1];return m(b)+"="+m(_)}).join("&")};var a=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,o=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,u=/^https?:\/\/.*$/,c=/^www\./,f=/\.(?:org|net|com)(?:\:|\/|$)/,d=(t.urlize=function(h,m,x){n(m)&&(m=1/0);varb=x===!0?' rel="nofollow"':"";returnh.split(/(\s+)/).filter(function(_){return_&&_.length}).map(function(_){varE=_.match(a),v=(E=E?E[1]:_).substr(0,m);returnu.test(E)?'<a href="'+E+'"'+b+">"+v+"</a>":c.test(E)?'<a href="http://'+E+'"'+b+">"+v+"</a>":o.test(E)?'<a href="mailto:'+E+'">'+E+"</a>":f.test(E)?'<a href="http://'+E+'"'+b+">"+v+"</a>":_}).join("")},t.wordcount=function(h){return(h=(h=e(h,""))?h.match(/\w+/g):null)?h.length:null},t.float=function(h,m){returnn(h=parseFloat(h))?m:h},bt.makeMacro(["value","default","base"],[],function(h,m,x){returnx===void0&&(x=10),n(h=parseInt(h,x))?m:h}));t.int=d,t.d=t.default,t.e=t.escape}),Mf={};functionIz(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}varFwe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Wx=function(t){returnFwe.exec(t).slice(1)};functionXx(){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?"/":"")+Iz(Jb(t.split("/"),function(i){return!!i}),!e).join("/")||"."}functionAq(t){vare=Rz(t),n=Bwe(t,-1)==="/";return(t=(t=Iz(Jb(t.split("/"),function(r){return!!r}),!e).join("/"))||e?t:".")&&n&&(t+="/"),(e?"/":"")+t}functionRz(t){returnt.charAt(0)==="/"}varO1={extname:function(t){returnWx(t)[3]},basename:function(t,e){returnt=Wx(t)[2],e&&t.substr(-1*e.length)===e?t.substr(0,t.length-e.length):t},dirname:function(n){vare=(n=Wx(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=Xx(t).substr(1),e=Xx(e).substr(1);for(varr=n(t.split("/")),i=n(e.split("/")),s=Math.min(r.length,i.length),l=s,a=0;a<s;a++)if(r[a]!==i[a]){l=a;break}for(varo=[],a=l;a<r.length;a++)o.push("..");return(o=o.concat(i.slice(l))).join("/")},join:function(){returnAq(Jb(Array.prototype.slice.call(arguments,0),function(t,e){if(typeoft!="string")thrownewTypeError("Arguments to path.join must be strings");returnt}).join("/"))},isAbsolute:Rz,normalize:Aq,resolve:Xx};functionJb(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}varBwe="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)};functionkz(t,e){return(kz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){returnn.__proto__=r,n})(t,e)}varWb=function(t){vare;functionn(){returnt.apply(this,arguments)||this}e=t,(r=n).prototype=Object.create(e.prototype),kz(r.prototype.constructor=r,e);varr=n.prototype;returnr.resolve=function(i,s){returnO1.resolve(O1.dirname(i),s)},r.isRelative=function(i){returni.indexOf("./")===0||i.indexOf("../")===0},n}(D1.EmitterObj);functionDz(t,e){return(Dz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){returnn.__proto__=r,n})(t,e)}varMwe=function(t){vare,n;functionr(i){vars;return(s=t.call(this)||this).precompiled=i||{},s}returnn=t,(e=r).prototype=Object.create(n.prototype),Dz(e.prototype.co
`)){let o=a.trim();if(o)if(o.startsWith("#")){if(o.startsWith("#EXT")){let u=ySe(o,s);u&&l.push(u)}}else l.push(o)}return l.length!==0&&l[0].name==="EXTM3U"||ze("The EXTM3U tag MUST be the first line."),l}(t,e),r=gSe(n,e);return r.source=t,r}var vSe=["#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"],_Se=["#EXT-X-MEDIA"],cw=class extends Array{constructor(e){super(),this.baseUri=e}push(...e){for(let n of e)if(n.startsWith("#"))if(vSe.some(r=>n.startsWith(r)))super.push(n);else{if(this.includes(n)){if(_Se.some(r=>n.startsWith(r)))continue;ze(`Redundantitem(${n})`)}super.push(n)}else super.push(n);return this.length}};function dw(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 ESe(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 cG(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&&ze("IV must be a 128-bit unsigned integer"),r.push(`IV=${aG(t.iv)}`)),t.format&&r.push(`KEYFORMAT="${t.format}"`),t.formatVersion&&r.push(`KEYFORMATVERSIONS="${t.formatVersion}"`),`${n}:${r.join(",")}`}function xSe(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=${dw(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(up(i))}if(e.video.length>0){r.push(`VIDEO="${e.video[0].groupId}"`);for(let i of e.video)t.push(up(i))}if(e.subtitles.length>0){r.push(`SUBTITLES="${e.subtitles[0].groupId}"`);for(let i of e.subtitles)t.push(up(i))}if(aSe().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(up(i))}if(e.score&&r.push(`SCORE=${e.score}`),e.allowedCpc){let i=[];for(let{format:s,cpcList:l}of e.allowedCpc)i.push(`${s}:${l.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 up(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 bSe(t,e,n,r,i=1,s=null){let l=!1,a="";if(e.discontinuity&&t.push("#EXT-X-DISCONTINUITY"),e.key){let u=cG(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="${lw(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:${sw(e.programDateTime)}`),e.dateRange&&t.push(function(u){let c=[`ID="${u.id}"`];u.start&&c.push(`START-DATE="${sw(u.start)}"`),u.end&&c.push(`END-DATE="${sw(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 pG="hls_cache",wp=[],Nu={},i6={},Ou={},bp="";function wSe(t,e){if(wp.push(t),Nu[t]=e,wp.length>5){let n=wp.shift();SSe(n)}}function SSe(t){delete Nu[t],delete wp[t],new JSFile(pG+"/"+t).delete()}function TSe(t,e){if(e.variants)for(let n of e.variants)n.uri.startsWith("http")||(n.uri=mw(t,n.uri));if(e.segments)for(let n of e.segments)n.uri.startsWith("http")||(n.uri=mw(t,n.uri)),n.key&&n.key.uri&&!n.key.uri.startsWith("http")&&(n.key.uri=mw(t,n.key.uri));return e}async function hG(t,e){let n=md5X(t);if(Nu[n])return Nu[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 s=r.content;let l=TSe(i,uG(s));return wSe(n,{code:r.code,plist:l,key:n,headers:r.headers}),Nu[n]}return{}}async function dG(t,e,n){if(!Nu[t])return{};let i=Nu[t].plist.segments,s=!Ou[t];if(s){Ou[t]={};for(let c of i){let f=md5X(c.uri+c.mediaSequenceNumber.toString());Ou[t][f]={file:pG+"/"+t+"/"+f,uri:c.uri,key:f,index:c.mediaSequenceNumber,order:c.mediaSequenceNumber,state:-1,read:!1}}}for(let c in Ou[t]){let f=Ou[t][c];f.index>=e?f.order=f.index-e:f.order=i.length-e+f.index}s&&ASe(t,5,n);let l=i[e],a=md5X(l.uri+l.mediaSequenceNumber.toString()),o=Ou[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&&mG(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,d){let h=new JSFile(o.file+".dl");await h.open("r"),async function m(){let x=await h.size();if(x>c){var b=await h.read(x-c,c);await u.write(b),c=x}if(o.state==1||o.state<0){u.done(),await h.close(),await h.delete(),o.read=!1,f();return}setTimeout(m,5)}()}),{buffer:3,content:u}}}async function mG(t,e,n){if(e.state>=0||!i6[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 ASe(t,e,n){bp&&bp!=t&&delete i6[bp],bp=t,i6[t]=!0;for(let r=0;r<e&&i6[t];r++)new Promise(function(i,s){(async function l(){if(!i6[t]){i();return}let a=Q.pickBy(Ou[t],function(u){return u.state==-1}),o=Q.minBy(Object.values(a),function(u){return u.order});if(!o){i();return}await mG(t,o,n),setTimeout(l,5)})()})}function mw(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 yG(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>"}varSp=class{constructor(){this.siteUrl="https://search.youku.com",this.reconnectTimes=0,this.maxReconnectTimes=5,this.jadeLog=newAa(this.getAppName(),"DEBUG")}getAppName(){return"\u5F39\u5E55"}getHeader(){return{"User-Agent":Wi,Referer:this.siteUrl+"/"}}asyncreconnnect(e,n,r,i,s,l){returnawaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u8BF7\u68C0\u67E5url:"+e+",\u4E24\u79D2\u540E\u91CD\u8BD5"),xo(2),this.reconnectTimes<this.maxReconnectTimes?(this.reconnectTimes=this.reconnectTimes+1,awaitthis.fetch(e,n,r,i,s,l)):(awaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u91CD\u8FDE\u5931\u8D25"),null)}asyncgetResponse(e,n,r,i,s,l,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,s,l):a.content.length>0?(this.reconnectTimes=0,s?{cookie:a.headers["set-cookie"],content:a.conten
`).forEach(function(l){i=l.indexOf(":"),n=l.substring(0,i).trim().toLowerCase(),r=l.substring(i+1).trim(),!(!n||e[n]&&vOe[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e};var AW=Symbol("internals");function v6(t){return t&&String(t).trim().toLowerCase()}function Qp(t){return t===!1||t==null?t:le.isArray(t)?t.map(Qp):String(t)}function _Oe(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 EOe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());functionfS(t,e,n,r,i){if(le.isFunction(r))returnr.call(this,e,n);if(i&&(e=n),!!le.isString(e)){if(le.isString(r))returne.indexOf(r)!==-1;if(le.isRegExp(r))returnr.test(e)}}functionxOe(t){returnt.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}functionbOe(t,e){letn=le.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,l){returnthis[r].call(this,e,i,s,l)},configurable:!0})})}varr4=class{constructor(e){e&&this.set(e)}set(e,n,r){leti=this;functions(a,o,u){letc=v6(o);if(!c)thrownewError("header name must be a non-empty string");letf=le.findKey(i,c);(!f||i[f]===void0||u===!0||u===void0&&i[f]!==!1)&&(i[f||o]=Qp(a))}letl=(a,o)=>le.forEach(a,(u,c)=>s(u,c,o));returnle.isPlainObject(e)||einstanceofthis.constructor?l(e,n):le.isString(e)&&(e=e.trim())&&!EOe(e)?l(TW(e),n):e!=null&&s(n,e,r),this}get(e,n){if(e=v6(e),e){letr=le.findKey(this,e);if(r){leti=this[r];if(!n)returni;if(n===!0)return_Oe(i);if(le.isFunction(n))returnn.call(this,i,r);if(le.isRegExp(n))returnn.exec(i);thrownewTypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=v6(e),e){letr=le.findKey(this,e);return!!(r&&this[r]!==void0&&(!n||fS(this,this[r],r,n)))}return!1}delete(e,n){letr=this,i=!1;functions(l){if(l=v6(l),l){leta=le.findKey(r,l);a&&(!n||fS(r,r[a],a,n))&&(deleter[a],i=!0)}}returnle.isArray(e)?e.forEach(s):s(e),i}clear(e){letn=Object.keys(this),r=n.length,i=!1;for(;r--;){lets=n[r];(!e||fS(this,this[s],s,e,!0))&&(deletethis[s],i=!0)}returni}normalize(e){letn=this,r={};returnle.forEach(this,(i,s)=>{letl=le.findKey(r,s);if(l){n[l]=Qp(i),deleten[s];return}leta=e?xOe(s):String(s).trim();a!==s&&deleten[s],n[a]=Qp(i),r[a]=!0}),this}concat(...e){returnthis.constructor.concat(this,...e)}toJSON(e){letn=Object.create(null);returnle.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&le.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(`
`,VOe=C6.encode(Oo),zOe=2,NS=class{constructor(e,n){let{escapeName:r}=this.constructor,i=le.isString(n),s=`Content-Disposition:form-data;name="${r(e)}"${!i&&n.name?`; filename="${r(n.name)}"`:""}${Oo}`;i?n=C6.encode(String(n).replace(/\r?\n|\r\n?/g,Oo)):s+=`Content-Type:${n.type||"application/octet-stream"}${Oo}`,this.headers=C6.encode(s+Oo),this.contentLength=i?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+zOe,this.name=e,this.value=n}async*encode(){yield this.headers;let{value:e}=this;le.isTypedArray(e)?yield e:yield*th(e),yield VOe}static escapeName(e){return String(e).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},GOe=(t,e,n)=>{let{tag:r="form-data-boundary",size:i=25,boundary:s=r+"-"+le.generateString(i,qOe)}=n||{};if(!le.isFormData(t))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");let l=C6.encode("--"+s+Oo),a=C6.encode("--"+s+"--"+Oo+Oo),o=a.byteLength,u=Array.from(t.entries()).map(([f,d])=>{let h=new NS(f,d);return o+=h.size,h});o+=l.byteLength*u.length,o=le.toFiniteNumber(o);let c={"Content-Type":`multipart/form-data;boundary=${s}`};return Number.isFinite(o)&&(c["Content-Length"]=o),e&&e(c),$W.Readable.from(async function*(){for(let f of u)yield l,yield*f.encode();yield a}())},HW=GOe;var qW=Dr(require("stream"),1),IS=class extends qW.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)}},VW=IS;var KOe=(t,e)=>le.isAsyncFn(t)?function(...n){let r=n.pop();t.apply(this,n).then(i=>{try{e?r(null,...e(i)):r(null,i)}catch(s){r(s)}},r)}:t,zW=KOe;var GW={flush:S2.default.constants.Z_SYNC_FLUSH,finishFlush:S2.default.constants.Z_SYNC_FLUSH},JOe={flush:S2.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:S2.default.constants.BROTLI_OPERATION_FLUSH},KW=le.isFunction(S2.default.createBrotliDecompress),{http:WOe,https:XOe}=eX.default,YOe=/https:?/,JW=ci.protocols.map(t=>t+":");function QOe(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function nX(t,e,n){let r=e;if(!r&&r!==!1){let i=(0,XW.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 s=Buffer.from(r.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+s}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(s){nX(s,e,s.href)}}var ZOe=typeof process<"u"&&le.kindOf(process)==="process",eNe=t=>new Promise((e,n)=>{let r,i,s=(o,u)=>{i||(i=!0,r&&r(o,u))},l=o=>{s(o),e(o)},a=o=>{s(o,!0),n(o)};t(l,a,o=>r=o).catch(a)}),tNe=({address:t,family:e})=>{if(!le.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},WW=(t,e)=>tNe(le.isObject(t)?t:{address:t,family:e}),rX=ZOe&&function(e){return eNe(async function(r,i,s){let{data:l,lookup:a,family:o}=e,{responseType:u,responseEncoding:c}=e,f=e.method.toUpperCase(),d,h=!1,m;if(a){let W=zW(a,re=>le.isArray(re)?re:[re]);a=(re,I,M)=>{W(re,I,(F,L,Ke)=>{if(F)return M(F);let Be=le.isArray(L)?L.map(Re=>WW(Re)):[WW(L,Ke)];I.all?M(F,Be):M(F,Be[0].address,Be[0].family)})}}let x=new tX.default,b=()=>{e.cancelToken&&e.cancelToken.unsubscribe(_),e.signal&&e.signal.removeEventListener("abort",_),x.removeAllListeners()};s((W,re)=>{d=!0,re&&(h=!0,b())});function _(W){x.emit("abort",!W||W.type?new ea(null,e,m):W)}x.once("abort",i),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(_),e.signal&&(e.signal.aborted?_():e.signal.addEventListener("abort",_)));let E=Bu(e.baseURL,e.url),v=new URL(E,"http://localhost"),g=v.protocol||JW[0];if(g==="data:"){let W;if(f!=="GET")return Co(r,i,{status:405,
`+s.map(oX).join(`
`):" "+oX(s[0]):"as no adapter specified";throw new We("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:RS};function kS(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ea(null,t)}function rh(t){return kS(t),t.headers=fi.from(t.headers),t.data=_6.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),nh.getAdapter(t.adapter||n4.adapter)(t).then(function(r){return kS(t),r.data=_6.call(t,t.transformResponse,r),r.headers=fi.from(r.headers),r},function(r){return E6(r)||(kS(t),r&&r.response&&(r.response.data=_6.call(t,t.transformResponse,r.response),r.response.headers=fi.from(r.response.headers))),Promise.reject(r)})}var uX=t=>t instanceof fi?t.toJSON():t;function T2(t,e){e=e||{};let n={};function r(u,c,f){return le.isPlainObject(u)&&le.isPlainObject(c)?le.merge.call({caseless:f},u,c):le.isPlainObject(c)?le.merge({},c):le.isArray(c)?c.slice():c}function i(u,c,f){if(le.isUndefined(c)){if(!le.isUndefined(u))return r(void 0,u,f)}else return r(u,c,f)}function s(u,c){if(!le.isUndefined(c))return r(void 0,c)}function l(u,c){if(le.isUndefined(c)){if(!le.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:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:a,headers:(u,c)=>i(uX(u),uX(c),!0)};return le.forEach(Object.keys(Object.assign({},t,e)),function(c){let f=o[c]||i,d=f(t[c],e[c],c);le.isUndefined(d)&&f!==a||(n[c]=d)}),n}var DS={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{DS[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});var cX={};DS.transitional=function(e,n,r){function i(s,l){return"[Axios v"+Uu+"] Transitional option '"+s+"'"+l+(r?". "+r:"")}return(s,l,a)=>{if(e===!1)throw new We(i(l," has been removed"+(n?" in "+n:"")),We.ERR_DEPRECATED);return n&&!cX[l]&&(cX[l]=!0,console.warn(i(l," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,l,a):!0}};function iNe(t,e,n){if(typeof t!="object")throw new We("options must be an object",We.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),i=r.length;for(;i-- >0;){let s=r[i],l=e[s];if(l){let a=t[s],o=a===void 0||l(a,s,t);if(o!==!0)throw new We("option "+s+" must be "+o,We.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new We("Unknown option "+s,We.ERR_BAD_OPTION)}}var ih={assertOptions:iNe,validators:DS};var No=ih.validators,s4=class{constructor(e){this.defaults=e,this.interceptors={request:new aS,response:new aS}}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 s=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?s&&!String(r.stack).endsWith(s.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":_o,Referer:`${this.siteUrl}/s?q=${encodeURIComponent(e)}`}}),s=(Q.isArray(r.headers["set-cookie"])?r.headers["set-cookie"].join(";;;"):r.headers["set-cookie"]).split(";;;"),l={};for(let c of s){let f=c.trim(),d=f.indexOf("="),h=f.substr(0,d);l[h]=f.substr(d+1,f.indexOf(";")-d-1)}let a=await req(`${this.siteUrl}/user/search.html?q=${encodeURIComponent(e)}&so=undefined`,{headers:{accept:"application/json","User-Agent":_o,cookie:"hm="+l.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=Xi(e[1]);if(r==="img"){await this.jadeLog.debug(`\u53CD\u5411\u4EE3\u7406ID\u4E3A:${i}`);let s=await this.getHtml(this.siteUrl+i),l=await this.parseVodDetailFromDoc(s),a;return Q.isEmpty(n)?a=await req(l.book_pic,{buffer:2,headers:{Referer:i,"User-Agent":Wi}}):a=await req(l.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:""})}},bn=new zS;var GS=class extends $e{constructor(){super()}getName(){return bn.getName()}getAppName(){return bn.getAppName()}getJSName(){return bn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await bn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await bn.initCookie(e.server.config.bilicookie),await bn.spiderInit(e),bn.cfgObj.code=0,bn.catOpenStatus=!0,bn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await bn.setClasses(),this.classes=bn.classes}async setFilterObj(){await bn.setFilterObj(),this.filterObj=bn.filterObj}async setHomeVod(){await bn.setHomeVod(),this.homeVodList=bn.homeVodList}async setCategory(e,n,r,i){await bn.setCategory(e,n,r,i),this.vodList=bn.vodList}async setDetail(e){await bn.setDetail(e),this.vodDetail=bn.vodDetail}async setPlay(e,n,r){await bn.setPlay(e,n,r),this.playUrl=bn.playUrl,this.result=bn.result}async setSearch(e,n){await bn.setSearch(e,n),this.vodList=bn.vodList}async setProxy(e,n){return await bn.proxy(e,n)}},Do=new GS;async function HX(t,e){return await Do.init(t,e)}async function qX(t,e){return await Do.home(t,e)}async function kNe(t,e){return await Do.homeVod(t,e)}async function VX(t,e){return await Do.category(t,e)}async function zX(t,e){return await Do.detail(t,e)}async function GX(t,e){return await Do.play(t,e)}async function KX(t,e){return await Do.search(t,e)}async function DNe(t,e){return await Do.proxy(t,e)}var JX={meta:{key:bn.getJSName(),name:bn.getName(),type:bn.getType()},api:async t=>{t.post("/init",HX),t.post("/home",qX),t.post("/category",VX),t.post("/detail",zX),t.post("/play",GX),t.post("/search",KX),t.get("/proxy/:what/:ids/:end",DNe)},spider:{init:HX,home:qX,homeVod:kNe,category:VX,detail:zX,play:GX,search:KX}};var KS=class extends Ge{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 s=new Us,l=e(i).find("a")[1];s.book_id=l.attribs.href,s.book_pic=e(i).find("img:first")[0].attribs.src;let a=e(i).find("strong:first")[0];s.book_name=a.children[0].data,s.book_remarks="\u{1F3B5}"+e(i).find("font")[5].children[0].data||"",n.push(s)}return n}async parseVodShortListFromDocByCategory(e){let n=e("ul.djddv_djList > li"),r=Q.map(n,s=>{let l=e(s).find("a")[1],a=e(s).find("img:first")[0],o=e(s).find(
`),i=[];for(let d of r)Q.isEmpty(d.replaceAll(" ","").replaceAll("/",""))||i.push(d.replaceAll(" ","").replaceAll("/",""));n.type_name=i.slice(0,2).join("*");let s=e('[class="video-info-items"]');n.vod_director=e(s[0]).find("a")[0].children[0].data;let l=e(s[1]).find("a"),a=[];for(let d of l)a.push(d.children[0].data);n.vod_actor=a.join(" * "),n.vod_year=i[2],n.vod_remarks=e(e(s[3]).find(".video-info-item")).text(),n.vod_content=e(e(s[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 d of o)c.push(e(d).text());let f=[];for(let d of u){let h=e(e(d).find('[class="sort-item"]')).find("a"),m=[];for(let x of h){let b=e(x).text(),_=x.attribs.href,E=b+"$"+_;m.push(E)}f.push(m.join("#"))}return n.vod_play_from=c.join("$$$"),n.vod_play_url=Q.values(f).join("$$$"),n}async parseVodShortListFromDocBySearch(e){let n=e(".module-search-item"),r=[];for(let i of n){let s=new Pe;s.vod_id=e(i).find(".video-serial")[0].attribs.href,s.vod_name=e(i).find(".video-serial")[0].attribs.title,s.vod_pic=e(i).find(".module-item-pic > img")[0].attribs["data-src"],s.vod_remarks="",r.push(s)}return r}async setClasses(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!Q.isEmpty(e)){let n=tt(e),r=n(n('[class="nav-menu-items"]')[0]).find("li");for(let i of r.slice(0,6)){let s=n(n(i).find("span")).text();if(s!=="\u9996\u9875"){let a={type_id:n(i).find("a")[0].attribs.href.split("/").slice(-1)[0].split(".")[0],type_name:s};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 s={key:(i+1).toString(),name:"",value:[]};if(i<n.length-1){s.name=e(e(n[i]).find("a")[0]).text(),s.value.push({n:"\u5168\u90E8",v:"0"});for(let l of e(n[i]).find("a").slice(1))e(e(n[i]).find("a")[0]).text()==="\u5168\u90E8\u7C7B\u578B"?s.value.push({n:e(l).text(),v:l.attribs.href.split("/").slice(-1)[0].split(".")[0]}):s.value.push({n:e(l).text(),v:e(l).text()});r.push(s)}else s.name=e(e(n[i]).find("a")[0]).text(),s.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(s)}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 s=tt(i);this.filterObj[n]=await this.getFilter(s)}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!Q.isEmpty(e)){let n=tt(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/"),s=this.getExtend(r[3],"","/lang/"),l=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}${s}${a}${l}/page/${n}.html`}async setCategory(e,n,r,i){let s=await this.getCateUrl(e,n,i),l=await this.fetch(s,null,this.getHeader());if(!Q.isEmpty(l)){let a=tt(l);this.vodList=await this.parseVodShortListFromDoc(a);let o=Ie(/\$\("\.mac_total"\)\.text\('(\d+)'\)/,l);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(!Q.isEmpty(r)){let i=tt(r);this.vodDetail=await this.parseVodDetailFromDoc(i)}}async setPlay(e,n,r){let i=await this.fetch(this.siteUrl+n,null,this.getHeader());if(!Q.isEmpty(i)){let s=Ie(/<script type="text\/javascript">var player_aaaa=(.*?)<\/script>/,i),l=JSON.parse(s);this.playUrl=l.url}}async setSearch(e,n){let r=this.siteUrl+`/vodsearch/wd/${e}.html`,i=await this.fetch(r,null,this.getHeader());if(!Q.isEmpty(i)){let s=tt(i);this.vodList=await this.parseVodShortListFromDocBySearch(s)}}},Tn=new QS;var ZS=class extends $e{constructor(){super()}getName(){return Tn.getName()}getAppName(){return Tn.getAppName()}getJSName(){return Tn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await Tn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Tn.initCookie(e.server.config.bilicookie),await Tn.spiderInit(e),Tn.cfgObj.code=0,Tn.catOpenStatus=!0,Tn.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=Ie(/名称:(.*?)\n/,l),n.vod_actor=Ie(/主演:(.*?)\n/,l),n.vod_director=Ie(/导演:(.*?)\n/,l),n.vod_area=Ie(/地区:(.*?)\n/,l),n.vod_year=Ie(/年份:(.*?)\n/,l),n.vod_remarks=Ie(/更新:(.*?)\n/,l);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 d=o[f],h=e(e(d).find("h2")).text().replaceAll(n.vod_name,"");u.push(h.replaceAll("\u4E0B\u8F7D","\u64AD\u653E"));let m=[];for(let x of e(o[f]).find("a")){let b=e(x).text().replaceAll("\u78C1\u529B\u94FE\u4E0B\u8F7D","").replaceAll(".mp4",""),_=x.attribs.href;m.push(b+"$"+_)}c.push(m.join("#"))}return n.vod_play_from=u.join("$$$"),n.vod_play_url=c.join("$$$"),n}async parseVodShortListFromJson(e){let n=[],r=tt(e.ajaxtxt),i=r(r("ul")).find("li");for(let s of i){let l=new Pe;l.vod_pic=r(s).find("img")[0].attribs["data-original"],l.vod_name=Ie(/《(.*?)》/,r(s).find("img")[0].attribs.alt),l.vod_id=r(s).find("a")[0].attribs.href,l.vod_remarks="\u8BC4\u5206:"+r(r(s).find('[class="rate badge"]')).text(),n.push(l)}return n}async parseVodShortListFromDocByCategory(e){let n=[],r=e(e('[id="list_all"]').find("ul")).find("li");for(let i of r){let s=new Pe;s.vod_id=e(i).find("a")[0].attribs.href,s.vod_name=Ie(/《(.*?)》/,e(e(e(i).find('[class="text_info"]')).find("a")[0]).text()),s.vod_pic=e(i).find("img")[0].attribs["data-original"],s.vod_remarks=e(e(i).find('[class="update_time"]')).text(),n.push(s)}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 s=this.siteUrl+`/list/${e}-${n}.html`,l=await this.getHtml(s);this.vodList=await this.parseVodShortListFromDocByCategory(l)}async setSearch(e,n){let r=this.siteUrl+"/search/",i={wd:e,p:"1",t:"j/tNgwBS2e8O4x9TuIkYuQ=="},s=await this.post(r,i,this.getSearchHeader()),l=tt(s);this.vodList=await this.parseVodShortListFromDocByCategory(l)}},Rn=new fT;var pT=class extends $e{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){await Rn.setSearch(e,n),this.vodList=Rn.vodList}async setProxy(e,n){return await Rn.proxy(e,n)}},Go=new pT;async function ZY(t,e){return await Go.init(t,e)}async function eQ(t,e){return await Go.home(t,e)}async function aIe(t,e){return await Go.homeVod(t,e)}async function tQ(t,e){return await Go.category(t,e)}async function nQ(t,e){return await Go.detail(t,e)}async function rQ(t,e){return await Go.play(t,e)}async function iQ(t,e){return await Go.search(t,e)}async function oIe(t,e){return await Go.proxy(t,e)}var sQ={meta:{key:Rn.getJSName(),name:Rn.getName(),type:Rn.getType()},api:async t=>{t.post("/init",ZY),t.post("/home",eQ),t.post("/category",tQ),t.post("/detail",nQ),t.post("/play",rQ),t.post("/search",iQ),t.get("/proxy/:what/:ids/:end",oIe)},spider:{init:ZY,home:eQ,homeVod:aIe,category:tQ,det
`);r.vod_name=i[0].replaceAll(/<\\?[^>]+>/g,"").replace("\u540D\u79F0\uFF1A","");let s=new Date(n.time);r.vod_remarks=s.toLocaleDateString().replace(/\//g,"-")+" "+s.toTimeString().substr(0,8),r.vod_pic=n.image;let l="";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&&(l=a.replaceAll(/<\\?[^>]+>/g,"").replace("\u94FE\u63A5\uFF1A",""));try{let a=await Ls([l]);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,s=this.siteUrl+"_next/data/"+i+"/search.json?keyword="+encodeURIComponent(n)+"&pan=aliyundrive",l=await this.fetch(s,null,this.getSearchHeader());if(Q.isEmpty(l))await this.jadeLog.error("\u641C\u7D22\u9875\u9762\u89E3\u6790\u5931\u8D25",!0);else{let a=JSON.parse(l).pageProps.data.data;for(let o of a){let u=new Pe;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(!Q.isEmpty(r)){let i=tt(r);this.vodList=await this.parseVodShortListFromDocBySearch(i,e)}}async play(e,n,r){return await Fs(e,n,r)}},Dn=new mT;var yT=class extends $e{constructor(){super()}getName(){return Dn.getName()}getAppName(){return Dn.getAppName()}getJSName(){return Dn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await Dn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Dn.initCookie(e.server.config.bilicookie),await Dn.spiderInit(e),Dn.cfgObj.code=0,Dn.catOpenStatus=!0,Dn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Dn.setClasses(),this.classes=Dn.classes}async setFilterObj(){await Dn.setFilterObj(),this.filterObj=Dn.filterObj}async setHomeVod(){await Dn.setHomeVod(),this.homeVodList=Dn.homeVodList}async setCategory(e,n,r,i){await Dn.setCategory(e,n,r,i),this.vodList=Dn.vodList}async setDetail(e){await Dn.setDetail(e),this.vodDetail=Dn.vodDetail}async setPlay(e,n,r){await Dn.setPlay(e,n,r),this.playUrl=Dn.playUrl,this.result=Dn.result}async setSearch(e,n){await Dn.setSearch(e,n),this.vodList=Dn.vodList}async setProxy(e,n){return await Dn.proxy(e,n)}},Jo=new yT;async function hQ(t,e){return await Jo.init(t,e)}async function dQ(t,e){return await Jo.home(t,e)}async function fIe(t,e){return await Jo.homeVod(t,e)}async function mQ(t,e){return await Jo.category(t,e)}async function yQ(t,e){return await Jo.detail(t,e)}async function gQ(t,e){return await Jo.play(t,e)}async function vQ(t,e){return await Jo.search(t,e)}async function pIe(t,e){return await Jo.proxy(t,e)}var _Q={meta:{key:Dn.getJSName(),name:Dn.getName(),type:Dn.getType()},api:async t=>{t.post("/init",hQ),t.post("/home",dQ),t.post("/category",mQ),t.post("/detail",yQ),t.post("/play",gQ),t.post("/search",vQ),t.get("/proxy/:what/:ids/:end",pIe)},spider:{init:hQ,home:dQ,homeVod:fIe,category:mQ,detail:yQ,play:gQ,search:vQ}};var gT=class extends Ge{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,""),s=e(r).text();i!=="/"&&this.classes.push(this.getTypeDic(s,i))}}async getFilter(e,n){let r=e('[class="nav-down-2 clearfix"]')[n],i=[];if(r!==void 0){let s="\u6309\u7C7B\u578B",l={key:s,name:s,value:[]};l.name=s,l.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];l.value.push({n:o,v:u})}i.push(l)}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}`,s=await this.getHtml(i);this.filterObj[r]=await this.getFilter(s,e)}e=e+1}}parseVodShortFromElement(e,n){let r=new Pe;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(`
`,""),Q.isEmpty(r.vod_pic)&&(r.vod_pic=Eo+"/resources/dygang.jpg"),r}async parseVodShortListFromDoc(e){let n=[],r=e('[class="index-tj-l"]').find("li");for(let i of r){let s=e(i).find("a")[0],l=this.parseVodShortFromElement(e,s);n.push(l)}return n}async parseVodShortListFromDocByCategory(e){let n=[],r=e('[class="index-area clearfix"]').find("li");for(let i of r){let s=e(i).find("a")[0],l=this.parseVodShortFromElement(e,s);n.push(l)}return n}async parseVodDetailFromDoc(e){let n=new Ye,r=e('[ class="ct mb clearfix"]');n.vod_pic=e(r).find("img")[0].attribs.src,n.vod_name=Ie(/◎片 名 (.*?)<br>/,e(r).html()),n.vod_area=Ie(/◎产 地 (.*?)<br>/,e(r).html()),n.vod_year=Ie(/◎年 代 (.*?)<br>/,e(r).html()),n.type_name=Ie(/◎类 别 (.*?)<br>/,e(r).html()),n.vod_remarks=Ie(/◎集 数 (.*?)<br>/,e(r).html());let i=Ie(/◎主 演 (.*?)<\/p>/s,e(r).html());Q.isEmpty(i)&&(i=Ie(/◎演 员 (.*?)<\/p>/s,e(r).html()));let s=[];for(let f of i.split(`