Compare commits

..
9 Commits
Author SHA1 Message Date
yunyingk d525087b97 Merge pull request #36 from yunyingk/codex/release-v0.10.8
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🚀 Release / 🚀 Build & Publish GitHub Release (push) Has been cancelled
🚀 Release / 📦 Sync Gitea Mirror (push) Has been cancelled
Release v0.10.8: Approval run attachments extraction and download command
2026-09-04 18:50:05 +08:00
gitea c5381e2c66 Release v0.10.8: Approval run attachments extraction and download command 2026-09-04 18:48:40 +08:00
gitea e9b66f787b Add approval-runs attachments download and Hose format extraction 2026-09-04 18:48:03 +08:00
yunyingk f64f2b8385 Merge pull request #34 from yunyingk/codex/release-v0.10.7
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🚀 Release / 🚀 Build & Publish GitHub Release (push) Has been cancelled
🚀 Release / 📦 Sync Gitea Mirror (push) Has been cancelled
Release v0.10.7: Local rules workspace, daemon HTTP server, and global stop
2026-09-04 18:09:49 +08:00
gitea cba3098654 docs: document global stop command and shutdown route in changelog 2026-09-04 18:08:13 +08:00
gitea f9b8b06647 Add global seal-use stop command and shutdown HTTP route 2026-09-04 17:58:30 +08:00
gitea 37580dac44 Release v0.10.7: Local rules workspace and daemon HTTP server 2026-09-04 17:54:47 +08:00
gitea f183cc8294 Add persistent HTTP server to background service daemon 2026-09-04 17:53:40 +08:00
gitea 13ed555bbb Add local approval rules workspace and offline linting 2026-09-04 17:45:46 +08:00
25 changed files with 1896 additions and 274 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "seal-use",
"version": "0.10.6",
"version": "0.10.8",
"description": "Seal Use tenant operations: approval-run diagnosis, minimal rule remediation, delegation links, Hose/合思 authorization, users, rules, billing, and search.",
"author": {
"name": "yingqing"
+27
View File
@@ -5,6 +5,33 @@ All notable changes to `seal-use` will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.10.8] - 2026-09-04
### Added & Enhanced
- **Approval Run Attachments Extraction Compatibility (Issue #35)**:
- Generalized `extractApprovalRunAttachments` to inspect `document.fields[].type === "ATTACHMENT"` arrays with nested `value[]` collections, properly recognizing HoseCloud/Seal 2026 flattened attachment fields that previously resolved to `count: 0`.
- Extracted comprehensive metadata including `ossSignedUrl`, `token` (automatically parsing embedded `fileId` and object `key`), `ossFileSize`, `mimeType`, and preserved parent field labels as `sourceField`.
- Added `hasSignedUrl` and `ossFileSize` to compact summary outputs without exposing raw signed URLs.
- **New Attachments Download Command (Issue #35)**:
- Added `seal-use approval-runs attachments download <recordId> [--name <pattern>] [--all] [--out-dir <path>]` and the corresponding tool `seal_approval_run_attachments_download` (aliased as `runs.attachments.download`).
- Prioritizes direct `ossSignedUrl` links from the run record and verifies downloaded file size against `ossFileSize`.
- Automatically sanitizes sensitive temporary signatures in CLI logging (`?[MASKED]`) to prevent credential leakage in build/agent transcripts.
- Implemented graceful error recovery for expired temporary URLs (HTTP 403) or missing links, reporting diagnostics for failed items while allowing valid attachments to complete without interruption.
## [0.10.7] - 2026-09-04
### Added & Enhanced
- **Local Approval Rules Workspace & Offline Linting**:
- Added `seal-use rules pull` (`seal_approval_rules_pull`) to export remote draft or published version rules to a local JSON file (defaults to `./rules.local.json`), eliminating unwanted mutations to remote drafts.
- Added `seal-use rules lint --file <path>` to execute rule quality and execution checks completely offline with zero network requests and zero dirty version records in the remote backend. Supports quality score gates (`--min-score`) and operates seamlessly even without configured enterprise credentials.
- Added `seal-use rules push` (`seal_approval_rules_push`) to apply refined local rules to the remote draft with preview (`--dry-run`), confirmation (`--yes`), and optional single-step formal release publishing (`--publish`).
- **Persistent HTTP Companion Daemon in Background Service**:
- Embedded the HTTP API server into `seal-use service run`, allowing `seal-use service start` to run as a detached background daemon with persistent HTTP service (serving `/docs`, `/openapi.json`, and `POST /api/cli`).
- Added `seal-use service logs` (`--lines <N>`) to easily inspect service background activity.
- Enhanced `seal-use service status` to track active host, port, and URL via daemon metadata state.
- Optimized `parseJsonBody` and CLI runner concurrency with standing command bypasses to prevent process queue blocks.
- Added top-level `seal-use stop` command, intuitive service aliases (`seal-use service kill|down|shutdown`), and `POST /shutdown` HTTP endpoint to gracefully terminate the background daemon from any terminal or script.
## [0.10.6] - 2026-09-03
### Added & Enhanced
+1
View File
@@ -276,6 +276,7 @@ These tools remain available to the CLI:
- `seal_approval_run_cited_rules_get`: extract rules cited or matched by the AI result, including runtime ID/code, version, scope, strictness, analysis, result, and findings when present.
- `seal_approval_run_document_summary_get`: return key document fields, invoice/attachment summary, AI result, and manual result.
- `seal_approval_run_attachments_get`: return attachment and invoice file metadata for one run without the full document or rule result; use `summary:true` for the smallest list.
- `seal_approval_run_attachments_download`: download attachments from an approval run to local disk; supports `--all`, `--name`, and `--out-dir`, prioritizes `ossSignedUrl`, validates `ossFileSize`, and masks credentials in logs.
- `seal_approval_run_result_get`: return one run result, with `{"summary":true}` for decision, summary, risk point count, matched rule count, trace ID, and record ID only.
- `seal_approval_run_url_get`: return the Hose enterprise assist URL, optionally with the original document URL for an approval run by `recordId`, `sourceDocumentSN`, or `sourceDocumentId`.
- `seal_simulation_batch_records_get`: read records from one simulation batch via `api/v1/simulation/batch/{batchId}/records`.
+125 -122
View File
@@ -1,95 +1,95 @@
import{createRequire as $D0}from"node:module";var dX0=Object.create;var{getPrototypeOf:lX0,defineProperty:PO,getOwnPropertyNames:mX0}=Object;var oX0=Object.prototype.hasOwnProperty;function rX0($){return this[$]}var tX0,aX0,BY=($,I,q)=>{var U=$!=null&&typeof $==="object";if(U){var Y=I?tX0??=new WeakMap:aX0??=new WeakMap,J=Y.get($);if(J)return J}q=$!=null?dX0(lX0($)):{};let Q=I||!$||!$.__esModule?PO(q,"default",{value:$,enumerable:!0}):q;for(let K of mX0($))if(!oX0.call(Q,K))PO(Q,K,{get:rX0.bind($,K),enumerable:!0});if(U)Y.set($,Q);return Q};var L=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var sX0=($)=>$;function eX0($,I){this[$]=sX0.bind(null,I)}var p8=($,I)=>{for(var q in I)PO($,q,{get:I[q],enumerable:!0,configurable:!0,set:eX0.bind(I,q)})};var o=$D0(import.meta.url);var EJ=L((Ef)=>{Object.defineProperty(Ef,"__esModule",{value:!0});Ef.regexpCode=Ef.getEsmExportName=Ef.getProperty=Ef.safeStringify=Ef.stringify=Ef.strConcat=Ef.addCodeArg=Ef.str=Ef._=Ef.nil=Ef._Code=Ef.Name=Ef.IDENTIFIER=Ef._CodeOrName=void 0;class vG{}Ef._CodeOrName=vG;Ef.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class bI extends vG{constructor($){super();if(!Ef.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}}}Ef.Name=bI;class y$ extends vG{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,q)=>`${I}${q}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,q)=>{if(q instanceof bI)I[q.str]=(I[q.str]||0)+1;return I},{})}}Ef._Code=y$;Ef.nil=new y$("");function Tf($,...I){let q=[$[0]],U=0;while(U<I.length)xg(q,I[U]),q.push($[++U]);return new y$(q)}Ef._=Tf;var ug=new y$("+");function jf($,...I){let q=[jJ($[0])],U=0;while(U<I.length)q.push(ug),xg(q,I[U]),q.push(ug,jJ($[++U]));return MF0(q),new y$(q)}Ef.str=jf;function xg($,I){if(I instanceof y$)$.push(...I._items);else if(I instanceof bI)$.push(I);else $.push(PF0(I))}Ef.addCodeArg=xg;function MF0($){let I=1;while(I<$.length-1){if($[I]===ug){let q=AF0($[I-1],$[I+1]);if(q!==void 0){$.splice(I-1,3,q);continue}$[I++]="+"}I++}}function AF0($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof bI||$[$.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 bI))return`"${$}${I.slice(1)}`;return}function gF0($,I){return I.emptyStr()?$:$.emptyStr()?I:jf`${$}${I}`}Ef.strConcat=gF0;function PF0($){return typeof $=="number"||typeof $=="boolean"||$===null?$:jJ(Array.isArray($)?$.join(","):$)}function TF0($){return new y$(jJ($))}Ef.stringify=TF0;function jJ($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ef.safeStringify=jJ;function jF0($){return typeof $=="string"&&Ef.IDENTIFIER.test($)?new y$(`.${$}`):Tf`[${$}]`}Ef.getProperty=jF0;function EF0($){if(typeof $=="string"&&Ef.IDENTIFIER.test($))return new y$(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Ef.getEsmExportName=EF0;function BF0($){return new y$($.toString())}Ef.regexpCode=BF0});var bg=L((Cf)=>{Object.defineProperty(Cf,"__esModule",{value:!0});Cf.ValueScope=Cf.ValueScopeName=Cf.Scope=Cf.varKinds=Cf.UsedValueState=void 0;var u6=EJ();class vf extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var CG;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(CG||(Cf.UsedValueState=CG={}));Cf.varKinds={const:new u6.Name("const"),let:new u6.Name("let"),var:new u6.Name("var")};class fg{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof u6.Name?$:this.name($)}name($){return new u6.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,q;if(((q=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||q===void 0?void 0:q.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}Cf.Scope=fg;class ng extends u6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:q}){this.value=$,this.scopePath=u6._`.${new u6.Name(I)}[${q}]`}}Cf.ValueScopeName=ng;var bF0=u6._`\n`;class Rf extends fg{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?bF0:u6.nil}}get(){return this._scope}name($){return new ng($,this._newName($))}value($,I){var q;if(I.ref===void 0)throw Error("CodeGen: ref must be passed in value");let U=this.toName($),{prefix:Y}=U,J=(q=I.key)!==null&&q!==void 0?q:I.ref,Q=this._values[Y];if(Q){let w=Q.get(J);if(Line truncated
`:""},this._extScope=$,this._scope=new u$.Scope({parent:$}),this._nodes=[new ff]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let q=this._extScope.value($,I);return(this._values[q.prefix]||(this._values[q.prefix]=new Set)).add(q),q}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,q,U){let Y=this._scope.toName(I);if(q!==void 0&&U)this._constants[Y.str]=q;return this._leafNode(new hf($,Y,q)),Y}const($,I,q){return this._def(u$.varKinds.const,$,I,q)}let($,I,q){return this._def(u$.varKinds.let,$,I,q)}var($,I,q){return this._def(u$.varKinds.var,$,I,q)}assign($,I,q){return this._leafNode(new cg($,I,q))}add($,I){return this._leafNode(new Sf($,x6.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==U1.nil)this._leafNode(new kf($));return this}object(...$){let I=["{"];for(let[q,U]of $){if(I.length>1)I.push(",");if(I.push(q),q!==U||this.opts.es5)I.push(":"),(0,U1.addCodeArg)(I,U)}return I.push("}"),new U1._Code(I)}if($,I,q){if(this._blockNode(new o8($)),I&&q)this.code(I).else().code(q).endIf();else if(I)this.code(I).endIf();else if(q)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new o8($))}else(){return this._elseNode(new BJ)}endIf(){return this._endBlockNode(o8,BJ)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new nf($),I)}forRange($,I,q,U,Y=this.opts.es5?u$.varKinds.var:u$.varKinds.let){let J=this._scope.toName($);return this._for(new bf(Y,J,I,q),()=>U(J))}forOf($,I,q,U=u$.varKinds.const){let Y=this._scope.toName($);if(this.opts.es5){let J=I instanceof U1.Name?I:this.var("_arr",I);return this.forRange("_i",0,U1._`${J}.length`,(Q)=>{this.var(Y,U1._`${J}[${Q}]`),q(Y)})}return this._for(new ig("of",U,Y,I),()=>q(Y))}forIn($,I,q,U=this.opts.es5?u$.varKinds.var:u$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,U1._`Object.keys(${I})`,q);let Y=this._scope.toName($);return this._for(new ig("in",U,Y,I),()=>q(Y))}endFor(){return this._endBlockNode(iI)}label($){return this._leafNode(new yf($))}break($){return this._leafNode(new uf($))}return($){let I=new hG;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(hG)}try($,I,q){if(!I&&!q)throw Error('CodeGen: "try" without "catch" and "finally"');let U=new pf;if(this._blockNode(U),this.code($),I){let Y=this.name("e");this._currNode=U.catch=new SG(Y),I(Y)}if(q)this._currNode=U.finally=new yG,this.code(q);return this._endBlockNode(SG,yG)}throw($){return this._leafNode(new xf($))}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 q=this._nodes.length-I;if(q<0||$!==void 0&&q!==$)throw Error(`CodeGen: wrong number of nodes: ${q} vs ${$} expected`);return this._nodes.length=I,this}func($,I=U1.nil,q,U){if(this._blockNode(new _G($,I,q)),U)this.code(U).endFunc();return this}endFunc(){return this._endBlockNode(_G)}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 q=this._currNode;if(q instanceof $||I&&q 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 o8))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]=$}}x6.CodeGen=cf;function E7($,I){for(let q in I)$[q]=($[q]||0)+(I[q]||0);return $}function uG($,I){return I instanceof U1._CodeOrName?E7($,I.names):$}function pI($,I,q){if($ instanceof U1.Name)return U($);if(!Y($))return $;return new U1._Code($._items.reduce((J,Q)=>{if(Q instanceof U1.Name)Q=U(Q);if(Q instanceof U1._Code)J.push(...Q._items);else J.push(Q);return J},[]));function U(J){let Q=q[J.str];if(Q===void 0||I[J.str]!==1)return J;return delete I[J.str],Q}function Y(J){return J instanceof U1._Code&&J._items.some((Q)=>Q instanceof U1.Name&&I[Q.str]===1&&q[Q.str]!==void 0)}}function dF0($,I){for(let q in I)$[q]=($[q]||0)-(I[q]||0)}function df($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:U1._`!${pg($)}`}x6.not=df;var lF0=lf(x6.operators.AND);function mF0(...$){return $.reduce(lF0)}x6.and=mF0;var oF0=lf(x6.operators.OR);function rF0(...$){return $.reduce(oF0)}x6.or=rF0;function lf($){return(I,q)=>I===U1.nil?q:q===U1.nil?I:U1._`${pg(I)} ${$} ${pg(q)}`}function pg($){return $ instanceof U1.Name?$:U1._`(${Line truncated
|| (${Q} == "string" && ${Y} && ${Y} == +${Y})`).assign(K,l0._`+${Y}`);return;case"integer":U.elseIf(l0._`${Q} === "boolean" || ${Y} === null
|| (${Q} === "string" && ${Y} && ${Y} == +${Y} && !(${Y} % 1))`).assign(K,l0._`+${Y}`);return;case"boolean":U.elseIf(l0._`${Y} === "false" || ${Y} === 0 || ${Y} === null`).assign(K,!1).elseIf(l0._`${Y} === "true" || ${Y} === 1`).assign(K,!0);return;case"null":U.elseIf(l0._`${Y} === "" || ${Y} === 0 || ${Y} === false`),U.assign(K,null);return;case"array":U.elseIf(l0._`${Q} === "string" || ${Q} === "number"
|| ${Q} === "boolean" || ${Y} === null`).assign(K,l0._`[${Y}]`)}}}function zA0({gen:$,parentData:I,parentDataProperty:q},U){$.if(l0._`${I} !== undefined`,()=>$.assign(l0._`${I}[${q}]`,U))}function ag($,I,q,U=cI.Correct){let Y=U===cI.Correct?l0.operators.EQ:l0.operators.NEQ,J;switch($){case"null":return l0._`${I} ${Y} null`;case"array":J=l0._`Array.isArray(${I})`;break;case"object":J=l0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":J=Q(l0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":J=Q();break;default:return l0._`typeof ${I} ${Y} ${$}`}return U===cI.Correct?J:(0,l0.not)(J);function Q(K=l0.nil){return(0,l0.and)(l0._`typeof ${I} == "number"`,K,q?l0._`isFinite(${I})`:l0.nil)}}An.checkDataType=ag;function sg($,I,q,U){if($.length===1)return ag($[0],I,q,U);let Y,J=(0,Nn.toHash)($);if(J.array&&J.object){let Q=l0._`typeof ${I} != "object"`;Y=J.null?Q:l0._`!${I} || ${Q}`,delete J.null,delete J.array,delete J.object}else Y=l0.nil;if(J.number)delete J.integer;for(let Q in J)Y=(0,l0.and)(Y,ag(Q,I,q,U));return Y}An.checkDataTypes=sg;var wA0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?l0._`{type: ${$}}`:l0._`{type: ${I}}`};function eg($){let I=GA0($);(0,UA0.reportError)(I,wA0)}An.reportTypeError=eg;function GA0($){let{gen:I,data:q,schema:U}=$,Y=(0,Nn.schemaRefOrVal)($,U,"type");return{gen:I,keyword:"type",data:q,schema:U.type,schemaCode:Y,schemaValue:Y,parentSchema:U,params:{},it:$}}});var En=L((Tn)=>{Object.defineProperty(Tn,"__esModule",{value:!0});Tn.assignDefaults=void 0;var dI=o0(),OA0=z1();function LA0($,I){let{properties:q,items:U}=$.schema;if(I==="object"&&q)for(let Y in q)Pn($,Y,q[Y].default);else if(I==="array"&&Array.isArray(U))U.forEach((Y,J)=>Pn($,J,Y.default))}Tn.assignDefaults=LA0;function Pn($,I,q){let{gen:U,compositeRule:Y,data:J,opts:Q}=$;if(q===void 0)return;let K=dI._`${J}${(0,dI.getProperty)(I)}`;if(Y){(0,OA0.checkStrictMode)($,`default is ignored for: ${K}`);return}let z=dI._`${K} === undefined`;if(Q.useDefaults==="empty")z=dI._`${z} || ${K} === null || ${K} === ""`;U.if(z,dI._`${K} = ${(0,dI.stringify)(q)}`)}});var D$=L((Rn)=>{Object.defineProperty(Rn,"__esModule",{value:!0});Rn.validateUnion=Rn.validateArray=Rn.usePattern=Rn.callValidateCode=Rn.schemaProperties=Rn.allSchemaProperties=Rn.noPropertyInData=Rn.propertyInData=Rn.isOwnProperty=Rn.hasPropFunc=Rn.reportMissingProp=Rn.checkMissingProp=Rn.checkReportMissingProp=void 0;var d1=o0(),$P=z1(),Y9=r8(),NA0=z1();function FA0($,I){let{gen:q,data:U,it:Y}=$;q.if(qP(q,U,I,Y.opts.ownProperties),()=>{$.setParams({missingProperty:d1._`${I}`},!0),$.error()})}Rn.checkReportMissingProp=FA0;function MA0({gen:$,data:I,it:{opts:q}},U,Y){return(0,d1.or)(...U.map((J)=>(0,d1.and)(qP($,I,J,q.ownProperties),d1._`${Y} = ${J}`)))}Rn.checkMissingProp=MA0;function AA0($,I){$.setParams({missingProperty:I},!0),$.error()}Rn.reportMissingProp=AA0;function Bn($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:d1._`Object.prototype.hasOwnProperty`})}Rn.hasPropFunc=Bn;function IP($,I,q){return d1._`${Bn($)}.call(${I}, ${q})`}Rn.isOwnProperty=IP;function gA0($,I,q,U){let Y=d1._`${I}${(0,d1.getProperty)(q)} !== undefined`;return U?d1._`${Y} && ${IP($,I,q)}`:Y}Rn.propertyInData=gA0;function qP($,I,q,U){let Y=d1._`${I}${(0,d1.getProperty)(q)} === undefined`;return U?(0,d1.or)(Y,(0,d1.not)(IP($,I,q))):Y}Rn.noPropertyInData=qP;function vn($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}Rn.allSchemaProperties=vn;function PA0($,I){return vn(I).filter((q)=>!(0,$P.alwaysValidSchema)($,I[q]))}Rn.schemaProperties=PA0;function TA0({schemaCode:$,data:I,it:{gen:q,topSchemaRef:U,schemaPath:Y,errorPath:J},it:Q},K,z,w){let G=w?d1._`${$}, ${I}, ${U}${Y}`:I,H=[[Y9.default.instancePath,(0,d1.strConcat)(Y9.default.instancePath,J)],[Y9.default.parentData,Q.parentData],[Y9.default.parentDataProperty,Q.parentDataProperty],[Y9.default.rootData,Y9.default.rootData]];if(Q.opts.dynamicRef)H.push([Y9.default.dynamicAnchors,Y9.default.dynamicAnchors]);let W=d1._`${G}, ${q.object(...H)}`;return z!==d1.nil?d1._`${K}.call(${z}, ${W})`:d1._`${K}(${W})`}Rn.callValidateCode=TA0;var jA0=d1._`new RegExp`;function EA0({gen:$,it:{opts:I}},q){let U=I.unicodeRegExp?"u":"",{regExp:Y}=I.code,J=Y(q,U);return $.scopeValue("pattern",{key:J.toString(),ref:J,code:d1._`${Y.code==="new RegExp"?jA0:(0,NA0.useFunc)($,Y)}(${q}, ${U})`})}Rn.usePattern=EA0;function BA0($){let{gen:I,data:q,keyword:U,it:Y}=$,J=I.name("valid");if(Y.allErrors){let K=I.let("valid",!0);return Q(()=>I.assign(K,!1)),K}return I.var(J,!0),Q(()=>I.break()),J;function Q(K){let z=I.const("len",d1._`${q}.length`);I.forRange("i",0,z,(w)=>{$.subschema({keyword:U,dataProp:w,dataPropType:$P.Type.Num},J),I.if((0,d1.not)(J),K)})}}Rn.validateArray=BA0;function vA0($){let{gen:I,schema:q,keyword:U,it:Y}=$;if(!Array.isArray(q))throw Error("ajv implementation error");if(q.some((z)=>(0,$P.alwaysValidSchema)(Y,z))&&!Y.opts.unevaluated)return;le Line truncated
import{createRequire as OD0}from"node:module";var wD0=Object.create;var{getPrototypeOf:zD0,defineProperty:hO,getOwnPropertyNames:GD0}=Object;var HD0=Object.prototype.hasOwnProperty;function VD0($){return this[$]}var WD0,ZD0,RY=($,I,q)=>{var U=$!=null&&typeof $==="object";if(U){var Y=I?WD0??=new WeakMap:ZD0??=new WeakMap,J=Y.get($);if(J)return J}q=$!=null?wD0(zD0($)):{};let Q=I||!$||!$.__esModule?hO(q,"default",{value:$,enumerable:!0}):q;for(let K of GD0($))if(!HD0.call(Q,K))hO(Q,K,{get:VD0.bind($,K),enumerable:!0});if(U)Y.set($,Q);return Q};var L=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var XD0=($)=>$;function DD0($,I){this[$]=XD0.bind(null,I)}var m8=($,I)=>{for(var q in I)hO($,q,{get:I[q],enumerable:!0,configurable:!0,set:DD0.bind(I,q)})};var o=OD0(import.meta.url);var vJ=L((cf)=>{Object.defineProperty(cf,"__esModule",{value:!0});cf.regexpCode=cf.getEsmExportName=cf.getProperty=cf.safeStringify=cf.stringify=cf.strConcat=cf.addCodeArg=cf.str=cf._=cf.nil=cf._Code=cf.Name=cf.IDENTIFIER=cf._CodeOrName=void 0;class hG{}cf._CodeOrName=hG;cf.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class pI extends hG{constructor($){super();if(!cf.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}}}cf.Name=pI;class x$ extends hG{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,q)=>`${I}${q}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,q)=>{if(q instanceof pI)I[q.str]=(I[q.str]||0)+1;return I},{})}}cf._Code=x$;cf.nil=new x$("");function bf($,...I){let q=[$[0]],U=0;while(U<I.length)lg(q,I[U]),q.push($[++U]);return new x$(q)}cf._=bf;var dg=new x$("+");function pf($,...I){let q=[BJ($[0])],U=0;while(U<I.length)q.push(dg),lg(q,I[U]),q.push(dg,BJ($[++U]));return kF0(q),new x$(q)}cf.str=pf;function lg($,I){if(I instanceof x$)$.push(...I._items);else if(I instanceof pI)$.push(I);else $.push(iF0(I))}cf.addCodeArg=lg;function kF0($){let I=1;while(I<$.length-1){if($[I]===dg){let q=fF0($[I-1],$[I+1]);if(q!==void 0){$.splice(I-1,3,q);continue}$[I++]="+"}I++}}function fF0($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof pI||$[$.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 pI))return`"${$}${I.slice(1)}`;return}function nF0($,I){return I.emptyStr()?$:$.emptyStr()?I:pf`${$}${I}`}cf.strConcat=nF0;function iF0($){return typeof $=="number"||typeof $=="boolean"||$===null?$:BJ(Array.isArray($)?$.join(","):$)}function bF0($){return new x$(BJ($))}cf.stringify=bF0;function BJ($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}cf.safeStringify=BJ;function pF0($){return typeof $=="string"&&cf.IDENTIFIER.test($)?new x$(`.${$}`):bf`[${$}]`}cf.getProperty=pF0;function cF0($){if(typeof $=="string"&&cf.IDENTIFIER.test($))return new x$(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}cf.getEsmExportName=cF0;function dF0($){return new x$($.toString())}cf.regexpCode=dF0});var tg=L((of)=>{Object.defineProperty(of,"__esModule",{value:!0});of.ValueScope=of.ValueScopeName=of.Scope=of.varKinds=of.UsedValueState=void 0;var x6=vJ();class lf extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var yG;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(yG||(of.UsedValueState=yG={}));of.varKinds={const:new x6.Name("const"),let:new x6.Name("let"),var:new x6.Name("var")};class og{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof x6.Name?$:this.name($)}name($){return new x6.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,q;if(((q=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||q===void 0?void 0:q.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}of.Scope=og;class rg extends x6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:q}){this.value=$,this.scopePath=x6._`.${new x6.Name(I)}[${q}]`}}of.ValueScopeName=rg;var YM0=x6._`\n`;class mf extends og{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?YM0:x6.nil}}get(){return this._scope}name($){return new rg($,this._newName($))}value($,I){var q;if(I.ref===void 0)throw Error("CodeGen: ref must be passed in value");let U=this.toName($),{prefix:Y}=U,J=(q=I.key)!==null&&q!==void 0?q:I.ref,Q=this._values[Y];if(Q){let z=Q.get(J);if(Line truncated
`:""},this._extScope=$,this._scope=new k$.Scope({parent:$}),this._nodes=[new qn]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let q=this._extScope.value($,I);return(this._values[q.prefix]||(this._values[q.prefix]=new Set)).add(q),q}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,q,U){let Y=this._scope.toName(I);if(q!==void 0&&U)this._constants[Y.str]=q;return this._leafNode(new tf($,Y,q)),Y}const($,I,q){return this._def(k$.varKinds.const,$,I,q)}let($,I,q){return this._def(k$.varKinds.let,$,I,q)}var($,I,q){return this._def(k$.varKinds.var,$,I,q)}assign($,I,q){return this._leafNode(new eg($,I,q))}add($,I){return this._leafNode(new af($,k6.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==U1.nil)this._leafNode(new In($));return this}object(...$){let I=["{"];for(let[q,U]of $){if(I.length>1)I.push(",");if(I.push(q),q!==U||this.opts.es5)I.push(":"),(0,U1.addCodeArg)(I,U)}return I.push("}"),new U1._Code(I)}if($,I,q){if(this._blockNode(new s8($)),I&&q)this.code(I).else().code(q).endIf();else if(I)this.code(I).endIf();else if(q)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new s8($))}else(){return this._elseNode(new RJ)}endIf(){return this._endBlockNode(s8,RJ)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new Un($),I)}forRange($,I,q,U,Y=this.opts.es5?k$.varKinds.var:k$.varKinds.let){let J=this._scope.toName($);return this._for(new Yn(Y,J,I,q),()=>U(J))}forOf($,I,q,U=k$.varKinds.const){let Y=this._scope.toName($);if(this.opts.es5){let J=I instanceof U1.Name?I:this.var("_arr",I);return this.forRange("_i",0,U1._`${J}.length`,(Q)=>{this.var(Y,U1._`${J}[${Q}]`),q(Y)})}return this._for(new ag("of",U,Y,I),()=>q(Y))}forIn($,I,q,U=this.opts.es5?k$.varKinds.var:k$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,U1._`Object.keys(${I})`,q);let Y=this._scope.toName($);return this._for(new ag("in",U,Y,I),()=>q(Y))}endFor(){return this._endBlockNode(cI)}label($){return this._leafNode(new sf($))}break($){return this._leafNode(new ef($))}return($){let I=new xG;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(xG)}try($,I,q){if(!I&&!q)throw Error('CodeGen: "try" without "catch" and "finally"');let U=new Jn;if(this._blockNode(U),this.code($),I){let Y=this.name("e");this._currNode=U.catch=new kG(Y),I(Y)}if(q)this._currNode=U.finally=new fG,this.code(q);return this._endBlockNode(kG,fG)}throw($){return this._leafNode(new $n($))}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 q=this._nodes.length-I;if(q<0||$!==void 0&&q!==$)throw Error(`CodeGen: wrong number of nodes: ${q} vs ${$} expected`);return this._nodes.length=I,this}func($,I=U1.nil,q,U){if(this._blockNode(new uG($,I,q)),U)this.code(U).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 q=this._currNode;if(q instanceof $||I&&q 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 s8))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]=$}}k6.CodeGen=Qn;function v7($,I){for(let q in I)$[q]=($[q]||0)+(I[q]||0);return $}function nG($,I){return I instanceof U1._CodeOrName?v7($,I.names):$}function dI($,I,q){if($ instanceof U1.Name)return U($);if(!Y($))return $;return new U1._Code($._items.reduce((J,Q)=>{if(Q instanceof U1.Name)Q=U(Q);if(Q instanceof U1._Code)J.push(...Q._items);else J.push(Q);return J},[]));function U(J){let Q=q[J.str];if(Q===void 0||I[J.str]!==1)return J;return delete I[J.str],Q}function Y(J){return J instanceof U1._Code&&J._items.some((Q)=>Q instanceof U1.Name&&I[Q.str]===1&&q[Q.str]!==void 0)}}function wM0($,I){for(let q in I)$[q]=($[q]||0)-(I[q]||0)}function Kn($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:U1._`!${sg($)}`}k6.not=Kn;var zM0=wn(k6.operators.AND);function GM0(...$){return $.reduce(zM0)}k6.and=GM0;var HM0=wn(k6.operators.OR);function VM0(...$){return $.reduce(HM0)}k6.or=VM0;function wn($){return(I,q)=>I===U1.nil?q:q===U1.nil?I:U1._`${sg(I)} ${$} ${sg(q)}`}function sg($){return $ instanceof U1.Name?$:U1._`(${Line truncated
|| (${Q} == "string" && ${Y} && ${Y} == +${Y})`).assign(K,d0._`+${Y}`);return;case"integer":U.elseIf(d0._`${Q} === "boolean" || ${Y} === null
|| (${Q} === "string" && ${Y} && ${Y} == +${Y} && !(${Y} % 1))`).assign(K,d0._`+${Y}`);return;case"boolean":U.elseIf(d0._`${Y} === "false" || ${Y} === 0 || ${Y} === null`).assign(K,!1).elseIf(d0._`${Y} === "true" || ${Y} === 1`).assign(K,!0);return;case"null":U.elseIf(d0._`${Y} === "" || ${Y} === 0 || ${Y} === false`),U.assign(K,null);return;case"array":U.elseIf(d0._`${Q} === "string" || ${Q} === "number"
|| ${Q} === "boolean" || ${Y} === null`).assign(K,d0._`[${Y}]`)}}}function TA0({gen:$,parentData:I,parentDataProperty:q},U){$.if(d0._`${I} !== undefined`,()=>$.assign(d0._`${I}[${q}]`,U))}function QP($,I,q,U=lI.Correct){let Y=U===lI.Correct?d0.operators.EQ:d0.operators.NEQ,J;switch($){case"null":return d0._`${I} ${Y} null`;case"array":J=d0._`Array.isArray(${I})`;break;case"object":J=d0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":J=Q(d0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":J=Q();break;default:return d0._`typeof ${I} ${Y} ${$}`}return U===lI.Correct?J:(0,d0.not)(J);function Q(K=d0.nil){return(0,d0.and)(d0._`typeof ${I} == "number"`,K,q?d0._`isFinite(${I})`:d0.nil)}}kn.checkDataType=QP;function KP($,I,q,U){if($.length===1)return QP($[0],I,q,U);let Y,J=(0,yn.toHash)($);if(J.array&&J.object){let Q=d0._`typeof ${I} != "object"`;Y=J.null?Q:d0._`!${I} || ${Q}`,delete J.null,delete J.array,delete J.object}else Y=d0.nil;if(J.number)delete J.integer;for(let Q in J)Y=(0,d0.and)(Y,QP(Q,I,q,U));return Y}kn.checkDataTypes=KP;var EA0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?d0._`{type: ${$}}`:d0._`{type: ${I}}`};function wP($){let I=jA0($);(0,FA0.reportError)(I,EA0)}kn.reportTypeError=wP;function jA0($){let{gen:I,data:q,schema:U}=$,Y=(0,yn.schemaRefOrVal)($,U,"type");return{gen:I,keyword:"type",data:q,schema:U.type,schemaCode:Y,schemaValue:Y,parentSchema:U,params:{},it:$}}});var cn=L((bn)=>{Object.defineProperty(bn,"__esModule",{value:!0});bn.assignDefaults=void 0;var mI=m0(),SA0=w1();function yA0($,I){let{properties:q,items:U}=$.schema;if(I==="object"&&q)for(let Y in q)nn($,Y,q[Y].default);else if(I==="array"&&Array.isArray(U))U.forEach((Y,J)=>nn($,J,Y.default))}bn.assignDefaults=yA0;function nn($,I,q){let{gen:U,compositeRule:Y,data:J,opts:Q}=$;if(q===void 0)return;let K=mI._`${J}${(0,mI.getProperty)(I)}`;if(Y){(0,SA0.checkStrictMode)($,`default is ignored for: ${K}`);return}let w=mI._`${K} === undefined`;if(Q.useDefaults==="empty")w=mI._`${w} || ${K} === null || ${K} === ""`;U.if(w,mI._`${K} = ${(0,mI.stringify)(q)}`)}});var O$=L((mn)=>{Object.defineProperty(mn,"__esModule",{value:!0});mn.validateUnion=mn.validateArray=mn.usePattern=mn.callValidateCode=mn.schemaProperties=mn.allSchemaProperties=mn.noPropertyInData=mn.propertyInData=mn.isOwnProperty=mn.hasPropFunc=mn.reportMissingProp=mn.checkMissingProp=mn.checkReportMissingProp=void 0;var l1=m0(),zP=w1(),z9=e8(),uA0=w1();function xA0($,I){let{gen:q,data:U,it:Y}=$;q.if(HP(q,U,I,Y.opts.ownProperties),()=>{$.setParams({missingProperty:l1._`${I}`},!0),$.error()})}mn.checkReportMissingProp=xA0;function kA0({gen:$,data:I,it:{opts:q}},U,Y){return(0,l1.or)(...U.map((J)=>(0,l1.and)(HP($,I,J,q.ownProperties),l1._`${Y} = ${J}`)))}mn.checkMissingProp=kA0;function fA0($,I){$.setParams({missingProperty:I},!0),$.error()}mn.reportMissingProp=fA0;function dn($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:l1._`Object.prototype.hasOwnProperty`})}mn.hasPropFunc=dn;function GP($,I,q){return l1._`${dn($)}.call(${I}, ${q})`}mn.isOwnProperty=GP;function nA0($,I,q,U){let Y=l1._`${I}${(0,l1.getProperty)(q)} !== undefined`;return U?l1._`${Y} && ${GP($,I,q)}`:Y}mn.propertyInData=nA0;function HP($,I,q,U){let Y=l1._`${I}${(0,l1.getProperty)(q)} === undefined`;return U?(0,l1.or)(Y,(0,l1.not)(GP($,I,q))):Y}mn.noPropertyInData=HP;function ln($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}mn.allSchemaProperties=ln;function iA0($,I){return ln(I).filter((q)=>!(0,zP.alwaysValidSchema)($,I[q]))}mn.schemaProperties=iA0;function bA0({schemaCode:$,data:I,it:{gen:q,topSchemaRef:U,schemaPath:Y,errorPath:J},it:Q},K,w,z){let G=z?l1._`${$}, ${I}, ${U}${Y}`:I,H=[[z9.default.instancePath,(0,l1.strConcat)(z9.default.instancePath,J)],[z9.default.parentData,Q.parentData],[z9.default.parentDataProperty,Q.parentDataProperty],[z9.default.rootData,z9.default.rootData]];if(Q.opts.dynamicRef)H.push([z9.default.dynamicAnchors,z9.default.dynamicAnchors]);let V=l1._`${G}, ${q.object(...H)}`;return w!==l1.nil?l1._`${K}.call(${w}, ${V})`:l1._`${K}(${V})`}mn.callValidateCode=bA0;var pA0=l1._`new RegExp`;function cA0({gen:$,it:{opts:I}},q){let U=I.unicodeRegExp?"u":"",{regExp:Y}=I.code,J=Y(q,U);return $.scopeValue("pattern",{key:J.toString(),ref:J,code:l1._`${Y.code==="new RegExp"?pA0:(0,uA0.useFunc)($,Y)}(${q}, ${U})`})}mn.usePattern=cA0;function dA0($){let{gen:I,data:q,keyword:U,it:Y}=$,J=I.name("valid");if(Y.allErrors){let K=I.let("valid",!0);return Q(()=>I.assign(K,!1)),K}return I.var(J,!0),Q(()=>I.break()),J;function Q(K){let w=I.const("len",l1._`${q}.length`);I.forRange("i",0,w,(z)=>{$.subschema({keyword:U,dataProp:z,dataPropType:zP.Type.Num},J),I.if((0,l1.not)(J),K)})}}mn.validateArray=dA0;function lA0($){let{gen:I,schema:q,keyword:U,it:Y}=$;if(!Array.isArray(q))throw Error("ajv implementation error");if(q.some((w)=>(0,zP.alwaysValidSchema)(Y,w))&&!Y.opts.unevaluated)return;le Line truncated
missingProperty: ${U},
depsCount: ${I},
deps: ${q}}`};var oj0={keyword:"dependencies",type:"object",schemaType:"object",error:oi.error,code($){let[I,q]=rj0($);li($,I),mi($,q)}};function rj0({schema:$}){let I={},q={};for(let U in $){if(U==="__proto__")continue;let Y=Array.isArray($[U])?I:q;Y[U]=$[U]}return[I,q]}function li($,I=$.schema){let{gen:q,data:U,it:Y}=$;if(Object.keys(I).length===0)return;let J=q.let("missing");for(let Q in I){let K=I[Q];if(K.length===0)continue;let z=(0,lJ.propertyInData)(q,U,Q,Y.opts.ownProperties);if($.setParams({property:Q,depsCount:K.length,deps:K.join(", ")}),Y.allErrors)q.if(z,()=>{for(let w of K)(0,lJ.checkReportMissingProp)($,w)});else q.if(TP._`${z} && (${(0,lJ.checkMissingProp)($,K,J)})`),(0,lJ.reportMissingProp)($,J),q.else()}}oi.validatePropertyDeps=li;function mi($,I=$.schema){let{gen:q,data:U,keyword:Y,it:J}=$,Q=q.name("valid");for(let K in I){if((0,mj0.alwaysValidSchema)(J,I[K]))continue;q.if((0,lJ.propertyInData)(q,U,K,J.opts.ownProperties),()=>{let z=$.subschema({keyword:Y,schemaProp:K},Q);$.mergeValidEvaluated(z,Q)},()=>q.var(Q,!0)),$.ok(Q)}}oi.validateSchemaDeps=mi;oi.default=oj0});var $p=L((ei)=>{Object.defineProperty(ei,"__esModule",{value:!0});var si=o0(),sj0=z1(),ej0={message:"property name must be valid",params:({params:$})=>si._`{propertyName: ${$.propertyName}}`},$E0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ej0,code($){let{gen:I,schema:q,data:U,it:Y}=$;if((0,sj0.alwaysValidSchema)(Y,q))return;let J=I.name("valid");I.forIn("key",U,(Q)=>{$.setParams({propertyName:Q}),$.subschema({keyword:"propertyNames",data:Q,dataTypes:["string"],propertyName:Q,compositeRule:!0},J),I.if((0,si.not)(J),()=>{if($.error(!0),!Y.allErrors)I.break()})}),$.ok(J)}};ei.default=$E0});var jP=L((Ip)=>{Object.defineProperty(Ip,"__esModule",{value:!0});var YH=D$(),f$=o0(),qE0=r8(),JH=z1(),UE0={message:"must NOT have additional properties",params:({params:$})=>f$._`{additionalProperty: ${$.additionalProperty}}`},YE0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:UE0,code($){let{gen:I,schema:q,parentSchema:U,data:Y,errsCount:J,it:Q}=$;if(!J)throw Error("ajv implementation error");let{allErrors:K,opts:z}=Q;if(Q.props=!0,z.removeAdditional!=="all"&&(0,JH.alwaysValidSchema)(Q,q))return;let w=(0,YH.allSchemaProperties)(U.properties),G=(0,YH.allSchemaProperties)(U.patternProperties);H(),$.ok(f$._`${J} === ${qE0.default.errors}`);function H(){I.forIn("key",Y,(O)=>{if(!w.length&&!G.length)X(O);else I.if(W(O),()=>X(O))})}function W(O){let N;if(w.length>8){let T=(0,JH.schemaRefOrVal)(Q,U.properties,"properties");N=(0,YH.isOwnProperty)(I,T,O)}else if(w.length)N=(0,f$.or)(...w.map((T)=>f$._`${O} === ${T}`));else N=f$.nil;if(G.length)N=(0,f$.or)(N,...G.map((T)=>f$._`${(0,YH.usePattern)($,T)}.test(${O})`));return(0,f$.not)(N)}function V(O){I.code(f$._`delete ${Y}[${O}]`)}function X(O){if(z.removeAdditional==="all"||z.removeAdditional&&q===!1){V(O);return}if(q===!1){if($.setParams({additionalProperty:O}),$.error(),!K)I.break();return}if(typeof q=="object"&&!(0,JH.alwaysValidSchema)(Q,q)){let N=I.name("valid");if(z.removeAdditional==="failing")D(O,N,!1),I.if((0,f$.not)(N),()=>{$.reset(),V(O)});else if(D(O,N),!K)I.if((0,f$.not)(N),()=>I.break())}}function D(O,N,T){let P={keyword:"additionalProperties",dataProp:O,dataPropType:JH.Type.Str};if(T===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,N)}}};Ip.default=YE0});var Jp=L((Yp)=>{Object.defineProperty(Yp,"__esModule",{value:!0});var QE0=SJ(),qp=D$(),EP=z1(),Up=jP(),KE0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,parentSchema:U,data:Y,it:J}=$;if(J.opts.removeAdditional==="all"&&U.additionalProperties===void 0)Up.default.code(new QE0.KeywordCxt(J,Up.default,"additionalProperties"));let Q=(0,qp.allSchemaProperties)(q);for(let H of Q)J.definedProperties.add(H);if(J.opts.unevaluated&&Q.length&&J.props!==!0)J.props=EP.mergeEvaluated.props(I,(0,EP.toHash)(Q),J.props);let K=Q.filter((H)=>!(0,EP.alwaysValidSchema)(J,q[H]));if(K.length===0)return;let z=I.name("valid");for(let H of K){if(w(H))G(H);else{if(I.if((0,qp.propertyInData)(I,Y,H,J.opts.ownProperties)),G(H),!J.allErrors)I.else().var(z,!0);I.endIf()}$.it.definedProperties.add(H),$.ok(z)}function w(H){return J.opts.useDefaults&&!J.compositeRule&&q[H].default!==void 0}function G(H){$.subschema({keyword:"properties",schemaProp:H,dataProp:H},z)}}};Yp.default=KE0});var Gp=L((wp)=>{Object.defineProperty(wp,"__esModule",{value:!0});var Qp=D$(),QH=o0(),Kp=z1(),zp=z1(),wE0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,data:U,parentSchema:Y,it:J}=$,{opts:Q}=J,K=(0,Qp.allSchemaProperties)(q),z=K.filter((D)=>(0,Kp.alwaysValidSchema)(J,q[D]));if(K.length===0||z.length===K.length&&(!J.opts.unevaluated||J.props===!0))return;let w=Q.strictSchema&&!Q.allowMatchingProperties&&Y.properties,G=I.name("valid");if(J.props!==!0&&!(J.props instanceo Line truncated
deps: ${q}}`};var Hj0={keyword:"dependencies",type:"object",schemaType:"object",error:Gp.error,code($){let[I,q]=Vj0($);wp($,I),zp($,q)}};function Vj0({schema:$}){let I={},q={};for(let U in $){if(U==="__proto__")continue;let Y=Array.isArray($[U])?I:q;Y[U]=$[U]}return[I,q]}function wp($,I=$.schema){let{gen:q,data:U,it:Y}=$;if(Object.keys(I).length===0)return;let J=q.let("missing");for(let Q in I){let K=I[Q];if(K.length===0)continue;let w=(0,oJ.propertyInData)(q,U,Q,Y.opts.ownProperties);if($.setParams({property:Q,depsCount:K.length,deps:K.join(", ")}),Y.allErrors)q.if(w,()=>{for(let z of K)(0,oJ.checkReportMissingProp)($,z)});else q.if(SP._`${w} && (${(0,oJ.checkMissingProp)($,K,J)})`),(0,oJ.reportMissingProp)($,J),q.else()}}Gp.validatePropertyDeps=wp;function zp($,I=$.schema){let{gen:q,data:U,keyword:Y,it:J}=$,Q=q.name("valid");for(let K in I){if((0,Gj0.alwaysValidSchema)(J,I[K]))continue;q.if((0,oJ.propertyInData)(q,U,K,J.opts.ownProperties),()=>{let w=$.subschema({keyword:Y,schemaProp:K},Q);$.mergeValidEvaluated(w,Q)},()=>q.var(Q,!0)),$.ok(Q)}}Gp.validateSchemaDeps=zp;Gp.default=Hj0});var Dp=L((Xp)=>{Object.defineProperty(Xp,"__esModule",{value:!0});var Zp=m0(),Xj0=w1(),Dj0={message:"property name must be valid",params:({params:$})=>Zp._`{propertyName: ${$.propertyName}}`},Oj0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Dj0,code($){let{gen:I,schema:q,data:U,it:Y}=$;if((0,Xj0.alwaysValidSchema)(Y,q))return;let J=I.name("valid");I.forIn("key",U,(Q)=>{$.setParams({propertyName:Q}),$.subschema({keyword:"propertyNames",data:Q,dataTypes:["string"],propertyName:Q,compositeRule:!0},J),I.if((0,Zp.not)(J),()=>{if($.error(!0),!Y.allErrors)I.break()})}),$.ok(J)}};Xp.default=Oj0});var yP=L((Op)=>{Object.defineProperty(Op,"__esModule",{value:!0});var wH=O$(),i$=m0(),Nj0=e8(),zH=w1(),Fj0={message:"must NOT have additional properties",params:({params:$})=>i$._`{additionalProperty: ${$.additionalProperty}}`},Mj0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Fj0,code($){let{gen:I,schema:q,parentSchema:U,data:Y,errsCount:J,it:Q}=$;if(!J)throw Error("ajv implementation error");let{allErrors:K,opts:w}=Q;if(Q.props=!0,w.removeAdditional!=="all"&&(0,zH.alwaysValidSchema)(Q,q))return;let z=(0,wH.allSchemaProperties)(U.properties),G=(0,wH.allSchemaProperties)(U.patternProperties);H(),$.ok(i$._`${J} === ${Nj0.default.errors}`);function H(){I.forIn("key",Y,(O)=>{if(!z.length&&!G.length)X(O);else I.if(V(O),()=>X(O))})}function V(O){let N;if(z.length>8){let T=(0,zH.schemaRefOrVal)(Q,U.properties,"properties");N=(0,wH.isOwnProperty)(I,T,O)}else if(z.length)N=(0,i$.or)(...z.map((T)=>i$._`${O} === ${T}`));else N=i$.nil;if(G.length)N=(0,i$.or)(N,...G.map((T)=>i$._`${(0,wH.usePattern)($,T)}.test(${O})`));return(0,i$.not)(N)}function W(O){I.code(i$._`delete ${Y}[${O}]`)}function X(O){if(w.removeAdditional==="all"||w.removeAdditional&&q===!1){W(O);return}if(q===!1){if($.setParams({additionalProperty:O}),$.error(),!K)I.break();return}if(typeof q=="object"&&!(0,zH.alwaysValidSchema)(Q,q)){let N=I.name("valid");if(w.removeAdditional==="failing")D(O,N,!1),I.if((0,i$.not)(N),()=>{$.reset(),W(O)});else if(D(O,N),!K)I.if((0,i$.not)(N),()=>I.break())}}function D(O,N,T){let P={keyword:"additionalProperties",dataProp:O,dataPropType:zH.Type.Str};if(T===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,N)}}};Op.default=Mj0});var Mp=L((Fp)=>{Object.defineProperty(Fp,"__esModule",{value:!0});var gj0=uJ(),Lp=O$(),uP=w1(),Np=yP(),Pj0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,parentSchema:U,data:Y,it:J}=$;if(J.opts.removeAdditional==="all"&&U.additionalProperties===void 0)Np.default.code(new gj0.KeywordCxt(J,Np.default,"additionalProperties"));let Q=(0,Lp.allSchemaProperties)(q);for(let H of Q)J.definedProperties.add(H);if(J.opts.unevaluated&&Q.length&&J.props!==!0)J.props=uP.mergeEvaluated.props(I,(0,uP.toHash)(Q),J.props);let K=Q.filter((H)=>!(0,uP.alwaysValidSchema)(J,q[H]));if(K.length===0)return;let w=I.name("valid");for(let H of K){if(z(H))G(H);else{if(I.if((0,Lp.propertyInData)(I,Y,H,J.opts.ownProperties)),G(H),!J.allErrors)I.else().var(w,!0);I.endIf()}$.it.definedProperties.add(H),$.ok(w)}function z(H){return J.opts.useDefaults&&!J.compositeRule&&q[H].default!==void 0}function G(H){$.subschema({keyword:"properties",schemaProp:H,dataProp:H},w)}}};Fp.default=Pj0});var Ep=L((Tp)=>{Object.defineProperty(Tp,"__esModule",{value:!0});var Ap=O$(),GH=m0(),gp=w1(),Pp=w1(),Ej0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,data:U,parentSchema:Y,it:J}=$,{opts:Q}=J,K=(0,Ap.allSchemaProperties)(q),w=K.filter((D)=>(0,gp.alwaysValidSchema)(J,q[D]));if(K.length===0||w.length===K.length&&(!J.opts.unevaluated||J.props===!0))return;let z=Q.strictSchema&&!Q.allowMatchingProperties&&Y.properties,G=I.name("valid");if(J.props!==!0&&!(J.props instanceo Line 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 Dm=L((xC0)=>{var Xj=I5().Buffer;xC0._dbcs=U5;var t4=-1,Xm=-2,F$=-10,j6=-1000,Fq=Array(256),ZQ=-1;for(WQ=0;WQ<256;WQ++)Fq[WQ]=t4;var WQ;function U5($,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 q=$.table();this.decodeTables=[],this.decodeTables[0]=Fq.slice(0),this.decodeTableSeq=[];for(var U=0;U<q.length;U++)this._addDecodeChunk(q[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var Y=this.decodeTables.length;this.decodeTables.push(Fq.slice(0));var J=this.decodeTables.length;this.decodeTables.push(Fq.slice(0));var Q=this.decodeTables[0];for(var U=129;U<=254;U++){var K=this.decodeTables[j6-Q[U]];for(var z=48;z<=57;z++){if(K[z]===t4)K[z]=j6-Y;else if(K[z]>j6)throw Error("gb18030 decode tables conflict at byte 2");var w=this.decodeTables[j6-K[z]];for(var G=129;G<=254;G++){if(w[G]===t4)w[G]=j6-J;else if(w[G]===j6-J)continue;else if(w[G]>j6)throw Error("gb18030 decode tables conflict at byte 3");var H=this.decodeTables[j6-w[G]];for(var W=48;W<=57;W++)if(H[W]===t4)H[W]=Xm}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var X=$.encodeSkipVals[U];if(typeof X==="number")V[X]=!0;else for(var z=X.from;z<=X.to;z++)V[z]=!0}if(this._fillEncodeTable(0,0,V),$.encodeAdd){for(var D in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,D))this._setEncodeChar(D.charCodeAt(0),$.encodeAdd[D])}if(this.defCharSB=this.encodeTable[0][I.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===t4)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===t4)this.defCharSB=63}U5.prototype.encoder=eH;U5.prototype.decoder=Dj;U5.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var q=this.decodeTables[0];for(var U=I.length-1;U>0;U--){var Y=q[I[U]];if(Y==t4)q[I[U]]=j6-this.decodeTables.length,this.decodeTables.push(q=Fq.slice(0));else if(Y<=j6)q=this.decodeTables[j6-Y];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return q};U5.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),q=this._getDecodeTrieNode(I);I=I&255;for(var U=1;U<$.length;U++){var Y=$[U];if(typeof Y==="string")for(var J=0;J<Y.length;){var Q=Y.charCodeAt(J++);if(Q>=55296&&Q<56320){var K=Y.charCodeAt(J++);if(K>=56320&&K<57344)q[I++]=65536+(Q-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(Q>4080&&Q<=4095){var z=4095-Q+2,w=[];for(var G=0;G<z;G++)w.push(Y.charCodeAt(J++));q[I++]=F$-this.decodeTableSeq.length,this.decodeTableSeq.push(w)}else q[I++]=Q}else if(typeof Y==="number"){var H=q[I-1]+1;for(var J=0;J<Y;J++)q[I++]=H++}else throw Error("Incorrect type '"+typeof Y+"' given in "+this.encodingName+" at chunk "+$[0])}if(I>255)throw Error("Incorrect chunk in "+this.encodinLine truncated
\x00`,p+=p1(f,2),p+=K.magic,p+=p1(O,2),p+=p1(N,2),p+=p1(h.crc32,4),p+=p1(h.compressedSize,4),p+=p1(h.uncompressedSize,4),p+=p1(w.length,2),p+=p1(T.length,2);var C=eV.LOCAL_FILE_HEADER+p+w+T,k=eV.CENTRAL_FILE_HEADER+p1(t,2)+p+p1(W.length,2)+"\x00\x00\x00\x00"+p1(S,4)+p1(U,4)+w+T+W;return{fileRecord:C,dirRecord:k}},pk0=function($,I,q,U,Y){var J="",Q=iq.transformTo("string",Y(U));return J=eV.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+p1($,2)+p1($,2)+p1(I,4)+p1(q,4)+p1(Q.length,2)+Q,J},ck0=function($){var I="";return I=eV.DATA_DESCRIPTOR+p1($.crc32,4)+p1($.compressedSize,4)+p1($.uncompressedSize,4),I};function m$($,I,q,U){pq.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=q,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}iq.inherits(m$,pq);m$.prototype.push=function($){var I=$.meta.percent||0,q=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,pq.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:q?(I+100*(q-U-1))/q:100}})};m$.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var q=Vs($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};m$.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,q=Vs($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(q.dirRecord),I)this.push({data:ck0($),meta:{percent:100}});else{this.push({data:q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};m$.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 q=this.bytesWritten-$,U=pk0(this.dirRecords.length,q,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};m$.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};m$.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(q){I.processChunk(q)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(q){I.error(q)}),this};m$.prototype.resume=function(){if(!pq.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};m$.prototype.error=function($){var I=this._sources;if(!pq.prototype.error.call(this,$))return!1;for(var q=0;q<I.length;q++)try{I[q].error($)}catch(U){}return!0};m$.prototype.lock=function(){pq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};Ws.exports=m$});var Xs=L((ok0)=>{var dk0=YB(),lk0=Zs(),mk0=function($,I){var q=$||I,U=dk0[q];if(!U)throw Error(q+" is not a valid compression method !");return U};ok0.generateWorker=function($,I,q){var U=new lk0(I.streamFiles,q,I.platform,I.encodeFileName),Y=0;try{$.forEach(function(J,Q){Y++;var K=mk0(Q.options.compression,I.compression),z=Q.options.compressionOptions||I.compressionOptions||{},w=Q.dir,G=Q.date;Q._compressWorker(K,z).withStreamInfo("file",{name:J,dir:w,date:G,comment:Q.comment||"",unixPermissions:Q.unixPermissions,dosPermissions:Q.dosPermissions}).pipe(U)}),U.entriesCount=Y}catch(J){U.error(J)}return U}});var Os=L((Dg1,Ds)=>{var tk0=z4(),$W=I$();function $2($,I){$W.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}tk0.inherits($2,$W);$2.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(q){I.push({data:q,meta:{percent:0}})}).on("error",function(q){if(I.isPaused)this.generatedError=q;else I.error(q)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};$2.prototype.pause=function(){if(!$W.prototype.pause.call(this))return!1;return this._stream.pause(),!0};$2.prototype.resume=function(){if(!$W.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};Ds.exports=$2});var Es=L((Og1,js)=>{var ak0=_q(),I2=z4(),Ms=I$(),sk0=GE(),As=HE(),Ls=yV(),ek0=Nt(),$f0=Xs(),Ns=hQ(),If0=Os(),gs=function($,I,q){var U=I2.getTypeOf(I),Y,J=I2.extend(q||{},As);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermissions&16)J.dir=!0;if(J. Line truncated
`)}openNode($,I){let q=this.tos,U=this._xml;if(q&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),iB(U,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)O00(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");iB(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(D00.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,q){if(this.openNode($,I),q!==void 0)this.writeText(q);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("")}}pB.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};L00.exports=pB});var cB=L((lb0)=>{var N00=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function db0($){if(typeof $==="string")return $;if(N00)return N00.decode($);return $.toString()}lb0.bufferToString=db0});var P00=L((M00)=>{Object.defineProperty(M00,"__esModule",{value:!0});M00.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;M00.S=` \r
`;M00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";M00.NAME_CHAR="-"+M00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";M00.CHAR_RE=new RegExp("^["+M00.CHAR+"]$","u");M00.S_RE=new RegExp("^["+M00.S+"]+$","u");M00.NAME_START_CHAR_RE=new RegExp("^["+M00.NAME_START_CHAR+"]$","u");M00.NAME_CHAR_RE=new RegExp("^["+M00.NAME_CHAR+"]$","u");M00.NAME_RE=new RegExp("^["+M00.NAME_START_CHAR+"]["+M00.NAME_CHAR+"]*$","u");M00.NMTOKEN_RE=new RegExp("^["+M00.NAME_CHAR+"]+$","u");var dB=9,lB=10,mB=13,oB=32;M00.S_LIST=[oB,lB,mB,dB];function ob0($){return $>=oB&&$<=55295||$===lB||$===mB||$===dB||$>=57344&&$<=65533||$>=65536&&$<=1114111}M00.isChar=ob0;function rb0($){return $===oB||$===lB||$===mB||$===dB}M00.isS=rb0;function F00($){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}M00.isNameStartChar=F00;function tb0($){return F00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}M00.isNameChar=tb0});var S00=L((R00)=>{Object.defineProperty(R00,"__esModule",{value:!0});R00.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";R00.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";R00.S=` \r
`;R00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";R00.NAME_CHAR="-"+R00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";R00.CHAR_RE=new RegExp("^["+R00.CHAR+"]$","u");R00.RESTRICTED_CHAR_RE=new RegExp("^["+R00.RESTRICTED_CHAR+"]$","u");R00.S_RE=new RegExp("^["+R00.S+"]+$","u");R00.NAME_START_CHAR_RE=new RegExp("^["+R00.NAME_START_CHAR+"]$","u");R00.NAME_CHAR_RE=new RegExp("^["+R00.NAME_CHAR+"]$","u");R00.NAME_RE=new RegExp("^["+R00.NAME_START_CHAR+"]["+R00.NAME_CHAR+"]*$","u");R00.NMTOKEN_RE=new RegExp("^["+R00.NAME_CHAR+"]+$","u");var T00=9,j00=10,E00=13,B00=32;R00.S_LIST=[B00,j00,E00,T00];function zi0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}R00.isChar=zi0;function wi0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}R00.isRestrictedChar=wi0;function Gi0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}R00.isCharAndNotRestricted=Gi0;function Hi0($){return $===B00||$===j00||$===E00||$===T00}R00.isS=Hi0;function v00($){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}R00.isNameStartChar=v00;function Vi0($){return v00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}R00.isNameChar=Vi0});var x00=L((u00)=>{Object.defineProperty(u00,"__esModule",{value:!0});u00.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";u00.NC_NAME_CHAR="-"+u00.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";u00.NC_NAME_START_CHAR_RE=new RegExp("^["+u00.NC_NAME_START_CHAR+"]$","u");u00.NC_NAME_CHAR_RE=new RegExp("^["+u00.NC_NAME_CHAR+"]$","u");u00.NC_NAME_RE=new RegExp("^["+u00.NC_NAME_START_CHAR+"]["+u00.NC_NAME_CHAR+"]*$","u");function y00($){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}u00.isNCNameStartChar=y00;function Ei0($){return y00($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}u00.isNCNameChar=Ei0});var J10=L((Y10)=>{Object.defineProperty(Y10,"__esModule",{value:!0});var $U=P00(),hi0=S00(),zv=x00(),p6=$U.isS,Si0=$U.isChar,Z2=$U.isNameStartChar,k00=$U.isNameChar,s00=$U.S_LIST,yi0=$U.NAME_RE,ui0=hi0.isChar,xi0=zv.isNCNameStartChar,ki0=zv.isNCNameChar,fi0=zv.NC_NAME_RE,vW="http://www.w3.org/XML/1998/namespace",eq="http://www.w3.org/2000/xmlns/",ni0={__proto__:null,xml:vW,xmlns:eq},bi0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},U4=-1,B8=-2,f00=0,ii0=1,tB=2,pi0=3,tq=4,ci0=5,di0=6,li0=7,aB=8,mi0=9,oi0=10,ri0=11,ti0=12,B6=13,PW=14,sB=15,ai0=16,eB=17,si0=18,ei0=19,$v=20,$p0=21,Ip0=22,qp0=23,n00=24,Iv=25,TW=26,b00=27,Up0=28,Yp0=29,i00=30,Jp0=31,Qp0=32,J3=33,Kp0=34,qv=35,X2=36,Uv=37,zp0=38,p00=39,c00=40,wp0=41,d00=42,Gp0=43,Hp0=44,Yv=9,r$=10,Jv=13,l00=32,m00=33,e00=34,D2=38,$10=39,jW=45,EW=47,Vp0=59,R9=60,aq=61,_4=62,$6=63,I10=91,sq=93,o00=133,r00=8232,BW=($)=>$===e00||$===$10,q10=[e00,$10],Wp0=[...q10,I10,_4],Zp0=[...q10,R9,sq],Xp0=[aq,$6,...s00],Dp0=[...s00,_4,D2,R9];function Kv($,I,q){switch(I){case"xml":if(q!==vW)$.fail(`xml prefix must be bound to ${vW}.`);break;case"xmlns":if(q!==eq)$.fail(`xmlns prefix must be bound to ${eq}.`);break;default:}switch(q){case eq:$.fail(I===""?`the default namespace may not be set to ${q}.`:`may not assign a prefix (even "xmlns") to the URI ${eq}.`);break;case vW:switch(I){case"xml":break;case"":$.fail(`the default namespace may not be set to ${q}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function Op0($,I){for(let q of Object.keys(I))Kv($,q,I[q])}var Lp0=($)=>fi0.test($),Np0=($)=>yi0.test($),Q3=0,t00=1,Qv=2;Y10.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var a00={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 U10{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=xi0,this.nameCheck=ki0,this.isName=Lp0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},ni0);let q=this.opt.additionalNamesp Line truncated
`,I=this.i}}captureToChar($){let{i:I}=this,{chunk:q}=this;while(!0){let U=this.getCode();switch(U){case B8:this.text+=`${q.slice(I,this.prevI)}
`,I=this.i,U=r$;break;case U4:return this.text+=q.slice(I),!1;default:}if(U===$)return this.text+=q.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let q=this.getCode();if(q===U4)return this.name+=$.slice(I),U4;if(!k00(q))return this.name+=$.slice(I,this.prevI),q===B8?r$:q}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===U4||!p6($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=Si0,this.getCode=this.getCode10;else this.isChar=ui0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=ii0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case R9:if(this.state=sB,this.text.length!==0)throw Error("no-empty text at start");break;case U4:break;default:this.unget(),this.state=B6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(Wp0);switch(I){case _4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=B6,this.doctype=!0;break}case U4:break;default:if(this.text+=String.fromCodePoint(I),I===I10)this.state=tq;else if(BW(I))this.state=pi0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=tB}sDTD(){let $=this.captureTo(Zp0);if($===U4)return;if(this.text+=String.fromCodePoint($),$===sq)this.state=tB;else if($===R9)this.state=di0;else if(BW($))this.state=ci0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=tq,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case m00:this.state=li0,this.openWakaBang="";break;case $6:this.state=ri0;break;default:this.state=tq}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?aB:tq,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(jW))this.text+="-",this.state=mi0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===jW?oi0:aB}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===_4)this.state=tq;else this.fail("malformed comment."),this.state=aB}sDTDPI(){if(this.captureToChar($6))this.text+="?",this.state=ti0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===_4)this.state=tq}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case B8:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case Vp0:{let{entityReturnState:q}=this,U=this.entity+I.slice($,this.prevI);this.state=q;let Y;if(U==="")this.fail("empty entity name."),Y="&;";else Y=this.parseEntity(U),this.entity="";if(q!==B6||this.textHandler!==void 0)this.text+=Y;break $}case U4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(Z2($))this.state=Kp0,this.unget(),this.xmlDeclPossible=!1;else switch($){case EW:this.state=Gp0,this.xmlDeclPossible=!1;break;case m00:this.state=ai0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case $6:this.state=qp0;break;default:this.fail("disallowed character in tag name"),this.state=B6,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=$v,this.openWakaBang="";break;case"--":this.state=eB,this.openWakaBang="";break;case"DOCTYPE":if(this.state=tB,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(jW))this.state=si0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===jW)this.state=ei0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=eB}sCommentEnded(){let $=this.getCodeNorm();if($!==_4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=eB;else this.state=B6}sCData(){if(this.captureToChar(sq))this.state=$p0}sCDataEnding(){let $=this.getCodeNorm();if($===sq)this.state=Ip0;else this.text+=`]${String.fromCodePoint($)}`,this.state=$v}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case _4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=B6;break}case sq:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=$v}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=n00;else if($===$6||p6($))this.fail("processing instruction without a target."),this.state=$===$6?TW:Iv;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=n00}sPIRest(){let{chunk:$,i:I}=this;while(!0){let q=this.getCodeNorm();if(q===U4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(q)){this.piTarget+=$.slice(I,this.prevI);let U=q===$6;if(U||p6(q))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?J3:b00}else this.state=U?TW:Iv;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(q);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===$6)this.state=TW;else if(!p6($))this.text=String.fromCodePoint($)}else if(this.captureToChar($6))this.state=TW}sPIEnding(){var $;let I=this.getCodeNorm();if(I===_4){let{piTarget:q}=this;if(q.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:q,body:this.text}),this.piTarget=this.text="",this.state=B6}else if(I===$6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=Iv;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===$6){this.state=J3;return}if($!==U4)this.state=Up0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(Xp0);if($===$6){this.state=J3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p6($)||$===aq))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=$===aq?i00:Yp0}sXMLDeclEq(){let $=this.getCodeNorm();if($===$6){this.state=J3,this.fail("XML declaration is incomplete.");return}if(p6($))return;if($!==aq)this.fail("value required.");this.state=i00}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===$6){this.state=J3,this.fail("XML declaration is incomplete.");return}if(p6($))return;if(!BW($))this.fail("value must be quoted."),this.q=l00;else this.q=$;this.state=Jp0}sXMLDeclValue(){let $=this.captureTo([this.q,$6]);if($===$6){this.state=J3,this.text="",this.fail("XML declaration is incomplete.");return}if($===U4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let q=I;if(this.xmlDecl.version=q,!/^1\.[0-9]+$/.test(q))this.fail("ver Line truncated
`;$=this.i,I=Q3;break;case U4:if(U!==void 0)this.text+=q.slice($);break $;default:I=Q3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:q}=this,U=!1;$:while(!0){let Y=this.getCode();switch(Y){case R9:{if(this.state=sB,q!==void 0){let{text:J}=this,Q=I.slice($,this.prevI);if(J.length!==0)q(J+Q),this.text="";else if(Q.length!==0)q(Q)}break $}case D2:if(this.state=PW,this.entityReturnState=B6,q!==void 0)this.text+=I.slice($,this.prevI);U=!0;break $;case B8:if(q!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case U4:if(q!==void 0)this.text+=I.slice($);break $;default:if(!p6(Y))U=!0}}if(!U)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 q;let{prefix:U,local:Y}=this.qname($),J={name:$,prefix:U,local:Y,value:I};if(this.attribList.push(J),(q=this.attributeHandler)===null||q===void 0||q.call(this,J),U==="xmlns"){let Q=I.trim();if(this.currentXMLVersion==="1.0"&&Q==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[Y]=Q,Kv(this,Y,Q)}else if($==="xmlns"){let Q=I.trim();this.topNS[""]=Q,Kv(this,"",Q)}}pushAttribPlain($,I){var q;let U={name:$,value:I};this.attribList.push(U),(q=this.attributeHandler)===null||q===void 0||q.call(this,U)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:q}=this;while(q.length>0){let Y=q.pop();this.fail(`unclosed tag: ${Y.name}`)}if(this.state!==f00&&this.state!==B6)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,q;let U=this.topNS[$];if(U!==void 0)return U;let{tags:Y}=this;for(let J=Y.length-1;J>=0;J--)if(U=Y[J].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(q=(I=this.opt).resolvePrefix)===null||q===void 0?void 0:q.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let q=$.slice(I+1),U=$.slice(0,I);if(U===""||q===""||q.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:q}}processAttribsNS(){var $;let{attribList:I}=this,q=this.tag;{let{prefix:J,local:Q}=this.qname(q.name);q.prefix=J,q.local=Q;let K=q.uri=($=this.resolve(J))!==null&&$!==void 0?$:"";if(J!==""){if(J==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(J)}.`),q.uri=J}}if(I.length===0)return;let{attributes:U}=q,Y=new Set;for(let J of I){let{name:Q,prefix:K,local:z}=J,w,G;if(K==="")w=Q==="xmlns"?eq:"",G=Q;else{if(w=this.resolve(K),w===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),w=K;G=`{${w}}${z}`}if(Y.has(G))this.fail(`duplicate attribute: ${G}.`);Y.add(G),J.uri=w,U[Q]=J}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:q,value:U}of $){if(I[q]!==void 0)this.fail(`duplicate attribute: ${q}.`);I[q]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,q=this.tag;q.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,q),I.push(q),this.state=B6,this.name=""}openSelfClosingTag(){var $,I,q;this.processAttribs();let{tags:U}=this,Y=this.tag;if(Y.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,Y),(I=this.closeTagHandler)===null||I===void 0||I.call(this,Y),(this.tag=(q=U[U.length-1])!==null&&q!==void 0?q:null)===null)this.closedRoot=!0;this.state=B6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=B6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let q=this.closeTagHandler,U=$.length;while(U-- >0){let Y=this.tag=$.pop();if(this.topNS=Y.ns,q===null||q===void 0||q(Y),Y.name===I)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}parseEntity($){if($[0]!=="#"){let q=this.ENTITIES[$];if(q!==void 0)return q;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)}}Y10.SaxesParser=U10});var O2=L(($P1,Q10)=>{var{SaxesParser:Ap0}=J10(),{PassThrough:gp0}=W6(),{bufferToString:Pp0}=cB();Q10.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new gp0);let I=new Ap0,q;I.on("error",(Y)=>{q=Y});let U=[];I.on("opentag",(Y)=>U.push({eventType:"opentag",value:Y})),I.on("text",(Y)=>U.push({eventType:"text",value:Y})),I.on("closetag",(Y)=>U.push({eventType:"closetag",value:Y}));for await(let Y of $){if(I.write(Pp0(Y)),q)throw q;yield U,U=[]}}});var Z0=L((IP1,K10)=>{var Tp0=O2(),jp0=e4();class IU{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof IU)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:q,value:U}of I)if(q==="opentag")this.parseOpen(U);else if(q==="text")this.parseText(U);else if(q==="closetag"){if(!this.parseClose(U.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}`}}x90.FormatterOptions=u90});var zZ=L((jj1,i90)=>{var ur0="[object AsyncFunction]",xr0="[object Function]",kr0="[object GeneratorFunction]",fr0="[object Null]",nr0="[object Proxy]",br0="[object Undefined]",ir0=typeof global=="object"&&global&&global.Object===Object&&global,pr0=typeof self=="object"&&self&&self.Object===Object&&self,cr0=ir0||pr0||Function("return this")(),n90=Object.prototype,dr0=n90.hasOwnProperty,b90=n90.toString,f90=cr0.Symbol,W3=f90?f90.toStringTag:void 0;function lr0($){if($==null)return $===void 0?br0:fr0;return W3&&W3 in Object($)?mr0($):or0($)}function mr0($){var I=dr0.call($,W3),q=$[W3];try{$[W3]=void 0;var U=!0}catch(J){}var Y=b90.call($);if(U)if(I)$[W3]=q;else delete $[W3];return Y}function or0($){return b90.call($)}function rr0($){if(!tr0($))return!1;var I=lr0($);return I==xr0||I==kr0||I==ur0||I==nr0}function tr0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}i90.exports=rr0});var g70=L((wZ,HU)=>{var ar0=200,CR="__lodash_hash_undefined__",OZ=1,$70=2,I70=9007199254740991,GZ="[object Arguments]",PR="[object Array]",sr0="[object AsyncFunction]",q70="[object Boolean]",U70="[object Date]",Y70="[object Error]",J70="[object Function]",er0="[object GeneratorFunction]",HZ="[object Map]",Q70="[object Number]",$t0="[object Null]",GU="[object Object]",p90="[object Promise]",It0="[object Proxy]",K70="[object RegExp]",VZ="[object Set]",z70="[object String]",qt0="[object Symbol]",Ut0="[object Undefined]",TR="[object WeakMap]",w70="[object ArrayBuffer]",WZ="[object DataView]",Yt0="[object Float32Array]",Jt0="[object Float64Array]",Qt0="[object Int8Array]",Kt0="[object Int16Array]",zt0="[object Int32Array]",wt0="[object Uint8Array]",Gt0="[object Uint8ClampedArray]",Ht0="[object Uint16Array]",Vt0="[object Uint32Array]",Wt0=/[\\^$.*+?()[\]{}|]/g,Zt0=/^\[object .+?Constructor\]$/,Xt0=/^(?:0|[1-9]\d*)$/,m1={};m1[Yt0]=m1[Jt0]=m1[Qt0]=m1[Kt0]=m1[zt0]=m1[wt0]=m1[Gt0]=m1[Ht0]=m1[Vt0]=!0;m1[GZ]=m1[PR]=m1[w70]=m1[q70]=m1[WZ]=m1[U70]=m1[Y70]=m1[J70]=m1[HZ]=m1[Q70]=m1[GU]=m1[K70]=m1[VZ]=m1[z70]=m1[TR]=!1;var G70=typeof global=="object"&&global&&global.Object===Object&&global,Dt0=typeof self=="object"&&self&&self.Object===Object&&self,O5=G70||Dt0||Function("return this")(),H70=typeof wZ=="object"&&wZ&&!wZ.nodeType&&wZ,c90=H70&&typeof HU=="object"&&HU&&!HU.nodeType&&HU,V70=c90&&c90.exports===H70,MR=V70&&G70.process,d90=function(){try{return MR&&MR.binding&&MR.binding("util")}catch($){}}(),l90=d90&&d90.isTypedArray;function Ot0($,I){var q=-1,U=$==null?0:$.length,Y=0,J=[];while(++q<U){var Q=$[q];if(I(Q,q,$))J[Y++]=Q}return J}function Lt0($,I){var q=-1,U=I.length,Y=$.length;while(++q<U)$[Y+q]=I[q];return $}function Nt0($,I){var q=-1,U=$==null?0:$.length;while(++q<U)if(I($[q],q,$))return!0;return!1}function Ft0($,I){var q=-1,U=Array($);while(++q<$)U[q]=I(q);return U}function Mt0($){return function(I){return $(I)}}function At0($,I){return $.has(I)}function gt0($,I){return $==null?void 0:$[I]}function Pt0($){var I=-1,q=Array($.size);return $.forEach(function(U,Y){q[++I]=[Y,U]}),q}function Tt0($,I){return function(q){return $(I(q))}}function jt0($){var I=-1,q=Array($.size);return $.forEach(function(U){q[++I]=U}),q}var Et0=Array.prototype,Bt0=Function.prototype,LZ=Object.prototype,AR=O5["__core-js_shared__"],W70=Bt0.toString,R8=LZ.hasOwnProperty,m90=function(){var $=/[^.]+$/.exec(AR&&AR.keys&&AR.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),Z70=LZ.toString,vt0=RegExp("^"+W70.call(R8).replace(Wt0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),o90=V70?O5.Buffer:void 0,ZZ=O5.Symbol,r90=O5.Uint8Array,X70=LZ.propertyIsEnumerable,Rt0=Et0.splice,Z3=ZZ?ZZ.toStringTag:void 0,t90=Object.getOwnPropertySymbols,Ct0=o90?o90.isBuffer:void 0,_t0=Tt0(Object.keys,Object),jR=VU(O5,"DataView"),P2=VU(O5,"Map"),ER=VU(O5,"Promise"),BR=VU(O5,"Set"),vR=VU(O5,"WeakMap"),T2=VU(Object,"create"),ht0=O3(jR),St0=O3(P2),yt0=O3(ER),ut0=O3(BR),xt0=O3(vR),a90=ZZ?ZZ.prototype:void 0,gR=a90?a90.valueOf:void 0;function X3($){var I=-1,q=$==null?0:$.length;this.clear();while(++I<q){var U=$[I];this.set(U[0],U[1])}}function kt0(){this.__data__=T2?T2(null):{},this.size=0}function ft0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function nt0($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let q=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(la0.default(q))return q;if(Array.isArray(q))return q[$];if(this._headers!==null)return q[this._headers[$]];return!1}format($,I,q){let U=`${ma0.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:Y}=this;if(Y.quote!==""){if(U.indexOf(Y.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,Y.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,q))return this.quoteField(U);return U}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}WU.FieldFormatter=_70});var uR=L((h70)=>{Object.defineProperty(h70,"__esModule",{value:!0});h70.isSyncTransform=void 0;h70.isSyncTransform=($)=>$.length===1});var u70=L((ZU)=>{var y70=ZU&&ZU.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(ZU,"__esModule",{value:!0});ZU.RowFormatter=void 0;var ra0=y70(zZ()),ta0=y70(g70()),aa0=yR(),sa0=uR();class L3{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new aa0.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(L3.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(sa0.isSyncTransform($))return(I,q)=>{let U=null;try{U=$(I)}catch(Y){return q(Y)}return q(null,U)};return(I,q)=>{$(I,q)}}set rowTransform($){if(!ra0.default($))throw TypeError("The transform should be a function");this._rowTransform=L3.createTransform($)}format($,I){this.callTransformer($,(q,U)=>{if(q)return I(q);if(!$)return I(null);let Y=[];if(U){let{shouldFormatColumns:J,headers:Q}=this.checkHeaders(U);if(this.shouldWriteHeaders&&Q&&!this.hasWrittenHeaders)Y.push(this.formatColumns(Q,!0)),this.hasWrittenHeaders=!0;if(J){let K=this.gatherColumns(U);Y.push(this.formatColumns(K,!1))}}return I(null,Y)})}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=L3.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!ta0.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(L3.isRowHashArray($))return this.headers.map((I,q)=>{let U=$[q];if(U)return U[1];return""});if(L3.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,q)=>$[q])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let q=$.map((Y,J)=>this.fieldFormatter.format(Y,J,I)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,q].join("");return q}}ZU.RowFormatter=L3});var x70=L((MZ)=>{Object.defineProperty(MZ,"__esModule",{value:!0});MZ.FieldFormatter=MZ.RowFormatter=void 0;var ea0=u70();Object.defineProperty(MZ,"RowFormatter",{enumerable:!0,get:function(){return ea0.RowFormatter}});var $s0=yR();Object.defineProperty(MZ,"FieldFormatter",{enumerable:!0,get:function(){return $s0.FieldFormatter}})});var xR=L((f70)=>{Object.defineProperty(f70,"__esModule",{value:!0});f70.CsvFormatterStream=void 0;var qs0=o("stream"),Us0=x70();class k70 extends qs0.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new Us0.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,q){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(Y,J)=>{if(Y)return U=!0,q(Y);if(J)J.forEach((Q)=>{this.push(Buffer.from(Q,"utf8"))});return U=!0,q()})}catch(Y){if(U)throw Y;q(Y)}}_flush($){this.rowFormatter.finish((I,q)=>{if(I)return $(I);if(q)q.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}f70.CsvFormatterStream=k70});var i70=L((D1)=>{var b70=D1&&D1.__createBinding||(Object.create?function($,I,q,U){if(U===void 0)U=q;Object.defineProperty($,U,{enumerable:!0,get:function(){return I[q]}})}:function($,I,q,U){if(U===void 0)U=q;$[U]=I[q]}),Ys0=D1&&D1.__setModuleDefault||(Object.create?function($,I){Ob Line 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 hm=L((Q_0)=>{var jE=Q5().Buffer;Q_0._dbcs=w5;var a4=-1,_m=-2,A$=-10,j6=-1000,Aq=Array(256),DQ=-1;for(XQ=0;XQ<256;XQ++)Aq[XQ]=a4;var XQ;function w5($,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 q=$.table();this.decodeTables=[],this.decodeTables[0]=Aq.slice(0),this.decodeTableSeq=[];for(var U=0;U<q.length;U++)this._addDecodeChunk(q[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var Y=this.decodeTables.length;this.decodeTables.push(Aq.slice(0));var J=this.decodeTables.length;this.decodeTables.push(Aq.slice(0));var Q=this.decodeTables[0];for(var U=129;U<=254;U++){var K=this.decodeTables[j6-Q[U]];for(var w=48;w<=57;w++){if(K[w]===a4)K[w]=j6-Y;else if(K[w]>j6)throw Error("gb18030 decode tables conflict at byte 2");var z=this.decodeTables[j6-K[w]];for(var G=129;G<=254;G++){if(z[G]===a4)z[G]=j6-J;else if(z[G]===j6-J)continue;else if(z[G]>j6)throw Error("gb18030 decode tables conflict at byte 3");var H=this.decodeTables[j6-z[G]];for(var V=48;V<=57;V++)if(H[V]===a4)H[V]=_m}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var W={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var X=$.encodeSkipVals[U];if(typeof X==="number")W[X]=!0;else for(var w=X.from;w<=X.to;w++)W[w]=!0}if(this._fillEncodeTable(0,0,W),$.encodeAdd){for(var D in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,D))this._setEncodeChar(D.charCodeAt(0),$.encodeAdd[D])}if(this.defCharSB=this.encodeTable[0][I.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===a4)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===a4)this.defCharSB=63}w5.prototype.encoder=YV;w5.prototype.decoder=BE;w5.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var q=this.decodeTables[0];for(var U=I.length-1;U>0;U--){var Y=q[I[U]];if(Y==a4)q[I[U]]=j6-this.decodeTables.length,this.decodeTables.push(q=Aq.slice(0));else if(Y<=j6)q=this.decodeTables[j6-Y];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return q};w5.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),q=this._getDecodeTrieNode(I);I=I&255;for(var U=1;U<$.length;U++){var Y=$[U];if(typeof Y==="string")for(var J=0;J<Y.length;){var Q=Y.charCodeAt(J++);if(Q>=55296&&Q<56320){var K=Y.charCodeAt(J++);if(K>=56320&&K<57344)q[I++]=65536+(Q-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(Q>4080&&Q<=4095){var w=4095-Q+2,z=[];for(var G=0;G<w;G++)z.push(Y.charCodeAt(J++));q[I++]=A$-this.decodeTableSeq.length,this.decodeTableSeq.push(z)}else q[I++]=Q}else if(typeof Y==="number"){var H=q[I-1]+1;for(var J=0;J<Y;J++)q[I++]=H++}else throw Error("Incorrect type '"+typeof Y+"' given in "+this.encodingName+" at chunk "+$[0])}if(I>255)throw Error("Incorrect chunk in "+this.encodinLine truncated
\x00`,p+=p1(f,2),p+=K.magic,p+=p1(O,2),p+=p1(N,2),p+=p1(h.crc32,4),p+=p1(h.compressedSize,4),p+=p1(h.uncompressedSize,4),p+=p1(z.length,2),p+=p1(T.length,2);var C=YW.LOCAL_FILE_HEADER+p+z+T,n=YW.CENTRAL_FILE_HEADER+p1(t,2)+p+p1(V.length,2)+"\x00\x00\x00\x00"+p1(S,4)+p1(U,4)+z+T+V;return{fileRecord:C,dirRecord:n}},Vf0=function($,I,q,U,Y){var J="",Q=cq.transformTo("string",Y(U));return J=YW.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+p1($,2)+p1($,2)+p1(I,4)+p1(q,4)+p1(Q.length,2)+Q,J},Wf0=function($){var I="";return I=YW.DATA_DESCRIPTOR+p1($.crc32,4)+p1($.compressedSize,4)+p1($.uncompressedSize,4),I};function o$($,I,q,U){dq.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=q,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}cq.inherits(o$,dq);o$.prototype.push=function($){var I=$.meta.percent||0,q=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,dq.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:q?(I+100*(q-U-1))/q:100}})};o$.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var q=vs($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};o$.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,q=vs($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(q.dirRecord),I)this.push({data:Wf0($),meta:{percent:100}});else{this.push({data:q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};o$.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 q=this.bytesWritten-$,U=Vf0(this.dirRecords.length,q,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};o$.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};o$.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(q){I.processChunk(q)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(q){I.error(q)}),this};o$.prototype.resume=function(){if(!dq.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};o$.prototype.error=function($){var I=this._sources;if(!dq.prototype.error.call(this,$))return!1;for(var q=0;q<I.length;q++)try{I[q].error($)}catch(U){}return!0};o$.prototype.lock=function(){dq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};Rs.exports=o$});var _s=L((Of0)=>{var Zf0=DB(),Xf0=Cs(),Df0=function($,I){var q=$||I,U=Zf0[q];if(!U)throw Error(q+" is not a valid compression method !");return U};Of0.generateWorker=function($,I,q){var U=new Xf0(I.streamFiles,q,I.platform,I.encodeFileName),Y=0;try{$.forEach(function(J,Q){Y++;var K=Df0(Q.options.compression,I.compression),w=Q.options.compressionOptions||I.compressionOptions||{},z=Q.dir,G=Q.date;Q._compressWorker(K,w).withStreamInfo("file",{name:J,dir:z,date:G,comment:Q.comment||"",unixPermissions:Q.unixPermissions,dosPermissions:Q.dosPermissions}).pipe(U)}),U.entriesCount=Y}catch(J){U.error(J)}return U}});var Ss=L((lg1,hs)=>{var Nf0=z4(),JW=q$();function q2($,I){JW.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Nf0.inherits(q2,JW);q2.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(q){I.push({data:q,meta:{percent:0}})}).on("error",function(q){if(I.isPaused)this.generatedError=q;else I.error(q)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};q2.prototype.pause=function(){if(!JW.prototype.pause.call(this))return!1;return this._stream.pause(),!0};q2.prototype.resume=function(){if(!JW.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};hs.exports=q2});var cs=L((mg1,ps)=>{var Ff0=Sq(),U2=z4(),ks=q$(),Mf0=Aj(),fs=gj(),ys=nV(),Af0=ut(),gf0=_s(),us=yQ(),Pf0=Ss(),ns=function($,I,q){var U=U2.getTypeOf(I),Y,J=U2.extend(q||{},fs);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermissions&16)J.dir=!0;if(J. Line truncated
`)}openNode($,I){let q=this.tos,U=this._xml;if(q&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),$v(U,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)S00(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");$v(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(h00.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,q){if(this.openNode($,I),q!==void 0)this.writeText(q);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("")}}Iv.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};y00.exports=Iv});var qv=L((Xb0)=>{var u00=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Zb0($){if(typeof $==="string")return $;if(u00)return u00.decode($);return $.toString()}Xb0.bufferToString=Zb0});var i00=L((k00)=>{Object.defineProperty(k00,"__esModule",{value:!0});k00.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;k00.S=` \r
`;k00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";k00.NAME_CHAR="-"+k00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";k00.CHAR_RE=new RegExp("^["+k00.CHAR+"]$","u");k00.S_RE=new RegExp("^["+k00.S+"]+$","u");k00.NAME_START_CHAR_RE=new RegExp("^["+k00.NAME_START_CHAR+"]$","u");k00.NAME_CHAR_RE=new RegExp("^["+k00.NAME_CHAR+"]$","u");k00.NAME_RE=new RegExp("^["+k00.NAME_START_CHAR+"]["+k00.NAME_CHAR+"]*$","u");k00.NMTOKEN_RE=new RegExp("^["+k00.NAME_CHAR+"]+$","u");var Uv=9,Yv=10,Jv=13,Qv=32;k00.S_LIST=[Qv,Yv,Jv,Uv];function Ob0($){return $>=Qv&&$<=55295||$===Yv||$===Jv||$===Uv||$>=57344&&$<=65533||$>=65536&&$<=1114111}k00.isChar=Ob0;function Lb0($){return $===Qv||$===Yv||$===Jv||$===Uv}k00.isS=Lb0;function x00($){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}k00.isNameStartChar=x00;function Nb0($){return x00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}k00.isNameChar=Nb0});var a00=L((m00)=>{Object.defineProperty(m00,"__esModule",{value:!0});m00.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";m00.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";m00.S=` \r
`;m00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";m00.NAME_CHAR="-"+m00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";m00.CHAR_RE=new RegExp("^["+m00.CHAR+"]$","u");m00.RESTRICTED_CHAR_RE=new RegExp("^["+m00.RESTRICTED_CHAR+"]$","u");m00.S_RE=new RegExp("^["+m00.S+"]+$","u");m00.NAME_START_CHAR_RE=new RegExp("^["+m00.NAME_START_CHAR+"]$","u");m00.NAME_CHAR_RE=new RegExp("^["+m00.NAME_CHAR+"]$","u");m00.NAME_RE=new RegExp("^["+m00.NAME_START_CHAR+"]["+m00.NAME_CHAR+"]*$","u");m00.NMTOKEN_RE=new RegExp("^["+m00.NAME_CHAR+"]+$","u");var b00=9,p00=10,c00=13,d00=32;m00.S_LIST=[d00,p00,c00,b00];function Cb0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}m00.isChar=Cb0;function _b0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}m00.isRestrictedChar=_b0;function hb0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}m00.isCharAndNotRestricted=hb0;function Sb0($){return $===d00||$===p00||$===c00||$===b00}m00.isS=Sb0;function l00($){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}m00.isNameStartChar=l00;function yb0($){return l00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}m00.isNameChar=yb0});var $10=L((e00)=>{Object.defineProperty(e00,"__esModule",{value:!0});e00.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";e00.NC_NAME_CHAR="-"+e00.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";e00.NC_NAME_START_CHAR_RE=new RegExp("^["+e00.NC_NAME_START_CHAR+"]$","u");e00.NC_NAME_CHAR_RE=new RegExp("^["+e00.NC_NAME_CHAR+"]$","u");e00.NC_NAME_RE=new RegExp("^["+e00.NC_NAME_START_CHAR+"]["+e00.NC_NAME_CHAR+"]*$","u");function s00($){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}e00.isNCNameStartChar=s00;function tb0($){return s00($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}e00.isNCNameChar=tb0});var A10=L((M10)=>{Object.defineProperty(M10,"__esModule",{value:!0});var qU=i00(),qp0=a00(),Fv=$10(),c6=qU.isS,Up0=qU.isChar,D2=qU.isNameStartChar,I10=qU.isNameChar,X10=qU.S_LIST,Yp0=qU.NAME_RE,Jp0=qp0.isChar,Qp0=Fv.isNCNameStartChar,Kp0=Fv.isNCNameChar,wp0=Fv.NC_NAME_RE,SW="http://www.w3.org/XML/1998/namespace",IU="http://www.w3.org/2000/xmlns/",zp0={__proto__:null,xml:SW,xmlns:IU},Gp0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},Y4=-1,R8=-2,q10=0,Hp0=1,wv=2,Vp0=3,sq=4,Wp0=5,Zp0=6,Xp0=7,zv=8,Dp0=9,Op0=10,Lp0=11,Np0=12,v6=13,vW=14,Gv=15,Fp0=16,Hv=17,Mp0=18,Ap0=19,Vv=20,gp0=21,Pp0=22,Tp0=23,U10=24,Wv=25,RW=26,Y10=27,Ep0=28,jp0=29,J10=30,Bp0=31,vp0=32,K3=33,Rp0=34,Zv=35,O2=36,Xv=37,Cp0=38,Q10=39,K10=40,_p0=41,w10=42,hp0=43,Sp0=44,Dv=9,t$=10,Ov=13,z10=32,G10=33,D10=34,L2=38,O10=39,CW=45,_W=47,yp0=59,h9=60,eq=61,h4=62,I6=63,L10=91,$U=93,H10=133,V10=8232,hW=($)=>$===D10||$===O10,N10=[D10,O10],up0=[...N10,L10,h4],xp0=[...N10,h9,$U],kp0=[eq,I6,...X10],fp0=[...X10,h4,L2,h9];function Nv($,I,q){switch(I){case"xml":if(q!==SW)$.fail(`xml prefix must be bound to ${SW}.`);break;case"xmlns":if(q!==IU)$.fail(`xmlns prefix must be bound to ${IU}.`);break;default:}switch(q){case IU:$.fail(I===""?`the default namespace may not be set to ${q}.`:`may not assign a prefix (even "xmlns") to the URI ${IU}.`);break;case SW:switch(I){case"xml":break;case"":$.fail(`the default namespace may not be set to ${q}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function np0($,I){for(let q of Object.keys(I))Nv($,q,I[q])}var ip0=($)=>wp0.test($),bp0=($)=>Yp0.test($),w3=0,W10=1,Lv=2;M10.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var Z10={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 F10{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=Qp0,this.nameCheck=Kp0,this.isName=ip0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},zp0);let q=this.opt.additionalNamesp Line truncated
`,I=this.i}}captureToChar($){let{i:I}=this,{chunk:q}=this;while(!0){let U=this.getCode();switch(U){case R8:this.text+=`${q.slice(I,this.prevI)}
`,I=this.i,U=t$;break;case Y4:return this.text+=q.slice(I),!1;default:}if(U===$)return this.text+=q.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let q=this.getCode();if(q===Y4)return this.name+=$.slice(I),Y4;if(!I10(q))return this.name+=$.slice(I,this.prevI),q===R8?t$:q}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===Y4||!c6($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=Up0,this.getCode=this.getCode10;else this.isChar=Jp0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Hp0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case h9:if(this.state=Gv,this.text.length!==0)throw Error("no-empty text at start");break;case Y4:break;default:this.unget(),this.state=v6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(up0);switch(I){case h4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=v6,this.doctype=!0;break}case Y4:break;default:if(this.text+=String.fromCodePoint(I),I===L10)this.state=sq;else if(hW(I))this.state=Vp0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=wv}sDTD(){let $=this.captureTo(xp0);if($===Y4)return;if(this.text+=String.fromCodePoint($),$===$U)this.state=wv;else if($===h9)this.state=Zp0;else if(hW($))this.state=Wp0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=sq,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case G10:this.state=Xp0,this.openWakaBang="";break;case I6:this.state=Lp0;break;default:this.state=sq}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?zv:sq,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(CW))this.text+="-",this.state=Dp0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===CW?Op0:zv}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===h4)this.state=sq;else this.fail("malformed comment."),this.state=zv}sDTDPI(){if(this.captureToChar(I6))this.text+="?",this.state=Np0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===h4)this.state=sq}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case R8:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case yp0:{let{entityReturnState:q}=this,U=this.entity+I.slice($,this.prevI);this.state=q;let Y;if(U==="")this.fail("empty entity name."),Y="&;";else Y=this.parseEntity(U),this.entity="";if(q!==v6||this.textHandler!==void 0)this.text+=Y;break $}case Y4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(D2($))this.state=Rp0,this.unget(),this.xmlDeclPossible=!1;else switch($){case _W:this.state=hp0,this.xmlDeclPossible=!1;break;case G10:this.state=Fp0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case I6:this.state=Tp0;break;default:this.fail("disallowed character in tag name"),this.state=v6,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=Vv,this.openWakaBang="";break;case"--":this.state=Hv,this.openWakaBang="";break;case"DOCTYPE":if(this.state=wv,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(CW))this.state=Mp0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===CW)this.state=Ap0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=Hv}sCommentEnded(){let $=this.getCodeNorm();if($!==h4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=Hv;else this.state=v6}sCData(){if(this.captureToChar($U))this.state=gp0}sCDataEnding(){let $=this.getCodeNorm();if($===$U)this.state=Pp0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Vv}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case h4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=v6;break}case $U:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=Vv}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=U10;else if($===I6||c6($))this.fail("processing instruction without a target."),this.state=$===I6?RW:Wv;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=U10}sPIRest(){let{chunk:$,i:I}=this;while(!0){let q=this.getCodeNorm();if(q===Y4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(q)){this.piTarget+=$.slice(I,this.prevI);let U=q===I6;if(U||c6(q))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?K3:Y10}else this.state=U?RW:Wv;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(q);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===I6)this.state=RW;else if(!c6($))this.text=String.fromCodePoint($)}else if(this.captureToChar(I6))this.state=RW}sPIEnding(){var $;let I=this.getCodeNorm();if(I===h4){let{piTarget:q}=this;if(q.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:q,body:this.text}),this.piTarget=this.text="",this.state=v6}else if(I===I6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=Wv;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===I6){this.state=K3;return}if($!==Y4)this.state=Ep0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(kp0);if($===I6){this.state=K3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(c6($)||$===eq))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=$===eq?J10:jp0}sXMLDeclEq(){let $=this.getCodeNorm();if($===I6){this.state=K3,this.fail("XML declaration is incomplete.");return}if(c6($))return;if($!==eq)this.fail("value required.");this.state=J10}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===I6){this.state=K3,this.fail("XML declaration is incomplete.");return}if(c6($))return;if(!hW($))this.fail("value must be quoted."),this.q=z10;else this.q=$;this.state=Bp0}sXMLDeclValue(){let $=this.captureTo([this.q,I6]);if($===I6){this.state=K3,this.text="",this.fail("XML declaration is incomplete.");return}if($===Y4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let q=I;if(this.xmlDecl.version=q,!/^1\.[0-9]+$/.test(q))this.fail("ver Line truncated
`;$=this.i,I=w3;break;case Y4:if(U!==void 0)this.text+=q.slice($);break $;default:I=w3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:q}=this,U=!1;$:while(!0){let Y=this.getCode();switch(Y){case h9:{if(this.state=Gv,q!==void 0){let{text:J}=this,Q=I.slice($,this.prevI);if(J.length!==0)q(J+Q),this.text="";else if(Q.length!==0)q(Q)}break $}case L2:if(this.state=vW,this.entityReturnState=v6,q!==void 0)this.text+=I.slice($,this.prevI);U=!0;break $;case R8:if(q!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case Y4:if(q!==void 0)this.text+=I.slice($);break $;default:if(!c6(Y))U=!0}}if(!U)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 q;let{prefix:U,local:Y}=this.qname($),J={name:$,prefix:U,local:Y,value:I};if(this.attribList.push(J),(q=this.attributeHandler)===null||q===void 0||q.call(this,J),U==="xmlns"){let Q=I.trim();if(this.currentXMLVersion==="1.0"&&Q==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[Y]=Q,Nv(this,Y,Q)}else if($==="xmlns"){let Q=I.trim();this.topNS[""]=Q,Nv(this,"",Q)}}pushAttribPlain($,I){var q;let U={name:$,value:I};this.attribList.push(U),(q=this.attributeHandler)===null||q===void 0||q.call(this,U)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:q}=this;while(q.length>0){let Y=q.pop();this.fail(`unclosed tag: ${Y.name}`)}if(this.state!==q10&&this.state!==v6)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,q;let U=this.topNS[$];if(U!==void 0)return U;let{tags:Y}=this;for(let J=Y.length-1;J>=0;J--)if(U=Y[J].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(q=(I=this.opt).resolvePrefix)===null||q===void 0?void 0:q.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let q=$.slice(I+1),U=$.slice(0,I);if(U===""||q===""||q.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:q}}processAttribsNS(){var $;let{attribList:I}=this,q=this.tag;{let{prefix:J,local:Q}=this.qname(q.name);q.prefix=J,q.local=Q;let K=q.uri=($=this.resolve(J))!==null&&$!==void 0?$:"";if(J!==""){if(J==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(J)}.`),q.uri=J}}if(I.length===0)return;let{attributes:U}=q,Y=new Set;for(let J of I){let{name:Q,prefix:K,local:w}=J,z,G;if(K==="")z=Q==="xmlns"?IU:"",G=Q;else{if(z=this.resolve(K),z===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),z=K;G=`{${z}}${w}`}if(Y.has(G))this.fail(`duplicate attribute: ${G}.`);Y.add(G),J.uri=z,U[Q]=J}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:q,value:U}of $){if(I[q]!==void 0)this.fail(`duplicate attribute: ${q}.`);I[q]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,q=this.tag;q.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,q),I.push(q),this.state=v6,this.name=""}openSelfClosingTag(){var $,I,q;this.processAttribs();let{tags:U}=this,Y=this.tag;if(Y.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,Y),(I=this.closeTagHandler)===null||I===void 0||I.call(this,Y),(this.tag=(q=U[U.length-1])!==null&&q!==void 0?q:null)===null)this.closedRoot=!0;this.state=v6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=v6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let q=this.closeTagHandler,U=$.length;while(U-- >0){let Y=this.tag=$.pop();if(this.topNS=Y.ns,q===null||q===void 0||q(Y),Y.name===I)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}parseEntity($){if($[0]!=="#"){let q=this.ENTITIES[$];if(q!==void 0)return q;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)}}M10.SaxesParser=F10});var N2=L((RP1,g10)=>{var{SaxesParser:dp0}=A10(),{PassThrough:lp0}=Z6(),{bufferToString:mp0}=qv();g10.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new lp0);let I=new dp0,q;I.on("error",(Y)=>{q=Y});let U=[];I.on("opentag",(Y)=>U.push({eventType:"opentag",value:Y})),I.on("text",(Y)=>U.push({eventType:"text",value:Y})),I.on("closetag",(Y)=>U.push({eventType:"closetag",value:Y}));for await(let Y of $){if(I.write(mp0(Y)),q)throw q;yield U,U=[]}}});var Z0=L((CP1,P10)=>{var op0=N2(),rp0=$6();class UU{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof UU)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:q,value:U}of I)if(q==="opentag")this.parseOpen(U);else if(q==="text")this.parseText(U);else if(q==="closetag"){if(!this.parseClose(U.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}`}}$70.FormatterOptions=e90});var WZ=L((qj1,J70)=>{var Jt0="[object AsyncFunction]",Qt0="[object Function]",Kt0="[object GeneratorFunction]",wt0="[object Null]",zt0="[object Proxy]",Gt0="[object Undefined]",Ht0=typeof global=="object"&&global&&global.Object===Object&&global,Vt0=typeof self=="object"&&self&&self.Object===Object&&self,Wt0=Ht0||Vt0||Function("return this")(),U70=Object.prototype,Zt0=U70.hasOwnProperty,Y70=U70.toString,q70=Wt0.Symbol,X3=q70?q70.toStringTag:void 0;function Xt0($){if($==null)return $===void 0?Gt0:wt0;return X3&&X3 in Object($)?Dt0($):Ot0($)}function Dt0($){var I=Zt0.call($,X3),q=$[X3];try{$[X3]=void 0;var U=!0}catch(J){}var Y=Y70.call($);if(U)if(I)$[X3]=q;else delete $[X3];return Y}function Ot0($){return Y70.call($)}function Lt0($){if(!Nt0($))return!1;var I=Xt0($);return I==Qt0||I==Kt0||I==Jt0||I==zt0}function Nt0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}J70.exports=Lt0});var n70=L((ZZ,WU)=>{var Ft0=200,pR="__lodash_hash_undefined__",AZ=1,O70=2,L70=9007199254740991,XZ="[object Arguments]",uR="[object Array]",Mt0="[object AsyncFunction]",N70="[object Boolean]",F70="[object Date]",M70="[object Error]",A70="[object Function]",At0="[object GeneratorFunction]",DZ="[object Map]",g70="[object Number]",gt0="[object Null]",VU="[object Object]",Q70="[object Promise]",Pt0="[object Proxy]",P70="[object RegExp]",OZ="[object Set]",T70="[object String]",Tt0="[object Symbol]",Et0="[object Undefined]",xR="[object WeakMap]",E70="[object ArrayBuffer]",LZ="[object DataView]",jt0="[object Float32Array]",Bt0="[object Float64Array]",vt0="[object Int8Array]",Rt0="[object Int16Array]",Ct0="[object Int32Array]",_t0="[object Uint8Array]",ht0="[object Uint8ClampedArray]",St0="[object Uint16Array]",yt0="[object Uint32Array]",ut0=/[\\^$.*+?()[\]{}|]/g,xt0=/^\[object .+?Constructor\]$/,kt0=/^(?:0|[1-9]\d*)$/,o1={};o1[jt0]=o1[Bt0]=o1[vt0]=o1[Rt0]=o1[Ct0]=o1[_t0]=o1[ht0]=o1[St0]=o1[yt0]=!0;o1[XZ]=o1[uR]=o1[E70]=o1[N70]=o1[LZ]=o1[F70]=o1[M70]=o1[A70]=o1[DZ]=o1[g70]=o1[VU]=o1[P70]=o1[OZ]=o1[T70]=o1[xR]=!1;var j70=typeof global=="object"&&global&&global.Object===Object&&global,ft0=typeof self=="object"&&self&&self.Object===Object&&self,A5=j70||ft0||Function("return this")(),B70=typeof ZZ=="object"&&ZZ&&!ZZ.nodeType&&ZZ,K70=B70&&typeof WU=="object"&&WU&&!WU.nodeType&&WU,v70=K70&&K70.exports===B70,hR=v70&&j70.process,w70=function(){try{return hR&&hR.binding&&hR.binding("util")}catch($){}}(),z70=w70&&w70.isTypedArray;function nt0($,I){var q=-1,U=$==null?0:$.length,Y=0,J=[];while(++q<U){var Q=$[q];if(I(Q,q,$))J[Y++]=Q}return J}function it0($,I){var q=-1,U=I.length,Y=$.length;while(++q<U)$[Y+q]=I[q];return $}function bt0($,I){var q=-1,U=$==null?0:$.length;while(++q<U)if(I($[q],q,$))return!0;return!1}function pt0($,I){var q=-1,U=Array($);while(++q<$)U[q]=I(q);return U}function ct0($){return function(I){return $(I)}}function dt0($,I){return $.has(I)}function lt0($,I){return $==null?void 0:$[I]}function mt0($){var I=-1,q=Array($.size);return $.forEach(function(U,Y){q[++I]=[Y,U]}),q}function ot0($,I){return function(q){return $(I(q))}}function rt0($){var I=-1,q=Array($.size);return $.forEach(function(U){q[++I]=U}),q}var tt0=Array.prototype,at0=Function.prototype,gZ=Object.prototype,SR=A5["__core-js_shared__"],R70=at0.toString,_8=gZ.hasOwnProperty,G70=function(){var $=/[^.]+$/.exec(SR&&SR.keys&&SR.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),C70=gZ.toString,st0=RegExp("^"+R70.call(_8).replace(ut0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H70=v70?A5.Buffer:void 0,NZ=A5.Symbol,V70=A5.Uint8Array,_70=gZ.propertyIsEnumerable,et0=tt0.splice,D3=NZ?NZ.toStringTag:void 0,W70=Object.getOwnPropertySymbols,$a0=H70?H70.isBuffer:void 0,Ia0=ot0(Object.keys,Object),kR=ZU(A5,"DataView"),E2=ZU(A5,"Map"),fR=ZU(A5,"Promise"),nR=ZU(A5,"Set"),iR=ZU(A5,"WeakMap"),j2=ZU(Object,"create"),qa0=N3(kR),Ua0=N3(E2),Ya0=N3(fR),Ja0=N3(nR),Qa0=N3(iR),Z70=NZ?NZ.prototype:void 0,yR=Z70?Z70.valueOf:void 0;function O3($){var I=-1,q=$==null?0:$.length;this.clear();while(++I<q){var U=$[I];this.set(U[0],U[1])}}function Ka0(){this.__data__=j2?j2(null):{},this.size=0}function wa0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function za0($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let q=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(Xs0.default(q))return q;if(Array.isArray(q))return q[$];if(this._headers!==null)return q[this._headers[$]];return!1}format($,I,q){let U=`${Ds0.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:Y}=this;if(Y.quote!==""){if(U.indexOf(Y.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,Y.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,q))return this.quoteField(U);return U}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}XU.FieldFormatter=r70});var oR=L((t70)=>{Object.defineProperty(t70,"__esModule",{value:!0});t70.isSyncTransform=void 0;t70.isSyncTransform=($)=>$.length===1});var e70=L((DU)=>{var s70=DU&&DU.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(DU,"__esModule",{value:!0});DU.RowFormatter=void 0;var Ls0=s70(WZ()),Ns0=s70(n70()),Fs0=mR(),Ms0=oR();class F3{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new Fs0.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(F3.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(Ms0.isSyncTransform($))return(I,q)=>{let U=null;try{U=$(I)}catch(Y){return q(Y)}return q(null,U)};return(I,q)=>{$(I,q)}}set rowTransform($){if(!Ls0.default($))throw TypeError("The transform should be a function");this._rowTransform=F3.createTransform($)}format($,I){this.callTransformer($,(q,U)=>{if(q)return I(q);if(!$)return I(null);let Y=[];if(U){let{shouldFormatColumns:J,headers:Q}=this.checkHeaders(U);if(this.shouldWriteHeaders&&Q&&!this.hasWrittenHeaders)Y.push(this.formatColumns(Q,!0)),this.hasWrittenHeaders=!0;if(J){let K=this.gatherColumns(U);Y.push(this.formatColumns(K,!1))}}return I(null,Y)})}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=F3.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!Ns0.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(F3.isRowHashArray($))return this.headers.map((I,q)=>{let U=$[q];if(U)return U[1];return""});if(F3.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,q)=>$[q])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let q=$.map((Y,J)=>this.fieldFormatter.format(Y,J,I)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,q].join("");return q}}DU.RowFormatter=F3});var $30=L((EZ)=>{Object.defineProperty(EZ,"__esModule",{value:!0});EZ.FieldFormatter=EZ.RowFormatter=void 0;var As0=e70();Object.defineProperty(EZ,"RowFormatter",{enumerable:!0,get:function(){return As0.RowFormatter}});var gs0=mR();Object.defineProperty(EZ,"FieldFormatter",{enumerable:!0,get:function(){return gs0.FieldFormatter}})});var rR=L((q30)=>{Object.defineProperty(q30,"__esModule",{value:!0});q30.CsvFormatterStream=void 0;var Ts0=o("stream"),Es0=$30();class I30 extends Ts0.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new Es0.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,q){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(Y,J)=>{if(Y)return U=!0,q(Y);if(J)J.forEach((Q)=>{this.push(Buffer.from(Q,"utf8"))});return U=!0,q()})}catch(Y){if(U)throw Y;q(Y)}}_flush($){this.rowFormatter.finish((I,q)=>{if(I)return $(I);if(q)q.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}q30.CsvFormatterStream=I30});var J30=L((D1)=>{var Y30=D1&&D1.__createBinding||(Object.create?function($,I,q,U){if(U===void 0)U=q;Object.defineProperty($,U,{enumerable:!0,get:function(){return I[q]}})}:function($,I,q,U){if(U===void 0)U=q;$[U]=I[q]}),js0=D1&&D1.__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}}p30.Token=i30});var KC=L((m30)=>{Object.defineProperty(m30,"__esModule",{value:!0});m30.Scanner=void 0;var d30=b9(),V11=/((?:\r\n)|\n|\r)/;class l30{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 q=I.exec($);if(q==null)return null;let U=q[1],Y=this.cursor+(q.index||0);return new d30.Token({token:U,startCursor:Y,endCursor:Y+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new d30.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=V11.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}}m30.Scanner=l30});var cZ=L((t30)=>{Object.defineProperty(t30,"__esModule",{value:!0});t30.ColumnFormatter=void 0;class r30{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}}t30.ColumnFormatter=r30});var zC=L(($I0)=>{Object.defineProperty($I0,"__esModule",{value:!0});$I0.NonQuotedColumnParser=void 0;var W11=cZ(),s30=b9();class e30{constructor($){this.parserOptions=$,this.columnFormatter=new W11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,q=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(s30.Token.isTokenDelimiter(U,I)||s30.Token.isTokenRowDelimiter(U))break;q.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(q.join(""))}}$I0.NonQuotedColumnParser=e30});var wC=L((UI0)=>{Object.defineProperty(UI0,"__esModule",{value:!0});UI0.QuotedColumnParser=void 0;var Z11=cZ(),TU=b9();class qI0{constructor($){this.parserOptions=$,this.columnFormatter=new Z11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:q,col:U}=this.gatherDataBetweenQuotes($);if(!q){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($),U}gatherDataBetweenQuotes($){let{parserOptions:I}=this,q=!1,U=!1,Y=[],J=$.nextCharacterToken;for(;!U&&J!==null;J=$.nextCharacterToken){let Q=TU.Token.isTokenQuote(J,I);if(!q&&Q)q=!0;else if(q)if(TU.Token.isTokenEscapeCharacter(J,I)){$.advancePastToken(J);let K=$.nextCharacterToken;if(K!==null&&(TU.Token.isTokenQuote(K,I)||TU.Token.isTokenEscapeCharacter(K,I)))Y.push(K.token),J=K;else if(Q)U=!0;else Y.push(J.token)}else if(Q)U=!0;else Y.push(J.token);$.advancePastToken(J)}return{col:this.columnFormatter.format(Y.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:q}=$;if(q){let U=TU.Token.isTokenDelimiter(q,I),Y=TU.Token.isTokenRowDelimiter(q);if(!(U||Y)){let J=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${q.token}'. at '${J}`)}$.advanceToToken(q)}else if(!$.hasMoreData)$.advancePastLine()}}UI0.QuotedColumnParser=qI0});var zI0=L((QI0)=>{Object.defineProperty(QI0,"__esModule",{value:!0});QI0.ColumnParser=void 0;var X11=zC(),D11=wC(),O11=b9();class JI0{constructor($){this.parserOptions=$,this.quotedColumnParser=new D11.QuotedColumnParser($),this.nonQuotedColumnParser=new X11.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&O11.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}QI0.ColumnParser=JI0});var GC=L((jU)=>{Object.defineProperty(jU,"__esModule",{value:!0});jU.ColumnFormatter=jU.QuotedColumnParser=jU.NonQuotedColumnParser=jU.ColumnParser=void 0;var L11=zI0();Object.defineProperty(jU,"ColumnParser",{enumerable:!0,get:function(){return L11.ColumnParser}});var N11=zC();Object.defineProperty(jU,"NonQuotedColumnParser",{enumerable:!0,get:function(){return N11.NonQuotedColumnParser}});var F11=wC();Object.defineProperty(jU,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,x,x,V,U);let h=V.type==="*"?jC:V.type==="?"?vC:"\\"+V.type;Y=!0,U=U.slice(0,V.reStart)+h+"\\("+x}if(P(),J)U+="\\\\";let g=H41[U.charAt(0)];for(let x=K.length-1;x>-1;x--){let h=K[x],f=U.slice(0,h.reStart),S=U.slice(h.reStart,h.reEnd-8),t=U.slice(h.reEnd),p=U.slice(h.reEnd-8,h.reEnd)+t,C=f.split(")").length,k=f.split("(").length-C,n=t;for(let j=0;j<k;j++)n=n.replace(/\)[+*?]?/,"");t=n;let J0=t===""&&I!==EC?"(?:$|\\/)":"";U=f+S+t+J0+p}if(U!==""&&Y)U="(?=.)"+U;if(g)U=N()+U;if(I===EC)return[U,Y];if(q.nocase&&!Y)Y=$.toUpperCase()!==$.toLowerCase();if(!Y)return W41($);let B=q.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",B),{_glob:$,_src:U})}catch(x){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,q=I.noglobstar?jC:I.dot?w41:G41,U=I.nocase?"i":"",Y=$.map((J)=>{return J=J.map((Q)=>typeof Q==="string"?X41(Q):Q===v6?v6:Q._src).reduce((Q,K)=>{if(!(Q[Q.length-1]===v6&&K===v6))Q.push(K);return Q},[]),J.forEach((Q,K)=>{if(Q!==v6||J[K-1]===v6)return;if(K===0)if(J.length>1)J[K+1]="(?:\\/|"+q+"\\/)?"+J[K+1];else J[K]=q;else if(K===J.length-1)J[K-1]+="(?:\\/|"+q+")?";else J[K-1]+="(?:\\/|\\/"+q+"\\/)"+J[K+1],J[K+1]=v6}),J.filter((Q)=>Q!==v6).join("/")}).join("|");if(Y="^(?:"+Y+")$",this.negate)Y="^(?!"+Y+").*$";try{this.regexp=new RegExp(Y,U)}catch(J){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 q=this.options;if(BC.sep!=="/")$=$.split(BC.sep).join("/");$=$.split($q0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let Y;for(let J=$.length-1;J>=0;J--)if(Y=$[J],Y)break;for(let J=0;J<U.length;J++){let Q=U[J],K=$;if(q.matchBase&&Q.length===1)K=[Y];if(this.matchOne(K,Q,I)){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate}static defaults($){return Y$.defaults($).Minimatch}}Y$.Minimatch=h2});var zq0=L((yE1,Kq0)=>{Kq0.exports=Qq0;var _C=o("fs"),{EventEmitter:O41}=o("events"),{Minimatch:CC}=Uq0(),{resolve:L41}=o("path");function N41($,I){return new Promise((q,U)=>{_C.readdir($,{withFileTypes:!0},(Y,J)=>{if(Y)switch(Y.code){case"ENOTDIR":if(I)U(Y);else q([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":q([]);break;case"ELOOP":default:U(Y);break}else q(J)})})}function Yq0($,I){return new Promise((q,U)=>{(I?_C.stat:_C.lstat)($,(J,Q)=>{if(J)switch(J.code){case"ENOENT":if(I)q(Yq0($,!1));else q(null);break;default:q(null);break}else q(Q)})})}async function*Jq0($,I,q,U,Y,J){let Q=await N41(I+$,J);for(let K of Q){let z=K.name;if(z===void 0)z=K,U=!0;let w=$+"/"+z,G=w.slice(1),H=I+"/"+G,W=null;if(U||q)W=await Yq0(H,q);if(!W&&K.name!==void 0)W=K;if(W===null)W={isDirectory:()=>!1};if(W.isDirectory()){if(!Y(G))yield{relative:G,absolute:H,stats:W},yield*Jq0(w,I,q,U,Y,!1)}else yield{relative:G,absolute:H,stats:W}}}async function*F41($,I,q,U){yield*Jq0("",$,I,q,U,!0)}function M41($){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 hC extends O41{constructor($,I,q){super();if(typeof I==="function")q=I,I=null;if(this.options=M41(I||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((Y)=>new CC(Y,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((Y)=>new CC(Y,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((Y)=>new CC(Y,{dot:!0}))}if(this.iterator=F41(L41($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,q)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>q(U)),this.on("end",()=>q(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let q=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(q)))&&!this.ignoreMatchers.some((U)=>U.match(q))&&(!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 q=$.value.relative,U=$.value.absolute;if(this.options.mark&&I)q+="/",U+="/";if(this.options.stat)this.emit("match",{relative:q,absolute:U,stat:$.value.stats});else this.emit("match",{relative:q,ab Line truncated
`,R);R=$0===-1?A.length:$0}else if(i!==-1&&A[R]==="/"&&A[R+1]==="*"){let $0=A.indexOf("*/",R);if($0!==-1)R=$0+2,i=A.indexOf("*/",R);else E+=A[R],R++}else E+=A[R],R++;return E}function i8(A){let E=G$(A.toString()),R=E.match(w$);if(!R)R=E.match(_$);if(!R)throw Error(`could not parse args in autoInject
`}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=JI0});var NC=L((GI0)=>{Object.defineProperty(GI0,"__esModule",{value:!0});GI0.Scanner=void 0;var wI0=c9(),y11=/((?:\r\n)|\n|\r)/;class zI0{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 q=I.exec($);if(q==null)return null;let U=q[1],Y=this.cursor+(q.index||0);return new wI0.Token({token:U,startCursor:Y,endCursor:Y+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new wI0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=y11.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}}GI0.Scanner=zI0});var rZ=L((WI0)=>{Object.defineProperty(WI0,"__esModule",{value:!0});WI0.ColumnFormatter=void 0;class VI0{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}}WI0.ColumnFormatter=VI0});var FC=L((OI0)=>{Object.defineProperty(OI0,"__esModule",{value:!0});OI0.NonQuotedColumnParser=void 0;var u11=rZ(),XI0=c9();class DI0{constructor($){this.parserOptions=$,this.columnFormatter=new u11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,q=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(XI0.Token.isTokenDelimiter(U,I)||XI0.Token.isTokenRowDelimiter(U))break;q.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(q.join(""))}}OI0.NonQuotedColumnParser=DI0});var MC=L((FI0)=>{Object.defineProperty(FI0,"__esModule",{value:!0});FI0.QuotedColumnParser=void 0;var x11=rZ(),jU=c9();class NI0{constructor($){this.parserOptions=$,this.columnFormatter=new x11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:q,col:U}=this.gatherDataBetweenQuotes($);if(!q){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($),U}gatherDataBetweenQuotes($){let{parserOptions:I}=this,q=!1,U=!1,Y=[],J=$.nextCharacterToken;for(;!U&&J!==null;J=$.nextCharacterToken){let Q=jU.Token.isTokenQuote(J,I);if(!q&&Q)q=!0;else if(q)if(jU.Token.isTokenEscapeCharacter(J,I)){$.advancePastToken(J);let K=$.nextCharacterToken;if(K!==null&&(jU.Token.isTokenQuote(K,I)||jU.Token.isTokenEscapeCharacter(K,I)))Y.push(K.token),J=K;else if(Q)U=!0;else Y.push(J.token)}else if(Q)U=!0;else Y.push(J.token);$.advancePastToken(J)}return{col:this.columnFormatter.format(Y.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:q}=$;if(q){let U=jU.Token.isTokenDelimiter(q,I),Y=jU.Token.isTokenRowDelimiter(q);if(!(U||Y)){let J=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${q.token}'. at '${J}`)}$.advanceToToken(q)}else if(!$.hasMoreData)$.advancePastLine()}}FI0.QuotedColumnParser=NI0});var TI0=L((gI0)=>{Object.defineProperty(gI0,"__esModule",{value:!0});gI0.ColumnParser=void 0;var k11=FC(),f11=MC(),n11=c9();class AI0{constructor($){this.parserOptions=$,this.quotedColumnParser=new f11.QuotedColumnParser($),this.nonQuotedColumnParser=new k11.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&n11.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}gI0.ColumnParser=AI0});var AC=L((BU)=>{Object.defineProperty(BU,"__esModule",{value:!0});BU.ColumnFormatter=BU.QuotedColumnParser=BU.NonQuotedColumnParser=BU.ColumnParser=void 0;var i11=TI0();Object.defineProperty(BU,"ColumnParser",{enumerable:!0,get:function(){return i11.ColumnParser}});var b11=FC();Object.defineProperty(BU,"NonQuotedColumnParser",{enumerable:!0,get:function(){return b11.NonQuotedColumnParser}});var p11=MC();Object.defineProperty(BU,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,k,k,W,U);let h=W.type==="*"?kC:W.type==="?"?iC:"\\"+W.type;Y=!0,U=U.slice(0,W.reStart)+h+"\\("+k}if(P(),J)U+="\\\\";let g=S41[U.charAt(0)];for(let k=K.length-1;k>-1;k--){let h=K[k],f=U.slice(0,h.reStart),S=U.slice(h.reStart,h.reEnd-8),t=U.slice(h.reEnd),p=U.slice(h.reEnd-8,h.reEnd)+t,C=f.split(")").length,n=f.split("(").length-C,i=t;for(let E=0;E<n;E++)i=i.replace(/\)[+*?]?/,"");t=i;let J0=t===""&&I!==fC?"(?:$|\\/)":"";U=f+S+t+J0+p}if(U!==""&&Y)U="(?=.)"+U;if(g)U=N()+U;if(I===fC)return[U,Y];if(q.nocase&&!Y)Y=$.toUpperCase()!==$.toLowerCase();if(!Y)return u41($);let B=q.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",B),{_glob:$,_src:U})}catch(k){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,q=I.noglobstar?kC:I.dot?_41:h41,U=I.nocase?"i":"",Y=$.map((J)=>{return J=J.map((Q)=>typeof Q==="string"?k41(Q):Q===R6?R6:Q._src).reduce((Q,K)=>{if(!(Q[Q.length-1]===R6&&K===R6))Q.push(K);return Q},[]),J.forEach((Q,K)=>{if(Q!==R6||J[K-1]===R6)return;if(K===0)if(J.length>1)J[K+1]="(?:\\/|"+q+"\\/)?"+J[K+1];else J[K]=q;else if(K===J.length-1)J[K-1]+="(?:\\/|"+q+")?";else J[K-1]+="(?:\\/|\\/"+q+"\\/)"+J[K+1],J[K+1]=R6}),J.filter((Q)=>Q!==R6).join("/")}).join("|");if(Y="^(?:"+Y+")$",this.negate)Y="^(?!"+Y+").*$";try{this.regexp=new RegExp(Y,U)}catch(J){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 q=this.options;if(nC.sep!=="/")$=$.split(nC.sep).join("/");$=$.split(Oq0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let Y;for(let J=$.length-1;J>=0;J--)if(Y=$[J],Y)break;for(let J=0;J<U.length;J++){let Q=U[J],K=$;if(q.matchBase&&Q.length===1)K=[Y];if(this.matchOne(K,Q,I)){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate}static defaults($){return J$.defaults($).Minimatch}}J$.Minimatch=y2});var Tq0=L((HB1,Pq0)=>{Pq0.exports=gq0;var cC=o("fs"),{EventEmitter:n41}=o("events"),{Minimatch:pC}=Fq0(),{resolve:i41}=o("path");function b41($,I){return new Promise((q,U)=>{cC.readdir($,{withFileTypes:!0},(Y,J)=>{if(Y)switch(Y.code){case"ENOTDIR":if(I)U(Y);else q([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":q([]);break;case"ELOOP":default:U(Y);break}else q(J)})})}function Mq0($,I){return new Promise((q,U)=>{(I?cC.stat:cC.lstat)($,(J,Q)=>{if(J)switch(J.code){case"ENOENT":if(I)q(Mq0($,!1));else q(null);break;default:q(null);break}else q(Q)})})}async function*Aq0($,I,q,U,Y,J){let Q=await b41(I+$,J);for(let K of Q){let w=K.name;if(w===void 0)w=K,U=!0;let z=$+"/"+w,G=z.slice(1),H=I+"/"+G,V=null;if(U||q)V=await Mq0(H,q);if(!V&&K.name!==void 0)V=K;if(V===null)V={isDirectory:()=>!1};if(V.isDirectory()){if(!Y(G))yield{relative:G,absolute:H,stats:V},yield*Aq0(z,I,q,U,Y,!1)}else yield{relative:G,absolute:H,stats:V}}}async function*p41($,I,q,U){yield*Aq0("",$,I,q,U,!0)}function c41($){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 dC extends n41{constructor($,I,q){super();if(typeof I==="function")q=I,I=null;if(this.options=c41(I||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((Y)=>new pC(Y,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((Y)=>new pC(Y,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((Y)=>new pC(Y,{dot:!0}))}if(this.iterator=p41(i41($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,q)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>q(U)),this.on("end",()=>q(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let q=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(q)))&&!this.ignoreMatchers.some((U)=>U.match(q))&&(!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 q=$.value.relative,U=$.value.absolute;if(this.options.mark&&I)q+="/",U+="/";if(this.options.stat)this.emit("match",{relative:q,absolute:U,stat:$.value.stats});else this.emit("match",{relative:q,ab Line truncated
`,R);R=$0===-1?A.length:$0}else if(b!==-1&&A[R]==="/"&&A[R+1]==="*"){let $0=A.indexOf("*/",R);if($0!==-1)R=$0+2,b=A.indexOf("*/",R);else j+=A[R],R++}else j+=A[R],R++;return j}function l8(A){let j=H$(A.toString()),R=j.match(G$);if(!R)R=j.match(S$);if(!R)throw Error(`could not parse args in autoInject
Source:
`+E);let[,i]=R;return i.replace(/\s/g,"").split(b8).map(($0)=>$0.replace(h$,"").trim())}function t6(A,E){var R={};return Object.keys(A).forEach((i)=>{var $0=A[i],q0,Q0=V($0),z0=!Q0&&$0.length===1||Q0&&$0.length===0;if(Array.isArray($0))q0=[...$0],$0=q0.pop(),R[i]=q0.concat(q0.length>0?V0:$0);else if(z0)R[i]=$0;else{if(q0=i8($0),$0.length===0&&!Q0&&q0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!Q0)q0.pop();R[i]=q0.concat(V0)}function V0(j0,q1){var V1=q0.map((Q1)=>j0[Q1]);V1.push(q1),O($0)(...V1)}}),v4(R,E)}class X7{constructor(){this.head=this.tail=null,this.length=0}removeLink(A){if(A.prev)A.prev.next=A.next;else this.head=A.next;if(A.next)A.next.prev=A.prev;else this.tail=A.prev;return A.prev=A.next=null,this.length-=1,A}empty(){while(this.head)this.shift();return this}insertAfter(A,E){if(E.prev=A,E.next=A.next,A.next)A.next.prev=E;else this.tail=E;A.next=E,this.length+=1}insertBefore(A,E){if(E.prev=A.prev,E.next=A,A.prev)A.prev.next=E;else this.head=E;A.prev=E,this.length+=1}unshift(A){if(this.head)this.insertBefore(this.head,A);else a6(this,A)}push(A){if(this.tail)this.insertAfter(this.tail,A);else a6(this,A)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var A=this.head;while(A)yield A.data,A=A.next}remove(A){var E=this.head;while(E){var{next:R}=E;if(A(E))this.removeLink(E);E=R}return this}}function a6(A,E){A.length=1,A.head=A.tail=E}function n5(A,E,R){if(E==null)E=1;else if(E===0)throw RangeError("Concurrency must not be zero");var i=O(A),$0=0,q0=[];let Q0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function z0(_0,P0){Q0[_0].push(P0)}function V0(_0,P0){let h0=(...K1)=>{j0(_0,h0),P0(...K1)};Q0[_0].push(h0)}function j0(_0,P0){if(!_0)return Object.keys(Q0).forEach((h0)=>Q0[h0]=[]);if(!P0)return Q0[_0]=[];Q0[_0]=Q0[_0].filter((h0)=>h0!==P0)}function q1(_0,...P0){Q0[_0].forEach((h0)=>h0(...P0))}var V1=!1;function Q1(_0,P0,h0,K1){if(K1!=null&&typeof K1!=="function")throw Error("task callback must be a function");W1.started=!0;var $4,x4;function V$(O7,...EY){if(O7)return h0?x4(O7):$4();if(EY.length<=1)return $4(EY[0]);$4(EY)}var UI=W1._createTaskItem(_0,h0?V$:K1||V$);if(P0)W1._tasks.unshift(UI);else W1._tasks.push(UI);if(!V1)V1=!0,w(()=>{V1=!1,W1.process()});if(h0||!K1)return new Promise((O7,EY)=>{$4=O7,x4=EY})}function H$(_0){return function(P0,...h0){$0-=1;for(var K1=0,$4=_0.length;K1<$4;K1++){var x4=_0[K1],V$=q0.indexOf(x4);if(V$===0)q0.shift();else if(V$>0)q0.splice(V$,1);if(x4.callback(P0,...h0),P0!=null)q1("error",P0,x4.data)}if($0<=W1.concurrency-W1.buffer)q1("unsaturated");if(W1.idle())q1("drain");W1.process()}}function qI(_0){if(_0.length===0&&W1.idle())return w(()=>q1("drain")),!0;return!1}let D7=(_0)=>(P0)=>{if(!P0)return new Promise((h0,K1)=>{V0(_0,($4,x4)=>{if($4)return K1($4);h0(x4)})});j0(_0),z0(_0,P0)};var jY=!1,W1={_tasks:new X7,_createTaskItem(_0,P0){return{data:_0,callback:P0}},*[Symbol.iterator](){yield*W1._tasks[Symbol.iterator]()},concurrency:E,payload:R,buffer:E/4,started:!1,paused:!1,push(_0,P0){if(Array.isArray(_0)){if(qI(_0))return;return _0.map((h0)=>Q1(h0,!1,!1,P0))}return Q1(_0,!1,!1,P0)},pushAsync(_0,P0){if(Array.isArray(_0)){if(qI(_0))return;return _0.map((h0)=>Q1(h0,!1,!0,P0))}return Q1(_0,!1,!0,P0)},kill(){j0(),W1._tasks.empty()},unshift(_0,P0){if(Array.isArray(_0)){if(qI(_0))return;return _0.map((h0)=>Q1(h0,!0,!1,P0))}return Q1(_0,!0,!1,P0)},unshiftAsync(_0,P0){if(Array.isArray(_0)){if(qI(_0))return;return _0.map((h0)=>Q1(h0,!0,!0,P0))}return Q1(_0,!0,!0,P0)},remove(_0){W1._tasks.remove(_0)},process(){if(jY)return;jY=!0;while(!W1.paused&&$0<W1.concurrency&&W1._tasks.length){var _0=[],P0=[],h0=W1._tasks.length;if(W1.payload)h0=Math.min(h0,W1.payload);for(var K1=0;K1<h0;K1++){var $4=W1._tasks.shift();_0.push($4),q0.push($4),P0.push($4.data)}if($0+=1,W1._tasks.length===0)q1("empty");if($0===W1.concurrency)q1("saturated");var x4=C(H$(_0));i(P0,x4)}jY=!1},length(){return W1._tasks.length},running(){return $0},workersList(){return q0},idle(){return W1._tasks.length+$0===0},pause(){W1.paused=!0},resume(){if(W1.paused===!1)return;W1.paused=!1,w(W1.process)}};return Object.defineProperties(W1,{saturated:{writable:!1,value:D7("saturated")},unsaturated:{writable:!1,value:D7("unsaturated")},empty:{writable:!1,value:D7("empty")},drain:{writable:!1,value:D7("drain")},error:{writable:!1,value:D7("error")}}),W1}function g0(A,E){return n5(A,1,E)}function r(A,E,R){return n5(A,E,R)}function F(A,E,R,i){i=x(i);var $0=O(R);return m0(A,(q0,Q0,z0)=>{$0(E,q0,(V0,j0)=>{E=j0,z0(V0)})},(q0)=>i(q0,E))}var M=N(F,4);function v(...A){var E=A.map(O);return function(...R){var i=this,$0=R[R.length-1];if(typeof $0=="function")R.pop();else $0=Y4();return M(E,R,(q0,Q0,z0)=>{Q0.apply(i,q0.concat((V0,...j0)=>{z0(V0,j0)}))},(q0,Q0)=>$0(q0,...Q0)),$0[C1]}}function y(...A){return v(...A.reverse())}function s(A,E,R,i){return P(n(E),A,R,i)}var c=N(s,4);function e( Line truncated
GFS4: `),console.error($)};if(!G4[q6]){if(SC=global[q6]||[],Nq0(G4,SC),G4.close=function($){function I(q,U){return $.call(G4,q,function(Y){if(!Y)Lq0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(I,$X,{value:$}),I}(G4.close),G4.closeSync=function($){function I(q){$.apply(G4,arguments),Lq0()}return Object.defineProperty(I,$X,{value:$}),I}(G4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){A3(G4[q6]),o("assert").equal(G4[q6].length,0)})}var SC;if(!global[q6])Nq0(global,G4[q6]);xC.exports=yC(R41(G4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!G4.__patched)xC.exports=yC(G4),G4.__patched=!0;function yC($){B41($),$.gracefulify=yC,$.createReadStream=B,$.createWriteStream=x;var I=$.readFile;$.readFile=q;function q(S,t,p){if(typeof t==="function")p=t,t=null;return C(S,t,p);function C(k,n,J0,j){return I(k,n,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))vU([C,[k,n,J0],u,j||Date.now(),Date.now()]);else if(typeof J0==="function")J0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=Y;function Y(S,t,p,C){if(typeof p==="function")C=p,p=null;return k(S,t,p,C);function k(n,J0,j,u,d){return U(n,J0,j,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))vU([k,[n,J0,j,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var J=$.appendFile;if(J)$.appendFile=Q;function Q(S,t,p,C){if(typeof p==="function")C=p,p=null;return k(S,t,p,C);function k(n,J0,j,u,d){return J(n,J0,j,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))vU([k,[n,J0,j,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=z;function z(S,t,p,C){if(typeof p==="function")C=p,p=0;return k(S,t,p,C);function k(n,J0,j,u,d){return K(n,J0,j,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))vU([k,[n,J0,j,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var w=$.readdir;$.readdir=H;var G=/^v[0-5]\./;function H(S,t,p){if(typeof t==="function")p=t,t=null;var C=G.test(process.version)?function(J0,j,u,d){return w(J0,k(J0,j,u,d))}:function(J0,j,u,d){return w(J0,j,k(J0,j,u,d))};return C(S,t,p);function k(n,J0,j,u){return function(d,a){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))vU([C,[n,J0,j],d,u||Date.now(),Date.now()]);else{if(a&&a.sort)a.sort();if(typeof j==="function")j.call(this,d,a)}}}}if(process.version.substr(0,4)==="v0.8"){var W=v41($);N=W.ReadStream,P=W.WriteStream}var V=$.ReadStream;if(V)N.prototype=Object.create(V.prototype),N.prototype.open=T;var X=$.WriteStream;if(X)P.prototype=Object.create(X.prototype),P.prototype.open=g;Object.defineProperty($,"ReadStream",{get:function(){return N},set:function(S){N=S},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return P},set:function(S){P=S},enumerable:!0,configurable:!0});var D=N;Object.defineProperty($,"FileReadStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var O=P;Object.defineProperty($,"FileWriteStream",{get:function(){return O},set:function(S){O=S},enumerable:!0,configurable:!0});function N(S,t){if(this instanceof N)return V.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function T(){var S=this;f(S.path,S.flags,S.mode,function(t,p){if(t){if(S.autoClose)S.destroy();S.emit("error",t)}else S.fd=p,S.emit("open",p),S.read()})}function P(S,t){if(this instanceof P)return X.apply(this,arguments),this;else return P.apply(Object.create(P.prototype),arguments)}function g(){var S=this;f(S.path,S.flags,S.mode,function(t,p){if(t)S.destroy(),S.emit("error",t);else S.fd=p,S.emit("open",p)})}function B(S,t){return new $.ReadStream(S,t)}function x(S,t){return new $.WriteStream(S,t)}var h=$.open;$.open=f;function f(S,t,p,C){if(typeof p==="function")C=p,p=null;return k(S,t,p,C);function k(n,J0,j,u,d){return h(n,J0,j,function(a,K0){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))vU([k,[n,J0,j,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return $}function vU($){A3("ENQUEUE",$[0].name,$[1]),G4[q6].push($),uC()}var eZ;function Lq0(){var $=Date.now();for(var I=0;I<G4[q6].length;++I)if(G4[q6][I].length>2)G4[q6][I][3]=$,G4[q6][I][4]=$;uC()}function uC(){if(clearTimeout(eZ),eZ=void 0,G4[q6].length===0)return;var $=G4[q6].shift(),I=$[0],q=$[1],U=$[2],Y=$[3],J=$[4];if(Y===void 0)A3("RETRY",I.name,q),I.apply(null,q);else if(Date.now()-Y>=60000){A3("TIMEOUT",I.name,q);var Q=q.pop();if(typeof Q==="function")Q.call(null,U)}else{var K=Date.now()-J,z=Math.max(J-Y,1),w=Math.min(z*1.2,100);if(K>=w)A3("RETRY",I.name,q),I.apply(null,q.concat([Y]));else G4[q6].push($)}if(eZ===void 0)eZ=setTimeout(uC,0)}});var Mq0=L((nE1,kC)=>{function _41($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Fq0=N4().Buffer,S2=o("util");function h41($,I,q){$.copy(I,q)}kC.exports=function(){function $(){_41(this,$),this.head=null,this.tail=null,th Line truncated
`+j);let[,b]=R;return b.replace(/\s/g,"").split(d8).map(($0)=>$0.replace(y$,"").trim())}function a6(A,j){var R={};return Object.keys(A).forEach((b)=>{var $0=A[b],q0,Q0=W($0),w0=!Q0&&$0.length===1||Q0&&$0.length===0;if(Array.isArray($0))q0=[...$0],$0=q0.pop(),R[b]=q0.concat(q0.length>0?V0:$0);else if(w0)R[b]=$0;else{if(q0=l8($0),$0.length===0&&!Q0&&q0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!Q0)q0.pop();R[b]=q0.concat(V0)}function V0(E0,q1){var V1=q0.map((Q1)=>E0[Q1]);V1.push(q1),O($0)(...V1)}}),R4(R,j)}class O7{constructor(){this.head=this.tail=null,this.length=0}removeLink(A){if(A.prev)A.prev.next=A.next;else this.head=A.next;if(A.next)A.next.prev=A.prev;else this.tail=A.prev;return A.prev=A.next=null,this.length-=1,A}empty(){while(this.head)this.shift();return this}insertAfter(A,j){if(j.prev=A,j.next=A.next,A.next)A.next.prev=j;else this.tail=j;A.next=j,this.length+=1}insertBefore(A,j){if(j.prev=A.prev,j.next=A,A.prev)A.prev.next=j;else this.head=j;A.prev=j,this.length+=1}unshift(A){if(this.head)this.insertBefore(this.head,A);else s6(this,A)}push(A){if(this.tail)this.insertAfter(this.tail,A);else s6(this,A)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var A=this.head;while(A)yield A.data,A=A.next}remove(A){var j=this.head;while(j){var{next:R}=j;if(A(j))this.removeLink(j);j=R}return this}}function s6(A,j){A.length=1,A.head=A.tail=j}function d5(A,j,R){if(j==null)j=1;else if(j===0)throw RangeError("Concurrency must not be zero");var b=O(A),$0=0,q0=[];let Q0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function w0(h0,P0){Q0[h0].push(P0)}function V0(h0,P0){let S0=(...K1)=>{E0(h0,S0),P0(...K1)};Q0[h0].push(S0)}function E0(h0,P0){if(!h0)return Object.keys(Q0).forEach((S0)=>Q0[S0]=[]);if(!P0)return Q0[h0]=[];Q0[h0]=Q0[h0].filter((S0)=>S0!==P0)}function q1(h0,...P0){Q0[h0].forEach((S0)=>S0(...P0))}var V1=!1;function Q1(h0,P0,S0,K1){if(K1!=null&&typeof K1!=="function")throw Error("task callback must be a function");W1.started=!0;var I4,k4;function W$(N7,...vY){if(N7)return S0?k4(N7):I4();if(vY.length<=1)return I4(vY[0]);I4(vY)}var JI=W1._createTaskItem(h0,S0?W$:K1||W$);if(P0)W1._tasks.unshift(JI);else W1._tasks.push(JI);if(!V1)V1=!0,z(()=>{V1=!1,W1.process()});if(S0||!K1)return new Promise((N7,vY)=>{I4=N7,k4=vY})}function V$(h0){return function(P0,...S0){$0-=1;for(var K1=0,I4=h0.length;K1<I4;K1++){var k4=h0[K1],W$=q0.indexOf(k4);if(W$===0)q0.shift();else if(W$>0)q0.splice(W$,1);if(k4.callback(P0,...S0),P0!=null)q1("error",P0,k4.data)}if($0<=W1.concurrency-W1.buffer)q1("unsaturated");if(W1.idle())q1("drain");W1.process()}}function YI(h0){if(h0.length===0&&W1.idle())return z(()=>q1("drain")),!0;return!1}let L7=(h0)=>(P0)=>{if(!P0)return new Promise((S0,K1)=>{V0(h0,(I4,k4)=>{if(I4)return K1(I4);S0(k4)})});E0(h0),w0(h0,P0)};var BY=!1,W1={_tasks:new O7,_createTaskItem(h0,P0){return{data:h0,callback:P0}},*[Symbol.iterator](){yield*W1._tasks[Symbol.iterator]()},concurrency:j,payload:R,buffer:j/4,started:!1,paused:!1,push(h0,P0){if(Array.isArray(h0)){if(YI(h0))return;return h0.map((S0)=>Q1(S0,!1,!1,P0))}return Q1(h0,!1,!1,P0)},pushAsync(h0,P0){if(Array.isArray(h0)){if(YI(h0))return;return h0.map((S0)=>Q1(S0,!1,!0,P0))}return Q1(h0,!1,!0,P0)},kill(){E0(),W1._tasks.empty()},unshift(h0,P0){if(Array.isArray(h0)){if(YI(h0))return;return h0.map((S0)=>Q1(S0,!0,!1,P0))}return Q1(h0,!0,!1,P0)},unshiftAsync(h0,P0){if(Array.isArray(h0)){if(YI(h0))return;return h0.map((S0)=>Q1(S0,!0,!0,P0))}return Q1(h0,!0,!0,P0)},remove(h0){W1._tasks.remove(h0)},process(){if(BY)return;BY=!0;while(!W1.paused&&$0<W1.concurrency&&W1._tasks.length){var h0=[],P0=[],S0=W1._tasks.length;if(W1.payload)S0=Math.min(S0,W1.payload);for(var K1=0;K1<S0;K1++){var I4=W1._tasks.shift();h0.push(I4),q0.push(I4),P0.push(I4.data)}if($0+=1,W1._tasks.length===0)q1("empty");if($0===W1.concurrency)q1("saturated");var k4=C(V$(h0));b(P0,k4)}BY=!1},length(){return W1._tasks.length},running(){return $0},workersList(){return q0},idle(){return W1._tasks.length+$0===0},pause(){W1.paused=!0},resume(){if(W1.paused===!1)return;W1.paused=!1,z(W1.process)}};return Object.defineProperties(W1,{saturated:{writable:!1,value:L7("saturated")},unsaturated:{writable:!1,value:L7("unsaturated")},empty:{writable:!1,value:L7("empty")},drain:{writable:!1,value:L7("drain")},error:{writable:!1,value:L7("error")}}),W1}function g0(A,j){return d5(A,1,j)}function r(A,j,R){return d5(A,j,R)}function F(A,j,R,b){b=k(b);var $0=O(R);return l0(A,(q0,Q0,w0)=>{$0(j,q0,(V0,E0)=>{j=E0,w0(V0)})},(q0)=>b(q0,j))}var M=N(F,4);function v(...A){var j=A.map(O);return function(...R){var b=this,$0=R[R.length-1];if(typeof $0=="function")R.pop();else $0=J4();return M(j,R,(q0,Q0,w0)=>{Q0.apply(b,q0.concat((V0,...E0)=>{w0(V0,E0)}))},(q0,Q0)=>$0(q0,...Q0)),$0[C1]}}function y(...A){return v(...A.reverse())}function s(A,j,R,b){return P(i(j),A,R,b)}var c=N(s,4);function e( Line truncated
GFS4: `),console.error($)};if(!H4[U6]){if(lC=global[U6]||[],uq0(H4,lC),H4.close=function($){function I(q,U){return $.call(H4,q,function(Y){if(!Y)yq0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(I,JX,{value:$}),I}(H4.close),H4.closeSync=function($){function I(q){$.apply(H4,arguments),yq0()}return Object.defineProperty(I,JX,{value:$}),I}(H4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){P3(H4[U6]),o("assert").equal(H4[U6].length,0)})}var lC;if(!global[U6])uq0(global,H4[U6]);rC.exports=mC(e41(H4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!H4.__patched)rC.exports=mC(H4),H4.__patched=!0;function mC($){a41($),$.gracefulify=mC,$.createReadStream=B,$.createWriteStream=k;var I=$.readFile;$.readFile=q;function q(S,t,p){if(typeof t==="function")p=t,t=null;return C(S,t,p);function C(n,i,J0,E){return I(n,i,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))CU([C,[n,i,J0],u,E||Date.now(),Date.now()]);else if(typeof J0==="function")J0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=Y;function Y(S,t,p,C){if(typeof p==="function")C=p,p=null;return n(S,t,p,C);function n(i,J0,E,u,d){return U(i,J0,E,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))CU([n,[i,J0,E,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var J=$.appendFile;if(J)$.appendFile=Q;function Q(S,t,p,C){if(typeof p==="function")C=p,p=null;return n(S,t,p,C);function n(i,J0,E,u,d){return J(i,J0,E,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))CU([n,[i,J0,E,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=w;function w(S,t,p,C){if(typeof p==="function")C=p,p=0;return n(S,t,p,C);function n(i,J0,E,u,d){return K(i,J0,E,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))CU([n,[i,J0,E,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var z=$.readdir;$.readdir=H;var G=/^v[0-5]\./;function H(S,t,p){if(typeof t==="function")p=t,t=null;var C=G.test(process.version)?function(J0,E,u,d){return z(J0,n(J0,E,u,d))}:function(J0,E,u,d){return z(J0,E,n(J0,E,u,d))};return C(S,t,p);function n(i,J0,E,u){return function(d,a){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))CU([C,[i,J0,E],d,u||Date.now(),Date.now()]);else{if(a&&a.sort)a.sort();if(typeof E==="function")E.call(this,d,a)}}}}if(process.version.substr(0,4)==="v0.8"){var V=s41($);N=V.ReadStream,P=V.WriteStream}var W=$.ReadStream;if(W)N.prototype=Object.create(W.prototype),N.prototype.open=T;var X=$.WriteStream;if(X)P.prototype=Object.create(X.prototype),P.prototype.open=g;Object.defineProperty($,"ReadStream",{get:function(){return N},set:function(S){N=S},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return P},set:function(S){P=S},enumerable:!0,configurable:!0});var D=N;Object.defineProperty($,"FileReadStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var O=P;Object.defineProperty($,"FileWriteStream",{get:function(){return O},set:function(S){O=S},enumerable:!0,configurable:!0});function N(S,t){if(this instanceof N)return W.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function T(){var S=this;f(S.path,S.flags,S.mode,function(t,p){if(t){if(S.autoClose)S.destroy();S.emit("error",t)}else S.fd=p,S.emit("open",p),S.read()})}function P(S,t){if(this instanceof P)return X.apply(this,arguments),this;else return P.apply(Object.create(P.prototype),arguments)}function g(){var S=this;f(S.path,S.flags,S.mode,function(t,p){if(t)S.destroy(),S.emit("error",t);else S.fd=p,S.emit("open",p)})}function B(S,t){return new $.ReadStream(S,t)}function k(S,t){return new $.WriteStream(S,t)}var h=$.open;$.open=f;function f(S,t,p,C){if(typeof p==="function")C=p,p=null;return n(S,t,p,C);function n(i,J0,E,u,d){return h(i,J0,E,function(a,K0){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))CU([n,[i,J0,E,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return $}function CU($){P3("ENQUEUE",$[0].name,$[1]),H4[U6].push($),oC()}var YX;function yq0(){var $=Date.now();for(var I=0;I<H4[U6].length;++I)if(H4[U6][I].length>2)H4[U6][I][3]=$,H4[U6][I][4]=$;oC()}function oC(){if(clearTimeout(YX),YX=void 0,H4[U6].length===0)return;var $=H4[U6].shift(),I=$[0],q=$[1],U=$[2],Y=$[3],J=$[4];if(Y===void 0)P3("RETRY",I.name,q),I.apply(null,q);else if(Date.now()-Y>=60000){P3("TIMEOUT",I.name,q);var Q=q.pop();if(typeof Q==="function")Q.call(null,U)}else{var K=Date.now()-J,w=Math.max(J-Y,1),z=Math.min(w*1.2,100);if(K>=z)P3("RETRY",I.name,q),I.apply(null,q.concat([Y]));else H4[U6].push($)}if(YX===void 0)YX=setTimeout(oC,0)}});var kq0=L((DB1,tC)=>{function I61($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var xq0=M4().Buffer,u2=o("util");function q61($,I,q){$.copy(I,q)}tC.exports=function(){function $(){I61(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.
*/KU0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var q=$.length;if(q<=1)return $;var U="";if(q>4&&$[3]==="\\"){var Y=$[2];if((Y==="?"||Y===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var J=$.split(/[/\\]+/);if(I!==!1&&J[J.length-1]==="")J.pop();return U+J.join("/")}});var Y_=L((sE1,ZU0)=>{var wU0=9007199254740991,f61="[object Arguments]",n61="[object Function]",b61="[object GeneratorFunction]",i61=/^(?:0|[1-9]\d*)$/;function GU0($,I,q){switch(q.length){case 0:return $.call(I);case 1:return $.call(I,q[0]);case 2:return $.call(I,q[0],q[1]);case 3:return $.call(I,q[0],q[1],q[2])}return $.apply(I,q)}function p61($,I){var q=-1,U=Array($);while(++q<$)U[q]=I(q);return U}var p2=Object.prototype,c2=p2.hasOwnProperty,HU0=p2.toString,c61=p2.propertyIsEnumerable,zU0=Math.max;function d61($,I){var q=I$1($)||$$1($)?p61($.length,String):[],U=q.length,Y=!!U;for(var J in $)if((I||c2.call($,J))&&!(Y&&(J=="length"||WU0(J,U))))q.push(J);return q}function l61($,I,q,U){if($===void 0||I_($,p2[q])&&!c2.call(U,q))return I;return $}function m61($,I,q){var U=$[I];if(!(c2.call($,I)&&I_(U,q))||q===void 0&&!(I in $))$[I]=q}function o61($){if(!U_($))return e61($);var I=s61($),q=[];for(var U in $)if(!(U=="constructor"&&(I||!c2.call($,U))))q.push(U);return q}function VU0($,I){return I=zU0(I===void 0?$.length-1:I,0),function(){var q=arguments,U=-1,Y=zU0(q.length-I,0),J=Array(Y);while(++U<Y)J[U]=q[I+U];U=-1;var Q=Array(I+1);while(++U<I)Q[U]=q[U];return Q[I]=J,GU0($,this,Q)}}function r61($,I,q,U){q||(q={});var Y=-1,J=I.length;while(++Y<J){var Q=I[Y],K=U?U(q[Q],$[Q],Q,q,$):void 0;m61(q,Q,K===void 0?$[Q]:K)}return q}function t61($){return VU0(function(I,q){var U=-1,Y=q.length,J=Y>1?q[Y-1]:void 0,Q=Y>2?q[2]:void 0;if(J=$.length>3&&typeof J=="function"?(Y--,J):void 0,Q&&a61(q[0],q[1],Q))J=Y<3?void 0:J,Y=1;I=Object(I);while(++U<Y){var K=q[U];if(K)$(I,K,U,J)}return I})}function WU0($,I){return I=I==null?wU0:I,!!I&&(typeof $=="number"||i61.test($))&&($>-1&&$%1==0&&$<I)}function a61($,I,q){if(!U_(q))return!1;var U=typeof I;if(U=="number"?q_(q)&&WU0(I,q.length):U=="string"&&(I in q))return I_(q[I],$);return!1}function s61($){var I=$&&$.constructor,q=typeof I=="function"&&I.prototype||p2;return $===q}function e61($){var I=[];if($!=null)for(var q in Object($))I.push(q);return I}function I_($,I){return $===I||$!==$&&I!==I}function $$1($){return q$1($)&&c2.call($,"callee")&&(!c61.call($,"callee")||HU0.call($)==f61)}var I$1=Array.isArray;function q_($){return $!=null&&Y$1($.length)&&!U$1($)}function q$1($){return J$1($)&&q_($)}function U$1($){var I=U_($)?HU0.call($):"";return I==n61||I==b61}function Y$1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=wU0}function U_($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function J$1($){return!!$&&typeof $=="object"}var Q$1=t61(function($,I,q,U){r61(I,z$1(I),$,U)}),K$1=VU0(function($){return $.push(void 0,l61),GU0(Q$1,void 0,$)});function z$1($){return q_($)?d61($,!0):o61($)}ZU0.exports=K$1});var DU0=L((eE1,J_)=>{function w$1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var XU0=N4().Buffer,d2=o("util");function G$1($,I,q){$.copy(I,q)}J_.exports=function(){function $(){w$1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(q){var U={data:q,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(q){var U={data:q,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var q=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,q},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(q){if(this.length===0)return"";var U=this.head,Y=""+U.data;while(U=U.next)Y+=q+U.data;return Y},$.prototype.concat=function(q){if(this.length===0)return XU0.alloc(0);var U=XU0.allocUnsafe(q>>>0),Y=this.head,J=0;while(Y)G$1(Y.data,U,J),J+=Y.data.length,Y=Y.next;return U},$}();if(d2&&d2.inspect&&d2.inspect.custom)J_.exports.prototype[d2.inspect.custom]=function(){var $=d2.inspect({length:this.length});return this.constructor.name+" "+$}});var Q_=L(($B1,OU0)=>{var WX=L4();function H$1($,I){var q=this,U=this._readableState&&this._readableState.destroyed,Y=this._writableState&&this._writableState.destroyed;if(U||Y){if(I)I($);else if($){if(!this._writableState)WX.nextTick(ZX,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,WX.nextTick(ZX,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!I&&J){if(!q._writableState)WX.nextTick(ZX,q,J);else if(!q._writableState.errorEmitted)q._writableState.errorEmitted=!0,WX.nextTick(ZX,q,J)}else if(I)I(J)}),this}function V$1(){if(this._readableState)this._readable Line truncated
%s`,B,B,T,U);var x=T.type==="*"?c_:T.type==="?"?p_:"\\"+T.type;Y=!0,U=U.slice(0,T.reStart)+x+"\\("+B}if(X(),J)U+="\\\\";var h=!1;switch(U.charAt(0)){case"[":case".":case"(":h=!0}for(var f=K.length-1;f>-1;f--){var S=K[f],t=U.slice(0,S.reStart),p=U.slice(S.reStart,S.reEnd-8),C=U.slice(S.reEnd-8,S.reEnd),k=U.slice(S.reEnd);C+=k;var n=t.split("(").length-1,J0=k;for(D=0;D<n;D++)J0=J0.replace(/\)[+*?]?/,"");k=J0;var j="";if(k===""&&I!==RX)j="$";var u=t+p+k+j+C;U=u}if(U!==""&&Y)U="(?=.)"+U;if(h)U=W+U;if(I===RX)return[U,Y];if(!Y)return C71($);var d=q.nocase?"i":"";try{var a=new RegExp("^"+U+"$",d)}catch(K0){return new RegExp("$.")}return a._glob=$,a._src=U,a}J$.makeRe=function($,I){return new T4($,I||{}).makeRe()};T4.prototype.makeRe=R71;function R71(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,q=I.noglobstar?c_:I.dot?A71:g71,U=I.nocase?"i":"",Y=$.map(function(J){return J.map(function(Q){return Q===R3?q:typeof Q==="string"?_71(Q):Q._src}).join("\\/")}).join("|");if(Y="^(?:"+Y+")$",this.negate)Y="^(?!"+Y+").*$";try{this.regexp=new RegExp(Y,U)}catch(J){this.regexp=!1}return this.regexp}J$.match=function($,I,q){q=q||{};var U=new T4(I,q);if($=$.filter(function(Y){return U.match(Y)}),U.options.nonull&&!$.length)$.push(I);return $};T4.prototype.match=function(I,q){if(typeof q>"u")q=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&q)return!0;var U=this.options;if(UK.sep!=="/")I=I.split(UK.sep).join("/");I=I.split(dY0),this.debug(this.pattern,"split",I);var Y=this.set;this.debug(this.pattern,"set",Y);var J,Q;for(Q=I.length-1;Q>=0;Q--)if(J=I[Q],J)break;for(Q=0;Q<Y.length;Q++){var K=Y[Q],z=I;if(U.matchBase&&K.length===1)z=[J];var w=this.matchOne(z,K,q);if(w){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};T4.prototype.matchOne=function($,I,q){if(I.indexOf(R3)!==-1)return this._matchGlobstar($,I,q,0,0);return this._matchOne($,I,q,0,0)};T4.prototype._matchGlobstar=function($,I,q,U,Y){var J,Q=-1;for(J=Y;J<I.length;J++)if(I[J]===R3){Q=J;break}var K=-1;for(J=I.length-1;J>=0;J--)if(I[J]===R3){K=J;break}var z=I.slice(Y,Q),w=q?I.slice(Q+1):I.slice(Q+1,K),G=q?[]:I.slice(K+1);if(z.length){var H=$.slice(U,U+z.length);if(!this._matchOne(H,z,q,0,0))return!1;U+=z.length}var W=0;if(G.length){if(G.length+U>$.length)return!1;var V=$.length-G.length;if(this._matchOne($,G,q,V,0))W=G.length;else{if($[$.length-1]!==""||U+G.length===$.length)return!1;if(V--,!this._matchOne($,G,q,V,0))return!1;W=G.length+1}}if(!w.length){var X=!!W;for(J=U;J<$.length-W;J++){var D=String($[J]);if(X=!0,D==="."||D===".."||!this.options.dot&&D.charAt(0)===".")return!1}return q||X}var O=[[[],0]],N=O[0],T=0,P=[0];for(var g=0;g<w.length;g++){var B=w[g];if(B===R3)P.push(T),N=[[],0],O.push(N);else N[0].push(B),T++}var x=O.length-1,h=$.length-W;for(var f=0;f<O.length;f++)O[f][1]=h-(P[x--]+O[f][0].length);return!!this._matchGlobStarBodySections($,O,U,0,q,0,!!W)};T4.prototype._matchGlobStarBodySections=function($,I,q,U,Y,J,Q){var K=I[U];if(!K){for(var z=q;z<$.length;z++){Q=!0;var w=$[z];if(w==="."||w===".."||!this.options.dot&&w.charAt(0)===".")return!1}return Q}var G=K[0],H=K[1];while(q<=H){var W=this._matchOne($.slice(0,q+G.length),G,Y,q,0);if(W&&J<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,q+G.length,U+1,Y,J+1,Q);if(V!==!1)return V}var w=$[q];if(w==="."||w===".."||!this.options.dot&&w.charAt(0)===".")return!1;q++}return Y||null};T4.prototype._matchOne=function($,I,q,U,Y){var J,Q,K,z;for(J=U,Q=Y,K=$.length,z=I.length;J<K&&Q<z;J++,Q++){this.debug("matchOne loop");var w=I[Q],G=$[J];if(this.debug(I,w,G),w===!1||w===R3)return!1;var H;if(typeof w==="string")H=G===w,this.debug("string match",w,G,H);else H=G.match(w),this.debug("pattern match",w,G,H);if(!H)return!1}if(J===K&&Q===z)return!0;else if(J===K)return q;else if(Q===z)return J===K-1&&$[J]==="";throw Error("wtf?")};function C71($){return $.replace(/\\(.)/g,"$1")}function _71($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var SX=L((NB1,hX)=>{function oY0($){return $.charAt(0)==="/"}function rY0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,q=I.exec($),U=q[1]||"",Y=Boolean(U&&U.charAt(1)!==":");return Boolean(q[2]||Y)}hX.exports=process.platform==="win32"?rY0:oY0;hX.exports.posix=oY0;hX.exports.win32=rY0});var l_=L((i71)=>{i71.setopts=k71;i71.ownProp=tY0;i71.makeAbs=YK;i71.finish=f71;i71.mark=n71;i71.isIgnored=sY0;i71.childrenIgnored=b71;function tY0($,I){return Object.prototype.hasOwnProperty.call($,I)}var h71=o("fs"),iU=o("path"),S71=_X(),aY0=SX(),d_=S71.Minimatch;function y71($,I){return $.localeCompare(I,"en")}function u71($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(x71)}function x71($){var I=null;if($.slice(-3)==="/**"){var q=$.replace(/(\/\*\*)+$/,"");I=new d_(q,{dot:!0})}return{matcher Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new h4($,I).found}function h4($,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 h4))return new h4($,I);if(a71(this,$,I),this.noprocess)return this;var q=this.minimatch.set.length;this.matches=Array(q);for(var U=0;U<q;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}h4.prototype._finish=function(){if($J0.ok(this instanceof h4),this.realpath){var $=this;this.matches.forEach(function(I,q){var U=$.matches[q]=Object.create(null);for(var Y in I)try{Y=$._makeAbs(Y);var J=t71.realpathSync(Y,$.realpathCache);U[J]=!0}catch(Q){if(Q.syscall==="stat")U[$._makeAbs(Y)]=!0;else throw Q}})}C3.finish(this)};h4.prototype._process=function($,I,q){$J0.ok(this instanceof h4);var U=0;while(typeof $[U]==="string")U++;var Y;switch(U){case $.length:this._processSimple($.join("/"),I);return;case 0:Y=null;break;default:Y=$.slice(0,U).join("/");break}var J=$.slice(U),Q;if(Y===null)Q=".";else if(yX(Y)||yX($.map(function(w){return typeof w==="string"?w:"[*]"}).join("/"))){if(!Y||!yX(Y))Y="/"+Y;Q=Y}else Q=Y;var K=this._makeAbs(Q);if(s71(this,Q))return;var z=J[0]===eY0.GLOBSTAR;if(z)this._processGlobStar(Y,Q,K,J,I,q);else this._processReaddir(Y,Q,K,J,I,q)};h4.prototype._processReaddir=function($,I,q,U,Y,J){var Q=this._readdir(q,J);if(!Q)return;var K=U[0],z=!!this.minimatch.negate,w=K._glob,G=this.dot||w.charAt(0)===".",H=[];for(var W=0;W<Q.length;W++){var V=Q[W];if(V.charAt(0)!=="."||G){var X;if(z&&!$)X=!V.match(K);else X=V.match(K);if(X)H.push(V)}}var D=H.length;if(D===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[Y])this.matches[Y]=Object.create(null);for(var W=0;W<D;W++){var V=H[W];if($)if($.slice(-1)!=="/")V=$+"/"+V;else V=$+V;if(V.charAt(0)==="/"&&!this.nomount)V=m_.join(this.root,V);this._emitMatch(Y,V)}return}U.shift();for(var W=0;W<D;W++){var V=H[W],O;if($)O=[$,V];else O=[V];this._process(O.concat(U),Y,J)}};h4.prototype._emitMatch=function($,I){if(e71(this,I))return;var q=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=q;if(this.matches[$][I])return;if(this.nodir){var U=this.cache[q];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};h4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,q,U;try{q=this.fs.lstatSync($)}catch(J){if(J.code==="ENOENT")return null}var Y=q&&q.isSymbolicLink();if(this.symlinks[$]=Y,!Y&&q&&!q.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};h4.prototype._readdir=function($,I){var q;if(I&&!o_(this.symlinks,$))return this._readdirInGlobStar($);if(o_(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(Y){return this._readdirError($,Y),null}};h4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var q=0;q<I.length;q++){var U=I[q];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=I,I};h4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var q=this._makeAbs($);if(this.cache[q]="FILE",q===this.cwdAbs){var U=Error(I.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=I.code,U}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}};h4.prototype._processGlobStar=function($,I,q,U,Y,J){var Q=this._readdir(q,J);if(!Q)return;var K=U.slice(1),z=$?[$]:[],w=z.concat(K);this._process(w,Y,!1);var G=Q.length,H=this.symlinks[q];if(H&&J)return;for(var W=0;W<G;W++){var V=Q[W];if(V.charAt(0)==="."&&!this.dot)continue;var X=z.concat(Q[W],K);this._process(X,Y,!0);var D=z.concat(Q[W],U);this._process(D,Y,!0)}};h4.prototype._processSimple=function($,I){var q=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!q)return;if($&&yX($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=m_.join(this.root,$);else if($=m_.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};h4.prototype._stat=function($){var I=this._makeAbs($),q=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&o_(this.cache,I)){var Q=this.cache[I];if(Array.isArray(Q))Q="DIR";if(!q||Q==="DIR")return Q;if(q&&Q==="FILE")return!1}var U,Y=this.statCache[I];if(!Y){var J;try{J=this.fs.lstatSync(I)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[I]=!1,!1}if(J&&J.isSymbolicLink())try{Y=this.fs.statSync(I)}catch(K){Y=J}else Y=J}this.statCache[I]=Y;var Q=!0;if(Y)Q=Y.isDirectory()?"DIR":"FILE";if(this.cache[I]=this.cache[I]||Q,q&&Q==="FILE")return!1;return Q};h4.prototype._mark=function($){return C3.mark(this,$)};h4.prototype._makeAbs=function($){return C3.makeAbs(this,$)}});var r_=L((TB1,JJ0)=>{JJ0.exports=YJ0;function YJ0($,I){if($&&I)return YJ0($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){q[U]=$[U]}),q;f Line truncated
`);if($.linkname)I+=Eh(" linkpath="+$.linkname+`
`);var q=$.pax;if(q)for(var U in q)I+=Eh(" "+U+"="+q[U]+`
`);return Buffer.from(I)};XI1.decodePax=function($){var I={};while($.length){var q=0;while(q<$.length&&$[q]!==32)q++;var U=parseInt($.slice(0,q).toString(),10);if(!U)return I;var Y=$.slice(q+1,U-1).toString(),J=Y.indexOf("=");if(J===-1)return I;I[Y.slice(0,J)]=Y.slice(J+1),$=$.slice(U)}return I};XI1.encode=function($){var I=YI1(512),q=$.name,U="";if($.typeflag===5&&q[q.length-1]!=="/")q+="/";if(Buffer.byteLength(q)!==q.length)return null;while(Buffer.byteLength(q)>100){var Y=q.indexOf("/");if(Y===-1)return null;U+=U?"/"+q.slice(0,Y):q.slice(0,Y),q=q.slice(Y+1)}if(Buffer.byteLength(q)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(q),I.write(a9($.mode&GI1,6),100),I.write(a9($.uid,6),108),I.write(a9($.gid,6),116),I.write(a9($.size,11),124),I.write(a9($.mtime.getTime()/1000|0,11),136),I[156]=gQ0+WI1($.type),$.linkname)I.write($.linkname,157);if(PQ0.copy(I,GK),KI1.copy(I,Bh),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write(a9($.devmajor||0,6),329),I.write(a9($.devminor||0,6),337),U)I.write(U,345);return I.write(a9(jQ0(I),6),148),I};XI1.decode=function($,I,q){var U=$[156]===0?0:$[156]-gQ0,Y=lU($,0,100,I),J=s9($,100,8),Q=s9($,108,8),K=s9($,116,8),z=s9($,124,12),w=s9($,136,12),G=VI1(U),H=$[157]===0?null:lU($,157,100,I),W=lU($,265,32),V=lU($,297,32),X=s9($,329,8),D=s9($,337,8),O=jQ0($);if(O===256)return null;if(O!==s9($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(PQ0.compare($,GK,GK+6)===0){if($[345])Y=lU($,345,155,I)+"/"+Y}else if(zI1.compare($,GK,GK+6)===0&&wI1.compare($,Bh,Bh+2)===0);else if(!q)throw Error("Invalid tar header: unknown format.");if(U===0&&Y&&Y[Y.length-1]==="/")U=5;return{name:Y,mode:J,uid:Q,gid:K,size:z,mtime:new Date(1000*w),type:G,linkname:H,uname:W,gname:V,devmajor:X,devminor:D}}});var hQ0=L((Qv1,_Q0)=>{var BQ0=o("util"),MI1=AQ0(),HK=vh(),vQ0=W6().Writable,RQ0=W6().PassThrough,CQ0=function(){},EQ0=function($){return $&=511,$&&512-$},AI1=function($,I){var q=new iX($,I);return q.end(),q},gI1=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,$},iX=function($,I){this._parent=$,this.offset=I,RQ0.call(this,{autoDestroy:!1})};BQ0.inherits(iX,RQ0);iX.prototype.destroy=function($){this._parent.destroy($)};var E5=function($){if(!(this instanceof E5))return new E5($);vQ0.call(this,$),$=$||{},this._offset=0,this._buffer=MI1(),this._missing=0,this._partial=!1,this._onparse=CQ0,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,q=I._buffer,U=function(){I._continue()},Y=function(W){if(I._locked=!1,W)return I.destroy(W);if(!I._stream)U()},J=function(){I._stream=null;var W=EQ0(I._header.size);if(W)I._parse(W,Q);else I._parse(512,H);if(!I._locked)U()},Q=function(){I._buffer.consume(EQ0(I._header.size)),I._parse(512,H),U()},K=function(){var W=I._header.size;I._paxGlobal=HK.decodePax(q.slice(0,W)),q.consume(W),J()},z=function(){var W=I._header.size;if(I._pax=HK.decodePax(q.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);q.consume(W),J()},w=function(){var W=I._header.size;this._gnuLongPath=HK.decodeLongPath(q.slice(0,W),$.filenameEncoding),q.consume(W),J()},G=function(){var W=I._header.size;this._gnuLongLinkPath=HK.decodeLongPath(q.slice(0,W),$.filenameEncoding),q.consume(W),J()},H=function(){var W=I._offset,V;try{V=I._header=HK.decode(q.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(q.consume(512),!V){I._parse(512,H),U();return}if(V.type==="gnu-long-path"){I._parse(V.size,w),U();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,G),U();return}if(V.type==="pax-global-header"){I._parse(V.size,K),U();return}if(V.type==="pax-header"){I._parse(V.size,z),U();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=gI1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,H),I.emit("entry",V,AI1(I,W),Y);return}I._stream=new iX(I,W),I.emit("entry",V,I._stream,Y),I._parse(V.size,J),U()};this._onheader=H,this._parse(512,H)};BQ0.inherits(E5,vQ0);E5.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};E5.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};E5.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=CQ0,this._overflow)this._write(this._overflow,void 0,$);else $()};E5.prototype._write=function($,I,q){if(this._destroyed)return;var U=this._stream,Y=this._buffer,J=this._missing;if($.length)this._partial=!0;if($.length<J){ 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="${iI1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}J20.exports=Y20});var H20=L((Dv1,G20)=>{var K20=e4(),z20=S9(),cI1=K4(),dI1=zR(),lI1=GR();class w20{constructor($,I,q){this.id=q.id,this.count=0,this._worksheet=$,this._workbook=q.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:z20.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:z20.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 q=new dI1,U=new K20;q.render(U,$),this.commentsStream.write(U.xml);let Y=new lI1,J=new K20;Y.render(J,$,I),this.vmlStream.write(J.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=cI1.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()}}G20.exports=w20});var O20=L((Ov1,D20)=>{var mI1=W4(),oI1=S9(),_h=K4(),V20=jj(),W20=J5(),rI1=bB(),Z20=QV(),hh=zV(),tI1=Q20(),aI1=H20(),sI1=Pj(),f4=new rI1,Sh=C9(),eI1=uv(),$q1=xv(),Iq1=kv(),qq1=_v(),Uq1=Rv(),Yq1=hv(),Jq1=fv(),Qq1=nv(),Kq1=bv(),zq1=iv(),wq1=pv(),Gq1=cv(),Hq1=rv(),Vq1=lv(),Wq1=dv(),n4={dataValidations:new eI1,sheetProperties:new $q1,sheetFormatProperties:new Iq1,columns:new Sh({tag:"cols",length:!1,childXform:new qq1}),row:new Uq1,hyperlinks:new Sh({tag:"hyperlinks",length:!1,childXform:new Yq1}),sheetViews:new Sh({tag:"sheetViews",length:!1,childXform:new Jq1}),sheetProtection:new Qq1,pageMargins:new Kq1,pageSeteup:new zq1,autoFilter:new wq1,picture:new Gq1,conditionalFormattings:new Hq1,headerFooter:new Vq1,rowBreaks:new Wq1};class X20{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 tI1($),this._sheetCommentsWriter=new aI1(this,this._sheetRelsWriter,$),this._dimensions=new W20,this._rowZero=1,this.committed=!1,this.dataValidations=new sI1,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
*/PU0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var q=$.length;if(q<=1)return $;var U="";if(q>4&&$[3]==="\\"){var Y=$[2];if((Y==="?"||Y===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var J=$.split(/[/\\]+/);if(I!==!1&&J[J.length-1]==="")J.pop();return U+J.join("/")}});var D_=L((BB1,CU0)=>{var EU0=9007199254740991,w$1="[object Arguments]",z$1="[object Function]",G$1="[object GeneratorFunction]",H$1=/^(?:0|[1-9]\d*)$/;function jU0($,I,q){switch(q.length){case 0:return $.call(I);case 1:return $.call(I,q[0]);case 2:return $.call(I,q[0],q[1]);case 3:return $.call(I,q[0],q[1],q[2])}return $.apply(I,q)}function V$1($,I){var q=-1,U=Array($);while(++q<$)U[q]=I(q);return U}var d2=Object.prototype,l2=d2.hasOwnProperty,BU0=d2.toString,W$1=d2.propertyIsEnumerable,TU0=Math.max;function Z$1($,I){var q=P$1($)||g$1($)?V$1($.length,String):[],U=q.length,Y=!!U;for(var J in $)if((I||l2.call($,J))&&!(Y&&(J=="length"||RU0(J,U))))q.push(J);return q}function X$1($,I,q,U){if($===void 0||W_($,d2[q])&&!l2.call(U,q))return I;return $}function D$1($,I,q){var U=$[I];if(!(l2.call($,I)&&W_(U,q))||q===void 0&&!(I in $))$[I]=q}function O$1($){if(!X_($))return A$1($);var I=M$1($),q=[];for(var U in $)if(!(U=="constructor"&&(I||!l2.call($,U))))q.push(U);return q}function vU0($,I){return I=TU0(I===void 0?$.length-1:I,0),function(){var q=arguments,U=-1,Y=TU0(q.length-I,0),J=Array(Y);while(++U<Y)J[U]=q[I+U];U=-1;var Q=Array(I+1);while(++U<I)Q[U]=q[U];return Q[I]=J,jU0($,this,Q)}}function L$1($,I,q,U){q||(q={});var Y=-1,J=I.length;while(++Y<J){var Q=I[Y],K=U?U(q[Q],$[Q],Q,q,$):void 0;D$1(q,Q,K===void 0?$[Q]:K)}return q}function N$1($){return vU0(function(I,q){var U=-1,Y=q.length,J=Y>1?q[Y-1]:void 0,Q=Y>2?q[2]:void 0;if(J=$.length>3&&typeof J=="function"?(Y--,J):void 0,Q&&F$1(q[0],q[1],Q))J=Y<3?void 0:J,Y=1;I=Object(I);while(++U<Y){var K=q[U];if(K)$(I,K,U,J)}return I})}function RU0($,I){return I=I==null?EU0:I,!!I&&(typeof $=="number"||H$1.test($))&&($>-1&&$%1==0&&$<I)}function F$1($,I,q){if(!X_(q))return!1;var U=typeof I;if(U=="number"?Z_(q)&&RU0(I,q.length):U=="string"&&(I in q))return W_(q[I],$);return!1}function M$1($){var I=$&&$.constructor,q=typeof I=="function"&&I.prototype||d2;return $===q}function A$1($){var I=[];if($!=null)for(var q in Object($))I.push(q);return I}function W_($,I){return $===I||$!==$&&I!==I}function g$1($){return T$1($)&&l2.call($,"callee")&&(!W$1.call($,"callee")||BU0.call($)==w$1)}var P$1=Array.isArray;function Z_($){return $!=null&&j$1($.length)&&!E$1($)}function T$1($){return B$1($)&&Z_($)}function E$1($){var I=X_($)?BU0.call($):"";return I==z$1||I==G$1}function j$1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=EU0}function X_($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function B$1($){return!!$&&typeof $=="object"}var v$1=N$1(function($,I,q,U){L$1(I,C$1(I),$,U)}),R$1=vU0(function($){return $.push(void 0,X$1),jU0(v$1,void 0,$)});function C$1($){return Z_($)?Z$1($,!0):O$1($)}CU0.exports=R$1});var hU0=L((vB1,O_)=>{function _$1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var _U0=M4().Buffer,m2=o("util");function h$1($,I,q){$.copy(I,q)}O_.exports=function(){function $(){_$1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(q){var U={data:q,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(q){var U={data:q,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var q=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,q},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(q){if(this.length===0)return"";var U=this.head,Y=""+U.data;while(U=U.next)Y+=q+U.data;return Y},$.prototype.concat=function(q){if(this.length===0)return _U0.alloc(0);var U=_U0.allocUnsafe(q>>>0),Y=this.head,J=0;while(Y)h$1(Y.data,U,J),J+=Y.data.length,Y=Y.next;return U},$}();if(m2&&m2.inspect&&m2.inspect.custom)O_.exports.prototype[m2.inspect.custom]=function(){var $=m2.inspect({length:this.length});return this.constructor.name+" "+$}});var L_=L((RB1,SU0)=>{var LX=F4();function S$1($,I){var q=this,U=this._readableState&&this._readableState.destroyed,Y=this._writableState&&this._writableState.destroyed;if(U||Y){if(I)I($);else if($){if(!this._writableState)LX.nextTick(NX,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,LX.nextTick(NX,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!I&&J){if(!q._writableState)LX.nextTick(NX,q,J);else if(!q._writableState.errorEmitted)q._writableState.errorEmitted=!0,LX.nextTick(NX,q,J)}else if(I)I(J)}),this}function y$1(){if(this._readableState)this._readable Line truncated
%s`,B,B,T,U);var k=T.type==="*"?qh:T.type==="?"?Ih:"\\"+T.type;Y=!0,U=U.slice(0,T.reStart)+k+"\\("+B}if(X(),J)U+="\\\\";var h=!1;switch(U.charAt(0)){case"[":case".":case"(":h=!0}for(var f=K.length-1;f>-1;f--){var S=K[f],t=U.slice(0,S.reStart),p=U.slice(S.reStart,S.reEnd-8),C=U.slice(S.reEnd-8,S.reEnd),n=U.slice(S.reEnd);C+=n;var i=t.split("(").length-1,J0=n;for(D=0;D<i;D++)J0=J0.replace(/\)[+*?]?/,"");n=J0;var E="";if(n===""&&I!==yX)E="$";var u=t+p+n+E+C;U=u}if(U!==""&&Y)U="(?=.)"+U;if(h)U=V+U;if(I===yX)return[U,Y];if(!Y)return $31($);var d=q.nocase?"i":"";try{var a=new RegExp("^"+U+"$",d)}catch(K0){return new RegExp("$.")}return a._glob=$,a._src=U,a}Q$.makeRe=function($,I){return new E4($,I||{}).makeRe()};E4.prototype.makeRe=e71;function e71(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,q=I.noglobstar?qh:I.dot?d71:l71,U=I.nocase?"i":"",Y=$.map(function(J){return J.map(function(Q){return Q===_3?q:typeof Q==="string"?I31(Q):Q._src}).join("\\/")}).join("|");if(Y="^(?:"+Y+")$",this.negate)Y="^(?!"+Y+").*$";try{this.regexp=new RegExp(Y,U)}catch(J){this.regexp=!1}return this.regexp}Q$.match=function($,I,q){q=q||{};var U=new E4(I,q);if($=$.filter(function(Y){return U.match(Y)}),U.options.nonull&&!$.length)$.push(I);return $};E4.prototype.match=function(I,q){if(typeof q>"u")q=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&q)return!0;var U=this.options;if(JK.sep!=="/")I=I.split(JK.sep).join("/");I=I.split(wJ0),this.debug(this.pattern,"split",I);var Y=this.set;this.debug(this.pattern,"set",Y);var J,Q;for(Q=I.length-1;Q>=0;Q--)if(J=I[Q],J)break;for(Q=0;Q<Y.length;Q++){var K=Y[Q],w=I;if(U.matchBase&&K.length===1)w=[J];var z=this.matchOne(w,K,q);if(z){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};E4.prototype.matchOne=function($,I,q){if(I.indexOf(_3)!==-1)return this._matchGlobstar($,I,q,0,0);return this._matchOne($,I,q,0,0)};E4.prototype._matchGlobstar=function($,I,q,U,Y){var J,Q=-1;for(J=Y;J<I.length;J++)if(I[J]===_3){Q=J;break}var K=-1;for(J=I.length-1;J>=0;J--)if(I[J]===_3){K=J;break}var w=I.slice(Y,Q),z=q?I.slice(Q+1):I.slice(Q+1,K),G=q?[]:I.slice(K+1);if(w.length){var H=$.slice(U,U+w.length);if(!this._matchOne(H,w,q,0,0))return!1;U+=w.length}var V=0;if(G.length){if(G.length+U>$.length)return!1;var W=$.length-G.length;if(this._matchOne($,G,q,W,0))V=G.length;else{if($[$.length-1]!==""||U+G.length===$.length)return!1;if(W--,!this._matchOne($,G,q,W,0))return!1;V=G.length+1}}if(!z.length){var X=!!V;for(J=U;J<$.length-V;J++){var D=String($[J]);if(X=!0,D==="."||D===".."||!this.options.dot&&D.charAt(0)===".")return!1}return q||X}var O=[[[],0]],N=O[0],T=0,P=[0];for(var g=0;g<z.length;g++){var B=z[g];if(B===_3)P.push(T),N=[[],0],O.push(N);else N[0].push(B),T++}var k=O.length-1,h=$.length-V;for(var f=0;f<O.length;f++)O[f][1]=h-(P[k--]+O[f][0].length);return!!this._matchGlobStarBodySections($,O,U,0,q,0,!!V)};E4.prototype._matchGlobStarBodySections=function($,I,q,U,Y,J,Q){var K=I[U];if(!K){for(var w=q;w<$.length;w++){Q=!0;var z=$[w];if(z==="."||z===".."||!this.options.dot&&z.charAt(0)===".")return!1}return Q}var G=K[0],H=K[1];while(q<=H){var V=this._matchOne($.slice(0,q+G.length),G,Y,q,0);if(V&&J<this.maxGlobstarRecursion){var W=this._matchGlobStarBodySections($,I,q+G.length,U+1,Y,J+1,Q);if(W!==!1)return W}var z=$[q];if(z==="."||z===".."||!this.options.dot&&z.charAt(0)===".")return!1;q++}return Y||null};E4.prototype._matchOne=function($,I,q,U,Y){var J,Q,K,w;for(J=U,Q=Y,K=$.length,w=I.length;J<K&&Q<w;J++,Q++){this.debug("matchOne loop");var z=I[Q],G=$[J];if(this.debug(I,z,G),z===!1||z===_3)return!1;var H;if(typeof z==="string")H=G===z,this.debug("string match",z,G,H);else H=G.match(z),this.debug("pattern match",z,G,H);if(!H)return!1}if(J===K&&Q===w)return!0;else if(J===K)return q;else if(Q===w)return J===K-1&&$[J]==="";throw Error("wtf?")};function $31($){return $.replace(/\\(.)/g,"$1")}function I31($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var fX=L((rB1,kX)=>{function HJ0($){return $.charAt(0)==="/"}function VJ0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,q=I.exec($),U=q[1]||"",Y=Boolean(U&&U.charAt(1)!==":");return Boolean(q[2]||Y)}kX.exports=process.platform==="win32"?VJ0:HJ0;kX.exports.posix=HJ0;kX.exports.win32=VJ0});var Yh=L((H31)=>{H31.setopts=K31;H31.ownProp=WJ0;H31.makeAbs=QK;H31.finish=w31;H31.mark=z31;H31.isIgnored=XJ0;H31.childrenIgnored=G31;function WJ0($,I){return Object.prototype.hasOwnProperty.call($,I)}var q31=o("fs"),cU=o("path"),U31=xX(),ZJ0=fX(),Uh=U31.Minimatch;function Y31($,I){return $.localeCompare(I,"en")}function J31($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(Q31)}function Q31($){var I=null;if($.slice(-3)==="/**"){var q=$.replace(/(\/\*\*)+$/,"");I=new Uh(q,{dot:!0})}return{matcher Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new S4($,I).found}function S4($,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 S4))return new S4($,I);if(F31(this,$,I),this.noprocess)return this;var q=this.minimatch.set.length;this.matches=Array(q);for(var U=0;U<q;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}S4.prototype._finish=function(){if(OJ0.ok(this instanceof S4),this.realpath){var $=this;this.matches.forEach(function(I,q){var U=$.matches[q]=Object.create(null);for(var Y in I)try{Y=$._makeAbs(Y);var J=N31.realpathSync(Y,$.realpathCache);U[J]=!0}catch(Q){if(Q.syscall==="stat")U[$._makeAbs(Y)]=!0;else throw Q}})}h3.finish(this)};S4.prototype._process=function($,I,q){OJ0.ok(this instanceof S4);var U=0;while(typeof $[U]==="string")U++;var Y;switch(U){case $.length:this._processSimple($.join("/"),I);return;case 0:Y=null;break;default:Y=$.slice(0,U).join("/");break}var J=$.slice(U),Q;if(Y===null)Q=".";else if(nX(Y)||nX($.map(function(z){return typeof z==="string"?z:"[*]"}).join("/"))){if(!Y||!nX(Y))Y="/"+Y;Q=Y}else Q=Y;var K=this._makeAbs(Q);if(M31(this,Q))return;var w=J[0]===DJ0.GLOBSTAR;if(w)this._processGlobStar(Y,Q,K,J,I,q);else this._processReaddir(Y,Q,K,J,I,q)};S4.prototype._processReaddir=function($,I,q,U,Y,J){var Q=this._readdir(q,J);if(!Q)return;var K=U[0],w=!!this.minimatch.negate,z=K._glob,G=this.dot||z.charAt(0)===".",H=[];for(var V=0;V<Q.length;V++){var W=Q[V];if(W.charAt(0)!=="."||G){var X;if(w&&!$)X=!W.match(K);else X=W.match(K);if(X)H.push(W)}}var D=H.length;if(D===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[Y])this.matches[Y]=Object.create(null);for(var V=0;V<D;V++){var W=H[V];if($)if($.slice(-1)!=="/")W=$+"/"+W;else W=$+W;if(W.charAt(0)==="/"&&!this.nomount)W=Jh.join(this.root,W);this._emitMatch(Y,W)}return}U.shift();for(var V=0;V<D;V++){var W=H[V],O;if($)O=[$,W];else O=[W];this._process(O.concat(U),Y,J)}};S4.prototype._emitMatch=function($,I){if(A31(this,I))return;var q=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=q;if(this.matches[$][I])return;if(this.nodir){var U=this.cache[q];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};S4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,q,U;try{q=this.fs.lstatSync($)}catch(J){if(J.code==="ENOENT")return null}var Y=q&&q.isSymbolicLink();if(this.symlinks[$]=Y,!Y&&q&&!q.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};S4.prototype._readdir=function($,I){var q;if(I&&!Qh(this.symlinks,$))return this._readdirInGlobStar($);if(Qh(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(Y){return this._readdirError($,Y),null}};S4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var q=0;q<I.length;q++){var U=I[q];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=I,I};S4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var q=this._makeAbs($);if(this.cache[q]="FILE",q===this.cwdAbs){var U=Error(I.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=I.code,U}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}};S4.prototype._processGlobStar=function($,I,q,U,Y,J){var Q=this._readdir(q,J);if(!Q)return;var K=U.slice(1),w=$?[$]:[],z=w.concat(K);this._process(z,Y,!1);var G=Q.length,H=this.symlinks[q];if(H&&J)return;for(var V=0;V<G;V++){var W=Q[V];if(W.charAt(0)==="."&&!this.dot)continue;var X=w.concat(Q[V],K);this._process(X,Y,!0);var D=w.concat(Q[V],U);this._process(D,Y,!0)}};S4.prototype._processSimple=function($,I){var q=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!q)return;if($&&nX($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=Jh.join(this.root,$);else if($=Jh.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};S4.prototype._stat=function($){var I=this._makeAbs($),q=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Qh(this.cache,I)){var Q=this.cache[I];if(Array.isArray(Q))Q="DIR";if(!q||Q==="DIR")return Q;if(q&&Q==="FILE")return!1}var U,Y=this.statCache[I];if(!Y){var J;try{J=this.fs.lstatSync(I)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[I]=!1,!1}if(J&&J.isSymbolicLink())try{Y=this.fs.statSync(I)}catch(K){Y=J}else Y=J}this.statCache[I]=Y;var Q=!0;if(Y)Q=Y.isDirectory()?"DIR":"FILE";if(this.cache[I]=this.cache[I]||Q,q&&Q==="FILE")return!1;return Q};S4.prototype._mark=function($){return h3.mark(this,$)};S4.prototype._makeAbs=function($){return h3.makeAbs(this,$)}});var Kh=L((Iv1,AJ0)=>{AJ0.exports=MJ0;function MJ0($,I){if($&&I)return MJ0($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){q[U]=$[U]}),q;f Line truncated
`);if($.linkname)I+=fh(" linkpath="+$.linkname+`
`);var q=$.pax;if(q)for(var U in q)I+=fh(" "+U+"="+q[U]+`
`);return Buffer.from(I)};kI1.decodePax=function($){var I={};while($.length){var q=0;while(q<$.length&&$[q]!==32)q++;var U=parseInt($.slice(0,q).toString(),10);if(!U)return I;var Y=$.slice(q+1,U-1).toString(),J=Y.indexOf("=");if(J===-1)return I;I[Y.slice(0,J)]=Y.slice(J+1),$=$.slice(U)}return I};kI1.encode=function($){var I=jI1(512),q=$.name,U="";if($.typeflag===5&&q[q.length-1]!=="/")q+="/";if(Buffer.byteLength(q)!==q.length)return null;while(Buffer.byteLength(q)>100){var Y=q.indexOf("/");if(Y===-1)return null;U+=U?"/"+q.slice(0,Y):q.slice(0,Y),q=q.slice(Y+1)}if(Buffer.byteLength(q)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(q),I.write($7($.mode&hI1,6),100),I.write($7($.uid,6),108),I.write($7($.gid,6),116),I.write($7($.size,11),124),I.write($7($.mtime.getTime()/1000|0,11),136),I[156]=nQ0+uI1($.type),$.linkname)I.write($.linkname,157);if(iQ0.copy(I,VK),RI1.copy(I,nh),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write($7($.devmajor||0,6),329),I.write($7($.devminor||0,6),337),U)I.write(U,345);return I.write($7(pQ0(I),6),148),I};kI1.decode=function($,I,q){var U=$[156]===0?0:$[156]-nQ0,Y=oU($,0,100,I),J=I7($,100,8),Q=I7($,108,8),K=I7($,116,8),w=I7($,124,12),z=I7($,136,12),G=yI1(U),H=$[157]===0?null:oU($,157,100,I),V=oU($,265,32),W=oU($,297,32),X=I7($,329,8),D=I7($,337,8),O=pQ0($);if(O===256)return null;if(O!==I7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(iQ0.compare($,VK,VK+6)===0){if($[345])Y=oU($,345,155,I)+"/"+Y}else if(CI1.compare($,VK,VK+6)===0&&_I1.compare($,nh,nh+2)===0);else if(!q)throw Error("Invalid tar header: unknown format.");if(U===0&&Y&&Y[Y.length-1]==="/")U=5;return{name:Y,mode:J,uid:Q,gid:K,size:w,mtime:new Date(1000*z),type:G,linkname:H,uname:V,gname:W,devmajor:X,devminor:D}}});var tQ0=L((uv1,rQ0)=>{var dQ0=o("util"),cI1=fQ0(),WK=ih(),lQ0=Z6().Writable,mQ0=Z6().PassThrough,oQ0=function(){},cQ0=function($){return $&=511,$&&512-$},dI1=function($,I){var q=new mX($,I);return q.end(),q},lI1=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,$},mX=function($,I){this._parent=$,this.offset=I,mQ0.call(this,{autoDestroy:!1})};dQ0.inherits(mX,mQ0);mX.prototype.destroy=function($){this._parent.destroy($)};var _5=function($){if(!(this instanceof _5))return new _5($);lQ0.call(this,$),$=$||{},this._offset=0,this._buffer=cI1(),this._missing=0,this._partial=!1,this._onparse=oQ0,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,q=I._buffer,U=function(){I._continue()},Y=function(V){if(I._locked=!1,V)return I.destroy(V);if(!I._stream)U()},J=function(){I._stream=null;var V=cQ0(I._header.size);if(V)I._parse(V,Q);else I._parse(512,H);if(!I._locked)U()},Q=function(){I._buffer.consume(cQ0(I._header.size)),I._parse(512,H),U()},K=function(){var V=I._header.size;I._paxGlobal=WK.decodePax(q.slice(0,V)),q.consume(V),J()},w=function(){var V=I._header.size;if(I._pax=WK.decodePax(q.slice(0,V)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);q.consume(V),J()},z=function(){var V=I._header.size;this._gnuLongPath=WK.decodeLongPath(q.slice(0,V),$.filenameEncoding),q.consume(V),J()},G=function(){var V=I._header.size;this._gnuLongLinkPath=WK.decodeLongPath(q.slice(0,V),$.filenameEncoding),q.consume(V),J()},H=function(){var V=I._offset,W;try{W=I._header=WK.decode(q.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(q.consume(512),!W){I._parse(512,H),U();return}if(W.type==="gnu-long-path"){I._parse(W.size,z),U();return}if(W.type==="gnu-long-link-path"){I._parse(W.size,G),U();return}if(W.type==="pax-global-header"){I._parse(W.size,K),U();return}if(W.type==="pax-header"){I._parse(W.size,w),U();return}if(I._gnuLongPath)W.name=I._gnuLongPath,I._gnuLongPath=null;if(I._gnuLongLinkPath)W.linkname=I._gnuLongLinkPath,I._gnuLongLinkPath=null;if(I._pax)I._header=W=lI1(W,I._pax),I._pax=null;if(I._locked=!0,!W.size||W.type==="directory"){I._parse(512,H),I.emit("entry",W,dI1(I,V),Y);return}I._stream=new mX(I,V),I.emit("entry",W,I._stream,Y),I._parse(W.size,J),U()};this._onheader=H,this._parse(512,H)};dQ0.inherits(_5,lQ0);_5.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};_5.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};_5.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=oQ0,this._overflow)this._write(this._overflow,void 0,$);else $()};_5.prototype._write=function($,I,q){if(this._destroyed)return;var U=this._stream,Y=this._buffer,J=this._missing;if($.length)this._partial=!0;if($.length<J){ 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="${Hq1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}A20.exports=M20});var B20=L((lv1,j20)=>{var P20=$6(),T20=x9(),Wq1=w4(),Zq1=FR(),Xq1=AR();class E20{constructor($,I,q){this.id=q.id,this.count=0,this._worksheet=$,this._workbook=q.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:T20.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:T20.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 q=new Zq1,U=new P20;q.render(U,$),this.commentsStream.write(U.xml);let Y=new Xq1,J=new P20;Y.render(J,$,I),this.vmlStream.write(J.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=Wq1.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()}}j20.exports=E20});var S20=L((mv1,h20)=>{var Dq1=Z4(),Oq1=x9(),ch=w4(),v20=kE(),R20=G5(),Lq1=eB(),C20=HV(),dh=WV(),Nq1=g20(),Fq1=B20(),Mq1=uE(),n4=new Lq1,lh=S9(),Aq1=ov(),gq1=rv(),Pq1=tv(),Tq1=cv(),Eq1=bv(),jq1=dv(),Bq1=av(),vq1=sv(),Rq1=ev(),Cq1=$R(),_q1=IR(),hq1=qR(),Sq1=KR(),yq1=YR(),uq1=UR(),i4={dataValidations:new Aq1,sheetProperties:new gq1,sheetFormatProperties:new Pq1,columns:new lh({tag:"cols",length:!1,childXform:new Tq1}),row:new Eq1,hyperlinks:new lh({tag:"hyperlinks",length:!1,childXform:new jq1}),sheetViews:new lh({tag:"sheetViews",length:!1,childXform:new Bq1}),sheetProtection:new vq1,pageMargins:new Rq1,pageSeteup:new Cq1,autoFilter:new _q1,picture:new hq1,conditionalFormattings:new Sq1,headerFooter:new yq1,rowBreaks:new uq1};class _20{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 Nq1($),this._sheetCommentsWriter=new Fq1(this,this._sheetRelsWriter,$),this._dimensions=new R20,this._rowZero=1,this.committed=!1,this.dataValidations=new Mq1,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
`)},sh=eh.getNativePromise();if(eh.isNode&&typeof MutationObserver>"u")$S=global.setImmediate,IS=process.nextTick,f3=eh.isRecentNode?function($){$S.call(global,$)}:function($){IS.call(process,$)};else if(typeof sh==="function"&&typeof sh.resolve==="function")qS=sh.resolve(),f3=function($){qS.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))f3=function(){var $=document.createElement("div"),I={attributes:!0},q=!1,U=document.createElement("div"),Y=new MutationObserver(function(){$.classList.toggle("foo"),q=!1});Y.observe(U,I);var J=function(){if(q)return;q=!0,U.classList.toggle("foo")};return function(K){var z=new MutationObserver(function(){z.disconnect(),K()});z.observe($,I),J()}}();else if(typeof setImmediate<"u")f3=function($){setImmediate($)};else if(typeof setTimeout<"u")f3=function($){setTimeout($,0)};else f3=YU1;var $S,IS,qS;t20.exports=f3});var e20=L((vv1,s20)=>{function JU1($,I,q,U,Y){for(var J=0;J<Y;++J)q[J+U]=$[J+I],$[J+I]=void 0}function I7($){this._capacity=$,this._length=0,this._front=0}I7.prototype._willBeOverCapacity=function($){return this._capacity<$};I7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var q=this._front+I&this._capacity-1;this[q]=$,this._length=I+1};I7.prototype.push=function($,I,q){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(I),this._pushOne(q);return}var Y=this._front+U-3;this._checkCapacity(U);var J=this._capacity-1;this[Y+0&J]=$,this[Y+1&J]=I,this[Y+2&J]=q,this._length=U};I7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};I7.prototype.length=function(){return this._length};I7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};I7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var q=this._front,U=this._length,Y=q+U&I-1;JU1(this,0,this,I,Y)};s20.exports=I7});var QK0=L((Rv1,US)=>{var YK0;try{throw Error()}catch($){YK0=$}var QU1=a20(),$K0=e20(),JK0=n1();function b4(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new $K0(16),this._normalQueue=new $K0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=QU1}b4.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};b4.prototype.hasCustomScheduler=function(){return this._customScheduler};b4.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};b4.prototype.disableTrampolineIfNecessary=function(){if(JK0.hasDevTools)this._trampolineEnabled=!1};b4.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};b4.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`)},GS=HS.getNativePromise();if(HS.isNode&&typeof MutationObserver>"u")VS=global.setImmediate,WS=process.nextTick,i3=HS.isRecentNode?function($){VS.call(global,$)}:function($){WS.call(process,$)};else if(typeof GS==="function"&&typeof GS.resolve==="function")ZS=GS.resolve(),i3=function($){ZS.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))i3=function(){var $=document.createElement("div"),I={attributes:!0},q=!1,U=document.createElement("div"),Y=new MutationObserver(function(){$.classList.toggle("foo"),q=!1});Y.observe(U,I);var J=function(){if(q)return;q=!0,U.classList.toggle("foo")};return function(K){var w=new MutationObserver(function(){w.disconnect(),K()});w.observe($,I),J()}}();else if(typeof setImmediate<"u")i3=function($){setImmediate($)};else if(typeof setTimeout<"u")i3=function($){setTimeout($,0)};else i3=jU1;var VS,WS,ZS;WK0.exports=i3});var DK0=L((JR1,XK0)=>{function BU1($,I,q,U,Y){for(var J=0;J<Y;++J)q[J+U]=$[J+I],$[J+I]=void 0}function Y7($){this._capacity=$,this._length=0,this._front=0}Y7.prototype._willBeOverCapacity=function($){return this._capacity<$};Y7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var q=this._front+I&this._capacity-1;this[q]=$,this._length=I+1};Y7.prototype.push=function($,I,q){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(I),this._pushOne(q);return}var Y=this._front+U-3;this._checkCapacity(U);var J=this._capacity-1;this[Y+0&J]=$,this[Y+1&J]=I,this[Y+2&J]=q,this._length=U};Y7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};Y7.prototype.length=function(){return this._length};Y7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};Y7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var q=this._front,U=this._length,Y=q+U&I-1;BU1(this,0,this,I,Y)};XK0.exports=Y7});var gK0=L((QR1,XS)=>{var MK0;try{throw Error()}catch($){MK0=$}var vU1=ZK0(),OK0=DK0(),AK0=n1();function b4(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new OK0(16),this._normalQueue=new OK0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=vU1}b4.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};b4.prototype.hasCustomScheduler=function(){return this._customScheduler};b4.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};b4.prototype.disableTrampolineIfNecessary=function(){if(AK0.hasDevTools)this._trampolineEnabled=!1};b4.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};b4.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};b4.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(q){throw Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function IK0($,I,q){this._lateQueue.push($,I,q),this._queueTick()}function qK0($,I,q){this._normalQueue.push($,I,q),this._queueTick()}function UK0($){this._normalQueue._pushOne($),this._queueTick()}if(!JK0.hasDevTools)b4.prototype.invokeLater=IK0,b4.prototype.invoke=qK0,b4.prototype.settlePromises=UK0;else b4.prototype.invokeLater=function($,I,q){if(this._trampolineEnabled)IK0.call(this,$,I,q);else this._schedule(function(){setTimeout(function(){$.call(I,q)},100)})},b4.prototype.invoke=function($,I,q){if(this._trampolineEnabled)qK0.call(this,$,I,q);else this._schedule(function(){$.call(I,q)})},b4.prototype.settlePromises=function($){if(this._trampolineEnabled)UK0.call(this,$);else this._schedule(function(){$._settlePromises()})};b4.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var q=$.shift(),U=$.shift();I.call(q,U)}};b4.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};b4.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};b4.prototype._reset=function(){this._isTickUsed=!1};US.exports=b4;US.exports.firstLineError=YK0});var v5=L((Cv1,wK0)=>{var QS=k3(),KU1=QS.freeze,KK0=n1(),zK0=KK0.inherits,aU=KK0.notEnumerableProp;function sU($,I){function q(U){if(!(this instanceof q))return new q(U);if(aU(this,"message",typeof U==="string"?U:I),aU(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return zK0(q,Error),q}var YS,JS,zU1=sU("Warning","warning"),wU1=sU("CancellationError","cancellation error"),GU1=sU("TimeoutError","timeout error"),OK=sU("AggregateError","aggregate error");try{YS=TypeError,JS=RangeError}catch($){YS=sU("TypeError","type error"),JS=sU("RangeError","range error")}var aX="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(n3=0;n3<aX.length;++n3)if(typeof Array.prototype[aX[n3]]==="function")OK.prototype[aX[n3]]=Array.prototype[aX[n3]];var n3;QS.defineProperty(OK.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});OK.prototype.isOperational=!0;var sX=0;OK.prototype.toString=function(){var $=Array(sX*4+1).join(" "),I=`
`)}};function LK0($,I,q){this._lateQueue.push($,I,q),this._queueTick()}function NK0($,I,q){this._normalQueue.push($,I,q),this._queueTick()}function FK0($){this._normalQueue._pushOne($),this._queueTick()}if(!AK0.hasDevTools)b4.prototype.invokeLater=LK0,b4.prototype.invoke=NK0,b4.prototype.settlePromises=FK0;else b4.prototype.invokeLater=function($,I,q){if(this._trampolineEnabled)LK0.call(this,$,I,q);else this._schedule(function(){setTimeout(function(){$.call(I,q)},100)})},b4.prototype.invoke=function($,I,q){if(this._trampolineEnabled)NK0.call(this,$,I,q);else this._schedule(function(){$.call(I,q)})},b4.prototype.settlePromises=function($){if(this._trampolineEnabled)FK0.call(this,$);else this._schedule(function(){$._settlePromises()})};b4.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var q=$.shift(),U=$.shift();I.call(q,U)}};b4.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};b4.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};b4.prototype._reset=function(){this._isTickUsed=!1};XS.exports=b4;XS.exports.firstLineError=MK0});var S5=L((KR1,EK0)=>{var LS=n3(),RU1=LS.freeze,PK0=n1(),TK0=PK0.inherits,eU=PK0.notEnumerableProp;function $Y($,I){function q(U){if(!(this instanceof q))return new q(U);if(eU(this,"message",typeof U==="string"?U:I),eU(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return TK0(q,Error),q}var DS,OS,CU1=$Y("Warning","warning"),_U1=$Y("CancellationError","cancellation error"),hU1=$Y("TimeoutError","timeout error"),NK=$Y("AggregateError","aggregate error");try{DS=TypeError,OS=RangeError}catch($){DS=$Y("TypeError","type error"),OS=$Y("RangeError","range error")}var qD="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(b3=0;b3<qD.length;++b3)if(typeof Array.prototype[qD[b3]]==="function")NK.prototype[qD[b3]]=Array.prototype[qD[b3]];var b3;LS.defineProperty(NK.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});NK.prototype.isOperational=!0;var UD=0;NK.prototype.toString=function(){var $=Array(UD*4+1).join(" "),I=`
`+$+`AggregateError of:
`;sX++,$=Array(sX*4+1).join(" ");for(var q=0;q<this.length;++q){var U=this[q]===this?"[Circular AggregateError]":this[q]+"",Y=U.split(`
`;UD++,$=Array(UD*4+1).join(" ");for(var q=0;q<this.length;++q){var U=this[q]===this?"[Circular AggregateError]":this[q]+"",Y=U.split(`
`);for(var J=0;J<Y.length;++J)Y[J]=$+Y[J];U=Y.join(`
`),I+=U+`
`}return sX--,I};function DK($){if(!(this instanceof DK))return new DK($);if(aU(this,"name","OperationalError"),aU(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)aU(this,"message",$.message),aU(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}zK0(DK,Error);var b3=Error.__BluebirdErrorTypes__;if(!b3)b3=KU1({CancellationError:wU1,TimeoutError:GU1,OperationalError:DK,RejectionError:DK,AggregateError:OK}),QS.defineProperty(Error,"__BluebirdErrorTypes__",{value:b3,writable:!1,enumerable:!1,configurable:!1});wK0.exports={Error,TypeError:YS,RangeError:JS,CancellationError:b3.CancellationError,OperationalError:b3.OperationalError,TimeoutError:b3.TimeoutError,AggregateError:b3.AggregateError,Warning:zU1}});var HK0=L((_v1,GK0)=>{GK0.exports=function($,I){var q=n1(),U=q.errorObj,Y=q.isObject;function J(H,W){if(Y(H)){if(H instanceof $)return H;var V=K(H);if(V===U){if(W)W._pushContext();var X=$.reject(V.e);if(W)W._popContext();return X}else if(typeof V==="function"){if(w(H)){var X=new $(I);return H._then(X._fulfill,X._reject,void 0,X,null),X}return G(H,V,W)}}return H}function Q(H){return H.then}function K(H){try{return Q(H)}catch(W){return U.e=W,U}}var z={}.hasOwnProperty;function w(H){try{return z.call(H,"_promise0")}catch(W){return!1}}function G(H,W,V){var X=new $(I),D=X;if(V)V._pushContext();if(X._captureStackTrace(),V)V._popContext();var O=!0,N=q.tryCatch(W).call(H,T,P);if(O=!1,X&&N===U)X._rejectCallback(N.e,!0,!0),X=null;function T(g){if(!X)return;X._resolveCallback(g),X=null}function P(g){if(!X)return;X._rejectCallback(g,O,!0),X=null}return D}return J}});var WK0=L((hv1,VK0)=>{VK0.exports=function($,I,q,U,Y){var J=n1(),Q=J.isArray;function K(w){switch(w){case-2:return[];case-3:return{}}}function z(w){var G=this._promise=new $(I);if(w instanceof $)G._propagateFrom(w,3);G._setOnCancel(this),this._values=w,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return J.inherits(z,Y),z.prototype.length=function(){return this._length},z.prototype.promise=function(){return this._promise},z.prototype._init=function w(G,H){var W=q(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(w,this._reject,void 0,this,H);else if((V&33554432)!==0)W=W._value();else if((V&16777216)!==0)return this._reject(W._reason());else return this._cancel()}if(W=J.asArray(W),W===null){var X=U("expecting an array or an iterable object but got "+J.classString(W)).reason();this._promise._rejectCallback(X,!1);return}if(W.length===0){if(H===-5)this._resolveEmptyArray();else this._resolve(K(H));return}this._iterate(W)},z.prototype._iterate=function(w){var G=this.getActualLength(w.length);this._length=G,this._values=this.shouldCopyValues()?Array(G):this._values;var H=this._promise,W=!1,V=null;for(var X=0;X<G;++X){var D=q(w[X],H);if(D instanceof $)D=D._target(),V=D._bitField;else V=null;if(W){if(V!==null)D.suppressUnhandledRejections()}else if(V!==null)if((V&50397184)===0)D._proxy(this,X),this._values[X]=D;else if((V&33554432)!==0)W=this._promiseFulfilled(D._value(),X);else if((V&16777216)!==0)W=this._promiseRejected(D._reason(),X);else W=this._promiseCancelled(X);else W=this._promiseFulfilled(D,X)}if(!W)H._setAsyncGuaranteed()},z.prototype._isResolved=function(){return this._values===null},z.prototype._resolve=function(w){this._values=null,this._promise._fulfill(w)},z.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},z.prototype._reject=function(w){this._values=null,this._promise._rejectCallback(w,!1)},z.prototype._promiseFulfilled=function(w,G){this._values[G]=w;var H=++this._totalResolved;if(H>=this._length)return this._resolve(this._values),!0;return!1},z.prototype._promiseCancelled=function(){return this._cancel(),!0},z.prototype._promiseRejected=function(w){return this._totalResolved++,this._reject(w),!0},z.prototype._resultCancelled=function(){if(this._isResolved())return;var w=this._values;if(this._cancel(),w instanceof $)w.cancel();else for(var G=0;G<w.length;++G)if(w[G]instanceof $)w[G].cancel()},z.prototype.shouldCopyValues=function(){return!0},z.prototype.getActualLength=function(w){return w},z}});var XK0=L((Sv1,ZK0)=>{ZK0.exports=function($){var I=!1,q=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(J())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,q.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var Q=q.pop(),K=Q._promiseCreated;return Q._promiseCreated=null,K}return null};function Y(){if(I)return new U}function J(){var Q=q.length-1;if(Q>=0)return q[Q];return}return U.CapturedTrace=null,U.create=Y,U.deactivateLong Line truncated
`}return UD--,I};function LK($){if(!(this instanceof LK))return new LK($);if(eU(this,"name","OperationalError"),eU(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)eU(this,"message",$.message),eU(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}TK0(LK,Error);var p3=Error.__BluebirdErrorTypes__;if(!p3)p3=RU1({CancellationError:_U1,TimeoutError:hU1,OperationalError:LK,RejectionError:LK,AggregateError:NK}),LS.defineProperty(Error,"__BluebirdErrorTypes__",{value:p3,writable:!1,enumerable:!1,configurable:!1});EK0.exports={Error,TypeError:DS,RangeError:OS,CancellationError:p3.CancellationError,OperationalError:p3.OperationalError,TimeoutError:p3.TimeoutError,AggregateError:p3.AggregateError,Warning:CU1}});var BK0=L((wR1,jK0)=>{jK0.exports=function($,I){var q=n1(),U=q.errorObj,Y=q.isObject;function J(H,V){if(Y(H)){if(H instanceof $)return H;var W=K(H);if(W===U){if(V)V._pushContext();var X=$.reject(W.e);if(V)V._popContext();return X}else if(typeof W==="function"){if(z(H)){var X=new $(I);return H._then(X._fulfill,X._reject,void 0,X,null),X}return G(H,W,V)}}return H}function Q(H){return H.then}function K(H){try{return Q(H)}catch(V){return U.e=V,U}}var w={}.hasOwnProperty;function z(H){try{return w.call(H,"_promise0")}catch(V){return!1}}function G(H,V,W){var X=new $(I),D=X;if(W)W._pushContext();if(X._captureStackTrace(),W)W._popContext();var O=!0,N=q.tryCatch(V).call(H,T,P);if(O=!1,X&&N===U)X._rejectCallback(N.e,!0,!0),X=null;function T(g){if(!X)return;X._resolveCallback(g),X=null}function P(g){if(!X)return;X._rejectCallback(g,O,!0),X=null}return D}return J}});var RK0=L((zR1,vK0)=>{vK0.exports=function($,I,q,U,Y){var J=n1(),Q=J.isArray;function K(z){switch(z){case-2:return[];case-3:return{}}}function w(z){var G=this._promise=new $(I);if(z instanceof $)G._propagateFrom(z,3);G._setOnCancel(this),this._values=z,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return J.inherits(w,Y),w.prototype.length=function(){return this._length},w.prototype.promise=function(){return this._promise},w.prototype._init=function z(G,H){var V=q(this._values,this._promise);if(V instanceof $){V=V._target();var W=V._bitField;if(this._values=V,(W&50397184)===0)return this._promise._setAsyncGuaranteed(),V._then(z,this._reject,void 0,this,H);else if((W&33554432)!==0)V=V._value();else if((W&16777216)!==0)return this._reject(V._reason());else return this._cancel()}if(V=J.asArray(V),V===null){var X=U("expecting an array or an iterable object but got "+J.classString(V)).reason();this._promise._rejectCallback(X,!1);return}if(V.length===0){if(H===-5)this._resolveEmptyArray();else this._resolve(K(H));return}this._iterate(V)},w.prototype._iterate=function(z){var G=this.getActualLength(z.length);this._length=G,this._values=this.shouldCopyValues()?Array(G):this._values;var H=this._promise,V=!1,W=null;for(var X=0;X<G;++X){var D=q(z[X],H);if(D instanceof $)D=D._target(),W=D._bitField;else W=null;if(V){if(W!==null)D.suppressUnhandledRejections()}else if(W!==null)if((W&50397184)===0)D._proxy(this,X),this._values[X]=D;else if((W&33554432)!==0)V=this._promiseFulfilled(D._value(),X);else if((W&16777216)!==0)V=this._promiseRejected(D._reason(),X);else V=this._promiseCancelled(X);else V=this._promiseFulfilled(D,X)}if(!V)H._setAsyncGuaranteed()},w.prototype._isResolved=function(){return this._values===null},w.prototype._resolve=function(z){this._values=null,this._promise._fulfill(z)},w.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},w.prototype._reject=function(z){this._values=null,this._promise._rejectCallback(z,!1)},w.prototype._promiseFulfilled=function(z,G){this._values[G]=z;var H=++this._totalResolved;if(H>=this._length)return this._resolve(this._values),!0;return!1},w.prototype._promiseCancelled=function(){return this._cancel(),!0},w.prototype._promiseRejected=function(z){return this._totalResolved++,this._reject(z),!0},w.prototype._resultCancelled=function(){if(this._isResolved())return;var z=this._values;if(this._cancel(),z instanceof $)z.cancel();else for(var G=0;G<z.length;++G)if(z[G]instanceof $)z[G].cancel()},w.prototype.shouldCopyValues=function(){return!0},w.prototype.getActualLength=function(z){return z},w}});var _K0=L((GR1,CK0)=>{CK0.exports=function($){var I=!1,q=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(J())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,q.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var Q=q.pop(),K=Q._promiseCreated;return Q._promiseCreated=null,K}return null};function Y(){if(I)return new U}function J(){var Q=q.length-1;if(Q>=0)return q[Q];return}return U.CapturedTrace=null,U.create=Y,U.deactivateLong Line truncated
See http://goo.gl/MqrFmX
`);if(!g0.longStackTraces&&h$()){var r=$.prototype._captureStackTrace,F=$.prototype._attachExtraTrace;g0.longStackTraces=!0,g=function(){if(U.haveItemsQueued()&&!g0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
`);if(!g0.longStackTraces&&y$()){var r=$.prototype._captureStackTrace,F=$.prototype._attachExtraTrace;g0.longStackTraces=!0,g=function(){if(U.haveItemsQueued()&&!g0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);$.prototype._captureStackTrace=r,$.prototype._attachExtraTrace=F,I.deactivateLongStackTraces(),U.enableTrampoline(),g0.longStackTraces=!1},$.prototype._captureStackTrace=K0,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return g0.longStackTraces&&h$()};var B=function(){try{if(typeof CustomEvent==="function"){var r=new CustomEvent("CustomEvent");return J.global.dispatchEvent(r),function(F,M){var v=new CustomEvent(F.toLowerCase(),{detail:M,cancelable:!0});return!J.global.dispatchEvent(v)}}else if(typeof Event==="function"){var r=new Event("CustomEvent");return J.global.dispatchEvent(r),function(M,v){var y=new Event(M.toLowerCase(),{cancelable:!0});return y.detail=v,!J.global.dispatchEvent(y)}}else{var r=document.createEvent("CustomEvent");return r.initCustomEvent("testingtheevent",!1,!0,{}),J.global.dispatchEvent(r),function(M,v){var y=document.createEvent("CustomEvent");return y.initCustomEvent(M.toLowerCase(),!1,!0,v),!J.global.dispatchEvent(y)}}}catch(F){}return function(){return!1}}(),x=function(){if(J.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!J.global)return function(){return!1};return function(r){var F="on"+r.toLowerCase(),M=J.global[F];if(!M)return!1;return M.apply(J.global,[].slice.call(arguments,1)),!0}}}();function h(r,F){return{promise:F}}var f={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(r,F,M){return{promise:F,child:M}},warning:function(r,F){return{warning:F}},unhandledRejection:function(r,F,M){return{reason:F,promise:M}},rejectionHandled:h},S=function(r){var F=!1;try{F=x.apply(null,arguments)}catch(v){U.throwLater(v),F=!0}var M=!1;try{M=B(r,f[r].apply(null,arguments))}catch(v){U.throwLater(v),M=!0}return M||F};$.config=function(r){if(r=Object(r),"longStackTraces"in r){if(r.longStackTraces)$.longStackTraces();else if(!r.longStackTraces&&$.hasLongStackTraces())g()}if("warnings"in r){var F=r.warnings;if(g0.warnings=!!F,P=g0.warnings,J.isObject(F)){if("wForgottenReturn"in F)P=!!F.wForgottenReturn}}if("cancellation"in r&&r.cancellation&&!g0.cancellation){if(U.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=J0,$.prototype._propagateFrom=j,$.prototype._onCancel=k,$.prototype._setOnCancel=n,$.prototype._attachCancellationCallback=C,$.prototype._execute=p,d=j,g0.cancellation=!0}if("monitoring"in r){if(r.monitoring&&!g0.monitoring)g0.monitoring=!0,$.prototype._fireEvent=S;else if(!r.monitoring&&g0.monitoring)g0.monitoring=!1,$.prototype._fireEvent=t}return $};function t(){return!1}$.prototype._fireEvent=t,$.prototype._execute=function(r,F,M){try{r(F,M)}catch(v){return v}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(r){},$.prototype._attachCancellationCallback=function(r){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(r,F){};function p(r,F,M){var v=this;try{r(F,M,function(y){if(typeof y!=="function")throw TypeError("onCancel must be a function, got: "+J.toString(y));v._attachCancellationCallback(y)})}catch(y){return y}}function C(r){if(!this._isCancellable())return this;var F=this._onCancel();if(F!==void 0)if(J.isArray(F))F.push(r);else this._setOnCancel([F,r]);else this._setOnCancel(r)}function k(){return this._onCancelField}function n(r){this._onCancelField=r}function J0(){this._cancellationParent=void 0,this._onCancelField=void 0}function j(r,F){if((F&1)!==0){this._cancellationParent=r;var M=r._branchesRemainingToCancel;if(M===void 0)M=0;r._branchesRemainingToCancel=M+1}if((F&2)!==0&&r._isBound())this._setBoundTo(r._boundTo)}function u(r,F){if((F&2)!==0&&r._isBound())this._setBoundTo(r._boundTo)}var d=u;function a(){var r=this._boundTo;if(r!==void 0){if(r instanceof $)if(r.isFulfilled())return r.value();else return}return r}function K0(){this._trace=new a6(this._peekContext())}function G0(r,F){if(Q(r)){var M=this._trace;if(M!==void 0){if(F)M=M._parent}if(M!==void 0)M.attachExtraTrace(r);else if(!r.__stackCleaned__){var v=Y4(r);J.notEnumerableProp(r,"stack",v.message+`
`);$.prototype._captureStackTrace=r,$.prototype._attachExtraTrace=F,I.deactivateLongStackTraces(),U.enableTrampoline(),g0.longStackTraces=!1},$.prototype._captureStackTrace=K0,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return g0.longStackTraces&&y$()};var B=function(){try{if(typeof CustomEvent==="function"){var r=new CustomEvent("CustomEvent");return J.global.dispatchEvent(r),function(F,M){var v=new CustomEvent(F.toLowerCase(),{detail:M,cancelable:!0});return!J.global.dispatchEvent(v)}}else if(typeof Event==="function"){var r=new Event("CustomEvent");return J.global.dispatchEvent(r),function(M,v){var y=new Event(M.toLowerCase(),{cancelable:!0});return y.detail=v,!J.global.dispatchEvent(y)}}else{var r=document.createEvent("CustomEvent");return r.initCustomEvent("testingtheevent",!1,!0,{}),J.global.dispatchEvent(r),function(M,v){var y=document.createEvent("CustomEvent");return y.initCustomEvent(M.toLowerCase(),!1,!0,v),!J.global.dispatchEvent(y)}}}catch(F){}return function(){return!1}}(),k=function(){if(J.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!J.global)return function(){return!1};return function(r){var F="on"+r.toLowerCase(),M=J.global[F];if(!M)return!1;return M.apply(J.global,[].slice.call(arguments,1)),!0}}}();function h(r,F){return{promise:F}}var f={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(r,F,M){return{promise:F,child:M}},warning:function(r,F){return{warning:F}},unhandledRejection:function(r,F,M){return{reason:F,promise:M}},rejectionHandled:h},S=function(r){var F=!1;try{F=k.apply(null,arguments)}catch(v){U.throwLater(v),F=!0}var M=!1;try{M=B(r,f[r].apply(null,arguments))}catch(v){U.throwLater(v),M=!0}return M||F};$.config=function(r){if(r=Object(r),"longStackTraces"in r){if(r.longStackTraces)$.longStackTraces();else if(!r.longStackTraces&&$.hasLongStackTraces())g()}if("warnings"in r){var F=r.warnings;if(g0.warnings=!!F,P=g0.warnings,J.isObject(F)){if("wForgottenReturn"in F)P=!!F.wForgottenReturn}}if("cancellation"in r&&r.cancellation&&!g0.cancellation){if(U.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=J0,$.prototype._propagateFrom=E,$.prototype._onCancel=n,$.prototype._setOnCancel=i,$.prototype._attachCancellationCallback=C,$.prototype._execute=p,d=E,g0.cancellation=!0}if("monitoring"in r){if(r.monitoring&&!g0.monitoring)g0.monitoring=!0,$.prototype._fireEvent=S;else if(!r.monitoring&&g0.monitoring)g0.monitoring=!1,$.prototype._fireEvent=t}return $};function t(){return!1}$.prototype._fireEvent=t,$.prototype._execute=function(r,F,M){try{r(F,M)}catch(v){return v}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(r){},$.prototype._attachCancellationCallback=function(r){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(r,F){};function p(r,F,M){var v=this;try{r(F,M,function(y){if(typeof y!=="function")throw TypeError("onCancel must be a function, got: "+J.toString(y));v._attachCancellationCallback(y)})}catch(y){return y}}function C(r){if(!this._isCancellable())return this;var F=this._onCancel();if(F!==void 0)if(J.isArray(F))F.push(r);else this._setOnCancel([F,r]);else this._setOnCancel(r)}function n(){return this._onCancelField}function i(r){this._onCancelField=r}function J0(){this._cancellationParent=void 0,this._onCancelField=void 0}function E(r,F){if((F&1)!==0){this._cancellationParent=r;var M=r._branchesRemainingToCancel;if(M===void 0)M=0;r._branchesRemainingToCancel=M+1}if((F&2)!==0&&r._isBound())this._setBoundTo(r._boundTo)}function u(r,F){if((F&2)!==0&&r._isBound())this._setBoundTo(r._boundTo)}var d=u;function a(){var r=this._boundTo;if(r!==void 0){if(r instanceof $)if(r.isFulfilled())return r.value();else return}return r}function K0(){this._trace=new s6(this._peekContext())}function G0(r,F){if(Q(r)){var M=this._trace;if(M!==void 0){if(F)M=M._parent}if(M!==void 0)M.attachExtraTrace(r);else if(!r.__stackCleaned__){var v=J4(r);J.notEnumerableProp(r,"stack",v.message+`
`+v.stack.join(`
`)),J.notEnumerableProp(r,"__stackCleaned__",!0)}}}function M0(r,F,M,v,y){if(r===void 0&&F!==null&&P){if(y!==void 0&&y._returnedNonUndefined())return;if((v._bitField&65535)===0)return;if(M)M=M+" ";var s="",c="";if(F._trace){var e=F._trace.stack.split(`
`),U0=J1(e);for(var w0=U0.length-1;w0>=0;--w0){var T0=U0[w0];if(!G.test(T0)){var u0=T0.match(H);if(u0)s="at "+u0[1]+":"+u0[2]+":"+u0[3]+" ";break}}if(U0.length>0){var S0=U0[0];for(var w0=0;w0<e.length;++w0)if(e[w0]===S0){if(w0>0)c=`
`+e[w0-1];break}}}var I1="a promise was created in a "+M+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+c;v._warn(I1,!0,F)}}function v0(r,F){var M=r+" is deprecated and will be removed in a future version.";if(F)M+=" Use "+F+" instead.";return v1(M)}function v1(r,F,M){if(!g0.warnings)return;var v=new Y(r),y;if(F)M._attachExtraTrace(v);else if(g0.longStackTraces&&(y=$._peekContext()))y.attachExtraTrace(v);else{var s=Y4(v);v.stack=s.message+`
`),U0=J1(e);for(var z0=U0.length-1;z0>=0;--z0){var T0=U0[z0];if(!G.test(T0)){var x0=T0.match(H);if(x0)s="at "+x0[1]+":"+x0[2]+":"+x0[3]+" ";break}}if(U0.length>0){var y0=U0[0];for(var z0=0;z0<e.length;++z0)if(e[z0]===y0){if(z0>0)c=`
`+e[z0-1];break}}}var I1="a promise was created in a "+M+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+c;v._warn(I1,!0,F)}}function R0(r,F){var M=r+" is deprecated and will be removed in a future version.";if(F)M+=" Use "+F+" instead.";return v1(M)}function v1(r,F,M){if(!g0.warnings)return;var v=new Y(r),y;if(F)M._attachExtraTrace(v);else if(g0.longStackTraces&&(y=$._peekContext()))y.attachExtraTrace(v);else{var s=J4(v);v.stack=s.message+`
`+s.stack.join(`
`)}if(!S("warning",v))v4(v,"",!0)}function m0(r,F){for(var M=0;M<F.length-1;++M)F[M].push("From previous event:"),F[M]=F[M].join(`
`)}if(!S("warning",v))R4(v,"",!0)}function l0(r,F){for(var M=0;M<F.length-1;++M)F[M].push("From previous event:"),F[M]=F[M].join(`
`);if(M<F.length)F[M]=F[M].join(`
`);return r+`
`+F.join(`
`)}function N1(r){for(var F=0;F<r.length;++F)if(r[F].length===0||F+1<r.length&&r[F][0]===r[F+1][0])r.splice(F,1),F--}function F1(r){var F=r[0];for(var M=1;M<r.length;++M){var v=r[M],y=F.length-1,s=F[y],c=-1;for(var e=v.length-1;e>=0;--e)if(v[e]===s){c=e;break}for(var e=c;e>=0;--e){var U0=v[e];if(F[y]===U0)F.pop(),y--;else break}F=v}}function J1(r){var F=[];for(var M=0;M<r.length;++M){var v=r[M],y=v===" (No stack trace)"||W.test(v),s=y&&G$(v);if(y&&!s){if(X&&v.charAt(0)!==" ")v=" "+v;F.push(v)}}return F}function C1(r){var F=r.stack.replace(/\s+$/g,"").split(`
`);for(var M=0;M<F.length;++M){var v=F[M];if(v===" (No stack trace)"||W.test(v))break}if(M>0&&r.name!="SyntaxError")F=F.slice(M);return F}function Y4(r){var F=r.stack,M=r.toString();return F=typeof F==="string"&&F.length>0?C1(r):[" (No stack trace)"],{message:M,stack:r.name=="SyntaxError"?F:J1(F)}}function v4(r,F,M){if(typeof console<"u"){var v;if(J.isObject(r)){var y=r.stack;v=F+V(y,r)}else v=F+String(r);if(typeof D==="function")D(v,M);else if(typeof console.log==="function"||typeof console.log==="object")console.log(v)}}function w$(r,F,M,v){var y=!1;try{if(typeof F==="function")if(y=!0,r==="rejectionHandled")F(v);else F(M,v)}catch(s){U.throwLater(s)}if(r==="unhandledRejection"){if(!S(r,M,v)&&!y)v4(M,"Unhandled rejection ")}else S(r,v)}function _$(r){var F;if(typeof r==="function")F="[function "+(r.name||"anonymous")+"]";else{F=r&&typeof r.toString==="function"?r.toString():J.toString(r);var M=/\[object [a-zA-Z0-9$_]+\]/;if(M.test(F))try{var v=JSON.stringify(r);F=v}catch(y){}if(F.length===0)F="(empty array)"}return"(<"+b8(F)+">, no stack trace)"}function b8(r){var F=41;if(r.length<F)return r;return r.substr(0,F-3)+"..."}function h$(){return typeof n5==="function"}var G$=function(){return!1},i8=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function t6(r){var F=r.match(i8);if(F)return{fileName:F[1],line:parseInt(F[2],10)}}function X7(r,F){if(!h$())return;var M=r.stack.split(`
`)}function L1(r){for(var F=0;F<r.length;++F)if(r[F].length===0||F+1<r.length&&r[F][0]===r[F+1][0])r.splice(F,1),F--}function N1(r){var F=r[0];for(var M=1;M<r.length;++M){var v=r[M],y=F.length-1,s=F[y],c=-1;for(var e=v.length-1;e>=0;--e)if(v[e]===s){c=e;break}for(var e=c;e>=0;--e){var U0=v[e];if(F[y]===U0)F.pop(),y--;else break}F=v}}function J1(r){var F=[];for(var M=0;M<r.length;++M){var v=r[M],y=v===" (No stack trace)"||V.test(v),s=y&&H$(v);if(y&&!s){if(X&&v.charAt(0)!==" ")v=" "+v;F.push(v)}}return F}function C1(r){var F=r.stack.replace(/\s+$/g,"").split(`
`);for(var M=0;M<F.length;++M){var v=F[M];if(v===" (No stack trace)"||V.test(v))break}if(M>0&&r.name!="SyntaxError")F=F.slice(M);return F}function J4(r){var F=r.stack,M=r.toString();return F=typeof F==="string"&&F.length>0?C1(r):[" (No stack trace)"],{message:M,stack:r.name=="SyntaxError"?F:J1(F)}}function R4(r,F,M){if(typeof console<"u"){var v;if(J.isObject(r)){var y=r.stack;v=F+W(y,r)}else v=F+String(r);if(typeof D==="function")D(v,M);else if(typeof console.log==="function"||typeof console.log==="object")console.log(v)}}function G$(r,F,M,v){var y=!1;try{if(typeof F==="function")if(y=!0,r==="rejectionHandled")F(v);else F(M,v)}catch(s){U.throwLater(s)}if(r==="unhandledRejection"){if(!S(r,M,v)&&!y)R4(M,"Unhandled rejection ")}else S(r,v)}function S$(r){var F;if(typeof r==="function")F="[function "+(r.name||"anonymous")+"]";else{F=r&&typeof r.toString==="function"?r.toString():J.toString(r);var M=/\[object [a-zA-Z0-9$_]+\]/;if(M.test(F))try{var v=JSON.stringify(r);F=v}catch(y){}if(F.length===0)F="(empty array)"}return"(<"+d8(F)+">, no stack trace)"}function d8(r){var F=41;if(r.length<F)return r;return r.substr(0,F-3)+"..."}function y$(){return typeof d5==="function"}var H$=function(){return!1},l8=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function a6(r){var F=r.match(l8);if(F)return{fileName:F[1],line:parseInt(F[2],10)}}function O7(r,F){if(!y$())return;var M=r.stack.split(`
`),v=F.stack.split(`
`),y=-1,s=-1,c,e;for(var U0=0;U0<M.length;++U0){var w0=t6(M[U0]);if(w0){c=w0.fileName,y=w0.line;break}}for(var U0=0;U0<v.length;++U0){var w0=t6(v[U0]);if(w0){e=w0.fileName,s=w0.line;break}}if(y<0||s<0||!c||!e||c!==e||y>=s)return;G$=function(T0){if(w.test(T0))return!0;var u0=t6(T0);if(u0){if(u0.fileName===c&&(y<=u0.line&&u0.line<=s))return!0}return!1}}function a6(r){this._parent=r,this._promisesCreated=0;var F=this._length=1+(r===void 0?0:r._length);if(n5(this,a6),F>32)this.uncycle()}J.inherits(a6,Error),I.CapturedTrace=a6,a6.prototype.uncycle=function(){var r=this._length;if(r<2)return;var F=[],M={};for(var v=0,y=this;y!==void 0;++v)F.push(y),y=y._parent;r=this._length=v;for(var v=r-1;v>=0;--v){var s=F[v].stack;if(M[s]===void 0)M[s]=v}for(var v=0;v<r;++v){var c=F[v].stack,e=M[c];if(e!==void 0&&e!==v){if(e>0)F[e-1]._parent=void 0,F[e-1]._length=1;F[v]._parent=void 0,F[v]._length=1;var U0=v>0?F[v-1]:this;if(e<r-1)U0._parent=F[e+1],U0._parent.uncycle(),U0._length=U0._parent._length+1;else U0._parent=void 0,U0._length=1;var w0=U0._length+1;for(var T0=v-2;T0>=0;--T0)F[T0]._length=w0,w0++;return}}},a6.prototype.attachExtraTrace=function(r){if(r.__stackCleaned__)return;this.uncycle();var F=Y4(r),M=F.message,v=[F.stack],y=this;while(y!==void 0)v.push(J1(y.stack.split(`
`))),y=y._parent;F1(v),N1(v),J.notEnumerableProp(r,"stack",m0(M,v)),J.notEnumerableProp(r,"__stackCleaned__",!0)};var n5=function(){var F=/^\s*at\s*/,M=function(c,e){if(typeof c==="string")return c;if(e.name!==void 0&&e.message!==void 0)return e.toString();return _$(e)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,W=F,V=M;var v=Error.captureStackTrace;return G$=function(c){return w.test(c)},function(c,e){Error.stackTraceLimit+=6,v(c,e),Error.stackTraceLimit-=6}}var y=Error();if(typeof y.stack==="string"&&y.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return W=/@/,V=M,X=!0,function(e){e.stack=Error().stack};var s;try{throw Error()}catch(c){s="stack"in c}if(!("stack"in y)&&s&&typeof Error.stackTraceLimit==="number")return W=F,V=M,function(e){Error.stackTraceLimit+=6;try{throw Error()}catch(U0){e.stack=U0.stack}Error.stackTraceLimit-=6};return V=function(c,e){if(typeof c==="string")return c;if((typeof e==="object"||typeof e==="function")&&e.name!==void 0&&e.message!==void 0)return e.toString();return _$(e)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(D=function(r){console.warn(r)},J.isNode&&process.stderr.isTTY)D=function(r,F){var M=F?"\x1B[33m":"\x1B[31m";console.warn(M+r+`\x1B[0m
`)};else if(!J.isNode&&typeof Error().stack==="string")D=function(r,F){console.warn("%c"+r,F?"color: darkorange":"color: red")}}var g0={warnings:N,longStackTraces:!1,cancellation:!1,monitoring:!1};if(T)$.longStackTraces();return{longStackTraces:function(){return g0.longStackTraces},warnings:function(){return g0.warnings},cancellation:function(){return g0.cancellation},monitoring:function(){return g0.monitoring},propagateFromFunction:function(){return d},boundValueFunction:function(){return a},checkForgottenReturns:M0,setBounds:X7,warn:v1,deprecated:v0,CapturedTrace:a6,fireDomEvent:B,fireGlobalEvent:x}}});var NK0=L((uv1,LK0)=>{LK0.exports=function($,I){var q=n1(),U=$.CancellationError,Y=q.errorObj;function J(H,W,V){this.promise=H,this.type=W,this.handler=V,this.called=!1,this.cancelPromise=null}J.prototype.isFinallyHandler=function(){return this.type===0};function Q(H){this.finallyHandler=H}Q.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(H,W){if(H.cancelPromise!=null){if(arguments.length>1)H.cancelPromise._reject(W);else H.cancelPromise._cancel();return H.cancelPromise=null,!0}return!1}function z(){return G.call(this,this.promise._target()._settledValue())}function w(H){if(K(this,H))return;return Y.e=H,Y}function G(H){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(),H);if(X!==void 0){W._setReturnedNonUndefined();var D=I(X,W);if(D instanceof $){if(this.cancelPromise!=null){if(D._isCancelled()){var O=new U("late cancellation observer");return W._attachExtraTrace(O),Y.e=O,Y}else if(D.isPending())D._attachCancellationCallback(new Q(this))}return D._then(z,w,void 0,this,void 0)}}}if(W.isRejected())return K(this),Y.e=H,Y;else return K(this),H}return $.prototype._passThrough=function(H,W,V,X){if(typeof H!=="function")return this.then();return this._then(V,X,void 0,new J(this,W,H),void 0)},$.prototype.lastly=$.prototype.finally=function(H){return this._passThrough(H,0,G,G)},$.prototype.tap=function(H){return this._passThrough(H,1,G)},J}});var MK0=L((xv1,FK0)=>{FK0.exports=function($){var I=n1(),q=k3().keys,U=I.tryCatch,Y=I.errorObj;function J(Q,K,z){return function(w){var G=z._boundValue();$:for(var H=0;H<Q.length;++H){var W=Q[H];if(W===Error||W!=null&&W.prototype instanceof Error){if(w instanceof W)return U(K).call(G,w)}else if(typeof W==="function"){var V=U(W).call(G,w);if(V===Y)return V;else if(V)return U(K).call(G,w)}else if(I.isObject(w)){var X=q(W);for(var D=0;D<X.length;++D){var O=X[D];if(W[O]!=w[O])continue $}return U(K).call(G,w)}}return $}}return J}});var KS=L((kv1,PK0)=>{var AK0=n1(),HU1=AK0.maybeWrapAsError,VU1=v5(),WU1=VU1.OperationalError,gK0=k3();function ZU1($){return $ instanceof Error&&gK0.getPrototypeOf($)===Error.prototype}var XU1=/^(?:name|message|stack|cause)$/;function DU1($){var I;if(ZU1($)){I=new WU1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var q=gK0.keys($);for(var U=0;U<q.length;++U){var Y=q[U];if(!XU1.test(Y))I[Y]=$[Y]}return I}return AK0.markAsOriginatingFromRejection($),$}function OU1($,I){return function(q,U){if($===null)return;if(q){var Y=DU1(HU1(q));$._attachExtraTrace(Y),$._reject(Y)}else if(!I)$._fulfill(U);else{var J=arguments.length,Q=Array(Math.max(J-1,0));for(var K=1;K<J;++K)Q[K-1]=arguments[K];$._fulfill(Q)}$=null}}PK0.exports=OU1});var jK0=L((fv1,TK0)=>{TK0.exports=function($,I,q,U,Y){var J=n1(),Q=J.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+J.classString(K));return function(){var z=new $(I);z._captureStackTrace(),z._pushContext();var w=Q(K).apply(this,arguments),G=z._popContext();return Y.checkForgottenReturns(w,G,"Promise.method",z),z._resolveFromSyncValue(w),z}},$.attempt=$.try=function(K){if(typeof K!=="function")return U("expecting a function but got "+J.classString(K));var z=new $(I);z._captureStackTrace(),z._pushContext();var w;if(arguments.length>1){Y.deprecated("calling Promise.try with more than 1 argument");var G=arguments[1],H=arguments[2];w=J.isArray(G)?Q(K).apply(H,G):Q(K).call(H,G)}else w=Q(K)();var W=z._popContext();return Y.checkForgottenReturns(w,W,"Promise.try",z),z._resolveFromSyncValue(w),z},$.prototype._resolveFromSyncValue=function(K){if(K===J.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var BK0=L((nv1,EK0)=>{EK0.exports=function($,I,q,U){var Y=!1,J=function(w,G){this._reject(G)},Q=function(w,G){G.promiseRejectionQueued=!0,G.bindingPromise._then(J,J,null,this,w)},K=function(w,G){if((this._bitField&50397184)===0)this._resolveCallback(G.target)},z=function(w,G){if(!G.promiseRejectionQueued)this._reject(w)};$.prototype.bind=function(w){if(!Y)Y=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var G=q(w),H=new $(I);H._propagateFrom(this,1);var W=this._target();if(H._setBoundTo(G),G instanceof $){var V={promiseRejectionQueued:!1,promise:H,target:W,bindingPromise:G};W._then(I,Q,voi Line truncated
`),y=-1,s=-1,c,e;for(var U0=0;U0<M.length;++U0){var z0=a6(M[U0]);if(z0){c=z0.fileName,y=z0.line;break}}for(var U0=0;U0<v.length;++U0){var z0=a6(v[U0]);if(z0){e=z0.fileName,s=z0.line;break}}if(y<0||s<0||!c||!e||c!==e||y>=s)return;H$=function(T0){if(z.test(T0))return!0;var x0=a6(T0);if(x0){if(x0.fileName===c&&(y<=x0.line&&x0.line<=s))return!0}return!1}}function s6(r){this._parent=r,this._promisesCreated=0;var F=this._length=1+(r===void 0?0:r._length);if(d5(this,s6),F>32)this.uncycle()}J.inherits(s6,Error),I.CapturedTrace=s6,s6.prototype.uncycle=function(){var r=this._length;if(r<2)return;var F=[],M={};for(var v=0,y=this;y!==void 0;++v)F.push(y),y=y._parent;r=this._length=v;for(var v=r-1;v>=0;--v){var s=F[v].stack;if(M[s]===void 0)M[s]=v}for(var v=0;v<r;++v){var c=F[v].stack,e=M[c];if(e!==void 0&&e!==v){if(e>0)F[e-1]._parent=void 0,F[e-1]._length=1;F[v]._parent=void 0,F[v]._length=1;var U0=v>0?F[v-1]:this;if(e<r-1)U0._parent=F[e+1],U0._parent.uncycle(),U0._length=U0._parent._length+1;else U0._parent=void 0,U0._length=1;var z0=U0._length+1;for(var T0=v-2;T0>=0;--T0)F[T0]._length=z0,z0++;return}}},s6.prototype.attachExtraTrace=function(r){if(r.__stackCleaned__)return;this.uncycle();var F=J4(r),M=F.message,v=[F.stack],y=this;while(y!==void 0)v.push(J1(y.stack.split(`
`))),y=y._parent;N1(v),L1(v),J.notEnumerableProp(r,"stack",l0(M,v)),J.notEnumerableProp(r,"__stackCleaned__",!0)};var d5=function(){var F=/^\s*at\s*/,M=function(c,e){if(typeof c==="string")return c;if(e.name!==void 0&&e.message!==void 0)return e.toString();return S$(e)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,V=F,W=M;var v=Error.captureStackTrace;return H$=function(c){return z.test(c)},function(c,e){Error.stackTraceLimit+=6,v(c,e),Error.stackTraceLimit-=6}}var y=Error();if(typeof y.stack==="string"&&y.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return V=/@/,W=M,X=!0,function(e){e.stack=Error().stack};var s;try{throw Error()}catch(c){s="stack"in c}if(!("stack"in y)&&s&&typeof Error.stackTraceLimit==="number")return V=F,W=M,function(e){Error.stackTraceLimit+=6;try{throw Error()}catch(U0){e.stack=U0.stack}Error.stackTraceLimit-=6};return W=function(c,e){if(typeof c==="string")return c;if((typeof e==="object"||typeof e==="function")&&e.name!==void 0&&e.message!==void 0)return e.toString();return S$(e)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(D=function(r){console.warn(r)},J.isNode&&process.stderr.isTTY)D=function(r,F){var M=F?"\x1B[33m":"\x1B[31m";console.warn(M+r+`\x1B[0m
`)};else if(!J.isNode&&typeof Error().stack==="string")D=function(r,F){console.warn("%c"+r,F?"color: darkorange":"color: red")}}var g0={warnings:N,longStackTraces:!1,cancellation:!1,monitoring:!1};if(T)$.longStackTraces();return{longStackTraces:function(){return g0.longStackTraces},warnings:function(){return g0.warnings},cancellation:function(){return g0.cancellation},monitoring:function(){return g0.monitoring},propagateFromFunction:function(){return d},boundValueFunction:function(){return a},checkForgottenReturns:M0,setBounds:O7,warn:v1,deprecated:R0,CapturedTrace:s6,fireDomEvent:B,fireGlobalEvent:k}}});var uK0=L((VR1,yK0)=>{yK0.exports=function($,I){var q=n1(),U=$.CancellationError,Y=q.errorObj;function J(H,V,W){this.promise=H,this.type=V,this.handler=W,this.called=!1,this.cancelPromise=null}J.prototype.isFinallyHandler=function(){return this.type===0};function Q(H){this.finallyHandler=H}Q.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(H,V){if(H.cancelPromise!=null){if(arguments.length>1)H.cancelPromise._reject(V);else H.cancelPromise._cancel();return H.cancelPromise=null,!0}return!1}function w(){return G.call(this,this.promise._target()._settledValue())}function z(H){if(K(this,H))return;return Y.e=H,Y}function G(H){var V=this.promise,W=this.handler;if(!this.called){this.called=!0;var X=this.isFinallyHandler()?W.call(V._boundValue()):W.call(V._boundValue(),H);if(X!==void 0){V._setReturnedNonUndefined();var D=I(X,V);if(D instanceof $){if(this.cancelPromise!=null){if(D._isCancelled()){var O=new U("late cancellation observer");return V._attachExtraTrace(O),Y.e=O,Y}else if(D.isPending())D._attachCancellationCallback(new Q(this))}return D._then(w,z,void 0,this,void 0)}}}if(V.isRejected())return K(this),Y.e=H,Y;else return K(this),H}return $.prototype._passThrough=function(H,V,W,X){if(typeof H!=="function")return this.then();return this._then(W,X,void 0,new J(this,V,H),void 0)},$.prototype.lastly=$.prototype.finally=function(H){return this._passThrough(H,0,G,G)},$.prototype.tap=function(H){return this._passThrough(H,1,G)},J}});var kK0=L((WR1,xK0)=>{xK0.exports=function($){var I=n1(),q=n3().keys,U=I.tryCatch,Y=I.errorObj;function J(Q,K,w){return function(z){var G=w._boundValue();$:for(var H=0;H<Q.length;++H){var V=Q[H];if(V===Error||V!=null&&V.prototype instanceof Error){if(z instanceof V)return U(K).call(G,z)}else if(typeof V==="function"){var W=U(V).call(G,z);if(W===Y)return W;else if(W)return U(K).call(G,z)}else if(I.isObject(z)){var X=q(V);for(var D=0;D<X.length;++D){var O=X[D];if(V[O]!=z[O])continue $}return U(K).call(G,z)}}return $}}return J}});var NS=L((ZR1,iK0)=>{var fK0=n1(),SU1=fK0.maybeWrapAsError,yU1=S5(),uU1=yU1.OperationalError,nK0=n3();function xU1($){return $ instanceof Error&&nK0.getPrototypeOf($)===Error.prototype}var kU1=/^(?:name|message|stack|cause)$/;function fU1($){var I;if(xU1($)){I=new uU1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var q=nK0.keys($);for(var U=0;U<q.length;++U){var Y=q[U];if(!kU1.test(Y))I[Y]=$[Y]}return I}return fK0.markAsOriginatingFromRejection($),$}function nU1($,I){return function(q,U){if($===null)return;if(q){var Y=fU1(SU1(q));$._attachExtraTrace(Y),$._reject(Y)}else if(!I)$._fulfill(U);else{var J=arguments.length,Q=Array(Math.max(J-1,0));for(var K=1;K<J;++K)Q[K-1]=arguments[K];$._fulfill(Q)}$=null}}iK0.exports=nU1});var pK0=L((XR1,bK0)=>{bK0.exports=function($,I,q,U,Y){var J=n1(),Q=J.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+J.classString(K));return function(){var w=new $(I);w._captureStackTrace(),w._pushContext();var z=Q(K).apply(this,arguments),G=w._popContext();return Y.checkForgottenReturns(z,G,"Promise.method",w),w._resolveFromSyncValue(z),w}},$.attempt=$.try=function(K){if(typeof K!=="function")return U("expecting a function but got "+J.classString(K));var w=new $(I);w._captureStackTrace(),w._pushContext();var z;if(arguments.length>1){Y.deprecated("calling Promise.try with more than 1 argument");var G=arguments[1],H=arguments[2];z=J.isArray(G)?Q(K).apply(H,G):Q(K).call(H,G)}else z=Q(K)();var V=w._popContext();return Y.checkForgottenReturns(z,V,"Promise.try",w),w._resolveFromSyncValue(z),w},$.prototype._resolveFromSyncValue=function(K){if(K===J.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var dK0=L((DR1,cK0)=>{cK0.exports=function($,I,q,U){var Y=!1,J=function(z,G){this._reject(G)},Q=function(z,G){G.promiseRejectionQueued=!0,G.bindingPromise._then(J,J,null,this,z)},K=function(z,G){if((this._bitField&50397184)===0)this._resolveCallback(G.target)},w=function(z,G){if(!G.promiseRejectionQueued)this._reject(z)};$.prototype.bind=function(z){if(!Y)Y=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var G=q(z),H=new $(I);H._propagateFrom(this,1);var V=this._target();if(H._setBoundTo(G),G instanceof $){var W={promiseRejectionQueued:!1,promise:H,target:V,bindingPromise:G};V._then(I,Q,voi Line truncated
See http://goo.gl/MqrFmX
`);return this._settledValue()},U=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()},Y=I.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},J=I.prototype.isRejected=function(){return(this._bitField&16777216)!==0},Q=I.prototype.isPending=function(){return(this._bitField&50397184)===0},K=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 Q.call(this._target())},$.prototype.isRejected=function(){return J.call(this._target())},$.prototype.isFulfilled=function(){return Y.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return q.call(this._target())},$.prototype.reason=function(){var z=this._target();return z._unsetRejectionIsUnhandled(),U.call(z)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var uK0=L((cv1,yK0)=>{yK0.exports=function($,I,q,U,Y,J){var Q=n1(),K=Q.canEvaluate,z=Q.tryCatch,w=Q.errorObj,G;if(K){var H=function(T){return Function("value","holder",`
`);return this._settledValue()},Y=I.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},J=I.prototype.isRejected=function(){return(this._bitField&16777216)!==0},Q=I.prototype.isPending=function(){return(this._bitField&50397184)===0},K=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 Q.call(this._target())},$.prototype.isRejected=function(){return J.call(this._target())},$.prototype.isFulfilled=function(){return Y.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return q.call(this._target())},$.prototype.reason=function(){var w=this._target();return w._unsetRejectionIsUnhandled(),U.call(w)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var eK0=L((FR1,sK0)=>{sK0.exports=function($,I,q,U,Y,J){var Q=n1(),K=Q.canEvaluate,w=Q.tryCatch,z=Q.errorObj,G;if(K){var H=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",`
`.replace(/Index/g,T))},V=function(T){return Function("promise","holder",`
'use strict';
holder.pIndex = promise;
`.replace(/Index/g,T))},V=function(T){var P=Array(T);for(var g=0;g<P.length;++g)P[g]="this.p"+(g+1);var B=P.join(" = ")+" = null;",x=`var promise;
`.replace(/Index/g,T))},W=function(T){var P=Array(T);for(var g=0;g<P.length;++g)P[g]="this.p"+(g+1);var B=P.join(" = ")+" = null;",k=`var promise;
`+P.map(function(t){return`
promise = `+t+`;
if (promise instanceof Promise) {
@@ -134,7 +134,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof h4))r
return [TheName];
}(tryCatch, errorObj, Promise, async);
`;return S=S.replace(/\[TheName\]/g,f).replace(/\[TheTotal\]/g,T).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,B).replace(/\[CancellationCode\]/g,x),Function("tryCatch","errorObj","Promise","async",S)(z,w,$,Y)},X=[],D=[],O=[];for(var N=0;N<8;++N)X.push(V(N+1)),D.push(H(N+1)),O.push(W(N+1));G=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&&K){var n=new $(U);n._captureStackTrace();var g=X[T-1],B=new g(P),x=D;for(var h=0;h<T;++h){var f=q(arguments[h],n);if(f instanceof $){f=f._target();var S=f._bitField;if((S&50397184)===0)f._then(x[h],G,void 0,n,B),O[h](f,B),B.asyncNeeded=!1;else if((S&33554432)!==0)x[h].call(n,f._value(),B);else if((S&16777216)!==0)n._reject(f._reason());else n._cancel()}else x[h].call(n,f,B)}if(!n._isFateSealed()){if(B.asyncNeeded){var t=J();if(t!==null)B.fn=Q.domainBind(t,B.fn)}n._setAsyncGuaranteed(),n._setOnCancel(B)}return n}}var p=arguments.length,C=Array(p);for(var k=0;k<p;++k)C[k]=arguments[k];if(P)C.pop();var n=new I(C).promise();return P!==void 0?n.spread(P):n}}});var kK0=L((dv1,xK0)=>{xK0.exports=function($,I,q,U,Y,J){var Q=$._getDomain,K=n1(),z=K.tryCatch,w=K.errorObj,G=$._async;function H(V,X,D,O){this.constructor$(V),this._promise._captureStackTrace();var N=Q();this._callback=N===null?X:K.domainBind(N,X),this._preservedValues=O===Y?Array(this.length()):null,this._limit=D,this._inFlight=0,this._queue=[],G.invoke(this._asyncInit,this,void 0)}K.inherits(H,I),H.prototype._asyncInit=function(){this._init$(void 0,-2)},H.prototype._init=function(){},H.prototype._promiseFulfilled=function(V,X){var D=this._values,O=this.length(),N=this._preservedValues,T=this._limit;if(X<0){if(X=X*-1-1,D[X]=V,T>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(T>=1&&this._inFlight>=T)return D[X]=V,this._queue.push(X),!1;if(N!==null)N[X]=V;var P=this._promise,g=this._callback,B=P._boundValue();P._pushContext();var x=z(g).call(B,V,X,O),h=P._popContext();if(J.checkForgottenReturns(x,h,N!==null?"Promise.filter":"Promise.map",P),x===w)return this._reject(x.e),!0;var f=U(x,this._promise);if(f instanceof $){f=f._target();var S=f._bitField;if((S&50397184)===0){if(T>=1)this._inFlight++;return D[X]=f,f._proxy(this,(X+1)*-1),!1}else if((S&33554432)!==0)x=f._value();else if((S&16777216)!==0)return this._reject(f._reason()),!0;else return this._cancel(),!0}D[X]=x}var t=++this._totalResolved;if(t>=O){if(N!==null)this._filter(D,N);else this._resolve(D);return!0}return!1},H.prototype._drainQueue=function(){var V=this._queue,X=this._limit,D=this._values;while(V.length>0&&this._inFlight<X){if(this._isResolved())return;var O=V.pop();this._promiseFulfilled(D[O],O)}},H.prototype._filter=function(V,X){var D=X.length,O=Array(D),N=0;for(var T=0;T<D;++T)if(V[T])O[N++]=X[T];O.length=N,this._resolve(O)},H.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,D,O){if(typeof X!=="function")return q("expecting a function but got "+K.classString(X));var N=0;if(D!==void 0)if(typeof D==="object"&&D!==null){if(typeof D.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(D.concurrency)));N=D.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(D)));return N=typeof N==="number"&&isFinite(N)&&N>=1?N:0,new H(V,X,N,O).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,D,O){return W(V,X,D,O)}}});var nK0=L((lv1,fK0)=>{var zS=Object.create;if(zS)eX=zS(null),$D=zS(null),eX[" size"]=$D[" size"]=0;var eX,$D;fK0.exports=function($){var I=n1(),q=I.canEvaluate,U=I.isIdentifier,Y,J,Q=function(V){return Function("ensureMethod",`
`;return S=S.replace(/\[TheName\]/g,f).replace(/\[TheTotal\]/g,T).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,B).replace(/\[CancellationCode\]/g,k),Function("tryCatch","errorObj","Promise","async",S)(w,z,$,Y)},X=[],D=[],O=[];for(var N=0;N<8;++N)X.push(W(N+1)),D.push(H(N+1)),O.push(V(N+1));G=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&&K){var i=new $(U);i._captureStackTrace();var g=X[T-1],B=new g(P),k=D;for(var h=0;h<T;++h){var f=q(arguments[h],i);if(f instanceof $){f=f._target();var S=f._bitField;if((S&50397184)===0)f._then(k[h],G,void 0,i,B),O[h](f,B),B.asyncNeeded=!1;else if((S&33554432)!==0)k[h].call(i,f._value(),B);else if((S&16777216)!==0)i._reject(f._reason());else i._cancel()}else k[h].call(i,f,B)}if(!i._isFateSealed()){if(B.asyncNeeded){var t=J();if(t!==null)B.fn=Q.domainBind(t,B.fn)}i._setAsyncGuaranteed(),i._setOnCancel(B)}return i}}var p=arguments.length,C=Array(p);for(var n=0;n<p;++n)C[n]=arguments[n];if(P)C.pop();var i=new I(C).promise();return P!==void 0?i.spread(P):i}}});var Iw0=L((MR1,$w0)=>{$w0.exports=function($,I,q,U,Y,J){var Q=$._getDomain,K=n1(),w=K.tryCatch,z=K.errorObj,G=$._async;function H(W,X,D,O){this.constructor$(W),this._promise._captureStackTrace();var N=Q();this._callback=N===null?X:K.domainBind(N,X),this._preservedValues=O===Y?Array(this.length()):null,this._limit=D,this._inFlight=0,this._queue=[],G.invoke(this._asyncInit,this,void 0)}K.inherits(H,I),H.prototype._asyncInit=function(){this._init$(void 0,-2)},H.prototype._init=function(){},H.prototype._promiseFulfilled=function(W,X){var D=this._values,O=this.length(),N=this._preservedValues,T=this._limit;if(X<0){if(X=X*-1-1,D[X]=W,T>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(T>=1&&this._inFlight>=T)return D[X]=W,this._queue.push(X),!1;if(N!==null)N[X]=W;var P=this._promise,g=this._callback,B=P._boundValue();P._pushContext();var k=w(g).call(B,W,X,O),h=P._popContext();if(J.checkForgottenReturns(k,h,N!==null?"Promise.filter":"Promise.map",P),k===z)return this._reject(k.e),!0;var f=U(k,this._promise);if(f instanceof $){f=f._target();var S=f._bitField;if((S&50397184)===0){if(T>=1)this._inFlight++;return D[X]=f,f._proxy(this,(X+1)*-1),!1}else if((S&33554432)!==0)k=f._value();else if((S&16777216)!==0)return this._reject(f._reason()),!0;else return this._cancel(),!0}D[X]=k}var t=++this._totalResolved;if(t>=O){if(N!==null)this._filter(D,N);else this._resolve(D);return!0}return!1},H.prototype._drainQueue=function(){var W=this._queue,X=this._limit,D=this._values;while(W.length>0&&this._inFlight<X){if(this._isResolved())return;var O=W.pop();this._promiseFulfilled(D[O],O)}},H.prototype._filter=function(W,X){var D=X.length,O=Array(D),N=0;for(var T=0;T<D;++T)if(W[T])O[N++]=X[T];O.length=N,this._resolve(O)},H.prototype.preservedValues=function(){return this._preservedValues};function V(W,X,D,O){if(typeof X!=="function")return q("expecting a function but got "+K.classString(X));var N=0;if(D!==void 0)if(typeof D==="object"&&D!==null){if(typeof D.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(D.concurrency)));N=D.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(D)));return N=typeof N==="number"&&isFinite(N)&&N>=1?N:0,new H(W,X,N,O).promise()}$.prototype.map=function(W,X){return V(this,W,X,null)},$.map=function(W,X,D,O){return V(W,X,D,O)}}});var Uw0=L((AR1,qw0)=>{var FS=Object.create;if(FS)YD=FS(null),JD=FS(null),YD[" size"]=JD[" size"]=0;var YD,JD;qw0.exports=function($){var I=n1(),q=I.canEvaluate,U=I.isIdentifier,Y,J,Q=function(W){return Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
@@ -148,10 +148,10 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof h4))r
return obj.methodName.apply(obj, this);
}
};
`.replace(/methodName/g,V))(w)},K=function(V){return Function("obj",`
`.replace(/methodName/g,W))(z)},K=function(W){return Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",V))},z=function(V,X,D){var O=D[V];if(typeof O!=="function"){if(!U(V))return null;if(O=X(V),D[V]=O,D[" size"]++,D[" size"]>512){var N=Object.keys(D);for(var T=0;T<256;++T)delete D[N[T]];D[" size"]=N.length-256}}return O};Y=function(V){return z(V,Q,eX)},J=function(V){return z(V,K,$D)};function w(V,X){var D;if(V!=null)D=V[X];if(typeof D!=="function"){var O="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(O)}return D}function G(V){var X=this.pop(),D=w(V,X);return D.apply(V,this)}$.prototype.call=function(V){var X=arguments.length,D=Array(Math.max(X-1,0));for(var O=1;O<X;++O)D[O-1]=arguments[O];if(q){var N=Y(V);if(N!==null)return this._then(N,void 0,void 0,D,void 0)}return D.push(V),this._then(G,void 0,void 0,D,void 0)};function H(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",D;if(!X)if(q){var O=J(V);D=O!==null?O:H}else D=H;else D=W;return this._then(D,void 0,void 0,V,void 0)}}});var iK0=L((mv1,bK0)=>{bK0.exports=function($,I,q,U,Y,J){var Q=n1(),K=v5().TypeError,z=n1().inherits,w=Q.errorObj,G=Q.tryCatch,H={};function W(P){setTimeout(function(){throw P},0)}function V(P){var g=q(P);if(g!==P&&typeof P._isDisposable==="function"&&typeof P._getDisposer==="function"&&P._isDisposable())g._setDisposable(P._getDisposer());return g}function X(P,g){var B=0,x=P.length,h=new $(Y);function f(){if(B>=x)return h._fulfill();var S=V(P[B++]);if(S instanceof $&&S._isDisposable()){try{S=q(S._getDisposer().tryDispose(g),P.promise)}catch(t){return W(t)}if(S instanceof $)return S._then(f,W,null,null,null)}f()}return f(),h}function D(P,g,B){this._data=P,this._promise=g,this._context=B}D.prototype.data=function(){return this._data},D.prototype.promise=function(){return this._promise},D.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return H},D.prototype.tryDispose=function(P){var g=this.resource(),B=this._context;if(B!==void 0)B._pushContext();var x=g!==H?this.doDispose(g,P):null;if(B!==void 0)B._popContext();return this._promise._unsetDisposable(),this._data=null,x},D.isDisposer=function(P){return P!=null&&typeof P.resource==="function"&&typeof P.tryDispose==="function"};function O(P,g,B){this.constructor$(P,g,B)}z(O,D),O.prototype.doDispose=function(P,g){var B=this.data();return B.call(P,P,g)};function N(P){if(D.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 g=0;g<P;++g){var B=this[g];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 g=arguments[P-1];if(typeof g!=="function")return I("expecting a function but got "+Q.classString(g));var B,x=!0;if(P===2&&Array.isArray(arguments[0]))B=arguments[0],P=B.length,x=!1;else B=arguments,P--;var h=new T(P);for(var f=0;f<P;++f){var S=B[f];if(D.isDisposer(S)){var t=S;S=S.promise(),S._setDisposable(t)}else{var p=q(S);if(p instanceof $)S=p._then(N,null,null,{resources:h,index:f},void 0)}h[f]=S}var C=Array(h.length);for(var f=0;f<C.length;++f)C[f]=$.resolve(h[f]).reflect();var k=$.all(C).then(function(J0){for(var j=0;j<J0.length;++j){var u=J0[j];if(u.isRejected())return w.e=u.error(),w;else if(!u.isFulfilled()){k.cancel();return}J0[j]=u.value()}n._pushContext(),g=G(g);var d=x?g.apply(void 0,J0):g(J0),a=n._popContext();return J.checkForgottenReturns(d,a,"Promise.using",n),d}),n=k.lastly(function(){var J0=new $.PromiseInspection(k);return X(h,J0)});return h.promise=n,n._setOnCancel(h),n},$.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 O(P,this,U());throw new K}}});var cK0=L((ov1,pK0)=>{pK0.exports=function($,I,q){var U=n1(),Y=$.TimeoutError;function J(H){this.handle=H}J.prototype._resultCancelled=function(){clearTimeout(this.handle)};var Q=function(H){return K(+this).thenReturn(H)},K=$.delay=function(H,W){var V,X;if(W!==void 0){if(V=$.resolve(W)._then(Q,null,null,H,void 0),q.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+H),q.cancellation())V._setOnCancel(new J(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(H){return K(H,this)};var z=function(H,W,V){var X;if(typeof W!=="string")if(W instanceof Error)X=W;else X=new Y("operation timed out");else X=new Y(W);if(U.markAsOriginatingFromRejection(X),H._attachExtraTrace(X),H._reject(X),V!=null)V.cancel()};function w(H){return clearTimeout(this.handle),H}f Line truncated
`.replace("propertyName",W))},w=function(W,X,D){var O=D[W];if(typeof O!=="function"){if(!U(W))return null;if(O=X(W),D[W]=O,D[" size"]++,D[" size"]>512){var N=Object.keys(D);for(var T=0;T<256;++T)delete D[N[T]];D[" size"]=N.length-256}}return O};Y=function(W){return w(W,Q,YD)},J=function(W){return w(W,K,JD)};function z(W,X){var D;if(W!=null)D=W[X];if(typeof D!=="function"){var O="Object "+I.classString(W)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(O)}return D}function G(W){var X=this.pop(),D=z(W,X);return D.apply(W,this)}$.prototype.call=function(W){var X=arguments.length,D=Array(Math.max(X-1,0));for(var O=1;O<X;++O)D[O-1]=arguments[O];if(q){var N=Y(W);if(N!==null)return this._then(N,void 0,void 0,D,void 0)}return D.push(W),this._then(G,void 0,void 0,D,void 0)};function H(W){return W[this]}function V(W){var X=+this;if(X<0)X=Math.max(0,X+W.length);return W[X]}$.prototype.get=function(W){var X=typeof W==="number",D;if(!X)if(q){var O=J(W);D=O!==null?O:H}else D=H;else D=V;return this._then(D,void 0,void 0,W,void 0)}}});var Jw0=L((gR1,Yw0)=>{Yw0.exports=function($,I,q,U,Y,J){var Q=n1(),K=S5().TypeError,w=n1().inherits,z=Q.errorObj,G=Q.tryCatch,H={};function V(P){setTimeout(function(){throw P},0)}function W(P){var g=q(P);if(g!==P&&typeof P._isDisposable==="function"&&typeof P._getDisposer==="function"&&P._isDisposable())g._setDisposable(P._getDisposer());return g}function X(P,g){var B=0,k=P.length,h=new $(Y);function f(){if(B>=k)return h._fulfill();var S=W(P[B++]);if(S instanceof $&&S._isDisposable()){try{S=q(S._getDisposer().tryDispose(g),P.promise)}catch(t){return V(t)}if(S instanceof $)return S._then(f,V,null,null,null)}f()}return f(),h}function D(P,g,B){this._data=P,this._promise=g,this._context=B}D.prototype.data=function(){return this._data},D.prototype.promise=function(){return this._promise},D.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return H},D.prototype.tryDispose=function(P){var g=this.resource(),B=this._context;if(B!==void 0)B._pushContext();var k=g!==H?this.doDispose(g,P):null;if(B!==void 0)B._popContext();return this._promise._unsetDisposable(),this._data=null,k},D.isDisposer=function(P){return P!=null&&typeof P.resource==="function"&&typeof P.tryDispose==="function"};function O(P,g,B){this.constructor$(P,g,B)}w(O,D),O.prototype.doDispose=function(P,g){var B=this.data();return B.call(P,P,g)};function N(P){if(D.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 g=0;g<P;++g){var B=this[g];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 g=arguments[P-1];if(typeof g!=="function")return I("expecting a function but got "+Q.classString(g));var B,k=!0;if(P===2&&Array.isArray(arguments[0]))B=arguments[0],P=B.length,k=!1;else B=arguments,P--;var h=new T(P);for(var f=0;f<P;++f){var S=B[f];if(D.isDisposer(S)){var t=S;S=S.promise(),S._setDisposable(t)}else{var p=q(S);if(p instanceof $)S=p._then(N,null,null,{resources:h,index:f},void 0)}h[f]=S}var C=Array(h.length);for(var f=0;f<C.length;++f)C[f]=$.resolve(h[f]).reflect();var n=$.all(C).then(function(J0){for(var E=0;E<J0.length;++E){var u=J0[E];if(u.isRejected())return z.e=u.error(),z;else if(!u.isFulfilled()){n.cancel();return}J0[E]=u.value()}i._pushContext(),g=G(g);var d=k?g.apply(void 0,J0):g(J0),a=i._popContext();return J.checkForgottenReturns(d,a,"Promise.using",i),d}),i=n.lastly(function(){var J0=new $.PromiseInspection(n);return X(h,J0)});return h.promise=i,i._setOnCancel(h),i},$.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 O(P,this,U());throw new K}}});var Kw0=L((PR1,Qw0)=>{Qw0.exports=function($,I,q){var U=n1(),Y=$.TimeoutError;function J(H){this.handle=H}J.prototype._resultCancelled=function(){clearTimeout(this.handle)};var Q=function(H){return K(+this).thenReturn(H)},K=$.delay=function(H,V){var W,X;if(V!==void 0){if(W=$.resolve(V)._then(Q,null,null,H,void 0),q.cancellation()&&V instanceof $)W._setOnCancel(V)}else{if(W=new $(I),X=setTimeout(function(){W._fulfill()},+H),q.cancellation())W._setOnCancel(new J(X));W._captureStackTrace()}return W._setAsyncGuaranteed(),W};$.prototype.delay=function(H){return K(H,this)};var w=function(H,V,W){var X;if(typeof V!=="string")if(V instanceof Error)X=V;else X=new Y("operation timed out");else X=new Y(V);if(U.markAsOriginatingFromRejection(X),H._attachExtraTrace(X),H._reject(X),W!=null)W.cancel()};function z(H){return clearTimeout(this.handle),H}f Line truncated
See http://goo.gl/MqrFmX
@@ -161,16 +161,16 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof h4))r
`)));return}}N=N._target();var T=N._bitField;if((T&50397184)===0)this._yieldedPromise=N,N._proxy(this,null);else if((T&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,N._value());else if((T&16777216)!==0)$._async.invoke(this._promiseRejected,this,N._reason());else this._promiseCancelled()}},$.coroutine=function(X,D){if(typeof X!=="function")throw new K(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var O=Object(D).yieldHandler,N=V,T=Error().stack;return function(){var P=X.apply(this,arguments),g=new N(void 0,void 0,O,T),B=g.promise();return g._generator=P,g._promiseFulfilled(void 0),B}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new K("expecting a function but got "+z.classString(X));H.push(X)},$.spawn=function(X){if(J.deprecated("Promise.spawn()","Promise.coroutine()"),typeof X!=="function")return I(`generatorFunction must be a function
`);var O=Object(D).yieldHandler,N=W,T=Error().stack;return function(){var P=X.apply(this,arguments),g=new N(void 0,void 0,O,T),B=g.promise();return g._generator=P,g._promiseFulfilled(void 0),B}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new K("expecting a function but got "+w.classString(X));H.push(X)},$.spawn=function(X){if(J.deprecated("Promise.spawn()","Promise.coroutine()"),typeof X!=="function")return I(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var D=new V(X,this),O=D.promise();return D._run($.spawn),O}}});var oK0=L((tv1,mK0)=>{mK0.exports=function($){var I=n1(),q=$._async,U=I.tryCatch,Y=I.errorObj;function J(z,w){var G=this;if(!I.isArray(z))return Q.call(G,z,w);var H=U(w).apply(G._boundValue(),[null].concat(z));if(H===Y)q.throwLater(H.e)}function Q(z,w){var G=this,H=G._boundValue(),W=z===void 0?U(w).call(H,null):U(w).call(H,null,z);if(W===Y)q.throwLater(W.e)}function K(z,w){var G=this;if(!z){var H=Error(z+"");H.cause=z,z=H}var W=U(w).call(G._boundValue(),z);if(W===Y)q.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(z,w){if(typeof z=="function"){var G=Q;if(w!==void 0&&Object(w).spread)G=J;this._then(G,K,void 0,this,z)}return this}}});var tK0=L((av1,rK0)=>{rK0.exports=function($,I){var q={},U=n1(),Y=KS(),J=U.withAppended,Q=U.maybeWrapAsError,K=U.canEvaluate,z=v5().TypeError,w="Async",G={__isPromisified__:!0},H=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+H.join("|")+")$"),V=function(k){return U.isIdentifier(k)&&k.charAt(0)!=="_"&&k!=="constructor"};function X(k){return!W.test(k)}function D(k){try{return k.__isPromisified__===!0}catch(n){return!1}}function O(k,n,J0){var j=U.getDataPropertyOrDefault(k,n+J0,G);return j?D(j):!1}function N(k,n,J0){for(var j=0;j<k.length;j+=2){var u=k[j];if(J0.test(u)){var d=u.replace(J0,"");for(var a=0;a<k.length;a+=2)if(k[a]===d)throw new z(`Cannot promisify an API that has normal methods with '%s'-suffix
`);var D=new W(X,this),O=D.promise();return D._run($.spawn),O}}});var Hw0=L((ER1,Gw0)=>{Gw0.exports=function($){var I=n1(),q=$._async,U=I.tryCatch,Y=I.errorObj;function J(w,z){var G=this;if(!I.isArray(w))return Q.call(G,w,z);var H=U(z).apply(G._boundValue(),[null].concat(w));if(H===Y)q.throwLater(H.e)}function Q(w,z){var G=this,H=G._boundValue(),V=w===void 0?U(z).call(H,null):U(z).call(H,null,w);if(V===Y)q.throwLater(V.e)}function K(w,z){var G=this;if(!w){var H=Error(w+"");H.cause=w,w=H}var V=U(z).call(G._boundValue(),w);if(V===Y)q.throwLater(V.e)}$.prototype.asCallback=$.prototype.nodeify=function(w,z){if(typeof w=="function"){var G=Q;if(z!==void 0&&Object(z).spread)G=J;this._then(G,K,void 0,this,w)}return this}}});var Ww0=L((jR1,Vw0)=>{Vw0.exports=function($,I){var q={},U=n1(),Y=NS(),J=U.withAppended,Q=U.maybeWrapAsError,K=U.canEvaluate,w=S5().TypeError,z="Async",G={__isPromisified__:!0},H=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],V=new RegExp("^(?:"+H.join("|")+")$"),W=function(n){return U.isIdentifier(n)&&n.charAt(0)!=="_"&&n!=="constructor"};function X(n){return!V.test(n)}function D(n){try{return n.__isPromisified__===!0}catch(i){return!1}}function O(n,i,J0){var E=U.getDataPropertyOrDefault(n,i+J0,G);return E?D(E):!1}function N(n,i,J0){for(var E=0;E<n.length;E+=2){var u=n[E];if(J0.test(u)){var d=u.replace(J0,"");for(var a=0;a<n.length;a+=2)if(n[a]===d)throw new w(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",n))}}}function T(k,n,J0,j){var u=U.inheritedDataKeys(k),d=[];for(var a=0;a<u.length;++a){var K0=u[a],G0=k[K0],M0=j===V?!0:V(K0,G0,k);if(typeof G0==="function"&&!D(G0)&&!O(k,K0,n)&&j(K0,G0,k,M0))d.push(K0,G0)}return N(d,n,J0),d}var P=function(k){return k.replace(/([$])/,"\\$")},g,B=function(k){var n=[k],J0=Math.max(0,k-1-3);for(var j=k-1;j>=J0;--j)n.push(j);for(var j=k+1;j<=3;++j)n.push(j);return n},x=function(k){return U.filledRange(k,"_arg","")},h=function(k){return U.filledRange(Math.max(k,3),"_arg","")},f=function(k){if(typeof k.length==="number")return Math.max(Math.min(k.length,1024),0);return 0};g=function(k,n,J0,j,u,d){var a=Math.max(0,f(j)-1),K0=B(a),G0=typeof k==="string"||n===q;function M0(N1){var F1=x(N1).join(", "),J1=N1>0?", ":"",C1;if(G0)C1=`ret = callback.call(this, {{args}}, nodeback); break;
`;else C1=n===void 0?`ret = callback({{args}}, nodeback); break;
`.replace("%s",i))}}}function T(n,i,J0,E){var u=U.inheritedDataKeys(n),d=[];for(var a=0;a<u.length;++a){var K0=u[a],G0=n[K0],M0=E===W?!0:W(K0,G0,n);if(typeof G0==="function"&&!D(G0)&&!O(n,K0,i)&&E(K0,G0,n,M0))d.push(K0,G0)}return N(d,i,J0),d}var P=function(n){return n.replace(/([$])/,"\\$")},g,B=function(n){var i=[n],J0=Math.max(0,n-1-3);for(var E=n-1;E>=J0;--E)i.push(E);for(var E=n+1;E<=3;++E)i.push(E);return i},k=function(n){return U.filledRange(n,"_arg","")},h=function(n){return U.filledRange(Math.max(n,3),"_arg","")},f=function(n){if(typeof n.length==="number")return Math.max(Math.min(n.length,1024),0);return 0};g=function(n,i,J0,E,u,d){var a=Math.max(0,f(E)-1),K0=B(a),G0=typeof n==="string"||i===q;function M0(L1){var N1=k(L1).join(", "),J1=L1>0?", ":"",C1;if(G0)C1=`ret = callback.call(this, {{args}}, nodeback); break;
`;else C1=i===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`;return C1.replace("{{args}}",F1).replace(", ",J1)}function v0(){var N1="";for(var F1=0;F1<K0.length;++F1)N1+="case "+K0[F1]+":"+M0(K0[F1]);return N1+=`
`;return C1.replace("{{args}}",N1).replace(", ",J1)}function R0(){var L1="";for(var N1=0;N1<K0.length;++N1)L1+="case "+K0[N1]+":"+M0(K0[N1]);return L1+=`
default:
var args = new Array(len + 1);
var i = 0;
@@ -182,7 +182,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof h4))r
break;
`.replace("[CodeForCall]",G0?`ret = callback.apply(this, args);
`:`ret = callback.apply(receiver, args);
`),N1}var v1=typeof k==="string"?"this != null ? this['"+k+"'] : fn":"fn",m0=`'use strict';
`),L1}var v1=typeof n==="string"?"this != null ? this['"+n+"'] : fn":"fn",l0=`'use strict';
var ret = function (Parameters) {
'use strict';
var len = arguments.length;
@@ -202,25 +202,25 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof h4))r
};
notEnumerableProp(ret, '__isPromisified__', true);
return ret;
`.replace("[CodeForSwitchCase]",v0()).replace("[GetFunctionCode]",v1);return m0=m0.replace("Parameters",h(a)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",m0)($,j,n,J,Q,Y,U.tryCatch,U.errorObj,U.notEnumerableProp,I)};function S(k,n,J0,j,u,d){var a=function(){return this}(),K0=k;if(typeof K0==="string")k=j;function G0(){var M0=n;if(n===q)M0=this;var v0=new $(I);v0._captureStackTrace();var v1=typeof K0==="string"&&this!==a?this[K0]:k,m0=Y(v0,d);try{v1.apply(M0,J(arguments,m0))}catch(N1){v0._rejectCallback(Q(N1),!0,!0)}if(!v0._isFateSealed())v0._setAsyncGuaranteed();return v0}return U.notEnumerableProp(G0,"__isPromisified__",!0),G0}var t=K?g:S;function p(k,n,J0,j,u){var d=new RegExp(P(n)+"$"),a=T(k,n,d,J0);for(var K0=0,G0=a.length;K0<G0;K0+=2){var M0=a[K0],v0=a[K0+1],v1=M0+n;if(j===t)k[v1]=t(M0,q,M0,v0,n,u);else{var m0=j(v0,function(){return t(M0,q,M0,v0,n,u)});U.notEnumerableProp(m0,"__isPromisified__",!0),k[v1]=m0}}return U.toFastProperties(k),k}function C(k,n,J0){return t(k,n,void 0,k,null,J0)}$.promisify=function(k,n){if(typeof k!=="function")throw new z("expecting a function but got "+U.classString(k));if(D(k))return k;n=Object(n);var J0=n.context===void 0?q:n.context,j=!!n.multiArgs,u=C(k,J0,j);return U.copyDescriptors(k,u,X),u},$.promisifyAll=function(k,n){if(typeof k!=="function"&&typeof k!=="object")throw new z(`the target of promisifyAll must be an object or a function
`.replace("[CodeForSwitchCase]",R0()).replace("[GetFunctionCode]",v1);return l0=l0.replace("Parameters",h(a)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",l0)($,E,i,J,Q,Y,U.tryCatch,U.errorObj,U.notEnumerableProp,I)};function S(n,i,J0,E,u,d){var a=function(){return this}(),K0=n;if(typeof K0==="string")n=E;function G0(){var M0=i;if(i===q)M0=this;var R0=new $(I);R0._captureStackTrace();var v1=typeof K0==="string"&&this!==a?this[K0]:n,l0=Y(R0,d);try{v1.apply(M0,J(arguments,l0))}catch(L1){R0._rejectCallback(Q(L1),!0,!0)}if(!R0._isFateSealed())R0._setAsyncGuaranteed();return R0}return U.notEnumerableProp(G0,"__isPromisified__",!0),G0}var t=K?g:S;function p(n,i,J0,E,u){var d=new RegExp(P(i)+"$"),a=T(n,i,d,J0);for(var K0=0,G0=a.length;K0<G0;K0+=2){var M0=a[K0],R0=a[K0+1],v1=M0+i;if(E===t)n[v1]=t(M0,q,M0,R0,i,u);else{var l0=E(R0,function(){return t(M0,q,M0,R0,i,u)});U.notEnumerableProp(l0,"__isPromisified__",!0),n[v1]=l0}}return U.toFastProperties(n),n}function C(n,i,J0){return t(n,i,void 0,n,null,J0)}$.promisify=function(n,i){if(typeof n!=="function")throw new w("expecting a function but got "+U.classString(n));if(D(n))return n;i=Object(i);var J0=i.context===void 0?q:i.context,E=!!i.multiArgs,u=C(n,J0,E);return U.copyDescriptors(n,u,X),u},$.promisifyAll=function(n,i){if(typeof n!=="function"&&typeof n!=="object")throw new w(`the target of promisifyAll must be an object or a function
See http://goo.gl/MqrFmX
`);n=Object(n);var J0=!!n.multiArgs,j=n.suffix;if(typeof j!=="string")j=w;var u=n.filter;if(typeof u!=="function")u=V;var d=n.promisifier;if(typeof d!=="function")d=t;if(!U.isIdentifier(j))throw RangeError(`suffix must be a valid identifier
`);i=Object(i);var J0=!!i.multiArgs,E=i.suffix;if(typeof E!=="string")E=z;var u=i.filter;if(typeof u!=="function")u=W;var d=i.promisifier;if(typeof d!=="function")d=t;if(!U.isIdentifier(E))throw RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);var a=U.inheritedDataKeys(k);for(var K0=0;K0<a.length;++K0){var G0=k[a[K0]];if(a[K0]!=="constructor"&&U.isClass(G0))p(G0.prototype,j,u,d,J0),p(G0,j,u,d,J0)}return p(k,j,u,d,J0)}}});var sK0=L((sv1,aK0)=>{aK0.exports=function($,I,q,U){var Y=n1(),J=Y.isObject,Q=k3(),K;if(typeof Map==="function")K=Map;var z=function(){var W=0,V=0;function X(D,O){this[W]=D,this[W+V]=O,W++}return function(O){V=O.size,W=0;var N=Array(O.size*2);return O.forEach(X,N),N}}(),w=function(W){var V=new K,X=W.length/2|0;for(var D=0;D<X;++D){var O=W[X+D],N=W[D];V.set(O,N)}return V};function G(W){var V=!1,X;if(K!==void 0&&W instanceof K)X=z(W),V=!0;else{var D=Q.keys(W),O=D.length;X=Array(O*2);for(var N=0;N<O;++N){var T=D[N];X[N]=W[T],X[N+O]=T}}this.constructor$(X),this._isMap=V,this._init$(void 0,-3)}Y.inherits(G,I),G.prototype._init=function(){},G.prototype._promiseFulfilled=function(W,V){this._values[V]=W;var X=++this._totalResolved;if(X>=this._length){var D;if(this._isMap)D=w(this._values);else{D={};var O=this.length();for(var N=0,T=this.length();N<T;++N)D[this._values[N+O]]=this._values[N]}return this._resolve(D),!0}return!1},G.prototype.shouldCopyValues=function(){return!1},G.prototype.getActualLength=function(W){return W>>1};function H(W){var V,X=q(W);if(!J(X))return U(`cannot await properties of a non-object
`);var a=U.inheritedDataKeys(n);for(var K0=0;K0<a.length;++K0){var G0=n[a[K0]];if(a[K0]!=="constructor"&&U.isClass(G0))p(G0.prototype,E,u,d,J0),p(G0,E,u,d,J0)}return p(n,E,u,d,J0)}}});var Xw0=L((BR1,Zw0)=>{Zw0.exports=function($,I,q,U){var Y=n1(),J=Y.isObject,Q=n3(),K;if(typeof Map==="function")K=Map;var w=function(){var V=0,W=0;function X(D,O){this[V]=D,this[V+W]=O,V++}return function(O){W=O.size,V=0;var N=Array(O.size*2);return O.forEach(X,N),N}}(),z=function(V){var W=new K,X=V.length/2|0;for(var D=0;D<X;++D){var O=V[X+D],N=V[D];W.set(O,N)}return W};function G(V){var W=!1,X;if(K!==void 0&&V instanceof K)X=w(V),W=!0;else{var D=Q.keys(V),O=D.length;X=Array(O*2);for(var N=0;N<O;++N){var T=D[N];X[N]=V[T],X[N+O]=T}}this.constructor$(X),this._isMap=W,this._init$(void 0,-3)}Y.inherits(G,I),G.prototype._init=function(){},G.prototype._promiseFulfilled=function(V,W){this._values[W]=V;var X=++this._totalResolved;if(X>=this._length){var D;if(this._isMap)D=z(this._values);else{D={};var O=this.length();for(var N=0,T=this.length();N<T;++N)D[this._values[N+O]]=this._values[N]}return this._resolve(D),!0}return!1},G.prototype.shouldCopyValues=function(){return!1},G.prototype.getActualLength=function(V){return V>>1};function H(V){var W,X=q(V);if(!J(X))return U(`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 G(X).promise();if(X instanceof $)V._propagateFrom(X,2);return V}$.prototype.props=function(){return H(this)},$.props=function(W){return H(W)}}});var $z0=L((ev1,eK0)=>{eK0.exports=function($,I,q,U){var Y=n1(),J=function(K){return K.then(function(z){return Q(z,K)})};function Q(K,z){var w=q(K);if(w instanceof $)return J(w);else if(K=Y.asArray(K),K===null)return U("expecting an array or an iterable object but got "+Y.classString(K));var G=new $(I);if(z!==void 0)G._propagateFrom(z,3);var{_fulfill:H,_reject:W}=G;for(var V=0,X=K.length;V<X;++V){var D=K[V];if(D===void 0&&!(V in K))continue;$.cast(D)._then(H,W,void 0,G,null)}return G}$.race=function(K){return Q(K,void 0)},$.prototype.race=function(){return Q(this,void 0)}}});var qz0=L(($R1,Iz0)=>{Iz0.exports=function($,I,q,U,Y,J){var Q=$._getDomain,K=n1(),z=K.tryCatch;function w(X,D,O,N){this.constructor$(X);var T=Q();if(this._fn=T===null?D:K.domainBind(T,D),O!==void 0)O=$.resolve(O),O._attachCancellationCallback(this);if(this._initialValue=O,this._currentCancellable=null,N===Y)this._eachValues=Array(this._length);else if(N===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(w,I),w.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==Y)this._eachValues.push(X)},w.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);return this._eachValues},w.prototype._init=function(){},w.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},w.prototype.shouldCopyValues=function(){return!1},w.prototype._resolve=function(X){this._promise._resolveCallback(X),this._values=null},w.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()},w.prototype._iterate=function(X){this._values=X;var D,O,N=X.length;if(this._initialValue!==void 0)D=this._initialValue,O=0;else D=$.resolve(X[0]),O=1;if(this._currentCancellable=D,!D.isRejected())for(;O<N;++O){var T={accum:null,value:X[O],index:O,length:N,array:this};D=D._then(W,void 0,void 0,T,void 0)}if(this._eachValues!==void 0)D=D._then(this._eachComplete,void 0,void 0,this,void 0);D._then(G,G,void 0,D,this)},$.prototype.reduce=function(X,D){return H(this,X,D,null)},$.reduce=function(X,D,O,N){return H(X,D,O,N)};function G(X,D){if(this.isFulfilled())D._resolve(X);else D._reject(X)}function H(X,D,O,N){if(typeof D!=="function")return q("expecting a function but got "+K.classString(D));var T=new w(X,D,O,N);return T.promise()}function W(X){this.accum=X,this.array._gotAccum(X);var D=U(this.value,this.array._promise);if(D instanceof $)return this.array._currentCancellable=D,D._then(V,void 0,void 0,this,void 0);else return V.call(this,D)}function V(X){var D=this.array,O=D._promise,N=z(D._fn);O._pushContext();var T;if(D._eachValues!==void 0)T=N.call(O._boundValue(),X,this.index,this.length);else T=N.call(O._boundValue(),this.accum,X,this.index,this.length);if(T instanceof $)D._currentCancellable=T;var P=O._popContext();return J.checkForgottenReturns(T,P,D._eachValues!==void 0?"Promise.each":"Promise.reduce",O),T}}});var Yz0=L((IR1,Uz0)=>{Uz0.exports=function($,I,q){var U=$.PromiseInspection,Y=n1();function J(Q){this.constructor$(Q)}Y.inherits(J,I),J.prototype._promiseResolved=function(Q,K){this._values[Q]=K;var z=++this._totalResolved;if(z>=this._length)return this._resolve(this._values),!0;return!1},J.prototype._promiseFulfilled=function(Q,K){var z=new U;return z._bitField=33554432,z._settledValueField=Q,this._promiseResolved(K,z)},J.prototype._promiseRejected=function(Q,K){var z=new U;return z._bitField=16777216,z._settledValueField=Q,this._promiseResolved(K,z)},$.settle=function(Q){return q.deprecated(".settle()",".reflect()"),new J(Q).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Qz0=L((qR1,Jz0)=>{Jz0.exports=function($,I,q){var U=n1(),Y=v5().RangeError,J=v5().AggregateError,Q=U.isArray,K={};function z(G){this.constructor$(G),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(z,I),z.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var G=Q(this._values);if(!this._isResolved()&&G&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},z.prototype.init=function(){this._initialized=!0,this._init()},z.prototype.setUnwrap=function(){this._unwrap=!0},z.prototype.howMany=function(){return this._howMany},z.prototype.setHowMany=function(G){this._howMany=G},z.prototype._promiseFulfilled=function(G){if(this._addFulfilled(G),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
`);else if(X instanceof $)W=X._then($.props,void 0,void 0,void 0,void 0);else W=new G(X).promise();if(X instanceof $)W._propagateFrom(X,2);return W}$.prototype.props=function(){return H(this)},$.props=function(V){return H(V)}}});var Ow0=L((vR1,Dw0)=>{Dw0.exports=function($,I,q,U){var Y=n1(),J=function(K){return K.then(function(w){return Q(w,K)})};function Q(K,w){var z=q(K);if(z instanceof $)return J(z);else if(K=Y.asArray(K),K===null)return U("expecting an array or an iterable object but got "+Y.classString(K));var G=new $(I);if(w!==void 0)G._propagateFrom(w,3);var{_fulfill:H,_reject:V}=G;for(var W=0,X=K.length;W<X;++W){var D=K[W];if(D===void 0&&!(W in K))continue;$.cast(D)._then(H,V,void 0,G,null)}return G}$.race=function(K){return Q(K,void 0)},$.prototype.race=function(){return Q(this,void 0)}}});var Nw0=L((RR1,Lw0)=>{Lw0.exports=function($,I,q,U,Y,J){var Q=$._getDomain,K=n1(),w=K.tryCatch;function z(X,D,O,N){this.constructor$(X);var T=Q();if(this._fn=T===null?D:K.domainBind(T,D),O!==void 0)O=$.resolve(O),O._attachCancellationCallback(this);if(this._initialValue=O,this._currentCancellable=null,N===Y)this._eachValues=Array(this._length);else if(N===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(z,I),z.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==Y)this._eachValues.push(X)},z.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);return this._eachValues},z.prototype._init=function(){},z.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},z.prototype.shouldCopyValues=function(){return!1},z.prototype._resolve=function(X){this._promise._resolveCallback(X),this._values=null},z.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()},z.prototype._iterate=function(X){this._values=X;var D,O,N=X.length;if(this._initialValue!==void 0)D=this._initialValue,O=0;else D=$.resolve(X[0]),O=1;if(this._currentCancellable=D,!D.isRejected())for(;O<N;++O){var T={accum:null,value:X[O],index:O,length:N,array:this};D=D._then(V,void 0,void 0,T,void 0)}if(this._eachValues!==void 0)D=D._then(this._eachComplete,void 0,void 0,this,void 0);D._then(G,G,void 0,D,this)},$.prototype.reduce=function(X,D){return H(this,X,D,null)},$.reduce=function(X,D,O,N){return H(X,D,O,N)};function G(X,D){if(this.isFulfilled())D._resolve(X);else D._reject(X)}function H(X,D,O,N){if(typeof D!=="function")return q("expecting a function but got "+K.classString(D));var T=new z(X,D,O,N);return T.promise()}function V(X){this.accum=X,this.array._gotAccum(X);var D=U(this.value,this.array._promise);if(D instanceof $)return this.array._currentCancellable=D,D._then(W,void 0,void 0,this,void 0);else return W.call(this,D)}function W(X){var D=this.array,O=D._promise,N=w(D._fn);O._pushContext();var T;if(D._eachValues!==void 0)T=N.call(O._boundValue(),X,this.index,this.length);else T=N.call(O._boundValue(),this.accum,X,this.index,this.length);if(T instanceof $)D._currentCancellable=T;var P=O._popContext();return J.checkForgottenReturns(T,P,D._eachValues!==void 0?"Promise.each":"Promise.reduce",O),T}}});var Mw0=L((CR1,Fw0)=>{Fw0.exports=function($,I,q){var U=$.PromiseInspection,Y=n1();function J(Q){this.constructor$(Q)}Y.inherits(J,I),J.prototype._promiseResolved=function(Q,K){this._values[Q]=K;var w=++this._totalResolved;if(w>=this._length)return this._resolve(this._values),!0;return!1},J.prototype._promiseFulfilled=function(Q,K){var w=new U;return w._bitField=33554432,w._settledValueField=Q,this._promiseResolved(K,w)},J.prototype._promiseRejected=function(Q,K){var w=new U;return w._bitField=16777216,w._settledValueField=Q,this._promiseResolved(K,w)},$.settle=function(Q){return q.deprecated(".settle()",".reflect()"),new J(Q).promise()},$.prototype.settle=function(){return $.settle(this)}}});var gw0=L((_R1,Aw0)=>{Aw0.exports=function($,I,q){var U=n1(),Y=S5().RangeError,J=S5().AggregateError,Q=U.isArray,K={};function w(G){this.constructor$(G),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(w,I),w.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var G=Q(this._values);if(!this._isResolved()&&G&&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(G){this._howMany=G},w.prototype._promiseFulfilled=function(G){if(this._addFulfilled(G),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
See http://goo.gl/MqrFmX
`);var W=new z(G),V=W.promise();return W.setHowMany(H),W.init(),V}$.some=function(G,H){return w(G,H)},$.prototype.some=function(G){return w(this,G)},$._SomePromiseArray=z}});var zz0=L((UR1,Kz0)=>{Kz0.exports=function($,I){var q=$.map;$.prototype.filter=function(U,Y){return q(this,U,Y,I)},$.filter=function(U,Y,J){return q(U,Y,J,I)}}});var Gz0=L((YR1,wz0)=>{wz0.exports=function($,I){var{reduce:q,all:U}=$;function Y(){return U(this)}function J(Q,K){return q(Q,K,I,I)}$.prototype.each=function(Q){return q(this,Q,I,0)._then(Y,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(Q){return q(this,Q,I,I)},$.each=function(Q,K){return q(Q,K,I,0)._then(Y,void 0,void 0,Q,void 0)},$.mapSeries=J}});var Vz0=L((JR1,Hz0)=>{Hz0.exports=function($){var I=$._SomePromiseArray;function q(U){var Y=new I(U),J=Y.promise();return Y.setHowMany(1),Y.setUnwrap(),Y.init(),J}$.any=function(U){return q(U)},$.prototype.any=function(){return q(this)}}});var Wz0=L((QR1,wS)=>{wS.exports=function(){var $=function(){return new H(`circular promise resolution chain
`);var V=new w(G),W=V.promise();return V.setHowMany(H),V.init(),W}$.some=function(G,H){return z(G,H)},$.prototype.some=function(G){return z(this,G)},$._SomePromiseArray=w}});var Tw0=L((hR1,Pw0)=>{Pw0.exports=function($,I){var q=$.map;$.prototype.filter=function(U,Y){return q(this,U,Y,I)},$.filter=function(U,Y,J){return q(U,Y,J,I)}}});var jw0=L((SR1,Ew0)=>{Ew0.exports=function($,I){var{reduce:q,all:U}=$;function Y(){return U(this)}function J(Q,K){return q(Q,K,I,I)}$.prototype.each=function(Q){return q(this,Q,I,0)._then(Y,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(Q){return q(this,Q,I,I)},$.each=function(Q,K){return q(Q,K,I,0)._then(Y,void 0,void 0,Q,void 0)},$.mapSeries=J}});var vw0=L((yR1,Bw0)=>{Bw0.exports=function($){var I=$._SomePromiseArray;function q(U){var Y=new I(U),J=Y.promise();return Y.setHowMany(1),Y.setUnwrap(),Y.init(),J}$.any=function(U){return q(U)},$.prototype.any=function(){return q(this)}}});var Rw0=L((uR1,MS)=>{MS.exports=function(){var $=function(){return new H(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},I=function(){return new C.PromiseInspection(this._target())},q=function(j){return C.reject(new H(j))};function U(){}var Y={},J=n1(),Q;if(J.isNode)Q=function(){var j=process.domain;if(j===void 0)j=null;return j};else Q=function(){return null};J.notEnumerableProp(C,"_getDomain",Q);var K=k3(),z=QK0(),w=new z;K.defineProperty(C,"_async",{value:w});var G=v5(),H=C.TypeError=G.TypeError;C.RangeError=G.RangeError;var W=C.CancellationError=G.CancellationError;C.TimeoutError=G.TimeoutError,C.OperationalError=G.OperationalError,C.RejectionError=G.OperationalError,C.AggregateError=G.AggregateError;var V=function(){},X={},D={},O=HK0()(C,V),N=WK0()(C,V,O,q,U),T=XK0()(C),P=T.create,g=OK0()(C,T),B=g.CapturedTrace,x=NK0()(C,O),h=MK0()(D),f=KS(),S=J.errorObj,t=J.tryCatch;function p(j,u){if(typeof u!=="function")throw new H("expecting a function but got "+J.classString(u));if(j.constructor!==C)throw new H(`the promise constructor cannot be invoked directly
`)},I=function(){return new C.PromiseInspection(this._target())},q=function(E){return C.reject(new H(E))};function U(){}var Y={},J=n1(),Q;if(J.isNode)Q=function(){var E=process.domain;if(E===void 0)E=null;return E};else Q=function(){return null};J.notEnumerableProp(C,"_getDomain",Q);var K=n3(),w=gK0(),z=new w;K.defineProperty(C,"_async",{value:z});var G=S5(),H=C.TypeError=G.TypeError;C.RangeError=G.RangeError;var V=C.CancellationError=G.CancellationError;C.TimeoutError=G.TimeoutError,C.OperationalError=G.OperationalError,C.RejectionError=G.OperationalError,C.AggregateError=G.AggregateError;var W=function(){},X={},D={},O=BK0()(C,W),N=RK0()(C,W,O,q,U),T=_K0()(C),P=T.create,g=SK0()(C,T),B=g.CapturedTrace,k=uK0()(C,O),h=kK0()(D),f=NS(),S=J.errorObj,t=J.tryCatch;function p(E,u){if(typeof u!=="function")throw new H("expecting a function but got "+J.classString(u));if(E.constructor!==C)throw new H(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function C(j){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,j!==V)p(this,j),this._resolveFromExecutor(j);this._promiseCreated(),this._fireEvent("promiseCreated",this)}C.prototype.toString=function(){return"[object Promise]"},C.prototype.caught=C.prototype.catch=function(j){var u=arguments.length;if(u>1){var d=Array(u-1),a=0,K0;for(K0=0;K0<u-1;++K0){var G0=arguments[K0];if(J.isObject(G0))d[a++]=G0;else return q("expecting an object but got A catch statement predicate "+J.classString(G0))}return d.length=a,j=arguments[K0],this.then(void 0,h(d,j,this))}return this.then(void 0,j)},C.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},C.prototype.then=function(j,u){if(g.warnings()&&arguments.length>0&&typeof j!=="function"&&typeof u!=="function"){var d=".then() only accepts functions but was passed: "+J.classString(j);if(arguments.length>1)d+=", "+J.classString(u);this._warn(d)}return this._then(j,u,void 0,void 0,void 0)},C.prototype.done=function(j,u){var d=this._then(j,u,void 0,void 0,void 0);d._setIsFinal()},C.prototype.spread=function(j){if(typeof j!=="function")return q("expecting a function but got "+J.classString(j));return this.all()._then(j,void 0,void 0,X,void 0)},C.prototype.toJSON=function(){var j={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())j.fulfillmentValue=this.value(),j.isFulfilled=!0;else if(this.isRejected())j.rejectionReason=this.reason(),j.isRejected=!0;return j},C.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new N(this).promise()},C.prototype.error=function(j){return this.caught(J.originatesFromRejection,j)},C.getNewLibraryCopy=wS.exports,C.is=function(j){return j instanceof C},C.fromNode=C.fromCallback=function(j){var u=new C(V);u._captureStackTrace();var d=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,a=t(j)(f(u,d));if(a===S)u._rejectCallback(a.e,!0);if(!u._isFateSealed())u._setAsyncGuaranteed();return u},C.all=function(j){return new N(j).promise()},C.cast=function(j){var u=O(j);if(!(u instanceof C))u=new C(V),u._captureStackTrace(),u._setFulfilled(),u._rejectionHandler0=j;return u},C.resolve=C.fulfilled=C.cast,C.reject=C.rejected=function(j){var u=new C(V);return u._captureStackTrace(),u._rejectCallback(j,!0),u},C.setScheduler=function(j){if(typeof j!=="function")throw new H("expecting a function but got "+J.classString(j));return w.setScheduler(j)},C.prototype._then=function(j,u,d,a,K0){var G0=K0!==void 0,M0=G0?K0:new C(V),v0=this._target(),v1=v0._bitField;if(!G0){if(M0._propagateFrom(this,3),M0._captureStackTrace(),a===void 0&&(this._bitField&2097152)!==0)if((v1&50397184)!==0)a=this._boundValue();else a=v0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,M0)}var m0=Q();if((v1&50397184)!==0){var N1,F1,J1=v0._settlePromiseCtx;if((v1&33554432)!==0)F1=v0._rejectionHandler0,N1=j;else if((v1&16777216)!==0)F1=v0._fulfillmentHandler0,N1=u,v0._unsetRejectionIsUnhandled();else J1=v0._settlePromiseLateCancellationObserver,F1=new W("late cancellation observer"),v0._attachExtraTrace(F1),N1=u;w.invoke(J1,v0,{handler:m0===null?N1:typeof N1==="function"&&J.domainBind(m0,N1),promise:M0,receiver:a,value:F1})}else v0._addCallbacks(j,u,M0,a,m0);return M0},C.prototype._length=function(){return this._bitField&65535},C.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},C.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},C.prototype._setLength=function(j){this._bitField=this._bitField&-65536|j&65535},C.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},C.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},C.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},C.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},C.prototype._isFinal=function(){return(this._bitField&4194304)>0},C.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},C.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},C.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},C.prototype._setAsyncGuaranteed=function(){if(w.hasCustomScheduler())return;this._bitField=this._bitField|134217728},C.prototype._receiverAt=function(j){var u=j===0?this._receiver0:this[j*4-4+3];if(u===Y)return;else if(u===void 0&&this._isBound())return this._boundValue();return u},C.prototype._promiseAt=function(j){return this[j*4-4+2]},C.prototype._fulfillmentHandlerAt=function(j){return this[j*4-4+0]},C.prototype._rejectionHandlerAt=function(j){return this[j*4-4+1]},C.prototype._boundValue=function(){},C.prototype._migrateCallback0=function(j){var{_bit Line truncated
`)}function C(E){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,E!==W)p(this,E),this._resolveFromExecutor(E);this._promiseCreated(),this._fireEvent("promiseCreated",this)}C.prototype.toString=function(){return"[object Promise]"},C.prototype.caught=C.prototype.catch=function(E){var u=arguments.length;if(u>1){var d=Array(u-1),a=0,K0;for(K0=0;K0<u-1;++K0){var G0=arguments[K0];if(J.isObject(G0))d[a++]=G0;else return q("expecting an object but got A catch statement predicate "+J.classString(G0))}return d.length=a,E=arguments[K0],this.then(void 0,h(d,E,this))}return this.then(void 0,E)},C.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},C.prototype.then=function(E,u){if(g.warnings()&&arguments.length>0&&typeof E!=="function"&&typeof u!=="function"){var d=".then() only accepts functions but was passed: "+J.classString(E);if(arguments.length>1)d+=", "+J.classString(u);this._warn(d)}return this._then(E,u,void 0,void 0,void 0)},C.prototype.done=function(E,u){var d=this._then(E,u,void 0,void 0,void 0);d._setIsFinal()},C.prototype.spread=function(E){if(typeof E!=="function")return q("expecting a function but got "+J.classString(E));return this.all()._then(E,void 0,void 0,X,void 0)},C.prototype.toJSON=function(){var E={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())E.fulfillmentValue=this.value(),E.isFulfilled=!0;else if(this.isRejected())E.rejectionReason=this.reason(),E.isRejected=!0;return E},C.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new N(this).promise()},C.prototype.error=function(E){return this.caught(J.originatesFromRejection,E)},C.getNewLibraryCopy=MS.exports,C.is=function(E){return E instanceof C},C.fromNode=C.fromCallback=function(E){var u=new C(W);u._captureStackTrace();var d=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,a=t(E)(f(u,d));if(a===S)u._rejectCallback(a.e,!0);if(!u._isFateSealed())u._setAsyncGuaranteed();return u},C.all=function(E){return new N(E).promise()},C.cast=function(E){var u=O(E);if(!(u instanceof C))u=new C(W),u._captureStackTrace(),u._setFulfilled(),u._rejectionHandler0=E;return u},C.resolve=C.fulfilled=C.cast,C.reject=C.rejected=function(E){var u=new C(W);return u._captureStackTrace(),u._rejectCallback(E,!0),u},C.setScheduler=function(E){if(typeof E!=="function")throw new H("expecting a function but got "+J.classString(E));return z.setScheduler(E)},C.prototype._then=function(E,u,d,a,K0){var G0=K0!==void 0,M0=G0?K0:new C(W),R0=this._target(),v1=R0._bitField;if(!G0){if(M0._propagateFrom(this,3),M0._captureStackTrace(),a===void 0&&(this._bitField&2097152)!==0)if((v1&50397184)!==0)a=this._boundValue();else a=R0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,M0)}var l0=Q();if((v1&50397184)!==0){var L1,N1,J1=R0._settlePromiseCtx;if((v1&33554432)!==0)N1=R0._rejectionHandler0,L1=E;else if((v1&16777216)!==0)N1=R0._fulfillmentHandler0,L1=u,R0._unsetRejectionIsUnhandled();else J1=R0._settlePromiseLateCancellationObserver,N1=new V("late cancellation observer"),R0._attachExtraTrace(N1),L1=u;z.invoke(J1,R0,{handler:l0===null?L1:typeof L1==="function"&&J.domainBind(l0,L1),promise:M0,receiver:a,value:N1})}else R0._addCallbacks(E,u,M0,a,l0);return M0},C.prototype._length=function(){return this._bitField&65535},C.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},C.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},C.prototype._setLength=function(E){this._bitField=this._bitField&-65536|E&65535},C.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},C.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},C.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},C.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},C.prototype._isFinal=function(){return(this._bitField&4194304)>0},C.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},C.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},C.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},C.prototype._setAsyncGuaranteed=function(){if(z.hasCustomScheduler())return;this._bitField=this._bitField|134217728},C.prototype._receiverAt=function(E){var u=E===0?this._receiver0:this[E*4-4+3];if(u===Y)return;else if(u===void 0&&this._isBound())return this._boundValue();return u},C.prototype._promiseAt=function(E){return this[E*4-4+2]},C.prototype._fulfillmentHandlerAt=function(E){return this[E*4-4+0]},C.prototype._rejectionHandlerAt=function(E){return this[E*4-4+1]},C.prototype._boundValue=function(){},C.prototype._migrateCallback0=function(E){var{_bit Line truncated
path = %s
syscall = %s
fstream_type = %s
@@ -230,21 +230,21 @@ fstream_class = %s
fstream_stack =
%s
`,I||"UNKNOWN",U.stack,U.path,U.syscall,U.fstream_type,U.fstream_path,U.fstream_unc_path,U.fstream_class,U.fstream_stack.join(`
`));else q.emit("warn",U)};Y7.prototype.info=function($,I){this.emit("info",$,I)};Y7.prototype.error=function($,I,q){var U=lw0($,I,this);if(q)throw U;else this.emit("error",U)};function lw0($,I,q){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.path=$.path||q.path,$.fstream_type=$.fstream_type||q.type,$.fstream_path=$.fstream_path||q.path,q._path!==q.path)$.fstream_unc_path=$.fstream_unc_path||q._path;if(q.linkpath)$.fstream_linkpath=$.fstream_linkpath||q.linkpath;return $.fstream_class=$.fstream_class||q.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var nK=L((uR1,ow0)=>{ow0.exports=tJ1;function tJ1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],q;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,Y=I.length;U<Y;U++){q=I[U];var J=$[q]||$["is"+q];if(typeof J==="function")J=J.call($);if(J)return $[q]=!0,$.type=q,q}return null}});var rS=L((xR1,rw0)=>{rw0.exports=bK;var aJ1=l6(),sJ1=n0(),oS=m3();sJ1(bK,oS);function bK($){var I=this;if(!(I instanceof bK))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);oS.call(I,$)}bK.prototype._stat=function($){var I=this;aJ1.readlink(I._path,function(q,U){if(q)return I.error(q);I.linkpath=I.props.linkpath=U,I.emit("linkpath",U),oS.prototype._stat.call(I,$)})};bK.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var aS=L((kR1,sw0)=>{sw0.exports=f8;var aw0=l6(),eJ1=n0(),iK=o("path"),tS=m3(),tw0=o("assert").ok;eJ1(f8,tS);function f8($){var I=this;if(!(I instanceof f8))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;tS.call(this,$)}f8.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,aw0.readdir($._path,function(I,q){if(I)return $.error(I);if($.entries=q,$.emit("entries",q),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};f8.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=iK.resolve($._path,$.entries[$._index]);tw0(I!==$._path),tw0($.entries[$._index]),$._currentEntry=I,aw0[$.props.follow?"stat":"lstat"](I,function(q,U){if(q)return $.error(q);var Y=$._proxy||$;U.path=I,U.basename=iK.basename(I),U.dirname=iK.dirname(I);var J=$.getChildProps.call(Y,U);J.path=I,J.basename=iK.basename(I),J.dirname=iK.dirname(I);var Q=tS(J,U);$._currentEntry=Q,Q.on("pause",function(w){if(!$._paused&&!Q._disowned)$.pause(w)}),Q.on("resume",function(w){if($._paused&&!Q._disowned)$.resume(w)}),Q.on("stat",function(w){if($.emit("_entryStat",Q,w),Q._aborted)return;if(Q._paused)Q.once("resume",function(){$.emit("entryStat",Q,w)});else $.emit("entryStat",Q,w)}),Q.on("ready",function w(){if($._paused)return Q.pause($),$.once("resume",w);if(Q.type==="Socket")$.emit("socket",Q);else $.emitEntry(Q)});var K=!1;Q.on("close",z),Q.on("disown",z);function z(){if(K)return;if(K=!0,$.emit("childEnd",Q),$.emit("entryEnd",Q),$._currentEntry=null,!$._paused)$._read()}Q.on("error",function(w){if(Q._swallowErrors)$.warn(w),Q.emit("end"),Q.emit("close");else $.emit("error",w)}),["child","childEnd","warn"].forEach(function(w){Q.on(w,$.emit.bind($,w))})})};f8.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};f8.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}};f8.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",$)};f8.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()};f8.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var sS=L((fR1,qG0)=>{qG0.exports=o3;var $Q1=l6(),IQ1=n0(),ew0=m3(),$G0={EOF:!0},IG0={CLOSE:!0};IQ1(o3,ew0);function o3($){var I=this;if(!(I instanceof o3))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,ew0.call(I,$)}o3.prototype._getStream=function(){var $=this,I=$._stream=$Q1.createReadStream($._path,$.pro Line truncated
`));else q.emit("warn",U)};K7.prototype.info=function($,I){this.emit("info",$,I)};K7.prototype.error=function($,I,q){var U=zG0($,I,this);if(q)throw U;else this.emit("error",U)};function zG0($,I,q){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.path=$.path||q.path,$.fstream_type=$.fstream_type||q.type,$.fstream_path=$.fstream_path||q.path,q._path!==q.path)$.fstream_unc_path=$.fstream_unc_path||q._path;if(q.linkpath)$.fstream_linkpath=$.fstream_linkpath||q.linkpath;return $.fstream_class=$.fstream_class||q.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var bK=L((VC1,HG0)=>{HG0.exports=NQ1;function NQ1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],q;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,Y=I.length;U<Y;U++){q=I[U];var J=$[q]||$["is"+q];if(typeof J==="function")J=J.call($);if(J)return $[q]=!0,$.type=q,q}return null}});var Ky=L((WC1,VG0)=>{VG0.exports=pK;var FQ1=m6(),MQ1=n0(),Qy=r3();MQ1(pK,Qy);function pK($){var I=this;if(!(I instanceof pK))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);Qy.call(I,$)}pK.prototype._stat=function($){var I=this;FQ1.readlink(I._path,function(q,U){if(q)return I.error(q);I.linkpath=I.props.linkpath=U,I.emit("linkpath",U),Qy.prototype._stat.call(I,$)})};pK.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var zy=L((ZC1,XG0)=>{XG0.exports=i8;var ZG0=m6(),AQ1=n0(),cK=o("path"),wy=r3(),WG0=o("assert").ok;AQ1(i8,wy);function i8($){var I=this;if(!(I instanceof i8))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;wy.call(this,$)}i8.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,ZG0.readdir($._path,function(I,q){if(I)return $.error(I);if($.entries=q,$.emit("entries",q),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};i8.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=cK.resolve($._path,$.entries[$._index]);WG0(I!==$._path),WG0($.entries[$._index]),$._currentEntry=I,ZG0[$.props.follow?"stat":"lstat"](I,function(q,U){if(q)return $.error(q);var Y=$._proxy||$;U.path=I,U.basename=cK.basename(I),U.dirname=cK.dirname(I);var J=$.getChildProps.call(Y,U);J.path=I,J.basename=cK.basename(I),J.dirname=cK.dirname(I);var Q=wy(J,U);$._currentEntry=Q,Q.on("pause",function(z){if(!$._paused&&!Q._disowned)$.pause(z)}),Q.on("resume",function(z){if($._paused&&!Q._disowned)$.resume(z)}),Q.on("stat",function(z){if($.emit("_entryStat",Q,z),Q._aborted)return;if(Q._paused)Q.once("resume",function(){$.emit("entryStat",Q,z)});else $.emit("entryStat",Q,z)}),Q.on("ready",function z(){if($._paused)return Q.pause($),$.once("resume",z);if(Q.type==="Socket")$.emit("socket",Q);else $.emitEntry(Q)});var K=!1;Q.on("close",w),Q.on("disown",w);function w(){if(K)return;if(K=!0,$.emit("childEnd",Q),$.emit("entryEnd",Q),$._currentEntry=null,!$._paused)$._read()}Q.on("error",function(z){if(Q._swallowErrors)$.warn(z),Q.emit("end"),Q.emit("close");else $.emit("error",z)}),["child","childEnd","warn"].forEach(function(z){Q.on(z,$.emit.bind($,z))})})};i8.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};i8.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}};i8.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",$)};i8.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()};i8.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var Gy=L((XC1,NG0)=>{NG0.exports=t3;var gQ1=m6(),PQ1=n0(),DG0=r3(),OG0={EOF:!0},LG0={CLOSE:!0};PQ1(t3,DG0);function t3($){var I=this;if(!(I instanceof t3))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,DG0.call(I,$)}t3.prototype._getStream=function(){var $=this,I=$._stream=gQ1.createReadStream($._path,$.pro Line truncated
expect: `+$.props.size+`
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(IG0),$._read();else $.emit("close")}),I.on("error",function(q){$.emit("error",q)}),$._read()};o3.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var q=0,U=I.length;q<U;q++){var Y=I[q];if(Y===$G0)$.emit("end");else if(Y===IG0)$.emit("close");else $.emit("data",Y);if($._paused){$._buffer=I.slice(q);return}}$._buffer.length=0}};o3.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};o3.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 JG0=L((nR1,YG0)=>{YG0.exports=jD;var qQ1=n0(),UG0=m3();qQ1(jD,UG0);function jD($){var I=this;if(!(I instanceof jD))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);UG0.call(I,$)}jD.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var $y=L((bR1,QG0)=>{QG0.exports=r3;var eS=m3(),UQ1=nK(),YQ1=n0(),JQ1=l6();YQ1(r3,eS);function r3($){var I=this;if(!(I instanceof r3))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,eS.call(I,$)}r3.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";JQ1[q](I.path,function(U,Y){var J;if(U||!Y)J="File";else J=UQ1(Y);I[J]=!0,I.type=$.type=J,$._old=Y,$._addProxy(eS(I,Y))})};r3.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(U){$.on(U,I.emit.bind(I,U))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var q=I._buffer;I._buffer.length=0,q.forEach(function(U){$[U[0]].apply($,U[1])})};r3.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};r3.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var m3=L((iR1,wG0)=>{wG0.exports=I8;var QQ1=l6(),KQ1=o("stream").Stream,zQ1=n0(),Iy=o("path"),qy=nK(),ED=I8.hardLinks={},KG0=TD();zQ1(I8,KG0);var zG0=rS();function I8($,I){var q=this;if(!(q instanceof I8))return new I8($,I);if(typeof $==="string")$={path:$};var U,Y;if($.type&&typeof $.type==="function")U=$.type,Y=U;else U=qy($),Y=I8;if(I&&!U)U=qy(I),$[U]=!0,$.type=U;switch(U){case"Directory":Y=aS();break;case"Link":case"File":Y=sS();break;case"SymbolicLink":Y=zG0;break;case"Socket":Y=JG0();break;case null:Y=$y();break}if(!(q instanceof Y))return new Y($);if(KG0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.readable=!0,q.writable=!1,q.type=U,q.props=$,q.depth=$.depth=$.depth||0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=Iy.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=$.basename=Iy.basename(q.path),q.dirname=$.dirname=Iy.dirname(q.path),$.parent=$.root=null,q.size=$.size,q.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=wQ1;q._stat(I)}function wQ1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}I8.prototype._stat=function($){var I=this,q=I.props,U=q.follow?"stat":"lstat";if($)process.nextTick(Y.bind(null,null,$));else QQ1[U](I._path,Y);function Y(J,Q){if(J)return I.error(J);if(Object.keys(Q).forEach(function(V){q[V]=Q[V]}),I.size!==void 0&&q.size!==I.size)return I.error("incorrect size");I.size=q.size;var K=qy(q),z=q.hardlinks!==!1;if(z&&K!=="Directory"&&q.nlink&&q.nlink>1){var w=q.dev+":"+q.ino;if(ED[w]===I._path||!ED[w])ED[w]=I._path;else K=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=ED[w],I._stat=I._read=zG0.prototype._read}if(I.type&&I.type!==K)I.error("Unexpected type: "+K);if(I.filter){var G=I._proxy||I;if(!I.filter.call(G,G,q)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var H=["_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=H[W++];if(!X)return I._read();I.emit(X,q),V()})()}};I8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(q){var U=$.add(q);if(U===!1)I.pause()});return KQ1.prototype.pipe.apply(this,arguments)};I8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};I8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};I8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Qy=L((pR1,OG0)=>{O Line truncated
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(LG0),$._read();else $.emit("close")}),I.on("error",function(q){$.emit("error",q)}),$._read()};t3.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var q=0,U=I.length;q<U;q++){var Y=I[q];if(Y===OG0)$.emit("end");else if(Y===LG0)$.emit("close");else $.emit("data",Y);if($._paused){$._buffer=I.slice(q);return}}$._buffer.length=0}};t3.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};t3.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 AG0=L((DC1,MG0)=>{MG0.exports=CD;var TQ1=n0(),FG0=r3();TQ1(CD,FG0);function CD($){var I=this;if(!(I instanceof CD))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);FG0.call(I,$)}CD.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Vy=L((OC1,gG0)=>{gG0.exports=a3;var Hy=r3(),EQ1=bK(),jQ1=n0(),BQ1=m6();jQ1(a3,Hy);function a3($){var I=this;if(!(I instanceof a3))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,Hy.call(I,$)}a3.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";BQ1[q](I.path,function(U,Y){var J;if(U||!Y)J="File";else J=EQ1(Y);I[J]=!0,I.type=$.type=J,$._old=Y,$._addProxy(Hy(I,Y))})};a3.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(U){$.on(U,I.emit.bind(I,U))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var q=I._buffer;I._buffer.length=0,q.forEach(function(U){$[U[0]].apply($,U[1])})};a3.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};a3.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var r3=L((LC1,EG0)=>{EG0.exports=q8;var vQ1=m6(),RQ1=o("stream").Stream,CQ1=n0(),Wy=o("path"),Zy=bK(),_D=q8.hardLinks={},PG0=RD();CQ1(q8,PG0);var TG0=Ky();function q8($,I){var q=this;if(!(q instanceof q8))return new q8($,I);if(typeof $==="string")$={path:$};var U,Y;if($.type&&typeof $.type==="function")U=$.type,Y=U;else U=Zy($),Y=q8;if(I&&!U)U=Zy(I),$[U]=!0,$.type=U;switch(U){case"Directory":Y=zy();break;case"Link":case"File":Y=Gy();break;case"SymbolicLink":Y=TG0;break;case"Socket":Y=AG0();break;case null:Y=Vy();break}if(!(q instanceof Y))return new Y($);if(PG0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.readable=!0,q.writable=!1,q.type=U,q.props=$,q.depth=$.depth=$.depth||0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=Wy.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=$.basename=Wy.basename(q.path),q.dirname=$.dirname=Wy.dirname(q.path),$.parent=$.root=null,q.size=$.size,q.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=_Q1;q._stat(I)}function _Q1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}q8.prototype._stat=function($){var I=this,q=I.props,U=q.follow?"stat":"lstat";if($)process.nextTick(Y.bind(null,null,$));else vQ1[U](I._path,Y);function Y(J,Q){if(J)return I.error(J);if(Object.keys(Q).forEach(function(W){q[W]=Q[W]}),I.size!==void 0&&q.size!==I.size)return I.error("incorrect size");I.size=q.size;var K=Zy(q),w=q.hardlinks!==!1;if(w&&K!=="Directory"&&q.nlink&&q.nlink>1){var z=q.dev+":"+q.ino;if(_D[z]===I._path||!_D[z])_D[z]=I._path;else K=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=_D[z],I._stat=I._read=TG0.prototype._read}if(I.type&&I.type!==K)I.error("Unexpected type: "+K);if(I.filter){var G=I._proxy||I;if(!I.filter.call(G,G,q)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var H=["_stat","stat","ready"],V=0;(function W(){if(I._aborted){I.emit("end"),I.emit("close");return}if(I._paused&&I.type!=="Directory"){I.once("resume",W);return}var X=H[V++];if(!X)return I._read();I.emit(X,q),W()})()}};q8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(q){var U=$.add(q);if(U===!1)I.pause()});return RQ1.prototype.pipe.apply(this,arguments)};q8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};q8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};q8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Ly=L((NC1,SG0)=>{S Line truncated
expect: `+$.size+`
actual: `+$._bytesWritten);kD.prototype._finish.call($)}});var Oy=L((KC1,QH0)=>{QH0.exports=w7;var Dy=GY(),uQ1=nK(),xQ1=n0(),kQ1=uD(),fQ1=o("fs");xQ1(w7,Dy);function w7($){var I=this;if(!(I instanceof w7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,Dy.call(I,$)}w7.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";fQ1[q](I.path,function(U,Y){var J;if(U||!Y)J="File";else J=uQ1(Y);I[J]=!0,I.type=$.type=J,$._old=Y,$._addProxy(Dy(I,Y))})};w7.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(U){$.on(U,I.emit.bind(I,U))}),I.emit("proxy",$);var q=I._buffer;if(q.forEach(function(U){$[U[0]].apply($,U[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};w7.prototype.add=function($){if(kQ1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};w7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};w7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var GY=L((zC1,XH0)=>{XH0.exports=C$;var R$=l6(),nQ1=n0(),bQ1=Qy(),iQ1=Hy(),lK=o("path"),zH0=process.platform==="win32"?0:process.umask(),wH0=nK(),GH0=TD();nQ1(C$,GH0);C$.dirmode=parseInt("0777",8)&~zH0;C$.filemode=parseInt("0666",8)&~zH0;var pQ1=Wy(),cQ1=Zy(),dQ1=Xy(),lQ1=Oy();function C$($,I){var q=this;if(typeof $==="string")$={path:$};var U=wH0($),Y=C$;switch(U){case"Directory":Y=pQ1;break;case"File":Y=dQ1;break;case"Link":case"SymbolicLink":Y=cQ1;break;case null:default:Y=lQ1;break}if(!(q instanceof Y))return new Y($);if(GH0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.type=$.type,q.props=$,q.depth=$.depth||0,q.clobber=$.clobber===!1?$.clobber:!0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=lK.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=lK.basename($.path),q.dirname=lK.dirname($.path),q.linkpath=$.linkpath||null,$.parent=$.root=null,q.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);q.readable=!1,q.writable=!0,q._buffer=[],q.ready=!1,q.filter=typeof $.filter==="function"?$.filter:null,q._stat(I)}C$.prototype._create=function(){var $=this;R$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};C$.prototype._stat=function($){var I=this,q=I.props,U=q.follow?"stat":"lstat",Y=I._proxy||I;if($)J(null,$);else R$[U](I._path,J);function J(Q,K){if(I.filter&&!I.filter.call(Y,Y,K)){I._aborted=!0,I.emit("end"),I.emit("close");return}if(Q||!K)return Ly(I);I._old=K;var z=wH0(K);if(z!==I.type||I.type==="File"&&K.nlink>1)return bQ1(I._path,function(w){if(w)return I.error(w);I._old=null,Ly(I)});Ly(I)}};function Ly($){iQ1(lK.dirname($._path),C$.dirmode,function(I,q){if(I)return $.error(I);return $._madeDir=q,$._create()})}function HH0($,I,q,U,Y){var J=I.mode,Q=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!R$[Q])return Y();if(typeof J!=="number")return Y();var K=q.mode&parseInt("0777",8);if(J=J&parseInt("0777",8),J===K)return Y();R$[Q](U,J,Y)}function VH0($,I,q,U,Y){if(process.platform==="win32")return Y();if(!process.getuid||process.getuid()!==0)return Y();if(typeof I.uid!=="number"&&typeof I.gid!=="number")return Y();if(q.uid===I.uid&&q.gid===I.gid)return Y();var J=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!R$[J])return Y();if(typeof I.uid!=="number")I.uid=q.uid;if(typeof I.gid!=="number")I.gid=q.gid;R$[J](U,I.uid,I.gid,Y)}function WH0($,I,q,U,Y){if(!R$.utimes||process.platform==="win32")return Y();var J=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(J==="lutimes"&&!R$[J])J="utimes";if(!R$[J])return Y();var{atime:Q,mtime:K}=q,z=I.atime,w=I.mtime;if(z===void 0)z=Q;if(w===void 0)w=K;if(!KH0(z))z=new Date(z);if(!KH0(w))z=new Date(w);if(z.getTime()===Q.getTime()&&w.getTime()===K.getTime())return Y();R$[J](U,z,w,Y)}C$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,q=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),J($._old);else{var Y=$.props.follow?"stat":"lstat";R$[Y]($._path,function(K,z){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);J($._old=z)})}return;function J(K){I+=3,HH0($,$.props,K,$._path,Q("chmod")),VH0($,$.props,K,$._path,Q("chown")),WH0($,$.props,K,$._path,Q("utimes"))}function Q(K){return function(z){if(q)return;if(z)return z.fstream_finish_call=K,$.error(q=z);if(--I>0)return;if(U)return;if(U=!0,!$._madeDir)return w();else ZH0($,$._path,w);function w(G){if(G)return G.fstream_finish_call="setupMadeDir",$.error(G);$.emit("end"),$.emit("close")}}}};function ZH0($,I,q){var U=$._madeDir,Y=lK.dirname(I);mQ1($,Y,function(J){if(J)return q(J);if(Y===U)return q();ZH0($,Y,q)})}function mQ1($,I,q){var U={};Object.keys($.props).forEach(function(K){if(U[K]=$.props[K],K==="mode"&&$.type!=="Directory")U[K]=U[K]|parseInt("0111",8)});var Y=3,J=null;R$.stat(I,function(K,z){if(K)return q(J=K);HH0($,U,z,I,Q),VH0($,U,z,I,Q),WH0($,U,z,I,Q)});function Q(K){if(J)return;if(K)return q(J=K);if(--Y===0)return q()}}C$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};C$.prototype.add=function(){this.error("Can't add to non-Directory type")};C$.prototype.write=function(){return!0};function oQ1($){return Object.prototype.toString.call($)}function KH0($){return typeof $==="object"&&oQ1($)==="[object Date]"}});var gy=L((rQ1)=>{rQ1.Abstract=TD();rQ1.Reader=m3();rQ1.Writer=GY();rQ1.File={Reader:sS(),Writer:Xy()};rQ1.Dir={Reader:aS(),Writer:Wy()};rQ1.Link={Reader:rS(),Writer:Zy()};rQ1.Proxy={Reader:$y(),Writer:Oy()};rQ1.Reader.Dir=rQ1.DirReader=rQ1.Dir.Reader;rQ1.Reader.File=rQ1.FileReader=rQ1.File.Reader;rQ1.Reader.Link=rQ1.LinkReader=rQ1.Link.Reader;rQ1.Reader.Proxy=rQ1.ProxyReader=rQ1.Proxy.Reader;rQ1.Writer.Dir=rQ1.DirWriter=rQ1.Dir.Writer;rQ1.Writer.File=rQ1.FileWriter=rQ1.File.Writer;rQ1.Writer.Link=rQ1.LinkWriter=rQ1.Link.Writer;rQ1.Writer.Proxy=rQ1.ProxyWriter=rQ1.Proxy.Writer;rQ1.collect=uD()});var OH0=L((LC1,DH0)=>{DH0.exports=U21;var sQ1=DD(),eQ1=gy().Writer,Py=o("path"),$21=o("stream"),I21=lS(),q21=q7();function U21($){$.path=Py.resolve(Py.normalize($.path));var I=new sQ1($),q=new $21.Writable({objectMode:!0});q._write=function(Y,J,Q){if(Y.type=="Directory")return Q();var K=Py.join($.path,Y.path);if(K.indexOf($.path)!=0)return Q();let z=$.getWriter?$.getWriter({path:K}):eQ1({path:K});Y.pipe(z).on("error",Q).on("close",Q)};var U=I21(I,q);return I.once("crx-header",function(Y){U.crxHeader=Y}),I.pipe(q).on("finish",function(){U.emit("close")}),U.promise=function(){return new q21(function(Y,J){U.on("close",Y),U.on("error",J)})},U}});var LH0=L((NC1,fD)=>{var S4=function($){var I=1e7,q=7,U=9007199254740992,Y=W(U),J="0123456789abcdefghijklmnopqrstuvwxyz",Q=typeof BigInt==="function";function K(F,M,v,y){if(typeof F>"u")return K[0];if(typeof M<"u")return+M===10&&!v?g0(F):h$(F,M,v,y);return g0(F)}function z(F,M){this.value=F,this.sign=M,this.isSmall=!1}z.prototype=Object.create(K.prototype);function w(F){this.value=F,this.sign=F<0,this.isSmall=!0}w.prototype=Object.create(K.prototype);function G(F){th Line truncated
actual: `+$._bytesWritten);pD.prototype._finish.call($)}});var vy=L((xC1,gH0)=>{gH0.exports=V7;var By=VY(),J21=bK(),Q21=n0(),K21=iD(),w21=o("fs");Q21(V7,By);function V7($){var I=this;if(!(I instanceof V7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,By.call(I,$)}V7.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";w21[q](I.path,function(U,Y){var J;if(U||!Y)J="File";else J=J21(Y);I[J]=!0,I.type=$.type=J,$._old=Y,$._addProxy(By(I,Y))})};V7.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(U){$.on(U,I.emit.bind(I,U))}),I.emit("proxy",$);var q=I._buffer;if(q.forEach(function(U){$[U[0]].apply($,U[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};V7.prototype.add=function($){if(K21($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};V7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};V7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var VY=L((kC1,_H0)=>{_H0.exports=h$;var _$=m6(),z21=n0(),G21=Ly(),H21=gy(),oK=o("path"),TH0=process.platform==="win32"?0:process.umask(),EH0=bK(),jH0=RD();z21(h$,jH0);h$.dirmode=parseInt("0777",8)&~TH0;h$.filemode=parseInt("0666",8)&~TH0;var V21=Ty(),W21=Ey(),Z21=jy(),X21=vy();function h$($,I){var q=this;if(typeof $==="string")$={path:$};var U=EH0($),Y=h$;switch(U){case"Directory":Y=V21;break;case"File":Y=Z21;break;case"Link":case"SymbolicLink":Y=W21;break;case null:default:Y=X21;break}if(!(q instanceof Y))return new Y($);if(jH0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.type=$.type,q.props=$,q.depth=$.depth||0,q.clobber=$.clobber===!1?$.clobber:!0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=oK.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=oK.basename($.path),q.dirname=oK.dirname($.path),q.linkpath=$.linkpath||null,$.parent=$.root=null,q.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);q.readable=!1,q.writable=!0,q._buffer=[],q.ready=!1,q.filter=typeof $.filter==="function"?$.filter:null,q._stat(I)}h$.prototype._create=function(){var $=this;_$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};h$.prototype._stat=function($){var I=this,q=I.props,U=q.follow?"stat":"lstat",Y=I._proxy||I;if($)J(null,$);else _$[U](I._path,J);function J(Q,K){if(I.filter&&!I.filter.call(Y,Y,K)){I._aborted=!0,I.emit("end"),I.emit("close");return}if(Q||!K)return Ry(I);I._old=K;var w=EH0(K);if(w!==I.type||I.type==="File"&&K.nlink>1)return G21(I._path,function(z){if(z)return I.error(z);I._old=null,Ry(I)});Ry(I)}};function Ry($){H21(oK.dirname($._path),h$.dirmode,function(I,q){if(I)return $.error(I);return $._madeDir=q,$._create()})}function BH0($,I,q,U,Y){var J=I.mode,Q=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!_$[Q])return Y();if(typeof J!=="number")return Y();var K=q.mode&parseInt("0777",8);if(J=J&parseInt("0777",8),J===K)return Y();_$[Q](U,J,Y)}function vH0($,I,q,U,Y){if(process.platform==="win32")return Y();if(!process.getuid||process.getuid()!==0)return Y();if(typeof I.uid!=="number"&&typeof I.gid!=="number")return Y();if(q.uid===I.uid&&q.gid===I.gid)return Y();var J=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!_$[J])return Y();if(typeof I.uid!=="number")I.uid=q.uid;if(typeof I.gid!=="number")I.gid=q.gid;_$[J](U,I.uid,I.gid,Y)}function RH0($,I,q,U,Y){if(!_$.utimes||process.platform==="win32")return Y();var J=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(J==="lutimes"&&!_$[J])J="utimes";if(!_$[J])return Y();var{atime:Q,mtime:K}=q,w=I.atime,z=I.mtime;if(w===void 0)w=Q;if(z===void 0)z=K;if(!PH0(w))w=new Date(w);if(!PH0(z))w=new Date(z);if(w.getTime()===Q.getTime()&&z.getTime()===K.getTime())return Y();_$[J](U,w,z,Y)}h$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,q=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),J($._old);else{var Y=$.props.follow?"stat":"lstat";_$[Y]($._path,function(K,w){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);J($._old=w)})}return;function J(K){I+=3,BH0($,$.props,K,$._path,Q("chmod")),vH0($,$.props,K,$._path,Q("chown")),RH0($,$.props,K,$._path,Q("utimes"))}function Q(K){return function(w){if(q)return;if(w)return w.fstream_finish_call=K,$.error(q=w);if(--I>0)return;if(U)return;if(U=!0,!$._madeDir)return z();else CH0($,$._path,z);function z(G){if(G)return G.fstream_finish_call="setupMadeDir",$.error(G);$.emit("end"),$.emit("close")}}}};function CH0($,I,q){var U=$._madeDir,Y=oK.dirname(I);D21($,Y,function(J){if(J)return q(J);if(Y===U)return q();CH0($,Y,q)})}function D21($,I,q){var U={};Object.keys($.props).forEach(function(K){if(U[K]=$.props[K],K==="mode"&&$.type!=="Directory")U[K]=U[K]|parseInt("0111",8)});var Y=3,J=null;_$.stat(I,function(K,w){if(K)return q(J=K);BH0($,U,w,I,Q),vH0($,U,w,I,Q),RH0($,U,w,I,Q)});function Q(K){if(J)return;if(K)return q(J=K);if(--Y===0)return q()}}h$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};h$.prototype.add=function(){this.error("Can't add to non-Directory type")};h$.prototype.write=function(){return!0};function O21($){return Object.prototype.toString.call($)}function PH0($){return typeof $==="object"&&O21($)==="[object Date]"}});var yy=L((L21)=>{L21.Abstract=RD();L21.Reader=r3();L21.Writer=VY();L21.File={Reader:Gy(),Writer:jy()};L21.Dir={Reader:zy(),Writer:Ty()};L21.Link={Reader:Ky(),Writer:Ey()};L21.Proxy={Reader:Vy(),Writer:vy()};L21.Reader.Dir=L21.DirReader=L21.Dir.Reader;L21.Reader.File=L21.FileReader=L21.File.Reader;L21.Reader.Link=L21.LinkReader=L21.Link.Reader;L21.Reader.Proxy=L21.ProxyReader=L21.Proxy.Reader;L21.Writer.Dir=L21.DirWriter=L21.Dir.Writer;L21.Writer.File=L21.FileWriter=L21.File.Writer;L21.Writer.Link=L21.LinkWriter=L21.Link.Writer;L21.Writer.Proxy=L21.ProxyWriter=L21.Proxy.Writer;L21.collect=iD()});var SH0=L((oC1,hH0)=>{hH0.exports=E21;var M21=MD(),A21=yy().Writer,uy=o("path"),g21=o("stream"),P21=Yy(),T21=J7();function E21($){$.path=uy.resolve(uy.normalize($.path));var I=new M21($),q=new g21.Writable({objectMode:!0});q._write=function(Y,J,Q){if(Y.type=="Directory")return Q();var K=uy.join($.path,Y.path);if(K.indexOf($.path)!=0)return Q();let w=$.getWriter?$.getWriter({path:K}):A21({path:K});Y.pipe(w).on("error",Q).on("close",Q)};var U=P21(I,q);return I.once("crx-header",function(Y){U.crxHeader=Y}),I.pipe(q).on("finish",function(){U.emit("close")}),U.promise=function(){return new T21(function(Y,J){U.on("close",Y),U.on("error",J)})},U}});var yH0=L((rC1,cD)=>{var y4=function($){var I=1e7,q=7,U=9007199254740992,Y=V(U),J="0123456789abcdefghijklmnopqrstuvwxyz",Q=typeof BigInt==="function";function K(F,M,v,y){if(typeof F>"u")return K[0];if(typeof M<"u")return+M===10&&!v?g0(F):y$(F,M,v,y);return g0(F)}function w(F,M){this.value=F,this.sign=M,this.isSmall=!1}w.prototype=Object.create(K.prototype);function z(F){this.value=F,this.sign=F<0,this.isSmall=!0}z.prototype=Object.create(K.prototype);function G(F){th Line truncated
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/var u1=o("fs"),dD=o("os"),y4=o("path"),CH0=o("crypto"),n8={fs:u1.constants,os:dD.constants},yH0=/XXXXXX/,uH0=(n8.O_CREAT||n8.fs.O_CREAT)|(n8.O_EXCL||n8.fs.O_EXCL)|(n8.O_RDWR||n8.fs.O_RDWR),E21=dD.platform()==="win32",B21=n8.EBADF||n8.os.errno.EBADF,v21=n8.ENOENT||n8.os.errno.ENOENT,VY=[],xH0=u1.rmdirSync.bind(u1),kH0=!1;function R21($,I){return u1.rm($,{recursive:!0},I)}function fH0($){return u1.rmSync($,{recursive:!0})}function vy($,I){let q=WY($,I),U=q[0],Y=q[1];n21(U,function(J,Q){if(J)return Y(J);let K=Q.tries;(function z(){try{let w=bH0(Q);u1.stat(w,function(G){if(!G){if(K-- >0)return z();return Y(Error("Could not get a unique tmp filename, max tries reached "+w))}Y(null,w)})}catch(w){Y(w)}})()})}function Ry($){let I=WY($),q=I[0],U=b21(q),Y=U.tries;do{let J=bH0(U);try{u1.statSync(J)}catch(Q){return J}}while(Y-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function C21($,I){let q=WY($,I),U=q[0],Y=q[1];vy(U,function(Q,K){if(Q)return Y(Q);u1.open(K,uH0,U.mode||384,function(w,G){if(w)return Y(w);if(U.discardDescriptor)return u1.close(G,function(W){return Y(W,K,void 0,Ey(K,-1,U,!1))});else{let H=U.discardDescriptor||U.detachDescriptor;Y(null,K,G,Ey(K,H?-1:G,U,!1))}})})}function _21($){let I=WY($),q=I[0],U=q.discardDescriptor||q.detachDescriptor,Y=Ry(q),J=u1.openSync(Y,uH0,q.mode||384);if(q.discardDescriptor)u1.closeSync(J),J=void 0;return{name:Y,fd:J,removeCallback:Ey(Y,U?-1:J,q,!0)}}function h21($,I){let q=WY($,I),U=q[0],Y=q[1];vy(U,function(Q,K){if(Q)return Y(Q);u1.mkdir(K,U.mode||448,function(w){if(w)return Y(w);Y(null,K,nH0(K,U,!1))})})}function S21($){let I=WY($),q=I[0],U=Ry(q);return u1.mkdirSync(U,q.mode||448),{name:U,removeCallback:nH0(U,q,!0)}}function y21($,I){let q=function(U){if(U&&!By(U))return I(U);I()};if(0<=$[0])u1.close($[0],function(){u1.unlink($[1],q)});else u1.unlink($[1],q)}function u21($){let I=null;try{if(0<=$[0])u1.closeSync($[0])}catch(q){if(!i21(q)&&!By(q))throw q}finally{try{u1.unlinkSync($[1])}catch(q){if(!By(q))I=q}}if(I!==null)throw I}function Ey($,I,q,U){let Y=cD(u21,[I,$],U),J=cD(y21,[I,$],U,Y);if(!q.keep)VY.unshift(Y);return U?Y:J}function nH0($,I,q){let U=I.unsafeCleanup?R21:u1.rmdir.bind(u1),Y=I.unsafeCleanup?fH0:xH0,J=cD(Y,$,q),Q=cD(U,$,q,J);if(!I.keep)VY.unshift(J);return q?J:Q}function cD($,I,q,U){let Y=!1;return function J(Q){if(!Y){let K=U||J,z=VY.indexOf(K);if(z>=0)VY.splice(z,1);if(Y=!0,q||$===xH0||$===fH0)return $(I);else return $(I,Q||function(){})}}}function x21(){if(!kH0)return;while(VY.length)try{VY[0]()}catch($){}}function _H0($){let I=[],q=null;try{q=CH0.randomBytes($)}catch(U){q=CH0.pseudoRandomBytes($)}for(let U=0;U<$;U++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[q[U]%62]);return I.join("")}function o6($){return typeof $>"u"}function WY($,I){if(typeof $==="function")return[{},$];if(o6($))return[{},I];let q={};for(let U of Object.getOwnPropertyNames($))q[U]=$[U];return[q,I]}function k21($,I,q){let U=y4.isAbsolute($)?$:y4.join(I,$);u1.stat(U,function(Y){if(Y)u1.realpath(y4.dirname(U),function(J,Q){if(J)return q(J);q(null,y4.join(Q,y4.basename(U)))});else u1.realpath(U,q)})}function f21($,I){let q=y4.isAbsolute($)?$:y4.join(I,$);try{return u1.statSync(q),u1.realpathSync(q)}catch(U){let Y=u1.realpathSync(y4.dirname(q));return y4.join(Y,y4.basename(q))}}function bH0($){let I=$.tmpdir;if(!o6($.name))return y4.join(I,$.dir,$.name);if(!o6($.template))return y4.join(I,$.dir,$.template).replace(yH0,_H0(6));let q=[$.prefix?$.prefix:"tmp","-",process.pid,"-",_H0(12),$.postfix?"-"+$.postfix:""].join("");return y4.join(I,$.dir,q)}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 iH0($){if(!o6($.name)){let I=$.name;if(y4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let q=y4.basename(I);if(q===".."||q==="."||q!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!o6($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(yH0))throw Error(`Invalid template, found "${$.template}".`)}if(!o6($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=o6($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=o6($.prefix)?"":jy("prefix",$.prefix),$.postfix=o6($.postfix)?"":jy("postfix",$.postfix),$.template=o6($.template)?void 0:jy("template",$.template)}function hH0($,I,q,U){if(o6(I))return U(null);k21(I,q,function(Y,J){if(Y)return U(Y);let Q=y4.relative(q,J);if(Q.startsWith("..")||y4.isAbsolute(Q))return U(Error(`${$} option must be relative to "${q}", found "${Q}".`));U(null,Q)})}function SH0($,I,q){if(o6(I))return;let U=f21(I,q),Y=y4.relative(q,U);if(Y.startsWith("..")||y4.isAbsolute(Y))throw ELine truncated
`)}var KI=($)=>(I,q,U,Y)=>{let J=U?{...U,async:!1}:{async:!1},Q=I._zod.run({value:q,issues:[]},J);if(Q instanceof Promise)throw new U8;if(Q.issues.length){let K=new(Y?.Err??$)(Q.issues.map((z)=>M6(z,J,V4())));throw nz(K,Y?.callee),K}return Q.value},kY=KI(S6),zI=($)=>async(I,q,U,Y)=>{let J=U?{...U,async:!0}:{async:!0},Q=I._zod.run({value:q,issues:[]},J);if(Q instanceof Promise)Q=await Q;if(Q.issues.length){let K=new(Y?.Err??$)(Q.issues.map((z)=>M6(z,J,V4())));throw nz(K,Y?.callee),K}return Q.value},fY=zI(S6),wI=($)=>(I,q,U)=>{let Y=U?{...U,async:!1}:{async:!1},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)throw new U8;return J.issues.length?{success:!1,error:new($??yY)(J.issues.map((Q)=>M6(Q,Y,V4())))}:{success:!0,data:J.value}},GI=wI(S6),HI=($)=>async(I,q,U)=>{let Y=U?{...U,async:!0}:{async:!0},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((Q)=>M6(Q,Y,V4())))}:{success:!0,data:J.value}},nY=HI(S6),bz=($)=>(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return KI($)(I,q,Y)},Qx=bz(S6),iz=($)=>(I,q,U)=>{return KI($)(I,q,U)},Kx=iz(S6),pz=($)=>async(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return zI($)(I,q,Y)},zx=pz(S6),cz=($)=>async(I,q,U)=>{return zI($)(I,q,U)},wx=cz(S6),dz=($)=>(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return wI($)(I,q,Y)},Gx=dz(S6),lz=($)=>(I,q,U)=>{return wI($)(I,q,U)},Hx=lz(S6),mz=($)=>async(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return HI($)(I,q,Y)},Vx=mz(S6),oz=($)=>async(I,q,U)=>{return HI($)(I,q,U)},Wx=oz(S6);var s6={};p8(s6,{xid:()=>iO,uuid7:()=>RD0,uuid6:()=>vD0,uuid4:()=>BD0,uuid:()=>M7,uppercase:()=>WL,unicodeEmail:()=>Zx,undefined:()=>HL,ulid:()=>bO,time:()=>YL,string:()=>QL,sha512_hex:()=>aD0,sha512_base64url:()=>eD0,sha512_base64:()=>sD0,sha384_hex:()=>oD0,sha384_base64url:()=>tD0,sha384_base64:()=>rD0,sha256_hex:()=>dD0,sha256_base64url:()=>mD0,sha256_base64:()=>lD0,sha1_hex:()=>iD0,sha1_base64url:()=>cD0,sha1_base64:()=>pD0,rfc5322Email:()=>_D0,number:()=>bY,null:()=>GL,nanoid:()=>cO,md5_hex:()=>fD0,md5_base64url:()=>bD0,md5_base64:()=>nD0,mac:()=>aO,lowercase:()=>VL,ksuid:()=>pO,ipv6:()=>tO,ipv4:()=>rO,integer:()=>zL,idnEmail:()=>hD0,httpProtocol:()=>IL,html5Email:()=>CD0,hostname:()=>uD0,hex:()=>kD0,guid:()=>lO,extendedDuration:()=>ED0,emoji:()=>oO,email:()=>mO,e164:()=>qL,duration:()=>dO,domain:()=>xD0,datetime:()=>JL,date:()=>UL,cuid2:()=>nO,cuid:()=>fO,cidrv6:()=>eO,cidrv4:()=>sO,browserEmail:()=>SD0,boolean:()=>wL,bigint:()=>KL,base64url:()=>rz,base64:()=>$L});var fO=/^[cC][0-9a-z]{6,}$/,nO=/^[0-9a-z]+$/,bO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,iO=/^[0-9a-vA-V]{20}$/,pO=/^[A-Za-z0-9]{27}$/,cO=/^[a-zA-Z0-9_-]{21}$/,dO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ED0=/^[-+]?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)?)??$/,lO=/^([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})$/,M7=($)=>{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})$`)},BD0=M7(4),vD0=M7(6),RD0=M7(7),mO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,CD0=/^[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])?)*$/,_D0=/^(([^<>()\[\]\\.,;:\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,}))$/,Zx=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,hD0=Zx,SD0=/^[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])?)*$/,yD0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function oO(){return new RegExp(yD0,"u")}var rO=/^(?:(?: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])$/,tO=/^(([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}|:))$/,aO=($)=>{let I=W$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},sO=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0Line truncated
*/var u1=o("fs"),tD=o("os"),u4=o("path"),oH0=o("crypto"),b8={fs:u1.constants,os:tD.constants},sH0=/XXXXXX/,eH0=(b8.O_CREAT||b8.fs.O_CREAT)|(b8.O_EXCL||b8.fs.O_EXCL)|(b8.O_RDWR||b8.fs.O_RDWR),t21=tD.platform()==="win32",a21=b8.EBADF||b8.os.errno.EBADF,s21=b8.ENOENT||b8.os.errno.ENOENT,ZY=[],$V0=u1.rmdirSync.bind(u1),IV0=!1;function e21($,I){return u1.rm($,{recursive:!0},I)}function qV0($){return u1.rmSync($,{recursive:!0})}function iy($,I){let q=XY($,I),U=q[0],Y=q[1];zK1(U,function(J,Q){if(J)return Y(J);let K=Q.tries;(function w(){try{let z=YV0(Q);u1.stat(z,function(G){if(!G){if(K-- >0)return w();return Y(Error("Could not get a unique tmp filename, max tries reached "+z))}Y(null,z)})}catch(z){Y(z)}})()})}function by($){let I=XY($),q=I[0],U=GK1(q),Y=U.tries;do{let J=YV0(U);try{u1.statSync(J)}catch(Q){return J}}while(Y-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function $K1($,I){let q=XY($,I),U=q[0],Y=q[1];iy(U,function(Q,K){if(Q)return Y(Q);u1.open(K,eH0,U.mode||384,function(z,G){if(z)return Y(z);if(U.discardDescriptor)return u1.close(G,function(V){return Y(V,K,void 0,fy(K,-1,U,!1))});else{let H=U.discardDescriptor||U.detachDescriptor;Y(null,K,G,fy(K,H?-1:G,U,!1))}})})}function IK1($){let I=XY($),q=I[0],U=q.discardDescriptor||q.detachDescriptor,Y=by(q),J=u1.openSync(Y,eH0,q.mode||384);if(q.discardDescriptor)u1.closeSync(J),J=void 0;return{name:Y,fd:J,removeCallback:fy(Y,U?-1:J,q,!0)}}function qK1($,I){let q=XY($,I),U=q[0],Y=q[1];iy(U,function(Q,K){if(Q)return Y(Q);u1.mkdir(K,U.mode||448,function(z){if(z)return Y(z);Y(null,K,UV0(K,U,!1))})})}function UK1($){let I=XY($),q=I[0],U=by(q);return u1.mkdirSync(U,q.mode||448),{name:U,removeCallback:UV0(U,q,!0)}}function YK1($,I){let q=function(U){if(U&&!ny(U))return I(U);I()};if(0<=$[0])u1.close($[0],function(){u1.unlink($[1],q)});else u1.unlink($[1],q)}function JK1($){let I=null;try{if(0<=$[0])u1.closeSync($[0])}catch(q){if(!HK1(q)&&!ny(q))throw q}finally{try{u1.unlinkSync($[1])}catch(q){if(!ny(q))I=q}}if(I!==null)throw I}function fy($,I,q,U){let Y=rD(JK1,[I,$],U),J=rD(YK1,[I,$],U,Y);if(!q.keep)ZY.unshift(Y);return U?Y:J}function UV0($,I,q){let U=I.unsafeCleanup?e21:u1.rmdir.bind(u1),Y=I.unsafeCleanup?qV0:$V0,J=rD(Y,$,q),Q=rD(U,$,q,J);if(!I.keep)ZY.unshift(J);return q?J:Q}function rD($,I,q,U){let Y=!1;return function J(Q){if(!Y){let K=U||J,w=ZY.indexOf(K);if(w>=0)ZY.splice(w,1);if(Y=!0,q||$===$V0||$===qV0)return $(I);else return $(I,Q||function(){})}}}function QK1(){if(!IV0)return;while(ZY.length)try{ZY[0]()}catch($){}}function rH0($){let I=[],q=null;try{q=oH0.randomBytes($)}catch(U){q=oH0.pseudoRandomBytes($)}for(let U=0;U<$;U++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[q[U]%62]);return I.join("")}function r6($){return typeof $>"u"}function XY($,I){if(typeof $==="function")return[{},$];if(r6($))return[{},I];let q={};for(let U of Object.getOwnPropertyNames($))q[U]=$[U];return[q,I]}function KK1($,I,q){let U=u4.isAbsolute($)?$:u4.join(I,$);u1.stat(U,function(Y){if(Y)u1.realpath(u4.dirname(U),function(J,Q){if(J)return q(J);q(null,u4.join(Q,u4.basename(U)))});else u1.realpath(U,q)})}function wK1($,I){let q=u4.isAbsolute($)?$:u4.join(I,$);try{return u1.statSync(q),u1.realpathSync(q)}catch(U){let Y=u1.realpathSync(u4.dirname(q));return u4.join(Y,u4.basename(q))}}function YV0($){let I=$.tmpdir;if(!r6($.name))return u4.join(I,$.dir,$.name);if(!r6($.template))return u4.join(I,$.dir,$.template).replace(sH0,rH0(6));let q=[$.prefix?$.prefix:"tmp","-",process.pid,"-",rH0(12),$.postfix?"-"+$.postfix:""].join("");return u4.join(I,$.dir,q)}function ky($,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 JV0($){if(!r6($.name)){let I=$.name;if(u4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let q=u4.basename(I);if(q===".."||q==="."||q!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!r6($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(sH0))throw Error(`Invalid template, found "${$.template}".`)}if(!r6($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=r6($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=r6($.prefix)?"":ky("prefix",$.prefix),$.postfix=r6($.postfix)?"":ky("postfix",$.postfix),$.template=r6($.template)?void 0:ky("template",$.template)}function tH0($,I,q,U){if(r6(I))return U(null);KK1(I,q,function(Y,J){if(Y)return U(Y);let Q=u4.relative(q,J);if(Q.startsWith("..")||u4.isAbsolute(Q))return U(Error(`${$} option must be relative to "${q}", found "${Q}".`));U(null,Q)})}function aH0($,I,q){if(r6(I))return;let U=wK1(I,q),Y=u4.relative(q,U);if(Y.startsWith("..")||u4.isAbsolute(Y))throw ELine truncated
`)}var zI=($)=>(I,q,U,Y)=>{let J=U?{...U,async:!1}:{async:!1},Q=I._zod.run({value:q,issues:[]},J);if(Q instanceof Promise)throw new Y8;if(Q.issues.length){let K=new(Y?.Err??$)(Q.issues.map((w)=>A6(w,J,W4())));throw cw(K,Y?.callee),K}return Q.value},nY=zI(y6),GI=($)=>async(I,q,U,Y)=>{let J=U?{...U,async:!0}:{async:!0},Q=I._zod.run({value:q,issues:[]},J);if(Q instanceof Promise)Q=await Q;if(Q.issues.length){let K=new(Y?.Err??$)(Q.issues.map((w)=>A6(w,J,W4())));throw cw(K,Y?.callee),K}return Q.value},iY=GI(y6),HI=($)=>(I,q,U)=>{let Y=U?{...U,async:!1}:{async:!1},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)throw new Y8;return J.issues.length?{success:!1,error:new($??xY)(J.issues.map((Q)=>A6(Q,Y,W4())))}:{success:!0,data:J.value}},VI=HI(y6),WI=($)=>async(I,q,U)=>{let Y=U?{...U,async:!0}:{async:!0},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((Q)=>A6(Q,Y,W4())))}:{success:!0,data:J.value}},bY=WI(y6),dw=($)=>(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return zI($)(I,q,Y)},Ax=dw(y6),lw=($)=>(I,q,U)=>{return zI($)(I,q,U)},gx=lw(y6),mw=($)=>async(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return GI($)(I,q,Y)},Px=mw(y6),ow=($)=>async(I,q,U)=>{return GI($)(I,q,U)},Tx=ow(y6),rw=($)=>(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return HI($)(I,q,Y)},Ex=rw(y6),tw=($)=>(I,q,U)=>{return HI($)(I,q,U)},jx=tw(y6),aw=($)=>async(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return WI($)(I,q,Y)},Bx=aw(y6),sw=($)=>async(I,q,U)=>{return WI($)(I,q,U)},vx=sw(y6);var e6={};m8(e6,{xid:()=>aO,uuid7:()=>mD0,uuid6:()=>lD0,uuid4:()=>dD0,uuid:()=>g7,uppercase:()=>AL,unicodeEmail:()=>Rx,undefined:()=>FL,ulid:()=>tO,time:()=>WL,string:()=>XL,sha512_hex:()=>ZO0,sha512_base64url:()=>DO0,sha512_base64:()=>XO0,sha384_hex:()=>HO0,sha384_base64url:()=>WO0,sha384_base64:()=>VO0,sha256_hex:()=>wO0,sha256_base64url:()=>GO0,sha256_base64:()=>zO0,sha1_hex:()=>JO0,sha1_base64url:()=>KO0,sha1_base64:()=>QO0,rfc5322Email:()=>rD0,number:()=>pY,null:()=>NL,nanoid:()=>eO,md5_hex:()=>qO0,md5_base64url:()=>YO0,md5_base64:()=>UO0,mac:()=>QL,lowercase:()=>ML,ksuid:()=>sO,ipv6:()=>JL,ipv4:()=>YL,integer:()=>OL,idnEmail:()=>tD0,httpProtocol:()=>GL,html5Email:()=>oD0,hostname:()=>eD0,hex:()=>IO0,guid:()=>IL,extendedDuration:()=>cD0,emoji:()=>UL,email:()=>qL,e164:()=>HL,duration:()=>$L,domain:()=>$O0,datetime:()=>ZL,date:()=>VL,cuid2:()=>rO,cuid:()=>oO,cidrv6:()=>wL,cidrv4:()=>KL,browserEmail:()=>aD0,boolean:()=>LL,bigint:()=>DL,base64url:()=>ew,base64:()=>zL});var oO=/^[cC][0-9a-z]{6,}$/,rO=/^[0-9a-z]+$/,tO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aO=/^[0-9a-vA-V]{20}$/,sO=/^[A-Za-z0-9]{27}$/,eO=/^[a-zA-Z0-9_-]{21}$/,$L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cD0=/^[-+]?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)?)??$/,IL=/^([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})$/,g7=($)=>{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})$`)},dD0=g7(4),lD0=g7(6),mD0=g7(7),qL=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,oD0=/^[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])?)*$/,rD0=/^(([^<>()\[\]\\.,;:\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,}))$/,Rx=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,tD0=Rx,aD0=/^[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])?)*$/,sD0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function UL(){return new RegExp(sD0,"u")}var YL=/^(?:(?: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])$/,JL=/^(([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}|:))$/,QL=($)=>{let I=Z$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},KL=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0Line truncated
`).filter((J)=>J),U=Math.min(...q.map((J)=>J.length-J.trimStart().length)),Y=q.map((J)=>J.slice(U)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of Y)this.content.push(J)}compile(){let $=Function,I=this?.args,U=[...(this?.content??[""]).map((Y)=>` ${Y}`)];return new $(...I,U.join(`
`))}}var _L={major:4,minor:4,patch:3};var k0=m("$ZodType",($,I)=>{var q;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=_L;let U=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))U.unshift($);for(let Y of U)for(let J of Y._zod.onattach)J($);if(U.length===0)(q=$._zod).deferred??(q.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let Y=(Q,K,z)=>{let w=d5(Q),G;for(let H of K){if(H._zod.def.when){if(uO(Q))continue;if(!H._zod.def.when(Q))continue}else if(w)continue;let W=Q.issues.length,V=H._zod.check(Q);if(V instanceof Promise&&z?.async===!1)throw new U8;if(G||V instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await V,Q.issues.length===W)return;if(!w)w=d5(Q,W)});else{if(Q.issues.length===W)continue;if(!w)w=d5(Q,W)}}if(G)return G.then(()=>{return Q});return Q},J=(Q,K,z)=>{if(d5(Q))return Q.aborted=!0,Q;let w=Y(K,U,z);if(w instanceof Promise){if(z.async===!1)throw new U8;return w.then((G)=>$._zod.parse(G,z))}return $._zod.parse(w,z)};$._zod.run=(Q,K)=>{if(K.skipChecks)return $._zod.parse(Q,K);if(K.direction==="backward"){let w=$._zod.parse({value:Q.value,issues:[]},{...K,skipChecks:!0});if(w instanceof Promise)return w.then((G)=>{return J(G,Q,K)});return J(w,Q,K)}let z=$._zod.parse(Q,K);if(z instanceof Promise){if(K.async===!1)throw new U8;return z.then((w)=>Y(w,U,K))}return Y(z,U,K)}}r0($,"~standard",()=>({validate:(Y)=>{try{let J=GI($,Y);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return nY($,Y).then((Q)=>Q.success?{value:Q.data}:{issues:Q.error?.issues})}},vendor:"zod",version:1}))}),A7=m("$ZodString",($,I)=>{k0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??QL($._zod.bag),$._zod.parse=(q,U)=>{if(I.coerce)try{q.value=String(q.value)}catch(Y){}if(typeof q.value==="string")return q;return q.issues.push({expected:"string",code:"invalid_type",input:q.value,inst:$}),q}}),_1=m("$ZodStringFormat",($,I)=>{VI.init($,I),A7.init($,I)}),SL=m("$ZodGUID",($,I)=>{I.pattern??(I.pattern=lO),_1.init($,I)}),yL=m("$ZodUUID",($,I)=>{if(I.version){let U={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(U===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=M7(U))}else I.pattern??(I.pattern=M7());_1.init($,I)}),uL=m("$ZodEmail",($,I)=>{I.pattern??(I.pattern=mO),_1.init($,I)}),xL=m("$ZodURL",($,I)=>{_1.init($,I),$._zod.check=(q)=>{try{let U=q.value.trim();if(!I.normalize&&I.protocol?.source===IL.source){if(!/^https?:\/\//i.test(U)){q.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:q.value,inst:$,continue:!I.abort});return}}let Y=new URL(U);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(Y.hostname))q.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:q.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(Y.protocol.endsWith(":")?Y.protocol.slice(0,-1):Y.protocol))q.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:q.value,inst:$,continue:!I.abort})}if(I.normalize)q.value=Y.href;else q.value=U;return}catch(U){q.issues.push({code:"invalid_format",format:"url",input:q.value,inst:$,continue:!I.abort})}}}),kL=m("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=oO()),_1.init($,I)}),fL=m("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=cO),_1.init($,I)}),nL=m("$ZodCUID",($,I)=>{I.pattern??(I.pattern=fO),_1.init($,I)}),bL=m("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=nO),_1.init($,I)}),iL=m("$ZodULID",($,I)=>{I.pattern??(I.pattern=bO),_1.init($,I)}),pL=m("$ZodXID",($,I)=>{I.pattern??(I.pattern=iO),_1.init($,I)}),cL=m("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=pO),_1.init($,I)}),dL=m("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=JL(I)),_1.init($,I)}),lL=m("$ZodISODate",($,I)=>{I.pattern??(I.pattern=UL),_1.init($,I)}),mL=m("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=YL(I)),_1.init($,I)}),oL=m("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=dO),_1.init($,I)}),rL=m("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=rO),_1.init($,I),$._zod.bag.format="ipv4"}),tL=m("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=tO),_1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(q)=>{try{new URL(`http://[${q.value}]`)}catch{q.issues.push({code:"invalid_format",format:"ipv6",input:q.value,inst:$,continue:!I.abort})}}}),aL=m("$ZodMAC",($,I)=>{I.pattern??(I.pattern=aO(I.delimiter)),_1.init($,I),$._zod.bag.format="mac"}),sL=m("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=sO),_1.init($,I)}),eL=m("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=eO),_1.init($,I),$._zod.check=(q)=>{let U=q.value.split("/");try{if(U.length!==2)throw Error();let[Y,J]=U;if(!J)throw Error();let Q=Number(J);if(`${Q}`!==J)throw Error();if(Q<0||Q>128)throw Error();new URL(`http://[${Y}]`)}catch{q.issues.push({code:"invalid_format",format:"cidrv6",input:q.value,inst:$,continue:!I.abort})}}});function $N($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}} Line truncated
`))}}var iL={major:4,minor:4,patch:3};var k0=m("$ZodType",($,I)=>{var q;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=iL;let U=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))U.unshift($);for(let Y of U)for(let J of Y._zod.onattach)J($);if(U.length===0)(q=$._zod).deferred??(q.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let Y=(Q,K,w)=>{let z=t5(Q),G;for(let H of K){if(H._zod.def.when){if(dO(Q))continue;if(!H._zod.def.when(Q))continue}else if(z)continue;let V=Q.issues.length,W=H._zod.check(Q);if(W instanceof Promise&&w?.async===!1)throw new Y8;if(G||W instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await W,Q.issues.length===V)return;if(!z)z=t5(Q,V)});else{if(Q.issues.length===V)continue;if(!z)z=t5(Q,V)}}if(G)return G.then(()=>{return Q});return Q},J=(Q,K,w)=>{if(t5(Q))return Q.aborted=!0,Q;let z=Y(K,U,w);if(z instanceof Promise){if(w.async===!1)throw new Y8;return z.then((G)=>$._zod.parse(G,w))}return $._zod.parse(z,w)};$._zod.run=(Q,K)=>{if(K.skipChecks)return $._zod.parse(Q,K);if(K.direction==="backward"){let z=$._zod.parse({value:Q.value,issues:[]},{...K,skipChecks:!0});if(z instanceof Promise)return z.then((G)=>{return J(G,Q,K)});return J(z,Q,K)}let w=$._zod.parse(Q,K);if(w instanceof Promise){if(K.async===!1)throw new Y8;return w.then((z)=>Y(z,U,K))}return Y(w,U,K)}}o0($,"~standard",()=>({validate:(Y)=>{try{let J=VI($,Y);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return bY($,Y).then((Q)=>Q.success?{value:Q.data}:{issues:Q.error?.issues})}},vendor:"zod",version:1}))}),P7=m("$ZodString",($,I)=>{k0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??XL($._zod.bag),$._zod.parse=(q,U)=>{if(I.coerce)try{q.value=String(q.value)}catch(Y){}if(typeof q.value==="string")return q;return q.issues.push({expected:"string",code:"invalid_type",input:q.value,inst:$}),q}}),_1=m("$ZodStringFormat",($,I)=>{ZI.init($,I),P7.init($,I)}),pL=m("$ZodGUID",($,I)=>{I.pattern??(I.pattern=IL),_1.init($,I)}),cL=m("$ZodUUID",($,I)=>{if(I.version){let U={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(U===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=g7(U))}else I.pattern??(I.pattern=g7());_1.init($,I)}),dL=m("$ZodEmail",($,I)=>{I.pattern??(I.pattern=qL),_1.init($,I)}),lL=m("$ZodURL",($,I)=>{_1.init($,I),$._zod.check=(q)=>{try{let U=q.value.trim();if(!I.normalize&&I.protocol?.source===GL.source){if(!/^https?:\/\//i.test(U)){q.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:q.value,inst:$,continue:!I.abort});return}}let Y=new URL(U);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(Y.hostname))q.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:q.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(Y.protocol.endsWith(":")?Y.protocol.slice(0,-1):Y.protocol))q.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:q.value,inst:$,continue:!I.abort})}if(I.normalize)q.value=Y.href;else q.value=U;return}catch(U){q.issues.push({code:"invalid_format",format:"url",input:q.value,inst:$,continue:!I.abort})}}}),mL=m("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=UL()),_1.init($,I)}),oL=m("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=eO),_1.init($,I)}),rL=m("$ZodCUID",($,I)=>{I.pattern??(I.pattern=oO),_1.init($,I)}),tL=m("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=rO),_1.init($,I)}),aL=m("$ZodULID",($,I)=>{I.pattern??(I.pattern=tO),_1.init($,I)}),sL=m("$ZodXID",($,I)=>{I.pattern??(I.pattern=aO),_1.init($,I)}),eL=m("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=sO),_1.init($,I)}),$N=m("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=ZL(I)),_1.init($,I)}),IN=m("$ZodISODate",($,I)=>{I.pattern??(I.pattern=VL),_1.init($,I)}),qN=m("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=WL(I)),_1.init($,I)}),UN=m("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=$L),_1.init($,I)}),YN=m("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=YL),_1.init($,I),$._zod.bag.format="ipv4"}),JN=m("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=JL),_1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(q)=>{try{new URL(`http://[${q.value}]`)}catch{q.issues.push({code:"invalid_format",format:"ipv6",input:q.value,inst:$,continue:!I.abort})}}}),QN=m("$ZodMAC",($,I)=>{I.pattern??(I.pattern=QL(I.delimiter)),_1.init($,I),$._zod.bag.format="mac"}),KN=m("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=KL),_1.init($,I)}),wN=m("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=wL),_1.init($,I),$._zod.check=(q)=>{let U=q.value.split("/");try{if(U.length!==2)throw Error();let[Y,J]=U;if(!J)throw Error();let Q=Number(J);if(`${Q}`!==J)throw Error();if(Q<0||Q>128)throw Error();new URL(`http://[${Y}]`)}catch{q.issues.push({code:"invalid_format",format:"cidrv6",input:q.value,inst:$,continue:!I.abort})}}});function zN($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}} Line truncated
if (${g}.issues.length) {
if (${B} in input) {
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
@@ -262,7 +262,7 @@ Unsupported type: `+$.type,"ENOTSUP");$._finish()})};C$.prototype._stat=function
newResult[${B}] = ${g}.value;
}
`);else if(!h)V.write(`
`);else if(!h)W.write(`
const ${g}_present = ${B} in input;
if (${g}.issues.length) {
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
@@ -287,7 +287,7 @@ Unsupported type: `+$.type,"ENOTSUP");$._finish()})};C$.prototype._stat=function
}
}
`);else V.write(`
`);else W.write(`
if (${g}.issues.length) {
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
...iss,
@@ -303,16 +303,17 @@ Unsupported type: `+$.type,"ENOTSUP");$._finish()})};C$.prototype._stat=function
newResult[${B}] = ${g}.value;
}
`)}V.write("payload.value = newResult;"),V.write("return payload;");let T=V.compile();return(P,g)=>T(W,P,g)},J,Q=F7,K=!L7.jitless,w=K&&RO.value,G=I.catchall,H;$._zod.parse=(W,V)=>{H??(H=U.value);let X=W.value;if(!Q(X))return W.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),W;if(K&&w&&V?.async===!1&&V.jitless!==!0){if(!J)J=Y(I.shape);if(W=J(W,V),!G)return W;return xx([],X,W,V,H,$)}return q(W,V)}});function Mx($,I,q,U){for(let J of $)if(J.issues.length===0)return I.value=J.value,I;let Y=$.filter((J)=>!d5(J));if(Y.length===1)return I.value=Y[0].value,Y[0];return I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:$.map((J)=>J.issues.map((Q)=>M6(Q,U,V4())))}),I}var dY=m("$ZodUnion",($,I)=>{k0.init($,I),r0($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),r0($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),r0($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),r0($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((Y)=>Y._zod.pattern);return new RegExp(`^(${U.map((Y)=>CY(Y.source)).join("|")})$`)}return});let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(U,Y)=>{if(q)return q(U,Y);let J=!1,Q=[];for(let K of I.options){let z=K._zod.run({value:U.value,issues:[]},Y);if(z instanceof Promise)Q.push(z),J=!0;else{if(z.issues.length===0)return z;Q.push(z)}}if(!J)return Mx(Q,U,$,Y);return Promise.all(Q).then((K)=>{return Mx(K,U,$,Y)})}});function Ax($,I,q,U){let Y=$.filter((J)=>J.issues.length===0);if(Y.length===1)return I.value=Y[0].value,I;if(Y.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:$.map((J)=>J.issues.map((Q)=>M6(Q,U,V4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:[],inclusive:!1});return I}var LN=m("$ZodXor",($,I)=>{dY.init($,I),I.inclusive=!1;let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(U,Y)=>{if(q)return q(U,Y);let J=!1,Q=[];for(let K of I.options){let z=K._zod.run({value:U.value,issues:[]},Y);if(z instanceof Promise)Q.push(z),J=!0;else Q.push(z)}if(!J)return Ax(Q,U,$,Y);return Promise.all(Q).then((K)=>{return Ax(K,U,$,Y)})}}),NN=m("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,dY.init($,I);let q=$._zod.parse;r0($._zod,"propValues",()=>{let Y={};for(let J of I.options){let Q=J._zod.propValues;if(!Q||Object.keys(Q).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(J)}"`);for(let[K,z]of Object.entries(Q)){if(!Y[K])Y[K]=new Set;for(let w of z)Y[K].add(w)}}return Y});let U=JI(()=>{let Y=I.options,J=new Map;for(let Q of Y){let K=Q._zod.propValues?.[I.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(Q)}"`);for(let z of K){if(J.has(z))throw Error(`Duplicate discriminator value "${String(z)}"`);J.set(z,Q)}}return J});$._zod.parse=(Y,J)=>{let Q=Y.value;if(!F7(Q))return Y.issues.push({code:"invalid_type",expected:"object",input:Q,inst:$}),Y;let K=U.value.get(Q?.[I.discriminator]);if(K)return K._zod.run(Y,J);if(I.unionFallback||J.direction==="backward")return q(Y,J);return Y.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(U.value.keys()),input:Q,path:[I.discriminator],inst:$}),Y}}),FN=m("$ZodIntersection",($,I)=>{k0.init($,I),$._zod.parse=(q,U)=>{let Y=q.value,J=I.left._zod.run({value:Y,issues:[]},U),Q=I.right._zod.run({value:Y,issues:[]},U);if(J instanceof Promise||Q instanceof Promise)return Promise.all([J,Q]).then(([z,w])=>{return gx(q,z,w)});return gx(q,J,Q)}});function hL($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(c5($)&&c5(I)){let q=Object.keys(I),U=Object.keys($).filter((J)=>q.indexOf(J)!==-1),Y={...$,...I};for(let J of U){let Q=hL($[J],I[J]);if(!Q.valid)return{valid:!1,mergeErrorPath:[J,...Q.mergeErrorPath]};Y[J]=Q.data}return{valid:!0,data:Y}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let q=[];for(let U=0;U<$.length;U++){let Y=$[U],J=I[U],Q=hL(Y,J);if(!Q.valid)return{valid:!1,mergeErrorPath:[U,...Q.mergeErrorPath]};q.push(Q.data)}return{valid:!0,data:q}}return{valid:!1,mergeErrorPath:[]}}function gx($,I,q){let U=new Map,Y;for(let K of I.issues)if(K.code==="unrecognized_keys"){Y??(Y=K);for(let z of K.keys){if(!U.has(z))U.set(z,{});U.get(z).l=!0}}else $.issues.push(K);for(let K of q.issues)if(K.code==="unrecognized_keys")for(let z of K.keys){if(!U.has(z))U.set(z,{});U.get(z).r=!0}else $.issues.push(K);let J=[...U].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(J.length&&Y)$.issues.push({...Y,keys:J});if(d5($))return $;let Q=hL(I.value,q.value);if(!Q.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Q.mergeErrorPath)}`);return $.value=Q.data,$}var Jw=m("$ZodTuple",($,I)=>{k0. Line truncated
`)}W.write("payload.value = newResult;"),W.write("return payload;");let T=W.compile();return(P,g)=>T(V,P,g)},J,Q=A7,K=!F7.jitless,z=K&&fO.value,G=I.catchall,H;$._zod.parse=(V,W)=>{H??(H=U.value);let X=V.value;if(!Q(X))return V.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),V;if(K&&z&&W?.async===!1&&W.jitless!==!0){if(!J)J=Y(I.shape);if(V=J(V,W),!G)return V;return ex([],X,V,W,H,$)}return q(V,W)}});function xx($,I,q,U){for(let J of $)if(J.issues.length===0)return I.value=J.value,I;let Y=$.filter((J)=>!t5(J));if(Y.length===1)return I.value=Y[0].value,Y[0];return I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:$.map((J)=>J.issues.map((Q)=>A6(Q,U,W4())))}),I}var mY=m("$ZodUnion",($,I)=>{k0.init($,I),o0($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),o0($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),o0($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),o0($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((Y)=>Y._zod.pattern);return new RegExp(`^(${U.map((Y)=>hY(Y.source)).join("|")})$`)}return});let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(U,Y)=>{if(q)return q(U,Y);let J=!1,Q=[];for(let K of I.options){let w=K._zod.run({value:U.value,issues:[]},Y);if(w instanceof Promise)Q.push(w),J=!0;else{if(w.issues.length===0)return w;Q.push(w)}}if(!J)return xx(Q,U,$,Y);return Promise.all(Q).then((K)=>{return xx(K,U,$,Y)})}});function kx($,I,q,U){let Y=$.filter((J)=>J.issues.length===0);if(Y.length===1)return I.value=Y[0].value,I;if(Y.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:$.map((J)=>J.issues.map((Q)=>A6(Q,U,W4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:[],inclusive:!1});return I}var jN=m("$ZodXor",($,I)=>{mY.init($,I),I.inclusive=!1;let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(U,Y)=>{if(q)return q(U,Y);let J=!1,Q=[];for(let K of I.options){let w=K._zod.run({value:U.value,issues:[]},Y);if(w instanceof Promise)Q.push(w),J=!0;else Q.push(w)}if(!J)return kx(Q,U,$,Y);return Promise.all(Q).then((K)=>{return kx(K,U,$,Y)})}}),BN=m("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,mY.init($,I);let q=$._zod.parse;o0($._zod,"propValues",()=>{let Y={};for(let J of I.options){let Q=J._zod.propValues;if(!Q||Object.keys(Q).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(J)}"`);for(let[K,w]of Object.entries(Q)){if(!Y[K])Y[K]=new Set;for(let z of w)Y[K].add(z)}}return Y});let U=KI(()=>{let Y=I.options,J=new Map;for(let Q of Y){let K=Q._zod.propValues?.[I.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(Q)}"`);for(let w of K){if(J.has(w))throw Error(`Duplicate discriminator value "${String(w)}"`);J.set(w,Q)}}return J});$._zod.parse=(Y,J)=>{let Q=Y.value;if(!A7(Q))return Y.issues.push({code:"invalid_type",expected:"object",input:Q,inst:$}),Y;let K=U.value.get(Q?.[I.discriminator]);if(K)return K._zod.run(Y,J);if(I.unionFallback||J.direction==="backward")return q(Y,J);return Y.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(U.value.keys()),input:Q,path:[I.discriminator],inst:$}),Y}}),vN=m("$ZodIntersection",($,I)=>{k0.init($,I),$._zod.parse=(q,U)=>{let Y=q.value,J=I.left._zod.run({value:Y,issues:[]},U),Q=I.right._zod.run({value:Y,issues:[]},U);if(J instanceof Promise||Q instanceof Promise)return Promise.all([J,Q]).then(([w,z])=>{return fx(q,w,z)});return fx(q,J,Q)}});function bL($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(r5($)&&r5(I)){let q=Object.keys(I),U=Object.keys($).filter((J)=>q.indexOf(J)!==-1),Y={...$,...I};for(let J of U){let Q=bL($[J],I[J]);if(!Q.valid)return{valid:!1,mergeErrorPath:[J,...Q.mergeErrorPath]};Y[J]=Q.data}return{valid:!0,data:Y}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let q=[];for(let U=0;U<$.length;U++){let Y=$[U],J=I[U],Q=bL(Y,J);if(!Q.valid)return{valid:!1,mergeErrorPath:[U,...Q.mergeErrorPath]};q.push(Q.data)}return{valid:!0,data:q}}return{valid:!1,mergeErrorPath:[]}}function fx($,I,q){let U=new Map,Y;for(let K of I.issues)if(K.code==="unrecognized_keys"){Y??(Y=K);for(let w of K.keys){if(!U.has(w))U.set(w,{});U.get(w).l=!0}}else $.issues.push(K);for(let K of q.issues)if(K.code==="unrecognized_keys")for(let w of K.keys){if(!U.has(w))U.set(w,{});U.get(w).r=!0}else $.issues.push(K);let J=[...U].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(J.length&&Y)$.issues.push({...Y,keys:J});if(t5($))return $;let Q=bL(I.value,q.value);if(!Q.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Q.mergeErrorPath)}`);return $.value=Q.data,$}var zz=m("$ZodTuple",($,I)=>{k0. Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Q of $.seen.entries()){let K=Q[1];if(I===Q[0]){J(Q);continue}if($.external){let w=$.external.registry.get(Q[0])?.id;if(I!==Q[0]&&w){J(Q);continue}}if($.metadataRegistry.get(Q[0])?.id){J(Q);continue}if(K.cycle){J(Q);continue}if(K.count>1){if($.reused==="ref"){J(Q);continue}}}}function t5($,I){let q=$.seen.get(I);if(!q)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(K)=>{let z=$.seen.get(K);if(z.ref===null)return;let w=z.def??z.schema,G={...w},H=z.ref;if(z.ref=null,H){U(H);let V=$.seen.get(H),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))w.allOf=w.allOf??[],w.allOf.push(X);else Object.assign(w,X);if(Object.assign(w,G),K._zod.parent===H)for(let O in w){if(O==="$ref"||O==="allOf")continue;if(!(O in G))delete w[O]}if(X.$ref&&V.def)for(let O in w){if(O==="$ref"||O==="allOf")continue;if(O in V.def&&JSON.stringify(w[O])===JSON.stringify(V.def[O]))delete w[O]}}let W=K._zod.parent;if(W&&W!==H){U(W);let V=$.seen.get(W);if(V?.schema.$ref){if(w.$ref=V.schema.$ref,V.def)for(let X in w){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(w[X])===JSON.stringify(V.def[X]))delete w[X]}}}$.override({zodSchema:K,jsonSchema:w,path:z.path??[]})};for(let K of[...$.seen.entries()].reverse())U(K[0]);let Y={};if($.target==="draft-2020-12")Y.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")Y.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")Y.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(I)?.id;if(!K)throw Error("Schema is missing an `id` property");Y.$id=$.external.uri(K)}Object.assign(Y,q.def??q.schema);let J=$.metadataRegistry.get(I)?.id;if(J!==void 0&&Y.id===J)delete Y.id;let Q=$.external?.defs??{};for(let K of $.seen.entries()){let z=K[1];if(z.def&&z.defId){if(z.def.id===z.defId)delete z.def.id;Q[z.defId]=z.def}}if($.external);else if(Object.keys(Q).length>0)if($.target==="draft-2020-12")Y.$defs=Q;else Y.definitions=Q;try{let K=JSON.parse(JSON.stringify(Y));return Object.defineProperty(K,"~standard",{value:{...I["~standard"],jsonSchema:{input:EI(I,"input",$.processors),output:EI(I,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function g6($,I){let q=I??{seen:new Set};if(q.seen.has($))return!1;q.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return g6(U.element,q);if(U.type==="set")return g6(U.valueType,q);if(U.type==="lazy")return g6(U.getter(),q);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return g6(U.innerType,q);if(U.type==="intersection")return g6(U.left,q)||g6(U.right,q);if(U.type==="record"||U.type==="map")return g6(U.keyType,q)||g6(U.valueType,q);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return g6(U.in,q)||g6(U.out,q)}if(U.type==="object"){for(let Y in U.shape)if(g6(U.shape[Y],q))return!0;return!1}if(U.type==="union"){for(let Y of U.options)if(g6(Y,q))return!0;return!1}if(U.type==="tuple"){for(let Y of U.items)if(g6(Y,q))return!0;if(U.rest&&g6(U.rest,q))return!0;return!1}return!1}var jM=($,I={})=>(q)=>{let U=o5({...q,processors:I});return E1($,U),r5(U,$),t5(U,$)},EI=($,I,q={})=>(U)=>{let{libraryOptions:Y,target:J}=U??{},Q=o5({...Y??{},target:J,io:I,processors:q});return E1($,Q),r5(Q,$),t5(Q,$)};var ML0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},EM=($,I,q,U)=>{let Y=q;Y.type="string";let{minimum:J,maximum:Q,format:K,patterns:z,contentEncoding:w}=$._zod.bag;if(typeof J==="number")Y.minLength=J;if(typeof Q==="number")Y.maxLength=Q;if(K){if(Y.format=ML0[K]??K,Y.format==="")delete Y.format;if(K==="time")delete Y.format}if(w)Y.contentEncoding=w;if(z&&z.size>0){let G=[...z];if(G.length===1)Y.pattern=G[0].source;else if(G.length>1)Y.allOf=[...G.map((H)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:H.source}))]}},BM=($,I,q,U)=>{let Y=q,{minimum:J,maximum:Q,format:K,multipleOf:z,exclusiveMaximum:w,exclusiveMinimum:G}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))Y.type="integer";else Y.type="number";let H=typeof G==="number"&&G>=(J??Number.NEGATIVE_INFINITY),W=typeof w==="number"&&w<=(Q??Number.POSITIVE_INFINITY),V=I.target==="draft-04"||I.target==="openapi-3.0";if(H)if(V)Y.minimum=G,Y.exclusiveMinimum=!0;else Y.exclusiveMinimum=G;else if(typeof J==="number")Y.minimum=J;if(W)if(V)Y.maximum=w,Y.exclusiveMaximum=!0;else Y.exclusiveMaximum=w;else if(typeof Q==="number")Y.maximum=Q;if(typeof z==="number")Y.multipleOf=z},vM=($,I,q,U)=>{q.type="boolean"},RM=($,I,q,U)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},CM=($,I,q,U)=>{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),pB0(I)}clear(){this._buffer=void 0}}function pB0($){return Zf.parse(JSON.parse($))}function Vc($){return JSON.stringify($)+`
`}class cP{constructor($=Wc.stdin,I=Wc.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new pP,this._started=!1,this._ondata=(q)=>{this._readBuffer.append(q),this.processReadBuffer()},this._onerror=(q)=>{this.onerror?.(q)}}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 q=Vc($);if(this._stdout.write(q))I();else this._stdout.once("drain",I)})}}import{dirname as Du,join as Nw1}from"node:path";import{fileURLToPath as Fw1}from"node:url";class s8 extends Error{name="KyError";get isKyError(){return!0}}class n6 extends s8{name="HTTPError";response;request;options;data;constructor($,I,q){let U=$.status||$.status===0?$.status:"",Y=$.statusText??"",J=`${U} ${Y}`.trim(),Q=J?`status code ${J}`:"an unknown error";super(`Request failed with ${Q}: ${I.method} ${I.url}`);this.response=$,this.request=I,this.options=q}}class rJ extends s8{name="NetworkError";request;constructor($,I){super(`Request failed due to a network error: ${$.method} ${$.url}`,I);this.request=$}}class tJ 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 $q extends s8{name="ForceRetryError";customDelay;code;customRequest;constructor($){let I=$?.cause?$.cause instanceof Error?$.cause:new tJ($.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 dP extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}class b$ extends s8{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}var lP=(()=>{let $=!1,I=!1,q=typeof globalThis.ReadableStream==="function",U=typeof globalThis.Request==="function";if(q&&U)try{I=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(Y){if(Y instanceof Error&&Y.message==="unsupported BodyInit type")return!1;throw Y}return $&&!I})(),Zc=typeof globalThis.AbortController==="function",HH=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Xc=typeof globalThis.ReadableStream==="function",Dc=typeof globalThis.FormData==="function",VH=["get","post","put","patch","head","delete"],cB0=()=>{return};cB0();var Oc={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Iq=2147483647,Lc=40,WH=Symbol("stop");class ZH{options;constructor($){this.options=$}}var Nc=($)=>new ZH($),Fc={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},Mc={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 XH=new TextEncoder,dB0=($)=>{if(!$)return 0;if($ instanceof FormData){let I=0;for(let[q,U]of $)I+=Lc,I+=XH.encode(`Content-Disposition: form-data; name="${q}"`).byteLength,I+=typeof U==="string"?XH.encode(U).byteLength:U.size;return I}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return XH.encode($).byteLength;if($ instanceof URLSearchParams)return XH.encode($.toString()).byteLength;return 0},Ac=($,I,q)=>{let U,Y=0;return $.pipeThrough(new TransformStream({transform(J,Q){if(Q.enqueue(J),U){Y+=U.byteLength;let K=I===0?0:Y/I;if(K>=1)K=1-Number.EPSILON;q?.({percent:K,totalBytes:Math.max(I,Y),transferredBytes:Y},U)}U=J},flush(){if(U)Y+=U.byteLength,q?.({percent:1,totalBytes:Math.max(I,Y),transferredBytes:Y},U)}}))},gc=($,I)=>{if(!$.body)return $;let q={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,q);let U=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(Ac($.body,U,I),q)},Pc=($,I,q)=>{if(!$.body)return $;let U=dB0(q??$.body);return new Request($,{duplex:"half",body:Ac($.body,U,I)})};var G8=($)=>$!==null&&typeof $==="object";var lB0=Symbol("replaceOption"),mP=($)=>G8($)&&$[lB0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$};var sJ=(...$)=>{for(let I of $)if( Line truncated
`,{mode:384}),I}function zq($,I,q=[]){let U=I.corpId?.trim()||void 0,Y=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,J=U??Y;if(J){let K=$.find((z)=>z.id===J);if(K)return K;throw Error(`No enterprise config found for ${J}`)}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 Q=$[0];if(Q)return Q;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(q.length?q.join(", "):"the configured enterprise directories"))}import{readFileSync as fK1}from"node:fs";import{randomBytes as nK1}from"node:crypto";import{randomBytes as xd}from"node:crypto";var bv0=Z.object({staffId:Z.string(),name:Z.string().optional(),code:Z.string().default(""),bindTime:Z.number().optional()}),iv0=Z.object({id:Z.string(),tenantId:Z.string(),name:Z.string(),isAdmin:Z.boolean().default(!1),permissions:Z.array(Z.string()).default([]),providerUserId:Z.string().optional(),hosecloudStaff:bv0.optional()}),pv0=Z.object({apiKey:Z.string().optional(),corporationId:Z.string().optional(),corporationName:Z.string().optional()}),cv0=Z.object({id:Z.string(),name:Z.string(),tenantSlug:Z.string().optional(),isDemo:Z.boolean().default(!1),logoUrl:Z.string().nullable().optional(),hoseCorpConfig:pv0.optional()}),Xd=Z.object({user:iv0,tenant:cv0}),dv0=Z.object({id:Z.string(),name:Z.string(),email:Z.string().nullable().optional(),emailVerified:Z.boolean().optional(),image:Z.string().nullable().optional(),tenantId:Z.string().optional(),provider:Z.string().optional(),providerUserId:Z.string().optional(),mobile:Z.string().nullable().optional(),status:Z.string().optional(),permissions:Z.array(Z.string()).default([]),isAdmin:Z.boolean().default(!1),hosecloudStaff:Z.unknown().optional()}).passthrough(),lv0=Z.object({id:Z.string(),token:Z.string().optional(),expiresAt:Z.string(),createdAt:Z.string().optional(),updatedAt:Z.string().optional(),ipAddress:Z.string().optional(),userAgent:Z.string().optional(),userId:Z.string(),delegationId:Z.string().nullable().optional()}).passthrough(),Dd=Z.object({user:dv0,session:lv0}),CH=Z.object({id:Z.string(),tenantId:Z.string().optional(),code:Z.number().optional(),description:Z.string(),scope:Z.string(),strictness:Z.string(),status:Z.string().optional(),createdAt:Z.number().optional(),updatedAt:Z.number().optional()}),Od=Z.object({rules:Z.array(CH),hasPendingDeletes:Z.boolean().default(!1)}),mv0=Z.object({code:Z.string().optional(),description:Z.string(),scope:Z.string(),strictness:Z.string()}),_H=Z.object({id:Z.string(),tenantId:Z.string().optional(),versionNumber:Z.number(),versionName:Z.string().nullable().optional(),publishedBy:Z.string().nullable().optional(),publishedByName:Z.string().nullable().optional(),rules:Z.array(mv0).default([]),publishedAt:Z.number().optional(),createdAt:Z.number().optional()}),Ld=Z.object({version:_H,rulesCount:Z.number()}),QQ=Z.object({id:Z.string(),tenantId:Z.string().optional(),title:Z.string(),purpose:Z.string().default(""),contentType:Z.string().default("policy"),content:Z.string(),status:Z.string().default("published"),enabled:Z.boolean().default(!0),scenarios:Z.array(Z.string()).default([]),tags:Z.array(Z.string()).default([]),category:Z.string().nullable().optional(),categoryTags:Z.array(Z.string()).default([]),createdBy:Z.string().nullable().optional(),createdByName:Z.string().nullable().optional(),createdAt:Z.number().optional(),updatedAt:Z.number().optional(),updatedBy:Z.string().nullable().optional(),updatedByName:Z.string().nullable().optional(),isDeleted:Z.boolean().default(!1)}),Nd=Z.object({articles:Z.array(QQ),total:Z.number().optional()}),ov0=Z.object({explicitApprove:Z.string().default(""),explicitReject:Z.string().default(""),exemptApprove:Z.string().default(""),review:Z.string().default("")}).passthrough(),rv0=Z.object({type:Z.string(),signKey:Z.string().optional(),outboundName:Z.string().optional(),mode:Z.string().optional(),autoApprovalRate:Z.number().optional(),apiKey:Z.string().optional(),apiSecret:Z.string().optional(),apiOrigin:Z.string().optional(),corporationId:Z.string().optional(),ebotSignKey:Z.string().optional(),completionSignKey:Z.string().optional(),outboundMessageId:Z.string().optional(),completionMessageId:Z.string().optional()}).passthrough(),tv0=Z.enum(["assisted","semi_automatic","fully_automatic"]),Zd=Z.object({id:Z.string(),url:Z.string().url()}).passthrough(),KQ=Z.object({type:Z.literal("webhook"),id:Z.string(),name:Z.string(),mode:tv0,incomingDocumentWebhook:Zd,outgoingResultWebhook:Z.string().url(),incomingManualResultWebhook:Zd,secret:Z.string().min(1),autoApprovalRate:Z.number().int().min(0).max(100).optional()}).passthrough(),HT=Z.object({id:Z.string().optional(),tenantId:Z.string().optional(),tone:Z.string().optional(),language:Z.string().optional(),detailLevel:Z.string().optional(),outputFormat:Z.string().optional(),examples:Z.array(Z.string()).default([]),prohibitedPhrases:Z.array(Z.strin Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:V7({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:UO(I,["template.name","templateName","form.name","formName","formTitle"]),amount:IO(q,["金额","报销金额","付款金额","合计","价税合计"])??UO(I,["amount","totalAmount","expenseAmount"]),expenseType:IO(q,["费用类型","费用类别","报销类型"]),costCompany:IO(q,["费用承担公司","承担公司","成本中心","费用归属"]),payee:IO(q,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:q.slice(0,30)}),invoices:Yz1($),attachments:vW0($,{summary:!0}).attachments,aiResult:JO($),manualResult:e3($)?.value,hints:V7({amountMentions:OW0(U,["金额","合计","税率"],8),partyMentions:OW0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function vW0($,I={}){let q=[["document",$.document],["result",$.result],["pipelineData",$.pipelineData],["sourceExtendData",$.sourceExtendData]],U=[],Y=new Set;for(let[J,Q]of q)py(Q,J,U,Y);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,count:U.length,attachments:I.summary?U.map((J)=>V7({path:J.path,kind:J.kind,fileName:J.fileName,mimeType:J.mimeType,fileId:J.fileId,sourceField:J.sourceField})):U}}function sK1($){let I=[["result.citedRules",x5($,"result.citedRules")],["result.matchedRules",x5($,"result.matchedRules")],["result.ruleResults",x5($,"result.ruleResults")],["result.rules",x5($,"result.rules")],["pipelineData.citedRules",x5($,"pipelineData.citedRules")],["pipelineData.matchedRules",x5($,"pipelineData.matchedRules")]],q=[],U=new Set;for(let[Y,J]of I)(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).forEach((K,z)=>{let w=OY(K);if(!w)return;let G=b0(w.runtimeRuleId)??b0(w.runtimeId)??b0(w.id)??b0(w.ruleId),H=b0(w.ruleCode)??b0(w.code)??(G?Kz1(G):void 0),W=V7({runtimeRuleId:G,ruleCode:H,versionNumber:qz1(w.versionNumber)??$.ruleSetVersionNumber,scope:b0(w.scope),strictness:b0(w.strictness),appliedAnalysis:w.appliedAnalysis??w.analysis??w.reasoning,checkResult:w.checkResult??w.result??w.decision,findings:w.findings??w.riskPoints??w.evidence,sourcePath:`${Y}.${z}`}),V=JSON.stringify(W);if(!U.has(V))U.add(V),q.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:q.length,rules:q}}function py($,I,q,U){if(Array.isArray($)){$.forEach((J,Q)=>py(J,`${I}.${Q}`,q,U));return}let Y=OY($);if(!Y)return;if(eK1(Y,I)){let J=V7({path:I,fieldPath:I,kind:$z1(I,Y),fileName:b0(Y.fileName)??b0(Y.filename)??b0(Y.name)??b0(Y.originalName),mimeType:b0(Y.mimeType)??b0(Y.mimetype)??b0(Y.contentType),fileId:b0(Y.fileId)??b0(Y.id)??b0(Y.attachmentId),ossPath:b0(Y.ossPath)??b0(Y.ossKey)??b0(Y.key),url:b0(Y.url)??b0(Y.signedUrl)??b0(Y.downloadUrl)??b0(Y.previewUrl),invoiceId:b0(Y.invoiceId),sourceField:b0(Y.fieldName)??b0(Y.label)}),Q=JSON.stringify(J);if(!U.has(Q))U.add(Q),q.push(J)}for(let[J,Q]of Object.entries(Y))py(Q,`${I}.${J}`,q,U)}function eK1($,I){let q=Object.keys($).map((J)=>J.toLowerCase());return/(attachment|attachments|invoice|receipt|file|files|附件|发票)/i.test(I)&&["filename","fileName","mimeType","mimetype","contentType","fileId","ossPath","signedUrl","downloadUrl","previewUrl","attachmentId"].some((J)=>q.includes(J.toLowerCase()))}function $z1($,I){let q=`${$} ${b0(I.type)??""}`.toLowerCase();if(q.includes("invoice")||q.includes("发票"))return"invoice";if(q.includes("receipt"))return"receipt";return"attachment"}function UO($,I){if(!$)return;for(let q of I){let U=x5($,q);if(U!==void 0)return U}return}function DW0($,I){if(!$)return 0;for(let q of I){let U=x5($,q);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function x5($,I){return I.split(".").reduce((q,U)=>{if(q===void 0||q===null)return;if(Array.isArray(q)){let Y=Number(U);return Number.isInteger(Y)?q[Y]:void 0}if(typeof q==="object")return q[U];return},$)}function Iz1($,I,q){let U=I.split("."),Y=$;for(let J of U.slice(0,-1)){let Q=Y[J];if(!Q||typeof Q!=="object"||Array.isArray(Q))Y[J]={};Y=Y[J]}Y[U[U.length-1]??I]=q}function V7($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function OY($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function qz1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function Uz1($){let I=[];return cy($,"document",I),I}function cy($,I,q){if(Array.isArray($)){$.forEach((Q,K)=>cy(Q,`${I}.${K}`,q));return}let U=OY($);if(!U)return;let Y=b0(U.label)??b0(U.name)??b0(U.title)??b0(U.fieldName),J=U.value??U.displayValue??U.text??U.content;if(Y&&J!==void 0&&typeof J!=="object")q.push(V7({path:I,label:Y,value:J,type:b0(U.type)??b0(U.fieldType)}));for(let[Q,K]of Object.entries(U)){if(Q==="attachments")continue;cy(K,`${I}.${Q}`,q)}}function IO($,I){return $.find((U)=>{let Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Q of $.seen.entries()){let K=Q[1];if(I===Q[0]){J(Q);continue}if($.external){let z=$.external.registry.get(Q[0])?.id;if(I!==Q[0]&&z){J(Q);continue}}if($.metadataRegistry.get(Q[0])?.id){J(Q);continue}if(K.cycle){J(Q);continue}if(K.count>1){if($.reused==="ref"){J(Q);continue}}}}function I9($,I){let q=$.seen.get(I);if(!q)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(K)=>{let w=$.seen.get(K);if(w.ref===null)return;let z=w.def??w.schema,G={...z},H=w.ref;if(w.ref=null,H){U(H);let W=$.seen.get(H),X=W.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))z.allOf=z.allOf??[],z.allOf.push(X);else Object.assign(z,X);if(Object.assign(z,G),K._zod.parent===H)for(let O in z){if(O==="$ref"||O==="allOf")continue;if(!(O in G))delete z[O]}if(X.$ref&&W.def)for(let O in z){if(O==="$ref"||O==="allOf")continue;if(O in W.def&&JSON.stringify(z[O])===JSON.stringify(W.def[O]))delete z[O]}}let V=K._zod.parent;if(V&&V!==H){U(V);let W=$.seen.get(V);if(W?.schema.$ref){if(z.$ref=W.schema.$ref,W.def)for(let X in z){if(X==="$ref"||X==="allOf")continue;if(X in W.def&&JSON.stringify(z[X])===JSON.stringify(W.def[X]))delete z[X]}}}$.override({zodSchema:K,jsonSchema:z,path:w.path??[]})};for(let K of[...$.seen.entries()].reverse())U(K[0]);let Y={};if($.target==="draft-2020-12")Y.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")Y.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")Y.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(I)?.id;if(!K)throw Error("Schema is missing an `id` property");Y.$id=$.external.uri(K)}Object.assign(Y,q.def??q.schema);let J=$.metadataRegistry.get(I)?.id;if(J!==void 0&&Y.id===J)delete Y.id;let Q=$.external?.defs??{};for(let K of $.seen.entries()){let w=K[1];if(w.def&&w.defId){if(w.def.id===w.defId)delete w.def.id;Q[w.defId]=w.def}}if($.external);else if(Object.keys(Q).length>0)if($.target==="draft-2020-12")Y.$defs=Q;else Y.definitions=Q;try{let K=JSON.parse(JSON.stringify(Y));return Object.defineProperty(K,"~standard",{value:{...I["~standard"],jsonSchema:{input:vI(I,"input",$.processors),output:vI(I,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function P6($,I){let q=I??{seen:new Set};if(q.seen.has($))return!1;q.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return P6(U.element,q);if(U.type==="set")return P6(U.valueType,q);if(U.type==="lazy")return P6(U.getter(),q);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return P6(U.innerType,q);if(U.type==="intersection")return P6(U.left,q)||P6(U.right,q);if(U.type==="record"||U.type==="map")return P6(U.keyType,q)||P6(U.valueType,q);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return P6(U.in,q)||P6(U.out,q)}if(U.type==="object"){for(let Y in U.shape)if(P6(U.shape[Y],q))return!0;return!1}if(U.type==="union"){for(let Y of U.options)if(P6(Y,q))return!0;return!1}if(U.type==="tuple"){for(let Y of U.items)if(P6(Y,q))return!0;if(U.rest&&P6(U.rest,q))return!0;return!1}return!1}var yM=($,I={})=>(q)=>{let U=e5({...q,processors:I});return j1($,U),$9(U,$),I9(U,$)},vI=($,I,q={})=>(U)=>{let{libraryOptions:Y,target:J}=U??{},Q=e5({...Y??{},target:J,io:I,processors:q});return j1($,Q),$9(Q,$),I9(Q,$)};var kL0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},uM=($,I,q,U)=>{let Y=q;Y.type="string";let{minimum:J,maximum:Q,format:K,patterns:w,contentEncoding:z}=$._zod.bag;if(typeof J==="number")Y.minLength=J;if(typeof Q==="number")Y.maxLength=Q;if(K){if(Y.format=kL0[K]??K,Y.format==="")delete Y.format;if(K==="time")delete Y.format}if(z)Y.contentEncoding=z;if(w&&w.size>0){let G=[...w];if(G.length===1)Y.pattern=G[0].source;else if(G.length>1)Y.allOf=[...G.map((H)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:H.source}))]}},xM=($,I,q,U)=>{let Y=q,{minimum:J,maximum:Q,format:K,multipleOf:w,exclusiveMaximum:z,exclusiveMinimum:G}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))Y.type="integer";else Y.type="number";let H=typeof G==="number"&&G>=(J??Number.NEGATIVE_INFINITY),V=typeof z==="number"&&z<=(Q??Number.POSITIVE_INFINITY),W=I.target==="draft-04"||I.target==="openapi-3.0";if(H)if(W)Y.minimum=G,Y.exclusiveMinimum=!0;else Y.exclusiveMinimum=G;else if(typeof J==="number")Y.minimum=J;if(V)if(W)Y.maximum=z,Y.exclusiveMaximum=!0;else Y.exclusiveMaximum=z;else if(typeof Q==="number")Y.maximum=Q;if(typeof w==="number")Y.multipleOf=w},kM=($,I,q,U)=>{q.type="boolean"},fM=($,I,q,U)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},nM=($,I,q,U)=>{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),Qv0(I)}clear(){this._buffer=void 0}}function Qv0($){return Rf.parse(JSON.parse($))}function Bc($){return JSON.stringify($)+`
`}class eP{constructor($=vc.stdin,I=vc.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new sP,this._started=!1,this._ondata=(q)=>{this._readBuffer.append(q),this.processReadBuffer()},this._onerror=(q)=>{this.onerror?.(q)}}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 q=Bc($);if(this._stdout.write(q))I();else this._stdout.once("drain",I)})}}import{dirname as _u,join as dz1}from"node:path";import{fileURLToPath as lz1}from"node:url";class q5 extends Error{name="KyError";get isKyError(){return!0}}class i6 extends q5{name="HTTPError";response;request;options;data;constructor($,I,q){let U=$.status||$.status===0?$.status:"",Y=$.statusText??"",J=`${U} ${Y}`.trim(),Q=J?`status code ${J}`:"an unknown error";super(`Request failed with ${Q}: ${I.method} ${I.url}`);this.response=$,this.request=I,this.options=q}}class aJ extends q5{name="NetworkError";request;constructor($,I){super(`Request failed due to a network error: ${$.method} ${$.url}`,I);this.request=$}}class sJ 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 qq extends q5{name="ForceRetryError";customDelay;code;customRequest;constructor($){let I=$?.cause?$.cause instanceof Error?$.cause:new sJ($.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 $T extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}class p$ extends q5{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}var IT=(()=>{let $=!1,I=!1,q=typeof globalThis.ReadableStream==="function",U=typeof globalThis.Request==="function";if(q&&U)try{I=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(Y){if(Y instanceof Error&&Y.message==="unsupported BodyInit type")return!1;throw Y}return $&&!I})(),Rc=typeof globalThis.AbortController==="function",XH=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Cc=typeof globalThis.ReadableStream==="function",_c=typeof globalThis.FormData==="function",DH=["get","post","put","patch","head","delete"],Kv0=()=>{return};Kv0();var hc={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Uq=2147483647,Sc=40,OH=Symbol("stop");class LH{options;constructor($){this.options=$}}var yc=($)=>new LH($),uc={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},xc={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 NH=new TextEncoder,wv0=($)=>{if(!$)return 0;if($ instanceof FormData){let I=0;for(let[q,U]of $)I+=Sc,I+=NH.encode(`Content-Disposition: form-data; name="${q}"`).byteLength,I+=typeof U==="string"?NH.encode(U).byteLength:U.size;return I}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return NH.encode($).byteLength;if($ instanceof URLSearchParams)return NH.encode($.toString()).byteLength;return 0},kc=($,I,q)=>{let U,Y=0;return $.pipeThrough(new TransformStream({transform(J,Q){if(Q.enqueue(J),U){Y+=U.byteLength;let K=I===0?0:Y/I;if(K>=1)K=1-Number.EPSILON;q?.({percent:K,totalBytes:Math.max(I,Y),transferredBytes:Y},U)}U=J},flush(){if(U)Y+=U.byteLength,q?.({percent:1,totalBytes:Math.max(I,Y),transferredBytes:Y},U)}}))},fc=($,I)=>{if(!$.body)return $;let q={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,q);let U=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(kc($.body,U,I),q)},nc=($,I,q)=>{if(!$.body)return $;let U=wv0(q??$.body);return new Request($,{duplex:"half",body:kc($.body,U,I)})};var H8=($)=>$!==null&&typeof $==="object";var zv0=Symbol("replaceOption"),qT=($)=>H8($)&&$[zv0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$};var $Q=(...$)=>{for(let I of $)if( Line truncated
`,{mode:384}),I}function Gq($,I,q=[]){let U=I.corpId?.trim()||void 0,Y=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,J=U??Y;if(J){let K=$.find((w)=>w.id===J);if(K)return K;throw Error(`No enterprise config found for ${J}`)}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 Q=$[0];if(Q)return Q;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(q.length?q.join(", "):"the configured enterprise directories"))}import{readFileSync as Zw1}from"node:fs";import{randomBytes as Xw1}from"node:crypto";import{randomBytes as ed}from"node:crypto";var YR0=Z.object({staffId:Z.string(),name:Z.string().optional(),code:Z.string().default(""),bindTime:Z.number().optional()}),JR0=Z.object({id:Z.string(),tenantId:Z.string(),name:Z.string(),isAdmin:Z.boolean().default(!1),permissions:Z.array(Z.string()).default([]),providerUserId:Z.string().optional(),hosecloudStaff:YR0.optional()}),QR0=Z.object({apiKey:Z.string().optional(),corporationId:Z.string().optional(),corporationName:Z.string().optional()}),KR0=Z.object({id:Z.string(),name:Z.string(),tenantSlug:Z.string().optional(),isDemo:Z.boolean().default(!1),logoUrl:Z.string().nullable().optional(),hoseCorpConfig:QR0.optional()}),Cd=Z.object({user:JR0,tenant:KR0}),wR0=Z.object({id:Z.string(),name:Z.string(),email:Z.string().nullable().optional(),emailVerified:Z.boolean().optional(),image:Z.string().nullable().optional(),tenantId:Z.string().optional(),provider:Z.string().optional(),providerUserId:Z.string().optional(),mobile:Z.string().nullable().optional(),status:Z.string().optional(),permissions:Z.array(Z.string()).default([]),isAdmin:Z.boolean().default(!1),hosecloudStaff:Z.unknown().optional()}).passthrough(),zR0=Z.object({id:Z.string(),token:Z.string().optional(),expiresAt:Z.string(),createdAt:Z.string().optional(),updatedAt:Z.string().optional(),ipAddress:Z.string().optional(),userAgent:Z.string().optional(),userId:Z.string(),delegationId:Z.string().nullable().optional()}).passthrough(),_d=Z.object({user:wR0,session:zR0}),yH=Z.object({id:Z.string(),tenantId:Z.string().optional(),code:Z.number().optional(),description:Z.string(),scope:Z.string(),strictness:Z.string(),status:Z.string().optional(),createdAt:Z.number().optional(),updatedAt:Z.number().optional()}),hd=Z.object({rules:Z.array(yH),hasPendingDeletes:Z.boolean().default(!1)}),GR0=Z.object({code:Z.string().optional(),description:Z.string(),scope:Z.string(),strictness:Z.string()}),uH=Z.object({id:Z.string(),tenantId:Z.string().optional(),versionNumber:Z.number(),versionName:Z.string().nullable().optional(),publishedBy:Z.string().nullable().optional(),publishedByName:Z.string().nullable().optional(),rules:Z.array(GR0).default([]),publishedAt:Z.number().optional(),createdAt:Z.number().optional()}),Sd=Z.object({version:uH,rulesCount:Z.number()}),wQ=Z.object({id:Z.string(),tenantId:Z.string().optional(),title:Z.string(),purpose:Z.string().default(""),contentType:Z.string().default("policy"),content:Z.string(),status:Z.string().default("published"),enabled:Z.boolean().default(!0),scenarios:Z.array(Z.string()).default([]),tags:Z.array(Z.string()).default([]),category:Z.string().nullable().optional(),categoryTags:Z.array(Z.string()).default([]),createdBy:Z.string().nullable().optional(),createdByName:Z.string().nullable().optional(),createdAt:Z.number().optional(),updatedAt:Z.number().optional(),updatedBy:Z.string().nullable().optional(),updatedByName:Z.string().nullable().optional(),isDeleted:Z.boolean().default(!1)}),yd=Z.object({articles:Z.array(wQ),total:Z.number().optional()}),HR0=Z.object({explicitApprove:Z.string().default(""),explicitReject:Z.string().default(""),exemptApprove:Z.string().default(""),review:Z.string().default("")}).passthrough(),VR0=Z.object({type:Z.string(),signKey:Z.string().optional(),outboundName:Z.string().optional(),mode:Z.string().optional(),autoApprovalRate:Z.number().optional(),apiKey:Z.string().optional(),apiSecret:Z.string().optional(),apiOrigin:Z.string().optional(),corporationId:Z.string().optional(),ebotSignKey:Z.string().optional(),completionSignKey:Z.string().optional(),outboundMessageId:Z.string().optional(),completionMessageId:Z.string().optional()}).passthrough(),WR0=Z.enum(["assisted","semi_automatic","fully_automatic"]),Rd=Z.object({id:Z.string(),url:Z.string().url()}).passthrough(),zQ=Z.object({type:Z.literal("webhook"),id:Z.string(),name:Z.string(),mode:WR0,incomingDocumentWebhook:Rd,outgoingResultWebhook:Z.string().url(),incomingManualResultWebhook:Rd,secret:Z.string().min(1),autoApprovalRate:Z.number().int().min(0).max(100).optional()}).passthrough(),FT=Z.object({id:Z.string().optional(),tenantId:Z.string().optional(),tone:Z.string().optional(),language:Z.string().optional(),detailLevel:Z.string().optional(),outputFormat:Z.string().optional(),examples:Z.array(Z.string()).default([]),prohibitedPhrases:Z.array(Z.strin Line truncated
`,"utf8"),q}function ll($){return $.map((I,q)=>{let U;if(typeof I.code==="number")U=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")U=I.code.startsWith("#")?I.code:`#${I.code}`;else U=`#${String(q+1).padStart(4,"0")}`;return{id:I.id,code:U,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}class f7 extends Error{errors;warnings;constructor($,I=[]){super(`材料包校验失败:${$.length} 个错误`);this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}import{createHmac as $C0,randomBytes as IC0}from"node:crypto";function qC0($,I,q,U){return $C0("sha256",U).update(`${$}.${I}.${JSON.stringify(q)}`).digest("hex")}function pT($,I){let q=Math.floor(Date.now()/1000),U=IC0(16).toString("hex");return{Authorization:`Bearer ${I}`,"x-webhook-signature":qC0(q,U,$,I),"x-webhook-timestamp":String(q),"x-webhook-nonce":U}}var hE=RY(Vm(),1),Io=RY($o(),1);var wV={maxEntries:1000,maxTotalSize:524288000,maxCompressionRatio:150};async function qo($){return new Promise((I,q)=>{hE.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0},(U,Y)=>{if(U||!Y)return q(U??Error("无法打开 ZIP"));let J=[];Y.readEntry(),Y.on("entry",(Q)=>{let K=Uo(Q);if(!K.endsWith("/")&&!C_0(K))J.push({fileName:K,uncompressedSize:Q.uncompressedSize,compressedSize:Q.compressedSize,raw:Q});Y.readEntry()}),Y.on("end",()=>I(J)),Y.on("error",q)})})}function Uo($){if($.fileNameUTF8||$.generalPurposeBitFlag&2048)return $.fileNameUTF8??$.fileName;let I=Buffer.from(String($.fileName),"binary"),q=I.toString("utf8");if(q.includes("�")||/[\u0080-\u00FF]/.test(q)){let U=Io.default.decode(I,"gbk");if(!U.includes("�"))return U}return q}function C_0($){let I=$.split("/").pop()??"";return $.split("/").includes("__MACOSX")||I===".DS_Store"||I.startsWith("._")||I.startsWith(".~")||I.startsWith("~$")}function Yo($){let I=[];if($.length>wV.maxEntries)I.push(`文件数超过 ${wV.maxEntries}`);if($.reduce((Y,J)=>Y+J.uncompressedSize,0)>wV.maxTotalSize)I.push("解压后总大小超过 500MB");for(let Y of $){if(Y.fileName.startsWith("/")||Y.fileName.split("/").includes(".."))I.push(`存在不安全路径: ${Y.fileName}`);if(Y.compressedSize>0&&Y.uncompressedSize/Y.compressedSize>wV.maxCompressionRatio)I.push(`压缩比超过 150: ${Y.fileName}`)}if(!$.find((Y)=>Y.fileName==="信息表.xlsx"))I.push("ZIP 根目录缺少精确名为「信息表.xlsx」的文件");if($.some((Y)=>Y.fileName.toLowerCase().endsWith(".zip")))I.push("不允许嵌套 ZIP");if(I.length)throw new f7(I)}function SE($,I){return new Promise((q,U)=>{hE.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0},(Y,J)=>{if(Y||!J)return U(Y??Error("无法打开 ZIP"));J.readEntry(),J.on("entry",(Q)=>{if(Uo(Q)!==I.fileName)return J.readEntry();J.openReadStream(Q,(K,w)=>{if(K||!w)return U(K??Error(`无法读取 ${I.fileName}`));let z=[];w.on("data",(G)=>z.push(G)),w.on("end",()=>q(Buffer.concat(z))),w.on("error",U)})}),J.on("error",U)})})}var vV0=RY(jV0(),1);function sD($,I,q,U){return{key:$,label:I,type:q,value:U}}function RV0($,I,q){return sD($,I,"TEXT",q==null?"":String(q))}function CV0($,I,q){return sD($,I,"AMOUNT",typeof q==="number"?{amount:q,currency:"CNY"}:null)}function _V0($){if($ instanceof Date)return $.toISOString();if(typeof $==="string"&&$.trim())return $.trim();return null}function bK1($){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 DY($){let I=new Map;return $.getRow(1).eachCell((q,U)=>I.set(String(q.value??"").trim(),U)),I}function OY($,I,q){let U=I.get(q);return U?$.getCell(U).value:void 0}function pK1($,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(([U,Y,J])=>{let Q=OY($,I,U);if(Q==null||Q==="")return[];return[J==="TEXT"?RV0(Y,U,Q):J==="AMOUNT"?CV0(Y,U,Q):sD(Y,U,J,_V0(Q))]})}function BV0($,I,q){return q.flatMap(([U,Y,J])=>{let Q=OY($,I,U);if(Q==null||Q==="")return[];return[J==="TEXT"?RV0(Y,U,Q):J==="AMOUNT"?CV0(Y,U,Q):sD(Y,U,J,_V0(Q))]})}var cK1=[["姓名","name","TEXT"],["身份证号码","id_number","TEXT"],["手机号","phone","TEXT"],["劳务费用","labor_fee","AMOUNT"],["税前费用","pretax_fee","AMOUNT"],["开户行","bank","TEXT"],["支行名称","branch_name","TEXT"],["联行号","bank_code","TEXT"],["银行卡号","bank_card_number","TEXT"]],dK1=[["报销金额","reimbursement_amount","AMOUNT"],["费用类型","expense_type","TEXT"],["发生时间","occurrence_time","DATE"],["收款人","payee","TEXT"],["开户行","bank","TEXT"],["支行名称","branch_name","TEXT"],["支行行 Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:NY({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:zO(I,["template.name","templateName","form.name","formName","formTitle"]),amount:KO(q,["金额","报销金额","付款金额","合计","价税合计"])??zO(I,["amount","totalAmount","expenseAmount"]),expenseType:KO(q,["费用类型","费用类别","报销类型"]),costCompany:KO(q,["费用承担公司","承担公司","成本中心","费用归属"]),payee:KO(q,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:q.slice(0,30)}),invoices:Cw1($),attachments:JO($,{summary:!0}).attachments,aiResult:HO($),manualResult:II($)?.value,hints:NY({amountMentions:kW0(U,["金额","合计","税率"],8),partyMentions:kW0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function jw1($){let I=[["result.citedRules",b5($,"result.citedRules")],["result.matchedRules",b5($,"result.matchedRules")],["result.ruleResults",b5($,"result.ruleResults")],["result.rules",b5($,"result.rules")],["pipelineData.citedRules",b5($,"pipelineData.citedRules")],["pipelineData.matchedRules",b5($,"pipelineData.matchedRules")]],q=[],U=new Set;for(let[Y,J]of I)(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).forEach((K,w)=>{let z=Hw(K);if(!z)return;let G=$4(z.runtimeRuleId)??$4(z.runtimeId)??$4(z.id)??$4(z.ruleId),H=$4(z.ruleCode)??$4(z.code)??(G?Sw1(G):void 0),V=NY({runtimeRuleId:G,ruleCode:H,versionNumber:vw1(z.versionNumber)??$.ruleSetVersionNumber,scope:$4(z.scope),strictness:$4(z.strictness),appliedAnalysis:z.appliedAnalysis??z.analysis??z.reasoning,checkResult:z.checkResult??z.result??z.decision,findings:z.findings??z.riskPoints??z.evidence,sourcePath:`${Y}.${w}`}),W=JSON.stringify(V);if(!U.has(W))U.add(W),q.push(V)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:q.length,rules:q}}function zO($,I){if(!$)return;for(let q of I){let U=b5($,q);if(U!==void 0)return U}return}function xW0($,I){if(!$)return 0;for(let q of I){let U=b5($,q);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function b5($,I){return I.split(".").reduce((q,U)=>{if(q===void 0||q===null)return;if(Array.isArray(q)){let Y=Number(U);return Number.isInteger(Y)?q[Y]:void 0}if(typeof q==="object")return q[U];return},$)}function Bw1($,I,q){let U=I.split("."),Y=$;for(let J of U.slice(0,-1)){let Q=Y[J];if(!Q||typeof Q!=="object"||Array.isArray(Q))Y[J]={};Y=Y[J]}Y[U[U.length-1]??I]=q}function NY($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function Hw($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function vw1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function Rw1($){let I=[];return Uu($,"document",I),I}function Uu($,I,q){if(Array.isArray($)){$.forEach((Q,K)=>Uu(Q,`${I}.${K}`,q));return}let U=Hw($);if(!U)return;let Y=$4(U.label)??$4(U.name)??$4(U.title)??$4(U.fieldName),J=U.value??U.displayValue??U.text??U.content;if(Y&&J!==void 0&&typeof J!=="object")q.push(NY({path:I,label:Y,value:J,type:$4(U.type)??$4(U.fieldType)}));for(let[Q,K]of Object.entries(U)){if(Q==="attachments")continue;Uu(K,`${I}.${Q}`,q)}}function KO($,I){return $.find((U)=>{let Y=$4(U.label)??"";return I.some((J)=>Y.includes(J))})?.value}function Cw1($){let I=[];return GO($.result,"result",I),GO($.document,"document",I),I.slice(0,20)}function GO($,I,q){if(Array.isArray($)){$.forEach((Y,J)=>GO(Y,`${I}.${J}`,q));return}let U=Hw($);if(!U)return;if(/invoice|发票/i.test(I))q.push(NY({path:I,fileName:$4(U.fileName)??$4(U.filename)??$4(U.name),buyer:U.buyer??U.buyerName??U.purchaserName,seller:U.seller??U.sellerName,amount:U.amount??U.totalAmount??U.total,taxRate:U.taxRate,category:U.category??U.type}));for(let[Y,J]of Object.entries(U))GO(J,`${I}.${Y}`,q)}function kW0($,I,q){return $.split(/\r?\n/).filter((U)=>I.some((Y)=>U.includes(Y))).slice(0,q)}function wO($){return $.map((I)=>{let q=$I(I);return{recordId:q.id,tenantId:q.tenantId,agentId:q.agentId,sourceDocumentSN:q.sourceDocumentSN,sourceDocumentId:q.sourceDocumentId,simulationBatchId:q.simulationBatchId,langfuseTraceId:q.langfuseTraceId,langfuseSessionFallback:q.langfuseSessionFallback,ruleSetVersionNumber:q.ruleSetVersionNumber,ruleSetPublishedAt:q.ruleSetPublishedAt,ruleSetPublishedByName:q.ruleSetPublishedByName,resolution:q.langfuseTraceId?"trace":q.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Iu($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function _w1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let q=await N$($,I.recordId);if(!q.ruleSetVersionNumber)throw Er Line truncated
`)}
`}function Hz($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function R0($,I={}){Fz1($,I);let q=`${JSON.stringify($,null,2)}
`;if(I.outputFile){Dz1(I.outputFile,q),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(q,"utf-8")},null,2));return}console.log(q.trimEnd())}function Fz1($,I={}){if(I.allowFull||I.outputFile)return;let q=Buffer.byteLength(JSON.stringify($),"utf-8");if(q>Nz1)throw Error(`Output is large (${q} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function iW0($,I){if(I)return;let q=$&&typeof $==="object"?$:{},U=typeof q.count==="number"?q.count:void 0,Y=Array.isArray(q.rules)?q.rules.length:void 0,J=Buffer.byteLength(JSON.stringify($),"utf-8"),Q=U??Y??0;if(Q>Oz1||J>Lz1)throw Error(`Rule list is large (${Q} rules, ${J} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`)}function O0($){return{allowFull:x0($.full)===!0,outputFile:b($.outputFile)??b($["output-file"])}}function pW0(){console.log(`seal-use CLI
`}function Zw($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function v0($,I={}){mw1($,I);let q=`${JSON.stringify($,null,2)}
`;if(I.outputFile){pw1(I.outputFile,q),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(q,"utf-8")},null,2));return}console.log(q.trimEnd())}function mw1($,I={}){if(I.allowFull||I.outputFile)return;let q=Buffer.byteLength(JSON.stringify($),"utf-8");if(q>lw1)throw Error(`Output is large (${q} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function wZ0($,I){if(I)return;let q=$&&typeof $==="object"?$:{},U=typeof q.count==="number"?q.count:void 0,Y=Array.isArray(q.rules)?q.rules.length:void 0,J=Buffer.byteLength(JSON.stringify($),"utf-8"),Q=U??Y??0;if(Q>cw1||J>dw1)throw Error(`Rule list is large (${Q} rules, ${J} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`)}function O0($){return{allowFull:C0($.full)===!0,outputFile:x($.outputFile)??x($["output-file"])}}function zZ0(){console.log(`seal-use CLI
Usage:
seal-use version
@@ -397,6 +398,7 @@ Usage:
seal-use approval-runs cited-rules <recordId> [--corp <corpId>]
seal-use approval-runs document-summary <recordId> [--corp <corpId>]
seal-use approval-runs attachments <recordId> [--summary] [--corp <corpId>]
seal-use approval-runs attachments download <recordId> [--all] [--name <name>] [--out-dir <dir>] [--corp <corpId>]
seal-use approval-runs result <recordId> [--summary] [--corp <corpId>]
seal-use approval-runs url [--corp <corpId>]
seal-use approval-runs url <recordId> [--corp <corpId>]
@@ -414,12 +416,12 @@ Usage:
seal-use simulation templates [--corp <corpId>]
seal-use simulation integrations [--corp <corpId>]
seal-use simulation package-upload <材料包.zip> [--corp <corpId>]
`)}function M4($){let I=H8(),q=H6();return zq(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$},S7())}function Vz($=H6()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},lint:$.lint,configFile:Kq()}}async function L0($,I,q,U,Y={}){R0(await LY($,I,q,U),Y)}async function LY($,I,q,U){let Y=zz.find((K)=>K.name===$);if(!Y)throw Error(`Unknown Seal tool: ${$}`);let J=Object.fromEntries(Object.entries(U).filter(([,K])=>K!==void 0)),Q=Y.handler;return Q(I,J,{corp:q})}async function cW0($,I,q,U,Y){if($==="summary"){let J=await LY("seal_approval_runs_summary",q,U,{date:b(Y.options.date),timezone:b(Y.options.timezone),limit:L1(Y.options.limit),startDate:b(Y.options.startDate),endDate:b(Y.options.endDate),status:b(Y.options.status),taskMode:b(Y.options.taskMode),manualApprovalStatus:b(Y.options.manualApprovalStatus),sourceDocumentSN:b(Y.options.sourceDocumentSN),sourceDocumentId:b(Y.options.sourceDocumentId),humanResult:b(Y.options.humanResult),query:b(Y.options.query)});if(J?.matched===0&&J?.total>0)console.error(`提示:在 ${J.date} 未匹配到记录(该企业共有 ${J.total} 条历史记录)。可使用 --date YYYY-MM-DD 指定日期,或运行 seal-use approval-runs list --limit 10 查看最近记录。`);R0(J,O0(Y.options));return}if($==="stats"){await L0("seal_approval_runs_stats",q,U,{since:b(Y.options.since),dedupeBy:b(Y.options.dedupeBy)??b(Y.options["dedupe-by"]),status:b(Y.options.status),sourceSystem:b(Y.options.sourceSystem)??b(Y.options["source-system"]),taskMode:b(Y.options.taskMode)??b(Y.options["task-mode"])},O0(Y.options));return}if($==="count"){await L0("seal_approval_runs_count",q,U,{status:b(Y.options.status),sourceSystem:b(Y.options.sourceSystem)??b(Y.options["source-system"]),taskMode:b(Y.options.taskMode)??b(Y.options["task-mode"]),search:b(Y.options.search)??b(Y.options.query)},O0(Y.options));return}if($==="search"||$==="list"){await L0("seal_approval_runs_search",q,U,{limit:L1(Y.options.limit),offset:L1(Y.options.offset),startDate:b(Y.options.startDate),endDate:b(Y.options.endDate),status:b(Y.options.status),taskMode:b(Y.options.taskMode),manualApprovalStatus:b(Y.options.manualApprovalStatus),sourceDocumentSN:b(Y.options.sourceDocumentSN),sourceDocumentId:b(Y.options.sourceDocumentId),humanResult:b(Y.options.humanResult),query:b(Y.options.query),includeBridge:x0(Y.options.includeBridge)},O0(Y.options));return}if($==="bridge"){await L0("seal_approval_run_langfuse_bridge_get",q,U,{recordId:b(Y.options.recordId),sourceDocumentSN:b(Y.options.sourceDocumentSN),sourceDocumentId:b(Y.options.sourceDocumentId),simulationBatchId:b(Y.options.simulationBatchId),limit:L1(Y.options.limit)},O0(Y.options));return}if($==="pick"){let J=I??b(Y.options.query)??b(Y.options.sn);if(!J)throw Error("Usage: seal-use approval-runs pick --sn <documentSN>");await L0("seal_approval_run_pick",q,U,{query:J,sn:b(Y.options.sn),batchId:b(Y.options.batch)??b(Y.options.batchId),latest:x0(Y.options.latest),fields:b(Y.options.fields),limit:L1(Y.options.limit),includeBridge:x0(Y.options.includeBridge)},O0(Y.options));return}if($==="get"){let J=Y.command[2];if(!J)throw Error("Missing approval run recordId");await L0("seal_approval_run_get",q,U,{recordId:J,fields:b(Y.options.fields),summary:x0(Y.options.summary)},O0(Y.options));return}if($==="cited-rules"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs cited-rules <recordId>");await L0("seal_approval_run_cited_rules_get",q,U,{recordId:J},O0(Y.options));return}if($==="document-summary"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs document-summary <recordId>");await L0("seal_approval_run_document_summary_get",q,U,{recordId:J},O0(Y.options));return}if($==="attachments"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs attachments <recordId>");await L0("seal_approval_run_attachments_get",q,U,{recordId:J,summary:x0(Y.options.summary)},O0(Y.options));return}if($==="result"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs result <recordId> [--summary]");await L0("seal_approval_run_result_get",q,U,{recordId:J,summary:x0(Y.options.summary)},O0(Y.options));return}if($==="url"){await L0("seal_approval_run_url_get",q,U,{recordId:I,sourceDocumentSN:b(Y.options.sourceDocumentSN),sourceDocumentId:b(Y.options.sourceDocumentId)},O0(Y.options));return}throw Error(`Unknown approval-runs command: ${$??""}. Run 'seal-use help' for available commands.`)}async function mW0($,I,q){if($==="diagnose"){R0(await Mz1(I));return}if($==="hose-link"){let U=L1(q.options.expire)??7200;R0(await sc(I,U));return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function Mz1($){if($.source.type!=="hose"){let X=await I4($),D=await W8(X);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:D.user,tenant:D.tenant}]}}FH($.id);let I=$.source, Line truncated
`)}function O4($){let I=V8(),q=V6();return Gq(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$},u7())}function Xw($=V6()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},lint:$.lint,configFile:zq()}}async function L0($,I,q,U,Y={}){v0(await p8($,I,q,U),Y)}async function p8($,I,q,U){let Y=Gw.find((K)=>K.name===$);if(!Y)throw Error(`Unknown Seal tool: ${$}`);let J=Object.fromEntries(Object.entries(U).filter(([,K])=>K!==void 0)),Q=Y.handler;return Q(I,J,{corp:q})}async function GZ0($,I,q,U,Y){if($==="summary"){let J=await p8("seal_approval_runs_summary",q,U,{date:x(Y.options.date),timezone:x(Y.options.timezone),limit:e0(Y.options.limit),startDate:x(Y.options.startDate),endDate:x(Y.options.endDate),status:x(Y.options.status),taskMode:x(Y.options.taskMode),manualApprovalStatus:x(Y.options.manualApprovalStatus),sourceDocumentSN:x(Y.options.sourceDocumentSN),sourceDocumentId:x(Y.options.sourceDocumentId),humanResult:x(Y.options.humanResult),query:x(Y.options.query)});if(J?.matched===0&&J?.total>0)console.error(`提示:在 ${J.date} 未匹配到记录(该企业共有 ${J.total} 条历史记录)。可使用 --date YYYY-MM-DD 指定日期,或运行 seal-use approval-runs list --limit 10 查看最近记录。`);v0(J,O0(Y.options));return}if($==="stats"){await L0("seal_approval_runs_stats",q,U,{since:x(Y.options.since),dedupeBy:x(Y.options.dedupeBy)??x(Y.options["dedupe-by"]),status:x(Y.options.status),sourceSystem:x(Y.options.sourceSystem)??x(Y.options["source-system"]),taskMode:x(Y.options.taskMode)??x(Y.options["task-mode"])},O0(Y.options));return}if($==="count"){await L0("seal_approval_runs_count",q,U,{status:x(Y.options.status),sourceSystem:x(Y.options.sourceSystem)??x(Y.options["source-system"]),taskMode:x(Y.options.taskMode)??x(Y.options["task-mode"]),search:x(Y.options.search)??x(Y.options.query)},O0(Y.options));return}if($==="search"||$==="list"){await L0("seal_approval_runs_search",q,U,{limit:e0(Y.options.limit),offset:e0(Y.options.offset),startDate:x(Y.options.startDate),endDate:x(Y.options.endDate),status:x(Y.options.status),taskMode:x(Y.options.taskMode),manualApprovalStatus:x(Y.options.manualApprovalStatus),sourceDocumentSN:x(Y.options.sourceDocumentSN),sourceDocumentId:x(Y.options.sourceDocumentId),humanResult:x(Y.options.humanResult),query:x(Y.options.query),includeBridge:C0(Y.options.includeBridge)},O0(Y.options));return}if($==="bridge"){await L0("seal_approval_run_langfuse_bridge_get",q,U,{recordId:x(Y.options.recordId),sourceDocumentSN:x(Y.options.sourceDocumentSN),sourceDocumentId:x(Y.options.sourceDocumentId),simulationBatchId:x(Y.options.simulationBatchId),limit:e0(Y.options.limit)},O0(Y.options));return}if($==="pick"){let J=I??x(Y.options.query)??x(Y.options.sn);if(!J)throw Error("Usage: seal-use approval-runs pick --sn <documentSN>");await L0("seal_approval_run_pick",q,U,{query:J,sn:x(Y.options.sn),batchId:x(Y.options.batch)??x(Y.options.batchId),latest:C0(Y.options.latest),fields:x(Y.options.fields),limit:e0(Y.options.limit),includeBridge:C0(Y.options.includeBridge)},O0(Y.options));return}if($==="get"){let J=Y.command[2];if(!J)throw Error("Missing approval run recordId");await L0("seal_approval_run_get",q,U,{recordId:J,fields:x(Y.options.fields),summary:C0(Y.options.summary)},O0(Y.options));return}if($==="cited-rules"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs cited-rules <recordId>");await L0("seal_approval_run_cited_rules_get",q,U,{recordId:J},O0(Y.options));return}if($==="document-summary"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs document-summary <recordId>");await L0("seal_approval_run_document_summary_get",q,U,{recordId:J},O0(Y.options));return}if($==="attachments"){if(Y.command[2]==="download"){let K=Y.command[3];if(!K)throw Error("Usage: seal-use approval-runs attachments download <recordId> [--all] [--name <name>] [--out-dir <dir>]");let w=await p8("seal_approval_run_attachments_download",q,U,{recordId:K,all:C0(Y.options.all),name:x(Y.options.name),outDir:x(Y.options["out-dir"])??x(Y.options.outDir)??x(Y.options.dir)});if(v0(w,O0(Y.options)),w?.total>0&&w?.downloaded===0)throw Error(`所有 ${w.total} 个附件下载均失败。`);return}let Q=Y.command[2];if(!Q)throw Error("Usage: seal-use approval-runs attachments <recordId> | seal-use approval-runs attachments download <recordId>");if(C0(Y.options.download)){let K=await p8("seal_approval_run_attachments_download",q,U,{recordId:Q,all:C0(Y.options.all)??!0,name:x(Y.options.name),outDir:x(Y.options["out-dir"])??x(Y.options.outDir)??x(Y.options.dir)});if(v0(K,O0(Y.options)),K?.total>0&&K?.downloaded===0)throw Error(`所有 ${K.total} 个附件下载均失败。`);return}await L0("seal_approval_run_attachments_get",q,U,{recordId:Q,summary:C0(Y.options.summary)},O0(Y.options));return}if($==="download"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs download <reco Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${S.length} candidate administrators:
- ${t}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!D)if(!G&&J)D=J;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let O=b1($,"id")??W,N=V??W,T=b1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,P={id:O,name:N,seal:{url:T,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:H,appKey:q,appSecurity:U,corpId:W,staffId:D},auth:{refreshTtl:300}};if(G)FH(O),await NY(P);let g=GT();$Z0(g,{recursive:!0,mode:448});let B=qZ0(g,`${ay(O)}.json`);if(eW0(B)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${B}. Pass "overwrite": true to replace it.`);IZ0(B,`${JSON.stringify(P,null,2)}
`,{mode:384}),R0({id:O,name:N,corpId:W,domain:H,staffId:D,verified:G,path:B})}async function Ez1($){let I=W7($,"token"),q=(b1($,"sealUrl")??b1($,"url")??"").replace(/\/+$/,"");if(!q)throw Error("Missing required JSON field: sealUrl");let U=uW0($,"expiresIn")??2592000,Y=$.force===!0||$.verify===!1?!1:!0,J=Y?await vz1(q,I):void 0;YZ0($,{token:I,sealUrl:q,expiresIn:U,verify:Y,remote:J})}async function Bz1($,I,q){let U=await MH($),Y=UQ(U.sealUrl,U.token),J=await W8(Y),Q={user:J.user,tenant:J.tenant};AH(U.corpId,Q.tenant),YZ0({id:U.corpId,corpId:U.corpId,name:I,provider:"hosecloud",overwrite:q},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:Q})}function YZ0($,I){let{token:q,sealUrl:U,expiresIn:Y,verify:J,remote:Q}=I,K=Q?.user,z=Q?.tenant,w=b1($,"tenantSlug")??Z7(z?.tenantSlug),G=b1($,"tenantId")??Z7(z?.id),H=b1($,"tenantName")??Z7(z?.name),W=b1($,"id")??w??G;if(!W)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=b1($,"staffId")??Z7(K?.providerUserId)??Z7(K?.id)??"seal",X=b1($,"provider")??Z7(K?.provider)??Z7(z?.providerConfig?.provider),D=b1($,"corpId")??w??G??W,O={id:W,name:b1($,"name")??H??W,seal:{url:U,tenantSlug:w,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:q,sealUrl:U,expiresIn:Y,staffId:V,corpId:D,tenantId:G,tenantSlug:w,tenantName:H,providerUserId:Z7(K?.providerUserId),provider:X},auth:{refreshTtl:300}},N=GT();$Z0(N,{recursive:!0,mode:448});let T=qZ0(N,`${ay(W)}.json`);if(eW0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);IZ0(T,`${JSON.stringify(O,null,2)}
`,{mode:384}),R0({id:W,name:O.name,tenantId:G,tenantSlug:w,verified:J,path:T})}async function vz1($,I){let q=await Rz1(`${$}/api/v1/auth/me`,{authorization:`Bearer ${I}`}),U=KO(q.data);return{user:KO(U.user??q.user),tenant:KO(U.tenant??q.tenant)}}async function Rz1($,I={}){let q=await fetch($,{headers:I}),U=await q.text();if(!q.ok)throw Error(`${q.status} ${U}`);let Y=JSON.parse(U);return KO(Y)}function KO($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function Z7($){return typeof $==="string"&&$?$:void 0}async function JZ0($,I){let q=await MH($),U=UQ(q.sealUrl,q.token),Y=await W8(U);AH(q.corpId,Y.tenant);let J=await wq(U,{note:I});R0({tenant:{id:Y.tenant.id,name:Y.tenant.name,tenantSlug:Y.tenant.tenantSlug,corpId:q.corpId},user:{id:Y.user.id,name:Y.user.name,providerUserId:Y.user.providerUserId,isAdmin:Y.user.isAdmin},delegation:J,expiresIn:q.expiresIn})}async function QZ0($,I,q,U,Y){if($==="list"){await L0("seal_delegation_list",q,U,{},O0(Y.options));return}if($==="create"){let J=b(Y.options.note)??(I?[I,...Y.command.slice(2)].join(" "):void 0);await L0("seal_delegation_create",q,U,{note:J},O0(Y.options));return}if($==="revoke"){let J=I??b(Y.options.tokenId);if(!J)throw Error("Usage: seal-use delegation revoke <tokenId>");await L0("seal_delegation_revoke",q,U,{tokenId:J},O0(Y.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as Cz1}from"node:fs";async function KZ0($,I,q,U,Y,J){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(!D)if(!G&&J)D=J;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let O=i1($,"id")??V,N=W??V,T=i1($,"sealUrl")??`https://${V.toLowerCase()}.sealai.cc`,P={id:O,name:N,seal:{url:T,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:H,appKey:q,appSecurity:U,corpId:V,staffId:D},auth:{refreshTtl:300}};if(G)PH(O),await FY(P);let g=NT();FZ0(g,{recursive:!0,mode:448});let B=AZ0(g,`${Gu(O)}.json`);if(NZ0(B)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${B}. Pass "overwrite": true to replace it.`);MZ0(B,`${JSON.stringify(P,null,2)}
`,{mode:384}),v0({id:O,name:N,corpId:V,domain:H,staffId:D,verified:G,path:B})}async function $z1($){let I=X7($,"token"),q=(i1($,"sealUrl")??i1($,"url")??"").replace(/\/+$/,"");if(!q)throw Error("Missing required JSON field: sealUrl");let U=qZ0($,"expiresIn")??2592000,Y=$.force===!0||$.verify===!1?!1:!0,J=Y?await qz1(q,I):void 0;PZ0($,{token:I,sealUrl:q,expiresIn:U,verify:Y,remote:J})}async function Iz1($,I,q){let U=await TH($),Y=JQ(U.sealUrl,U.token),J=await Z8(Y),Q={user:J.user,tenant:J.tenant};EH(U.corpId,Q.tenant),PZ0({id:U.corpId,corpId:U.corpId,name:I,provider:"hosecloud",overwrite:q},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:Q})}function PZ0($,I){let{token:q,sealUrl:U,expiresIn:Y,verify:J,remote:Q}=I,K=Q?.user,w=Q?.tenant,z=i1($,"tenantSlug")??D7(w?.tenantSlug),G=i1($,"tenantId")??D7(w?.id),H=i1($,"tenantName")??D7(w?.name),V=i1($,"id")??z??G;if(!V)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let W=i1($,"staffId")??D7(K?.providerUserId)??D7(K?.id)??"seal",X=i1($,"provider")??D7(K?.provider)??D7(w?.providerConfig?.provider),D=i1($,"corpId")??z??G??V,O={id:V,name:i1($,"name")??H??V,seal:{url:U,tenantSlug:z,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:q,sealUrl:U,expiresIn:Y,staffId:W,corpId:D,tenantId:G,tenantSlug:z,tenantName:H,providerUserId:D7(K?.providerUserId),provider:X},auth:{refreshTtl:300}},N=NT();FZ0(N,{recursive:!0,mode:448});let T=AZ0(N,`${Gu(V)}.json`);if(NZ0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);MZ0(T,`${JSON.stringify(O,null,2)}
`,{mode:384}),v0({id:V,name:O.name,tenantId:G,tenantSlug:z,verified:J,path:T})}async function qz1($,I){let q=await Uz1(`${$}/api/v1/auth/me`,{authorization:`Bearer ${I}`}),U=WO(q.data);return{user:WO(U.user??q.user),tenant:WO(U.tenant??q.tenant)}}async function Uz1($,I={}){let q=await fetch($,{headers:I}),U=await q.text();if(!q.ok)throw Error(`${q.status} ${U}`);let Y=JSON.parse(U);return WO(Y)}function WO($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function D7($){return typeof $==="string"&&$?$:void 0}async function TZ0($,I){let q=await TH($),U=JQ(q.sealUrl,q.token),Y=await Z8(U);EH(q.corpId,Y.tenant);let J=await Hq(U,{note:I});v0({tenant:{id:Y.tenant.id,name:Y.tenant.name,tenantSlug:Y.tenant.tenantSlug,corpId:q.corpId},user:{id:Y.user.id,name:Y.user.name,providerUserId:Y.user.providerUserId,isAdmin:Y.user.isAdmin},delegation:J,expiresIn:q.expiresIn})}async function EZ0($,I,q,U,Y){if($==="list"){await L0("seal_delegation_list",q,U,{},O0(Y.options));return}if($==="create"){let J=x(Y.options.note)??(I?[I,...Y.command.slice(2)].join(" "):void 0);await L0("seal_delegation_create",q,U,{note:J},O0(Y.options));return}if($==="revoke"){let J=I??x(Y.options.tokenId);if(!J)throw Error("Usage: seal-use delegation revoke <tokenId>");await L0("seal_delegation_revoke",q,U,{tokenId:J},O0(Y.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as Yz1}from"node:fs";async function jZ0($,I,q,U,Y,J){if(!$||$==="help")throw Error(`Usage: seal-use deploy <system> <action> [options]
`+`支持的审批系统与发布目标:
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
@@ -427,25 +429,25 @@ 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 w=$==="maycur"?"每刻报销":"汇联易";throw Error(`${w}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${w}' --result-url <url> --corp <corpId>`)}let Q=$==="hosecloud",K=$==="hosecloud"?I:$,z=$==="hosecloud"?q:I;if(!Q)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(K==="requirements"){await L0("seal_deploy_hosecloud_requirements",U,Y,{},O0(J.options));return}if(K==="list"){await L0("seal_deploy_hosecloud_list",U,Y,{},O0(J.options));return}if(K==="get"){let w=z??b(J.options.signKey)??b(J.options["sign-key"]);if(!w){let H=((await Q4(U)).integrations??[]).filter((W)=>W.type==="hosecloud");if(H.length===0)throw Error(`当前企业 (${Y.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 z=$==="maycur"?"每刻报销":"汇联易";throw Error(`${z}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${z}' --result-url <url> --corp <corpId>`)}let Q=$==="hosecloud",K=$==="hosecloud"?I:$,w=$==="hosecloud"?q:I;if(!Q)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(K==="requirements"){await L0("seal_deploy_hosecloud_requirements",U,Y,{},O0(J.options));return}if(K==="list"){await L0("seal_deploy_hosecloud_list",U,Y,{},O0(J.options));return}if(K==="get"){let z=w??x(J.options.signKey)??x(J.options["sign-key"]);if(!z){let H=((await K4(U)).integrations??[]).filter((V)=>V.type==="hosecloud");if(H.length===0)throw Error(`当前企业 (${Y.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Y.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${Y.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let W of H){let V=W.outboundName??"SealAI 审批",X=W.signKey,D=W.apiOrigin??"production";console.error(` • "${V}" (signKey: ${X}, 环境: ${D})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${X} --corp ${Y.id}
`)}throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。")}await L0("seal_deploy_hosecloud_get",U,Y,{signKey:w},O0(J.options));return}if(K==="status"){await L0("seal_deploy_hosecloud_status",U,Y,{},O0(J.options));return}if(K==="configure"){let w=b(J.options.input),G=w?JSON.parse(Cz1(w,"utf8")):r6(J.json);if(!G||Object.keys(G).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await L0("seal_deploy_hosecloud_configure",U,Y,G,O0(J.options));return}if(K==="sync"){let w=z??b(J.options.signKey)??b(J.options["sign-key"]),G=x0(J.options.auto)??x0(J.options.yes);if(!w){let W=((await Q4(U)).integrations??[]).filter((X)=>X.type==="hosecloud");if(W.length===0)throw Error(`当前企业 (${Y.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Y.id}`);let V=W[0];if(V&&W.length===1&&G){let X=V.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${X})`),await L0("seal_deploy_hosecloud_sync",U,Y,{signKey:X},O0(J.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${Y.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of W){let D=X.outboundName??"SealAI 审批",O=X.signKey,N=X.apiOrigin??"production";console.error(` • "${D}" (signKey: ${O}, 环境: ${N})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${O} --corp ${Y.id}
`)}if(W.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${Y.id}
`);throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。")}await L0("seal_deploy_hosecloud_sync",U,Y,{signKey:w},O0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}import{createServer as uz1}from"node:http";import{URL as hz1}from"node:url";var zZ0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.6",description:`Planned HTTP contract for the seal-use wrapped backend API.
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let V of H){let W=V.outboundName??"SealAI 审批",X=V.signKey,D=V.apiOrigin??"production";console.error(` • "${W}" (signKey: ${X}, 环境: ${D})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${X} --corp ${Y.id}
`)}throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。")}await L0("seal_deploy_hosecloud_get",U,Y,{signKey:z},O0(J.options));return}if(K==="status"){await L0("seal_deploy_hosecloud_status",U,Y,{},O0(J.options));return}if(K==="configure"){let z=x(J.options.input),G=z?JSON.parse(Yz1(z,"utf8")):t6(J.json);if(!G||Object.keys(G).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await L0("seal_deploy_hosecloud_configure",U,Y,G,O0(J.options));return}if(K==="sync"){let z=w??x(J.options.signKey)??x(J.options["sign-key"]),G=C0(J.options.auto)??C0(J.options.yes);if(!z){let V=((await K4(U)).integrations??[]).filter((X)=>X.type==="hosecloud");if(V.length===0)throw Error(`当前企业 (${Y.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Y.id}`);let W=V[0];if(W&&V.length===1&&G){let X=W.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${X})`),await L0("seal_deploy_hosecloud_sync",U,Y,{signKey:X},O0(J.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${Y.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of V){let D=X.outboundName??"SealAI 审批",O=X.signKey,N=X.apiOrigin??"production";console.error(` • "${D}" (signKey: ${O}, 环境: ${N})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${O} --corp ${Y.id}
`)}if(V.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${Y.id}
`);throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。")}await L0("seal_deploy_hosecloud_sync",U,Y,{signKey:z},O0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}import{createServer as zz1}from"node:http";import{URL as Qz1}from"node:url";var BZ0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.8",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${a0})</title>
<title>Seal Home API Docs (v${t0})</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 {
@@ -464,20 +466,21 @@ 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 u4($,I,q,U){let Y=$.handler;return Y(I,q,{corp:U})}async function GZ0($,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 q=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",Y=new hz1($.url||"/",`${U}://${q}`),J=Y.pathname.replace(/\/+$/,"")||"/",Q=($.method||"GET").toUpperCase();try{if(Q==="GET"&&J==="/"){e1(I,200,{name:"seal-use",version:a0,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(Q==="GET"&&J==="/docs"){yz1(I,200,wZ0());return}if(Q==="GET"&&J==="/openapi.json"){e1(I,200,zO());return}if(Q==="GET"&&J==="/health"){e1(I,200,{status:"ok",version:a0,name:"seal-use",timestamp:new Date().toISOString()});return}if(Q==="POST"&&J==="/api/cli"){let K=await GO($),z=(typeof K?.command==="string"?K.command:"").trim();if(!z){wO(I,400,"Missing 'command' property in request body");return}let w=Uu(z),G=w[0]==="seal-use"||w[0]==="seal-home"||w[0]?.endsWith("/seal-use")||w[0]?.endsWith("/seal-home")?w.slice(1):w,H=await Zz(G),W=void 0;try{if(H.stdout.trim().startsWith("{")||H.stdout.trim().startsWith("["))W=JSON.parse(H.stdout)}catch{}e1(I,H.isError?400:200,{success:!H.isError,stdout:H.stdout,stderr:H.stderr,exitCode:H.exitCode,data:W});return}if(Q==="POST"&&J.startsWith("/api/tool/")){let K=J.slice(10).trim(),z=B4(K,{includeMcpAliases:!0});if(!z){wO(I,404,`Tool not found: '${K}'`);return}let w=await GO($)||{},G=_6($,Y,w),H=M4(G),W=await I4(H),V={...w};delete V.corp;let X=await u4(z,W,V,H);e1(I,200,X);return}if(J.startsWith("/v1/")){if(await Sz1($,I,Q,J,Y))return}wO(I,404,`Cannot ${Q} ${J}. Visit /docs for available endpoints.`)}catch(K){let z=K instanceof Error?K.message:String(K);wO(I,500,z)}}async function Sz1($,I,q,U,Y){let J=Object.fromEntries(Y.searchParams.entries());if(q==="GET"&&U==="/v1/corps"){let Q=H8(),K=H6();return e1(I,200,{count:Q.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:Q.map((z)=>({id:z.id,name:z.name,sourceType:z.source.type,sealUrl:z.seal?.url}))}),!0}if(q==="GET"&&U==="/v1/whoami"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_whoami"),G=await u4(w,z,{},K);return e1(I,200,G),!0}if(q==="GET"&&U==="/v1/session"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_session_get"),G=await u4(w,z,{},K);return e1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/summary"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_approval_runs_summary"),G=await u4(w,z,J,K);return e1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/stats"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_approval_runs_stats"),G=await u4(w,z,J,K);return e1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/pick"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_approval_run_pick"),G=await u4(w,z,J,K);return e1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/url"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_approval_run_url_get"),G=await u4(w,z,J,K);return e1(I,200,G),!0}if(U.startsWith("/v1/approval-runs/")){let Q=U.slice(18).split("/"),K=Q[0],z=Q[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let w=_6($,Y,J),G=M4(w),H=await I4(G);if(!z){let W=B4("seal_approval_run_get"),V=await u4(W,H,{recordId:K,...J},G);return e1(I,200,V),!0}if(z==="attachments"){let W=B4("seal_approval_run_attachments_get"),V=await u4(W,H,{recordId:K,...J},G);return e1(I,200,V),!0}if(z==="cited-rules"){let W=B4("seal_approval_run_cited_rules_get"),V=await u4(W,H,{recordId:K,...J},G);return e1(I,200,V),!0}if(z==="document-summary"){let W=B4("seal_approval_run_document_summary_get"),V=await u4(W,H,{recordId:K,...J},G);return e1(I,200,V),!0}if(z==="result"){let W=B4("seal_approval_run_result_get"),V=await u4(W,H,{recordId:K,...J},G);return e1(I,200,V),!0}}}if(q==="GET"&&U==="/v1/approval-runs"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_approval_runs_search"),G=await u4(w,z,{...J,limit:J.limit?Number(J.limit):void 0,offset:J.offset?Number(J.offset):void 0,includeBridge:J.includeBridge==="true"},K);return e1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval/rules"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_approval_rules_list"),G=await u4(w,z,J,K);return e1(I,200,G),!0}if(q==="GET"&&U==="/v1/simulation/batches"){let Q=_6($,Y,J),K=M4(Q),z=await I4(K),w=B4("seal_simulation_batches_list"),G=await u4(w,z,J,K);return e1(I,200,G),!0}if(q==="POST"&&U==="/v1/simulation/create-batch"){let Q=await GO($)||{},K=_6($,Y,Q),z=M4(K),w=await I4(z),G=B4("seal_simulation_batch_create"),H=await u4(G,w,Q,z);return e1(I,200,H),!0}if(q==="GET"&&U.startsWith("/v1/simulation/batch/")){let K=U.slice(21).split("/")[0];if(K){let z=_6($,YLine truncated
\uD83D\uDE80 seal-use HTTP Server (v${a0}) started`),console.error(` URL: http://${q}:${I}`),console.error(` Docs: http://${q}:${I}/docs`),console.error(` OpenAPI: http://${q}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${q}:${I}/api/cli`),console.error(` REST API: http://${q}:${I}/v1/...
`);Y(U)})})}async function VZ0($){let I=L1($.options.port)??L1($.options.p),q=b($.options.host)??b($.options.h),U=await HZ0({port:I,host:q}),Y=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",Y),process.on("SIGTERM",Y),await new Promise(()=>{})}async function WZ0($,I,q,U){if($==="config"||$==="get"){await L0("seal_llm_config_get",I,q,{},O0(U.options));return}if($==="providers"||$==="list"){await L0("seal_llm_providers_list",I,q,{},O0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}async function ZZ0($,I){if($==="config"||$==="json"){Yu();return}await Ju()}function Yu(){R0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function XZ0($){let I=zO();R0(I,{...O0($.options),allowFull:!0})}async function DZ0($,I,q,U){if($==="available"){await L0("seal_permissions_available_list",I,q,{},O0(U.options));return}if($==="configs"||$==="list"){await L0("seal_permissions_configs_list",I,q,{},O0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as OZ0}from"node:fs";async function LZ0($,I,q,U,Y,J,Q){if(!$||$==="get"){await L0("seal_preference_get",Y,J,{},O0(Q.options));return}if($==="decision"){if(I==="update"||!I){let K=b(Q.options.input),z=K?JSON.parse(OZ0(K,"utf8")):r6(Q.json);if(!z||Object.keys(z).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await L0("seal_preference_decision_update",Y,J,z,O0(Q.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let K=b(Q.options.default)??b(Q.options.level)??U;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await L0("seal_preference_thinking_depth_set",Y,J,{defaultLevel:K},O0(Q.options));return}if(I==="policies"){if(q==="list"||!q){await L0("seal_preference_thinking_depth_policies_list",Y,J,{},O0(Q.options));return}if(q==="upsert"){let K=b(Q.options.input),z=K?JSON.parse(OZ0(K,"utf8")):r6(Q.json);if(!z||!z.id||!z.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await L0("seal_preference_thinking_depth_policies_upsert",Y,J,z,O0(Q.options));return}if(q==="remove"||q==="delete"){let K=U??b(Q.options.id)??b(Q.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await L0("seal_preference_thinking_depth_policies_remove",Y,J,{policyId:K},O0(Q.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function NZ0($={}){let I=H8(),q=H6(),U=zq(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$.corpId},S7());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let Y=await NY(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(Y,null,2));let J=await I4(U),Q=await xH(J,{documentLimit:20,stylePreferencesEndpoint:U.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:Q.rules.rules.length,hasPendingRuleDeletes:Q.rules.hasPendingDeletes,documents:Q.documents.articles.length,documentsTotal:Q.documents.total,stylePreferences:Q.stylePreferences.ok?"ok":`error: ${Q.stylePreferences.error}`},null,2))}async function FZ0($,I,q){let U=I??b(q.options.corp)??($&&$!=="--corp"?$:void 0);await NZ0({corpId:U})}async function MZ0($,I,q,U,Y){if($==="count"){await L0("seal_approval_rules_list",q,U,{countOnly:!0},O0(Y.options));return}if($==="list"){if(x0(Y.options.count)){await L0("seal_approval_rules_list",q,U,{countOnly:!0},O0(Y.options));return}let J=L1(Y.options.limit),Q=L1(Y.options.offset);if(x0(Y.options.summary)){await L0("seal_approval_rules_list",q,U,{fields:bW0,limit:J,offset:Q},O0(Y.options));return}let K=await LY("seal_approval_rules_list",q,U,{limit:J,offset:Q});iW0(K,x0(Y.options.full)===!0),R0(K);return}if($==="clear"){let J=x0(Y.options.yes)===!0,Q=x0(Y.options.dryRun)??x0(Y.options["dry-run"])??!J;if(!J&&!Q)throw Error("Refusing to clear rules without --yes. Use --dry-run to preview.");let K=await LY("seal_approval_rules_clear",q,U,{dryRun:Q,recode:x0(Y.options.recode)});if(!J&&Q&&K&&typeof K==="object"){R0({...K,nextCommand:`seal-use rules clear --corp ${U.id} --yes`},O0(Y.options));return}R0(K,O0(Y.options));return}if($==="versions"){await L0("seal_approval_rule_versions_list",q,U,{},O0(Y.options));return}if($==="version"){let J=I??b(Y.options.version);if(!J)throw Error("Usage: seal-use rules version <versionId|versionNumber|latest>");await L0("seal_approval_rule_version_get",q,U,wz(J),O0(Y.options));return}if($==="get"){await L0("seal_approval_rule_get",q,U,{...nW0(b(Y.options.version)),code:b(Y.options.code),runtimeId:b(Y.options.runtimeId)??b(Y.options["runtime-id"]),recordId:b(Y.options Line truncated
`,{mode:384}),VO(q,`running pid=${process.pid}`);let U=()=>{if(Ku(I)===process.pid)HO(I,{force:!0});VO(q,`stopped pid=${process.pid}`)};await new Promise((Y)=>{let J=!1,Q=setInterval(()=>{},60000),K=()=>{if(J)return;J=!0,U(),clearInterval(Q),process.off("SIGTERM",K),process.off("SIGINT",K),Y()};process.once("SIGTERM",K),process.once("SIGINT",K)})}function AZ0($){jZ0($.stateDir);let I=FY($);if(I.running)return I;let q=$.launcher??{command:process.execPath,args:[$.entryFile]},U=xz1(q.command,[...q.args??[],"service","run"],{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=WO($);return Qu(Y,`${U.pid}
`,{mode:384}),VO(ZO($),`started pid=${U.pid}`),{started:!0,...FY($)}}function gZ0($,I={}){let q=WO($),U=Ku(q);if(!U||!TZ0(U,$.appRoot))return HO(q,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),HO(q,{force:!0}),VO(ZO($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function TZ0($,I){if(!pz1($))return!1;try{let q=kz1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(q.includes(I)||q.includes("seal-use")||q.includes("src/cli.ts"))&&q.includes("service")&&q.includes("run")}catch{return!1}}function pz1($){try{return process.kill($,0),!0}catch{return!1}}function WO($){return PZ0($.stateDir,"service.pid")}function ZO($){return PZ0($.stateDir,"service.log")}function Ku($){if(!fz1($))return;let I=Number(bz1($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function jZ0($){nz1($,{recursive:!0,mode:448})}function VO($,I){Qu($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}var zu=dz1(cz1(),".config","seal-use");async function EZ0($,I){let q=await $I($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:zu,version:a0,launcher:I.launcher});if(q!==void 0)R0(q)}import{existsSync as lz1,readFileSync as BZ0}from"node:fs";async function vZ0($,I,q,U,Y){if($==="batch-records"||$==="records"){let J=I??b(Y.options.batchId)??b(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation batch-records <batchId>");await L0("seal_simulation_batch_records_get",q,U,{batchId:J,query:b(Y.options.query)},O0(Y.options));return}if($==="create"||$==="run"){let J=b(Y.options.mode)??b(Y.options.sourceSystem)??b(Y.options["source-system"])??"hosecloud",Q=J==="material-pack"?"material_pack":J,K=b(Y.options.schemaConfig)??b(Y.options["schema-config"]),z=K?JSON.parse(BZ0(K,"utf8")):void 0,w=b(Y.options.input),G=w?JSON.parse(BZ0(w,"utf8")):r6(Y.json),H=b(Y.options.packageId)??b(Y.options["package-id"]),W=N6(Y.options.packageIds)??N6(Y.options["package-ids"])??(H?[H]:void 0),V=N6(Y.options.flowIds)??N6(Y.options["flow-ids"])??N6(Y.options.documentSn)??N6(Y.options["document-sn"]),X=b(Y.options.signKey)??b(Y.options["sign-key"])??b(Y.options.integration);await L0("seal_simulation_batch_create",q,U,{mode:Q,sourceSystem:Q,flowIds:V,documentSn:V,rejectNodeName:b(Y.options.rejectNode)??b(Y.options["reject-node"])??null,thinkingDepthOverride:b(Y.options.thinkingDepth)??b(Y.options["thinking-depth"]),skipInvoiceGeneration:x0(Y.options.skipInvoiceGeneration)??x0(Y.options["skip-invoice-generation"]),skipExpenseExtraction:x0(Y.options.skipExpenseExtraction)??x0(Y.options["skip-expense-extraction"]),disableAttachmentCache:x0(Y.options.disableAttachmentCache)??x0(Y.options["disable-attachment-cache"]),signKey:X,packageIds:W,packageId:H,templateId:b(Y.options.templateId)??b(Y.options["template-id"]),schemaConfig:z,requestIds:N6(Y.options.requestIds)??N6(Y.options["request-ids"]),workflowTypeId:b(Y.options.workflowTypeId)??b(Y.options["workflow-type-id"]),flowStatusList:N6(Y.options.flowStatusList)?.map(Number)??N6(Y.options["flow-status-list"])?.map(Number),businessCodes:N6(Y.options.businessCodes)??N6(Y.options["business-codes"]),documentType:b(Y.options.documentType)??b(Y.options["document-type"]),startTime:L1(Y.options.startTime)??L1(Y.options["start-time"]),endTime:L1(Y.options.endTime)??L1(Y.options["end-time"]),status:N6(Y.options.status),limit:L1(Y.options.limit),rawParams:G},O0(Y.options));return}if($==="wait"){let J=I??b(Y.options.batchId)??b(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await L0("seal_simulation_batch_wait",q,U,{batchId:J,timeout:b(Y.options.timeout),pollInterval:b(Y.options.pollInterval)??b(Y.options["poll-interval"])},O0(Y.options));return}if($==="clean"||$==="delete"){let J=I??b(Y.options.batchId)??b(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation clean <batchId>");await L0("seal_simulation_batch_clean",q,U,{batchId:J},O0(Y.options));return}if($==="specifications"){let J=I??b(Y.options.integration)??b(Y.options.signKey)??b(Y.options["sign-key"]);await L0("seal_simulation_specifications_list",q,U,{signKey:J},O0(Y.options));return}if($==="list"){await L0("seal_simulation_batches_list",q,U,{limit:L1(Y.options.limit)},O0(Y.options));return}if($==="get"){let J=I??b(Y.options.batchId)??b(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation get <batchId>");await L0("seal_simulation_batch_get",q,U,{batchId:J},O0(Y.options));return}if($==="templates"){await L0("seal_simulation_templates_get",q,U,{},O0(Y.options));return}if($==="integrations"){await L0("seal_simulation_integrations_get",q,U,{},O0(Y.options));return}if($==="package-upload"){let J=I??b(Y.options.file);if(!J)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!lz1(J))throw Error(`File not found: ${J}`);await L0("seal_simulation_material_package_upload",q,U,{filePath:J},O0(Y.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as mZ0}from"node:fs";import{join as XO}from"node:path";import{existsSync as wu,mkdirSync as bZ0,rmSync as Yw1,writeFileSync as Jw1}from"node:fs";import{homedir as iZ0}from"node:os";import{dirname as Qw1,join as Gu}from"node:path";var RZ0=`---
</html>`}async function x4($,I,q,U){let Y=$.handler;return Y(I,q,{corp:U})}async function RZ0($,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 q=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",Y=new Qz1($.url||"/",`${U}://${q}`),J=Y.pathname.replace(/\/+$/,"")||"/",Q=($.method||"GET").toUpperCase();try{if(Q==="GET"&&J==="/"){d1(I,200,{name:"seal-use",version:t0,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(Q==="GET"&&J==="/docs"){wz1(I,200,vZ0());return}if(Q==="GET"&&J==="/openapi.json"){d1(I,200,ZO());return}if(Q==="GET"&&J==="/health"){d1(I,200,{status:"ok",version:t0,name:"seal-use",timestamp:new Date().toISOString()});return}if(Q==="POST"&&(J==="/shutdown"||J==="/api/shutdown")){d1(I,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(Q==="POST"&&J==="/api/cli"){let K=await DO($),w=(typeof K?.command==="string"?K.command:"").trim();if(!w){XO(I,400,"Missing 'command' property in request body");return}let z=Du(w),G=z[0]==="seal-use"||z[0]==="seal-home"||z[0]?.endsWith("/seal-use")||z[0]?.endsWith("/seal-home")?z.slice(1):z,H=await Ow(G),V=void 0;try{if(H.stdout.trim().startsWith("{")||H.stdout.trim().startsWith("["))V=JSON.parse(H.stdout)}catch{}d1(I,H.isError?400:200,{success:!H.isError,stdout:H.stdout,stderr:H.stderr,exitCode:H.exitCode,data:V});return}if(Q==="POST"&&J.startsWith("/api/tool/")){let K=J.slice(10).trim(),w=v4(K,{includeMcpAliases:!0});if(!w){XO(I,404,`Tool not found: '${K}'`);return}let z=await DO($)||{},G=h6($,Y,z),H=O4(G),V=await q4(H),W={...z};delete W.corp;let X=await x4(w,V,W,H);d1(I,200,X);return}if(J.startsWith("/v1/")){if(await Kz1($,I,Q,J,Y))return}XO(I,404,`Cannot ${Q} ${J}. Visit /docs for available endpoints.`)}catch(K){let w=K instanceof Error?K.message:String(K);XO(I,500,w)}}async function Kz1($,I,q,U,Y){let J=Object.fromEntries(Y.searchParams.entries());if(q==="GET"&&U==="/v1/corps"){let Q=V8(),K=V6();return d1(I,200,{count:Q.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:Q.map((w)=>({id:w.id,name:w.name,sourceType:w.source.type,sealUrl:w.seal?.url}))}),!0}if(q==="GET"&&U==="/v1/whoami"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_whoami"),G=await x4(z,w,{},K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/session"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_session_get"),G=await x4(z,w,{},K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/summary"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_approval_runs_summary"),G=await x4(z,w,J,K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/stats"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_approval_runs_stats"),G=await x4(z,w,J,K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/pick"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_approval_run_pick"),G=await x4(z,w,J,K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/url"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_approval_run_url_get"),G=await x4(z,w,J,K);return d1(I,200,G),!0}if(U.startsWith("/v1/approval-runs/")){let Q=U.slice(18).split("/"),K=Q[0],w=Q[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let z=h6($,Y,J),G=O4(z),H=await q4(G);if(!w){let V=v4("seal_approval_run_get"),W=await x4(V,H,{recordId:K,...J},G);return d1(I,200,W),!0}if(w==="attachments"){let V=v4("seal_approval_run_attachments_get"),W=await x4(V,H,{recordId:K,...J},G);return d1(I,200,W),!0}if(w==="cited-rules"){let V=v4("seal_approval_run_cited_rules_get"),W=await x4(V,H,{recordId:K,...J},G);return d1(I,200,W),!0}if(w==="document-summary"){let V=v4("seal_approval_run_document_summary_get"),W=await x4(V,H,{recordId:K,...J},G);return d1(I,200,W),!0}if(w==="result"){let V=v4("seal_approval_run_result_get"),W=await x4(V,H,{recordId:K,...J},G);return d1(I,200,W),!0}}}if(q==="GET"&&U==="/v1/approval-runs"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_approval_runs_search"),G=await x4(z,w,{...J,limit:J.limit?Number(J.limit):void 0,offset:J.offset?Number(J.offset):void 0,includeBridge:J.includeBridge==="true"},K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval/rules"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_approval_rules_list"),G=await x4(z,w,J,K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/simulation/batches"){let Q=h6($,Y,J),K=O4(Q),w=await q4(K),z=v4("seal_simulation_batches_list"),G=await x4(z,w,J,K);return d1(I,200,G),!0}if(q==="POST"&&U==="/v1/simulation/create-batch"){let Q=await DO($)||{},K=h6($,Line truncated
\uD83D\uDE80 seal-use HTTP Server (v${t0}) started`),console.error(` URL: http://${q}:${I}`),console.error(` Docs: http://${q}:${I}/docs`),console.error(` OpenAPI: http://${q}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${q}:${I}/api/cli`),console.error(` REST API: http://${q}:${I}/v1/...
`);Y(U)})})}async function CZ0($){let I=e0($.options.port)??e0($.options.p),q=x($.options.host)??x($.options.h),U=await NO({port:I,host:q}),Y=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",Y),process.on("SIGTERM",Y),await new Promise(()=>{})}async function _Z0($,I,q,U){if($==="config"||$==="get"){await L0("seal_llm_config_get",I,q,{},O0(U.options));return}if($==="providers"||$==="list"){await L0("seal_llm_providers_list",I,q,{},O0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}async function hZ0($,I){if($==="config"||$==="json"){Ou();return}await Lu()}function Ou(){v0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function SZ0($){let I=ZO();v0(I,{...O0($.options),allowFull:!0})}async function yZ0($,I,q,U){if($==="available"){await L0("seal_permissions_available_list",I,q,{},O0(U.options));return}if($==="configs"||$==="list"){await L0("seal_permissions_configs_list",I,q,{},O0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as uZ0}from"node:fs";async function xZ0($,I,q,U,Y,J,Q){if(!$||$==="get"){await L0("seal_preference_get",Y,J,{},O0(Q.options));return}if($==="decision"){if(I==="update"||!I){let K=x(Q.options.input),w=K?JSON.parse(uZ0(K,"utf8")):t6(Q.json);if(!w||Object.keys(w).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await L0("seal_preference_decision_update",Y,J,w,O0(Q.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let K=x(Q.options.default)??x(Q.options.level)??U;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await L0("seal_preference_thinking_depth_set",Y,J,{defaultLevel:K},O0(Q.options));return}if(I==="policies"){if(q==="list"||!q){await L0("seal_preference_thinking_depth_policies_list",Y,J,{},O0(Q.options));return}if(q==="upsert"){let K=x(Q.options.input),w=K?JSON.parse(uZ0(K,"utf8")):t6(Q.json);if(!w||!w.id||!w.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await L0("seal_preference_thinking_depth_policies_upsert",Y,J,w,O0(Q.options));return}if(q==="remove"||q==="delete"){let K=U??x(Q.options.id)??x(Q.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await L0("seal_preference_thinking_depth_policies_remove",Y,J,{policyId:K},O0(Q.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function kZ0($={}){let I=V8(),q=V6(),U=Gq(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$.corpId},u7());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let Y=await FY(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(Y,null,2));let J=await q4(U),Q=await bH(J,{documentLimit:20,stylePreferencesEndpoint:U.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:Q.rules.rules.length,hasPendingRuleDeletes:Q.rules.hasPendingDeletes,documents:Q.documents.articles.length,documentsTotal:Q.documents.total,stylePreferences:Q.stylePreferences.ok?"ok":`error: ${Q.stylePreferences.error}`},null,2))}async function fZ0($,I,q){let U=I??x(q.options.corp)??($&&$!=="--corp"?$:void 0);await kZ0({corpId:U})}async function Nu($,I,q,U,Y){if($==="count"){await L0("seal_approval_rules_list",q,U,{countOnly:!0},O0(Y.options));return}if($==="list"){if(C0(Y.options.count)){await L0("seal_approval_rules_list",q,U,{countOnly:!0},O0(Y.options));return}let J=e0(Y.options.limit),Q=e0(Y.options.offset);if(C0(Y.options.summary)){await L0("seal_approval_rules_list",q,U,{fields:KZ0,limit:J,offset:Q},O0(Y.options));return}let K=await p8("seal_approval_rules_list",q,U,{limit:J,offset:Q});wZ0(K,C0(Y.options.full)===!0),v0(K);return}if($==="clear"){let J=C0(Y.options.yes)===!0,Q=C0(Y.options.dryRun)??C0(Y.options["dry-run"])??!J;if(!J&&!Q)throw Error("Refusing to clear rules without --yes. Use --dry-run to preview.");let K=await p8("seal_approval_rules_clear",q,U,{dryRun:Q,recode:C0(Y.options.recode)});if(!J&&Q&&K&&typeof K==="object"){v0({...K,nextCommand:`seal-use rules clear --corp ${U.id} --yes`},O0(Y.options));return}v0(K,O0(Y.options));return}if($==="versions"){await L0("seal_approval_rule_versions_list",q,U,{},O0(Y.options));return}if($==="version"){let J=I??x(Y.options.version);if(!J)throw Error("Usage: seal-use rules version <versionId|versionNumber|latest>");await L0("seal_approval_rule_version_get",q,U,Vw(J),O0(Y.options));return}if($==="get"){await L0("seal_approval_rule_get",q,U,{...QZ0(x(Y.options.version)),code:x(Y.options.code),runtimeId:x(Y.options.runtimeId)??x(Y.options["runtime-id"]),recordId:x(Y.options.r Line truncated
`).filter(Boolean),J=Y.slice(-I);return{logFile:q,lines:J,totalLines:Y.length}}async function Zz1($){let I=gO($),q=Au($),U=Lw($);pZ0($.stateDir);let Y=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):OO),J=$.host??(process.env.HOST?process.env.HOST:LO);MO(I,`${process.pid}
`,{mode:384}),MO(q,JSON.stringify({pid:process.pid,port:Y,host:J,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),MY(U,`service starting on http://${J}:${Y} pid=${process.pid}`);let Q=null;try{Q=await NO({port:Y,host:J,silent:!0}),MY(U,`service listening pid=${process.pid}`)}catch(w){if(MY(U,`service failed to bind port ${Y}: ${w instanceof Error?w.message:String(w)}`),AO(I)===process.pid)c8(I,{force:!0}),c8(q,{force:!0});throw w}let K=()=>{if(Q)Q.close(),Q=null;if(AO(I)===process.pid)c8(I,{force:!0}),c8(q,{force:!0});MY(U,`stopped pid=${process.pid}`)};await new Promise((w)=>{let z=!1,G=()=>{if(z)return;z=!0,K(),process.off("SIGTERM",G),process.off("SIGINT",G),w()};process.once("SIGTERM",G),process.once("SIGINT",G)})}function nZ0($){pZ0($.stateDir);let I=AY($);if(I.running)return I;let q=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...q.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let Y=Gz1(q.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});Y.unref();let J=gO($);return MO(J,`${Y.pid}
`,{mode:384}),MY(Lw($),`started pid=${Y.pid}`),{started:!0,...AY($)}}function iZ0($,I={}){let q=gO($),U=Au($),Y=AO(q);if(!Y||!bZ0(Y,$.appRoot))return c8(q,{force:!0}),c8(U,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(Y,"SIGTERM"),c8(q,{force:!0}),c8(U,{force:!0}),MY(Lw($),`stop requested pid=${Y}`),I.quiet?void 0:{stopped:!0,pid:Y}}function bZ0($,I){if(!Xz1($))return!1;try{let q=Hz1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(q.includes(I)||q.includes("seal-use")||q.includes("src/cli.ts"))&&q.includes("service")&&q.includes("run")}catch{return!1}}function Xz1($){try{return process.kill($,0),!0}catch{return!1}}function gO($){return Mu($.stateDir,"service.pid")}function Au($){return Mu($.stateDir,"service.json")}function Lw($){return Mu($.stateDir,"service.log")}function AO($){if(!FO($))return;let I=Number(Fu($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function pZ0($){Vz1($,{recursive:!0,mode:448})}function MY($,I){MO($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}var gu=Oz1(Dz1(),".config","seal-use");async function Pu($,I,q){let U=q?e0(q.options.port)??e0(q.options.p):void 0,Y=q?x(q.options.host)??x(q.options.h):void 0,J=q?e0(q.options.lines)??e0(q.options.n):void 0,Q=await qI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:gu,version:t0,launcher:I.launcher,port:U,host:Y},{maxLines:J});if(Q!==void 0)v0(Q)}import{existsSync as Lz1,readFileSync as cZ0}from"node:fs";async function dZ0($,I,q,U,Y){if($==="batch-records"||$==="records"){let J=I??x(Y.options.batchId)??x(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation batch-records <batchId>");await L0("seal_simulation_batch_records_get",q,U,{batchId:J,query:x(Y.options.query)},O0(Y.options));return}if($==="create"||$==="run"){let J=x(Y.options.mode)??x(Y.options.sourceSystem)??x(Y.options["source-system"])??"hosecloud",Q=J==="material-pack"?"material_pack":J,K=x(Y.options.schemaConfig)??x(Y.options["schema-config"]),w=K?JSON.parse(cZ0(K,"utf8")):void 0,z=x(Y.options.input),G=z?JSON.parse(cZ0(z,"utf8")):t6(Y.json),H=x(Y.options.packageId)??x(Y.options["package-id"]),V=F6(Y.options.packageIds)??F6(Y.options["package-ids"])??(H?[H]:void 0),W=F6(Y.options.flowIds)??F6(Y.options["flow-ids"])??F6(Y.options.documentSn)??F6(Y.options["document-sn"]),X=x(Y.options.signKey)??x(Y.options["sign-key"])??x(Y.options.integration);await L0("seal_simulation_batch_create",q,U,{mode:Q,sourceSystem:Q,flowIds:W,documentSn:W,rejectNodeName:x(Y.options.rejectNode)??x(Y.options["reject-node"])??null,thinkingDepthOverride:x(Y.options.thinkingDepth)??x(Y.options["thinking-depth"]),skipInvoiceGeneration:C0(Y.options.skipInvoiceGeneration)??C0(Y.options["skip-invoice-generation"]),skipExpenseExtraction:C0(Y.options.skipExpenseExtraction)??C0(Y.options["skip-expense-extraction"]),disableAttachmentCache:C0(Y.options.disableAttachmentCache)??C0(Y.options["disable-attachment-cache"]),signKey:X,packageIds:V,packageId:H,templateId:x(Y.options.templateId)??x(Y.options["template-id"]),schemaConfig:w,requestIds:F6(Y.options.requestIds)??F6(Y.options["request-ids"]),workflowTypeId:x(Y.options.workflowTypeId)??x(Y.options["workflow-type-id"]),flowStatusList:F6(Y.options.flowStatusList)?.map(Number)??F6(Y.options["flow-status-list"])?.map(Number),businessCodes:F6(Y.options.businessCodes)??F6(Y.options["business-codes"]),documentType:x(Y.options.documentType)??x(Y.options["document-type"]),startTime:e0(Y.options.startTime)??e0(Y.options["start-time"]),endTime:e0(Y.options.endTime)??e0(Y.options["end-time"]),status:F6(Y.options.status),limit:e0(Y.options.limit),rawParams:G},O0(Y.options));return}if($==="wait"){let J=I??x(Y.options.batchId)??x(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await L0("seal_simulation_batch_wait",q,U,{batchId:J,timeout:x(Y.options.timeout),pollInterval:x(Y.options.pollInterval)??x(Y.options["poll-interval"])},O0(Y.options));return}if($==="clean"||$==="delete"){let J=I??x(Y.options.batchId)??x(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation clean <batchId>");await L0("seal_simulation_batch_clean",q,U,{batchId:J},O0(Y.options));return}if($==="specifications"){let J=I??x(Y.options.integration)??x(Y.options.signKey)??x(Y.options["sign-key"]);await L0("seal_simulation_specifications_list",q,U,{signKey:J},O0(Y.options));return}if($==="list"){await L0("seal_simulation_batches_list",q,U,{limit:e0(Y.options.limit)},O0(Y.options));return}if($==="get"){let J=I??x(Y.options.batchId)??x(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation get <batchId>");await L0("seal_simulation_batch_get",q,U,{batchId:J},O0(Y.options));return}if($==="templates"){await L0("seal_simulation_templates_get",q,U,{},O0(Y.options));return}if($==="integrations"){await L0("seal_simulation_integrations_get",q,U,{},O0(Y.options));return}if($==="package-upload"){let J=I??x(Y.options.file);if(!J)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!Lz1(J))throw Error(`File not found: ${J}`);await L0("seal_simulation_material_package_upload",q,U,{filePath:J},O0(Y.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as zX0}from"node:fs";import{join as PO}from"node:path";import{existsSync as Tu,mkdirSync as UX0,rmSync as Rz1,writeFileSync as Cz1}from"node:fs";import{homedir as YX0}from"node:os";import{dirname as _z1,join as Eu}from"node:path";var lZ0=`---
name: seal-use
description: "v0.10.6: 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."
description: "v0.10.8: 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:
version: 0.10.6
short-description: Seal tenant and Hose approval automation (v0.10.6)
version: 0.10.8
short-description: Seal tenant and Hose approval automation (v0.10.8)
---
# Seal Use (v0.10.6)
# Seal Use (v0.10.8)
Use the \`seal_cli\` MCP tool when it is available; pass the command string as its \`command\` argument. If MCP is unavailable, fall back to the global \`seal-use\` CLI. This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
@@ -597,11 +600,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 CZ0=`interface:
`;var mZ0=`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 _Z0=`# Rule Lightweight Queries
`;var oZ0=`# 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.
@@ -706,7 +709,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 hZ0=`# Approval Bad Case Catalog
`;var rZ0=`# 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.
@@ -756,7 +759,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 SZ0="# 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 `./enterprises` and `~/.config/seal-use/enterprises` are merged.\n- User-level configs override same-ID local configs.\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** (e.g. `👉 Next action: ...`).\n- **`Exit Code`**: `0` on success, non-zero (e.g. `1`) on failure to trigger Agent error self-remediation.\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 lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules lint [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use service <start|stop|restart|status>\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update\nseal-use tools list\nseal-use corps list [--corp <corpId>]\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\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 reset-password <userId> [--corp <corpId>]\nseal-use users get <userId> [--corp <corpId>]\nseal-use users delete <userId> [--corp <corpId>]\nseal-use llm config [--corp <corpId>]\nseal-use llm providers [--corp <corpId>]\nseal-use permissions available [--corp <corpId>]\nseal-use permissions configs [--corp <corpId>]\nseal-use billing status [--corp <corpId>]\nseal-use billing plans [--corp <corpId>]\nseal-use billing features [--corp <corpId>]\nseal-use webhook list [--query <text>] [--show-secret] [--corp <corpId>]\nseal-use webhook get|find <idOrName> [--show-secret] [--corp <corpId>]\nseal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]\nseal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]\nseal-use webhook delete <idOrName> --yes [--corp <corpId>]\nseal-use deploy hosecloud requirements [--corp <corpId>]\nseal-use deploy hosecloud list [--corp <corpId>]\nseal-use deploy hosecloud get [<sign-key>] [--corp <corpId>]\nseal-use deploy hosecloud status [--corp <corpId>]\nseal-use deploy hosecloud configure --json '{...}' [--corp <corpId>]\nseal-use deploy hosecloud sync [<sign-key>] [--auto] [--corp <corpId>]\nseal-use preference get [--corp <corpId>]\nseal-use preference decision update --json '{\"explicitApprove\":\"...\"}' [--corp <corpId>]\nseal-use preference thinking-depth set --default <medium|high> [--corp <corpId>]\nseal-use preference thinking-depth policies list [--corp <corpId>]\nseal-use preference thinking-depth policies upsert --json '{...}' [--corp <corpId>]\nseal-use preference thinking-depth policies remove <policyId> [--corp <corpId>]\nseal-use source config [--corp <corpId>]\nseal-use tool <toolName> [--corp <corpId>] [--json '{\"key\":\"value\"}']\nseal-use approval-runs summary --corp <corpId> [--date YYYY-MM-DD] [--timezone Asia/Shanghai]\nseal-use approval-runs stats --corp <corpId> [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id]\nseal-use approval-runs count --corp <corpId> [--status APPROVED]\nseal-use approval-runs search --corp <corpId> [--query text] [--limit 20] [--includeBridge true]\nseal-use approval-runs get <recordId> --corp <corpId> [--fields metadata|document.fields,result.summLine truncated
`;var tZ0="# 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 `./enterprises` and `~/.config/seal-use/enterprises` are merged.\n- User-level configs override same-ID local configs.\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** (e.g. `👉 Next action: ...`).\n- **`Exit Code`**: `0` on success, non-zero (e.g. `1`) on failure to trigger Agent error self-remediation.\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 lint <enable|disable|status> [--linter <name>] [--min-score <score>]\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 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\nseal-use tools list\nseal-use corps list [--corp <corpId>]\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\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 reset-password <userId> [--corp <corpId>]\nseal-use users get <userId> [--corp <corpId>]\nseal-use users delete <userId> [--corp <corpId>]\nseal-use llm config [--corp <corpId>]\nseal-use llm providers [--corp <corpId>]\nseal-use permissions available [--corp <corpId>]\nseal-use permissions configs [--corp <corpId>]\nseal-use billing status [--corp <corpId>]\nseal-use billing plans [--corp <corpId>]\nseal-use billing features [--corp <corpId>]\nseal-use webhook list [--query <text>] [--show-secret] [--corp <corpId>]\nseal-use webhook get|find <idOrName> [--show-secret] [--corp <corpId>]\nseal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]\nseal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]\nseal-use webhook delete <idOrName> --yes [--corp <corpId>]\nseal-use deploy hosecloud requirements [--corp <corpId>]\nseal-use deploy hosecloud list [--corp <corpId>]\nseal-use deploy hosecloud get [<sign-key>] [--corp <corpId>]\nseal-use deploy hosecloud status [--corp <corpId>]\nseal-use deploy hosecloud configure --json '{...}' [--corp <corpId>]\nseal-use deploy hosecloud sync [<sign-key>] [--auto] [--corp <corpId>]\nseal-use preference get [--corp <corpId>]\nseal-use preference decision update --json '{\"explicitApprove\":\"...\"}' [--corp <corpId>]\nseal-use preference thinking-depth set --default <medium|high> [--corp <corpId>]\nseal-use preference thinking-depth policies list [--corp <corpId>]\nseal-use preference thinking-depth policies upsert --json '{...}' [--corp <corpId>]\nseal-use preference thinking-depth policies remove <policyId> [--corp <corpId>]\nseal-use source config [--corp <corpId>]\nseal-use tool <toolName> [--corp <corpId>] [--json '{\"key\":\"value\"}']\nseal-use approval-runs summary --corp <corpId> [--date YYYY-MM-DD] [--timezone Asia/Shanghai]\nseal-use approval-runs stats --corp <corpId> [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id]\nseal-uLine 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.
@@ -977,7 +980,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 xZ0=`# Customer Feedback Rule Remediation
`;var eZ0=`# 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.
@@ -1141,7 +1144,7 @@ Return a compact report containing:
- New version number and version name, if published
- Verification result
- Whether a regression rerun was performed
`;var kZ0="# Enterprise Onboarding\n\nRead 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.\n\n## Start With Discovery\n\nRun this before asking for setup parameters (if `seal-use` is not installed, first run `curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash`):\n\n```bash\nseal-use version\nseal-use corps list\n```\n\n- If `seal-use` is not installed on the system, run the curl install script above to install it.\n- If the target enterprise is listed, match the user's human enterprise name to its returned `id` and use that value as `--corp` on every command. Do not ask the user for `corpId`.\n- If multiple configured enterprises plausibly match, show their human names and let the user choose. Keep their IDs as implementation details.\n- If none are configured, ask one plain-language question: “你现在手上有哪一种接入材料:合思开放平台 appKey/appSecurity、合思授权/协助链接、Seal 协助链接,还是从已登录的合思或 Seal 网页复制的 cURL?”\n\nDo not open with a JSON template or a list of internal fields.\n\nAll command examples in this reference are for the Agent to run. Do not hand them to the user as setup instructions. Communicate with the user in natural language and translate their answer into CLI/MCP parameters yourself.\n\n## Keep Two Concepts Separate\n\nClassify both the enterprise identity origin and how the current credential was acquired:\n\n| Enterprise identity origin | Credential material the user may have | Meaning |\n| --- | --- | --- |\n| Hose/合思-sourced Seal tenant | Hose `appKey` + `appSecurity` | Stable, refreshable standard integration |\n| Hose/合思-sourced Seal tenant | Hose authorization/assistance link | Temporary Hose authorization that can lead into the Seal SSO session |\n| Hose/合思-sourced Seal tenant | cURL copied from an authenticated Hose or Seal page | Snapshot of a signed-in browser session; it may expire |\n| Seal-native tenant | Seal assistance/delegation link | Temporary delegated access to a Seal tenant |\n| Seal-native tenant | cURL copied from an authenticated Seal page | Snapshot containing the Seal host and session authentication |\n\nCredential shape alone does not define identity origin. In particular, a Hose-sourced user eventually receives a Seal Bearer session after SSO. When `whoami` returns provider metadata, preserve it and use it to describe the tenant accurately.\n\n## Parameter Ownership\n\nAsk the user only for information that cannot be discovered safely:\n\n| Field | Owner and behavior |\n| --- | --- |\n| `appKey`, `appSecurity` | User supplies these for standard Hose OpenAPI onboarding. Explain that they come from the enterprise's 合思开放平台 application credentials. Treat both as secrets. |\n| `domain` | Probe the standard Hose SaaS domains automatically. Ask only when probing fails and the enterprise uses a private or dedicated deployment. |\n| Enterprise name and `corpId` | Discover from the credential response or Seal `whoami`. Do not ask the user to invent or locate them first. |\n| Administrator and `staffId` | Discover administrator candidates. If more than one is eligible, present name and masked phone for the user to choose; pass the selected ID internally. |\n| Seal URL, tenant ID, tenant slug | Discover from the assistance link, cURL host, and Seal `whoami`. |\n| Bearer token, cookies, signed query tokens | Extract only from user-supplied authentication material. Never print them back or include them in summaries. |\n\n## Route 1: Standard Hose Credentials\n\nThis is the preferred durable route for a Hose-sourced tenant. Read `hose-enterprise-init.md`, then use:\n\n```bash\nseal-use corps add-hose --json '{\"appKey\":\"...\",\"appSecurity\":\"...\"}'\n```\n\nThe CLI probes the standard domains, discovers the corporation, and discovers administrator candidates. If it returns multiple candidates, show only useful identifying information and ask which person should be used; retry with `staffName`, `staffPhone`, or the selected `staffId` internally. After creation, run:\n\n```bash\nseal-use auth diagnose --corp <discovered-id>\n```\n\nDo not ask for `domain`, `corpId`, or `proxyStaffBizId` up front. For a dedicated/private Hose deployment, add `domain` only after standard probing reports that it cannot find the enterprise.\n\n## Route 2: Incoming Assistance Link\n\nFirst distinguish the link by its host and purpose:\n\n- A Hose authorization/provisional link opens a Hose session and may continue through Seal SSO. It is not a Seal delegation link.\n- A Seal assistance/delegation link grants temporary delegated access on a Seal tenant. It is not a Hose OpenAPI credential.\n- `seal-use auth hose-link` and `seal-use delegation create` generat Line truncated
`;var $X0="# Enterprise Onboarding\n\nRead 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.\n\n## Start With Discovery\n\nRun this before asking for setup parameters (if `seal-use` is not installed, first run `curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash`):\n\n```bash\nseal-use version\nseal-use corps list\n```\n\n- If `seal-use` is not installed on the system, run the curl install script above to install it.\n- If the target enterprise is listed, match the user's human enterprise name to its returned `id` and use that value as `--corp` on every command. Do not ask the user for `corpId`.\n- If multiple configured enterprises plausibly match, show their human names and let the user choose. Keep their IDs as implementation details.\n- If none are configured, ask one plain-language question: “你现在手上有哪一种接入材料:合思开放平台 appKey/appSecurity、合思授权/协助链接、Seal 协助链接,还是从已登录的合思或 Seal 网页复制的 cURL?”\n\nDo not open with a JSON template or a list of internal fields.\n\nAll command examples in this reference are for the Agent to run. Do not hand them to the user as setup instructions. Communicate with the user in natural language and translate their answer into CLI/MCP parameters yourself.\n\n## Keep Two Concepts Separate\n\nClassify both the enterprise identity origin and how the current credential was acquired:\n\n| Enterprise identity origin | Credential material the user may have | Meaning |\n| --- | --- | --- |\n| Hose/合思-sourced Seal tenant | Hose `appKey` + `appSecurity` | Stable, refreshable standard integration |\n| Hose/合思-sourced Seal tenant | Hose authorization/assistance link | Temporary Hose authorization that can lead into the Seal SSO session |\n| Hose/合思-sourced Seal tenant | cURL copied from an authenticated Hose or Seal page | Snapshot of a signed-in browser session; it may expire |\n| Seal-native tenant | Seal assistance/delegation link | Temporary delegated access to a Seal tenant |\n| Seal-native tenant | cURL copied from an authenticated Seal page | Snapshot containing the Seal host and session authentication |\n\nCredential shape alone does not define identity origin. In particular, a Hose-sourced user eventually receives a Seal Bearer session after SSO. When `whoami` returns provider metadata, preserve it and use it to describe the tenant accurately.\n\n## Parameter Ownership\n\nAsk the user only for information that cannot be discovered safely:\n\n| Field | Owner and behavior |\n| --- | --- |\n| `appKey`, `appSecurity` | User supplies these for standard Hose OpenAPI onboarding. Explain that they come from the enterprise's 合思开放平台 application credentials. Treat both as secrets. |\n| `domain` | Probe the standard Hose SaaS domains automatically. Ask only when probing fails and the enterprise uses a private or dedicated deployment. |\n| Enterprise name and `corpId` | Discover from the credential response or Seal `whoami`. Do not ask the user to invent or locate them first. |\n| Administrator and `staffId` | Discover administrator candidates. If more than one is eligible, present name and masked phone for the user to choose; pass the selected ID internally. |\n| Seal URL, tenant ID, tenant slug | Discover from the assistance link, cURL host, and Seal `whoami`. |\n| Bearer token, cookies, signed query tokens | Extract only from user-supplied authentication material. Never print them back or include them in summaries. |\n\n## Route 1: Standard Hose Credentials\n\nThis is the preferred durable route for a Hose-sourced tenant. Read `hose-enterprise-init.md`, then use:\n\n```bash\nseal-use corps add-hose --json '{\"appKey\":\"...\",\"appSecurity\":\"...\"}'\n```\n\nThe CLI probes the standard domains, discovers the corporation, and discovers administrator candidates. If it returns multiple candidates, show only useful identifying information and ask which person should be used; retry with `staffName`, `staffPhone`, or the selected `staffId` internally. After creation, run:\n\n```bash\nseal-use auth diagnose --corp <discovered-id>\n```\n\nDo not ask for `domain`, `corpId`, or `proxyStaffBizId` up front. For a dedicated/private Hose deployment, add `domain` only after standard probing reports that it cannot find the enterprise.\n\n## Route 2: Incoming Assistance Link\n\nFirst distinguish the link by its host and purpose:\n\n- A Hose authorization/provisional link opens a Hose session and may continue through Seal SSO. It is not a Seal delegation link.\n- A Seal assistance/delegation link grants temporary delegated access on a Seal tenant. It is not a Hose OpenAPI credential.\n- `seal-use auth hose-link` and `seal-use delegation create` generat Line truncated
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
@@ -1206,7 +1209,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 nZ0=`# Hose Enterprise Initialization & Automated Discovery
`;var qX0=`# 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.
@@ -1312,12 +1315,12 @@ seal-use corps hose-staffs --json '{
}'
\`\`\`
* 直接使用指定 ID 完成接入并进行连通性验证。
`;var pZ0={"SKILL.md":RZ0,"agents/openai.yaml":CZ0,"references/rule-lightweight.md":_Z0,"references/approval-bad-cases.md":hZ0,"references/cli.md":SZ0,"references/approval-run-lightweight.md":yZ0,"references/approval-attachment-trace.md":uZ0,"references/customer-feedback-rule-remediation.md":xZ0,"references/enterprise-onboarding.md":kZ0,"references/hose-enterprise-auth.md":fZ0,"references/hose-enterprise-init.md":nZ0};function cZ0(){return pZ0["SKILL.md"]||""}function Xz(){return Gu(iZ0(),".agents","skills","seal-use")}function dZ0(){return Gu(iZ0(),".agents","skills","seal-home")}function lZ0(){let $=dZ0();if(wu($))try{return Yw1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function Hu($=Xz()){lZ0(),bZ0($,{recursive:!0});let I=[];for(let[q,U]of Object.entries(pZ0)){let Y=Gu($,q);bZ0(Qw1(Y),{recursive:!0}),Jw1(Y,U,"utf8"),I.push(q)}return{targetDir:$,files:I}}function Vu(){let $=dZ0(),I=Xz(),q=wu($),U=wu(I);if(q||U)return lZ0(),Hu(I),{synced:!0,targetDir:I};return{synced:!1}}function oZ0($,I,q){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${cZ0()}
`);return}if($==="install"||$==="init"||$==="sync"){let U=x0(q.options.local)||x0(q.options.workspace),Y=b(q.options.dir)??b(q.options.target)??I,J=Y?Y:U?XO(process.cwd(),".agents","skills","seal-use"):Xz(),Q=Hu(J);R0({installed:!0,targetDir:Q.targetDir,fileCount:Q.files.length,files:Q.files});return}if($==="status"||$==="get"||!$){let U=Xz(),Y=XO(process.cwd(),".agents","skills","seal-use");R0({global:{dir:U,installed:mZ0(XO(U,"SKILL.md"))},local:{dir:Y,installed:mZ0(XO(Y,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}async function rZ0($,I){if($==="config"){R0(await NY(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}async function tZ0($,I,q,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await L0($,I,q,r6(U.json),O0(U.options))}function aZ0(){R0(zz.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as Kw1,mkdirSync as zw1,renameSync as Wu,rmSync as ww1,unlinkSync as qX0,writeFileSync as sZ0}from"node:fs";import{dirname as Gw1,join as eZ0}from"node:path";import{spawnSync as II}from"node:child_process";function DO($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let q=$.toLowerCase().replace(/\\/g,"/");return!q.endsWith("/bun")&&!q.endsWith("/bun.exe")&&!q.endsWith("/node")&&!q.endsWith("/node.exe")}var UX0="yunyingk/seal-use",Oz="yunyingk/seal-home";var Hw1="SEAL_USE_GITHUB_REPO",Vw1="SEAL_HOME_GITHUB_REPO";async function YX0($,I={}){let q={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:zu,version:a0,launcher:$.launcher},U=I.repo||process.env[Hw1]?.trim()||process.env[Vw1]?.trim()||UX0,Y=I.targetVersion?.trim(),J=Y&&Y.toLowerCase()!=="latest"?Y:void 0;if(J){let g=J.replace(/^v/,""),B=JX0(g,a0);if(B<0){R0({updated:!1,currentVersion:a0,targetVersion:g,mode:DO()?"binary":"source",message:`Cannot downgrade seal-use from v${a0} to older version v${g}. Updates must be forward-only.`});return}if(B===0&&!I.force){R0({updated:!1,currentVersion:a0,targetVersion:g,mode:DO()?"binary":"source",message:`seal-use is already at version v${a0}. Use --force to reinstall.`});return}}if(I.changelogOnly){let g=await Zu(U,I.limit??10);R0({currentVersion:a0,totalQueried:g.length,releases:g.map((B)=>({version:B.version,tagName:B.tagName,publishedAt:B.publishedAt,author:B.author,releaseNotes:B.notes,releaseUrl:B.htmlUrl,isCurrent:B.version===a0,isNewer:Dz(B.version,a0)}))});return}if(!DO()){if(I.checkOnly){let B=await Zu(U,30),x=B[0],h=x?.version??a0,f=B.find((p)=>p.version===a0),S=Dz(h,a0),t=B.filter((p)=>Dz(p.version,a0));R0({updated:!1,updateAvailable:S,currentVersion:a0,currentVersionPublishedAt:f?.publishedAt,latestVersion:h,latestVersionPublishedAt:x?.publishedAt,behindCount:t.length,pendingReleases:t.map((p)=>({version:p.version,tagName:p.tagName,publishedAt:p.publishedAt,author:p.author,releaseNotes:p.notes,releaseUrl:p.htmlUrl})),releaseNotes:x?.notes??"",releaseUrl:x?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let g=FY(q).running;if(g)await $I("stop",q);try{IX0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(B){console.error(`git pull skipped: ${B instanceof Error?B.message:String(B)}`)}if(IX0("bun",["install"],{cwd:$.appRoot}),g)await $I("start",q);R0({updated:!0,serviceRestarted:g,version:a0,mode:"source"});return}let Q=Ww1(),K=Zw1(),z=await Zu(U,30),w=J?z.find((g)=>g.version===J||g.tagName===J||g.tagName===`v${J}`)??await $X0(U,J):z[0]??await $X0(U);if(!w){R0({updated:!1,currentVersion:a0,mode:"binary",message:`Failed to query releases from repository '${U}'`});return}let G=w.version,H=z.find((g)=>g.version===a0),W=Dz(G,a0),V=W||Boolean(I.force),X=z.filter((g)=>Dz(g.version,a0));if(I.checkOnly){R0({updated:!1,updateAvailable:W,currentVersion:a0,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:w.publishedAt,behindCount:X.length,pendingReleases:X.map((g)=>({version:g.version,tagName:g.tagName,publishedAt:g.publishedAt,author:g.author,releaseNotes:g.notes,releaseUrl:g.htmlUrl})),releaseNotes:w.notes,releaseUrl:w.htmlUrl,mode:"binary"});return}if(!V){R0({updated:!1,currentVersion:a0,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:w.publishedAt,mode:"binary",message:`seal-use is already up to date (v${a0})`});return}let D=Xw1(w.assets,Q,K);if(!D)throw Error(`No compatible binary found for ${Q}-${K} in release v${G}. Available assets: ${w.assets.map((g)=>g.name).join(", ")}`);let O=FY(q).running;if(O)await $I("stop",q);let N=process.execPath,T=Gw1(N),P=eZ0(T,`.tmp-update-${Date.now()}`);zw1(P,{recursive:!0});try{let g=eZ0(P,D.name);await Dw1(D.downloadUrl,g,w.tagName,D.name);let B=g;if(D.name.endsWith(".tar.gz")||D.name.endsWith(".tgz"))B=Ow1(g,P,Q);else if(D.name.endsWith(".zip"))B=Lw1(g,P,Q);if(Kw1(B,493),process.platform==="darwin")try{II("/usr/bin/codesig Line truncated
`)}catch{}}async function Dw1($,I,q,U){let Y=Xu(),J=[],Q=q?q.startsWith("v")?q:`v${q}`:void 0,K=U||$.split("/").pop()||"";if(Y!=="github"){if(Q&&K)J.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${Q}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${Q}/${K}`);if($.startsWith("https://git.ying-qing.cn"))J.push($)}if(Y!=="gitea")if(Q&&K){let D=`https://github.com/${UX0}/releases/download/${Q}/${K}`;if(!process.env.CI)J.push(`https://ghfast.top/${D}`,`https://gh.ddlc.top/${D}`);J.push(D)}else if($.includes("github.com")){if(!process.env.CI)J.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);J.push($)}else J.push($);let z=Array.from(new Set(J)),w,G=6000,H=6000,W=307200,V=1e4,X=180000;for(let D=0;D<z.length;D++){let O=z[D],N=new AbortController,T="",P=(h)=>{T=h;try{N.abort()}catch{}},g=setTimeout(()=>{P("Connection timed out (no response headers within 6s)")},G),B,x;try{OO(`==> [${D+1}/${z.length}] Downloading via: ${O}`);let h=await fetch(O,{signal:N.signal});if(g)clearTimeout(g),g=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);B=setTimeout(()=>{P("Overall download time exceeded 3 minutes")},X);let f=Number(h.headers.get("content-length"))||0,S=h.body?.getReader();if(!S){let n=Buffer.from(await h.arrayBuffer());if(n.length<1000)throw Error(`Downloaded content is suspiciously small (${n.length} bytes)`);sZ0(I,n),OO(`✓ Download succeeded (${(n.length/1024/1024).toFixed(1)} MB)`);return}let t=[],p=0,C=0;x=setTimeout(()=>{if(p<W){let n=(p/1024).toFixed(1);P(`Initial transfer too slow (${n} KB < 300 KB in 6s), switching mirror...`)}},H);while(!0){let n=S.read(),J0,j=new Promise((K0,G0)=>{J0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),u;try{u=await Promise.race([n,j])}finally{if(J0)clearTimeout(J0)}let{done:d,value:a}=u;if(d)break;if(a){if(t.push(a),p+=a.length,x&&p>=W)clearTimeout(x),x=void 0;let K0=Date.now();if(K0-C>200){C=K0;let G0=f?Math.round(p/f*100):0,M0=(p/1048576).toFixed(1),v0=f?(f/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${M0} / ${v0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let k=Buffer.concat(t);if(k.length<1000)throw Error(`Downloaded content is suspiciously small (${k.length} bytes)`);sZ0(I,k),OO(`✓ Download completed successfully (${(k.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(g)clearTimeout(g);if(x)clearTimeout(x);if(B)clearTimeout(B);let f=T||(h instanceof Error?h.message:String(h));w=Error(f),OO(`
↳ Mirror failed: ${w.message}`)}finally{if(g)clearTimeout(g);if(x)clearTimeout(x);if(B)clearTimeout(B)}}throw Error(`Failed to download asset from all mirrors: ${w?.message}`)}function Ow1($,I,q){let U=II("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);qX0($);let Y=q==="windows"?"seal-use.exe":"seal-use",J=II("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),Q=J.find((K)=>K.endsWith(`/${Y}`)||K.endsWith(Y));if(Q)return Q;return J[0]||$}function Lw1($,I,q){let U=II("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);qX0($);let Y=q==="windows"?"seal-use.exe":"seal-use",J=II("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),Q=J.find((K)=>K.endsWith(`/${Y}`)||K.endsWith(Y));if(Q)return Q;return J[0]||$}function JX0($,I){let q=$.replace(/^v/,"").split(".").map((Y)=>Number.parseInt(Y,10)||0),U=I.replace(/^v/,"").split(".").map((Y)=>Number.parseInt(Y,10)||0);for(let Y=0;Y<Math.max(q.length,U.length);Y++){let J=q[Y]??0,Q=U[Y]??0;if(J>Q)return 1;if(J<Q)return-1}return 0}function Dz($,I){return JX0($,I)>0}function IX0($,I,q={}){let U=II($,I,{cwd:q.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${U.status}`)}async function QX0($,I,q,U,Y){if($==="create"){let J=b(Y.options.name)??I,Q=b(Y.options.phone);if(!J||!Q)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=b(Y.options.dept)??b(Y.options.departmentId);await L0("seal_user_create",q,U,{name:J,phone:Q,departmentIds:K?[K]:void 0},O0(Y.options));return}if($==="reset-password"){let J=I??b(Y.options.userId);if(!J)throw Error("Usage: seal-use users reset-password <userId>");await L0("seal_user_reset_password",q,U,{userId:J},O0(Y.options));return}if($==="search"||$==="list"){let J=I??b(Y.options.keyword)??b(Y.options.query)??"";await L0("seal_user_search",q,U,{keyword:J},O0(Y.options));return}if($==="get"){let J=I??b(Y.options.userId);if(!J)throw Error("Usage: seal-use users get <userId>");await L0("seal_user_get",q,U,{userId:J},O0(Y.options));return}if($==="delete"){let J=I??b(Y.options.userId);if(!J)throw Error("Usage: seal-use users delete <userId>");await L0("seal_user_delete",q,U,{userId:J},O0(Y.options));return}if($==="activate"){let J=I??b(Y.options.userId);if(!J)throw Error("Usage: seal-use users activate <userId>");await L0("seal_user_activate",q,U,{userId:J},O0(Y.options));return}if($==="delegation"||$==="impersonate"){let J=I??b(Y.options.userId)??b(Y.options.phone);if(!J)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let Q=b(Y.options.note);await L0("seal_user_delegation_create",q,U,{userIdOrPhone:J,note:Q},O0(Y.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as KX0}from"node:fs";async function zX0($){if(!KX0($))throw Error(`File not found: ${$}`);let I=Jz($);console.log(JSON.stringify(await Yz(I.fileBuffer,I.fileName),null,2))}async function wX0($,I,q,U,Y){if($==="material-pack"||$==="material-pack-push"){let J=$==="material-pack-push"?"push":I,Q=$==="material-pack-push"?b(Y.options.file)??b(Y.options.input):Y.command[3]??b(Y.options.file)??b(Y.options.input);if(!Q)throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");if(!KX0(Q))throw Error(`File not found: ${Q}`);let K=Jz(Q);if(J==="preview"){console.log(JSON.stringify(await Yz(K.fileBuffer,K.fileName),null,2));return}if(J!=="push")throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");let z=b(Y.options.webhook)??b(Y.options.selector);if(!z)throw Error("Push requires --webhook <idOrName>");let w=Hq(await Gq(q),z),G=await eD(K.fileBuffer,K.fileName,{webhookUrl:w.incomingDocumentWebhook.url,secret:w.secret});console.log(JSON.stringify(G,null,2));return}if($==="list"){await L0("seal_webhook_list",q,U,{query:b(Y.options.query)??b(Y.options.keyword),includeSecret:$u(Y.options)},O0(Y.options));return}if($==="get"||$==="find"){let J=I??b(Y.options.selector)??b(Y.options.id);if(!J)throw Error("Usage: seal-use webhook get <idOrName> [--show-secret]");await L0("seal_webhook_get",q,U,{selector:J,includeSecret:$u(Y.options)},O0(Y.options));return}if($==="add"||$==="create"){let J=b(Y.options.name)??I,Q=b(Y.options.resultUrl)??b(Y.options["result-url"])??b(Y.options.outgoingResultWebhook)??b(Y.options["outgoing-result-webhook"]);if(!J||!Q)throw Error("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");let K=ey(Y.options);await L0("seal_webhook_add",q,U,{name:J,mode:sy(b(Y.options.mode)),outgoingResultWebhook:Q,autoApprovalRate:K,secret:b(Y.options.secret)},O0(Y.options));return}if($==="update"){let J=I??b(Y.options.selector)??b(Y.options.id);if(!J)throw Error("Usage: seal-use webhook update <idOrName> [options]");let Q=b(Y.options.secret),K=x0(Y.options.rotateSecret)??x0(Y.options["rotate-secret"]);if(Q!==void 0&&K)throw Error("Use either --secret or --rotate-secret, not both");let z=b(Y.options.name),w=sy(b(Y.options.mode)),G=b(Y.options.resultUrl)??b(Y.options["result-url"])??b(Y.options.outgoingResultWebhook)??b(Y.options["outgoing-result-webhook"]),H=ey(Y.options);if(z===void 0&&w===void 0&&G===void 0&&H===void 0&&Q===void 0&&!K)throw Error("Webhook update requires at least one field option");await L0("seal_webhook_update",q,U,{selector:J,name:z,mode:w,outgoingResultWebhook:G,autoApprovalRate:H,secret:Q,rotateSecret:K},O0(Y.options));return}if($==="delete"){let J=I??b(Y.options. Line truncated
`;var JX0={"SKILL.md":lZ0,"agents/openai.yaml":mZ0,"references/rule-lightweight.md":oZ0,"references/approval-bad-cases.md":rZ0,"references/cli.md":tZ0,"references/approval-run-lightweight.md":aZ0,"references/approval-attachment-trace.md":sZ0,"references/customer-feedback-rule-remediation.md":eZ0,"references/enterprise-onboarding.md":$X0,"references/hose-enterprise-auth.md":IX0,"references/hose-enterprise-init.md":qX0};function QX0(){return JX0["SKILL.md"]||""}function Nw(){return Eu(YX0(),".agents","skills","seal-use")}function KX0(){return Eu(YX0(),".agents","skills","seal-home")}function wX0(){let $=KX0();if(Tu($))try{return Rz1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function ju($=Nw()){wX0(),UX0($,{recursive:!0});let I=[];for(let[q,U]of Object.entries(JX0)){let Y=Eu($,q);UX0(_z1(Y),{recursive:!0}),Cz1(Y,U,"utf8"),I.push(q)}return{targetDir:$,files:I}}function Bu(){let $=KX0(),I=Nw(),q=Tu($),U=Tu(I);if(q||U)return wX0(),ju(I),{synced:!0,targetDir:I};return{synced:!1}}function GX0($,I,q){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${QX0()}
`);return}if($==="install"||$==="init"||$==="sync"){let U=C0(q.options.local)||C0(q.options.workspace),Y=x(q.options.dir)??x(q.options.target)??I,J=Y?Y:U?PO(process.cwd(),".agents","skills","seal-use"):Nw(),Q=ju(J);v0({installed:!0,targetDir:Q.targetDir,fileCount:Q.files.length,files:Q.files});return}if($==="status"||$==="get"||!$){let U=Nw(),Y=PO(process.cwd(),".agents","skills","seal-use");v0({global:{dir:U,installed:zX0(PO(U,"SKILL.md"))},local:{dir:Y,installed:zX0(PO(Y,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}async function HX0($,I){if($==="config"){v0(await FY(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}async function VX0($,I,q,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await L0($,I,q,t6(U.json),O0(U.options))}function WX0(){v0(Gw.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as hz1,mkdirSync as Sz1,renameSync as vu,rmSync as yz1,unlinkSync as LX0,writeFileSync as ZX0}from"node:fs";import{dirname as uz1,join as XX0}from"node:path";import{spawnSync as UI}from"node:child_process";function TO($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let q=$.toLowerCase().replace(/\\/g,"/");return!q.endsWith("/bun")&&!q.endsWith("/bun.exe")&&!q.endsWith("/node")&&!q.endsWith("/node.exe")}var NX0="yunyingk/seal-use",Mw="yunyingk/seal-home";var xz1="SEAL_USE_GITHUB_REPO",kz1="SEAL_HOME_GITHUB_REPO";async function FX0($,I={}){let q={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:gu,version:t0,launcher:$.launcher},U=I.repo||process.env[xz1]?.trim()||process.env[kz1]?.trim()||NX0,Y=I.targetVersion?.trim(),J=Y&&Y.toLowerCase()!=="latest"?Y:void 0;if(J){let g=J.replace(/^v/,""),B=MX0(g,t0);if(B<0){v0({updated:!1,currentVersion:t0,targetVersion:g,mode:TO()?"binary":"source",message:`Cannot downgrade seal-use from v${t0} to older version v${g}. Updates must be forward-only.`});return}if(B===0&&!I.force){v0({updated:!1,currentVersion:t0,targetVersion:g,mode:TO()?"binary":"source",message:`seal-use is already at version v${t0}. Use --force to reinstall.`});return}}if(I.changelogOnly){let g=await Ru(U,I.limit??10);v0({currentVersion:t0,totalQueried:g.length,releases:g.map((B)=>({version:B.version,tagName:B.tagName,publishedAt:B.publishedAt,author:B.author,releaseNotes:B.notes,releaseUrl:B.htmlUrl,isCurrent:B.version===t0,isNewer:Fw(B.version,t0)}))});return}if(!TO()){if(I.checkOnly){let B=await Ru(U,30),k=B[0],h=k?.version??t0,f=B.find((p)=>p.version===t0),S=Fw(h,t0),t=B.filter((p)=>Fw(p.version,t0));v0({updated:!1,updateAvailable:S,currentVersion:t0,currentVersionPublishedAt:f?.publishedAt,latestVersion:h,latestVersionPublishedAt:k?.publishedAt,behindCount:t.length,pendingReleases:t.map((p)=>({version:p.version,tagName:p.tagName,publishedAt:p.publishedAt,author:p.author,releaseNotes:p.notes,releaseUrl:p.htmlUrl})),releaseNotes:k?.notes??"",releaseUrl:k?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let g=AY(q).running;if(g)await qI("stop",q);try{OX0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(B){console.error(`git pull skipped: ${B instanceof Error?B.message:String(B)}`)}if(OX0("bun",["install"],{cwd:$.appRoot}),g)await qI("start",q);v0({updated:!0,serviceRestarted:g,version:t0,mode:"source"});return}let Q=fz1(),K=nz1(),w=await Ru(U,30),z=J?w.find((g)=>g.version===J||g.tagName===J||g.tagName===`v${J}`)??await DX0(U,J):w[0]??await DX0(U);if(!z){v0({updated:!1,currentVersion:t0,mode:"binary",message:`Failed to query releases from repository '${U}'`});return}let G=z.version,H=w.find((g)=>g.version===t0),V=Fw(G,t0),W=V||Boolean(I.force),X=w.filter((g)=>Fw(g.version,t0));if(I.checkOnly){v0({updated:!1,updateAvailable:V,currentVersion:t0,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:z.publishedAt,behindCount:X.length,pendingReleases:X.map((g)=>({version:g.version,tagName:g.tagName,publishedAt:g.publishedAt,author:g.author,releaseNotes:g.notes,releaseUrl:g.htmlUrl})),releaseNotes:z.notes,releaseUrl:z.htmlUrl,mode:"binary"});return}if(!W){v0({updated:!1,currentVersion:t0,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:z.publishedAt,mode:"binary",message:`seal-use is already up to date (v${t0})`});return}let D=iz1(z.assets,Q,K);if(!D)throw Error(`No compatible binary found for ${Q}-${K} in release v${G}. Available assets: ${z.assets.map((g)=>g.name).join(", ")}`);let O=AY(q).running;if(O)await qI("stop",q);let N=process.execPath,T=uz1(N),P=XX0(T,`.tmp-update-${Date.now()}`);Sz1(P,{recursive:!0});try{let g=XX0(P,D.name);await bz1(D.downloadUrl,g,z.tagName,D.name);let B=g;if(D.name.endsWith(".tar.gz")||D.name.endsWith(".tgz"))B=pz1(g,P,Q);else if(D.name.endsWith(".zip"))B=cz1(g,P,Q);if(hz1(B,493),process.platform==="darwin")try{UI("/usr/bin/codesig Line truncated
`)}catch{}}async function bz1($,I,q,U){let Y=Cu(),J=[],Q=q?q.startsWith("v")?q:`v${q}`:void 0,K=U||$.split("/").pop()||"";if(Y!=="github"){if(Q&&K)J.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${Q}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${Q}/${K}`);if($.startsWith("https://git.ying-qing.cn"))J.push($)}if(Y!=="gitea")if(Q&&K){let D=`https://github.com/${NX0}/releases/download/${Q}/${K}`;if(!process.env.CI)J.push(`https://ghfast.top/${D}`,`https://gh.ddlc.top/${D}`);J.push(D)}else if($.includes("github.com")){if(!process.env.CI)J.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);J.push($)}else J.push($);let w=Array.from(new Set(J)),z,G=6000,H=6000,V=307200,W=1e4,X=180000;for(let D=0;D<w.length;D++){let O=w[D],N=new AbortController,T="",P=(h)=>{T=h;try{N.abort()}catch{}},g=setTimeout(()=>{P("Connection timed out (no response headers within 6s)")},G),B,k;try{EO(`==> [${D+1}/${w.length}] Downloading via: ${O}`);let h=await fetch(O,{signal:N.signal});if(g)clearTimeout(g),g=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);B=setTimeout(()=>{P("Overall download time exceeded 3 minutes")},X);let f=Number(h.headers.get("content-length"))||0,S=h.body?.getReader();if(!S){let i=Buffer.from(await h.arrayBuffer());if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);ZX0(I,i),EO(`✓ Download succeeded (${(i.length/1024/1024).toFixed(1)} MB)`);return}let t=[],p=0,C=0;k=setTimeout(()=>{if(p<V){let i=(p/1024).toFixed(1);P(`Initial transfer too slow (${i} KB < 300 KB in 6s), switching mirror...`)}},H);while(!0){let i=S.read(),J0,E=new Promise((K0,G0)=>{J0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},W)}),u;try{u=await Promise.race([i,E])}finally{if(J0)clearTimeout(J0)}let{done:d,value:a}=u;if(d)break;if(a){if(t.push(a),p+=a.length,k&&p>=V)clearTimeout(k),k=void 0;let K0=Date.now();if(K0-C>200){C=K0;let G0=f?Math.round(p/f*100):0,M0=(p/1048576).toFixed(1),R0=f?(f/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${M0} / ${R0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let n=Buffer.concat(t);if(n.length<1000)throw Error(`Downloaded content is suspiciously small (${n.length} bytes)`);ZX0(I,n),EO(`✓ Download completed successfully (${(n.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(g)clearTimeout(g);if(k)clearTimeout(k);if(B)clearTimeout(B);let f=T||(h instanceof Error?h.message:String(h));z=Error(f),EO(`
↳ Mirror failed: ${z.message}`)}finally{if(g)clearTimeout(g);if(k)clearTimeout(k);if(B)clearTimeout(B)}}throw Error(`Failed to download asset from all mirrors: ${z?.message}`)}function pz1($,I,q){let U=UI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);LX0($);let Y=q==="windows"?"seal-use.exe":"seal-use",J=UI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),Q=J.find((K)=>K.endsWith(`/${Y}`)||K.endsWith(Y));if(Q)return Q;return J[0]||$}function cz1($,I,q){let U=UI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);LX0($);let Y=q==="windows"?"seal-use.exe":"seal-use",J=UI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),Q=J.find((K)=>K.endsWith(`/${Y}`)||K.endsWith(Y));if(Q)return Q;return J[0]||$}function MX0($,I){let q=$.replace(/^v/,"").split(".").map((Y)=>Number.parseInt(Y,10)||0),U=I.replace(/^v/,"").split(".").map((Y)=>Number.parseInt(Y,10)||0);for(let Y=0;Y<Math.max(q.length,U.length);Y++){let J=q[Y]??0,Q=U[Y]??0;if(J>Q)return 1;if(J<Q)return-1}return 0}function Fw($,I){return MX0($,I)>0}function OX0($,I,q={}){let U=UI($,I,{cwd:q.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${U.status}`)}async function AX0($,I,q,U,Y){if($==="create"){let J=x(Y.options.name)??I,Q=x(Y.options.phone);if(!J||!Q)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=x(Y.options.dept)??x(Y.options.departmentId);await L0("seal_user_create",q,U,{name:J,phone:Q,departmentIds:K?[K]:void 0},O0(Y.options));return}if($==="reset-password"){let J=I??x(Y.options.userId);if(!J)throw Error("Usage: seal-use users reset-password <userId>");await L0("seal_user_reset_password",q,U,{userId:J},O0(Y.options));return}if($==="search"||$==="list"){let J=I??x(Y.options.keyword)??x(Y.options.query)??"";await L0("seal_user_search",q,U,{keyword:J},O0(Y.options));return}if($==="get"){let J=I??x(Y.options.userId);if(!J)throw Error("Usage: seal-use users get <userId>");await L0("seal_user_get",q,U,{userId:J},O0(Y.options));return}if($==="delete"){let J=I??x(Y.options.userId);if(!J)throw Error("Usage: seal-use users delete <userId>");await L0("seal_user_delete",q,U,{userId:J},O0(Y.options));return}if($==="activate"){let J=I??x(Y.options.userId);if(!J)throw Error("Usage: seal-use users activate <userId>");await L0("seal_user_activate",q,U,{userId:J},O0(Y.options));return}if($==="delegation"||$==="impersonate"){let J=I??x(Y.options.userId)??x(Y.options.phone);if(!J)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let Q=x(Y.options.note);await L0("seal_user_delegation_create",q,U,{userIdOrPhone:J,note:Q},O0(Y.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as gX0}from"node:fs";async function PX0($){if(!gX0($))throw Error(`File not found: ${$}`);let I=Kw($);console.log(JSON.stringify(await Qw(I.fileBuffer,I.fileName),null,2))}async function TX0($,I,q,U,Y){if($==="material-pack"||$==="material-pack-push"){let J=$==="material-pack-push"?"push":I,Q=$==="material-pack-push"?x(Y.options.file)??x(Y.options.input):Y.command[3]??x(Y.options.file)??x(Y.options.input);if(!Q)throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");if(!gX0(Q))throw Error(`File not found: ${Q}`);let K=Kw(Q);if(J==="preview"){console.log(JSON.stringify(await Qw(K.fileBuffer,K.fileName),null,2));return}if(J!=="push")throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");let w=x(Y.options.webhook)??x(Y.options.selector);if(!w)throw Error("Push requires --webhook <idOrName>");let z=Wq(await Vq(q),w),G=await YO(K.fileBuffer,K.fileName,{webhookUrl:z.incomingDocumentWebhook.url,secret:z.secret});console.log(JSON.stringify(G,null,2));return}if($==="list"){await L0("seal_webhook_list",q,U,{query:x(Y.options.query)??x(Y.options.keyword),includeSecret:Wu(Y.options)},O0(Y.options));return}if($==="get"||$==="find"){let J=I??x(Y.options.selector)??x(Y.options.id);if(!J)throw Error("Usage: seal-use webhook get <idOrName> [--show-secret]");await L0("seal_webhook_get",q,U,{selector:J,includeSecret:Wu(Y.options)},O0(Y.options));return}if($==="add"||$==="create"){let J=x(Y.options.name)??I,Q=x(Y.options.resultUrl)??x(Y.options["result-url"])??x(Y.options.outgoingResultWebhook)??x(Y.options["outgoing-result-webhook"]);if(!J||!Q)throw Error("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");let K=Vu(Y.options);await L0("seal_webhook_add",q,U,{name:J,mode:Hu(x(Y.options.mode)),outgoingResultWebhook:Q,autoApprovalRate:K,secret:x(Y.options.secret)},O0(Y.options));return}if($==="update"){let J=I??x(Y.options.selector)??x(Y.options.id);if(!J)throw Error("Usage: seal-use webhook update <idOrName> [options]");let Q=x(Y.options.secret),K=C0(Y.options.rotateSecret)??C0(Y.options["rotate-secret"]);if(Q!==void 0&&K)throw Error("Use either --secret or --rotate-secret, not both");let w=x(Y.options.name),z=Hu(x(Y.options.mode)),G=x(Y.options.resultUrl)??x(Y.options["result-url"])??x(Y.options.outgoingResultWebhook)??x(Y.options["outgoing-result-webhook"]),H=Vu(Y.options);if(w===void 0&&z===void 0&&G===void 0&&H===void 0&&Q===void 0&&!K)throw Error("Webhook update requires at least one field option");await L0("seal_webhook_update",q,U,{selector:J,name:w,mode:z,outgoingResultWebhook:G,autoApprovalRate:H,secret:Q,rotateSecret:K},O0(Y.options));return}if($==="delete"){let J=I??x(Y.options. Line truncated
`)?"":`
`}`);process.exitCode=$.exitCode}var _w1=Boolean(o.main==o.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&VX0(process.argv[1])===VX0(f5));if(_w1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await Cw1();else Ju().catch(($)=>{console.error($),process.exitCode=1});export{Uu as tokenizeCommand,Ju as startServer,Bw1 as resolveMcpEnabled,vw1 as createServer,jw1 as SEAL_MCP_ENABLED_ENV,Tw1 as SEAL_CLI_TOOL_NAME,Ew1 as LEGACY_SEAL_MCP_ENABLED_ENV};
`}`);process.exitCode=$.exitCode}var JG1=Boolean(o.main==o.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&vX0(process.argv[1])===vX0(c5));if(JG1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await YG1();else Lu().catch(($)=>{console.error($),process.exitCode=1});export{Du as tokenizeCommand,Lu as startServer,IG1 as resolveMcpEnabled,qG1 as createServer,ez1 as SEAL_MCP_ENABLED_ENV,sz1 as SEAL_CLI_TOOL_NAME,$G1 as LEGACY_SEAL_MCP_ENABLED_ENV};
+1 -1
View File
@@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "seal-use Wrapped API",
"version": "0.10.6",
"version": "0.10.8",
"description": "Planned HTTP contract for the seal-use wrapped backend API.\n\nThese endpoints describe the intended stable API for frontend developers and agents once\nthe HTTP adapter is implemented.\nThey are not the raw downstream Seal endpoints. seal-use is responsible for enterprise\nselection, source authentication, response compaction, and diagnostics-friendly fields.\n"
},
"servers": [
+1 -1
View File
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: seal-use Wrapped API
version: 0.10.6
version: 0.10.8
description: |
Planned HTTP contract for the seal-use wrapped backend API.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "seal-use",
"version": "0.10.6",
"version": "0.10.8",
"type": "module",
"module": "src/server.ts",
"bin": {
+4 -4
View File
@@ -1,12 +1,12 @@
---
name: seal-use
description: "v0.10.6: 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."
description: "v0.10.8: 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:
version: 0.10.6
short-description: Seal tenant and Hose approval automation (v0.10.6)
version: 0.10.8
short-description: Seal tenant and Hose approval automation (v0.10.8)
---
# Seal Use (v0.10.6)
# Seal Use (v0.10.8)
Use the `seal_cli` MCP tool when it is available; pass the command string as its `command` argument. If MCP is unavailable, fall back to the global `seal-use` CLI. This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
@@ -62,7 +62,14 @@ If the user then wants the full text of one cited rule, use `rules get --record-
Use:
```bash
# 查看附件列表摘要(包含文件名、类型、大小及直链可用性)
seal-use approval-runs attachments <recordId> --corp <corpId> --summary
# 下载全部附件到本地目录(优先使用 ossSignedUrl 签名直链)
seal-use approval-runs attachments download <recordId> --all --out-dir ./downloads --corp <corpId>
# 按名称或 fileId 过滤下载单个附件
seal-use approval-runs attachments download <recordId> --name 发票 --corp <corpId>
```
This should be enough for file names, file IDs, mime types, positions, invoice/attachment grouping, and links when available. For customer disputes about OCR, receipt/invoice classification, or image content, switch to `approval-attachment-trace.md`.
+13 -4
View File
@@ -38,8 +38,10 @@ seal-use config paths
seal-use config get
seal-use config mode <stateful|stateless> [--corp <corpId>]
seal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]
seal-use rules lint [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]
seal-use service <start|stop|restart|status>
seal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]
seal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]
seal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]
seal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]
seal-use http [--port 8787] [--host 127.0.0.1]
seal-use serve [--port 8787]
seal-use update
@@ -91,6 +93,7 @@ seal-use approval-runs count --corp <corpId> [--status APPROVED]
seal-use approval-runs search --corp <corpId> [--query text] [--limit 20] [--includeBridge true]
seal-use approval-runs get <recordId> --corp <corpId> [--fields metadata|document.fields,result.summary] [--output-file file.json]
seal-use approval-runs attachments <recordId> --corp <corpId>
seal-use approval-runs attachments download <recordId> [--all] [--name <name>] [--out-dir <dir>] --corp <corpId>
seal-use approval-runs result <recordId> --corp <corpId> [--summary]
seal-use approval-runs url --corp <corpId>
seal-use approval-runs url <recordId> --corp <corpId>
@@ -121,7 +124,7 @@ seal-use simulation package-upload <材料包.zip> --corp <corpId>
}
```
`seal-use service status` returns the PID, version, state directory, PID file, and log file for the optional local background process.
`seal-use service <start|stop|restart|status|logs>` manages the persistent background service daemon with embedded HTTP server (serving `/docs`, `/openapi.json`, and `POST /api/cli`). `status` returns the PID, version, host, port, active HTTP URL, state directory, PID file, and log file.
`seal-use update` updates the git checkout, runs `bun install`, and restarts the local service if it was running.
@@ -135,9 +138,13 @@ Approval rule maintenance:
- `seal-use rules count [--corp <corpId>]`
- `seal-use rules list --summary [--corp <corpId>]`
- `seal-use rules lint [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]`
- `seal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]`
- `seal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]`
- `seal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]`
- `seal-use rules clear [--corp <corpId>] [--dry-run|--yes]`
- `seal_approval_rules_list`
- `seal_approval_rules_pull`
- `seal_approval_rules_push`
- `seal_approval_rules_lint`
- `seal_approval_rules_clear`
- `seal_approval_rule_create`
@@ -155,12 +162,14 @@ Approval run lightweight queries:
- `seal-use approval-runs cited-rules <recordId> --corp <corpId>`
- `seal-use approval-runs get <recordId> --corp <corpId> --fields document.fields,result.summary`
- `seal-use approval-runs attachments <recordId> --corp <corpId> --summary`
- `seal-use approval-runs attachments download <recordId> [--all] [--name <name>] [--out-dir <dir>] --corp <corpId>`
- `seal-use approval-runs result <recordId> --corp <corpId> --summary`
- `seal_approval_run_get` with `fields`
- `seal_approval_run_pick`
- `seal_approval_run_cited_rules_get`
- `seal_approval_run_document_summary_get`
- `seal_approval_run_attachments_get`
- `seal_approval_run_attachments_download`
- `seal_approval_run_result_get` with `{"summary":true}`
Approval knowledge documents:
+84 -1
View File
@@ -168,8 +168,62 @@ export async function handleApprovalRunsCommand(
}
if (action === "attachments") {
const subAction = args.command[2];
if (subAction === "download") {
const recordId = args.command[3];
if (!recordId) {
throw new Error(
"Usage: seal-use approval-runs attachments download <recordId> [--all] [--name <name>] [--out-dir <dir>]"
);
}
const downloadResult = (await runToolResult(
"seal_approval_run_attachments_download",
client,
corp,
{
recordId,
all: booleanOption(args.options.all),
name: stringOption(args.options.name),
outDir:
stringOption(args.options["out-dir"]) ??
stringOption(args.options.outDir) ??
stringOption(args.options.dir)
}
)) as any;
printJson(downloadResult, outputOptions(args.options));
if (downloadResult?.total > 0 && downloadResult?.downloaded === 0) {
throw new Error(`所有 ${downloadResult.total} 个附件下载均失败。`);
}
return;
}
const recordId = args.command[2];
if (!recordId) throw new Error("Usage: seal-use approval-runs attachments <recordId>");
if (!recordId) throw new Error("Usage: seal-use approval-runs attachments <recordId> | seal-use approval-runs attachments download <recordId>");
if (booleanOption(args.options.download)) {
const downloadResult = (await runToolResult(
"seal_approval_run_attachments_download",
client,
corp,
{
recordId,
all: booleanOption(args.options.all) ?? true,
name: stringOption(args.options.name),
outDir:
stringOption(args.options["out-dir"]) ??
stringOption(args.options.outDir) ??
stringOption(args.options.dir)
}
)) as any;
printJson(downloadResult, outputOptions(args.options));
if (downloadResult?.total > 0 && downloadResult?.downloaded === 0) {
throw new Error(`所有 ${downloadResult.total} 个附件下载均失败。`);
}
return;
}
await runTool(
"seal_approval_run_attachments_get",
client,
@@ -183,6 +237,35 @@ export async function handleApprovalRunsCommand(
return;
}
if (action === "download") {
const recordId = args.command[2];
if (!recordId) {
throw new Error(
"Usage: seal-use approval-runs download <recordId> [--all] [--name <name>] [--out-dir <dir>]"
);
}
const downloadResult = (await runToolResult(
"seal_approval_run_attachments_download",
client,
corp,
{
recordId,
all: booleanOption(args.options.all),
name: stringOption(args.options.name),
outDir:
stringOption(args.options["out-dir"]) ??
stringOption(args.options.outDir) ??
stringOption(args.options.dir)
}
)) as any;
printJson(downloadResult, outputOptions(args.options));
if (downloadResult?.total > 0 && downloadResult?.downloaded === 0) {
throw new Error(`所有 ${downloadResult.total} 个附件下载均失败。`);
}
return;
}
if (action === "result") {
const recordId = args.command[2];
if (!recordId) throw new Error("Usage: seal-use approval-runs result <recordId> [--summary]");
+52 -1
View File
@@ -140,12 +140,63 @@ export async function handleRulesCommand(
return;
}
if (action === "pull") {
const version = stringOption(args.options.version) ?? maybeName;
const out = stringOption(args.options.out) ?? stringOption(args.options.file) ?? stringOption(args.options.f);
await runTool(
"seal_approval_rules_pull",
client,
corp,
{
version,
out
},
outputOptions(args.options)
);
return;
}
if (action === "push") {
const file = stringOption(args.options.file) ?? stringOption(args.options.f) ?? maybeName;
const confirmed = booleanOption(args.options.yes) === true;
const dryRun = booleanOption(args.options.dryRun) ?? booleanOption(args.options["dry-run"]) ?? !confirmed;
const publish = booleanOption(args.options.publish);
const versionName = stringOption(args.options.versionName) ?? stringOption(args.options["version-name"]);
const result = await runToolResult(
"seal_approval_rules_push",
client,
corp,
{
file,
dryRun,
confirm: confirmed,
publish,
versionName
}
);
if (!confirmed && dryRun && result && typeof result === "object") {
printJson(
{
...result,
nextCommand: `seal-use rules push --file ${file ?? "./rules.local.json"} --corp ${corp.id} --yes${publish ? " --publish" : ""}`
},
outputOptions(args.options)
);
return;
}
printJson(result, outputOptions(args.options));
return;
}
if (action === "lint") {
await runTool(
"seal_approval_rules_lint",
client,
corp,
{
file: stringOption(args.options.file) ?? stringOption(args.options.f),
linter: stringOption(args.options.linter),
version: stringOption(args.options.version),
code: stringOption(args.options.code),
@@ -159,5 +210,5 @@ export async function handleRulesCommand(
return;
}
throw new Error(`Unknown rules command: ${action ?? ""}. Available: count, list, clear, versions, version, get, search, lint. Run 'seal-use help' for available commands.`);
throw new Error(`Unknown rules command: ${action ?? ""}. Available: count, list, clear, versions, version, get, search, lint, pull, push. Run 'seal-use help' for available commands.`);
}
+24 -9
View File
@@ -3,17 +3,32 @@ import { join } from "node:path";
import { VERSION } from "../../version.js";
import { runServiceCommand } from "../service.js";
import { printJson } from "../printer.js";
import type { CliRuntime } from "../types.js";
import { numberOption, stringOption } from "../parser.js";
import type { CliRuntime, ParsedArgs } from "../types.js";
export const STATE_DIR = join(homedir(), ".config", "seal-use");
export async function handleServiceCommand(action: string | undefined, runtime: CliRuntime) {
const result = await runServiceCommand(action, {
appRoot: runtime.appRoot,
entryFile: runtime.entryFile,
stateDir: STATE_DIR,
version: VERSION,
launcher: runtime.launcher
});
export async function handleServiceCommand(
action: string | undefined,
runtime: CliRuntime,
args?: ParsedArgs
) {
const port = args ? numberOption(args.options.port) ?? numberOption(args.options.p) : undefined;
const host = args ? stringOption(args.options.host) ?? stringOption(args.options.h) : undefined;
const maxLines = args ? numberOption(args.options.lines) ?? numberOption(args.options.n) : undefined;
const result = await runServiceCommand(
action,
{
appRoot: runtime.appRoot,
entryFile: runtime.entryFile,
stateDir: STATE_DIR,
version: VERSION,
launcher: runtime.launcher,
port,
host
},
{ maxLines }
);
if (result !== undefined) printJson(result);
}
+10 -3
View File
@@ -19,12 +19,19 @@ export function parseArgs(argv: string[]): ParsedArgs {
}
if (arg.startsWith("-")) {
const key = arg.replace(/^-+/, "");
const raw = arg.replace(/^-+/, "");
if (raw.includes("=")) {
const eqIdx = raw.indexOf("=");
const key = raw.slice(0, eqIdx);
const val = raw.slice(eqIdx + 1);
options[key] = val;
continue;
}
const next = argv[index + 1];
if (!next || next.startsWith("-")) {
options[key] = true;
options[raw] = true;
} else {
options[key] = next;
options[raw] = next;
index += 1;
}
continue;
+1
View File
@@ -155,6 +155,7 @@ Usage:
seal-use approval-runs cited-rules <recordId> [--corp <corpId>]
seal-use approval-runs document-summary <recordId> [--corp <corpId>]
seal-use approval-runs attachments <recordId> [--summary] [--corp <corpId>]
seal-use approval-runs attachments download <recordId> [--all] [--name <name>] [--out-dir <dir>] [--corp <corpId>]
seal-use approval-runs result <recordId> [--summary] [--corp <corpId>]
seal-use approval-runs url [--corp <corpId>]
seal-use approval-runs url <recordId> [--corp <corpId>]
+37 -1
View File
@@ -3,6 +3,7 @@
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { createSealClient } from "../core/http/factory.js";
import type { CorpConfig } from "../core/config/types.js";
import { VERSION } from "../version.js";
import { handleApprovalRunsCommand } from "./commands/approval-runs.js";
import { handleAuthCommand } from "./commands/auth.js";
@@ -44,6 +45,7 @@ const DEFAULT_APP_ROOT = dirname(dirname(dirname(fileURLToPath(import.meta.url))
const KNOWN_AREAS = new Set([
"config",
"service",
"stop",
"http",
"serve",
"update",
@@ -77,9 +79,23 @@ const KNOWN_AREAS = new Set([
export type { CliResult, CliRunOptions } from "./types.js";
const STANDING_COMMANDS = new Set(["http", "server", "web", "mcp"]);
function isStandingCommand(argv: string[]): boolean {
if (!argv.length) return false;
const first = argv[0]?.toLowerCase();
const second = argv[1]?.toLowerCase();
if (first && STANDING_COMMANDS.has(first)) return true;
if ((first === "service" || first === "daemon") && second === "run") return true;
return false;
}
let runQueue = Promise.resolve();
export function runCli(argv: string[], options: CliRunOptions = {}): Promise<CliResult> {
if (isStandingCommand(argv)) {
return runCliOnce(argv, options);
}
const run = runQueue.then(() => runCliOnce(argv, options));
runQueue = run.then(
() => undefined,
@@ -193,7 +209,12 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
}
if (area === "service") {
await handleServiceCommand(action, runtime);
await handleServiceCommand(action, runtime, args);
return;
}
if (area === "stop") {
await handleServiceCommand("stop", runtime, args);
return;
}
@@ -248,6 +269,21 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
return;
}
if (area === "rules" && action === "lint" && ("file" in args.options || "f" in args.options)) {
let corp: CorpConfig;
try {
corp = selectCorp(stringOption(args.options.corp));
} catch {
corp = {
id: "local",
name: "Local Workspace",
source: { type: "native" }
} as any;
}
await handleRulesCommand(action, maybeName, null as any, corp, args);
return;
}
const corp = selectCorp(stringOption(args.options.corp));
if (area === "source") {
+67 -1
View File
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, test } from "bun:test";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { serviceStatus } from "./service.js";
import { serviceStatus, readServiceLogs, runServiceCommand } from "./service.js";
const tempDirs: string[] = [];
@@ -27,5 +27,71 @@ describe("service lifecycle state", () => {
expect(status.running).toBe(false);
expect(status.pid).toBeUndefined();
expect(status.port).toBe(8787);
expect(status.host).toBe("127.0.0.1");
expect(status.url).toBeUndefined();
});
test("respects custom port and host configuration", () => {
const stateDir = mkdtempSync(join(tmpdir(), "seal-use-service-"));
tempDirs.push(stateDir);
const status = serviceStatus({
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir,
version: "0.10.7",
port: 9090,
host: "0.0.0.0"
});
expect(status.port).toBe(9090);
expect(status.host).toBe("0.0.0.0");
});
test("reads service log file lines safely", () => {
const stateDir = mkdtempSync(join(tmpdir(), "seal-use-service-"));
tempDirs.push(stateDir);
const emptyLogs = readServiceLogs({
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir
});
expect(emptyLogs.lines).toEqual([]);
expect(emptyLogs.totalLines).toBe(0);
const logFile = join(stateDir, "service.log");
writeFileSync(logFile, "line 1\nline 2\nline 3\nline 4\nline 5\n");
const logs = readServiceLogs(
{
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir
},
3
);
expect(logs.totalLines).toBe(5);
expect(logs.lines).toEqual(["line 3", "line 4", "line 5"]);
});
test("runServiceCommand handles logs and status actions", async () => {
const stateDir = mkdtempSync(join(tmpdir(), "seal-use-service-"));
tempDirs.push(stateDir);
const status = await runServiceCommand("status", {
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir
});
expect(status).toHaveProperty("running");
const logs = await runServiceCommand("logs", {
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir
});
expect(logs).toHaveProperty("lines");
});
});
+106 -12
View File
@@ -1,6 +1,7 @@
import { spawn, execFileSync } from "node:child_process";
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { startHttpServer, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST } from "../http/server.js";
export type ServiceConfig = {
appRoot: string;
@@ -11,12 +12,14 @@ export type ServiceConfig = {
command: string;
args?: string[];
};
port?: number;
host?: string;
};
export async function runServiceCommand(
action: string | undefined,
config: ServiceConfig,
options: { quiet?: boolean } = {}
options: { quiet?: boolean; maxLines?: number } = {}
) {
switch (action) {
case "run":
@@ -25,31 +28,55 @@ export async function runServiceCommand(
case "start":
return startService(config);
case "stop":
case "kill":
case "down":
case "shutdown":
return stopService(config, options);
case "restart":
stopService(config, { quiet: true });
return startService(config);
case "logs":
case "log":
return readServiceLogs(config, options.maxLines);
case "status":
case undefined:
return serviceStatus(config);
default:
throw new Error("Usage: seal-use service <start|stop|restart|status>");
throw new Error("Usage: seal-use service <start|stop|restart|status|logs>");
}
}
export function serviceStatus(config: ServiceConfig) {
const pidFile = getPidFile(config);
const metaFile = getMetaFile(config);
const pid = readServicePid(pidFile);
const running = pid ? isSealHomeProcess(pid, config.appRoot) : false;
if (pid && !running) {
rmSync(pidFile, { force: true });
if (!running) {
if (pid) rmSync(pidFile, { force: true });
if (existsSync(metaFile)) rmSync(metaFile, { force: true });
}
let storedMeta: { port?: number; host?: string; version?: string } | undefined;
if (running && existsSync(metaFile)) {
try {
storedMeta = JSON.parse(readFileSync(metaFile, "utf8"));
} catch {
// ignore
}
}
const port = config.port ?? storedMeta?.port ?? (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : DEFAULT_HTTP_PORT);
const host = config.host ?? storedMeta?.host ?? (process.env.HOST ? process.env.HOST : DEFAULT_HTTP_HOST);
const version = config.version ?? storedMeta?.version;
return {
running,
pid: running ? pid : undefined,
version: config.version,
version,
port,
host,
url: running ? `http://${host}:${port}` : undefined,
appRoot: config.appRoot,
stateDir: config.stateDir,
pidFile,
@@ -57,28 +84,84 @@ export function serviceStatus(config: ServiceConfig) {
};
}
export function readServiceLogs(config: ServiceConfig, maxLines = 50) {
const logFile = getLogFile(config);
if (!existsSync(logFile)) {
return {
logFile,
lines: [],
totalLines: 0
};
}
const content = readFileSync(logFile, "utf8");
const allLines = content.split("\n").filter(Boolean);
const lines = allLines.slice(-maxLines);
return {
logFile,
lines,
totalLines: allLines.length
};
}
async function runService(config: ServiceConfig) {
const pidFile = getPidFile(config);
const metaFile = getMetaFile(config);
const logFile = getLogFile(config);
ensureStateDir(config.stateDir);
writeFileSync(pidFile, `${process.pid}\n`, { mode: 0o600 });
appendLog(logFile, `running pid=${process.pid}`);
const cleanup = () => {
const port = config.port ?? (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : DEFAULT_HTTP_PORT);
const host = config.host ?? (process.env.HOST ? process.env.HOST : DEFAULT_HTTP_HOST);
writeFileSync(pidFile, `${process.pid}\n`, { mode: 0o600 });
writeFileSync(
metaFile,
JSON.stringify(
{
pid: process.pid,
port,
host,
version: config.version,
startedAt: new Date().toISOString()
},
null,
2
),
{ mode: 0o600 }
);
appendLog(logFile, `service starting on http://${host}:${port} pid=${process.pid}`);
let server: Awaited<ReturnType<typeof startHttpServer>> | null = null;
try {
server = await startHttpServer({ port, host, silent: true });
appendLog(logFile, `service listening pid=${process.pid}`);
} catch (err: unknown) {
appendLog(logFile, `service failed to bind port ${port}: ${err instanceof Error ? err.message : String(err)}`);
if (readServicePid(pidFile) === process.pid) {
rmSync(pidFile, { force: true });
rmSync(metaFile, { force: true });
}
throw err;
}
const cleanup = () => {
if (server) {
server.close();
server = null;
}
if (readServicePid(pidFile) === process.pid) {
rmSync(pidFile, { force: true });
rmSync(metaFile, { force: true });
}
appendLog(logFile, `stopped pid=${process.pid}`);
};
await new Promise<void>((resolve) => {
let stopped = false;
const heartbeat = setInterval(() => {}, 60_000);
const stop = () => {
if (stopped) return;
stopped = true;
cleanup();
clearInterval(heartbeat);
process.off("SIGTERM", stop);
process.off("SIGINT", stop);
resolve();
@@ -96,11 +179,15 @@ function startService(config: ServiceConfig) {
}
const launcher = config.launcher ?? { command: process.execPath, args: [config.entryFile] };
const child = spawn(launcher.command, [
const serviceArgs = [
...(launcher.args ?? []),
"service",
"run"
], {
];
if (config.port) serviceArgs.push("--port", String(config.port));
if (config.host) serviceArgs.push("--host", String(config.host));
const child = spawn(launcher.command, serviceArgs, {
cwd: config.appRoot,
detached: true,
stdio: ["ignore", "ignore", "ignore"],
@@ -116,14 +203,17 @@ function startService(config: ServiceConfig) {
function stopService(config: ServiceConfig, options: { quiet?: boolean } = {}) {
const pidFile = getPidFile(config);
const metaFile = getMetaFile(config);
const pid = readServicePid(pidFile);
if (!pid || !isSealHomeProcess(pid, config.appRoot)) {
rmSync(pidFile, { force: true });
rmSync(metaFile, { force: true });
return options.quiet ? undefined : { stopped: false, reason: "not running" };
}
process.kill(pid, "SIGTERM");
rmSync(pidFile, { force: true });
rmSync(metaFile, { force: true });
appendLog(getLogFile(config), `stop requested pid=${pid}`);
return options.quiet ? undefined : { stopped: true, pid };
}
@@ -156,6 +246,10 @@ function getPidFile(config: ServiceConfig) {
return join(config.stateDir, "service.pid");
}
function getMetaFile(config: ServiceConfig) {
return join(config.stateDir, "service.json");
}
function getLogFile(config: ServiceConfig) {
return join(config.stateDir, "service.log");
}
+352
View File
@@ -0,0 +1,352 @@
import { describe, test, expect, beforeEach, afterEach } from "bun:test";
import fs from "node:fs";
import path from "node:path";
import os from "node:os";
import {
extractApprovalRunAttachments,
downloadApprovalRunAttachments,
sanitizeUrlForLog,
sanitizeFileName,
type FetchLike
} from "./attachments.js";
import type { ApprovalRun } from "./types.js";
describe("attachments domain", () => {
let tmpDir: string;
beforeEach(async () => {
tmpDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "seal-att-test-"));
});
afterEach(async () => {
try {
await fs.promises.rm(tmpDir, { recursive: true, force: true });
} catch {}
});
test("sanitizeUrlForLog masks query string signatures", () => {
const rawUrl = "https://oss-bucket.aliyuncs.com/tenant/doc1/pic.jpg?X-Amz-Signature=secret123&OSSAccessKeyId=key456";
const masked = sanitizeUrlForLog(rawUrl);
expect(masked).toBe("https://oss-bucket.aliyuncs.com/tenant/doc1/pic.jpg?[MASKED]");
expect(masked).not.toContain("secret123");
expect(masked).not.toContain("key456");
const plainUrl = "https://example.com/files/receipt.pdf";
expect(sanitizeUrlForLog(plainUrl)).toBe("https://example.com/files/receipt.pdf");
});
test("sanitizeFileName strips dangerous characters", () => {
expect(sanitizeFileName("foo/bar:baz?.png")).toBe("foo_bar_baz_.png");
expect(sanitizeFileName("../../evil.exe")).toBe(".._.._evil.exe");
expect(sanitizeFileName("")).toBe("attachment");
});
test("extractApprovalRunAttachments extracts attachments from Issue #35 field structure", () => {
const fixture: ApprovalRun = {
id: "run-hose-1",
status: "completed",
sourceDocumentSN: "BX2026080001",
sourceDocumentId: "doc-hose-1",
document: {
id: "doc-1",
sn: "BX2026080001",
fields: [
{ key: "expense_type", label: "费用类型", value: "差旅" },
{
key: "attachments",
type: "ATTACHMENT",
label: "附件",
value: [
{
url: "https://oss-bucket.aliyuncs.com/tenant/attachments/doc1/receipt1.jpg",
ossSignedUrl: "https://oss-bucket.aliyuncs.com/tenant/attachments/doc1/receipt1.jpg?X-Amz-Signature=sig1",
name: "发票1.jpg",
token: JSON.stringify({ source: "hosecloud", fileId: "file-101", key: "obj-key-101" }),
fileId: "file-101",
ossPath: "tenant/attachments/doc1/obj-key-101",
category: "file",
mimeType: "image/jpeg",
ossFileSize: 1024
},
{
url: "https://oss-bucket.aliyuncs.com/tenant/attachments/doc1/receipt2.jpg",
ossSignedUrl: "https://oss-bucket.aliyuncs.com/tenant/attachments/doc1/receipt2.jpg?X-Amz-Signature=sig2",
name: "水单2.jpg",
token: JSON.stringify({ source: "hosecloud", fileId: "file-102", key: "obj-key-102" }),
fileId: "file-102",
ossPath: "tenant/attachments/doc1/obj-key-102",
category: "file",
mimeType: "image/jpeg",
ossFileSize: 2048
},
{
url: "https://oss-bucket.aliyuncs.com/tenant/attachments/doc1/doc3.pdf",
ossSignedUrl: "https://oss-bucket.aliyuncs.com/tenant/attachments/doc1/doc3.pdf?X-Amz-Signature=sig3",
name: "行程单.pdf",
token: JSON.stringify({ source: "hosecloud", fileId: "file-103", key: "obj-key-103" }),
fileId: "file-103",
category: "file",
mimeType: "application/pdf",
ossFileSize: 4096
},
{
url: "https://oss-bucket.aliyuncs.com/tenant/attachments/doc1/photo4.png",
ossSignedUrl: "https://oss-bucket.aliyuncs.com/tenant/attachments/doc1/photo4.png?X-Amz-Signature=sig4",
name: "现场打卡.png",
token: JSON.stringify({ source: "hosecloud", fileId: "file-104", key: "obj-key-104" }),
fileId: "file-104",
category: "file",
mimeType: "image/png",
ossFileSize: 8192
}
]
}
]
}
};
const fullResult = extractApprovalRunAttachments(fixture);
expect(fullResult.count).toBe(4);
expect(fullResult.recordId).toBe("run-hose-1");
expect(fullResult.sourceDocumentSN).toBe("BX2026080001");
const first = fullResult.attachments[0] as any;
expect(first.fileName).toBe("发票1.jpg");
expect(first.fileId).toBe("file-101");
expect(first.tokenKey).toBe("obj-key-101");
expect(first.ossFileSize).toBe(1024);
expect(first.ossSignedUrl).toContain("X-Amz-Signature=sig1");
expect(first.sourceField).toBe("附件");
expect(first.kind).toBe("invoice"); // "发票" in name triggers invoice kind
const summaryResult = extractApprovalRunAttachments(fixture, { summary: true });
expect(summaryResult.count).toBe(4);
expect((summaryResult.attachments[0] as any).hasSignedUrl).toBe(true);
expect((summaryResult.attachments[0] as any).ossFileSize).toBe(1024);
expect((summaryResult.attachments[0] as any).ossSignedUrl).toBeUndefined(); // summary masks raw url
});
test("extractApprovalRunAttachments extracts attachments from legacy layout", () => {
const fixture: ApprovalRun = {
id: "run-legacy-1",
status: "completed",
document: {
fields: [
{
label: "附件",
attachments: [
{
fileName: "legacy.pdf",
fileId: "file-legacy-1",
mimeType: "application/pdf",
ossPath: "oss://bucket/legacy.pdf"
}
]
}
]
}
};
const result = extractApprovalRunAttachments(fixture);
expect(result.count).toBe(1);
expect((result.attachments[0] as any).fileName).toBe("legacy.pdf");
expect((result.attachments[0] as any).fileId).toBe("file-legacy-1");
});
test("downloadApprovalRunAttachments downloads all files with --all and matches size", async () => {
const content1 = Buffer.from("Invoice mock data 12345");
const content2 = Buffer.from("Receipt mock data 67890");
const fakeFetch: FetchLike = async (url: any) => {
const urlStr = String(url);
if (urlStr.includes("att1.jpg")) {
return new Response(content1, { status: 200 });
}
if (urlStr.includes("att2.jpg")) {
return new Response(content2, { status: 200 });
}
return new Response("Not found", { status: 404 });
};
const record: ApprovalRun = {
id: "run-dl-1",
document: {
fields: [
{
key: "attachments",
type: "ATTACHMENT",
label: "附件",
value: [
{
name: "发票.jpg",
ossSignedUrl: "https://oss.example.com/att1.jpg?sign=abc",
ossFileSize: content1.length
},
{
name: "水单.jpg",
ossSignedUrl: "https://oss.example.com/att2.jpg?sign=def",
ossFileSize: content2.length
}
]
}
]
}
};
const result = await downloadApprovalRunAttachments({
record,
all: true,
outDir: tmpDir,
fetchFn: fakeFetch
});
expect(result.total).toBe(2);
expect(result.downloaded).toBe(2);
expect(result.failed).toBe(0);
const file1Path = path.join(tmpDir, "发票.jpg");
const file2Path = path.join(tmpDir, "水单.jpg");
expect(fs.existsSync(file1Path)).toBe(true);
expect(fs.existsSync(file2Path)).toBe(true);
expect(fs.readFileSync(file1Path)).toEqual(content1);
expect(fs.readFileSync(file2Path)).toEqual(content2);
});
test("downloadApprovalRunAttachments filters by --name", async () => {
const content = Buffer.from("Target attachment data");
const fakeFetch: FetchLike = async () => new Response(content, { status: 200 });
const record: ApprovalRun = {
id: "run-dl-2",
document: {
fields: [
{
key: "attachments",
type: "ATTACHMENT",
value: [
{ name: "test_a.pdf", ossSignedUrl: "https://oss.example.com/a.pdf" },
{ name: "target_b.pdf", ossSignedUrl: "https://oss.example.com/b.pdf" }
]
}
]
}
};
const result = await downloadApprovalRunAttachments({
record,
name: "target_b",
outDir: tmpDir,
fetchFn: fakeFetch
});
expect(result.total).toBe(1);
expect(result.downloaded).toBe(1);
expect(result.files[0]!.name).toBe("target_b.pdf");
expect(fs.existsSync(path.join(tmpDir, "target_b.pdf"))).toBe(true);
expect(fs.existsSync(path.join(tmpDir, "test_a.pdf"))).toBe(false);
});
test("downloadApprovalRunAttachments requires --all when multiple attachments exist without filter", async () => {
const record: ApprovalRun = {
id: "run-dl-3",
document: {
fields: [
{
key: "attachments",
type: "ATTACHMENT",
value: [
{ name: "f1.jpg", ossSignedUrl: "https://oss.example.com/1.jpg" },
{ name: "f2.jpg", ossSignedUrl: "https://oss.example.com/2.jpg" }
]
}
]
}
};
expect(
downloadApprovalRunAttachments({
record,
outDir: tmpDir
})
).rejects.toThrow("请使用 --all 下载全部附件");
});
test("downloadApprovalRunAttachments handles expired URL (HTTP 403) gracefully without aborting others", async () => {
const validContent = Buffer.from("Valid attachment data");
const fakeFetch: FetchLike = async (url: any) => {
const urlStr = String(url);
if (urlStr.includes("expired.jpg")) {
return new Response("Access Denied / Expired", { status: 403, statusText: "Forbidden" });
}
return new Response(validContent, { status: 200 });
};
const record: ApprovalRun = {
id: "run-dl-4",
document: {
fields: [
{
key: "attachments",
type: "ATTACHMENT",
value: [
{ name: "expired.jpg", ossSignedUrl: "https://oss.example.com/expired.jpg?sign=old" },
{ name: "valid.jpg", ossSignedUrl: "https://oss.example.com/valid.jpg?sign=fresh" }
]
}
]
}
};
const result = await downloadApprovalRunAttachments({
record,
all: true,
outDir: tmpDir,
fetchFn: fakeFetch
});
expect(result.total).toBe(2);
expect(result.downloaded).toBe(1);
expect(result.failed).toBe(1);
const failedItem = result.files.find((f) => f.name === "expired.jpg");
expect(failedItem?.status).toBe("failed");
expect(failedItem?.error).toContain("403");
const successItem = result.files.find((f) => f.name === "valid.jpg");
expect(successItem?.status).toBe("success");
expect(fs.existsSync(path.join(tmpDir, "valid.jpg"))).toBe(true);
});
test("downloadApprovalRunAttachments disambiguates duplicate filenames", async () => {
const fakeFetch: FetchLike = async () => new Response("data", { status: 200 });
const record: ApprovalRun = {
id: "run-dl-5",
document: {
fields: [
{
key: "attachments",
type: "ATTACHMENT",
value: [
{ name: "same.jpg", ossSignedUrl: "https://oss.example.com/1.jpg" },
{ name: "same.jpg", ossSignedUrl: "https://oss.example.com/2.jpg" }
]
}
]
}
};
const result = await downloadApprovalRunAttachments({
record,
all: true,
outDir: tmpDir,
fetchFn: fakeFetch
});
expect(result.downloaded).toBe(2);
expect(result.files.map((f) => f.name)).toEqual(["same.jpg", "same_1.jpg"]);
expect(fs.existsSync(path.join(tmpDir, "same.jpg"))).toBe(true);
expect(fs.existsSync(path.join(tmpDir, "same_1.jpg"))).toBe(true);
});
});
+427
View File
@@ -0,0 +1,427 @@
import fs from "node:fs";
import path from "node:path";
import type { ApprovalRun } from "./types.js";
export interface ApprovalRunAttachment {
path: string;
fieldPath: string;
kind: string;
fileName?: string;
mimeType?: string;
fileId?: string;
ossPath?: string;
url?: string;
ossSignedUrl?: string;
token?: unknown;
tokenKey?: string;
category?: string;
ossFileSize?: number;
invoiceId?: string;
sourceField?: string;
}
export interface ApprovalRunAttachmentsResult {
recordId: string;
sourceDocumentSN?: string;
sourceDocumentId?: string;
count: number;
attachments: Array<Record<string, unknown>>;
}
export type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
export interface DownloadAttachmentsOptions {
record: ApprovalRun;
all?: boolean;
name?: string;
outDir?: string;
fetchFn?: FetchLike;
}
export interface DownloadedAttachmentFile {
name: string;
fileId?: string;
path?: string;
size?: number;
expectedSize?: number;
status: "success" | "failed";
error?: string;
sourceField?: string;
tokenKey?: string;
}
export interface DownloadAttachmentsResult {
recordId: string;
outDir: string;
total: number;
downloaded: number;
failed: number;
files: DownloadedAttachmentFile[];
}
interface CollectContext {
fieldLabel?: string;
fieldKey?: string;
fieldType?: string;
}
export function sanitizeUrlForLog(url: string): string {
try {
const parsed = new URL(url);
if (parsed.search) {
return `${parsed.origin}${parsed.pathname}?[MASKED]`;
}
return url;
} catch {
return url.replace(/\?.*$/, "?[MASKED]");
}
}
export function sanitizeFileName(name: string): string {
const cleaned = name.replace(/[/\\?%*:|"<>]/g, "_").trim();
return cleaned || "attachment";
}
function compactObject(object: Record<string, unknown>) {
return Object.fromEntries(Object.entries(object).filter(([, value]) => value !== undefined));
}
function asRecord(value: unknown): Record<string, unknown> | undefined {
return value && typeof value === "object" && !Array.isArray(value)
? value as Record<string, unknown>
: undefined;
}
function stringFromUnknown(value: unknown): string | undefined {
return typeof value === "string" && value.trim() ? value.trim() : undefined;
}
function numberFromUnknown(value: unknown): number | undefined {
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
}
function tryParseToken(token: unknown): Record<string, unknown> | undefined {
if (!token) return undefined;
if (typeof token === "string") {
try {
const parsed = JSON.parse(token);
if (parsed && typeof parsed === "object") return parsed as Record<string, unknown>;
} catch {
return undefined;
}
}
if (typeof token === "object" && !Array.isArray(token)) {
return token as Record<string, unknown>;
}
return undefined;
}
function looksLikeAttachment(object: Record<string, unknown>, path: string, context?: CollectContext): boolean {
// If parent field explicitly declares ATTACHMENT type, any item with file properties is an attachment
if (context?.fieldType?.toUpperCase() === "ATTACHMENT") {
const hasIdentifier = Boolean(
object.fileName ||
object.filename ||
object.name ||
object.originalName ||
object.fileId ||
object.ossPath ||
object.url ||
object.ossSignedUrl ||
object.signedUrl ||
object.token
);
if (hasIdentifier) return true;
}
// Explicit signed URL presence always indicates a download-ready attachment
if (object.ossSignedUrl || object.signedUrl) {
return true;
}
// Check common file identity properties
const fileName = object.fileName ?? object.filename ?? object.name ?? object.originalName;
const fileId = object.fileId ?? object.id ?? object.attachmentId;
const ossPath = object.ossPath ?? object.ossKey;
const url = object.url ?? object.downloadUrl ?? object.previewUrl;
const mimeType = object.mimeType ?? object.mimetype ?? object.contentType;
const ossFileSize = object.ossFileSize ?? object.fileSize ?? object.size;
if (fileName && (url || ossPath || fileId || ossFileSize)) {
return true;
}
if (fileId && (mimeType || ossFileSize || ossPath || url)) {
return true;
}
// Legacy path and keyword based heuristics
const keys = Object.keys(object).map((k) => k.toLowerCase());
const pathHint = /(attachment|attachments|invoice|receipt|file|files|附件|发票)/i.test(path) ||
Boolean(context?.fieldKey && /(attachment|attachments|invoice|receipt|file|files|附件|发票)/i.test(context.fieldKey)) ||
Boolean(context?.fieldLabel && /(attachment|attachments|invoice|receipt|file|files|附件|发票)/i.test(context.fieldLabel));
const fileHints = [
"filename", "filename", "mimetype", "contenttype",
"fileid", "osspath", "signedurl", "downloadurl",
"previewurl", "attachmentid", "ossfilesize", "osssignedurl"
];
return pathHint && fileHints.some((hint) => keys.includes(hint));
}
function inferAttachmentKind(path: string, object: Record<string, unknown>, context?: CollectContext): string {
const normalized = `${path} ${context?.fieldLabel ?? ""} ${context?.fieldKey ?? ""} ${stringFromUnknown(object.type) ?? ""} ${stringFromUnknown(object.category) ?? ""}`.toLowerCase();
if (normalized.includes("invoice") || normalized.includes("发票")) return "invoice";
if (normalized.includes("receipt")) return "receipt";
const name = (stringFromUnknown(object.fileName) ?? stringFromUnknown(object.name) ?? "").toLowerCase();
if (name.includes("发票") || name.includes("invoice")) return "invoice";
return "attachment";
}
function collectAttachments(
value: unknown,
path: string,
output: Array<Record<string, unknown>>,
seen: Set<string>,
context?: CollectContext
) {
if (Array.isArray(value)) {
value.forEach((item, index) => collectAttachments(item, `${path}.${index}`, output, seen, context));
return;
}
const object = asRecord(value);
if (!object) return;
// Determine if this object is a field container (e.g. in document.fields[])
const isFieldContainer = (object.type && typeof object.type === "string") ||
("label" in object && "value" in object) ||
("key" in object && "value" in object);
let nextContext = context;
if (isFieldContainer) {
nextContext = {
fieldLabel: stringFromUnknown(object.label) ?? context?.fieldLabel,
fieldKey: stringFromUnknown(object.key) ?? context?.fieldKey,
fieldType: stringFromUnknown(object.type) ?? context?.fieldType
};
}
// If this object itself qualifies as an attachment file
// (containers that just have array value without url/fileId are not attachment files)
const isContainerOnly = Array.isArray(object.value) && !object.url && !object.ossSignedUrl && !object.fileId;
if (!isContainerOnly && looksLikeAttachment(object, path, context)) {
const parsedToken = tryParseToken(object.token);
const tokenKey = stringFromUnknown(parsedToken?.key);
const tokenFileId = stringFromUnknown(parsedToken?.fileId);
const attachment = compactObject({
path,
fieldPath: path,
kind: inferAttachmentKind(path, object, context),
fileName: stringFromUnknown(object.fileName) ?? stringFromUnknown(object.filename) ?? stringFromUnknown(object.name) ?? stringFromUnknown(object.originalName),
mimeType: stringFromUnknown(object.mimeType) ?? stringFromUnknown(object.mimetype) ?? stringFromUnknown(object.contentType),
fileId: stringFromUnknown(object.fileId) ?? stringFromUnknown(object.id) ?? stringFromUnknown(object.attachmentId) ?? tokenFileId,
ossPath: stringFromUnknown(object.ossPath) ?? stringFromUnknown(object.ossKey) ?? tokenKey,
url: stringFromUnknown(object.url) ?? stringFromUnknown(object.signedUrl) ?? stringFromUnknown(object.downloadUrl) ?? stringFromUnknown(object.previewUrl),
ossSignedUrl: stringFromUnknown(object.ossSignedUrl) ?? stringFromUnknown(object.signedUrl),
token: object.token,
tokenKey,
category: stringFromUnknown(object.category),
ossFileSize: numberFromUnknown(object.ossFileSize) ?? numberFromUnknown(object.fileSize) ?? numberFromUnknown(object.size),
invoiceId: stringFromUnknown(object.invoiceId),
sourceField: stringFromUnknown(object.fieldName) ?? stringFromUnknown(object.label) ?? context?.fieldLabel ?? context?.fieldKey
});
const key = JSON.stringify(attachment);
if (!seen.has(key)) {
seen.add(key);
output.push(attachment);
}
}
for (const [key, child] of Object.entries(object)) {
collectAttachments(child, `${path}.${key}`, output, seen, nextContext);
}
}
export function extractApprovalRunAttachments(
record: ApprovalRun,
options: { summary?: boolean } = {}
): ApprovalRunAttachmentsResult {
const roots: Array<[string, unknown]> = [
["document", record.document],
["result", record.result],
["pipelineData", record.pipelineData],
["sourceExtendData", record.sourceExtendData]
];
const attachments: Array<Record<string, unknown>> = [];
const seen = new Set<string>();
for (const [path, value] of roots) {
collectAttachments(value, path, attachments, seen);
}
return {
recordId: record.id,
sourceDocumentSN: record.sourceDocumentSN,
sourceDocumentId: record.sourceDocumentId,
count: attachments.length,
attachments: options.summary
? attachments.map((attachment) => compactObject({
path: attachment.path,
kind: attachment.kind,
fileName: attachment.fileName,
mimeType: attachment.mimeType,
fileId: attachment.fileId,
sourceField: attachment.sourceField,
ossFileSize: attachment.ossFileSize,
hasSignedUrl: Boolean(attachment.ossSignedUrl)
}))
: attachments
};
}
export async function downloadApprovalRunAttachments(
options: DownloadAttachmentsOptions
): Promise<DownloadAttachmentsResult> {
const { record, fetchFn = globalThis.fetch } = options;
const extraction = extractApprovalRunAttachments(record, { summary: false });
const allAttachments = extraction.attachments as unknown as ApprovalRunAttachment[];
const resolvedOutDir = path.resolve(options.outDir ?? "./attachments");
if (allAttachments.length === 0) {
return {
recordId: record.id,
outDir: resolvedOutDir,
total: 0,
downloaded: 0,
failed: 0,
files: []
};
}
let selected: ApprovalRunAttachment[] = [];
if (options.name) {
const term = options.name.toLowerCase();
selected = allAttachments.filter((att) => {
const fileName = att.fileName?.toLowerCase() ?? "";
const fileId = att.fileId?.toLowerCase() ?? "";
const tokenKey = att.tokenKey?.toLowerCase() ?? "";
return fileName.includes(term) || fileId === term || tokenKey.includes(term);
});
if (selected.length === 0) {
const available = allAttachments.map((a) => a.fileName ?? a.fileId).filter(Boolean).join(", ");
throw new Error(`未找到匹配 "${options.name}" 的附件。可选附件: ${available || "无"}`);
}
} else if (!options.all) {
if (allAttachments.length > 1) {
const available = allAttachments.map((a) => a.fileName ?? a.fileId).filter(Boolean).join(", ");
throw new Error(
`共发现 ${allAttachments.length} 个附件。请使用 --all 下载全部附件,或使用 --name <名称|fileId> 指定下载项。可选附件: ${available}`
);
}
selected = allAttachments;
} else {
selected = allAttachments;
}
await fs.promises.mkdir(resolvedOutDir, { recursive: true });
const files: DownloadedAttachmentFile[] = [];
const usedNames = new Set<string>();
for (const attachment of selected) {
const rawName = attachment.fileName ?? attachment.fileId ?? "attachment";
const safeBase = sanitizeFileName(rawName);
let targetName = safeBase;
const lastDot = safeBase.lastIndexOf(".");
const stem = lastDot > 0 ? safeBase.slice(0, lastDot) : safeBase;
const ext = lastDot > 0 ? safeBase.slice(lastDot) : "";
let counter = 1;
while (usedNames.has(targetName.toLowerCase())) {
targetName = `${stem}_${counter}${ext}`;
counter++;
}
usedNames.add(targetName.toLowerCase());
const downloadUrl = attachment.ossSignedUrl ?? attachment.url;
if (!downloadUrl) {
console.error(`⚠️ [跳过] 附件 "${rawName}": 记录中无下载直链 (ossSignedUrl/url)`);
files.push({
name: targetName,
fileId: attachment.fileId,
status: "failed",
error: "缺少可用的下载直链 (ossSignedUrl/url)。",
sourceField: attachment.sourceField,
tokenKey: attachment.tokenKey
});
continue;
}
const sanitizedUrl = sanitizeUrlForLog(downloadUrl);
try {
const response = await fetchFn(downloadUrl, {
signal: AbortSignal.timeout(60000)
});
if (!response.ok) {
const errorMsg = response.status === 403
? "HTTP 403 Forbidden: 签名直链可能已过期"
: `HTTP ${response.status} ${response.statusText}`;
throw new Error(errorMsg);
}
const arrayBuffer = await response.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
if (attachment.ossFileSize !== undefined && buffer.length !== attachment.ossFileSize) {
console.error(`⚠️ [校验] 附件 "${targetName}" 实际大小 (${buffer.length} 字节) 与 ossFileSize (${attachment.ossFileSize} 字节) 不一致`);
}
const filePath = path.join(resolvedOutDir, targetName);
await fs.promises.writeFile(filePath, buffer);
console.error(`✓ 已下载: ${targetName} (${buffer.length} 字节)`);
files.push({
name: targetName,
fileId: attachment.fileId,
path: filePath,
size: buffer.length,
expectedSize: attachment.ossFileSize,
status: "success",
sourceField: attachment.sourceField,
tokenKey: attachment.tokenKey
});
} catch (err: any) {
const msg = err.message ?? String(err);
console.error(`⚠️ [失败] 附件 "${rawName}" 下载失败: ${msg} [${sanitizedUrl}]`);
files.push({
name: targetName,
fileId: attachment.fileId,
status: "failed",
error: msg,
sourceField: attachment.sourceField,
tokenKey: attachment.tokenKey
});
}
}
const downloaded = files.filter((f) => f.status === "success").length;
const failed = files.filter((f) => f.status === "failed").length;
return {
recordId: record.id,
outDir: resolvedOutDir,
total: selected.length,
downloaded,
failed,
files
};
}
+163
View File
@@ -0,0 +1,163 @@
import { describe, expect, test, afterEach } from "bun:test";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import {
parseLocalRulesContent,
loadLocalRulesFile,
saveLocalRulesFile,
localRulesToLintTargets
} from "./rules-local.js";
import { findSealTool } from "./tools.js";
const tempDirs: string[] = [];
afterEach(() => {
for (const dir of tempDirs.splice(0)) {
rmSync(dir, { recursive: true, force: true });
}
});
describe("rules-local workspace", () => {
test("parses wrapped rules object", () => {
const raw = JSON.stringify({
corpId: "corp-1",
source: "draft",
rules: [
{ code: 1, description: "餐饮发票必须提供水单", scope: "MEAL", strictness: "MUST_FOLLOW" },
{ code: 2, description: "单张发票金额不得超标", scope: "ALL" }
]
});
const parsed = parseLocalRulesContent(raw);
expect(parsed.rules.length).toBe(2);
expect(parsed.meta.corpId).toBe("corp-1");
expect(parsed.meta.source).toBe("draft");
expect(parsed.rules[0]!.description).toBe("餐饮发票必须提供水单");
expect(parsed.rules[0]!.strictness).toBe("MUST_FOLLOW");
expect(parsed.rules[1]!.strictness).toBe("MUST_FOLLOW"); // default
});
test("parses raw rules array", () => {
const raw = JSON.stringify([
{ description: "打车必须备注起止地点", scope: "TAXI" }
]);
const parsed = parseLocalRulesContent(raw);
expect(parsed.rules.length).toBe(1);
expect(parsed.rules[0]!.description).toBe("打车必须备注起止地点");
expect(parsed.rules[0]!.code).toBe(1);
});
test("rejects invalid format or empty description", () => {
expect(() => parseLocalRulesContent("not-json")).toThrow("JSON 解析失败");
expect(() => parseLocalRulesContent(JSON.stringify({ other: 123 }))).toThrow("本地规则文件格式错误");
expect(() => parseLocalRulesContent(JSON.stringify([{ code: 1 }]))).toThrow("缺少有效的 'description'");
});
test("saves and loads local rules file accurately", () => {
const dir = mkdtempSync(join(tmpdir(), "seal-rules-test-"));
tempDirs.push(dir);
const filePath = join(dir, "sub", "rules.json");
const savedPath = saveLocalRulesFile(filePath, {
corpId: "test-corp",
source: "version:5",
rules: [
{ code: 10, description: "酒店住宿必须提供明细清单", scope: "HOTEL", strictness: "MUST_FOLLOW" }
]
});
expect(savedPath).toBe(filePath);
const loaded = loadLocalRulesFile(filePath);
expect(loaded.rules.length).toBe(1);
expect(loaded.meta.corpId).toBe("test-corp");
expect(loaded.rules[0]!.code).toBe(10);
expect(loaded.rules[0]!.description).toBe("酒店住宿必须提供明细清单");
});
test("converts local rules to lint targets", () => {
const targets = localRulesToLintTargets([
{ code: 1, description: "规则一", name: "R1" },
{ code: "0002", description: "规则二" },
{ description: "规则三" }
]);
expect(targets[0]!.code).toBe("#0001");
expect(targets[0]!.name).toBe("R1");
expect(targets[1]!.code).toBe("#0002");
expect(targets[2]!.code).toBe("#0003");
});
});
describe("rules-local offline lint tool integration", () => {
test("lints local file directly with 0 network calls and high score", async () => {
const dir = mkdtempSync(join(tmpdir(), "seal-lint-test-"));
tempDirs.push(dir);
const filePath = join(dir, "clean-rules.json");
saveLocalRulesFile(filePath, {
corpId: "test-corp",
rules: [
{
code: 1,
description: "单张发票金额超过500元时,必须提供经办人签字的费用明细水单与消费清单。",
scope: "MEAL",
strictness: "MUST_FOLLOW"
}
]
});
const lintTool = findSealTool("seal_approval_rules_lint")!;
expect(lintTool).toBeDefined();
const result = await lintTool.handler(
null as any,
{ file: filePath } as any,
{ corp: { id: "test-corp" } } as any
) as any;
expect(result.totalRules).toBe(1);
expect(result.passed).toBe(true);
expect(result.overallScore).toBe(100);
});
test("detects vague wording in local rules file and enforces minScore gate", async () => {
const dir = mkdtempSync(join(tmpdir(), "seal-lint-test-"));
tempDirs.push(dir);
const filePath = join(dir, "vague-rules.json");
saveLocalRulesFile(filePath, {
corpId: "test-corp",
rules: [
{
code: 1,
description: "金额适当即可,视情况而定。",
scope: "ALL"
}
]
});
const lintTool = findSealTool("seal_approval_rules_lint")!;
const result = await lintTool.handler(
null as any,
{ file: filePath } as any,
{ corp: { id: "test-corp" } } as any
) as any;
expect(result.totalRules).toBe(1);
expect(result.overallScore).toBeLessThan(100);
expect(result.issues[0].issues.some((i: any) => i.code === "VAGUE_WORD")).toBe(true);
// minScore enforcement
await expect(
lintTool.handler(
null as any,
{ file: filePath, minScore: 95 } as any,
{ corp: { id: "test-corp" } } as any
)
).rejects.toThrow("Linter 质量门禁未通过");
});
});
+153
View File
@@ -0,0 +1,153 @@
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
import { dirname, resolve } from "node:path";
import type { RuleLintTarget } from "./linter/types.js";
export interface LocalRuleItem {
id?: string;
code?: number | string;
name?: string;
description: string;
scope?: string;
strictness?: string;
status?: string;
[key: string]: unknown;
}
export interface LocalRulesPayload {
corpId?: string;
source?: string;
versionNumber?: number;
exportedAt?: string;
rulesCount?: number;
rules: LocalRuleItem[];
}
/**
* Parses raw local rule content (JSON array or object with `rules` array)
* and normalizes them into a consistent structure.
*/
export function parseLocalRulesContent(rawText: string): {
rules: LocalRuleItem[];
meta: Omit<LocalRulesPayload, "rules">;
} {
let parsed: unknown;
try {
parsed = JSON.parse(rawText);
} catch (err) {
throw new Error(`本地规则文件 JSON 解析失败: ${err instanceof Error ? err.message : String(err)}`);
}
if (Array.isArray(parsed)) {
return {
rules: normalizeRuleItems(parsed),
meta: {
rulesCount: parsed.length
}
};
}
if (parsed && typeof parsed === "object") {
const obj = parsed as Record<string, unknown>;
const rawRules = Array.isArray(obj.rules) ? obj.rules : undefined;
if (!rawRules) {
throw new Error("本地规则文件格式错误: 顶层必须为规则数组或包含 'rules' 数组的对象");
}
return {
rules: normalizeRuleItems(rawRules),
meta: {
corpId: typeof obj.corpId === "string" ? obj.corpId : undefined,
source: typeof obj.source === "string" ? obj.source : undefined,
versionNumber: typeof obj.versionNumber === "number" ? obj.versionNumber : undefined,
exportedAt: typeof obj.exportedAt === "string" ? obj.exportedAt : undefined,
rulesCount: rawRules.length
}
};
}
throw new Error("本地规则文件格式错误: 顶层必须为规则数组或包含 'rules' 数组的对象");
}
function normalizeRuleItems(items: unknown[]): LocalRuleItem[] {
return items.map((item, idx) => {
if (!item || typeof item !== "object") {
throw new Error(`第 ${idx + 1} 条规则格式错误: 必须为对象`);
}
const r = item as Record<string, unknown>;
const description = typeof r.description === "string" ? r.description.trim() : "";
if (!description) {
throw new Error(`第 ${idx + 1} 条规则缺少有效的 'description' (规则描述) 字段`);
}
const code =
typeof r.code === "number" || typeof r.code === "string"
? r.code
: idx + 1;
return {
...r,
code,
description,
scope: typeof r.scope === "string" ? r.scope : "ALL",
strictness: typeof r.strictness === "string" ? r.strictness : "MUST_FOLLOW"
};
});
}
/**
* Loads a local rules file from path.
*/
export function loadLocalRulesFile(filePath: string): {
rules: LocalRuleItem[];
meta: Omit<LocalRulesPayload, "rules">;
resolvedPath: string;
} {
const resolved = resolve(filePath);
if (!existsSync(resolved)) {
throw new Error(`未找到本地规则文件: ${filePath} (${resolved})`);
}
const content = readFileSync(resolved, "utf8");
const parsed = parseLocalRulesContent(content);
return {
...parsed,
resolvedPath: resolved
};
}
/**
* Saves rules to a formatted JSON file.
*/
export function saveLocalRulesFile(
filePath: string,
data: LocalRulesPayload
): string {
const resolved = resolve(filePath);
mkdirSync(dirname(resolved), { recursive: true });
writeFileSync(resolved, `${JSON.stringify(data, null, 2)}\n`, "utf8");
return resolved;
}
/**
* Converts local rule items to linter targets.
*/
export function localRulesToLintTargets(rules: LocalRuleItem[]): RuleLintTarget[] {
return rules.map((r, idx) => {
let codeStr: string | undefined;
if (typeof r.code === "number") {
codeStr = `#${String(r.code).padStart(4, "0")}`;
} else if (typeof r.code === "string") {
codeStr = r.code.startsWith("#") ? r.code : `#${r.code}`;
} else {
codeStr = `#${String(idx + 1).padStart(4, "0")}`;
}
return {
id: r.id,
code: codeStr,
name: r.name,
description: r.description,
scope: r.scope,
strictness: r.strictness
};
});
}
+209 -88
View File
@@ -9,7 +9,19 @@ import { loadGlobalConfig } from "../../core/config/loader.js";
import { createSealClientForToken } from "../../core/http/factory.js";
import { searchApprovalContent } from "./search.js";
import { loadRuleLinter, lintRuleBatch, lintSingleRule, type RuleLintTarget } from "./linter/index.js";
import {
loadLocalRulesFile,
saveLocalRulesFile,
localRulesToLintTargets,
type LocalRuleItem
} from "./rules-local.js";
import { previewMaterialPack, pushMaterialPack, readMaterialPackFile } from "./material-pack/index.js";
import {
extractApprovalRunAttachments,
downloadApprovalRunAttachments,
type ApprovalRunAttachment,
type DownloadAttachmentsResult
} from "./attachments.js";
import {
ThinkingPolicySchema,
type ApprovalRule,
@@ -440,8 +452,9 @@ export const sealTools = [
},
{
name: "seal_approval_rules_lint",
description: "对 Seal 草稿审批规则或指定发布版本规则进行质量与可执行性检查(模糊词、悬空例外检测)",
description: "对 Seal 本地规则文件、草稿审批规则或指定发布版本规则进行质量与可执行性检查(模糊词、悬空例外检测)",
parameters: z.object({
file: z.string().optional().describe("指定本地规则文件路径进行离线质检(支持 .json),0网络请求、不污染远端草稿"),
linter: z.string().optional().describe("指定使用的校验器名称或脚本路径(如 builtin、strict、./my-linter.ts)"),
version: z.string().optional().describe("指定要质检的历史发布版本号或 ID(如 16 或 latest),不传默认质检当前草稿"),
code: z.string().optional().describe("按规则展示编号过滤(如 #0038)"),
@@ -453,6 +466,7 @@ export const sealTools = [
handler: async (
client: KyInstance,
params: {
file?: string;
linter?: string;
version?: string;
code?: string;
@@ -466,7 +480,11 @@ export const sealTools = [
let targets: RuleLintTarget[] = [];
let versionNumber: number | undefined;
if (params.version) {
if (params.file) {
const local = loadLocalRulesFile(params.file);
targets = localRulesToLintTargets(local.rules);
versionNumber = local.meta.versionNumber;
} else if (params.version) {
const versions = await api.listApprovalRuleVersions(client);
const versionNumberParsed = Number(params.version);
const version = isNaN(versionNumberParsed)
@@ -515,7 +533,7 @@ export const sealTools = [
const batchResult = await lintRuleBatch(
targets,
loadedLinter,
{ corpId: context.corp.id, versionNumber, allRules: targets },
{ corpId: context?.corp?.id, versionNumber, allRules: targets },
{ minScore: params.minScore, level: params.level, summary: params.summary }
);
@@ -528,6 +546,164 @@ export const sealTools = [
return batchResult;
}
},
{
name: "seal_approval_rules_pull",
description: "从 Seal 远端拉取草稿或指定版本规则,保存至本地规则文件(支持离线编辑与本地 Lint,绝不污染远端草稿)",
parameters: z.object({
version: z.string().optional().describe("指定拉取的历史发布版本号或 ID(如 16 或 latest),不传默认拉取当前草稿规则"),
out: z.string().optional().describe("保存的目标本地文件路径,默认为 ./rules.local.json")
}),
handler: async (
client: KyInstance,
params: {
version?: string;
out?: string;
},
context: ToolContext
) => {
const outPath = params.out ?? "./rules.local.json";
let rules: LocalRuleItem[] = [];
let source = "draft";
let versionNumber: number | undefined;
if (params.version) {
const versions = await api.listApprovalRuleVersions(client);
const versionNumberParsed = Number(params.version);
const targetVersion = isNaN(versionNumberParsed)
? params.version === "latest"
? versions[0]
: versions.find((v) => v.id === params.version)
: versions.find((v) => v.versionNumber === versionNumberParsed);
if (!targetVersion) {
throw new Error(`未找到指定的规则版本: ${params.version}`);
}
versionNumber = targetVersion.versionNumber;
source = `version:${versionNumber}`;
rules = (targetVersion.rules ?? []).map((r, idx) => ({
code: (r as any).code ? Number(String((r as any).code).replace(/^#/, "")) || idx + 1 : idx + 1,
name: (r as any).name ?? (r as any).title,
description: r.description ?? "",
scope: (r as any).scope ?? "ALL",
strictness: (r as any).strictness ?? "MUST_FOLLOW"
}));
} else {
const draftData = await api.listApprovalRules(client);
rules = (draftData.rules ?? []).map((r, idx) => ({
id: r.id,
code: r.code ?? idx + 1,
name: (r as any).name ?? (r as any).title,
description: r.description ?? "",
scope: r.scope ?? "ALL",
strictness: r.strictness ?? "MUST_FOLLOW",
status: r.status
}));
}
const savedPath = saveLocalRulesFile(outPath, {
corpId: context.corp.id,
source,
versionNumber,
exportedAt: new Date().toISOString(),
rulesCount: rules.length,
rules
});
return {
saved: true,
path: savedPath,
rulesCount: rules.length,
corpId: context.corp.id,
source,
versionNumber
};
}
},
{
name: "seal_approval_rules_push",
description: "将本地规则文件推送到远端草稿(本地调优通过后一键应用,支持直接发布为正式版本)",
parameters: z.object({
file: z.string().optional().describe("要推送的本地规则文件路径,默认为 ./rules.local.json"),
dryRun: z.boolean().optional().describe("是否仅预览变更而不实际写入远端(默认 true,传 --yes 或 confirm: true 执行写入)"),
confirm: z.boolean().optional().describe("确认覆盖写入远端草稿"),
publish: z.boolean().optional().describe("写入草稿后是否直接发布为一个正式版本"),
versionName: z.string().optional().describe("发布版本的名称(仅在 publish=true 时有效)")
}),
handler: async (
client: KyInstance,
params: {
file?: string;
dryRun?: boolean;
confirm?: boolean;
publish?: boolean;
versionName?: string;
},
context: ToolContext
) => {
const filePath = params.file ?? "./rules.local.json";
const local = loadLocalRulesFile(filePath);
const isConfirmed = params.confirm === true;
const isDryRun = params.dryRun ?? !isConfirmed;
const before = await api.listApprovalRules(client);
if (isDryRun) {
return {
corpId: context.corp.id,
dryRun: true,
localFile: local.resolvedPath,
localRulesCount: local.rules.length,
remoteDraftCount: before.rules.length,
willPublish: Boolean(params.publish),
message: "Preview mode. Use --yes or confirm=true to apply local rules to remote draft."
};
}
// Step 1: Clear existing draft rules
let deleted = 0;
for (const rule of before.rules) {
await api.deleteApprovalRule(client, rule.id);
deleted += 1;
}
// Step 2: Create new rules from local
const created: Array<{ id: string; description: string; code?: number }> = [];
for (const rule of local.rules) {
const strictness = rule.strictness?.toUpperCase()?.includes("SHOULD")
? "SHOULD_FOLLOW"
: rule.strictness?.toUpperCase()?.includes("SUGGEST")
? "SUGGESTION"
: "MUST_FOLLOW";
const newRule = await api.createApprovalRule(client, {
description: rule.description,
scope: rule.scope ?? "ALL",
strictness
});
created.push({ id: newRule.id, description: newRule.description, code: newRule.code });
}
// Step 3: Recode
await api.recodeApprovalRules(client);
// Step 4: Optional publish
let publishedVersion: unknown = undefined;
if (params.publish) {
const dateStr = new Date().toISOString().slice(0, 10).replace(/-/g, "");
const name = params.versionName || `v-local-${dateStr}-${Date.now().toString().slice(-4)}`;
publishedVersion = await api.publishApprovalRuleVersion(client, name);
}
return {
corpId: context.corp.id,
dryRun: false,
localFile: local.resolvedPath,
clearedDraftRules: deleted,
createdRules: created.length,
published: publishedVersion ?? false
};
}
},
{
name: "seal_approval_documents_list",
description: "列出 Seal 审批知识文档",
@@ -1057,6 +1233,28 @@ export const sealTools = [
return extractApprovalRunAttachments(record, { summary: params.summary });
}
},
{
name: "seal_approval_run_attachments_download",
description: "下载审批运行记录中的附件到本地目录;优先使用记录内 ossSignedUrl 直链",
parameters: z.object({
recordId: z.string().describe("Seal approval run record ID"),
all: z.boolean().optional().describe("下载所有附件"),
name: z.string().optional().describe("按文件名、fileId 或 tokenKey 过滤"),
outDir: z.string().optional().describe("本地保存目录,默认 ./attachments")
}),
handler: async (
client: KyInstance,
params: { recordId: string; all?: boolean; name?: string; outDir?: string }
) => {
const record = await api.getApprovalRun(client, params.recordId);
return downloadApprovalRunAttachments({
record,
all: params.all,
name: params.name,
outDir: params.outDir
});
}
},
{
name: "seal_approval_run_result_get",
description: "返回审批运行结果摘要;summary=true 时只返回 decision、summary、风险点数量、命中规则数量、traceId 等",
@@ -1877,6 +2075,8 @@ const sealActionNames = [
"seal_approval_rule_version_get",
"seal_approval_rule_get",
"seal_approval_rules_lint",
"seal_approval_rules_pull",
"seal_approval_rules_push",
"seal_approval_rule_version_publish",
"seal_approval_documents_list",
"seal_approval_document_get",
@@ -1896,6 +2096,7 @@ const sealActionNames = [
"seal_approval_run_cited_rules_get",
"seal_approval_run_document_summary_get",
"seal_approval_run_attachments_get",
"seal_approval_run_attachments_download",
"seal_approval_run_result_get",
"seal_approval_run_url_get",
"seal_approval_run_pick",
@@ -1935,6 +2136,8 @@ const sealActionAliases: Record<string, (typeof sealActionNames)[number]> = {
"rule.version.get": "seal_approval_rule_version_get",
"rule.get": "seal_approval_rule_get",
"rule.lint": "seal_approval_rules_lint",
"rule.pull": "seal_approval_rules_pull",
"rule.push": "seal_approval_rules_push",
"rule.publish": "seal_approval_rule_version_publish",
"doc.list": "seal_approval_documents_list",
"doc.get": "seal_approval_document_get",
@@ -1954,6 +2157,7 @@ const sealActionAliases: Record<string, (typeof sealActionNames)[number]> = {
"runs.citedRules": "seal_approval_run_cited_rules_get",
"runs.documentSummary": "seal_approval_run_document_summary_get",
"runs.attachments": "seal_approval_run_attachments_get",
"runs.attachments.download": "seal_approval_run_attachments_download",
"runs.result": "seal_approval_run_result_get",
"runs.url": "seal_approval_run_url_get",
"runs.pick": "seal_approval_run_pick",
@@ -2510,38 +2714,6 @@ function summarizeApprovalRunDocument(record: ApprovalRun) {
};
}
function extractApprovalRunAttachments(record: ApprovalRun, options: { summary?: boolean } = {}) {
const roots: Array<[string, unknown]> = [
["document", record.document],
["result", record.result],
["pipelineData", record.pipelineData],
["sourceExtendData", record.sourceExtendData]
];
const attachments: Array<Record<string, unknown>> = [];
const seen = new Set<string>();
for (const [path, value] of roots) {
collectAttachments(value, path, attachments, seen);
}
return {
recordId: record.id,
sourceDocumentSN: record.sourceDocumentSN,
sourceDocumentId: record.sourceDocumentId,
count: attachments.length,
attachments: options.summary
? attachments.map((attachment) => compactObject({
path: attachment.path,
kind: attachment.kind,
fileName: attachment.fileName,
mimeType: attachment.mimeType,
fileId: attachment.fileId,
sourceField: attachment.sourceField
}))
: attachments
};
}
function extractCitedRules(record: ApprovalRun) {
const candidates: Array<[string, unknown]> = [
["result.citedRules", getPath(record, "result.citedRules")],
@@ -2594,59 +2766,6 @@ function extractCitedRules(record: ApprovalRun) {
};
}
function collectAttachments(
value: unknown,
path: string,
output: Array<Record<string, unknown>>,
seen: Set<string>
) {
if (Array.isArray(value)) {
value.forEach((item, index) => collectAttachments(item, `${path}.${index}`, output, seen));
return;
}
const object = asRecord(value);
if (!object) return;
if (looksLikeAttachment(object, path)) {
const attachment = compactObject({
path,
fieldPath: path,
kind: inferAttachmentKind(path, object),
fileName: stringFromUnknown(object.fileName) ?? stringFromUnknown(object.filename) ?? stringFromUnknown(object.name) ?? stringFromUnknown(object.originalName),
mimeType: stringFromUnknown(object.mimeType) ?? stringFromUnknown(object.mimetype) ?? stringFromUnknown(object.contentType),
fileId: stringFromUnknown(object.fileId) ?? stringFromUnknown(object.id) ?? stringFromUnknown(object.attachmentId),
ossPath: stringFromUnknown(object.ossPath) ?? stringFromUnknown(object.ossKey) ?? stringFromUnknown(object.key),
url: stringFromUnknown(object.url) ?? stringFromUnknown(object.signedUrl) ?? stringFromUnknown(object.downloadUrl) ?? stringFromUnknown(object.previewUrl),
invoiceId: stringFromUnknown(object.invoiceId),
sourceField: stringFromUnknown(object.fieldName) ?? stringFromUnknown(object.label)
});
const key = JSON.stringify(attachment);
if (!seen.has(key)) {
seen.add(key);
output.push(attachment);
}
}
for (const [key, child] of Object.entries(object)) {
collectAttachments(child, `${path}.${key}`, output, seen);
}
}
function looksLikeAttachment(object: Record<string, unknown>, path: string) {
const keys = Object.keys(object).map((key) => key.toLowerCase());
const pathHint = /(attachment|attachments|invoice|receipt|file|files|附件|发票)/i.test(path);
const fileHints = ["filename", "fileName", "mimeType", "mimetype", "contentType", "fileId", "ossPath", "signedUrl", "downloadUrl", "previewUrl", "attachmentId"];
return pathHint && fileHints.some((key) => keys.includes(key.toLowerCase()));
}
function inferAttachmentKind(path: string, object: Record<string, unknown>) {
const normalized = `${path} ${stringFromUnknown(object.type) ?? ""}`.toLowerCase();
if (normalized.includes("invoice") || normalized.includes("发票")) return "invoice";
if (normalized.includes("receipt")) return "receipt";
return "attachment";
}
function firstPath(object: Record<string, unknown> | undefined, paths: readonly string[]) {
if (!object) return undefined;
for (const path of paths) {
@@ -3328,3 +3447,5 @@ function localParts(date: Date, timezone: string): Record<string, string> {
.map((part) => [part.type, part.value])
);
}
export { extractApprovalRunAttachments, downloadApprovalRunAttachments };
+25 -22
View File
@@ -75,6 +75,18 @@ export async function handleHttpRequest(req: IncomingMessage, res: ServerRespons
return;
}
if (method === "POST" && (pathname === "/shutdown" || pathname === "/api/shutdown")) {
sendJson(res, 200, {
success: true,
message: "Shutting down seal-use background daemon",
pid: process.pid
});
setTimeout(() => {
process.kill(process.pid, "SIGTERM");
}, 50);
return;
}
// 3. Command Execution Endpoint: POST /api/cli
if (method === "POST" && pathname === "/api/cli") {
const body = await parseJsonBody(req);
@@ -393,28 +405,19 @@ export function extractCorpId(
}
export async function parseJsonBody(req: IncomingMessage): Promise<Record<string, unknown>> {
return new Promise((resolve, reject) => {
let raw = "";
req.on("data", (chunk) => {
raw += chunk;
if (raw.length > 20 * 1024 * 1024) {
// 20MB limit
reject(new Error("Payload too large"));
}
});
req.on("end", () => {
if (!raw.trim()) {
resolve({});
return;
}
try {
resolve(JSON.parse(raw));
} catch (err) {
reject(new Error(`Invalid JSON body: ${err instanceof Error ? err.message : String(err)}`));
}
});
req.on("error", reject);
});
let raw = "";
for await (const chunk of req) {
raw += chunk;
if (raw.length > 20 * 1024 * 1024) {
throw new Error("Payload too large");
}
}
if (!raw.trim()) return {};
try {
return JSON.parse(raw);
} catch (err) {
throw new Error(`Invalid JSON body: ${err instanceof Error ? err.message : String(err)}`);
}
}
export function sendJson(res: ServerResponse, statusCode: number, data: unknown) {
+5 -2
View File
@@ -8,9 +8,12 @@ export type HttpServerOptions = {
silent?: boolean;
};
export const DEFAULT_HTTP_PORT = 8787;
export const DEFAULT_HTTP_HOST = "127.0.0.1";
export async function startHttpServer(options: HttpServerOptions = {}): Promise<Server> {
const port = options.port ?? (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : 8787);
const host = options.host ?? (process.env.HOST ? process.env.HOST : "127.0.0.1");
const port = options.port ?? (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : DEFAULT_HTTP_PORT);
const host = options.host ?? (process.env.HOST ? process.env.HOST : DEFAULT_HTTP_HOST);
const server = createServer(async (req, res) => {
try {