@sheetxl/studio-vanilla 0.4.19 → 0.4.21
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.
- package/browser/cjs/index.cjs +80 -2
- package/browser/cjs/{BJIfDlGWvnC0eGUi.cjs → n6CXzSocLW_BCO8w.cjs} +6 -6
- package/browser/esm/{DiGLoJDZqriVp152.mjs → NBuS53B7u8hItiXf.mjs} +933 -937
- package/browser/esm/index.mjs +176 -4
- package/cdn/assets/CY8njwo06MWkoPz2.js +21 -0
- package/cdn/index.js +2 -2
- package/cdn/loader.js +1 -1
- package/package.json +3 -3
- package/browser/cjs/1FbLU-GkjsXMtg8T.cjs +0 -15
- package/browser/cjs/3xnum9EEG0qokR90.cjs +0 -12
- package/browser/cjs/5i4FVjROedZEnZNH.cjs +0 -6
- package/browser/cjs/9yZt9CqVSMBE7LUX.cjs +0 -6
- package/browser/cjs/B7V2ifI29G13Ypfn.cjs +0 -378
- package/browser/cjs/BCBl10fgrkZ5JX8E.cjs +0 -161
- package/browser/cjs/BCVApYTYfHlRzbCn.cjs +0 -6
- package/browser/cjs/BjW-ykzXN9S3TMzb.cjs +0 -11
- package/browser/cjs/Bn5tlfH0oqJI1Lk9.cjs +0 -6
- package/browser/cjs/BnD8IArw964iF-Zg.cjs +0 -1501
- package/browser/cjs/BnwSPi6FOdqxr7z1.cjs +0 -19
- package/browser/cjs/BxpKhdqadWDARG9W.cjs +0 -16
- package/browser/cjs/C8FEOglWYUtglsLP.cjs +0 -6
- package/browser/cjs/CDd6P2SfTKp4v-QA.cjs +0 -6
- package/browser/cjs/CFfq2Z-VQyMwMJKP.cjs +0 -6
- package/browser/cjs/CG1FkANzsujO3FLU.cjs +0 -6
- package/browser/cjs/CGD07mOjjl6zfCzK.cjs +0 -15
- package/browser/cjs/CMO36tnnJHrXso4Q.cjs +0 -7
- package/browser/cjs/CMfyyxtrIHPMnrBl.cjs +0 -6
- package/browser/cjs/CNue1AsHpswiVYJx.cjs +0 -6
- package/browser/cjs/C_bqbac1bCl1H0Bn.cjs +0 -6
- package/browser/cjs/C_jIzbaCWis1jB7f.cjs +0 -32
- package/browser/cjs/CaFeiasVg3jafLwL.cjs +0 -6
- package/browser/cjs/CaWJjQ_KmjWp1ooU.cjs +0 -145
- package/browser/cjs/CahVr7pzDRu3h4G3.cjs +0 -6
- package/browser/cjs/CaswMUSE1R9Noewr.cjs +0 -6
- package/browser/cjs/CfX6-fSMFgAg6iL9.cjs +0 -124
- package/browser/cjs/CkhCXLhqA4a2CnSJ.cjs +0 -6
- package/browser/cjs/CkriFKrE5BBPFQWm.cjs +0 -6
- package/browser/cjs/CuX_ftSJWqfRsXHy.cjs +0 -6
- package/browser/cjs/CznEff7u33FYbOSn.cjs +0 -6
- package/browser/cjs/D-fNsTpgGyZHdYEp.cjs +0 -6
- package/browser/cjs/DCxlQuW8eB70ZbcJ.cjs +0 -6
- package/browser/cjs/DFet-I-_FYR9s_ET.cjs +0 -6
- package/browser/cjs/DKQmNMiW6vEz1i7V.cjs +0 -6
- package/browser/cjs/DMOCfhgdy7Z8GoD-.cjs +0 -13
- package/browser/cjs/DVVk6WU7lfgpQLZG.cjs +0 -6
- package/browser/cjs/DYMFAMQ13cX03167.cjs +0 -7
- package/browser/cjs/DZVJ234kMQwb5dEy.cjs +0 -6
- package/browser/cjs/DZqqUVtfn36E0rIk.cjs +0 -6
- package/browser/cjs/DguzXHidCk2s1uCY.cjs +0 -6
- package/browser/cjs/Dhik7yBvR-5iyJcR.cjs +0 -6
- package/browser/cjs/Dms2LCMINwYEtl3S.cjs +0 -6
- package/browser/cjs/DnHgK81nepMuvMim.cjs +0 -6
- package/browser/cjs/DuJlHux5dLU53d80.cjs +0 -6
- package/browser/cjs/Dz5uLsJ16GF2Cyov.cjs +0 -6
- package/browser/cjs/Io_6AEq6KpjrZEfL.cjs +0 -6
- package/browser/cjs/R7ToEkyr-cbP0Q3N.cjs +0 -6
- package/browser/cjs/TGD3vlMtB_qnQE-M.cjs +0 -11
- package/browser/cjs/XFsZZevZgfk9vB1r.cjs +0 -6
- package/browser/cjs/bGVtUGltyeHuGKLB.cjs +0 -6
- package/browser/cjs/f-w9NYC1mTi7W9HY.cjs +0 -6
- package/browser/cjs/kGBvcCWaH3h23Ojp.cjs +0 -7
- package/browser/cjs/mUwYCSHSRCUQJ4uV.cjs +0 -42
- package/browser/cjs/qLyXB7fJpKBbTC_N.cjs +0 -6
- package/browser/cjs/s2JuJCqW6ny4lxQX.cjs +0 -6
- package/browser/esm/2Fopggi4LREIIXpY.mjs +0 -13208
- package/browser/esm/4ZXEcNsjnqWXAiUa.mjs +0 -2344
- package/browser/esm/4yxl564v_Wx022xz.mjs +0 -633
- package/browser/esm/5Ovf_TtcBCG7hgdY.mjs +0 -20
- package/browser/esm/6X4p3ajMgDNtcmLW.mjs +0 -10
- package/browser/esm/8F0vFRAXlzH-vmJl.mjs +0 -52354
- package/browser/esm/B1L8rEDpskxCqnhJ.mjs +0 -10
- package/browser/esm/BENg2ibY7Hr-SYp3.mjs +0 -10
- package/browser/esm/BHzg_9TpgdKnIlaX.mjs +0 -10
- package/browser/esm/BY9rDUy2rHkqh6hH.mjs +0 -820
- package/browser/esm/Bd2yJknZG5WTZ26u.mjs +0 -10
- package/browser/esm/BlH_AWoPr-w3-qdS.mjs +0 -10
- package/browser/esm/BmeozQuzbqa81PvH.mjs +0 -41
- package/browser/esm/BprECrKMFGb2UK2v.mjs +0 -2174
- package/browser/esm/Br_6r7a5IjKksr00.mjs +0 -390
- package/browser/esm/ByJuiohpCMXnDKmL.mjs +0 -47
- package/browser/esm/C04_X_6DkiZCUmwB.mjs +0 -1702
- package/browser/esm/C3pNOQaLBsTUp2CW.mjs +0 -10
- package/browser/esm/C4gnsPTE7_xP3Mz_.mjs +0 -1575
- package/browser/esm/C8kq7JNW8ivhRL1S.mjs +0 -3934
- package/browser/esm/CGquHZGGYOxATF73.mjs +0 -10
- package/browser/esm/CKwR5AWlnckKQRc-.mjs +0 -10
- package/browser/esm/CLSpsTCV3Onb_QXV.mjs +0 -84
- package/browser/esm/CMrXKGbxBR_LxLxN.mjs +0 -3755
- package/browser/esm/CN-UcSPqkcXnkJCx.mjs +0 -1365
- package/browser/esm/CQJsDOnipkhuGkKg.mjs +0 -56
- package/browser/esm/CTIgStBt9DOpau5q.mjs +0 -1665
- package/browser/esm/CXL9mY2kUT053cTN.mjs +0 -1346
- package/browser/esm/CZ54d8Ueai6uZgy6.mjs +0 -10
- package/browser/esm/CZM2uNUNI4W8qUw3.mjs +0 -10
- package/browser/esm/CaaAGrJF7OxdprqB.mjs +0 -10
- package/browser/esm/CnRJWnfDHzunp3N5.mjs +0 -472
- package/browser/esm/CpGYH9QSPqM4ejyF.mjs +0 -421
- package/browser/esm/CqLIq6VVhQnv6ZP4.mjs +0 -10
- package/browser/esm/CqTn7MLxDJZX7aIA.mjs +0 -10
- package/browser/esm/D3RHh0FQuMAKk4JL.mjs +0 -10
- package/browser/esm/D8hxrXJDfvDRoouY.mjs +0 -147
- package/browser/esm/DMwYqCQzDDwbzt8K.mjs +0 -44
- package/browser/esm/DNV2yXFlJ5hRF5ME.mjs +0 -46
- package/browser/esm/DUxcExPcvgbBrSXX.mjs +0 -5582
- package/browser/esm/DbTEH7CjzsjIc-ew.mjs +0 -21
- package/browser/esm/Df2lY3OJ73BCDQo6.mjs +0 -24
- package/browser/esm/DlUeNEy_cp31Am5t.mjs +0 -39
- package/browser/esm/DovESggwbqQKJEkM.mjs +0 -10
- package/browser/esm/DpNpusKUeZXcDNra.mjs +0 -29
- package/browser/esm/Dx-FJghQY8rpWJi1.mjs +0 -10
- package/browser/esm/DxObRtwZ98tP8NM3.mjs +0 -10
- package/browser/esm/FT-XJjpzjdyq4pin.mjs +0 -48
- package/browser/esm/HnfOytlj72v4rd6y.mjs +0 -425
- package/browser/esm/IChTkXO9eDekfSb7.mjs +0 -10
- package/browser/esm/KcDpdRfEgTnFwlSh.mjs +0 -21
- package/browser/esm/TVfGpAQkvkA9mx4E.mjs +0 -10
- package/browser/esm/pqikV5IyVMBYUDqP.mjs +0 -10
- package/browser/esm/qfHSXgWX4yZd3nwZ.mjs +0 -1466
- package/browser/esm/xWvOAH67Iwyf2Zge.mjs +0 -10
- package/browser/esm/xaJvLe6JwO1rQiE-.mjs +0 -12
- package/cdn/assets/15AvUM5aNUAfFLU7.js +0 -58
- package/cdn/assets/2Fopggi4LREIIXpY.js +0 -13208
- package/cdn/assets/4yxl564v_Wx022xz.js +0 -633
- package/cdn/assets/6X4p3ajMgDNtcmLW.js +0 -10
- package/cdn/assets/B1L8rEDpskxCqnhJ.js +0 -10
- package/cdn/assets/B1y38xd4JTLIrdUW.js +0 -1702
- package/cdn/assets/BENg2ibY7Hr-SYp3.js +0 -10
- package/cdn/assets/BHzg_9TpgdKnIlaX.js +0 -10
- package/cdn/assets/BXRf5zCAUE8kGNat.js +0 -46
- package/cdn/assets/BZdjtacH2DTSHsdG.js +0 -22
- package/cdn/assets/Bd2yJknZG5WTZ26u.js +0 -10
- package/cdn/assets/BlH_AWoPr-w3-qdS.js +0 -10
- package/cdn/assets/C3pNOQaLBsTUp2CW.js +0 -10
- package/cdn/assets/C6yX85fw0aO70N0-.js +0 -2346
- package/cdn/assets/CGquHZGGYOxATF73.js +0 -10
- package/cdn/assets/CKwR5AWlnckKQRc-.js +0 -10
- package/cdn/assets/CN-UcSPqkcXnkJCx.js +0 -1365
- package/cdn/assets/CSBAnGx7ebIRyjML.js +0 -21
- package/cdn/assets/CTIgStBt9DOpau5q.js +0 -1665
- package/cdn/assets/CXL9mY2kUT053cTN.js +0 -1346
- package/cdn/assets/CZ54d8Ueai6uZgy6.js +0 -10
- package/cdn/assets/CZM2uNUNI4W8qUw3.js +0 -10
- package/cdn/assets/CaaAGrJF7OxdprqB.js +0 -10
- package/cdn/assets/Cfgui52VcoZakyBi.js +0 -50
- package/cdn/assets/Ck6R7vI9j0vG-mKU.js +0 -390
- package/cdn/assets/ClTJpu1UdRW0KLAX.js +0 -23
- package/cdn/assets/Co1yPh9LPeUa-tCm.js +0 -29
- package/cdn/assets/CpGYH9QSPqM4ejyF.js +0 -421
- package/cdn/assets/CppP22dM3wzxzf_R.js +0 -3934
- package/cdn/assets/CqLIq6VVhQnv6ZP4.js +0 -10
- package/cdn/assets/CqTn7MLxDJZX7aIA.js +0 -10
- package/cdn/assets/D3RHh0FQuMAKk4JL.js +0 -10
- package/cdn/assets/DCmJyecz9jzS5Hh5.js +0 -41
- package/cdn/assets/DEHd1h8uAHbt7JQl.js +0 -425
- package/cdn/assets/DK25k4g9SWrBiPDl.js +0 -43
- package/cdn/assets/DL18SWHzmNBC5_Sq.js +0 -472
- package/cdn/assets/DZz8nVXsYYFIaomy.js +0 -3756
- package/cdn/assets/Df2lY3OJ73BCDQo6.js +0 -24
- package/cdn/assets/DidmQocPR2LUv5_-.js +0 -84
- package/cdn/assets/DifkJcFEihfAmrz6.js +0 -5582
- package/cdn/assets/Dj-9L-ifpIi1HChy.js +0 -52185
- package/cdn/assets/DovESggwbqQKJEkM.js +0 -10
- package/cdn/assets/Dwy3QqzGL-q3IHdC.js +0 -49
- package/cdn/assets/Dx-FJghQY8rpWJi1.js +0 -10
- package/cdn/assets/DxObRtwZ98tP8NM3.js +0 -10
- package/cdn/assets/IChTkXO9eDekfSb7.js +0 -10
- package/cdn/assets/KcDpdRfEgTnFwlSh.js +0 -21
- package/cdn/assets/R-6SrokApX5Vs5h6.js +0 -12
- package/cdn/assets/TVfGpAQkvkA9mx4E.js +0 -10
- package/cdn/assets/ZfVobc-p41aYisnX.js +0 -46
- package/cdn/assets/_QS_SgWjAGVcBh2y.js +0 -2177
- package/cdn/assets/_bKdjn1gFyUlsKF8.js +0 -149
- package/cdn/assets/cgKx_r-dAv2kc57N.js +0 -1575
- package/cdn/assets/lxv3lfQ08L2wD1S3.js +0 -820
- package/cdn/assets/pqikV5IyVMBYUDqP.js +0 -10
- package/cdn/assets/wXUNHjkvpeSH2dQZ.js +0 -1466
- package/cdn/assets/xWvOAH67Iwyf2Zge.js +0 -10
- package/cdn/assets/xaJvLe6JwO1rQiE-.js +0 -12
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.19
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./B7V2ifI29G13Ypfn.cjs"),Je=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",ys=new RegExp(`^[${Je}][-${Je}.0-9·̀-ͯ‿-⁀]*$`,"u");function os(i){return i>=65&&i<=90||i>=97&&i<=122||i===58||i===95||i===8204||i===8205||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=767||i>=880&&i<=893||i>=895&&i<=8191||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}const Ke="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",bs=new RegExp(`^[${Ke}][-${Ke}.0-9·̀-ͯ‿-⁀]*$`,"u");function rs(i){return i>=65&&i<=90||i===95||i>=97&&i<=122||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=767||i>=880&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}const z=function(i){return i===32||i===10||i===13||i===9},xs=function(i){return i>=32&&i<=55295||i===10||i===13||i===9||i>=57344&&i<=65533||i>=65536&&i<=1114111},re=os,ts=function(i){return os(i)||i>=48&&i<=57||i===45||i===46||i===183||i>=768&&i<=879||i>=8255&&i<=8256},ns=[32,10,13,9],ws=ys,vs=function(i){return i>=1&&i<=55295||i>=57344&&i<=65533||i>=65536&&i<=1114111},Ss=rs,Cs=function(i){return rs(i)||i===45||i===46||i>=48&&i<=57||i===183||i>=768&&i<=879||i>=8255&&i<=8256},ks=bs,ge="http://www.w3.org/XML/1998/namespace",Zt="http://www.w3.org/2000/xmlns/",As={__proto__:null,xml:ge,xmlns:Zt},Ds={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},I=-1,lt=-2,W=13,Xt=33,ot=10,St=60,Gt=61,j=62,F=63,Yt=93,pe=i=>i===34||i===39,as=[34,39],Es=[...as,91,j],Ps=[...as,St,Yt],Os=[Gt,F,...ns],Is=[...ns,j,38,St];function ke(i,t,s){switch(t){case"xml":s!==ge&&i.fail(`xml prefix must be bound to ${ge}.`);break;case"xmlns":s!==Zt&&i.fail(`xmlns prefix must be bound to ${Zt}.`)}switch(s){case Zt:i.fail(t===""?`the default namespace may not be set to ${s}.`:`may not assign a prefix (even "xmlns") to the URI ${Zt}.`);break;case ge:switch(t){case"xml":break;case"":i.fail(`the default namespace may not be set to ${s}.`);break;default:i.fail("may not assign the xml namespace to another prefix.")}}}const Vs=i=>ks.test(i),Ls=i=>ws.test(i),es={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class Ns{constructor(t){this.i=0,this.prevI=0,this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;const s=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,s){this.nameStartCheck=Ss,this.nameCheck=Cs,this.isName=Vs,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns={__proto__:null,...As};const o=this.opt.additionalNamespaces;o!=null&&(function(n,a){for(const c of Object.keys(a))ke(n,c,a[c])}(this,o),Object.assign(this.ns,o))}else this.nameStartCheck=re,this.nameCheck=ts,this.isName=Ls,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(){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=[];const{fragmentOpt:t}=this;this.state=t?W:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:s}=this.opt;if(s===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");s="1.0"}this.setXMLVersion(s),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(Ds),this.readyHandler?.()}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,s){this[es[t]]=s}off(t){this[es[t]]=void 0}makeError(t){let s=this.fileName??"";return this.trackPosition&&(s.length>0&&(s+=":"),s+=`${this.line}:${this.column}`),s.length>0&&(s+=": "),new Error(s+t)}fail(t){const s=this.makeError(t),o=this.errorHandler;if(o===void 0)throw s;return o(s),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let s=!1;t===null?(s=!0,t=""):typeof t=="object"&&(t=t.toString()),this.carriedFromPrevious!==void 0&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let o=t.length;const n=t.charCodeAt(o-1);!s&&(n===13||n>=55296&&n<=56319)&&(this.carriedFromPrevious=t[o-1],o--,t=t.slice(0,o));const{stateTable:a}=this;for(this.chunk=t,this.i=0;this.i<o;)a[this.state].call(this);return this.chunkPosition+=o,s?this.end():this}close(){return this.write(null)}getCode10(){const t=this.chunk,s=this.i;if(this.prevI=s,this.i++,s>=t.length)return I;const o=t.charCodeAt(s);if(this.column++,o<55296){if(o>=32||o===9)return o;switch(o){case ot:return this.line++,this.column=0,this.positionAtNewLine=this.position,ot;case 13:return t.charCodeAt(s+1)===ot&&(this.i=s+2),this.line++,this.column=0,this.positionAtNewLine=this.position,lt;default:return this.fail("disallowed character."),o}}if(o>56319)return o>=57344&&o<=65533||this.fail("disallowed character."),o;const n=65536+1024*(o-55296)+(t.charCodeAt(s+1)-56320);return this.i=s+2,n>1114111&&this.fail("disallowed character."),n}getCode11(){const{chunk:t,i:s}=this;if(this.prevI=s,this.i=s+1,s>=t.length)return I;const o=t.charCodeAt(s);if(this.column++,o<55296){if(o>31&&o<127||o>159&&o!==8232||o===9)return o;switch(o){case ot:return this.line++,this.column=0,this.positionAtNewLine=this.position,ot;case 13:{const a=t.charCodeAt(s+1);a!==ot&&a!==133||(this.i=s+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,lt;default:return this.fail("disallowed character."),o}}if(o>56319)return o>=57344&&o<=65533||this.fail("disallowed character."),o;const n=65536+1024*(o-55296)+(t.charCodeAt(s+1)-56320);return this.i=s+2,n>1114111&&this.fail("disallowed character."),n}getCodeNorm(){const t=this.getCode();return t===lt?ot:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:s}=this;const{chunk:o}=this;for(;;){const n=this.getCode(),a=n===lt,c=a?ot:n;if(c===I||t.includes(c))return this.text+=o.slice(s,this.prevI),c;a&&(this.text+=`${o.slice(s,this.prevI)}
|
|
7
|
-
`,s=this.i)}}captureToChar(t){let{i:s}=this;const{chunk:o}=this;for(;;){let n=this.getCode();switch(n){case lt:this.text+=`${o.slice(s,this.prevI)}
|
|
8
|
-
`,s=this.i,n=ot;break;case I:return this.text+=o.slice(s),!1}if(n===t)return this.text+=o.slice(s,this.prevI),!0}}captureNameChars(){const{chunk:t,i:s}=this;for(;;){const o=this.getCode();if(o===I)return this.name+=t.slice(s),I;if(!ts(o))return this.name+=t.slice(s,this.prevI),o===lt?ot:o}}skipSpaces(){for(;;){const t=this.getCodeNorm();if(t===I||!z(t))return t}}setXMLVersion(t){this.currentXMLVersion=t,t==="1.0"?(this.isChar=xs,this.getCode=this.getCode10):(this.isChar=vs,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){const t=this.i,s=this.skipSpaces();switch(this.prevI!==t&&(this.xmlDeclPossible=!1),s){case St:if(this.state=15,this.text.length!==0)throw new Error("no-empty text at start");break;case I:break;default:this.unget(),this.state=W,this.xmlDeclPossible=!1}}sDoctype(){const t=this.captureTo(Es);switch(t){case j:this.doctypeHandler?.(this.text),this.text="",this.state=W,this.doctype=!0;break;case I:break;default:this.text+=String.fromCodePoint(t),t===91?this.state=4:pe(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.q=null,this.state=2)}sDTD(){const t=this.captureTo(Ps);t!==I&&(this.text+=String.fromCodePoint(t),t===Yt?this.state=2:t===St?this.state=6:pe(t)&&(this.state=5,this.q=t))}sDTDQuoted(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.state=4,this.q=null)}sDTDOpenWaka(){const t=this.getCodeNorm();switch(this.text+=String.fromCodePoint(t),t){case 33:this.state=7,this.openWakaBang="";break;case F:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){const t=String.fromCodePoint(this.getCodeNorm()),s=this.openWakaBang+=t;this.text+=t,s!=="-"&&(this.state=s==="--"?8:4,this.openWakaBang="")}sDTDComment(){this.captureToChar(45)&&(this.text+="-",this.state=9)}sDTDCommentEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),this.state=t===45?10:8}sDTDCommentEnded(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===j?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(F)&&(this.text+="?",this.state=12)}sDTDPIEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===j&&(this.state=4)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:t}=this;const{chunk:s}=this;t:for(;;)switch(this.getCode()){case lt:this.entity+=`${s.slice(t,this.prevI)}
|
|
9
|
-
`,t=this.i;break;case 59:{const{entityReturnState:o}=this,n=this.entity+s.slice(t,this.prevI);let a;this.state=o,n===""?(this.fail("empty entity name."),a="&;"):(a=this.parseEntity(n),this.entity=""),o===W&&this.textHandler===void 0||(this.text+=a);break t}case I:this.entity+=s.slice(t);break t}}sOpenWaka(){const t=this.getCode();if(re(t))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(t){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang="",this.xmlDeclPossible=!1;break;case F:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=W,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(){const t=this.getCodeNorm();t===45?(this.state=19,this.commentHandler?.(this.text),this.text=""):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){const t=this.getCodeNorm();t!==j?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(t)}`,this.state=17):this.state=W}sCData(){this.captureToChar(Yt)&&(this.state=21)}sCDataEnding(){const t=this.getCodeNorm();t===Yt?this.state=22:(this.text+=`]${String.fromCodePoint(t)}`,this.state=20)}sCDataEnding2(){const t=this.getCodeNorm();switch(t){case j:this.cdataHandler?.(this.text),this.text="",this.state=W;break;case Yt:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){const t=this.getCodeNorm();this.nameStartCheck(t)?(this.piTarget+=String.fromCodePoint(t),this.state=24):t===F||z(t)?(this.fail("processing instruction without a target."),this.state=t===F?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(t),this.state=24)}sPIRest(){const{chunk:t,i:s}=this;for(;;){const o=this.getCodeNorm();if(o===I)return void(this.piTarget+=t.slice(s));if(!this.nameCheck(o)){this.piTarget+=t.slice(s,this.prevI);const n=o===F;n||z(o)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=n?Xt:27):this.state=n?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(o));break}}}sPIBody(){if(this.text.length===0){const t=this.getCodeNorm();t===F?this.state=26:z(t)||(this.text=String.fromCodePoint(t))}else this.captureToChar(F)&&(this.state=26)}sPIEnding(){const t=this.getCodeNorm();if(t===j){const{piTarget:s}=this;s.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),this.piHandler?.({target:s,body:this.text}),this.piTarget=this.text="",this.state=W}else t===F?this.text+="?":(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const t=this.skipSpaces();t!==F?t!==I&&(this.state=28,this.name=String.fromCodePoint(t)):this.state=Xt}sXMLDeclName(){const t=this.captureTo(Os);if(t===F)return this.state=Xt,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(z(t)||t===Gt){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=t===Gt?30:29}}sXMLDeclEq(){const t=this.getCodeNorm();if(t===F)return this.state=Xt,void this.fail("XML declaration is incomplete.");z(t)||(t!==Gt&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){const t=this.getCodeNorm();if(t===F)return this.state=Xt,void this.fail("XML declaration is incomplete.");z(t)||(pe(t)?this.q=t:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){const t=this.captureTo([this.q,F]);if(t===F)return this.state=Xt,this.text="",void this.fail("XML declaration is incomplete.");if(t===I)return;const s=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const o=s;this.xmlDecl.version=o,/^1\.[0-9]+$/.test(o)?this.opt.forceXMLVersion||this.setXMLVersion(o):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(s)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=s;break;case"standalone":s!=="yes"&&s!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=s}this.name="",this.state=32}sXMLDeclSeparator(){const t=this.getCodeNorm();t!==F?(z(t)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=Xt}sXMLDeclEnding(){this.getCodeNorm()===j?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),this.xmldeclHandler?.(this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=W):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){const t=this.captureNameChars();if(t===I)return;const s=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=s.ns=Object.create(null)),this.openTagStartHandler?.(s),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),t){case j:this.openTag();break;case 47:this.state=35;break;default:z(t)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){this.getCode()===j?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){const t=this.skipSpaces();t!==I&&(re(t)?(this.unget(),this.state=37):t===j?this.openTag():t===47?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){const t=this.captureNameChars();t===Gt?this.state=39:z(t)?this.state=38:t===j?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):t!==I&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const t=this.skipSpaces();switch(t){case I:return;case Gt:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",t===j?this.openTag():re(t)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){const t=this.getCodeNorm();pe(t)?(this.q=t,this.state=40):z(t)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){const{q:t,chunk:s}=this;let{i:o}=this;for(;;)switch(this.getCode()){case t:return this.pushAttrib(this.name,this.text+s.slice(o,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=s.slice(o,this.prevI),this.state=14,void(this.entityReturnState=40);case ot:case lt:case 9:this.text+=`${s.slice(o,this.prevI)} `,o=this.i;break;case St:return this.text+=s.slice(o,this.prevI),void this.fail("disallowed character.");case I:return void(this.text+=s.slice(o))}}sAttribValueClosed(){const t=this.getCodeNorm();z(t)?this.state=36:t===j?this.openTag():t===47?this.state=35:re(t)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const t=this.captureTo(Is);switch(t){case 38:this.state=14,this.entityReturnState=42;break;case St:this.fail("disallowed character.");break;case I:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",t===j?this.openTag():this.state=36}}sCloseTag(){const t=this.captureNameChars();t===j?this.closeTag():z(t)?this.state=44:t!==I&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case j:this.closeTag();break;case I:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:t,forbiddenState:s}=this;const{chunk:o,textHandler:n}=this;t:for(;;)switch(this.getCode()){case St:if(this.state=15,n!==void 0){const{text:a}=this,c=o.slice(t,this.prevI);a.length!==0?(n(a+c),this.text=""):c.length!==0&&n(c)}s=0;break t;case 38:this.state=14,this.entityReturnState=W,n!==void 0&&(this.text+=o.slice(t,this.prevI)),s=0;break t;case Yt:switch(s){case 0:s=1;break;case 1:s=2;break;case 2:break;default:throw new Error("impossible state")}break;case j:s===2&&this.fail('the string "]]>" is disallowed in char data.'),s=0;break;case lt:n!==void 0&&(this.text+=`${o.slice(t,this.prevI)}
|
|
10
|
-
`),t=this.i,s=0;break;case I:n!==void 0&&(this.text+=o.slice(t));break t;default:s=0}this.forbiddenState=s}handleTextOutsideRoot(){let{i:t}=this;const{chunk:s,textHandler:o}=this;let n=!1;t:for(;;){const a=this.getCode();switch(a){case St:if(this.state=15,o!==void 0){const{text:c}=this,T=s.slice(t,this.prevI);c.length!==0?(o(c+T),this.text=""):T.length!==0&&o(T)}break t;case 38:this.state=14,this.entityReturnState=W,o!==void 0&&(this.text+=s.slice(t,this.prevI)),n=!0;break t;case lt:o!==void 0&&(this.text+=`${s.slice(t,this.prevI)}
|
|
11
|
-
`),t=this.i;break;case I:o!==void 0&&(this.text+=s.slice(t));break t;default:z(a)||(n=!0)}}n&&(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(t,s){const{prefix:o,local:n}=this.qname(t),a={name:t,prefix:o,local:n,value:s};if(this.attribList.push(a),this.attributeHandler?.(a),o==="xmlns"){const c=s.trim();this.currentXMLVersion==="1.0"&&c===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[n]=c,ke(this,n,c)}else if(t==="xmlns"){const c=s.trim();this.topNS[""]=c,ke(this,"",c)}}pushAttribPlain(t,s){const o={name:t,value:s};this.attribList.push(o),this.attributeHandler?.(o)}end(){this.sawRoot||this.fail("document must contain a root element.");const{tags:t}=this;for(;t.length>0;){const o=t.pop();this.fail(`unclosed tag: ${o.name}`)}this.state!==0&&this.state!==W&&this.fail("unexpected end.");const{text:s}=this;return s.length!==0&&(this.textHandler?.(s),this.text=""),this._closed=!0,this.endHandler?.(),this._init(),this}resolve(t){let s=this.topNS[t];if(s!==void 0)return s;const{tags:o}=this;for(let n=o.length-1;n>=0;n--)if(s=o[n].ns[t],s!==void 0)return s;return s=this.ns[t],s!==void 0?s:this.opt.resolvePrefix?.(t)}qname(t){const s=t.indexOf(":");if(s===-1)return{prefix:"",local:t};const o=t.slice(s+1),n=t.slice(0,s);return(n===""||o===""||o.includes(":"))&&this.fail(`malformed name: ${t}.`),{prefix:n,local:o}}processAttribsNS(){const{attribList:t}=this,s=this.tag;{const{prefix:a,local:c}=this.qname(s.name);s.prefix=a,s.local=c;const T=s.uri=this.resolve(a)??"";a!==""&&(a==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),T===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(a)}.`),s.uri=a))}if(t.length===0)return;const{attributes:o}=s,n=new Set;for(const a of t){const{name:c,prefix:T,local:S}=a;let x,w;T===""?(x=c==="xmlns"?Zt:"",w=c):(x=this.resolve(T),x===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(T)}.`),x=T),w=`{${x}}${S}`),n.has(w)&&this.fail(`duplicate attribute: ${w}.`),n.add(w),a.uri=x,o[c]=a}this.attribList=[]}processAttribsPlain(){const{attribList:t}=this,s=this.tag.attributes;for(const{name:o,value:n}of t)s[o]!==void 0&&this.fail(`duplicate attribute: ${o}.`),s[o]=n;this.attribList=[]}openTag(){this.processAttribs();const{tags:t}=this,s=this.tag;s.isSelfClosing=!1,this.openTagHandler?.(s),t.push(s),this.state=W,this.name=""}openSelfClosingTag(){this.processAttribs();const{tags:t}=this,s=this.tag;s.isSelfClosing=!0,this.openTagHandler?.(s),this.closeTagHandler?.(s),(this.tag=t[t.length-1]??null)===null&&(this.closedRoot=!0),this.state=W,this.name=""}closeTag(){const{tags:t,name:s}=this;if(this.state=W,this.name="",s==="")return this.fail("weird empty close tag."),void(this.text+="</>");const o=this.closeTagHandler;let n=t.length;for(;n-- >0;){const a=this.tag=t.pop();if(this.topNS=a.ns,o?.(a),a.name===s)break;this.fail("unexpected close tag.")}n===0?this.closedRoot=!0:n<0&&(this.fail(`unmatched closing tag: ${s}.`),this.text+=`</${s}>`)}parseEntity(t){if(t[0]!=="#"){const o=this.ENTITIES[t];return o!==void 0?o:(this.fail(this.isName(t)?"undefined entity.":"disallowed character in entity name."),`&${t};`)}let s=NaN;return t[1]==="x"&&/^#x[0-9a-f]+$/i.test(t)?s=parseInt(t.slice(2),16):/^#[0-9]+$/.test(t)&&(s=parseInt(t.slice(1),10)),this.isChar(s)?String.fromCodePoint(s):(this.fail("malformed character entity."),`&${t};`)}}var Ae,Tt;(Tt=Ae||(Ae={})).Events={XmlDecl:"xmldecl",Text:"text",ProcessingInstruction:"processinginstruction",Doctype:"doctype",Comment:"comment",OpenTagStart:"opentagstart",Attribute:"attribute",OpenTag:"opentag",CloseTag:"closetag",CDdata:"cdata",Error:"error",End:"end",Ready:"ready"},Tt.parseStream=async(i,t,s)=>{const o=new Ns({position:!1,...s});let n;if(t.onOpenTagStart&&o.on(Tt.Events.OpenTagStart,t.onOpenTagStart),t.onOpenTag&&o.on(Tt.Events.OpenTag,t.onOpenTag),t.onCloseTag&&o.on(Tt.Events.CloseTag,t.onCloseTag),t.onAttribute&&o.on(Tt.Events.Attribute,t.onAttribute),t.onText&&o.on(Tt.Events.Text,t.onText),t.onError&&o.on(Tt.Events.Error,t.onError),t.onEnd){t.onEnd;const a=()=>{n=t.onEnd()};o.on(Tt.Events.End,a)}for(;;){const{value:a,done:c}=await i.read();if(c)break;o.write(a)}return o.close(),n};const v=i=>i===!0||i==="1"||i==="on"||i==="true"||i!==!1&&i!=="0"&&i!=="off"&&i!=="false"&&null,D=i=>{const t=parseInt(i);return isNaN(t)?null:t},ct=i=>{const t=parseFloat(i);return isNaN(t)?null:t},A=null;class Rs{constructor(){this._registeredVisitors=new Map}registerVisitor(t){this._registeredVisitors.set(t.from,t)}createEventHandler(t,s,o){const n=this._registeredVisitors,a=[];let c=null,T=null,S=null,x=null;const w=[],E={key:null,source:t};let b=null,d=!1;const P=(y,m)=>{let V=S.attributes[y];if(m){if(Array.isArray(m)){for(let H=0;H<m.length;H++)if(V==null||(V=m[H](V),V==null))return}else if(V==null||(V=m(V),V==null))return}return V},f={getSource:()=>b.source,setSource:y=>{b.source=y},setKey:y=>{b.key=y},getFrom:()=>S,getAttribute:(y,m)=>P(y,m)??null,hasAttribute:y=>f.getAttribute(y)!==null,getParent:()=>w[w.length-2].source,getPath:()=>{const y=[];for(let m=0;m<a.length;m++)y.push(a[m].local);return y.join("\\")},parseAttribute:P,copyToObject:(y,m,V,H)=>{const q=P(H??m,V);q!==void 0&&(y[m]=q)},copyTo:(y,m,V)=>{const H=P(V??y,m);H!==void 0&&(b.source[y]=H)},warn:y=>{o?o?.(y):console.warn(y)}};return{onOpenTag:y=>{let m=y.name;const V=m.indexOf(":");V!==-1&&(m=m.slice(V+1));const H=n.get(m);if(c={local:m,visitor:H,tag:y,destination:null},d)return a.push(c),T=m,void(S=y);x=c?.visitor??null,H&&(b=a.length===0?E:x?.to!==null?{key:null,source:{}}:null,c.destination=b,b&&w.push(b)),a.push(c),T=m,S=y,d=x?.to===null,x?.openTag?.(f)},onCloseTag:y=>{let m=y.name;const V=m.indexOf(":");if(V!==-1&&(m=m.slice(V+1)),m!==T)throw new Error(`mismatch open/close tag: '${m}'/'${T}'`);d||x?.closeTag?.(f);const H=a.pop()??null;c=a[a.length-1]??null;const q=H?.destination;if(q){w.pop(),b=w[w.length-1]??E;const ht=H.visitor;ht&&ht.to&&q.source!==void 0&&(Array.isArray(ht.to)?b.source.push?b.source.push(q.source):o?.(`Unable to parse array for ${ht.from} at ${f.getPath()}`):q.key?b.source[q.key]=q.source:typeof ht.to=="string"&&(b.source[ht.to]=q.source))}T=c?.local??null,S=c?.tag??null,x=c?.visitor??null,d=!c?.destination},onText:y=>{x?.text?.(y,f)},onEnd:s}}}const ss=(i,t,s,o=null)=>{if(!i)return null;let n=i;n.startsWith("/")&&(n=n.substring(1));let a=o?.parsedRefs?.get(i);if(a!==void 0)return a;const c=t(n);if(!c)return null;let T=c.content;try{s&&(T=s(T))}catch(S){console.warn(S)}return o?.parsedRefs?.set(i,T),T},De=(i,t,s,o,n=null)=>{if(!i)return null;let a=i;a.startsWith("/")&&(a=a.substring(1));let c=n?.parsedRefs?.get(i);if(c!==void 0)return c;const T=t(a);if(!T)return null;const S=T.content;try{const x=new TextDecoder().decode(S),w=s.parseFromString(x,"text/xml"),E=o.convert(w,i,n);return n?.parsedRefs?.set(i,E),E}catch(x){console.warn(x)}return null},Ut=(i,t,s,o,n=null)=>{const a=new Map;let c=t.Directory[i];const T=c?c.length:0;for(let S=0;S<T;S++){const x=c[S];if(!x)continue;let w=x;w.startsWith("/")&&(w=w.substring(1));const E=De(w,b=>t.files[b],s,o,n);a.set(w,E)}return a},$s=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],Ee=(i,t="dk1")=>{let s;const o=i("auto");o===void 0||o!=="1"&&o!=="true"||(s=t);const n=i("indexed");n&&(s=`index${n}`);const a=i("rgb");a&&(s=a.toLowerCase(),a.length!==8||a.startsWith("FF")||(s="FF"+a.substring(2,a.length)));const c=i("theme");c&&(s=$s[c]);let T=i("tint");if(T&&(s+=` ${u.N.AdjustmentType.ETint} ${parseFloat(T)}`),s)return s},ls=i=>i&&i.replace(/^\{([\s\S]+)\}$/,"$1"),cs=i=>i==="true"||i==="1";class Ht{static{this.Collapsed=1}static{this.CustomFormat=2}static{this.CustomHeight=4}static{this.Hidden=8}static{this.Ht=16}static{this.OutlineLevel=32}static{this.Ph=64}static{this.R=128}static{this.S=256}static{this.Spans=512}static{this.ThickBot=1024}static{this.ThickTop=2048}}const Ms=(i,t,s)=>{if(i[0].value[0]===i[1].value[0])return t},is={colStart:0,colEnd:0,rowStart:0,rowEnd:0},js=Object.freeze(Object.defineProperty({__proto__:null,fromBufferXLSX:async(i,t)=>{const{password:s,onWarning:o,createWorkbookOptions:n={},...a}=t??{},c=Promise.resolve().then(()=>require("./CaWJjQ_KmjWp1ooU.cjs")),T=Promise.resolve().then(()=>require("./XFsZZevZgfk9vB1r.cjs"));let S=null;try{S=new DOMParser}catch{}let x=null;S||(x=Promise.resolve().then(()=>require("./TGD3vlMtB_qnQE-M.cjs")).then(d=>d.i));let w=null,E=null,b=null;try{const d=await Promise.all([c,T,x]);w=d[0],E=d[1],b=d[2]}catch(d){throw new Error("Unable to load XLSX parser.",{cause:d})}try{const d=w.read(i,{type:"array",sheets:[],cellStyles:!1,bookFiles:!0});if(!d.Directory)throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");d.Directory.richstructure=["/xl/richData/rdrichvaluestructure.xml"],d.Directory.richdata=["/xl/richData/rdrichvalue.xml"];const P=new E.FromOOXMLConverter,f=S??new b.DOMParser,y=n?.resources??new u.Af,m=y.beginPersist(),V={},H=new Set,q=new Map;q.set("richTypes",[]);const ht=new Map,Pe=[],ne=O=>d.files[O],fe=(O,U)=>{const K=O.lastIndexOf("/"),ut=O.substring(0,K+1)+"_rels/"+O.substring(K+1,O.length)+".rels";let dt=U.get(ut);return dt||(dt=(($,be,xe,we,Ft=null)=>{if(!$)return null;const tt=De($,be,xe,we,Ft);if(!tt)return null;const et=new Map,bt=Object.keys(tt),Bt=bt.length;for(let xt=0;xt<Bt;xt++){const Wt=bt[xt],kt=tt[Wt];et.set(Wt,kt)}return et})(ut,ne,f,P,yt),U.set(ut,dt)),dt},ae=(O,U,K,ut=ht)=>{let dt=fe(U,ut).get(O),$=dt?.target;if(!$)return null;if(dt.targetMode==="External")return dt.target;const be=U.lastIndexOf("/"),xe=U.substring(0,be+1);$.startsWith("/")||($=xe+$),$=(tt=>{const et=tt.split(/\/+/);return et.reduce((bt,Bt,xt)=>(Bt==="."?bt.splice(xt,1):Bt===".."&&bt.splice(xt-1,2),bt),et).join("/")})($);const we=P?.getVisitorParamsState().get("dxfs");let Ft=ut.get($);if(!Ft)if(dt.type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"){const tt={};Ft=tt;const et=async()=>{const bt=((L,G,Qt,_,Y,Z,wt)=>{const h=new Rs,Q=new u.je.TransposedBuilder;let X=null;h.registerVisitor({from:"autoFilter",to:"filter",openTag:e=>{e.copyTo("ref",A)}}),h.registerVisitor({from:"conditionalFormatting",to:{},openTag:e=>{const r=e.getParent();r.conditionals||(r.conditionals=[]),r.conditionals.push(e.getSource());const l=e.getAttribute("sqref");l&&(e.getSource().ref=l.split(" ").join(",")),e.copyTo("pivot",v)},closeTag:e=>{const r=e.getSource();if(r.rule){const l=Object.keys(r.rule);for(let p=0;p<l.length;p++){const C=l[p];C!=="rule"&&(r[C]=r.rule[C])}}delete r.rule}}),h.registerVisitor({from:"cfRule",to:"rule",openTag:e=>{const r=e.getParent();e.copyToObject(r,"type",A),e.copyToObject(r,"priority",D),e.copyToObject(r,"stopIfTrue",v);const l=e.getAttribute("dxfId",D);if(l!==null){let p=_?.get(l);p||(Z?.(`Unable to load conditional color. Invalid dxfI: '${l}' at '${e.getPath()}'.`),p={}),r.style=p}e.copyToObject(r,"aboveAverage",v),e.copyToObject(r,"equalAverage",v),e.copyToObject(r,"stdDev",D),e.copyToObject(r,"bottom",v),e.copyToObject(r,"percent",v),e.copyToObject(r,"rank",D),e.copyToObject(r,"operator",A),e.copyToObject(r,"text",A),e.copyToObject(r,"timePeriod",A)}}),h.registerVisitor({from:"colorScale",to:"colorScale"}),h.registerVisitor({from:"dataBar",to:"dataBar",openTag:e=>{e.copyTo("maxLength",D),e.copyTo("minLength",D),e.copyTo("showValue",v)}}),h.registerVisitor({from:"iconSet",to:"iconSet",openTag:e=>{e.copyTo("iconSet",A),e.copyTo("reverse",v),e.copyTo("showValue",v)}}),h.registerVisitor({from:"formula",to:null,text:(e,r)=>{const l=r.getParent();let p=l.formulas;p||(p=[],l.formulas=p),p.push(e)}}),h.registerVisitor({from:"cfvo",to:{},openTag:e=>{const r=e.getParent();r.conditions||(r.conditions=[]),r.conditions.push(e.getSource()),e.copyTo("type",A),e.copyTo("value",ct,"val"),e.copyTo("gte",v)}}),h.registerVisitor({from:"color",to:{},openTag:e=>{const r=e.getParent();r.colors||(r.colors=[]);const l=Ee(p=>e.getAttribute(p));r.colors.push(l)}}),h.registerVisitor({from:"filterColumn",to:"filterColumn",openTag:e=>{const r=e.getParent();r.fields||(r.fields=[]),r.fields.push(e.getSource()),e.copyTo("offset",D,"colId"),e.copyTo("hiddenButton",v),e.copyTo("showButton",v)}}),h.registerVisitor({from:"colorFilter",to:"colorFilter",openTag:e=>{const r=e.getParent();r.criteria||(r.criteria=[]),r.criteria.push(e.getSource()),e.getSource().type=u.Yd.Type.Color,e.copyTo("cellColor",v),e.copyTo("styleId",D,"dxfId")}}),h.registerVisitor({from:"dynamicFilter",to:"dynamicFilter",openTag:e=>{const r=e.getParent();r.criteria||(r.criteria=[]),r.criteria.push(e.getSource()),e.getSource().type=u.Yd.Type.Dynamic,e.copyTo("dynamicType",A,"type"),e.copyTo("val",ct),e.copyTo("maxVal",ct,"maxVal")}}),h.registerVisitor({from:"iconFilter",to:"iconFilter",openTag:e=>{const r=e.getParent();r.criteria||(r.criteria=[]),r.criteria.push(e.getSource()),e.getSource().type=u.Yd.Type.Icon,e.copyTo("iconId",D),e.copyTo("iconSet",A)}}),h.registerVisitor({from:"top10",to:"top10",openTag:e=>{const r=e.getParent();r.criteria||(r.criteria=[]),r.criteria.push(e.getSource()),e.getSource().type=u.Yd.Type.Top10,e.copyTo("filterVal",ct),e.copyTo("percent",v),e.copyTo("top",v),e.copyTo("val",ct)}}),h.registerVisitor({from:"filters",to:"filters",openTag:e=>{const r=e.getParent();r.criteria||(r.criteria=[]),r.criteria.push(e.getSource()),e.getSource().type=u.Yd.Type.Items,e.copyTo("blank",v),e.copyTo("calendarType",A)}}),h.registerVisitor({from:"dateGroupItem",to:"dateGroupItem",openTag:e=>{const r=e.getParent();r.dateGroups||(r.dateGroups=[]),r.dateGroups.push(e.getSource()),e.copyTo("group",A,"dateTimeGrouping"),e.copyTo("day",D),e.copyTo("hour",D),e.copyTo("minute",D),e.copyTo("month",D),e.copyTo("second",D),e.copyTo("year",D)}}),h.registerVisitor({from:"filter",to:"filter",openTag:e=>{const r=e.getParent();r.items||(r.items=[]),r.items.push(e.getAttribute("val",ct))}}),h.registerVisitor({from:"customFilters",to:"customFilters",openTag:e=>{const r=e.getParent();r.criteria||(r.criteria=[]),r.criteria.push(e.getSource()),e.getSource().type=u.Yd.Type.Custom,e.copyTo("and",v)}}),h.registerVisitor({from:"customFilter",to:"customFilter",openTag:e=>{const r=e.getParent();r.filters||(r.filters=[]),r.filters.push(e.getSource()),e.copyTo("operator",A),e.copyTo("value",ct,"val")}}),h.registerVisitor({from:"sortState",to:"sort",openTag:e=>{e.copyTo("ref",A)}}),h.registerVisitor({from:"sortCondition",to:"sortCondition",openTag:e=>{const r=e.getParent();r.fields||(r.fields=[]);const l=e.getSource();r.fields.push(l),e.copyTo("sortOn",A,"sortBy"),e.copyTo("dxfId",A,"sortBy"),e.copyTo("iconSet",A),e.copyTo("customList",A);const p=e.getAttribute("ref");if(p){const C=u.oo.fastStringToRange(p,is).colStart,pt=u.oo.fastStringToRange(r.ref,is),rt=pt.colStart;l.offset=pt?C-rt:C}l.reverse=e.getAttribute("descending",v)??!1}}),h.registerVisitor({from:"AlternateContent",to:null});const ue=e=>{X=e.getSource(),e.copyTo("topLeft",A,"topLeftCell");const r=cs(e.getAttribute("defaultGridColor")),l=e.getAttribute("colorId");l===null||r||(e.getSource().gridLineColor="index"+parseFloat(l)),e.copyTo("showZeros",v),e.copyTo("showFormulas",v),e.copyTo("zoomScale",D),e.copyTo("showRowHeaders",v,"showRowColHeaders"),e.copyTo("showColumnHeaders",v,"showRowColHeaders"),e.copyTo("showRowGridlines",v,"showGridLines"),e.copyTo("showColumnGridlines",v,"showGridLines")};h.registerVisitor({from:"sheetView",to:"view",openTag:e=>{ue(e)},closeTag:()=>{X=null}}),h.registerVisitor({from:"customSheetViews",to:"customSheetViews",openTag:e=>{e.setSource([])}}),h.registerVisitor({from:"customSheetView",to:[],openTag:e=>{ue(e)},closeTag:()=>{X=null}}),h.registerVisitor({from:"selection",to:"selection",openTag:e=>{if(!X)return;e.copyTo("cell",A,"activeCell"),e.copyTo("rangeIndex",D,"activeCellId");const r=e.getAttribute("activeCell"),l=e.getAttribute("sqref");l&&l!==r&&(e.getSource().ranges=l.split(" "))}}),h.registerVisitor({from:"pane",to:"pane",openTag:e=>{if(X&&e.getAttribute("state")==="frozen"){const r={};X.freezePanes=r,e.copyToObject(r,"topLeft",A,"topLeftCell");const l=X.topLeft?u.oo.fastStringToCell(X.topLeft):{colIndex:0,rowIndex:0},p={colIndex:0,rowIndex:0};e.copyToObject(p,"colIndex",D,"xSplit"),e.copyToObject(p,"rowIndex",D,"ySplit");const C={colIndex:l.colIndex+p.colIndex,rowIndex:l.rowIndex+p.rowIndex};r.coords=u.oo.cellToString(C)}}}),h.registerVisitor({from:"tabColor",to:null,openTag:e=>{const r=Ee(l=>e.getAttribute(l));r&&(L.tabColor=r)}}),h.registerVisitor({from:"pageSetUpPr",to:"pageSetUpPr",openTag:e=>{}}),h.registerVisitor({from:"outlinePr",to:"outlinePr",openTag:e=>{}}),h.registerVisitor({from:"pageMargins",to:"pageMargins",openTag:e=>{}}),h.registerVisitor({from:"pageSetup",to:"pageSetup",openTag:e=>{}}),h.registerVisitor({from:"printOptions",to:"printOptions",openTag:e=>{}}),h.registerVisitor({from:"mergeCells",to:"merges",openTag:e=>{e.setSource([])}}),h.registerVisitor({from:"mergeCell",to:[],openTag:e=>{const r=e.getAttribute("ref");e.setSource(r)}}),h.registerVisitor({from:"hyperlinks",to:"hyperlinks",openTag:e=>{e.setSource([])}}),h.registerVisitor({from:"hyperlink",to:[],openTag:e=>{const r=e.getAttribute("r:id"),l=e.getAttribute("ref");if(!l)return void console.warn("No ref found for hyperlink");e.setKey(l);let p=r?G(r):"";if(typeof p!="string")return void console.warn("Invalid address ",p);const C=e.getAttribute("location");p.endsWith("\\")&&(p=p.substring(0,p.length-1));const pt=e.getAttribute("location");if(pt&&(C&&C!==pt&&console.warn("display and location are different",C,pt),p+="#"+pt),!p)return void console.warn("No address found for hyperlink. r:id",r);let rt;const At=e.getAttribute("tooltip");rt=At?{address:p,tooltip:At}:p,e.setSource({r:l,v:rt})}}),h.registerVisitor({from:"drawing",to:"movables",openTag:e=>{const r=e.getAttribute("r:id");if(!r)return;const l=G(r);l?e.setSource(l.movables):console.warn("no drawing found for rId",r)}}),h.registerVisitor({from:"tableParts",to:"tables",openTag:e=>{e.setSource([])}}),h.registerVisitor({from:"tablePart",to:[],openTag:e=>{const r=e.getAttribute("r:id");if(!r)return;const l=G(r);l?e.setSource(l):console.warn("no table found for rId",r)}}),h.registerVisitor({from:"worksheet",to:"worksheet",openTag:e=>{}}),h.registerVisitor({from:"sheetProtection",to:"protection",openTag:e=>{let r=!1;if(e.hasAttribute("sheet")&&v(e.getAttribute("sheet"))&&(r=!0),!r)return void e.setSource(void 0);const l=C=>C===!0||C==="1"||C==="on"||C==="true"||C===!1||C==="0"||C==="off"||C==="false"||null;e.copyTo("autoFilter",l),e.copyTo("deleteColumns",l),e.copyTo("formatCells",l),e.copyTo("formatColumns",l),e.copyTo("formatRows",l),e.copyTo("insertColumns",l),e.copyTo("insertHyperlinks",l),e.copyTo("insertRows",l),e.copyTo("objects",l),e.copyTo("pivotTables",l),e.copyTo("scenarios",l),e.copyTo("selectUnlockedCells",l),e.copyTo("selectUnlockedCells",l),e.copyTo("sort",l);const p={};e.copyToObject(p,"hash",A,"hashValue"),e.copyToObject(p,"algorithm",A,"algorithmName"),e.copyToObject(p,"salt",A,"saltValue"),e.copyToObject(p,"spinCount",D),Object.keys(p).length>0&&(e.getSource().password=p)}}),h.registerVisitor({from:"protectedRanges",to:"protectedRanges",openTag:e=>{e.setSource({})}}),h.registerVisitor({from:"protectedRange",to:{},openTag:e=>{const r=e.getAttribute("sqref");e.setKey(r),e.copyTo("name"),e.copyTo("securityDescriptor");const l={};e.copyToObject(l,"hash",A,"hashValue"),e.copyToObject(l,"algorithm",A,"algorithmName"),e.copyToObject(l,"salt",A,"saltValue"),e.copyToObject(l,"spinCount",D),Object.keys(l).length>0&&(e.getSource().password=l)}}),h.registerVisitor({from:"sheetFormatPr",to:"sheetFormatPr",openTag:e=>{e.copyToObject(L,"defaultColSize",ct,"defaultColWidth"),e.copyToObject(L,"outlineLevelCol",D,"outlineLevelCol");const r=e.getAttribute("customHeight");r!=="1"&&r!=="true"||e.copyToObject(L,"defaultRowSize",ct,"defaultRowHeight"),e.copyToObject(L,"outlineLevelRow",D,"outlineLevelRow")}}),h.registerVisitor({from:"cols",to:"cols",openTag:e=>{e.setSource([])}}),h.registerVisitor({from:"col",to:[],openTag:e=>{e.copyTo("min",r=>parseInt(r)-1),e.copyTo("max",r=>parseInt(r)-1),e.copyTo("sz",ct,"width"),e.copyTo("cs",v,"customWidth"),e.copyTo("h",v,"hidden"),e.copyTo("l",D,"outlineLevel"),e.copyTo("s",D,"style")}}),h.registerVisitor({from:"oleObjects",to:null,openTag:e=>{e.warn("'OLE Objects' are not supported.")}});let Jt=null;const ms={onOpenTag:e=>{Jt===null&&(Jt="")},onText:e=>{Jt+=e},onEnd:()=>{const e=Qt(Jt);return Jt=null,e},onError:e=>{}};return((e,r,l,p,C,pt)=>{let rt=!1,At=!1,qt=[],_t=!1,Dt=null,Kt=null,de=null,nt=null,$e=null,Me=null;const Ts=pt?.get("richData")??[],je=u.oo.normalizeA1ToR1C1,Xe=u.D.createConflatingRanges(),He=new Map,ve=[];let te=null;const Fe=u.D.createConflatingRanges();let ee,Et=!1,B=-1,J=-1,gt=null,se=null;const Se=[];let Ce=null,Be=-2,ft=0,zt="",Pt="",Ot="",It="",Vt="",Lt="",Nt="",We="",qe="",_e="",ze="",Ue="",Ge="",Ye="",mt=!0,Rt=null;return{...l,onEnd:()=>{Se.length>0&&(r.rows=Se);let g=Xe.done(Ms);const k=g.length;if(k>0){const M=new Array(k);for(let N=0;N<k;N++){const at=g[N],$t=u.oo.rangeToString(at),Mt=at.value[1],ie=u.oo.resolveRelativeToA1(Mt,at.rowStart,at.colStart);M[N]=[$t,ie]}r.formulas=M}const st=Fe.done(!0),R=st.length;if(R>0){const M=new Array(R);for(let N=0;N<R;N++){const at=st[N],$t=u.oo.rangeToString(at);M[N]=$t}r.volatile=M}if(ve.length>0&&(r.dynamicArray=[...ve]),qt.length>0){qt.sort(u.D.createRangeComparator(u.F.Orientation.Column));const M=[];let N=null,at=-1,$t=-1,Mt=-1,ie=-1,vt=null;const Ze=qt.length;Ze>0&&(N=qt[0],at=N.colStart,$t=N.colEnd,Mt=N.rowEnd,ie=N.value,M.push(N));for(let jt=1;jt<Ze;jt++)vt=qt[jt],ie!==vt.value||at!==vt.colStart||$t!==vt.colEnd||Mt+1!==vt.rowEnd?(M.push(vt),N=vt,at=N.colStart,$t=N.colEnd,Mt=N.rowEnd,ie=N.value):(Mt=vt.rowEnd,N.rowEnd=Mt);let Qe=[];for(let jt=0;jt<M.length;jt++){const oe=M[jt];Qe.push({r:{colStart:oe.colStart,colEnd:oe.colEnd,rowStart:oe.rowStart,rowEnd:oe.rowEnd},v:oe.value})}r.directStyles=Qe}const it=e.build();if(it){const M=it.tuples;r.data=M}l?.onEnd?.()},onOpenTag:g=>{let k=g.name;const st=k.indexOf(":");if(st!==-1&&(k=k.slice(st+1)),ee){const R=g.attributes;switch(k){case"v":At=!0;break;case"f":switch(R.t??null){case null:case"normal":_t=!0;break;case"shared":const it=R.si;Kt=R.ref,Dt=it;break;case"array":_t=!0,Kt=R.ref,te=[Kt,!1];break;case"datatable":_t=!0,Kt=R.ref,_t=!0}R.ca!==void 0&&Fe.append(B,J);break;case"is":return void(Et=!0)}return void(Et&&C?.onOpenTag(g))}if(rt){if(k==="c"){ee=g;const R=g.attributes.r;J=u.oo.fastStringToCol(R);const it=g.attributes.t;it===void 0?se=null:(se=it,se==="str"&&(Et=!0));let M=g.attributes.s;M!==void 0&&(M=parseInt(M),Rt&&Rt.value===M&&Rt.colEnd+1===J?Rt.colEnd=J:(Rt={colStart:J,rowStart:B,colEnd:J,rowEnd:B,value:M},qt.push(Rt)))}}else{if(k==="row"){rt=!0;const R=g.attributes.r;if(B=parseInt(R)-1,ft=0,Pt=g.attributes.customHeight,Pt!==void 0&&(ft|=Ht.CustomHeight),Pt!==qe&&(mt=!0,qe=Pt),zt=g.attributes.ht,zt!==void 0&&(ft|=Ht.Ht),zt!==We&&(mt=!0,We=zt),Ot=g.attributes.hidden,Ot!==void 0&&(ft|=Ht.Hidden),Ot!==_e&&(mt=!0,_e=Ot),Vt=g.attributes.s,Vt!==void 0&&(ft|=Ht.S),Vt!==Ue&&(mt=!0,Ue=Vt),It=g.attributes.customFormat,It!==void 0&&(ft|=Ht.CustomFormat),It!==ze&&(mt=!0,ze=It),Lt=g.attributes.outlineLevel,Lt!==void 0&&(ft|=Ht.OutlineLevel),Lt!==Ge&&(mt=!0,Ge=Lt),Nt=g.attributes.collapsed,Nt!==void 0&&(ft|=Ht.Collapsed),Nt!==Ye&&(mt=!0,Ye=Nt),ft!==0)if(Be+1!==B||mt){const it=Pt!==void 0&&(Pt==="1"||Pt==="true"),M=It!==void 0&&(It==="1"||It==="true");Ce={min:B,max:B,sz:it&&zt!==void 0?parseFloat(zt):-1,csz:it,h:Ot!==void 0&&(Ot==="1"||Ot==="true"),s:it&&Vt!==void 0&&Vt!=="0"?parseInt(Vt):0,cs:M,l:Lt===void 0||Lt==="0"?0:parseInt(Lt),cl:Nt!==void 0&&(Nt==="1"||Nt==="true")},Se.push(Ce)}else Ce.max=B;return Be=B,void(mt=!1)}l?.onOpenTag(g)}},onCloseTag:g=>{if(ee){let k=g.name;const st=k.indexOf(":");if(st!==-1&&(k=k.slice(st+1)),Et)if(k==="is"||k==="v"){const R=C?.onEnd();R!==null&&e.addValue(B,J,""+R)}else C?.onCloseTag?.(g);return At&&(At=!1),void(k==="c"&&(ee=null,Et=!1))}if(rt)return rt=!1,void(Rt=null);l?.onCloseTag(g)},onText:g=>{if(g=g.trim(),At){switch(gt=null,se){case null:case"n":gt=parseFloat(g);break;case"b":gt=g==="1"||g==="true";break;case"s":gt=g;break;case"e":if(g==="#VALUE!"){const st=ee.attributes.vm;if(st!==void 0){const R=Ts[parseInt(st)-1];if(R&&R.isFormulaError){gt={t:u.X.Error,v:R.getCode()};break}}}const k=u.Y.getBuiltInByLabel(g);k?gt={t:u.X.Error,v:k.getCode()}:(gt=g,p?.(`Unknown formula error '${g}' in cell ${u.oo.cellToString({colIndex:J,rowIndex:B})}`));break;case"str":case"inlineStr":Et=!0}gt!==null&&e.addValue(B,J,gt)}if(te&&(se==="e"&&(te[1]=!0),ve.push(te),te=null),Dt)if($e===Dt)nt=Me;else{if(nt=He.get(Dt),!nt){const k=[];de=je(g,B,J,k),nt=[de,k,g],He.set(Dt,nt)}$e=Dt,Me=nt}if(_t){const k=[];de=je(g,B,J,k),nt=[de,k,g]}if(nt)return Xe.append(B,J,nt),nt=null,_t=!1,Dt=null,void(Kt=null);Et?C?.onText(g):rt||l?.onText(g)}}})(Q,L,h.createEventHandler(L,()=>{},Z),Z,ms,wt)})(tt,(L,G=!1)=>ae(L,$,G)??null,us,we,0,L=>{o&&(L=$+": "+L,o?.(L))},q),Bt=ss($,ne),xt=await(async(L,G=8388608)=>{await(async()=>{if(typeof ReadableStream>"u")if(typeof window>"u"){const{ReadableStream:Z}=await Promise.resolve().then(()=>require("./C_bqbac1bCl1H0Bn.cjs"));globalThis.ReadableStream=Z}else console.warn("Browser does not support ReadableStream; consider loading a polyfill.")})();const Qt=new TextDecoder("utf-8");let _=0;const Y=L instanceof Uint8Array?L:new Uint8Array(L);return new ReadableStream({pull(Z){if(_>=Y.byteLength)return void Z.close();const wt=Y.subarray(_,Math.min(_+G,Y.byteLength)),h=Qt.decode(wt,{stream:_+G<Y.byteLength});Z.enqueue(h),_+=wt.length}}).getReader()})(Bt);try{await Ae.parseStream(xt,bt,{xmlns:!1})}catch(L){throw console.warn(`Error parsing sheet: '${$}'`,L),new Error(`Error parsing sheet: '${$}'`,{cause:L})}const Wt=fe($,ut);let kt,Re=new Map;if(Wt){const L="http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";let G;Wt.forEach((_,Y)=>{_.type===L&&(kt=ae(Y,$,!1,ut)?.comments,kt&&kt.forEach(Z=>{Re.set(Z.id,Z)}))});const Qt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";if(Wt.forEach((_,Y)=>{_.type===Qt&&(G=ae(Y,$,!1,ut))}),G||kt){const _=kt??[],Y=G?.comments;if(Y){const Z=G?.authors;for(let wt=0;wt<Y.length;wt++){const h=Y[wt];let Q=h.authorId!==void 0?Z[h.authorId]:void 0;if((!Q||Q.startsWith("tc="))&&(Q=ls(Q.substring(3)),Re.has(Q)))continue;let X=ce.get(Q);X||(X=Ve.get(Q)),X||(X={id:u.k.uuidV4(),displayName:Q},Ve.set(X.displayName,X),ce.set(X.id,X)),Q=X?.id??null;const ue={id:u.k.uuidV4(),personId:Q,ref:h.ref,done:!1,asNote:!0,content:h.content};_.push(ue)}}tt.comments=_}}};Pe.push(et())}else Ft=K?ss($,ne,tt=>{const et=y.add({buffer:tt});return et.addReference(V),H.add(et),m.toResourceId(et)},yt):De($,ne,f,P,yt);return Ft},yt={paramMap:q,getRefs:fe,getRef:ae,parsedRefs:ht,onWarning:o,addPerson:O=>null},le=[];let me=0;d.Strings&&(me=parseInt(d.Strings.Unique??d.Strings.length??0));const hs=d.Strings??[];for(let O=0;O<me;O++)le.push(hs[O]?.t??"");const Oe=new Map;let Ie=me;const us=O=>{const U=Oe.get(O);if(U!==void 0)return U;const K=Ie;return Oe.set(O,Ie++),le.push(O),K},ce=(Ut("richstructure",d,f,P,yt),Ut("richdata",d,f,P,yt),new Map),Ve=new Map,Le=Ut("people",d,f,P);let Ct=null;if(Le.size>0&&(Ct=Le.entries().next()?.value?.[1]?.persons,Ct)){const O=Ct.length;for(let U=0;U<O;U++){const K=Ct[U];ce.set(K.id,K),ce.set(K.displayName,K)}}const Te=Ut("themes",d,f,P,yt);let Ne=null;if(Te&&Te.entries){let O=Te.entries().next();O?.value?.[1]&&(Ne=O.value[1])}const ds=new u.tc(Ne);let he=Ut("styles",d,f,P,yt).entries().next()?.value[1];he&&(he=JSON.parse(u.ya(he)));const ps=Ut("workbooks",d,f,P,yt);await Promise.all(Pe);const ye={...ps.entries().next().value[1],styles:he,theme:ds.toJSON()};le.length>0&&(ye.strings=le),Ct&&Ct.length>0&&(ye.people=Ct);const gs={...n,resources:y,json:ye},fs=new u.j1(gs);return H.forEach(O=>{O.deleteReference(V)}),m.endPersist(),fs}catch(d){let P="Unable to parse XLSX.";throw d instanceof u.$e&&(P="Unable to open XLSX. There are too many rows or columns."),new Error(P,{cause:d})}},toBufferXLSX:async(i,t)=>{const s=await Promise.resolve().then(()=>require("./CaWJjQ_KmjWp1ooU.cjs")),o=await i.toJSON(!0),n=s.utils.book_new();for(let a=0;a<o.sheets.length;a++){const c=o.sheets[a],T=s.utils.json_to_sheet([{}]);s.utils.book_append_sheet(n,T,c.name);const S=c.sheet,x=i.getSheetAt(a),w=x.getUsedRange();if(w?(T["!ref"]=w.getA1(),w.forEach((E,b)=>{const d={t:"z"},P=b.getCell().getStyle();if(!P.isNormal()){let f=P.getNumberFormat();f!==u.zt.Type.General&&(f===u.zt.Type.ShortDate?f="m/d/yyyy":f===u.zt.Type.MediumDate?f="d-mmm-yy":f===u.zt.Type.LongDate?f="[$-x-sysdate]dddd, mmmm dd, yyyy":f===u.zt.Type.ShortTime?f="h:mm":f===u.zt.Type.MediumTime?f="h:mm AM/PM":f===u.zt.Type.LongTime&&(f="h:mm:ss AM/PM"),d.z=f)}if(E!==null)switch(b.getType()){case u.X.Number:d.t="n",d.v=E;break;case u.X.String:d.t="s",d.v=E;break;case u.X.Boolean:d.t="b",d.v=E;break;case u.X.Error:d.t="e",d.v=E.toString();case u.X.RichData:}T[b.getA1()]=d})):T["!ref"]="A1:A1",S.merges?.length>0){const E=[];T["!merges"]=E;for(let b=0;b<S.merges.length;b++)E.push(s.utils.decode_range(S.merges[b]))}if(S.cols?.length>0){const E=[];T["!cols"]=E;const b=S.cols,d={width:S.defaultColSize??x.getColumnWidthAsFontUnit(x.getColumnHeaders().getDefaultSize())};for(let P=0;P<b.length;P++){const f=b[P];for(let m=E.length;m<=f.min-1;m++)E.push(d);const y={};f.sz!==void 0&&(y.width=f.sz),f.h!==void 0&&(y.hidden=f.h),f.l!==void 0&&(y.level=f.l);for(let m=f.min;m<=f.max;m++)E.push(y)}}}return s.write(n,{type:"array",bookType:"xlsx"}),s.write(n,{type:"array",bookType:"xlsx"})}},Symbol.toStringTag,{value:"Module"}));exports.a=i=>parseFloat(i)/1e3,exports.b=cs,exports.c=i=>i?u.Tz.roundAccurately(parseFloat(i)/9525,1):null,exports.d=Ee,exports.i=js,exports.p=i=>parseFloat(i)/6e4,exports.r=ls,exports.t=i=>i?u.Tz.roundAccurately(parseFloat(i)/12700,4):null;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.19
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/function v(t){return Array.isArray?Array.isArray(t):Me(t)==="[object Array]"}function L(t){return typeof t=="string"}function Ce(t){return typeof t=="number"}function me(t){return typeof t=="object"}function M(t){return t!=null}function te(t){return!t.trim().length}function Me(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=Object.prototype.hasOwnProperty;class Ie{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(i=>{let n=Fe(i);this._keys.push(n),this._keyMap[n.id]=n,s+=n.weight}),this._keys.forEach(i=>{i.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Fe(t){let e=null,s=null,i=null,n=1,r=null;if(L(t)||v(t))i=t,e=de(t),s=ie(t);else{if(!le.call(t,"name"))throw new Error("Missing name property in key");const u=t.name;if(i=u,le.call(t,"weight")&&(n=t.weight,n<=0))throw new Error(`Property 'weight' in key '${u}' must be a positive integer`);e=de(u),s=ie(u),r=t.getFn}return{path:e,id:s,weight:n,src:i,getFn:r}}function de(t){return v(t)?t:t.split(".")}function ie(t){return v(t)?t.join("."):t}var l={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(t,e){let s=[],i=!1;const n=(r,u,h)=>{if(M(r))if(u[h]){const a=r[u[h]];if(!M(a))return;if(h===u.length-1&&(L(a)||Ce(a)||function(o){return o===!0||o===!1||me(d=o)&&d!==null&&Me(o)=="[object Boolean]";var d}(a)))s.push((c=a)==null?"":function(o){if(typeof o=="string")return o;let d=o+"";return d=="0"&&1/o==-1/0?"-0":d}(c));else if(v(a)){i=!0;for(let o=0,d=a.length;o<d;o+=1)n(a[o],u,h+1)}else u.length&&n(a,u,h+1)}else s.push(r);var c};return n(t,L(e)?e.split("."):e,0),i?s:s[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};const we=/[^ ]+/g;class ce{constructor({getFn:e=l.getFn,fieldNormWeight:s=l.fieldNormWeight}={}){this.norm=function(i=1,n=3){const r=new Map,u=Math.pow(10,n);return{get(h){const c=h.match(we).length;if(r.has(c))return r.get(c);const a=1/Math.pow(c,.5*i),o=parseFloat(Math.round(a*u)/u);return r.set(c,o),o},clear(){r.clear()}}}(s,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,i)=>{this._keysMap[s.id]=i})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,L(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){const s=this.size();L(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,i=this.size();s<i;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!M(e)||te(e))return;let i={v:e,i:s,n:this.norm.get(e)};this.records.push(i)}_addObject(e,s){let i={i:s,$:{}};this.keys.forEach((n,r)=>{let u=n.getFn?n.getFn(e):this.getFn(e,n.path);if(M(u)){if(v(u)){let h=[];const c=[{nestedArrIndex:-1,value:u}];for(;c.length;){const{nestedArrIndex:a,value:o}=c.pop();if(M(o))if(L(o)&&!te(o)){let d={v:o,i:a,n:this.norm.get(o)};h.push(d)}else v(o)&&o.forEach((d,f)=>{c.push({nestedArrIndex:f,value:d})})}i.$[r]=h}else if(L(u)&&!te(u)){let h={v:u,n:this.norm.get(u)};i.$[r]=h}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Ee(t,e,{getFn:s=l.getFn,fieldNormWeight:i=l.fieldNormWeight}={}){const n=new ce({getFn:s,fieldNormWeight:i});return n.setKeys(t.map(Fe)),n.setSources(e),n.create(),n}function X(t,{errors:e=0,currentLocation:s=0,expectedLocation:i=0,distance:n=l.distance,ignoreLocation:r=l.ignoreLocation}={}){const u=e/t.length;if(r)return u;const h=Math.abs(i-s);return n?u+h/n:h?1:u}const z=32;function $e(t){let e={};for(let s=0,i=t.length;s<i;s+=1){const n=t.charAt(s);e[n]=(e[n]||0)|1<<i-s-1}return e}const Y=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):t=>t;class ye{constructor(e,{location:s=l.location,threshold:i=l.threshold,distance:n=l.distance,includeMatches:r=l.includeMatches,findAllMatches:u=l.findAllMatches,minMatchCharLength:h=l.minMatchCharLength,isCaseSensitive:c=l.isCaseSensitive,ignoreDiacritics:a=l.ignoreDiacritics,ignoreLocation:o=l.ignoreLocation}={}){if(this.options={location:s,threshold:i,distance:n,includeMatches:r,findAllMatches:u,minMatchCharLength:h,isCaseSensitive:c,ignoreDiacritics:a,ignoreLocation:o},e=c?e:e.toLowerCase(),e=a?Y(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(g,p)=>{this.chunks.push({pattern:g,alphabet:$e(g),startIndex:p})},f=this.pattern.length;if(f>z){let g=0;const p=f%z,A=f-p;for(;g<A;)d(this.pattern.substr(g,z),g),g+=z;if(p){const m=f-z;d(this.pattern.substr(m),m)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:s,ignoreDiacritics:i,includeMatches:n}=this.options;if(e=s?e:e.toLowerCase(),e=i?Y(e):e,this.pattern===e){let A={isMatch:!0,score:0};return n&&(A.indices=[[0,e.length-1]]),A}const{location:r,distance:u,threshold:h,findAllMatches:c,minMatchCharLength:a,ignoreLocation:o}=this.options;let d=[],f=0,g=!1;this.chunks.forEach(({pattern:A,alphabet:m,startIndex:_})=>{const{isMatch:N,score:w,indices:S}=function(k,$,Le,{location:ke=l.location,distance:J=l.distance,threshold:ve=l.threshold,findAllMatches:_e=l.findAllMatches,minMatchCharLength:he=l.minMatchCharLength,includeMatches:ae=l.includeMatches,ignoreLocation:V=l.ignoreLocation}={}){if($.length>z)throw new Error("Pattern length exceeds max of 32.");const R=$.length,P=k.length,D=Math.max(0,Math.min(ke,P));let O=ve,b=D;const Q=he>1||ae,Z=Q?Array(P):[];let T;for(;(T=k.indexOf($,b))>-1;){let F=X($,{currentLocation:T,expectedLocation:D,distance:J,ignoreLocation:V});if(O=Math.min(F,O),b=T+R,Q){let E=0;for(;E<R;)Z[T+E]=1,E+=1}}b=-1;let U=[],G=1,H=R+P;const Se=1<<R-1;for(let F=0;F<R;F+=1){let E=0,B=H;for(;E<B;)X($,{errors:F,currentLocation:D+B,expectedLocation:D,distance:J,ignoreLocation:V})<=O?E=B:H=B,B=Math.floor((H-E)/2+E);H=B;let j=Math.max(1,D-B+1),y=_e?P:Math.min(D+B,P)+R,x=Array(y+2);x[y+1]=(1<<F)-1;for(let C=y;C>=j;C-=1){let W=C-1,q=Le[k.charAt(W)];if(Q&&(Z[W]=+!!q),x[C]=(x[C+1]<<1|1)&q,F&&(x[C]|=(U[C+1]|U[C])<<1|1|U[C+1]),x[C]&Se&&(G=X($,{errors:F,currentLocation:W,expectedLocation:D,distance:J,ignoreLocation:V}),G<=O)){if(O=G,b=W,b<=D)break;j=Math.max(1,2*D-b)}}if(X($,{errors:F+1,currentLocation:D,expectedLocation:D,distance:J,ignoreLocation:V})>O)break;U=x}const ee={isMatch:b>=0,score:Math.max(.001,G)};if(Q){const F=function(E=[],B=l.minMatchCharLength){let j=[],y=-1,x=-1,C=0;for(let W=E.length;C<W;C+=1){let q=E[C];q&&y===-1?y=C:q||y===-1||(x=C-1,x-y+1>=B&&j.push([y,x]),y=-1)}return E[C-1]&&C-y>=B&&j.push([y,C-1]),j}(Z,he);F.length?ae&&(ee.indices=F):ee.isMatch=!1}return ee}(e,A,m,{location:r+_,distance:u,threshold:h,findAllMatches:c,minMatchCharLength:a,includeMatches:n,ignoreLocation:o});N&&(g=!0),f+=w,N&&S&&(d=[...d,...S])});let p={isMatch:g,score:g?f/this.chunks.length:1};return g&&n&&(p.indices=d),p}}class I{constructor(e){this.pattern=e}static isMultiMatch(e){return ge(e,this.multiRegex)}static isSingleMatch(e){return ge(e,this.singleRegex)}search(){}}function ge(t,e){const s=t.match(e);return s?s[1]:null}class De extends I{constructor(e,{location:s=l.location,threshold:i=l.threshold,distance:n=l.distance,includeMatches:r=l.includeMatches,findAllMatches:u=l.findAllMatches,minMatchCharLength:h=l.minMatchCharLength,isCaseSensitive:c=l.isCaseSensitive,ignoreDiacritics:a=l.ignoreDiacritics,ignoreLocation:o=l.ignoreLocation}={}){super(e),this._bitapSearch=new ye(e,{location:s,threshold:i,distance:n,includeMatches:r,findAllMatches:u,minMatchCharLength:h,isCaseSensitive:c,ignoreDiacritics:a,ignoreLocation:o})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Be extends I{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s,i=0;const n=[],r=this.pattern.length;for(;(s=e.indexOf(this.pattern,i))>-1;)i=s+r,n.push([s,i-1]);const u=!!n.length;return{isMatch:u,score:u?0:1,indices:n}}}const ne=[class extends I{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},Be,class extends I{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends I{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends I{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends I{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends I{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=t.indexOf(this.pattern)===-1;return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},De],fe=ne.length,be=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Ne=new Set([De.type,Be.type]),re=[];function ue(t,e){for(let s=0,i=re.length;s<i;s+=1){let n=re[s];if(n.condition(t,e))return new n(t,e)}return new ye(t,e)}const oe="$and",Ae="$path",se=t=>!(!t[oe]&&!t.$or),pe=t=>({[oe]:Object.keys(t).map(e=>({[e]:t[e]}))});function xe(t,e,{auto:s=!0}={}){const i=n=>{let r=Object.keys(n);const u=!!n[Ae];if(!u&&r.length>1&&!se(n))return i(pe(n));if((c=>!v(c)&&me(c)&&!se(c))(n)){const c=u?n[Ae]:r[0],a=u?n.$val:n[c];if(!L(a))throw new Error(`Invalid value for key ${c}`);const o={keyId:ie(c),pattern:a};return s&&(o.searcher=ue(a,e)),o}let h={children:[],operator:r[0]};return r.forEach(c=>{const a=n[c];v(a)&&a.forEach(o=>{h.children.push(i(o))})}),h};return se(t)||(t=pe(t)),i(t)}function Re(t,e){const s=t.matches;e.matches=[],M(s)&&s.forEach(i=>{if(!M(i.indices)||!i.indices.length)return;const{indices:n,value:r}=i;let u={indices:n,value:r};i.key&&(u.key=i.key.src),i.idx>-1&&(u.refIndex=i.idx),e.matches.push(u)})}function Oe(t,e){e.score=t.score}class K{constructor(e,s={},i){this.options={...l,...s},this.options.useExtendedSearch,this._keyStore=new Ie(this.options.keys),this.setCollection(e,i)}setCollection(e,s){if(this._docs=e,s&&!(s instanceof ce))throw new Error("Incorrect 'index' type");this._myIndex=s||Ee(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){M(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const s=[];for(let i=0,n=this._docs.length;i<n;i+=1){const r=this._docs[i];e(r,i)&&(this.removeAt(i),i-=1,n-=1,s.push(r))}return s}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:s=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:r,sortFn:u,ignoreFieldNorm:h}=this.options;let c=L(e)?L(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(a,{ignoreFieldNorm:o=l.ignoreFieldNorm}){a.forEach(d=>{let f=1;d.matches.forEach(({key:g,norm:p,score:A})=>{const m=g?g.weight:null;f*=Math.pow(A===0&&m?Number.EPSILON:A,(m||1)*(o?1:p))}),d.score=f})}(c,{ignoreFieldNorm:h}),r&&c.sort(u),Ce(s)&&s>-1&&(c=c.slice(0,s)),function(a,o,{includeMatches:d=l.includeMatches,includeScore:f=l.includeScore}={}){const g=[];return d&&g.push(Re),f&&g.push(Oe),a.map(p=>{const{idx:A}=p,m={item:o[A],refIndex:A};return g.length&&g.forEach(_=>{_(p,m)}),m})}(c,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const s=ue(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:r,i:u,n:h})=>{if(!M(r))return;const{isMatch:c,score:a,indices:o}=s.searchIn(r);c&&n.push({item:r,idx:u,matches:[{score:a,value:r,norm:h,indices:o}]})}),n}_searchLogical(e){const s=xe(e,this.options),i=(h,c,a)=>{if(!h.children){const{keyId:d,searcher:f}=h,g=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(c,d),searcher:f});return g&&g.length?[{idx:a,item:c,matches:g}]:[]}const o=[];for(let d=0,f=h.children.length;d<f;d+=1){const g=h.children[d],p=i(g,c,a);if(p.length)o.push(...p);else if(h.operator===oe)return[]}return o},n=this._myIndex.records,r={},u=[];return n.forEach(({$:h,i:c})=>{if(M(h)){let a=i(s,h,c);a.length&&(r[c]||(r[c]={idx:c,item:h,matches:[]},u.push(r[c])),a.forEach(({matches:o})=>{r[c].matches.push(...o)}))}}),u}_searchObjectList(e){const s=ue(e,this.options),{keys:i,records:n}=this._myIndex,r=[];return n.forEach(({$:u,i:h})=>{if(!M(u))return;let c=[];i.forEach((a,o)=>{c.push(...this._findMatches({key:a,value:u[o],searcher:s}))}),c.length&&r.push({idx:h,item:u,matches:c})}),r}_findMatches({key:e,value:s,searcher:i}){if(!M(s))return[];let n=[];if(v(s))s.forEach(({v:r,i:u,n:h})=>{if(!M(r))return;const{isMatch:c,score:a,indices:o}=i.searchIn(r);c&&n.push({score:a,key:e,value:r,idx:u,norm:h,indices:o})});else{const{v:r,n:u}=s,{isMatch:h,score:c,indices:a}=i.searchIn(r);h&&n.push({score:c,key:e,value:r,norm:u,indices:a})}return n}}K.version="7.1.0",K.createIndex=Ee,K.parseIndex=function(t,{getFn:e=l.getFn,fieldNormWeight:s=l.fieldNormWeight}={}){const{keys:i,records:n}=t,r=new ce({getFn:e,fieldNormWeight:s});return r.setKeys(i),r.setIndexRecords(n),r},K.config=l,K.parseQuery=xe,function(...t){re.push(...t)}(class{constructor(t,{isCaseSensitive:e=l.isCaseSensitive,ignoreDiacritics:s=l.ignoreDiacritics,includeMatches:i=l.includeMatches,minMatchCharLength:n=l.minMatchCharLength,ignoreLocation:r=l.ignoreLocation,findAllMatches:u=l.findAllMatches,location:h=l.location,threshold:c=l.threshold,distance:a=l.distance}={}){this.query=null,this.options={isCaseSensitive:e,ignoreDiacritics:s,includeMatches:i,minMatchCharLength:n,findAllMatches:u,ignoreLocation:r,location:h,threshold:c,distance:a},t=e?t:t.toLowerCase(),t=s?Y(t):t,this.pattern=t,this.query=function(o,d={}){return o.split("|").map(f=>{let g=f.trim().split(be).filter(A=>A&&!!A.trim()),p=[];for(let A=0,m=g.length;A<m;A+=1){const _=g[A];let N=!1,w=-1;for(;!N&&++w<fe;){const S=ne[w];let k=S.isMultiMatch(_);k&&(p.push(new S(k,d)),N=!0)}if(!N)for(w=-1;++w<fe;){const S=ne[w];let k=S.isSingleMatch(_);if(k){p.push(new S(k,d));break}}}return p})}(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:i,ignoreDiacritics:n}=this.options;t=i?t:t.toLowerCase(),t=n?Y(t):t;let r=0,u=[],h=0;for(let c=0,a=e.length;c<a;c+=1){const o=e[c];u.length=0,r=0;for(let d=0,f=o.length;d<f;d+=1){const g=o[d],{isMatch:p,indices:A,score:m}=g.search(t);if(!p){h=0,r=0,u.length=0;break}if(r+=1,h+=m,s){const _=g.constructor.type;Ne.has(_)?u=[...u,...A]:u.push(A)}}if(r){let d={isMatch:!0,score:h/r};return s&&(d.indices=u),d}}return{isMatch:!1,score:1}}}),exports.default=K;
|