@sheetxl/studio-vanilla 0.4.11 → 0.4.13
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/{DFspSkki779xN-Ey.cjs → -DkdmW3XP1ICRY25.cjs} +2 -2
- package/browser/cjs/B-KQs1Bf48nEucW7.cjs +7 -0
- package/browser/cjs/B1xnY7pDnbnNzknG.cjs +7 -0
- package/browser/cjs/B6A5w_aWHkigBc6j.cjs +7 -0
- package/browser/cjs/B9jxuOg1CXcmbi9J.cjs +110 -0
- package/browser/cjs/BAYjkr4LmsWRLoPr.cjs +7 -0
- package/browser/cjs/{DFtyXc7YFh9dIp74.cjs → BG2uV2RpxrfZyCuV.cjs} +1 -1
- package/browser/cjs/{DiBy6-IxLscyMW2y.cjs → BGCPG4Ip5ZijUQwi.cjs} +2 -2
- package/browser/cjs/BHTlBOQH-tPGoKgo.cjs +7 -0
- package/browser/cjs/BLBNzBvRVl9VLynf.cjs +7 -0
- package/browser/cjs/BLh6E7ER8mrM6vc_.cjs +7 -0
- package/browser/cjs/{CuTW2Pt-L5n-hNxV.cjs → BMaq_2S3IFrE5XeJ.cjs} +1 -1
- package/browser/cjs/BO7Pbclmywy-QCSV.cjs +13 -0
- package/browser/cjs/BPlthbyKkqCDjgxO.cjs +7 -0
- package/browser/cjs/BUGo0mXtBfFOmQXV.cjs +7 -0
- package/browser/cjs/BdHdXCz_K1djQgI4.cjs +7 -0
- package/browser/cjs/BfNkb1jDZkJf3wRA.cjs +7 -0
- package/browser/cjs/BfdQd2UEOlOc5iF3.cjs +7 -0
- package/browser/cjs/Bi9KvObgq_kJ_pjC.cjs +7 -0
- package/browser/cjs/BjPpJjnABDd3_WOZ.cjs +7 -0
- package/browser/cjs/BsSNzyN8kOGCKzso.cjs +7 -0
- package/browser/cjs/BtCcoaKKb8ZDnliG.cjs +7 -0
- package/browser/cjs/{DrlS1oz9Nea8Pm3j.cjs → BwHquG4sSd7OJjxz.cjs} +2 -2
- package/browser/cjs/{CjZbhk41S1qO_74G.cjs → BywNBbTVRYbgRbNI.cjs} +1 -1
- package/browser/cjs/C04Qr5P8uyQ6Vcml.cjs +7 -0
- package/browser/cjs/C42ZEPRmW9Wcd7tI.cjs +7 -0
- package/browser/cjs/{T4SHYo66xDT3l9JN.cjs → CBpt1PBR1VfBegko.cjs} +2 -2
- package/browser/cjs/CED8Az5C8GWF7pUT.cjs +7 -0
- package/browser/cjs/{BPTHTRDvNOVkUJGa.cjs → CbD4Wa5QLTdRCYcz.cjs} +2 -2
- package/browser/cjs/{C5FXOMLhAu_KTjVe.cjs → CbILz9Skl6lWf6yR.cjs} +1 -1
- package/browser/cjs/CoFQQqIzuvS9PM77.cjs +7 -0
- package/browser/cjs/{BlSFY6zLlebuejdV.cjs → CpDNo2Lhwr5ZHECs.cjs} +2 -2
- package/browser/cjs/{D3iOk-Q2tRdUeTcn.cjs → CsamfGfFsItvSgo_.cjs} +1 -1
- package/browser/cjs/Cx3kn5gBsQ-1bORi.cjs +7 -0
- package/browser/cjs/CxLvGnG44-qNI36G.cjs +7 -0
- package/browser/cjs/D-xyWit7jxctQCpR.cjs +7 -0
- package/browser/cjs/D4XQsK7d7DRctaOO.cjs +7 -0
- package/browser/cjs/D9rVEA1BdB0JZwhE.cjs +7 -0
- package/browser/cjs/DES2NmIRVZg-HXgs.cjs +7 -0
- package/browser/cjs/{BshvMtUxTJHj3JQN.cjs → DFxeLNhACFIHb0nv.cjs} +2 -2
- package/browser/cjs/DIv1SrLYeyVwcaxE.cjs +7 -0
- package/browser/cjs/DJ6L43osbaMzEV5K.cjs +7 -0
- package/browser/cjs/DMjLN_HDktNzzUB8.cjs +7 -0
- package/browser/cjs/DVPfPZCFjmYu3xyn.cjs +7 -0
- package/browser/cjs/DhSlaiQXxEOVtZkA.cjs +7 -0
- package/browser/cjs/{Dx-jp_LJxWbAScyA.cjs → Dh_dFnagz7dMZlGh.cjs} +1 -1
- package/browser/cjs/DpF6vgGka2d-RKkb.cjs +10 -0
- package/browser/cjs/{C7EZCTczsC-gkRcq.cjs → DtY0Jzlwnr_YKnV4.cjs} +2 -2
- package/browser/cjs/DwyyFI1Ix0uc0Qoz.cjs +7 -0
- package/browser/cjs/Dy5_viRzFls9rOzN.cjs +7 -0
- package/browser/cjs/GkINjQ8Te3GKi2mx.cjs +7 -0
- package/browser/cjs/aN3KCqswA1SdJIMq.cjs +7 -0
- package/browser/cjs/{BuWtGFX0HiBezGjw.cjs → hLJbgylpETByV4wc.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/qumqKlVHFx89iLeu.cjs +7 -0
- package/browser/cjs/{BAyEOOtO-9sHQQRW.cjs → rKZjTYQ0WpTriIv6.cjs} +2 -2
- package/browser/cjs/xjKotAOVt3JH36U7.cjs +7 -0
- package/browser/cjs/ymbPxio09Fw7I2BW.cjs +7 -0
- package/browser/esm/2P5dQT7wZToOh-n9.mjs +7 -0
- package/browser/esm/4GgcUVhUmQmiv9Ha.mjs +110 -0
- package/browser/esm/7_x68v6PpvRDox_Z.mjs +7 -0
- package/browser/esm/9icgSuuzXq6mlgM8.mjs +7 -0
- package/browser/esm/B354iAatN9y9AIIP.mjs +7 -0
- package/browser/esm/B5EVyoxm3aSlAnxN.mjs +7 -0
- package/browser/esm/BD8rE7MUxuHXsdcf.mjs +7 -0
- package/browser/esm/BGFWI1a1PmU8_hCE.mjs +7 -0
- package/browser/esm/BI6JAQCQx1V0F2aC.mjs +7 -0
- package/browser/esm/BIYg30d_9HaluFFz.mjs +7 -0
- package/browser/esm/BKL-uyBp_OE47lXd.mjs +7 -0
- package/browser/esm/BMwJCtLAYUW8wExX.mjs +13 -0
- package/browser/esm/BNOfK-lGWF2S8vQE.mjs +7 -0
- package/browser/esm/Ba433v6lQUMtECiY.mjs +7 -0
- package/browser/esm/BbZWfDW2LUyjqUDy.mjs +7 -0
- package/browser/esm/C238uBmZN1XXqMUb.mjs +7 -0
- package/browser/esm/C34whwRkHO0lhq4-.mjs +7 -0
- package/browser/esm/C6FEpAqSZoW5Hgte.mjs +7 -0
- package/browser/esm/COlW5ULL29SUKN1Z.mjs +7 -0
- package/browser/esm/CRyxOj2xPj9qe9LK.mjs +7 -0
- package/browser/esm/CVeyOpbAhaBhDRye.mjs +7 -0
- package/browser/esm/CVyVvtlJuCTn4MDh.mjs +7 -0
- package/browser/esm/CapeIfjWq-_BHMlE.mjs +7 -0
- package/browser/esm/CcQqGNgK2CsgNtuD.mjs +7 -0
- package/browser/esm/CdZSxrk3k1Lx6G8W.mjs +7 -0
- package/browser/esm/CdchvB_wAbv_6Whw.mjs +7 -0
- package/browser/esm/{Cc_VWd0wF5-39LsI.mjs → Cf8eDl3Tu5NAWWwG.mjs} +1 -1
- package/browser/esm/{BXUGsC1Mo3FP8vnW.mjs → Cfq9tttQlsKvfaCr.mjs} +2 -2
- package/browser/esm/{BDVJ7eOPpW5FnEAP.mjs → ClR6uLJoM-xKVYEc.mjs} +1 -1
- package/browser/esm/Cnl_e-EYkZ3CLbi2.mjs +7 -0
- package/browser/esm/CtRS2ZCPF7IH_mXe.mjs +7 -0
- package/browser/esm/{BUSR_OK5Qi6hRPfw.mjs → CuV-bwi1vcXAqFUY.mjs} +1 -1
- package/browser/esm/CwVE0qelO_xgf-l1.mjs +7 -0
- package/browser/esm/{CFFC0SNc24a0Dxnh.mjs → D1Dzlta8ZVy08ng6.mjs} +2 -2
- package/browser/esm/D1TjRQiHLWhpl-dl.mjs +7 -0
- package/browser/esm/D8BJ-y3ulgO_ezrj.mjs +10 -0
- package/browser/esm/{BlGoi1_x9rUMpWMd.mjs → DTDXNEbHVnnZONNL.mjs} +1 -1
- package/browser/esm/DTWfi8Dl-c2s5moT.mjs +7 -0
- package/browser/esm/DYVBXcu1r5KRLB-1.mjs +7 -0
- package/browser/esm/{BGpv6Kq7eBlJy43T.mjs → DZjWyWMvr2XHQrBg.mjs} +1 -1
- package/browser/esm/DhHK4QmASvgAq9Xy.mjs +7 -0
- package/browser/esm/{PS0cqYnlMVEGOQpI.mjs → DoFV2S6Su86IN5Ul.mjs} +2 -2
- package/browser/esm/Dq3ybkgattcCsF_4.mjs +7 -0
- package/browser/esm/DqWoZ4TjweoJWX3o.mjs +7 -0
- package/browser/esm/DtXxHirBm16ldE1l.mjs +7 -0
- package/browser/esm/DtuWZG6c_8vKRSdr.mjs +7 -0
- package/browser/esm/FBG8XXdIMd9PfUIo.mjs +7 -0
- package/browser/esm/Nh7JiwvF01PblHQ0.mjs +7 -0
- package/browser/esm/PVYiH9vBQM6rqXI4.mjs +7 -0
- package/browser/esm/U5-LDZQ0qkJ2Y-p8.mjs +7 -0
- package/browser/esm/XhQDWZu47oe6bwHh.mjs +7 -0
- package/browser/esm/_BjU6TtI-mQfFpfy.mjs +7 -0
- package/browser/esm/{Cq8D_M0jeHLcnRjg.mjs → gOUfyCw957TzcbNB.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/lmkbfs9sNc7f0oe5.mjs +7 -0
- package/browser/esm/{tFhROdVSw9KLQfUN.mjs → naa0kcRwxHEYGaQB.mjs} +2 -2
- package/browser/esm/qxOkQutRxmAi1vRh.mjs +7 -0
- package/browser/esm/tMSro0g2GM5BBTIH.mjs +7 -0
- package/cdn/assets/0e9wDKSn4SFxSmP5.js +27 -0
- package/cdn/assets/0j_nQmV1Bb0lJ6sB.js +472 -0
- package/cdn/assets/2mxiQm6dELsqQoX7.js +5624 -0
- package/cdn/assets/5XdpCWQ6AcxZ6oY1.js +10 -0
- package/cdn/assets/6JtXguBKwGj6dqfy.js +1577 -0
- package/cdn/assets/8U2WVdbZHYCBnd9L.js +23 -0
- package/cdn/assets/9-cIcj6CRJx5HTn9.js +10 -0
- package/cdn/assets/B-kFRtzNNkf4_SiP.js +1701 -0
- package/cdn/assets/B1Iys8a964LGNZKf.js +10 -0
- package/cdn/assets/B2RAJJJFkcaWUfUW.js +21 -0
- package/cdn/assets/BAzGoI9gE2G3F3on.js +637 -0
- package/cdn/assets/BBJxLS-wB_nXRnI2.js +10 -0
- package/cdn/assets/BDE7FUo2oiivrvBL.js +43 -0
- package/cdn/assets/BL6TUDSeou6wPejW.js +10 -0
- package/cdn/assets/BLqaorJ5Wl-1YOoy.js +3875 -0
- package/cdn/assets/BMiA9p1uOrwnooVT.js +10 -0
- package/cdn/assets/BNh9nSR83reiVMKt.js +90 -0
- package/cdn/assets/BQON-ToGsIBPrPkM.js +1371 -0
- package/cdn/assets/BUwNyHytF9St68tJ.js +10 -0
- package/cdn/assets/BVYDmdUGWvMG5gNK.js +241 -0
- package/cdn/assets/B_2bXmyji3Dr7LRM.js +50224 -0
- package/cdn/assets/BciokME96sykArSM.js +10 -0
- package/cdn/assets/BgnlshX157Ob6RLs.js +21 -0
- package/cdn/assets/BlYoycYtR-sUp0iC.js +27 -0
- package/cdn/assets/Bsa9-Itkf_SdDBM9.js +6481 -0
- package/cdn/assets/BwpBFv8Ks2ka07ch.js +10 -0
- package/cdn/assets/BxblmHGC7YxZcuak.js +10 -0
- package/cdn/assets/C-Z8wvIy20kJ7R-k.js +10 -0
- package/cdn/assets/C3EFzvmp0DcC_HAx.js +10 -0
- package/cdn/assets/C4vStn7wNlvrxdsp.js +10 -0
- package/cdn/assets/C5q0qaKi2eeDgoO8.js +10 -0
- package/cdn/assets/C9eQW5GKgPRmKKgJ.js +29 -0
- package/cdn/assets/CHTspRZD2v_dU_eV.js +22 -0
- package/cdn/assets/CKA4s2hlzSnrdWSD.js +10 -0
- package/cdn/assets/CMBDD1Mjde6UL5ep.js +84 -0
- package/cdn/assets/CR01MBraUPYPpwy4.js +36 -0
- package/cdn/assets/CT0d1P-Aav62lUvV.js +10 -0
- package/cdn/assets/CV8UjJPDVplXjK1E.js +49 -0
- package/cdn/assets/CrLrvmlJhYpNpXqR.js +10 -0
- package/cdn/assets/CsorxCiOoe7qX9j1.js +10 -0
- package/cdn/assets/CuNqTH3P8mCglRiz.js +10 -0
- package/cdn/assets/CwdMjMPFdIs8SAV0.js +1358 -0
- package/cdn/assets/D-5VYBO5_VEh6fEW.js +24 -0
- package/cdn/assets/DD3csu4pddGtMp3n.js +1468 -0
- package/cdn/assets/DFHruAftzuzBZ71r.js +393 -0
- package/cdn/assets/DHydjLSnijEgtpyU.js +10 -0
- package/cdn/assets/DPQqTIMsRLhMxPIy.js +820 -0
- package/cdn/assets/DUtu7r6CzW4dtW3E.js +50 -0
- package/cdn/assets/DXHirQMr483hJBil.js +58 -0
- package/cdn/assets/DXtbonLk2ESfF4Dh.js +10 -0
- package/cdn/assets/Dr5X-ng9wbwUWVr4.js +41 -0
- package/cdn/assets/DvFNLgeMJ9LdQROu.js +149 -0
- package/cdn/assets/Dvj7UEckqOBrgs9i.js +3947 -0
- package/cdn/assets/F6zW9Vj410C4yRVG.js +424 -0
- package/cdn/assets/Gz4u4ewyWfB-Pf-a.js +1703 -0
- package/cdn/assets/KDGtuIzSpkf1vsmH.js +10 -0
- package/cdn/assets/KtKlo5mM4kTTfFgi.js +46 -0
- package/cdn/assets/N3pWBoccPrTedAw-.js +12 -0
- package/cdn/assets/NTINjW8JjyZudT8s.js +13449 -0
- package/cdn/assets/R9RwlorPWfftoboH.js +2373 -0
- package/cdn/assets/Xwyp21e7L5fTeb_y.js +423 -0
- package/cdn/assets/XysyS9rk9tFdbzZh.js +2183 -0
- package/cdn/assets/f3_QXO8z0p-q4nJo.js +46 -0
- package/cdn/assets/quOP5QFyTT9soNIl.js +12 -0
- package/cdn/index.js +41 -37
- package/cdn/loader.js +1 -1
- package/package.json +3 -5
- package/browser/cjs/B0rdyyttE2Aibsag.cjs +0 -7
- package/browser/cjs/B2e7dDI-zKoqXpIW.cjs +0 -107
- package/browser/cjs/BplA5pDzOJpfTZuA.cjs +0 -7
- package/browser/cjs/CFcjX5-nVsgzdZ4F.cjs +0 -7
- package/browser/cjs/Db_Ew1r6yOMYylvA.cjs +0 -7
- package/browser/cjs/DgBn3aW39yjgm0X_.cjs +0 -7
- package/browser/cjs/SzxJv7OUs5ojl8gx.cjs +0 -7
- package/browser/cjs/vfUix5Di0Ro8tEID.cjs +0 -7
- package/browser/esm/B5kkStdEkTczERyM.mjs +0 -7
- package/browser/esm/B905wKzTtod-jbsD.mjs +0 -7
- package/browser/esm/BALnKy2Fp7fyk-lc.mjs +0 -7
- package/browser/esm/Bo_ZPRrOQrqOVHAF.mjs +0 -7
- package/browser/esm/BuURCm92KsyGHG9e.mjs +0 -7
- package/browser/esm/CGZ5MX7afzMxDkCe.mjs +0 -7
- package/browser/esm/CzmNwV9tfFYUp_gS.mjs +0 -7
- package/browser/esm/De6RPxc4p_jXLlT5.mjs +0 -7
- package/browser/esm/DlVZFM9ZR5jGyG0_.mjs +0 -7
- package/browser/esm/DqXxZP6yKF4U1YfY.mjs +0 -7
- package/browser/esm/DtmE60AvstK9u0Ta.mjs +0 -107
- package/browser/esm/Dz2OVgq3kxi1TkfX.mjs +0 -7
- package/browser/esm/QBGUD1XS5_pysBLL.mjs +0 -7
- package/browser/esm/uGDCdtqxjqRCo4Xn.mjs +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@sheetxl/sdk");exports.fromBufferCSV=async(t,r)=>{const{papaParseConfig:o,setValuesOptions:n,createWorkbookOptions:s}=r??{},a=await Promise.resolve().then(()=>require("./CuTW2Pt-L5n-hNxV.cjs")).then(e=>e.p),l=(new TextDecoder).decode(t);let i=-1;const c=new e.Workbook(s),d=c.getSelectedSheet().getEntireRange().startIncrementalUpdates({orientation:e.IRange.Orientation.Row}),u=r?.onProgress;let p=0;const f={...o,transform:(e,t)=>{o?.transform&&(e=o.transform(e,t));const r=t;0===r&&i++;let n=e??"";return d.pushAt(i,r,n),p++,p%1e5==0&&u?.(p),e}};return a.parse(l,f).data,d.apply({textParser:!0,...n}),c},exports.toBufferCSV=async(e,t)=>{const{trimLeadingBlankRow:r=!0,trimLeadingBlankColumn:o=!0,excludeHidden:n=!1,sheetKey:s=null,papaParseConfig:a={}}=t||{},l=await Promise.resolve().then(()=>require("./CuTW2Pt-L5n-hNxV.cjs")).then(e=>e.p);if(!e)throw new Error("workbook must be specified");let i=null;if(null===s?i=e.getSelectedSheet():"number"==typeof s?i=e.getSheets().search()[s]:"string"==typeof s&&(i=e.getSheets().getByName(s)),!i)throw new Error("invalid sheetKey specified");let c=null;const d=[];let u=null,p=i.getUsedRange({excludeHidden:n});if(!p)throw new Error("Nothing to export");if(!r||!o){const e=r?p.getRowStart():0,t=o?p.getColumnStart():0;p=p.getOffsetTo(e,t)}p.forEach((e,t)=>{const r=t.getCoords(),o=t.getCell();c!==r.rowIndex&&(u&&d.push(u),u=[],c=r.rowIndex);const n=o.toTextUnformatted()??"";u.push(n)},{includeEmpty:!0,address:null}),u&&d.push(u);const f={...a},g=l.unparse(d,f);return(new TextEncoder).encode(g).buffer};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@sheetxl/sdk");exports.fromBufferJSON=async(r,t)=>{let n=r;(function(e){if(e.byteLength<4)return!1;const r=new Uint8Array(e),t={gzip:[31,139],zip:[80,75,3,4],bz2:[66,90,104],br:[206,178,207,129]},n=Object.keys(t);for(let e=0;e<n.length;e++){const o=n[e],i=t[o];let f=!0;for(let e=0;e<i.length;e++)if(r[e]!==i[e]){f=!1;break}if(f)return o}return!1})(n)&&(n=await async function(e,r="gzip"){let t;"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?(t=new ArrayBuffer(e.byteLength),new Uint8Array(t).set(new Uint8Array(e))):t=e;const n=new Blob([t]).stream(),o=new DecompressionStream(r),i=n.pipeThrough(o);return(await new Response(i).blob()).arrayBuffer()}(n));let o=(new TextDecoder).decode(n);const i=JSON.parse(o),f={...t?.createWorkbookOptions??{},json:i};return new e.Workbook(f)},exports.toBufferJSON=async(e,r)=>{const t=await e.toJSON(),n=r?.whiteSpace??0;let o;r?.beforeWrite?.(e,t),o=0===n?JSON.stringify(t):function(e,r=2){const t=[];function n(e){const n=r*e;return void 0===t[n]&&(t[n]=" ".repeat(n)),t[n]}return function e(r,t,o,i){if(null==r||"object"!=typeof r)return JSON.stringify(r);const f=n(t),s=n(t+1);if(Array.isArray(r)){const n=r.length;if(0===n)return"[]";if(0!==o)return JSON.stringify(r);let i="[\n";for(let f=0;f<n;f++)i+=s+e(r[f],t+1,o+1,!0),f<n-1&&(i+=",\n");return i+="\n"+f+"]",i}const a=Object.keys(r),u=a.length;if(0===u)return"{}";if(!(o<2))return JSON.stringify(r);let c="{\n";i||(o=0);for(let n=0;n<u;n++){const i=a[n];c+=s+JSON.stringify(i)+": "+e(r[i],t+1,o,!1),n<u-1&&(c+=",\n")}return c+="\n"+f+"}",c}(e,0,0,!1)}(t,n);let i=(new TextEncoder).encode(o).buffer;const f=r?.compress??!0;return f&&(i=await async function(e,r="gzip"){let t;"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?(t=new ArrayBuffer(e.byteLength),new Uint8Array(t).set(new Uint8Array(e))):t=e;const n=new ReadableStream({start(e){e.enqueue(t),e.close()}}),o=new CompressionStream(r),i=n.pipeThrough(o);return(await new Response(i).blob()).arrayBuffer()}(i,"string"==typeof f?f:void 0)),i};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B2e7dDI-zKoqXpIW.cjs"),t=require("@sheetxl/sdk"),n=e.createSvgIcon(e.jsxRuntimeExports.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),s=e.createSvgIcon(e.jsxRuntimeExports.jsx("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"}),"ArrowDownward"),o=e.createSvgIcon(e.jsxRuntimeExports.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),i=e.createSvgIcon(e.jsxRuntimeExports.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward"),r=e.reactExports.memo(t=>{const{label:n,value:s,options:o,onSelect:i,tabIndex:r=0,...l}=t,[a,c]=e.reactExports.useState(()=>u(s,o));e.reactExports.useEffect(()=>{c(u(s,o))},[s,o]);const p=e.go(e=>{c(e.target.value),i?.(o[e.target.value])},[i,o]),x=e.reactExports.useMemo(()=>Object.keys(o).map(t=>e.jsxRuntimeExports.jsx(e.MenuItem,{value:t,children:t},t)),[o]);return e.jsxRuntimeExports.jsxs(e.FormControl,{sx:{minWidth:135},size:"small",children:[e.jsxRuntimeExports.jsx(e.InputLabel,{children:n}),e.jsxRuntimeExports.jsx(e.Select,{inputProps:{tabIndex:r},value:a,label:n,onChange:p,sx:{backgroundImage:`linear-gradient(${e.alpha("#fff",e.hx(5))}, ${e.alpha("#fff",e.hx(5))})`},...l,children:x})]})}),l={Workbook:"workbook",Sheet:"sheet"},a={enter:140,exit:140},c={Formulas:t.ICell.Content.Formulas,Values:t.ICell.Content.Values,Notes:t.ICell.Content.Notes,Comments:t.ICell.Content.Comments},p={...c};delete p.Values;const x={"By Rows":!0,"By Columns":!1},u=(e,t)=>{const n=Object.keys(t);for(let s=0;s<n.length;s++){const o=n[s];if(t[o]===e)return o}},d=e.reactExports.memo(u=>{const{replace:d=!1,findText:f,replaceText:m,findOptions:g,replaceOptions:j,title:h,onHide:E,onFindOrReplace:R,...C}=u,O=e.reactExports.useRef(null),y=e.reactExports.useRef(null),I=e.reactExports.useRef(null),b=e.reactExports.useRef(null),v=e.reactExports.useRef(null),k=e.reactExports.useRef(null),T=(e,t)=>{t&&(t.start(e,{center:!1}),setTimeout(()=>t.stop(e),180))},[S,w]=e.reactExports.useState(!1),[F,B]=e.reactExports.useState(!1),[L,D]=e.reactExports.useState(d),[P,A]=e.reactExports.useState(!1),[M,K]=e.reactExports.useState(!1),[V,z]=e.reactExports.useState({findText:null,replaceText:null,replace:d,replaceOptions:{},findOptions:{matchCase:!1,matchEntireCell:!1,useRegex:!1,orientation:t.IRange.Orientation.Row,fields:[t.ICell.Content.Formulas]},scope:l.Sheet}),H=e.go(async(e,n,s,o)=>{if(!R)return;const i={...V};i.replaceOptions={...i.replaceOptions},i.findOptions={...i.findOptions},i.replaceOptions.maxCount=s?void 0:1,i.replace=n,n&&V.findOptions.fields?.[0]===t.ICell.Content.Values&&(i.findOptions.fields=[t.ICell.Content.Formulas]),i.findOptions.reverse=!e;const r=await R({autoFocus:o,...i});A(0===r)},[V,R]);e.reactExports.useEffect(()=>{A(!1)},[V,F,L]);const $=e.go((t,n)=>{if(t.keyCode===e.io.Enter){if(!V.findText)return;let e=!0,s=!1;t.shiftKey&&(e=!1),n?(t.ctrlKey&&t.altKey&&(s=!0),T(t,s?k.current:v.current)):T(t,e?b.current:I.current),H(e,n,s,!1)}},[V]),N=e.reactExports.useRef(null);e.reactExports.useLayoutEffect(()=>{z(e=>{const n={...e};n.findText=f&&f.length>0?f:e.findText??"",w(!0),void 0!==m&&(n.replaceText=m),g&&(n.findOptions={...n.findOptions,...g}),n.replaceText||(n.replaceText=""),n.replaceOptions&&(n.replaceOptions={...n.replaceOptions}),j&&(n.replaceOptions={...n.replaceOptions,...j}),V.findOptions.fields?.[0]||(V.findOptions.fields=[t.ICell.Content.Formulas]);const s=!(!j&&void 0===m);return s&&D(s),n}),M||N.current?.focus()},[f,m,g,j]),e.reactExports.useEffect(()=>{L?(V.findOptions.fields[0],t.ICell.Content.Values):w(!0)},[L]),e.reactExports.useEffect(()=>{if(S&&O.current&&V.findText===O.current.value)return O.current===document.activeElement||O.current.contains(document.activeElement)?(O.current?.select(),void w(!1)):void O.current.addEventListener("focus",()=>{O.current?.select(),w(!1)},{once:!0})},[S,V]);const[W,{width:q}]=e._I();return e.jsxRuntimeExports.jsx(e.Vg,{ref:N,title:h??(L?"Find & Replace":"Find"),initialPosition:{y:"35"},autoFocusSel:".input",onHide:E,onFocus:()=>K(!0),onBlur:()=>{K(!1),A(!1)},PaperProps:{elevation:M?3:1},...C,children:e.jsxRuntimeExports.jsxs(e.DialogContent,{dividers:!0,ref:W,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)D(!0),O.current?.contains(document.activeElement)&&y.current?.focus();else if("f"===e.key&&e.ctrlKey)O.current?.focus();else if("c"===e.key&&e.altKey)z(e=>{const t={...e};return t.findOptions.matchCase=!e.findOptions.matchCase,t});else if("e"===e.key&&e.altKey)z(e=>{const t={...e};return t.findOptions.matchEntireCell=!e.findOptions.matchEntireCell,t});else{if("r"!==e.key||!e.altKey)return;z(e=>{const t={...e};return t.findOptions.useRegex=!e.findOptions.useRegex,t})}e.preventDefault()},children:[e.jsxRuntimeExports.jsxs(e.Box,{sx:{display:"flex",flexDirection:"row",gap:e=>e.spacing(1)},children:[e.jsxRuntimeExports.jsxs(e.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"start",gap:e=>e.spacing(.25),paddingTop:"3px"},children:[e.jsxRuntimeExports.jsx(e.sm,{selected:F,onSelectToggle:e=>{B(e)},preventFocus:!0,label:"Toggle Additional Options",icon:e.kc(e.jsxRuntimeExports.jsx(e.zh,{}))}),e.jsxRuntimeExports.jsx(e.sm,{selected:L,onSelectToggle:e=>{D(e)},preventFocus:!0,label:"Toggle Replace",icon:e.kc(e.jsxRuntimeExports.jsx(e.Ph,{})),shortcut:{key:L?"F":"H",modifiers:[e.ro.Ctrl]}})]}),e.jsxRuntimeExports.jsxs(e.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box"},children:[e.jsxRuntimeExports.jsxs(e.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.TextField,{label:"Find",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),minWidth:q>460?"20em":void 0,backgroundImage:`linear-gradient(${e.alpha("#fff",e.hx(5))}, ${e.alpha("#fff",e.hx(5))})`},inputProps:{draggable:!1,ref:O,className:"input",autoFocus:!0,spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}},endAdornment:e.jsxRuntimeExports.jsx(e.InputAdornment,{sx:{transform:"scale(0.75) translateX(16px)"},position:"end",children:e.jsxRuntimeExports.jsxs(e.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"row",gap:"1px"},children:[e.jsxRuntimeExports.jsx(e.sm,{selected:V.findOptions.matchCase,onSelectToggle:e=>{z(t=>{const n={...t};return n.findOptions.matchCase=e,n})},label:"Match Case",shortcut:{key:"C",modifiers:[e.ro.Alt]},icon:e.kc(e.jsxRuntimeExports.jsx(e.Fh,{}))}),e.jsxRuntimeExports.jsx(e.sm,{selected:V.findOptions.matchEntireCell,onSelectToggle:e=>{z(t=>{const n={...t};return n.findOptions.matchEntireCell=e,n})},label:"Match Entire Cell",shortcut:{key:"E",modifiers:[e.ro.Alt]},icon:e.kc(e.jsxRuntimeExports.jsx(e.Nh,{}))}),e.jsxRuntimeExports.jsx(e.sm,{selected:V.findOptions.useRegex,onSelectToggle:e=>{z(t=>{const n={...t};return n.findOptions.useRegex=e,n})},label:"Use Regular Expression",shortcut:{key:"R",modifiers:[e.ro.Alt]},icon:e.kc(e.jsxRuntimeExports.jsx(e.Bh,{}))})]})})},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1),"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>P?`${e.palette.error.main} !important`:void 0},"& .MuiInputLabel-outlined":{color:e=>P?`${e.palette.error.main} !important`:void 0}},value:V.findText??"",onChange:e=>{z(t=>{const n={...t};return n.findText=e.target.value,n})},onKeyDown:e=>$(e,!1),onContextMenu:e=>{e.stopPropagation()}}),e.jsxRuntimeExports.jsx(e.sm,{selected:V.findOptions.reverse,onSelectToggle:e=>{H(!1,!1)},touchRippleRef:I,label:"",shortcut:{key:"Enter",modifiers:[e.ro.Shift]},icon:e.kc(V.findOptions.orientation!==t.IRange.Orientation.Column?e.jsxRuntimeExports.jsx(n,{}):e.jsxRuntimeExports.jsx(i,{})),disabled:!V.findText}),e.jsxRuntimeExports.jsx(e.sm,{selected:!V.findOptions.reverse,onSelectToggle:e=>{H(!0,!1)},touchRippleRef:b,label:"Next Match",shortcut:{key:"Enter"},icon:e.kc(V.findOptions.orientation!==t.IRange.Orientation.Column?e.jsxRuntimeExports.jsx(o,{}):e.jsxRuntimeExports.jsx(s,{})),disabled:!V.findText})]}),e.jsxRuntimeExports.jsx(e.Collapse,{in:L,timeout:a,onExit:()=>{O.current?.focus()},children:e.jsxRuntimeExports.jsxs(e.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:e=>e.spacing(2)},children:[e.jsxRuntimeExports.jsx(e.TextField,{label:"Replace",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),backgroundImage:`linear-gradient(${e.alpha("#fff",e.hx(5))}, ${e.alpha("#fff",e.hx(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:V.replaceText??"",onChange:e=>{z(t=>{const n={...t};return n.replaceText=e.target.value,n})},onKeyDown:e=>$(e,!0),onContextMenu:e=>{e.stopPropagation()}}),e.jsxRuntimeExports.jsx(e.sm,{onSelectToggle:e=>{H(!0,!0)},touchRippleRef:v,label:"Replace",shortcut:{key:"Enter"},icon:e.kc(e.jsxRuntimeExports.jsx(e.Vh,{})),disabled:!V.findText}),e.jsxRuntimeExports.jsx(e.sm,{onSelectToggle:e=>{H(!0,!0,!0)},touchRippleRef:k,label:"Replace All",shortcut:{key:"Enter",modifiers:[e.ro.Ctrl,e.ro.Alt]},icon:e.kc(e.jsxRuntimeExports.jsx(e.Hh,{})),disabled:!V.findText})]})})]})]}),e.jsxRuntimeExports.jsx(e.Collapse,{in:F,timeout:a,onExit:()=>{O.current?.focus()},children:e.jsxRuntimeExports.jsxs(e.Box,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:e=>e.spacing(.5),marginTop:e=>e.spacing(1)},children:[e.jsxRuntimeExports.jsx(e.Mp,{orientation:"horizontal",sx:{marginBottom:e=>e.spacing(1.5)}}),e.jsxRuntimeExports.jsxs(e.Box,{sx:{display:"flex",flexDirection:q>=413?"row":"column",justifyContent:"space-evenly",alignItems:"center",rowGap:e=>e.spacing(2)},tabIndex:-1,children:[e.jsxRuntimeExports.jsx(r,{label:"Within",value:V.scope,options:l,onSelect:e=>{z(t=>{const n={...t};return n.scope=e,n})}}),e.jsxRuntimeExports.jsx(r,{label:"Search",value:V.findOptions.orientation!==t.IRange.Orientation.Column,options:x,onSelect:e=>{z(n=>{const s={...n};return s.findOptions.orientation=e?t.IRange.Orientation.Row:t.IRange.Orientation.Column,s})}}),e.jsxRuntimeExports.jsx(r,{label:"Look in",value:L&&V.findOptions.fields?.[0]===t.ICell.Content.Values?t.ICell.Content.Formulas:V.findOptions.fields?.[0],options:L?p:c,onSelect:e=>{z(t=>{const n={...t};return n.findOptions.fields=[e],n})}})]})]})})]})})});exports.FindReplaceWindow=d,exports.ScopeOptions=l,exports.default=d;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B2e7dDI-zKoqXpIW.cjs"),t=require("@sheetxl/sdk"),n=({range:n,options:o,cell:s,onDone:i,...r})=>{const[l,a]=e.reactExports.useState(o??t.Sort.DefaultRangeOptions),x=e.go(e=>{let t=null;"Sort"===e&&(t={...o,options:l}),i?.(t)},[l,i,o]);return e.jsxRuntimeExports.jsx(e.sb,{title:"Sort",options:["Sort","Cancel"],onDone:x,...r,children:e.jsxRuntimeExports.jsxs(e.Box,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxRuntimeExports.jsx(e.FormControlLabel,{control:e.jsxRuntimeExports.jsx(e.Checkbox,{checked:!l.reverse,onChange:()=>a(e=>({...e,reverse:!e.reverse}))}),label:"Is Ascending",labelPlacement:"end"}),e.jsxRuntimeExports.jsx(e.FormControlLabel,{control:e.jsxRuntimeExports.jsx(e.Checkbox,{checked:l.hasHeader,onChange:()=>a(e=>({...e,hasHeader:!e.hasHeader}))}),label:"Has Header",labelPlacement:"end"}),e.jsxRuntimeExports.jsx(e.FormControlLabel,{control:e.jsxRuntimeExports.jsx(e.Checkbox,{checked:l.collatorOptions?.sensitivity===t.Sort.CaseSensitiveOptions.sensitivity,onChange:()=>a(e=>({...e,collatorOptions:l.collatorOptions?.sensitivity===t.Sort.CaseSensitiveOptions.sensitivity?t.Sort.CaseInsensitiveOptions:t.Sort.CaseSensitiveOptions}))}),label:"Case Sensitive",labelPlacement:"end"}),e.jsxRuntimeExports.jsx(e.FormControlLabel,{control:e.jsxRuntimeExports.jsx(e.Checkbox,{checked:l.orientation===t.IRange.Orientation.Row,onChange:()=>a(e=>{const o=e.orientation===t.IRange.Orientation.Row?t.IRange.Orientation.Column:t.IRange.Orientation.Row;return{...n.getDefaultSortCriteria(o,s).options,includeHidden:e.includeHidden,reverse:e.reverse,orientation:o}})}),label:"Row Sort",labelPlacement:"end"}),e.jsxRuntimeExports.jsx(e.FormControlLabel,{control:e.jsxRuntimeExports.jsx(e.Checkbox,{checked:l.includeHidden,onChange:()=>a(e=>({...e,includeHidden:!e.includeHidden}))}),label:"Include Hidden",labelPlacement:"end"})]})})};exports.SortDialog=n,exports.default=n;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./B2e7dDI-zKoqXpIW.cjs"),e=require("./B0rdyyttE2Aibsag.cjs"),s=require("@sheetxl/sdk");class r{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let e=0;e<this.list.length;e++)t(this.list[e],e,this)}}const o=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,i=t=>{const e=parseInt(t);return isNaN(e)?null:e},n=t=>{const e=parseFloat(t);return isNaN(e)?null:e},l=new Map;class a{constructor(t,e,s,r,o,i=null,n){const l=(t,e,s)=>n?.getRef?.(t,e,s,n?.parsedRefs),a=t=>n?.getRefs?.(t,n?.parsedRefs);this._parent=t,this.sharedShared=e,this.currentPath=s,this.elemRoot=r,this.jsonRoot=o,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs):(i&&(this._fileLocation=i),l&&a&&(this._getRef=l),a&&(this._getRefs=a),this._onWarning=n?.onWarning,this._addPerson=n?.addPerson)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??l}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let s=[e];const o=t.split("/");for(let t=0;t<o.length;t++){const e=o[t];if(""===e||"."===e)continue;let r=[];for(let t=0;t<s.length;t++){const o=s[t],i=o.childNodes;for(let t=0;i&&t<i.length;t++){const s=o.childNodes[t];s.localName!==e&&"*"!==e||r.push(s)}}s=r}return 1===s.length?s[0]:0===s.length?null:new r(s)}getFromPath(e,s){return t._n.getFromPath(e,s)}setToPath(e,s,r){return t._n.setToPath(e,s,r)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return null==o?s:"1"===o||"on"===o||"true"===o||"0"!==o&&"off"!==o&&"false"!==o&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return o}get INT_COPY(){return i}get FLOAT_COPY(){return n}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){if(null==i)return;if(i=o[t](i),null==i)return}else{if(null==i)return;if(i=o(i),null==i)return}this.setToPath(s,r,i)}}class c{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class u{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);1===o.nodeType&&"Relationship"===o.localName&&this.processRelationship(t,o,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const h=(s,r)=>{if(s||!s.hasAttribute("rot"))return;const o=s.getAttribute("rot"),i=t._n.roundAccurately(e.p(o),2);-1e3!==i&&(r.rotation=i)},p=(t,e,s,r,o)=>{const i=t.getValAttrAsString(r,e);null!==i&&(s[o]=i)},g=(t,e,s,r,o=r,i=null)=>{const n=t.getValAttrAsBoolean(r,e,i);null!==n&&(s[o]=n)},d=(t,e,s,r,o)=>{const i=t.getValAttrAsInteger(r,e);null!==i&&(s[o]=i)},m=(t,e,s,r,o,i=1)=>{const n=t.getValAttrAsFloat(r,e);null!==n&&(s[o]=n*i)};class b{visit(t,e,s){return g(t,e,s,"roundedCorners","roundedCorners"),d(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let t=0;t<c.length;t++){const e=c[t];if(e.xAxisId){const r=e.xAxisId,n=a.get(r);o[t+""]=n,e.offsetXAxis=t,delete e.xAxisId,s.xAxes=o,o.length=++i}if(e.yAxisId){const r=e.yAxisId,o=a.get(r);n[t+""]=o,e.offsetYAxis=t,delete e.yAxisId,s.yAxes=n,n.length=++l}r[t+""]=e}r.length=c.length;const u=t.getVisitorParamsState().get("series");if(!u||0===u.length)return;const h={};s.series=h;for(let t=0;t<u.length;t++)h[t+""]=u[t];h.length=u.length}}class A{visit(t,e,s){return g(t,e,s,"plotVisOnly","plotVisOnly"),p(t,e,s,"dispBlanksAs","dispBlanksAs"),g(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),g(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(!0===r||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",null!==i)}catch(t){throw new Error("Unexpected Error parsing Chart: "+t)}}}class f{visit(t,e,s){let r={};return s.plotArea=r,r}}class y{EnumMappings(){}static fromOoxmlGradientType(t){return"circle"===t?"radial":t}static fromOoxmlLineCap(t){if("rnd"===t)return"round";if("flat"===t)return"butt";if("sq"===t)return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return"sng"===t?"single":t}static fromOoxmlAlignment(t){return"ctr"===t?"center":t}}class v{visit(t,e,s){}processStroke(t,s,r){const o={},i=t.evaluate("ln",s);if(i){i.hasAttribute("algn")&&(o.align=y.fromOoxmlAlignment(i.getAttribute("algn"))),i.hasAttribute("cap")&&(o.lineCap=y.fromOoxmlLineCap(i.getAttribute("cap"))),i.hasAttribute("cmpd")&&(o.compound=y.fromOoxmlCompound(i.getAttribute("cmpd"))),i.hasAttribute("w")&&(o.width=e.t(i.getAttribute("w")));const s=t.evaluate("miter",i);s&&(o.lineJoin="miter",s.hasAttribute("lim")&&(o.miter=parseFloat(s.getAttribute("lim")))),t.evaluate("bevel",i)&&(o.lineJoin="bevel"),t.evaluate("round",i)&&(o.lineJoin="round");const n=t.evaluate("custDash",i);if(n){const s=t.evaluate("ds",n);if(s&&s.length>0){let t="";for(let r=0;r<s.length;r++){const o=s.item(r);t+=e.a(o.getAttribute("d"))+","+e.a(o.getAttribute("sp"))}o.dash=t}}const l=t.evaluate("prstDash",i);l&&l.hasAttribute("val")&&(o.dash=l.getAttribute("val")),this.parseEndElement(t,i,o,"headEnd","head"),this.parseEndElement(t,i,o,"tailEnd","tail");const a=this.processFill(t,i,r);o.fill=a}return o}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const t=i.getAttribute("len")?i.getAttribute("len"):"med",e=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=t+"-"+e}}processFill(t,s,r){const o={};if(t.evaluate("noFill",s))return o.none=!0,o;const i=t.evaluate("solidFill",s);if(i){const e=this.processAdjColor(t,i);return e&&(o.solid=e),o}const n=t.evaluate("gradFill",s);if(n){n.hasAttribute("rotWithShape")&&(o.isRotated="1"===n.getAttribute("rotWithShape"));const e=this.processGradFill(t,n);return o.gradient=e,o}const l=t.evaluate("pattFill",s);if(l){const e=this.processPatternFill(t,l);return o.pattern=e,o}const a=t.evaluate("blipFill",s);if(a){a.hasAttribute("rotWithShape")&&(o.isRotated=e.b(a.getAttribute("rotWithShape"))),a.hasAttribute("dpi")&&(o.dpi=a.getAttribute("dpi"));const s=this.processImageFill(t,a);return o.image=s,o}return o.none=!0,o}processGradFill(t,s){const r={},o=t.evaluate("lin",s);if(o){if(r.type="linear",o.hasAttribute("ang")){const t=e.p(o.getAttribute("ang"));r.angle=t}if(o.hasAttribute("scaled")){const t=e.b(o.getAttribute("scaled"));r.scaled=t}}const i={};s.hasAttribute("flip")&&(i.mirror=s.getAttribute("flip")),Object.keys(i).length>0&&(r.tile=i);const n=t.evaluate("path",s);if(n){n.hasAttribute("path")&&(r.type=y.fromOoxmlGradientType(n.getAttribute("path")));const e=t.evaluate("fillToRect",n);e&&(r.fillTo=this.getRect(e))}const l=t.evaluate("tileRect",s);l&&(r.tile.bounds=this.getRect(l));const a=[],c=t.evaluate("gsLst/gs",s);for(let s=0;c&&s<c.length;s++){const r=c.item(s),o={offset:e.a(r.getAttribute("pos")),color:this.processAdjColor(t,r)};a.push(o)}return a.length>0&&(r.stops=a),r}getRect(t){const s={};return t.hasAttribute("t")&&(s.t=e.a(t.getAttribute("t"))),t.hasAttribute("l")&&(s.l=e.a(t.getAttribute("l"))),t.hasAttribute("b")&&(s.b=e.a(t.getAttribute("b"))),t.hasAttribute("r")&&(s.r=e.a(t.getAttribute("r"))),0===Object.keys(s).length?null:s}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const e=this.processAdjColor(t,o);e&&(s.background=e)}const i=t.evaluate("fgClr",e);if(i){let e=this.processAdjColor(t,i);e&&(s.foreground=e)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,s){let r="lrgba("+e.a(s.getAttribute("r"))+","+e.a(s.getAttribute("g"))+","+e.a(s.getAttribute("b"))+")";return r+=this.processAdjustments(t,s),r}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,s){let r="hsl("+e.p(s.getAttribute("hue"))+","+e.a(s.getAttribute("sat"))+","+e.a(s.getAttribute("lum"))+")";return r+=this.processAdjustments(t,s),r}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(1===i.nodeType){let r=i.localName;s+="hue"===r||"hueOff"===r||"hueMod"===r?this.processAdjustmentElement(t,e,r,6e4):"gray"===r||"comp"===r||"inv"===r||"gamma"===r||"invGamma"===r?this.processAdjustmentElement(t,e,r,1):this.processAdjustmentElement(t,e,r)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class F extends v{visit(t,s,r){try{const o=t.evaluate("xfrm",s);if(o){h(o,r);const s={x:0,y:0,width:0,height:0},i=t.evaluate("off",o);i&&(s.x=e.c(i.getAttribute("x"))??0,s.y=e.c(i.getAttribute("y"))??0);const n=t.evaluate("ext",o);i&&(s.width=e.c(n.getAttribute("cx"))??0,s.height=e.c(n.getAttribute("cy"))??0),r.bounds=s}const i=t.evaluate("prstGeom",s);i?.hasAttribute("prst")?r.geometry=i?.getAttribute("prst"):t.evaluate("customGeom",s)&&console.warn("customGeom not supported yet");const n=this.processFill(t,s,r);n&&Object.keys(n).length>0&&(r.fill=n);const l=this.processStroke(t,s,r);return l&&Object.keys(l).length>0&&(r.stroke=l),r}catch(t){throw console.warn(t),new Error("Unexpected Error parsing Shape Properties element")}}}class C{visit(t,e,s){let r={};if(p(t,e,r,"grouping","grouping"),g(t,e,r,"varyColors","varyColors"),m(t,e,r,"gapWidth","gapWidth",.01),m(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),d(t,e,r,"bubbleScale","bubbleScale"),g(t,e,r,"showNegBubbles","showNegativeBubbleValues"),g(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),d(t,e,r,"firstSliceAng","startAngle"),d(t,e,r,"holeSize","holeSize"),p(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let e=t.getVisitorParamsState().get("types");e||(e=[],t.getVisitorParamsState().set("types",e)),e.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(0===r.length)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class w extends C{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type="col"===r?"column":"bar")}}class P{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);null!==i&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),!0===n?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(g(t,e,r,"showBubbleSize","showBubbleSize"),g(t,e,r,"showCatName","showCatName"),g(t,e,r,"showLeaderLines","showLeaderLines"),g(t,e,r,"showPercent","showPercentage"),g(t,e,r,"showSerName","showSerName"),g(t,e,r,"showVal","showVal"),g(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return null!==l&&(r.separator=l.textContent),p(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const t=r.getAttribute("formatCode");s.formatCode=t,r.hasAttribute("sourceLinked")&&(s.sourceLinked="1"===r.getAttribute("sourceLinked"))}}}const N=(t,e,s)=>{if(!0===t.getValAttrAsBoolean("invertIfNegative",e))if(t.evaluate("extLst/ext/invertSolidFillFmt",e)){if(s.fill&&s.fillNegative){const e=t.getFromPath(s,"fill.solid.adjs");e&&t.setToPath(s,"fillNegative.solid.adjs",e)}}else{const t={val:"FFFFFF"},e={};e.solid=t,s.fillNegative=e;const r={val:"000000"},o={};o.solid=r;const i={};i.fill=o,s.strokeNegative=i}};class O{visit(t,e,s){const r={};d(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;null!==o&&null!==o.firstChild&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),null!==i&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),null!==n&&(l=this.parsePointsAsString(t,n))),null!==l&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),d(t,e,r,"idx","idx"),g(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(null!==r){const e=r.firstChild.nodeValue;t.setToPath(s,"title.range",e)}else{const r=t.evaluate("tx/v",e);null!==r&&t.setToPath(s,"title.text.simpleRun",r.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let s=0;o&&r&&s<r;s++){let r=null,o=t.evaluate("pt[@idx='"+s+"']/v",e);o instanceof Node&&(r=o.textContent),i[s]=r}for(let t=0;t<i.length;t++)t>0&&(s+=","),void 0!==i[t]&&(s+=i[t]);return s+="}",s}afterVisit(t,e,s){N(t,e,s);let r=t.getFromPath(s,"points");if(r){const e=Object.keys(r);for(let o=0;o<e.length;o++){const i=e[o],n=t.getFromPath(r,i);if(!n)continue;let l=t.getFromPath(n,"markers");l&&(t.setToPath(s,"markers.points."+i,l),delete n.markers)}}}}class T{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return null!==n&&(o[n]=i),g(t,e,i,"bubble3D","bubble3D"),d(t,e,i,"explosion","explosion"),N(t,e,i),i}}class S{visit(t,e,s){const r=e.parentNode.localName;if("ser"===r||"dPt"===r){const r={},o=t.getValAttrAsString("size",e);null!==o&&(r.size=o);const i=t.getValAttrAsString("symbol",e);return i&&(r.type=i),s.markers=r,r}return null}}class V{visit(t,e,s){let r={};this.parseScaling(t,e,r),m(t,e,r,"majorUnit","majorUnits"),m(t,e,r,"minorUnit","minorUnits"),g(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),p(t,e,r,"majorTickMark","majorTickMarks"),p(t,e,r,"minorTickMark","minorTickMarks"),p(t,e,r,"crosses","crosses"),m(t,e,r,"crossesAt","crosses"),p(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),d(t,e,r,"lblOffset","labelOffset"),p(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=null!==o&&0===o,d(t,e,r,"tickMarkSkip","tickMarkSkip"),d(t,e,r,"tickLblSkip","labelInterval"),this.parseDisplayCustOrBuiltInUnit(e,t,r),this.parseTimeUnits(t,e,r,"majorUnitDates","majorTimeUnit","majorUnit"),this.parseTimeUnits(t,e,r,"minorUnitDates","minorTimeUnit","minorUnit"),p(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(null!==l){n.dem=l;let s=t.getValAttrAsString(i,e);n.amt=s}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);null!==r&&("ctr"===r?s.labelAlign="center":"l"===r?s.labelAlign="left":"r"===r&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);null!==r&&("b"===r?s.orientation="bottom":"l"===r?s.orientation="left":"r"===r?s.orientation="right":"t"===r&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);null!==o&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked="1"===o.getAttribute("sourceLinked"))),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);null!==r&&(s.inverted="minMax"!==r);const o=t.getValAttrAsFloat("scaling/logBase",e);null!==o&&(s.logBase=o,s.scaleType="log"),m(t,e,s,"scaling/max","max"),m(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);null!==r&&(t.setToPath(s,"labels.shown",!0!==r),t.setToPath(s,"shown",!0!==r));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",null!==i);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",null!==n);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",null!==l)}}class x{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),(new F).visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=e=>{const s={};let r=t.evaluate("t",e);const o=t.evaluate("rPr",e);o&&this.parseTextProperties(t,o,s),r?s.text=r.firstChild.textContent??"":e.textContent&&(s.text=e.textContent??""),i.push(s)};if(void 0!==n?.length)for(let t=0;n&&t<n.length;t++)l(n.item(t));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&h(a,s)}parseTextProperties(t,e,r){if(!e)return;e.hasAttribute("sz")&&(r.size=parseFloat(e.getAttribute("sz"))/100),e.hasAttribute("b")&&(r.weight="1"===e.getAttribute("b")?700:400),e.hasAttribute("i")&&(r.italic="1"===e.getAttribute("i")),e.hasAttribute("u")&&(r.underline=e.getAttribute("u")),e.hasAttribute("strike")&&(r.strike=e.getAttribute("strike"));const o=t.evaluate("latin",e);if(o&&!o.getAttribute("typeface").startsWith("+")){const t=r.font??{};if(o.hasAttribute("typeface")&&(t.family=o.getAttribute("typeface")),o.hasAttribute("panose")){const e=o.getAttribute("panose");e&&(t.fallbacks=[s.IFont.getPanoseFallback(e)])}o.hasAttribute("pitchFamily")&&(t.pitch=o.getAttribute("pitchFamily")),o.hasAttribute("charset")&&(t.charset=o.getAttribute("charset")),Object.keys(t).length>0&&(r.font=t)}}}class k{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let s=t.getFromPath(r,"title");s||(s={},t.setToPath(r,"title",s));let o=s,i=t.getValAttrAsBoolean("delete",e);return null!==i&&(o.shown=!i),o}return s}}class I{visit(t,e,s){const r={};return g(t,e,r,"overlay","overlay"),p(t,e,r,"legendPos","position"),s.legend=r,r}}class L extends F{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class B extends x{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const e=r.firstElementChild.nodeValue;t.setToPath(s,"range",e)}}visit(t,e,s){const r={};g(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const t=s.text?.rotation??null;null!==t&&(s.rotation=parseInt(t),delete s.title.rotation)}}}class _{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let e={};m(t,r,e,"x","x"),m(t,r,e,"y","y"),m(t,r,e,"w","w"),m(t,r,e,"h","h"),p(t,r,e,"xMode","xMode"),p(t,r,e,"yMode","yMode"),p(t,r,e,"wMode","wMode"),p(t,r,e,"hMode","hMode"),Object.keys(e).length>0&&(s.manualLayout=e)}return s}}class j{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class R extends v{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let s=0;s<o.length;s++){const i=o.item(s);if(1===i.nodeType){let s=i.localName;const o=t.evaluate(s,e),n=this.processAdjColor(t,o);r[s]=n}}return Object.keys(r).length>0&&(s.colors=r),r}}class E{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(t,e,r){if(!e)return;const o=t.evaluate("latin",e);if(!o)return;const i=o.getAttribute("typeface");i&&(r.family=i);const n=o.getAttribute("panose");return n&&(r.fallbacks=[s.IFont.getPanoseFallback(n)]),r}}class Y{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const e=t.getRef(o);"string"==typeof e&&(r.address=e)}return t.copyFromAttribute(e,"tooltip",r),t.copyFromAttribute(e,"history",r,"history",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tgtFrame",r,"target"),s.hyperlink=r,r}}class D{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(t,e){const r={type:s.IAutoFilter.Type.Color};return t.copyFromAttribute(e,"cellColor",r,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(e,"dxfId",r,"styleId",t.INT_COPY),r}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(t,e){const r={type:s.IAutoFilter.Type.Custom};t.copyFromAttribute(e,"and",r,"and",t.BOOLEAN_COPY);const o=e.childNodes;r.filters=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1!==s.nodeType)continue;let i=null;"customFilter"===s.localName&&(i=this.processCustomFilter(t,s)),i&&r.filters.push(i)}return r}processDynamicFilter(t,e){const r={type:s.IAutoFilter.Type.Dynamic};return t.copyFromAttribute(e,"type",r,"dynamicType"),t.copyFromAttribute(e,"val",r,"val",t.INT_COPY),t.copyFromAttribute(e,"maxVal",r,"maxVal",t.INT_COPY),r}processDateGroupItem(t,e){const s={};return t.copyFromAttribute(e,"dateTimeGrouping",s,"group"),t.copyFromAttribute(e,"day",s,"day",t.INT_COPY),t.copyFromAttribute(e,"hour",s,"hour",t.INT_COPY),t.copyFromAttribute(e,"minute",s,"minute",t.INT_COPY),t.copyFromAttribute(e,"month",s,"month",t.INT_COPY),t.copyFromAttribute(e,"second",s,"second",t.INT_COPY),t.copyFromAttribute(e,"year",s,"year",t.INT_COPY),s}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(t,e){const r={type:s.IAutoFilter.Type.Items};t.copyFromAttribute(e,"blank",r,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(e,"calendarType",r,"calendarType");let o=[],i=[];const n=e.childNodes;for(let e=0;e<n.length;e++){const s=n.item(e);if(1===s.nodeType)if("dateGroupItem"===s.localName){const e=this.processDateGroupItem(t,s);e&&o.push(e)}else if("filter"===s.localName){const e=this.processFilterItem(t,s);void 0!==e&&i.push(e)}}return o.length>0&&(r.dateGroups=o),i.length>0&&(r.items=i),r}processIcon(t,e){const r={type:s.IAutoFilter.Type.Icon};return t.copyFromAttribute(e,"iconId",r,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",r),r}processTop10(t,e){const r={type:s.IAutoFilter.Type.Top10};return t.copyFromAttribute(e,"filterVal",r,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(e,"percent",r,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(e,"top",r,"top",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",r,"val",t.FLOAT_COPY),r}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1!==s.nodeType)continue;let i=null;"colorFilter"===s.localName?i=this.processColorFilter(t,s):"customFilters"===s.localName?i=this.processCustomFilters(t,s):"dynamicFilter"===s.localName?i=this.processDynamicFilter(t,s):"filters"===s.localName?i=this.processFilters(t,s):"iconFilter"===s.localName?i=this.processIcon(t,s):"top10"===s.localName&&(i=this.processTop10(t,s)),i&&o.push(i)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,s){if(!s)return null;const r={};if(!s.hasAttribute("colId"))return;r.offset=parseInt(s.getAttribute("colId"));let o=!1;return s.hasAttribute("hiddenButton")&&(o=e.b(s.getAttribute("hiddenButton"))),o&&(r.hiddenButton=!0),s.hasAttribute("showButton")&&(r.showButton=e.b(s.getAttribute("showButton"))),this.processFilterCriteria(t,s,r),r}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1===s.nodeType&&"filterColumn"===s.localName){const e=this.processFilterColumn(t,s);e&&o.push(e)}}return o.length>0&&(s.fields=o),o}}class M{visit(t,r,o){if(!r)return;const i={};if(t.copyFromAttribute(r,"ref",i),r.hasAttribute("caseSensitive")){const t=e.b(r.getAttribute("caseSensitive"));i.collatorOptions=t?s.Sort.CaseSensitiveOptions:s.Sort.CaseInsensitiveOptions}const n=r.getAttribute("sortMethod");null!=n&&"none"!==n&&("stroke"===n?i.collatorOptions={...i.collatorOptions,collation:"stroke"}:"pinYin"===n&&(i.collatorOptions={...i.collatorOptions,collation:"pinyin"})),r.hasAttribute("columnSort")&&e.b(r.getAttribute("columnSort"))&&(i.orientation=s.IRange.Orientation.Column);const l=s.AddressUtils.fastStringToRange(i.ref);return this.processSortConditions(t,r,i,l),Object.keys(i).length>0&&(o.sort=i),i}processSortCondition(t,r,o){if(!r)return null;const i={};if(r.hasAttribute("ref")){if(r.hasAttribute("ref")){const t=r.getAttribute("ref"),e=s.AddressUtils.fastStringToRange(t);i.offset=o?e.colStart-o.colStart:e.colStart}return i.reverse=!1,r.hasAttribute("descending")&&(i.reverse=e.b(r.getAttribute("descending"))),t.copyFromAttribute(r,"sortBy",i,"sortOn"),t.copyFromAttribute(r,"dxfId",i),t.copyFromAttribute(r,"iconSet",i),t.copyFromAttribute(r,"customList",i),i}console.warn("no ref for sort conditional",t.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"sortCondition"===s.localName){const e=this.processSortCondition(t,s,r);e&&i.push(e)}}return i.length>0&&(s.fields=i),i}}class U{visit(t,e,s){}processDataBarColor(t,s,r,o,i="dk1"){if(!s)return;const n=e.d(t=>s.getAttribute(t),i);return n&&(r[o]=n),r}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);if(1===i.nodeType&&"font"===i.localName){const e={};this.processFont(t,i,e),s[o++]=e}}return s}processFont(t,e,r){t.getValAttrAsBoolean("b",e,!0)&&(r.weight=700),t.getValAttrAsBoolean("i",e,!0)&&(r.style=s.IFont.Style.Italic),t.getValAttrAsBoolean("strike",e,!0)&&(r.strike=!0);const o=t.evaluate("u",e);if(o){const t=o.getAttribute("val");r.underline=t||s.IFont.UnderlineStyle.Single}p(t,e,r,"vertAlign","verticalAlign"),"superscript"===r.verticalAlign?r.verticalAlign=s.IFont.VerticalAlignment.Super:"subscript"===r.verticalAlign&&(r.verticalAlign=s.IFont.VerticalAlignment.Sub),m(t,e,r,"sz","size");const i=t.evaluate("color",e);this.processDataBarColor(t,i,r,"fill"),r.fill||(r.fill="dk1"),p(t,e,r,"name","family"),p(t,e,r,"rFont","family");const n=t.evaluate("family",e);if(n){const t=n.getAttribute("val");if(t)switch(t){case"1":r.fallbacks=["serif"];break;case"2":r.fallbacks=["sans-serif"];break;case"3":r.fallbacks=["monospace"];break;case"4":r.fallbacks=["cursive"];break;case"5":r.fallbacks=["fantasy"]}}return p(t,e,r,"scheme","scheme"),g(t,e,r,"shadow","shadow",!0),g(t,e,r,"outline","outline",!0),t.getValAttrAsBoolean("condense",e,!0)&&(r.letterSpacing=-1),t.getValAttrAsBoolean("extend",e,!0)&&(r.letterSpacing=1),p(t,e,r,"charset","charset"),r}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);1===i.nodeType&&"fill"===i.localName&&this.processFill(t,i,s,o++)}return s}processFill(t,e,r,o){const i={type:s.IFill.Type.None},n=e.childNodes;let l=!1;for(let e=0;!l&&e<n.length;e++){const s=n.item(e);1===s.nodeType&&("gradientFill"===s.localName?(this.processGradientFill(t,s,i),l=!0):"patternFill"===s.localName&&(this.processPatternFill(t,s,i),l=!0))}return r[o]=i,r}processGradientFill(t,e,r){if(!e)return;r.type=s.IFill.Type.Gradient;const o=[];r.stops=o,r.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const i=e.getAttribute("type");i&&(r.gradientType=i);const n=t=>{if(!t)return 0;const e=parseFloat(t);return isNaN(e)?0:e};(e.hasAttribute("left")||e.hasAttribute("top")||e.hasAttribute("right")||e.hasAttribute("bottom"))&&(r.fillTo={left:n(e.getAttribute("left")),top:n(e.getAttribute("top")),right:n(e.getAttribute("right")),bottom:n(e.getAttribute("bottom"))});const l=e.childNodes;for(let e=0;e<l.length;e++){const s=l.item(e);if(1===s.nodeType&&"stop"===s.localName){const e={};o.push(e);const r=parseFloat(s.getAttribute("position"));e.offset=r;const i=t.evaluate("color",s);this.processDataBarColor(t,i,e,"color")}}return r}processPatternFill(t,e,r){if(!e)return;const o=t.getVisitorParamsState().get("processingDXFs"),i=e.getAttribute("patternType")||(o?s.IFill.BuiltInSheetPattern.Solid:s.IFill.BuiltInSheetPattern.None);if(i===s.IFill.BuiltInSheetPattern.None)return{none:!0};r.type=s.IFill.Type.Pattern,i&&(r.patternType=i);let n,l="foreground",a="background";const c=r.patternType===s.IFill.BuiltInSheetPattern.Solid&&o;if(c){n="lt1";const t=l;l=a,a=t}const u=t.evaluate("fgColor",e);this.processDataBarColor(t,u,r,l,n);const h=t.evaluate("bgColor",e);return this.processDataBarColor(t,h,r,a,n),c&&!r.foreground&&(r.foreground=n),r}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let e=0;e<o.length;e++){const n=o.item(e);1===n.nodeType&&"border"===n.localName&&this.processBorder(t,n,s,i++,r)}return s}processBorder(t,e,r,o,i){if(!e)return;const n={};return this.processBorderStroke(t,e,n,s.IBorder.Edge.Left),this.processBorderStroke(t,e,n,s.IBorder.Edge.Right),i?(n.right||n.left)&&(n.right?n.vertical={...n.right}:n.vertical={...n.left}):this.processBorderStroke(t,e,n,s.IBorder.Edge.Vertical),this.processBorderStroke(t,e,n,s.IBorder.Edge.Top),this.processBorderStroke(t,e,n,s.IBorder.Edge.Bottom),i?(n.bottom||n.top)&&(n.right?n.horizontal={...n.bottom}:n.horizontal={...n.top}):this.processBorderStroke(t,e,n,s.IBorder.Edge.Horizontal),r[o]=n,r}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class z extends U{visit(t,e,r){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const o={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),o.fonts),this.processFills(t,t.evaluate("fills",e),o.fills),this.processBorders(t,t.evaluate("borders",e),o.borders,!0),o.fills[0]={type:s.IFill.Type.None},o.fills[1]={type:s.IFill.Type.Pattern,patternType:s.IFill.BuiltInSheetPattern.Gray125},o.borders[0]={};const i=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),i,o,null,!1);const n=new Map;if(i.length>0){const s=[];this.processCellStyles(t,t.evaluate("cellStyles",e),s,i,n),r.named=s}const l=[];this.processXFs(t,t.evaluate("cellXfs",e),l,o,n),Object.keys(l).length>0&&(r.direct=l);const a=[];return this.processDXFs(t,t.evaluate("dxfs",e),a),this.processTableStyles(t,t.evaluate("tableStyles",e),r,a),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),r),this.processMruColors(t,t.evaluate("colors/mruColors",e),r),r}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"rgbColor"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"color"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let t=0;t<o.length;t++){const e=o.item(t);if(1===e.nodeType&&"numFmt"===e.localName){const t=e.getAttribute("numFmtId"),s=e.getAttribute("formatCode");if(t&&s){const e=s.replace(/\\(.)/g,"$1");r.set(parseInt(t),e)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let e=0;e<n.length;e++){const l=n.item(e);if(1===l.nodeType&&"xf"===l.localName){const e={};this.processXF(t,l,e,r,o,i),s.push(e)}}}processXF(t,r,o,i,n,l){if(!r)return;const a=r.getAttribute("xfId");if(a&&n){const t=n.get(parseInt(a));t&&t!==s.IStyle.BuiltInName.Normal&&(o.named=t)}const c=t=>!(!l&&r.hasAttribute(t))||e.b(r.getAttribute("applyFont"));if(c("applyFont")){const t=i.fonts[r.getAttribute("fontId")];t&&(o.font=t)}if(c("applyFill")){const t=i.fills[r.getAttribute("fillId")];t&&Object.keys(t).length>0&&(o.fill=t)}if(c("applyBorder")){const t=i.borders[r.getAttribute("borderId")];t&&Object.keys(t).length>0&&(o.border=t)}if(c("applyNumberFormat")){const e=r.getAttribute("numFmtId");if(e){const s=parseInt(e);let r;const i=t.getVisitorParamsState();if(i){const t=i.get("numFmts");t&&(r=t.get(s)),o.numberFormat=r??s}else console.warn("no visitor params state")}}c("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",r),o),c("applyProtection")&&this.processProtection(t,t.evaluate("protection",r),o);const u=e.b(r.getAttribute("quotePrefix"));u&&(o.quotePrefix=u)}processAlignment(t,r,o){const i={};if(r?.hasAttribute("horizontal")?i.horizontal=r.getAttribute("horizontal"):i.horizontal=s.ITextFrame.HorizontalAlignment.General,r?.hasAttribute("vertical")?i.vertical=r.getAttribute("vertical"):i.vertical=s.ITextFrame.VerticalAlignment.Bottom,r?.hasAttribute("indent")?i.indent=parseInt(r.getAttribute("indent")):i.indent=0,r?.hasAttribute("relativeIndent")?i.relativeIndent=parseInt(r.getAttribute("relativeIndent")):i.relativeIndent=0,e.b(r?.getAttribute("wrapText"))?i.overflow=s.ITextFrame.Overflow.Wrap:i.overflow=s.ITextFrame.Overflow.Visible,e.b(r?.getAttribute("shrinkToFit"))&&(i.overflow=s.ITextFrame.Overflow.Shrink),r?.hasAttribute("textRotation")){let t=parseFloat(r.getAttribute("textRotation"));t>0&&t<=90?t=360-t:t>90&&t<=180?t-=90:255===t&&(t=0,i.stacked=!0),i.rotation=t}else i.rotation=0;r?.hasAttribute("justifyLastLine")&&(i.justifyLastLine=e.b(r.getAttribute("justifyLastLine")));const n=r?.getAttribute("readingOrder");return n&&("0"===n?i.readingDirection=s.ITextFrame.ReadingDirection.Auto:"1"===n?i.readingDirection=s.ITextFrame.ReadingDirection.LeftToRight:"2"===n?i.readingDirection=s.ITextFrame.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${n}`)),Object.keys(i).length>0&&(o.alignment=i),o}processProtection(t,s,r){if(!s)return;const o={},i=s.getAttribute("locked");i&&!e.b(i)&&(o.edit=!0);const n=s.getAttribute("hidden");return n&&e.b(n)&&(o.formulaHidden=!0),Object.keys(o).length>0&&(r.protection=o),r}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"font"===o.localName){const e={};this.processFont(t,o,e),s.font=e}else if(1===o.nodeType&&"fill"===o.localName){const e=[];this.processFill(t,o,e,0),e.length>0&&e[0]&&(s.fill=e[0])}else if(1===o.nodeType&&"border"===o.localName){const e=[];this.processBorder(t,o,e,0,!1),e.length>0&&e[0]&&(s.border=e[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);if(1===i.nodeType&&"dxf"===i.localName){const e={};this.processDXF(t,i,e);const o=s.length;r.set(o,e),s.push(e)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,s,r,o,i=!1){const n=s.getAttribute("name"),l={name:n};s.hasAttribute("table")&&(l.table=e.b(s.getAttribute("table"))),s.hasAttribute("pivot")&&(l.pivot=e.b(s.getAttribute("pivot"))),i&&!l.pivot&&o.unshift(null);const a=s.childNodes;for(let t=0;t<a.length;t++){const e=a.item(t);if(1===e.nodeType&&"tableStyleElement"===e.localName){const t=e.getAttribute("type"),s=e.getAttribute("dxfId");let r=o?.[s];r||(console.warn("invalid dfx id",s),r={}),l[t]=r;let i=null;e.hasAttribute("size")&&(i=parseInt(e.getAttribute("size"))),i&&!isNaN(i)&&(r.size=i)}}delete l.name,r[n]=l}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let e=0;e<a.length;e++){const s=a.item(e);1===s.nodeType&&"tableStyle"===s.localName&&this.processTableStyle(t,s,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,s,r,o,i){if(!s)return;const n=s.childNodes;for(let t=0;t<n.length;t++){const s=n.item(t);if(1===s.nodeType&&"cellStyle"===s.localName){const t=parseInt(s.getAttribute("xfId")),n=s.getAttribute("name");if(i.set(t,n),!o[t])continue;const l={name:n,style:o[t]};s.getAttribute("hidden")&&(l.hidden=e.b(s.getAttribute("hidden"))),s.getAttribute("iLevel")&&(l.iLevel=parseInt(s.getAttribute("iLevel"))),r.push(l)}}}afterVisit(t,e,s){}}class G extends U{visit(t,e,s){return this.processSheetRefs(t,t.evaluate("sheets",e),s),this.processBookViews(t,t.evaluate("bookViews",e),s),this.processDefinedNames(t,t.evaluate("definedNames",e),s),this.processCalcPr(t,t.evaluate("calcPr",e),s),this.processWorkbookProtection(t,t.evaluate("workbookProtection",e),s),this.processWorkbookPr(t,t.evaluate("workbookPr",e),s),s}processPassword(t,e,s,r="password"){if(!e)return;const o={};t.copyFromAttribute(e,"algorithmName",o,"algorithmName"),t.copyFromAttribute(e,"hashValue",o,"hashValue"),t.copyFromAttribute(e,"saltValue",o,"saltValue",t.BOOLEAN_COPY),t.copyFromAttribute(e,"spinCount",o,"spinCount",t.INT_COPY),Object.keys(o).length>0&&(s[r]=o)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=t=>!0!==t&&"1"!==t&&"on"!==t&&"true"!==t&&(!1===t||"0"===t||"off"===t||"false"===t||null);return t.copyFromAttribute(e,"lockStructure",r,"structure",o),t.copyFromAttribute(e,"lockWindows",r,"windows",o),t.copyFromAttribute(e,"lockRevision",r,"revision",o),s.protection=r,s}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);1===s.nodeType&&"sheet"===s.localName&&this.processSheetRef(t,s,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const e=r.item(i);1===e.nodeType&&"workbookView"===e.localName&&(this.processWorkbookView(t,e,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,t=>t+1]),e.hasAttribute("activeTab")||(r.activeSheetId=1),t.copyFromAttribute(e,"showHorizontalScroll",r,"showHorizontalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showVerticalScroll",r,"showVerticalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showSheetTabs",r,"showTabs",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tabRatio",r,"tabRatio",[t.FLOAT_COPY,t=>t]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&3===i.nodeType&&(o.ref=i.textContent),t.copyFromAttribute(e,"name",o),t.copyFromAttribute(e,"comment",o),t.copyFromAttribute(e,"hidden",o,"hidden",t.BOOLEAN_COPY),e.hasAttribute("localSheetId")){const t=e.getAttribute("localSheetId");if(!r[t]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${t}' which does not exist.`);o.scope=r[t].name}t.copyFromAttribute(e,"customMenu",o),t.copyFromAttribute(e,"description",o),t.copyFromAttribute(e,"statusBar",o),t.copyFromAttribute(e,"help",o),t.copyFromAttribute(e,"shortcutKey",o),t.copyFromAttribute(e,"function",o,"function",t.BOOLEAN_COPY),t.copyFromAttribute(e,"functionGroupId",o,"functionGroupId",t.INT_COPY),t.copyFromAttribute(e,"publishToServer",o,"publishToServer",t.BOOLEAN_COPY),t.copyFromAttribute(e,"vbProcedure",o,"vbProcedure",t.BOOLEAN_COPY),t.copyFromAttribute(e,"xlm",o,"xlm",t.BOOLEAN_COPY),Object.keys(o).length>0&&s.push(o)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);1===i.nodeType&&"definedName"===i.localName&&this.processDefineName(t,i,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class W{visit(t,e,s){return t.copyFromAttribute(e,"name",s),t.copyFromAttribute(e,"displayName",s),t.copyFromAttribute(e,"ref",s),t.copyFromAttribute(e,"headerRowCount",s,"headerRowCount",t.INT_COPY),t.copyFromAttribute(e,"totalsRowCount",s,"totalsRowCount",t.INT_COPY),this.processTableColumns(t,e,s),this.processTableStyleInfo(t,e,s),s}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableStyleInfo"===s.localName&&(t.copyFromAttribute(s,"name",o),t.copyFromAttribute(s,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"tableColumn"===o.localName){const e={};t.copyFromAttribute(o,"name",e),t.copyFromAttribute(o,"uniqueName",e),s.push(e)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableColumns"===s.localName&&this.processTableColumn(t,s,o)}o.length>0&&(s.columns=o)}}class X{visit(t,e,s){return s}}class ${visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"editAs",r,"anchorType"),r.anchor={},this.processOffsetCoord(t,t.evaluate("from",e),r.anchor,"from"),this.processOffsetCoord(t,t.evaluate("to",e),r.anchor,"to"),s.movables||(s.movables=[]),s.movables.push(r),r}processOffsetCoord(t,s,r,o){if(!s)return;const i={c:0,r:0,x:0,y:0};return t.evaluate("col",s)&&(i.c=parseInt(t.evaluate("col",s).textContent)),t.evaluate("row",s)&&(i.r=parseInt(t.evaluate("row",s).textContent)),t.evaluate("colOff",s)&&(i.x=e.c(t.evaluate("colOff",s).textContent)),t.evaluate("rowOff",s)&&(i.y=e.c(t.evaluate("rowOff",s).textContent)),"from"===o?r.tl=i:r.br=i,r}}class K{visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);return r&&(t.copyFromAttribute(r,"name",s),t.copyFromAttribute(r,"desc",s),t.copyFromAttribute(r,"hidden",s,"hidden",t.BOOLEAN_COPY),t.copyFromAttribute(r,"id",s)),s}}class H extends K{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const e=t.evaluate("graphicFrameLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)try{let e=s.localName;"chart"===e&&(e="chart"),o.type=e;const r=s.getAttribute("r:id");r&&(o.json=t.getRef(r))}catch(t){console.warn("Unable to parse graphicFrame",t)}}return o&&(s.content=o),o}}class q extends K{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const e=t.evaluate("spLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class J extends K{visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const s=t.evaluate("picLocks",o);if(s){s.hasAttribute("noChangeAspect")&&(r.lockAspect="1"===s.getAttribute("noChangeAspect"));const e={};t.copyFromAttribute(s,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(e).length>0&&(r.locks=e)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const e=i.getAttribute("r:embed")??i.getAttribute("embed");if(!e)return void console.warn("no rId found for blip",i);n=t.getRef(e,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class Q extends q{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const e=t.evaluate("grpSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class Z extends q{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const e=t.evaluate("cxnSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const tt="richTypes";class et{visit(t,e,s){let r=t.getVisitorParamsState().get(tt);r||(r=[],t.getVisitorParamsState().set(tt,r));const o=e.childNodes,i=o.length;for(let e=0;e<i;e++){const s=o.item(e);if(1===s.nodeType&&"s"===s.localName){const e={type:s.getAttribute("t")??"n",keys:[]};this.processKeys(t,s,e),r.push(e)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let t=0;t<o;t++){const e=r.item(t);if(1===e.nodeType&&"k"===e.localName){const t=e.getAttribute("n"),s=e.getAttribute("t");i.push([t,s])}}}}const st="richData";class rt{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(st);o||(o=[],t.getVisitorParamsState().set(st,o));const i=e.childNodes,n=i.length;for(let e=0;e<n;e++){const s=i.item(e);if(1===s.nodeType&&"rv"===s.localName){const e=r[s.getAttribute("s")],i={type:e.type};this.processValues(t,s,i,e);const n=this.mapType(t,i);o.push(n)}}return s.richData=o,o}mapType(t,e){if("_error"===e.type){const r=e.errorType;if(r)try{e=s.FormulaError.getBuiltInById(r+1)}catch(t){}}return e}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let e=0;e<i;e++){const r=o.item(e);if(1===r.nodeType&&"v"===r.localName){const o=n[e];if(!o)return void t.warn("Invalid richData");const i=o[0],l=o[1];let a=r.textContent;"i"===l&&(a=Number(a)),s[i]=a}}}}class ot{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let t=0;t<r.length;t++){const e=r.item(t);if(1===e.nodeType&&"author"===e.localName){const t=e.firstChild;t&&3===t.nodeType&&s.push(t.textContent)}}}}class it{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"authorId",r,"authorId",t.INT_COPY),r.asNote=!0,s.comments||(s.comments=[]),s.comments.push(r),r}}class nt{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class lt{visit(t,s,r){if(!s)return;const o={};return t.copyFromAttribute(s,"id",o,"id",e.r),t.copyFromAttribute(s,"personId",o,"personId",e.r),t.copyFromAttribute(s,"ref",o),t.copyFromAttribute(s,"parentId",o,"parentId",e.r),t.copyFromAttribute(s,"dT",o),s.hasAttribute("done")&&(o.done=e.b(s.getAttribute("done"))),r.push(o),o}}class at{visit(t,s,r){const o=[],i=s.childNodes;for(let s=0;s<i.length;s++){const r=i.item(s);if(1===r.nodeType&&"person"===r.localName){const s={};t.copyFromAttribute(r,"id",s,"id",e.r),t.copyFromAttribute(r,"displayName",s),t.copyFromAttribute(r,"userId",s,"userId",e.r),t.copyFromAttribute(r,"providerId",s),o.push(s)}}return o.length>0&&(r.persons=o),o}}const ct={};class ut{constructor(t,e){this.path=t,this.visitor=e}}class ht{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new u),this.registerVisitor("spPr",new F),this.registerVisitor("txBody",new x),this.registerVisitor("txPr",new x),this.registerVisitor("c:chartSpace",new b),this.registerVisitor("c:chartSpace",new A,"chart"),this.registerVisitor("c:plotArea",new f),this.registerVisitor("c:barChart",new w),this.registerVisitor("c:doughnutChart",new C),this.registerVisitor("c:lineChart",new C),this.registerVisitor("c:ofPieType",new C),this.registerVisitor("c:pieChart",new C),this.registerVisitor("c:scatterChart",new C),this.registerVisitor("c:barChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new P("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new P("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new O),this.registerVisitor("c:dPt",new T),this.registerVisitor("c:marker",new S),this.registerVisitor("c:catAx",new V),this.registerVisitor("c:valAx",new V),this.registerVisitor("c:dateAx",new V),this.registerVisitor("c:majorGridlines",new c("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new c("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new x("labels.text"),"txPr"),this.registerVisitor("c:valAx",new x("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new x("labels.text"),"txPr"),this.registerVisitor("c:legend",new I),this.registerVisitor("c:legend",new x("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new k),this.registerVisitor("c:ser",new L,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new P("labels"),"dLbls"),this.registerVisitor("c:dLbl",new P("points")),this.registerVisitor("c:title",new B),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new _),this.registerVisitor("c:dispUnits",new c("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new B("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new x,"tx/rich"),this.registerVisitor("a:theme",new j),this.registerVisitor("a:theme",new R,"themeElements/clrScheme"),this.registerVisitor("a:theme",new E,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new D),this.registerVisitor("sortState",new M),this.registerVisitor("s:workbook",new G),this.registerVisitor("styleSheet",new z),this.registerVisitor("table",new W),this.registerVisitor("hlinkClick",new Y),this.registerVisitor("wsDr",new X),this.registerVisitor("twoCellAnchor",new $),this.registerVisitor("oneCellAnchor",new $),this.registerVisitor("absoluteAnchor",new $),this.registerVisitor("graphicFrame",new H),this.registerVisitor("sp",new q),this.registerVisitor("grpSp",new Q),this.registerVisitor("cxnSp",new Z),this.registerVisitor("pic",new J),this.registerVisitor("rvStructures",new et),this.registerVisitor("rvData",new rt),this.registerVisitor("comments",new ot),this.registerVisitor("commentList",new it,"comment"),this.registerVisitor("comment",new x("content"),"text"),this.registerVisitor("ThreadedComments",new nt),this.registerVisitor("threadedComment",new lt),this.registerVisitor("threadedComment",new x("content"),"text"),this.registerVisitor("personList",new at)}registerVisitor(t,e,s=null){-1===t.indexOf(":")&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new ut(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=ct){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);if(i||(i=this.visitorsByXmlTagName.get(r.localName)),!i)throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);const n="/"+r.localName,l=new a(null,this,n,r,o,e,s),c=[];this._doWalk(i,l,c,r,o,e,s);for(let e=0;e<c.length;e++){const s=c[e];try{s.visitor?.afterVisit?.(s.context,s.elemParent,s.jsonParent)}catch(t){console.warn(`Error in afterVisit: ${s.context.getPath()}`,t)}}return o}_walkScoped(t,e,s,r,o,i,n){const l=this.scopedVisitorsByXmlTagName.get(t);for(let c=0;l&&c<l.length;c++){const u=l[c];let h=null;try{h=e.evaluate(u.path,r)}catch(e){console.warn(`"Invalid path '${u.path}' for '${t}'.`)}if(!h)continue;const p=t=>{let l=t.localName,c=t.parentNode;for(;c&&c!==r;)l=c.localName+"/"+l,c=c.parentNode;const h=e.getPath()+"/"+l;if(u.visitor){const r=new a(e,this,h,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(u.visitor,r,s,t,o,i,n)}};if(h.length>0){const t=h;for(let e=0;e<t.length;e++)p(t.item(e))}else p(h)}}_doWalk(t,e,s,r,o,i,n){let l=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),l=t.visit(e,r,o)),l||(l=o);const c=r.localName;this._walkScoped(c,e,s,r,l,i,n);const u=r.childNodes;for(let t=0;t<u.length;t++){const r=u.item(t);if(1===r.nodeType){const t=r,c=t.localName,u=this.visitorsByXmlTagName.get(c),h=e.getPath()+"/"+c,p=new a(e,this,h,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(u,p,s,t,l??o,i,n)}}return l}}exports.FromOOXMLConverter=ht,exports.default=ht;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B2e7dDI-zKoqXpIW.cjs"),t=require("@sheetxl/sdk"),o=["Ok","Cancel"],a=e.reactExports.memo(a=>{const{initialValue:r,context:s,onOption:n,onValidateOption:p,onInputOption:i,onDone:l,options:u=o,defaultOption:x=u?.[0],cancelOption:c="Cancel",sx:m,...d}=a,[g,y]=e.reactExports.useState(r),[h,b]=e.reactExports.useState(!1),f=e.reactExports.useCallback(async(e,t)=>!0,[]),j=e.go(async e=>{i?.(g,e),n?.(e,e===c,e===x),l?.()},[g,i,l,n,c,x]),E=e.go(async t=>{t.keyCode===e.io.Enter&&!1!==await(f?.(g,null))&&j(x)},[g,j]),C=e.go(e=>{y(e.target.value),f?.(e.target.value,null)},[p]),F=e.go(async e=>{let t=await Promise.resolve(p?.(e));try{!1!==t&&(t=await Promise.resolve(f?.(g,e))??!0)}catch(e){}return t??!0},[p]),[T,v]=e.reactExports.useState(t.NumberFormat.Styles.lookupStyle(g).formatType??t.NumberFormat.Type.Custom);e.reactExports.useEffect(()=>{v(t.NumberFormat.Styles.lookupStyle(g).formatType??t.NumberFormat.Type.Custom)},[g]);const k=e.reactExports.useMemo(()=>{const o=t.NumberFormat.Styles.lookupPrimary(),a=t=>e.jsxRuntimeExports.jsx(e.MenuItem,{value:t,children:t},t),r=Object.keys(o).map(e=>a(o[e].formatType));return r.push(a(t.NumberFormat.Type.Custom)),r},[]),R=e.reactExports.useCallback(e=>{const o=e.target.value;v(o);const a=t.NumberFormat.Styles.lookupDefault(o);a&&y(a)},[]),S=e.reactExports.useMemo(()=>{const e=s();return e.createTemporaryCell({value:e.getValue()??12345,style:{numberFormat:g}})},[T,g,s]);return e.jsxRuntimeExports.jsx(e.sb,{title:"Number Format",options:u,onDone:l,onOption:e=>j(e),onValidateOption:F,defaultOption:x,cancelOption:c,autoFocusSel:".autoFocus",sx:{width:"580px",...m},...d,children:e.jsxRuntimeExports.jsxs(e.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[e.jsxRuntimeExports.jsxs(e.FormControl,{sx:{minWidth:135},size:"small",children:[e.jsxRuntimeExports.jsx(e.InputLabel,{children:"Category"}),e.jsxRuntimeExports.jsx(e.Select,{value:T,label:"Category",onChange:R,sx:{backgroundImage:`linear-gradient(${e.alpha("#fff",e.hx(5))}, ${e.alpha("#fff",e.hx(5))})`},children:k})]}),e.jsxRuntimeExports.jsx(e.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:e.jsxRuntimeExports.jsx(e.TextField,{label:"Code",onFocus:e=>{h||e.target?.select(),b(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${e.alpha("#fff",e.hx(5))}, ${e.alpha("#fff",e.hx(5))})`}}},value:g,onChange:C,onKeyDown:E,onContextMenu:e=>{e.stopPropagation()}})}),e.jsxRuntimeExports.jsxs(e.Box,{children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",component:"div",sx:{paddingLeft:e=>e.spacing(2)},children:"Preview"}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",component:"div",sx:{borderRadius:e=>`${e.shape.borderRadius}px`,padding:e=>e.spacing(1),border:e=>`1px solid ${e.palette.grey[400]}`},children:S.getNumberFormat().displayText||"(empty)"})]})]})})});exports.NumberFormatDialog=a,exports.default=a;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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{a3 as e,j as t,r as n,$ as s,p as i,a4 as o,V as a,D as l,B as r,a5 as c,a6 as p,a7 as d,a8 as u,a9 as f,T as x,a as g,I as m,aa as h,ab as O,ac as j,x as C,ad as y,ae as b,af as R,ag as T,a2 as v,F as k,a0 as S,a1 as w}from"./DtmE60AvstK9u0Ta.mjs";import{ICell as E,IRange as F}from"@sheetxl/sdk";const I=e(t.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),D=e(t.jsx("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"}),"ArrowDownward"),L=e(t.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),P=e(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward"),A=n.memo(e=>{const{label:i,value:o,options:a,onSelect:l,tabIndex:r=0,...c}=e,[p,d]=n.useState(()=>z(o,a));n.useEffect(()=>{d(z(o,a))},[o,a]);const u=s(e=>{d(e.target.value),l?.(a[e.target.value])},[l,a]),f=n.useMemo(()=>Object.keys(a).map(e=>t.jsx(v,{value:e,children:e},e)),[a]);return t.jsxs(k,{sx:{minWidth:135},size:"small",children:[t.jsx(S,{children:i}),t.jsx(w,{inputProps:{tabIndex:r},value:p,label:i,onChange:u,sx:{backgroundImage:`linear-gradient(${g("#fff",C(5))}, ${g("#fff",C(5))})`},...c,children:f})]})}),K={Workbook:"workbook",Sheet:"sheet"},V={enter:140,exit:140},M={Formulas:E.Content.Formulas,Values:E.Content.Values,Notes:E.Content.Notes,Comments:E.Content.Comments},$={...M};delete $.Values;const B={"By Rows":!0,"By Columns":!1},z=(e,t)=>{const n=Object.keys(t);for(let s=0;s<n.length;s++){const i=n[s];if(t[i]===e)return i}},H=n.memo(e=>{const{replace:v=!1,findText:k,replaceText:S,findOptions:w,replaceOptions:z,title:H,onHide:W,onFindOrReplace:N,...U}=e,G=n.useRef(null),X=n.useRef(null),q=n.useRef(null),J=n.useRef(null),Q=n.useRef(null),Y=n.useRef(null),Z=(e,t)=>{t&&(t.start(e,{center:!1}),setTimeout(()=>t.stop(e),180))},[_,ee]=n.useState(!1),[te,ne]=n.useState(!1),[se,ie]=n.useState(v),[oe,ae]=n.useState(!1),[le,re]=n.useState(!1),[ce,pe]=n.useState({findText:null,replaceText:null,replace:v,replaceOptions:{},findOptions:{matchCase:!1,matchEntireCell:!1,useRegex:!1,orientation:F.Orientation.Row,fields:[E.Content.Formulas]},scope:K.Sheet}),de=s(async(e,t,n,s)=>{if(!N)return;const i={...ce};i.replaceOptions={...i.replaceOptions},i.findOptions={...i.findOptions},i.replaceOptions.maxCount=n?void 0:1,i.replace=t,t&&ce.findOptions.fields?.[0]===E.Content.Values&&(i.findOptions.fields=[E.Content.Formulas]),i.findOptions.reverse=!e;const o=await N({autoFocus:s,...i});ae(0===o)},[ce,N]);n.useEffect(()=>{ae(!1)},[ce,te,se]);const ue=s((e,t)=>{if(e.keyCode===i.Enter){if(!ce.findText)return;let n=!0,s=!1;e.shiftKey&&(n=!1),t?(e.ctrlKey&&e.altKey&&(s=!0),Z(e,s?Y.current:Q.current)):Z(e,n?J.current:q.current),de(n,t,s,!1)}},[ce]),fe=n.useRef(null);n.useLayoutEffect(()=>{pe(e=>{const t={...e};t.findText=k&&k.length>0?k:e.findText??"",ee(!0),void 0!==S&&(t.replaceText=S),w&&(t.findOptions={...t.findOptions,...w}),t.replaceText||(t.replaceText=""),t.replaceOptions&&(t.replaceOptions={...t.replaceOptions}),z&&(t.replaceOptions={...t.replaceOptions,...z}),ce.findOptions.fields?.[0]||(ce.findOptions.fields=[E.Content.Formulas]);const n=!(!z&&void 0===S);return n&&ie(n),t}),le||fe.current?.focus()},[k,S,w,z]),n.useEffect(()=>{se?(ce.findOptions.fields[0],E.Content.Values):ee(!0)},[se]),n.useEffect(()=>{if(_&&G.current&&ce.findText===G.current.value)return G.current===document.activeElement||G.current.contains(document.activeElement)?(G.current?.select(),void ee(!1)):void G.current.addEventListener("focus",()=>{G.current?.select(),ee(!1)},{once:!0})},[_,ce]);const[xe,{width:ge}]=o();return t.jsx(a,{ref:fe,title:H??(se?"Find & Replace":"Find"),initialPosition:{y:"35"},autoFocusSel:".input",onHide:W,onFocus:()=>re(!0),onBlur:()=>{re(!1),ae(!1)},PaperProps:{elevation:le?3:1},...U,children:t.jsxs(l,{dividers:!0,ref:xe,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)ie(!0),G.current?.contains(document.activeElement)&&X.current?.focus();else if("f"===e.key&&e.ctrlKey)G.current?.focus();else if("c"===e.key&&e.altKey)pe(e=>{const t={...e};return t.findOptions.matchCase=!e.findOptions.matchCase,t});else if("e"===e.key&&e.altKey)pe(e=>{const t={...e};return t.findOptions.matchEntireCell=!e.findOptions.matchEntireCell,t});else{if("r"!==e.key||!e.altKey)return;pe(e=>{const t={...e};return t.findOptions.useRegex=!e.findOptions.useRegex,t})}e.preventDefault()},children:[t.jsxs(r,{sx:{display:"flex",flexDirection:"row",gap:e=>e.spacing(1)},children:[t.jsxs(r,{sx:{display:"flex",flexDirection:"row",alignItems:"start",gap:e=>e.spacing(.25),paddingTop:"3px"},children:[t.jsx(c,{selected:te,onSelectToggle:e=>{ne(e)},preventFocus:!0,label:"Toggle Additional Options",icon:p(t.jsx(d,{}))}),t.jsx(c,{selected:se,onSelectToggle:e=>{ie(e)},preventFocus:!0,label:"Toggle Replace",icon:p(t.jsx(f,{})),shortcut:{key:se?"F":"H",modifiers:[u.Ctrl]}})]}),t.jsxs(r,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box"},children:[t.jsxs(r,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t.jsx(x,{label:"Find",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),minWidth:ge>460?"20em":void 0,backgroundImage:`linear-gradient(${g("#fff",C(5))}, ${g("#fff",C(5))})`},inputProps:{draggable:!1,ref:G,className:"input",autoFocus:!0,spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}},endAdornment:t.jsx(m,{sx:{transform:"scale(0.75) translateX(16px)"},position:"end",children:t.jsxs(r,{sx:{display:"flex",alignItems:"center",flexDirection:"row",gap:"1px"},children:[t.jsx(c,{selected:ce.findOptions.matchCase,onSelectToggle:e=>{pe(t=>{const n={...t};return n.findOptions.matchCase=e,n})},label:"Match Case",shortcut:{key:"C",modifiers:[u.Alt]},icon:p(t.jsx(h,{}))}),t.jsx(c,{selected:ce.findOptions.matchEntireCell,onSelectToggle:e=>{pe(t=>{const n={...t};return n.findOptions.matchEntireCell=e,n})},label:"Match Entire Cell",shortcut:{key:"E",modifiers:[u.Alt]},icon:p(t.jsx(O,{}))}),t.jsx(c,{selected:ce.findOptions.useRegex,onSelectToggle:e=>{pe(t=>{const n={...t};return n.findOptions.useRegex=e,n})},label:"Use Regular Expression",shortcut:{key:"R",modifiers:[u.Alt]},icon:p(t.jsx(j,{}))})]})})},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1),"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>oe?`${e.palette.error.main} !important`:void 0},"& .MuiInputLabel-outlined":{color:e=>oe?`${e.palette.error.main} !important`:void 0}},value:ce.findText??"",onChange:e=>{pe(t=>{const n={...t};return n.findText=e.target.value,n})},onKeyDown:e=>ue(e,!1),onContextMenu:e=>{e.stopPropagation()}}),t.jsx(c,{selected:ce.findOptions.reverse,onSelectToggle:e=>{de(!1,!1)},touchRippleRef:q,label:"",shortcut:{key:"Enter",modifiers:[u.Shift]},icon:p(ce.findOptions.orientation!==F.Orientation.Column?t.jsx(I,{}):t.jsx(P,{})),disabled:!ce.findText}),t.jsx(c,{selected:!ce.findOptions.reverse,onSelectToggle:e=>{de(!0,!1)},touchRippleRef:J,label:"Next Match",shortcut:{key:"Enter"},icon:p(ce.findOptions.orientation!==F.Orientation.Column?t.jsx(L,{}):t.jsx(D,{})),disabled:!ce.findText})]}),t.jsx(y,{in:se,timeout:V,onExit:()=>{G.current?.focus()},children:t.jsxs(r,{sx:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:e=>e.spacing(2)},children:[t.jsx(x,{label:"Replace",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),backgroundImage:`linear-gradient(${g("#fff",C(5))}, ${g("#fff",C(5))})`},inputProps:{ref:X,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:ce.replaceText??"",onChange:e=>{pe(t=>{const n={...t};return n.replaceText=e.target.value,n})},onKeyDown:e=>ue(e,!0),onContextMenu:e=>{e.stopPropagation()}}),t.jsx(c,{onSelectToggle:e=>{de(!0,!0)},touchRippleRef:Q,label:"Replace",shortcut:{key:"Enter"},icon:p(t.jsx(b,{})),disabled:!ce.findText}),t.jsx(c,{onSelectToggle:e=>{de(!0,!0,!0)},touchRippleRef:Y,label:"Replace All",shortcut:{key:"Enter",modifiers:[u.Ctrl,u.Alt]},icon:p(t.jsx(R,{})),disabled:!ce.findText})]})})]})]}),t.jsx(y,{in:te,timeout:V,onExit:()=>{G.current?.focus()},children:t.jsxs(r,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:e=>e.spacing(.5),marginTop:e=>e.spacing(1)},children:[t.jsx(T,{orientation:"horizontal",sx:{marginBottom:e=>e.spacing(1.5)}}),t.jsxs(r,{sx:{display:"flex",flexDirection:ge>=413?"row":"column",justifyContent:"space-evenly",alignItems:"center",rowGap:e=>e.spacing(2)},tabIndex:-1,children:[t.jsx(A,{label:"Within",value:ce.scope,options:K,onSelect:e=>{pe(t=>{const n={...t};return n.scope=e,n})}}),t.jsx(A,{label:"Search",value:ce.findOptions.orientation!==F.Orientation.Column,options:B,onSelect:e=>{pe(t=>{const n={...t};return n.findOptions.orientation=e?F.Orientation.Row:F.Orientation.Column,n})}}),t.jsx(A,{label:"Look in",value:se&&ce.findOptions.fields?.[0]===E.Content.Values?E.Content.Formulas:ce.findOptions.fields?.[0],options:se?$:M,onSelect:e=>{pe(t=>{const n={...t};return n.findOptions.fields=[e],n})}})]})]})})]})})});export{H as FindReplaceWindow,K as ScopeOptions,H as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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{Workbook as e,IRange as t}from"@sheetxl/sdk";const n=async(e,t)=>{const{trimLeadingBlankRow:n=!0,trimLeadingBlankColumn:r=!0,excludeHidden:o=!1,sheetKey:s=null,papaParseConfig:a={}}=t||{},l=await import("./Cc_VWd0wF5-39LsI.mjs").then(e=>e.p);if(!e)throw new Error("workbook must be specified");let i=null;if(null===s?i=e.getSelectedSheet():"number"==typeof s?i=e.getSheets().search()[s]:"string"==typeof s&&(i=e.getSheets().getByName(s)),!i)throw new Error("invalid sheetKey specified");let d=null;const c=[];let p=null,f=i.getUsedRange({excludeHidden:o});if(!f)throw new Error("Nothing to export");if(!n||!r){const e=n?f.getRowStart():0,t=r?f.getColumnStart():0;f=f.getOffsetTo(e,t)}f.forEach((e,t)=>{const n=t.getCoords(),r=t.getCell();d!==n.rowIndex&&(p&&c.push(p),p=[],d=n.rowIndex);const o=r.toTextUnformatted()??"";p.push(o)},{includeEmpty:!0,address:null}),p&&c.push(p);const u={...a},g=l.unparse(c,u);return(new TextEncoder).encode(g).buffer},r=async(n,r)=>{const{papaParseConfig:o,setValuesOptions:s,createWorkbookOptions:a}=r??{},l=await import("./Cc_VWd0wF5-39LsI.mjs").then(e=>e.p),i=(new TextDecoder).decode(n);let d=-1;const c=new e(a),p=c.getSelectedSheet().getEntireRange().startIncrementalUpdates({orientation:t.Orientation.Row}),f=r?.onProgress;let u=0;const g={...o,transform:(e,t)=>{o?.transform&&(e=o.transform(e,t));const n=t;0===n&&d++;let r=e??"";return p.pushAt(d,n,r),u++,u%1e5==0&&f?.(u),e}};return l.parse(i,g).data,p.apply({textParser:!0,...s}),c};export{r as fromBufferCSV,n as toBufferCSV};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
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,CoordUtils as n,FormulaError as a,IRange as l,CommonUtils as c,Theme as h,JSONStableStringify as u,Workbook as d,IColor as p,OutOfBoundsError as g}from"@sheetxl/sdk";import{_ as f}from"./DtmE60AvstK9u0Ta.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+=` ${p.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,p)=>{const{password:f,onWarning:m,createWorkbookOptions:T={},...y}=p??{},b=import("./BDVJ7eOPpW5FnEAP.mjs"),x=import("./Bo_ZPRrOQrqOVHAF.mjs");let w=null;try{w=new DOMParser}catch(t){}let v=null;w||(v=import("./BlGoi1_x9rUMpWMd.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 p=S.read(t,{type:"array",sheets:[],cellStyles:!1,bookFiles:!0});if(!p.Directory)throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");p.Directory.richstructure=["/xl/richData/rdrichvaluestructure.xml"],p.Directory.richdata=["/xl/richData/rdrichvalue.xml"];const g=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=>p.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,g,V),e.set(i,o)),o},I=(t,s,h,u=D)=>{let d=O(s,u).get(t),p=d?.target;if(!p)return null;if("External"===d.targetMode)return d.target;const T=s.lastIndexOf("/"),w=s.substring(0,T+1);p.startsWith("/")||(p=w+p),p=(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("/")})(p);const S=g?.getVisitorParamsState().get("dxfs");let C=u.get(p);if(!C){const t="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";if(d.type===t){const t={};C=t;const s=async()=>{const s=((t,s,c,h,u,d,p)=>{const g=new ct,f=new i.TransposedBuilder;let m=null;g.registerVisitor({from:"autoFilter",to:"filter",openTag:t=>{t.copyTo("ref",lt)}}),g.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}}),g.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=h?.get(s);i||(d?.(`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)}}),g.registerVisitor({from:"colorScale",to:"colorScale"}),g.registerVisitor({from:"dataBar",to:"dataBar",openTag:t=>{t.copyTo("maxLength",nt),t.copyTo("minLength",nt),t.copyTo("showValue",rt)}}),g.registerVisitor({from:"iconSet",to:"iconSet",openTag:t=>{t.copyTo("iconSet",lt),t.copyTo("reverse",rt),t.copyTo("showValue",rt)}}),g.registerVisitor({from:"formula",to:null,text:(t,e)=>{const s=e.getParent();let i=s.formulas;i||(i=[],s.formulas=i),i.push(t)}}),g.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)}}),g.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)}}),g.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)}}),g.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")}}),g.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")}}),g.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)}}),g.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)}}),g.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)}}),g.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)}}),g.registerVisitor({from:"filter",to:"filter",openTag:t=>{const e=t.getParent();e.items||(e.items=[]),e.items.push(t.getAttribute("val",at))}}),g.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)}}),g.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")}}),g.registerVisitor({from:"sortState",to:"sort",openTag:t=>{t.copyTo("ref",lt)}}),g.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}}),g.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")};g.registerVisitor({from:"sheetView",to:"view",openTag:t=>{T(t)},closeTag:()=>{m=null}}),g.registerVisitor({from:"customSheetViews",to:"customSheetViews",openTag:t=>{t.setSource([])}}),g.registerVisitor({from:"customSheetView",to:[],openTag:t=>{T(t)},closeTag:()=>{m=null}}),g.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(" "))}}),g.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)}}}),g.registerVisitor({from:"tabColor",to:null,openTag:e=>{const s=gt(t=>e.getAttribute(t));s&&(t.tabColor=s)}}),g.registerVisitor({from:"pageSetUpPr",to:"pageSetUpPr",openTag:t=>{}}),g.registerVisitor({from:"outlinePr",to:"outlinePr",openTag:t=>{}}),g.registerVisitor({from:"pageMargins",to:"pageMargins",openTag:t=>{}}),g.registerVisitor({from:"pageSetup",to:"pageSetup",openTag:t=>{}}),g.registerVisitor({from:"printOptions",to:"printOptions",openTag:t=>{}}),g.registerVisitor({from:"mergeCells",to:"merges",openTag:t=>{t.setSource([])}}),g.registerVisitor({from:"mergeCell",to:[],openTag:t=>{const e=t.getAttribute("ref");t.setSource(e)}}),g.registerVisitor({from:"hyperlinks",to:"hyperlinks",openTag:t=>{t.setSource([])}}),g.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})}}),g.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)}}),g.registerVisitor({from:"tableParts",to:"tables",openTag:t=>{t.setSource([])}}),g.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)}}),g.registerVisitor({from:"worksheet",to:"worksheet",openTag:t=>{}}),g.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)}}),g.registerVisitor({from:"protectedRanges",to:"protectedRanges",openTag:t=>{t.setSource({})}}),g.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)}}),g.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")}}),g.registerVisitor({from:"cols",to:"cols",openTag:t=>{t.setSource([])}}),g.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")}}),g.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=c(y);return y=null,t},onError:t=>{}};return((t,s,i,o,c,h)=>{let u=!1,d=!1,p=[],g=!1,f=null,m=null,T=null,y=null,b=null,x=null;const w=h?.get("richData")??[],v=r.normalizeA1ToR1C1,S=n.createConflatingRanges(),C=new Map,k=[];let A=null;const D=n.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 a=D.done(!0),c=a.length;if(c>0){const t=new Array(c);for(let e=0;e<c;e++){const s=a[e],i=r.rangeToString(s);t[e]=i}s.volatile=t}if(k.length>0&&(s.dynamicArray=[...k]),p.length>0){p.sort(n.createRangeComparator(l.Orientation.Column));const t=[];let e=null,i=-1,o=-1,r=-1,a=-1,c=null;const h=p.length;h>0&&(e=p[0],i=e.colStart,o=e.colEnd,r=e.rowEnd,a=e.value,t.push(e));for(let s=1;s<h;s++)c=p[s],a!==c.value||i!==c.colStart||o!==c.colEnd||r+1!==c.rowEnd?(t.push(c),e=c,i=e.colStart,o=e.colEnd,r=e.rowEnd,a=e.value):(r=c.rowEnd,e.rowEnd=r);let u=[];for(let e=0;e<t.length;e++){const s=t[e];u.push({r:{colStart:s.colStart,colEnd:s.colEnd,rowStart:s.rowStart,rowEnd:s.rowEnd},v:s.value})}s.directStyles=u}const h=t.build();if(h){const t=h.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":d=!0;break;case"f":switch(s.t??null){case null:case"normal":g=!0;break;case"shared":const t=s.si;m=s.ref,f=t;break;case"array":g=!0,m=s.ref,A=[m,!1];break;case"datatable":g=!0,m=s.ref,g=!0}void 0!==s.ca&&D.append(O,I);break;case"is":return void(P=!0)}return void(P&&c?.onOpenTag(t))}if(u){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},p.push(Y)))}}else{if("row"===e){u=!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=c?.onEnd();null!==e&&t.addValue(O,I,""+e)}else c?.onCloseTag?.(e);return d&&(d=!1),void("c"===s&&(E=null,P=!1))}if(u)return u=!1,void(Y=null);i?.onCloseTag(e)},onText:s=>{if(s=s.trim(),d){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=a.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(g){const t=[];T=v(s,O,I,t),y=[T,t,s]}if(y)return S.append(O,I,y),y=null,g=!1,f=null,void(m=null);P?c?.onText(s):u||i?.onText(s)}}})(f,t,g.createEventHandler(t,()=>{},d),d,b,p)})(t,(t,e=!1)=>I(t,p,e)??null,j,S,0,t=>{m&&(t=p+": "+t,m?.(t))},A),h=ht(p,P),d=await(async(t,e=8388608)=>{await(async()=>{if("undefined"==typeof ReadableStream)if("undefined"==typeof window){const{ReadableStream:t}=await import("./BUSR_OK5Qi6hRPfw.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()})(h);try{await it.parseStream(d,s,{xmlns:!1})}catch(t){throw console.warn(`Error parsing sheet: '${p}'`,t),new Error(`Error parsing sheet: '${p}'`,{cause:t})}const g=O(p,u);let f,T=new Map;if(g){const e="http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";let s;g.forEach((t,s)=>{if(t.type===e){const t=I(s,p,!1,u);f=t?.comments,f&&f.forEach(t=>{T.set(t.id,t)})}});const i="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";if(g.forEach((t,e)=>{if(t.type===i){const t=I(e,p,!1,u);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 n=H.get(r);n||(n=F.get(r)),n||(n={id:c.uuidV4(),displayName:r},F.set(n.displayName,n),H.set(n.id,n)),r=n?.id??null;const a={id:c.uuidV4(),personId:r,ref:o.ref,done:!1,asNote:!0,content:o.content};e.push(a)}}t.comments=e}}};E.push(s())}else C=h?ht(p,P,t=>{const e=y.add({buffer:t});return e.addReference(x),v.add(e),b.toResourceId(e)},V):ut(p,P,f,g,V)}return C},V={paramMap:A,getRefs:O,getRef:I,parsedRefs:D,onWarning:m,addPerson:t=>null},L=[];let N=0;p.Strings&&(N=parseInt(p.Strings.Unique??p.Strings.length??0));const R=p.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",p,f,g,V),dt("richdata",p,f,g,V),new Map),F=new Map,X=dt("people",p,f,g);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",p,f,g,V);let _=null;if(W&&W.entries){let t=W.entries().next();t?.value?.[1]&&(_=t.value[1])}const q=new h(_),z=dt("styles",p,f,g,V);let U=z.entries().next()?.value[1];U&&(U=JSON.parse(u(U)));const G=dt("workbooks",p,f,g,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 d(Q);return v.forEach(t=>{t.deleteReference(x)}),b.endPersist(),J}catch(t){let e="Unable to parse XLSX.";throw t instanceof g&&(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("./BDVJ7eOPpW5FnEAP.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};
|