@sheetxl/studio-vanilla 0.4.9 → 0.4.11
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/README.md +1 -1
- package/browser/cjs/B0rdyyttE2Aibsag.cjs +7 -0
- package/browser/cjs/B2e7dDI-zKoqXpIW.cjs +107 -0
- package/browser/cjs/BAyEOOtO-9sHQQRW.cjs +7 -0
- package/browser/cjs/BPTHTRDvNOVkUJGa.cjs +7 -0
- package/browser/cjs/BlSFY6zLlebuejdV.cjs +7 -0
- package/browser/cjs/BplA5pDzOJpfTZuA.cjs +7 -0
- package/browser/cjs/BshvMtUxTJHj3JQN.cjs +7 -0
- package/browser/cjs/BuWtGFX0HiBezGjw.cjs +7 -0
- package/browser/cjs/C5FXOMLhAu_KTjVe.cjs +7 -0
- package/browser/cjs/C7EZCTczsC-gkRcq.cjs +7 -0
- package/browser/cjs/CFcjX5-nVsgzdZ4F.cjs +7 -0
- package/browser/cjs/CjZbhk41S1qO_74G.cjs +7 -0
- package/browser/cjs/CuTW2Pt-L5n-hNxV.cjs +7 -0
- package/browser/cjs/D3iOk-Q2tRdUeTcn.cjs +7 -0
- package/browser/cjs/DFspSkki779xN-Ey.cjs +7 -0
- package/browser/cjs/DFtyXc7YFh9dIp74.cjs +7 -0
- package/browser/cjs/Db_Ew1r6yOMYylvA.cjs +7 -0
- package/browser/cjs/DgBn3aW39yjgm0X_.cjs +7 -0
- package/browser/cjs/DiBy6-IxLscyMW2y.cjs +7 -0
- package/browser/cjs/DrlS1oz9Nea8Pm3j.cjs +7 -0
- package/browser/cjs/Dx-jp_LJxWbAScyA.cjs +7 -0
- package/browser/cjs/SzxJv7OUs5ojl8gx.cjs +7 -0
- package/browser/cjs/T4SHYo66xDT3l9JN.cjs +7 -0
- package/browser/cjs/index.cjs +4 -3
- package/browser/cjs/vfUix5Di0Ro8tEID.cjs +7 -0
- package/browser/esm/B5kkStdEkTczERyM.mjs +7 -0
- package/browser/esm/B905wKzTtod-jbsD.mjs +7 -0
- package/browser/esm/BALnKy2Fp7fyk-lc.mjs +7 -0
- package/browser/esm/BDVJ7eOPpW5FnEAP.mjs +7 -0
- package/browser/esm/BGpv6Kq7eBlJy43T.mjs +7 -0
- package/browser/esm/BUSR_OK5Qi6hRPfw.mjs +7 -0
- package/browser/esm/BXUGsC1Mo3FP8vnW.mjs +7 -0
- package/browser/esm/BlGoi1_x9rUMpWMd.mjs +7 -0
- package/browser/esm/Bo_ZPRrOQrqOVHAF.mjs +7 -0
- package/browser/esm/BuURCm92KsyGHG9e.mjs +7 -0
- package/browser/esm/CFFC0SNc24a0Dxnh.mjs +7 -0
- package/browser/esm/CGZ5MX7afzMxDkCe.mjs +7 -0
- package/browser/esm/Cc_VWd0wF5-39LsI.mjs +7 -0
- package/browser/esm/Cq8D_M0jeHLcnRjg.mjs +7 -0
- package/browser/esm/CzmNwV9tfFYUp_gS.mjs +7 -0
- package/browser/esm/De6RPxc4p_jXLlT5.mjs +7 -0
- package/browser/esm/DlVZFM9ZR5jGyG0_.mjs +7 -0
- package/browser/esm/DqXxZP6yKF4U1YfY.mjs +7 -0
- package/browser/esm/DtmE60AvstK9u0Ta.mjs +107 -0
- package/browser/esm/Dz2OVgq3kxi1TkfX.mjs +7 -0
- package/browser/esm/PS0cqYnlMVEGOQpI.mjs +7 -0
- package/browser/esm/QBGUD1XS5_pysBLL.mjs +7 -0
- package/browser/esm/index.mjs +2 -8
- package/browser/esm/tFhROdVSw9KLQfUN.mjs +7 -0
- package/browser/esm/uGDCdtqxjqRCo4Xn.mjs +7 -0
- package/cdn/index.js +40 -44
- package/cdn/loader.js +1 -1
- package/package.json +5 -5
- package/types/index.d.ts +9 -9
- package/browser/cjs/3GhIDU8JK1oBJrCA.cjs +0 -6
- package/browser/cjs/5hPVyVAXmITQCRAG.cjs +0 -6
- package/browser/cjs/7PlrLPQx1lct0mdN.cjs +0 -6
- package/browser/cjs/B4K6KuggSdXj-V8g.cjs +0 -6
- package/browser/cjs/B5Qc3gXLEhscRsFm.cjs +0 -12
- package/browser/cjs/B7eW1GQgFvphlLGY.cjs +0 -6
- package/browser/cjs/BQPFxJ77OaD_sBIX.cjs +0 -6
- package/browser/cjs/Ba3O1f0NYbzEwNAd.cjs +0 -6
- package/browser/cjs/BoojmbbjqixMVu2H.cjs +0 -6
- package/browser/cjs/CSGVl8EBCRhxcFm1.cjs +0 -15
- package/browser/cjs/CalnqtYH48_x2rcI.cjs +0 -301
- package/browser/cjs/CjDsO4sQWUHbIX1N.cjs +0 -6
- package/browser/cjs/CsCaFaiySArzEfdH.cjs +0 -7
- package/browser/cjs/D6AUUY9awlTRjjqd.cjs +0 -11
- package/browser/cjs/D8lN5Mv3J4SwSpLP.cjs +0 -161
- package/browser/cjs/D9RQ5oYv7U38wSI7.cjs +0 -11
- package/browser/cjs/DCd2rPNFkSHDaRcM.cjs +0 -7
- package/browser/cjs/DGQrcBvjSGwwoZEv.cjs +0 -6
- package/browser/cjs/DIXyMJKaeCGuWxjZ.cjs +0 -12
- package/browser/cjs/Dmw7xaaV85s72QZe.cjs +0 -145
- package/browser/cjs/DzCXPcqV1oKbCcLO.cjs +0 -16
- package/browser/cjs/EoaX6dPoS-Mb-ITO.cjs +0 -42
- package/browser/cjs/Y6OgkWqbIB761o5q.cjs +0 -6
- package/browser/cjs/gbABnN2zW1kHo3_I.cjs +0 -19
- package/browser/cjs/kfV5Cli9oE9IsCtx.cjs +0 -6
- package/browser/cjs/nURb18uhj9rScsHa.cjs +0 -6
- package/browser/esm/2NQDbhor1Nuzndgq.mjs +0 -3756
- package/browser/esm/4aC35Q2XPOwifBRR.mjs +0 -1365
- package/browser/esm/5zFDFBAgT-aPgQQ0.mjs +0 -1665
- package/browser/esm/B3I_TrFN_pAK5Mdh.mjs +0 -2346
- package/browser/esm/BD9GKsR-k4aEK2tx.mjs +0 -421
- package/browser/esm/BQpsMTJvguy6LMIq.mjs +0 -43
- package/browser/esm/BfCWogOnq8R-c3dD.mjs +0 -21
- package/browser/esm/BkGQPKMRPIVUVTLO.mjs +0 -944
- package/browser/esm/C81J50HcankGTOIj.mjs +0 -390
- package/browser/esm/CO_s27056nua6qzN.mjs +0 -1346
- package/browser/esm/CPEjlDUTxckVS1rp.mjs +0 -50
- package/browser/esm/CY7astxzrfb7uZqy.mjs +0 -2178
- package/browser/esm/CZVzRhflTpwAAl1o.mjs +0 -22
- package/browser/esm/CaWZXQsmKl4hTNq5.mjs +0 -46
- package/browser/esm/CxcLNXXaxyFyUzyb.mjs +0 -633
- package/browser/esm/D0icxW0WVNoeVRLH.mjs +0 -58
- package/browser/esm/DFQvqk5r1uf_z0h_.mjs +0 -24994
- package/browser/esm/DRL5s4S0fIXi1aU7.mjs +0 -84
- package/browser/esm/DRmeb1VC4YCzKKWd.mjs +0 -13208
- package/browser/esm/DTwhl4v5YnZrUSgI.mjs +0 -24
- package/browser/esm/DmpPAs6w-XNWGTIN.mjs +0 -1703
- package/browser/esm/Dx-GS3XDBkRaMNG-.mjs +0 -151
- package/browser/esm/V5CA7xqGOB7-Qx4Y.mjs +0 -1467
- package/browser/esm/gsfI5CGYr7LCQxRx.mjs +0 -41
- package/browser/esm/tOBqasyBAnd7O4qE.mjs +0 -46
- package/browser/esm/tPrnEcHW_czJDZOT.mjs +0 -50
- package/cdn/assets/2NQDbhor1Nuzndgq.js +0 -3756
- package/cdn/assets/4aC35Q2XPOwifBRR.js +0 -1365
- package/cdn/assets/5zFDFBAgT-aPgQQ0.js +0 -1665
- package/cdn/assets/B0w_moB3pDJd-a6V.js +0 -24
- package/cdn/assets/BD9GKsR-k4aEK2tx.js +0 -421
- package/cdn/assets/BJVOhUH_XL03H6ZD.js +0 -22
- package/cdn/assets/BWJOkXXB6Tr-jYUS.js +0 -46
- package/cdn/assets/BapFqJyAb3cblvJM.js +0 -50
- package/cdn/assets/Bg88bG-JM9EHeyYX.js +0 -41
- package/cdn/assets/C81J50HcankGTOIj.js +0 -390
- package/cdn/assets/CO_s27056nua6qzN.js +0 -1346
- package/cdn/assets/CXa9u-7w14dyPYxk.js +0 -1703
- package/cdn/assets/CkcETdiKdTsZAzma.js +0 -1467
- package/cdn/assets/CxcLNXXaxyFyUzyb.js +0 -633
- package/cdn/assets/D0PaU6F-TNaTWj-a.js +0 -43
- package/cdn/assets/D4hoypx6_sZbvrC_.js +0 -2346
- package/cdn/assets/D5exf1RvCqvUoJ3X.js +0 -2178
- package/cdn/assets/DKLitAhDj5Ibh2cc.js +0 -24841
- package/cdn/assets/DRL5s4S0fIXi1aU7.js +0 -84
- package/cdn/assets/DRmeb1VC4YCzKKWd.js +0 -13208
- package/cdn/assets/DYkBvlMlZjOASUJs.js +0 -58
- package/cdn/assets/ON5--a75QdEU99y_.js +0 -151
- package/cdn/assets/PIZDjyqIbvmHXs1T.js +0 -46
- package/cdn/assets/TOkIJFYhNg78FdJa.js +0 -21
- package/cdn/assets/b9dlFmoFz8tJhV0Z.js +0 -50
- package/cdn/assets/d1PG-QPA1GcQ_RuH.js +0 -944
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
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=t.Mb(t.Uw());function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}var n=/^\s+/,o=/\s+$/;function i(t,e){if(e=e||{},(t=t||"")instanceof i)return t;if(!(this instanceof i))return new i(t,e);var a=function(t){var e,i,a,u={r:0,g:0,b:0},s=1,c=null,f=null,l=null,h=!1,p=!1;return"string"==typeof t&&(t=function(t){t=t.replace(n,"").replace(o,"").toLowerCase();var e,r=!1;if(w[t])t=w[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=L.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=L.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=L.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=L.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=L.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=L.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=L.hex8.exec(t))?{r:S(e[1]),g:S(e[2]),b:S(e[3]),a:R(e[4]),format:r?"name":"hex8"}:(e=L.hex6.exec(t))?{r:S(e[1]),g:S(e[2]),b:S(e[3]),format:r?"name":"hex"}:(e=L.hex4.exec(t))?{r:S(e[1]+""+e[1]),g:S(e[2]+""+e[2]),b:S(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:r?"name":"hex8"}:!!(e=L.hex3.exec(t))&&{r:S(e[1]+""+e[1]),g:S(e[2]+""+e[2]),b:S(e[3]+""+e[3]),format:r?"name":"hex"}}(t)),"object"==r(t)&&(U(t.r)&&U(t.g)&&U(t.b)?(e=t.r,i=t.g,a=t.b,u={r:255*M(e,255),g:255*M(i,255),b:255*M(a,255)},h=!0,p="%"===String(t.r).substr(-1)?"prgb":"rgb"):U(t.h)&&U(t.s)&&U(t.v)?(c=A(t.s),f=A(t.v),u=function(t,e,r){t=6*M(t,360),e=M(e,100),r=M(r,100);var n=Math.floor(t),o=t-n,i=r*(1-e),a=r*(1-o*e),u=r*(1-(1-o)*e),s=n%6;return{r:255*[r,a,i,i,u,r][s],g:255*[u,r,r,a,i,i][s],b:255*[i,i,u,r,r,a][s]}}(t.h,c,f),h=!0,p="hsv"):U(t.h)&&U(t.s)&&U(t.l)&&(c=A(t.s),l=A(t.l),u=function(t,e,r){var n,o,i;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=M(t,360),e=M(e,100),r=M(r,100),0===e)n=o=i=r;else{var u=r<.5?r*(1+e):r+e-r*e,s=2*r-u;n=a(s,u,t+1/3),o=a(s,u,t),i=a(s,u,t-1/3)}return{r:255*n,g:255*o,b:255*i}}(t.h,c,l),h=!0,p="hsl"),t.hasOwnProperty("a")&&(s=t.a)),s=O(s),{ok:h,format:t.format||p,r:Math.min(255,Math.max(u.r,0)),g:Math.min(255,Math.max(u.g,0)),b:Math.min(255,Math.max(u.b,0)),a:s}}(t);this._originalInput=t,this._r=a.r,this._g=a.g,this._b=a.b,this._a=a.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||a.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=a.ok}function a(t,e,r){t=M(t,255),e=M(e,255),r=M(r,255);var n,o,i=Math.max(t,e,r),a=Math.min(t,e,r),u=(i+a)/2;if(i==a)n=o=0;else{var s=i-a;switch(o=u>.5?s/(2-i-a):s/(i+a),i){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:o,l:u}}function u(t,e,r){t=M(t,255),e=M(e,255),r=M(r,255);var n,o,i=Math.max(t,e,r),a=Math.min(t,e,r),u=i,s=i-a;if(o=0===i?0:s/i,i==a)n=0;else{switch(i){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:o,v:u}}function s(t,e,r,n){var o=[k(Math.round(t).toString(16)),k(Math.round(e).toString(16)),k(Math.round(r).toString(16))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function c(t,e,r,n){return[k(C(n)),k(Math.round(t).toString(16)),k(Math.round(e).toString(16)),k(Math.round(r).toString(16))].join("")}function f(t,e){e=0===e?0:e||10;var r=i(t).toHsl();return r.s-=e/100,r.s=E(r.s),i(r)}function l(t,e){e=0===e?0:e||10;var r=i(t).toHsl();return r.s+=e/100,r.s=E(r.s),i(r)}function h(t){return i(t).desaturate(100)}function p(t,e){e=0===e?0:e||10;var r=i(t).toHsl();return r.l+=e/100,r.l=E(r.l),i(r)}function d(t,e){e=0===e?0:e||10;var r=i(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-e/100*255))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-e/100*255))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-e/100*255))),i(r)}function b(t,e){e=0===e?0:e||10;var r=i(t).toHsl();return r.l-=e/100,r.l=E(r.l),i(r)}function v(t,e){var r=i(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,i(r)}function g(t){var e=i(t).toHsl();return e.h=(e.h+180)%360,i(e)}function y(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=i(t).toHsl(),n=[i(t)],o=360/e,a=1;a<e;a++)n.push(i({h:(r.h+a*o)%360,s:r.s,l:r.l}));return n}function m(t){var e=i(t).toHsl(),r=e.h;return[i(t),i({h:(r+72)%360,s:e.s,l:e.l}),i({h:(r+216)%360,s:e.s,l:e.l})]}function x(t,e,r){e=e||6,r=r||30;var n=i(t).toHsl(),o=360/r,a=[i(t)];for(n.h=(n.h-(o*e>>1)+720)%360;--e;)n.h=(n.h+o)%360,a.push(i(n));return a}function _(t,e){e=e||6;for(var r=i(t).toHsv(),n=r.h,o=r.s,a=r.v,u=[],s=1/e;e--;)u.push(i({h:n,s:o,v:a})),a=(a+s)%1;return u}i.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=O(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=u(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=a(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return s(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,o){var i=[k(Math.round(t).toString(16)),k(Math.round(e).toString(16)),k(Math.round(r).toString(16)),k(C(n))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*M(this._r,255))+"%",g:Math.round(100*M(this._g,255))+"%",b:Math.round(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*M(this._r,255))+"%, "+Math.round(100*M(this._g,255))+"%, "+Math.round(100*M(this._b,255))+"%)":"rgba("+Math.round(100*M(this._r,255))+"%, "+Math.round(100*M(this._g,255))+"%, "+Math.round(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(j[s(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+c(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var o=i(t);r="#"+c(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return i(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(d,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(l,arguments)},greyscale:function(){return this._applyModification(h,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(g,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(m,arguments)},triad:function(){return this._applyCombination(y,[3])},tetrad:function(){return this._applyCombination(y,[4])}},i.fromRatio=function(t,e){if("object"==r(t)){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]="a"===o?t[o]:A(t[o]));t=n}return i(t,e)},i.equals=function(t,e){return!(!t||!e)&&i(t).toRgbString()==i(e).toRgbString()},i.random=function(){return i.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},i.mix=function(t,e,r){r=0===r?0:r||50;var n=i(t).toRgb(),o=i(e).toRgb(),a=r/100;return i({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},i.readability=function(t,e){var r=i(t),n=i(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},i.isReadable=function(t,e,r){var n,o,a=i.readability(t,e);switch(o=!1,(n=function(t){var e,r;return"AA"!==(e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==e&&(e="AA"),"small"!==(r=(t.size||"small").toLowerCase())&&"large"!==r&&(r="small"),{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":o=a>=4.5;break;case"AAlarge":o=a>=3;break;case"AAAsmall":o=a>=7}return o},i.mostReadable=function(t,e,r){var n,o,a,u,s=null,c=0;o=(r=r||{}).includeFallbackColors,a=r.level,u=r.size;for(var f=0;f<e.length;f++)(n=i.readability(t,e[f]))>c&&(c=n,s=i(e[f]));return i.isReadable(t,s,{level:a,size:u})||!o?s:(r.includeFallbackColors=!1,i.mostReadable(t,["#fff","#000"],r))};var w=i.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},j=i.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(w);function O(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function M(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function E(t){return Math.min(1,Math.max(0,t))}function S(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function A(t){return t<=1&&(t=100*t+"%"),t}function C(t){return Math.round(255*parseFloat(t)).toString(16)}function R(t){return S(t)/255}var z,P,T,L=(P="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",T="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+P),rgba:new RegExp("rgba"+T),hsl:new RegExp("hsl"+P),hsla:new RegExp("hsla"+T),hsv:new RegExp("hsv"+P),hsva:new RegExp("hsva"+T),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!L.CSS_UNIT.exec(t)}var F,D,B,H,W,$,N,I,V,X,Y,q,K,G,J,Q,Z,tt,et,rt,nt,ot,it,at,ut,st,ct,ft,lt={},ht={};function pt(){if(D)return F;D=1;var e="object"==typeof t.Tb&&t.Tb&&t.Tb.Object===Object&&t.Tb;return F=e}function dt(){if(H)return B;H=1;var t=pt(),e="object"==typeof self&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return B=r}function bt(){if($)return W;$=1;var t=dt().Symbol;return W=t}function vt(){if(q)return Y;q=1;var t=bt(),e=function(){if(I)return N;I=1;var t=bt(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,o=t?t.toStringTag:void 0;return N=function(t){var e=r.call(t,o),i=t[o];try{t[o]=void 0;var a=!0}catch(t){}var u=n.call(t);return a&&(e?t[o]=i:delete t[o]),u}}(),r=function(){if(X)return V;X=1;var t=Object.prototype.toString;return V=function(e){return t.call(e)}}(),n=t?t.toStringTag:void 0;return Y=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":n&&n in Object(t)?e(t):r(t)}}function gt(){if(G)return K;G=1;var t=Array.isArray;return K=t}function yt(){return Q?J:(Q=1,J=function(t){return null!=t&&"object"==typeof t})}function mt(){if(ft)return ct;ft=1;var t=function(){if(st)return ut;st=1;var t=vt(),e=yt();return ut=function(r){return e(r)&&"[object Arguments]"==t(r)}}(),e=yt(),r=Object.prototype,n=r.hasOwnProperty,o=r.propertyIsEnumerable,i=t(function(){return arguments}())?t:function(t){return e(t)&&n.call(t,"callee")&&!o.call(t,"callee")};return ct=i}var xt,_t,wt,jt,Ot,Mt,Et,St,kt,At,Ct,Rt={exports:{}};function zt(){return wt||(wt=1,t=Rt,e=Rt.exports,r=dt(),n=_t?xt:(_t=1,xt=function(){return!1}),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,u=(a?a.isBuffer:void 0)||n,t.exports=u),Rt.exports;var t,e,r,n,o,i,a,u}function Pt(){if(Ot)return jt;Ot=1;var t=/^(?:0|[1-9]\d*)$/;return jt=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}}function Tt(){return Et?Mt:(Et=1,Mt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991})}function Lt(){return Ct?At:(Ct=1,At=function(t){return function(e){return t(e)}})}var Ut,Ft,Dt,Bt,Ht,Wt,$t,Nt,It,Vt,Xt,Yt,qt,Kt,Gt,Jt,Qt,Zt,te,ee,re,ne,oe,ie,ae,ue,se,ce,fe,le,he,pe,de,be,ve,ge,ye,me,xe,_e,we,je,Oe,Me,Ee,Se,ke,Ae,Ce,Re,ze,Pe,Te,Le,Ue,Fe,De,Be,He,We,$e,Ne,Ie,Ve,Xe,Ye,qe,Ke,Ge,Je,Qe,Ze,tr,er,rr,nr,or,ir,ar,ur,sr,cr,fr,lr,hr,pr,dr,br,vr,gr,yr,mr,xr,_r,wr,jr,Or,Mr,Er,Sr,kr,Ar,Cr,Rr,zr,Pr,Tr,Lr,Ur,Fr,Dr,Br,Hr,Wr,$r,Nr,Ir,Vr,Xr,Yr,qr,Kr,Gr,Jr,Qr,Zr,tn,en,rn,nn,on,an,un,sn,cn,fn,ln,hn,pn,dn,bn,vn,gn,yn,mn,xn,_n,wn,jn,On,Mn,En,Sn,kn,An,Cn,Rn,zn,Pn,Tn,Ln,Un,Fn,Dn,Bn,Hn,Wn,$n,Nn,In,Vn,Xn,Yn,qn,Kn,Gn,Jn,Qn,Zn,to,eo,ro,no,oo,io,ao,uo,so,co,fo,lo,ho,po,bo,vo,go,yo,mo,xo,_o,wo,jo,Oo,Mo,Eo,So,ko,Ao,Co,Ro,zo,Po,To={exports:{}};function Lo(){return Ut||(Ut=1,t=To,e=To.exports,r=pt(),n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,i=o&&o.exports===n&&r.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}(),t.exports=a),To.exports;var t,e,r,n,o,i,a}function Uo(){if(Dt)return Ft;Dt=1;var t=function(){if(kt)return St;kt=1;var t=vt(),e=Tt(),r=yt(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,St=function(o){return r(o)&&e(o.length)&&!!n[t(o)]}}(),e=Lt(),r=Lo(),n=r&&r.isTypedArray,o=n?e(n):t;return Ft=o}function Fo(){if(Ht)return Bt;Ht=1;var t=at?it:(at=1,it=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}),e=mt(),r=gt(),n=zt(),o=Pt(),i=Uo(),a=Object.prototype.hasOwnProperty;return Bt=function(u,s){var c=r(u),f=!c&&e(u),l=!c&&!f&&n(u),h=!c&&!f&&!l&&i(u),p=c||f||l||h,d=p?t(u.length,String):[],b=d.length;for(var v in u)!s&&!a.call(u,v)||p&&("length"==v||l&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||o(v,b))||d.push(v);return d}}function Do(){if($t)return Wt;$t=1;var t=Object.prototype;return Wt=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}}function Bo(){return It?Nt:(It=1,Nt=function(t,e){return function(r){return t(e(r))}})}function Ho(){return Gt?Kt:(Gt=1,Kt=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)})}function Wo(){if(Qt)return Jt;Qt=1;var t=vt(),e=Ho();return Jt=function(r){if(!e(r))return!1;var n=t(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}}function $o(){if(te)return Zt;te=1;var t=Wo(),e=Tt();return Zt=function(r){return null!=r&&e(r.length)&&!t(r)}}function No(){if(re)return ee;re=1;var t=Fo(),e=function(){if(qt)return Yt;qt=1;var t=Do(),e=function(){if(Xt)return Vt;Xt=1;var t=Bo()(Object.keys,Object);return Vt=t}(),r=Object.prototype.hasOwnProperty;return Yt=function(n){if(!t(n))return e(n);var o=[];for(var i in Object(n))r.call(n,i)&&"constructor"!=i&&o.push(i);return o}}(),r=$o();return ee=function(n){return r(n)?t(n):e(n)}}function Io(){if(oe)return ne;oe=1;var t=function(){if(ot)return nt;ot=1;var t=(rt?et:(rt=1,et=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var s=a[t?u:++o];if(!1===r(i[s],s,i))break}return e}}))();return nt=t}(),e=No();return ne=function(r,n){return r&&t(r,n,e)}}function Vo(){return ae?ie:(ae=1,ie=function(t){return t})}function Xo(){if(fe)return ce;fe=1;var t=Io(),e=function(){if(se)return ue;se=1;var t=Vo();return ue=function(e){return"function"==typeof e?e:t}}();return ce=function(r,n){return r&&t(r,e(n))}}function Yo(){if(he)return le;he=1;var t=Bo()(Object.getPrototypeOf,Object);return le=t}function qo(){return ve?be:(ve=1,be=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o})}function Ko(){return xe?me:(xe=1,me=function(t,e){return t===e||t!=t&&e!=e})}function Go(){if(we)return _e;we=1;var t=Ko();return _e=function(e,r){for(var n=e.length;n--;)if(t(e[n][0],r))return n;return-1}}function Jo(){if(ze)return Re;ze=1;var t=ye?ge:(ye=1,ge=function(){this.__data__=[],this.size=0}),e=function(){if(Oe)return je;Oe=1;var t=Go(),e=Array.prototype.splice;return je=function(r){var n=this.__data__,o=t(n,r);return!(o<0||(o==n.length-1?n.pop():e.call(n,o,1),--this.size,0))}}(),r=function(){if(Ee)return Me;Ee=1;var t=Go();return Me=function(e){var r=this.__data__,n=t(r,e);return n<0?void 0:r[n][1]}}(),n=function(){if(ke)return Se;ke=1;var t=Go();return Se=function(e){return t(this.__data__,e)>-1}}(),o=function(){if(Ce)return Ae;Ce=1;var t=Go();return Ae=function(e,r){var n=this.__data__,o=t(n,e);return o<0?(++this.size,n.push([e,r])):n[o][1]=r,this}}();function i(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,Re=i}function Qo(){if(Xe)return Ve;Xe=1;var t=Function.prototype.toString;return Ve=function(e){if(null!=e){try{return t.call(e)}catch(t){}try{return e+""}catch(t){}}return""}}function Zo(){if(Qe)return Je;Qe=1;var t=function(){if(qe)return Ye;qe=1;var t=Wo(),e=function(){if(Ie)return Ne;Ie=1;var t,e=function(){if($e)return We;$e=1;var t=dt()["__core-js_shared__"];return We=t}(),r=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return Ne=function(t){return!!r&&r in t}}(),r=Ho(),n=Qo(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,a=Object.prototype,u=i.toString,s=a.hasOwnProperty,c=RegExp("^"+u.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return Ye=function(i){return!(!r(i)||e(i))&&(t(i)?c:o).test(n(i))}}(),e=Ge?Ke:(Ge=1,Ke=function(t,e){return null==t?void 0:t[e]});return Je=function(r,n){var o=e(r,n);return t(o)?o:void 0}}function ti(){if(tr)return Ze;tr=1;var t=Zo()(dt(),"Map");return Ze=t}function ei(){if(rr)return er;rr=1;var t=Zo()(Object,"create");return er=t}function ri(){if(xr)return mr;xr=1;var t=yr?gr:(yr=1,gr=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return mr=function(e,r){var n=e.__data__;return t(r)?n["string"==typeof r?"string":"hash"]:n.map}}function ni(){if(Cr)return Ar;Cr=1;var t=function(){if(vr)return br;vr=1;var t=function(){if(dr)return pr;dr=1;var t=function(){if(or)return nr;or=1;var t=ei();return nr=function(){this.__data__=t?t(null):{},this.size=0}}(),e=ar?ir:(ar=1,ir=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),r=function(){if(sr)return ur;sr=1;var t=ei(),e=Object.prototype.hasOwnProperty;return ur=function(r){var n=this.__data__;if(t){var o=n[r];return"__lodash_hash_undefined__"===o?void 0:o}return e.call(n,r)?n[r]:void 0}}(),n=function(){if(fr)return cr;fr=1;var t=ei(),e=Object.prototype.hasOwnProperty;return cr=function(r){var n=this.__data__;return t?void 0!==n[r]:e.call(n,r)}}(),o=function(){if(hr)return lr;hr=1;var t=ei();return lr=function(e,r){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=t&&void 0===r?"__lodash_hash_undefined__":r,this}}();function i(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,pr=i}(),e=Jo(),r=ti();return br=function(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}}(),e=function(){if(wr)return _r;wr=1;var t=ri();return _r=function(e){var r=t(this,e).delete(e);return this.size-=r?1:0,r}}(),r=function(){if(Or)return jr;Or=1;var t=ri();return jr=function(e){return t(this,e).get(e)}}(),n=function(){if(Er)return Mr;Er=1;var t=ri();return Mr=function(e){return t(this,e).has(e)}}(),o=function(){if(kr)return Sr;kr=1;var t=ri();return Sr=function(e,r){var n=t(this,e),o=n.size;return n.set(e,r),this.size+=n.size==o?0:1,this}}();function i(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,Ar=i}function oi(){if(Tr)return Pr;Tr=1;var t=Jo(),e=function(){if(Te)return Pe;Te=1;var t=Jo();return Pe=function(){this.__data__=new t,this.size=0}}(),r=Ue?Le:(Ue=1,Le=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}),n=De?Fe:(De=1,Fe=function(t){return this.__data__.get(t)}),o=He?Be:(He=1,Be=function(t){return this.__data__.has(t)}),i=function(){if(zr)return Rr;zr=1;var t=Jo(),e=ti(),r=ni();return Rr=function(n,o){var i=this.__data__;if(i instanceof t){var a=i.__data__;if(!e||a.length<199)return a.push([n,o]),this.size=++i.size,this;i=this.__data__=new r(a)}return i.set(n,o),this.size=i.size,this}}();function a(e){var r=this.__data__=new t(e);this.size=r.size}return a.prototype.clear=e,a.prototype.delete=r,a.prototype.get=n,a.prototype.has=o,a.prototype.set=i,Pr=a}function ii(){if(Xr)return Vr;Xr=1;var t=function(){if(Hr)return Br;Hr=1;var t=ni(),e=Ur?Lr:(Ur=1,Lr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}),r=Dr?Fr:(Dr=1,Fr=function(t){return this.__data__.has(t)});function n(e){var r=-1,n=null==e?0:e.length;for(this.__data__=new t;++r<n;)this.add(e[r])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,Br=n}(),e=$r?Wr:($r=1,Wr=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}),r=Ir?Nr:(Ir=1,Nr=function(t,e){return t.has(e)});return Vr=function(n,o,i,a,u,s){var c=1&i,f=n.length,l=o.length;if(f!=l&&!(c&&l>f))return!1;var h=s.get(n),p=s.get(o);if(h&&p)return h==o&&p==n;var d=-1,b=!0,v=2&i?new t:void 0;for(s.set(n,o),s.set(o,n);++d<f;){var g=n[d],y=o[d];if(a)var m=c?a(y,g,d,o,n,s):a(g,y,d,n,o,s);if(void 0!==m){if(m)continue;b=!1;break}if(v){if(!e(o,function(t,e){if(!r(v,e)&&(g===t||u(g,t,i,a,s)))return v.push(e)})){b=!1;break}}else if(g!==y&&!u(g,y,i,a,s)){b=!1;break}}return s.delete(n),s.delete(o),b}}function ai(){if(qr)return Yr;qr=1;var t=dt().Uint8Array;return Yr=t}function ui(){return rn?en:(rn=1,en=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t})}function si(){if(on)return nn;on=1;var t=ui(),e=gt();return nn=function(r,n,o){var i=n(r);return e(r)?i:t(i,o(r))}}function ci(){return cn?sn:(cn=1,sn=function(){return[]})}function fi(){if(ln)return fn;ln=1;var t=un?an:(un=1,an=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}),e=ci(),r=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols;return fn=n?function(e){return null==e?[]:(e=Object(e),t(n(e),function(t){return r.call(e,t)}))}:e}function li(){if(pn)return hn;pn=1;var t=si(),e=fi(),r=No();return hn=function(n){return t(n,r,e)}}function hi(){if(Mn)return On;Mn=1;var t=function(){if(gn)return vn;gn=1;var t=Zo()(dt(),"DataView");return vn=t}(),e=ti(),r=function(){if(mn)return yn;mn=1;var t=Zo()(dt(),"Promise");return yn=t}(),n=function(){if(_n)return xn;_n=1;var t=Zo()(dt(),"Set");return xn=t}(),o=function(){if(jn)return wn;jn=1;var t=Zo()(dt(),"WeakMap");return wn=t}(),i=vt(),a=Qo(),u="[object Map]",s="[object Promise]",c="[object Set]",f="[object WeakMap]",l="[object DataView]",h=a(t),p=a(e),d=a(r),b=a(n),v=a(o),g=i;return(t&&g(new t(new ArrayBuffer(1)))!=l||e&&g(new e)!=u||r&&g(r.resolve())!=s||n&&g(new n)!=c||o&&g(new o)!=f)&&(g=function(t){var e=i(t),r="[object Object]"==e?t.constructor:void 0,n=r?a(r):"";if(n)switch(n){case h:return l;case p:return u;case d:return s;case b:return c;case v:return f}return e}),On=g}function pi(){if(Sn)return En;Sn=1;var t=oi(),e=ii(),r=function(){if(tn)return Zr;tn=1;var t=bt(),e=ai(),r=Ko(),n=ii(),o=Gr?Kr:(Gr=1,Kr=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}),i=Qr?Jr:(Qr=1,Jr=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}),a=t?t.prototype:void 0,u=a?a.valueOf:void 0;return Zr=function(t,a,s,c,f,l,h){switch(s){case"[object DataView]":if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=a.byteLength||!l(new e(t),new e(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+t,+a);case"[object Error]":return t.name==a.name&&t.message==a.message;case"[object RegExp]":case"[object String]":return t==a+"";case"[object Map]":var p=o;case"[object Set]":var d=1&c;if(p||(p=i),t.size!=a.size&&!d)return!1;var b=h.get(t);if(b)return b==a;c|=2,h.set(t,a);var v=n(p(t),p(a),c,f,l,h);return h.delete(t),v;case"[object Symbol]":if(u)return u.call(t)==u.call(a)}return!1}}(),n=function(){if(bn)return dn;bn=1;var t=li(),e=Object.prototype.hasOwnProperty;return dn=function(r,n,o,i,a,u){var s=1&o,c=t(r),f=c.length;if(f!=t(n).length&&!s)return!1;for(var l=f;l--;){var h=c[l];if(!(s?h in n:e.call(n,h)))return!1}var p=u.get(r),d=u.get(n);if(p&&d)return p==n&&d==r;var b=!0;u.set(r,n),u.set(n,r);for(var v=s;++l<f;){var g=r[h=c[l]],y=n[h];if(i)var m=s?i(y,g,h,n,r,u):i(g,y,h,r,n,u);if(!(void 0===m?g===y||a(g,y,o,i,u):m)){b=!1;break}v||(v="constructor"==h)}if(b&&!v){var x=r.constructor,_=n.constructor;x==_||!("constructor"in r)||!("constructor"in n)||"function"==typeof x&&x instanceof x&&"function"==typeof _&&_ instanceof _||(b=!1)}return u.delete(r),u.delete(n),b}}(),o=hi(),i=gt(),a=zt(),u=Uo(),s="[object Arguments]",c="[object Array]",f="[object Object]",l=Object.prototype.hasOwnProperty;return En=function(h,p,d,b,v,g){var y=i(h),m=i(p),x=y?c:o(h),_=m?c:o(p),w=(x=x==s?f:x)==f,j=(_=_==s?f:_)==f,O=x==_;if(O&&a(h)){if(!a(p))return!1;y=!0,w=!1}if(O&&!w)return g||(g=new t),y||u(h)?e(h,p,d,b,v,g):r(h,p,x,d,b,v,g);if(!(1&d)){var M=w&&l.call(h,"__wrapped__"),E=j&&l.call(p,"__wrapped__");if(M||E){var S=M?h.value():h,k=E?p.value():p;return g||(g=new t),v(S,k,d,b,g)}}return!!O&&(g||(g=new t),n(h,p,d,b,v,g))}}function di(){if(An)return kn;An=1;var t=pi(),e=yt();return kn=function r(n,o,i,a,u){return n===o||(null==n||null==o||!e(n)&&!e(o)?n!=n&&o!=o:t(n,o,i,a,r,u))}}function bi(){if(Pn)return zn;Pn=1;var t=Ho();return zn=function(e){return e==e&&!t(e)}}function vi(){return Fn?Un:(Fn=1,Un=function(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}})}function gi(){if(Wn)return Hn;Wn=1;var t=vt(),e=yt();return Hn=function(r){return"symbol"==typeof r||e(r)&&"[object Symbol]"==t(r)}}function yi(){if(Nn)return $n;Nn=1;var t=gt(),e=gi(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return $n=function(o,i){if(t(o))return!1;var a=typeof o;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=o&&!e(o))||n.test(o)||!r.test(o)||null!=i&&o in Object(i)}}function mi(){if(eo)return to;eo=1;var t=gt(),e=yi(),r=function(){if(Kn)return qn;Kn=1;var t=function(){if(Yn)return Xn;Yn=1;var t=function(){if(Vn)return In;Vn=1;var t=ni();function e(r,n){if("function"!=typeof r||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var o=function(){var t=arguments,e=n?n.apply(this,t):t[0],i=o.cache;if(i.has(e))return i.get(e);var a=r.apply(this,t);return o.cache=i.set(e,a)||i,a};return o.cache=new(e.Cache||t),o}return e.Cache=t,In=e}();return Xn=function(e){var r=t(e,function(t){return 500===n.size&&n.clear(),t}),n=r.cache;return r}}(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(e,function(t,e,o,i){n.push(o?i.replace(r,"$1"):e||t)}),n});return qn=n}(),n=function(){if(Zn)return Qn;Zn=1;var t=function(){if(Jn)return Gn;Jn=1;var t=bt(),e=qo(),r=gt(),n=gi(),o=t?t.prototype:void 0,i=o?o.toString:void 0;return Gn=function t(o){if("string"==typeof o)return o;if(r(o))return e(o,t)+"";if(n(o))return i?i.call(o):"";var a=o+"";return"0"==a&&1/o==-1/0?"-0":a},Gn}();return Qn=function(e){return null==e?"":t(e)}}();return to=function(o,i){return t(o)?o:e(o,i)?[o]:r(n(o))}}function xi(){if(no)return ro;no=1;var t=gi();return ro=function(e){if("string"==typeof e||t(e))return e;var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}}function _i(){if(io)return oo;io=1;var t=mi(),e=xi();return oo=function(r,n){for(var o=0,i=(n=t(n,r)).length;null!=r&&o<i;)r=r[e(n[o++])];return o&&o==i?r:void 0}}function wi(){if(vo)return bo;vo=1;var t=di(),e=function(){if(uo)return ao;uo=1;var t=_i();return ao=function(e,r,n){var o=null==e?void 0:t(e,r);return void 0===o?n:o}}(),r=function(){if(po)return ho;po=1;var t=co?so:(co=1,so=function(t,e){return null!=t&&e in Object(t)}),e=function(){if(lo)return fo;lo=1;var t=mi(),e=mt(),r=gt(),n=Pt(),o=Tt(),i=xi();return fo=function(a,u,s){for(var c=-1,f=(u=t(u,a)).length,l=!1;++c<f;){var h=i(u[c]);if(!(l=null!=a&&s(a,h)))break;a=a[h]}return l||++c!=f?l:!!(f=null==a?0:a.length)&&o(f)&&n(h,f)&&(r(a)||e(a))}}();return ho=function(r,n){return null!=r&&e(r,n,t)}}(),n=yi(),o=bi(),i=vi(),a=xi();return bo=function(u,s){return n(u)&&o(s)?i(a(u),s):function(n){var o=e(n,u);return void 0===o&&o===s?r(n,u):t(s,o,3)}}}function ji(){if(zo)return Ro;zo=1;var t=qo(),e=function(){if(Oo)return jo;Oo=1;var t=function(){if(Bn)return Dn;Bn=1;var t=function(){if(Rn)return Cn;Rn=1;var t=oi(),e=di();return Cn=function(r,n,o,i){var a=o.length,u=a,s=!i;if(null==r)return!u;for(r=Object(r);a--;){var c=o[a];if(s&&c[2]?c[1]!==r[c[0]]:!(c[0]in r))return!1}for(;++a<u;){var f=(c=o[a])[0],l=r[f],h=c[1];if(s&&c[2]){if(void 0===l&&!(f in r))return!1}else{var p=new t;if(i)var d=i(l,h,f,r,n,p);if(!(void 0===d?e(h,l,3,i,p):d))return!1}}return!0}}(),e=function(){if(Ln)return Tn;Ln=1;var t=bi(),e=No();return Tn=function(r){for(var n=e(r),o=n.length;o--;){var i=n[o],a=r[i];n[o]=[i,a,t(a)]}return n}}(),r=vi();return Dn=function(n){var o=e(n);return 1==o.length&&o[0][2]?r(o[0][0],o[0][1]):function(e){return e===n||t(e,n,o)}}}(),e=wi(),r=Vo(),n=gt(),o=function(){if(wo)return _o;wo=1;var t=yo?go:(yo=1,go=function(t){return function(e){return null==e?void 0:e[t]}}),e=function(){if(xo)return mo;xo=1;var t=_i();return mo=function(e){return function(r){return t(r,e)}}}(),r=yi(),n=xi();return _o=function(o){return r(o)?t(n(o)):e(o)}}();return jo=function(i){return"function"==typeof i?i:null==i?r:"object"==typeof i?n(i)?e(i[0],i[1]):t(i):o(i)}}(),r=function(){if(Co)return Ao;Co=1;var t=function(){if(ko)return So;ko=1;var t=Io(),e=function(){if(Eo)return Mo;Eo=1;var t=$o();return Mo=function(e,r){return function(n,o){if(null==n)return n;if(!t(n))return e(n,o);for(var i=n.length,a=r?i:-1,u=Object(n);(r?a--:++a<i)&&!1!==o(u[a],a,u););return n}}}()(t);return So=e}(),e=$o();return Ao=function(r,n){var o=-1,i=e(r)?Array(r.length):[];return t(r,function(t,e,r){i[++o]=n(t,e,r)}),i}}(),n=gt();return Ro=function(o,i){return(n(o)?t:r)(o,e(i,3))}}var Oi,Mi,Ei,Si,ki,Ai,Ci,Ri,zi,Pi,Ti,Li,Ui,Fi,Di,Bi,Hi,Wi,$i,Ni,Ii={};function Vi(){if(Ai)return ki;Ai=1;var t=function(){if(Si)return Ei;Si=1;var t=Zo(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();return Ei=e}();return ki=function(e,r,n){"__proto__"==r&&t?t(e,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[r]=n}}function Xi(){if(Ri)return Ci;Ri=1;var t=Vi(),e=Ko(),r=Object.prototype.hasOwnProperty;return Ci=function(n,o,i){var a=n[o];r.call(n,o)&&e(a,i)&&(void 0!==i||o in n)||t(n,o,i)}}function Yi(){if(Pi)return zi;Pi=1;var t=Xi(),e=Vi();return zi=function(r,n,o,i){var a=!o;o||(o={});for(var u=-1,s=n.length;++u<s;){var c=n[u],f=i?i(o[c],r[c],c,o,r):void 0;void 0===f&&(f=r[c]),a?e(o,c,f):t(o,c,f)}return o}}function qi(){if(Wi)return Hi;Wi=1;var t=Fo(),e=function(){if(Bi)return Di;Bi=1;var t=Ho(),e=Do(),r=Fi?Ui:(Fi=1,Ui=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}),n=Object.prototype.hasOwnProperty;return Di=function(o){if(!t(o))return r(o);var i=e(o),a=[];for(var u in o)("constructor"!=u||!i&&n.call(o,u))&&a.push(u);return a}}(),r=$o();return Hi=function(n){return r(n)?t(n,!0):e(n)}}var Ki,Gi,Ji,Qi,Zi,ta,ea,ra,na,oa,ia,aa,ua,sa,ca,fa,la,ha,pa,da,ba,va,ga,ya,ma,xa,_a,wa,ja,Oa,Ma,Ea,Sa,ka,Aa,Ca,Ra,za,Pa,Ta,La,Ua,Fa={exports:{}};function Da(){if(ea)return ta;ea=1;var t=ui(),e=Yo(),r=fi(),n=ci(),o=Object.getOwnPropertySymbols;return ta=o?function(n){for(var o=[];n;)t(o,r(n)),n=e(n);return o}:n}function Ba(){if(ca)return sa;ca=1;var t=ai();return sa=function(e){var r=new e.constructor(e.byteLength);return new t(r).set(new t(e)),r}}function Ha(){if(Pa)return za;Pa=1;var t=oi(),e=Mi?Oi:(Mi=1,Oi=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}),r=Xi(),n=function(){if(Li)return Ti;Li=1;var t=Yi(),e=No();return Ti=function(r,n){return r&&t(n,e(n),r)}}(),o=function(){if(Ni)return $i;Ni=1;var t=Yi(),e=qi();return $i=function(r,n){return r&&t(n,e(n),r)}}(),i=(Ki||(Ki=1,function(t,e){var r=dt(),n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,i=o&&o.exports===n?r.Buffer:void 0,a=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=a?a(r):new t.constructor(r);return t.copy(n),n}}(Fa,Fa.exports)),Fa.exports),a=Ji?Gi:(Ji=1,Gi=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}),u=function(){if(Zi)return Qi;Zi=1;var t=Yi(),e=fi();return Qi=function(r,n){return t(r,e(r),n)}}(),s=function(){if(na)return ra;na=1;var t=Yi(),e=Da();return ra=function(r,n){return t(r,e(r),n)}}(),c=li(),f=function(){if(ia)return oa;ia=1;var t=si(),e=Da(),r=qi();return oa=function(n){return t(n,r,e)}}(),l=hi(),h=function(){if(ua)return aa;ua=1;var t=Object.prototype.hasOwnProperty;return aa=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}}(),p=function(){if(ma)return ya;ma=1;var t=Ba(),e=function(){if(la)return fa;la=1;var t=Ba();return fa=function(e,r){var n=r?t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}}(),r=function(){if(pa)return ha;pa=1;var t=/\w*$/;return ha=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}}(),n=function(){if(ba)return da;ba=1;var t=bt(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;return da=function(t){return r?Object(r.call(t)):{}}}(),o=function(){if(ga)return va;ga=1;var t=Ba();return va=function(e,r){var n=r?t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}}();return ya=function(i,a,u){var s=i.constructor;switch(a){case"[object ArrayBuffer]":return t(i);case"[object Boolean]":case"[object Date]":return new s(+i);case"[object DataView]":return e(i,u);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(i,u);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(i);case"[object RegExp]":return r(i);case"[object Symbol]":return n(i)}}}(),d=function(){if(ja)return wa;ja=1;var t=function(){if(_a)return xa;_a=1;var t=Ho(),e=Object.create,r=function(){function r(){}return function(n){if(!t(n))return{};if(e)return e(n);r.prototype=n;var o=new r;return r.prototype=void 0,o}}();return xa=r}(),e=Yo(),r=Do();return wa=function(n){return"function"!=typeof n.constructor||r(n)?{}:t(e(n))}}(),b=gt(),v=zt(),g=function(){if(Sa)return Ea;Sa=1;var t=function(){if(Ma)return Oa;Ma=1;var t=hi(),e=yt();return Oa=function(r){return e(r)&&"[object Map]"==t(r)}}(),e=Lt(),r=Lo(),n=r&&r.isMap,o=n?e(n):t;return Ea=o}(),y=Ho(),m=function(){if(Ra)return Ca;Ra=1;var t=function(){if(Aa)return ka;Aa=1;var t=hi(),e=yt();return ka=function(r){return e(r)&&"[object Set]"==t(r)}}(),e=Lt(),r=Lo(),n=r&&r.isSet,o=n?e(n):t;return Ca=o}(),x=No(),_=qi(),w="[object Arguments]",j="[object Function]",O="[object Object]",M={};return M[w]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[O]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[j]=M["[object WeakMap]"]=!1,za=function E(S,k,A,C,R,z){var P,T=1&k,L=2&k,U=4&k;if(A&&(P=R?A(S,C,R,z):A(S)),void 0!==P)return P;if(!y(S))return S;var F=b(S);if(F){if(P=h(S),!T)return a(S,P)}else{var D=l(S),B=D==j||"[object GeneratorFunction]"==D;if(v(S))return i(S,T);if(D==O||D==w||B&&!R){if(P=L||B?{}:d(S),!T)return L?s(S,o(P,S)):u(S,n(P,S))}else{if(!M[D])return R?S:{};P=p(S,D,T)}}z||(z=new t);var H=z.get(S);if(H)return H;z.set(S,P),m(S)?S.forEach(function(t){P.add(E(t,k,A,t,S,z))}):g(S)&&S.forEach(function(t,e){P.set(e,E(t,k,A,e,S,z))});var W=F?void 0:(U?L?f:c:L?_:x)(S);return e(W||S,function(t,e){W&&(t=S[e=t]),r(P,e,E(t,k,A,e,S,z))}),P},za}var Wa,$a,Na={},Ia={};var Va,Xa={};var Ya,qa,Ka={},Ga=function(){if(qa)return lt;qa=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.ReactCSS=lt.loop=lt.handleActive=lt.handleHover=lt.hover=void 0;var e=s(function(){if(Po)return ht;Po=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.flattenNames=void 0;var t=function(){if(tt)return Z;tt=1;var t=vt(),e=gt(),r=yt();return Z=function(n){return"string"==typeof n||!e(n)&&r(n)&&"[object String]"==t(n)}}(),e=a(t),r=a(Xo()),n=function(){if(de)return pe;de=1;var t=vt(),e=Yo(),r=yt(),n=Function.prototype,o=Object.prototype,i=n.toString,a=o.hasOwnProperty,u=i.call(Object);return pe=function(n){if(!r(n)||"[object Object]"!=t(n))return!1;var o=e(n);if(null===o)return!0;var s=a.call(o,"constructor")&&o.constructor;return"function"==typeof s&&s instanceof s&&i.call(s)==u}}(),o=a(n),i=a(ji());function a(t){return t&&t.__esModule?t:{default:t}}var u=ht.flattenNames=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=[];return(0,i.default)(n,function(n){Array.isArray(n)?t(n).map(function(t){return a.push(t)}):(0,o.default)(n)?(0,r.default)(n,function(t,e){!0===t&&a.push(e),a.push(e+"-"+t)}):(0,e.default)(n)&&a.push(n)}),a};return ht.default=u,ht}()),r=s(function(){if(Ua)return Ii;Ua=1,Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.mergeClasses=void 0;var t=n(Xo()),e=n(function(){if(La)return Ta;La=1;var t=Ha();return Ta=function(e){return t(e,5)}}()),r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function n(t){return t&&t.__esModule?t:{default:t}}var o=Ii.mergeClasses=function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=n.default&&(0,e.default)(n.default)||{};return o.map(function(e){var o=n[e];return o&&(0,t.default)(o,function(t,e){i[e]||(i[e]={}),i[e]=r({},i[e],o[e])}),e}),i};return Ii.default=o,Ii}()),n=function(){if(Wa)return Na;Wa=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.autoprefix=void 0;var t,e=(t=Xo())&&t.__esModule?t:{default:t},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},n={borderRadius:function(t){return{msBorderRadius:t,MozBorderRadius:t,OBorderRadius:t,WebkitBorderRadius:t,borderRadius:t}},boxShadow:function(t){return{msBoxShadow:t,MozBoxShadow:t,OBoxShadow:t,WebkitBoxShadow:t,boxShadow:t}},userSelect:function(t){return{WebkitTouchCallout:t,KhtmlUserSelect:t,MozUserSelect:t,msUserSelect:t,WebkitUserSelect:t,userSelect:t}},flex:function(t){return{WebkitBoxFlex:t,MozBoxFlex:t,WebkitFlex:t,msFlex:t,flex:t}},flexBasis:function(t){return{WebkitFlexBasis:t,flexBasis:t}},justifyContent:function(t){return{WebkitJustifyContent:t,justifyContent:t}},transition:function(t){return{msTransition:t,MozTransition:t,OTransition:t,WebkitTransition:t,transition:t}},transform:function(t){return{msTransform:t,MozTransform:t,OTransform:t,WebkitTransform:t,transform:t}},absolute:function(t){var e=t&&t.split(" ");return{position:"absolute",top:e&&e[0],right:e&&e[1],bottom:e&&e[2],left:e&&e[3]}},extend:function(t,e){return e[t]||{extend:t}}},o=Na.autoprefix=function(t){var o={};return(0,e.default)(t,function(t,i){var a={};(0,e.default)(t,function(t,e){var o=n[e];o?a=r({},a,o(t)):a[e]=t}),o[i]=a}),o};return Na.default=o,Na}(),o=s(n),i=s(function(){if($a)return Ia;$a=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.hover=void 0;var e,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},n=(e=t.z)&&e.__esModule?e:{default:e};function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var i=Ia.hover=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(i){function a(){var i,u,s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var c=arguments.length,f=Array(c),l=0;l<c;l++)f[l]=arguments[l];return u=s=o(this,(i=a.__proto__||Object.getPrototypeOf(a)).call.apply(i,[this].concat(f))),s.state={hover:!1},s.handleMouseOver=function(){return s.setState({hover:!0})},s.handleMouseOut=function(){return s.setState({hover:!1})},s.render=function(){return n.default.createElement(e,{onMouseOver:s.handleMouseOver,onMouseOut:s.handleMouseOut},n.default.createElement(t,r({},s.props,s.state)))},o(s,u)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,i),a}(n.default.Component)};return Ia.default=i,Ia}()),a=s(function(){if(Va)return Xa;Va=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.active=void 0;var e,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},n=(e=t.z)&&e.__esModule?e:{default:e};function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var i=Xa.active=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(i){function a(){var i,u,s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var c=arguments.length,f=Array(c),l=0;l<c;l++)f[l]=arguments[l];return u=s=o(this,(i=a.__proto__||Object.getPrototypeOf(a)).call.apply(i,[this].concat(f))),s.state={active:!1},s.handleMouseDown=function(){return s.setState({active:!0})},s.handleMouseUp=function(){return s.setState({active:!1})},s.render=function(){return n.default.createElement(e,{onMouseDown:s.handleMouseDown,onMouseUp:s.handleMouseUp},n.default.createElement(t,r({},s.props,s.state)))},o(s,u)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,i),a}(n.default.Component)};return Xa.default=i,Xa}()),u=s((Ya||(Ya=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=function(t,e){var r={},n=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r[t]=e};return 0===t&&n("first-child"),t===e-1&&n("last-child"),(0===t||t%2==0)&&n("even"),1===Math.abs(t%2)&&n("odd"),n("nth-child",t),r}),Ka));function s(t){return t&&t.__esModule?t:{default:t}}lt.hover=i.default,lt.handleHover=i.default,lt.handleActive=a.default,lt.loop=u.default;var c=lt.ReactCSS=function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];var u=(0,e.default)(i),s=(0,r.default)(t,u);return(0,o.default)(s)};return lt.default=c,lt}();const Ja=t.Mb(Ga);var Qa={},Za=function(t,e,r,n){var o=t+"-"+e+"-"+r+(n?"-server":"");if(Qa[o])return Qa[o];var i=function(t,e,r,n){if("undefined"==typeof document&&!n)return null;var o=n?new n:document.createElement("canvas");o.width=2*r,o.height=2*r;var i=o.getContext("2d");return i?(i.fillStyle=t,i.fillRect(0,0,o.width,o.height),i.fillStyle=e,i.fillRect(0,0,r,r),i.translate(r,r),i.fillRect(0,0,r,r),o.toDataURL()):null}(t,e,r,n);return Qa[o]=i,i},tu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},eu=function(e){var r=e.white,n=e.grey,o=e.size,i=e.renderers,a=e.borderRadius,u=e.boxShadow,s=e.children,c=Ja({default:{grid:{borderRadius:a,boxShadow:u,absolute:"0px 0px 0px 0px",background:"url("+Za(r,n,o,i.canvas)+") center left"}}});return t.reactExports.isValidElement(s)?t.z.cloneElement(s,tu({},s.props,{style:tu({},s.props.style,c.grid)})):t.z.createElement("div",{style:c.grid})};eu.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var ru=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},nu=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function ou(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var iu=function(){function e(){var t,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=n=ou(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i))),n.handleChange=function(t){var e=function(t,e,r,n,o){var i=o.clientWidth,a=o.clientHeight,u="number"==typeof t.pageX?t.pageX:t.touches[0].pageX,s="number"==typeof t.pageY?t.pageY:t.touches[0].pageY,c=u-(o.getBoundingClientRect().left+window.pageXOffset),f=s-(o.getBoundingClientRect().top+window.pageYOffset);if("vertical"===r){var l;if(l=f<0?0:f>a?1:Math.round(100*f/a)/100,e.a!==l)return{h:e.h,s:e.s,l:e.l,a:l,source:"rgb"}}else{var h;if(n!==(h=c<0?0:c>i?1:Math.round(100*c/i)/100))return{h:e.h,s:e.s,l:e.l,a:h,source:"rgb"}}return null}(t,n.props.hsl,n.props.direction,n.props.a,n.container);e&&"function"==typeof n.props.onChange&&n.props.onChange(e,t)},n.handleMouseDown=function(t){n.handleChange(t),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},ou(n,r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t.reactExports.PureComponent||t.reactExports.Component),nu(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,r=this.props.rgb,n=Ja({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+r.r+","+r.g+","+r.b+", 0) 0%,\n rgba("+r.r+","+r.g+","+r.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*r.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+r.r+","+r.g+","+r.b+", 0) 0%,\n rgba("+r.r+","+r.g+","+r.b+", 1) 100%)"},pointer:{left:0,top:100*r.a+"%"}},overwrite:ru({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return t.z.createElement("div",{style:n.alpha},t.z.createElement("div",{style:n.checkboard},t.z.createElement(eu,{renderers:this.props.renderers})),t.z.createElement("div",{style:n.gradient}),t.z.createElement("div",{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},t.z.createElement("div",{style:n.pointer},this.props.pointer?t.z.createElement(this.props.pointer,this.props):t.z.createElement("div",{style:n.slider}))))}}]),e}(),au=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),uu=[38,40],su=1,cu=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(t){r.setUpdatedValue(t.target.value,t)},r.handleKeyDown=function(t){var e,n=function(t){return Number(String(t).replace(/%/g,""))}(t.target.value);if(!isNaN(n)&&(e=t.keyCode,uu.indexOf(e)>-1)){var o=r.getArrowOffset(),i=38===t.keyCode?n+o:n-o;r.setUpdatedValue(i,t)}},r.handleDrag=function(t){if(r.props.dragLabel){var e=Math.round(r.props.value+t.movementX);e>=0&&e<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(e),t)}},r.handleMouseDown=function(t){r.props.dragLabel&&(t.preventDefault(),r.handleDrag(t),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},r.inputId="rc-editable-input-"+su++,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t.reactExports.PureComponent||t.reactExports.Component),au(e,[{key:"componentDidUpdate",value:function(t,e){this.props.value===this.state.value||t.value===this.props.value&&e.value===this.state.value||(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(t){return function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},this.props.label,t)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(t,e){var r=this.props.label?this.getValueObjectWithLabel(t):t;this.props.onChange&&this.props.onChange(r,e),this.setState({value:t})}},{key:"render",value:function(){var e=this,r=Ja({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return t.z.createElement("div",{style:r.wrap},t.z.createElement("input",{id:this.inputId,style:r.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?t.z.createElement("label",{htmlFor:this.inputId,style:r.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(),fu=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function lu(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var hu=function(){function e(){var t,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=n=lu(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i))),n.handleChange=function(t){var e=function(t,e,r,n){var o=n.clientWidth,i=n.clientHeight,a="number"==typeof t.pageX?t.pageX:t.touches[0].pageX,u="number"==typeof t.pageY?t.pageY:t.touches[0].pageY,s=a-(n.getBoundingClientRect().left+window.pageXOffset),c=u-(n.getBoundingClientRect().top+window.pageYOffset);if("vertical"===e){var f;if(f=c<0?359:c>i?0:360*(-100*c/i+100)/100,r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var l;if(l=s<0?0:s>o?359:100*s/o*360/100,r.h!==l)return{h:l,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null}(t,n.props.direction,n.props.hsl,n.container);e&&"function"==typeof n.props.onChange&&n.props.onChange(e,t)},n.handleMouseDown=function(t){n.handleChange(t),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},lu(n,r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t.reactExports.PureComponent||t.reactExports.Component),fu(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,r=this.props.direction,n=void 0===r?"horizontal":r,o=Ja({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-100*this.props.hsl.h/360+100+"%"}}},{vertical:"vertical"===n});return t.z.createElement("div",{style:o.hue},t.z.createElement("div",{className:"hue-"+n,style:o.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},t.z.createElement("style",null,"\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n "),t.z.createElement("div",{style:o.pointer},this.props.pointer?t.z.createElement(this.props.pointer,this.props):t.z.createElement("div",{style:o.slider}))))}}]),e}(),pu="object"==typeof global&&global&&global.Object===Object&&global,du="object"==typeof self&&self&&self.Object===Object&&self,bu=pu||du||Function("return this")(),vu=bu.Symbol,gu=Object.prototype,yu=gu.hasOwnProperty,mu=gu.toString,xu=vu?vu.toStringTag:void 0,_u=Object.prototype.toString,wu=vu?vu.toStringTag:void 0;function ju(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}e.string,e.oneOf([0,1,2,3,4,5]),e.number,e.object;var Ou=function(){return bu.Date.now()},Mu=/\s/,Eu=/^\s+/;var Su=/^[-+]0x[0-9a-f]+$/i,ku=/^0b[01]+$/i,Au=/^0o[0-7]+$/i,Cu=parseInt;function Ru(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":wu&&wu in Object(t)?function(t){var e=yu.call(t,xu),r=t[xu];try{t[xu]=void 0;var n=!0}catch(t){}var o=mu.call(t);return n&&(e?t[xu]=r:delete t[xu]),o}(t):function(t){return _u.call(t)}(t)}(t)}(t))return NaN;if(ju(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ju(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=function(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Mu.test(t.charAt(e)););return e}(t)+1).replace(Eu,""):t}(t);var r=ku.test(t);return r||Au.test(t)?Cu(t.slice(2),r?2:8):Su.test(t)?NaN:+t}var zu=Math.max,Pu=Math.min;var Tu=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();!function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.handleChange=function(t){"function"==typeof r.props.onChange&&r.throttle(r.props.onChange,function(t,e,r){var n=r.getBoundingClientRect(),o=n.width,i=n.height,a="number"==typeof t.pageX?t.pageX:t.touches[0].pageX,u="number"==typeof t.pageY?t.pageY:t.touches[0].pageY,s=a-(r.getBoundingClientRect().left+window.pageXOffset),c=u-(r.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>o&&(s=o),c<0?c=0:c>i&&(c=i);var f=s/o,l=1-c/i;return{h:e.h,s:f,v:l,a:e.a,source:"hsv"}}(t,r.props.hsl,r.container),t)},r.handleMouseDown=function(t){r.handleChange(t);var e=r.getContainerRenderWindow();e.addEventListener("mousemove",r.handleChange),e.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.throttle=function(t,e,r){var n=!0,o=!0;return ju(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),function(t,e,r){var n,o,i,a,u,s,c=0,f=!1,l=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var r=n,i=o;return n=o=void 0,c=e,a=t.apply(i,r)}function d(t){var r=t-s;return void 0===s||r>=e||r<0||l&&t-c>=i}function b(){var t=Ou();if(d(t))return v(t);u=setTimeout(b,function(t){var r=e-(t-s);return l?Pu(r,i-(t-c)):r}(t))}function v(t){return u=void 0,h&&n?p(t):(n=o=void 0,a)}function g(){var t=Ou(),r=d(t);if(n=arguments,o=this,s=t,r){if(void 0===u)return function(t){return c=t,u=setTimeout(b,e),f?p(t):a}(s);if(l)return clearTimeout(u),u=setTimeout(b,e),p(s)}return void 0===u&&(u=setTimeout(b,e)),a}return e=Ru(e)||0,ju(r)&&(f=!!r.leading,i=(l="maxWait"in r)?zu(Ru(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h),g.cancel=function(){void 0!==u&&clearTimeout(u),c=0,n=s=o=u=void 0},g.flush=function(){return void 0===u?a:v(Ou())},g}(t,50,{leading:n,maxWait:50,trailing:o})}(function(t,e,r){t(e,r)}),r}(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)})(e,t.reactExports.PureComponent||t.reactExports.Component),Tu(e,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var t=this.container,e=window;!e.document.contains(t)&&e.parent!==e;)e=e.parent;return e}},{key:"unbindEventListeners",value:function(){var t=this.getContainerRenderWindow();t.removeEventListener("mousemove",this.handleChange),t.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,r=this.props.style||{},n=r.color,o=r.white,i=r.black,a=r.pointer,u=r.circle,s=Ja({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-100*this.props.hsv.v+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:o,black:i,pointer:a,circle:u}},{custom:!!this.props.style});return t.z.createElement("div",{style:s.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},t.z.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),t.z.createElement("div",{style:s.white,className:"saturation-white"},t.z.createElement("div",{style:s.black,className:"saturation-black"}),t.z.createElement("div",{style:s.pointer},this.props.pointer?t.z.createElement(this.props.pointer,this.props):t.z.createElement("div",{style:s.circle}))))}}])}();var Lu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Uu=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function Fu(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Du=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};!function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";!function(){function n(){var t,e,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return e=r=Fu(this,(t=n.__proto__||Object.getPrototypeOf(n)).call.apply(t,[this].concat(i))),r.state={focus:!1},r.handleFocus=function(){return r.setState({focus:!0})},r.handleBlur=function(){return r.setState({focus:!1})},Fu(r,e)}(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)})(n,t.z.Component),Uu(n,[{key:"render",value:function(){return t.z.createElement(r,{onFocus:this.handleFocus,onBlur:this.handleBlur},t.z.createElement(e,Lu({},this.props,this.state)))}}])}()}(function(e){var r=e.color,n=e.style,o=e.onClick,i=void 0===o?function(){}:o,a=e.onHover,u=e.title,s=void 0===u?r:u,c=e.children,f=e.focus,l=e.focusStyle,h="transparent"===r,p=Ja({default:{swatch:Du({background:r,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},n,f?void 0===l?{}:l:{})}}),d={};return a&&(d.onMouseOver=function(t){return a(r,t)}),t.z.createElement("div",Du({style:p.swatch,onClick:function(t){return i(r,t)},title:s,tabIndex:0,onKeyDown:function(t){return 13===t.keyCode&&i(r,t)}},d),c,h&&t.z.createElement(eu,{borderRadius:p.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))});var Bu=function(e){var r=e.onChange,n=e.rgb,o=e.hsl,a=e.hex,u=e.disableAlpha,s=Ja({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:u}),c=function(t,e){t.hex?function(t){if("transparent"===t)return!0;var e="#"===String(t).charAt(0)?1:0;return t.length!==4+e&&t.length<7+e&&i(t).isValid()}(t.hex)&&r({hex:t.hex,source:"hex"},e):t.r||t.g||t.b?r({r:t.r||n.r,g:t.g||n.g,b:t.b||n.b,a:n.a,source:"rgb"},e):t.a&&(t.a<0?t.a=0:t.a>100&&(t.a=100),t.a/=100,r({h:o.h,s:o.s,l:o.l,a:t.a,source:"rgb"},e))};return t.z.createElement("div",{style:s.fields,className:"flexbox-fix"},t.z.createElement("div",{style:s.double},t.z.createElement(cu,{style:{input:s.input,label:s.label},label:"hex",value:a.replace("#",""),onChange:c})),t.z.createElement("div",{style:s.single},t.z.createElement(cu,{style:{input:s.input,label:s.label},label:"r",value:n.r,onChange:c,dragLabel:"true",dragMax:"255"})),t.z.createElement("div",{style:s.single},t.z.createElement(cu,{style:{input:s.input,label:s.label},label:"g",value:n.g,onChange:c,dragLabel:"true",dragMax:"255"})),t.z.createElement("div",{style:s.single},t.z.createElement(cu,{style:{input:s.input,label:s.label},label:"b",value:n.b,onChange:c,dragLabel:"true",dragMax:"255"})),t.z.createElement("div",{style:s.alpha},t.z.createElement(cu,{style:{input:s.input,label:s.label},label:"a",value:Math.round(100*n.a),onChange:c,dragLabel:"true",dragMax:"100"})))};class Hu extends(t.reactExports.PureComponent||t.reactExports.Component){constructor(t){super(t),this.handleChange=t=>{"function"==typeof this.props.onChange&&this.throttle(this.props.onChange,((t,e,r)=>{var n=r.getBoundingClientRect(),o=n.width,i=n.height,a="number"==typeof t.pageX?t.pageX:t.touches[0].pageX,u="number"==typeof t.pageY?t.pageY:t.touches[0].pageY,s=a-(r.getBoundingClientRect().left+window.pageXOffset),c=u-(r.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>o&&(s=o),c<0?c=0:c>i&&(c=i);var f=s/o,l=1-c/i;return{h:e.h,s:f,v:l,a:e.a,source:"hsv"}})(t,this.props.hsl,this.container),t),t.preventDefault()},this.handleMouseDown=t=>{this.handleChange(t);const e=this.getContainerRenderWindow();e.addEventListener("mousemove",this.handleChange),e.addEventListener("mouseup",this.handleMouseUp)},this.handleMouseUp=t=>{t.preventDefault(),this.unbindEventListeners()},this.throttle=function(t,e,r){let n,o,i,a;var u=0;r||(r={});let s=function(){u=!1===r.leading?0:Date.now(),n=null,a=t.apply(o,i),n||(o=i=null)},c=function(){var e=Date.now();u||!1!==r.leading||(u=e);var c=50-(e-u);return o=this,i=arguments,c<=0||c>50?(n&&(clearTimeout(n),n=null),u=e,a=t.apply(o,i),n||(o=i=null)):n||!1===r.trailing||(n=setTimeout(s,c)),a};return c.cancel=function(){clearTimeout(n),u=0,n=o=i=null},c}((t,e,r)=>{t(e,r)})}componentWillUnmount(){this.throttle.cancel(),this.unbindEventListeners()}getContainerRenderWindow(){const{container:t}=this;let e=window;for(;!e.document.contains(t)&&e.parent!==e;)e=e.parent;return e}unbindEventListeners(){const t=this.getContainerRenderWindow();t.removeEventListener("mousemove",this.handleChange),t.removeEventListener("mouseup",this.handleMouseUp)}render(){const{color:e,white:r,black:n,pointer:o,circle:i}=this.props||{},a={position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px"},u={color:{...a,backgroundColor:`hsl(${this.props.hsl?.h},100%, 50%)`,borderRadius:this.props.style?.borderRadius},white:{...a,borderRadius:this.props.style?.borderRadius},black:{...a,boxShadow:this.props.style?.boxShadow,borderRadius:this.props.style?.borderRadius},pointer:{...a,top:-100*this.props.hsv?.v+100+"%",left:100*this.props.hsv?.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}};return t.jsxRuntimeExports.jsxs("div",{style:u.color,ref:t=>this.container=t,onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange,children:[t.jsxRuntimeExports.jsx("style",{children:"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "}),t.jsxRuntimeExports.jsxs("div",{style:u.white,className:"saturation-white",children:[t.jsxRuntimeExports.jsx("div",{style:u.black,className:"saturation-black"}),t.jsxRuntimeExports.jsx("div",{style:u.pointer,children:this.props.pointer?t.jsxRuntimeExports.jsx(this.props.pointer,{...this.props}):t.jsxRuntimeExports.jsx("div",{style:u.circle})})]})]})}}const Wu=(t,e=null)=>{const r=t.hex?i(t.hex):i(t||"transparent"),n=r.toHsl(),o=r.toHsv(),a=r.toRgb(),u=r.toHex();return 0===n.s&&(n.h=e??0,o.h=e??0),{hsl:n,hex:"#"+u,rgb:a,hsv:o,source:t.source}},$u=t.reactExports.memo(e=>{const{selectedColor:r,onColorChange:n,renderers:o,disableAlpha:i=!1,style:a=t.Jo.EmptyCssProperties,...u}=e,s=t.Tx(),[c,f]=t.reactExports.useState(()=>Wu(r)),[l,h]=t.reactExports.useState(c.hsl.h??0),p=t.reactExports.useCallback(t=>{let e=Wu(t,l);return h(e.hsl.h??0),f(e),e},[l]),d=t.reactExports.useCallback(t=>{const e=p(t),r=`rgba(${e.rgb.r},${e.rgb.g},${e.rgb.b},${i?1:e.rgb.a})`;n?.(r)},[n,p,i]);t.reactExports.useLayoutEffect(()=>{p(r)},[r,p]);const b=t.jsxRuntimeExports.jsx("div",{style:{position:"relative",minHeight:"10px",maxHeight:"10px",width:"100%"},children:t.jsxRuntimeExports.jsx(iu,{style:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},rgb:c.rgb,hsl:c.hsl,renderers:o,onChange:d})});return t.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",...a},...u,children:[t.jsxRuntimeExports.jsx("div",{style:{width:"100%",flex:"1 1 100%",position:"relative",overflow:"hidden"},children:t.jsxRuntimeExports.jsx(Hu,{style:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hsl:c.hsl,hsv:c.hsv,onChange:d})}),t.jsxRuntimeExports.jsxs("div",{style:{marginTop:"4px",display:"flex",gap:"4px"},children:[t.jsxRuntimeExports.jsxs("div",{style:{flex:"1",display:"flex",flexDirection:i?"row":"column",justifyContent:"space-between",alignItems:"center"},children:[t.jsxRuntimeExports.jsx("div",{style:{position:"relative",minHeight:"10px",maxHeight:"10px",width:"100%"},children:t.jsxRuntimeExports.jsx(hu,{style:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hsl:c.hsl,onChange:d})}),i?null:b]}),t.jsxRuntimeExports.jsxs("div",{style:{minWidth:"24px",maxWidth:"24px",minHeight:"24px",maxHeight:"24px",position:"relative",borderRadius:"1px",overflow:"hidden"},children:[t.jsxRuntimeExports.jsx(t.cO,{grey:s.palette.text.icon??s.palette.action.active}),t.jsxRuntimeExports.jsx("div",{style:{position:"absolute",height:"100%",width:"100%",background:`rgba(${c.rgb.r},${c.rgb.g},${c.rgb.b},${i?1:c.rgb.a})`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}})]})]}),t.jsxRuntimeExports.jsx(t.Box,{sx:{marginBottom:"4px","& label":{fontFamily:t=>`${t.typography.fontFamily} !important`,color:t=>`${t.palette.text.secondary} !important`},"& *":{fontFamily:t=>`${t.typography.fontFamily} !important`,userSelect:"none"},"& input":{paddingLeft:t=>`${t.spacing(.5)} !important`,paddingRight:t=>`${t.spacing(.5)} !important`,outline:"none",boxSizing:"border-box",width:"100% !important",textAlign:"center"}},children:t.jsxRuntimeExports.jsx(Bu,{rgb:c.rgb,hsl:c.hsl,hex:c.hex,disableAlpha:i,onChange:d})})]})});exports.CustomColorPanel=$u,exports.default=$u,exports.toState=Wu;
|
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
6
|
+
*/
|
|
7
|
+
"use strict";const e=require("./B2e7dDI-zKoqXpIW.cjs");module.exports=e.SheetXL;
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
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};
|
|
@@ -0,0 +1,7 @@
|
|
|
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};
|