Add smart insights risks, performance, and analyze commands

This commit is contained in:
gitea committed 2026-09-12 23:27:13 +08:00
1 parent 1baeb3722f
commit c929fd002c
11 files changed
+476 -136

No files matched your search

+130 -130
View File
@@ -1,61 +1,61 @@
import{createRequire as VF0}from"node:module";var UF0=Object.create;var{getPrototypeOf:YF0,defineProperty:AF,getOwnPropertyNames:JF0}=Object;var QF0=Object.prototype.hasOwnProperty;function wF0($){return this[$]}var KF0,HF0,vI=($,I,z)=>{var q=$!=null&&typeof $==="object";if(q){var U=I?KF0??=new WeakMap:HF0??=new WeakMap,Y=U.get($);if(Y)return Y}z=$!=null?UF0(YF0($)):{};let J=I||!$||!$.__esModule?AF(z,"default",{value:$,enumerable:!0}):z;for(let Q of JF0($))if(!QF0.call(J,Q))AF(J,Q,{get:wF0.bind($,Q),enumerable:!0});if(q)U.set($,J);return J};var O=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var GF0=($)=>$;function WF0($,I){this[$]=GF0.bind(null,I)}var Y5=($,I)=>{for(var z in I)AF($,z,{get:I[z],enumerable:!0,configurable:!0,set:WF0.bind(I,z)})};var t=VF0(import.meta.url);var aY=O((ln)=>{Object.defineProperty(ln,"__esModule",{value:!0});ln.regexpCode=ln.getEsmExportName=ln.getProperty=ln.safeStringify=ln.stringify=ln.strConcat=ln.addCodeArg=ln.str=ln._=ln.nil=ln._Code=ln.Name=ln.IDENTIFIER=ln._CodeOrName=void 0;class $G{}ln._CodeOrName=$G;ln.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Wz extends $G{constructor($){super();if(!ln.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}ln.Name=Wz;class a$ extends $G{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,z)=>`${I}${z}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,z)=>{if(z instanceof Wz)I[z.str]=(I[z.str]||0)+1;return I},{})}}ln._Code=a$;ln.nil=new a$("");function dn($,...I){let z=[$[0]],q=0;while(q<I.length)yT(z,I[q]),z.push($[++q]);return new a$(z)}ln._=dn;var ST=new a$("+");function mn($,...I){let z=[tY($[0])],q=0;while(q<I.length)z.push(ST),yT(z,I[q]),z.push(ST,tY($[++q]));return SA0(z),new a$(z)}ln.str=mn;function yT($,I){if(I instanceof a$)$.push(...I._items);else if(I instanceof Wz)$.push(I);else $.push(xA0(I))}ln.addCodeArg=yT;function SA0($){let I=1;while(I<$.length-1){if($[I]===ST){let z=yA0($[I-1],$[I+1]);if(z!==void 0){$.splice(I-1,3,z);continue}$[I++]="+"}I++}}function yA0($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof Wz||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof Wz))return`"${$}${I.slice(1)}`;return}function uA0($,I){return I.emptyStr()?$:$.emptyStr()?I:mn`${$}${I}`}ln.strConcat=uA0;function xA0($){return typeof $=="number"||typeof $=="boolean"||$===null?$:tY(Array.isArray($)?$.join(","):$)}function kA0($){return new a$(tY($))}ln.stringify=kA0;function tY($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ln.safeStringify=tY;function fA0($){return typeof $=="string"&&ln.IDENTIFIER.test($)?new a$(`.${$}`):dn`[${$}]`}ln.getProperty=fA0;function nA0($){if(typeof $=="string"&&ln.IDENTIFIER.test($))return new a$(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}ln.getEsmExportName=nA0;function bA0($){return new a$($.toString())}ln.regexpCode=bA0});var fT=O((an)=>{Object.defineProperty(an,"__esModule",{value:!0});an.ValueScope=an.ValueScopeName=an.Scope=an.varKinds=an.UsedValueState=void 0;var d6=aY();class rn extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var zG;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(zG||(an.UsedValueState=zG={}));an.varKinds={const:new d6.Name("const"),let:new d6.Name("let"),var:new d6.Name("var")};class xT{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof d6.Name?$:this.name($)}name($){return new d6.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,z;if(((z=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||z===void 0?void 0:z.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}an.Scope=xT;class kT extends d6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:z}){this.value=$,this.scopePath=d6._`.${new d6.Name(I)}[${z}]`}}an.ValueScopeName=kT;var $P0=d6._`\n`;class tn extends xT{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?$P0:d6.nil}}get(){return this._scope}name($){return new kT($,this._newName($))}value($,I){var z;if(I.ref===void 0)throw Error("CodeGen: ref must be passed in value");let q=this.toName($),{prefix:U}=q,Y=(z=I.key)!==null&&z!==void 0?z:I.ref,J=this._values[U];if(J){let K=J.get(Y);if(Line truncated
`:""},this._extScope=$,this._scope=new s$.Scope({parent:$}),this._nodes=[new Yb]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let z=this._extScope.value($,I);return(this._values[z.prefix]||(this._values[z.prefix]=new Set)).add(z),z}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,z,q){let U=this._scope.toName(I);if(z!==void 0&&q)this._constants[U.str]=z;return this._leafNode(new en($,U,z)),U}const($,I,z){return this._def(s$.varKinds.const,$,I,z)}let($,I,z){return this._def(s$.varKinds.let,$,I,z)}var($,I,z){return this._def(s$.varKinds.var,$,I,z)}assign($,I,z){return this._leafNode(new iT($,I,z))}add($,I){return this._leafNode(new $b($,m6.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==H1.nil)this._leafNode(new Ub($));return this}object(...$){let I=["{"];for(let[z,q]of $){if(I.length>1)I.push(",");if(I.push(z),z!==q||this.opts.es5)I.push(":"),(0,H1.addCodeArg)(I,q)}return I.push("}"),new H1._Code(I)}if($,I,z){if(this._blockNode(new H5($)),I&&z)this.code(I).else().code(z).endIf();else if(I)this.code(I).endIf();else if(z)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new H5($))}else(){return this._elseNode(new sY)}endIf(){return this._endBlockNode(H5,sY)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new Jb($),I)}forRange($,I,z,q,U=this.opts.es5?s$.varKinds.var:s$.varKinds.let){let Y=this._scope.toName($);return this._for(new Qb(U,Y,I,z),()=>q(Y))}forOf($,I,z,q=s$.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let Y=I instanceof H1.Name?I:this.var("_arr",I);return this.forRange("_i",0,H1._`${Y}.length`,(J)=>{this.var(U,H1._`${Y}[${J}]`),z(U)})}return this._for(new nT("of",q,U,I),()=>z(U))}forIn($,I,z,q=this.opts.es5?s$.varKinds.var:s$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,H1._`Object.keys(${I})`,z);let U=this._scope.toName($);return this._for(new nT("in",q,U,I),()=>z(U))}endFor(){return this._endBlockNode(Vz)}label($){return this._leafNode(new Ib($))}break($){return this._leafNode(new zb($))}return($){let I=new UG;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(UG)}try($,I,z){if(!I&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let q=new wb;if(this._blockNode(q),this.code($),I){let U=this.name("e");this._currNode=q.catch=new YG(U),I(U)}if(z)this._currNode=q.finally=new JG,this.code(z);return this._endBlockNode(YG,JG)}throw($){return this._leafNode(new qb($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw Error("CodeGen: not in self-balancing block");let z=this._nodes.length-I;if(z<0||$!==void 0&&z!==$)throw Error(`CodeGen: wrong number of nodes: ${z} vs ${$} expected`);return this._nodes.length=I,this}func($,I=H1.nil,z,q){if(this._blockNode(new qG($,I,z)),q)this.code(q).endFunc();return this}endFunc(){return this._endBlockNode(qG)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let z=this._currNode;if(z instanceof $||I&&z instanceof I)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof H5))throw Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}m6.CodeGen=Kb;function m7($,I){for(let z in I)$[z]=($[z]||0)+(I[z]||0);return $}function QG($,I){return I instanceof H1._CodeOrName?m7($,I.names):$}function Zz($,I,z){if($ instanceof H1.Name)return q($);if(!U($))return $;return new H1._Code($._items.reduce((Y,J)=>{if(J instanceof H1.Name)J=q(J);if(J instanceof H1._Code)Y.push(...J._items);else Y.push(J);return Y},[]));function q(Y){let J=z[Y.str];if(J===void 0||I[Y.str]!==1)return Y;return delete I[Y.str],J}function U(Y){return Y instanceof H1._Code&&Y._items.some((J)=>J instanceof H1.Name&&I[J.str]===1&&z[J.str]!==void 0)}}function UP0($,I){for(let z in I)$[z]=($[z]||0)-(I[z]||0)}function Hb($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:H1._`!${bT($)}`}m6.not=Hb;var YP0=Gb(m6.operators.AND);function JP0(...$){return $.reduce(YP0)}m6.and=JP0;var QP0=Gb(m6.operators.OR);function wP0(...$){return $.reduce(QP0)}m6.or=wP0;function Gb($){return(I,z)=>I===H1.nil?z:z===H1.nil?I:H1._`${bT(I)} ${$} ${bT(z)}`}function bT($){return $ instanceof H1.Name?$:H1._`(${Line truncated
|| (${J} == "string" && ${U} && ${U} == +${U})`).assign(Q,t0._`+${U}`);return;case"integer":q.elseIf(t0._`${J} === "boolean" || ${U} === null
|| (${J} === "string" && ${U} && ${U} == +${U} && !(${U} % 1))`).assign(Q,t0._`+${U}`);return;case"boolean":q.elseIf(t0._`${U} === "false" || ${U} === 0 || ${U} === null`).assign(Q,!1).elseIf(t0._`${U} === "true" || ${U} === 1`).assign(Q,!0);return;case"null":q.elseIf(t0._`${U} === "" || ${U} === 0 || ${U} === false`),q.assign(Q,null);return;case"array":q.elseIf(t0._`${J} === "string" || ${J} === "number"
|| ${J} === "boolean" || ${U} === null`).assign(Q,t0._`[${U}]`)}}}function MT0({gen:$,parentData:I,parentDataProperty:z},q){$.if(t0._`${I} !== undefined`,()=>$.assign(t0._`${I}[${z}]`,q))}function rT($,I,z,q=Xz.Correct){let U=q===Xz.Correct?t0.operators.EQ:t0.operators.NEQ,Y;switch($){case"null":return t0._`${I} ${U} null`;case"array":Y=t0._`Array.isArray(${I})`;break;case"object":Y=t0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Y=J(t0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Y=J();break;default:return t0._`typeof ${I} ${U} ${$}`}return q===Xz.Correct?Y:(0,t0.not)(Y);function J(Q=t0.nil){return(0,t0.and)(t0._`typeof ${I} == "number"`,Q,z?t0._`isFinite(${I})`:t0.nil)}}bb.checkDataType=rT;function tT($,I,z,q){if($.length===1)return rT($[0],I,z,q);let U,Y=(0,kb.toHash)($);if(Y.array&&Y.object){let J=t0._`typeof ${I} != "object"`;U=Y.null?J:t0._`!${I} || ${J}`,delete Y.null,delete Y.array,delete Y.object}else U=t0.nil;if(Y.number)delete Y.integer;for(let J in Y)U=(0,t0.and)(U,rT(J,I,z,q));return U}bb.checkDataTypes=tT;var AT0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?t0._`{type: ${$}}`:t0._`{type: ${I}}`};function aT($){let I=PT0($);(0,LT0.reportError)(I,AT0)}bb.reportTypeError=aT;function PT0($){let{gen:I,data:z,schema:q}=$,U=(0,kb.schemaRefOrVal)($,q,"type");return{gen:I,keyword:"type",data:z,schema:q.type,schemaCode:U,schemaValue:U,parentSchema:q,params:{},it:$}}});var mb=O((cb)=>{Object.defineProperty(cb,"__esModule",{value:!0});cb.assignDefaults=void 0;var Lz=a0(),RT0=X1();function _T0($,I){let{properties:z,items:q}=$.schema;if(I==="object"&&z)for(let U in z)pb($,U,z[U].default);else if(I==="array"&&Array.isArray(q))q.forEach((U,Y)=>pb($,Y,U.default))}cb.assignDefaults=_T0;function pb($,I,z){let{gen:q,compositeRule:U,data:Y,opts:J}=$;if(z===void 0)return;let Q=Lz._`${Y}${(0,Lz.getProperty)(I)}`;if(U){(0,RT0.checkStrictMode)($,`default is ignored for: ${Q}`);return}let w=Lz._`${Q} === undefined`;if(J.useDefaults==="empty")w=Lz._`${w} || ${Q} === null || ${Q} === ""`;q.if(w,Lz._`${Q} = ${(0,Lz.stringify)(z)}`)}});var C$=O((rb)=>{Object.defineProperty(rb,"__esModule",{value:!0});rb.validateUnion=rb.validateArray=rb.usePattern=rb.callValidateCode=rb.schemaProperties=rb.allSchemaProperties=rb.noPropertyInData=rb.propertyInData=rb.isOwnProperty=rb.hasPropFunc=rb.reportMissingProp=rb.checkMissingProp=rb.checkReportMissingProp=void 0;var a1=a0(),sT=X1(),M9=G5(),CT0=X1();function hT0($,I){let{gen:z,data:q,it:U}=$;z.if($E(z,q,I,U.opts.ownProperties),()=>{$.setParams({missingProperty:a1._`${I}`},!0),$.error()})}rb.checkReportMissingProp=hT0;function ST0({gen:$,data:I,it:{opts:z}},q,U){return(0,a1.or)(...q.map((Y)=>(0,a1.and)($E($,I,Y,z.ownProperties),a1._`${U} = ${Y}`)))}rb.checkMissingProp=ST0;function yT0($,I){$.setParams({missingProperty:I},!0),$.error()}rb.reportMissingProp=yT0;function lb($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:a1._`Object.prototype.hasOwnProperty`})}rb.hasPropFunc=lb;function eT($,I,z){return a1._`${lb($)}.call(${I}, ${z})`}rb.isOwnProperty=eT;function uT0($,I,z,q){let U=a1._`${I}${(0,a1.getProperty)(z)} !== undefined`;return q?a1._`${U} && ${eT($,I,z)}`:U}rb.propertyInData=uT0;function $E($,I,z,q){let U=a1._`${I}${(0,a1.getProperty)(z)} === undefined`;return q?(0,a1.or)(U,(0,a1.not)(eT($,I,z))):U}rb.noPropertyInData=$E;function ob($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}rb.allSchemaProperties=ob;function xT0($,I){return ob(I).filter((z)=>!(0,sT.alwaysValidSchema)($,I[z]))}rb.schemaProperties=xT0;function kT0({schemaCode:$,data:I,it:{gen:z,topSchemaRef:q,schemaPath:U,errorPath:Y},it:J},Q,w,K){let H=K?a1._`${$}, ${I}, ${q}${U}`:I,G=[[M9.default.instancePath,(0,a1.strConcat)(M9.default.instancePath,Y)],[M9.default.parentData,J.parentData],[M9.default.parentDataProperty,J.parentDataProperty],[M9.default.rootData,M9.default.rootData]];if(J.opts.dynamicRef)G.push([M9.default.dynamicAnchors,M9.default.dynamicAnchors]);let W=a1._`${H}, ${z.object(...G)}`;return w!==a1.nil?a1._`${Q}.call(${w}, ${W})`:a1._`${Q}(${W})`}rb.callValidateCode=kT0;var fT0=a1._`new RegExp`;function nT0({gen:$,it:{opts:I}},z){let q=I.unicodeRegExp?"u":"",{regExp:U}=I.code,Y=U(z,q);return $.scopeValue("pattern",{key:Y.toString(),ref:Y,code:a1._`${U.code==="new RegExp"?fT0:(0,CT0.useFunc)($,U)}(${z}, ${q})`})}rb.usePattern=nT0;function bT0($){let{gen:I,data:z,keyword:q,it:U}=$,Y=I.name("valid");if(U.allErrors){let Q=I.let("valid",!0);return J(()=>I.assign(Q,!1)),Q}return I.var(Y,!0),J(()=>I.break()),Y;function J(Q){let w=I.const("len",a1._`${z}.length`);I.forRange("i",0,w,(K)=>{$.subschema({keyword:q,dataProp:K,dataPropType:sT.Type.Num},Y),I.if((0,a1.not)(Y),Q)})}}rb.validateArray=bT0;function iT0($){let{gen:I,schema:z,keyword:q,it:U}=$;if(!Array.isArray(z))throw Error("ajv implementation error");if(z.some((w)=>(0,sT.alwaysValidSchema)(U,w))&&!U.opts.unevaluated)return;le Line truncated
import{createRequire as MF0}from"node:module";var WF0=Object.create;var{getPrototypeOf:VF0,defineProperty:PF,getOwnPropertyNames:ZF0}=Object;var XF0=Object.prototype.hasOwnProperty;function LF0($){return this[$]}var DF0,FF0,vI=($,I,z)=>{var q=$!=null&&typeof $==="object";if(q){var U=I?DF0??=new WeakMap:FF0??=new WeakMap,Y=U.get($);if(Y)return Y}z=$!=null?WF0(VF0($)):{};let J=I||!$||!$.__esModule?PF(z,"default",{value:$,enumerable:!0}):z;for(let Q of ZF0($))if(!XF0.call(J,Q))PF(J,Q,{get:LF0.bind($,Q),enumerable:!0});if(q)U.set($,J);return J};var O=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var OF0=($)=>$;function NF0($,I){this[$]=OF0.bind(null,I)}var Y5=($,I)=>{for(var z in I)PF($,z,{get:I[z],enumerable:!0,configurable:!0,set:NF0.bind(I,z)})};var t=MF0(import.meta.url);var aY=O((rn)=>{Object.defineProperty(rn,"__esModule",{value:!0});rn.regexpCode=rn.getEsmExportName=rn.getProperty=rn.safeStringify=rn.stringify=rn.strConcat=rn.addCodeArg=rn.str=rn._=rn.nil=rn._Code=rn.Name=rn.IDENTIFIER=rn._CodeOrName=void 0;class IG{}rn._CodeOrName=IG;rn.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Wz extends IG{constructor($){super();if(!rn.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}rn.Name=Wz;class a$ extends IG{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,z)=>`${I}${z}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,z)=>{if(z instanceof Wz)I[z.str]=(I[z.str]||0)+1;return I},{})}}rn._Code=a$;rn.nil=new a$("");function ln($,...I){let z=[$[0]],q=0;while(q<I.length)uT(z,I[q]),z.push($[++q]);return new a$(z)}rn._=ln;var yT=new a$("+");function on($,...I){let z=[tY($[0])],q=0;while(q<I.length)z.push(yT),uT(z,I[q]),z.push(yT,tY($[++q]));return iA0(z),new a$(z)}rn.str=on;function uT($,I){if(I instanceof a$)$.push(...I._items);else if(I instanceof Wz)$.push(I);else $.push(dA0(I))}rn.addCodeArg=uT;function iA0($){let I=1;while(I<$.length-1){if($[I]===yT){let z=pA0($[I-1],$[I+1]);if(z!==void 0){$.splice(I-1,3,z);continue}$[I++]="+"}I++}}function pA0($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof Wz||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof Wz))return`"${$}${I.slice(1)}`;return}function cA0($,I){return I.emptyStr()?$:$.emptyStr()?I:on`${$}${I}`}rn.strConcat=cA0;function dA0($){return typeof $=="number"||typeof $=="boolean"||$===null?$:tY(Array.isArray($)?$.join(","):$)}function mA0($){return new a$(tY($))}rn.stringify=mA0;function tY($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rn.safeStringify=tY;function lA0($){return typeof $=="string"&&rn.IDENTIFIER.test($)?new a$(`.${$}`):ln`[${$}]`}rn.getProperty=lA0;function oA0($){if(typeof $=="string"&&rn.IDENTIFIER.test($))return new a$(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}rn.getEsmExportName=oA0;function rA0($){return new a$($.toString())}rn.regexpCode=rA0});var nT=O((en)=>{Object.defineProperty(en,"__esModule",{value:!0});en.ValueScope=en.ValueScopeName=en.Scope=en.varKinds=en.UsedValueState=void 0;var d6=aY();class an extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var qG;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(qG||(en.UsedValueState=qG={}));en.varKinds={const:new d6.Name("const"),let:new d6.Name("let"),var:new d6.Name("var")};class kT{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof d6.Name?$:this.name($)}name($){return new d6.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,z;if(((z=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||z===void 0?void 0:z.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}en.Scope=kT;class fT extends d6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:z}){this.value=$,this.scopePath=d6._`.${new d6.Name(I)}[${z}]`}}en.ValueScopeName=fT;var wP0=d6._`\n`;class sn extends kT{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?wP0:d6.nil}}get(){return this._scope}name($){return new fT($,this._newName($))}value($,I){var z;if(I.ref===void 0)throw Error("CodeGen: ref must be passed in value");let q=this.toName($),{prefix:U}=q,Y=(z=I.key)!==null&&z!==void 0?z:I.ref,J=this._values[U];if(J){let K=J.get(Y);if(Line truncated
`:""},this._extScope=$,this._scope=new s$.Scope({parent:$}),this._nodes=[new Qb]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let z=this._extScope.value($,I);return(this._values[z.prefix]||(this._values[z.prefix]=new Set)).add(z),z}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,z,q){let U=this._scope.toName(I);if(z!==void 0&&q)this._constants[U.str]=z;return this._leafNode(new Ib($,U,z)),U}const($,I,z){return this._def(s$.varKinds.const,$,I,z)}let($,I,z){return this._def(s$.varKinds.let,$,I,z)}var($,I,z){return this._def(s$.varKinds.var,$,I,z)}assign($,I,z){return this._leafNode(new pT($,I,z))}add($,I){return this._leafNode(new zb($,m6.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==H1.nil)this._leafNode(new Jb($));return this}object(...$){let I=["{"];for(let[z,q]of $){if(I.length>1)I.push(",");if(I.push(z),z!==q||this.opts.es5)I.push(":"),(0,H1.addCodeArg)(I,q)}return I.push("}"),new H1._Code(I)}if($,I,z){if(this._blockNode(new H5($)),I&&z)this.code(I).else().code(z).endIf();else if(I)this.code(I).endIf();else if(z)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new H5($))}else(){return this._elseNode(new sY)}endIf(){return this._endBlockNode(H5,sY)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new wb($),I)}forRange($,I,z,q,U=this.opts.es5?s$.varKinds.var:s$.varKinds.let){let Y=this._scope.toName($);return this._for(new Kb(U,Y,I,z),()=>q(Y))}forOf($,I,z,q=s$.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let Y=I instanceof H1.Name?I:this.var("_arr",I);return this.forRange("_i",0,H1._`${Y}.length`,(J)=>{this.var(U,H1._`${Y}[${J}]`),z(U)})}return this._for(new bT("of",q,U,I),()=>z(U))}forIn($,I,z,q=this.opts.es5?s$.varKinds.var:s$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,H1._`Object.keys(${I})`,z);let U=this._scope.toName($);return this._for(new bT("in",q,U,I),()=>z(U))}endFor(){return this._endBlockNode(Vz)}label($){return this._leafNode(new qb($))}break($){return this._leafNode(new Ub($))}return($){let I=new YG;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(YG)}try($,I,z){if(!I&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let q=new Hb;if(this._blockNode(q),this.code($),I){let U=this.name("e");this._currNode=q.catch=new JG(U),I(U)}if(z)this._currNode=q.finally=new QG,this.code(z);return this._endBlockNode(JG,QG)}throw($){return this._leafNode(new Yb($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw Error("CodeGen: not in self-balancing block");let z=this._nodes.length-I;if(z<0||$!==void 0&&z!==$)throw Error(`CodeGen: wrong number of nodes: ${z} vs ${$} expected`);return this._nodes.length=I,this}func($,I=H1.nil,z,q){if(this._blockNode(new UG($,I,z)),q)this.code(q).endFunc();return this}endFunc(){return this._endBlockNode(UG)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let z=this._currNode;if(z instanceof $||I&&z instanceof I)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof H5))throw Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}m6.CodeGen=Gb;function m7($,I){for(let z in I)$[z]=($[z]||0)+(I[z]||0);return $}function wG($,I){return I instanceof H1._CodeOrName?m7($,I.names):$}function Zz($,I,z){if($ instanceof H1.Name)return q($);if(!U($))return $;return new H1._Code($._items.reduce((Y,J)=>{if(J instanceof H1.Name)J=q(J);if(J instanceof H1._Code)Y.push(...J._items);else Y.push(J);return Y},[]));function q(Y){let J=z[Y.str];if(J===void 0||I[Y.str]!==1)return Y;return delete I[Y.str],J}function U(Y){return Y instanceof H1._Code&&Y._items.some((J)=>J instanceof H1.Name&&I[J.str]===1&&z[J.str]!==void 0)}}function WP0($,I){for(let z in I)$[z]=($[z]||0)-(I[z]||0)}function Wb($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:H1._`!${iT($)}`}m6.not=Wb;var VP0=Vb(m6.operators.AND);function ZP0(...$){return $.reduce(VP0)}m6.and=ZP0;var XP0=Vb(m6.operators.OR);function LP0(...$){return $.reduce(XP0)}m6.or=LP0;function Vb($){return(I,z)=>I===H1.nil?z:z===H1.nil?I:H1._`${iT(I)} ${$} ${iT(z)}`}function iT($){return $ instanceof H1.Name?$:H1._`(${Line truncated
|| (${J} == "string" && ${U} && ${U} == +${U})`).assign(Q,a0._`+${U}`);return;case"integer":q.elseIf(a0._`${J} === "boolean" || ${U} === null
|| (${J} === "string" && ${U} && ${U} == +${U} && !(${U} % 1))`).assign(Q,a0._`+${U}`);return;case"boolean":q.elseIf(a0._`${U} === "false" || ${U} === 0 || ${U} === null`).assign(Q,!1).elseIf(a0._`${U} === "true" || ${U} === 1`).assign(Q,!0);return;case"null":q.elseIf(a0._`${U} === "" || ${U} === 0 || ${U} === false`),q.assign(Q,null);return;case"array":q.elseIf(a0._`${J} === "string" || ${J} === "number"
|| ${J} === "boolean" || ${U} === null`).assign(Q,a0._`[${U}]`)}}}function gT0({gen:$,parentData:I,parentDataProperty:z},q){$.if(a0._`${I} !== undefined`,()=>$.assign(a0._`${I}[${z}]`,q))}function tT($,I,z,q=Xz.Correct){let U=q===Xz.Correct?a0.operators.EQ:a0.operators.NEQ,Y;switch($){case"null":return a0._`${I} ${U} null`;case"array":Y=a0._`Array.isArray(${I})`;break;case"object":Y=a0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Y=J(a0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Y=J();break;default:return a0._`typeof ${I} ${U} ${$}`}return q===Xz.Correct?Y:(0,a0.not)(Y);function J(Q=a0.nil){return(0,a0.and)(a0._`typeof ${I} == "number"`,Q,z?a0._`isFinite(${I})`:a0.nil)}}pb.checkDataType=tT;function aT($,I,z,q){if($.length===1)return tT($[0],I,z,q);let U,Y=(0,nb.toHash)($);if(Y.array&&Y.object){let J=a0._`typeof ${I} != "object"`;U=Y.null?J:a0._`!${I} || ${J}`,delete Y.null,delete Y.array,delete Y.object}else U=a0.nil;if(Y.number)delete Y.integer;for(let J in Y)U=(0,a0.and)(U,tT(J,I,z,q));return U}pb.checkDataTypes=aT;var RT0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?a0._`{type: ${$}}`:a0._`{type: ${I}}`};function sT($){let I=_T0($);(0,TT0.reportError)(I,RT0)}pb.reportTypeError=sT;function _T0($){let{gen:I,data:z,schema:q}=$,U=(0,nb.schemaRefOrVal)($,q,"type");return{gen:I,keyword:"type",data:z,schema:q.type,schemaCode:U,schemaValue:U,parentSchema:q,params:{},it:$}}});var ob=O((mb)=>{Object.defineProperty(mb,"__esModule",{value:!0});mb.assignDefaults=void 0;var Lz=s0(),kT0=X1();function fT0($,I){let{properties:z,items:q}=$.schema;if(I==="object"&&z)for(let U in z)db($,U,z[U].default);else if(I==="array"&&Array.isArray(q))q.forEach((U,Y)=>db($,Y,U.default))}mb.assignDefaults=fT0;function db($,I,z){let{gen:q,compositeRule:U,data:Y,opts:J}=$;if(z===void 0)return;let Q=Lz._`${Y}${(0,Lz.getProperty)(I)}`;if(U){(0,kT0.checkStrictMode)($,`default is ignored for: ${Q}`);return}let w=Lz._`${Q} === undefined`;if(J.useDefaults==="empty")w=Lz._`${w} || ${Q} === null || ${Q} === ""`;q.if(w,Lz._`${Q} = ${(0,Lz.stringify)(z)}`)}});var C$=O((ab)=>{Object.defineProperty(ab,"__esModule",{value:!0});ab.validateUnion=ab.validateArray=ab.usePattern=ab.callValidateCode=ab.schemaProperties=ab.allSchemaProperties=ab.noPropertyInData=ab.propertyInData=ab.isOwnProperty=ab.hasPropFunc=ab.reportMissingProp=ab.checkMissingProp=ab.checkReportMissingProp=void 0;var a1=s0(),eT=X1(),M9=G5(),nT0=X1();function bT0($,I){let{gen:z,data:q,it:U}=$;z.if(IE(z,q,I,U.opts.ownProperties),()=>{$.setParams({missingProperty:a1._`${I}`},!0),$.error()})}ab.checkReportMissingProp=bT0;function iT0({gen:$,data:I,it:{opts:z}},q,U){return(0,a1.or)(...q.map((Y)=>(0,a1.and)(IE($,I,Y,z.ownProperties),a1._`${U} = ${Y}`)))}ab.checkMissingProp=iT0;function pT0($,I){$.setParams({missingProperty:I},!0),$.error()}ab.reportMissingProp=pT0;function rb($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:a1._`Object.prototype.hasOwnProperty`})}ab.hasPropFunc=rb;function $E($,I,z){return a1._`${rb($)}.call(${I}, ${z})`}ab.isOwnProperty=$E;function cT0($,I,z,q){let U=a1._`${I}${(0,a1.getProperty)(z)} !== undefined`;return q?a1._`${U} && ${$E($,I,z)}`:U}ab.propertyInData=cT0;function IE($,I,z,q){let U=a1._`${I}${(0,a1.getProperty)(z)} === undefined`;return q?(0,a1.or)(U,(0,a1.not)($E($,I,z))):U}ab.noPropertyInData=IE;function tb($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}ab.allSchemaProperties=tb;function dT0($,I){return tb(I).filter((z)=>!(0,eT.alwaysValidSchema)($,I[z]))}ab.schemaProperties=dT0;function mT0({schemaCode:$,data:I,it:{gen:z,topSchemaRef:q,schemaPath:U,errorPath:Y},it:J},Q,w,K){let H=K?a1._`${$}, ${I}, ${q}${U}`:I,G=[[M9.default.instancePath,(0,a1.strConcat)(M9.default.instancePath,Y)],[M9.default.parentData,J.parentData],[M9.default.parentDataProperty,J.parentDataProperty],[M9.default.rootData,M9.default.rootData]];if(J.opts.dynamicRef)G.push([M9.default.dynamicAnchors,M9.default.dynamicAnchors]);let W=a1._`${H}, ${z.object(...G)}`;return w!==a1.nil?a1._`${Q}.call(${w}, ${W})`:a1._`${Q}(${W})`}ab.callValidateCode=mT0;var lT0=a1._`new RegExp`;function oT0({gen:$,it:{opts:I}},z){let q=I.unicodeRegExp?"u":"",{regExp:U}=I.code,Y=U(z,q);return $.scopeValue("pattern",{key:Y.toString(),ref:Y,code:a1._`${U.code==="new RegExp"?lT0:(0,nT0.useFunc)($,U)}(${z}, ${q})`})}ab.usePattern=oT0;function rT0($){let{gen:I,data:z,keyword:q,it:U}=$,Y=I.name("valid");if(U.allErrors){let Q=I.let("valid",!0);return J(()=>I.assign(Q,!1)),Q}return I.var(Y,!0),J(()=>I.break()),Y;function J(Q){let w=I.const("len",a1._`${z}.length`);I.forRange("i",0,w,(K)=>{$.subschema({keyword:q,dataProp:K,dataPropType:eT.Type.Num},Y),I.if((0,a1.not)(Y),Q)})}}ab.validateArray=rT0;function tT0($){let{gen:I,schema:z,keyword:q,it:U}=$;if(!Array.isArray(z))throw Error("ajv implementation error");if(z.some((w)=>(0,eT.alwaysValidSchema)(U,w))&&!U.opts.unevaluated)return;le Line truncated
missingProperty: ${q},
depsCount: ${I},
deps: ${z}}`};var Qg0={keyword:"dependencies",type:"object",schemaType:"object",error:Wc.error,code($){let[I,z]=wg0($);Hc($,I),Gc($,z)}};function wg0({schema:$}){let I={},z={};for(let q in $){if(q==="__proto__")continue;let U=Array.isArray($[q])?I:z;U[q]=$[q]}return[I,z]}function Hc($,I=$.schema){let{gen:z,data:q,it:U}=$;if(Object.keys(I).length===0)return;let Y=z.let("missing");for(let J in I){let Q=I[J];if(Q.length===0)continue;let w=(0,LJ.propertyInData)(z,q,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)z.if(w,()=>{for(let K of Q)(0,LJ.checkReportMissingProp)($,K)});else z.if(PE._`${w} && (${(0,LJ.checkMissingProp)($,Q,Y)})`),(0,LJ.reportMissingProp)($,Y),z.else()}}Wc.validatePropertyDeps=Hc;function Gc($,I=$.schema){let{gen:z,data:q,keyword:U,it:Y}=$,J=z.name("valid");for(let Q in I){if((0,Jg0.alwaysValidSchema)(Y,I[Q]))continue;z.if((0,LJ.propertyInData)(z,q,Q,Y.opts.ownProperties),()=>{let w=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(w,J)},()=>z.var(J,!0)),$.ok(J)}}Wc.validateSchemaDeps=Gc;Wc.default=Qg0});var Fc=O((Dc)=>{Object.defineProperty(Dc,"__esModule",{value:!0});var Lc=a0(),Gg0=X1(),Wg0={message:"property name must be valid",params:({params:$})=>Lc._`{propertyName: ${$.propertyName}}`},Vg0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Wg0,code($){let{gen:I,schema:z,data:q,it:U}=$;if((0,Gg0.alwaysValidSchema)(U,z))return;let Y=I.name("valid");I.forIn("key",q,(J)=>{$.setParams({propertyName:J}),$.subschema({keyword:"propertyNames",data:J,dataTypes:["string"],propertyName:J,compositeRule:!0},Y),I.if((0,Lc.not)(Y),()=>{if($.error(!0),!U.allErrors)I.break()})}),$.ok(Y)}};Dc.default=Vg0});var TE=O((Oc)=>{Object.defineProperty(Oc,"__esModule",{value:!0});var gG=C$(),I8=a0(),Xg0=G5(),RG=X1(),Lg0={message:"must NOT have additional properties",params:({params:$})=>I8._`{additionalProperty: ${$.additionalProperty}}`},Dg0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Lg0,code($){let{gen:I,schema:z,parentSchema:q,data:U,errsCount:Y,it:J}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:Q,opts:w}=J;if(J.props=!0,w.removeAdditional!=="all"&&(0,RG.alwaysValidSchema)(J,z))return;let K=(0,gG.allSchemaProperties)(q.properties),H=(0,gG.allSchemaProperties)(q.patternProperties);G(),$.ok(I8._`${Y} === ${Xg0.default.errors}`);function G(){I.forIn("key",U,(D)=>{if(!K.length&&!H.length)X(D);else I.if(W(D),()=>X(D))})}function W(D){let F;if(K.length>8){let T=(0,RG.schemaRefOrVal)(J,q.properties,"properties");F=(0,gG.isOwnProperty)(I,T,D)}else if(K.length)F=(0,I8.or)(...K.map((T)=>I8._`${D} === ${T}`));else F=I8.nil;if(H.length)F=(0,I8.or)(F,...H.map((T)=>I8._`${(0,gG.usePattern)($,T)}.test(${D})`));return(0,I8.not)(F)}function V(D){I.code(I8._`delete ${U}[${D}]`)}function X(D){if(w.removeAdditional==="all"||w.removeAdditional&&z===!1){V(D);return}if(z===!1){if($.setParams({additionalProperty:D}),$.error(),!Q)I.break();return}if(typeof z=="object"&&!(0,RG.alwaysValidSchema)(J,z)){let F=I.name("valid");if(w.removeAdditional==="failing")L(D,F,!1),I.if((0,I8.not)(F),()=>{$.reset(),V(D)});else if(L(D,F),!Q)I.if((0,I8.not)(F),()=>I.break())}}function L(D,F,T){let P={keyword:"additionalProperties",dataProp:D,dataPropType:RG.Type.Str};if(T===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,F)}}};Oc.default=Dg0});var Pc=O((Ac)=>{Object.defineProperty(Ac,"__esModule",{value:!0});var Og0=UJ(),Nc=C$(),EE=X1(),Mc=TE(),Ng0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,parentSchema:q,data:U,it:Y}=$;if(Y.opts.removeAdditional==="all"&&q.additionalProperties===void 0)Mc.default.code(new Og0.KeywordCxt(Y,Mc.default,"additionalProperties"));let J=(0,Nc.allSchemaProperties)(z);for(let G of J)Y.definedProperties.add(G);if(Y.opts.unevaluated&&J.length&&Y.props!==!0)Y.props=EE.mergeEvaluated.props(I,(0,EE.toHash)(J),Y.props);let Q=J.filter((G)=>!(0,EE.alwaysValidSchema)(Y,z[G]));if(Q.length===0)return;let w=I.name("valid");for(let G of Q){if(K(G))H(G);else{if(I.if((0,Nc.propertyInData)(I,U,G,Y.opts.ownProperties)),H(G),!Y.allErrors)I.else().var(w,!0);I.endIf()}$.it.definedProperties.add(G),$.ok(w)}function K(G){return Y.opts.useDefaults&&!Y.compositeRule&&z[G].default!==void 0}function H(G){$.subschema({keyword:"properties",schemaProp:G,dataProp:G},w)}}};Ac.default=Ng0});var vc=O((jc)=>{Object.defineProperty(jc,"__esModule",{value:!0});var Tc=C$(),_G=a0(),Ec=X1(),Bc=X1(),Ag0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,data:q,parentSchema:U,it:Y}=$,{opts:J}=Y,Q=(0,Tc.allSchemaProperties)(z),w=Q.filter((L)=>(0,Ec.alwaysValidSchema)(Y,z[L]));if(Q.length===0||w.length===Q.length&&(!Y.opts.unevaluated||Y.props===!0))return;let K=J.strictSchema&&!J.allowMatchingProperties&&U.properties,H=I.name("valid");if(Y.props!==!0&&!(Y.props instanceo Line truncated
\x00`,i+=o1(x,2),i+=Q.magic,i+=o1(D,2),i+=o1(F,2),i+=o1(h.crc32,4),i+=o1(h.compressedSize,4),i+=o1(h.uncompressedSize,4),i+=o1(K.length,2),i+=o1(T.length,2);var S=GV.LOCAL_FILE_HEADER+i+K+T,f=GV.CENTRAL_FILE_HEADER+o1(p,2)+i+o1(W.length,2)+"\x00\x00\x00\x00"+o1(g,4)+o1(q,4)+K+T+W;return{fileRecord:S,dirRecord:f}},ek0=function($,I,z,q,U){var Y="",J=zq.transformTo("string",U(q));return Y=GV.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+o1($,2)+o1($,2)+o1(I,4)+o1(z,4)+o1(J.length,2)+J,Y},$f0=function($){var I="";return I=GV.DATA_DESCRIPTOR+o1($.crc32,4)+o1($.compressedSize,4)+o1($.uncompressedSize,4),I};function K8($,I,z,q){qq.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=z,this.encodeFileName=q,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}zq.inherits(K8,qq);K8.prototype.push=function($){var I=$.meta.percent||0,z=this.entriesCount,q=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,qq.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(I+100*(z-q-1))/z:100}})};K8.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var z=Fs($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};K8.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,z=Fs($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),I)this.push({data:$f0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};K8.prototype.flush=function(){var $=this.bytesWritten;for(var I=0;I<this.dirRecords.length;I++)this.push({data:this.dirRecords[I],meta:{percent:100}});var z=this.bytesWritten-$,q=ek0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:q,meta:{percent:100}})};K8.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};K8.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(z){I.processChunk(z)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(z){I.error(z)}),this};K8.prototype.resume=function(){if(!qq.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};K8.prototype.error=function($){var I=this._sources;if(!qq.prototype.error.call(this,$))return!1;for(var z=0;z<I.length;z++)try{I[z].error($)}catch(q){}return!0};K8.prototype.lock=function(){qq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};Os.exports=K8});var Ms=O((Uf0)=>{var If0=Yv(),zf0=Ns(),qf0=function($,I){var z=$||I,q=If0[z];if(!q)throw Error(z+" is not a valid compression method !");return q};Uf0.generateWorker=function($,I,z){var q=new zf0(I.streamFiles,z,I.platform,I.encodeFileName),U=0;try{$.forEach(function(Y,J){U++;var Q=qf0(J.options.compression,I.compression),w=J.options.compressionOptions||I.compressionOptions||{},K=J.dir,H=J.date;J._compressWorker(Q,w).withStreamInfo("file",{name:Y,dir:K,date:H,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(q)}),q.entriesCount=U}catch(Y){q.error(Y)}return q}});var Ps=O((cE1,As)=>{var Jf0=W4(),WV=Z$();function DQ($,I){WV.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Jf0.inherits(DQ,WV);DQ.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(z){I.push({data:z,meta:{percent:0}})}).on("error",function(z){if(I.isPaused)this.generatedError=z;else I.error(z)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};DQ.prototype.pause=function(){if(!WV.prototype.pause.call(this))return!1;return this._stream.pause(),!0};DQ.prototype.resume=function(){if(!WV.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};As.exports=DQ});var hs=O((dE1,Cs)=>{var Qf0=mz(),FQ=W4(),js=Z$(),wf0=Gj(),vs=Wj(),Ts=lW(),Kf0=Et(),Hf0=Ms(),Es=tJ(),Gf0=Ps(),gs=function($,I,z){var q=FQ.getTypeOf(I),U,Y=FQ.extend(z||{},vs);if(Y.date=Y.date||new Date,Y.compression!==null)Y.compression=Y.compression.toUpperCase();if(typeof Y.unixPermissions==="string")Y.unixPermissions=parseInt(Y.unixPermissions,8);if(Y.unixPermissions&&Y.unixPermissions&16384)Y.dir=!0;if(Y.dosPermissions&&Y.dosPermissions&16)Y.dir=!0;if(Y. Line truncated
`)}openNode($,I){let z=this.tos,q=this._xml;if(z&&this.open)q.push(">");this._stack.push($),q.push("<"),q.push($),pv(q,I),this.leaf=!0,this.open=!0}addAttribute($,I){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(I!==void 0)P00(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");pv(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(A00.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),I=this._xml;if(this.leaf)I.push("/>");else I.push("</"),I.push($),I.push(">");this.open=!1,this.leaf=!1}leafNode($,I,z){if(this.openNode($,I),z!==void 0)this.writeText(z);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}cv.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};T00.exports=cv});var dv=O((zi0)=>{var E00=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Ii0($){if(typeof $==="string")return $;if(E00)return E00.decode($);return $.toString()}zi0.bufferToString=Ii0});var R00=O((j00)=>{Object.defineProperty(j00,"__esModule",{value:!0});j00.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;j00.S=` \r
`;j00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";j00.NAME_CHAR="-"+j00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";j00.CHAR_RE=new RegExp("^["+j00.CHAR+"]$","u");j00.S_RE=new RegExp("^["+j00.S+"]+$","u");j00.NAME_START_CHAR_RE=new RegExp("^["+j00.NAME_START_CHAR+"]$","u");j00.NAME_CHAR_RE=new RegExp("^["+j00.NAME_CHAR+"]$","u");j00.NAME_RE=new RegExp("^["+j00.NAME_START_CHAR+"]["+j00.NAME_CHAR+"]*$","u");j00.NMTOKEN_RE=new RegExp("^["+j00.NAME_CHAR+"]+$","u");var mv=9,lv=10,ov=13,rv=32;j00.S_LIST=[rv,lv,ov,mv];function Ui0($){return $>=rv&&$<=55295||$===lv||$===ov||$===mv||$>=57344&&$<=65533||$>=65536&&$<=1114111}j00.isChar=Ui0;function Yi0($){return $===rv||$===lv||$===ov||$===mv}j00.isS=Yi0;function B00($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}j00.isNameStartChar=B00;function Ji0($){return B00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}j00.isNameChar=Ji0});var n00=O((u00)=>{Object.defineProperty(u00,"__esModule",{value:!0});u00.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";u00.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";u00.S=` \r
`;u00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";u00.NAME_CHAR="-"+u00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";u00.CHAR_RE=new RegExp("^["+u00.CHAR+"]$","u");u00.RESTRICTED_CHAR_RE=new RegExp("^["+u00.RESTRICTED_CHAR+"]$","u");u00.S_RE=new RegExp("^["+u00.S+"]+$","u");u00.NAME_START_CHAR_RE=new RegExp("^["+u00.NAME_START_CHAR+"]$","u");u00.NAME_CHAR_RE=new RegExp("^["+u00.NAME_CHAR+"]$","u");u00.NAME_RE=new RegExp("^["+u00.NAME_START_CHAR+"]["+u00.NAME_CHAR+"]*$","u");u00.NMTOKEN_RE=new RegExp("^["+u00.NAME_CHAR+"]+$","u");var _00=9,C00=10,h00=13,S00=32;u00.S_LIST=[S00,C00,h00,_00];function Fi0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}u00.isChar=Fi0;function Oi0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}u00.isRestrictedChar=Oi0;function Ni0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}u00.isCharAndNotRestricted=Ni0;function Mi0($){return $===S00||$===C00||$===h00||$===_00}u00.isS=Mi0;function y00($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}u00.isNameStartChar=y00;function Ai0($){return y00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}u00.isNameChar=Ai0});var p00=O((i00)=>{Object.defineProperty(i00,"__esModule",{value:!0});i00.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";i00.NC_NAME_CHAR="-"+i00.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";i00.NC_NAME_START_CHAR_RE=new RegExp("^["+i00.NC_NAME_START_CHAR+"]$","u");i00.NC_NAME_CHAR_RE=new RegExp("^["+i00.NC_NAME_CHAR+"]$","u");i00.NC_NAME_RE=new RegExp("^["+i00.NC_NAME_START_CHAR+"]["+i00.NC_NAME_CHAR+"]*$","u");function b00($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}i00.isNCNameStartChar=b00;function xi0($){return b00($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}i00.isNCNameChar=xi0});var G10=O((H10)=>{Object.defineProperty(H10,"__esModule",{value:!0});var Zq=R00(),pi0=n00(),Kg=p00(),a6=Zq.isS,ci0=Zq.isChar,_Q=Zq.isNameStartChar,c00=Zq.isNameChar,U10=Zq.S_LIST,di0=Zq.NAME_RE,mi0=pi0.isChar,li0=Kg.isNCNameStartChar,oi0=Kg.isNCNameChar,ri0=Kg.NC_NAME_RE,bV="http://www.w3.org/XML/1998/namespace",Vq="http://www.w3.org/2000/xmlns/",ti0={__proto__:null,xml:bV,xmlns:Vq},ai0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},K4=-1,n8=-2,d00=0,si0=1,av=2,ei0=3,Hq=4,$p0=5,Ip0=6,zp0=7,sv=8,qp0=9,Up0=10,Yp0=11,Jp0=12,S6=13,uV=14,ev=15,Qp0=16,$g=17,wp0=18,Kp0=19,Ig=20,Hp0=21,Gp0=22,Wp0=23,m00=24,zg=25,xV=26,l00=27,Vp0=28,Zp0=29,o00=30,Xp0=31,Lp0=32,O3=33,Dp0=34,qg=35,CQ=36,Ug=37,Fp0=38,r00=39,t00=40,Op0=41,a00=42,Np0=43,Mp0=44,Yg=9,G8=10,Jg=13,s00=32,e00=33,Y10=34,hQ=38,J10=39,kV=45,fV=47,Ap0=59,m9=60,Gq=61,u4=62,U6=63,Q10=91,Wq=93,$10=133,I10=8232,nV=($)=>$===Y10||$===J10,w10=[Y10,J10],Pp0=[...w10,Q10,u4],Tp0=[...w10,m9,Wq],Ep0=[Gq,U6,...U10],Bp0=[...U10,u4,hQ,m9];function wg($,I,z){switch(I){case"xml":if(z!==bV)$.fail(`xml prefix must be bound to ${bV}.`);break;case"xmlns":if(z!==Vq)$.fail(`xmlns prefix must be bound to ${Vq}.`);break;default:}switch(z){case Vq:$.fail(I===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${Vq}.`);break;case bV:switch(I){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function jp0($,I){for(let z of Object.keys(I))wg($,z,I[z])}var vp0=($)=>ri0.test($),gp0=($)=>di0.test($),N3=0,z10=1,Qg=2;H10.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var q10={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class K10{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let I=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,I){this.nameStartCheck=li0,this.nameCheck=oi0,this.isName=vp0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},ti0);let z=this.opt.additionalNamesp Line truncated
deps: ${z}}`};var Xg0={keyword:"dependencies",type:"object",schemaType:"object",error:Zc.error,code($){let[I,z]=Lg0($);Wc($,I),Vc($,z)}};function Lg0({schema:$}){let I={},z={};for(let q in $){if(q==="__proto__")continue;let U=Array.isArray($[q])?I:z;U[q]=$[q]}return[I,z]}function Wc($,I=$.schema){let{gen:z,data:q,it:U}=$;if(Object.keys(I).length===0)return;let Y=z.let("missing");for(let J in I){let Q=I[J];if(Q.length===0)continue;let w=(0,LJ.propertyInData)(z,q,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)z.if(w,()=>{for(let K of Q)(0,LJ.checkReportMissingProp)($,K)});else z.if(TE._`${w} && (${(0,LJ.checkMissingProp)($,Q,Y)})`),(0,LJ.reportMissingProp)($,Y),z.else()}}Zc.validatePropertyDeps=Wc;function Vc($,I=$.schema){let{gen:z,data:q,keyword:U,it:Y}=$,J=z.name("valid");for(let Q in I){if((0,Zg0.alwaysValidSchema)(Y,I[Q]))continue;z.if((0,LJ.propertyInData)(z,q,Q,Y.opts.ownProperties),()=>{let w=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(w,J)},()=>z.var(J,!0)),$.ok(J)}}Zc.validateSchemaDeps=Vc;Zc.default=Xg0});var Nc=O((Oc)=>{Object.defineProperty(Oc,"__esModule",{value:!0});var Fc=s0(),Og0=X1(),Ng0={message:"property name must be valid",params:({params:$})=>Fc._`{propertyName: ${$.propertyName}}`},Mg0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Ng0,code($){let{gen:I,schema:z,data:q,it:U}=$;if((0,Og0.alwaysValidSchema)(U,z))return;let Y=I.name("valid");I.forIn("key",q,(J)=>{$.setParams({propertyName:J}),$.subschema({keyword:"propertyNames",data:J,dataTypes:["string"],propertyName:J,compositeRule:!0},Y),I.if((0,Fc.not)(Y),()=>{if($.error(!0),!U.allErrors)I.break()})}),$.ok(Y)}};Oc.default=Mg0});var EE=O((Mc)=>{Object.defineProperty(Mc,"__esModule",{value:!0});var RG=C$(),I8=s0(),Pg0=G5(),_G=X1(),Tg0={message:"must NOT have additional properties",params:({params:$})=>I8._`{additionalProperty: ${$.additionalProperty}}`},Eg0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Tg0,code($){let{gen:I,schema:z,parentSchema:q,data:U,errsCount:Y,it:J}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:Q,opts:w}=J;if(J.props=!0,w.removeAdditional!=="all"&&(0,_G.alwaysValidSchema)(J,z))return;let K=(0,RG.allSchemaProperties)(q.properties),H=(0,RG.allSchemaProperties)(q.patternProperties);G(),$.ok(I8._`${Y} === ${Pg0.default.errors}`);function G(){I.forIn("key",U,(D)=>{if(!K.length&&!H.length)X(D);else I.if(W(D),()=>X(D))})}function W(D){let F;if(K.length>8){let T=(0,_G.schemaRefOrVal)(J,q.properties,"properties");F=(0,RG.isOwnProperty)(I,T,D)}else if(K.length)F=(0,I8.or)(...K.map((T)=>I8._`${D} === ${T}`));else F=I8.nil;if(H.length)F=(0,I8.or)(F,...H.map((T)=>I8._`${(0,RG.usePattern)($,T)}.test(${D})`));return(0,I8.not)(F)}function V(D){I.code(I8._`delete ${U}[${D}]`)}function X(D){if(w.removeAdditional==="all"||w.removeAdditional&&z===!1){V(D);return}if(z===!1){if($.setParams({additionalProperty:D}),$.error(),!Q)I.break();return}if(typeof z=="object"&&!(0,_G.alwaysValidSchema)(J,z)){let F=I.name("valid");if(w.removeAdditional==="failing")L(D,F,!1),I.if((0,I8.not)(F),()=>{$.reset(),V(D)});else if(L(D,F),!Q)I.if((0,I8.not)(F),()=>I.break())}}function L(D,F,T){let P={keyword:"additionalProperties",dataProp:D,dataPropType:_G.Type.Str};if(T===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,F)}}};Mc.default=Eg0});var Ec=O((Tc)=>{Object.defineProperty(Tc,"__esModule",{value:!0});var jg0=UJ(),Ac=C$(),BE=X1(),Pc=EE(),vg0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,parentSchema:q,data:U,it:Y}=$;if(Y.opts.removeAdditional==="all"&&q.additionalProperties===void 0)Pc.default.code(new jg0.KeywordCxt(Y,Pc.default,"additionalProperties"));let J=(0,Ac.allSchemaProperties)(z);for(let G of J)Y.definedProperties.add(G);if(Y.opts.unevaluated&&J.length&&Y.props!==!0)Y.props=BE.mergeEvaluated.props(I,(0,BE.toHash)(J),Y.props);let Q=J.filter((G)=>!(0,BE.alwaysValidSchema)(Y,z[G]));if(Q.length===0)return;let w=I.name("valid");for(let G of Q){if(K(G))H(G);else{if(I.if((0,Ac.propertyInData)(I,U,G,Y.opts.ownProperties)),H(G),!Y.allErrors)I.else().var(w,!0);I.endIf()}$.it.definedProperties.add(G),$.ok(w)}function K(G){return Y.opts.useDefaults&&!Y.compositeRule&&z[G].default!==void 0}function H(G){$.subschema({keyword:"properties",schemaProp:G,dataProp:G},w)}}};Tc.default=vg0});var Rc=O((gc)=>{Object.defineProperty(gc,"__esModule",{value:!0});var Bc=C$(),CG=s0(),jc=X1(),vc=X1(),Rg0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,data:q,parentSchema:U,it:Y}=$,{opts:J}=Y,Q=(0,Bc.allSchemaProperties)(z),w=Q.filter((L)=>(0,jc.alwaysValidSchema)(Y,z[L]));if(Q.length===0||w.length===Q.length&&(!Y.opts.unevaluated||Y.props===!0))return;let K=J.strictSchema&&!J.allowMatchingProperties&&U.properties,H=I.name("valid");if(Y.props!==!0&&!(Y.props instanceo Line truncated
\x00`,i+=o1(x,2),i+=Q.magic,i+=o1(D,2),i+=o1(F,2),i+=o1(h.crc32,4),i+=o1(h.compressedSize,4),i+=o1(h.uncompressedSize,4),i+=o1(K.length,2),i+=o1(T.length,2);var S=WV.LOCAL_FILE_HEADER+i+K+T,f=WV.CENTRAL_FILE_HEADER+o1(p,2)+i+o1(W.length,2)+"\x00\x00\x00\x00"+o1(g,4)+o1(q,4)+K+T+W;return{fileRecord:S,dirRecord:f}},Qf0=function($,I,z,q,U){var Y="",J=zq.transformTo("string",U(q));return Y=WV.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+o1($,2)+o1($,2)+o1(I,4)+o1(z,4)+o1(J.length,2)+J,Y},wf0=function($){var I="";return I=WV.DATA_DESCRIPTOR+o1($.crc32,4)+o1($.compressedSize,4)+o1($.uncompressedSize,4),I};function K8($,I,z,q){qq.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=z,this.encodeFileName=q,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}zq.inherits(K8,qq);K8.prototype.push=function($){var I=$.meta.percent||0,z=this.entriesCount,q=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,qq.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(I+100*(z-q-1))/z:100}})};K8.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var z=Bs($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};K8.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,z=Bs($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),I)this.push({data:wf0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};K8.prototype.flush=function(){var $=this.bytesWritten;for(var I=0;I<this.dirRecords.length;I++)this.push({data:this.dirRecords[I],meta:{percent:100}});var z=this.bytesWritten-$,q=Qf0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:q,meta:{percent:100}})};K8.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};K8.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(z){I.processChunk(z)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(z){I.error(z)}),this};K8.prototype.resume=function(){if(!qq.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};K8.prototype.error=function($){var I=this._sources;if(!qq.prototype.error.call(this,$))return!1;for(var z=0;z<I.length;z++)try{I[z].error($)}catch(q){}return!0};K8.prototype.lock=function(){qq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};js.exports=K8});var gs=O((Wf0)=>{var Kf0=Qv(),Hf0=vs(),Gf0=function($,I){var z=$||I,q=Kf0[z];if(!q)throw Error(z+" is not a valid compression method !");return q};Wf0.generateWorker=function($,I,z){var q=new Hf0(I.streamFiles,z,I.platform,I.encodeFileName),U=0;try{$.forEach(function(Y,J){U++;var Q=Gf0(J.options.compression,I.compression),w=J.options.compressionOptions||I.compressionOptions||{},K=J.dir,H=J.date;J._compressWorker(Q,w).withStreamInfo("file",{name:Y,dir:K,date:H,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(q)}),q.entriesCount=U}catch(Y){q.error(Y)}return q}});var _s=O(($B1,Rs)=>{var Zf0=W4(),VV=Z$();function FQ($,I){VV.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Zf0.inherits(FQ,VV);FQ.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(z){I.push({data:z,meta:{percent:0}})}).on("error",function(z){if(I.isPaused)this.generatedError=z;else I.error(z)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};FQ.prototype.pause=function(){if(!VV.prototype.pause.call(this))return!1;return this._stream.pause(),!0};FQ.prototype.resume=function(){if(!VV.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};Rs.exports=FQ});var bs=O((IB1,ns)=>{var Xf0=mz(),OQ=W4(),ys=Z$(),Lf0=Vj(),us=Zj(),Cs=oW(),Df0=ht(),Ff0=gs(),hs=aJ(),Of0=_s(),xs=function($,I,z){var q=OQ.getTypeOf(I),U,Y=OQ.extend(z||{},us);if(Y.date=Y.date||new Date,Y.compression!==null)Y.compression=Y.compression.toUpperCase();if(typeof Y.unixPermissions==="string")Y.unixPermissions=parseInt(Y.unixPermissions,8);if(Y.unixPermissions&&Y.unixPermissions&16384)Y.dir=!0;if(Y.dosPermissions&&Y.dosPermissions&16)Y.dir=!0;if(Y. Line truncated
`)}openNode($,I){let z=this.tos,q=this._xml;if(z&&this.open)q.push(">");this._stack.push($),q.push("<"),q.push($),dv(q,I),this.leaf=!0,this.open=!0}addAttribute($,I){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(I!==void 0)_00(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");dv(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(R00.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),I=this._xml;if(this.leaf)I.push("/>");else I.push("</"),I.push($),I.push(">");this.open=!1,this.leaf=!1}leafNode($,I,z){if(this.openNode($,I),z!==void 0)this.writeText(z);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}mv.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};C00.exports=mv});var lv=O((Hi0)=>{var h00=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Ki0($){if(typeof $==="string")return $;if(h00)return h00.decode($);return $.toString()}Hi0.bufferToString=Ki0});var k00=O((y00)=>{Object.defineProperty(y00,"__esModule",{value:!0});y00.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;y00.S=` \r
`;y00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";y00.NAME_CHAR="-"+y00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";y00.CHAR_RE=new RegExp("^["+y00.CHAR+"]$","u");y00.S_RE=new RegExp("^["+y00.S+"]+$","u");y00.NAME_START_CHAR_RE=new RegExp("^["+y00.NAME_START_CHAR+"]$","u");y00.NAME_CHAR_RE=new RegExp("^["+y00.NAME_CHAR+"]$","u");y00.NAME_RE=new RegExp("^["+y00.NAME_START_CHAR+"]["+y00.NAME_CHAR+"]*$","u");y00.NMTOKEN_RE=new RegExp("^["+y00.NAME_CHAR+"]+$","u");var ov=9,rv=10,tv=13,av=32;y00.S_LIST=[av,rv,tv,ov];function Wi0($){return $>=av&&$<=55295||$===rv||$===tv||$===ov||$>=57344&&$<=65533||$>=65536&&$<=1114111}y00.isChar=Wi0;function Vi0($){return $===av||$===rv||$===tv||$===ov}y00.isS=Vi0;function S00($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}y00.isNameStartChar=S00;function Zi0($){return S00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}y00.isNameChar=Zi0});var o00=O((c00)=>{Object.defineProperty(c00,"__esModule",{value:!0});c00.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";c00.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";c00.S=` \r
`;c00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";c00.NAME_CHAR="-"+c00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";c00.CHAR_RE=new RegExp("^["+c00.CHAR+"]$","u");c00.RESTRICTED_CHAR_RE=new RegExp("^["+c00.RESTRICTED_CHAR+"]$","u");c00.S_RE=new RegExp("^["+c00.S+"]+$","u");c00.NAME_START_CHAR_RE=new RegExp("^["+c00.NAME_START_CHAR+"]$","u");c00.NAME_CHAR_RE=new RegExp("^["+c00.NAME_CHAR+"]$","u");c00.NAME_RE=new RegExp("^["+c00.NAME_START_CHAR+"]["+c00.NAME_CHAR+"]*$","u");c00.NMTOKEN_RE=new RegExp("^["+c00.NAME_CHAR+"]+$","u");var f00=9,n00=10,b00=13,i00=32;c00.S_LIST=[i00,n00,b00,f00];function Bi0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}c00.isChar=Bi0;function ji0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}c00.isRestrictedChar=ji0;function vi0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}c00.isCharAndNotRestricted=vi0;function gi0($){return $===i00||$===n00||$===b00||$===f00}c00.isS=gi0;function p00($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}c00.isNameStartChar=p00;function Ri0($){return p00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}c00.isNameChar=Ri0});var a00=O((t00)=>{Object.defineProperty(t00,"__esModule",{value:!0});t00.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";t00.NC_NAME_CHAR="-"+t00.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";t00.NC_NAME_START_CHAR_RE=new RegExp("^["+t00.NC_NAME_START_CHAR+"]$","u");t00.NC_NAME_CHAR_RE=new RegExp("^["+t00.NC_NAME_CHAR+"]$","u");t00.NC_NAME_RE=new RegExp("^["+t00.NC_NAME_START_CHAR+"]["+t00.NC_NAME_CHAR+"]*$","u");function r00($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}t00.isNCNameStartChar=r00;function di0($){return r00($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}t00.isNCNameChar=di0});var O10=O((F10)=>{Object.defineProperty(F10,"__esModule",{value:!0});var Zq=k00(),ai0=o00(),Gg=a00(),a6=Zq.isS,si0=Zq.isChar,CQ=Zq.isNameStartChar,s00=Zq.isNameChar,W10=Zq.S_LIST,ei0=Zq.NAME_RE,$p0=ai0.isChar,Ip0=Gg.isNCNameStartChar,zp0=Gg.isNCNameChar,qp0=Gg.NC_NAME_RE,iV="http://www.w3.org/XML/1998/namespace",Vq="http://www.w3.org/2000/xmlns/",Up0={__proto__:null,xml:iV,xmlns:Vq},Yp0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},K4=-1,n8=-2,e00=0,Jp0=1,ev=2,Qp0=3,Hq=4,wp0=5,Kp0=6,Hp0=7,$g=8,Gp0=9,Wp0=10,Vp0=11,Zp0=12,S6=13,xV=14,Ig=15,Xp0=16,zg=17,Lp0=18,Dp0=19,qg=20,Fp0=21,Op0=22,Np0=23,$10=24,Ug=25,kV=26,I10=27,Mp0=28,Ap0=29,z10=30,Pp0=31,Tp0=32,O3=33,Ep0=34,Yg=35,hQ=36,Jg=37,Bp0=38,q10=39,U10=40,jp0=41,Y10=42,vp0=43,gp0=44,Qg=9,G8=10,wg=13,J10=32,Q10=33,V10=34,SQ=38,Z10=39,fV=45,nV=47,Rp0=59,m9=60,Gq=61,u4=62,U6=63,X10=91,Wq=93,w10=133,K10=8232,bV=($)=>$===V10||$===Z10,L10=[V10,Z10],_p0=[...L10,X10,u4],Cp0=[...L10,m9,Wq],hp0=[Gq,U6,...W10],Sp0=[...W10,u4,SQ,m9];function Hg($,I,z){switch(I){case"xml":if(z!==iV)$.fail(`xml prefix must be bound to ${iV}.`);break;case"xmlns":if(z!==Vq)$.fail(`xmlns prefix must be bound to ${Vq}.`);break;default:}switch(z){case Vq:$.fail(I===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${Vq}.`);break;case iV:switch(I){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function yp0($,I){for(let z of Object.keys(I))Hg($,z,I[z])}var up0=($)=>qp0.test($),xp0=($)=>ei0.test($),N3=0,H10=1,Kg=2;F10.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var G10={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class D10{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let I=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,I){this.nameStartCheck=Ip0,this.nameCheck=zp0,this.isName=up0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Up0);let z=this.opt.additionalNamesp Line truncated
`,I=this.i}}captureToChar($){let{i:I}=this,{chunk:z}=this;while(!0){let q=this.getCode();switch(q){case n8:this.text+=`${z.slice(I,this.prevI)}
`,I=this.i,q=G8;break;case K4:return this.text+=z.slice(I),!1;default:}if(q===$)return this.text+=z.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let z=this.getCode();if(z===K4)return this.name+=$.slice(I),K4;if(!c00(z))return this.name+=$.slice(I,this.prevI),z===n8?G8:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===K4||!a6($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=ci0,this.getCode=this.getCode10;else this.isChar=mi0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=si0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case m9:if(this.state=ev,this.text.length!==0)throw Error("no-empty text at start");break;case K4:break;default:this.unget(),this.state=S6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(Pp0);switch(I){case u4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=S6,this.doctype=!0;break}case K4:break;default:if(this.text+=String.fromCodePoint(I),I===Q10)this.state=Hq;else if(nV(I))this.state=ei0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=av}sDTD(){let $=this.captureTo(Tp0);if($===K4)return;if(this.text+=String.fromCodePoint($),$===Wq)this.state=av;else if($===m9)this.state=Ip0;else if(nV($))this.state=$p0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=Hq,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case e00:this.state=zp0,this.openWakaBang="";break;case U6:this.state=Yp0;break;default:this.state=Hq}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?sv:Hq,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(kV))this.text+="-",this.state=qp0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===kV?Up0:sv}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===u4)this.state=Hq;else this.fail("malformed comment."),this.state=sv}sDTDPI(){if(this.captureToChar(U6))this.text+="?",this.state=Jp0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===u4)this.state=Hq}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case n8:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case Ap0:{let{entityReturnState:z}=this,q=this.entity+I.slice($,this.prevI);this.state=z;let U;if(q==="")this.fail("empty entity name."),U="&;";else U=this.parseEntity(q),this.entity="";if(z!==S6||this.textHandler!==void 0)this.text+=U;break $}case K4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(_Q($))this.state=Dp0,this.unget(),this.xmlDeclPossible=!1;else switch($){case fV:this.state=Np0,this.xmlDeclPossible=!1;break;case e00:this.state=Qp0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case U6:this.state=Wp0;break;default:this.fail("disallowed character in tag name"),this.state=S6,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=Ig,this.openWakaBang="";break;case"--":this.state=$g,this.openWakaBang="";break;case"DOCTYPE":if(this.state=av,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(kV))this.state=wp0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===kV)this.state=Kp0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=$g}sCommentEnded(){let $=this.getCodeNorm();if($!==u4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=$g;else this.state=S6}sCData(){if(this.captureToChar(Wq))this.state=Hp0}sCDataEnding(){let $=this.getCodeNorm();if($===Wq)this.state=Gp0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Ig}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case u4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=S6;break}case Wq:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=Ig}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=m00;else if($===U6||a6($))this.fail("processing instruction without a target."),this.state=$===U6?xV:zg;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=m00}sPIRest(){let{chunk:$,i:I}=this;while(!0){let z=this.getCodeNorm();if(z===K4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(I,this.prevI);let q=z===U6;if(q||a6(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=q?O3:l00}else this.state=q?xV:zg;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===U6)this.state=xV;else if(!a6($))this.text=String.fromCodePoint($)}else if(this.captureToChar(U6))this.state=xV}sPIEnding(){var $;let I=this.getCodeNorm();if(I===u4){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=S6}else if(I===U6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=zg;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===U6){this.state=O3;return}if($!==K4)this.state=Vp0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(Ep0);if($===U6){this.state=O3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(a6($)||$===Gq))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===Gq?o00:Zp0}sXMLDeclEq(){let $=this.getCodeNorm();if($===U6){this.state=O3,this.fail("XML declaration is incomplete.");return}if(a6($))return;if($!==Gq)this.fail("value required.");this.state=o00}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===U6){this.state=O3,this.fail("XML declaration is incomplete.");return}if(a6($))return;if(!nV($))this.fail("value must be quoted."),this.q=s00;else this.q=$;this.state=Xp0}sXMLDeclValue(){let $=this.captureTo([this.q,U6]);if($===U6){this.state=O3,this.text="",this.fail("XML declaration is incomplete.");return}if($===K4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=I;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver Line truncated
`;$=this.i,I=N3;break;case K4:if(q!==void 0)this.text+=z.slice($);break $;default:I=N3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:z}=this,q=!1;$:while(!0){let U=this.getCode();switch(U){case m9:{if(this.state=ev,z!==void 0){let{text:Y}=this,J=I.slice($,this.prevI);if(Y.length!==0)z(Y+J),this.text="";else if(J.length!==0)z(J)}break $}case hQ:if(this.state=uV,this.entityReturnState=S6,z!==void 0)this.text+=I.slice($,this.prevI);q=!0;break $;case n8:if(z!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case K4:if(z!==void 0)this.text+=I.slice($);break $;default:if(!a6(U))q=!0}}if(!q)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,I){var z;let{prefix:q,local:U}=this.qname($),Y={name:$,prefix:q,local:U,value:I};if(this.attribList.push(Y),(z=this.attributeHandler)===null||z===void 0||z.call(this,Y),q==="xmlns"){let J=I.trim();if(this.currentXMLVersion==="1.0"&&J==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[U]=J,wg(this,U,J)}else if($==="xmlns"){let J=I.trim();this.topNS[""]=J,wg(this,"",J)}}pushAttribPlain($,I){var z;let q={name:$,value:I};this.attribList.push(q),(z=this.attributeHandler)===null||z===void 0||z.call(this,q)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let U=z.pop();this.fail(`unclosed tag: ${U.name}`)}if(this.state!==d00&&this.state!==S6)this.fail("unexpected end.");let{text:q}=this;if(q.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,q),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,z;let q=this.topNS[$];if(q!==void 0)return q;let{tags:U}=this;for(let Y=U.length-1;Y>=0;Y--)if(q=U[Y].ns[$],q!==void 0)return q;if(q=this.ns[$],q!==void 0)return q;return(z=(I=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let z=$.slice(I+1),q=$.slice(0,I);if(q===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:q,local:z}}processAttribsNS(){var $;let{attribList:I}=this,z=this.tag;{let{prefix:Y,local:J}=this.qname(z.name);z.prefix=Y,z.local=J;let Q=z.uri=($=this.resolve(Y))!==null&&$!==void 0?$:"";if(Y!==""){if(Y==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(Q==="")this.fail(`unbound namespace prefix: ${JSON.stringify(Y)}.`),z.uri=Y}}if(I.length===0)return;let{attributes:q}=z,U=new Set;for(let Y of I){let{name:J,prefix:Q,local:w}=Y,K,H;if(Q==="")K=J==="xmlns"?Vq:"",H=J;else{if(K=this.resolve(Q),K===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),K=Q;H=`{${K}}${w}`}if(U.has(H))this.fail(`duplicate attribute: ${H}.`);U.add(H),Y.uri=K,q[J]=Y}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:z,value:q}of $){if(I[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);I[z]=q}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),I.push(z),this.state=S6,this.name=""}openSelfClosingTag(){var $,I,z;this.processAttribs();let{tags:q}=this,U=this.tag;if(U.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,U),(I=this.closeTagHandler)===null||I===void 0||I.call(this,U),(this.tag=(z=q[q.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=S6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=S6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,q=$.length;while(q-- >0){let U=this.tag=$.pop();if(this.topNS=U.ns,z===null||z===void 0||z(U),U.name===I)break;this.fail("unexpected close tag.")}if(q===0)this.closedRoot=!0;else if(q<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let I=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))I=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))I=parseInt($.slice(1),10);if(!this.isChar(I))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(I)}}H10.SaxesParser=K10});var SQ=O((vB1,W10)=>{var{SaxesParser:Cp0}=G10(),{PassThrough:hp0}=F6(),{bufferToString:Sp0}=dv();W10.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new hp0);let I=new Cp0,z;I.on("error",(U)=>{z=U});let q=[];I.on("opentag",(U)=>q.push({eventType:"opentag",value:U})),I.on("text",(U)=>q.push({eventType:"text",value:U})),I.on("closetag",(U)=>q.push({eventType:"closetag",value:U}));for await(let U of $){if(I.write(Sp0(U)),z)throw z;yield q,q=[]}}});var D0=O((gB1,V10)=>{var yp0=SQ(),up0=q6();class Xq{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof Xq)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:z,value:q}of I)if(z==="opentag")this.parseOpen(q);else if(z==="text")this.parseText(q);else if(z==="closetag"){if(!this.parseClose(q.name))return thLine truncated
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((I=$.writeHeaders)!==null&&I!==void 0?I:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}p90.FormatterOptions=i90});var NZ=O(($g1,o90)=>{var mr0="[object AsyncFunction]",lr0="[object Function]",or0="[object GeneratorFunction]",rr0="[object Null]",tr0="[object Proxy]",ar0="[object Undefined]",sr0=typeof global=="object"&&global&&global.Object===Object&&global,er0=typeof self=="object"&&self&&self.Object===Object&&self,$t0=sr0||er0||Function("return this")(),m90=Object.prototype,It0=m90.hasOwnProperty,l90=m90.toString,d90=$t0.Symbol,j3=d90?d90.toStringTag:void 0;function zt0($){if($==null)return $===void 0?ar0:rr0;return j3&&j3 in Object($)?qt0($):Ut0($)}function qt0($){var I=It0.call($,j3),z=$[j3];try{$[j3]=void 0;var q=!0}catch(Y){}var U=l90.call($);if(q)if(I)$[j3]=z;else delete $[j3];return U}function Ut0($){return l90.call($)}function Yt0($){if(!Jt0($))return!1;var I=zt0($);return I==lr0||I==or0||I==mr0||I==tr0}function Jt0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}o90.exports=Yt0});var g70=O((MZ,Eq)=>{var Qt0=200,CR="__lodash_hash_undefined__",gZ=1,J70=2,Q70=9007199254740991,AZ="[object Arguments]",ER="[object Array]",wt0="[object AsyncFunction]",w70="[object Boolean]",K70="[object Date]",H70="[object Error]",G70="[object Function]",Kt0="[object GeneratorFunction]",PZ="[object Map]",W70="[object Number]",Ht0="[object Null]",Tq="[object Object]",r90="[object Promise]",Gt0="[object Proxy]",V70="[object RegExp]",TZ="[object Set]",Z70="[object String]",Wt0="[object Symbol]",Vt0="[object Undefined]",BR="[object WeakMap]",X70="[object ArrayBuffer]",EZ="[object DataView]",Zt0="[object Float32Array]",Xt0="[object Float64Array]",Lt0="[object Int8Array]",Dt0="[object Int16Array]",Ft0="[object Int32Array]",Ot0="[object Uint8Array]",Nt0="[object Uint8ClampedArray]",Mt0="[object Uint16Array]",At0="[object Uint32Array]",Pt0=/[\\^$.*+?()[\]{}|]/g,Tt0=/^\[object .+?Constructor\]$/,Et0=/^(?:0|[1-9]\d*)$/,e1={};e1[Zt0]=e1[Xt0]=e1[Lt0]=e1[Dt0]=e1[Ft0]=e1[Ot0]=e1[Nt0]=e1[Mt0]=e1[At0]=!0;e1[AZ]=e1[ER]=e1[X70]=e1[w70]=e1[EZ]=e1[K70]=e1[H70]=e1[G70]=e1[PZ]=e1[W70]=e1[Tq]=e1[V70]=e1[TZ]=e1[Z70]=e1[BR]=!1;var L70=typeof global=="object"&&global&&global.Object===Object&&global,Bt0=typeof self=="object"&&self&&self.Object===Object&&self,g5=L70||Bt0||Function("return this")(),D70=typeof MZ=="object"&&MZ&&!MZ.nodeType&&MZ,t90=D70&&typeof Eq=="object"&&Eq&&!Eq.nodeType&&Eq,F70=t90&&t90.exports===D70,AR=F70&&L70.process,a90=function(){try{return AR&&AR.binding&&AR.binding("util")}catch($){}}(),s90=a90&&a90.isTypedArray;function jt0($,I){var z=-1,q=$==null?0:$.length,U=0,Y=[];while(++z<q){var J=$[z];if(I(J,z,$))Y[U++]=J}return Y}function vt0($,I){var z=-1,q=I.length,U=$.length;while(++z<q)$[U+z]=I[z];return $}function gt0($,I){var z=-1,q=$==null?0:$.length;while(++z<q)if(I($[z],z,$))return!0;return!1}function Rt0($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}function _t0($){return function(I){return $(I)}}function Ct0($,I){return $.has(I)}function ht0($,I){return $==null?void 0:$[I]}function St0($){var I=-1,z=Array($.size);return $.forEach(function(q,U){z[++I]=[U,q]}),z}function yt0($,I){return function(z){return $(I(z))}}function ut0($){var I=-1,z=Array($.size);return $.forEach(function(q){z[++I]=q}),z}var xt0=Array.prototype,kt0=Function.prototype,RZ=Object.prototype,PR=g5["__core-js_shared__"],O70=kt0.toString,i8=RZ.hasOwnProperty,e90=function(){var $=/[^.]+$/.exec(PR&&PR.keys&&PR.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),N70=RZ.toString,ft0=RegExp("^"+O70.call(i8).replace(Pt0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$70=F70?g5.Buffer:void 0,BZ=g5.Symbol,I70=g5.Uint8Array,M70=RZ.propertyIsEnumerable,nt0=xt0.splice,v3=BZ?BZ.toStringTag:void 0,z70=Object.getOwnPropertySymbols,bt0=$70?$70.isBuffer:void 0,it0=yt0(Object.keys,Object),jR=Bq(g5,"DataView"),bQ=Bq(g5,"Map"),vR=Bq(g5,"Promise"),gR=Bq(g5,"Set"),RR=Bq(g5,"WeakMap"),iQ=Bq(Object,"create"),pt0=_3(jR),ct0=_3(bQ),dt0=_3(vR),mt0=_3(gR),lt0=_3(RR),q70=BZ?BZ.prototype:void 0,TR=q70?q70.valueOf:void 0;function g3($){var I=-1,z=$==null?0:$.length;this.clear();while(++I<z){var q=$[I];this.set(q[0],q[1])}}function ot0(){this.__data__=iQ?iQ(null):{},this.size=0}function rt0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function tt0($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let z=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(zs0.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,I,z){let q=`${qs0.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:U}=this;if(U.quote!==""){if(q.indexOf(U.quote)!==-1)return this.quoteField(q.replace(this.REPLACE_REGEXP,U.escapedQuote))}if(q.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,z))return this.quoteField(q);return q}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}jq.FieldFormatter=k70});var xR=O((f70)=>{Object.defineProperty(f70,"__esModule",{value:!0});f70.isSyncTransform=void 0;f70.isSyncTransform=($)=>$.length===1});var i70=O((vq)=>{var b70=vq&&vq.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(vq,"__esModule",{value:!0});vq.RowFormatter=void 0;var Ys0=b70(NZ()),Js0=b70(g70()),Qs0=uR(),ws0=xR();class C3{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new Qs0.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(C3.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(ws0.isSyncTransform($))return(I,z)=>{let q=null;try{q=$(I)}catch(U){return z(U)}return z(null,q)};return(I,z)=>{$(I,z)}}set rowTransform($){if(!Ys0.default($))throw TypeError("The transform should be a function");this._rowTransform=C3.createTransform($)}format($,I){this.callTransformer($,(z,q)=>{if(z)return I(z);if(!$)return I(null);let U=[];if(q){let{shouldFormatColumns:Y,headers:J}=this.checkHeaders(q);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)U.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Y){let Q=this.gatherColumns(q);U.push(this.formatColumns(Q,!1))}}return I(null,U)})}finish($){let I=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));I.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)I.push(this.formatterOptions.rowDelimiter);return $(null,I)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let I=C3.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!Js0.default(I,$),headers:I}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((I)=>$[I]);if(C3.isRowHashArray($))return this.headers.map((I,z)=>{let q=$[z];if(q)return q[1];return""});if(C3.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,z)=>$[z])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let z=$.map((U,Y)=>this.fieldFormatter.format(U,Y,I)).join(this.formatterOptions.delimiter),{rowCount:q}=this;if(this.rowCount+=1,q)return[this.formatterOptions.rowDelimiter,z].join("");return z}}vq.RowFormatter=C3});var p70=O((hZ)=>{Object.defineProperty(hZ,"__esModule",{value:!0});hZ.FieldFormatter=hZ.RowFormatter=void 0;var Ks0=i70();Object.defineProperty(hZ,"RowFormatter",{enumerable:!0,get:function(){return Ks0.RowFormatter}});var Hs0=uR();Object.defineProperty(hZ,"FieldFormatter",{enumerable:!0,get:function(){return Hs0.FieldFormatter}})});var kR=O((d70)=>{Object.defineProperty(d70,"__esModule",{value:!0});d70.CsvFormatterStream=void 0;var Ws0=t("stream"),Vs0=p70();class c70 extends Ws0.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new Vs0.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,z){let q=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(U,Y)=>{if(U)return q=!0,z(U);if(Y)Y.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return q=!0,z()})}catch(U){if(q)throw U;z(U)}}_flush($){this.rowFormatter.finish((I,z)=>{if(I)return $(I);if(z)z.forEach((q)=>{this.push(Buffer.from(q,"utf8"))});return $()})}}d70.CsvFormatterStream=c70});var o70=O((E1)=>{var l70=E1&&E1.__createBinding||(Object.create?function($,I,z,q){if(q===void 0)q=z;Object.defineProperty($,q,{enumerable:!0,get:function(){return I[z]}})}:function($,I,z,q){if(q===void 0)q=z;$[q]=I[z]}),Zs0=E1&&E1.__setModuleDefault||(Object.create?function($,I){Ob Line truncated
`,I=this.i,q=G8;break;case K4:return this.text+=z.slice(I),!1;default:}if(q===$)return this.text+=z.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let z=this.getCode();if(z===K4)return this.name+=$.slice(I),K4;if(!s00(z))return this.name+=$.slice(I,this.prevI),z===n8?G8:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===K4||!a6($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=si0,this.getCode=this.getCode10;else this.isChar=$p0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Jp0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case m9:if(this.state=Ig,this.text.length!==0)throw Error("no-empty text at start");break;case K4:break;default:this.unget(),this.state=S6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(_p0);switch(I){case u4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=S6,this.doctype=!0;break}case K4:break;default:if(this.text+=String.fromCodePoint(I),I===X10)this.state=Hq;else if(bV(I))this.state=Qp0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=ev}sDTD(){let $=this.captureTo(Cp0);if($===K4)return;if(this.text+=String.fromCodePoint($),$===Wq)this.state=ev;else if($===m9)this.state=Kp0;else if(bV($))this.state=wp0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=Hq,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case Q10:this.state=Hp0,this.openWakaBang="";break;case U6:this.state=Vp0;break;default:this.state=Hq}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?$g:Hq,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(fV))this.text+="-",this.state=Gp0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===fV?Wp0:$g}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===u4)this.state=Hq;else this.fail("malformed comment."),this.state=$g}sDTDPI(){if(this.captureToChar(U6))this.text+="?",this.state=Zp0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===u4)this.state=Hq}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case n8:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case Rp0:{let{entityReturnState:z}=this,q=this.entity+I.slice($,this.prevI);this.state=z;let U;if(q==="")this.fail("empty entity name."),U="&;";else U=this.parseEntity(q),this.entity="";if(z!==S6||this.textHandler!==void 0)this.text+=U;break $}case K4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(CQ($))this.state=Ep0,this.unget(),this.xmlDeclPossible=!1;else switch($){case nV:this.state=vp0,this.xmlDeclPossible=!1;break;case Q10:this.state=Xp0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case U6:this.state=Np0;break;default:this.fail("disallowed character in tag name"),this.state=S6,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=qg,this.openWakaBang="";break;case"--":this.state=zg,this.openWakaBang="";break;case"DOCTYPE":if(this.state=ev,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(fV))this.state=Lp0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===fV)this.state=Dp0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=zg}sCommentEnded(){let $=this.getCodeNorm();if($!==u4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=zg;else this.state=S6}sCData(){if(this.captureToChar(Wq))this.state=Fp0}sCDataEnding(){let $=this.getCodeNorm();if($===Wq)this.state=Op0;else this.text+=`]${String.fromCodePoint($)}`,this.state=qg}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case u4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=S6;break}case Wq:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=qg}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=$10;else if($===U6||a6($))this.fail("processing instruction without a target."),this.state=$===U6?kV:Ug;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=$10}sPIRest(){let{chunk:$,i:I}=this;while(!0){let z=this.getCodeNorm();if(z===K4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(I,this.prevI);let q=z===U6;if(q||a6(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=q?O3:I10}else this.state=q?kV:Ug;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===U6)this.state=kV;else if(!a6($))this.text=String.fromCodePoint($)}else if(this.captureToChar(U6))this.state=kV}sPIEnding(){var $;let I=this.getCodeNorm();if(I===u4){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=S6}else if(I===U6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=Ug;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===U6){this.state=O3;return}if($!==K4)this.state=Mp0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(hp0);if($===U6){this.state=O3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(a6($)||$===Gq))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===Gq?z10:Ap0}sXMLDeclEq(){let $=this.getCodeNorm();if($===U6){this.state=O3,this.fail("XML declaration is incomplete.");return}if(a6($))return;if($!==Gq)this.fail("value required.");this.state=z10}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===U6){this.state=O3,this.fail("XML declaration is incomplete.");return}if(a6($))return;if(!bV($))this.fail("value must be quoted."),this.q=J10;else this.q=$;this.state=Pp0}sXMLDeclValue(){let $=this.captureTo([this.q,U6]);if($===U6){this.state=O3,this.text="",this.fail("XML declaration is incomplete.");return}if($===K4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=I;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver Line truncated
`;$=this.i,I=N3;break;case K4:if(q!==void 0)this.text+=z.slice($);break $;default:I=N3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:z}=this,q=!1;$:while(!0){let U=this.getCode();switch(U){case m9:{if(this.state=Ig,z!==void 0){let{text:Y}=this,J=I.slice($,this.prevI);if(Y.length!==0)z(Y+J),this.text="";else if(J.length!==0)z(J)}break $}case SQ:if(this.state=xV,this.entityReturnState=S6,z!==void 0)this.text+=I.slice($,this.prevI);q=!0;break $;case n8:if(z!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case K4:if(z!==void 0)this.text+=I.slice($);break $;default:if(!a6(U))q=!0}}if(!q)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,I){var z;let{prefix:q,local:U}=this.qname($),Y={name:$,prefix:q,local:U,value:I};if(this.attribList.push(Y),(z=this.attributeHandler)===null||z===void 0||z.call(this,Y),q==="xmlns"){let J=I.trim();if(this.currentXMLVersion==="1.0"&&J==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[U]=J,Hg(this,U,J)}else if($==="xmlns"){let J=I.trim();this.topNS[""]=J,Hg(this,"",J)}}pushAttribPlain($,I){var z;let q={name:$,value:I};this.attribList.push(q),(z=this.attributeHandler)===null||z===void 0||z.call(this,q)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let U=z.pop();this.fail(`unclosed tag: ${U.name}`)}if(this.state!==e00&&this.state!==S6)this.fail("unexpected end.");let{text:q}=this;if(q.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,q),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,z;let q=this.topNS[$];if(q!==void 0)return q;let{tags:U}=this;for(let Y=U.length-1;Y>=0;Y--)if(q=U[Y].ns[$],q!==void 0)return q;if(q=this.ns[$],q!==void 0)return q;return(z=(I=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let z=$.slice(I+1),q=$.slice(0,I);if(q===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:q,local:z}}processAttribsNS(){var $;let{attribList:I}=this,z=this.tag;{let{prefix:Y,local:J}=this.qname(z.name);z.prefix=Y,z.local=J;let Q=z.uri=($=this.resolve(Y))!==null&&$!==void 0?$:"";if(Y!==""){if(Y==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(Q==="")this.fail(`unbound namespace prefix: ${JSON.stringify(Y)}.`),z.uri=Y}}if(I.length===0)return;let{attributes:q}=z,U=new Set;for(let Y of I){let{name:J,prefix:Q,local:w}=Y,K,H;if(Q==="")K=J==="xmlns"?Vq:"",H=J;else{if(K=this.resolve(Q),K===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),K=Q;H=`{${K}}${w}`}if(U.has(H))this.fail(`duplicate attribute: ${H}.`);U.add(H),Y.uri=K,q[J]=Y}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:z,value:q}of $){if(I[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);I[z]=q}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),I.push(z),this.state=S6,this.name=""}openSelfClosingTag(){var $,I,z;this.processAttribs();let{tags:q}=this,U=this.tag;if(U.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,U),(I=this.closeTagHandler)===null||I===void 0||I.call(this,U),(this.tag=(z=q[q.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=S6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=S6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,q=$.length;while(q-- >0){let U=this.tag=$.pop();if(this.topNS=U.ns,z===null||z===void 0||z(U),U.name===I)break;this.fail("unexpected close tag.")}if(q===0)this.closedRoot=!0;else if(q<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let I=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))I=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))I=parseInt($.slice(1),10);if(!this.isChar(I))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(I)}}F10.SaxesParser=D10});var yQ=O((kB1,N10)=>{var{SaxesParser:np0}=O10(),{PassThrough:bp0}=F6(),{bufferToString:ip0}=lv();N10.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new bp0);let I=new np0,z;I.on("error",(U)=>{z=U});let q=[];I.on("opentag",(U)=>q.push({eventType:"opentag",value:U})),I.on("text",(U)=>q.push({eventType:"text",value:U})),I.on("closetag",(U)=>q.push({eventType:"closetag",value:U}));for await(let U of $){if(I.write(ip0(U)),z)throw z;yield q,q=[]}}});var D0=O((fB1,M10)=>{var pp0=yQ(),cp0=q6();class Xq{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof Xq)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:z,value:q}of I)if(z==="opentag")this.parseOpen(q);else if(z==="text")this.parseText(q);else if(z==="closetag"){if(!this.parseClose(q.name))return thLine truncated
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((I=$.writeHeaders)!==null&&I!==void 0?I:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}a90.FormatterOptions=t90});var MZ=O((Hg1,z70)=>{var $t0="[object AsyncFunction]",It0="[object Function]",zt0="[object GeneratorFunction]",qt0="[object Null]",Ut0="[object Proxy]",Yt0="[object Undefined]",Jt0=typeof global=="object"&&global&&global.Object===Object&&global,Qt0=typeof self=="object"&&self&&self.Object===Object&&self,wt0=Jt0||Qt0||Function("return this")(),$70=Object.prototype,Kt0=$70.hasOwnProperty,I70=$70.toString,e90=wt0.Symbol,j3=e90?e90.toStringTag:void 0;function Ht0($){if($==null)return $===void 0?Yt0:qt0;return j3&&j3 in Object($)?Gt0($):Wt0($)}function Gt0($){var I=Kt0.call($,j3),z=$[j3];try{$[j3]=void 0;var q=!0}catch(Y){}var U=I70.call($);if(q)if(I)$[j3]=z;else delete $[j3];return U}function Wt0($){return I70.call($)}function Vt0($){if(!Zt0($))return!1;var I=Ht0($);return I==It0||I==zt0||I==$t0||I==Ut0}function Zt0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}z70.exports=Vt0});var x70=O((AZ,Eq)=>{var Xt0=200,SR="__lodash_hash_undefined__",RZ=1,Z70=2,X70=9007199254740991,PZ="[object Arguments]",jR="[object Array]",Lt0="[object AsyncFunction]",L70="[object Boolean]",D70="[object Date]",F70="[object Error]",O70="[object Function]",Dt0="[object GeneratorFunction]",TZ="[object Map]",N70="[object Number]",Ft0="[object Null]",Tq="[object Object]",q70="[object Promise]",Ot0="[object Proxy]",M70="[object RegExp]",EZ="[object Set]",A70="[object String]",Nt0="[object Symbol]",Mt0="[object Undefined]",vR="[object WeakMap]",P70="[object ArrayBuffer]",BZ="[object DataView]",At0="[object Float32Array]",Pt0="[object Float64Array]",Tt0="[object Int8Array]",Et0="[object Int16Array]",Bt0="[object Int32Array]",jt0="[object Uint8Array]",vt0="[object Uint8ClampedArray]",gt0="[object Uint16Array]",Rt0="[object Uint32Array]",_t0=/[\\^$.*+?()[\]{}|]/g,Ct0=/^\[object .+?Constructor\]$/,ht0=/^(?:0|[1-9]\d*)$/,e1={};e1[At0]=e1[Pt0]=e1[Tt0]=e1[Et0]=e1[Bt0]=e1[jt0]=e1[vt0]=e1[gt0]=e1[Rt0]=!0;e1[PZ]=e1[jR]=e1[P70]=e1[L70]=e1[BZ]=e1[D70]=e1[F70]=e1[O70]=e1[TZ]=e1[N70]=e1[Tq]=e1[M70]=e1[EZ]=e1[A70]=e1[vR]=!1;var T70=typeof global=="object"&&global&&global.Object===Object&&global,St0=typeof self=="object"&&self&&self.Object===Object&&self,g5=T70||St0||Function("return this")(),E70=typeof AZ=="object"&&AZ&&!AZ.nodeType&&AZ,U70=E70&&typeof Eq=="object"&&Eq&&!Eq.nodeType&&Eq,B70=U70&&U70.exports===E70,TR=B70&&T70.process,Y70=function(){try{return TR&&TR.binding&&TR.binding("util")}catch($){}}(),J70=Y70&&Y70.isTypedArray;function yt0($,I){var z=-1,q=$==null?0:$.length,U=0,Y=[];while(++z<q){var J=$[z];if(I(J,z,$))Y[U++]=J}return Y}function ut0($,I){var z=-1,q=I.length,U=$.length;while(++z<q)$[U+z]=I[z];return $}function xt0($,I){var z=-1,q=$==null?0:$.length;while(++z<q)if(I($[z],z,$))return!0;return!1}function kt0($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}function ft0($){return function(I){return $(I)}}function nt0($,I){return $.has(I)}function bt0($,I){return $==null?void 0:$[I]}function it0($){var I=-1,z=Array($.size);return $.forEach(function(q,U){z[++I]=[U,q]}),z}function pt0($,I){return function(z){return $(I(z))}}function ct0($){var I=-1,z=Array($.size);return $.forEach(function(q){z[++I]=q}),z}var dt0=Array.prototype,mt0=Function.prototype,_Z=Object.prototype,ER=g5["__core-js_shared__"],j70=mt0.toString,i8=_Z.hasOwnProperty,Q70=function(){var $=/[^.]+$/.exec(ER&&ER.keys&&ER.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),v70=_Z.toString,lt0=RegExp("^"+j70.call(i8).replace(_t0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w70=B70?g5.Buffer:void 0,jZ=g5.Symbol,K70=g5.Uint8Array,g70=_Z.propertyIsEnumerable,ot0=dt0.splice,v3=jZ?jZ.toStringTag:void 0,H70=Object.getOwnPropertySymbols,rt0=w70?w70.isBuffer:void 0,tt0=pt0(Object.keys,Object),gR=Bq(g5,"DataView"),iQ=Bq(g5,"Map"),RR=Bq(g5,"Promise"),_R=Bq(g5,"Set"),CR=Bq(g5,"WeakMap"),pQ=Bq(Object,"create"),at0=_3(gR),st0=_3(iQ),et0=_3(RR),$a0=_3(_R),Ia0=_3(CR),G70=jZ?jZ.prototype:void 0,BR=G70?G70.valueOf:void 0;function g3($){var I=-1,z=$==null?0:$.length;this.clear();while(++I<z){var q=$[I];this.set(q[0],q[1])}}function za0(){this.__data__=pQ?pQ(null):{},this.size=0}function qa0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function Ua0($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let z=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(Hs0.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,I,z){let q=`${Gs0.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:U}=this;if(U.quote!==""){if(q.indexOf(U.quote)!==-1)return this.quoteField(q.replace(this.REPLACE_REGEXP,U.escapedQuote))}if(q.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,z))return this.quoteField(q);return q}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}jq.FieldFormatter=m70});var fR=O((l70)=>{Object.defineProperty(l70,"__esModule",{value:!0});l70.isSyncTransform=void 0;l70.isSyncTransform=($)=>$.length===1});var t70=O((vq)=>{var r70=vq&&vq.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(vq,"__esModule",{value:!0});vq.RowFormatter=void 0;var Vs0=r70(MZ()),Zs0=r70(x70()),Xs0=kR(),Ls0=fR();class C3{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new Xs0.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(C3.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(Ls0.isSyncTransform($))return(I,z)=>{let q=null;try{q=$(I)}catch(U){return z(U)}return z(null,q)};return(I,z)=>{$(I,z)}}set rowTransform($){if(!Vs0.default($))throw TypeError("The transform should be a function");this._rowTransform=C3.createTransform($)}format($,I){this.callTransformer($,(z,q)=>{if(z)return I(z);if(!$)return I(null);let U=[];if(q){let{shouldFormatColumns:Y,headers:J}=this.checkHeaders(q);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)U.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Y){let Q=this.gatherColumns(q);U.push(this.formatColumns(Q,!1))}}return I(null,U)})}finish($){let I=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));I.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)I.push(this.formatterOptions.rowDelimiter);return $(null,I)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let I=C3.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!Zs0.default(I,$),headers:I}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((I)=>$[I]);if(C3.isRowHashArray($))return this.headers.map((I,z)=>{let q=$[z];if(q)return q[1];return""});if(C3.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,z)=>$[z])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let z=$.map((U,Y)=>this.fieldFormatter.format(U,Y,I)).join(this.formatterOptions.delimiter),{rowCount:q}=this;if(this.rowCount+=1,q)return[this.formatterOptions.rowDelimiter,z].join("");return z}}vq.RowFormatter=C3});var a70=O((SZ)=>{Object.defineProperty(SZ,"__esModule",{value:!0});SZ.FieldFormatter=SZ.RowFormatter=void 0;var Ds0=t70();Object.defineProperty(SZ,"RowFormatter",{enumerable:!0,get:function(){return Ds0.RowFormatter}});var Fs0=kR();Object.defineProperty(SZ,"FieldFormatter",{enumerable:!0,get:function(){return Fs0.FieldFormatter}})});var nR=O((e70)=>{Object.defineProperty(e70,"__esModule",{value:!0});e70.CsvFormatterStream=void 0;var Ns0=t("stream"),Ms0=a70();class s70 extends Ns0.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new Ms0.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,z){let q=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(U,Y)=>{if(U)return q=!0,z(U);if(Y)Y.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return q=!0,z()})}catch(U){if(q)throw U;z(U)}}_flush($){this.rowFormatter.finish((I,z)=>{if(I)return $(I);if(z)z.forEach((q)=>{this.push(Buffer.from(q,"utf8"))});return $()})}}e70.CsvFormatterStream=s70});var z30=O((E1)=>{var I30=E1&&E1.__createBinding||(Object.create?function($,I,z,q){if(q===void 0)q=z;Object.defineProperty($,q,{enumerable:!0,get:function(){return I[z]}})}:function($,I,z,q){if(q===void 0)q=z;$[q]=I[z]}),As0=E1&&E1.__setModuleDefault||(Object.create?function($,I){Ob Line truncated
`||I===`\r
`}static isTokenCarriageReturn($,I){return $.token===I.carriageReturn}static isTokenComment($,I){return I.supportsComments&&!!$&&$.token===I.comment}static isTokenEscapeCharacter($,I){return $.token===I.escapeChar}static isTokenQuote($,I){return $.token===I.quote}static isTokenDelimiter($,I){return $.token===I.delimiter}}r30.Token=o30});var w_=O((e30)=>{Object.defineProperty(e30,"__esModule",{value:!0});e30.Scanner=void 0;var a30=q7(),A11=/((?:\r\n)|\n|\r)/;class s30{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,I=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(I)===-1)return null;let z=I.exec($);if(z==null)return null;let q=z[1],U=this.cursor+(z.index||0);return new a30.Token({token:q,startCursor:U,endCursor:U+q.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new a30.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=A11.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}e30.Scanner=s30});var zX=O((zI0)=>{Object.defineProperty(zI0,"__esModule",{value:!0});zI0.ColumnFormatter=void 0;class II0{constructor($){if($.trim)this.format=(I)=>I.trim();else if($.ltrim)this.format=(I)=>I.trimLeft();else if($.rtrim)this.format=(I)=>I.trimRight();else this.format=(I)=>I}}zI0.ColumnFormatter=II0});var K_=O((JI0)=>{Object.defineProperty(JI0,"__esModule",{value:!0});JI0.NonQuotedColumnParser=void 0;var P11=zX(),UI0=q7();class YI0{constructor($){this.parserOptions=$,this.columnFormatter=new P11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,z=[],q=$.nextCharacterToken;for(;q;q=$.nextCharacterToken){if(UI0.Token.isTokenDelimiter(q,I)||UI0.Token.isTokenRowDelimiter(q))break;z.push(q.token),$.advancePastToken(q)}return this.columnFormatter.format(z.join(""))}}JI0.NonQuotedColumnParser=YI0});var H_=O((KI0)=>{Object.defineProperty(KI0,"__esModule",{value:!0});KI0.QuotedColumnParser=void 0;var T11=zX(),fq=q7();class wI0{constructor($){this.parserOptions=$,this.columnFormatter=new T11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:z,col:q}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(I),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),q}gatherDataBetweenQuotes($){let{parserOptions:I}=this,z=!1,q=!1,U=[],Y=$.nextCharacterToken;for(;!q&&Y!==null;Y=$.nextCharacterToken){let J=fq.Token.isTokenQuote(Y,I);if(!z&&J)z=!0;else if(z)if(fq.Token.isTokenEscapeCharacter(Y,I)){$.advancePastToken(Y);let Q=$.nextCharacterToken;if(Q!==null&&(fq.Token.isTokenQuote(Q,I)||fq.Token.isTokenEscapeCharacter(Q,I)))U.push(Q.token),Y=Q;else if(J)q=!0;else U.push(Y.token)}else if(J)q=!0;else U.push(Y.token);$.advancePastToken(Y)}return{col:this.columnFormatter.format(U.join("")),foundClosingQuote:q}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:z}=$;if(z){let q=fq.Token.isTokenDelimiter(z,I),U=fq.Token.isTokenRowDelimiter(z);if(!(q||U)){let Y=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${z.token}'. at '${Y}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}KI0.QuotedColumnParser=wI0});var ZI0=O((WI0)=>{Object.defineProperty(WI0,"__esModule",{value:!0});WI0.ColumnParser=void 0;var E11=K_(),B11=H_(),j11=q7();class GI0{constructor($){this.parserOptions=$,this.quotedColumnParser=new B11.QuotedColumnParser($),this.nonQuotedColumnParser=new E11.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&j11.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}WI0.ColumnParser=GI0});var G_=O((nq)=>{Object.defineProperty(nq,"__esModule",{value:!0});nq.ColumnFormatter=nq.QuotedColumnParser=nq.NonQuotedColumnParser=nq.ColumnParser=void 0;var v11=ZI0();Object.defineProperty(nq,"ColumnParser",{enumerable:!0,get:function(){return v11.ColumnParser}});var g11=K_();Object.defineProperty(nq,"NonQuotedColumnParser",{enumerable:!0,get:function(){return g11.NonQuotedColumnParser}});var R11=H_();Object.defineProperty(nq,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,u,u,V,q);let h=V.type==="*"?j_:V.type==="?"?R_:"\\"+V.type;U=!0,q=q.slice(0,V.reStart)+h+"\\("+u}if(P(),Y)q+="\\\\";let M=M41[q.charAt(0)];for(let u=Q.length-1;u>-1;u--){let h=Q[u],x=q.slice(0,h.reStart),g=q.slice(h.reStart,h.reEnd-8),p=q.slice(h.reEnd),i=q.slice(h.reEnd-8,h.reEnd)+p,S=x.split(")").length,f=x.split("(").length-S,b=p;for(let v=0;v<f;v++)b=b.replace(/\)[+*?]?/,"");p=b;let z0=p===""&&I!==v_?"(?:$|\\/)":"";q=x+g+p+z0+i}if(q!==""&&U)q="(?=.)"+q;if(M)q=F()+q;if(I===v_)return[q,U];if(z.nocase&&!U)U=$.toUpperCase()!==$.toLowerCase();if(!U)return P41($);let B=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+q+"$",B),{_glob:$,_src:q})}catch(u){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let I=this.options,z=I.noglobstar?j_:I.dot?O41:N41,q=I.nocase?"i":"",U=$.map((Y)=>{return Y=Y.map((J)=>typeof J==="string"?E41(J):J===y6?y6:J._src).reduce((J,Q)=>{if(!(J[J.length-1]===y6&&Q===y6))J.push(Q);return J},[]),Y.forEach((J,Q)=>{if(J!==y6||Y[Q-1]===y6)return;if(Q===0)if(Y.length>1)Y[Q+1]="(?:\\/|"+z+"\\/)?"+Y[Q+1];else Y[Q]=z;else if(Q===Y.length-1)Y[Q-1]+="(?:\\/|"+z+")?";else Y[Q-1]+="(?:\\/|\\/"+z+"\\/)"+Y[Q+1],Y[Q+1]=y6}),Y.filter((J)=>J!==y6).join("/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,q)}catch(Y){this.regexp=!1}return this.regexp}match($,I=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&I)return!0;let z=this.options;if(g_.sep!=="/")$=$.split(g_.sep).join("/");$=$.split(Jz0),this.debug(this.pattern,"split",$);let q=this.set;this.debug(this.pattern,"set",q);let U;for(let Y=$.length-1;Y>=0;Y--)if(U=$[Y],U)break;for(let Y=0;Y<q.length;Y++){let J=q[Y],Q=$;if(z.matchBase&&J.length===1)Q=[U];if(this.matchOne(Q,J,I)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return D$.defaults($).Minimatch}}D$.Minimatch=tQ});var Zz0=O((KR1,Vz0)=>{Vz0.exports=Wz0;var h_=t("fs"),{EventEmitter:j41}=t("events"),{Minimatch:C_}=Kz0(),{resolve:v41}=t("path");function g41($,I){return new Promise((z,q)=>{h_.readdir($,{withFileTypes:!0},(U,Y)=>{if(U)switch(U.code){case"ENOTDIR":if(I)q(U);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:q(U);break}else z(Y)})})}function Hz0($,I){return new Promise((z,q)=>{(I?h_.stat:h_.lstat)($,(Y,J)=>{if(Y)switch(Y.code){case"ENOENT":if(I)z(Hz0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*Gz0($,I,z,q,U,Y){let J=await g41(I+$,Y);for(let Q of J){let w=Q.name;if(w===void 0)w=Q,q=!0;let K=$+"/"+w,H=K.slice(1),G=I+"/"+H,W=null;if(q||z)W=await Hz0(G,z);if(!W&&Q.name!==void 0)W=Q;if(W===null)W={isDirectory:()=>!1};if(W.isDirectory()){if(!U(H))yield{relative:H,absolute:G,stats:W},yield*Gz0(K,I,z,q,U,!1)}else yield{relative:H,absolute:G,stats:W}}}async function*R41($,I,z,q){yield*Gz0("",$,I,z,q,!0)}function _41($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class S_ extends j41{constructor($,I,z){super();if(typeof I==="function")z=I,I=null;if(this.options=_41(I||{}),this.matchers=[],this.options.pattern){let q=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=q.map((U)=>new C_(U,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let q=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=q.map((U)=>new C_(U,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let q=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=q.map((U)=>new C_(U,{dot:!0}))}if(this.iterator=R41(v41($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(q)=>this._matches.push(this.options.absolute?q.absolute:q.relative)),this.on("error",(q)=>z(q)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let z=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((q)=>q.match(z)))&&!this.ignoreMatchers.some((q)=>q.match(z))&&(!this.options.nodir||!I)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let I=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,I)){let z=$.value.relative,q=$.value.absolute;if(this.options.mark&&I)z+="/",q+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:q,stat:$.value.stats});else this.emit("match",{relative:z,ab Line truncated
`}static isTokenCarriageReturn($,I){return $.token===I.carriageReturn}static isTokenComment($,I){return I.supportsComments&&!!$&&$.token===I.comment}static isTokenEscapeCharacter($,I){return $.token===I.escapeChar}static isTokenQuote($,I){return $.token===I.quote}static isTokenDelimiter($,I){return $.token===I.delimiter}}qI0.Token=zI0});var H_=O((QI0)=>{Object.defineProperty(QI0,"__esModule",{value:!0});QI0.Scanner=void 0;var YI0=q7(),R11=/((?:\r\n)|\n|\r)/;class JI0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,I=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(I)===-1)return null;let z=I.exec($);if(z==null)return null;let q=z[1],U=this.cursor+(z.index||0);return new YI0.Token({token:q,startCursor:U,endCursor:U+q.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new YI0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=R11.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}QI0.Scanner=JI0});var qX=O((HI0)=>{Object.defineProperty(HI0,"__esModule",{value:!0});HI0.ColumnFormatter=void 0;class KI0{constructor($){if($.trim)this.format=(I)=>I.trim();else if($.ltrim)this.format=(I)=>I.trimLeft();else if($.rtrim)this.format=(I)=>I.trimRight();else this.format=(I)=>I}}HI0.ColumnFormatter=KI0});var G_=O((ZI0)=>{Object.defineProperty(ZI0,"__esModule",{value:!0});ZI0.NonQuotedColumnParser=void 0;var _11=qX(),WI0=q7();class VI0{constructor($){this.parserOptions=$,this.columnFormatter=new _11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,z=[],q=$.nextCharacterToken;for(;q;q=$.nextCharacterToken){if(WI0.Token.isTokenDelimiter(q,I)||WI0.Token.isTokenRowDelimiter(q))break;z.push(q.token),$.advancePastToken(q)}return this.columnFormatter.format(z.join(""))}}ZI0.NonQuotedColumnParser=VI0});var W_=O((DI0)=>{Object.defineProperty(DI0,"__esModule",{value:!0});DI0.QuotedColumnParser=void 0;var C11=qX(),fq=q7();class LI0{constructor($){this.parserOptions=$,this.columnFormatter=new C11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:z,col:q}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(I),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),q}gatherDataBetweenQuotes($){let{parserOptions:I}=this,z=!1,q=!1,U=[],Y=$.nextCharacterToken;for(;!q&&Y!==null;Y=$.nextCharacterToken){let J=fq.Token.isTokenQuote(Y,I);if(!z&&J)z=!0;else if(z)if(fq.Token.isTokenEscapeCharacter(Y,I)){$.advancePastToken(Y);let Q=$.nextCharacterToken;if(Q!==null&&(fq.Token.isTokenQuote(Q,I)||fq.Token.isTokenEscapeCharacter(Q,I)))U.push(Q.token),Y=Q;else if(J)q=!0;else U.push(Y.token)}else if(J)q=!0;else U.push(Y.token);$.advancePastToken(Y)}return{col:this.columnFormatter.format(U.join("")),foundClosingQuote:q}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:z}=$;if(z){let q=fq.Token.isTokenDelimiter(z,I),U=fq.Token.isTokenRowDelimiter(z);if(!(q||U)){let Y=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${z.token}'. at '${Y}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}DI0.QuotedColumnParser=LI0});var AI0=O((NI0)=>{Object.defineProperty(NI0,"__esModule",{value:!0});NI0.ColumnParser=void 0;var h11=G_(),S11=W_(),y11=q7();class OI0{constructor($){this.parserOptions=$,this.quotedColumnParser=new S11.QuotedColumnParser($),this.nonQuotedColumnParser=new h11.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&y11.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}NI0.ColumnParser=OI0});var V_=O((nq)=>{Object.defineProperty(nq,"__esModule",{value:!0});nq.ColumnFormatter=nq.QuotedColumnParser=nq.NonQuotedColumnParser=nq.ColumnParser=void 0;var u11=AI0();Object.defineProperty(nq,"ColumnParser",{enumerable:!0,get:function(){return u11.ColumnParser}});var x11=G_();Object.defineProperty(nq,"NonQuotedColumnParser",{enumerable:!0,get:function(){return x11.NonQuotedColumnParser}});var k11=W_();Object.defineProperty(nq,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,u,u,V,q);let h=V.type==="*"?g_:V.type==="?"?C_:"\\"+V.type;U=!0,q=q.slice(0,V.reStart)+h+"\\("+u}if(P(),Y)q+="\\\\";let M=g41[q.charAt(0)];for(let u=Q.length-1;u>-1;u--){let h=Q[u],x=q.slice(0,h.reStart),g=q.slice(h.reStart,h.reEnd-8),p=q.slice(h.reEnd),i=q.slice(h.reEnd-8,h.reEnd)+p,S=x.split(")").length,f=x.split("(").length-S,b=p;for(let v=0;v<f;v++)b=b.replace(/\)[+*?]?/,"");p=b;let z0=p===""&&I!==R_?"(?:$|\\/)":"";q=x+g+p+z0+i}if(q!==""&&U)q="(?=.)"+q;if(M)q=F()+q;if(I===R_)return[q,U];if(z.nocase&&!U)U=$.toUpperCase()!==$.toLowerCase();if(!U)return _41($);let j=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+q+"$",j),{_glob:$,_src:q})}catch(u){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let I=this.options,z=I.noglobstar?g_:I.dot?j41:v41,q=I.nocase?"i":"",U=$.map((Y)=>{return Y=Y.map((J)=>typeof J==="string"?h41(J):J===y6?y6:J._src).reduce((J,Q)=>{if(!(J[J.length-1]===y6&&Q===y6))J.push(Q);return J},[]),Y.forEach((J,Q)=>{if(J!==y6||Y[Q-1]===y6)return;if(Q===0)if(Y.length>1)Y[Q+1]="(?:\\/|"+z+"\\/)?"+Y[Q+1];else Y[Q]=z;else if(Q===Y.length-1)Y[Q-1]+="(?:\\/|"+z+")?";else Y[Q-1]+="(?:\\/|\\/"+z+"\\/)"+Y[Q+1],Y[Q+1]=y6}),Y.filter((J)=>J!==y6).join("/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,q)}catch(Y){this.regexp=!1}return this.regexp}match($,I=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&I)return!0;let z=this.options;if(__.sep!=="/")$=$.split(__.sep).join("/");$=$.split(Zz0),this.debug(this.pattern,"split",$);let q=this.set;this.debug(this.pattern,"set",q);let U;for(let Y=$.length-1;Y>=0;Y--)if(U=$[Y],U)break;for(let Y=0;Y<q.length;Y++){let J=q[Y],Q=$;if(z.matchBase&&J.length===1)Q=[U];if(this.matchOne(Q,J,I)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return D$.defaults($).Minimatch}}D$.Minimatch=aQ});var Az0=O((OR1,Mz0)=>{Mz0.exports=Nz0;var y_=t("fs"),{EventEmitter:y41}=t("events"),{Minimatch:S_}=Dz0(),{resolve:u41}=t("path");function x41($,I){return new Promise((z,q)=>{y_.readdir($,{withFileTypes:!0},(U,Y)=>{if(U)switch(U.code){case"ENOTDIR":if(I)q(U);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:q(U);break}else z(Y)})})}function Fz0($,I){return new Promise((z,q)=>{(I?y_.stat:y_.lstat)($,(Y,J)=>{if(Y)switch(Y.code){case"ENOENT":if(I)z(Fz0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*Oz0($,I,z,q,U,Y){let J=await x41(I+$,Y);for(let Q of J){let w=Q.name;if(w===void 0)w=Q,q=!0;let K=$+"/"+w,H=K.slice(1),G=I+"/"+H,W=null;if(q||z)W=await Fz0(G,z);if(!W&&Q.name!==void 0)W=Q;if(W===null)W={isDirectory:()=>!1};if(W.isDirectory()){if(!U(H))yield{relative:H,absolute:G,stats:W},yield*Oz0(K,I,z,q,U,!1)}else yield{relative:H,absolute:G,stats:W}}}async function*k41($,I,z,q){yield*Oz0("",$,I,z,q,!0)}function f41($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class u_ extends y41{constructor($,I,z){super();if(typeof I==="function")z=I,I=null;if(this.options=f41(I||{}),this.matchers=[],this.options.pattern){let q=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=q.map((U)=>new S_(U,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let q=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=q.map((U)=>new S_(U,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let q=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=q.map((U)=>new S_(U,{dot:!0}))}if(this.iterator=k41(u41($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(q)=>this._matches.push(this.options.absolute?q.absolute:q.relative)),this.on("error",(q)=>z(q)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let z=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((q)=>q.match(z)))&&!this.ignoreMatchers.some((q)=>q.match(z))&&(!this.options.nodir||!I)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let I=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,I)){let z=$.value.relative,q=$.value.absolute;if(this.options.mark&&I)z+="/",q+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:q,stat:$.value.stats});else this.emit("match",{relative:z,ab Line truncated
`,y);y=$0===-1?E.length:$0}else if(d!==-1&&E[y]==="/"&&E[y+1]==="*"){let $0=E.indexOf("*/",y);if($0!==-1)y=$0+2,d=E.indexOf("*/",y);else R+=E[y],y++}else R+=E[y],y++;return R}function B$(E){let R=T6(E.toString()),y=R.match(b4);if(!y)y=R.match(n6);if(!y)throw Error(`could not parse args in autoInject
Source:
`+R);let[,d]=y;return d.replace(/\s/g,"").split(E$).map(($0)=>$0.replace(b6,"").trim())}function Q$(E,R){var y={};return Object.keys(E).forEach((d)=>{var $0=E[d],q0,w0=V($0),K0=!w0&&$0.length===1||w0&&$0.length===0;if(Array.isArray($0))q0=[...$0],$0=q0.pop(),y[d]=q0.concat(q0.length>0?Z0:$0);else if(K0)y[d]=$0;else{if(q0=B$($0),$0.length===0&&!w0&&q0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!w0)q0.pop();y[d]=q0.concat(Z0)}function Z0(C0,K1){var M1=q0.map((V1)=>C0[V1]);M1.push(K1),D($0)(...M1)}}),N1(y,R)}class S7{constructor(){this.head=this.tail=null,this.length=0}removeLink(E){if(E.prev)E.prev.next=E.next;else this.head=E.next;if(E.next)E.next.prev=E.prev;else this.tail=E.prev;return E.prev=E.next=null,this.length-=1,E}empty(){while(this.head)this.shift();return this}insertAfter(E,R){if(R.prev=E,R.next=E.next,E.next)E.next.prev=R;else this.tail=R;E.next=R,this.length+=1}insertBefore(E,R){if(R.prev=E.prev,R.next=E,E.prev)E.prev.next=R;else this.head=R;E.prev=R,this.length+=1}unshift(E){if(this.head)this.insertBefore(this.head,E);else w$(this,E)}push(E){if(this.tail)this.insertAfter(this.tail,E);else w$(this,E)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var E=this.head;while(E)yield E.data,E=E.next}remove(E){var R=this.head;while(R){var{next:y}=R;if(E(R))this.removeLink(R);R=y}return this}}function w$(E,R){E.length=1,E.head=E.tail=R}function q9(E,R,y){if(R==null)R=1;else if(R===0)throw RangeError("Concurrency must not be zero");var d=D(E),$0=0,q0=[];let w0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function K0(u0,R0){w0[u0].push(R0)}function Z0(u0,R0){let x0=(...Z1)=>{C0(u0,x0),R0(...Z1)};w0[u0].push(x0)}function C0(u0,R0){if(!u0)return Object.keys(w0).forEach((x0)=>w0[x0]=[]);if(!R0)return w0[u0]=[];w0[u0]=w0[u0].filter((x0)=>x0!==R0)}function K1(u0,...R0){w0[u0].forEach((x0)=>x0(...R0))}var M1=!1;function V1(u0,R0,x0,Z1){if(Z1!=null&&typeof Z1!=="function")throw Error("task callback must be a function");A1.started=!0;var Q4,i4;function v$(u7,...sU){if(u7)return x0?i4(u7):Q4();if(sU.length<=1)return Q4(sU[0]);Q4(sU)}var jI=A1._createTaskItem(u0,x0?v$:Z1||v$);if(R0)A1._tasks.unshift(jI);else A1._tasks.push(jI);if(!M1)M1=!0,K(()=>{M1=!1,A1.process()});if(x0||!Z1)return new Promise((u7,sU)=>{Q4=u7,i4=sU})}function j$(u0){return function(R0,...x0){$0-=1;for(var Z1=0,Q4=u0.length;Z1<Q4;Z1++){var i4=u0[Z1],v$=q0.indexOf(i4);if(v$===0)q0.shift();else if(v$>0)q0.splice(v$,1);if(i4.callback(R0,...x0),R0!=null)K1("error",R0,i4.data)}if($0<=A1.concurrency-A1.buffer)K1("unsaturated");if(A1.idle())K1("drain");A1.process()}}function BI(u0){if(u0.length===0&&A1.idle())return K(()=>K1("drain")),!0;return!1}let y7=(u0)=>(R0)=>{if(!R0)return new Promise((x0,Z1)=>{Z0(u0,(Q4,i4)=>{if(Q4)return Z1(Q4);x0(i4)})});C0(u0),K0(u0,R0)};var aU=!1,A1={_tasks:new S7,_createTaskItem(u0,R0){return{data:u0,callback:R0}},*[Symbol.iterator](){yield*A1._tasks[Symbol.iterator]()},concurrency:R,payload:y,buffer:R/4,started:!1,paused:!1,push(u0,R0){if(Array.isArray(u0)){if(BI(u0))return;return u0.map((x0)=>V1(x0,!1,!1,R0))}return V1(u0,!1,!1,R0)},pushAsync(u0,R0){if(Array.isArray(u0)){if(BI(u0))return;return u0.map((x0)=>V1(x0,!1,!0,R0))}return V1(u0,!1,!0,R0)},kill(){C0(),A1._tasks.empty()},unshift(u0,R0){if(Array.isArray(u0)){if(BI(u0))return;return u0.map((x0)=>V1(x0,!0,!1,R0))}return V1(u0,!0,!1,R0)},unshiftAsync(u0,R0){if(Array.isArray(u0)){if(BI(u0))return;return u0.map((x0)=>V1(x0,!0,!0,R0))}return V1(u0,!0,!0,R0)},remove(u0){A1._tasks.remove(u0)},process(){if(aU)return;aU=!0;while(!A1.paused&&$0<A1.concurrency&&A1._tasks.length){var u0=[],R0=[],x0=A1._tasks.length;if(A1.payload)x0=Math.min(x0,A1.payload);for(var Z1=0;Z1<x0;Z1++){var Q4=A1._tasks.shift();u0.push(Q4),q0.push(Q4),R0.push(Q4.data)}if($0+=1,A1._tasks.length===0)K1("empty");if($0===A1.concurrency)K1("saturated");var i4=S(j$(u0));d(R0,i4)}aU=!1},length(){return A1._tasks.length},running(){return $0},workersList(){return q0},idle(){return A1._tasks.length+$0===0},pause(){A1.paused=!0},resume(){if(A1.paused===!1)return;A1.paused=!1,K(A1.process)}};return Object.defineProperties(A1,{saturated:{writable:!1,value:y7("saturated")},unsaturated:{writable:!1,value:y7("unsaturated")},empty:{writable:!1,value:y7("empty")},drain:{writable:!1,value:y7("drain")},error:{writable:!1,value:y7("error")}}),A1}function j0(E,R){return q9(E,1,R)}function a(E,R,y){return q9(E,R,y)}function N(E,R,y,d){d=u(d);var $0=D(y);return f0(E,(q0,w0,K0)=>{$0(R,q0,(Z0,C0)=>{R=C0,K0(Z0)})},(q0)=>d(q0,R))}var A=F(N,4);function C(...E){var R=E.map(D);return function(...y){var d=this,$0=y[y.length-1];if(typeof $0=="function")y.pop();else $0=q1();return A(R,y,(q0,w0,K0)=>{w0.apply(d,q0.concat((Z0,...C0)=>{K0(Z0,C0)}))},(q0,w0)=>$0(q0,...w0)),$0[v0]}}function k(...E){return C(...E.reverse())}function s(E,R,y,d){return P(b(R),E,y,d)}var m=F(s,4);function e( Line truncated
GFS4: `),console.error($)};if(!Z4[J6]){if(y_=global[J6]||[],Ez0(Z4,y_),Z4.close=function($){function I(z,q){return $.call(Z4,z,function(U){if(!U)Tz0();if(typeof q==="function")q.apply(this,arguments)})}return Object.defineProperty(I,WX,{value:$}),I}(Z4.close),Z4.closeSync=function($){function I(z){$.apply(Z4,arguments),Tz0()}return Object.defineProperty(I,WX,{value:$}),I}(Z4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){u3(Z4[J6]),t("assert").equal(Z4[J6].length,0)})}var y_;if(!global[J6])Ez0(global,Z4[J6]);k_.exports=u_(n41(Z4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Z4.__patched)k_.exports=u_(Z4),Z4.__patched=!0;function u_($){k41($),$.gracefulify=u_,$.createReadStream=B,$.createWriteStream=u;var I=$.readFile;$.readFile=z;function z(g,p,i){if(typeof p==="function")i=p,p=null;return S(g,p,i);function S(f,b,z0,v){return I(f,b,function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))pq([S,[f,b,z0],n,v||Date.now(),Date.now()]);else if(typeof z0==="function")z0.apply(this,arguments)})}}var q=$.writeFile;$.writeFile=U;function U(g,p,i,S){if(typeof i==="function")S=i,i=null;return f(g,p,i,S);function f(b,z0,v,n,c){return q(b,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))pq([f,[b,z0,v,n],r,c||Date.now(),Date.now()]);else if(typeof n==="function")n.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=J;function J(g,p,i,S){if(typeof i==="function")S=i,i=null;return f(g,p,i,S);function f(b,z0,v,n,c){return Y(b,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))pq([f,[b,z0,v,n],r,c||Date.now(),Date.now()]);else if(typeof n==="function")n.apply(this,arguments)})}}var Q=$.copyFile;if(Q)$.copyFile=w;function w(g,p,i,S){if(typeof i==="function")S=i,i=0;return f(g,p,i,S);function f(b,z0,v,n,c){return Q(b,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))pq([f,[b,z0,v,n],r,c||Date.now(),Date.now()]);else if(typeof n==="function")n.apply(this,arguments)})}}var K=$.readdir;$.readdir=G;var H=/^v[0-5]\./;function G(g,p,i){if(typeof p==="function")i=p,p=null;var S=H.test(process.version)?function(z0,v,n,c){return K(z0,f(z0,v,n,c))}:function(z0,v,n,c){return K(z0,v,f(z0,v,n,c))};return S(g,p,i);function f(b,z0,v,n){return function(c,r){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))pq([S,[b,z0,v],c,n||Date.now(),Date.now()]);else{if(r&&r.sort)r.sort();if(typeof v==="function")v.call(this,c,r)}}}}if(process.version.substr(0,4)==="v0.8"){var W=f41($);F=W.ReadStream,P=W.WriteStream}var V=$.ReadStream;if(V)F.prototype=Object.create(V.prototype),F.prototype.open=T;var X=$.WriteStream;if(X)P.prototype=Object.create(X.prototype),P.prototype.open=M;Object.defineProperty($,"ReadStream",{get:function(){return F},set:function(g){F=g},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return P},set:function(g){P=g},enumerable:!0,configurable:!0});var L=F;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(g){L=g},enumerable:!0,configurable:!0});var D=P;Object.defineProperty($,"FileWriteStream",{get:function(){return D},set:function(g){D=g},enumerable:!0,configurable:!0});function F(g,p){if(this instanceof F)return V.apply(this,arguments),this;else return F.apply(Object.create(F.prototype),arguments)}function T(){var g=this;x(g.path,g.flags,g.mode,function(p,i){if(p){if(g.autoClose)g.destroy();g.emit("error",p)}else g.fd=i,g.emit("open",i),g.read()})}function P(g,p){if(this instanceof P)return X.apply(this,arguments),this;else return P.apply(Object.create(P.prototype),arguments)}function M(){var g=this;x(g.path,g.flags,g.mode,function(p,i){if(p)g.destroy(),g.emit("error",p);else g.fd=i,g.emit("open",i)})}function B(g,p){return new $.ReadStream(g,p)}function u(g,p){return new $.WriteStream(g,p)}var h=$.open;$.open=x;function x(g,p,i,S){if(typeof i==="function")S=i,i=null;return f(g,p,i,S);function f(b,z0,v,n,c){return h(b,z0,v,function(r,U0){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))pq([f,[b,z0,v,n],r,c||Date.now(),Date.now()]);else if(typeof n==="function")n.apply(this,arguments)})}}return $}function pq($){u3("ENQUEUE",$[0].name,$[1]),Z4[J6].push($),x_()}var GX;function Tz0(){var $=Date.now();for(var I=0;I<Z4[J6].length;++I)if(Z4[J6][I].length>2)Z4[J6][I][3]=$,Z4[J6][I][4]=$;x_()}function x_(){if(clearTimeout(GX),GX=void 0,Z4[J6].length===0)return;var $=Z4[J6].shift(),I=$[0],z=$[1],q=$[2],U=$[3],Y=$[4];if(U===void 0)u3("RETRY",I.name,z),I.apply(null,z);else if(Date.now()-U>=60000){u3("TIMEOUT",I.name,z);var J=z.pop();if(typeof J==="function")J.call(null,q)}else{var Q=Date.now()-Y,w=Math.max(Y-U,1),K=Math.min(w*1.2,100);if(Q>=K)u3("RETRY",I.name,z),I.apply(null,z.concat([U]));else Z4[J6].push($)}if(GX===void 0)GX=setTimeout(x_,0)}});var jz0=O((ZR1,f_)=>{function i41($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Bz0=E4().Buffer,aQ=t("util");function p41($,I,z){$.copy(I,z)}f_.exports=function(){function $(){i41(this,$),this.head=null,this.tail=null,th Line truncated
`+R);let[,d]=y;return d.replace(/\s/g,"").split(E$).map(($0)=>$0.replace(b6,"").trim())}function Q$(E,R){var y={};return Object.keys(E).forEach((d)=>{var $0=E[d],q0,w0=V($0),K0=!w0&&$0.length===1||w0&&$0.length===0;if(Array.isArray($0))q0=[...$0],$0=q0.pop(),y[d]=q0.concat(q0.length>0?Z0:$0);else if(K0)y[d]=$0;else{if(q0=B$($0),$0.length===0&&!w0&&q0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!w0)q0.pop();y[d]=q0.concat(Z0)}function Z0(C0,K1){var M1=q0.map((V1)=>C0[V1]);M1.push(K1),D($0)(...M1)}}),N1(y,R)}class S7{constructor(){this.head=this.tail=null,this.length=0}removeLink(E){if(E.prev)E.prev.next=E.next;else this.head=E.next;if(E.next)E.next.prev=E.prev;else this.tail=E.prev;return E.prev=E.next=null,this.length-=1,E}empty(){while(this.head)this.shift();return this}insertAfter(E,R){if(R.prev=E,R.next=E.next,E.next)E.next.prev=R;else this.tail=R;E.next=R,this.length+=1}insertBefore(E,R){if(R.prev=E.prev,R.next=E,E.prev)E.prev.next=R;else this.head=R;E.prev=R,this.length+=1}unshift(E){if(this.head)this.insertBefore(this.head,E);else w$(this,E)}push(E){if(this.tail)this.insertAfter(this.tail,E);else w$(this,E)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var E=this.head;while(E)yield E.data,E=E.next}remove(E){var R=this.head;while(R){var{next:y}=R;if(E(R))this.removeLink(R);R=y}return this}}function w$(E,R){E.length=1,E.head=E.tail=R}function q9(E,R,y){if(R==null)R=1;else if(R===0)throw RangeError("Concurrency must not be zero");var d=D(E),$0=0,q0=[];let w0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function K0(x0,R0){w0[x0].push(R0)}function Z0(x0,R0){let k0=(...Z1)=>{C0(x0,k0),R0(...Z1)};w0[x0].push(k0)}function C0(x0,R0){if(!x0)return Object.keys(w0).forEach((k0)=>w0[k0]=[]);if(!R0)return w0[x0]=[];w0[x0]=w0[x0].filter((k0)=>k0!==R0)}function K1(x0,...R0){w0[x0].forEach((k0)=>k0(...R0))}var M1=!1;function V1(x0,R0,k0,Z1){if(Z1!=null&&typeof Z1!=="function")throw Error("task callback must be a function");A1.started=!0;var Q4,i4;function v$(u7,...sU){if(u7)return k0?i4(u7):Q4();if(sU.length<=1)return Q4(sU[0]);Q4(sU)}var jI=A1._createTaskItem(x0,k0?v$:Z1||v$);if(R0)A1._tasks.unshift(jI);else A1._tasks.push(jI);if(!M1)M1=!0,K(()=>{M1=!1,A1.process()});if(k0||!Z1)return new Promise((u7,sU)=>{Q4=u7,i4=sU})}function j$(x0){return function(R0,...k0){$0-=1;for(var Z1=0,Q4=x0.length;Z1<Q4;Z1++){var i4=x0[Z1],v$=q0.indexOf(i4);if(v$===0)q0.shift();else if(v$>0)q0.splice(v$,1);if(i4.callback(R0,...k0),R0!=null)K1("error",R0,i4.data)}if($0<=A1.concurrency-A1.buffer)K1("unsaturated");if(A1.idle())K1("drain");A1.process()}}function BI(x0){if(x0.length===0&&A1.idle())return K(()=>K1("drain")),!0;return!1}let y7=(x0)=>(R0)=>{if(!R0)return new Promise((k0,Z1)=>{Z0(x0,(Q4,i4)=>{if(Q4)return Z1(Q4);k0(i4)})});C0(x0),K0(x0,R0)};var aU=!1,A1={_tasks:new S7,_createTaskItem(x0,R0){return{data:x0,callback:R0}},*[Symbol.iterator](){yield*A1._tasks[Symbol.iterator]()},concurrency:R,payload:y,buffer:R/4,started:!1,paused:!1,push(x0,R0){if(Array.isArray(x0)){if(BI(x0))return;return x0.map((k0)=>V1(k0,!1,!1,R0))}return V1(x0,!1,!1,R0)},pushAsync(x0,R0){if(Array.isArray(x0)){if(BI(x0))return;return x0.map((k0)=>V1(k0,!1,!0,R0))}return V1(x0,!1,!0,R0)},kill(){C0(),A1._tasks.empty()},unshift(x0,R0){if(Array.isArray(x0)){if(BI(x0))return;return x0.map((k0)=>V1(k0,!0,!1,R0))}return V1(x0,!0,!1,R0)},unshiftAsync(x0,R0){if(Array.isArray(x0)){if(BI(x0))return;return x0.map((k0)=>V1(k0,!0,!0,R0))}return V1(x0,!0,!0,R0)},remove(x0){A1._tasks.remove(x0)},process(){if(aU)return;aU=!0;while(!A1.paused&&$0<A1.concurrency&&A1._tasks.length){var x0=[],R0=[],k0=A1._tasks.length;if(A1.payload)k0=Math.min(k0,A1.payload);for(var Z1=0;Z1<k0;Z1++){var Q4=A1._tasks.shift();x0.push(Q4),q0.push(Q4),R0.push(Q4.data)}if($0+=1,A1._tasks.length===0)K1("empty");if($0===A1.concurrency)K1("saturated");var i4=S(j$(x0));d(R0,i4)}aU=!1},length(){return A1._tasks.length},running(){return $0},workersList(){return q0},idle(){return A1._tasks.length+$0===0},pause(){A1.paused=!0},resume(){if(A1.paused===!1)return;A1.paused=!1,K(A1.process)}};return Object.defineProperties(A1,{saturated:{writable:!1,value:y7("saturated")},unsaturated:{writable:!1,value:y7("unsaturated")},empty:{writable:!1,value:y7("empty")},drain:{writable:!1,value:y7("drain")},error:{writable:!1,value:y7("error")}}),A1}function j0(E,R){return q9(E,1,R)}function a(E,R,y){return q9(E,R,y)}function N(E,R,y,d){d=u(d);var $0=D(y);return f0(E,(q0,w0,K0)=>{$0(R,q0,(Z0,C0)=>{R=C0,K0(Z0)})},(q0)=>d(q0,R))}var A=F(N,4);function C(...E){var R=E.map(D);return function(...y){var d=this,$0=y[y.length-1];if(typeof $0=="function")y.pop();else $0=q1();return A(R,y,(q0,w0,K0)=>{w0.apply(d,q0.concat((Z0,...C0)=>{K0(Z0,C0)}))},(q0,w0)=>$0(q0,...w0)),$0[v0]}}function k(...E){return C(...E.reverse())}function s(E,R,y,d){return P(b(R),E,y,d)}var m=F(s,4);function e( Line truncated
GFS4: `),console.error($)};if(!Z4[J6]){if(x_=global[J6]||[],hz0(Z4,x_),Z4.close=function($){function I(z,q){return $.call(Z4,z,function(U){if(!U)Cz0();if(typeof q==="function")q.apply(this,arguments)})}return Object.defineProperty(I,VX,{value:$}),I}(Z4.close),Z4.closeSync=function($){function I(z){$.apply(Z4,arguments),Cz0()}return Object.defineProperty(I,VX,{value:$}),I}(Z4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){u3(Z4[J6]),t("assert").equal(Z4[J6].length,0)})}var x_;if(!global[J6])hz0(global,Z4[J6]);n_.exports=k_(o41(Z4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Z4.__patched)n_.exports=k_(Z4),Z4.__patched=!0;function k_($){m41($),$.gracefulify=k_,$.createReadStream=j,$.createWriteStream=u;var I=$.readFile;$.readFile=z;function z(g,p,i){if(typeof p==="function")i=p,p=null;return S(g,p,i);function S(f,b,z0,v){return I(f,b,function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))pq([S,[f,b,z0],n,v||Date.now(),Date.now()]);else if(typeof z0==="function")z0.apply(this,arguments)})}}var q=$.writeFile;$.writeFile=U;function U(g,p,i,S){if(typeof i==="function")S=i,i=null;return f(g,p,i,S);function f(b,z0,v,n,c){return q(b,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))pq([f,[b,z0,v,n],r,c||Date.now(),Date.now()]);else if(typeof n==="function")n.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=J;function J(g,p,i,S){if(typeof i==="function")S=i,i=null;return f(g,p,i,S);function f(b,z0,v,n,c){return Y(b,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))pq([f,[b,z0,v,n],r,c||Date.now(),Date.now()]);else if(typeof n==="function")n.apply(this,arguments)})}}var Q=$.copyFile;if(Q)$.copyFile=w;function w(g,p,i,S){if(typeof i==="function")S=i,i=0;return f(g,p,i,S);function f(b,z0,v,n,c){return Q(b,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))pq([f,[b,z0,v,n],r,c||Date.now(),Date.now()]);else if(typeof n==="function")n.apply(this,arguments)})}}var K=$.readdir;$.readdir=G;var H=/^v[0-5]\./;function G(g,p,i){if(typeof p==="function")i=p,p=null;var S=H.test(process.version)?function(z0,v,n,c){return K(z0,f(z0,v,n,c))}:function(z0,v,n,c){return K(z0,v,f(z0,v,n,c))};return S(g,p,i);function f(b,z0,v,n){return function(c,r){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))pq([S,[b,z0,v],c,n||Date.now(),Date.now()]);else{if(r&&r.sort)r.sort();if(typeof v==="function")v.call(this,c,r)}}}}if(process.version.substr(0,4)==="v0.8"){var W=l41($);F=W.ReadStream,P=W.WriteStream}var V=$.ReadStream;if(V)F.prototype=Object.create(V.prototype),F.prototype.open=T;var X=$.WriteStream;if(X)P.prototype=Object.create(X.prototype),P.prototype.open=M;Object.defineProperty($,"ReadStream",{get:function(){return F},set:function(g){F=g},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return P},set:function(g){P=g},enumerable:!0,configurable:!0});var L=F;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(g){L=g},enumerable:!0,configurable:!0});var D=P;Object.defineProperty($,"FileWriteStream",{get:function(){return D},set:function(g){D=g},enumerable:!0,configurable:!0});function F(g,p){if(this instanceof F)return V.apply(this,arguments),this;else return F.apply(Object.create(F.prototype),arguments)}function T(){var g=this;x(g.path,g.flags,g.mode,function(p,i){if(p){if(g.autoClose)g.destroy();g.emit("error",p)}else g.fd=i,g.emit("open",i),g.read()})}function P(g,p){if(this instanceof P)return X.apply(this,arguments),this;else return P.apply(Object.create(P.prototype),arguments)}function M(){var g=this;x(g.path,g.flags,g.mode,function(p,i){if(p)g.destroy(),g.emit("error",p);else g.fd=i,g.emit("open",i)})}function j(g,p){return new $.ReadStream(g,p)}function u(g,p){return new $.WriteStream(g,p)}var h=$.open;$.open=x;function x(g,p,i,S){if(typeof i==="function")S=i,i=null;return f(g,p,i,S);function f(b,z0,v,n,c){return h(b,z0,v,function(r,U0){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))pq([f,[b,z0,v,n],r,c||Date.now(),Date.now()]);else if(typeof n==="function")n.apply(this,arguments)})}}return $}function pq($){u3("ENQUEUE",$[0].name,$[1]),Z4[J6].push($),f_()}var WX;function Cz0(){var $=Date.now();for(var I=0;I<Z4[J6].length;++I)if(Z4[J6][I].length>2)Z4[J6][I][3]=$,Z4[J6][I][4]=$;f_()}function f_(){if(clearTimeout(WX),WX=void 0,Z4[J6].length===0)return;var $=Z4[J6].shift(),I=$[0],z=$[1],q=$[2],U=$[3],Y=$[4];if(U===void 0)u3("RETRY",I.name,z),I.apply(null,z);else if(Date.now()-U>=60000){u3("TIMEOUT",I.name,z);var J=z.pop();if(typeof J==="function")J.call(null,q)}else{var Q=Date.now()-Y,w=Math.max(Y-U,1),K=Math.min(w*1.2,100);if(Q>=K)u3("RETRY",I.name,z),I.apply(null,z.concat([U]));else Z4[J6].push($)}if(WX===void 0)WX=setTimeout(f_,0)}});var yz0=O((TR1,b_)=>{function t41($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Sz0=E4().Buffer,sQ=t("util");function a41($,I,z){$.copy(I,z)}b_.exports=function(){function $(){t41(this,$),this.head=null,this.tail=null,th Line truncated
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/Vq0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var q="";if(z>4&&$[3]==="\\"){var U=$[2];if((U==="?"||U===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),q="//"}var Y=$.split(/[/\\]+/);if(I!==!1&&Y[Y.length-1]==="")Y.pop();return q+Y.join("/")}});var YC=O((BR1,Nq0)=>{var Xq0=9007199254740991,r61="[object Arguments]",t61="[object Function]",a61="[object GeneratorFunction]",s61=/^(?:0|[1-9]\d*)$/;function Lq0($,I,z){switch(z.length){case 0:return $.call(I);case 1:return $.call(I,z[0]);case 2:return $.call(I,z[0],z[1]);case 3:return $.call(I,z[0],z[1],z[2])}return $.apply(I,z)}function e61($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}var J2=Object.prototype,Q2=J2.hasOwnProperty,Dq0=J2.toString,$$1=J2.propertyIsEnumerable,Zq0=Math.max;function I$1($,I){var z=G$1($)||H$1($)?e61($.length,String):[],q=z.length,U=!!q;for(var Y in $)if((I||Q2.call($,Y))&&!(U&&(Y=="length"||Oq0(Y,q))))z.push(Y);return z}function z$1($,I,z,q){if($===void 0||zC($,J2[z])&&!Q2.call(q,z))return I;return $}function q$1($,I,z){var q=$[I];if(!(Q2.call($,I)&&zC(q,z))||z===void 0&&!(I in $))$[I]=z}function U$1($){if(!UC($))return K$1($);var I=w$1($),z=[];for(var q in $)if(!(q=="constructor"&&(I||!Q2.call($,q))))z.push(q);return z}function Fq0($,I){return I=Zq0(I===void 0?$.length-1:I,0),function(){var z=arguments,q=-1,U=Zq0(z.length-I,0),Y=Array(U);while(++q<U)Y[q]=z[I+q];q=-1;var J=Array(I+1);while(++q<I)J[q]=z[q];return J[I]=Y,Lq0($,this,J)}}function Y$1($,I,z,q){z||(z={});var U=-1,Y=I.length;while(++U<Y){var J=I[U],Q=q?q(z[J],$[J],J,z,$):void 0;q$1(z,J,Q===void 0?$[J]:Q)}return z}function J$1($){return Fq0(function(I,z){var q=-1,U=z.length,Y=U>1?z[U-1]:void 0,J=U>2?z[2]:void 0;if(Y=$.length>3&&typeof Y=="function"?(U--,Y):void 0,J&&Q$1(z[0],z[1],J))Y=U<3?void 0:Y,U=1;I=Object(I);while(++q<U){var Q=z[q];if(Q)$(I,Q,q,Y)}return I})}function Oq0($,I){return I=I==null?Xq0:I,!!I&&(typeof $=="number"||s61.test($))&&($>-1&&$%1==0&&$<I)}function Q$1($,I,z){if(!UC(z))return!1;var q=typeof I;if(q=="number"?qC(z)&&Oq0(I,z.length):q=="string"&&(I in z))return zC(z[I],$);return!1}function w$1($){var I=$&&$.constructor,z=typeof I=="function"&&I.prototype||J2;return $===z}function K$1($){var I=[];if($!=null)for(var z in Object($))I.push(z);return I}function zC($,I){return $===I||$!==$&&I!==I}function H$1($){return W$1($)&&Q2.call($,"callee")&&(!$$1.call($,"callee")||Dq0.call($)==r61)}var G$1=Array.isArray;function qC($){return $!=null&&Z$1($.length)&&!V$1($)}function W$1($){return X$1($)&&qC($)}function V$1($){var I=UC($)?Dq0.call($):"";return I==t61||I==a61}function Z$1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=Xq0}function UC($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function X$1($){return!!$&&typeof $=="object"}var L$1=J$1(function($,I,z,q){Y$1(I,F$1(I),$,q)}),D$1=Fq0(function($){return $.push(void 0,z$1),Lq0(L$1,void 0,$)});function F$1($){return qC($)?I$1($,!0):U$1($)}Nq0.exports=D$1});var Aq0=O((jR1,JC)=>{function O$1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Mq0=E4().Buffer,w2=t("util");function N$1($,I,z){$.copy(I,z)}JC.exports=function(){function $(){O$1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var q={data:z,next:null};if(this.length>0)this.tail.next=q;else this.head=q;this.tail=q,++this.length},$.prototype.unshift=function(z){var q={data:z,next:this.head};if(this.length===0)this.tail=q;this.head=q,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var q=this.head,U=""+q.data;while(q=q.next)U+=z+q.data;return U},$.prototype.concat=function(z){if(this.length===0)return Mq0.alloc(0);var q=Mq0.allocUnsafe(z>>>0),U=this.head,Y=0;while(U)N$1(U.data,q,Y),Y+=U.data.length,U=U.next;return q},$}();if(w2&&w2.inspect&&w2.inspect.custom)JC.exports.prototype[w2.inspect.custom]=function(){var $=w2.inspect({length:this.length});return this.constructor.name+" "+$}});var QC=O((vR1,Pq0)=>{var EX=T4();function M$1($,I){var z=this,q=this._readableState&&this._readableState.destroyed,U=this._writableState&&this._writableState.destroyed;if(q||U){if(I)I($);else if($){if(!this._writableState)EX.nextTick(BX,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,EX.nextTick(BX,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Y){if(!I&&Y){if(!z._writableState)EX.nextTick(BX,z,Y);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,EX.nextTick(BX,z,Y)}else if(I)I(Y)}),this}function A$1(){if(this._readableState)this._readable Line truncated
%s`,B,B,T,q);var u=T.type==="*"?dC:T.type==="?"?cC:"\\"+T.type;U=!0,q=q.slice(0,T.reStart)+u+"\\("+B}if(X(),Y)q+="\\\\";var h=!1;switch(q.charAt(0)){case"[":case".":case"(":h=!0}for(var x=Q.length-1;x>-1;x--){var g=Q[x],p=q.slice(0,g.reStart),i=q.slice(g.reStart,g.reEnd-8),S=q.slice(g.reEnd-8,g.reEnd),f=q.slice(g.reEnd);S+=f;var b=p.split("(").length-1,z0=f;for(L=0;L<b;L++)z0=z0.replace(/\)[+*?]?/,"");f=z0;var v="";if(f===""&&I!==iX)v="$";var n=p+i+f+v+S;q=n}if(q!==""&&U)q="(?=.)"+q;if(h)q=W+q;if(I===iX)return[q,U];if(!U)return b71($);var c=z.nocase?"i":"";try{var r=new RegExp("^"+q+"$",c)}catch(U0){return new RegExp("$.")}return r._glob=$,r._src=q,r}F$.makeRe=function($,I){return new R4($,I||{}).makeRe()};R4.prototype.makeRe=n71;function n71(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,z=I.noglobstar?dC:I.dot?C71:h71,q=I.nocase?"i":"",U=$.map(function(Y){return Y.map(function(J){return J===c3?z:typeof J==="string"?i71(J):J._src}).join("\\/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,q)}catch(Y){this.regexp=!1}return this.regexp}F$.match=function($,I,z){z=z||{};var q=new R4(I,z);if($=$.filter(function(U){return q.match(U)}),q.options.nonull&&!$.length)$.push(I);return $};R4.prototype.match=function(I,z){if(typeof z>"u")z=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&z)return!0;var q=this.options;if(N2.sep!=="/")I=I.split(N2.sep).join("/");I=I.split(aU0),this.debug(this.pattern,"split",I);var U=this.set;this.debug(this.pattern,"set",U);var Y,J;for(J=I.length-1;J>=0;J--)if(Y=I[J],Y)break;for(J=0;J<U.length;J++){var Q=U[J],w=I;if(q.matchBase&&Q.length===1)w=[Y];var K=this.matchOne(w,Q,z);if(K){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate};R4.prototype.matchOne=function($,I,z){if(I.indexOf(c3)!==-1)return this._matchGlobstar($,I,z,0,0);return this._matchOne($,I,z,0,0)};R4.prototype._matchGlobstar=function($,I,z,q,U){var Y,J=-1;for(Y=U;Y<I.length;Y++)if(I[Y]===c3){J=Y;break}var Q=-1;for(Y=I.length-1;Y>=0;Y--)if(I[Y]===c3){Q=Y;break}var w=I.slice(U,J),K=z?I.slice(J+1):I.slice(J+1,Q),H=z?[]:I.slice(Q+1);if(w.length){var G=$.slice(q,q+w.length);if(!this._matchOne(G,w,z,0,0))return!1;q+=w.length}var W=0;if(H.length){if(H.length+q>$.length)return!1;var V=$.length-H.length;if(this._matchOne($,H,z,V,0))W=H.length;else{if($[$.length-1]!==""||q+H.length===$.length)return!1;if(V--,!this._matchOne($,H,z,V,0))return!1;W=H.length+1}}if(!K.length){var X=!!W;for(Y=q;Y<$.length-W;Y++){var L=String($[Y]);if(X=!0,L==="."||L===".."||!this.options.dot&&L.charAt(0)===".")return!1}return z||X}var D=[[[],0]],F=D[0],T=0,P=[0];for(var M=0;M<K.length;M++){var B=K[M];if(B===c3)P.push(T),F=[[],0],D.push(F);else F[0].push(B),T++}var u=D.length-1,h=$.length-W;for(var x=0;x<D.length;x++)D[x][1]=h-(P[u--]+D[x][0].length);return!!this._matchGlobStarBodySections($,D,q,0,z,0,!!W)};R4.prototype._matchGlobStarBodySections=function($,I,z,q,U,Y,J){var Q=I[q];if(!Q){for(var w=z;w<$.length;w++){J=!0;var K=$[w];if(K==="."||K===".."||!this.options.dot&&K.charAt(0)===".")return!1}return J}var H=Q[0],G=Q[1];while(z<=G){var W=this._matchOne($.slice(0,z+H.length),H,U,z,0);if(W&&Y<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,z+H.length,q+1,U,Y+1,J);if(V!==!1)return V}var K=$[z];if(K==="."||K===".."||!this.options.dot&&K.charAt(0)===".")return!1;z++}return U||null};R4.prototype._matchOne=function($,I,z,q,U){var Y,J,Q,w;for(Y=q,J=U,Q=$.length,w=I.length;Y<Q&&J<w;Y++,J++){this.debug("matchOne loop");var K=I[J],H=$[Y];if(this.debug(I,K,H),K===!1||K===c3)return!1;var G;if(typeof K==="string")G=H===K,this.debug("string match",K,H,G);else G=H.match(K),this.debug("pattern match",K,H,G);if(!G)return!1}if(Y===Q&&J===w)return!0;else if(Y===Q)return z;else if(J===w)return Y===Q-1&&$[Y]==="";throw Error("wtf?")};function b71($){return $.replace(/\\(.)/g,"$1")}function i71($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var mX=O((lR1,dX)=>{function $Y0($){return $.charAt(0)==="/"}function IY0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=I.exec($),q=z[1]||"",U=Boolean(q&&q.charAt(1)!==":");return Boolean(z[2]||U)}dX.exports=process.platform==="win32"?IY0:$Y0;dX.exports.posix=$Y0;dX.exports.win32=IY0});var lC=O((s71)=>{s71.setopts=o71;s71.ownProp=zY0;s71.makeAbs=M2;s71.finish=r71;s71.mark=t71;s71.isIgnored=UY0;s71.childrenIgnored=a71;function zY0($,I){return Object.prototype.hasOwnProperty.call($,I)}var p71=t("fs"),zU=t("path"),c71=cX(),qY0=mX(),mC=c71.Minimatch;function d71($,I){return $.localeCompare(I,"en")}function m71($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(l71)}function l71($){var I=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");I=new mC(z,{dot:!0})}return{matcher Line truncated
*/Mq0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var q="";if(z>4&&$[3]==="\\"){var U=$[2];if((U==="?"||U===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),q="//"}var Y=$.split(/[/\\]+/);if(I!==!1&&Y[Y.length-1]==="")Y.pop();return q+Y.join("/")}});var QC=O((uR1,vq0)=>{var Pq0=9007199254740991,q$1="[object Arguments]",U$1="[object Function]",Y$1="[object GeneratorFunction]",J$1=/^(?:0|[1-9]\d*)$/;function Tq0($,I,z){switch(z.length){case 0:return $.call(I);case 1:return $.call(I,z[0]);case 2:return $.call(I,z[0],z[1]);case 3:return $.call(I,z[0],z[1],z[2])}return $.apply(I,z)}function Q$1($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}var Q2=Object.prototype,w2=Q2.hasOwnProperty,Eq0=Q2.toString,w$1=Q2.propertyIsEnumerable,Aq0=Math.max;function K$1($,I){var z=O$1($)||F$1($)?Q$1($.length,String):[],q=z.length,U=!!q;for(var Y in $)if((I||w2.call($,Y))&&!(U&&(Y=="length"||jq0(Y,q))))z.push(Y);return z}function H$1($,I,z,q){if($===void 0||UC($,Q2[z])&&!w2.call(q,z))return I;return $}function G$1($,I,z){var q=$[I];if(!(w2.call($,I)&&UC(q,z))||z===void 0&&!(I in $))$[I]=z}function W$1($){if(!JC($))return D$1($);var I=L$1($),z=[];for(var q in $)if(!(q=="constructor"&&(I||!w2.call($,q))))z.push(q);return z}function Bq0($,I){return I=Aq0(I===void 0?$.length-1:I,0),function(){var z=arguments,q=-1,U=Aq0(z.length-I,0),Y=Array(U);while(++q<U)Y[q]=z[I+q];q=-1;var J=Array(I+1);while(++q<I)J[q]=z[q];return J[I]=Y,Tq0($,this,J)}}function V$1($,I,z,q){z||(z={});var U=-1,Y=I.length;while(++U<Y){var J=I[U],Q=q?q(z[J],$[J],J,z,$):void 0;G$1(z,J,Q===void 0?$[J]:Q)}return z}function Z$1($){return Bq0(function(I,z){var q=-1,U=z.length,Y=U>1?z[U-1]:void 0,J=U>2?z[2]:void 0;if(Y=$.length>3&&typeof Y=="function"?(U--,Y):void 0,J&&X$1(z[0],z[1],J))Y=U<3?void 0:Y,U=1;I=Object(I);while(++q<U){var Q=z[q];if(Q)$(I,Q,q,Y)}return I})}function jq0($,I){return I=I==null?Pq0:I,!!I&&(typeof $=="number"||J$1.test($))&&($>-1&&$%1==0&&$<I)}function X$1($,I,z){if(!JC(z))return!1;var q=typeof I;if(q=="number"?YC(z)&&jq0(I,z.length):q=="string"&&(I in z))return UC(z[I],$);return!1}function L$1($){var I=$&&$.constructor,z=typeof I=="function"&&I.prototype||Q2;return $===z}function D$1($){var I=[];if($!=null)for(var z in Object($))I.push(z);return I}function UC($,I){return $===I||$!==$&&I!==I}function F$1($){return N$1($)&&w2.call($,"callee")&&(!w$1.call($,"callee")||Eq0.call($)==q$1)}var O$1=Array.isArray;function YC($){return $!=null&&A$1($.length)&&!M$1($)}function N$1($){return P$1($)&&YC($)}function M$1($){var I=JC($)?Eq0.call($):"";return I==U$1||I==Y$1}function A$1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=Pq0}function JC($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function P$1($){return!!$&&typeof $=="object"}var T$1=Z$1(function($,I,z,q){V$1(I,B$1(I),$,q)}),E$1=Bq0(function($){return $.push(void 0,H$1),Tq0(T$1,void 0,$)});function B$1($){return YC($)?K$1($,!0):W$1($)}vq0.exports=E$1});var Rq0=O((xR1,wC)=>{function j$1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var gq0=E4().Buffer,K2=t("util");function v$1($,I,z){$.copy(I,z)}wC.exports=function(){function $(){j$1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var q={data:z,next:null};if(this.length>0)this.tail.next=q;else this.head=q;this.tail=q,++this.length},$.prototype.unshift=function(z){var q={data:z,next:this.head};if(this.length===0)this.tail=q;this.head=q,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var q=this.head,U=""+q.data;while(q=q.next)U+=z+q.data;return U},$.prototype.concat=function(z){if(this.length===0)return gq0.alloc(0);var q=gq0.allocUnsafe(z>>>0),U=this.head,Y=0;while(U)v$1(U.data,q,Y),Y+=U.data.length,U=U.next;return q},$}();if(K2&&K2.inspect&&K2.inspect.custom)wC.exports.prototype[K2.inspect.custom]=function(){var $=K2.inspect({length:this.length});return this.constructor.name+" "+$}});var KC=O((kR1,_q0)=>{var BX=T4();function g$1($,I){var z=this,q=this._readableState&&this._readableState.destroyed,U=this._writableState&&this._writableState.destroyed;if(q||U){if(I)I($);else if($){if(!this._writableState)BX.nextTick(jX,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,BX.nextTick(jX,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Y){if(!I&&Y){if(!z._writableState)BX.nextTick(jX,z,Y);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,BX.nextTick(jX,z,Y)}else if(I)I(Y)}),this}function R$1(){if(this._readableState)this._readable Line truncated
%s`,j,j,T,q);var u=T.type==="*"?lC:T.type==="?"?mC:"\\"+T.type;U=!0,q=q.slice(0,T.reStart)+u+"\\("+j}if(X(),Y)q+="\\\\";var h=!1;switch(q.charAt(0)){case"[":case".":case"(":h=!0}for(var x=Q.length-1;x>-1;x--){var g=Q[x],p=q.slice(0,g.reStart),i=q.slice(g.reStart,g.reEnd-8),S=q.slice(g.reEnd-8,g.reEnd),f=q.slice(g.reEnd);S+=f;var b=p.split("(").length-1,z0=f;for(L=0;L<b;L++)z0=z0.replace(/\)[+*?]?/,"");f=z0;var v="";if(f===""&&I!==pX)v="$";var n=p+i+f+v+S;q=n}if(q!==""&&U)q="(?=.)"+q;if(h)q=W+q;if(I===pX)return[q,U];if(!U)return r71($);var c=z.nocase?"i":"";try{var r=new RegExp("^"+q+"$",c)}catch(U0){return new RegExp("$.")}return r._glob=$,r._src=q,r}F$.makeRe=function($,I){return new R4($,I||{}).makeRe()};R4.prototype.makeRe=o71;function o71(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,z=I.noglobstar?lC:I.dot?n71:b71,q=I.nocase?"i":"",U=$.map(function(Y){return Y.map(function(J){return J===c3?z:typeof J==="string"?t71(J):J._src}).join("\\/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,q)}catch(Y){this.regexp=!1}return this.regexp}F$.match=function($,I,z){z=z||{};var q=new R4(I,z);if($=$.filter(function(U){return q.match(U)}),q.options.nonull&&!$.length)$.push(I);return $};R4.prototype.match=function(I,z){if(typeof z>"u")z=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&z)return!0;var q=this.options;if(M2.sep!=="/")I=I.split(M2.sep).join("/");I=I.split(YY0),this.debug(this.pattern,"split",I);var U=this.set;this.debug(this.pattern,"set",U);var Y,J;for(J=I.length-1;J>=0;J--)if(Y=I[J],Y)break;for(J=0;J<U.length;J++){var Q=U[J],w=I;if(q.matchBase&&Q.length===1)w=[Y];var K=this.matchOne(w,Q,z);if(K){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate};R4.prototype.matchOne=function($,I,z){if(I.indexOf(c3)!==-1)return this._matchGlobstar($,I,z,0,0);return this._matchOne($,I,z,0,0)};R4.prototype._matchGlobstar=function($,I,z,q,U){var Y,J=-1;for(Y=U;Y<I.length;Y++)if(I[Y]===c3){J=Y;break}var Q=-1;for(Y=I.length-1;Y>=0;Y--)if(I[Y]===c3){Q=Y;break}var w=I.slice(U,J),K=z?I.slice(J+1):I.slice(J+1,Q),H=z?[]:I.slice(Q+1);if(w.length){var G=$.slice(q,q+w.length);if(!this._matchOne(G,w,z,0,0))return!1;q+=w.length}var W=0;if(H.length){if(H.length+q>$.length)return!1;var V=$.length-H.length;if(this._matchOne($,H,z,V,0))W=H.length;else{if($[$.length-1]!==""||q+H.length===$.length)return!1;if(V--,!this._matchOne($,H,z,V,0))return!1;W=H.length+1}}if(!K.length){var X=!!W;for(Y=q;Y<$.length-W;Y++){var L=String($[Y]);if(X=!0,L==="."||L===".."||!this.options.dot&&L.charAt(0)===".")return!1}return z||X}var D=[[[],0]],F=D[0],T=0,P=[0];for(var M=0;M<K.length;M++){var j=K[M];if(j===c3)P.push(T),F=[[],0],D.push(F);else F[0].push(j),T++}var u=D.length-1,h=$.length-W;for(var x=0;x<D.length;x++)D[x][1]=h-(P[u--]+D[x][0].length);return!!this._matchGlobStarBodySections($,D,q,0,z,0,!!W)};R4.prototype._matchGlobStarBodySections=function($,I,z,q,U,Y,J){var Q=I[q];if(!Q){for(var w=z;w<$.length;w++){J=!0;var K=$[w];if(K==="."||K===".."||!this.options.dot&&K.charAt(0)===".")return!1}return J}var H=Q[0],G=Q[1];while(z<=G){var W=this._matchOne($.slice(0,z+H.length),H,U,z,0);if(W&&Y<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,z+H.length,q+1,U,Y+1,J);if(V!==!1)return V}var K=$[z];if(K==="."||K===".."||!this.options.dot&&K.charAt(0)===".")return!1;z++}return U||null};R4.prototype._matchOne=function($,I,z,q,U){var Y,J,Q,w;for(Y=q,J=U,Q=$.length,w=I.length;Y<Q&&J<w;Y++,J++){this.debug("matchOne loop");var K=I[J],H=$[Y];if(this.debug(I,K,H),K===!1||K===c3)return!1;var G;if(typeof K==="string")G=H===K,this.debug("string match",K,H,G);else G=H.match(K),this.debug("pattern match",K,H,G);if(!G)return!1}if(Y===Q&&J===w)return!0;else if(Y===Q)return z;else if(J===w)return Y===Q-1&&$[Y]==="";throw Error("wtf?")};function r71($){return $.replace(/\\(.)/g,"$1")}function t71($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var lX=O((q_1,mX)=>{function wY0($){return $.charAt(0)==="/"}function KY0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=I.exec($),q=z[1]||"",U=Boolean(q&&q.charAt(1)!==":");return Boolean(z[2]||U)}mX.exports=process.platform==="win32"?KY0:wY0;mX.exports.posix=wY0;mX.exports.win32=KY0});var rC=O((J31)=>{J31.setopts=z31;J31.ownProp=HY0;J31.makeAbs=A2;J31.finish=q31;J31.mark=U31;J31.isIgnored=WY0;J31.childrenIgnored=Y31;function HY0($,I){return Object.prototype.hasOwnProperty.call($,I)}var a71=t("fs"),zU=t("path"),s71=dX(),GY0=lX(),oC=s71.Minimatch;function e71($,I){return $.localeCompare(I,"en")}function $31($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(I31)}function I31($){var I=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");I=new oC(z,{dot:!0})}return{matcher Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new x4($,I).found}function x4($,I){if(!$)throw Error("must provide pattern");if(typeof I==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))return new x4($,I);if(Q31(this,$,I),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var q=0;q<z;q++)this._process(this.minimatch.set[q],q,!1);this._finish()}x4.prototype._finish=function(){if(JY0.ok(this instanceof x4),this.realpath){var $=this;this.matches.forEach(function(I,z){var q=$.matches[z]=Object.create(null);for(var U in I)try{U=$._makeAbs(U);var Y=J31.realpathSync(U,$.realpathCache);q[Y]=!0}catch(J){if(J.syscall==="stat")q[$._makeAbs(U)]=!0;else throw J}})}d3.finish(this)};x4.prototype._process=function($,I,z){JY0.ok(this instanceof x4);var q=0;while(typeof $[q]==="string")q++;var U;switch(q){case $.length:this._processSimple($.join("/"),I);return;case 0:U=null;break;default:U=$.slice(0,q).join("/");break}var Y=$.slice(q),J;if(U===null)J=".";else if(lX(U)||lX($.map(function(K){return typeof K==="string"?K:"[*]"}).join("/"))){if(!U||!lX(U))U="/"+U;J=U}else J=U;var Q=this._makeAbs(J);if(w31(this,J))return;var w=Y[0]===YY0.GLOBSTAR;if(w)this._processGlobStar(U,J,Q,Y,I,z);else this._processReaddir(U,J,Q,Y,I,z)};x4.prototype._processReaddir=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q[0],w=!!this.minimatch.negate,K=Q._glob,H=this.dot||K.charAt(0)===".",G=[];for(var W=0;W<J.length;W++){var V=J[W];if(V.charAt(0)!=="."||H){var X;if(w&&!$)X=!V.match(Q);else X=V.match(Q);if(X)G.push(V)}}var L=G.length;if(L===0)return;if(q.length===1&&!this.mark&&!this.stat){if(!this.matches[U])this.matches[U]=Object.create(null);for(var W=0;W<L;W++){var V=G[W];if($)if($.slice(-1)!=="/")V=$+"/"+V;else V=$+V;if(V.charAt(0)==="/"&&!this.nomount)V=oC.join(this.root,V);this._emitMatch(U,V)}return}q.shift();for(var W=0;W<L;W++){var V=G[W],D;if($)D=[$,V];else D=[V];this._process(D.concat(q),U,Y)}};x4.prototype._emitMatch=function($,I){if(K31(this,I))return;var z=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=z;if(this.matches[$][I])return;if(this.nodir){var q=this.cache[z];if(q==="DIR"||Array.isArray(q))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};x4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,z,q;try{z=this.fs.lstatSync($)}catch(Y){if(Y.code==="ENOENT")return null}var U=z&&z.isSymbolicLink();if(this.symlinks[$]=U,!U&&z&&!z.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};x4.prototype._readdir=function($,I){var z;if(I&&!rC(this.symlinks,$))return this._readdirInGlobStar($);if(rC(this.cache,$)){var q=this.cache[$];if(!q||q==="FILE")return null;if(Array.isArray(q))return q}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(U){return this._readdirError($,U),null}};x4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var z=0;z<I.length;z++){var q=I[z];if($==="/")q=$+q;else q=$+"/"+q;this.cache[q]=!0}return this.cache[$]=I,I};x4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var q=Error(I.code+" invalid cwd "+this.cwd);throw q.path=this.cwd,q.code=I.code,q}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw I;if(!this.silent)console.error("glob error",I);break}};x4.prototype._processGlobStar=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q.slice(1),w=$?[$]:[],K=w.concat(Q);this._process(K,U,!1);var H=J.length,G=this.symlinks[z];if(G&&Y)return;for(var W=0;W<H;W++){var V=J[W];if(V.charAt(0)==="."&&!this.dot)continue;var X=w.concat(J[W],Q);this._process(X,U,!0);var L=w.concat(J[W],q);this._process(L,U,!0)}};x4.prototype._processSimple=function($,I){var z=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!z)return;if($&&lX($)&&!this.nomount){var q=/[\/\\]$/.test($);if($.charAt(0)==="/")$=oC.join(this.root,$);else if($=oC.resolve(this.root,$),q)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};x4.prototype._stat=function($){var I=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&rC(this.cache,I)){var J=this.cache[I];if(Array.isArray(J))J="DIR";if(!z||J==="DIR")return J;if(z&&J==="FILE")return!1}var q,U=this.statCache[I];if(!U){var Y;try{Y=this.fs.lstatSync(I)}catch(Q){if(Q&&(Q.code==="ENOENT"||Q.code==="ENOTDIR"))return this.statCache[I]=!1,!1}if(Y&&Y.isSymbolicLink())try{U=this.fs.statSync(I)}catch(Q){U=Y}else U=Y}this.statCache[I]=U;var J=!0;if(U)J=U.isDirectory()?"DIR":"FILE";if(this.cache[I]=this.cache[I]||J,z&&J==="FILE")return!1;return J};x4.prototype._mark=function($){return d3.mark(this,$)};x4.prototype._makeAbs=function($){return d3.makeAbs(this,$)}});var tC=O((eR1,GY0)=>{GY0.exports=HY0;function HY0($,I){if($&&I)return HY0($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(q){z[q]=$[q]}),z;f Line truncated
`);if($.linkname)I+=vh(" linkpath="+$.linkname+`
`);var z=$.pax;if(z)for(var q in z)I+=vh(" "+q+"="+z[q]+`
`);return Buffer.from(I)};EI1.decodePax=function($){var I={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var q=parseInt($.slice(0,z).toString(),10);if(!q)return I;var U=$.slice(z+1,q-1).toString(),Y=U.indexOf("=");if(Y===-1)return I;I[U.slice(0,Y)]=U.slice(Y+1),$=$.slice(q)}return I};EI1.encode=function($){var I=ZI1(512),z=$.name,q="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var U=z.indexOf("/");if(U===-1)return null;q+=q?"/"+z.slice(0,U):z.slice(0,U),z=z.slice(U+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(q)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(z),I.write(V7($.mode&NI1,6),100),I.write(V7($.uid,6),108),I.write(V7($.gid,6),116),I.write(V7($.size,11),124),I.write(V7($.mtime.getTime()/1000|0,11),136),I[156]=gJ0+PI1($.type),$.linkname)I.write($.linkname,157);if(RJ0.copy(I,j2),DI1.copy(I,gh),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write(V7($.devmajor||0,6),329),I.write(V7($.devminor||0,6),337),q)I.write(q,345);return I.write(V7(CJ0(I),6),148),I};EI1.decode=function($,I,z){var q=$[156]===0?0:$[156]-gJ0,U=JU($,0,100,I),Y=Z7($,100,8),J=Z7($,108,8),Q=Z7($,116,8),w=Z7($,124,12),K=Z7($,136,12),H=AI1(q),G=$[157]===0?null:JU($,157,100,I),W=JU($,265,32),V=JU($,297,32),X=Z7($,329,8),L=Z7($,337,8),D=CJ0($);if(D===256)return null;if(D!==Z7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(RJ0.compare($,j2,j2+6)===0){if($[345])U=JU($,345,155,I)+"/"+U}else if(FI1.compare($,j2,j2+6)===0&&OI1.compare($,gh,gh+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(q===0&&U&&U[U.length-1]==="/")q=5;return{name:U,mode:Y,uid:J,gid:Q,size:w,mtime:new Date(1000*K),type:H,linkname:G,uname:W,gname:V,devmajor:X,devminor:L}}});var fJ0=O((S_1,kJ0)=>{var SJ0=t("util"),_I1=vJ0(),v2=Rh(),yJ0=F6().Writable,uJ0=F6().PassThrough,xJ0=function(){},hJ0=function($){return $&=511,$&&512-$},CI1=function($,I){var z=new $L($,I);return z.end(),z},hI1=function($,I){if(I.path)$.name=I.path;if(I.linkpath)$.linkname=I.linkpath;if(I.size)$.size=parseInt(I.size,10);return $.pax=I,$},$L=function($,I){this._parent=$,this.offset=I,uJ0.call(this,{autoDestroy:!1})};SJ0.inherits($L,uJ0);$L.prototype.destroy=function($){this._parent.destroy($)};var f5=function($){if(!(this instanceof f5))return new f5($);yJ0.call(this,$),$=$||{},this._offset=0,this._buffer=_I1(),this._missing=0,this._partial=!1,this._onparse=xJ0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var I=this,z=I._buffer,q=function(){I._continue()},U=function(W){if(I._locked=!1,W)return I.destroy(W);if(!I._stream)q()},Y=function(){I._stream=null;var W=hJ0(I._header.size);if(W)I._parse(W,J);else I._parse(512,G);if(!I._locked)q()},J=function(){I._buffer.consume(hJ0(I._header.size)),I._parse(512,G),q()},Q=function(){var W=I._header.size;I._paxGlobal=v2.decodePax(z.slice(0,W)),z.consume(W),Y()},w=function(){var W=I._header.size;if(I._pax=v2.decodePax(z.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);z.consume(W),Y()},K=function(){var W=I._header.size;this._gnuLongPath=v2.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},H=function(){var W=I._header.size;this._gnuLongLinkPath=v2.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},G=function(){var W=I._offset,V;try{V=I._header=v2.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(z.consume(512),!V){I._parse(512,G),q();return}if(V.type==="gnu-long-path"){I._parse(V.size,K),q();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,H),q();return}if(V.type==="pax-global-header"){I._parse(V.size,Q),q();return}if(V.type==="pax-header"){I._parse(V.size,w),q();return}if(I._gnuLongPath)V.name=I._gnuLongPath,I._gnuLongPath=null;if(I._gnuLongLinkPath)V.linkname=I._gnuLongLinkPath,I._gnuLongLinkPath=null;if(I._pax)I._header=V=hI1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,G),I.emit("entry",V,CI1(I,W),U);return}I._stream=new $L(I,W),I.emit("entry",V,I._stream,U),I._parse(V.size,Y),q()};this._onheader=G,this._parse(512,G)};SJ0.inherits(f5,yJ0);f5.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};f5.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};f5.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=xJ0,this._overflow)this._write(this._overflow,void 0,$);else $()};f5.prototype._write=function($,I,z){if(this._destroyed)return;var q=this._stream,U=this._buffer,Y=this._missing;if($.length)this._partial=!0;if($.length<Y){ Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let I=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${sI1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}GQ0.exports=HQ0});var DQ0=O((c_1,LQ0)=>{var VQ0=q6(),ZQ0=t9(),$z1=G4(),Iz1=KR(),zz1=GR();class XQ0{constructor($,I,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=I}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:ZQ0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:ZQ0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(I)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,I){let z=new Iz1,q=new VQ0;z.render(q,$),this.commentsStream.write(q.xml);let U=new zz1,Y=new VQ0;U.render(Y,$,I),this.vmlStream.write(Y.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((I)=>{I.refAddress=$z1.decodeAddress(I.ref)}),$.forEach((I)=>{this._writeComment(I,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}LQ0.exports=XQ0});var PQ0=O((d_1,AQ0)=>{var qz1=F4(),Uz1=t9(),hh=G4(),FQ0=jB(),OQ0=D5(),Yz1=iv(),NQ0=FW(),Sh=NW(),Jz1=WQ0(),Qz1=DQ0(),wz1=EB(),c4=new Yz1,yh=l9(),Kz1=xg(),Hz1=kg(),Gz1=fg(),Wz1=hg(),Vz1=_g(),Zz1=Sg(),Xz1=ng(),Lz1=bg(),Dz1=ig(),Fz1=pg(),Oz1=cg(),Nz1=dg(),Mz1=tg(),Az1=lg(),Pz1=mg(),d4={dataValidations:new Kz1,sheetProperties:new Hz1,sheetFormatProperties:new Gz1,columns:new yh({tag:"cols",length:!1,childXform:new Wz1}),row:new Vz1,hyperlinks:new yh({tag:"hyperlinks",length:!1,childXform:new Zz1}),sheetViews:new yh({tag:"sheetViews",length:!1,childXform:new Xz1}),sheetProtection:new Lz1,pageMargins:new Dz1,pageSeteup:new Fz1,autoFilter:new Oz1,picture:new Nz1,conditionalFormattings:new Mz1,headerFooter:new Az1,rowBreaks:new Pz1};class MQ0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new Jz1($),this._sheetCommentsWriter=new Qz1(this,this._sheetRelsWriter,$),this._dimensions=new OQ0,this._rowZero=1,this.committed=!1,this.dataValidations=new wz1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))return new x4($,I);if(X31(this,$,I),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var q=0;q<z;q++)this._process(this.minimatch.set[q],q,!1);this._finish()}x4.prototype._finish=function(){if(ZY0.ok(this instanceof x4),this.realpath){var $=this;this.matches.forEach(function(I,z){var q=$.matches[z]=Object.create(null);for(var U in I)try{U=$._makeAbs(U);var Y=Z31.realpathSync(U,$.realpathCache);q[Y]=!0}catch(J){if(J.syscall==="stat")q[$._makeAbs(U)]=!0;else throw J}})}d3.finish(this)};x4.prototype._process=function($,I,z){ZY0.ok(this instanceof x4);var q=0;while(typeof $[q]==="string")q++;var U;switch(q){case $.length:this._processSimple($.join("/"),I);return;case 0:U=null;break;default:U=$.slice(0,q).join("/");break}var Y=$.slice(q),J;if(U===null)J=".";else if(oX(U)||oX($.map(function(K){return typeof K==="string"?K:"[*]"}).join("/"))){if(!U||!oX(U))U="/"+U;J=U}else J=U;var Q=this._makeAbs(J);if(L31(this,J))return;var w=Y[0]===VY0.GLOBSTAR;if(w)this._processGlobStar(U,J,Q,Y,I,z);else this._processReaddir(U,J,Q,Y,I,z)};x4.prototype._processReaddir=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q[0],w=!!this.minimatch.negate,K=Q._glob,H=this.dot||K.charAt(0)===".",G=[];for(var W=0;W<J.length;W++){var V=J[W];if(V.charAt(0)!=="."||H){var X;if(w&&!$)X=!V.match(Q);else X=V.match(Q);if(X)G.push(V)}}var L=G.length;if(L===0)return;if(q.length===1&&!this.mark&&!this.stat){if(!this.matches[U])this.matches[U]=Object.create(null);for(var W=0;W<L;W++){var V=G[W];if($)if($.slice(-1)!=="/")V=$+"/"+V;else V=$+V;if(V.charAt(0)==="/"&&!this.nomount)V=tC.join(this.root,V);this._emitMatch(U,V)}return}q.shift();for(var W=0;W<L;W++){var V=G[W],D;if($)D=[$,V];else D=[V];this._process(D.concat(q),U,Y)}};x4.prototype._emitMatch=function($,I){if(D31(this,I))return;var z=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=z;if(this.matches[$][I])return;if(this.nodir){var q=this.cache[z];if(q==="DIR"||Array.isArray(q))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};x4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,z,q;try{z=this.fs.lstatSync($)}catch(Y){if(Y.code==="ENOENT")return null}var U=z&&z.isSymbolicLink();if(this.symlinks[$]=U,!U&&z&&!z.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};x4.prototype._readdir=function($,I){var z;if(I&&!aC(this.symlinks,$))return this._readdirInGlobStar($);if(aC(this.cache,$)){var q=this.cache[$];if(!q||q==="FILE")return null;if(Array.isArray(q))return q}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(U){return this._readdirError($,U),null}};x4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var z=0;z<I.length;z++){var q=I[z];if($==="/")q=$+q;else q=$+"/"+q;this.cache[q]=!0}return this.cache[$]=I,I};x4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var q=Error(I.code+" invalid cwd "+this.cwd);throw q.path=this.cwd,q.code=I.code,q}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw I;if(!this.silent)console.error("glob error",I);break}};x4.prototype._processGlobStar=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q.slice(1),w=$?[$]:[],K=w.concat(Q);this._process(K,U,!1);var H=J.length,G=this.symlinks[z];if(G&&Y)return;for(var W=0;W<H;W++){var V=J[W];if(V.charAt(0)==="."&&!this.dot)continue;var X=w.concat(J[W],Q);this._process(X,U,!0);var L=w.concat(J[W],q);this._process(L,U,!0)}};x4.prototype._processSimple=function($,I){var z=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!z)return;if($&&oX($)&&!this.nomount){var q=/[\/\\]$/.test($);if($.charAt(0)==="/")$=tC.join(this.root,$);else if($=tC.resolve(this.root,$),q)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};x4.prototype._stat=function($){var I=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&aC(this.cache,I)){var J=this.cache[I];if(Array.isArray(J))J="DIR";if(!z||J==="DIR")return J;if(z&&J==="FILE")return!1}var q,U=this.statCache[I];if(!U){var Y;try{Y=this.fs.lstatSync(I)}catch(Q){if(Q&&(Q.code==="ENOENT"||Q.code==="ENOTDIR"))return this.statCache[I]=!1,!1}if(Y&&Y.isSymbolicLink())try{U=this.fs.statSync(I)}catch(Q){U=Y}else U=Y}this.statCache[I]=U;var J=!0;if(U)J=U.isDirectory()?"DIR":"FILE";if(this.cache[I]=this.cache[I]||J,z&&J==="FILE")return!1;return J};x4.prototype._mark=function($){return d3.mark(this,$)};x4.prototype._makeAbs=function($){return d3.makeAbs(this,$)}});var sC=O((K_1,OY0)=>{OY0.exports=FY0;function FY0($,I){if($&&I)return FY0($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(q){z[q]=$[q]}),z;f Line truncated
`);if($.linkname)I+=Rh(" linkpath="+$.linkname+`
`);var z=$.pax;if(z)for(var q in z)I+=Rh(" "+q+"="+z[q]+`
`);return Buffer.from(I)};hI1.decodePax=function($){var I={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var q=parseInt($.slice(0,z).toString(),10);if(!q)return I;var U=$.slice(z+1,q-1).toString(),Y=U.indexOf("=");if(Y===-1)return I;I[U.slice(0,Y)]=U.slice(Y+1),$=$.slice(q)}return I};hI1.encode=function($){var I=AI1(512),z=$.name,q="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var U=z.indexOf("/");if(U===-1)return null;q+=q?"/"+z.slice(0,U):z.slice(0,U),z=z.slice(U+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(q)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(z),I.write(V7($.mode&vI1,6),100),I.write(V7($.uid,6),108),I.write(V7($.gid,6),116),I.write(V7($.size,11),124),I.write(V7($.mtime.getTime()/1000|0,11),136),I[156]=xJ0+_I1($.type),$.linkname)I.write($.linkname,157);if(kJ0.copy(I,v2),EI1.copy(I,_h),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write(V7($.devmajor||0,6),329),I.write(V7($.devminor||0,6),337),q)I.write(q,345);return I.write(V7(nJ0(I),6),148),I};hI1.decode=function($,I,z){var q=$[156]===0?0:$[156]-xJ0,U=JU($,0,100,I),Y=Z7($,100,8),J=Z7($,108,8),Q=Z7($,116,8),w=Z7($,124,12),K=Z7($,136,12),H=RI1(q),G=$[157]===0?null:JU($,157,100,I),W=JU($,265,32),V=JU($,297,32),X=Z7($,329,8),L=Z7($,337,8),D=nJ0($);if(D===256)return null;if(D!==Z7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(kJ0.compare($,v2,v2+6)===0){if($[345])U=JU($,345,155,I)+"/"+U}else if(BI1.compare($,v2,v2+6)===0&&jI1.compare($,_h,_h+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(q===0&&U&&U[U.length-1]==="/")q=5;return{name:U,mode:Y,uid:J,gid:Q,size:w,mtime:new Date(1000*K),type:H,linkname:G,uname:W,gname:V,devmajor:X,devminor:L}}});var lJ0=O((c_1,mJ0)=>{var iJ0=t("util"),fI1=uJ0(),g2=Ch(),pJ0=F6().Writable,cJ0=F6().PassThrough,dJ0=function(){},bJ0=function($){return $&=511,$&&512-$},nI1=function($,I){var z=new IL($,I);return z.end(),z},bI1=function($,I){if(I.path)$.name=I.path;if(I.linkpath)$.linkname=I.linkpath;if(I.size)$.size=parseInt(I.size,10);return $.pax=I,$},IL=function($,I){this._parent=$,this.offset=I,cJ0.call(this,{autoDestroy:!1})};iJ0.inherits(IL,cJ0);IL.prototype.destroy=function($){this._parent.destroy($)};var f5=function($){if(!(this instanceof f5))return new f5($);pJ0.call(this,$),$=$||{},this._offset=0,this._buffer=fI1(),this._missing=0,this._partial=!1,this._onparse=dJ0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var I=this,z=I._buffer,q=function(){I._continue()},U=function(W){if(I._locked=!1,W)return I.destroy(W);if(!I._stream)q()},Y=function(){I._stream=null;var W=bJ0(I._header.size);if(W)I._parse(W,J);else I._parse(512,G);if(!I._locked)q()},J=function(){I._buffer.consume(bJ0(I._header.size)),I._parse(512,G),q()},Q=function(){var W=I._header.size;I._paxGlobal=g2.decodePax(z.slice(0,W)),z.consume(W),Y()},w=function(){var W=I._header.size;if(I._pax=g2.decodePax(z.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);z.consume(W),Y()},K=function(){var W=I._header.size;this._gnuLongPath=g2.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},H=function(){var W=I._header.size;this._gnuLongLinkPath=g2.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},G=function(){var W=I._offset,V;try{V=I._header=g2.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(z.consume(512),!V){I._parse(512,G),q();return}if(V.type==="gnu-long-path"){I._parse(V.size,K),q();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,H),q();return}if(V.type==="pax-global-header"){I._parse(V.size,Q),q();return}if(V.type==="pax-header"){I._parse(V.size,w),q();return}if(I._gnuLongPath)V.name=I._gnuLongPath,I._gnuLongPath=null;if(I._gnuLongLinkPath)V.linkname=I._gnuLongLinkPath,I._gnuLongLinkPath=null;if(I._pax)I._header=V=bI1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,G),I.emit("entry",V,nI1(I,W),U);return}I._stream=new IL(I,W),I.emit("entry",V,I._stream,U),I._parse(V.size,Y),q()};this._onheader=G,this._parse(512,G)};iJ0.inherits(f5,pJ0);f5.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};f5.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};f5.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=dJ0,this._overflow)this._write(this._overflow,void 0,$);else $()};f5.prototype._write=function($,I,z){if(this._destroyed)return;var q=this._stream,U=this._buffer,Y=this._missing;if($.length)this._partial=!0;if($.length<Y){ Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let I=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${Jz1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}OQ0.exports=FQ0});var EQ0=O(($C1,TQ0)=>{var MQ0=q6(),AQ0=t9(),wz1=G4(),Kz1=GR(),Hz1=VR();class PQ0{constructor($,I,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=I}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:AQ0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:AQ0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(I)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,I){let z=new Kz1,q=new MQ0;z.render(q,$),this.commentsStream.write(q.xml);let U=new Hz1,Y=new MQ0;U.render(Y,$,I),this.vmlStream.write(Y.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((I)=>{I.refAddress=wz1.decodeAddress(I.ref)}),$.forEach((I)=>{this._writeComment(I,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}TQ0.exports=PQ0});var _Q0=O((IC1,RQ0)=>{var Gz1=F4(),Wz1=t9(),yh=G4(),BQ0=gB(),jQ0=D5(),Vz1=cv(),vQ0=OW(),uh=MW(),Zz1=NQ0(),Xz1=EQ0(),Lz1=jB(),c4=new Vz1,xh=l9(),Dz1=fg(),Fz1=ng(),Oz1=bg(),Nz1=yg(),Mz1=hg(),Az1=ug(),Pz1=ig(),Tz1=pg(),Ez1=cg(),Bz1=dg(),jz1=mg(),vz1=lg(),gz1=sg(),Rz1=rg(),_z1=og(),d4={dataValidations:new Dz1,sheetProperties:new Fz1,sheetFormatProperties:new Oz1,columns:new xh({tag:"cols",length:!1,childXform:new Nz1}),row:new Mz1,hyperlinks:new xh({tag:"hyperlinks",length:!1,childXform:new Az1}),sheetViews:new xh({tag:"sheetViews",length:!1,childXform:new Pz1}),sheetProtection:new Tz1,pageMargins:new Ez1,pageSeteup:new Bz1,autoFilter:new jz1,picture:new vz1,conditionalFormattings:new gz1,headerFooter:new Rz1,rowBreaks:new _z1};class gQ0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new Zz1($),this._sheetCommentsWriter=new Xz1(this,this._sheetRelsWriter,$),this._dimensions=new jQ0,this._rowZero=1,this.committed=!1,this.dataValidations=new Lz1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get Line truncated
See http://goo.gl/MqrFmX
`)},eh=$S.getNativePromise();if($S.isNode&&typeof MutationObserver>"u")IS=global.setImmediate,zS=process.nextTick,e3=$S.isRecentNode?function($){IS.call(global,$)}:function($){zS.call(process,$)};else if(typeof eh==="function"&&typeof eh.resolve==="function")qS=eh.resolve(),e3=function($){qS.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))e3=function(){var $=document.createElement("div"),I={attributes:!0},z=!1,q=document.createElement("div"),U=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});U.observe(q,I);var Y=function(){if(z)return;z=!0,q.classList.toggle("foo")};return function(Q){var w=new MutationObserver(function(){w.disconnect(),Q()});w.observe($,I),Y()}}();else if(typeof setImmediate<"u")e3=function($){setImmediate($)};else if(typeof setTimeout<"u")e3=function($){setTimeout($,0)};else e3=Zq1;var IS,zS,qS;z20.exports=e3});var Y20=O((qC1,U20)=>{function Xq1($,I,z,q,U){for(var Y=0;Y<U;++Y)z[Y+q]=$[Y+I],$[Y+I]=void 0}function D7($){this._capacity=$,this._length=0,this._front=0}D7.prototype._willBeOverCapacity=function($){return this._capacity<$};D7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var z=this._front+I&this._capacity-1;this[z]=$,this._length=I+1};D7.prototype.push=function($,I,z){var q=this.length()+3;if(this._willBeOverCapacity(q)){this._pushOne($),this._pushOne(I),this._pushOne(z);return}var U=this._front+q-3;this._checkCapacity(q);var Y=this._capacity-1;this[U+0&Y]=$,this[U+1&Y]=I,this[U+2&Y]=z,this._length=q};D7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};D7.prototype.length=function(){return this._length};D7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};D7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var z=this._front,q=this._length,U=z+q&I-1;Xq1(this,0,this,I,U)};U20.exports=D7});var W20=O((UC1,US)=>{var H20;try{throw Error()}catch($){H20=$}var Lq1=q20(),J20=Y20(),G20=d1();function m4(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new J20(16),this._normalQueue=new J20(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=Lq1}m4.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};m4.prototype.hasCustomScheduler=function(){return this._customScheduler};m4.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};m4.prototype.disableTrampolineIfNecessary=function(){if(G20.hasDevTools)this._trampolineEnabled=!1};m4.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};m4.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`)},IS=zS.getNativePromise();if(zS.isNode&&typeof MutationObserver>"u")qS=global.setImmediate,US=process.nextTick,e3=zS.isRecentNode?function($){qS.call(global,$)}:function($){US.call(process,$)};else if(typeof IS==="function"&&typeof IS.resolve==="function")YS=IS.resolve(),e3=function($){YS.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))e3=function(){var $=document.createElement("div"),I={attributes:!0},z=!1,q=document.createElement("div"),U=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});U.observe(q,I);var Y=function(){if(z)return;z=!0,q.classList.toggle("foo")};return function(Q){var w=new MutationObserver(function(){w.disconnect(),Q()});w.observe($,I),Y()}}();else if(typeof setImmediate<"u")e3=function($){setImmediate($)};else if(typeof setTimeout<"u")e3=function($){setTimeout($,0)};else e3=Aq1;var qS,US,YS;H20.exports=e3});var V20=O((VC1,W20)=>{function Pq1($,I,z,q,U){for(var Y=0;Y<U;++Y)z[Y+q]=$[Y+I],$[Y+I]=void 0}function D7($){this._capacity=$,this._length=0,this._front=0}D7.prototype._willBeOverCapacity=function($){return this._capacity<$};D7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var z=this._front+I&this._capacity-1;this[z]=$,this._length=I+1};D7.prototype.push=function($,I,z){var q=this.length()+3;if(this._willBeOverCapacity(q)){this._pushOne($),this._pushOne(I),this._pushOne(z);return}var U=this._front+q-3;this._checkCapacity(q);var Y=this._capacity-1;this[U+0&Y]=$,this[U+1&Y]=I,this[U+2&Y]=z,this._length=q};D7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};D7.prototype.length=function(){return this._length};D7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};D7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var z=this._front,q=this._length,U=z+q&I-1;Pq1(this,0,this,I,U)};W20.exports=D7});var N20=O((ZC1,JS)=>{var F20;try{throw Error()}catch($){F20=$}var Tq1=G20(),Z20=V20(),O20=d1();function m4(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new Z20(16),this._normalQueue=new Z20(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=Tq1}m4.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};m4.prototype.hasCustomScheduler=function(){return this._customScheduler};m4.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};m4.prototype.disableTrampolineIfNecessary=function(){if(O20.hasDevTools)this._trampolineEnabled=!1};m4.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};m4.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};m4.prototype.throwLater=function($,I){if(arguments.length===1)I=$,$=function(){throw I};if(typeof setTimeout<"u")setTimeout(function(){$(I)},0);else try{this._schedule(function(){$(I)})}catch(z){throw Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function Q20($,I,z){this._lateQueue.push($,I,z),this._queueTick()}function w20($,I,z){this._normalQueue.push($,I,z),this._queueTick()}function K20($){this._normalQueue._pushOne($),this._queueTick()}if(!G20.hasDevTools)m4.prototype.invokeLater=Q20,m4.prototype.invoke=w20,m4.prototype.settlePromises=K20;else m4.prototype.invokeLater=function($,I,z){if(this._trampolineEnabled)Q20.call(this,$,I,z);else this._schedule(function(){setTimeout(function(){$.call(I,z)},100)})},m4.prototype.invoke=function($,I,z){if(this._trampolineEnabled)w20.call(this,$,I,z);else this._schedule(function(){$.call(I,z)})},m4.prototype.settlePromises=function($){if(this._trampolineEnabled)K20.call(this,$);else this._schedule(function(){$._settlePromises()})};m4.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var z=$.shift(),q=$.shift();I.call(z,q)}};m4.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};m4.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};m4.prototype._reset=function(){this._isTickUsed=!1};US.exports=m4;US.exports.firstLineError=H20});var b5=O((YC1,X20)=>{var QS=s3(),Dq1=QS.freeze,V20=d1(),Z20=V20.inherits,GU=V20.notEnumerableProp;function WU($,I){function z(q){if(!(this instanceof z))return new z(q);if(GU(this,"message",typeof q==="string"?q:I),GU(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return Z20(z,Error),z}var YS,JS,Fq1=WU("Warning","warning"),Oq1=WU("CancellationError","cancellation error"),Nq1=WU("TimeoutError","timeout error"),S2=WU("AggregateError","aggregate error");try{YS=TypeError,JS=RangeError}catch($){YS=WU("TypeError","type error"),JS=WU("RangeError","range error")}var KL="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for($I=0;$I<KL.length;++$I)if(typeof Array.prototype[KL[$I]]==="function")S2.prototype[KL[$I]]=Array.prototype[KL[$I]];var $I;QS.defineProperty(S2.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});S2.prototype.isOperational=!0;var HL=0;S2.prototype.toString=function(){var $=Array(HL*4+1).join(" "),I=`
`)}};function X20($,I,z){this._lateQueue.push($,I,z),this._queueTick()}function L20($,I,z){this._normalQueue.push($,I,z),this._queueTick()}function D20($){this._normalQueue._pushOne($),this._queueTick()}if(!O20.hasDevTools)m4.prototype.invokeLater=X20,m4.prototype.invoke=L20,m4.prototype.settlePromises=D20;else m4.prototype.invokeLater=function($,I,z){if(this._trampolineEnabled)X20.call(this,$,I,z);else this._schedule(function(){setTimeout(function(){$.call(I,z)},100)})},m4.prototype.invoke=function($,I,z){if(this._trampolineEnabled)L20.call(this,$,I,z);else this._schedule(function(){$.call(I,z)})},m4.prototype.settlePromises=function($){if(this._trampolineEnabled)D20.call(this,$);else this._schedule(function(){$._settlePromises()})};m4.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var z=$.shift(),q=$.shift();I.call(z,q)}};m4.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};m4.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};m4.prototype._reset=function(){this._isTickUsed=!1};JS.exports=m4;JS.exports.firstLineError=F20});var b5=O((XC1,P20)=>{var KS=s3(),Eq1=KS.freeze,M20=d1(),A20=M20.inherits,GU=M20.notEnumerableProp;function WU($,I){function z(q){if(!(this instanceof z))return new z(q);if(GU(this,"message",typeof q==="string"?q:I),GU(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return A20(z,Error),z}var QS,wS,Bq1=WU("Warning","warning"),jq1=WU("CancellationError","cancellation error"),vq1=WU("TimeoutError","timeout error"),y2=WU("AggregateError","aggregate error");try{QS=TypeError,wS=RangeError}catch($){QS=WU("TypeError","type error"),wS=WU("RangeError","range error")}var HL="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for($I=0;$I<HL.length;++$I)if(typeof Array.prototype[HL[$I]]==="function")y2.prototype[HL[$I]]=Array.prototype[HL[$I]];var $I;KS.defineProperty(y2.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});y2.prototype.isOperational=!0;var GL=0;y2.prototype.toString=function(){var $=Array(GL*4+1).join(" "),I=`
`+$+`AggregateError of:
`;HL++,$=Array(HL*4+1).join(" ");for(var z=0;z<this.length;++z){var q=this[z]===this?"[Circular AggregateError]":this[z]+"",U=q.split(`
`;GL++,$=Array(GL*4+1).join(" ");for(var z=0;z<this.length;++z){var q=this[z]===this?"[Circular AggregateError]":this[z]+"",U=q.split(`
`);for(var Y=0;Y<U.length;++Y)U[Y]=$+U[Y];q=U.join(`
`),I+=q+`
`}return HL--,I};function h2($){if(!(this instanceof h2))return new h2($);if(GU(this,"name","OperationalError"),GU(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)GU(this,"message",$.message),GU(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}Z20(h2,Error);var II=Error.__BluebirdErrorTypes__;if(!II)II=Dq1({CancellationError:Oq1,TimeoutError:Nq1,OperationalError:h2,RejectionError:h2,AggregateError:S2}),QS.defineProperty(Error,"__BluebirdErrorTypes__",{value:II,writable:!1,enumerable:!1,configurable:!1});X20.exports={Error,TypeError:YS,RangeError:JS,CancellationError:II.CancellationError,OperationalError:II.OperationalError,TimeoutError:II.TimeoutError,AggregateError:II.AggregateError,Warning:Fq1}});var D20=O((JC1,L20)=>{L20.exports=function($,I){var z=d1(),q=z.errorObj,U=z.isObject;function Y(G,W){if(U(G)){if(G instanceof $)return G;var V=Q(G);if(V===q){if(W)W._pushContext();var X=$.reject(V.e);if(W)W._popContext();return X}else if(typeof V==="function"){if(K(G)){var X=new $(I);return G._then(X._fulfill,X._reject,void 0,X,null),X}return H(G,V,W)}}return G}function J(G){return G.then}function Q(G){try{return J(G)}catch(W){return q.e=W,q}}var w={}.hasOwnProperty;function K(G){try{return w.call(G,"_promise0")}catch(W){return!1}}function H(G,W,V){var X=new $(I),L=X;if(V)V._pushContext();if(X._captureStackTrace(),V)V._popContext();var D=!0,F=z.tryCatch(W).call(G,T,P);if(D=!1,X&&F===q)X._rejectCallback(F.e,!0,!0),X=null;function T(M){if(!X)return;X._resolveCallback(M),X=null}function P(M){if(!X)return;X._rejectCallback(M,D,!0),X=null}return L}return Y}});var O20=O((QC1,F20)=>{F20.exports=function($,I,z,q,U){var Y=d1(),J=Y.isArray;function Q(K){switch(K){case-2:return[];case-3:return{}}}function w(K){var H=this._promise=new $(I);if(K instanceof $)H._propagateFrom(K,3);H._setOnCancel(this),this._values=K,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Y.inherits(w,U),w.prototype.length=function(){return this._length},w.prototype.promise=function(){return this._promise},w.prototype._init=function K(H,G){var W=z(this._values,this._promise);if(W instanceof $){W=W._target();var V=W._bitField;if(this._values=W,(V&50397184)===0)return this._promise._setAsyncGuaranteed(),W._then(K,this._reject,void 0,this,G);else if((V&33554432)!==0)W=W._value();else if((V&16777216)!==0)return this._reject(W._reason());else return this._cancel()}if(W=Y.asArray(W),W===null){var X=q("expecting an array or an iterable object but got "+Y.classString(W)).reason();this._promise._rejectCallback(X,!1);return}if(W.length===0){if(G===-5)this._resolveEmptyArray();else this._resolve(Q(G));return}this._iterate(W)},w.prototype._iterate=function(K){var H=this.getActualLength(K.length);this._length=H,this._values=this.shouldCopyValues()?Array(H):this._values;var G=this._promise,W=!1,V=null;for(var X=0;X<H;++X){var L=z(K[X],G);if(L instanceof $)L=L._target(),V=L._bitField;else V=null;if(W){if(V!==null)L.suppressUnhandledRejections()}else if(V!==null)if((V&50397184)===0)L._proxy(this,X),this._values[X]=L;else if((V&33554432)!==0)W=this._promiseFulfilled(L._value(),X);else if((V&16777216)!==0)W=this._promiseRejected(L._reason(),X);else W=this._promiseCancelled(X);else W=this._promiseFulfilled(L,X)}if(!W)G._setAsyncGuaranteed()},w.prototype._isResolved=function(){return this._values===null},w.prototype._resolve=function(K){this._values=null,this._promise._fulfill(K)},w.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},w.prototype._reject=function(K){this._values=null,this._promise._rejectCallback(K,!1)},w.prototype._promiseFulfilled=function(K,H){this._values[H]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},w.prototype._promiseCancelled=function(){return this._cancel(),!0},w.prototype._promiseRejected=function(K){return this._totalResolved++,this._reject(K),!0},w.prototype._resultCancelled=function(){if(this._isResolved())return;var K=this._values;if(this._cancel(),K instanceof $)K.cancel();else for(var H=0;H<K.length;++H)if(K[H]instanceof $)K[H].cancel()},w.prototype.shouldCopyValues=function(){return!0},w.prototype.getActualLength=function(K){return K},w}});var M20=O((wC1,N20)=>{N20.exports=function($){var I=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function q(){this._trace=new q.CapturedTrace(Y())}q.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},q.prototype._popContext=function(){if(this._trace!==void 0){var J=z.pop(),Q=J._promiseCreated;return J._promiseCreated=null,Q}return null};function U(){if(I)return new q}function Y(){var J=z.length-1;if(J>=0)return z[J];return}return q.CapturedTrace=null,q.create=U,q.deactivateLong Line truncated
`}return GL--,I};function S2($){if(!(this instanceof S2))return new S2($);if(GU(this,"name","OperationalError"),GU(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)GU(this,"message",$.message),GU(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}A20(S2,Error);var II=Error.__BluebirdErrorTypes__;if(!II)II=Eq1({CancellationError:jq1,TimeoutError:vq1,OperationalError:S2,RejectionError:S2,AggregateError:y2}),KS.defineProperty(Error,"__BluebirdErrorTypes__",{value:II,writable:!1,enumerable:!1,configurable:!1});P20.exports={Error,TypeError:QS,RangeError:wS,CancellationError:II.CancellationError,OperationalError:II.OperationalError,TimeoutError:II.TimeoutError,AggregateError:II.AggregateError,Warning:Bq1}});var E20=O((LC1,T20)=>{T20.exports=function($,I){var z=d1(),q=z.errorObj,U=z.isObject;function Y(G,W){if(U(G)){if(G instanceof $)return G;var V=Q(G);if(V===q){if(W)W._pushContext();var X=$.reject(V.e);if(W)W._popContext();return X}else if(typeof V==="function"){if(K(G)){var X=new $(I);return G._then(X._fulfill,X._reject,void 0,X,null),X}return H(G,V,W)}}return G}function J(G){return G.then}function Q(G){try{return J(G)}catch(W){return q.e=W,q}}var w={}.hasOwnProperty;function K(G){try{return w.call(G,"_promise0")}catch(W){return!1}}function H(G,W,V){var X=new $(I),L=X;if(V)V._pushContext();if(X._captureStackTrace(),V)V._popContext();var D=!0,F=z.tryCatch(W).call(G,T,P);if(D=!1,X&&F===q)X._rejectCallback(F.e,!0,!0),X=null;function T(M){if(!X)return;X._resolveCallback(M),X=null}function P(M){if(!X)return;X._rejectCallback(M,D,!0),X=null}return L}return Y}});var j20=O((DC1,B20)=>{B20.exports=function($,I,z,q,U){var Y=d1(),J=Y.isArray;function Q(K){switch(K){case-2:return[];case-3:return{}}}function w(K){var H=this._promise=new $(I);if(K instanceof $)H._propagateFrom(K,3);H._setOnCancel(this),this._values=K,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Y.inherits(w,U),w.prototype.length=function(){return this._length},w.prototype.promise=function(){return this._promise},w.prototype._init=function K(H,G){var W=z(this._values,this._promise);if(W instanceof $){W=W._target();var V=W._bitField;if(this._values=W,(V&50397184)===0)return this._promise._setAsyncGuaranteed(),W._then(K,this._reject,void 0,this,G);else if((V&33554432)!==0)W=W._value();else if((V&16777216)!==0)return this._reject(W._reason());else return this._cancel()}if(W=Y.asArray(W),W===null){var X=q("expecting an array or an iterable object but got "+Y.classString(W)).reason();this._promise._rejectCallback(X,!1);return}if(W.length===0){if(G===-5)this._resolveEmptyArray();else this._resolve(Q(G));return}this._iterate(W)},w.prototype._iterate=function(K){var H=this.getActualLength(K.length);this._length=H,this._values=this.shouldCopyValues()?Array(H):this._values;var G=this._promise,W=!1,V=null;for(var X=0;X<H;++X){var L=z(K[X],G);if(L instanceof $)L=L._target(),V=L._bitField;else V=null;if(W){if(V!==null)L.suppressUnhandledRejections()}else if(V!==null)if((V&50397184)===0)L._proxy(this,X),this._values[X]=L;else if((V&33554432)!==0)W=this._promiseFulfilled(L._value(),X);else if((V&16777216)!==0)W=this._promiseRejected(L._reason(),X);else W=this._promiseCancelled(X);else W=this._promiseFulfilled(L,X)}if(!W)G._setAsyncGuaranteed()},w.prototype._isResolved=function(){return this._values===null},w.prototype._resolve=function(K){this._values=null,this._promise._fulfill(K)},w.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},w.prototype._reject=function(K){this._values=null,this._promise._rejectCallback(K,!1)},w.prototype._promiseFulfilled=function(K,H){this._values[H]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},w.prototype._promiseCancelled=function(){return this._cancel(),!0},w.prototype._promiseRejected=function(K){return this._totalResolved++,this._reject(K),!0},w.prototype._resultCancelled=function(){if(this._isResolved())return;var K=this._values;if(this._cancel(),K instanceof $)K.cancel();else for(var H=0;H<K.length;++H)if(K[H]instanceof $)K[H].cancel()},w.prototype.shouldCopyValues=function(){return!0},w.prototype.getActualLength=function(K){return K},w}});var g20=O((FC1,v20)=>{v20.exports=function($){var I=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function q(){this._trace=new q.CapturedTrace(Y())}q.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},q.prototype._popContext=function(){if(this._trace!==void 0){var J=z.pop(),Q=J._promiseCreated;return J._promiseCreated=null,Q}return null};function U(){if(I)return new q}function Y(){var J=z.length-1;if(J>=0)return z[J];return}return q.CapturedTrace=null,q.create=U,q.deactivateLong Line truncated
See http://goo.gl/MqrFmX
`);if(!j0.longStackTraces&&b6()){var a=$.prototype._captureStackTrace,N=$.prototype._attachExtraTrace;j0.longStackTraces=!0,M=function(){if(q.haveItemsQueued()&&!j0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);$.prototype._captureStackTrace=a,$.prototype._attachExtraTrace=N,I.deactivateLongStackTraces(),q.enableTrampoline(),j0.longStackTraces=!1},$.prototype._captureStackTrace=U0,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),q.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return j0.longStackTraces&&b6()};var B=function(){try{if(typeof CustomEvent==="function"){var a=new CustomEvent("CustomEvent");return Y.global.dispatchEvent(a),function(N,A){var C=new CustomEvent(N.toLowerCase(),{detail:A,cancelable:!0});return!Y.global.dispatchEvent(C)}}else if(typeof Event==="function"){var a=new Event("CustomEvent");return Y.global.dispatchEvent(a),function(A,C){var k=new Event(A.toLowerCase(),{cancelable:!0});return k.detail=C,!Y.global.dispatchEvent(k)}}else{var a=document.createEvent("CustomEvent");return a.initCustomEvent("testingtheevent",!1,!0,{}),Y.global.dispatchEvent(a),function(A,C){var k=document.createEvent("CustomEvent");return k.initCustomEvent(A.toLowerCase(),!1,!0,C),!Y.global.dispatchEvent(k)}}}catch(N){}return function(){return!1}}(),u=function(){if(Y.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!Y.global)return function(){return!1};return function(a){var N="on"+a.toLowerCase(),A=Y.global[N];if(!A)return!1;return A.apply(Y.global,[].slice.call(arguments,1)),!0}}}();function h(a,N){return{promise:N}}var x={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(a,N,A){return{promise:N,child:A}},warning:function(a,N){return{warning:N}},unhandledRejection:function(a,N,A){return{reason:N,promise:A}},rejectionHandled:h},g=function(a){var N=!1;try{N=u.apply(null,arguments)}catch(C){q.throwLater(C),N=!0}var A=!1;try{A=B(a,x[a].apply(null,arguments))}catch(C){q.throwLater(C),A=!0}return A||N};$.config=function(a){if(a=Object(a),"longStackTraces"in a){if(a.longStackTraces)$.longStackTraces();else if(!a.longStackTraces&&$.hasLongStackTraces())M()}if("warnings"in a){var N=a.warnings;if(j0.warnings=!!N,P=j0.warnings,Y.isObject(N)){if("wForgottenReturn"in N)P=!!N.wForgottenReturn}}if("cancellation"in a&&a.cancellation&&!j0.cancellation){if(q.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=z0,$.prototype._propagateFrom=v,$.prototype._onCancel=f,$.prototype._setOnCancel=b,$.prototype._attachCancellationCallback=S,$.prototype._execute=i,c=v,j0.cancellation=!0}if("monitoring"in a){if(a.monitoring&&!j0.monitoring)j0.monitoring=!0,$.prototype._fireEvent=g;else if(!a.monitoring&&j0.monitoring)j0.monitoring=!1,$.prototype._fireEvent=p}return $};function p(){return!1}$.prototype._fireEvent=p,$.prototype._execute=function(a,N,A){try{a(N,A)}catch(C){return C}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(a){},$.prototype._attachCancellationCallback=function(a){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(a,N){};function i(a,N,A){var C=this;try{a(N,A,function(k){if(typeof k!=="function")throw TypeError("onCancel must be a function, got: "+Y.toString(k));C._attachCancellationCallback(k)})}catch(k){return k}}function S(a){if(!this._isCancellable())return this;var N=this._onCancel();if(N!==void 0)if(Y.isArray(N))N.push(a);else this._setOnCancel([N,a]);else this._setOnCancel(a)}function f(){return this._onCancelField}function b(a){this._onCancelField=a}function z0(){this._cancellationParent=void 0,this._onCancelField=void 0}function v(a,N){if((N&1)!==0){this._cancellationParent=a;var A=a._branchesRemainingToCancel;if(A===void 0)A=0;a._branchesRemainingToCancel=A+1}if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}function n(a,N){if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}var c=n;function r(){var a=this._boundTo;if(a!==void 0){if(a instanceof $)if(a.isFulfilled())return a.value();else return}return a}function U0(){this._trace=new w$(this._peekContext())}function G0(a,N){if(J(a)){var A=this._trace;if(A!==void 0){if(N)A=A._parent}if(A!==void 0)A.attachExtraTrace(a);else if(!a.__stackCleaned__){var C=q1(a);Y.notEnumerableProp(a,"stack",C.message+`
`);$.prototype._captureStackTrace=a,$.prototype._attachExtraTrace=N,I.deactivateLongStackTraces(),q.enableTrampoline(),j0.longStackTraces=!1},$.prototype._captureStackTrace=U0,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),q.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return j0.longStackTraces&&b6()};var j=function(){try{if(typeof CustomEvent==="function"){var a=new CustomEvent("CustomEvent");return Y.global.dispatchEvent(a),function(N,A){var C=new CustomEvent(N.toLowerCase(),{detail:A,cancelable:!0});return!Y.global.dispatchEvent(C)}}else if(typeof Event==="function"){var a=new Event("CustomEvent");return Y.global.dispatchEvent(a),function(A,C){var k=new Event(A.toLowerCase(),{cancelable:!0});return k.detail=C,!Y.global.dispatchEvent(k)}}else{var a=document.createEvent("CustomEvent");return a.initCustomEvent("testingtheevent",!1,!0,{}),Y.global.dispatchEvent(a),function(A,C){var k=document.createEvent("CustomEvent");return k.initCustomEvent(A.toLowerCase(),!1,!0,C),!Y.global.dispatchEvent(k)}}}catch(N){}return function(){return!1}}(),u=function(){if(Y.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!Y.global)return function(){return!1};return function(a){var N="on"+a.toLowerCase(),A=Y.global[N];if(!A)return!1;return A.apply(Y.global,[].slice.call(arguments,1)),!0}}}();function h(a,N){return{promise:N}}var x={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(a,N,A){return{promise:N,child:A}},warning:function(a,N){return{warning:N}},unhandledRejection:function(a,N,A){return{reason:N,promise:A}},rejectionHandled:h},g=function(a){var N=!1;try{N=u.apply(null,arguments)}catch(C){q.throwLater(C),N=!0}var A=!1;try{A=j(a,x[a].apply(null,arguments))}catch(C){q.throwLater(C),A=!0}return A||N};$.config=function(a){if(a=Object(a),"longStackTraces"in a){if(a.longStackTraces)$.longStackTraces();else if(!a.longStackTraces&&$.hasLongStackTraces())M()}if("warnings"in a){var N=a.warnings;if(j0.warnings=!!N,P=j0.warnings,Y.isObject(N)){if("wForgottenReturn"in N)P=!!N.wForgottenReturn}}if("cancellation"in a&&a.cancellation&&!j0.cancellation){if(q.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=z0,$.prototype._propagateFrom=v,$.prototype._onCancel=f,$.prototype._setOnCancel=b,$.prototype._attachCancellationCallback=S,$.prototype._execute=i,c=v,j0.cancellation=!0}if("monitoring"in a){if(a.monitoring&&!j0.monitoring)j0.monitoring=!0,$.prototype._fireEvent=g;else if(!a.monitoring&&j0.monitoring)j0.monitoring=!1,$.prototype._fireEvent=p}return $};function p(){return!1}$.prototype._fireEvent=p,$.prototype._execute=function(a,N,A){try{a(N,A)}catch(C){return C}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(a){},$.prototype._attachCancellationCallback=function(a){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(a,N){};function i(a,N,A){var C=this;try{a(N,A,function(k){if(typeof k!=="function")throw TypeError("onCancel must be a function, got: "+Y.toString(k));C._attachCancellationCallback(k)})}catch(k){return k}}function S(a){if(!this._isCancellable())return this;var N=this._onCancel();if(N!==void 0)if(Y.isArray(N))N.push(a);else this._setOnCancel([N,a]);else this._setOnCancel(a)}function f(){return this._onCancelField}function b(a){this._onCancelField=a}function z0(){this._cancellationParent=void 0,this._onCancelField=void 0}function v(a,N){if((N&1)!==0){this._cancellationParent=a;var A=a._branchesRemainingToCancel;if(A===void 0)A=0;a._branchesRemainingToCancel=A+1}if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}function n(a,N){if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}var c=n;function r(){var a=this._boundTo;if(a!==void 0){if(a instanceof $)if(a.isFulfilled())return a.value();else return}return a}function U0(){this._trace=new w$(this._peekContext())}function G0(a,N){if(J(a)){var A=this._trace;if(A!==void 0){if(N)A=A._parent}if(A!==void 0)A.attachExtraTrace(a);else if(!a.__stackCleaned__){var C=q1(a);Y.notEnumerableProp(a,"stack",C.message+`
`+C.stack.join(`
`)),Y.notEnumerableProp(a,"__stackCleaned__",!0)}}}function A0(a,N,A,C,k){if(a===void 0&&N!==null&&P){if(k!==void 0&&k._returnedNonUndefined())return;if((C._bitField&65535)===0)return;if(A)A=A+" ";var s="",m="";if(N._trace){var e=N._trace.stack.split(`
`),J0=Y0(e);for(var H0=J0.length-1;H0>=0;--H0){var _0=J0[H0];if(!H.test(_0)){var i0=_0.match(G);if(i0)s="at "+i0[1]+":"+i0[2]+":"+i0[3]+" ";break}}if(J0.length>0){var n0=J0[0];for(var H0=0;H0<e.length;++H0)if(e[H0]===n0){if(H0>0)m=`
@@ -71,20 +71,20 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
`),k=-1,s=-1,m,e;for(var J0=0;J0<A.length;++J0){var H0=Q$(A[J0]);if(H0){m=H0.fileName,k=H0.line;break}}for(var J0=0;J0<C.length;++J0){var H0=Q$(C[J0]);if(H0){e=H0.fileName,s=H0.line;break}}if(k<0||s<0||!m||!e||m!==e||k>=s)return;T6=function(_0){if(K.test(_0))return!0;var i0=Q$(_0);if(i0){if(i0.fileName===m&&(k<=i0.line&&i0.line<=s))return!0}return!1}}function w$(a){this._parent=a,this._promisesCreated=0;var N=this._length=1+(a===void 0?0:a._length);if(q9(this,w$),N>32)this.uncycle()}Y.inherits(w$,Error),I.CapturedTrace=w$,w$.prototype.uncycle=function(){var a=this._length;if(a<2)return;var N=[],A={};for(var C=0,k=this;k!==void 0;++C)N.push(k),k=k._parent;a=this._length=C;for(var C=a-1;C>=0;--C){var s=N[C].stack;if(A[s]===void 0)A[s]=C}for(var C=0;C<a;++C){var m=N[C].stack,e=A[m];if(e!==void 0&&e!==C){if(e>0)N[e-1]._parent=void 0,N[e-1]._length=1;N[C]._parent=void 0,N[C]._length=1;var J0=C>0?N[C-1]:this;if(e<a-1)J0._parent=N[e+1],J0._parent.uncycle(),J0._length=J0._parent._length+1;else J0._parent=void 0,J0._length=1;var H0=J0._length+1;for(var _0=C-2;_0>=0;--_0)N[_0]._length=H0,H0++;return}}},w$.prototype.attachExtraTrace=function(a){if(a.__stackCleaned__)return;this.uncycle();var N=q1(a),A=N.message,C=[N.stack],k=this;while(k!==void 0)C.push(Y0(k.stack.split(`
`))),k=k._parent;M0(C),z1(C),Y.notEnumerableProp(a,"stack",f0(A,C)),Y.notEnumerableProp(a,"__stackCleaned__",!0)};var q9=function(){var N=/^\s*at\s*/,A=function(m,e){if(typeof m==="string")return m;if(e.name!==void 0&&e.message!==void 0)return e.toString();return n6(e)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,W=N,V=A;var C=Error.captureStackTrace;return T6=function(m){return K.test(m)},function(m,e){Error.stackTraceLimit+=6,C(m,e),Error.stackTraceLimit-=6}}var k=Error();if(typeof k.stack==="string"&&k.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return W=/@/,V=A,X=!0,function(e){e.stack=Error().stack};var s;try{throw Error()}catch(m){s="stack"in m}if(!("stack"in k)&&s&&typeof Error.stackTraceLimit==="number")return W=N,V=A,function(e){Error.stackTraceLimit+=6;try{throw Error()}catch(J0){e.stack=J0.stack}Error.stackTraceLimit-=6};return V=function(m,e){if(typeof m==="string")return m;if((typeof e==="object"||typeof e==="function")&&e.name!==void 0&&e.message!==void 0)return e.toString();return n6(e)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(L=function(a){console.warn(a)},Y.isNode&&process.stderr.isTTY)L=function(a,N){var A=N?"\x1B[33m":"\x1B[31m";console.warn(A+a+`\x1B[0m
`)};else if(!Y.isNode&&typeof Error().stack==="string")L=function(a,N){console.warn("%c"+a,N?"color: darkorange":"color: red")}}var j0={warnings:F,longStackTraces:!1,cancellation:!1,monitoring:!1};if(T)$.longStackTraces();return{longStackTraces:function(){return j0.longStackTraces},warnings:function(){return j0.warnings},cancellation:function(){return j0.cancellation},monitoring:function(){return j0.monitoring},propagateFromFunction:function(){return c},boundValueFunction:function(){return r},checkForgottenReturns:A0,setBounds:S7,warn:Q1,deprecated:g0,CapturedTrace:w$,fireDomEvent:B,fireGlobalEvent:u}}});var E20=O((HC1,T20)=>{T20.exports=function($,I){var z=d1(),q=$.CancellationError,U=z.errorObj;function Y(G,W,V){this.promise=G,this.type=W,this.handler=V,this.called=!1,this.cancelPromise=null}Y.prototype.isFinallyHandler=function(){return this.type===0};function J(G){this.finallyHandler=G}J.prototype._resultCancelled=function(){Q(this.finallyHandler)};function Q(G,W){if(G.cancelPromise!=null){if(arguments.length>1)G.cancelPromise._reject(W);else G.cancelPromise._cancel();return G.cancelPromise=null,!0}return!1}function w(){return H.call(this,this.promise._target()._settledValue())}function K(G){if(Q(this,G))return;return U.e=G,U}function H(G){var W=this.promise,V=this.handler;if(!this.called){this.called=!0;var X=this.isFinallyHandler()?V.call(W._boundValue()):V.call(W._boundValue(),G);if(X!==void 0){W._setReturnedNonUndefined();var L=I(X,W);if(L instanceof $){if(this.cancelPromise!=null){if(L._isCancelled()){var D=new q("late cancellation observer");return W._attachExtraTrace(D),U.e=D,U}else if(L.isPending())L._attachCancellationCallback(new J(this))}return L._then(w,K,void 0,this,void 0)}}}if(W.isRejected())return Q(this),U.e=G,U;else return Q(this),G}return $.prototype._passThrough=function(G,W,V,X){if(typeof G!=="function")return this.then();return this._then(V,X,void 0,new Y(this,W,G),void 0)},$.prototype.lastly=$.prototype.finally=function(G){return this._passThrough(G,0,H,H)},$.prototype.tap=function(G){return this._passThrough(G,1,H)},Y}});var j20=O((GC1,B20)=>{B20.exports=function($){var I=d1(),z=s3().keys,q=I.tryCatch,U=I.errorObj;function Y(J,Q,w){return function(K){var H=w._boundValue();$:for(var G=0;G<J.length;++G){var W=J[G];if(W===Error||W!=null&&W.prototype instanceof Error){if(K instanceof W)return q(Q).call(H,K)}else if(typeof W==="function"){var V=q(W).call(H,K);if(V===U)return V;else if(V)return q(Q).call(H,K)}else if(I.isObject(K)){var X=z(W);for(var L=0;L<X.length;++L){var D=X[L];if(W[D]!=K[D])continue $}return q(Q).call(H,K)}}return $}}return Y}});var wS=O((WC1,R20)=>{var v20=d1(),Mq1=v20.maybeWrapAsError,Aq1=b5(),Pq1=Aq1.OperationalError,g20=s3();function Tq1($){return $ instanceof Error&&g20.getPrototypeOf($)===Error.prototype}var Eq1=/^(?:name|message|stack|cause)$/;function Bq1($){var I;if(Tq1($)){I=new Pq1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var z=g20.keys($);for(var q=0;q<z.length;++q){var U=z[q];if(!Eq1.test(U))I[U]=$[U]}return I}return v20.markAsOriginatingFromRejection($),$}function jq1($,I){return function(z,q){if($===null)return;if(z){var U=Bq1(Mq1(z));$._attachExtraTrace(U),$._reject(U)}else if(!I)$._fulfill(q);else{var Y=arguments.length,J=Array(Math.max(Y-1,0));for(var Q=1;Q<Y;++Q)J[Q-1]=arguments[Q];$._fulfill(J)}$=null}}R20.exports=jq1});var C20=O((VC1,_20)=>{_20.exports=function($,I,z,q,U){var Y=d1(),J=Y.tryCatch;$.method=function(Q){if(typeof Q!=="function")throw new $.TypeError("expecting a function but got "+Y.classString(Q));return function(){var w=new $(I);w._captureStackTrace(),w._pushContext();var K=J(Q).apply(this,arguments),H=w._popContext();return U.checkForgottenReturns(K,H,"Promise.method",w),w._resolveFromSyncValue(K),w}},$.attempt=$.try=function(Q){if(typeof Q!=="function")return q("expecting a function but got "+Y.classString(Q));var w=new $(I);w._captureStackTrace(),w._pushContext();var K;if(arguments.length>1){U.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],G=arguments[2];K=Y.isArray(H)?J(Q).apply(G,H):J(Q).call(G,H)}else K=J(Q)();var W=w._popContext();return U.checkForgottenReturns(K,W,"Promise.try",w),w._resolveFromSyncValue(K),w},$.prototype._resolveFromSyncValue=function(Q){if(Q===Y.errorObj)this._rejectCallback(Q.e,!1);else this._resolveCallback(Q,!0)}}});var S20=O((ZC1,h20)=>{h20.exports=function($,I,z,q){var U=!1,Y=function(K,H){this._reject(H)},J=function(K,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(Y,Y,null,this,K)},Q=function(K,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},w=function(K,H){if(!H.promiseRejectionQueued)this._reject(K)};$.prototype.bind=function(K){if(!U)U=!0,$.prototype._propagateFrom=q.propagateFromFunction(),$.prototype._boundValue=q.boundValueFunction();var H=z(K),G=new $(I);G._propagateFrom(this,1);var W=this._target();if(G._setBoundTo(H),H instanceof $){var V={promiseRejectionQueued:!1,promise:G,target:W,bindingPromise:H};W._then(I,J,voi Line truncated
`)};else if(!Y.isNode&&typeof Error().stack==="string")L=function(a,N){console.warn("%c"+a,N?"color: darkorange":"color: red")}}var j0={warnings:F,longStackTraces:!1,cancellation:!1,monitoring:!1};if(T)$.longStackTraces();return{longStackTraces:function(){return j0.longStackTraces},warnings:function(){return j0.warnings},cancellation:function(){return j0.cancellation},monitoring:function(){return j0.monitoring},propagateFromFunction:function(){return c},boundValueFunction:function(){return r},checkForgottenReturns:A0,setBounds:S7,warn:Q1,deprecated:g0,CapturedTrace:w$,fireDomEvent:j,fireGlobalEvent:u}}});var h20=O((NC1,C20)=>{C20.exports=function($,I){var z=d1(),q=$.CancellationError,U=z.errorObj;function Y(G,W,V){this.promise=G,this.type=W,this.handler=V,this.called=!1,this.cancelPromise=null}Y.prototype.isFinallyHandler=function(){return this.type===0};function J(G){this.finallyHandler=G}J.prototype._resultCancelled=function(){Q(this.finallyHandler)};function Q(G,W){if(G.cancelPromise!=null){if(arguments.length>1)G.cancelPromise._reject(W);else G.cancelPromise._cancel();return G.cancelPromise=null,!0}return!1}function w(){return H.call(this,this.promise._target()._settledValue())}function K(G){if(Q(this,G))return;return U.e=G,U}function H(G){var W=this.promise,V=this.handler;if(!this.called){this.called=!0;var X=this.isFinallyHandler()?V.call(W._boundValue()):V.call(W._boundValue(),G);if(X!==void 0){W._setReturnedNonUndefined();var L=I(X,W);if(L instanceof $){if(this.cancelPromise!=null){if(L._isCancelled()){var D=new q("late cancellation observer");return W._attachExtraTrace(D),U.e=D,U}else if(L.isPending())L._attachCancellationCallback(new J(this))}return L._then(w,K,void 0,this,void 0)}}}if(W.isRejected())return Q(this),U.e=G,U;else return Q(this),G}return $.prototype._passThrough=function(G,W,V,X){if(typeof G!=="function")return this.then();return this._then(V,X,void 0,new Y(this,W,G),void 0)},$.prototype.lastly=$.prototype.finally=function(G){return this._passThrough(G,0,H,H)},$.prototype.tap=function(G){return this._passThrough(G,1,H)},Y}});var y20=O((MC1,S20)=>{S20.exports=function($){var I=d1(),z=s3().keys,q=I.tryCatch,U=I.errorObj;function Y(J,Q,w){return function(K){var H=w._boundValue();$:for(var G=0;G<J.length;++G){var W=J[G];if(W===Error||W!=null&&W.prototype instanceof Error){if(K instanceof W)return q(Q).call(H,K)}else if(typeof W==="function"){var V=q(W).call(H,K);if(V===U)return V;else if(V)return q(Q).call(H,K)}else if(I.isObject(K)){var X=z(W);for(var L=0;L<X.length;++L){var D=X[L];if(W[D]!=K[D])continue $}return q(Q).call(H,K)}}return $}}return Y}});var HS=O((AC1,k20)=>{var u20=d1(),gq1=u20.maybeWrapAsError,Rq1=b5(),_q1=Rq1.OperationalError,x20=s3();function Cq1($){return $ instanceof Error&&x20.getPrototypeOf($)===Error.prototype}var hq1=/^(?:name|message|stack|cause)$/;function Sq1($){var I;if(Cq1($)){I=new _q1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var z=x20.keys($);for(var q=0;q<z.length;++q){var U=z[q];if(!hq1.test(U))I[U]=$[U]}return I}return u20.markAsOriginatingFromRejection($),$}function yq1($,I){return function(z,q){if($===null)return;if(z){var U=Sq1(gq1(z));$._attachExtraTrace(U),$._reject(U)}else if(!I)$._fulfill(q);else{var Y=arguments.length,J=Array(Math.max(Y-1,0));for(var Q=1;Q<Y;++Q)J[Q-1]=arguments[Q];$._fulfill(J)}$=null}}k20.exports=yq1});var n20=O((PC1,f20)=>{f20.exports=function($,I,z,q,U){var Y=d1(),J=Y.tryCatch;$.method=function(Q){if(typeof Q!=="function")throw new $.TypeError("expecting a function but got "+Y.classString(Q));return function(){var w=new $(I);w._captureStackTrace(),w._pushContext();var K=J(Q).apply(this,arguments),H=w._popContext();return U.checkForgottenReturns(K,H,"Promise.method",w),w._resolveFromSyncValue(K),w}},$.attempt=$.try=function(Q){if(typeof Q!=="function")return q("expecting a function but got "+Y.classString(Q));var w=new $(I);w._captureStackTrace(),w._pushContext();var K;if(arguments.length>1){U.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],G=arguments[2];K=Y.isArray(H)?J(Q).apply(G,H):J(Q).call(G,H)}else K=J(Q)();var W=w._popContext();return U.checkForgottenReturns(K,W,"Promise.try",w),w._resolveFromSyncValue(K),w},$.prototype._resolveFromSyncValue=function(Q){if(Q===Y.errorObj)this._rejectCallback(Q.e,!1);else this._resolveCallback(Q,!0)}}});var i20=O((TC1,b20)=>{b20.exports=function($,I,z,q){var U=!1,Y=function(K,H){this._reject(H)},J=function(K,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(Y,Y,null,this,K)},Q=function(K,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},w=function(K,H){if(!H.promiseRejectionQueued)this._reject(K)};$.prototype.bind=function(K){if(!U)U=!0,$.prototype._propagateFrom=q.propagateFromFunction(),$.prototype._boundValue=q.boundValueFunction();var H=z(K),G=new $(I);G._propagateFrom(this,1);var W=this._target();if(G._setBoundTo(H),H instanceof $){var V={promiseRejectionQueued:!1,promise:G,target:W,bindingPromise:H};W._then(I,J,voi Line truncated
See http://goo.gl/MqrFmX
`);return this._settledValue()},q=I.prototype.error=I.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
See http://goo.gl/MqrFmX
`);return this._settledValue()},U=I.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},Y=I.prototype.isRejected=function(){return(this._bitField&16777216)!==0},J=I.prototype.isPending=function(){return(this._bitField&50397184)===0},Q=I.prototype.isResolved=function(){return(this._bitField&50331648)!==0};I.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return J.call(this._target())},$.prototype.isRejected=function(){return Y.call(this._target())},$.prototype.isFulfilled=function(){return U.call(this._target())},$.prototype.isResolved=function(){return Q.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var w=this._target();return w._unsetRejectionIsUnhandled(),q.call(w)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var i20=O((FC1,b20)=>{b20.exports=function($,I,z,q,U,Y){var J=d1(),Q=J.canEvaluate,w=J.tryCatch,K=J.errorObj,H;if(Q){var G=function(T){return Function("value","holder",`
`);return this._settledValue()},U=I.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},Y=I.prototype.isRejected=function(){return(this._bitField&16777216)!==0},J=I.prototype.isPending=function(){return(this._bitField&50397184)===0},Q=I.prototype.isResolved=function(){return(this._bitField&50331648)!==0};I.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return J.call(this._target())},$.prototype.isRejected=function(){return Y.call(this._target())},$.prototype.isFulfilled=function(){return U.call(this._target())},$.prototype.isResolved=function(){return Q.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var w=this._target();return w._unsetRejectionIsUnhandled(),q.call(w)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var t20=O((vC1,r20)=>{r20.exports=function($,I,z,q,U,Y){var J=d1(),Q=J.canEvaluate,w=J.tryCatch,K=J.errorObj,H;if(Q){var G=function(T){return Function("value","holder",`
'use strict';
holder.pIndex = value;
holder.checkFulfillment(this);
`.replace(/Index/g,T))},W=function(T){return Function("promise","holder",`
'use strict';
holder.pIndex = promise;
`.replace(/Index/g,T))},V=function(T){var P=Array(T);for(var M=0;M<P.length;++M)P[M]="this.p"+(M+1);var B=P.join(" = ")+" = null;",u=`var promise;
`.replace(/Index/g,T))},V=function(T){var P=Array(T);for(var M=0;M<P.length;++M)P[M]="this.p"+(M+1);var j=P.join(" = ")+" = null;",u=`var promise;
`+P.map(function(p){return`
promise = `+p+`;
if (promise instanceof Promise) {
@@ -129,7 +129,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
return [TheName];
}(tryCatch, errorObj, Promise, async);
`;return g=g.replace(/\[TheName\]/g,x).replace(/\[TheTotal\]/g,T).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,B).replace(/\[CancellationCode\]/g,u),Function("tryCatch","errorObj","Promise","async",g)(w,K,$,U)},X=[],L=[],D=[];for(var F=0;F<8;++F)X.push(V(F+1)),L.push(G(F+1)),D.push(W(F+1));H=function(T){this._reject(T)}}$.join=function(){var T=arguments.length-1,P;if(T>0&&typeof arguments[T]==="function"){if(P=arguments[T],T<=8&&Q){var b=new $(q);b._captureStackTrace();var M=X[T-1],B=new M(P),u=L;for(var h=0;h<T;++h){var x=z(arguments[h],b);if(x instanceof $){x=x._target();var g=x._bitField;if((g&50397184)===0)x._then(u[h],H,void 0,b,B),D[h](x,B),B.asyncNeeded=!1;else if((g&33554432)!==0)u[h].call(b,x._value(),B);else if((g&16777216)!==0)b._reject(x._reason());else b._cancel()}else u[h].call(b,x,B)}if(!b._isFateSealed()){if(B.asyncNeeded){var p=Y();if(p!==null)B.fn=J.domainBind(p,B.fn)}b._setAsyncGuaranteed(),b._setOnCancel(B)}return b}}var i=arguments.length,S=Array(i);for(var f=0;f<i;++f)S[f]=arguments[f];if(P)S.pop();var b=new I(S).promise();return P!==void 0?b.spread(P):b}}});var c20=O((OC1,p20)=>{p20.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=d1(),w=Q.tryCatch,K=Q.errorObj,H=$._async;function G(V,X,L,D){this.constructor$(V),this._promise._captureStackTrace();var F=J();this._callback=F===null?X:Q.domainBind(F,X),this._preservedValues=D===U?Array(this.length()):null,this._limit=L,this._inFlight=0,this._queue=[],H.invoke(this._asyncInit,this,void 0)}Q.inherits(G,I),G.prototype._asyncInit=function(){this._init$(void 0,-2)},G.prototype._init=function(){},G.prototype._promiseFulfilled=function(V,X){var L=this._values,D=this.length(),F=this._preservedValues,T=this._limit;if(X<0){if(X=X*-1-1,L[X]=V,T>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(T>=1&&this._inFlight>=T)return L[X]=V,this._queue.push(X),!1;if(F!==null)F[X]=V;var P=this._promise,M=this._callback,B=P._boundValue();P._pushContext();var u=w(M).call(B,V,X,D),h=P._popContext();if(Y.checkForgottenReturns(u,h,F!==null?"Promise.filter":"Promise.map",P),u===K)return this._reject(u.e),!0;var x=q(u,this._promise);if(x instanceof $){x=x._target();var g=x._bitField;if((g&50397184)===0){if(T>=1)this._inFlight++;return L[X]=x,x._proxy(this,(X+1)*-1),!1}else if((g&33554432)!==0)u=x._value();else if((g&16777216)!==0)return this._reject(x._reason()),!0;else return this._cancel(),!0}L[X]=u}var p=++this._totalResolved;if(p>=D){if(F!==null)this._filter(L,F);else this._resolve(L);return!0}return!1},G.prototype._drainQueue=function(){var V=this._queue,X=this._limit,L=this._values;while(V.length>0&&this._inFlight<X){if(this._isResolved())return;var D=V.pop();this._promiseFulfilled(L[D],D)}},G.prototype._filter=function(V,X){var L=X.length,D=Array(L),F=0;for(var T=0;T<L;++T)if(V[T])D[F++]=X[T];D.length=F,this._resolve(D)},G.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,L,D){if(typeof X!=="function")return z("expecting a function but got "+Q.classString(X));var F=0;if(L!==void 0)if(typeof L==="object"&&L!==null){if(typeof L.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+Q.classString(L.concurrency)));F=L.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+Q.classString(L)));return F=typeof F==="number"&&isFinite(F)&&F>=1?F:0,new G(V,X,F,D).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,L,D){return W(V,X,L,D)}}});var m20=O((NC1,d20)=>{var KS=Object.create;if(KS)GL=KS(null),WL=KS(null),GL[" size"]=WL[" size"]=0;var GL,WL;d20.exports=function($){var I=d1(),z=I.canEvaluate,q=I.isIdentifier,U,Y,J=function(V){return Function("ensureMethod",`
`;return g=g.replace(/\[TheName\]/g,x).replace(/\[TheTotal\]/g,T).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,j).replace(/\[CancellationCode\]/g,u),Function("tryCatch","errorObj","Promise","async",g)(w,K,$,U)},X=[],L=[],D=[];for(var F=0;F<8;++F)X.push(V(F+1)),L.push(G(F+1)),D.push(W(F+1));H=function(T){this._reject(T)}}$.join=function(){var T=arguments.length-1,P;if(T>0&&typeof arguments[T]==="function"){if(P=arguments[T],T<=8&&Q){var b=new $(q);b._captureStackTrace();var M=X[T-1],j=new M(P),u=L;for(var h=0;h<T;++h){var x=z(arguments[h],b);if(x instanceof $){x=x._target();var g=x._bitField;if((g&50397184)===0)x._then(u[h],H,void 0,b,j),D[h](x,j),j.asyncNeeded=!1;else if((g&33554432)!==0)u[h].call(b,x._value(),j);else if((g&16777216)!==0)b._reject(x._reason());else b._cancel()}else u[h].call(b,x,j)}if(!b._isFateSealed()){if(j.asyncNeeded){var p=Y();if(p!==null)j.fn=J.domainBind(p,j.fn)}b._setAsyncGuaranteed(),b._setOnCancel(j)}return b}}var i=arguments.length,S=Array(i);for(var f=0;f<i;++f)S[f]=arguments[f];if(P)S.pop();var b=new I(S).promise();return P!==void 0?b.spread(P):b}}});var s20=O((gC1,a20)=>{a20.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=d1(),w=Q.tryCatch,K=Q.errorObj,H=$._async;function G(V,X,L,D){this.constructor$(V),this._promise._captureStackTrace();var F=J();this._callback=F===null?X:Q.domainBind(F,X),this._preservedValues=D===U?Array(this.length()):null,this._limit=L,this._inFlight=0,this._queue=[],H.invoke(this._asyncInit,this,void 0)}Q.inherits(G,I),G.prototype._asyncInit=function(){this._init$(void 0,-2)},G.prototype._init=function(){},G.prototype._promiseFulfilled=function(V,X){var L=this._values,D=this.length(),F=this._preservedValues,T=this._limit;if(X<0){if(X=X*-1-1,L[X]=V,T>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(T>=1&&this._inFlight>=T)return L[X]=V,this._queue.push(X),!1;if(F!==null)F[X]=V;var P=this._promise,M=this._callback,j=P._boundValue();P._pushContext();var u=w(M).call(j,V,X,D),h=P._popContext();if(Y.checkForgottenReturns(u,h,F!==null?"Promise.filter":"Promise.map",P),u===K)return this._reject(u.e),!0;var x=q(u,this._promise);if(x instanceof $){x=x._target();var g=x._bitField;if((g&50397184)===0){if(T>=1)this._inFlight++;return L[X]=x,x._proxy(this,(X+1)*-1),!1}else if((g&33554432)!==0)u=x._value();else if((g&16777216)!==0)return this._reject(x._reason()),!0;else return this._cancel(),!0}L[X]=u}var p=++this._totalResolved;if(p>=D){if(F!==null)this._filter(L,F);else this._resolve(L);return!0}return!1},G.prototype._drainQueue=function(){var V=this._queue,X=this._limit,L=this._values;while(V.length>0&&this._inFlight<X){if(this._isResolved())return;var D=V.pop();this._promiseFulfilled(L[D],D)}},G.prototype._filter=function(V,X){var L=X.length,D=Array(L),F=0;for(var T=0;T<L;++T)if(V[T])D[F++]=X[T];D.length=F,this._resolve(D)},G.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,L,D){if(typeof X!=="function")return z("expecting a function but got "+Q.classString(X));var F=0;if(L!==void 0)if(typeof L==="object"&&L!==null){if(typeof L.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+Q.classString(L.concurrency)));F=L.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+Q.classString(L)));return F=typeof F==="number"&&isFinite(F)&&F>=1?F:0,new G(V,X,F,D).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,L,D){return W(V,X,L,D)}}});var $w0=O((RC1,e20)=>{var GS=Object.create;if(GS)WL=GS(null),VL=GS(null),WL[" size"]=VL[" size"]=0;var WL,VL;e20.exports=function($){var I=d1(),z=I.canEvaluate,q=I.isIdentifier,U,Y,J=function(V){return Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
@@ -146,7 +146,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
`.replace(/methodName/g,V))(K)},Q=function(V){return Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",V))},w=function(V,X,L){var D=L[V];if(typeof D!=="function"){if(!q(V))return null;if(D=X(V),L[V]=D,L[" size"]++,L[" size"]>512){var F=Object.keys(L);for(var T=0;T<256;++T)delete L[F[T]];L[" size"]=F.length-256}}return D};U=function(V){return w(V,J,GL)},Y=function(V){return w(V,Q,WL)};function K(V,X){var L;if(V!=null)L=V[X];if(typeof L!=="function"){var D="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(D)}return L}function H(V){var X=this.pop(),L=K(V,X);return L.apply(V,this)}$.prototype.call=function(V){var X=arguments.length,L=Array(Math.max(X-1,0));for(var D=1;D<X;++D)L[D-1]=arguments[D];if(z){var F=U(V);if(F!==null)return this._then(F,void 0,void 0,L,void 0)}return L.push(V),this._then(H,void 0,void 0,L,void 0)};function G(V){return V[this]}function W(V){var X=+this;if(X<0)X=Math.max(0,X+V.length);return V[X]}$.prototype.get=function(V){var X=typeof V==="number",L;if(!X)if(z){var D=Y(V);L=D!==null?D:G}else L=G;else L=W;return this._then(L,void 0,void 0,V,void 0)}}});var o20=O((MC1,l20)=>{l20.exports=function($,I,z,q,U,Y){var J=d1(),Q=b5().TypeError,w=d1().inherits,K=J.errorObj,H=J.tryCatch,G={};function W(P){setTimeout(function(){throw P},0)}function V(P){var M=z(P);if(M!==P&&typeof P._isDisposable==="function"&&typeof P._getDisposer==="function"&&P._isDisposable())M._setDisposable(P._getDisposer());return M}function X(P,M){var B=0,u=P.length,h=new $(U);function x(){if(B>=u)return h._fulfill();var g=V(P[B++]);if(g instanceof $&&g._isDisposable()){try{g=z(g._getDisposer().tryDispose(M),P.promise)}catch(p){return W(p)}if(g instanceof $)return g._then(x,W,null,null,null)}x()}return x(),h}function L(P,M,B){this._data=P,this._promise=M,this._context=B}L.prototype.data=function(){return this._data},L.prototype.promise=function(){return this._promise},L.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return G},L.prototype.tryDispose=function(P){var M=this.resource(),B=this._context;if(B!==void 0)B._pushContext();var u=M!==G?this.doDispose(M,P):null;if(B!==void 0)B._popContext();return this._promise._unsetDisposable(),this._data=null,u},L.isDisposer=function(P){return P!=null&&typeof P.resource==="function"&&typeof P.tryDispose==="function"};function D(P,M,B){this.constructor$(P,M,B)}w(D,L),D.prototype.doDispose=function(P,M){var B=this.data();return B.call(P,P,M)};function F(P){if(L.isDisposer(P))return this.resources[this.index]._setDisposable(P),P.promise();return P}function T(P){this.length=P,this.promise=null,this[P-1]=null}T.prototype._resultCancelled=function(){var P=this.length;for(var M=0;M<P;++M){var B=this[M];if(B instanceof $)B.cancel()}},$.using=function(){var P=arguments.length;if(P<2)return I("you must pass at least 2 arguments to Promise.using");var M=arguments[P-1];if(typeof M!=="function")return I("expecting a function but got "+J.classString(M));var B,u=!0;if(P===2&&Array.isArray(arguments[0]))B=arguments[0],P=B.length,u=!1;else B=arguments,P--;var h=new T(P);for(var x=0;x<P;++x){var g=B[x];if(L.isDisposer(g)){var p=g;g=g.promise(),g._setDisposable(p)}else{var i=z(g);if(i instanceof $)g=i._then(F,null,null,{resources:h,index:x},void 0)}h[x]=g}var S=Array(h.length);for(var x=0;x<S.length;++x)S[x]=$.resolve(h[x]).reflect();var f=$.all(S).then(function(z0){for(var v=0;v<z0.length;++v){var n=z0[v];if(n.isRejected())return K.e=n.error(),K;else if(!n.isFulfilled()){f.cancel();return}z0[v]=n.value()}b._pushContext(),M=H(M);var c=u?M.apply(void 0,z0):M(z0),r=b._popContext();return Y.checkForgottenReturns(c,r,"Promise.using",b),c}),b=f.lastly(function(){var z0=new $.PromiseInspection(f);return X(h,z0)});return h.promise=b,b._setOnCancel(h),b},$.prototype._setDisposable=function(P){this._bitField=this._bitField|131072,this._disposer=P},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(P){if(typeof P==="function")return new D(P,this,q());throw new Q}}});var t20=O((AC1,r20)=>{r20.exports=function($,I,z){var q=d1(),U=$.TimeoutError;function Y(G){this.handle=G}Y.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(G){return Q(+this).thenReturn(G)},Q=$.delay=function(G,W){var V,X;if(W!==void 0){if(V=$.resolve(W)._then(J,null,null,G,void 0),z.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+G),z.cancellation())V._setOnCancel(new Y(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(G){return Q(G,this)};var w=function(G,W,V){var X;if(typeof W!=="string")if(W instanceof Error)X=W;else X=new U("operation timed out");else X=new U(W);if(q.markAsOriginatingFromRejection(X),G._attachExtraTrace(X),G._reject(X),V!=null)V.cancel()};function K(G){return clearTimeout(this.handle),G}f Line truncated
`.replace("propertyName",V))},w=function(V,X,L){var D=L[V];if(typeof D!=="function"){if(!q(V))return null;if(D=X(V),L[V]=D,L[" size"]++,L[" size"]>512){var F=Object.keys(L);for(var T=0;T<256;++T)delete L[F[T]];L[" size"]=F.length-256}}return D};U=function(V){return w(V,J,WL)},Y=function(V){return w(V,Q,VL)};function K(V,X){var L;if(V!=null)L=V[X];if(typeof L!=="function"){var D="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(D)}return L}function H(V){var X=this.pop(),L=K(V,X);return L.apply(V,this)}$.prototype.call=function(V){var X=arguments.length,L=Array(Math.max(X-1,0));for(var D=1;D<X;++D)L[D-1]=arguments[D];if(z){var F=U(V);if(F!==null)return this._then(F,void 0,void 0,L,void 0)}return L.push(V),this._then(H,void 0,void 0,L,void 0)};function G(V){return V[this]}function W(V){var X=+this;if(X<0)X=Math.max(0,X+V.length);return V[X]}$.prototype.get=function(V){var X=typeof V==="number",L;if(!X)if(z){var D=Y(V);L=D!==null?D:G}else L=G;else L=W;return this._then(L,void 0,void 0,V,void 0)}}});var zw0=O((_C1,Iw0)=>{Iw0.exports=function($,I,z,q,U,Y){var J=d1(),Q=b5().TypeError,w=d1().inherits,K=J.errorObj,H=J.tryCatch,G={};function W(P){setTimeout(function(){throw P},0)}function V(P){var M=z(P);if(M!==P&&typeof P._isDisposable==="function"&&typeof P._getDisposer==="function"&&P._isDisposable())M._setDisposable(P._getDisposer());return M}function X(P,M){var j=0,u=P.length,h=new $(U);function x(){if(j>=u)return h._fulfill();var g=V(P[j++]);if(g instanceof $&&g._isDisposable()){try{g=z(g._getDisposer().tryDispose(M),P.promise)}catch(p){return W(p)}if(g instanceof $)return g._then(x,W,null,null,null)}x()}return x(),h}function L(P,M,j){this._data=P,this._promise=M,this._context=j}L.prototype.data=function(){return this._data},L.prototype.promise=function(){return this._promise},L.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return G},L.prototype.tryDispose=function(P){var M=this.resource(),j=this._context;if(j!==void 0)j._pushContext();var u=M!==G?this.doDispose(M,P):null;if(j!==void 0)j._popContext();return this._promise._unsetDisposable(),this._data=null,u},L.isDisposer=function(P){return P!=null&&typeof P.resource==="function"&&typeof P.tryDispose==="function"};function D(P,M,j){this.constructor$(P,M,j)}w(D,L),D.prototype.doDispose=function(P,M){var j=this.data();return j.call(P,P,M)};function F(P){if(L.isDisposer(P))return this.resources[this.index]._setDisposable(P),P.promise();return P}function T(P){this.length=P,this.promise=null,this[P-1]=null}T.prototype._resultCancelled=function(){var P=this.length;for(var M=0;M<P;++M){var j=this[M];if(j instanceof $)j.cancel()}},$.using=function(){var P=arguments.length;if(P<2)return I("you must pass at least 2 arguments to Promise.using");var M=arguments[P-1];if(typeof M!=="function")return I("expecting a function but got "+J.classString(M));var j,u=!0;if(P===2&&Array.isArray(arguments[0]))j=arguments[0],P=j.length,u=!1;else j=arguments,P--;var h=new T(P);for(var x=0;x<P;++x){var g=j[x];if(L.isDisposer(g)){var p=g;g=g.promise(),g._setDisposable(p)}else{var i=z(g);if(i instanceof $)g=i._then(F,null,null,{resources:h,index:x},void 0)}h[x]=g}var S=Array(h.length);for(var x=0;x<S.length;++x)S[x]=$.resolve(h[x]).reflect();var f=$.all(S).then(function(z0){for(var v=0;v<z0.length;++v){var n=z0[v];if(n.isRejected())return K.e=n.error(),K;else if(!n.isFulfilled()){f.cancel();return}z0[v]=n.value()}b._pushContext(),M=H(M);var c=u?M.apply(void 0,z0):M(z0),r=b._popContext();return Y.checkForgottenReturns(c,r,"Promise.using",b),c}),b=f.lastly(function(){var z0=new $.PromiseInspection(f);return X(h,z0)});return h.promise=b,b._setOnCancel(h),b},$.prototype._setDisposable=function(P){this._bitField=this._bitField|131072,this._disposer=P},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(P){if(typeof P==="function")return new D(P,this,q());throw new Q}}});var Uw0=O((CC1,qw0)=>{qw0.exports=function($,I,z){var q=d1(),U=$.TimeoutError;function Y(G){this.handle=G}Y.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(G){return Q(+this).thenReturn(G)},Q=$.delay=function(G,W){var V,X;if(W!==void 0){if(V=$.resolve(W)._then(J,null,null,G,void 0),z.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+G),z.cancellation())V._setOnCancel(new Y(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(G){return Q(G,this)};var w=function(G,W,V){var X;if(typeof W!=="string")if(W instanceof Error)X=W;else X=new U("operation timed out");else X=new U(W);if(q.markAsOriginatingFromRejection(X),G._attachExtraTrace(X),G._reject(X),V!=null)V.cancel()};function K(G){return clearTimeout(this.handle),G}f Line truncated
See http://goo.gl/MqrFmX
@@ -156,13 +156,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
`)));return}}F=F._target();var T=F._bitField;if((T&50397184)===0)this._yieldedPromise=F,F._proxy(this,null);else if((T&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,F._value());else if((T&16777216)!==0)$._async.invoke(this._promiseRejected,this,F._reason());else this._promiseCancelled()}},$.coroutine=function(X,L){if(typeof X!=="function")throw new Q(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var D=Object(L).yieldHandler,F=V,T=Error().stack;return function(){var P=X.apply(this,arguments),M=new F(void 0,void 0,D,T),B=M.promise();return M._generator=P,M._promiseFulfilled(void 0),B}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new Q("expecting a function but got "+w.classString(X));G.push(X)},$.spawn=function(X){if(Y.deprecated("Promise.spawn()","Promise.coroutine()"),typeof X!=="function")return I(`generatorFunction must be a function
`);var D=Object(L).yieldHandler,F=V,T=Error().stack;return function(){var P=X.apply(this,arguments),M=new F(void 0,void 0,D,T),j=M.promise();return M._generator=P,M._promiseFulfilled(void 0),j}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new Q("expecting a function but got "+w.classString(X));G.push(X)},$.spawn=function(X){if(Y.deprecated("Promise.spawn()","Promise.coroutine()"),typeof X!=="function")return I(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var L=new V(X,this),D=L.promise();return L._run($.spawn),D}}});var $w0=O((TC1,e20)=>{e20.exports=function($){var I=d1(),z=$._async,q=I.tryCatch,U=I.errorObj;function Y(w,K){var H=this;if(!I.isArray(w))return J.call(H,w,K);var G=q(K).apply(H._boundValue(),[null].concat(w));if(G===U)z.throwLater(G.e)}function J(w,K){var H=this,G=H._boundValue(),W=w===void 0?q(K).call(G,null):q(K).call(G,null,w);if(W===U)z.throwLater(W.e)}function Q(w,K){var H=this;if(!w){var G=Error(w+"");G.cause=w,w=G}var W=q(K).call(H._boundValue(),w);if(W===U)z.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(w,K){if(typeof w=="function"){var H=J;if(K!==void 0&&Object(K).spread)H=Y;this._then(H,Q,void 0,this,w)}return this}}});var zw0=O((EC1,Iw0)=>{Iw0.exports=function($,I){var z={},q=d1(),U=wS(),Y=q.withAppended,J=q.maybeWrapAsError,Q=q.canEvaluate,w=b5().TypeError,K="Async",H={__isPromisified__:!0},G=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+G.join("|")+")$"),V=function(f){return q.isIdentifier(f)&&f.charAt(0)!=="_"&&f!=="constructor"};function X(f){return!W.test(f)}function L(f){try{return f.__isPromisified__===!0}catch(b){return!1}}function D(f,b,z0){var v=q.getDataPropertyOrDefault(f,b+z0,H);return v?L(v):!1}function F(f,b,z0){for(var v=0;v<f.length;v+=2){var n=f[v];if(z0.test(n)){var c=n.replace(z0,"");for(var r=0;r<f.length;r+=2)if(f[r]===c)throw new w(`Cannot promisify an API that has normal methods with '%s'-suffix
`);var L=new V(X,this),D=L.promise();return L._run($.spawn),D}}});var ww0=O((SC1,Qw0)=>{Qw0.exports=function($){var I=d1(),z=$._async,q=I.tryCatch,U=I.errorObj;function Y(w,K){var H=this;if(!I.isArray(w))return J.call(H,w,K);var G=q(K).apply(H._boundValue(),[null].concat(w));if(G===U)z.throwLater(G.e)}function J(w,K){var H=this,G=H._boundValue(),W=w===void 0?q(K).call(G,null):q(K).call(G,null,w);if(W===U)z.throwLater(W.e)}function Q(w,K){var H=this;if(!w){var G=Error(w+"");G.cause=w,w=G}var W=q(K).call(H._boundValue(),w);if(W===U)z.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(w,K){if(typeof w=="function"){var H=J;if(K!==void 0&&Object(K).spread)H=Y;this._then(H,Q,void 0,this,w)}return this}}});var Hw0=O((yC1,Kw0)=>{Kw0.exports=function($,I){var z={},q=d1(),U=HS(),Y=q.withAppended,J=q.maybeWrapAsError,Q=q.canEvaluate,w=b5().TypeError,K="Async",H={__isPromisified__:!0},G=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+G.join("|")+")$"),V=function(f){return q.isIdentifier(f)&&f.charAt(0)!=="_"&&f!=="constructor"};function X(f){return!W.test(f)}function L(f){try{return f.__isPromisified__===!0}catch(b){return!1}}function D(f,b,z0){var v=q.getDataPropertyOrDefault(f,b+z0,H);return v?L(v):!1}function F(f,b,z0){for(var v=0;v<f.length;v+=2){var n=f[v];if(z0.test(n)){var c=n.replace(z0,"");for(var r=0;r<f.length;r+=2)if(f[r]===c)throw new w(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",b))}}}function T(f,b,z0,v){var n=q.inheritedDataKeys(f),c=[];for(var r=0;r<n.length;++r){var U0=n[r],G0=f[U0],A0=v===V?!0:V(U0,G0,f);if(typeof G0==="function"&&!L(G0)&&!D(f,U0,b)&&v(U0,G0,f,A0))c.push(U0,G0)}return F(c,b,z0),c}var P=function(f){return f.replace(/([$])/,"\\$")},M,B=function(f){var b=[f],z0=Math.max(0,f-1-3);for(var v=f-1;v>=z0;--v)b.push(v);for(var v=f+1;v<=3;++v)b.push(v);return b},u=function(f){return q.filledRange(f,"_arg","")},h=function(f){return q.filledRange(Math.max(f,3),"_arg","")},x=function(f){if(typeof f.length==="number")return Math.max(Math.min(f.length,1024),0);return 0};M=function(f,b,z0,v,n,c){var r=Math.max(0,x(v)-1),U0=B(r),G0=typeof f==="string"||b===z;function A0(z1){var M0=u(z1).join(", "),Y0=z1>0?", ":"",v0;if(G0)v0=`ret = callback.call(this, {{args}}, nodeback); break;
`.replace("%s",b))}}}function T(f,b,z0,v){var n=q.inheritedDataKeys(f),c=[];for(var r=0;r<n.length;++r){var U0=n[r],G0=f[U0],A0=v===V?!0:V(U0,G0,f);if(typeof G0==="function"&&!L(G0)&&!D(f,U0,b)&&v(U0,G0,f,A0))c.push(U0,G0)}return F(c,b,z0),c}var P=function(f){return f.replace(/([$])/,"\\$")},M,j=function(f){var b=[f],z0=Math.max(0,f-1-3);for(var v=f-1;v>=z0;--v)b.push(v);for(var v=f+1;v<=3;++v)b.push(v);return b},u=function(f){return q.filledRange(f,"_arg","")},h=function(f){return q.filledRange(Math.max(f,3),"_arg","")},x=function(f){if(typeof f.length==="number")return Math.max(Math.min(f.length,1024),0);return 0};M=function(f,b,z0,v,n,c){var r=Math.max(0,x(v)-1),U0=j(r),G0=typeof f==="string"||b===z;function A0(z1){var M0=u(z1).join(", "),Y0=z1>0?", ":"",v0;if(G0)v0=`ret = callback.call(this, {{args}}, nodeback); break;
`;else v0=b===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`;return v0.replace("{{args}}",M0).replace(", ",Y0)}function g0(){var z1="";for(var M0=0;M0<U0.length;++M0)z1+="case "+U0[M0]+":"+A0(U0[M0]);return z1+=`
@@ -203,19 +203,19 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
`);b=Object(b);var z0=!!b.multiArgs,v=b.suffix;if(typeof v!=="string")v=K;var n=b.filter;if(typeof n!=="function")n=V;var c=b.promisifier;if(typeof c!=="function")c=p;if(!q.isIdentifier(v))throw RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);var r=q.inheritedDataKeys(f);for(var U0=0;U0<r.length;++U0){var G0=f[r[U0]];if(r[U0]!=="constructor"&&q.isClass(G0))i(G0.prototype,v,n,c,z0),i(G0,v,n,c,z0)}return i(f,v,n,c,z0)}}});var Uw0=O((BC1,qw0)=>{qw0.exports=function($,I,z,q){var U=d1(),Y=U.isObject,J=s3(),Q;if(typeof Map==="function")Q=Map;var w=function(){var W=0,V=0;function X(L,D){this[W]=L,this[W+V]=D,W++}return function(D){V=D.size,W=0;var F=Array(D.size*2);return D.forEach(X,F),F}}(),K=function(W){var V=new Q,X=W.length/2|0;for(var L=0;L<X;++L){var D=W[X+L],F=W[L];V.set(D,F)}return V};function H(W){var V=!1,X;if(Q!==void 0&&W instanceof Q)X=w(W),V=!0;else{var L=J.keys(W),D=L.length;X=Array(D*2);for(var F=0;F<D;++F){var T=L[F];X[F]=W[T],X[F+D]=T}}this.constructor$(X),this._isMap=V,this._init$(void 0,-3)}U.inherits(H,I),H.prototype._init=function(){},H.prototype._promiseFulfilled=function(W,V){this._values[V]=W;var X=++this._totalResolved;if(X>=this._length){var L;if(this._isMap)L=K(this._values);else{L={};var D=this.length();for(var F=0,T=this.length();F<T;++F)L[this._values[F+D]]=this._values[F]}return this._resolve(L),!0}return!1},H.prototype.shouldCopyValues=function(){return!1},H.prototype.getActualLength=function(W){return W>>1};function G(W){var V,X=z(W);if(!Y(X))return q(`cannot await properties of a non-object
`);var r=q.inheritedDataKeys(f);for(var U0=0;U0<r.length;++U0){var G0=f[r[U0]];if(r[U0]!=="constructor"&&q.isClass(G0))i(G0.prototype,v,n,c,z0),i(G0,v,n,c,z0)}return i(f,v,n,c,z0)}}});var Ww0=O((uC1,Gw0)=>{Gw0.exports=function($,I,z,q){var U=d1(),Y=U.isObject,J=s3(),Q;if(typeof Map==="function")Q=Map;var w=function(){var W=0,V=0;function X(L,D){this[W]=L,this[W+V]=D,W++}return function(D){V=D.size,W=0;var F=Array(D.size*2);return D.forEach(X,F),F}}(),K=function(W){var V=new Q,X=W.length/2|0;for(var L=0;L<X;++L){var D=W[X+L],F=W[L];V.set(D,F)}return V};function H(W){var V=!1,X;if(Q!==void 0&&W instanceof Q)X=w(W),V=!0;else{var L=J.keys(W),D=L.length;X=Array(D*2);for(var F=0;F<D;++F){var T=L[F];X[F]=W[T],X[F+D]=T}}this.constructor$(X),this._isMap=V,this._init$(void 0,-3)}U.inherits(H,I),H.prototype._init=function(){},H.prototype._promiseFulfilled=function(W,V){this._values[V]=W;var X=++this._totalResolved;if(X>=this._length){var L;if(this._isMap)L=K(this._values);else{L={};var D=this.length();for(var F=0,T=this.length();F<T;++F)L[this._values[F+D]]=this._values[F]}return this._resolve(L),!0}return!1},H.prototype.shouldCopyValues=function(){return!1},H.prototype.getActualLength=function(W){return W>>1};function G(W){var V,X=z(W);if(!Y(X))return q(`cannot await properties of a non-object
See http://goo.gl/MqrFmX
`);else if(X instanceof $)V=X._then($.props,void 0,void 0,void 0,void 0);else V=new H(X).promise();if(X instanceof $)V._propagateFrom(X,2);return V}$.prototype.props=function(){return G(this)},$.props=function(W){return G(W)}}});var Jw0=O((jC1,Yw0)=>{Yw0.exports=function($,I,z,q){var U=d1(),Y=function(Q){return Q.then(function(w){return J(w,Q)})};function J(Q,w){var K=z(Q);if(K instanceof $)return Y(K);else if(Q=U.asArray(Q),Q===null)return q("expecting an array or an iterable object but got "+U.classString(Q));var H=new $(I);if(w!==void 0)H._propagateFrom(w,3);var{_fulfill:G,_reject:W}=H;for(var V=0,X=Q.length;V<X;++V){var L=Q[V];if(L===void 0&&!(V in Q))continue;$.cast(L)._then(G,W,void 0,H,null)}return H}$.race=function(Q){return J(Q,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var ww0=O((vC1,Qw0)=>{Qw0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=d1(),w=Q.tryCatch;function K(X,L,D,F){this.constructor$(X);var T=J();if(this._fn=T===null?L:Q.domainBind(T,L),D!==void 0)D=$.resolve(D),D._attachCancellationCallback(this);if(this._initialValue=D,this._currentCancellable=null,F===U)this._eachValues=Array(this._length);else if(F===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}Q.inherits(K,I),K.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==U)this._eachValues.push(X)},K.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);return this._eachValues},K.prototype._init=function(){},K.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},K.prototype.shouldCopyValues=function(){return!1},K.prototype._resolve=function(X){this._promise._resolveCallback(X),this._values=null},K.prototype._resultCancelled=function(X){if(X===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},K.prototype._iterate=function(X){this._values=X;var L,D,F=X.length;if(this._initialValue!==void 0)L=this._initialValue,D=0;else L=$.resolve(X[0]),D=1;if(this._currentCancellable=L,!L.isRejected())for(;D<F;++D){var T={accum:null,value:X[D],index:D,length:F,array:this};L=L._then(W,void 0,void 0,T,void 0)}if(this._eachValues!==void 0)L=L._then(this._eachComplete,void 0,void 0,this,void 0);L._then(H,H,void 0,L,this)},$.prototype.reduce=function(X,L){return G(this,X,L,null)},$.reduce=function(X,L,D,F){return G(X,L,D,F)};function H(X,L){if(this.isFulfilled())L._resolve(X);else L._reject(X)}function G(X,L,D,F){if(typeof L!=="function")return z("expecting a function but got "+Q.classString(L));var T=new K(X,L,D,F);return T.promise()}function W(X){this.accum=X,this.array._gotAccum(X);var L=q(this.value,this.array._promise);if(L instanceof $)return this.array._currentCancellable=L,L._then(V,void 0,void 0,this,void 0);else return V.call(this,L)}function V(X){var L=this.array,D=L._promise,F=w(L._fn);D._pushContext();var T;if(L._eachValues!==void 0)T=F.call(D._boundValue(),X,this.index,this.length);else T=F.call(D._boundValue(),this.accum,X,this.index,this.length);if(T instanceof $)L._currentCancellable=T;var P=D._popContext();return Y.checkForgottenReturns(T,P,L._eachValues!==void 0?"Promise.each":"Promise.reduce",D),T}}});var Hw0=O((gC1,Kw0)=>{Kw0.exports=function($,I,z){var q=$.PromiseInspection,U=d1();function Y(J){this.constructor$(J)}U.inherits(Y,I),Y.prototype._promiseResolved=function(J,Q){this._values[J]=Q;var w=++this._totalResolved;if(w>=this._length)return this._resolve(this._values),!0;return!1},Y.prototype._promiseFulfilled=function(J,Q){var w=new q;return w._bitField=33554432,w._settledValueField=J,this._promiseResolved(Q,w)},Y.prototype._promiseRejected=function(J,Q){var w=new q;return w._bitField=16777216,w._settledValueField=J,this._promiseResolved(Q,w)},$.settle=function(J){return z.deprecated(".settle()",".reflect()"),new Y(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Ww0=O((RC1,Gw0)=>{Gw0.exports=function($,I,z){var q=d1(),U=b5().RangeError,Y=b5().AggregateError,J=q.isArray,Q={};function w(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}q.inherits(w,I),w.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var H=J(this._values);if(!this._isResolved()&&H&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},w.prototype.init=function(){this._initialized=!0,this._init()},w.prototype.setUnwrap=function(){this._unwrap=!0},w.prototype.howMany=function(){return this._howMany},w.prototype.setHowMany=function(H){this._howMany=H},w.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
`);else if(X instanceof $)V=X._then($.props,void 0,void 0,void 0,void 0);else V=new H(X).promise();if(X instanceof $)V._propagateFrom(X,2);return V}$.prototype.props=function(){return G(this)},$.props=function(W){return G(W)}}});var Zw0=O((xC1,Vw0)=>{Vw0.exports=function($,I,z,q){var U=d1(),Y=function(Q){return Q.then(function(w){return J(w,Q)})};function J(Q,w){var K=z(Q);if(K instanceof $)return Y(K);else if(Q=U.asArray(Q),Q===null)return q("expecting an array or an iterable object but got "+U.classString(Q));var H=new $(I);if(w!==void 0)H._propagateFrom(w,3);var{_fulfill:G,_reject:W}=H;for(var V=0,X=Q.length;V<X;++V){var L=Q[V];if(L===void 0&&!(V in Q))continue;$.cast(L)._then(G,W,void 0,H,null)}return H}$.race=function(Q){return J(Q,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var Lw0=O((kC1,Xw0)=>{Xw0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=d1(),w=Q.tryCatch;function K(X,L,D,F){this.constructor$(X);var T=J();if(this._fn=T===null?L:Q.domainBind(T,L),D!==void 0)D=$.resolve(D),D._attachCancellationCallback(this);if(this._initialValue=D,this._currentCancellable=null,F===U)this._eachValues=Array(this._length);else if(F===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}Q.inherits(K,I),K.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==U)this._eachValues.push(X)},K.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);return this._eachValues},K.prototype._init=function(){},K.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},K.prototype.shouldCopyValues=function(){return!1},K.prototype._resolve=function(X){this._promise._resolveCallback(X),this._values=null},K.prototype._resultCancelled=function(X){if(X===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},K.prototype._iterate=function(X){this._values=X;var L,D,F=X.length;if(this._initialValue!==void 0)L=this._initialValue,D=0;else L=$.resolve(X[0]),D=1;if(this._currentCancellable=L,!L.isRejected())for(;D<F;++D){var T={accum:null,value:X[D],index:D,length:F,array:this};L=L._then(W,void 0,void 0,T,void 0)}if(this._eachValues!==void 0)L=L._then(this._eachComplete,void 0,void 0,this,void 0);L._then(H,H,void 0,L,this)},$.prototype.reduce=function(X,L){return G(this,X,L,null)},$.reduce=function(X,L,D,F){return G(X,L,D,F)};function H(X,L){if(this.isFulfilled())L._resolve(X);else L._reject(X)}function G(X,L,D,F){if(typeof L!=="function")return z("expecting a function but got "+Q.classString(L));var T=new K(X,L,D,F);return T.promise()}function W(X){this.accum=X,this.array._gotAccum(X);var L=q(this.value,this.array._promise);if(L instanceof $)return this.array._currentCancellable=L,L._then(V,void 0,void 0,this,void 0);else return V.call(this,L)}function V(X){var L=this.array,D=L._promise,F=w(L._fn);D._pushContext();var T;if(L._eachValues!==void 0)T=F.call(D._boundValue(),X,this.index,this.length);else T=F.call(D._boundValue(),this.accum,X,this.index,this.length);if(T instanceof $)L._currentCancellable=T;var P=D._popContext();return Y.checkForgottenReturns(T,P,L._eachValues!==void 0?"Promise.each":"Promise.reduce",D),T}}});var Fw0=O((fC1,Dw0)=>{Dw0.exports=function($,I,z){var q=$.PromiseInspection,U=d1();function Y(J){this.constructor$(J)}U.inherits(Y,I),Y.prototype._promiseResolved=function(J,Q){this._values[J]=Q;var w=++this._totalResolved;if(w>=this._length)return this._resolve(this._values),!0;return!1},Y.prototype._promiseFulfilled=function(J,Q){var w=new q;return w._bitField=33554432,w._settledValueField=J,this._promiseResolved(Q,w)},Y.prototype._promiseRejected=function(J,Q){var w=new q;return w._bitField=16777216,w._settledValueField=J,this._promiseResolved(Q,w)},$.settle=function(J){return z.deprecated(".settle()",".reflect()"),new Y(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Nw0=O((nC1,Ow0)=>{Ow0.exports=function($,I,z){var q=d1(),U=b5().RangeError,Y=b5().AggregateError,J=q.isArray,Q={};function w(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}q.inherits(w,I),w.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var H=J(this._values);if(!this._isResolved()&&H&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},w.prototype.init=function(){this._initialized=!0,this._init()},w.prototype.setUnwrap=function(){this._unwrap=!0},w.prototype.howMany=function(){return this._howMany},w.prototype.setHowMany=function(H){this._howMany=H},w.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
See http://goo.gl/MqrFmX
`);var W=new w(H),V=W.promise();return W.setHowMany(G),W.init(),V}$.some=function(H,G){return K(H,G)},$.prototype.some=function(H){return K(this,H)},$._SomePromiseArray=w}});var Zw0=O((_C1,Vw0)=>{Vw0.exports=function($,I){var z=$.map;$.prototype.filter=function(q,U){return z(this,q,U,I)},$.filter=function(q,U,Y){return z(q,U,Y,I)}}});var Lw0=O((CC1,Xw0)=>{Xw0.exports=function($,I){var{reduce:z,all:q}=$;function U(){return q(this)}function Y(J,Q){return z(J,Q,I,I)}$.prototype.each=function(J){return z(this,J,I,0)._then(U,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return z(this,J,I,I)},$.each=function(J,Q){return z(J,Q,I,0)._then(U,void 0,void 0,J,void 0)},$.mapSeries=Y}});var Fw0=O((hC1,Dw0)=>{Dw0.exports=function($){var I=$._SomePromiseArray;function z(q){var U=new I(q),Y=U.promise();return U.setHowMany(1),U.setUnwrap(),U.init(),Y}$.any=function(q){return z(q)},$.prototype.any=function(){return z(this)}}});var Ow0=O((SC1,HS)=>{HS.exports=function(){var $=function(){return new G(`circular promise resolution chain
`);var W=new w(H),V=W.promise();return W.setHowMany(G),W.init(),V}$.some=function(H,G){return K(H,G)},$.prototype.some=function(H){return K(this,H)},$._SomePromiseArray=w}});var Aw0=O((bC1,Mw0)=>{Mw0.exports=function($,I){var z=$.map;$.prototype.filter=function(q,U){return z(this,q,U,I)},$.filter=function(q,U,Y){return z(q,U,Y,I)}}});var Tw0=O((iC1,Pw0)=>{Pw0.exports=function($,I){var{reduce:z,all:q}=$;function U(){return q(this)}function Y(J,Q){return z(J,Q,I,I)}$.prototype.each=function(J){return z(this,J,I,0)._then(U,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return z(this,J,I,I)},$.each=function(J,Q){return z(J,Q,I,0)._then(U,void 0,void 0,J,void 0)},$.mapSeries=Y}});var Bw0=O((pC1,Ew0)=>{Ew0.exports=function($){var I=$._SomePromiseArray;function z(q){var U=new I(q),Y=U.promise();return U.setHowMany(1),U.setUnwrap(),U.init(),Y}$.any=function(q){return z(q)},$.prototype.any=function(){return z(this)}}});var jw0=O((cC1,WS)=>{WS.exports=function(){var $=function(){return new G(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},I=function(){return new S.PromiseInspection(this._target())},z=function(v){return S.reject(new G(v))};function q(){}var U={},Y=d1(),J;if(Y.isNode)J=function(){var v=process.domain;if(v===void 0)v=null;return v};else J=function(){return null};Y.notEnumerableProp(S,"_getDomain",J);var Q=s3(),w=W20(),K=new w;Q.defineProperty(S,"_async",{value:K});var H=b5(),G=S.TypeError=H.TypeError;S.RangeError=H.RangeError;var W=S.CancellationError=H.CancellationError;S.TimeoutError=H.TimeoutError,S.OperationalError=H.OperationalError,S.RejectionError=H.OperationalError,S.AggregateError=H.AggregateError;var V=function(){},X={},L={},D=D20()(S,V),F=O20()(S,V,D,z,q),T=M20()(S),P=T.create,M=P20()(S,T),B=M.CapturedTrace,u=E20()(S,D),h=j20()(L),x=wS(),g=Y.errorObj,p=Y.tryCatch;function i(v,n){if(typeof n!=="function")throw new G("expecting a function but got "+Y.classString(n));if(v.constructor!==S)throw new G(`the promise constructor cannot be invoked directly
`)},I=function(){return new S.PromiseInspection(this._target())},z=function(v){return S.reject(new G(v))};function q(){}var U={},Y=d1(),J;if(Y.isNode)J=function(){var v=process.domain;if(v===void 0)v=null;return v};else J=function(){return null};Y.notEnumerableProp(S,"_getDomain",J);var Q=s3(),w=N20(),K=new w;Q.defineProperty(S,"_async",{value:K});var H=b5(),G=S.TypeError=H.TypeError;S.RangeError=H.RangeError;var W=S.CancellationError=H.CancellationError;S.TimeoutError=H.TimeoutError,S.OperationalError=H.OperationalError,S.RejectionError=H.OperationalError,S.AggregateError=H.AggregateError;var V=function(){},X={},L={},D=E20()(S,V),F=j20()(S,V,D,z,q),T=g20()(S),P=T.create,M=_20()(S,T),j=M.CapturedTrace,u=h20()(S,D),h=y20()(L),x=HS(),g=Y.errorObj,p=Y.tryCatch;function i(v,n){if(typeof n!=="function")throw new G("expecting a function but got "+Y.classString(n));if(v.constructor!==S)throw new G(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function S(v){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,v!==V)i(this,v),this._resolveFromExecutor(v);this._promiseCreated(),this._fireEvent("promiseCreated",this)}S.prototype.toString=function(){return"[object Promise]"},S.prototype.caught=S.prototype.catch=function(v){var n=arguments.length;if(n>1){var c=Array(n-1),r=0,U0;for(U0=0;U0<n-1;++U0){var G0=arguments[U0];if(Y.isObject(G0))c[r++]=G0;else return z("expecting an object but got A catch statement predicate "+Y.classString(G0))}return c.length=r,v=arguments[U0],this.then(void 0,h(c,v,this))}return this.then(void 0,v)},S.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},S.prototype.then=function(v,n){if(M.warnings()&&arguments.length>0&&typeof v!=="function"&&typeof n!=="function"){var c=".then() only accepts functions but was passed: "+Y.classString(v);if(arguments.length>1)c+=", "+Y.classString(n);this._warn(c)}return this._then(v,n,void 0,void 0,void 0)},S.prototype.done=function(v,n){var c=this._then(v,n,void 0,void 0,void 0);c._setIsFinal()},S.prototype.spread=function(v){if(typeof v!=="function")return z("expecting a function but got "+Y.classString(v));return this.all()._then(v,void 0,void 0,X,void 0)},S.prototype.toJSON=function(){var v={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())v.fulfillmentValue=this.value(),v.isFulfilled=!0;else if(this.isRejected())v.rejectionReason=this.reason(),v.isRejected=!0;return v},S.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new F(this).promise()},S.prototype.error=function(v){return this.caught(Y.originatesFromRejection,v)},S.getNewLibraryCopy=HS.exports,S.is=function(v){return v instanceof S},S.fromNode=S.fromCallback=function(v){var n=new S(V);n._captureStackTrace();var c=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=p(v)(x(n,c));if(r===g)n._rejectCallback(r.e,!0);if(!n._isFateSealed())n._setAsyncGuaranteed();return n},S.all=function(v){return new F(v).promise()},S.cast=function(v){var n=D(v);if(!(n instanceof S))n=new S(V),n._captureStackTrace(),n._setFulfilled(),n._rejectionHandler0=v;return n},S.resolve=S.fulfilled=S.cast,S.reject=S.rejected=function(v){var n=new S(V);return n._captureStackTrace(),n._rejectCallback(v,!0),n},S.setScheduler=function(v){if(typeof v!=="function")throw new G("expecting a function but got "+Y.classString(v));return K.setScheduler(v)},S.prototype._then=function(v,n,c,r,U0){var G0=U0!==void 0,A0=G0?U0:new S(V),g0=this._target(),Q1=g0._bitField;if(!G0){if(A0._propagateFrom(this,3),A0._captureStackTrace(),r===void 0&&(this._bitField&2097152)!==0)if((Q1&50397184)!==0)r=this._boundValue();else r=g0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,A0)}var f0=J();if((Q1&50397184)!==0){var z1,M0,Y0=g0._settlePromiseCtx;if((Q1&33554432)!==0)M0=g0._rejectionHandler0,z1=v;else if((Q1&16777216)!==0)M0=g0._fulfillmentHandler0,z1=n,g0._unsetRejectionIsUnhandled();else Y0=g0._settlePromiseLateCancellationObserver,M0=new W("late cancellation observer"),g0._attachExtraTrace(M0),z1=n;K.invoke(Y0,g0,{handler:f0===null?z1:typeof z1==="function"&&Y.domainBind(f0,z1),promise:A0,receiver:r,value:M0})}else g0._addCallbacks(v,n,A0,r,f0);return A0},S.prototype._length=function(){return this._bitField&65535},S.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},S.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},S.prototype._setLength=function(v){this._bitField=this._bitField&-65536|v&65535},S.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},S.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},S.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},S.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},S.prototype._isFinal=function(){return(this._bitField&4194304)>0},S.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},S.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},S.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},S.prototype._setAsyncGuaranteed=function(){if(K.hasCustomScheduler())return;this._bitField=this._bitField|134217728},S.prototype._receiverAt=function(v){var n=v===0?this._receiver0:this[v*4-4+3];if(n===U)return;else if(n===void 0&&this._isBound())return this._boundValue();return n},S.prototype._promiseAt=function(v){return this[v*4-4+2]},S.prototype._fulfillmentHandlerAt=function(v){return this[v*4-4+0]},S.prototype._rejectionHandlerAt=function(v){return this[v*4-4+1]},S.prototype._boundValue=function(){},S.prototype._migrateCallback0=function(v){var{_bit Line truncated
`)}function S(v){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,v!==V)i(this,v),this._resolveFromExecutor(v);this._promiseCreated(),this._fireEvent("promiseCreated",this)}S.prototype.toString=function(){return"[object Promise]"},S.prototype.caught=S.prototype.catch=function(v){var n=arguments.length;if(n>1){var c=Array(n-1),r=0,U0;for(U0=0;U0<n-1;++U0){var G0=arguments[U0];if(Y.isObject(G0))c[r++]=G0;else return z("expecting an object but got A catch statement predicate "+Y.classString(G0))}return c.length=r,v=arguments[U0],this.then(void 0,h(c,v,this))}return this.then(void 0,v)},S.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},S.prototype.then=function(v,n){if(M.warnings()&&arguments.length>0&&typeof v!=="function"&&typeof n!=="function"){var c=".then() only accepts functions but was passed: "+Y.classString(v);if(arguments.length>1)c+=", "+Y.classString(n);this._warn(c)}return this._then(v,n,void 0,void 0,void 0)},S.prototype.done=function(v,n){var c=this._then(v,n,void 0,void 0,void 0);c._setIsFinal()},S.prototype.spread=function(v){if(typeof v!=="function")return z("expecting a function but got "+Y.classString(v));return this.all()._then(v,void 0,void 0,X,void 0)},S.prototype.toJSON=function(){var v={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())v.fulfillmentValue=this.value(),v.isFulfilled=!0;else if(this.isRejected())v.rejectionReason=this.reason(),v.isRejected=!0;return v},S.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new F(this).promise()},S.prototype.error=function(v){return this.caught(Y.originatesFromRejection,v)},S.getNewLibraryCopy=WS.exports,S.is=function(v){return v instanceof S},S.fromNode=S.fromCallback=function(v){var n=new S(V);n._captureStackTrace();var c=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=p(v)(x(n,c));if(r===g)n._rejectCallback(r.e,!0);if(!n._isFateSealed())n._setAsyncGuaranteed();return n},S.all=function(v){return new F(v).promise()},S.cast=function(v){var n=D(v);if(!(n instanceof S))n=new S(V),n._captureStackTrace(),n._setFulfilled(),n._rejectionHandler0=v;return n},S.resolve=S.fulfilled=S.cast,S.reject=S.rejected=function(v){var n=new S(V);return n._captureStackTrace(),n._rejectCallback(v,!0),n},S.setScheduler=function(v){if(typeof v!=="function")throw new G("expecting a function but got "+Y.classString(v));return K.setScheduler(v)},S.prototype._then=function(v,n,c,r,U0){var G0=U0!==void 0,A0=G0?U0:new S(V),g0=this._target(),Q1=g0._bitField;if(!G0){if(A0._propagateFrom(this,3),A0._captureStackTrace(),r===void 0&&(this._bitField&2097152)!==0)if((Q1&50397184)!==0)r=this._boundValue();else r=g0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,A0)}var f0=J();if((Q1&50397184)!==0){var z1,M0,Y0=g0._settlePromiseCtx;if((Q1&33554432)!==0)M0=g0._rejectionHandler0,z1=v;else if((Q1&16777216)!==0)M0=g0._fulfillmentHandler0,z1=n,g0._unsetRejectionIsUnhandled();else Y0=g0._settlePromiseLateCancellationObserver,M0=new W("late cancellation observer"),g0._attachExtraTrace(M0),z1=n;K.invoke(Y0,g0,{handler:f0===null?z1:typeof z1==="function"&&Y.domainBind(f0,z1),promise:A0,receiver:r,value:M0})}else g0._addCallbacks(v,n,A0,r,f0);return A0},S.prototype._length=function(){return this._bitField&65535},S.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},S.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},S.prototype._setLength=function(v){this._bitField=this._bitField&-65536|v&65535},S.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},S.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},S.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},S.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},S.prototype._isFinal=function(){return(this._bitField&4194304)>0},S.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},S.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},S.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},S.prototype._setAsyncGuaranteed=function(){if(K.hasCustomScheduler())return;this._bitField=this._bitField|134217728},S.prototype._receiverAt=function(v){var n=v===0?this._receiver0:this[v*4-4+3];if(n===U)return;else if(n===void 0&&this._isBound())return this._boundValue();return n},S.prototype._promiseAt=function(v){return this[v*4-4+2]},S.prototype._fulfillmentHandlerAt=function(v){return this[v*4-4+0]},S.prototype._rejectionHandlerAt=function(v){return this[v*4-4+1]},S.prototype._boundValue=function(){},S.prototype._migrateCallback0=function(v){var{_bit Line truncated
path = %s
syscall = %s
fstream_type = %s
@@ -225,49 +225,49 @@ fstream_class = %s
fstream_stack =
%s
`,I||"UNKNOWN",q.stack,q.path,q.syscall,q.fstream_type,q.fstream_path,q.fstream_unc_path,q.fstream_class,q.fstream_stack.join(`
`));else z.emit("warn",q)};N7.prototype.info=function($,I){this.emit("info",$,I)};N7.prototype.error=function($,I,z){var q=sK0($,I,this);if(z)throw q;else this.emit("error",q)};function sK0($,I,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(q){return q.replace(/^ {4}at /,"")}),$}});var qw=O((Hh1,$H0)=>{$H0.exports=JJ1;function JJ1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var q=0,U=I.length;q<U;q++){z=I[q];var Y=$[z]||$["is"+z];if(typeof Y==="function")Y=Y.call($);if(Y)return $[z]=!0,$.type=z,z}return null}});var tS=O((Gh1,IH0)=>{IH0.exports=Uw;var QJ1=$$(),wJ1=d0(),rS=QI();wJ1(Uw,rS);function Uw($){var I=this;if(!(I instanceof Uw))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);rS.call(I,$)}Uw.prototype._stat=function($){var I=this;QJ1.readlink(I._path,function(z,q){if(z)return I.error(z);I.linkpath=I.props.linkpath=q,I.emit("linkpath",q),rS.prototype._stat.call(I,$)})};Uw.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var sS=O((Wh1,UH0)=>{UH0.exports=a8;var qH0=$$(),KJ1=d0(),Yw=t("path"),aS=QI(),zH0=t("assert").ok;KJ1(a8,aS);function a8($){var I=this;if(!(I instanceof a8))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(I.entries=null,I._index=-1,I._paused=!1,I._length=-1,$.sort)this.sort=$.sort;aS.call(this,$)}a8.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,qH0.readdir($._path,function(I,z){if(I)return $.error(I);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",q);else q();function q(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};a8.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var I=Yw.resolve($._path,$.entries[$._index]);zH0(I!==$._path),zH0($.entries[$._index]),$._currentEntry=I,qH0[$.props.follow?"stat":"lstat"](I,function(z,q){if(z)return $.error(z);var U=$._proxy||$;q.path=I,q.basename=Yw.basename(I),q.dirname=Yw.dirname(I);var Y=$.getChildProps.call(U,q);Y.path=I,Y.basename=Yw.basename(I),Y.dirname=Yw.dirname(I);var J=aS(Y,q);$._currentEntry=J,J.on("pause",function(K){if(!$._paused&&!J._disowned)$.pause(K)}),J.on("resume",function(K){if($._paused&&!J._disowned)$.resume(K)}),J.on("stat",function(K){if($.emit("_entryStat",J,K),J._aborted)return;if(J._paused)J.once("resume",function(){$.emit("entryStat",J,K)});else $.emit("entryStat",J,K)}),J.on("ready",function K(){if($._paused)return J.pause($),$.once("resume",K);if(J.type==="Socket")$.emit("socket",J);else $.emitEntry(J)});var Q=!1;J.on("close",w),J.on("disown",w);function w(){if(Q)return;if(Q=!0,$.emit("childEnd",J),$.emit("entryEnd",J),$._currentEntry=null,!$._paused)$._read()}J.on("error",function(K){if(J._swallowErrors)$.warn(K),J.emit("end"),J.emit("close");else $.emit("error",K)}),["child","childEnd","warn"].forEach(function(K){J.on(K,$.emit.bind($,K))})})};a8.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};a8.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};a8.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._currentEntry&&I._currentEntry.pause)I._currentEntry.pause($);I.emit("pause",$)};a8.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I._paused=!1,I.emit("resume",$),I._paused)return;if(I._currentEntry){if(I._currentEntry.resume)I._currentEntry.resume($)}else I._read()};a8.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var eS=O((Vh1,wH0)=>{wH0.exports=wI;var HJ1=$$(),GJ1=d0(),YH0=QI(),JH0={EOF:!0},QH0={CLOSE:!0};GJ1(wI,YH0);function wI($){var I=this;if(!(I instanceof wI))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);I._buffer=[],I._bytesEmitted=0,YH0.call(I,$)}wI.prototype._getStream=function(){var $=this,I=$._stream=HJ1.createReadStream($._path,$.pro Line truncated
`));else z.emit("warn",q)};N7.prototype.info=function($,I){this.emit("info",$,I)};N7.prototype.error=function($,I,z){var q=JH0($,I,this);if(z)throw q;else this.emit("error",q)};function JH0($,I,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(q){return q.replace(/^ {4}at /,"")}),$}});var Uw=O((Nh1,wH0)=>{wH0.exports=ZJ1;function ZJ1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var q=0,U=I.length;q<U;q++){z=I[q];var Y=$[z]||$["is"+z];if(typeof Y==="function")Y=Y.call($);if(Y)return $[z]=!0,$.type=z,z}return null}});var sS=O((Mh1,KH0)=>{KH0.exports=Yw;var XJ1=$$(),LJ1=d0(),aS=QI();LJ1(Yw,aS);function Yw($){var I=this;if(!(I instanceof Yw))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);aS.call(I,$)}Yw.prototype._stat=function($){var I=this;XJ1.readlink(I._path,function(z,q){if(z)return I.error(z);I.linkpath=I.props.linkpath=q,I.emit("linkpath",q),aS.prototype._stat.call(I,$)})};Yw.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var $y=O((Ah1,WH0)=>{WH0.exports=a8;var GH0=$$(),DJ1=d0(),Jw=t("path"),eS=QI(),HH0=t("assert").ok;DJ1(a8,eS);function a8($){var I=this;if(!(I instanceof a8))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(I.entries=null,I._index=-1,I._paused=!1,I._length=-1,$.sort)this.sort=$.sort;eS.call(this,$)}a8.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,GH0.readdir($._path,function(I,z){if(I)return $.error(I);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",q);else q();function q(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};a8.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var I=Jw.resolve($._path,$.entries[$._index]);HH0(I!==$._path),HH0($.entries[$._index]),$._currentEntry=I,GH0[$.props.follow?"stat":"lstat"](I,function(z,q){if(z)return $.error(z);var U=$._proxy||$;q.path=I,q.basename=Jw.basename(I),q.dirname=Jw.dirname(I);var Y=$.getChildProps.call(U,q);Y.path=I,Y.basename=Jw.basename(I),Y.dirname=Jw.dirname(I);var J=eS(Y,q);$._currentEntry=J,J.on("pause",function(K){if(!$._paused&&!J._disowned)$.pause(K)}),J.on("resume",function(K){if($._paused&&!J._disowned)$.resume(K)}),J.on("stat",function(K){if($.emit("_entryStat",J,K),J._aborted)return;if(J._paused)J.once("resume",function(){$.emit("entryStat",J,K)});else $.emit("entryStat",J,K)}),J.on("ready",function K(){if($._paused)return J.pause($),$.once("resume",K);if(J.type==="Socket")$.emit("socket",J);else $.emitEntry(J)});var Q=!1;J.on("close",w),J.on("disown",w);function w(){if(Q)return;if(Q=!0,$.emit("childEnd",J),$.emit("entryEnd",J),$._currentEntry=null,!$._paused)$._read()}J.on("error",function(K){if(J._swallowErrors)$.warn(K),J.emit("end"),J.emit("close");else $.emit("error",K)}),["child","childEnd","warn"].forEach(function(K){J.on(K,$.emit.bind($,K))})})};a8.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};a8.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};a8.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._currentEntry&&I._currentEntry.pause)I._currentEntry.pause($);I.emit("pause",$)};a8.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I._paused=!1,I.emit("resume",$),I._paused)return;if(I._currentEntry){if(I._currentEntry.resume)I._currentEntry.resume($)}else I._read()};a8.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var Iy=O((Ph1,LH0)=>{LH0.exports=wI;var FJ1=$$(),OJ1=d0(),VH0=QI(),ZH0={EOF:!0},XH0={CLOSE:!0};OJ1(wI,VH0);function wI($){var I=this;if(!(I instanceof wI))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);I._buffer=[],I._bytesEmitted=0,VH0.call(I,$)}wI.prototype._getStream=function(){var $=this,I=$._stream=FJ1.createReadStream($._path,$.pro Line truncated
expect: `+$.props.size+`
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(QH0),$._read();else $.emit("close")}),I.on("error",function(z){$.emit("error",z)}),$._read()};wI.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var z=0,q=I.length;z<q;z++){var U=I[z];if(U===JH0)$.emit("end");else if(U===QH0)$.emit("close");else $.emit("data",U);if($._paused){$._buffer=I.slice(z);return}}$._buffer.length=0}};wI.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};wI.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I.emit("resume",$),I._paused=!1,I._stream)I._stream.resume();I._read()}});var GH0=O((Zh1,HH0)=>{HH0.exports=kL;var WJ1=d0(),KH0=QI();WJ1(kL,KH0);function kL($){var I=this;if(!(I instanceof kL))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);KH0.call(I,$)}kL.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Iy=O((Xh1,WH0)=>{WH0.exports=KI;var $y=QI(),VJ1=qw(),ZJ1=d0(),XJ1=$$();ZJ1(KI,$y);function KI($){var I=this;if(!(I instanceof KI))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,$y.call(I,$)}KI.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";XJ1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=VJ1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy($y(I,U))})};KI.prototype._addProxy=function($){var I=this;if(I._proxyTarget)return I.error("proxy already set");I._proxyTarget=$,$._proxy=I,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(q){$.on(q,I.emit.bind(I,q))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var z=I._buffer;I._buffer.length=0,z.forEach(function(q){$[q[0]].apply($,q[1])})};KI.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};KI.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var QI=O((Lh1,XH0)=>{XH0.exports=D8;var LJ1=$$(),DJ1=t("stream").Stream,FJ1=d0(),zy=t("path"),qy=qw(),fL=D8.hardLinks={},VH0=xL();FJ1(D8,VH0);var ZH0=tS();function D8($,I){var z=this;if(!(z instanceof D8))return new D8($,I);if(typeof $==="string")$={path:$};var q,U;if($.type&&typeof $.type==="function")q=$.type,U=q;else q=qy($),U=D8;if(I&&!q)q=qy(I),$[q]=!0,$.type=q;switch(q){case"Directory":U=sS();break;case"Link":case"File":U=eS();break;case"SymbolicLink":U=ZH0;break;case"Socket":U=GH0();break;case null:U=Iy();break}if(!(z instanceof U))return new U($);if(VH0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=q,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=zy.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=zy.basename(z.path),z.dirname=$.dirname=zy.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=OJ1;z._stat(I)}function OJ1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}D8.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat";if($)process.nextTick(U.bind(null,null,$));else LJ1[q](I._path,U);function U(Y,J){if(Y)return I.error(Y);if(Object.keys(J).forEach(function(V){z[V]=J[V]}),I.size!==void 0&&z.size!==I.size)return I.error("incorrect size");I.size=z.size;var Q=qy(z),w=z.hardlinks!==!1;if(w&&Q!=="Directory"&&z.nlink&&z.nlink>1){var K=z.dev+":"+z.ino;if(fL[K]===I._path||!fL[K])fL[K]=I._path;else Q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=fL[K],I._stat=I._read=ZH0.prototype._read}if(I.type&&I.type!==Q)I.error("Unexpected type: "+Q);if(I.filter){var H=I._proxy||I;if(!I.filter.call(H,H,z)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var G=["_stat","stat","ready"],W=0;(function V(){if(I._aborted){I.emit("end"),I.emit("close");return}if(I._paused&&I.type!=="Directory"){I.once("resume",V);return}var X=G[W++];if(!X)return I._read();I.emit(X,z),V()})()}};D8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(z){var q=$.add(z);if(q===!1)I.pause()});return DJ1.prototype.pipe.apply(this,arguments)};D8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};D8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};D8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Qy=O((Dh1,PH0)=>{P Line truncated
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(XH0),$._read();else $.emit("close")}),I.on("error",function(z){$.emit("error",z)}),$._read()};wI.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var z=0,q=I.length;z<q;z++){var U=I[z];if(U===ZH0)$.emit("end");else if(U===XH0)$.emit("close");else $.emit("data",U);if($._paused){$._buffer=I.slice(z);return}}$._buffer.length=0}};wI.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};wI.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I.emit("resume",$),I._paused=!1,I._stream)I._stream.resume();I._read()}});var OH0=O((Th1,FH0)=>{FH0.exports=fL;var NJ1=d0(),DH0=QI();NJ1(fL,DH0);function fL($){var I=this;if(!(I instanceof fL))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);DH0.call(I,$)}fL.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var qy=O((Eh1,NH0)=>{NH0.exports=KI;var zy=QI(),MJ1=Uw(),AJ1=d0(),PJ1=$$();AJ1(KI,zy);function KI($){var I=this;if(!(I instanceof KI))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,zy.call(I,$)}KI.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";PJ1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=MJ1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(zy(I,U))})};KI.prototype._addProxy=function($){var I=this;if(I._proxyTarget)return I.error("proxy already set");I._proxyTarget=$,$._proxy=I,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(q){$.on(q,I.emit.bind(I,q))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var z=I._buffer;I._buffer.length=0,z.forEach(function(q){$[q[0]].apply($,q[1])})};KI.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};KI.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var QI=O((Bh1,PH0)=>{PH0.exports=D8;var TJ1=$$(),EJ1=t("stream").Stream,BJ1=d0(),Uy=t("path"),Yy=Uw(),nL=D8.hardLinks={},MH0=kL();BJ1(D8,MH0);var AH0=sS();function D8($,I){var z=this;if(!(z instanceof D8))return new D8($,I);if(typeof $==="string")$={path:$};var q,U;if($.type&&typeof $.type==="function")q=$.type,U=q;else q=Yy($),U=D8;if(I&&!q)q=Yy(I),$[q]=!0,$.type=q;switch(q){case"Directory":U=$y();break;case"Link":case"File":U=Iy();break;case"SymbolicLink":U=AH0;break;case"Socket":U=OH0();break;case null:U=qy();break}if(!(z instanceof U))return new U($);if(MH0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=q,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=Uy.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=Uy.basename(z.path),z.dirname=$.dirname=Uy.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=jJ1;z._stat(I)}function jJ1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}D8.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat";if($)process.nextTick(U.bind(null,null,$));else TJ1[q](I._path,U);function U(Y,J){if(Y)return I.error(Y);if(Object.keys(J).forEach(function(V){z[V]=J[V]}),I.size!==void 0&&z.size!==I.size)return I.error("incorrect size");I.size=z.size;var Q=Yy(z),w=z.hardlinks!==!1;if(w&&Q!=="Directory"&&z.nlink&&z.nlink>1){var K=z.dev+":"+z.ino;if(nL[K]===I._path||!nL[K])nL[K]=I._path;else Q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=nL[K],I._stat=I._read=AH0.prototype._read}if(I.type&&I.type!==Q)I.error("Unexpected type: "+Q);if(I.filter){var H=I._proxy||I;if(!I.filter.call(H,H,z)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var G=["_stat","stat","ready"],W=0;(function V(){if(I._aborted){I.emit("end"),I.emit("close");return}if(I._paused&&I.type!=="Directory"){I.once("resume",V);return}var X=G[W++];if(!X)return I._read();I.emit(X,z),V()})()}};D8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(z){var q=$.add(z);if(q===!1)I.pause()});return EJ1.prototype.pipe.apply(this,arguments)};D8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};D8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};D8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Ky=O((jh1,_H0)=>{_ Line truncated
expect: `+$.size+`
actual: `+$._bytesWritten);tL.prototype._finish.call($)}});var Fy=O((yh1,WG0)=>{WG0.exports=E7;var Dy=TU(),mJ1=qw(),lJ1=d0(),oJ1=oL(),rJ1=t("fs");lJ1(E7,Dy);function E7($){var I=this;if(!(I instanceof E7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,Dy.call(I,$)}E7.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";rJ1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=mJ1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(Dy(I,U))})};E7.prototype._addProxy=function($){var I=this;if(I._proxy)return I.error("proxy already set");I._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(q){$.on(q,I.emit.bind(I,q))}),I.emit("proxy",$);var z=I._buffer;if(z.forEach(function(q){$[q[0]].apply($,q[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};E7.prototype.add=function($){if(oJ1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};E7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};E7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var TU=O((uh1,MG0)=>{MG0.exports=d$;var c$=$$(),tJ1=d0(),aJ1=Qy(),sJ1=Wy(),Kw=t("path"),ZG0=process.platform==="win32"?0:process.umask(),XG0=qw(),LG0=xL();tJ1(d$,LG0);d$.dirmode=parseInt("0777",8)&~ZG0;d$.filemode=parseInt("0666",8)&~ZG0;var eJ1=Zy(),$Q1=Xy(),IQ1=Ly(),zQ1=Fy();function d$($,I){var z=this;if(typeof $==="string")$={path:$};var q=XG0($),U=d$;switch(q){case"Directory":U=eJ1;break;case"File":U=IQ1;break;case"Link":case"SymbolicLink":U=$Q1;break;case null:default:U=zQ1;break}if(!(z instanceof U))return new U($);if(LG0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=Kw.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=Kw.basename($.path),z.dirname=Kw.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(I)}d$.prototype._create=function(){var $=this;c$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};d$.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat",U=I._proxy||I;if($)Y(null,$);else c$[q](I._path,Y);function Y(J,Q){if(I.filter&&!I.filter.call(U,U,Q)){I._aborted=!0,I.emit("end"),I.emit("close");return}if(J||!Q)return Oy(I);I._old=Q;var w=XG0(Q);if(w!==I.type||I.type==="File"&&Q.nlink>1)return aJ1(I._path,function(K){if(K)return I.error(K);I._old=null,Oy(I)});Oy(I)}};function Oy($){sJ1(Kw.dirname($._path),d$.dirmode,function(I,z){if(I)return $.error(I);return $._madeDir=z,$._create()})}function DG0($,I,z,q,U){var Y=I.mode,J=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!c$[J])return U();if(typeof Y!=="number")return U();var Q=z.mode&parseInt("0777",8);if(Y=Y&parseInt("0777",8),Y===Q)return U();c$[J](q,Y,U)}function FG0($,I,z,q,U){if(process.platform==="win32")return U();if(!process.getuid||process.getuid()!==0)return U();if(typeof I.uid!=="number"&&typeof I.gid!=="number")return U();if(z.uid===I.uid&&z.gid===I.gid)return U();var Y=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!c$[Y])return U();if(typeof I.uid!=="number")I.uid=z.uid;if(typeof I.gid!=="number")I.gid=z.gid;c$[Y](q,I.uid,I.gid,U)}function OG0($,I,z,q,U){if(!c$.utimes||process.platform==="win32")return U();var Y=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Y==="lutimes"&&!c$[Y])Y="utimes";if(!c$[Y])return U();var{atime:J,mtime:Q}=z,w=I.atime,K=I.mtime;if(w===void 0)w=J;if(K===void 0)K=Q;if(!VG0(w))w=new Date(w);if(!VG0(K))w=new Date(K);if(w.getTime()===J.getTime()&&K.getTime()===Q.getTime())return U();c$[Y](q,w,K,U)}d$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,z=null,q=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Y($._old);else{var U=$.props.follow?"stat":"lstat";c$[U]($._path,function(Q,w){if(Q)if(Q.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(Q);Y($._old=w)})}return;function Y(Q){I+=3,DG0($,$.props,Q,$._path,J("chmod")),FG0($,$.props,Q,$._path,J("chown")),OG0($,$.props,Q,$._path,J("utimes"))}function J(Q){return function(w){if(z)return;if(w)return w.fstream_finish_call=Q,$.error(z=w);if(--I>0)return;if(q)return;if(q=!0,!$._madeDir)return K();else NG0($,$._path,K);function K(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function NG0($,I,z){var q=$._madeDir,U=Kw.dirname(I);qQ1($,U,function(Y){if(Y)return z(Y);if(U===q)return z();NG0($,U,z)})}function qQ1($,I,z){var q={};Object.keys($.props).forEach(function(Q){if(q[Q]=$.props[Q],Q==="mode"&&$.type!=="Directory")q[Q]=q[Q]|parseInt("0111",8)});var U=3,Y=null;c$.stat(I,function(Q,w){if(Q)return z(Y=Q);DG0($,q,w,I,J),FG0($,q,w,I,J),OG0($,q,w,I,J)});function J(Q){if(Y)return;if(Q)return z(Y=Q);if(--U===0)return z()}}d$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};d$.prototype.add=function(){this.error("Can't add to non-Directory type")};d$.prototype.write=function(){return!0};function UQ1($){return Object.prototype.toString.call($)}function VG0($){return typeof $==="object"&&UQ1($)==="[object Date]"}});var Ty=O((YQ1)=>{YQ1.Abstract=xL();YQ1.Reader=QI();YQ1.Writer=TU();YQ1.File={Reader:eS(),Writer:Ly()};YQ1.Dir={Reader:sS(),Writer:Zy()};YQ1.Link={Reader:tS(),Writer:Xy()};YQ1.Proxy={Reader:Iy(),Writer:Fy()};YQ1.Reader.Dir=YQ1.DirReader=YQ1.Dir.Reader;YQ1.Reader.File=YQ1.FileReader=YQ1.File.Reader;YQ1.Reader.Link=YQ1.LinkReader=YQ1.Link.Reader;YQ1.Reader.Proxy=YQ1.ProxyReader=YQ1.Proxy.Reader;YQ1.Writer.Dir=YQ1.DirWriter=YQ1.Dir.Writer;YQ1.Writer.File=YQ1.FileWriter=YQ1.File.Writer;YQ1.Writer.Link=YQ1.LinkWriter=YQ1.Link.Writer;YQ1.Writer.Proxy=YQ1.ProxyWriter=YQ1.Proxy.Writer;YQ1.collect=oL()});var PG0=O((mh1,AG0)=>{AG0.exports=VQ1;var wQ1=vL(),KQ1=Ty().Writer,Ey=t("path"),HQ1=t("stream"),GQ1=lS(),WQ1=F7();function VQ1($){$.path=Ey.resolve(Ey.normalize($.path));var I=new wQ1($),z=new HQ1.Writable({objectMode:!0});z._write=function(U,Y,J){if(U.type=="Directory")return J();var Q=Ey.join($.path,U.path);if(Q.indexOf($.path)!=0)return J();let w=$.getWriter?$.getWriter({path:Q}):KQ1({path:Q});U.pipe(w).on("error",J).on("close",J)};var q=GQ1(I,z);return I.once("crx-header",function(U){q.crxHeader=U}),I.pipe(z).on("finish",function(){q.emit("close")}),q.promise=function(){return new WQ1(function(U,Y){q.on("close",U),q.on("error",Y)})},q}});var TG0=O((lh1,aL)=>{var k4=function($){var I=1e7,z=7,q=9007199254740992,U=W(q),Y="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function Q(N,A,C,k){if(typeof N>"u")return Q[0];if(typeof A<"u")return+A===10&&!C?j0(N):b6(N,A,C,k);return j0(N)}function w(N,A){this.value=N,this.sign=A,this.isSmall=!1}w.prototype=Object.create(Q.prototype);function K(N){this.value=N,this.sign=N<0,this.isSmall=!0}K.prototype=Object.create(Q.prototype);function H(N){th Line truncated
actual: `+$._bytesWritten);aL.prototype._finish.call($)}});var Ny=O((dh1,NG0)=>{NG0.exports=E7;var Oy=TU(),$Q1=Uw(),IQ1=d0(),zQ1=rL(),qQ1=t("fs");IQ1(E7,Oy);function E7($){var I=this;if(!(I instanceof E7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,Oy.call(I,$)}E7.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";qQ1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=$Q1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(Oy(I,U))})};E7.prototype._addProxy=function($){var I=this;if(I._proxy)return I.error("proxy already set");I._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(q){$.on(q,I.emit.bind(I,q))}),I.emit("proxy",$);var z=I._buffer;if(z.forEach(function(q){$[q[0]].apply($,q[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};E7.prototype.add=function($){if(zQ1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};E7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};E7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var TU=O((mh1,gG0)=>{gG0.exports=d$;var c$=$$(),UQ1=d0(),YQ1=Ky(),JQ1=Zy(),Hw=t("path"),AG0=process.platform==="win32"?0:process.umask(),PG0=Uw(),TG0=kL();UQ1(d$,TG0);d$.dirmode=parseInt("0777",8)&~AG0;d$.filemode=parseInt("0666",8)&~AG0;var QQ1=Ly(),wQ1=Dy(),KQ1=Fy(),HQ1=Ny();function d$($,I){var z=this;if(typeof $==="string")$={path:$};var q=PG0($),U=d$;switch(q){case"Directory":U=QQ1;break;case"File":U=KQ1;break;case"Link":case"SymbolicLink":U=wQ1;break;case null:default:U=HQ1;break}if(!(z instanceof U))return new U($);if(TG0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=Hw.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=Hw.basename($.path),z.dirname=Hw.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(I)}d$.prototype._create=function(){var $=this;c$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};d$.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat",U=I._proxy||I;if($)Y(null,$);else c$[q](I._path,Y);function Y(J,Q){if(I.filter&&!I.filter.call(U,U,Q)){I._aborted=!0,I.emit("end"),I.emit("close");return}if(J||!Q)return My(I);I._old=Q;var w=PG0(Q);if(w!==I.type||I.type==="File"&&Q.nlink>1)return YQ1(I._path,function(K){if(K)return I.error(K);I._old=null,My(I)});My(I)}};function My($){JQ1(Hw.dirname($._path),d$.dirmode,function(I,z){if(I)return $.error(I);return $._madeDir=z,$._create()})}function EG0($,I,z,q,U){var Y=I.mode,J=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!c$[J])return U();if(typeof Y!=="number")return U();var Q=z.mode&parseInt("0777",8);if(Y=Y&parseInt("0777",8),Y===Q)return U();c$[J](q,Y,U)}function BG0($,I,z,q,U){if(process.platform==="win32")return U();if(!process.getuid||process.getuid()!==0)return U();if(typeof I.uid!=="number"&&typeof I.gid!=="number")return U();if(z.uid===I.uid&&z.gid===I.gid)return U();var Y=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!c$[Y])return U();if(typeof I.uid!=="number")I.uid=z.uid;if(typeof I.gid!=="number")I.gid=z.gid;c$[Y](q,I.uid,I.gid,U)}function jG0($,I,z,q,U){if(!c$.utimes||process.platform==="win32")return U();var Y=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Y==="lutimes"&&!c$[Y])Y="utimes";if(!c$[Y])return U();var{atime:J,mtime:Q}=z,w=I.atime,K=I.mtime;if(w===void 0)w=J;if(K===void 0)K=Q;if(!MG0(w))w=new Date(w);if(!MG0(K))w=new Date(K);if(w.getTime()===J.getTime()&&K.getTime()===Q.getTime())return U();c$[Y](q,w,K,U)}d$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,z=null,q=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Y($._old);else{var U=$.props.follow?"stat":"lstat";c$[U]($._path,function(Q,w){if(Q)if(Q.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(Q);Y($._old=w)})}return;function Y(Q){I+=3,EG0($,$.props,Q,$._path,J("chmod")),BG0($,$.props,Q,$._path,J("chown")),jG0($,$.props,Q,$._path,J("utimes"))}function J(Q){return function(w){if(z)return;if(w)return w.fstream_finish_call=Q,$.error(z=w);if(--I>0)return;if(q)return;if(q=!0,!$._madeDir)return K();else vG0($,$._path,K);function K(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function vG0($,I,z){var q=$._madeDir,U=Hw.dirname(I);GQ1($,U,function(Y){if(Y)return z(Y);if(U===q)return z();vG0($,U,z)})}function GQ1($,I,z){var q={};Object.keys($.props).forEach(function(Q){if(q[Q]=$.props[Q],Q==="mode"&&$.type!=="Directory")q[Q]=q[Q]|parseInt("0111",8)});var U=3,Y=null;c$.stat(I,function(Q,w){if(Q)return z(Y=Q);EG0($,q,w,I,J),BG0($,q,w,I,J),jG0($,q,w,I,J)});function J(Q){if(Y)return;if(Q)return z(Y=Q);if(--U===0)return z()}}d$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};d$.prototype.add=function(){this.error("Can't add to non-Directory type")};d$.prototype.write=function(){return!0};function WQ1($){return Object.prototype.toString.call($)}function MG0($){return typeof $==="object"&&WQ1($)==="[object Date]"}});var By=O((VQ1)=>{VQ1.Abstract=kL();VQ1.Reader=QI();VQ1.Writer=TU();VQ1.File={Reader:Iy(),Writer:Fy()};VQ1.Dir={Reader:$y(),Writer:Ly()};VQ1.Link={Reader:sS(),Writer:Dy()};VQ1.Proxy={Reader:qy(),Writer:Ny()};VQ1.Reader.Dir=VQ1.DirReader=VQ1.Dir.Reader;VQ1.Reader.File=VQ1.FileReader=VQ1.File.Reader;VQ1.Reader.Link=VQ1.LinkReader=VQ1.Link.Reader;VQ1.Reader.Proxy=VQ1.ProxyReader=VQ1.Proxy.Reader;VQ1.Writer.Dir=VQ1.DirWriter=VQ1.Dir.Writer;VQ1.Writer.File=VQ1.FileWriter=VQ1.File.Writer;VQ1.Writer.Link=VQ1.LinkWriter=VQ1.Link.Writer;VQ1.Writer.Proxy=VQ1.ProxyWriter=VQ1.Proxy.Writer;VQ1.collect=rL()});var _G0=O((zS1,RG0)=>{RG0.exports=MQ1;var LQ1=gL(),DQ1=By().Writer,jy=t("path"),FQ1=t("stream"),OQ1=rS(),NQ1=F7();function MQ1($){$.path=jy.resolve(jy.normalize($.path));var I=new LQ1($),z=new FQ1.Writable({objectMode:!0});z._write=function(U,Y,J){if(U.type=="Directory")return J();var Q=jy.join($.path,U.path);if(Q.indexOf($.path)!=0)return J();let w=$.getWriter?$.getWriter({path:Q}):DQ1({path:Q});U.pipe(w).on("error",J).on("close",J)};var q=OQ1(I,z);return I.once("crx-header",function(U){q.crxHeader=U}),I.pipe(z).on("finish",function(){q.emit("close")}),q.promise=function(){return new NQ1(function(U,Y){q.on("close",U),q.on("error",Y)})},q}});var CG0=O((qS1,sL)=>{var k4=function($){var I=1e7,z=7,q=9007199254740992,U=W(q),Y="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function Q(N,A,C,k){if(typeof N>"u")return Q[0];if(typeof A<"u")return+A===10&&!C?j0(N):b6(N,A,C,k);return j0(N)}function w(N,A){this.value=N,this.sign=A,this.isSmall=!1}w.prototype=Object.create(Q.prototype);function K(N){this.value=N,this.sign=N<0,this.isSmall=!0}K.prototype=Object.create(Q.prototype);function H(N){th Line truncated
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/var b1=t("fs"),qD=t("os"),f4=t("path"),xG0=t("crypto"),s8={fs:b1.constants,os:qD.constants},bG0=/XXXXXX/,iG0=(s8.O_CREAT||s8.fs.O_CREAT)|(s8.O_EXCL||s8.fs.O_EXCL)|(s8.O_RDWR||s8.fs.O_RDWR),xQ1=qD.platform()==="win32",kQ1=s8.EBADF||s8.os.errno.EBADF,fQ1=s8.ENOENT||s8.os.errno.ENOENT,BU=[],pG0=b1.rmdirSync.bind(b1),cG0=!1;function nQ1($,I){return b1.rm($,{recursive:!0},I)}function dG0($){return b1.rmSync($,{recursive:!0})}function Ry($,I){let z=jU($,I),q=z[0],U=z[1];tQ1(q,function(Y,J){if(Y)return U(Y);let Q=J.tries;(function w(){try{let K=lG0(J);b1.stat(K,function(H){if(!H){if(Q-- >0)return w();return U(Error("Could not get a unique tmp filename, max tries reached "+K))}U(null,K)})}catch(K){U(K)}})()})}function _y($){let I=jU($),z=I[0],q=aQ1(z),U=q.tries;do{let Y=lG0(q);try{b1.statSync(Y)}catch(J){return Y}}while(U-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function bQ1($,I){let z=jU($,I),q=z[0],U=z[1];Ry(q,function(J,Q){if(J)return U(J);b1.open(Q,iG0,q.mode||384,function(K,H){if(K)return U(K);if(q.discardDescriptor)return b1.close(H,function(W){return U(W,Q,void 0,vy(Q,-1,q,!1))});else{let G=q.discardDescriptor||q.detachDescriptor;U(null,Q,H,vy(Q,G?-1:H,q,!1))}})})}function iQ1($){let I=jU($),z=I[0],q=z.discardDescriptor||z.detachDescriptor,U=_y(z),Y=b1.openSync(U,iG0,z.mode||384);if(z.discardDescriptor)b1.closeSync(Y),Y=void 0;return{name:U,fd:Y,removeCallback:vy(U,q?-1:Y,z,!0)}}function pQ1($,I){let z=jU($,I),q=z[0],U=z[1];Ry(q,function(J,Q){if(J)return U(J);b1.mkdir(Q,q.mode||448,function(K){if(K)return U(K);U(null,Q,mG0(Q,q,!1))})})}function cQ1($){let I=jU($),z=I[0],q=_y(z);return b1.mkdirSync(q,z.mode||448),{name:q,removeCallback:mG0(q,z,!0)}}function dQ1($,I){let z=function(q){if(q&&!gy(q))return I(q);I()};if(0<=$[0])b1.close($[0],function(){b1.unlink($[1],z)});else b1.unlink($[1],z)}function mQ1($){let I=null;try{if(0<=$[0])b1.closeSync($[0])}catch(z){if(!sQ1(z)&&!gy(z))throw z}finally{try{b1.unlinkSync($[1])}catch(z){if(!gy(z))I=z}}if(I!==null)throw I}function vy($,I,z,q){let U=zD(mQ1,[I,$],q),Y=zD(dQ1,[I,$],q,U);if(!z.keep)BU.unshift(U);return q?U:Y}function mG0($,I,z){let q=I.unsafeCleanup?nQ1:b1.rmdir.bind(b1),U=I.unsafeCleanup?dG0:pG0,Y=zD(U,$,z),J=zD(q,$,z,Y);if(!I.keep)BU.unshift(Y);return z?Y:J}function zD($,I,z,q){let U=!1;return function Y(J){if(!U){let Q=q||Y,w=BU.indexOf(Q);if(w>=0)BU.splice(w,1);if(U=!0,z||$===pG0||$===dG0)return $(I);else return $(I,J||function(){})}}}function lQ1(){if(!cG0)return;while(BU.length)try{BU[0]()}catch($){}}function kG0($){let I=[],z=null;try{z=xG0.randomBytes($)}catch(q){z=xG0.pseudoRandomBytes($)}for(let q=0;q<$;q++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[q]%62]);return I.join("")}function z$($){return typeof $>"u"}function jU($,I){if(typeof $==="function")return[{},$];if(z$($))return[{},I];let z={};for(let q of Object.getOwnPropertyNames($))z[q]=$[q];return[z,I]}function oQ1($,I,z){let q=f4.isAbsolute($)?$:f4.join(I,$);b1.stat(q,function(U){if(U)b1.realpath(f4.dirname(q),function(Y,J){if(Y)return z(Y);z(null,f4.join(J,f4.basename(q)))});else b1.realpath(q,z)})}function rQ1($,I){let z=f4.isAbsolute($)?$:f4.join(I,$);try{return b1.statSync(z),b1.realpathSync(z)}catch(q){let U=b1.realpathSync(f4.dirname(z));return f4.join(U,f4.basename(z))}}function lG0($){let I=$.tmpdir;if(!z$($.name))return f4.join(I,$.dir,$.name);if(!z$($.template))return f4.join(I,$.dir,$.template).replace(bG0,kG0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",kG0(12),$.postfix?"-"+$.postfix:""].join("");return f4.join(I,$.dir,z)}function jy($,I){if(typeof I!=="string")throw Error(`${$} option must be a string, got "${typeof I}".`);if(I.includes(".."))throw Error("Relative value not allowed");return I}function oG0($){if(!z$($.name)){let I=$.name;if(f4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let z=f4.basename(I);if(z===".."||z==="."||z!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!z$($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(bG0))throw Error(`Invalid template, found "${$.template}".`)}if(!z$($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=z$($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=z$($.prefix)?"":jy("prefix",$.prefix),$.postfix=z$($.postfix)?"":jy("postfix",$.postfix),$.template=z$($.template)?void 0:jy("template",$.template)}function fG0($,I,z,q){if(z$(I))return q(null);oQ1(I,z,function(U,Y){if(U)return q(U);let J=f4.relative(z,Y);if(J.startsWith("..")||f4.isAbsolute(J))return q(Error(`${$} option must be relative to "${z}", found "${J}".`));q(null,J)})}function nG0($,I,z){if(z$(I))return;let q=rQ1(I,z),U=f4.relative(z,q);if(U.startsWith("..")||f4.isAbsolute(U))throw ELine truncated
*/var b1=t("fs"),UD=t("os"),f4=t("path"),dG0=t("crypto"),s8={fs:b1.constants,os:UD.constants},rG0=/XXXXXX/,tG0=(s8.O_CREAT||s8.fs.O_CREAT)|(s8.O_EXCL||s8.fs.O_EXCL)|(s8.O_RDWR||s8.fs.O_RDWR),dQ1=UD.platform()==="win32",mQ1=s8.EBADF||s8.os.errno.EBADF,lQ1=s8.ENOENT||s8.os.errno.ENOENT,BU=[],aG0=b1.rmdirSync.bind(b1),sG0=!1;function oQ1($,I){return b1.rm($,{recursive:!0},I)}function eG0($){return b1.rmSync($,{recursive:!0})}function Cy($,I){let z=jU($,I),q=z[0],U=z[1];U21(q,function(Y,J){if(Y)return U(Y);let Q=J.tries;(function w(){try{let K=IW0(J);b1.stat(K,function(H){if(!H){if(Q-- >0)return w();return U(Error("Could not get a unique tmp filename, max tries reached "+K))}U(null,K)})}catch(K){U(K)}})()})}function hy($){let I=jU($),z=I[0],q=Y21(z),U=q.tries;do{let Y=IW0(q);try{b1.statSync(Y)}catch(J){return Y}}while(U-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function rQ1($,I){let z=jU($,I),q=z[0],U=z[1];Cy(q,function(J,Q){if(J)return U(J);b1.open(Q,tG0,q.mode||384,function(K,H){if(K)return U(K);if(q.discardDescriptor)return b1.close(H,function(W){return U(W,Q,void 0,Ry(Q,-1,q,!1))});else{let G=q.discardDescriptor||q.detachDescriptor;U(null,Q,H,Ry(Q,G?-1:H,q,!1))}})})}function tQ1($){let I=jU($),z=I[0],q=z.discardDescriptor||z.detachDescriptor,U=hy(z),Y=b1.openSync(U,tG0,z.mode||384);if(z.discardDescriptor)b1.closeSync(Y),Y=void 0;return{name:U,fd:Y,removeCallback:Ry(U,q?-1:Y,z,!0)}}function aQ1($,I){let z=jU($,I),q=z[0],U=z[1];Cy(q,function(J,Q){if(J)return U(J);b1.mkdir(Q,q.mode||448,function(K){if(K)return U(K);U(null,Q,$W0(Q,q,!1))})})}function sQ1($){let I=jU($),z=I[0],q=hy(z);return b1.mkdirSync(q,z.mode||448),{name:q,removeCallback:$W0(q,z,!0)}}function eQ1($,I){let z=function(q){if(q&&!_y(q))return I(q);I()};if(0<=$[0])b1.close($[0],function(){b1.unlink($[1],z)});else b1.unlink($[1],z)}function $21($){let I=null;try{if(0<=$[0])b1.closeSync($[0])}catch(z){if(!J21(z)&&!_y(z))throw z}finally{try{b1.unlinkSync($[1])}catch(z){if(!_y(z))I=z}}if(I!==null)throw I}function Ry($,I,z,q){let U=qD($21,[I,$],q),Y=qD(eQ1,[I,$],q,U);if(!z.keep)BU.unshift(U);return q?U:Y}function $W0($,I,z){let q=I.unsafeCleanup?oQ1:b1.rmdir.bind(b1),U=I.unsafeCleanup?eG0:aG0,Y=qD(U,$,z),J=qD(q,$,z,Y);if(!I.keep)BU.unshift(Y);return z?Y:J}function qD($,I,z,q){let U=!1;return function Y(J){if(!U){let Q=q||Y,w=BU.indexOf(Q);if(w>=0)BU.splice(w,1);if(U=!0,z||$===aG0||$===eG0)return $(I);else return $(I,J||function(){})}}}function I21(){if(!sG0)return;while(BU.length)try{BU[0]()}catch($){}}function mG0($){let I=[],z=null;try{z=dG0.randomBytes($)}catch(q){z=dG0.pseudoRandomBytes($)}for(let q=0;q<$;q++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[q]%62]);return I.join("")}function z$($){return typeof $>"u"}function jU($,I){if(typeof $==="function")return[{},$];if(z$($))return[{},I];let z={};for(let q of Object.getOwnPropertyNames($))z[q]=$[q];return[z,I]}function z21($,I,z){let q=f4.isAbsolute($)?$:f4.join(I,$);b1.stat(q,function(U){if(U)b1.realpath(f4.dirname(q),function(Y,J){if(Y)return z(Y);z(null,f4.join(J,f4.basename(q)))});else b1.realpath(q,z)})}function q21($,I){let z=f4.isAbsolute($)?$:f4.join(I,$);try{return b1.statSync(z),b1.realpathSync(z)}catch(q){let U=b1.realpathSync(f4.dirname(z));return f4.join(U,f4.basename(z))}}function IW0($){let I=$.tmpdir;if(!z$($.name))return f4.join(I,$.dir,$.name);if(!z$($.template))return f4.join(I,$.dir,$.template).replace(rG0,mG0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",mG0(12),$.postfix?"-"+$.postfix:""].join("");return f4.join(I,$.dir,z)}function gy($,I){if(typeof I!=="string")throw Error(`${$} option must be a string, got "${typeof I}".`);if(I.includes(".."))throw Error("Relative value not allowed");return I}function zW0($){if(!z$($.name)){let I=$.name;if(f4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let z=f4.basename(I);if(z===".."||z==="."||z!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!z$($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(rG0))throw Error(`Invalid template, found "${$.template}".`)}if(!z$($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=z$($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=z$($.prefix)?"":gy("prefix",$.prefix),$.postfix=z$($.postfix)?"":gy("postfix",$.postfix),$.template=z$($.template)?void 0:gy("template",$.template)}function lG0($,I,z,q){if(z$(I))return q(null);z21(I,z,function(U,Y){if(U)return q(U);let J=f4.relative(z,Y);if(J.startsWith("..")||f4.isAbsolute(J))return q(Error(`${$} option must be relative to "${z}", found "${J}".`));q(null,J)})}function oG0($,I,z){if(z$(I))return;let q=q21(I,z),U=f4.relative(z,q);if(U.startsWith("..")||f4.isAbsolute(U))throw ELine truncated
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csiLine truncated
\v\f\r\x0E\x0F\x10ỨỰỲỶỸÝỴ\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ`},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:`\x00\x01Ẳ\x03\x04ẴẪ\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13Ỷ\x15\x16\x17\x18Ỹ\x1A\x1B\x1C\x1DỴ\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ`},iso646cn:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},iso646jp:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var CV0=O((uK1)=>{var Cu=t5().Buffer;uK1._dbcs=s5;var W6=-1,_V0=-2,r$=-10,k6=-1000,fU=Array(256),Aw=-1;for(Mw=0;Mw<256;Mw++)fU[Mw]=W6;var Mw;function s5($,I){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=fU.slice(0),this.decodeTableSeq=[];for(var q=0;q<z.length;q++)this._addDecodeChunk(z[q]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var U=this.decodeTables.length;this.decodeTables.push(fU.slice(0));var Y=this.decodeTables.length;this.decodeTables.push(fU.slice(0));var J=this.decodeTables[0];for(var q=129;q<=254;q++){var Q=this.decodeTables[k6-J[q]];for(var w=48;w<=57;w++){if(Q[w]===W6)Q[w]=k6-U;else if(Q[w]>k6)throw Error("gb18030 decode tables conflict at byte 2");var K=this.decodeTables[k6-Q[w]];for(var H=129;H<=254;H++){if(K[H]===W6)K[H]=k6-Y;else if(K[H]===k6-Y)continue;else if(K[H]>k6)throw Error("gb18030 decode tables conflict at byte 3");var G=this.decodeTables[k6-K[H]];for(var W=48;W<=57;W++)if(G[W]===W6)G[W]=_V0}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var q=0;q<$.encodeSkipVals.length;q++){var X=$.encodeSkipVals[q];if(typeof X==="number")V[X]=!0;else for(var w=X.from;w<=X.to;w++)V[w]=!0}if(this._fillEncodeTable(0,0,V),$.encodeAdd){for(var L in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,L))this._setEncodeChar(L.charCodeAt(0),$.encodeAdd[L])}if(this.defCharSB=this.encodeTable[0][I.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===W6)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===W6)this.defCharSB=63}s5.prototype.encoder=CD;s5.prototype.decoder=hu;s5.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var z=this.decodeTables[0];for(var q=I.length-1;q>0;q--){var U=z[I[q]];if(U==W6)z[I[q]]=k6-this.decodeTables.length,this.decodeTables.push(z=fU.slice(0));else if(U<=k6)z=this.decodeTables[k6-U];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};s5.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),z=this._getDecodeTrieNode(I);I=I&255;for(var q=1;q<$.length;q++){var U=$[q];if(typeof U==="string")for(var Y=0;Y<U.length;){var J=U.charCodeAt(Y++);if(J>=55296&&J<56320){var Q=U.charCodeAt(Y++);if(Q>=56320&&Q<57344)z[I++]=65536+(J-55296)*1024+(Q-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(J>4080&&J<=4095){var w=4095-J+2,K=[];for(var H=0;H<w;H++)K.push(U.charCodeAt(Y++));z[I++]=r$-this.decodeTableSeq.length,this.decodeTableSeq.push(K)}else z[I++]=J}else if(typeof U==="number"){var G=z[I-1]+1;for(var Y=0;Y<U;Y++)z[I++]=G++}else throw Error("Incorrect type '"+typeof U+"' given in "+this.encodingName+" at chunk "+$[0])}if(I>255)throw Error("Incorrect chunk in "+this.encoLine truncated
`)}var CI=($)=>(I,z,q,U)=>{let Y=q?{...q,async:!1}:{async:!1},J=I._zod.run({value:z,issues:[]},Y);if(J instanceof Promise)throw new O8;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((w)=>B6(w,Y,D4())));throw GK(Q,U?.callee),Q}return J.value},wY=CI(p6),hI=($)=>async(I,z,q,U)=>{let Y=q?{...q,async:!0}:{async:!0},J=I._zod.run({value:z,issues:[]},Y);if(J instanceof Promise)J=await J;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((w)=>B6(w,Y,D4())));throw GK(Q,U?.callee),Q}return J.value},KY=hI(p6),SI=($)=>(I,z,q)=>{let U=q?{...q,async:!1}:{async:!1},Y=I._zod.run({value:z,issues:[]},U);if(Y instanceof Promise)throw new O8;return Y.issues.length?{success:!1,error:new($??YY)(Y.issues.map((J)=>B6(J,U,D4())))}:{success:!0,data:Y.value}},yI=SI(p6),uI=($)=>async(I,z,q)=>{let U=q?{...q,async:!0}:{async:!0},Y=I._zod.run({value:z,issues:[]},U);if(Y instanceof Promise)Y=await Y;return Y.issues.length?{success:!1,error:new $(Y.issues.map((J)=>B6(J,U,D4())))}:{success:!0,data:Y.value}},HY=uI(p6),WK=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return CI($)(I,z,U)},Tk=WK(p6),VK=($)=>(I,z,q)=>{return CI($)(I,z,q)},Ek=VK(p6),ZK=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return hI($)(I,z,U)},Bk=ZK(p6),XK=($)=>async(I,z,q)=>{return hI($)(I,z,q)},jk=XK(p6),LK=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return SI($)(I,z,U)},vk=LK(p6),DK=($)=>(I,z,q)=>{return SI($)(I,z,q)},gk=DK(p6),FK=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return uI($)(I,z,U)},Rk=FK(p6),OK=($)=>async(I,z,q)=>{return uI($)(I,z,q)},_k=OK(p6);var K$={};Y5(K$,{xid:()=>nF,uuid7:()=>pF0,uuid6:()=>iF0,uuid4:()=>bF0,uuid:()=>n7,uppercase:()=>GO,unicodeEmail:()=>Ck,undefined:()=>KO,ulid:()=>fF,time:()=>zO,string:()=>UO,sha512_hex:()=>HO0,sha512_base64url:()=>WO0,sha512_base64:()=>GO0,sha384_hex:()=>QO0,sha384_base64url:()=>KO0,sha384_base64:()=>wO0,sha256_hex:()=>UO0,sha256_base64url:()=>JO0,sha256_base64:()=>YO0,sha1_hex:()=>IO0,sha1_base64url:()=>qO0,sha1_base64:()=>zO0,rfc5322Email:()=>dF0,number:()=>GY,null:()=>wO,nanoid:()=>iF,md5_hex:()=>sF0,md5_base64url:()=>$O0,md5_base64:()=>eF0,mac:()=>rF,lowercase:()=>HO,ksuid:()=>bF,ipv6:()=>oF,ipv4:()=>lF,integer:()=>JO,idnEmail:()=>mF0,httpProtocol:()=>eF,html5Email:()=>cF0,hostname:()=>rF0,hex:()=>aF0,guid:()=>cF,extendedDuration:()=>nF0,emoji:()=>mF,email:()=>dF,e164:()=>$O,duration:()=>pF,domain:()=>tF0,datetime:()=>qO,date:()=>IO,cuid2:()=>kF,cuid:()=>xF,cidrv6:()=>aF,cidrv4:()=>tF,browserEmail:()=>lF0,boolean:()=>QO,bigint:()=>YO,base64url:()=>NK,base64:()=>sF});var xF=/^[cC][0-9a-z]{6,}$/,kF=/^[0-9a-z]+$/,fF=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nF=/^[0-9a-vA-V]{20}$/,bF=/^[A-Za-z0-9]{27}$/,iF=/^[a-zA-Z0-9_-]{21}$/,pF=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nF0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cF=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,n7=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},bF0=n7(4),iF0=n7(6),pF0=n7(7),dF=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cF0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,dF0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ck=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mF0=Ck,lF0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,oF0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mF(){return new RegExp(oF0,"u")}var lF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oF=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rF=($)=>{let I=g$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},tF=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0Line truncated
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var nV0=O((cK1)=>{var Su=t5().Buffer;cK1._dbcs=s5;var W6=-1,fV0=-2,r$=-10,k6=-1000,fU=Array(256),Pw=-1;for(Aw=0;Aw<256;Aw++)fU[Aw]=W6;var Aw;function s5($,I){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=fU.slice(0),this.decodeTableSeq=[];for(var q=0;q<z.length;q++)this._addDecodeChunk(z[q]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var U=this.decodeTables.length;this.decodeTables.push(fU.slice(0));var Y=this.decodeTables.length;this.decodeTables.push(fU.slice(0));var J=this.decodeTables[0];for(var q=129;q<=254;q++){var Q=this.decodeTables[k6-J[q]];for(var w=48;w<=57;w++){if(Q[w]===W6)Q[w]=k6-U;else if(Q[w]>k6)throw Error("gb18030 decode tables conflict at byte 2");var K=this.decodeTables[k6-Q[w]];for(var H=129;H<=254;H++){if(K[H]===W6)K[H]=k6-Y;else if(K[H]===k6-Y)continue;else if(K[H]>k6)throw Error("gb18030 decode tables conflict at byte 3");var G=this.decodeTables[k6-K[H]];for(var W=48;W<=57;W++)if(G[W]===W6)G[W]=fV0}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var q=0;q<$.encodeSkipVals.length;q++){var X=$.encodeSkipVals[q];if(typeof X==="number")V[X]=!0;else for(var w=X.from;w<=X.to;w++)V[w]=!0}if(this._fillEncodeTable(0,0,V),$.encodeAdd){for(var L in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,L))this._setEncodeChar(L.charCodeAt(0),$.encodeAdd[L])}if(this.defCharSB=this.encodeTable[0][I.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===W6)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===W6)this.defCharSB=63}s5.prototype.encoder=hD;s5.prototype.decoder=yu;s5.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var z=this.decodeTables[0];for(var q=I.length-1;q>0;q--){var U=z[I[q]];if(U==W6)z[I[q]]=k6-this.decodeTables.length,this.decodeTables.push(z=fU.slice(0));else if(U<=k6)z=this.decodeTables[k6-U];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};s5.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),z=this._getDecodeTrieNode(I);I=I&255;for(var q=1;q<$.length;q++){var U=$[q];if(typeof U==="string")for(var Y=0;Y<U.length;){var J=U.charCodeAt(Y++);if(J>=55296&&J<56320){var Q=U.charCodeAt(Y++);if(Q>=56320&&Q<57344)z[I++]=65536+(J-55296)*1024+(Q-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(J>4080&&J<=4095){var w=4095-J+2,K=[];for(var H=0;H<w;H++)K.push(U.charCodeAt(Y++));z[I++]=r$-this.decodeTableSeq.length,this.decodeTableSeq.push(K)}else z[I++]=J}else if(typeof U==="number"){var G=z[I-1]+1;for(var Y=0;Y<U;Y++)z[I++]=G++}else throw Error("Incorrect type '"+typeof U+"' given in "+this.encodingName+" at chunk "+$[0])}if(I>255)throw Error("Incorrect chunk in "+this.encoLine truncated
`)}var CI=($)=>(I,z,q,U)=>{let Y=q?{...q,async:!1}:{async:!1},J=I._zod.run({value:z,issues:[]},Y);if(J instanceof Promise)throw new O8;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((w)=>B6(w,Y,D4())));throw WK(Q,U?.callee),Q}return J.value},wY=CI(p6),hI=($)=>async(I,z,q,U)=>{let Y=q?{...q,async:!0}:{async:!0},J=I._zod.run({value:z,issues:[]},Y);if(J instanceof Promise)J=await J;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((w)=>B6(w,Y,D4())));throw WK(Q,U?.callee),Q}return J.value},KY=hI(p6),SI=($)=>(I,z,q)=>{let U=q?{...q,async:!1}:{async:!1},Y=I._zod.run({value:z,issues:[]},U);if(Y instanceof Promise)throw new O8;return Y.issues.length?{success:!1,error:new($??YY)(Y.issues.map((J)=>B6(J,U,D4())))}:{success:!0,data:Y.value}},yI=SI(p6),uI=($)=>async(I,z,q)=>{let U=q?{...q,async:!0}:{async:!0},Y=I._zod.run({value:z,issues:[]},U);if(Y instanceof Promise)Y=await Y;return Y.issues.length?{success:!1,error:new $(Y.issues.map((J)=>B6(J,U,D4())))}:{success:!0,data:Y.value}},HY=uI(p6),VK=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return CI($)(I,z,U)},Bk=VK(p6),ZK=($)=>(I,z,q)=>{return CI($)(I,z,q)},jk=ZK(p6),XK=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return hI($)(I,z,U)},vk=XK(p6),LK=($)=>async(I,z,q)=>{return hI($)(I,z,q)},gk=LK(p6),DK=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return SI($)(I,z,U)},Rk=DK(p6),FK=($)=>(I,z,q)=>{return SI($)(I,z,q)},_k=FK(p6),OK=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return uI($)(I,z,U)},Ck=OK(p6),NK=($)=>async(I,z,q)=>{return uI($)(I,z,q)},hk=NK(p6);var K$={};Y5(K$,{xid:()=>bF,uuid7:()=>aF0,uuid6:()=>tF0,uuid4:()=>rF0,uuid:()=>n7,uppercase:()=>WO,unicodeEmail:()=>Sk,undefined:()=>HO,ulid:()=>nF,time:()=>qO,string:()=>YO,sha512_hex:()=>FO0,sha512_base64url:()=>NO0,sha512_base64:()=>OO0,sha384_hex:()=>XO0,sha384_base64url:()=>DO0,sha384_base64:()=>LO0,sha256_hex:()=>WO0,sha256_base64url:()=>ZO0,sha256_base64:()=>VO0,sha1_hex:()=>KO0,sha1_base64url:()=>GO0,sha1_base64:()=>HO0,rfc5322Email:()=>eF0,number:()=>GY,null:()=>KO,nanoid:()=>pF,md5_hex:()=>JO0,md5_base64url:()=>wO0,md5_base64:()=>QO0,mac:()=>tF,lowercase:()=>GO,ksuid:()=>iF,ipv6:()=>rF,ipv4:()=>oF,integer:()=>QO,idnEmail:()=>$O0,httpProtocol:()=>$O,html5Email:()=>sF0,hostname:()=>qO0,hex:()=>YO0,guid:()=>dF,extendedDuration:()=>oF0,emoji:()=>lF,email:()=>mF,e164:()=>IO,duration:()=>cF,domain:()=>UO0,datetime:()=>UO,date:()=>zO,cuid2:()=>fF,cuid:()=>kF,cidrv6:()=>sF,cidrv4:()=>aF,browserEmail:()=>IO0,boolean:()=>wO,bigint:()=>JO,base64url:()=>MK,base64:()=>eF});var kF=/^[cC][0-9a-z]{6,}$/,fF=/^[0-9a-z]+$/,nF=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bF=/^[0-9a-vA-V]{20}$/,iF=/^[A-Za-z0-9]{27}$/,pF=/^[a-zA-Z0-9_-]{21}$/,cF=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,oF0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dF=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,n7=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},rF0=n7(4),tF0=n7(6),aF0=n7(7),mF=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sF0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,eF0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Sk=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$O0=Sk,IO0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,zO0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function lF(){return new RegExp(zO0,"u")}var oF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rF=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tF=($)=>{let I=g$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},aF=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0Line truncated
`).filter((Y)=>Y),q=Math.min(...z.map((Y)=>Y.length-Y.trimStart().length)),U=z.map((Y)=>Y.slice(q)).map((Y)=>" ".repeat(this.indent*2)+Y);for(let Y of U)this.content.push(Y)}compile(){let $=Function,I=this?.args,q=[...(this?.content??[""]).map((U)=>` ${U}`)];return new $(...I,q.join(`
`))}}var RO={major:4,minor:4,patch:3};var p0=o("$ZodType",($,I)=>{var z;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=RO;let q=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))q.unshift($);for(let U of q)for(let Y of U._zod.onattach)Y($);if(q.length===0)(z=$._zod).deferred??(z.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(J,Q,w)=>{let K=w9(J),H;for(let G of Q){if(G._zod.def.when){if(SF(J))continue;if(!G._zod.def.when(J))continue}else if(K)continue;let W=J.issues.length,V=G._zod.check(J);if(V instanceof Promise&&w?.async===!1)throw new O8;if(H||V instanceof Promise)H=(H??Promise.resolve()).then(async()=>{if(await V,J.issues.length===W)return;if(!K)K=w9(J,W)});else{if(J.issues.length===W)continue;if(!K)K=w9(J,W)}}if(H)return H.then(()=>{return J});return J},Y=(J,Q,w)=>{if(w9(J))return J.aborted=!0,J;let K=U(Q,q,w);if(K instanceof Promise){if(w.async===!1)throw new O8;return K.then((H)=>$._zod.parse(H,w))}return $._zod.parse(K,w)};$._zod.run=(J,Q)=>{if(Q.skipChecks)return $._zod.parse(J,Q);if(Q.direction==="backward"){let K=$._zod.parse({value:J.value,issues:[]},{...Q,skipChecks:!0});if(K instanceof Promise)return K.then((H)=>{return Y(H,J,Q)});return Y(K,J,Q)}let w=$._zod.parse(J,Q);if(w instanceof Promise){if(Q.async===!1)throw new O8;return w.then((K)=>U(K,q,Q))}return U(w,q,Q)}}$1($,"~standard",()=>({validate:(U)=>{try{let Y=yI($,U);return Y.success?{value:Y.data}:{issues:Y.error?.issues}}catch(Y){return HY($,U).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),b7=o("$ZodString",($,I)=>{p0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??UO($._zod.bag),$._zod.parse=(z,q)=>{if(I.coerce)try{z.value=String(z.value)}catch(U){}if(typeof z.value==="string")return z;return z.issues.push({expected:"string",code:"invalid_type",input:z.value,inst:$}),z}}),x1=o("$ZodStringFormat",($,I)=>{xI.init($,I),b7.init($,I)}),CO=o("$ZodGUID",($,I)=>{I.pattern??(I.pattern=cF),x1.init($,I)}),hO=o("$ZodUUID",($,I)=>{if(I.version){let q={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(q===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=n7(q))}else I.pattern??(I.pattern=n7());x1.init($,I)}),SO=o("$ZodEmail",($,I)=>{I.pattern??(I.pattern=dF),x1.init($,I)}),yO=o("$ZodURL",($,I)=>{x1.init($,I),$._zod.check=(z)=>{try{let q=z.value.trim();if(!I.normalize&&I.protocol?.source===eF.source){if(!/^https?:\/\//i.test(q)){z.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:z.value,inst:$,continue:!I.abort});return}}let U=new URL(q);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(U.hostname))z.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:z.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))z.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:z.value,inst:$,continue:!I.abort})}if(I.normalize)z.value=U.href;else z.value=q;return}catch(q){z.issues.push({code:"invalid_format",format:"url",input:z.value,inst:$,continue:!I.abort})}}}),uO=o("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=mF()),x1.init($,I)}),xO=o("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=iF),x1.init($,I)}),kO=o("$ZodCUID",($,I)=>{I.pattern??(I.pattern=xF),x1.init($,I)}),fO=o("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=kF),x1.init($,I)}),nO=o("$ZodULID",($,I)=>{I.pattern??(I.pattern=fF),x1.init($,I)}),bO=o("$ZodXID",($,I)=>{I.pattern??(I.pattern=nF),x1.init($,I)}),iO=o("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=bF),x1.init($,I)}),pO=o("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=qO(I)),x1.init($,I)}),cO=o("$ZodISODate",($,I)=>{I.pattern??(I.pattern=IO),x1.init($,I)}),dO=o("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=zO(I)),x1.init($,I)}),mO=o("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=pF),x1.init($,I)}),lO=o("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=lF),x1.init($,I),$._zod.bag.format="ipv4"}),oO=o("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=oF),x1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(z)=>{try{new URL(`http://[${z.value}]`)}catch{z.issues.push({code:"invalid_format",format:"ipv6",input:z.value,inst:$,continue:!I.abort})}}}),rO=o("$ZodMAC",($,I)=>{I.pattern??(I.pattern=rF(I.delimiter)),x1.init($,I),$._zod.bag.format="mac"}),tO=o("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=tF),x1.init($,I)}),aO=o("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=aF),x1.init($,I),$._zod.check=(z)=>{let q=z.value.split("/");try{if(q.length!==2)throw Error();let[U,Y]=q;if(!Y)throw Error();let J=Number(Y);if(`${J}`!==Y)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${U}]`)}catch{z.issues.push({code:"invalid_format",format:"cidrv6",input:z.value,inst:$,continue:!I.abort})}}});function sO($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}} Line truncated
`))}}var _O={major:4,minor:4,patch:3};var p0=o("$ZodType",($,I)=>{var z;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=_O;let q=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))q.unshift($);for(let U of q)for(let Y of U._zod.onattach)Y($);if(q.length===0)(z=$._zod).deferred??(z.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(J,Q,w)=>{let K=w9(J),H;for(let G of Q){if(G._zod.def.when){if(yF(J))continue;if(!G._zod.def.when(J))continue}else if(K)continue;let W=J.issues.length,V=G._zod.check(J);if(V instanceof Promise&&w?.async===!1)throw new O8;if(H||V instanceof Promise)H=(H??Promise.resolve()).then(async()=>{if(await V,J.issues.length===W)return;if(!K)K=w9(J,W)});else{if(J.issues.length===W)continue;if(!K)K=w9(J,W)}}if(H)return H.then(()=>{return J});return J},Y=(J,Q,w)=>{if(w9(J))return J.aborted=!0,J;let K=U(Q,q,w);if(K instanceof Promise){if(w.async===!1)throw new O8;return K.then((H)=>$._zod.parse(H,w))}return $._zod.parse(K,w)};$._zod.run=(J,Q)=>{if(Q.skipChecks)return $._zod.parse(J,Q);if(Q.direction==="backward"){let K=$._zod.parse({value:J.value,issues:[]},{...Q,skipChecks:!0});if(K instanceof Promise)return K.then((H)=>{return Y(H,J,Q)});return Y(K,J,Q)}let w=$._zod.parse(J,Q);if(w instanceof Promise){if(Q.async===!1)throw new O8;return w.then((K)=>U(K,q,Q))}return U(w,q,Q)}}$1($,"~standard",()=>({validate:(U)=>{try{let Y=yI($,U);return Y.success?{value:Y.data}:{issues:Y.error?.issues}}catch(Y){return HY($,U).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),b7=o("$ZodString",($,I)=>{p0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??YO($._zod.bag),$._zod.parse=(z,q)=>{if(I.coerce)try{z.value=String(z.value)}catch(U){}if(typeof z.value==="string")return z;return z.issues.push({expected:"string",code:"invalid_type",input:z.value,inst:$}),z}}),x1=o("$ZodStringFormat",($,I)=>{xI.init($,I),b7.init($,I)}),hO=o("$ZodGUID",($,I)=>{I.pattern??(I.pattern=dF),x1.init($,I)}),SO=o("$ZodUUID",($,I)=>{if(I.version){let q={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(q===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=n7(q))}else I.pattern??(I.pattern=n7());x1.init($,I)}),yO=o("$ZodEmail",($,I)=>{I.pattern??(I.pattern=mF),x1.init($,I)}),uO=o("$ZodURL",($,I)=>{x1.init($,I),$._zod.check=(z)=>{try{let q=z.value.trim();if(!I.normalize&&I.protocol?.source===$O.source){if(!/^https?:\/\//i.test(q)){z.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:z.value,inst:$,continue:!I.abort});return}}let U=new URL(q);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(U.hostname))z.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:z.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))z.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:z.value,inst:$,continue:!I.abort})}if(I.normalize)z.value=U.href;else z.value=q;return}catch(q){z.issues.push({code:"invalid_format",format:"url",input:z.value,inst:$,continue:!I.abort})}}}),xO=o("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=lF()),x1.init($,I)}),kO=o("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=pF),x1.init($,I)}),fO=o("$ZodCUID",($,I)=>{I.pattern??(I.pattern=kF),x1.init($,I)}),nO=o("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=fF),x1.init($,I)}),bO=o("$ZodULID",($,I)=>{I.pattern??(I.pattern=nF),x1.init($,I)}),iO=o("$ZodXID",($,I)=>{I.pattern??(I.pattern=bF),x1.init($,I)}),pO=o("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=iF),x1.init($,I)}),cO=o("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=UO(I)),x1.init($,I)}),dO=o("$ZodISODate",($,I)=>{I.pattern??(I.pattern=zO),x1.init($,I)}),mO=o("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=qO(I)),x1.init($,I)}),lO=o("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=cF),x1.init($,I)}),oO=o("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=oF),x1.init($,I),$._zod.bag.format="ipv4"}),rO=o("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=rF),x1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(z)=>{try{new URL(`http://[${z.value}]`)}catch{z.issues.push({code:"invalid_format",format:"ipv6",input:z.value,inst:$,continue:!I.abort})}}}),tO=o("$ZodMAC",($,I)=>{I.pattern??(I.pattern=tF(I.delimiter)),x1.init($,I),$._zod.bag.format="mac"}),aO=o("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=aF),x1.init($,I)}),sO=o("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=sF),x1.init($,I),$._zod.check=(z)=>{let q=z.value.split("/");try{if(q.length!==2)throw Error();let[U,Y]=q;if(!Y)throw Error();let J=Number(Y);if(`${J}`!==Y)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${U}]`)}catch{z.issues.push({code:"invalid_format",format:"cidrv6",input:z.value,inst:$,continue:!I.abort})}}});function eO($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}} Line truncated
if (${M}.issues.length) {
if (${B} in input) {
if (${j} in input) {
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
...iss,
path: iss.path ? [${B}, ...iss.path] : [${B}]
path: iss.path ? [${j}, ...iss.path] : [${j}]
})));
}
}
if (${M}.value === undefined) {
if (${B} in input) {
newResult[${B}] = undefined;
if (${j} in input) {
newResult[${j}] = undefined;
}
} else {
newResult[${B}] = ${M}.value;
newResult[${j}] = ${M}.value;
}
`);else if(!h)V.write(`
const ${M}_present = ${B} in input;
const ${M}_present = ${j} in input;
if (${M}.issues.length) {
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
...iss,
path: iss.path ? [${B}, ...iss.path] : [${B}]
path: iss.path ? [${j}, ...iss.path] : [${j}]
})));
}
if (!${M}_present && !${M}.issues.length) {
@@ -275,15 +275,15 @@ Unsupported type: `+$.type,"ENOTSUP");$._finish()})};d$.prototype._stat=function
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${B}]
path: [${j}]
});
}
if (${M}_present) {
if (${M}.value === undefined) {
newResult[${B}] = undefined;
newResult[${j}] = undefined;
} else {
newResult[${B}] = ${M}.value;
newResult[${j}] = ${M}.value;
}
}
@@ -291,52 +291,52 @@ Unsupported type: `+$.type,"ENOTSUP");$._finish()})};d$.prototype._stat=function
if (${M}.issues.length) {
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
...iss,
path: iss.path ? [${B}, ...iss.path] : [${B}]
path: iss.path ? [${j}, ...iss.path] : [${j}]
})));
}
if (${M}.value === undefined) {
if (${B} in input) {
newResult[${B}] = undefined;
if (${j} in input) {
newResult[${j}] = undefined;
}
} else {
newResult[${B}] = ${M}.value;
newResult[${j}] = ${M}.value;
}
`)}V.write("payload.value = newResult;"),V.write("return payload;");let T=V.compile();return(P,M)=>T(W,P,M)},Y,J=f7,Q=!x7.jitless,K=Q&&vF.value,H=I.catchall,G;$._zod.parse=(W,V)=>{G??(G=q.value);let X=W.value;if(!J(X))return W.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),W;if(Q&&K&&V?.async===!1&&V.jitless!==!0){if(!Y)Y=U(I.shape);if(W=Y(W,V),!H)return W;return If([],X,W,V,G,$)}return z(W,V)}});function fk($,I,z,q){for(let Y of $)if(Y.issues.length===0)return I.value=Y.value,I;let U=$.filter((Y)=>!w9(Y));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:$.map((Y)=>Y.issues.map((J)=>B6(J,q,D4())))}),I}var XY=o("$ZodUnion",($,I)=>{p0.init($,I),$1($._zod,"optin",()=>I.options.some((q)=>q._zod.optin==="optional")?"optional":void 0),$1($._zod,"optout",()=>I.options.some((q)=>q._zod.optout==="optional")?"optional":void 0),$1($._zod,"values",()=>{if(I.options.every((q)=>q._zod.values))return new Set(I.options.flatMap((q)=>Array.from(q._zod.values)));return}),$1($._zod,"pattern",()=>{if(I.options.every((q)=>q._zod.pattern)){let q=I.options.map((U)=>U._zod.pattern);return new RegExp(`^(${q.map((U)=>IY(U.source)).join("|")})$`)}return});let z=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(q,U)=>{if(z)return z(q,U);let Y=!1,J=[];for(let Q of I.options){let w=Q._zod.run({value:q.value,issues:[]},U);if(w instanceof Promise)J.push(w),Y=!0;else{if(w.issues.length===0)return w;J.push(w)}}if(!Y)return fk(J,q,$,U);return Promise.all(J).then((Q)=>{return fk(Q,q,$,U)})}});function nk($,I,z,q){let U=$.filter((Y)=>Y.issues.length===0);if(U.length===1)return I.value=U[0].value,I;if(U.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:$.map((Y)=>Y.issues.map((J)=>B6(J,q,D4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:[],inclusive:!1});return I}var LN=o("$ZodXor",($,I)=>{XY.init($,I),I.inclusive=!1;let z=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(q,U)=>{if(z)return z(q,U);let Y=!1,J=[];for(let Q of I.options){let w=Q._zod.run({value:q.value,issues:[]},U);if(w instanceof Promise)J.push(w),Y=!0;else J.push(w)}if(!Y)return nk(J,q,$,U);return Promise.all(J).then((Q)=>{return nk(Q,q,$,U)})}}),DN=o("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,XY.init($,I);let z=$._zod.parse;$1($._zod,"propValues",()=>{let U={};for(let Y of I.options){let J=Y._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(Y)}"`);for(let[Q,w]of Object.entries(J)){if(!U[Q])U[Q]=new Set;for(let K of w)U[Q].add(K)}}return U});let q=RI(()=>{let U=I.options,Y=new Map;for(let J of U){let Q=J._zod.propValues?.[I.discriminator];if(!Q||Q.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(J)}"`);for(let w of Q){if(Y.has(w))throw Error(`Duplicate discriminator value "${String(w)}"`);Y.set(w,J)}}return Y});$._zod.parse=(U,Y)=>{let J=U.value;if(!f7(J))return U.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),U;let Q=q.value.get(J?.[I.discriminator]);if(Q)return Q._zod.run(U,Y);if(I.unionFallback||Y.direction==="backward")return z(U,Y);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(q.value.keys()),input:J,path:[I.discriminator],inst:$}),U}}),FN=o("$ZodIntersection",($,I)=>{p0.init($,I),$._zod.parse=(z,q)=>{let U=z.value,Y=I.left._zod.run({value:U,issues:[]},q),J=I.right._zod.run({value:U,issues:[]},q);if(Y instanceof Promise||J instanceof Promise)return Promise.all([Y,J]).then(([w,K])=>{return bk(z,w,K)});return bk(z,Y,J)}});function _O($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(Q9($)&&Q9(I)){let z=Object.keys(I),q=Object.keys($).filter((Y)=>z.indexOf(Y)!==-1),U={...$,...I};for(let Y of q){let J=_O($[Y],I[Y]);if(!J.valid)return{valid:!1,mergeErrorPath:[Y,...J.mergeErrorPath]};U[Y]=J.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let q=0;q<$.length;q++){let U=$[q],Y=I[q],J=_O(U,Y);if(!J.valid)return{valid:!1,mergeErrorPath:[q,...J.mergeErrorPath]};z.push(J.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function bk($,I,z){let q=new Map,U;for(let Q of I.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let w of Q.keys){if(!q.has(w))q.set(w,{});q.get(w).l=!0}}else $.issues.push(Q);for(let Q of z.issues)if(Q.code==="unrecognized_keys")for(let w of Q.keys){if(!q.has(w))q.set(w,{});q.get(w).r=!0}else $.issues.push(Q);let Y=[...q].filter(([,Q])=>Q.l&&Q.r).map(([Q])=>Q);if(Y.length&&U)$.issues.push({...U,keys:Y});if(w9($))return $;let J=_O(I.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}var RK=o("$ZodTuple",($,I)=>{p0. Line truncated
`)}V.write("payload.value = newResult;"),V.write("return payload;");let T=V.compile();return(P,M)=>T(W,P,M)},Y,J=f7,Q=!x7.jitless,K=Q&&gF.value,H=I.catchall,G;$._zod.parse=(W,V)=>{G??(G=q.value);let X=W.value;if(!J(X))return W.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),W;if(Q&&K&&V?.async===!1&&V.jitless!==!0){if(!Y)Y=U(I.shape);if(W=Y(W,V),!H)return W;return qf([],X,W,V,G,$)}return z(W,V)}});function bk($,I,z,q){for(let Y of $)if(Y.issues.length===0)return I.value=Y.value,I;let U=$.filter((Y)=>!w9(Y));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:$.map((Y)=>Y.issues.map((J)=>B6(J,q,D4())))}),I}var XY=o("$ZodUnion",($,I)=>{p0.init($,I),$1($._zod,"optin",()=>I.options.some((q)=>q._zod.optin==="optional")?"optional":void 0),$1($._zod,"optout",()=>I.options.some((q)=>q._zod.optout==="optional")?"optional":void 0),$1($._zod,"values",()=>{if(I.options.every((q)=>q._zod.values))return new Set(I.options.flatMap((q)=>Array.from(q._zod.values)));return}),$1($._zod,"pattern",()=>{if(I.options.every((q)=>q._zod.pattern)){let q=I.options.map((U)=>U._zod.pattern);return new RegExp(`^(${q.map((U)=>IY(U.source)).join("|")})$`)}return});let z=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(q,U)=>{if(z)return z(q,U);let Y=!1,J=[];for(let Q of I.options){let w=Q._zod.run({value:q.value,issues:[]},U);if(w instanceof Promise)J.push(w),Y=!0;else{if(w.issues.length===0)return w;J.push(w)}}if(!Y)return bk(J,q,$,U);return Promise.all(J).then((Q)=>{return bk(Q,q,$,U)})}});function ik($,I,z,q){let U=$.filter((Y)=>Y.issues.length===0);if(U.length===1)return I.value=U[0].value,I;if(U.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:$.map((Y)=>Y.issues.map((J)=>B6(J,q,D4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:[],inclusive:!1});return I}var DN=o("$ZodXor",($,I)=>{XY.init($,I),I.inclusive=!1;let z=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(q,U)=>{if(z)return z(q,U);let Y=!1,J=[];for(let Q of I.options){let w=Q._zod.run({value:q.value,issues:[]},U);if(w instanceof Promise)J.push(w),Y=!0;else J.push(w)}if(!Y)return ik(J,q,$,U);return Promise.all(J).then((Q)=>{return ik(Q,q,$,U)})}}),FN=o("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,XY.init($,I);let z=$._zod.parse;$1($._zod,"propValues",()=>{let U={};for(let Y of I.options){let J=Y._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(Y)}"`);for(let[Q,w]of Object.entries(J)){if(!U[Q])U[Q]=new Set;for(let K of w)U[Q].add(K)}}return U});let q=RI(()=>{let U=I.options,Y=new Map;for(let J of U){let Q=J._zod.propValues?.[I.discriminator];if(!Q||Q.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(J)}"`);for(let w of Q){if(Y.has(w))throw Error(`Duplicate discriminator value "${String(w)}"`);Y.set(w,J)}}return Y});$._zod.parse=(U,Y)=>{let J=U.value;if(!f7(J))return U.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),U;let Q=q.value.get(J?.[I.discriminator]);if(Q)return Q._zod.run(U,Y);if(I.unionFallback||Y.direction==="backward")return z(U,Y);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(q.value.keys()),input:J,path:[I.discriminator],inst:$}),U}}),ON=o("$ZodIntersection",($,I)=>{p0.init($,I),$._zod.parse=(z,q)=>{let U=z.value,Y=I.left._zod.run({value:U,issues:[]},q),J=I.right._zod.run({value:U,issues:[]},q);if(Y instanceof Promise||J instanceof Promise)return Promise.all([Y,J]).then(([w,K])=>{return pk(z,w,K)});return pk(z,Y,J)}});function CO($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(Q9($)&&Q9(I)){let z=Object.keys(I),q=Object.keys($).filter((Y)=>z.indexOf(Y)!==-1),U={...$,...I};for(let Y of q){let J=CO($[Y],I[Y]);if(!J.valid)return{valid:!1,mergeErrorPath:[Y,...J.mergeErrorPath]};U[Y]=J.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let q=0;q<$.length;q++){let U=$[q],Y=I[q],J=CO(U,Y);if(!J.valid)return{valid:!1,mergeErrorPath:[q,...J.mergeErrorPath]};z.push(J.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function pk($,I,z){let q=new Map,U;for(let Q of I.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let w of Q.keys){if(!q.has(w))q.set(w,{});q.get(w).l=!0}}else $.issues.push(Q);for(let Q of z.issues)if(Q.code==="unrecognized_keys")for(let w of Q.keys){if(!q.has(w))q.set(w,{});q.get(w).r=!0}else $.issues.push(Q);let Y=[...q].filter(([,Q])=>Q.l&&Q.r).map(([Q])=>Q);if(Y.length&&U)$.issues.push({...U,keys:Y});if(w9($))return $;let J=CO(I.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}var _K=o("$ZodTuple",($,I)=>{p0. Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let Q=J[1];if(I===J[0]){Y(J);continue}if($.external){let K=$.external.registry.get(J[0])?.id;if(I!==J[0]&&K){Y(J);continue}}if($.metadataRegistry.get(J[0])?.id){Y(J);continue}if(Q.cycle){Y(J);continue}if(Q.count>1){if($.reused==="ref"){Y(J);continue}}}}function V9($,I){let z=$.seen.get(I);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let q=(Q)=>{let w=$.seen.get(Q);if(w.ref===null)return;let K=w.def??w.schema,H={...K},G=w.ref;if(w.ref=null,G){q(G);let V=$.seen.get(G),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))K.allOf=K.allOf??[],K.allOf.push(X);else Object.assign(K,X);if(Object.assign(K,H),Q._zod.parent===G)for(let D in K){if(D==="$ref"||D==="allOf")continue;if(!(D in H))delete K[D]}if(X.$ref&&V.def)for(let D in K){if(D==="$ref"||D==="allOf")continue;if(D in V.def&&JSON.stringify(K[D])===JSON.stringify(V.def[D]))delete K[D]}}let W=Q._zod.parent;if(W&&W!==G){q(W);let V=$.seen.get(W);if(V?.schema.$ref){if(K.$ref=V.schema.$ref,V.def)for(let X in K){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(K[X])===JSON.stringify(V.def[X]))delete K[X]}}}$.override({zodSchema:Q,jsonSchema:K,path:w.path??[]})};for(let Q of[...$.seen.entries()].reverse())q(Q[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Q=$.external.registry.get(I)?.id;if(!Q)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(Q)}Object.assign(U,z.def??z.schema);let Y=$.metadataRegistry.get(I)?.id;if(Y!==void 0&&U.id===Y)delete U.id;let J=$.external?.defs??{};for(let Q of $.seen.entries()){let w=Q[1];if(w.def&&w.defId){if(w.def.id===w.defId)delete w.def.id;J[w.defId]=w.def}}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")U.$defs=J;else U.definitions=J;try{let Q=JSON.parse(JSON.stringify(U));return Object.defineProperty(Q,"~standard",{value:{...I["~standard"],jsonSchema:{input:sI(I,"input",$.processors),output:sI(I,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function v6($,I){let z=I??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let q=$._zod.def;if(q.type==="transform")return!0;if(q.type==="array")return v6(q.element,z);if(q.type==="set")return v6(q.valueType,z);if(q.type==="lazy")return v6(q.getter(),z);if(q.type==="promise"||q.type==="optional"||q.type==="nonoptional"||q.type==="nullable"||q.type==="readonly"||q.type==="default"||q.type==="prefault")return v6(q.innerType,z);if(q.type==="intersection")return v6(q.left,z)||v6(q.right,z);if(q.type==="record"||q.type==="map")return v6(q.keyType,z)||v6(q.valueType,z);if(q.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return v6(q.in,z)||v6(q.out,z)}if(q.type==="object"){for(let U in q.shape)if(v6(q.shape[U],z))return!0;return!1}if(q.type==="union"){for(let U of q.options)if(v6(U,z))return!0;return!1}if(q.type==="tuple"){for(let U of q.items)if(v6(U,z))return!0;if(q.rest&&v6(q.rest,z))return!0;return!1}return!1}var TA=($,I={})=>(z)=>{let q=G9({...z,processors:I});return S1($,q),W9(q,$),V9(q,$)},sI=($,I,z={})=>(q)=>{let{libraryOptions:U,target:Y}=q??{},J=G9({...U??{},target:Y,io:I,processors:z});return S1($,J),W9(J,$),V9(J,$)};var SN0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},EA=($,I,z,q)=>{let U=z;U.type="string";let{minimum:Y,maximum:J,format:Q,patterns:w,contentEncoding:K}=$._zod.bag;if(typeof Y==="number")U.minLength=Y;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=SN0[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(K)U.contentEncoding=K;if(w&&w.size>0){let H=[...w];if(H.length===1)U.pattern=H[0].source;else if(H.length>1)U.allOf=[...H.map((G)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:G.source}))]}},BA=($,I,z,q)=>{let U=z,{minimum:Y,maximum:J,format:Q,multipleOf:w,exclusiveMaximum:K,exclusiveMinimum:H}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let G=typeof H==="number"&&H>=(Y??Number.NEGATIVE_INFINITY),W=typeof K==="number"&&K<=(J??Number.POSITIVE_INFINITY),V=I.target==="draft-04"||I.target==="openapi-3.0";if(G)if(V)U.minimum=H,U.exclusiveMinimum=!0;else U.exclusiveMinimum=H;else if(typeof Y==="number")U.minimum=Y;if(W)if(V)U.maximum=K,U.exclusiveMaximum=!0;else U.exclusiveMaximum=K;else if(typeof J==="number")U.maximum=J;if(typeof w==="number")U.multipleOf=w},jA=($,I,z,q)=>{z.type="boolean"},vA=($,I,z,q)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},gA=($,I,z,q)=>{if(I.unrepresentable==Line truncated
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),z_0(I)}clear(){this._buffer=void 0}}function z_0($){return hn.parse(JSON.parse($))}function Rd($){return JSON.stringify($)+`
`}class iE{constructor($=_d.stdin,I=_d.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new bE,this._started=!1,this._ondata=(z)=>{this._readBuffer.append(z),this.processReadBuffer()},this._onerror=(z)=>{this.onerror?.(z)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let z=Rd($);if(this._stdout.write(z))I();else this._stdout.once("drain",I)})}}import{dirname as Sx,join as xW1}from"node:path";import{fileURLToPath as kW1}from"node:url";class Z5 extends Error{name="KyError";get isKyError(){return!0}}class W$ extends Z5{name="HTTPError";response;request;options;data;constructor($,I,z){let q=$.status||$.status===0?$.status:"",U=$.statusText??"",Y=`${q} ${U}`.trim(),J=Y?`status code ${Y}`:"an unknown error";super(`Request failed with ${J}: ${I.method} ${I.url}`);this.response=$,this.request=I,this.options=z}}class OJ extends Z5{name="NetworkError";request;constructor($,I){super(`Request failed due to a network error: ${$.method} ${$.url}`,I);this.request=$}}class NJ extends Error{name="NonError";value;constructor($){let I="Non-error value was thrown";try{if(typeof $==="string")I=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")I=$.message}catch{}super(I);this.value=$}}class Ez extends Z5{name="ForceRetryError";customDelay;code;customRequest;constructor($){let I=$?.cause?$.cause instanceof Error?$.cause:new NJ($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",I?{cause:I}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}class pE extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}class q8 extends Z5{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}var cE=(()=>{let $=!1,I=!1,z=typeof globalThis.ReadableStream==="function",q=typeof globalThis.Request==="function";if(z&&q)try{I=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(U){if(U instanceof Error&&U.message==="unsupported BodyInit type")return!1;throw U}return $&&!I})(),Cd=typeof globalThis.AbortController==="function",uG=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",hd=typeof globalThis.ReadableStream==="function",Sd=typeof globalThis.FormData==="function",xG=["get","post","put","patch","head","delete"],q_0=()=>{return};q_0();var yd={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Bz=2147483647,ud=40,kG=Symbol("stop");class fG{options;constructor($){this.options=$}}var xd=($)=>new fG($),kd={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},fd={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var nG=new TextEncoder,U_0=($)=>{if(!$)return 0;if($ instanceof FormData){let I=0;for(let[z,q]of $)I+=ud,I+=nG.encode(`Content-Disposition: form-data; name="${z}"`).byteLength,I+=typeof q==="string"?nG.encode(q).byteLength:q.size;return I}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return nG.encode($).byteLength;if($ instanceof URLSearchParams)return nG.encode($.toString()).byteLength;return 0},nd=($,I,z)=>{let q,U=0;return $.pipeThrough(new TransformStream({transform(Y,J){if(J.enqueue(Y),q){U+=q.byteLength;let Q=I===0?0:U/I;if(Q>=1)Q=1-Number.EPSILON;z?.({percent:Q,totalBytes:Math.max(I,U),transferredBytes:U},q)}q=Y},flush(){if(q)U+=q.byteLength,z?.({percent:1,totalBytes:Math.max(I,U),transferredBytes:U},q)}}))},bd=($,I)=>{if(!$.body)return $;let z={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,z);let q=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(nd($.body,q,I),z)},id=($,I,z)=>{if(!$.body)return $;let q=U_0(z??$.body);return new Request($,{duplex:"half",body:nd($.body,q,I)})};var B8=($)=>$!==null&&typeof $==="object";var Y_0=Symbol("replaceOption"),dE=($)=>B8($)&&$[Y_0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$};var AJ=(...$)=>{for(let I of $)if( Line truncated
`,{mode:384}),I}function iy($){let I=hW0();for(let z of I){if(!A$(z))continue;for(let q of HD(z).filter((U)=>U.endsWith(".json")).filter((U)=>!U.startsWith("example."))){let U=e8(z,q);try{let Y=WD(U,"utf-8"),J=JSON.parse(Y);if(J&&typeof J==="object"&&J.id===$)return U}catch{}}}return}function j7($,I){let z=iy($);if(!z)throw Error(`Enterprise config not found: ${$}`);let U={...JSON.parse(WD(z,"utf-8")),...I};for(let J of Object.keys(I))if(I[J]===void 0)delete U[J];let Y=fy.parse(U);return jW0(z,`${JSON.stringify(Y,null,2)}
`,"utf-8"),Y}function v7($,I,z=[]){let q=I.corpId?.trim()||void 0,U=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,Y=q??U;if(Y){let Q=$.find((H)=>H.id===Y);if(Q)return Q;let w=$.find((H)=>H.id.toLowerCase()===Y.toLowerCase());if(w)return w;let K=$.find((H)=>H.name.toLowerCase()===Y.toLowerCase());if(K)return K;throw Error(`No enterprise config found for ${Y}`)}if(!I.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let J=$[0];if(J)return J;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{readFileSync as AH1}from"node:fs";import{randomBytes as PH1}from"node:crypto";var uW0=300000,SW0=new Map;function s21($,I){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>I?z:z.toLowerCase())}function e21($,I){return I?$:$.toLowerCase()}function $w1($,I,z,q){let U=e21($,q),Y=I.filter((J)=>U.includes(J));if(z==="all"&&Y.length!==I.length)return[];return Y}function Iw1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function zw1($,I){if(I.fields&&!I.fields.has($.field))return[];let z=Iw1($.value),q=[];return z.forEach((U,Y)=>{let J=$w1(U,I.keywords,I.matchMode,I.caseSensitive);if(J.length===0)return;let Q=Math.max(0,Y-I.contextLines),w=Math.min(z.length,Y+I.contextLines+1),K={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Y+1,matchedKeywords:J,matchedText:ZD(U,I.maxChars),context:{before:I.snippetOnly?[]:z.slice(Q,Y).map((H)=>ZD(H,I.maxChars)),line:ZD(U,I.maxChars),after:I.snippetOnly?[]:z.slice(Y+1,w).map((H)=>ZD(H,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)K.context={before:[],line:K.context.line,after:[]};q.push(K)}),q}function ZD($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function qw1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function yW0($){return $.rules.flatMap((I,z)=>{let q=`${$.id}:${I.description.slice(0,32)}`,U={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:I.scope,strictness:I.strictness,code:"code"in I?I.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:q,title:`${$.versionName} / ${I.scope}`,field:"history.description",value:I.description,metadata:U},{area:"rules",entityType:"rule",entityId:q,title:`${$.versionName} / ${I.scope}`,field:"history.scope",value:I.scope,metadata:U}]})}function Uw1($){return[{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"title",value:$.title,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"purpose",value:$.purpose,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"content",value:$.content,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}}]}function Yw1($){let I=[];if($.decisionPreferences)for(let[z,q]of Object.entries($.decisionPreferences))I.push({area:"preferences",entityType:"preference",field:`decisionPreferences.${z}`,value:q,metadata:{integrationSystem:$.integrationSystem}});return $.integrations.forEach((z,q)=>{I.push({area:"preferences",entityType:"integration",title:z.outboundName,field:`integrations[${q}]`,value:z,metadata:{type:z.type,outboundName:z.outboundName,mode:z.mode,corporationId:z.corporationId}})}),I}async function Jw1($,I,z){let q=z.ruleVersionScope??"current",U=[I.id,`ruleVersionScope=${q}`,`ruleVersionId=${z.ruleVersionId??""}`,`ruleVersionNumber=${z.ruleVersionNumber??""}`,`latestRuleVersion=${z.latestRuleVersion??!1}`,`documentLimit=${z.documentLimit??100}`].join("|"),Y=SW0.get(U);if(!z.refresh&&Y&&Date.now()<Y.expiresAt)return Y;let[J,Q,w]=await Promise.all([Qw1($,{scope:q,versionId:z.ruleVersionId,versionNumber:z.ruleVersionNumber,latest:z.latestRuleVersion}),j9($,{limit:z.documentLimit??100}),P1($,I.seal.endpoints.approvalStylePreferences)]),K=Date.now(),H={entries:[...J,...Q.articles.flatMap(Uw1),...Yw1(w)],fetchedAt:K,expiresAt:K+uW0};return SW0.set(U,H),H}async function Qw1($,I){if(I.scope==="current")return(await C6($)).rules.flatMap(qw1);if(I.scope==="version"){let q=await ww1($,I);return yW0(q)}return(await S$($)).flatMap(yW0)}async function ww1($,I){if(I.versionId)return hJ($,I.versionId);let z=await S$($),q=I.versionNumber?z.find((U)=>U.versionNumber===I.versionNumber):z[0];if(!q)throw Error(I.versionNumber?`Rule version not found: ${I.versionNumber}`:"No rule versions found");return q}async func Line truncated
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==q.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:q}}async function Dw1($,I,z){let q=await Y8($,I.seal.endpoints.approvalStylePreferences);if(z||q.length>0)return fW0(q,z,I.id);if(I.environment==="test"||I.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${I.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let U=(I.seal.url??I.source?.sealUrl??`https://${I.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await GW($,U,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${U}/api/v1/integrations/webhook/replay-mock-callback`},I.seal.endpoints.approvalStylePreferences)}throw new U$(`当前租户「${I.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${I.id}`)}async function RU($){let{query:I,sourceClient:z,targetClient:q,sourceCorp:U,targetCorp:Y,webhookSelector:J,snPrefix:Q,snSuffix:w,docIdPrefix:K,docIdSuffix:H,dryRun:G,fetchFn:W=fetch}=$,V=[];if(I.recordId){let B=await P4(z,I.recordId);V.push(B)}else if(I.recordIds&&I.recordIds.length>0)for(let B of I.recordIds)V.push(await P4(z,B));else if(I.sn){let B=await r6(z,{sourceDocumentSN:I.sn,limit:1});if(!B.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${I.sn}」的审批记录。`);V.push(B.records[0])}else if(I.sns&&I.sns.length>0)for(let B of I.sns){let u=await r6(z,{sourceDocumentSN:B,limit:1});if(!u.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${B}」的审批记录。`);V.push(u.records[0])}else if(I.limit!==void 0){let B=await r6(z,{limit:I.limit,status:I.status,startDate:I.startDate,endDate:I.endDate});if(!B.records.length)throw Error(`在企业「${U.name}」中未检索到符合条件的审批记录。`);V=B.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let X=V.map((B)=>({run:B,doc:Zw1(B,{snPrefix:Q,snSuffix:w,docIdPrefix:K,docIdSuffix:H})}));if(G){let B={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Y.seal.url}/api/v1/integrations/webhook/preview`};try{let x=await Y8(q,Y.seal.endpoints.approvalStylePreferences);if(x.length>0){let g=fW0(x,J,Y.id);B={id:g.id,name:g.name,mode:g.mode,incomingDocumentWebhookUrl:g.incomingDocumentWebhook.url}}}catch{}let u=X.map(({run:x,doc:g})=>({originalRecord:{id:x.id,sourceSystem:x.sourceSystem,sourceDocumentSN:x.sourceDocumentSN,sourceDocumentId:x.sourceDocumentId},document:g,success:!0})),h=u.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:B,totalCount:u.length,successCount:u.length,failureCount:0,originalRecord:h?u[0].originalRecord:void 0,document:h?u[0].document:void 0,records:u}}let L=await Dw1(q,Y,J),D={id:L.id,name:L.name,mode:L.mode,incomingDocumentWebhookUrl:L.incomingDocumentWebhook.url},F=[],T=0,P=0;for(let{run:B,doc:u}of X){console.error(`[webhook-replay] 正在向 Webhook 通道「${L.name}」推送单据: ${u.documentSN}...`);try{let h=await Lw1(L.incomingDocumentWebhook.url,L.secret,u,W);F.push({originalRecord:{id:B.id,sourceSystem:B.sourceSystem,sourceDocumentSN:B.sourceDocumentSN,sourceDocumentId:B.sourceDocumentId},replayedDocument:{documentSN:u.documentSN,documentId:u.documentId,fieldCount:u.fields.length},pushResult:h,success:!0}),T+=1}catch(h){let x=h instanceof Error?h.message:String(h);F.push({originalRecord:{id:B.id,sourceSystem:B.sourceSystem,sourceDocumentSN:B.sourceDocumentSN,sourceDocumentId:B.sourceDocumentId},replayedDocument:{documentSN:u.documentSN,documentId:u.documentId,fieldCount:u.fields.length},error:x,success:!1}),P+=1}}let M=F.length===1;return{success:P===0,dryRun:!1,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:D,totalCount:F.length,successCount:T,failureCount:P,originalRecord:M?F[0].originalRecord:void 0,replayedDocument:M?F[0].replayedDocument:void 0,pushResult:M?F[0].pushResult:void 0,records:F}}var nW0=Z.object({level:Z.enum(["error","warning","info"]),code:Z.string(),message:Z.string(),snippet:Z.string().optional(),suggestion:Z.string().optional()}),CS1=Z.object({score:Z.number().min(0).max(100),passed:Z.boolean(),issues:Z.array(nW0)}),Fw1=Z.object({ruleId:Z.string().optional(),ruleCode:Z.string().optional(),ruleName:Z.string().optional(),score:Z.number().min(0).max(100),passed:Z.boolean(),issues:Z.array(nW0),description:Z.string().optional()}),hS1=Z.object({linter:Z.string(),linterType:Z.enum(["built Line truncated
`,"utf8"),z}function dW0($){return $.map((I,z)=>{let q;if(typeof I.code==="number")q=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")q=I.code.startsWith("#")?I.code:`#${I.code}`;else q=`#${String(z+1).padStart(4,"0")}`;return{id:I.id,code:q,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}class m$ extends Error{errors;warnings;constructor($,I=[]){super([`材料包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}var ku=vI(GV0(),1),$Z0=vI(eV0(),1);var uD={maxEntries:1000,maxTotalSize:524288000,maxCompressionRatio:150};async function IZ0($){return new Promise((I,z)=>{ku.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(q,U)=>{if(q||!U)return z(q??Error("无法打开 ZIP"));let Y=[];U.readEntry(),U.on("entry",(J)=>{let Q=zZ0(J);if(!Q.endsWith("/")&&!QH1(Q))Y.push({fileName:Q,uncompressedSize:J.uncompressedSize,compressedSize:J.compressedSize,raw:J});U.readEntry()}),U.on("end",()=>I(Y)),U.on("error",z)})})}function zZ0($){let I=Buffer.isBuffer($.fileName)?$.fileName:Buffer.from(String($.fileName),"binary"),z=I.toString("utf8");if(!z.includes("�"))return z;let q=$Z0.default.decode(I,"gbk");if(!q.includes("�"))return q;return z}function QH1($){let I=$.split("/").pop()??"";return $.split("/").includes("__MACOSX")||I===".DS_Store"||I.startsWith("._")||I.startsWith(".~")||I.startsWith("~$")}function qZ0($,I){let z=[],q=Cz(I);if($.length>uD.maxEntries)z.push(`文件数超过 ${uD.maxEntries}`);if($.reduce((J,Q)=>J+Q.uncompressedSize,0)>uD.maxTotalSize)z.push("解压后总大小超过 500MB");for(let J of $){if(J.fileName.startsWith("/")||J.fileName.split("/").includes(".."))z.push(`存在不安全路径: ${J.fileName}`);if(J.compressedSize>0&&J.uncompressedSize/J.compressedSize>uD.maxCompressionRatio)z.push(`压缩比超过 150: ${J.fileName}`);if(J.fileName==="信息表.xlsx")continue;wH1(J,q,z)}if(!$.find((J)=>J.fileName==="信息表.xlsx"))z.push("ZIP 根目录缺少精确名为「信息表.xlsx」的文件");if($.some((J)=>J.fileName.toLowerCase().endsWith(".zip")))z.push("不允许嵌套 ZIP");if(z.length)throw new m$(z)}function wH1($,I,z){let q=KH1($.fileName);if(!q||!I.allowedExtensions.includes(q))z.push(`附件后缀不在白名单中: ${$.fileName}(允许: ${I.allowedExtensions.join(", ")})`);if($.uncompressedSize<I.minFileSizeBytes)z.push(`附件文件过小: ${$.fileName}(${$.uncompressedSize} B,小于最小值 ${I.minFileSizeBytes} B)`);if(I.maxFileSizeBytes!==void 0&&I.maxFileSizeBytes!==null&&$.uncompressedSize>I.maxFileSizeBytes)z.push(`附件文件过大: ${$.fileName}(${$.uncompressedSize} B,大于最大值 ${I.maxFileSizeBytes} B)`)}function KH1($){let I=$.split("/").pop()??$,z=I.lastIndexOf(".");return z>0?I.slice(z).toLowerCase():""}function fu($,I){return new Promise((z,q)=>{ku.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(U,Y)=>{if(U||!Y)return q(U??Error("无法打开 ZIP"));Y.readEntry(),Y.on("entry",(J)=>{if(zZ0(J)!==I.fileName)return Y.readEntry();Y.openReadStream(J,(Q,w)=>{if(Q||!w)return q(Q??Error(`无法读取 ${I.fileName}`));let K=[];w.on("data",(H)=>K.push(H)),w.on("end",()=>z(Buffer.concat(K))),w.on("error",q)})}),Y.on("error",q)})})}var YZ0=vI(Sy(),1);function HH1($){return $.startsWith("[附件]")}function JZ0($){return $.startsWith("[附件]")?$.slice(4):$}function GH1($){return JZ0($).toLowerCase().replace(/\s+/g,"_")||"attachment"}function WH1($){if($==null||$==="")return[];return String($).split(/[\n,;,;]/).map((I)=>I.trim()).filter(Boolean)}function nu($,I){let z=[];for(let[q,U]of I.entries()){if(!HH1(q))continue;let Y=$.getCell(U).value,J=WH1(Y);if(!J.length)continue;z.push({key:GH1(q),label:JZ0(q),paths:J})}return z}function bu($){let I=new Map;return $.map((z)=>{let q=(I.get(z.key)??0)+1;return I.set(z.key,q),q===1?z:{...z,key:`${z.key}-${q}`}})}function xD($,I,z,q){return{key:$,label:I,type:z,value:q}}function QZ0($,I,z){return xD($,I,"TEXT",z==null?"":String(z))}function wZ0($,I,z){return xD($,I,"AMOUNT",typeof z==="number"?{amount:z,currency:"CNY"}:null)}function KZ0($){if($ instanceof Date)return $.toISOString();if(typeof $==="string"&&$.trim())return $.trim();return null}function VH1($){if($ instanceof Date)return Math.floor($.getTime()/1000);if(typeof $==="string"&&$.trim()){let I=Date.parse($.trim().replace(" ","T"));if(Number.isFinite(I))return Math.floor(I/1000)}return null}function Bw($){let I=new Map;return $.getRow(1).eachCell((z,q)=>I.set(String(z.value??"").trim(),q)),I}function LI($,I,z){let q=I.get(z);return q?$.getCell(q).value:void 0}function ZH1($,I){return[["会议编号","meeting_id","TEXT"],["会议名称","meeting_name","TEXT"],["状态","status","TEXT"],["总金额","total_amount","AMOUNT"],["税前劳务总额","pretax_labor_total","AMOUNT"],["报销事由","reimbursement_reason","TEXT"],["po码","po_code","TEXT"],["快递单号","tracking_number","TEXT"],["申请日期","application_date","DATE"],["更新日期","updated_date","DATE"]].flatMap(([q,U,Y])=>{let J=LI($,I,q);if(J==null||J==="")return[];return[Y==="TEXT"?QZ0(U,q,J):Y==="AMOUNT"?wZ0(U,q,J):xD(U,q,Y,KZ0(J))]})}function UZ0($,I,z){return z.flatMap(([q,U,Y])=>{let J=LI($,I,q);if(J==null||J==="")return[];return[Y==="TEXT"?QZ0(U,q,J):Y==="AMOUNT"?wZ0(U,q,J):xD(U,q,Y,KZ0(J))]})}var XH1=[["姓名","name","TEXT"],["身份证号码","id_ Line truncated
`);let F=new FormData,T=await fu(q.fileBuffer,D),P=L.split("/").pop()??L;F.append("files",new File([new Uint8Array(T)],P));let M=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/attachments`,{method:"POST",headers:Fw({},z.secret),body:F});if(!M.ok)throw Error(`附件上传失败 ${M.status}: ${await M.text()}`);let B=await M.json();H.set(L,B.attachments?.map((u)=>u.data)??(B.data===void 0?[]:[B.data])),process.stderr.write(`✓ 附件上传成功: ${L}
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let Q=J[1];if(I===J[0]){Y(J);continue}if($.external){let K=$.external.registry.get(J[0])?.id;if(I!==J[0]&&K){Y(J);continue}}if($.metadataRegistry.get(J[0])?.id){Y(J);continue}if(Q.cycle){Y(J);continue}if(Q.count>1){if($.reused==="ref"){Y(J);continue}}}}function V9($,I){let z=$.seen.get(I);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let q=(Q)=>{let w=$.seen.get(Q);if(w.ref===null)return;let K=w.def??w.schema,H={...K},G=w.ref;if(w.ref=null,G){q(G);let V=$.seen.get(G),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))K.allOf=K.allOf??[],K.allOf.push(X);else Object.assign(K,X);if(Object.assign(K,H),Q._zod.parent===G)for(let D in K){if(D==="$ref"||D==="allOf")continue;if(!(D in H))delete K[D]}if(X.$ref&&V.def)for(let D in K){if(D==="$ref"||D==="allOf")continue;if(D in V.def&&JSON.stringify(K[D])===JSON.stringify(V.def[D]))delete K[D]}}let W=Q._zod.parent;if(W&&W!==G){q(W);let V=$.seen.get(W);if(V?.schema.$ref){if(K.$ref=V.schema.$ref,V.def)for(let X in K){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(K[X])===JSON.stringify(V.def[X]))delete K[X]}}}$.override({zodSchema:Q,jsonSchema:K,path:w.path??[]})};for(let Q of[...$.seen.entries()].reverse())q(Q[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Q=$.external.registry.get(I)?.id;if(!Q)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(Q)}Object.assign(U,z.def??z.schema);let Y=$.metadataRegistry.get(I)?.id;if(Y!==void 0&&U.id===Y)delete U.id;let J=$.external?.defs??{};for(let Q of $.seen.entries()){let w=Q[1];if(w.def&&w.defId){if(w.def.id===w.defId)delete w.def.id;J[w.defId]=w.def}}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")U.$defs=J;else U.definitions=J;try{let Q=JSON.parse(JSON.stringify(U));return Object.defineProperty(Q,"~standard",{value:{...I["~standard"],jsonSchema:{input:sI(I,"input",$.processors),output:sI(I,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function v6($,I){let z=I??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let q=$._zod.def;if(q.type==="transform")return!0;if(q.type==="array")return v6(q.element,z);if(q.type==="set")return v6(q.valueType,z);if(q.type==="lazy")return v6(q.getter(),z);if(q.type==="promise"||q.type==="optional"||q.type==="nonoptional"||q.type==="nullable"||q.type==="readonly"||q.type==="default"||q.type==="prefault")return v6(q.innerType,z);if(q.type==="intersection")return v6(q.left,z)||v6(q.right,z);if(q.type==="record"||q.type==="map")return v6(q.keyType,z)||v6(q.valueType,z);if(q.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return v6(q.in,z)||v6(q.out,z)}if(q.type==="object"){for(let U in q.shape)if(v6(q.shape[U],z))return!0;return!1}if(q.type==="union"){for(let U of q.options)if(v6(U,z))return!0;return!1}if(q.type==="tuple"){for(let U of q.items)if(v6(U,z))return!0;if(q.rest&&v6(q.rest,z))return!0;return!1}return!1}var EA=($,I={})=>(z)=>{let q=G9({...z,processors:I});return S1($,q),W9(q,$),V9(q,$)},sI=($,I,z={})=>(q)=>{let{libraryOptions:U,target:Y}=q??{},J=G9({...U??{},target:Y,io:I,processors:z});return S1($,J),W9(J,$),V9(J,$)};var iN0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},BA=($,I,z,q)=>{let U=z;U.type="string";let{minimum:Y,maximum:J,format:Q,patterns:w,contentEncoding:K}=$._zod.bag;if(typeof Y==="number")U.minLength=Y;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=iN0[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(K)U.contentEncoding=K;if(w&&w.size>0){let H=[...w];if(H.length===1)U.pattern=H[0].source;else if(H.length>1)U.allOf=[...H.map((G)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:G.source}))]}},jA=($,I,z,q)=>{let U=z,{minimum:Y,maximum:J,format:Q,multipleOf:w,exclusiveMaximum:K,exclusiveMinimum:H}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let G=typeof H==="number"&&H>=(Y??Number.NEGATIVE_INFINITY),W=typeof K==="number"&&K<=(J??Number.POSITIVE_INFINITY),V=I.target==="draft-04"||I.target==="openapi-3.0";if(G)if(V)U.minimum=H,U.exclusiveMinimum=!0;else U.exclusiveMinimum=H;else if(typeof Y==="number")U.minimum=Y;if(W)if(V)U.maximum=K,U.exclusiveMaximum=!0;else U.exclusiveMaximum=K;else if(typeof J==="number")U.maximum=J;if(typeof w==="number")U.multipleOf=w},vA=($,I,z,q)=>{z.type="boolean"},gA=($,I,z,q)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},RA=($,I,z,q)=>{if(I.unrepresentable==Line truncated
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),H_0(I)}clear(){this._buffer=void 0}}function H_0($){return yn.parse(JSON.parse($))}function Cd($){return JSON.stringify($)+`
`}class pE{constructor($=hd.stdin,I=hd.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new iE,this._started=!1,this._ondata=(z)=>{this._readBuffer.append(z),this.processReadBuffer()},this._onerror=(z)=>{this.onerror?.(z)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let z=Cd($);if(this._stdout.write(z))I();else this._stdout.once("drain",I)})}}import{dirname as ux,join as dW1}from"node:path";import{fileURLToPath as mW1}from"node:url";class Z5 extends Error{name="KyError";get isKyError(){return!0}}class W$ extends Z5{name="HTTPError";response;request;options;data;constructor($,I,z){let q=$.status||$.status===0?$.status:"",U=$.statusText??"",Y=`${q} ${U}`.trim(),J=Y?`status code ${Y}`:"an unknown error";super(`Request failed with ${J}: ${I.method} ${I.url}`);this.response=$,this.request=I,this.options=z}}class OJ extends Z5{name="NetworkError";request;constructor($,I){super(`Request failed due to a network error: ${$.method} ${$.url}`,I);this.request=$}}class NJ extends Error{name="NonError";value;constructor($){let I="Non-error value was thrown";try{if(typeof $==="string")I=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")I=$.message}catch{}super(I);this.value=$}}class Ez extends Z5{name="ForceRetryError";customDelay;code;customRequest;constructor($){let I=$?.cause?$.cause instanceof Error?$.cause:new NJ($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",I?{cause:I}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}class cE extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}class q8 extends Z5{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}var dE=(()=>{let $=!1,I=!1,z=typeof globalThis.ReadableStream==="function",q=typeof globalThis.Request==="function";if(z&&q)try{I=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(U){if(U instanceof Error&&U.message==="unsupported BodyInit type")return!1;throw U}return $&&!I})(),Sd=typeof globalThis.AbortController==="function",xG=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",yd=typeof globalThis.ReadableStream==="function",ud=typeof globalThis.FormData==="function",kG=["get","post","put","patch","head","delete"],G_0=()=>{return};G_0();var xd={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Bz=2147483647,kd=40,fG=Symbol("stop");class nG{options;constructor($){this.options=$}}var fd=($)=>new nG($),nd={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},bd={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var bG=new TextEncoder,W_0=($)=>{if(!$)return 0;if($ instanceof FormData){let I=0;for(let[z,q]of $)I+=kd,I+=bG.encode(`Content-Disposition: form-data; name="${z}"`).byteLength,I+=typeof q==="string"?bG.encode(q).byteLength:q.size;return I}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return bG.encode($).byteLength;if($ instanceof URLSearchParams)return bG.encode($.toString()).byteLength;return 0},id=($,I,z)=>{let q,U=0;return $.pipeThrough(new TransformStream({transform(Y,J){if(J.enqueue(Y),q){U+=q.byteLength;let Q=I===0?0:U/I;if(Q>=1)Q=1-Number.EPSILON;z?.({percent:Q,totalBytes:Math.max(I,U),transferredBytes:U},q)}q=Y},flush(){if(q)U+=q.byteLength,z?.({percent:1,totalBytes:Math.max(I,U),transferredBytes:U},q)}}))},pd=($,I)=>{if(!$.body)return $;let z={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,z);let q=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(id($.body,q,I),z)},cd=($,I,z)=>{if(!$.body)return $;let q=W_0(z??$.body);return new Request($,{duplex:"half",body:id($.body,q,I)})};var B8=($)=>$!==null&&typeof $==="object";var V_0=Symbol("replaceOption"),mE=($)=>B8($)&&$[V_0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$};var AJ=(...$)=>{for(let I of $)if( Line truncated
`,{mode:384}),I}function cy($){let I=bW0();for(let z of I){if(!A$(z))continue;for(let q of GD(z).filter((U)=>U.endsWith(".json")).filter((U)=>!U.startsWith("example."))){let U=e8(z,q);try{let Y=VD(U,"utf-8"),J=JSON.parse(Y);if(J&&typeof J==="object"&&J.id===$)return U}catch{}}}return}function j7($,I){let z=cy($);if(!z)throw Error(`Enterprise config not found: ${$}`);let U={...JSON.parse(VD(z,"utf-8")),...I};for(let J of Object.keys(I))if(I[J]===void 0)delete U[J];let Y=by.parse(U);return yW0(z,`${JSON.stringify(Y,null,2)}
`,"utf-8"),Y}function v7($,I,z=[]){let q=I.corpId?.trim()||void 0,U=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,Y=q??U;if(Y){let Q=$.find((H)=>H.id===Y);if(Q)return Q;let w=$.find((H)=>H.id.toLowerCase()===Y.toLowerCase());if(w)return w;let K=$.find((H)=>H.name.toLowerCase()===Y.toLowerCase());if(K)return K;throw Error(`No enterprise config found for ${Y}`)}if(!I.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let J=$[0];if(J)return J;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{readFileSync as RH1}from"node:fs";import{randomBytes as _H1}from"node:crypto";var cW0=300000,iW0=new Map;function Jw1($,I){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>I?z:z.toLowerCase())}function Qw1($,I){return I?$:$.toLowerCase()}function ww1($,I,z,q){let U=Qw1($,q),Y=I.filter((J)=>U.includes(J));if(z==="all"&&Y.length!==I.length)return[];return Y}function Kw1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function Hw1($,I){if(I.fields&&!I.fields.has($.field))return[];let z=Kw1($.value),q=[];return z.forEach((U,Y)=>{let J=ww1(U,I.keywords,I.matchMode,I.caseSensitive);if(J.length===0)return;let Q=Math.max(0,Y-I.contextLines),w=Math.min(z.length,Y+I.contextLines+1),K={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Y+1,matchedKeywords:J,matchedText:XD(U,I.maxChars),context:{before:I.snippetOnly?[]:z.slice(Q,Y).map((H)=>XD(H,I.maxChars)),line:XD(U,I.maxChars),after:I.snippetOnly?[]:z.slice(Y+1,w).map((H)=>XD(H,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)K.context={before:[],line:K.context.line,after:[]};q.push(K)}),q}function XD($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function Gw1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function pW0($){return $.rules.flatMap((I,z)=>{let q=`${$.id}:${I.description.slice(0,32)}`,U={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:I.scope,strictness:I.strictness,code:"code"in I?I.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:q,title:`${$.versionName} / ${I.scope}`,field:"history.description",value:I.description,metadata:U},{area:"rules",entityType:"rule",entityId:q,title:`${$.versionName} / ${I.scope}`,field:"history.scope",value:I.scope,metadata:U}]})}function Ww1($){return[{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"title",value:$.title,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"purpose",value:$.purpose,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"content",value:$.content,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}}]}function Vw1($){let I=[];if($.decisionPreferences)for(let[z,q]of Object.entries($.decisionPreferences))I.push({area:"preferences",entityType:"preference",field:`decisionPreferences.${z}`,value:q,metadata:{integrationSystem:$.integrationSystem}});return $.integrations.forEach((z,q)=>{I.push({area:"preferences",entityType:"integration",title:z.outboundName,field:`integrations[${q}]`,value:z,metadata:{type:z.type,outboundName:z.outboundName,mode:z.mode,corporationId:z.corporationId}})}),I}async function Zw1($,I,z){let q=z.ruleVersionScope??"current",U=[I.id,`ruleVersionScope=${q}`,`ruleVersionId=${z.ruleVersionId??""}`,`ruleVersionNumber=${z.ruleVersionNumber??""}`,`latestRuleVersion=${z.latestRuleVersion??!1}`,`documentLimit=${z.documentLimit??100}`].join("|"),Y=iW0.get(U);if(!z.refresh&&Y&&Date.now()<Y.expiresAt)return Y;let[J,Q,w]=await Promise.all([Xw1($,{scope:q,versionId:z.ruleVersionId,versionNumber:z.ruleVersionNumber,latest:z.latestRuleVersion}),j9($,{limit:z.documentLimit??100}),P1($,I.seal.endpoints.approvalStylePreferences)]),K=Date.now(),H={entries:[...J,...Q.articles.flatMap(Ww1),...Vw1(w)],fetchedAt:K,expiresAt:K+cW0};return iW0.set(U,H),H}async function Xw1($,I){if(I.scope==="current")return(await C6($)).rules.flatMap(Gw1);if(I.scope==="version"){let q=await Lw1($,I);return pW0(q)}return(await S$($)).flatMap(pW0)}async function Lw1($,I){if(I.versionId)return SJ($,I.versionId);let z=await S$($),q=I.versionNumber?z.find((U)=>U.versionNumber===I.versionNumber):z[0];if(!q)throw Error(I.versionNumber?`Rule version not found: ${I.versionNumber}`:"No rule versions found");return q}async func Line truncated
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==q.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:q}}async function Ew1($,I,z){let q=await Y8($,I.seal.endpoints.approvalStylePreferences);if(z||q.length>0)return lW0(q,z,I.id);if(I.environment==="test"||I.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${I.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let U=(I.seal.url??I.source?.sealUrl??`https://${I.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await WW($,U,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${U}/api/v1/integrations/webhook/replay-mock-callback`},I.seal.endpoints.approvalStylePreferences)}throw new U$(`当前租户「${I.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${I.id}`)}async function RU($){let{query:I,sourceClient:z,targetClient:q,sourceCorp:U,targetCorp:Y,webhookSelector:J,snPrefix:Q,snSuffix:w,docIdPrefix:K,docIdSuffix:H,dryRun:G,fetchFn:W=fetch}=$,V=[];if(I.recordId){let j=await P4(z,I.recordId);V.push(j)}else if(I.recordIds&&I.recordIds.length>0)for(let j of I.recordIds)V.push(await P4(z,j));else if(I.sn){let j=await r6(z,{sourceDocumentSN:I.sn,limit:1});if(!j.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${I.sn}」的审批记录。`);V.push(j.records[0])}else if(I.sns&&I.sns.length>0)for(let j of I.sns){let u=await r6(z,{sourceDocumentSN:j,limit:1});if(!u.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${j}」的审批记录。`);V.push(u.records[0])}else if(I.limit!==void 0){let j=await r6(z,{limit:I.limit,status:I.status,startDate:I.startDate,endDate:I.endDate});if(!j.records.length)throw Error(`在企业「${U.name}」中未检索到符合条件的审批记录。`);V=j.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let X=V.map((j)=>({run:j,doc:Aw1(j,{snPrefix:Q,snSuffix:w,docIdPrefix:K,docIdSuffix:H})}));if(G){let j={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Y.seal.url}/api/v1/integrations/webhook/preview`};try{let x=await Y8(q,Y.seal.endpoints.approvalStylePreferences);if(x.length>0){let g=lW0(x,J,Y.id);j={id:g.id,name:g.name,mode:g.mode,incomingDocumentWebhookUrl:g.incomingDocumentWebhook.url}}}catch{}let u=X.map(({run:x,doc:g})=>({originalRecord:{id:x.id,sourceSystem:x.sourceSystem,sourceDocumentSN:x.sourceDocumentSN,sourceDocumentId:x.sourceDocumentId},document:g,success:!0})),h=u.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:j,totalCount:u.length,successCount:u.length,failureCount:0,originalRecord:h?u[0].originalRecord:void 0,document:h?u[0].document:void 0,records:u}}let L=await Ew1(q,Y,J),D={id:L.id,name:L.name,mode:L.mode,incomingDocumentWebhookUrl:L.incomingDocumentWebhook.url},F=[],T=0,P=0;for(let{run:j,doc:u}of X){console.error(`[webhook-replay] 正在向 Webhook 通道「${L.name}」推送单据: ${u.documentSN}...`);try{let h=await Tw1(L.incomingDocumentWebhook.url,L.secret,u,W);F.push({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},replayedDocument:{documentSN:u.documentSN,documentId:u.documentId,fieldCount:u.fields.length},pushResult:h,success:!0}),T+=1}catch(h){let x=h instanceof Error?h.message:String(h);F.push({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},replayedDocument:{documentSN:u.documentSN,documentId:u.documentId,fieldCount:u.fields.length},error:x,success:!1}),P+=1}}let M=F.length===1;return{success:P===0,dryRun:!1,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:D,totalCount:F.length,successCount:T,failureCount:P,originalRecord:M?F[0].originalRecord:void 0,replayedDocument:M?F[0].replayedDocument:void 0,pushResult:M?F[0].pushResult:void 0,records:F}}var oW0=Z.object({level:Z.enum(["error","warning","info"]),code:Z.string(),message:Z.string(),snippet:Z.string().optional(),suggestion:Z.string().optional()}),iS1=Z.object({score:Z.number().min(0).max(100),passed:Z.boolean(),issues:Z.array(oW0)}),Bw1=Z.object({ruleId:Z.string().optional(),ruleCode:Z.string().optional(),ruleName:Z.string().optional(),score:Z.number().min(0).max(100),passed:Z.boolean(),issues:Z.array(oW0),description:Z.string().optional()}),pS1=Z.object({linter:Z.string(),linterType:Z.enum(["built Line truncated
`,"utf8"),z}function eW0($){return $.map((I,z)=>{let q;if(typeof I.code==="number")q=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")q=I.code.startsWith("#")?I.code:`#${I.code}`;else q=`#${String(z+1).padStart(4,"0")}`;return{id:I.id,code:q,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}class m$ extends Error{errors;warnings;constructor($,I=[]){super([`材料包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}var nu=vI(OV0(),1),wZ0=vI(QZ0(),1);var xD={maxEntries:1000,maxTotalSize:524288000,maxCompressionRatio:150};async function KZ0($){return new Promise((I,z)=>{nu.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(q,U)=>{if(q||!U)return z(q??Error("无法打开 ZIP"));let Y=[];U.readEntry(),U.on("entry",(J)=>{let Q=HZ0(J);if(!Q.endsWith("/")&&!XH1(Q))Y.push({fileName:Q,uncompressedSize:J.uncompressedSize,compressedSize:J.compressedSize,raw:J});U.readEntry()}),U.on("end",()=>I(Y)),U.on("error",z)})})}function HZ0($){let I=Buffer.isBuffer($.fileName)?$.fileName:Buffer.from(String($.fileName),"binary"),z=I.toString("utf8");if(!z.includes("�"))return z;let q=wZ0.default.decode(I,"gbk");if(!q.includes("�"))return q;return z}function XH1($){let I=$.split("/").pop()??"";return $.split("/").includes("__MACOSX")||I===".DS_Store"||I.startsWith("._")||I.startsWith(".~")||I.startsWith("~$")}function GZ0($,I){let z=[],q=Cz(I);if($.length>xD.maxEntries)z.push(`文件数超过 ${xD.maxEntries}`);if($.reduce((J,Q)=>J+Q.uncompressedSize,0)>xD.maxTotalSize)z.push("解压后总大小超过 500MB");for(let J of $){if(J.fileName.startsWith("/")||J.fileName.split("/").includes(".."))z.push(`存在不安全路径: ${J.fileName}`);if(J.compressedSize>0&&J.uncompressedSize/J.compressedSize>xD.maxCompressionRatio)z.push(`压缩比超过 150: ${J.fileName}`);if(J.fileName==="信息表.xlsx")continue;LH1(J,q,z)}if(!$.find((J)=>J.fileName==="信息表.xlsx"))z.push("ZIP 根目录缺少精确名为「信息表.xlsx」的文件");if($.some((J)=>J.fileName.toLowerCase().endsWith(".zip")))z.push("不允许嵌套 ZIP");if(z.length)throw new m$(z)}function LH1($,I,z){let q=DH1($.fileName);if(!q||!I.allowedExtensions.includes(q))z.push(`附件后缀不在白名单中: ${$.fileName}(允许: ${I.allowedExtensions.join(", ")})`);if($.uncompressedSize<I.minFileSizeBytes)z.push(`附件文件过小: ${$.fileName}(${$.uncompressedSize} B,小于最小值 ${I.minFileSizeBytes} B)`);if(I.maxFileSizeBytes!==void 0&&I.maxFileSizeBytes!==null&&$.uncompressedSize>I.maxFileSizeBytes)z.push(`附件文件过大: ${$.fileName}(${$.uncompressedSize} B,大于最大值 ${I.maxFileSizeBytes} B)`)}function DH1($){let I=$.split("/").pop()??$,z=I.lastIndexOf(".");return z>0?I.slice(z).toLowerCase():""}function bu($,I){return new Promise((z,q)=>{nu.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(U,Y)=>{if(U||!Y)return q(U??Error("无法打开 ZIP"));Y.readEntry(),Y.on("entry",(J)=>{if(HZ0(J)!==I.fileName)return Y.readEntry();Y.openReadStream(J,(Q,w)=>{if(Q||!w)return q(Q??Error(`无法读取 ${I.fileName}`));let K=[];w.on("data",(H)=>K.push(H)),w.on("end",()=>z(Buffer.concat(K))),w.on("error",q)})}),Y.on("error",q)})})}var VZ0=vI(uy(),1);function FH1($){return $.startsWith("[附件]")}function ZZ0($){return $.startsWith("[附件]")?$.slice(4):$}function OH1($){return ZZ0($).toLowerCase().replace(/\s+/g,"_")||"attachment"}function NH1($){if($==null||$==="")return[];return String($).split(/[\n,;,;]/).map((I)=>I.trim()).filter(Boolean)}function iu($,I){let z=[];for(let[q,U]of I.entries()){if(!FH1(q))continue;let Y=$.getCell(U).value,J=NH1(Y);if(!J.length)continue;z.push({key:OH1(q),label:ZZ0(q),paths:J})}return z}function pu($){let I=new Map;return $.map((z)=>{let q=(I.get(z.key)??0)+1;return I.set(z.key,q),q===1?z:{...z,key:`${z.key}-${q}`}})}function kD($,I,z,q){return{key:$,label:I,type:z,value:q}}function XZ0($,I,z){return kD($,I,"TEXT",z==null?"":String(z))}function LZ0($,I,z){return kD($,I,"AMOUNT",typeof z==="number"?{amount:z,currency:"CNY"}:null)}function DZ0($){if($ instanceof Date)return $.toISOString();if(typeof $==="string"&&$.trim())return $.trim();return null}function MH1($){if($ instanceof Date)return Math.floor($.getTime()/1000);if(typeof $==="string"&&$.trim()){let I=Date.parse($.trim().replace(" ","T"));if(Number.isFinite(I))return Math.floor(I/1000)}return null}function jw($){let I=new Map;return $.getRow(1).eachCell((z,q)=>I.set(String(z.value??"").trim(),q)),I}function LI($,I,z){let q=I.get(z);return q?$.getCell(q).value:void 0}function AH1($,I){return[["会议编号","meeting_id","TEXT"],["会议名称","meeting_name","TEXT"],["状态","status","TEXT"],["总金额","total_amount","AMOUNT"],["税前劳务总额","pretax_labor_total","AMOUNT"],["报销事由","reimbursement_reason","TEXT"],["po码","po_code","TEXT"],["快递单号","tracking_number","TEXT"],["申请日期","application_date","DATE"],["更新日期","updated_date","DATE"]].flatMap(([q,U,Y])=>{let J=LI($,I,q);if(J==null||J==="")return[];return[Y==="TEXT"?XZ0(U,q,J):Y==="AMOUNT"?LZ0(U,q,J):kD(U,q,Y,DZ0(J))]})}function WZ0($,I,z){return z.flatMap(([q,U,Y])=>{let J=LI($,I,q);if(J==null||J==="")return[];return[Y==="TEXT"?XZ0(U,q,J):Y==="AMOUNT"?LZ0(U,q,J):kD(U,q,Y,DZ0(J))]})}var PH1=[["姓名","name","TEXT"],["身份证号码","id_ Line truncated
`);let F=new FormData,T=await bu(q.fileBuffer,D),P=L.split("/").pop()??L;F.append("files",new File([new Uint8Array(T)],P));let M=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/attachments`,{method:"POST",headers:Ow({},z.secret),body:F});if(!M.ok)throw Error(`附件上传失败 ${M.status}: ${await M.text()}`);let j=await M.json();H.set(L,j.attachments?.map((u)=>u.data)??(j.data===void 0?[]:[j.data])),process.stderr.write(`✓ 附件上传成功: ${L}
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${w.document.documentId}
`);let W=iu(w.document,K,H),V=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/document`,{method:"POST",headers:{"Content-Type":"application/json",...Fw({webhookId:Y,...W},z.secret)},body:JSON.stringify(W)});if(!V.ok)throw Error(`Webhook 单据推送失败 ${V.status}: ${await V.text()}`);J.push({documentId:W.documentId,document:W,pushResult:await V.json()}),process.stderr.write(`✓ 单据推送成功: ${W.documentId}
`)}return{warnings:[],results:J}}function FI($){return{fileBuffer:DH1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}import{existsSync as MH1}from"node:fs";async function fD($,I,z={}){let U=Y4().stateful?"stateful":"stateless",Y="ok",J,Q,w;try{let M=await V$($);w={id:M.user.id,name:M.user.name,isAdmin:M.user.isAdmin},Q={id:M.tenant.id,name:M.tenant.name,tenantSlug:M.tenant.tenantSlug,corporationName:M.tenant.hoseCorpConfig?.corporationName}}catch(M){Y="error",J=M instanceof Error?M.message:String(M)}let K=[];if(Y==="ok")try{K=await Y8($,I.seal.endpoints.approvalStylePreferences)}catch(M){Y="error",J=`读取 Webhook 配置失败: ${M instanceof Error?M.message:String(M)}`}let H=K.length===1,G=K.map((M)=>({id:M.id,name:M.name,mode:M.mode,incomingDocumentWebhookUrl:M.incomingDocumentWebhook.url,outgoingResultWebhookUrl:M.outgoingResultWebhook,autoApprovalRate:M.autoApprovalRate,...H?{isDefault:!0}:{}})),W=H?{id:K[0].id,name:K[0].name,mode:K[0].mode}:null,V=z.webhook?v9(K,z.webhook):H?K[0]:void 0,X;if(z.filePath)if(!MH1(z.filePath))X={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let M=FI(z.filePath),B=await DI(M.fileBuffer,M.fileName,V?.materialPackFilePolicy);X={valid:!0,filePath:z.filePath,fileName:M.fileName,documentCount:B.documents.length,warnings:B.warnings}}catch(M){X={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[M instanceof Error?M.message:String(M)]}}let L=X?X.valid:!0,D=Y==="ok"&&G.length>0&&L,F=U==="stateful"?"":` --corp ${I.id}`,T="",P="";if(Y!=="ok")P=`凭证鉴权异常: ${J}`,T=`seal-use auth diagnose${F}`;else if(G.length===0)P="当前企业尚未配置任何 Webhook 集成通道",T=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${F}`;else if(X&&!X.valid)P=`材料包预检失败: ${X.errors?.join("; ")}`,T=`seal-use webhook material-pack preview ${X.filePath}${F}`;else{P=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${G.length} 个 Webhook 通道,等待载入`;let M=X?.filePath??"<材料包.zip>",B=H?"":` --webhook ${W?W.id:"<webhookIdOrName>"}`;T=`seal-use webhook material-pack push ${M}${B}${F}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:Q,user:w},stateMode:U,authStatus:Y,authError:J,activeWebhooks:G,defaultWebhook:W,materialPack:X,statusMessage:P,nextAction:T}}var vw=[{name:"seal_whoami",description:"查询当前 Seal 用户身份及租户信息",parameters:Z.object({}),handler:async($)=>V$($)},{name:"seal_session_get",description:"查询当前 Seal Bearer session、用户和过期时间",parameters:Z.object({}),handler:async($)=>Ul($)},{name:"seal_delegation_list",description:"查询当前 Seal 租户下的授权链接 (Delegation) 列表",parameters:Z.object({}),handler:async($)=>Bl($)},{name:"seal_delegation_create",description:"创建新的 Seal 授权链接 (Delegation)",parameters:Z.object({note:Z.string().optional().describe("授权链接的备注或说明信息")}),handler:async($,I)=>hz($,I)},{name:"seal_delegation_revoke",description:"撤销/废除指定的 Seal 授权链接 (Delegation)",parameters:Z.object({tokenId:Z.string().describe("授权链接 ID (delegation record ID)")}),handler:async($,I)=>jl($,I.tokenId)},{name:"seal_user_create",description:"创建本地 Seal 用户,生成并返回初始随机密码",parameters:Z.object({name:Z.string().describe("用户姓名"),phone:Z.string().describe("手机号码 (例如 13300001111 或 +8613300001111)"),permissions:Z.array(Z.string()).optional().describe("权限列表,默认为 []"),departmentIds:Z.array(Z.string()).optional().describe("关联部门 ID 数组")}),handler:async($,I)=>vl($,I)},{name:"seal_user_reset_password",description:"重置指定 Seal 用户的默认/随机密码,并返回生成的新密码",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>AB($,I.userId)},{name:"seal_user_get",description:"获取指定 Seal 用户的详细信息",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>UW($,I.userId)},{name:"seal_user_search",description:"按姓名、手机号或邮箱搜索 Seal 成员用户列表",parameters:Z.object({keyword:Z.string().optional().describe("搜索关键词(姓名、手机号、邮箱等),不传或传空字符串可列出租户成员")}),handler:async($,I)=>YW($,I.keyword??"")},{name:"seal_user_delete",description:"删除指定 Seal 本地用户",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>fl($,I.userId)},{name:"seal_user_activate",description:"启用/激活已离职的 Seal 用户账号",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>PB($,I.userId)},{name:"seal_user_delegation_create",description:"为指定 S Line truncated
`);let W=cu(w.document,K,H),V=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/document`,{method:"POST",headers:{"Content-Type":"application/json",...Ow({webhookId:Y,...W},z.secret)},body:JSON.stringify(W)});if(!V.ok)throw Error(`Webhook 单据推送失败 ${V.status}: ${await V.text()}`);J.push({documentId:W.documentId,document:W,pushResult:await V.json()}),process.stderr.write(`✓ 单据推送成功: ${W.documentId}
`)}return{warnings:[],results:J}}function FI($){return{fileBuffer:EH1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}import{existsSync as gH1}from"node:fs";async function nD($,I,z={}){let U=Y4().stateful?"stateful":"stateless",Y="ok",J,Q,w;try{let M=await V$($);w={id:M.user.id,name:M.user.name,isAdmin:M.user.isAdmin},Q={id:M.tenant.id,name:M.tenant.name,tenantSlug:M.tenant.tenantSlug,corporationName:M.tenant.hoseCorpConfig?.corporationName}}catch(M){Y="error",J=M instanceof Error?M.message:String(M)}let K=[];if(Y==="ok")try{K=await Y8($,I.seal.endpoints.approvalStylePreferences)}catch(M){Y="error",J=`读取 Webhook 配置失败: ${M instanceof Error?M.message:String(M)}`}let H=K.length===1,G=K.map((M)=>({id:M.id,name:M.name,mode:M.mode,incomingDocumentWebhookUrl:M.incomingDocumentWebhook.url,outgoingResultWebhookUrl:M.outgoingResultWebhook,autoApprovalRate:M.autoApprovalRate,...H?{isDefault:!0}:{}})),W=H?{id:K[0].id,name:K[0].name,mode:K[0].mode}:null,V=z.webhook?v9(K,z.webhook):H?K[0]:void 0,X;if(z.filePath)if(!gH1(z.filePath))X={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let M=FI(z.filePath),j=await DI(M.fileBuffer,M.fileName,V?.materialPackFilePolicy);X={valid:!0,filePath:z.filePath,fileName:M.fileName,documentCount:j.documents.length,warnings:j.warnings}}catch(M){X={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[M instanceof Error?M.message:String(M)]}}let L=X?X.valid:!0,D=Y==="ok"&&G.length>0&&L,F=U==="stateful"?"":` --corp ${I.id}`,T="",P="";if(Y!=="ok")P=`凭证鉴权异常: ${J}`,T=`seal-use auth diagnose${F}`;else if(G.length===0)P="当前企业尚未配置任何 Webhook 集成通道",T=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${F}`;else if(X&&!X.valid)P=`材料包预检失败: ${X.errors?.join("; ")}`,T=`seal-use webhook material-pack preview ${X.filePath}${F}`;else{P=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${G.length} 个 Webhook 通道,等待载入`;let M=X?.filePath??"<材料包.zip>",j=H?"":` --webhook ${W?W.id:"<webhookIdOrName>"}`;T=`seal-use webhook material-pack push ${M}${j}${F}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:Q,user:w},stateMode:U,authStatus:Y,authError:J,activeWebhooks:G,defaultWebhook:W,materialPack:X,statusMessage:P,nextAction:T}}var gw=[{name:"seal_whoami",description:"查询当前 Seal 用户身份及租户信息",parameters:Z.object({}),handler:async($)=>V$($)},{name:"seal_session_get",description:"查询当前 Seal Bearer session、用户和过期时间",parameters:Z.object({}),handler:async($)=>Kl($)},{name:"seal_delegation_list",description:"查询当前 Seal 租户下的授权链接 (Delegation) 列表",parameters:Z.object({}),handler:async($)=>_l($)},{name:"seal_delegation_create",description:"创建新的 Seal 授权链接 (Delegation)",parameters:Z.object({note:Z.string().optional().describe("授权链接的备注或说明信息")}),handler:async($,I)=>hz($,I)},{name:"seal_delegation_revoke",description:"撤销/废除指定的 Seal 授权链接 (Delegation)",parameters:Z.object({tokenId:Z.string().describe("授权链接 ID (delegation record ID)")}),handler:async($,I)=>Cl($,I.tokenId)},{name:"seal_user_create",description:"创建本地 Seal 用户,生成并返回初始随机密码",parameters:Z.object({name:Z.string().describe("用户姓名"),phone:Z.string().describe("手机号码 (例如 13300001111 或 +8613300001111)"),permissions:Z.array(Z.string()).optional().describe("权限列表,默认为 []"),departmentIds:Z.array(Z.string()).optional().describe("关联部门 ID 数组")}),handler:async($,I)=>hl($,I)},{name:"seal_user_reset_password",description:"重置指定 Seal 用户的默认/随机密码,并返回生成的新密码",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>PB($,I.userId)},{name:"seal_user_get",description:"获取指定 Seal 用户的详细信息",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>YW($,I.userId)},{name:"seal_user_search",description:"按姓名、手机号或邮箱搜索 Seal 成员用户列表",parameters:Z.object({keyword:Z.string().optional().describe("搜索关键词(姓名、手机号、邮箱等),不传或传空字符串可列出租户成员")}),handler:async($,I)=>JW($,I.keyword??"")},{name:"seal_user_delete",description:"删除指定 Seal 本地用户",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>ll($,I.userId)},{name:"seal_user_activate",description:"启用/激活已离职的 Seal 用户账号",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>EB($,I.userId)},{name:"seal_user_delegation_create",description:"为指定 S Line truncated
`+`• 身份主体:${F}${T}
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
`+`• 时效性:换票凭证有效时间 ${V} 秒(${Math.round(V/60)} 分钟),在浏览器打开后将保留 30 天会话
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?H:K,sealResultUrl:K,ssoUrl:H,type:I.sso?"sso_link":"deep_link",expiresIn:I.sso?V:void 0,identity:G,warning:W,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Y.type==="hose"?dH1(Y.domain):void 0,documentUrl:Q,recordId:U?.id,sourceDocumentSN:U?.sourceDocumentSN,sourceDocumentId:U?.sourceDocumentId,sourceSystem:U?.sourceSystem,missing:{enterpriseAssistUrl:J?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:q&&!Q?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:Z.object({query:Z.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:Z.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:Z.string().optional().describe("模拟批次 ID"),latest:Z.boolean().optional().describe("只返回最新一条匹配记录"),fields:Z.union([Z.string(),Z.array(Z.string())]).optional().describe("限制返回字段"),limit:Z.number().int().positive().max(100).optional(),maxScan:Z.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:Z.boolean().optional()}),handler:async($,I)=>{let z=I.sn??I.query;if(!z)throw Error("query or sn is required");let q=await mH1($,{query:z,sn:I.sn,batchId:I.batchId,latest:I.latest,limit:I.latest?1:I.limit??20,maxScan:I.maxScan??1000}),U=await Promise.all(q.records.map((Q)=>P4($,Q.id))),Y=ZZ0(I.fields),J=U.map((Q)=>iH1(Q,Y));return{query:z,sourceDocumentSN:I.sn,simulationBatchId:I.batchId,latest:I.latest??!1,total:q.total,scanned:q.scanned,matched:J.length,records:J,next:{getSummary:"seal-home approval-runs get <recordId> --summary",getRuleVersion:"seal-home rules version <ruleSetVersionNumber>",searchRuleVersion:`seal-home tool seal_approval_search --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version","ruleVersionNumber":14}'`,getVersionContext:`seal-home tool seal_approval_context_get --json '{"ruleVersionNumber":14}'`},...I.includeBridge?{bridge:iD(U)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:Z.object({batchId:Z.string().describe("simulation batch ID"),query:Z.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,I)=>{let z=au(await OB($,I.batchId),I.query);return{batchId:I.batchId,count:z.length,records:z.map(OI),bridge:iD(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:Z.object({mode:Z.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:Z.array(Z.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:Z.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:Z.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:Z.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:Z.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:Z.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:Z.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:Z.array(Z.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:Z.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:Z.record(Z.string(),Z.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:Z.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:Z.record(Z.string(),Z.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,I)=>{let z=I.mode??"hosecloud",q=I.signKey;if(z==="hosecloud"&&!q){if(q=(await MB($)).find((Q)=>Q.signKey)?.signKey,!q)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:nU({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:dD(I,["template.name","templateName","form.name","formName","formTitle"]),amount:bD(z,["金额","报销金额","付款金额","合计","价税合计"])??dD(I,["amount","totalAmount","expenseAmount"]),expenseType:bD(z,["费用类型","费用类别","报销类型"]),costCompany:bD(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:bD(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:kH1($),attachments:vU($,{summary:!0}).attachments,aiResult:lD($),manualResult:NI($)?.value,hints:nU({amountMentions:LZ0(q,["金额","合计","税率"],8),partyMentions:LZ0(q,["买方","卖方","甲方","乙方","收款"],8)})}}function SH1($){let I=[["result.citedRules",e5($,"result.citedRules")],["result.matchedRules",e5($,"result.matchedRules")],["result.ruleResults",e5($,"result.ruleResults")],["result.rules",e5($,"result.rules")],["pipelineData.citedRules",e5($,"pipelineData.citedRules")],["pipelineData.matchedRules",e5($,"pipelineData.matchedRules")]],z=[],q=new Set;for(let[U,Y]of I)(Array.isArray(Y)?Y:Y&&typeof Y==="object"?Object.values(Y):[]).forEach((Q,w)=>{let K=gw(Q);if(!K)return;let H=J4(K.runtimeRuleId)??J4(K.runtimeId)??J4(K.id)??J4(K.ruleId),G=J4(K.ruleCode)??J4(K.code)??(H?bH1(H):void 0),W=nU({runtimeRuleId:H,ruleCode:G,versionNumber:uH1(K.versionNumber)??$.ruleSetVersionNumber,scope:J4(K.scope),strictness:J4(K.strictness),appliedAnalysis:K.appliedAnalysis??K.analysis??K.reasoning,checkResult:K.checkResult??K.result??K.decision,findings:K.findings??K.riskPoints??K.evidence,sourcePath:`${U}.${w}`}),V=JSON.stringify(W);if(!q.has(V))q.add(V),z.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function dD($,I){if(!$)return;for(let z of I){let q=e5($,z);if(q!==void 0)return q}return}function XZ0($,I){if(!$)return 0;for(let z of I){let q=e5($,z);if(Array.isArray(q))return q.length;if(q&&typeof q==="object")return Object.keys(q).length;if(typeof q==="number")return q}return 0}function e5($,I){return I.split(".").reduce((z,q)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let U=Number(q);return Number.isInteger(U)?z[U]:void 0}if(typeof z==="object")return z[q];return},$)}function yH1($,I,z){let q=I.split("."),U=$;for(let Y of q.slice(0,-1)){let J=U[Y];if(!J||typeof J!=="object"||Array.isArray(J))U[Y]={};U=U[Y]}U[q[q.length-1]??I]=z}function nU($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function gw($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function uH1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function xH1($){let I=[];return du($,"document",I),I}function du($,I,z){if(Array.isArray($)){$.forEach((J,Q)=>du(J,`${I}.${Q}`,z));return}let q=gw($);if(!q)return;let U=J4(q.label)??J4(q.name)??J4(q.title)??J4(q.fieldName),Y=q.value??q.displayValue??q.text??q.content;if(U&&Y!==void 0&&typeof Y!=="object")z.push(nU({path:I,label:U,value:Y,type:J4(q.type)??J4(q.fieldType)}));for(let[J,Q]of Object.entries(q)){if(J==="attachments")continue;du(Q,`${I}.${J}`,z)}}function bD($,I){return $.find((q)=>{let U=J4(q.label)??"";return I.some((Y)=>U.includes(Y))})?.value}function kH1($){let I=[];return mD($.result,"result",I),mD($.document,"document",I),I.slice(0,20)}function mD($,I,z){if(Array.isArray($)){$.forEach((U,Y)=>mD(U,`${I}.${Y}`,z));return}let q=gw($);if(!q)return;if(/invoice|发票/i.test(I))z.push(nU({path:I,fileName:J4(q.fileName)??J4(q.filename)??J4(q.name),buyer:q.buyer??q.buyerName??q.purchaserName,seller:q.seller??q.sellerName,amount:q.amount??q.totalAmount??q.total,taxRate:q.taxRate,category:q.category??q.type}));for(let[U,Y]of Object.entries(q))mD(Y,`${I}.${U}`,z)}function LZ0($,I,z){return $.split(/\r?\n/).filter((q)=>I.some((U)=>q.includes(U))).slice(0,z)}function iD($){return $.map((I)=>{let z=OI(I);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function pu($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function fH1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let z=await P4($,I.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`)}function $G1($){let I=[];if(I.push(`seal-use ${$.area} - ${$.title}`),$.description)I.push($.description);I.push(""),I.push("Usage:");for(let z of $.commands)for(let q of z.usage)I.push(` ${q}`);if($.commands.some((z)=>z.name))I.push(""),I.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return I.join(`
`)}function kZ0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of fZ0)for(let z of I.commands)for(let q of z.usage)$.push(` ${q}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var zG1=100,qG1=120000,iZ0=["id","code","status","strictness","scope","createdAt","updatedAt"],UG1=200000;function zx($){return $.map((I)=>typeof I==="string"?I:String(I)).join(" ")}function Cw($){if(!$.length)return"";return`${$.join(`
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?H:K,sealResultUrl:K,ssoUrl:H,type:I.sso?"sso_link":"deep_link",expiresIn:I.sso?V:void 0,identity:G,warning:W,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Y.type==="hose"?eH1(Y.domain):void 0,documentUrl:Q,recordId:U?.id,sourceDocumentSN:U?.sourceDocumentSN,sourceDocumentId:U?.sourceDocumentId,sourceSystem:U?.sourceSystem,missing:{enterpriseAssistUrl:J?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:q&&!Q?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:Z.object({query:Z.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:Z.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:Z.string().optional().describe("模拟批次 ID"),latest:Z.boolean().optional().describe("只返回最新一条匹配记录"),fields:Z.union([Z.string(),Z.array(Z.string())]).optional().describe("限制返回字段"),limit:Z.number().int().positive().max(100).optional(),maxScan:Z.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:Z.boolean().optional()}),handler:async($,I)=>{let z=I.sn??I.query;if(!z)throw Error("query or sn is required");let q=await $G1($,{query:z,sn:I.sn,batchId:I.batchId,latest:I.latest,limit:I.latest?1:I.limit??20,maxScan:I.maxScan??1000}),U=await Promise.all(q.records.map((Q)=>P4($,Q.id))),Y=AZ0(I.fields),J=U.map((Q)=>tH1(Q,Y));return{query:z,sourceDocumentSN:I.sn,simulationBatchId:I.batchId,latest:I.latest??!1,total:q.total,scanned:q.scanned,matched:J.length,records:J,next:{getSummary:"seal-home approval-runs get <recordId> --summary",getRuleVersion:"seal-home rules version <ruleSetVersionNumber>",searchRuleVersion:`seal-home tool seal_approval_search --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version","ruleVersionNumber":14}'`,getVersionContext:`seal-home tool seal_approval_context_get --json '{"ruleVersionNumber":14}'`},...I.includeBridge?{bridge:pD(U)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:Z.object({batchId:Z.string().describe("simulation batch ID"),query:Z.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,I)=>{let z=eu(await NB($,I.batchId),I.query);return{batchId:I.batchId,count:z.length,records:z.map(OI),bridge:pD(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:Z.object({mode:Z.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:Z.array(Z.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:Z.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:Z.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:Z.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:Z.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:Z.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:Z.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:Z.array(Z.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:Z.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:Z.record(Z.string(),Z.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:Z.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:Z.record(Z.string(),Z.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,I)=>{let z=I.mode??"hosecloud",q=I.signKey;if(z==="hosecloud"&&!q){if(q=(await AB($)).find((Q)=>Q.signKey)?.signKey,!q)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:nU({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:mD(I,["template.name","templateName","form.name","formName","formTitle"]),amount:iD(z,["金额","报销金额","付款金额","合计","价税合计"])??mD(I,["amount","totalAmount","expenseAmount"]),expenseType:iD(z,["费用类型","费用类别","报销类型"]),costCompany:iD(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:iD(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:mH1($),attachments:vU($,{summary:!0}).attachments,aiResult:oD($),manualResult:NI($)?.value,hints:nU({amountMentions:TZ0(q,["金额","合计","税率"],8),partyMentions:TZ0(q,["买方","卖方","甲方","乙方","收款"],8)})}}function iH1($){let I=[["result.citedRules",e5($,"result.citedRules")],["result.matchedRules",e5($,"result.matchedRules")],["result.ruleResults",e5($,"result.ruleResults")],["result.rules",e5($,"result.rules")],["pipelineData.citedRules",e5($,"pipelineData.citedRules")],["pipelineData.matchedRules",e5($,"pipelineData.matchedRules")]],z=[],q=new Set;for(let[U,Y]of I)(Array.isArray(Y)?Y:Y&&typeof Y==="object"?Object.values(Y):[]).forEach((Q,w)=>{let K=Rw(Q);if(!K)return;let H=J4(K.runtimeRuleId)??J4(K.runtimeId)??J4(K.id)??J4(K.ruleId),G=J4(K.ruleCode)??J4(K.code)??(H?rH1(H):void 0),W=nU({runtimeRuleId:H,ruleCode:G,versionNumber:cH1(K.versionNumber)??$.ruleSetVersionNumber,scope:J4(K.scope),strictness:J4(K.strictness),appliedAnalysis:K.appliedAnalysis??K.analysis??K.reasoning,checkResult:K.checkResult??K.result??K.decision,findings:K.findings??K.riskPoints??K.evidence,sourcePath:`${U}.${w}`}),V=JSON.stringify(W);if(!q.has(V))q.add(V),z.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function mD($,I){if(!$)return;for(let z of I){let q=e5($,z);if(q!==void 0)return q}return}function PZ0($,I){if(!$)return 0;for(let z of I){let q=e5($,z);if(Array.isArray(q))return q.length;if(q&&typeof q==="object")return Object.keys(q).length;if(typeof q==="number")return q}return 0}function e5($,I){return I.split(".").reduce((z,q)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let U=Number(q);return Number.isInteger(U)?z[U]:void 0}if(typeof z==="object")return z[q];return},$)}function pH1($,I,z){let q=I.split("."),U=$;for(let Y of q.slice(0,-1)){let J=U[Y];if(!J||typeof J!=="object"||Array.isArray(J))U[Y]={};U=U[Y]}U[q[q.length-1]??I]=z}function nU($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function Rw($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function cH1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function dH1($){let I=[];return lu($,"document",I),I}function lu($,I,z){if(Array.isArray($)){$.forEach((J,Q)=>lu(J,`${I}.${Q}`,z));return}let q=Rw($);if(!q)return;let U=J4(q.label)??J4(q.name)??J4(q.title)??J4(q.fieldName),Y=q.value??q.displayValue??q.text??q.content;if(U&&Y!==void 0&&typeof Y!=="object")z.push(nU({path:I,label:U,value:Y,type:J4(q.type)??J4(q.fieldType)}));for(let[J,Q]of Object.entries(q)){if(J==="attachments")continue;lu(Q,`${I}.${J}`,z)}}function iD($,I){return $.find((q)=>{let U=J4(q.label)??"";return I.some((Y)=>U.includes(Y))})?.value}function mH1($){let I=[];return lD($.result,"result",I),lD($.document,"document",I),I.slice(0,20)}function lD($,I,z){if(Array.isArray($)){$.forEach((U,Y)=>lD(U,`${I}.${Y}`,z));return}let q=Rw($);if(!q)return;if(/invoice|发票/i.test(I))z.push(nU({path:I,fileName:J4(q.fileName)??J4(q.filename)??J4(q.name),buyer:q.buyer??q.buyerName??q.purchaserName,seller:q.seller??q.sellerName,amount:q.amount??q.totalAmount??q.total,taxRate:q.taxRate,category:q.category??q.type}));for(let[U,Y]of Object.entries(q))lD(Y,`${I}.${U}`,z)}function TZ0($,I,z){return $.split(/\r?\n/).filter((q)=>I.some((U)=>q.includes(U))).slice(0,z)}function pD($){return $.map((I)=>{let z=OI(I);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function du($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function lH1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let z=await P4($,I.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`)}function wG1($){let I=[];if(I.push(`seal-use ${$.area} - ${$.title}`),$.description)I.push($.description);I.push(""),I.push("Usage:");for(let z of $.commands)for(let q of z.usage)I.push(` ${q}`);if($.commands.some((z)=>z.name))I.push(""),I.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return I.join(`
`)}function mZ0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of lZ0)for(let z of I.commands)for(let q of z.usage)$.push(` ${q}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var HG1=100,GG1=120000,tZ0=["id","code","status","strictness","scope","createdAt","updatedAt"],WG1=200000;function Ux($){return $.map((I)=>typeof I==="string"?I:String(I)).join(" ")}function hw($){if(!$.length)return"";return`${$.join(`
`)}
`}function hw($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function E0($,I={}){YG1($,I);let z=`${JSON.stringify($,null,2)}
`;if(I.outputFile){IG1(I.outputFile,z),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function YG1($,I={}){if(I.allowFull||I.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>UG1)throw new XD(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function pZ0($,I){if(I)return;let z=$&&typeof $==="object"?$:{},q=typeof z.count==="number"?z.count:void 0,U=Array.isArray(z.rules)?z.rules.length:void 0,Y=Buffer.byteLength(JSON.stringify($),"utf-8"),J=q??U??0;if(J>zG1||Y>qG1)throw new XD(`Rule list is large (${J} rules, ${Y} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function W0($){return{allowFull:L0($.full)===!0,outputFile:j($.outputFile)??j($["output-file"])}}function cZ0($=[]){console.log(bZ0($))}function O1($){let I=q$(),z=Y4();return v7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},o5())}function MI($=Y4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:WI()}}async function O0($,I,z,q,U={}){E0(await AI($,I,z,q),U)}async function AI($,I,z,q){let U=vw.find((Q)=>Q.name===$);if(!U)throw Error(`Unknown Seal tool: ${$}`);let Y=Object.fromEntries(Object.entries(q).filter(([,Q])=>Q!==void 0)),J=U.handler;return J(I,Y,{corp:z})}import{existsSync as dZ0}from"node:fs";async function mZ0($,I){if(!dZ0($))throw Error(`File not found: ${$}`);let z=FI($);console.log(JSON.stringify(await DI(z.fileBuffer,z.fileName,I),null,2))}async function oD($,I,z,q,U){if($==="ready"||$==="status"){let Y=I??j(U.options.file)??j(U.options.input),J=await fD(z,q,{filePath:Y,webhook:j(U.options.webhook)??j(U.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${J.corp.name} (${J.corp.id}) [${J.stateMode}]`),J.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${J.corp.tenant.name} (${J.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${J.authStatus==="ok"?"OK":`异常 (${J.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${J.activeWebhooks.length} 个可用`);for(let Q of J.activeWebhooks){let w=Q.isDefault?" [默认通道]":"";console.error(` - ${Q.name} (${Q.id}) mode=${Q.mode}${w}`)}if(J.materialPack)console.error(`[webhook-ready] 材料包预检: ${J.materialPack.valid?`通过 (${J.materialPack.documentCount} 单)`:`失败 (${J.materialPack.errors?.join("; ")})`}`);if(J.ready)console.error(`\uD83D\uDFE2 ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);console.log(JSON.stringify(J,null,2));return}if($==="replay"){let Y=I??j(U.options.recordId)??j(U.options["record-id"])??j(U.options.id),J=j(U.options.recordIds)??j(U.options["record-ids"]),Q=J?J.split(",").map((b)=>b.trim()).filter(Boolean):void 0,w=j(U.options.sn)??j(U.options.documentSn)??j(U.options["document-sn"]),K=j(U.options.sns)??j(U.options["document-sns"]),H=K?K.split(",").map((b)=>b.trim()).filter(Boolean):void 0,G=k0(U.options.limit),W=j(U.options.status),V=j(U.options.startDate)??j(U.options["start-date"]),X=j(U.options.endDate)??j(U.options["end-date"]);if(!Y&&!Q&&!w&&!H&&G===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let L=j(U.options.sourceCorp)??j(U.options["source-corp"])??j(U.options.prodCorp)??j(U.options["prod-corp"]),D=j(U.options.targetCorp)??j(U.options["target-corp"])??j(U.options.testCorp)??j(U.options["test-corp"]),F=L0(U.options.force)===!0,{sourceCorp:T,targetCorp:P}=DD({sourceCorpId:L,targetCorpId:D,activeCorp:q,force:F},O1),M=T.id===q.id?z:await G1(T),B=P.id===q.id?z:await G1(P),u=j(U.options.webhook)??j(U.options.selector),h=j(U.options.snSuffix)??j(U.options["sn-suffix"]),x=j(U.options.snPrefix)??j(U.options["sn-prefix"]),g=j(U.options.docIdSuffix)??j(U.options["doc-id-suffix"]),p=j(U.options.docIdPrefix)??j(U.options["doc-id-prefix"]),i=L0(U.options.dryRun)??L0(U.options["dry-run"]),f=await RU({query:{recordId:Y,recordIds:Q,sn:w,sns:H,limit:G,status:W,startDate:V,endDate:X},sourceClient:M,targetClient:B,sourceCorp:T,targetCorp:P,webhookSelector:u,snPrefix:x,snSuffix:h,docIdPrefix:p,docIdSuffix:g,dryRun:i});if(i){console.error(`[webhook-replay] 预览模式:已成功从 ${T.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(f,null,2));return}if(f.success)if(f.totalCount===1&&f.replayedDocument)console.error(`\uD83D\uDFE2 成功重放Line truncated
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Y=O1(q),J=O1(U);if(Y.id===J.id)throw X4(`Cannot bind enterprise '${Y.id}' to itself.`);if(Y.prodCorpId&&Y.prodCorpId!==J.id)throw X4(`Cannot use '${Y.id}' as a production enterprise because it is already registered as a test enterprise for '${Y.prodCorpId}'. Multi-tier chaining is not permitted.`);if(J.testCorpId&&J.testCorpId!==Y.id)throw X4(`Cannot bind '${J.id}' as a test enterprise because it already has a bound test enterprise '${J.testCorpId}'. Multi-tier chaining is not permitted.`);let Q=L0(z.options.force)===!0;if(Y.testCorpId&&Y.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Y.id){if(!Q)throw $5(`Enterprise binding conflict: production enterprise '${Y.id}' is bound to '${Y.testCorpId??"none"}', and test enterprise '${J.id}' is bound to '${J.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${Y.id} ${J.id} --confirm --force`)}if(!(L0(z.options.confirm)===!0||L0(z.options.yes)===!0)){let G=Q?" --force":"";throw $5(`Refusing to bind test enterprise '${J.name}' (${J.id}) to production enterprise '${Y.name}' (${Y.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${J.id}' as a test environment.`,`seal-use corps bind-test ${Y.id} ${J.id} --confirm${G}`)}if(Y.testCorpId&&Y.testCorpId!==J.id)try{j7(Y.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Y.id)try{j7(J.prodCorpId,{testCorpId:void 0})}catch{}let K=j7(Y.id,{environment:"production",testCorpId:J.id}),H=j7(J.id,{environment:"test",prodCorpId:Y.id});E0({success:!0,productionEnterprise:{id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId},testEnterprise:{id:H.id,name:H.name,environment:H.environment,prodCorpId:H.prodCorpId}});return}if($==="unbind-test"){let q=I??j(z.options.corp),U=O1(q);if(!U.testCorpId&&!U.prodCorpId){E0({unbound:!1,message:`Enterprise '${U.name}' (${U.id}) does not have an active test enterprise binding.`});return}let Y=U.testCorpId?U.id:U.prodCorpId,J=U.testCorpId?U.testCorpId:U.id;if(!(L0(z.options.confirm)===!0||L0(z.options.yes)===!0))throw $5(`Refusing to unbind production enterprise '${Y}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${U.id} --confirm`);j7(Y,{testCorpId:void 0});try{j7(J,{prodCorpId:void 0})}catch{}E0({success:!0,unboundProduction:Y,unboundTest:J});return}if($==="sync-test"){let q=I??j(z.options.corp),U=O1(q);if(!U.testCorpId)throw X4(`Production enterprise '${U.name}' (${U.id}) has no bound test enterprise.
Run 'seal-use corps bind-test ${U.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let Y=O1(U.testCorpId);if(Y.environment!=="test")throw Error(`Target enterprise '${Y.name}' (${Y.id}) is marked as '${Y.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let J=await G1(U),Q=await G1(Y),[w,K,H,G,W,V,X,L]=await Promise.all([P1(J,U.seal.endpoints.approvalStylePreferences).catch(()=>({})),P1(Q,Y.seal.endpoints.approvalStylePreferences).catch(()=>({})),C6(J),C6(Q),S$(J).catch(()=>[]),S$(Q).catch(()=>[]),j9(J,{limit:100}).catch(()=>({articles:[]})),j9(Q,{limit:100}).catch(()=>({articles:[]}))]),D=(X.articles||[]).filter((Y0)=>!Y0.isDeleted),F=(L.articles||[]).filter((Y0)=>!Y0.isDeleted),T=new Map(F.map((Y0)=>[Y0.title.trim(),Y0])),P=[],M=[],B=new Set(D.map((Y0)=>Y0.title.trim()));for(let Y0 of D){let v0=Y0.title.trim(),q1=T.get(v0);if(!q1)P.push(Y0);else{let N1=q1.content!==Y0.content,b4=(q1.purpose??"")!==(Y0.purpose??""),n6=q1.enabled!==Y0.enabled,E$=q1.contentType!==Y0.contentType,b6=(q1.status??"")!==(Y0.status??""),T6=JSON.stringify([...q1.scenarios??[]].sort())!==JSON.stringify([...Y0.scenarios??[]].sort()),B$=JSON.stringify([...q1.tags??[]].sort())!==JSON.stringify([...Y0.tags??[]].sort());if(N1||b4||n6||E$||b6||T6||B$)M.push({testId:q1.id,prodDoc:Y0,reasons:[...N1?["content"]:[],...b4?["purpose"]:[],...n6?["enabled"]:[],...E$?["contentType"]:[],...b6?["status"]:[],...T6?["scenarios"]:[],...B$?["tags"]:[]]})}}let u=F.filter((Y0)=>!B.has(Y0.title.trim())),x=[...W].sort((Y0,v0)=>v0.versionNumber-Y0.versionNumber)[0],g=x?.versionNumber,i=([...V].sort((Y0,v0)=>v0.versionNumber-Y0.versionNumber)[0]?.versionNumber??0)+1,S=HL0(U.name,g,V),b=j(z.options["version-name"])??j(z.options.versionName)??GL0(U.name,g,S,i),z0={...K,tone:w.tone,language:w.language,detailLevel:w.detailLevel,outputFormat:w.outputFormat,examples:w.examples??[],prohibitedPhrases:w.prohibitedPhrases??[],customInstructions:w.customInstructions,decisionPreferences:w.decisionPreferences,thinkingDepthPreference:w.thinkingDepthPreference};if(L0(z.options["dry-run"])===!0||L0(z.options.dryRun)===!0){E0({dryRun:!0,source:{id:U.id,name:U.name,environment:U.environment,latestPublishedVersion:x?{versionNumber:x.versionNumber,versionName:x.versionName}:null,documentsCount:D.length},target:{id:Y.id,name:Y.name,environment:Y.environment},versionMappingPlan:{sourceProdVersionNumber:g??null,sourceProdVersionName:x?.versionName??null,targetTestExpectedVersionNumber:i,targetTestPublishVersionName:b,iteration:S},preferencesDiff:{decisionPreferences:{before:K.decisionPreferences,after:w.decisionPreferences},thinkingDepthPreference:{before:K.thinkingDepthPreference,after:w.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:G.rules.length,toDeleteCount:G.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((Y0,v0)=>({index:v0+1,sourceRuleId:Y0.id,sourceRuleCode:Y0.code??v0+1,expectedTargetCode:`rule-${v0+1}`,description:Y0.description,scope:Y0.scope,strictness:Y0.strictness}))},documentsPlan:{sourceDocumentCount:D.length,targetExistingDocumentCount:F.length,toCreateCount:P.length,toCreate:P.map((Y0)=>({title:Y0.title,purpose:Y0.purpose,contentType:Y0.contentType,scenarios:Y0.scenarios})),toUpdateCount:M.length,toUpdate:M.map((Y0)=>({targetDocumentId:Y0.testId,title:Y0.prodDoc.title,reasons:Y0.reasons})),toDeleteCount:u.length,toDelete:u.map((Y0)=>({targetDocumentId:Y0.id,title:Y0.title}))},publishingPlan:{targetCorpId:Y.id,publishVersionName:b,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(U.source.type!=="hose")return{sourceType:U.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let Y0=(w.integrations??[]).filter((N1)=>N1.type==="hosecloud"),v0=new Set,q1=Y0.filter((N1)=>{let b4=N1.corporationId??U.id;if(v0.has(b4))return!1;return v0.add(b4),!0});return{sourceType:"hose",outboundName:DL0(U.name),targetMode:"assisted",integrationsCount:q1.length,integrations:q1.map((N1)=>({corporationId:N1.corporationId,apiOrigin:N1.apiOrigin,customApiUrl:N1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(L0(z.options.yes)===!0||L0(z.options.confirm)===!0))throw $5(`Refusing to overwrite test enterprise '${Y.name}' (${Y.id}) with preferences, ${H.rules.length} draft rules, and ${D.length} knowledge documents from production enterprise '${U.name}' (${U.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${U.id} --yes`);await j8(Q,z0,Y.seal.endpoints.approvalStylePreferences);let c=[];for(let Y0 of u)await HW(Q,Y0.id),c.push({id:Y0.id,title:Y0.title});let r=[];for(let Y0 of M)await KW(Q,Y0.testId,{title:Y0.prodDoc.title,purpose:Y0.prodDoc.purpose,content:Y0.prodDoc.content,contentType:Y0.prodDoc.contentType,status:Y0.prodDoc.status,enabled:Y0.prodDoc.ena Line truncated
`}function Sw($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function E0($,I={}){VG1($,I);let z=`${JSON.stringify($,null,2)}
`;if(I.outputFile){KG1(I.outputFile,z),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function VG1($,I={}){if(I.allowFull||I.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>WG1)throw new LD(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function aZ0($,I){if(I)return;let z=$&&typeof $==="object"?$:{},q=typeof z.count==="number"?z.count:void 0,U=Array.isArray(z.rules)?z.rules.length:void 0,Y=Buffer.byteLength(JSON.stringify($),"utf-8"),J=q??U??0;if(J>HG1||Y>GG1)throw new LD(`Rule list is large (${J} rules, ${Y} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function W0($){return{allowFull:L0($.full)===!0,outputFile:B($.outputFile)??B($["output-file"])}}function sZ0($=[]){console.log(rZ0($))}function O1($){let I=q$(),z=Y4();return v7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},o5())}function MI($=Y4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:WI()}}async function O0($,I,z,q,U={}){E0(await AI($,I,z,q),U)}async function AI($,I,z,q){let U=gw.find((Q)=>Q.name===$);if(!U)throw Error(`Unknown Seal tool: ${$}`);let Y=Object.fromEntries(Object.entries(q).filter(([,Q])=>Q!==void 0)),J=U.handler;return J(I,Y,{corp:z})}import{existsSync as eZ0}from"node:fs";async function $X0($,I){if(!eZ0($))throw Error(`File not found: ${$}`);let z=FI($);console.log(JSON.stringify(await DI(z.fileBuffer,z.fileName,I),null,2))}async function rD($,I,z,q,U){if($==="ready"||$==="status"){let Y=I??B(U.options.file)??B(U.options.input),J=await nD(z,q,{filePath:Y,webhook:B(U.options.webhook)??B(U.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${J.corp.name} (${J.corp.id}) [${J.stateMode}]`),J.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${J.corp.tenant.name} (${J.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${J.authStatus==="ok"?"OK":`异常 (${J.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${J.activeWebhooks.length} 个可用`);for(let Q of J.activeWebhooks){let w=Q.isDefault?" [默认通道]":"";console.error(` - ${Q.name} (${Q.id}) mode=${Q.mode}${w}`)}if(J.materialPack)console.error(`[webhook-ready] 材料包预检: ${J.materialPack.valid?`通过 (${J.materialPack.documentCount} 单)`:`失败 (${J.materialPack.errors?.join("; ")})`}`);if(J.ready)console.error(`\uD83D\uDFE2 ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);console.log(JSON.stringify(J,null,2));return}if($==="replay"){let Y=I??B(U.options.recordId)??B(U.options["record-id"])??B(U.options.id),J=B(U.options.recordIds)??B(U.options["record-ids"]),Q=J?J.split(",").map((b)=>b.trim()).filter(Boolean):void 0,w=B(U.options.sn)??B(U.options.documentSn)??B(U.options["document-sn"]),K=B(U.options.sns)??B(U.options["document-sns"]),H=K?K.split(",").map((b)=>b.trim()).filter(Boolean):void 0,G=y0(U.options.limit),W=B(U.options.status),V=B(U.options.startDate)??B(U.options["start-date"]),X=B(U.options.endDate)??B(U.options["end-date"]);if(!Y&&!Q&&!w&&!H&&G===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let L=B(U.options.sourceCorp)??B(U.options["source-corp"])??B(U.options.prodCorp)??B(U.options["prod-corp"]),D=B(U.options.targetCorp)??B(U.options["target-corp"])??B(U.options.testCorp)??B(U.options["test-corp"]),F=L0(U.options.force)===!0,{sourceCorp:T,targetCorp:P}=FD({sourceCorpId:L,targetCorpId:D,activeCorp:q,force:F},O1),M=T.id===q.id?z:await G1(T),j=P.id===q.id?z:await G1(P),u=B(U.options.webhook)??B(U.options.selector),h=B(U.options.snSuffix)??B(U.options["sn-suffix"]),x=B(U.options.snPrefix)??B(U.options["sn-prefix"]),g=B(U.options.docIdSuffix)??B(U.options["doc-id-suffix"]),p=B(U.options.docIdPrefix)??B(U.options["doc-id-prefix"]),i=L0(U.options.dryRun)??L0(U.options["dry-run"]),f=await RU({query:{recordId:Y,recordIds:Q,sn:w,sns:H,limit:G,status:W,startDate:V,endDate:X},sourceClient:M,targetClient:j,sourceCorp:T,targetCorp:P,webhookSelector:u,snPrefix:x,snSuffix:h,docIdPrefix:p,docIdSuffix:g,dryRun:i});if(i){console.error(`[webhook-replay] 预览模式:已成功从 ${T.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(f,null,2));return}if(f.success)if(f.totalCount===1&&f.replayedDocument)console.error(`\uD83D\uDFE2 成功重放Line truncated
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Y=O1(q),J=O1(U);if(Y.id===J.id)throw X4(`Cannot bind enterprise '${Y.id}' to itself.`);if(Y.prodCorpId&&Y.prodCorpId!==J.id)throw X4(`Cannot use '${Y.id}' as a production enterprise because it is already registered as a test enterprise for '${Y.prodCorpId}'. Multi-tier chaining is not permitted.`);if(J.testCorpId&&J.testCorpId!==Y.id)throw X4(`Cannot bind '${J.id}' as a test enterprise because it already has a bound test enterprise '${J.testCorpId}'. Multi-tier chaining is not permitted.`);let Q=L0(z.options.force)===!0;if(Y.testCorpId&&Y.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Y.id){if(!Q)throw $5(`Enterprise binding conflict: production enterprise '${Y.id}' is bound to '${Y.testCorpId??"none"}', and test enterprise '${J.id}' is bound to '${J.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${Y.id} ${J.id} --confirm --force`)}if(!(L0(z.options.confirm)===!0||L0(z.options.yes)===!0)){let G=Q?" --force":"";throw $5(`Refusing to bind test enterprise '${J.name}' (${J.id}) to production enterprise '${Y.name}' (${Y.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${J.id}' as a test environment.`,`seal-use corps bind-test ${Y.id} ${J.id} --confirm${G}`)}if(Y.testCorpId&&Y.testCorpId!==J.id)try{j7(Y.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Y.id)try{j7(J.prodCorpId,{testCorpId:void 0})}catch{}let K=j7(Y.id,{environment:"production",testCorpId:J.id}),H=j7(J.id,{environment:"test",prodCorpId:Y.id});E0({success:!0,productionEnterprise:{id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId},testEnterprise:{id:H.id,name:H.name,environment:H.environment,prodCorpId:H.prodCorpId}});return}if($==="unbind-test"){let q=I??B(z.options.corp),U=O1(q);if(!U.testCorpId&&!U.prodCorpId){E0({unbound:!1,message:`Enterprise '${U.name}' (${U.id}) does not have an active test enterprise binding.`});return}let Y=U.testCorpId?U.id:U.prodCorpId,J=U.testCorpId?U.testCorpId:U.id;if(!(L0(z.options.confirm)===!0||L0(z.options.yes)===!0))throw $5(`Refusing to unbind production enterprise '${Y}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${U.id} --confirm`);j7(Y,{testCorpId:void 0});try{j7(J,{prodCorpId:void 0})}catch{}E0({success:!0,unboundProduction:Y,unboundTest:J});return}if($==="sync-test"){let q=I??B(z.options.corp),U=O1(q);if(!U.testCorpId)throw X4(`Production enterprise '${U.name}' (${U.id}) has no bound test enterprise.
Run 'seal-use corps bind-test ${U.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let Y=O1(U.testCorpId);if(Y.environment!=="test")throw Error(`Target enterprise '${Y.name}' (${Y.id}) is marked as '${Y.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let J=await G1(U),Q=await G1(Y),[w,K,H,G,W,V,X,L]=await Promise.all([P1(J,U.seal.endpoints.approvalStylePreferences).catch(()=>({})),P1(Q,Y.seal.endpoints.approvalStylePreferences).catch(()=>({})),C6(J),C6(Q),S$(J).catch(()=>[]),S$(Q).catch(()=>[]),j9(J,{limit:100}).catch(()=>({articles:[]})),j9(Q,{limit:100}).catch(()=>({articles:[]}))]),D=(X.articles||[]).filter((Y0)=>!Y0.isDeleted),F=(L.articles||[]).filter((Y0)=>!Y0.isDeleted),T=new Map(F.map((Y0)=>[Y0.title.trim(),Y0])),P=[],M=[],j=new Set(D.map((Y0)=>Y0.title.trim()));for(let Y0 of D){let v0=Y0.title.trim(),q1=T.get(v0);if(!q1)P.push(Y0);else{let N1=q1.content!==Y0.content,b4=(q1.purpose??"")!==(Y0.purpose??""),n6=q1.enabled!==Y0.enabled,E$=q1.contentType!==Y0.contentType,b6=(q1.status??"")!==(Y0.status??""),T6=JSON.stringify([...q1.scenarios??[]].sort())!==JSON.stringify([...Y0.scenarios??[]].sort()),B$=JSON.stringify([...q1.tags??[]].sort())!==JSON.stringify([...Y0.tags??[]].sort());if(N1||b4||n6||E$||b6||T6||B$)M.push({testId:q1.id,prodDoc:Y0,reasons:[...N1?["content"]:[],...b4?["purpose"]:[],...n6?["enabled"]:[],...E$?["contentType"]:[],...b6?["status"]:[],...T6?["scenarios"]:[],...B$?["tags"]:[]]})}}let u=F.filter((Y0)=>!j.has(Y0.title.trim())),x=[...W].sort((Y0,v0)=>v0.versionNumber-Y0.versionNumber)[0],g=x?.versionNumber,i=([...V].sort((Y0,v0)=>v0.versionNumber-Y0.versionNumber)[0]?.versionNumber??0)+1,S=FL0(U.name,g,V),b=B(z.options["version-name"])??B(z.options.versionName)??OL0(U.name,g,S,i),z0={...K,tone:w.tone,language:w.language,detailLevel:w.detailLevel,outputFormat:w.outputFormat,examples:w.examples??[],prohibitedPhrases:w.prohibitedPhrases??[],customInstructions:w.customInstructions,decisionPreferences:w.decisionPreferences,thinkingDepthPreference:w.thinkingDepthPreference};if(L0(z.options["dry-run"])===!0||L0(z.options.dryRun)===!0){E0({dryRun:!0,source:{id:U.id,name:U.name,environment:U.environment,latestPublishedVersion:x?{versionNumber:x.versionNumber,versionName:x.versionName}:null,documentsCount:D.length},target:{id:Y.id,name:Y.name,environment:Y.environment},versionMappingPlan:{sourceProdVersionNumber:g??null,sourceProdVersionName:x?.versionName??null,targetTestExpectedVersionNumber:i,targetTestPublishVersionName:b,iteration:S},preferencesDiff:{decisionPreferences:{before:K.decisionPreferences,after:w.decisionPreferences},thinkingDepthPreference:{before:K.thinkingDepthPreference,after:w.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:G.rules.length,toDeleteCount:G.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((Y0,v0)=>({index:v0+1,sourceRuleId:Y0.id,sourceRuleCode:Y0.code??v0+1,expectedTargetCode:`rule-${v0+1}`,description:Y0.description,scope:Y0.scope,strictness:Y0.strictness}))},documentsPlan:{sourceDocumentCount:D.length,targetExistingDocumentCount:F.length,toCreateCount:P.length,toCreate:P.map((Y0)=>({title:Y0.title,purpose:Y0.purpose,contentType:Y0.contentType,scenarios:Y0.scenarios})),toUpdateCount:M.length,toUpdate:M.map((Y0)=>({targetDocumentId:Y0.testId,title:Y0.prodDoc.title,reasons:Y0.reasons})),toDeleteCount:u.length,toDelete:u.map((Y0)=>({targetDocumentId:Y0.id,title:Y0.title}))},publishingPlan:{targetCorpId:Y.id,publishVersionName:b,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(U.source.type!=="hose")return{sourceType:U.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let Y0=(w.integrations??[]).filter((N1)=>N1.type==="hosecloud"),v0=new Set,q1=Y0.filter((N1)=>{let b4=N1.corporationId??U.id;if(v0.has(b4))return!1;return v0.add(b4),!0});return{sourceType:"hose",outboundName:EL0(U.name),targetMode:"assisted",integrationsCount:q1.length,integrations:q1.map((N1)=>({corporationId:N1.corporationId,apiOrigin:N1.apiOrigin,customApiUrl:N1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(L0(z.options.yes)===!0||L0(z.options.confirm)===!0))throw $5(`Refusing to overwrite test enterprise '${Y.name}' (${Y.id}) with preferences, ${H.rules.length} draft rules, and ${D.length} knowledge documents from production enterprise '${U.name}' (${U.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${U.id} --yes`);await j8(Q,z0,Y.seal.endpoints.approvalStylePreferences);let c=[];for(let Y0 of u)await GW(Q,Y0.id),c.push({id:Y0.id,title:Y0.title});let r=[];for(let Y0 of M)await HW(Q,Y0.testId,{title:Y0.prodDoc.title,purpose:Y0.prodDoc.purpose,content:Y0.prodDoc.content,contentType:Y0.prodDoc.contentType,status:Y0.prodDoc.status,enabled:Y0.prodDoc.ena Line truncated
Run 'seal-use corps bind-test ${U.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association,
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);J=U}else if(J=O1(U.testCorpId),J.environment!=="test"&&!Y)throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let Q=j(z.options.recordId)??j(z.options["record-id"])??j(z.options.id),w=j(z.options.recordIds)??j(z.options["record-ids"]),K=w?w.split(",").map((i)=>i.trim()).filter(Boolean):void 0,H=j(z.options.sn)??j(z.options.documentSn)??j(z.options["document-sn"]),G=j(z.options.sns)??j(z.options["document-sns"]),W=G?G.split(",").map((i)=>i.trim()).filter(Boolean):void 0,V=k0(z.options.limit)??(!Q&&!K&&!H&&!W?1:void 0),X=j(z.options.status),L=j(z.options.startDate)??j(z.options["start-date"]),D=j(z.options.endDate)??j(z.options["end-date"]),F=await G1(U),T=U.id===J.id?F:await G1(J),P=j(z.options.webhook)??j(z.options.selector),M=j(z.options.snSuffix)??j(z.options["sn-suffix"]),B=j(z.options.snPrefix)??j(z.options["sn-prefix"]),u=j(z.options.docIdSuffix)??j(z.options["doc-id-suffix"]),h=j(z.options.docIdPrefix)??j(z.options["doc-id-prefix"]),x=L0(z.options.dryRun)??L0(z.options["dry-run"]),g={recordId:Q,recordIds:K,sn:H,sns:W,limit:V,status:X,startDate:L,endDate:D};console.error(`[corps-replay-test] 正式企业「${U.name}」(${U.id}) -> 测试企业「${J.name}」(${J.id})`);let p=await RU({query:g,sourceClient:F,targetClient:T,sourceCorp:U,targetCorp:J,webhookSelector:P,snPrefix:B,snSuffix:M,docIdPrefix:h,docIdSuffix:u,dryRun:x});if(x){console.error(`[corps-replay-test] 预览模式:已成功从 ${U.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(p,null,2));return}if(p.success)if(p.totalCount===1&&p.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${p.replayedDocument.documentSN}」至 ${J.name} (${p.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${p.successCount} 条单据(来自「${U.name}」)至「${J.name}」(${p.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${p.successCount} 条,失败 ${p.failureCount} 条)至「${J.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${J.id} --limit ${p.totalCount}`),console.log(JSON.stringify(p,null,2)),!p.success)process.exitCode=1;return}if($==="switch"){let q=I;if(!q)throw Error("Usage: seal-use corps switch <corpId>");let U=Y4();if(!U.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let Y=O1(q);VI({...U,stateful:!0,defaultCorpId:Y.id}),E0({current:!0,id:Y.id,name:Y.name});return}if($==="probe-hose"){await fG1(J$(z.json));return}if($==="hose-staffs"){await nG1(J$(z.json));return}if($==="add-hose"){await bG1(J$(z.json));return}if($==="add-seal"){await iG1(J$(z.json));return}if($==="add-link"){let q=I??j(z.options.link)??j(z.options.url);if(!q)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]");await pG1(q,j(z.options.name),L0(z.options.overwrite)===!0);return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function DL0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function kG1($,I,z,q){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let U=($.source.appKey??$.source.key)?.trim(),Y=($.source.appSecurity??$.source.password)?.trim();if(!U||!Y)return{skipped:!0,reason:"prod hose source missing appKey/appSecurity (or key/password)"};let[J,Q]=await Promise.all([P1(z,$.seal.endpoints.approvalStylePreferences).catch(()=>({})),P1(q,I.seal.endpoints.approvalStylePreferences).catch(()=>({}))]),w=(J.integrations??[]).filter((T)=>T.type==="hosecloud");if(w.length===0)return{skipped:!0,reason:"prod Seal enterprise has no hosecloud integrations configured"};let K=new Set,H=[];for(let T of w){let P=T.corporationId??$.id;if(!K.has(P))K.add(P),H.push(T)}let G=Q.integrations??[],W=new Map(G.filter((T)=>T.type==="hosecloud").map((T)=>[T.corporationId,T])),V=DL0($.name),X=[],L=H.map((T)=>{let P=W.get(T.corporationId),M=P?.signKey??yG1(6).toString("hex");return X.push({signKey:M,outboundName:V,corporationId:T.corporationId,action:P?"updated":"created"}),{type:"hosecloud",signKey:M,outboundName:V,mode:"assisted",apiKey:U,apiSecret:Y,apiOrigin:T.apiOrigin,...T.customApiUrl?{customApiUrl:T.customApiUrl}:{},corporationId:T.corporationId}}),D=G.filter((T)=>T.type!=="hosecloud"),F={...Q,integrations:[...D,...L]};return await j8(q,F,I.seal.endpoints.approvalStylePreferences),{skipped:!1,synced:X}}async function fG1($){let I=_7($,"appKey"),z=_7($,"appSecurity"),q=m1($,"domain"),U=await _z(I,z,q),Y=await aG(U.domain,U.openapiToken).catch(()=>[]) Line truncated
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);J=U}else if(J=O1(U.testCorpId),J.environment!=="test"&&!Y)throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let Q=B(z.options.recordId)??B(z.options["record-id"])??B(z.options.id),w=B(z.options.recordIds)??B(z.options["record-ids"]),K=w?w.split(",").map((i)=>i.trim()).filter(Boolean):void 0,H=B(z.options.sn)??B(z.options.documentSn)??B(z.options["document-sn"]),G=B(z.options.sns)??B(z.options["document-sns"]),W=G?G.split(",").map((i)=>i.trim()).filter(Boolean):void 0,V=y0(z.options.limit)??(!Q&&!K&&!H&&!W?1:void 0),X=B(z.options.status),L=B(z.options.startDate)??B(z.options["start-date"]),D=B(z.options.endDate)??B(z.options["end-date"]),F=await G1(U),T=U.id===J.id?F:await G1(J),P=B(z.options.webhook)??B(z.options.selector),M=B(z.options.snSuffix)??B(z.options["sn-suffix"]),j=B(z.options.snPrefix)??B(z.options["sn-prefix"]),u=B(z.options.docIdSuffix)??B(z.options["doc-id-suffix"]),h=B(z.options.docIdPrefix)??B(z.options["doc-id-prefix"]),x=L0(z.options.dryRun)??L0(z.options["dry-run"]),g={recordId:Q,recordIds:K,sn:H,sns:W,limit:V,status:X,startDate:L,endDate:D};console.error(`[corps-replay-test] 正式企业「${U.name}」(${U.id}) -> 测试企业「${J.name}」(${J.id})`);let p=await RU({query:g,sourceClient:F,targetClient:T,sourceCorp:U,targetCorp:J,webhookSelector:P,snPrefix:j,snSuffix:M,docIdPrefix:h,docIdSuffix:u,dryRun:x});if(x){console.error(`[corps-replay-test] 预览模式:已成功从 ${U.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(p,null,2));return}if(p.success)if(p.totalCount===1&&p.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${p.replayedDocument.documentSN}」至 ${J.name} (${p.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${p.successCount} 条单据(来自「${U.name}」)至「${J.name}」(${p.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${p.successCount} 条,失败 ${p.failureCount} 条)至「${J.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${J.id} --limit ${p.totalCount}`),console.log(JSON.stringify(p,null,2)),!p.success)process.exitCode=1;return}if($==="switch"){let q=I;if(!q)throw Error("Usage: seal-use corps switch <corpId>");let U=Y4();if(!U.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let Y=O1(q);VI({...U,stateful:!0,defaultCorpId:Y.id}),E0({current:!0,id:Y.id,name:Y.name});return}if($==="probe-hose"){await lG1(J$(z.json));return}if($==="hose-staffs"){await oG1(J$(z.json));return}if($==="add-hose"){await rG1(J$(z.json));return}if($==="add-seal"){await tG1(J$(z.json));return}if($==="add-link"){let q=I??B(z.options.link)??B(z.options.url);if(!q)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]");await aG1(q,B(z.options.name),L0(z.options.overwrite)===!0);return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function EL0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function mG1($,I,z,q){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let U=($.source.appKey??$.source.key)?.trim(),Y=($.source.appSecurity??$.source.password)?.trim();if(!U||!Y)return{skipped:!0,reason:"prod hose source missing appKey/appSecurity (or key/password)"};let[J,Q]=await Promise.all([P1(z,$.seal.endpoints.approvalStylePreferences).catch(()=>({})),P1(q,I.seal.endpoints.approvalStylePreferences).catch(()=>({}))]),w=(J.integrations??[]).filter((T)=>T.type==="hosecloud");if(w.length===0)return{skipped:!0,reason:"prod Seal enterprise has no hosecloud integrations configured"};let K=new Set,H=[];for(let T of w){let P=T.corporationId??$.id;if(!K.has(P))K.add(P),H.push(T)}let G=Q.integrations??[],W=new Map(G.filter((T)=>T.type==="hosecloud").map((T)=>[T.corporationId,T])),V=EL0($.name),X=[],L=H.map((T)=>{let P=W.get(T.corporationId),M=P?.signKey??pG1(6).toString("hex");return X.push({signKey:M,outboundName:V,corporationId:T.corporationId,action:P?"updated":"created"}),{type:"hosecloud",signKey:M,outboundName:V,mode:"assisted",apiKey:U,apiSecret:Y,apiOrigin:T.apiOrigin,...T.customApiUrl?{customApiUrl:T.customApiUrl}:{},corporationId:T.corporationId}}),D=G.filter((T)=>T.type!=="hosecloud"),F={...Q,integrations:[...D,...L]};return await j8(q,F,I.seal.endpoints.approvalStylePreferences),{skipped:!1,synced:X}}async function lG1($){let I=_7($,"appKey"),z=_7($,"appSecurity"),q=m1($,"domain"),U=await _z(I,z,q),Y=await sG(U.domain,U.openapiToken).catch(()=>[]) Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${g.length} candidate administrators:
- ${p}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!L)if(!H&&Y)L=Y;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let D=m1($,"id")??W,F=V??W,T=m1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,P={id:D,name:F,environment:"production",seal:{url:T,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:G,appKey:z,appSecurity:q,corpId:W,staffId:L},auth:{refreshTtl:300}};if(H)dG(D),await pU(P);let M=by();VL0(M,{recursive:!0,mode:448});let B=XL0(M,`${su(D)}.json`);if(WL0(B)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${B}. Pass "overwrite": true to replace it.`);ZL0(B,`${JSON.stringify(P,null,2)}
`,{mode:384}),E0({id:D,name:F,corpId:W,domain:G,staffId:L,verified:H,path:B})}async function iG1($){let I=_7($,"token"),z=(m1($,"sealUrl")??m1($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let q=hZ0($,"expiresIn")??2592000,U=$.force===!0||$.verify===!1?!1:!0,Y=FL0($),J=U?await cG1(z,I,EJ(Y)):void 0;OL0($,{token:I,sealUrl:z,expiresIn:q,verify:U,remote:J,custom:Y})}function FL0($){return{headers:xy.parse($.headers),cookies:ky.parse($.cookies)}}async function pG1($,I,z){let q=await mG($),U=BJ(q.sealUrl,q.token),Y=await V$(U),J={user:Y.user,tenant:Y.tenant};lG(q.corpId,J.tenant),OL0({id:q.corpId,corpId:q.corpId,name:I,provider:"hosecloud",overwrite:z},{token:q.token,sealUrl:q.sealUrl,expiresIn:q.expiresIn,verify:!0,remote:J})}function OL0($,I){let{token:z,sealUrl:q,expiresIn:U,verify:Y,remote:J}=I,Q=I.custom??FL0($),w=J?.user,K=J?.tenant,H=m1($,"tenantSlug")??h7(K?.tenantSlug),G=m1($,"tenantId")??h7(K?.id),W=m1($,"tenantName")??h7(K?.name),V=m1($,"id")??H??G;if(!V)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let X=m1($,"staffId")??h7(w?.providerUserId)??h7(w?.id)??"seal",L=m1($,"provider")??h7(w?.provider)??h7(K?.providerConfig?.provider),D=m1($,"corpId")??H??G??V,F={id:V,name:m1($,"name")??W??V,environment:"production",seal:{url:q,tenantSlug:H,headers:Q.headers,cookies:Q.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:q,expiresIn:U,staffId:X,corpId:D,tenantId:G,tenantSlug:H,tenantName:W,providerUserId:h7(w?.providerUserId),provider:L},auth:{refreshTtl:300}},T=by();VL0(T,{recursive:!0,mode:448});let P=XL0(T,`${su(V)}.json`);if(WL0(P)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${P}. Pass "overwrite": true to replace it.`);ZL0(P,`${JSON.stringify(F,null,2)}
`,{mode:384}),E0({id:V,name:F.name,tenantId:G,tenantSlug:H,verified:Y,path:P})}async function cG1($,I,z={}){let q=await dG1(`${$}/api/v1/auth/me`,{...z,authorization:`Bearer ${I}`}),U=zF(q.data);return{user:zF(U.user??q.user),tenant:zF(U.tenant??q.tenant)}}async function dG1($,I={}){let z=await fetch($,{headers:I}),q=await z.text();if(!z.ok)throw Error(`${z.status} ${q}`);let U=JSON.parse(q);return zF(U)}function zF($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function h7($){return typeof $==="string"&&$?$:void 0}async function NL0($,I){let z=await mG($),q=BJ(z.sealUrl,z.token),U=await V$(q);lG(z.corpId,U.tenant);let Y=await hz(q,{note:I});E0({tenant:{id:U.tenant.id,name:U.tenant.name,tenantSlug:U.tenant.tenantSlug,corpId:z.corpId},user:{id:U.user.id,name:U.user.name,providerUserId:U.user.providerUserId,isAdmin:U.user.isAdmin},delegation:Y,expiresIn:z.expiresIn})}async function ML0($,I,z,q,U){if($==="list"){await O0("seal_delegation_list",z,q,{},W0(U.options));return}if($==="create"){let Y=j(U.options.note)??(I?[I,...U.command.slice(2)].join(" "):void 0);await O0("seal_delegation_create",z,q,{note:Y},W0(U.options));return}if($==="revoke"){let Y=I??j(U.options.tokenId);if(!Y)throw Error("Usage: seal-use delegation revoke <tokenId>");await O0("seal_delegation_revoke",z,q,{tokenId:Y},W0(U.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as mG1}from"node:fs";async function AL0($,I,z,q,U,Y){if(!$||$==="help")throw Error(`Usage: seal-use deploy <system> <action> [options]
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!L)if(!H&&Y)L=Y;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let D=m1($,"id")??W,F=V??W,T=m1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,P={id:D,name:F,environment:"production",seal:{url:T,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:G,appKey:z,appSecurity:q,corpId:W,staffId:L},auth:{refreshTtl:300}};if(H)mG(D),await pU(P);let M=py();ML0(M,{recursive:!0,mode:448});let j=PL0(M,`${$x(D)}.json`);if(NL0(j)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${j}. Pass "overwrite": true to replace it.`);AL0(j,`${JSON.stringify(P,null,2)}
`,{mode:384}),E0({id:D,name:F,corpId:W,domain:G,staffId:L,verified:H,path:j})}async function tG1($){let I=_7($,"token"),z=(m1($,"sealUrl")??m1($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let q=bZ0($,"expiresIn")??2592000,U=$.force===!0||$.verify===!1?!1:!0,Y=BL0($),J=U?await sG1(z,I,EJ(Y)):void 0;jL0($,{token:I,sealUrl:z,expiresIn:q,verify:U,remote:J,custom:Y})}function BL0($){return{headers:fy.parse($.headers),cookies:ny.parse($.cookies)}}async function aG1($,I,z){let q=await lG($),U=BJ(q.sealUrl,q.token),Y=await V$(U),J={user:Y.user,tenant:Y.tenant};oG(q.corpId,J.tenant),jL0({id:q.corpId,corpId:q.corpId,name:I,provider:"hosecloud",overwrite:z},{token:q.token,sealUrl:q.sealUrl,expiresIn:q.expiresIn,verify:!0,remote:J})}function jL0($,I){let{token:z,sealUrl:q,expiresIn:U,verify:Y,remote:J}=I,Q=I.custom??BL0($),w=J?.user,K=J?.tenant,H=m1($,"tenantSlug")??h7(K?.tenantSlug),G=m1($,"tenantId")??h7(K?.id),W=m1($,"tenantName")??h7(K?.name),V=m1($,"id")??H??G;if(!V)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let X=m1($,"staffId")??h7(w?.providerUserId)??h7(w?.id)??"seal",L=m1($,"provider")??h7(w?.provider)??h7(K?.providerConfig?.provider),D=m1($,"corpId")??H??G??V,F={id:V,name:m1($,"name")??W??V,environment:"production",seal:{url:q,tenantSlug:H,headers:Q.headers,cookies:Q.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:q,expiresIn:U,staffId:X,corpId:D,tenantId:G,tenantSlug:H,tenantName:W,providerUserId:h7(w?.providerUserId),provider:L},auth:{refreshTtl:300}},T=py();ML0(T,{recursive:!0,mode:448});let P=PL0(T,`${$x(V)}.json`);if(NL0(P)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${P}. Pass "overwrite": true to replace it.`);AL0(P,`${JSON.stringify(F,null,2)}
`,{mode:384}),E0({id:V,name:F.name,tenantId:G,tenantSlug:H,verified:Y,path:P})}async function sG1($,I,z={}){let q=await eG1(`${$}/api/v1/auth/me`,{...z,authorization:`Bearer ${I}`}),U=qF(q.data);return{user:qF(U.user??q.user),tenant:qF(U.tenant??q.tenant)}}async function eG1($,I={}){let z=await fetch($,{headers:I}),q=await z.text();if(!z.ok)throw Error(`${z.status} ${q}`);let U=JSON.parse(q);return qF(U)}function qF($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function h7($){return typeof $==="string"&&$?$:void 0}async function vL0($,I){let z=await lG($),q=BJ(z.sealUrl,z.token),U=await V$(q);oG(z.corpId,U.tenant);let Y=await hz(q,{note:I});E0({tenant:{id:U.tenant.id,name:U.tenant.name,tenantSlug:U.tenant.tenantSlug,corpId:z.corpId},user:{id:U.user.id,name:U.user.name,providerUserId:U.user.providerUserId,isAdmin:U.user.isAdmin},delegation:Y,expiresIn:z.expiresIn})}async function gL0($,I,z,q,U){if($==="list"){await O0("seal_delegation_list",z,q,{},W0(U.options));return}if($==="create"){let Y=B(U.options.note)??(I?[I,...U.command.slice(2)].join(" "):void 0);await O0("seal_delegation_create",z,q,{note:Y},W0(U.options));return}if($==="revoke"){let Y=I??B(U.options.tokenId);if(!Y)throw Error("Usage: seal-use delegation revoke <tokenId>");await O0("seal_delegation_revoke",z,q,{tokenId:Y},W0(U.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as $W1}from"node:fs";async function RL0($,I,z,q,U,Y){if(!$||$==="help")throw Error(`Usage: seal-use deploy <system> <action> [options]
`+`支持的审批系统与发布目标:
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
@@ -344,14 +344,14 @@ Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an a
`+` • feishu (飞书审批): 建议使用 Webhook 模式对接
`+` • weaver (泛微 OA): 建议使用 Webhook 模式对接
`+` • helios (汇联易): 建议使用 Webhook 模式对接
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let K=$==="maycur"?"每刻报销":"汇联易";throw Error(`${K}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${K}' --result-url <url> --corp <corpId>`)}let J=$==="hosecloud",Q=$==="hosecloud"?I:$,w=$==="hosecloud"?z:I;if(!J)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(Q==="requirements"){await O0("seal_deploy_hosecloud_requirements",q,U,{},W0(Y.options));return}if(Q==="list"){await O0("seal_deploy_hosecloud_list",q,U,{},W0(Y.options));return}if(Q==="get"){let K=w??j(Y.options.signKey)??j(Y.options["sign-key"]);if(!K){let G=((await P1(q)).integrations??[]).filter((W)=>W.type==="hosecloud");if(G.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let K=$==="maycur"?"每刻报销":"汇联易";throw Error(`${K}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${K}' --result-url <url> --corp <corpId>`)}let J=$==="hosecloud",Q=$==="hosecloud"?I:$,w=$==="hosecloud"?z:I;if(!J)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(Q==="requirements"){await O0("seal_deploy_hosecloud_requirements",q,U,{},W0(Y.options));return}if(Q==="list"){await O0("seal_deploy_hosecloud_list",q,U,{},W0(Y.options));return}if(Q==="get"){let K=w??B(Y.options.signKey)??B(Y.options["sign-key"]);if(!K){let G=((await P1(q)).integrations??[]).filter((W)=>W.type==="hosecloud");if(G.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${U.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${U.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let W of G){let V=W.outboundName??"SealAI 审批",X=W.signKey,L=W.apiOrigin??"production";console.error(` • "${V}" (signKey: ${X}, 环境: ${L})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${X} --corp ${U.id}
`)}throw new U$("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,G.length===1?`seal-use deploy hosecloud get ${G[0].signKey} --corp ${U.id}`:void 0)}await O0("seal_deploy_hosecloud_get",q,U,{signKey:K},W0(Y.options));return}if(Q==="status"){await O0("seal_deploy_hosecloud_status",q,U,{},W0(Y.options));return}if(Q==="configure"){let K=j(Y.options.input),H=K?JSON.parse(mG1(K,"utf8")):J$(Y.json);if(!H||Object.keys(H).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await O0("seal_deploy_hosecloud_configure",q,U,{...H,dryRun:L0(Y.options.dryRun)??L0(Y.options["dry-run"])},W0(Y.options));return}if(Q==="sync"){let K=w??j(Y.options.signKey)??j(Y.options["sign-key"]),H=L0(Y.options.auto)??L0(Y.options.yes);if(!K){let W=((await P1(q)).integrations??[]).filter((X)=>X.type==="hosecloud");if(W.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`)}throw new U$("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,G.length===1?`seal-use deploy hosecloud get ${G[0].signKey} --corp ${U.id}`:void 0)}await O0("seal_deploy_hosecloud_get",q,U,{signKey:K},W0(Y.options));return}if(Q==="status"){await O0("seal_deploy_hosecloud_status",q,U,{},W0(Y.options));return}if(Q==="configure"){let K=B(Y.options.input),H=K?JSON.parse($W1(K,"utf8")):J$(Y.json);if(!H||Object.keys(H).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await O0("seal_deploy_hosecloud_configure",q,U,{...H,dryRun:L0(Y.options.dryRun)??L0(Y.options["dry-run"])},W0(Y.options));return}if(Q==="sync"){let K=w??B(Y.options.signKey)??B(Y.options["sign-key"]),H=L0(Y.options.auto)??L0(Y.options.yes);if(!K){let W=((await P1(q)).integrations??[]).filter((X)=>X.type==="hosecloud");if(W.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${U.id}`);let V=W[0];if(V&&W.length===1&&H){let X=V.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${X})`),await O0("seal_deploy_hosecloud_sync",q,U,{signKey:X},W0(Y.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${U.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of W){let L=X.outboundName??"SealAI 审批",D=X.signKey,F=X.apiOrigin??"production";console.error(` • "${L}" (signKey: ${D}, 环境: ${F})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${D} --corp ${U.id}
`)}if(W.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${U.id}
`);throw new U$("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,W.length===1?`seal-use deploy hosecloud sync ${W[0].signKey} --corp ${U.id}`:void 0)}await O0("seal_deploy_hosecloud_sync",q,U,{signKey:K},W0(Y.options));return}throw Error(`Unknown deploy hosecloud action: ${Q??""}. Available: requirements, list, get, status, configure, sync.`)}import{accessSync as QW1,constants as wW1,existsSync as T$,readdirSync as KW1}from"node:fs";import{homedir as HW1}from"node:os";import{join as I9}from"node:path";import{existsSync as Vx,mkdirSync as SL0,rmSync as UW1,writeFileSync as YW1}from"node:fs";import{homedir as yL0}from"node:os";import{dirname as JW1,join as Zx}from"node:path";var PL0=`---
`);throw new U$("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,W.length===1?`seal-use deploy hosecloud sync ${W[0].signKey} --corp ${U.id}`:void 0)}await O0("seal_deploy_hosecloud_sync",q,U,{signKey:K},W0(Y.options));return}throw Error(`Unknown deploy hosecloud action: ${Q??""}. Available: requirements, list, get, status, configure, sync.`)}import{accessSync as XW1,constants as LW1,existsSync as T$,readdirSync as DW1}from"node:fs";import{homedir as FW1}from"node:os";import{join as I9}from"node:path";import{existsSync as Xx,mkdirSync as iL0,rmSync as WW1,writeFileSync as VW1}from"node:fs";import{homedir as pL0}from"node:os";import{dirname as ZW1,join as Lx}from"node:path";var _L0=`---
name: seal-use
description: "v0.10.18: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
metadata:
@@ -438,11 +438,11 @@ seal-use corps list
- 规则本地工作流: \`seal-use rules pull\` 导出草稿规则,\`rules lint\` 做质量检查,\`rules push --dry-run\` 预览增量更新,确认后用 \`--yes\` 写入;\`rules map\` 查询 \`corps sync-test\` 生成的跨企业规则映射。规则版本与草稿/发布 code 空间的区别详见 \`references/rule-lightweight.md\` 和 \`references/cli.md\`。
- Seal AI 智能审核发布到合思费控: \`seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>\`; read \`references/hose-enterprise-deploy.md\`.
- 审核决策偏好与思考深度: \`seal-use preference get --corp <corpId>\`, \`preference decision update --json '...' --corp <corpId>\`, \`preference thinking-depth set --default <medium|high> --corp <corpId>\`, \`preference thinking-depth policies <list|upsert|remove> --corp <corpId>\`.
- 审核大盘统计与去重分析: \`seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] --corp <corpId>\`, \`approval-runs count\`, \`analytics insight\`, 以及 \`approval-runs export\`(Excel 报表);需要追踪单据时再使用 \`url\` 或 \`bridge\`。
- 审核大盘统计与去重分析: \`seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] --corp <corpId>\`, \`approval-runs count\`, \`analytics insight|risks|performance|analyze\`, 以及 \`approval-runs export\`(Excel 报表);需要追踪单据时再使用 \`url\` 或 \`bridge\`。
- User-facing 合思 authorization link (合思/易快报授权): \`seal-use auth hose-link --corp <corpId> --expire 7200\`; read \`references/hose-enterprise-auth.md\`. Never use this route when the user says Seal 协助. Always provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) AND a hyperlink.
- Delegation links management: \`seal-use delegation list --corp <corpId>\`, \`create [--note ...] --corp <corpId>\`, \`create --from-link <url> [--note ...]\`, \`revoke <tokenId> --corp <corpId>\`.
- User & Contacts Management (用户搜索、激活与一键代生成授权): \`seal-use users search [keyword] --corp <corpId>\`, \`users delegation <userIdOrPhone> --corp <corpId>\` (仅适用于 Seal 本地创建的账号 \`provider: local\`;对合思同步账号系统拒绝重置密码,需改用 \`auth hose-link\`), \`users activate <userId> --corp <corpId>\`, \`users create --name ... --phone ... --corp <corpId>\`, \`users reset-password <userId> --corp <corpId>\`, \`users get <userId> --corp <corpId>\`, \`users delete <userId> --corp <corpId>\`.
- 只读业务数据与组织发现: \`seal-use contacts departments|children|users|sync-time --corp <corpId>\`, \`seal-use data expenses|invoices --corp <corpId>\`, \`seal-use analytics insight --corp <corpId>\`, \`seal-use context --corp <corpId>\`, \`seal-use source config --corp <corpId>\`;这些查询优先用于定位企业结构、原始费用/发票和当前审核知识,不要把结果误当成写操作。
- 只读业务数据与组织发现: \`seal-use contacts departments|children|users|sync-time --corp <corpId>\`, \`seal-use data expenses|invoices --corp <corpId>\`, \`seal-use analytics insight|risks|performance --corp <corpId>\`, \`seal-use context --corp <corpId>\`, \`seal-use source config --corp <corpId>\`;这些查询优先用于定位企业结构、原始费用/发票和当前审核知识,不要把结果误当成写操作。
- LLM Model Config & Providers: \`seal-use llm config --corp <corpId>\`, \`seal-use llm providers --corp <corpId>\`.
- System Permissions Config: \`seal-use permissions available --corp <corpId>\`, \`seal-use permissions configs --corp <corpId>\`.
- Billing & Feature Quotas: \`seal-use billing status --corp <corpId>\`, \`seal-use billing plans --corp <corpId>\`, \`seal-use billing features --corp <corpId>\`.
@@ -541,11 +541,11 @@ seal-use tool seal_approval_search --corp <corpId> --json '{"keywords":["差旅"
## Safety
Rule, document, style preference, and publish actions mutate Seal configuration. Make the target enterprise explicit, show the intended payload, and verify after the write. Never send real \`enterprises/*.json\` files, tokens, signed URLs, or full raw documents to GitHub, tickets, logs, or chat unless the user explicitly requests a safe export.
`;var TL0=`interface:
`;var CL0=`interface:
display_name: "Seal Use"
short_description: "Diagnose approval feedback and publish minimal rule fixes"
default_prompt: "Use $seal-use to resolve a customer feedback package to the correct tenant, diagnose the approval run, propose a minimal rule diff, and publish only after explicit confirmation."
`;var EL0=`# Rule Lightweight Queries
`;var hL0=`# Rule Lightweight Queries
Use this reference when the user wants rule counts, compact rule lists, one rule from a historical version, or approval knowledge search without dumping hundreds of rule descriptions.
@@ -656,7 +656,7 @@ Use current search only when the question is about current draft/current knowled
## Output Discipline
If a rule command would return many descriptions or more than about 20 rules, use \`rules count\`, \`rules list --summary\`, \`fields\`, \`snippetOnly\`, or \`--output-file\`. Use \`--full\` only for deliberate exports.
`;var BL0=`# Approval Bad Case Catalog
`;var SL0=`# Approval Bad Case Catalog
Use this file only as a comparison catalog after inspecting the current trace. Do not treat any case below as a default diagnosis.
@@ -706,7 +706,7 @@ Important nuance:
- This is a bad-case pattern, not a general rule that every amount-total dispute is caused by \`pre_analysis\`.
- Use it when the current trace shows recognized amounts being excluded downstream or duplicate attachments producing inconsistent conclusions.
`;var jL0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use <command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise the user-level `~/.config/seal-use/enterprises` directory is loaded. A configured\n `testEnterprisesDir` is loaded first for test-tenant workflows. The current working directory's\n `./enterprises` directory is not loaded implicitly.\n- Set `SEAL_USE_ENTERPRISES_DIR` to use one explicit directory instead. Legacy\n `~/.config/seal-home/enterprises` files are migrated to the primary directory when possible.\n\nEnterprise selection is stateless by default. Commands that access an enterprise require\n`--corp <corpId>` unless stateful mode is explicitly enabled:\n\n```bash\nseal-use config mode stateful --corp <corpId>\nseal-use corps switch <corpId>\nseal-use config mode stateless\n```\n\nThe global mode is stored in `~/.config/seal-use/config.json`; set `SEAL_USE_CONFIG_FILE` to\noverride that path. The legacy `current-corp` file is not read.\n\n## Stream & Exit Code Contract\n\n- **`stdout`**: Pure, deterministic JSON for machine/Agent parsing.\n- **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** with the stable prefix `👉 Next action: seal-use ...`.\n- **`Exit Code`**: `0` on success; `1` runtime/upstream failure, `2` usage/argument error, `10` explicit destructive-operation confirmation required, `11` missing/invalid authentication, and `12` output protection requiring a compact/file/query alternative.\n\n## Top-Level Commands\n\n```bash\nseal-use version\nseal-use config paths\nseal-use config get\nseal-use config mode <stateful|stateless> [--corp <corpId>]\nseal-use config test-dir [<path>|--clear]\nseal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules count [--corp <corpId>]\nseal-use rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <corpId>]\nseal-use rules clear [--corp <corpId>] [--dry-run|--yes]\nseal-use rules versions [--corp <corpId>]\nseal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]\nseal-use rules get --corp <corpId> --version <number|latest> --code '#0038'\nseal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205\nseal-use rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]\nseal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]\nseal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]\nseal-use rules map [--corp <corpId>] [--version <id|num|latest>] [--code <code>]\nseal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update [--check] [--force] [--version <v>]\nseal-use update check\nseal-use update changelog [--limit <n>]\nseal-use changelog [--limit <n>]\nseal-use mcp\nseal-use mcp config\nseal-use mcp-config\nseal-use skill dump\nseal-use skill install [--dir <path>|--local]\nseal-use skill status\nseal-use openapi\nseal-use doctor [--quiet]\nseal-use doctor guide\nseal-use doctor paths\nseal-use probe [<corpId>]\nseal-use tools list\nseal-use corps list [query] [--env <production|test>] [--strict] [--corp <corpId>]\nseal-use corps search <query> [--env <production|test>] [--strict]\nseal-use corps get <corpId>\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\nseal-use corps mark <corpId> --env <production|test> [--confirm]\nseal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]\nseal-use corps unbind-test [<corpId>] [--confirm]\nseal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]\nseal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--force]\nseal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-use corps add-seal --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]\nseal-use auth diagnose [--corp <corpId>]\nseal-use auth hose-link [--corp <corpId>] [--expire 7200]\nseal-use delegation list [--corp <corpId>]\nseal-use delegation create [--note <note>] [--from-link <url>] [--corp <corpId>]\nseal-use delegation revoke <tokenId> [--corp <corpId>]\nseal-use users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]\nseal-use users search <keyword>Line truncated
`;var yL0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use <command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise the user-level `~/.config/seal-use/enterprises` directory is loaded. A configured\n `testEnterprisesDir` is loaded first for test-tenant workflows. The current working directory's\n `./enterprises` directory is not loaded implicitly.\n- Set `SEAL_USE_ENTERPRISES_DIR` to use one explicit directory instead. Legacy\n `~/.config/seal-home/enterprises` files are migrated to the primary directory when possible.\n\nEnterprise selection is stateless by default. Commands that access an enterprise require\n`--corp <corpId>` unless stateful mode is explicitly enabled:\n\n```bash\nseal-use config mode stateful --corp <corpId>\nseal-use corps switch <corpId>\nseal-use config mode stateless\n```\n\nThe global mode is stored in `~/.config/seal-use/config.json`; set `SEAL_USE_CONFIG_FILE` to\noverride that path. The legacy `current-corp` file is not read.\n\n## Stream & Exit Code Contract\n\n- **`stdout`**: Pure, deterministic JSON for machine/Agent parsing.\n- **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** with the stable prefix `👉 Next action: seal-use ...`.\n- **`Exit Code`**: `0` on success; `1` runtime/upstream failure, `2` usage/argument error, `10` explicit destructive-operation confirmation required, `11` missing/invalid authentication, and `12` output protection requiring a compact/file/query alternative.\n\n## Top-Level Commands\n\n```bash\nseal-use version\nseal-use config paths\nseal-use config get\nseal-use config mode <stateful|stateless> [--corp <corpId>]\nseal-use config test-dir [<path>|--clear]\nseal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules count [--corp <corpId>]\nseal-use rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <corpId>]\nseal-use rules clear [--corp <corpId>] [--dry-run|--yes]\nseal-use rules versions [--corp <corpId>]\nseal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]\nseal-use rules get --corp <corpId> --version <number|latest> --code '#0038'\nseal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205\nseal-use rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]\nseal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]\nseal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]\nseal-use rules map [--corp <corpId>] [--version <id|num|latest>] [--code <code>]\nseal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update [--check] [--force] [--version <v>]\nseal-use update check\nseal-use update changelog [--limit <n>]\nseal-use changelog [--limit <n>]\nseal-use mcp\nseal-use mcp config\nseal-use mcp-config\nseal-use skill dump\nseal-use skill install [--dir <path>|--local]\nseal-use skill status\nseal-use openapi\nseal-use doctor [--quiet]\nseal-use doctor guide\nseal-use doctor paths\nseal-use probe [<corpId>]\nseal-use tools list\nseal-use corps list [query] [--env <production|test>] [--strict] [--corp <corpId>]\nseal-use corps search <query> [--env <production|test>] [--strict]\nseal-use corps get <corpId>\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\nseal-use corps mark <corpId> --env <production|test> [--confirm]\nseal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]\nseal-use corps unbind-test [<corpId>] [--confirm]\nseal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]\nseal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--force]\nseal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-use corps add-seal --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]\nseal-use auth diagnose [--corp <corpId>]\nseal-use auth hose-link [--corp <corpId>] [--expire 7200]\nseal-use delegation list [--corp <corpId>]\nseal-use delegation create [--note <note>] [--from-link <url>] [--corp <corpId>]\nseal-use delegation revoke <tokenId> [--corp <corpId>]\nseal-use users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]\nseal-use users search <keyword>Line truncated
Use this workflow when a customer disputes an AI approval finding about an attachment, invoice, receipt, OCR result, or a UI-highlighted audit result.
@@ -927,7 +927,7 @@ Manual image check:
- The customer's objection that they were receipts rather than invoices was reasonable.
However, the final rejection also had an independent rule-37 reason: payment screenshots totaled 699.48 while reimbursement was 700.00.
`;var RL0=`# Customer Feedback Rule Remediation
`;var kL0=`# Customer Feedback Rule Remediation
Use this low-freedom workflow when the user provides packaged customer feedback from WeChat, screenshots, rejection notifications, a document number, or expected business behavior and wants diagnosis or an approval-rule change.
@@ -1097,7 +1097,7 @@ Return a compact report containing:
- New version number and version name, if published
- Verification result
- Whether a regression rerun was performed
`;var _L0=`# Enterprise Onboarding
`;var fL0=`# Enterprise Onboarding
Read this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.
@@ -1231,7 +1231,7 @@ seal-use auth diagnose --corp <discovered-id> # Hose source
Report the human enterprise name, identity provider, credential method, and whether verification succeeded. Do not expose internal IDs unless they help with troubleshooting. Do not perform approval, rule, document, simulation, publishing, or other business mutations just because onboarding succeeded; continue only with the user's requested task and its normal confirmation rules.
If a temporary assistance-link or browser session expires, explain that it must be renewed or recaptured. Recommend standard Hose app credentials when the user needs durable unattended access.
`;var CL0=`# Hose Enterprise Auth
`;var nL0=`# Hose Enterprise Auth
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
@@ -1296,7 +1296,7 @@ Important:
- \`seal-use auth diagnose\` proves this stage works but redacts the token, so it is not enough when the user needs the actual clickable Hose link.
- **Formatting Requirement**: When returning a Hose authorization link to the user, ALWAYS provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) for easy copying without accidental default browser redirection, AND a clickable hyperlink.
- If the CLI later provides a dedicated command for this, prefer that command.
`;var hL0=`# Hose Enterprise Initialization & Automated Discovery
`;var bL0=`# Hose Enterprise Initialization & Automated Discovery
Use this reference for automated Hose/合思 enterprise onboarding, multi-domain probing (including dedicated private cloud domains like 美年大健康), OpenAPI role and staff discovery, and non-TUI safe administrator selection.
@@ -1402,7 +1402,7 @@ seal-use corps hose-staffs --json '{
}'
\`\`\`
* 直接使用指定 ID 完成接入并进行连通性验证。
`;var uL0={"SKILL.md":PL0,"agents/openai.yaml":TL0,"references/rule-lightweight.md":EL0,"references/approval-bad-cases.md":BL0,"references/cli.md":jL0,"references/approval-run-lightweight.md":vL0,"references/approval-attachment-trace.md":gL0,"references/customer-feedback-rule-remediation.md":RL0,"references/enterprise-onboarding.md":_L0,"references/hose-enterprise-auth.md":CL0,"references/hose-enterprise-init.md":hL0};function xL0(){return uL0["SKILL.md"]||""}function PI(){return Zx(yL0(),".agents","skills","seal-use")}function kL0(){return Zx(yL0(),".agents","skills","seal-home")}function fL0(){let $=kL0();if(Vx($))try{return UW1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function Xx($=PI()){fL0(),SL0($,{recursive:!0});let I=[];for(let[z,q]of Object.entries(uL0)){let U=Zx($,z);SL0(JW1(U),{recursive:!0}),YW1(U,q,"utf8"),I.push(z)}return{targetDir:$,files:I}}function Lx(){let $=kL0(),I=PI(),z=Vx($),q=Vx(I);if(z||q)return fL0(),Xx(I),{synced:!0,targetDir:I};return{synced:!1}}var Dx=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Fx=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],Ox=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同 Line truncated
`;var cL0={"SKILL.md":_L0,"agents/openai.yaml":CL0,"references/rule-lightweight.md":hL0,"references/approval-bad-cases.md":SL0,"references/cli.md":yL0,"references/approval-run-lightweight.md":uL0,"references/approval-attachment-trace.md":xL0,"references/customer-feedback-rule-remediation.md":kL0,"references/enterprise-onboarding.md":fL0,"references/hose-enterprise-auth.md":nL0,"references/hose-enterprise-init.md":bL0};function dL0(){return cL0["SKILL.md"]||""}function PI(){return Lx(pL0(),".agents","skills","seal-use")}function mL0(){return Lx(pL0(),".agents","skills","seal-home")}function lL0(){let $=mL0();if(Xx($))try{return WW1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function Dx($=PI()){lL0(),iL0($,{recursive:!0});let I=[];for(let[z,q]of Object.entries(cL0)){let U=Lx($,z);iL0(ZW1(U),{recursive:!0}),VW1(U,q,"utf8"),I.push(z)}return{targetDir:$,files:I}}function Fx(){let $=mL0(),I=PI(),z=Xx($),q=Xx(I);if(z||q)return lL0(),Dx(I),{synced:!0,targetDir:I};return{synced:!1}}var Ox=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Nx=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],Mx=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同 Line truncated
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
@@ -1425,14 +1425,14 @@ seal-use corps hose-staffs --json '{
| 目录名称 | 类别 | 规范路径 | 作用与生命周期 |
| :--- | :--- | :--- | :--- |
${Dx.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
${Ox.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
`)}
---
## 3. 安全与数据隐私保证
${Fx.map(($,I)=>`### 3.${I+1} ${$.topic}
${Nx.map(($,I)=>`### 3.${I+1} ${$.topic}
- **安全承诺**:${$.guarantee}
- **实现约束**:${$.enforcement}
`).join(`
@@ -1442,7 +1442,7 @@ ${Fx.map(($,I)=>`### 3.${I+1} ${$.topic}
## 4. 业务域能力图谱
${Ox.map(($)=>`### \`seal-use ${$.domain}\`
${Mx.map(($)=>`### \`seal-use ${$.domain}\`
* **能力定位**:${$.summary}
* **核心命令**:${$.primaryCommands.map((I)=>`\`seal-use ${I}\``).join("、")}
`).join(`
@@ -1455,20 +1455,20 @@ ${Ox.map(($)=>`### \`seal-use ${$.domain}\`
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
`}function bL0($){if(!T$($))return 0;try{return KW1($).filter((I)=>I.endsWith(".json")).length}catch{return 0}}function Nx($){try{return QW1($,wW1.W_OK),!0}catch{return!1}}function Mx(){let $=HW1(),I=I9($,".config","seal-use"),z=I9(I,"enterprises"),q=I9(I,"config.json"),U=I9(I,"seal_tokens.json"),Y=I9(I,"mappings"),J=PI(),Q=I9($,"Downloads"),K=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",I9($,".local","bin","seal-use"),I9($,"bin","seal-use")].find((M)=>T$(M))??process.execPath,H={configDir:{name:"配置根目录",path:I,exists:T$(I),writable:T$(I)?Nx(I):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:z,exists:T$(z),writable:T$(z)?Nx(z):!1,fileCount:bL0(z),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:q,exists:T$(q),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:U,exists:T$(U),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:Y,exists:T$(Y),fileCount:bL0(Y),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:T$(I9(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:Q,exists:T$(Q),writable:T$(Q)?Nx(Q):!1,description:"审核大盘报表默认写入目录"},globalBinary:{name:"全局命令行二进制",path:K,exists:T$(K),description:"系统全局命令执行入口"}},G=[];try{G=q$()}catch{G=[]}let V=Y4().defaultCorpId??G[0]?.id,X=G.find((M)=>M.id===V),L=G.filter((M)=>(M.environment??"production").toLowerCase()==="test").length,D=G.length-L,F=[];if(F.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),H.configDir?.exists&&H.configDir.writable)F.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${I} (正常读写)`});else if(H.configDir?.exists)F.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${I} (存在但可能不可写)`});else F.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${I},首次运行配置命令时将自动创建`});if(G.length>0)F.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${G.length} 家企业 (正式: ${D}, 测试: ${L})`});else F.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(H.agentSkillDir?.exists)F.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else F.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let T=F.some((M)=>M.status==="warn"||M.status==="error"),P=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:T?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:s0,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:P},directories:H,enterprises:{total:G.length,productionCount:D,testCount:L,activeCorpId:X?.id,activeCorpName:X?.name},checks:F,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:Dx.length,securityPoliciesCount:Fx.length,domainCapabilitiesCount:Ox.length,guideCommand:"seal-use doctor guide"}}}function iL0($){let I=[],z=$.doctor==="ok"?"✨":"⚠️";I.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${z}`),I.push("─────────────────────────────────────────────────────────────"),I.push("【运行环境】"),I.push(` 版本号: ${$.runtime.version}`),I.push(` 程序路径: ${$.runtime.executablePath}`),I.push(` 操作系统: ${$.runtime.platform}`),I.push(` 执行引擎: ${$.runtime.engine}`),I.push(""),I.push("【核心路径状态】");for(let[,q]of Object.entries($.directories)){let U=q.exists?"✓":"○",Y=q.exists?q.fileCount!==void 0?`(${q.fileCount} 个文件)`:q.writable?"(就绪/可写)":"(存在)":"(未创建)";I.push(` ${U} ${q.name.padEnd(16," ")}: ${q.path} ${Y}`)}if(I.push(""),I.push("【企业资产概览】"),I.push(` 接入企业总计: ${$.enterprises.total} 家 (生产: ${$.enterprises.productionCount}, 测试: ${$.enterprises.testCount})`),$.enterprises.activeCorpId)I.push(` 当前激活企业: ${$.enterprises.activeCorpName} (${$.enterprises.activeCorpId})`);else I.push(" 当前激活企业: 无默认企业 (无状态模式)");I.push(""),I.push("【健康自检】");for(let q of $.checks){let U=q.status==="ok"?"✓":q.status==="warn"?"⚠️":"✗";I.push(` ${U} [${q.title}]: ${q.message}`)}return I.push(""),I.push("───────── Line truncated
`)}async function pL0($,I,z){let q=($??I??"").toLowerCase();if(q==="guide"||q==="doc"||q==="knowledge"||q==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(nL0());return}if(q==="paths"||q==="dirs"||q==="directories"){let J=Mx();E0(J.directories);return}let U=Mx();if(!(L0(z.options.quiet)||L0(z.options.silent)))console.error(iL0(U));E0(U)}import{createServer as XW1}from"node:http";import{URL as WW1}from"node:url";var cL0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.18",description:`Planned HTTP contract for the seal-use wrapped backend API.
`}function rL0($){if(!T$($))return 0;try{return DW1($).filter((I)=>I.endsWith(".json")).length}catch{return 0}}function Ax($){try{return XW1($,LW1.W_OK),!0}catch{return!1}}function Px(){let $=FW1(),I=I9($,".config","seal-use"),z=I9(I,"enterprises"),q=I9(I,"config.json"),U=I9(I,"seal_tokens.json"),Y=I9(I,"mappings"),J=PI(),Q=I9($,"Downloads"),K=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",I9($,".local","bin","seal-use"),I9($,"bin","seal-use")].find((M)=>T$(M))??process.execPath,H={configDir:{name:"配置根目录",path:I,exists:T$(I),writable:T$(I)?Ax(I):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:z,exists:T$(z),writable:T$(z)?Ax(z):!1,fileCount:rL0(z),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:q,exists:T$(q),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:U,exists:T$(U),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:Y,exists:T$(Y),fileCount:rL0(Y),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:T$(I9(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:Q,exists:T$(Q),writable:T$(Q)?Ax(Q):!1,description:"审核大盘报表默认写入目录"},globalBinary:{name:"全局命令行二进制",path:K,exists:T$(K),description:"系统全局命令执行入口"}},G=[];try{G=q$()}catch{G=[]}let V=Y4().defaultCorpId??G[0]?.id,X=G.find((M)=>M.id===V),L=G.filter((M)=>(M.environment??"production").toLowerCase()==="test").length,D=G.length-L,F=[];if(F.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),H.configDir?.exists&&H.configDir.writable)F.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${I} (正常读写)`});else if(H.configDir?.exists)F.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${I} (存在但可能不可写)`});else F.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${I},首次运行配置命令时将自动创建`});if(G.length>0)F.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${G.length} 家企业 (正式: ${D}, 测试: ${L})`});else F.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(H.agentSkillDir?.exists)F.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else F.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let T=F.some((M)=>M.status==="warn"||M.status==="error"),P=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:T?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:e0,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:P},directories:H,enterprises:{total:G.length,productionCount:D,testCount:L,activeCorpId:X?.id,activeCorpName:X?.name},checks:F,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:Ox.length,securityPoliciesCount:Nx.length,domainCapabilitiesCount:Mx.length,guideCommand:"seal-use doctor guide"}}}function tL0($){let I=[],z=$.doctor==="ok"?"✨":"⚠️";I.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${z}`),I.push("─────────────────────────────────────────────────────────────"),I.push("【运行环境】"),I.push(` 版本号: ${$.runtime.version}`),I.push(` 程序路径: ${$.runtime.executablePath}`),I.push(` 操作系统: ${$.runtime.platform}`),I.push(` 执行引擎: ${$.runtime.engine}`),I.push(""),I.push("【核心路径状态】");for(let[,q]of Object.entries($.directories)){let U=q.exists?"✓":"○",Y=q.exists?q.fileCount!==void 0?`(${q.fileCount} 个文件)`:q.writable?"(就绪/可写)":"(存在)":"(未创建)";I.push(` ${U} ${q.name.padEnd(16," ")}: ${q.path} ${Y}`)}if(I.push(""),I.push("【企业资产概览】"),I.push(` 接入企业总计: ${$.enterprises.total} 家 (生产: ${$.enterprises.productionCount}, 测试: ${$.enterprises.testCount})`),$.enterprises.activeCorpId)I.push(` 当前激活企业: ${$.enterprises.activeCorpName} (${$.enterprises.activeCorpId})`);else I.push(" 当前激活企业: 无默认企业 (无状态模式)");I.push(""),I.push("【健康自检】");for(let q of $.checks){let U=q.status==="ok"?"✓":q.status==="warn"?"⚠️":"✗";I.push(` ${U} [${q.title}]: ${q.message}`)}return I.push(""),I.push("───────── Line truncated
`)}async function aL0($,I,z){let q=($??I??"").toLowerCase();if(q==="guide"||q==="doc"||q==="knowledge"||q==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(oL0());return}if(q==="paths"||q==="dirs"||q==="directories"){let J=Px();E0(J.directories);return}let U=Px();if(!(L0(z.options.quiet)||L0(z.options.silent)))console.error(tL0(U));E0(U)}import{createServer as PW1}from"node:http";import{URL as NW1}from"node:url";var sL0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.18",description:`Planned HTTP contract for the seal-use wrapped backend API.
These endpoints describe the intended stable API for frontend developers and agents once
the HTTP adapter is implemented.
They are not the raw downstream Seal endpoints. seal-use is responsible for enterprise
selection, source authentication, response compaction, and diagnostics-friendly fields.
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"2 Line truncated
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"2 Line truncated
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Seal Home API Docs (v${s0})</title>
<title>Seal Home API Docs (v${e0})</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>\uD83E\uDDAD</text></svg>" />
<style>
body {
@@ -1487,18 +1487,18 @@ selection, source authentication, response compaction, and diagnostics-friendly
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
></script>
</body>
</html>`}async function n4($,I,z,q){let U=$.handler;return U(I,z,{corp:q})}async function mL0($,I){if(I.setHeader("Access-Control-Allow-Origin","*"),I.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),I.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){I.writeHead(204),I.end();return}let z=$.headers.host||"localhost",q=$.headers["x-forwarded-proto"]||"http",U=new WW1($.url||"/",`${q}://${z}`),Y=U.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Y==="/"){t1(I,200,{name:"seal-use",version:s0,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(J==="GET"&&Y==="/docs"){ZW1(I,200,dL0());return}if(J==="GET"&&Y==="/openapi.json"){t1(I,200,qF());return}if(J==="GET"&&Y==="/health"){t1(I,200,{status:"ok",version:s0,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Y==="/shutdown"||Y==="/api/shutdown")){t1(I,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(J==="POST"&&Y==="/api/cli"){let Q=await YF($),w=(typeof Q?.command==="string"?Q.command:"").trim();if(!w){UF(I,400,"Missing 'command' property in request body");return}let K=Ax(w),H=K[0]==="seal-use"||K[0]==="seal-home"||K[0]?.endsWith("/seal-use")||K[0]?.endsWith("/seal-home")?K.slice(1):K,G=await fw(H),W=void 0;try{if(G.stdout.trim().startsWith("{")||G.stdout.trim().startsWith("["))W=JSON.parse(G.stdout)}catch{}t1(I,G.isError?400:200,{success:!G.isError,stdout:G.stdout,stderr:G.stderr,exitCode:G.exitCode,data:W});return}if(J==="POST"&&Y.startsWith("/api/tool/")){let Q=Y.slice(10).trim(),w=h4(Q);if(!w){UF(I,404,`Tool not found: '${Q}'`);return}let K=await YF($)||{},H=f6($,U,K),G=O1(H),W=await G1(G),V={...K};delete V.corp;let X=await n4(w,W,V,G);t1(I,200,X);return}if(Y.startsWith("/v1/")){if(await VW1($,I,J,Y,U))return}UF(I,404,`Cannot ${J} ${Y}. Visit /docs for available endpoints.`)}catch(Q){let w=Q instanceof Error?Q.message:String(Q);UF(I,500,w)}}async function VW1($,I,z,q,U){let Y=Object.fromEntries(U.searchParams.entries());if(z==="GET"&&q==="/v1/corps"){let J=q$(),Q=Y4();return t1(I,200,{count:J.length,mode:Q.stateful?"stateful":"stateless",defaultCorpId:Q.defaultCorpId,corps:J.map((w)=>({id:w.id,name:w.name,sourceType:w.source.type,sealUrl:w.seal?.url}))}),!0}if(z==="GET"&&q==="/v1/whoami"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_whoami"),H=await n4(K,w,{},Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/session"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_session_get"),H=await n4(K,w,{},Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/summary"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_runs_summary"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/stats"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_runs_stats"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/pick"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_run_pick"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/url"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_run_url_get"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q.startsWith("/v1/approval-runs/")){let J=q.slice(18).split("/"),Q=J[0],w=J[1];if(Q&&!["summary","pick","stats","url","bridge"].includes(Q)){let K=f6($,U,Y),H=O1(K),G=await G1(H);if(!w){let W=h4("seal_approval_run_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="attachments"){let W=h4("seal_approval_run_attachments_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="cited-rules"){let W=h4("seal_approval_run_cited_rules_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="document-summary"){let W=h4("seal_approval_run_document_summary_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="result"){let W=h4("seal_approval_run_result_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}}}if(z==="GET"&&q==="/v1/approval-runs"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_runs_search"),H=await n4(K,w,{...Y,limit:Y.limit?Number(Y.limit):void 0,offset:Y.offset?Number(Y.offset):void 0,includeBridge:Y.includeBridge==="true"},Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval/rules"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_rules_list"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/simulation/batches"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_simulation_batches_list"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="POST"&&q==="/v1/simulation/create-batch"){let J=await YF($)||{},Q=f6($,U,J),w=O1(Q),K=await G1Line truncated
\uD83D\uDE80 seal-use HTTP Server (v${s0}) started`),console.error(` URL: http://${z}:${I}`),console.error(` Docs: http://${z}:${I}/docs`),console.error(` OpenAPI: http://${z}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${z}:${I}/api/cli`),console.error(` REST API: http://${z}:${I}/v1/...
`);U(q)})})}async function lL0($){let I=k0($.options.port)??k0($.options.p),z=j($.options.host)??j($.options.h),q=await wF({port:I,host:z}),U=()=>{q.close(()=>{process.exit(0)})};process.on("SIGINT",U),process.on("SIGTERM",U),await new Promise(()=>{})}async function oL0($,I,z,q){if($==="config"||$==="get"){await O0("seal_llm_config_get",I,z,{},W0(q.options));return}if($==="providers"||$==="list"){await O0("seal_llm_providers_list",I,z,{},W0(q.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}async function rL0($,I){if($==="config"||$==="json"){Px();return}await Tx()}function Px(){E0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function tL0($){let I=qF();E0(I,{...W0($.options),allowFull:!0})}async function aL0($,I,z,q){if($==="available"){await O0("seal_permissions_available_list",I,z,{},W0(q.options));return}if($==="configs"||$==="list"){await O0("seal_permissions_configs_list",I,z,{},W0(q.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as sL0}from"node:fs";async function eL0($,I,z,q,U,Y,J){if(!$||$==="get"){await O0("seal_preference_get",U,Y,{},W0(J.options));return}if($==="decision"){if(I==="update"||!I){let Q=j(J.options.input),w=Q?JSON.parse(sL0(Q,"utf8")):J$(J.json);if(!w||Object.keys(w).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await O0("seal_preference_decision_update",U,Y,{...w,dryRun:L0(J.options.dryRun)??L0(J.options["dry-run"])},W0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let Q=j(J.options.default)??j(J.options.level)??q;if(Q!=="medium"&&Q!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await O0("seal_preference_thinking_depth_set",U,Y,{defaultLevel:Q,dryRun:L0(J.options.dryRun)??L0(J.options["dry-run"])},W0(J.options));return}if(I==="policies"){if(z==="list"||!z){await O0("seal_preference_thinking_depth_policies_list",U,Y,{},W0(J.options));return}if(z==="upsert"){let Q=j(J.options.input),w=Q?JSON.parse(sL0(Q,"utf8")):J$(J.json);if(!w||!w.id||!w.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await O0("seal_preference_thinking_depth_policies_upsert",U,Y,{...w,dryRun:L0(J.options.dryRun)??L0(J.options["dry-run"])},W0(J.options));return}if(z==="remove"||z==="delete"){let Q=q??j(J.options.id)??j(J.options.policyId);if(!Q)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await O0("seal_preference_thinking_depth_policies_remove",U,Y,{policyId:Q,dryRun:L0(J.options.dryRun)??L0(J.options["dry-run"])},W0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function $D0($={}){let I=q$(),z=Y4(),q=v7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},o5());console.log(`[probe] corp=${q.id} source=${q.source.type}`);let U=await pU(q);console.log("[probe] seal enterprise"),console.log(JSON.stringify(U,null,2));let Y=await G1(q),J=await ZW(Y,{documentLimit:20,stylePreferencesEndpoint:q.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:J.rules.rules.length,hasPendingRuleDeletes:J.rules.hasPendingDeletes,documents:J.documents.articles.length,documentsTotal:J.documents.total,stylePreferences:J.stylePreferences.ok?"ok":`error: ${J.stylePreferences.error}`},null,2))}async function ID0($,I,z){let q=I??j(z.options.corp)??($&&$!=="--corp"?$:void 0);await $D0({corpId:q})}async function Ex($,I,z,q,U){if($==="count"){await O0("seal_approval_rules_list",z,q,{countOnly:!0},W0(U.options));return}if($==="list"){if(L0(U.options.count)){await O0("seal_approval_rules_list",z,q,{countOnly:!0},W0(U.options));return}let Y=k0(U.options.limit),J=k0(U.options.offset);if(L0(U.options.summary)){await O0("seal_approval_rules_list",z,q,{fields:iZ0,limit:Y,offset:J},W0(U.options));return}let Q=await AI("seal_approval_rules_list",z,q,{limit:Y,offset:J});pZ0(Q,L0(U.options.full)===!0),E0(Q);return}if($==="clear"){let Y=L0(U.options.yes)===!0,J=L0(U.options.dryRun)??L0(U.options["dry-run"])??!Y;if(!Y&&!J)throw $5("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${q.id} --dry-run`);let Q=await AI("seal_approval_rules_clear",z,q,{dryRun:J,recode:L0(U.options.recode)});if(!Y&&J&&Q&&typeof Q==="object"){E0({...Q,nextCommand:`seal-use rules clear --corp ${q.id} --yes`},W0(U.options));return}E0(Q,W0(U.options));return}if($==="versions"){await O0("seal_approval_rule_versions_list",z,q,{},W0(U.options));return}if($==="version"){let Y=I??j(U.options.version);if(!Y)throw Error("Usage: seal-use rules version <versionId|versionNumber|l Line truncated
`).filter(Boolean),Y=U.slice(-I);return{logFile:z,lines:Y,totalLines:U.length}}async function NW1($){let I=WF($),z=vx($),q=nw($);YD0($.stateDir);let U=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):JF),Y=$.host??(process.env.HOST?process.env.HOST:QF);HF(I,`${process.pid}
`,{mode:384}),HF(z,JSON.stringify({pid:process.pid,port:U,host:Y,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),cU(q,`service starting on http://${Y}:${U} pid=${process.pid}`);let J=null;try{J=await wF({port:U,host:Y,silent:!0}),cU(q,`service listening pid=${process.pid}`)}catch(w){if(cU(q,`service failed to bind port ${U}: ${w instanceof Error?w.message:String(w)}`),GF(I)===process.pid)U5(I,{force:!0}),U5(z,{force:!0});throw w}let Q=()=>{if(J)J.close(),J=null;if(GF(I)===process.pid)U5(I,{force:!0}),U5(z,{force:!0});cU(q,`stopped pid=${process.pid}`)};await new Promise((w)=>{let K=!1,H=()=>{if(K)return;K=!0,Q(),process.off("SIGTERM",H),process.off("SIGINT",H),w()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function zD0($){YD0($.stateDir);let I=dU($);if(I.running)return I;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},q=[...z.args??[],"service","run"];if($.port)q.push("--port",String($.port));if($.host)q.push("--host",String($.host));let U=LW1(z.command,q,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=WF($);return HF(Y,`${U.pid}
`,{mode:384}),cU(nw($),`started pid=${U.pid}`),{started:!0,...dU($)}}function qD0($,I={}){let z=WF($),q=vx($),U=GF(z);if(!U||!UD0(U,$.appRoot))return U5(z,{force:!0}),U5(q,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),U5(z,{force:!0}),U5(q,{force:!0}),cU(nw($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function UD0($,I){if(!MW1($))return!1;try{let z=DW1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(z.includes(I)||z.includes("seal-use")||z.includes("src/cli.ts"))&&z.includes("service")&&z.includes("run")}catch{return!1}}function MW1($){try{return process.kill($,0),!0}catch{return!1}}function WF($){return jx($.stateDir,"service.pid")}function vx($){return jx($.stateDir,"service.json")}function nw($){return jx($.stateDir,"service.log")}function GF($){if(!KF($))return;let I=Number(Bx($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function YD0($){FW1($,{recursive:!0,mode:448})}function cU($,I){HF($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}var gx=PW1(AW1(),".config","seal-use");async function Rx($,I,z){let q=z?k0(z.options.port)??k0(z.options.p):void 0,U=z?j(z.options.host)??j(z.options.h):void 0,Y=z?k0(z.options.lines)??k0(z.options.n):void 0,J=await TI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:gx,version:s0,launcher:I.launcher,port:q,host:U},{maxLines:Y});if(J!==void 0)E0(J)}import{existsSync as TW1,readFileSync as JD0}from"node:fs";async function QD0($,I,z,q,U){if($==="batch-records"||$==="records"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation batch-records <batchId>");await O0("seal_simulation_batch_records_get",z,q,{batchId:Y,query:j(U.options.query)},W0(U.options));return}if($==="create"||$==="run"){let Y=j(U.options.mode)??j(U.options.sourceSystem)??j(U.options["source-system"])??"hosecloud",J=Y==="material-pack"?"material_pack":Y,Q=j(U.options.schemaConfig)??j(U.options["schema-config"]),w=Q?JSON.parse(JD0(Q,"utf8")):void 0,K=j(U.options.input),H=K?JSON.parse(JD0(K,"utf8")):J$(U.json),G=j(U.options.packageId)??j(U.options["package-id"]),W=V6(U.options.packageIds)??V6(U.options["package-ids"])??(G?[G]:void 0),V=V6(U.options.flowIds)??V6(U.options["flow-ids"])??V6(U.options.documentSn)??V6(U.options["document-sn"]),X=j(U.options.signKey)??j(U.options["sign-key"])??j(U.options.integration),L=L0(U.options.noWait)??L0(U.options["no-wait"]);await O0("seal_simulation_batch_create",z,q,{mode:J,sourceSystem:J,flowIds:V,documentSn:V,rejectNodeName:j(U.options.rejectNode)??j(U.options["reject-node"])??null,thinkingDepthOverride:j(U.options.thinkingDepth)??j(U.options["thinking-depth"]),skipInvoiceGeneration:L0(U.options.skipInvoiceGeneration)??L0(U.options["skip-invoice-generation"]),skipExpenseExtraction:L0(U.options.skipExpenseExtraction)??L0(U.options["skip-expense-extraction"]),disableAttachmentCache:L0(U.options.disableAttachmentCache)??L0(U.options["disable-attachment-cache"]),signKey:X,packageIds:W,packageId:G,templateId:j(U.options.templateId)??j(U.options["template-id"]),schemaConfig:w,requestIds:V6(U.options.requestIds)??V6(U.options["request-ids"]),workflowTypeId:j(U.options.workflowTypeId)??j(U.options["workflow-type-id"]),flowStatusList:V6(U.options.flowStatusList)?.map(Number)??V6(U.options["flow-status-list"])?.map(Number),businessCodes:V6(U.options.businessCodes)??V6(U.options["business-codes"]),documentType:j(U.options.documentType)??j(U.options["document-type"]),startTime:k0(U.options.startTime)??k0(U.options["start-time"]),endTime:k0(U.options.endTime)??k0(U.options["end-time"]),status:V6(U.options.status),limit:k0(U.options.limit),noWait:L,rawParams:H},W0(U.options));return}if($==="wait"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await O0("seal_simulation_batch_wait",z,q,{batchId:Y,timeout:j(U.options.timeout),pollInterval:j(U.options.pollInterval)??j(U.options["poll-interval"])},W0(U.options));return}if($==="status"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation status <batchId>");await O0("seal_simulation_batch_status",z,q,{batchId:Y},W0(U.options));return}if($==="clean"||$==="delete"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation clean <batchId>");await O0("seal_simulation_batch_clean",z,q,{batchId:Y},W0(U.options));return}if($==="specifications"){let Y=I??j(U.options.integration)??j(U.options.signKey)??j(U.options["sign-key"]);await O0("seal_simulation_specifications_list",z,q,{signKey:Y},W0(U.options));return}if($==="approval-definitions"||$==="definitions"){await O0("seal_simulation_feishu_approval_definitions_list",z,q,{},W0(U.options));return}if($==="list"){await O0("seal_simulation_batches_list",z,q,{limit:k0(U.options.limit)},W0(U.options));return}if($==="get"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation get <batchId>");await O0("seal_simulation_batch_get",z,q,{batchId:Y},W0(U.options));return}if($==="templates"){await O0("seal_simulation_templates_get",z,q,{},W0(U.options));return}if($==="integrations"){await O0("seal_simulation_integrations_get",z,q,{},W0(U.options));return}if($==="package-upload"){let Y=I??j(U.options.file);if(!Y)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!TW1(Y))throw Error(`File not found: ${Y}`);await O0("seal_simulation_material_package_upload",z,q,{filePath:Y},W0(U.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as wD0}from"node:fs";import{join as VF}from"node:path";function KD0($,I,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${xL0()}
`);return}if($==="install"||$==="init"||$==="sync"){let q=L0(z.options.local)||L0(z.options.workspace),U=j(z.options.dir)??j(z.options.target)??I,Y=U?U:q?VF(process.cwd(),".agents","skills","seal-use"):PI(),J=Xx(Y);E0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let q=PI(),U=VF(process.cwd(),".agents","skills","seal-use");E0({global:{dir:q,installed:wD0(VF(q,"SKILL.md"))},local:{dir:U,installed:wD0(VF(U,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}async function HD0($,I){if($==="config"){E0(await pU(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}async function GD0($,I,z,q){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await O0($,I,z,J$(q.json),W0(q.options))}function WD0(){E0(vw.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as EW1,mkdirSync as BW1,renameSync as _x,rmSync as jW1,unlinkSync as DD0,writeFileSync as VD0}from"node:fs";import{dirname as vW1,join as ZD0}from"node:path";import{spawnSync as EI}from"node:child_process";function ZF($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var FD0="yunyingk/seal-use",iw="yunyingk/seal-home";var gW1="SEAL_USE_GITHUB_REPO",RW1="SEAL_HOME_GITHUB_REPO";async function OD0($,I={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:gx,version:s0,launcher:$.launcher},q=I.repo||process.env[gW1]?.trim()||process.env[RW1]?.trim()||FD0,U=I.targetVersion?.trim(),Y=U&&U.toLowerCase()!=="latest"?U:void 0;if(Y){let M=Y.replace(/^v/,""),B=ND0(M,s0);if(B<0)if(!JB&&I.force);else{E0({updated:!1,currentVersion:s0,targetVersion:M,mode:ZF()?"binary":"source",message:!JB?`Cannot downgrade seal-use from dev build v${s0} to release v${M}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${s0} to older version v${M}. Updates must be forward-only.`});return}if(B===0&&!I.force){E0({updated:!1,currentVersion:s0,targetVersion:M,mode:ZF()?"binary":"source",message:`seal-use is already at version v${s0}. Use --force to reinstall.`});return}}if(I.changelogOnly){let M=await Cx(q,I.limit??10);E0({currentVersion:s0,totalQueried:M.length,releases:M.map((B)=>({version:B.version,tagName:B.tagName,publishedAt:B.publishedAt,author:B.author,releaseNotes:B.notes,releaseUrl:B.htmlUrl,isCurrent:B.version===s0,isNewer:bw(B.version,s0)}))});return}if(!ZF()){if(I.checkOnly){let B=await Cx(q,30),u=B[0],h=u?.version??s0,x=B.find((i)=>i.version===s0),g=bw(h,s0),p=B.filter((i)=>bw(i.version,s0));E0({updated:!1,updateAvailable:g,currentVersion:s0,currentVersionPublishedAt:x?.publishedAt,latestVersion:h,latestVersionPublishedAt:u?.publishedAt,behindCount:p.length,pendingReleases:p.map((i)=>({version:i.version,tagName:i.tagName,publishedAt:i.publishedAt,author:i.author,releaseNotes:i.notes,releaseUrl:i.htmlUrl})),releaseNotes:u?.notes??"",releaseUrl:u?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let M=dU(z).running;if(M)await TI("stop",z);try{LD0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(B){console.error(`git pull skipped: ${B instanceof Error?B.message:String(B)}`)}if(LD0("bun",["install"],{cwd:$.appRoot}),M)await TI("start",z);E0({updated:!0,serviceRestarted:M,version:s0,mode:"source"});return}let J=_W1(),Q=CW1(),w=await Cx(q,30),K=Y?w.find((M)=>M.version===Y||M.tagName===Y||M.tagName===`v${Y}`)??await XD0(q,Y):w[0]??await XD0(q);if(!K){E0({updated:!1,currentVersion:s0,mode:"binary",message:`Failed to query releases from repository '${q}'`});return}let H=K.version,G=w.find((M)=>M.version===s0),W=bw(H,s0),V=W||Boolean(I.force),X=w.filter((M)=>bw(M.version,s0));if(I.checkOnly){E0({updated:!1,updateAvailable:W,currentVersion:s0,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:K.publishedAt,behindCount:X.length,pendingReleases:X.map((M)=>({version:M.version,tagName:M.tagName,publishedAt:M.publishedAt,author:M.author,releaseNotes:M.notes,releaseUrl:M.htmlUrl})),releaseNotes:K.notes,releaseUrl:K.htmlUrl,mode:"binary"});return}if(!V){E0({updated:!1,currentVersion:s0,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:K.publishedAt,mode:"binary",message:`seal-use is already up to date (v${s0})`});return}let L=hW1(K.assets,J,Q);if(!L)throw Error(`No compatible binary found for ${J}-${Q} in release v${H}. Available assets: ${K.assets.map((M)=>M.name).join(", ")}`);let D=dU(z).running;if(D)await TI("stop",z);let F=process.execPath,T=vW1(F),P=ZD0(T,`.tmp-update-${Date.now()}`);BW1(P,{recursive:!0});try{let M=ZD0(P,L.name);await SW1(L.downloadUrl,M,K.tagName,L.name);let B=M;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))B=yW1 Line truncated
`)}catch{}}async function SW1($,I,z,q){let U=hx(),Y=[],J=z?z.startsWith("v")?z:`v${z}`:void 0,Q=q||$.split("/").pop()||"";if(U!=="github"){if(J&&Q)Y.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${J}/${Q}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${J}/${Q}`);if($.startsWith("https://git.ying-qing.cn"))Y.push($)}if(U!=="gitea")if(J&&Q){let L=`https://github.com/${FD0}/releases/download/${J}/${Q}`;if(!process.env.CI)Y.push(`https://ghfast.top/${L}`,`https://gh.ddlc.top/${L}`);Y.push(L)}else if($.includes("github.com")){if(!process.env.CI)Y.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Y.push($)}else Y.push($);let w=Array.from(new Set(Y)),K,H=6000,G=6000,W=307200,V=1e4,X=180000;for(let L=0;L<w.length;L++){let D=w[L],F=new AbortController,T="",P=(h)=>{T=h;try{F.abort()}catch{}},M=setTimeout(()=>{P("Connection timed out (no response headers within 6s)")},H),B,u;try{XF(`==> [${L+1}/${w.length}] Downloading via: ${D}`);let h=await fetch(D,{signal:F.signal});if(M)clearTimeout(M),M=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);B=setTimeout(()=>{P("Overall download time exceeded 3 minutes")},X);let x=Number(h.headers.get("content-length"))||0,g=h.body?.getReader();if(!g){let b=Buffer.from(await h.arrayBuffer());if(b.length<1000)throw Error(`Downloaded content is suspiciously small (${b.length} bytes)`);VD0(I,b),XF(`✓ Download succeeded (${(b.length/1024/1024).toFixed(1)} MB)`);return}let p=[],i=0,S=0;u=setTimeout(()=>{if(i<W){let b=(i/1024).toFixed(1);P(`Initial transfer too slow (${b} KB < 300 KB in 6s), switching mirror...`)}},G);while(!0){let b=g.read(),z0,v=new Promise((U0,G0)=>{z0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),n;try{n=await Promise.race([b,v])}finally{if(z0)clearTimeout(z0)}let{done:c,value:r}=n;if(c)break;if(r){if(p.push(r),i+=r.length,u&&i>=W)clearTimeout(u),u=void 0;let U0=Date.now();if(U0-S>200){S=U0;let G0=x?Math.round(i/x*100):0,A0=(i/1048576).toFixed(1),g0=x?(x/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${A0} / ${g0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let f=Buffer.concat(p);if(f.length<1000)throw Error(`Downloaded content is suspiciously small (${f.length} bytes)`);VD0(I,f),XF(`✓ Download completed successfully (${(f.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(M)clearTimeout(M);if(u)clearTimeout(u);if(B)clearTimeout(B);let x=T||(h instanceof Error?h.message:String(h));K=Error(x),XF(`
↳ Mirror failed: ${K.message}`)}finally{if(M)clearTimeout(M);if(u)clearTimeout(u);if(B)clearTimeout(B)}}throw Error(`Failed to download asset from all mirrors: ${K?.message}`)}function yW1($,I,z){let q=EI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract tar archive: ${q.stderr.toString()}`);DD0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=EI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),J=Y.find((Q)=>Q.endsWith(`/${U}`)||Q.endsWith(U));if(J)return J;return Y[0]||$}function uW1($,I,z){let q=EI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract zip archive: ${q.stderr.toString()}`);DD0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=EI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),J=Y.find((Q)=>Q.endsWith(`/${U}`)||Q.endsWith(U));if(J)return J;return Y[0]||$}function ND0($,I){let z=$.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0),q=I.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0);for(let U=0;U<Math.max(z.length,q.length);U++){let Y=z[U]??0,J=q[U]??0;if(Y>J)return 1;if(Y<J)return-1}return 0}function bw($,I){return ND0($,I)>0}function LD0($,I,z={}){let q=EI($,I,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(q.stdout)console.error(q.stdout.trimEnd());if(q.stderr)console.error(q.stderr.trimEnd());if(q.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${q.status}`)}async function MD0($,I,z,q,U){if($==="create"){let Y=j(U.options.name)??I,J=j(U.options.phone);if(!Y||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let Q=j(U.options.dept)??j(U.options.departmentId);await O0("seal_user_create",z,q,{name:Y,phone:J,departmentIds:Q?[Q]:void 0},W0(U.options));return}if($==="reset-password"){let Y=I??j(U.options.userId);if(!Y)throw Error("Usage: seal-use users reset-password <userId>");await O0("seal_user_reset_password",z,q,{userId:Y},W0(U.options));return}if($==="search"||$==="list"){let Y=I??j(U.options.keyword)??j(U.options.query)??"";await O0("seal_user_search",z,q,{keyword:Y},W0(U.options));return}if($==="get"){let Y=I??j(U.options.userId);if(!Y)throw Error("Usage: seal-use users get <userId>");await O0("seal_user_get",z,q,{userId:Y},W0(U.options));return}if($==="delete"){let Y=I??j(U.options.userId);if(!Y)throw Error("Usage: seal-use users delete <userId>");await O0("seal_user_delete",z,q,{userId:Y},W0(U.options));return}if($==="activate"){let Y=I??j(U.options.userId);if(!Y)throw Error("Usage: seal-use users activate <userId>");await O0("seal_user_activate",z,q,{userId:Y},W0(U.options));return}if($==="delegation"||$==="impersonate"){let Y=I??j(U.options.userId)??j(U.options.phone);if(!Y)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=j(U.options.note);await O0("seal_user_delegation_create",z,q,{userIdOrPhone:Y,note:J},W0(U.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var AD0=Sx(Sx(Sx(kW1(import.meta.url)))),fW1=new Set(["config","service","stop","http","serve","update","tools","corps","corp","tool","source","auth","delegation","users","contacts","data","llm","permissions","billing","webhook","webhooks","context","rules","approval-runs","analytics","simulation","deploy","preference","preferences","mcp","server","mcp-config","skill","openapi","probe","doctor","changelog"]),nW1=new Set(["http","server","web","mcp"]);function bW1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(I&&nW1.has(I))return!0;if((I==="service"||I==="daemon")&&z==="run")return!0;return!1}var PD0=Promise.resolve();function fw($,I={}){if(bW1($))return TD0($,I);let z=PD0.then(()=>TD0($,I));return PD0=z.then(()=>{return},()=>{return}),z}async function TD0($,I){let z=[],q=[],U=console.log,Y=console.error,J={appRoot:I.appRoot??AD0,entryFile:I.entryFile??xW1(I.appRoot??AD0,"src","cli.ts"),launcher:I.launcher};console.log=(...Q)=>{z.push(zx(Q))},console.error=(...Q)=>{q.push(zx(Q))};try{return await iW1($,J),{stdout:Cw(z),stderr:Cw(q),isError:!1,exitCode:0}}catch(Q){let w=hw(Q instanceof Error?Q.message:String(Q)),K=LD(Q);if(q.push(w),K.nextAction&&!w.includes("Next action:"))q.push(`\uD83D\uDC49 Next action: ${K.nextAction}`);return{stdout:Cw(z),stderr:Cw(q),isError:!0,exitCode:K.exitCode}}finally{console.log=U,console.error=Y}}async function iW1($,I){let z=CZ0($),[q,U,Y]=z.command;if(q==="version"||q==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){E0(vJ);return}let J=nZ0(z);if(J.isHelp){cZ0(J.target);return}if(!q||!fW1.has(q))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(q==="webhook"&&U==="material-pack"&&Y==="preview"){let K=z.command[3]??j(z.options.file)??j(z.options.input);if(!K)throw Error("Usage: seal-use webhook material-pack preview <材料包.zip>");await mZ0(K,_w(z.options));return}if(q==="openapi"){tL0(z);return}if(q==="mcp-config"){Px();return}if(q==="skill"){KD0(U,Y,z);return}if(q==="mcp"||q==="server"){await rL0(U,z);return}if(q==="probe"){await ID0(U,Y,z);return}if(q==="doctor"){await pL0(U,Y,z);return}if(q==="config"){IX0(U,Y,z);return}if(q==="service"){await Rx(U,I,z);return}if(q==="stop"){await Rx("stop",I,z);return}if(q==="http"||q==="serve"){await lL0(z);return}if(q==="update"||q==="changelog"){let K=q==="changelog"||U==="changelog"||U==="log"||U==="history"||L0(z.options.changelog)===!0,H=U==="check"||L0(z.options.check)===!0||L0(z.options["check-only"])===!0,G=j(z.options.version)??j(z.options.tag)??(!K&&!H&&U&&!U.startsWith("-")?U:void 0);await OD0(I,{checkOnly:H,changelogOnly:K,limit:k0(z.options.limit),force:L0(z.options.force),targetVersion:G,repo:j(z.options.re Line truncated
</html>`}async function n4($,I,z,q){let U=$.handler;return U(I,z,{corp:q})}async function $D0($,I){if(I.setHeader("Access-Control-Allow-Origin","*"),I.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),I.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){I.writeHead(204),I.end();return}let z=$.headers.host||"localhost",q=$.headers["x-forwarded-proto"]||"http",U=new NW1($.url||"/",`${q}://${z}`),Y=U.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Y==="/"){t1(I,200,{name:"seal-use",version:e0,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(J==="GET"&&Y==="/docs"){AW1(I,200,eL0());return}if(J==="GET"&&Y==="/openapi.json"){t1(I,200,UF());return}if(J==="GET"&&Y==="/health"){t1(I,200,{status:"ok",version:e0,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Y==="/shutdown"||Y==="/api/shutdown")){t1(I,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(J==="POST"&&Y==="/api/cli"){let Q=await JF($),w=(typeof Q?.command==="string"?Q.command:"").trim();if(!w){YF(I,400,"Missing 'command' property in request body");return}let K=Tx(w),H=K[0]==="seal-use"||K[0]==="seal-home"||K[0]?.endsWith("/seal-use")||K[0]?.endsWith("/seal-home")?K.slice(1):K,G=await nw(H),W=void 0;try{if(G.stdout.trim().startsWith("{")||G.stdout.trim().startsWith("["))W=JSON.parse(G.stdout)}catch{}t1(I,G.isError?400:200,{success:!G.isError,stdout:G.stdout,stderr:G.stderr,exitCode:G.exitCode,data:W});return}if(J==="POST"&&Y.startsWith("/api/tool/")){let Q=Y.slice(10).trim(),w=h4(Q);if(!w){YF(I,404,`Tool not found: '${Q}'`);return}let K=await JF($)||{},H=f6($,U,K),G=O1(H),W=await G1(G),V={...K};delete V.corp;let X=await n4(w,W,V,G);t1(I,200,X);return}if(Y.startsWith("/v1/")){if(await MW1($,I,J,Y,U))return}YF(I,404,`Cannot ${J} ${Y}. Visit /docs for available endpoints.`)}catch(Q){let w=Q instanceof Error?Q.message:String(Q);YF(I,500,w)}}async function MW1($,I,z,q,U){let Y=Object.fromEntries(U.searchParams.entries());if(z==="GET"&&q==="/v1/corps"){let J=q$(),Q=Y4();return t1(I,200,{count:J.length,mode:Q.stateful?"stateful":"stateless",defaultCorpId:Q.defaultCorpId,corps:J.map((w)=>({id:w.id,name:w.name,sourceType:w.source.type,sealUrl:w.seal?.url}))}),!0}if(z==="GET"&&q==="/v1/whoami"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_whoami"),H=await n4(K,w,{},Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/session"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_session_get"),H=await n4(K,w,{},Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/summary"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_runs_summary"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/stats"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_runs_stats"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/pick"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_run_pick"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/url"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_run_url_get"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q.startsWith("/v1/approval-runs/")){let J=q.slice(18).split("/"),Q=J[0],w=J[1];if(Q&&!["summary","pick","stats","url","bridge"].includes(Q)){let K=f6($,U,Y),H=O1(K),G=await G1(H);if(!w){let W=h4("seal_approval_run_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="attachments"){let W=h4("seal_approval_run_attachments_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="cited-rules"){let W=h4("seal_approval_run_cited_rules_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="document-summary"){let W=h4("seal_approval_run_document_summary_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="result"){let W=h4("seal_approval_run_result_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}}}if(z==="GET"&&q==="/v1/approval-runs"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_runs_search"),H=await n4(K,w,{...Y,limit:Y.limit?Number(Y.limit):void 0,offset:Y.offset?Number(Y.offset):void 0,includeBridge:Y.includeBridge==="true"},Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval/rules"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_approval_rules_list"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="GET"&&q==="/v1/simulation/batches"){let J=f6($,U,Y),Q=O1(J),w=await G1(Q),K=h4("seal_simulation_batches_list"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z==="POST"&&q==="/v1/simulation/create-batch"){let J=await JF($)||{},Q=f6($,U,J),w=O1(Q),K=await G1Line truncated
\uD83D\uDE80 seal-use HTTP Server (v${e0}) started`),console.error(` URL: http://${z}:${I}`),console.error(` Docs: http://${z}:${I}/docs`),console.error(` OpenAPI: http://${z}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${z}:${I}/api/cli`),console.error(` REST API: http://${z}:${I}/v1/...
`);U(q)})})}async function ID0($){let I=y0($.options.port)??y0($.options.p),z=B($.options.host)??B($.options.h),q=await KF({port:I,host:z}),U=()=>{q.close(()=>{process.exit(0)})};process.on("SIGINT",U),process.on("SIGTERM",U),await new Promise(()=>{})}async function zD0($,I,z,q){if($==="config"||$==="get"){await O0("seal_llm_config_get",I,z,{},W0(q.options));return}if($==="providers"||$==="list"){await O0("seal_llm_providers_list",I,z,{},W0(q.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}async function qD0($,I){if($==="config"||$==="json"){Ex();return}await Bx()}function Ex(){E0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function UD0($){let I=UF();E0(I,{...W0($.options),allowFull:!0})}async function YD0($,I,z,q){if($==="available"){await O0("seal_permissions_available_list",I,z,{},W0(q.options));return}if($==="configs"||$==="list"){await O0("seal_permissions_configs_list",I,z,{},W0(q.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as JD0}from"node:fs";async function QD0($,I,z,q,U,Y,J){if(!$||$==="get"){await O0("seal_preference_get",U,Y,{},W0(J.options));return}if($==="decision"){if(I==="update"||!I){let Q=B(J.options.input),w=Q?JSON.parse(JD0(Q,"utf8")):J$(J.json);if(!w||Object.keys(w).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await O0("seal_preference_decision_update",U,Y,{...w,dryRun:L0(J.options.dryRun)??L0(J.options["dry-run"])},W0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let Q=B(J.options.default)??B(J.options.level)??q;if(Q!=="medium"&&Q!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await O0("seal_preference_thinking_depth_set",U,Y,{defaultLevel:Q,dryRun:L0(J.options.dryRun)??L0(J.options["dry-run"])},W0(J.options));return}if(I==="policies"){if(z==="list"||!z){await O0("seal_preference_thinking_depth_policies_list",U,Y,{},W0(J.options));return}if(z==="upsert"){let Q=B(J.options.input),w=Q?JSON.parse(JD0(Q,"utf8")):J$(J.json);if(!w||!w.id||!w.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await O0("seal_preference_thinking_depth_policies_upsert",U,Y,{...w,dryRun:L0(J.options.dryRun)??L0(J.options["dry-run"])},W0(J.options));return}if(z==="remove"||z==="delete"){let Q=q??B(J.options.id)??B(J.options.policyId);if(!Q)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await O0("seal_preference_thinking_depth_policies_remove",U,Y,{policyId:Q,dryRun:L0(J.options.dryRun)??L0(J.options["dry-run"])},W0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function wD0($={}){let I=q$(),z=Y4(),q=v7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},o5());console.log(`[probe] corp=${q.id} source=${q.source.type}`);let U=await pU(q);console.log("[probe] seal enterprise"),console.log(JSON.stringify(U,null,2));let Y=await G1(q),J=await XW(Y,{documentLimit:20,stylePreferencesEndpoint:q.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:J.rules.rules.length,hasPendingRuleDeletes:J.rules.hasPendingDeletes,documents:J.documents.articles.length,documentsTotal:J.documents.total,stylePreferences:J.stylePreferences.ok?"ok":`error: ${J.stylePreferences.error}`},null,2))}async function KD0($,I,z){let q=I??B(z.options.corp)??($&&$!=="--corp"?$:void 0);await wD0({corpId:q})}async function jx($,I,z,q,U){if($==="count"){await O0("seal_approval_rules_list",z,q,{countOnly:!0},W0(U.options));return}if($==="list"){if(L0(U.options.count)){await O0("seal_approval_rules_list",z,q,{countOnly:!0},W0(U.options));return}let Y=y0(U.options.limit),J=y0(U.options.offset);if(L0(U.options.summary)){await O0("seal_approval_rules_list",z,q,{fields:tZ0,limit:Y,offset:J},W0(U.options));return}let Q=await AI("seal_approval_rules_list",z,q,{limit:Y,offset:J});aZ0(Q,L0(U.options.full)===!0),E0(Q);return}if($==="clear"){let Y=L0(U.options.yes)===!0,J=L0(U.options.dryRun)??L0(U.options["dry-run"])??!Y;if(!Y&&!J)throw $5("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${q.id} --dry-run`);let Q=await AI("seal_approval_rules_clear",z,q,{dryRun:J,recode:L0(U.options.recode)});if(!Y&&J&&Q&&typeof Q==="object"){E0({...Q,nextCommand:`seal-use rules clear --corp ${q.id} --yes`},W0(U.options));return}E0(Q,W0(U.options));return}if($==="versions"){await O0("seal_approval_rule_versions_list",z,q,{},W0(U.options));return}if($==="version"){let Y=I??B(U.options.version);if(!Y)throw Error("Usage: seal-use rules version <versionId|versionNumber|l Line truncated
`).filter(Boolean),Y=U.slice(-I);return{logFile:z,lines:Y,totalLines:U.length}}async function vW1($){let I=VF($),z=Rx($),q=bw($);VD0($.stateDir);let U=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):QF),Y=$.host??(process.env.HOST?process.env.HOST:wF);GF(I,`${process.pid}
`,{mode:384}),GF(z,JSON.stringify({pid:process.pid,port:U,host:Y,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),cU(q,`service starting on http://${Y}:${U} pid=${process.pid}`);let J=null;try{J=await KF({port:U,host:Y,silent:!0}),cU(q,`service listening pid=${process.pid}`)}catch(w){if(cU(q,`service failed to bind port ${U}: ${w instanceof Error?w.message:String(w)}`),WF(I)===process.pid)U5(I,{force:!0}),U5(z,{force:!0});throw w}let Q=()=>{if(J)J.close(),J=null;if(WF(I)===process.pid)U5(I,{force:!0}),U5(z,{force:!0});cU(q,`stopped pid=${process.pid}`)};await new Promise((w)=>{let K=!1,H=()=>{if(K)return;K=!0,Q(),process.off("SIGTERM",H),process.off("SIGINT",H),w()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function HD0($){VD0($.stateDir);let I=dU($);if(I.running)return I;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},q=[...z.args??[],"service","run"];if($.port)q.push("--port",String($.port));if($.host)q.push("--host",String($.host));let U=TW1(z.command,q,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=VF($);return GF(Y,`${U.pid}
`,{mode:384}),cU(bw($),`started pid=${U.pid}`),{started:!0,...dU($)}}function GD0($,I={}){let z=VF($),q=Rx($),U=WF(z);if(!U||!WD0(U,$.appRoot))return U5(z,{force:!0}),U5(q,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),U5(z,{force:!0}),U5(q,{force:!0}),cU(bw($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function WD0($,I){if(!gW1($))return!1;try{let z=EW1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(z.includes(I)||z.includes("seal-use")||z.includes("src/cli.ts"))&&z.includes("service")&&z.includes("run")}catch{return!1}}function gW1($){try{return process.kill($,0),!0}catch{return!1}}function VF($){return gx($.stateDir,"service.pid")}function Rx($){return gx($.stateDir,"service.json")}function bw($){return gx($.stateDir,"service.log")}function WF($){if(!HF($))return;let I=Number(vx($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function VD0($){BW1($,{recursive:!0,mode:448})}function cU($,I){GF($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}var _x=_W1(RW1(),".config","seal-use");async function Cx($,I,z){let q=z?y0(z.options.port)??y0(z.options.p):void 0,U=z?B(z.options.host)??B(z.options.h):void 0,Y=z?y0(z.options.lines)??y0(z.options.n):void 0,J=await TI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:_x,version:e0,launcher:I.launcher,port:q,host:U},{maxLines:Y});if(J!==void 0)E0(J)}import{existsSync as CW1,readFileSync as ZD0}from"node:fs";async function XD0($,I,z,q,U){if($==="batch-records"||$==="records"){let Y=I??B(U.options.batchId)??B(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation batch-records <batchId>");await O0("seal_simulation_batch_records_get",z,q,{batchId:Y,query:B(U.options.query)},W0(U.options));return}if($==="create"||$==="run"){let Y=B(U.options.mode)??B(U.options.sourceSystem)??B(U.options["source-system"])??"hosecloud",J=Y==="material-pack"?"material_pack":Y,Q=B(U.options.schemaConfig)??B(U.options["schema-config"]),w=Q?JSON.parse(ZD0(Q,"utf8")):void 0,K=B(U.options.input),H=K?JSON.parse(ZD0(K,"utf8")):J$(U.json),G=B(U.options.packageId)??B(U.options["package-id"]),W=V6(U.options.packageIds)??V6(U.options["package-ids"])??(G?[G]:void 0),V=V6(U.options.flowIds)??V6(U.options["flow-ids"])??V6(U.options.documentSn)??V6(U.options["document-sn"]),X=B(U.options.signKey)??B(U.options["sign-key"])??B(U.options.integration),L=L0(U.options.noWait)??L0(U.options["no-wait"]);await O0("seal_simulation_batch_create",z,q,{mode:J,sourceSystem:J,flowIds:V,documentSn:V,rejectNodeName:B(U.options.rejectNode)??B(U.options["reject-node"])??null,thinkingDepthOverride:B(U.options.thinkingDepth)??B(U.options["thinking-depth"]),skipInvoiceGeneration:L0(U.options.skipInvoiceGeneration)??L0(U.options["skip-invoice-generation"]),skipExpenseExtraction:L0(U.options.skipExpenseExtraction)??L0(U.options["skip-expense-extraction"]),disableAttachmentCache:L0(U.options.disableAttachmentCache)??L0(U.options["disable-attachment-cache"]),signKey:X,packageIds:W,packageId:G,templateId:B(U.options.templateId)??B(U.options["template-id"]),schemaConfig:w,requestIds:V6(U.options.requestIds)??V6(U.options["request-ids"]),workflowTypeId:B(U.options.workflowTypeId)??B(U.options["workflow-type-id"]),flowStatusList:V6(U.options.flowStatusList)?.map(Number)??V6(U.options["flow-status-list"])?.map(Number),businessCodes:V6(U.options.businessCodes)??V6(U.options["business-codes"]),documentType:B(U.options.documentType)??B(U.options["document-type"]),startTime:y0(U.options.startTime)??y0(U.options["start-time"]),endTime:y0(U.options.endTime)??y0(U.options["end-time"]),status:V6(U.options.status),limit:y0(U.options.limit),noWait:L,rawParams:H},W0(U.options));return}if($==="wait"){let Y=I??B(U.options.batchId)??B(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await O0("seal_simulation_batch_wait",z,q,{batchId:Y,timeout:B(U.options.timeout),pollInterval:B(U.options.pollInterval)??B(U.options["poll-interval"])},W0(U.options));return}if($==="status"){let Y=I??B(U.options.batchId)??B(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation status <batchId>");await O0("seal_simulation_batch_status",z,q,{batchId:Y},W0(U.options));return}if($==="clean"||$==="delete"){let Y=I??B(U.options.batchId)??B(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation clean <batchId>");await O0("seal_simulation_batch_clean",z,q,{batchId:Y},W0(U.options));return}if($==="specifications"){let Y=I??B(U.options.integration)??B(U.options.signKey)??B(U.options["sign-key"]);await O0("seal_simulation_specifications_list",z,q,{signKey:Y},W0(U.options));return}if($==="approval-definitions"||$==="definitions"){await O0("seal_simulation_feishu_approval_definitions_list",z,q,{},W0(U.options));return}if($==="list"){await O0("seal_simulation_batches_list",z,q,{limit:y0(U.options.limit)},W0(U.options));return}if($==="get"){let Y=I??B(U.options.batchId)??B(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation get <batchId>");await O0("seal_simulation_batch_get",z,q,{batchId:Y},W0(U.options));return}if($==="templates"){await O0("seal_simulation_templates_get",z,q,{},W0(U.options));return}if($==="integrations"){await O0("seal_simulation_integrations_get",z,q,{},W0(U.options));return}if($==="package-upload"){let Y=I??B(U.options.file);if(!Y)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!CW1(Y))throw Error(`File not found: ${Y}`);await O0("seal_simulation_material_package_upload",z,q,{filePath:Y},W0(U.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as LD0}from"node:fs";import{join as ZF}from"node:path";function DD0($,I,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${dL0()}
`);return}if($==="install"||$==="init"||$==="sync"){let q=L0(z.options.local)||L0(z.options.workspace),U=B(z.options.dir)??B(z.options.target)??I,Y=U?U:q?ZF(process.cwd(),".agents","skills","seal-use"):PI(),J=Dx(Y);E0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let q=PI(),U=ZF(process.cwd(),".agents","skills","seal-use");E0({global:{dir:q,installed:LD0(ZF(q,"SKILL.md"))},local:{dir:U,installed:LD0(ZF(U,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}async function FD0($,I){if($==="config"){E0(await pU(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}async function OD0($,I,z,q){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await O0($,I,z,J$(q.json),W0(q.options))}function ND0(){E0(gw.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as hW1,mkdirSync as SW1,renameSync as hx,rmSync as yW1,unlinkSync as ED0,writeFileSync as MD0}from"node:fs";import{dirname as uW1,join as AD0}from"node:path";import{spawnSync as EI}from"node:child_process";function XF($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var BD0="yunyingk/seal-use",pw="yunyingk/seal-home";var xW1="SEAL_USE_GITHUB_REPO",kW1="SEAL_HOME_GITHUB_REPO";async function jD0($,I={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:_x,version:e0,launcher:$.launcher},q=I.repo||process.env[xW1]?.trim()||process.env[kW1]?.trim()||BD0,U=I.targetVersion?.trim(),Y=U&&U.toLowerCase()!=="latest"?U:void 0;if(Y){let M=Y.replace(/^v/,""),j=vD0(M,e0);if(j<0)if(!QB&&I.force);else{E0({updated:!1,currentVersion:e0,targetVersion:M,mode:XF()?"binary":"source",message:!QB?`Cannot downgrade seal-use from dev build v${e0} to release v${M}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${e0} to older version v${M}. Updates must be forward-only.`});return}if(j===0&&!I.force){E0({updated:!1,currentVersion:e0,targetVersion:M,mode:XF()?"binary":"source",message:`seal-use is already at version v${e0}. Use --force to reinstall.`});return}}if(I.changelogOnly){let M=await Sx(q,I.limit??10);E0({currentVersion:e0,totalQueried:M.length,releases:M.map((j)=>({version:j.version,tagName:j.tagName,publishedAt:j.publishedAt,author:j.author,releaseNotes:j.notes,releaseUrl:j.htmlUrl,isCurrent:j.version===e0,isNewer:iw(j.version,e0)}))});return}if(!XF()){if(I.checkOnly){let j=await Sx(q,30),u=j[0],h=u?.version??e0,x=j.find((i)=>i.version===e0),g=iw(h,e0),p=j.filter((i)=>iw(i.version,e0));E0({updated:!1,updateAvailable:g,currentVersion:e0,currentVersionPublishedAt:x?.publishedAt,latestVersion:h,latestVersionPublishedAt:u?.publishedAt,behindCount:p.length,pendingReleases:p.map((i)=>({version:i.version,tagName:i.tagName,publishedAt:i.publishedAt,author:i.author,releaseNotes:i.notes,releaseUrl:i.htmlUrl})),releaseNotes:u?.notes??"",releaseUrl:u?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let M=dU(z).running;if(M)await TI("stop",z);try{TD0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(j){console.error(`git pull skipped: ${j instanceof Error?j.message:String(j)}`)}if(TD0("bun",["install"],{cwd:$.appRoot}),M)await TI("start",z);E0({updated:!0,serviceRestarted:M,version:e0,mode:"source"});return}let J=fW1(),Q=nW1(),w=await Sx(q,30),K=Y?w.find((M)=>M.version===Y||M.tagName===Y||M.tagName===`v${Y}`)??await PD0(q,Y):w[0]??await PD0(q);if(!K){E0({updated:!1,currentVersion:e0,mode:"binary",message:`Failed to query releases from repository '${q}'`});return}let H=K.version,G=w.find((M)=>M.version===e0),W=iw(H,e0),V=W||Boolean(I.force),X=w.filter((M)=>iw(M.version,e0));if(I.checkOnly){E0({updated:!1,updateAvailable:W,currentVersion:e0,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:K.publishedAt,behindCount:X.length,pendingReleases:X.map((M)=>({version:M.version,tagName:M.tagName,publishedAt:M.publishedAt,author:M.author,releaseNotes:M.notes,releaseUrl:M.htmlUrl})),releaseNotes:K.notes,releaseUrl:K.htmlUrl,mode:"binary"});return}if(!V){E0({updated:!1,currentVersion:e0,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:K.publishedAt,mode:"binary",message:`seal-use is already up to date (v${e0})`});return}let L=bW1(K.assets,J,Q);if(!L)throw Error(`No compatible binary found for ${J}-${Q} in release v${H}. Available assets: ${K.assets.map((M)=>M.name).join(", ")}`);let D=dU(z).running;if(D)await TI("stop",z);let F=process.execPath,T=uW1(F),P=AD0(T,`.tmp-update-${Date.now()}`);SW1(P,{recursive:!0});try{let M=AD0(P,L.name);await iW1(L.downloadUrl,M,K.tagName,L.name);let j=M;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))j=pW1 Line truncated
`)}catch{}}async function iW1($,I,z,q){let U=yx(),Y=[],J=z?z.startsWith("v")?z:`v${z}`:void 0,Q=q||$.split("/").pop()||"";if(U!=="github"){if(J&&Q)Y.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${J}/${Q}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${J}/${Q}`);if($.startsWith("https://git.ying-qing.cn"))Y.push($)}if(U!=="gitea")if(J&&Q){let L=`https://github.com/${BD0}/releases/download/${J}/${Q}`;if(!process.env.CI)Y.push(`https://ghfast.top/${L}`,`https://gh.ddlc.top/${L}`);Y.push(L)}else if($.includes("github.com")){if(!process.env.CI)Y.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Y.push($)}else Y.push($);let w=Array.from(new Set(Y)),K,H=6000,G=6000,W=307200,V=1e4,X=180000;for(let L=0;L<w.length;L++){let D=w[L],F=new AbortController,T="",P=(h)=>{T=h;try{F.abort()}catch{}},M=setTimeout(()=>{P("Connection timed out (no response headers within 6s)")},H),j,u;try{LF(`==> [${L+1}/${w.length}] Downloading via: ${D}`);let h=await fetch(D,{signal:F.signal});if(M)clearTimeout(M),M=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);j=setTimeout(()=>{P("Overall download time exceeded 3 minutes")},X);let x=Number(h.headers.get("content-length"))||0,g=h.body?.getReader();if(!g){let b=Buffer.from(await h.arrayBuffer());if(b.length<1000)throw Error(`Downloaded content is suspiciously small (${b.length} bytes)`);MD0(I,b),LF(`✓ Download succeeded (${(b.length/1024/1024).toFixed(1)} MB)`);return}let p=[],i=0,S=0;u=setTimeout(()=>{if(i<W){let b=(i/1024).toFixed(1);P(`Initial transfer too slow (${b} KB < 300 KB in 6s), switching mirror...`)}},G);while(!0){let b=g.read(),z0,v=new Promise((U0,G0)=>{z0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),n;try{n=await Promise.race([b,v])}finally{if(z0)clearTimeout(z0)}let{done:c,value:r}=n;if(c)break;if(r){if(p.push(r),i+=r.length,u&&i>=W)clearTimeout(u),u=void 0;let U0=Date.now();if(U0-S>200){S=U0;let G0=x?Math.round(i/x*100):0,A0=(i/1048576).toFixed(1),g0=x?(x/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${A0} / ${g0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let f=Buffer.concat(p);if(f.length<1000)throw Error(`Downloaded content is suspiciously small (${f.length} bytes)`);MD0(I,f),LF(`✓ Download completed successfully (${(f.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(M)clearTimeout(M);if(u)clearTimeout(u);if(j)clearTimeout(j);let x=T||(h instanceof Error?h.message:String(h));K=Error(x),LF(`
↳ Mirror failed: ${K.message}`)}finally{if(M)clearTimeout(M);if(u)clearTimeout(u);if(j)clearTimeout(j)}}throw Error(`Failed to download asset from all mirrors: ${K?.message}`)}function pW1($,I,z){let q=EI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract tar archive: ${q.stderr.toString()}`);ED0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=EI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),J=Y.find((Q)=>Q.endsWith(`/${U}`)||Q.endsWith(U));if(J)return J;return Y[0]||$}function cW1($,I,z){let q=EI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract zip archive: ${q.stderr.toString()}`);ED0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=EI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),J=Y.find((Q)=>Q.endsWith(`/${U}`)||Q.endsWith(U));if(J)return J;return Y[0]||$}function vD0($,I){let z=$.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0),q=I.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0);for(let U=0;U<Math.max(z.length,q.length);U++){let Y=z[U]??0,J=q[U]??0;if(Y>J)return 1;if(Y<J)return-1}return 0}function iw($,I){return vD0($,I)>0}function TD0($,I,z={}){let q=EI($,I,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(q.stdout)console.error(q.stdout.trimEnd());if(q.stderr)console.error(q.stderr.trimEnd());if(q.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${q.status}`)}async function gD0($,I,z,q,U){if($==="create"){let Y=B(U.options.name)??I,J=B(U.options.phone);if(!Y||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let Q=B(U.options.dept)??B(U.options.departmentId);await O0("seal_user_create",z,q,{name:Y,phone:J,departmentIds:Q?[Q]:void 0},W0(U.options));return}if($==="reset-password"){let Y=I??B(U.options.userId);if(!Y)throw Error("Usage: seal-use users reset-password <userId>");await O0("seal_user_reset_password",z,q,{userId:Y},W0(U.options));return}if($==="search"||$==="list"){let Y=I??B(U.options.keyword)??B(U.options.query)??"";await O0("seal_user_search",z,q,{keyword:Y},W0(U.options));return}if($==="get"){let Y=I??B(U.options.userId);if(!Y)throw Error("Usage: seal-use users get <userId>");await O0("seal_user_get",z,q,{userId:Y},W0(U.options));return}if($==="delete"){let Y=I??B(U.options.userId);if(!Y)throw Error("Usage: seal-use users delete <userId>");await O0("seal_user_delete",z,q,{userId:Y},W0(U.options));return}if($==="activate"){let Y=I??B(U.options.userId);if(!Y)throw Error("Usage: seal-use users activate <userId>");await O0("seal_user_activate",z,q,{userId:Y},W0(U.options));return}if($==="delegation"||$==="impersonate"){let Y=I??B(U.options.userId)??B(U.options.phone);if(!Y)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=B(U.options.note);await O0("seal_user_delegation_create",z,q,{userIdOrPhone:Y,note:J},W0(U.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var RD0=ux(ux(ux(mW1(import.meta.url)))),lW1=new Set(["config","service","stop","http","serve","update","tools","corps","corp","tool","source","auth","delegation","users","contacts","data","llm","permissions","billing","webhook","webhooks","context","rules","approval-runs","analytics","simulation","deploy","preference","preferences","mcp","server","mcp-config","skill","openapi","probe","doctor","changelog"]),oW1=new Set(["http","server","web","mcp"]);function rW1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(I&&oW1.has(I))return!0;if((I==="service"||I==="daemon")&&z==="run")return!0;return!1}var _D0=Promise.resolve();function nw($,I={}){if(rW1($))return CD0($,I);let z=_D0.then(()=>CD0($,I));return _D0=z.then(()=>{return},()=>{return}),z}async function CD0($,I){let z=[],q=[],U=console.log,Y=console.error,J={appRoot:I.appRoot??RD0,entryFile:I.entryFile??dW1(I.appRoot??RD0,"src","cli.ts"),launcher:I.launcher};console.log=(...Q)=>{z.push(Ux(Q))},console.error=(...Q)=>{q.push(Ux(Q))};try{return await tW1($,J),{stdout:hw(z),stderr:hw(q),isError:!1,exitCode:0}}catch(Q){let w=Sw(Q instanceof Error?Q.message:String(Q)),K=DD(Q);if(q.push(w),K.nextAction&&!w.includes("Next action:"))q.push(`\uD83D\uDC49 Next action: ${K.nextAction}`);return{stdout:hw(z),stderr:hw(q),isError:!0,exitCode:K.exitCode}}finally{console.log=U,console.error=Y}}async function tW1($,I){let z=nZ0($),[q,U,Y]=z.command;if(q==="version"||q==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){E0(vJ);return}let J=oZ0(z);if(J.isHelp){sZ0(J.target);return}if(!q||!lW1.has(q))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(q==="webhook"&&U==="material-pack"&&Y==="preview"){let K=z.command[3]??B(z.options.file)??B(z.options.input);if(!K)throw Error("Usage: seal-use webhook material-pack preview <材料包.zip>");await $X0(K,Cw(z.options));return}if(q==="openapi"){UD0(z);return}if(q==="mcp-config"){Ex();return}if(q==="skill"){DD0(U,Y,z);return}if(q==="mcp"||q==="server"){await qD0(U,z);return}if(q==="probe"){await KD0(U,Y,z);return}if(q==="doctor"){await aL0(U,Y,z);return}if(q==="config"){KX0(U,Y,z);return}if(q==="service"){await Cx(U,I,z);return}if(q==="stop"){await Cx("stop",I,z);return}if(q==="http"||q==="serve"){await ID0(z);return}if(q==="update"||q==="changelog"){let K=q==="changelog"||U==="changelog"||U==="log"||U==="history"||L0(z.options.changelog)===!0,H=U==="check"||L0(z.options.check)===!0||L0(z.options["check-only"])===!0,G=B(z.options.version)??B(z.options.tag)??(!K&&!H&&U&&!U.startsWith("-")?U:void 0);await jD0(I,{checkOnly:H,changelogOnly:K,limit:y0(z.options.limit),force:L0(z.options.force),targetVersion:G,repo:B(z.options.re Line truncated
`)?"":`
`}`);process.exitCode=$.exitCode}var aW1=Boolean(t.main==t.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&ED0(process.argv[1])===ED0(z9));if(aW1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await tW1();else Tx().catch(($)=>{console.error($),process.exitCode=1});export{Ax as tokenizeCommand,Tx as startServer,lW1 as resolveMcpEnabled,oW1 as createServer,dW1 as SEAL_MCP_ENABLED_ENV,cW1 as SEAL_CLI_TOOL_NAME,mW1 as LEGACY_SEAL_MCP_ENABLED_ENV};
`}`);process.exitCode=$.exitCode}var YV1=Boolean(t.main==t.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&hD0(process.argv[1])===hD0(z9));if(YV1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await UV1();else Bx().catch(($)=>{console.error($),process.exitCode=1});export{Tx as tokenizeCommand,Bx as startServer,IV1 as resolveMcpEnabled,zV1 as createServer,eW1 as SEAL_MCP_ENABLED_ENV,sW1 as SEAL_CLI_TOOL_NAME,$V1 as LEGACY_SEAL_MCP_ENABLED_ENV};
+2 -2
View File
@@ -85,11 +85,11 @@ seal-use corps list
- 规则本地工作流: `seal-use rules pull` 导出草稿规则,`rules lint` 做质量检查,`rules push --dry-run` 预览增量更新,确认后用 `--yes` 写入;`rules map` 查询 `corps sync-test` 生成的跨企业规则映射。规则版本与草稿/发布 code 空间的区别详见 `references/rule-lightweight.md` 和 `references/cli.md`。
- Seal AI 智能审核发布到合思费控: `seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>`; read `references/hose-enterprise-deploy.md`.
- 审核决策偏好与思考深度: `seal-use preference get --corp <corpId>`, `preference decision update --json '...' --corp <corpId>`, `preference thinking-depth set --default <medium|high> --corp <corpId>`, `preference thinking-depth policies <list|upsert|remove> --corp <corpId>`.
- 审核大盘统计与去重分析: `seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] --corp <corpId>`, `approval-runs count`, `analytics insight`, 以及 `approval-runs export`(Excel 报表);需要追踪单据时再使用 `url` 或 `bridge`。
- 审核大盘统计与去重分析: `seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] --corp <corpId>`, `approval-runs count`, `analytics insight|risks|performance|analyze`, 以及 `approval-runs export`(Excel 报表);需要追踪单据时再使用 `url` 或 `bridge`。
- User-facing 合思 authorization link (合思/易快报授权): `seal-use auth hose-link --corp <corpId> --expire 7200`; read `references/hose-enterprise-auth.md`. Never use this route when the user says Seal 协助. Always provide BOTH a code block (` ```text ... ``` `) AND a hyperlink.
- Delegation links management: `seal-use delegation list --corp <corpId>`, `create [--note ...] --corp <corpId>`, `create --from-link <url> [--note ...]`, `revoke <tokenId> --corp <corpId>`.
- User & Contacts Management (用户搜索、激活与一键代生成授权): `seal-use users search [keyword] --corp <corpId>`, `users delegation <userIdOrPhone> --corp <corpId>` (仅适用于 Seal 本地创建的账号 `provider: local`;对合思同步账号系统拒绝重置密码,需改用 `auth hose-link`), `users activate <userId> --corp <corpId>`, `users create --name ... --phone ... --corp <corpId>`, `users reset-password <userId> --corp <corpId>`, `users get <userId> --corp <corpId>`, `users delete <userId> --corp <corpId>`.
- 只读业务数据与组织发现: `seal-use contacts departments|children|users|sync-time --corp <corpId>`, `seal-use data expenses|invoices --corp <corpId>`, `seal-use analytics insight --corp <corpId>`, `seal-use context --corp <corpId>`, `seal-use source config --corp <corpId>`;这些查询优先用于定位企业结构、原始费用/发票和当前审核知识,不要把结果误当成写操作。
- 只读业务数据与组织发现: `seal-use contacts departments|children|users|sync-time --corp <corpId>`, `seal-use data expenses|invoices --corp <corpId>`, `seal-use analytics insight|risks|performance --corp <corpId>`, `seal-use context --corp <corpId>`, `seal-use source config --corp <corpId>`;这些查询优先用于定位企业结构、原始费用/发票和当前审核知识,不要把结果误当成写操作。
- LLM Model Config & Providers: `seal-use llm config --corp <corpId>`, `seal-use llm providers --corp <corpId>`.
- System Permissions Config: `seal-use permissions available --corp <corpId>`, `seal-use permissions configs --corp <corpId>`.
- Billing & Feature Quotas: `seal-use billing status --corp <corpId>`, `seal-use billing plans --corp <corpId>`, `seal-use billing features --corp <corpId>`.
+6
View File
@@ -138,6 +138,9 @@ seal-use tool <toolName> [--corp <corpId>] [--json '{"key":"value"}']
seal-use approval-runs summary --corp <corpId> [--date YYYY-MM-DD] [--timezone Asia/Shanghai]
seal-use approval-runs stats --corp <corpId> [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id]
seal-use analytics insight --corp <corpId> [--start-date <ISO>] [--end-date <ISO>] [--limit <n>]
seal-use analytics risks <tagId> --corp <corpId> [--start-date <ISO>] [--end-date <ISO>]
seal-use analytics performance --corp <corpId> [--start-date <ISO|ms>] [--end-date <ISO|ms>]
seal-use analytics analyze <recordId> --corp <corpId>
seal-use approval-runs count --corp <corpId> [--status APPROVED]
seal-use approval-runs export --corp <corpId> [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--limit <n>] [--downloads] [--out <file>]
seal-use approval-runs search --corp <corpId> [--query text] [--limit 20] [--includeBridge true]
@@ -201,6 +204,9 @@ Read-only discovery:
- `seal-use contacts departments|children|users|sync-time --corp <corpId>` queries the tenant's organization tree and last directory sync time.
- `seal-use data expenses|invoices --corp <corpId> [--search <text>] [--start-date <ISO|ms>] [--end-date <ISO|ms>] [--offset <n>] [--limit <n>]` queries paginated raw expense or invoice records.
- `seal-use analytics insight --corp <corpId> [--start-date <ISO>] [--end-date <ISO>] [--limit <n>]` queries risk-tag statistics; omitted dates use the current month.
- `seal-use analytics risks <tagId> --corp <corpId> [--start-date <ISO>] [--end-date <ISO>]` queries detailed risks and cited documents under a specific risk tag.
- `seal-use analytics performance --corp <corpId> [--start-date <ISO|ms>] [--end-date <ISO|ms>]` queries approval performance metrics and Sankey decision flow.
- `seal-use analytics analyze <recordId> --corp <corpId>` triggers on-demand smart insight risk analysis for an approval record.
- `seal-use context --corp <corpId> [--ruleVersion <versionId|versionNumber|latest>] [--documentLimit 50]` aggregates rules, knowledge documents, and style preferences.
- `seal-use source config --corp <corpId>` resolves the live source-system configuration without changing it.
+51
View File
@@ -7,6 +7,7 @@ import type { ParsedArgs } from "../types.js";
export async function handleAnalyticsCommand(
action: string | undefined,
maybeName: string | undefined,
client: Awaited<ReturnType<typeof createSealClient>>,
corp: CorpConfig,
args: ParsedArgs
@@ -26,5 +27,55 @@ export async function handleAnalyticsCommand(
return;
}
if (action === "risks" || action === "risks-by-tag" || action === "tag-risks") {
const tagId = maybeName ?? stringOption(args.options.tagId) ?? stringOption(args.options["tag-id"]);
if (!tagId) {
throw new Error("Usage: seal-use analytics risks <tagId> [--start-date <ISO>] [--end-date <ISO>] [--corp <corpId>]");
}
await runTool(
"seal_insight_risks_by_tag_get",
client,
corp,
{
tagId,
startDate: stringOption(args.options.startDate) ?? stringOption(args.options["start-date"]),
endDate: stringOption(args.options.endDate) ?? stringOption(args.options["end-date"])
},
outputOptions(args.options)
);
return;
}
if (action === "performance" || action === "perf") {
await runTool(
"seal_insight_performance_get",
client,
corp,
{
startDate: stringOption(args.options.startDate) ?? stringOption(args.options["start-date"]) ?? numberOption(args.options.startDate) ?? numberOption(args.options["start-date"]),
endDate: stringOption(args.options.endDate) ?? stringOption(args.options["end-date"]) ?? numberOption(args.options.endDate) ?? numberOption(args.options["end-date"])
},
outputOptions(args.options)
);
return;
}
if (action === "analyze" || action === "reanalyze") {
const recordId = maybeName ?? stringOption(args.options.recordId) ?? stringOption(args.options["record-id"]);
if (!recordId) {
throw new Error("Usage: seal-use analytics analyze <recordId> [--corp <corpId>]");
}
await runTool(
"seal_insight_record_analyze",
client,
corp,
{
recordId
},
outputOptions(args.options)
);
return;
}
throw new Error(`Unknown analytics command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+20 -1
View File
@@ -752,8 +752,27 @@ export const HELP_REGISTRY: AreaHelp[] = [
commands: [
{
name: "insight",
summary: "Query AI audit insights and trends",
aliases: ["insight-stats", "stats"],
summary: "Query AI audit insights risk-tag statistics and analysis status",
usage: ["seal-use analytics insight [--start-date <ISO>] [--end-date <ISO>] [--limit <n>] [--corp <corpId>]"]
},
{
name: "risks",
aliases: ["risks-by-tag", "tag-risks"],
summary: "Query detailed risks and document citations under a specific risk tag",
usage: ["seal-use analytics risks <tagId> [--start-date <ISO>] [--end-date <ISO>] [--corp <corpId>]"]
},
{
name: "performance",
aliases: ["perf"],
summary: "Query audit performance metrics (accuracy, automation rate) and Sankey flow",
usage: ["seal-use analytics performance [--start-date <ISO|ms>] [--end-date <ISO|ms>] [--corp <corpId>]"]
},
{
name: "analyze",
aliases: ["reanalyze"],
summary: "Trigger on-demand smart insight risk analysis for an approval record",
usage: ["seal-use analytics analyze <recordId> [--corp <corpId>]"]
}
]
},
+1 -1
View File
@@ -379,7 +379,7 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
}
if (area === "analytics") {
await handleAnalyticsCommand(action, client, corp, args);
await handleAnalyticsCommand(action, maybeName, client, corp, args);
return;
}
+105
View File
@@ -12,6 +12,9 @@ import {
getDepartment,
getContactsLastSyncTime,
getInsightStats,
getInsightRisksByTag,
getInsightPerformance,
analyzeInsightRecord,
listExpenses,
listInvoices,
listFeishuSimulationApprovalDefinitions,
@@ -139,6 +142,108 @@ describe("Seal contact API", () => {
);
});
test("forwards risks-by-tag parameters and parses response", async () => {
let requestedUrl = "";
const client = {
get: (url: string, options?: { searchParams?: URLSearchParams }) => {
requestedUrl = `${url}?${options?.searchParams?.toString() ?? ""}`;
return {
json: async () => ({
data: {
tagId: "B.1.6",
tagName: "缺少验收/签收证明",
tagPath: "凭证/附件问题 > 凭证缺失 > 缺少验收/签收证明",
tagDescription: "维修费等未提供验收单",
risks: [
{
riskId: "risk-01",
recordId: "rec-01",
riskDetails: "冰箱无验收单",
riskLevel: "warning",
documentType: "费用报销",
documentSN: "B26000011",
sourceSystem: "custom",
confidence: 0.95,
reasoning: "缺少签收",
createdAt: "2026-09-11T07:31:43.647Z"
}
],
total: 1
}
})
};
}
} as unknown as KyInstance;
const result = await getInsightRisksByTag(client, {
tagId: "B.1.6",
startDate: "2026-09-01T00:00:00Z",
endDate: "2026-09-30T23:59:59Z"
});
expect(result.tagId).toBe("B.1.6");
expect(result.risks.length).toBe(1);
expect(result.risks[0]?.documentSN).toBe("B26000011");
expect(requestedUrl).toBe(
"api/v1/insight/risks-by-tag?tagId=B.1.6&startDate=2026-09-01T00%3A00%3A00Z&endDate=2026-09-30T23%3A59%3A59Z"
);
});
test("normalizes performance date parameters to numeric timestamps", async () => {
let requestedUrl = "";
const client = {
get: (url: string, options?: { searchParams?: URLSearchParams }) => {
requestedUrl = `${url}?${options?.searchParams?.toString() ?? ""}`;
return {
json: async () => ({
data: {
metrics: {
approvalCount: { value: 24, trend: 0 },
accuracy: { value: 100, trend: 0 },
automationRate: { value: 75, trend: 0 },
riskCount: { value: 54, trend: 0 },
avgDuration: { value: 1041.4, trend: 0 }
},
sankeyData: {
nodes: [{ id: "辅助模式" }],
links: [{ source: "辅助模式", target: "添加评论", value: 24 }]
}
}
})
};
}
} as unknown as KyInstance;
const result = await getInsightPerformance(client, {
startDate: "2026-09-01T00:00:00.000Z",
endDate: "2026-09-30T23:59:59.000Z"
});
expect(result.metrics.approvalCount?.value).toBe(24);
expect(result.sankeyData.nodes[0]?.id).toBe("辅助模式");
const startTs = new Date("2026-09-01T00:00:00.000Z").getTime();
const endTs = new Date("2026-09-30T23:59:59.000Z").getTime();
expect(requestedUrl).toBe(
`api/v1/insight/performance?startDate=${startTs}&endDate=${endTs}`
);
});
test("posts to analyze insight record", async () => {
let postedUrl = "";
const client = {
post: async (url: string) => {
postedUrl = url;
return {
json: async () => ({ data: null })
};
}
} as unknown as KyInstance;
const result = await analyzeInsightRecord(client, "rec-test-123");
expect(result).toEqual({ success: true, recordId: "rec-test-123" });
expect(postedUrl).toBe("api/v1/insight/analyze/rec-test-123");
});
test("uses the frontend filter parameter names for expenses and invoices", async () => {
const requestedUrls: string[] = [];
const client = {
+61
View File
@@ -51,6 +51,10 @@ import {
SealContactsLastSyncTimeSchema,
InsightStats,
InsightStatsSchema,
InsightRisksByTag,
InsightRisksByTagSchema,
InsightPerformance,
InsightPerformanceSchema,
ExpenseListData,
ExpenseListDataSchema,
InvoiceListData,
@@ -1007,6 +1011,63 @@ export async function getInsightStats(
);
}
export async function getInsightRisksByTag(
client: KyInstance,
params: { tagId: string; startDate?: string; endDate?: string }
): Promise<InsightRisksByTag> {
const defaultRange = currentMonthDateRange();
const searchParams = new URLSearchParams();
searchParams.set("tagId", params.tagId);
searchParams.set("startDate", params.startDate ?? defaultRange.startDate);
searchParams.set("endDate", params.endDate ?? defaultRange.endDate);
return unwrap(
await client.get("api/v1/insight/risks-by-tag", { searchParams }),
InsightRisksByTagSchema
);
}
export async function getInsightPerformance(
client: KyInstance,
params: { startDate?: string | number; endDate?: string | number } = {}
): Promise<InsightPerformance> {
const defaultRange = currentMonthDateRange();
const startTs = normalizeToTimestamp(params.startDate ?? defaultRange.startDate);
const endTs = normalizeToTimestamp(params.endDate ?? defaultRange.endDate);
const searchParams = new URLSearchParams();
searchParams.set("startDate", String(startTs));
searchParams.set("endDate", String(endTs));
return unwrap(
await client.get("api/v1/insight/performance", { searchParams }),
InsightPerformanceSchema
);
}
export async function analyzeInsightRecord(
client: KyInstance,
recordId: string
): Promise<{ success: boolean; recordId: string }> {
await client.post(`api/v1/insight/analyze/${encodeURIComponent(recordId)}`);
return { success: true, recordId };
}
function normalizeToTimestamp(value: string | number): number {
if (typeof value === "number") {
return value < 1e11 ? value * 1000 : value;
}
const parsed = Number(value);
if (!isNaN(parsed) && value.trim() !== "") {
return parsed < 1e11 ? parsed * 1000 : parsed;
}
const date = new Date(value);
if (isNaN(date.getTime())) {
throw new Error(`Invalid date format: ${value}`);
}
return date.getTime();
}
function currentMonthDateRange(): { startDate: string; endDate: string } {
const now = new Date();
const start = new Date(now.getFullYear(), now.getMonth(), 1);
+4 -1
View File
@@ -92,8 +92,11 @@ describe("sealTools", () => {
expect(sealTools.find((item) => item.name === "seal_contacts_last_sync_time_get")).toBeDefined();
});
test("includes the read-only insight stats tool", () => {
test("includes the read-only insight stats and analytics tools", () => {
expect(sealTools.find((item) => item.name === "seal_insight_stats_get")).toBeDefined();
expect(sealTools.find((item) => item.name === "seal_insight_risks_by_tag_get")).toBeDefined();
expect(sealTools.find((item) => item.name === "seal_insight_performance_get")).toBeDefined();
expect(sealTools.find((item) => item.name === "seal_insight_record_analyze")).toBeDefined();
});
test("includes read-only financial data tools", () => {
+36
View File
@@ -219,6 +219,42 @@ export const sealTools = [
params: { startDate?: string; endDate?: string; limit?: number }
) => api.getInsightStats(client, params)
},
{
name: "seal_insight_risks_by_tag_get",
description: "按风险标签查询智能洞察风险单据明细及 AI 分析依据",
parameters: z.object({
tagId: z.string().describe("风险标签 ID(如 B.1.1、B.1.6)"),
startDate: z.string().optional().describe("统计开始时间(ISO 8601)"),
endDate: z.string().optional().describe("统计结束时间(ISO 8601)")
}),
handler: async (
client: KyInstance,
params: { tagId: string; startDate?: string; endDate?: string }
) => api.getInsightRisksByTag(client, params)
},
{
name: "seal_insight_performance_get",
description: "查询智能洞察审核效能指标(自动化率、准确率等)及决策流向桑基图",
parameters: z.object({
startDate: z.union([z.string(), z.number()]).optional().describe("统计开始时间(ISO 8601 或毫秒时间戳)"),
endDate: z.union([z.string(), z.number()]).optional().describe("统计结束时间(ISO 8601 或毫秒时间戳)")
}),
handler: async (
client: KyInstance,
params: { startDate?: string | number; endDate?: string | number }
) => api.getInsightPerformance(client, params)
},
{
name: "seal_insight_record_analyze",
description: "对指定的审批单运行记录按需触发智能洞察风险分析",
parameters: z.object({
recordId: z.string().describe("审批单运行记录 ID (recordId)")
}),
handler: async (
client: KyInstance,
params: { recordId: string }
) => api.analyzeInsightRecord(client, params.recordId)
},
{
name: "seal_expenses_list",
description: "分页查询费用明细",
+60 -1
View File
@@ -314,7 +314,15 @@ export const SealContactsLastSyncTimeSchema = z.object({
lastSyncTime: z.union([z.string(), z.number(), z.null()])
}).passthrough();
export const InsightTagStatsSchema = z.record(z.string(), z.unknown());
export const InsightTagStatsSchema = z.object({
tagId: z.string().optional(),
tagName: z.string().optional(),
tagPath: z.string().optional(),
count: z.number().default(0),
avgConfidence: z.number().default(0),
errorCount: z.number().default(0),
warningCount: z.number().default(0)
}).passthrough();
export const InsightStatsSchema = z.object({
tagStats: z.array(InsightTagStatsSchema).default([]),
@@ -323,6 +331,52 @@ export const InsightStatsSchema = z.object({
pendingRisks: z.number().default(0)
}).passthrough();
export const InsightRiskItemSchema = z.object({
riskId: z.string().optional(),
recordId: z.string().optional(),
riskDetails: z.string().default(""),
riskLevel: z.string().default("warning"),
documentType: z.string().default(""),
documentSN: z.string().default(""),
sourceSystem: z.string().default(""),
sourceDocumentURL: z.string().nullable().optional(),
confidence: z.number().default(0),
reasoning: z.string().default(""),
createdAt: z.union([z.string(), z.number(), z.date()]).optional()
}).passthrough();
export const InsightRisksByTagSchema = z.object({
tagId: z.string(),
tagName: z.string().default(""),
tagPath: z.string().default(""),
tagDescription: z.string().default(""),
risks: z.array(InsightRiskItemSchema).default([]),
total: z.number().default(0)
}).passthrough();
export const InsightPerformanceMetricSchema = z.object({
value: z.number().default(0),
trend: z.number().default(0)
}).passthrough();
export const InsightPerformanceSchema = z.object({
metrics: z.object({
approvalCount: InsightPerformanceMetricSchema.optional(),
accuracy: InsightPerformanceMetricSchema.optional(),
automationRate: InsightPerformanceMetricSchema.optional(),
riskCount: InsightPerformanceMetricSchema.optional(),
avgDuration: InsightPerformanceMetricSchema.optional()
}).passthrough().default({}),
sankeyData: z.object({
nodes: z.array(z.object({ id: z.string() }).passthrough()).default([]),
links: z.array(z.object({
source: z.string(),
target: z.string(),
value: z.number().default(0)
}).passthrough()).default([])
}).passthrough().default({ nodes: [], links: [] })
}).passthrough();
const DataRecordSchema = z.record(z.string(), z.unknown());
export const ExpenseListDataSchema = z.object({
@@ -593,7 +647,12 @@ export type SealDepartment = z.infer<typeof SealDepartmentSchema>;
export type SealDepartmentListData = z.infer<typeof SealDepartmentListDataSchema>;
export type SealDepartmentUsersData = z.infer<typeof SealDepartmentUsersDataSchema>;
export type SealContactsLastSyncTime = z.infer<typeof SealContactsLastSyncTimeSchema>;
export type InsightTagStats = z.infer<typeof InsightTagStatsSchema>;
export type InsightStats = z.infer<typeof InsightStatsSchema>;
export type InsightRiskItem = z.infer<typeof InsightRiskItemSchema>;
export type InsightRisksByTag = z.infer<typeof InsightRisksByTagSchema>;
export type InsightPerformanceMetric = z.infer<typeof InsightPerformanceMetricSchema>;
export type InsightPerformance = z.infer<typeof InsightPerformanceSchema>;
export type ExpenseListData = z.infer<typeof ExpenseListDataSchema>;
export type InvoiceListData = z.infer<typeof InvoiceListDataSchema>;
export type SimulationApprovalDefinition = z.infer<typeof SimulationApprovalDefinitionSchema>;