@cj-tech-master/excelts 0.1.0-canary.20251029013247.758de7b → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts
|
|
2
|
+
* @cj-tech-master/excelts v1.0.0
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2025 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -27,7 +27,7 @@ Please leave feedback at https://github.com/excelts/excelts/discussions/2575`);l
|
|
|
27
27
|
`)}openNode(e,t){let n=this.tos,r=this._xml;n&&this.open&&r.push(`>`),this._stack.push(e),r.push(`<`),r.push(e),Fo(r,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);t!==void 0&&Po(this._xml,e,t)}addAttributes(e){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);Fo(this._xml,e)}writeText(e){let t=this._xml;this.open&&=(t.push(`>`),!1),this.leaf=!1,t.push(ea(e.toString()))}writeXml(e){this.open&&=(this._xml.push(`>`),!1),this.leaf=!1,this._xml.push(e)}closeNode(){let e=this._stack.pop(),t=this._xml;this.leaf?t.push(`/>`):(t.push(`</`),t.push(e),t.push(`>`)),this.open=!1,this.leaf=!1}leafNode(e,t,n){this.openNode(e,t),n!==void 0&&this.writeText(n),this.closeNode()}closeAll(){for(;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 e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._xml.join(``)}static{this.StdDocAttributes={version:`1.0`,encoding:`UTF-8`,standalone:`yes`}}};let Lo=global.TextDecoder===void 0?null:new global.TextDecoder(`utf-8`);function Ro(e){return typeof e==`string`?e:Lo?Lo.decode(e):e.toString()}var zo=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAR=`
|
|
28
28
|
\r --�𐀀-`,e.S=` \r
|
|
29
29
|
`,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=i&&e<=55295||e===n||e===r||e===t||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e===i||e===n||e===r||e===t}e.isS=o;function s(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=s;function c(e){return s(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=c})),Bo=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAR=`--�𐀀-`,e.RESTRICTED_CHAR=`-\b\v\f---`,e.S=` \r
|
|
30
|
-
`,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.RESTRICTED_CHAR_RE=RegExp(`^[`+e.RESTRICTED_CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}e.isRestrictedChar=o;function s(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isCharAndNotRestricted=s;function c(e){return e===i||e===n||e===r||e===t}e.isS=c;function l(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=l;function u(e){return l(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=u})),Vo=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NC_NAME_START_CHAR=`A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NC_NAME_CHAR=`-`+e.NC_NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.NC_NAME_START_CHAR_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`]$`,`u`),e.NC_NAME_CHAR_RE=RegExp(`^[`+e.NC_NAME_CHAR+`]$`,`u`),e.NC_NAME_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`][`+e.NC_NAME_CHAR+`]*$`,`u`);function t(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNCNameStartChar=t;function n(e){return t(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNCNameChar=n})),Ho=d(c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=zo(),n=Bo(),r=Vo();var i=t.isS,a=t.isChar,o=t.isNameStartChar,s=t.isNameChar,c=t.S_LIST,l=t.NAME_RE,u=n.isChar,d=r.isNCNameStartChar,f=r.isNCNameChar,p=r.NC_NAME_RE;let m=`http://www.w3.org/XML/1998/namespace`,h=`http://www.w3.org/2000/xmlns/`,g={__proto__:null,xml:m,xmlns:h},_={__proto__:null,amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},v=8232,y=e=>e===34||e===39,b=[34,39],x=[...b,91,62],S=[...b,60,93],C=[61,63,...c],w=[...c,62,38,60];function T(e,t,n){switch(t){case`xml`:n!==m&&e.fail(`xml prefix must be bound to ${m}.`);break;case`xmlns`:n!==h&&e.fail(`xmlns prefix must be bound to ${h}.`);break;default:}switch(n){case h:e.fail(t===``?`the default namespace may not be set to ${n}.`:`may not assign a prefix (even "xmlns") to the URI \
|
|
30
|
+
`,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.RESTRICTED_CHAR_RE=RegExp(`^[`+e.RESTRICTED_CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}e.isRestrictedChar=o;function s(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isCharAndNotRestricted=s;function c(e){return e===i||e===n||e===r||e===t}e.isS=c;function l(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=l;function u(e){return l(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=u})),Vo=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NC_NAME_START_CHAR=`A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NC_NAME_CHAR=`-`+e.NC_NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.NC_NAME_START_CHAR_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`]$`,`u`),e.NC_NAME_CHAR_RE=RegExp(`^[`+e.NC_NAME_CHAR+`]$`,`u`),e.NC_NAME_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`][`+e.NC_NAME_CHAR+`]*$`,`u`);function t(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNCNameStartChar=t;function n(e){return t(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNCNameChar=n})),Ho=d(c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SaxesParser=e.EVENTS=void 0;let t=zo(),n=Bo(),r=Vo();var i=t.isS,a=t.isChar,o=t.isNameStartChar,s=t.isNameChar,c=t.S_LIST,l=t.NAME_RE,u=n.isChar,d=r.isNCNameStartChar,f=r.isNCNameChar,p=r.NC_NAME_RE;let m=`http://www.w3.org/XML/1998/namespace`,h=`http://www.w3.org/2000/xmlns/`,g={__proto__:null,xml:m,xmlns:h},_={__proto__:null,amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},v=8232,y=e=>e===34||e===39,b=[34,39],x=[...b,91,62],S=[...b,60,93],C=[61,63,...c],w=[...c,62,38,60];function T(e,t,n){switch(t){case`xml`:n!==m&&e.fail(`xml prefix must be bound to ${m}.`);break;case`xmlns`:n!==h&&e.fail(`xmlns prefix must be bound to ${h}.`);break;default:}switch(n){case h:e.fail(t===``?`the default namespace may not be set to ${n}.`:`may not assign a prefix (even "xmlns") to the URI \
|
|
31
31
|
${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namespace may not be set to ${n}.`);break;default:e.fail(`may not assign the xml namespace to another prefix.`)}break;default:}}function E(e,t){for(let n of Object.keys(t))T(e,n,t[n])}let D=e=>p.test(e),O=e=>l.test(e);e.EVENTS=[`xmldecl`,`text`,`processinginstruction`,`doctype`,`comment`,`opentagstart`,`attribute`,`opentag`,`closetag`,`cdata`,`error`,`end`,`ready`];let k={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`};e.SaxesParser=class{constructor(e){this.opt=e??{},this.fragmentOpt=!!this.opt.fragment;let t=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,t){this.nameStartCheck=d,this.nameCheck=f,this.isName=D,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},g);let e=this.opt.additionalNamespaces;e!=null&&(E(this,e),Object.assign(this.ns,e))}else this.nameStartCheck=o,this.nameCheck=s,this.isName=O,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var e;this.openWakaBang=``,this.text=``,this.name=``,this.piTarget=``,this.entity=``,this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk=``,this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];let{fragmentOpt:t}=this;this.state=t?13:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=[`version`],this.entityReturnState=void 0;let{defaultXMLVersion:n}=this.opt;if(n===void 0){if(this.opt.forceXMLVersion===!0)throw Error(`forceXMLVersion set but defaultXMLVersion is not set`);n=`1.0`}this.setXMLVersion(n),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(_),(e=this.readyHandler)==null||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,t){this[k[e]]=t}off(e){this[k[e]]=void 0}makeError(e){let t=this.fileName??``;return this.trackPosition&&(t.length>0&&(t+=`:`),t+=`${this.line}:${this.column}`),t.length>0&&(t+=`: `),Error(t+e)}fail(e){let t=this.makeError(e),n=this.errorHandler;if(n===void 0)throw t;return n(t),this}write(e){if(this.closed)return this.fail(`cannot write after close; assign an onready handler.`);let t=!1;e===null?(t=!0,e=``):typeof e==`object`&&(e=e.toString()),this.carriedFromPrevious!==void 0&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let n=e.length,r=e.charCodeAt(n-1);!t&&(r===13||r>=55296&&r<=56319)&&(this.carriedFromPrevious=e[n-1],n--,e=e.slice(0,n));let{stateTable:i}=this;for(this.chunk=e,this.i=0;this.i<n;)i[this.state].call(this);return this.chunkPosition+=n,t?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return-1;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>=32||n===9)return n;switch(n){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:return e.charCodeAt(t+1)===10&&(this.i=t+2),this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCode11(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return-1;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>31&&n<127||n>159&&n!==v||n===9)return n;switch(n){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:{let n=e.charCodeAt(t+1);(n===10||n===133)&&(this.i=t+2)}case 133:case v:return this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCodeNorm(){let e=this.getCode();return e===-2?10:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode(),i=r===-2,a=i?10:r;if(a===-1||e.includes(a))return this.text+=n.slice(t,this.prevI),a;i&&(this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i)}}captureToChar(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode();switch(r){case-2:this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i,r=10;break;case-1:return this.text+=n.slice(t),!1;default:}if(r===e)return this.text+=n.slice(t,this.prevI),!0}}captureNameChars(){let{chunk:e,i:t}=this;for(;;){let n=this.getCode();if(n===-1)return this.name+=e.slice(t),-1;if(!s(n))return this.name+=e.slice(t,this.prevI),n===-2?10:n}}skipSpaces(){for(;;){let e=this.getCodeNorm();if(e===-1||!i(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,e===`1.0`?(this.isChar=a,this.getCode=this.getCode10):(this.isChar=u,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){let e=this.i,t=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),t){case 60:if(this.state=15,this.text.length!==0)throw Error(`no-empty text at start`);break;case-1:break;default:this.unget(),this.state=13,this.xmlDeclPossible=!1}}sDoctype(){var e;let t=this.captureTo(x);switch(t){case 62:(e=this.doctypeHandler)==null||e.call(this,this.text),this.text=``,this.state=13,this.doctype=!0;break;case-1:break;default:this.text+=String.fromCodePoint(t),t===91?this.state=4:y(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=2)}sDTD(){let e=this.captureTo(S);e!==-1&&(this.text+=String.fromCodePoint(e),e===93?this.state=2:e===60?this.state=6:y(e)&&(this.state=5,this.q=e))}sDTDQuoted(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=4,this.q=null)}sDTDOpenWaka(){let e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case 33:this.state=7,this.openWakaBang=``;break;case 63:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){let e=String.fromCodePoint(this.getCodeNorm()),t=this.openWakaBang+=e;this.text+=e,t!==`-`&&(this.state=t===`--`?8:4,this.openWakaBang=``)}sDTDComment(){this.captureToChar(45)&&(this.text+=`-`,this.state=9)}sDTDCommentEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=e===45?10:8}sDTDCommentEnded(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===62?this.state=4:(this.fail(`malformed comment.`),this.state=8)}sDTDPI(){this.captureToChar(63)&&(this.text+=`?`,this.state=12)}sDTDPIEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===62&&(this.state=4)}sText(){this.tags.length===0?this.handleTextOutsideRoot():this.handleTextInRoot()}sEntity(){let{i:e}=this,{chunk:t}=this;loop:for(;;)switch(this.getCode()){case-2:this.entity+=`${t.slice(e,this.prevI)}\n`,e=this.i;break;case 59:{let{entityReturnState:n}=this,r=this.entity+t.slice(e,this.prevI);this.state=n;let i;r===``?(this.fail(`empty entity name.`),i=`&;`):(i=this.parseEntity(r),this.entity=``),(n!==13||this.textHandler!==void 0)&&(this.text+=i);break loop}case-1:this.entity+=t.slice(e);break loop;default:}}sOpenWaka(){let e=this.getCode();if(o(e))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(e){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang=``,this.xmlDeclPossible=!1;break;case 63:this.state=23;break;default:this.fail(`disallowed character in tag name`),this.state=13,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case`[CDATA[`:!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang=``;break;case`--`:this.state=17,this.openWakaBang=``;break;case`DOCTYPE`:this.state=2,(this.doctype||this.sawRoot)&&this.fail(`inappropriately located doctype declaration.`),this.openWakaBang=``;break;default:this.openWakaBang.length>=7&&this.fail(`incorrect syntax.`)}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){var e;let t=this.getCodeNorm();t===45?(this.state=19,(e=this.commentHandler)==null||e.call(this,this.text),this.text=``):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){let e=this.getCodeNorm();e===62?this.state=13:(this.fail(`malformed comment.`),this.text+=`--${String.fromCodePoint(e)}`,this.state=17)}sCData(){this.captureToChar(93)&&(this.state=21)}sCDataEnding(){let e=this.getCodeNorm();e===93?this.state=22:(this.text+=`]${String.fromCodePoint(e)}`,this.state=20)}sCDataEnding2(){var e;let t=this.getCodeNorm();switch(t){case 62:(e=this.cdataHandler)==null||e.call(this,this.text),this.text=``,this.state=13;break;case 93:this.text+=`]`;break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){let e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=24):e===63||i(e)?(this.fail(`processing instruction without a target.`),this.state=e===63?26:25):(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(e),this.state=24)}sPIRest(){let{chunk:e,i:t}=this;for(;;){let n=this.getCodeNorm();if(n===-1){this.piTarget+=e.slice(t);return}if(!this.nameCheck(n)){this.piTarget+=e.slice(t,this.prevI);let r=n===63;r||i(n)?this.piTarget===`xml`?(this.xmlDeclPossible||this.fail(`an XML declaration must be at the start of the document.`),this.state=r?33:27):this.state=r?26:25:(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(n));break}}}sPIBody(){if(this.text.length===0){let e=this.getCodeNorm();e===63?this.state=26:i(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(63)&&(this.state=26)}sPIEnding(){var e;let t=this.getCodeNorm();if(t===62){let{piTarget:t}=this;t.toLowerCase()===`xml`&&this.fail(`the XML declaration must appear at the start of the document.`),(e=this.piHandler)==null||e.call(this,{target:t,body:this.text}),this.piTarget=this.text=``,this.state=13}else t===63?this.text+=`?`:(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){let e=this.skipSpaces();if(e===63){this.state=33;return}e!==-1&&(this.state=28,this.name=String.fromCodePoint(e))}sXMLDeclName(){let e=this.captureTo(C);if(e===63){this.state=33,this.name+=this.text,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(i(e)||e===61){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=e===61?30:29}}sXMLDeclEq(){let e=this.getCodeNorm();if(e===63){this.state=33,this.fail(`XML declaration is incomplete.`);return}i(e)||(e!==61&&this.fail(`value required.`),this.state=30)}sXMLDeclValueStart(){let e=this.getCodeNorm();if(e===63){this.state=33,this.fail(`XML declaration is incomplete.`);return}i(e)||(y(e)?this.q=e:(this.fail(`value must be quoted.`),this.q=32),this.state=31)}sXMLDeclValue(){let e=this.captureTo([this.q,63]);if(e===63){this.state=33,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(e===-1)return;let t=this.text;switch(this.text=``,this.name){case`version`:{this.xmlDeclExpects=[`encoding`,`standalone`];let e=t;this.xmlDecl.version=e,/^1\.[0-9]+$/.test(e)?this.opt.forceXMLVersion||this.setXMLVersion(e):this.fail(`version number must match /^1\\.[0-9]+$/.`);break}case`encoding`:/^[A-Za-z][A-Za-z0-9._-]*$/.test(t)||this.fail(`encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/.`),this.xmlDeclExpects=[`standalone`],this.xmlDecl.encoding=t;break;case`standalone`:t!==`yes`&&t!==`no`&&this.fail(`standalone value must match "yes" or "no".`),this.xmlDeclExpects=[],this.xmlDecl.standalone=t;break;default:}this.name=``,this.state=32}sXMLDeclSeparator(){let e=this.getCodeNorm();if(e===63){this.state=33;return}i(e)||(this.fail(`whitespace required.`),this.unget()),this.state=27}sXMLDeclEnding(){var e;this.getCodeNorm()===62?(this.piTarget===`xml`?this.name!==`version`&&this.xmlDeclExpects.includes(`version`)&&this.fail(`XML declaration must contain a version.`):this.fail(`processing instructions are not allowed before root.`),(e=this.xmldeclHandler)==null||e.call(this,this.xmlDecl),this.name=``,this.piTarget=this.text=``,this.state=13):this.fail(`The character ? is disallowed anywhere in XML declarations.`),this.xmlDeclPossible=!1}sOpenTag(){var e;let t=this.captureNameChars();if(t===-1)return;let n=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name=``,this.xmlnsOpt&&(this.topNS=n.ns=Object.create(null)),(e=this.openTagStartHandler)==null||e.call(this,n),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail(`documents may contain only one root.`),t){case 62:this.openTag();break;case 47:this.state=35;break;default:i(t)||this.fail(`disallowed character in tag name.`),this.state=36}}sOpenTagSlash(){this.getCode()===62?this.openSelfClosingTag():(this.fail(`forward-slash in opening tag not followed by >.`),this.state=36)}sAttrib(){let e=this.skipSpaces();e!==-1&&(o(e)?(this.unget(),this.state=37):e===62?this.openTag():e===47?this.state=35:this.fail(`disallowed character in attribute name.`))}sAttribName(){let e=this.captureNameChars();e===61?this.state=39:i(e)?this.state=38:e===62?(this.fail(`attribute without value.`),this.pushAttrib(this.name,this.name),this.name=this.text=``,this.openTag()):e!==-1&&this.fail(`disallowed character in attribute name.`)}sAttribNameSawWhite(){let e=this.skipSpaces();switch(e){case-1:return;case 61:this.state=39;break;default:this.fail(`attribute without value.`),this.text=``,this.name=``,e===62?this.openTag():o(e)?(this.unget(),this.state=37):(this.fail(`disallowed character in attribute name.`),this.state=36)}}sAttribValue(){let e=this.getCodeNorm();y(e)?(this.q=e,this.state=40):i(e)||(this.fail(`unquoted attribute value.`),this.state=42,this.unget())}sAttribValueQuoted(){let{q:e,chunk:t}=this,{i:n}=this;for(;;)switch(this.getCode()){case e:this.pushAttrib(this.name,this.text+t.slice(n,this.prevI)),this.name=this.text=``,this.q=null,this.state=41;return;case 38:this.text+=t.slice(n,this.prevI),this.state=14,this.entityReturnState=40;return;case 10:case-2:case 9:this.text+=`${t.slice(n,this.prevI)} `,n=this.i;break;case 60:this.text+=t.slice(n,this.prevI),this.fail(`disallowed character.`);return;case-1:this.text+=t.slice(n);return;default:}}sAttribValueClosed(){let e=this.getCodeNorm();i(e)?this.state=36:e===62?this.openTag():e===47?this.state=35:o(e)?(this.fail(`no whitespace between attributes.`),this.unget(),this.state=37):this.fail(`disallowed character in attribute name.`)}sAttribValueUnquoted(){let e=this.captureTo(w);switch(e){case 38:this.state=14,this.entityReturnState=42;break;case 60:this.fail(`disallowed character.`);break;case-1:break;default:this.text.includes(`]]>`)&&this.fail(`the string "]]>" is disallowed in char data.`),this.pushAttrib(this.name,this.text),this.name=this.text=``,e===62?this.openTag():this.state=36}}sCloseTag(){let e=this.captureNameChars();e===62?this.closeTag():i(e)?this.state=44:e!==-1&&this.fail(`disallowed character in closing tag.`)}sCloseTagSawWhite(){switch(this.skipSpaces()){case 62:this.closeTag();break;case-1:break;default:this.fail(`disallowed character in closing tag.`)}}handleTextInRoot(){let{i:e,forbiddenState:t}=this,{chunk:n,textHandler:r}=this;scanLoop:for(;;)switch(this.getCode()){case 60:if(this.state=15,r!==void 0){let{text:t}=this,i=n.slice(e,this.prevI);t.length===0?i.length!==0&&r(i):(r(t+i),this.text=``)}t=0;break scanLoop;case 38:this.state=14,this.entityReturnState=13,r!==void 0&&(this.text+=n.slice(e,this.prevI)),t=0;break scanLoop;case 93:switch(t){case 0:t=1;break;case 1:t=2;break;case 2:break;default:throw Error(`impossible state`)}break;case 62:t===2&&this.fail(`the string "]]>" is disallowed in char data.`),t=0;break;case-2:r!==void 0&&(this.text+=`${n.slice(e,this.prevI)}\n`),e=this.i,t=0;break;case-1:r!==void 0&&(this.text+=n.slice(e));break scanLoop;default:t=0}this.forbiddenState=t}handleTextOutsideRoot(){let{i:e}=this,{chunk:t,textHandler:n}=this,r=!1;outRootLoop:for(;;){let a=this.getCode();switch(a){case 60:if(this.state=15,n!==void 0){let{text:r}=this,i=t.slice(e,this.prevI);r.length===0?i.length!==0&&n(i):(n(r+i),this.text=``)}break outRootLoop;case 38:this.state=14,this.entityReturnState=13,n!==void 0&&(this.text+=t.slice(e,this.prevI)),r=!0;break outRootLoop;case-2:n!==void 0&&(this.text+=`${t.slice(e,this.prevI)}\n`),e=this.i;break;case-1:n!==void 0&&(this.text+=t.slice(e));break outRootLoop;default:i(a)||(r=!0)}}r&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0))}pushAttribNS(e,t){var n;let{prefix:r,local:i}=this.qname(e),a={name:e,prefix:r,local:i,value:t};if(this.attribList.push(a),(n=this.attributeHandler)==null||n.call(this,a),r===`xmlns`){let e=t.trim();this.currentXMLVersion===`1.0`&&e===``&&this.fail(`invalid attempt to undefine prefix in XML 1.0`),this.topNS[i]=e,T(this,i,e)}else if(e===`xmlns`){let e=t.trim();this.topNS[``]=e,T(this,``,e)}}pushAttribPlain(e,t){var n;let r={name:e,value:t};this.attribList.push(r),(n=this.attributeHandler)==null||n.call(this,r)}end(){var e,t;this.sawRoot||this.fail(`document must contain a root element.`);let{tags:n}=this;for(;n.length>0;){let e=n.pop();this.fail(`unclosed tag: ${e.name}`)}this.state!==0&&this.state!==13&&this.fail(`unexpected end.`);let{text:r}=this;return r.length!==0&&((e=this.textHandler)==null||e.call(this,r),this.text=``),this._closed=!0,(t=this.endHandler)==null||t.call(this),this._init(),this}resolve(e){var t;let n=this.topNS[e];if(n!==void 0)return n;let{tags:r}=this;for(let t=r.length-1;t>=0;t--)if(n=r[t].ns[e],n!==void 0)return n;return n=this.ns[e],n===void 0?(t=this.opt).resolvePrefix?.call(t,e):n}qname(e){let t=e.indexOf(`:`);if(t===-1)return{prefix:``,local:e};let n=e.slice(t+1),r=e.slice(0,t);return(r===``||n===``||n.includes(`:`))&&this.fail(`malformed name: ${e}.`),{prefix:r,local:n}}processAttribsNS(){let{attribList:e}=this,t=this.tag;{let{prefix:e,local:n}=this.qname(t.name);t.prefix=e,t.local=n;let r=t.uri=this.resolve(e)??``;e!==``&&(e===`xmlns`&&this.fail(`tags may not have "xmlns" as prefix.`),r===``&&(this.fail(`unbound namespace prefix: ${JSON.stringify(e)}.`),t.uri=e))}if(e.length===0)return;let{attributes:n}=t,r=new Set;for(let t of e){let{name:e,prefix:i,local:a}=t,o,s;i===``?(o=e===`xmlns`?h:``,s=e):(o=this.resolve(i),o===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`),o=i),s=`{${o}}${a}`),r.has(s)&&this.fail(`duplicate attribute: ${s}.`),r.add(s),t.uri=o,n[e]=t}this.attribList=[]}processAttribsPlain(){let{attribList:e}=this,t=this.tag.attributes;for(let{name:n,value:r}of e)t[n]!==void 0&&this.fail(`duplicate attribute: ${n}.`),t[n]=r;this.attribList=[]}openTag(){var e;this.processAttribs();let{tags:t}=this,n=this.tag;n.isSelfClosing=!1,(e=this.openTagHandler)==null||e.call(this,n),t.push(n),this.state=13,this.name=``}openSelfClosingTag(){var e,t;this.processAttribs();let{tags:n}=this,r=this.tag;r.isSelfClosing=!0,(e=this.openTagHandler)==null||e.call(this,r),(t=this.closeTagHandler)==null||t.call(this,r),(this.tag=n[n.length-1]??null)===null&&(this.closedRoot=!0),this.state=13,this.name=``}closeTag(){let{tags:e,name:t}=this;if(this.state=13,this.name=``,t===``){this.fail(`weird empty close tag.`),this.text+=`</>`;return}let n=this.closeTagHandler,r=e.length;for(;r-- >0;){let r=this.tag=e.pop();if(this.topNS=r.ns,n?.(r),r.name===t)break;this.fail(`unexpected close tag.`)}r===0?this.closedRoot=!0:r<0&&(this.fail(`unmatched closing tag: ${t}.`),this.text+=`</${t}>`)}parseEntity(e){if(e[0]!==`#`){let t=this.ENTITIES[e];return t===void 0?(this.fail(this.isName(e)?`undefined entity.`:`disallowed character in entity name.`),`&${e};`):t}let t=NaN;return e[1]===`x`&&/^#x[0-9a-f]+$/i.test(e)?t=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(t=parseInt(e.slice(1),10)),this.isChar(t)?String.fromCodePoint(t):(this.fail(`malformed character entity.`),`&${e};`)}}}))(),1);async function*Uo(e){let t=new Ho.SaxesParser({xmlns:!1,defaultXMLVersion:`1.0`}),n;t.on(`error`,e=>{n=e});let r=[];t.on(`opentag`,e=>r.push({eventType:`opentag`,value:e})),t.on(`text`,e=>r.push({eventType:`text`,value:e})),t.on(`closetag`,e=>r.push({eventType:`closetag`,value:e}));for await(let i of e){if(t.write(Ro(i)),n)throw n;yield r,r=[]}}var $=class e{prepare(e,t){}render(e,t){}parseOpen(e){}parseText(e){}parseClose(e){return!1}reconcile(e,t){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof e?t.reset():t.xform&&t.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){for await(let t of e)for(let{eventType:e,value:n}of t)if(e===`opentag`)this.parseOpen(n);else if(e===`text`)this.parseText(n);else if(e===`closetag`&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(e){return this.parse(Uo(e))}get xml(){return this.toXml(this.model)}toXml(e){let t=new Io;return this.render(t,e),t.xml}static toAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e.toString()}static toStringAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toStringValue(e,t){return e===void 0?t:e}static toBoolAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e?`1`:`0`}static toBoolValue(e,t){return e===void 0?t:e===`1`}static toIntAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toIntValue(e,t){return e===void 0?t:parseInt(e,10)}static toFloatAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toFloatValue(e,t){return e===void 0?t:parseFloat(e)}};function Wo(e,t){e.openNode(t.tag,t.$),t.c&&t.c.forEach(t=>{Wo(e,t)}),t.t&&e.writeText(t.t),e.closeNode()}var Go=class extends ${constructor(e){super(),this._model=e}render(e){if(!this._xml){let e=new Io;Wo(e,this._model),this._xml=e.xml}e.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){switch(e){case this._model.tag:return!1;default:return!0}}},Ko=class extends ${constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count||`count`,this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){let{childXform:n}=this;e&&e.forEach((e,r)=>{t.index=r,n.prepare(e,t)})}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t&&t.length||0);let{childXform:n}=this;(t||[]).forEach((t,r)=>{n.render(e,t,r)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model=[],!0;default:return this.childXform.parseOpen(e)?(this.parser=this.childXform,!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(e,t){if(e){let{childXform:n}=this;e.forEach(e=>{n.reconcile(e,t)})}}},qo=class extends ${constructor(e){super(),this.name=e||`color`}get tag(){return this.name}render(e,t){return t?(e.openNode(this.name),t.argb?e.addAttribute(`rgb`,t.argb):t.theme===void 0?t.indexed===void 0?e.addAttribute(`auto`,`1`):e.addAttribute(`indexed`,t.indexed):(e.addAttribute(`theme`,t.theme),t.tint!==void 0&&e.addAttribute(`tint`,t.tint)),e.closeNode(),!0):!1}parseOpen(e){return e.name===this.name?(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0):!1}parseText(){}parseClose(){return!1}},Jo=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}},Yo=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero,this.text=[]}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag?(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0):!1}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join(``)||`0`,10)),!1}},Xo=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[]}render(e,t){t!==void 0&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join(``)),!1}},Zo=class e extends ${static{this.Attributes={single:{},double:{val:`double`},singleAccounting:{val:`singleAccounting`},doubleAccounting:{val:`doubleAccounting`}}}constructor(e){super(),this.model=e}get tag(){return`u`}render(t,n){if(n||=this.model,n===!0)t.leafNode(`u`);else{let r=e.Attributes[n];r&&t.leafNode(`u`,r)}}parseOpen(e){e.name===`u`&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}},Qo=class e extends ${constructor(t){super(),this.options=t||e.OPTIONS,this.map={b:{prop:`bold`,xform:new Jo({tag:`b`,attr:`val`})},i:{prop:`italic`,xform:new Jo({tag:`i`,attr:`val`})},u:{prop:`underline`,xform:new Zo},charset:{prop:`charset`,xform:new Yo({tag:`charset`,attr:`val`})},color:{prop:`color`,xform:new qo},condense:{prop:`condense`,xform:new Jo({tag:`condense`,attr:`val`})},extend:{prop:`extend`,xform:new Jo({tag:`extend`,attr:`val`})},family:{prop:`family`,xform:new Yo({tag:`family`,attr:`val`})},outline:{prop:`outline`,xform:new Jo({tag:`outline`,attr:`val`})},vertAlign:{prop:`vertAlign`,xform:new Xo({tag:`vertAlign`,attr:`val`})},scheme:{prop:`scheme`,xform:new Xo({tag:`scheme`,attr:`val`})},shadow:{prop:`shadow`,xform:new Jo({tag:`shadow`,attr:`val`})},strike:{prop:`strike`,xform:new Jo({tag:`strike`,attr:`val`})},sz:{prop:`size`,xform:new Yo({tag:`sz`,attr:`val`})}},this.map[this.options.fontNameTag]={prop:`name`,xform:new Xo({tag:this.options.fontNameTag,attr:`val`})}}get tag(){return this.options.tagName}render(e,t){let{map:n}=this;e.openNode(this.options.tagName),Object.entries(this.map).forEach(([r,i])=>{n[r].xform.render(e,t[i.prop])}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(this.map[e.name])return this.parser=this.map[e.name].xform,this.parser.parseOpen(e);switch(e.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){let t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}switch(e){case this.options.tagName:return!1;default:return!0}}static{this.OPTIONS={tagName:`font`,fontNameTag:`name`}}},$o=class extends ${constructor(){super(),this.map={color:new qo}}get tag(){return`stop`}render(e,t){e.openNode(`stop`),e.addAttribute(`position`,t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`stop`:return this.model={position:parseFloat(e.attributes.position)},!0;case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0):!1}},es=class extends ${constructor(){super(),this.map={fgColor:new qo(`fgColor`),bgColor:new qo(`bgColor`)}}get name(){return`pattern`}get tag(){return`patternFill`}render(e,t){e.openNode(`patternFill`),e.addAttribute(`patternType`,t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`patternFill`:return this.model={type:`pattern`,pattern:e.attributes.patternType},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0):!1}},ts=class extends ${constructor(){super(),this.map={stop:new $o}}get name(){return`gradient`}get tag(){return`gradientFill`}render(e,t){switch(e.openNode(`gradientFill`),t.gradient){case`angle`:e.addAttribute(`degree`,t.degree);break;case`path`:e.addAttribute(`type`,`path`),t.center.left&&(e.addAttribute(`left`,t.center.left),t.center.right===void 0&&e.addAttribute(`right`,t.center.left)),t.center.right&&e.addAttribute(`right`,t.center.right),t.center.top&&(e.addAttribute(`top`,t.center.top),t.center.bottom===void 0&&e.addAttribute(`bottom`,t.center.top)),t.center.bottom&&e.addAttribute(`bottom`,t.center.bottom);break;default:break}let n=this.map.stop;t.stops.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`gradientFill`:{let t=this.model={stops:[]};return e.attributes.degree?(t.gradient=`angle`,t.degree=parseInt(e.attributes.degree,10)):e.attributes.type===`path`&&(t.gradient=`path`,t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case`stop`:return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0):!1}},ns=class e extends ${constructor(){super(),this.map={patternFill:new es,gradientFill:new ts}}get tag(){return`fill`}render(e,t){switch(e.addRollback(),e.openNode(`fill`),t.type){case`pattern`:this.map.patternFill.render(e,t);break;case`gradient`:this.map.gradientFill.render(e,t);break;default:e.rollback();return}e.closeNode(),e.commit()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`fill`:return this.model={},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0):!1}validStyle(t){return e.validPatternValues[t]}static{this.validPatternValues=[`none`,`solid`,`darkVertical`,`darkGray`,`mediumGray`,`lightGray`,`gray125`,`gray0625`,`darkHorizontal`,`darkVertical`,`darkDown`,`darkUp`,`darkGrid`,`darkTrellis`,`lightHorizontal`,`lightVertical`,`lightDown`,`lightUp`,`lightGrid`,`lightTrellis`,`lightGrid`].reduce((e,t)=>(e[t]=!0,e),{})}static{this.StopXform=$o}static{this.PatternFillXform=es}static{this.GradientFillXform=ts}},rs=class e extends ${constructor(e){super(),this.name=e,this.map={color:new qo}}get tag(){return this.name}render(e,t,n){let r=t&&t.color||n||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute(`style`,t.style),r&&this.map.color.render(e,r)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{let{style:t}=e.attributes;return t?this.model={style:t}:this.model=void 0,!0}case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||={},this.model.color=this.map.color.model),!1)}validStyle(t){return e.validStyleValues[t]}static{this.validStyleValues=[`thin`,`dashed`,`dotted`,`dashDot`,`hair`,`dashDotDot`,`slantDashDot`,`mediumDashed`,`mediumDashDotDot`,`mediumDashDot`,`medium`,`double`,`thick`].reduce((e,t)=>(e[t]=!0,e),{})}},is=class extends ${constructor(){super(),this.map={top:new rs(`top`),left:new rs(`left`),bottom:new rs(`bottom`),right:new rs(`right`),diagonal:new rs(`diagonal`)}}render(e,t){let{color:n}=t;e.openNode(`border`),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute(`diagonalUp`,`1`),t.diagonal.down&&e.addAttribute(`diagonalDown`,`1`));let r=(r,i)=>{let a=r;a&&!a.color&&t.color&&(a={...a,color:t.color}),i.render(e,a,n)};r(t.left,this.map.left),r(t.right,this.map.right),r(t.top,this.map.top),r(t.bottom,this.map.bottom),r(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`border`:return this.reset(),this.diagonalUp=aa(e.attributes.diagonalUp),this.diagonalDown=aa(e.attributes.diagonalDown),!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`border`){let e=this.model={},t=(t,n,r)=>{n&&(r&&Object.assign(n,r),e[t]=n)};t(`left`,this.map.left.model),t(`right`,this.map.right.model),t(`top`,this.map.top.model),t(`bottom`,this.map.bottom.model),t(`diagonal`,this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}};let as={0:{f:`General`},1:{f:`0`},2:{f:`0.00`},3:{f:`#,##0`},4:{f:`#,##0.00`},9:{f:`0%`},10:{f:`0.00%`},11:{f:`0.00E+00`},12:{f:`# ?/?`},13:{f:`# ??/??`},14:{f:`mm-dd-yy`},15:{f:`d-mmm-yy`},16:{f:`d-mmm`},17:{f:`mmm-yy`},18:{f:`h:mm AM/PM`},19:{f:`h:mm:ss AM/PM`},20:{f:`h:mm`},21:{f:`h:mm:ss`},22:{f:`m/d/yy "h":mm`},27:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},28:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},29:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},30:{"zh-tw":`m/d/yy `,"zh-cn":`m-d-yy`,"ja-jp":`m/d/yy`,"ko-kr":`mm-dd-yy`},31:{"zh-tw":`yyyy"年"m"月"d"日"`,"zh-cn":`yyyy"年"m"月"d"日"`,"ja-jp":`yyyy"年"m"月"d"日"`,"ko-kr":`yyyy"년" mm"월" dd"일"`},32:{"zh-tw":`hh"時"mm"分"`,"zh-cn":`h"时"mm"分"`,"ja-jp":`h"時"mm"分"`,"ko-kr":`h"시" mm"분"`},33:{"zh-tw":`hh"時"mm"分"ss"秒"`,"zh-cn":`h"时"mm"分"ss"秒"`,"ja-jp":`h"時"mm"分"ss"秒"`,"ko-kr":`h"시" mm"분" ss"초"`},34:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},35:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},36:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},37:{f:`#,##0 ;(#,##0)`},38:{f:`#,##0 ;[Red](#,##0)`},39:{f:`#,##0.00 ;(#,##0.00)`},40:{f:`#,##0.00 ;[Red](#,##0.00)`},45:{f:`mm:ss`},46:{f:`[h]:mm:ss`},47:{f:`mmss.0`},48:{f:`##0.0E+0`},49:{f:`@`},50:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},51:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},52:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},53:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`m"月"d"日"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},54:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},55:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},56:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},57:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},58:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},59:{"th-th":`t0`},60:{"th-th":`t0.00`},61:{"th-th":`t#,##0`},62:{"th-th":`t#,##0.00`},67:{"th-th":`t0%`},68:{"th-th":`t0.00%`},69:{"th-th":`t# ?/?`},70:{"th-th":`t# ??/??`},81:{"th-th":`d/m/bb`}};function os(){let e={};return Object.entries(as).forEach(([t,n])=>{n.f&&(e[n.f]=parseInt(t,10))}),e}let ss=os();var cs=class extends ${constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return`numFmt`}render(e,t){e.leafNode(`numFmt`,{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){switch(e.name){case`numFmt`:return this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,`$1`)},!0;default:return!1}}parseText(){}parseClose(){return!1}static getDefaultFmtId(e){return ss[e]}static getDefaultFmtCode(e){return as[e]&&as[e].f}};let ls={ReadingOrder:{LeftToRight:1,RightToLeft:2}},us={horizontalValues:[`left`,`center`,`right`,`fill`,`centerContinuous`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:[`top`,`middle`,`bottom`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),vertical(e){return e===`middle`?`center`:this.verticalValues[e]?e:void 0},wrapText(e){return e?!0:void 0},shrinkToFit(e){return e?!0:void 0},textRotation(e){switch(e){case`vertical`:return e;default:{let t=na(e);return t!==void 0&&t>=-90&&t<=90?t:void 0}}},indent(e){let t=na(e);return Math.max(0,t)},readingOrder(e){switch(e){case`ltr`:return ls.ReadingOrder.LeftToRight;case`rtl`:return ls.ReadingOrder.RightToLeft;default:return}}},ds={toXml(e){let t=us.textRotation(e);if(t){if(t===`vertical`)return 255;let e=Math.round(t);if(e>=0&&e<=90)return e;if(e<0&&e>=-90)return 90-e}},toModel(e){let t=na(e);if(t!==void 0){if(t===255)return`vertical`;if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};var fs=class extends ${get tag(){return`alignment`}render(e,t){e.addRollback(),e.openNode(`alignment`);let n=!1;function r(t,r){r&&(e.addAttribute(t,r),n=!0)}r(`horizontal`,us.horizontal(t.horizontal)),r(`vertical`,us.vertical(t.vertical)),r(`wrapText`,us.wrapText(t.wrapText)?`1`:!1),r(`shrinkToFit`,us.shrinkToFit(t.shrinkToFit)?`1`:!1),r(`indent`,us.indent(t.indent)),r(`textRotation`,ds.toXml(t.textRotation)),r(`readingOrder`,us.readingOrder(t.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={},n=!1;function r(e,r,i){e&&(t[r]=i,n=!0)}r(e.attributes.horizontal,`horizontal`,e.attributes.horizontal),r(e.attributes.vertical,`vertical`,e.attributes.vertical===`center`?`middle`:e.attributes.vertical),r(e.attributes.wrapText,`wrapText`,aa(e.attributes.wrapText)),r(e.attributes.shrinkToFit,`shrinkToFit`,aa(e.attributes.shrinkToFit)),r(e.attributes.indent,`indent`,parseInt(e.attributes.indent,10)),r(e.attributes.textRotation,`textRotation`,ds.toModel(e.attributes.textRotation)),r(e.attributes.readingOrder,`readingOrder`,e.attributes.readingOrder===`2`?`rtl`:`ltr`),this.model=n?t:null}parseText(){}parseClose(){return!1}};let ps={boolean(e,t){return e===void 0?t:e}};var ms=class extends ${get tag(){return`protection`}render(e,t){e.addRollback(),e.openNode(`protection`);let n=!1;function r(t,r){r!==void 0&&(e.addAttribute(t,r),n=!0)}r(`locked`,ps.boolean(t.locked,!0)?void 0:`0`),r(`hidden`,ps.boolean(t.hidden,!1)?`1`:void 0),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={locked:e.attributes.locked!==`0`,hidden:e.attributes.hidden===`1`};this.model=!t.locked||t.hidden?t:null}parseText(){}parseClose(){return!1}},hs=class extends ${constructor(e){super(),this.xfId=!!(e&&e.xfId),this.map={alignment:new fs,protection:new ms}}get tag(){return`xf`}render(e,t){e.openNode(`xf`,{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&e.addAttribute(`xfId`,t.xfId||0),t.numFmtId&&e.addAttribute(`applyNumberFormat`,`1`),t.fontId&&e.addAttribute(`applyFont`,`1`),t.fillId&&e.addAttribute(`applyFill`,`1`),t.borderId&&e.addAttribute(`applyBorder`,`1`),t.alignment&&e.addAttribute(`applyAlignment`,`1`),t.protection&&e.addAttribute(`applyProtection`,`1`),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`xf`:return this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),!0;case`alignment`:return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case`protection`:return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):e!==`xf`}},gs=class extends ${constructor(){super(),this.map={alignment:new fs,border:new is,fill:new ns,font:new Qo,numFmt:new cs,protection:new ms}}get tag(){return`dxf`}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){let n={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,n)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e===this.tag?(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1):!0}},_s=class e extends ${constructor(t){super(),this.map={numFmts:new Ko({tag:`numFmts`,count:!0,childXform:new cs}),fonts:new Ko({tag:`fonts`,count:!0,childXform:new Qo,$:{"x14ac:knownFonts":1}}),fills:new Ko({tag:`fills`,count:!0,childXform:new ns}),borders:new Ko({tag:`borders`,count:!0,childXform:new is}),cellStyleXfs:new Ko({tag:`cellStyleXfs`,count:!0,childXform:new hs}),cellXfs:new Ko({tag:`cellXfs`,count:!0,childXform:new hs({xfId:!0})}),dxfs:new Ko({tag:`dxfs`,always:!0,count:!0,childXform:new gs}),numFmt:new cs,font:new Qo,fill:new ns,border:new is,style:new hs({xfId:!0}),cellStyles:e.STATIC_XFORMS.cellStyles,tableStyles:e.STATIC_XFORMS.tableStyles,extLst:e.STATIC_XFORMS.extLst},t&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:`pattern`,pattern:`none`}),this._addFill({type:`pattern`,pattern:`gray125`}),this.weakMap=new WeakMap}render(t,n){let r=n||this.model;t.openXml(Io.StdDocAttributes),t.openNode(`styleSheet`,e.STYLESHEET_ATTRIBUTES),this.index?(r.numFmts&&r.numFmts.length&&(t.openNode(`numFmts`,{count:r.numFmts.length}),r.numFmts.forEach(e=>{t.writeXml(e)}),t.closeNode()),r.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),t.openNode(`fonts`,{count:r.fonts.length,"x14ac:knownFonts":1}),r.fonts.forEach(e=>{t.writeXml(e)}),t.closeNode(),t.openNode(`fills`,{count:r.fills.length}),r.fills.forEach(e=>{t.writeXml(e)}),t.closeNode(),t.openNode(`borders`,{count:r.borders.length}),r.borders.forEach(e=>{t.writeXml(e)}),t.closeNode(),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),t.openNode(`cellXfs`,{count:r.styles.length}),r.styles.forEach(e=>{t.writeXml(e)}),t.closeNode()):(this.map.numFmts.render(t,r.numFmts),this.map.fonts.render(t,r.fonts),this.map.fills.render(t,r.fills),this.map.borders.render(t,r.borders),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(t,r.styles)),e.STATIC_XFORMS.cellStyles.render(t),this.map.dxfs.render(t,r.dxfs),e.STATIC_XFORMS.tableStyles.render(t),e.STATIC_XFORMS.extLst.render(t),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`styleSheet`:return this.initIndex(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`styleSheet`:{this.model={};let e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e(`numFmts`,this.map.numFmts),e(`fonts`,this.map.fonts),e(`fills`,this.map.fills),e(`borders`,this.map.borders),e(`styles`,this.map.cellXfs),e(`dxfs`,this.map.dxfs),this.index={model:[],numFmt:{}},this.model.numFmts){let e=this.index.numFmt;this.model.numFmts.forEach(t=>{e[t.id]=t.formatCode})}return!1}default:return!0}}addStyleModel(e,t){if(!e)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);let n={},r=t||S.ValueType.Number;if(e.numFmt)n.numFmtId=this._addNumFmtStr(e.numFmt);else switch(r){case S.ValueType.Number:n.numFmtId=this._addNumFmtStr(`General`);break;case S.ValueType.Date:n.numFmtId=this._addNumFmtStr(`mm-dd-yy`);break;default:break}e.font&&(n.fontId=this._addFont(e.font)),e.border&&(n.borderId=this._addBorder(e.border)),e.fill&&(n.fillId=this._addFill(e.fill)),e.alignment&&(n.alignment=e.alignment),e.protection&&(n.protection=e.protection);let i=this._addStyle(n);return this.weakMap&&this.weakMap.set(e,i),i}getStyleModel(e){let t=this.model.styles[e];if(!t)return null;let n=this.index.model[e];if(n)return n;if(n=this.index.model[e]={},t.numFmtId){let e=this.index.numFmt[t.numFmtId]||cs.getDefaultFmtCode(t.numFmtId);e&&(n.numFmt=e)}function r(e,t,r){if(r||r===0){let i=t[r];i&&(n[e]=i)}}return r(`font`,this.model.fonts,t.fontId),r(`border`,this.model.borders,t.borderId),r(`fill`,this.model.fills,t.fillId),t.alignment&&(n.alignment=t.alignment),t.protection&&(n.protection=t.protection),n}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}_addStyle(e){let t=this.map.style.toXml(e),n=this.index.style[t];return n===void 0&&(n=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),n}_addNumFmtStr(e){let t=cs.getDefaultFmtId(e);if(t!==void 0||(t=this.index.numFmt[e],t!==void 0))return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;let n=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(n),t}_addFont(e){let t=this.map.font.toXml(e),n=this.index.font[t];return n===void 0&&(n=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),n}_addBorder(e){let t=this.map.border.toXml(e),n=this.index.border[t];return n===void 0&&(n=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),n}_addFill(e){let t=this.map.fill.toXml(e),n=this.index.fill[t];return n===void 0&&(n=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),n}static{this.STYLESHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac x16r2`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"xmlns:x16r2":`http://schemas.microsoft.com/office/spreadsheetml/2015/02/main`}}static{this.STATIC_XFORMS={cellStyles:new Go({tag:`cellStyles`,$:{count:1},c:[{tag:`cellStyle`,$:{name:`Normal`,xfId:0,builtinId:0}}]}),dxfs:new Go({tag:`dxfs`,$:{count:0}}),tableStyles:new Go({tag:`tableStyles`,$:{count:0,defaultTableStyle:`TableStyleMedium2`,defaultPivotStyle:`PivotStyleLight16`}}),extLst:new Go({tag:`extLst`,c:[{tag:`ext`,$:{uri:`{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`},c:[{tag:`x14:slicerStyles`,$:{defaultSlicerStyle:`SlicerStyleLight1`}}]},{tag:`ext`,$:{uri:`{9260A510-F301-46a8-8635-F512D64BE5F5}`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},c:[{tag:`x15:timelineStyles`,$:{defaultTimelineStyle:`TimeSlicerStyleLight1`}}]}]})}}};_s.Mock=class extends _s{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}],borders:[{}],fills:[{type:`pattern`,pattern:`none`},{type:`pattern`,pattern:`gray125`}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){switch(t){case S.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){let e={numFmtId:cs.getDefaultFmtId(`mm-dd-yy`)};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}};var vs=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[],this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?``:e.toISOString()}catch{return``}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(``))),!1}},ys=class e extends ${constructor(){super(),this.map={"dc:creator":new Xo({tag:`dc:creator`}),"dc:title":new Xo({tag:`dc:title`}),"dc:subject":new Xo({tag:`dc:subject`}),"dc:description":new Xo({tag:`dc:description`}),"dc:identifier":new Xo({tag:`dc:identifier`}),"dc:language":new Xo({tag:`dc:language`}),"cp:keywords":new Xo({tag:`cp:keywords`}),"cp:category":new Xo({tag:`cp:category`}),"cp:lastModifiedBy":new Xo({tag:`cp:lastModifiedBy`}),"cp:lastPrinted":new vs({tag:`cp:lastPrinted`,format:e.DateFormat}),"cp:revision":new Yo({tag:`cp:revision`}),"cp:version":new Xo({tag:`cp:version`}),"cp:contentStatus":new Xo({tag:`cp:contentStatus`}),"cp:contentType":new Xo({tag:`cp:contentType`}),"dcterms:created":new vs({tag:`dcterms:created`,attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new vs({tag:`dcterms:modified`,attrs:e.DateAttrs,format:e.DateFormat})}}render(t,n){t.openXml(Io.StdDocAttributes),t.openNode(`cp:coreProperties`,e.CORE_PROPERTY_ATTRIBUTES),this.map[`dc:creator`].render(t,n.creator),this.map[`dc:title`].render(t,n.title),this.map[`dc:subject`].render(t,n.subject),this.map[`dc:description`].render(t,n.description),this.map[`dc:identifier`].render(t,n.identifier),this.map[`dc:language`].render(t,n.language),this.map[`cp:keywords`].render(t,n.keywords),this.map[`cp:category`].render(t,n.category),this.map[`cp:lastModifiedBy`].render(t,n.lastModifiedBy),this.map[`cp:lastPrinted`].render(t,n.lastPrinted),this.map[`cp:revision`].render(t,n.revision),this.map[`cp:version`].render(t,n.version),this.map[`cp:contentStatus`].render(t,n.contentStatus),this.map[`cp:contentType`].render(t,n.contentType),this.map[`dcterms:created`].render(t,n.created),this.map[`dcterms:modified`].render(t,n.modified),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`cp:coreProperties`:case`coreProperties`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`cp:coreProperties`:case`coreProperties`:return this.model={creator:this.map[`dc:creator`].model,title:this.map[`dc:title`].model,subject:this.map[`dc:subject`].model,description:this.map[`dc:description`].model,identifier:this.map[`dc:identifier`].model,language:this.map[`dc:language`].model,keywords:this.map[`cp:keywords`].model,category:this.map[`cp:category`].model,lastModifiedBy:this.map[`cp:lastModifiedBy`].model,lastPrinted:this.map[`cp:lastPrinted`].model,revision:this.map[`cp:revision`].model,contentStatus:this.map[`cp:contentStatus`].model,contentType:this.map[`cp:contentType`].model,created:this.map[`dcterms:created`].model,modified:this.map[`dcterms:modified`].model},!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:dcterms":`http://purl.org/dc/terms/`,"xmlns:dcmitype":`http://purl.org/dc/dcmitype/`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`}}},bs=class extends ${get tag(){return`t`}render(e,t){e.openNode(`t`),/^\s|\n|\s$/.test(t)&&e.addAttribute(`xml:space`,`preserve`),e.writeText(t),e.closeNode()}parseOpen(e){switch(e.name){case`t`:return this._text=[],this.model=``,!0;default:return!1}}parseText(e){this._text.push(e),this.model=this._text.join(``).replace(/_x([0-9A-F]{4})_/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}parseClose(){return!1}},xs=class e extends ${constructor(e){super(),this.model=e}get tag(){return`r`}get textXform(){return this._textXform||=new bs}get fontXform(){return this._fontXform||=new Qo(e.FONT_OPTIONS)}render(e,t){let n=t||this.model;e.openNode(`r`),n.font&&this.fontXform.render(e,n.font),this.textXform.render(e,n.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`r`:return this.model={},!0;case`t`:return this.parser=this.textXform,this.parser.parseOpen(e),!0;case`rPr`:return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`r`:return!1;case`t`:return this.model.text=this.parser.model,this.parser=void 0,!0;case`rPr`:return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.FONT_OPTIONS={tagName:`rPr`,fontNameTag:`rFont`}}},Ss=class extends ${constructor(){super(),this.map={r:new xs,t:new bs}}get tag(){return`rPh`}render(e,t){if(e.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText){let{r:n}=this.map;t.richText.forEach(t=>{n.render(e,t)})}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model.text=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},Cs=class extends ${constructor(e){super(),this.model=e,this.map={r:new xs,t:new bs,rPh:new Ss}}get tag(){return`si`}render(e,t){e.openNode(this.tag),t&&typeof t==`object`&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText?t.richText.length?t.richText.forEach(t=>{this.map.r.render(e,t)}):this.map.t.render(e,``):t!=null&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={},!0):(this.parser=this.map[t],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},ws=class extends ${constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||=new Cs}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return t===void 0&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){let t=this.sharedStringXform.toXml(e),n=this.rich[t];return n===void 0&&(n=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,n}render(e,t){let n=t||this._values;e.openXml(Io.StdDocAttributes),e.openNode(`sst`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:n.count,uniqueCount:n.values.length});let r=this.sharedStringXform;n.values.forEach(t=>{r.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`sst`:return!0;case`si`:return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(e){case`sst`:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}},Ts=class extends ${render(e,t){e.leafNode(`Relationship`,t)}parseOpen(e){switch(e.name){case`Relationship`:return this.model=e.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}},Es=class e extends ${constructor(){super(),this.map={Relationship:new Ts}}render(t,n){let r=n||this._values;t.openXml(Io.StdDocAttributes),t.openNode(`Relationships`,e.RELATIONSHIPS_ATTRIBUTES),r.forEach(e=>{this.map.Relationship.render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Relationships`:return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case`Relationships`:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}static{this.RELATIONSHIPS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`}}},Ds=class e extends ${render(t,n){t.openXml(Io.StdDocAttributes),t.openNode(`Types`,e.PROPERTY_ATTRIBUTES);let r={};(n.media||[]).forEach(e=>{if(e.type===`image`){let n=e.extension;r[n]||(r[n]=!0,t.leafNode(`Default`,{Extension:n,ContentType:`image/${n}`}))}}),t.leafNode(`Default`,{Extension:`rels`,ContentType:`application/vnd.openxmlformats-package.relationships+xml`}),t.leafNode(`Default`,{Extension:`xml`,ContentType:`application/xml`}),t.leafNode(`Override`,{PartName:`/xl/workbook.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`}),n.worksheets.forEach(e=>{let n=`/xl/worksheets/sheet${e.id}.xml`;t.leafNode(`Override`,{PartName:n,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`})}),(n.pivotTables||[]).length&&(t.leafNode(`Override`,{PartName:`/xl/pivotCache/pivotCacheDefinition1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml`}),t.leafNode(`Override`,{PartName:`/xl/pivotCache/pivotCacheRecords1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml`}),t.leafNode(`Override`,{PartName:`/xl/pivotTables/pivotTable1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml`})),t.leafNode(`Override`,{PartName:`/xl/theme/theme1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.theme+xml`}),t.leafNode(`Override`,{PartName:`/xl/styles.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`}),n.sharedStrings&&n.sharedStrings.count&&t.leafNode(`Override`,{PartName:`/xl/sharedStrings.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`}),n.tables&&n.tables.forEach(e=>{t.leafNode(`Override`,{PartName:`/xl/tables/${e.target}`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`})}),n.drawings&&n.drawings.forEach(e=>{t.leafNode(`Override`,{PartName:`/xl/drawings/${e.name}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.drawing+xml`})}),n.commentRefs&&(t.leafNode(`Default`,{Extension:`vml`,ContentType:`application/vnd.openxmlformats-officedocument.vmlDrawing`}),n.commentRefs.forEach(({commentName:e})=>{t.leafNode(`Override`,{PartName:`/xl/${e}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml`})})),t.leafNode(`Override`,{PartName:`/docProps/core.xml`,ContentType:`application/vnd.openxmlformats-package.core-properties+xml`}),t.leafNode(`Override`,{PartName:`/docProps/app.xml`,ContentType:`application/vnd.openxmlformats-officedocument.extended-properties+xml`}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/content-types`}}},Os=class extends ${render(e,t){e.openNode(`HeadingPairs`),e.openNode(`vt:vector`,{size:2,baseType:`variant`}),e.openNode(`vt:variant`),e.leafNode(`vt:lpstr`,void 0,`Worksheets`),e.closeNode(),e.openNode(`vt:variant`),e.leafNode(`vt:i4`,void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`HeadingPairs`}parseText(){}parseClose(e){return e!==`HeadingPairs`}},ks=class extends ${render(e,t){e.openNode(`TitlesOfParts`),e.openNode(`vt:vector`,{size:t.length,baseType:`lpstr`}),t.forEach(t=>{e.leafNode(`vt:lpstr`,void 0,t.name)}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`TitlesOfParts`}parseText(){}parseClose(e){return e!==`TitlesOfParts`}},As=class e extends ${constructor(){super(),this.map={Company:new Xo({tag:`Company`}),Manager:new Xo({tag:`Manager`}),HeadingPairs:new Os,TitleOfParts:new ks}}render(t,n){t.openXml(Io.StdDocAttributes),t.openNode(`Properties`,e.PROPERTY_ATTRIBUTES),t.leafNode(`Application`,void 0,`Microsoft Excel`),t.leafNode(`DocSecurity`,void 0,`0`),t.leafNode(`ScaleCrop`,void 0,`false`),this.map.HeadingPairs.render(t,n.worksheets),this.map.TitleOfParts.render(t,n.worksheets),this.map.Company.render(t,n.company||``),this.map.Manager.render(t,n.manager),t.leafNode(`LinksUpToDate`,void 0,`false`),t.leafNode(`SharedDoc`,void 0,`false`),t.leafNode(`HyperlinksChanged`,void 0,`false`),t.leafNode(`AppVersion`,void 0,`16.0300`),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Properties`:return!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`Properties`:return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`}}},js=class extends ${constructor(){super(),this._parsedText=[]}render(e,t){e.openNode(`definedName`,{name:t.name,localSheetId:t.localSheetId}),e.writeText(t.ranges.join(`,`)),e.closeNode()}parseOpen(e){switch(e.name){case`definedName`:return this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:Ns(this._parsedText.join(``))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}};function Ms(e){try{return m.decodeEx(e),!0}catch{return!1}}function Ns(e){let t=[],n=!1,r=``;return e.split(`,`).forEach(e=>{if(!e)return;let i=(e.match(/'/g)||[]).length;if(!i){n?r+=`${e},`:Ms(e)&&t.push(e);return}let a=i%2==0;!n&&a&&Ms(e)?t.push(e):n&&!a?(n=!1,Ms(r+e)&&t.push(r+e),r=``):(n=!0,r+=`${e},`)}),t}var Ps=class extends ${render(e,t){e.leafNode(`sheet`,{sheetId:t.id,name:t.name,state:t.state,"r:id":t.rId})}parseOpen(e){return e.name===`sheet`?(this.model={name:ta(e.attributes.name),id:parseInt(e.attributes.sheetId,10),state:e.attributes.state,rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},Fs=class extends ${render(e,t){let n={xWindow:t.x||0,yWindow:t.y||0,windowWidth:t.width||12e3,windowHeight:t.height||24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&t.visibility!==`visible`&&(n.visibility=t.visibility),e.leafNode(`workbookView`,n)}parseOpen(e){if(e.name===`workbookView`){let t=this.model={},n=function(e,n,r){t[e]=n===void 0?r:n},r=function(e,n,r){let i=n===void 0?r:parseInt(n,10);i!==void 0&&(t[e]=i)};return r(`x`,e.attributes.xWindow,0),r(`y`,e.attributes.yWindow,0),r(`width`,e.attributes.windowWidth,25e3),r(`height`,e.attributes.windowHeight,1e4),n(`visibility`,e.attributes.visibility,`visible`),r(`activeTab`,e.attributes.activeTab,void 0),r(`firstSheet`,e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}},Is=class extends ${render(e,t){e.leafNode(`workbookPr`,{date1904:t.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(e){return e.name===`workbookPr`?(this.model={date1904:e.attributes.date1904===`1`},!0):!1}parseText(){}parseClose(){return!1}},Ls=class extends ${render(e,t){e.leafNode(`calcPr`,{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0})}parseOpen(e){return e.name===`calcPr`?(this.model={},!0):!1}parseText(){}parseClose(){return!1}},Rs=class extends ${render(e,t){e.leafNode(`pivotCache`,{cacheId:t.cacheId,"r:id":t.rId})}parseOpen(e){return e.name===`pivotCache`?(this.model={cacheId:e.attributes.cacheId,rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},zs=class e extends ${constructor(){super(),this.map={fileVersion:e.STATIC_XFORMS.fileVersion,workbookPr:new Is,bookViews:new Ko({tag:`bookViews`,count:!1,childXform:new Fs}),sheets:new Ko({tag:`sheets`,count:!1,childXform:new Ps}),definedNames:new Ko({tag:`definedNames`,count:!1,childXform:new js}),calcPr:new Ls,pivotCaches:new Ko({tag:`pivotCaches`,count:!1,childXform:new Rs})}}prepare(e){e.sheets=e.worksheets;let t=[],n=0;e.sheets.forEach(e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split(`&&`).forEach(r=>{let i=r.split(`:`),a={name:`_xlnm.Print_Area`,ranges:[`'${e.name}'!$${i[0]}:$${i[1]}`],localSheetId:n};t.push(a)}),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){let r=[];if(e.pageSetup.printTitlesColumn){let t=e.pageSetup.printTitlesColumn.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}if(e.pageSetup.printTitlesRow){let t=e.pageSetup.printTitlesRow.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}let i={name:`_xlnm.Print_Titles`,ranges:r,localSheetId:n};t.push(i)}n++}),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media||[]).forEach((e,t)=>{e.name=e.type+(t+1)})}render(t,n){t.openXml(Io.StdDocAttributes),t.openNode(`workbook`,e.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(t),this.map.workbookPr.render(t,n.properties),this.map.bookViews.render(t,n.views),this.map.sheets.render(t,n.sheets),this.map.definedNames.render(t,n.definedNames),this.map.calcPr.render(t,n.calcProperties),this.map.pivotCaches.render(t,n.pivotTables),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`workbook`:return!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`workbook`:return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1;default:return!0}}reconcile(e){let t=(e.workbookRels||[]).reduce((e,t)=>(e[t.Id]=t,e),{}),n=[],r,i=0;(e.sheets||[]).forEach(a=>{let o=t[a.rId];o&&(r=e.worksheetHash[`xl/${o.Target.replace(/^(\s|\/xl\/)+/,``)}`],r&&(r.name=a.name,r.id=a.id,r.state=a.state,n[i++]=r))});let a=[];e.definedNames&&e.definedNames.forEach(e=>{if(e.name===`_xlnm.Print_Area`){if(r=n[e.localSheetId],r){r.pageSetup||={};let t=m.decodeEx(e.ranges[0]);r.pageSetup.printArea=r.pageSetup.printArea?`${r.pageSetup.printArea}&&${t.dimensions}`:t.dimensions}}else if(e.name===`_xlnm.Print_Titles`){if(r=n[e.localSheetId],r){r.pageSetup||={};let t=e.ranges.join(`,`),n=/\$/g,i=t.match(/\$\d+:\$\d+/);if(i&&i.length){let e=i[0];r.pageSetup.printTitlesRow=e.replace(n,``)}let a=t.match(/\$[A-Z]+:\$[A-Z]+/);if(a&&a.length){let e=a[0];r.pageSetup.printTitlesColumn=e.replace(n,``)}}}else a.push(e)}),e.definedNames=a,e.media.forEach((e,t)=>{e.index=t})}static{this.WORKBOOK_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x15`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`}}static{this.STATIC_XFORMS={fileVersion:new Go({tag:`fileVersion`,$:{appName:`xl`,lastEdited:5,lowestEdited:5,rupBuild:9303}})}}};let Bs={OfficeDocument:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,Worksheet:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,CalcChain:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain`,SharedStrings:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,Styles:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,Theme:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,Hyperlink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,Image:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,CoreProperties:`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,ExtenderProperties:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,Comments:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,VmlDrawing:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,Table:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`,PivotCacheDefinition:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,PivotCacheRecords:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords`,PivotTable:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable`};var Vs=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{let t=`${e.master}:${e.address}`;this.merges[e.master]=new h(t)}}get mergeCells(){return Object.values(this.merges).map(e=>e.range)}reconcile(e,t){e.forEach(e=>{let n=m.decode(e);for(let e=n.top;e<=n.bottom;e++){let r=t[e-1];for(let t=n.left;t<=n.right;t++){let i=r.cells[t-1];i?i.type===S.ValueType.Merge&&(i.master=n.tl):r.cells[t]={type:S.ValueType.Null,address:m.encodeAddress(e,t)}}}})}getMasterAddress(e){let t=this.hash[e];return t&&t.tl}};function Hs(e){if(e==null)return S.ValueType.Null;if(e instanceof String||typeof e==`string`)return S.ValueType.String;if(typeof e==`number`)return S.ValueType.Number;if(typeof e==`boolean`)return S.ValueType.Boolean;if(e instanceof Date)return S.ValueType.Date;if(e.text&&e.hyperlink)return S.ValueType.Hyperlink;if(e.formula)return S.ValueType.Formula;if(e.error)return S.ValueType.Error;throw Error(`I could not understand type of value`)}function Us(e){switch(e.type){case S.ValueType.Formula:return Hs(e.result);default:return e.type}}var Ws=class extends ${constructor(){super(),this.richTextXform=new xs}get tag(){return`c`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{},Us(e));switch(n&&(e.styleId=n),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case S.ValueType.String:case S.ValueType.RichText:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case S.ValueType.Date:t.date1904&&(e.date1904=!0);break;case S.ValueType.Hyperlink:t.sharedStrings&&e.text!==void 0&&e.text!==null&&(e.ssId=t.sharedStrings.add(e.text)),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case S.ValueType.Merge:t.merges.add(e);break;case S.ValueType.Formula:if(t.date1904&&(e.date1904=!0),e.shareType===`shared`&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){let n=t.formulae[e.sharedFormula];if(!n)throw Error(`Shared Formula master must exist above and or left of clone for cell ${e.address}`);n.si===void 0?(n.shareType=`shared`,n.si=t.siFormulae++,n.range=new h(n.address,e.address)):n.range&&n.range.expandToAddress(e.address),e.si=n.si}break;default:break}}renderFormula(e,t){let n=null;switch(t.shareType){case`shared`:n={t:`shared`,ref:t.ref||t.range.range,si:t.si};break;case`array`:n={t:`array`,ref:t.ref};break;default:t.si!==void 0&&(n={t:`shared`,si:t.si});break}switch(Hs(t.result)){case S.ValueType.Null:e.leafNode(`f`,n,t.formula);break;case S.ValueType.String:e.addAttribute(`t`,`str`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case S.ValueType.Number:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case S.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result?1:0);break;case S.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result.error);break;case S.ValueType.Date:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,Zi(t.result,t.date1904));break;default:throw Error(`I could not understand type of value`)}}render(e,t){if(!(t.type===S.ValueType.Null&&!t.styleId)){switch(e.openNode(`c`),e.addAttribute(`r`,t.address),t.styleId&&e.addAttribute(`s`,t.styleId),t.type){case S.ValueType.Null:break;case S.ValueType.Number:e.leafNode(`v`,null,t.value);break;case S.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case S.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`v`,null,t.value.error);break;case S.ValueType.String:case S.ValueType.RichText:t.ssId===void 0?t.value&&t.value.richText?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.value.richText.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.value)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case S.ValueType.Date:e.leafNode(`v`,null,Zi(t.value,t.date1904));break;case S.ValueType.Hyperlink:t.ssId===void 0?(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.text)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case S.ValueType.Formula:this.renderFormula(e,t);break;case S.ValueType.Merge:break;default:break}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`c`:return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),!0;case`f`:return this.currentNode=`f`,this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case`v`:return this.currentNode=`v`,!0;case`t`:return this.currentNode=`t`,!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser){this.parser.parseText(e);return}switch(this.currentNode){case`f`:this.model.formula=this.model.formula?this.model.formula+e:e;break;case`v`:case`t`:this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e;break;default:break}}parseClose(e){switch(e){case`c`:{let{model:e}=this;if(e.formula||e.shareType)e.type=S.ValueType.Formula,e.value&&=(this.t===`str`?e.result=ta(e.value):this.t===`b`?e.result=parseInt(e.value,10)!==0:this.t===`e`?e.result={error:e.value}:e.result=parseFloat(e.value),void 0);else if(e.value!==void 0)switch(this.t){case`s`:e.type=S.ValueType.String,e.value=parseInt(e.value,10);break;case`str`:e.type=S.ValueType.String,e.value=ta(e.value);break;case`inlineStr`:e.type=S.ValueType.String;break;case`b`:e.type=S.ValueType.Boolean,e.value=parseInt(e.value,10)!==0;break;case`e`:e.type=S.ValueType.Error,e.value={error:e.value};break;default:e.type=S.ValueType.Number,e.value=parseFloat(e.value);break}else e.styleId?e.type=S.ValueType.Null:e.type=S.ValueType.Merge;return!1}case`f`:case`v`:case`is`:return this.currentNode=void 0,!0;case`t`:return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case`r`:return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return this.parser?(this.parser.parseClose(e),!0):!1}}reconcile(e,t){let n=e.styleId&&t.styles&&t.styles.getStyleModel(e.styleId);switch(n&&(e.style=n),e.styleId!==void 0&&(e.styleId=void 0),e.type){case S.ValueType.String:typeof e.value==`number`&&t.sharedStrings&&(e.value=t.sharedStrings.getString(e.value)),e.value.richText&&(e.type=S.ValueType.RichText);break;case S.ValueType.Number:n&&ra(n.numFmt)&&(e.type=S.ValueType.Date,e.value=Qi(e.value,t.date1904));break;case S.ValueType.Formula:e.result!==void 0&&n&&ra(n.numFmt)&&(e.result=Qi(e.result,t.date1904)),e.shareType===`shared`&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si);break;default:break}let r=t.hyperlinkMap[e.address];r&&(e.type===S.ValueType.Formula?(e.text=e.result,e.result=void 0):(e.text=e.value,e.value=void 0),e.type=S.ValueType.Hyperlink,e.hyperlink=r);let i=t.commentsMap&&t.commentsMap[e.address];i&&(e.comment=i)}},Gs=class extends ${constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new Ws}}get tag(){return`row`}prepare(e,t){let n=t.styles.addStyleModel(e.style);n&&(e.styleId=n);let r=this.map.c;e.cells.forEach(e=>{r.prepare(e,t)})}render(e,t,n){if(!t)return;e.openNode(`row`),e.addAttribute(`r`,t.number),t.height&&(e.addAttribute(`ht`,t.height),e.addAttribute(`customHeight`,`1`)),t.hidden&&e.addAttribute(`hidden`,`1`),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute(`spans`,`${t.min}:${t.max}`),t.styleId&&(e.addAttribute(`s`,t.styleId),e.addAttribute(`customFormat`,`1`)),e.addAttribute(`x14ac:dyDescent`,`0.25`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`);let r=this.map.c;t.cells.forEach(t=>{r.render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===`row`){this.numRowsSeen+=1;let t=e.attributes.spans?e.attributes.spans.split(`:`).map(e=>parseInt(e,10)):[void 0,void 0],n=this.model={number:parseInt(e.attributes.r,10),min:t[0],max:t[1],cells:[]};return e.attributes.s&&(n.styleId=parseInt(e.attributes.s,10)),aa(e.attributes.hidden)&&(n.hidden=!0),aa(e.attributes.bestFit)&&(n.bestFit=!0),e.attributes.ht&&(n.height=parseFloat(e.attributes.ht)),e.attributes.outlineLevel&&(n.outlineLevel=parseInt(e.attributes.outlineLevel,10)),aa(e.attributes.collapsed)&&(n.collapsed=!0),!0}return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId?t.styles.getStyleModel(e.styleId):{},e.styleId!==void 0&&(e.styleId=void 0);let n=this.map.c;e.cells.forEach(e=>{n.reconcile(e,t)})}},Ks=class extends ${get tag(){return`col`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{});n&&(e.styleId=n)}render(e,t){e.openNode(`col`),e.addAttribute(`min`,t.min),e.addAttribute(`max`,t.max),t.width&&e.addAttribute(`width`,t.width),t.styleId&&e.addAttribute(`style`,t.styleId),t.hidden&&e.addAttribute(`hidden`,`1`),t.bestFit&&e.addAttribute(`bestFit`,`1`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`),e.addAttribute(`customWidth`,`1`),e.closeNode()}parseOpen(e){if(e.name===`col`){let t=this.model={min:parseInt(e.attributes.min||`0`,10),max:parseInt(e.attributes.max||`0`,10),width:e.attributes.width===void 0?void 0:parseFloat(e.attributes.width||`0`)};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),aa(e.attributes.hidden)&&(t.hidden=!0),aa(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),aa(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId&&(e.style=t.styles.getStyleModel(e.styleId))}},qs=class extends ${get tag(){return`dimension`}render(e,t){t&&e.leafNode(`dimension`,{ref:t})}parseOpen(e){return e.name===`dimension`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},Js=class extends ${get tag(){return`hyperlink`}render(e,t){this.isInternalLink(t)?e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip,location:t.target}):e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){return e.name===`hyperlink`?(this.model={address:e.attributes.ref,rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip},e.attributes.location&&(this.model.target=e.attributes.location),!0):!1}parseText(){}parseClose(){return!1}isInternalLink(e){return!!(e.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(e.target))}},Ys=class extends ${get tag(){return`mergeCell`}render(e,t){e.leafNode(`mergeCell`,{ref:t})}parseOpen(e){return e.name===`mergeCell`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}};function Xs(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=i}function Zs(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=aa(i)}function Qs(e){if(!e)return[];let t=Object.entries(e).map(([e,t])=>({address:e,dataValidation:t,marked:!1})).sort((e,t)=>e.address.localeCompare(t.address)),n=Object.fromEntries(t.map(e=>[e.address,e])),r=(t,n,r)=>{for(let i=0;i<n;i++){let n=m.encodeAddress(t.row+i,r);if(!e[n]||!T(e[t.address],e[n]))return!1}return!0};return t.map(t=>{if(!t.marked){let i=m.decodeEx(t.address);if(i.dimensions)return n[i.dimensions].marked=!0,{...t.dataValidation,sqref:t.address};let a=1,o=m.encodeAddress(i.row+a,i.col);for(;e[o]&&T(t.dataValidation,e[o]);)a++,o=m.encodeAddress(i.row+a,i.col);let s=1;for(;r(i,a,i.col+s);)s++;for(let e=0;e<a;e++)for(let t=0;t<s;t++)o=m.encodeAddress(i.row+e,i.col+t),n[o].marked=!0;if(a>1||s>1){let e=i.row+(a-1),n=i.col+(s-1);return{...t.dataValidation,sqref:`${t.address}:${m.encodeAddress(e,n)}`}}return{...t.dataValidation,sqref:t.address}}return null}).filter(Boolean)}var $s=class extends ${get tag(){return`dataValidations`}render(e,t){let n=Qs(t);n.length&&(e.openNode(`dataValidations`,{count:n.length}),n.forEach(t=>{e.openNode(`dataValidation`),t.type!==`any`&&(e.addAttribute(`type`,t.type),t.operator&&t.type!==`list`&&t.operator!==`between`&&e.addAttribute(`operator`,t.operator),t.allowBlank&&e.addAttribute(`allowBlank`,`1`)),t.showInputMessage&&e.addAttribute(`showInputMessage`,`1`),t.promptTitle&&e.addAttribute(`promptTitle`,t.promptTitle),t.prompt&&e.addAttribute(`prompt`,t.prompt),t.showErrorMessage&&e.addAttribute(`showErrorMessage`,`1`),t.errorStyle&&e.addAttribute(`errorStyle`,t.errorStyle),t.errorTitle&&e.addAttribute(`errorTitle`,t.errorTitle),t.error&&e.addAttribute(`error`,t.error),e.addAttribute(`sqref`,t.sqref),(t.formulae||[]).forEach((n,r)=>{e.openNode(`formula${r+1}`),t.type===`date`?e.writeText(Zi(new Date(n))):e.writeText(n),e.closeNode()}),e.closeNode()}),e.closeNode())}parseOpen(e){switch(e.name){case`dataValidations`:return this.model={},!0;case`dataValidation`:{this._address=e.attributes.sqref;let t={type:e.attributes.type||`any`,formulae:[]};switch(e.attributes.type&&Zs(t,e.attributes,`allowBlank`),Zs(t,e.attributes,`showInputMessage`),Zs(t,e.attributes,`showErrorMessage`),t.type){case`any`:case`list`:case`custom`:break;default:Xs(t,e.attributes,`operator`,`between`);break}return Xs(t,e.attributes,`promptTitle`),Xs(t,e.attributes,`prompt`),Xs(t,e.attributes,`errorStyle`),Xs(t,e.attributes,`errorTitle`),Xs(t,e.attributes,`error`),this._dataValidation=t,!0}case`formula1`:case`formula2`:return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case`dataValidations`:return!1;case`dataValidation`:return(!this._dataValidation.formulae||!this._dataValidation.formulae.length)&&(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(e=>{e.includes(`:`)?new h(e).forEachAddress(e=>{this.model[e]=this._dataValidation}):this.model[e]=this._dataValidation}),!0;case`formula1`:case`formula2`:{let e=this._formula.join(``);switch(this._dataValidation.type){case`whole`:case`textLength`:e=parseInt(e,10);break;case`decimal`:e=parseFloat(e);break;case`date`:e=Qi(parseFloat(e));break;default:break}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}},ec=class extends ${get tag(){return`pageSetUpPr`}render(e,t){return t&&t.fitToPage?(e.leafNode(this.tag,{fitToPage:t.fitToPage?`1`:void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={fitToPage:e.attributes.fitToPage===`1`},!0):!1}parseText(){}parseClose(){return!1}};let tc=e=>e!==void 0;var nc=class extends ${get tag(){return`outlinePr`}render(e,t){return t&&(tc(t.summaryBelow)||tc(t.summaryRight))?(e.leafNode(this.tag,{summaryBelow:tc(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:tc(t.summaryRight)?Number(t.summaryRight):void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={summaryBelow:tc(e.attributes.summaryBelow)?!!Number(e.attributes.summaryBelow):void 0,summaryRight:tc(e.attributes.summaryRight)?!!Number(e.attributes.summaryRight):void 0},!0):!1}parseText(){}parseClose(){return!1}},rc=class extends ${constructor(){super(),this.map={tabColor:new qo(`tabColor`),pageSetUpPr:new ec,outlinePr:new nc}}get tag(){return`sheetPr`}render(e,t){if(t){e.addRollback(),e.openNode(`sheetPr`);let n=!1;n=this.map.tabColor.render(e,t.tabColor)||n,n=this.map.pageSetUpPr.render(e,t.pageSetup)||n,n=this.map.outlinePr.render(e,t.outlineProperties)||n,n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):this.map[e.name]?(this.parser=this.map[e.name],this.parser.parseOpen(e),!0):!1}parseText(e){return this.parser?(this.parser.parseText(e),!0):!1}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}},ic=class extends ${get tag(){return`sheetFormatPr`}render(e,t){if(t){let n={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow,outlineLevelCol:t.outlineLevelCol,"x14ac:dyDescent":t.dyDescent};t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),(!t.defaultRowHeight||t.defaultRowHeight!==15)&&(n.customHeight=`1`),Object.values(n).some(e=>e!==void 0)&&e.leafNode(`sheetFormatPr`,n)}}parseOpen(e){return e.name===`sheetFormatPr`?(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight||`0`),dyDescent:parseFloat(e.attributes[`x14ac:dyDescent`]||`0`),outlineLevelRow:parseInt(e.attributes.outlineLevelRow||`0`,10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol||`0`,10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),!0):!1}parseText(){}parseClose(){return!1}};let ac={frozen:`frozen`,frozenSplit:`frozen`,split:`split`};var oc=class extends ${get tag(){return`sheetView`}prepare(e){switch(e.state){case`frozen`:case`split`:break;default:e.state=`normal`;break}}render(e,t){e.openNode(`sheetView`,{workbookViewId:t.workbookViewId||0});let n=function(t,n,r){r&&e.addAttribute(t,n)};n(`rightToLeft`,`1`,t.rightToLeft===!0),n(`tabSelected`,`1`,t.tabSelected),n(`showRuler`,`0`,t.showRuler===!1),n(`showRowColHeaders`,`0`,t.showRowColHeaders===!1),n(`showGridLines`,`0`,t.showGridLines===!1),n(`zoomScale`,t.zoomScale,t.zoomScale),n(`zoomScaleNormal`,t.zoomScaleNormal,t.zoomScaleNormal),n(`view`,t.style,t.style);let r,i,a,o;switch(t.state){case`frozen`:i=t.xSplit||0,a=t.ySplit||0,r=t.topLeftCell||m.getAddress(a+1,i+1).address,o=t.xSplit&&t.ySplit&&`bottomRight`||t.xSplit&&`topRight`||`bottomLeft`,e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:r,activePane:o,state:`frozen`}),e.leafNode(`selection`,{pane:o,activeCell:t.activeCell,sqref:t.activeCell});break;case`split`:t.activePane===`topLeft`&&(t.activePane=void 0),e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode(`selection`,{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case`normal`:t.activeCell&&e.leafNode(`selection`,{activeCell:t.activeCell,sqref:t.activeCell});break;default:break}e.closeNode()}parseOpen(e){switch(e.name){case`sheetView`:return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:e.attributes.rightToLeft===`1`,tabSelected:e.attributes.tabSelected===`1`,showRuler:e.attributes.showRuler!==`0`,showRowColHeaders:e.attributes.showRowColHeaders!==`0`,showGridLines:e.attributes.showGridLines!==`0`,zoomScale:parseInt(e.attributes.zoomScale||`100`,10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal||`100`,10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case`pane`:return this.pane={xSplit:parseInt(e.attributes.xSplit||`0`,10),ySplit:parseInt(e.attributes.ySplit||`0`,10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane||`topLeft`,state:e.attributes.state},!0;case`selection`:{let t=e.attributes.pane||`topLeft`;return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,n;switch(e){case`sheetView`:return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:ac[this.pane.state]||`split`,xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state===`split`&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:`normal`,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}};function sc(e,t){return e?t:void 0}function cc(e,t){return e===t?!0:void 0}var lc=class extends ${get tag(){return`sheetProtection`}render(e,t){if(t){let n={sheet:sc(t.sheet,`1`),selectLockedCells:t.selectLockedCells===!1?`1`:void 0,selectUnlockedCells:t.selectUnlockedCells===!1?`1`:void 0,formatCells:sc(t.formatCells,`0`),formatColumns:sc(t.formatColumns,`0`),formatRows:sc(t.formatRows,`0`),insertColumns:sc(t.insertColumns,`0`),insertRows:sc(t.insertRows,`0`),insertHyperlinks:sc(t.insertHyperlinks,`0`),deleteColumns:sc(t.deleteColumns,`0`),deleteRows:sc(t.deleteRows,`0`),sort:sc(t.sort,`0`),autoFilter:sc(t.autoFilter,`0`),pivotTables:sc(t.pivotTables,`0`)};t.sheet&&(n.algorithmName=t.algorithmName,n.hashValue=t.hashValue,n.saltValue=t.saltValue,n.spinCount=t.spinCount,n.objects=sc(t.objects===!1,`1`),n.scenarios=sc(t.scenarios===!1,`1`)),Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={sheet:cc(e.attributes.sheet,`1`),objects:e.attributes.objects===`1`?!1:void 0,scenarios:e.attributes.scenarios===`1`?!1:void 0,selectLockedCells:e.attributes.selectLockedCells===`1`?!1:void 0,selectUnlockedCells:e.attributes.selectUnlockedCells===`1`?!1:void 0,formatCells:cc(e.attributes.formatCells,`0`),formatColumns:cc(e.attributes.formatColumns,`0`),formatRows:cc(e.attributes.formatRows,`0`),insertColumns:cc(e.attributes.insertColumns,`0`),insertRows:cc(e.attributes.insertRows,`0`),insertHyperlinks:cc(e.attributes.insertHyperlinks,`0`),deleteColumns:cc(e.attributes.deleteColumns,`0`),deleteRows:cc(e.attributes.deleteRows,`0`),sort:cc(e.attributes.sort,`0`),autoFilter:cc(e.attributes.autoFilter,`0`),pivotTables:cc(e.attributes.pivotTables,`0`)},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}},uc=class extends ${get tag(){return`pageMargins`}render(e,t){if(t){let n={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}};function dc(e){return e?`1`:void 0}function fc(e){switch(e){case`overThenDown`:return e;default:return}}function pc(e){switch(e){case`atEnd`:case`asDisplyed`:return e;default:return}}function mc(e){switch(e){case`dash`:case`blank`:case`NA`:return e;default:return}}function hc(e){return e===void 0?void 0:parseInt(e,10)}var gc=class extends ${get tag(){return`pageSetup`}render(e,t){if(t){let n={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:t.horizontalDpi,verticalDpi:t.verticalDpi,pageOrder:fc(t.pageOrder),blackAndWhite:dc(t.blackAndWhite),draft:dc(t.draft),cellComments:pc(t.cellComments),errors:mc(t.errors),scale:t.scale,fitToWidth:t.fitToWidth,fitToHeight:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:dc(!!t.firstPageNumber),usePrinterDefaults:dc(t.usePrinterDefaults),copies:t.copies};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={paperSize:hc(e.attributes.paperSize),orientation:e.attributes.orientation||`portrait`,horizontalDpi:parseInt(e.attributes.horizontalDpi||`4294967295`,10),verticalDpi:parseInt(e.attributes.verticalDpi||`4294967295`,10),pageOrder:e.attributes.pageOrder||`downThenOver`,blackAndWhite:e.attributes.blackAndWhite===`1`,draft:e.attributes.draft===`1`,cellComments:e.attributes.cellComments||`None`,errors:e.attributes.errors||`displayed`,scale:parseInt(e.attributes.scale||`100`,10),fitToWidth:parseInt(e.attributes.fitToWidth||`1`,10),fitToHeight:parseInt(e.attributes.fitToHeight||`1`,10),firstPageNumber:parseInt(e.attributes.firstPageNumber||`1`,10),useFirstPageNumber:e.attributes.useFirstPageNumber===`1`,usePrinterDefaults:e.attributes.usePrinterDefaults===`1`,copies:parseInt(e.attributes.copies||`1`,10)},!0;default:return!1}}parseText(){}parseClose(){return!1}};function _c(e){return e?`1`:void 0}var vc=class extends ${get tag(){return`printOptions`}render(e,t){if(t){let n={headings:_c(t.showRowColHeaders),gridLines:_c(t.showGridLines),horizontalCentered:_c(t.horizontalCentered),verticalCentered:_c(t.verticalCentered)};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={showRowColHeaders:e.attributes.headings===`1`,showGridLines:e.attributes.gridLines===`1`,horizontalCentered:e.attributes.horizontalCentered===`1`,verticalCentered:e.attributes.verticalCentered===`1`},!0;default:return!1}}parseText(){}parseClose(){return!1}},yc=class extends ${get tag(){return`autoFilter`}render(e,t){if(t)if(typeof t==`string`)e.leafNode(`autoFilter`,{ref:t});else{let n=function(e){return typeof e==`string`?e:m.getAddress(e.row,e.column).address},r=n(t.from),i=n(t.to);r&&i&&e.leafNode(`autoFilter`,{ref:`${r}:${i}`})}}parseOpen(e){e.name===`autoFilter`&&(this.model=e.attributes.ref)}},bc=class extends ${get tag(){return`picture`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},xc=class extends ${get tag(){return`drawing`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},Sc=class extends ${get tag(){return`tablePart`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},Cc=class extends ${get tag(){return`brk`}render(e,t){e.leafNode(`brk`,t)}parseOpen(e){return e.name===`brk`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},wc=class extends Ko{constructor(){let e={tag:`rowBreaks`,count:!0,childXform:new Cc};super(e)}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),this.count&&(e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length));let{childXform:n}=this;t.forEach(t=>{n.render(e,t)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}},Tc=class extends ${get tag(){return`headerFooter`}render(e,t){if(t){e.addRollback();let n=!1;e.openNode(`headerFooter`),t.differentFirst&&(e.addAttribute(`differentFirst`,`1`),n=!0),t.differentOddEven&&(e.addAttribute(`differentOddEven`,`1`),n=!0),t.oddHeader&&typeof t.oddHeader==`string`&&(e.leafNode(`oddHeader`,null,t.oddHeader),n=!0),t.oddFooter&&typeof t.oddFooter==`string`&&(e.leafNode(`oddFooter`,null,t.oddFooter),n=!0),t.evenHeader&&typeof t.evenHeader==`string`&&(e.leafNode(`evenHeader`,null,t.evenHeader),n=!0),t.evenFooter&&typeof t.evenFooter==`string`&&(e.leafNode(`evenFooter`,null,t.evenFooter),n=!0),t.firstHeader&&typeof t.firstHeader==`string`&&(e.leafNode(`firstHeader`,null,t.firstHeader),n=!0),t.firstFooter&&typeof t.firstFooter==`string`&&(e.leafNode(`firstFooter`,null,t.firstFooter),n=!0),n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){switch(e.name){case`headerFooter`:return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=parseInt(e.attributes.differentFirst,0)===1),e.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(e.attributes.differentOddEven,0)===1),!0;case`oddHeader`:return this.currentNode=`oddHeader`,!0;case`oddFooter`:return this.currentNode=`oddFooter`,!0;case`evenHeader`:return this.currentNode=`evenHeader`,!0;case`evenFooter`:return this.currentNode=`evenFooter`,!0;case`firstHeader`:return this.currentNode=`firstHeader`,!0;case`firstFooter`:return this.currentNode=`firstFooter`,!0;default:return!1}}parseText(e){switch(this.currentNode){case`oddHeader`:this.model.oddHeader=(this.model.oddHeader||``)+e;break;case`oddFooter`:this.model.oddFooter=(this.model.oddFooter||``)+e;break;case`evenHeader`:this.model.evenHeader=(this.model.evenHeader||``)+e;break;case`evenFooter`:this.model.evenFooter=(this.model.evenFooter||``)+e;break;case`firstHeader`:this.model.firstHeader=(this.model.firstHeader||``)+e;break;case`firstFooter`:this.model.firstFooter=(this.model.firstFooter||``)+e;break;default:break}}parseClose(){switch(this.currentNode){case`oddHeader`:case`oddFooter`:case`evenHeader`:case`evenFooter`:case`firstHeader`:case`firstFooter`:return this.currentNode=void 0,!0;default:return!1}}},Ec=class extends ${createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=this.createNewModel(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}get tag(){return``}},Dc=class extends ${get tag(){return`cfvo`}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:$.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}},Oc=class extends Ec{constructor(){super(),this.map={cfvo:this.cfvoXform=new Dc,color:this.colorXform=new qo}}get tag(){return`dataBar`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case`cfvo`:this.model.cfvo.push(t.model);break;case`color`:this.model.color=t.model;break}}},kc=class extends ${get tag(){return`x14:id`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Ac=class extends Ec{constructor(){super(),this.map={"x14:id":this.idXform=new kc}}get tag(){return`ext`}render(e,t){e.openNode(this.tag,{uri:`{B025F937-C7B1-47D3-B67F-A62EFF666E3E}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}},jc=class extends Ec{constructor(){super(),this.map={ext:new Ac}}get tag(){return`extLst`}render(e,t){e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}},Mc=class extends ${get tag(){return`formula`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Nc=class extends Ec{constructor(){super(),this.map={cfvo:this.cfvoXform=new Dc,color:this.colorXform=new qo}}get tag(){return`colorScale`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.color.forEach(t=>{this.colorXform.render(e,t)}),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}},Pc=class extends Ec{constructor(){super(),this.map={cfvo:this.cfvoXform=new Dc}}get tag(){return`iconSet`}render(e,t){e.openNode(this.tag,{iconSet:$.toStringAttribute(t.iconSet,`3TrafficLights`),reverse:$.toBoolAttribute(t.reverse,!1),showValue:$.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{iconSet:$.toStringValue(e.iconSet,`3TrafficLights`),reverse:$.toBoolValue(e.reverse),showValue:$.toBoolValue(e.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}};let Fc={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},Ic=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new h(e.ref);switch(e.operator){case`containsText`:return`NOT(ISERROR(SEARCH("${e.text}",${t})))`;case`containsBlanks`:return`LEN(TRIM(${t}))=0`;case`notContainsBlanks`:return`LEN(TRIM(${t}))>0`;case`containsErrors`:return`ISERROR(${t})`;case`notContainsErrors`:return`NOT(ISERROR(${t}))`;default:return}},Lc=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new h(e.ref);switch(e.timePeriod){case`thisWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${t},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case`lastWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${t},0)<(WEEKDAY(TODAY())+7))`;case`nextWeek`:return`AND(ROUNDDOWN(${t},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${t},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case`yesterday`:return`FLOOR(${t},1)=TODAY()-1`;case`today`:return`FLOOR(${t},1)=TODAY()`;case`tomorrow`:return`FLOOR(${t},1)=TODAY()+1`;case`last7Days`:return`AND(TODAY()-FLOOR(${t},1)<=6,FLOOR(${t},1)<=TODAY())`;case`lastMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0-1)),YEAR(${t})=YEAR(EDATE(TODAY(),0-1)))`;case`thisMonth`:return`AND(MONTH(${t})=MONTH(TODAY()),YEAR(${t})=YEAR(TODAY()))`;case`nextMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0+1)),YEAR(${t})=YEAR(EDATE(TODAY(),0+1)))`;default:return}},Rc=e=>{let{type:t,operator:n}=e;switch(t){case`containsText`:case`containsBlanks`:case`notContainsBlanks`:case`containsErrors`:case`notContainsErrors`:return{type:`containsText`,operator:t};default:return{type:t,operator:n}}};var zc=class e extends Ec{constructor(){super(),this.map={dataBar:this.databarXform=new Oc,extLst:this.extLstRefXform=new jc,formula:this.formulaXform=new Mc,colorScale:this.colorScaleXform=new Nc,iconSet:this.iconSetXform=new Pc}}get tag(){return`cfRule`}static isPrimitive(e){return!(e.type===`iconSet`&&(e.custom||Fc[e.iconSet]))}render(e,t){switch(t.type){case`expression`:this.renderExpression(e,t);break;case`cellIs`:this.renderCellIs(e,t);break;case`top10`:this.renderTop10(e,t);break;case`aboveAverage`:this.renderAboveAverage(e,t);break;case`dataBar`:this.renderDataBar(e,t);break;case`colorScale`:this.renderColorScale(e,t);break;case`iconSet`:this.renderIconSet(e,t);break;case`containsText`:this.renderText(e,t);break;case`timePeriod`:this.renderTimePeriod(e,t);break}}renderExpression(e,t){e.openNode(this.tag,{type:`expression`,dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:`cellIs`,dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach(t=>{this.formulaXform.render(e,t)}),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:`top10`,dxfId:t.dxfId,priority:t.priority,percent:$.toBoolAttribute(t.percent,!1),bottom:$.toBoolAttribute(t.bottom,!1),rank:$.toIntValue(t.rank,10)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:`aboveAverage`,dxfId:t.dxfId,priority:t.priority,aboveAverage:$.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:`colorScale`,priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(t,n){e.isPrimitive(n)&&(t.openNode(this.tag,{type:`iconSet`,priority:n.priority}),this.iconSetXform.render(t,n),t.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:$.toStringAttribute(t.operator,`containsText`)});let n=Ic(t);n&&this.formulaXform.render(e,n),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:`timePeriod`,dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});let n=Lc(t);n&&this.formulaXform.render(e,n),e.closeNode()}createNewModel({attributes:e}){return{...Rc(e),dxfId:$.toIntValue(e.dxfId),priority:$.toIntValue(e.priority),timePeriod:e.timePeriod,percent:$.toBoolValue(e.percent),bottom:$.toBoolValue(e.bottom),rank:$.toIntValue(e.rank),aboveAverage:$.toBoolValue(e.aboveAverage)}}onParserClose(e,t){switch(e){case`dataBar`:case`extLst`:case`colorScale`:case`iconSet`:Object.assign(this.model,t.model);break;case`formula`:this.model.formulae=this.model.formulae||[],this.model.formulae.push(t.model);break}}},Bc=class extends Ec{constructor(){super(),this.map={cfRule:new zc}}get tag(){return`conditionalFormatting`}render(e,t){t.rules.some(zc.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach(n=>{zc.isPrimitive(n)&&(n.ref=t.ref,this.map.cfRule.render(e,n))}),e.closeNode())}createNewModel({attributes:e}){return{ref:e.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}},Vc=class extends ${constructor(){super(),this.cfXform=new Bc}get tag(){return`conditionalFormatting`}reset(){this.model=[]}prepare(e,t){let n=e.reduce((e,t)=>Math.max(e,...t.rules.map(e=>e.priority||0)),1);e.forEach(e=>{e.rules.forEach(e=>{e.priority||=n++,e.style&&(e.dxfId=t.styles.addDxfStyle(e.style))})})}render(e,t){t.forEach(t=>{this.cfXform.render(e,t)})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`conditionalFormatting`:return this.parser=this.cfXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?this.parser.parseClose(e)?!0:(this.model.push(this.parser.model),this.parser=void 0,!1):!1}reconcile(e,t){e.forEach(e=>{e.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}};let Hc=[];for(let e=0;e<256;++e)Hc.push((e+256).toString(16).slice(1));function Uc(e,t=0){return(Hc[e[t+0]]+Hc[e[t+1]]+Hc[e[t+2]]+Hc[e[t+3]]+`-`+Hc[e[t+4]]+Hc[e[t+5]]+`-`+Hc[e[t+6]]+Hc[e[t+7]]+`-`+Hc[e[t+8]]+Hc[e[t+9]]+`-`+Hc[e[t+10]]+Hc[e[t+11]]+Hc[e[t+12]]+Hc[e[t+13]]+Hc[e[t+14]]+Hc[e[t+15]]).toLowerCase()}let Wc,Gc=new Uint8Array(16);function Kc(){if(!Wc){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Wc=crypto.getRandomValues.bind(crypto)}return Wc(Gc)}var qc={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Jc(e,t,n){e||={};let r=e.random??e.rng?.()??Kc();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Uc(r)}function Yc(e,t,n){return qc.randomUUID&&!t&&!e?qc.randomUUID():Jc(e,t,n)}var Xc=Yc,Zc=class extends ${get tag(){return`xm:f`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Qc=class extends Ec{constructor(){super(),this.map={"xm:f":this.fExtXform=new Zc}}get tag(){return`x14:cfvo`}render(e,t){e.openNode(this.tag,{type:t.type}),t.value!==void 0&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){switch(e){case`xm:f`:this.model.value=t.model?parseFloat(t.model):0;break}}},$c=class extends Ec{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Qc,"x14:borderColor":this.borderColorXform=new qo(`x14:borderColor`),"x14:negativeBorderColor":this.negativeBorderColorXform=new qo(`x14:negativeBorderColor`),"x14:negativeFillColor":this.negativeFillColorXform=new qo(`x14:negativeFillColor`),"x14:axisColor":this.axisColorXform=new qo(`x14:axisColor`)}}static isExt(e){return!e.gradient}get tag(){return`x14:dataBar`}render(e,t){e.openNode(this.tag,{minLength:$.toIntAttribute(t.minLength,0,!0),maxLength:$.toIntAttribute(t.maxLength,100,!0),border:$.toBoolAttribute(t.border,!1),gradient:$.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:$.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:$.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:$.toAttribute(t.axisPosition,`auto`),direction:$.toAttribute(t.direction,`leftToRight`)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],minLength:$.toIntValue(e.minLength,0),maxLength:$.toIntValue(e.maxLength,100),border:$.toBoolValue(e.border,!1),gradient:$.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:$.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:$.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:$.toStringValue(e.axisPosition,`auto`),direction:$.toStringValue(e.direction,`leftToRight`)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;default:this.model[n]=t.model;break}}},el=class extends ${get tag(){return`x14:cfIcon`}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen({attributes:e}){this.model={iconSet:e.iconSet,iconId:$.toIntValue(e.iconId)}}parseClose(e){return e!==this.tag}},tl=class extends Ec{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Qc,"x14:cfIcon":this.cfIconXform=new el}}get tag(){return`x14:iconSet`}render(e,t){e.openNode(this.tag,{iconSet:$.toStringAttribute(t.iconSet),reverse:$.toBoolAttribute(t.reverse,!1),showValue:$.toBoolAttribute(t.showValue,!0),custom:$.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.icons&&t.icons.forEach((t,n)=>{t.iconId=n,this.cfIconXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],iconSet:$.toStringValue(e.iconSet,`3TrafficLights`),reverse:$.toBoolValue(e.reverse,!1),showValue:$.toBoolValue(e.showValue,!0)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;case`cfIcon`:this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[n]=t.model;break}}};let nl={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};var rl=class e extends Ec{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new $c,"x14:iconSet":this.iconSetXform=new tl}}get tag(){return`x14:cfRule`}static isExt(e){return e.type===`dataBar`?$c.isExt(e):!!(e.type===`iconSet`&&(e.custom||nl[e.iconSet]))}prepare(t){e.isExt(t)&&(t.x14Id=`{${Xc()}}`.toUpperCase())}render(t,n){if(e.isExt(n))switch(n.type){case`dataBar`:this.renderDataBar(t,n);break;case`iconSet`:this.renderIconSet(t,n);break}}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:`iconSet`,priority:t.priority,id:t.x14Id||`{${Xc()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel({attributes:e}){return{type:e.type,x14Id:e.id,priority:$.toIntValue(e.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}},il=class extends ${get tag(){return`xm:sqref`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},al=class extends Ec{constructor(){super(),this.map={"xm:sqref":this.sqRef=new il,"x14:cfRule":this.cfRule=new rl}}get tag(){return`x14:conditionalFormatting`}prepare(e){e.rules.forEach(e=>{this.cfRule.prepare(e)})}render(e,t){t.rules.some(rl.isExt)&&(e.openNode(this.tag,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`}),t.rules.filter(rl.isExt).forEach(t=>this.cfRule.render(e,t)),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case`xm:sqref`:this.model.ref=t.model;break;case`x14:cfRule`:this.model.rules.push(t.model);break}}},ol=class extends Ec{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new al}}get tag(){return`x14:conditionalFormattings`}hasContent(e){return e.hasExtContent===void 0&&(e.hasExtContent=e.some(e=>e.rules.some(rl.isExt))),e.hasExtContent}prepare(e){e.forEach(e=>{this.cfXform.prepare(e)})}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach(t=>this.cfXform.render(e,t)),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}},sl=class extends Ec{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new ol}}get tag(){return`ext`}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e){this.conditionalFormattings.prepare(e.conditionalFormattings)}render(e,t){e.openNode(`ext`,{uri:`{78C0D931-6437-407d-A8EE-F0AAD7539E65}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}},cl=class extends Ec{constructor(){super(),this.map={ext:this.ext=new sl}}get tag(){return`extLst`}prepare(e,t){this.ext.prepare(e)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode(`extLst`),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}};let ll=(e,t)=>{Object.keys(t).forEach(n=>{let r=e[n],i=t[n];r===void 0&&i!==void 0&&(e[n]=i)})},ul=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;let n={},r={};return e.forEach(e=>{n[e.ref]=e,e.rules.forEach(e=>{let{x14Id:t}=e;t&&(r[t]=e)})}),t.forEach(t=>{t.rules.forEach(i=>{let a=r[i.x14Id];a?ll(a,i):n[t.ref]?n[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})})}),e};var dl=class e extends ${static{this.WORKSHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`}}constructor(e){super();let{maxRows:t,maxCols:n,ignoreNodes:r}=e||{};this.ignoreNodes=r||[],this.map={sheetPr:new rc,dimension:new qs,sheetViews:new Ko({tag:`sheetViews`,count:!1,childXform:new oc}),sheetFormatPr:new ic,cols:new Ko({tag:`cols`,count:!1,childXform:new Ks}),sheetData:new Ko({tag:`sheetData`,count:!1,empty:!0,childXform:new Gs({maxItems:n}),maxItems:t}),autoFilter:new yc,mergeCells:new Ko({tag:`mergeCells`,count:!0,childXform:new Ys}),rowBreaks:new wc,hyperlinks:new Ko({tag:`hyperlinks`,count:!1,childXform:new Js}),pageMargins:new uc,dataValidations:new $s,pageSetup:new gc,headerFooter:new Tc,printOptions:new vc,picture:new bc,drawing:new xc,sheetProtection:new lc,tableParts:new Ko({tag:`tableParts`,count:!0,childXform:new Sc}),conditionalFormatting:new Vc,extLst:new cl}}prepare(e,t){t.merges=new Vs,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;let n=e.rels=[];function r(e){return`rId${e.length+1}`}if(e.hyperlinks.forEach(e=>{let t=r(n);e.rId=t,n.push({Id:t,Type:Bs.Hyperlink,Target:e.target,TargetMode:`External`})}),e.comments.length>0){let i={Id:r(n),Type:Bs.Comments,Target:`../comments${e.id}.xml`};n.push(i);let a={Id:r(n),Type:Bs.VmlDrawing,Target:`../drawings/vmlDrawing${e.id}.vml`};n.push(a),e.comments.forEach(e=>{e.refAddress=m.decodeAddress(e.ref)}),t.commentRefs.push({commentName:`comments${e.id}`,vmlDrawing:`vmlDrawing${e.id}`})}let i=[],a;e.media.forEach(o=>{if(o.type===`background`){let i=r(n);a=t.media[o.imageId],n.push({Id:i,Type:Bs.Image,Target:`../media/${a.name}.${a.extension}`}),e.background={rId:i},e.image=t.media[o.imageId]}else if(o.type===`image`){let{drawing:s}=e;a=t.media[o.imageId],s||(s=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(s),n.push({Id:s.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:`../drawings/${s.name}.xml`}));let c=this.preImageId===o.imageId?i[o.imageId]:i[s.rels.length];c||(c=r(s.rels),i[s.rels.length]=c,s.rels.push({Id:c,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:`../media/${a.name}.${a.extension}`}));let l={picture:{rId:c},range:o.range};if(o.hyperlinks&&o.hyperlinks.hyperlink){let e=r(s.rels);i[s.rels.length]=e,l.picture.hyperlinks={tooltip:o.hyperlinks.tooltip,rId:e},s.rels.push({Id:e,Type:Bs.Hyperlink,Target:o.hyperlinks.hyperlink,TargetMode:`External`})}this.preImageId=o.imageId,s.anchors.push(l)}}),e.tables.forEach(e=>{let i=r(n);e.rId=i,n.push({Id:i,Type:Bs.Table,Target:`../tables/${e.target}`}),e.columns.forEach(e=>{let{style:n}=e;n&&(e.dxfId=t.styles.addDxfStyle(n))})}),(e.pivotTables||[]).length&&n.push({Id:r(n),Type:Bs.PivotTable,Target:`../pivotTables/pivotTable1.xml`}),this.map.extLst.prepare(e,t)}render(t,n){t.openXml(Io.StdDocAttributes),t.openNode(`worksheet`,e.WORKSHEET_ATTRIBUTES);let r=n.properties?{defaultRowHeight:n.properties.defaultRowHeight,dyDescent:n.properties.dyDescent,outlineLevelCol:n.properties.outlineLevelCol,outlineLevelRow:n.properties.outlineLevelRow}:void 0;n.properties&&n.properties.defaultColWidth&&(r.defaultColWidth=n.properties.defaultColWidth);let i={outlineProperties:n.properties&&n.properties.outlineProperties,tabColor:n.properties&&n.properties.tabColor,pageSetup:n.pageSetup&&n.pageSetup.fitToPage?{fitToPage:n.pageSetup.fitToPage}:void 0},a=n.pageSetup&&n.pageSetup.margins,o={showRowColHeaders:n.pageSetup&&n.pageSetup.showRowColHeaders,showGridLines:n.pageSetup&&n.pageSetup.showGridLines,horizontalCentered:n.pageSetup&&n.pageSetup.horizontalCentered,verticalCentered:n.pageSetup&&n.pageSetup.verticalCentered},s=n.sheetProtection;this.map.sheetPr.render(t,i),this.map.dimension.render(t,n.dimensions),this.map.sheetViews.render(t,n.views),this.map.sheetFormatPr.render(t,r),this.map.cols.render(t,n.cols),this.map.sheetData.render(t,n.rows),this.map.sheetProtection.render(t,s),this.map.autoFilter.render(t,n.autoFilter),this.map.mergeCells.render(t,n.mergeCells),this.map.conditionalFormatting.render(t,n.conditionalFormattings),this.map.dataValidations.render(t,n.dataValidations),this.map.hyperlinks.render(t,n.hyperlinks),this.map.printOptions.render(t,o),this.map.pageMargins.render(t,a),this.map.pageSetup.render(t,n.pageSetup),this.map.headerFooter.render(t,n.headerFooter),this.map.rowBreaks.render(t,n.rowBreaks),this.map.drawing.render(t,n.drawing),this.map.picture.render(t,n.background),this.map.tableParts.render(t,n.tables),this.map.extLst.render(t,n),n.rels&&n.rels.forEach(e=>{e.Type===Bs.VmlDrawing&&t.leafNode(`legacyDrawing`,{"r:id":e.Id})}),t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===`worksheet`?(Object.values(this.map).forEach(e=>{e.reset()}),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`worksheet`:{let e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);let t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},n=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),r=ul(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model[`x14:conditionalFormattings`]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:n,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:r},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(e,t){let n=(e.relationships||[]).reduce((n,r)=>{if(n[r.Id]=r,r.Type===Bs.Comments&&(e.comments=t.comments[r.Target].comments),r.Type===Bs.VmlDrawing&&e.comments&&e.comments.length){let n=t.vmlDrawings[r.Target].comments;e.comments.forEach((e,t)=>{e.note=Object.assign({},e.note,n[t])})}return n},{});if(t.commentsMap=(e.comments||[]).reduce((e,t)=>(t.ref&&(e[t.ref]=t),e),{}),t.hyperlinkMap=(e.hyperlinks||[]).reduce((e,t)=>(t.rId&&(e[t.address]=n[t.rId].Target),e),{}),t.formulae={},e.rows=e.rows&&e.rows.filter(Boolean)||[],e.rows.forEach(e=>{e.cells=e.cells&&e.cells.filter(Boolean)||[]}),this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){let r=n[e.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(r){let n=r[1];t.drawings[n].anchors.forEach(t=>{if(t.medium){let n={type:`image`,imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks};e.media.push(n)}})}}let r=e.background&&n[e.background.rId];if(r){let n=r.Target.split(`/media/`)[1],i=t.mediaIndex&&t.mediaIndex[n];i!==void 0&&e.media.push({type:`background`,imageId:i})}e.tables=(e.tables||[]).map(e=>{let r=n[e.rId];return t.tables[r.Target]}),delete e.relationships,delete e.hyperlinks,delete e.comments}},fl=class extends ${parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={range:{editAs:e.attributes.editAs||`oneCell`}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){let n=t.rels[e.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){let e=n[1],r=t.mediaIndex[e];return t.media[r]}}}},pl=class extends ${constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new Yo({tag:`xdr:col`,zero:!0}),"xdr:colOff":new Yo({tag:`xdr:colOff`,zero:!0}),"xdr:row":new Yo({tag:`xdr:row`,zero:!0}),"xdr:rowOff":new Yo({tag:`xdr:rowOff`,zero:!0})},this.model={nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0}}render(e,t){e.openNode(this.tag),this.map[`xdr:col`].render(e,t.nativeCol),this.map[`xdr:colOff`].render(e,t.nativeColOff),this.map[`xdr:row`].render(e,t.nativeRow),this.map[`xdr:rowOff`].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model={nativeCol:this.map[`xdr:col`].model,nativeColOff:this.map[`xdr:colOff`].model,nativeRow:this.map[`xdr:row`].model,nativeRowOff:this.map[`xdr:rowOff`].model},!1;default:return!0}}},ml=class extends ${constructor(){super(),this.model={rId:``}}get tag(){return`a:blip`}render(e,t){e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:embed`]},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},hl=class extends ${constructor(){super(),this.map={"a:blip":new ml}}get tag(){return`xdr:blipFill`}render(e,t){e.openNode(this.tag),this.map[`a:blip`].render(e,t),e.openNode(`a:stretch`),e.leafNode(`a:fillRect`),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:blip`].model,!1;default:return!0}}},gl=class extends ${constructor(){super(),this.model={}}get tag(){return`a:hlinkClick`}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){switch(e.name){case this.tag:return this.model={hyperlinks:{rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}},_l=class extends ${get tag(){return`a:extLst`}render(e){e.openNode(this.tag),e.openNode(`a:ext`,{uri:`{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}`}),e.leafNode(`a16:creationId`,{"xmlns:a16":`http://schemas.microsoft.com/office/drawing/2014/main`,id:`{00000000-0008-0000-0000-000002000000}`}),e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},vl=class extends ${constructor(){super(),this.map={"a:hlinkClick":new gl,"a:extLst":new _l}}get tag(){return`xdr:cNvPr`}render(e,t){e.openNode(this.tag,{id:t.index,name:`Picture ${t.index}`}),this.map[`a:hlinkClick`].render(e,t),this.map[`a:extLst`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:hlinkClick`].model,!1;default:return!0}}},yl=class extends ${get tag(){return`xdr:cNvPicPr`}render(e){e.openNode(this.tag),e.leafNode(`a:picLocks`,{noChangeAspect:`1`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},bl=class extends ${constructor(){super(),this.map={"xdr:cNvPr":new vl,"xdr:cNvPicPr":new yl}}get tag(){return`xdr:nvPicPr`}render(e,t){e.openNode(this.tag),this.map[`xdr:cNvPr`].render(e,t),this.map[`xdr:cNvPicPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`xdr:cNvPr`].model,!1;default:return!0}}};let xl={tag:`xdr:spPr`,c:[{tag:`a:xfrm`,c:[{tag:`a:off`,$:{x:`0`,y:`0`}},{tag:`a:ext`,$:{cx:`0`,cy:`0`}}]},{tag:`a:prstGeom`,$:{prst:`rect`},c:[{tag:`a:avLst`}]}]};var Sl=class extends ${constructor(){super(),this.map={"xdr:nvPicPr":new bl,"xdr:blipFill":new hl,"xdr:spPr":new Go(xl)}}get tag(){return`xdr:pic`}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map[`xdr:nvPicPr`].render(e,t),this.map[`xdr:blipFill`].render(e,t),this.map[`xdr:spPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}},Cl=class extends fl{constructor(){super(),this.map={"xdr:from":new pl({tag:`xdr:from`}),"xdr:to":new pl({tag:`xdr:to`}),"xdr:pic":new Sl,"xdr:clientData":new Go({tag:`xdr:clientData`})}}get tag(){return`xdr:twoCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:to`].render(e,t.range.br),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.br=this.map[`xdr:to`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};let wl=9525;var Tl=class extends ${constructor(e){super(),this.tag=e.tag,this.map={},this.model={width:0,height:0}}render(e,t){e.openNode(this.tag);let n=Math.floor(t.width*wl),r=Math.floor(t.height*wl);e.addAttribute(`cx`,n),e.addAttribute(`cy`,r),e.closeNode()}parseOpen(e){return e.name===this.tag?(this.model={width:parseInt(e.attributes.cx||`0`,10)/wl,height:parseInt(e.attributes.cy||`0`,10)/wl},!0):!1}parseText(e){}parseClose(e){return!1}},El=class extends fl{constructor(){super(),this.map={"xdr:from":new pl({tag:`xdr:from`}),"xdr:ext":new Tl({tag:`xdr:ext`}),"xdr:pic":new Sl,"xdr:clientData":new Go({tag:`xdr:clientData`})}}get tag(){return`xdr:oneCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:ext`].render(e,t.range.ext),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};function Dl(e){return(typeof e.range==`string`?m.decode(e.range):e.range).br?`xdr:twoCellAnchor`:`xdr:oneCellAnchor`}var Ol=class e extends ${constructor(){super(),this.map={"xdr:twoCellAnchor":new Cl,"xdr:oneCellAnchor":new El},this.model={anchors:[]}}prepare(e){e.anchors.forEach((e,t)=>{e.anchorType=Dl(e),this.map[e.anchorType].prepare(e,{index:t})})}get tag(){return`xdr:wsDr`}render(t,n){let r=n||this.model;t.openXml(Io.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),r.anchors.forEach(e=>{this.map[e.anchorType].render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`}}},kl=class extends ${constructor(){super(),this.model={val:``}}get tag(){return`customFilter`}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val,operator:e.attributes.operator},!0):!1}parseText(){}parseClose(){return!1}},Al=class extends ${constructor(){super(),this.model={val:``}}get tag(){return`filter`}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val},!0):!1}parseText(){}parseClose(){return!1}},jl=class extends ${constructor(){super(),this.map={customFilters:new Ko({tag:`customFilters`,count:!1,empty:!0,childXform:new kl}),filters:new Ko({tag:`filters`,count:!1,empty:!0,childXform:new Al})},this.model={filterButton:!1}}get tag(){return`filterColumn`}prepare(e,t){e.colId=t.index.toString()}render(e,t){if(t.customFilters){e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),this.map.customFilters.render(e,t.customFilters),e.closeNode();return}e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{attributes:t}=e;switch(e.name){case this.tag:return this.model={filterButton:t.hiddenButton===`0`},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}},Ml=class extends ${constructor(){super(),this.map={filterColumn:new jl},this.model={autoFilterRef:``,columns:[]}}get tag(){return`autoFilter`}prepare(e){e.columns.forEach((e,t)=>{this.map.filterColumn.prepare(e,{index:t})})}render(e,t){e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach(t=>{this.map.filterColumn.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}},Nl=class extends ${constructor(){super(),this.model={name:``}}get tag(){return`tableColumn`}prepare(e,t){e.id=t.index+1}render(e,t){e.leafNode(this.tag,{id:t.id.toString(),name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId})}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return!1}parseText(){}parseClose(){return!1}},Pl=class extends ${constructor(){super(),this.model={theme:null,showFirstColumn:!1,showLastColumn:!1,showRowStripes:!1,showColumnStripes:!1}}get tag(){return`tableStyleInfo`}render(e,t){e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?`1`:`0`,showLastColumn:t.showLastColumn?`1`:`0`,showRowStripes:t.showRowStripes?`1`:`0`,showColumnStripes:t.showColumnStripes?`1`:`0`})}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:t.showFirstColumn===`1`,showLastColumn:t.showLastColumn===`1`,showRowStripes:t.showRowStripes===`1`,showColumnStripes:t.showColumnStripes===`1`},!0}return!1}parseText(){}parseClose(){return!1}},Fl=class e extends ${constructor(){super(),this.map={autoFilter:new Ml,tableColumns:new Ko({tag:`tableColumns`,count:!0,empty:!0,childXform:new Nl}),tableStyleInfo:new Pl},this.model={id:0,name:``,tableRef:``,columns:[]}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return`table`}render(t,n){t.openXml(Io.StdDocAttributes),t.openNode(this.tag,{...e.TABLE_ATTRIBUTES,id:n.id,name:n.name,displayName:n.displayName||n.name,ref:n.tableRef,totalsRowCount:n.totalsRow?`1`:void 0,totalsRowShown:n.totalsRow?void 0:`1`,headerRowCount:n.headerRow?`1`:`0`}),this.map.autoFilter.render(t,n),this.map.tableColumns.render(t,n.columns),this.map.tableStyleInfo.render(t,n.style),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={name:n.name,displayName:n.displayName||n.name,tableRef:n.ref,totalsRow:n.totalsRowCount===`1`,headerRow:n.headerRowCount===`1`};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((e,t)=>{this.model.columns[t].filterButton=e.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(e,t){e.tableRef&&!e.ref&&(e.ref=e.tableRef),e.rows||=[],e.columns.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId))})}static{this.TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr xr3`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,"xmlns:xr3":`http://schemas.microsoft.com/office/spreadsheetml/2016/revision3`}}},Il=class e extends ${constructor(){super(),this.map={}}prepare(e){}get tag(){return`pivotCacheRecords`}render(t,n){let{sourceSheet:r,cacheFields:i}=n,a=r.getSheetValues().slice(2);t.openXml(Io.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_CACHE_RECORDS_ATTRIBUTES,count:a.length}),t.writeXml(o()),t.closeNode();function o(){return a.map(e=>[...s(e.slice(1))].join(``)).join(``)}function*s(e){yield`
|
|
32
32
|
<r>`;for(let[t,n]of e.entries())yield`
|
|
33
33
|
`,yield c(n,i[t].sharedItems);yield`
|
|
@@ -106,7 +106,7 @@ ${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namesp
|
|
|
106
106
|
${n}
|
|
107
107
|
/>
|
|
108
108
|
`}var Hl=class extends ${constructor(e){super(),this.model=e||{type:`note`,note:{texts:[]},ref:``}}get tag(){return`r`}get richTextXform(){return this._richTextXform||=new xs,this._richTextXform}render(e,t){let n=t||this.model;e.openNode(`comment`,{ref:n.ref,authorId:0}),e.openNode(`text`),n&&n.note&&n.note.texts&&n.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`comment`:return this.model={type:`note`,note:{texts:[]},...e.attributes},!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`comment`:return!1;case`r`:return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}},Ul=class e extends ${constructor(){super(),this.map={comment:new Hl},this.model={comments:[]}}render(t,n){let r=n||this.model;t.openXml(Io.StdDocAttributes),t.openNode(`comments`,e.COMMENTS_ATTRIBUTES),t.openNode(`authors`),t.leafNode(`author`,null,`Author`),t.closeNode(),t.openNode(`commentList`),r.comments.forEach(e=>{this.map.comment.render(t,e)}),t.closeNode(),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`commentList`:return this.model={comments:[]},!0;case`comment`:return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`commentList`:return!1;case`comment`:return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.COMMENTS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}},Wl=class extends ${constructor(){super(),this.model={}}get tag(){return`v:textbox`}conversionUnit(e,t,n){return`${(parseFloat(e.toString())*t).toFixed(2)}${n}`}reverseConversionUnit(e){return(e||``).split(`,`).map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,``)).toFixed(2)))}render(e,t){let n={style:`mso-direction-alt:auto`};if(t&&t.note){let{inset:e}=t.note&&t.note.margins||{};Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,`mm`)).join(`,`)),e&&(n.inset=e)}e.openNode(`v:textbox`,n),e.leafNode(`div`,{style:`text-align:left`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},Gl=class extends ${constructor(){super(),this.text=``}get tag(){return`x:Anchor`}getAnchorRect(e){let t=Math.floor(e.left),n=Math.floor((e.left-t)*68),r=Math.floor(e.top),i=Math.floor((e.top-r)*18),a=Math.floor(e.right),o=Math.floor((e.right-a)*68),s=Math.floor(e.bottom);return[t,n,r,i,a,o,s,Math.floor((e.bottom-s)*18)]}getDefaultRect(e){let t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){let n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode(`x:Anchor`,null,n.join(`, `))}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},Kl=class extends ${constructor(e){super(),this._model=e||{},this.text=``}get tag(){return this._model&&this._model.tag||``}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},ql=class extends ${constructor(e){super(),this._model=e||{},this.model={}}get tag(){return this._model&&this._model.tag||``}render(e,t,n){(n&&t===n[2]||n&&this.tag===`x:SizeWithCells`&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){switch(e.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}};let Jl=[`twoCells`,`oneCells`,`absolute`];var Yl=class extends ${constructor(){super(),this.map={"x:Anchor":new Gl,"x:Locked":new Kl({tag:`x:Locked`}),"x:LockText":new Kl({tag:`x:LockText`}),"x:SizeWithCells":new ql({tag:`x:SizeWithCells`}),"x:MoveWithCells":new ql({tag:`x:MoveWithCells`})},this.model={anchor:[],protection:{},editAs:``}}get tag(){return`x:ClientData`}render(e,t){let{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:`Note`}),this.map[`x:MoveWithCells`].render(e,r,Jl),this.map[`x:SizeWithCells`].render(e,r,Jl),this.map[`x:Anchor`].render(e,t),this.map[`x:Locked`].render(e,n.locked),e.leafNode(`x:AutoFill`,null,`False`),this.map[`x:LockText`].render(e,n.lockText),e.leafNode(`x:Row`,null,t.refAddress.row-1),e.leafNode(`x:Column`,null,t.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:``};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){let e=Object.assign({},this.map[`x:MoveWithCells`].model,this.map[`x:SizeWithCells`].model),t=Object.keys(e).length;this.model.editAs=Jl[t],this.model.anchor=this.map[`x:Anchor`].text,this.model.protection.locked=this.map[`x:Locked`].text,this.model.protection.lockText=this.map[`x:LockText`].text}},Xl=class e extends ${constructor(){super(),this.map={"v:textbox":new Wl,"x:ClientData":new Yl}}get tag(){return`v:shape`}render(t,n,r){t.openNode(`v:shape`,e.V_SHAPE_ATTRIBUTES(n,r||0)),t.leafNode(`v:fill`,{color2:`infoBackground [80]`}),t.leafNode(`v:shadow`,{color:`none [81]`,obscured:`t`}),t.leafNode(`v:path`,{"o:connecttype":`none`}),this.map[`v:textbox`].render(t,n),this.map[`x:ClientData`].render(t,n),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes[`o:insetmode`]},anchor:``,editAs:``,protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map[`v:textbox`].model&&this.map[`v:textbox`].model.inset,this.model.protection=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.protection,this.model.anchor=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.anchor,this.model.editAs=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.editAs,!1;default:return!0}}static{this.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s${1025+t}`,type:`#_x0000_t202`,style:`position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden`,fillcolor:`infoBackground [80]`,strokecolor:`none [81]`,"o:insetmode":e.note.margins&&e.note.margins.insetmode})}},Zl=class e extends ${constructor(){super(),this.map={"v:shape":new Xl},this.model={comments:[]}}get tag(){return`xml`}render(t,n){let r=n||this.model;t.openXml(Io.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),t.openNode(`o:shapelayout`,{"v:ext":`edit`}),t.leafNode(`o:idmap`,{"v:ext":`edit`,data:1}),t.closeNode(),t.openNode(`v:shapetype`,{id:`_x0000_t202`,coordsize:`21600,21600`,"o:spt":202,path:`m,l,21600r21600,l21600,xe`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.leafNode(`v:path`,{gradientshapeok:`t`,"o:connecttype":`rect`}),t.closeNode(),r.comments.forEach((e,n)=>{this.map[`v:shape`].render(t,e,n)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:x":`urn:schemas-microsoft-com:office:excel`}}},Ql=d(q(),1);Ji();var $l=d(sn(),1);function eu(e,t){return new Promise((n,r)=>{qi.readFile(e,t,(e,t)=>{e?r(e):n(t)})})}var tu=class e{constructor(e){this.workbook=e}async readFile(e,t){if(!await ia(e))throw Error(`File not found: ${e}`);let n=qi.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}parseRels(e){return new Es().parseStream(e)}parseWorkbook(e){return new zs().parseStream(e)}parseSharedStrings(e){return new ws().parseStream(e)}reconcile(e,t){let n=new zs,r=new dl(t),i=new Ol,a=new Fl;n.reconcile(e);let o={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach(t=>{let n=e.drawings[t],r=e.drawingRels[t];r&&(o.rels=r.reduce((e,t)=>(e[t.Id]=t,e),{}),(n.anchors||[]).forEach(e=>{let t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)}),i.reconcile(n,o))});let s={styles:e.styles};Object.values(e.tables).forEach(e=>{a.reconcile(e,s)});let c={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,c)}),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings}async _processWorksheetEntry(e,t,n,r,i){let a=await new dl(r).parseStream(e);if(!a)throw Error(`Failed to parse worksheet ${i}`);a.sheetNo=n,t.worksheetHash[i]=a,t.worksheets.push(a)}async _processCommentEntry(e,t,n){let r=await new Ul().parseStream(e);t.comments[`../${n}.xml`]=r}async _processTableEntry(e,t,n){let r=await new Fl().parseStream(e);t.tables[`../tables/${n}.xml`]=r}async _processWorksheetRelsEntry(e,t,n){let r=await new Es().parseStream(e);t.worksheetRels[n]=r}async _processMediaEntry(e,t,n){let r=n.lastIndexOf(`.`);if(r>=1){let i=n.substr(r+1),a=n.substr(0,r);await new Promise((r,o)=>{let s=new Do,c=()=>{e.removeListener(`error`,u),s.removeListener(`error`,u),s.removeListener(`finish`,l)},l=()=>{c(),t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;let e={type:`image`,name:a,extension:i,buffer:s.toBuffer()};t.media.push(e),r()},u=e=>{c(),o(e)};s.once(`finish`,l),e.on(`error`,u),s.on(`error`,u),e.pipe(s)})}}async _processDrawingEntry(e,t,n){let r=await new Ol().parseStream(e);t.drawings[n]=r}async _processDrawingRelsEntry(e,t,n){let r=await new Es().parseStream(e);t.drawingRels[n]=r}async _processVmlDrawingEntry(e,t,n){let r=await new Zl().parseStream(e);t.vmlDrawings[`../drawings/${n}.vml`]=r}async _processThemeEntry(e,t,n){await new Promise((r,i)=>{let a=new Do,o=()=>{e.removeListener(`error`,c),a.removeListener(`error`,c),a.removeListener(`finish`,s)},s=()=>{o(),t.themes[n]=a.read().toString(),r()},c=e=>{o(),i(e)};a.once(`finish`,s),e.on(`error`,c),a.on(`error`,c),e.pipe(a)})}async read(e,t){let n={};return await new Promise((t,r)=>{let i=0,a=!1,o=0,s=()=>{e.removeListener(`data`,u),e.removeListener(`end`,d),e.removeListener(`error`,f)},c=()=>{a&&i===o&&(s(),t())},l=new _o(e=>{o++;let t=[],a=0;e.ondata=(o,l,u)=>{if(o){s(),r(o);return}if(l&&(t.push(l),a+=l.length),u){if(t.length===1)n[e.name]=t[0];else if(t.length>1){let r=new Uint8Array(a),i=0;for(let e of t)r.set(e,i),i+=e.length;n[e.name]=r}else n[e.name]=new Uint8Array;i++,t.length=0,c()}},e.start()});l.register(go);let u=e=>{l.push(e)},d=()=>{l.push(new Uint8Array,!0),a=!0,c()},f=e=>{s(),r(e)};e.on(`data`,u),e.on(`end`,d),e.on(`error`,f)}),this.loadFromFiles(n,t)}async load(e,t){let n;if(!e||typeof e==`object`&&!Ql.Buffer.isBuffer(e)&&!(e instanceof Uint8Array)&&!(e instanceof ArrayBuffer))throw Error(`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);n=t&&t.base64?Ql.Buffer.from(e.toString(),`base64`):e;let r=new $l.PassThrough;return r.end(n),this.read(r,t)}async loadFromFiles(e,t){let n={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},r=Object.keys(e).map(t=>({name:t,dir:t.endsWith(`/`),data:e[t]}));for(let e of r)if(!e.dir){let r=e.name;r[0]===`/`&&(r=r.substr(1));let i;if(r.match(/xl\/media\//)||r.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))i=new $l.PassThrough,i.end(Ql.Buffer.from(e.data));else{i=new $l.PassThrough({readableObjectMode:!0,writableObjectMode:!0});let t=Ro(Ql.Buffer.from(e.data));i.end(t)}let a;if(a=r.match(/xl\/worksheets\/sheet(\d+)[.]xml/),a){let e=parseInt(a[1],10);await this._processWorksheetEntry(i,n,e,t,r)}else switch(r){case`_rels/.rels`:n.globalRels=await this.parseRels(i);break;case`xl/workbook.xml`:{let e=await this.parseWorkbook(i);n.sheets=e.sheets,n.definedNames=e.definedNames,n.views=e.views,n.properties=e.properties,n.calcProperties=e.calcProperties;break}case`xl/sharedStrings.xml`:n.sharedStrings=new ws,await n.sharedStrings.parseStream(i);break;case`xl/_rels/workbook.xml.rels`:n.workbookRels=await this.parseRels(i);break;case`docProps/app.xml`:{let e=await new As().parseStream(i);n.company=e.company,n.manager=e.manager;break}case`docProps/core.xml`:{let e=await new ys().parseStream(i);Object.assign(n,e);break}case`xl/styles.xml`:n.styles=new _s,await n.styles.parseStream(i);break;default:if(a=r.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml[.]rels/),a){let e=parseInt(a[1],10);await this._processWorksheetRelsEntry(i,n,e);break}if(a=r.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),a){await this._processMediaEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/(drawing\d+)[.]xml/),a){await this._processDrawingEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/_rels\/(drawing\d+)[.]xml[.]rels/),a){await this._processDrawingRelsEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),a){await this._processVmlDrawingEntry(i,n,a[1]);break}if(a=r.match(/xl\/comments(\d+)[.]xml/),a){await this._processCommentEntry(i,n,`comments${a[1]}`);break}if(a=r.match(/xl\/tables\/(table\d+)[.]xml/),a){await this._processTableEntry(i,n,a[1]);break}if(a=r.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),a){await this._processThemeEntry(i,n,a[1]);break}}}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async addContentTypes(e,t){let n=new Ds().toXml(t);e.append(n,{name:`[Content_Types].xml`})}async addApp(e,t){let n=new As().toXml(t);e.append(n,{name:`docProps/app.xml`})}async addCore(e,t){let n=new ys;e.append(n.toXml(t),{name:`docProps/core.xml`})}async addThemes(e,t){let n=t.themes||{theme1:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
109
|
-
<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:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <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="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`};Object.keys(n).forEach(t=>{let r=n[t],i=`xl/theme/${t}.xml`;e.append(r,{name:i})})}async addOfficeRels(t,n){let r=new Es().toXml([{Id:`rId1`,Type:e.RelType.OfficeDocument,Target:`xl/workbook.xml`},{Id:`rId2`,Type:e.RelType.CoreProperties,Target:`docProps/core.xml`},{Id:`rId3`,Type:e.RelType.ExtenderProperties,Target:`docProps/app.xml`}]);t.append(r,{name:`_rels/.rels`})}async addWorkbookRels(t,n){let r=1,i=[{Id:`rId${r++}`,Type:e.RelType.Styles,Target:`styles.xml`},{Id:`rId${r++}`,Type:e.RelType.Theme,Target:`theme/theme1.xml`}];if(n.sharedStrings.count&&i.push({Id:`rId${r++}`,Type:e.RelType.SharedStrings,Target:`sharedStrings.xml`}),(n.pivotTables||[]).length){let t=n.pivotTables[0];t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.PivotCacheDefinition,Target:`pivotCache/pivotCacheDefinition1.xml`})}n.worksheets.forEach(t=>{t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:`worksheets/sheet${t.id}.xml`})});let a=new Es().toXml(i);t.append(a,{name:`xl/_rels/workbook.xml.rels`})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:`xl/sharedStrings.xml`})}async addStyles(e,t){let{xml:n}=t.styles;n&&e.append(n,{name:`xl/styles.xml`})}async addWorkbook(e,t){let n=new zs;e.append(n.toXml(t),{name:`xl/workbook.xml`})}async addWorksheets(e,t){let n=new dl,r=new Es,i=new Ul,a=new Zl;t.worksheets.forEach(t=>{let o=new Io;n.render(o,t),e.append(o.xml,{name:`xl/worksheets/sheet${t.id}.xml`}),t.rels&&t.rels.length&&(o=new Io,r.render(o,t.rels),e.append(o.xml,{name:`xl/worksheets/_rels/sheet${t.id}.xml.rels`})),t.comments.length>0&&(o=new Io,i.render(o,t),e.append(o.xml,{name:`xl/comments${t.id}.xml`}),o=new Io,a.render(o,t),e.append(o.xml,{name:`xl/drawings/vmlDrawing${t.id}.vml`}))})}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if(t.type===`image`){let n=`xl/media/${t.name}.${t.extension}`;if(t.filename){let r=await eu(t.filename);return e.append(r,{name:n})}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64,i=r.substring(r.indexOf(`,`)+1);return e.append(i,{name:n,base64:!0})}}throw Error(`Unsupported media`)}))}addDrawings(e,t){let n=new Ol,r=new Es;t.worksheets.forEach(t=>{let{drawing:i}=t;if(i){n.prepare(i);let t=n.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=r.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}})}addTables(e,t){let n=new Fl;t.worksheets.forEach(t=>{let{tables:r}=t;r.forEach(t=>{n.prepare(t,{});let r=n.toXml(t);e.append(r,{name:`xl/tables/${t.target}`})})})}addPivotTables(t,n){if(!n.pivotTables.length)return;let r=n.pivotTables[0],i=new Il,a=new Rl,o=new zl,s=new Es,c=i.toXml(r);t.append(c,{name:`xl/pivotCache/pivotCacheRecords1.xml`}),c=a.toXml(r),t.append(c,{name:`xl/pivotCache/pivotCacheDefinition1.xml`}),c=s.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheRecords,Target:`pivotCacheRecords1.xml`}]),t.append(c,{name:`xl/pivotCache/_rels/pivotCacheDefinition1.xml.rels`}),c=o.toXml(r),t.append(c,{name:`xl/pivotTables/pivotTable1.xml`}),c=s.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheDefinition,Target:`../pivotCache/pivotCacheDefinition1.xml`}]),t.append(c,{name:`xl/pivotTables/_rels/pivotTable1.xml.rels`})}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator||`ExcelTS`,e.lastModifiedBy=e.lastModifiedBy||`ExcelTS`,e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=t.useSharedStrings===void 0?!0:t.useSharedStrings,e.useStyles=t.useStyles===void 0?!0:t.useStyles,e.sharedStrings=new ws,e.styles=e.useStyles?new _s(!0):new _s.Mock;let n=new zs,r=new dl;n.prepare(e);let i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{a++,t.target=`table${a}.xml`,t.id=a,e.tables.push(t)}),r.prepare(t,i)})}async write(e,t){t||={};let{model:n}=this.workbook,r=new No(t.zip);return r.pipe(e),this.prepareModel(n,t),await this.addContentTypes(r,n),await this.addOfficeRels(r,n),await this.addWorkbookRels(r,n),await this.addWorksheets(r,n),await this.addSharedStrings(r,n),this.addDrawings(r,n),this.addTables(r,n),this.addPivotTables(r,n),await Promise.all([this.addThemes(r,n),this.addStyles(r,n)]),await this.addMedia(r,n),await Promise.all([this.addApp(r,n),this.addCore(r,n)]),await this.addWorkbook(r,n),this._finalize(r)}writeFile(e,t){let n=qi.createWriteStream(e);return new Promise((e,r)=>{let i=()=>{n.removeListener(`finish`,a),n.removeListener(`error`,o)},a=()=>{i(),e()},o=e=>{i(),r(e)};n.once(`finish`,a),n.on(`error`,o),this.write(n,t).then(()=>{n.end()}).catch(e=>{i(),r(e)})})}async writeBuffer(e){let t=new Do;return await this.write(t,e),t.read()}static{this.RelType=Bs}},nu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FormatterOptions=class{objectMode=!0;delimiter=`,`;rowDelimiter=`
|
|
110
|
-
`;quote=`"`;escape=this.quote;quoteColumns=!1;quoteHeaders=this.quoteColumns;headers=null;includeEndRowDelimiter=!1;transform;shouldWriteHeaders;writeBOM=!1;escapedQuote;BOM=``;alwaysWriteHeaders=!1;constructor(e={}){Object.assign(this,e||{}),e?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),e?.quote===!0?this.quote=`"`:e?.quote===!1&&(this.quote=``),typeof e?.escape!=`string`&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&(e.writeHeaders??!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}})),ru=c(((e,t)=>{var n=`[object AsyncFunction]`,r=`[object Function]`,i=`[object GeneratorFunction]`,a=`[object Null]`,o=`[object Proxy]`,s=`[object Undefined]`,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype,f=d.hasOwnProperty,p=d.toString,m=u.Symbol,h=m?m.toStringTag:void 0;function g(e){return e==null?e===void 0?s:a:h&&h in Object(e)?_(e):v(e)}function _(e){var t=f.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch{}var i=p.call(e);return r&&(t?e[h]=n:delete e[h]),i}function v(e){return p.call(e)}function y(e){if(!b(e))return!1;var t=g(e);return t==r||t==i||t==n||t==o}function b(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=y})),iu=c(((e,t)=>{var n=`[object Boolean]`,r=Object.prototype.toString;function i(e){return e===!0||e===!1||a(e)&&r.call(e)==n}function a(e){return!!e&&typeof e==`object`}t.exports=i})),au=c(((e,t)=>{function n(e){return e==null}t.exports=n})),ou=c(((e,t)=>{var n=1/0,r=`[object Symbol]`,i=/[\\^$.*+?()[\]{}|]/g,a=RegExp(i.source),o=typeof global==`object`&&global&&global.Object===Object&&global,s=typeof self==`object`&&self&&self.Object===Object&&self,c=o||s||Function(`return this`)(),l=Object.prototype.toString,u=c.Symbol,d=u?u.prototype:void 0,f=d?d.toString:void 0;function p(e){if(typeof e==`string`)return e;if(h(e))return f?f.call(e):``;var t=e+``;return t==`0`&&1/e==-n?`-0`:t}function m(e){return!!e&&typeof e==`object`}function h(e){return typeof e==`symbol`||m(e)&&l.call(e)==r}function g(e){return e==null?``:p(e)}function _(e){return e=g(e),e&&a.test(e)?e.replace(i,`\\$&`):e}t.exports=_})),su=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});let n=t(iu()),r=t(au()),i=t(ou());e.FieldFormatter=class{formatterOptions;_headers=null;REPLACE_REGEXP;ESCAPE_REGEXP;constructor(e){this.formatterOptions=e,e.headers!==null&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,`g`);let t=`[${e.delimiter}${(0,i.default)(e.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){let r=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return(0,n.default)(r)?r:Array.isArray(r)?r[e]:this._headers===null?!1:r[this._headers[e]]}format(e,t,n){let i=`${(0,r.default)(e)?``:e}`.replace(/\0/g,``),{formatterOptions:a}=this;return a.quote!==``&&i.indexOf(a.quote)!==-1?this.quoteField(i.replace(this.REPLACE_REGEXP,a.escapedQuote)):i.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(t,n)?this.quoteField(i):i}quoteField(e){let{quote:t}=this.formatterOptions;return`${t}${e}${t}`}}})),cu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSyncTransform=e=>e.length===1})),lu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});let n=t(ru()),r=su(),i=cu();e.RowFormatter=class e{static isRowHashArray(e){return Array.isArray(e)?Array.isArray(e[0])&&e[0].length===2:!1}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(t){return e.isRowHashArray(t)?t.map(e=>e[0]):Array.isArray(t)?t:Object.keys(t)}static createTransform(e){return(0,i.isSyncTransform)(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:(t,n)=>{e(t,n)}}formatterOptions;fieldFormatter;shouldWriteHeaders;_rowTransform;headers;hasWrittenHeaders;rowCount=0;constructor(e){this.formatterOptions=e,this.fieldFormatter=new r.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}set rowTransform(t){if(!(0,n.default)(t))throw TypeError(`The transform should be a function`);this._rowTransform=e.createTransform(t)}format(e,t){this.callTransformer(e,(n,r)=>{if(n)return t(n);if(!e)return t(null);let i=[];if(r){let{shouldFormatColumns:e,headers:t}=this.checkHeaders(r);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){let e=this.gatherColumns(r);i.push(this.formatColumns(e,!1))}}return t(null,i)})}finish(e){let t=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return e(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(t){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let n=e.gatherHeaders(t);return this.headers=n,this.fieldFormatter.headers=n,this.shouldWriteHeaders?Array.isArray(t)&&n.every((e,n)=>e===t[n])?{shouldFormatColumns:!1,headers:n}:{shouldFormatColumns:!0,headers:n}:{shouldFormatColumns:!0,headers:null}}gatherColumns(t){if(this.headers===null)throw Error(`Headers is currently null`);return Array.isArray(t)?e.isRowHashArray(t)?this.headers.map((e,n)=>{let r=t[n];return r?r[1]:``}):e.isRowArray(t)&&!this.shouldWriteHeaders?t:this.headers.map((e,n)=>t[n]):this.headers.map(e=>t[e])}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){let n=e.map((e,n)=>this.fieldFormatter.format(e,n,t)).join(this.formatterOptions.delimiter),{rowCount:r}=this;return this.rowCount+=1,r?[this.formatterOptions.rowDelimiter,n].join(``):n}}})),uu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FieldFormatter=e.RowFormatter=void 0;var t=lu();Object.defineProperty(e,`RowFormatter`,{enumerable:!0,get:function(){return t.RowFormatter}});var n=su();Object.defineProperty(e,`FieldFormatter`,{enumerable:!0,get:function(){return n.FieldFormatter}})})),du=c((e=>{var t=d(q());Object.defineProperty(e,`__esModule`,{value:!0});let n=sn(),r=uu();e.CsvFormatterStream=class extends n.Transform{formatterOptions;rowFormatter;hasWrittenBOM=!1;constructor(e){super({writableObjectMode:e.objectMode}),this.formatterOptions=e,this.rowFormatter=new r.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,n,r){let i=!1;try{this.hasWrittenBOM||=(this.push(this.formatterOptions.BOM),!0),this.rowFormatter.format(e,(e,n)=>e?(i=!0,r(e)):(n&&n.forEach(e=>{this.push(t.Buffer.from(e,`utf8`))}),i=!0,r()))}catch(e){if(i)throw e;r(e)}}_flush(e){this.rowFormatter.finish((n,r)=>n?e(n):(r&&r.forEach(e=>{this.push(t.Buffer.from(e,`utf8`))}),e()))}}})),fu=c((e=>{var t=d(q()),n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},a=e&&e.__exportStar||function(e,t){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=e.FormatterOptions=e.CsvFormatterStream=void 0;let o=Wt(),s=sn(),c=i((Ji(),f(Ki))),l=nu(),u=du();a(cu(),e);var p=du();Object.defineProperty(e,`CsvFormatterStream`,{enumerable:!0,get:function(){return p.CsvFormatterStream}});var m=nu();Object.defineProperty(e,`FormatterOptions`,{enumerable:!0,get:function(){return m.FormatterOptions}}),e.format=e=>new u.CsvFormatterStream(new l.FormatterOptions(e)),e.write=(t,n)=>{let r=(0,e.format)(n),i=(0,o.promisify)((e,t)=>{r.write(e,void 0,t)});return t.reduce((e,t)=>e.then(()=>i(t)),Promise.resolve()).then(()=>{r.end()}).catch(e=>{r.emit(`error`,e)}),r},e.writeToStream=(t,n,r)=>(0,e.write)(n,r).pipe(t),e.writeToBuffer=(n,r={})=>{let i=[],a=new s.Writable({write(e,t,n){i.push(e),n()}});return new Promise((o,s)=>{a.on(`error`,s).on(`finish`,()=>o(t.Buffer.concat(i))),(0,e.write)(n,r).pipe(a)})},e.writeToString=(t,n)=>(0,e.writeToBuffer)(t,n).then(e=>e.toString()),e.writeToPath=(t,n,r)=>{let i=c.createWriteStream(t,{encoding:`utf8`});return(0,e.write)(n,r).pipe(i)}})),pu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});let n=t(ou()),r=t(au());e.ParserOptions=class{escapedDelimiter;objectMode=!0;delimiter=`,`;ignoreEmpty=!1;quote=`"`;escape=null;escapeChar=this.quote;comment=null;supportsComments=!1;ltrim=!1;rtrim=!1;trim=!1;headers=null;renameHeaders=!1;strictColumnHandling=!1;discardUnmappedColumns=!1;carriageReturn=`\r`;NEXT_TOKEN_REGEXP;encoding=`utf8`;limitRows=!1;maxRows=0;skipLines=0;skipRows=0;constructor(e){if(Object.assign(this,e||{}),this.delimiter.length>1)throw Error(`delimiter option must be one character long`);this.escapedDelimiter=(0,n.default)(this.delimiter),this.escapeChar=this.escape??this.quote,this.supportsComments=!(0,r.default)(this.comment),this.NEXT_TOKEN_REGEXP=RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}})),mu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSyncTransform=e=>e.length===1,e.isSyncValidate=e=>e.length===1})),hu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});let n=t(ru()),r=mu();e.RowTransformerValidator=class e{static createTransform(e){return(0,r.isSyncTransform)(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:e}static createValidator(e){return(0,r.isSyncValidate)(e)?(t,n)=>{n(null,{row:t,isValid:e(t)})}:(t,n)=>{e(t,(e,r,i)=>e?n(e):r?n(null,{row:t,isValid:r,reason:i}):n(null,{row:t,isValid:!1,reason:i}))}}_rowTransform=null;_rowValidator=null;set rowTransform(t){if(!(0,n.default)(t))throw TypeError(`The transform should be a function`);this._rowTransform=e.createTransform(t)}set rowValidator(t){if(!(0,n.default)(t))throw TypeError(`The validate should be a function`);this._rowValidator=e.createValidator(t)}transformAndValidate(e,t){return this.callTransformer(e,(e,n)=>e?t(e):n?this.callValidator(n,(e,r)=>e?t(e):r&&!r.isValid?t(null,{row:n,isValid:!1,reason:r.reason}):t(null,{row:n,isValid:!0})):t(null,{row:null,isValid:!0}))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}})),gu=c(((e,t)=>{function n(e){return e===void 0}t.exports=n})),_u=c(((e,t)=>{var n=200,r=`__lodash_hash_undefined__`,i=1/0,a=`[object Function]`,o=`[object GeneratorFunction]`,s=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,l=typeof global==`object`&&global&&global.Object===Object&&global,u=typeof self==`object`&&self&&self.Object===Object&&self,d=l||u||Function(`return this`)();function f(e,t){return!!(e&&e.length)&&h(e,t,0)>-1}function p(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}function m(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function h(e,t,n){if(t!==t)return m(e,g,n);for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function g(e){return e!==e}function _(e,t){return e.has(t)}function v(e,t){return e?.[t]}function y(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function b(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var x=Array.prototype,S=Function.prototype,C=Object.prototype,w=d[`__core-js_shared__`],T=function(){var e=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),E=S.toString,D=C.hasOwnProperty,O=C.toString,k=RegExp(`^`+E.call(D).replace(s,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),A=x.splice,ee=fe(d,`Map`),j=fe(d,`Set`),M=fe(Object,`create`);function N(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function P(){this.__data__=M?M(null):{}}function F(e){return this.has(e)&&delete this.__data__[e]}function te(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return D.call(t,e)?t[e]:void 0}function I(e){var t=this.__data__;return M?t[e]!==void 0:D.call(t,e)}function L(e,t){var n=this.__data__;return n[e]=M&&t===void 0?r:t,this}N.prototype.clear=P,N.prototype.delete=F,N.prototype.get=te,N.prototype.has=I,N.prototype.set=L;function ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function R(){this.__data__=[]}function z(e){var t=this.__data__,n=ce(t,e);return n<0?!1:(n==t.length-1?t.pop():A.call(t,n,1),!0)}function re(e){var t=this.__data__,n=ce(t,e);return n<0?void 0:t[n][1]}function B(e){return ce(this.__data__,e)>-1}function V(e,t){var n=this.__data__,r=ce(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}ne.prototype.clear=R,ne.prototype.delete=z,ne.prototype.get=re,ne.prototype.has=B,ne.prototype.set=V;function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function H(){this.__data__={hash:new N,map:new(ee||ne),string:new N}}function U(e){return de(this,e).delete(e)}function ae(e){return de(this,e).get(e)}function W(e){return de(this,e).has(e)}function G(e,t){return de(this,e).set(e,t),this}ie.prototype.clear=H,ie.prototype.delete=U,ie.prototype.get=ae,ie.prototype.has=W,ie.prototype.set=G;function oe(e){var t=-1,n=e?e.length:0;for(this.__data__=new ie;++t<n;)this.add(e[t])}function K(e){return this.__data__.set(e,r),this}function se(e){return this.__data__.has(e)}oe.prototype.add=oe.prototype.push=K,oe.prototype.has=se;function ce(e,t){for(var n=e.length;n--;)if(J(e[n][0],t))return n;return-1}function le(e){return!_e(e)||me(e)?!1:(Y(e)||y(e)?k:c).test(he(e))}function q(e,t,r){var i=-1,a=f,o=e.length,s=!0,c=[],l=c;if(r)s=!1,a=p;else if(o>=n){var u=t?null:ue(e);if(u)return b(u);s=!1,a=_,l=new oe}else l=t?[]:c;outer:for(;++i<o;){var d=e[i],m=t?t(d):d;if(d=r||d!==0?d:0,s&&m===m){for(var h=l.length;h--;)if(l[h]===m)continue outer;t&&l.push(m),c.push(d)}else a(l,m,r)||(l!==c&&l.push(m),c.push(d))}return c}var ue=j&&1/b(new j([,-0]))[1]==i?function(e){return new j(e)}:X;function de(e,t){var n=e.__data__;return pe(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function fe(e,t){var n=v(e,t);return le(n)?n:void 0}function pe(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function me(e){return!!T&&T in e}function he(e){if(e!=null){try{return E.call(e)}catch{}try{return e+``}catch{}}return``}function ge(e){return e&&e.length?q(e):[]}function J(e,t){return e===t||e!==e&&t!==t}function Y(e){var t=_e(e)?O.call(e):``;return t==a||t==o}function _e(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function X(){}t.exports=ge})),vu=c(((e,t)=>{var n=200,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=1,o=2,s=1/0,c=9007199254740991,l=`[object Arguments]`,u=`[object Array]`,d=`[object Boolean]`,f=`[object Date]`,p=`[object Error]`,m=`[object Function]`,h=`[object GeneratorFunction]`,g=`[object Map]`,_=`[object Number]`,v=`[object Object]`,y=`[object Promise]`,b=`[object RegExp]`,x=`[object Set]`,S=`[object String]`,C=`[object Symbol]`,w=`[object WeakMap]`,T=`[object ArrayBuffer]`,E=`[object DataView]`,D=`[object Float32Array]`,O=`[object Float64Array]`,k=`[object Int8Array]`,A=`[object Int16Array]`,ee=`[object Int32Array]`,j=`[object Uint8Array]`,M=`[object Uint8ClampedArray]`,N=`[object Uint16Array]`,P=`[object Uint32Array]`,F=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,I=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,R=/\\(\\)?/g,z=/^\[object .+?Constructor\]$/,re=/^(?:0|[1-9]\d*)$/,B={};B[D]=B[O]=B[k]=B[A]=B[ee]=B[j]=B[M]=B[N]=B[P]=!0,B[l]=B[u]=B[T]=B[d]=B[E]=B[f]=B[p]=B[m]=B[g]=B[_]=B[v]=B[b]=B[x]=B[S]=B[w]=!1;var V=typeof global==`object`&&global&&global.Object===Object&&global,ie=typeof self==`object`&&self&&self.Object===Object&&self,H=V||ie||Function(`return this`)(),U=typeof e==`object`&&e&&!e.nodeType&&e,ae=U&&typeof t==`object`&&t&&!t.nodeType&&t,W=ae&&ae.exports===U&&V.process,G=function(){try{return W&&W.binding(`util`)}catch{}}(),oe=G&&G.isTypedArray;function K(e,t,n,r){for(var i=-1,a=e?e.length:0;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function se(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function ce(e){return function(t){return t?.[e]}}function le(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function q(e){return function(t){return e(t)}}function ue(e,t){return e?.[t]}function de(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function fe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function pe(e,t){return function(n){return e(t(n))}}function me(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var he=Array.prototype,ge=Function.prototype,J=Object.prototype,Y=H[`__core-js_shared__`],_e=function(){var e=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),X=ge.toString,Z=J.hasOwnProperty,ve=J.toString,ye=RegExp(`^`+X.call(Z).replace(ne,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),be=H.Symbol,xe=H.Uint8Array,Se=J.propertyIsEnumerable,Ce=he.splice,we=pe(Object.keys,Object),Te=Bt(H,`DataView`),Ee=Bt(H,`Map`),De=Bt(H,`Promise`),Oe=Bt(H,`Set`),ke=Bt(H,`WeakMap`),Ae=Bt(Object,`create`),je=Qt(Te),Me=Qt(Ee),Ne=Qt(De),Pe=Qt(Oe),Fe=Qt(ke),Ie=be?be.prototype:void 0,Le=Ie?Ie.valueOf:void 0,Q=Ie?Ie.toString:void 0;function Re(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ze(){this.__data__=Ae?Ae(null):{}}function Be(e){return this.has(e)&&delete this.__data__[e]}function Ve(e){var t=this.__data__;if(Ae){var n=t[e];return n===i?void 0:n}return Z.call(t,e)?t[e]:void 0}function He(e){var t=this.__data__;return Ae?t[e]!==void 0:Z.call(t,e)}function Ue(e,t){var n=this.__data__;return n[e]=Ae&&t===void 0?i:t,this}Re.prototype.clear=ze,Re.prototype.delete=Be,Re.prototype.get=Ve,Re.prototype.has=He,Re.prototype.set=Ue;function We(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ge(){this.__data__=[]}function Ke(e){var t=this.__data__,n=ft(t,e);return n<0?!1:(n==t.length-1?t.pop():Ce.call(t,n,1),!0)}function qe(e){var t=this.__data__,n=ft(t,e);return n<0?void 0:t[n][1]}function Je(e){return ft(this.__data__,e)>-1}function Ye(e,t){var n=this.__data__,r=ft(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}We.prototype.clear=Ge,We.prototype.delete=Ke,We.prototype.get=qe,We.prototype.has=Je,We.prototype.set=Ye;function Xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ze(){this.__data__={hash:new Re,map:new(Ee||We),string:new Re}}function Qe(e){return Rt(this,e).delete(e)}function $e(e){return Rt(this,e).get(e)}function et(e){return Rt(this,e).has(e)}function tt(e,t){return Rt(this,e).set(e,t),this}Xe.prototype.clear=Ze,Xe.prototype.delete=Qe,Xe.prototype.get=$e,Xe.prototype.has=et,Xe.prototype.set=tt;function nt(e){var t=-1,n=e?e.length:0;for(this.__data__=new Xe;++t<n;)this.add(e[t])}function rt(e){return this.__data__.set(e,i),this}function it(e){return this.__data__.has(e)}nt.prototype.add=nt.prototype.push=rt,nt.prototype.has=it;function at(e){this.__data__=new We(e)}function ot(){this.__data__=new We}function st(e){return this.__data__.delete(e)}function ct(e){return this.__data__.get(e)}function lt(e){return this.__data__.has(e)}function ut(e,t){var r=this.__data__;if(r instanceof We){var i=r.__data__;if(!Ee||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new Xe(i)}return r.set(e,t),this}at.prototype.clear=ot,at.prototype.delete=st,at.prototype.get=ct,at.prototype.has=lt,at.prototype.set=ut;function dt(e,t){var n=rn(e)||nn(e)?le(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||Z.call(e,a))&&!(i&&(a==`length`||Ut(a,r)))&&n.push(a);return n}function ft(e,t){for(var n=e.length;n--;)if(tn(e[n][0],t))return n;return-1}function pt(e,t,n,r){return mt(e,function(e,i,a){t(r,e,n(e),a)}),r}var mt=Nt(gt),ht=Pt();function gt(e,t){return e&&ht(e,t,gn)}function _t(e,t){t=Wt(t,e)?[t]:jt(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Zt(t[n++])];return n&&n==r?e:void 0}function vt(e){return ve.call(e)}function yt(e,t){return e!=null&&t in Object(e)}function bt(e,t,n,r,i){return e===t?!0:e==null||t==null||!ln(e)&&!un(t)?e!==e&&t!==t:xt(e,t,bt,n,r,i)}function xt(e,t,n,r,i,a){var s=rn(e),c=rn(t),d=u,f=u;s||(d=Vt(e),d=d==l?v:d),c||(f=Vt(t),f=f==l?v:f);var p=d==v&&!de(e),m=f==v&&!de(t),h=d==f;if(h&&!p)return a||=new at,s||fn(e)?Ft(e,t,n,r,i,a):It(e,t,d,n,r,i,a);if(!(i&o)){var g=p&&Z.call(e,`__wrapped__`),_=m&&Z.call(t,`__wrapped__`);if(g||_){var y=g?e.value():e,b=_?t.value():t;return a||=new at,n(y,b,r,i,a)}}return h?(a||=new at,Lt(e,t,n,r,i,a)):!1}function St(e,t,n,r){var i=n.length,s=i,c=!r;if(e==null)return!s;for(e=Object(e);i--;){var l=n[i];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=n[i];var u=l[0],d=e[u],f=l[1];if(c&&l[2]){if(d===void 0&&!(u in e))return!1}else{var p=new at;if(r)var m=r(d,f,u,e,t,p);if(!(m===void 0?bt(f,d,r,a|o,p):m))return!1}}return!0}function Ct(e){return!ln(e)||Kt(e)?!1:(sn(e)||de(e)?ye:z).test(Qt(e))}function wt(e){return un(e)&&cn(e.length)&&!!B[ve.call(e)]}function Tt(e){return typeof e==`function`?e:e==null?_n:typeof e==`object`?rn(e)?Ot(e[0],e[1]):Dt(e):vn(e)}function Et(e){if(!qt(e))return we(e);var t=[];for(var n in Object(e))Z.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Dt(e){var t=zt(e);return t.length==1&&t[0][2]?Yt(t[0][0],t[0][1]):function(n){return n===e||St(n,e,t)}}function Ot(e,t){return Wt(e)&&Jt(t)?Yt(Zt(e),t):function(n){var r=mn(n,e);return r===void 0&&r===t?hn(n,e):bt(t,r,void 0,a|o)}}function kt(e){return function(t){return _t(t,e)}}function At(e){if(typeof e==`string`)return e;if(dn(e))return Q?Q.call(e):``;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function jt(e){return rn(e)?e:Xt(e)}function Mt(e,t){return function(n,r){var i=rn(n)?K:pt,a=t?t():{};return i(n,e,Tt(r,2),a)}}function Nt(e,t){return function(n,r){if(n==null)return n;if(!an(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function Pt(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function Ft(e,t,n,r,i,s){var c=i&o,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=i&a?new nt:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var h=e[f],g=t[f];if(r)var _=c?r(g,h,f,t,e,s):r(h,g,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!se(t,function(e,t){if(!m.has(t)&&(h===e||n(h,e,r,i,s)))return m.add(t)})){p=!1;break}}else if(!(h===g||n(h,g,r,i,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function It(e,t,n,r,i,s,c){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!r(new xe(e),new xe(t)));case d:case f:case _:return tn(+e,+t);case p:return e.name==t.name&&e.message==t.message;case b:case S:return e==t+``;case g:var l=fe;case x:var u=s&o;if(l||=me,e.size!=t.size&&!u)return!1;var m=c.get(e);if(m)return m==t;s|=a,c.set(e,t);var h=Ft(l(e),l(t),r,i,s,c);return c.delete(e),h;case C:if(Le)return Le.call(e)==Le.call(t)}return!1}function Lt(e,t,n,r,i,a){var s=i&o,c=gn(e),l=c.length;if(l!=gn(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Z.call(t,d)))return!1}var f=a.get(e);if(f&&a.get(t))return f==t;var p=!0;a.set(e,t),a.set(t,e);for(var m=s;++u<l;){d=c[u];var h=e[d],g=t[d];if(r)var _=s?r(g,h,d,t,e,a):r(h,g,d,e,t,a);if(!(_===void 0?h===g||n(h,g,r,i,a):_)){p=!1;break}m||=d==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}function Rt(e,t){var n=e.__data__;return Gt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function zt(e){for(var t=gn(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Jt(i)]}return t}function Bt(e,t){var n=ue(e,t);return Ct(n)?n:void 0}var Vt=vt;(Te&&Vt(new Te(new ArrayBuffer(1)))!=E||Ee&&Vt(new Ee)!=g||De&&Vt(De.resolve())!=y||Oe&&Vt(new Oe)!=x||ke&&Vt(new ke)!=w)&&(Vt=function(e){var t=ve.call(e),n=t==v?e.constructor:void 0,r=n?Qt(n):void 0;if(r)switch(r){case je:return E;case Me:return g;case Ne:return y;case Pe:return x;case Fe:return w}return t});function Ht(e,t,n){t=Wt(t,e)?[t]:jt(t);for(var r,i=-1,a=t.length;++i<a;){var o=Zt(t[i]);if(!(r=e!=null&&n(e,o)))break;e=e[o]}if(r)return r;var a=e?e.length:0;return!!a&&cn(a)&&Ut(o,a)&&(rn(e)||nn(e))}function Ut(e,t){return t??=c,!!t&&(typeof e==`number`||re.test(e))&&e>-1&&e%1==0&&e<t}function Wt(e,t){if(rn(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||dn(e)?!0:te.test(e)||!F.test(e)||t!=null&&e in Object(t)}function Gt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Kt(e){return!!_e&&_e in e}function qt(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||J)}function Jt(e){return e===e&&!ln(e)}function Yt(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var Xt=en(function(e){e=pn(e);var t=[];return I.test(e)&&t.push(``),e.replace(L,function(e,n,r,i){t.push(r?i.replace(R,`$1`):n||e)}),t});function Zt(e){if(typeof e==`string`||dn(e))return e;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function Qt(e){if(e!=null){try{return X.call(e)}catch{}try{return e+``}catch{}}return``}var $t=Mt(function(e,t,n){Z.call(e,n)?e[n].push(t):e[n]=[t]});function en(e,t){if(typeof e!=`function`||t&&typeof t!=`function`)throw TypeError(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o),o};return n.cache=new(en.Cache||Xe),n}en.Cache=Xe;function tn(e,t){return e===t||e!==e&&t!==t}function nn(e){return on(e)&&Z.call(e,`callee`)&&(!Se.call(e,`callee`)||ve.call(e)==l)}var rn=Array.isArray;function an(e){return e!=null&&cn(e.length)&&!sn(e)}function on(e){return un(e)&&an(e)}function sn(e){var t=ln(e)?ve.call(e):``;return t==m||t==h}function cn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=c}function ln(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function un(e){return!!e&&typeof e==`object`}function dn(e){return typeof e==`symbol`||un(e)&&ve.call(e)==C}var fn=oe?q(oe):wt;function pn(e){return e==null?``:At(e)}function mn(e,t,n){var r=e==null?void 0:_t(e,t);return r===void 0?n:r}function hn(e,t){return e!=null&&Ht(e,t,yt)}function gn(e){return an(e)?dt(e):Et(e)}function _n(e){return e}function vn(e){return Wt(e)?ce(Zt(e)):kt(e)}t.exports=$t})),yu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});let n=t(gu()),r=t(ru()),i=t(_u()),a=t(vu());e.HeaderTransformer=class{parserOptions;headers=null;receivedHeaders=!1;shouldUseFirstRow=!1;processedFirstRow=!1;headersLength=0;headersTransform;constructor(e){this.parserOptions=e,e.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):(0,r.default)(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){let{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw Error(`Error renaming headers: new headers must be provided in an array`);return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else if(this.shouldUseFirstRow)this.setHeaders(e);else return!0;return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};let{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return t.strictColumnHandling&&e.length<this.headersLength?{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}:{row:this.mapHeaders(e),isValid:!0}}mapHeaders(e){let t={},{headers:r,headersLength:i}=this;for(let a=0;a<i;a+=1){let i=r[a];if(!(0,n.default)(i)){let r=e[a];(0,n.default)(r)?t[i]=``:t[i]=r}}return t}setHeaders(e){let t=e.filter(e=>!!e);if((0,i.default)(t).length!==t.length){let e=(0,a.default)(t),n=Object.keys(e).filter(t=>e[t].length>1);throw Error(`Duplicate headers found ${JSON.stringify(n)}`)}this.headers=e,this.receivedHeaders=!0,this.headersLength=this.headers?.length||0}}})),bu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HeaderTransformer=e.RowTransformerValidator=void 0;var t=hu();Object.defineProperty(e,`RowTransformerValidator`,{enumerable:!0,get:function(){return t.RowTransformerValidator}});var n=yu();Object.defineProperty(e,`HeaderTransformer`,{enumerable:!0,get:function(){return n.HeaderTransformer}})})),xu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Token=class{static isTokenRowDelimiter(e){let t=e.token;return t===`\r`||t===`
|
|
109
|
+
<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:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <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="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`};Object.keys(n).forEach(t=>{let r=n[t],i=`xl/theme/${t}.xml`;e.append(r,{name:i})})}async addOfficeRels(t,n){let r=new Es().toXml([{Id:`rId1`,Type:e.RelType.OfficeDocument,Target:`xl/workbook.xml`},{Id:`rId2`,Type:e.RelType.CoreProperties,Target:`docProps/core.xml`},{Id:`rId3`,Type:e.RelType.ExtenderProperties,Target:`docProps/app.xml`}]);t.append(r,{name:`_rels/.rels`})}async addWorkbookRels(t,n){let r=1,i=[{Id:`rId${r++}`,Type:e.RelType.Styles,Target:`styles.xml`},{Id:`rId${r++}`,Type:e.RelType.Theme,Target:`theme/theme1.xml`}];if(n.sharedStrings.count&&i.push({Id:`rId${r++}`,Type:e.RelType.SharedStrings,Target:`sharedStrings.xml`}),(n.pivotTables||[]).length){let t=n.pivotTables[0];t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.PivotCacheDefinition,Target:`pivotCache/pivotCacheDefinition1.xml`})}n.worksheets.forEach(t=>{t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:`worksheets/sheet${t.id}.xml`})});let a=new Es().toXml(i);t.append(a,{name:`xl/_rels/workbook.xml.rels`})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:`xl/sharedStrings.xml`})}async addStyles(e,t){let{xml:n}=t.styles;n&&e.append(n,{name:`xl/styles.xml`})}async addWorkbook(e,t){let n=new zs;e.append(n.toXml(t),{name:`xl/workbook.xml`})}async addWorksheets(e,t){let n=new dl,r=new Es,i=new Ul,a=new Zl;t.worksheets.forEach(t=>{let o=new Io;n.render(o,t),e.append(o.xml,{name:`xl/worksheets/sheet${t.id}.xml`}),t.rels&&t.rels.length&&(o=new Io,r.render(o,t.rels),e.append(o.xml,{name:`xl/worksheets/_rels/sheet${t.id}.xml.rels`})),t.comments.length>0&&(o=new Io,i.render(o,t),e.append(o.xml,{name:`xl/comments${t.id}.xml`}),o=new Io,a.render(o,t),e.append(o.xml,{name:`xl/drawings/vmlDrawing${t.id}.vml`}))})}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if(t.type===`image`){let n=`xl/media/${t.name}.${t.extension}`;if(t.filename){let r=await eu(t.filename);return e.append(r,{name:n})}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64,i=r.substring(r.indexOf(`,`)+1);return e.append(i,{name:n,base64:!0})}}throw Error(`Unsupported media`)}))}addDrawings(e,t){let n=new Ol,r=new Es;t.worksheets.forEach(t=>{let{drawing:i}=t;if(i){n.prepare(i);let t=n.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=r.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}})}addTables(e,t){let n=new Fl;t.worksheets.forEach(t=>{let{tables:r}=t;r.forEach(t=>{n.prepare(t,{});let r=n.toXml(t);e.append(r,{name:`xl/tables/${t.target}`})})})}addPivotTables(t,n){if(!n.pivotTables.length)return;let r=n.pivotTables[0],i=new Il,a=new Rl,o=new zl,s=new Es,c=i.toXml(r);t.append(c,{name:`xl/pivotCache/pivotCacheRecords1.xml`}),c=a.toXml(r),t.append(c,{name:`xl/pivotCache/pivotCacheDefinition1.xml`}),c=s.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheRecords,Target:`pivotCacheRecords1.xml`}]),t.append(c,{name:`xl/pivotCache/_rels/pivotCacheDefinition1.xml.rels`}),c=o.toXml(r),t.append(c,{name:`xl/pivotTables/pivotTable1.xml`}),c=s.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheDefinition,Target:`../pivotCache/pivotCacheDefinition1.xml`}]),t.append(c,{name:`xl/pivotTables/_rels/pivotTable1.xml.rels`})}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator||`ExcelTS`,e.lastModifiedBy=e.lastModifiedBy||`ExcelTS`,e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=t.useSharedStrings===void 0?!0:t.useSharedStrings,e.useStyles=t.useStyles===void 0?!0:t.useStyles,e.sharedStrings=new ws,e.styles=e.useStyles?new _s(!0):new _s.Mock;let n=new zs,r=new dl;n.prepare(e);let i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{a++,t.target=`table${a}.xml`,t.id=a,e.tables.push(t)}),r.prepare(t,i)})}async write(e,t){t||={};let{model:n}=this.workbook,r=new No(t.zip);return r.pipe(e),this.prepareModel(n,t),await this.addContentTypes(r,n),await this.addOfficeRels(r,n),await this.addWorkbookRels(r,n),await this.addWorksheets(r,n),await this.addSharedStrings(r,n),this.addDrawings(r,n),this.addTables(r,n),this.addPivotTables(r,n),await Promise.all([this.addThemes(r,n),this.addStyles(r,n)]),await this.addMedia(r,n),await Promise.all([this.addApp(r,n),this.addCore(r,n)]),await this.addWorkbook(r,n),this._finalize(r)}writeFile(e,t){let n=qi.createWriteStream(e);return new Promise((e,r)=>{let i=()=>{n.removeListener(`finish`,a),n.removeListener(`error`,o)},a=()=>{i(),e()},o=e=>{i(),r(e)};n.once(`finish`,a),n.on(`error`,o),this.write(n,t).then(()=>{n.end()}).catch(e=>{i(),r(e)})})}async writeBuffer(e){let t=new Do;return await this.write(t,e),t.read()}static{this.RelType=Bs}},nu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FormatterOptions=void 0,e.FormatterOptions=class{objectMode=!0;delimiter=`,`;rowDelimiter=`
|
|
110
|
+
`;quote=`"`;escape=this.quote;quoteColumns=!1;quoteHeaders=this.quoteColumns;headers=null;includeEndRowDelimiter=!1;transform;shouldWriteHeaders;writeBOM=!1;escapedQuote;BOM=``;alwaysWriteHeaders=!1;constructor(e={}){Object.assign(this,e||{}),e?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),e?.quote===!0?this.quote=`"`:e?.quote===!1&&(this.quote=``),typeof e?.escape!=`string`&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&(e.writeHeaders??!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}})),ru=c(((e,t)=>{var n=`[object AsyncFunction]`,r=`[object Function]`,i=`[object GeneratorFunction]`,a=`[object Null]`,o=`[object Proxy]`,s=`[object Undefined]`,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype,f=d.hasOwnProperty,p=d.toString,m=u.Symbol,h=m?m.toStringTag:void 0;function g(e){return e==null?e===void 0?s:a:h&&h in Object(e)?_(e):v(e)}function _(e){var t=f.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch{}var i=p.call(e);return r&&(t?e[h]=n:delete e[h]),i}function v(e){return p.call(e)}function y(e){if(!b(e))return!1;var t=g(e);return t==r||t==i||t==n||t==o}function b(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=y})),iu=c(((e,t)=>{var n=`[object Boolean]`,r=Object.prototype.toString;function i(e){return e===!0||e===!1||a(e)&&r.call(e)==n}function a(e){return!!e&&typeof e==`object`}t.exports=i})),au=c(((e,t)=>{function n(e){return e==null}t.exports=n})),ou=c(((e,t)=>{var n=1/0,r=`[object Symbol]`,i=/[\\^$.*+?()[\]{}|]/g,a=RegExp(i.source),o=typeof global==`object`&&global&&global.Object===Object&&global,s=typeof self==`object`&&self&&self.Object===Object&&self,c=o||s||Function(`return this`)(),l=Object.prototype.toString,u=c.Symbol,d=u?u.prototype:void 0,f=d?d.toString:void 0;function p(e){if(typeof e==`string`)return e;if(h(e))return f?f.call(e):``;var t=e+``;return t==`0`&&1/e==-n?`-0`:t}function m(e){return!!e&&typeof e==`object`}function h(e){return typeof e==`symbol`||m(e)&&l.call(e)==r}function g(e){return e==null?``:p(e)}function _(e){return e=g(e),e&&a.test(e)?e.replace(i,`\\$&`):e}t.exports=_})),su=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.FieldFormatter=void 0;let n=t(iu()),r=t(au()),i=t(ou());e.FieldFormatter=class{formatterOptions;_headers=null;REPLACE_REGEXP;ESCAPE_REGEXP;constructor(e){this.formatterOptions=e,e.headers!==null&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,`g`);let t=`[${e.delimiter}${(0,i.default)(e.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){let r=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return(0,n.default)(r)?r:Array.isArray(r)?r[e]:this._headers===null?!1:r[this._headers[e]]}format(e,t,n){let i=`${(0,r.default)(e)?``:e}`.replace(/\0/g,``),{formatterOptions:a}=this;return a.quote!==``&&i.indexOf(a.quote)!==-1?this.quoteField(i.replace(this.REPLACE_REGEXP,a.escapedQuote)):i.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(t,n)?this.quoteField(i):i}quoteField(e){let{quote:t}=this.formatterOptions;return`${t}${e}${t}`}}})),cu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSyncTransform=void 0,e.isSyncTransform=e=>e.length===1})),lu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.RowFormatter=void 0;let n=t(ru()),r=su(),i=cu();e.RowFormatter=class e{static isRowHashArray(e){return Array.isArray(e)?Array.isArray(e[0])&&e[0].length===2:!1}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(t){return e.isRowHashArray(t)?t.map(e=>e[0]):Array.isArray(t)?t:Object.keys(t)}static createTransform(e){return(0,i.isSyncTransform)(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:(t,n)=>{e(t,n)}}formatterOptions;fieldFormatter;shouldWriteHeaders;_rowTransform;headers;hasWrittenHeaders;rowCount=0;constructor(e){this.formatterOptions=e,this.fieldFormatter=new r.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}set rowTransform(t){if(!(0,n.default)(t))throw TypeError(`The transform should be a function`);this._rowTransform=e.createTransform(t)}format(e,t){this.callTransformer(e,(n,r)=>{if(n)return t(n);if(!e)return t(null);let i=[];if(r){let{shouldFormatColumns:e,headers:t}=this.checkHeaders(r);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){let e=this.gatherColumns(r);i.push(this.formatColumns(e,!1))}}return t(null,i)})}finish(e){let t=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return e(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(t){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let n=e.gatherHeaders(t);return this.headers=n,this.fieldFormatter.headers=n,this.shouldWriteHeaders?Array.isArray(t)&&n.every((e,n)=>e===t[n])?{shouldFormatColumns:!1,headers:n}:{shouldFormatColumns:!0,headers:n}:{shouldFormatColumns:!0,headers:null}}gatherColumns(t){if(this.headers===null)throw Error(`Headers is currently null`);return Array.isArray(t)?e.isRowHashArray(t)?this.headers.map((e,n)=>{let r=t[n];return r?r[1]:``}):e.isRowArray(t)&&!this.shouldWriteHeaders?t:this.headers.map((e,n)=>t[n]):this.headers.map(e=>t[e])}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){let n=e.map((e,n)=>this.fieldFormatter.format(e,n,t)).join(this.formatterOptions.delimiter),{rowCount:r}=this;return this.rowCount+=1,r?[this.formatterOptions.rowDelimiter,n].join(``):n}}})),uu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FieldFormatter=e.RowFormatter=void 0;var t=lu();Object.defineProperty(e,`RowFormatter`,{enumerable:!0,get:function(){return t.RowFormatter}});var n=su();Object.defineProperty(e,`FieldFormatter`,{enumerable:!0,get:function(){return n.FieldFormatter}})})),du=c((e=>{var t=d(q());Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvFormatterStream=void 0;let n=sn(),r=uu();e.CsvFormatterStream=class extends n.Transform{formatterOptions;rowFormatter;hasWrittenBOM=!1;constructor(e){super({writableObjectMode:e.objectMode}),this.formatterOptions=e,this.rowFormatter=new r.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,n,r){let i=!1;try{this.hasWrittenBOM||=(this.push(this.formatterOptions.BOM),!0),this.rowFormatter.format(e,(e,n)=>e?(i=!0,r(e)):(n&&n.forEach(e=>{this.push(t.Buffer.from(e,`utf8`))}),i=!0,r()))}catch(e){if(i)throw e;r(e)}}_flush(e){this.rowFormatter.finish((n,r)=>n?e(n):(r&&r.forEach(e=>{this.push(t.Buffer.from(e,`utf8`))}),e()))}}})),fu=c((e=>{var t=d(q()),n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},a=e&&e.__exportStar||function(e,t){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=e.FormatterOptions=e.CsvFormatterStream=void 0;let o=Wt(),s=sn(),c=i((Ji(),f(Ki))),l=nu(),u=du();a(cu(),e);var p=du();Object.defineProperty(e,`CsvFormatterStream`,{enumerable:!0,get:function(){return p.CsvFormatterStream}});var m=nu();Object.defineProperty(e,`FormatterOptions`,{enumerable:!0,get:function(){return m.FormatterOptions}}),e.format=e=>new u.CsvFormatterStream(new l.FormatterOptions(e)),e.write=(t,n)=>{let r=(0,e.format)(n),i=(0,o.promisify)((e,t)=>{r.write(e,void 0,t)});return t.reduce((e,t)=>e.then(()=>i(t)),Promise.resolve()).then(()=>{r.end()}).catch(e=>{r.emit(`error`,e)}),r},e.writeToStream=(t,n,r)=>(0,e.write)(n,r).pipe(t),e.writeToBuffer=(n,r={})=>{let i=[],a=new s.Writable({write(e,t,n){i.push(e),n()}});return new Promise((o,s)=>{a.on(`error`,s).on(`finish`,()=>o(t.Buffer.concat(i))),(0,e.write)(n,r).pipe(a)})},e.writeToString=(t,n)=>(0,e.writeToBuffer)(t,n).then(e=>e.toString()),e.writeToPath=(t,n,r)=>{let i=c.createWriteStream(t,{encoding:`utf8`});return(0,e.write)(n,r).pipe(i)}})),pu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ParserOptions=void 0;let n=t(ou()),r=t(au());e.ParserOptions=class{escapedDelimiter;objectMode=!0;delimiter=`,`;ignoreEmpty=!1;quote=`"`;escape=null;escapeChar=this.quote;comment=null;supportsComments=!1;ltrim=!1;rtrim=!1;trim=!1;headers=null;renameHeaders=!1;strictColumnHandling=!1;discardUnmappedColumns=!1;carriageReturn=`\r`;NEXT_TOKEN_REGEXP;encoding=`utf8`;limitRows=!1;maxRows=0;skipLines=0;skipRows=0;constructor(e){if(Object.assign(this,e||{}),this.delimiter.length>1)throw Error(`delimiter option must be one character long`);this.escapedDelimiter=(0,n.default)(this.delimiter),this.escapeChar=this.escape??this.quote,this.supportsComments=!(0,r.default)(this.comment),this.NEXT_TOKEN_REGEXP=RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}})),mu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSyncValidate=e.isSyncTransform=void 0,e.isSyncTransform=e=>e.length===1,e.isSyncValidate=e=>e.length===1})),hu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.RowTransformerValidator=void 0;let n=t(ru()),r=mu();e.RowTransformerValidator=class e{static createTransform(e){return(0,r.isSyncTransform)(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:e}static createValidator(e){return(0,r.isSyncValidate)(e)?(t,n)=>{n(null,{row:t,isValid:e(t)})}:(t,n)=>{e(t,(e,r,i)=>e?n(e):r?n(null,{row:t,isValid:r,reason:i}):n(null,{row:t,isValid:!1,reason:i}))}}_rowTransform=null;_rowValidator=null;set rowTransform(t){if(!(0,n.default)(t))throw TypeError(`The transform should be a function`);this._rowTransform=e.createTransform(t)}set rowValidator(t){if(!(0,n.default)(t))throw TypeError(`The validate should be a function`);this._rowValidator=e.createValidator(t)}transformAndValidate(e,t){return this.callTransformer(e,(e,n)=>e?t(e):n?this.callValidator(n,(e,r)=>e?t(e):r&&!r.isValid?t(null,{row:n,isValid:!1,reason:r.reason}):t(null,{row:n,isValid:!0})):t(null,{row:null,isValid:!0}))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}})),gu=c(((e,t)=>{function n(e){return e===void 0}t.exports=n})),_u=c(((e,t)=>{var n=200,r=`__lodash_hash_undefined__`,i=1/0,a=`[object Function]`,o=`[object GeneratorFunction]`,s=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,l=typeof global==`object`&&global&&global.Object===Object&&global,u=typeof self==`object`&&self&&self.Object===Object&&self,d=l||u||Function(`return this`)();function f(e,t){return!!(e&&e.length)&&h(e,t,0)>-1}function p(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}function m(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function h(e,t,n){if(t!==t)return m(e,g,n);for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function g(e){return e!==e}function _(e,t){return e.has(t)}function v(e,t){return e?.[t]}function y(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function b(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var x=Array.prototype,S=Function.prototype,C=Object.prototype,w=d[`__core-js_shared__`],T=function(){var e=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),E=S.toString,D=C.hasOwnProperty,O=C.toString,k=RegExp(`^`+E.call(D).replace(s,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),A=x.splice,ee=fe(d,`Map`),j=fe(d,`Set`),M=fe(Object,`create`);function N(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function P(){this.__data__=M?M(null):{}}function F(e){return this.has(e)&&delete this.__data__[e]}function te(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return D.call(t,e)?t[e]:void 0}function I(e){var t=this.__data__;return M?t[e]!==void 0:D.call(t,e)}function L(e,t){var n=this.__data__;return n[e]=M&&t===void 0?r:t,this}N.prototype.clear=P,N.prototype.delete=F,N.prototype.get=te,N.prototype.has=I,N.prototype.set=L;function ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function R(){this.__data__=[]}function z(e){var t=this.__data__,n=ce(t,e);return n<0?!1:(n==t.length-1?t.pop():A.call(t,n,1),!0)}function re(e){var t=this.__data__,n=ce(t,e);return n<0?void 0:t[n][1]}function B(e){return ce(this.__data__,e)>-1}function V(e,t){var n=this.__data__,r=ce(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}ne.prototype.clear=R,ne.prototype.delete=z,ne.prototype.get=re,ne.prototype.has=B,ne.prototype.set=V;function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function H(){this.__data__={hash:new N,map:new(ee||ne),string:new N}}function U(e){return de(this,e).delete(e)}function ae(e){return de(this,e).get(e)}function W(e){return de(this,e).has(e)}function G(e,t){return de(this,e).set(e,t),this}ie.prototype.clear=H,ie.prototype.delete=U,ie.prototype.get=ae,ie.prototype.has=W,ie.prototype.set=G;function oe(e){var t=-1,n=e?e.length:0;for(this.__data__=new ie;++t<n;)this.add(e[t])}function K(e){return this.__data__.set(e,r),this}function se(e){return this.__data__.has(e)}oe.prototype.add=oe.prototype.push=K,oe.prototype.has=se;function ce(e,t){for(var n=e.length;n--;)if(J(e[n][0],t))return n;return-1}function le(e){return!_e(e)||me(e)?!1:(Y(e)||y(e)?k:c).test(he(e))}function q(e,t,r){var i=-1,a=f,o=e.length,s=!0,c=[],l=c;if(r)s=!1,a=p;else if(o>=n){var u=t?null:ue(e);if(u)return b(u);s=!1,a=_,l=new oe}else l=t?[]:c;outer:for(;++i<o;){var d=e[i],m=t?t(d):d;if(d=r||d!==0?d:0,s&&m===m){for(var h=l.length;h--;)if(l[h]===m)continue outer;t&&l.push(m),c.push(d)}else a(l,m,r)||(l!==c&&l.push(m),c.push(d))}return c}var ue=j&&1/b(new j([,-0]))[1]==i?function(e){return new j(e)}:X;function de(e,t){var n=e.__data__;return pe(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function fe(e,t){var n=v(e,t);return le(n)?n:void 0}function pe(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function me(e){return!!T&&T in e}function he(e){if(e!=null){try{return E.call(e)}catch{}try{return e+``}catch{}}return``}function ge(e){return e&&e.length?q(e):[]}function J(e,t){return e===t||e!==e&&t!==t}function Y(e){var t=_e(e)?O.call(e):``;return t==a||t==o}function _e(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function X(){}t.exports=ge})),vu=c(((e,t)=>{var n=200,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=1,o=2,s=1/0,c=9007199254740991,l=`[object Arguments]`,u=`[object Array]`,d=`[object Boolean]`,f=`[object Date]`,p=`[object Error]`,m=`[object Function]`,h=`[object GeneratorFunction]`,g=`[object Map]`,_=`[object Number]`,v=`[object Object]`,y=`[object Promise]`,b=`[object RegExp]`,x=`[object Set]`,S=`[object String]`,C=`[object Symbol]`,w=`[object WeakMap]`,T=`[object ArrayBuffer]`,E=`[object DataView]`,D=`[object Float32Array]`,O=`[object Float64Array]`,k=`[object Int8Array]`,A=`[object Int16Array]`,ee=`[object Int32Array]`,j=`[object Uint8Array]`,M=`[object Uint8ClampedArray]`,N=`[object Uint16Array]`,P=`[object Uint32Array]`,F=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,I=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,R=/\\(\\)?/g,z=/^\[object .+?Constructor\]$/,re=/^(?:0|[1-9]\d*)$/,B={};B[D]=B[O]=B[k]=B[A]=B[ee]=B[j]=B[M]=B[N]=B[P]=!0,B[l]=B[u]=B[T]=B[d]=B[E]=B[f]=B[p]=B[m]=B[g]=B[_]=B[v]=B[b]=B[x]=B[S]=B[w]=!1;var V=typeof global==`object`&&global&&global.Object===Object&&global,ie=typeof self==`object`&&self&&self.Object===Object&&self,H=V||ie||Function(`return this`)(),U=typeof e==`object`&&e&&!e.nodeType&&e,ae=U&&typeof t==`object`&&t&&!t.nodeType&&t,W=ae&&ae.exports===U&&V.process,G=function(){try{return W&&W.binding(`util`)}catch{}}(),oe=G&&G.isTypedArray;function K(e,t,n,r){for(var i=-1,a=e?e.length:0;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function se(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function ce(e){return function(t){return t?.[e]}}function le(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function q(e){return function(t){return e(t)}}function ue(e,t){return e?.[t]}function de(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function fe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function pe(e,t){return function(n){return e(t(n))}}function me(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var he=Array.prototype,ge=Function.prototype,J=Object.prototype,Y=H[`__core-js_shared__`],_e=function(){var e=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),X=ge.toString,Z=J.hasOwnProperty,ve=J.toString,ye=RegExp(`^`+X.call(Z).replace(ne,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),be=H.Symbol,xe=H.Uint8Array,Se=J.propertyIsEnumerable,Ce=he.splice,we=pe(Object.keys,Object),Te=Bt(H,`DataView`),Ee=Bt(H,`Map`),De=Bt(H,`Promise`),Oe=Bt(H,`Set`),ke=Bt(H,`WeakMap`),Ae=Bt(Object,`create`),je=Qt(Te),Me=Qt(Ee),Ne=Qt(De),Pe=Qt(Oe),Fe=Qt(ke),Ie=be?be.prototype:void 0,Le=Ie?Ie.valueOf:void 0,Q=Ie?Ie.toString:void 0;function Re(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ze(){this.__data__=Ae?Ae(null):{}}function Be(e){return this.has(e)&&delete this.__data__[e]}function Ve(e){var t=this.__data__;if(Ae){var n=t[e];return n===i?void 0:n}return Z.call(t,e)?t[e]:void 0}function He(e){var t=this.__data__;return Ae?t[e]!==void 0:Z.call(t,e)}function Ue(e,t){var n=this.__data__;return n[e]=Ae&&t===void 0?i:t,this}Re.prototype.clear=ze,Re.prototype.delete=Be,Re.prototype.get=Ve,Re.prototype.has=He,Re.prototype.set=Ue;function We(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ge(){this.__data__=[]}function Ke(e){var t=this.__data__,n=ft(t,e);return n<0?!1:(n==t.length-1?t.pop():Ce.call(t,n,1),!0)}function qe(e){var t=this.__data__,n=ft(t,e);return n<0?void 0:t[n][1]}function Je(e){return ft(this.__data__,e)>-1}function Ye(e,t){var n=this.__data__,r=ft(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}We.prototype.clear=Ge,We.prototype.delete=Ke,We.prototype.get=qe,We.prototype.has=Je,We.prototype.set=Ye;function Xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ze(){this.__data__={hash:new Re,map:new(Ee||We),string:new Re}}function Qe(e){return Rt(this,e).delete(e)}function $e(e){return Rt(this,e).get(e)}function et(e){return Rt(this,e).has(e)}function tt(e,t){return Rt(this,e).set(e,t),this}Xe.prototype.clear=Ze,Xe.prototype.delete=Qe,Xe.prototype.get=$e,Xe.prototype.has=et,Xe.prototype.set=tt;function nt(e){var t=-1,n=e?e.length:0;for(this.__data__=new Xe;++t<n;)this.add(e[t])}function rt(e){return this.__data__.set(e,i),this}function it(e){return this.__data__.has(e)}nt.prototype.add=nt.prototype.push=rt,nt.prototype.has=it;function at(e){this.__data__=new We(e)}function ot(){this.__data__=new We}function st(e){return this.__data__.delete(e)}function ct(e){return this.__data__.get(e)}function lt(e){return this.__data__.has(e)}function ut(e,t){var r=this.__data__;if(r instanceof We){var i=r.__data__;if(!Ee||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new Xe(i)}return r.set(e,t),this}at.prototype.clear=ot,at.prototype.delete=st,at.prototype.get=ct,at.prototype.has=lt,at.prototype.set=ut;function dt(e,t){var n=rn(e)||nn(e)?le(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||Z.call(e,a))&&!(i&&(a==`length`||Ut(a,r)))&&n.push(a);return n}function ft(e,t){for(var n=e.length;n--;)if(tn(e[n][0],t))return n;return-1}function pt(e,t,n,r){return mt(e,function(e,i,a){t(r,e,n(e),a)}),r}var mt=Nt(gt),ht=Pt();function gt(e,t){return e&&ht(e,t,gn)}function _t(e,t){t=Wt(t,e)?[t]:jt(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Zt(t[n++])];return n&&n==r?e:void 0}function vt(e){return ve.call(e)}function yt(e,t){return e!=null&&t in Object(e)}function bt(e,t,n,r,i){return e===t?!0:e==null||t==null||!ln(e)&&!un(t)?e!==e&&t!==t:xt(e,t,bt,n,r,i)}function xt(e,t,n,r,i,a){var s=rn(e),c=rn(t),d=u,f=u;s||(d=Vt(e),d=d==l?v:d),c||(f=Vt(t),f=f==l?v:f);var p=d==v&&!de(e),m=f==v&&!de(t),h=d==f;if(h&&!p)return a||=new at,s||fn(e)?Ft(e,t,n,r,i,a):It(e,t,d,n,r,i,a);if(!(i&o)){var g=p&&Z.call(e,`__wrapped__`),_=m&&Z.call(t,`__wrapped__`);if(g||_){var y=g?e.value():e,b=_?t.value():t;return a||=new at,n(y,b,r,i,a)}}return h?(a||=new at,Lt(e,t,n,r,i,a)):!1}function St(e,t,n,r){var i=n.length,s=i,c=!r;if(e==null)return!s;for(e=Object(e);i--;){var l=n[i];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=n[i];var u=l[0],d=e[u],f=l[1];if(c&&l[2]){if(d===void 0&&!(u in e))return!1}else{var p=new at;if(r)var m=r(d,f,u,e,t,p);if(!(m===void 0?bt(f,d,r,a|o,p):m))return!1}}return!0}function Ct(e){return!ln(e)||Kt(e)?!1:(sn(e)||de(e)?ye:z).test(Qt(e))}function wt(e){return un(e)&&cn(e.length)&&!!B[ve.call(e)]}function Tt(e){return typeof e==`function`?e:e==null?_n:typeof e==`object`?rn(e)?Ot(e[0],e[1]):Dt(e):vn(e)}function Et(e){if(!qt(e))return we(e);var t=[];for(var n in Object(e))Z.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Dt(e){var t=zt(e);return t.length==1&&t[0][2]?Yt(t[0][0],t[0][1]):function(n){return n===e||St(n,e,t)}}function Ot(e,t){return Wt(e)&&Jt(t)?Yt(Zt(e),t):function(n){var r=mn(n,e);return r===void 0&&r===t?hn(n,e):bt(t,r,void 0,a|o)}}function kt(e){return function(t){return _t(t,e)}}function At(e){if(typeof e==`string`)return e;if(dn(e))return Q?Q.call(e):``;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function jt(e){return rn(e)?e:Xt(e)}function Mt(e,t){return function(n,r){var i=rn(n)?K:pt,a=t?t():{};return i(n,e,Tt(r,2),a)}}function Nt(e,t){return function(n,r){if(n==null)return n;if(!an(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function Pt(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function Ft(e,t,n,r,i,s){var c=i&o,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=i&a?new nt:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var h=e[f],g=t[f];if(r)var _=c?r(g,h,f,t,e,s):r(h,g,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!se(t,function(e,t){if(!m.has(t)&&(h===e||n(h,e,r,i,s)))return m.add(t)})){p=!1;break}}else if(!(h===g||n(h,g,r,i,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function It(e,t,n,r,i,s,c){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!r(new xe(e),new xe(t)));case d:case f:case _:return tn(+e,+t);case p:return e.name==t.name&&e.message==t.message;case b:case S:return e==t+``;case g:var l=fe;case x:var u=s&o;if(l||=me,e.size!=t.size&&!u)return!1;var m=c.get(e);if(m)return m==t;s|=a,c.set(e,t);var h=Ft(l(e),l(t),r,i,s,c);return c.delete(e),h;case C:if(Le)return Le.call(e)==Le.call(t)}return!1}function Lt(e,t,n,r,i,a){var s=i&o,c=gn(e),l=c.length;if(l!=gn(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Z.call(t,d)))return!1}var f=a.get(e);if(f&&a.get(t))return f==t;var p=!0;a.set(e,t),a.set(t,e);for(var m=s;++u<l;){d=c[u];var h=e[d],g=t[d];if(r)var _=s?r(g,h,d,t,e,a):r(h,g,d,e,t,a);if(!(_===void 0?h===g||n(h,g,r,i,a):_)){p=!1;break}m||=d==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}function Rt(e,t){var n=e.__data__;return Gt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function zt(e){for(var t=gn(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Jt(i)]}return t}function Bt(e,t){var n=ue(e,t);return Ct(n)?n:void 0}var Vt=vt;(Te&&Vt(new Te(new ArrayBuffer(1)))!=E||Ee&&Vt(new Ee)!=g||De&&Vt(De.resolve())!=y||Oe&&Vt(new Oe)!=x||ke&&Vt(new ke)!=w)&&(Vt=function(e){var t=ve.call(e),n=t==v?e.constructor:void 0,r=n?Qt(n):void 0;if(r)switch(r){case je:return E;case Me:return g;case Ne:return y;case Pe:return x;case Fe:return w}return t});function Ht(e,t,n){t=Wt(t,e)?[t]:jt(t);for(var r,i=-1,a=t.length;++i<a;){var o=Zt(t[i]);if(!(r=e!=null&&n(e,o)))break;e=e[o]}if(r)return r;var a=e?e.length:0;return!!a&&cn(a)&&Ut(o,a)&&(rn(e)||nn(e))}function Ut(e,t){return t??=c,!!t&&(typeof e==`number`||re.test(e))&&e>-1&&e%1==0&&e<t}function Wt(e,t){if(rn(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||dn(e)?!0:te.test(e)||!F.test(e)||t!=null&&e in Object(t)}function Gt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Kt(e){return!!_e&&_e in e}function qt(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||J)}function Jt(e){return e===e&&!ln(e)}function Yt(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var Xt=en(function(e){e=pn(e);var t=[];return I.test(e)&&t.push(``),e.replace(L,function(e,n,r,i){t.push(r?i.replace(R,`$1`):n||e)}),t});function Zt(e){if(typeof e==`string`||dn(e))return e;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function Qt(e){if(e!=null){try{return X.call(e)}catch{}try{return e+``}catch{}}return``}var $t=Mt(function(e,t,n){Z.call(e,n)?e[n].push(t):e[n]=[t]});function en(e,t){if(typeof e!=`function`||t&&typeof t!=`function`)throw TypeError(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o),o};return n.cache=new(en.Cache||Xe),n}en.Cache=Xe;function tn(e,t){return e===t||e!==e&&t!==t}function nn(e){return on(e)&&Z.call(e,`callee`)&&(!Se.call(e,`callee`)||ve.call(e)==l)}var rn=Array.isArray;function an(e){return e!=null&&cn(e.length)&&!sn(e)}function on(e){return un(e)&&an(e)}function sn(e){var t=ln(e)?ve.call(e):``;return t==m||t==h}function cn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=c}function ln(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function un(e){return!!e&&typeof e==`object`}function dn(e){return typeof e==`symbol`||un(e)&&ve.call(e)==C}var fn=oe?q(oe):wt;function pn(e){return e==null?``:At(e)}function mn(e,t,n){var r=e==null?void 0:_t(e,t);return r===void 0?n:r}function hn(e,t){return e!=null&&Ht(e,t,yt)}function gn(e){return an(e)?dt(e):Et(e)}function _n(e){return e}function vn(e){return Wt(e)?ce(Zt(e)):kt(e)}t.exports=$t})),yu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.HeaderTransformer=void 0;let n=t(gu()),r=t(ru()),i=t(_u()),a=t(vu());e.HeaderTransformer=class{parserOptions;headers=null;receivedHeaders=!1;shouldUseFirstRow=!1;processedFirstRow=!1;headersLength=0;headersTransform;constructor(e){this.parserOptions=e,e.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):(0,r.default)(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){let{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw Error(`Error renaming headers: new headers must be provided in an array`);return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else if(this.shouldUseFirstRow)this.setHeaders(e);else return!0;return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};let{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return t.strictColumnHandling&&e.length<this.headersLength?{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}:{row:this.mapHeaders(e),isValid:!0}}mapHeaders(e){let t={},{headers:r,headersLength:i}=this;for(let a=0;a<i;a+=1){let i=r[a];if(!(0,n.default)(i)){let r=e[a];(0,n.default)(r)?t[i]=``:t[i]=r}}return t}setHeaders(e){let t=e.filter(e=>!!e);if((0,i.default)(t).length!==t.length){let e=(0,a.default)(t),n=Object.keys(e).filter(t=>e[t].length>1);throw Error(`Duplicate headers found ${JSON.stringify(n)}`)}this.headers=e,this.receivedHeaders=!0,this.headersLength=this.headers?.length||0}}})),bu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HeaderTransformer=e.RowTransformerValidator=void 0;var t=hu();Object.defineProperty(e,`RowTransformerValidator`,{enumerable:!0,get:function(){return t.RowTransformerValidator}});var n=yu();Object.defineProperty(e,`HeaderTransformer`,{enumerable:!0,get:function(){return n.HeaderTransformer}})})),xu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Token=void 0,e.Token=class{static isTokenRowDelimiter(e){let t=e.token;return t===`\r`||t===`
|
|
111
111
|
`||t===`\r
|
|
112
|
-
`}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}token;startCursor;endCursor;constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}}})),Su=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=xu(),n=/((?:\r\n)|\n|\r)/;e.Scanner=class{line;parserOptions;lineLength;hasMoreData;cursor=0;constructor(e){this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:e}=this,n=this.parserOptions.NEXT_TOKEN_REGEXP;if(e.search(n)===-1)return null;let r=n.exec(e);if(r==null)return null;let i=r[1],a=this.cursor+(r.index||0);return new t.Token({token:i,startCursor:a,endCursor:a+i.length-1})}get nextCharacterToken(){let{cursor:e,lineLength:n}=this;return n<=e?null:new t.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let e=n.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}})),Cu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnFormatter=class{format;constructor(e){e.trim?this.format=e=>e.trim():e.ltrim?this.format=e=>e.trimLeft():e.rtrim?this.format=e=>e.trimRight():this.format=e=>e}}})),wu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Cu(),n=xu();e.NonQuotedColumnParser=class{parserOptions;columnFormatter;constructor(e){this.parserOptions=e,this.columnFormatter=new t.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let{parserOptions:t}=this,r=[],i=e.nextCharacterToken;for(;i&&!(n.Token.isTokenDelimiter(i,t)||n.Token.isTokenRowDelimiter(i));i=e.nextCharacterToken)r.push(i.token),e.advancePastToken(i);return this.columnFormatter.format(r.join(``))}}})),Tu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Cu(),n=xu();e.QuotedColumnParser=class{parserOptions;columnFormatter;constructor(e){this.parserOptions=e,this.columnFormatter=new t.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let t=e.cursor,{foundClosingQuote:n,col:r}=this.gatherDataBetweenQuotes(e);if(!n){if(e.advanceTo(t),!e.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||``}' in line: at '${e.lineFromCursor.replace(/[\r\n]/g,`\\n'`)}'`);return null}return this.checkForMalformedColumn(e),r}gatherDataBetweenQuotes(e){let{parserOptions:t}=this,r=!1,i=!1,a=[],o=e.nextCharacterToken;for(;!i&&o!==null;o=e.nextCharacterToken){let s=n.Token.isTokenQuote(o,t);if(!r&&s)r=!0;else if(r)if(n.Token.isTokenEscapeCharacter(o,t)){e.advancePastToken(o);let r=e.nextCharacterToken;r!==null&&(n.Token.isTokenQuote(r,t)||n.Token.isTokenEscapeCharacter(r,t))?(a.push(r.token),o=r):s?i=!0:a.push(o.token)}else s?i=!0:a.push(o.token);e.advancePastToken(o)}return{col:this.columnFormatter.format(a.join(``)),foundClosingQuote:i}}checkForMalformedColumn(e){let{parserOptions:t}=this,{nextNonSpaceToken:r}=e;if(r){let i=n.Token.isTokenDelimiter(r,t),a=n.Token.isTokenRowDelimiter(r);if(!(i||a)){let n=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,`\\n'`);throw Error(`Parse Error: expected: '${t.escapedDelimiter}' OR new line got: '${r.token}'. at '${n}'`)}e.advanceToToken(r)}else e.hasMoreData||e.advancePastLine()}}})),Eu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=wu(),n=Tu(),r=xu();e.ColumnParser=class{parserOptions;nonQuotedColumnParser;quotedColumnParser;constructor(e){this.parserOptions=e,this.quotedColumnParser=new n.QuotedColumnParser(e),this.nonQuotedColumnParser=new t.NonQuotedColumnParser(e)}parse(e){let{nextNonSpaceToken:t}=e;return t!==null&&r.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}}})),Du=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnFormatter=e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=void 0;var t=Eu();Object.defineProperty(e,`ColumnParser`,{enumerable:!0,get:function(){return t.ColumnParser}});var n=wu();Object.defineProperty(e,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return n.NonQuotedColumnParser}});var r=Tu();Object.defineProperty(e,`QuotedColumnParser`,{enumerable:!0,get:function(){return r.QuotedColumnParser}});var i=Cu();Object.defineProperty(e,`ColumnFormatter`,{enumerable:!0,get:function(){return i.ColumnFormatter}})})),Ou=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Du(),n=xu();e.RowParser=class{static isEmptyRow(e){return e.join(``).replace(/\s+/g,``)===``}parserOptions;columnParser;constructor(e){this.parserOptions=e,this.columnParser=new t.ColumnParser(e)}parse(e){let{parserOptions:t}=this,{hasMoreData:r}=e,i=e,a=[],o=this.getStartToken(i,a);for(;o;){if(n.Token.isTokenRowDelimiter(o))return i.advancePastToken(o),!i.hasMoreCharacters&&n.Token.isTokenCarriageReturn(o,t)&&r?null:(i.truncateToCursor(),a);if(!this.shouldSkipColumnParse(i,o,a)){let e=this.columnParser.parse(i);if(e===null)return null;a.push(e)}o=i.nextNonSpaceToken}return r?null:(i.truncateToCursor(),a)}getStartToken(e,t){let r=e.nextNonSpaceToken;return r!==null&&n.Token.isTokenDelimiter(r,this.parserOptions)?(t.push(``),e.nextNonSpaceToken):r}shouldSkipColumnParse(e,t,r){let{parserOptions:i}=this;if(n.Token.isTokenDelimiter(t,i)){e.advancePastToken(t);let a=e.nextCharacterToken;if(!e.hasMoreCharacters||a!==null&&n.Token.isTokenRowDelimiter(a)||a!==null&&n.Token.isTokenDelimiter(a,i))return r.push(``),!0}return!1}}})),ku=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Su(),n=Ou(),r=xu();e.Parser=class e{static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parserOptions;rowParser;constructor(e){this.parserOptions=e,this.rowParser=new n.RowParser(this.parserOptions)}parse(n,r){let i=new t.Scanner({line:e.removeBOM(n),parserOptions:this.parserOptions,hasMoreData:r});return this.parserOptions.supportsComments?this.parseWithComments(i):this.parseWithoutComments(i)}parseWithoutComments(e){let t=[],n=!0;for(;n;)n=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){let{parserOptions:t}=this,n=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(r.Token.isTokenComment(i,t)){if(e.advancePastLine()===null||!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;let r=this.rowParser.parse(e);return r===null?!1:(this.parserOptions.ignoreEmpty&&n.RowParser.isEmptyRow(r)||t.push(r),!0)}}})),Au=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=e.Token=e.Scanner=e.RowParser=e.Parser=void 0;var t=ku();Object.defineProperty(e,`Parser`,{enumerable:!0,get:function(){return t.Parser}});var n=Ou();Object.defineProperty(e,`RowParser`,{enumerable:!0,get:function(){return n.RowParser}});var r=Su();Object.defineProperty(e,`Scanner`,{enumerable:!0,get:function(){return r.Scanner}});var i=xu();Object.defineProperty(e,`Token`,{enumerable:!0,get:function(){return i.Token}});var a=Du();Object.defineProperty(e,`ColumnParser`,{enumerable:!0,get:function(){return a.ColumnParser}}),Object.defineProperty(e,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return a.NonQuotedColumnParser}}),Object.defineProperty(e,`QuotedColumnParser`,{enumerable:!0,get:function(){return a.QuotedColumnParser}})})),ju=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Qt(),n=sn(),r=bu(),i=Au();e.CsvParserStream=class e extends n.Transform{parserOptions;decoder;parser;headerTransformer;rowTransformerValidator;lines=``;rowCount=0;parsedRowCount=0;parsedLineCount=0;endEmitted=!1;headersEmitted=!1;constructor(e){super({objectMode:e.objectMode}),this.parserOptions=e,this.parser=new i.Parser(e),this.headerTransformer=new r.HeaderTransformer(e),this.decoder=new t.StringDecoder(e.encoding),this.rowTransformerValidator=new r.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e,...t){return e===`end`?(this.endEmitted||(this.endEmitted=!0,super.emit(`end`,this.rowCount)),!1):super.emit(e,...t)}_transform(t,n,r){if(this.hasHitRowLimit)return r();let i=e.wrapDoneCallback(r);try{let{lines:e}=this,n=e+this.decoder.write(t),r=this.parse(n,!0);return this.processRows(r,i)}catch(e){return i(e)}}_flush(t){let n=e.wrapDoneCallback(t);if(this.hasHitRowLimit)return n();try{let e=this.lines+this.decoder.end(),t=this.parse(e,!1);return this.processRows(t,n)}catch(e){return n(e)}}parse(e,t){if(!e)return[];let{line:n,rows:r}=this.parser.parse(e,t);return this.lines=n,r}processRows(e,t){let n=e.length,r=i=>{let a=e=>{if(e)return t(e);if(i%100==0){setImmediate(()=>r(i+1));return}return r(i+1)};if(this.checkAndEmitHeaders(),i>=n||this.hasHitRowLimit)return t();if(this.parsedLineCount+=1,this.shouldSkipLine)return a();let o=e[i];this.rowCount+=1,this.parsedRowCount+=1;let s=this.rowCount;return this.transformRow(o,(e,t)=>{if(e)return--this.rowCount,a(e);if(!t)return a(Error(`expected transform result`));if(!t.isValid)this.emit(`data-invalid`,t.row,s,t.reason);else if(t.row)return this.pushRow(t.row,a);return a()})};r(0)}transformRow(e,t){try{this.headerTransformer.transform(e,(n,r)=>n?t(n):r?r.isValid?r.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(r.row,t):this.skipRow(t):(--this.rowCount,--this.parsedRowCount,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(Error(`Expected result from header transform`)))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit(`headers`,this.headerTransformer.headers))}skipRow(e){return--this.rowCount,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return(n,...r)=>{if(n){if(t)throw n;t=!0,e(n);return}e(...r)}}}})),Mu=c((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.parseString=e.parseFile=e.parseStream=e.parse=e.ParserOptions=e.CsvParserStream=void 0;let a=r((Ji(),f(Ki))),o=sn(),s=pu(),c=ju();i(mu(),e);var l=ju();Object.defineProperty(e,`CsvParserStream`,{enumerable:!0,get:function(){return l.CsvParserStream}});var u=pu();Object.defineProperty(e,`ParserOptions`,{enumerable:!0,get:function(){return u.ParserOptions}}),e.parse=e=>new c.CsvParserStream(new s.ParserOptions(e)),e.parseStream=(e,t)=>e.pipe(new c.CsvParserStream(new s.ParserOptions(t))),e.parseFile=(e,t={})=>a.createReadStream(e).pipe(new c.CsvParserStream(new s.ParserOptions(t))),e.parseString=(e,t)=>{let n=new o.Readable;return n.push(e),n.push(null),n.pipe(new c.CsvParserStream(new s.ParserOptions(t)))}})),Nu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvParserStream=e.ParserOptions=e.parseFile=e.parseStream=e.parseString=e.parse=e.FormatterOptions=e.CsvFormatterStream=e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=void 0;var t=fu();Object.defineProperty(e,`format`,{enumerable:!0,get:function(){return t.format}}),Object.defineProperty(e,`write`,{enumerable:!0,get:function(){return t.write}}),Object.defineProperty(e,`writeToStream`,{enumerable:!0,get:function(){return t.writeToStream}}),Object.defineProperty(e,`writeToBuffer`,{enumerable:!0,get:function(){return t.writeToBuffer}}),Object.defineProperty(e,`writeToString`,{enumerable:!0,get:function(){return t.writeToString}}),Object.defineProperty(e,`writeToPath`,{enumerable:!0,get:function(){return t.writeToPath}}),Object.defineProperty(e,`CsvFormatterStream`,{enumerable:!0,get:function(){return t.CsvFormatterStream}}),Object.defineProperty(e,`FormatterOptions`,{enumerable:!0,get:function(){return t.FormatterOptions}});var n=Mu();Object.defineProperty(e,`parse`,{enumerable:!0,get:function(){return n.parse}}),Object.defineProperty(e,`parseString`,{enumerable:!0,get:function(){return n.parseString}}),Object.defineProperty(e,`parseStream`,{enumerable:!0,get:function(){return n.parseStream}}),Object.defineProperty(e,`parseFile`,{enumerable:!0,get:function(){return n.parseFile}}),Object.defineProperty(e,`ParserOptions`,{enumerable:!0,get:function(){return n.ParserOptions}}),Object.defineProperty(e,`CsvParserStream`,{enumerable:!0,get:function(){return n.CsvParserStream}})})),Pu=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal;if(this.day=e.match(/\d+/)[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,``)===e&&(this.day=n)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),Fu=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),Iu=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}));Ji();var Lu=d(Nu(),1),Ru=d(Pu(),1),zu=d(Fu(),1),Bu=d(Iu(),1);let Vu={true:!0,false:!1,"#N/A":{error:`#N/A`},"#REF!":{error:`#REF!`},"#NAME?":{error:`#NAME?`},"#DIV/0!":{error:`#DIV/0!`},"#NULL!":{error:`#NULL!`},"#VALUE!":{error:`#VALUE!`},"#NUM!":{error:`#NUM!`}};Bu.default.extend(Ru.default),Bu.default.extend(zu.default);var Hu=class{constructor(e){this.workbook=e,this.worksheet=null}async readFile(e,t){if(t||={},!await ia(e))throw Error(`File not found: ${e}`);let n=qi.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}read(e,t){return t||={},new Promise((n,r)=>{let i=this.workbook.addWorksheet(t.sheetName),a=t.dateFormats||[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`MM-DD-YYYY`,`YYYY-MM-DD`],o=t.map||function(e){if(e===``)return null;let t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;let n=a.reduce((t,n)=>{if(t)return t;let r=(0,Bu.default)(e,n,!0);return r.isValid()?r:null},null);if(n)return new Date(n.valueOf());let r=Vu[e];return r===void 0?e:r},s=e=>{i.addRow(e.map(o))},c=()=>{f.emit(`worksheet`,i)},l=()=>{f.removeListener(`data`,s),f.removeListener(`end`,c),f.removeListener(`worksheet`,u),f.removeListener(`error`,d)},u=e=>{l(),n(e)},d=e=>{l(),r(e)},f=(0,Lu.parse)(t.parserOptions).on(`data`,s).on(`end`,c);f.once(`worksheet`,u).on(`error`,d),e.pipe(f)})}write(e,t){return new Promise((n,r)=>{t||={};let i=this.workbook.getWorksheet(t.sheetName||t.sheetId),a=(0,Lu.format)(t.formatterOptions),o=()=>{e.removeListener(`finish`,s),a.removeListener(`error`,c)},s=()=>{o(),n()},c=e=>{o(),r(e)};e.once(`finish`,s),a.on(`error`,c),a.pipe(e);let{dateFormat:l,dateUTC:u}=t,d=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||``;if(e.formula||e.result)return e.result||``;if(e instanceof Date)return l?u?Bu.default.utc(e).format(l):(0,Bu.default)(e).format(l):u?Bu.default.utc(e).format():(0,Bu.default)(e).format();if(e.error)return e.error;if(typeof e==`object`)return JSON.stringify(e)}return e}),f=t.includeEmptyRows===void 0||t.includeEmptyRows,p=1;i&&i.eachRow((e,t)=>{if(f)for(;p++<t-1;)a.write([]);let{values:n}=e;n.shift(),a.write(n.map(d)),p=t}),a.end()})}writeFile(e,t){t||={};let n={encoding:t.encoding||`utf8`},r=qi.createWriteStream(e,n);return this.write(r,t)}async writeBuffer(e){let t=new Do;return await this.write(t,e),t.read()}},Uu=class{constructor(){this.category=``,this.company=``,this.created=new Date,this.description=``,this.keywords=``,this.manager=``,this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject=``,this.title=``,this.views=[],this.media=[],this.pivotTables=[],this._definedNames=new ya}get xlsx(){return this._xlsx||=new tu(this),this._xlsx}get csv(){return this._csv||=new Hu(this),this._csv}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,t){let n=this.nextId,r=this._worksheets.reduce((e,t)=>(t&&t.orderNo)>e?t.orderNo:e,0),i=new ga(Object.assign({},t,{id:n,name:e,orderNo:r+1,workbook:this}));return this._worksheets[n]=i,i}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){let t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){if(e===void 0)return this._worksheets.find(Boolean);if(typeof e==`number`)return this._worksheets[e];if(typeof e==`string`)return this._worksheets.find(t=>t&&t.name===e)}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){let t=this.media.length;return this.media.push(Object.assign({},e,{type:`image`})),t}getImage(e){return this.media[e]}get model(){return{creator:this.creator||`Unknown`,lastModifiedBy:this.lastModifiedBy||`Unknown`,lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,pivotTables:this.pivotTables,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(t=>{let{id:n,name:r,state:i}=t,a=e.sheets&&e.sheets.findIndex(e=>e.id===n),o=this._worksheets[n]=new ga({id:n,name:r,orderNo:a===-1?void 0:a,state:i,workbook:this});o.model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[],this.pivotTables=e.pivotTables||[]}};let Wu=function(e){return e[e.Legal=5]=`Legal`,e[e.Executive=7]=`Executive`,e[e.A4=9]=`A4`,e[e.A5=11]=`A5`,e[e.B5=13]=`B5`,e[e.Envelope_10=20]=`Envelope_10`,e[e.Envelope_DL=27]=`Envelope_DL`,e[e.Envelope_C5=28]=`Envelope_C5`,e[e.Envelope_B5=34]=`Envelope_B5`,e[e.Envelope_Monarch=37]=`Envelope_Monarch`,e[e.Double_Japan_Postcard_Rotated=82]=`Double_Japan_Postcard_Rotated`,e[e.K16_197x273_mm=119]=`K16_197x273_mm`,e}({});return e.DocumentType=y,e.Enums=S,e.ErrorValue=x,e.FormulaType=_,e.PaperSize=Wu,e.ReadingOrder=b,e.RelationshipType=v,e.ValueType=g,e.Workbook=Uu,e})({});
|
|
112
|
+
`}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}token;startCursor;endCursor;constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}}})),Su=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Scanner=void 0;let t=xu(),n=/((?:\r\n)|\n|\r)/;e.Scanner=class{line;parserOptions;lineLength;hasMoreData;cursor=0;constructor(e){this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:e}=this,n=this.parserOptions.NEXT_TOKEN_REGEXP;if(e.search(n)===-1)return null;let r=n.exec(e);if(r==null)return null;let i=r[1],a=this.cursor+(r.index||0);return new t.Token({token:i,startCursor:a,endCursor:a+i.length-1})}get nextCharacterToken(){let{cursor:e,lineLength:n}=this;return n<=e?null:new t.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let e=n.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}})),Cu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnFormatter=void 0,e.ColumnFormatter=class{format;constructor(e){e.trim?this.format=e=>e.trim():e.ltrim?this.format=e=>e.trimLeft():e.rtrim?this.format=e=>e.trimRight():this.format=e=>e}}})),wu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NonQuotedColumnParser=void 0;let t=Cu(),n=xu();e.NonQuotedColumnParser=class{parserOptions;columnFormatter;constructor(e){this.parserOptions=e,this.columnFormatter=new t.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let{parserOptions:t}=this,r=[],i=e.nextCharacterToken;for(;i&&!(n.Token.isTokenDelimiter(i,t)||n.Token.isTokenRowDelimiter(i));i=e.nextCharacterToken)r.push(i.token),e.advancePastToken(i);return this.columnFormatter.format(r.join(``))}}})),Tu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.QuotedColumnParser=void 0;let t=Cu(),n=xu();e.QuotedColumnParser=class{parserOptions;columnFormatter;constructor(e){this.parserOptions=e,this.columnFormatter=new t.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let t=e.cursor,{foundClosingQuote:n,col:r}=this.gatherDataBetweenQuotes(e);if(!n){if(e.advanceTo(t),!e.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||``}' in line: at '${e.lineFromCursor.replace(/[\r\n]/g,`\\n'`)}'`);return null}return this.checkForMalformedColumn(e),r}gatherDataBetweenQuotes(e){let{parserOptions:t}=this,r=!1,i=!1,a=[],o=e.nextCharacterToken;for(;!i&&o!==null;o=e.nextCharacterToken){let s=n.Token.isTokenQuote(o,t);if(!r&&s)r=!0;else if(r)if(n.Token.isTokenEscapeCharacter(o,t)){e.advancePastToken(o);let r=e.nextCharacterToken;r!==null&&(n.Token.isTokenQuote(r,t)||n.Token.isTokenEscapeCharacter(r,t))?(a.push(r.token),o=r):s?i=!0:a.push(o.token)}else s?i=!0:a.push(o.token);e.advancePastToken(o)}return{col:this.columnFormatter.format(a.join(``)),foundClosingQuote:i}}checkForMalformedColumn(e){let{parserOptions:t}=this,{nextNonSpaceToken:r}=e;if(r){let i=n.Token.isTokenDelimiter(r,t),a=n.Token.isTokenRowDelimiter(r);if(!(i||a)){let n=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,`\\n'`);throw Error(`Parse Error: expected: '${t.escapedDelimiter}' OR new line got: '${r.token}'. at '${n}'`)}e.advanceToToken(r)}else e.hasMoreData||e.advancePastLine()}}})),Eu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnParser=void 0;let t=wu(),n=Tu(),r=xu();e.ColumnParser=class{parserOptions;nonQuotedColumnParser;quotedColumnParser;constructor(e){this.parserOptions=e,this.quotedColumnParser=new n.QuotedColumnParser(e),this.nonQuotedColumnParser=new t.NonQuotedColumnParser(e)}parse(e){let{nextNonSpaceToken:t}=e;return t!==null&&r.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}}})),Du=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnFormatter=e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=void 0;var t=Eu();Object.defineProperty(e,`ColumnParser`,{enumerable:!0,get:function(){return t.ColumnParser}});var n=wu();Object.defineProperty(e,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return n.NonQuotedColumnParser}});var r=Tu();Object.defineProperty(e,`QuotedColumnParser`,{enumerable:!0,get:function(){return r.QuotedColumnParser}});var i=Cu();Object.defineProperty(e,`ColumnFormatter`,{enumerable:!0,get:function(){return i.ColumnFormatter}})})),Ou=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RowParser=void 0;let t=Du(),n=xu();e.RowParser=class{static isEmptyRow(e){return e.join(``).replace(/\s+/g,``)===``}parserOptions;columnParser;constructor(e){this.parserOptions=e,this.columnParser=new t.ColumnParser(e)}parse(e){let{parserOptions:t}=this,{hasMoreData:r}=e,i=e,a=[],o=this.getStartToken(i,a);for(;o;){if(n.Token.isTokenRowDelimiter(o))return i.advancePastToken(o),!i.hasMoreCharacters&&n.Token.isTokenCarriageReturn(o,t)&&r?null:(i.truncateToCursor(),a);if(!this.shouldSkipColumnParse(i,o,a)){let e=this.columnParser.parse(i);if(e===null)return null;a.push(e)}o=i.nextNonSpaceToken}return r?null:(i.truncateToCursor(),a)}getStartToken(e,t){let r=e.nextNonSpaceToken;return r!==null&&n.Token.isTokenDelimiter(r,this.parserOptions)?(t.push(``),e.nextNonSpaceToken):r}shouldSkipColumnParse(e,t,r){let{parserOptions:i}=this;if(n.Token.isTokenDelimiter(t,i)){e.advancePastToken(t);let a=e.nextCharacterToken;if(!e.hasMoreCharacters||a!==null&&n.Token.isTokenRowDelimiter(a)||a!==null&&n.Token.isTokenDelimiter(a,i))return r.push(``),!0}return!1}}})),ku=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Parser=void 0;let t=Su(),n=Ou(),r=xu();e.Parser=class e{static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parserOptions;rowParser;constructor(e){this.parserOptions=e,this.rowParser=new n.RowParser(this.parserOptions)}parse(n,r){let i=new t.Scanner({line:e.removeBOM(n),parserOptions:this.parserOptions,hasMoreData:r});return this.parserOptions.supportsComments?this.parseWithComments(i):this.parseWithoutComments(i)}parseWithoutComments(e){let t=[],n=!0;for(;n;)n=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){let{parserOptions:t}=this,n=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(r.Token.isTokenComment(i,t)){if(e.advancePastLine()===null||!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;let r=this.rowParser.parse(e);return r===null?!1:(this.parserOptions.ignoreEmpty&&n.RowParser.isEmptyRow(r)||t.push(r),!0)}}})),Au=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=e.Token=e.Scanner=e.RowParser=e.Parser=void 0;var t=ku();Object.defineProperty(e,`Parser`,{enumerable:!0,get:function(){return t.Parser}});var n=Ou();Object.defineProperty(e,`RowParser`,{enumerable:!0,get:function(){return n.RowParser}});var r=Su();Object.defineProperty(e,`Scanner`,{enumerable:!0,get:function(){return r.Scanner}});var i=xu();Object.defineProperty(e,`Token`,{enumerable:!0,get:function(){return i.Token}});var a=Du();Object.defineProperty(e,`ColumnParser`,{enumerable:!0,get:function(){return a.ColumnParser}}),Object.defineProperty(e,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return a.NonQuotedColumnParser}}),Object.defineProperty(e,`QuotedColumnParser`,{enumerable:!0,get:function(){return a.QuotedColumnParser}})})),ju=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvParserStream=void 0;let t=Qt(),n=sn(),r=bu(),i=Au();e.CsvParserStream=class e extends n.Transform{parserOptions;decoder;parser;headerTransformer;rowTransformerValidator;lines=``;rowCount=0;parsedRowCount=0;parsedLineCount=0;endEmitted=!1;headersEmitted=!1;constructor(e){super({objectMode:e.objectMode}),this.parserOptions=e,this.parser=new i.Parser(e),this.headerTransformer=new r.HeaderTransformer(e),this.decoder=new t.StringDecoder(e.encoding),this.rowTransformerValidator=new r.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e,...t){return e===`end`?(this.endEmitted||(this.endEmitted=!0,super.emit(`end`,this.rowCount)),!1):super.emit(e,...t)}_transform(t,n,r){if(this.hasHitRowLimit)return r();let i=e.wrapDoneCallback(r);try{let{lines:e}=this,n=e+this.decoder.write(t),r=this.parse(n,!0);return this.processRows(r,i)}catch(e){return i(e)}}_flush(t){let n=e.wrapDoneCallback(t);if(this.hasHitRowLimit)return n();try{let e=this.lines+this.decoder.end(),t=this.parse(e,!1);return this.processRows(t,n)}catch(e){return n(e)}}parse(e,t){if(!e)return[];let{line:n,rows:r}=this.parser.parse(e,t);return this.lines=n,r}processRows(e,t){let n=e.length,r=i=>{let a=e=>{if(e)return t(e);if(i%100==0){setImmediate(()=>r(i+1));return}return r(i+1)};if(this.checkAndEmitHeaders(),i>=n||this.hasHitRowLimit)return t();if(this.parsedLineCount+=1,this.shouldSkipLine)return a();let o=e[i];this.rowCount+=1,this.parsedRowCount+=1;let s=this.rowCount;return this.transformRow(o,(e,t)=>{if(e)return--this.rowCount,a(e);if(!t)return a(Error(`expected transform result`));if(!t.isValid)this.emit(`data-invalid`,t.row,s,t.reason);else if(t.row)return this.pushRow(t.row,a);return a()})};r(0)}transformRow(e,t){try{this.headerTransformer.transform(e,(n,r)=>n?t(n):r?r.isValid?r.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(r.row,t):this.skipRow(t):(--this.rowCount,--this.parsedRowCount,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(Error(`Expected result from header transform`)))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit(`headers`,this.headerTransformer.headers))}skipRow(e){return--this.rowCount,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return(n,...r)=>{if(n){if(t)throw n;t=!0,e(n);return}e(...r)}}}})),Mu=c((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.parseString=e.parseFile=e.parseStream=e.parse=e.ParserOptions=e.CsvParserStream=void 0;let a=r((Ji(),f(Ki))),o=sn(),s=pu(),c=ju();i(mu(),e);var l=ju();Object.defineProperty(e,`CsvParserStream`,{enumerable:!0,get:function(){return l.CsvParserStream}});var u=pu();Object.defineProperty(e,`ParserOptions`,{enumerable:!0,get:function(){return u.ParserOptions}}),e.parse=e=>new c.CsvParserStream(new s.ParserOptions(e)),e.parseStream=(e,t)=>e.pipe(new c.CsvParserStream(new s.ParserOptions(t))),e.parseFile=(e,t={})=>a.createReadStream(e).pipe(new c.CsvParserStream(new s.ParserOptions(t))),e.parseString=(e,t)=>{let n=new o.Readable;return n.push(e),n.push(null),n.pipe(new c.CsvParserStream(new s.ParserOptions(t)))}})),Nu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvParserStream=e.ParserOptions=e.parseFile=e.parseStream=e.parseString=e.parse=e.FormatterOptions=e.CsvFormatterStream=e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=void 0;var t=fu();Object.defineProperty(e,`format`,{enumerable:!0,get:function(){return t.format}}),Object.defineProperty(e,`write`,{enumerable:!0,get:function(){return t.write}}),Object.defineProperty(e,`writeToStream`,{enumerable:!0,get:function(){return t.writeToStream}}),Object.defineProperty(e,`writeToBuffer`,{enumerable:!0,get:function(){return t.writeToBuffer}}),Object.defineProperty(e,`writeToString`,{enumerable:!0,get:function(){return t.writeToString}}),Object.defineProperty(e,`writeToPath`,{enumerable:!0,get:function(){return t.writeToPath}}),Object.defineProperty(e,`CsvFormatterStream`,{enumerable:!0,get:function(){return t.CsvFormatterStream}}),Object.defineProperty(e,`FormatterOptions`,{enumerable:!0,get:function(){return t.FormatterOptions}});var n=Mu();Object.defineProperty(e,`parse`,{enumerable:!0,get:function(){return n.parse}}),Object.defineProperty(e,`parseString`,{enumerable:!0,get:function(){return n.parseString}}),Object.defineProperty(e,`parseStream`,{enumerable:!0,get:function(){return n.parseStream}}),Object.defineProperty(e,`parseFile`,{enumerable:!0,get:function(){return n.parseFile}}),Object.defineProperty(e,`ParserOptions`,{enumerable:!0,get:function(){return n.ParserOptions}}),Object.defineProperty(e,`CsvParserStream`,{enumerable:!0,get:function(){return n.CsvParserStream}})})),Pu=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal;if(this.day=e.match(/\d+/)[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,``)===e&&(this.day=n)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),Fu=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),Iu=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}));Ji();var Lu=d(Nu(),1),Ru=d(Pu(),1),zu=d(Fu(),1),Bu=d(Iu(),1);let Vu={true:!0,false:!1,"#N/A":{error:`#N/A`},"#REF!":{error:`#REF!`},"#NAME?":{error:`#NAME?`},"#DIV/0!":{error:`#DIV/0!`},"#NULL!":{error:`#NULL!`},"#VALUE!":{error:`#VALUE!`},"#NUM!":{error:`#NUM!`}};Bu.default.extend(Ru.default),Bu.default.extend(zu.default);var Hu=class{constructor(e){this.workbook=e,this.worksheet=null}async readFile(e,t){if(t||={},!await ia(e))throw Error(`File not found: ${e}`);let n=qi.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}read(e,t){return t||={},new Promise((n,r)=>{let i=this.workbook.addWorksheet(t.sheetName),a=t.dateFormats||[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`MM-DD-YYYY`,`YYYY-MM-DD`],o=t.map||function(e){if(e===``)return null;let t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;let n=a.reduce((t,n)=>{if(t)return t;let r=(0,Bu.default)(e,n,!0);return r.isValid()?r:null},null);if(n)return new Date(n.valueOf());let r=Vu[e];return r===void 0?e:r},s=e=>{i.addRow(e.map(o))},c=()=>{f.emit(`worksheet`,i)},l=()=>{f.removeListener(`data`,s),f.removeListener(`end`,c),f.removeListener(`worksheet`,u),f.removeListener(`error`,d)},u=e=>{l(),n(e)},d=e=>{l(),r(e)},f=(0,Lu.parse)(t.parserOptions).on(`data`,s).on(`end`,c);f.once(`worksheet`,u).on(`error`,d),e.pipe(f)})}write(e,t){return new Promise((n,r)=>{t||={};let i=this.workbook.getWorksheet(t.sheetName||t.sheetId),a=(0,Lu.format)(t.formatterOptions),o=()=>{e.removeListener(`finish`,s),a.removeListener(`error`,c)},s=()=>{o(),n()},c=e=>{o(),r(e)};e.once(`finish`,s),a.on(`error`,c),a.pipe(e);let{dateFormat:l,dateUTC:u}=t,d=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||``;if(e.formula||e.result)return e.result||``;if(e instanceof Date)return l?u?Bu.default.utc(e).format(l):(0,Bu.default)(e).format(l):u?Bu.default.utc(e).format():(0,Bu.default)(e).format();if(e.error)return e.error;if(typeof e==`object`)return JSON.stringify(e)}return e}),f=t.includeEmptyRows===void 0||t.includeEmptyRows,p=1;i&&i.eachRow((e,t)=>{if(f)for(;p++<t-1;)a.write([]);let{values:n}=e;n.shift(),a.write(n.map(d)),p=t}),a.end()})}writeFile(e,t){t||={};let n={encoding:t.encoding||`utf8`},r=qi.createWriteStream(e,n);return this.write(r,t)}async writeBuffer(e){let t=new Do;return await this.write(t,e),t.read()}},Uu=class{constructor(){this.category=``,this.company=``,this.created=new Date,this.description=``,this.keywords=``,this.manager=``,this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject=``,this.title=``,this.views=[],this.media=[],this.pivotTables=[],this._definedNames=new ya}get xlsx(){return this._xlsx||=new tu(this),this._xlsx}get csv(){return this._csv||=new Hu(this),this._csv}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,t){let n=this.nextId,r=this._worksheets.reduce((e,t)=>(t&&t.orderNo)>e?t.orderNo:e,0),i=new ga(Object.assign({},t,{id:n,name:e,orderNo:r+1,workbook:this}));return this._worksheets[n]=i,i}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){let t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){if(e===void 0)return this._worksheets.find(Boolean);if(typeof e==`number`)return this._worksheets[e];if(typeof e==`string`)return this._worksheets.find(t=>t&&t.name===e)}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){let t=this.media.length;return this.media.push(Object.assign({},e,{type:`image`})),t}getImage(e){return this.media[e]}get model(){return{creator:this.creator||`Unknown`,lastModifiedBy:this.lastModifiedBy||`Unknown`,lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,pivotTables:this.pivotTables,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(t=>{let{id:n,name:r,state:i}=t,a=e.sheets&&e.sheets.findIndex(e=>e.id===n),o=this._worksheets[n]=new ga({id:n,name:r,orderNo:a===-1?void 0:a,state:i,workbook:this});o.model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[],this.pivotTables=e.pivotTables||[]}};let Wu=function(e){return e[e.Legal=5]=`Legal`,e[e.Executive=7]=`Executive`,e[e.A4=9]=`A4`,e[e.A5=11]=`A5`,e[e.B5=13]=`B5`,e[e.Envelope_10=20]=`Envelope_10`,e[e.Envelope_DL=27]=`Envelope_DL`,e[e.Envelope_C5=28]=`Envelope_C5`,e[e.Envelope_B5=34]=`Envelope_B5`,e[e.Envelope_Monarch=37]=`Envelope_Monarch`,e[e.Double_Japan_Postcard_Rotated=82]=`Double_Japan_Postcard_Rotated`,e[e.K16_197x273_mm=119]=`K16_197x273_mm`,e}({});return e.DocumentType=y,e.Enums=S,e.ErrorValue=x,e.FormulaType=_,e.PaperSize=Wu,e.ReadingOrder=b,e.RelationshipType=v,e.ValueType=g,e.Workbook=Uu,e})({});
|