@sheetxl/studio-mui 0.4.12 → 0.4.14
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/-zKDSjn55SCvCwk8.cjs +6 -0
- package/browser/cjs/AoLA7tfyPshG_mKt.cjs +6 -0
- package/browser/cjs/As7uhSEgY8VJ3I6f.cjs +90 -0
- package/browser/cjs/B1Eaz6PFZAmrWiyY.cjs +6 -0
- package/browser/cjs/B8ZfZXhvW4sSKKZs.cjs +42 -0
- package/browser/cjs/BAfNSJo7fktzFVJd.cjs +11 -0
- package/browser/cjs/BH0v7IIykugrFxaT.cjs +6 -0
- package/browser/cjs/BUwmvmcdC0xBQ97L.cjs +145 -0
- package/browser/cjs/BiBEmbWoJHdOB1li.cjs +12 -0
- package/browser/cjs/BkVtS9FZxWYNmrbU.cjs +6 -0
- package/browser/cjs/Bmifo5y7ZMJolUTY.cjs +15 -0
- package/browser/cjs/BpLu9-spCLcAFdwd.cjs +6 -0
- package/browser/cjs/BqOg0z4HGrbNaL1k.cjs +6 -0
- package/browser/cjs/C6Fk0jGWAOED60yf.cjs +161 -0
- package/browser/cjs/CRvxop0QcZL23Akb.cjs +6 -0
- package/browser/cjs/CS5USjyVh8DwPSri.cjs +7 -0
- package/browser/cjs/Chz3K3Qt8M2FNJwI.cjs +12 -0
- package/browser/cjs/D2gy3JDrJyGAMqsl.cjs +7 -0
- package/browser/cjs/DD8-ZSDUkRqk7l6y.cjs +11 -0
- package/browser/cjs/DNL88d5PGwk92LeD.cjs +6 -0
- package/browser/cjs/DTHMIHonHaHeJ0o1.cjs +18 -0
- package/browser/cjs/DZ8WTAzF6V2Tw1tW.cjs +6 -0
- package/browser/cjs/W7LR70ajtjR9Lmvl.cjs +6 -0
- package/browser/cjs/XGmQ2kUHM2qQkG1r.cjs +16 -0
- package/browser/cjs/d2jsgbPdf35xArnn.cjs +6 -0
- package/browser/cjs/index.cjs +4 -10
- package/browser/esm/4fzdzYhVH9eIXv-E.mjs +2410 -0
- package/browser/esm/B-rZWEIXFvB2W_mP.mjs +84 -0
- package/browser/esm/C4ORm_Up6Zxt92F_.mjs +1672 -0
- package/browser/esm/C5OCdRxcYIZViFzN.mjs +13391 -0
- package/browser/esm/C8po4rRYJ8127Rgb.mjs +44 -0
- package/browser/esm/CB7vnn7AtsGma4R6.mjs +3803 -0
- package/browser/esm/CBQZHZlKIiEz186r.mjs +2251 -0
- package/browser/esm/CCwOCTrf9Bira1-Y.mjs +424 -0
- package/browser/esm/CHovQU_R4AuKULmT.mjs +392 -0
- package/browser/esm/CIH3ADFJJmUiyA8p.mjs +864 -0
- package/browser/esm/CQiALmsycGGLFj1o.mjs +25 -0
- package/browser/esm/CS6uJp7phBvUmos6.mjs +1467 -0
- package/browser/esm/CSKgHJSTMvOEe2RH.mjs +19981 -0
- package/browser/esm/CYG1vk4AMMwqsul7.mjs +1366 -0
- package/browser/esm/ClmlhDf-0RC5GFV3.mjs +52 -0
- package/browser/esm/CmAnpd_SOxQuTQRL.mjs +1703 -0
- package/browser/esm/DWy4L2usallW0WdU.mjs +153 -0
- package/browser/esm/Dc1PmtvbeqsIQHq6.mjs +48 -0
- package/browser/esm/DgKsUQMTThBdEQds.mjs +59 -0
- package/browser/esm/Dk00kGaRJxiitO5-.mjs +23 -0
- package/browser/esm/FdSIHwC_mNRZpcgJ.mjs +43 -0
- package/browser/esm/Ks946bL2vmd4m743.mjs +52 -0
- package/browser/esm/TlZOl3Gt-d0Nc2a8.mjs +46 -0
- package/browser/esm/_FvE2-K7MOW_qWVS.mjs +1352 -0
- package/browser/esm/index.mjs +83 -8
- package/browser/esm/vgS9ixFRuZrPx6vq.mjs +640 -0
- package/licenses/dependencies.txt +134 -134
- package/node/esm/{B3M2CzPvK2oKOfg5.mjs → 762kbapO408ejsVC.mjs} +2 -2
- package/node/esm/{CryVonGjJnmo2dE_.mjs → B0gJGF9-J3L5yBEW.mjs} +5 -5
- package/node/esm/{CBGAl2mih9mHDt5w.mjs → BR9YJuwMP9nTMBE-.mjs} +1 -1
- package/node/esm/{D1xD8cOQDGcbjIlG.mjs → BTNBRzW8ZZbJY4GL.mjs} +1 -1
- package/node/esm/{C2P_M1JNT_WZZN3H.mjs → Bgtg4I8EL4M776SY.mjs} +8 -8
- package/node/esm/{DUfB1ollhqU-JIk5.mjs → Bi5br6yrYZqhLEiY.mjs} +4 -4
- package/node/esm/{M3UB6IrhVERZziiJ.mjs → CCygt4zw40-jO57G.mjs} +2 -2
- package/node/esm/{m8fyd2BoYkTOJlc1.mjs → CTpkd2r1aBS5d0yl.mjs} +1 -1
- package/node/esm/{kHsChOtl8GUkzj5Q.mjs → CY1qC_sXGD6av4yO.mjs} +2 -2
- package/node/esm/{Dx2vq1Hdt4pqmOF-.mjs → CZoMFCKJudiTl_Tf.mjs} +2 -2
- package/node/esm/{kIQFLB3nmEJdn_OT.mjs → CzWLA_IQgFbENkMq.mjs} +1 -1
- package/node/esm/{BJY8yNMmN_yyRtIG.mjs → D1GfRQ1jyFg-wmLD.mjs} +1 -1
- package/node/esm/{D1C8ifsmXsypL6pp.mjs → DC2dPUCWVgxEKzaS.mjs} +13 -13
- package/node/esm/{Bj8uU2shfkvN4LnE.mjs → DOUP6ynjlQE-UEJs.mjs} +6 -6
- package/node/esm/{BIRLX0-9t62Lqats.mjs → DUqIYzvmrCd67Dpx.mjs} +2 -2
- package/node/esm/{CVGxETc4rIE1gNAH.mjs → DWCxF-chq5dVi363.mjs} +38 -38
- package/node/esm/{Bt5y5wVaVAVjwHBl.mjs → DghPySv_2Ts78czJ.mjs} +1 -1
- package/node/esm/{PF5CCBvapZxEzc7k.mjs → DrujinnhlNDCosqb.mjs} +1 -1
- package/node/esm/DsD7O5j2cXyaECkB.mjs +313 -0
- package/node/esm/{wdtYNTNCynMMS4_P.mjs → VHY56h6xqQcPba6u.mjs} +1 -1
- package/node/esm/{h1y2hBFecTqRgUa-.mjs → dlEq3vDkIERtTn7Y.mjs} +25 -25
- package/node/esm/index.mjs +4999 -5264
- package/node/esm/{CKtVB9hMCfabQMxC.mjs → yB8OTWhDomxUy_SX.mjs} +2 -2
- package/node/esm/{bv_GA6NGCT0sJaXy.mjs → yP0whgIwVZApluLw.mjs} +2 -2
- package/package.json +8 -8
- package/types/index.d.ts +0 -11
- package/browser/cjs/B7qLzxylqOaybl3H.cjs +0 -7
- package/browser/cjs/BNGixOiIsu8jZlvn.cjs +0 -7
- package/browser/cjs/BUYxt7KgFkIIIMyc.cjs +0 -7
- package/browser/cjs/Bk6VhhWsnCRyBu2F.cjs +0 -7
- package/browser/cjs/BpiMMYip132x0r1O.cjs +0 -7
- package/browser/cjs/ByZ_Q-J7jgF7AoWR.cjs +0 -7
- package/browser/cjs/BzD7LV8VmFKLAJyW.cjs +0 -7
- package/browser/cjs/C6_zcNM0Efa11KEE.cjs +0 -7
- package/browser/cjs/C8Azx_ZaQa4WvAtR.cjs +0 -7
- package/browser/cjs/CITvaW7L_iZfIyAN.cjs +0 -7
- package/browser/cjs/CNDDYOoLCrGsUMYL.cjs +0 -7
- package/browser/cjs/CYbeY5OVZDqHGSOm.cjs +0 -7
- package/browser/cjs/C_SgucbRn-v9IkNO.cjs +0 -7
- package/browser/cjs/CeTd2nFbE5yFzf7T.cjs +0 -7
- package/browser/cjs/Cfe7IbPNI8-CgoDI.cjs +0 -7
- package/browser/cjs/Ctyk-ajkSsTDJuvY.cjs +0 -7
- package/browser/cjs/DBhTQLbjAtU-A1YA.cjs +0 -7
- package/browser/cjs/Dc2rbOjtcmSIm8D4.cjs +0 -7
- package/browser/cjs/DcsvUmoS8zGG5GB8.cjs +0 -7
- package/browser/cjs/DqAlQQIZIyF7HMib.cjs +0 -7
- package/browser/cjs/DuwawlAm4aRBNTBm.cjs +0 -7
- package/browser/cjs/Dx9UUJj-yeubDjm4.cjs +0 -7
- package/browser/cjs/IC19hB4Ntvw1158j.cjs +0 -7
- package/browser/cjs/reQ9miE5C5qMfbRJ.cjs +0 -7
- package/browser/esm/B1Ey4ZP8BHUzHW7G.mjs +0 -7
- package/browser/esm/B8dJHVZJta8QbNKG.mjs +0 -7
- package/browser/esm/BThbC01mtb7qq8_A.mjs +0 -7
- package/browser/esm/Bnt1M91BRyMvXrc4.mjs +0 -7
- package/browser/esm/BqN0SYrEO0RZQtv-.mjs +0 -7
- package/browser/esm/CHPXsEre3jry2-jF.mjs +0 -7
- package/browser/esm/CMCOU0nDlymDFS9l.mjs +0 -7
- package/browser/esm/Cc7y1nMDr5J8jWx-.mjs +0 -7
- package/browser/esm/CesL-3BNbMB1f_if.mjs +0 -7
- package/browser/esm/CfvNSnuQLa1SPbNL.mjs +0 -7
- package/browser/esm/CloqVDbJmTL4oFek.mjs +0 -7
- package/browser/esm/Cta0yn5UIrP2UoT4.mjs +0 -7
- package/browser/esm/CwRyQHiDoBLx5_1g.mjs +0 -7
- package/browser/esm/DI-ZGstUJFwkx4H6.mjs +0 -7
- package/browser/esm/DQTfmweCXjuIlITn.mjs +0 -7
- package/browser/esm/DUIfOO25d1fqtJzn.mjs +0 -7
- package/browser/esm/DhOXsRr8c7bDS1jM.mjs +0 -7
- package/browser/esm/JPwh2m5-pXkdPVzF.mjs +0 -7
- package/browser/esm/UkNAvQj0NVgeMpUl.mjs +0 -7
- package/browser/esm/ZUfck_LDsQb9gpvU.mjs +0 -7
- package/browser/esm/gHhqkr52cxXkga0T.mjs +0 -7
- package/browser/esm/obM68UOvA5HV7Lt1.mjs +0 -7
- package/browser/esm/x9MyDRdLE47dI9dF.mjs +0 -7
- package/browser/esm/yW9jxnamUqAhVQkJ.mjs +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.12
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{NumberFormat as t,ScalarType as e,ResourceCollection as s,Tuple as i,IAutoFilter as o,AddressUtils as r,CommonUtils as n,Theme as a,JSONStableStringify as l,Workbook as c,IColor as h,CoordUtils as u,IRange as d,OutOfBoundsError as p,FormulaError as g}from"@sheetxl/sdk";import{e as f}from"./Cc7y1nMDr5J8jWx-.mjs";const m=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",T=new RegExp(`^[${m}][-${m}.0-9·̀-ͯ‿-⁀]*$`,"u");function y(t){return t>=65&&t<=90||t>=97&&t<=122||58===t||95===t||8204===t||8205===t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}const b="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",x=new RegExp(`^[${b}][-${b}.0-9·̀-ͯ‿-⁀]*$`,"u");function w(t){return t>=65&&t<=90||95===t||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}const v=function(t){return 32===t||10===t||13===t||9===t},S=function(t){return t>=32&&t<=55295||10===t||13===t||9===t||t>=57344&&t<=65533||t>=65536&&t<=1114111},C=y,k=function(t){return y(t)||t>=48&&t<=57||45===t||46===t||183===t||t>=768&&t<=879||t>=8255&&t<=8256},A=[32,10,13,9],D=T,E=function(t){return t>=1&&t<=55295||t>=57344&&t<=65533||t>=65536&&t<=1114111},P=w,O=function(t){return w(t)||45===t||46===t||t>=48&&t<=57||183===t||t>=768&&t<=879||t>=8255&&t<=8256},I=x,V="http://www.w3.org/XML/1998/namespace",L="http://www.w3.org/2000/xmlns/",N={__proto__:null,xml:V,xmlns:L},R={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},$=-1,M=-2,j=13,H=33,F=10,X=60,B=61,W=62,_=63,q=93,z=t=>34===t||39===t,U=[34,39],G=[...U,91,W],Z=[...U,X,q],Q=[B,_,...A],J=[...A,W,38,X];function K(t,e,s){switch(e){case"xml":s!==V&&t.fail(`xml prefix must be bound to ${V}.`);break;case"xmlns":s!==L&&t.fail(`xmlns prefix must be bound to ${L}.`)}switch(s){case L:t.fail(""===e?`the default namespace may not be set to ${s}.`:`may not assign a prefix (even "xmlns") to the URI ${L}.`);break;case V:switch(e){case"xml":break;case"":t.fail(`the default namespace may not be set to ${s}.`);break;default:t.fail("may not assign the xml namespace to another prefix.")}}}const Y=t=>I.test(t),tt=t=>D.test(t),et={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 st{constructor(t){this.i=0,this.prevI=0,this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;const e=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=!1!==this.opt.position,this.fileName=this.opt.fileName,e){this.nameStartCheck=P,this.nameCheck=O,this.isName=Y,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns={__proto__:null,...N};const t=this.opt.additionalNamespaces;null!=t&&(function(t,e){for(const s of Object.keys(e))K(t,s,e[s])}(this,t),Object.assign(this.ns,t))}else this.nameStartCheck=C,this.nameCheck=k,this.isName=tt,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?j:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:e}=this.opt;if(void 0===e){if(!0===this.opt.forceXMLVersion)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");e="1.0"}this.setXMLVersion(e),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(R),this.readyHandler?.()}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,e){this[et[t]]=e}off(t){this[et[t]]=void 0}makeError(t){let e=this.fileName??"";return this.trackPosition&&(e.length>0&&(e+=":"),e+=`${this.line}:${this.column}`),e.length>0&&(e+=": "),new Error(e+t)}fail(t){const e=this.makeError(t),s=this.errorHandler;if(void 0===s)throw e;return s(e),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let e=!1;null===t?(e=!0,t=""):"object"==typeof t&&(t=t.toString()),void 0!==this.carriedFromPrevious&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let s=t.length;const i=t.charCodeAt(s-1);!e&&(13===i||i>=55296&&i<=56319)&&(this.carriedFromPrevious=t[s-1],s--,t=t.slice(0,s));const{stateTable:o}=this;for(this.chunk=t,this.i=0;this.i<s;)o[this.state].call(this);return this.chunkPosition+=s,e?this.end():this}close(){return this.write(null)}getCode10(){const t=this.chunk,e=this.i;if(this.prevI=e,this.i++,e>=t.length)return $;const s=t.charCodeAt(e);if(this.column++,s<55296){if(s>=32||9===s)return s;switch(s){case F:return this.line++,this.column=0,this.positionAtNewLine=this.position,F;case 13:return t.charCodeAt(e+1)===F&&(this.i=e+2),this.line++,this.column=0,this.positionAtNewLine=this.position,M;default:return this.fail("disallowed character."),s}}if(s>56319)return s>=57344&&s<=65533||this.fail("disallowed character."),s;const i=65536+1024*(s-55296)+(t.charCodeAt(e+1)-56320);return this.i=e+2,i>1114111&&this.fail("disallowed character."),i}getCode11(){const{chunk:t,i:e}=this;if(this.prevI=e,this.i=e+1,e>=t.length)return $;const s=t.charCodeAt(e);if(this.column++,s<55296){if(s>31&&s<127||s>159&&8232!==s||9===s)return s;switch(s){case F:return this.line++,this.column=0,this.positionAtNewLine=this.position,F;case 13:{const s=t.charCodeAt(e+1);s!==F&&133!==s||(this.i=e+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,M;default:return this.fail("disallowed character."),s}}if(s>56319)return s>=57344&&s<=65533||this.fail("disallowed character."),s;const i=65536+1024*(s-55296)+(t.charCodeAt(e+1)-56320);return this.i=e+2,i>1114111&&this.fail("disallowed character."),i}getCodeNorm(){const t=this.getCode();return t===M?F:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:e}=this;const{chunk:s}=this;for(;;){const i=this.getCode(),o=i===M,r=o?F:i;if(r===$||t.includes(r))return this.text+=s.slice(e,this.prevI),r;o&&(this.text+=`${s.slice(e,this.prevI)}\n`,e=this.i)}}captureToChar(t){let{i:e}=this;const{chunk:s}=this;for(;;){let i=this.getCode();switch(i){case M:this.text+=`${s.slice(e,this.prevI)}\n`,e=this.i,i=F;break;case $:return this.text+=s.slice(e),!1}if(i===t)return this.text+=s.slice(e,this.prevI),!0}}captureNameChars(){const{chunk:t,i:e}=this;for(;;){const s=this.getCode();if(s===$)return this.name+=t.slice(e),$;if(!k(s))return this.name+=t.slice(e,this.prevI),s===M?F:s}}skipSpaces(){for(;;){const t=this.getCodeNorm();if(t===$||!v(t))return t}}setXMLVersion(t){this.currentXMLVersion=t,"1.0"===t?(this.isChar=S,this.getCode=this.getCode10):(this.isChar=E,this.getCode=this.getCode11)}sBegin(){65279===this.chunk.charCodeAt(0)&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){const t=this.i,e=this.skipSpaces();switch(this.prevI!==t&&(this.xmlDeclPossible=!1),e){case X:if(this.state=15,0!==this.text.length)throw new Error("no-empty text at start");break;case $:break;default:this.unget(),this.state=j,this.xmlDeclPossible=!1}}sDoctype(){const t=this.captureTo(G);switch(t){case W:this.doctypeHandler?.(this.text),this.text="",this.state=j,this.doctype=!0;break;case $:break;default:this.text+=String.fromCodePoint(t),91===t?this.state=4:z(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(Z);t!==$&&(this.text+=String.fromCodePoint(t),t===q?this.state=2:t===X?this.state=6:z(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 _:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){const t=String.fromCodePoint(this.getCodeNorm()),e=this.openWakaBang+=t;this.text+=t,"-"!==e&&(this.state="--"===e?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=45===t?10:8}sDTDCommentEnded(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===W?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(_)&&(this.text+="?",this.state=12)}sDTDPIEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===W&&(this.state=4)}sText(){0!==this.tags.length?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:t}=this;const{chunk:e}=this;t:for(;;)switch(this.getCode()){case M:this.entity+=`${e.slice(t,this.prevI)}\n`,t=this.i;break;case 59:{const{entityReturnState:s}=this,i=this.entity+e.slice(t,this.prevI);let o;this.state=s,""===i?(this.fail("empty entity name."),o="&;"):(o=this.parseEntity(i),this.entity=""),s===j&&void 0===this.textHandler||(this.text+=o);break t}case $:this.entity+=e.slice(t);break t}}sOpenWaka(){const t=this.getCode();if(C(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 _:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=j,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();45===t?(this.state=19,this.commentHandler?.(this.text),this.text=""):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){const t=this.getCodeNorm();t!==W?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(t)}`,this.state=17):this.state=j}sCData(){this.captureToChar(q)&&(this.state=21)}sCDataEnding(){const t=this.getCodeNorm();t===q?this.state=22:(this.text+=`]${String.fromCodePoint(t)}`,this.state=20)}sCDataEnding2(){const t=this.getCodeNorm();switch(t){case W:this.cdataHandler?.(this.text),this.text="",this.state=j;break;case q: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===_||v(t)?(this.fail("processing instruction without a target."),this.state=t===_?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(t),this.state=24)}sPIRest(){const{chunk:t,i:e}=this;for(;;){const s=this.getCodeNorm();if(s===$)return void(this.piTarget+=t.slice(e));if(!this.nameCheck(s)){this.piTarget+=t.slice(e,this.prevI);const i=s===_;i||v(s)?"xml"===this.piTarget?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=i?H:27):this.state=i?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(s));break}}}sPIBody(){if(0===this.text.length){const t=this.getCodeNorm();t===_?this.state=26:v(t)||(this.text=String.fromCodePoint(t))}else this.captureToChar(_)&&(this.state=26)}sPIEnding(){const t=this.getCodeNorm();if(t===W){const{piTarget:t}=this;"xml"===t.toLowerCase()&&this.fail("the XML declaration must appear at the start of the document."),this.piHandler?.({target:t,body:this.text}),this.piTarget=this.text="",this.state=j}else t===_?this.text+="?":(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const t=this.skipSpaces();t!==_?t!==$&&(this.state=28,this.name=String.fromCodePoint(t)):this.state=H}sXMLDeclName(){const t=this.captureTo(Q);if(t===_)return this.state=H,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(v(t)||t===B){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===B?30:29}}sXMLDeclEq(){const t=this.getCodeNorm();if(t===_)return this.state=H,void this.fail("XML declaration is incomplete.");v(t)||(t!==B&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){const t=this.getCodeNorm();if(t===_)return this.state=H,void this.fail("XML declaration is incomplete.");v(t)||(z(t)?this.q=t:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){const t=this.captureTo([this.q,_]);if(t===_)return this.state=H,this.text="",void this.fail("XML declaration is incomplete.");if(t===$)return;const e=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const t=e;this.xmlDecl.version=t,/^1\.[0-9]+$/.test(t)?this.opt.forceXMLVersion||this.setXMLVersion(t):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(e)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=e;break;case"standalone":"yes"!==e&&"no"!==e&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=e}this.name="",this.state=32}sXMLDeclSeparator(){const t=this.getCodeNorm();t!==_?(v(t)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=H}sXMLDeclEnding(){this.getCodeNorm()===W?("xml"!==this.piTarget?this.fail("processing instructions are not allowed before root."):"version"!==this.name&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),this.xmldeclHandler?.(this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=j):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){const t=this.captureNameChars();if(t===$)return;const e=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=e.ns=Object.create(null)),this.openTagStartHandler?.(e),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),t){case W:this.openTag();break;case 47:this.state=35;break;default:v(t)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){this.getCode()===W?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){const t=this.skipSpaces();t!==$&&(C(t)?(this.unget(),this.state=37):t===W?this.openTag():47===t?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){const t=this.captureNameChars();t===B?this.state=39:v(t)?this.state=38:t===W?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):t!==$&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const t=this.skipSpaces();switch(t){case $:return;case B:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",t===W?this.openTag():C(t)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){const t=this.getCodeNorm();z(t)?(this.q=t,this.state=40):v(t)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){const{q:t,chunk:e}=this;let{i:s}=this;for(;;)switch(this.getCode()){case t:return this.pushAttrib(this.name,this.text+e.slice(s,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=e.slice(s,this.prevI),this.state=14,void(this.entityReturnState=40);case F:case M:case 9:this.text+=`${e.slice(s,this.prevI)} `,s=this.i;break;case X:return this.text+=e.slice(s,this.prevI),void this.fail("disallowed character.");case $:return void(this.text+=e.slice(s))}}sAttribValueClosed(){const t=this.getCodeNorm();v(t)?this.state=36:t===W?this.openTag():47===t?this.state=35:C(t)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const t=this.captureTo(J);switch(t){case 38:this.state=14,this.entityReturnState=42;break;case X:this.fail("disallowed character.");break;case $: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===W?this.openTag():this.state=36}}sCloseTag(){const t=this.captureNameChars();t===W?this.closeTag():v(t)?this.state=44:t!==$&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case W:this.closeTag();break;case $:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:t,forbiddenState:e}=this;const{chunk:s,textHandler:i}=this;t:for(;;)switch(this.getCode()){case X:if(this.state=15,void 0!==i){const{text:e}=this,o=s.slice(t,this.prevI);0!==e.length?(i(e+o),this.text=""):0!==o.length&&i(o)}e=0;break t;case 38:this.state=14,this.entityReturnState=j,void 0!==i&&(this.text+=s.slice(t,this.prevI)),e=0;break t;case q:switch(e){case 0:e=1;break;case 1:e=2;break;case 2:break;default:throw new Error("impossible state")}break;case W:2===e&&this.fail('the string "]]>" is disallowed in char data.'),e=0;break;case M:void 0!==i&&(this.text+=`${s.slice(t,this.prevI)}\n`),t=this.i,e=0;break;case $:void 0!==i&&(this.text+=s.slice(t));break t;default:e=0}this.forbiddenState=e}handleTextOutsideRoot(){let{i:t}=this;const{chunk:e,textHandler:s}=this;let i=!1;t:for(;;){const o=this.getCode();switch(o){case X:if(this.state=15,void 0!==s){const{text:i}=this,o=e.slice(t,this.prevI);0!==i.length?(s(i+o),this.text=""):0!==o.length&&s(o)}break t;case 38:this.state=14,this.entityReturnState=j,void 0!==s&&(this.text+=e.slice(t,this.prevI)),i=!0;break t;case M:void 0!==s&&(this.text+=`${e.slice(t,this.prevI)}\n`),t=this.i;break;case $:void 0!==s&&(this.text+=e.slice(t));break t;default:v(o)||(i=!0)}}i&&(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,e){const{prefix:s,local:i}=this.qname(t),o={name:t,prefix:s,local:i,value:e};if(this.attribList.push(o),this.attributeHandler?.(o),"xmlns"===s){const t=e.trim();"1.0"===this.currentXMLVersion&&""===t&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[i]=t,K(this,i,t)}else if("xmlns"===t){const t=e.trim();this.topNS[""]=t,K(this,"",t)}}pushAttribPlain(t,e){const s={name:t,value:e};this.attribList.push(s),this.attributeHandler?.(s)}end(){this.sawRoot||this.fail("document must contain a root element.");const{tags:t}=this;for(;t.length>0;){const e=t.pop();this.fail(`unclosed tag: ${e.name}`)}0!==this.state&&this.state!==j&&this.fail("unexpected end.");const{text:e}=this;return 0!==e.length&&(this.textHandler?.(e),this.text=""),this._closed=!0,this.endHandler?.(),this._init(),this}resolve(t){let e=this.topNS[t];if(void 0!==e)return e;const{tags:s}=this;for(let i=s.length-1;i>=0;i--)if(e=s[i].ns[t],void 0!==e)return e;return e=this.ns[t],void 0!==e?e:this.opt.resolvePrefix?.(t)}qname(t){const e=t.indexOf(":");if(-1===e)return{prefix:"",local:t};const s=t.slice(e+1),i=t.slice(0,e);return(""===i||""===s||s.includes(":"))&&this.fail(`malformed name: ${t}.`),{prefix:i,local:s}}processAttribsNS(){const{attribList:t}=this,e=this.tag;{const{prefix:t,local:s}=this.qname(e.name);e.prefix=t,e.local=s;const i=e.uri=this.resolve(t)??"";""!==t&&("xmlns"===t&&this.fail('tags may not have "xmlns" as prefix.'),""===i&&(this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`),e.uri=t))}if(0===t.length)return;const{attributes:s}=e,i=new Set;for(const e of t){const{name:t,prefix:o,local:r}=e;let n,a;""===o?(n="xmlns"===t?L:"",a=t):(n=this.resolve(o),void 0===n&&(this.fail(`unbound namespace prefix: ${JSON.stringify(o)}.`),n=o),a=`{${n}}${r}`),i.has(a)&&this.fail(`duplicate attribute: ${a}.`),i.add(a),e.uri=n,s[t]=e}this.attribList=[]}processAttribsPlain(){const{attribList:t}=this,e=this.tag.attributes;for(const{name:s,value:i}of t)void 0!==e[s]&&this.fail(`duplicate attribute: ${s}.`),e[s]=i;this.attribList=[]}openTag(){this.processAttribs();const{tags:t}=this,e=this.tag;e.isSelfClosing=!1,this.openTagHandler?.(e),t.push(e),this.state=j,this.name=""}openSelfClosingTag(){this.processAttribs();const{tags:t}=this,e=this.tag;e.isSelfClosing=!0,this.openTagHandler?.(e),this.closeTagHandler?.(e),null===(this.tag=t[t.length-1]??null)&&(this.closedRoot=!0),this.state=j,this.name=""}closeTag(){const{tags:t,name:e}=this;if(this.state=j,this.name="",""===e)return this.fail("weird empty close tag."),void(this.text+="</>");const s=this.closeTagHandler;let i=t.length;for(;i-- >0;){const i=this.tag=t.pop();if(this.topNS=i.ns,s?.(i),i.name===e)break;this.fail("unexpected close tag.")}0===i?this.closedRoot=!0:i<0&&(this.fail(`unmatched closing tag: ${e}.`),this.text+=`</${e}>`)}parseEntity(t){if("#"!==t[0]){const e=this.ENTITIES[t];return void 0!==e?e:(this.fail(this.isName(t)?"undefined entity.":"disallowed character in entity name."),`&${t};`)}let e=NaN;return"x"===t[1]&&/^#x[0-9a-f]+$/i.test(t)?e=parseInt(t.slice(2),16):/^#[0-9]+$/.test(t)&&(e=parseInt(t.slice(1),10)),this.isChar(e)?String.fromCodePoint(e):(this.fail("malformed character entity."),`&${t};`)}}var it,ot;(ot=it||(it={})).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"},ot.parseStream=async(t,e,s)=>{const i=new st({position:!1,...s});let o;if(e.onOpenTagStart&&i.on(ot.Events.OpenTagStart,e.onOpenTagStart),e.onOpenTag&&i.on(ot.Events.OpenTag,e.onOpenTag),e.onCloseTag&&i.on(ot.Events.CloseTag,e.onCloseTag),e.onAttribute&&i.on(ot.Events.Attribute,e.onAttribute),e.onText&&i.on(ot.Events.Text,e.onText),e.onError&&i.on(ot.Events.Error,e.onError),e.onEnd){e.onEnd;const t=()=>{o=e.onEnd()};i.on(ot.Events.End,t)}for(;;){const{value:e,done:s}=await t.read();if(s)break;i.write(e)}return i.close(),o};const rt=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,nt=t=>{const e=parseInt(t);return isNaN(e)?null:e},at=t=>{const e=parseFloat(t);return isNaN(e)?null:e},lt=null;class ct{constructor(){this._registeredVisitors=new Map}registerVisitor(t){this._registeredVisitors.set(t.from,t)}createEventHandler(t,e,s){const i=this._registeredVisitors,o=[];let r=null,n=null,a=null,l=null;const c=[],h={key:null,source:t};let u=null,d=!1;const p=(t,e)=>{let s=a.attributes[t];if(e)if(Array.isArray(e))for(let t=0;t<e.length;t++){if(null==s)return;if(s=e[t](s),null==s)return}else{if(null==s)return;if(s=e(s),null==s)return}return s},g={getSource:()=>u.source,setSource:t=>{u.source=t},setKey:t=>{u.key=t},getFrom:()=>a,getAttribute:(t,e)=>p(t,e)??null,hasAttribute:t=>null!==g.getAttribute(t),getParent:()=>c[c.length-2].source,getPath:()=>{const t=[];for(let e=0;e<o.length;e++)t.push(o[e].local);return t.join("\\")},parseAttribute:p,copyToObject:(t,e,s,i)=>{const o=p(i??e,s);void 0!==o&&(t[e]=o)},copyTo:(t,e,s)=>{const i=p(s??t,e);void 0!==i&&(u.source[t]=i)},warn:t=>{s?s?.(t):console.warn(t)}};return{onOpenTag:t=>{let e=t.name;const s=e.indexOf(":");-1!==s&&(e=e.slice(s+1));const p=i.get(e);if(r={local:e,visitor:p,tag:t,destination:null},d)return o.push(r),n=e,void(a=t);l=r?.visitor??null,p&&(u=0===o.length?h:null!==l?.to?{key:null,source:{}}:null,r.destination=u,u&&c.push(u)),o.push(r),n=e,a=t,d=null===l?.to,l?.openTag?.(g)},onCloseTag:t=>{let e=t.name;const i=e.indexOf(":");if(-1!==i&&(e=e.slice(i+1)),e!==n)throw new Error(`mismatch open/close tag: '${e}'/'${n}'`);d||l?.closeTag?.(g);const p=o.pop()??null;r=o[o.length-1]??null;const f=p?.destination;if(f){c.pop(),u=c[c.length-1]??h;const t=p.visitor;t&&t.to&&void 0!==f.source&&(Array.isArray(t.to)?u.source.push?u.source.push(f.source):s?.(`Unable to parse array for ${t.from} at ${g.getPath()}`):f.key?u.source[f.key]=f.source:"string"==typeof t.to&&(u.source[t.to]=f.source))}n=r?.local??null,a=r?.tag??null,l=r?.visitor??null,d=!r?.destination},onText:t=>{l?.text?.(t,g)},onEnd:e}}}const ht=(t,e,s,i=null)=>{if(!t)return null;let o=t;o.startsWith("/")&&(o=o.substring(1));let r=i?.parsedRefs?.get(t);if(void 0!==r)return r;const n=e(o);if(!n)return null;let a=n.content;try{s&&(a=s(a))}catch(t){console.warn(t)}return i?.parsedRefs?.set(t,a),a},ut=(t,e,s,i,o=null)=>{if(!t)return null;let r=t;r.startsWith("/")&&(r=r.substring(1));let n=o?.parsedRefs?.get(t);if(void 0!==n)return n;const a=e(r);if(!a)return null;const l=a.content;try{const e=(new TextDecoder).decode(l),r=s.parseFromString(e,"text/xml"),n=i.convert(r,t,o);return o?.parsedRefs?.set(t,n),n}catch(t){console.warn(t)}return null},dt=(t,e,s,i,o=null)=>{const r=new Map;let n=e.Directory[t];const a=n?n.length:0;for(let t=0;t<a;t++){const a=n[t];if(!a)continue;let l=a;l.startsWith("/")&&(l=l.substring(1));const c=ut(l,t=>e.files[t],s,i,o);r.set(l,c)}return r},pt=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],gt=(t,e="dk1")=>{let s;const i=t("auto");void 0===i||"1"!==i&&"true"!==i||(s=e);const o=t("indexed");o&&(s=`index${o}`);const r=t("rgb");r&&(s=r.toLowerCase(),8!==r.length||r.startsWith("FF")||(s="FF"+r.substring(2,r.length)));const n=t("theme");n&&(s=pt[n]);let a=t("tint");if(a&&(s+=` ${h.AdjustmentType.ETint} ${parseFloat(a)}`),s)return s},ft=t=>t?t.replace(/^\{([\s\S]+)\}$/,"$1"):t,mt=t=>t?f.roundAccurately(parseFloat(t)/12700,4):null,Tt=t=>t?f.roundAccurately(parseFloat(t)/9525,1):null,yt=t=>parseFloat(t)/1e3,bt=t=>parseFloat(t)/6e4,xt=t=>"true"===t||"1"===t;class wt{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 vt=(t,e,s)=>{if(t[0].value[0]===t[1].value[0])return e},St={colStart:0,colEnd:0,rowStart:0,rowEnd:0},Ct=Object.freeze(Object.defineProperty({__proto__:null,fromBufferXLSX:async(t,h)=>{const{password:f,onWarning:m,createWorkbookOptions:T={},...y}=h??{},b=import("./CwRyQHiDoBLx5_1g.mjs"),x=import("./DhOXsRr8c7bDS1jM.mjs");let w=null;try{w=new DOMParser}catch(t){}let v=null;w||(v=import("./B8dJHVZJta8QbNKG.mjs").then(t=>t.i));let S=null,C=null,k=null;try{const t=await Promise.all([b,x,v]);S=t[0],C=t[1],k=t[2]}catch(t){throw new Error("Unable to load XLSX parser.",{cause:t})}try{const h=S.read(t,{type:"array",sheets:[],cellStyles:!1,bookFiles:!0});if(!h.Directory)throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");h.Directory.richstructure=["/xl/richData/rdrichvaluestructure.xml"],h.Directory.richdata=["/xl/richData/rdrichvalue.xml"];const p=new C.FromOOXMLConverter,f=w??new k.DOMParser,y=T?.resources??new s,b=y.beginPersist(),x={},v=new Set,A=new Map;A.set("richTypes",[]);const D=new Map,E=[],P=t=>h.files[t],O=(t,e)=>{const s=t.lastIndexOf("/"),i=t.substring(0,s+1)+"_rels/"+t.substring(s+1,t.length)+".rels";let o=e.get(i);return o||(o=((t,e,s,i,o=null)=>{if(!t)return null;const r=ut(t,e,s,i,o);if(!r)return null;const n=new Map,a=Object.keys(r),l=a.length;for(let t=0;t<l;t++){const e=a[t],s=r[e];n.set(e,s)}return n})(i,P,f,p,V),e.set(i,o)),o},I=(t,s,a,l=D)=>{let c=O(s,l).get(t),h=c?.target;if(!h)return null;if("External"===c.targetMode)return c.target;const T=s.lastIndexOf("/"),w=s.substring(0,T+1);h.startsWith("/")||(h=w+h),h=(t=>{const e=t.split(/\/+/),s=e.reduce((t,e,s)=>("."===e?t.splice(s,1):".."===e&&t.splice(s-1,2),t),e);return s.join("/")})(h);const S=p?.getVisitorParamsState().get("dxfs");let C=l.get(h);if(!C){const t="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";if(c.type===t){const t={};C=t;const s=async()=>{const s=((t,s,n,a,l,c,h)=>{const p=new ct,f=new i.TransposedBuilder;let m=null;p.registerVisitor({from:"autoFilter",to:"filter",openTag:t=>{t.copyTo("ref",lt)}}),p.registerVisitor({from:"conditionalFormatting",to:{},openTag:t=>{const e=t.getParent();e.conditionals||(e.conditionals=[]),e.conditionals.push(t.getSource());const s=t.getAttribute("sqref");s&&(t.getSource().ref=s.split(" ").join(",")),t.copyTo("pivot",rt)},closeTag:t=>{const e=t.getSource();if(e.rule){const t=Object.keys(e.rule);for(let s=0;s<t.length;s++){const i=t[s];"rule"!==i&&(e[i]=e.rule[i])}}delete e.rule}}),p.registerVisitor({from:"cfRule",to:"rule",openTag:t=>{const e=t.getParent();t.copyToObject(e,"type",lt),t.copyToObject(e,"priority",nt),t.copyToObject(e,"stopIfTrue",rt);const s=t.getAttribute("dxfId",nt);if(null!==s){let i=a?.get(s);i||(c?.(`Unable to load conditional color. Invalid dxfI: '${s}' at '${t.getPath()}'.`),i={}),e.style=i}t.copyToObject(e,"aboveAverage",rt),t.copyToObject(e,"equalAverage",rt),t.copyToObject(e,"stdDev",nt),t.copyToObject(e,"bottom",rt),t.copyToObject(e,"percent",rt),t.copyToObject(e,"rank",nt),t.copyToObject(e,"operator",lt),t.copyToObject(e,"text",lt),t.copyToObject(e,"timePeriod",lt)}}),p.registerVisitor({from:"colorScale",to:"colorScale"}),p.registerVisitor({from:"dataBar",to:"dataBar",openTag:t=>{t.copyTo("maxLength",nt),t.copyTo("minLength",nt),t.copyTo("showValue",rt)}}),p.registerVisitor({from:"iconSet",to:"iconSet",openTag:t=>{t.copyTo("iconSet",lt),t.copyTo("reverse",rt),t.copyTo("showValue",rt)}}),p.registerVisitor({from:"formula",to:null,text:(t,e)=>{const s=e.getParent();let i=s.formulas;i||(i=[],s.formulas=i),i.push(t)}}),p.registerVisitor({from:"cfvo",to:{},openTag:t=>{const e=t.getParent();e.conditions||(e.conditions=[]),e.conditions.push(t.getSource()),t.copyTo("type",lt),t.copyTo("value",at,"val"),t.copyTo("gte",rt)}}),p.registerVisitor({from:"color",to:{},openTag:t=>{const e=t.getParent();e.colors||(e.colors=[]);const s=gt(e=>t.getAttribute(e));e.colors.push(s)}}),p.registerVisitor({from:"filterColumn",to:"filterColumn",openTag:t=>{const e=t.getParent();e.fields||(e.fields=[]),e.fields.push(t.getSource()),t.copyTo("offset",nt,"colId"),t.copyTo("hiddenButton",rt),t.copyTo("showButton",rt)}}),p.registerVisitor({from:"colorFilter",to:"colorFilter",openTag:t=>{const e=t.getParent();e.criteria||(e.criteria=[]),e.criteria.push(t.getSource()),t.getSource().type=o.Type.Color,t.copyTo("cellColor",rt),t.copyTo("styleId",nt,"dxfId")}}),p.registerVisitor({from:"dynamicFilter",to:"dynamicFilter",openTag:t=>{const e=t.getParent();e.criteria||(e.criteria=[]),e.criteria.push(t.getSource()),t.getSource().type=o.Type.Dynamic,t.copyTo("dynamicType",lt,"type"),t.copyTo("val",at),t.copyTo("maxVal",at,"maxVal")}}),p.registerVisitor({from:"iconFilter",to:"iconFilter",openTag:t=>{const e=t.getParent();e.criteria||(e.criteria=[]),e.criteria.push(t.getSource()),t.getSource().type=o.Type.Icon,t.copyTo("iconId",nt),t.copyTo("iconSet",lt)}}),p.registerVisitor({from:"top10",to:"top10",openTag:t=>{const e=t.getParent();e.criteria||(e.criteria=[]),e.criteria.push(t.getSource()),t.getSource().type=o.Type.Top10,t.copyTo("filterVal",at),t.copyTo("percent",rt),t.copyTo("top",rt),t.copyTo("val",at)}}),p.registerVisitor({from:"filters",to:"filters",openTag:t=>{const e=t.getParent();e.criteria||(e.criteria=[]),e.criteria.push(t.getSource()),t.getSource().type=o.Type.Items,t.copyTo("blank",rt),t.copyTo("calendarType",lt)}}),p.registerVisitor({from:"dateGroupItem",to:"dateGroupItem",openTag:t=>{const e=t.getParent();e.dateGroups||(e.dateGroups=[]),e.dateGroups.push(t.getSource()),t.copyTo("group",lt,"dateTimeGrouping"),t.copyTo("day",nt),t.copyTo("hour",nt),t.copyTo("minute",nt),t.copyTo("month",nt),t.copyTo("second",nt),t.copyTo("year",nt)}}),p.registerVisitor({from:"filter",to:"filter",openTag:t=>{const e=t.getParent();e.items||(e.items=[]),e.items.push(t.getAttribute("val",at))}}),p.registerVisitor({from:"customFilters",to:"customFilters",openTag:t=>{const e=t.getParent();e.criteria||(e.criteria=[]),e.criteria.push(t.getSource()),t.getSource().type=o.Type.Custom,t.copyTo("and",rt)}}),p.registerVisitor({from:"customFilter",to:"customFilter",openTag:t=>{const e=t.getParent();e.filters||(e.filters=[]),e.filters.push(t.getSource()),t.copyTo("operator",lt),t.copyTo("value",at,"val")}}),p.registerVisitor({from:"sortState",to:"sort",openTag:t=>{t.copyTo("ref",lt)}}),p.registerVisitor({from:"sortCondition",to:"sortCondition",openTag:t=>{const e=t.getParent();e.fields||(e.fields=[]);const s=t.getSource();e.fields.push(s),t.copyTo("sortOn",lt,"sortBy"),t.copyTo("dxfId",lt,"sortBy"),t.copyTo("iconSet",lt),t.copyTo("customList",lt);const i=t.getAttribute("ref");if(i){const t=r.fastStringToRange(i,St).colStart,o=r.fastStringToRange(e.ref,St),n=o.colStart;s.offset=o?t-n:t}s.reverse=t.getAttribute("descending",rt)??!1}}),p.registerVisitor({from:"AlternateContent",to:null});const T=t=>{m=t.getSource(),t.copyTo("topLeft",lt,"topLeftCell");const e=xt(t.getAttribute("defaultGridColor")),s=t.getAttribute("colorId");null===s||e||(t.getSource().gridLineColor="index"+parseFloat(s)),t.copyTo("showZeros",rt),t.copyTo("showFormulas",rt),t.copyTo("zoomScale",nt),t.copyTo("showRowHeaders",rt,"showRowColHeaders"),t.copyTo("showColumnHeaders",rt,"showRowColHeaders"),t.copyTo("showRowGridlines",rt,"showGridLines"),t.copyTo("showColumnGridlines",rt,"showGridLines")};p.registerVisitor({from:"sheetView",to:"view",openTag:t=>{T(t)},closeTag:()=>{m=null}}),p.registerVisitor({from:"customSheetViews",to:"customSheetViews",openTag:t=>{t.setSource([])}}),p.registerVisitor({from:"customSheetView",to:[],openTag:t=>{T(t)},closeTag:()=>{m=null}}),p.registerVisitor({from:"selection",to:"selection",openTag:t=>{if(!m)return;t.copyTo("cell",lt,"activeCell"),t.copyTo("rangeIndex",nt,"activeCellId");const e=t.getAttribute("activeCell"),s=t.getAttribute("sqref");s&&s!==e&&(t.getSource().ranges=s.split(" "))}}),p.registerVisitor({from:"pane",to:"pane",openTag:t=>{if(m&&"frozen"===t.getAttribute("state")){const e={};m.freezePanes=e,t.copyToObject(e,"topLeft",lt,"topLeftCell");const s=m.topLeft?r.fastStringToCell(m.topLeft):{colIndex:0,rowIndex:0},i={colIndex:0,rowIndex:0};t.copyToObject(i,"colIndex",nt,"xSplit"),t.copyToObject(i,"rowIndex",nt,"ySplit");const o={colIndex:s.colIndex+i.colIndex,rowIndex:s.rowIndex+i.rowIndex};e.coords=r.cellToString(o)}}}),p.registerVisitor({from:"tabColor",to:null,openTag:e=>{const s=gt(t=>e.getAttribute(t));s&&(t.tabColor=s)}}),p.registerVisitor({from:"pageSetUpPr",to:"pageSetUpPr",openTag:t=>{}}),p.registerVisitor({from:"outlinePr",to:"outlinePr",openTag:t=>{}}),p.registerVisitor({from:"pageMargins",to:"pageMargins",openTag:t=>{}}),p.registerVisitor({from:"pageSetup",to:"pageSetup",openTag:t=>{}}),p.registerVisitor({from:"printOptions",to:"printOptions",openTag:t=>{}}),p.registerVisitor({from:"mergeCells",to:"merges",openTag:t=>{t.setSource([])}}),p.registerVisitor({from:"mergeCell",to:[],openTag:t=>{const e=t.getAttribute("ref");t.setSource(e)}}),p.registerVisitor({from:"hyperlinks",to:"hyperlinks",openTag:t=>{t.setSource([])}}),p.registerVisitor({from:"hyperlink",to:[],openTag:t=>{const e=t.getAttribute("r:id"),i=t.getAttribute("ref");if(!i)return void console.warn("No ref found for hyperlink");t.setKey(i);let o=e?s(e):"";if("string"!=typeof o)return void console.warn("Invalid address ",o);const r=t.getAttribute("location");o.endsWith("\\")&&(o=o.substring(0,o.length-1));const n=t.getAttribute("location");if(n&&(r&&r!==n&&console.warn("display and location are different",r,n),o+="#"+n),!o)return void console.warn("No address found for hyperlink. r:id",e);let a;const l=t.getAttribute("tooltip");a=l?{address:o,tooltip:l}:o,t.setSource({r:i,v:a})}}),p.registerVisitor({from:"drawing",to:"movables",openTag:t=>{const e=t.getAttribute("r:id");if(!e)return;const i=s(e);i?t.setSource(i.movables):console.warn("no drawing found for rId",e)}}),p.registerVisitor({from:"tableParts",to:"tables",openTag:t=>{t.setSource([])}}),p.registerVisitor({from:"tablePart",to:[],openTag:t=>{const e=t.getAttribute("r:id");if(!e)return;const i=s(e);i?t.setSource(i):console.warn("no table found for rId",e)}}),p.registerVisitor({from:"worksheet",to:"worksheet",openTag:t=>{}}),p.registerVisitor({from:"sheetProtection",to:"protection",openTag:t=>{let e=!1;if(t.hasAttribute("sheet")&&rt(t.getAttribute("sheet"))&&(e=!0),!e)return void t.setSource(void 0);const s=t=>!0===t||"1"===t||"on"===t||"true"===t||!1===t||"0"===t||"off"===t||"false"===t||null;t.copyTo("autoFilter",s),t.copyTo("deleteColumns",s),t.copyTo("formatCells",s),t.copyTo("formatColumns",s),t.copyTo("formatRows",s),t.copyTo("insertColumns",s),t.copyTo("insertHyperlinks",s),t.copyTo("insertRows",s),t.copyTo("objects",s),t.copyTo("pivotTables",s),t.copyTo("scenarios",s),t.copyTo("selectUnlockedCells",s),t.copyTo("selectUnlockedCells",s),t.copyTo("sort",s);const i={};t.copyToObject(i,"hash",lt,"hashValue"),t.copyToObject(i,"algorithm",lt,"algorithmName"),t.copyToObject(i,"salt",lt,"saltValue"),t.copyToObject(i,"spinCount",nt),Object.keys(i).length>0&&(t.getSource().password=i)}}),p.registerVisitor({from:"protectedRanges",to:"protectedRanges",openTag:t=>{t.setSource({})}}),p.registerVisitor({from:"protectedRange",to:{},openTag:t=>{const e=t.getAttribute("sqref");t.setKey(e),t.copyTo("name"),t.copyTo("securityDescriptor");const s={};t.copyToObject(s,"hash",lt,"hashValue"),t.copyToObject(s,"algorithm",lt,"algorithmName"),t.copyToObject(s,"salt",lt,"saltValue"),t.copyToObject(s,"spinCount",nt),Object.keys(s).length>0&&(t.getSource().password=s)}}),p.registerVisitor({from:"sheetFormatPr",to:"sheetFormatPr",openTag:e=>{e.copyToObject(t,"defaultColSize",at,"defaultColWidth"),e.copyToObject(t,"outlineLevelCol",nt,"outlineLevelCol");const s=e.getAttribute("customHeight");"1"!==s&&"true"!==s||e.copyToObject(t,"defaultRowSize",at,"defaultRowHeight"),e.copyToObject(t,"outlineLevelRow",nt,"outlineLevelRow")}}),p.registerVisitor({from:"cols",to:"cols",openTag:t=>{t.setSource([])}}),p.registerVisitor({from:"col",to:[],openTag:t=>{t.copyTo("min",t=>parseInt(t)-1),t.copyTo("max",t=>parseInt(t)-1),t.copyTo("sz",at,"width"),t.copyTo("cs",rt,"customWidth"),t.copyTo("h",rt,"hidden"),t.copyTo("l",nt,"outlineLevel"),t.copyTo("s",nt,"style")}}),p.registerVisitor({from:"oleObjects",to:null,openTag:t=>{t.warn("'OLE Objects' are not supported.")}});let y=null;const b={onOpenTag:t=>{null===y&&(y="")},onText:t=>{y+=t},onEnd:()=>{const t=n(y);return y=null,t},onError:t=>{}};return((t,s,i,o,n,a)=>{let l=!1,c=!1,h=[],p=!1,f=null,m=null,T=null,y=null,b=null,x=null;const w=a?.get("richData")??[],v=r.normalizeA1ToR1C1,S=u.createConflatingRanges(),C=new Map,k=[];let A=null;const D=u.createConflatingRanges();let E,P=!1,O=-1,I=-1,V=null,L=null;const N=[];let R=null,$=-2,M=0,j="",H="",F="",X="",B="",W="",_="",q="",z="",U="",G="",Z="",Q="",J="",K=!0,Y=null;return{...i,onEnd:()=>{N.length>0&&(s.rows=N);let e=S.done(vt);const o=e.length;if(o>0){const t=new Array(o);for(let s=0;s<o;s++){const i=e[s],o=r.rangeToString(i),n=i.value[1],a=r.resolveRelativeToA1(n,i.rowStart,i.colStart);t[s]=[o,a]}s.formulas=t}const n=D.done(!0),a=n.length;if(a>0){const t=new Array(a);for(let e=0;e<a;e++){const s=n[e],i=r.rangeToString(s);t[e]=i}s.volatile=t}if(k.length>0&&(s.dynamicArray=[...k]),h.length>0){h.sort(u.createRangeComparator(d.Orientation.Column));const t=[];let e=null,i=-1,o=-1,r=-1,n=-1,a=null;const l=h.length;l>0&&(e=h[0],i=e.colStart,o=e.colEnd,r=e.rowEnd,n=e.value,t.push(e));for(let s=1;s<l;s++)a=h[s],n!==a.value||i!==a.colStart||o!==a.colEnd||r+1!==a.rowEnd?(t.push(a),e=a,i=e.colStart,o=e.colEnd,r=e.rowEnd,n=e.value):(r=a.rowEnd,e.rowEnd=r);let c=[];for(let e=0;e<t.length;e++){const s=t[e];c.push({r:{colStart:s.colStart,colEnd:s.colEnd,rowStart:s.rowStart,rowEnd:s.rowEnd},v:s.value})}s.directStyles=c}const l=t.build();if(l){const t=l.tuples;s.data=t}i?.onEnd?.()},onOpenTag:t=>{let e=t.name;const s=e.indexOf(":");if(-1!==s&&(e=e.slice(s+1)),E){const s=t.attributes;switch(e){case"v":c=!0;break;case"f":switch(s.t??null){case null:case"normal":p=!0;break;case"shared":const t=s.si;m=s.ref,f=t;break;case"array":p=!0,m=s.ref,A=[m,!1];break;case"datatable":p=!0,m=s.ref,p=!0}void 0!==s.ca&&D.append(O,I);break;case"is":return void(P=!0)}return void(P&&n?.onOpenTag(t))}if(l){if("c"===e){E=t;const e=t.attributes.r;I=r.fastStringToCol(e);const s=t.attributes.t;void 0===s?L=null:(L=s,"str"===L&&(P=!0));let i=t.attributes.s;void 0!==i&&(i=parseInt(i),Y&&Y.value===i&&Y.colEnd+1===I?Y.colEnd=I:(Y={colStart:I,rowStart:O,colEnd:I,rowEnd:O,value:i},h.push(Y)))}}else{if("row"===e){l=!0;const e=t.attributes.r;if(O=parseInt(e)-1,M=0,H=t.attributes.customHeight,void 0!==H&&(M|=wt.CustomHeight),H!==z&&(K=!0,z=H),j=t.attributes.ht,void 0!==j&&(M|=wt.Ht),j!==q&&(K=!0,q=j),F=t.attributes.hidden,void 0!==F&&(M|=wt.Hidden),F!==U&&(K=!0,U=F),B=t.attributes.s,void 0!==B&&(M|=wt.S),B!==Z&&(K=!0,Z=B),X=t.attributes.customFormat,void 0!==X&&(M|=wt.CustomFormat),X!==G&&(K=!0,G=X),W=t.attributes.outlineLevel,void 0!==W&&(M|=wt.OutlineLevel),W!==Q&&(K=!0,Q=W),_=t.attributes.collapsed,void 0!==_&&(M|=wt.Collapsed),_!==J&&(K=!0,J=_),0!==M)if($+1!==O||K){const t=void 0!==H&&("1"===H||"true"===H),e=void 0!==X&&("1"===X||"true"===X);R={min:O,max:O,sz:t&&void 0!==j?parseFloat(j):-1,csz:t,h:void 0!==F&&("1"===F||"true"===F),s:t&&void 0!==B&&"0"!==B?parseInt(B):0,cs:e,l:void 0===W||"0"===W?0:parseInt(W),cl:void 0!==_&&("1"===_||"true"===_)},N.push(R)}else R.max=O;return $=O,void(K=!1)}i?.onOpenTag(t)}},onCloseTag:e=>{if(E){let s=e.name;const i=s.indexOf(":");if(-1!==i&&(s=s.slice(i+1)),P)if("is"===s||"v"===s){const e=n?.onEnd();null!==e&&t.addValue(O,I,""+e)}else n?.onCloseTag?.(e);return c&&(c=!1),void("c"===s&&(E=null,P=!1))}if(l)return l=!1,void(Y=null);i?.onCloseTag(e)},onText:s=>{if(s=s.trim(),c){switch(V=null,L){case null:case"n":V=parseFloat(s);break;case"b":V="1"===s||"true"===s;break;case"s":V=s;break;case"e":if("#VALUE!"===s){const t=E.attributes.vm;if(void 0!==t){const s=w[parseInt(t)-1];if(s&&s.isFormulaError){V={t:e.Error,v:s.getCode()};break}}}const t=g.getBuiltInByLabel(s);t?V={t:e.Error,v:t.getCode()}:(V=s,o?.(`Unknown formula error '${s}' in cell ${r.cellToString({colIndex:I,rowIndex:O})}`));break;case"str":case"inlineStr":P=!0}null!==V&&t.addValue(O,I,V)}if(A&&("e"===L&&(A[1]=!0),k.push(A),A=null),f)if(b===f)y=x;else{if(y=C.get(f),!y){const t=[];T=v(s,O,I,t),y=[T,t,s],C.set(f,y)}b=f,x=y}if(p){const t=[];T=v(s,O,I,t),y=[T,t,s]}if(y)return S.append(O,I,y),y=null,p=!1,f=null,void(m=null);P?n?.onText(s):l||i?.onText(s)}}})(f,t,p.createEventHandler(t,()=>{},c),c,b,h)})(t,(t,e=!1)=>I(t,h,e)??null,j,S,0,t=>{m&&(t=h+": "+t,m?.(t))},A),a=ht(h,P),c=await(async(t,e=8388608)=>{await(async()=>{if("undefined"==typeof ReadableStream)if("undefined"==typeof window){const{ReadableStream:t}=await import("./JPwh2m5-pXkdPVzF.mjs");globalThis.ReadableStream=t}else console.warn("Browser does not support ReadableStream; consider loading a polyfill.")})();const s=new TextDecoder("utf-8");let i=0;const o=t instanceof Uint8Array?t:new Uint8Array(t);return new ReadableStream({pull(t){if(i>=o.byteLength)return void t.close();const r=o.subarray(i,Math.min(i+e,o.byteLength)),n=s.decode(r,{stream:i+e<o.byteLength});t.enqueue(n),i+=r.length}}).getReader()})(a);try{await it.parseStream(c,s,{xmlns:!1})}catch(t){throw console.warn(`Error parsing sheet: '${h}'`,t),new Error(`Error parsing sheet: '${h}'`,{cause:t})}const p=O(h,l);let f,T=new Map;if(p){const e="http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";let s;p.forEach((t,s)=>{if(t.type===e){const t=I(s,h,!1,l);f=t?.comments,f&&f.forEach(t=>{T.set(t.id,t)})}});const i="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";if(p.forEach((t,e)=>{if(t.type===i){const t=I(e,h,!1,l);s=t}}),s||f){const e=f??[],i=s?.comments;if(i){const t=s?.authors;for(let s=0;s<i.length;s++){const o=i[s];let r=void 0!==o.authorId?t[o.authorId]:void 0;if((!r||r.startsWith("tc="))&&(r=ft(r.substring(3)),T.has(r)))continue;let a=H.get(r);a||(a=F.get(r)),a||(a={id:n.uuidV4(),displayName:r},F.set(a.displayName,a),H.set(a.id,a)),r=a?.id??null;const l={id:n.uuidV4(),personId:r,ref:o.ref,done:!1,asNote:!0,content:o.content};e.push(l)}}t.comments=e}}};E.push(s())}else C=a?ht(h,P,t=>{const e=y.add({buffer:t});return e.addReference(x),v.add(e),b.toResourceId(e)},V):ut(h,P,f,p,V)}return C},V={paramMap:A,getRefs:O,getRef:I,parsedRefs:D,onWarning:m,addPerson:t=>null},L=[];let N=0;h.Strings&&(N=parseInt(h.Strings.Unique??h.Strings.length??0));const R=h.Strings??[];for(let t=0;t<N;t++)L.push(R[t]?.t??"");const $=new Map;let M=N;const j=t=>{const e=$.get(t);if(void 0!==e)return e;const s=M;return $.set(t,M++),L.push(t),s},H=(dt("richstructure",h,f,p,V),dt("richdata",h,f,p,V),new Map),F=new Map,X=dt("people",h,f,p);let B=null;if(X.size>0&&(B=X.entries().next()?.value?.[1]?.persons,B)){const t=B.length;for(let e=0;e<t;e++){const t=B[e];H.set(t.id,t),H.set(t.displayName,t)}}const W=dt("themes",h,f,p,V);let _=null;if(W&&W.entries){let t=W.entries().next();t?.value?.[1]&&(_=t.value[1])}const q=new a(_),z=dt("styles",h,f,p,V);let U=z.entries().next()?.value[1];U&&(U=JSON.parse(l(U)));const G=dt("workbooks",h,f,p,V);await Promise.all(E);const Z={...G.entries().next().value[1],styles:U,theme:q.toJSON()};L.length>0&&(Z.strings=L),B&&B.length>0&&(Z.people=B);const Q={...T,resources:y,json:Z},J=new c(Q);return v.forEach(t=>{t.deleteReference(x)}),b.endPersist(),J}catch(t){let e="Unable to parse XLSX.";throw t instanceof p&&(e="Unable to open XLSX. There are too many rows or columns."),new Error(e,{cause:t})}},toBufferXLSX:async(s,i)=>{const o=await import("./CwRyQHiDoBLx5_1g.mjs"),r=await s.toJSON(!0),n=o.utils.book_new();for(let i=0;i<r.sheets.length;i++){const a=r.sheets[i],l=o.utils.json_to_sheet([{}]);o.utils.book_append_sheet(n,l,a.name);const c=a.sheet,h=s.getSheetAt(i),u=h.getUsedRange();if(u?(l["!ref"]=u.getA1(),u.forEach((s,i)=>{const o={t:"z"},r=i.getCell().getStyle();if(!r.isNormal()){let e=r.getNumberFormat();e!==t.Type.General&&(e===t.Type.ShortDate?e="m/d/yyyy":e===t.Type.MediumDate?e="d-mmm-yy":e===t.Type.LongDate?e="[$-x-sysdate]dddd, mmmm dd, yyyy":e===t.Type.ShortTime?e="h:mm":e===t.Type.MediumTime?e="h:mm AM/PM":e===t.Type.LongTime&&(e="h:mm:ss AM/PM"),o.z=e)}if(null!==s)switch(i.getType()){case e.Number:o.t="n",o.v=s;break;case e.String:o.t="s",o.v=s;break;case e.Boolean:o.t="b",o.v=s;break;case e.Error:o.t="e",o.v=s.toString();case e.RichData:}l[i.getA1()]=o})):l["!ref"]="A1:A1",c.merges?.length>0){const t=[];l["!merges"]=t;for(let e=0;e<c.merges.length;e++)t.push(o.utils.decode_range(c.merges[e]))}if(c.cols?.length>0){const t=[];l["!cols"]=t;const e=c.cols,s={width:c.defaultColSize??h.getColumnWidthAsFontUnit(h.getColumnHeaders().getDefaultSize())};for(let i=0;i<e.length;i++){const o=e[i];for(let e=t.length;e<=o.min-1;e++)t.push(s);const r={};void 0!==o.sz&&(r.width=o.sz),void 0!==o.h&&(r.hidden=o.h),void 0!==o.l&&(r.level=o.l);for(let e=o.min;e<=o.max;e++)t.push(r)}}}return o.write(n,{type:"array",bookType:"xlsx"}),o.write(n,{type:"array",bookType:"xlsx"})}},Symbol.toStringTag,{value:"Module"}));export{yt as a,xt as b,Tt as c,gt as d,Ct as i,bt as p,ft as r,mt as t};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.12
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{jsx as t,jsxs as n}from"react/jsx-runtime";import{memo as e,useMemo as o,useState as a,useCallback as i}from"react";import{Box as s,FormControl as l,TextField as r}from"@mui/material";import{B as p,p as d,a as c}from"./Cc7y1nMDr5J8jWx-.mjs";import{alpha as u}from"@mui/system";const g=["Ok","Cancel"],m=e(e=>{const{initialHyperlink:m=null,initialDisplay:f=null,onUpdateHyperlink:x,context:h,onOption:y,onValidateOption:T,onDone:k,options:C=g,defaultOption:O=C?.[0],cancelOption:P="Cancel",sx:b,...D}=e,F=o(()=>null!==(m??h?.()?.getHyperlink()),[]),I=o(()=>{let t=null,n=null;m&&("string"==typeof m?n=m:t=m);const e=t??h?.()?.getHyperlink();return{address:n??e?.getAddress()??"",textToDisplay:e?.getDisplayText()??""}},[m,h]),[v,w]=a(I.address),[H,M]=a(()=>{const t=h?.().toTextUnformatted()??f;return t===I.address?"":t}),[$,B]=a(!1),L=i(t=>{M(t.target.value)},[]),W=i(async(t,n)=>null,[]),j=p(async t=>{const n=""===v?null:{address:v};t!==P&&x?.(n,H),y?.(t,t===P,t===O),k?.()},[v,H,x,k,y,O,P]),z=p(t=>{w(t.target.value),W(t.target.value,null)},[T]),A=p(async t=>{let n=await Promise.resolve(T?.(t));try{!1!==n&&(n=await W(v,t))}catch(t){}return n??!0},[T]);return t(d,{title:(F?"Edit":"Insert")+" Link",options:C,onDone:k,onOption:t=>j(t),onValidateOption:A,defaultOption:O,cancelOption:P,autoFocusSel:".autoFocus",sx:{width:"480px",...b},...D,children:n(s,{sx:{paddingTop:t=>t.spacing(1),paddingBottom:t=>t.spacing(0),rowGap:t=>t.spacing(1),display:"flex",flexDirection:"column"},children:[t(l,{sx:{paddingTop:t=>t.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:t(r,{label:"Address",placeholder:"Enter a url or cell reference.",onFocus:t=>{$||t.target?.select(),B(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:t=>t.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:t=>t.spacing(1.25),paddingBottom:t=>t.spacing(.75),backgroundImage:`linear-gradient(${u("#fff",c(5))}, ${u("#fff",c(5))})`}}},value:v,onChange:z,onContextMenu:t=>{t.stopPropagation()}})}),t(l,{sx:{paddingTop:t=>t.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:t(r,{label:"Display Text",placeholder:v?.startsWith("#")?v.substring(1):v,onFocus:()=>{B(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:t=>t.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{spellCheck:!1,autoComplete:"off",sx:{paddingTop:t=>t.spacing(1.25),paddingBottom:t=>t.spacing(.75),backgroundImage:`linear-gradient(${u("#fff",c(5))}, ${u("#fff",c(5))})`}}},value:H,onChange:L,onContextMenu:t=>{t.stopPropagation()}})})]})})});export{m as HyperlinkDialog,m as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.12
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
var e,t,r={},n={},o={},i={},a={};function s(){if(t)return a;t=1;var e=a&&a.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})},r=a&&a.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(a,"__esModule",{value:!0}),a.JsDelivrSourceResolver=void 0;var n=function(){function t(){}return t.prototype.resolvePackageJson=function(t,n,o){return e(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.resolveFile("https://cdn.jsdelivr.net/npm/".concat(t).concat(n?"@".concat(n):"").concat(o?"/".concat(o):"","/package.json"))];case 1:return[2,e.sent()]}})})},t.prototype.resolveSourceFile=function(t,n,o){return e(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.resolveFile("https://cdn.jsdelivr.net/npm/".concat(t).concat(n?"@".concat(n):"","/").concat(o))];case 1:return[2,e.sent()]}})})},t.prototype.resolveFile=function(t){return e(this,void 0,void 0,function(){var e;return r(this,function(r){switch(r.label){case 0:return[4,fetch(t,{method:"GET"})];case 1:return(e=r.sent()).ok?[4,e.text()]:[3,3];case 2:return[2,r.sent()];case 3:if(404===e.status)return[2,""];throw Error("Error other than 404 while fetching from Unpkg at ".concat(t));case 4:return[2]}})})},t}();return a.JsDelivrSourceResolver=n,a}var c,u,l,p={},h={};function f(){if(u)return c;function e(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function t(e,t){for(var r,n="",o=0,i=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}u=1;var r={resolve:function(){for(var r,n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a;i>=0?a=arguments[i]:(void 0===r&&(r=process.cwd()),a=r),e(a),0!==a.length&&(n=a+"/"+n,o=47===a.charCodeAt(0))}return n=t(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(r){if(e(r),0===r.length)return".";var n=47===r.charCodeAt(0),o=47===r.charCodeAt(r.length-1);return 0!==(r=t(r,!n)).length||n||(r="."),r.length>0&&o&&(r+="/"),n?"/"+r:r},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,n=0;n<arguments.length;++n){var o=arguments[n];e(o),o.length>0&&(void 0===t?t=o:t+="/"+o)}return void 0===t?".":r.normalize(t)},relative:function(t,n){if(e(t),e(n),t===n)return"";if((t=r.resolve(t))===(n=r.resolve(n)))return"";for(var o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var i=t.length,a=i-o,s=1;s<n.length&&47===n.charCodeAt(s);++s);for(var c=n.length-s,u=a<c?a:c,l=-1,p=0;p<=u;++p){if(p===u){if(c>u){if(47===n.charCodeAt(s+p))return n.slice(s+p+1);if(0===p)return n.slice(s+p)}else a>u&&(47===t.charCodeAt(o+p)?l=p:0===p&&(l=0));break}var h=t.charCodeAt(o+p);if(h!==n.charCodeAt(s+p))break;47===h&&(l=p)}var f="";for(p=o+l+1;p<=i;++p)p!==i&&47!==t.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(s+l):(s+=l,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(t){if(e(t),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,o=-1,i=!0,a=t.length-1;a>=1;--a)if(47===(r=t.charCodeAt(a))){if(!i){o=a;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');e(t);var n,o=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,c=-1;for(n=t.length-1;n>=0;--n){var u=t.charCodeAt(n);if(47===u){if(!a){o=n+1;break}}else-1===c&&(a=!1,c=n+1),s>=0&&(u===r.charCodeAt(s)?-1===--s&&(i=n):(s=-1,i=c))}return o===i?i=c:-1===i&&(i=t.length),t.slice(o,i)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){o=n+1;break}}else-1===i&&(a=!1,i=n+1);return-1===i?"":t.slice(o,i)},extname:function(t){e(t);for(var r=-1,n=0,o=-1,i=!0,a=0,s=t.length-1;s>=0;--s){var c=t.charCodeAt(s);if(47!==c)-1===o&&(i=!1,o=s+1),46===c?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!i){n=s+1;break}}return-1===r||-1===o||0===a||1===a&&r===o-1&&r===n+1?"":t.slice(r,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return r;var n,o=t.charCodeAt(0),i=47===o;i?(r.root="/",n=1):n=0;for(var a=-1,s=0,c=-1,u=!0,l=t.length-1,p=0;l>=n;--l)if(47!==(o=t.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===o?-1===a?a=l:1!==p&&(p=1):-1!==a&&(p=-1);else if(!u){s=l+1;break}return-1===a||-1===c||0===p||1===p&&a===c-1&&a===s+1?-1!==c&&(r.base=r.name=0===s&&i?t.slice(1,c):t.slice(s,c)):(0===s&&i?(r.name=t.slice(1,a),r.base=t.slice(1,c)):(r.name=t.slice(s,a),r.base=t.slice(s,c)),r.ext=t.slice(a,c)),s>0?r.dir=t.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,c=r}var d,v={};function y(){if(d)return v;d=1;var e=v&&v.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v,"__esModule",{value:!0}),v.importResourcePathToString=void 0;var t=e(f());return v.importResourcePathToString=function(e){var r;switch(e.kind){case"package":return t.default.join(e.packageName,null!==(r=e.importPath)&&void 0!==r?r:"","package.json");case"relative":return t.default.join(e.sourcePath,e.importPath);case"relative-in-package":return t.default.join(e.packageName,e.sourcePath,e.importPath)}},v}var g,m={};function b(){return g||(g=1,Object.defineProperty(m,"__esModule",{value:!0}),m.invokeUpdate=void 0,m.invokeUpdate=function(e,t){var r,n="".concat(e.type,": ");switch(e.type){case"CodeChanged":case"ResolveNewImports":n+="";break;case"LookedUpTypeFile":n+='"'.concat(e.path,'" was ').concat(e.success?"sucessfully":"not sucessfully"," looked up");break;case"AttemptedLookUpFile":n+='"'.concat(e.path,'" was ').concat(e.success?"sucessfully":"not sucessfully"," attempted to looked up");break;case"LookedUpPackage":n+='package.json for package "'.concat(e.package,'" was ').concat(e.success?"sucessfully":"not sucessfully"," looked up").concat(e.definitelyTyped?" (found in definitely typed repo)":"");break;case"LoadedFromCache":n+='"'.concat(e.importPath,'" was loaded from cache');break;case"StoredToCache":n+='"'.concat(e.importPath,'" was stored to cache')}n.endsWith(": ")&&(n=n.slice(void 0,-2)),null===(r=t.onUpdate)||void 0===r||r.call(t,e,n)}),m}var k,w,_,P,O={};function j(){if(k)return O;k=1,Object.defineProperty(O,"__esModule",{value:!0}),O.RecursionDepth=void 0;var e=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=0),this.options=e,this.fileRecursionDepth=t,this.packageRecursionDepth=r}return e.prototype.nextPackage=function(){return new e(this.options,this.fileRecursionDepth,this.packageRecursionDepth+1)},e.prototype.nextFile=function(){return new e(this.options,this.fileRecursionDepth+1,this.packageRecursionDepth)},e.prototype.same=function(){return new e(this.options,this.fileRecursionDepth,this.packageRecursionDepth)},e.prototype.shouldStop=function(){return this.options.fileRecursionDepth>0&&this.fileRecursionDepth>=this.options.fileRecursionDepth||this.options.packageRecursionDepth>0&&this.packageRecursionDepth>=this.options.packageRecursionDepth},e}();return O.RecursionDepth=e,O}function R(){if(w)return p;w=1;var e=p&&p.__assign||function(){return e=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)},t=p&&p.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(n,e,o);return r(n,e),n},o=p&&p.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})},i=p&&p.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},a=p&&p.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=p&&p.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(p,"__esModule",{value:!0}),p.ImportResolver=void 0;var c=function(){if(l)return h;l=1;var e=h&&h.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=h&&h.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=h&&h.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n},n=h&&h.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=h&&h.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(h,"__esModule",{value:!0}),h.DependencyParser=void 0;var i=r(f()),a=function(){function e(){this.REGEX_CLEAN=/[\n|\r]/g,this.REGEX_DETECT_IMPORT=/(?:(?:(?:import)|(?:export))(?:.)*?from\s+["']([^"']+)["'])|(?:((?:require|import))(?:\s+)?\(["']([^"']+)["']\))|(?:\/+\s+<reference\s+path=["']([^"']+)["']\s+\/>)/g,this.REGEX_NODE_MODULE=/^node:([\w\W\/]+)$/}return e.prototype.parseDependencies=function(e,t){var r=this;return o([],n(e.matchAll(this.REGEX_DETECT_IMPORT)),!1).map(function(e){var t,r;return null!==(r=null!==(t=e[1])&&void 0!==t?t:e[2])&&void 0!==r?r:e[3]}).filter(function(e){return!!e}).map(function(e){return r.resolvePath(e,t)})},e.prototype.resolvePath=function(e,t){var r=e.match(this.REGEX_NODE_MODULE);if(r)return{kind:"relative-in-package",packageName:"@types/node",importPath:"".concat(r[1],".d.ts"),sourcePath:""};if("string"==typeof t){if(e.startsWith("."))return{kind:"relative",importPath:e,sourcePath:t};if(e.startsWith("@")){var n=e.split("/");return{kind:"package",packageName:"".concat(n[0],"/").concat(n[1]),importPath:n.slice(2).join("/")}}return{kind:"package",packageName:(n=e.split("/"))[0],importPath:n.slice(1).join("/")}}switch(t.kind){case"package":throw Error("TODO?");case"relative":throw Error("TODO2?");case"relative-in-package":return e.startsWith(".")?{kind:"relative-in-package",packageName:t.packageName,sourcePath:i.join(t.sourcePath,t.importPath),importPath:e}:e.startsWith("@")?(n=e.split("/"),{kind:"package",packageName:"".concat(n[0],"/").concat(n[1]),importPath:n.slice(2).join("/")}):{kind:"package",packageName:(n=e.split("/"))[0],importPath:n.slice(1).join("/")}}},e}();return h.DependencyParser=a,h}(),u=y(),d=n(f()),v=b(),g=j(),m=function(){function t(e){var t,r;if(this.options=e,this.loadedFiles=[],this.dependencyParser=new c.DependencyParser,this.cache=e.sourceCache,this.sourceResolver=e.sourceResolver,this.newImportsResolved=!1,this.monaco=e.monaco,e.preloadPackages&&e.versions){this.versions=e.versions;try{for(var n=a(Object.entries(e.versions)),o=n.next();!o.done;o=n.next()){var i=s(o.value,2),u=i[0];i[1],this.resolveImport({kind:"package",packageName:u,importPath:""},new g.RecursionDepth(this.options)).catch(function(e){console.error(e)})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}}return t.prototype.wereNewImportsResolved=function(){return this.newImportsResolved},t.prototype.resetNewImportsResolved=function(){this.newImportsResolved=!1},t.prototype.resolveImportsInFile=function(e,t,r){var n,s,c;return o(this,void 0,void 0,function(){var o,u,l,p,h,f,d,v;return i(this,function(i){switch(i.label){case 0:if(r.shouldStop())return[2];o=this.dependencyParser.parseDependencies(e,t),i.label=1;case 1:i.trys.push([1,8,9,10]),u=a(o),l=u.next(),i.label=2;case 2:if(l.done)return[3,7];p=l.value,i.label=3;case 3:return i.trys.push([3,5,,6]),[4,this.resolveImport(p,r)];case 4:return i.sent(),[3,6];case 5:return h=i.sent(),this.options.onError?null===(s=(n=this.options).onError)||void 0===s||s.call(n,null!==(c=h.message)&&void 0!==c?c:h):console.error(h),[3,6];case 6:return l=u.next(),[3,2];case 7:return[3,10];case 8:return f=i.sent(),d={error:f},[3,10];case 9:try{l&&!l.done&&(v=u.return)&&v.call(u)}finally{if(d)throw d.error}return[7];case 10:return[2]}})})},t.prototype.resolveImport=function(e,t){return o(this,void 0,void 0,function(){var r,n;return i(this,function(o){switch(o.label){case 0:if(r=this.hashImportResourcePath(e),this.loadedFiles.includes(r))return[2];switch(this.loadedFiles.push(r),e.kind){case"package":return[3,1];case"relative":return[3,5];case"relative-in-package":return[3,6]}return[3,8];case 1:return[4,this.resolveImportFromPackageRoot(e)];case 2:return(n=o.sent())?[4,this.resolveImportInPackage(n,t.nextPackage().nextFile())]:[3,4];case 3:case 7:return[2,o.sent()];case 4:return[3,8];case 5:throw Error("Not implemented yet");case 6:return[4,this.resolveImportInPackage(e,t.nextFile())];case 8:return[2]}})})},t.prototype.resolveImportInPackage=function(e,t){return o(this,void 0,void 0,function(){var r,n,o;return i(this,function(i){switch(i.label){case 0:return[4,this.loadSourceFileContents(e)];case 1:return(r=i.sent())?(n=r.source,o=r.at,this.createModel(n,this.monaco.Uri.parse(this.options.fileRootPath+d.join("node_modules/".concat(e.packageName),o))),[4,this.resolveImportsInFile(n,{kind:"relative-in-package",packageName:e.packageName,sourcePath:d.dirname(o),importPath:""},t)]):[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}})})},t.prototype.resolveImportFromPackageRoot=function(e){var t,r,n,a,s,c,u,l,p;return o(this,void 0,void 0,function(){var o,h,f,y,g,m,b,k,w;return i(this,function(i){switch(i.label){case 0:return o={type:"LookedUpPackage",package:e.packageName,definitelyTyped:!1,success:!1},!this.options.onlySpecifiedPackages||(null===(t=this.versions)||void 0===t?void 0:t[e.packageName])||(null===(r=this.versions)||void 0===r?void 0:r["@types/"+e.packageName])?(h=null!==(a=null===(n=e.importPath)||void 0===n?void 0:n.length)&&void 0!==a&&a,f=h?"/".concat(e.importPath):"",[4,this.resolvePackageJson(e.packageName,null===(s=this.versions)||void 0===s?void 0:s[e.packageName],h?e.importPath:void 0)]):((0,v.invokeUpdate)(o,this.options),[2]);case 1:return(y=i.sent())||!h?[3,3]:[4,this.resolvePackageJson(e.packageName,null===(c=this.versions)||void 0===c?void 0:c[e.packageName])];case 2:y=i.sent(),f="",i.label=3;case 3:return y?(g=JSON.parse(y)).typings||g.types?(w=g.typings||g.types,this.createModel(y,this.monaco.Uri.parse("".concat(this.options.fileRootPath,"node_modules/").concat(e.packageName).concat(f,"/package.json"))),(0,v.invokeUpdate)({type:"LookedUpPackage",package:e.packageName,definitelyTyped:!1,success:!0},this.options),this.setVersion(e.packageName,g.version),[2,{kind:"relative-in-package",packageName:e.packageName,sourcePath:"",importPath:d.join(null!==(u=e.importPath)&&void 0!==u?u:"",w.startsWith("./")?w.slice(2):w)}]):[3,4]:[3,7];case 4:return m="@types/".concat(e.packageName.startsWith("@")?e.packageName.slice(1).replace(/\//,"__"):e.packageName),[4,this.resolvePackageJson(m,null===(l=this.versions)||void 0===l?void 0:l[m])];case 5:if(b=i.sent()){if((k=JSON.parse(b)).typings||k.types)return w=k.typings||k.types,this.createModel(b,this.monaco.Uri.parse("".concat(this.options.fileRootPath,"node_modules/").concat(m,"/package.json"))),(0,v.invokeUpdate)({type:"LookedUpPackage",package:m,definitelyTyped:!0,success:!0},this.options),this.setVersion(m,k.version),[2,{kind:"relative-in-package",packageName:m,sourcePath:"",importPath:d.join(null!==(p=e.importPath)&&void 0!==p?p:"",w.startsWith("./")?w.slice(2):w)}];(0,v.invokeUpdate)(o,this.options)}else(0,v.invokeUpdate)(o,this.options);i.label=6;case 6:return[3,8];case 7:(0,v.invokeUpdate)(o,this.options),i.label=8;case 8:return[2]}})})},t.prototype.loadSourceFileContents=function(e){return o(this,void 0,void 0,function(){var t,r,n,o,s,c,u,l,p,h,f,y,g,m,b,k;return i(this,function(i){switch(i.label){case 0:return t=d.join(e.packageName,e.sourcePath,e.importPath),r={type:"LookedUpTypeFile",path:t,definitelyTyped:!1,success:!1},n=e.packageName,o=this.getVersion(e.packageName),(s=[".d.ts","/index.d.ts",".ts",".tsx","/index.ts","/index.tsx"]).map(function(t){return e.importPath.endsWith(t)}).reduce(function(e,t){return e||t},!1)?[4,this.resolveSourceFile(n,o,d.join(e.sourcePath,e.importPath))]:[3,2];case 1:return(m=i.sent())?[2,{source:m,at:d.join(e.sourcePath,e.importPath)}]:[3,9];case 2:i.trys.push([2,7,8,9]),c=a(s),u=c.next(),i.label=3;case 3:return u.done?[3,6]:(l=u.value,p=d.join(e.sourcePath,e.importPath),g=(".d.ts"===l&&p.endsWith(".js")?p.slice(0,-3):p)+l,[4,this.resolveSourceFile(n,o,g)]);case 4:if(m=i.sent(),(0,v.invokeUpdate)({type:"AttemptedLookUpFile",path:d.join(n,g),success:!!m},this.options),m)return(0,v.invokeUpdate)({type:"LookedUpTypeFile",path:d.join(n,g),success:!0},this.options),[2,{source:m,at:g}];i.label=5;case 5:return u=c.next(),[3,3];case 6:return[3,9];case 7:return h=i.sent(),b={error:h},[3,9];case 8:try{u&&!u.done&&(k=c.return)&&k.call(c)}finally{if(b)throw b.error}return[7];case 9:return[4,this.resolvePackageJson(n,o,d.join(e.sourcePath,e.importPath))];case 10:return(f=i.sent())&&(y=JSON.parse(f).types)?(g=d.join(e.sourcePath,e.importPath,y),[4,this.resolveSourceFile(n,o,g)]):[3,12];case 11:if(m=i.sent())return(0,v.invokeUpdate)({type:"LookedUpTypeFile",path:d.join(n,g),success:!0},this.options),[2,{source:m,at:g}];i.label=12;case 12:return(0,v.invokeUpdate)(r,this.options),[2,null]}})})},t.prototype.getVersion=function(e){var t;return null===(t=this.versions)||void 0===t?void 0:t[e]},t.prototype.setVersions=function(e){var t,r;this.versions=e,null===(r=(t=this.options).onUpdateVersions)||void 0===r||r.call(t,e)},t.prototype.setVersion=function(t,r){var n;this.setVersions(e(e({},this.versions),((n={})[t]=r,n)))},t.prototype.createModel=function(e,t){t=t.with({path:t.path.replace("@types/","")}),this.monaco.editor.getModel(t)||(this.monaco.editor.createModel(e,"typescript",t),this.newImportsResolved=!0)},t.prototype.hashImportResourcePath=function(e){return(0,u.importResourcePathToString)(e)},t.prototype.resolvePackageJson=function(e,t,r){return o(this,void 0,void 0,function(){var n,o,a,s;return i(this,function(i){switch(i.label){case 0:return n=d.join(e+(t?"@".concat(t):""),null!=r?r:"","package.json"),o=!1,a=void 0,this.cache.isFileAvailable?[4,this.cache.isFileAvailable(n)]:[3,2];case 1:return o=i.sent(),[3,4];case 2:return[4,this.cache.getFile(n)];case 3:a=i.sent(),o=void 0!==a,i.label=4;case 4:return o?null==a?[3,5]:(s=a,[3,7]):[3,8];case 5:return[4,this.cache.getFile(n)];case 6:s=i.sent(),i.label=7;case 7:return[2,s];case 8:return[4,this.sourceResolver.resolvePackageJson(e,t,r)];case 9:return(a=i.sent())&&this.cache.storeFile(n,a),[2,a]}})})},t.prototype.resolveSourceFile=function(e,t,r){return o(this,void 0,void 0,function(){var n,o,a,s;return i(this,function(i){switch(i.label){case 0:return n=d.join(e+(t?"@".concat(t):""),r),o=!1,a=void 0,this.cache.isFileAvailable?[4,this.cache.isFileAvailable(n)]:[3,2];case 1:return o=i.sent(),[3,4];case 2:return[4,this.cache.getFile(n)];case 3:a=i.sent(),o=void 0!==a,i.label=4;case 4:return o?((0,v.invokeUpdate)({type:"LoadedFromCache",importPath:n},this.options),null==a?[3,5]:(s=a,[3,7])):[3,8];case 5:return[4,this.cache.getFile(n)];case 6:s=i.sent(),i.label=7;case 7:return[2,s];case 8:return[4,this.sourceResolver.resolveSourceFile(e,t,r)];case 9:return(a=i.sent())&&((0,v.invokeUpdate)({type:"StoredToCache",importPath:n},this.options),this.cache.storeFile(n,a)),[2,a]}})})},t}();return p.ImportResolver=m,p}function C(){if(_)return o;_=1;var t=o&&o.__assign||function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)},r=o&&o.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=o&&o.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=o&&o.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},c=o&&o.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})},u=o&&o.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},l=o&&o.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(o,"__esModule",{value:!0}),o.AutoTypingsCore=void 0;var p=function(){if(e)return i;e=1,Object.defineProperty(i,"__esModule",{value:!0}),i.DummySourceCache=void 0;var t=function(){function e(){}return e.prototype.getFile=function(e){return Promise.resolve(void 0)},e.prototype.isFileAvailable=function(e){return Promise.resolve(!1)},e.prototype.storeFile=function(e,t){return Promise.resolve(void 0)},e.prototype.clear=function(){return Promise.resolve(void 0)},e}();return i.DummySourceCache=t,i}(),h=s(),d=R(),v=a(f()),y=b(),g=j(),m=function(){function e(e,r){var n=this;this.editor=e,this.options=r,this.disposables=[],this.importResolver=new d.ImportResolver(r);var o=e.onDidChangeModelContent(function(e){n.debouncedResolveContents()});this.disposables.push(o),this.resolveContents(),r.dontAdaptEditorOptions||r.monaco.languages.typescript.typescriptDefaults.setCompilerOptions(t(t({},r.monaco.languages.typescript.typescriptDefaults.getCompilerOptions()),{moduleResolution:r.monaco.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,rootDir:r.fileRootPath}))}return e.create=function(r,n){var o,i;return c(this,void 0,void 0,function(){var a;return u(this,function(s){if((null==n?void 0:n.shareCache)&&n.sourceCache&&!e.sharedCache&&(e.sharedCache=n.sourceCache),!(a=null==n?void 0:n.monaco))throw new Error("monacoInstance not found, you can specify the monaco instance via options.monaco");return[2,new e(r,t(t({fileRootPath:"inmemory://model/",onlySpecifiedPackages:!1,preloadPackages:!1,shareCache:!1,dontAdaptEditorOptions:!1,dontRefreshModelValueAfterResolvement:!1,sourceCache:null!==(o=e.sharedCache)&&void 0!==o?o:new p.DummySourceCache,sourceResolver:null!==(i=null==n?void 0:n.sourceResolver)&&void 0!==i?i:new h.JsDelivrSourceResolver,debounceDuration:4e3,fileRecursionDepth:10,packageRecursionDepth:3},n),{monaco:a}))]})})},e.prototype.dispose=function(){var e,t;try{for(var r=l(this.disposables),n=r.next();!n.done;n=r.next())n.value.dispose()}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.setVersions=function(e){this.importResolver.setVersions(e),this.options.versions=e},e.prototype.clearCache=function(){return c(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.options.sourceCache.clear()];case 1:return e.sent(),[2]}})})},e.prototype.debouncedResolveContents=function(){var e=this;this.isResolving||((0,y.invokeUpdate)({type:"CodeChanged"},this.options),this.options.debounceDuration<=0?this.resolveContents():(void 0!==this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(function(){return c(e,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.resolveContents()];case 1:return e.sent(),this.debounceTimer=void 0,[2]}})})},this.options.debounceDuration)))},e.prototype.resolveContents=function(){var e;return c(this,void 0,void 0,function(){var t,r,n,o;return u(this,function(i){switch(i.label){case 0:if(this.isResolving=!0,(0,y.invokeUpdate)({type:"ResolveNewImports"},this.options),!(t=this.editor.getModel()))throw Error("No model");r=t.getLinesContent(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.importResolver.resolveImportsInFile(r.join("\n"),v.dirname(t.uri.toString()),new g.RecursionDepth(this.options))];case 2:return i.sent(),[3,4];case 3:if(n=i.sent(),!this.options.onError)throw n;return this.options.onError(null!==(e=n.message)&&void 0!==e?e:n),[3,4];case 4:return this.importResolver.wereNewImportsResolved()&&(this.options.dontRefreshModelValueAfterResolvement||(o=this.editor.getPosition(),t.setValue(t.getValue()),o&&this.editor.setPosition(o)),this.importResolver.resetNewImportsResolved()),this.isResolving=!1,[2]}})})},e}();return o.AutoTypingsCore=m,o}var S,x={};var A,D,E,F,T,N,I,M,U={},L={},G={},J={},V={};const W=function(e,t){for(var r=0;r<t.length;r++){const n=t[r];if("string"!=typeof n&&!Array.isArray(n))for(const t in n)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(n,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}({__proto__:null},[M?I:(M=1,I=function(){return N||(N=1,e=r,t=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=r&&r.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)},Object.defineProperty(e,"__esModule",{value:!0}),o(function(){if(P)return n;P=1;var e,t=n&&n.__extends||(e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.AutoTypings=void 0;var r=function(e){function r(t,r){return e.call(this,t,r)||this}return t(r,e),r}(C().AutoTypingsCore);return n.AutoTypings=r,n}(),e),o(y(),e),o(function(){if(S)return x;S=1;var e=x&&x.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})},t=x&&x.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},r=x&&x.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(x,"__esModule",{value:!0}),x.LocalStorageCache=void 0;var n=function(){function n(){this.localCache={}}return n.prototype.getFile=function(r){var o;return e(this,void 0,void 0,function(){return t(this,function(e){try{return[2,null!==(o=localStorage.getItem(n.LOCALSTORAGE_PREFIX+r))&&void 0!==o?o:void 0]}catch(e){return[2,this.localCache[r]]}return[2]})})},n.prototype.storeFile=function(r,o){return e(this,void 0,void 0,function(){return t(this,function(e){this.localCache[r]=o;try{localStorage.setItem(n.LOCALSTORAGE_PREFIX+r,o)}catch(e){}return[2]})})},n.prototype.clear=function(){return e(this,void 0,void 0,function(){var e,o,i,a,s,c,u;return t(this,function(t){for(this.localCache={},e=[],o=0;o<localStorage.length;o++)(null==(s=localStorage.key(o))?void 0:s.startsWith(n.LOCALSTORAGE_PREFIX))&&e.push(s);try{for(i=r(e),a=i.next();!a.done;a=i.next())s=a.value,localStorage.removeItem(s)}catch(e){c={error:e}}finally{try{a&&!a.done&&(u=i.return)&&u.call(i)}finally{if(c)throw c.error}}return[2]})})},n.LOCALSTORAGE_PREFIX="__autotyper_cache_",n}();return x.LocalStorageCache=n,x}(),e),o((A||(A=1,Object.defineProperty(U,"__esModule",{value:!0})),U),e),o((D||(D=1,Object.defineProperty(L,"__esModule",{value:!0})),L),e),o((E||(E=1,Object.defineProperty(G,"__esModule",{value:!0})),G),e),o((F||(F=1,Object.defineProperty(J,"__esModule",{value:!0})),J),e),o(function(){if(T)return V;T=1;var e=V&&V.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})},t=V&&V.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(V,"__esModule",{value:!0}),V.UnpkgSourceResolver=void 0;var r=function(){function r(){}return r.prototype.resolvePackageJson=function(r,n,o){return e(this,void 0,void 0,function(){return t(this,function(e){switch(e.label){case 0:return[4,this.resolveFile("https://unpkg.com/".concat(r).concat(n?"@".concat(n):"").concat(o?"/".concat(o):"","/package.json"))];case 1:return[2,e.sent()]}})})},r.prototype.resolveSourceFile=function(r,n,o){return e(this,void 0,void 0,function(){return t(this,function(e){switch(e.label){case 0:return[4,this.resolveFile("https://unpkg.com/".concat(r).concat(n?"@".concat(n):"","/").concat(o))];case 1:return[2,e.sent()]}})})},r.prototype.resolveFile=function(r){return e(this,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return[4,fetch(r,{method:"GET"})];case 1:return(e=t.sent()).ok?[4,e.text()]:[3,3];case 2:return[2,t.sent()];case 3:if(404===e.status)return[2,""];throw Error("Error other than 404 while fetching from Unpkg at ".concat(r));case 4:return[2]}})})},r}();return V.UnpkgSourceResolver=r,V}(),e),o(s(),e)),r;var e,t,o}())]);export{W as c};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.12
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{memo as t,useRef as i,useState as o,useEffect as l,useLayoutEffect as r,useMemo as s}from"react";import{DialogContent as a,Box as c,TextField as p,InputAdornment as d,Collapse as u,MenuItem as f,FormControl as m,InputLabel as g,Select as x}from"@mui/material";import{ArrowBack as h,ArrowUpward as O,ArrowForward as C,ArrowDownward as y}from"@mui/icons-material";import{ICell as b,IRange as T}from"@sheetxl/sdk";import{B as v,L as k,b as R,O as E,U as S,f as F,X as I,S as w,q as D,h as K,K as P,i as $,a as A,Q as M,J as B,n as L}from"./Cc7y1nMDr5J8jWx-.mjs";import{alpha as V}from"@mui/system";const j=t(t=>{const{label:i,value:r,options:a,onSelect:c,tabIndex:p=0,...d}=t,[u,h]=o(()=>X(r,a));l(()=>{h(X(r,a))},[r,a]);const O=v(e=>{h(e.target.value),c?.(a[e.target.value])},[c,a]),C=s(()=>Object.keys(a).map(n=>e(f,{value:n,children:n},n)),[a]);return n(m,{sx:{minWidth:135},size:"small",children:[e(g,{children:i}),e(x,{inputProps:{tabIndex:p},value:u,label:i,onChange:O,sx:{backgroundImage:`linear-gradient(${V("#fff",A(5))}, ${V("#fff",A(5))})`},...d,children:C})]})}),N={Workbook:"workbook",Sheet:"sheet"},W={enter:140,exit:140},H={Formulas:b.Content.Formulas,Values:b.Content.Values,Notes:b.Content.Notes,Comments:b.Content.Comments},z={...H};delete z.Values;const U={"By Rows":!0,"By Columns":!1},X=(e,n)=>{const t=Object.keys(n);for(let i=0;i<t.length;i++){const o=t[i];if(n[o]===e)return o}},q=t(t=>{const{replace:s=!1,findText:f,replaceText:m,findOptions:g,replaceOptions:x,title:X,onHide:q,onFindOrReplace:G,...J}=t,Q=i(null),Y=i(null),Z=i(null),_=i(null),ee=i(null),ne=i(null),te=(e,n)=>{if(!n)return;n.start(e,{center:!1}),setTimeout(()=>n.stop(e),180)},[ie,oe]=o(!1),[le,re]=o(!1),[se,ae]=o(s),[ce,pe]=o(!1),[de,ue]=o(!1),[fe,me]=o({findText:null,replaceText:null,replace:s,replaceOptions:{},findOptions:{matchCase:!1,matchEntireCell:!1,useRegex:!1,orientation:T.Orientation.Row,fields:[b.Content.Formulas]},scope:N.Sheet}),ge=v(async(e,n,t,i)=>{if(!G)return;const o={...fe};o.replaceOptions={...o.replaceOptions},o.findOptions={...o.findOptions},o.replaceOptions.maxCount=t?void 0:1,o.replace=n,n&&fe.findOptions.fields?.[0]===b.Content.Values&&(o.findOptions.fields=[b.Content.Formulas]),o.findOptions.reverse=!e;const l=await G({autoFocus:i,...o});pe(0===l)},[fe,G]);l(()=>{pe(!1)},[fe,le,se]);const xe=v((e,n)=>{if(e.keyCode===k.Enter){if(!fe.findText)return;let t=!0,i=!1;e.shiftKey&&(t=!1),n?(e.ctrlKey&&e.altKey&&(i=!0),te(e,i?ne.current:ee.current)):te(e,t?_.current:Z.current),ge(t,n,i,!1)}},[fe]),he=i(null);r(()=>{me(e=>{const n={...e};n.findText=f&&f.length>0?f:e.findText??"",oe(!0),void 0!==m&&(n.replaceText=m),g&&(n.findOptions={...n.findOptions,...g}),n.replaceText||(n.replaceText=""),n.replaceOptions&&(n.replaceOptions={...n.replaceOptions}),x&&(n.replaceOptions={...n.replaceOptions,...x}),fe.findOptions.fields?.[0]||(fe.findOptions.fields=[b.Content.Formulas]);const t=!(!x&&void 0===m);return t&&ae(t),n}),de||he.current?.focus()},[f,m,g,x]),l(()=>{se?(fe.findOptions.fields[0],b.Content.Values):oe(!0)},[se]),l(()=>{if(ie&&Q.current&&fe.findText===Q.current.value)return Q.current===document.activeElement||Q.current.contains(document.activeElement)?(Q.current?.select(),void oe(!1)):void Q.current.addEventListener("focus",()=>{Q.current?.select(),oe(!1)},{once:!0})},[ie,fe]);const[Oe,{width:Ce}]=R();return e(E,{ref:he,title:X??(se?"Find & Replace":"Find"),initialPosition:{y:"35"},autoFocusSel:".input",onHide:q,onFocus:()=>ue(!0),onBlur:()=>{ue(!1),pe(!1)},PaperProps:{elevation:de?3:1},...J,children:n(a,{dividers:!0,ref:Oe,sx:{display:"flex",flexDirection:"column",paddingLeft:e=>e.spacing(1.5),paddingRight:e=>e.spacing(1.5)},onKeyDown:e=>{if("h"===e.key&&e.ctrlKey)ae(!0),Q.current?.contains(document.activeElement)&&Y.current?.focus();else if("f"===e.key&&e.ctrlKey)Q.current?.focus();else if("c"===e.key&&e.altKey)me(e=>{const n={...e};return n.findOptions.matchCase=!e.findOptions.matchCase,n});else if("e"===e.key&&e.altKey)me(e=>{const n={...e};return n.findOptions.matchEntireCell=!e.findOptions.matchEntireCell,n});else{if("r"!==e.key||!e.altKey)return;me(e=>{const n={...e};return n.findOptions.useRegex=!e.findOptions.useRegex,n})}e.preventDefault()},children:[n(c,{sx:{display:"flex",flexDirection:"row",gap:e=>e.spacing(1)},children:[n(c,{sx:{display:"flex",flexDirection:"row",alignItems:"start",gap:e=>e.spacing(.25),paddingTop:"3px"},children:[e(S,{selected:le,onSelectToggle:e=>{re(e)},preventFocus:!0,label:"Toggle Additional Options",icon:F(e(I,{}))}),e(S,{selected:se,onSelectToggle:e=>{ae(e)},preventFocus:!0,label:"Toggle Replace",icon:F(e(D,{})),shortcut:{key:se?"F":"H",modifiers:[w.Ctrl]}})]}),n(c,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box"},children:[n(c,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e(p,{label:"Find",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),minWidth:Ce>460?"20em":void 0,backgroundImage:`linear-gradient(${V("#fff",A(5))}, ${V("#fff",A(5))})`},inputProps:{draggable:!1,ref:Q,className:"input",autoFocus:!0,spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}},endAdornment:e(d,{sx:{transform:"scale(0.75) translateX(16px)"},position:"end",children:n(c,{sx:{display:"flex",alignItems:"center",flexDirection:"row",gap:"1px"},children:[e(S,{selected:fe.findOptions.matchCase,onSelectToggle:e=>{me(n=>{const t={...n};return t.findOptions.matchCase=e,t})},label:"Match Case",shortcut:{key:"C",modifiers:[w.Alt]},icon:F(e(K,{}))}),e(S,{selected:fe.findOptions.matchEntireCell,onSelectToggle:e=>{me(n=>{const t={...n};return t.findOptions.matchEntireCell=e,t})},label:"Match Entire Cell",shortcut:{key:"E",modifiers:[w.Alt]},icon:F(e(P,{}))}),e(S,{selected:fe.findOptions.useRegex,onSelectToggle:e=>{me(n=>{const t={...n};return t.findOptions.useRegex=e,t})},label:"Use Regular Expression",shortcut:{key:"R",modifiers:[w.Alt]},icon:F(e($,{}))})]})})},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1),"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>ce?`${e.palette.error.main} !important`:void 0},"& .MuiInputLabel-outlined":{color:e=>ce?`${e.palette.error.main} !important`:void 0}},value:fe.findText??"",onChange:e=>{me(n=>{const t={...n};return t.findText=e.target.value,t})},onKeyDown:e=>xe(e,!1),onContextMenu:e=>{e.stopPropagation()}}),e(S,{selected:fe.findOptions.reverse,onSelectToggle:e=>{ge(!1,!1)},touchRippleRef:Z,label:"",shortcut:{key:"Enter",modifiers:[w.Shift]},icon:F(fe.findOptions.orientation!==T.Orientation.Column?e(h,{}):e(O,{})),disabled:!fe.findText}),e(S,{selected:!fe.findOptions.reverse,onSelectToggle:e=>{ge(!0,!1)},touchRippleRef:_,label:"Next Match",shortcut:{key:"Enter"},icon:F(fe.findOptions.orientation!==T.Orientation.Column?e(C,{}):e(y,{})),disabled:!fe.findText})]}),e(u,{in:se,timeout:W,onExit:()=>{Q.current?.focus()},children:n(c,{sx:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:e=>e.spacing(2)},children:[e(p,{label:"Replace",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),backgroundImage:`linear-gradient(${V("#fff",A(5))}, ${V("#fff",A(5))})`},inputProps:{ref:Y,className:"input",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}}},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1)},value:fe.replaceText??"",onChange:e=>{me(n=>{const t={...n};return t.replaceText=e.target.value,t})},onKeyDown:e=>xe(e,!0),onContextMenu:e=>{e.stopPropagation()}}),e(S,{onSelectToggle:e=>{ge(!0,!0)},touchRippleRef:ee,label:"Replace",shortcut:{key:"Enter"},icon:F(e(M,{})),disabled:!fe.findText}),e(S,{onSelectToggle:e=>{ge(!0,!0,!0)},touchRippleRef:ne,label:"Replace All",shortcut:{key:"Enter",modifiers:[w.Ctrl,w.Alt]},icon:F(e(B,{})),disabled:!fe.findText})]})})]})]}),e(u,{in:le,timeout:W,onExit:()=>{Q.current?.focus()},children:n(c,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:e=>e.spacing(.5),marginTop:e=>e.spacing(1)},children:[e(L,{orientation:"horizontal",sx:{marginBottom:e=>e.spacing(1.5)}}),n(c,{sx:{display:"flex",flexDirection:Ce>=413?"row":"column",justifyContent:"space-evenly",alignItems:"center",rowGap:e=>e.spacing(2)},tabIndex:-1,children:[e(j,{label:"Within",value:fe.scope,options:N,onSelect:e=>{me(n=>{const t={...n};return t.scope=e,t})}}),e(j,{label:"Search",value:fe.findOptions.orientation!==T.Orientation.Column,options:U,onSelect:e=>{me(n=>{const t={...n};return t.findOptions.orientation=e?T.Orientation.Row:T.Orientation.Column,t})}}),e(j,{label:"Look in",value:se&&fe.findOptions.fields?.[0]===b.Content.Values?b.Content.Formulas:fe.findOptions.fields?.[0],options:se?z:H,onSelect:e=>{me(n=>{const t={...n};return t.findOptions.fields=[e],t})}})]})]})})]})})});export{q as FindReplaceWindow,N as ScopeOptions,q as default};
|