@sheetxl/studio-mui 0.4.13 → 0.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/BNHQPLsVdLmkPgyG.cjs +6 -0
- package/browser/cjs/BUU_z9x81l1Qnv1t.cjs +6 -0
- package/browser/cjs/BX8hkPMsPd9PSv0Z.cjs +161 -0
- package/browser/cjs/BknKSPzyXctJohHb.cjs +6 -0
- package/browser/cjs/Blfxp7Ec3Yjx3gNU.cjs +6 -0
- package/browser/cjs/BqFEcpPZjpwULlZk.cjs +6 -0
- package/browser/cjs/C-pPuqiWtgMU4NgZ.cjs +15 -0
- package/browser/cjs/C9eqE9OnPkiI-5Zd.cjs +7 -0
- package/browser/cjs/CB6DGRkCA3BLDEFr.cjs +6 -0
- package/browser/cjs/CO4rZgb0ObTZh6NO.cjs +6 -0
- package/browser/cjs/CU900NraHPDHMGJt.cjs +18 -0
- package/browser/cjs/Cpo-h2pMpScosT7r.cjs +6 -0
- package/browser/cjs/Cq2L49XjSKiIAsND.cjs +11 -0
- package/browser/cjs/D9X3UXVH6b_NJFeo.cjs +12 -0
- package/browser/cjs/DZJO-_8PnMFRZMpg.cjs +6 -0
- package/browser/cjs/DmCCEKhedSOg163M.cjs +6 -0
- package/browser/cjs/DpZ5HlIMG95q2uIe.cjs +96 -0
- package/browser/cjs/DwLcsRl4-LumKl6l.cjs +42 -0
- package/browser/cjs/Dy2vYVhrEqTHdzfD.cjs +11 -0
- package/browser/cjs/Gj8MlEhOCg_o7idM.cjs +6 -0
- package/browser/cjs/IllnWqWVClWDW1ot.cjs +6 -0
- package/browser/cjs/J3xq71qTV9LqCUzu.cjs +145 -0
- package/browser/cjs/X9sJMKafafBPpNpK.cjs +16 -0
- package/browser/cjs/index.cjs +4 -10
- package/browser/cjs/klnhoS0cqBpCC5fo.cjs +7 -0
- package/browser/esm/BQNKKCtIvfOMph3T.mjs +2250 -0
- package/browser/esm/BiQfhG8JMHeWuT63.mjs +1672 -0
- package/browser/esm/Btyp6us1Vzz3ZfHk.mjs +13391 -0
- package/browser/esm/Bvr3QlWdnOSnskWL.mjs +392 -0
- package/browser/esm/CYpvNksOw1PyhLpA.mjs +52 -0
- package/browser/esm/CcZUaOkODU7h0onP.mjs +25 -0
- package/browser/esm/CnXUhdLB8blNUvSr.mjs +84 -0
- package/browser/esm/CwjVlrJJqEGZX6q2.mjs +52 -0
- package/browser/esm/D0v3VaJtA3LjHpWR.mjs +20816 -0
- package/browser/esm/D4DvAg7aaaWl0TPV.mjs +1467 -0
- package/browser/esm/DAZNeiMI9sOM-xd8.mjs +1366 -0
- package/browser/esm/DGUm6rEOgO8WrVtT.mjs +23 -0
- package/browser/esm/DGoy2q9hDB7kive6.mjs +44 -0
- package/browser/esm/DSCE3cCea5d5Ip-N.mjs +1703 -0
- package/browser/esm/DrTLuc1VQWQfDAej.mjs +59 -0
- package/browser/esm/DuzycndVID_eag8V.mjs +1352 -0
- package/browser/esm/FZoe4QJ2ecSD1pjB.mjs +43 -0
- package/browser/esm/HI5oLhcn8kfiky1k.mjs +3803 -0
- package/browser/esm/T2YlNqs-LGJBm08C.mjs +46 -0
- package/browser/esm/UCJVaz3qX1u53mgI.mjs +640 -0
- package/browser/esm/UWejV3W_nMwWqnxY.mjs +48 -0
- package/browser/esm/VpP_qw0lmgCaHdHR.mjs +153 -0
- package/browser/esm/YS19x3zzRUKQqXu_.mjs +2410 -0
- package/browser/esm/index.mjs +84 -8
- package/browser/esm/jqoS02EUPE2WEY1t.mjs +424 -0
- package/licenses/dependencies.txt +6 -6
- package/node/esm/{BO6cKQ_efCO2YTyW.mjs → 3htalFC0z5xbRnmH.mjs} +1 -1
- package/node/esm/{DKho7vhsoPr3NuMl.mjs → B-pzKiKMkbB9Es-9.mjs} +1 -1
- package/node/esm/{BZ8BYhQCAcmtqV_l.mjs → BFxzGj5sPFwrklFi.mjs} +3 -3
- package/node/esm/{DvKUmpzXvELOJbAq.mjs → BGYSS0lvjSMTtreq.mjs} +1 -1
- package/node/esm/{BxJ8RdpZW49RjtqB.mjs → BGZpuIQG7RsGY_HH.mjs} +1 -1
- package/node/esm/{BEWR_Oinb-P8gswu.mjs → BTnlaEz7yZqa7QHP.mjs} +1 -1
- package/node/esm/{DW7i1Qv4kcmwOTvD.mjs → BfUEFSGuAZXw2fvO.mjs} +1 -1
- package/node/esm/{BqcpB9wQAjq0QKR1.mjs → BiJ5CZBAxg4-QDHh.mjs} +1 -1
- package/node/esm/{nmVSg6Qpwj9V1oA0.mjs → Bnkt1wiWaLEq8xla.mjs} +1 -1
- package/node/esm/{-mcJjjdCwl8lh-eg.mjs → BwbOSLs2gcxOaV0i.mjs} +1 -1
- package/node/esm/{RpUFmc_WL9-PMYhx.mjs → CAWLE2N0nA-FjUkH.mjs} +1 -1
- package/node/esm/{uAAAbPd_k3kmgO5f.mjs → CSnI8PJEgxEQEj1B.mjs} +1 -1
- package/node/esm/{VnhwCsWDUmo5-K5N.mjs → CvYpf-Km1Rvg15q4.mjs} +1 -1
- package/node/esm/{BqsJ9biuGwjU2xgY.mjs → CxhzSvAqksnasp3g.mjs} +1 -1
- package/node/esm/{CdLN7JEivNllaQ6w.mjs → DCrdGvQ_vOB2o-ca.mjs} +1 -1
- package/node/esm/{CfO2Xok0ch8kylzr.mjs → DhGXQOOW9FBpgCqI.mjs} +1 -1
- package/node/esm/{CsPaYpANdd8Rpel-.mjs → DkhnVkboeZsdMJxH.mjs} +1 -1
- package/node/esm/{4WfRn0Og_yApP_Q8.mjs → DnMRqYWKDGXlNm42.mjs} +1 -1
- package/node/esm/{CQ1mTChRFSKFU2O1.mjs → DsS5U5rJ5tNVEGXs.mjs} +1 -1
- package/node/esm/{CcOchU9ZOmdG4JFr.mjs → DuyHq4Fs-_RQkwF_.mjs} +1 -1
- package/node/esm/{o-JVx3HFrRjVjKmi.mjs → FzVegyt0upYkLobF.mjs} +2 -2
- package/node/esm/{BPG7zfcXK20urqr_.mjs → imk332niB0MxWuGl.mjs} +5 -5
- package/node/esm/index.mjs +11 -11
- package/package.json +8 -8
- package/browser/cjs/34mwIxXhbXYv5xsc.cjs +0 -7
- package/browser/cjs/3OIgTi54FC0IBzyK.cjs +0 -7
- package/browser/cjs/B-Aq2h8aSDrc_0iZ.cjs +0 -7
- package/browser/cjs/BDhT8qcsUqUILki7.cjs +0 -7
- package/browser/cjs/BKJsMQHem8u-jMiR.cjs +0 -7
- package/browser/cjs/BO7LEbRChpLg-xKv.cjs +0 -7
- package/browser/cjs/BZR-qDCIYdiDtD-U.cjs +0 -7
- package/browser/cjs/BfE1_C2EpBrmB7bt.cjs +0 -7
- package/browser/cjs/Brij8vl9GntSQBer.cjs +0 -7
- package/browser/cjs/C61z_849Y2mg6eYL.cjs +0 -7
- package/browser/cjs/CaKjImRkCm3-QSAI.cjs +0 -7
- package/browser/cjs/Cw7iXqLfwZMRGb3J.cjs +0 -7
- package/browser/cjs/CwwItA5xvSx0QgDn.cjs +0 -7
- package/browser/cjs/DPTcPoZ3PiOOW7lp.cjs +0 -7
- package/browser/cjs/DhmN913n5MBAZsij.cjs +0 -7
- package/browser/cjs/DhoDW4ohnPkwiE_o.cjs +0 -7
- package/browser/cjs/Dj_PjsvImW3tjX0i.cjs +0 -7
- package/browser/cjs/Dl4WPIJFTvpCXOs3.cjs +0 -7
- package/browser/cjs/QCtfu4qn-ovJa_wL.cjs +0 -7
- package/browser/cjs/VQ4Cuzvkmtel1iE_.cjs +0 -7
- package/browser/cjs/VTMW1yjPzEJGyBmh.cjs +0 -7
- package/browser/cjs/hY59MepmKCIoN0hM.cjs +0 -7
- package/browser/cjs/pKp_fof7vGupYAM2.cjs +0 -7
- package/browser/cjs/t-9gaLqrOnGiw-3T.cjs +0 -7
- package/browser/esm/5U4XS5qxb3oJ33qK.mjs +0 -7
- package/browser/esm/BPMMuKIe5xb3-D8V.mjs +0 -7
- package/browser/esm/BXartMrqQuAXu0Qz.mjs +0 -7
- package/browser/esm/Bc8N72T3wtTApPEG.mjs +0 -7
- package/browser/esm/BjoQXBQuDry5Fgc_.mjs +0 -7
- package/browser/esm/BlUq84tk9v01SQgx.mjs +0 -7
- package/browser/esm/C5iuJTeAtknnUEIE.mjs +0 -7
- package/browser/esm/CN67iG3xuQhXAPad.mjs +0 -7
- package/browser/esm/CQgUOqCEwTc61uuT.mjs +0 -7
- package/browser/esm/Cq1DtQcbtmTtKOc4.mjs +0 -7
- package/browser/esm/Cqz35dsi-gZArS0S.mjs +0 -7
- package/browser/esm/D9wzPAaUYfW5yKFN.mjs +0 -7
- package/browser/esm/DRRzJ8Ep6_Tyd6ne.mjs +0 -7
- package/browser/esm/DSGJzNzS8OeMxUW1.mjs +0 -7
- package/browser/esm/DSIpyed_o2mrjd0r.mjs +0 -7
- package/browser/esm/DWgrVUwlK4kwFJn-.mjs +0 -7
- package/browser/esm/Dr6QLJSwckbF9K_u.mjs +0 -7
- package/browser/esm/DuSF-rjIFFvyCoo8.mjs +0 -7
- package/browser/esm/EiBc8VBUeU8VXEhw.mjs +0 -7
- package/browser/esm/R3CPiIXdp_rdc-Bw.mjs +0 -7
- package/browser/esm/eXqnYk6V-QI6pGI5.mjs +0 -7
- package/browser/esm/hdx26DrfopUuM4j1.mjs +0 -7
- package/browser/esm/oXfsh9SiDjQuu2ZE.mjs +0 -7
- package/browser/esm/zBIGDTI8z3bRbFxO.mjs +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
|
|
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{jsxs as t,jsx as e}from"react/jsx-runtime";import r,{isValidElement as n,PureComponent as o,Component as i,memo as a,useState as u,useCallback as s,useLayoutEffect as f}from"react";import{Box as c}from"@mui/material";import{g as l,r as h,c as p,y as d,u as b,C as v}from"./BPMMuKIe5xb3-D8V.mjs";const g=l(h());function y(t){return y="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},y(t)}var m=/^\s+/,w=/\s+$/;function _(t,e){if(e=e||{},(t=t||"")instanceof _)return t;if(!(this instanceof _))return new _(t,e);var r=function(t){var e={r:0,g:0,b:0},r=1,n=null,o=null,i=null,a=!1,u=!1;"string"==typeof t&&(t=function(t){t=t.replace(m,"").replace(w,"").toLowerCase();var e,r=!1;if(z[t])t=z[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=J.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=J.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=J.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=J.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=J.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=J.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=J.hex8.exec(t))return{r:N(e[1]),g:N(e[2]),b:N(e[3]),a:Y(e[4]),format:r?"name":"hex8"};if(e=J.hex6.exec(t))return{r:N(e[1]),g:N(e[2]),b:N(e[3]),format:r?"name":"hex"};if(e=J.hex4.exec(t))return{r:N(e[1]+""+e[1]),g:N(e[2]+""+e[2]),b:N(e[3]+""+e[3]),a:Y(e[4]+""+e[4]),format:r?"name":"hex8"};if(e=J.hex3.exec(t))return{r:N(e[1]+""+e[1]),g:N(e[2]+""+e[2]),b:N(e[3]+""+e[3]),format:r?"name":"hex"};return!1}(t));"object"==y(t)&&(Q(t.r)&&Q(t.g)&&Q(t.b)?(s=t.r,f=t.g,c=t.b,e={r:255*W(s,255),g:255*W(f,255),b:255*W(c,255)},a=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):Q(t.h)&&Q(t.s)&&Q(t.v)?(n=V(t.s),o=V(t.v),e=function(t,e,r){t=6*W(t,360),e=W(e,100),r=W(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,f=[r,a,i,i,u,r][s],c=[u,r,r,a,i,i][s],l=[i,i,u,r,r,a][s];return{r:255*f,g:255*c,b:255*l}}(t.h,n,o),a=!0,u="hsv"):Q(t.h)&&Q(t.s)&&Q(t.l)&&(n=V(t.s),i=V(t.l),e=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=W(t,360),e=W(e,100),r=W(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,n,i),a=!0,u="hsl"),t.hasOwnProperty("a")&&(r=t.a));var s,f,c;return r=H(r),{ok:a,format:t.format||u,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.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=r.ok}function x(t,e,r){t=W(t,255),e=W(e,255),r=W(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 j(t,e,r){t=W(t,255),e=W(e,255),r=W(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 O(t,e,r,n){var o=[I(Math.round(t).toString(16)),I(Math.round(e).toString(16)),I(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 M(t,e,r,n){return[I(X(n)),I(Math.round(t).toString(16)),I(Math.round(e).toString(16)),I(Math.round(r).toString(16))].join("")}function S(t,e){e=0===e?0:e||10;var r=_(t).toHsl();return r.s-=e/100,r.s=$(r.s),_(r)}function k(t,e){e=0===e?0:e||10;var r=_(t).toHsl();return r.s+=e/100,r.s=$(r.s),_(r)}function A(t){return _(t).desaturate(100)}function E(t,e){e=0===e?0:e||10;var r=_(t).toHsl();return r.l+=e/100,r.l=$(r.l),_(r)}function C(t,e){e=0===e?0:e||10;var r=_(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))),_(r)}function R(t,e){e=0===e?0:e||10;var r=_(t).toHsl();return r.l-=e/100,r.l=$(r.l),_(r)}function P(t,e){var r=_(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,_(r)}function T(t){var e=_(t).toHsl();return e.h=(e.h+180)%360,_(e)}function L(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=_(t).toHsl(),n=[_(t)],o=360/e,i=1;i<e;i++)n.push(_({h:(r.h+i*o)%360,s:r.s,l:r.l}));return n}function U(t){var e=_(t).toHsl(),r=e.h;return[_(t),_({h:(r+72)%360,s:e.s,l:e.l}),_({h:(r+216)%360,s:e.s,l:e.l})]}function F(t,e,r){e=e||6,r=r||30;var n=_(t).toHsl(),o=360/r,i=[_(t)];for(n.h=(n.h-(o*e>>1)+720)%360;--e;)n.h=(n.h+o)%360,i.push(_(n));return i}function D(t,e){e=e||6;for(var r=_(t).toHsv(),n=r.h,o=r.s,i=r.v,a=[],u=1/e;e--;)a.push(_({h:n,s:o,v:i})),i=(i+u)%1;return a}_.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=H(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=j(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=j(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=x(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=x(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 O(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=[I(Math.round(t).toString(16)),I(Math.round(e).toString(16)),I(Math.round(r).toString(16)),I(X(n))];if(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))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return 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*W(this._r,255))+"%",g:Math.round(100*W(this._g,255))+"%",b:Math.round(100*W(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*W(this._r,255))+"%, "+Math.round(100*W(this._g,255))+"%, "+Math.round(100*W(this._b,255))+"%)":"rgba("+Math.round(100*W(this._r,255))+"%, "+Math.round(100*W(this._g,255))+"%, "+Math.round(100*W(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(B[O(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+M(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var o=_(t);r="#"+M(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 _(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(E,arguments)},brighten:function(){return this._applyModification(C,arguments)},darken:function(){return this._applyModification(R,arguments)},desaturate:function(){return this._applyModification(S,arguments)},saturate:function(){return this._applyModification(k,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(P,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(F,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(U,arguments)},triad:function(){return this._applyCombination(L,[3])},tetrad:function(){return this._applyCombination(L,[4])}},_.fromRatio=function(t,e){if("object"==y(t)){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:V(t[n]));t=r}return _(t,e)},_.equals=function(t,e){return!(!t||!e)&&_(t).toRgbString()==_(e).toRgbString()},_.random=function(){return _.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},_.mix=function(t,e,r){r=0===r?0:r||50;var n=_(t).toRgb(),o=_(e).toRgb(),i=r/100;return _({r:(o.r-n.r)*i+n.r,g:(o.g-n.g)*i+n.g,b:(o.b-n.b)*i+n.b,a:(o.a-n.a)*i+n.a})},_.readability=function(t,e){var r=_(t),n=_(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},_.isReadable=function(t,e,r){var n,o,i=_.readability(t,e);switch(o=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},_.mostReadable=function(t,e,r){var n,o,i,a,u=null,s=0;o=(r=r||{}).includeFallbackColors,i=r.level,a=r.size;for(var f=0;f<e.length;f++)(n=_.readability(t,e[f]))>s&&(s=n,u=_(e[f]));return _.isReadable(t,u,{level:i,size:a})||!o?u:(r.includeFallbackColors=!1,_.mostReadable(t,["#fff","#000"],r))};var z=_.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"},B=_.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(z);function H(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function W(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 $(t){return Math.min(1,Math.max(0,t))}function N(t){return parseInt(t,16)}function I(t){return 1==t.length?"0"+t:""+t}function V(t){return t<=1&&(t=100*t+"%"),t}function X(t){return Math.round(255*parseFloat(t)).toString(16)}function Y(t){return N(t)/255}var q,K,G,J=(K="[\\s|\\(]+("+(q="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",G="[\\s|\\(]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",{CSS_UNIT:new RegExp(q),rgb:new RegExp("rgb"+K),rgba:new RegExp("rgba"+G),hsl:new RegExp("hsl"+K),hsla:new RegExp("hsla"+G),hsv:new RegExp("hsv"+K),hsva:new RegExp("hsva"+G),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 Q(t){return!!J.CSS_UNIT.exec(t)}var Z,tt,et,rt,nt,ot,it,at,ut,st,ft,ct,lt,ht,pt,dt,bt,vt,gt,yt,mt,wt,_t,xt,jt,Ot,Mt,St,kt={},At={};function Et(){if(tt)return Z;tt=1;var t="object"==typeof p&&p&&p.Object===Object&&p;return Z=t}function Ct(){if(rt)return et;rt=1;var t=Et(),e="object"==typeof self&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return et=r}function Rt(){if(ot)return nt;ot=1;var t=Ct().Symbol;return nt=t}function Pt(){if(ct)return ft;ct=1;var t=Rt(),e=function(){if(at)return it;at=1;var t=Rt(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,o=t?t.toStringTag:void 0;return it=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(st)return ut;st=1;var t=Object.prototype.toString;return ut=function(e){return t.call(e)}}(),n=t?t.toStringTag:void 0;return ft=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":n&&n in Object(t)?e(t):r(t)}}function Tt(){if(ht)return lt;ht=1;var t=Array.isArray;return lt=t}function Lt(){if(dt)return pt;return dt=1,pt=function(t){return null!=t&&"object"==typeof t}}function Ut(){if(wt)return mt;wt=1;var t=(yt?gt:(yt=1,gt=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 mt=t}function Ft(){if(St)return Mt;St=1;var t=function(){if(Ot)return jt;Ot=1;var t=Pt(),e=Lt();return jt=function(r){return e(r)&&"[object Arguments]"==t(r)}}(),e=Lt(),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 Mt=i}var Dt,zt,Bt,Ht,Wt,$t,Nt,It,Vt,Xt,Yt,qt={exports:{}};function Kt(){return Bt||(Bt=1,function(t,e){var r=Ct(),n=zt?Dt:(zt=1,Dt=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}(qt,qt.exports)),qt.exports}function Gt(){if(Wt)return Ht;Wt=1;var t=/^(?:0|[1-9]\d*)$/;return Ht=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 Jt(){if(Nt)return $t;Nt=1;return $t=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}function Qt(){if(Yt)return Xt;return Yt=1,Xt=function(t){return function(e){return t(e)}}}var Zt,te,ee,re,ne,oe,ie,ae,ue,se,fe,ce,le,he,pe,de,be,ve,ge,ye,me,we,_e,xe,je,Oe,Me,Se,ke,Ae,Ee,Ce,Re,Pe,Te,Le,Ue,Fe,De,ze,Be,He,We,$e,Ne,Ie,Ve,Xe,Ye,qe,Ke,Ge,Je,Qe,Ze,tr,er,rr,nr,or,ir,ar,ur,sr,fr,cr,lr,hr,pr,dr,br,vr,gr,yr,mr,wr,_r,xr,jr,Or,Mr,Sr,kr,Ar,Er,Cr,Rr,Pr,Tr,Lr,Ur,Fr,Dr,zr,Br,Hr,Wr,$r,Nr,Ir,Vr,Xr,Yr,qr,Kr,Gr,Jr,Qr,Zr,tn,en,rn,nn,on,an,un,sn,fn,cn,ln,hn,pn,dn,bn,vn,gn,yn,mn,wn,_n,xn,jn,On,Mn,Sn,kn,An,En,Cn,Rn,Pn,Tn,Ln,Un,Fn,Dn,zn,Bn,Hn,Wn,$n,Nn,In,Vn,Xn,Yn,qn,Kn,Gn,Jn,Qn,Zn,to,eo,ro,no,oo,io,ao,uo,so,fo,co,lo,ho,po,bo,vo,go,yo,mo,wo,_o,xo,jo,Oo,Mo,So,ko,Ao,Eo,Co,Ro,Po,To,Lo,Uo,Fo,Do,zo,Bo,Ho,Wo,$o,No,Io,Vo,Xo,Yo,qo,Ko,Go,Jo={exports:{}};function Qo(){return Zt||(Zt=1,function(t,e){var r=Et(),n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,i=o&&o.exports===n&&r.process,a=function(){try{var t=o&&o.require&&o.require("util").types;return t||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=a}(Jo,Jo.exports)),Jo.exports}function Zo(){if(ee)return te;ee=1;var t=function(){if(Vt)return It;Vt=1;var t=Pt(),e=Jt(),r=Lt(),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,It=function(o){return r(o)&&e(o.length)&&!!n[t(o)]}}(),e=Qt(),r=Qo(),n=r&&r.isTypedArray,o=n?e(n):t;return te=o}function ti(){if(ne)return re;ne=1;var t=xt?_t:(xt=1,_t=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}),e=Ft(),r=Tt(),n=Kt(),o=Gt(),i=Zo(),a=Object.prototype.hasOwnProperty;return re=function(u,s){var f=r(u),c=!f&&e(u),l=!f&&!c&&n(u),h=!f&&!c&&!l&&i(u),p=f||c||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 ei(){if(ie)return oe;ie=1;var t=Object.prototype;return oe=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}}function ri(){if(ue)return ae;return ue=1,ae=function(t,e){return function(r){return t(e(r))}}}function ni(){if(le)return ce;le=1;var t=ei(),e=function(){if(fe)return se;fe=1;var t=ri()(Object.keys,Object);return se=t}(),r=Object.prototype.hasOwnProperty;return ce=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}}function oi(){if(pe)return he;return pe=1,he=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function ii(){if(be)return de;be=1;var t=Pt(),e=oi();return de=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 ai(){if(ge)return ve;ge=1;var t=ii(),e=Jt();return ve=function(r){return null!=r&&e(r.length)&&!t(r)}}function ui(){if(me)return ye;me=1;var t=ti(),e=ni(),r=ai();return ye=function(n){return r(n)?t(n):e(n)}}function si(){if(_e)return we;_e=1;var t=Ut(),e=ui();return we=function(r,n){return r&&t(r,n,e)}}function fi(){if(je)return xe;return je=1,xe=function(t){return t}}function ci(){if(ke)return Se;ke=1;var t=si(),e=function(){if(Me)return Oe;Me=1;var t=fi();return Oe=function(e){return"function"==typeof e?e:t}}();return Se=function(r,n){return r&&t(r,e(n))}}function li(){if(Ee)return Ae;Ee=1;var t=ri()(Object.getPrototypeOf,Object);return Ae=t}function hi(){if(Te)return Pe;return Te=1,Pe=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 pi(){if(De)return Fe;return De=1,Fe=function(t,e){return t===e||t!=t&&e!=e}}function di(){if(Be)return ze;Be=1;var t=pi();return ze=function(e,r){for(var n=e.length;n--;)if(t(e[n][0],r))return n;return-1}}function bi(){if(Ke)return qe;Ke=1;var t=Ue?Le:(Ue=1,Le=function(){this.__data__=[],this.size=0}),e=function(){if(We)return He;We=1;var t=di(),e=Array.prototype.splice;return He=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(Ne)return $e;Ne=1;var t=di();return $e=function(e){var r=this.__data__,n=t(r,e);return n<0?void 0:r[n][1]}}(),n=function(){if(Ve)return Ie;Ve=1;var t=di();return Ie=function(e){return t(this.__data__,e)>-1}}(),o=function(){if(Ye)return Xe;Ye=1;var t=di();return Xe=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,qe=i}function vi(){if(ur)return ar;ur=1;var t,e=function(){if(ir)return or;ir=1;var t=Ct()["__core-js_shared__"];return or=t}(),r=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return ar=function(t){return!!r&&r in t}}function gi(){if(fr)return sr;fr=1;var t=Function.prototype.toString;return sr=function(e){if(null!=e){try{return t.call(e)}catch(t){}try{return e+""}catch(t){}}return""}}function yi(){if(br)return dr;br=1;var t=function(){if(lr)return cr;lr=1;var t=ii(),e=vi(),r=oi(),n=gi(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,a=Object.prototype,u=i.toString,s=a.hasOwnProperty,f=RegExp("^"+u.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return cr=function(i){return!(!r(i)||e(i))&&(t(i)?f:o).test(n(i))}}(),e=pr?hr:(pr=1,hr=function(t,e){return null==t?void 0:t[e]});return dr=function(r,n){var o=e(r,n);return t(o)?o:void 0}}function mi(){if(gr)return vr;gr=1;var t=yi()(Ct(),"Map");return vr=t}function wi(){if(mr)return yr;mr=1;var t=yi()(Object,"create");return yr=t}function _i(){if(Rr)return Cr;Rr=1;var t=function(){if(_r)return wr;_r=1;var t=wi();return wr=function(){this.__data__=t?t(null):{},this.size=0}}(),e=jr?xr:(jr=1,xr=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),r=function(){if(Mr)return Or;Mr=1;var t=wi(),e=Object.prototype.hasOwnProperty;return Or=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(kr)return Sr;kr=1;var t=wi(),e=Object.prototype.hasOwnProperty;return Sr=function(r){var n=this.__data__;return t?void 0!==n[r]:e.call(n,r)}}(),o=function(){if(Er)return Ar;Er=1;var t=wi();return Ar=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,Cr=i}function xi(){if(Dr)return Fr;Dr=1;var t=Ur?Lr:(Ur=1,Lr=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return Fr=function(e,r){var n=e.__data__;return t(r)?n["string"==typeof r?"string":"hash"]:n.map}}function ji(){if(Yr)return Xr;Yr=1;var t=function(){if(Tr)return Pr;Tr=1;var t=_i(),e=bi(),r=mi();return Pr=function(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}}(),e=function(){if(Br)return zr;Br=1;var t=xi();return zr=function(e){var r=t(this,e).delete(e);return this.size-=r?1:0,r}}(),r=function(){if(Wr)return Hr;Wr=1;var t=xi();return Hr=function(e){return t(this,e).get(e)}}(),n=function(){if(Nr)return $r;Nr=1;var t=xi();return $r=function(e){return t(this,e).has(e)}}(),o=function(){if(Vr)return Ir;Vr=1;var t=xi();return Ir=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,Xr=i}function Oi(){if(Jr)return Gr;Jr=1;var t=bi(),e=function(){if(Je)return Ge;Je=1;var t=bi();return Ge=function(){this.__data__=new t,this.size=0}}(),r=Ze?Qe:(Ze=1,Qe=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}),n=er?tr:(er=1,tr=function(t){return this.__data__.get(t)}),o=nr?rr:(nr=1,rr=function(t){return this.__data__.has(t)}),i=function(){if(Kr)return qr;Kr=1;var t=bi(),e=mi(),r=ji();return qr=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,Gr=a}function Mi(){if(nn)return rn;nn=1;var t=ji(),e=Zr?Qr:(Zr=1,Qr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}),r=en?tn:(en=1,tn=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,rn=n}function Si(){if(cn)return fn;cn=1;var t=Mi(),e=an?on:(an=1,on=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=sn?un:(sn=1,un=function(t,e){return t.has(e)});return fn=function(n,o,i,a,u,s){var f=1&i,c=n.length,l=o.length;if(c!=l&&!(f&&l>c))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<c;){var g=n[d],y=o[d];if(a)var m=f?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 ki(){if(hn)return ln;hn=1;var t=Ct().Uint8Array;return ln=t}function Ai(){if(yn)return gn;yn=1;var t=Rt(),e=ki(),r=pi(),n=Si(),o=dn?pn:(dn=1,pn=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}),i=vn?bn:(vn=1,bn=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 gn=function(t,a,s,f,c,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&f;if(p||(p=i),t.size!=a.size&&!d)return!1;var b=h.get(t);if(b)return b==a;f|=2,h.set(t,a);var v=n(p(t),p(a),f,c,l,h);return h.delete(t),v;case"[object Symbol]":if(u)return u.call(t)==u.call(a)}return!1}}function Ei(){if(wn)return mn;return wn=1,mn=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}}function Ci(){if(xn)return _n;xn=1;var t=Ei(),e=Tt();return _n=function(r,n,o){var i=n(r);return e(r)?i:t(i,o(r))}}function Ri(){if(Sn)return Mn;return Sn=1,Mn=function(){return[]}}function Pi(){if(An)return kn;An=1;var t=On?jn:(On=1,jn=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=Ri(),r=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols;return kn=n?function(e){return null==e?[]:(e=Object(e),t(n(e),function(t){return r.call(e,t)}))}:e}function Ti(){if(Cn)return En;Cn=1;var t=Ci(),e=Pi(),r=ui();return En=function(n){return t(n,r,e)}}function Li(){if($n)return Wn;$n=1;var t=function(){if(Ln)return Tn;Ln=1;var t=yi()(Ct(),"DataView");return Tn=t}(),e=mi(),r=function(){if(Fn)return Un;Fn=1;var t=yi()(Ct(),"Promise");return Un=t}(),n=function(){if(zn)return Dn;zn=1;var t=yi()(Ct(),"Set");return Dn=t}(),o=function(){if(Hn)return Bn;Hn=1;var t=yi()(Ct(),"WeakMap");return Bn=t}(),i=Pt(),a=gi(),u="[object Map]",s="[object Promise]",f="[object Set]",c="[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)!=f||o&&g(new o)!=c)&&(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 f;case v:return c}return e}),Wn=g}function Ui(){if(In)return Nn;In=1;var t=Oi(),e=Si(),r=Ai(),n=function(){if(Pn)return Rn;Pn=1;var t=Ti(),e=Object.prototype.hasOwnProperty;return Rn=function(r,n,o,i,a,u){var s=1&o,f=t(r),c=f.length;if(c!=t(n).length&&!s)return!1;for(var l=c;l--;){var h=f[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<c;){var g=r[h=f[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 w=r.constructor,_=n.constructor;w==_||!("constructor"in r)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(b=!1)}return u.delete(r),u.delete(n),b}}(),o=Li(),i=Tt(),a=Kt(),u=Zo(),s="[object Arguments]",f="[object Array]",c="[object Object]",l=Object.prototype.hasOwnProperty;return Nn=function(h,p,d,b,v,g){var y=i(h),m=i(p),w=y?f:o(h),_=m?f:o(p),x=(w=w==s?c:w)==c,j=(_=_==s?c:_)==c,O=w==_;if(O&&a(h)){if(!a(p))return!1;y=!0,x=!1}if(O&&!x)return g||(g=new t),y||u(h)?e(h,p,d,b,v,g):r(h,p,w,d,b,v,g);if(!(1&d)){var M=x&&l.call(h,"__wrapped__"),S=j&&l.call(p,"__wrapped__");if(M||S){var k=M?h.value():h,A=S?p.value():p;return g||(g=new t),v(k,A,d,b,g)}}return!!O&&(g||(g=new t),n(h,p,d,b,v,g))}}function Fi(){if(Xn)return Vn;Xn=1;var t=Ui(),e=Lt();return Vn=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))},Vn}function Di(){if(Gn)return Kn;Gn=1;var t=oi();return Kn=function(e){return e==e&&!t(e)}}function zi(){if(to)return Zn;return to=1,Zn=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}}function Bi(){if(ro)return eo;ro=1;var t=function(){if(qn)return Yn;qn=1;var t=Oi(),e=Fi();return Yn=function(r,n,o,i){var a=o.length,u=a,s=!i;if(null==r)return!u;for(r=Object(r);a--;){var f=o[a];if(s&&f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++a<u;){var c=(f=o[a])[0],l=r[c],h=f[1];if(s&&f[2]){if(void 0===l&&!(c in r))return!1}else{var p=new t;if(i)var d=i(l,h,c,r,n,p);if(!(void 0===d?e(h,l,3,i,p):d))return!1}}return!0}}(),e=function(){if(Qn)return Jn;Qn=1;var t=Di(),e=ui();return Jn=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=zi();return eo=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)}}}function Hi(){if(oo)return no;oo=1;var t=Pt(),e=Lt();return no=function(r){return"symbol"==typeof r||e(r)&&"[object Symbol]"==t(r)}}function Wi(){if(ao)return io;ao=1;var t=Tt(),e=Hi(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return io=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 $i(){if(co)return fo;co=1;var t=function(){if(so)return uo;so=1;var t=ji();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,uo=e}();return fo=function(e){var r=t(e,function(t){return 500===n.size&&n.clear(),t}),n=r.cache;return r}}function Ni(){if(go)return vo;go=1;var t=function(){if(bo)return po;bo=1;var t=Rt(),e=hi(),r=Tt(),n=Hi(),o=t?t.prototype:void 0,i=o?o.toString:void 0;return po=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},po}();return vo=function(e){return null==e?"":t(e)}}function Ii(){if(mo)return yo;mo=1;var t=Tt(),e=Wi(),r=function(){if(ho)return lo;ho=1;var t=$i(),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 lo=n}(),n=Ni();return yo=function(o,i){return t(o)?o:e(o,i)?[o]:r(n(o))}}function Vi(){if(_o)return wo;_o=1;var t=Hi();return wo=function(e){if("string"==typeof e||t(e))return e;var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}}function Xi(){if(jo)return xo;jo=1;var t=Ii(),e=Vi();return xo=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 Yi(){if(Ro)return Co;Ro=1;var t=ko?So:(ko=1,So=function(t,e){return null!=t&&e in Object(t)}),e=function(){if(Eo)return Ao;Eo=1;var t=Ii(),e=Ft(),r=Tt(),n=Gt(),o=Jt(),i=Vi();return Ao=function(a,u,s){for(var f=-1,c=(u=t(u,a)).length,l=!1;++f<c;){var h=i(u[f]);if(!(l=null!=a&&s(a,h)))break;a=a[h]}return l||++f!=c?l:!!(c=null==a?0:a.length)&&o(c)&&n(h,c)&&(r(a)||e(a))}}();return Co=function(r,n){return null!=r&&e(r,n,t)}}function qi(){if(To)return Po;To=1;var t=Fi(),e=function(){if(Mo)return Oo;Mo=1;var t=Xi();return Oo=function(e,r,n){var o=null==e?void 0:t(e,r);return void 0===o?n:o}}(),r=Yi(),n=Wi(),o=Di(),i=zi(),a=Vi();return Po=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 Ki(){if(Bo)return zo;Bo=1;var t=Uo?Lo:(Uo=1,Lo=function(t){return function(e){return null==e?void 0:e[t]}}),e=function(){if(Do)return Fo;Do=1;var t=Xi();return Fo=function(e){return function(r){return t(r,e)}}}(),r=Wi(),n=Vi();return zo=function(o){return r(o)?t(n(o)):e(o)}}function Gi(){if(Vo)return Io;Vo=1;var t=si(),e=function(){if(No)return $o;No=1;var t=ai();return $o=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 Io=e}function Ji(){if(Ko)return qo;Ko=1;var t=hi(),e=function(){if(Wo)return Ho;Wo=1;var t=Bi(),e=qi(),r=fi(),n=Tt(),o=Ki();return Ho=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(Yo)return Xo;Yo=1;var t=Gi(),e=ai();return Xo=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=Tt();return qo=function(o,i){return(n(o)?t:r)(o,e(i,3))}}function Qi(){if(Go)return At;Go=1,Object.defineProperty(At,"__esModule",{value:!0}),At.flattenNames=void 0;var t=function(){if(vt)return bt;vt=1;var t=Pt(),e=Tt(),r=Lt();return bt=function(n){return"string"==typeof n||!e(n)&&r(n)&&"[object String]"==t(n)}}(),e=a(t),r=a(ci()),n=function(){if(Re)return Ce;Re=1;var t=Pt(),e=li(),r=Lt(),n=Function.prototype,o=Object.prototype,i=n.toString,a=o.hasOwnProperty,u=i.call(Object);return Ce=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=At.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 At.default=u,At}var Zi,ta,ea,ra,na,oa,ia,aa,ua,sa,fa,ca,la,ha,pa,da,ba,va,ga,ya,ma={};function wa(){if(oa)return na;oa=1;var t=function(){if(ra)return ea;ra=1;var t=yi(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();return ea=e}();return na=function(e,r,n){"__proto__"==r&&t?t(e,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[r]=n}}function _a(){if(aa)return ia;aa=1;var t=wa(),e=pi(),r=Object.prototype.hasOwnProperty;return ia=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 xa(){if(sa)return ua;sa=1;var t=_a(),e=wa();return ua=function(r,n,o,i){var a=!o;o||(o={});for(var u=-1,s=n.length;++u<s;){var f=n[u],c=i?i(o[f],r[f],f,o,r):void 0;void 0===c&&(c=r[f]),a?e(o,f,c):t(o,f,c)}return o}}function ja(){if(da)return pa;da=1;var t=oi(),e=ei(),r=ha?la:(ha=1,la=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}),n=Object.prototype.hasOwnProperty;return pa=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}}function Oa(){if(va)return ba;va=1;var t=ti(),e=ja(),r=ai();return ba=function(n){return r(n)?t(n,!0):e(n)}}var Ma,Sa,ka,Aa,Ea,Ca,Ra,Pa,Ta,La,Ua,Fa,Da,za,Ba,Ha,Wa,$a,Na,Ia,Va,Xa,Ya,qa,Ka,Ga,Ja,Qa,Za,tu,eu,ru,nu,ou,iu,au,uu,su,fu,cu,lu,hu,pu={exports:{}};function du(){if(Ra)return Ca;Ra=1;var t=Ei(),e=li(),r=Pi(),n=Ri(),o=Object.getOwnPropertySymbols;return Ca=o?function(n){for(var o=[];n;)t(o,r(n)),n=e(n);return o}:n}function bu(){if(Ba)return za;Ba=1;var t=ki();return za=function(e){var r=new e.constructor(e.byteLength);return new t(r).set(new t(e)),r}}function vu(){if(Ka)return qa;Ka=1;var t=bu(),e=function(){if(Wa)return Ha;Wa=1;var t=bu();return Ha=function(e,r){var n=r?t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}}(),r=function(){if(Na)return $a;Na=1;var t=/\w*$/;return $a=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}}(),n=function(){if(Va)return Ia;Va=1;var t=Rt(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;return Ia=function(t){return r?Object(r.call(t)):{}}}(),o=function(){if(Ya)return Xa;Ya=1;var t=bu();return Xa=function(e,r){var n=r?t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}}();return qa=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)}}}function gu(){if(Za)return Qa;Za=1;var t=function(){if(Ja)return Ga;Ja=1;var t=oi(),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 Ga=r}(),e=li(),r=ei();return Qa=function(n){return"function"!=typeof n.constructor||r(n)?{}:t(e(n))}}function yu(){if(nu)return ru;nu=1;var t=function(){if(eu)return tu;eu=1;var t=Li(),e=Lt();return tu=function(r){return e(r)&&"[object Map]"==t(r)}}(),e=Qt(),r=Qo(),n=r&&r.isMap,o=n?e(n):t;return ru=o}function mu(){if(uu)return au;uu=1;var t=function(){if(iu)return ou;iu=1;var t=Li(),e=Lt();return ou=function(r){return e(r)&&"[object Set]"==t(r)}}(),e=Qt(),r=Qo(),n=r&&r.isSet,o=n?e(n):t;return au=o}function wu(){if(fu)return su;fu=1;var t=Oi(),e=ta?Zi:(ta=1,Zi=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}),r=_a(),n=function(){if(ca)return fa;ca=1;var t=xa(),e=ui();return fa=function(r,n){return r&&t(n,e(n),r)}}(),o=function(){if(ya)return ga;ya=1;var t=xa(),e=Oa();return ga=function(r,n){return r&&t(n,e(n),r)}}(),i=(Ma||(Ma=1,function(t,e){var r=Ct(),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}}(pu,pu.exports)),pu.exports),a=ka?Sa:(ka=1,Sa=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(Ea)return Aa;Ea=1;var t=xa(),e=Pi();return Aa=function(r,n){return t(r,e(r),n)}}(),s=function(){if(Ta)return Pa;Ta=1;var t=xa(),e=du();return Pa=function(r,n){return t(r,e(r),n)}}(),f=Ti(),c=function(){if(Ua)return La;Ua=1;var t=Ci(),e=du(),r=Oa();return La=function(n){return t(n,r,e)}}(),l=Li(),h=function(){if(Da)return Fa;Da=1;var t=Object.prototype.hasOwnProperty;return Fa=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=vu(),d=gu(),b=Tt(),v=Kt(),g=yu(),y=oi(),m=mu(),w=ui(),_=Oa(),x="[object Arguments]",j="[object Function]",O="[object Object]",M={};return M[x]=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,su=function S(k,A,E,C,R,P){var T,L=1&A,U=2&A,F=4&A;if(E&&(T=R?E(k,C,R,P):E(k)),void 0!==T)return T;if(!y(k))return k;var D=b(k);if(D){if(T=h(k),!L)return a(k,T)}else{var z=l(k),B=z==j||"[object GeneratorFunction]"==z;if(v(k))return i(k,L);if(z==O||z==x||B&&!R){if(T=U||B?{}:d(k),!L)return U?s(k,o(T,k)):u(k,n(T,k))}else{if(!M[z])return R?k:{};T=p(k,z,L)}}P||(P=new t);var H=P.get(k);if(H)return H;P.set(k,T),m(k)?k.forEach(function(t){T.add(S(t,A,E,t,k,P))}):g(k)&&k.forEach(function(t,e){T.set(e,S(t,A,E,e,k,P))});var W=D?void 0:(F?U?c:f:U?_:w)(k);return e(W||k,function(t,e){W&&(t=k[e=t]),r(T,e,S(t,A,E,e,k,P))}),T},su}function _u(){if(hu)return ma;hu=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.mergeClasses=void 0;var t=n(ci()),e=n(function(){if(lu)return cu;lu=1;var t=wu();return cu=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=ma.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 ma.default=o,ma}var xu,ju={};var Ou,Mu={};function Su(){if(Ou)return Mu;Ou=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.hover=void 0;var t,e=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=(t=r)&&t.__esModule?t:{default:t};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=Mu.hover=function(t){var r=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 f=arguments.length,c=Array(f),l=0;l<f;l++)c[l]=arguments[l];return u=s=o(this,(i=a.__proto__||Object.getPrototypeOf(a)).call.apply(i,[this].concat(c))),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(r,{onMouseOver:s.handleMouseOver,onMouseOut:s.handleMouseOut},n.default.createElement(t,e({},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 Mu.default=i,Mu}var ku,Au={};function Eu(){if(ku)return Au;ku=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.active=void 0;var t,e=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=(t=r)&&t.__esModule?t:{default:t};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=Au.active=function(t){var r=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 f=arguments.length,c=Array(f),l=0;l<f;l++)c[l]=arguments[l];return u=s=o(this,(i=a.__proto__||Object.getPrototypeOf(a)).call.apply(i,[this].concat(c))),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(r,{onMouseDown:s.handleMouseDown,onMouseUp:s.handleMouseUp},n.default.createElement(t,e({},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 Au.default=i,Au}var Cu,Ru,Pu={};var Tu=function(){if(Ru)return kt;Ru=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.ReactCSS=kt.loop=kt.handleActive=kt.handleHover=kt.hover=void 0;var t=u(Qi()),e=u(_u()),r=function(){if(xu)return ju;xu=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.autoprefix=void 0;var t,e=ci(),r=(t=e)&&t.__esModule?t:{default:t},n=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},o={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}}},i=ju.autoprefix=function(t){var e={};return(0,r.default)(t,function(t,i){var a={};(0,r.default)(t,function(t,e){var r=o[e];r?a=n({},a,r(t)):a[e]=t}),e[i]=a}),e};return ju.default=i,ju}(),n=u(r),o=u(Su()),i=u(Eu()),a=u((Cu||(Cu=1,Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.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}),Pu));function u(t){return t&&t.__esModule?t:{default:t}}kt.hover=o.default,kt.handleHover=o.default,kt.handleActive=i.default,kt.loop=a.default;var s=kt.ReactCSS=function(r){for(var o=arguments.length,i=Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];var u=(0,t.default)(i),s=(0,e.default)(r,u);return(0,n.default)(s)};return kt.default=s,kt}();const Lu=l(Tu);var Uu={},Fu=function(t,e,r,n){var o=t+"-"+e+"-"+r+(n?"-server":"");if(Uu[o])return Uu[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 Uu[o]=i,i},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},zu=function(t){var e=t.white,o=t.grey,i=t.size,a=t.renderers,u=t.borderRadius,s=t.boxShadow,f=t.children,c=Lu({default:{grid:{borderRadius:u,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+Fu(e,o,i,a.canvas)+") center left"}}});return n(f)?r.cloneElement(f,Du({},f.props,{style:Du({},f.props.style,c.grid)})):r.createElement("div",{style:c.grid})};zu.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var Bu=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},Hu=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 Wu(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 $u=function(){function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=n=Wu(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[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,f=u-(o.getBoundingClientRect().left+window.pageXOffset),c=s-(o.getBoundingClientRect().top+window.pageYOffset);if("vertical"===r){var l=void 0;if(l=c<0?0:c>a?1:Math.round(100*c/a)/100,e.a!==l)return{h:e.h,s:e.s,l:e.l,a:l,source:"rgb"}}else{var h=void 0;if(n!==(h=f<0?0:f>i?1:Math.round(100*f/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)},Wu(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)}(t,o||i),Hu(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var t=this,e=this.props.rgb,n=Lu({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("+e.r+","+e.g+","+e.b+", 0) 0%,\n rgba("+e.r+","+e.g+","+e.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*e.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("+e.r+","+e.g+","+e.b+", 0) 0%,\n rgba("+e.r+","+e.g+","+e.b+", 1) 100%)"},pointer:{left:0,top:100*e.a+"%"}},overwrite:Bu({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return r.createElement("div",{style:n.alpha},r.createElement("div",{style:n.checkboard},r.createElement(zu,{renderers:this.props.renderers})),r.createElement("div",{style:n.gradient}),r.createElement("div",{style:n.container,ref:function(e){return t.container=e},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},r.createElement("div",{style:n.pointer},this.props.pointer?r.createElement(this.props.pointer,this.props):r.createElement("div",{style:n.slider}))))}}]),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}}();var Iu=[38,40],Vu=1,Xu=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);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,(t.__proto__||Object.getPrototypeOf(t)).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,Iu.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(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},r.inputId="rc-editable-input-"+Vu++,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)}(t,o||i),Nu(t,[{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 t=this,e=Lu({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 r.createElement("div",{style:e.wrap},r.createElement("input",{id:this.inputId,style:e.input,ref:function(e){return t.input=e},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?r.createElement("label",{htmlFor:this.inputId,style:e.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(),Yu=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 qu(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 Ku=function(){function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=n=qu(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[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),f=u-(n.getBoundingClientRect().top+window.pageYOffset);if("vertical"===e){var c=void 0;if(c=f<0?359:f>i?0:360*(-100*f/i+100)/100,r.h!==c)return{h:c,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var l=void 0;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()},qu(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)}(t,o||i),Yu(t,[{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 t=this,e=this.props.direction,n=void 0===e?"horizontal":e,o=Lu({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 r.createElement("div",{style:o.hue},r.createElement("div",{className:"hue-"+n,style:o.container,ref:function(e){return t.container=e},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},r.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 "),r.createElement("div",{style:o.pointer},this.props.pointer?r.createElement(this.props.pointer,this.props):r.createElement("div",{style:o.slider}))))}}]),t}(),Gu="object"==typeof global&&global&&global.Object===Object&&global,Ju="object"==typeof self&&self&&self.Object===Object&&self,Qu=Gu||Ju||Function("return this")(),Zu=Qu.Symbol,ts=Object.prototype,es=ts.hasOwnProperty,rs=ts.toString,ns=Zu?Zu.toStringTag:void 0;var os=Object.prototype.toString;var is=Zu?Zu.toStringTag:void 0;function as(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":is&&is in Object(t)?function(t){var e=es.call(t,ns),r=t[ns];try{t[ns]=void 0;var n=!0}catch(t){}var o=rs.call(t);return n&&(e?t[ns]=r:delete t[ns]),o}(t):function(t){return os.call(t)}(t)}function us(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}g.string,g.oneOf([0,1,2,3,4,5]),g.number,g.object;var ss=function(){return Qu.Date.now()},fs=/\s/;var cs=/^\s+/;function ls(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&fs.test(t.charAt(e)););return e}(t)+1).replace(cs,""):t}var hs=/^[-+]0x[0-9a-f]+$/i,ps=/^0b[01]+$/i,ds=/^0o[0-7]+$/i,bs=parseInt;function vs(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]"==as(t)}(t))return NaN;if(us(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=us(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=ls(t);var r=ps.test(t);return r||ds.test(t)?bs(t.slice(2),r?2:8):hs.test(t)?NaN:+t}var gs=Math.max,ys=Math.min;function ms(t,e,r){var n,o,i,a,u,s,f=0,c=!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,f=e,a=t.apply(i,r)}function d(t){var r=t-s;return void 0===s||r>=e||r<0||l&&t-f>=i}function b(){var t=ss();if(d(t))return v(t);u=setTimeout(b,function(t){var r=e-(t-s);return l?ys(r,i-(t-f)):r}(t))}function v(t){return u=void 0,h&&n?p(t):(n=o=void 0,a)}function g(){var t=ss(),r=d(t);if(n=arguments,o=this,s=t,r){if(void 0===u)return function(t){return f=t,u=setTimeout(b,e),c?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=vs(e)||0,us(r)&&(c=!!r.leading,i=(l="maxWait"in r)?gs(vs(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h),g.cancel=function(){void 0!==u&&clearTimeout(u),f=0,n=s=o=u=void 0},g.flush=function(){return void 0===u?a:v(ss())},g}var ws=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 t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);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,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));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),f=u-(r.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>o&&(s=o),f<0?f=0:f>i&&(f=i);var c=s/o,l=1-f/i;return{h:e.h,s:c,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;if("function"!=typeof t)throw new TypeError("Expected a function");return us(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),ms(t,e,{leading:n,maxWait:e,trailing:o})}(function(t,e,r){t(e,r)},50),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)})(t,o||i),ws(t,[{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 t=this,e=this.props.style||{},n=e.color,o=e.white,i=e.black,a=e.pointer,u=e.circle,s=Lu({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 r.createElement("div",{style:s.color,ref:function(e){return t.container=e},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},r.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 "),r.createElement("div",{style:s.white,className:"saturation-white"},r.createElement("div",{style:s.black,className:"saturation-black"}),r.createElement("div",{style:s.pointer},this.props.pointer?r.createElement(this.props.pointer,this.props):r.createElement("div",{style:s.circle}))))}}])}();var _s=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},xs=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 js(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 Os=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(t){var e=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=js(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})},js(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,r.Component),xs(n,[{key:"render",value:function(){return r.createElement(e,{onFocus:this.handleFocus,onBlur:this.handleBlur},r.createElement(t,_s({},this.props,this.state)))}}])})()}(function(t){var e=t.color,n=t.style,o=t.onClick,i=void 0===o?function(){}:o,a=t.onHover,u=t.title,s=void 0===u?e:u,f=t.children,c=t.focus,l=t.focusStyle,h="transparent"===e,p=Lu({default:{swatch:Os({background:e,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},n,c?void 0===l?{}:l:{})}}),d={};return a&&(d.onMouseOver=function(t){return a(e,t)}),r.createElement("div",Os({style:p.swatch,onClick:function(t){return i(e,t)},title:s,tabIndex:0,onKeyDown:function(t){return 13===t.keyCode&&i(e,t)}},d),f,h&&r.createElement(zu,{borderRadius:p.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))});var Ms=function(t){var e=t.onChange,n=t.rgb,o=t.hsl,i=t.hex,a=t.disableAlpha,u=Lu({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:a}),s=function(t,r){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&&_(t).isValid()}(t.hex)&&e({hex:t.hex,source:"hex"},r):t.r||t.g||t.b?e({r:t.r||n.r,g:t.g||n.g,b:t.b||n.b,a:n.a,source:"rgb"},r):t.a&&(t.a<0?t.a=0:t.a>100&&(t.a=100),t.a/=100,e({h:o.h,s:o.s,l:o.l,a:t.a,source:"rgb"},r))};return r.createElement("div",{style:u.fields,className:"flexbox-fix"},r.createElement("div",{style:u.double},r.createElement(Xu,{style:{input:u.input,label:u.label},label:"hex",value:i.replace("#",""),onChange:s})),r.createElement("div",{style:u.single},r.createElement(Xu,{style:{input:u.input,label:u.label},label:"r",value:n.r,onChange:s,dragLabel:"true",dragMax:"255"})),r.createElement("div",{style:u.single},r.createElement(Xu,{style:{input:u.input,label:u.label},label:"g",value:n.g,onChange:s,dragLabel:"true",dragMax:"255"})),r.createElement("div",{style:u.single},r.createElement(Xu,{style:{input:u.input,label:u.label},label:"b",value:n.b,onChange:s,dragLabel:"true",dragMax:"255"})),r.createElement("div",{style:u.alpha},r.createElement(Xu,{style:{input:u.input,label:u.label},label:"a",value:Math.round(100*n.a),onChange:s,dragLabel:"true",dragMax:"100"})))};class Ss extends(o||i){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),f=u-(r.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>o&&(s=o),f<0?f=0:f>i&&(f=i);var c=s/o,l=1-f/i;return{h:e.h,s:c,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)},f=function(){var f=Date.now();u||!1!==r.leading||(u=f);var c=e-(f-u);return o=this,i=arguments,c<=0||c>e?(n&&(clearTimeout(n),n=null),u=f,a=t.apply(o,i),n||(o=i=null)):n||!1===r.trailing||(n=setTimeout(s,c)),a};return f.cancel=function(){clearTimeout(n),u=0,n=o=i=null},f}((t,e,r)=>{t(e,r)},50)}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:r,white:n,black:o,pointer:i,circle:a}=this.props||{},u={position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px"},s={color:{...u,backgroundColor:`hsl(${this.props.hsl?.h},100%, 50%)`,borderRadius:this.props.style?.borderRadius},white:{...u,borderRadius:this.props.style?.borderRadius},black:{...u,boxShadow:this.props.style?.boxShadow,borderRadius:this.props.style?.borderRadius},pointer:{...u,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("div",{style:s.color,ref:t=>this.container=t,onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange,children:[e("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("div",{style:s.white,className:"saturation-white",children:[e("div",{style:s.black,className:"saturation-black"}),e("div",{style:s.pointer,children:this.props.pointer?e(this.props.pointer,{...this.props}):e("div",{style:s.circle})})]})]})}}const ks=(t,e=null)=>{const r=t.hex?_(t.hex):_(t||"transparent"),n=r.toHsl(),o=r.toHsv(),i=r.toRgb(),a=r.toHex();return 0===n.s&&(n.h=e??0,o.h=e??0),{hsl:n,hex:"#"+a,rgb:i,hsv:o,source:t.source}},As=a(r=>{const{selectedColor:n,onColorChange:o,renderers:i,disableAlpha:a=!1,style:l=d.EmptyCssProperties,...h}=r,p=b(),[g,y]=u(()=>ks(n)),[m,w]=u(g.hsl.h??0),_=s(t=>{let e=ks(t,m);return w(e.hsl.h??0),y(e),e},[m]),x=s(t=>{const e=_(t),r=`rgba(${e.rgb.r},${e.rgb.g},${e.rgb.b},${a?1:e.rgb.a})`;o?.(r)},[o,_,a]);f(()=>{_(n)},[n,_]);const j=e("div",{style:{position:"relative",minHeight:"10px",maxHeight:"10px",width:"100%"},children:e($u,{style:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},rgb:g.rgb,hsl:g.hsl,renderers:i,onChange:x})});return t("div",{style:{display:"flex",flexDirection:"column",...l},...h,children:[e("div",{style:{width:"100%",flex:"1 1 100%",position:"relative",overflow:"hidden"},children:e(Ss,{style:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hsl:g.hsl,hsv:g.hsv,onChange:x})}),t("div",{style:{marginTop:"4px",display:"flex",gap:"4px"},children:[t("div",{style:{flex:"1",display:"flex",flexDirection:a?"row":"column",justifyContent:"space-between",alignItems:"center"},children:[e("div",{style:{position:"relative",minHeight:"10px",maxHeight:"10px",width:"100%"},children:e(Ku,{style:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hsl:g.hsl,onChange:x})}),a?null:j]}),t("div",{style:{minWidth:"24px",maxWidth:"24px",minHeight:"24px",maxHeight:"24px",position:"relative",borderRadius:"1px",overflow:"hidden"},children:[e(v,{grey:p.palette.text.icon??p.palette.action.active}),e("div",{style:{position:"absolute",height:"100%",width:"100%",background:`rgba(${g.rgb.r},${g.rgb.g},${g.rgb.b},${a?1:g.rgb.a})`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}})]})]}),e(c,{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:e(Ms,{rgb:g.rgb,hsl:g.hsl,hex:g.hex,disableAlpha:a,onChange:x})})]})});export{As as CustomColorPanel,As as default,ks as toState};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{memo as t,useRef as i,useState as o,useEffect as l,useLayoutEffect as r,useMemo as s}from"react";import{DialogContent as a,Box as c,TextField as p,InputAdornment as d,Collapse as u,MenuItem as f,FormControl as m,InputLabel as g,Select as x}from"@mui/material";import{ArrowBack as h,ArrowUpward as O,ArrowForward as C,ArrowDownward as y}from"@mui/icons-material";import{ICell as b,IRange as T}from"@sheetxl/sdk";import{B as v,L as k,b as R,O as E,U as S,f as F,X as I,S as w,q as D,h as K,K as P,i as $,a as A,Q as M,J as B,n as L}from"./BPMMuKIe5xb3-D8V.mjs";import{alpha as V}from"@mui/system";const j=t(t=>{const{label:i,value:r,options:a,onSelect:c,tabIndex:p=0,...d}=t,[u,h]=o(()=>X(r,a));l(()=>{h(X(r,a))},[r,a]);const O=v(e=>{h(e.target.value),c?.(a[e.target.value])},[c,a]),C=s(()=>Object.keys(a).map(n=>e(f,{value:n,children:n},n)),[a]);return n(m,{sx:{minWidth:135},size:"small",children:[e(g,{children:i}),e(x,{inputProps:{tabIndex:p},value:u,label:i,onChange:O,sx:{backgroundImage:`linear-gradient(${V("#fff",A(5))}, ${V("#fff",A(5))})`},...d,children:C})]})}),N={Workbook:"workbook",Sheet:"sheet"},W={enter:140,exit:140},H={Formulas:b.Content.Formulas,Values:b.Content.Values,Notes:b.Content.Notes,Comments:b.Content.Comments},z={...H};delete z.Values;const U={"By Rows":!0,"By Columns":!1},X=(e,n)=>{const t=Object.keys(n);for(let i=0;i<t.length;i++){const o=t[i];if(n[o]===e)return o}},q=t(t=>{const{replace:s=!1,findText:f,replaceText:m,findOptions:g,replaceOptions:x,title:X,onHide:q,onFindOrReplace:G,...J}=t,Q=i(null),Y=i(null),Z=i(null),_=i(null),ee=i(null),ne=i(null),te=(e,n)=>{if(!n)return;n.start(e,{center:!1}),setTimeout(()=>n.stop(e),180)},[ie,oe]=o(!1),[le,re]=o(!1),[se,ae]=o(s),[ce,pe]=o(!1),[de,ue]=o(!1),[fe,me]=o({findText:null,replaceText:null,replace:s,replaceOptions:{},findOptions:{matchCase:!1,matchEntireCell:!1,useRegex:!1,orientation:T.Orientation.Row,fields:[b.Content.Formulas]},scope:N.Sheet}),ge=v(async(e,n,t,i)=>{if(!G)return;const o={...fe};o.replaceOptions={...o.replaceOptions},o.findOptions={...o.findOptions},o.replaceOptions.maxCount=t?void 0:1,o.replace=n,n&&fe.findOptions.fields?.[0]===b.Content.Values&&(o.findOptions.fields=[b.Content.Formulas]),o.findOptions.reverse=!e;const l=await G({autoFocus:i,...o});pe(0===l)},[fe,G]);l(()=>{pe(!1)},[fe,le,se]);const xe=v((e,n)=>{if(e.keyCode===k.Enter){if(!fe.findText)return;let t=!0,i=!1;e.shiftKey&&(t=!1),n?(e.ctrlKey&&e.altKey&&(i=!0),te(e,i?ne.current:ee.current)):te(e,t?_.current:Z.current),ge(t,n,i,!1)}},[fe]),he=i(null);r(()=>{me(e=>{const n={...e};n.findText=f&&f.length>0?f:e.findText??"",oe(!0),void 0!==m&&(n.replaceText=m),g&&(n.findOptions={...n.findOptions,...g}),n.replaceText||(n.replaceText=""),n.replaceOptions&&(n.replaceOptions={...n.replaceOptions}),x&&(n.replaceOptions={...n.replaceOptions,...x}),fe.findOptions.fields?.[0]||(fe.findOptions.fields=[b.Content.Formulas]);const t=!(!x&&void 0===m);return t&&ae(t),n}),de||he.current?.focus()},[f,m,g,x]),l(()=>{se?(fe.findOptions.fields[0],b.Content.Values):oe(!0)},[se]),l(()=>{if(ie&&Q.current&&fe.findText===Q.current.value)return Q.current===document.activeElement||Q.current.contains(document.activeElement)?(Q.current?.select(),void oe(!1)):void Q.current.addEventListener("focus",()=>{Q.current?.select(),oe(!1)},{once:!0})},[ie,fe]);const[Oe,{width:Ce}]=R();return e(E,{ref:he,title:X??(se?"Find & Replace":"Find"),initialPosition:{y:"35"},autoFocusSel:".input",onHide:q,onFocus:()=>ue(!0),onBlur:()=>{ue(!1),pe(!1)},PaperProps:{elevation:de?3:1},...J,children:n(a,{dividers:!0,ref:Oe,sx:{display:"flex",flexDirection:"column",paddingLeft:e=>e.spacing(1.5),paddingRight:e=>e.spacing(1.5)},onKeyDown:e=>{if("h"===e.key&&e.ctrlKey)ae(!0),Q.current?.contains(document.activeElement)&&Y.current?.focus();else if("f"===e.key&&e.ctrlKey)Q.current?.focus();else if("c"===e.key&&e.altKey)me(e=>{const n={...e};return n.findOptions.matchCase=!e.findOptions.matchCase,n});else if("e"===e.key&&e.altKey)me(e=>{const n={...e};return n.findOptions.matchEntireCell=!e.findOptions.matchEntireCell,n});else{if("r"!==e.key||!e.altKey)return;me(e=>{const n={...e};return n.findOptions.useRegex=!e.findOptions.useRegex,n})}e.preventDefault()},children:[n(c,{sx:{display:"flex",flexDirection:"row",gap:e=>e.spacing(1)},children:[n(c,{sx:{display:"flex",flexDirection:"row",alignItems:"start",gap:e=>e.spacing(.25),paddingTop:"3px"},children:[e(S,{selected:le,onSelectToggle:e=>{re(e)},preventFocus:!0,label:"Toggle Additional Options",icon:F(e(I,{}))}),e(S,{selected:se,onSelectToggle:e=>{ae(e)},preventFocus:!0,label:"Toggle Replace",icon:F(e(D,{})),shortcut:{key:se?"F":"H",modifiers:[w.Ctrl]}})]}),n(c,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box"},children:[n(c,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e(p,{label:"Find",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),minWidth:Ce>460?"20em":void 0,backgroundImage:`linear-gradient(${V("#fff",A(5))}, ${V("#fff",A(5))})`},inputProps:{draggable:!1,ref:Q,className:"input",autoFocus:!0,spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}},endAdornment:e(d,{sx:{transform:"scale(0.75) translateX(16px)"},position:"end",children:n(c,{sx:{display:"flex",alignItems:"center",flexDirection:"row",gap:"1px"},children:[e(S,{selected:fe.findOptions.matchCase,onSelectToggle:e=>{me(n=>{const t={...n};return t.findOptions.matchCase=e,t})},label:"Match Case",shortcut:{key:"C",modifiers:[w.Alt]},icon:F(e(K,{}))}),e(S,{selected:fe.findOptions.matchEntireCell,onSelectToggle:e=>{me(n=>{const t={...n};return t.findOptions.matchEntireCell=e,t})},label:"Match Entire Cell",shortcut:{key:"E",modifiers:[w.Alt]},icon:F(e(P,{}))}),e(S,{selected:fe.findOptions.useRegex,onSelectToggle:e=>{me(n=>{const t={...n};return t.findOptions.useRegex=e,t})},label:"Use Regular Expression",shortcut:{key:"R",modifiers:[w.Alt]},icon:F(e($,{}))})]})})},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1),"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>ce?`${e.palette.error.main} !important`:void 0},"& .MuiInputLabel-outlined":{color:e=>ce?`${e.palette.error.main} !important`:void 0}},value:fe.findText??"",onChange:e=>{me(n=>{const t={...n};return t.findText=e.target.value,t})},onKeyDown:e=>xe(e,!1),onContextMenu:e=>{e.stopPropagation()}}),e(S,{selected:fe.findOptions.reverse,onSelectToggle:e=>{ge(!1,!1)},touchRippleRef:Z,label:"",shortcut:{key:"Enter",modifiers:[w.Shift]},icon:F(fe.findOptions.orientation!==T.Orientation.Column?e(h,{}):e(O,{})),disabled:!fe.findText}),e(S,{selected:!fe.findOptions.reverse,onSelectToggle:e=>{ge(!0,!1)},touchRippleRef:_,label:"Next Match",shortcut:{key:"Enter"},icon:F(fe.findOptions.orientation!==T.Orientation.Column?e(C,{}):e(y,{})),disabled:!fe.findText})]}),e(u,{in:se,timeout:W,onExit:()=>{Q.current?.focus()},children:n(c,{sx:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:e=>e.spacing(2)},children:[e(p,{label:"Replace",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),backgroundImage:`linear-gradient(${V("#fff",A(5))}, ${V("#fff",A(5))})`},inputProps:{ref:Y,className:"input",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}}},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1)},value:fe.replaceText??"",onChange:e=>{me(n=>{const t={...n};return t.replaceText=e.target.value,t})},onKeyDown:e=>xe(e,!0),onContextMenu:e=>{e.stopPropagation()}}),e(S,{onSelectToggle:e=>{ge(!0,!0)},touchRippleRef:ee,label:"Replace",shortcut:{key:"Enter"},icon:F(e(M,{})),disabled:!fe.findText}),e(S,{onSelectToggle:e=>{ge(!0,!0,!0)},touchRippleRef:ne,label:"Replace All",shortcut:{key:"Enter",modifiers:[w.Ctrl,w.Alt]},icon:F(e(B,{})),disabled:!fe.findText})]})})]})]}),e(u,{in:le,timeout:W,onExit:()=>{Q.current?.focus()},children:n(c,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:e=>e.spacing(.5),marginTop:e=>e.spacing(1)},children:[e(L,{orientation:"horizontal",sx:{marginBottom:e=>e.spacing(1.5)}}),n(c,{sx:{display:"flex",flexDirection:Ce>=413?"row":"column",justifyContent:"space-evenly",alignItems:"center",rowGap:e=>e.spacing(2)},tabIndex:-1,children:[e(j,{label:"Within",value:fe.scope,options:N,onSelect:e=>{me(n=>{const t={...n};return t.scope=e,t})}}),e(j,{label:"Search",value:fe.findOptions.orientation!==T.Orientation.Column,options:U,onSelect:e=>{me(n=>{const t={...n};return t.findOptions.orientation=e?T.Orientation.Row:T.Orientation.Column,t})}}),e(j,{label:"Look in",value:se&&fe.findOptions.fields?.[0]===b.Content.Values?b.Content.Formulas:fe.findOptions.fields?.[0],options:se?z:H,onSelect:e=>{me(n=>{const t={...n};return t.findOptions.fields=[e],t})}})]})]})})]})})});export{q as FindReplaceWindow,N as ScopeOptions,q as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useState as t}from"react";import{Box as o,FormControlLabel as i,Checkbox as l}from"@mui/material";import{Sort as r,IRange as a}from"@sheetxl/sdk";import{B as s,p as c}from"./BPMMuKIe5xb3-D8V.mjs";const d=({range:d,options:m,cell:p,onDone:h,...u})=>{const[v,C]=t(m??r.DefaultRangeOptions),O=s(e=>{let n=null;"Sort"===e&&(n={...m,options:v}),h?.(n)},[v,h,m]);return e(c,{title:"Sort",options:["Sort","Cancel"],onDone:O,...u,children:n(o,{sx:{display:"flex",flexDirection:"column"},children:[e(i,{control:e(l,{checked:!v.reverse,onChange:()=>C(e=>({...e,reverse:!e.reverse}))}),label:"Is Ascending",labelPlacement:"end"}),e(i,{control:e(l,{checked:v.hasHeader,onChange:()=>C(e=>({...e,hasHeader:!e.hasHeader}))}),label:"Has Header",labelPlacement:"end"}),e(i,{control:e(l,{checked:v.collatorOptions?.sensitivity===r.CaseSensitiveOptions.sensitivity,onChange:()=>C(e=>({...e,collatorOptions:v.collatorOptions?.sensitivity===r.CaseSensitiveOptions.sensitivity?r.CaseInsensitiveOptions:r.CaseSensitiveOptions}))}),label:"Case Sensitive",labelPlacement:"end"}),e(i,{control:e(l,{checked:v.orientation===a.Orientation.Row,onChange:()=>C(e=>{const n=e.orientation===a.Orientation.Row?a.Orientation.Column:a.Orientation.Row;return{...d.getDefaultSortCriteria(n,p).options,includeHidden:e.includeHidden,reverse:e.reverse,orientation:n}})}),label:"Row Sort",labelPlacement:"end"}),e(i,{control:e(l,{checked:v.includeHidden,onChange:()=>C(e=>({...e,includeHidden:!e.includeHidden}))}),label:"Include Hidden",labelPlacement:"end"})]})})};export{d as SortDialog,d as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
|
|
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
|
-
function t(t){return Array.isArray?Array.isArray(t):"[object Array]"===c(t)}function e(t){return"string"==typeof t}function n(t){return"number"==typeof t}function s(t){return!0===t||!1===t||function(t){return i(t)&&null!==t}(t)&&"[object Boolean]"==c(t)}function i(t){return"object"==typeof t}function r(t){return null!=t}function u(t){return!t.trim().length}function c(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const o=Object.prototype.hasOwnProperty;class h{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(t=>{let n=a(t);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(t=>{t.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function a(n){let s=null,i=null,r=null,u=1,c=null;if(e(n)||t(n))r=n,s=l(n),i=d(n);else{if(!o.call(n,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const t=n.name;if(r=t,o.call(n,"weight")&&(u=n.weight,u<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(t));s=l(t),i=d(t),c=n.getFn}return{path:s,id:i,weight:u,src:r,getFn:c}}function l(e){return t(e)?e:e.split(".")}function d(e){return t(e)?e.join("."):e}var g={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(i,u){let c=[],o=!1;const h=(i,u,a)=>{if(r(i))if(u[a]){const l=i[u[a]];if(!r(l))return;if(a===u.length-1&&(e(l)||n(l)||s(l)))c.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(l));else if(t(l)){o=!0;for(let t=0,e=l.length;t<e;t+=1)h(l[t],u,a+1)}else u.length&&h(l,u,a+1)}else c.push(i)};return h(i,e(u)?u.split("."):u,0),o?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const f=/[^ ]+/g;class A{constructor({getFn:t=g.getFn,fieldNormWeight:e=g.fieldNormWeight}={}){this.norm=function(t=1,e=3){const n=new Map,s=Math.pow(10,e);return{get(e){const i=e.match(f).length;if(n.has(i))return n.get(i);const r=1/Math.pow(i,.5*t),u=parseFloat(Math.round(r*s)/s);return n.set(i,u),u},clear(){n.clear()}}}(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((t,e)=>{this._keysMap[t.id]=e})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,e(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const n=this.size();e(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let e=t,n=this.size();e<n;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!r(t)||u(t))return;let n={v:t,i:e,n:this.norm.get(t)};this.records.push(n)}_addObject(n,s){let i={i:s,$:{}};this.keys.forEach((s,c)=>{let o=s.getFn?s.getFn(n):this.getFn(n,s.path);if(r(o))if(t(o)){let n=[];const s=[{nestedArrIndex:-1,value:o}];for(;s.length;){const{nestedArrIndex:i,value:c}=s.pop();if(r(c))if(e(c)&&!u(c)){let t={v:c,i:i,n:this.norm.get(c)};n.push(t)}else t(c)&&c.forEach((t,e)=>{s.push({nestedArrIndex:e,value:t})})}i.$[c]=n}else if(e(o)&&!u(o)){let t={v:o,n:this.norm.get(o)};i.$[c]=t}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function p(t,e,{getFn:n=g.getFn,fieldNormWeight:s=g.fieldNormWeight}={}){const i=new A({getFn:n,fieldNormWeight:s});return i.setKeys(t.map(a)),i.setSources(e),i.create(),i}function C(t,{errors:e=0,currentLocation:n=0,expectedLocation:s=0,distance:i=g.distance,ignoreLocation:r=g.ignoreLocation}={}){const u=e/t.length;if(r)return u;const c=Math.abs(s-n);return i?u+c/i:c?1:u}const m=32;function F(t,e,n,{location:s=g.location,distance:i=g.distance,threshold:r=g.threshold,findAllMatches:u=g.findAllMatches,minMatchCharLength:c=g.minMatchCharLength,includeMatches:o=g.includeMatches,ignoreLocation:h=g.ignoreLocation}={}){if(e.length>m)throw new Error(`Pattern length exceeds max of ${m}.`);const a=e.length,l=t.length,d=Math.max(0,Math.min(s,l));let f=r,A=d;const p=c>1||o,F=p?Array(l):[];let M;for(;(M=t.indexOf(e,A))>-1;){let t=C(e,{currentLocation:M,expectedLocation:d,distance:i,ignoreLocation:h});if(f=Math.min(t,f),A=M+a,p){let t=0;for(;t<a;)F[M+t]=1,t+=1}}A=-1;let E=[],D=1,y=a+l;const B=1<<a-1;for(let s=0;s<a;s+=1){let r=0,c=y;for(;r<c;){C(e,{errors:s,currentLocation:d+c,expectedLocation:d,distance:i,ignoreLocation:h})<=f?r=c:y=c,c=Math.floor((y-r)/2+r)}y=c;let o=Math.max(1,d-c+1),g=u?l:Math.min(d+c,l)+a,m=Array(g+2);m[g+1]=(1<<s)-1;for(let r=g;r>=o;r-=1){let u=r-1,c=n[t.charAt(u)];if(p&&(F[u]=+!!c),m[r]=(m[r+1]<<1|1)&c,s&&(m[r]|=(E[r+1]|E[r])<<1|1|E[r+1]),m[r]&B&&(D=C(e,{errors:s,currentLocation:u,expectedLocation:d,distance:i,ignoreLocation:h}),D<=f)){if(f=D,A=u,A<=d)break;o=Math.max(1,2*d-A)}}if(C(e,{errors:s+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:h})>f)break;E=m}const x={isMatch:A>=0,score:Math.max(.001,D)};if(p){const t=function(t=[],e=g.minMatchCharLength){let n=[],s=-1,i=-1,r=0;for(let u=t.length;r<u;r+=1){let u=t[r];u&&-1===s?s=r:u||-1===s||(i=r-1,i-s+1>=e&&n.push([s,i]),s=-1)}return t[r-1]&&r-s>=e&&n.push([s,r-1]),n}(F,c);t.length?o&&(x.indices=t):x.isMatch=!1}return x}function M(t){let e={};for(let n=0,s=t.length;n<s;n+=1){const i=t.charAt(n);e[i]=(e[i]||0)|1<<s-n-1}return e}const E=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):t=>t;class D{constructor(t,{location:e=g.location,threshold:n=g.threshold,distance:s=g.distance,includeMatches:i=g.includeMatches,findAllMatches:r=g.findAllMatches,minMatchCharLength:u=g.minMatchCharLength,isCaseSensitive:c=g.isCaseSensitive,ignoreDiacritics:o=g.ignoreDiacritics,ignoreLocation:h=g.ignoreLocation}={}){if(this.options={location:e,threshold:n,distance:s,includeMatches:i,findAllMatches:r,minMatchCharLength:u,isCaseSensitive:c,ignoreDiacritics:o,ignoreLocation:h},t=c?t:t.toLowerCase(),t=o?E(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const a=(t,e)=>{this.chunks.push({pattern:t,alphabet:M(t),startIndex:e})},l=this.pattern.length;if(l>m){let t=0;const e=l%m,n=l-e;for(;t<n;)a(this.pattern.substr(t,m),t),t+=m;if(e){const t=l-m;a(this.pattern.substr(t),t)}}else a(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,ignoreDiacritics:n,includeMatches:s}=this.options;if(t=e?t:t.toLowerCase(),t=n?E(t):t,this.pattern===t){let e={isMatch:!0,score:0};return s&&(e.indices=[[0,t.length-1]]),e}const{location:i,distance:r,threshold:u,findAllMatches:c,minMatchCharLength:o,ignoreLocation:h}=this.options;let a=[],l=0,d=!1;this.chunks.forEach(({pattern:e,alphabet:n,startIndex:g})=>{const{isMatch:f,score:A,indices:p}=F(t,e,n,{location:i+g,distance:r,threshold:u,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:h});f&&(d=!0),l+=A,f&&p&&(a=[...a,...p])});let g={isMatch:d,score:d?l/this.chunks.length:1};return d&&s&&(g.indices=a),g}}class y{constructor(t){this.pattern=t}static isMultiMatch(t){return B(t,this.multiRegex)}static isSingleMatch(t){return B(t,this.singleRegex)}search(){}}function B(t,e){const n=t.match(e);return n?n[1]:null}class x extends y{constructor(t,{location:e=g.location,threshold:n=g.threshold,distance:s=g.distance,includeMatches:i=g.includeMatches,findAllMatches:r=g.findAllMatches,minMatchCharLength:u=g.minMatchCharLength,isCaseSensitive:c=g.isCaseSensitive,ignoreDiacritics:o=g.ignoreDiacritics,ignoreLocation:h=g.ignoreLocation}={}){super(t),this._bitapSearch=new D(t,{location:e,threshold:n,distance:s,includeMatches:i,findAllMatches:r,minMatchCharLength:u,isCaseSensitive:c,ignoreDiacritics:o,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class L extends y{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,n=0;const s=[],i=this.pattern.length;for(;(e=t.indexOf(this.pattern,n))>-1;)n=e+i,s.push([e,n-1]);const r=!!s.length;return{isMatch:r,score:r?0:1,indices:s}}}const k=[class extends y{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},L,class extends y{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends y{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends y{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends y{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends y{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},x],_=k.length,v=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const S=new Set([x.type,L.type]);class I{constructor(t,{isCaseSensitive:e=g.isCaseSensitive,ignoreDiacritics:n=g.ignoreDiacritics,includeMatches:s=g.includeMatches,minMatchCharLength:i=g.minMatchCharLength,ignoreLocation:r=g.ignoreLocation,findAllMatches:u=g.findAllMatches,location:c=g.location,threshold:o=g.threshold,distance:h=g.distance}={}){this.query=null,this.options={isCaseSensitive:e,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:i,findAllMatches:u,ignoreLocation:r,location:c,threshold:o,distance:h},t=e?t:t.toLowerCase(),t=n?E(t):t,this.pattern=t,this.query=function(t,e={}){return t.split("|").map(t=>{let n=t.trim().split(v).filter(t=>t&&!!t.trim()),s=[];for(let t=0,i=n.length;t<i;t+=1){const i=n[t];let r=!1,u=-1;for(;!r&&++u<_;){const t=k[u];let n=t.isMultiMatch(i);n&&(s.push(new t(n,e)),r=!0)}if(!r)for(u=-1;++u<_;){const t=k[u];let n=t.isSingleMatch(i);if(n){s.push(new t(n,e));break}}}return s})}(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:i}=this.options;t=s?t:t.toLowerCase(),t=i?E(t):t;let r=0,u=[],c=0;for(let s=0,i=e.length;s<i;s+=1){const i=e[s];u.length=0,r=0;for(let e=0,s=i.length;e<s;e+=1){const s=i[e],{isMatch:o,indices:h,score:a}=s.search(t);if(!o){c=0,r=0,u.length=0;break}if(r+=1,c+=a,n){const t=s.constructor.type;S.has(t)?u=[...u,...h]:u.push(h)}}if(r){let t={isMatch:!0,score:c/r};return n&&(t.indices=u),t}}return{isMatch:!1,score:1}}}const w=[];function $(t,e){for(let n=0,s=w.length;n<s;n+=1){let s=w[n];if(s.condition(t,e))return new s(t,e)}return new D(t,e)}const b="$and",N="$or",R="$path",O="$val",j=t=>!(!t[b]&&!t[N]),W=t=>({[b]:Object.keys(t).map(e=>({[e]:t[e]}))});function z(n,s,{auto:r=!0}={}){const u=n=>{let c=Object.keys(n);const o=(t=>!!t[R])(n);if(!o&&c.length>1&&!j(n))return u(W(n));if((e=>!t(e)&&i(e)&&!j(e))(n)){const t=o?n[R]:c[0],i=o?n[O]:n[t];if(!e(i))throw new Error((t=>`Invalid value for key ${t}`)(t));const u={keyId:d(t),pattern:i};return r&&(u.searcher=$(i,s)),u}let h={children:[],operator:c[0]};return c.forEach(e=>{const s=n[e];t(s)&&s.forEach(t=>{h.children.push(u(t))})}),h};return j(n)||(n=W(n)),u(n)}function K(t,e){const n=t.matches;e.matches=[],r(n)&&n.forEach(t=>{if(!r(t.indices)||!t.indices.length)return;const{indices:n,value:s}=t;let i={indices:n,value:s};t.key&&(i.key=t.key.src),t.idx>-1&&(i.refIndex=t.idx),e.matches.push(i)})}function P(t,e){e.score=t.score}class q{constructor(t,e={},n){this.options={...g,...e},this.options.useExtendedSearch,this._keyStore=new h(this.options.keys),this.setCollection(t,n)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof A))throw new Error("Incorrect 'index' type");this._myIndex=e||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){r(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let n=0,s=this._docs.length;n<s;n+=1){const i=this._docs[n];t(i,n)&&(this.removeAt(n),n-=1,s-=1,e.push(i))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:s=-1}={}){const{includeMatches:i,includeScore:r,shouldSort:u,sortFn:c,ignoreFieldNorm:o}=this.options;let h=e(t)?e(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,{ignoreFieldNorm:e=g.ignoreFieldNorm}){t.forEach(t=>{let n=1;t.matches.forEach(({key:t,norm:s,score:i})=>{const r=t?t.weight:null;n*=Math.pow(0===i&&r?Number.EPSILON:i,(r||1)*(e?1:s))}),t.score=n})}(h,{ignoreFieldNorm:o}),u&&h.sort(c),n(s)&&s>-1&&(h=h.slice(0,s)),function(t,e,{includeMatches:n=g.includeMatches,includeScore:s=g.includeScore}={}){const i=[];return n&&i.push(K),s&&i.push(P),t.map(t=>{const{idx:n}=t,s={item:e[n],refIndex:n};return i.length&&i.forEach(e=>{e(t,s)}),s})}(h,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(t){const e=$(t,this.options),{records:n}=this._myIndex,s=[];return n.forEach(({v:t,i:n,n:i})=>{if(!r(t))return;const{isMatch:u,score:c,indices:o}=e.searchIn(t);u&&s.push({item:t,idx:n,matches:[{score:c,value:t,norm:i,indices:o}]})}),s}_searchLogical(t){const e=z(t,this.options),n=(t,e,s)=>{if(!t.children){const{keyId:n,searcher:i}=t,r=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(e,n),searcher:i});return r&&r.length?[{idx:s,item:e,matches:r}]:[]}const i=[];for(let r=0,u=t.children.length;r<u;r+=1){const u=t.children[r],c=n(u,e,s);if(c.length)i.push(...c);else if(t.operator===b)return[]}return i},s=this._myIndex.records,i={},u=[];return s.forEach(({$:t,i:s})=>{if(r(t)){let r=n(e,t,s);r.length&&(i[s]||(i[s]={idx:s,item:t,matches:[]},u.push(i[s])),r.forEach(({matches:t})=>{i[s].matches.push(...t)}))}}),u}_searchObjectList(t){const e=$(t,this.options),{keys:n,records:s}=this._myIndex,i=[];return s.forEach(({$:t,i:s})=>{if(!r(t))return;let u=[];n.forEach((n,s)=>{u.push(...this._findMatches({key:n,value:t[s],searcher:e}))}),u.length&&i.push({idx:s,item:t,matches:u})}),i}_findMatches({key:e,value:n,searcher:s}){if(!r(n))return[];let i=[];if(t(n))n.forEach(({v:t,i:n,n:u})=>{if(!r(t))return;const{isMatch:c,score:o,indices:h}=s.searchIn(t);c&&i.push({score:o,key:e,value:t,idx:n,norm:u,indices:h})});else{const{v:t,n:r}=n,{isMatch:u,score:c,indices:o}=s.searchIn(t);u&&i.push({score:c,key:e,value:t,norm:r,indices:o})}return i}}q.version="7.1.0",q.createIndex=p,q.parseIndex=function(t,{getFn:e=g.getFn,fieldNormWeight:n=g.fieldNormWeight}={}){const{keys:s,records:i}=t,r=new A({getFn:e,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(i),r},q.config=g,q.parseQuery=z,function(...t){w.push(...t)}(I);export{q as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{memo as t,useState as a,useCallback as o}from"react";import{Box as i,FormControlLabel as s,Checkbox as l}from"@mui/material";import{B as r,p,R as c}from"./BPMMuKIe5xb3-D8V.mjs";const d=["Ok","Cancel"],m=t(t=>{const{tableOptions:m,context:g,onOption:u,onValidateOption:f,onDone:h,options:O=d,defaultOption:x=O?.[0],cancelOption:b="Cancel",sx:C,...D}=t,[N,T]=a(!1),[j,k]=a(()=>m?.hasHeader??!1),[v,w]=a(()=>m?.ranges??null),y=r(e=>{const n={...m,hasHeader:j,ranges:v};u?.(e,e===b,e===x),h?.({option:e,tableOptions:n})},[h,u,x,b,j,v,m]),F=o(async(e,n)=>null,[]);return e(p,{title:"Insert Table",options:O,onDone:y,onValidateOption:F,defaultOption:x,cancelOption:b,autoFocusSel:".range-input input",sx:{width:"360px",...C},...D,children:n(i,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[e(c,{formName:"range",value:v,onChangeInput:e=>w(e),resolvedAddress:g.getNames().getRanges.bind(g.getNames()),onFocus:e=>{N||e.target?.select(),T(!0)}}),e(s,{control:e(l,{checked:j,onChange:()=>k(!j)}),label:"Table has headers",labelPlacement:"end"})]})})});export{m as TableNewDialog,m as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
|
|
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 e,{memo as t,useState as r,useRef as n,useCallback as o,useEffect as i}from"react";function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function g(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(r,[].concat(o,n))}}}function p(e){return{}.toString.call(e).includes("Object")}function h(e){return"function"==typeof e}var y=g(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),m=function(e,t){return p(t)||y("changeType"),Object.keys(t).some(function(t){return r=e,n=t,!Object.prototype.hasOwnProperty.call(r,n);var r,n})&&y("changeField"),t},v=function(e){h(e)||y("selectorType")},b=function(e){h(e)||p(e)||y("handlerType"),p(e)&&Object.values(e).some(function(e){return!h(e)})&&y("handlersType")},w=function(e){var t;e||y("initialIsRequired"),p(e)||y("initialType"),t=e,Object.keys(t).length||y("initialContent")};function O(e,t){return h(t)?t(e.current):t}function j(e,t){return e.current=f(f({},e.current),t),t}function M(e,t,r){return h(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null===(n=t[r])||void 0===n?void 0:n.call(t,e.current[r])}),r}var P,E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(e),b(t);var r={current:e},n=g(M)(r,t),o=g(j)(r),i=g(m)(e),c=g(O)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return v(e),e(r.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(n,o,i,c)(e)}]},S={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},k=(P=function(e,t){throw new Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.length>=P.length?P.apply(this,n):function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e.apply(t,[].concat(n,o))}})(S),x=function(e){var t;return e||k("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||k("configType"),e.urls?(console.warn(S.deprecation),{paths:{vs:e.urls.monacoBase}}):e};function I(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],I(e[r],t[r]))}),a(a({},e),t)}var T={type:"cancelation",msg:"operation is manually canceled"};function A(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(T):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var D,V=function(e){if(Array.isArray(e))return e}(D=E({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var t=[],r=!0,n=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(t.push(i.value),2!==t.length);r=!0);}catch(e){n=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(n)throw o}}return t}}(D)||function(e){if(e){if("string"==typeof e)return l(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(e,2):void 0}}(D)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),C=V[0],L=V[1];function R(e){return document.body.appendChild(e)}function q(e){var t,r,n=C(function(e){return{config:e.config,reject:e.reject}}),o=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return o.onload=function(){return e()},o.onerror=n.reject,o}function z(){var e=C(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){_(t),e.resolve(t)},function(t){e.reject(t)})}function _(e){C().monaco||L({monaco:e})}var N=new Promise(function(e,t){return L({resolve:e,reject:t})}),F={config:function(e){var t=x(e),r=t.monaco,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,["monaco"]);L(function(e){return{config:I(e.config,n),monaco:r}})},init:function(){var e=C(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(L({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),A(N);if(window.monaco&&window.monaco.editor)return _(window.monaco),e.resolve(window.monaco),A(N);!function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(R,q)(z)}return A(N)},__getMonacoInstance:function(){return C(function(e){return e.monaco})}},U={display:"flex",position:"relative",textAlign:"initial"},B={width:"100%"},Y={display:"none"},$={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},G=function({children:t}){return e.createElement("div",{style:$.container},t)},H=t(function({width:t,height:r,isEditorReady:n,loading:o,_ref:i,className:c,wrapperProps:u}){return e.createElement("section",{style:{...U,width:t,height:r},...u},!n&&e.createElement(G,null,o),e.createElement("div",{ref:i,style:{...B,...!n&&Y},className:c}))}),J=function(e){i(e,[])},K=function(e,t,r=!0){let o=n(!0);i(o.current||!r?()=>{o.current=!1}:e,t)};function Q(){}function W(e,t,r,n){return function(e,t){return e.editor.getModel(X(e,t))}(e,n)||function(e,t,r,n){return e.editor.createModel(t,r,n?X(e,n):void 0)}(e,t,r,n)}function X(e,t){return e.Uri.parse(t)}var Z=t(function({original:t,modified:c,language:u,originalLanguage:a,modifiedLanguage:l,originalModelPath:s,modifiedModelPath:d,keepCurrentOriginalModel:f=!1,keepCurrentModifiedModel:g=!1,theme:p="light",loading:h="Loading...",options:y={},height:m="100%",width:v="100%",className:b,wrapperProps:w={},beforeMount:O=Q,onMount:j=Q}){let[M,P]=r(!1),[E,S]=r(!0),k=n(null),x=n(null),I=n(null),T=n(j),A=n(O),D=n(!1);J(()=>{let e=F.init();return e.then(e=>(x.current=e)&&S(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>k.current?function(){let e=k.current?.getModel();f||e?.original?.dispose(),g||e?.modified?.dispose(),k.current?.dispose()}():e.cancel()}),K(()=>{if(k.current&&x.current){let e=k.current.getOriginalEditor(),r=W(x.current,t||"",a||u||"text",s||"");r!==e.getModel()&&e.setModel(r)}},[s],M),K(()=>{if(k.current&&x.current){let e=k.current.getModifiedEditor(),t=W(x.current,c||"",l||u||"text",d||"");t!==e.getModel()&&e.setModel(t)}},[d],M),K(()=>{let e=k.current.getModifiedEditor();e.getOption(x.current.editor.EditorOption.readOnly)?e.setValue(c||""):c!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:c||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[c],M),K(()=>{k.current?.getModel()?.original.setValue(t||"")},[t],M),K(()=>{let{original:e,modified:t}=k.current.getModel();x.current.editor.setModelLanguage(e,a||u||"text"),x.current.editor.setModelLanguage(t,l||u||"text")},[u,a,l],M),K(()=>{x.current?.editor.setTheme(p)},[p],M),K(()=>{k.current?.updateOptions(y)},[y],M);let V=o(()=>{if(!x.current)return;A.current(x.current);let e=W(x.current,t||"",a||u||"text",s||""),r=W(x.current,c||"",l||u||"text",d||"");k.current?.setModel({original:e,modified:r})},[u,c,l,t,a,s,d]),C=o(()=>{!D.current&&I.current&&(k.current=x.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...y}),V(),x.current?.editor.setTheme(p),P(!0),D.current=!0)},[y,p,V]);return i(()=>{M&&T.current(k.current,x.current)},[M]),i(()=>{!E&&!M&&C()},[E,M,C]),e.createElement(H,{width:v,height:m,isEditorReady:M,loading:h,_ref:I,className:b,wrapperProps:w})}),ee=function(){let[e,t]=r(F.__getMonacoInstance());return J(()=>{let r;return e||(r=F.init(),r.then(e=>{t(e)})),()=>r?.cancel()}),e},te=new Map,re=t(function({defaultValue:t,defaultLanguage:c,defaultPath:u,value:a,language:l,path:s,theme:d="light",line:f,loading:g="Loading...",options:p={},overrideServices:h={},saveViewState:y=!0,keepCurrentModel:m=!1,width:v="100%",height:b="100%",className:w,wrapperProps:O={},beforeMount:j=Q,onMount:M=Q,onChange:P,onValidate:E=Q}){let[S,k]=r(!1),[x,I]=r(!0),T=n(null),A=n(null),D=n(null),V=n(M),C=n(j),L=n(),R=n(a),q=function(e){let t=n();return i(()=>{t.current=e},[e]),t.current}(s),z=n(!1),_=n(!1);J(()=>{let e=F.init();return e.then(e=>(T.current=e)&&I(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>A.current?(L.current?.dispose(),m?y&&te.set(s,A.current.saveViewState()):A.current.getModel()?.dispose(),void A.current.dispose()):e.cancel()}),K(()=>{let e=W(T.current,t||a||"",c||l||"",s||u||"");e!==A.current?.getModel()&&(y&&te.set(q,A.current?.saveViewState()),A.current?.setModel(e),y&&A.current?.restoreViewState(te.get(s)))},[s],S),K(()=>{A.current?.updateOptions(p)},[p],S),K(()=>{!A.current||void 0===a||(A.current.getOption(T.current.editor.EditorOption.readOnly)?A.current.setValue(a):a!==A.current.getValue()&&(_.current=!0,A.current.executeEdits("",[{range:A.current.getModel().getFullModelRange(),text:a,forceMoveMarkers:!0}]),A.current.pushUndoStop(),_.current=!1))},[a],S),K(()=>{let e=A.current?.getModel();e&&l&&T.current?.editor.setModelLanguage(e,l)},[l],S),K(()=>{void 0!==f&&A.current?.revealLine(f)},[f],S),K(()=>{T.current?.editor.setTheme(d)},[d],S);let N=o(()=>{if(D.current&&T.current&&!z.current){C.current(T.current);let e=s||u,r=W(T.current,a||t||"",c||l||"",e||"");A.current=T.current?.editor.create(D.current,{model:r,automaticLayout:!0,...p},h),y&&A.current.restoreViewState(te.get(e)),T.current.editor.setTheme(d),void 0!==f&&A.current.revealLine(f),k(!0),z.current=!0}},[t,c,u,a,l,s,p,h,y,d,f]);return i(()=>{S&&V.current(A.current,T.current)},[S]),i(()=>{!x&&!S&&N()},[x,S,N]),R.current=a,i(()=>{S&&P&&(L.current?.dispose(),L.current=A.current?.onDidChangeModelContent(e=>{_.current||P(A.current.getValue(),e)}))},[S,P]),i(()=>{if(S){let e=T.current.editor.onDidChangeMarkers(e=>{let t=A.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=T.current.editor.getModelMarkers({resource:t});E?.(e)}});return()=>{e?.dispose()}}return()=>{}},[S,E]),e.createElement(H,{width:v,height:b,isEditorReady:S,loading:g,_ref:D,className:w,wrapperProps:O})}),ne=re;export{Z as DiffEditor,re as Editor,ne as default,F as loader,ee as useMonaco};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{jsx as t}from"react/jsx-runtime";import{memo as n,useMemo as o,useState as e,useCallback as a}from"react";import{Box as i,FormControl as s,TextField as r}from"@mui/material";import{B as l,p,a as c}from"./BPMMuKIe5xb3-D8V.mjs";import{alpha as m}from"@mui/system";const u=["Ok","Cancel"],d=n(n=>{const{initialComments:d=null,onUpdateComments:g,context:f,onOption:x,onValidateOption:h,onDone:C,options:O=u,defaultOption:y=O?.[0],cancelOption:w="Cancel",sx:F,...P}=n,T=o(()=>{const t=d??f?.()?.getComments();let n="";if(t&&t.content&&t.content.runs){const o=t.content.runs;for(let t=0;t<o.length;t++){const e=o[t];n+=e?.text}}return n},[]),[k,v]=e(T),[I,b]=e(!1),D=a(async(t,n)=>null,[]),j=l(async t=>{const n=""===k?[]:k.split("\n");if(t!==w){const t=[];for(let o=0;o<n.length;o++)t.push({text:n[o]});const o={content:{runs:t}};g?.(o)}x?.(t,t===w,t===y),C?.()},[k,g,C,x,y,w]),B=l(t=>{v(t.target.value),D(t.target.value,null)},[h]),E=l(async t=>{let n=await Promise.resolve(h?.(t));try{!1!==n&&(n=await D(k,t))}catch(t){}return n??!0},[h,k]);return t(p,{title:(T?"Edit":"Insert")+" Comments",options:O,onDone:C,onOption:t=>j(t),onValidateOption:E,defaultOption:y,cancelOption:w,autoFocusSel:".autoFocus",sx:{width:"480px",...F},...P,children:t(i,{sx:{paddingTop:t=>t.spacing(1),paddingBottom:t=>t.spacing(0),rowGap:t=>t.spacing(1),display:"flex",flexDirection:"column"},children:t(s,{sx:{paddingTop:t=>t.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:t(r,{label:"Comments",placeholder:"Enter a comment.",onFocus:t=>{I||t.target?.select(),b(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:t=>t.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:t=>t.spacing(1.25),paddingBottom:t=>t.spacing(.75),backgroundImage:`linear-gradient(${m("#fff",c(5))}, ${m("#fff",c(5))})`}}},value:k,onChange:B,onContextMenu:t=>{t.stopPropagation()}})})})})});export{d as CommentsDialog,d as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.13
|
|
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{e as t}from"./BPMMuKIe5xb3-D8V.mjs";import{c as e,b as s,r,t as o,a as i,p as n,d as l}from"./zBIGDTI8z3bRbFxO.mjs";import{IFont as a,IAutoFilter as c,Sort as u,IRange as h,AddressUtils as p,IFill as g,IStyle as d,ITextFrame as m,FormulaError as b,IBorder as f}from"@sheetxl/sdk";class A{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 y=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,v=t=>{const e=parseInt(t);return isNaN(e)?null:e},F=t=>{const e=parseFloat(t);return isNaN(e)?null:e},C=new Map;class w{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)??C}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 r=t.split("/");for(let t=0;t<r.length;t++){const e=r[t];if(""===e||"."===e)continue;let o=[];for(let t=0;t<s.length;t++){const r=s[t],i=r.childNodes;for(let t=0;i&&t<i.length;t++){const s=r.childNodes[t];s.localName!==e&&"*"!==e||o.push(s)}}s=o}return 1===s.length?s[0]:0===s.length?null:new A(s)}getFromPath(e,s){return t.getFromPath(e,s)}setToPath(e,s,r){return t.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 y}get INT_COPY(){return v}get FLOAT_COPY(){return F}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 P{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class N{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 O=(e,s)=>{if(e||!e.hasAttribute("rot"))return;const r=e.getAttribute("rot"),o=t.roundAccurately(n(r),2);-1e3!==o&&(s.rotation=o)},T=(t,e,s,r,o)=>{const i=t.getValAttrAsString(r,e);null!==i&&(s[o]=i)},V=(t,e,s,r,o=r,i=null)=>{const n=t.getValAttrAsBoolean(r,e,i);null!==n&&(s[o]=n)},S=(t,e,s,r,o)=>{const i=t.getValAttrAsInteger(r,e);null!==i&&(s[o]=i)},k=(t,e,s,r,o,i=1)=>{const n=t.getValAttrAsFloat(r,e);null!==n&&(s[o]=n*i)};class x{visit(t,e,s){return V(t,e,s,"roundedCorners","roundedCorners"),S(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 L{visit(t,e,s){return V(t,e,s,"plotVisOnly","plotVisOnly"),T(t,e,s,"dispBlanksAs","dispBlanksAs"),V(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),V(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 I{visit(t,e,s){let r={};return s.plotArea=r,r}}class B{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 j{visit(t,e,s){}processStroke(t,e,s){const r={},n=t.evaluate("ln",e);if(n){n.hasAttribute("algn")&&(r.align=B.fromOoxmlAlignment(n.getAttribute("algn"))),n.hasAttribute("cap")&&(r.lineCap=B.fromOoxmlLineCap(n.getAttribute("cap"))),n.hasAttribute("cmpd")&&(r.compound=B.fromOoxmlCompound(n.getAttribute("cmpd"))),n.hasAttribute("w")&&(r.width=o(n.getAttribute("w")));const e=t.evaluate("miter",n);e&&(r.lineJoin="miter",e.hasAttribute("lim")&&(r.miter=parseFloat(e.getAttribute("lim")))),t.evaluate("bevel",n)&&(r.lineJoin="bevel"),t.evaluate("round",n)&&(r.lineJoin="round");const l=t.evaluate("custDash",n);if(l){const e=t.evaluate("ds",l);if(e&&e.length>0){let t="";for(let s=0;s<e.length;s++){const r=e.item(s);t+=i(r.getAttribute("d"))+","+i(r.getAttribute("sp"))}r.dash=t}}const a=t.evaluate("prstDash",n);a&&a.hasAttribute("val")&&(r.dash=a.getAttribute("val")),this.parseEndElement(t,n,r,"headEnd","head"),this.parseEndElement(t,n,r,"tailEnd","tail");const c=this.processFill(t,n,s);r.fill=c}return r}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,e,r){const o={};if(t.evaluate("noFill",e))return o.none=!0,o;const i=t.evaluate("solidFill",e);if(i){const e=this.processAdjColor(t,i);return e&&(o.solid=e),o}const n=t.evaluate("gradFill",e);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",e);if(l){const e=this.processPatternFill(t,l);return o.pattern=e,o}const a=t.evaluate("blipFill",e);if(a){a.hasAttribute("rotWithShape")&&(o.isRotated=s(a.getAttribute("rotWithShape"))),a.hasAttribute("dpi")&&(o.dpi=a.getAttribute("dpi"));const e=this.processImageFill(t,a);return o.image=e,o}return o.none=!0,o}processGradFill(t,e){const r={},o=t.evaluate("lin",e);if(o){if(r.type="linear",o.hasAttribute("ang")){const t=n(o.getAttribute("ang"));r.angle=t}if(o.hasAttribute("scaled")){const t=s(o.getAttribute("scaled"));r.scaled=t}}const l={};e.hasAttribute("flip")&&(l.mirror=e.getAttribute("flip")),Object.keys(l).length>0&&(r.tile=l);const a=t.evaluate("path",e);if(a){a.hasAttribute("path")&&(r.type=B.fromOoxmlGradientType(a.getAttribute("path")));const e=t.evaluate("fillToRect",a);e&&(r.fillTo=this.getRect(e))}const c=t.evaluate("tileRect",e);c&&(r.tile.bounds=this.getRect(c));const u=[],h=t.evaluate("gsLst/gs",e);for(let e=0;h&&e<h.length;e++){const s=h.item(e),r={offset:i(s.getAttribute("pos")),color:this.processAdjColor(t,s)};u.push(r)}return u.length>0&&(r.stops=u),r}getRect(t){const e={};return t.hasAttribute("t")&&(e.t=i(t.getAttribute("t"))),t.hasAttribute("l")&&(e.l=i(t.getAttribute("l"))),t.hasAttribute("b")&&(e.b=i(t.getAttribute("b"))),t.hasAttribute("r")&&(e.r=i(t.getAttribute("r"))),0===Object.keys(e).length?null:e}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,e){let s="lrgba("+i(e.getAttribute("r"))+","+i(e.getAttribute("g"))+","+i(e.getAttribute("b"))+")";return s+=this.processAdjustments(t,e),s}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,e){let s="hsl("+n(e.getAttribute("hue"))+","+i(e.getAttribute("sat"))+","+i(e.getAttribute("lum"))+")";return s+=this.processAdjustments(t,e),s}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 _ extends j{visit(t,s,r){try{const o=t.evaluate("xfrm",s);if(o){O(o,r);const s={x:0,y:0,width:0,height:0},i=t.evaluate("off",o);i&&(s.x=e(i.getAttribute("x"))??0,s.y=e(i.getAttribute("y"))??0);const n=t.evaluate("ext",o);i&&(s.width=e(n.getAttribute("cx"))??0,s.height=e(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 R{visit(t,e,s){let r={};if(T(t,e,r,"grouping","grouping"),V(t,e,r,"varyColors","varyColors"),k(t,e,r,"gapWidth","gapWidth",.01),k(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),S(t,e,r,"bubbleScale","bubbleScale"),V(t,e,r,"showNegBubbles","showNegativeBubbleValues"),V(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),S(t,e,r,"firstSliceAng","startAngle"),S(t,e,r,"holeSize","holeSize"),T(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 E extends R{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type="col"===r?"column":"bar")}}class Y{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):(V(t,e,r,"showBubbleSize","showBubbleSize"),V(t,e,r,"showCatName","showCatName"),V(t,e,r,"showLeaderLines","showLeaderLines"),V(t,e,r,"showPercent","showPercentage"),V(t,e,r,"showSerName","showSerName"),V(t,e,r,"showVal","showVal"),V(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return null!==l&&(r.separator=l.textContent),T(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 D=(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 M{visit(t,e,s){const r={};S(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),S(t,e,r,"idx","idx"),V(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){D(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 U{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),V(t,e,i,"bubble3D","bubble3D"),S(t,e,i,"explosion","explosion"),D(t,e,i),i}}class z{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 G{visit(t,e,s){let r={};this.parseScaling(t,e,r),k(t,e,r,"majorUnit","majorUnits"),k(t,e,r,"minorUnit","minorUnits"),V(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),T(t,e,r,"majorTickMark","majorTickMarks"),T(t,e,r,"minorTickMark","minorTickMarks"),T(t,e,r,"crosses","crosses"),k(t,e,r,"crossesAt","crosses"),T(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),S(t,e,r,"lblOffset","labelOffset"),T(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=null!==o&&0===o,S(t,e,r,"tickMarkSkip","tickMarkSkip"),S(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"),T(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"),k(t,e,s,"scaling/max","max"),k(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 W{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 _).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&&O(a,s)}parseTextProperties(t,e,s){if(!e)return;e.hasAttribute("sz")&&(s.size=parseFloat(e.getAttribute("sz"))/100),e.hasAttribute("b")&&(s.weight="1"===e.getAttribute("b")?700:400),e.hasAttribute("i")&&(s.italic="1"===e.getAttribute("i")),e.hasAttribute("u")&&(s.underline=e.getAttribute("u")),e.hasAttribute("strike")&&(s.strike=e.getAttribute("strike"));const r=t.evaluate("latin",e);if(r&&!r.getAttribute("typeface").startsWith("+")){const t=s.font??{};if(r.hasAttribute("typeface")&&(t.family=r.getAttribute("typeface")),r.hasAttribute("panose")){const e=r.getAttribute("panose");e&&(t.fallbacks=[a.getPanoseFallback(e)])}r.hasAttribute("pitchFamily")&&(t.pitch=r.getAttribute("pitchFamily")),r.hasAttribute("charset")&&(t.charset=r.getAttribute("charset")),Object.keys(t).length>0&&(s.font=t)}}}class X{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 ${visit(t,e,s){const r={};return V(t,e,r,"overlay","overlay"),T(t,e,r,"legendPos","position"),s.legend=r,r}}class K extends _{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 H extends W{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={};V(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 J{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let e={};k(t,r,e,"x","x"),k(t,r,e,"y","y"),k(t,r,e,"w","w"),k(t,r,e,"h","h"),T(t,r,e,"xMode","xMode"),T(t,r,e,"yMode","yMode"),T(t,r,e,"wMode","wMode"),T(t,r,e,"hMode","hMode"),Object.keys(e).length>0&&(s.manualLayout=e)}return s}}class q{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class Q extends j{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 Z{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,s){if(!e)return;const r=t.evaluate("latin",e);if(!r)return;const o=r.getAttribute("typeface");o&&(s.family=o);const i=r.getAttribute("panose");return i&&(s.fallbacks=[a.getPanoseFallback(i)]),s}}class tt{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 et{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 s={type:c.Type.Color};return t.copyFromAttribute(e,"cellColor",s,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(e,"dxfId",s,"styleId",t.INT_COPY),s}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 s={type:c.Type.Custom};t.copyFromAttribute(e,"and",s,"and",t.BOOLEAN_COPY);const r=e.childNodes;s.filters=[];for(let e=0;e<r.length;e++){const o=r.item(e);if(1!==o.nodeType)continue;let i=null;"customFilter"===o.localName&&(i=this.processCustomFilter(t,o)),i&&s.filters.push(i)}return s}processDynamicFilter(t,e){const s={type:c.Type.Dynamic};return t.copyFromAttribute(e,"type",s,"dynamicType"),t.copyFromAttribute(e,"val",s,"val",t.INT_COPY),t.copyFromAttribute(e,"maxVal",s,"maxVal",t.INT_COPY),s}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 s={type:c.Type.Items};t.copyFromAttribute(e,"blank",s,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(e,"calendarType",s,"calendarType");let r=[],o=[];const i=e.childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)if("dateGroupItem"===s.localName){const e=this.processDateGroupItem(t,s);e&&r.push(e)}else if("filter"===s.localName){const e=this.processFilterItem(t,s);void 0!==e&&o.push(e)}}return r.length>0&&(s.dateGroups=r),o.length>0&&(s.items=o),s}processIcon(t,e){const s={type:c.Type.Icon};return t.copyFromAttribute(e,"iconId",s,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",s),s}processTop10(t,e){const s={type:c.Type.Top10};return t.copyFromAttribute(e,"filterVal",s,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(e,"percent",s,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(e,"top",s,"top",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val",t.FLOAT_COPY),s}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,e){if(!e)return null;const r={};if(!e.hasAttribute("colId"))return;r.offset=parseInt(e.getAttribute("colId"));let o=!1;return e.hasAttribute("hiddenButton")&&(o=s(e.getAttribute("hiddenButton"))),o&&(r.hiddenButton=!0),e.hasAttribute("showButton")&&(r.showButton=s(e.getAttribute("showButton"))),this.processFilterCriteria(t,e,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 st{visit(t,e,r){if(!e)return;const o={};if(t.copyFromAttribute(e,"ref",o),e.hasAttribute("caseSensitive")){const t=s(e.getAttribute("caseSensitive"));o.collatorOptions=t?u.CaseSensitiveOptions:u.CaseInsensitiveOptions}const i=e.getAttribute("sortMethod");null!=i&&"none"!==i&&("stroke"===i?o.collatorOptions={...o.collatorOptions,collation:"stroke"}:"pinYin"===i&&(o.collatorOptions={...o.collatorOptions,collation:"pinyin"})),e.hasAttribute("columnSort")&&s(e.getAttribute("columnSort"))&&(o.orientation=h.Orientation.Column);const n=p.fastStringToRange(o.ref);return this.processSortConditions(t,e,o,n),Object.keys(o).length>0&&(r.sort=o),o}processSortCondition(t,e,r){if(!e)return null;const o={};if(e.hasAttribute("ref")){if(e.hasAttribute("ref")){const t=e.getAttribute("ref"),s=p.fastStringToRange(t);o.offset=r?s.colStart-r.colStart:s.colStart}return o.reverse=!1,e.hasAttribute("descending")&&(o.reverse=s(e.getAttribute("descending"))),t.copyFromAttribute(e,"sortBy",o,"sortOn"),t.copyFromAttribute(e,"dxfId",o),t.copyFromAttribute(e,"iconSet",o),t.copyFromAttribute(e,"customList",o),o}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 rt{visit(t,e,s){}processDataBarColor(t,e,s,r,o="dk1"){if(!e)return;const i=l(t=>e.getAttribute(t),o);return i&&(s[r]=i),s}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,s){t.getValAttrAsBoolean("b",e,!0)&&(s.weight=700),t.getValAttrAsBoolean("i",e,!0)&&(s.style=a.Style.Italic),t.getValAttrAsBoolean("strike",e,!0)&&(s.strike=!0);const r=t.evaluate("u",e);if(r){const t=r.getAttribute("val");s.underline=t||a.UnderlineStyle.Single}T(t,e,s,"vertAlign","verticalAlign"),"superscript"===s.verticalAlign?s.verticalAlign=a.VerticalAlignment.Super:"subscript"===s.verticalAlign&&(s.verticalAlign=a.VerticalAlignment.Sub),k(t,e,s,"sz","size");const o=t.evaluate("color",e);this.processDataBarColor(t,o,s,"fill"),s.fill||(s.fill="dk1"),T(t,e,s,"name","family"),T(t,e,s,"rFont","family");const i=t.evaluate("family",e);if(i){const t=i.getAttribute("val");if(t)switch(t){case"1":s.fallbacks=["serif"];break;case"2":s.fallbacks=["sans-serif"];break;case"3":s.fallbacks=["monospace"];break;case"4":s.fallbacks=["cursive"];break;case"5":s.fallbacks=["fantasy"]}}return T(t,e,s,"scheme","scheme"),V(t,e,s,"shadow","shadow",!0),V(t,e,s,"outline","outline",!0),t.getValAttrAsBoolean("condense",e,!0)&&(s.letterSpacing=-1),t.getValAttrAsBoolean("extend",e,!0)&&(s.letterSpacing=1),T(t,e,s,"charset","charset"),s}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,s,r){const o={type:g.Type.None},i=e.childNodes;let n=!1;for(let e=0;!n&&e<i.length;e++){const s=i.item(e);1===s.nodeType&&("gradientFill"===s.localName?(this.processGradientFill(t,s,o),n=!0):"patternFill"===s.localName&&(this.processPatternFill(t,s,o),n=!0))}return s[r]=o,s}processGradientFill(t,e,s){if(!e)return;s.type=g.Type.Gradient;const r=[];s.stops=r,s.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const o=e.getAttribute("type");o&&(s.gradientType=o);const i=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"))&&(s.fillTo={left:i(e.getAttribute("left")),top:i(e.getAttribute("top")),right:i(e.getAttribute("right")),bottom:i(e.getAttribute("bottom"))});const n=e.childNodes;for(let e=0;e<n.length;e++){const s=n.item(e);if(1===s.nodeType&&"stop"===s.localName){const e={};r.push(e);const o=parseFloat(s.getAttribute("position"));e.offset=o;const i=t.evaluate("color",s);this.processDataBarColor(t,i,e,"color")}}return s}processPatternFill(t,e,s){if(!e)return;const r=t.getVisitorParamsState().get("processingDXFs"),o=e.getAttribute("patternType")||(r?g.BuiltInSheetPattern.Solid:g.BuiltInSheetPattern.None);if(o===g.BuiltInSheetPattern.None)return{none:!0};s.type=g.Type.Pattern,o&&(s.patternType=o);let i,n="foreground",l="background";const a=s.patternType===g.BuiltInSheetPattern.Solid&&r;if(a){i="lt1";const t=n;n=l,l=t}const c=t.evaluate("fgColor",e);this.processDataBarColor(t,c,s,n,i);const u=t.evaluate("bgColor",e);return this.processDataBarColor(t,u,s,l,i),a&&!s.foreground&&(s.foreground=i),s}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,s,r,o){if(!e)return;const i={};return this.processBorderStroke(t,e,i,f.Edge.Left),this.processBorderStroke(t,e,i,f.Edge.Right),o?(i.right||i.left)&&(i.right?i.vertical={...i.right}:i.vertical={...i.left}):this.processBorderStroke(t,e,i,f.Edge.Vertical),this.processBorderStroke(t,e,i,f.Edge.Top),this.processBorderStroke(t,e,i,f.Edge.Bottom),o?(i.bottom||i.top)&&(i.right?i.horizontal={...i.bottom}:i.horizontal={...i.top}):this.processBorderStroke(t,e,i,f.Edge.Horizontal),s[r]=i,s}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 ot extends rt{visit(t,e,s){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const r={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),r.fonts),this.processFills(t,t.evaluate("fills",e),r.fills),this.processBorders(t,t.evaluate("borders",e),r.borders,!0),r.fills[0]={type:g.Type.None},r.fills[1]={type:g.Type.Pattern,patternType:g.BuiltInSheetPattern.Gray125},r.borders[0]={};const o=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),o,r,null,!1);const i=new Map;if(o.length>0){const r=[];this.processCellStyles(t,t.evaluate("cellStyles",e),r,o,i),s.named=r}const n=[];this.processXFs(t,t.evaluate("cellXfs",e),n,r,i),Object.keys(n).length>0&&(s.direct=n);const l=[];return this.processDXFs(t,t.evaluate("dxfs",e),l),this.processTableStyles(t,t.evaluate("tableStyles",e),s,l),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),s),this.processMruColors(t,t.evaluate("colors/mruColors",e),s),s}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,e,r,o,i,n){if(!e)return;const l=e.getAttribute("xfId");if(l&&i){const t=i.get(parseInt(l));t&&t!==d.BuiltInName.Normal&&(r.named=t)}const a=t=>!(!n&&e.hasAttribute(t))||s(e.getAttribute("applyFont"));if(a("applyFont")){const t=o.fonts[e.getAttribute("fontId")];t&&(r.font=t)}if(a("applyFill")){const t=o.fills[e.getAttribute("fillId")];t&&Object.keys(t).length>0&&(r.fill=t)}if(a("applyBorder")){const t=o.borders[e.getAttribute("borderId")];t&&Object.keys(t).length>0&&(r.border=t)}if(a("applyNumberFormat")){const s=e.getAttribute("numFmtId");if(s){const e=parseInt(s);let o;const i=t.getVisitorParamsState();if(i){const t=i.get("numFmts");t&&(o=t.get(e)),r.numberFormat=o??e}else console.warn("no visitor params state")}}a("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",e),r),a("applyProtection")&&this.processProtection(t,t.evaluate("protection",e),r);const c=s(e.getAttribute("quotePrefix"));c&&(r.quotePrefix=c)}processAlignment(t,e,r){const o={};if(e?.hasAttribute("horizontal")?o.horizontal=e.getAttribute("horizontal"):o.horizontal=m.HorizontalAlignment.General,e?.hasAttribute("vertical")?o.vertical=e.getAttribute("vertical"):o.vertical=m.VerticalAlignment.Bottom,e?.hasAttribute("indent")?o.indent=parseInt(e.getAttribute("indent")):o.indent=0,e?.hasAttribute("relativeIndent")?o.relativeIndent=parseInt(e.getAttribute("relativeIndent")):o.relativeIndent=0,s(e?.getAttribute("wrapText"))?o.overflow=m.Overflow.Wrap:o.overflow=m.Overflow.Visible,s(e?.getAttribute("shrinkToFit"))&&(o.overflow=m.Overflow.Shrink),e?.hasAttribute("textRotation")){let t=parseFloat(e.getAttribute("textRotation"));t>0&&t<=90?t=360-t:t>90&&t<=180?t-=90:255===t&&(t=0,o.stacked=!0),o.rotation=t}else o.rotation=0;e?.hasAttribute("justifyLastLine")&&(o.justifyLastLine=s(e.getAttribute("justifyLastLine")));const i=e?.getAttribute("readingOrder");return i&&("0"===i?o.readingDirection=m.ReadingDirection.Auto:"1"===i?o.readingDirection=m.ReadingDirection.LeftToRight:"2"===i?o.readingDirection=m.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${i}`)),Object.keys(o).length>0&&(r.alignment=o),r}processProtection(t,e,r){if(!e)return;const o={},i=e.getAttribute("locked");i&&!s(i)&&(o.edit=!0);const n=e.getAttribute("hidden");return n&&s(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,e,r,o,i=!1){const n=e.getAttribute("name"),l={name:n};e.hasAttribute("table")&&(l.table=s(e.getAttribute("table"))),e.hasAttribute("pivot")&&(l.pivot=s(e.getAttribute("pivot"))),i&&!l.pivot&&o.unshift(null);const a=e.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,e,r,o,i){if(!e)return;const n=e.childNodes;for(let t=0;t<n.length;t++){const e=n.item(t);if(1===e.nodeType&&"cellStyle"===e.localName){const t=parseInt(e.getAttribute("xfId")),n=e.getAttribute("name");if(i.set(t,n),!o[t])continue;const l={name:n,style:o[t]};e.getAttribute("hidden")&&(l.hidden=s(e.getAttribute("hidden"))),e.getAttribute("iLevel")&&(l.iLevel=parseInt(e.getAttribute("iLevel"))),r.push(l)}}}afterVisit(t,e,s){}}class it extends rt{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 nt{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 lt{visit(t,e,s){return s}}class at{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(t.evaluate("colOff",s).textContent)),t.evaluate("rowOff",s)&&(i.y=e(t.evaluate("rowOff",s).textContent)),"from"===o?r.tl=i:r.br=i,r}}class ct{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 ut extends ct{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 ht extends ct{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 pt extends ct{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 gt extends ht{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 dt extends ht{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 mt="richTypes";class bt{visit(t,e,s){let r=t.getVisitorParamsState().get(mt);r||(r=[],t.getVisitorParamsState().set(mt,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 ft="richData";class At{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(ft);o||(o=[],t.getVisitorParamsState().set(ft,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 s=e.errorType;if(s)try{e=b.getBuiltInById(s+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 yt{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 vt{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 Ft{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class Ct{visit(t,e,o){if(!e)return;const i={};return t.copyFromAttribute(e,"id",i,"id",r),t.copyFromAttribute(e,"personId",i,"personId",r),t.copyFromAttribute(e,"ref",i),t.copyFromAttribute(e,"parentId",i,"parentId",r),t.copyFromAttribute(e,"dT",i),e.hasAttribute("done")&&(i.done=s(e.getAttribute("done"))),o.push(i),i}}class wt{visit(t,e,s){const o=[],i=e.childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType&&"person"===s.localName){const e={};t.copyFromAttribute(s,"id",e,"id",r),t.copyFromAttribute(s,"displayName",e),t.copyFromAttribute(s,"userId",e,"userId",r),t.copyFromAttribute(s,"providerId",e),o.push(e)}}return o.length>0&&(s.persons=o),o}}const Pt={};class Nt{constructor(t,e){this.path=t,this.visitor=e}}class Ot{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new N),this.registerVisitor("spPr",new _),this.registerVisitor("txBody",new W),this.registerVisitor("txPr",new W),this.registerVisitor("c:chartSpace",new x),this.registerVisitor("c:chartSpace",new L,"chart"),this.registerVisitor("c:plotArea",new I),this.registerVisitor("c:barChart",new E),this.registerVisitor("c:doughnutChart",new R),this.registerVisitor("c:lineChart",new R),this.registerVisitor("c:ofPieType",new R),this.registerVisitor("c:pieChart",new R),this.registerVisitor("c:scatterChart",new R),this.registerVisitor("c:barChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new M),this.registerVisitor("c:dPt",new U),this.registerVisitor("c:marker",new z),this.registerVisitor("c:catAx",new G),this.registerVisitor("c:valAx",new G),this.registerVisitor("c:dateAx",new G),this.registerVisitor("c:majorGridlines",new P("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new P("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new W("labels.text"),"txPr"),this.registerVisitor("c:valAx",new W("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new W("labels.text"),"txPr"),this.registerVisitor("c:legend",new $),this.registerVisitor("c:legend",new W("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new X),this.registerVisitor("c:ser",new K,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new Y("labels"),"dLbls"),this.registerVisitor("c:dLbl",new Y("points")),this.registerVisitor("c:title",new H),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new J),this.registerVisitor("c:dispUnits",new P("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new H("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new W,"tx/rich"),this.registerVisitor("a:theme",new q),this.registerVisitor("a:theme",new Q,"themeElements/clrScheme"),this.registerVisitor("a:theme",new Z,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new et),this.registerVisitor("sortState",new st),this.registerVisitor("s:workbook",new it),this.registerVisitor("styleSheet",new ot),this.registerVisitor("table",new nt),this.registerVisitor("hlinkClick",new tt),this.registerVisitor("wsDr",new lt),this.registerVisitor("twoCellAnchor",new at),this.registerVisitor("oneCellAnchor",new at),this.registerVisitor("absoluteAnchor",new at),this.registerVisitor("graphicFrame",new ut),this.registerVisitor("sp",new ht),this.registerVisitor("grpSp",new gt),this.registerVisitor("cxnSp",new dt),this.registerVisitor("pic",new pt),this.registerVisitor("rvStructures",new bt),this.registerVisitor("rvData",new At),this.registerVisitor("comments",new yt),this.registerVisitor("commentList",new vt,"comment"),this.registerVisitor("comment",new W("content"),"text"),this.registerVisitor("ThreadedComments",new Ft),this.registerVisitor("threadedComment",new Ct),this.registerVisitor("threadedComment",new W("content"),"text"),this.registerVisitor("personList",new wt)}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 Nt(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=Pt){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 w(null,this,n,r,o,e,s),a=[];this._doWalk(i,l,a,r,o,e,s);for(let e=0;e<a.length;e++){const s=a[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 a=0;l&&a<l.length;a++){const c=l[a];let u=null;try{u=e.evaluate(c.path,r)}catch(e){console.warn(`"Invalid path '${c.path}' for '${t}'.`)}if(!u)continue;const h=t=>{let l=t.localName,a=t.parentNode;for(;a&&a!==r;)l=a.localName+"/"+l,a=a.parentNode;const u=e.getPath()+"/"+l;if(c.visitor){const r=new w(e,this,u,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c.visitor,r,s,t,o,i,n)}};if(u.length>0){const t=u;for(let e=0;e<t.length;e++)h(t.item(e))}else h(u)}}_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 a=r.localName;this._walkScoped(a,e,s,r,l,i,n);const c=r.childNodes;for(let t=0;t<c.length;t++){const r=c.item(t);if(1===r.nodeType){const t=r,a=t.localName,c=this.visitorsByXmlTagName.get(a),u=e.getPath()+"/"+a,h=new w(e,this,u,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c,h,s,t,l??o,i,n)}}return l}}export{Ot as FromOOXMLConverter,Ot as default};
|