@evotecit/officeimo 0.1.19 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -10
- package/bundles/officeimo-canopyx-adapter.js +147 -65
- package/bundles/officeimo-canopyx-adapter.min.js +1 -1
- package/bundles/officeimo-canopyx-adapter.min.mjs +1 -1
- package/bundles/officeimo-canopyx-adapter.mjs +134 -53
- package/bundles/officeimo-canopyx.js +554 -234
- package/bundles/officeimo-canopyx.min.js +1 -1
- package/bundles/officeimo-canopyx.min.mjs +1 -1
- package/bundles/officeimo-canopyx.mjs +477 -158
- package/bundles/officeimo-chartforgex-adapter.js +1924 -0
- package/bundles/officeimo-chartforgex-adapter.min.js +2 -0
- package/bundles/officeimo-chartforgex-adapter.min.mjs +2 -0
- package/bundles/officeimo-chartforgex-adapter.mjs +1910 -0
- package/bundles/officeimo-chartforgex.js +13594 -0
- package/bundles/officeimo-chartforgex.min.js +2 -0
- package/bundles/officeimo-chartforgex.min.mjs +2 -0
- package/bundles/officeimo-chartforgex.mjs +13487 -0
- package/bundles/officeimo-csv.js +12 -7
- package/bundles/officeimo-csv.min.js +1 -1
- package/bundles/officeimo-csv.min.mjs +1 -1
- package/bundles/officeimo-csv.mjs +8 -3
- package/bundles/officeimo-datatables-adapter.js +11 -11
- package/bundles/officeimo-datatables-adapter.min.js +1 -1
- package/bundles/officeimo-datatables-adapter.min.mjs +1 -1
- package/bundles/officeimo-datatables-adapter.mjs +7 -7
- package/bundles/officeimo-datatables.js +418 -180
- package/bundles/officeimo-datatables.min.js +1 -1
- package/bundles/officeimo-datatables.min.mjs +1 -1
- package/bundles/officeimo-datatables.mjs +350 -112
- package/bundles/officeimo-execution.js +14 -9
- package/bundles/officeimo-execution.min.js +1 -1
- package/bundles/officeimo-execution.min.mjs +1 -1
- package/bundles/officeimo-execution.mjs +8 -3
- package/bundles/officeimo-pdf.js +286 -120
- package/bundles/officeimo-pdf.min.js +1 -1
- package/bundles/officeimo-pdf.min.mjs +1 -1
- package/bundles/officeimo-pdf.mjs +244 -78
- package/bundles/officeimo-xlsx.js +136 -59
- package/bundles/officeimo-xlsx.min.js +1 -1
- package/bundles/officeimo-xlsx.min.mjs +1 -1
- package/bundles/officeimo-xlsx.mjs +114 -37
- package/bundles/officeimo.js +416 -178
- package/bundles/officeimo.min.js +1 -1
- package/bundles/officeimo.min.mjs +1 -1
- package/bundles/officeimo.mjs +351 -113
- package/dist/core/progress.js +7 -2
- package/dist/index.d.ts +1 -1
- package/dist/integrations/canopyx/index.js +13 -4
- package/dist/integrations/canopyx/pdf-number.js +9 -6
- package/dist/integrations/canopyx/rule-predicates.d.ts +1 -1
- package/dist/integrations/canopyx/rule-predicates.js +2 -1
- package/dist/integrations/canopyx/rules.d.ts +1 -1
- package/dist/integrations/canopyx/rules.js +11 -13
- package/dist/integrations/canopyx/source.js +57 -7
- package/dist/integrations/canopyx/tones.d.ts +10 -0
- package/dist/integrations/canopyx/tones.js +12 -0
- package/dist/integrations/canopyx/types.d.ts +8 -1
- package/dist/integrations/chartforgex/capture.d.ts +31 -0
- package/dist/integrations/chartforgex/capture.js +103 -0
- package/dist/integrations/chartforgex/index.d.ts +13 -0
- package/dist/integrations/chartforgex/index.js +88 -0
- package/dist/integrations/chartforgex/svg-drawing.d.ts +5 -0
- package/dist/integrations/chartforgex/svg-drawing.js +775 -0
- package/dist/integrations/chartforgex/svg-geometry.d.ts +23 -0
- package/dist/integrations/chartforgex/svg-geometry.js +304 -0
- package/dist/integrations/chartforgex/svg-image.d.ts +9 -0
- package/dist/integrations/chartforgex/svg-image.js +46 -0
- package/dist/integrations/chartforgex/svg-markup.d.ts +10 -0
- package/dist/integrations/chartforgex/svg-markup.js +124 -0
- package/dist/integrations/chartforgex/svg-paint.d.ts +16 -0
- package/dist/integrations/chartforgex/svg-paint.js +146 -0
- package/dist/integrations/chartforgex/types.d.ts +77 -0
- package/dist/integrations/chartforgex/types.js +1 -0
- package/dist/integrations/chartforgex/winansi.d.ts +4 -0
- package/dist/integrations/chartforgex/winansi.js +48 -0
- package/dist/integrations/chartforgex/workbook.d.ts +12 -0
- package/dist/integrations/chartforgex/workbook.js +137 -0
- package/dist/pdf/document-drawings.d.ts +1 -1
- package/dist/pdf/document-drawings.js +91 -17
- package/dist/pdf/document-images.d.ts +7 -1
- package/dist/pdf/document-images.js +59 -24
- package/dist/pdf/document-types.d.ts +3 -1
- package/dist/pdf/document.d.ts +2 -2
- package/dist/pdf/document.js +3 -1
- package/dist/pdf/drawing-types.d.ts +37 -10
- package/dist/pdf/font-resources.d.ts +1 -1
- package/dist/pdf/font-resources.js +6 -3
- package/dist/pdf/index.d.ts +1 -1
- package/dist/pdf/pages.js +15 -0
- package/dist/pdf/png.d.ts +11 -2
- package/dist/pdf/png.js +50 -23
- package/dist/pdf/session.js +3 -2
- package/dist/pdf/settings.d.ts +2 -2
- package/dist/pdf/settings.js +7 -3
- package/dist/xlsx/options.js +2 -2
- package/dist/xlsx/portable.js +1 -1
- package/dist/xlsx/styles.js +28 -18
- package/dist/xlsx/types.d.ts +13 -1
- package/dist/xlsx/workbook.js +9 -1
- package/dist/xlsx/worksheet.d.ts +13 -1
- package/dist/xlsx/worksheet.js +65 -11
- package/package.json +9 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Generated by OfficeIMO.JavaScript/scripts/bundles.mjs from tsc output. MIT.
|
|
2
|
+
(function(Be){"use strict";const Ye=Be.OfficeIMO||(Be.OfficeIMO={}),be=Ye[Symbol.for("@evotecit/officeimo/modules")],Ee=ie=>{const W=be&&be.get(ie);if(!W)throw new Error("officeimo-chartforgex-adapter.min.js needs officeimo.js or officeimo.min.js from the same OfficeIMO build, loaded first.");return W},at=Ee("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00"),qe=Ee("50b3c10b690ceff693c8c5f809195ba6845b20e60f408e791a750d2ecbd5c669"),Ke=Ee("42faf379960e5674a6fdfa8c8fca0bb68bbd74587231248d2524d7004def3671"),ct=Ee("f0627ba89e5c8fcb376ebe3ce72dcc8d68c34952981f8703e36b8bb1a9894208"),He=Ee("6c92204b587bb12cfa85c60eb1fd921804dfa51304538c7be3353e2927551b02"),ft=Ee("fd70ccda89f27c6b874c8840ac944b3ec723dbdef3dfe7600f7bdb81f4660c96"),lt=Ee("edf1bf5cb6d749de0e6823397df6610a6c1cc88768898c1b4d7083ee96ef6759"),dt=Ee("344fd55ffe1a37b32a8eb6a2bdaa14dff90e0fee0f37282457f9e4c3b7bce1ca"),Fe=Ee("d5c945064d81fdd257960f48c421125e106e5f270427d170bb05587dd96a44ea"),ut=Ee("87c24efeaa0f1579c19afeeb4918caeb4f8f65a88d24a246e2cfd712b37dbac3"),ht=Ee("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f"),pt=Ee("32ca4982f963f400829c2e364b7d3479f36d91740dafb32d600f29b5cac487ec"),mt=Ee("6b0244b5ec6d550c705b4e4cbb47997331f1ecd99e2bf8a06f7c646eebbffbf8"),gt=Ee("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070"),bt=Ee("732224f6995c2478cf33a6ed01f3e3d3dcccb159a731d6db9280104bd5040fc5"),yt=Ee("8d96d0024443ac9aeaea70e9324b53aacef098c2385d4e6a89a76d184e28556a"),xt=Ee("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596"),wt=be.get("2ab57874b786ef4d2b4841b9072fedd27d40c308f72c6548962810139359deb9")??(()=>{const{captureFields:ie}=qe,{ExportBudget:W}=Ke,{captureCsvOptions:z}=ct,{capturePdfOptions:fe,capturePdfLimits:ye,pdfLimitFields:de}=He,{captureWorkbookLimits:O,workbookLimitFields:se,workbookOptionFields:b,sheetOptionFields:S}=ft,f=[...new Set([...se,...de])],M=b.filter(c=>c!=="sink");function k(c){return c===void 0?void 0:new W(ie(c,f)).limits}function p(c,a){const r={...c};for(const[l,g]of Object.entries(a??{}))g!==void 0&&(r[l]=g);return r}function x(c={}){const a=ie(c,[...M,"sheet"]),r=a.sheet&&ie(a.sheet,[...S,"name"]),l=r?.footer&&ie(r.footer,["rows","values","totals","style"]);return{...a,...r===void 0?{}:{sheet:{...r,...l===void 0?{}:{footer:l}}},...a.limits===void 0?{}:{limits:O(a.limits)}}}function E(c={}){const a=z(c);return{...a,...a.limits===void 0?{}:{limits:new W(a.limits).limits}}}function t(c={}){const a=fe(c);return{...a,...a.limits===void 0?{}:{limits:ye(a.limits)}}}const n=Object.freeze({captureCommonLimits:k,mergeAdapterLimits:p,captureXlsxOptions:x,captureCsvOptions:E,capturePdfOptions:t});return be.set("2ab57874b786ef4d2b4841b9072fedd27d40c308f72c6548962810139359deb9",n),n})(),Mt=be.get("ac8402d3d046ec8f54d00b5207b5342ec15c8d02aca85e597479db0f27d7cd6d")??(()=>{const{NotSupportedError:ie}=Fe;function W(b,S){if(!b||typeof b!="object"||Array.isArray(b))throw new TypeError("Chart capture "+S+" must be an object.");return b}function z(b,S,f=!1){if(b==null){if(f)throw new TypeError("Chart capture "+S+" is required.");return}if(typeof b!="string")throw new TypeError("Chart capture "+S+" must be a string.");return b}const fe=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;function ye(b){const S=b.replace(" ","T").replace(/([+-]\d{2})(\d{2})$/,"$1:$2").replace(/(\.\d{3})\d+/,"$1");return S.length===10||/(Z|[+-]\d{2}:\d{2})$/.test(S)?S:S+"Z"}function de(b){const S=b.trim();if(!fe.test(S))return NaN;const f=S.slice(0,10),M=new Date(f+"T00:00:00Z");return!Number.isFinite(M.getTime())||!M.toISOString().startsWith(f+"T")?NaN:Date.parse(ye(S))}function O(b,S=1048575){const f=W(b,"");if(f.version!==1)throw new ie("Only ChartForgeX capture version 1 is supported.");const M=W(f.x,"x"),k=M.kind;if(k!=="date"&&k!=="number"&&k!=="category")throw new TypeError("Chart capture x.kind must be date, number or category.");const p=f.y===void 0?{}:W(f.y,"y");if(!Array.isArray(f.series))throw new TypeError("Chart capture series must be an array.");let x=0;const E=Array.from(f.series,(c,a)=>{const r=W(c,"series["+a+"]"),l=r.points;if(!Array.isArray(l))throw new TypeError("Chart capture series["+a+"].points must be an array.");const g=l.length;if((x+=g)>S)throw new RangeError("Chart capture has more than "+S+" points.");return{id:z(r.id,"series["+a+"].id",!0),name:z(r.name,"series["+a+"].name",!0),unit:z(r.unit,"series unit"),format:z(r.format,"series format"),points:Array.from({length:g},(i,m)=>{const N=W(l[m],"point"),K="series["+a+"].points["+m+"]",A=N.y;if(A!=null&&(typeof A!="number"||!Number.isFinite(A)))throw new TypeError(K+".y must be a finite number or null.");let H=null,U=null;const _=N.x;if(_!=null)if(k==="date"){let y=NaN;if(typeof _=="string"&&(y=de(_)),typeof _=="object")try{y=Date.prototype.getTime.call(_)}catch{}if(!Number.isFinite(y))throw new TypeError(K+".x must be an ISO 8601 date string or a valid Date.");H=new Date(y),U=y}else if(k==="number"){if(typeof _!="number"||!Number.isFinite(_))throw new TypeError(K+".x must be a finite number.");H=U=_}else{if(typeof _!="string"&&typeof _!="number")throw new TypeError(K+".x must be a category label.");H=U=String(_)}return{x:H,key:U,xCaption:z(N.xCaption,K+".xCaption"),y:A??null,caption:z(N.caption,K+".caption")}})}}),t=f.svg,n=t&&typeof t=="object"?t.outerHTML:t;if(t!=null&&typeof n!="string")throw new TypeError("Chart capture svg must be markup or an element.");return{title:z(f.title,"title"),description:z(f.description,"description"),kind:k,xTitle:z(M.title,"x.title")||"X",xFormat:z(M.format,"x.format"),yTitle:z(p.title,"y.title")||"Value",yUnit:z(p.unit,"y.unit"),yFormat:z(p.format,"y.format"),series:E,svg:typeof n=="string"?n:void 0}}const se=Object.freeze({prepareChart:O});return be.set("ac8402d3d046ec8f54d00b5207b5342ec15c8d02aca85e597479db0f27d7cd6d",se),se})(),Tt=be.get("f54d4d4723150fc5bcef9dc5e60d5b819452cd5007edfa3494a3c876459a0b01")??(()=>{const{OfficeIMOError:ie}=Fe,{jpegSize:W}=pt,{pngEmbeddableSize:z}=mt,fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ye=new Int16Array(128).fill(-1);for(let b=0;b<fe.length;b++)ye[fe.charCodeAt(b)]=b;function de(b){const S=b.replace(/[\t\n\f\r ]+/g,"").replace(/={1,2}$/,"");if(S.length%4===1)return;const f=new Uint8Array(Math.floor(S.length*3/4));let M=0,k=0,p=0;for(let x=0;x<S.length;x++){const E=S.charCodeAt(x),t=E<128?ye[E]:-1;if(t<0)return;k=(k<<6|t)&16777215,M+=6,M>=8&&(M-=8,f[p++]=k>>M&255)}return f}function O(b){const S=/^\s*data:image\/(png|jpeg|jpg)(?:;[^,;]*=[^,;]*)*;base64,([\s\S]*)$/i.exec(b);if(!S)return;const f=de(S[2]);if(f)try{const M=S[1].toLowerCase()==="png"?"png":"jpeg",{width:k,height:p}=M==="png"?z(f):W(f);return k&&p?{image:{format:M,data:f},width:k,height:p}:void 0}catch(M){if(M instanceof ie&&M.code==="RESOURCE_LIMIT")throw M;return}}const se=Object.freeze({svgDataImage:O});return be.set("f54d4d4723150fc5bcef9dc5e60d5b819452cd5007edfa3494a3c876459a0b01",se),se})(),Et=be.get("5dab75a1e2b113e5358c4e759fad101ac6fe31a376053e16a415e66ff02f7ff7")??(()=>{const{NotSupportedError:ie}=Fe,W=/([A-Za-z_][\w.:-]*)\s*=\s*("([^"]*)"|'([^']*)')/y,z={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",nbsp:" "};function fe(O){return O.indexOf("&")<0?O:O.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[A-Za-z]+);/g,(se,b)=>{if(b[0]==="#"){const S=b[1]==="x"||b[1]==="X"?parseInt(b.slice(2),16):parseInt(b.slice(1),10);return S>0&&S<=1114111&&!(S>=55296&&S<=57343)?String.fromCodePoint(S):"�"}return z[b]??se})}function ye(O,se=256){if(typeof O!="string")throw new TypeError("Chart SVG must be serialized markup.");const b=[];let S,f=0;const M=k=>{const p=b[b.length-1];p&&k&&p.children.push(k)};for(;f<O.length;){const k=O.indexOf("<",f);if(k<0){M(fe(O.slice(f)));break}if(k>f&&M(fe(O.slice(f,k))),O.startsWith("<!--",k)){const r=O.indexOf("-->",k+4);if(r<0)throw new TypeError("Chart SVG has an unterminated comment.");f=r+3;continue}if(O.startsWith("<![CDATA[",k)){const r=O.indexOf("]]>",k+9);if(r<0)throw new TypeError("Chart SVG has an unterminated CDATA section.");M(O.slice(k+9,r)),f=r+3;continue}if(O[k+1]==="?"){const r=O.indexOf("?>",k+2);if(r<0)throw new TypeError("Chart SVG has an unterminated processing instruction.");f=r+2;continue}if(O[k+1]==="!"){if(/^<!DOCTYPE[^>]*\[/i.test(O.slice(k,k+1024)))throw new ie("Chart SVG with an internal DTD subset is not supported.");const r=O.indexOf(">",k+2);if(r<0)throw new TypeError("Chart SVG has an unterminated declaration.");f=r+1;continue}if(O[k+1]==="/"){const r=O.indexOf(">",k+2);if(r<0)throw new TypeError("Chart SVG has an unterminated end tag.");const l=O.slice(k+2,r).trim(),g=b.pop();if(!g||g.name!==l)throw new TypeError("Chart SVG end tag </"+l+"> does not match its element.");const i=g;b.length?b[b.length-1].children.push(i):S=i,f=r+1;continue}const p=/^<([A-Za-z_][\w.:-]*)/.exec(O.slice(k,k+256));if(!p)throw new TypeError("Chart SVG has an invalid start tag.");const x=p[1],E=new Map;let t=k+p[0].length,n=!1;for(;;){for(;t<O.length&&/\s/.test(O[t]);)t++;const r=O[t];if(r===void 0)throw new TypeError("Chart SVG has an unterminated start tag.");if(r===">"){t++;break}if(r==="/"&&O[t+1]===">"){t+=2,n=!0;break}W.lastIndex=t;const l=W.exec(O);if(!l)throw new TypeError("Chart SVG has an invalid attribute on <"+x+">.");E.set(l[1],fe(l[3]??l[4]??"")),t=W.lastIndex}if(S)throw new TypeError("Chart SVG must have one root element.");const c=x.slice(x.indexOf(":")+1),a={name:x,local:c,attributes:E,children:[]};if(n)b.length?b[b.length-1].children.push(a):S=a;else{if(b.length>=se)throw new ie("Chart SVG nesting exceeds "+se+" levels.");b.push(a)}f=t}if(b.length)throw new TypeError("Chart SVG has an unclosed <"+b[b.length-1].name+"> element.");if(!S||S.local!=="svg")throw new TypeError("Chart SVG must have an <svg> root element.");return S}const de=Object.freeze({parseSvgMarkup:ye});return be.set("5dab75a1e2b113e5358c4e759fad101ac6fe31a376053e16a415e66ff02f7ff7",de),de})(),St=be.get("aa2e4d4a785e0f5ad98b5ca9eb14387d1335d0d7df8005063972b69a7a07eab0")??(()=>{const ie=[1,0,0,1,0,0];function W(t,n){return[t[0]*n[0]+t[2]*n[1],t[1]*n[0]+t[3]*n[1],t[0]*n[2]+t[2]*n[3],t[1]*n[2]+t[3]*n[3],t[0]*n[4]+t[2]*n[5]+t[4],t[1]*n[4]+t[3]*n[5]+t[5]]}function z(t,n,c){return[t[0]*n+t[2]*c+t[4],t[1]*n+t[3]*c+t[5]]}function fe(t){return t[0]*t[3]-t[1]*t[2]}function ye(t){return Math.sqrt(Math.abs(fe(t)))}const de=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g;function O(t){return(t.match(de)??[]).map(Number)}function se(t){if(t===void 0||!t.trim()||t.trim()==="none")return ie;let n=ie,c=t.trim();const a=/^([a-zA-Z]+)\s*\(([^)]*)\)\s*,?\s*/;for(;c;){const r=a.exec(c);if(!r)return;const l=r[1],g=r[2].trim(),i=[],m=/([+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)([a-z%]*)/gi;let N=0;for(const A of g.matchAll(m)){const H=g.slice(N,A.index);if(!/^\s*,?\s*$/.test(H)||!i.length&&H)return;const U=A[2].toLowerCase(),_=Number(A[1]),y=!i.length&&(l==="rotate"||l==="skewX"||l==="skewY");if(!U||U==="px"&&l==="translate")i.push(_);else if(y&&U==="deg")i.push(_);else if(y&&U==="rad")i.push(_*180/Math.PI);else if(y&&U==="grad")i.push(_*.9);else if(y&&U==="turn")i.push(_*360);else return;N=A.index+A[0].length}if(N!==g.length)return;let K;if(l==="matrix"&&i.length===6)K=i;else if(l==="translate"&&(i.length===1||i.length===2))K=[1,0,0,1,i[0],i[1]??0];else if(l==="scale"&&(i.length===1||i.length===2))K=[i[0],0,0,i[1]??i[0],0,0];else if(l==="rotate"&&(i.length===1||i.length===3)){const A=i[0]*Math.PI/180,H=Math.cos(A),U=Math.sin(A),_=i[1]??0,y=i[2]??0;K=W(W([1,0,0,1,_,y],[H,U,-U,H,0,0]),[1,0,0,1,-_,-y])}else if(l==="skewX"&&i.length===1)K=[1,0,Math.tan(i[0]*Math.PI/180),1,0,0];else if(l==="skewY"&&i.length===1)K=[1,Math.tan(i[0]*Math.PI/180),0,1,0,0];else return;n=W(n,K),c=c.slice(r[0].length)}return n.every(Number.isFinite)?n:void 0}function b(t,n,c,a,r,l,g,i,m,N){if(n===m&&c===N)return;if(a=Math.abs(a),r=Math.abs(r),!a||!r){t.push({op:"line",x:m,y:N});return}const K=l*Math.PI/180,A=Math.cos(K),H=Math.sin(K),U=(n-m)/2,_=(c-N)/2,y=A*U+H*_,w=-H*U+A*_,he=y*y/(a*a)+w*w/(r*r);if(he>1){const ee=Math.sqrt(he);a*=ee,r*=ee}const L=g===i?-1:1,pe=a*a*r*r-a*a*w*w-r*r*y*y,R=L*Math.sqrt(Math.max(0,pe/(a*a*w*w+r*r*y*y))),re=R*a*w/r,ne=-R*r*y/a,oe=A*re-H*ne+(n+m)/2,B=H*re+A*ne+(c+N)/2,me=(ee,Oe,ve,_e)=>Math.atan2(ee*_e-Oe*ve,ee*ve+Oe*_e),ke=me(1,0,(y-re)/a,(w-ne)/r);let ge=me((y-re)/a,(w-ne)/r,(-y-re)/a,(-w-ne)/r);!i&&ge>0?ge-=2*Math.PI:i&&ge<0&&(ge+=2*Math.PI);const ae=Math.max(1,Math.ceil(Math.abs(ge)/(Math.PI/2)-1e-9)),Me=ge/ae,xe=4/3*Math.tan(Me/4),ue=ee=>[oe+a*Math.cos(ee)*A-r*Math.sin(ee)*H,B+a*Math.cos(ee)*H+r*Math.sin(ee)*A],Te=ee=>[-a*Math.sin(ee)*A-r*Math.cos(ee)*H,-a*Math.sin(ee)*H+r*Math.cos(ee)*A];for(let ee=0;ee<ae;ee++){const Oe=ke+ee*Me,ve=Oe+Me,[_e,We]=ue(Oe),[Re,Ae]=ee===ae-1?[m,N]:ue(ve),[G,q]=Te(Oe),[ze,Ce]=Te(ve);t.push({op:"cubic",x1:_e+xe*G,y1:We+xe*q,x2:Re-xe*ze,y2:Ae-xe*Ce,x:Re,y:Ae})}}function S(t){const n=[],c=/([MmLlHhVvCcSsQqTtAaZz])|([+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)|([\s,]+)|(.)/g,a=[];let r=!1,l=!1;for(const L of t.matchAll(c)){if(L[4]!==void 0||l&&L[1]!==void 0){r=!0;break}const pe=L[3];if(pe?.includes(",")){const R=a.at(-1);if(R===void 0||/^[A-Za-z]$/.test(R)||pe.indexOf(",")!==pe.lastIndexOf(",")){r=!0;break}l=!0;continue}(L[1]!==void 0||L[2]!==void 0)&&a.push(L[1]??L[2]),l=!1}r||=l;let g=0,i=0,m=0,N=0,K=0,A="",H,U,_=!1;const y=L=>L!==void 0&&/^[A-Za-z]$/.test(L),w=()=>{const L=a[g];if(L===void 0||y(L))return;g++;const pe=Number(L);return Number.isFinite(pe)?pe:void 0},he=()=>{const L=a[g];if(!(L===void 0||y(L))){if(L==="0"||L==="1")return g++,Number(L);if(/^[01][\d.]/.test(L))return a[g]=L.slice(1),Number(L[0])}};for(;g<a.length;){const L=a[g];if(y(L))A=L,g++;else if(!A||A==="Z"||A==="z")return{commands:n,malformed:!0};const pe=A===A.toLowerCase(),R=A.toUpperCase();if(!n.length&&R!=="M")return{commands:n,malformed:!0};const re=pe?i:0,ne=pe?m:0;if(R==="Z"){_&&n.push({op:"close"}),i=N,m=K,_=!1,H=U=void 0;continue}const oe=()=>{_||(n.push({op:"move",x:i,y:m}),_=!0)};if(R==="M"){const B=w(),me=w();if(B===void 0||me===void 0)return{commands:n,malformed:!0};i=re+B,m=ne+me,N=i,K=m,n.push({op:"move",x:i,y:m}),_=!0,A=pe?"l":"L",H=U=void 0;continue}if(R==="L"||R==="H"||R==="V"){const B=w();if(B===void 0)return{commands:n,malformed:!0};const me=R==="L"?w():void 0;if(R==="L"&&me===void 0)return{commands:n,malformed:!0};oe(),R!=="V"&&(i=re+B),R!=="H"&&(m=ne+(me??B)),n.push({op:"line",x:i,y:m}),H=U=void 0;continue}if(R==="C"||R==="S"){const B=[];for(let Te=R==="C"?6:4;Te>0;Te--){const ee=w();if(ee===void 0)return{commands:n,malformed:!0};B.push(ee)}const[me,ke]=R==="C"?[re+B[0],ne+B[1]]:H?[2*i-H[0],2*m-H[1]]:[i,m],ge=R==="C"?B.slice(2):B,ae=re+ge[0],Me=ne+ge[1],xe=re+ge[2],ue=ne+ge[3];oe(),n.push({op:"cubic",x1:me,y1:ke,x2:ae,y2:Me,x:xe,y:ue}),H=[ae,Me],U=void 0,i=xe,m=ue;continue}if(R==="Q"||R==="T"){const B=[];for(let Me=R==="Q"?4:2;Me>0;Me--){const xe=w();if(xe===void 0)return{commands:n,malformed:!0};B.push(xe)}const[me,ke]=R==="Q"?[re+B[0],ne+B[1]]:U?[2*i-U[0],2*m-U[1]]:[i,m],ge=re+B[B.length-2],ae=ne+B[B.length-1];oe(),n.push({op:"cubic",x1:i+2/3*(me-i),y1:m+2/3*(ke-m),x2:ge+2/3*(me-ge),y2:ae+2/3*(ke-ae),x:ge,y:ae}),U=[me,ke],H=void 0,i=ge,m=ae;continue}if(R==="A"){const B=w(),me=w(),ke=w(),ge=he(),ae=he(),Me=w(),xe=w();if(B===void 0||me===void 0||ke===void 0||ge===void 0||ae===void 0||Me===void 0||xe===void 0)return{commands:n,malformed:!0};oe(),b(n,i,m,B,me,ke,ge===1,ae===1,re+Me,ne+xe),i=re+Me,m=ne+xe,H=U=void 0;continue}return{commands:n,malformed:!0}}return{commands:n,malformed:r}}const f=.5522847498307936;function M(t,n,c,a){const r=c*f,l=a*f;return[{op:"move",x:t+c,y:n},{op:"cubic",x1:t+c,y1:n+l,x2:t+r,y2:n+a,x:t,y:n+a},{op:"cubic",x1:t-r,y1:n+a,x2:t-c,y2:n+l,x:t-c,y:n},{op:"cubic",x1:t-c,y1:n-l,x2:t-r,y2:n-a,x:t,y:n-a},{op:"cubic",x1:t+r,y1:n-a,x2:t+c,y2:n-l,x:t+c,y:n},{op:"close"}]}function k(t,n,c,a,r,l){if(r=Math.min(Math.max(r,0),c/2),l=Math.min(Math.max(l,0),a/2),!r||!l)return[{op:"move",x:t,y:n},{op:"line",x:t+c,y:n},{op:"line",x:t+c,y:n+a},{op:"line",x:t,y:n+a},{op:"close"}];const g=r*(1-f),i=l*(1-f),m=t+c,N=n+a;return[{op:"move",x:t+r,y:n},{op:"line",x:m-r,y:n},{op:"cubic",x1:m-g,y1:n,x2:m,y2:n+i,x:m,y:n+l},{op:"line",x:m,y:N-l},{op:"cubic",x1:m,y1:N-i,x2:m-g,y2:N,x:m-r,y:N},{op:"line",x:t+r,y:N},{op:"cubic",x1:t+g,y1:N,x2:t,y2:N-i,x:t,y:N-l},{op:"line",x:t,y:n+l},{op:"cubic",x1:t,y1:n+i,x2:t+g,y2:n,x:t+r,y:n},{op:"close"}]}function p(t,n){const c=[];for(let a=0;a+1<t.length;a+=2)c.push({op:a?"line":"move",x:t[a],y:t[a+1]});return n&&c.length&&c.push({op:"close"}),c}function x(t,n){return t.map(c=>{if(c.op==="close")return c;const[a,r]=z(n,c.x,c.y);if(c.op==="cubic"){const[l,g]=z(n,c.x1,c.y1),[i,m]=z(n,c.x2,c.y2);return{op:"cubic",x1:l,y1:g,x2:i,y2:m,x:a,y:r}}return{op:c.op,x:a,y:r}})}const E=Object.freeze({identity:ie,multiply:W,apply:z,determinant:fe,scaleOf:ye,numbers:O,parseTransform:se,parsePathData:S,ellipse:M,rectangle:k,polyline:p,transformCommands:x});return be.set("aa2e4d4a785e0f5ad98b5ca9eb14387d1335d0d7df8005063972b69a7a07eab0",E),E})(),kt=be.get("f2ed937ff699a1d52b7e285a0008b74f6cc95abfd4bdbeb65a6fd71beb3610e5")??(()=>{const ie={black:"000000",white:"ffffff",red:"ff0000",green:"008000",blue:"0000ff",yellow:"ffff00",orange:"ffa500",purple:"800080",gray:"808080",grey:"808080",silver:"c0c0c0",maroon:"800000",navy:"000080",teal:"008080",olive:"808000",lime:"00ff00",aqua:"00ffff",cyan:"00ffff",fuchsia:"ff00ff",magenta:"ff00ff",darkgray:"a9a9a9",darkgrey:"a9a9a9",lightgray:"d3d3d3",lightgrey:"d3d3d3",dimgray:"696969",dimgrey:"696969",gainsboro:"dcdcdc",whitesmoke:"f5f5f5",steelblue:"4682b4",slategray:"708090",slategrey:"708090",crimson:"dc143c",tomato:"ff6347",gold:"ffd700",indigo:"4b0082",brown:"a52a2a",pink:"ffc0cb",coral:"ff7f50",salmon:"fa8072",seagreen:"2e8b57",forestgreen:"228b22",royalblue:"4169e1",darkblue:"00008b",darkred:"8b0000",darkgreen:"006400",darkorange:"ff8c00",lightblue:"add8e6",skyblue:"87ceeb",tan:"d2b48c",violet:"ee82ee"},W=(p,x,E)=>Math.min(E,Math.max(x,p));function z(p,x){const E=parseFloat(p);return p.trim().endsWith("%")?E/100*x:E}function fe(p){if(p===void 0)return 1;if(p.trim()==="none")return 0;if(/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?%?$/i.test(p.trim()))return W(z(p,1),0,1)}function ye(p,x){const[E,t]=p.split("/"),n=E.includes(",")?E.split(",").map(c=>c.trim()).filter(Boolean):E.trim().split(/\s+/);return x&&t===void 0&&n.length===4?{values:n.slice(0,3),alpha:n[3]}:{values:n,alpha:t?.trim()}}function de(p){const x=W(p,0,1);return 255*(x<=.0031308?12.92*x:1.055*Math.pow(x,1/2.4)-.055)}function O(p,x,E,t){const n=Math.pow(p+.3963377774*x+.2158037573*E,3),c=Math.pow(p-.1055613458*x-.0638541728*E,3),a=Math.pow(p-.0894841775*x-1.291485548*E,3),r=4.0767416621*n-3.3077115913*c+.2309699292*a,l=-1.2684380046*n+2.6097574011*c-.3413193965*a,g=-.0041960863*n-.7034186147*c+1.707614701*a;if([r,l,g].every(Number.isFinite))return{r:de(r),g:de(l),b:de(g),a:t}}function se(p){const x=parseFloat(p);return p.endsWith("turn")?x*360:p.endsWith("rad")?x*180/Math.PI:x}function b(p){const x=p.trim().toLowerCase();if(!x)return;if(x==="transparent")return{r:0,g:0,b:0,a:0};const E=/^#([0-9a-f]{3,8})$/.exec(x)?.[1];if(E){if(E.length===3||E.length===4){const[i,m,N,K]=[...E].map(A=>parseInt(A+A,16));return{r:i,g:m,b:N,a:K===void 0?1:K/255}}return E.length===6||E.length===8?{r:parseInt(E.slice(0,2),16),g:parseInt(E.slice(2,4),16),b:parseInt(E.slice(4,6),16),a:E.length===8?parseInt(E.slice(6),16)/255:1}:void 0}const t=ie[x];if(t)return b("#"+t);const n=/^([a-z]+)\((.*)\)$/.exec(x);if(!n)return;const c=n[1],{values:a,alpha:r}=ye(n[2],c!=="color");if(a.some(i=>!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|deg|rad|turn)?$/.test(i)&&i!=="none")&&c!=="color")return;const l=fe(r);if(l===void 0)return;const g=a.map(i=>i==="none"?"0":i);if((c==="rgb"||c==="rgba")&&g.length===3)return{r:W(z(g[0],255),0,255),g:W(z(g[1],255),0,255),b:W(z(g[2],255),0,255),a:l};if((c==="hsl"||c==="hsla")&&g.length===3){const i=(se(g[0])%360+360)%360/360,m=W(parseFloat(g[1])/100,0,1),N=W(parseFloat(g[2])/100,0,1),K=N<.5?N*(1+m):N+m-N*m,A=2*N-K,H=U=>(U=(U+1)%1,255*(U<1/6?A+(K-A)*6*U:U<.5?K:U<2/3?A+(K-A)*(2/3-U)*6:A));return{r:H(i+1/3),g:H(i),b:H(i-1/3),a:l}}if(c==="oklab"&&g.length===3)return O(z(g[0],1),z(g[1],.4),z(g[2],.4),l);if(c==="oklch"&&g.length===3){const i=z(g[0],1),m=z(g[1],.4),N=se(g[2])*Math.PI/180;return O(i,m*Math.cos(N),m*Math.sin(N),l)}if(c==="color"&&g.length===4&&(g[0]==="srgb"||g[0]==="srgb-linear")){const i=g.slice(1).map(N=>z(N,1)),m=g[0]==="srgb"?N=>W(N,0,1)*255:de;return i.every(Number.isFinite)?{r:m(i[0]),g:m(i[1]),b:m(i[2]),a:l}:void 0}}function S(p,x){const E=W(p.a*x,0,1);if(E<.002)return;const t=n=>Math.round(W(n,0,255)*E+255*(1-E)).toString(16).padStart(2,"0").toUpperCase();return t(p.r)+t(p.g)+t(p.b)}function f(p){const x=new Map;if(!p)return x;const E=new Set;for(const t of p.split(";")){const n=t.indexOf(":");if(n<0)continue;const c=t.slice(0,n).trim().toLowerCase(),a=t.slice(n+1),r=/!\s*important\s*$/i,l=a.replace(r,"").trim(),g=r.test(a);!c||!l||E.has(c)&&!g||(g&&E.add(c),x.set(c,l))}return x}function M(p,x,E=0){if(p===void 0)return;const t=/^\s*([+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)\s*(px|pt|pc|mm|cm|in|em|rem|ex|%)?\s*$/.exec(p);if(!t)return;const n=Number(t[1]),c=t[2],a=c===void 0||c==="px"?1:c==="pt"?4/3:c==="pc"?16:c==="mm"?96/25.4:c==="cm"?96/2.54:c==="in"?96:c==="em"?x:c==="rem"?16:c==="ex"?x/2:E/100,r=n*a;return Number.isFinite(r)?r:void 0}const k=Object.freeze({alpha:fe,parseColor:b,flatten:S,parseStyle:f,length:M});return be.set("f2ed937ff699a1d52b7e285a0008b74f6cc95abfd4bdbeb65a6fd71beb3610e5",k),k})(),Qe=be.get("121725bdf2bbb700556fc2c27134a47be8f7f0314a1bcffdab5bbc886f1ef089")??(()=>{const{standardCode:ie}=gt,W=new Map([[8722,"-"],[8208,"-"],[8209,"-"],[8210,"-"],[8201," "],[8202," "],[8239," "],[8199," "],[8194," "],[8195," "],[8203,""],[8206,""],[8207,""],[8288,""],[65279,""]]),z=new Map([[321,"L"],[322,"l"],[272,"D"],[273,"d"],[294,"H"],[295,"h"],[305,"i"],[319,"L"],[320,"l"],[358,"T"],[359,"t"],[384,"b"],[407,"I"],[437,"Z"],[438,"z"],[7838,"SS"]]);function fe(O){const se=z.get(O.codePointAt(0));if(se!==void 0)return se;if(!/\p{Script=Latin}/u.test(O))return;const b=O.normalize("NFD").replace(/\p{Mark}+/gu,"");return b&&b!==O&&[...b].every(S=>ie(S.codePointAt(0))!==void 0)?b:void 0}function ye(O,se){let b="";const S=O.normalize("NFC").replace(/(\p{Script=Latin})\p{Mark}+/gu,(f,M)=>(se(),M));for(const f of S){const M=f.codePointAt(0);if(M===173)continue;if(ie(M)!==void 0){b+=f;continue}if(M===10||M===13||M===9){b+=f;continue}const k=W.get(M);if(k!==void 0){b+=k;continue}se(),b+=fe(f)??"?"}return b}const de=Object.freeze({winAnsiText:ye});return be.set("121725bdf2bbb700556fc2c27134a47be8f7f0314a1bcffdab5bbc886f1ef089",de),de})(),Ct=be.get("11cb7de812b31909ea7f244067c0bbb605bdb3c85ca2e304d9b006893fb22eed")??(()=>{const{NotSupportedError:ie,OfficeIMOError:W}=Fe,{checkAbort:z}=ut,{pdfNumber:fe}=ht,{capturePdfLimits:ye,pdfDrawingLimits:de,pdfDrawingMaxDepth:O}=He,{svgDataImage:se}=Tt,{parseSvgMarkup:b}=Et,{apply:S,determinant:f,ellipse:M,identity:k,multiply:p,numbers:x,parsePathData:E,parseTransform:t,polyline:n,rectangle:c,scaleOf:a,transformCommands:r}=St,{alpha:l,flatten:g,length:i,parseColor:m,parseStyle:N}=kt,{winAnsiText:K}=Qe,A=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-opacity","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","paint-order","stroke-dasharray","stroke-dashoffset","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","color","visibility","white-space"]),H=["opacity","display","clip-path","mask","filter","marker-start","marker-mid","marker-end","vector-effect","overflow"],U=new Set(["defs","clipPath","mask","marker","pattern","linearGradient","radialGradient","symbol","script","title","desc","metadata","filter","stop","font","font-face"]),_=new Set(["svg","symbol","g","a","use","switch"]),y=new Set(["path","rect","circle","ellipse","line","polyline","polygon"]),w=new Map([["fill","black"],["stroke","none"],["stroke-width","1"],["font-size","16"],["color","black"]]),he=R=>{const ne=Math.hypot(R[0],R[1]),oe=Math.hypot(R[2],R[3]);return Math.abs(ne-oe)>1e-6*Math.max(ne,oe)||Math.abs(R[0]*R[2]+R[1]*R[3])>1e-6*ne*oe};function L(R,re,ne,oe){const B=re.limits===void 0?void 0:ye(re.limits),me=B?.maxDrawingElements??de.maxDrawingElements,ke=B?.maxVectorCommands??de.maxVectorCommands,ge=Math.max(4096,16*Math.max(me,ke));let ae=0,Me=0,xe=0;const ue=(e=1)=>{if(z(oe),xe+=e,xe>ge)throw new W("RESOURCE_LIMIT","Chart SVG conversion work limit exceeded.")},Te=e=>{e&&ue(Math.ceil(e.length/16))},ee=(e,s)=>{if(++ae>me)throw new W("RESOURCE_LIMIT","maxDrawingElements exceeded.");e.push(s)};typeof R=="string"&&ue(Math.ceil(R.length/16));const Oe=b(R),ve=new Map,_e=new Set,We=new Set(re.fonts??["regular","bold","italic","boldItalic"]),Re=re.winAnsi!==!1,Ae=e=>{ue();const s=e.attributes.get("id");s!==void 0&&!ve.has(s)&&ve.set(s,e);for(const D of e.children)typeof D!="string"&&Ae(D)};Ae(Oe);const G=(e,s)=>{if(re.unsupported==="reject")throw new ie("Unsupported chart SVG feature: "+e+(s?" (<"+s+">)":""));if(_e.has(e))return;_e.add(e);const D=s===void 0?{code:e}:{code:e,element:s};re.onDiagnostic?.(D)},q=(e,s)=>e.attributes.get(s),ze=(e,s,D,P,T=!1,F)=>{const o=q(e,"viewBox");Te(o);const u=x(o??""),I=u.length===4&&u[2]>0&&u[3]>0,V=T||!I?D:u[2],Y=T||!I?P:u[3],te=F?.width??i(q(e,"width"),s,V)??V,C=F?.height??i(q(e,"height"),s,Y)??Y;if(!I)return{width:te,height:C,userWidth:te,userHeight:C,originZero:!0,matrix:k};const h=(q(e,"preserveAspectRatio")??"xMidYMid meet").trim().split(/\s+/);let d=te/u[2],X=C/u[3],le=0,v=0;if(h[0]!=="none"){const Q=h[1]==="slice"?Math.max(d,X):Math.min(d,X),$=h[0]??"xMidYMid";le=(te-u[2]*Q)*($.includes("xMid")?.5:$.includes("xMax")?1:0),v=(C-u[3]*Q)*($.includes("YMid")?.5:$.includes("YMax")?1:0),d=X=Q}const j=[d,0,0,X,le-u[0]*d,v-u[1]*X];return{width:te,height:C,userWidth:u[2],userHeight:u[3],originZero:u[0]===0&&u[1]===0,matrix:j}},Ce=ze(Oe,16,0,0);if(!(Ce.width>0&&Ce.height>0))throw new TypeError("Chart SVG needs a positive width and height or viewBox.");const De=Math.min(.75,14400/Ce.width,14400/Ce.height),Je=Math.min(14400,Ce.width*De),et=Math.min(14400,Ce.height*De),tt=[];function Le(e){const s=q(e,"style");return Te(s),N(s)}function Ue(e,s,D,P){const T=I=>s.get(I)??q(e,I),F=T("transform");Te(F);const o=t(F);if(!o){G("TRANSFORM_UNSUPPORTED",e.local);return}if(o[0]===1&&o[1]===0&&o[2]===0&&o[3]===1)return o;const u=T("transform-box")??"view-box";if(D.viewportOriginZero&&["view-box","initial","unset"].includes(u)){const I=T("transform-origin");if(I===void 0)return o;Te(I);const[V,Y,te,C]=I.trim().split(/\s+/,4),h=i(V,P,D.userWidth),d=i(Y,P,D.userHeight);if(h!==void 0&&d!==void 0&&(te===void 0||/^0(?:px)?$/.test(te))&&C===void 0)return[o[0],o[1],o[2],o[3],o[4]+h-o[0]*h-o[2]*d,o[5]+d-o[1]*h-o[3]*d]}G("TRANSFORM_ORIGIN_IGNORED",e.local)}function nt(e,s){const D=Le(e),P=new Map;let T=s.style,F=!1;const o=j=>D.get(j)??q(e,j);for(const j of A){const Q=o(j);if(Q===void 0||Q==="inherit"||Q==="unset")continue;const $=Q==="initial"?w.get(j):Q;$!==s.style.get(j)&&(F||(T=new Map(s.style),F=!0),$===void 0?T.delete(j):T.set(j,$))}for(const j of H){const Q=o(j);Q!==void 0&&P.set(j,Q)}if(P.get("display")==="none")return;const u=o("font-size"),I=u==="initial"?16:u!==void 0?vt(u,s.fontSize):s.fontSize,V=Ue(e,D,s,I),Y=P.get("overflow")?.trim(),te=e.local==="image"||(e.local==="svg"||e.local==="symbol")&&e!==Oe,C=Y==="inherit"?s.overflowVisible:Y===void 0||Y==="revert"?!te:/^(?:visible(?:\s+visible)?|initial|unset)$/.test(Y),h=P.get("opacity"),d=ne===2&&h?.trim()==="inherit"?s.localOpacity:l(h)??1,X=ne===2&&_.has(e.local)&&d>0&&d<1;!X&&d<1&&d>0&&e.local!=="image"&&G("OPACITY_FLATTENED",e.local);const le=q(e,"xml:space");return{context:{...s,matrix:p(s.matrix,V??k),imageTransformValid:s.imageTransformValid&&V!==void 0,style:T,fontSize:I,localOpacity:d,opacity:s.opacity*d,overflowVisible:C,...le===void 0?{}:{xmlSpace:le}},own:P,declared:D,groupOpacity:X}}function vt(e,s){const P={"xx-small":9,"x-small":10,small:13,medium:16,large:18,"x-large":24,"xx-large":32}[e.trim()]??i(e,s,s);return P!==void 0&&P>0?P:s}function je(e,s,D,P){if(e===void 0||e==="none")return;ue(Math.ceil(e.length/16));let T;const F=/^url\(\s*["']?#([^"')]+)["']?\s*\)\s*(.*)$/.exec(e.trim());if(F){const u=ve.get(F[1]),I=F[2].trim();if(u&&(u.local==="linearGradient"||u.local==="radialGradient"))T=_t(u),G("GRADIENT_FLATTENED",P);else if(I&&I!=="none")T=m(I);else{G("PAINT_UNSUPPORTED",P);return}}else if(e.trim().toLowerCase()==="currentcolor"){const u=s.style.get("color")??"black";Te(u),T=m(u)}else T=m(e);if(!T){G("COLOR_UNSUPPORTED",P);return}const o=(l(s.style.get(D))??1)*s.opacity;return T.a*o<1&&T.a*o>=.002&&G("OPACITY_FLATTENED",P),g(T,o)}function _t(e){const s=new Set;let D=e;for(;D&&!s.has(D);){ue(),s.add(D);for(const T of D.children){if(ue(),typeof T=="string"||T.local!=="stop")continue;const F=Le(T),o=F.get("stop-color")??q(T,"stop-color")??"black";ue(Math.ceil(o.length/16));const u=m(o),I=l(F.get("stop-opacity")??q(T,"stop-opacity"))??1;return u&&{...u,a:u.a*I}}const P=(q(D,"href")??q(D,"xlink:href"))?.replace(/^#/,"");D=P===void 0?void 0:ve.get(P)}}const it=new WeakMap;function Dt(e,s,D){const P=e[e.length-1];if(D!==void 0&&P&&P.kind==="path"&&it.get(P)===D&&P.commands.length+s.commands.length<=4096){P.commands.push(...s.commands);return}D!==void 0&&it.set(s,D),ee(e,s)}function Pt(e,s,D,P){const{userWidth:T,userHeight:F}=s,o=Math.hypot(T,F)/Math.SQRT2,u=(v,j=0)=>i(q(e,v),s.fontSize,j)??0;let I;switch(e.local){case"rect":{const v=u("width",T),j=u("height",F);if(!(v>0&&j>0))return;const Q=q(e,"rx"),$=q(e,"ry"),we=Q===void 0||Q==="auto"?u("ry",F):u("rx",T),Z=$===void 0||$==="auto"?we:u("ry",F);I=c(u("x",T),u("y",F),v,j,we,Z);break}case"circle":{const v=u("r",o);if(!(v>0))return;I=M(u("cx",T),u("cy",F),v,v);break}case"ellipse":{const v=u("rx",T),j=u("ry",F);if(!(v>0&&j>0))return;I=M(u("cx",T),u("cy",F),v,j);break}case"line":I=[{op:"move",x:u("x1",T),y:u("y1",F)},{op:"line",x:u("x2",T),y:u("y2",F)}];break;case"polyline":case"polygon":{const v=q(e,"points")??"";ue(Math.ceil(v.length/4)),I=n(x(v),e.local==="polygon");break}default:{const v=q(e,"d")??"";ue(Math.ceil(v.length/4));const j=E(v);j.malformed&&G("PATH_DATA_TRUNCATED","path"),I=j.commands}}if(!I.length)return;for(const v of["marker-start","marker-mid","marker-end"])P.get(v)&&P.get(v)!=="none"&&G("MARKER_IGNORED",e.local);const V=e.local==="line"?void 0:je(s.style.get("fill"),s,"fill-opacity",e.local),Y=je(s.style.get("stroke"),s,"stroke-opacity",e.local);if(V===void 0&&Y===void 0)return;const te=P.get("vector-effect")==="non-scaling-stroke",C=te?De:a(s.matrix),h=(i(s.style.get("stroke-width"),s.fontSize,o)??1)*C;if(Y!==void 0&&!(h>0)&&V===void 0)return;if(Me+=I.length,Me>ke)throw new W("RESOURCE_LIMIT","maxVectorCommands exceeded.");const d={kind:"path",commands:r(I,s.matrix)};if(V!==void 0&&(d.fill=V,s.style.get("fill-rule")==="evenodd"&&(d.fillRule="evenodd")),Y!==void 0&&h>0){!te&&he(s.matrix)&&G("STROKE_DISTORTED",e.local),d.stroke=Y,d.strokeWidth=h;const v=s.style.get("stroke-linecap"),j=s.style.get("stroke-linejoin");if((v==="round"||v==="square")&&(d.lineCap=v),j==="round"||j==="bevel")d.lineJoin=j;else{const Z=Number(s.style.get("stroke-miterlimit")??"4");Z>=0&&Z<1?d.lineJoin="bevel":Z>=1&&Z<=1e6?d.miterLimit=Z:(G("MITER_LIMIT_UNSUPPORTED",e.local),d.miterLimit=4)}const Q=s.style.get("paint-order");if(V!==void 0&&Q&&Q!=="normal"){Te(Q);const Z=Q.split(/\s+/),J=Z.indexOf("fill"),ce=Z.indexOf("stroke");ce>=0&&(J<0||ce<J)&&G("PAINT_ORDER_IGNORED",e.local)}const $=s.style.get("stroke-dasharray");Te($);const we=$?.trim();if(we!=="none"&&we){const Z=we.split(/[\s,]+/,17).map(J=>i(J,s.fontSize,o));if(Z.every(J=>J!==void 0&&J>=0)&&Z.some(J=>J>0)){const J=Z.map(Ie=>Ie*C),ce=s.style.get("stroke-dashoffset");Te(ce);const Se=(i(ce,s.fontSize,o)??0)*C;J.length<=16&&J.every(Ie=>Ie<=14400)&&J.some(Ie=>fe(Ie)!=="0")&&Math.abs(Se)<=1e6?(d.dash=J,Se&&(d.dashOffset=Se)):G("DASH_UNSUPPORTED",e.local)}else Z.some(J=>J===void 0||J<0)&&G("DASH_UNSUPPORTED",e.local)}}if(d.fill===void 0&&d.stroke===void 0)return;const X=d.fill===void 0||(d.stroke===void 0||d.stroke===d.fill)&&d.fillRule===void 0&&["rect","circle","ellipse"].includes(e.local),le=f(s.matrix);Dt(D,d,X?JSON.stringify([d.fill,le<0,d.stroke,d.strokeWidth,d.lineCap,d.lineJoin,d.miterLimit,d.dash,d.dashOffset]):void 0)}function Nt(e,s,D){const P=[];let T=0,F=0,o,u=!1,I=!1;const V=C=>C.style.get("visibility")!=="hidden"&&C.style.get("visibility")!=="collapse"&&C.opacity>0,Y=()=>{const C=o?.context.style.get("text-anchor");u&&o?.text&&(C==="middle"||C==="end")&&G("TEXT_POSITIONS_SIMPLIFIED","text")},te=(C,h,d)=>{ue();const X=h.xmlSpace==="preserve"||/^pre/.test(h.style.get("white-space")??""),le=(Z,J)=>(q(C,Z)??"").trim().split(/[\s,]+/).filter(Boolean).map(ce=>i(ce,h.fontSize,J)).filter(ce=>ce!==void 0),v=le("x",h.userWidth),j=le("y",h.userHeight),Q=le("dx",h.userWidth),$=le("dy",h.userHeight);(v.length>1||j.length>1||Q.length>1||$.length>1||q(C,"rotate")!==void 0)&&G("TEXT_POSITIONS_SIMPLIFIED",C.local);const we=d||v.length>0||j.length>0||Q.length>0||$.length>0;!d&&we&&!v.length&&o?.text.trim()&&G("TEXT_POSITIONS_SIMPLIFIED",C.local),we&&(Y(),v.length&&(T=v[0],u=!1,I=!1),j.length&&(F=j[0]),T+=Q[0]??0,F+=$[0]??0,o={x:T,y:F,text:"",context:h,preserve:X},P.push(o));for(const Z of C.children){if(typeof Z=="string"){if(ue(1+Math.ceil(Z.length/16)),!o)continue;const ce=X&&Z.length>0||/[^\t\r\n ]/.test(Z);if(!V(h)){u||=ce,I||=/[ \t]/.test(Z)&&/[^\t\r\n ]$/.test(o.text);continue}if(!ce&&!V(o.context))continue;if(ce){const Ie=I&&/[^\t\r\n ]$/.test(o.text)&&/^[^\t\r\n ]/.test(Z);(u||Ie)&&G("TEXT_POSITIONS_SIMPLIFIED",C.local),u=I=!1}V(o.context)||(o.context=h,o.preserve=X);const Se=o.context;o.preserve!==X&&/[\t\r\n ]/.test(Z)&&G("TEXT_WHITESPACE_SIMPLIFIED",C.local),ce&&Se.matrix.some((Ie,Pe)=>Ie!==h.matrix[Pe])&&G("TEXT_TRANSFORM_IGNORED",C.local),(Se.style!==h.style||Se.fontSize!==h.fontSize||Se.opacity!==h.opacity)&&/\S/.test(Z)&&G("TEXT_STYLE_MERGED",C.local),o.text+=Z;continue}if(Z.local!=="tspan"&&Z.local!=="a"){Z.local==="textPath"&&G("TEXT_PATH_IGNORED","textPath");continue}const J=nt(Z,h);J&&te(Z,J.context,!1)}};te(e,s,!0),Y();for(const C of P){const h=C.context.style,{preserve:d}=C;let X=C.text.replace(/\t/g," ").replace(/[\r\n]/g,d?" ":"");if(d||(X=X.replace(/ {2,}/g," ")),C===P[0]&&!d&&(X=X.replace(/^ +/,"")),C===P[P.length-1]&&!d&&(X=X.replace(/ +$/,"")),!X||h.get("visibility")==="hidden"||h.get("visibility")==="collapse")continue;const le=je(h.get("fill"),C.context,"fill-opacity","text");if(le===void 0)continue;(h.get("stroke")??"none")!=="none"&&G("TEXT_STROKE_IGNORED","text");const v=C.context.matrix,j=a(v);(he(v)||f(v)<0)&&G("TEXT_DISTORTED","text");const Q=C.context.fontSize*j;if(!(Q>0))continue;const $=h.get("dominant-baseline")??h.get("alignment-baseline")??"auto",we=$==="middle"||$==="central"?.35:$==="hanging"||$==="text-before-edge"||$==="text-top"?.8:$==="text-after-edge"||$==="ideographic"||$==="text-bottom"?-.2:0,[Z,J]=S(v,C.x,C.y+we*C.context.fontSize),ce=Math.atan2(v[1],v[0])*180/Math.PI,Se=h.get("font-weight")??"normal",Ie=/italic|oblique/.test(h.get("font-style")??""),Pe=Se==="bold"||Se==="bolder"||Number(Se)>=600;let Ne=Pe&&Ie?"boldItalic":Pe?"bold":Ie?"italic":"regular";We.has(Ne)||(Ne="regular");const Ze=h.get("text-anchor"),Ve={kind:"text",text:Re?K(X,()=>G("TEXT_SUBSTITUTED","text")):X.normalize("NFC"),x:Z,y:J,font:Ne,fontSize:Q,color:le};Ve.text&&((Ze==="middle"||Ze==="end")&&(Ve.anchor=Ze),Math.abs(ce)>1e-6&&(Ve.rotation=Math.round(ce*1e6)/1e6),ee(D,Ve))}}function st(e){return e.children.some(s=>(ue(typeof s=="string"?1+Math.ceil(s.length/16):1),typeof s=="string"?/\S/.test(s):st(s)))}function Xe(e,s,D,P,T){if(P<=0||T<=0)return null;const F=Math.abs(e[1])<=1e-9&&Math.abs(e[2])<=1e-9,o=Math.abs(e[0])<=1e-9&&Math.abs(e[3])<=1e-9;if(!F&&!o)return;const[u,I]=S(e,s,D),[V,Y]=S(e,s+P,D+T),te=Math.max(0,Math.min(u,V)),C=Math.max(0,Math.min(I,Y)),h=Math.min(Je,Math.max(u,V)),d=Math.min(et,Math.max(I,Y));if([te,C,h,d].every(Number.isFinite))return h<=te||d<=C?null:{x:te,y:C,width:h-te,height:d-C}}function At(e,s,D){if(e===void 0||e==="none")return;Te(e);const P=/^url\(\s*["']?#([^"')]+)["']?\s*\)$/.exec(e.trim())?.[1],T=P===void 0?void 0:ve.get(P);if(T?.local!=="clipPath"){G("CLIP_IGNORED",D);return}const F=Le(T),o=F.get("visibility")??q(T,"visibility");let u,I=w;for(const $ of T.children){if(ue(),typeof $=="string")continue;const we=Le($);if((we.get("display")??q($,"display"))==="none")continue;const Z=we.get("visibility")??q($,"visibility"),J=Z===void 0||Z==="inherit"||Z==="unset"?o:Z;if(!(J==="hidden"||J==="collapse")){if(u||$.local!=="rect"){G("CLIP_IGNORED",D);return}u=$,I=we}}if(!u)return null;if(T.attributes.get("clipPathUnits")==="objectBoundingBox"){G("CLIP_IGNORED",D);return}const V=($,we)=>i(I.get($)??q(u,$),s.fontSize,we),Y=V("width",s.userWidth)??0,te=V("height",s.userHeight)??0;if(Y<=0||te<=0)return null;const C=V("rx",s.userWidth),h=V("ry",s.userHeight);if((C??h??0)>0&&(h??C??0)>0){G("CLIP_IGNORED",D);return}const d=Ue(T,F,s,s.fontSize),X=Ue(u,I,s,s.fontSize);if(!d||!X)return;const le=p(s.matrix,p(d,X)),v=V("x",s.userWidth)??0,j=V("y",s.userHeight)??0,Q=Xe(le,v,j,Y,te);return Q===void 0&&G("CLIP_IGNORED",D),Q}const rt=new Map;function Ft(e,s,D,P){const T=s.matrix;if(!s.imageTransformValid||Math.abs(T[1])>1e-9||Math.abs(T[2])>1e-9||!(T[0]>0)||!(T[3]>0)){G("IMAGE_SKIPPED","image");return}const F=(q(e,"href")??q(e,"xlink:href"))?.trim();let o=F===void 0?null:rt.get(F);if(F!==void 0&&o===void 0&&(ue(Math.ceil(F.length/16)),o=se(F)??null,rt.set(F,o)),!o){G("IMAGE_SKIPPED","image");return}const u=(ce,Se)=>i(D.get(ce)??q(e,ce),s.fontSize,Se),I=u("x",s.userWidth)??0,V=u("y",s.userHeight)??0,Y=u("width",s.userWidth),te=u("height",s.userHeight),C=Y??(te===void 0?o.width:te*o.width/o.height),h=te??(Y===void 0?o.height:Y*o.height/o.width);if(!(C>0&&h>0))return;let d={x:I,y:V,width:C,height:h},X;const le=q(e,"preserveAspectRatio")?.trim().replace(/^defer(?:\s+|$)/,""),[v="xMidYMid",j="meet"]=(le||"xMidYMid meet").split(/\s+/);if(v!=="none"){const ce=C/o.width,Se=h/o.height,Ie=j==="slice"?Math.max(ce,Se):Math.min(ce,Se),Pe=o.width*Ie,Ne=o.height*Ie;if(d={x:I+(C-Pe)*(v.includes("xMid")?.5:v.includes("xMax")?1:0),y:V+(h-Ne)*(v.includes("YMid")?.5:v.includes("YMax")?1:0),width:Pe,height:Ne},j==="slice"&&!s.overflowVisible&&(X=Xe(T,I,V,C,h),X===null))return}const[Q,$]=S(T,d.x,d.y),[we,Z]=S(T,d.x+d.width,d.y+d.height),J={kind:"image",image:o.image,x:Q,y:$,width:we-Q,height:Z-$,...s.opacity<1?{opacity:s.opacity}:{}};if(![Q,$,J.width,J.height].every(ce=>Number.isFinite(ce)&&Math.abs(ce)<=1e6)||!(J.width>0&&J.height>0)){G("IMAGE_SKIPPED","image");return}if(X&&s.clipDepth+1<O){const ce=[];ee(ce,J),ee(P,{kind:"group",clip:X,elements:ce})}else X&&G("CLIP_DEPTH_IGNORED","image"),ee(P,J)}function ot(e,s){if(e.length!==s+1)return!1;const D=e[s];return D.kind==="image"||D.kind==="group"&&ot(D.elements,0)}const $e=new Set;function Ge(e,s,D,P,T){if(ue(),U.has(e.local)&&!(e.local==="symbol"&&T))return;if(P>512)throw new ie("Chart SVG nesting is too deep.");if(e.local==="image"&&ne===1){G("IMAGE_SKIPPED","image");return}if(e.local==="foreignObject"){G("FOREIGN_OBJECT_SKIPPED","foreignObject");return}if(e.local==="style"){st(e)&&G("STYLESHEET_IGNORED","style");return}const F=nt(e,s);if(!F||F.context.opacity<=0)return;let{context:o}=F;const u=F.own;u.get("mask")&&u.get("mask")!=="none"&&G("MASK_IGNORED",e.local),u.get("filter")&&u.get("filter")!=="none"&&G("FILTER_IGNORED",e.local);let I;if((e.local==="svg"||e.local==="symbol")&&e!==Oe){const h=ze(e,o.fontSize,o.userWidth,o.userHeight,!0,T);if(!(h.width>0&&h.height>0))return;const d=i(q(e,"x"),o.fontSize,o.userWidth)??0,X=i(q(e,"y"),o.fontSize,o.userHeight)??0,le=p(o.matrix,[1,0,0,1,d,X]);if(!o.overflowVisible){const v=Xe(le,0,0,h.width,h.height);if(v===null)return;I=v,I||G("CLIP_IGNORED",e.local)}o={...o,userWidth:h.userWidth,userHeight:h.userHeight,viewportOriginZero:h.originZero,matrix:p(le,h.matrix)}}let V=At(u.get("clip-path"),o,e.local);if(V===null)return;if(V&&I){const h=Math.max(V.x,I.x),d=Math.max(V.y,I.y),X=Math.min(V.x+V.width,I.x+I.width)-h,le=Math.min(V.y+V.height,I.y+I.height)-d;if(X<=0||le<=0)return;V={x:h,y:d,width:X,height:le}}else V??=I;V&&(o.clipDepth+1>=O?(G("CLIP_DEPTH_IGNORED",e.local),V=void 0):o={...o,clipDepth:o.clipDepth+1});const Y=V?[]:D,te=Y.length,C=o.style.get("visibility")!=="hidden"&&o.style.get("visibility")!=="collapse";if(y.has(e.local))C&&Pt(e,o,Y,u);else if(e.local==="text")Nt(e,o,Y);else if(e.local==="image")C&&Ft(e,o,F.declared,Y);else if(e.local==="use"){const h=(q(e,"href")??q(e,"xlink:href"))?.replace(/^#/,""),d=h===void 0?void 0:ve.get(h);if(!d||$e.has(d))G("USE_UNRESOLVED","use");else{const X=i(q(e,"x"),o.fontSize,o.userWidth)??0,le=i(q(e,"y"),o.fontSize,o.userHeight)??0,v={...o,matrix:p(o.matrix,[1,0,0,1,X,le])};$e.add(d);const j={width:i(q(e,"width"),o.fontSize,o.userWidth),height:i(q(e,"height"),o.fontSize,o.userHeight)};Ge(d,v,Y,P+1,j),$e.delete(d)}}else if(e.local==="switch"){for(const h of e.children)if(ue(),typeof h!="string"){if(["systemLanguage","requiredExtensions","requiredFeatures"].some(d=>h.attributes.has(d))){G("SWITCH_CONDITION_IGNORED",h.local);continue}Ge(h,o,Y,P+1);break}}else if(_.has(e.local))for(const h of e.children)typeof h=="string"?ue():Ge(h,o,Y,P+1);else G("ELEMENT_SKIPPED",e.local);F.groupOpacity&&Y.length>te&&!ot(Y,te)&&G("OPACITY_FLATTENED",e.local),V&&Y.length&&ee(D,{kind:"group",clip:V,elements:Y})}return Ge(Oe,{matrix:[De*Ce.matrix[0],0,0,De*Ce.matrix[3],De*Ce.matrix[4],De*Ce.matrix[5]],userWidth:Ce.userWidth,userHeight:Ce.userHeight,viewportOriginZero:Ce.originZero,clipDepth:0,overflowVisible:!0,imageTransformValid:!0,style:w,fontSize:16,opacity:1,localOpacity:1},tt,0),{version:ne,width:Je,height:et,elements:tt,standardFonts:!0}}const pe=Object.freeze({svgToPdfDrawing:L});return be.set("11cb7de812b31909ea7f244067c0bbb605bdb3c85ca2e304d9b006893fb22eed",pe),pe})(),It=be.get("7f95b63decec4e2ba1f42fe3a3a9681568d33fb28d1017e9dd158b93eba26d36")??(()=>{const{ExportCell:ie}=bt,{NumberFormats:W}=yt,{ExportBudget:z}=Ke,fe=f=>f+" (display)";function ye(f){let M=!1,k=!1;for(const p of f.series)for(const x of p.points){if(!(x.x instanceof Date))continue;const E=x.x.getTime()%864e5;if(E%1e3)return"yyyy-mm-dd hh:mm:ss.000";E&&(M=!0),E%6e4&&(k=!0)}return k?"yyyy-mm-dd hh:mm:ss":M?"yyyy-mm-dd hh:mm":"yyyy-mm-dd"}function de(f){const M=f.xTitle;return f.kind==="date"?{key:"x",header:M,type:"date",format:f.xFormat??ye(f)}:f.kind==="number"?{key:"x",header:M,type:"number",...f.xFormat===void 0?{}:{format:f.xFormat}}:{key:"x",header:M,type:"string"}}const O=(f,M)=>M?f+" ("+M+")":f;function se(f){const M=new Map;for(const k of f.series){const p=new Set;for(const x of k.points){if(x.key===null||p.has(x.key))return!1;if(p.add(x.key),x.xCaption!==void 0){const E=M.get(x.key);if(E!==void 0&&E!==x.xCaption)return!1;M.set(x.key,x.xCaption)}}}return!0}function b(f,M="auto",k){if(M!=="auto"&&M!=="wide"&&M!=="long")throw new TypeError("Chart layout must be auto, wide or long.");const p=M!=="long"&&se(f);if(M==="wide"&&!p)throw new TypeError("A wide chart sheet needs unique x values in every series, consistent x captions, and no missing x values.");const x=new z(k),E=f.title?2:1;function t(y){if(x.row(y),y+E>1048576)throw new RangeError("Excel supports at most 1,048,576 rows including headings.")}function n(y,w){x.check("maxCells",(y+E)*w)}const c=de(f),a=f.series.some(y=>y.points.some(w=>w.xCaption!==void 0)),r=(y,w,he)=>y?.y===null||y===void 0?null:w!==void 0&&w!==he?new ie(y.y,{presentation:{numberFormat:w||W.General}}):y.y;if(!p){const y=f.yFormat,w=f.series.some(oe=>oe.points.some(B=>B.caption!==void 0)),he=new Set(f.series.filter(oe=>oe.points.length>0).map(oe=>(oe.unit??f.yUnit)||void 0)),L=he.size>1,pe=O(f.yTitle,he.size===0?f.yUnit:L?void 0:he.values().next().value),R=[{key:"series",header:"Series",type:"string"},{key:"seriesId",header:"Series ID",type:"string"},c,...a?[{key:"xCaption",header:fe(c.header),type:"string"}]:[],{key:"y",header:pe,type:"number",...y===void 0?{}:{format:y}},...w?[{key:"caption",header:fe(pe),type:"string"}]:[],...L?[{key:"unit",header:"Unit",type:"string"}]:[]],re=f.series.reduce((oe,B)=>oe+B.points.length,0);t(re),n(re,R.length);function*ne(){for(const oe of f.series)for(const B of oe.points)yield[oe.name,oe.id,B.x,...a?[B.xCaption??null]:[],r(B,oe.format??y,y),...w?[B.caption??null]:[],...L?[oe.unit??f.yUnit??null]:[]]}return{columns:R,rows:ne()}}const l=f.series.map(y=>y.points.some(w=>w.caption!==void 0)),g=1+Number(a)+f.series.length+l.filter(Boolean).length;if(g>16384)throw new RangeError("Excel supports at most 16,384 columns.");const i=[],m=new Map,N=new Map,K=new Set;for(const y of f.series)for(const w of y.points)K.has(w.key)||(t(i.length+1),K.add(w.key),i.push(w.key),N.set(w.key,w.x)),w.xCaption!==void 0&&!m.has(w.key)&&m.set(w.key,w.xCaption);n(i.length,g),f.kind!=="category"&&i.sort((y,w)=>y-w);const A=new Map;for(const y of f.series)A.set(y.name,(A.get(y.name)??0)+1);const H=[c,...a?[{key:"xCaption",header:fe(c.header),type:"string"}]:[]],U=f.series.map((y,w)=>{const he=y.format??f.yFormat,L=O(y.name+(A.get(y.name)>1?" ["+y.id+"]":""),y.unit??f.yUnit),pe=l[w];return H.push({key:"s"+w,header:L,type:"number",...he===void 0?{}:{format:he}}),pe&&H.push({key:"s"+w+"Caption",header:fe(L),type:"string"}),{caption:pe,format:he,points:new Map(y.points.map(R=>[R.key,R]))}});function*_(){for(const y of i){const w=[N.get(y)??null,...a?[m.get(y)??null]:[]];for(const he of U){const L=he.points.get(y);w.push(L?.y??null),he.caption&&w.push(L?.caption??null)}yield w}}return{columns:H,rows:_()}}const S=Object.freeze({chartTable:b});return be.set("7f95b63decec4e2ba1f42fe3a3a9681568d33fb28d1017e9dd158b93eba26d36",S),S})(),Ot=be.get("ca03c551cbbfd3e6df4aae1a9d773797c3c21b0f36ac3f0a0c049177cf1b6e45")??(()=>{const{BlobByteSink:ie,checkAbort:W}=at,{captureFields:z}=qe,{captureCommonLimits:fe,captureXlsxOptions:ye,mergeAdapterLimits:de}=wt,{writeXlsxTo:O}=lt,{writePdfDocumentTo:se}=dt,{capturePdfLimits:b}=He,{prepareChart:S}=Mt,{svgToPdfDrawing:f}=Ct,{chartTable:M}=It,{winAnsiText:k}=Qe,p=["regular","bold","italic","boldItalic"],x="E7EDF5",E=Object.freeze({bottom:Object.freeze({style:"thin",color:"A6B4C8"})});function t(r,l={},g={}){const m=z(l===2?g:l,["unsupported","fonts","winAnsi","limits","onDiagnostic"]);return l===2?f(r,m,2):f(r,m,1)}async function n(r,l,g,i={}){const m=z(i,["layout","signal","limits","onProgress","onDiagnostic","unsupported","xlsx","pdf"]);if(l!=="xlsx"&&l!=="pdf")throw new TypeError("ChartForgeX exports are xlsx or pdf.");const{signal:N,onProgress:K,onDiagnostic:A,unsupported:H}=m,U=fe(m.limits);if(H!==void 0&&H!=="skip"&&H!=="reject")throw new TypeError("unsupported must be skip or reject.");W(N);const _=S(r),y={...N?{signal:N}:{},...K?{onProgress:K}:{}};if(l==="xlsx"){const ae=z(m.xlsx??{},["dateMode","compression","creator","created","modified","sheetName"]),{sheetName:Me="Chart data",...xe}=ae,ue=ye(xe),Te=de(ue.limits,U),ee=M(_,m.layout,Te);return O(ee.rows,g,{dateMode:"utc",...ue,...y,columns:ee.columns,..._.title===void 0?{}:{title:_.title},..._.description===void 0?{}:{description:_.description},limits:Te,sheet:{name:Me,headerFill:x,headerBorder:E,headerWrap:!0,freezeHeader:!0,autoFilter:!0,boldHeader:!0,autoSize:{minWidth:8,maxWidth:48},..._.title?{title:{text:_.title}}:{}}})}if(_.svg===void 0)throw new TypeError("A ChartForgeX PDF needs the chart's SVG markup.");const w=z(m.pdf??{},["pageSize","orientation","margins","fonts","tagged","compression","pageNumbers","pageHeader","pageFooter","fontSize","limits"]),he=de(w.limits===void 0?void 0:b(w.limits),U),L=w.fonts===void 0?void 0:z(w.fonts,p),pe=L?p.filter(ae=>ae==="regular"||L[ae]!==void 0):p,R=new Set,re=ae=>{R.has(ae.code)||(R.add(ae.code),A?.(ae))},ne=f(_.svg,{fonts:pe,winAnsi:!L?.regular,limits:he,...H?{unsupported:H}:{},onDiagnostic:re},2,N),oe=ae=>{if(ae!==void 0)return L?.regular?ae.normalize("NFC"):k(ae,()=>{if(H==="reject")throw new TypeError("Chart text needs an embedded font: supply pdf.fonts.regular.");re({code:"TEXT_SUBSTITUTED"})})},B=oe(_.title),me=oe(_.description),ke=_.description?.trim()?_.description:_.title?.trim()?_.title:"Chart",ge=[...me?[{kind:"paragraph",text:me}]:[],{kind:"drawing",drawing:ne,alignment:"center",alternativeText:ke}];return se(ge,g,{orientation:ne.width>ne.height?"landscape":"portrait",pageNumbers:!1,...w,...y,...L?{fonts:L}:{},...B?{title:B}:{},..._.title?{metadataTitle:_.title}:{},limits:he})}async function c(r,l,g={}){const i=new ie;try{return await n(r,l,i,g),i.toBlob(l==="xlsx"?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"application/pdf")}catch(m){throw i.discard(),m}}const a=Object.freeze({PdfFont:xt.PdfFont,chartForgeXDrawing:t,writeChartForgeXTo:n,exportChartForgeX:c});return be.set("ca03c551cbbfd3e6df4aae1a9d773797c3c21b0f36ac3f0a0c049177cf1b6e45",a),a})();Object.assign(Ye,Ot)})(globalThis);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Generated by OfficeIMO.JavaScript/scripts/bundles.mjs from tsc output. MIT.
|
|
2
|
+
import{__officeimoModules as dt}from"./officeimo.min.mjs";const Ee=ie=>{const W=dt[ie];if(!W)throw new Error("officeimo-chartforgex-adapter.min.mjs needs officeimo.mjs or officeimo.min.mjs from the same OfficeIMO build, loaded first.");return W},ut=Ee("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00"),tt=Ee("50b3c10b690ceff693c8c5f809195ba6845b20e60f408e791a750d2ecbd5c669"),nt=Ee("42faf379960e5674a6fdfa8c8fca0bb68bbd74587231248d2524d7004def3671"),ht=Ee("f0627ba89e5c8fcb376ebe3ce72dcc8d68c34952981f8703e36b8bb1a9894208"),$e=Ee("6c92204b587bb12cfa85c60eb1fd921804dfa51304538c7be3353e2927551b02"),pt=Ee("fd70ccda89f27c6b874c8840ac944b3ec723dbdef3dfe7600f7bdb81f4660c96"),mt=Ee("edf1bf5cb6d749de0e6823397df6610a6c1cc88768898c1b4d7083ee96ef6759"),gt=Ee("344fd55ffe1a37b32a8eb6a2bdaa14dff90e0fee0f37282457f9e4c3b7bce1ca"),Ge=Ee("d5c945064d81fdd257960f48c421125e106e5f270427d170bb05587dd96a44ea"),yt=Ee("87c24efeaa0f1579c19afeeb4918caeb4f8f65a88d24a246e2cfd712b37dbac3"),bt=Ee("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f"),xt=Ee("32ca4982f963f400829c2e364b7d3479f36d91740dafb32d600f29b5cac487ec"),wt=Ee("6b0244b5ec6d550c705b4e4cbb47997331f1ecd99e2bf8a06f7c646eebbffbf8"),Mt=Ee("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070"),Tt=Ee("732224f6995c2478cf33a6ed01f3e3d3dcccb159a731d6db9280104bd5040fc5"),Et=Ee("8d96d0024443ac9aeaea70e9324b53aacef098c2385d4e6a89a76d184e28556a"),St=Ee("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596"),kt=(()=>{const{captureFields:ie}=tt,{ExportBudget:W}=nt,{captureCsvOptions:z}=ht,{capturePdfOptions:ce,capturePdfLimits:ye,pdfLimitFields:me}=$e,{captureWorkbookLimits:O,workbookLimitFields:de,workbookOptionFields:y,sheetOptionFields:k}=pt,l=[...new Set([...de,...me])],M=y.filter(a=>a!=="sink");function C(a){return a===void 0?void 0:new W(ie(a,l)).limits}function p(a,c){const s={...a};for(const[f,g]of Object.entries(c??{}))g!==void 0&&(s[f]=g);return s}function x(a={}){const c=ie(a,[...M,"sheet"]),s=c.sheet&&ie(c.sheet,[...k,"name"]),f=s?.footer&&ie(s.footer,["rows","values","totals","style"]);return{...c,...s===void 0?{}:{sheet:{...s,...f===void 0?{}:{footer:f}}},...c.limits===void 0?{}:{limits:O(c.limits)}}}function S(a={}){const c=z(a);return{...c,...c.limits===void 0?{}:{limits:new W(c.limits).limits}}}function t(a={}){const c=ce(a);return{...c,...c.limits===void 0?{}:{limits:ye(c.limits)}}}return Object.freeze({captureCommonLimits:C,mergeAdapterLimits:p,captureXlsxOptions:x,captureCsvOptions:S,capturePdfOptions:t})})(),Ct=(()=>{const{NotSupportedError:ie}=Ge;function W(y,k){if(!y||typeof y!="object"||Array.isArray(y))throw new TypeError("Chart capture "+k+" must be an object.");return y}function z(y,k,l=!1){if(y==null){if(l)throw new TypeError("Chart capture "+k+" is required.");return}if(typeof y!="string")throw new TypeError("Chart capture "+k+" must be a string.");return y}const ce=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;function ye(y){const k=y.replace(" ","T").replace(/([+-]\d{2})(\d{2})$/,"$1:$2").replace(/(\.\d{3})\d+/,"$1");return k.length===10||/(Z|[+-]\d{2}:\d{2})$/.test(k)?k:k+"Z"}function me(y){const k=y.trim();if(!ce.test(k))return NaN;const l=k.slice(0,10),M=new Date(l+"T00:00:00Z");return!Number.isFinite(M.getTime())||!M.toISOString().startsWith(l+"T")?NaN:Date.parse(ye(k))}function O(y,k=1048575){const l=W(y,"");if(l.version!==1)throw new ie("Only ChartForgeX capture version 1 is supported.");const M=W(l.x,"x"),C=M.kind;if(C!=="date"&&C!=="number"&&C!=="category")throw new TypeError("Chart capture x.kind must be date, number or category.");const p=l.y===void 0?{}:W(l.y,"y");if(!Array.isArray(l.series))throw new TypeError("Chart capture series must be an array.");let x=0;const S=Array.from(l.series,(a,c)=>{const s=W(a,"series["+c+"]"),f=s.points;if(!Array.isArray(f))throw new TypeError("Chart capture series["+c+"].points must be an array.");const g=f.length;if((x+=g)>k)throw new RangeError("Chart capture has more than "+k+" points.");return{id:z(s.id,"series["+c+"].id",!0),name:z(s.name,"series["+c+"].name",!0),unit:z(s.unit,"series unit"),format:z(s.format,"series format"),points:Array.from({length:g},(i,m)=>{const N=W(f[m],"point"),K="series["+c+"].points["+m+"]",A=N.y;if(A!=null&&(typeof A!="number"||!Number.isFinite(A)))throw new TypeError(K+".y must be a finite number or null.");let H=null,U=null;const v=N.x;if(v!=null)if(C==="date"){let b=NaN;if(typeof v=="string"&&(b=me(v)),typeof v=="object")try{b=Date.prototype.getTime.call(v)}catch{}if(!Number.isFinite(b))throw new TypeError(K+".x must be an ISO 8601 date string or a valid Date.");H=new Date(b),U=b}else if(C==="number"){if(typeof v!="number"||!Number.isFinite(v))throw new TypeError(K+".x must be a finite number.");H=U=v}else{if(typeof v!="string"&&typeof v!="number")throw new TypeError(K+".x must be a category label.");H=U=String(v)}return{x:H,key:U,xCaption:z(N.xCaption,K+".xCaption"),y:A??null,caption:z(N.caption,K+".caption")}})}}),t=l.svg,n=t&&typeof t=="object"?t.outerHTML:t;if(t!=null&&typeof n!="string")throw new TypeError("Chart capture svg must be markup or an element.");return{title:z(l.title,"title"),description:z(l.description,"description"),kind:C,xTitle:z(M.title,"x.title")||"X",xFormat:z(M.format,"x.format"),yTitle:z(p.title,"y.title")||"Value",yUnit:z(p.unit,"y.unit"),yFormat:z(p.format,"y.format"),series:S,svg:typeof n=="string"?n:void 0}}return Object.freeze({prepareChart:O})})(),It=(()=>{const{OfficeIMOError:ie}=Ge,{jpegSize:W}=xt,{pngEmbeddableSize:z}=wt,ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ye=new Int16Array(128).fill(-1);for(let y=0;y<ce.length;y++)ye[ce.charCodeAt(y)]=y;function me(y){const k=y.replace(/[\t\n\f\r ]+/g,"").replace(/={1,2}$/,"");if(k.length%4===1)return;const l=new Uint8Array(Math.floor(k.length*3/4));let M=0,C=0,p=0;for(let x=0;x<k.length;x++){const S=k.charCodeAt(x),t=S<128?ye[S]:-1;if(t<0)return;C=(C<<6|t)&16777215,M+=6,M>=8&&(M-=8,l[p++]=C>>M&255)}return l}function O(y){const k=/^\s*data:image\/(png|jpeg|jpg)(?:;[^,;]*=[^,;]*)*;base64,([\s\S]*)$/i.exec(y);if(!k)return;const l=me(k[2]);if(l)try{const M=k[1].toLowerCase()==="png"?"png":"jpeg",{width:C,height:p}=M==="png"?z(l):W(l);return C&&p?{image:{format:M,data:l},width:C,height:p}:void 0}catch(M){if(M instanceof ie&&M.code==="RESOURCE_LIMIT")throw M;return}}return Object.freeze({svgDataImage:O})})(),Ot=(()=>{const{NotSupportedError:ie}=Ge,W=/([A-Za-z_][\w.:-]*)\s*=\s*("([^"]*)"|'([^']*)')/y,z={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",nbsp:" "};function ce(O){return O.indexOf("&")<0?O:O.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[A-Za-z]+);/g,(de,y)=>{if(y[0]==="#"){const k=y[1]==="x"||y[1]==="X"?parseInt(y.slice(2),16):parseInt(y.slice(1),10);return k>0&&k<=1114111&&!(k>=55296&&k<=57343)?String.fromCodePoint(k):"�"}return z[y]??de})}function ye(O,de=256){if(typeof O!="string")throw new TypeError("Chart SVG must be serialized markup.");const y=[];let k,l=0;const M=C=>{const p=y[y.length-1];p&&C&&p.children.push(C)};for(;l<O.length;){const C=O.indexOf("<",l);if(C<0){M(ce(O.slice(l)));break}if(C>l&&M(ce(O.slice(l,C))),O.startsWith("<!--",C)){const s=O.indexOf("-->",C+4);if(s<0)throw new TypeError("Chart SVG has an unterminated comment.");l=s+3;continue}if(O.startsWith("<![CDATA[",C)){const s=O.indexOf("]]>",C+9);if(s<0)throw new TypeError("Chart SVG has an unterminated CDATA section.");M(O.slice(C+9,s)),l=s+3;continue}if(O[C+1]==="?"){const s=O.indexOf("?>",C+2);if(s<0)throw new TypeError("Chart SVG has an unterminated processing instruction.");l=s+2;continue}if(O[C+1]==="!"){if(/^<!DOCTYPE[^>]*\[/i.test(O.slice(C,C+1024)))throw new ie("Chart SVG with an internal DTD subset is not supported.");const s=O.indexOf(">",C+2);if(s<0)throw new TypeError("Chart SVG has an unterminated declaration.");l=s+1;continue}if(O[C+1]==="/"){const s=O.indexOf(">",C+2);if(s<0)throw new TypeError("Chart SVG has an unterminated end tag.");const f=O.slice(C+2,s).trim(),g=y.pop();if(!g||g.name!==f)throw new TypeError("Chart SVG end tag </"+f+"> does not match its element.");const i=g;y.length?y[y.length-1].children.push(i):k=i,l=s+1;continue}const p=/^<([A-Za-z_][\w.:-]*)/.exec(O.slice(C,C+256));if(!p)throw new TypeError("Chart SVG has an invalid start tag.");const x=p[1],S=new Map;let t=C+p[0].length,n=!1;for(;;){for(;t<O.length&&/\s/.test(O[t]);)t++;const s=O[t];if(s===void 0)throw new TypeError("Chart SVG has an unterminated start tag.");if(s===">"){t++;break}if(s==="/"&&O[t+1]===">"){t+=2,n=!0;break}W.lastIndex=t;const f=W.exec(O);if(!f)throw new TypeError("Chart SVG has an invalid attribute on <"+x+">.");S.set(f[1],ce(f[3]??f[4]??"")),t=W.lastIndex}if(k)throw new TypeError("Chart SVG must have one root element.");const a=x.slice(x.indexOf(":")+1),c={name:x,local:a,attributes:S,children:[]};if(n)y.length?y[y.length-1].children.push(c):k=c;else{if(y.length>=de)throw new ie("Chart SVG nesting exceeds "+de+" levels.");y.push(c)}l=t}if(y.length)throw new TypeError("Chart SVG has an unclosed <"+y[y.length-1].name+"> element.");if(!k||k.local!=="svg")throw new TypeError("Chart SVG must have an <svg> root element.");return k}return Object.freeze({parseSvgMarkup:ye})})(),_t=(()=>{const ie=[1,0,0,1,0,0];function W(t,n){return[t[0]*n[0]+t[2]*n[1],t[1]*n[0]+t[3]*n[1],t[0]*n[2]+t[2]*n[3],t[1]*n[2]+t[3]*n[3],t[0]*n[4]+t[2]*n[5]+t[4],t[1]*n[4]+t[3]*n[5]+t[5]]}function z(t,n,a){return[t[0]*n+t[2]*a+t[4],t[1]*n+t[3]*a+t[5]]}function ce(t){return t[0]*t[3]-t[1]*t[2]}function ye(t){return Math.sqrt(Math.abs(ce(t)))}const me=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g;function O(t){return(t.match(me)??[]).map(Number)}function de(t){if(t===void 0||!t.trim()||t.trim()==="none")return ie;let n=ie,a=t.trim();const c=/^([a-zA-Z]+)\s*\(([^)]*)\)\s*,?\s*/;for(;a;){const s=c.exec(a);if(!s)return;const f=s[1],g=s[2].trim(),i=[],m=/([+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)([a-z%]*)/gi;let N=0;for(const A of g.matchAll(m)){const H=g.slice(N,A.index);if(!/^\s*,?\s*$/.test(H)||!i.length&&H)return;const U=A[2].toLowerCase(),v=Number(A[1]),b=!i.length&&(f==="rotate"||f==="skewX"||f==="skewY");if(!U||U==="px"&&f==="translate")i.push(v);else if(b&&U==="deg")i.push(v);else if(b&&U==="rad")i.push(v*180/Math.PI);else if(b&&U==="grad")i.push(v*.9);else if(b&&U==="turn")i.push(v*360);else return;N=A.index+A[0].length}if(N!==g.length)return;let K;if(f==="matrix"&&i.length===6)K=i;else if(f==="translate"&&(i.length===1||i.length===2))K=[1,0,0,1,i[0],i[1]??0];else if(f==="scale"&&(i.length===1||i.length===2))K=[i[0],0,0,i[1]??i[0],0,0];else if(f==="rotate"&&(i.length===1||i.length===3)){const A=i[0]*Math.PI/180,H=Math.cos(A),U=Math.sin(A),v=i[1]??0,b=i[2]??0;K=W(W([1,0,0,1,v,b],[H,U,-U,H,0,0]),[1,0,0,1,-v,-b])}else if(f==="skewX"&&i.length===1)K=[1,0,Math.tan(i[0]*Math.PI/180),1,0,0];else if(f==="skewY"&&i.length===1)K=[1,Math.tan(i[0]*Math.PI/180),0,1,0,0];else return;n=W(n,K),a=a.slice(s[0].length)}return n.every(Number.isFinite)?n:void 0}function y(t,n,a,c,s,f,g,i,m,N){if(n===m&&a===N)return;if(c=Math.abs(c),s=Math.abs(s),!c||!s){t.push({op:"line",x:m,y:N});return}const K=f*Math.PI/180,A=Math.cos(K),H=Math.sin(K),U=(n-m)/2,v=(a-N)/2,b=A*U+H*v,w=-H*U+A*v,ue=b*b/(c*c)+w*w/(s*s);if(ue>1){const ee=Math.sqrt(ue);c*=ee,s*=ee}const L=g===i?-1:1,ge=c*c*s*s-c*c*w*w-s*s*b*b,R=L*Math.sqrt(Math.max(0,ge/(c*c*w*w+s*s*b*b))),re=R*c*w/s,ne=-R*s*b/c,se=A*re-H*ne+(n+m)/2,B=H*re+A*ne+(a+N)/2,he=(ee,Ie,Oe,_e)=>Math.atan2(ee*_e-Ie*Oe,ee*Oe+Ie*_e),Se=he(1,0,(b-re)/c,(w-ne)/s);let pe=he((b-re)/c,(w-ne)/s,(-b-re)/c,(-w-ne)/s);!i&&pe>0?pe-=2*Math.PI:i&&pe<0&&(pe+=2*Math.PI);const oe=Math.max(1,Math.ceil(Math.abs(pe)/(Math.PI/2)-1e-9)),we=pe/oe,be=4/3*Math.tan(we/4),fe=ee=>[se+c*Math.cos(ee)*A-s*Math.sin(ee)*H,B+c*Math.cos(ee)*H+s*Math.sin(ee)*A],Me=ee=>[-c*Math.sin(ee)*A-s*Math.cos(ee)*H,-c*Math.sin(ee)*H+s*Math.cos(ee)*A];for(let ee=0;ee<oe;ee++){const Ie=Se+ee*we,Oe=Ie+we,[_e,Ve]=fe(Ie),[Ae,Ne]=ee===oe-1?[m,N]:fe(Oe),[G,q]=Me(Ie),[Fe,ke]=Me(Oe);t.push({op:"cubic",x1:_e+be*G,y1:Ve+be*q,x2:Ae-be*Fe,y2:Ne-be*ke,x:Ae,y:Ne})}}function k(t){const n=[],a=/([MmLlHhVvCcSsQqTtAaZz])|([+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)|([\s,]+)|(.)/g,c=[];let s=!1,f=!1;for(const L of t.matchAll(a)){if(L[4]!==void 0||f&&L[1]!==void 0){s=!0;break}const ge=L[3];if(ge?.includes(",")){const R=c.at(-1);if(R===void 0||/^[A-Za-z]$/.test(R)||ge.indexOf(",")!==ge.lastIndexOf(",")){s=!0;break}f=!0;continue}(L[1]!==void 0||L[2]!==void 0)&&c.push(L[1]??L[2]),f=!1}s||=f;let g=0,i=0,m=0,N=0,K=0,A="",H,U,v=!1;const b=L=>L!==void 0&&/^[A-Za-z]$/.test(L),w=()=>{const L=c[g];if(L===void 0||b(L))return;g++;const ge=Number(L);return Number.isFinite(ge)?ge:void 0},ue=()=>{const L=c[g];if(!(L===void 0||b(L))){if(L==="0"||L==="1")return g++,Number(L);if(/^[01][\d.]/.test(L))return c[g]=L.slice(1),Number(L[0])}};for(;g<c.length;){const L=c[g];if(b(L))A=L,g++;else if(!A||A==="Z"||A==="z")return{commands:n,malformed:!0};const ge=A===A.toLowerCase(),R=A.toUpperCase();if(!n.length&&R!=="M")return{commands:n,malformed:!0};const re=ge?i:0,ne=ge?m:0;if(R==="Z"){v&&n.push({op:"close"}),i=N,m=K,v=!1,H=U=void 0;continue}const se=()=>{v||(n.push({op:"move",x:i,y:m}),v=!0)};if(R==="M"){const B=w(),he=w();if(B===void 0||he===void 0)return{commands:n,malformed:!0};i=re+B,m=ne+he,N=i,K=m,n.push({op:"move",x:i,y:m}),v=!0,A=ge?"l":"L",H=U=void 0;continue}if(R==="L"||R==="H"||R==="V"){const B=w();if(B===void 0)return{commands:n,malformed:!0};const he=R==="L"?w():void 0;if(R==="L"&&he===void 0)return{commands:n,malformed:!0};se(),R!=="V"&&(i=re+B),R!=="H"&&(m=ne+(he??B)),n.push({op:"line",x:i,y:m}),H=U=void 0;continue}if(R==="C"||R==="S"){const B=[];for(let Me=R==="C"?6:4;Me>0;Me--){const ee=w();if(ee===void 0)return{commands:n,malformed:!0};B.push(ee)}const[he,Se]=R==="C"?[re+B[0],ne+B[1]]:H?[2*i-H[0],2*m-H[1]]:[i,m],pe=R==="C"?B.slice(2):B,oe=re+pe[0],we=ne+pe[1],be=re+pe[2],fe=ne+pe[3];se(),n.push({op:"cubic",x1:he,y1:Se,x2:oe,y2:we,x:be,y:fe}),H=[oe,we],U=void 0,i=be,m=fe;continue}if(R==="Q"||R==="T"){const B=[];for(let we=R==="Q"?4:2;we>0;we--){const be=w();if(be===void 0)return{commands:n,malformed:!0};B.push(be)}const[he,Se]=R==="Q"?[re+B[0],ne+B[1]]:U?[2*i-U[0],2*m-U[1]]:[i,m],pe=re+B[B.length-2],oe=ne+B[B.length-1];se(),n.push({op:"cubic",x1:i+2/3*(he-i),y1:m+2/3*(Se-m),x2:pe+2/3*(he-pe),y2:oe+2/3*(Se-oe),x:pe,y:oe}),U=[he,Se],H=void 0,i=pe,m=oe;continue}if(R==="A"){const B=w(),he=w(),Se=w(),pe=ue(),oe=ue(),we=w(),be=w();if(B===void 0||he===void 0||Se===void 0||pe===void 0||oe===void 0||we===void 0||be===void 0)return{commands:n,malformed:!0};se(),y(n,i,m,B,he,Se,pe===1,oe===1,re+we,ne+be),i=re+we,m=ne+be,H=U=void 0;continue}return{commands:n,malformed:!0}}return{commands:n,malformed:s}}const l=.5522847498307936;function M(t,n,a,c){const s=a*l,f=c*l;return[{op:"move",x:t+a,y:n},{op:"cubic",x1:t+a,y1:n+f,x2:t+s,y2:n+c,x:t,y:n+c},{op:"cubic",x1:t-s,y1:n+c,x2:t-a,y2:n+f,x:t-a,y:n},{op:"cubic",x1:t-a,y1:n-f,x2:t-s,y2:n-c,x:t,y:n-c},{op:"cubic",x1:t+s,y1:n-c,x2:t+a,y2:n-f,x:t+a,y:n},{op:"close"}]}function C(t,n,a,c,s,f){if(s=Math.min(Math.max(s,0),a/2),f=Math.min(Math.max(f,0),c/2),!s||!f)return[{op:"move",x:t,y:n},{op:"line",x:t+a,y:n},{op:"line",x:t+a,y:n+c},{op:"line",x:t,y:n+c},{op:"close"}];const g=s*(1-l),i=f*(1-l),m=t+a,N=n+c;return[{op:"move",x:t+s,y:n},{op:"line",x:m-s,y:n},{op:"cubic",x1:m-g,y1:n,x2:m,y2:n+i,x:m,y:n+f},{op:"line",x:m,y:N-f},{op:"cubic",x1:m,y1:N-i,x2:m-g,y2:N,x:m-s,y:N},{op:"line",x:t+s,y:N},{op:"cubic",x1:t+g,y1:N,x2:t,y2:N-i,x:t,y:N-f},{op:"line",x:t,y:n+f},{op:"cubic",x1:t,y1:n+i,x2:t+g,y2:n,x:t+s,y:n},{op:"close"}]}function p(t,n){const a=[];for(let c=0;c+1<t.length;c+=2)a.push({op:c?"line":"move",x:t[c],y:t[c+1]});return n&&a.length&&a.push({op:"close"}),a}function x(t,n){return t.map(a=>{if(a.op==="close")return a;const[c,s]=z(n,a.x,a.y);if(a.op==="cubic"){const[f,g]=z(n,a.x1,a.y1),[i,m]=z(n,a.x2,a.y2);return{op:"cubic",x1:f,y1:g,x2:i,y2:m,x:c,y:s}}return{op:a.op,x:c,y:s}})}return Object.freeze({identity:ie,multiply:W,apply:z,determinant:ce,scaleOf:ye,numbers:O,parseTransform:de,parsePathData:k,ellipse:M,rectangle:C,polyline:p,transformCommands:x})})(),vt=(()=>{const ie={black:"000000",white:"ffffff",red:"ff0000",green:"008000",blue:"0000ff",yellow:"ffff00",orange:"ffa500",purple:"800080",gray:"808080",grey:"808080",silver:"c0c0c0",maroon:"800000",navy:"000080",teal:"008080",olive:"808000",lime:"00ff00",aqua:"00ffff",cyan:"00ffff",fuchsia:"ff00ff",magenta:"ff00ff",darkgray:"a9a9a9",darkgrey:"a9a9a9",lightgray:"d3d3d3",lightgrey:"d3d3d3",dimgray:"696969",dimgrey:"696969",gainsboro:"dcdcdc",whitesmoke:"f5f5f5",steelblue:"4682b4",slategray:"708090",slategrey:"708090",crimson:"dc143c",tomato:"ff6347",gold:"ffd700",indigo:"4b0082",brown:"a52a2a",pink:"ffc0cb",coral:"ff7f50",salmon:"fa8072",seagreen:"2e8b57",forestgreen:"228b22",royalblue:"4169e1",darkblue:"00008b",darkred:"8b0000",darkgreen:"006400",darkorange:"ff8c00",lightblue:"add8e6",skyblue:"87ceeb",tan:"d2b48c",violet:"ee82ee"},W=(p,x,S)=>Math.min(S,Math.max(x,p));function z(p,x){const S=parseFloat(p);return p.trim().endsWith("%")?S/100*x:S}function ce(p){if(p===void 0)return 1;if(p.trim()==="none")return 0;if(/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?%?$/i.test(p.trim()))return W(z(p,1),0,1)}function ye(p,x){const[S,t]=p.split("/"),n=S.includes(",")?S.split(",").map(a=>a.trim()).filter(Boolean):S.trim().split(/\s+/);return x&&t===void 0&&n.length===4?{values:n.slice(0,3),alpha:n[3]}:{values:n,alpha:t?.trim()}}function me(p){const x=W(p,0,1);return 255*(x<=.0031308?12.92*x:1.055*Math.pow(x,1/2.4)-.055)}function O(p,x,S,t){const n=Math.pow(p+.3963377774*x+.2158037573*S,3),a=Math.pow(p-.1055613458*x-.0638541728*S,3),c=Math.pow(p-.0894841775*x-1.291485548*S,3),s=4.0767416621*n-3.3077115913*a+.2309699292*c,f=-1.2684380046*n+2.6097574011*a-.3413193965*c,g=-.0041960863*n-.7034186147*a+1.707614701*c;if([s,f,g].every(Number.isFinite))return{r:me(s),g:me(f),b:me(g),a:t}}function de(p){const x=parseFloat(p);return p.endsWith("turn")?x*360:p.endsWith("rad")?x*180/Math.PI:x}function y(p){const x=p.trim().toLowerCase();if(!x)return;if(x==="transparent")return{r:0,g:0,b:0,a:0};const S=/^#([0-9a-f]{3,8})$/.exec(x)?.[1];if(S){if(S.length===3||S.length===4){const[i,m,N,K]=[...S].map(A=>parseInt(A+A,16));return{r:i,g:m,b:N,a:K===void 0?1:K/255}}return S.length===6||S.length===8?{r:parseInt(S.slice(0,2),16),g:parseInt(S.slice(2,4),16),b:parseInt(S.slice(4,6),16),a:S.length===8?parseInt(S.slice(6),16)/255:1}:void 0}const t=ie[x];if(t)return y("#"+t);const n=/^([a-z]+)\((.*)\)$/.exec(x);if(!n)return;const a=n[1],{values:c,alpha:s}=ye(n[2],a!=="color");if(c.some(i=>!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|deg|rad|turn)?$/.test(i)&&i!=="none")&&a!=="color")return;const f=ce(s);if(f===void 0)return;const g=c.map(i=>i==="none"?"0":i);if((a==="rgb"||a==="rgba")&&g.length===3)return{r:W(z(g[0],255),0,255),g:W(z(g[1],255),0,255),b:W(z(g[2],255),0,255),a:f};if((a==="hsl"||a==="hsla")&&g.length===3){const i=(de(g[0])%360+360)%360/360,m=W(parseFloat(g[1])/100,0,1),N=W(parseFloat(g[2])/100,0,1),K=N<.5?N*(1+m):N+m-N*m,A=2*N-K,H=U=>(U=(U+1)%1,255*(U<1/6?A+(K-A)*6*U:U<.5?K:U<2/3?A+(K-A)*(2/3-U)*6:A));return{r:H(i+1/3),g:H(i),b:H(i-1/3),a:f}}if(a==="oklab"&&g.length===3)return O(z(g[0],1),z(g[1],.4),z(g[2],.4),f);if(a==="oklch"&&g.length===3){const i=z(g[0],1),m=z(g[1],.4),N=de(g[2])*Math.PI/180;return O(i,m*Math.cos(N),m*Math.sin(N),f)}if(a==="color"&&g.length===4&&(g[0]==="srgb"||g[0]==="srgb-linear")){const i=g.slice(1).map(N=>z(N,1)),m=g[0]==="srgb"?N=>W(N,0,1)*255:me;return i.every(Number.isFinite)?{r:m(i[0]),g:m(i[1]),b:m(i[2]),a:f}:void 0}}function k(p,x){const S=W(p.a*x,0,1);if(S<.002)return;const t=n=>Math.round(W(n,0,255)*S+255*(1-S)).toString(16).padStart(2,"0").toUpperCase();return t(p.r)+t(p.g)+t(p.b)}function l(p){const x=new Map;if(!p)return x;const S=new Set;for(const t of p.split(";")){const n=t.indexOf(":");if(n<0)continue;const a=t.slice(0,n).trim().toLowerCase(),c=t.slice(n+1),s=/!\s*important\s*$/i,f=c.replace(s,"").trim(),g=s.test(c);!a||!f||S.has(a)&&!g||(g&&S.add(a),x.set(a,f))}return x}function M(p,x,S=0){if(p===void 0)return;const t=/^\s*([+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)\s*(px|pt|pc|mm|cm|in|em|rem|ex|%)?\s*$/.exec(p);if(!t)return;const n=Number(t[1]),a=t[2],c=a===void 0||a==="px"?1:a==="pt"?4/3:a==="pc"?16:a==="mm"?96/25.4:a==="cm"?96/2.54:a==="in"?96:a==="em"?x:a==="rem"?16:a==="ex"?x/2:S/100,s=n*c;return Number.isFinite(s)?s:void 0}return Object.freeze({alpha:ce,parseColor:y,flatten:k,parseStyle:l,length:M})})(),it=(()=>{const{standardCode:ie}=Mt,W=new Map([[8722,"-"],[8208,"-"],[8209,"-"],[8210,"-"],[8201," "],[8202," "],[8239," "],[8199," "],[8194," "],[8195," "],[8203,""],[8206,""],[8207,""],[8288,""],[65279,""]]),z=new Map([[321,"L"],[322,"l"],[272,"D"],[273,"d"],[294,"H"],[295,"h"],[305,"i"],[319,"L"],[320,"l"],[358,"T"],[359,"t"],[384,"b"],[407,"I"],[437,"Z"],[438,"z"],[7838,"SS"]]);function ce(O){const de=z.get(O.codePointAt(0));if(de!==void 0)return de;if(!/\p{Script=Latin}/u.test(O))return;const y=O.normalize("NFD").replace(/\p{Mark}+/gu,"");return y&&y!==O&&[...y].every(k=>ie(k.codePointAt(0))!==void 0)?y:void 0}function ye(O,de){let y="";const k=O.normalize("NFC").replace(/(\p{Script=Latin})\p{Mark}+/gu,(l,M)=>(de(),M));for(const l of k){const M=l.codePointAt(0);if(M===173)continue;if(ie(M)!==void 0){y+=l;continue}if(M===10||M===13||M===9){y+=l;continue}const C=W.get(M);if(C!==void 0){y+=C;continue}de(),y+=ce(l)??"?"}return y}return Object.freeze({winAnsiText:ye})})(),Dt=(()=>{const{NotSupportedError:ie,OfficeIMOError:W}=Ge,{checkAbort:z}=yt,{pdfNumber:ce}=bt,{capturePdfLimits:ye,pdfDrawingLimits:me,pdfDrawingMaxDepth:O}=$e,{svgDataImage:de}=It,{parseSvgMarkup:y}=Ot,{apply:k,determinant:l,ellipse:M,identity:C,multiply:p,numbers:x,parsePathData:S,parseTransform:t,polyline:n,rectangle:a,scaleOf:c,transformCommands:s}=_t,{alpha:f,flatten:g,length:i,parseColor:m,parseStyle:N}=vt,{winAnsiText:K}=it,A=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-opacity","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","paint-order","stroke-dasharray","stroke-dashoffset","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","color","visibility","white-space"]),H=["opacity","display","clip-path","mask","filter","marker-start","marker-mid","marker-end","vector-effect","overflow"],U=new Set(["defs","clipPath","mask","marker","pattern","linearGradient","radialGradient","symbol","script","title","desc","metadata","filter","stop","font","font-face"]),v=new Set(["svg","symbol","g","a","use","switch"]),b=new Set(["path","rect","circle","ellipse","line","polyline","polygon"]),w=new Map([["fill","black"],["stroke","none"],["stroke-width","1"],["font-size","16"],["color","black"]]),ue=R=>{const ne=Math.hypot(R[0],R[1]),se=Math.hypot(R[2],R[3]);return Math.abs(ne-se)>1e-6*Math.max(ne,se)||Math.abs(R[0]*R[2]+R[1]*R[3])>1e-6*ne*se};function L(R,re,ne,se){const B=re.limits===void 0?void 0:ye(re.limits),he=B?.maxDrawingElements??me.maxDrawingElements,Se=B?.maxVectorCommands??me.maxVectorCommands,pe=Math.max(4096,16*Math.max(he,Se));let oe=0,we=0,be=0;const fe=(e=1)=>{if(z(se),be+=e,be>pe)throw new W("RESOURCE_LIMIT","Chart SVG conversion work limit exceeded.")},Me=e=>{e&&fe(Math.ceil(e.length/16))},ee=(e,r)=>{if(++oe>he)throw new W("RESOURCE_LIMIT","maxDrawingElements exceeded.");e.push(r)};typeof R=="string"&&fe(Math.ceil(R.length/16));const Ie=y(R),Oe=new Map,_e=new Set,Ve=new Set(re.fonts??["regular","bold","italic","boldItalic"]),Ae=re.winAnsi!==!1,Ne=e=>{fe();const r=e.attributes.get("id");r!==void 0&&!Oe.has(r)&&Oe.set(r,e);for(const D of e.children)typeof D!="string"&&Ne(D)};Ne(Ie);const G=(e,r)=>{if(re.unsupported==="reject")throw new ie("Unsupported chart SVG feature: "+e+(r?" (<"+r+">)":""));if(_e.has(e))return;_e.add(e);const D=r===void 0?{code:e}:{code:e,element:r};re.onDiagnostic?.(D)},q=(e,r)=>e.attributes.get(r),Fe=(e,r,D,P,T=!1,F)=>{const o=q(e,"viewBox");Me(o);const u=x(o??""),I=u.length===4&&u[2]>0&&u[3]>0,V=T||!I?D:u[2],Y=T||!I?P:u[3],te=F?.width??i(q(e,"width"),r,V)??V,E=F?.height??i(q(e,"height"),r,Y)??Y;if(!I)return{width:te,height:E,userWidth:te,userHeight:E,originZero:!0,matrix:C};const h=(q(e,"preserveAspectRatio")??"xMidYMid meet").trim().split(/\s+/);let d=te/u[2],X=E/u[3],le=0,_=0;if(h[0]!=="none"){const Q=h[1]==="slice"?Math.max(d,X):Math.min(d,X),$=h[0]??"xMidYMid";le=(te-u[2]*Q)*($.includes("xMid")?.5:$.includes("xMax")?1:0),_=(E-u[3]*Q)*($.includes("YMid")?.5:$.includes("YMax")?1:0),d=X=Q}const j=[d,0,0,X,le-u[0]*d,_-u[1]*X];return{width:te,height:E,userWidth:u[2],userHeight:u[3],originZero:u[0]===0&&u[1]===0,matrix:j}},ke=Fe(Ie,16,0,0);if(!(ke.width>0&&ke.height>0))throw new TypeError("Chart SVG needs a positive width and height or viewBox.");const ve=Math.min(.75,14400/ke.width,14400/ke.height),Ze=Math.min(14400,ke.width*ve),Be=Math.min(14400,ke.height*ve),Ye=[];function Re(e){const r=q(e,"style");return Me(r),N(r)}function He(e,r,D,P){const T=I=>r.get(I)??q(e,I),F=T("transform");Me(F);const o=t(F);if(!o){G("TRANSFORM_UNSUPPORTED",e.local);return}if(o[0]===1&&o[1]===0&&o[2]===0&&o[3]===1)return o;const u=T("transform-box")??"view-box";if(D.viewportOriginZero&&["view-box","initial","unset"].includes(u)){const I=T("transform-origin");if(I===void 0)return o;Me(I);const[V,Y,te,E]=I.trim().split(/\s+/,4),h=i(V,P,D.userWidth),d=i(Y,P,D.userHeight);if(h!==void 0&&d!==void 0&&(te===void 0||/^0(?:px)?$/.test(te))&&E===void 0)return[o[0],o[1],o[2],o[3],o[4]+h-o[0]*h-o[2]*d,o[5]+d-o[1]*h-o[3]*d]}G("TRANSFORM_ORIGIN_IGNORED",e.local)}function qe(e,r){const D=Re(e),P=new Map;let T=r.style,F=!1;const o=j=>D.get(j)??q(e,j);for(const j of A){const Q=o(j);if(Q===void 0||Q==="inherit"||Q==="unset")continue;const $=Q==="initial"?w.get(j):Q;$!==r.style.get(j)&&(F||(T=new Map(r.style),F=!0),$===void 0?T.delete(j):T.set(j,$))}for(const j of H){const Q=o(j);Q!==void 0&&P.set(j,Q)}if(P.get("display")==="none")return;const u=o("font-size"),I=u==="initial"?16:u!==void 0?rt(u,r.fontSize):r.fontSize,V=He(e,D,r,I),Y=P.get("overflow")?.trim(),te=e.local==="image"||(e.local==="svg"||e.local==="symbol")&&e!==Ie,E=Y==="inherit"?r.overflowVisible:Y===void 0||Y==="revert"?!te:/^(?:visible(?:\s+visible)?|initial|unset)$/.test(Y),h=P.get("opacity"),d=ne===2&&h?.trim()==="inherit"?r.localOpacity:f(h)??1,X=ne===2&&v.has(e.local)&&d>0&&d<1;!X&&d<1&&d>0&&e.local!=="image"&&G("OPACITY_FLATTENED",e.local);const le=q(e,"xml:space");return{context:{...r,matrix:p(r.matrix,V??C),imageTransformValid:r.imageTransformValid&&V!==void 0,style:T,fontSize:I,localOpacity:d,opacity:r.opacity*d,overflowVisible:E,...le===void 0?{}:{xmlSpace:le}},own:P,declared:D,groupOpacity:X}}function rt(e,r){const P={"xx-small":9,"x-small":10,small:13,medium:16,large:18,"x-large":24,"xx-large":32}[e.trim()]??i(e,r,r);return P!==void 0&&P>0?P:r}function We(e,r,D,P){if(e===void 0||e==="none")return;fe(Math.ceil(e.length/16));let T;const F=/^url\(\s*["']?#([^"')]+)["']?\s*\)\s*(.*)$/.exec(e.trim());if(F){const u=Oe.get(F[1]),I=F[2].trim();if(u&&(u.local==="linearGradient"||u.local==="radialGradient"))T=st(u),G("GRADIENT_FLATTENED",P);else if(I&&I!=="none")T=m(I);else{G("PAINT_UNSUPPORTED",P);return}}else if(e.trim().toLowerCase()==="currentcolor"){const u=r.style.get("color")??"black";Me(u),T=m(u)}else T=m(e);if(!T){G("COLOR_UNSUPPORTED",P);return}const o=(f(r.style.get(D))??1)*r.opacity;return T.a*o<1&&T.a*o>=.002&&G("OPACITY_FLATTENED",P),g(T,o)}function st(e){const r=new Set;let D=e;for(;D&&!r.has(D);){fe(),r.add(D);for(const T of D.children){if(fe(),typeof T=="string"||T.local!=="stop")continue;const F=Re(T),o=F.get("stop-color")??q(T,"stop-color")??"black";fe(Math.ceil(o.length/16));const u=m(o),I=f(F.get("stop-opacity")??q(T,"stop-opacity"))??1;return u&&{...u,a:u.a*I}}const P=(q(D,"href")??q(D,"xlink:href"))?.replace(/^#/,"");D=P===void 0?void 0:Oe.get(P)}}const Ke=new WeakMap;function ot(e,r,D){const P=e[e.length-1];if(D!==void 0&&P&&P.kind==="path"&&Ke.get(P)===D&&P.commands.length+r.commands.length<=4096){P.commands.push(...r.commands);return}D!==void 0&&Ke.set(r,D),ee(e,r)}function at(e,r,D,P){const{userWidth:T,userHeight:F}=r,o=Math.hypot(T,F)/Math.SQRT2,u=(_,j=0)=>i(q(e,_),r.fontSize,j)??0;let I;switch(e.local){case"rect":{const _=u("width",T),j=u("height",F);if(!(_>0&&j>0))return;const Q=q(e,"rx"),$=q(e,"ry"),xe=Q===void 0||Q==="auto"?u("ry",F):u("rx",T),Z=$===void 0||$==="auto"?xe:u("ry",F);I=a(u("x",T),u("y",F),_,j,xe,Z);break}case"circle":{const _=u("r",o);if(!(_>0))return;I=M(u("cx",T),u("cy",F),_,_);break}case"ellipse":{const _=u("rx",T),j=u("ry",F);if(!(_>0&&j>0))return;I=M(u("cx",T),u("cy",F),_,j);break}case"line":I=[{op:"move",x:u("x1",T),y:u("y1",F)},{op:"line",x:u("x2",T),y:u("y2",F)}];break;case"polyline":case"polygon":{const _=q(e,"points")??"";fe(Math.ceil(_.length/4)),I=n(x(_),e.local==="polygon");break}default:{const _=q(e,"d")??"";fe(Math.ceil(_.length/4));const j=S(_);j.malformed&&G("PATH_DATA_TRUNCATED","path"),I=j.commands}}if(!I.length)return;for(const _ of["marker-start","marker-mid","marker-end"])P.get(_)&&P.get(_)!=="none"&&G("MARKER_IGNORED",e.local);const V=e.local==="line"?void 0:We(r.style.get("fill"),r,"fill-opacity",e.local),Y=We(r.style.get("stroke"),r,"stroke-opacity",e.local);if(V===void 0&&Y===void 0)return;const te=P.get("vector-effect")==="non-scaling-stroke",E=te?ve:c(r.matrix),h=(i(r.style.get("stroke-width"),r.fontSize,o)??1)*E;if(Y!==void 0&&!(h>0)&&V===void 0)return;if(we+=I.length,we>Se)throw new W("RESOURCE_LIMIT","maxVectorCommands exceeded.");const d={kind:"path",commands:s(I,r.matrix)};if(V!==void 0&&(d.fill=V,r.style.get("fill-rule")==="evenodd"&&(d.fillRule="evenodd")),Y!==void 0&&h>0){!te&&ue(r.matrix)&&G("STROKE_DISTORTED",e.local),d.stroke=Y,d.strokeWidth=h;const _=r.style.get("stroke-linecap"),j=r.style.get("stroke-linejoin");if((_==="round"||_==="square")&&(d.lineCap=_),j==="round"||j==="bevel")d.lineJoin=j;else{const Z=Number(r.style.get("stroke-miterlimit")??"4");Z>=0&&Z<1?d.lineJoin="bevel":Z>=1&&Z<=1e6?d.miterLimit=Z:(G("MITER_LIMIT_UNSUPPORTED",e.local),d.miterLimit=4)}const Q=r.style.get("paint-order");if(V!==void 0&&Q&&Q!=="normal"){Me(Q);const Z=Q.split(/\s+/),J=Z.indexOf("fill"),ae=Z.indexOf("stroke");ae>=0&&(J<0||ae<J)&&G("PAINT_ORDER_IGNORED",e.local)}const $=r.style.get("stroke-dasharray");Me($);const xe=$?.trim();if(xe!=="none"&&xe){const Z=xe.split(/[\s,]+/,17).map(J=>i(J,r.fontSize,o));if(Z.every(J=>J!==void 0&&J>=0)&&Z.some(J=>J>0)){const J=Z.map(Ce=>Ce*E),ae=r.style.get("stroke-dashoffset");Me(ae);const Te=(i(ae,r.fontSize,o)??0)*E;J.length<=16&&J.every(Ce=>Ce<=14400)&&J.some(Ce=>ce(Ce)!=="0")&&Math.abs(Te)<=1e6?(d.dash=J,Te&&(d.dashOffset=Te)):G("DASH_UNSUPPORTED",e.local)}else Z.some(J=>J===void 0||J<0)&&G("DASH_UNSUPPORTED",e.local)}}if(d.fill===void 0&&d.stroke===void 0)return;const X=d.fill===void 0||(d.stroke===void 0||d.stroke===d.fill)&&d.fillRule===void 0&&["rect","circle","ellipse"].includes(e.local),le=l(r.matrix);ot(D,d,X?JSON.stringify([d.fill,le<0,d.stroke,d.strokeWidth,d.lineCap,d.lineJoin,d.miterLimit,d.dash,d.dashOffset]):void 0)}function ct(e,r,D){const P=[];let T=0,F=0,o,u=!1,I=!1;const V=E=>E.style.get("visibility")!=="hidden"&&E.style.get("visibility")!=="collapse"&&E.opacity>0,Y=()=>{const E=o?.context.style.get("text-anchor");u&&o?.text&&(E==="middle"||E==="end")&&G("TEXT_POSITIONS_SIMPLIFIED","text")},te=(E,h,d)=>{fe();const X=h.xmlSpace==="preserve"||/^pre/.test(h.style.get("white-space")??""),le=(Z,J)=>(q(E,Z)??"").trim().split(/[\s,]+/).filter(Boolean).map(ae=>i(ae,h.fontSize,J)).filter(ae=>ae!==void 0),_=le("x",h.userWidth),j=le("y",h.userHeight),Q=le("dx",h.userWidth),$=le("dy",h.userHeight);(_.length>1||j.length>1||Q.length>1||$.length>1||q(E,"rotate")!==void 0)&&G("TEXT_POSITIONS_SIMPLIFIED",E.local);const xe=d||_.length>0||j.length>0||Q.length>0||$.length>0;!d&&xe&&!_.length&&o?.text.trim()&&G("TEXT_POSITIONS_SIMPLIFIED",E.local),xe&&(Y(),_.length&&(T=_[0],u=!1,I=!1),j.length&&(F=j[0]),T+=Q[0]??0,F+=$[0]??0,o={x:T,y:F,text:"",context:h,preserve:X},P.push(o));for(const Z of E.children){if(typeof Z=="string"){if(fe(1+Math.ceil(Z.length/16)),!o)continue;const ae=X&&Z.length>0||/[^\t\r\n ]/.test(Z);if(!V(h)){u||=ae,I||=/[ \t]/.test(Z)&&/[^\t\r\n ]$/.test(o.text);continue}if(!ae&&!V(o.context))continue;if(ae){const Ce=I&&/[^\t\r\n ]$/.test(o.text)&&/^[^\t\r\n ]/.test(Z);(u||Ce)&&G("TEXT_POSITIONS_SIMPLIFIED",E.local),u=I=!1}V(o.context)||(o.context=h,o.preserve=X);const Te=o.context;o.preserve!==X&&/[\t\r\n ]/.test(Z)&&G("TEXT_WHITESPACE_SIMPLIFIED",E.local),ae&&Te.matrix.some((Ce,De)=>Ce!==h.matrix[De])&&G("TEXT_TRANSFORM_IGNORED",E.local),(Te.style!==h.style||Te.fontSize!==h.fontSize||Te.opacity!==h.opacity)&&/\S/.test(Z)&&G("TEXT_STYLE_MERGED",E.local),o.text+=Z;continue}if(Z.local!=="tspan"&&Z.local!=="a"){Z.local==="textPath"&&G("TEXT_PATH_IGNORED","textPath");continue}const J=qe(Z,h);J&&te(Z,J.context,!1)}};te(e,r,!0),Y();for(const E of P){const h=E.context.style,{preserve:d}=E;let X=E.text.replace(/\t/g," ").replace(/[\r\n]/g,d?" ":"");if(d||(X=X.replace(/ {2,}/g," ")),E===P[0]&&!d&&(X=X.replace(/^ +/,"")),E===P[P.length-1]&&!d&&(X=X.replace(/ +$/,"")),!X||h.get("visibility")==="hidden"||h.get("visibility")==="collapse")continue;const le=We(h.get("fill"),E.context,"fill-opacity","text");if(le===void 0)continue;(h.get("stroke")??"none")!=="none"&&G("TEXT_STROKE_IGNORED","text");const _=E.context.matrix,j=c(_);(ue(_)||l(_)<0)&&G("TEXT_DISTORTED","text");const Q=E.context.fontSize*j;if(!(Q>0))continue;const $=h.get("dominant-baseline")??h.get("alignment-baseline")??"auto",xe=$==="middle"||$==="central"?.35:$==="hanging"||$==="text-before-edge"||$==="text-top"?.8:$==="text-after-edge"||$==="ideographic"||$==="text-bottom"?-.2:0,[Z,J]=k(_,E.x,E.y+xe*E.context.fontSize),ae=Math.atan2(_[1],_[0])*180/Math.PI,Te=h.get("font-weight")??"normal",Ce=/italic|oblique/.test(h.get("font-style")??""),De=Te==="bold"||Te==="bolder"||Number(Te)>=600;let Pe=De&&Ce?"boldItalic":De?"bold":Ce?"italic":"regular";Ve.has(Pe)||(Pe="regular");const Xe=h.get("text-anchor"),Le={kind:"text",text:Ae?K(X,()=>G("TEXT_SUBSTITUTED","text")):X.normalize("NFC"),x:Z,y:J,font:Pe,fontSize:Q,color:le};Le.text&&((Xe==="middle"||Xe==="end")&&(Le.anchor=Xe),Math.abs(ae)>1e-6&&(Le.rotation=Math.round(ae*1e6)/1e6),ee(D,Le))}}function Qe(e){return e.children.some(r=>(fe(typeof r=="string"?1+Math.ceil(r.length/16):1),typeof r=="string"?/\S/.test(r):Qe(r)))}function Ue(e,r,D,P,T){if(P<=0||T<=0)return null;const F=Math.abs(e[1])<=1e-9&&Math.abs(e[2])<=1e-9,o=Math.abs(e[0])<=1e-9&&Math.abs(e[3])<=1e-9;if(!F&&!o)return;const[u,I]=k(e,r,D),[V,Y]=k(e,r+P,D+T),te=Math.max(0,Math.min(u,V)),E=Math.max(0,Math.min(I,Y)),h=Math.min(Ze,Math.max(u,V)),d=Math.min(Be,Math.max(I,Y));if([te,E,h,d].every(Number.isFinite))return h<=te||d<=E?null:{x:te,y:E,width:h-te,height:d-E}}function lt(e,r,D){if(e===void 0||e==="none")return;Me(e);const P=/^url\(\s*["']?#([^"')]+)["']?\s*\)$/.exec(e.trim())?.[1],T=P===void 0?void 0:Oe.get(P);if(T?.local!=="clipPath"){G("CLIP_IGNORED",D);return}const F=Re(T),o=F.get("visibility")??q(T,"visibility");let u,I=w;for(const $ of T.children){if(fe(),typeof $=="string")continue;const xe=Re($);if((xe.get("display")??q($,"display"))==="none")continue;const Z=xe.get("visibility")??q($,"visibility"),J=Z===void 0||Z==="inherit"||Z==="unset"?o:Z;if(!(J==="hidden"||J==="collapse")){if(u||$.local!=="rect"){G("CLIP_IGNORED",D);return}u=$,I=xe}}if(!u)return null;if(T.attributes.get("clipPathUnits")==="objectBoundingBox"){G("CLIP_IGNORED",D);return}const V=($,xe)=>i(I.get($)??q(u,$),r.fontSize,xe),Y=V("width",r.userWidth)??0,te=V("height",r.userHeight)??0;if(Y<=0||te<=0)return null;const E=V("rx",r.userWidth),h=V("ry",r.userHeight);if((E??h??0)>0&&(h??E??0)>0){G("CLIP_IGNORED",D);return}const d=He(T,F,r,r.fontSize),X=He(u,I,r,r.fontSize);if(!d||!X)return;const le=p(r.matrix,p(d,X)),_=V("x",r.userWidth)??0,j=V("y",r.userHeight)??0,Q=Ue(le,_,j,Y,te);return Q===void 0&&G("CLIP_IGNORED",D),Q}const Je=new Map;function ft(e,r,D,P){const T=r.matrix;if(!r.imageTransformValid||Math.abs(T[1])>1e-9||Math.abs(T[2])>1e-9||!(T[0]>0)||!(T[3]>0)){G("IMAGE_SKIPPED","image");return}const F=(q(e,"href")??q(e,"xlink:href"))?.trim();let o=F===void 0?null:Je.get(F);if(F!==void 0&&o===void 0&&(fe(Math.ceil(F.length/16)),o=de(F)??null,Je.set(F,o)),!o){G("IMAGE_SKIPPED","image");return}const u=(ae,Te)=>i(D.get(ae)??q(e,ae),r.fontSize,Te),I=u("x",r.userWidth)??0,V=u("y",r.userHeight)??0,Y=u("width",r.userWidth),te=u("height",r.userHeight),E=Y??(te===void 0?o.width:te*o.width/o.height),h=te??(Y===void 0?o.height:Y*o.height/o.width);if(!(E>0&&h>0))return;let d={x:I,y:V,width:E,height:h},X;const le=q(e,"preserveAspectRatio")?.trim().replace(/^defer(?:\s+|$)/,""),[_="xMidYMid",j="meet"]=(le||"xMidYMid meet").split(/\s+/);if(_!=="none"){const ae=E/o.width,Te=h/o.height,Ce=j==="slice"?Math.max(ae,Te):Math.min(ae,Te),De=o.width*Ce,Pe=o.height*Ce;if(d={x:I+(E-De)*(_.includes("xMid")?.5:_.includes("xMax")?1:0),y:V+(h-Pe)*(_.includes("YMid")?.5:_.includes("YMax")?1:0),width:De,height:Pe},j==="slice"&&!r.overflowVisible&&(X=Ue(T,I,V,E,h),X===null))return}const[Q,$]=k(T,d.x,d.y),[xe,Z]=k(T,d.x+d.width,d.y+d.height),J={kind:"image",image:o.image,x:Q,y:$,width:xe-Q,height:Z-$,...r.opacity<1?{opacity:r.opacity}:{}};if(![Q,$,J.width,J.height].every(ae=>Number.isFinite(ae)&&Math.abs(ae)<=1e6)||!(J.width>0&&J.height>0)){G("IMAGE_SKIPPED","image");return}if(X&&r.clipDepth+1<O){const ae=[];ee(ae,J),ee(P,{kind:"group",clip:X,elements:ae})}else X&&G("CLIP_DEPTH_IGNORED","image"),ee(P,J)}function et(e,r){if(e.length!==r+1)return!1;const D=e[r];return D.kind==="image"||D.kind==="group"&&et(D.elements,0)}const je=new Set;function ze(e,r,D,P,T){if(fe(),U.has(e.local)&&!(e.local==="symbol"&&T))return;if(P>512)throw new ie("Chart SVG nesting is too deep.");if(e.local==="image"&&ne===1){G("IMAGE_SKIPPED","image");return}if(e.local==="foreignObject"){G("FOREIGN_OBJECT_SKIPPED","foreignObject");return}if(e.local==="style"){Qe(e)&&G("STYLESHEET_IGNORED","style");return}const F=qe(e,r);if(!F||F.context.opacity<=0)return;let{context:o}=F;const u=F.own;u.get("mask")&&u.get("mask")!=="none"&&G("MASK_IGNORED",e.local),u.get("filter")&&u.get("filter")!=="none"&&G("FILTER_IGNORED",e.local);let I;if((e.local==="svg"||e.local==="symbol")&&e!==Ie){const h=Fe(e,o.fontSize,o.userWidth,o.userHeight,!0,T);if(!(h.width>0&&h.height>0))return;const d=i(q(e,"x"),o.fontSize,o.userWidth)??0,X=i(q(e,"y"),o.fontSize,o.userHeight)??0,le=p(o.matrix,[1,0,0,1,d,X]);if(!o.overflowVisible){const _=Ue(le,0,0,h.width,h.height);if(_===null)return;I=_,I||G("CLIP_IGNORED",e.local)}o={...o,userWidth:h.userWidth,userHeight:h.userHeight,viewportOriginZero:h.originZero,matrix:p(le,h.matrix)}}let V=lt(u.get("clip-path"),o,e.local);if(V===null)return;if(V&&I){const h=Math.max(V.x,I.x),d=Math.max(V.y,I.y),X=Math.min(V.x+V.width,I.x+I.width)-h,le=Math.min(V.y+V.height,I.y+I.height)-d;if(X<=0||le<=0)return;V={x:h,y:d,width:X,height:le}}else V??=I;V&&(o.clipDepth+1>=O?(G("CLIP_DEPTH_IGNORED",e.local),V=void 0):o={...o,clipDepth:o.clipDepth+1});const Y=V?[]:D,te=Y.length,E=o.style.get("visibility")!=="hidden"&&o.style.get("visibility")!=="collapse";if(b.has(e.local))E&&at(e,o,Y,u);else if(e.local==="text")ct(e,o,Y);else if(e.local==="image")E&&ft(e,o,F.declared,Y);else if(e.local==="use"){const h=(q(e,"href")??q(e,"xlink:href"))?.replace(/^#/,""),d=h===void 0?void 0:Oe.get(h);if(!d||je.has(d))G("USE_UNRESOLVED","use");else{const X=i(q(e,"x"),o.fontSize,o.userWidth)??0,le=i(q(e,"y"),o.fontSize,o.userHeight)??0,_={...o,matrix:p(o.matrix,[1,0,0,1,X,le])};je.add(d);const j={width:i(q(e,"width"),o.fontSize,o.userWidth),height:i(q(e,"height"),o.fontSize,o.userHeight)};ze(d,_,Y,P+1,j),je.delete(d)}}else if(e.local==="switch"){for(const h of e.children)if(fe(),typeof h!="string"){if(["systemLanguage","requiredExtensions","requiredFeatures"].some(d=>h.attributes.has(d))){G("SWITCH_CONDITION_IGNORED",h.local);continue}ze(h,o,Y,P+1);break}}else if(v.has(e.local))for(const h of e.children)typeof h=="string"?fe():ze(h,o,Y,P+1);else G("ELEMENT_SKIPPED",e.local);F.groupOpacity&&Y.length>te&&!et(Y,te)&&G("OPACITY_FLATTENED",e.local),V&&Y.length&&ee(D,{kind:"group",clip:V,elements:Y})}return ze(Ie,{matrix:[ve*ke.matrix[0],0,0,ve*ke.matrix[3],ve*ke.matrix[4],ve*ke.matrix[5]],userWidth:ke.userWidth,userHeight:ke.userHeight,viewportOriginZero:ke.originZero,clipDepth:0,overflowVisible:!0,imageTransformValid:!0,style:w,fontSize:16,opacity:1,localOpacity:1},Ye,0),{version:ne,width:Ze,height:Be,elements:Ye,standardFonts:!0}}return Object.freeze({svgToPdfDrawing:L})})(),Pt=(()=>{const{ExportCell:ie}=Tt,{NumberFormats:W}=Et,{ExportBudget:z}=nt,ce=l=>l+" (display)";function ye(l){let M=!1,C=!1;for(const p of l.series)for(const x of p.points){if(!(x.x instanceof Date))continue;const S=x.x.getTime()%864e5;if(S%1e3)return"yyyy-mm-dd hh:mm:ss.000";S&&(M=!0),S%6e4&&(C=!0)}return C?"yyyy-mm-dd hh:mm:ss":M?"yyyy-mm-dd hh:mm":"yyyy-mm-dd"}function me(l){const M=l.xTitle;return l.kind==="date"?{key:"x",header:M,type:"date",format:l.xFormat??ye(l)}:l.kind==="number"?{key:"x",header:M,type:"number",...l.xFormat===void 0?{}:{format:l.xFormat}}:{key:"x",header:M,type:"string"}}const O=(l,M)=>M?l+" ("+M+")":l;function de(l){const M=new Map;for(const C of l.series){const p=new Set;for(const x of C.points){if(x.key===null||p.has(x.key))return!1;if(p.add(x.key),x.xCaption!==void 0){const S=M.get(x.key);if(S!==void 0&&S!==x.xCaption)return!1;M.set(x.key,x.xCaption)}}}return!0}function y(l,M="auto",C){if(M!=="auto"&&M!=="wide"&&M!=="long")throw new TypeError("Chart layout must be auto, wide or long.");const p=M!=="long"&&de(l);if(M==="wide"&&!p)throw new TypeError("A wide chart sheet needs unique x values in every series, consistent x captions, and no missing x values.");const x=new z(C),S=l.title?2:1;function t(b){if(x.row(b),b+S>1048576)throw new RangeError("Excel supports at most 1,048,576 rows including headings.")}function n(b,w){x.check("maxCells",(b+S)*w)}const a=me(l),c=l.series.some(b=>b.points.some(w=>w.xCaption!==void 0)),s=(b,w,ue)=>b?.y===null||b===void 0?null:w!==void 0&&w!==ue?new ie(b.y,{presentation:{numberFormat:w||W.General}}):b.y;if(!p){const b=l.yFormat,w=l.series.some(se=>se.points.some(B=>B.caption!==void 0)),ue=new Set(l.series.filter(se=>se.points.length>0).map(se=>(se.unit??l.yUnit)||void 0)),L=ue.size>1,ge=O(l.yTitle,ue.size===0?l.yUnit:L?void 0:ue.values().next().value),R=[{key:"series",header:"Series",type:"string"},{key:"seriesId",header:"Series ID",type:"string"},a,...c?[{key:"xCaption",header:ce(a.header),type:"string"}]:[],{key:"y",header:ge,type:"number",...b===void 0?{}:{format:b}},...w?[{key:"caption",header:ce(ge),type:"string"}]:[],...L?[{key:"unit",header:"Unit",type:"string"}]:[]],re=l.series.reduce((se,B)=>se+B.points.length,0);t(re),n(re,R.length);function*ne(){for(const se of l.series)for(const B of se.points)yield[se.name,se.id,B.x,...c?[B.xCaption??null]:[],s(B,se.format??b,b),...w?[B.caption??null]:[],...L?[se.unit??l.yUnit??null]:[]]}return{columns:R,rows:ne()}}const f=l.series.map(b=>b.points.some(w=>w.caption!==void 0)),g=1+Number(c)+l.series.length+f.filter(Boolean).length;if(g>16384)throw new RangeError("Excel supports at most 16,384 columns.");const i=[],m=new Map,N=new Map,K=new Set;for(const b of l.series)for(const w of b.points)K.has(w.key)||(t(i.length+1),K.add(w.key),i.push(w.key),N.set(w.key,w.x)),w.xCaption!==void 0&&!m.has(w.key)&&m.set(w.key,w.xCaption);n(i.length,g),l.kind!=="category"&&i.sort((b,w)=>b-w);const A=new Map;for(const b of l.series)A.set(b.name,(A.get(b.name)??0)+1);const H=[a,...c?[{key:"xCaption",header:ce(a.header),type:"string"}]:[]],U=l.series.map((b,w)=>{const ue=b.format??l.yFormat,L=O(b.name+(A.get(b.name)>1?" ["+b.id+"]":""),b.unit??l.yUnit),ge=f[w];return H.push({key:"s"+w,header:L,type:"number",...ue===void 0?{}:{format:ue}}),ge&&H.push({key:"s"+w+"Caption",header:ce(L),type:"string"}),{caption:ge,format:ue,points:new Map(b.points.map(R=>[R.key,R]))}});function*v(){for(const b of i){const w=[N.get(b)??null,...c?[m.get(b)??null]:[]];for(const ue of U){const L=ue.points.get(b);w.push(L?.y??null),ue.caption&&w.push(L?.caption??null)}yield w}}return{columns:H,rows:v()}}return Object.freeze({chartTable:y})})(),Nt=(()=>{const{BlobByteSink:ie,checkAbort:W}=ut,{captureFields:z}=tt,{captureCommonLimits:ce,captureXlsxOptions:ye,mergeAdapterLimits:me}=kt,{writeXlsxTo:O}=mt,{writePdfDocumentTo:de}=gt,{capturePdfLimits:y}=$e,{prepareChart:k}=Ct,{svgToPdfDrawing:l}=Dt,{chartTable:M}=Pt,{winAnsiText:C}=it,p=["regular","bold","italic","boldItalic"],x="E7EDF5",S=Object.freeze({bottom:Object.freeze({style:"thin",color:"A6B4C8"})});function t(s,f={},g={}){const m=z(f===2?g:f,["unsupported","fonts","winAnsi","limits","onDiagnostic"]);return f===2?l(s,m,2):l(s,m,1)}async function n(s,f,g,i={}){const m=z(i,["layout","signal","limits","onProgress","onDiagnostic","unsupported","xlsx","pdf"]);if(f!=="xlsx"&&f!=="pdf")throw new TypeError("ChartForgeX exports are xlsx or pdf.");const{signal:N,onProgress:K,onDiagnostic:A,unsupported:H}=m,U=ce(m.limits);if(H!==void 0&&H!=="skip"&&H!=="reject")throw new TypeError("unsupported must be skip or reject.");W(N);const v=k(s),b={...N?{signal:N}:{},...K?{onProgress:K}:{}};if(f==="xlsx"){const oe=z(m.xlsx??{},["dateMode","compression","creator","created","modified","sheetName"]),{sheetName:we="Chart data",...be}=oe,fe=ye(be),Me=me(fe.limits,U),ee=M(v,m.layout,Me);return O(ee.rows,g,{dateMode:"utc",...fe,...b,columns:ee.columns,...v.title===void 0?{}:{title:v.title},...v.description===void 0?{}:{description:v.description},limits:Me,sheet:{name:we,headerFill:x,headerBorder:S,headerWrap:!0,freezeHeader:!0,autoFilter:!0,boldHeader:!0,autoSize:{minWidth:8,maxWidth:48},...v.title?{title:{text:v.title}}:{}}})}if(v.svg===void 0)throw new TypeError("A ChartForgeX PDF needs the chart's SVG markup.");const w=z(m.pdf??{},["pageSize","orientation","margins","fonts","tagged","compression","pageNumbers","pageHeader","pageFooter","fontSize","limits"]),ue=me(w.limits===void 0?void 0:y(w.limits),U),L=w.fonts===void 0?void 0:z(w.fonts,p),ge=L?p.filter(oe=>oe==="regular"||L[oe]!==void 0):p,R=new Set,re=oe=>{R.has(oe.code)||(R.add(oe.code),A?.(oe))},ne=l(v.svg,{fonts:ge,winAnsi:!L?.regular,limits:ue,...H?{unsupported:H}:{},onDiagnostic:re},2,N),se=oe=>{if(oe!==void 0)return L?.regular?oe.normalize("NFC"):C(oe,()=>{if(H==="reject")throw new TypeError("Chart text needs an embedded font: supply pdf.fonts.regular.");re({code:"TEXT_SUBSTITUTED"})})},B=se(v.title),he=se(v.description),Se=v.description?.trim()?v.description:v.title?.trim()?v.title:"Chart",pe=[...he?[{kind:"paragraph",text:he}]:[],{kind:"drawing",drawing:ne,alignment:"center",alternativeText:Se}];return de(pe,g,{orientation:ne.width>ne.height?"landscape":"portrait",pageNumbers:!1,...w,...b,...L?{fonts:L}:{},...B?{title:B}:{},...v.title?{metadataTitle:v.title}:{},limits:ue})}async function a(s,f,g={}){const i=new ie;try{return await n(s,f,i,g),i.toBlob(f==="xlsx"?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"application/pdf")}catch(m){throw i.discard(),m}}return Object.freeze({PdfFont:St.PdfFont,chartForgeXDrawing:t,writeChartForgeXTo:n,exportChartForgeX:a})})(),{PdfFont:At,chartForgeXDrawing:Ft,writeChartForgeXTo:Rt,exportChartForgeX:zt}=Nt;export{At as PdfFont,Ft as chartForgeXDrawing,zt as exportChartForgeX,Rt as writeChartForgeXTo};
|