tvbox/cat/dist/index.js

518 lines
2.4 MiB
JavaScript
Raw Normal View History

2024-05-29 18:58:23 +08:00
var bte=Object.create;var V8=Object.defineProperty;var wte=Object.getOwnPropertyDescriptor;var Ste=Object.getOwnPropertyNames;var Tte=Object.getPrototypeOf,xte=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),RA=(t,e)=>{for(var n in e)V8(t,n,{get:e[n],enumerable:!0})},kA=(t,e,n,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ste(e))!xte.call(t,r)&&r!==n&&V8(t,r,{get:()=>e[r],enumerable:!(l=wte(e,r))||l.enumerable});return t};var Wl=(t,e,n)=>(n=t!=null?bte(Tte(t)):{},kA(e||!t||!t.__esModule?V8(n,"default",{value:t,enumerable:!0}):n,t)),Ate=t=>kA(V8({},"__esModule",{value:!0}),t);var PA=k((VOe,DA)=>{"use strict";function Ote(t){var e=new t,n=e;function l(){var i=e;return i.next?e=i.next:(e=new t,n=e),i.next=null,i}function r(i){n.next=i,n=i}return{get:l,release:r}}DA.exports=Ote});var Md=k((qOe,Ud)=>{"use strict";var Nte=PA();function LA(t,e,n){if(typeof t=="function"&&(n=e,e=t,t=null),!(n>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var l=Nte(Cte),r=null,i=null,s=0,a=null,u={push:_,drain:G3,saturated:G3,pause:c,paused:!1,get concurrency(){return n},set concurrency(x){if(!(x>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(n=x,!u.paused)for(;r&&s<n;)s++,w()},running:o,resume:d,idle:y,length:f,getQueue:m,unshift:S,empty:G3,kill:E,killAndDrain:g,error:v};return u;function o(){return s}function c(){u.paused=!0}function f(){for(var x=r,O=0;x;)x=x.next,O++;return O}function m(){for(var x=r,O=[];x;)O.push(x.value),x=x.next;return O}function d(){if(u.paused)for(u.paused=!1;r&&s<n;)s++,w()}function y(){return s===0&&u.length()===0}function _(x,O){var N=l.get();N.context=t,N.release=w,N.value=x,N.callback=O||G3,N.errorHandler=a,s>=n||u.paused?i?(i.next=N,i=N):(r=N,i=N,u.saturated()):(s++,e.call(t,N.value,N.worked))}function S(x,O){var N=l.get();N.context=t,N.release=w,N.value=x,N.callback=O||G3,N.errorHandler=a,s>=n||u.paused?r?(N.next=r,r=N):(r=N,i=N,u.saturated()):(s++,e.call(t,N.value,N.worked))}function w(x){x&&l.release(x);var O=r;O&&s<=n?u.paused?s--:(i===r&&(i=null),r=O.next,O.next=null,e.call(t,O.value,O.worked),i===null&&u.empty()):--s===0&&u.drain()}function E(){r=null,i=null,u.drain=G3}function g(){r=null,i=null,u.drain(),u.drain=G3}function v(x){a=x}}function G3(){}function Cte(){this.value=null,this.callback=G3,this.next=null,this.release=G3,this.context=null,this.errorHandler=null;var t=this;this.worked=function(n,l){var r=t.callback,i=t.errorHandler,s=t.value;t.value=null,t.callback=G3,t.errorHandler&&i(n,s),r.call(t.context,n,l),t.release(t)}}function Ite(t,e,n){typeof t=="function"&&(n=e,e=t,t=null);function l(c,f){e.call(this,c).then(function(m){f(null,m)},f)}var r=LA(t,l,n),i=r.push,s=r.unshift;return r.push=a,r.unshift=u,r.drained=o,r;function a(c){var f=new Promise(function(m,d){i(c,function(y,_){if(y){d(y);return}m(_)})});return f.catch(G3),f}function u(c){var f=new Promise(function(m,d){s(c,function(y,_){if(y){d(y);return}m(_)})});return f.catch(G3),f}function o(){if(r.idle())return new Promise(function(m){m()});var c=r.drain,f=new Promise(function(m){r.drain=function(){c(),m()}});return f}}Ud.exports=LA;Ud.exports.promise=Ite});var Bd=k((zOe,FA)=>{"use strict";var{inherits:Rte,format:$d}=require("util");function du(t,e,n=Error){if(!t)throw new Error("Avvio error code must not be empty");if(!e)throw new Error("Avvio base error message must not be empty");function l(r,i,s){if(!new.target)return new l(r,i,s);Error.captureStackTrace(this,l),this.code=t,this.message=e,this.name="AvvioError",r&&i&&s?this.message=$d(e,r,i,s):r&&i?this.message=$d(e,r,i):r?this.message=$d(e,r):this.message=e}return l.prototype[Symbol.toStringTag]="Error",l.prototype.toString=function(){return`${this.name} [${this.code}]: ${this.message}`},Rte(l,n),l}FA.exports={createError:du,AVV_ERR_EXPOSE_ALREADY_DEFINED:du("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' () is already defined, specify an expose option"),AVV_ERR_CALLBACK_NOT_FN:du("AVV_ERR_CALLBACK_NOT_FN","Callback for '%s' hook is not a function. Received: '%s
2024-05-06 10:35:10 +08:00
`),a=`
2024-05-07 17:30:00 +08:00
`+n+(i.length?r("\u2502"):" ")+" ";return n+s.join(a)+`
2024-05-29 18:58:23 +08:00
`+i.map(function(u,o){var c=o===i.length-1,f=u.nodes&&u.nodes.length,m=n+(c?" ":r("\u2502"))+" ";return n+r(c?"\u2514":"\u251C")+r("\u2500")+r(f?"\u252C":"\u2500")+" "+t(u,m,l).slice(n.length+2)}).join("")}});var qA=k((JOe,VA)=>{"use strict";var kte=UA(),MA=Symbol("avvio.TimeTree.untrackNode"),Hd=Symbol("avvio.TimeTree.trackNode"),$A=Symbol("avvio.TimeTree.getParent"),BA=Symbol("avvio.TimeTree.getNode"),HA=Symbol("avvio.TimeTree.addNode"),Vd=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Hd](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[MA](e){this.tableId.delete(e.id);let n=this.tableLabel.get(e.label);if(n.id){this.tableLabel.delete(e.label);return}n.pop(),n.length===0&&this.tableLabel.delete(e.label)}[$A](e){if(e===null)return this.root;let n=this.tableLabel.get(e);return n.id?n:n[n.length-1]}[BA](e){return this.tableId.get(e)}[HA](e,n,l){if(e===null)return this.root={id:"root",label:n,start:l,nodes:[]},this[Hd](this.root),this.root.id;let i=this[$A](e),s=`${n}-${Math.random()}`,a={id:s,parent:e,start:l,label:n,nodes:[]};return i.nodes.push(a),this[Hd](a),s}start(e,n,l=Date.now()){return this[HA](e,n,l)}stop(e,n=Date.now()){let l=this[BA](e);l&&(l.stop=n,l.diff=l.stop-l.start||0,this[MA](l))}toJSON(){return Object.assign({},this.root)}prittyPrint(){let e=l=>(l.label=`${l.label} ${l.diff} ms`,l.nodes.length>0&&(l.nodes=l.nodes.map(r=>e(r))),l),n=e(this.toJSON());return kte(n)}};VA.exports=Vd});var GA=k((KOe,zA)=>{var Uo=1e3,Mo=Uo*60,$o=Mo*60,hu=$o*24,Dte=hu*7,Pte=hu*365.25;zA.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return Lte(t);if(n==="number"&&isFinite(t))return e.long?jte(t):Fte(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Lte(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),l=(e[2]||"ms").toLowerCase();switch(l){case"years":case"year":case"yrs":case"yr":case"y":return n*Pte;case"weeks":case"week":case"w":return n*Dte;case"days":case"day":case"d":return n*hu;case"hours":case"hour":case"hrs":case"hr":case"h":return n*$o;case"minutes":case"minute":case"mins":case"min":case"m":return n*Mo;case"seconds":case"second":case"secs":case"sec":case"s":return n*Uo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Fte(t){var e=Math.abs(t);return e>=hu?Math.round(t/hu)+"d":e>=$o?Math.round(t/$o)+"h":e>=Mo?Math.round(t/Mo)+"m":e>=Uo?Math.round(t/Uo)+"s":t+"ms"}function jte(t){var e=Math.abs(t);return e>=hu?q8(t,e,hu,"day"):e>=$o?q8(t,e,$o,"hour"):e>=Mo?q8(t,e,Mo,"minute"):e>=Uo?q8(t,e,Uo,"second"):t+" ms"}function q8(t,e,n,l){var r=e>=n*1.5;return Math.round(t/n)+" "+l+(r?"s":"")}});var qd=k((XOe,JA)=>{function Ute(t){n.debug=n,n.default=n,n.coerce=u,n.disable=i,n.enable=r,n.enabled=s,n.humanize=GA(),n.destroy=o,Object.keys(t).forEach(c=>{n[c]=t[c]}),n.names=[],n.skips=[],n.formatters={};function e(c){let f=0;for(let m=0;m<c.length;m++)f=(f<<5)-f+c.charCodeAt(m),f|=0;return n.colors[Math.abs(f)%n.colors.length]}n.selectColor=e;function n(c){let f,m=null,d,y;function _(...S){if(!_.enabled)return;let w=_,E=Number(new Date),g=E-(f||E);w.diff=g,w.prev=f,w.curr=E,f=E,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let v=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(O,N)=>{if(O==="%%")return"%";v++;let I=n.formatters[N];if(typeof I=="function"){let U=S[v];O=I.call(w,U),S.splice(v,1),v--}return O}),n.formatArgs.call(w,S),(w.log||n.log).apply(w,S)}return _.namespace=c,_.useColors=n.useColors(),_.color=n.selectColor(c),_.extend=l,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(d!==n.namespaces&&(d=n.namespaces,y=n.enabled(c)),y),set:S=>{m=S}}),typeof n.init=="function"&&n.init(_),_}function l(c,f){let m=n(this.namespace+(typeof f>"u"?":":f)+c);return m.log=this.log,
2024-04-02 15:03:09 +08:00
`).join(`
2024-05-29 18:58:23 +08:00
`+i),t.push(r+"m+"+J8.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Yte()+e+" "+t[0]}function Yte(){return b2.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Qte(...t){return process.stderr.write(G8.format(...t)+`
`)}function Zte(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function ene(){return process.env.DEBUG}function tne(t){t.inspectOpts={};let e=Object.keys(b2.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=b2.inspectOpts[e[n]]}J8.exports=qd()(b2);var{formatters:ZA}=J8.exports;ZA.o=function(t){return this.inspectOpts.colors=this.useColors,G8.inspect(t,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};ZA.O=function(t){return this.inspectOpts.colors=this.useColors,G8.inspect(t,this.inspectOpts)}});var K8=k((QOe,Gd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Gd.exports=KA():Gd.exports=eO()});var tO=k((ZOe,Xd)=>{"use strict";var nne=Md(),lne=require("events").EventEmitter,rne=require("util").inherits,o2=K8()("avvio"),{AVV_ERR_READY_TIMEOUT:ine}=Bd(),Jd=Symbol.for("plugin-meta");function sne(t,e){return t[Jd]&&t[Jd].name?t[Jd].name:typeof e<"u"&&typeof e!="function"&&e.name?e.name:t.name?t.name:t.toString().split(`
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function ane(){let t={};return t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),t}function Ho(t,e,n,l,r){this.started=!1,this.func=e,this.opts=n,this.onFinish=null,this.parent=t,this.timeout=r===void 0?t._timeout:r,this.name=sne(e,n),this.isAfter=l,this.q=nne(t,une,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}rne(Ho,lne);Ho.prototype.exec=function(t,e){let n=this.func,l=!1,r=this.name;if(this.parent._error&&!this.isAfter){o2("skipping loading of plugin as parent errored and it is not an after",r),process.nextTick(e);return}if(this.isAfter)this.server=t;else try{this.server=this.parent.override(t,n,this.opts)}catch(u){return o2("override errored",r),e(u)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,o2("exec",r);let i,s=u=>{if(l){o2("loading complete",r);return}this._error=u,o2(u?"exec errored":"exec completed",r),l=!0,i&&clearTimeout(i),e(u)};this.timeout>0&&(o2("setting up timeout",r,this.timeout),i=setTimeout(function(){o2("timed out",r),i=null;let u=new ine(r);u.fn=n,s(u)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());let a=n(this.server,this.opts,s);a&&typeof a.then=="function"&&(o2("exec: resolving promise",r),a.then(()=>process.nextTick(s),u=>process.nextTick(s,u)))};Ho.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();let t=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(o2("rejecting promise",this.name,n),this._promise.reject(n)):(o2("resolving promise",this.name),this._promise.resolve()),this._promise=null,process.nextTick(l,n)}),this.q.resume()},e;return this._promise?e=Promise.resolve():(this._promise=ane(),e=this._promise.promise,this.server?t():this.on("start",t)),e};Ho.prototype.enqueue=function(t,e){o2("enqueue",this.name,t.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(t,e)};Ho.prototype.finish=function(t,e){o2("finish",this.name,t);let n=()=>{this.loaded||(o2("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,e(t))};if(t){this._promise&&(this._promise.reject(t),this._promise=null),n();return}let l=()=>{if(o2("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){let r=()=>{o2("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(r,r),this._promise=null}else n();else o2("delayed",this.name),this.q.drain=()=>{o2("drain",this.name),this.q.drain=one,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function une(t,e){let n=this;process.nextTick(Kd.bind(n),t,e)}function Kd(t,e){if(typeof t.func.then=="function"){t.func.then(l=>{typeof l.default=="function"&&(l=l.default),t.func=l,Kd.call(this,t,e)},e);return}let n=this._current[0];this._current.unshift(t),t.exec(n&&n.server||this._server,l=>{t.finish(l,r=>{this._current.shift(),e(r)})})}function one(){}Xd.exports=Ho;Xd.exports.loadPlugin=Kd});var sO=k((eNe,eh)=>{"use strict";var nO=Md(),cne=require("events").EventEmitter,pne=require("util").inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Wd,AVV_ERR_CALLBACK_NOT_FN:r1,AVV_ERR_PLUGIN_NOT_VALID:fne,AVV_ERR_ROOT_PLG_BOOTED:dne,AVV_ERR_READY_TIMEOUT:hne}=Bd(),mne=qA(),Zd=tO(),Vo=K8()("avvio"),X8=Symbol("kAvvio"),Yd=Symbol("kThenifyDoNotWrap");function yne(t,e,n){let l=e.expose||{},r=l.use||"use",i=l.after||"after",s=l.ready||"ready",a=l.onClose||"onClose",u=l.close||"close";if(t[r])throw new Wd(r);if(t[i])throw new Wd(i);if(t[s])throw new Wd(s);t[r]=function(o,c){return n.use(o,c),this},Object.defineProperty(t,"then",{get:rO.bind(n)}),t[X8]=!0,t[i]=function(o){return typeof o!="function"?n._loadRegistered():(n.after(Qd(o,this)),this)},t[s]=function(o){if(o&&typeof o!="function")throw new r1(s,typeof o);return n.ready(o?Qd(o,this):void 0)},t[a]=function(o){if(typeof o!="function")throw new r1(a,typeof o);return n.onClose(bne(o,this)),this},t[u]=function(o){if(o&&typeof o!="function")throw new r1(u,typeof o);return o?(n.close(Q
2024-05-23 19:28:35 +08:00
causes have become circular...`;let l=mh(t);return l?(e.add(t),n+`
2024-05-29 18:58:23 +08:00
caused by: `+MO(l,e)):n},Fle=t=>MO(t,new Set),$O=(t,e,n)=>{if(!u1(t))return"";let l=n?"":t.message||"";if(e.has(t))return l+": ...";let r=mh(t);if(r){e.add(t);let i=typeof t.cause=="function";return l+(i?"":": ")+$O(r,e,i)}else return l},jle=t=>$O(t,new Set);BO.exports={isErrorLike:u1,getErrorCause:mh,stackWithCauses:Fle,messageWithCauses:jle}});var gh=k((dNe,VO)=>{"use strict";var Ule=Symbol("circular-ref-tag"),s9=Symbol("pino-raw-err-ref"),HO=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[s9]},set:function(t){this[s9]=t}}});Object.defineProperty(HO,s9,{writable:!0,value:{}});VO.exports={pinoErrProto:HO,pinoErrorSymbols:{seen:Ule,rawSymbol:s9}}});var GO=k((hNe,zO)=>{"use strict";zO.exports=_h;var{messageWithCauses:Mle,stackWithCauses:$le,isErrorLike:qO}=yh(),{pinoErrProto:Ble,pinoErrorSymbols:Hle}=gh(),{seen:vh}=Hle,{toString:Vle}=Object.prototype;function _h(t){if(!qO(t))return t;t[vh]=void 0;let e=Object.create(Ble);e.type=Vle.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=Mle(t),e.stack=$le(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(n=>_h(n)));for(let n in t)if(e[n]===void 0){let l=t[n];qO(l)?n!=="cause"&&!Object.prototype.hasOwnProperty.call(l,vh)&&(e[n]=_h(l)):e[n]=l}return delete t[vh],e.raw=t,e}});var KO=k((mNe,JO)=>{"use strict";JO.exports=u9;var{isErrorLike:Eh}=yh(),{pinoErrProto:qle,pinoErrorSymbols:zle}=gh(),{seen:a9}=zle,{toString:Gle}=Object.prototype;function u9(t){if(!Eh(t))return t;t[a9]=void 0;let e=Object.create(qle);e.type=Gle.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(n=>u9(n))),Eh(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,a9)&&(e.cause=u9(t.cause));for(let n in t)if(e[n]===void 0){let l=t[n];Eh(l)?Object.prototype.hasOwnProperty.call(l,a9)||(e[n]=u9(l)):e[n]=l}return delete t[a9],e.raw=t,e}});var QO=k((yNe,YO)=>{"use strict";YO.exports={mapHttpRequest:Jle,reqSerializer:WO};var bh=Symbol("pino-raw-req-ref"),XO=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[bh]},set:function(t){this[bh]=t}}});Object.defineProperty(XO,bh,{writable:!0,value:{}});function WO(t){let e=t.info||t.socket,n=Object.create(XO);if(n.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),n.method=t.method,t.originalUrl)n.url=t.originalUrl;else{let l=t.path;n.url=typeof l=="string"?l:t.url?t.url.path||t.url:void 0}return t.query&&(n.query=t.query),t.params&&(n.params=t.params),n.headers=t.headers,n.remoteAddress=e&&e.remoteAddress,n.remotePort=e&&e.remotePort,n.raw=t.raw||t,n}function Jle(t){return{req:WO(t)}}});var nN=k((gNe,tN)=>{"use strict";tN.exports={mapHttpResponse:Kle,resSerializer:eN};var wh=Symbol("pino-raw-res-ref"),ZO=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[wh]},set:function(t){this[wh]=t}}});Object.defineProperty(ZO,wh,{writable:!0,value:{}});function eN(t){let e=Object.create(ZO);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function Kle(t){return{res:eN(t)}}});var Th=k((vNe,lN)=>{"use strict";var Sh=GO(),Xle=KO(),o9=QO(),c9=nN();lN.exports={err:Sh,errWithCause:Xle,mapHttpRequest:o9.mapHttpRequest,mapHttpResponse:c9.mapHttpResponse,req:o9.reqSerializer,res:c9.resSerializer,wrapErrorSerializer:function(e){return e===Sh?e:function(l){return e(Sh(l))}},wrapRequestSerializer:fu
2024-04-02 15:03:09 +08:00
'use strict'
const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
const \u3007 = null;
2024-04-17 11:16:03 +08:00
o${s}
2024-05-29 18:58:23 +08:00
if ([o${s}].length !== 1) throw Error()`)()}catch{throw Error(n(i))}})}}});var p9=k((bNe,aN)=>{"use strict";aN.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var oN=k((wNe,uN)=>{"use strict";var Qle=p9();uN.exports=Zle;function Zle({paths:t}){let e=[];var n=0;let l=t.reduce(function(r,i,s){var a=i.match(Qle).map(c=>c.replace(/'|"|`/g,""));let u=i[0]==="[";a=a.map(c=>c[0]==="["?c.substr(1,c.length-2):c);let o=a.indexOf("*");if(o>-1){let c=a.slice(0,o),f=c.join("."),m=a.slice(o+1,a.length),d=m.length>0;n++,e.push({before:c,beforeStr:f,after:m,nested:d})}else r[i]={path:a,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:u};return r},{});return{wildcards:e,wcLen:n,secret:l}}});var pN=k((SNe,cN)=>{"use strict";var e2e=p9();cN.exports=t2e;function t2e({secret:t,serialize:e,wcLen:n,strict:l,isCensorFct:r,censorFctTakesPath:i},s){let a=Function("o",`
2024-04-02 15:03:09 +08:00
if (typeof o !== 'object' || o == null) {
2024-05-29 18:58:23 +08:00
${i2e(l,e)}
2024-04-02 15:03:09 +08:00
}
const { censor, secret } = this
2024-05-29 18:58:23 +08:00
${n2e(t,r,i)}
2024-04-02 15:03:09 +08:00
this.compileRestore()
2024-05-29 18:58:23 +08:00
${l2e(n>0,r,i)}
${r2e(e)}
`).bind(s);return e===!1&&(a.restore=u=>s.restore(u)),a}function n2e(t,e,n){return Object.keys(t).map(l=>{let{escPath:r,leadingBracket:i,path:s}=t[l],a=i?1:0,u=i?"":".",o=[];for(var c;(c=e2e.exec(l))!==null;){let[,y]=c,{index:_,input:S}=c;_>a&&o.push(S.substring(0,_-(y?0:1)))}var f=o.map(y=>`o${u}${y}`).join(" && ");f.length===0?f+=`o${u}${l} != null`:f+=` && o${u}${l} != null`;let m=`
2024-04-02 15:03:09 +08:00
switch (true) {
2024-05-07 17:30:00 +08:00
${o.reverse().map(y=>`
case o${u}${y} === censor:
secret[${r}].circle = ${JSON.stringify(y)}
2024-04-02 15:03:09 +08:00
break
`).join(`
`)}
}
2024-05-06 10:35:10 +08:00
`,d=n?`val, ${JSON.stringify(s)}`:"val";return`
2024-04-02 15:03:09 +08:00
if (${f}) {
2024-05-07 17:30:00 +08:00
const val = o${u}${l}
2024-04-02 15:03:09 +08:00
if (val === censor) {
2024-05-07 17:30:00 +08:00
secret[${r}].precensored = true
2024-04-02 15:03:09 +08:00
} else {
2024-05-07 17:30:00 +08:00
secret[${r}].val = val
o${u}${l} = ${e?`censor(${d})`:"censor"}
2024-04-17 11:16:03 +08:00
${m}
2024-04-02 15:03:09 +08:00
}
}
`}).join(`
2024-05-29 18:58:23 +08:00
`)}function l2e(t,e,n){return t===!0?`
2024-04-02 15:03:09 +08:00
{
const { wildcards, wcLen, groupRedact, nestedRedact } = this
for (var i = 0; i < wcLen; i++) {
const { before, beforeStr, after, nested } = wildcards[i]
if (nested === true) {
secret[beforeStr] = secret[beforeStr] || []
nestedRedact(secret[beforeStr], o, before, after, censor, ${e}, ${n})
} else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${n})
}
}
2024-05-29 18:58:23 +08:00
`:""}function r2e(t){return t===!1?"return o":`
2024-04-02 15:03:09 +08:00
var s = this.serialize(o)
this.restore(o)
return s
2024-05-29 18:58:23 +08:00
`}function i2e(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Oh=k((TNe,hN)=>{"use strict";hN.exports={groupRedact:a2e,groupRestore:s2e,nestedRedact:o2e,nestedRestore:u2e};function s2e({keys:t,values:e,target:n}){if(n==null)return;let l=t.length;for(var r=0;r<l;r++){let i=t[r];n[i]=e[r]}}function a2e(t,e,n,l,r){let i=fN(t,e);if(i==null)return{keys:null,values:null,target:null,flat:!0};let s=Object.keys(i),a=s.length,u=e.length,o=r?[...e]:void 0,c=new Array(a);for(var f=0;f<a;f++){let m=s[f];c[f]=i[m],r?(o[u]=m,i[m]=n(i[m],o)):l?i[m]=n(i[m]):i[m]=n}return{keys:s,values:c,target:i,flat:!0}}function u2e(t){for(let e=0;e<t.length;e++){let{target:n,path:l,value:r}=t[e],i=n;for(let s=l.length-1;s>0;s--)i=i[l[s]];i[l[0]]=r}}function o2e(t,e,n,l,r,i,s){let a=fN(e,n);if(a==null)return;let u=Object.keys(a),o=u.length;for(var c=0;c<o;c++){let f=u[c];c2e(t,a,f,n,l,r,i,s)}return t}function Ah(t,e){return t!=null?"hasOwn"in Object?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e):!1}function c2e(t,e,n,l,r,i,s,a){let u=r.length,o=u-1,c=n;var f=-1,m,d,y,_=null,S=null,w,E,g=!1,v=0,x=0,O=p2e();if(y=m=e[n],typeof m=="object"){for(;m!=null&&++f<u&&(x+=1,n=r[f],_=y,!(n!=="*"&&!S&&!(typeof m=="object"&&n in m)));)if(!(n==="*"&&(S==="*"&&(g=!0),S=n,f!==o))){if(S){let I=Object.keys(m);for(var N=0;N<I.length;N++){let U=I[N];if(E=m[U],w=n==="*",g)O=ji(O,U,x),v=f,y=dN(E,v-1,n,l,r,i,s,a,c,m,d,y,w,U,f,o,O,t,e[c],x+1);else if(w||typeof E=="object"&&E!==null&&n in E){if(w?y=E:y=E[n],d=f!==o?y:s?a?i(y,[...l,c,...r]):i(y):i,w){let F=o1(ji(O,U,x),y,e[c]);t.push(F),m[U]=d}else if(E[n]!==d)if(d===void 0&&i!==void 0||Ah(E,n)&&d===y)O=ji(O,U,x);else{O=ji(O,U,x);let F=o1(ji(O,n,x+1),y,e[c]);t.push(F),E[n]=d}}}S=null}else{if(y=m[n],O=ji(O,n,x),d=f!==o?y:s?a?i(y,[...l,c,...r]):i(y):i,!(Ah(m,n)&&d===y||d===void 0&&i!==void 0)){let I=o1(O,y,e[c]);t.push(I),m[n]=d}m=m[n]}if(typeof m!="object")break}}}function fN(t,e){for(var n=-1,l=e.length,r=t;r!=null&&++n<l;)r=r[e[n]];return r}function dN(t,e,n,l,r,i,s,a,u,o,c,f,m,d,y,_,S,w,E,g){if(e===0&&(m||typeof t=="object"&&t!==null&&n in t)){if(m?f=t:f=t[n],c=y!==_?f:s?a?i(f,[...l,u,...r]):i(f):i,m){let v=o1(S,f,E);w.push(v),o[d]=c}else if(t[n]!==c){if(!(c===void 0&&i!==void 0||Ah(t,n)&&c===f)){let v=o1(ji(S,n,g+1),f,E);w.push(v),t[n]=c}}}for(let v in t)typeof t[v]=="object"&&(S=ji(S,v,g),dN(t[v],e-1,n,l,r,i,s,a,u,o,c,f,m,d,y,_,S,w,E,g+1))}function p2e(){return{parent:null,key:null,children:[],depth:0}}function ji(t,e,n){if(t.depth===n)return ji(t.parent,e,n);var l={parent:t,key:e,depth:n,children:[]};return t.children.push(l),l}function o1(t,e,n){let l=t,r=[];do r.push(l.key),l=l.parent;while(l.parent!=null);return{path:r,value:e,target:n}}});var yN=k((xNe,mN)=>{"use strict";var{groupRestore:f2e,nestedRestore:d2e}=Oh();mN.exports=h2e;function h2e({secret:t,wcLen:e}){return function(){if(this.restore)return;let l=Object.keys(t),r=m2e(t,l),i=e>0,s=i?{secret:t,groupRestore:f2e,nestedRestore:d2e}:{secret:t};this.restore=Function("o",y2e(r,l,i)).bind(s)}}function m2e(t,e){return e.map(n=>{let{circle:l,escPath:r,leadingBracket:i}=t[n],a=l?`o.${l} = secret[${r}].val`:`o${i?"":"."}${n} = secret[${r}].val`,u=`secret[${r}].val = undefined`;return`
2024-05-07 17:30:00 +08:00
if (secret[${r}].val !== undefined) {
2024-04-02 15:03:09 +08:00
try { ${a} } catch (e) {}
2024-05-07 17:30:00 +08:00
${u}
2024-04-02 15:03:09 +08:00
}
2024-05-29 18:58:23 +08:00
`}).join("")}function y2e(t,e,n){return`
2024-04-02 15:03:09 +08:00
const secret = this.secret
2024-05-06 10:35:10 +08:00
${n===!0?`
2024-04-02 15:03:09 +08:00
const keys = Object.keys(secret)
const len = keys.length
for (var i = len - 1; i >= ${e.length}; i--) {
const k = keys[i]
const o = secret[k]
if (o.flat === true) this.groupRestore(o)
else this.nestedRestore(o)
secret[k] = null
}
2024-05-06 10:35:10 +08:00
`:""}
2024-04-02 15:03:09 +08:00
${t}
return o
2024-09-23 11:52:18 +08:00
`}});var vN=k((ANe,gN)=>{"use strict";gN.exports=g2e;function g2e(t){let{secret:e,censor:n,compileRestore:l,serialize:r,groupRedact:i,nestedRedact:s,wildcards:a,wcLen:u}=t,o=[{secret:e,censor:n,compileRestore:l}];return r!==!1&&o.push({serialize:r}),u>0&&o.push({groupRedact:i,nestedRedact:s,wildcards:a,wcLen:u}),Object.assign(...o)}});var bN=k((ONe,EN)=>{"use strict";var _N=sN(),v2e=oN(),_2e=pN(),E2e=yN(),{groupRedact:b2e,nestedRedact:w2e}=Oh(),S2e=vN(),T2e=p9(),x2e=_N(),Nh=t=>t;Nh.restore=Nh;var A2e="[REDACTED]";Ch.rx=T2e;Ch.validator=_N;EN.exports=Ch;function Ch(t={}){let e=Array.from(new Set(t.paths||[])),n="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,l=t.remove;if(l===!0&&n!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let r=l===!0?void 0:"censor"in t?t.censor:A2e,i=typeof r=="function",s=i&&r.length>1;if(e.length===0)return n||Nh;x2e({paths:e,serialize:n,censor:r});let{wildcards:a,wcLen:u,secret:o}=v2e({paths:e,censor:r}),c=E2e({secret:o,wcLen:u}),f="strict"in t?t.strict:!0;return _2e({secret:o,wcLen:u,serialize:n,strict:f,isCensorFct:i,censorFctTakesPath:s},S2e({secret:o,censor:r,compileRestore:c,serialize:n,groupRedact:b2e,nestedRedact:w2e,wildcards:a,wcLen:u}))}});var Jo=k((NNe,wN)=>{"use strict";var O2e=Symbol("pino.setLevel"),N2e=Symbol("pino.getLevel"),C2e=Symbol("pino.levelVal"),I2e=Symbol("pino.levelComp"),R2e=Symbol("pino.useLevelLabels"),k2e=Symbol("pino.useOnlyCustomLevels"),D2e=Symbol("pino.mixin"),P2e=Symbol("pino.lsCache"),L2e=Symbol("pino.chindings"),F2e=Symbol("pino.asJson"),j2e=Symbol("pino.write"),U2e=Symbol("pino.redactFmt"),M2e=Symbol("pino.time"),$2e=Symbol("pino.timeSliceIndex"),B2e=Symbol("pino.stream"),H2e=Symbol("pino.stringify"),V2e=Symbol("pino.stringifySafe"),q2e=Symbol("pino.stringifiers"),z2e=Symbol("pino.end"),G2e=Symbol("pino.formatOpts"),J2e=Symbol("pino.messageKey"),K2e=Symbol("pino.errorKey"),X2e=Symbol("pino.nestedKey"),W2e=Symbol("pino.nestedKeyStr"),Y2e=Symbol("pino.mixinMergeStrategy"),Q2e=Symbol("pino.msgPrefix"),Z2e=Symbol("pino.wildcardFirst"),e3e=Symbol.for("pino.serializers"),t3e=Symbol.for("pino.formatters"),n3e=Symbol.for("pino.hooks"),l3e=Symbol.for("pino.metadata");wN.exports={setLevelSym:O2e,getLevelSym:N2e,levelValSym:C2e,levelCompSym:I2e,useLevelLabelsSym:R2e,mixinSym:D2e,lsCacheSym:P2e,chindingsSym:L2e,asJsonSym:F2e,writeSym:j2e,serializersSym:e3e,redactFmtSym:U2e,timeSym:M2e,timeSliceIndexSym:$2e,streamSym:B2e,stringifySym:H2e,stringifySafeSym:V2e,stringifiersSym:q2e,endSym:z2e,formatOptsSym:G2e,messageKeySym:J2e,errorKeySym:K2e,nestedKeySym:X2e,wildcardFirstSym:Z2e,needsMetadataGsym:l3e,useOnlyCustomLevelsSym:k2e,formattersSym:t3e,hooksSym:n3e,nestedKeyStrSym:W2e,mixinMergeStrategySym:Y2e,msgPrefixSym:Q2e}});var kh=k((CNe,AN)=>{"use strict";var Rh=bN(),{redactFmtSym:r3e,wildcardFirstSym:f9}=Jo(),{rx:Ih,validator:i3e}=Rh,SN=i3e({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),TN="[Redacted]",xN=!1;function s3e(t,e){let{paths:n,censor:l}=a3e(t),r=n.reduce((a,u)=>{Ih.lastIndex=0;let o=Ih.exec(u),c=Ih.exec(u),f=o[1]!==void 0?o[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):o[0];if(f==="*"&&(f=f9),c===null)return a[f]=null,a;if(a[f]===null)return a;let{index:m}=c,d=`${u.substr(m,u.length-1)}`;return a[f]=a[f]||[],f!==f9&&a[f].length===0&&a[f].push(...a[f9]||[]),f===f9&&Object.keys(a).forEach(function(y){a[y]&&a[y].push(d)}),a[f].push(d),a},{}),i={[r3e]:Rh({paths:n,censor:l,serialize:e,strict:xN})},s=(...a)=>e(typeof l=="function"?l(...a):l);return[...Object.keys(r),...Object.getOwnPropertySymbols(r)].reduce((a,u)=>{if(r[u]===null)a[u]=o=>s(o,[u]);else{let o=typeof l=="function"?(c,f)=>l(c,[u,...f]):l;a[u]=Rh({paths:r[u],censor:o,serialize:e,strict:xN})}return a},i)}function a3e(t){if(Array.isArray(t))return t={paths:t,censor:TN},SN(t),t;let{paths:e,censor:n=TN,remove:l}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contai
2024-05-06 10:35:10 +08:00
${w}`,v=`,
2024-05-23 19:28:35 +08:00
${w}`);let te=Math.min(E.length,s),Q=0;for(;Q<te-1;Q++){let ce=a(String(Q),E,y,_,S,w);g+=ce!==void 0?ce:"null",g+=v}let W=a(String(Q),E,y,_,S,w);if(g+=W!==void 0?W:"null",E.length-1>s){let ce=E.length-s-1;g+=`${v}"... ${gu(ce)} not stringified"`}return S!==""&&(g+=`
${x}`),y.pop(),`[${g}]`}let O=Object.keys(E),N=O.length;if(N===0)return"{}";if(i<y.length+1)return'"[Object]"';let I="",U="";S!==""&&(w+=S,v=`,
2024-05-29 18:58:23 +08:00
${w}`,I=" ");let F=Math.min(N,s);r&&!lm(E)&&(O=nm(O)),y.push(E);for(let te=0;te<F;te++){let Q=O[te],W=a(Q,E,y,_,S,w);W!==void 0&&(g+=`${U}${Es(Q)}:${I}${W}`,U=v)}if(N>s){let te=N-s;g+=`${U}"...":${I}"${gu(te)} not stringified"`,U=v}return S!==""&&U.length>1&&(g=`
2024-04-17 11:16:03 +08:00
${w}${g}
2024-05-29 18:58:23 +08:00
${x}`),y.pop(),`{${g}}`}case"number":return isFinite(E)?String(E):e?e(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(l)return String(E);default:return e?e(E):void 0}}function u(m,d,y,_,S,w){switch(typeof d=="object"&&d!==null&&typeof d.toJSON=="function"&&(d=d.toJSON(m)),typeof d){case"string":return Es(d);case"object":{if(d===null)return"null";if(y.indexOf(d)!==-1)return n;let E=w,g="",v=",";if(Array.isArray(d)){if(d.length===0)return"[]";if(i<y.length+1)return'"[Array]"';y.push(d),S!==""&&(w+=S,g+=`
2024-05-06 10:35:10 +08:00
${w}`,v=`,
2024-05-23 19:28:35 +08:00
${w}`);let N=Math.min(d.length,s),I=0;for(;I<N-1;I++){let F=u(String(I),d[I],y,_,S,w);g+=F!==void 0?F:"null",g+=v}let U=u(String(I),d[I],y,_,S,w);if(g+=U!==void 0?U:"null",d.length-1>s){let F=d.length-s-1;g+=`${v}"... ${gu(F)} not stringified"`}return S!==""&&(g+=`
2024-05-06 10:35:10 +08:00
${E}`),y.pop(),`[${g}]`}y.push(d);let x="";S!==""&&(w+=S,v=`,
2024-05-29 18:58:23 +08:00
${w}`,x=" ");let O="";for(let N of _){let I=u(N,d[N],y,_,S,w);I!==void 0&&(g+=`${O}${Es(N)}:${x}${I}`,O=v)}return S!==""&&O.length>1&&(g=`
2024-04-17 11:16:03 +08:00
${w}${g}
2024-05-29 18:58:23 +08:00
${E}`),y.pop(),`{${g}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(l)return String(d);default:return e?e(d):void 0}}function o(m,d,y,_,S){switch(typeof d){case"string":return Es(d);case"object":{if(d===null)return"null";if(typeof d.toJSON=="function"){if(d=d.toJSON(m),typeof d!="object")return o(m,d,y,_,S);if(d===null)return"null"}if(y.indexOf(d)!==-1)return n;let w=S;if(Array.isArray(d)){if(d.length===0)return"[]";if(i<y.length+1)return'"[Array]"';y.push(d),S+=_;let I=`
2024-05-23 19:28:35 +08:00
${S}`,U=`,
${S}`,F=Math.min(d.length,s),te=0;for(;te<F-1;te++){let W=o(String(te),d[te],y,_,S);I+=W!==void 0?W:"null",I+=U}let Q=o(String(te),d[te],y,_,S);if(I+=Q!==void 0?Q:"null",d.length-1>s){let W=d.length-s-1;I+=`${U}"... ${gu(W)} not stringified"`}return I+=`
2024-05-13 09:18:33 +08:00
${w}`,y.pop(),`[${I}]`}let E=Object.keys(d),g=E.length;if(g===0)return"{}";if(i<y.length+1)return'"[Object]"';S+=_;let v=`,
2024-05-29 18:58:23 +08:00
${S}`,x="",O="",N=Math.min(g,s);lm(d)&&(x+=NC(d,v,s),E=E.slice(d.length),N-=d.length,O=v),r&&(E=nm(E)),y.push(d);for(let I=0;I<N;I++){let U=E[I],F=o(U,d[U],y,_,S);F!==void 0&&(x+=`${O}${Es(U)}: ${F}`,O=v)}if(g>s){let I=g-s;x+=`${O}"...": "${gu(I)} not stringified"`,O=v}return O!==""&&(x=`
2024-04-17 11:16:03 +08:00
${S}${x}
2024-05-29 18:58:23 +08:00
${w}`),y.pop(),`{${x}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(l)return String(d);default:return e?e(d):void 0}}function c(m,d,y){switch(typeof d){case"string":return Es(d);case"object":{if(d===null)return"null";if(typeof d.toJSON=="function"){if(d=d.toJSON(m),typeof d!="object")return c(m,d,y);if(d===null)return"null"}if(y.indexOf(d)!==-1)return n;let _="";if(Array.isArray(d)){if(d.length===0)return"[]";if(i<y.length+1)return'"[Array]"';y.push(d);let v=Math.min(d.length,s),x=0;for(;x<v-1;x++){let N=c(String(x),d[x],y);_+=N!==void 0?N:"null",_+=","}let O=c(String(x),d[x],y);if(_+=O!==void 0?O:"null",d.length-1>s){let N=d.length-s-1;_+=`,"... ${gu(N)} not stringified"`}return y.pop(),`[${_}]`}let S=Object.keys(d),w=S.length;if(w===0)return"{}";if(i<y.length+1)return'"[Object]"';let E="",g=Math.min(w,s);lm(d)&&(_+=NC(d,",",s),S=S.slice(d.length),g-=d.length,E=","),r&&(S=nm(S)),y.push(d);for(let v=0;v<g;v++){let x=S[v],O=c(x,d[x],y);O!==void 0&&(_+=`${E}${Es(x)}:${O}`,E=",")}if(w>s){let v=w-s;_+=`${E}"...":"${gu(v)} not stringified"`}return y.pop(),`{${_}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(l)return String(d);default:return e?e(d):void 0}}function f(m,d,y){if(arguments.length>1){let _="";if(typeof y=="number"?_=" ".repeat(Math.min(y,10)):typeof y=="string"&&(_=y.slice(0,10)),d!=null){if(typeof d=="function")return a("",{"":m},[],d,_,"");if(Array.isArray(d))return u("",m,[],kie(d),_,"")}if(_.length!==0)return o("",m,[],_,"")}return c("",m,[])}return f}});var LC=k((GNe,PC)=>{"use strict";var sm=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:DC}=w9(),Pie=DC.info;function Lie(t,e){let n=0;t=t||[],e=e||{dedupe:!1};let l=Object.create(DC);l.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(c=>{l[c]=e.levels[c]});let r={write:i,add:a,flushSync:s,end:u,minLevel:0,streams:[],clone:o,[sm]:!0,streamLevels:l};return Array.isArray(t)?t.forEach(a,r):a.call(r,t),t=null,r;function i(c){let f,m=this.lastLevel,{streams:d}=this,y=0,_;for(let S=jie(d.length,e.dedupe);Mie(S,d.length,e.dedupe);S=Uie(S,e.dedupe))if(f=d[S],f.level<=m){if(y!==0&&y!==f.level)break;if(_=f.stream,_[sm]){let{lastTime:w,lastMsg:E,lastObj:g,lastLogger:v}=this;_.lastLevel=m,_.lastTime=w,_.lastMsg=E,_.lastObj=g,_.lastLogger=v}_.write(c),e.dedupe&&(y=f.level)}else if(!e.dedupe)break}function s(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync()}function a(c){if(!c)return r;let f=typeof c.write=="function"||c.stream,m=c.write?c:c.stream;if(!f)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:d,streamLevels:y}=this,_;typeof c.levelVal=="number"?_=c.levelVal:typeof c.level=="string"?_=y[c.level]:typeof c.level=="number"?_=c.level:_=Pie;let S={stream:m,level:_,levelVal:void 0,id:n++};return d.unshift(S),d.sort(Fie),this.minLevel=d[0].level,r}function u(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync(),c.end()}function o(c){let f=new Array(this.streams.length);for(let m=0;m<f.length;m++)f[m]={level:c,stream:this.streams[m].stream};return{write:i,add:a,minLevel:c,streams:f,clone:o,flushSync:s,[sm]:!0}}}function Fie(t,e){return t.level-e.level}function jie(t,e){return e?t-1:0}function Uie(t,e){return e?t-1:t+1}function Mie(t,e,n){return n?t>=0:t<e}PC.exports=Lie});var KC=k((JNe,J3)=>{"use strict";var $ie=require("os"),VC=Th(),Bie=xh(),Hie=kh(),qC=NN(),Vie=OC(),zC=Jo(),{configure:qie}=kC(),{assertDefaultLevelFound:zie,mappings:GC,genLsCache:Gie,genLevelComparison:Jie,assertLevelComparison:Kie}=Yh(),{DEFAULT_LEVELS:Xie,SORTING_ORDER:Wie}=w9(),{createArgsNormalizer:Yie,asChindings:Qie,buildSafeSonicBoom:FC,buildFormatters:Zie,stringify:am,normalizeDestFileDescriptor:jC,noop:ese}=b9(),{version:tse}=Qh(),{chindingsSym:UC,redactFmtSym:nse,serializersSym:MC,timeSym:lse,timeSliceIndexSym:rse,streamSym:ise,stringifySym:$C,stringifySafeSym:um,strin
2024-05-06 10:35:10 +08:00
`:`
2024-05-29 18:58:23 +08:00
`),we=Qie.bind(null,{[UC]:"",[MC]:s,[BC]:Q,[$C]:am,[um]:U,[HC]:F}),se="";f!==null&&(m===void 0?se=we(f):se=we(Object.assign({},f,{name:m})));let ee=a instanceof Function?a:a?JC:_se,me=ee().indexOf(":")+1;if(E&&!y)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(S&&typeof S!="function")throw Error(`Unknown mixin type "${typeof S}" - expected "function"`);if(I&&typeof I!="string")throw Error(`Unknown msgPrefix type "${typeof I}" - expected "string"`);zie(d,y,E);let P=GC(y,E);Kie(_);let G=Jie(_);return Object.assign(e,{levels:P,[dse]:G,[hse]:E,[ise]:l,[lse]:ee,[rse]:me,[$C]:am,[um]:U,[BC]:Q,[ase]:ce,[use]:W,[ose]:u,[cse]:o,[pse]:c,[yse]:c?`,${JSON.stringify(c)}:{`:"",[MC]:s,[fse]:S,[gse]:w,[UC]:se,[HC]:F,[mse]:v,silent:ese,onChild:N,[vse]:I}),Object.setPrototypeOf(e,Vie()),Gie(e),e[sse](d),e}J3.exports=om;J3.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=jC(t.dest||process.stdout.fd),FC(t)):FC({dest:jC(t),minLength:0});J3.exports.transport=zh();J3.exports.multistream=LC();J3.exports.levels=GC();J3.exports.stdSerializers=xse;J3.exports.stdTimeFunctions=Object.assign({},qC);J3.exports.symbols=zC;J3.exports.version=tse;J3.exports.default=om;J3.exports.pino=om});var p1=k((KNe,ZC)=>{"use strict";var Ase=UO(),T9=KC(),{serializersSym:XC}=T9.symbols,{FST_ERR_LOG_INVALID_DESTINATION:Ose,FST_ERR_LOG_INVALID_LOGGER:Nse}=L2();function WC(t){if(t.stream&&t.file)throw new Ose;t.file&&(t.stream=T9.destination(t.file),delete t.file);let e=t.logger,n=t.genReqId,l=null;return e?(t.logger=void 0,t.genReqId=void 0,e[XC]&&(t.serializers=Object.assign({},t.serializers,e[XC])),l=e.child({},t),t.logger=e,t.genReqId=n):l=T9(t,t.stream),l}var cm={req:function(e){return{method:e.method,url:e.url,version:e.headers&&e.headers["accept-version"],hostname:e.hostname,remoteAddress:e.ip,remotePort:e.socket?e.socket.remotePort:void 0}},err:T9.stdSerializers.err,res:function(e){return{statusCode:e.statusCode}}};function Cse(){let t=process.hrtime();return t[0]*1e3+t[1]/1e6}function Ise(t){if(!t.logger){let l=Ase;return l.child=()=>l,{logger:l,hasLogger:!1}}if(YC(t.logger))return{logger:WC({logger:t.logger,serializers:Object.assign({},cm,t.logger.serializers)}),hasLogger:!0};let e={};return Object.prototype.toString.call(t.logger)==="[object Object]"&&Reflect.ownKeys(t.logger).forEach(l=>{Object.defineProperty(e,l,{value:t.logger[l],writable:!0,enumerable:!0,configurable:!0})}),e.level=e.level||"info",e.serializers=Object.assign({},cm,e.serializers),t.logger=e,{logger:WC(t.logger),hasLogger:!0}}function YC(t,e){let n=["info","error","debug","fatal","warn","trace","child"],l=t?n.filter(r=>!t[r]||typeof t[r]!="function"):n;if(l.length){if(l.length===n.length&&!e)return!1;throw Nse(l.join(","))}else return!0}function Rse(t,e,n,l,r){let i={[t.requestIdLogLabel]:l},s=t.childLoggerFactory.call(t.server,e,i,r||{},n);return t.childLoggerFactory!==QC&&YC(s,!0),s}function QC(t,e,n){return t.child(e,n)}ZC.exports={createLogger:Ise,createChildLogger:Rse,defaultChildLoggerFactory:QC,serializers:cm,now:Cse}});var f1=k((XNe,eI)=>{"use strict";eI.exports=kse;function Wo(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function kse(t){if(t=t||{},t.circles)return Dse(t);return t.proto?l:n;function e(r,i){for(var s=Object.keys(r),a=new Array(s.length),u=0;u<s.length;u++){var o=s[u],c=r[o];typeof c!="object"||c===null?a[o]=c:c instanceof Date?a[o]=new Date(c):ArrayBuffer.isView(c)?a[o]=Wo(c):a[o]=i(c)}return a}function n(r){if(typeof r!="object"||r===null)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return e(r,n);if(r instanceof Map)return new Map(e(Array.from(r),n));if(r instanceof Set)return new Set(e(Array.from(r),n));var i={};for(var s in r)if(Object.hasOwnProperty.call(r,s)!==!1){var a=r[s];typeof a!="object"||a===null?i[s]=a:a instanceof Date?i[s]=new Date(a):a instanceof Map?i[s]=new Map(e(Array.from(a),n)):a instanceof Set?i[s]=new Set(e(Array.from(a),n)):ArrayBuffer.isView(a)?i[s]=Wo(a):i[s]=n(a)}return i}function l(r){if(typeof r!="object"||
`:""},this._extScope=e,this._scope=new _r.Scope({parent:e}),this._nodes=[new xm]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let l=this._extScope.value(e,n);return(this._values[l.prefix]||(this._values[l.prefix]=new Set)).add(l),l}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,l,r){let i=this._scope.toName(n);return l!==void 0&&r&&(this._constants[i.str]=l),this._leafNode(new _m(e,i,l)),i}const(e,n,l){return this._def(_r.varKinds.const,e,n,l)}let(e,n,l){return this._def(_r.varKinds.let,e,n,l)}var(e,n,l){return this._def(_r.varKinds.var,e,n,l)}assign(e,n,l){return this._leafNode(new C9(e,n,l))}add(e,n){return this._leafNode(new Em(e,Rt.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==Wt.nil&&this._leafNode(new Tm(e)),this}object(...e){let n=["{"];for(let[l,r]of e)n.length>1&&n.push(","),n.push(l),(l!==r||this.opts.es5)&&(n.push(":"),(0,Wt.addCodeArg)(n,r));return n.push("}"),new Wt._Code(n)}if(e,n,l){if(this._blockNode(new Eu(e)),n&&l)this.code(n).else().code(l).endIf();else if(n)this.code(n).endIf();else if(l)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Eu(e))}else(){return this._elseNode(new Qo)}endIf(){return this._endBlockNode(Eu,Qo)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new Am(e),n)}forRange(e,n,l,r,i=this.opts.es5?_r.varKinds.var:_r.varKinds.let){let s=this._scope.toName(e);return this._for(new Om(i,s,n,l),()=>r(s))}forOf(e,n,l,r=_r.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let s=n instanceof Wt.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Wt._)`${s}.length`,a=>{this.var(i,(0,Wt._)`${s}[${a}]`),l(i)})}return this._for(new I9("of",r,i,n),()=>l(i))}forIn(e,n,l,r=this.opts.es5?_r.varKinds.var:_r.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Wt._)`Object.keys(${n})`,l);let i=this._scope.toName(e);return this._for(new I9("in",r,i,n),()=>l(i))}endFor(){return this._endBlockNode(bu)}label(e){return this._leafNode(new bm(e))}break(e){return this._leafNode(new wm(e))}return(e){let n=new v1;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(v1)}try(e,n,l){if(!n&&!l)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new Nm;if(this._blockNode(r),this.code(e),n){let i=this.name("e");this._currNode=r.catch=new _1(i),n(i)}return l&&(this._currNode=r.finally=new E1,this.code(l)),this._endBlockNode(_1,E1)}throw(e){return this._leafNode(new Sm(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let l=this._nodes.length-n;if(l<0||e!==void 0&&l!==e)throw new Error(`CodeGen: wrong number of nodes: ${l} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=Wt.nil,l,r){return this._blockNode(new g1(e,n,l)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(g1)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let l=this._currNode;if(l instanceof e||n&&l instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof Eu))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};Rt.CodeGen=Cm;function wu(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function R9(t,e){return e in
2024-05-07 17:30:00 +08:00
|| (${s} == "string" && ${r} && ${r} == +${r})`).assign(a,(0,Ot._)`+${r}`);return;case"integer":l.elseIf((0,Ot._)`${s} === "boolean" || ${r} === null
|| (${s} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(a,(0,Ot._)`+${r}`);return;case"boolean":l.elseIf((0,Ot._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(a,!1).elseIf((0,Ot._)`${r} === "true" || ${r} === 1`).assign(a,!0);return;case"null":l.elseIf((0,Ot._)`${r} === "" || ${r} === 0 || ${r} === false`),l.assign(a,null);return;case"array":l.elseIf((0,Ot._)`${s} === "string" || ${s} === "number"
2024-09-23 11:52:18 +08:00
|| ${s} === "boolean" || ${r} === null`).assign(a,(0,Ot._)`[${r}]`)}}}function Bae({gen:t,parentData:e,parentDataProperty:n},l){t.if((0,Ot._)`${e} !== undefined`,()=>t.assign((0,Ot._)`${e}[${n}]`,l))}function Fm(t,e,n,l=w1.Correct){let r=l===w1.Correct?Ot.operators.EQ:Ot.operators.NEQ,i;switch(t){case"null":return(0,Ot._)`${e} ${r} null`;case"array":i=(0,Ot._)`Array.isArray(${e})`;break;case"object":i=(0,Ot._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=s((0,Ot._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=s();break;default:return(0,Ot._)`typeof ${e} ${r} ${t}`}return l===w1.Correct?i:(0,Ot.not)(i);function s(a=Ot.nil){return(0,Ot.and)((0,Ot._)`typeof ${e} == "number"`,a,n?(0,Ot._)`isFinite(${e})`:Ot.nil)}}w2.checkDataType=Fm;function jm(t,e,n,l){if(t.length===1)return Fm(t[0],e,n,l);let r,i=(0,AI.toHash)(t);if(i.array&&i.object){let s=(0,Ot._)`typeof ${e} != "object"`;r=i.null?s:(0,Ot._)`!${e} || ${s}`,delete i.null,delete i.array,delete i.object}else r=Ot.nil;i.number&&delete i.integer;for(let s in i)r=(0,Ot.and)(r,Fm(s,e,n,l));return r}w2.checkDataTypes=jm;var Hae={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ot._)`{type: ${t}}`:(0,Ot._)`{type: ${e}}`};function Um(t){let e=Vae(t);(0,Fae.reportError)(e,Hae)}w2.reportTypeError=Um;function Vae(t){let{gen:e,data:n,schema:l}=t,r=(0,AI.schemaRefOrVal)(t,l,"type");return{gen:e,keyword:"type",data:n,schema:l.type,schemaCode:r,schemaValue:r,parentSchema:l,params:{},it:t}}});var II=k(P9=>{"use strict";Object.defineProperty(P9,"__esModule",{value:!0});P9.assignDefaults=void 0;var n0=st(),qae=Nt();function zae(t,e){let{properties:n,items:l}=t.schema;if(e==="object"&&n)for(let r in n)CI(t,r,n[r].default);else e==="array"&&Array.isArray(l)&&l.forEach((r,i)=>CI(t,i,r.default))}P9.assignDefaults=zae;function CI(t,e,n){let{gen:l,compositeRule:r,data:i,opts:s}=t;if(n===void 0)return;let a=(0,n0._)`${i}${(0,n0.getProperty)(e)}`;if(r){(0,qae.checkStrictMode)(t,`default is ignored for: ${a}`);return}let u=(0,n0._)`${a} === undefined`;s.useDefaults==="empty"&&(u=(0,n0._)`${u} || ${a} === null || ${a} === ""`),l.if(u,(0,n0._)`${a} = ${(0,n0.stringify)(n)}`)}});var S2=k(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.validateUnion=Kn.validateArray=Kn.usePattern=Kn.callValidateCode=Kn.schemaProperties=Kn.allSchemaProperties=Kn.noPropertyInData=Kn.propertyInData=Kn.isOwnProperty=Kn.hasPropFunc=Kn.reportMissingProp=Kn.checkMissingProp=Kn.checkReportMissingProp=void 0;var ol=st(),Mm=Nt(),Ss=X3(),Gae=Nt();function Jae(t,e){let{gen:n,data:l,it:r}=t;n.if(Bm(n,l,e,r.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ol._)`${e}`},!0),t.error()})}Kn.checkReportMissingProp=Jae;function Kae({gen:t,data:e,it:{opts:n}},l,r){return(0,ol.or)(...l.map(i=>(0,ol.and)(Bm(t,e,i,n.ownProperties),(0,ol._)`${r} = ${i}`)))}Kn.checkMissingProp=Kae;function Xae(t,e){t.setParams({missingProperty:e},!0),t.error()}Kn.reportMissingProp=Xae;function RI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ol._)`Object.prototype.hasOwnProperty`})}Kn.hasPropFunc=RI;function $m(t,e,n){return(0,ol._)`${RI(t)}.call(${e}, ${n})`}Kn.isOwnProperty=$m;function Wae(t,e,n,l){let r=(0,ol._)`${e}${(0,ol.getProperty)(n)} !== undefined`;return l?(0,ol._)`${r} && ${$m(t,e,n)}`:r}Kn.propertyInData=Wae;function Bm(t,e,n,l){let r=(0,ol._)`${e}${(0,ol.getProperty)(n)} === undefined`;return l?(0,ol.or)(r,(0,ol.not)($m(t,e,n))):r}Kn.noPropertyInData=Bm;function kI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Kn.allSchemaProperties=kI;function Yae(t,e){return kI(e).filter(n=>!(0,Mm.alwaysValidSchema)(t,e[n]))}Kn.schemaProperties=Yae;function Qae({schemaCode:t,data:e,it:{gen:n,topSchemaRef:l,schemaPath:r,errorPath:i},it:s},a,u,o){let c=o?(0,ol._)`${t}, ${e}, ${l}${r}`:e,f=[[Ss.default.instancePath,(0,ol.strConcat)(Ss.default.instancePath,i)],[Ss.default.parentData,s.parentData],[Ss.default.parentDataProperty,s.parentDataProperty],[Ss.default.rootData,Ss.default.rootData]];s.opts.d
2024-05-07 17:30:00 +08:00
missingProperty: ${l},
2024-04-02 15:03:09 +08:00
depsCount: ${e},
2024-09-23 11:52:18 +08:00
deps: ${n}}`};var I0e={keyword:"dependencies",type:"object",schemaType:"object",error:Yr.error,code(t){let[e,n]=R0e(t);qR(t,e),zR(t,n)}};function R0e({schema:t}){let e={},n={};for(let l in t){if(l==="__proto__")continue;let r=Array.isArray(t[l])?e:n;r[l]=t[l]}return[e,n]}function qR(t,e=t.schema){let{gen:n,data:l,it:r}=t;if(Object.keys(e).length===0)return;let i=n.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let u=(0,$1.propertyInData)(n,l,s,r.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),r.allErrors?n.if(u,()=>{for(let o of a)(0,$1.checkReportMissingProp)(t,o)}):(n.if((0,Oy._)`${u} && (${(0,$1.checkMissingProp)(t,a,i)})`),(0,$1.reportMissingProp)(t,i),n.else())}}Yr.validatePropertyDeps=qR;function zR(t,e=t.schema){let{gen:n,data:l,keyword:r,it:i}=t,s=n.name("valid");for(let a in e)(0,C0e.alwaysValidSchema)(i,e[a])||(n.if((0,$1.propertyInData)(n,l,a,i.opts.ownProperties),()=>{let u=t.subschema({keyword:r,schemaProp:a},s);t.mergeValidEvaluated(u,s)},()=>n.var(s,!0)),t.ok(s))}Yr.validateSchemaDeps=zR;Yr.default=I0e});var KR=k(Ny=>{"use strict";Object.defineProperty(Ny,"__esModule",{value:!0});var JR=st(),k0e=Nt(),D0e={message:"property name must be valid",params:({params:t})=>(0,JR._)`{propertyName: ${t.propertyName}}`},P0e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:D0e,code(t){let{gen:e,schema:n,data:l,it:r}=t;if((0,k0e.alwaysValidSchema)(r,n))return;let i=e.name("valid");e.forIn("key",l,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),e.if((0,JR.not)(i),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(i)}};Ny.default=P0e});var Iy=k(Cy=>{"use strict";Object.defineProperty(Cy,"__esModule",{value:!0});var K9=S2(),wr=st(),L0e=X3(),X9=Nt(),F0e={message:"must NOT have additional properties",params:({params:t})=>(0,wr._)`{additionalProperty: ${t.additionalProperty}}`},j0e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:F0e,code(t){let{gen:e,schema:n,parentSchema:l,data:r,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:u}=s;if(s.props=!0,u.removeAdditional!=="all"&&(0,X9.alwaysValidSchema)(s,n))return;let o=(0,K9.allSchemaProperties)(l.properties),c=(0,K9.allSchemaProperties)(l.patternProperties);f(),t.ok((0,wr._)`${i} === ${L0e.default.errors}`);function f(){e.forIn("key",r,S=>{!o.length&&!c.length?y(S):e.if(m(S),()=>y(S))})}function m(S){let w;if(o.length>8){let E=(0,X9.schemaRefOrVal)(s,l.properties,"properties");w=(0,K9.isOwnProperty)(e,E,S)}else o.length?w=(0,wr.or)(...o.map(E=>(0,wr._)`${S} === ${E}`)):w=wr.nil;return c.length&&(w=(0,wr.or)(w,...c.map(E=>(0,wr._)`${(0,K9.usePattern)(t,E)}.test(${S})`))),(0,wr.not)(w)}function d(S){e.code((0,wr._)`delete ${r}[${S}]`)}function y(S){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){d(S);return}if(n===!1){t.setParams({additionalProperty:S}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,X9.alwaysValidSchema)(s,n)){let w=e.name("valid");u.removeAdditional==="failing"?(_(S,w,!1),e.if((0,wr.not)(w),()=>{t.reset(),d(S)})):(_(S,w),a||e.if((0,wr.not)(w),()=>e.break()))}}function _(S,w,E){let g={keyword:"additionalProperties",dataProp:S,dataPropType:X9.Type.Str};E===!1&&Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(g,w)}}};Cy.default=j0e});var YR=k(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});var U0e=i0(),XR=S2(),Ry=Nt(),WR=Iy(),M0e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:l,data:r,it:i}=t;i.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&WR.default.code(new U0e.KeywordCxt(i,WR.default,"additionalProperties"));let s=(0,XR.allSchemaProperties)(n);for(let f of s)i.definedProperties.add(f);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Ry.mergeEvaluated.props(e,(0,Ry.toHash)(s),i.props));let a=s.filter(f=>!(0,Ry.alwaysValidSchema)(i,n[f]));if(a.le
2024-05-07 17:30:00 +08:00
`,r+=`const validator = Validator.restoreFromState(validatorState)
`):r+=`const validator = null
2024-05-06 10:35:10 +08:00
`,`
2024-04-02 15:03:09 +08:00
'use strict'
const { dependencies } = require('fast-json-stringify/lib/standalone')
const { Serializer, Validator } = dependencies
const serializerState = ${JSON.stringify(n.getState())}
const serializer = Serializer.restoreFromState(serializerState)
2024-05-07 17:30:00 +08:00
${r}
2024-04-02 15:03:09 +08:00
2024-09-23 11:52:18 +08:00
module.exports = ${t.toString()}(validator, serializer)`}sg.exports=j1e;sg.exports.dependencies={Serializer:dm(),Validator:ig()}});var Wk=k((gIe,Xk)=>{"use strict";var{dependencies:U1e}=ag(),{Serializer:M1e,Validator:yIe}=U1e,$1e={mode:"standalone"},B1e=M1e.restoreFromState($1e),H1e=null;Xk.exports=function(e,n){function l(i){let s=i&&typeof i.toJSON=="function"?i.toJSON():i;if(s===null)return"{}";let a=!1,u="{";return s.statusCode!==void 0&&(!a&&(a=!0)||(u+=","),u+='"statusCode":',u+=n.asNumber(s.statusCode)),s.code!==void 0&&(!a&&(a=!0)||(u+=","),u+='"code":',u+=n.asString(s.code)),s.error!==void 0&&(!a&&(a=!0)||(u+=","),u+='"error":',u+=n.asString(s.error)),s.message!==void 0&&(!a&&(a=!0)||(u+=","),u+='"message":',u+=n.asString(s.message)),u+"}"}return l}(H1e,B1e)});var q1=k((vIe,eD)=>{"use strict";var Yk=require("node:http").STATUS_CODES,V1e=ch(),{kReplyHeaders:Iu,kReplyNextErrorHandler:ac,kReplyIsRunningOnErrorHook:q1e,kReplyHasStatusCode:z1e,kRouteContext:Zk}=p2(),{FST_ERR_REP_INVALID_PAYLOAD_TYPE:G1e,FST_ERR_FAILED_ERROR_SERIALIZATION:J1e}=L2(),{getSchemaSerializer:K1e}=d1(),ug=Wk(),X1e={func:Y1e,toJSON(){return this.func.name.toString()+"()"}};function W1e(t,e,n){t[q1e]=!1;let l=t[Zk];if(t[ac]===!1){Qk(e,t,function(a,u){try{a.raw.writeHead(a.raw.statusCode,a[Iu])}catch(o){a.log.warn({req:a.request,res:a,err:o},o&&o.message),a.raw.writeHead(a.raw.statusCode)}a.raw.end(u)});return}let r=t[ac]||l.errorHandler;t[ac]=Object.getPrototypeOf(r),delete t[Iu]["content-type"],delete t[Iu]["content-length"];let i=r.func;if(!i){t[ac]=!1,Qk(e,t,n);return}let s=i(e,t.request,t);s!==void 0&&(s!==null&&typeof s.then=="function"?V1e(s,t):t.send(s))}function Y1e(t,e,n){if(Z1e(t,n),!n[z1e]||n.statusCode===200){let l=t.statusCode||t.status;n.code(l>=400?l:500)}n.statusCode<500?n.log.info({res:n,err:t},t&&t.message):n.log.error({req:e,res:n,err:t},t&&t.message),n.send(t)}function Qk(t,e,n){let l=e.raw,r=e.statusCode;e[Iu]["content-type"]=e[Iu]["content-type"]??"application/json; charset=utf-8";let i;try{let s=K1e(e[Zk],r,e[Iu]["content-type"]);i=s===!1?ug({error:Yk[r+""],code:t.code,message:t.message,statusCode:r}):s(Object.create(t,{error:{value:Yk[r+""]},message:{value:t.message},statusCode:{value:r}}))}catch(s){e.log.error({err:s,statusCode:l.statusCode},"The serializer for the given status code failed"),e.code(500),i=ug(new J1e(s.message,t.message))}typeof i!="string"&&!Buffer.isBuffer(i)&&(i=ug(new G1e(typeof i))),e[Iu]["content-length"]=""+Buffer.byteLength(i),n(e,i)}function Q1e(t=X1e,e){if(!e)return t;let n=Object.create(t);return n.func=e,n}function Z1e(t,e){let n=e.raw,l=n.statusCode;l=l>=400?l:500,t!=null&&(t.headers!==void 0&&e.headers(t.headers),t.status>=400?l=t.status:t.statusCode>=400&&(l=t.statusCode)),n.statusCode=l}eD.exports={buildErrorHandler:Q1e,handleError:W1e}});var dc=k((_Ie,fc)=>{"use strict";var fg=require("node:stream").finished,e5e=require("node:stream").Readable,{kFourOhFourContext:tD,kPublicRouteContext:nD,kReplyErrorHandlerCalled:cD,kReplyHijacked:z1,kReplyStartTime:G1,kReplyEndTime:hg,kReplySerializer:Hi,kReplySerializerDefault:oc,kReplyIsError:cc,kReplyHeaders:il,kReplyTrailers:f2,kReplyHasStatusCode:mg,kReplyIsRunningOnErrorHook:yg,kReplyNextErrorHandler:t5e,kDisableRequestLogging:pD,kSchemaResponse:pc,kReplyCacheSerializeFns:Is,kSchemaController:og,kOptions:n5e,kRouteContext:jt}=p2(),{onSendHookRunner:fD,onResponseHookRunner:l5e,preHandlerHookRunner:r5e,preSerializationHookRunner:i5e}=ys(),lD=hh()[Symbol.for("internals")],s5e=p1(),dg=s5e.now,{handleError:rD}=q1(),{getSchemaSerializer:a5e}=d1(),cg={JSON:"application/json; charset=utf-8",PLAIN:"text/plain; charset=utf-8",OCTET:"application/octet-stream"},{FST_ERR_REP_INVALID_PAYLOAD_TYPE:u5e,FST_ERR_REP_RESPONSE_BODY_CONSUMED:o5e,FST_ERR_REP_ALREADY_SENT:dD,FST_ERR_REP_SENT_VALUE:c5e,FST_ERR_SEND_INSIDE_ONERR:p5e,FST_ERR_BAD_STATUS_CODE:f5e,FST_ERR_BAD_TRAILER_NAME:d5e,FST_ERR_BAD_TRAILER_VALUE:h5e,FST_ERR_MISSING_SERIALIZATION_FN:m5e,FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:y5e}=L2(),{FSTDEP010:g5e,FSTDEP013:v5e,FSTDEP019:_5e,FSTDEP020:E5e}=Fi
2024-04-02 15:03:09 +08:00
${n.functions.join(`
`)}
const main = anonymous0
return main
2024-05-06 10:35:10 +08:00
`:s=`
2024-04-02 15:03:09 +08:00
function main (input) {
let json = ''
2024-05-07 17:30:00 +08:00
${i}
2024-04-02 15:03:09 +08:00
return json
}
${n.functions.join(`
`)}
return main
2024-05-29 18:58:23 +08:00
`;let a=new r7e(e),u=new i7e(e.ajv);for(let c of n.validatorSchemasIds){let f=n.refResolver.getSchema(c);u.addSchema(f,c);let m=n.refResolver.getSchemaDependencies(c);for(let[d,y]of Object.entries(m))u.addSchema(y,d)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:u,serializer:a,code:`validator
2024-04-02 15:03:09 +08:00
serializer
2024-05-29 18:58:23 +08:00
${s}`,ajv:u.ajv};let o=new Function("validator","serializer",s);return e.mode==="standalone"?ag()(o,n,a,u):o(u,a)}var u7e=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],o7e=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],c7e=["maxLength","minLength","pattern"],p7e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function _F(t){for(var e of u7e)if(e in t)return"object";for(var e of o7e)if(e in t)return"array";for(var e of c7e)if(e in t)return"string";for(var e of p7e)if(e in t)return"number";return t.type}function f7e(t,e){let n=e.schema,l=Object.keys(n.properties||{}),r=`
2024-05-07 17:30:00 +08:00
const propertiesKeys = ${JSON.stringify(l)}
2024-04-02 15:03:09 +08:00
for (const [key, value] of Object.entries(obj)) {
if (
propertiesKeys.includes(key) ||
value === undefined ||
typeof value === 'function' ||
typeof value === 'symbol'
) continue
2024-05-07 17:30:00 +08:00
`,i=e.getPropertyLocation("patternProperties"),s=i.schema;if(s!==void 0)for(let o in s){let c=i.getPropertyLocation(o);r+=`
if (/${o.replace(/\\*\//g,"\\/")}/.test(key)) {
2024-05-23 19:28:35 +08:00
${b0}
2024-04-02 15:03:09 +08:00
json += serializer.asString(key) + ':'
2024-05-23 19:28:35 +08:00
${ti(t,c,"value")}
2024-04-02 15:03:09 +08:00
continue
}
2024-05-07 17:30:00 +08:00
`}let u=e.getPropertyLocation("additionalProperties").schema;if(u!==void 0)if(u===!0)r+=`
2024-05-23 19:28:35 +08:00
${b0}
2024-04-02 15:03:09 +08:00
json += serializer.asString(key) + ':' + JSON.stringify(value)
2024-05-07 17:30:00 +08:00
`;else{let o=e.getPropertyLocation("additionalProperties");r+=`
2024-05-23 19:28:35 +08:00
${b0}
2024-04-02 15:03:09 +08:00
json += serializer.asString(key) + ':'
2024-05-23 19:28:35 +08:00
${ti(t,o,"value")}
2024-05-07 17:30:00 +08:00
`}return r+=`
2024-04-02 15:03:09 +08:00
}
2024-05-29 18:58:23 +08:00
`,r}function d7e(t,e){let n="",l=e.schema,r=l.required||[],i=e.getPropertyLocation("properties"),s=[],a=[];if(l.properties)for(let o of Object.keys(l.properties)){if(r.indexOf(o)===-1)continue;let c=i.getPropertyLocation(o);c.schema.$ref&&(c=w0(t,e,c.schema.$ref));let f=JSON.stringify(o);c.schema.default===void 0&&(n+=`if (obj[${f}] === undefined) throw new Error('${f} is required!')
2024-05-07 17:30:00 +08:00
`,a.push(o)),s.push(o)}for(let o of r)s.indexOf(o)===-1&&(n+=`if (obj['${o}'] === undefined) throw new Error('"${o}" is required!')
2024-05-06 10:35:10 +08:00
`);n+=`
2024-04-02 15:03:09 +08:00
let addComma = false
2024-05-06 10:35:10 +08:00
let json = '${t.wrapObjects?"{":""}'
2024-05-23 19:28:35 +08:00
`;let u=t.wrapObjects;if(t.wrapObjects=!0,l.properties)for(let o of Object.keys(l.properties)){let c=i.getPropertyLocation(o);c.schema.$ref&&(c=w0(t,e,c.schema.$ref));let f=JSON.stringify(o);if(a.indexOf(o)!==-1)n+=`
${b0}
2024-05-06 10:35:10 +08:00
json += ${JSON.stringify(f+":")}
2024-05-23 19:28:35 +08:00
${ti(t,c,`obj[${f}]`)}
2024-05-06 10:35:10 +08:00
`;else{n+=`
2024-04-02 15:03:09 +08:00
if (obj[${f}] !== undefined) {
2024-05-23 19:28:35 +08:00
${b0}
2024-05-06 10:35:10 +08:00
json += ${JSON.stringify(f+":")}
2024-05-23 19:28:35 +08:00
${ti(t,c,`obj[${f}]`)}
2024-04-02 15:03:09 +08:00
}
2024-05-06 10:35:10 +08:00
`;let m=c.schema.default;m!==void 0&&(n+=`
2024-04-02 15:03:09 +08:00
else {
2024-05-23 19:28:35 +08:00
${b0}
2024-05-06 10:35:10 +08:00
json += ${JSON.stringify(f+":"+JSON.stringify(m))}
2024-04-02 15:03:09 +08:00
}
2024-05-29 18:58:23 +08:00
`)}}return(l.patternProperties||l.additionalProperties)&&(n+=f7e(t,e)),t.wrapObjects=u,n+=`
2024-05-06 10:35:10 +08:00
return json${t.wrapObjects?" + '}'":""}
2024-05-29 18:58:23 +08:00
`,n}function EF(t,e,n,l){let r=e.getPropertyLocation("allOf");for(let i=0;i<n.allOf.length;i++){let s=n.allOf[i];if(s.$ref){let u=r.getPropertyLocation(i);s=w0(t,u,s.$ref).schema}let a=s.type;if(a===void 0&&(a=_F(s)),a!==void 0){if(l.type!==void 0&&l.type!==a)throw new Error("allOf schemas have different type values");l.type=a}if(s.format!==void 0){if(l.format!==void 0&&l.format!==s.format)throw new Error("allOf schemas have different format values");l.format=s.format}if(s.nullable!==void 0){if(l.nullable!==void 0&&l.nullable!==s.nullable)throw new Error("allOf schemas have different nullable values");l.nullable=s.nullable}s.properties!==void 0&&(l.properties===void 0&&(l.properties={}),Object.assign(l.properties,s.properties)),s.additionalProperties!==void 0&&(l.additionalProperties===void 0&&(l.additionalProperties={}),Object.assign(l.additionalProperties,s.additionalProperties)),s.patternProperties!==void 0&&(l.patternProperties===void 0&&(l.patternProperties={}),Object.assign(l.patternProperties,s.patternProperties)),s.required!==void 0&&(l.required===void 0&&(l.required=[]),l.required.push(...s.required)),s.oneOf!==void 0&&(l.oneOf===void 0&&(l.oneOf=[]),l.oneOf.push(...s.oneOf)),s.anyOf!==void 0&&(l.anyOf===void 0&&(l.anyOf=[]),l.anyOf.push(...s.anyOf)),s.allOf!==void 0&&EF(t,e,s,l)}delete l.allOf,l.$id=`__fjs_merged_${vF++}`,t.refResolver.addSchema(l),e.addMergedSchema(l,l.$id)}function h7e(t,e,n){t.validatorSchemasIds.add(e.getSchemaId());let l=ov({},e.schema),r=l.then,i=l.else||{additionalProperties:!0};delete l.if,delete l.then,delete l.else;let a=e.getPropertyLocation("if").getSchemaRef(),u=e.getPropertyLocation("then");u.schema=ov(l,r);let o=e.getPropertyLocation("else");return o.schema=ov(l,i),`
2024-04-02 15:03:09 +08:00
if (validator.validate("${a}", ${n})) {
2024-05-23 19:28:35 +08:00
${ti(t,u,n)}
2024-04-02 15:03:09 +08:00
} else {
2024-05-23 19:28:35 +08:00
${ti(t,o,n)}
2024-04-02 15:03:09 +08:00
}
2024-05-29 18:58:23 +08:00
`}function m7e(t){return`(${t} && typeof ${t}.toJSON === 'function')
2024-04-02 15:03:09 +08:00
? ${t}.toJSON()
: ${t}
2024-05-23 19:28:35 +08:00
`}function bF(t,e){let n=e.schema;if(t.functionsNamesBySchema.has(n))return t.functionsNamesBySchema.get(n);let l=SF(t);t.functionsNamesBySchema.set(n,l);let r=e.getSchemaRef();r.startsWith(t.rootSchemaId)&&(r=r.replace(t.rootSchemaId,""));let i=`
2024-05-07 17:30:00 +08:00
`,s=n.nullable===!0;return i+=`
// ${r}
function ${l} (input) {
2024-05-29 18:58:23 +08:00
const obj = ${m7e("input")}
2024-05-06 10:35:10 +08:00
${s?"":"if (obj === null) return '{}'"}
2024-04-02 15:03:09 +08:00
2024-05-29 18:58:23 +08:00
${d7e(t,e)}
2024-04-02 15:03:09 +08:00
}
2024-05-29 18:58:23 +08:00
`,t.functions.push(i),l}function y7e(t,e){let n=e.schema,l=e.getPropertyLocation("items");l.schema=l.schema||{},l.schema.$ref&&(l=w0(t,l,l.schema.$ref));let r=l.schema;if(t.functionsNamesBySchema.has(n))return t.functionsNamesBySchema.get(n);let i=SF(t);t.functionsNamesBySchema.set(n,i);let s=e.getSchemaRef();s.startsWith(t.rootSchemaId)&&(s=s.replace(t.rootSchemaId,""));let a=`
2024-05-07 17:30:00 +08:00
function ${i} (obj) {
2024-04-17 11:16:03 +08:00
// ${s}
2024-05-07 17:30:00 +08:00
`,u=n.nullable===!0;if(a+=`
${u?"":"if (obj === null) return '[]'"}
2024-04-02 15:03:09 +08:00
if (!Array.isArray(obj)) {
2024-04-17 11:16:03 +08:00
throw new TypeError(\`The value of '${s}' does not match schema definition.\`)
2024-04-02 15:03:09 +08:00
}
const arrayLength = obj.length
2024-05-07 17:30:00 +08:00
`,!n.additionalItems&&Array.isArray(r)&&(a+=`
if (arrayLength > ${r.length}) {
throw new Error(\`Item at ${r.length} does not match schema definition.\`)
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`),yF==="json-stringify"&&(a+=`if (arrayLength && arrayLength >= ${Bc}) return JSON.stringify(obj)
2024-05-06 10:35:10 +08:00
`),a+=`
2024-04-02 15:03:09 +08:00
let jsonOutput = ''
2024-05-23 19:28:35 +08:00
`,Array.isArray(r)){for(let o=0;o<r.length;o++){let c=r[o],f=ti(t,l.getPropertyLocation(o),`obj[${o}]`);a+=`
2024-05-07 17:30:00 +08:00
if (${o} < arrayLength) {
2024-05-23 19:28:35 +08:00
if (${wF(c.type,`[${o}]`)}) {
2024-04-02 15:03:09 +08:00
let json = ''
${f}
jsonOutput += json
2024-05-07 17:30:00 +08:00
if (${o} < arrayLength - 1) {
2024-04-02 15:03:09 +08:00
jsonOutput += ','
}
} else {
2024-05-07 17:30:00 +08:00
throw new Error(\`Item at ${o} does not match schema definition.\`)
2024-04-02 15:03:09 +08:00
}
}
2024-05-06 10:35:10 +08:00
`}n.additionalItems&&(a+=`
2024-05-07 17:30:00 +08:00
for (let i = ${r.length}; i < arrayLength; i++) {
2024-04-02 15:03:09 +08:00
jsonOutput += JSON.stringify(obj[i])
if (i < arrayLength - 1) {
jsonOutput += ','
}
2024-05-23 19:28:35 +08:00
}`)}else{let o=ti(t,l,"obj[i]");a+=`
2024-04-02 15:03:09 +08:00
for (let i = 0; i < arrayLength; i++) {
let json = ''
2024-05-07 17:30:00 +08:00
${o}
2024-04-02 15:03:09 +08:00
jsonOutput += json
if (i < arrayLength - 1) {
jsonOutput += ','
}
2024-05-23 19:28:35 +08:00
}`}return a+="\n return `[${jsonOutput}]`\n }",t.functions.push(a),i}function wF(t,e){let n;switch(t){case"null":n=`obj${e} === null`;break;case"string":n=`typeof obj${e} === 'string' ||
2024-04-02 15:03:09 +08:00
obj${e} === null ||
obj${e} instanceof Date ||
obj${e} instanceof RegExp ||
(
typeof obj${e} === "object" &&
typeof obj${e}.toString === "function" &&
obj${e}.toString !== Object.prototype.toString
2024-05-29 18:58:23 +08:00
)`;break;case"integer":n=`Number.isInteger(obj${e})`;break;case"number":n=`Number.isFinite(obj${e})`;break;case"boolean":n=`typeof obj${e} === 'boolean'`;break;case"object":n=`obj${e} && typeof obj${e} === 'object' && obj${e}.constructor === Object`;break;case"array":n=`Array.isArray(obj${e})`;break;default:Array.isArray(t)&&(n=`(${t.map(r=>wF(r,e)).join(" || ")})`)}return n}function SF(t){return"anonymous"+t.functionsCounter++}function g7e(t,e,n){let r=e.schema.type.sort(a=>a==="null"?-1:1),i="";r.forEach((a,u)=>{e.schema={...e.schema,type:a};let o=TF(t,e,n),c=u===0?"if":"else if";switch(a){case"null":i+=`
2024-04-02 15:03:09 +08:00
${c} (${n} === null)
2024-05-07 17:30:00 +08:00
${o}
`;break;case"string":{i+=`
2024-04-02 15:03:09 +08:00
${c}(
typeof ${n} === "string" ||
${n} === null ||
${n} instanceof Date ||
${n} instanceof RegExp ||
(
typeof ${n} === "object" &&
typeof ${n}.toString === "function" &&
${n}.toString !== Object.prototype.toString
)
)
2024-05-07 17:30:00 +08:00
${o}
`;break}case"array":{i+=`
2024-04-02 15:03:09 +08:00
${c}(Array.isArray(${n}))
2024-05-07 17:30:00 +08:00
${o}
`;break}case"integer":{i+=`
2024-04-02 15:03:09 +08:00
${c}(Number.isInteger(${n}) || ${n} === null)
2024-05-07 17:30:00 +08:00
${o}
`;break}default:{i+=`
2024-04-02 15:03:09 +08:00
${c}(typeof ${n} === "${a}" || ${n} === null)
2024-05-07 17:30:00 +08:00
${o}
`;break}}});let s=e.getSchemaRef();return s.startsWith(t.rootSchemaId)&&(s=s.replace(t.rootSchemaId,"")),i+=`
2024-04-17 11:16:03 +08:00
else throw new TypeError(\`The value of '${s}' does not match schema definition.\`)
2024-05-29 18:58:23 +08:00
`,i}function TF(t,e,n){let l=e.schema;switch(l.type){case"null":return"json += 'null'";case"string":return l.format==="date-time"?`json += serializer.asDateTime(${n})`:l.format==="date"?`json += serializer.asDate(${n})`:l.format==="time"?`json += serializer.asTime(${n})`:`json += serializer.asString(${n})`;case"integer":return`json += serializer.asInteger(${n})`;case"number":return`json += serializer.asNumber(${n})`;case"boolean":return`json += serializer.asBoolean(${n})`;case"object":return`json += ${bF(t,e)}(${n})`;case"array":return`json += ${y7e(t,e)}(${n})`;case void 0:return`json += JSON.stringify(${n})`;default:throw new Error(`${l.type} unsupported`)}}function v7e(t,e){let n=t.schema,l=n.type,r=Array.isArray(l)&&l.includes("null"),i="";return r&&(i+=`
2024-04-02 15:03:09 +08:00
if (${e} === null) {
json += 'null'
} else {
2024-05-29 18:58:23 +08:00
`),i+=`json += '${JSON.stringify(n.const).replace(s7e,"\\'")}'`,r&&(i+=`
2024-04-02 15:03:09 +08:00
}
2024-05-29 18:58:23 +08:00
`),i}function ti(t,e,n){let l=e.schema;if(typeof l=="boolean")return`json += JSON.stringify(${n})`;if(l.$ref&&(e=w0(t,e,l.$ref),l=e.schema),l.type===void 0){let a=_F(l);a&&(l.type=a)}if(l.if&&l.then)return h7e(t,e,n);l.allOf&&(EF(t,e,l,n7e(l)),l=e.schema);let r=l.type,i="";if((r===void 0||r==="object")&&(l.anyOf||l.oneOf)){if(t.validatorSchemasIds.add(e.getSchemaId()),l.type==="object"){t.wrapObjects=!1;let c=bF(t,e);i+=`
2024-04-02 15:03:09 +08:00
json += '{'
json += ${c}(${n})
json += ','
2024-05-23 19:28:35 +08:00
`}let a=l.anyOf?"anyOf":"oneOf",u=e.getPropertyLocation(a);for(let c=0;c<e.schema[a].length;c++){let f=u.getPropertyLocation(c),m=f.getSchemaRef(),d=ti(t,f,n);i+=`
2024-05-06 10:35:10 +08:00
${c===0?"if":"else if"}(validator.validate("${m}", ${n}))
2024-04-17 11:16:03 +08:00
${d}
2024-05-07 17:30:00 +08:00
`}let o=e.getSchemaRef();return o.startsWith(t.rootSchemaId)&&(o=o.replace(t.rootSchemaId,"")),i+=`
else throw new TypeError(\`The value of '${o}' does not match schema definition.\`)
`,l.type==="object"&&(i+=`
2024-04-02 15:03:09 +08:00
json += '}'
2024-05-07 17:30:00 +08:00
`,t.wrapObjects=!0),i}let s=l.nullable===!0;return s&&(i+=`
2024-04-02 15:03:09 +08:00
if (${n} === null) {
json += 'null'
} else {
2024-05-29 18:58:23 +08:00
`),l.const!==void 0?i+=v7e(e,n):Array.isArray(r)?i+=g7e(t,e,n):i+=TF(t,e,n),s&&(i+=`
2024-04-02 15:03:09 +08:00
}
2024-05-29 18:58:23 +08:00
`),i}S0.exports=pv;S0.exports.default=pv;S0.exports.build=pv;S0.exports.validLargeArrayMechanisms=gF;S0.exports.restore=function({code:t,validator:e,serializer:n}){return Function.apply(null,["validator","serializer",t]).apply(null,[e,n])}});var OF=k((ORe,fv)=>{"use strict";var _7e=dv();function AF(t={readMode:!0}){if(t.readMode===!0&&typeof t.restoreFunction!="function")throw new Error("You must provide a function for the restoreFunction-option when readMode ON");if(t.readMode!==!0&&typeof t.storeFunction!="function")throw new Error("You must provide a function for the storeFunction-option when readMode OFF");if(t.readMode===!0)return function(){return function(l){return t.restoreFunction(l)}};let e=_7e();return function(l,r={}){r.mode="standalone";let i=e(l,r);return function(s){let a=i(s);return t.storeFunction(s,a),new Function(a)}}}fv.exports=AF;fv.exports.default=AF});var dv=k((NRe,u5)=>{"use strict";var E7e=xF();function hv(){return function(e,n){let l=Object.assign({},n,{schema:e});return b7e.bind(null,l)}}function b7e(t,{schema:e}){return t.schema&&e.$id&&t.schema[e.$id]&&(t.schema={...t.schema},delete t.schema[e.$id]),E7e(e,t)}u5.exports=hv;u5.exports.default=hv;u5.exports.SerializerSelector=hv;u5.exports.StandaloneSerializer=OF()});var Ji=k(o5=>{"use strict";Object.defineProperty(o5,"__esModule",{value:!0});o5.checkMetadata=void 0;var w7e=Nt(),S7e={keyword:"metadata",schemaType:"object",code(t){NF(t);let{gen:e,schema:n,it:l}=t;if((0,w7e.alwaysValidSchema)(l,n))return;let r=e.name("valid");t.subschema({keyword:"metadata",jtdMetadata:!0},r),t.ok(r)}};function NF({it:t,keyword:e},n){if(t.jtdMetadata!==n)throw new Error(`JTD: "${e}" cannot be used in this schema location`)}o5.checkMetadata=NF;o5.default=S7e});var Hc=k(p5=>{"use strict";Object.defineProperty(p5,"__esModule",{value:!0});p5.hasRef=void 0;var CF=Au(),c5=st(),T7e=Os(),IF=X3(),RF=ry(),x7e=Ji(),A7e={keyword:"ref",schemaType:"string",code(t){(0,x7e.checkMetadata)(t);let{gen:e,data:n,schema:l,parentSchema:r,it:i}=t,{schemaEnv:{root:s}}=i,a=e.name("valid");r.nullable?(e.var(a,(0,c5._)`${n} === null`),e.if((0,c5.not)(a),u)):(e.var(a,!1),u()),t.ok(a);function u(){var f;let m=(f=s.schema.definitions)===null||f===void 0?void 0:f[l];if(!m)throw new T7e.default(i.opts.uriResolver,"",l,`No definition ${l}`);mv(m)||!i.opts.inlineRefs?o(m):c(m)}function o(f){let m=CF.compileSchema.call(i.self,new CF.SchemaEnv({schema:f,root:s,schemaPath:`/definitions/${l}`})),d=(0,RF.getValidate)(t,m),y=e.const("_errs",IF.default.errors);(0,RF.callRef)(t,d,m,m.$async),e.assign(a,(0,c5._)`${y} === ${IF.default.errors}`)}function c(f){let m=e.scopeValue("schema",i.opts.code.source===!0?{ref:f,code:(0,c5.stringify)(f)}:{ref:f});t.subschema({schema:f,dataTypes:[],schemaPath:c5.nil,topSchemaRef:m,errSchemaPath:`/definitions/${l}`},a)}}};function mv(t){for(let e in t){let n;if(e==="ref"||typeof(n=t[e])=="object"&&mv(n))return!0}return!1}p5.hasRef=mv;p5.default=A7e});var gv=k(yv=>{"use strict";Object.defineProperty(yv,"__esModule",{value:!0});var O7e=/t|\s/i,N7e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,C7e=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,I7e=[0,31,28,31,30,31,30,31,31,30,31,30,31];function DF(t,e){let n=t.split(O7e);return n.length===2&&kF(n[0])&&R7e(n[1])||e&&n.length===1&&kF(n[0])}yv.default=DF;function kF(t){let e=N7e.exec(t);if(!e)return!1;let n=+e[1],l=+e[2],r=+e[3];return l>=1&&l<=12&&r>=1&&(r<=I7e[l]||l===2&&r===29&&(n%100===0?n%400===0:n%4===0))}function R7e(t){let e=C7e.exec(t);if(!e)return!1;let n=+e[1],l=+e[2],r=+e[3],i=+(e[4]||0),s=+(e[5]||0);return n<=23&&l<=59&&r<=59||n-i===23&&l-s===59&&r===60}DF.code='require("ajv/dist/runtime/timestamp").default'});var T0=k(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.typeErrorParams=ks.typeErrorMessage=ks.typeError=void 0;var k7e=st();function D7e(t){return{message:e=>PF(e,t),params:e=>LF(e,t)}}ks.typeError=D7e;function PF({parentSchema:t},e){return t?.nullable?`must be ${e} or null`:`must be ${e}`}ks.typeErrorMessage=PF;function LF({parentSchema:t},e){return(0,k7e._)`{type: ${e}, nullab
`,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},Kpe=97,Xpe=48;function Ls(t,e){let n="",l;for(Ls.message=void 0;l=t[e++],l!=='"';)if(l==="\\")if(l=t[e],l in cj)n+=cj[l],e++;else if(l==="u"){e++;let i=4,s=0;for(;i--;){if(s<<=4,l=t[e],l===void 0){r("unexpected end");return}if(l=l.toLowerCase(),l>="a"&&l<="f")s+=l.charCodeAt(0)-Kpe+10;else if(l>="0"&&l<="9")s+=l.charCodeAt(0)-Xpe;else{r(`unexpected token ${l}`);return}e++}n+=String.fromCharCode(s)}else{r(`unexpected token ${l}`);return}else if(l===void 0){r("unexpected end");return}else if(l.charCodeAt(0)>=32)n+=l;else{r(`unexpected token ${l}`);return}return Ls.position=e,n;function r(i){Ls.position=e,Ls.message=i}}Fs.parseJsonString=Ls;Ls.message=void 0;Ls.position=0;Ls.code='require("ajv/dist/runtime/parseJson").parseJsonString'});var wj=k(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var Wpe=Cv(),mj=Au(),tt=st(),Ype=Os(),Ht=X3(),Qpe=S2(),Zpe=Hc(),efe=vv(),Fv=pj(),yj=Nt(),tfe=gv(),nfe={elements:sfe,values:afe,discriminator:ofe,properties:fj,optionalProperties:fj,enum:pfe,type:cfe,ref:ffe};function gj(t,e){let n=mj.getCompilingSchema.call(this,t);if(n)return n;let{es5:l,lines:r}=this.opts.code,{ownProperties:i}=this.opts,s=new tt.CodeGen(this.scope,{es5:l,lines:r,ownProperties:i}),a=s.scopeName("parse"),u={self:this,gen:s,schema:t.schema,schemaEnv:t,definitions:e,data:Ht.default.data,parseName:a,char:s.name("c")},o;try{this._compilations.add(t),t.parseName=a,lfe(u),s.optimize(this.opts.code.optimize);let c=s.toString();o=`${s.scopeRefs(Ht.default.scope)}return ${c}`;let m=new Function(`${Ht.default.scope}`,o)(this.scope.get());this.scope.value(a,{ref:m}),t.parse=m}catch(c){throw o&&this.logger.error("Error compiling parser, function code:",o),delete t.parse,delete t.parseName,c}finally{this._compilations.delete(t)}return t}Bv.default=gj;var Lv=(0,tt._)`undefined`;function lfe(t){let{gen:e,parseName:n,char:l}=t;e.func(n,(0,tt._)`${Ht.default.json}, ${Ht.default.jsonPos}, ${Ht.default.jsonPart}`,!1,()=>{e.let(Ht.default.data),e.let(l),e.assign((0,tt._)`${n}.message`,Lv),e.assign((0,tt._)`${n}.position`,Lv),e.assign(Ht.default.jsonPos,(0,tt._)`${Ht.default.jsonPos} || 0`),e.const(Ht.default.jsonLen,(0,tt._)`${Ht.default.json}.length`),Jc(t),$v(t),e.if(Ht.default.jsonPart,()=>{e.assign((0,tt._)`${n}.position`,Ht.default.jsonPos),e.return(Ht.default.data)}),e.if((0,tt._)`${Ht.default.jsonPos} === ${Ht.default.jsonLen}`,()=>e.return(Ht.default.data)),C0(t)})}function Jc(t){let e;for(let n of Wpe.jtdForms)if(n in t.schema){e=n;break}e?ife(t,nfe[e]):Uv(t)}var rfe=hj(!0,hj(!1,C0));function ife(t,e){let{gen:n,schema:l,data:r}=t;if(!l.nullable)return e(t);h5(t,"null",e,()=>n.assign(r,null))}function sfe(t){let{gen:e,schema:n,data:l}=t;ni(t,"[");let r=e.let("i",0);e.assign(l,(0,tt._)`[]`),jv(t,"]",()=>{let i=e.let("el");Jc({...t,schema:n.elements,data:i}),e.assign((0,tt._)`${l}[${r}++]`,i)})}function afe(t){let{gen:e,schema:n,data:l}=t;ni(t,"{"),e.assign(l,(0,tt._)`{}`),jv(t,"}",()=>ufe(t,n.values))}function jv(t,e,n){vj(t,e,n),ni(t,e)}function vj(t,e,n){let{gen:l}=t;l.for((0,tt._)`;${Ht.default.jsonPos}<${Ht.default.jsonLen} && ${Kc(1)}!==${e};`,()=>{n(),h5(t,",",()=>l.break(),r)});function r(){h5(t,e,()=>{},C0)}}function ufe(t,e){let{gen:n}=t,l=n.let("key");Uu({...t,data:l}),ni(t,":"),Ej(t,l,e)}function ofe(t){let{gen:e,data:n,schema:l}=t,{discriminator:r,mapping:i}=l;ni(t,"{"),e.assign(n,(0,tt._)`{}`);let s=e.const("pos",Ht.default.jsonPos),a=e.let("value"),u=e.let("tag");vj(t,"}",()=>{let o=e.let("key");Uu({...t,data:o}),ni(t,":"),e.if((0,tt._)`${o} === ${r}`,()=>{Uu({...t,data:u}),e.assign((0,tt._)`${n}[${o}]`,u),e.break()},()=>Uv({...t,data:a}))}),e.assign(Ht.default.jsonPos,s),e.if((0,tt._)`${u} === undefined`),Qi(t,(0,tt.str)`discriminator tag not found`);for(let o in i)e.elseIf((0,tt._)`${u} === ${o}`),_j({...t,schema:i[o]},r);e.else(),Qi(t,(0,tt.str)`discriminator value not in schema`),e.endIf()}function fj(t){let{gen:e,data:n}=t;ni(t,"{"),e.assign(n,(0,tt._)`{}`),_j(t)}function _j(t,e){let{gen:n,schema:l,data:r}=t,{properties:i,optionalProperties:s,additio
`).slice(0,2).map(e=>e.trim()).join(" -- ")}function $j(t){return t[Symbol.for("fastify.display-name")]}function Bj(t){return!!t[Symbol.for("skip-override")]}function Hj(t){let e=g5(t);if(!e)return;let n=e.dependencies;n&&(Qv(Array.isArray(n),"The dependencies should be an array of strings"),n.forEach(l=>{Qv(this[Zv].indexOf(l)>-1,`The dependency '${l}' of plugin '${e.name}' is not registered`)}))}function Vj(t){let e=g5(t);if(!e)return;let{decorators:n,name:l}=e;n&&(n.fastify&&Yv(this,"Fastify",n.fastify,l),n.reply&&Yv(this,"Reply",n.reply,l),n.request&&Yv(this,"Request",n.request,l))}var Vfe={Fastify:Ffe,Request:Ufe,Reply:jfe};function Yv(t,e,n,l){Qv(Array.isArray(n),"The decorators should be an array of strings"),n.forEach(r=>{let i=typeof l=="string"?` required by '${l}'`:"";if(!Vfe[e].call(t,r))throw new $fe(r,i,e)})}function qfe(t){let e=g5(t);if(!e)return;let n=e.fastify,l=/-rc.+$/.test(this.version);if(!(l===!0&&Wv.gt(this.version,Wv.coerce(n))===!0)&&n&&Wv.satisfies(this.version,n,{includePrerelease:l})===!1)throw new Mfe(e.name,n,this.version)}function zfe(t){let e=g5(t);if(!e)return;let n=e.name;if(n)return this[Zv].push(n),n}function Gfe(t,e){t.constructor.name==="AsyncFunction"&&t.length===3&&Bfe(e||"anonymous")}function Jfe(t){let e=zfe.call(this,t)||Mj(t);return Gfe.call(this,t,e),qfe.call(this,t),Vj.call(this,t),Hj.call(this,t),Bj(t)}e_.exports={getPluginName:Mj,getFuncPreview:Hfe,kRegisteredPlugins:Zv,getDisplayName:$j,registerPlugin:Jfe};e_.exports[Lfe]={shouldSkipOverride:Bj,getMeta:g5,checkDecorators:Vj,checkDependencies:Hj}});var Wc=k((nke,qj)=>{"use strict";function Kfe(t,e){let n=e||Wfe();return t?Yfe(t,n):n}function Xfe(t,e){return t.genReqId(e)}function Wfe(){let e=0;return function(){return e=e+1&2147483647,`req-${e.toString(36)}`}}function Yfe(t,e){return function(n){return n.headers[t]||e(n)}}qj.exports={getGenReqId:Xfe,reqIdGenFactory:Kfe}});var Kj=k((lke,Jj)=>{"use strict";var zj=12,Qfe=0,n_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function Zfe(t){var e=t.indexOf("%");if(e===-1)return t;for(var n=t.length,l="",r=0,i=0,s=e,a=zj;e>-1&&e<n;){var u=Gj(t[e+1],4),o=Gj(t[e+2],0),c=u|o,f=n_[c];if(a=n_[256+a+f],i=i<<6|c&n_[364+f],a===zj)l+=t.slice(r,s),l+=i<=65535?String.fromCharCode(i):String.fromCharCode(55232+(i>>10),56320+(i&1023)),i=0,r=e+3,e=s=t.indexOf("%",r);else{if(a===Qfe)return null;if(e+=3,e<n&&t.charCodeAt(e)===37)continue;return null}}return l+t.slice(r)}var ede={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function Gj(t,e){var n=ede[t];return n===void 0?255:n<<e}Jj.exports=Zfe});var Zj=k((rke,Qj)=>{"use strict";var Xj=Kj(),Wj=/\+/g,Yj=function(){};Yj.prototype=Object.create(null);function tde(t){let e=new Yj;if(typeof t!="string")return e;let n=t.length,l="",r="",i=-1,s=-1,a=!1,u=!1,o=!1,c=!1,f=!1,m=0;for(let d=0;d<n+1;d++)if(m=d!==n?t.charCodeAt(d):38,m===38){if(f=s>i,f||(s=d),l=t.slice(i+1,s),f||l.length>0){o&&(l=l.replace(Wj," ")),a&&(l=Xj(l)||l),f&&(r=t.slice(s+1,d),c&&(r=r.replace(Wj," ")),u&&(r=Xj(r)||r));let y=e[l];y===void 0?e[l]=r:y.pop?y.push(r):e[l]=[y,r]}r="",i=d,s=d,a=!1,u=!1,o=!1,c=!1}else m===61?s<=i?s=d:u=!0:m===43?s>i?c=!0:o=!0:m===37&&(s>i?u=!0:a=!0);return e}Qj.exports=tde});var tU=k((ike,eU)=>{var li=Array.from({length:256},(t,e)=>"%"+((e<16?"0":"")+e.toString(16)).toUpperCase(
2024-04-02 15:03:09 +08:00
`).join(`
2024-05-07 17:30:00 +08:00
`+e+o);n+=e+u+i+f+`
2024-05-29 18:58:23 +08:00
`,n+=SU(s,e+o)}return n}function cde(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function TU(t){return Array.isArray(t)?t.map(e=>TU(e)):typeof t=="symbol"?t.toString():typeof t=="function"?cde(t):t}function pde(t,e){if(!e.includeMeta)return{};let n=e.buildPrettyMeta(t),l={},r=e.includeMeta;Array.isArray(r)||(r=Reflect.ownKeys(n));for(let i of r){if(!Object.prototype.hasOwnProperty.call(n,i))continue;let s=i.toString(),a=n[i];if(a!=null){let u=JSON.stringify(TU(a));l[s]=u}}return l}function fde(t){let e="";for(let[n,l]of Object.entries(t))e+=`
\u2022 (${n}) ${l}`;return e}function dde(t){let e={...t.opts.constraints},n=e[bU.name];return delete e[bU.name],{...t,method:n,opts:{constraints:e}}}function hde(t){let e=` (${t.method})`,n=t.opts.constraints||{};return Object.keys(n).length!==0&&(e+=" "+JSON.stringify(n)),e+=fde(t.metaData),e}function mde(t){return t.reduce((e,n)=>{for(let l of e)if(EU(n.opts.constraints,l.opts.constraints)&&EU(n.metaData,l.metaData))return l.method+=", "+n.method,e;return e.push(n),e},[])}function yde(t,e,n){let l=t.routes;return n.method===void 0&&(l=l.map(dde)),l=l.map(r=>(r.metaData=pde(r,n),r)),n.method===void 0&&(l=mde(l)),l.map(hde).join(`
${e}`)}function e7(t,e,n,l){if((t.isLeafNode||l.commonPrefix!==!1)&&(n=n||"(empty root node)",e=e[n]={},t.isLeafNode&&(e[wU]=yde(t,n,l)),n=""),t.staticChildren)for(let r of Object.values(t.staticChildren))e7(r,e,n+r.prefix,l);if(t.parametricChildren)for(let r of Object.values(t.parametricChildren)){let i=Array.from(r.nodePaths).join("|");e7(r,e,n+i,l)}t.wildcardChild&&e7(t.wildcardChild,e,"*",l)}function gde(t,e){let n={};return e7(t,n,t.prefix,e),SU(n)}xU.exports={prettyPrintTree:gde}});var NU=k((yke,OU)=>{"use strict";var vde=Zc(),a_=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 l=n.params,r=n.opts.constraints||{},i={params:l,constraints:r,handler:n.handler,store:n.store||null,_createParamsObject:this._compileCreateParamsObject(l)},s=Object.keys(r);s.length===0&&(this.unconstrainedHandler=i);for(let u of s)this.constraints.includes(u)||(u==="version"?this.constraints.unshift(u):this.constraints.push(u));let a=s.includes(vde.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(i),this.handlers.sort((u,o)=>Object.keys(u.constraints).length-Object.keys(o.constraints).length),a||this._compileGetHandlerMatchingConstraints(e,r)}_compileCreateParamsObject(e){let n=[];for(let l=0;l<e.length;l++)n.push(`'${e[l]}': paramsArray[${l}]`);return new Function("paramsArray",`return {${n.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,n){for(let l=0;l<this.handlers.length;l++){let i=this.handlers[l].constraints[n];if(i!==void 0){let s=e.get(i)||0;s|=1<<l,e.set(i,s)}}}_constrainedIndexBitmask(e){let n=0;for(let l=0;l<this.handlers.length;l++)this.handlers[l].constraints[e]!==void 0&&(n|=1<<l);return~n}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let l of this.constraints){let r=e.newStoreForConstraint(l);this.constrainedHandlerStores[l]=r,this._buildConstraintStore(r,l)}let n=[];n.push(`
2024-05-06 10:35:10 +08:00
let candidates = ${(1<<this.handlers.length)-1}
2024-04-02 15:03:09 +08:00
let mask, matches
2024-05-07 17:30:00 +08:00
`);for(let l of this.constraints){n.push(`
mask = ${this._constrainedIndexBitmask(l)}
value = derivedConstraints.${l}
`);let i=e.strategies[l].mustMatchWhenDerived?"matches":"(matches | mask)";n.push(`
2024-04-02 15:03:09 +08:00
if (value === undefined) {
candidates &= mask
} else {
2024-05-07 17:30:00 +08:00
matches = this.constrainedHandlerStores.${l}.get(value) || 0
candidates &= ${i}
2024-04-02 15:03:09 +08:00
}
if (candidates === 0) return null;
2024-05-07 17:30:00 +08:00
`)}for(let l in e.strategies)e.strategies[l].mustMatchWhenDerived&&!this.constraints.includes(l)&&n.push(`if (derivedConstraints.${l} !== undefined) return null`);n.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",n.join(`
2024-05-29 18:58:23 +08:00
`))}};OU.exports=a_});var IU=k((gke,CU)=>{"use strict";var _de=NU(),s7={STATIC:0,PARAMETRIC:1,WILDCARD:2},t7=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 _de),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(n,e)}},n7=class extends t7{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,n){let l=this.staticChildren[e.charAt(n)];return l===void 0||!l.matchPrefix(e,n)?null:l}getStaticChild(e,n=0){if(e.length===n)return this;let l=this.findStaticMatchingChild(e,n);return l?l.getStaticChild(e,n+l.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let n=this.staticChildren[e.charAt(0)];if(n){let r=1;for(;r<n.prefix.length;r++)if(e.charCodeAt(r)!==n.prefix.charCodeAt(r)){n=n.split(this,r);break}return n.createStaticChild(e.slice(r))}let l=e.charAt(0);return this.staticChildren[l]=new l7(e),this.staticChildren[l]}},l7=class t extends n7{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=s7.STATIC,this._compilePrefixMatch()}getParametricChild(e){let n=e&&e.source,l=this.parametricChildren.find(r=>(r.regex&&r.regex.source)===n);return l||null}createParametricChild(e,n,l){let r=this.getParametricChild(e);return r?(r.nodePaths.add(l),r):(r=new r7(e,n,l),this.parametricChildren.push(r),this.parametricChildren.sort((i,s)=>i.isRegex?s.isRegex?i.staticSuffix===null?1:s.staticSuffix===null?-1:s.staticSuffix.endsWith(i.staticSuffix)?1:i.staticSuffix.endsWith(s.staticSuffix)?-1:0:-1:1),r)}getWildcardChild(){return this.wildcardChild?this.wildcardChild:null}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new i7,this.wildcardChild}split(e,n){let l=this.prefix.slice(0,n),r=this.prefix.slice(n);this.prefix=r,this._compilePrefixMatch();let i=new t(l);return i.staticChildren[r.charAt(0)]=this,e.staticChildren[l.charAt(0)]=i,i}getNextNode(e,n,l,r){let i=this.findStaticMatchingChild(e,n),s=0;if(i===null){if(this.parametricChildren.length===0)return this.wildcardChild;i=this.parametricChildren[0],s=1}this.wildcardChild!==null&&l.push({paramsCount:r,brotherPathIndex:n,brotherNode:this.wildcardChild});for(let a=this.parametricChildren.length-1;a>=s;a--)l.push({paramsCount:r,brotherPathIndex:n,brotherNode:this.parametricChildren[a]});return i}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let n=1;n<this.prefix.length;n++){let l=this.prefix.charCodeAt(n);e.push(`path.charCodeAt(i + ${n}) === ${l}`)}this.matchPrefix=new Function("path","i",`return ${e.join(" && ")}`)}},r7=class extends n7{constructor(e,n,l){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=n||null,this.kind=s7.PARAMETRIC,this.nodePaths=new Set([l])}getNextNode(e,n){return this.findStaticMatchingChild(e,n)}},i7=class extends t7{constructor(){super(),this.kind=s7.WILDCARD}getNextNode(){return null}};CU.exports={StaticNode:l7,ParametricNode:r7,WildcardNode:i7,NODE_TYPES:s7}});var kU=k((vke,RU)=>{"use strict";var Ede=require("assert");function w5(){if(!(this instanceof w5))return new w5;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}w5.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[n,l,r]=t.split(".");return n=Number(n)||0,l=Number(l)||0,r=Number(r)||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),l>=(this.maxMinors[n]||0)&&(this.maxMinors[n]=l,this.store[`${n}.x`]=e,this.store[`${n}.x.x`]=e),r>=(this.store[`${n}.${l}`]||0)&&(this.maxPatches[`${n}.${l}`]=r,this.store[`${n}.${l}.x`]=e),this.store[`${n}.${l}.${r}`]=e,this};w5.prototype.get=function(t){return this.store[t]};RU.exports={name:"version",mustMatchWhenDerived:!0,storage:w5,validate(t){Ede(typeof t=="string","Version should be a string")}}});var PU=k((_ke,DU)=>{"use strict";var bde=require("assert");function wde(){let t={},e=[];return{get:n=>{let l=t[n];if(l)return l;for
2024-09-23 11:52:18 +08:00
`)).bind(this)}};LU.exports=o_});var UU=k((bke,jU)=>{"use strict";var xde=["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"];jU.exports=xde});var BU=k((wke,$U)=>{"use strict";function MU(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 Ade(t,e){let n=!1,l=!1,r="";for(let s=1;s<t.length;s++){let a=t.charCodeAt(s);if(a===37){let u=t.charCodeAt(s+1),o=t.charCodeAt(s+2);MU(u,o)===null?n=!0:(l=!0,u===50&&o===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){r=t.slice(s+1),t=t.slice(0,s);break}}return{path:n?decodeURI(t):t,querystring:r,shouldDecodeParam:l}}function Ode(t){let e=t.indexOf("%");if(e===-1)return t;let n="",l=e;for(let r=e;r<t.length;r++)if(t.charCodeAt(r)===37){let i=t.charCodeAt(r+1),s=t.charCodeAt(r+2),a=MU(i,s);n+=t.slice(l,r)+a,l=r+3}return t.slice(0,e)+n+t.slice(l)}$U.exports={safeDecodeURI:Ade,safeDecodeURIComponent:Ode}});var m_=k((Ske,KU)=>{"use strict";var Ul=require("assert"),Nde=uU(),a7=vU(),f_=l0(),{prettyPrintTree:Cde}=AU(),{StaticNode:HU,NODE_TYPES:c_}=IU(),Ide=FU(),L0=UU(),p_=Zc(),{safeDecodeURI:Rde,safeDecodeURIComponent:VU}=BU(),qU=/^https?:\/\/.*?\//,$u=/(\/:[^/()]*?)\?(\/?)/;if(!a7(qU))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!a7($u))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function vl(t){if(!(this instanceof vl))return new vl(t);t=t||{},this._opts=t,t.defaultRoute?(Ul(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(Ul(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(Ul(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=kde,t.querystringParser?(Ul(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:Nde.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 Ide(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}vl.prototype.on=function(e,n,l,r,i){typeof l=="function"&&(r!==void 0&&(i=r),r=l,l={}),Ul(typeof n=="string","Path should be a string"),Ul(n.length>0,"The path could not be empty"),Ul(n[0]==="/"||n[0]==="*","The first character of a path should be `/` or `*`"),Ul(typeof r=="function","Handler should be a function");let s=n.match($u);if(s){Ul(n.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let o=n.replace($u,"$1$2"),c=n.replace($u,"$2");this.on(e,o,l,r,i),this.on(e,c,l,r,i);return}let a=n;this.ignoreDuplicateSlashes&&(n=d_(n)),this.ignoreTrailingSlash&&(n=h_(n));let u=Array.isArray(e)?e:[e];for(let o of u)Ul(typeof o=="string","Method should be a string"),Ul(L0.includes(o),`Method '${o}' is not an http method.`),this._on(o,n,l,r,i,a)};vl.prototype._on=function(e,n,l,r,i){let s={};l.constraints!==void 0&&(Ul(typeof l.constraints=="object"&&l.constraints!==null,"Constraints should be an object"),Object.keys(l.constraints).length!==0&&(s=l.constraints)),this.constrainer.validateConstraints(s),this.constrainer.noteUsage(s),this.trees[e]===void 0&&(this.trees[e]=new HU("/"));let a=n;if(a==="*"&&this.trees[e].prefix.length!==0){let m=this.trees[e]
2024-05-13 09:18:33 +08:00
Content-Length: ${Se.length}\r
2024-04-02 15:03:09 +08:00
Content-Type: application/json\r
\r
2024-05-29 18:58:23 +08:00
${Se}`),ve.destroy(re)}function me(re,ve){re.headers["accept-version"]!==void 0&&(re.headers[vme]=re.headers["accept-version"],re.headers["accept-version"]=void 0),d.router.lookup(re,ve)}function P(re,ve,Se){if(a){let dt=s$(F.server,ve),Pe=r$(F,u,ve,dt),Lt=new v7(dt,null,ve,null,Pe,F),bl=new D5(Se,Lt,Pe);return i===!1&&Pe.info({req:Lt},"incoming request"),a(new Ume(re),Lt,bl)}let Ke=`{"error":"Bad Request","code":"FST_ERR_BAD_URL","message":"'${re}' is not a valid url component","statusCode":400}`;Se.writeHead(400,{"Content-Type":"application/json","Content-Length":Ke.length}),Se.end(Ke)}function G(re,ve,Se){if(re!==!1)return function(dt){if(dt){if(a){let Lt=s$(F.server,ve),bl=r$(F,u,ve,Lt),Ft=new v7(Lt,null,ve,null,bl,F),tn=new D5(Se,Ft,bl);return i===!1&&bl.info({req:Ft},"incoming request"),a(new jme,Ft,tn)}let Pe='{"error":"Internal Server Error","message":"Unexpected error from async constraint","statusCode":500}';Se.writeHead(500,{"Content-Type":"application/json","Content-Length":Pe.length}),Se.end(Pe)}}}function V(re,ve){return te('Cannot call "setNotFoundHandler"!'),d.setNotFoundHandler.call(this,re,ve,U,m.routeHandler),this}function q(re){return te('Cannot call "setValidatorCompiler"!'),this[$s].setValidatorCompiler(re),this}function Yn(re){return te('Cannot call "setSchemaErrorFormatter"!'),p$(re),this[M_]=re.bind(this),this}function Tt(re){return te('Cannot call "setSerializerCompiler"!'),this[$s].setSerializerCompiler(re),this}function Ye(re){te('Cannot call "setSchemaController"!');let ve=this[$s],Se=n$.buildSchemaController(ve,Object.assign({},ve.opts,re));return this[$s]=Se,this.getSchema=Se.getSchema.bind(Se),this.getSchemas=Se.getSchemas.bind(Se),this}function ft(re){return te('Cannot call "setReplySerializer"!'),this[t$]=re,this}function qe(re){return te('Cannot call "setErrorHandler"!'),this[g7]=c$(this[g7],re.bind(this)),this}function Ue(re){return te('Cannot call "setChildLoggerFactory"!'),this[B_]=re,this}function $t(re={}){return re.includeMeta=re.includeHooks?re.includeMeta?V_.concat(re.includeMeta):V_:re.includeMeta,m.printRoutes(re)}function vt(re,{rewriteUrl:ve,logger:Se}){let Ke;return function(Pe,Lt){if(Ke===void 0&&(Ke=re.isAsyncConstraint()),ve){Pe.originalUrl=Pe.url;let bl=ve.call(N,Pe);if(typeof bl=="string")Pe.url=bl;else{let Ft=new Kme(Pe.url,typeof bl);Pe.destroy(Ft)}}re.routing(Pe,Lt,G(Ke,Pe,Lt))}}function Et(re){return te('Cannot call "setGenReqId"!'),this[H_]=a$(this[U_].requestIdHeader,re),this}}_7.errorCodes=Hu;function p$(t){if(typeof t!="function")throw new o$(typeof t);if(t.constructor.name==="AsyncFunction")throw new o$("AsyncFunction")}E7.exports=_7;E7.exports.fastify=_7;E7.exports.default=_7});var Jq=k((MPe,Gq)=>{"use strict";Gq.exports=Error});var Xq=k(($Pe,Kq)=>{"use strict";Kq.exports=EvalError});var Yq=k((BPe,Wq)=>{"use strict";Wq.exports=RangeError});var Zq=k((HPe,Qq)=>{"use strict";Qq.exports=ReferenceError});var Pb=k((VPe,ez)=>{"use strict";ez.exports=SyntaxError});var b4=k((qPe,tz)=>{"use strict";tz.exports=TypeError});var lz=k((zPe,nz)=>{"use strict";nz.exports=URIError});var iz=k((GPe,rz)=>{"use strict";rz.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),l=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var r=42;e[n]=r;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==r||s.enumerable!==!0)return!1}return!0}});var uz=k((JPe,az)=>{"use strict";var sz=typeof Symbol<"u"&&Symbol,JEe=iz();az.exports=function(){return typeof sz!="function"||typeof Symbol!="function"||typeof sz("foo")!="sy
`)>=0)return!1;return!0}function lwe(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=mi.call(Array(t.indent+1)," ");else return null;return{base:n,prev:mi.call(Array(e+1),n)}}function Xb(t,e){if(t.length===0)return"";var n=`
2024-05-23 19:28:35 +08:00
`+e.prev+e.base;return n+mi.call(t,","+n)+`
2024-09-23 11:52:18 +08:00
`+e.prev}function rf(t,e){var n=Kb(t),l=[];if(n){l.length=t.length;for(var r=0;r<t.length;r++)l[r]=na(t,r)?e(t[r],t):""}var i=typeof Vb=="function"?Vb(t):[],s;if(O4){s={};for(var a=0;a<i.length;a++)s["$"+i[a]]=i[a]}for(var u in t)na(t,u)&&(n&&String(Number(u))===u&&u<t.length||O4&&s["$"+u]instanceof Symbol||(sG.call(/[^\w$]/,u)?l.push(e(u,t)+": "+e(t[u],t)):l.push(u+": "+e(t[u],t))));if(typeof Vb=="function")for(var o=0;o<i.length;o++)aG.call(t,i[o])&&l.push("["+e(i[o])+"]: "+e(t[i[o]],t));return l}});var yG=k((uLe,mG)=>{"use strict";var hG=po(),N4=zz(),rwe=dG(),iwe=b4(),uf=hG("%WeakMap%",!0),of=hG("%Map%",!0),swe=N4("WeakMap.prototype.get",!0),awe=N4("WeakMap.prototype.set",!0),uwe=N4("WeakMap.prototype.has",!0),owe=N4("Map.prototype.get",!0),cwe=N4("Map.prototype.set",!0),pwe=N4("Map.prototype.has",!0),Zb=function(t,e){for(var n=t,l;(l=n.next)!==null;n=l)if(l.key===e)return n.next=l.next,l.next=t.next,t.next=l,l},fwe=function(t,e){var n=Zb(t,e);return n&&n.value},dwe=function(t,e,n){var l=Zb(t,e);l?l.value=n:t.next={key:e,next:t.next,value:n}},hwe=function(t,e){return!!Zb(t,e)};mG.exports=function(){var e,n,l,r={assert:function(i){if(!r.has(i))throw new iwe("Side channel does not contain "+rwe(i))},get:function(i){if(uf&&i&&(typeof i=="object"||typeof i=="function")){if(e)return swe(e,i)}else if(of){if(n)return owe(n,i)}else if(l)return fwe(l,i)},has:function(i){if(uf&&i&&(typeof i=="object"||typeof i=="function")){if(e)return uwe(e,i)}else if(of){if(n)return pwe(n,i)}else if(l)return hwe(l,i);return!1},set:function(i,s){uf&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new uf),awe(e,i,s)):of?(n||(n=new of),cwe(n,i,s)):(l||(l={key:{},next:null}),dwe(l,i,s))}};return r}});var cf=k((oLe,gG)=>{"use strict";var mwe=String.prototype.replace,ywe=/%20/g,ew={RFC1738:"RFC1738",RFC3986:"RFC3986"};gG.exports={default:ew.RFC3986,formatters:{RFC1738:function(t){return mwe.call(t,ywe,"+")},RFC3986:function(t){return String(t)}},RFC1738:ew.RFC1738,RFC3986:ew.RFC3986}});var lw=k((cLe,_G)=>{"use strict";var gwe=cf(),tw=Object.prototype.hasOwnProperty,fo=Array.isArray,yi=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),vwe=function(e){for(;e.length>1;){var n=e.pop(),l=n.obj[n.prop];if(fo(l)){for(var r=[],i=0;i<l.length;++i)typeof l[i]<"u"&&r.push(l[i]);n.obj[n.prop]=r}}},vG=function(e,n){for(var l=n&&n.plainObjects?Object.create(null):{},r=0;r<e.length;++r)typeof e[r]<"u"&&(l[r]=e[r]);return l},_we=function t(e,n,l){if(!n)return e;if(typeof n!="object"){if(fo(e))e.push(n);else if(e&&typeof e=="object")(l&&(l.plainObjects||l.allowPrototypes)||!tw.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var r=e;return fo(e)&&!fo(n)&&(r=vG(e,l)),fo(e)&&fo(n)?(n.forEach(function(i,s){if(tw.call(e,s)){var a=e[s];a&&typeof a=="object"&&i&&typeof i=="object"?e[s]=t(a,i,l):e.push(i)}else e[s]=i}),e):Object.keys(n).reduce(function(i,s){var a=n[s];return tw.call(i,s)?i[s]=t(i[s],a,l):i[s]=a,i},r)},Ewe=function(e,n){return Object.keys(n).reduce(function(l,r){return l[r]=n[r],l},e)},bwe=function(t,e,n){var l=t.replace(/\+/g," ");if(n==="iso-8859-1")return l.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(l)}catch{return l}},nw=1024,wwe=function(e,n,l,r,i){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),l==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var a="",u=0;u<s.length;u+=nw){for(var o=s.length>=nw?s.slice(u,u+nw):s,c=[],f=0;f<o.length;++f){var m=o.charCodeAt(f);if(m===45||m===46||m===95||m===126||m>=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||i===gwe.RFC1738&&(m===40||m===41)){c[c.length]=o.charAt(f);continue}if(m<128){c[c.length]=yi[m];continue}if(m<2048){c[c.length]=yi[192|m>>6]+yi[128|m&63];continue}if(m<55296||m>=57344){c[c.length]=yi[224|m>>12]+yi[128|m>>6&63]+yi[128|m&63];continue}f+=1,m=65536+((m&1023)<<10|o.charCodeAt(f)&1023),c[c.length]=yi[240|m>>18]+yi[12
2024-05-29 18:58:23 +08:00
`;an.DEFAULT_CONTENT_TYPE="application/octet-stream";an.prototype.append=function(t,e,n){n=n||{},typeof n=="string"&&(n={filename:n});var l=vw.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),EJ.isArray(e)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(t,e,n),i=this._multiPartFooter();l(r),l(e),l(i),this._trackLength(r,e,n)};an.prototype._trackLength=function(t,e,n){var l=0;n.knownLength!=null?l+=+n.knownLength:Buffer.isBuffer(e)?l=e.length:typeof e=="string"&&(l=Buffer.byteLength(e)),this._valueLength+=l,this._overheadLength+=Buffer.byteLength(t)+an.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof iTe))&&(n.knownLength||this._valuesToMeasure.push(e))};an.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)):rTe.stat(t.path,function(n,l){var r;if(n){e(n);return}r=l.size-(t.start?t.start:0),e(null,r)}):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")};an.prototype._multiPartHeader=function(t,e,n){if(typeof n.header=="string")return n.header;var l=this._getContentDisposition(e,n),r=this._getContentType(e,n),i="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(l||[]),"Content-Type":[].concat(r||[])};typeof n.header=="object"&&gw(s,n.header);var a;for(var u in s)s.hasOwnProperty(u)&&(a=s[u],a!=null&&(Array.isArray(a)||(a=[a]),a.length&&(i+=u+": "+a.join("; ")+an.LINE_BREAK)));return"--"+this.getBoundary()+an.LINE_BREAK+i+an.LINE_BREAK};an.prototype._getContentDisposition=function(t,e){var n,l;return typeof e.filepath=="string"?n=mw.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t.name||t.path?n=mw.basename(e.filename||t.name||t.path):t.readable&&t.hasOwnProperty("httpVersion")&&(n=mw.basename(t.client._httpMessage.path||"")),n&&(l='filename="'+n+'"'),l};an.prototype._getContentType=function(t,e){var n=e.contentType;return!n&&t.name&&(n=yw.lookup(t.name)),!n&&t.path&&(n=yw.lookup(t.path)),!n&&t.readable&&t.hasOwnProperty("httpVersion")&&(n=t.headers["content-type"]),!n&&(e.filepath||e.filename)&&(n=yw.lookup(e.filepath||e.filename)),!n&&typeof t=="object"&&(n=an.DEFAULT_CONTENT_TYPE),n};an.prototype._multiPartFooter=function(){return function(t){var e=an.LINE_BREAK,n=this._streams.length===0;n&&(e+=this._lastBoundary()),t(e)}.bind(this)};an.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+an.LINE_BREAK};an.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};an.prototype.setBoundary=function(t){this._boundary=t};an.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};an.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),n=0,l=this._streams.length;n<l;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(an.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};an.prototype._generateBoundary=function(){for(var t="--------------------------",e=0;e<24;e++)t+=Math.floor(Math.random()*10).toString(16);this._boundary=t};an.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};an.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};an.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),l.removeSocket(r)}};us.prototype.removeSocket=function(e){var n=this.sockets.indexOf(e);if(n!==-1){this.sockets.splice(n,1);var l=this.requests.shift();l&&this.createSocket(l,function(r){l.request.onSocket(r)})}};function xK(t,e){var n=this;us.prototype.createSocket.call(n,t,function(l){var r=t.request.getHeader("host"),i=Zw({},n.options,{socket:l,servername:r?r.replace(/:.*$/,""):t.host}),s=rxe.connect(0,i);n.sockets[n.sockets.indexOf(l)]=s,e(s)})}function AK(t,e,n){return typeof t=="string"?{host:t,port:e,localAddress:n}:t}function Zw(t){for(var e=1,n=arguments.length;e<n;++e){var l=arguments[e];if(typeof l=="object")for(var r=Object.keys(l),i=0,s=r.length;i<s;++i){var a=r[i];l[a]!==void 0&&(t[a]=l[a])}}return t}var oa;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?oa=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)}:oa=function(){};U4.debug=oa});var CK=k((lMe,NK)=>{NK.exports=OK()});var OZ=k(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.removeTrailingChar=Eo.merge=void 0;var TOe=(...t)=>{let e={};return t.forEach(function(n){var l;for(l in n)l in e&&e[l]===null?e[l]=n[l]:l in e&&Array.isArray(e[l])?e[l]=e[l].concat(n[l]):l in e&&typeof e[l]=="object"?e[l]=(0,Eo.merge)(e[l],n[l]):e[l]=n[l]}),e};Eo.merge=TOe;var xOe=(t,e)=>t.length>1&&t.endsWith(e)?t.substring(0,t.length-1):t;Eo.removeTrailingChar=xOe});var M4=k(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.DataError=Wa.DatabaseError=Wa.NestedError=void 0;var Y6=class extends Error{inner;id;constructor(e,n,l){super(e),this.inner=l,this.id=n,this.name=this.constructor.name}toString(){let e=this.name+": "+this.message;return this.inner?e+`:
`+this.inner:e}};Wa.NestedError=Y6;var wT=class extends Y6{};Wa.DatabaseError=wT;var ST=class extends Y6{};Wa.DataError=ST});var NT=k(s3=>{"use strict";Object.defineProperty(s3,"__esModule",{value:!0});s3.getArrayIndicies=s3.validateArrayIndex=s3.validateArrayIndicies=s3.isInt=s3.ArrayInfo=s3.arrayRegex=void 0;var Rf=M4(),AOe=()=>/^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;s3.arrayRegex=AOe;var TT={},xT=class t{property;index=0;append=!1;indicies=[];constructor(e,n){this.property=e;let l=n[0]??0;if(this.append=l===""||n[n.length-1]==="",this.indicies=n,AT(l))this.index=parseInt(l);else if(!this.append)throw new Rf.DataError("Only numerical values accepted for array index",200)}static processArray(e){if(typeof e>"u")return null;if(TT[e])return TT[e];let l=(0,s3.arrayRegex)().exec(e.trim());if(l!=null){let r=l[1],i="["+l[2].toString()+"]",s=OT(i);return NZ(s),TT[e]=new t(r,s)}return null}getIndex(e,n){if(this.append)return-1;let l=this.index;if(l==-1){let r=n?e:e[this.property];return r.length===0?0:r.length-1}return l}getData(e){if(this.append)throw new Rf.DataError("Can't get data when appending",100);let{index:n,dataForProperty:l}=this.getArrayDataAndIndexFromProperty(e);return l[n]}setData(e,n){if(this.append){let l=e[this.property];this.indicies.forEach(r=>{r!==""&&(r=+r,r===-1&&(r=l.length-1),l=l[+r])}),l.push(n)}else{let{index:l,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);l===-1?r.push(n):r[l]=n}}delete(e){if(this.append)throw new Rf.DataError("Can't delete an appended data",10);let{index:n,dataForProperty:l}=this.getArrayDataAndIndexFromProperty(e);l.splice(n,1)}isValid(e){let{index:n,dataForProperty:l}=this.getArrayDataAndIndexFromProperty(e);return l.hasOwnProperty(n)}getArrayDataAndIndexFromProperty(e){let n=0,l=e instanceof Array?e:e[this.property]??e;if(this.indicies.length>0){n=+this.indicies[this.indicies.length-1];for(let r=0;r<this.indicies.length-1;r++){let i=+this.indicies[r];i===-1&&(i=l.length-1),l=l[i]}n===-1&&(n=l.length-1)}return{index:n,dataForProperty:l}}isMultiDimensional(){return this.indicies.length>1}};s3.ArrayInfo=xT;function AT(t){return!isNaN(t)&&Number(t)==t&&!isNaN(parseInt(t,10))}s3.isInt=AT;function NZ(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")}s3.validateArrayIndicies=NZ;function CZ(t){if(t.length!==0&&!AT(t))throw new Rf.DataError("Only numerical values accepted for array index",200)}s3.validateArrayIndex=CZ;function OT(t){if(t.length===0)return[];if(t.charAt(0)!=="[")throw new Error("Invalid array syntax detected");let e=t.substring(1,t.indexOf("]"));CZ(e);let n=e.length+2;return[e,...OT(t.substring(n))]}s3.getArrayIndicies=OT});var kZ=k(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.DBParentData=void 0;var IZ=NT(),RZ=M4(),CT=class{parent;data;db;dataPath;constructor(e,n,l,r){this.parent=r,this.data=e,this.db=n,this.dataPath=l}checkArray(e=!1){let n=IZ.ArrayInfo.processArray(this.parent);if(n&&(!n.append||e)&&!n.isValid(this.data))throw new RZ.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=IZ.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 RZ.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]}};kf.DBParentData=CT});var PZ=k((cze,DZ)=>{DZ.exports=function(){"use strict";function t(){this.readers=0,this.queue=[]}function e(i,s,a){var u;typeof i!="function"?(r.hasOwnProperty(i)
`:t(e.children):M7(e)?t(e.children):pi(e)?e.data:""},textContent:l4,innerText:H7,getChildren:Z7,getParent:jB,getSiblings:UB,getAttributeValue:function(t,e){return(t=t.attribs)==null?void 0:t[e]},hasAttrib:function(t,e){return t.attribs!=null&&Object.prototype.hasOwnProperty.call(t.attribs,e)&&t.attribs[e]!=null},getName:function(t){return t.name},nextElementSibling:HE,prevElementSibling:VE,removeElement:zu,replaceElement:function(t,e){let n=e.prev=t.prev;n&&(n.next=e);var l=e.next=t.next;if(l&&(l.prev=e),l=e.parent=t.parent){let r=l.children;r[r.lastIndexOf(t)]=e,t.parent=null}},appendChild:function(t,e){zu(e),e.next=null,1<(e.parent=t).children.push(e)?((t=t.children[t.children.length-2]).next=e).prev=t:e.prev=null},append:function(t,e){zu(e);var n=t.parent,l=t.next;if(e.next=l,((e.prev=t).next=e).parent=n,l){if(l.prev=e,n){let r=n.children;r.splice(r.lastIndexOf(l),0,e)}}else n&&n.children.push(e)},prependChild:function(t,e){zu(e),e.parent=t,e.prev=null,t.children.unshift(e)!==1?((t=t.children[1]).prev=e).next=t:e.next=null},prepend:function(t,e){zu(e);var n,l=t.parent;l&&(n=l.children).splice(n.indexOf(t),0,e),t.prev&&(t.prev.next=e),e.parent=l,e.prev=t.prev,(e.next=t).prev=e},filter:C7,find:qE,findOneChild:function(t,e){return e.find(t)},findOne:hE,existsOne:function t(e,n){return n.some(l=>gt(l)&&(e(l)||t(e,l.children)))},findAll:function(t,e){for(var n=[],l=[e],r=[0];;)if(r[0]>=l[0].length){if(l.length===1)return n;l.shift(),r.shift()}else{let i=l[0][r[0]++];gt(i)&&(t(i)&&n.push(i),0<i.children.length)&&(r.unshift(0),l.unshift(i.children))}},testElement:function(t,e){return!(t=E$(t))||t(e)},getElements:function(t,e,n,l=1/0){return(t=E$(t))?C7(t,e,n,l):[]},getElementById:function(t,e,n=!0){return Array.isArray(e)||(e=[e]),hE(MB("id",t),e,n)},getElementsByTagName:Y0,getElementsByTagType:function(t,e,n=!0,l=1/0){return C7(V7.tag_type(t),e,n,l)},removeSubsets:function(t){let e=t.length;for(;0<=--e;){var n=t[e];if(0<e&&0<=t.lastIndexOf(n,e-1))t.splice(e,1);else for(let l=n.parent;l;l=l.parent)if(t.includes(l)){t.splice(e,1);break}}return t},get DocumentPosition(){return lr},compareDocumentPosition:$B,uniqueSort:r4,getFeed:function(t){return(t=b7(bye,t))?(t.name==="feed"?function(e){var n={type:"atom",items:Y0("entry",e=e.children).map(r=>{var i={media:b$(r=r.children)},s=(v3(i,"id","id",r),v3(i,"title","title",r),(s=b7("link",r))==null?void 0:s.attribs.href);return s&&(i.link=s),(s=Bs("summary",r)||Bs("content",r))&&(i.description=s),(s=Bs("updated",r))&&(i.pubDate=new Date(s)),i})},l=(v3(n,"id","id",e),v3(n,"title","title",e),(l=b7("link",e))==null?void 0:l.attribs.href);return l&&(n.link=l),v3(n,"description","subtitle",e),(l=Bs("updated",e))&&(n.updated=new Date(l)),v3(n,"author","email",e,!0),n}:function(l){var n=(n=(n=b7("channel",l.children))==null?void 0:n.children)!=null?n:[],l={type:l.name.substr(0,3),id:"",items:Y0("item",l.children).map(i=>{var s={media:b$(i=i.children)};return v3(s,"id","guid",i),v3(s,"title","title",i),v3(s,"link","link",i),v3(s,"description","description",i),(i=Bs("pubDate",i)||Bs("dc:date",i))&&(s.pubDate=new Date(i)),s})},r=(v3(l,"title","title",n),v3(l,"link","link",n),v3(l,"description","description",n),Bs("lastBuildDate",n));return r&&(l.updated=new Date(r)),v3(l,"author","managingEditor",n,!0),l})(t):null}}),Q0=function(){return(Q0=Object.assign||function(t){for(var e,n=1,l=arguments.length;n<l;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function BB(t,e,n){return t?t(e??t._root.children,null,void 0,n).toString():""}function wye(t,e){return BB(this,function(n){return!(typeof n!="object"||n==null||"length"in n||"type"in n)}(t)?void(e=t):t,Q0(Q0(Q0({},BE),this==null?void 0:this._options),pE(e??{})))}function Sye(t){return BB(this,t,Q0(Q0({},this._options),{xmlMode:!0}))}function s6(t){for(var e=t||(this?this.root():[]),n="",l=0;l<e.length;l++)n+=l4(e[l]);return n}function Tye(t,e,n){return n===void 0&&(n=typeof e=="boolean"&&e),t&&typeof t=="string"?(typeof e=="boolean"&&(n=e),e=this.load(t,BE,!1),n||e("script
2024-04-02 15:03:09 +08:00
:is(button, input, select, textarea, optgroup, option)[disabled],
optgroup[disabled] > option,
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
2024-05-29 18:58:23 +08:00
)`,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])"},JB={};function KB(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 _E(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 W_=(t,e,n,l,r)=>{let i=r(e,_E(n),l);return i===Pt.trueFunc?t:i===Pt.falseFunc?Pt.falseFunc:s=>i(s)&&t(s)},Y_={is:W_,matches:W_,where:W_,not(t,e,n,l,r){let i=r(e,_E(n),l);return i===Pt.falseFunc?t:i===Pt.trueFunc?Pt.falseFunc:s=>!i(s)&&t(s)},has(t,e,n,l,r){let i=n.adapter,s=_E(n),a=(s.relativeSelector=!0,e.some(c=>c.some(gE))?[JB]:void 0),u=r(e,s,a);if(u===Pt.falseFunc)return Pt.falseFunc;let o=function(c,f){return c===Pt.falseFunc?Pt.falseFunc:m=>f.isTag(m)&&c(m)}(u,i);if(a&&u!==Pt.trueFunc){let{shouldTestNextSiblings:c=!1}=u;return d=>{if(!t(d))return!1;a[0]=d;var m=i.getChildren(d),d=c?[...m,...KB(d,i)]:m;return i.existsOne(o,d)}}return c=>t(c)&&i.existsOne(o,i.getChildren(c))}};function Q_(t,e){return(t=e.getParent(t))&&e.isTag(t)?t:null}function Vye(t,e,n,l,r){let{adapter:i,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()),Mye[e.action](t,e,n);case at.Pseudo:return function(a,u,o,c,f){let{name:m,data:d}=u;if(Array.isArray(d)){if(m in Y_)return Y_[m](a,d,o,c,f);throw new Error(`Unknown pseudo-class :${m}(${d})`)}let y=(u=o.pseudos)==null?void 0:u[m],_=typeof y=="string"?y:Hye[m];if(typeof _=="string"){if(d!=null)throw new Error(`Pseudo ${m} doesn't have any arguments`);let S=tp(_);return Y_.is(a,S,o,c,f)}if(typeof y=="function")return D$(y,m,d,1),S=>y(S,d)&&a(S);if(m in vE)return vE[m](a,d,o,c);if(m in k$){let S=k$[m];return D$(S,m,d,2),w=>S(w,o,d)&&a(w)}throw new Error("Unknown pseudo-class :"+m)}(t,e,n,l,r);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(u){return i.getName(u)===a&&t(u)}}case at.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(u){let o=u;for(;o=Q_(o,i);)if(t(o))return!0;return!1};let a=new WeakSet;return function(u){let o=u;for(;o=Q_(o,i);)if(!a.has(o)){if(i.isTag(o)&&t(o))return!0;a.add(o)}return!1}}case"_flexibleDescendant":return function(a){let u=a;do if(t(u))return!0;while(u=Q_(u,i));return!1};case at.Parent:return function(a){return i.getChildren(a).some(u=>i.isTag(u)&&t(u))};case at.Child:return function(a){return(a=i.getParent(a))!=null&&i.isTag(a)&&t(a)};case at.Sibling:return function(a){var u=i.getSiblings(a);for(let c=0;c<u.length;c++){var o=u[c];if(s(a,o))break;if(i.isTag(o)&&t(o))return!0}return!1};case at.Adjacent:return i.prevElementSibling?function(a){return(a=i.prevElementSibling(a))!=null&&t(a)}:function(a){var u=i.getSiblings(a);let o;for(let f=0;f<u.length;f++){var c=u[f];if(s(a,c))break;i.isTag(c)&&(o=c)}return!!o&&t(o)};case at.Universal:if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not ye
2024-05-23 19:28:35 +08:00
`)}}):{name:l,value:r.replace(L$,`\r
2024-05-29 18:58:23 +08:00
`)}}).toArray()}}),q5=function(t,e,n){if(this.length=0,this.options=n,this._root=e,t){for(var l=0;l<t.length;l++)this[l]=t[l];this.length=t.length}},YE=(q5.prototype.cheerio="[cheerio object]",q5.prototype.splice=Array.prototype.splice,q5.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(q5.prototype,Cye,cge,yge,gge,_ge),function(t,e){return(YE=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,l){n.__proto__=l}:function(n,l){for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(n[r]=l[r])}))(t,e)}),Ege=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}YE(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)},z5=function(){return(z5=Object.assign||function(t){for(var e,n=1,l=arguments.length;n<l;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},bge=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]),dl="\uFFFD",F$=(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||{}),"--"),j$="[CDATA[",U$="doctype",M0="script",wge="public",Sge="system";function oH(t){return 55296<=t&&t<=57343}function cH(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&1<=t&&t<=31||127<=t&&t<=159}function pH(t){return 64976<=t&&t<=65007||bge.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 o(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}i.hasOwnProp=s,i._prettifyError=function(w,E,g){return(g=g.Update?g:new i.TemplateError(g)).Update(w),E||(w=g,(g=new Error(w.message)).name=w.name),g},Object.setPrototypeOf?Object.setPrototypeOf(u.prototype,Error.prototype):u.prototype=Object.create(Error.prototype,{constructor:{value:u}}),i.TemplateError=u,i.escape=function(w){return w.replace(r,a)},i.isFunction=o,i.isArray=c,i.isString=f,i.isObject=m,i.getAttrGetter=d,i.groupBy=function(w,E,g){for(var v={},x=o(E)?E:d(E),O=0;O<w.length;O++){var N=w[O],I=x(N,O);if(I===void 0&&g===!0)throw new TypeError('groupby: attribute "'+E+'" resolved to undefined');(v[I]||(v[I]=[])).push(N)}return v},i.toArray=y,i.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},i.repeat=function(w,E){for(var g="",v=0;v<E;v++)g+=w;return g},i.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)}},i.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},i.asyncIter=function(w,E,g){var v=-1;(function x(){++v<w.length?E(w[v],v,x,g):g()})()},i.asyncFor=function(w,E,g){var v=S(w||{}),x=v.length,O=-1;(function N(){var I=v[++O];O<x?E(I,w[I],O,x,N):g()})()},i.indexOf=_,i.keys=S,i._entries=function(w){return S(w).map(function(E){return[E,w[E]]})},i._values=function(w){return S(w).map(function(E){return w[E]})},i._assign=i.extend=function(w,E){return w=w||{},S(E).forEach(function(g){w[g]=E[g]}),w},i.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 FH(){throw new Error("setTimeout has not been defined")}function jH(){throw new Error("clearTimeout has not been defined")}var zs=FH,Gs=jH;function UH(t){if(zs===setTimeout)return setTimeout(t,0);if((zs===FH||!zs)&&setTimeout)return(zs=setTimeout)(t,0);try{return zs(t,0)}catch{try{return zs.call(null,t,0)}catch{return zs.call(this,t,0)}}}typeof ts.setTimeout=="function"&&(zs=setTimeout),typeof ts.clearTimeout=="function"&&(Gs=clearTimeout);var Xu,ls=[],t4=!1,L7=-1;function Eve(){t4&&Xu&&(t4=!1,Xu.length?ls=Xu.concat(ls):L7=-1,ls.length)&&MH()}function MH(){if(!t4){var t=UH(Eve);t4=!0;for(var e=ls.length;e;){for(Xu=ls,ls=[];++L7<e;)Xu&&Xu[L7].run();L7=-1,e=ls.length}Xu=null,t4=!1,function(n){if(Gs===clearTimeout)return clearTimeout(n);if((Gs===jH||!Gs)&&clearTimeout)return(Gs=clearTimeout)(n);try{Gs(n)}catch{try{return Gs.call(null,n)}catch{return Gs.call(this,n)}}}(t)}}function $H(t,e){this.fun=t,this.array=e}function to(){}$H.prototype.run=function(){this.fun.apply(null,this.array)};var bve=to,wve=to,Sve=to,Tve=to,xve=to,Ave=to,Ove=to,z0=ts.performance||{},Nve=z0.now||z0.mozNow||z0.msNow||z0.oNow||z0.webkitNow||function(){return new Date().getTime()},Cve=new Date,Qs={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];ls.push(new $H(t,e)),ls.length!==1||t4||UH(MH)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:bve,addListener:wve,once:Sve,off:Tve,removeListener:xve,removeAllListeners:Ave,emit:Ove,binding:function(t){throw new Error("process.
\r\xA0`,EB="()[]{}%*-+~/#,:|.<>=!",GH="string",JH="whitespace",KH="data",XH="block-start",WH="block-end",YH="variable-start",QH="variable-end",ZH="comment",eV="left-paren",tV="right-paren",nV="left-bracket",lV="right-bracket",rV="left-curly",iV="right-curly",sV="operator",aV="comma",uV="colon",oV="tilde",cV="pipe",pV="float",fV="boolean",jE="none",dV="symbol",hV="regex";function n3(t,e,n,l){return{type:t,value:e,lineno:n,colno:l}}var Lve=function(){function t(n,l){this.str=n,this.index=0,this.len=n.length,this.lineno=0,this.colno=0,this.in_code=!1,n=(l=l||{}).tags||{},this.tags={BLOCK_START:n.blockStart||"{%",BLOCK_END:n.blockEnd||"%}",VARIABLE_START:n.variableStart||"{{",VARIABLE_END:n.variableEnd||"}}",COMMENT_START:n.commentStart||"{#",COMMENT_END:n.commentEnd||"#}"},this.trimBlocks=!!l.trimBlocks,this.lstripBlocks=!!l.lstripBlocks}var e=t.prototype;return e.nextToken=function(){var n=this.lineno,l=this.colno;if(this.in_code){var r=this.current();if(this.isFinished())return null;if(r==='"'||r==="'")return n3(GH,this._parseString(r),n,l);if(d=this._extract(_B))return n3(JH,d,n,l);if(d=(d=this._extractString(this.tags.BLOCK_END))||this._extractString("-"+this.tags.BLOCK_END))return this.in_code=!1,this.trimBlocks&&((r=this.current())===`
2024-05-07 17:30:00 +08:00
`?this.forward():r==="\r"&&(this.forward(),(r=this.current())===`
2024-05-29 18:58:23 +08:00
`?this.forward():this.back())),n3(WH,d,n,l);if(d=(d=this._extractString(this.tags.VARIABLE_END))||this._extractString("-"+this.tags.VARIABLE_END))return this.in_code=!1,n3(QH,d,n,l);if(r==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var i="";!this.isFinished();){if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}i+=this.current(),this.forward()}for(var s=["g","i","m","y"],a="";!this.isFinished()&&s.indexOf(this.current())!==-1;)a+=this.current(),this.forward();return n3(hV,{body:i,flags:a},n,l)}if(EB.indexOf(r)!==-1){this.forward();var u,o=["==","===","!=","!==","<=",">=","//","**"],c=r+this.current();switch(Le.indexOf(o,c)!==-1&&(this.forward(),Le.indexOf(o,(r=c)+this.current())!==-1)&&(r=c+this.current(),this.forward()),r){case"(":u=eV;break;case")":u=tV;break;case"[":u=nV;break;case"]":u=lV;break;case"{":u=rV;break;case"}":u=iV;break;case",":u=aV;break;case":":u=uV;break;case"~":u=oV;break;case"|":u=cV;break;default:u=sV}return n3(u,r,n,l)}if((d=this._extractUntil(_B+EB)).match(/^[-+]?[0-9]+$/))return this.current()==="."?(this.forward(),o=this._extract("0123456789"),n3(pV,d+"."+o,n,l)):n3("int",d,n,l);if(d.match(/^(true|false)$/))return n3(fV,d,n,l);if(d==="none"||d==="null")return n3(jE,d,n,l);if(d)return n3(dV,d,n,l);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,n3(XH,d,n,l);if(d=(d=this._extractString(this.tags.VARIABLE_START+"-"))||this._extractString(this.tags.VARIABLE_START))return this.in_code=!0,n3(YH,d,n,l);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 n3(y?ZH:KH,d,n,l)},e._parseString=function(n){this.forward();for(var l="";!this.isFinished()&&this.current()!==n;){var r=this.current();if(r==="\\")switch(this.forward(),this.current()){case"n":l+=`
2024-05-07 17:30:00 +08:00
`;break;case"t":l+=" ";break;case"r":l+="\r";break;default:l+=this.current()}else l+=r;this.forward()}return this.forward(),l},e._matches=function(n){return this.index+n.length>this.len?null:this.str.slice(this.index,this.index+n.length)===n},e._extractString=function(n){return this._matches(n)?(this.forwardN(n.length),n):null},e._extractUntil=function(n){return this._extractMatching(!0,n||"")},e._extract=function(n){return this._extractMatching(!1,n)},e._extractMatching=function(n,l){if(this.isFinished())return null;var r=l.indexOf(this.current());if(n&&r===-1||!n&&r!==-1){var i=this.current();this.forward();for(var s=l.indexOf(this.current());(n&&s===-1||!n&&s!==-1)&&!this.isFinished();)i+=this.current(),this.forward(),s=l.indexOf(this.current());return i}return""},e._extractRegex=function(n){return(n=this.currentStr().match(n))?(this.forwardN(n[0].length),n):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(n){for(var l=0;l<n;l++)this.forward()},e.forward=function(){this.index++,this.previous()===`
`?(this.lineno++,this.colno=0):this.colno++},e.backN=function(n){for(var l=0;l<n;l++)this.back()},e.back=function(){var n;this.index--,this.current()===`
2024-05-06 10:35:10 +08:00
`?(this.lineno--,n=this.src.lastIndexOf(`
2024-05-29 18:58:23 +08:00
`,this.index-1),this.colno=n===-1?this.index:this.index-n):this.colno--},e.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},e.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},e.previous=function(){return this.str.charAt(this.index-1)},t}(),ze={lex:function(t,e){return new Lve(t,e)},TOKEN_STRING:GH,TOKEN_WHITESPACE:JH,TOKEN_DATA:KH,TOKEN_BLOCK_START:XH,TOKEN_BLOCK_END:WH,TOKEN_VARIABLE_START:YH,TOKEN_VARIABLE_END:QH,TOKEN_COMMENT:ZH,TOKEN_LEFT_PAREN:eV,TOKEN_RIGHT_PAREN:tV,TOKEN_LEFT_BRACKET:nV,TOKEN_RIGHT_BRACKET:lV,TOKEN_LEFT_CURLY:rV,TOKEN_RIGHT_CURLY:iV,TOKEN_OPERATOR:sV,TOKEN_COMMA:aV,TOKEN_COLON:uV,TOKEN_TILDE:oV,TOKEN_PIPE:cV,TOKEN_INT:"int",TOKEN_FLOAT:pV,TOKEN_BOOLEAN:fV,TOKEN_NONE:jE,TOKEN_SYMBOL:dV,TOKEN_SPECIAL:"special",TOKEN_REGEX:hV};function bB(t,e){for(var n,l=0;l<e.length;l++){var r=e[l];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,typeof(n=function(i){if(typeof i!="object"||i===null)return i;var s=i[Symbol.toPrimitive];if(s===void 0)return String(i);if(typeof(s=s.call(i,"string"))!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}(r.key))=="symbol"?n:String(n),r)}}function eb(t,e,n){return e&&bB(t.prototype,e),n&&bB(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function mV(t,e){t.prototype=Object.create(e.prototype),yV(t.prototype.constructor=t,e)}function yV(t,e){return(yV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}function gV(t,e,n){n=n||{},Le.keys(n).forEach(function(r){n[r]=function(i,s){return typeof i!="function"||typeof s!="function"?s:function(){var a=this.parent,u=(this.parent=i,s.apply(this,arguments));return this.parent=a,u}}(t.prototype[r],n[r])});var l=function(r){function i(){return r.apply(this,arguments)||this}return mV(i,r),eb(i,[{key:"typename",get:function(){return e}}]),i}(t);return Le._assign(l.prototype,n),l}var Fve=function(){function t(){this.init.apply(this,arguments)}return t.prototype.init=function(){},t.extend=function(e,n){return typeof e=="object"&&(n=e,e="anonymous"),gV(this,e,n)},eb(t,[{key:"typename",get:function(){return this.constructor.name}}]),t}(),jve=function(t){function e(){var n;return(n=t.call(this)||this).init.apply(n,arguments),n}return mV(e,t),e.prototype.init=function(){},e.extend=function(n,l){return typeof n=="object"&&(l=n,n="anonymous"),gV(this,n,l)},eb(e,[{key:"typename",get:function(){return this.constructor.name}}]),e}(Wn),a4={Obj:Fve,EmitterObj:jve};function wB(t,e){for(var n,l=0;l<e.length;l++){var r=e[l];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,typeof(n=function(i){if(typeof i!="object"||i===null)return i;var s=i[Symbol.toPrimitive];if(s===void 0)return String(i);if(typeof(s=s.call(i,"string"))!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}(r.key))=="symbol"?n:String(n),r)}}function tb(t,e,n){return e&&wB(t.prototype,e),n&&wB(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function lp(t,e){t.prototype=Object.create(e.prototype),vV(t.prototype.constructor=t,e)}function vV(t,e){return(vV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}function SB(t,e,n){t instanceof e&&n.push(t),t instanceof ll&&t.findAll(e,n)}var ll=function(t){function e(){return t.apply(this,arguments)||this}lp(e,t);var n=e.prototype;return n.init=function(l,r){for(var i=arguments,s=this,a=arguments.length,u=new Array(2<a?a-2:0),o=2;o<a;o++)u[o-2]=arguments[o];this.lineno=l,this.colno=r,this.fields.forEach(function(c,f){s[c]=f=(f=i[f+2])===void 0?null:f})},n.findAll=function(l,r){var i=this;return r=r||[],this instanceof fi?this.children.forEach(function(s){return SB(s,l,r)}):this.fields.forEach(function(s){return SB(i[s],l,r)}),r},n.iterFields=function(l){var r=this;this.fields.forEach(function(i){l(r[i],i)})},e}(a4.Obj),nb=function(t){function e(){return t.apply(this,arguments)||this}return lp(e,t),tb(e,[{key:"ty
2024-05-07 17:30:00 +08:00
`);l.forEach(function(r,i){r&&(n&&0<i||!n)&&process.stdout.write(" ".repeat(e)),i=i===l.length-1?"":`
2024-05-29 18:58:23 +08:00
`,process.stdout.write(r+i)})}var X={Node:ll,Root:Uve,NodeList:fi,Value:nb,Literal:_V,Symbol:Mve,Group:$ve,Array:Bve,Pair:Hve,Dict:EV,Output:s_e,Capture:a_e,TemplateData:u_e,If:bV,IfAsync:qve,InlineIf:zve,For:lb,AsyncEach:Gve,AsyncAll:Jve,Macro:wV,Caller:Kve,Import:Xve,FromImport:Wve,FunCall:SV,Filter:TV,FilterAsync:Yve,KeywordArgs:Qve,Block:Zve,Super:e_e,Extends:t_e,Include:n_e,Set:l_e,Switch:r_e,Case:i_e,LookupVal:Vve,BinOp:D3,In:o_e,Is:c_e,Or:p_e,And:f_e,Not:d_e,Add:h_e,Concat:m_e,Sub:y_e,Mul:g_e,Div:v_e,FloorDiv:__e,Mod:E_e,Pow:b_e,Neg:w_e,Pos:S_e,Compare:T_e,CompareOperand:x_e,CallExtension:UE,CallExtensionAsync:A_e,printNodes:function t(e,n){var l,r;n=n||0,B0(e.typename+": ",n),e instanceof fi?(B0(`
2024-05-23 19:28:35 +08:00
`),e.children.forEach(function(i){t(i,n+2)})):e instanceof UE?(B0(e.extName+"."+e.prop+`
`),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach(function(i){t(i,n+2)})):(l=[],r=null,e.iterFields(function(i,s){i instanceof ll?l.push([s,i]):(r=r||{})[s]=i}),r?B0(JSON.stringify(r,null,2)+`
`,null,!0):B0(`
2024-05-29 18:58:23 +08:00
`),l.forEach(function(a){var s=a[0],a=a[1];B0("["+s+"] =>",n+2),t(a,n+4)}))}};function xV(t,e){return(xV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}X.Node,X.Root,X.NodeList,X.Value,X.Literal,X.Group,X.Pair,X.Dict,X.Output,X.Capture,X.TemplateData,X.If,X.IfAsync,X.InlineIf,X.For,X.AsyncEach,X.AsyncAll,X.Macro,X.Caller,X.Import,X.FromImport,X.FunCall,X.Filter,X.FilterAsync,X.KeywordArgs,X.Block,X.Super,X.Extends,X.Include,X.Switch,X.Case,X.LookupVal,X.BinOp,X.In,X.Is,X.Or,X.And,X.Not,X.Add,X.Concat,X.Sub,X.Mul,X.Div,X.FloorDiv,X.Mod,X.Pow,X.Neg,X.Pos,X.Compare,X.CompareOperand,X.CallExtension,X.CallExtensionAsync,X.printNodes;var TB=function(t){var e;function n(){return t.apply(this,arguments)||this}e=t,(l=n).prototype=Object.create(e.prototype),xV(l.prototype.constructor=l,e);var l=n.prototype;return l.init=function(r){this.tokens=r,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},l.nextToken=function(r){var i;if(this.peeked){if(r||this.peeked.type!==ze.TOKEN_WHITESPACE)return i=this.peeked,this.peeked=null,i;this.peeked=null}if(i=this.tokens.nextToken(),!r)for(;i&&i.type===ze.TOKEN_WHITESPACE;)i=this.tokens.nextToken();return i},l.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},l.pushToken=function(r){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=r},l.error=function(r,i,s){var a;return i!==void 0&&s!==void 0||(i=(a=this.peekToken()||{}).lineno,s=a.colno),i!==void 0&&(i+=1),s!==void 0&&(s+=1),new Le.TemplateError(r,i,s)},l.fail=function(r,i,s){throw this.error(r,i,s)},l.skip=function(r){var i=this.nextToken();return!(!i||i.type!==r)||(this.pushToken(i),!1)},l.expect=function(r){var i=this.nextToken();return i.type!==r&&this.fail("expected "+r+", got "+i.type,i.lineno,i.colno),i},l.skipValue=function(r,i){var s=this.nextToken();return!(!s||s.type!==r||s.value!==i)||(this.pushToken(s),!1)},l.skipSymbol=function(r){return this.skipValue(ze.TOKEN_SYMBOL,r)},l.advanceAfterBlockEnd=function(r){var i;return r||((i=this.peekToken())||this.fail("unexpected end of file"),i.type!==ze.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),r=this.nextToken().value),(i=this.nextToken())&&i.type===ze.TOKEN_BLOCK_END?i.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+r+" statement"),i},l.advanceAfterVariableEnd=function(){var r=this.nextToken();r&&r.type===ze.TOKEN_VARIABLE_END?this.dropLeadingWhitespace=r.value.charAt(r.value.length-this.tokens.tags.VARIABLE_END.length-1)==="-":(this.pushToken(r),this.fail("expected variable end"))},l.parseFor=function(){var r,i,s=this.peekToken();if(this.skipSymbol("for")?(r=new X.For(s.lineno,s.colno),i="endfor"):this.skipSymbol("asyncEach")?(r=new X.AsyncEach(s.lineno,s.colno),i="endeach"):this.skipSymbol("asyncAll")?(r=new X.AsyncAll(s.lineno,s.colno),i="endall"):this.fail("parseFor: expected for{Async}",s.lineno,s.colno),r.name=this.parsePrimary(),r.name instanceof X.Symbol||this.fail("parseFor: variable name expected for loop"),this.peekToken().type===ze.TOKEN_COMMA){var a=r.name;for(r.name=new X.Array(a.lineno,a.colno),r.name.addChild(a);this.skip(ze.TOKEN_COMMA);){var u=this.parsePrimary();r.name.addChild(u)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',s.lineno,s.colno),r.arr=this.parseExpression(),this.advanceAfterBlockEnd(s.value),r.body=this.parseUntilBlocks(i,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),r.else_=this.parseUntilBlocks(i)),this.advanceAfterBlockEnd(),r},l.parseMacro=function(){var r=this.peekToken(),s=(this.skipSymbol("macro")||this.fail("expected macro"),this.parsePrimary(!0)),i=this.parseSignature(),s=new X.Macro(r.lineno,r.colno,s,i);return this.advanceAfterBlockEnd(r.value),s.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),s},l.parseCall=function(){var r=this.peekToken(),u=(this.skipSymbol("call")||this.fail("expected call"),this.
2024-05-07 17:30:00 +08:00
`)},l._emitLines=function(){for(var r=this,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];s.forEach(function(u){return r._emitLine(u)})},l._emitFuncBegin=function(r,i){this.buffer="output",this._scopeClosers="",this._emitLine("function "+i+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+r.lineno+";"),this._emitLine("var colno = "+r.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},l._emitFuncEnd=function(r){r||this._emitLine("cb(null, "+this.buffer+");"),this._closeScopeLevels(),this._emitLine("} catch (e) {"),this._emitLine(" cb(runtime.handleError(e, lineno, colno));"),this._emitLine("}"),this._emitLine("}"),this.buffer=null},l._addScopeLevel=function(){this._scopeClosers+="})"},l._closeScopeLevels=function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},l._withScopedSyntax=function(r){var i=this._scopeClosers;this._scopeClosers="",r.call(this),this._closeScopeLevels(),this._scopeClosers=i},l._makeCallback=function(r){var i=this._tmpid();return"function("+i+(r?","+r:"")+`) {
if(`+i+") { cb("+i+"); return; }"},l._tmpid=function(){return this.lastId++,"t_"+this.lastId},l._templateName=function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},l._compileChildren=function(r,i){var s=this;r.children.forEach(function(a){s.compile(a,i)})},l._compileAggregate=function(r,i,s,a){var u=this;s&&this._emit(s),r.children.forEach(function(o,c){0<c&&u._emit(","),u.compile(o,i)}),a&&this._emit(a)},l._compileExpression=function(r,i){this.assertType(r,X.Literal,X.Symbol,X.Group,X.Array,X.Dict,X.FunCall,X.Caller,X.Filter,X.LookupVal,X.Compare,X.InlineIf,X.In,X.Is,X.And,X.Or,X.Not,X.Add,X.Concat,X.Sub,X.Mul,X.Div,X.FloorDiv,X.Mod,X.Pow,X.Neg,X.Pos,X.Compare,X.NodeList),this.compile(r,i)},l.assertType=function(r){for(var i=arguments.length,s=new Array(1<i?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];s.some(function(u){return r instanceof u})||this.fail("assertType: invalid type: "+r.typename,r.lineno,r.colno)},l.compileCallExtension=function(r,i,s){var a=this,u=r.args,o=r.contentArgs,c=typeof r.autoescape!="boolean"||r.autoescape;s||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+r.extName+'")["'+r.prop+'"]('),this._emit("context"),(u||o)&&this._emit(","),u&&(u instanceof X.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),u.children.forEach(function(f,m){a._compileExpression(f,i),m===u.children.length-1&&!o.length||a._emit(",")})),o.length&&o.forEach(function(f,m){var d;0<m&&a._emit(","),f?(a._emitLine("function(cb) {"),a._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}"),d=a._pushBuffer(),a._withScopedSyntax(function(){a.compile(f,i),a._emitLine("cb(null, "+d+");")}),a._popBuffer(),a._emitLine("return "+d+";"),a._emitLine("}")):a._emit("null")}),s?(r=this._tmpid(),this._emitLine(", "+this._makeCallback(r)),this._emitLine(this.buffer+" += runtime.suppressValue("+r+", "+c+" && env.opts.autoescape);"),this._addScopeLevel()):(this._emit(")"),this._emit(", "+c+` && env.opts.autoescape);
2024-05-29 18:58:23 +08:00
`))},l.compileCallExtensionAsync=function(r,i){this.compileCallExtension(r,i,!0)},l.compileNodeList=function(r,i){this._compileChildren(r,i)},l.compileLiteral=function(r){var i;typeof r.value=="string"?(i=(i=(i=(i=(i=(i=r.value.replace(/\\/g,"\\\\")).replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+i+'"')):r.value===null?this._emit("null"):this._emit(r.value.toString())},l.compileSymbol=function(r,i){r=r.value,(i=i.lookup(r))?this._emit(i):this._emit('runtime.contextOrFrameLookup(context, frame, "'+r+'")')},l.compileGroup=function(r,i){this._compileAggregate(r,i,"(",")")},l.compileArray=function(r,i){this._compileAggregate(r,i,"[","]")},l.compileDict=function(r,i){this._compileAggregate(r,i,"{","}")},l.compilePair=function(a,i){var s=a.key,a=a.value;s instanceof X.Symbol?s=new X.Literal(s.lineno,s.colno,s.value):s instanceof X.Literal&&typeof s.value=="string"||this.fail("compilePair: Dict keys must be strings or names",s.lineno,s.colno),this.compile(s,i),this._emit(": "),this._compileExpression(a,i)},l.compileInlineIf=function(r,i){this._emit("("),this.compile(r.cond,i),this._emit("?"),this.compile(r.body,i),this._emit(":"),r.else_!==null?this.compile(r.else_,i):this._emit('""'),this._emit(")")},l.compileIn=function(r,i){this._emit("runtime.inOperator("),this.compile(r.left,i),this._emit(","),this.compile(r.right,i),this._emit(")")},l.compileIs=function(r,i){var s=(r.right.name||r.right).value;this._emit('env.getTest("'+s+'").call(context, '),this.compile(r.left,i),r.right.args&&(this._emit(","),this.compile(r.right.args,i)),this._emit(") === true")},l._binOpEmitter=function(r,i,s){this.compile(r.left,i),this._emit(s),this.compile(r.right,i)},l.compileOr=function(r,i){return this._binOpEmitter(r,i," || ")},l.compileAnd=function(r,i){return this._binOpEmitter(r,i," && ")},l.compileAdd=function(r,i){return this._binOpEmitter(r,i," + ")},l.compileConcat=function(r,i){return this._binOpEmitter(r,i,' + "" + ')},l.compileSub=function(r,i){return this._binOpEmitter(r,i," - ")},l.compileMul=function(r,i){return this._binOpEmitter(r,i," * ")},l.compileDiv=function(r,i){return this._binOpEmitter(r,i," / ")},l.compileMod=function(r,i){return this._binOpEmitter(r,i," % ")},l.compileNot=function(r,i){this._emit("!"),this.compile(r.target,i)},l.compileFloorDiv=function(r,i){this._emit("Math.floor("),this.compile(r.left,i),this._emit(" / "),this.compile(r.right,i),this._emit(")")},l.compilePow=function(r,i){this._emit("Math.pow("),this.compile(r.left,i),this._emit(", "),this.compile(r.right,i),this._emit(")")},l.compileNeg=function(r,i){this._emit("-"),this.compile(r.target,i)},l.compilePos=function(r,i){this._emit("+"),this.compile(r.target,i)},l.compileCompare=function(r,i){var s=this;this.compile(r.expr,i),r.ops.forEach(function(a){s._emit(" "+P_e[a.type]+" "),s.compile(a.expr,i)})},l.compileLookupVal=function(r,i){this._emit("runtime.memberLookup(("),this._compileExpression(r.target,i),this._emit("),"),this._compileExpression(r.val,i),this._emit(")")},l._getNodeName=function(r){switch(r.typename){case"Symbol":return r.value;case"FunCall":return"the return value of ("+this._getNodeName(r.name)+")";case"LookupVal":return this._getNodeName(r.target)+'["'+this._getNodeName(r.val)+'"]';case"Literal":return r.value.toString();default:return"--expression--"}},l.compileFunCall=function(r,i){this._emit("(lineno = "+r.lineno+", colno = "+r.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(r.name,i),this._emit(', "'+this._getNodeName(r.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(r.args,i,"[","])"),this._emit(")")},l.compileFilter=function(r,i){var s=r.name;this.assertType(s,X.Symbol),this._emit('env.getFilter("'+s.value+'").call(context, '),this._compileAggregate(r.args,i),this._emit(")")},l.compileFilterAsync=function(r,i){var s=r.name,a=r.symbol.value;this.assertType(s,X.Symbol),i.set(a,a),this._emit('env.getFilter("'+s.value+'").call(context, '),this._compileAggregate(r.args,i),this._emitLine(", "+this._makeCallback(a)
2024-05-07 17:30:00 +08:00
else {`),this._withScopedSyntax(function(){a.compile(r.else_,i),s&&a._emit("cb()")})):s&&(this._emitLine(`}
2024-05-23 19:28:35 +08:00
else {`),this._emit("cb()")),this._emitLine("}")},l.compileIfAsync=function(r,i){this._emit("(function(cb) {"),this.compileIf(r,i,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},l._emitLoopBindings=function(r,i,s,a){var u=this;[{name:"index",val:s+" + 1"},{name:"index0",val:s},{name:"revindex",val:a+" - "+s},{name:"revindex0",val:a+" - "+s+" - 1"},{name:"first",val:s+" === 0"},{name:"last",val:s+" === "+a+" - 1"},{name:"length",val:a}].forEach(function(o){u._emitLine('frame.set("loop.'+o.name+'", '+o.val+");")})},l.compileFor=function(r,i){var s,a,u,o,c=this,f=this._tmpid(),m=this._tmpid(),d=this._tmpid();i=i.push(),this._emitLine("frame = frame.push();"),this._emit("var "+d+" = "),this._compileExpression(r.arr,i),this._emitLine(";"),this._emit("if("+d+") {"),this._emitLine(d+" = runtime.fromIterator("+d+");"),r.name instanceof X.Array?(this._emitLine("var "+f+";"),this._emitLine("if(runtime.isArray("+d+")) {"),this._emitLine("var "+m+" = "+d+".length;"),this._emitLine("for("+f+"=0; "+f+" < "+d+".length; "+f+"++) {"),r.name.children.forEach(function(y,_){var S=c._tmpid();c._emitLine("var "+S+" = "+d+"["+f+"]["+_+"];"),c._emitLine('frame.set("'+y+'", '+d+"["+f+"]["+_+"]);"),i.set(r.name.children[_].value,S)}),this._emitLoopBindings(r,d,f,m),this._withScopedSyntax(function(){c.compile(r.body,i)}),this._emitLine("}"),this._emitLine("} else {"),o=(s=r.name.children)[0],s=s[1],a=this._tmpid(),u=this._tmpid(),i.set(o.value,a),i.set(s.value,u),this._emitLine(f+" = -1;"),this._emitLine("var "+m+" = runtime.keys("+d+").length;"),this._emitLine("for(var "+a+" in "+d+") {"),this._emitLine(f+"++;"),this._emitLine("var "+u+" = "+d+"["+a+"];"),this._emitLine('frame.set("'+o.value+'", '+a+");"),this._emitLine('frame.set("'+s.value+'", '+u+");"),this._emitLoopBindings(r,d,f,m),this._withScopedSyntax(function(){c.compile(r.body,i)}),this._emitLine("}")):(o=this._tmpid(),i.set(r.name.value,o),this._emitLine("var "+m+" = "+d+".length;"),this._emitLine("for(var "+f+"=0; "+f+" < "+d+".length; "+f+"++) {"),this._emitLine("var "+o+" = "+d+"["+f+"];"),this._emitLine('frame.set("'+r.name.value+'", '+o+");"),this._emitLoopBindings(r,d,f,m),this._withScopedSyntax(function(){c.compile(r.body,i)})),this._emitLine("}"),this._emitLine("}"),r.else_&&(this._emitLine("if (!"+m+") {"),this.compile(r.else_,i),this._emitLine("}")),this._emitLine("frame = frame.pop();")},l._compileAsyncLoop=function(r,i,s){var a,u=this,o=this._tmpid(),c=this._tmpid(),f=this._tmpid(),m=s?"asyncAll":"asyncEach",m=(i=i.push(),this._emitLine("frame = frame.push();"),this._emit("var "+f+" = runtime.fromIterator("),this._compileExpression(r.arr,i),this._emitLine(");"),r.name instanceof X.Array?(a=r.name.children.length,this._emit("runtime."+m+"("+f+", "+a+", function("),r.name.children.forEach(function(d){u._emit(d.value+",")}),this._emit(o+","+c+",next) {"),r.name.children.forEach(function(d){d=d.value,i.set(d,d),u._emitLine('frame.set("'+d+'", '+d+");")})):(a=r.name.value,this._emitLine("runtime."+m+"("+f+", 1, function("+a+", "+o+", "+c+",next) {"),this._emitLine('frame.set("'+a+'", '+a+");"),i.set(a,a)),this._emitLoopBindings(r,f,o,c),this._withScopedSyntax(function(){var d;s&&(d=u._pushBuffer()),u.compile(r.body,i),u._emitLine("next("+o+(d?","+d:"")+");"),s&&u._popBuffer()}),this._tmpid());this._emitLine("}, "+this._makeCallback(m)),this._addScopeLevel(),s&&this._emitLine(this.buffer+" += "+m+";"),r.else_&&(this._emitLine("if (!"+f+".length) {"),this.compile(r.else_,i),this._emitLine("}")),this._emitLine("frame = frame.pop();")},l.compileAsyncEach=function(r,i){this._compileAsyncLoop(r,i)},l.compileAsyncAll=function(r,i){this._compileAsyncLoop(r,i,!0)},l._compileMacro=function(r,_){var s=this,a=[],u=null,o="macro_"+this._tmpid(),c=_!==void 0,f=(r.args.children.forEach(function(S,w){w===r.args.children.length-1&&S instanceof X.Dict?u=S:(s.assertType(S,X.Symbol),a.push(S))}),[].concat(a.map(function(S){return"l_"+S.value}),["kwargs"])),m=a.map(function(S){return'"'+S.value+'"'}),d=(u&&u.children||[]).map(function(S){return'"'+S.key.value+'"'}),y=c?_.push(!0):
`))})},l.compileRoot=function(r,i){var s=this,a=(i&&this.fail("compileRoot: root node can't have frame"),i=new iE,this._emitFuncBegin(r,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(r,i),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0,[]);(i=r.findAll(X.Block)).forEach(function(u,o){var c=u.name.value;if(a.indexOf(c)!==-1)throw new Error('Block "'+c+'" defined more than once.');a.push(c),s._emitFuncBegin(u,"b_"+c),c=new iE,s._emitLine("var frame = frame.push(true);"),s.compile(u.body,c),s._emitFuncEnd()}),this._emitLine("return {"),i.forEach(function(u,o){u="b_"+u.name.value,s._emitLine(u+": "+u+",")}),this._emitLine(`root: root
2024-05-29 18:58:23 +08:00
};`)},l.compile=function(r,i){var s=this["compile"+r.typename];s?s.call(this,r,i):this.fail("compile: Cannot compile node: "+r.typename,r.lineno,r.colno)},l.getCode=function(){return this.codebuf.join("")},n}(a4.Obj),L_e={compile:function(s,e,n,l,r){var i=new AB(l,(r=r===void 0?{}:r).throwOnUndefined),s=(n||[]).map(function(a){return a.preprocess}).filter(function(a){return!!a}).reduce(function(a,u){return u(a)},s);return i.compile(I_e.transform(O_e.parse(s,n,r),e,l)),i.getCode()},Compiler:AB},F_e=mt(function(t){function e(d,y){return d==null||d===!1?y:d}function n(d){return d!=d}function l(d){var y=(d=e(d,"")).toLowerCase();return yt.copySafeness(d,y.charAt(0).toUpperCase()+y.slice(1))}function r(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 i(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 yt.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=l,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),yt.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 yt.SafeString?d:yt.markSafe(Le.escape((d=d??"").toString()))},t.safe=function(d){return d instanceof yt.SafeString?d:yt.markSafe((d=d??"").toString())},t.first=function(d){return d[0]},t.forceescape=function(d){return yt.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(`
2024-05-23 19:28:35 +08:00
`),w=Le.repeat(" ",E),E=S.map(function(g,v){return v!==0||_?""+w+g:g}).join(`
`);return yt.copySafeness(d,E)},t.join=function(d,y,_){return y=y||"",(d=_?Le.map(d,function(S){return S[_]}):d).join(y)},t.last=function(d){return d[d.length-1]},t.length=function(d){return(d=e(d,""))!==void 0?typeof Map=="function"&&d instanceof Map||typeof Set=="function"&&d instanceof Set?d.size:(!Le.isObject(d)||d instanceof yt.SafeString?d:Le.keys(d)).length:0},t.list=r,t.lower=function(d){return(d=e(d,"")).toLowerCase()},t.nl2br=function(d){return d==null?"":yt.copySafeness(d,d.replace(/\r\n|\n/g,`<br />
`))},t.random=function(d){return d[Math.floor(Math.random()*d.length)]},t.reject=i(!1),t.rejectattr=function(d,y){return d.filter(function(_){return!_[y]})},t.select=i(!0),t.selectattr=function(d,y){return d.filter(function(_){return!!_[y]})},t.replace=function(d,y,_,S){var w=d;if(y instanceof RegExp)return d.replace(y,_);S===void 0&&(S=-1);var E="";if(typeof y=="number")y=""+y;else if(typeof y!="string")return d;if(typeof(d=typeof d=="number"?""+d:d)!="string"&&!(d instanceof yt.SafeString))return d;if(y==="")return E=_+d.split("").join(_)+_,yt.copySafeness(d,E);var g=d.indexOf(y);if(S===0||g===-1)return d;for(var v=0,x=0;-1<g&&(S===-1||x<S);)E+=d.substring(v,g)+_,v=g+y.length,x++,g=d.indexOf(y,v);return v<d.length&&(E+=d.substring(v)),yt.copySafeness(w,E)},t.reverse=function(d){var y;return(y=Le.isString(d)?r(d):Le.map(d,function(_){return _})).reverse(),Le.isString(d)?yt.copySafeness(d,y.join("")):y},t.round=function(d,y,_){return y=y||0,y=Math.pow(10,y),(_==="ceil"?Math.ceil:_==="floor"?Math.floor:Math.round)(d*y)/y},t.slice=function(d,y,_){for(var S=Math.floor(d.length/y),w=d.length%y,E=[],g=0,v=0;v<y;v++){var x=g+v*S;v<w&&g++,x=d.slice(x,g+(v+1)*S),_&&w<=v&&x.push(_),E.push(x)}return E},t.sum=function(d,y,_){return(_=_===void 0?0:_)+(d=y?Le.map(d,function(S){return S[y]}):d).reduce(function(S,w){return S+w},0)},t.sort=yt.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(E,y,_,S){var w=this,E=Le.map(E,function(v){return v}),g=Le.getAttrGetter(S);return E.sort(function(v,x){if(v=S?g(v):v,x=S?g(x):x,w.env.opts.throwOnUndefined&&S&&(v===void 0||x===void 0))throw new TypeError('sort: attribute "'+S+'" resolved to undefined');return!_&&Le.isString(v)&&Le.isString(x)&&(v=v.toLowerCase(),x=x.toLowerCase()),v<x?y?1:-1:x<v?y?-1:1:0}),E}),t.string=function(d){return yt.copySafeness(d,d)},t.striptags=function(d,S){var _=s((d=e(d,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,"")),S=S?_.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
2024-05-06 10:35:10 +08:00
`).replace(/\n\n\n+/g,`
2024-04-02 15:03:09 +08:00
2024-09-23 11:52:18 +08:00
`):_.replace(/\s+/gi," ");return yt.copySafeness(d,S)},t.title=function(d){var y=(d=e(d,"")).split(" ").map(l);return yt.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,_)),yt.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=/^(?:\(|<|&lt;)?(.*?)(?:\.|,|\)|\n|&gt;)?$/,u=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,o=/^https?:\/\/.*$/,c=/^www\./,f=/\.(?:org|net|com)(?:\:|\/|$)/,m=(t.urlize=function(d,y,_){n(y)&&(y=1/0);var S=_===!0?' rel="nofollow"':"";return d.split(/(\s+)/).filter(function(w){return w&&w.length}).map(function(w){var E=w.match(a),g=(E=E?E[1]:w).substr(0,y);return o.test(E)?'<a href="'+E+'"'+S+">"+g+"</a>":c.test(E)?'<a href="http://'+E+'"'+S+">"+g+"</a>":u.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){return n(d=parseFloat(d))?y:d},yt.makeMacro(["value","default","base"],[],function(d,y,_){return _===void 0&&(_=10),n(d=parseInt(d,_))?y:d}));t.int=m,t.d=t.default,t.e=t.escape}),Y7={};function IV(t,e){for(var n=0,l=t.length-1;0<=l;l--){var r=t[l];r==="."?t.splice(l,1):r===".."?(t.splice(l,1),n++):n&&(t.splice(l,1),n--)}if(e)for(;n--;)t.unshift("..");return t}var j_e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,sE=function(t){return j_e.exec(t).slice(1)};function aE(){for(var t="",e=!1,n=arguments.length-1;-1<=n&&!e;n--){var l=0<=n?arguments[n]:"/";if(typeof l!="string")throw new TypeError("Arguments to path.resolve must be strings");l&&(t=l+"/"+t,e=l.charAt(0)==="/")}return(e?"/":"")+IV(ib(t.split("/"),function(r){return!!r}),!e).join("/")||"."}function OB(t){var e=RV(t),n=U_e(t,-1)==="/";return(t=(t=IV(ib(t.split("/"),function(l){return!!l}),!e).join("/"))||e?t:".")&&n&&(t+="/"),(e?"/":"")+t}function RV(t){return t.charAt(0)==="/"}var n4={extname:function(t){return sE(t)[3]},basename:function(t,e){return t=sE(t)[2],e&&t.substr(-1*e.length)===e?t.substr(0,t.length-e.length):t},dirname:function(n){var e=(n=sE(n))[0],n=n[1];return e||n?e+(n&&n.substr(0,n.length-1)):"."},sep:"/",delimiter:":",relative:function(t,e){function n(o){for(var c=0;c<o.length&&o[c]==="";c++);for(var f=o.length-1;0<=f&&o[f]==="";f--);return f<c?[]:o.slice(c,f-c+1)}t=aE(t).substr(1),e=aE(e).substr(1);for(var l=n(t.split("/")),r=n(e.split("/")),i=Math.min(l.length,r.length),s=i,a=0;a<i;a++)if(l[a]!==r[a]){s=a;break}for(var u=[],a=s;a<l.length;a++)u.push("..");return(u=u.concat(r.slice(s))).join("/")},join:function(){return OB(ib(Array.prototype.slice.call(arguments,0),function(t,e){if(typeof t!="string")throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},isAbsolute:RV,normalize:OB,resolve:aE};function ib(t,e){if(t.filter)return t.filter(e);for(var n=[],l=0;l<t.length;l++)e(t[l],l,t)&&n.push(t[l]);return n}var U_e="ab".substr(-1)==="b"?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)};function kV(t,e){return(kV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}var sb=function(t){var e;function n(){return t.apply(this,arguments)||this}e=t,(l=n).prototype=Object.create(e.prototype),kV(l.prototype.constructor=l,e);var l=n.prototype;return l.resolve=function(r,i){return n4.resolve(n4.dirname(r),i)},l.isRelative=function(r){return r.indexOf("./")===0||r.indexOf("../")===0},n}(a4.EmitterObj);function DV(t,e){return(DV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}var M_e=function(t){var e,n;function l(r){var i;return(i=t.call(this)||this).precompiled=r||{},i}return n=t,(e=l).prototype=Object.create(n.prototype),DV(e.prototype.co
2024-05-06 10:35:10 +08:00
/* [wrapped with `+L+`] */
2024-09-23 11:52:18 +08:00
`)):C}(A,function(C,L){return Jl(m,function(z){var K="_."+z[0];L&z[1]&&!cr(C,K)&&C.push(K)}),C.sort()}(function(){var C=A.match(a3);return C?C[1].split(pl):[]}(),b)))}function Yx(p){var h=0,b=0;return function(){var A=ZZ(),C=16-(A-b);if(b=A,0<C){if(800<=++h)return arguments[0]}else h=0;return p.apply(n,arguments)}}function R8(p,h){var b=-1,A=p.length,C=A-1;for(h=h===n?A:h;++b<h;){var L=Qf(b,C),z=p[L];p[L]=p[b],p[b]=z}return p.length=h,p}var Qx=function(){var p=L8(function(b){var A=[];return b.charCodeAt(0)===46&&A.push(""),b.replace(dt,function(C,L,z,K){A.push(z?K.replace(v2,"$1"):L||C)}),A},function(b){return h.size===500&&h.clear(),b}),h=p.cache;return p}();function zr(p){var h;return typeof p=="string"||C3(p)?p:(h=p+"")=="0"&&1/p==-1/0?"-0":h}function pu(p){if(p!=null){try{return u8.call(p)}catch{}try{return p+""}catch{}}return""}function Zx(p){var h;return p instanceof Xt?p.clone():((h=new fr(p.__wrapped__,p.__chain__)).__actions__=u3(p.__actions__),h.__index__=p.__index__,h.__values__=p.__values__,h)}function eA(p,h,b){var A=p==null?0:p.length;return A?((b=b==null?0:At(b))<0&&(b=Xl(A+b,0)),Mr(p,ut(h,3),b)):-1}function tA(p,h,b){var A,C=p==null?0:p.length;return C?(A=C-1,b!==n&&(A=At(b),A=b<0?Xl(C+A,0):I2(A,C-1)),Mr(p,ut(h,3),A,!0)):-1}function nA(p){return p!=null&&p.length?E2(p,1):[]}function lA(p){return p&&p.length?p[0]:n}function V3(p){var h=p==null?0:p.length;return h?p[h-1]:n}function rA(p,h){return p&&p.length&&h&&h.length?Yf(p,h):p}$f=It(function(p,h){return Dl(p)?W4(p,E2(h,1,Dl,!0)):[]}),Hr=It(function(p,h){var b=V3(h);return Dl(b)&&(b=n),Dl(p)?W4(p,E2(h,1,Dl,!0),ut(b,2)):[]}),G4=It(function(p,h){var b=V3(h);return Dl(b)&&(b=n),Dl(p)?W4(p,E2(h,1,Dl,!0),n,b):[]}),Zt=It(function(p){var h=on(p,ld);return h.length&&h[0]===p[0]?Jf(h):[]}),No=It(function(p){var h=V3(p),b=on(p,ld);return h===V3(b)?h=n:b.pop(),b.length&&b[0]===p[0]?Jf(b,ut(h,2)):[]}),Bf=It(function(p){var h=V3(p),b=on(p,ld);return(h=typeof h=="function"?h:n)&&b.pop(),b.length&&b[0]===p[0]?Jf(b,n,h):[]}),R2=It(rA);var hee=Ii(function(p,h){var b=p==null?0:p.length,A=Vf(p,h);return gx(p,on(h,function(C){return Ri(C,b)?+C:C}).sort(Ox)),A});function vd(p){return p==null?p:tee.call(p)}var mee=It(function(p){return fs(E2(p,1,Dl,!0))}),yee=It(function(p){var h=V3(p);return Dl(h)&&(h=n),fs(E2(p,1,Dl,!0),ut(h,2))}),gee=It(function(p){var h=typeof(h=V3(p))=="function"?h:n;return fs(E2(p,1,Dl,!0),n,h)});function _d(p){var h;return p&&p.length?(h=0,p=a2(p,function(b){if(Dl(b))return h=Xl(b.length,h),!0}),n8(h,function(b){return on(p,$r(b))})):[]}function iA(p,h){return p&&p.length?(p=_d(p),h==null?p:on(p,function(b){return s2(h,n,b)})):[]}var vee=It(function(p,h){return Dl(p)?W4(p,h):[]}),_ee=It(function(p){return nd(a2(p,Dl))}),Eee=It(function(p){var h=V3(p);return Dl(h)&&(h=n),nd(a2(p,Dl),ut(h,2))}),bee=It(function(p){var h=typeof(h=V3(p))=="function"?h:n;return nd(a2(p,Dl),n,h)}),wee=It(_d),See=It(function(p){var h=typeof(h=1<(h=p.length)?p[h-1]:n)=="function"?(p.pop(),h):n;return iA(p,h)});function sA(p){return(p=R(p)).__chain__=!0,p}function k8(p,h){return h(p)}var Tee=Ii(function(p){function h(L){return Vf(L,p)}var b=p.length,A=b?p[0]:0,C=this.__wrapped__;return!(1<b||this.__actions__.length)&&C instanceof Xt&&Ri(A)?((C=C.slice(A,+A+(b?1:0))).__actions__.push({func:k8,args:[h],thisArg:n}),new fr(C,this.__chain__).thru(function(L){return b&&!L.length&&L.push(n),L})):this.thru(h)}),xee=T8(function(p,h,b){Jn.call(p,b)?++p[b]:Ni(p,b,1)}),Aee=Dx(eA),Oee=Dx(tA);function aA(p,h){return(St(p)?Jl:ps)(p,ut(h,3))}function uA(p,h){return(St(p)?function(b,A){for(var C=b==null?0:b.length;C--&&A(b[C],C,b)!==!1;);return b}:rx)(p,ut(h,3))}var Nee=T8(function(p,h,b){Jn.call(p,b)?p[b].push(h):Ni(p,b,[h])}),Cee=It(function(p,h,b){var A=-1,C=typeof h=="function",L=o3(p)?he(p.length):[];return ps(p,function(z){L[++A]=C?s2(h,z,b):Y4(z,h,b)}),L}),Iee=T8(function(p,h,b){Ni(p,b,h)});function D8(p,h){return(St(p)?on:px)(p,ut(h,3))}var Ree=T8(function(p,h,b){p[b?0:1].push(h)},function(){return[[],[]]}),kee=It(function(p,h){var b;return p==null?[]:(1<(b=h.length)&&X2(p,h[0],h[1])?h=
2024-05-23 19:28:35 +08:00
`;if(p.replace(fe,function(Ee,_e,Te,nt,Re,ke){return Te=Te||nt,pe+=p.slice(K,ke).replace(Bl,HT),_e&&(A=!0,pe+=`' +
2024-05-06 10:35:10 +08:00
__e(`+_e+`) +
2024-05-23 19:28:35 +08:00
'`),Re&&(C=!0,pe+=`';
`+Re+`;
2024-05-13 09:18:33 +08:00
__p += '`),Te&&(pe+=`' +
((__t = (`+Te+`)) == null ? '' : __t) +
2024-05-23 19:28:35 +08:00
'`),K=ke+Ee.length,Ee}),pe+=`';
`,le=Jn.call(h,"variable")&&h.variable){if(wl.test(le))throw new lt("Invalid `variable` option passed into `_.template`")}else pe=`with (obj) {
2024-05-06 10:35:10 +08:00
`+pe+`
2024-04-02 15:03:09 +08:00
}
2024-05-29 18:58:23 +08:00
`;if(pe=(C?pe.replace(Tt,""):pe).replace(Ye,"$1").replace(ft,"$1;"),pe="function("+(le||"obj")+`) {
2024-05-07 17:30:00 +08:00
`+(le?"":`obj || (obj = {});
2024-05-06 10:35:10 +08:00
`)+"var __t, __p = ''"+(A?", __e = _.escape":"")+(C?`, __j = Array.prototype.join;
2024-04-02 15:03:09 +08:00
function print() { __p += __j.call(arguments, '') }
2024-05-06 10:35:10 +08:00
`:`;
`)+pe+`return __p
2024-09-23 11:52:18 +08:00
}`,(fe=CA(function(){return wt(L,xe+"return "+pe).apply(n,z)})).source=pe,Td(fe))throw fe;return fe},R.times=function(p,h){if((p=At(p))<1||o<p)return[];var b=f,A=I2(p,f);for(h=ut(h),p-=f,A=n8(A,h);++b<p;)h(b);return A},R.toFinite=Di,R.toInteger=At,R.toLength=_A,R.toLower=function(p){return hn(p).toLowerCase()},R.toNumber=z3,R.toSafeInteger=function(p){return p?uu(At(p),-9007199254740991,o):p===0?p:0},R.toString=hn,R.toUpper=function(p){return hn(p).toUpperCase()},R.trim=function(p,h,b){return(p=hn(p))&&(b||h===n)?Ti(p):p&&(h=N3(h))?hs(b=pr(p),l8(b,h=pr(h)),r8(b,h)+1).join(""):p},R.trimEnd=function(p,h,b){return(p=hn(p))&&(b||h===n)?p.slice(0,VT(p)+1):p&&(h=N3(h))?hs(b=pr(p),0,r8(b,pr(h))+1).join(""):p},R.trimStart=function(p,h,b){return(p=hn(p))&&(b||h===n)?p.replace(bl,""):p&&(h=N3(h))?hs(b=pr(p),l8(b,pr(h))).join(""):p},R.truncate=function(p,C){var b,z=30,A="...",C=(ml(C)&&(b="separator"in C?C.separator:b,z="length"in C?At(C.length):z,A="omission"in C?N3(C.omission):A),(p=hn(p)).length);if((C=lu(p)?(L=pr(p)).length:C)<=z)return p;if((C=z-xo(A))<1)return A;var L,z=L?hs(L,0,C).join(""):p.slice(0,C);if(b!==n)if(L&&(C+=z.length-C),xd(b)){if(p.slice(C).search(b)){var K,le=z;for((b=b.global?b:ru(b.source,hn(F3.exec(b))+"g")).lastIndex=0;K=b.exec(le);)var pe=K.index;z=z.slice(0,pe===n?C:pe)}}else p.indexOf(N3(b),C)!=C&&-1<(L=z.lastIndexOf(b))&&(z=z.slice(0,L));return z+A},R.unescape=function(p){return(p=hn(p))&&$t.test(p)?p.replace(qe,zZ):p},R.uniqueId=function(p){var h=++JZ;return hn(p)+h},R.upperCase=lte,R.upperFirst=Nd,R.each=aA,R.eachRight=uA,R.first=lA,Rd(R,(Ld={},Vr(R,function(p,h){Jn.call(R.prototype,h)||(Ld[h]=p)}),Ld),{chain:!1}),R.VERSION="4.17.21",Jl(["bind","bindKey","curry","curryRight","partial","partialRight"],function(p){R[p].placeholder=R}),Jl(["drop","take"],function(p,h){Xt.prototype[p]=function(b){b=b===n?1:Xl(At(b),0);var A=this.__filtered__&&!h?new Xt(this):this.clone();return A.__filtered__?A.__takeCount__=I2(b,A.__takeCount__):A.__views__.push({size:I2(b,f),type:p+(A.__dir__<0?"Right":"")}),A},Xt.prototype[p+"Right"]=function(b){return this.reverse()[p](b).reverse()}}),Jl(["filter","map","takeWhile"],function(p,h){var b=h+1,A=b==1||b==3;Xt.prototype[p]=function(C){var L=this.clone();return L.__iteratees__.push({iteratee:ut(C,3),type:b}),L.__filtered__=L.__filtered__||A,L}}),Jl(["head","last"],function(p,h){var b="take"+(h?"Right":"");Xt.prototype[p]=function(){return this[b](1).value()[0]}}),Jl(["initial","tail"],function(p,h){var b="drop"+(h?"":"Right");Xt.prototype[p]=function(){return this.__filtered__?new Xt(this):this[b](1)}}),Xt.prototype.compact=function(){return this.filter(p3)},Xt.prototype.find=function(p){return this.filter(p).head()},Xt.prototype.findLast=function(p){return this.reverse().find(p)},Xt.prototype.invokeMap=It(function(p,h){return typeof p=="function"?new Xt(this):this.map(function(b){return Y4(b,p,h)})}),Xt.prototype.reject=function(p){return this.filter(F8(ut(p)))},Xt.prototype.slice=function(p,h){p=At(p);var b=this;return b.__filtered__&&(0<p||h<0)?new Xt(b):(p<0?b=b.takeRight(-p):p&&(b=b.drop(p)),h!==n?(h=At(h))<0?b.dropRight(-h):b.take(h-p):b)},Xt.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},Xt.prototype.toArray=function(){return this.take(f)},Vr(Xt.prototype,function(p,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),A=/^(?:head|last)$/.test(h),C=R[A?"take"+(h=="last"?"Right":""):h],L=A||/^find/.test(h);C&&(R.prototype[h]=function(){function z(nt){return nt=C.apply(R,Ur([nt],pe)),A&&xe?nt[0]:nt}var K,le=this.__wrapped__,pe=A?[1]:arguments,Te=le instanceof Xt,Ee=pe[0],fe=Te||St(le),xe=(fe&&b&&typeof Ee=="function"&&Ee.length!=1&&(Te=fe=!1),this.__chain__),Ee=!!this.__actions__.length,_e=L&&!xe,Te=Te&&!Ee;return!L&&fe?(le=Te?le:new Xt(this),(K=p.apply(le,pe)).__actions__.push({func:k8,args:[z],thisArg:n}),new fr(K,xe)):_e&&Te?p.apply(this,pe):(K=this.thru(z),_e?A?K.value()[0]:K.value():K)})}),Jl(["pop","push","shift","sort","splice","unshift"],function(p){var h=a8[p],b=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",A=/^(?:pop|shif
2024-05-29 18:58:23 +08:00
`)){let u=a.trim();if(u)if(u.startsWith("#")){if(u.startsWith("#EXT")){let o=mEe(u,i);o&&s.push(o)}}else s.push(u)}return s.length!==0&&s[0].name==="EXTM3U"||Be("The EXTM3U tag MUST be the first line."),s}(t,e),l=yEe(n,e);return l.source=t,l}var gEe=["#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"],vEe=["#EXT-X-MEDIA"],Sb=class extends Array{constructor(e){super(),this.baseUri=e}push(...e){for(let n of e)if(n.startsWith("#"))if(gEe.some(l=>n.startsWith(l)))super.push(n);else{if(this.includes(n)){if(vEe.some(l=>n.startsWith(l)))continue;Be(`Redundant item (${n})`)}super.push(n)}else super.push(n);return this.length}};function Ob(t,e){let n=1e3;e&&(n=Math.pow(10,e));let l=Math.round(t*n)/n;return e?l.toFixed(e):l}function _Ee(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 cq(t,e){let n=e?"#EXT-X-SESSION-KEY":"#EXT-X-KEY",l=[`METHOD=${t.method}`];return t.uri&&l.push(`URI="${t.uri}"`),t.iv&&(t.iv.length!==16&&Be("IV must be a 128-bit unsigned integer"),l.push(`IV=${aq(t.iv)}`)),t.format&&l.push(`KEYFORMAT="${t.format}"`),t.formatVersion&&l.push(`KEYFORMATVERSIONS="${t.formatVersion}"`),`${n}:${l.join(",")}`}function EEe(t,e){let n=e.isIFrameOnly?"#EXT-X-I-FRAME-STREAM-INF":"#EXT-X-STREAM-INF",l=[`BANDWIDTH=${e.bandwidth}`];if(e.averageBandwidth&&l.push(`AVERAGE-BANDWIDTH=${e.averageBandwidth}`),e.isIFrameOnly&&l.push(`URI="${e.uri}"`),e.codecs&&l.push(`CODECS="${e.codecs}"`),e.resolution&&l.push(`RESOLUTION=${e.resolution.width}x${e.resolution.height}`),e.frameRate&&l.push(`FRAME-RATE=${Ob(e.frameRate,3)}`),e.hdcpLevel&&l.push(`HDCP-LEVEL=${e.hdcpLevel}`),e.audio.length>0){l.push(`AUDIO="${e.audio[0].groupId}"`);for(let r of e.audio)t.push(Op(r))}if(e.video.length>0){l.push(`VIDEO="${e.video[0].groupId}"`);for(let r of e.video)t.push(Op(r))}if(e.subtitles.length>0){l.push(`SUBTITLES="${e.subtitles[0].groupId}"`);for(let r of e.subtitles)t.push(Op(r))}if(sEe().allowClosedCaptionsNone&&e.closedCaptions.length===0)l.push("CLOSED-CAPTIONS=NONE");else if(e.closedCaptions.length>0){l.push(`CLOSED-CAPTIONS="${e.closedCaptions[0].groupId}"`);for(let r of e.closedCaptions)t.push(Op(r))}if(e.score&&l.push(`SCORE=${e.score}`),e.allowedCpc){let r=[];for(let{format:i,cpcList:s}of e.allowedCpc)r.push(`${i}:${s.join("/")}`);l.push(`ALLOWED-CPC="${r.join(",")}"`)}e.videoRange&&l.push(`VIDEO-RANGE=${e.videoRange}`),e.stableVariantId&&l.push(`STABLE-VARIANT-ID="${e.stableVariantId}"`),e.programId&&l.push(`PROGRAM-ID=${e.programId}`),t.push(`${n}:${l.join(",")}`),e.isIFrameOnly||t.push(`${e.uri}`)}function Op(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 bEe(t,e,n,l,r=1,i=null){let s=!1,a="";if(e.discontinuity&&t.push("#EXT-X-DISCONTINUITY"),e.key){let o=cq(e.key);o!==n&&(t.push(o),n=o)}if(e.map){let o=function(c){let f=[`URI="${c.uri}"`];return c.byterange&&f.push(`BYTERANGE="${_b(c.byterange)}"`),`#EXT-X-MAP:${f.join(",")}`}(e.map);o!==l&&(t.push(o),l=o)}if(e.programDateTime&&t.push(`#EXT-X-PROGRAM-DATE-TIME:${vb(e.programDateTime)}`),e.dateRange&&t.push(function(o){let c=[`ID="${o.id}"`];o.start&&c.push(`START-DATE="${vb(o.start)}"`),o.end&&c.push(`END-DATE="${vb(o.end)}"`),o.duration&&c.push(`DURATION=${o.duration}`),o.plannedDuration&&c.push(`PLANNED-DURATION=${o.plannedDuration}`),o.classId&&c.push(`CLASS="${o.classId}"`),o.endOnNext&&
`)}var fq="hls_cache",Bp=[],io={},b6={},ro={},$p="";function wEe(t,e){if(Bp.push(t),io[t]=e,Bp.length>5){let n=Bp.shift();SEe(n)}}function SEe(t){delete io[t],delete Bp[t],new JSFile(fq+"/"+t).delete()}function TEe(t,e){if(e.variants)for(let n of e.variants)n.uri.startsWith("http")||(n.uri=Nb(t,n.uri));if(e.segments)for(let n of e.segments)n.uri.startsWith("http")||(n.uri=Nb(t,n.uri)),n.key&&n.key.uri&&!n.key.uri.startsWith("http")&&(n.key.uri=Nb(t,n.key.uri));return e}async function dq(t,e){let n=md5X(t);if(io[n])return io[n];let l={},r=t;for(;l=await req(r,{headers:e,redirect:0}),l.headers.location;)r=l.headers.location;if(l.code==200){var i=l.content;let s=TEe(r,oq(i));return wEe(n,{code:l.code,plist:s,key:n,headers:l.headers}),io[n]}return{}}async function hq(t,e,n){if(!io[t])return{};let r=io[t].plist.segments,i=!ro[t];if(i){ro[t]={};for(let c of r){let f=md5X(c.uri+c.mediaSequenceNumber.toString());ro[t][f]={file:fq+"/"+t+"/"+f,uri:c.uri,key:f,index:c.mediaSequenceNumber,order:c.mediaSequenceNumber,state:-1,read:!1}}}for(let c in ro[t]){let f=ro[t][c];f.index>=e?f.order=f.index-e:f.order=r.length-e+f.index}i&&xEe(t,5,n);let s=r[e],a=md5X(s.uri+s.mediaSequenceNumber.toString()),u=ro[t][a];if(u.state==1||u.state==-1){let c=new JSFile(u.file);if(await c.exist())return u.state=1,{buffer:3,code:200,headers:{connection:"close","content-type":"video/mp2t"},content:c};u.state=-1}if(u.state==-1&&mq(t,u,n),u.state==0){var o=new JSProxyStream;o.head(200,{connection:"close","content-type":"video/mp2t"});let c=0;return u.read=!0,new Promise(async function(f,m){let d=new JSFile(u.file+".dl");await d.open("r"),async function y(){let _=await d.size();if(_>c){var S=await d.read(_-c,c);await o.write(S),c=_}if(u.state==1||u.state<0){o.done(),await d.close(),await d.delete(),u.read=!1,f();return}setTimeout(y,5)}()}),{buffer:3,content:o}}}async function mq(t,e,n){if(e.state>=0||!b6[t])return;if(e.state=0,await new JSFile(e.file).exist()){e.state=1;return}let l=new JSFile(e.file+".dl");await l.open("w");let r=await req(e.uri,{buffer:3,headers:n,stream:l,timeout:[5e3,1e4]});if(r.error||r.code>=300){await l.close(),e.read||await l.delete(),e.state=-1;return}await l.close(),e.read?await l.copy(e.file):await l.move(e.file),e.state=1}async function xEe(t,e,n){$p&&$p!=t&&delete b6[$p],$p=t,b6[t]=!0;for(let l=0;l<e&&b6[t];l++)new Promise(function(r,i){(async function s(){if(!b6[t]){r();return}let a=M.pickBy(ro[t],function(o){return o.state==-1}),u=M.minBy(Object.values(a),function(o){return o.order});if(!u){r();return}await mq(t,u,n),setTimeout(s,5)})()})}function Nb(t,e){var n=t.split("/"),l=e.split("/");n.pop();for(var r=0;r<l.length;r++)l[r]!="."&&(l[r]==".."?n.pop():n.push(l[r]));return n.join("/")}function yq(t){let e=[];return Array.from(t.danmuku).forEach(n=>{let l=Number(n[0]),r=n[4];e.push(`<d p="${l},1,25,16777215,1659282294,0,8b53b65c,1108899274487246080"><![CDATA[${r}]]></d>`)}),String.raw`<?xml version="1.0" encoding="UTF-8"?><i><chatserver>chat.bilibili.com</chatserver><chatid>52175602</chatid><mission>0</mission><maxlimit>1000</maxlimit><state>0</state><real_name>0</real_name><source>k-v</source>`+e.join("")+"</i>"}var Hp=class{constructor(){this.siteUrl="https://search.youku.com",this.reconnectTimes=0,this.maxReconnectTimes=5,this.jadeLog=new nr(this.getAppName(),"DEBUG")}getAppName(){return"\u5F39\u5E55"}getHeader(){return{"User-Agent":ql,Referer:this.siteUrl+"/"}}async reconnnect(e,n,l,r,i,s){return await this.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u8BF7\u68C0\u67E5url:"+e+",\u4E24\u79D2\u540E\u91CD\u8BD5"),Rr(2),this.reconnectTimes<this.maxReconnectTimes?(this.reconnectTimes=this.reconnectTimes+1,await this.fetch(e,n,l,r,i,s)):(await this.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u91CD\u8FDE\u5931\u8D25"),null)}async getResponse(e,n,l,r,i,s,a){return a.headers.location!==void 0?r?(await this.jadeLog.debug(`\u8FD4\u56DE\u91CD\u5B9A\u5411\u8FDE\u63A5:${a.headers.location}`),a.headers.location):this.fetch(a.headers.location,n,l,r,i,s):a.content.length>0?(this.reconnectTimes=0,i?{cookie:a.headers["set-cookie"],content:a.conten
`).forEach(function(s){r=s.indexOf(":"),n=s.substring(0,r).trim().toLowerCase(),l=s.substring(r+1).trim(),!(!n||e[n]&&gTe[n])&&(n==="set-cookie"?e[n]?e[n].push(l):e[n]=[l]:e[n]=e[n]?e[n]+", "+l:l)}),e};var LJ=Symbol("internals");function F6(t){return t&&String(t).trim().toLowerCase()}function Ef(t){return t===!1||t==null?t:Z.isArray(t)?t.map(Ef):String(t)}function vTe(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,l;for(;l=n.exec(t);)e[l[1]]=l[2];return e}var _Te=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function xw(t,e,n,l,r){if(Z.isFunction(l))return l.call(this,e,n);if(r&&(e=n),!!Z.isString(e)){if(Z.isString(l))return e.indexOf(l)!==-1;if(Z.isRegExp(l))return l.test(e)}}function ETe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,l)=>n.toUpperCase()+l)}function bTe(t,e){let n=Z.toCamelCase(" "+e);["get","set","has"].forEach(l=>{Object.defineProperty(t,l+n,{value:function(r,i,s){return this[l].call(this,e,r,i,s)},configurable:!0})})}var P4=class{constructor(e){e&&this.set(e)}set(e,n,l){let r=this;function i(a,u,o){let c=F6(u);if(!c)throw new Error("header name must be a non-empty string");let f=Z.findKey(r,c);(!f||r[f]===void 0||o===!0||o===void 0&&r[f]!==!1)&&(r[f||u]=Ef(a))}let s=(a,u)=>Z.forEach(a,(o,c)=>i(o,c,u));return Z.isPlainObject(e)||e instanceof this.constructor?s(e,n):Z.isString(e)&&(e=e.trim())&&!_Te(e)?s(PJ(e),n):e!=null&&i(n,e,l),this}get(e,n){if(e=F6(e),e){let l=Z.findKey(this,e);if(l){let r=this[l];if(!n)return r;if(n===!0)return vTe(r);if(Z.isFunction(n))return n.call(this,r,l);if(Z.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=F6(e),e){let l=Z.findKey(this,e);return!!(l&&this[l]!==void 0&&(!n||xw(this,this[l],l,n)))}return!1}delete(e,n){let l=this,r=!1;function i(s){if(s=F6(s),s){let a=Z.findKey(l,s);a&&(!n||xw(l,l[a],a,n))&&(delete l[a],r=!0)}}return Z.isArray(e)?e.forEach(i):i(e),r}clear(e){let n=Object.keys(this),l=n.length,r=!1;for(;l--;){let i=n[l];(!e||xw(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let n=this,l={};return Z.forEach(this,(r,i)=>{let s=Z.findKey(l,i);if(s){n[s]=Ef(r),delete n[i];return}let a=e?ETe(i):String(i).trim();a!==i&&delete n[i],n[a]=Ef(r),l[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let n=Object.create(null);return Z.forEach(this,(l,r)=>{l!=null&&l!==!1&&(n[r]=e&&Z.isArray(l)?l.join(", "):l)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){let l=new this(e);return n.forEach(r=>l.set(r)),l}static accessor(e){let l=(this[LJ]=this[LJ]={accessors:{}}).accessors,r=this.prototype;function i(s){let a=F6(s);l[a]||(bTe(r,s),l[a]=!0)}return Z.isArray(e)?e.forEach(i):i(e),this}};P4.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Z.reduceDescriptors(P4.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(l){this[n]=l}}});Z.freezeMethods(P4);var l2=P4;function j6(t,e){let n=this||D4,l=e||n,r=l2.from(l.headers),i=l.data;return Z.forEach(t,function(a){i=a.call(n,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function U6(t){return!!(t&&t.__CANCEL__)}function FJ(t,e,n){Ve.call(this,t??"canceled",Ve.ERR_CANCELED,e,n),this.name="CanceledError"}Z.inherits(FJ,Ve,{__CANCEL__:!0});var Dr=FJ;function sa(t,e,n){let l=n.config.validateStatus;!n.status||!l||l(n.status)?t(n):e(new Ve("Request failed with status code "+n.status,[Ve.ERR_BAD_REQUEST,Ve.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Aw(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ow(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function mo(t,e){return t&&!Aw(e)?Ow(t,e):e}var iK=Wl(UJ(),1),sK=Wl(require("http"),1),aK=Wl(require("https"),1),uK=Wl(require("util"),1),oK=Wl(zJ(),1),ss=Wl(require("zlib"),1);var go="1.6.7";function q6(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var UTe=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function $w(t,e,n){let l=n&&n.Blob||n2.classes.Blob,r=q6(t);if(e===void 0&&l&&(e=!0),r==="data"){t=r.length?t.slice(r.length+1):t;let i=UTe.exec(t);if(!i)throw new Ve("Invalid URL",Ve.ERR_INVALID_URL);let s=i[1],a=i[2],u=i[3],o=Buffer.from(decodeURIComponent(u),a?"base64":"utf8");if(e){if(!l)throw new Ve("Blob is not supported",Ve.ERR_NOT_SUPPORT);return new l([o],{type:s})}return o}throw new Ve("Unsupported protocol "+r,Ve.ERR_NOT_SUPPORT)}var vo=Wl(require("stream"),1);var JJ=Wl(require("stream"),1);function MTe(t,e){let n=0,l=1e3/e,r=null;return function(s,a){let u=Date.now();if(s||u-n>l)return r&&(clearTimeout(r),r=null),n=u,t.apply(null,a);r||(r=setTimeout(()=>(r=null,n=Date.now(),t.apply(null,a)),l-(u-n)))}}var GJ=MTe;function $Te(t,e){t=t||10;let n=new Array(t),l=new Array(t),r=0,i=0,s;return e=e!==void 0?e:1e3,function(u){let o=Date.now(),c=l[i];s||(s=o),n[r]=u,l[r]=o;let f=i,m=0;for(;f!==r;)m+=n[f++],f=f%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),o-s<e)return;let d=c&&o-c;return d?Math.round(m*1e3/d):void 0}}var bf=$Te;var wf=Symbol("internals"),Bw=class extends JJ.default.Transform{constructor(e){e=Z.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(a,u)=>!Z.isUndefined(u[a])),super({readableHighWaterMark:e.chunkSize});let n=this,l=this[wf]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},r=bf(l.ticksRate*e.samplesCount,l.timeWindow);this.on("newListener",a=>{a==="progress"&&(l.isCaptured||(l.isCaptured=!0))});let i=0;l.updateProgress=GJ(function(){let u=l.length,o=l.bytesSeen,c=o-i;if(!c||n.destroyed)return;let f=r(c);i=o,process.nextTick(()=>{n.emit("progress",{loaded:o,total:u,progress:u?o/u:void 0,bytes:c,rate:f||void 0,estimated:f&&u&&o<=u?(u-o)/f:void 0})})},l.ticksRate);let s=()=>{l.updateProgress(!0)};this.once("end",s),this.once("error",s)}_read(e){let n=this[wf];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,l){let r=this,i=this[wf],s=i.maxRate,a=this.readableHighWaterMark,u=i.timeWindow,o=1e3/u,c=s/o,f=i.minChunkSize!==!1?Math.max(i.minChunkSize,c*.01):0;function m(y,_){let S=Buffer.byteLength(y);i.bytesSeen+=S,i.bytes+=S,i.isCaptured&&i.updateProgress(),r.push(y)?process.nextTick(_):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTic
`,VTe=z6.encode(aa),qTe=2,Vw=class{constructor(e,n){let{escapeName:l}=this.constructor,r=Z.isString(n),i=`Content-Disposition: form-data; name="${l(e)}"${!r&&n.name?`; filename="${l(n.name)}"`:""}${aa}`;r?n=z6.encode(String(n).replace(/\r?\n|\r\n?/g,aa)):i+=`Content-Type: ${n.type||"application/octet-stream"}${aa}`,this.headers=z6.encode(i+aa),this.contentLength=r?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+qTe,this.name=e,this.value=n}async*encode(){yield this.headers;let{value:e}=this;Z.isTypedArray(e)?yield e:yield*Sf(e),yield VTe}static escapeName(e){return String(e).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},zTe=(t,e,n)=>{let{tag:l="form-data-boundary",size:r=25,boundary:i=l+"-"+Z.generateString(r,HTe)}=n||{};if(!Z.isFormData(t))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let s=z6.encode("--"+i+aa),a=z6.encode("--"+i+"--"+aa+aa),u=a.byteLength,o=Array.from(t.entries()).map(([f,m])=>{let d=new Vw(f,m);return u+=d.size,d});u+=s.byteLength*o.length,u=Z.toFiniteNumber(u);let c={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(u)&&(c["Content-Length"]=u),e&&e(c),WJ.Readable.from(async function*(){for(let f of o)yield s,yield*f.encode();yield a}())},YJ=zTe;var QJ=Wl(require("stream"),1),qw=class extends QJ.default.Transform{__transform(e,n,l){this.push(e),l()}_transform(e,n,l){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,n)}this.__transform(e,n,l)}},ZJ=qw;var GTe=(t,e)=>Z.isAsyncFn(t)?function(...n){let l=n.pop();t.apply(this,n).then(r=>{try{e?l(null,...e(r)):l(null,r)}catch(i){l(i)}},l)}:t,eK=GTe;var tK={flush:ss.default.constants.Z_SYNC_FLUSH,finishFlush:ss.default.constants.Z_SYNC_FLUSH},JTe={flush:ss.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:ss.default.constants.BROTLI_OPERATION_FLUSH},nK=Z.isFunction(ss.default.createBrotliDecompress),{http:KTe,https:XTe}=oK.default,WTe=/https:?/,lK=n2.protocols.map(t=>t+":");function YTe(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function pK(t,e,n){let l=e;if(!l&&l!==!1){let r=(0,iK.getProxyForUrl)(n);r&&(l=new URL(r))}if(l){if(l.username&&(l.auth=(l.username||"")+":"+(l.password||"")),l.auth){(l.auth.username||l.auth.password)&&(l.auth=(l.auth.username||"")+":"+(l.auth.password||""));let i=Buffer.from(l.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+i}t.headers.host=t.hostname+(t.port?":"+t.port:"");let r=l.hostname||l.host;t.hostname=r,t.host=r,t.port=l.port,t.path=n,l.protocol&&(t.protocol=l.protocol.includes(":")?l.protocol:`${l.protocol}:`)}t.beforeRedirects.proxy=function(i){pK(i,e,i.href)}}var QTe=typeof process<"u"&&Z.kindOf(process)==="process",ZTe=t=>new Promise((e,n)=>{let l,r,i=(u,o)=>{r||(r=!0,l&&l(u,o))},s=u=>{i(u),e(u)},a=u=>{i(u,!0),n(u)};t(s,a,u=>l=u).catch(a)}),exe=({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)}},rK=(t,e)=>exe(Z.isObject(t)?t:{address:t,family:e}),fK=QTe&&function(e){return ZTe(async function(l,r,i){let{data:s,lookup:a,family:u}=e,{responseType:o,responseEncoding:c}=e,f=e.method.toUpperCase(),m,d=!1,y;if(a){let ee=eK(a,me=>Z.isArray(me)?me:[me]);a=(me,P,G)=>{ee(me,P,(V,q,Yn)=>{if(V)return G(V);let Tt=Z.isArray(q)?q.map(Ye=>rK(Ye)):[rK(q,Yn)];P.all?G(V,Tt):G(V,Tt[0].address,Tt[0].family)})}}let _=new cK.default,S=()=>{e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),_.removeAllListeners()};i((ee,me)=>{m=!0,me&&(d=!0,S())});function w(ee){_.emit("abort",!ee||ee.type?new Dr(null,e,y):ee)}_.once("abort",r),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));let E=mo(e.baseURL,e.url),g=new URL(E,"http://localhost"),v=g.protocol||lK[0];if(v==="data:"){let ee;if(f!=="GET")return sa(l,r,{status:405,stat
`+i.map(gK).join(`
`):" "+gK(i[0]):"as no adapter specified";throw new Ve("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return l},adapters:zw};function Gw(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Dr(null,t)}function xf(t){return Gw(t),t.headers=l2.from(t.headers),t.data=j6.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Tf.getAdapter(t.adapter||D4.adapter)(t).then(function(l){return Gw(t),l.data=j6.call(t,t.transformResponse,l),l.headers=l2.from(l.headers),l},function(l){return U6(l)||(Gw(t),l&&l.response&&(l.response.data=j6.call(t,t.transformResponse,l.response),l.response.headers=l2.from(l.response.headers))),Promise.reject(l)})}var vK=t=>t instanceof l2?t.toJSON():t;function as(t,e){e=e||{};let n={};function l(o,c,f){return Z.isPlainObject(o)&&Z.isPlainObject(c)?Z.merge.call({caseless:f},o,c):Z.isPlainObject(c)?Z.merge({},c):Z.isArray(c)?c.slice():c}function r(o,c,f){if(Z.isUndefined(c)){if(!Z.isUndefined(o))return l(void 0,o,f)}else return l(o,c,f)}function i(o,c){if(!Z.isUndefined(c))return l(void 0,c)}function s(o,c){if(Z.isUndefined(c)){if(!Z.isUndefined(o))return l(void 0,o)}else return l(void 0,c)}function a(o,c,f){if(f in e)return l(o,c);if(f in t)return l(void 0,o)}let u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(o,c)=>r(vK(o),vK(c),!0)};return Z.forEach(Object.keys(Object.assign({},t,e)),function(c){let f=u[c]||r,m=f(t[c],e[c],c);Z.isUndefined(m)&&f!==a||(n[c]=m)}),n}var Jw={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Jw[t]=function(l){return typeof l===t||"a"+(e<1?"n ":" ")+t}});var _K={};Jw.transitional=function(e,n,l){function r(i,s){return"[Axios v"+go+"] Transitional option '"+i+"'"+s+(l?". "+l:"")}return(i,s,a)=>{if(e===!1)throw new Ve(r(s," has been removed"+(n?" in "+n:"")),Ve.ERR_DEPRECATED);return n&&!_K[s]&&(_K[s]=!0,console.warn(r(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}};function lxe(t,e,n){if(typeof t!="object")throw new Ve("options must be an object",Ve.ERR_BAD_OPTION_VALUE);let l=Object.keys(t),r=l.length;for(;r-- >0;){let i=l[r],s=e[i];if(s){let a=t[i],u=a===void 0||s(a,i,t);if(u!==!0)throw new Ve("option "+i+" must be "+u,Ve.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ve("Unknown option "+i,Ve.ERR_BAD_OPTION)}}var Af={assertOptions:lxe,validators:Jw};var ua=Af.validators,F4=class{constructor(e){this.defaults=e,this.interceptors={request:new bw,response:new bw}}async request(e,n){try{return await this._request(e,n)}catch(l){if(l instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;let i=r.stack?r.stack.replace(/^.+\n/,""):"";l.stack?i&&!String(l.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(l.stack+=`
`+i):l.stack=i}throw l}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=as(this.defaults,n);let{transitional:l,paramsSerializer:r,headers:i}=n;l!==void 0&&Af.assertOptions(l,{silentJSONParsing:ua.transitional(ua.boolean),forcedJSONParsing:ua.transitional(ua.boolean),clarifyTimeoutError:ua.transitional(ua.boolean)},!1),r!=null&&(Z.isFunction(r)?n.paramsSerializer={serialize:r}:Af.assertOptions(r,{encode:ua.function,serialize:ua.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&Z.merge(i.common,i[n.method]);i&&Z.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=l2.concat(s,i);let a=[],u=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(u=u&&_.synchronous,a.unshift(_.fulfilled,_.rejected))});let o=[];this.interceptors.response.forEach(function(_){o.push(_.fulfilled,_.rejected)});let c,f=0,m;if(!u){let y=[xf.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,o),m=y.length,c=Promise.resolve(n);f<m;)c=c.then(y[f++],y[f++]);return c}m=a.length;let d=n;for(f=0;f<m;){let y=a[f++],_=a[f++];try{d=y(d)}catch(S){_.call(this,S);break}}try{c=xf.call(this,d)}catch(y){return Promise.reject(y)}for(f=0,m=o.length;f<m;)c=c.then(o[f++],o[f++]);return c}getUri(e){e=as(this.defaults,e);let n=mo(e.baseURL,e.url);return ho(n,e.params,e.paramsSerializer)}};Z.forEach(["delete","get","head","options"],function(e){F4.prototype[e]=function(n,l){return this.request(as(l||{},{method:e,url:n,data:(l||{}).data}))}});Z.forEach(["post","put","patch"],function(e){function n(l){return function(i,s,a){return this.request(as(a||{},{method:e,headers:l?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}F4.prototype[e]=n(),F4.prototype[e+"Form"]=n(!0)});var G6=F4;var Kw=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});let l=this;this.promise.then(r=>{if(!l._listeners)return;let i=l._listeners.length;for(;i-- >0;)l._listeners[i](r);l._listeners=null}),this.promise.then=r=>{let i,s=new Promise(a=>{l.subscribe(a),i=a}).then(r);return s.cancel=function(){l.unsubscribe(i)},s},e(function(i,s,a){l.reason||(l.reason=new Dr(i,s,a),n(l.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new t(function(r){e=r}),cancel:e}}},EK=Kw;function Xw(t){return function(n){return t.apply(null,n)}}function Ww(t){return Z.isObject(t)&&t.isAxiosError===!0}var Yw={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yw).forEach(([t,e])=>{Yw[e]=t});var bK=Yw;function wK(t){let e=new G6(t),n=D6(G6.prototype.request,e);return Z.extend(n,G6.proto
`},timeout:.1}),await dataBase.push(l,eS)}globalThis.localLog={set:async function(t,e,n){hxe(t,e,n)}};function dxe(){_o.default.existsSync("log")||_o.default.mkdirSync("log");let t="log/info.log";return _o.default.existsSync(t)?_o.default.readFileSync(t).toString():(_o.default.writeFileSync(t,""),"")}function hxe(t){_o.default.writeFileSync("log/info.log",dxe()+`
`+t)}globalThis.req=mxe;async function mxe(t,e){try{let n=e&&e.data||null,l=e&&e.postType||null,r=e&&e.buffer||0,i=e&&e.timeout||5e3,s=(e&&e.redirect||1)===1,a=e.proxy??!1,u=e?e.headers||{}:{};l==="form"?(u["Content-Type"]="application/x-www-form-urlencoded",n!=null&&(n=IK.default.stringify(n,{encode:!1}))):l==="form-data"&&(u["Content-Type"]="multipart/form-data",n=SK(n));let o=r===1||r===2?"arraybuffer":void 0,c;a?c=DK.default.httpsOverHttp({proxy:{host:"127.0.0.1",port:7890}}):c=RK.default.Agent({rejectUnauthorized:!1});let f=await j4(t,{responseType:o,method:e&&e.method||"get",headers:u,data:n,timeout:i,maxRedirects:s?null:0,httpsAgent:c});n=f.data;let m={};for(let d of f.headers){let y=d[1];m[d[0]]=Array.isArray(y)&&y.length===1?y[0]:y}if(!r)typeof n=="object"&&(n=JSON.stringify(n));else{if(r===1)return{code:f.status,headers:m,content:n};if(r===2)return{code:f.status,headers:m,content:n.toString("base64")};if(r===3){let d=e.stream;return d.onResp&&await d.onResp({code:f.status,headers:m}),d.onData?(n.on("data",async y=>{await d.onData(y)}),n.on("end",async()=>{d.onDone&&await d.onDone()})):d.onDone&&await d.onDone(),"stream..."}}return{code:f.status,headers:m,content:n}}catch(n){let l=n.response;try{return{code:l.status,headers:l.headers,content:JSON.stringify(l.data)}}catch{return{headers:{},content:""}}}}globalThis.md5X=yxe;function yxe(t){return kK.default.createHash("md5").update(Buffer.from(t,"utf8")).digest("hex")}globalThis.js2Proxy=function(t,e,n){let l=Object.keys(n).length===0?" ":encodeURIComponent(JSON.stringify(n));return t.server.address().dynamic+t.server.prefix+"/proxy/"+encodeURIComponent(e)+"/"+l+"/"};var gxe=["DEBUG","INFO","WARNING","ERROR"];var ca=class{constructor(e,n="DEBUG"){this.app_name=e,this.level=n,this.level_index=gxe.indexOf(n)}format(e,n){let l=80;switch(e){case"INFO":l=l+1;break;case"WARNING":l=l-2;break;default:break}return n.length<l&&((l-n.length)%2===0?n="#".repeat(Math.floor((l-n.length)/2))+n+"#".repeat(Math.floor((l-n.length)/2)):n="#".repeat(Math.floor((l-n.length)/2))+n+"#".repeat(Math.floor((l-n.length)/2)+1)),n}getTime(){let e=new Date;return e.toLocaleDateString().replace(/\//g,"-")+" "+e.toTimeString().substr(0,8)+","+e.getMilliseconds().toString()}formatMessage(e,n,l){return l&&(n=this.format(e,n)),`${this.getTime()} - ${this.app_name} - ${e}: ${n}`}async log(e){console.debug(e),await req("http://127.0.0.1:8099/upload",{data:{log:e+`
2024-09-23 11:52:18 +08:00
`},timeout:.1})}async info(e,n){this.level_index<=1&&await this.log(this.formatMessage("INFO",e,n))}async warning(e,n){this.level_index<=2&&await this.log(this.formatMessage("WARNING",e,n))}async error(e,n){this.level_index<=3&&await this.log(this.formatMessage("ERROR",e,n))}async debug(e,n){this.level_index<=0&&await this.log(this.formatMessage("DEBUG",e,n))}};var De=class extends Fe{constructor(){super(),this.jadeLog=new ca(this.getAppName(),"DEBUG")}async init(e,n){await this.jadeLog.info("\u521D\u59CB\u5316",!0);try{await await req("http://127.0.0.1:8099/clear",{timeout:.1}),this.siteKey=this.getJSName(),this.siteType=this.getType(),this.cfgObj=e.server.config[this.siteKey],this.deviceKey=e.server.prefix+"/",this.db=e.server.db,this.catOpenStatus=!0,this.danmuStaus=!1;try{await this.loadFilterAndClasses()?await this.jadeLog.debug("\u8BFB\u53D6\u7F13\u5B58\u5217\u8868\u548C\u4E8C\u7EA7\u83DC\u5355\u6210\u529F"):(await this.jadeLog.warning("\u8BFB\u53D6\u7F13\u5B58\u5217\u8868\u548C\u4E8C\u7EA7\u83DC\u5355\u5931\u8D25"),await this.writeFilterAndClasses())}catch(l){await this.db.push(this.deviceKey+"classes",{}),await this.db.push(this.deviceKey+"filterObj",{}),await this.jadeLog.error("\u8BFB\u53D6\u7F13\u5B58\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:"+l,!1)}}catch(l){await this.jadeLog.error(`\u521D\u59CB\u5316\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${l}`)}await this.jadeLog.info("\u521D\u59CB\u5316\u5B8C\u6210",!0)}async loadFilterAndClasses(){return this.classes=await this.getClassesCache(),this.filterObj=await this.getFiletObjCache(),this.classes.length>0?!0:(await this.db.push(this.deviceKey+"classes",{}),await this.db.push(this.deviceKey+"filterObj",{}),!1)}async writeFilterAndClasses(){this.catOpenStatus&&this.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await this.setClasses(),await this.setFilterObj(),await this.db.push(this.deviceKey+"classes",this.classes),await this.db.push(this.deviceKey+"filterObj",this.filterObj)}async getClassesCache(){let e=await this.db.getObjectDefault(this.deviceKey+"classes",{});return M.isEmpty(e)?this.classes:e}async getFiletObjCache(){let e=await this.db.getObjectDefault(this.deviceKey+"filterObj",{});return M.isEmpty(e)?this.filterObj:e}async home(e,n){return this.vodList=[],await this.jadeLog.info("\u6B63\u5728\u89E3\u6790\u9996\u9875\u7C7B\u522B",!0),await this.setHome(),await this.jadeLog.debug(`\u9996\u9875\u7C7B\u522B\u5185\u5BB9\u4E3A:${this.result.home(this.classes,[],this.filterObj)}`),await this.jadeLog.info("\u9996\u9875\u7C7B\u522B\u89E3\u6790\u5B8C\u6210",!0),this.result.home(this.classes,[],this.filterObj)}async homeVod(){await this.jadeLog.info("\u6B63\u5728\u89E3\u6790\u9996\u9875\u5185\u5BB9",!0);try{return await this.setHomeVod(),await this.jadeLog.debug(`\u9996\u9875\u5185\u5BB9\u4E3A:${this.result.homeVod(this.homeVodList)}`),await this.jadeLog.info("\u9996\u9875\u5185\u5BB9\u89E3\u6790\u5B8C\u6210",!0),this.result.homeVod(this.homeVodList)}catch(e){await this.jadeLog.error(`\u9996\u9875\u5185\u5BB9\u89E3\u6790\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${e}`)}}async category(e,n){let l=e.body.id,r=e.body.page,i=!0,s=e.body.filters;if(this.page=parseInt(r),await this.jadeLog.info(`\u6B63\u5728\u89E3\u6790\u5206\u7C7B\u9875\u9762,tid = ${l},pg = ${r},extend = ${JSON.stringify(s)}`),l==="\u6700\u8FD1\u66F4\u65B0")return this.page=0,await this.homeVod();try{return this.vodList=[],await this.setCategory(l,r,i,s),await this.jadeLog.debug(`\u5206\u7C7B\u9875\u9762\u5185\u5BB9\u4E3A:${this.result.category(this.vodList,this.page,this.count,this.limit,this.total)}`),await this.jadeLog.info("\u5206\u7C7B\u9875\u9762\u89E3\u6790\u5B8C\u6210",!0),this.result.category(this.vodList,this.page,this.count,this.limit,this.total)}catch(a){await this.jadeLog.error(`\u5206\u7C7B\u9875\u89E3\u6790\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${a}`)}}async detail(e,n){await this.jadeLog.debug(`\u83B7\u53D6\u8BE6\u60C5\u9875\u9762:${JSON.stringify(e.body)}`);let r=(Array.isArray(e.body.id)?e.body.id:[e.body.id])[0];this.vodDetail=new H
2024-05-23 19:28:35 +08:00
`),r=[];for(let m of l)M.isEmpty(m.replaceAll(" ","").replaceAll("/",""))||r.push(m.replaceAll(" ","").replaceAll("/",""));n.type_name=r.slice(0,2).join("*");let i=e('[class="video-info-items"]');n.vod_director=e(i[0]).find("a")[0].children[0].data;let s=e(i[1]).find("a"),a=[];for(let m of s)a.push(m.children[0].data);n.vod_actor=a.join(" * "),n.vod_year=r[2],n.vod_remarks=e(e(i[3]).find(".video-info-item")).text(),n.vod_content=e(e(i[5]).find(".video-info-item")).text(),n.vod_area=r[3],n.vod_content=n.vod_content.replace("[\u6536\u8D77\u90E8\u5206]","").replace("[\u5C55\u5F00\u5168\u90E8]","").replaceAll(" ","").replaceAll(`
2024-09-23 11:52:18 +08:00
`,"");let u=e(e('[class="module-tab-content"]')[0]).find("span"),o=e('[class="module-list module-player-list tab-list sort-list "]'),c=[];for(let m of u)c.push(e(m).text());let f=[];for(let m of o){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=M.values(f).join("$$$"),n}async parseVodShortListFromDocBySearch(e){let n=e(".module-search-item"),l=[];for(let r of n){let i=new Ne;i.vod_id=e(r).find(".video-serial")[0].attribs.href,i.vod_name=e(r).find(".video-serial")[0].attribs.title,i.vod_pic=e(r).find(".module-item-pic > img")[0].attribs["data-src"],i.vod_remarks=e(e(r).find(".video-serial")[0]).text(),l.push(i)}return l}async setClasses(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!M.isEmpty(e)){let n=et(e),l=n(n('[class="nav-menu-items"]')[0]).find("li");for(let r of l.slice(0,6)){let i=n(n(r).find("span")).text();if(i!=="\u9996\u9875"){let a={type_id:n(r).find("a")[0].attribs.href.split("/").slice(-1)[0].split(".")[0],type_name:i};this.classes.push(a)}}}}async getFilter(e){let n=e('[class="scroll-content"]').slice(1),l=[];for(let r=0;r<n.length;r++){let i={key:(r+1).toString(),name:"",value:[]};if(r<n.length-1){i.name=e(e(n[r]).find("a")[0]).text(),i.value.push({n:"\u5168\u90E8",v:"0"});for(let s of e(n[r]).find("a").slice(1))e(e(n[r]).find("a")[0]).text()==="\u5168\u90E8\u7C7B\u578B"?i.value.push({n:e(s).text(),v:s.attribs.href.split("/").slice(-1)[0].split(".")[0]}):i.value.push({n:e(s).text(),v:e(s).text()});l.push(i)}else i.name=e(e(n[r]).find("a")[0]).text(),i.value=[{n:"\u5168\u90E8",v:"0"},{n:e(e(n[r]).find("a")[1]).text(),v:"hits"},{n:e(e(n[r]).find("a")[2]).text(),v:"score"}],l.push(i)}return l}async setFilterObj(){for(let e of this.classes){let n=e.type_id;if(n!=="/"&&n!=="\u6700\u8FD1\u66F4\u65B0"){let l=this.siteUrl+`/vodshow/id/${n}.html`,r=await this.fetch(l,null,this.getHeader());if(r!=null){let i=et(r);this.filterObj[n]=await this.getFilter(i)}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!M.isEmpty(e)){let n=et(e);this.homeVodList=await this.parseVodShortListFromDoc(n)}}getExtend(e,n,l=""){return e!==void 0&&e!=="0"?l+e:n}async getCateUrl(e,n,l){e=this.getExtend(l[1],e);let r=this.getExtend(l[2],"","/area/"),i=this.getExtend(l[3],"","/lang/"),s=this.getExtend(l[4],"","/year/"),a=this.getExtend(l[5],"","/letter/"),u=this.getExtend(l[6],"","/by/");return this.siteUrl+`/vodshow${u}${r}/id/${e}${i}${a}${s}/page/${n}.html`}async setCategory(e,n,l,r){let i=await this.getCateUrl(e,n,r),s=await this.fetch(i,null,this.getHeader());if(!M.isEmpty(s)){let a=et(s);this.vodList=await this.parseVodShortListFromDoc(a);let u=Oe(/\$\("\.mac_total"\)\.text\('(\d+)'\)/,s);this.limit=72,u.length>0&&(this.total=parseInt(u)),this.total<=this.limit?this.count=1:this.count=Math.ceil(this.total/this.limit)}}async setDetail(e){let n=this.siteUrl+e,l=await this.fetch(n,null,this.getHeader());if(!M.isEmpty(l)){let r=et(l);this.vodDetail=await this.parseVodDetailFromDoc(r)}}async setPlay(e,n,l){let r=await this.fetch(this.siteUrl+n,null,this.getHeader());if(!M.isEmpty(r)){let i=Oe(/<script type="text\/javascript">var player_aaaa=(.*?)<\/script>/,r),s=JSON.parse(i);this.playUrl=s.url}}async setSearch(e,n){let l=this.siteUrl+`/vodsearch/wd/${e}.html`,r=await this.fetch(l,null,this.getHeader());if(!M.isEmpty(r)){let i=et(r);this.vodList=await this.parseVodShortListFromDocBySearch(i)}}},vn=new rS;var iS=class extends De{constructor(){super()}getName(){return vn.getName()}getAppName(){return vn.getAppName()}getJSName(){return vn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await vn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await vn.initCookie(e.server.config.biliCookie),await vn.spiderInit(e),vn.cfgObj.code=0,vn.catOpenStatus=!0,vn.classes.push({type_name:"\u6700\u8FD1\u6
`,"").replaceAll("\u5267\u60C5\uFF1A",""),n.vod_pic=e("img.lazy")[0].attribs["data-original"],n}async parseVodShortListFromJson(e){let n=[];for(let l of e){let r=new Ne;r.vod_id=l.url,r.vod_pic=l.thumb,r.vod_remarks=l.time,r.vod_name=l.title,n.push(r)}return n}async setClasses(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!M.isEmpty(e)){let n=et(e),l=n("[class=index-list-l]");for(let r of l){let i=n(n(r).find('[class="h1 clearfix"]')[0]).find("a"),s=i[0].attribs.href,a=n(i[1]).text();M.isEmpty(a)||this.classes.push({type_id:s,type_name:a})}}}async getFilter(e){let n=this.siteUrl+e,l=await this.fetch(n,null,this.getHeader()),r=[];if(!M.isEmpty(l)){let i=et(l),s=i('[class="sy scon clearfix"]').find("dl"),a=0;for(let u of s){let o=i(i(u).find("dt")).text().replace("\u6309","").replace("\uFF1A",""),c={key:(a+1).toString(),name:o,value:[]},f=i(u).find("a"),m=0;o==="\u5267\u60C5"?m=3:o==="\u5E74\u4EE3"?m=2:o==="\u5730\u533A"&&(m=4);for(let d of f){let y=d.attribs.href.split("/");c.value.push({n:i(d).text(),v:y[m]})}r.push(c),a=a+1}}return r}async setFilterObj(){for(let e of this.classes){let n=e.type_id;n!=="\u6700\u8FD1\u66F4\u65B0"&&(this.filterObj[n]=await this.getFilter(n))}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!M.isEmpty(e)){let n=et(e);this.homeVodList=await this.parseVodShortListFromDoc(n)}}async setCategory(e,n,l,r){let i=this.siteUrl+e,s=await this.fetch(i,null,this.getHeader());if(!M.isEmpty(s)){let a=e.split("/")[1],u=e.split("/")[2],o=Oe(/var _yu_gda_s="(.*?)";/,s),c={action:a,page:parseInt(n),year:r[2]??"0",area:r[3]??"all",class:r[1]??"0",dect:"",id:u},f=await this.fetch(o,c,this.getHeader());if(f!==null){let m=et(f);this.vodList=await this.parseVodShortListFromDoc(m)}}}async setDetail(e){let n=this.siteUrl+e,l=await this.fetch(n,null,this.getHeader());if(!M.isEmpty(l)){let r=et(l);this.vodDetail=await this.parseVodDetailFromDoc(r);let s="http://test.gqyy8.com:8077/ne2"+/<script type="text\/javascript" src="http:\/\/test.gqyy8.com:8077\/ne2(.*?)"><\/script>/g.exec(l)[1],a=await this.fetch(s,null,this.getHeader());if(!M.isEmpty(a)){let u=this.paraseUrlObject(a);this.vodDetail.vod_play_url=u.play_url,this.vodDetail.vod_play_from=u.play_format}}}async setSearch(e,n){let l=this.siteUrl+"/search.php",r=await this.fetch(l,null,this.getHeader());if(!M.isEmpty(r)){let i={top:10,q:e},s=Oe(/var my_search='(.*?)';/,r),a=await this.fetch(s,i,this.getHeader());if(!M.isEmpty(a)){let u=JSON.parse(a.replaceAll("\uFEFF",""));this.vodList=await this.parseVodShortListFromJson(u)}}}},wn=new dS;var hS=class extends De{constructor(){super()}getName(){return wn.getName()}getAppName(){return wn.getAppName()}getJSName(){return wn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await wn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await wn.initCookie(e.server.config.biliCookie),await wn.spiderInit(e),wn.cfgObj.code=0,wn.catOpenStatus=!0,wn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await wn.setClasses(),this.classes=wn.classes}async setFilterObj(){await wn.setFilterObj(),this.filterObj=wn.filterObj}async setHomeVod(){await wn.setHomeVod(),this.homeVodList=wn.homeVodList}async setCategory(e,n,l,r){await wn.setCategory(e,n,l,r),this.vodList=wn.vodList}async setDetail(e){await wn.setDetail(e),this.vodDetail=wn.vodDetail}async setPlay(e,n,l){await wn.setPlay(e,n,l),this.playUrl=wn.playUrl,this.result=wn.result}async setSearch(e,n,l){await wn.setSearch(e,n,l),this.vodList=wn.vodList,this.result=wn.result}async setProxy(e,n){return await wn.proxy(e,n)}},ga=new hS;async function OX(t,e){return await ga.init(t,e)}async function NX(t,e){return await ga.home(t,e)}async function Rxe(t,e){return await ga.homeVod(t,e)}async function CX(t,e){return await ga.category(t,e)}async function IX(t,e){return await ga.detail(t,e)}async function RX(t,e){return aw
2024-09-29 09:10:57 +08:00
`,"").replaceAll(" ",""),l.push(s)}return l}async parseVodDetailFromDoc(e){let n=e("#post_content"),l=[],r=[];if(!this.catOpenStatus){let u=0,o="\u78C1\u529B\u7EBF\u8DEF";for(let c of n){let f=e(c).find("table a"),m=[];for(let d of f){let y=d.attribs.href,_=d.children[0].data;y.toLowerCase().startsWith("magnet")&&m.push(_+"$"+y)}m.length>0&&(u++,l.push(o+u),r.push(m.join("#")))}}let i=e(e(".mainleft")).find('[class="widget box row"]');for(let u of i){let o=e(u).find("h3").text(),c=[];if(!M.isEmpty(o)){let f=e(u).find("a");for(let m of f)c.push(m.attribs.title+"$"+m.attribs.href);l.push(o),r.push(c.join("#"))}}let s=e(".context").html(),a=new He;return a.vod_name=e(".article_container > h1").text(),a.vod_pic=e("#post_content img").attr("src"),a.type_name=Oe(/◎类  别 (.*?)<br>/,s),M.isEmpty(a.type_name)&&(a.type_name=e('[rel="category tag"]').text()),a.vod_year=Oe(/◎年  代 (.*?)<br>/,s),M.isEmpty(a.vod_year)&&(a.vod_year=Oe(/首播:(.*?)<br>"/,s)),a.vod_area=Oe(/◎产  地 (.*?)<br>/,s),M.isEmpty(a.vod_year)&&(a.vod_area=Oe(/地区:(.*?)<br>"/,s)),a.vod_remarks=Oe(/◎上映日期 (.*?)<br>/,s),a.vod_actor=this.getActorOrDirector(/◎演  员 (.*?)<\/p>/,s),M.isEmpty(a.vod_actor)&&(a.vod_actor=this.getActorOrDirector(/◎主  演 (.*?)<\/p>/,s)),M.isEmpty(a.vod_actor)&&(a.vod_actor=this.getActorOrDirector(/主演:(.*?)<br>/,s)),a.vod_director=this.getActorOrDirector(/◎导  演 (.*?)<br>/,s),M.isEmpty(a.vod_director)&&(a.vod_director=this.getActorOrDirector(/导演:(.*?)<br>/,s)),a.vod_content=this.getDescription(/◎简  介(.*?)<hr>/gi,s),M.isEmpty(a.vod_content)&&(a.vod_content=this.getDescription(/简介(.*?)<\/p>/gi,s)),M.isEmpty(a.vod_content)&&(a.vod_content=this.getDescription(/◎简  介(.*?)<br>/gi,s)),a.vod_play_from=l.join("$$$"),a.vod_play_url=r.join("$$$"),a}async parseVodPlayFromDoc(e,n){let l="",r=n.html();switch(e){case"\u64AD\u653E\u5730\u5740\uFF08\u65E0\u63D2\u4EF6 \u6781\u901F\u64AD\u653E\uFF09":case"\u64AD\u653E\u5730\u5740\u4E09":l=n(n(".video")).find("iframe")[0].attribs.src+"/index.m3u8";break;case"\u64AD\u653E\u5730\u5740\uFF08\u65E0\u9700\u5B89\u88C5\u63D2\u4EF6\uFF09":let i=/url: '(.*?)',/gs.exec(r);i.length>1&&(l=i[1]);break;case"\u64AD\u653E\u5730\u5740\u56DB":let s=/source: "(.*?)",/gs.exec(r);s.length>1&&(l=s[1]);break;default:await this.jadeLog.warning(`\u6682\u4E0D\u652F\u6301\u5F53\u524D\u683C\u5F0F,\u5F53\u524D\u683C\u5F0F\u4E3A:${e}`);break}return l}async setClasses(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!M.isEmpty(e)){let n=et(e),l=n("#menus > li > a");for(let r=0;r<l.length;r++){let i=l[r];if(r<2||r===l.length-1)continue;let s=i.children[0].data,a=i.attribs.href;if(this.classes.push({type_name:s,type_id:a}),s==="\u7535\u89C6\u5267"){let u=[{n:"\u4E0D\u9650",v:""}];for(let o of n(i.next).find("a"))u.push({n:o.children[0].data,v:o.attribs.href.replaceAll(a,"")});this.filterObj[a]=[{key:"cateId",name:"\u7C7B\u578B",value:u}]}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(M.isEmpty(e))await this.jadeLog.info("\u9996\u9875\u7C7B\u522B\u89E3\u6790\u5931\u8D25",!0);else{let n=et(e);this.homeVodList=await this.parseVodShortListFromDoc(n)}}async setCategory(e,n,l,r){let i=r.cateId??"",s=this.siteUrl+e+i;this.page=parseInt(n),this.count=0,this.limit=18,this.total=0,this.page!==1&&(s+="index_"+n+".html");let a=await this.fetch(s,null,this.getHeader());if(!M.isEmpty(a)){let u=et(a),o=u(".pagination > a");if(o.length>0){let c=o.slice(-1)[0].attribs.href,m=/index_(.*?).html/.exec(c);this.count=parseInt(m[1]);let d=u("#post_container .post_hover");this.total=this.page===this.count?(this.page-1)*this.limit+d.length:this.count*this.limit}this.vodList=await this.parseVodShortListFromDoc(u)}}async setSearch(e,n){let l=this.siteUrl+"/e/search/index.php",r={show:"title",tempid:"1",tbname:"article",mid:"1",dopost:"search",keyboard:e},i=await this.post(l,r,this.getHeader());if(!M.isEmpty(i)){let s=et(i);this.vodList=await this.parseVodShortListFromDoc(s)}}async setDetail(e){let n=this.site
2024-09-23 11:52:18 +08:00
"type": "{{tid}}",
"p": "{{pg}}",
"area": "{{ext.area|default(0)}}",
"year": "{{ext.year|default(0)}}",
"sort": "{{ext.sort|default(0)}}",
"class": "{{ext.class|default(0)}}"}`,{ext:r,tid:e,pg:n}));console.log(s);let a=await this.request(i,s);this.vodList=await this.parseVodShortListFromJson(a.data.data)}async setDetail(e){let n=await this.request(this.siteUrl+"/api.php/Video/getVideoInfo",{video_id:e});this.vodDetail=await this.parseVodDetailfromJson(n.data.video)}async setPlay(e,n,l){this.result.jx=0;try{if(n.indexOf("youku")>=0||n.indexOf("iqiyi")>=0||n.indexOf("v.qq.com")>=0||n.indexOf("pptv")>=0||n.indexOf("le.com")>=0||n.indexOf("1905.com")>=0||n.indexOf("mgtv")>=0){if(this.parse.length>0)for(let r=0;r<this.parse.length;r++)try{let i=this.parse[r],s=await req(i+n,{headers:{"user-agent":"okhttp/4.1.0"}});await this.jadeLog.debug(`\u89E3\u6790\u8FDE\u63A5\u7ED3\u679C\u4E3A:${JSON.stringify(s)}`);let a=uW(n,JSON.parse(s.content).data);a.url&&(this.playUrl=a.url,this.danmuUrl=await this.danmuSpider.getVideoUrl(n,0),this.result.jx=1)}catch{}}else if(n.indexOf("jqq-")>=0){let r=await this.request(this.siteUrl+"/jqqheader.json",null,null,!0),i=n.split("-"),s=await req("https://api.juquanquanapp.com/app/drama/detail?dramaId="+i[1]+"&episodeSid="+i[2]+"&quality=LD",{headers:r}),a=JSON.parse(s.content);a.data.playInfo.url&&(this.playUrl=a.data.playInfo.url)}else if(n.startsWith("ftp"))this.playUrl=n;else{let r=await this.request(this.siteUrl+"/video.php",{url:n}),i=uW(n,r.data);i.url&&(i.url.indexOf("filename=1.mp4")>-1?this.playUrl=i.url:this.playUrl=await js2Proxy(!0,this.siteType,this.siteKey,"lzm3u8/"+r3(i.url),{}))}}catch(r){await this.jadeLog.error(r)}}async setSearch(e,n){let l=await this.request(this.siteUrl+"/api.php/Search/getSearch",{key:e,type_id:0,p:1});this.vodList=await this.parseVodShortListFromJson(l.data.data)}async proxy(e,n){let l=e[0],r=y2(e[1]);if(l==="lzm3u8"){await this.jadeLog.debug(`\u4F7F\u7528\u4EE3\u7406\u64AD\u653E,\u64AD\u653E\u8FDE\u63A5\u4E3A:${r}`);let i=await req(r,{}),s=i.content,a=await js2Proxy(!1,this.siteType,this.siteKey,"lzm3u8/",{}),u=r.substr(0,r.lastIndexOf("/")+1);return await this.jadeLog.debug(s.length),s=s.replace(/#EXT-X-DISCONTINUITY\r*\n*#EXTINF:6.433333,[\s\S]*?#EXT-X-DISCONTINUITY/,""),await this.jadeLog.debug(s.length),s=s.replace(/(#EXT-X-KEY\S+URI=")(\S+)("\S+)/g,function(o,c,f,m){let d=(f.startsWith("http")?"":u)+f;return c+d+m}),s=s.replace(/(#EXT-X-STREAM-INF:.*\n)(.*)/g,function(o,c,f){let m=(f.startsWith("http")?"":u)+f;return c+a+y2(m)}),s=s.replace(/(#EXTINF:.*\n)(.*)/g,function(o,c,f){let m=(f.startsWith("http")?"":u)+f;return c+m}),JSON.stringify({code:i.code,content:s,headers:i.headers})}return JSON.stringify({code:500,content:""})}},An=new TS;var xS=class extends De{constructor(){super()}getName(){return An.getName()}getAppName(){return An.getAppName()}getJSName(){return An.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await An.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await An.initCookie(e.server.config.biliCookie),await An.spiderInit(e),An.cfgObj.code=0,An.catOpenStatus=!0,An.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await An.setClasses(),this.classes=An.classes}async setFilterObj(){await An.setFilterObj(),this.filterObj=An.filterObj}async setHomeVod(){await An.setHomeVod(),this.homeVodList=An.homeVodList}async setCategory(e,n,l,r){await An.setCategory(e,n,l,r),this.vodList=An.vodList}async setDetail(e){await An.setDetail(e),this.vodDetail=An.vodDetail}async setPlay(e,n,l){await An.setPlay(e,n,l),this.playUrl=An.playUrl,this.result=An.result}async setSearch(e,n,l){await An.setSearch(e,n,l),this.vodList=An.vodList,this.result=An.result}async setProxy(e,n){return await An.proxy(e,n)}},wa=new xS;async function oW(t,e){return await wa.init(t,e)}async function cW(t,e){return await wa.home(t,e)}async function eAe(t,e){return await wa.homeVod(t,e)}async function pW(t,e){return await wa.category(t,e)}async function fW(t,e){return await wa.detail(t,
`;n.type_name=e(e(e(r).find('[class="post-meta"]')).find("span")[0]).text(),n.vod_pic=e(r).find("img")[0].attribs.src,n.vod_name=Oe(/名称:(.*?)\n/,s),n.vod_actor=Oe(/主演:(.*?)\n/,s),n.vod_director=Oe(/导演:(.*?)\n/,s),n.vod_area=Oe(/地区:(.*?)\n/,s),n.vod_year=Oe(/年份:(.*?)\n/,s),n.vod_remarks=Oe(/更新:(.*?)\n/,s);let a=e('[class="article-related info"]').find("p");n.vod_content=e(a).text();let u=e('[class="article-related download_url"]'),o=[],c=[];for(let f=0;f<u.length;f++){let m=u[f],d=e(e(m).find("h2")).text().replaceAll(n.vod_name,"");o.push(d.replaceAll("\u4E0B\u8F7D","\u64AD\u653E"));let y=[];for(let _ of e(u[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=o.join("$$$"),n.vod_play_url=c.join("$$$"),n}async parseVodShortListFromJson(e){let n=[],l=et(e.ajaxtxt),r=l(l("ul")).find("li");for(let i of r){let s=new Ne;s.vod_pic=l(i).find("img")[0].attribs["data-original"],s.vod_name=Oe(/《(.*?)》/,l(i).find("img")[0].attribs.alt),s.vod_id=l(i).find("a")[0].attribs.href,s.vod_remarks="\u8BC4\u5206:"+l(l(i).find('[class="rate badge"]')).text(),n.push(s)}return n}async parseVodShortListFromDocByCategory(e){let n=[],l=e(e('[id="list_all"]').find("ul")).find("li");for(let r of l){let i=new Ne;i.vod_id=e(r).find("a")[0].attribs.href,i.vod_name=Oe(/《(.*?)》/,e(e(e(r).find('[class="text_info"]')).find("a")[0]).text()),i.vod_pic=e(r).find("img")[0].attribs["data-original"],i.vod_remarks=e(e(r).find('[class="update_time"]')).text(),n.push(i)}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,l,r){let i=this.siteUrl+`/list/${e}-${n}.html`,s=await this.getHtml(i);this.vodList=await this.parseVodShortListFromDocByCategory(s)}async setSearch(e,n){let l=this.siteUrl+"/search/",r={wd:e,p:"1",t:"j/tNgwBS2e8O4x9TuIkYuQ=="},i=await this.post(l,r,this.getSearchHeader()),s=et(i);this.vodList=await this.parseVodShortListFromDocByCategory(s)}},On=new AS;var OS=class extends De{constructor(){super()}getName(){return On.getName()}getAppName(){return On.getAppName()}getJSName(){return On.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await On.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await On.initCookie(e.server.config.biliCookie),await On.spiderInit(e),On.cfgObj.code=0,On.catOpenStatus=!0,On.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await On.setClasses(),this.classes=On.classes}async setFilterObj(){await On.setFilterObj(),this.filterObj=On.filterObj}async setHomeVod(){await On.setHomeVod(),this.homeVodList=On.homeVodList}async setCategory(e,n,l,r){await On.setCategory(e,n,l,r),this.vodList=On.vodList}async setDetail(e){await On.setDetail(e),this.vodDetail=On.vodDetail}async setPlay(e,n,l){await On.setPlay(e,n,l),this.playUrl=On.playUrl,this.result=On.result}async setSearch(e,n,l){await On.setSearch(e,n,l),this.vodList=On.vodList,this.result=On.result}async setProxy(e,n){return await On.proxy(e,n)}},Sa=new OS;async function yW(t,e){return await Sa.init(t,e)}async function gW(t,e){return await Sa.home(t,e)}async function nAe(t,e){return await Sa.homeVod(t,e)}async function vW(t,e){return await Sa.category(t,e)}async function _W(t,e){return await Sa.detail(t,e)}async function EW(t,e){return await Sa.play(t,e)}async function bW(t,e){return await Sa.search(t,e)}async function lAe(t,e){return await Sa.proxy(t,e)}var wW={meta:{key:On.getJSName(),name:On.getName(),type:On.getType()},api:async t=>{t.post("/init",yW),t.post("/home",gW),t.post("/category",vW),t.post("/detail",_W),t.post("/play",EW),t.post("/search",bW),t.get("/proxy/:what/:id
`," ").replaceAll(" \u6536\u8D77","");let o=e('[class="module-tab-item tab-item"]'),c=e('[class="scroll-content"]'),f=[],m=[];for(let d=0;d<o.length;d++){let _=o[d].attribs["data-dropdown-value"];if(_.indexOf("\u5938\u514B")===-1){f.push(_);let S=[];for(let w of e(c[d]).find("a")){let E=e(w).text(),g=w.attribs.href;S.push(E+"$"+g)}m.push(S.join("#"))}}return l.vod_play_from=f.join("$$$"),l.vod_play_url=m.join("$$$"),l}async setHomeVod(){let e=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(e)}async setCategory(e,n,l,r){let i=[e.toString(),"","","","","","","",n.toString(),"","",""],s=[3,11,1,2];r.\u5168\u90E8\u5267\u60C5!==void 0&&r.\u5168\u90E8\u5267\u60C5!=="0"&&(i[s[0]]=r.\u5168\u90E8\u5267\u60C5),r.\u5168\u90E8\u65F6\u95F4!==void 0&&r.\u5168\u90E8\u65F6\u95F4!=="0"&&(i[s[1]]=r.\u5168\u90E8\u65F6\u95F4),r.\u5168\u90E8\u5730\u533A!==void 0&&r.\u5168\u90E8\u5730\u533A!=="0"&&(i[s[2]]=r.\u5168\u90E8\u5730\u533A),r.\u65F6\u95F4\u6392\u5E8F!==void 0&&r.\u65F6\u95F4\u6392\u5E8F!=="0"&&(i[s[3]]=r.\u65F6\u95F4\u6392\u5E8F);let a=this.siteUrl+"/index.php/vodshow/"+i.join("-")+".html",u=await this.getHtml(a);this.vodList=await this.parseVodShortListFromDoc(u)}async setDetail(e){let n=await this.getHtml(this.siteUrl+e);this.vodDetail=await this.parseVodDetailFromDoc(n)}uic(e,n){let l=$e.enc.Utf8.parse("2890"+n+"tB959C"),r=$e.enc.Utf8.parse("2F131BE91247866E"),i=$e.AES.decrypt(e,l,{iv:r,mode:$e.mode.CBC,padding:$e.pad.Pkcs7});return $e.enc.Utf8.stringify(i)}async setPlay(e,n,l){let i=(await this.getHtml(this.siteUrl+n))('[id="bfurl"]')[0].attribs.href;if(i.indexOf("http")>-1)this.playUrl=i;else{let s="https://jiexi.xn--1lq90i13mxk5bolhm8k.xn--fiqs8s/player/ec.php?code=ak&if=1&url="+i,u=(await this.getHtml(s)).html(),o=JSON.parse(Oe(/let ConFig = (.*?),box = /,u));this.playUrl=this.uic(o.url,o.config.uid)}}async setSearch(e,n){let l=`http://123.207.150.253/zxapi/public/?service=App.F.Fetch&req_p=${e}&type=6080`,r=await this.fetch(l,null,this.getHeader());this.vodList=await this.parseVodShortListFromJson(JSON.parse(r))}},In=new kS;var DS=class extends De{constructor(){super()}getName(){return In.getName()}getAppName(){return In.getAppName()}getJSName(){return In.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await In.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await In.initCookie(e.server.config.biliCookie),await In.spiderInit(e),In.cfgObj.code=0,In.catOpenStatus=!0,In.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await In.setClasses(),this.classes=In.classes}async setFilterObj(){await In.setFilterObj(),this.filterObj=In.filterObj}async setHomeVod(){await In.setHomeVod(),this.homeVodList=In.homeVodList}async setCategory(e,n,l,r){await In.setCategory(e,n,l,r),this.vodList=In.vodList}async setDetail(e){await In.setDetail(e),this.vodDetail=In.vodDetail}async setPlay(e,n,l){await In.setPlay(e,n,l),this.playUrl=In.playUrl,this.result=In.result}async setSearch(e,n,l){await In.setSearch(e,n,l),this.vodList=In.vodList,this.result=In.result}async setProxy(e,n){return await In.proxy(e,n)}},Aa=new DS;async function jW(t,e){return await Aa.init(t,e)}async function UW(t,e){return await Aa.home(t,e)}async function uAe(t,e){return await Aa.homeVod(t,e)}async function MW(t,e){return await Aa.category(t,e)}async function $W(t,e){return await Aa.detail(t,e)}async function BW(t,e){return await Aa.play(t,e)}async function HW(t,e){return await Aa.search(t,e)}async function oAe(t,e){return await Aa.proxy(t,e)}var VW={meta:{key:In.getJSName(),name:In.getName(),type:In.getType()},api:async t=>{t.post("/init",jW),t.post("/home",UW),t.post("/category",MW),t.post("/detail",$W),t.post("/play",BW),t.post("/search",HW),t.get("/proxy/:what/:ids/:end",oAe)},spider:{init:jW,home:UW,homeVod:uAe,category:MW,detail:$W,play:BW,search:HW}};var cAe=["4k","4K"],PS=class extends Fe{constructor(){super(),this.
`;let u=[],o=Oe(lo,a).split(`
`);for(let f of o){let m=f.match(lo);M.isEmpty(m)||u.push(m[1]);let d=f.match(p4);M.isEmpty(d)||u.push(d[1])}let c=await i3([u]);return r.vod_play_from=M.keys(c).join("$$$"),r.vod_play_url=M.values(c).join("$$$"),r.type_name=Oe(/标签(.*?)\n/,a).replaceAll("\uFF1A",""),r.vod_content=Oe(/描述(.*?)\n/,a).replaceAll("\uFF1A",""),r}async setClasses(){let e=await this.getHtml(),n=e("[id^='navbar-category']").find("a"),l=["\u5F71","\u5267","4K","\u89C6","\u97F3","\u6F14","\u52A8\u6F2B"];for(let r of n){let i=e(r).text(),s=r.attribs.href,a=!1;for(let u of l)i.indexOf(u)>-1&&(a=!0);a&&this.classes.push(this.getTypeDic(i,s))}}async setHomeVod(){let e=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(e)}async setCategory(e,n,l,r){let i=e.split(".html")[0]+"_"+n+".html",s=await this.getHtml(i);this.vodList=await this.parseVodShortListFromDocByCategory(s)}async setDetail(e){let n=await this.getHtml(e);this.vodDetail=await this.parseVodDetailFromDoc(n)}async setPlay(e,n,l){this.playUrl=await S3(e,n,l),this.result.setHeader(sr(e))}async setSearch(e,n){let l=this.siteUrl+`/search.php?q=${e}`,r=await this.getHtml(l);this.vodList=await this.parseVodShortListFromDocByCategory(r)}},Rn=new PS;var LS=class extends De{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().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await Rn.initCloud(e.server.config):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,l,r){await Rn.setCategory(e,n,l,r),this.vodList=Rn.vodList}async setDetail(e){await Rn.setDetail(e),this.vodDetail=Rn.vodDetail}async setPlay(e,n,l){await Rn.setPlay(e,n,l),this.playUrl=Rn.playUrl,this.result=Rn.result}async setSearch(e,n,l){await Rn.setSearch(e,n,l),this.vodList=Rn.vodList,this.result=Rn.result}async setProxy(e,n){return await Rn.proxy(e,n)}},Oa=new LS;async function qW(t,e){return await Oa.init(t,e)}async function zW(t,e){return await Oa.home(t,e)}async function pAe(t,e){return await Oa.homeVod(t,e)}async function GW(t,e){return await Oa.category(t,e)}async function JW(t,e){return await Oa.detail(t,e)}async function KW(t,e){return await Oa.play(t,e)}async function XW(t,e){return await Oa.search(t,e)}async function fAe(t,e){return await Oa.proxy(t,e)}var WW={meta:{key:Rn.getJSName(),name:Rn.getName(),type:Rn.getType()},api:async t=>{t.post("/init",qW),t.post("/home",zW),t.post("/category",GW),t.post("/detail",JW),t.post("/play",KW),t.post("/search",XW),t.get("/proxy/:what/:ids/:end",fAe)},spider:{init:qW,home:zW,homeVod:pAe,category:GW,detail:JW,play:KW,search:XW}};var dAe="diao.com",Cf=class{constructor(){this.channelMsg="",this.channelStatus=0,this.channelList=[],this.channelFilters={}}fromJsonString(e,n=0){let l=JSON.parse(e);this.channelMsg=l.msg,this.channelStatus=l.status;let r=[];for(let i of l.list){let s=new FS;switch(n){case 0:s.fromJson(i),r.push(s);break;case 1:i.channelName!=="\u5348\u591C\u573A"&&i.channelName!=="\u5348\u591C\u76F4\u64AD"&&(s.fromJson(i),r.push(s));break;case 2:(i.channelName==="\u5348\u591C\u573A"||i.channelName==="\u5348\u591C\u76F4\u64AD")&&(s.fromJson(i),r.push(s));break}}this.channelList=r,this.channelFilters=l.filter}setChannelFilters(e){this.channelFilters=JSON.parse(e)}getValues(e,n,l){let r=[];r.push({n:"\u5168\u90E8",v:"0"});for(let i of e)r.push({n:i[n],v:i[l].toString()});return r}getFilters(){let e={};for(let n of this.channelList){e[n.channelId]=[];let l=this.channelFilters.sortsMap[parseInt(n.channelId)],r=this.getValues(l,"title","
`,"").replaceAll(" ","");if(a.indexOf("\u65F6\u95F4")>-1&&a.indexOf("\u6587\u4EF6\u5939")>-1){let u=a.split("\u65F6\u95F4"),o=new Ne;o.vod_name=u[0],o.vod_remarks=u[1].split("\u683C\u5F0F")[0].replaceAll(":","").replaceAll(" ","").replaceAll("\uFEFF","").replaceAll("\xA0",""),o.vod_id=JSON.stringify({name:o.vod_name,remarks:o.vod_remarks,id:i}),l.push(o)}}}return l}async setClasses(){await this.parseClassFromDoc(this.content_html)}async setHomeVod(){let e=this.content_html(this.content_html('[id="app"]')[0]).find("van-tab");this.homeVodList=await this.parseVodShortListFromDoc(e[0])}async setDetail(e){if(e.indexOf("search")>-1){let n=this.siteUrl+"/search",l={k:decodeURIComponent(e.split("search?k=").slice(-1)[0])},r=await this.fetch(n,l,this.getHeader());if(!M.isEmpty(r)){let i=et(r),s=await this.parseVodShortListFromDocBySearch(i);s.length>0?e=s[0].vod_id:e=""}}if(!M.isEmpty(e)){let n=JSON.parse(e);this.vodDetail=await this.parseVodDetailfromJson(n)}}async setCategory(e,n,l,r){let i=this.content_html(this.content_html('[id="app"]')[0]).find("van-tab");this.vodList=await this.parseVodShortListFromDoc(i[parseInt(e)])}async setSearch(e,n){let l=this.siteUrl+"/search",r={k:e},i=await this.fetch(l,r,this.getHeader());if(!M.isEmpty(i)){let s=et(i);this.vodList=await this.parseVodShortListFromDocBySearch(s)}}async setPlay(e,n,l){this.playUrl=await S3(e,n,l),this.result.setHeader(sr(e))}},Pn=new BS;var HS=class extends De{constructor(){super()}getName(){return Pn.getName()}getAppName(){return Pn.getAppName()}getJSName(){return Pn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await Pn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Pn.initCookie(e.server.config.biliCookie),await Pn.spiderInit(e),Pn.cfgObj.code=0,Pn.catOpenStatus=!0,Pn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Pn.setClasses(),this.classes=Pn.classes}async setFilterObj(){await Pn.setFilterObj(),this.filterObj=Pn.filterObj}async setHomeVod(){await Pn.setHomeVod(),this.homeVodList=Pn.homeVodList}async setCategory(e,n,l,r){await Pn.setCategory(e,n,l,r),this.vodList=Pn.vodList}async setDetail(e){await Pn.setDetail(e),this.vodDetail=Pn.vodDetail}async setPlay(e,n,l){await Pn.setPlay(e,n,l),this.playUrl=Pn.playUrl,this.result=Pn.result}async setSearch(e,n,l){await Pn.setSearch(e,n,l),this.vodList=Pn.vodList,this.result=Pn.result}async setProxy(e,n){return await Pn.proxy(e,n)}},Da=new HS;async function fY(t,e){return await Da.init(t,e)}async function dY(t,e){return await Da.home(t,e)}async function EAe(t,e){return await Da.homeVod(t,e)}async function hY(t,e){return await Da.category(t,e)}async function mY(t,e){return await Da.detail(t,e)}async function yY(t,e){return await Da.play(t,e)}async function gY(t,e){return await Da.search(t,e)}async function bAe(t,e){return await Da.proxy(t,e)}var vY={meta:{key:Pn.getJSName(),name:Pn.getName(),type:Pn.getType()},api:async t=>{t.post("/init",fY),t.post("/home",dY),t.post("/category",hY),t.post("/detail",mY),t.post("/play",yY),t.post("/search",gY),t.get("/proxy/:what/:ids/:end",bAe)},spider:{init:fY,home:dY,homeVod:EAe,category:hY,detail:mY,play:yY,search:gY}};var VS=class extends Fe{constructor(){super(),this.siteUrl="https://www.cilixiong.com",this.cateObj={"/movie/":"1","/drama/":"2"}}getAppName(){return"\u78C1\u529B\u718A"}getName(){return"\u{1F43B}\u2503\u78C1\u529B\u718A\u2503\u{1F43B}"}getJSName(){return"cilixiong"}getType(){return 3}async setClasses(){let e=await this.getHtml(),n=e('[class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0"]').find("li");for(let l of n){let r=e(l).find("a")[0],i=e(r).text(),s=r.attribs.href;i!=="\u9996\u9875"&&i!=="\u699C\u5355"&&i!=="\u7559\u8A00"&&this.classes.push(this.getTypeDic(i,s))}}async getFilter(e){let n=[],l=e('[class="nav small"]'),r=1;for(let i of l){let s=e(e(i).find("li")[0]).text().replaceAll("\uFF1A",""
2024-04-09 09:34:47 +08:00
<ContentComponent contentType="${f}"/>
2024-05-07 17:30:00 +08:00
<Representation id="${n}" bandwidth="${i}" codecs="${r}" mimeType="${a}" ${m} startWithSAP="${s}">
<BaseURL>${u}</BaseURL>
<SegmentBase indexRange="${o}">
2024-04-09 09:34:47 +08:00
<Initialization range="${c}"/>
</SegmentBase>
</Representation>
2024-05-07 17:30:00 +08:00
</AdaptationSet>`}catch{}}getDash(e,n,l){let r=e.data.dash.duration,i=e.data.dash.minBufferTime;return`<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" type="static" mediaPresentationDuration="PT${r}S" minBufferTime="PT${i}S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
<Period duration="PT${r}S" start="PT0S">
2024-04-09 09:34:47 +08:00
${n}
2024-05-07 17:30:00 +08:00
${l}
2024-04-09 09:34:47 +08:00
</Period>
2024-09-23 11:52:18 +08:00
</MPD>`}async proxy(e,n){let l=e[0],r=y2(e[1]);if(l==="dash"){let i=r.split("+"),s=i[0],a=i[1],u=i[2],o=this.apiUrl+`/x/player/playurl?avid=${s}&cid=${a}&qn=${u}&fnval=4048&fourk=1`,c="",f="",m=await this.fetch(o,null,n),d=JSON.parse(m),y=d.data.dash,_=y.video,S=y.audio;for(let E=0;E<_.length;E++){let g=_[E];g.id.toString()===u&&(c+=this.getDashMedia(g))}for(let E=0;E<S.length;E++){let g=S[E];for(let v in this.vod_audio_id)g.id.toString()===v&&(f+=this.getDashMedia(g))}let w=this.getDash(d,c,f);return JSON.stringify({code:200,content:w,headers:{"Content-Type":"application/dash+xml"}})}return JSON.stringify({code:500,content:""})}},Fn=new zS;var GS=class extends De{constructor(){super()}getName(){return Fn.getName()}getAppName(){return Fn.getAppName()}getJSName(){return Fn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await Fn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Fn.initCookie(e.server.config.biliCookie),await Fn.spiderInit(e),Fn.cfgObj.code=0,Fn.catOpenStatus=!0,Fn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Fn.setClasses(),this.classes=Fn.classes}async setFilterObj(){await Fn.setFilterObj(),this.filterObj=Fn.filterObj}async setHomeVod(){await Fn.setHomeVod(),this.homeVodList=Fn.homeVodList}async setCategory(e,n,l,r){await Fn.setCategory(e,n,l,r),this.vodList=Fn.vodList}async setDetail(e){await Fn.setDetail(e),this.vodDetail=Fn.vodDetail}async setPlay(e,n,l){await Fn.setPlay(e,n,l),this.playUrl=Fn.playUrl,this.result=Fn.result}async setSearch(e,n,l){await Fn.setSearch(e,n,l),this.vodList=Fn.vodList,this.result=Fn.result}async setProxy(e,n){return await Fn.proxy(e,n)}},La=new GS;async function AY(t,e){return await La.init(t,e)}async function OY(t,e){return await La.home(t,e)}async function TAe(t,e){return await La.homeVod(t,e)}async function NY(t,e){return await La.category(t,e)}async function CY(t,e){return await La.detail(t,e)}async function IY(t,e){return await La.play(t,e)}async function RY(t,e){return await La.search(t,e)}async function xAe(t,e){return await La.proxy(t,e)}var kY={meta:{key:Fn.getJSName(),name:Fn.getName(),type:Fn.getType()},api:async t=>{t.post("/init",AY),t.post("/home",OY),t.post("/category",NY),t.post("/detail",CY),t.post("/play",IY),t.post("/search",RY),t.get("/proxy/:what/:ids/:end",xAe)},spider:{init:AY,home:OY,homeVod:TAe,category:NY,detail:CY,play:IY,search:RY}};var JS=class extends Fe{constructor(){super(),this.siteUrl="https://www.dygangs.org"}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 l of n){let r=l.attribs.href.replaceAll(this.siteUrl,""),i=e(l).text();r!=="/"&&this.classes.push(this.getTypeDic(i,r))}}async getFilter(e,n){let l=e('[class="nav-down-2 clearfix"]')[n],r=[];if(l!==void 0){let i="\u6309\u7C7B\u578B",s={key:i,name:i,value:[]};s.name=i,s.value.push({n:"\u5168\u90E8",v:"0"});for(let a of e(l).find("a")){let u=e(a).html(),o=a.attribs.href.split("/").slice(-2)[0];s.value.push({n:u,v:o})}r.push(s)}return r}async setFilterObj(){let e=0;for(let n of this.classes.slice(1,5)){let l=n.type_id;if(l!=="\u6700\u8FD1\u66F4\u65B0"){let r=this.siteUrl+`${l}`,i=await this.getHtml(r);this.filterObj[l]=await this.getFilter(i,e)}e=e+1}}parseVodShortFromElement(e,n){let l=new Ne;return l.vod_id=n.attribs.href,l.vod_name=n.attribs.title,l.vod_pic=e(n).find("img")[0].attribs["data-original"],l.vod_remarks=e(e(n).find("i")[0]).text().replaceAll(" ","").replaceAll(`
2024-05-29 18:58:23 +08:00
`,""),M.isEmpty(l.vod_pic)&&(l.vod_pic=ta+"/resources/dygang.jpg"),l}async parseVodShortListFromDoc(e){let n=[],l=e('[class="index-tj-l"]').find("li");for(let r of l){let i=e(r).find("a")[0],s=this.parseVodShortFromElement(e,i);n.push(s)}return n}async parseVodShortListFromDocByCategory(e){let n=[],l=e('[class="index-area clearfix"]').find("li");for(let r of l){let i=e(r).find("a")[0],s=this.parseVodShortFromElement(e,i);n.push(s)}return n}async parseVodDetailFromDoc(e){let n=new He,l=e('[ class="ct mb clearfix"]');n.vod_pic=e(l).find("img")[0].attribs.src,n.vod_name=Oe(/◎片  名 (.*?)<br>/,e(l).html()),n.vod_area=Oe(/◎产  地 (.*?)<br>/,e(l).html()),n.vod_year=Oe(/◎年  代 (.*?)<br>/,e(l).html()),n.type_name=Oe(/◎类  别 (.*?)<br>/,e(l).html()),n.vod_remarks=Oe(/◎集  数 (.*?)<br>/,e(l).html());let r=Oe(/◎主  演 (.*?)<\/p>/s,e(l).html());M.isEmpty(r)&&(r=Oe(/◎演  员 (.*?)<\/p>/s,e(l).html()));let i=[];for(let f of r.split(`
2024-05-23 19:28:35 +08:00
`))i.push(f.replaceAll("\u3000\u3000\u3000\u3000&nbsp; \u3000","").replaceAll("<br>","").replaceAll("\u3000\u3000\u3000\u3000\u3000",""));n.vod_actor=i.join("/"),n.vod_director=Oe(/◎导  演 (.*?)<br>/,e(l).html()),n.vod_content=Oe(/◎简  介<\/p>(.*?)<br>/s,e(l).html()).replaceAll("<p>","").replaceAll(`
`,""),M.isEmpty(n.vod_content)&&(n.vod_content=Oe(/◎简  介<br>(.*?)<\/p>/s,e(l).html()).replaceAll("<p>","").replaceAll(`
2024-09-23 11:52:18 +08:00
`,""));let s=[],a=[],u=e('[class="playfrom tab8 clearfix"]'),o=e('[class="videourl clearfix"]');for(let f=0;f<u.length;f++){let m=u[f],d=e(e(m).find("li")).html();s.push(d.replaceAll('<i class="playerico ico-Azhan"></i> ',""));let y=[];for(let _ of e(o[f]).find("a")){let S=_.attribs.title,w=_.attribs.href;y.push(S+"$"+w)}a.push(y.join("#"))}let c=e(e(l).find("span")[0]).find("span");if(c.length>0){let f=e(c).html();s.push(Oe(/【(.*?)】/,f.replaceAll("\u4E0B\u8F7D\u5730\u5740","\u78C1\u529B\u94FE\u63A5")));let m=[];for(let d of e(e(e(l).find("tbody")).find("tr")).find("a")){let y=e(d).html().replaceAll(".mp4",""),_=d.attribs.href;m.push(y+"$"+_)}a.push(m.join("#"))}return n.vod_play_from=s.join("$$$"),n.vod_play_url=a.join("$$$"),n}async setHomeVod(){let e=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(e)}async setCategory(e,n,l,r){let i=this.siteUrl+e;r.\u6309\u7C7B\u578B!==void 0&&r.\u6309\u7C7B\u578B!=="0"&&(i=i+`${r.\u6309\u7C7B\u578B}/`),parseInt(n)>1&&(i=i+`index_${n}.html`);let s=await this.getHtml(i);this.vodList=await this.parseVodShortListFromDocByCategory(s)}async setDetail(e){let n=await this.getHtml(e);this.vodDetail=await this.parseVodDetailFromDoc(n)}async setSearch(e,n){let l=this.siteUrl+"/e/search/index.php",r={keyboard:e,submit:"\u641C \u7D22",show:"title,zhuyan",tempid:"1"},i=await this.post(l,r,this.getHeader()),s=et(i);this.vodList=await this.parseVodShortListFromDocByCategory(s)}async setPlay(e,n,l){if(n.indexOf("http")>-1){let r=await this.getHtml(n),i=Oe(/url: '(.*?)',/,r.html());if(M.isEmpty(i)){let s=r(r('[class="video"]')[0]).find("iframe")[0].attribs.src,a=await this.fetch(s,null,{"User-Agent":ql});if(this.playUrl=Oe(/url: '(.*?)',/,a),M.isEmpty(this.playUrl)){let u=XV(s);this.playUrl=u+Oe(/var main = "(.*?)";/,a)}}else this.playUrl=i}else this.playUrl=n}},jn=new JS;var KS=class extends De{constructor(){super()}getName(){return jn.getName()}getAppName(){return jn.getAppName()}getJSName(){return jn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await jn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await jn.initCookie(e.server.config.biliCookie),await jn.spiderInit(e),jn.cfgObj.code=0,jn.catOpenStatus=!0,jn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await jn.setClasses(),this.classes=jn.classes}async setFilterObj(){await jn.setFilterObj(),this.filterObj=jn.filterObj}async setHomeVod(){await jn.setHomeVod(),this.homeVodList=jn.homeVodList}async setCategory(e,n,l,r){await jn.setCategory(e,n,l,r),this.vodList=jn.vodList}async setDetail(e){await jn.setDetail(e),this.vodDetail=jn.vodDetail}async setPlay(e,n,l){await jn.setPlay(e,n,l),this.playUrl=jn.playUrl,this.result=jn.result}async setSearch(e,n,l){await jn.setSearch(e,n,l),this.vodList=jn.vodList,this.result=jn.result}async setProxy(e,n){return await jn.proxy(e,n)}},Fa=new KS;async function DY(t,e){return await Fa.init(t,e)}async function PY(t,e){return await Fa.home(t,e)}async function AAe(t,e){return await Fa.homeVod(t,e)}async function LY(t,e){return await Fa.category(t,e)}async function FY(t,e){return await Fa.detail(t,e)}async function jY(t,e){return await Fa.play(t,e)}async function UY(t,e){return await Fa.search(t,e)}async function OAe(t,e){return await Fa.proxy(t,e)}var MY={meta:{key:jn.getJSName(),name:jn.getName(),type:jn.getType()},api:async t=>{t.post("/init",DY),t.post("/home",PY),t.post("/category",LY),t.post("/detail",FY),t.post("/play",jY),t.post("/search",UY),t.get("/proxy/:what/:ids/:end",OAe)},spider:{init:DY,home:PY,homeVod:AAe,category:LY,detail:FY,play:jY,search:UY}};var $Y=[19970,19972,19973,19974,19983,19986,19991,19999,2e4,20001,20003,20006,20009,20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,20076,20077,20078,20079,20082,20084,20085,20086,20087,2
2024-05-23 19:28:35 +08:00
`)),e.push(r)}return e}async parseVodShortListFromDocBySearch(t){let e=t('[class="show-list"]').find("li"),n=[];for(let l of e){let r=new Ne;r.vod_id=t(l).find("a")[0].attribs.href;let i=t(l).find("img")[0];r.vod_pic=i.attribs.src,r.vod_name=i.attribs.alt,r.vod_remarks=t(t(l).find('[class="type fn-left"]')).text().replace("\u7C7B\u578B\uFF1A",""),r.vod_remarks!=="\u793E\u5904\u7247"&&r.vod_remarks!=="\u793E\u4FDD\u7247"&&r.vod_remarks!=="\u64B8\u4E1D\u7247"&&r.vod_remarks!=="\u64B8\u4E1D\u52A8\u6F2B"&&n.push(r)}return n}async parseVodDetailFromDoc(t){let e=new He,n=t('[class="detail-pic fn-left"]').find("img")[0];e.vod_pic=n.attribs.src,e.vod_name=n.attribs.alt;let l=t('[class="info fn-clear"]');for(let o of t(l).find("dl")){let c=t(o).text();c.indexOf("\u4E3B\u6F14")>-1&&(e.vod_actor=c.replaceAll("\u4E3B\u6F14\uFF1A","").replaceAll(`
2024-05-07 17:30:00 +08:00
`,"")),c.indexOf("\u72B6\u6001")>-1&&(e.vod_remarks=c.replaceAll("\u72B6\u6001\uFF1A","").replaceAll(`
`,"")),c.indexOf("\u7C7B\u578B")>-1&&(e.type_name=c.replaceAll("\u7C7B\u578B\uFF1A","").replaceAll(`
`,"")),c.indexOf("\u5730\u533A")>-1&&(e.vod_area=c.replaceAll("\u5730\u533A\uFF1A","").replaceAll(`
`,"")),c.indexOf("\u5BFC\u6F14")>-1&&(e.vod_director=c.replaceAll("\u5BFC\u6F14\uFF1A","").replaceAll(`
`,"")),c.indexOf("\u5E74\u4EFD")>-1&&(e.vod_year=c.replaceAll("\u5E74\u4EFD\uFF1A","").replaceAll(`
`,"")),c.indexOf("\u5267\u60C5")>-1&&(e.vod_content=c.replaceAll("\u5267\u60C5\uFF1A","").replaceAll(`
2024-09-23 11:52:18 +08:00
`,""))}let r={},i=t.html(),s=t('[class="play-list"]'),a=1;for(let o of s){let c=`\u64AD\u653E\u8FDE\u63A5-${a}`,f=[];for(let m of t(o).find("a")){let d=m.attribs.title,y=m.attribs.href;f.push(d+"$"+y)}r[c]=f.join("#"),a=a+1}a=1;let u=t('[class="con4"]');for(let o of u){let c=`\u78C1\u529B\u94FE\u63A5-${a}`,f=[],m=c,d=t(t(o).find("div")).find("a")[0].attribs.href;d!=="javascript:void(0);"&&(f.push(m+"$"+d),r[c]=f.join("#"),a=a+1)}return e.vod_play_url=M.values(r).join("$$$"),e.vod_play_from=M.keys(r).join("$$$"),e}async setHomeVod(){let t=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(t)}async setDetail(t){let e=await this.getHtml(this.siteUrl+t);this.vodDetail=await this.parseVodDetailFromDoc(e)}getExtend(t){if(t.class!==void 0&&t.class!=="\u5168\u90E8")return t.class}async setCategory(t,e,n,l){let r=this.getExtend(l)??t,i;r===t?i=this.siteUrl+r:parseInt(e)===1?i=this.siteUrl+r:i=this.siteUrl+r+`index${e}.html`;let s=await this.getHtml(i);this.vodList=await this.parseVodShortListFromDoc(s)}async setPlay(flag,id,flags){if(flag.indexOf("\u78C1\u529B")>-1)this.playUrl=id;else{let idSplitList=id.split("-"),flag_id=parseInt(idSplitList[1]),episode=parseInt(idSplitList[2].split(".")[0]),$=await this.getHtml(this.siteUrl+id),playJsUrl=Oe(/<script type="text\/javascript" src="(.*?)">/,$.html()),playJsContent=await this.fetch(this.siteUrl+playJsUrl,null,this.getHeader()),playUrlListStr=Oe(/var VideoListJson=(.*?),urlinfo=/,playJsContent),playDic=eval(playUrlListStr);if(this.playUrl=playDic[flag_id][1][episode].split("$")[1],this.playUrl.indexOf("m3u8")===-1){let t=await this.fetch(this.playUrl,null,this.getHeader());this.playUrl=Oe(/url: '(.*?)'/,t)}}}GBKEncode(t){var e=33088;t+="";for(var n=[],l=63,r=0;r<t.length;r++){var i=t.charCodeAt(r);if(i<128)n.push(i);else{var s=$Y.indexOf(i);~s?(s+=e,n.push(255&s>>8,255&s)):n.push(l)}}return n}encode(t){let e="";for(let n of t){let l=this.GBKEncode(n);for(let r=0;r<l.length;r++)l[r]="%"+("0"+l[r].toString(16)).substr(-2).toUpperCase();e=e+l.join("")}return e}async setSearch(t,e){let n={searchword:this.encode(t)},l=await this.post(this.siteUrl+"/search.asp",n,this.getHeader(),"form",1),r=et(yb(l,"gb2312"));this.vodList=await this.parseVodShortListFromDocBySearch(r)}},qt=new XS;async function NAe(t){await qt.init(t)}async function CAe(t){return await qt.home(t)}async function IAe(){return await qt.homeVod()}async function RAe(t,e,n,l){return await qt.category(t,e,n,l)}async function kAe(t){return await qt.detail(t)}async function DAe(t,e,n){return await qt.play(t,e,n)}async function PAe(t,e){return await qt.search(t,e)}function UHe(){return{init:NAe,home:CAe,homeVod:IAe,category:RAe,detail:kAe,play:DAe,search:PAe}}var WS=class extends De{constructor(){super()}getName(){return qt.getName()}getAppName(){return qt.getAppName()}getJSName(){return qt.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await qt.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await qt.initCookie(e.server.config.biliCookie),await qt.spiderInit(e),qt.cfgObj.code=0,qt.catOpenStatus=!0,qt.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await qt.setClasses(),this.classes=qt.classes}async setFilterObj(){await qt.setFilterObj(),this.filterObj=qt.filterObj}async setHomeVod(){await qt.setHomeVod(),this.homeVodList=qt.homeVodList}async setCategory(e,n,l,r){await qt.setCategory(e,n,l,r),this.vodList=qt.vodList}async setDetail(e){await qt.setDetail(e),this.vodDetail=qt.vodDetail}async setPlay(e,n,l){await qt.setPlay(e,n,l),this.playUrl=qt.playUrl,this.result=qt.result}async setSearch(e,n,l){await qt.setSearch(e,n,l),this.vodList=qt.vodList,this.result=qt.result}async setProxy(e,n){return await qt.proxy(e,n)}},ja=new WS;async function BY(t,e){return await ja.init(t,e)}async function HY(t,e){return await ja.home(t,e)}async function LAe(t,e){return await ja.homeVod(t,e)}asyn
`);l.vod_name=r[0].replaceAll(/<\\?[^>]+>/g,"").replace("\u540D\u79F0\uFF1A","");let i=new Date(n.time);l.vod_remarks=i.toLocaleDateString().replace(/\//g,"-")+" "+i.toTimeString().substr(0,8),l.vod_pic=n.image;let s="";for(let u of r)u.indexOf("\u63CF\u8FF0")>-1&&(l.vod_content=u.replace("\u63CF\u8FF0\uFF1A","").replaceAll(/<\\?[^>]+>/g,"")),u.indexOf("\u6807\u7B7E\uFF1A")>-1&&(l.type_name=u.replace("\u{1F3F7} \u6807\u7B7E\uFF1A","")),u.indexOf("\u94FE\u63A5\uFF1A")>-1&&(s=u.replaceAll(/<\\?[^>]+>/g,"").replace("\u94FE\u63A5\uFF1A",""));let a=await i3([s]);return l.vod_play_from=M.keys(a).join("$$$"),l.vod_play_url=M.values(a).join("$$$"),l}async parseVodShortListFromDocBySearch(e,n){let l=[],r=JSON.parse(e("script[id=__NEXT_DATA__]")[0].children[0].data).buildId,i=this.siteUrl+"_next/data/"+r+"/search.json?keyword="+encodeURIComponent(n)+"&pan=aliyundrive",s=await this.fetch(i,null,this.getSearchHeader());if(M.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 u of a){let o=new Ne;o.vod_id=JSON.stringify(u);let c=u.content.split(`
`);o.vod_name=c[0].replaceAll(/<\\?[^>]+>/g,"").replace("\u540D\u79F0\uFF1A","");let f=new Date(u.time);o.vod_remarks=f.toLocaleDateString().replace(/\//g,"-")+" "+f.toTimeString().substr(0,8),o.vod_pic=u.image,l.push(o)}return l}}async setDetail(e){this.vodDetail=await this.parseVodDetailfromJson(e)}async setSearch(e,n){let l=await this.fetch(this.siteUrl,null,this.getHeader());if(!M.isEmpty(l)){let r=et(l);this.vodList=await this.parseVodShortListFromDocBySearch(r,e)}}async setPlay(e,n,l){this.playUrl=await S3(e,n,l),this.result.setHeader(sr(e))}},Un=new YS;var QS=class extends De{constructor(){super()}getName(){return Un.getName()}getAppName(){return Un.getAppName()}getJSName(){return Un.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await Un.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Un.initCookie(e.server.config.biliCookie),await Un.spiderInit(e),Un.cfgObj.code=0,Un.catOpenStatus=!0,Un.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Un.setClasses(),this.classes=Un.classes}async setFilterObj(){await Un.setFilterObj(),this.filterObj=Un.filterObj}async setHomeVod(){await Un.setHomeVod(),this.homeVodList=Un.homeVodList}async setCategory(e,n,l,r){await Un.setCategory(e,n,l,r),this.vodList=Un.vodList}async setDetail(e){await Un.setDetail(e),this.vodDetail=Un.vodDetail}async setPlay(e,n,l){await Un.setPlay(e,n,l),this.playUrl=Un.playUrl,this.result=Un.result}async setSearch(e,n,l){await Un.setSearch(e,n,l),this.vodList=Un.vodList,this.result=Un.result}async setProxy(e,n){return await Un.proxy(e,n)}},Ua=new QS;async function KY(t,e){return await Ua.init(t,e)}async function XY(t,e){return await Ua.home(t,e)}async function jAe(t,e){return await Ua.homeVod(t,e)}async function WY(t,e){return await Ua.category(t,e)}async function YY(t,e){return await Ua.detail(t,e)}async function QY(t,e){return await Ua.play(t,e)}async function ZY(t,e){return await Ua.search(t,e)}async function UAe(t,e){return await Ua.proxy(t,e)}var eQ={meta:{key:Un.getJSName(),name:Un.getName(),type:Un.getType()},api:async t=>{t.post("/init",KY),t.post("/home",XY),t.post("/category",WY),t.post("/detail",YY),t.post("/play",QY),t.post("/search",ZY),t.get("/proxy/:what/:ids/:end",UAe)},spider:{init:KY,home:XY,homeVod:jAe,category:WY,detail:YY,play:QY,search:ZY}};var ZS=class extends Fe{constructor(){super(),this.siteUrl="https://www.mxdm4.com/"}getName(){return"\u{1F352}\u2503MX\u52A8\u6F2B\u2503\u{1F352}"}getAppName(){return"MX\u52A8\u6F2B"}getJSName(){return"mxanime"}getType(){return 3}async setClasses(){let t=await this.getHtml(),e=t(t('[class="nav-menu-items"]')[0]).find('[class="nav-menu-item "]');for(let n of e){let l=t(n).find("a")[0],r=l.attribs.title,i=l.attribs.href;r!=="\u840C\u56FE"&&this.classes.push(this.getTypeDic(r,Oe(/type\/(.*?).html/,i)))}}async getFilter(t){let e=t('[class="library-box scroll-box"]'),n=[];for(let l=0;l<e.length;l++){let r={key:(l+1).toString(),name:"",value:[]};if(l<e.length-1){r.name=t(t(e[l]).find("a")[0]).text(),r.value.push({n:"\u5168\u90E8",v:"0"});for(let i of t(e[l]).find("a").slice(1))r.value.push({n:t(i).text(),v:t(i).text()});n.push(r)}else r.name=t(t(e[l]).find("a")[0]).text(),r.value=[{n:"\u5168\u90E8",v:"0"},{n:t(t(e[l]).find("a")[1]).text(),v:"hits"},{n:t(t(e[l]).find("a")[2]).text(),v:"score"}],n.push(r)}return n}async setFilterObj(){for(let t of this.classes){let e=t.type_id;if(e!=="\u6700\u8FD1\u66F4\u65B0"){let n=await this.getHtml(this.siteUrl+`/type/${e}.html`);this.filterObj[e]=await this.getFilter(n)}}}parseVodShortFromElement(t,e){let n=new Ne,l=t(t(e).find('[class="module-item-titlebox"]')).find("a")[0];return n.vod_id=l.attribs.href,n.vod_name=l.attribs.title,n.vod_pic=t(t(e).find('[class="module-item-pic"]')).find("img")[0].attribs["data-src"],n.vod_remarks=t(t(e).find('[class="module-item-text"]')).text(),n}async parseVodShortListFromDoc(t){let e=[],n
`,"").replaceAll(" ","").replaceAll(" ","")+"end";if(o.indexOf("\u5E74\u4EFD")>-1&&(e.vod_year=Oe(/年份:(.*?)end/,o).replaceAll("/","")),o.indexOf("\u5907\u6CE8")>-1){let c=Oe(/备注:(.*?)end/,o);e.vod_remarks=Oe(/备注:\/(.*?)end/,o)}o.indexOf("\u6807\u7B7E")>-1&&(e.type_name=Oe(/标签:(.*?)end/,o)),o.indexOf("\u5267\u60C5")>-1&&(e.vod_content=Oe(/剧情:(.*?)end/,o))}let r=t('[class="module-tab-item tab-item"]'),i=t('[class="scroll-content"]'),s=[],a=[];for(let u=0;u<r.length;u++){let o=r[u];s.push(o.attribs["data-dropdown-value"]);let c=[];for(let f of t(i[u]).find("a")){let m=t(f).text(),d=f.attribs.href;c.push(m+"$"+d)}a.push(c.join("#"))}return e.vod_play_from=s.join("$$$"),e.vod_play_url=a.join("$$$"),e}async setHomeVod(){let t=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(t)}getExtendValue(t,e){return t[e]===void 0||t[e]==="0"?"":t[e]}async setCategory(t,e,n,l){await this.jadeLog.debug(`extend:${JSON.stringify(l)}`);let r=this.getExtendValue(l,"1"),i=this.getExtendValue(l,"2"),s=this.getExtendValue(l,"3"),a=this.getExtendValue(l,"4"),u=[t.toString(),"",a,r,"",s,"","",e.toString(),"","",i],o=this.siteUrl+"/show/"+u.join("-")+".html",c=await this.getHtml(o);this.vodList=await this.parseVodShortListFromDocByCategory(c)}async setDetail(t){let e=await this.getHtml(this.siteUrl+t);this.vodDetail=await this.parseVodDetailFromDoc(e)}async setSearch(t,e){let n=this.siteUrl+`/search/${t}-------------.html`,l=await this.getHtml(n);this.vodList=await this.parseVodShortListFromDocBySearch(l)}async setPlay(t,e,n){let l=await this.getHtml(this.siteUrl+e),i="https://danmu.yhdmjx.com/m3u8.php?url="+JSON.parse(Oe(/var player_aaaa=(.*?)<\/script>/,l.html())).url,s=await await this.fetch(i,null,this.getHeader()),a=s.match(/"url": getVideoInfo\("(.*?)"\),/)[1],u=s.match(/<script>var bt_token = "(.*?)"/)[1],o=await await this.fetch("https://danmu.yhdmjx.com/js/play.js",null,this.getHeader());o=o.match(/var _token_key=CryptoJS\['enc'\]\['Utf8'\]\[_0x17f1\('67','qETJ'\)\]\((.*?\))/)[1],o=this.decrypt_token_key(o),this.playUrl=await this.getVideoInfo(a,o,u)}decrypt_token_key(toekn_key){var _0xod4="jsjiami.com.v6",_0x175e=[_0xod4,"JMOsw6omwoDCmw==","wp3DkSx5Eg==","HB7CscOJfS3DuUjDv2bDjsOmwr3Cm8KcwoI=","fR/Dqg==","ShRGTcKa","w5Y8VBs=","esKYKQ==","FgIdwrPDnMKOw7k=","HhXCmA==","woNrRsKSwpnDvcKfw4g=","ezBn","w43DkcK5w4MaJiE=","w44Ob8KjwrjCrMKtUA==","HwtswqI=","YsKnwrRawro=","Sm/CpQXCjz4RH8ORSXw=","IsO6w64=","T8OeAQ==","VcK4Hg==","csOmfBJ4","d8OAcA5L","Tn4RL2s=","w7goGizCmw==","w6XDlcOGwpoY","TsK7wpNPwrg=","w7J1CzLCnsO+HA==","w4XDkcK0w5YXPg==","S8KoCcKS","PcKWHcK/Eg==","Z2oMJ3rCiw==","YsKMG8KMwo0=","QsOecgRIwp4=","dFzDkUUxw48Qw7nCmX3CicODCMKnw74IOg==","acO2KU1B","wrAnw6DDrg==","w5MsScKwwoA=","wohZG8KhBg==","b8OieSpZ","w4ZmEsORw6I=","w7jDhxvCh8KY","w7wQa8KFwr0=","IMObw4E3wqU=","JsOjw5Erwrg=","w6MwcsKOwqU=","b8KIwqF0wrs=","XhXDvT52","wrDCmirChSE=","w5t1wpvDuwE=","XA7CtsKeEA==","wonCvVthw78=","U8KPP8KMwq4=","wp7DhCxjGTU=","woPDoBdiEQ==","HjzCrE/Dvg==","SsOQOWHCgg==","w6NdwoXCkMOx","w6shYWQ/","eE/Cgg==","XW/Csj7CmDoA","w680OynCgcK5BA8=","w4PDoMOTwrog","w5R7wqbCpMOPwrMxUcOiM8OuMVLCisKKFsOXAcOWY8O6w5hM","WwjDoht0","PzXCiHHDiA==","QMOFaMKcfQ==","bz9bVsK+","w7Npwp/DsB9ONw==","EcOPBQ3Cig==","woHDnzk=","DsKQLxtd","R8OCJmk=","wp55O8On","bkXCmhTCqg==","w7vDgx3Cg8KU","w6nDo8KdAn8=","O8KwP8KEDw==","wqzCtCHCtCg=","w5nDgmYhw5c=","wp0OZsK+w4A=","wrFxe8KFwp/DvcKew4EbN8K7BMORMx3DuxtOVELChsOEIQ==","BMKWRDc=","IS5dw6nDhQ==","w6geeG8t","SsK/wohywpc=","LBlnw7jDkA==","wodiLsOg","Ig5Ow7/Dlw==","TMOOewRZwoQ=","LjnClV7DvA==","woZsO8KcPQ==","eWvClMKeKQ==","wq1KWsKswr8=","w4p+AGFa","C8O7F8K2CQcKFxxgwo5sfh3DpAFV","w6XDqMKoCw==","w6Z8wqnCpMOe","w6x/CHRhXhV/w7I=","wrvClndGw5Y=","VsKcwo5RwoA=","ZcK2BMKmLQ==","BCcPwofDvQ==","eGEsF20=","eMOcUglq","w4U9XEAMw4/Dm3rCuzpxTg/DvyDDvMONH8OTwpTCtsKbw6k=","VwXDkTxG","CzHCrl3DkQ==","w7PDkVovw4o=","dsONYDdj","w79pwr3Duh4=","w55kwoLCpMOR","w6gbc8KGwpw=","bCnCtMKCCg==","Php5w64=","w7x8wpfDtiQ=","w4TDk2AB","w7lowoHDtgQ=","DB/CsnjDuQ==","woTDl8K3wp4S","wr0Ewq7Dq8Oh","GmHCpGxN","w5/Dm2XDpw==","w5bDps
`,"").replace(" ","").replace("\u73A9\u5076",""),a={type_id:i,type_name:s};this.classes.push(a)}}}async getFilter(e){let n=e("[class='scroll-content']").slice(1),l=[];for(let r=0;r<n.length;r++){let i={key:(r+1).toString(),name:"",value:[]};if(r<n.length-1){i.name=e(e(n[r]).find("a")[0]).text(),i.value.push({n:"\u5168\u90E8",v:"0"});for(let s of e(n[r]).find("a").slice(1))i.value.push({n:e(s).text(),v:e(s).text()});l.push(i)}else i.name=e(e(n[r]).find("a")[0]).text(),i.value=[{n:"\u5168\u90E8",v:"0"},{n:e(e(n[r]).find("a")[1]).text(),v:"hits"},{n:e(e(n[r]).find("a")[2]).text(),v:"score"}],l.push(i)}return l}async setFilterObj(){for(let e of this.classes){let n=e.type_id;if(n!=="/"&&n!=="\u6700\u8FD1\u66F4\u65B0"){let l=this.siteUrl+`/index.php/vodshow/${n}--------1---.html`,r=await this.fetch(l,null,this.getHeader());if(r!=null){let i=et(r);this.filterObj[n]=await this.getFilter(i)}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!M.isEmpty(e)){let n=et(e);this.homeVodList=await this.parseVodShortListFromDoc(n)}}async setCategory(e,n,l,r){let i=[e.toString(),"","","","","","","",n.toString(),"","",""],s=this.get_extend_sort_dic(parseInt(e));for(let o of Object.keys(s))r[o]==="0"?i[s[o]]="":i[s[o]]=r[o];let a=this.siteUrl+"/index.php/vodshow/"+i.join("-")+".html",u=await this.fetch(a,null,this.getHeader());if(!M.isEmpty(u)){let o=et(u);this.vodList=await this.parseVodShortListFromDoc(o);let c=Oe(/\$\("\.mac_total"\)\.text\('(\d+)'\)/,u);this.limit=72,c.length>0&&(this.total=parseInt(c)),this.total<=this.limit?this.count=1:this.count=Math.ceil(this.total/this.limit)}}async setDetail(e){let n=this.siteUrl+e,l=await this.fetch(n,null,this.getHeader());if(!M.isEmpty(l)){let r=et(l);this.vodDetail=await this.parseVodDetailFromDoc(r)}}async setPlay(e,n,l){this.playUrl=await S3(e,n,l),this.result.setHeader(sr(e))}async setSearch(e,n){let l=this.siteUrl+"/index.php/vodsearch/-------------.html?wd="+e,r=await this.fetch(l,null,this.getHeader());if(!M.isEmpty(r)){let i=et(r);this.vodList=await this.parseVodShortListFromDocBySearch(i)}}},Mn=new tT;var nT=class extends De{constructor(){super()}getName(){return Mn.getName()}getAppName(){return Mn.getAppName()}getJSName(){return Mn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await Mn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Mn.initCookie(e.server.config.biliCookie),await Mn.spiderInit(e),Mn.cfgObj.code=0,Mn.catOpenStatus=!0,Mn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Mn.setClasses(),this.classes=Mn.classes}async setFilterObj(){await Mn.setFilterObj(),this.filterObj=Mn.filterObj}async setHomeVod(){await Mn.setHomeVod(),this.homeVodList=Mn.homeVodList}async setCategory(e,n,l,r){await Mn.setCategory(e,n,l,r),this.vodList=Mn.vodList}async setDetail(e){await Mn.setDetail(e),this.vodDetail=Mn.vodDetail}async setPlay(e,n,l){await Mn.setPlay(e,n,l),this.playUrl=Mn.playUrl,this.result=Mn.result}async setSearch(e,n,l){await Mn.setSearch(e,n,l),this.vodList=Mn.vodList,this.result=Mn.result}async setProxy(e,n){return await Mn.proxy(e,n)}},$a=new nT;async function uQ(t,e){return await $a.init(t,e)}async function oQ(t,e){return await $a.home(t,e)}async function XAe(t,e){return await $a.homeVod(t,e)}async function cQ(t,e){return await $a.category(t,e)}async function pQ(t,e){return await $a.detail(t,e)}async function fQ(t,e){return await $a.play(t,e)}async function dQ(t,e){return await $a.search(t,e)}async function WAe(t,e){return await $a.proxy(t,e)}var hQ={meta:{key:Mn.getJSName(),name:Mn.getName(),type:Mn.getType()},api:async t=>{t.post("/init",uQ),t.post("/home",oQ),t.post("/category",cQ),t.post("/detail",pQ),t.post("/play",fQ),t.post("/search",dQ),t.get("/proxy/:what/:ids/:end",WAe)},spider:{init:uQ,home:oQ,homeVod:XAe,category:cQ,detail:pQ,play:fQ,search:dQ}};var If=class extends Fe{constructor(){supe
2024-05-20 15:50:52 +08:00
2024-05-23 19:28:35 +08:00
`;for(;;){let s=await this.getHtml(this.siteUrl+n);if(i+=c4(s('[class="content"]').html().trim().replaceAll("<p>"," ").replaceAll("</p>",`
2024-09-23 11:52:18 +08:00
`)),n=s('[id="next_url"]')[0].attribs.href,n.indexOf("_")<0)break}this.playUrl={content:i}}async setSearch(e,n){let l={searchkey:e,searchtype:"all",Submit:""},r=await this.fetch(this.siteUrl+"/search/",l,this.getHeader()),i=et(r);this.vodList=await this.parseVodShortListFromDocBySearch(i)}async proxy(e,n){await this.jadeLog.debug(`\u6B63\u5728\u8BBE\u7F6E\u53CD\u5411\u4EE3\u7406 segments = ${e.join(",")},headers = ${JSON.stringify(n)}`);let l=e[0],r=y2(e[1]);if(l==="img"){await this.jadeLog.debug(`\u53CD\u5411\u4EE3\u7406ID\u4E3A:${r}`);let i=await this.getHtml(this.siteUrl+r),s=await this.parseVodDetailFromDoc(i),a;return M.isEmpty(n)?a=await req(s.book_pic,{buffer:2,headers:{Referer:r,"User-Agent":ql}}):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:""})}},Bn=new iT;var sT=class extends De{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().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await Bn.initCloud(e.server.config):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,l,r){await Bn.setCategory(e,n,l,r),this.vodList=Bn.vodList}async setDetail(e){await Bn.setDetail(e),this.vodDetail=Bn.vodDetail}async setPlay(e,n,l){await Bn.setPlay(e,n,l),this.playUrl=Bn.playUrl,this.result=Bn.result}async setSearch(e,n,l){await Bn.setSearch(e,n,l),this.vodList=Bn.vodList,this.result=Bn.result}async setProxy(e,n){return await Bn.proxy(e,n)}},Ha=new sT;async function wQ(t,e){return await Ha.init(t,e)}async function SQ(t,e){return await Ha.home(t,e)}async function ZAe(t,e){return await Ha.homeVod(t,e)}async function TQ(t,e){return await Ha.category(t,e)}async function xQ(t,e){return await Ha.detail(t,e)}async function AQ(t,e){return await Ha.play(t,e)}async function OQ(t,e){return await Ha.search(t,e)}async function eOe(t,e){return await Ha.proxy(t,e)}var NQ={meta:{key:Bn.getJSName(),name:Bn.getName(),type:Bn.getType()},api:async t=>{t.post("/init",wQ),t.post("/home",SQ),t.post("/category",TQ),t.post("/detail",xQ),t.post("/play",AQ),t.post("/search",OQ),t.get("/proxy/:what/:ids/:end",eOe)},spider:{init:wQ,home:SQ,homeVod:ZAe,category:TQ,detail:xQ,play:AQ,search:OQ}};function RQ(t){this._parameters={},this._loadParameters(t||{})}RQ.prototype={_loadParameters:function(t){t instanceof Array?this._loadParametersFromArray(t):typeof t=="object"&&this._loadParametersFromObject(t)},_loadParametersFromArray:function(t){var e;for(e=0;e<t.length;e++)this._loadParametersFromObject(t[e])},_loadParametersFromObject:function(t){var e;for(e in t)if(t.hasOwnProperty(e)){var n=this._getStringFromParameter(t[e]);this._loadParameterValue(e,n)}},_loadParameterValue:function(t,e){var n;if(e instanceof Array){for(n=0;n<e.length;n++){var l=this._getStringFromParameter(e[n]);this._addParameter(t,l)}e.length==0&&this._addParameter(t,"")}else this._addParameter(t,e)},_getStringFromParameter:function(t){var e=t||"";try{(typeof t=="number"||typeof t=="boolean")&&(e=t.toString())}catch{}return e},_addParameter:function(t,e){this._parameters[t]||(this._parameters[t]=[]),this._parameters[t].push(e)},get:function(){return this._parameters}};function tOe(t){return t?decodeURIComponent(t):""}function nOe(t){let e=[],n=[];for(let a in t)e.push(K6(a));e.sort();for(let a=0;a<e.length;a++){let u=e[a];var l,r,i=tOe(u),s=t[i];for(s.sort(),l=0;l<s.length;l++)r=K6(s[l]),n.push(u+"="+r)}return n.join("&")}function CQ(t=10){let e="ABCDEFGHIJKL
2024-05-11 09:31:35 +08:00
2024-05-23 19:28:35 +08:00
`;for(;;){let s=await this.getHtml(this.siteUrl+n);if(i+=c4(s('[class="content"]').html().trim().replaceAll("<p>"," ").replaceAll("</p>",`
`)),n=s('[id="next_url"]')[0].attribs.href,n.indexOf("_")<0)break}this.playUrl={content:i}}async setSearch(e,n){let l={q:encodeURIComponent(e)},r=await this.fetch(this.siteUrl+"/novel/search",l,this.getHeader()),i=et(r);this.vodList=await this.parseVodShortListFromDocBySearch(i);let s=0}async setPlay(e,n,l){let r=n.split("+");n=r[1];let i=r[0]+`
2024-05-11 09:31:35 +08:00
`,a=(await this.getHtml(this.siteUrl+"/novel/pagea/"+n))('[class="content"]').text().trim().replaceAll("\u7AE0\u8282\u62A5\u9519 \u5206\u4EAB\u7ED9\u670B\u53CB\uFF1A","").replaceAll(" ","").split(`
2024-05-23 19:28:35 +08:00
`),u=[];for(let o of a)M.isEmpty(o.replaceAll(" ",""))||u.push(o.replaceAll(" "," "));i=i+" "+u.join(`
2024-05-11 09:31:35 +08:00
2024-09-23 11:52:18 +08:00
`),this.playUrl={content:i}}},Vn=new oT;var cT=class extends De{constructor(){super()}getName(){return Vn.getName()}getAppName(){return Vn.getAppName()}getJSName(){return Vn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await Vn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Vn.initCookie(e.server.config.biliCookie),await Vn.spiderInit(e),Vn.cfgObj.code=0,Vn.catOpenStatus=!0,Vn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Vn.setClasses(),this.classes=Vn.classes}async setFilterObj(){await Vn.setFilterObj(),this.filterObj=Vn.filterObj}async setHomeVod(){await Vn.setHomeVod(),this.homeVodList=Vn.homeVodList}async setCategory(e,n,l,r){await Vn.setCategory(e,n,l,r),this.vodList=Vn.vodList}async setDetail(e){await Vn.setDetail(e),this.vodDetail=Vn.vodDetail}async setPlay(e,n,l){await Vn.setPlay(e,n,l),this.playUrl=Vn.playUrl,this.result=Vn.result}async setSearch(e,n,l){await Vn.setSearch(e,n,l),this.vodList=Vn.vodList,this.result=Vn.result}async setProxy(e,n){return await Vn.proxy(e,n)}},qa=new cT;async function MQ(t,e){return await qa.init(t,e)}async function $Q(t,e){return await qa.home(t,e)}async function iOe(t,e){return await qa.homeVod(t,e)}async function BQ(t,e){return await qa.category(t,e)}async function HQ(t,e){return await qa.detail(t,e)}async function VQ(t,e){return await qa.play(t,e)}async function qQ(t,e){return await qa.search(t,e)}async function sOe(t,e){return await qa.proxy(t,e)}var zQ={meta:{key:Vn.getJSName(),name:Vn.getName(),type:Vn.getType()},api:async t=>{t.post("/init",MQ),t.post("/home",$Q),t.post("/category",BQ),t.post("/detail",HQ),t.post("/play",VQ),t.post("/search",qQ),t.get("/proxy/:what/:ids/:end",sOe)},spider:{init:MQ,home:$Q,homeVod:iOe,category:BQ,detail:HQ,play:VQ,search:qQ}};var pT=class extends Fe{constructor(){super(),this.siteUrl="https://m.13bqg.com"}getAppName(){return"\u7B14\u8DA3\u9601"}getJSName(){return"bqg_open"}getType(){return 10}getName(){return"\u{1F4DA}\uFE0E\u2503\u7B14\u8DA3\u9601\u2503\u{1F4DA}\uFE0E"}async spiderInit(e=null){e!==null?this.jsBase=await js2Proxy(e,"img",this.getHeader()):this.jsBase=await js2Proxy(!0,this.siteType,this.siteKey,"img/",this.getHeader())}async init(e){await super.init(e),await this.spiderInit(null)}async parseVodShortListFromDoc(e){let n=[],l=e('[class="block"]');for(let r of e(l[0]).find("li")){let i=new El,s=e(r).find("span");i.book_remarks=e(s[0]).text(),i.book_name=e(s[1]).text(),i.book_id=e(s[1]).find("a")[0].attribs.href,i.book_pic=this.jsBase+r3(i.book_id),n.push(i)}return n}async parseVodShortListFromDocByCategory(e){let n=[];for(let l of e("div.item")){let r=new El;r.book_id=e(l).find("a:first")[0].attribs.href;let i=e(l).find("img:first")[0];r.book_name=i.attribs.alt,r.book_pic=i.attribs.src,r.book_remarks=e(l).find("span:first")[0].children[0].data.trim(),n.push(r)}return n}async parseVodDetailFromDoc(e,n){let l=new _i;l.book_name=e("[property$=book_name]")[0].attribs.content,l.book_year=e("[property$=update_time]")[0].attribs.content,l.book_director=e("[property$=author]")[0].attribs.content,l.book_content=e("[property$=description]")[0].attribs.content,l.book_pic=e(e('[class="cover"]')).find("img")[0].attribs.src,l.book_id=n;let r={};if(n!==void 0){e=await this.getHtml(this.siteUrl+n+"list.html");let i=[],s=e('dl>dd>a[href*="/html/"]');for(let a of s){let u=e(a).text().trim(),o=a.attribs.href;i.push(u+"$"+o)}r.\u6700\u65B0\u7AE0\u8282=i.slice(-10).join("#"),r.\u76EE\u5F55=i.join("#")}return l.volumes=M.keys(r).join("$$$"),l.urls=M.values(r).join("$$$"),l}async setClasses(){let e=await this.getHtml();for(let n of e('div.nav > ul > li > a[href!="/"]'))this.classes.push({type_id:n.attribs.href.replace(/\//g,""),type_name:n.children[0].data.trim(),tline:2})}async setHomeVod(){let e=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(e)}async setDetail(e){let n=await
`).trim(),n=i("a.Readpage_down")[0].attribs.href,n.indexOf("_")<0)break}this.playUrl={content:r+`
`}}catch{this.playUrl={content:""}}}async search(e,n){let l=await req(`${this.siteUrl}/user/hm.html?q=${encodeURIComponent(e)}`,{headers:{accept:"application/json","User-Agent":ea,Referer:`${this.siteUrl}/s?q=${encodeURIComponent(e)}`}}),i=(M.isArray(l.headers["set-cookie"])?l.headers["set-cookie"].join(";;;"):l.headers["set-cookie"]).split(";;;"),s={};for(let c of i){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":ea,cookie:"hm="+s.hm,Referer:`${this.siteUrl}/s?q=${encodeURIComponent(e)}`}}),u=JSON.parse(a.content),o=[];for(let c of u)o.push({book_id:c.url_list,book_name:c.articlename,book_pic:c.url_img,book_remarks:c.author});return{tline:2,list:o}}async proxy(e,n){await this.jadeLog.debug(`\u6B63\u5728\u8BBE\u7F6E\u53CD\u5411\u4EE3\u7406 segments = ${e.join(",")},headers = ${JSON.stringify(n)}`);let l=e[0],r=y2(e[1]);if(l==="img"){await this.jadeLog.debug(`\u53CD\u5411\u4EE3\u7406ID\u4E3A:${r}`);let i=await this.getHtml(this.siteUrl+r),s=await this.parseVodDetailFromDoc(i),a;return M.isEmpty(n)?a=await req(s.book_pic,{buffer:2,headers:{Referer:r,"User-Agent":ql}}):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:""})}},qn=new pT;var fT=class extends De{constructor(){super()}getName(){return qn.getName()}getAppName(){return qn.getAppName()}getJSName(){return qn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await qn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await qn.initCookie(e.server.config.biliCookie),await qn.spiderInit(e),qn.cfgObj.code=0,qn.catOpenStatus=!0,qn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await qn.setClasses(),this.classes=qn.classes}async setFilterObj(){await qn.setFilterObj(),this.filterObj=qn.filterObj}async setHomeVod(){await qn.setHomeVod(),this.homeVodList=qn.homeVodList}async setCategory(e,n,l,r){await qn.setCategory(e,n,l,r),this.vodList=qn.vodList}async setDetail(e){await qn.setDetail(e),this.vodDetail=qn.vodDetail}async setPlay(e,n,l){await qn.setPlay(e,n,l),this.playUrl=qn.playUrl,this.result=qn.result}async setSearch(e,n,l){await qn.setSearch(e,n,l),this.vodList=qn.vodList,this.result=qn.result}async setProxy(e,n){return await qn.proxy(e,n)}},za=new fT;async function GQ(t,e){return await za.init(t,e)}async function JQ(t,e){return await za.home(t,e)}async function aOe(t,e){return await za.homeVod(t,e)}async function KQ(t,e){return await za.category(t,e)}async function XQ(t,e){return await za.detail(t,e)}async function WQ(t,e){return await za.play(t,e)}async function YQ(t,e){return await za.search(t,e)}async function uOe(t,e){return await za.proxy(t,e)}var QQ={meta:{key:qn.getJSName(),name:qn.getName(),type:qn.getType()},api:async t=>{t.post("/init",GQ),t.post("/home",JQ),t.post("/category",KQ),t.post("/detail",XQ),t.post("/play",WQ),t.post("/search",YQ),t.get("/proxy/:what/:ids/:end",uOe)},spider:{init:GQ,home:JQ,homeVod:aOe,category:KQ,detail:XQ,play:WQ,search:YQ}};function oOe(t){return t.trim().replace(/<|>|《|》/g,"").replace(/\$|#/g," ").trim()}var dT=class extends Fe{constructor(){super(),this.siteUrl="https://api.bookan.com.cn"}getName(){return"\u{1F3B5}\u2503\u770B\u4E66\u2503\u{1F3B5}"}getAppName(){return"\u770B\u4E66"}getJSName(){return"bookan"}getType(){return 10}async parseVodShortListFromJson(e){let n=[];for(let l of e.list)n.push({book_id:l.id,book_name:l.name,book_pic:l.cover,book_remarks:l.extra.author});return n}async setClasses(){this.classes=[{type_id:"1305",type_name:"\u5C11\u5E74\u8BFB\u7269"},{type_id:"1304",type_name:"\u513F\u7AE5\u6587\u5B66"},{type_id:"1320",type_name:"\u56FD\u5B66\u7ECF\u5178"},{type_id:"1306",type_name:"\u6587\u827A\u
2024-04-02 15:03:09 +08:00
/*! Bundled license information:
uri-js/dist/es5/uri.all.js:
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
forwarded/index.js:
(*!
* forwarded
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*)
proxy-addr/index.js:
(*!
* proxy-addr
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*)
toad-cache/dist/toad-cache.cjs:
(**
* toad-cache
*
* @copyright 2024 Igor Savin <kibertoad@gmail.com>
* @license MIT
* @version 3.7.0
*)
cookie/index.js:
(*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
mime-db/index.js:
(*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*)
mime-types/index.js:
(*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
rwlock/lib/lock.js:
(*! ReadWriteLock - v5.0.0 - 2015-01-16
* Author: Alberto La Rocca <a71104@gmail.com> (https://github.com/71104)
* Released under the MIT license
* Copyright (c) 2015 Alberto La Rocca *)
*/