tvbox/cat/dist/index.js

518 lines
2.4 MiB
JavaScript
Raw Normal View History

2024-05-22 10:56:27 +08:00
var tne=Object.create;var W8=Object.defineProperty;var nne=Object.getOwnPropertyDescriptor;var lne=Object.getOwnPropertyNames;var rne=Object.getPrototypeOf,ine=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zA=(t,e)=>{for(var n in e)W8(t,n,{get:e[n],enumerable:!0})},GA=(t,e,n,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of lne(e))!ine.call(t,r)&&r!==n&&W8(t,r,{get:()=>e[r],enumerable:!(l=nne(e,r))||l.enumerable});return t};var Zl=(t,e,n)=>(n=t!=null?tne(rne(t)):{},GA(e||!t||!t.__esModule?W8(n,"default",{value:t,enumerable:!0}):n,t)),sne=t=>GA(W8({},"__esModule",{value:!0}),t);var KA=k((INe,JA)=>{"use strict";function ane(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}}JA.exports=ane});var Jd=k((RNe,Gd)=>{"use strict";var une=KA();function XA(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=une(one),r=null,i=null,s=0,a=null,u={push:_,drain:X3,saturated:X3,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:X3,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||X3,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||X3,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=X3}function g(){r=null,i=null,u.drain(),u.drain=X3}function v(x){a=x}}function X3(){}function one(){this.value=null,this.callback=X3,this.next=null,this.release=X3,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=X3,t.errorHandler&&i(n,s),r.call(t.context,n,l),t.release(t)}}function cne(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=XA(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(X3),f}function u(c){var f=new Promise(function(m,d){s(c,function(y,_){if(y){d(y);return}m(_)})});return f.catch(X3),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}}Gd.exports=XA;Gd.exports.promise=cne});var Xd=k((kNe,WA)=>{"use strict";var{inherits:pne,format:Kd}=require("util");function Eu(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=Kd(e,r,i,s):r&&i?this.message=Kd(e,r,i):r?this.message=Kd(e,r):this.message=e}return l.prototype[Symbol.toStringTag]="Error",l.prototype.toString=function(){return`${this.name} [${this.code}]: ${this.message}`},pne(l,n),l}WA.exports={createError:Eu,AVV_ERR_EXPOSE_ALREADY_DEFINED:Eu("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' () is already defined, specify an expose option"),AVV_ERR_CALLBACK_NOT_FN:Eu("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-22 10:56:27 +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 rO=k((PNe,lO)=>{"use strict";var fne=QA(),ZA=Symbol("avvio.TimeTree.untrackNode"),Wd=Symbol("avvio.TimeTree.trackNode"),eO=Symbol("avvio.TimeTree.getParent"),tO=Symbol("avvio.TimeTree.getNode"),nO=Symbol("avvio.TimeTree.addNode"),Yd=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Wd](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])}[ZA](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)}[eO](e){if(e===null)return this.root;let n=this.tableLabel.get(e);return n.id?n:n[n.length-1]}[tO](e){return this.tableId.get(e)}[nO](e,n,l){if(e===null)return this.root={id:"root",label:n,start:l,nodes:[]},this[Wd](this.root),this.root.id;let i=this[eO](e),s=`${n}-${Math.random()}`,a={id:s,parent:e,start:l,label:n,nodes:[]};return i.nodes.push(a),this[Wd](a),s}start(e,n,l=Date.now()){return this[nO](e,n,l)}stop(e,n=Date.now()){let l=this[tO](e);l&&(l.stop=n,l.diff=l.stop-l.start||0,this[ZA](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 fne(n)}};lO.exports=Yd});var sO=k((LNe,iO)=>{var zo=1e3,Go=zo*60,Jo=Go*60,bu=Jo*24,dne=bu*7,hne=bu*365.25;iO.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return mne(t);if(n==="number"&&isFinite(t))return e.long?gne(t):yne(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function mne(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*hne;case"weeks":case"week":case"w":return n*dne;case"days":case"day":case"d":return n*bu;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Jo;case"minutes":case"minute":case"mins":case"min":case"m":return n*Go;case"seconds":case"second":case"secs":case"sec":case"s":return n*zo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function yne(t){var e=Math.abs(t);return e>=bu?Math.round(t/bu)+"d":e>=Jo?Math.round(t/Jo)+"h":e>=Go?Math.round(t/Go)+"m":e>=zo?Math.round(t/zo)+"s":t+"ms"}function gne(t){var e=Math.abs(t);return e>=bu?Y8(t,e,bu,"day"):e>=Jo?Y8(t,e,Jo,"hour"):e>=Go?Y8(t,e,Go,"minute"):e>=zo?Y8(t,e,zo,"second"):t+" ms"}function Y8(t,e,n,l){var r=e>=n*1.5;return Math.round(t/n)+" "+l+(r?"s":"")}});var Qd=k((FNe,aO)=>{function vne(t){n.debug=n,n.default=n,n.coerce=u,n.disable=i,n.enable=r,n.enabled=s,n.humanize=sO(),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 M=S[v];O=I.call(w,M),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-22 10:56:27 +08:00
`+i),t.push(r+"m+"+ec.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Rne()+e+" "+t[0]}function Rne(){return x2.inspectOpts.hideDate?"":new Date().toISOString()+" "}function kne(...t){return process.stderr.write(Z8.format(...t)+`
`)}function Dne(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Pne(){return process.env.DEBUG}function Lne(t){t.inspectOpts={};let e=Object.keys(x2.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=x2.inspectOpts[e[n]]}ec.exports=Qd()(x2);var{formatters:dO}=ec.exports;dO.o=function(t){return this.inspectOpts.colors=this.useColors,Z8.inspect(t,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};dO.O=function(t){return this.inspectOpts.colors=this.useColors,Z8.inspect(t,this.inspectOpts)}});var tc=k((MNe,eh)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?eh.exports=uO():eh.exports=hO()});var mO=k(($Ne,lh)=>{"use strict";var Fne=Jd(),jne=require("events").EventEmitter,Une=require("util").inherits,d2=tc()("avvio"),{AVV_ERR_READY_TIMEOUT:Mne}=Xd(),th=Symbol.for("plugin-meta");function $ne(t,e){return t[th]&&t[th].name?t[th].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 Bne(){let t={};return t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),t}function Xo(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=$ne(e,n),this.isAfter=l,this.q=Fne(t,Hne,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Une(Xo,jne);Xo.prototype.exec=function(t,e){let n=this.func,l=!1,r=this.name;if(this.parent._error&&!this.isAfter){d2("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 d2("override errored",r),e(u)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,d2("exec",r);let i,s=u=>{if(l){d2("loading complete",r);return}this._error=u,d2(u?"exec errored":"exec completed",r),l=!0,i&&clearTimeout(i),e(u)};this.timeout>0&&(d2("setting up timeout",r,this.timeout),i=setTimeout(function(){d2("timed out",r),i=null;let u=new Mne(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"&&(d2("exec: resolving promise",r),a.then(()=>process.nextTick(s),u=>process.nextTick(s,u)))};Xo.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();let t=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(d2("rejecting promise",this.name,n),this._promise.reject(n)):(d2("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=Bne(),e=this._promise.promise,this.server?t():this.on("start",t)),e};Xo.prototype.enqueue=function(t,e){d2("enqueue",this.name,t.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(t,e)};Xo.prototype.finish=function(t,e){d2("finish",this.name,t);let n=()=>{this.loaded||(d2("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(d2("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){let r=()=>{d2("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(r,r),this._promise=null}else n();else d2("delayed",this.name),this.q.drain=()=>{d2("drain",this.name),this.q.drain=Vne,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Hne(t,e){let n=this;process.nextTick(nh.bind(n),t,e)}function nh(t,e){if(typeof t.func.then=="function"){t.func.then(l=>{typeof l.default=="function"&&(l=l.default),t.func=l,nh.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 Vne(){}lh.exports=Xo;lh.exports.loadPlugin=nh});var EO=k((BNe,uh)=>{"use strict";var yO=Jd(),qne=require("events").EventEmitter,zne=require("util").inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:rh,AVV_ERR_CALLBACK_NOT_FN:c1,AVV_ERR_PLUGIN_NOT_VALID:Gne,AVV_ERR_ROOT_PLG_BOOTED:Jne,AVV_ERR_READY_TIMEOUT:Kne}=Xd(),Xne=rO(),ah=mO(),Wo=tc()("avvio"),nc=Symbol("kAvvio"),ih=Symbol("kThenifyDoNotWrap");function Wne(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 rh(r);if(t[i])throw new rh(i);if(t[s])throw new rh(s);t[r]=function(o,c){return n.use(o,c),this},Object.defineProperty(t,"then",{get:vO.bind(n)}),t[nc]=!0,t[i]=function(o){return typeof o!="function"?n._loadRegistered():(n.after(sh(o,this)),this)},t[s]=function(o){if(o&&typeof o!="function")throw new c1(s,typeof o);return n.ready(o?sh(o,this):void 0)},t[a]=function(o){if(typeof o!="function")throw new c1(a,typeof o);return n.onClose(tle(o,this)),this},t[u]=function(o){if(o&&typeof o!="function")throw new c1(u,typeof o);return o?(n.close(s
causes have become circular...`;let l=Sh(t);return l?(e.add(t),n+`
caused by: `+ZO(l,e)):n},y2e=t=>ZO(t,new Set),eN=(t,e,n)=>{if(!h1(t))return"";let l=n?"":t.message||"";if(e.has(t))return l+": ...";let r=Sh(t);if(r){e.add(t);let i=typeof t.cause=="function";return l+(i?"":": ")+eN(r,e,i)}else return l},g2e=t=>eN(t,new Set);tN.exports={isErrorLike:h1,getErrorCause:Sh,stackWithCauses:y2e,messageWithCauses:g2e}});var xh=k((eCe,lN)=>{"use strict";var v2e=Symbol("circular-ref-tag"),dc=Symbol("pino-raw-err-ref"),nN=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[dc]},set:function(t){this[dc]=t}}});Object.defineProperty(nN,dc,{writable:!0,value:{}});lN.exports={pinoErrProto:nN,pinoErrorSymbols:{seen:v2e,rawSymbol:dc}}});var sN=k((tCe,iN)=>{"use strict";iN.exports=Oh;var{messageWithCauses:_2e,stackWithCauses:E2e,isErrorLike:rN}=Th(),{pinoErrProto:b2e,pinoErrorSymbols:w2e}=xh(),{seen:Ah}=w2e,{toString:S2e}=Object.prototype;function Oh(t){if(!rN(t))return t;t[Ah]=void 0;let e=Object.create(b2e);e.type=S2e.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=_2e(t),e.stack=E2e(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(n=>Oh(n)));for(let n in t)if(e[n]===void 0){let l=t[n];rN(l)?n!=="cause"&&!Object.prototype.hasOwnProperty.call(l,Ah)&&(e[n]=Oh(l)):e[n]=l}return delete t[Ah],e.raw=t,e}});var uN=k((nCe,aN)=>{"use strict";aN.exports=mc;var{isErrorLike:Nh}=Th(),{pinoErrProto:T2e,pinoErrorSymbols:x2e}=xh(),{seen:hc}=x2e,{toString:A2e}=Object.prototype;function mc(t){if(!Nh(t))return t;t[hc]=void 0;let e=Object.create(T2e);e.type=A2e.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=>mc(n))),Nh(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,hc)&&(e.cause=mc(t.cause));for(let n in t)if(e[n]===void 0){let l=t[n];Nh(l)?Object.prototype.hasOwnProperty.call(l,hc)||(e[n]=mc(l)):e[n]=l}return delete t[hc],e.raw=t,e}});var fN=k((lCe,pN)=>{"use strict";pN.exports={mapHttpRequest:O2e,reqSerializer:cN};var Ch=Symbol("pino-raw-req-ref"),oN=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[Ch]},set:function(t){this[Ch]=t}}});Object.defineProperty(oN,Ch,{writable:!0,value:{}});function cN(t){let e=t.info||t.socket,n=Object.create(oN);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 O2e(t){return{req:cN(t)}}});var yN=k((rCe,mN)=>{"use strict";mN.exports={mapHttpResponse:N2e,resSerializer:hN};var Ih=Symbol("pino-raw-res-ref"),dN=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Ih]},set:function(t){this[Ih]=t}}});Object.defineProperty(dN,Ih,{writable:!0,value:{}});function hN(t){let e=Object.create(dN);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function N2e(t){return{res:hN(t)}}});var kh=k((iCe,gN)=>{"use strict";var Rh=sN(),C2e=uN(),yc=fN(),gc=yN();gN.exports={err:Rh,errWithCause:C2e,mapHttpRequest:yc.mapHttpRequest,mapHttpResponse:gc.mapHttpResponse,req:yc.reqSerializer,res:gc.resSerializer,wrapErrorSerializer:function(e){return e===Rh?e:function(l){return e(Rh(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-22 10:56:27 +08:00
if ([o${s}].length !== 1) throw Error()`)()}catch{throw Error(n(i))}})}}});var vc=k((uCe,bN)=>{"use strict";bN.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var SN=k((oCe,wN)=>{"use strict";var k2e=vc();wN.exports=D2e;function D2e({paths:t}){let e=[];var n=0;let l=t.reduce(function(r,i,s){var a=i.match(k2e).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 xN=k((cCe,TN)=>{"use strict";var P2e=vc();TN.exports=L2e;function L2e({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-22 10:56:27 +08:00
${M2e(l,e)}
2024-04-02 15:03:09 +08:00
}
const { censor, secret } = this
2024-05-22 10:56:27 +08:00
${F2e(t,r,i)}
2024-04-02 15:03:09 +08:00
this.compileRestore()
2024-05-22 10:56:27 +08:00
${j2e(n>0,r,i)}
${U2e(e)}
`).bind(s);return e===!1&&(a.restore=u=>s.restore(u)),a}function F2e(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=P2e.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-22 10:56:27 +08:00
`)}function j2e(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-22 10:56:27 +08:00
`:""}function U2e(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-22 10:56:27 +08:00
`}function M2e(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Lh=k((pCe,NN)=>{"use strict";NN.exports={groupRedact:B2e,groupRestore:$2e,nestedRedact:V2e,nestedRestore:H2e};function $2e({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 B2e(t,e,n,l,r){let i=AN(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 H2e(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 V2e(t,e,n,l,r,i,s){let a=AN(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];q2e(t,a,f,n,l,r,i,s)}return t}function Ph(t,e){return t!=null?"hasOwn"in Object?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e):!1}function q2e(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=z2e();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 M=I[N];if(E=m[M],w=n==="*",g)O=$i(O,M,x),v=f,y=ON(E,v-1,n,l,r,i,s,a,c,m,d,y,w,M,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=m1($i(O,M,x),y,e[c]);t.push(F),m[M]=d}else if(E[n]!==d)if(d===void 0&&i!==void 0||Ph(E,n)&&d===y)O=$i(O,M,x);else{O=$i(O,M,x);let F=m1($i(O,n,x+1),y,e[c]);t.push(F),E[n]=d}}}S=null}else{if(y=m[n],O=$i(O,n,x),d=f!==o?y:s?a?i(y,[...l,c,...r]):i(y):i,!(Ph(m,n)&&d===y||d===void 0&&i!==void 0)){let I=m1(O,y,e[c]);t.push(I),m[n]=d}m=m[n]}if(typeof m!="object")break}}}function AN(t,e){for(var n=-1,l=e.length,r=t;r!=null&&++n<l;)r=r[e[n]];return r}function ON(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=m1(S,f,E);w.push(v),o[d]=c}else if(t[n]!==c){if(!(c===void 0&&i!==void 0||Ph(t,n)&&c===f)){let v=m1($i(S,n,g+1),f,E);w.push(v),t[n]=c}}}for(let v in t)typeof t[v]=="object"&&(S=$i(S,v,g),ON(t[v],e-1,n,l,r,i,s,a,u,o,c,f,m,d,y,_,S,w,E,g+1))}function z2e(){return{parent:null,key:null,children:[],depth:0}}function $i(t,e,n){if(t.depth===n)return $i(t.parent,e,n);var l={parent:t,key:e,depth:n,children:[]};return t.children.push(l),l}function m1(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 IN=k((fCe,CN)=>{"use strict";var{groupRestore:G2e,nestedRestore:J2e}=Lh();CN.exports=K2e;function K2e({secret:t,wcLen:e}){return function(){if(this.restore)return;let l=Object.keys(t),r=X2e(t,l),i=e>0,s=i?{secret:t,groupRestore:G2e,nestedRestore:J2e}:{secret:t};this.restore=Function("o",W2e(r,l,i)).bind(s)}}function X2e(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-22 10:56:27 +08:00
`}).join("")}function W2e(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-05-22 10:56:27 +08:00
`}});var kN=k((dCe,RN)=>{"use strict";RN.exports=Y2e;function Y2e(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 LN=k((hCe,PN)=>{"use strict";var DN=EN(),Q2e=SN(),Z2e=xN(),e3e=IN(),{groupRedact:t3e,nestedRedact:n3e}=Lh(),l3e=kN(),r3e=vc(),i3e=DN(),Fh=t=>t;Fh.restore=Fh;var s3e="[REDACTED]";jh.rx=r3e;jh.validator=DN;PN.exports=jh;function jh(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:s3e,i=typeof r=="function",s=i&&r.length>1;if(e.length===0)return n||Fh;i3e({paths:e,serialize:n,censor:r});let{wildcards:a,wcLen:u,secret:o}=Q2e({paths:e,censor:r}),c=e3e({secret:o,wcLen:u}),f="strict"in t?t.strict:!0;return Z2e({secret:o,wcLen:u,serialize:n,strict:f,isCensorFct:i,censorFctTakesPath:s},l3e({secret:o,censor:r,compileRestore:c,serialize:n,groupRedact:t3e,nestedRedact:n3e,wildcards:a,wcLen:u}))}});var e0=k((mCe,FN)=>{"use strict";var a3e=Symbol("pino.setLevel"),u3e=Symbol("pino.getLevel"),o3e=Symbol("pino.levelVal"),c3e=Symbol("pino.levelComp"),p3e=Symbol("pino.useLevelLabels"),f3e=Symbol("pino.useOnlyCustomLevels"),d3e=Symbol("pino.mixin"),h3e=Symbol("pino.lsCache"),m3e=Symbol("pino.chindings"),y3e=Symbol("pino.asJson"),g3e=Symbol("pino.write"),v3e=Symbol("pino.redactFmt"),_3e=Symbol("pino.time"),E3e=Symbol("pino.timeSliceIndex"),b3e=Symbol("pino.stream"),w3e=Symbol("pino.stringify"),S3e=Symbol("pino.stringifySafe"),T3e=Symbol("pino.stringifiers"),x3e=Symbol("pino.end"),A3e=Symbol("pino.formatOpts"),O3e=Symbol("pino.messageKey"),N3e=Symbol("pino.errorKey"),C3e=Symbol("pino.nestedKey"),I3e=Symbol("pino.nestedKeyStr"),R3e=Symbol("pino.mixinMergeStrategy"),k3e=Symbol("pino.msgPrefix"),D3e=Symbol("pino.wildcardFirst"),P3e=Symbol.for("pino.serializers"),L3e=Symbol.for("pino.formatters"),F3e=Symbol.for("pino.hooks"),j3e=Symbol.for("pino.metadata");FN.exports={setLevelSym:a3e,getLevelSym:u3e,levelValSym:o3e,levelCompSym:c3e,useLevelLabelsSym:p3e,mixinSym:d3e,lsCacheSym:h3e,chindingsSym:m3e,asJsonSym:y3e,writeSym:g3e,serializersSym:P3e,redactFmtSym:v3e,timeSym:_3e,timeSliceIndexSym:E3e,streamSym:b3e,stringifySym:w3e,stringifySafeSym:S3e,stringifiersSym:T3e,endSym:x3e,formatOptsSym:A3e,messageKeySym:O3e,errorKeySym:N3e,nestedKeySym:C3e,wildcardFirstSym:D3e,needsMetadataGsym:j3e,useOnlyCustomLevelsSym:f3e,formattersSym:L3e,hooksSym:F3e,nestedKeyStrSym:I3e,mixinMergeStrategySym:R3e,msgPrefixSym:k3e}});var $h=k((yCe,$N)=>{"use strict";var Mh=LN(),{redactFmtSym:U3e,wildcardFirstSym:_c}=e0(),{rx:Uh,validator:M3e}=Mh,jN=M3e({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})`}),UN="[Redacted]",MN=!1;function $3e(t,e){let{paths:n,censor:l}=B3e(t),r=n.reduce((a,u)=>{Uh.lastIndex=0;let o=Uh.exec(u),c=Uh.exec(u),f=o[1]!==void 0?o[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):o[0];if(f==="*"&&(f=_c),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!==_c&&a[f].length===0&&a[f].push(...a[_c]||[]),f===_c&&Object.keys(a).forEach(function(y){a[y]&&a[y].push(d)}),a[f].push(d),a},{}),i={[U3e]:Mh({paths:n,censor:l,serialize:e,strict:MN})},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]=Mh({paths:r[u],censor:o,serialize:e,strict:MN})}return a},i)}function B3e(t){if(Array.isArray(t))return t={paths:t,censor:UN},jN(t),t;let{paths:e,censor:n=UN,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-22 10:56:27 +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}"... ${Tu(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="",M="";S!==""&&(w+=S,v=`,
${w}`,I=" ");let F=Math.min(N,s);r&&!pm(E)&&(O=cm(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+=`${M}${ws(Q)}:${I}${W}`,M=v)}if(N>s){let te=N-s;g+=`${M}"...":${I}"${Tu(te)} not stringified"`,M=v}return S!==""&&M.length>1&&(g=`
2024-04-17 11:16:03 +08:00
${w}${g}
2024-05-22 10:56:27 +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 ws(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-22 10:56:27 +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 M=u(String(I),d[I],y,_,S,w);if(g+=M!==void 0?M:"null",d.length-1>s){let F=d.length-s-1;g+=`${v}"... ${Tu(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-22 10:56:27 +08:00
${w}`,x=" ");let O="";for(let N of _){let I=u(N,d[N],y,_,S,w);I!==void 0&&(g+=`${O}${ws(N)}:${x}${I}`,O=v)}return S!==""&&O.length>1&&(g=`
2024-04-17 11:16:03 +08:00
${w}${g}
2024-05-22 10:56:27 +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 ws(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=`
${S}`,M=`,
${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+=M}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+=`${M}"... ${Tu(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-22 10:56:27 +08:00
${S}`,x="",O="",N=Math.min(g,s);pm(d)&&(x+=HC(d,v,s),E=E.slice(d.length),N-=d.length,O=v),r&&(E=cm(E)),y.push(d);for(let I=0;I<N;I++){let M=E[I],F=o(M,d[M],y,_,S);F!==void 0&&(x+=`${O}${ws(M)}: ${F}`,O=v)}if(g>s){let I=g-s;x+=`${O}"...": "${Tu(I)} not stringified"`,O=v}return O!==""&&(x=`
2024-04-17 11:16:03 +08:00
${S}${x}
2024-05-22 10:56:27 +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 ws(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;_+=`,"... ${Tu(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);pm(d)&&(_+=HC(d,",",s),S=S.slice(d.length),g-=d.length,E=","),r&&(S=cm(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}${ws(x)}:${O}`,E=",")}if(w>s){let v=w-s;_+=`${E}"...":"${Tu(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,[],fse(d),_,"")}if(_.length!==0)return o("",m,[],_,"")}return c("",m,[])}return f}});var XC=k((DCe,KC)=>{"use strict";var hm=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:JC}=Cc(),hse=JC.info;function mse(t,e){let n=0;t=t||[],e=e||{dedupe:!1};let l=Object.create(JC);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,[hm]:!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=gse(d.length,e.dedupe);_se(S,d.length,e.dedupe);S=vse(S,e.dedupe))if(f=d[S],f.level<=m){if(y!==0&&y!==f.level)break;if(_=f.stream,_[hm]){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:_=hse;let S={stream:m,level:_,levelVal:void 0,id:n++};return d.unshift(S),d.sort(yse),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,[hm]:!0}}}function yse(t,e){return t.level-e.level}function gse(t,e){return e?t-1:0}function vse(t,e){return e?t-1:t+1}function _se(t,e,n){return n?t>=0:t<e}KC.exports=mse});var uI=k((PCe,W3)=>{"use strict";var Ese=require("os"),lI=kh(),bse=Dh(),wse=$h(),rI=HN(),Sse=BC(),iI=e0(),{configure:Tse}=GC(),{assertDefaultLevelFound:xse,mappings:sI,genLsCache:Ase,genLevelComparison:Ose,assertLevelComparison:Nse}=im(),{DEFAULT_LEVELS:Cse,SORTING_ORDER:Ise}=Cc(),{createArgsNormalizer:Rse,asChindings:kse,buildSafeSonicBoom:WC,buildFormatters:Dse,stringify:mm,normalizeDestFileDescriptor:YC,noop:Pse}=Nc(),{version:Lse}=sm(),{chindingsSym:QC,redactFmtSym:Fse,serializersSym:ZC,timeSym:jse,timeSliceIndexSym:Use,streamSym:Mse,stringifySym:eI,stringifySafeSym:ym,strin
2024-05-06 10:35:10 +08:00
`:`
2024-05-22 10:56:27 +08:00
`),we=kse.bind(null,{[QC]:"",[ZC]:s,[tI]:Q,[eI]:mm,[ym]:M,[nI]:F}),se="";f!==null&&(m===void 0?se=we(f):se=we(Object.assign({},f,{name:m})));let ee=a instanceof Function?a:a?aI:Zse,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"`);xse(d,y,E);let P=sI(y,E);Nse(_);let G=Ose(_);return Object.assign(e,{levels:P,[Jse]:G,[Kse]:E,[Mse]:l,[jse]:ee,[Use]:me,[eI]:mm,[ym]:M,[tI]:Q,[Bse]:ce,[Hse]:W,[Vse]:u,[qse]:o,[zse]:c,[Wse]:c?`,${JSON.stringify(c)}:{`:"",[ZC]:s,[Gse]:S,[Yse]:w,[QC]:se,[nI]:F,[Xse]:v,silent:Pse,onChild:N,[Qse]:I}),Object.setPrototypeOf(e,Sse()),Ase(e),e[$se](d),e}W3.exports=gm;W3.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=YC(t.dest||process.stdout.fd),WC(t)):WC({dest:YC(t),minLength:0});W3.exports.transport=Zh();W3.exports.multistream=XC();W3.exports.levels=sI();W3.exports.stdSerializers=iae;W3.exports.stdTimeFunctions=Object.assign({},rI);W3.exports.symbols=iI;W3.exports.version=Lse;W3.exports.default=gm;W3.exports.pino=gm});var g1=k((LCe,dI)=>{"use strict";var sae=QO(),Rc=uI(),{serializersSym:oI}=Rc.symbols,{FST_ERR_LOG_INVALID_DESTINATION:aae,FST_ERR_LOG_INVALID_LOGGER:uae}=M2();function cI(t){if(t.stream&&t.file)throw new aae;t.file&&(t.stream=Rc.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[oI]&&(t.serializers=Object.assign({},t.serializers,e[oI])),l=e.child({},t),t.logger=e,t.genReqId=n):l=Rc(t,t.stream),l}var vm={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:Rc.stdSerializers.err,res:function(e){return{statusCode:e.statusCode}}};function oae(){let t=process.hrtime();return t[0]*1e3+t[1]/1e6}function cae(t){if(!t.logger){let l=sae;return l.child=()=>l,{logger:l,hasLogger:!1}}if(pI(t.logger))return{logger:cI({logger:t.logger,serializers:Object.assign({},vm,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({},vm,e.serializers),t.logger=e,{logger:cI(t.logger),hasLogger:!0}}function pI(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 uae(l.join(","))}else return!0}function pae(t,e,n,l,r){let i={[t.requestIdLogLabel]:l},s=t.childLoggerFactory.call(t.server,e,i,r||{},n);return t.childLoggerFactory!==fI&&pI(s,!0),s}function fI(t,e,n){return t.child(e,n)}dI.exports={createLogger:cae,createChildLogger:pae,defaultChildLoggerFactory:fI,serializers:vm,now:oae}});var v1=k((FCe,hI)=>{"use strict";hI.exports=fae;function l0(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function fae(t){if(t=t||{},t.circles)return dae(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]=l0(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]=l0(a):i[s]=n(a)}return i}function l(r){if(typeof r!="object"||
`:""},this._extScope=e,this._scope=new wr.Scope({parent:e}),this._nodes=[new Dm]}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 Om(e,i,l)),i}const(e,n,l){return this._def(wr.varKinds.const,e,n,l)}let(e,n,l){return this._def(wr.varKinds.let,e,n,l)}var(e,n,l){return this._def(wr.varKinds.var,e,n,l)}assign(e,n,l){return this._leafNode(new Fc(e,n,l))}add(e,n){return this._leafNode(new Nm(e,Rt.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==Yt.nil&&this._leafNode(new km(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,Yt.addCodeArg)(n,r));return n.push("}"),new Yt._Code(n)}if(e,n,l){if(this._blockNode(new Ou(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 Ou(e))}else(){return this._elseNode(new i0)}endIf(){return this._endBlockNode(Ou,i0)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new Pm(e),n)}forRange(e,n,l,r,i=this.opts.es5?wr.varKinds.var:wr.varKinds.let){let s=this._scope.toName(e);return this._for(new Lm(i,s,n,l),()=>r(s))}forOf(e,n,l,r=wr.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let s=n instanceof Yt.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Yt._)`${s}.length`,a=>{this.var(i,(0,Yt._)`${s}[${a}]`),l(i)})}return this._for(new jc("of",r,i,n),()=>l(i))}forIn(e,n,l,r=this.opts.es5?wr.varKinds.var:wr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Yt._)`Object.keys(${n})`,l);let i=this._scope.toName(e);return this._for(new jc("in",r,i,n),()=>l(i))}endFor(){return this._endBlockNode(Nu)}label(e){return this._leafNode(new Cm(e))}break(e){return this._leafNode(new Im(e))}return(e){let n=new T1;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(T1)}try(e,n,l){if(!n&&!l)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new Fm;if(this._blockNode(r),this.code(e),n){let i=this.name("e");this._currNode=r.catch=new x1(i),n(i)}return l&&(this._currNode=r.finally=new A1,this.code(l)),this._endBlockNode(x1,A1)}throw(e){return this._leafNode(new Rm(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=Yt.nil,l,r){return this._blockNode(new S1(e,n,l)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(S1)}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 Ou))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=jm;function Cu(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function Uc(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-05-22 10:56:27 +08:00
|| ${s} === "boolean" || ${r} === null`).assign(a,(0,Ot._)`[${r}]`)}}}function bue({gen:t,parentData:e,parentDataProperty:n},l){t.if((0,Ot._)`${e} !== undefined`,()=>t.assign((0,Ot._)`${e}[${n}]`,l))}function qm(t,e,n,l=N1.Correct){let r=l===N1.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===N1.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)}}A2.checkDataType=qm;function zm(t,e,n,l){if(t.length===1)return qm(t[0],e,n,l);let r,i=(0,$I.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,qm(s,e,n,l));return r}A2.checkDataTypes=zm;var wue={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ot._)`{type: ${t}}`:(0,Ot._)`{type: ${e}}`};function Gm(t){let e=Sue(t);(0,yue.reportError)(e,wue)}A2.reportTypeError=Gm;function Sue(t){let{gen:e,data:n,schema:l}=t,r=(0,$I.schemaRefOrVal)(t,l,"type");return{gen:e,keyword:"type",data:n,schema:l.type,schemaCode:r,schemaValue:r,parentSchema:l,params:{},it:t}}});var qI=k(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.assignDefaults=void 0;var o0=st(),Tue=Nt();function xue(t,e){let{properties:n,items:l}=t.schema;if(e==="object"&&n)for(let r in n)VI(t,r,n[r].default);else e==="array"&&Array.isArray(l)&&l.forEach((r,i)=>VI(t,i,r.default))}Bc.assignDefaults=xue;function VI(t,e,n){let{gen:l,compositeRule:r,data:i,opts:s}=t;if(n===void 0)return;let a=(0,o0._)`${i}${(0,o0.getProperty)(e)}`;if(r){(0,Tue.checkStrictMode)(t,`default is ignored for: ${a}`);return}let u=(0,o0._)`${a} === undefined`;s.useDefaults==="empty"&&(u=(0,o0._)`${u} || ${a} === null || ${a} === ""`),l.if(u,(0,o0._)`${a} = ${(0,o0.stringify)(n)}`)}});var O2=k(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.validateUnion=Yn.validateArray=Yn.usePattern=Yn.callValidateCode=Yn.schemaProperties=Yn.allSchemaProperties=Yn.noPropertyInData=Yn.propertyInData=Yn.isOwnProperty=Yn.hasPropFunc=Yn.reportMissingProp=Yn.checkMissingProp=Yn.checkReportMissingProp=void 0;var fl=st(),Jm=Nt(),xs=Q3(),Aue=Nt();function Oue(t,e){let{gen:n,data:l,it:r}=t;n.if(Xm(n,l,e,r.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fl._)`${e}`},!0),t.error()})}Yn.checkReportMissingProp=Oue;function Nue({gen:t,data:e,it:{opts:n}},l,r){return(0,fl.or)(...l.map(i=>(0,fl.and)(Xm(t,e,i,n.ownProperties),(0,fl._)`${r} = ${i}`)))}Yn.checkMissingProp=Nue;function Cue(t,e){t.setParams({missingProperty:e},!0),t.error()}Yn.reportMissingProp=Cue;function zI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fl._)`Object.prototype.hasOwnProperty`})}Yn.hasPropFunc=zI;function Km(t,e,n){return(0,fl._)`${zI(t)}.call(${e}, ${n})`}Yn.isOwnProperty=Km;function Iue(t,e,n,l){let r=(0,fl._)`${e}${(0,fl.getProperty)(n)} !== undefined`;return l?(0,fl._)`${r} && ${Km(t,e,n)}`:r}Yn.propertyInData=Iue;function Xm(t,e,n,l){let r=(0,fl._)`${e}${(0,fl.getProperty)(n)} === undefined`;return l?(0,fl.or)(r,(0,fl.not)(Km(t,e,n))):r}Yn.noPropertyInData=Xm;function GI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Yn.allSchemaProperties=GI;function Rue(t,e){return GI(e).filter(n=>!(0,Jm.alwaysValidSchema)(t,e[n]))}Yn.schemaProperties=Rue;function kue({schemaCode:t,data:e,it:{gen:n,topSchemaRef:l,schemaPath:r,errorPath:i},it:s},a,u,o){let c=o?(0,fl._)`${t}, ${e}, ${l}${r}`:e,f=[[xs.default.instancePath,(0,fl.strConcat)(xs.default.instancePath,i)],[xs.default.parentData,s.parentData],[xs.default.parentDataProperty,s.parentDataProperty],[xs.default.rootData,xs.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-05-22 10:56:27 +08:00
deps: ${n}}`};var c4e={keyword:"dependencies",type:"object",schemaType:"object",error:ei.error,code(t){let[e,n]=p4e(t);rk(t,e),ik(t,n)}};function p4e({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 rk(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,G1.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,G1.checkReportMissingProp)(t,o)}):(n.if((0,Ly._)`${u} && (${(0,G1.checkMissingProp)(t,a,i)})`),(0,G1.reportMissingProp)(t,i),n.else())}}ei.validatePropertyDeps=rk;function ik(t,e=t.schema){let{gen:n,data:l,keyword:r,it:i}=t,s=n.name("valid");for(let a in e)(0,o4e.alwaysValidSchema)(i,e[a])||(n.if((0,G1.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))}ei.validateSchemaDeps=ik;ei.default=c4e});var uk=k(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});var ak=st(),f4e=Nt(),d4e={message:"property name must be valid",params:({params:t})=>(0,ak._)`{propertyName: ${t.propertyName}}`},h4e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:d4e,code(t){let{gen:e,schema:n,data:l,it:r}=t;if((0,f4e.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,ak.not)(i),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(i)}};Fy.default=h4e});var Uy=k(jy=>{"use strict";Object.defineProperty(jy,"__esModule",{value:!0});var t9=O2(),xr=st(),m4e=Q3(),n9=Nt(),y4e={message:"must NOT have additional properties",params:({params:t})=>(0,xr._)`{additionalProperty: ${t.additionalProperty}}`},g4e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:y4e,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,n9.alwaysValidSchema)(s,n))return;let o=(0,t9.allSchemaProperties)(l.properties),c=(0,t9.allSchemaProperties)(l.patternProperties);f(),t.ok((0,xr._)`${i} === ${m4e.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,n9.schemaRefOrVal)(s,l.properties,"properties");w=(0,t9.isOwnProperty)(e,E,S)}else o.length?w=(0,xr.or)(...o.map(E=>(0,xr._)`${S} === ${E}`)):w=xr.nil;return c.length&&(w=(0,xr.or)(w,...c.map(E=>(0,xr._)`${(0,t9.usePattern)(t,E)}.test(${S})`))),(0,xr.not)(w)}function d(S){e.code((0,xr._)`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,n9.alwaysValidSchema)(s,n)){let w=e.name("valid");u.removeAdditional==="failing"?(_(S,w,!1),e.if((0,xr.not)(w),()=>{t.reset(),d(S)})):(_(S,w),a||e.if((0,xr.not)(w),()=>e.break()))}}function _(S,w,E){let g={keyword:"additionalProperties",dataProp:S,dataPropType:n9.Type.Str};E===!1&&Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(g,w)}}};jy.default=g4e});var pk=k($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});var v4e=f0(),ok=O2(),My=Nt(),ck=Uy(),_4e={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&&ck.default.code(new v4e.KeywordCxt(i,ck.default,"additionalProperties"));let s=(0,ok.allSchemaProperties)(n);for(let f of s)i.definedProperties.add(f);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=My.mergeEvaluated.props(e,(0,My.toHash)(s),i.props));let a=s.filter(f=>!(0,My.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-05-22 10:56:27 +08:00
module.exports = ${t.toString()}(validator, serializer)`}hg.exports=g5e;hg.exports.dependencies={Serializer:bm(),Validator:dg()}});var cD=k((rRe,oD)=>{"use strict";var{dependencies:v5e}=mg(),{Serializer:_5e,Validator:lRe}=v5e,E5e={mode:"standalone"},b5e=_5e.restoreFromState(E5e),w5e=null;oD.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}(w5e,b5e)});var W1=k((iRe,hD)=>{"use strict";var pD=require("node:http").STATUS_CODES,S5e=vh(),{kReplyHeaders:ju,kReplyNextErrorHandler:h9,kReplyIsRunningOnErrorHook:T5e,kReplyHasStatusCode:x5e,kRouteContext:dD}=m2(),{FST_ERR_REP_INVALID_PAYLOAD_TYPE:A5e,FST_ERR_FAILED_ERROR_SERIALIZATION:O5e}=M2(),{getSchemaSerializer:N5e}=_1(),yg=cD(),C5e={func:R5e,toJSON(){return this.func.name.toString()+"()"}};function I5e(t,e,n){t[T5e]=!1;let l=t[dD];if(t[h9]===!1){fD(e,t,function(a,u){try{a.raw.writeHead(a.raw.statusCode,a[ju])}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[h9]||l.errorHandler;t[h9]=Object.getPrototypeOf(r),delete t[ju]["content-type"],delete t[ju]["content-length"];let i=r.func;if(!i){t[h9]=!1,fD(e,t,n);return}let s=i(e,t.request,t);s!==void 0&&(s!==null&&typeof s.then=="function"?S5e(s,t):t.send(s))}function R5e(t,e,n){if(D5e(t,n),!n[x5e]||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 fD(t,e,n){let l=e.raw,r=e.statusCode;e[ju]["content-type"]=e[ju]["content-type"]??"application/json; charset=utf-8";let i;try{let s=N5e(e[dD],r,e[ju]["content-type"]);i=s===!1?yg({error:pD[r+""],code:t.code,message:t.message,statusCode:r}):s(Object.create(t,{error:{value:pD[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=yg(new O5e(s.message,t.message))}typeof i!="string"&&!Buffer.isBuffer(i)&&(i=yg(new A5e(typeof i))),e[ju]["content-length"]=""+Buffer.byteLength(i),n(e,i)}function k5e(t=C5e,e){if(!e)return t;let n=Object.create(t);return n.func=e,n}function D5e(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}hD.exports={buildErrorHandler:k5e,handleError:I5e}});var E9=k((sRe,_9)=>{"use strict";var Eg=require("node:stream").finished,P5e=require("node:stream").Readable,{kFourOhFourContext:mD,kPublicRouteContext:yD,kReplyErrorHandlerCalled:TD,kReplyHijacked:Y1,kReplyStartTime:Q1,kReplyEndTime:wg,kReplySerializer:zi,kReplySerializerDefault:y9,kReplyIsError:g9,kReplyHeaders:ul,kReplyTrailers:y2,kReplyHasStatusCode:Sg,kReplyIsRunningOnErrorHook:Tg,kReplyNextErrorHandler:L5e,kDisableRequestLogging:xD,kSchemaResponse:v9,kReplyCacheSerializeFns:ks,kSchemaController:gg,kOptions:F5e,kRouteContext:jt}=m2(),{onSendHookRunner:AD,onResponseHookRunner:j5e,preHandlerHookRunner:U5e,preSerializationHookRunner:M5e}=vs(),gD=wh()[Symbol.for("internals")],$5e=g1(),bg=$5e.now,{handleError:vD}=W1(),{getSchemaSerializer:B5e}=_1(),vg={JSON:"application/json; charset=utf-8",PLAIN:"text/plain; charset=utf-8",OCTET:"application/octet-stream"},{FST_ERR_REP_INVALID_PAYLOAD_TYPE:H5e,FST_ERR_REP_RESPONSE_BODY_CONSUMED:V5e,FST_ERR_REP_ALREADY_SENT:OD,FST_ERR_REP_SENT_VALUE:q5e,FST_ERR_SEND_INSIDE_ONERR:z5e,FST_ERR_BAD_STATUS_CODE:G5e,FST_ERR_BAD_TRAILER_NAME:J5e,FST_ERR_BAD_TRAILER_VALUE:K5e,FST_ERR_MISSING_SERIALIZATION_FN:X5e,FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:W5e}=M2(),{FSTDEP010:Y5e,FSTDEP013:Q5e,FSTDEP019:Z5e,FSTDEP020:e6e}=Mi
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-22 10:56:27 +08:00
`;let a=new U7e(e),u=new M7e(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-22 10:56:27 +08:00
${s}`,ajv:u.ajv};let o=new Function("validator","serializer",s);return e.mode==="standalone"?mg()(o,n,a,u):o(u,a)}var H7e=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],V7e=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],q7e=["maxLength","minLength","pattern"],z7e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function DF(t){for(var e of H7e)if(e in t)return"object";for(var e of V7e)if(e in t)return"array";for(var e of q7e)if(e in t)return"string";for(var e of z7e)if(e in t)return"number";return t.type}function G7e(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-22 10:56:27 +08:00
${N0}
2024-04-02 15:03:09 +08:00
json += serializer.asString(key) + ':'
2024-05-22 10:56:27 +08:00
${ri(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-22 10:56:27 +08:00
${N0}
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-22 10:56:27 +08:00
${N0}
2024-04-02 15:03:09 +08:00
json += serializer.asString(key) + ':'
2024-05-22 10:56:27 +08:00
${ri(t,o,"value")}
2024-05-07 17:30:00 +08:00
`}return r+=`
2024-04-02 15:03:09 +08:00
}
2024-05-22 10:56:27 +08:00
`,r}function J7e(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=C0(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-22 10:56:27 +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=C0(t,e,c.schema.$ref));let f=JSON.stringify(o);if(a.indexOf(o)!==-1)n+=`
${N0}
2024-05-06 10:35:10 +08:00
json += ${JSON.stringify(f+":")}
2024-05-22 10:56:27 +08:00
${ri(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-22 10:56:27 +08:00
${N0}
2024-05-06 10:35:10 +08:00
json += ${JSON.stringify(f+":")}
2024-05-22 10:56:27 +08:00
${ri(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-22 10:56:27 +08:00
${N0}
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-22 10:56:27 +08:00
`)}}return(l.patternProperties||l.additionalProperties)&&(n+=G7e(t,e)),t.wrapObjects=u,n+=`
2024-05-06 10:35:10 +08:00
return json${t.wrapObjects?" + '}'":""}
2024-05-22 10:56:27 +08:00
`,n}function PF(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=C0(t,u,s.$ref).schema}let a=s.type;if(a===void 0&&(a=DF(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&&PF(t,e,s,l)}delete l.allOf,l.$id=`__fjs_merged_${kF++}`,t.refResolver.addSchema(l),e.addMergedSchema(l,l.$id)}function K7e(t,e,n){t.validatorSchemasIds.add(e.getSchemaId());let l=gv({},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=gv(l,r);let o=e.getPropertyLocation("else");return o.schema=gv(l,i),`
2024-04-02 15:03:09 +08:00
if (validator.validate("${a}", ${n})) {
2024-05-22 10:56:27 +08:00
${ri(t,u,n)}
2024-04-02 15:03:09 +08:00
} else {
2024-05-22 10:56:27 +08:00
${ri(t,o,n)}
2024-04-02 15:03:09 +08:00
}
2024-05-22 10:56:27 +08:00
`}function X7e(t){return`(${t} && typeof ${t}.toJSON === 'function')
2024-04-02 15:03:09 +08:00
? ${t}.toJSON()
: ${t}
2024-05-22 10:56:27 +08:00
`}function LF(t,e){let n=e.schema;if(t.functionsNamesBySchema.has(n))return t.functionsNamesBySchema.get(n);let l=jF(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-22 10:56:27 +08:00
const obj = ${X7e("input")}
2024-05-06 10:35:10 +08:00
${s?"":"if (obj === null) return '{}'"}
2024-04-02 15:03:09 +08:00
2024-05-22 10:56:27 +08:00
${J7e(t,e)}
2024-04-02 15:03:09 +08:00
}
2024-05-22 10:56:27 +08:00
`,t.functions.push(i),l}function W7e(t,e){let n=e.schema,l=e.getPropertyLocation("items");l.schema=l.schema||{},l.schema.$ref&&(l=C0(t,l,l.schema.$ref));let r=l.schema;if(t.functionsNamesBySchema.has(n))return t.functionsNamesBySchema.get(n);let i=jF(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-22 10:56:27 +08:00
`),IF==="json-stringify"&&(a+=`if (arrayLength && arrayLength >= ${K9}) 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-22 10:56:27 +08:00
`,Array.isArray(r)){for(let o=0;o<r.length;o++){let c=r[o],f=ri(t,l.getPropertyLocation(o),`obj[${o}]`);a+=`
2024-05-07 17:30:00 +08:00
if (${o} < arrayLength) {
2024-05-22 10:56:27 +08:00
if (${FF(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-22 10:56:27 +08:00
}`)}else{let o=ri(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-22 10:56:27 +08:00
}`}return a+="\n return `[${jsonOutput}]`\n }",t.functions.push(a),i}function FF(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-22 10:56:27 +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=>FF(r,e)).join(" || ")})`)}return n}function jF(t){return"anonymous"+t.functionsCounter++}function Y7e(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=UF(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-22 10:56:27 +08:00
`,i}function UF(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 += ${LF(t,e)}(${n})`;case"array":return`json += ${W7e(t,e)}(${n})`;case void 0:return`json += JSON.stringify(${n})`;default:throw new Error(`${l.type} unsupported`)}}function Q7e(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-22 10:56:27 +08:00
`),i+=`json += '${JSON.stringify(n.const).replace($7e,"\\'")}'`,r&&(i+=`
2024-04-02 15:03:09 +08:00
}
2024-05-22 10:56:27 +08:00
`),i}function ri(t,e,n){let l=e.schema;if(typeof l=="boolean")return`json += JSON.stringify(${n})`;if(l.$ref&&(e=C0(t,e,l.$ref),l=e.schema),l.type===void 0){let a=DF(l);a&&(l.type=a)}if(l.if&&l.then)return K7e(t,e,n);l.allOf&&(PF(t,e,l,F7e(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=LF(t,e);i+=`
2024-04-02 15:03:09 +08:00
json += '{'
json += ${c}(${n})
json += ','
2024-05-22 10:56:27 +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=ri(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-22 10:56:27 +08:00
`),l.const!==void 0?i+=Q7e(e,n):Array.isArray(r)?i+=Y7e(t,e,n):i+=UF(t,e,n),s&&(i+=`
2024-04-02 15:03:09 +08:00
}
2024-05-22 10:56:27 +08:00
`),i}I0.exports=_v;I0.exports.default=_v;I0.exports.build=_v;I0.exports.validLargeArrayMechanisms=RF;I0.exports.restore=function({code:t,validator:e,serializer:n}){return Function.apply(null,["validator","serializer",t]).apply(null,[e,n])}});var BF=k((hke,Ev)=>{"use strict";var Z7e=bv();function $F(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=Z7e();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)}}}Ev.exports=$F;Ev.exports.default=$F});var bv=k((mke,h5)=>{"use strict";var epe=MF();function wv(){return function(e,n){let l=Object.assign({},n,{schema:e});return tpe.bind(null,l)}}function tpe(t,{schema:e}){return t.schema&&e.$id&&t.schema[e.$id]&&(t.schema={...t.schema},delete t.schema[e.$id]),epe(e,t)}h5.exports=wv;h5.exports.default=wv;h5.exports.SerializerSelector=wv;h5.exports.StandaloneSerializer=BF()});var Wi=k(m5=>{"use strict";Object.defineProperty(m5,"__esModule",{value:!0});m5.checkMetadata=void 0;var npe=Nt(),lpe={keyword:"metadata",schemaType:"object",code(t){HF(t);let{gen:e,schema:n,it:l}=t;if((0,npe.alwaysValidSchema)(l,n))return;let r=e.name("valid");t.subschema({keyword:"metadata",jtdMetadata:!0},r),t.ok(r)}};function HF({it:t,keyword:e},n){if(t.jtdMetadata!==n)throw new Error(`JTD: "${e}" cannot be used in this schema location`)}m5.checkMetadata=HF;m5.default=lpe});var X9=k(g5=>{"use strict";Object.defineProperty(g5,"__esModule",{value:!0});g5.hasRef=void 0;var VF=Du(),y5=st(),rpe=Cs(),qF=Q3(),zF=fy(),ipe=Wi(),spe={keyword:"ref",schemaType:"string",code(t){(0,ipe.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,y5._)`${n} === null`),e.if((0,y5.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 rpe.default(i.opts.uriResolver,"",l,`No definition ${l}`);Sv(m)||!i.opts.inlineRefs?o(m):c(m)}function o(f){let m=VF.compileSchema.call(i.self,new VF.SchemaEnv({schema:f,root:s,schemaPath:`/definitions/${l}`})),d=(0,zF.getValidate)(t,m),y=e.const("_errs",qF.default.errors);(0,zF.callRef)(t,d,m,m.$async),e.assign(a,(0,y5._)`${y} === ${qF.default.errors}`)}function c(f){let m=e.scopeValue("schema",i.opts.code.source===!0?{ref:f,code:(0,y5.stringify)(f)}:{ref:f});t.subschema({schema:f,dataTypes:[],schemaPath:y5.nil,topSchemaRef:m,errSchemaPath:`/definitions/${l}`},a)}}};function Sv(t){for(let e in t){let n;if(e==="ref"||typeof(n=t[e])=="object"&&Sv(n))return!0}return!1}g5.hasRef=Sv;g5.default=spe});var xv=k(Tv=>{"use strict";Object.defineProperty(Tv,"__esModule",{value:!0});var ape=/t|\s/i,upe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ope=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,cpe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function JF(t,e){let n=t.split(ape);return n.length===2&&GF(n[0])&&ppe(n[1])||e&&n.length===1&&GF(n[0])}Tv.default=JF;function GF(t){let e=upe.exec(t);if(!e)return!1;let n=+e[1],l=+e[2],r=+e[3];return l>=1&&l<=12&&r>=1&&(r<=cpe[l]||l===2&&r===29&&(n%100===0?n%400===0:n%4===0))}function ppe(t){let e=ope.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}JF.code='require("ajv/dist/runtime/timestamp").default'});var R0=k(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.typeErrorParams=Ps.typeErrorMessage=Ps.typeError=void 0;var fpe=st();function dpe(t){return{message:e=>KF(e,t),params:e=>XF(e,t)}}Ps.typeError=dpe;function KF({parentSchema:t},e){return t?.nullable?`must be ${e} or null`:`must be ${e}`}Ps.typeErrorMessage=KF;function XF({parentSchema:t},e){return(0,fpe._)`{type: ${e}, nullab
`,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},Nfe=97,Cfe=48;function Us(t,e){let n="",l;for(Us.message=void 0;l=t[e++],l!=='"';)if(l==="\\")if(l=t[e],l in Tj)n+=Tj[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)-Nfe+10;else if(l>="0"&&l<="9")s+=l.charCodeAt(0)-Cfe;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 Us.position=e,n;function r(i){Us.position=e,Us.message=i}}Ms.parseJsonString=Us;Us.message=void 0;Us.position=0;Us.code='require("ajv/dist/runtime/parseJson").parseJsonString'});var Fj=k(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var Ife=jv(),Cj=Du(),tt=st(),Rfe=Cs(),Ht=Q3(),kfe=O2(),Dfe=X9(),Pfe=Av(),qv=xj(),Ij=Nt(),Lfe=xv(),Ffe={elements:$fe,values:Bfe,discriminator:Vfe,properties:Aj,optionalProperties:Aj,enum:zfe,type:qfe,ref:Gfe};function Rj(t,e){let n=Cj.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,jfe(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}Xv.default=Rj;var Vv=(0,tt._)`undefined`;function jfe(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`,Vv),e.assign((0,tt._)`${n}.position`,Vv),e.assign(Ht.default.jsonPos,(0,tt._)`${Ht.default.jsonPos} || 0`),e.const(Ht.default.jsonLen,(0,tt._)`${Ht.default.json}.length`),e7(t),Kv(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)),F0(t)})}function e7(t){let e;for(let n of Ife.jtdForms)if(n in t.schema){e=n;break}e?Mfe(t,Ffe[e]):Gv(t)}var Ufe=Nj(!0,Nj(!1,F0));function Mfe(t,e){let{gen:n,schema:l,data:r}=t;if(!l.nullable)return e(t);E5(t,"null",e,()=>n.assign(r,null))}function $fe(t){let{gen:e,schema:n,data:l}=t;ii(t,"[");let r=e.let("i",0);e.assign(l,(0,tt._)`[]`),zv(t,"]",()=>{let i=e.let("el");e7({...t,schema:n.elements,data:i}),e.assign((0,tt._)`${l}[${r}++]`,i)})}function Bfe(t){let{gen:e,schema:n,data:l}=t;ii(t,"{"),e.assign(l,(0,tt._)`{}`),zv(t,"}",()=>Hfe(t,n.values))}function zv(t,e,n){kj(t,e,n),ii(t,e)}function kj(t,e,n){let{gen:l}=t;l.for((0,tt._)`;${Ht.default.jsonPos}<${Ht.default.jsonLen} && ${t7(1)}!==${e};`,()=>{n(),E5(t,",",()=>l.break(),r)});function r(){E5(t,e,()=>{},F0)}}function Hfe(t,e){let{gen:n}=t,l=n.let("key");zu({...t,data:l}),ii(t,":"),Pj(t,l,e)}function Vfe(t){let{gen:e,data:n,schema:l}=t,{discriminator:r,mapping:i}=l;ii(t,"{"),e.assign(n,(0,tt._)`{}`);let s=e.const("pos",Ht.default.jsonPos),a=e.let("value"),u=e.let("tag");kj(t,"}",()=>{let o=e.let("key");zu({...t,data:o}),ii(t,":"),e.if((0,tt._)`${o} === ${r}`,()=>{zu({...t,data:u}),e.assign((0,tt._)`${n}[${o}]`,u),e.break()},()=>Gv({...t,data:a}))}),e.assign(Ht.default.jsonPos,s),e.if((0,tt._)`${u} === undefined`),ts(t,(0,tt.str)`discriminator tag not found`);for(let o in i)e.elseIf((0,tt._)`${u} === ${o}`),Dj({...t,schema:i[o]},r);e.else(),ts(t,(0,tt.str)`discriminator value not in schema`),e.endIf()}function Aj(t){let{gen:e,data:n}=t;ii(t,"{"),e.assign(n,(0,tt._)`{}`),Dj(t)}function Dj(t,e){let{gen:n,schema:l,data:r}=t,{properties:i,optionalProperties:s,additio
`).slice(0,2).map(e=>e.trim()).join(" -- ")}function eU(t){return t[Symbol.for("fastify.display-name")]}function tU(t){return!!t[Symbol.for("skip-override")]}function nU(t){let e=S5(t);if(!e)return;let n=e.dependencies;n&&(s_(Array.isArray(n),"The dependencies should be an array of strings"),n.forEach(l=>{s_(this[a_].indexOf(l)>-1,`The dependency '${l}' of plugin '${e.name}' is not registered`)}))}function lU(t){let e=S5(t);if(!e)return;let{decorators:n,name:l}=e;n&&(n.fastify&&i_(this,"Fastify",n.fastify,l),n.reply&&i_(this,"Reply",n.reply,l),n.request&&i_(this,"Request",n.request,l))}var Sde={Fastify:yde,Request:vde,Reply:gde};function i_(t,e,n,l){s_(Array.isArray(n),"The decorators should be an array of strings"),n.forEach(r=>{let i=typeof l=="string"?` required by '${l}'`:"";if(!Sde[e].call(t,r))throw new Ede(r,i,e)})}function Tde(t){let e=S5(t);if(!e)return;let n=e.fastify,l=/-rc.+$/.test(this.version);if(!(l===!0&&r_.gt(this.version,r_.coerce(n))===!0)&&n&&r_.satisfies(this.version,n,{includePrerelease:l})===!1)throw new _de(e.name,n,this.version)}function xde(t){let e=S5(t);if(!e)return;let n=e.name;if(n)return this[a_].push(n),n}function Ade(t,e){t.constructor.name==="AsyncFunction"&&t.length===3&&bde(e||"anonymous")}function Ode(t){let e=xde.call(this,t)||Zj(t);return Ade.call(this,t,e),Tde.call(this,t),lU.call(this,t),nU.call(this,t),tU(t)}u_.exports={getPluginName:Zj,getFuncPreview:wde,kRegisteredPlugins:a_,getDisplayName:eU,registerPlugin:Ode};u_.exports[mde]={shouldSkipOverride:tU,getMeta:S5,checkDecorators:lU,checkDependencies:nU}});var l7=k((Vke,rU)=>{"use strict";function Nde(t,e){let n=e||Ide();return t?Rde(t,n):n}function Cde(t,e){return t.genReqId(e)}function Ide(){let e=0;return function(){return e=e+1&2147483647,`req-${e.toString(36)}`}}function Rde(t,e){return function(n){return n.headers[t]||e(n)}}rU.exports={getGenReqId:Cde,reqIdGenFactory:Nde}});var uU=k((qke,aU)=>{"use strict";var iU=12,kde=0,c_=[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 Dde(t){var e=t.indexOf("%");if(e===-1)return t;for(var n=t.length,l="",r=0,i=0,s=e,a=iU;e>-1&&e<n;){var u=sU(t[e+1],4),o=sU(t[e+2],0),c=u|o,f=c_[c];if(a=c_[256+a+f],i=i<<6|c&c_[364+f],a===iU)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===kde)return null;if(e+=3,e<n&&t.charCodeAt(e)===37)continue;return null}}return l+t.slice(r)}var Pde={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 sU(t,e){var n=Pde[t];return n===void 0?255:n<<e}aU.exports=Dde});var dU=k((zke,fU)=>{"use strict";var oU=uU(),cU=/\+/g,pU=function(){};pU.prototype=Object.create(null);function Lde(t){let e=new pU;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(cU," ")),a&&(l=oU(l)||l),f&&(r=t.slice(s+1,d),c&&(r=r.replace(cU," ")),u&&(r=oU(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}fU.exports=Lde});var mU=k((Gke,hU)=>{var si=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-22 10:56:27 +08:00
`,n+=jU(s,e+o)}return n}function qde(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function UU(t){return Array.isArray(t)?t.map(e=>UU(e)):typeof t=="symbol"?t.toString():typeof t=="function"?qde(t):t}function zde(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(UU(a));l[s]=u}}return l}function Gde(t){let e="";for(let[n,l]of Object.entries(t))e+=`
\u2022 (${n}) ${l}`;return e}function Jde(t){let e={...t.opts.constraints},n=e[LU.name];return delete e[LU.name],{...t,method:n,opts:{constraints:e}}}function Kde(t){let e=` (${t.method})`,n=t.opts.constraints||{};return Object.keys(n).length!==0&&(e+=" "+JSON.stringify(n)),e+=Gde(t.metaData),e}function Xde(t){return t.reduce((e,n)=>{for(let l of e)if(PU(n.opts.constraints,l.opts.constraints)&&PU(n.metaData,l.metaData))return l.method+=", "+n.method,e;return e.push(n),e},[])}function Wde(t,e,n){let l=t.routes;return n.method===void 0&&(l=l.map(Jde)),l=l.map(r=>(r.metaData=zde(r,n),r)),n.method===void 0&&(l=Xde(l)),l.map(Kde).join(`
${e}`)}function a7(t,e,n,l){if((t.isLeafNode||l.commonPrefix!==!1)&&(n=n||"(empty root node)",e=e[n]={},t.isLeafNode&&(e[FU]=Wde(t,n,l)),n=""),t.staticChildren)for(let r of Object.values(t.staticChildren))a7(r,e,n+r.prefix,l);if(t.parametricChildren)for(let r of Object.values(t.parametricChildren)){let i=Array.from(r.nodePaths).join("|");a7(r,e,n+i,l)}t.wildcardChild&&a7(t.wildcardChild,e,"*",l)}function Yde(t,e){let n={};return a7(t,n,t.prefix,e),jU(n)}MU.exports={prettyPrintTree:Yde}});var HU=k((lDe,BU)=>{"use strict";var Qde=s7(),m_=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(Qde.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-22 10:56:27 +08:00
`))}};BU.exports=m_});var qU=k((rDe,VU)=>{"use strict";var Zde=HU(),d7={STATIC:0,PARAMETRIC:1,WILDCARD:2},u7=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 Zde),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(n,e)}},o7=class extends u7{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 c7(e),this.staticChildren[l]}},c7=class t extends o7{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=d7.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 p7(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 f7,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(" && ")}`)}},p7=class extends o7{constructor(e,n,l){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=n||null,this.kind=d7.PARAMETRIC,this.nodePaths=new Set([l])}getNextNode(e,n){return this.findStaticMatchingChild(e,n)}},f7=class extends u7{constructor(){super(),this.kind=d7.WILDCARD}getNextNode(){return null}};VU.exports={StaticNode:c7,ParametricNode:p7,WildcardNode:f7,NODE_TYPES:d7}});var GU=k((iDe,zU)=>{"use strict";var ehe=require("assert");function N5(){if(!(this instanceof N5))return new N5;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}N5.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};N5.prototype.get=function(t){return this.store[t]};zU.exports={name:"version",mustMatchWhenDerived:!0,storage:N5,validate(t){ehe(typeof t=="string","Version should be a string")}}});var KU=k((sDe,JU)=>{"use strict";var the=require("assert");function nhe(){let t={},e=[];return{get:n=>{let l=t[n];if(l)return l;for
`)).bind(this)}};XU.exports=g_});var QU=k((uDe,YU)=>{"use strict";var ihe=["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"];YU.exports=ihe});var tM=k((oDe,eM)=>{"use strict";function ZU(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 she(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);ZU(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 ahe(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=ZU(i,s);n+=t.slice(l,r)+a,l=r+3}return t.slice(0,e)+n+t.slice(l)}eM.exports={safeDecodeURI:she,safeDecodeURIComponent:ahe}});var S_=k((cDe,uM)=>{"use strict";var $l=require("assert"),uhe=wU(),h7=kU(),E_=c0(),{prettyPrintTree:ohe}=$U(),{StaticNode:nM,NODE_TYPES:v_}=qU(),che=WU(),H0=QU(),__=s7(),{safeDecodeURI:phe,safeDecodeURIComponent:lM}=tM(),rM=/^https?:\/\/.*?\//,Ju=/(\/:[^/()]*?)\?(\/?)/;if(!h7(rM))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!h7(Ju))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function bl(t){if(!(this instanceof bl))return new bl(t);t=t||{},this._opts=t,t.defaultRoute?($l(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?($l(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?($l(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=fhe,t.querystringParser?($l(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:uhe.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 che(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}bl.prototype.on=function(e,n,l,r,i){typeof l=="function"&&(r!==void 0&&(i=r),r=l,l={}),$l(typeof n=="string","Path should be a string"),$l(n.length>0,"The path could not be empty"),$l(n[0]==="/"||n[0]==="*","The first character of a path should be `/` or `*`"),$l(typeof r=="function","Handler should be a function");let s=n.match(Ju);if(s){$l(n.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let o=n.replace(Ju,"$1$2"),c=n.replace(Ju,"$2");this.on(e,o,l,r,i),this.on(e,c,l,r,i);return}let a=n;this.ignoreDuplicateSlashes&&(n=b_(n)),this.ignoreTrailingSlash&&(n=w_(n));let u=Array.isArray(e)?e:[e];for(let o of u)$l(typeof o=="string","Method should be a string"),$l(H0.includes(o),`Method '${o}' is not an http method.`),this._on(o,n,l,r,i,a)};bl.prototype._on=function(e,n,l,r,i){let s={};l.constraints!==void 0&&($l(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 nM("/"));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-22 10:56:27 +08:00
${Se}`),ve.destroy(re)}function me(re,ve){re.headers["accept-version"]!==void 0&&(re.headers[Qme]=re.headers["accept-version"],re.headers["accept-version"]=void 0),d.router.lookup(re,ve)}function P(re,ve,Se){if(a){let dt=E$(F.server,ve),Le=v$(F,u,ve,dt),Lt=new x7(dt,null,ve,null,Le,F),Tl=new M5(Se,Lt,Le);return i===!1&&Le.info({req:Lt},"incoming request"),a(new vye(re),Lt,Tl)}let Xe=`{"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":Xe.length}),Se.end(Xe)}function G(re,ve,Se){if(re!==!1)return function(dt){if(dt){if(a){let Lt=E$(F.server,ve),Tl=v$(F,u,ve,Lt),Ft=new x7(Lt,null,ve,null,Tl,F),tn=new M5(Se,Ft,Tl);return i===!1&&Tl.info({req:Ft},"incoming request"),a(new gye,Ft,tn)}let Le='{"error":"Internal Server Error","message":"Unexpected error from async constraint","statusCode":500}';Se.writeHead(500,{"Content-Type":"application/json","Content-Length":Le.length}),Se.end(Le)}}}function V(re,ve){return te('Cannot call "setNotFoundHandler"!'),d.setNotFoundHandler.call(this,re,ve,M,m.routeHandler),this}function q(re){return te('Cannot call "setValidatorCompiler"!'),this[Hs].setValidatorCompiler(re),this}function el(re){return te('Cannot call "setSchemaErrorFormatter"!'),x$(re),this[J_]=re.bind(this),this}function Tt(re){return te('Cannot call "setSerializerCompiler"!'),this[Hs].setSerializerCompiler(re),this}function Ye(re){te('Cannot call "setSchemaController"!');let ve=this[Hs],Se=y$.buildSchemaController(ve,Object.assign({},ve.opts,re));return this[Hs]=Se,this.getSchema=Se.getSchema.bind(Se),this.getSchemas=Se.getSchemas.bind(Se),this}function ft(re){return te('Cannot call "setReplySerializer"!'),this[m$]=re,this}function ze(re){return te('Cannot call "setErrorHandler"!'),this[T7]=T$(this[T7],re.bind(this)),this}function Me(re){return te('Cannot call "setChildLoggerFactory"!'),this[X_]=re,this}function $t(re={}){return re.includeMeta=re.includeHooks?re.includeMeta?Y_.concat(re.includeMeta):Y_:re.includeMeta,m.printRoutes(re)}function vt(re,{rewriteUrl:ve,logger:Se}){let Xe;return function(Le,Lt){if(Xe===void 0&&(Xe=re.isAsyncConstraint()),ve){Le.originalUrl=Le.url;let Tl=ve.call(N,Le);if(typeof Tl=="string")Le.url=Tl;else{let Ft=new Nye(Le.url,typeof Tl);Le.destroy(Ft)}}re.routing(Le,Lt,G(Xe,Le,Lt))}}function Et(re){return te('Cannot call "setGenReqId"!'),this[W_]=b$(this[G_].requestIdHeader,re),this}}A7.errorCodes=Xu;function x$(t){if(typeof t!="function")throw new S$(typeof t);if(t.constructor.name==="AsyncFunction")throw new S$("AsyncFunction")}O7.exports=A7;O7.exports.fastify=A7;O7.exports.default=A7});var sz=k((xLe,iz)=>{"use strict";iz.exports=Error});var uz=k((ALe,az)=>{"use strict";az.exports=EvalError});var cz=k((OLe,oz)=>{"use strict";oz.exports=RangeError});var fz=k((NLe,pz)=>{"use strict";pz.exports=ReferenceError});var Hb=k((CLe,dz)=>{"use strict";dz.exports=SyntaxError});var O4=k((ILe,hz)=>{"use strict";hz.exports=TypeError});var yz=k((RLe,mz)=>{"use strict";mz.exports=URIError});var vz=k((kLe,gz)=>{"use strict";gz.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 bz=k((DLe,Ez)=>{"use strict";var _z=typeof Symbol<"u"&&Symbol,Obe=vz();Ez.exports=function(){return typeof _z!="function"||typeof Symbol!="function"||typeof _z("foo")!="sy
`)>=0)return!1;return!0}function jwe(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=vi.call(Array(t.indent+1)," ");else return null;return{base:n,prev:vi.call(Array(e+1),n)}}function lw(t,e){if(t.length===0)return"";var n=`
`+e.prev+e.base;return n+vi.call(t,","+n)+`
`+e.prev}function ff(t,e){var n=nw(t),l=[];if(n){l.length=t.length;for(var r=0;r<t.length;r++)l[r]=ia(t,r)?e(t[r],t):""}var i=typeof Yb=="function"?Yb(t):[],s;if(D4){s={};for(var a=0;a<i.length;a++)s["$"+i[a]]=i[a]}for(var u in t)ia(t,u)&&(n&&String(Number(u))===u&&u<t.length||D4&&s["$"+u]instanceof Symbol||(_G.call(/[^\w$]/,u)?l.push(e(u,t)+": "+e(t[u],t)):l.push(u+": "+e(t[u],t))));if(typeof Yb=="function")for(var o=0;o<i.length;o++)EG.call(t,i[o])&&l.push("["+e(i[o])+"]: "+e(t[i[o]],t));return l}});var CG=k((KLe,NG)=>{"use strict";var OG=_o(),P4=rG(),Uwe=AG(),Mwe=O4(),mf=OG("%WeakMap%",!0),yf=OG("%Map%",!0),$we=P4("WeakMap.prototype.get",!0),Bwe=P4("WeakMap.prototype.set",!0),Hwe=P4("WeakMap.prototype.has",!0),Vwe=P4("Map.prototype.get",!0),qwe=P4("Map.prototype.set",!0),zwe=P4("Map.prototype.has",!0),aw=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},Gwe=function(t,e){var n=aw(t,e);return n&&n.value},Jwe=function(t,e,n){var l=aw(t,e);l?l.value=n:t.next={key:e,next:t.next,value:n}},Kwe=function(t,e){return!!aw(t,e)};NG.exports=function(){var e,n,l,r={assert:function(i){if(!r.has(i))throw new Mwe("Side channel does not contain "+Uwe(i))},get:function(i){if(mf&&i&&(typeof i=="object"||typeof i=="function")){if(e)return $we(e,i)}else if(yf){if(n)return Vwe(n,i)}else if(l)return Gwe(l,i)},has:function(i){if(mf&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Hwe(e,i)}else if(yf){if(n)return zwe(n,i)}else if(l)return Kwe(l,i);return!1},set:function(i,s){mf&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new mf),Bwe(e,i,s)):yf?(n||(n=new yf),qwe(n,i,s)):(l||(l={key:{},next:null}),Jwe(l,i,s))}};return r}});var gf=k((XLe,IG)=>{"use strict";var Xwe=String.prototype.replace,Wwe=/%20/g,uw={RFC1738:"RFC1738",RFC3986:"RFC3986"};IG.exports={default:uw.RFC3986,formatters:{RFC1738:function(t){return Xwe.call(t,Wwe,"+")},RFC3986:function(t){return String(t)}},RFC1738:uw.RFC1738,RFC3986:uw.RFC3986}});var pw=k((WLe,kG)=>{"use strict";var Ywe=gf(),ow=Object.prototype.hasOwnProperty,Eo=Array.isArray,_i=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Qwe=function(e){for(;e.length>1;){var n=e.pop(),l=n.obj[n.prop];if(Eo(l)){for(var r=[],i=0;i<l.length;++i)typeof l[i]<"u"&&r.push(l[i]);n.obj[n.prop]=r}}},RG=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},Zwe=function t(e,n,l){if(!n)return e;if(typeof n!="object"){if(Eo(e))e.push(n);else if(e&&typeof e=="object")(l&&(l.plainObjects||l.allowPrototypes)||!ow.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 Eo(e)&&!Eo(n)&&(r=RG(e,l)),Eo(e)&&Eo(n)?(n.forEach(function(i,s){if(ow.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 ow.call(i,s)?i[s]=t(i[s],a,l):i[s]=a,i},r)},eSe=function(e,n){return Object.keys(n).reduce(function(l,r){return l[r]=n[r],l},e)},tSe=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}},cw=1024,nSe=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+=cw){for(var o=s.length>=cw?s.slice(u,u+cw):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===Ywe.RFC1738&&(m===40||m===41)){c[c.length]=o.charAt(f);continue}if(m<128){c[c.length]=_i[m];continue}if(m<2048){c[c.length]=_i[192|m>>6]+_i[128|m&63];continue}if(m<55296||m>=57344){c[c.length]=_i[224|m>>12]+_i[128|m>>6&63]+_i[128|m&63];continue}f+=1,m=65536+((m&1023)<<10|o.charCodeAt(f)&1023),c[c.length]=_i[240|m>>18]+_i[12
`;an.DEFAULT_CONTENT_TYPE="application/octet-stream";an.prototype.append=function(t,e,n){n=n||{},typeof n=="string"&&(n={filename:n});var l=Aw.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),DJ.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 MTe))&&(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)):UTe.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"&&xw(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=Sw.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t.name||t.path?n=Sw.basename(e.filename||t.name||t.path):t.readable&&t.hasOwnProperty("httpVersion")&&(n=Sw.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=Tw.lookup(t.name)),!n&&t.path&&(n=Tw.lookup(t.path)),!n&&t.readable&&t.hasOwnProperty("httpVersion")&&(n=t.headers["content-type"]),!n&&(e.filepath||e.filename)&&(n=Tw.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)}};cs.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 UK(t,e){var n=this;cs.prototype.createSocket.call(n,t,function(l){var r=t.request.getHeader("host"),i=aS({},n.options,{socket:l,servername:r?r.replace(/:.*$/,""):t.host}),s=Uxe.connect(0,i);n.sockets[n.sockets.indexOf(l)]=s,e(s)})}function MK(t,e,n){return typeof t=="string"?{host:t,port:e,localAddress:n}:t}function aS(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 fa;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?fa=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)}:fa=function(){};q4.debug=fa});var HK=k((VMe,BK)=>{BK.exports=$K()});var aee=k(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.removeTrailingChar=Oo.merge=void 0;var pNe=(...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,Oo.merge)(e[l],n[l]):e[l]=n[l]}),e};Oo.merge=pNe;var fNe=(t,e)=>t.length>1&&t.endsWith(e)?t.substring(0,t.length-1):t;Oo.removeTrailingChar=fNe});var z4=k(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.DataError=lu.DatabaseError=lu.NestedError=void 0;var r8=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}};lu.NestedError=r8;var FT=class extends r8{};lu.DatabaseError=FT;var jT=class extends r8{};lu.DataError=jT});var HT=k(o3=>{"use strict";Object.defineProperty(o3,"__esModule",{value:!0});o3.getArrayIndicies=o3.validateArrayIndex=o3.validateArrayIndicies=o3.isInt=o3.ArrayInfo=o3.arrayRegex=void 0;var Mf=z4(),dNe=()=>/^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;o3.arrayRegex=dNe;var UT={},MT=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,$T(l))this.index=parseInt(l);else if(!this.append)throw new Mf.DataError("Only numerical values accepted for array index",200)}static processArray(e){if(typeof e>"u")return null;if(UT[e])return UT[e];let l=(0,o3.arrayRegex)().exec(e.trim());if(l!=null){let r=l[1],i="["+l[2].toString()+"]",s=BT(i);return uee(s),UT[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 Mf.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 Mf.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}};o3.ArrayInfo=MT;function $T(t){return!isNaN(t)&&Number(t)==t&&!isNaN(parseInt(t,10))}o3.isInt=$T;function uee(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")}o3.validateArrayIndicies=uee;function oee(t){if(t.length!==0&&!$T(t))throw new Mf.DataError("Only numerical values accepted for array index",200)}o3.validateArrayIndex=oee;function BT(t){if(t.length===0)return[];if(t.charAt(0)!=="[")throw new Error("Invalid array syntax detected");let e=t.substring(1,t.indexOf("]"));oee(e);let n=e.length+2;return[e,...BT(t.substring(n))]}o3.getArrayIndicies=BT});var fee=k($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.DBParentData=void 0;var cee=HT(),pee=z4(),VT=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=cee.ArrayInfo.processArray(this.parent);if(n&&(!n.append||e)&&!n.isValid(this.data))throw new pee.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=cee.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 pee.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]}};$f.DBParentData=VT});var hee=k((yGe,dee)=>{dee.exports=function(){"use strict";function t(){this.readers=0,this.queue=[]}function e(i,s,a){var u;typeof i!="function"?(r.h
`:t(e.children):G7(e)?t(e.children):hi(e)?e.data:""},textContent:c4,innerText:X7,getChildren:sp,getParent:YB,getSiblings:QB,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:WE,prevElementSibling:YE,removeElement:Qu,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){Qu(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){Qu(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){Qu(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){Qu(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:F7,find:QE,findOneChild:function(t,e){return e.find(t)},findOne:wE,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=P$(t))||t(e)},getElements:function(t,e,n,l=1/0){return(t=P$(t))?F7(t,e,n,l):[]},getElementById:function(t,e,n=!0){return Array.isArray(e)||(e=[e]),wE(ZB("id",t),e,n)},getElementsByTagName:r4,getElementsByTagType:function(t,e,n=!0,l=1/0){return F7(W7.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 sr},compareDocumentPosition:eH,uniqueSort:p4,getFeed:function(t){return(t=N7(tge,t))?(t.name==="feed"?function(e){var n={type:"atom",items:r4("entry",e=e.children).map(r=>{var i={media:L$(r=r.children)},s=(b3(i,"id","id",r),b3(i,"title","title",r),(s=N7("link",r))==null?void 0:s.attribs.href);return s&&(i.link=s),(s=Vs("summary",r)||Vs("content",r))&&(i.description=s),(s=Vs("updated",r))&&(i.pubDate=new Date(s)),i})},l=(b3(n,"id","id",e),b3(n,"title","title",e),(l=N7("link",e))==null?void 0:l.attribs.href);return l&&(n.link=l),b3(n,"description","subtitle",e),(l=Vs("updated",e))&&(n.updated=new Date(l)),b3(n,"author","email",e,!0),n}:function(l){var n=(n=(n=N7("channel",l.children))==null?void 0:n.children)!=null?n:[],l={type:l.name.substr(0,3),id:"",items:r4("item",l.children).map(i=>{var s={media:L$(i=i.children)};return b3(s,"id","guid",i),b3(s,"title","title",i),b3(s,"link","link",i),b3(s,"description","description",i),(i=Vs("pubDate",i)||Vs("dc:date",i))&&(s.pubDate=new Date(i)),s})},r=(b3(l,"title","title",n),b3(l,"link","link",n),b3(l,"description","description",n),Vs("lastBuildDate",n));return r&&(l.updated=new Date(r)),b3(l,"author","managingEditor",n,!0),l})(t):null}}),i4=function(){return(i4=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 tH(t,e,n){return t?t(e??t._root.children,null,void 0,n).toString():""}function nge(t,e){return tH(this,function(n){return!(typeof n!="object"||n==null||"length"in n||"type"in n)}(t)?void(e=t):t,i4(i4(i4({},XE),this==null?void 0:this._options),_E(e??{})))}function lge(t){return tH(this,t,i4(i4({},this._options),{xmlMode:!0}))}function f6(t){for(var e=t||(this?this.root():[]),n="",l=0;l<e.length;l++)n+=c4(e[l]);return n}function rge(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,XE,!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-22 10:56:27 +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])"},aH={};function uH(t,e){var n=e.getSiblings(t);return n.length<=1||(t=n.indexOf(t))<0||t===n.length-1?[]:n.slice(t+1).filter(e.isTag)}function OE(t){return{xmlMode:!!t.xmlMode,lowerCaseAttributeNames:!!t.lowerCaseAttributeNames,lowerCaseTags:!!t.lowerCaseTags,quirksMode:!!t.quirksMode,cacheResults:!!t.cacheResults,pseudos:t.pseudos,adapter:t.adapter,equals:t.equals}}var rE=(t,e,n,l,r)=>{let i=r(e,OE(n),l);return i===Pt.trueFunc?t:i===Pt.falseFunc?Pt.falseFunc:s=>i(s)&&t(s)},iE={is:rE,matches:rE,where:rE,not(t,e,n,l,r){let i=r(e,OE(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=OE(n),a=(s.relativeSelector=!0,e.some(c=>c.some(xE))?[aH]: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,...uH(d,i)]:m;return i.existsOne(o,d)}}return c=>t(c)&&i.existsOne(o,i.getChildren(c))}};function sE(t,e){return(t=e.getParent(t))&&e.isTag(t)?t:null}function Sge(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()),_ge[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 iE)return iE[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:wge[m];if(typeof _=="string"){if(d!=null)throw new Error(`Pseudo ${m} doesn't have any arguments`);let S=up(_);return iE.is(a,S,o,c,f)}if(typeof y=="function")return J$(y,m,d,1),S=>y(S,d)&&a(S);if(m in AE)return AE[m](a,d,o,c);if(m in G$){let S=G$[m];return J$(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=sE(o,i);)if(t(o))return!0;return!1};let a=new WeakSet;return function(u){let o=u;for(;o=sE(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=sE(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
`)}}):{name:l,value:r.replace(X$,`\r
`)}}).toArray()}}),W5=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}},ib=(W5.prototype.cheerio="[cheerio object]",W5.prototype.splice=Array.prototype.splice,W5.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(W5.prototype,oge,qge,Wge,Yge,Zge),function(t,e){return(ib=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)}),eve=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}ib(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)},Y5=function(){return(Y5=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)},tve=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]),yl="\uFFFD",W$=(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||{}),"--"),Y$="[CDATA[",Q$="doctype",G0="script",nve="public",lve="system";function SH(t){return 55296<=t&&t<=57343}function TH(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&1<=t&&t<=31||127<=t&&t<=159}function xH(t){return 64976<=t&&t<=65007||tve.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&&(M+=" "),this.message=M+(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 WH(){throw new Error("setTimeout has not been defined")}function YH(){throw new Error("clearTimeout has not been defined")}var Js=WH,Ks=YH;function QH(t){if(Js===setTimeout)return setTimeout(t,0);if((Js===WH||!Js)&&setTimeout)return(Js=setTimeout)(t,0);try{return Js(t,0)}catch{try{return Js.call(null,t,0)}catch{return Js.call(this,t,0)}}}typeof rs.setTimeout=="function"&&(Js=setTimeout),typeof rs.clearTimeout=="function"&&(Ks=clearTimeout);var no,ss=[],u4=!1,H7=-1;function e_e(){u4&&no&&(u4=!1,no.length?ss=no.concat(ss):H7=-1,ss.length)&&ZH()}function ZH(){if(!u4){var t=QH(e_e);u4=!0;for(var e=ss.length;e;){for(no=ss,ss=[];++H7<e;)no&&no[H7].run();H7=-1,e=ss.length}no=null,u4=!1,function(n){if(Ks===clearTimeout)return clearTimeout(n);if((Ks===YH||!Ks)&&clearTimeout)return(Ks=clearTimeout)(n);try{Ks(n)}catch{try{return Ks.call(null,n)}catch{return Ks.call(this,n)}}}(t)}}function eV(t,e){this.fun=t,this.array=e}function uo(){}eV.prototype.run=function(){this.fun.apply(null,this.array)};var t_e=uo,n_e=uo,l_e=uo,r_e=uo,i_e=uo,s_e=uo,a_e=uo,Q0=rs.performance||{},u_e=Q0.now||Q0.mozNow||Q0.msNow||Q0.oNow||Q0.webkitNow||function(){return new Date().getTime()},o_e=new Date,ea={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];ss.push(new eV(t,e)),ss.length!==1||u4||QH(ZH)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:t_e,addListener:n_e,once:l_e,off:r_e,removeListener:i_e,removeAllListeners:s_e,emit:a_e,binding:function(t){throw new Error("process.
\r\xA0`,PB="()[]{}%*-+~/#,:|.<>=!",sV="string",aV="whitespace",uV="data",oV="block-start",cV="block-end",pV="variable-start",fV="variable-end",dV="comment",hV="left-paren",mV="right-paren",yV="left-bracket",gV="right-bracket",vV="left-curly",_V="right-curly",EV="operator",bV="comma",wV="colon",SV="tilde",TV="pipe",xV="float",AV="boolean",zE="none",OV="symbol",NV="regex";function s3(t,e,n,l){return{type:t,value:e,lineno:n,colno:l}}var m_e=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 s3(sV,this._parseString(r),n,l);if(d=this._extract(DB))return s3(aV,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-22 10:56:27 +08:00
`?this.forward():this.back())),s3(cV,d,n,l);if(d=(d=this._extractString(this.tags.VARIABLE_END))||this._extractString("-"+this.tags.VARIABLE_END))return this.in_code=!1,s3(fV,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 s3(NV,{body:i,flags:a},n,l)}if(PB.indexOf(r)!==-1){this.forward();var u,o=["==","===","!=","!==","<=",">=","//","**"],c=r+this.current();switch(Fe.indexOf(o,c)!==-1&&(this.forward(),Fe.indexOf(o,(r=c)+this.current())!==-1)&&(r=c+this.current(),this.forward()),r){case"(":u=hV;break;case")":u=mV;break;case"[":u=yV;break;case"]":u=gV;break;case"{":u=vV;break;case"}":u=_V;break;case",":u=bV;break;case":":u=wV;break;case"~":u=SV;break;case"|":u=TV;break;default:u=EV}return s3(u,r,n,l)}if((d=this._extractUntil(DB+PB)).match(/^[-+]?[0-9]+$/))return this.current()==="."?(this.forward(),o=this._extract("0123456789"),s3(xV,d+"."+o,n,l)):s3("int",d,n,l);if(d.match(/^(true|false)$/))return s3(AV,d,n,l);if(d==="none"||d==="null")return s3(zE,d,n,l);if(d)return s3(OV,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,s3(oV,d,n,l);if(d=(d=this._extractString(this.tags.VARIABLE_START+"-"))||this._extractString(this.tags.VARIABLE_START))return this.in_code=!0,s3(pV,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 s3(y?dV:uV,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-22 10:56:27 +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}(),Ge={lex:function(t,e){return new m_e(t,e)},TOKEN_STRING:sV,TOKEN_WHITESPACE:aV,TOKEN_DATA:uV,TOKEN_BLOCK_START:oV,TOKEN_BLOCK_END:cV,TOKEN_VARIABLE_START:pV,TOKEN_VARIABLE_END:fV,TOKEN_COMMENT:dV,TOKEN_LEFT_PAREN:hV,TOKEN_RIGHT_PAREN:mV,TOKEN_LEFT_BRACKET:yV,TOKEN_RIGHT_BRACKET:gV,TOKEN_LEFT_CURLY:vV,TOKEN_RIGHT_CURLY:_V,TOKEN_OPERATOR:EV,TOKEN_COMMA:bV,TOKEN_COLON:wV,TOKEN_TILDE:SV,TOKEN_PIPE:TV,TOKEN_INT:"int",TOKEN_FLOAT:xV,TOKEN_BOOLEAN:AV,TOKEN_NONE:zE,TOKEN_SYMBOL:OV,TOKEN_SPECIAL:"special",TOKEN_REGEX:NV};function LB(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 ub(t,e,n){return e&&LB(t.prototype,e),n&&LB(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function CV(t,e){t.prototype=Object.create(e.prototype),IV(t.prototype.constructor=t,e)}function IV(t,e){return(IV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}function RV(t,e,n){n=n||{},Fe.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 CV(i,r),ub(i,[{key:"typename",get:function(){return e}}]),i}(t);return Fe._assign(l.prototype,n),l}var y_e=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"),RV(this,e,n)},ub(t,[{key:"typename",get:function(){return this.constructor.name}}]),t}(),g_e=function(t){function e(){var n;return(n=t.call(this)||this).init.apply(n,arguments),n}return CV(e,t),e.prototype.init=function(){},e.extend=function(n,l){return typeof n=="object"&&(l=n,n="anonymous"),RV(this,n,l)},ub(e,[{key:"typename",get:function(){return this.constructor.name}}]),e}(Zn),h4={Obj:y_e,EmitterObj:g_e};function FB(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 ob(t,e,n){return e&&FB(t.prototype,e),n&&FB(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function cp(t,e){t.prototype=Object.create(e.prototype),kV(t.prototype.constructor=t,e)}function kV(t,e){return(kV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}function jB(t,e,n){t instanceof e&&n.push(t),t instanceof sl&&t.findAll(e,n)}var sl=function(t){function e(){return t.apply(this,arguments)||this}cp(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 mi?this.children.forEach(function(s){return jB(s,l,r)}):this.fields.forEach(function(s){return jB(i[s],l,r)}),r},n.iterFields=function(l){var r=this;this.fields.forEach(function(i){l(r[i],i)})},e}(h4.Obj),cb=function(t){function e(){return t.apply(this,arguments)||this}return cp(e,t),ob(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-22 10:56:27 +08:00
`,process.stdout.write(r+i)})}var X={Node:sl,Root:v_e,NodeList:mi,Value:cb,Literal:DV,Symbol:__e,Group:E_e,Array:b_e,Pair:w_e,Dict:PV,Output:$_e,Capture:B_e,TemplateData:H_e,If:LV,IfAsync:T_e,InlineIf:x_e,For:pb,AsyncEach:A_e,AsyncAll:O_e,Macro:FV,Caller:N_e,Import:C_e,FromImport:I_e,FunCall:jV,Filter:UV,FilterAsync:R_e,KeywordArgs:k_e,Block:D_e,Super:P_e,Extends:L_e,Include:F_e,Set:j_e,Switch:U_e,Case:M_e,LookupVal:S_e,BinOp:F3,In:V_e,Is:q_e,Or:z_e,And:G_e,Not:J_e,Add:K_e,Concat:X_e,Sub:W_e,Mul:Y_e,Div:Q_e,FloorDiv:Z_e,Mod:eEe,Pow:tEe,Neg:nEe,Pos:lEe,Compare:rEe,CompareOperand:iEe,CallExtension:GE,CallExtensionAsync:sEe,printNodes:function t(e,n){var l,r;n=n||0,K0(e.typename+": ",n),e instanceof mi?(K0(`
`),e.children.forEach(function(i){t(i,n+2)})):e instanceof GE?(K0(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 sl?l.push([s,i]):(r=r||{})[s]=i}),r?K0(JSON.stringify(r,null,2)+`
`,null,!0):K0(`
`),l.forEach(function(a){var s=a[0],a=a[1];K0("["+s+"] =>",n+2),t(a,n+4)}))}};function MV(t,e){return(MV=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 UB=function(t){var e;function n(){return t.apply(this,arguments)||this}e=t,(l=n).prototype=Object.create(e.prototype),MV(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!==Ge.TOKEN_WHITESPACE)return i=this.peeked,this.peeked=null,i;this.peeked=null}if(i=this.tokens.nextToken(),!r)for(;i&&i.type===Ge.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 Fe.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(Ge.TOKEN_SYMBOL,r)},l.advanceAfterBlockEnd=function(r){var i;return r||((i=this.peekToken())||this.fail("unexpected end of file"),i.type!==Ge.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),r=this.nextToken().value),(i=this.nextToken())&&i.type===Ge.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===Ge.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===Ge.TOKEN_COMMA){var a=r.name;for(r.name=new X.Array(a.lineno,a.colno),r.name.addChild(a);this.skip(Ge.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-22 10:56:27 +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(" "+hEe[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-22 10:56:27 +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 dE,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 dE,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
};`)},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}(h4.Obj),mEe={compile:function(s,e,n,l,r){var i=new $B(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(cEe.transform(aEe.parse(s,n,r),e,l)),i.getCode()},Compiler:$B},yEe=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(Fe.isString(d))return d.split("");if(Fe.isObject(d))return Fe._entries(d||{}).map(function(y){return{key:y[0],value:y[1]}});if(Fe.isArray(d))return d;throw new Fe.TemplateError("list filter: type not iterable")}function i(d){return function(y,_,S){var w=this,E=w.env.getTest(_=_===void 0?"truthy":_);return Fe.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,_=Fe.repeat(" ",y/2-y%2),y=Fe.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(!Fe.isObject(d))throw new Fe.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 Fe.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||(Fe.isString(g)&&(g=g.toUpperCase()),Fe.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(Fe.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(Fe.escape((d=d??"").toString()))},t.groupby=function(d,y){return Fe.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-07 17:30:00 +08:00
`),w=Fe.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=_?Fe.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:(!Fe.isObject(d)||d instanceof yt.SafeString?d:Fe.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=Fe.isString(d)?r(d):Fe.map(d,function(_){return _})).reverse(),Fe.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?Fe.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=Fe.map(E,function(v){return v}),g=Fe.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!_&&Fe.isString(v)&&Fe.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-05-22 10:56:27 +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 Fe.isString(d)?y(d):(Fe.isArray(d)?d:Fe._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}),rp={};function qV(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 gEe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,hE=function(t){return gEe.exec(t).slice(1)};function mE(){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?"/":"")+qV(db(t.split("/"),function(r){return!!r}),!e).join("/")||"."}function BB(t){var e=zV(t),n=vEe(t,-1)==="/";return(t=(t=qV(db(t.split("/"),function(l){return!!l}),!e).join("/"))||e?t:".")&&n&&(t+="/"),(e?"/":"")+t}function zV(t){return t.charAt(0)==="/"}var o4={extname:function(t){return hE(t)[3]},basename:function(t,e){return t=hE(t)[2],e&&t.substr(-1*e.length)===e?t.substr(0,t.length-e.length):t},dirname:function(n){var e=(n=hE(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=mE(t).substr(1),e=mE(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 BB(db(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:zV,normalize:BB,resolve:mE};function db(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 vEe="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 GV(t,e){return(GV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}var hb=function(t){var e;function n(){return t.apply(this,arguments)||this}e=t,(l=n).prototype=Object.create(e.prototype),GV(l.prototype.constructor=l,e);var l=n.prototype;return l.resolve=function(r,i){return o4.resolve(o4.dirname(r),i)},l.isRelative=function(r){return r.indexOf("./")===0||r.indexOf("../")===0},n}(h4.EmitterObj);function JV(t,e){return(JV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,l){return n.__proto__=l,n})(t,e)}var _Ee=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),JV(e.prototype.co
2024-05-06 10:35:10 +08:00
/* [wrapped with `+L+`] */
2024-05-22 10:56:27 +08:00
`)):C}(A,function(C,L){return Wl(m,function(z){var K="_."+z[0];L&z[1]&&!dr(C,K)&&C.push(K)}),C.sort()}(function(){var C=A.match(c3);return C?C[1].split(hl):[]}(),b)))}function pA(p){var h=0,b=0;return function(){var A=Dee(),C=16-(A-b);if(b=A,0<C){if(800<=++h)return arguments[0]}else h=0;return p.apply(n,arguments)}}function U8(p,h){var b=-1,A=p.length,C=A-1;for(h=h===n?A:h;++b<h;){var L=ad(b,C),z=p[L];p[L]=p[b],p[b]=z}return p.length=h,p}var fA=function(){var p=H8(function(b){var A=[];return b.charCodeAt(0)===46&&A.push(""),b.replace(dt,function(C,L,z,K){A.push(z?K.replace(w2,"$1"):L||C)}),A},function(b){return h.size===500&&h.clear(),b}),h=p.cache;return p}();function Kr(p){var h;return typeof p=="string"||k3(p)?p:(h=p+"")=="0"&&1/p==-1/0?"-0":h}function vu(p){if(p!=null){try{return m8.call(p)}catch{}try{return p+""}catch{}}return""}function dA(p){var h;return p instanceof Wt?p.clone():((h=new mr(p.__wrapped__,p.__chain__)).__actions__=p3(p.__actions__),h.__index__=p.__index__,h.__values__=p.__values__,h)}function hA(p,h,b){var A=p==null?0:p.length;return A?((b=b==null?0:At(b))<0&&(b=Ql(A+b,0)),Hr(p,ut(h,3),b)):-1}function mA(p,h,b){var A,C=p==null?0:p.length;return C?(A=C-1,b!==n&&(A=At(b),A=b<0?Ql(C+A,0):P2(A,C-1)),Hr(p,ut(h,3),A,!0)):-1}function yA(p){return p!=null&&p.length?T2(p,1):[]}function gA(p){return p&&p.length?p[0]:n}function G3(p){var h=p==null?0:p.length;return h?p[h-1]:n}function vA(p,h){return p&&p.length&&h&&h.length?sd(p,h):p}Kf=It(function(p,h){return Ll(p)?n1(p,T2(h,1,Ll,!0)):[]}),zr=It(function(p,h){var b=G3(h);return Ll(b)&&(b=n),Ll(p)?n1(p,T2(h,1,Ll,!0),ut(b,2)):[]}),Q4=It(function(p,h){var b=G3(h);return Ll(b)&&(b=n),Ll(p)?n1(p,T2(h,1,Ll,!0),n,b):[]}),Zt=It(function(p){var h=on(p,fd);return h.length&&h[0]===p[0]?td(h):[]}),Lo=It(function(p){var h=G3(p),b=on(p,fd);return h===G3(b)?h=n:b.pop(),b.length&&b[0]===p[0]?td(b,ut(h,2)):[]}),Xf=It(function(p){var h=G3(p),b=on(p,fd);return(h=typeof h=="function"?h:n)&&b.pop(),b.length&&b[0]===p[0]?td(b,n,h):[]}),L2=It(vA);var Kee=Di(function(p,h){var b=p==null?0:p.length,A=Yf(p,h);return Rx(p,on(h,function(C){return Pi(C,b)?+C:C}).sort(Bx)),A});function Ad(p){return p==null?p:Lee.call(p)}var Xee=It(function(p){return hs(T2(p,1,Ll,!0))}),Wee=It(function(p){var h=G3(p);return Ll(h)&&(h=n),hs(T2(p,1,Ll,!0),ut(h,2))}),Yee=It(function(p){var h=typeof(h=G3(p))=="function"?h:n;return hs(T2(p,1,Ll,!0),n,h)});function Od(p){var h;return p&&p.length?(h=0,p=p2(p,function(b){if(Ll(b))return h=Ql(b.length,h),!0}),o8(h,function(b){return on(p,Vr(b))})):[]}function _A(p,h){return p&&p.length?(p=Od(p),h==null?p:on(p,function(b){return c2(h,n,b)})):[]}var Qee=It(function(p,h){return Ll(p)?n1(p,h):[]}),Zee=It(function(p){return pd(p2(p,Ll))}),ete=It(function(p){var h=G3(p);return Ll(h)&&(h=n),pd(p2(p,Ll),ut(h,2))}),tte=It(function(p){var h=typeof(h=G3(p))=="function"?h:n;return pd(p2(p,Ll),n,h)}),nte=It(Od),lte=It(function(p){var h=typeof(h=1<(h=p.length)?p[h-1]:n)=="function"?(p.pop(),h):n;return _A(p,h)});function EA(p){return(p=R(p)).__chain__=!0,p}function M8(p,h){return h(p)}var rte=Di(function(p){function h(L){return Yf(L,p)}var b=p.length,A=b?p[0]:0,C=this.__wrapped__;return!(1<b||this.__actions__.length)&&C instanceof Wt&&Pi(A)?((C=C.slice(A,+A+(b?1:0))).__actions__.push({func:M8,args:[h],thisArg:n}),new mr(C,this.__chain__).thru(function(L){return b&&!L.length&&L.push(n),L})):this.thru(h)}),ite=R8(function(p,h,b){Wn.call(p,b)?++p[b]:Ri(p,b,1)}),ste=Jx(hA),ate=Jx(mA);function bA(p,h){return(St(p)?Wl:ds)(p,ut(h,3))}function wA(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}:vx)(p,ut(h,3))}var ute=R8(function(p,h,b){Wn.call(p,b)?p[b].push(h):Ri(p,b,[h])}),ote=It(function(p,h,b){var A=-1,C=typeof h=="function",L=f3(p)?he(p.length):[];return ds(p,function(z){L[++A]=C?c2(h,z,b):l1(z,h,b)}),L}),cte=R8(function(p,h,b){Ri(p,b,h)});function $8(p,h){return(St(p)?on:xx)(p,ut(h,3))}var pte=R8(function(p,h,b){p[b?0:1].push(h)},function(){return[[],[]]}),fte=It(function(p,h){var b;return p==null?[]:(1<(b=h.length)&&Z2(p,h[0],h[1])?h
`;if(p.replace(fe,function(Ee,_e,Te,nt,ke,De){return Te=Te||nt,pe+=p.slice(K,De).replace(ql,nx),_e&&(A=!0,pe+=`' +
2024-05-06 10:35:10 +08:00
__e(`+_e+`) +
'`),ke&&(C=!0,pe+=`';
`+ke+`;
2024-05-13 09:18:33 +08:00
__p += '`),Te&&(pe+=`' +
((__t = (`+Te+`)) == null ? '' : __t) +
'`),K=De+Ee.length,Ee}),pe+=`';
`,le=Wn.call(h,"variable")&&h.variable){if(xl.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-22 10:56:27 +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-05-22 10:56:27 +08:00
}`,(fe=VA(function(){return wt(L,Ae+"return "+pe).apply(n,z)})).source=pe,kd(fe))throw fe;return fe},R.times=function(p,h){if((p=At(p))<1||o<p)return[];var b=f,A=P2(p,f);for(h=ut(h),p-=f,A=o8(A,h);++b<p;)h(b);return A},R.toFinite=Fi,R.toInteger=At,R.toLength=DA,R.toLower=function(p){return hn(p).toLowerCase()},R.toNumber=K3,R.toSafeInteger=function(p){return p?mu(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)?Oi(p):p&&(h=R3(h))?ys(b=hr(p),c8(b,h=hr(h)),p8(b,h)+1).join(""):p},R.trimEnd=function(p,h,b){return(p=hn(p))&&(b||h===n)?p.slice(0,lx(p)+1):p&&(h=R3(h))?ys(b=hr(p),0,p8(b,hr(h))+1).join(""):p},R.trimStart=function(p,h,b){return(p=hn(p))&&(b||h===n)?p.replace(Tl,""):p&&(h=R3(h))?ys(b=hr(p),c8(b,hr(h))).join(""):p},R.truncate=function(p,C){var b,z=30,A="...",C=(vl(C)&&(b="separator"in C?C.separator:b,z="length"in C?At(C.length):z,A="omission"in C?R3(C.omission):A),(p=hn(p)).length);if((C=cu(p)?(L=hr(p)).length:C)<=z)return p;if((C=z-ko(A))<1)return A;var L,z=L?ys(L,0,C).join(""):p.slice(0,C);if(b!==n)if(L&&(C+=z.length-C),Dd(b)){if(p.slice(C).search(b)){var K,le=z;for((b=b.global?b:pu(b.source,hn(M3.exec(b))+"g")).lastIndex=0;K=b.exec(le);)var pe=K.index;z=z.slice(0,pe===n?C:pe)}}else p.indexOf(R3(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(ze,xee):p},R.uniqueId=function(p){var h=++Oee;return hn(p)+h},R.upperCase=jte,R.upperFirst=Fd,R.each=bA,R.eachRight=wA,R.first=gA,Md(R,(Vd={},Gr(R,function(p,h){Wn.call(R.prototype,h)||(Vd[h]=p)}),Vd),{chain:!1}),R.VERSION="4.17.21",Wl(["bind","bindKey","curry","curryRight","partial","partialRight"],function(p){R[p].placeholder=R}),Wl(["drop","take"],function(p,h){Wt.prototype[p]=function(b){b=b===n?1:Ql(At(b),0);var A=this.__filtered__&&!h?new Wt(this):this.clone();return A.__filtered__?A.__takeCount__=P2(b,A.__takeCount__):A.__views__.push({size:P2(b,f),type:p+(A.__dir__<0?"Right":"")}),A},Wt.prototype[p+"Right"]=function(b){return this.reverse()[p](b).reverse()}}),Wl(["filter","map","takeWhile"],function(p,h){var b=h+1,A=b==1||b==3;Wt.prototype[p]=function(C){var L=this.clone();return L.__iteratees__.push({iteratee:ut(C,3),type:b}),L.__filtered__=L.__filtered__||A,L}}),Wl(["head","last"],function(p,h){var b="take"+(h?"Right":"");Wt.prototype[p]=function(){return this[b](1).value()[0]}}),Wl(["initial","tail"],function(p,h){var b="drop"+(h?"":"Right");Wt.prototype[p]=function(){return this.__filtered__?new Wt(this):this[b](1)}}),Wt.prototype.compact=function(){return this.filter(h3)},Wt.prototype.find=function(p){return this.filter(p).head()},Wt.prototype.findLast=function(p){return this.reverse().find(p)},Wt.prototype.invokeMap=It(function(p,h){return typeof p=="function"?new Wt(this):this.map(function(b){return l1(b,p,h)})}),Wt.prototype.reject=function(p){return this.filter(V8(ut(p)))},Wt.prototype.slice=function(p,h){p=At(p);var b=this;return b.__filtered__&&(0<p||h<0)?new Wt(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)},Wt.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},Wt.prototype.toArray=function(){return this.take(f)},Gr(Wt.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,Br([nt],pe)),A&&Ae?nt[0]:nt}var K,le=this.__wrapped__,pe=A?[1]:arguments,Te=le instanceof Wt,Ee=pe[0],fe=Te||St(le),Ae=(fe&&b&&typeof Ee=="function"&&Ee.length!=1&&(Te=fe=!1),this.__chain__),Ee=!!this.__actions__.length,_e=L&&!Ae,Te=Te&&!Ee;return!L&&fe?(le=Te?le:new Wt(this),(K=p.apply(le,pe)).__actions__.push({func:M8,args:[z],thisArg:n}),new mr(K,Ae)):_e&&Te?p.apply(this,pe):(K=this.thru(z),_e?A?K.value()[0]:K.value():K)})}),Wl(["pop","push","shift","sort","splice","unshift"],function(p){var h=h8[p],b=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",A=/^(?:pop|sh
`)){let u=a.trim();if(u)if(u.startsWith("#")){if(u.startsWith("#EXT")){let o=XEe(u,i);o&&s.push(o)}}else s.push(u)}return s.length!==0&&s[0].name==="EXTM3U"||He("The EXTM3U tag MUST be the first line."),s}(t,e),l=WEe(n,e);return l.source=t,l}var YEe=["#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"],QEe=["#EXT-X-MEDIA"],Rb=class extends Array{constructor(e){super(),this.baseUri=e}push(...e){for(let n of e)if(n.startsWith("#"))if(YEe.some(l=>n.startsWith(l)))super.push(n);else{if(this.includes(n)){if(QEe.some(l=>n.startsWith(l)))continue;He(`Redundant item (${n})`)}super.push(n)}else super.push(n);return this.length}};function Lb(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 ZEe(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 Sq(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&&He("IV must be a 128-bit unsigned integer"),l.push(`IV=${Eq(t.iv)}`)),t.format&&l.push(`KEYFORMAT="${t.format}"`),t.formatVersion&&l.push(`KEYFORMATVERSIONS="${t.formatVersion}"`),`${n}:${l.join(",")}`}function ebe(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=${Lb(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(Pp(r))}if(e.video.length>0){l.push(`VIDEO="${e.video[0].groupId}"`);for(let r of e.video)t.push(Pp(r))}if(e.subtitles.length>0){l.push(`SUBTITLES="${e.subtitles[0].groupId}"`);for(let r of e.subtitles)t.push(Pp(r))}if($Ee().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(Pp(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 Pp(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 tbe(t,e,n,l,r=1,i=null){let s=!1,a="";if(e.discontinuity&&t.push("#EXT-X-DISCONTINUITY"),e.key){let o=Sq(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="${Ob(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:${Ab(e.programDateTime)}`),e.dateRange&&t.push(function(o){let c=[`ID="${o.id}"`];o.start&&c.push(`START-DATE="${Ab(o.start)}"`),o.end&&c.push(`END-DATE="${Ab(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 xq="hls_cache",Kp=[],fo={},O6={},po={},Jp="";function nbe(t,e){if(Kp.push(t),fo[t]=e,Kp.length>5){let n=Kp.shift();lbe(n)}}function lbe(t){delete fo[t],delete Kp[t],new JSFile(xq+"/"+t).delete()}function rbe(t,e){if(e.variants)for(let n of e.variants)n.uri.startsWith("http")||(n.uri=Fb(t,n.uri));if(e.segments)for(let n of e.segments)n.uri.startsWith("http")||(n.uri=Fb(t,n.uri)),n.key&&n.key.uri&&!n.key.uri.startsWith("http")&&(n.key.uri=Fb(t,n.key.uri));return e}async function Aq(t,e){let n=md5X(t);if(fo[n])return fo[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=rbe(r,wq(i));return nbe(n,{code:l.code,plist:s,key:n,headers:l.headers}),fo[n]}return{}}async function Oq(t,e,n){if(!fo[t])return{};let r=fo[t].plist.segments,i=!po[t];if(i){po[t]={};for(let c of r){let f=md5X(c.uri+c.mediaSequenceNumber.toString());po[t][f]={file:xq+"/"+t+"/"+f,uri:c.uri,key:f,index:c.mediaSequenceNumber,order:c.mediaSequenceNumber,state:-1,read:!1}}}for(let c in po[t]){let f=po[t][c];f.index>=e?f.order=f.index-e:f.order=r.length-e+f.index}i&&ibe(t,5,n);let s=r[e],a=md5X(s.uri+s.mediaSequenceNumber.toString()),u=po[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&&Nq(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 Nq(t,e,n){if(e.state>=0||!O6[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 ibe(t,e,n){Jp&&Jp!=t&&delete O6[Jp],Jp=t,O6[t]=!0;for(let l=0;l<e&&O6[t];l++)new Promise(function(r,i){(async function s(){if(!O6[t]){r();return}let a=U.pickBy(po[t],function(o){return o.state==-1}),u=U.minBy(Object.values(a),function(o){return o.order});if(!u){r();return}await Nq(t,u,n),setTimeout(s,5)})()})}function Fb(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 Cq(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 Xp=class{constructor(){this.siteUrl="https://search.youku.com",this.reconnectTimes=0,this.maxReconnectTimes=5,this.jadeLog=new ir(this.getAppName(),"DEBUG")}getAppName(){return"\u5F39\u5E55"}getHeader(){return{"User-Agent":Jl,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"),Pr(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]&&YTe[n])&&(n==="set-cookie"?e[n]?e[n].push(l):e[n]=[l]:e[n]=e[n]?e[n]+", "+l:l)}),e};var KJ=Symbol("internals");function V6(t){return t&&String(t).trim().toLowerCase()}function Of(t){return t===!1||t==null?t:Z.isArray(t)?t.map(Of):String(t)}function QTe(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 ZTe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Dw(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 exe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,l)=>n.toUpperCase()+l)}function txe(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 $4=class{constructor(e){e&&this.set(e)}set(e,n,l){let r=this;function i(a,u,o){let c=V6(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]=Of(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())&&!ZTe(e)?s(JJ(e),n):e!=null&&i(n,e,l),this}get(e,n){if(e=V6(e),e){let l=Z.findKey(this,e);if(l){let r=this[l];if(!n)return r;if(n===!0)return QTe(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=V6(e),e){let l=Z.findKey(this,e);return!!(l&&this[l]!==void 0&&(!n||Dw(this,this[l],l,n)))}return!1}delete(e,n){let l=this,r=!1;function i(s){if(s=V6(s),s){let a=Z.findKey(l,s);a&&(!n||Dw(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||Dw(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]=Of(r),delete n[i];return}let a=e?exe(i):String(i).trim();a!==i&&delete n[i],n[a]=Of(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[KJ]=this[KJ]={accessors:{}}).accessors,r=this.prototype;function i(s){let a=V6(s);l[a]||(txe(r,s),l[a]=!0)}return Z.isArray(e)?e.forEach(i):i(e),this}};$4.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Z.reduceDescriptors($4.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(l){this[n]=l}}});Z.freezeMethods($4);var a2=$4;function q6(t,e){let n=this||M4,l=e||n,r=a2.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 z6(t){return!!(t&&t.__CANCEL__)}function XJ(t,e,n){qe.call(this,t??"canceled",qe.ERR_CANCELED,e,n),this.name="CanceledError"}Z.inherits(XJ,qe,{__CANCEL__:!0});var Fr=XJ;function oa(t,e,n){let l=n.config.validateStatus;!n.status||!l||l(n.status)?t(n):e(new qe("Request failed with status code "+n.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Pw(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Lw(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function wo(t,e){return t&&!Pw(e)?Lw(t,e):e}var vK=Zl(YJ(),1),_K=Zl(require("http"),1),EK=Zl(require("https"),1),bK=Zl(require("util"),1),wK=Zl(rK(),1),us=Zl(require("zlib"),1);var To="1.6.7";function Y6(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var vxe=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Kw(t,e,n){let l=n&&n.Blob||s2.classes.Blob,r=Y6(t);if(e===void 0&&l&&(e=!0),r==="data"){t=r.length?t.slice(r.length+1):t;let i=vxe.exec(t);if(!i)throw new qe("Invalid URL",qe.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 qe("Blob is not supported",qe.ERR_NOT_SUPPORT);return new l([o],{type:s})}return o}throw new qe("Unsupported protocol "+r,qe.ERR_NOT_SUPPORT)}var xo=Zl(require("stream"),1);var sK=Zl(require("stream"),1);function _xe(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 iK=_xe;function Exe(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 Nf=Exe;var Cf=Symbol("internals"),Xw=class extends sK.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[Cf]={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=Nf(l.ticksRate*e.samplesCount,l.timeWindow);this.on("newListener",a=>{a==="progress"&&(l.isCaptured||(l.isCaptured=!0))});let i=0;l.updateProgress=iK(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[Cf];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,l){let r=this,i=this[Cf],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
`,Sxe=Q6.encode(ca),Txe=2,Yw=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)}"`:""}${ca}`;r?n=Q6.encode(String(n).replace(/\r?\n|\r\n?/g,ca)):i+=`Content-Type: ${n.type||"application/octet-stream"}${ca}`,this.headers=Q6.encode(i+ca),this.contentLength=r?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+Txe,this.name=e,this.value=n}async*encode(){yield this.headers;let{value:e}=this;Z.isTypedArray(e)?yield e:yield*If(e),yield Sxe}static escapeName(e){return String(e).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},xxe=(t,e,n)=>{let{tag:l="form-data-boundary",size:r=25,boundary:i=l+"-"+Z.generateString(r,wxe)}=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=Q6.encode("--"+i+ca),a=Q6.encode("--"+i+"--"+ca+ca),u=a.byteLength,o=Array.from(t.entries()).map(([f,m])=>{let d=new Yw(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),oK.Readable.from(async function*(){for(let f of o)yield s,yield*f.encode();yield a}())},cK=xxe;var pK=Zl(require("stream"),1),Qw=class extends pK.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)}},fK=Qw;var Axe=(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,dK=Axe;var hK={flush:us.default.constants.Z_SYNC_FLUSH,finishFlush:us.default.constants.Z_SYNC_FLUSH},Oxe={flush:us.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:us.default.constants.BROTLI_OPERATION_FLUSH},mK=Z.isFunction(us.default.createBrotliDecompress),{http:Nxe,https:Cxe}=wK.default,Ixe=/https:?/,yK=s2.protocols.map(t=>t+":");function Rxe(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function TK(t,e,n){let l=e;if(!l&&l!==!1){let r=(0,vK.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){TK(i,e,i.href)}}var kxe=typeof process<"u"&&Z.kindOf(process)==="process",Dxe=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)}),Pxe=({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)}},gK=(t,e)=>Pxe(Z.isObject(t)?t:{address:t,family:e}),xK=kxe&&function(e){return Dxe(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=dK(a,me=>Z.isArray(me)?me:[me]);a=(me,P,G)=>{ee(me,P,(V,q,el)=>{if(V)return G(V);let Tt=Z.isArray(q)?q.map(Ye=>gK(Ye)):[gK(q,el)];P.all?G(V,Tt):G(V,Tt[0].address,Tt[0].family)})}}let _=new SK.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 Fr(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=wo(e.baseURL,e.url),g=new URL(E,"http://localhost"),v=g.protocol||yK[0];if(v==="data:"){let ee;if(f!=="GET")return oa(l,r,{status:405,stat
`+i.map(IK).join(`
`):" "+IK(i[0]):"as no adapter specified";throw new qe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return l},adapters:Zw};function eS(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Fr(null,t)}function kf(t){return eS(t),t.headers=a2.from(t.headers),t.data=q6.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Rf.getAdapter(t.adapter||M4.adapter)(t).then(function(l){return eS(t),l.data=q6.call(t,t.transformResponse,l),l.headers=a2.from(l.headers),l},function(l){return z6(l)||(eS(t),l&&l.response&&(l.response.data=q6.call(t,t.transformResponse,l.response),l.response.headers=a2.from(l.response.headers))),Promise.reject(l)})}var RK=t=>t instanceof a2?t.toJSON():t;function os(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(RK(o),RK(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 tS={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{tS[t]=function(l){return typeof l===t||"a"+(e<1?"n ":" ")+t}});var kK={};tS.transitional=function(e,n,l){function r(i,s){return"[Axios v"+To+"] Transitional option '"+i+"'"+s+(l?". "+l:"")}return(i,s,a)=>{if(e===!1)throw new qe(r(s," has been removed"+(n?" in "+n:"")),qe.ERR_DEPRECATED);return n&&!kK[s]&&(kK[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 jxe(t,e,n){if(typeof t!="object")throw new qe("options must be an object",qe.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 qe("option "+i+" must be "+u,qe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qe("Unknown option "+i,qe.ERR_BAD_OPTION)}}var Df={assertOptions:jxe,validators:tS};var pa=Df.validators,H4=class{constructor(e){this.defaults=e,this.interceptors={request:new Cw,response:new Cw}}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=os(this.defaults,n);let{transitional:l,paramsSerializer:r,headers:i}=n;l!==void 0&&Df.assertOptions(l,{silentJSONParsing:pa.transitional(pa.boolean),forcedJSONParsing:pa.transitional(pa.boolean),clarifyTimeoutError:pa.transitional(pa.boolean)},!1),r!=null&&(Z.isFunction(r)?n.paramsSerializer={serialize:r}:Df.assertOptions(r,{encode:pa.function,serialize:pa.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=a2.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=[kf.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=kf.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=os(this.defaults,e);let n=wo(e.baseURL,e.url);return bo(n,e.params,e.paramsSerializer)}};Z.forEach(["delete","get","head","options"],function(e){H4.prototype[e]=function(n,l){return this.request(os(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(os(a||{},{method:e,headers:l?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}H4.prototype[e]=n(),H4.prototype[e+"Form"]=n(!0)});var Z6=H4;var nS=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 Fr(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}}},DK=nS;function lS(t){return function(n){return t.apply(null,n)}}function rS(t){return Z.isObject(t)&&t.isAxiosError===!0}var iS={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(iS).forEach(([t,e])=>{iS[e]=t});var PK=iS;function LK(t){let e=new Z6(t),n=$6(Z6.prototype.request,e);return Z.extend(n,Z6.proto
`},timeout:.1}),await dataBase.push(l,uS)}globalThis.localLog={set:async function(t,e,n){Kxe(t,e,n)}};function Jxe(){Ao.default.existsSync("log")||Ao.default.mkdirSync("log");let t="log/info.log";return Ao.default.existsSync(t)?Ao.default.readFileSync(t).toString():(Ao.default.writeFileSync(t,""),"")}function Kxe(t){Ao.default.writeFileSync("log/info.log",Jxe()+`
`+t)}globalThis.req=Xxe;async function Xxe(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=VK.default.stringify(n,{encode:!1}))):l==="form-data"&&(u["Content-Type"]="multipart/form-data",n=FK(n));let o=r===1||r===2?"arraybuffer":void 0,c;a?c=GK.default.httpsOverHttp({proxy:{host:"127.0.0.1",port:7890}}):c=qK.default.Agent({rejectUnauthorized:!1});let f=await V4(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=Wxe;function Wxe(t){return zK.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 Yxe=["DEBUG","INFO","WARNING","ERROR"];var da=class{constructor(e,n="DEBUG"){this.app_name=e,this.level=n,this.level_index=Yxe.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+`
`},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 Ce=class extends Pe{constructor(){super(),this.jadeLog=new da(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 U.isEmpty(e)?this.classes:e}async getFiletObjCache(){let e=await this.db.getObjectDefault(this.deviceKey+"filterObj",{});return U.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 U
`," ").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=Be.enc.Utf8.parse("2890"+n+"tB959C"),r=Be.enc.Utf8.parse("2F131BE91247866E"),i=Be.AES.decrypt(e,l,{iv:r,mode:Be.mode.CBC,padding:Be.pad.Pkcs7});return Be.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(xe(/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))}},yn=new oS;var cS=class extends Ce{constructor(){super()}getName(){return yn.getName()}getAppName(){return yn.getAppName()}getJSName(){return yn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await yn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await yn.initCookie(e.server.config.biliCookie),await yn.spiderInit(e),yn.cfgObj.code=0,yn.catOpenStatus=!0,yn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await yn.setClasses(),this.classes=yn.classes}async setFilterObj(){await yn.setFilterObj(),this.filterObj=yn.filterObj}async setHomeVod(){await yn.setHomeVod(),this.homeVodList=yn.homeVodList}async setCategory(e,n,l,r){await yn.setCategory(e,n,l,r),this.vodList=yn.vodList}async setDetail(e){await yn.setDetail(e),this.vodDetail=yn.vodDetail}async setPlay(e,n,l){await yn.setPlay(e,n,l),this.playUrl=yn.playUrl,this.result=yn.result}async setSearch(e,n,l){await yn.setSearch(e,n,l),this.vodList=yn.vodList,this.result=yn.result}async setProxy(e,n){return await yn.proxy(e,n)}},ha=new cS;async function JK(t,e){return await ha.init(t,e)}async function KK(t,e){return await ha.home(t,e)}async function Qxe(t,e){return await ha.homeVod(t,e)}async function XK(t,e){return await ha.category(t,e)}async function WK(t,e){return await ha.detail(t,e)}async function YK(t,e){return await ha.play(t,e)}async function QK(t,e){return await ha.search(t,e)}async function Zxe(t,e){return await ha.proxy(t,e)}var ZK={meta:{key:yn.getJSName(),name:yn.getName(),type:yn.getType()},api:async t=>{t.post("/init",JK),t.post("/home",KK),t.post("/category",XK),t.post("/detail",WK),t.post("/play",YK),t.post("/search",QK),t.get("/proxy/:what/:ids/:end",Zxe)},spider:{init:JK,home:KK,homeVod:Qxe,category:XK,detail:WK,play:YK,search:QK}};function eAe(t){return t==="zd"?"\u6700\u5927":t==="yj"?"\u6C38\u4E
`,"").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(!U.isEmpty(e)){let n=Ve(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();U.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(!U.isEmpty(l)){let i=Ve(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(!U.isEmpty(e)){let n=Ve(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(!U.isEmpty(s)){let a=e.split("/")[1],u=e.split("/")[2],o=xe(/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=Ve(f);this.vodList=await this.parseVodShortListFromDoc(m)}}}async setDetail(e){let n=this.siteUrl+e,l=await this.fetch(n,null,this.getHeader());if(!U.isEmpty(l)){let r=Ve(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(!U.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(!U.isEmpty(r)){let i={top:10,q:e},s=xe(/var my_search='(.*?)';/,r),a=await this.fetch(s,i,this.getHeader());if(!U.isEmpty(a)){let u=JSON.parse(a.replaceAll("\uFEFF",""));this.vodList=await this.parseVodShortListFromJson(u)}}}},gn=new pS;var fS=class extends Ce{constructor(){super()}getName(){return gn.getName()}getAppName(){return gn.getAppName()}getJSName(){return gn.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 gn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await gn.initCookie(e.server.config.biliCookie),await gn.spiderInit(e),gn.cfgObj.code=0,gn.catOpenStatus=!0,gn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await gn.setClasses(),this.classes=gn.classes}async setFilterObj(){await gn.setFilterObj(),this.filterObj=gn.filterObj}async setHomeVod(){await gn.setHomeVod(),this.homeVodList=gn.homeVodList}async setCategory(e,n,l,r){await gn.setCategory(e,n,l,r),this.vodList=gn.vodList}async setDetail(e){await gn.setDetail(e),this.vodDetail=gn.vodDetail}async setPlay(e,n,l){await gn.setPlay(e,n,l),this.playUrl=gn.playUrl,this.result=gn.result}async setSearch(e,n,l){await gn.setSearch(e,n,l),this.vodList=gn.vodList,this.result=gn.result}async setProxy(e,n){return await gn.proxy(e,n)}},ma=new fS;async function eX(t,e){return await ma.init(t,e)}async function tX(t,e){return await ma.home(t,e)}async function tAe(t,e){return await ma.homeVod(t,e)}async function nX(t,e){return await ma.category(t,e)}async function lX(t,e){return await ma.detail(t,e)}async function rX(t,e){return aw
`,"").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(!U.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 Ue;return a.vod_name=e(".article_container > h1").text(),a.vod_pic=e("#post_content img").attr("src"),a.type_name=xe(/◎类  别 (.*?)<br>/,s),U.isEmpty(a.type_name)&&(a.type_name=e('[rel="category tag"]').text()),a.vod_year=xe(/◎年  代 (.*?)<br>/,s),U.isEmpty(a.vod_year)&&(a.vod_year=xe(/首播:(.*?)<br>"/,s)),a.vod_area=xe(/◎产  地 (.*?)<br>/,s),U.isEmpty(a.vod_year)&&(a.vod_area=xe(/地区:(.*?)<br>"/,s)),a.vod_remarks=xe(/◎上映日期 (.*?)<br>/,s),a.vod_actor=this.getActorOrDirector(/◎演  员 (.*?)<\/p>/,s),U.isEmpty(a.vod_actor)&&(a.vod_actor=this.getActorOrDirector(/◎主  演 (.*?)<\/p>/,s)),U.isEmpty(a.vod_actor)&&(a.vod_actor=this.getActorOrDirector(/主演:(.*?)<br>/,s)),a.vod_director=this.getActorOrDirector(/◎导  演 (.*?)<br>/,s),U.isEmpty(a.vod_director)&&(a.vod_director=this.getActorOrDirector(/导演:(.*?)<br>/,s)),a.vod_content=this.getDescription(/◎简  介(.*?)<hr>/gi,s),U.isEmpty(a.vod_content)&&(a.vod_content=this.getDescription(/简介(.*?)<\/p>/gi,s)),U.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(!U.isEmpty(e)){let n=Ve(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(U.isEmpty(e))await this.jadeLog.info("\u9996\u9875\u7C7B\u522B\u89E3\u6790\u5931\u8D25",!0);else{let n=Ve(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(!U.isEmpty(a)){let u=Ve(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(!U.isEmpty(i)){let s=Ve(i);this.vodList=await this.parseVodShortListFromDoc(s)}}async setDetail(e){let n=this.site
`;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=xe(/名称:(.*?)\n/,s),n.vod_actor=xe(/主演:(.*?)\n/,s),n.vod_director=xe(/导演:(.*?)\n/,s),n.vod_area=xe(/地区:(.*?)\n/,s),n.vod_year=xe(/年份:(.*?)\n/,s),n.vod_remarks=xe(/更新:(.*?)\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=Ve(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=xe(/《(.*?)》/,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=xe(/《(.*?)》/,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=Ve(i);this.vodList=await this.parseVodShortListFromDocByCategory(s)}},En=new gS;var vS=class extends Ce{constructor(){super()}getName(){return En.getName()}getAppName(){return En.getAppName()}getJSName(){return En.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await En.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await En.initCookie(e.server.config.biliCookie),await En.spiderInit(e),En.cfgObj.code=0,En.catOpenStatus=!0,En.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await En.setClasses(),this.classes=En.classes}async setFilterObj(){await En.setFilterObj(),this.filterObj=En.filterObj}async setHomeVod(){await En.setHomeVod(),this.homeVodList=En.homeVodList}async setCategory(e,n,l,r){await En.setCategory(e,n,l,r),this.vodList=En.vodList}async setDetail(e){await En.setDetail(e),this.vodDetail=En.vodDetail}async setPlay(e,n,l){await En.setPlay(e,n,l),this.playUrl=En.playUrl,this.result=En.result}async setSearch(e,n,l){await En.setSearch(e,n,l),this.vodList=En.vodList,this.result=En.result}async setProxy(e,n){return await En.proxy(e,n)}},va=new vS;async function AX(t,e){return await va.init(t,e)}async function OX(t,e){return await va.home(t,e)}async function aAe(t,e){return await va.homeVod(t,e)}async function NX(t,e){return await va.category(t,e)}async function CX(t,e){return await va.detail(t,e)}async function IX(t,e){return await va.play(t,e)}async function RX(t,e){return await va.search(t,e)}async function uAe(t,e){return await va.proxy(t,e)}var kX={meta:{key:En.getJSName(),name:En.getName(),type:En.getType()},api:async t=>{t.post("/init",AX),t.post("/home",OX),t.post("/category",NX),t.post("/detail",CX),t.post("/play",IX),t.post("/search",RX),t.get("/proxy/:what/:id
`,"").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(!U.isEmpty(r)){let i=Ve(r),s=await this.parseVodShortListFromDocBySearch(i);s.length>0?e=s[0].vod_id:e=""}}if(!U.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(!U.isEmpty(i)){let s=Ve(i);this.vodList=await this.parseVodShortListFromDocBySearch(s)}}async setPlay(e,n,l){this.playUrl=await A3(e,n,l),this.result.setHeader(or(e))}},wn=new bS;var wS=class extends Ce{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)}},Ea=new wS;async function $X(t,e){return await Ea.init(t,e)}async function BX(t,e){return await Ea.home(t,e)}async function pAe(t,e){return await Ea.homeVod(t,e)}async function HX(t,e){return await Ea.category(t,e)}async function VX(t,e){return await Ea.detail(t,e)}async function qX(t,e){return await Ea.play(t,e)}async function zX(t,e){return await Ea.search(t,e)}async function fAe(t,e){return await Ea.proxy(t,e)}var GX={meta:{key:wn.getJSName(),name:wn.getName(),type:wn.getType()},api:async t=>{t.post("/init",$X),t.post("/home",BX),t.post("/category",HX),t.post("/detail",VX),t.post("/play",qX),t.post("/search",zX),t.get("/proxy/:what/:ids/:end",fAe)},spider:{init:$X,home:BX,homeVod:pAe,category:HX,detail:VX,play:qX,search:zX}};var ba=class extends Pe{constructor(){super(),this.siteUrl="http://cj.ffzyapi.com",this.remove18=!1,this.type_id_18=34}async spiderInit(e){e!==null?this.detailProxy=await js2Proxy(e,"detail",this.getHeader()):this.detailProxy=await js2Proxy(!0,this.siteType,this.siteKey,"detail/",this.getHeader())}async init(e){await super.init(e),await this.spiderInit(null)}async parseVodShortListFromJson(e,n=!1){let l=[],r;for(let i of e.list)n?(r=new Ne,r.vod_pic=this.detailProxy+l2(i.vod_id),r.vod_id=i.vod_id,r.vod_name=i.vod_name,r.vod_remarks=i.vod_remarks):r=this.parseVodDetail(i),this.remove18&&i.type_id!==this.type_id_18&&l.push(r),!this.remove18&&i.type_id===this.type_id_18&&l.push(r);return l}parseVodDetail(e){let n=new Ue;n.vod_i
`),r=[];for(let m of l)U.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(`
`,"");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=U.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(!U.isEmpty(e)){let n=Ve(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=Ve(r);this.filterObj[n]=await this.getFilter(i)}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!U.isEmpty(e)){let n=Ve(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(!U.isEmpty(s)){let a=Ve(s);this.vodList=await this.parseVodShortListFromDoc(a);let u=xe(/\$\("\.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(!U.isEmpty(l)){let r=Ve(l);this.vodDetail=await this.parseVodDetailFromDoc(r)}}async setPlay(e,n,l){let r=await this.fetch(this.siteUrl+n,null,this.getHeader());if(!U.isEmpty(r)){let i=xe(/<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(!U.isEmpty(r)){let i=Ve(r);this.vodList=await this.parseVodShortListFromDocBySearch(i)}}},On=new kS;var DS=class extends Ce{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\u6
`,"").replaceAll(" ","").replaceAll(" ","")+"end";if(o.indexOf("\u5E74\u4EFD")>-1&&(e.vod_year=xe(/年份:(.*?)end/,o).replaceAll("/","")),o.indexOf("\u5907\u6CE8")>-1){let c=xe(/备注:(.*?)end/,o);e.vod_remarks=xe(/备注:\/(.*?)end/,o)}o.indexOf("\u6807\u7B7E")>-1&&(e.type_name=xe(/标签:(.*?)end/,o)),o.indexOf("\u5267\u60C5")>-1&&(e.vod_content=xe(/剧情:(.*?)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(xe(/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
`);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 u3([s]);return l.vod_play_from=U.keys(a).join("$$$"),l.vod_play_url=U.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(U.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(!U.isEmpty(l)){let r=Ve(l);this.vodList=await this.parseVodShortListFromDocBySearch(r,e)}}async setPlay(e,n,l){this.playUrl=await A3(e,n,l),this.result.setHeader(or(e))}},Rn=new HS;var VS=class extends Ce{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)}},Pa=new VS;async function lY(t,e){return await Pa.init(t,e)}async function rY(t,e){return await Pa.home(t,e)}async function HAe(t,e){return await Pa.homeVod(t,e)}async function iY(t,e){return await Pa.category(t,e)}async function sY(t,e){return await Pa.detail(t,e)}async function aY(t,e){return await Pa.play(t,e)}async function uY(t,e){return await Pa.search(t,e)}async function VAe(t,e){return await Pa.proxy(t,e)}var oY={meta:{key:Rn.getJSName(),name:Rn.getName(),type:Rn.getType()},api:async t=>{t.post("/init",lY),t.post("/home",rY),t.post("/category",iY),t.post("/detail",sY),t.post("/play",aY),t.post("/search",uY),t.get("/proxy/:what/:ids/:end",VAe)},spider:{init:lY,home:rY,homeVod:HAe,category:iY,detail:sY,play:aY,search:uY}};var qS=class extends ba{constructor(){super(),this.siteUrl="https://cj.lzcaiji.com",this.remove18=!0}getAppName(){return"\u91CF\u5B50\u8D44\u6E90"}getName(){return"\u{1F41D}\u2503\u91CF\u5B50\u8D44\u6E90\u2503\u{1F41D}"}getJSName(){return"liangzi"}getType(){return 3}async spiderInit(e){await super.spiderInit(e)}async init(e){await super.init(e),await this.spiderInit(null)}},kn=new qS;var zS=class extends Ce{constructor(){super()}getName(){return kn.getName()}getAppName(){return kn.getAppName()}getJSName(){return kn.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 kn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await kn.initCookie(e.server.config.biliCookie),await kn.spiderInit(e),kn.cfgObj.code=0,kn.catOpenStatus=!0,kn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await kn.setClasses(),this.classes=kn.classes}async setFilterObj(){await kn.setFilterObj(),this.filterObj=kn.filterObj}async setHomeVod(){await kn.setHomeVod(),this.homeVodList=kn.homeVodList}async setCategory(e,n,l,r){await kn.setCategory(e,n,l,r),this.vodList=kn.vodList}async setDetail(e){await kn.setDetail(e),this.vodDetail=kn.vodDetail}async setPlay(e,n,l){await kn.setPlay(e,n,l),this.playUrl=kn.playUrl,this.result=kn.result}async setSearch(e,n,l){await kn.setSearch(e,n,l),this.vodList=kn.vodList,this.result=kn.result}async setProxy(e,n){return await kn.
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-05-22 10:56:27 +08:00
</MPD>`}async proxy(e,n){let l=e[0],r=E2(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:""})}},Dn=new GS;var JS=class extends Ce{constructor(){super()}getName(){return Dn.getName()}getAppName(){return Dn.getAppName()}getJSName(){return Dn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await Dn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Dn.initCookie(e.server.config.biliCookie),await Dn.spiderInit(e),Dn.cfgObj.code=0,Dn.catOpenStatus=!0,Dn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Dn.setClasses(),this.classes=Dn.classes}async setFilterObj(){await Dn.setFilterObj(),this.filterObj=Dn.filterObj}async setHomeVod(){await Dn.setHomeVod(),this.homeVodList=Dn.homeVodList}async setCategory(e,n,l,r){await Dn.setCategory(e,n,l,r),this.vodList=Dn.vodList}async setDetail(e){await Dn.setDetail(e),this.vodDetail=Dn.vodDetail}async setPlay(e,n,l){await Dn.setPlay(e,n,l),this.playUrl=Dn.playUrl,this.result=Dn.result}async setSearch(e,n,l){await Dn.setSearch(e,n,l),this.vodList=Dn.vodList,this.result=Dn.result}async setProxy(e,n){return await Dn.proxy(e,n)}},Fa=new JS;async function gY(t,e){return await Fa.init(t,e)}async function vY(t,e){return await Fa.home(t,e)}async function GAe(t,e){return await Fa.homeVod(t,e)}async function _Y(t,e){return await Fa.category(t,e)}async function EY(t,e){return await Fa.detail(t,e)}async function bY(t,e){return await Fa.play(t,e)}async function wY(t,e){return await Fa.search(t,e)}async function JAe(t,e){return await Fa.proxy(t,e)}var SY={meta:{key:Dn.getJSName(),name:Dn.getName(),type:Dn.getType()},api:async t=>{t.post("/init",gY),t.post("/home",vY),t.post("/category",_Y),t.post("/detail",EY),t.post("/play",bY),t.post("/search",wY),t.get("/proxy/:what/:ids/:end",JAe)},spider:{init:gY,home:vY,homeVod:GAe,category:_Y,detail:EY,play:bY,search:wY}};function KAe(t,e,n,l){let r=Be.enc.Utf8.parse(e||"PBfAUnTdMjNDe6pL"),i=Be.enc.Utf8.parse(n||"sENS6bVbwSfvnXrj"),s;return l?s=Be.AES.encrypt(t,r,{iv:i,mode:Be.mode.CBC,padding:Be.pad.Pkcs7}):s=Be.AES.decrypt(t,r,{iv:i,padding:Be.pad.Pkcs7}).toString(Be.enc.Utf8),s}var KS=class extends Pe{constructor(){super(),this.siteUrl="https://www.czys.top"}async init(t){await super.init(t),await z2(this.cfgObj)}getName(){return"\u{1F3ED}\uFE0F\u2503\u5382\u957F\u76F4\u8FDE\u2503\u{1F3ED}\uFE0F"}getAppName(){return"\u5382\u957F\u76F4\u8FDE"}getJSName(){return"changzhang"}getType(){return 3}async getHtml(t=this.siteUrl,e=this.getHeader()){let l=(await this.fetch(t,null,e,!1,!0)).content;if(!U.isEmpty(l)&&l.indexOf("\u4EBA\u673A\u9A8C\u8BC1")===-1)return Ve(l);await this.jadeLog.error("html\u83B7\u53D6\u5931\u8D25",!0)}getSearchHeader(){return{Cookie:"cf_clearance=otYZbHg1safCIxkCtZfy9DPKbf1Gs_zUskkVDc0MVKM-1707026063-1-ATOpKnTLv9+pv171YE/rzxN/nmvGN9Mucx7vpwp0kW2vZb/cbtz5e2md2/ym7EE+9dT7pPBV+kQOg9vJx2v8cks=;myannoun=1;PHPSESSID=73386nobqugs7r3pb2ljcsp5q4","User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/100.0.4896.77 Mobile/15E148 Safari/604.1",Connection:"keep-alive",Host:"www.czzy55.com"}}parseVodShortFromElement(t,e){let n=new Ne,l=t(t(e).find("a")).find("img")[0];return n.vod_name=l.attribs.alt,n.vod_pic=l.attribs["data-original"],n.vod_remarks=t(t(t(e).find("[class='hdinfo']")).find("span")).text(),n.vod_id=t(e).find
`,"").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=Ve(r);this.filterObj[n]=await this.getFilter(i)}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!U.isEmpty(e)){let n=Ve(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(!U.isEmpty(u)){let o=Ve(u);this.vodList=await this.parseVodShortListFromDoc(o);let c=xe(/\$\("\.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(!U.isEmpty(l)){let r=Ve(l);this.vodDetail=await this.parseVodDetailFromDoc(r)}}async setPlay(e,n,l){this.playUrl=await A3(e,n,l),this.result.setHeader(or(e))}async setSearch(e,n){let l=this.siteUrl+"/index.php/vodsearch/-------------.html?wd="+e,r=await this.fetch(l,null,this.getHeader());if(!U.isEmpty(r)){let i=Ve(r);this.vodList=await this.parseVodShortListFromDocBySearch(i)}}},Pn=new WS;var YS=class extends Ce{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)}},Ua=new YS;async function RY(t,e){return await Ua.init(t,e)}async function kY(t,e){return await Ua.home(t,e)}async function iOe(t,e){return await Ua.homeVod(t,e)}async function DY(t,e){return await Ua.category(t,e)}async function PY(t,e){return await Ua.detail(t,e)}async function LY(t,e){return await Ua.play(t,e)}async function FY(t,e){return await Ua.search(t,e)}async function sOe(t,e){return await Ua.proxy(t,e)}var jY={meta:{key:Pn.getJSName(),name:Pn.getName(),type:Pn.getType()},api:async t=>{t.post("/init",RY),t.post("/home",kY),t.post("/category",DY),t.post("/detail",PY),t.post("/play",LY),t.post("/search",FY),t.get("/proxy/:what/:ids/:end",sOe)},spider:{init:RY,home:kY,homeVod:iOe,category:DY,detail:PY,play:LY,search:FY}};function aOe(t){return t.replace(/<\/?[^>]
`;let u=[],o=xe(co,a).split(`
`);for(let f of o){let m=f.match(co);U.isEmpty(m)||u.push(m[1]);let d=f.match(v4);U.isEmpty(d)||u.push(d[1])}let c=await u3([u]);return r.vod_play_from=U.keys(c).join("$$$"),r.vod_play_url=U.values(c).join("$$$"),r.type_name=xe(/标签(.*?)\n/,a).replaceAll("\uFF1A",""),r.vod_content=xe(/描述(.*?)\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 A3(e,n,l),this.result.setHeader(or(e))}async setSearch(e,n){let l=this.siteUrl+`/search.php?q=${e}`,r=await this.getHtml(l);this.vodList=await this.parseVodShortListFromDocByCategory(r)}},Fn=new eT;var tT=class extends Ce{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)}},$a=new tT;async function zY(t,e){return await $a.init(t,e)}async function GY(t,e){return await $a.home(t,e)}async function fOe(t,e){return await $a.homeVod(t,e)}async function JY(t,e){return await $a.category(t,e)}async function KY(t,e){return await $a.detail(t,e)}async function XY(t,e){return await $a.play(t,e)}async function WY(t,e){return await $a.search(t,e)}async function dOe(t,e){return await $a.proxy(t,e)}var YY={meta:{key:Fn.getJSName(),name:Fn.getName(),type:Fn.getType()},api:async t=>{t.post("/init",zY),t.post("/home",GY),t.post("/category",JY),t.post("/detail",KY),t.post("/play",XY),t.post("/search",WY),t.get("/proxy/:what/:ids/:end",dOe)},spider:{init:zY,home:GY,homeVod:fOe,category:JY,detail:KY,play:XY,search:WY}};var nT=class extends e8{constructor(){super(),this.siteUrl="http://v.rbotv.cn",this.cookie="",this.extendObj={extend:"\u7C7B\u578B",area:"\u5730\u533A",year:"\u5E74\u4EE3"},this.parseMap={}}getName(){return"\u{1F6F6}\u2503\u72EC\u64AD\u5F71\u89C6\u2503\u{1F6F6}"}getAppName(){return"\u72EC\u64AD\u5F71\u89C6"}getJSName(){return"dubo"}getType(){return 3}async init(e){await super.init(e),this.danmuStaus=!1}},jn=new nT;var lT=class extends Ce{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.p
`,""),U.isEmpty(l.vod_pic)&&(l.vod_pic=la+"/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 Ue,l=e('[ class="ct mb clearfix"]');n.vod_pic=e(l).find("img")[0].attribs.src,n.vod_name=xe(/◎片  名 (.*?)<br>/,e(l).html()),n.vod_area=xe(/◎产  地 (.*?)<br>/,e(l).html()),n.vod_year=xe(/◎年  代 (.*?)<br>/,e(l).html()),n.type_name=xe(/◎类  别 (.*?)<br>/,e(l).html()),n.vod_remarks=xe(/◎集  数 (.*?)<br>/,e(l).html());let r=xe(/◎主  演 (.*?)<\/p>/s,e(l).html());U.isEmpty(r)&&(r=xe(/◎演  员 (.*?)<\/p>/s,e(l).html()));let i=[];for(let f of r.split(`
2024-05-13 09:18:33 +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=xe(/◎导  演 (.*?)<br>/,e(l).html()),n.vod_content=xe(/◎简  介<\/p>(.*?)<br>/s,e(l).html()).replaceAll("<p>","").replaceAll(`
2024-05-22 10:56:27 +08:00
`,""),U.isEmpty(n.vod_content)&&(n.vod_content=xe(/◎简  介<br>(.*?)<\/p>/s,e(l).html()).replaceAll("<p>","").replaceAll(`
`,""));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(xe(/【(.*?)】/,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=Ve(i);this.vodList=await this.parseVodShortListFromDocByCategory(s)}async setPlay(e,n,l){if(n.indexOf("http")>-1){let r=await this.getHtml(n),i=xe(/url: '(.*?)',/,r.html());if(U.isEmpty(i)){let s=r(r('[class="video"]')[0]).find("iframe")[0].attribs.src,a=await this.fetch(s,null,{"User-Agent":Jl});if(this.playUrl=xe(/url: '(.*?)',/,a),U.isEmpty(this.playUrl)){let u=oq(s);this.playUrl=u+xe(/var main = "(.*?)";/,a)}}else this.playUrl=i}else this.playUrl=n}},Mn=new sT;var aT=class extends Ce{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)}},Va=new aT;async function fQ(t,e){return await Va.init(t,e)}async function dQ(t,e){return await Va.home(t,e)}async function vOe(t,e){return await Va.homeVod(t,e)}async function hQ(t,e){return await Va.category(t,e)}async function mQ(t,e){return await Va.detail(t,e)}async function yQ(t,e){return await Va.play(t,e)}async function gQ(t,e){return await Va.search(t,e)}async function _Oe(t,e){return await Va.proxy(t,e)}var vQ={meta:{key:Mn.getJSName(),name:Mn.getName(),type:Mn.getType()},api:async t=>{t.post("/init",fQ),t.post("/home",dQ),t.post("/category",hQ),t.post("/detail",mQ),t.post("/play",yQ),t.post("/search",gQ),t.get("/proxy/:what/:ids/:end",_Oe)},spider:{init:fQ,home:dQ,homeVod:vOe,category:hQ,detail:mQ,play:yQ,search:gQ}};function Ff(t,e){let n=jf();return Ff=function(l,r){return l=l-424,n[l]},Ff(t,e)}function jf(){let t=["1580630GngmmA","117uvwflw","join","current_id","565448Apkhig","23092JwmytW","707152yowhOv","getElementById","855936CGaczt","length","2966831GCGpvn","611266nfcTEf","value","substring"];return j
2024-05-13 09:18:33 +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 Ue,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-05-22 10:56:27 +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=U.values(r).join("$$$"),e.vod_play_from=U.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=xe(/<script type="text\/javascript" src="(.*?)">/,$.html()),playJsContent=await this.fetch(this.siteUrl+playJsUrl,null,this.getHeader()),playUrlListStr=xe(/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=xe(/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=DQ.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=Ve(Tb(l,"gb2312"));this.vodList=await this.parseVodShortListFromDocBySearch(r)}},qt=new fT;async function xOe(t){await qt.init(t)}async function AOe(t){return await qt.home(t)}async function OOe(){return await qt.homeVod()}async function NOe(t,e,n,l){return await qt.category(t,e,n,l)}async function COe(t){return await qt.detail(t)}async function IOe(t,e,n){return await qt.play(t,e,n)}async function ROe(t,e){return await qt.search(t,e)}function rqe(){return{init:xOe,home:AOe,homeVod:OOe,category:NOe,detail:COe,play:IOe,search:ROe}}var dT=class extends Ce{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)}},Ga=new dT;async function PQ(t,e){return await Ga.init(t,e)}async function LQ(t,e){return await Ga.home(t,e)}async function kOe(t,e){return await Ga.homeVod(t,e)}asyn
2024-05-20 15:50:52 +08:00
"type": "{{tid}}",
"p": "{{pg}}",
"area": "{{ext.area|default(0)}}",
"year": "{{ext.year|default(0)}}",
"sort": "{{ext.sort|default(0)}}",
2024-05-22 10:56:27 +08:00
"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=KQ(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=KQ(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/"+l2(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=E2(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+E2(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:""})}},Vn=new gT;var vT=class extends Ce{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)}},Ka=new vT;async function XQ(t,e){return await Ka.init(t,e)}async function WQ(t,e){return await Ka.home(t,e)}async function UOe(t,e){return await Ka.homeVod(t,e)}async function YQ(t,e){return await Ka.category(t,e)}async function QQ(t,e){return await Ka.detail(t,
2024-05-20 15:50:52 +08:00
2024-05-22 10:56:27 +08:00
`;for(;;){let s=await this.getHtml(this.siteUrl+n);if(i+=g4(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={searchkey:e,searchtype:"all",Submit:""},r=await this.fetch(this.siteUrl+"/search/",l,this.getHeader()),i=Ve(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=E2(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 U.isEmpty(n)?a=await req(s.book_pic,{buffer:2,headers:{Referer:r,"User-Agent":Jl}}):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 _T;var ET=class extends Ce{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)}},Xa=new ET;async function nZ(t,e){return await Xa.init(t,e)}async function lZ(t,e){return await Xa.home(t,e)}async function $Oe(t,e){return await Xa.homeVod(t,e)}async function rZ(t,e){return await Xa.category(t,e)}async function iZ(t,e){return await Xa.detail(t,e)}async function sZ(t,e){return await Xa.play(t,e)}async function aZ(t,e){return await Xa.search(t,e)}async function BOe(t,e){return await Xa.proxy(t,e)}var uZ={meta:{key:qn.getJSName(),name:qn.getName(),type:qn.getType()},api:async t=>{t.post("/init",nZ),t.post("/home",lZ),t.post("/category",rZ),t.post("/detail",iZ),t.post("/play",sZ),t.post("/search",aZ),t.get("/proxy/:what/:ids/:end",BOe)},spider:{init:nZ,home:lZ,homeVod:$Oe,category:rZ,detail:iZ,play:sZ,search:aZ}};var bT=class extends Pe{constructor(){super(),this.siteUrl="http://m.dj0898.com"}getName(){return"\u{1F3B5}\u2503\u4E16\u7EAADJ\u97F3\u4E50\u7F51\u2503\u{1F3B5}"}getAppName(){return"\u4E16\u7EAADJ\u97F3\u4E50\u7F51"}getJSName(){return"dj0898_book_open"}getType(){return 10}async parseVodShortListFromDoc(e){let n=[],l=e("ul.djddv_djList > li");for(let r of l){let i=new Sl,s=e(r).find("a")[1];i.book_id=s.attribs.href,i.book_pic=e(r).find("img:first")[0].attribs.src;let a=e(r).find("strong:first")[0];i.book_name=a.children[0].data,i.book_remarks="\u{1F3B5}"+e(r).find("font")[5].children[0].data||"",n.push(i)}return n}async parseVodShortListFromDocByCategory(e){let n=e("ul.djddv_djList > li"),l=U.map(n,i=>{let s=e(i).find("a")[1],a=e(i).find("img:first")[0],u=e(i).find("strong:first")[0],o=e(i).find("font")[5];return{book_id:s.attribs.href,book_name:u.children[0].data,book_pic:a.attribs.src,book_remarks:"\u{1F3B5}"+o.children[0].data||""}}),r=e("ul.page_link > li > a:contains(\xA0)").length>0;return this.page=r?parseInt(this.page)+1:parseInt(this.page),l}async parseVodShortListFromDocBySearch(e){let n=e("ul.djddv_djList > li");return U.map(n,l=>{let r=e(l).find("a")[1],i=e(l).find("img:first")[0],s=e(l).find("strong:first")[0],a=e(l).find("fo
2024-05-20 15:50:52 +08:00
`).trim(),n=i("a.Readpage_down")[0].attribs.href,n.indexOf("_")<0)break}this.playUrl={content:r+`
2024-05-22 10:56:27 +08:00
`}}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":na,Referer:`${this.siteUrl}/s?q=${encodeURIComponent(e)}`}}),i=(U.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":na,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=E2(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 U.isEmpty(n)?a=await req(s.book_pic,{buffer:2,headers:{Referer:r,"User-Agent":Jl}}):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:""})}},Gn=new ST;var TT=class extends Ce{constructor(){super()}getName(){return Gn.getName()}getAppName(){return Gn.getAppName()}getJSName(){return Gn.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 Gn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Gn.initCookie(e.server.config.biliCookie),await Gn.spiderInit(e),Gn.cfgObj.code=0,Gn.catOpenStatus=!0,Gn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Gn.setClasses(),this.classes=Gn.classes}async setFilterObj(){await Gn.setFilterObj(),this.filterObj=Gn.filterObj}async setHomeVod(){await Gn.setHomeVod(),this.homeVodList=Gn.homeVodList}async setCategory(e,n,l,r){await Gn.setCategory(e,n,l,r),this.vodList=Gn.vodList}async setDetail(e){await Gn.setDetail(e),this.vodDetail=Gn.vodDetail}async setPlay(e,n,l){await Gn.setPlay(e,n,l),this.playUrl=Gn.playUrl,this.result=Gn.result}async setSearch(e,n,l){await Gn.setSearch(e,n,l),this.vodList=Gn.vodList,this.result=Gn.result}async setProxy(e,n){return await Gn.proxy(e,n)}},Ya=new TT;async function yZ(t,e){return await Ya.init(t,e)}async function gZ(t,e){return await Ya.home(t,e)}async function qOe(t,e){return await Ya.homeVod(t,e)}async function vZ(t,e){return await Ya.category(t,e)}async function _Z(t,e){return await Ya.detail(t,e)}async function EZ(t,e){return await Ya.play(t,e)}async function bZ(t,e){return await Ya.search(t,e)}async function zOe(t,e){return await Ya.proxy(t,e)}var wZ={meta:{key:Gn.getJSName(),name:Gn.getName(),type:Gn.getType()},api:async t=>{t.post("/init",yZ),t.post("/home",gZ),t.post("/category",vZ),t.post("/detail",_Z),t.post("/play",EZ),t.post("/search",bZ),t.get("/proxy/:what/:ids/:end",zOe)},spider:{init:yZ,home:gZ,homeVod:qOe,category:vZ,detail:_Z,play:EZ,search:bZ}};function xZ(t){this._parameters={},this._loadParameters(t||{})}xZ.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)},_getStringFromParamete
2024-05-11 09:31:35 +08:00
2024-05-22 10:56:27 +08:00
`;for(;;){let s=await this.getHtml(this.siteUrl+n);if(i+=g4(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=Ve(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-22 10:56:27 +08:00
`),u=[];for(let o of a)U.isEmpty(o.replaceAll(" ",""))||u.push(o.replaceAll(" "," "));i=i+" "+u.join(`
2024-05-11 09:31:35 +08:00
2024-05-22 10:56:27 +08:00
`),this.playUrl={content:i}}},Xn=new RT;var kT=class extends Ce{constructor(){super()}getName(){return Xn.getName()}getAppName(){return Xn.getAppName()}getJSName(){return Xn.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 Xn.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Xn.initCookie(e.server.config.biliCookie),await Xn.spiderInit(e),Xn.cfgObj.code=0,Xn.catOpenStatus=!0,Xn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async setClasses(){await Xn.setClasses(),this.classes=Xn.classes}async setFilterObj(){await Xn.setFilterObj(),this.filterObj=Xn.filterObj}async setHomeVod(){await Xn.setHomeVod(),this.homeVodList=Xn.homeVodList}async setCategory(e,n,l,r){await Xn.setCategory(e,n,l,r),this.vodList=Xn.vodList}async setDetail(e){await Xn.setDetail(e),this.vodDetail=Xn.vodDetail}async setPlay(e,n,l){await Xn.setPlay(e,n,l),this.playUrl=Xn.playUrl,this.result=Xn.result}async setSearch(e,n,l){await Xn.setSearch(e,n,l),this.vodList=Xn.vodList,this.result=Xn.result}async setProxy(e,n){return await Xn.proxy(e,n)}},tu=new kT;async function JZ(t,e){return await tu.init(t,e)}async function KZ(t,e){return await tu.home(t,e)}async function uNe(t,e){return await tu.homeVod(t,e)}async function XZ(t,e){return await tu.category(t,e)}async function WZ(t,e){return await tu.detail(t,e)}async function YZ(t,e){return await tu.play(t,e)}async function QZ(t,e){return await tu.search(t,e)}async function oNe(t,e){return await tu.proxy(t,e)}var ZZ={meta:{key:Xn.getJSName(),name:Xn.getName(),type:Xn.getType()},api:async t=>{t.post("/init",JZ),t.post("/home",KZ),t.post("/category",XZ),t.post("/detail",WZ),t.post("/play",YZ),t.post("/search",QZ),t.get("/proxy/:what/:ids/:end",oNe)},spider:{init:JZ,home:KZ,homeVod:uNe,category:XZ,detail:WZ,play:YZ,search:QZ}};var PT=new da("\u7F51\u76D8","DEBUG"),nu=async function(t,e={}){e.method=="POST"&&e.data&&(e.body=JSON.stringify(e.data),e.headers=Object.assign({"content-type":"application/json"},e.headers));let n=await req(t,e);return n.json=()=>{try{return JSON.parse(n.content)}catch{return{}}},n.text=()=>n.content,n};["get","post"].forEach(t=>{nu[t]=function(e,n={}){return nu(e,Object.assign(n,{method:t.toUpperCase()}))}});var l8={},n8={};async function DT(t){let e=t.indexOf("/",1),n=t.substring(1,e),l=t.substring(e);return{drives:await cNe(n),path:l}}async function cNe(t){let{settings:e,api:n,server:l}=l8[t];if(e.v3==null){e.v3=!1;let r=(await nu.get(l+"/api/public/settings")).content,i=(await nu.get(l+"/api/public/settings")).json().data;Array.isArray(i)?(e.title=i.find(s=>s.key=="title")?.value,e.v3=!1,e.version=i.find(s=>s.key=="version")?.value,e.enableSearch=i.find(s=>s.key=="enable search")?.value=="true"):(e.title=i.title,e.v3=!0,e.version=i.version,e.enableSearch=!1),n.path=e.v3?"/api/fs/list":"/api/public/path",n.file=e.v3?"/api/fs/get":"/api/public/path",n.search=(e.v3,"/api/public/search"),n.other=e.v3?"/api/fs/other":null}return l8[t]}async function eee(t,e){return await PT.info(`\u7F51\u76D8\u521D\u59CB\u5316:${JSON.stringify(t.server.config.alist)}`),t.server.config.alist.forEach(n=>l8[n.name]={name:n.name,server:n.server.endsWith("/")?n.server.substring(0,n.server.length-1):n.server,startPage:n.startPage||"/",showAll:n.showAll??!0,params:n.params||{},_path_param:n.params?Object.keys(n.params).sort(function(l,r){return r.length-l.length}):[],settings:{},api:{},getParams(l){let r=this._path_param.find(i=>l.startsWith(i));return Object.assign({},this.params[r],{path:l})},async getPath(l){let r=(await nu.post(this.server+this.api.path,{data:this.getParams(l)})).json();return this.settings.v3?r.data.content:r.data.files},async getFile(l){let r=(await nu.post(this.server+this.api.file,{data:this.getParams(l)})).json(),i=this.settings.v3?r.data:r.data.files[0];return this.settings.v3||(i.raw_url=i.url),i},async getOther(l,r){let i=this.getParams(r);return i.method=l,(await nu
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 *)
*/