efficient-office 0.12.0 → 0.13.0

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.
Files changed (46) hide show
  1. package/dist/Slides-JLWEMUXJ.js +1 -0
  2. package/dist/SlidesEditor-DGK4W6W4.js +1 -0
  3. package/dist/Spreadsheet-WQOZPWY5.js +1 -0
  4. package/dist/chunk-5K2D7PBJ.js +1 -0
  5. package/dist/chunk-AJTH75FI.js +1 -0
  6. package/dist/chunk-BDVKNU3U.js +1 -0
  7. package/dist/chunk-CEVQKZ66.js +1 -0
  8. package/dist/chunk-EDJRXJNE.js +1 -0
  9. package/dist/chunk-EP3ZNVDB.js +1 -0
  10. package/dist/{chunk-DG4VDXLL.js → chunk-HQM2HX4V.js} +1 -1
  11. package/dist/chunk-PX4QOBHF.js +1 -0
  12. package/dist/{chunk-MDG2ADZ7.js → chunk-R2CXMNZL.js} +1 -1
  13. package/dist/chunk-T2TZ7HF5.js +1 -0
  14. package/dist/chunk-VYLIT7NN.js +1 -0
  15. package/dist/{chunk-MR7ZWQHF.js → chunk-WAB44FLE.js} +1 -1
  16. package/dist/{chunk-NRGUS5QY.js → chunk-XENQLN5I.js} +1 -1
  17. package/dist/deckPdf-KZFS4CTF.js +1 -0
  18. package/dist/documents/index.js +1 -1
  19. package/dist/docxPdf-S4RXU4L2.js +1 -0
  20. package/dist/importSpreadsheet-L5FJGRUV.js +1 -0
  21. package/dist/{pptxImport-OACGHWQ6.js → pptxImport-UQQXZUQL.js} +1 -1
  22. package/dist/slides/index.d.ts +213 -17
  23. package/dist/slides/index.js +1 -1
  24. package/dist/slides/slides.css +53 -0
  25. package/dist/spreadsheet/index.d.ts +2 -1
  26. package/dist/spreadsheet/index.js +1 -1
  27. package/dist/workbookPdf-K65CQX4K.js +1 -0
  28. package/dist/xlsxFile-3GXD4KW5.js +1 -0
  29. package/package.json +1 -1
  30. package/dist/Slides-YZQXZJX4.js +0 -1
  31. package/dist/SlidesEditor-ETCUQVJ7.js +0 -1
  32. package/dist/Spreadsheet-VWRRB6FE.js +0 -1
  33. package/dist/chunk-3RFDQOTI.js +0 -1
  34. package/dist/chunk-ADXHTZ3Q.js +0 -1
  35. package/dist/chunk-B2X3NIQR.js +0 -1
  36. package/dist/chunk-BGAR3P46.js +0 -1
  37. package/dist/chunk-JKYJGXJE.js +0 -1
  38. package/dist/chunk-PXOQN7D6.js +0 -1
  39. package/dist/chunk-Q7NVDOCX.js +0 -1
  40. package/dist/chunk-UKGIT2RS.js +0 -1
  41. package/dist/chunk-ZS45QEF4.js +0 -1
  42. package/dist/deckPdf-4RC7QJ45.js +0 -1
  43. package/dist/docxPdf-QSMEFCUF.js +0 -1
  44. package/dist/importSpreadsheet-IRN32JON.js +0 -1
  45. package/dist/workbookPdf-CQTTURQ5.js +0 -1
  46. package/dist/xlsxFile-SX767BIH.js +0 -1
@@ -1 +0,0 @@
1
- import{DECK_FONT as t,NO_FILL as e,SLIDE_H as n,SLIDE_W as r,newId as o}from"./chunk-PXOQN7D6.js";var i=t=>`M${t.map(([t,e])=>`${t},${e}`).join(" L")} Z`,a=(t,e,n,r=-Math.PI/2)=>i(Array.from({length:t},(o,i)=>{const a=r+2*i*Math.PI/t;return[e/2+e/2*Math.cos(a),n/2+n/2*Math.sin(a)]})),l={rect:(t,e)=>i([[0,0],[t,0],[t,e],[0,e]]),roundRect:(t,e,n)=>{const r=Math.min(n??Math.min(t,e)/6,t/2,e/2);return`M${r},0 H${t-r} A${r},${r} 0 0 1 ${t},${r} V${e-r} A${r},${r} 0 0 1 ${t-r},${e} H${r} A${r},${r} 0 0 1 0,${e-r} V${r} A${r},${r} 0 0 1 ${r},0 Z`},ellipse:(t,e)=>`M0,${e/2} A${t/2},${e/2} 0 1 1 ${t},${e/2} A${t/2},${e/2} 0 1 1 0,${e/2} Z`,triangle:(t,e)=>i([[t/2,0],[t,e],[0,e]]),rightTriangle:(t,e)=>i([[0,0],[t,e],[0,e]]),diamond:(t,e)=>i([[t/2,0],[t,e/2],[t/2,e],[0,e/2]]),pentagon:(t,e)=>a(5,t,e),hexagon:(t,e)=>a(6,t,e,0),octagon:(t,e)=>a(8,t,e,Math.PI/8),star:(t,e)=>i(Array.from({length:10},(n,r)=>{const o=-Math.PI/2+r*Math.PI/5,i=r%2==0?.5:.2;return[t/2+t*i*Math.cos(o),e/2+e*i*Math.sin(o)+.04*e]})),heart:(t,e)=>`M${t/2},${e} C${.1*t},${.7*e} 0,${.45*e} 0,${.28*e} C0,${.05*e} ${.25*t},0 ${.5*t},${.2*e} C${.75*t},0 ${t},${.05*e} ${t},${.28*e} C${t},${.45*e} ${.9*t},${.7*e} ${t/2},${e} Z`,cloud:(t,e)=>`M${.25*t},${.85*e} C${.05*t},${.85*e} 0,${.6*e} ${.12*t},${.5*e} C${.05*t},${.25*e} ${.3*t},${.15*e} ${.4*t},${.25*e} C${.45*t},${.05*e} ${.75*t},${.05*e} ${.75*t},${.3*e} C${.95*t},${.25*e} ${t},${.55*e} ${.88*t},${.65*e} C${t},${.8*e} ${.85*t},${.9*e} ${.72*t},${.85*e} Z`,bolt:(t,e)=>i([[.55*t,0],[.15*t,.55*e],[.45*t,.55*e],[.35*t,e],[.85*t,.4*e],[.55*t,.4*e],[.75*t,0]]),parallelogram:(t,e)=>i([[.25*t,0],[t,0],[.75*t,e],[0,e]]),trapezoid:(t,e)=>i([[.2*t,0],[.8*t,0],[t,e],[0,e]]),cylinder:(t,e)=>{const n=Math.min(.15*e,t/4);return`M0,${n} A${t/2},${n} 0 0 1 ${t},${n} V${e-n} A${t/2},${n} 0 0 1 0,${e-n} Z M0,${n} A${t/2},${n} 0 0 0 ${t},${n}`},plus:(t,e)=>{const n=t/3,r=e/3;return i([[n,0],[2*n,0],[2*n,r],[t,r],[t,2*r],[2*n,2*r],[2*n,e],[n,e],[n,2*r],[0,2*r],[0,r],[n,r]])},arrowRight:(t,e)=>i([[0,.25*e],[.6*t,.25*e],[.6*t,0],[t,e/2],[.6*t,e],[.6*t,.75*e],[0,.75*e]]),arrowLeft:(t,e)=>i([[t,.25*e],[.4*t,.25*e],[.4*t,0],[0,e/2],[.4*t,e],[.4*t,.75*e],[t,.75*e]]),arrowUp:(t,e)=>i([[.25*t,e],[.25*t,.4*e],[0,.4*e],[t/2,0],[t,.4*e],[.75*t,.4*e],[.75*t,e]]),arrowDown:(t,e)=>i([[.25*t,0],[.25*t,.6*e],[0,.6*e],[t/2,e],[t,.6*e],[.75*t,.6*e],[.75*t,0]]),arrowLeftRight:(t,e)=>i([[0,e/2],[.25*t,0],[.25*t,.25*e],[.75*t,.25*e],[.75*t,0],[t,e/2],[.75*t,e],[.75*t,.75*e],[.25*t,.75*e],[.25*t,e]]),chevron:(t,e)=>i([[0,0],[.7*t,0],[t,e/2],[.7*t,e],[0,e],[.3*t,e/2]]),callout:(t,e)=>i([[0,0],[t,0],[t,.75*e],[.4*t,.75*e],[.2*t,e],[.25*t,.75*e],[0,.75*e]]),calloutRound:(t,e)=>{const n=.12*Math.min(t,e),r=.75*e;return`M${n},0 H${t-n} A${n},${n} 0 0 1 ${t},${n} V${r-n} A${n},${n} 0 0 1 ${t-n},${r} H${.4*t} L${.2*t},${e} L${.25*t},${r} H${n} A${n},${n} 0 0 1 0,${r-n} V${n} A${n},${n} 0 0 1 ${n},0 Z`}};function s(t,e,n,r){return(l[t]??l.rect)(e,n,r)}var c={rect:"rect",roundRect:"roundRect",ellipse:"ellipse",triangle:"triangle",rightTriangle:"rtTriangle",diamond:"diamond",pentagon:"pentagon",hexagon:"hexagon",octagon:"octagon",star:"star5",heart:"heart",cloud:"cloud",bolt:"lightningBolt",parallelogram:"parallelogram",trapezoid:"trapezoid",cylinder:"can",plus:"plus",arrowRight:"rightArrow",arrowLeft:"leftArrow",arrowUp:"upArrow",arrowDown:"downArrow",arrowLeftRight:"leftRightArrow",chevron:"chevron",callout:"wedgeRectCallout",calloutRound:"wedgeRoundRectCallout",line:"line"},h=["bold","italic","underline","strike","color","highlight","size","font","link"];function u(t){return t.paragraphs&&t.paragraphs.length>0?t.paragraphs:t.text.split("\n").map(t=>({runs:[{text:t}]}))}function d(t){return t.map(t=>t.runs.map(t=>t.text).join("")).join("\n")}function f(t,e){const n=e.map(m);return{...t,paragraphs:n,text:d(n)}}var p=(t,e)=>h.every(n=>(t[n]??void 0)===(e[n]??void 0));function g(t){const e={};for(const n of h){const r=t[n];void 0!==r&&!1!==r&&""!==r&&(e[n]=r)}return e}function m(t){const e=[];for(const n of t.runs){const t=g(n),r=e[e.length-1];n.text&&(r&&p(g(r),t)?r.text+=n.text:e.push({text:n.text,...t}))}const n={};t.align&&"left"!==t.align&&(n.align=t.align),t.list&&(n.list=t.list),t.level&&(n.level=Math.max(0,Math.min(4,t.level))),t.lineHeight&&(n.lineHeight=t.lineHeight);const r=t.runs[0]?[{...g(t.runs[0]),text:""}]:[{text:""}];return{...n,runs:e.length>0?e:r}}function $(t){const e=[];let n=0;for(const r of t)e.push(n),n+=r.runs.reduce((t,e)=>t+e.text.length,0)+1;return e}function y(t,e,n,r){return function(t,e,n,r){const o=$(t);return t.map((t,i)=>{const a=o[i],l=t.runs.reduce((t,e)=>t+e.text.length,0),s=Math.max(e-a,0),c=Math.min(n-a,l);if(c<=s)return t;let h=0;const u=function(t,e,n){const r=[];let o=0;for(const i of t){const t=o+i.text.length,a=[e,n].filter(e=>e>o&&e<t).map(t=>t-o);let l=0;for(const t of[...a,i.text.length])t>l&&r.push({...i,text:i.text.slice(l,t)}),l=t;o=t}return r}(t.runs,s,c).map(t=>{const e=h>=s&&h+t.text.length<=c;return h+=t.text.length,e?r(t):t});return m({...t,runs:u})})}(t,e,n,t=>{const e={...t,...r};for(const t of h)void 0===e[t]&&delete e[t];return e})}function w(t,e,n){const r=[],o=$(t);if(t.forEach((t,i)=>{let a=o[i];for(const o of t.runs){const t=a+o.text.length;(e===n?e>a&&e<=t||e===a&&""===o.text:t>e&&a<n)&&r.push(g(o)),a=t}}),0===r.length){let n=0;o.forEach((t,r)=>{t<=e&&(n=r)}),r.push(g(t[n]?.runs[0]??{text:""}))}const i={};for(const t of h){const e=r[0][t];void 0!==e&&r.every(n=>n[t]===e)&&(i[t]=e)}return i}function x(t,e,n){const r=$(t);return t.map((t,e)=>e).filter(o=>r[o]+t[o].runs.reduce((t,e)=>t+e.text.length,0)>=e&&r[o]<=n)}function v(t,e,n,r){const o=new Set(x(t,e,n));return t.map((t,e)=>o.has(e)?m(r(t)):t)}function b(t,e,n,r){const o=x(t,e,n).every(e=>t[e].list===r);return v(t,e,n,t=>({...t,list:o?void 0:r}))}function M(t,e,n,r){return v(t,e,n,t=>({...t,level:Math.max(0,Math.min(4,(t.level??0)+r))}))}function k(t){const e=[];return t.map(t=>{const n=t.level??0;return e.length=n+1,"number"!==t.list?(t.list?e[n]=0:e.length=0,"bullet"===t.list?["•","◦","▪"][n%3]:null):(e[n]=(e[n]??0)+1,`${e[n]}.`)})}var S="data-run",C="data-paragraph",A=t=>t instanceof HTMLElement&&"false"===t.getAttribute("contenteditable");function I(t,e=[]){return A(t)||(t.nodeType===Node.TEXT_NODE?e.push(t):t.childNodes.forEach(t=>I(t,e))),e}var H=t=>I(t).reduce((t,e)=>t+e.data.replace(/\u200b/g,"").length,0);function j(t){const e=[...t.childNodes],n=[];let r=null;const o=(e,n)=>{if(!A(e))if(e.nodeType===Node.TEXT_NODE){const r=e.parentElement?.closest(`[${S}]`),o=r&&t.contains(r)?JSON.parse(r.getAttribute(S)||"{}"):{};n.push({...o,text:(e.textContent??"").replace(/​/g,"")})}else e.childNodes.forEach(t=>o(t,n))};for(const t of e){if(!(t instanceof HTMLElement&&(t.hasAttribute(C)||/^(DIV|P)$/.test(t.tagName)))){if(t instanceof HTMLElement&&"BR"===t.tagName){r=null;continue}r||(r={runs:[]},n.push(r)),o(t,r.runs);continue}r=null;const e=JSON.parse(t.getAttribute(C)||"{}"),i=[];o(t,i),n.push({...e,runs:i})}return(n.length>0?n:[{runs:[{text:""}]}]).map(m)}function z(t){const e=t.ownerDocument.getSelection();if(!e||0===e.rangeCount)return null;const n=e.getRangeAt(0);if(!t.contains(n.startContainer)||!t.contains(n.endContainer))return null;const r=(e,n)=>{const r=t.ownerDocument.createRange();r.setStart(t,0),r.setEnd(e,n);const o=[...t.childNodes];let i=0;return o.forEach((t,o)=>{if(r.intersectsNode(t)){o>0&&(i+=1);for(const o of I(t))o===e?i+=o.data.slice(0,n).replace(/\u200b/g,"").length:r.isPointInRange(o,o.data.length)&&(i+=o.data.replace(/\u200b/g,"").length)}}),i},o=r(n.startContainer,n.startOffset),i=r(n.endContainer,n.endOffset);return{start:Math.min(o,i),end:Math.max(o,i)}}function L(t,e,n){const r=e=>{const n=[...t.childNodes];let r=0;for(let t=0;t<n.length;t+=1){t>0&&(r+=1);const o=I(n[t]);if(e<=r+H(n[t])){let i=r;for(const t of o){const n=t.data.replace(/\u200b/g,"").length;if(e<=i+n)return[t,0===n?t.data.length:e-i];i+=n}return[n[t],n[t].childNodes.length]}r+=H(n[t])}return[t,t.childNodes.length]},o=t.ownerDocument.getSelection();if(!o)return;const i=t.ownerDocument.createRange(),[a,l]=r(e),[s,c]=r(n);i.setStart(a,l),i.setEnd(s,c),o.removeAllRanges(),o.addRange(i)}var E=24;function F(t,e){const n=t.x+t.w/2,r=t.y+t.h/2,o={n:[0,-t.h/2],e:[t.w/2,0],s:[0,t.h/2],w:[-t.w/2,0]}[e],i=t.rotation*Math.PI/180;return{x:n+o[0]*Math.cos(i)-o[1]*Math.sin(i),y:r+o[0]*Math.sin(i)+o[1]*Math.cos(i)}}function N(t,e,n,r){let o=null;for(const i of t)if(i.id!==r&&"connector"!==i.type)for(const t of["n","e","s","w"]){const r=F(i,t),a=Math.hypot(r.x-e,r.y-n);a<=40&&(!o||a<o.d)&&(o={id:i.id,side:t,...r,d:a})}return o&&{id:o.id,side:o.side,x:o.x,y:o.y}}function P(t,e){const n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(Math.abs(e.x-t.x),E),i=Math.max(Math.abs(e.y-t.y),E);return{x:n-(o===E?12:0),y:r-(i===E?12:0),w:o,h:i}}function R(t,e,n){return{...t,start:e,end:n,...P(e,n),rotation:0}}function W(t,e){const n=new Map(t.elements.map(t=>[t.id,t]));let r=!1;const o=t.elements.map(t=>{if("connector"!==t.type)return t;const o=r=>{if(!r.attach)return r;const o=n.get(r.attach.id);return o&&"connector"!==o.type?e?.has(t.id)&&!e.has(o.id)?{x:r.x,y:r.y}:{...F(o,r.attach.side),attach:r.attach}:{x:r.x,y:r.y}},i=R(t,o(t.start),o(t.end));return JSON.stringify(i)!==JSON.stringify(t)&&(r=!0),i});return r?{...t,elements:o}:t}function O(t){const e=t.start.x-t.x,n=t.start.y-t.y,r=t.end.x-t.x,o=t.end.y-t.y;if("straight"===t.route)return`M${e},${n} L${r},${o}`;if("elbow"===t.route){if(t.start.attach?"e"===(i=t.start.attach.side)||"w"===i:Math.abs(r-e)>=Math.abs(o-n)){return`M${e},${n} H${(e+r)/2} V${o} H${r}`}return`M${e},${n} V${(n+o)/2} H${r} V${o}`}var i;const a=Math.max(Math.abs(r-e),Math.abs(o-n))/2,l=(t,i,l,s=1)=>{if(!l)return Math.abs(r-e)>=Math.abs(o-n)?[t+s*a,i]:[t,i+s*a];const c={n:[0,-a],e:[a,0],s:[0,a],w:[-a,0]}[l];return[t+c[0],i+c[1]]},[s,c]=l(e,n,t.start.attach?.side,1),[h,u]=l(r,o,t.end.attach?.side,-1);return`M${e},${n} C${s},${c} ${h},${u} ${r},${o}`}import{Fragment as D,useLayoutEffect as T,useRef as V}from"react";import{Fragment as X,jsx as B,jsxs as Z}from"react/jsx-runtime";function Y({shape:t}){const{w:n,h:r,arrowEnd:o,arrowStart:i}=t,a=t.stroke??(t.fill===e?"#2c2c2a":t.fill),l=t.strokeWidth??4,s=r/2,c=Math.min(Math.max(4*l,14),n/2),h=c/2;return Z(X,{children:[B("line",{x1:i?c:0,y1:s,x2:o?n-c:n,y2:s,stroke:a,strokeWidth:l}),i&&B("polygon",{points:`0,${s} ${c},${s-h} ${c},${s+h}`,fill:a}),o&&B("polygon",{points:`${n},${s} ${n-c},${s-h} ${n-c},${s+h}`,fill:a})]})}function J({shape:t}){const{w:e,h:n,fill:r,stroke:o,strokeWidth:i}=t,a={fill:r,stroke:o,strokeWidth:o?i??4:void 0};switch(t.shape){case"line":return null;case"rect":return B("rect",{width:e,height:n,...a});case"ellipse":return B("ellipse",{cx:e/2,cy:n/2,rx:e/2,ry:n/2,...a});case"diamond":return B("polygon",{points:`${e/2},0 ${e},${n/2} ${e/2},${n} 0,${n/2}`,...a});case"roundRect":return B("rect",{width:e,height:n,rx:Math.min(t.radius??Math.min(e,n)/6,e/2,n/2),...a});default:return B("path",{d:s(t.shape,e,n,t.radius),...a,strokeLinejoin:"round"})}}function q({shape:t}){const e=Math.max(t.w,1),n=Math.max(t.h,1);return B("svg",{width:e,height:n,viewBox:`0 0 ${e} ${n}`,"aria-hidden":"true",style:{display:"block",overflow:"visible"},children:"line"===t.shape?B(Y,{shape:t}):B(J,{shape:t})})}import{useLayoutEffect as U,useRef as _,useState as Q}from"react";import{jsx as G,jsxs as K}from"react/jsx-runtime";var tt=e=>`${e?`'${e}', `:""}${t}, ui-sans-serif, system-ui, sans-serif`,et=1.4;function nt(t,e,n=1){const r=[e.underline||e.link?"underline":"",e.strike?"line-through":""].filter(Boolean).join(" ");return{fontFamily:e.font||t.font?tt(e.font??t.font):void 0,fontSize:e.size?e.size*n:void 0,fontWeight:void 0===e.bold?void 0:e.bold?700:400,fontStyle:e.italic?"italic":void 0,textDecoration:r||void 0,color:e.color,background:e.highlight}}function rt(t,e){const n=e.level??0,r=e.list?1:0;return{margin:0,textAlign:e.align??t.align,lineHeight:e.lineHeight??1.25,paddingLeft:n*et+r*et+"em",position:"relative",minHeight:`${e.lineHeight??1.25}em`}}function ot(t,e=1){return{fontFamily:tt(t.font),fontSize:t.fontSize*e,fontWeight:t.bold?700:400,color:t.color,whiteSpace:"pre-wrap",overflowWrap:"break-word"}}var it={position:"absolute",left:0,width:"1.4em",textAlign:"left"};function at({marker:t,level:e}){return t?G("span",{"aria-hidden":"true",contentEditable:!1,style:{...it,left:e*et+"em"},children:t}):null}function lt({el:t,run:e,scale:n,onLink:r}){const o=nt(t,e,n);return e.link&&r?G("a",{href:e.link,style:{...o,color:o.color??"inherit",cursor:"pointer"},onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e.link)},children:e.text}):G("span",{style:o,children:e.text})}function st({element:t,onLink:e}){const n=u(t),r=k(n),o=_(null),[i,a]=Q(1),l=t.autofit,s=JSON.stringify([n,t.fontSize,t.w,t.h,t.font]);U(()=>{if(!l)return void a(1);const e=o.current;if(!e)return;let n=.2,r=1;if(e.style.fontSize=`${t.fontSize}px`,e.scrollHeight<=t.h+1)a(1);else{for(let o=0;o<8;o+=1){const o=(n+r)/2;e.style.fontSize=t.fontSize*o+"px",e.scrollHeight<=t.h+1?n=o:r=o}e.style.fontSize="",a(n)}},[l,s]);const c={top:"flex-start",middle:"center",bottom:"flex-end"}[t.anchor??"top"];return G("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:c,overflow:l?"hidden":void 0},children:G("div",{ref:o,style:ot(t,i),children:n.map((n,o)=>K("div",{"data-slide-paragraph":"",style:rt(t,n),children:[G(at,{marker:r[o],level:n.level??0}),n.runs.map((n,r)=>G(lt,{el:t,run:n,scale:i,onLink:e},r)),n.runs.every(t=>!t.text)&&"​"]},o))})})}function ct(t,e){const n=k(e),r=t=>Object.entries(t).filter(([,t])=>void 0!==t&&""!==t).map(([t,e])=>`${t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}:${"number"!=typeof e||/weight|height/i.test(t)?e:`${e}px`}`).join(";"),o=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return e.map((e,i)=>{const{runs:a,...l}=e,s=e.level??0,c=n[i]?`<span contenteditable="false" aria-hidden="true" style="${r({...it,left:s*et+"em"})}">${o(n[i])}</span>`:"",h=a.map(e=>`<span ${S}="${o(JSON.stringify(g(e)))}" style="${r(nt(t,e))}">${o(e.text)||"​"}</span>`).join("");return`<div ${C}="${o(JSON.stringify(l))}" style="${r(rt(t,e))}">${c}${h}</div>`}).join("")}function ht(t){return t.series&&t.series.length>0&&t.categories?{categories:t.categories,series:t.series}:{categories:t.points.map(t=>t.label),series:[{name:"",color:t.color,values:t.points.map(t=>t.value)}]}}function ut(t){const{categories:e,series:n}=ht(t);return[["",...n.map(t=>t.name)],...e.map((t,e)=>[t,...n.map(t=>String(t.values[e]??""))])]}function dt(t,e,n){const r=ht(t).series,o=Math.max(1,...e.map(t=>t.length)),i=(e[0]??[]).slice(1),a=e.slice(1),l=Array.from({length:o-1},(t,e)=>({name:i[e]?.trim()??"",color:r[e]?.color??n[e%n.length],values:a.map(t=>{const n=Number((t[e+1]??"").trim());return Number.isFinite(n)?n:0})}));return function(t,e,n){const r=n[0]??{name:"",color:t.color,values:[]};return{...t,categories:e,series:n.map(t=>({...t,values:e.map((e,n)=>t.values[n]??0)})),color:r.color,points:e.map((t,e)=>({label:t,value:r.values[e]??0}))}}(t,a.map(t=>(t[0]??"").trim()),l)}var ft=.5;function pt(t,e="fadeIn"){return{id:o(),elementId:t,effect:e,start:"click",duration:.5,..."flyIn"===e?{from:"bottom"}:{}}}function gt(t){const e=(t.animations??[]).filter(e=>t.elements.some(t=>t.id===e.elementId)),n=[[]];let r=0,o=0;for(const t of e){if("click"===t.start){n.push([{animation:t,delay:0}]),o=0,r=t.duration;continue}const e=n[n.length-1],i="withPrevious"===t.start?o:r;e.push({animation:t,delay:i}),o=i,r=Math.max(r,i+t.duration)}return n}var mt=t=>gt(t).length-1,$t=new Set(["appear","fadeIn","flyIn","zoomIn"]),yt=t=>$t.has(t);function wt(t,e){const n=gt(t),r=new Set;return n.forEach((t,n)=>{for(const{animation:o}of t)yt(o.effect)&&n>e&&r.add(o.elementId),!yt(o.effect)&&n<e&&r.add(o.elementId)}),{hidden:r,playing:n[Math.min(e,n.length-1)]??[]}}function xt(t){switch(t.effect){case"appear":return[{opacity:0},{opacity:0,offset:.99},{opacity:1}];case"fadeIn":return[{opacity:0},{opacity:1}];case"zoomIn":return[{opacity:0,transform:"scale(0.3)"},{opacity:1,transform:"scale(1)"}];case"fadeOut":return[{opacity:1},{opacity:0}];case"flyIn":return[{opacity:0,transform:{left:"translateX(-1200px)",right:"translateX(1200px)",top:"translateY(-900px)",bottom:"translateY(900px)"}[t.from??"bottom"]},{opacity:1,transform:"translate(0, 0)"}]}}function vt(t){switch(t.kind){case"fade":return{incoming:[{opacity:0},{opacity:1}],outgoing:[{opacity:1},{opacity:1}]};case"slide":return{incoming:[{transform:"translateX(100%)"},{transform:"translateX(0)"}],outgoing:[{opacity:1},{opacity:1}]};case"push":return{incoming:[{transform:"translateX(100%)"},{transform:"translateX(0)"}],outgoing:[{transform:"translateX(0)"},{transform:"translateX(-100%)"}]};case"zoom":return{incoming:[{opacity:0,transform:"scale(0.6)"},{opacity:1,transform:"scale(1)"}],outgoing:[{opacity:1},{opacity:0}]};case"flip":return{incoming:[{transform:"perspective(2000px) rotateY(-90deg)",offset:0},{transform:"perspective(2000px) rotateY(-90deg)",offset:.5},{transform:"perspective(2000px) rotateY(0deg)"}],outgoing:[{transform:"perspective(2000px) rotateY(0deg)"},{transform:"perspective(2000px) rotateY(90deg)",offset:.5},{transform:"perspective(2000px) rotateY(90deg)"}]}}}function bt(t){const e=t.map((t,e)=>t.skip?-1:e).filter(t=>-1!==t);return e.length>0?e:t.map((t,e)=>e)}function Mt(t,e,n){const r=[...t],[o]=r.splice(e,1);return r.splice(Math.max(0,Math.min(n,r.length)),0,o),r}var kt=(t,e,n)=>t&&[...t.slice(0,e),n,...t.slice(e)],St=(t,e)=>t&&t.filter((t,n)=>n!==e);function Ct(t,e,n,r){if(!t)return t;const o="row"===e?"rows":"cols";return t.flatMap(t=>{const i=t[e],a=i+t[o];return 1===r?n<=i?[{...t,[e]:i+1}]:n<a?[{...t,[o]:t[o]+1}]:[t]:n<i?[{...t,[e]:i-1}]:n<a?t[o]>2?[{...t,[o]:t[o]-1}]:[]:[t]})}function At(t,e){const n=t.rows[0]?.length??1,r=t.rowHeights&&kt(t.rowHeights,e,t.rowHeights[Math.max(0,e-1)]??80);return{...t,rows:kt(t.rows,e,Array(n).fill("")),rowHeights:r,cellFills:kt(t.cellFills,e,Array(n).fill(null)),cellColors:kt(t.cellColors,e,Array(n).fill(null)),merges:Ct(t.merges,"row",e,1)}}function It(t,e){return t.rows.length<=1?t:{...t,rows:St(t.rows,e),rowHeights:St(t.rowHeights,e),cellFills:St(t.cellFills,e),cellColors:St(t.cellColors,e),merges:Ct(t.merges,"row",e,-1)}}function Ht(t,e){const n=(t.rows[0]?.length??0)+1;return{...t,rows:t.rows.map(t=>kt(t,e,"")),columnWidths:t.columnWidths&&(r=n,Array(r).fill(1/r)),cellFills:t.cellFills?.map(t=>kt(t,e,null)),cellColors:t.cellColors?.map(t=>kt(t,e,null)),merges:Ct(t.merges,"col",e,1)};var r}function jt(t,e){if((t.rows[0]?.length??0)<=1)return t;const n=t.columnWidths&&St(t.columnWidths,e),r=n?.reduce((t,e)=>t+e,0)||1;return{...t,rows:t.rows.map(t=>St(t,e)),columnWidths:n?.map(t=>t/r),cellFills:t.cellFills?.map(t=>St(t,e)),cellColors:t.cellColors?.map(t=>St(t,e)),merges:Ct(t.merges,"col",e,-1)}}var zt=(t,e,n)=>t.merges?.find(t=>e>=t.row&&e<t.row+t.rows&&n>=t.col&&n<t.col+t.cols);function Lt(t,e){if(e.rows*e.cols<2)return t;let{row:n,col:r,rows:o,cols:i}=e;const a=(t.merges??[]).filter(t=>t.row<n+o&&n<t.row+t.rows&&t.col<r+i&&r<t.col+t.cols);for(const t of a){const e=Math.max(n+o,t.row+t.rows),a=Math.max(r+i,t.col+t.cols);n=Math.min(n,t.row),r=Math.min(r,t.col),o=e-n,i=a-r}const l=[],s=t.rows.map((t,e)=>t.map((t,a)=>e>=n&&e<n+o&&a>=r&&a<r+i?(t.trim()&&l.push(t.trim()),""):t));s[n][r]=l.join(" ");const c=(t.merges??[]).filter(t=>!a.includes(t));return{...t,rows:s,merges:[...c,{row:n,col:r,rows:o,cols:i}]}}function Et(t,e,n){const r=zt(t,e,n);if(!r)return t;const o=t.merges.filter(t=>t!==r);return{...t,merges:o.length>0?o:void 0}}function Ft(t,e,n,r){return{...t,rows:t.rows.map((t,o)=>o===e?t.map((t,e)=>e===n?r:t):t)}}import{jsx as Nt,jsxs as Pt}from"react/jsx-runtime";var Rt=tt();function Wt(t){return{position:"absolute",left:t.x,top:t.y,width:t.w,height:t.h,transform:t.rotation?`rotate(${t.rotation}deg)`:void 0}}var Ot="#444441";function Dt(t){const e=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i.exec(t);if(!e)return Ot;const[n,r,o]=[e[1],e[2],e[3]].map(t=>parseInt(t,16)/255).map(t=>t<=.03928?t/12.92:((t+.055)/1.055)**2.4);return.2126*n+.7152*r+.0722*o<.25?"#f1efe8":Ot}function Tt({names:t,colors:e,side:n,ink:r}){return Nt("div",{style:{display:"flex",flexDirection:"right"===n?"column":"row",gap:24,justifyContent:"center",fontFamily:Rt,fontSize:28,color:r,padding:8},children:t.map((t,n)=>Pt("span",{style:{display:"inline-flex",alignItems:"center",gap:10,whiteSpace:"nowrap"},children:[Nt("span",{style:{width:22,height:22,background:e[n],display:"inline-block"}}),t]},n))})}function Vt({chart:t,w:e,h:n,ink:r}){const{categories:o,series:i}=ht(t),{kind:a}=t;if("pie"===a||"donut"===a){const r=i[0]?.values??[],l=r.reduce((t,e)=>t+Math.max(e,0),0)||1,s=Math.min(e,n)/2-8,c=e/2,h=n/2;let u=-Math.PI/2;const d=Bt(t,o.length);return Pt("svg",{width:e,height:n,viewBox:`0 0 ${e} ${n}`,role:"img","aria-label":"Chart",style:{display:"block"},children:[r.map((t,e)=>{const n=Math.max(t,0)/l*Math.PI*2,r=u;if(u+=n,n>=2*Math.PI-1e-6)return Nt("circle",{cx:c,cy:h,r:s,fill:d[e]},e);const o=n>Math.PI?1:0,i=t=>`${c+s*Math.cos(t)},${h+s*Math.sin(t)}`;return Nt("path",{d:`M${c},${h} L${i(r)} A${s},${s} 0 ${o} 1 ${i(u)} Z`,fill:d[e],stroke:"#ffffff",strokeWidth:4},e)}),"donut"===a&&Nt("circle",{cx:c,cy:h,r:.55*s,fill:"#ffffff"})]})}const l=(t=>Math.max(1,...t.flatMap(t=>t.values)))(i),s=Math.max(o.length,1);if("hbar"===a){const t=Math.min(240,.25*e),a=n/s,c=.7*a/Math.max(i.length,1),h=n=>Math.max(n,0)/l*(e-t-90);return Nt("svg",{width:e,height:n,viewBox:`0 0 ${e} ${n}`,role:"img","aria-label":"Chart",style:{display:"block"},children:o.map((e,n)=>Pt("g",{fontFamily:Rt,fontSize:30,fill:r,children:[Nt("text",{x:t-12,y:a*n+a/2+10,textAnchor:"end",children:e}),i.map((e,r)=>Pt(D,{children:[Nt("rect",{x:t,y:a*n+.15*a+c*r,width:h(e.values[n]??0),height:c,fill:e.color}),1===i.length&&Nt("text",{x:t+h(e.values[n]??0)+12,y:a*n+a/2+10,children:e.values[n]})]},r))]},n))})}const c=n-56,h=e/s,u=t=>c-Math.max(t,0)/l*(c-40),d=t=>h*t+h/2;return Pt("svg",{width:e,height:n,viewBox:`0 0 ${e} ${n}`,role:"img","aria-label":"Chart",style:{display:"block"},children:[i.map((t,e)=>{if("line"===a||"area"===a){const n=t.values.map((t,e)=>`${d(e)},${u(t)}`).join(" ");return Pt("g",{children:["area"===a&&Nt("polygon",{points:`${d(0)},${c} ${n} ${d(t.values.length-1)},${c}`,fill:t.color,fillOpacity:.35}),Nt("polyline",{fill:"none",stroke:t.color,strokeWidth:8,points:n})]},e)}const n=.7*h/i.length;return t.values.map((r,o)=>Nt("rect",{x:h*o+.15*h+n*e,y:u(r),width:n,height:c-u(r),fill:t.color},`${e}-${o}`))}),o.map((t,e)=>Pt("g",{fontFamily:Rt,fontSize:30,fill:r,textAnchor:"middle",children:[Nt("text",{x:d(e),y:n-14,children:t}),1===i.length&&Nt("text",{x:d(e),y:u(i[0].values[e]??0)-12,children:i[0].values[e]})]},e))]})}var Xt=["#534ab7","#1d9e75","#d85a30","#ef9f27","#378add","#d4537e","#5f5e5a","#97c459"];function Bt(t,e){const n=ht(t).series[0]?.color??t.color,r=Xt.filter(t=>t.toLowerCase()!==n.toLowerCase());return Array.from({length:e},(t,e)=>0===e?n:r[(e-1)%r.length])}function Zt({chart:t,ink:e=Ot}){const{categories:n,series:r}=ht(t),o="pie"===t.kind||"donut"===t.kind,i=t.legend??(o||r.length>1?"bottom":"none"),a=o?n:r.map(t=>t.name),l=o?Bt(t,n.length):r.map(t=>t.color);if("none"===i)return Nt(Vt,{chart:t,w:t.w,h:t.h,ink:e});const s="right"===i,c=s?Math.min(360,.3*t.w):t.w,h=s?t.h:64;return Pt("div",{style:{display:"flex",flexDirection:s?"row":"column",width:t.w,height:t.h},children:[Nt(Vt,{chart:t,w:s?t.w-c:t.w,h:s?t.h:t.h-h,ink:e}),Nt("div",{style:{width:s?c:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:Nt(Tt,{names:a,colors:l,side:i,ink:e})})]})}var Yt="#2c2c2a";function Jt({table:t,cellEditor:e,ink:n}){const r=t.fontSize??32,o=t.borderWidth??2,i=t.borderColor??"#b4b2a9",a=t.rows[0]?.length??0,{columnWidths:l,rowHeights:s}=t,c=s?.slice(0,t.rows.length).reduce((t,e)=>t+e,0)??0,h=e=>s?.[e]&&c?s[e]*(t.h-o)/c:void 0;return Pt("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse",fontFamily:Rt,fontSize:r,lineHeight:t.fontSize?1.2:void 0,color:n&&n!==Ot?n:Yt,tableLayout:"fixed"},children:[l?.length===a&&Nt("colgroup",{children:l.map((t,e)=>Nt("col",{style:{width:100*t+"%"}},e))}),Nt("tbody",{children:t.rows.map((a,l)=>Nt("tr",{style:{height:h(l),background:0===l?t.headerFill:void 0,color:0===l?t.headerColor??(n&&n!==Ot?Yt:void 0):void 0,fontWeight:0===l?500:400},children:a.map((n,a)=>{const s=zt(t,l,a);return!s||s.row===l&&s.col===a?Nt("td",{"data-cell":`${l}:${a}`,rowSpan:s?.rows,colSpan:s?.cols,style:{border:o?`${o}px solid ${i}`:"none",padding:`${.25*r}px ${.5*r}px`,overflow:"hidden",background:t.cellFills?.[l]?.[a]??void 0,color:t.cellColors?.[l]?.[a]??void 0,verticalAlign:"top"},children:e?.(l,a)??n},a):null})},l))})]})}function qt({image:t}){if(!t.src)return Nt("div",{style:{width:"100%",height:"100%",background:"#f1efe8",border:"4px dashed #b4b2a9",boxSizing:"border-box"}});const e=t.crop??{left:0,top:0,right:0,bottom:0},n=Math.max(.05,1-e.left-e.right),r=Math.max(.05,1-e.top-e.bottom),o=e.left||e.top||e.right||e.bottom,i=Nt("img",{src:t.src,alt:t.alt,draggable:!1,style:o?{position:"absolute",width:100/n+"%",height:100/r+"%",left:-e.left/n*100+"%",top:-e.top/r*100+"%",objectFit:"fill",display:"block"}:{width:"100%",height:"100%",objectFit:"contain",display:"block"}});return Nt("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",opacity:t.opacity??1},children:i})}function Ut(t){if(!t)return null;const e=t.match(/(?:youtube\.com\/(?:watch\?(?:.*&)?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{6,})/);if(e)return{kind:"youtube",id:e[1]};const n=t.match(/vimeo\.com\/(?:video\/)?(\d+)/);return n?{kind:"vimeo",id:n[1]}:{kind:"file"}}function _t({video:t,live:e}){const n=Ut(t.src),r={width:"100%",height:"100%",border:0,display:"block",background:"#000"};if(e&&"youtube"===n?.kind)return Nt("iframe",{title:t.alt||"Video",src:`https://www.youtube-nocookie.com/embed/${n.id}`,style:r,allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0});if(e&&"vimeo"===n?.kind)return Nt("iframe",{title:t.alt||"Video",src:`https://player.vimeo.com/video/${n.id}`,style:r,allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0});if(e&&"file"===n?.kind)return Nt("video",{src:t.src,controls:!0,style:r,"aria-label":t.alt||"Video"});const o="youtube"===n?.kind?`https://img.youtube.com/vi/${n.id}/hqdefault.jpg`:null;return Pt("div",{style:{position:"relative",width:"100%",height:"100%",background:"#2c2c2a",overflow:"hidden"},children:[o&&Nt("img",{src:o,alt:t.alt,draggable:!1,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}),Pt("svg",{viewBox:"0 0 100 100","aria-hidden":"true",style:{position:"absolute",left:"50%",top:"50%",width:140,height:140,marginLeft:-70,marginTop:-70},children:[Nt("circle",{cx:"50",cy:"50",r:"48",fill:"rgba(0,0,0,0.55)"}),Nt("polygon",{points:"40,30 72,50 40,70",fill:"#ffffff"})]})]})}function Qt({connector:t}){const{w:e,h:n,stroke:r,strokeWidth:o}=t,i=Math.max(4*o,14),a=e=>{const n="end"===e?t.end:t.start,o=function(t,e){const n="end"===e?t.end:t.start,r=n.attach?.side;if("straight"!==t.route&&r)return{n:Math.PI/2,e:Math.PI,s:-Math.PI/2,w:0}[r];const o="end"===e?t.start:t.end;if("elbow"===t.route){return(t.start.attach?"e"===t.start.attach.side||"w"===t.start.attach.side:Math.abs(t.end.x-t.start.x)>=Math.abs(t.end.y-t.start.y))?n.x>=o.x?0:Math.PI:n.y>=o.y?Math.PI/2:-Math.PI/2}return Math.atan2(n.y-o.y,n.x-o.x)}(t,e)+("start"===e?Math.PI:0),a=n.x-t.x,l=n.y-t.y,s=t=>`${a-i*Math.cos(o)+t*(i/2)*Math.sin(o)},${l-i*Math.sin(o)-t*(i/2)*Math.cos(o)}`;return Nt("polygon",{points:`${a},${l} ${s(1)} ${s(-1)}`,fill:r})};return Pt("svg",{width:Math.max(e,1),height:Math.max(n,1),viewBox:`0 0 ${Math.max(e,1)} ${Math.max(n,1)}`,"aria-hidden":"true",style:{display:"block",overflow:"visible"},children:[Nt("path",{d:O(t),fill:"none",stroke:r,strokeWidth:o,strokeLinejoin:"round"}),t.arrowStart&&a("start"),t.arrowEnd&&a("end")]})}function Gt({element:t,options:e={}}){switch(t.type){case"text":return Nt(st,{element:t,onLink:e.onLink});case"shape":return Nt(q,{shape:t});case"image":return Nt(qt,{image:t});case"video":return Nt(_t,{video:t,live:e.live});case"connector":return Nt(Qt,{connector:t});case"chart":return Nt(Zt,{chart:t,ink:e.ink});case"table":return Nt(Jt,{table:t,cellEditor:e.cellEditor,ink:e.ink})}}function Kt({slide:e,width:o,editingId:i,editor:a,number:l,motion:s,options:c}){const h=o/r,u=V(null);return function(t,e){T(()=>{const n=t.current;if(!n||!e)return;const r=[];for(const{animation:t,delay:o}of e.playing){const e=n.querySelector(`[data-element="${CSS.escape(t.elementId)}"]`);if(!e)continue;const i=xt(t),a={duration:1e3*t.duration,delay:1e3*o,fill:"both",easing:"ease-out"},l=t.byParagraph?[...e.querySelectorAll("[data-slide-paragraph]")]:[];l.length>1?(l.forEach((e,n)=>r.push(e.animate(i,{...a,delay:1e3*(o+n*t.duration)}))),e.style.visibility="visible"):r.push(e.animate(i,a))}return()=>r.forEach(t=>t.cancel())},[t,e])}(u,s),Nt("div",{style:{width:o,height:n*h,overflow:"hidden",position:"relative",background:e.background},children:Pt("div",{ref:u,style:{width:r,height:n,transform:`scale(${h})`,transformOrigin:"0 0",position:"absolute",left:0,top:0},children:[e.elements.map(t=>Nt("div",{"data-element":t.id,style:{...Wt(t),visibility:s?.hidden.has(t.id)?"hidden":void 0},children:t.id===i?a:Nt(Gt,{element:t,options:{...c,ink:Dt(e.background)}})},t.id)),void 0!==l&&Nt("div",{style:{position:"absolute",right:60,bottom:36,fontFamily:`${t}, sans-serif`,fontSize:28,color:Dt(e.background)===Ot?"#888780":"#b4b2a9"},children:l})]})})}export{s as shapePath,c as PPTX_SHAPES,u as paragraphsOf,d as plainText,f as withParagraphs,y as applyStyle,w as styleAt,x as paragraphsIn,v as setParagraphs,b as toggleList,M as indent,k as listMarkers,j as readParagraphs,z as selectionOffsets,L as restoreSelection,ot as boxStyle,ct as editorHtml,ht as seriesOf,ut as chartToGrid,dt as gridToChart,N as nearestSide,R as withEnds,W as relayConnectors,O as connectorPath,ft as DEFAULT_TRANSITION_SECONDS,pt as newAnimation,mt as clicksOf,wt as stateAt,vt as transitionKeyframes,bt as shownSlides,Mt as moveAnimation,At as insertRow,It as removeRow,Ht as insertColumn,jt as removeColumn,zt as mergeAt,Lt as mergeCells,Et as unmergeCell,Ft as setCell,Rt as SLIDE_FONT,Ut as videoSource,Kt as SlideView};
@@ -1 +0,0 @@
1
- import{ENGLISH_WORDS as t}from"./chunk-PXOQN7D6.js";import{createContext as e,useContext as r}from"react";import{jsx as o}from"react/jsx-runtime";var n=class extends Error{},a="efficient-office:slides",c=()=>{try{return JSON.parse(localStorage.getItem(a)??"{}")}catch{return{}}},s=t=>localStorage.setItem(a,JSON.stringify(t)),i={list:async()=>Object.values(c()).map(({id:t,title:e,updatedAt:r})=>({id:t,title:e,updatedAt:r})).sort((t,e)=>e.updatedAt.localeCompare(t.updatedAt)),get:async t=>{const e=c()[t];if(!e)throw new Error("No such deck");return e},create:async t=>{const e=(new Date).toISOString(),r={id:crypto.randomUUID(),title:t,document:{},version:crypto.randomUUID(),updatedAt:e};return s({...c(),[r.id]:r}),r},rename:async(t,e)=>{const r=c();r[t]&&s({...r,[t]:{...r[t],title:e,updatedAt:(new Date).toISOString()}})},save:async(t,e,r)=>{const o=c();if(!o[t]||o[t].version!==r)throw new n;const a=crypto.randomUUID();return s({...o,[t]:{...o[t],document:e,version:a,updatedAt:(new Date).toISOString()}}),a},remove:async t=>{const{[t]:e,...r}=c();s(r)}},d=e({store:i});function u({value:t,children:e}){return o(d.Provider,{value:t,children:e})}var l=()=>r(d),m=()=>r(d).words??t;export{n as SlidesConflict,i as browserSlidesStore,u as SlidesProvider,l as useSlidesHost,m as useSlidesWords};
@@ -1 +0,0 @@
1
- var t=t=>t>=192&&t<=207&&196!==t&&200!==t&&204!==t;var e={1:"/DeviceGray",3:"/DeviceRGB",4:"/DeviceCMYK"},n=t=>String(Math.round(100*t)/100),o=class{chunks=[];offsets=[];length=0;write(t){this.chunks.push(t),this.length+=t.length}object(t,e){this.offsets[t]=this.length,this.write(`${t} 0 obj\n${e}\nendobj\n`)}stream(t,e,n){this.offsets[t]=this.length,this.write(`${t} 0 obj\n<<${e}/Length ${n.length}>>\nstream\n`),this.write(n),this.write("\nendstream\nendobj\n")}finish(t){const e=this.length,n=this.offsets.slice(1).map(t=>`${String(t).padStart(10,"0")} 00000 n \n`);return this.write(`xref\n0 ${this.offsets.length}\n0000000000 65535 f \n${n.join("")}`),this.write(`trailer\n<</Size ${this.offsets.length}/Root ${t} 0 R>>\nstartxref\n${e}\n%%EOF\n`),new Blob(this.chunks,{type:"application/pdf"})}};function i(o,i,r){const s=3+3*r,{width:a,height:h,components:c}=function(e){if(255!==e[0]||216!==e[1])throw new Error("Not a JPEG");let n=2;for(;n+9<e.length;){if(255!==e[n])throw new Error("Damaged JPEG");const o=e[n+1];if(255!==o){if(t(o))return{height:e[n+5]<<8|e[n+6],width:e[n+7]<<8|e[n+8],components:e[n+9]};n+=2+(e[n+2]<<8|e[n+3])}else n+=1}throw new Error("Damaged JPEG")}(i.jpeg),f=e[c];if(!f)throw new Error("Unsupported JPEG colours");const l=n(i.width),g=n(i.height);o.object(s,`<</Type/Page/Parent 2 0 R/MediaBox[0 0 ${l} ${g}]/Contents ${s+1} 0 R/Resources<</XObject<</Im0 ${s+2} 0 R>>>>>>`),o.stream(s+1,"",`q ${l} 0 0 ${g} 0 0 cm /Im0 Do Q`),o.stream(s+2,`/Type/XObject/Subtype/Image/Width ${a}/Height ${h}/ColorSpace${f}/BitsPerComponent 8/Filter/DCTDecode`,i.jpeg)}function r(t){if(!t.length)throw new Error("A PDF needs a page");const e=new o;e.write("%PDF-1.4\n"),e.write(Uint8Array.of(37,226,227,207,211,10)),e.object(1,"<</Type/Catalog/Pages 2 0 R>>");const n=t.map((t,e)=>3+3*e+" 0 R").join(" ");return e.object(2,`<</Type/Pages/Kids[${n}]/Count ${t.length}>>`),t.forEach((t,n)=>i(e,t,n)),e.finish(1)}function s(){const t=document.createElement("div");return t.setAttribute("aria-hidden","true"),t.style.cssText="position:fixed;left:-100000px;top:0;pointer-events:none;",document.body.append(t),{root:t,close:()=>t.remove()}}async function a(t){const{getFontEmbedCSS:e}=await(import("html-to-image"));return e(t,{includeQueryParams:!0})}async function h(t){t.getBoundingClientRect(),await document.fonts.ready,await Promise.all(Array.from(t.querySelectorAll("img"),t=>t.decode()))}async function c(t,{width:e,height:n,pixelRatio:o,quality:i,fontCss:r,background:s}){const{toJpeg:a}=await(import("html-to-image"));return function(t){const e=atob(t.slice(t.indexOf(",")+1)),n=new Uint8Array(e.length);for(let t=0;t<e.length;t+=1)n[t]=e.charCodeAt(t);return n}(await a(t,{width:e,height:n,pixelRatio:o,quality:i??.8,backgroundColor:s??"#ffffff",fontEmbedCSS:r,includeQueryParams:!0}))}export{r as jpegPdf,s as openStage,a as embeddedFonts,h as settled,c as drawJpeg};
@@ -1 +0,0 @@
1
- import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var o={rect:"Rectangle",roundRect:"Rounded rectangle",ellipse:"Ellipse",triangle:"Triangle",rightTriangle:"Right triangle",diamond:"Diamond",pentagon:"Pentagon",hexagon:"Hexagon",octagon:"Octagon",star:"Star",heart:"Heart",cloud:"Cloud",bolt:"Lightning bolt",parallelogram:"Parallelogram",trapezoid:"Trapezoid",cylinder:"Cylinder",plus:"Plus",arrowRight:"Right arrow",arrowLeft:"Left arrow",arrowUp:"Up arrow",arrowDown:"Down arrow",arrowLeftRight:"Left-right arrow",chevron:"Chevron",callout:"Callout",calloutRound:"Rounded callout",line:"Line"},n={rect:"矩形",roundRect:"圆角矩形",ellipse:"椭圆",triangle:"三角形",rightTriangle:"直角三角形",diamond:"菱形",pentagon:"五边形",hexagon:"六边形",octagon:"八边形",star:"星形",heart:"心形",cloud:"云形",bolt:"闪电形",parallelogram:"平行四边形",trapezoid:"梯形",cylinder:"圆柱形",plus:"加号",arrowRight:"右箭头",arrowLeft:"左箭头",arrowUp:"上箭头",arrowDown:"下箭头",arrowLeftRight:"左右箭头",chevron:"燕尾形",callout:"标注",calloutRound:"圆角标注",line:"线条"},i={blank:"Blank",simple:"Simple",midnight:"Midnight",editorial:"Editorial",dealerPitch:"Dealer pitch",monthlyReport:"Monthly report"},r={blank:"空白",simple:"简约",midnight:"午夜",editorial:"杂志",dealerPitch:"经销商推介",monthlyReport:"月度报告"},a={decks:"Decks",newDeck:"New deck",untitledDeck:"Untitled deck",emptyTitle:"Make your first deck",emptyBody:"Build slides here, then present them or export to PowerPoint.",openFailed:"Couldn't open this deck",createFailed:"Could not create a deck.",deleteFailed:"Could not delete this deck.",backToDecks:"Back to decks",deleteConfirm:e=>`Delete "${e}"? This can't be undone.`,delete:"Delete",deckName:"Deck name",slidesPanel:"Slides",slideNumber:e=>`Slide ${e}`,slideOf:(e,t)=>`Slide ${e} of ${t}`,addSlide:"Add slide",duplicateSlide:"Duplicate slide",deleteSlide:"Delete slide",slideText:"Slide text",undo:"Undo",redo:"Redo",export:"Export",exportFailed:"Could not export this deck.",present:"Present",endShow:"End show",popupBlocked:"Your browser blocked the audience window. Allow pop-ups for this site, then end the show and present again.",back:"Back",next:"Next",nextSlide:"Next slide",endOfDeck:"End of the deck.",notes:"Notes",noNotes:"No notes for this slide.",speakerNotes:"Speaker notes",saveFailed:"Could not save this deck. Trying again.",renameFailed:"Could not rename this deck.",conflict:"Somebody else changed this deck. Your latest edits aren't saved. Reload to see their version.",reload:"Reload",addText:"Add text",addShape:"Add shape",addImage:"Add image",addChart:"Add chart",addTable:"Add table",elementText:"Text",elementShape:"Shape",elementImage:"Image",elementChart:"Chart",elementTable:"Table",slide:"Slide",objects:e=>`${e} objects`,background:"Background",positionAndSize:"Position and size",width:"W",height:"H",angle:"Angle",align:"Align",alignLeft:"Align left",alignCentre:"Align centre",alignRight:"Align right",bringForward:"Bring forward",size:"Size",weight:"Weight",regular:"Regular",bold:"Bold",textAlignment:"Text alignment",left:"Left",centre:"Centre",right:"Right",colour:"Colour",rectangle:"Rectangle",ellipse:"Ellipse",roundedRectangle:"Rounded rectangle",diamond:"Diamond",lineShape:"Line",outlineColour:"Outline colour",imageAddress:"Image address",chooseImage:"Choose image",imageTitle:"Slide image",description:"Description",data:"Data",chartType:"Chart type",bar:"Bar",line:"Line",values:"Values",valuesHint:"One label and number a line, like Sept, 42.",rows:"Rows",rowsHint:"One row a line, with commas between cells.",headingColour:"Heading colour",pptxPasswordProtected:"This file has a password. Remove it in PowerPoint, then import the file again.",pptxUnreadable:"This file can't be read as a PowerPoint (.pptx) file.",pptxLegacyFormat:"This is an older Office file. Save it as .pptx in PowerPoint, then import it again.",pptxTooManySlides:(e,t)=>`This deck has ${e} slides, and a deck can have at most ${t}.`,pptxTooLarge:(e,t)=>`This deck comes to ${e} MiB without its pictures, and a deck can be at most ${t} MiB. Split it into smaller decks.`,pdfSlideFailed:e=>`Slide ${e} couldn't be drawn for the PDF.`,files:e,fileKind:"PowerPoint",importNotes:({skipped:e,animations:t,fonts:o})=>{const n=[e&&(1===e?"a chart, video or custom shape was":`${e} charts, videos or custom shapes were`)+" left out",t&&`animations on ${1===t?"1 slide were":`${t} slides were`} dropped`,o.length&&`${o.join(", ")} ${1===o.length?"is":"are"} shown in the deck's font`].filter(Boolean);return n.length?`Some things didn't come across: ${n.join("; ")}.`:null},dismiss:"Dismiss",newSlide:"New slide",layouts:"Layouts",layoutTitle:"Title",layoutTitleBody:"Title and body",layoutSection:"Section",layoutTwoColumns:"Two columns",layoutTitleOnly:"Title only",layoutBlank:"Blank",placeholderTitle:"Click to add a title",placeholderSubtitle:"Click to add a subtitle",placeholderBody:"Click to add text",addVideo:"Add video",addLine:"Add line or connector",elementVideo:"Video",elementConnector:"Connector",lineStraight:"Line",lineArrow:"Arrow",lineDoubleArrow:"Double arrow",connectorElbow:"Elbow connector",connectorCurved:"Curved connector",arrange:"Arrange",theme:"Theme",motion:"Motion",comments:"Comments",versionHistory:"Version history",font:"Font",fontSize:"Font size",smaller:"Smaller",larger:"Larger",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",textColour:"Text colour",highlight:"Highlight",link:"Link",linkPrompt:"Link to a web address, an email address, or a slide number",removeLink:"Remove link",badLink:"That link isn’t a web address, an email address or a slide number.",alignJustify:"Justify",bulletList:"Bulleted list",numberedList:"Numbered list",indentLess:"Decrease indent",indentMore:"Increase indent",lineSpacing:"Line spacing",verticalAlign:"Vertical alignment",top:"Top",middle:"Middle",bottom:"Bottom",shrinkToFit:"Shrink text to fit",cut:"Cut",copy:"Copy",paste:"Paste",duplicate:"Duplicate",copyStyle:"Copy style",pasteStyle:"Paste style",order:"Order",bringToFront:"Bring to front",sendBackward:"Send backward",sendToBack:"Send to back",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",distributeAcross:"Distribute horizontally",distributeDown:"Distribute vertically",distribute:"Distribute",group:"Group",ungroup:"Ungroup",lock:"Lock",unlock:"Unlock",locked:"Locked",comment:"Comment",grid:"Grid",crop:"Crop",cropLeft:"Left",cropTop:"Top",cropRight:"Right",cropBottom:"Bottom",opacity:"Opacity",replaceImage:"Replace image",videoAddress:"Video address",videoHint:"A YouTube or Vimeo link, or a video file.",chooseVideo:"Choose from Media Library",videoUnsupported:"This video can’t be played here. Open it from its link.",route:"Route",routeStraight:"Straight",routeElbow:"Elbow",routeCurved:"Curved",arrowStart:"Arrow at start",arrowEnd:"Arrow at end",lineWidth:"Line width",fill:"Fill",noFill:"No fill",outline:"Outline",chartBar:"Column",chartHbar:"Bar",chartArea:"Area",chartPie:"Pie",chartDonut:"Donut",legend:"Legend",legendBottom:"Bottom",legendRight:"Right",legendNone:"None",addSeries:"Series",addCategory:"Row",seriesName:"Series name",borders:"Borders",borderColour:"Border colour",borderWidth:"Border width",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",mergeCells:"Merge cells",unmergeCells:"Unmerge cells",cellEditHint:"Double-click a cell to type in it. Shift-click to choose several.",colours:"Colours",headingFont:"Headings",bodyFont:"Body",slideNumbers:"Slide numbers",skipSlide:"Skip slide",unskipSlide:"Don’t skip slide",skipped:"Skipped in the show",transition:"Transition",transitionNone:"None",transitionFade:"Fade",transitionSlide:"Slide from right",transitionPush:"Push",transitionZoom:"Zoom",transitionFlip:"Flip",duration:"Duration",applyToAll:"Apply to all slides",play:"Play",animations:"Object animations",addAnimation:"Add animation",removeAnimation:"Remove animation",selectToAnimate:"Select an object on the slide to animate it.",noAnimations:"No animations on this slide.",effectAppear:"Appear",effectFadeIn:"Fade in",effectFlyIn:"Fly in",effectZoomIn:"Zoom in",effectFadeOut:"Fade out",startClick:"On click",startWithPrevious:"With previous",startAfterPrevious:"After previous",fromLeft:"From left",fromRight:"From right",fromTop:"From top",fromBottom:"From bottom",byParagraph:"By paragraph",moveEarlier:"Earlier",moveLater:"Later",commentPlaceholder:"Comment or add others with @",replyPlaceholder:"Reply",post:"Comment",reply:"Reply",resolve:"Resolve",reopen:"Reopen",showResolved:"Show resolved",noComments:"No comments yet. Select something and choose Comment.",editComment:"Edit",deleteComment:"Delete",save:"Save",cancel:"Cancel",commentFailed:"Could not save this comment.",onSlide:"On the slide",objectGone:"The object it was on is gone.",resolvedBy:"Resolved",nameVersion:"Name this version",versionName:"Version name",restore:"Restore",previewVersion:"Preview",noVersions:"No earlier versions yet.",restoreFailed:"Could not restore this version.",closePreview:"Back to the deck",versionsFailed:"Could not load the history.",startFrom:"Start from",exportPptx:"PowerPoint (.pptx)",exportPdf:"PDF",exporting:"Exporting…",merged:"Somebody else changed this deck too. Their changes are in.",editingNow:e=>`${e} also here`,commentCount:e=>`${e} comments`,restoreConfirm:e=>`Restore the deck as it was on ${e}? You can undo this.`,shapeName:e=>o[e],starterName:e=>i[e],themeName:e=>({simple:"Simple",midnight:"Midnight",editorial:"Editorial"}[e]??e),presenterStep:(e,t)=>`Click ${e} of ${t}`,dealerPitch:[["Wheel and Tyre Haus","Dealer programme 2026"],["Why stock us","Fast restock from three warehouses"],["The range","Wheels, tyres and fitting kits"],["Margins and support","Tiered pricing and co-op marketing"],["Next steps","Book a range review"]],monthlyReport:[["Monthly report","October 2026"],["Highlights","What went well this month"],["Numbers","Sales, margin and stock"],["Risks","What needs attention"],["Next month","Priorities and owners"]]},l={decks:"演示文稿",newDeck:"新建演示文稿",untitledDeck:"未命名演示文稿",emptyTitle:"制作第一份演示文稿",emptyBody:"在这里制作幻灯片,然后放映或导出为 PowerPoint。",openFailed:"无法打开此演示文稿",createFailed:"无法创建演示文稿。",deleteFailed:"无法删除此演示文稿。",backToDecks:"返回演示文稿列表",deleteConfirm:e=>`要删除“${e}”吗?此操作无法撤销。`,delete:"删除",deckName:"演示文稿名称",slidesPanel:"幻灯片",slideNumber:e=>`第 ${e} 张幻灯片`,slideOf:(e,t)=>`第 ${e} 张,共 ${t} 张`,addSlide:"添加幻灯片",duplicateSlide:"复制幻灯片",deleteSlide:"删除幻灯片",slideText:"幻灯片文字",undo:"撤销",redo:"重做",export:"导出",exportFailed:"无法导出此演示文稿。",present:"放映",endShow:"结束放映",popupBlocked:"浏览器阻止了观众窗口。请允许此网站的弹出窗口,然后结束放映并重新放映。",back:"上一张",next:"下一张",nextSlide:"下一张幻灯片",endOfDeck:"演示文稿已结束。",notes:"备注",noNotes:"此幻灯片没有备注。",speakerNotes:"演讲者备注",saveFailed:"无法保存此演示文稿,正在重试。",renameFailed:"无法重命名此演示文稿。",conflict:"其他人修改了此演示文稿,您最近的编辑未保存。请重新加载以查看对方的版本。",reload:"重新加载",addText:"添加文字",addShape:"添加形状",addImage:"添加图片",addChart:"添加图表",addTable:"添加表格",elementText:"文字",elementShape:"形状",elementImage:"图片",elementChart:"图表",elementTable:"表格",slide:"幻灯片",objects:e=>`${e} 个对象`,background:"背景",positionAndSize:"位置和大小",width:"宽",height:"高",angle:"角度",align:"对齐",alignLeft:"左对齐",alignCentre:"居中对齐",alignRight:"右对齐",bringForward:"上移一层",size:"字号",weight:"字重",regular:"常规",bold:"粗体",textAlignment:"文字对齐",left:"左",centre:"中",right:"右",colour:"颜色",rectangle:"矩形",ellipse:"椭圆",roundedRectangle:"圆角矩形",diamond:"菱形",lineShape:"线条",outlineColour:"轮廓颜色",imageAddress:"图片地址",chooseImage:"选择图片",imageTitle:"幻灯片图片",description:"描述",data:"数据",chartType:"图表类型",bar:"柱形图",line:"折线图",values:"数值",valuesHint:"每行一个标签和数字,例如 九月, 42。",rows:"行",rowsHint:"每行一行数据,单元格之间用逗号分隔。",headingColour:"标题颜色",pptxPasswordProtected:"此文件设有密码。请先在 PowerPoint 中移除密码,再重新导入。",pptxUnreadable:"无法将此文件读取为 PowerPoint (.pptx) 文件。",pptxLegacyFormat:"这是旧版 Office 文件。请先在 PowerPoint 中另存为 .pptx,再重新导入。",pptxTooManySlides:(e,t)=>`此演示文稿有 ${e} 张幻灯片,最多只能有 ${t} 张。`,pptxTooLarge:(e,t)=>`此演示文稿不计图片已达 ${e} MiB,上限为 ${t} MiB。请拆分成较小的演示文稿。`,pdfSlideFailed:e=>`第 ${e} 张幻灯片无法绘制到 PDF。`,files:t,fileKind:"PowerPoint",importNotes:({skipped:e,animations:t,fonts:o})=>{const n=[e&&`${e} 个图表、视频或自定义形状未能导入`,t&&`${t} 张幻灯片的动画已移除`,o.length&&`${o.join("、")} 以演示文稿字体显示`].filter(Boolean);return n.length?`部分内容未能导入:${n.join(";")}。`:null},dismiss:"关闭",newSlide:"新建幻灯片",layouts:"版式",layoutTitle:"标题",layoutTitleBody:"标题和正文",layoutSection:"节标题",layoutTwoColumns:"两栏",layoutTitleOnly:"仅标题",layoutBlank:"空白",placeholderTitle:"单击添加标题",placeholderSubtitle:"单击添加副标题",placeholderBody:"单击添加文本",addVideo:"添加视频",addLine:"添加线条或连接线",elementVideo:"视频",elementConnector:"连接线",lineStraight:"直线",lineArrow:"箭头",lineDoubleArrow:"双向箭头",connectorElbow:"肘形连接线",connectorCurved:"曲线连接线",arrange:"排列",theme:"主题",motion:"动画",comments:"评论",versionHistory:"版本历史记录",font:"字体",fontSize:"字号",smaller:"减小字号",larger:"增大字号",italic:"斜体",underline:"下划线",strikethrough:"删除线",textColour:"文字颜色",highlight:"突出显示",link:"链接",linkPrompt:"链接到网址、电子邮件地址或幻灯片编号",removeLink:"移除链接",badLink:"该链接不是网址、电子邮件地址或幻灯片编号。",alignJustify:"两端对齐",bulletList:"项目符号列表",numberedList:"编号列表",indentLess:"减少缩进",indentMore:"增加缩进",lineSpacing:"行距",verticalAlign:"垂直对齐",top:"顶端",middle:"居中",bottom:"底端",shrinkToFit:"缩小文字以适应",cut:"剪切",copy:"复制",paste:"粘贴",duplicate:"创建副本",copyStyle:"复制格式",pasteStyle:"粘贴格式",order:"顺序",bringToFront:"置于顶层",sendBackward:"下移一层",sendToBack:"置于底层",alignTop:"顶端对齐",alignMiddle:"垂直居中",alignBottom:"底端对齐",distributeAcross:"横向分布",distributeDown:"纵向分布",distribute:"分布",group:"组合",ungroup:"取消组合",lock:"锁定",unlock:"解锁",locked:"已锁定",comment:"评论",grid:"网格",crop:"裁剪",cropLeft:"左",cropTop:"上",cropRight:"右",cropBottom:"下",opacity:"不透明度",replaceImage:"替换图片",videoAddress:"视频地址",videoHint:"YouTube 或 Vimeo 链接,或视频文件。",chooseVideo:"从媒体库选择",videoUnsupported:"此视频无法在此播放。请通过其链接打开。",route:"路线",routeStraight:"直线",routeElbow:"肘形",routeCurved:"曲线",arrowStart:"起点箭头",arrowEnd:"终点箭头",lineWidth:"线条粗细",fill:"填充",noFill:"无填充",outline:"轮廓",chartBar:"柱形图",chartHbar:"条形图",chartArea:"面积图",chartPie:"饼图",chartDonut:"圆环图",legend:"图例",legendBottom:"底部",legendRight:"右侧",legendNone:"无",addSeries:"系列",addCategory:"行",seriesName:"系列名称",borders:"边框",borderColour:"边框颜色",borderWidth:"边框粗细",insertRowAbove:"在上方插入行",insertRowBelow:"在下方插入行",insertColumnLeft:"在左侧插入列",insertColumnRight:"在右侧插入列",deleteRow:"删除行",deleteColumn:"删除列",mergeCells:"合并单元格",unmergeCells:"取消合并单元格",cellEditHint:"双击单元格即可输入。按住 Shift 单击可选择多个。",colours:"颜色",headingFont:"标题",bodyFont:"正文",slideNumbers:"幻灯片编号",skipSlide:"跳过幻灯片",unskipSlide:"不跳过幻灯片",skipped:"放映时跳过",transition:"切换效果",transitionNone:"无",transitionFade:"淡出",transitionSlide:"从右侧滑入",transitionPush:"推入",transitionZoom:"缩放",transitionFlip:"翻转",duration:"持续时间",applyToAll:"应用于所有幻灯片",play:"播放",animations:"对象动画",addAnimation:"添加动画",removeAnimation:"删除动画",selectToAnimate:"选择幻灯片上的对象以添加动画。",noAnimations:"此幻灯片没有动画。",effectAppear:"出现",effectFadeIn:"淡入",effectFlyIn:"飞入",effectZoomIn:"放大",effectFadeOut:"淡出",startClick:"单击时",startWithPrevious:"与上一动画同时",startAfterPrevious:"上一动画之后",fromLeft:"自左侧",fromRight:"自右侧",fromTop:"自顶部",fromBottom:"自底部",byParagraph:"按段落",moveEarlier:"提前",moveLater:"延后",commentPlaceholder:"发表评论,或使用 @ 添加其他人",replyPlaceholder:"回复",post:"评论",reply:"回复",resolve:"解决",reopen:"重新打开",showResolved:"显示已解决",noComments:"还没有评论。选择内容后选择“评论”。",editComment:"编辑",deleteComment:"删除",save:"保存",cancel:"取消",commentFailed:"无法保存此评论。",onSlide:"在幻灯片上",objectGone:"所评论的对象已被删除。",resolvedBy:"已解决",nameVersion:"命名此版本",versionName:"版本名称",restore:"恢复",previewVersion:"预览",noVersions:"还没有较早的版本。",restoreFailed:"无法恢复此版本。",closePreview:"返回演示文稿",versionsFailed:"无法加载历史记录。",startFrom:"开始于",exportPptx:"PowerPoint (.pptx)",exportPdf:"PDF",exporting:"正在导出…",merged:"其他人也修改了此演示文稿,其更改已合并。",editingNow:e=>`${e} 也在此处`,commentCount:e=>`${e} 条评论`,restoreConfirm:e=>`将演示文稿恢复为 ${e} 时的版本?此操作可以撤销。`,shapeName:e=>n[e],starterName:e=>r[e],themeName:e=>({simple:"简约",midnight:"午夜",editorial:"杂志"}[e]??e),presenterStep:(e,t)=>`第 ${e} 次单击,共 ${t} 次`,dealerPitch:[["Wheel and Tyre Haus","2026 年经销商计划"],["为何选择我们","三个仓库快速补货"],["产品系列","轮毂、轮胎和安装套件"],["利润与支持","阶梯定价和联合营销"],["后续步骤","预约产品系列评审"]],monthlyReport:[["月度报告","2026 年 10 月"],["亮点","本月进展顺利的方面"],["数据","销售、利润和库存"],["风险","需要关注的事项"],["下月","重点工作和负责人"]]},s=1920,d=1080,c="Inter",p=["Inter","Roboto","Montserrat","Lora","Playfair Display","JetBrains Mono"],m="transparent",h=20,u=["rect","roundRect","ellipse","triangle","rightTriangle","diamond","pentagon","hexagon","octagon","star","heart","cloud","bolt","parallelogram","trapezoid","cylinder","plus","arrowRight","arrowLeft","arrowUp","arrowDown","arrowLeftRight","chevron","callout","calloutRound","line"],g=()=>crypto.randomUUID();function f(){return{id:g(),background:"#ffffff",notes:"",elements:[]}}function w(e){const t=e,o=t?.slides;return Array.isArray(o)&&o.length>0?{...t,slides:o}:{slides:[f()]}}var y={text:"#2c2c2a",accents:["#534ab7","#1d9e75","#d85a30"],shapeFill:"#afa9ec"};function b(e,t=y){const o=(e,t)=>({id:g(),x:(s-e)/2,y:(d-t)/2,w:e,h:t,rotation:0}),n=t.accents[0]??y.accents[0];switch(e){case"text":return{...o(800,160),type:e,text:"Text",fontSize:64,bold:!1,color:t.text,align:"left",...t.bodyFont&&t.bodyFont!==c?{font:t.bodyFont}:{}};case"shape":return{...o(400,400),type:e,shape:"rect",fill:t.shapeFill};case"image":return{...o(800,450),type:e,src:"",alt:""};case"video":return{...o(960,540),type:e,src:"",alt:""};case"connector":{const n={x:760,y:540},i={x:1160,y:540};return{...o(400,24),y:528,type:e,start:n,end:i,route:"straight",stroke:t.text,strokeWidth:4,arrowEnd:!0}}case"chart":return{...o(900,600),type:e,kind:"bar",color:n,points:[{label:"A",value:40},{label:"B",value:65},{label:"C",value:90}]};case"table":return{...o(1e3,400),type:e,headerFill:"#eeedfe",rows:[["Heading","Heading"],["Cell","Cell"]]}}}function k(e,t,o){return{...e,slides:e.slides.map(e=>e.id===t?o(e):e)}}function x(e,t,o){const n=e.slides.findIndex(e=>e.id===t),i=[...e.slides];return i.splice(-1===n?i.length:n+1,0,o),{...e,slides:i}}function S(e){return{...e,id:g(),elements:e.elements.map(e=>({...e,id:g()}))}}function v(e,t){const o=e.slides.filter(e=>e.id!==t);return{...e,slides:o.length>0?o:[f()]}}function C(e,t,o){const n=e.slides.findIndex(e=>e.id===t);if(-1===n)return e;const i=[...e.slides],[r]=i.splice(n,1);return i.splice(Math.max(0,Math.min(o,i.length)),0,r),{...e,slides:i}}function T(e,t,o){return{...e,elements:e.elements.map(e=>t.has(e.id)?o(e):e)}}function P(e,t){return{...e,elements:e.elements.filter(e=>!t.has(e.id))}}function F(e,t,o){const n={...e,x:e.x+t,y:e.y+o};if("connector"!==n.type)return n;const i=e=>({...e,x:e.x+t,y:e.y+o});return{...n,start:i(n.start),end:i(n.end)}}function R(e,t){const o=[...e.elements];for(let e=o.length-2;e>=0;e-=1)t.has(o[e].id)&&!t.has(o[e+1].id)&&([o[e],o[e+1]]=[o[e+1],o[e]]);return{...e,elements:o}}function A(e){const t=Math.min(...e.map(e=>e.x)),o=Math.min(...e.map(e=>e.y));return{x:t,y:o,w:Math.max(...e.map(e=>e.x+e.w))-t,h:Math.max(...e.map(e=>e.y+e.h))-o}}function B(e,t){const o=[{x:0,y:0,w:s,h:d},...t],n=(e,t,o)=>{let n=null;for(const i of[e,e+t/2,e+t])for(const e of o){const t=e-i;Math.abs(t)<=8&&(!n||Math.abs(t)<Math.abs(n.shift))&&(n={shift:t,at:e})}return n},i=n(e.x,e.w,o.flatMap(e=>[e.x,e.x+e.w/2,e.x+e.w])),r=n(e.y,e.h,o.flatMap(e=>[e.y,e.y+e.h/2,e.y+e.h]));return{box:{...e,x:e.x+(i?.shift??0),y:e.y+(r?.shift??0)},guides:{x:i?[i.at]:[],y:r?[r.at]:[]}}}var L=["nw","n","ne","e","se","s","sw","w"];function D(e,t,o,n,i=!1){let{x:r,y:a,w:l,h:s}=e;if(t.includes("e")&&(l=Math.max(20,e.w+o)),t.includes("s")&&(s=Math.max(20,e.h+n)),t.includes("w")&&(l=Math.max(20,e.w-o),r=e.x+e.w-l),t.includes("n")&&(s=Math.max(20,e.h-n),a=e.y+e.h-s),i&&2===t.length){const o=Math.max(l/e.w,s/e.h);l=e.w*o,s=e.h*o,t.includes("w")&&(r=e.x+e.w-l),t.includes("n")&&(a=e.y+e.h-s)}return{x:r,y:a,w:l,h:s}}function N(e,t,o,n=!1){const i=180*Math.atan2(o-(e.y+e.h/2),t-(e.x+e.w/2))/Math.PI+90;return((n?15*Math.round(i/15):Math.round(i))%360+360)%360}function M(e,t){return e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h}function $(e,t){switch(t.type){case"commit":return t.doc===e.present?e:{past:[...e.past,e.present].slice(-200),present:t.doc,future:[]};case"live":return{...e,present:t.doc};case"settle":return t.from===e.present?e:{past:[...e.past,t.from].slice(-200),present:e.present,future:[]};case"undo":{const t=e.past[e.past.length-1];return t?{past:e.past.slice(0,-1),present:t,future:[e.present,...e.future]}:e}case"redo":{const[t,...o]=e.future;return t?{past:[...e.past,e.present],present:t,future:o}:e}case"rebase":return{past:e.past.map(t.rebase),present:t.rebase(e.present),future:e.future.map(t.rebase)}}}export{a as ENGLISH_WORDS,l as ZH_HANS_WORDS,s as SLIDE_W,d as SLIDE_H,c as DECK_FONT,p as DECK_FONTS,m as NO_FILL,h as MIN_SIZE,u as SHAPE_KINDS,g as newId,f as newSlide,w as asDocument,b as newElement,k as updateSlide,x as insertSlideAfter,S as copySlide,v as removeSlide,C as moveSlide,T as updateElements,P as removeElements,F as shiftElement,R as bringForward,A as boundsOf,B as snapBox,L as HANDLES,D as resizeBox,N as angleTo,M as boxesTouch,$ as historyReducer};
@@ -1 +0,0 @@
1
- import{paragraphsOf as t,withParagraphs as e}from"./chunk-B2X3NIQR.js";import{DECK_FONT as o,DECK_FONTS as n,SLIDE_H as r,SLIDE_W as i,newId as a,newSlide as l}from"./chunk-PXOQN7D6.js";var s=[{id:"simple",name:"Simple",background:"#ffffff",text:"#2c2c2a",heading:"#26215c",accents:["#534ab7","#1d9e75","#d85a30","#ef9f27","#378add","#d4537e"],headingFont:o,bodyFont:o},{id:"midnight",name:"Midnight",background:"#26215c",text:"#eeedfe",heading:"#ffffff",accents:["#afa9ec","#5dcaa5","#f0997b","#fac775","#85b7eb","#ed93b1"],headingFont:"Montserrat",bodyFont:o},{id:"editorial",name:"Editorial",background:"#f1efe8",text:"#444441",heading:"#2c2c2a",accents:["#993c1d","#5f5e5a","#0f6e56","#854f0b","#185fa5","#993556"],headingFont:"Playfair Display",bodyFont:"Lora"}],c=s[0],d=t=>t.theme??c,f={title:96,subtitle:48,body:44};function u(t,e,o,n){return{id:a(),type:"text",...e,rotation:0,text:o,fontSize:f[t],bold:"title"===t,color:"title"===t?n.heading:n.text,font:"title"===t?n.headingFont:n.bodyFont,align:"left",anchor:"body"===t?"top":"bottom",placeholder:t,..."body"===t?{paragraphs:[{list:"bullet",runs:[{text:o}]}]}:{}}}var h=120,b={x:h,y:80,w:i-240,h:180},m={x:h,y:300,w:i-240,h:r-300-100},p=["title","titleBody","section","twoColumns","titleOnly","blank"];function y(t,e,o){const n={...l(),background:e.background,layout:t},r=(m.w-80)/2;return{...n,elements:(()=>{switch(t){case"title":return[{...u("title",{x:h,y:340,w:i-240,h:220},o.title,e),align:"center"},{...u("subtitle",{x:h,y:580,w:i-240,h:120},o.subtitle,e),align:"center",anchor:"top"}];case"titleBody":return[u("title",b,o.title,e),u("body",m,o.body,e)];case"section":return[u("title",{x:h,y:520,w:i-240,h:200},o.title,e)];case"twoColumns":return[u("title",b,o.title,e),u("body",{...m,w:r},o.body,e),u("body",{...m,x:m.x+r+80,w:r},o.body,e)];case"titleOnly":return[u("title",b,o.title,e)];case"blank":return[]}})()}}function g(n,r){const i=d(n),a=(t,e)=>!!t&&t.toLowerCase()===e.toLowerCase(),l=t=>{const e=i.accents.findIndex(e=>a(t,e));return-1===e?t:r.accents[e]??t},s=n=>{switch(n.type){case"text":{const l="title"===n.placeholder||!n.placeholder&&a(n.color,i.heading),s=t=>a(t,i.heading)?r.heading:a(t,i.text)?r.text:t,c=l?i.headingFont:i.bodyFont,d=l?r.headingFont:r.bodyFont,f=n.placeholder||(n.font??o)===c?d===o?void 0:d:n.font,u=t(n).map(t=>({...t,runs:t.runs.map(t=>({...t,color:s(t.color),font:t.font===c?void 0:t.font}))}));return e({...n,color:s(n.color)??n.color,font:f},u)}case"shape":return{...n,fill:l(n.fill),stroke:n.stroke&&(a(n.stroke,i.text)?r.text:l(n.stroke))};case"connector":return{...n,stroke:a(n.stroke,i.text)?r.text:l(n.stroke)};case"chart":return{...n,color:l(n.color),series:n.series?.map(t=>({...t,color:l(t.color)}))};default:return n}};return{...n,theme:r,slides:n.slides.map(t=>({...t,background:a(t.background,i.background)?r.background:t.background,elements:t.elements.map(s)}))}}var x=["blank","simple","midnight","editorial","dealerPitch","monthlyReport"];function k(o,n){if("blank"===o)return{slides:[l()]};const r=s.find(t=>t.id===o)??("dealerPitch"===o?s[1]:c);if("simple"===o||"midnight"===o||"editorial"===o)return{theme:r,slides:[y("title",r,n)]};const i="dealerPitch"===o?n.dealerPitch:n.monthlyReport,a=i.map(([o,a],l)=>((o,n,r)=>({...o,elements:o.elements.map(o=>{if("text"!==o.type)return o;const i="title"===o.placeholder?n:r;return e(o,t(o).slice(0,1).map(t=>({...t,runs:[{...t.runs[0],text:i}]})))})}))(y(0===l?"title":l===i.length-1?"section":"titleBody",r,n),o,a));return{theme:r,slideNumbers:!0,slides:a}}function w(t){const e=d(t),o=new Set([e.headingFont,e.bodyFont]);for(const e of t.slides)for(const t of e.elements)if("text"===t.type){t.font&&o.add(t.font);for(const e of t.paragraphs??[])for(const t of e.runs)t.font&&o.add(t.font)}return[...o].filter(t=>n.includes(t))}var F="data-slides-fonts";function v(t,e){const n=function(t){return`https://fonts.googleapis.com/css2?${[...t].sort().map(t=>`family=${t.replace(/ /g,"+")}:ital,wght@0,400;0,700;1,400;1,700`).join("&")}&display=swap`}([...new Set([o,...e])]),r=t.head.querySelector(`link[${F}]`);if(r?.href===n)return;const i=t.createElement("link");i.rel="stylesheet",i.crossOrigin="anonymous",i.href=n,i.setAttribute(F,""),t.head.appendChild(i),r?.remove()}export{s as THEMES,d as themeOf,p as LAYOUTS,y as slideFromLayout,g as applyTheme,x as STARTERS,k as starterDeck,w as fontsOf,v as ensureFonts};
@@ -1 +0,0 @@
1
- import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var a={ABS:"Absolute value",AND:"True if all are true",AVERAGE:"Average of numbers",AVERAGEIF:"Average where a test passes",AVERAGEIFS:"Average on many tests",CEILING:"Rounds up to a multiple","CEILING.MATH":"Rounds up to a multiple",CHAR:"Character for a Unicode number",CHOOSE:"Picks by position",CLEAN:"Removes control characters",CODE:"Unicode number of the first character",COLUMN:"Column number",COLUMNS:"Number of columns",CONCAT:"Joins text",CONCATENATE:"Joins text",COS:"Cosine",COUNT:"Counts numbers",COUNTA:"Counts non-blank cells",COUNTBLANK:"Counts blank cells",COUNTIF:"Counts where a test passes",COUNTIFS:"Counts on many tests",DATE:"Builds a date",DATEDIF:"Time between dates",DATEVALUE:"Date from text",DAY:"Day of the month",DAYS:"Days between dates",EDATE:"Date some months away",EOMONTH:"Last day of a month",EXACT:"Same text, case included",EXP:"e to a power",FIND:"Position of text, case exact",FLOOR:"Rounds down to a multiple","FLOOR.MATH":"Rounds down to a multiple",FV:"Future value",HLOOKUP:"Looks along the top row",HOUR:"Hour of a time",IF:"One value or another",IFERROR:"A fallback for an error",IFNA:"A fallback for #N/A",IFS:"First test that passes",INDEX:"The cell at a position",INT:"Rounds down to a whole number",ISBLANK:"True if blank",ISERR:"True if an error other than #N/A",ISERROR:"True if an error",ISEVEN:"True if even",ISLOGICAL:"True if TRUE or FALSE",ISNA:"True if #N/A",ISNUMBER:"True if a number",ISODD:"True if odd",ISOWEEKNUM:"ISO week of the year",ISTEXT:"True if text",LARGE:"The kth largest",LEFT:"Text from the start",LEN:"Length of text",LN:"Natural logarithm",LOG:"Logarithm",LOG10:"Base-10 logarithm",LOWER:"Lower case",MATCH:"Position of a value",MAX:"Largest number",MAXIFS:"Largest where all tests pass",MEDIAN:"Middle number",MID:"Text from the middle",MIN:"Smallest number",MINIFS:"Smallest where all tests pass",MINUTE:"Minute of a time",MOD:"Remainder",MODE:"Most common number","MODE.SNGL":"Most common number",MONTH:"Month of a date",MROUND:"Rounds to the nearest multiple",N:"A value as a number",NA:"The #N/A error",NETWORKDAYS:"Working days between dates","NETWORKDAYS.INTL":"Working days, your weekend",NOT:"The opposite",NOW:"Date and time now",NPV:"Net present value",OR:"True if any is true",PERCENTILE:"Value at a percentile","PERCENTILE.INC":"Value at a percentile",PI:"The number pi",PMT:"Loan payment",POWER:"A number to a power",PRODUCT:"Multiplies numbers",PROPER:"Capitals on each word",PV:"Present value",QUARTILE:"Value at a quartile","QUARTILE.INC":"Value at a quartile",QUOTIENT:"Whole part of a division",RAND:"Random from 0 to 1",RANDBETWEEN:"Random whole number",RANK:"Rank in a list","RANK.EQ":"Rank in a list",REGEXEXTRACT:"Text a pattern finds",REGEXMATCH:"True if a pattern matches",REGEXREPLACE:"Replaces what a pattern finds",REPLACE:"Replaces by position",REPT:"Repeats text",RIGHT:"Text from the end",ROUND:"Rounds a number",ROUNDDOWN:"Rounds toward zero",ROUNDUP:"Rounds away from zero",ROW:"Row number",ROWS:"Number of rows",SEARCH:"Position of text, any case",SECOND:"Second of a time",SIGN:"Sign of a number",SIN:"Sine",SMALL:"The kth smallest",SQRT:"Square root",STDEV:"Standard deviation of a sample","STDEV.P":"Standard deviation of everything","STDEV.S":"Standard deviation of a sample",STDEVP:"Standard deviation of everything",SUBSTITUTE:"Replaces text",SUBTOTAL:"Total that skips other subtotals",SUM:"Adds numbers",SUMIF:"Adds where a test passes",SUMIFS:"Adds on many tests",SUMPRODUCT:"Multiplies, then adds",SWITCH:"Picks a result by value",TAN:"Tangent",TEXT:"A number as formatted text",TEXTJOIN:"Joins with a separator",TIME:"Builds a time",TIMEVALUE:"Time from text",TODAY:"Today's date",TRIM:"Removes extra spaces",TRUNC:"Cuts off decimals",UPPER:"Upper case",VALUE:"Text as a number",VAR:"Variance of a sample","VAR.P":"Variance of everything","VAR.S":"Variance of a sample",VARP:"Variance of everything",VLOOKUP:"Looks down the first column",WEEKDAY:"Day of the week",WEEKNUM:"Week of the year",WORKDAY:"Date some working days away","WORKDAY.INTL":"Working days away, your weekend",XLOOKUP:"Looks up in any column",XOR:"True if an odd number are true",YEAR:"Year of a date",YEARFRAC:"Years between dates, as a fraction"},o={ABS:"绝对值",AND:"全部为真时返回真",AVERAGE:"数字的平均值",AVERAGEIF:"满足条件的平均值",AVERAGEIFS:"满足多个条件的平均值",CEILING:"向上舍入到倍数","CEILING.MATH":"向上舍入到倍数",CHAR:"Unicode 编号对应的字符",CHOOSE:"按位置选择",CLEAN:"删除控制字符",CODE:"首字符的 Unicode 编号",COLUMN:"列号",COLUMNS:"列数",CONCAT:"连接文本",CONCATENATE:"连接文本",COS:"余弦",COUNT:"统计数字个数",COUNTA:"统计非空单元格",COUNTBLANK:"统计空单元格",COUNTIF:"统计满足条件的个数",COUNTIFS:"统计满足多个条件的个数",DATE:"生成日期",DATEDIF:"两个日期的间隔",DATEVALUE:"将文本转换为日期",DAY:"月份中的第几天",DAYS:"两个日期相差的天数",EDATE:"相隔若干个月的日期",EOMONTH:"月份的最后一天",EXACT:"文本完全相同",EXP:"e 的幂",FIND:"文本位置(区分大小写)",FLOOR:"向下舍入到倍数","FLOOR.MATH":"向下舍入到倍数",FV:"未来值",HLOOKUP:"在首行中查找",HOUR:"时间中的小时",IF:"二选一返回值",IFERROR:"出错时的备用值",IFNA:"#N/A 时的备用值",IFS:"第一个满足的条件",INDEX:"指定位置的单元格",INT:"向下取整",ISBLANK:"为空时返回真",ISERR:"为 #N/A 以外的错误时返回真",ISERROR:"为错误时返回真",ISEVEN:"为偶数时返回真",ISLOGICAL:"为逻辑值时返回真",ISNA:"为 #N/A 时返回真",ISNUMBER:"为数字时返回真",ISODD:"为奇数时返回真",ISOWEEKNUM:"ISO 周数",ISTEXT:"为文本时返回真",LARGE:"第 k 大的值",LEFT:"从开头截取文本",LEN:"文本长度",LN:"自然对数",LOG:"对数",LOG10:"以 10 为底的对数",LOWER:"转为小写",MATCH:"值的位置",MAX:"最大值",MAXIFS:"满足全部条件的最大值",MEDIAN:"中位数",MID:"从中间截取文本",MIN:"最小值",MINIFS:"满足全部条件的最小值",MINUTE:"时间中的分钟",MOD:"余数",MODE:"出现最多的数字","MODE.SNGL":"出现最多的数字",MONTH:"日期中的月份",MROUND:"舍入到最接近的倍数",N:"转为数字",NA:"#N/A 错误",NETWORKDAYS:"两个日期之间的工作日","NETWORKDAYS.INTL":"工作日天数(自定义周末)",NOT:"取反",NOW:"当前日期和时间",NPV:"净现值",OR:"任一为真时返回真",PERCENTILE:"百分位数","PERCENTILE.INC":"百分位数",PI:"圆周率",PMT:"贷款每期还款额",POWER:"幂运算",PRODUCT:"数字相乘",PROPER:"每个单词首字母大写",PV:"现值",QUARTILE:"四分位数","QUARTILE.INC":"四分位数",QUOTIENT:"除法的整数部分",RAND:"0 到 1 之间的随机数",RANDBETWEEN:"随机整数",RANK:"在列表中的排名","RANK.EQ":"在列表中的排名",REGEXEXTRACT:"提取正则表达式匹配的文本",REGEXMATCH:"匹配正则表达式时返回真",REGEXREPLACE:"替换正则表达式匹配的文本",REPLACE:"按位置替换",REPT:"重复文本",RIGHT:"从末尾截取文本",ROUND:"四舍五入",ROUNDDOWN:"向零舍入",ROUNDUP:"远离零舍入",ROW:"行号",ROWS:"行数",SEARCH:"文本位置(不区分大小写)",SECOND:"时间中的秒",SIGN:"数字的符号",SIN:"正弦",SMALL:"第 k 小的值",SQRT:"平方根",STDEV:"样本标准差","STDEV.P":"总体标准差","STDEV.S":"样本标准差",STDEVP:"总体标准差",SUBSTITUTE:"替换文本",SUBTOTAL:"跳过其他小计的汇总",SUM:"数字求和",SUMIF:"对满足条件的值求和",SUMIFS:"对满足多个条件的值求和",SUMPRODUCT:"相乘后求和",SWITCH:"按值选择结果",TAN:"正切",TEXT:"数字转为带格式的文本",TEXTJOIN:"用分隔符连接",TIME:"生成时间",TIMEVALUE:"将文本转换为时间",TODAY:"今天的日期",TRIM:"删除多余空格",TRUNC:"截去小数",UPPER:"转为大写",VALUE:"文本转为数字",VAR:"样本方差","VAR.P":"总体方差","VAR.S":"样本方差",VARP:"总体方差",VLOOKUP:"在首列中查找",WEEKDAY:"星期几",WEEKNUM:"一年中的第几周",WORKDAY:"若干工作日后的日期","WORKDAY.INTL":"若干工作日后的日期(自定义周末)",XLOOKUP:"在任意列中查找",XOR:"奇数个为真时返回真",YEAR:"日期中的年份",YEARFRAC:"两个日期之间的年数(小数)"},r={pdfPageFailed:e=>`Page ${e} couldn't be drawn for the PDF.`,files:e,fileKind:"Excel",untitled:"Untitled",backToFiles:"Back to files",filesHeading:"Spreadsheets",newFile:"New spreadsheet",openFile:"Open a file",filesEmptyTitle:"Make your first spreadsheet",filesEmptyBody:"Every change saves by itself.",deleteFile:"Delete",createFailed:"The spreadsheet could not be made.",deleteFailed:"The spreadsheet could not be deleted.",storedOpenFailed:"This spreadsheet could not be opened.",loading:"Loading",renameFailed:"The spreadsheet could not be renamed.",conflict:"Somebody else saved this spreadsheet, so your latest changes are not saved. Reload to see theirs.",reload:"Reload",noStoreEdited:"Not saved. Save as Excel to keep your changes",saveToFiles:"Save to Files",noStoreClean:"No autosave here. Save as Excel to keep a copy",deleteConfirm:e=>`Delete "${e}"? Nobody can open it again.`,spreadsheetFile:"spreadsheet",sheetBase:"Sheet",menuFile:"File",menuEdit:"Edit",menuView:"View",menuInsert:"Insert",menuFormat:"Format",menuData:"Data",menuNew:"New",menuOpen:"Open",saveExcel:"Save as Excel (.xlsx)",saveCsv:"Download this sheet as CSV",email:"Email",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste",pasteValues:"Paste values only",pasteFormats:"Paste formatting only",findReplace:"Find and replace",clearValues:"Clear contents",freeze:"Freeze",gridlines:"Gridlines",showFormulas:"Show formulas",rowsAbove:"Rows above",rowsBelow:"Rows below",columnsLeft:"Columns left",columnsRight:"Columns right",sheet:"Sheet",function:"Function",functions:"Functions",number:"Number format",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontSize:"Font size",alignment:"Alignment",borders:"Borders",wrapText:"Wrap text",mergeCells:"Merge cells",clearFormatting:"Clear formatting",sortAscending:"Sort A to Z",sortDescending:"Sort Z to A",filter:"Filter",hideRows:"Hide rows",hideColumns:"Hide columns",unhideRows:"Show hidden rows",unhideColumns:"Show hidden columns",deleteRows:"Delete rows",deleteColumns:"Delete columns",formatGeneral:"Automatic",formatNumber:"Number",formatPercent:"Percent",formatScientific:"Scientific",formatCurrency:"Currency",formatDate:"Date",formatTime:"Time",formatDateTime:"Date and time",formatText:"Plain text",bordersAll:"All borders",bordersOuter:"Outer borders",bordersTop:"Top border",bordersBottom:"Bottom border",bordersLeft:"Left border",bordersRight:"Right border",bordersNone:"No borders",alignLeft:"Left",alignCenter:"Center",alignRight:"Right",alignTop:"Top",alignMiddle:"Middle",alignBottom:"Bottom",formatPainter:"Paint format",fewerDecimals:"Fewer decimal places",moreDecimals:"More decimal places",textColor:"Text color",fillColor:"Fill color",nameBox:"Selected cells",formulaBar:"Formula bar",cellEditor:"Cell contents",selectAll:"Select all",fillHandle:"Fill",find:"Find",replaceWith:"Replace with",replace:"Replace",replaceAll:"Replace all",previous:"Previous",next:"Next",close:"Close",matchCase:"Match case",wholeCell:"Whole cell",inFormulas:"In formulas",addSheet:"Add sheet",rename:"Rename",duplicate:"Duplicate",moveLeft:"Move left",moveRight:"Move right",tabColor:"Tab color",noColor:"No color",deleteSheet:"Delete sheet",deleteSheetTitle:"Delete this sheet?",sheetNameTaken:"Another sheet already has that name.",saveFailed:"Could not save the workbook. Try again.",openFailed:"Could not open that file. It may be damaged or an unsupported type.",statSum:"Sum",statAverage:"Average",statCount:"Count",statMin:"Min",statMax:"Max",blank:"(Blank)",clear:"Clear",apply:"Apply",sheetName:e=>`Sheet ${e}`,filterColumn:e=>`Filter column ${e}`,freezeRows:e=>0===e?"No frozen rows":1===e?"1 row":`${e} rows`,freezeColumns:e=>0===e?"No frozen columns":1===e?"1 column":`${e} columns`,freezeUpToRow:e=>`Up to row ${e}`,freezeUpToColumn:e=>`Up to column ${e}`,hitCount:(e,t)=>`${e} of ${t}`,replacedCount:e=>1===e?"Replaced in 1 cell":`Replaced in ${e} cells`,deleteSheetMessage:e=>`"${e}" and everything on it will be deleted. Formulas that use it will show #REF!.`,functionHelp:e=>a[e]??String(e)},l={pdfPageFailed:e=>`第 ${e} 页无法绘制到 PDF。`,files:t,fileKind:"Excel",untitled:"未命名",backToFiles:"返回文件",filesHeading:"电子表格",newFile:"新建电子表格",openFile:"打开文件",filesEmptyTitle:"创建您的第一个电子表格",filesEmptyBody:"每次更改都会自动保存。",deleteFile:"删除",createFailed:"无法创建电子表格。",deleteFailed:"无法删除电子表格。",storedOpenFailed:"无法打开此电子表格。",loading:"正在加载",renameFailed:"无法重命名电子表格。",conflict:"其他人已保存此电子表格,您最近的更改尚未保存。请重新加载以查看他们的版本。",reload:"重新加载",noStoreEdited:"未保存。请另存为 Excel 以保留更改",saveToFiles:"保存到文件",noStoreClean:"此处不会自动保存。请另存为 Excel 以保留副本",deleteConfirm:e=>`删除“${e}”?之后任何人都无法再打开它。`,spreadsheetFile:"电子表格",sheetBase:"工作表",menuFile:"文件",menuEdit:"编辑",menuView:"视图",menuInsert:"插入",menuFormat:"格式",menuData:"数据",menuNew:"新建",menuOpen:"打开",saveExcel:"另存为 Excel(.xlsx)",saveCsv:"将此工作表下载为 CSV",email:"发送邮件",undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴",pasteValues:"仅粘贴数值",pasteFormats:"仅粘贴格式",findReplace:"查找和替换",clearValues:"清除内容",freeze:"冻结",gridlines:"网格线",showFormulas:"显示公式",rowsAbove:"在上方插入行",rowsBelow:"在下方插入行",columnsLeft:"在左侧插入列",columnsRight:"在右侧插入列",sheet:"工作表",function:"函数",functions:"函数",number:"数字格式",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",fontSize:"字号",alignment:"对齐",borders:"边框",wrapText:"自动换行",mergeCells:"合并单元格",clearFormatting:"清除格式",sortAscending:"升序排序",sortDescending:"降序排序",filter:"筛选",hideRows:"隐藏行",hideColumns:"隐藏列",unhideRows:"显示隐藏的行",unhideColumns:"显示隐藏的列",deleteRows:"删除行",deleteColumns:"删除列",formatGeneral:"自动",formatNumber:"数字",formatPercent:"百分比",formatScientific:"科学计数",formatCurrency:"货币",formatDate:"日期",formatTime:"时间",formatDateTime:"日期和时间",formatText:"纯文本",bordersAll:"所有边框",bordersOuter:"外边框",bordersTop:"上边框",bordersBottom:"下边框",bordersLeft:"左边框",bordersRight:"右边框",bordersNone:"无边框",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignTop:"顶端对齐",alignMiddle:"垂直居中",alignBottom:"底端对齐",formatPainter:"格式刷",fewerDecimals:"减少小数位",moreDecimals:"增加小数位",textColor:"文字颜色",fillColor:"填充颜色",nameBox:"所选单元格",formulaBar:"编辑栏",cellEditor:"单元格内容",selectAll:"全选",fillHandle:"填充",find:"查找",replaceWith:"替换为",replace:"替换",replaceAll:"全部替换",previous:"上一个",next:"下一个",close:"关闭",matchCase:"区分大小写",wholeCell:"整个单元格",inFormulas:"在公式中",addSheet:"添加工作表",rename:"重命名",duplicate:"复制工作表",moveLeft:"左移",moveRight:"右移",tabColor:"标签颜色",noColor:"无颜色",deleteSheet:"删除工作表",deleteSheetTitle:"删除此工作表?",sheetNameTaken:"已有工作表使用该名称。",saveFailed:"无法保存工作簿,请重试。",openFailed:"无法打开该文件,文件可能已损坏或类型不受支持。",statSum:"求和",statAverage:"平均值",statCount:"计数",statMin:"最小值",statMax:"最大值",blank:"(空白)",clear:"清除",apply:"应用",sheetName:e=>`工作表 ${e}`,filterColumn:e=>`筛选 ${e} 列`,freezeRows:e=>0===e?"不冻结行":`${e} 行`,freezeColumns:e=>0===e?"不冻结列":`${e} 列`,freezeUpToRow:e=>`冻结至第 ${e} 行`,freezeUpToColumn:e=>`冻结至 ${e} 列`,hitCount:(e,t)=>`${e} / ${t}`,replacedCount:e=>`已替换 ${e} 个单元格`,deleteSheetMessage:e=>`将删除“${e}”及其全部内容。引用它的公式将显示 #REF!。`,functionHelp:e=>o[e]??String(e)};export{r as ENGLISH_WORDS,l as ZH_HANS_WORDS};
@@ -1 +0,0 @@
1
- var t=1048576,n=16384;function e(t){let n=t+1,e="";for(;n>0;){const t=(n-1)%26;e=String.fromCharCode(65+t)+e,n=Math.floor((n-1)/26)}return e}function r(t){let n=0;for(const e of t.toUpperCase())n=26*n+(e.charCodeAt(0)-64);return n-1}function o(t,n){return`${e(n)}${t+1}`}function s(t,n){return{r1:Math.min(t.row,n.row),c1:Math.min(t.col,n.col),r2:Math.max(t.row,n.row),c2:Math.max(t.col,n.col)}}function c(t){const n=o(t.r1,t.c1);return t.r1===t.r2&&t.c1===t.c2?n:`${n}:${o(t.r2,t.c2)}`}function u(t,n,e){return n>=t.r1&&n<=t.r2&&e>=t.c1&&e<=t.c2}function i(t,n){return t.r1<=n.r2&&t.r2>=n.r1&&t.c1<=n.c2&&t.c2>=n.c1}function l(t){const n=/^\$?([A-Za-z]{1,3})\$?(\d{1,7})(?::\$?([A-Za-z]{1,3})\$?(\d{1,7}))?$/.exec(t.trim());if(!n)return null;const e={row:Number(n[2])-1,col:r(n[1])},o=n[3]?{row:Number(n[4])-1,col:r(n[3])}:e;return e.row<0||o.row<0?null:s(e,o)}var a=class extends Error{},f=String.raw`(\$?)([A-Za-z]{1,3})(\$?)(\d{1,7})`,h=new RegExp(`^${f}(?::${f})?(?![A-Za-z0-9_.(])`),m=/^(\$?)([A-Za-z]{1,3}):(\$?)([A-Za-z]{1,3})(?![A-Za-z0-9_.(])/,d=/^(\$?)(\d{1,7}):(\$?)(\d{1,7})(?![A-Za-z0-9_.(])/,g=/^(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/,p=/^[A-Za-z_][A-Za-z0-9_.]*/,w=/^#(?:REF!|N\/A|NAME\?|DIV\/0!|VALUE!|NUM!|NULL!)/i,M=/^(?:'((?:[^']|'')+)'|([A-Za-z_][A-Za-z0-9_.]*))!/;function b(t,n,e,o){return{col:r(n),row:Number(o)-1,colAbs:"$"===t,rowAbs:"$"===e}}function y(e){let o=null,s=0;const c=M.exec(e);c&&(o=void 0!==c[1]?c[1].replace(/''/g,"'"):c[2],s=c[0].length);const u=e.slice(s),i=h.exec(u);if(i){const e=b(i[1],i[2],i[3],i[4]);if(e.row<0||e.row>=t||e.col>=n)return null;const r=i[6]?b(i[5],i[6],i[7],i[8]):null;return r&&(r.row<0||r.row>=t||r.col>=n)?null:{ref:{sheet:o,a:e,b:r},length:s+i[0].length}}const l=m.exec(u);if(l){return{ref:{sheet:o,a:{col:r(l[2]),row:null,colAbs:"$"===l[1],rowAbs:!1},b:{col:r(l[4]),row:null,colAbs:"$"===l[3],rowAbs:!1}},length:s+l[0].length}}const a=d.exec(u);if(a&&Number(a[2])>0&&Number(a[4])>0){return{ref:{sheet:o,a:{col:null,row:Number(a[2])-1,colAbs:!1,rowAbs:"$"===a[1]},b:{col:null,row:Number(a[4])-1,colAbs:!1,rowAbs:"$"===a[3]}},length:s+a[0].length}}return null}var A=["<=",">=","<>","+","-","*","/","^","&","=","<",">","%","(",")",",",";"];function E(t){const n=[];let e=0;for(;e<t.length;){const r=t[e];if(/\s/.test(r)){e++;continue}const o=t.slice(e);if('"'===r){let r=e+1,o="",s=!1;for(;r<t.length;){if('"'===t[r]){if('"'===t[r+1]){o+='"',r+=2;continue}s=!0,r++;break}o+=t[r++]}if(!s)return{tokens:n,complete:!1};n.push({type:"string",value:o,start:e,end:r}),e=r;continue}if("#"===r){const t=w.exec(o);if(!t)return{tokens:n,complete:!1};n.push({type:"error",value:t[0].toUpperCase(),start:e,end:e+t[0].length}),e+=t[0].length;continue}const s=y(o);if(s){n.push({type:"ref",ref:s.ref,start:e,end:e+s.length}),e+=s.length;continue}const c=g.exec(o);if(c){n.push({type:"number",value:Number(c[0]),start:e,end:e+c[0].length}),e+=c[0].length;continue}const u=p.exec(o);if(u){n.push({type:"ident",value:u[0],start:e,end:e+u[0].length}),e+=u[0].length;continue}const i=A.find(t=>o.startsWith(t));if(!i)return{tokens:n,complete:!1};n.push({type:"op",value:i,start:e,end:e+i.length}),e+=i.length}return{tokens:n,complete:!0}}var N={"=":1,"<>":1,"<":1,">":1,"<=":1,">=":1,"&":2,"+":3,"-":3,"*":4,"/":4,"^":6},v=class{constructor(t){this.tokens=t}tokens;pos=0;peek(){return this.tokens[this.pos]}isOp(t){const n=this.peek();return"op"===n?.type&&n.value===t}run(){const t=this.expression(0);if(this.pos<this.tokens.length)throw new a("Unexpected text");return t}expression(t){let n=this.prefix();for(;;){const e=this.peek();if("op"!==e?.type)break;if("%"===e.value){this.pos++,n={kind:"percent",arg:n};continue}const r=N[e.value];if(void 0===r||r<=t)break;this.pos++,n={kind:"binary",op:e.value,left:n,right:this.expression(r)}}return n}prefix(){const t=this.peek();if(!t)throw new a("Formula ends early");switch(this.pos++,t.type){case"number":return{kind:"num",value:t.value};case"string":return{kind:"str",value:t.value};case"error":return{kind:"err",value:t.value};case"ref":return{kind:"ref",ref:t.ref};case"ident":{if(this.isOp("("))return this.call(t.value);const n=t.value.toUpperCase();return"TRUE"===n?{kind:"bool",value:!0}:"FALSE"===n?{kind:"bool",value:!1}:{kind:"err",value:"#NAME?"}}case"op":if("-"===t.value||"+"===t.value)return{kind:"unary",op:t.value,arg:this.expression(7)};if("("===t.value){const t=this.expression(0);if(!this.isOp(")"))throw new a("Missing )");return this.pos++,t}throw new a(`Unexpected ${t.value}`)}}call(t){this.pos++;const n=[];if(this.isOp(")"))return this.pos++,{kind:"call",name:t.toUpperCase(),args:n};for(;;){if(this.isOp(",")||this.isOp(";")||this.isOp(")")?n.push({kind:"empty"}):n.push(this.expression(0)),!this.isOp(",")&&!this.isOp(";")){if(this.isOp(")"))return this.pos++,{kind:"call",name:t.toUpperCase(),args:n};throw new a("Missing )")}this.pos++}}},C=new Map;function x(t){return t.length>1&&"="===t[0]}function T(t){return(null===t.col?"":`${t.colAbs?"$":""}${e(t.col)}`)+(null===t.row?"":`${t.rowAbs?"$":""}${t.row+1}`)}function $(t){return(null===(n=t.sheet)?"":/^[A-Za-z_][A-Za-z0-9_.]*$/.test(n)&&!h.test(n)?`${n}!`:`'${n.replace(/'/g,"''")}'!`)+T(t.a)+(t.b?`:${T(t.b)}`:"");var n}function R(t,n){if(!x(t))return t;const e=t.slice(1),{tokens:r}=E(e);let o="",s=0;for(const t of r){if("ref"!==t.type)continue;const r=n(t.ref);o+=e.slice(s,t.start)+(r?$(r):"#REF!"),s=t.end}return`=${o}${e.slice(s)}`}function S(e,r,o){const s=e=>{const s=null===e.row||e.rowAbs?e.row:e.row+r,c=null===e.col||e.colAbs?e.col:e.col+o;return null!==s&&(s<0||s>=t)||null!==c&&(c<0||c>=n)?null:{...e,row:s,col:c}};return R(e,t=>{const n=s(t.a),e=t.b?s(t.b):null;return!n||t.b&&!e?null:{...t,a:n,b:e}})}function O(t){return t.colAbs||t.rowAbs?t.colAbs&&t.rowAbs?{...t,colAbs:!1,rowAbs:!0}:!t.colAbs&&t.rowAbs?{...t,colAbs:!0,rowAbs:!1}:{...t,colAbs:!1,rowAbs:!1}:{...t,colAbs:!0,rowAbs:!0}}var U=t=>String(t).padStart(2,"0"),I={general:"General",number:"#,##0.00",percent:"0.00%",currency:'"$"#,##0.00',scientific:"0.00E+00",date:"yyyy-mm-dd",time:"h:mm:ss AM/PM",dateTime:"yyyy-mm-dd h:mm",text:"@"},L=864e5,D=Date.UTC(1899,11,30);function F(t,n,e){return Math.round((Date.UTC(t,n-1,e)-D)/L)}function k(t){const n=Math.floor(t),e=new Date(D+n*L),r=Math.round(86400*(t-n));return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),weekday:e.getUTCDay(),hours:Math.floor(r/3600)%24,minutes:Math.floor(r/60)%60,seconds:r%60}}var P=/\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i;function V(t){const n=[];let e="",r=!1;for(let o=0;o<t.length;o++){const s=t[o];"\\"!==s?('"'===s&&(r=!r),";"!==s||r?e+=s:(n.push(e),e="")):e+=s+(t[++o]??"")}return n.push(e),n}function z(t){return t.replace(/\\./g,"").replace(/"[^"]*"/g,"").replace(/\[[^\]]*\]/g,"")}function G(t){return!(!t||"General"===t||"@"===t)&&/[ymdhs]/i.test(z(V(t)[0]).replace(/E\+/gi,""))}var W=["January","February","March","April","May","June","July","August","September","October","November","December"],j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function H(t,n){const e=k(n),r=/AM\/PM|A\/P/i.test(z(t)),o=t.match(/"[^"]*"|\\.|\[[^\]]*\]|AM\/PM|A\/P|y+|m+|d+|h+|s+|./gi)??[];let s="";return o.forEach((t,n)=>{if('"'===t[0])s+=t.slice(1,-1);else if("\\"===t[0])s+=t.slice(1);else if("["===t[0])s+="";else if(/^AM\/PM$/i.test(t))s+=e.hours<12?"AM":"PM";else if(/^A\/P$/i.test(t))s+=e.hours<12?"A":"P";else if(/^y+$/i.test(t))s+=t.length<=2?U(e.year%100):String(e.year);else if(/^m+$/i.test(t))t.length<=2&&(t=>{for(let n=t-1;n>=0;n--){if(/^h+$/i.test(o[n]))return!0;if(/^[ymds]+$/i.test(o[n]))break}for(let n=t+1;n<o.length;n++){if(/^s+$/i.test(o[n]))return!0;if(/^[ymdh]+$/i.test(o[n]))break}return!1})(n)?s+=2===t.length?U(e.minutes):String(e.minutes):1===t.length?s+=String(e.month):2===t.length?s+=U(e.month):3===t.length?s+=W[e.month-1].slice(0,3):s+=W[e.month-1];else if(/^d+$/i.test(t))1===t.length?s+=String(e.day):2===t.length?s+=U(e.day):3===t.length?s+=j[e.weekday].slice(0,3):s+=j[e.weekday];else if(/^h+$/i.test(t)){const n=r?e.hours%12||12:e.hours;s+=2===t.length?U(n):String(n)}else/^s+$/i.test(t)?s+=2===t.length?U(e.seconds):String(e.seconds):s+=t}),s}function K(t,n){const e=/[eE]([+-])(0+|\?+|#+)$/.exec(t);if(e){const r=(t.slice(0,e.index).split(".")[1]??"").length,[o,s]=n.toExponential(r).split("e"),c=Number(s);return`${o}E${c<0?"-":"+"===e[1]?"+":""}${String(Math.abs(c)).padStart(e[2].length,"0")}`}const[r,o=""]=t.split("."),s=/,+$/.exec(r)?.[0].length??0,c=/[#0?],[#0?]/.test(r),u=(r.match(/0/g)??[]).length,i=o.replace(/[^#0?]/g,"").length,l=(o.match(/0/g)??[]).length,a=n/1e3**s,f=Math.abs(a).toFixed(Math.min(i,20));let[h,m=""]=f.split(".");for(;m.length>l&&m.endsWith("0");)m=m.slice(0,-1);return"0"===h&&0===u&&(h=""),h=h.padStart(u,"0"),c&&(h=h.replace(/\B(?=(\d{3})+(?!\d))/g,",")),m?`${h}.${m}`:(o.includes("."),h)}function X(t){if(!Number.isFinite(t))return String(t);if(0===t)return"0";const n=Math.abs(t);if(n>=1e11||n<1e-9){const[n,e]=t.toExponential(5).split("e"),r=Number(e);return`${n.replace(/\.?0+$/,"")}E${r<0?"-":"+"}${U(Math.abs(r))}`}return String(Number(t.toPrecision(10)))}var Z={black:"#000000",blue:"#0000ff",cyan:"#00ffff",green:"#00a650",magenta:"#ff00ff",red:"#ff0000",white:"#ffffff",yellow:"#ffff00"};function Y(t,n){if(!n||"General"===n||"@"===n)return{text:X(t),color:null};const e=V(n);let r=e[0],o=!1;t<0&&e.length>1?(r=e[1],o=!0):0===t&&e.length>2&&(r=e[2]);const s=P.exec(r),c=s?Z[s[1].toLowerCase()]??null:null;if(/general/i.test(z(r)))return{text:r.replace(/\[[^\]]*\]/g,"").replace(/general/i,X(o?-t:t)),color:c};if(G(r))return t<0?{text:X(t),color:c}:{text:H(r,t),color:c};const u=o?Math.abs(t):t,i=function(t,n){const e=t.match(/"[^"]*"|\\.|\[[^\]]*\]|_.|\*.|[#0?][#0?,.]*(?:[eE][+-][0?#]+)?%?|%|./g)??[],r=n*100**(z(t).match(/%/g)??[]).length;let o="",s=!1;for(const t of e)if('"'===t[0])o+=t.slice(1,-1);else if("\\"===t[0])o+=t.slice(1);else if("["===t[0]){const n=/^\[\$([^-\]]*)/.exec(t);n&&(o+=n[1])}else if("_"===t[0])o+=" ";else if("*"===t[0])o+="";else if(/^[#0?]/.test(t)){const n=t.endsWith("%"),e=n?t.slice(0,-1):t;s||(o+=K(e,r),s=!0),n&&(o+="%")}else o+=t;return s?o:`${o}`}(r,Math.abs(u)),l=!/[1-9]/.test(i);return{text:!o&&t<0&&!l?`-${i}`:i,color:c}}function _(t,n){if(!n||"General"===n||"@"===n)return t;const e=V(n),r=e.length>=4?e[3]:e[0];return r.includes("@")?r.replace(/"([^"]*)"/g,"$1").replace(/\\(.)/g,"$1").replace(/@/g,t):t}function B(t,n,e){let r=t;if(!r||"General"===r){const t=null===e?0:Math.min(9,(String(e).split(".")[1]??"").length);r=t>0?`0.${"0".repeat(t)}`:"0"}return"@"===r||G(r)?r:V(r).map(t=>{const e=t.match(/"[^"]*"|\\.|\[[^\]]*\]|./g)??[];let r=-1,o=-1;return e.forEach((t,n)=>{"."===t&&-1===o&&(o=n),"0"!==t&&"#"!==t&&"?"!==t||(r=n)}),-1===r?t:(1===n?-1===o?e.splice(r+1,0,".","0"):e.splice(r+1,0,"0"):-1!==o&&(r-o===1?e.splice(o,2):e.splice(r,1)),e.join(""))}).join(";")}var Q=/^(-?)\s*([$€£¥])\s*(-?)\s*([\d,]*\.?\d+)$/,J=/^[+-]?(?:\d{1,3}(?:,\d{3})+|\d+)?(?:\.\d+)?(?:[eE][+-]?\d+)?$/,q=/^[+-]?0\d/,tt=/^[+-]?\d{16,}$/,nt=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,et=/^(\d{1,2})[/.-](\d{1,2})[/.-](\d{2}|\d{4})$/;function rt(){try{const t=new Intl.DateTimeFormat(void 0).formatToParts(new Date(2e3,11,31));return t.findIndex(t=>"day"===t.type)<t.findIndex(t=>"month"===t.type)}catch{return!0}}function ot(t,n,e){if(n<1||n>12||e<1||e>31)return!1;const r=new Date(Date.UTC(t,n-1,e));return r.getUTCMonth()===n-1&&r.getUTCDate()===e}function st(t){const n=t.trim();if(!n||q.test(n)||tt.test(n))return null;const e=Q.exec(n);if(e){const t=Number(e[4].replace(/,/g,""));if(Number.isNaN(t))return null;return{value:"-"===e[1]||"-"===e[3]?-t:t,kind:"currency",format:`"${e[2]}"#,##0${e[4].includes(".")?".00":""}`}}if(n.endsWith("%")){const t=n.slice(0,-1).trim();if(!t||!J.test(t))return null;return{value:Number(t.replace(/,/g,""))/100,kind:"percent",format:t.includes(".")?"0.00%":"0%"}}if(/\d/.test(n)&&J.test(n))return{value:Number(n.replace(/,/g,"")),kind:"number",format:n.includes(",")?n.includes(".")?"#,##0.00":"#,##0":null};const r=nt.exec(n);if(r&&ot(Number(r[1]),Number(r[2]),Number(r[3])))return{value:F(Number(r[1]),Number(r[2]),Number(r[3])),kind:"date",format:I.date};const o=et.exec(n);if(o){const t=Number(o[1]),n=Number(o[2]),e=2===o[3].length?2e3+Number(o[3]):Number(o[3]),[r,s]=rt()?[t,n]:[n,t];if(ot(e,s,r))return{value:F(e,s,r),kind:"date",format:rt()?"dd/mm/yyyy":"mm/dd/yyyy"}}return null}var ct=class{constructor(t){this.code=t}code;toString(){return this.code}},ut=t=>"object"==typeof t&&null!==t&&!(t instanceof ct),it=t=>new ct(t),lt=it("#VALUE!"),at=it("#DIV/0!"),ft=it("#NUM!"),ht=it("#N/A"),mt=it("#REF!"),dt=it("#NAME?"),gt=it("#CIRC!"),pt=it("#ERROR!"),wt=/^-?(?:0|[1-9]\d{0,14})(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Mt(t){if(""===t)return null;if("'"===t[0])return t.slice(1);if(wt.test(t))return Number(t);const n=t.toUpperCase();return"TRUE"===n||"FALSE"!==n&&t}function bt(t){return ut(t)?0===t.rows||0===t.cols?null:t.at(0,0):t}function yt(t){if(null===t)return 0;if("number"==typeof t)return t;if("boolean"==typeof t)return t?1:0;if(t instanceof ct)return t;if(""===t.trim())return lt;const n=st(t);return n?n.value:lt}function At(t){return null===t?"":"number"==typeof t?X(t):"boolean"==typeof t?t?"TRUE":"FALSE":t instanceof ct?t.code:t}function Et(t){if(null===t)return!1;if("boolean"==typeof t)return t;if("number"==typeof t)return 0!==t;if(t instanceof ct)return t;const n=t.toUpperCase();return"TRUE"===n||"FALSE"!==n&&lt}function Nt(t,n){const e=t=>"number"==typeof t?0:"string"==typeof t?1:"boolean"==typeof t?2:3,r=null===t?"string"==typeof n?"":"boolean"!=typeof n&&0:t,o=null===n?"string"==typeof t?"":"boolean"!=typeof t&&0:n,s=e(r),c=e(o);if(s!==c)return s-c;if("number"==typeof r)return r-o;if("string"==typeof r){const t=r.toLowerCase(),n=o.toLowerCase();return t<n?-1:t>n?1:0}return"boolean"==typeof r?Number(r)-Number(o):0}function vt(t,n,e){if(n instanceof ct)return n;if(e instanceof ct)return e;switch(t){case"&":return At(n)+At(e);case"=":return 0===Nt(n,e);case"<>":return 0!==Nt(n,e);case"<":return Nt(n,e)<0;case">":return Nt(n,e)>0;case"<=":return Nt(n,e)<=0;case">=":return Nt(n,e)>=0}const r=yt(n),o=yt(e);if(r instanceof ct)return r;if(o instanceof ct)return o;switch(t){case"+":return r+o;case"-":return r-o;case"*":return r*o;case"/":return 0===o?at:r/o;case"^":{const t=r**o;return Number.isFinite(t)?t:ft}}return lt}function Ct(t,n,e){return{rows:t,cols:n,at:e}}function xt(t,n,e){if(!ut(t)&&!ut(n))return e(t,n);const r=Math.max(ut(t)?t.rows:1,ut(n)?n.rows:1),o=Math.max(ut(t)?t.cols:1,ut(n)?n.cols:1),s=(t,n,e)=>{if(!ut(t))return t;const r=1===t.rows?0:n,o=1===t.cols?0:e;return r<t.rows&&o<t.cols?t.at(r,o):ht};return Ct(r,o,(r,o)=>e(s(t,r,o),s(n,r,o)))}function Tt(t,n){if(ut(t))for(let e=0;e<t.rows;e++)for(let r=0;r<t.cols;r++)n(t.at(e,r),!0);else n(t,!1)}function $t(t){const n=[];let e=null;for(const r of t)Tt(r,(t,r)=>{if(e)return;if(t instanceof ct)return void(e=t);if("number"==typeof t)return void n.push(t);if(r||null===t)return;const o=yt(t);o instanceof ct?e=o:n.push(o)});return e??n}function Rt(t){return t.replace(/[.+^${}()|[\]\\]/g,"\\$&")}function St(t){let n="";for(let e=0;e<t.length;e++){const r=t[e];"~"===r&&e+1<t.length?n+=Rt(t[++e]):n+="*"===r?"[\\s\\S]*":"?"===r?"[\\s\\S]":Rt(r)}return new RegExp(`^${n}$`,"i")}var Ot=(t,n)=>{if(void 0===t)return n??lt;const e=bt(t);return null===e&&void 0!==n?n:yt(e)},Ut=t=>{if(void 0===t)return lt;const n=bt(t);return n instanceof ct?n:At(n)},It=t=>n=>{const e=Ot(n[0]);if(e instanceof ct)return e;const r=t(e);return Number.isFinite(r)?r:ft},Lt=t=>n=>{const e=$t(n);return e instanceof ct?e:t(e)};var Dt=t=>n=>{const e=Ot(n[0]),r=Ot(n[1],0);if(e instanceof ct)return e;if(r instanceof ct)return r;return(e<0?-1:1)*function(t,n,e){const r=10**n;return e(Number((t*r).toPrecision(15)))/r}(Math.abs(e),Math.trunc(r),t)};function Ft(t,n){const e=t.length;if(e<(n?2:1))return at;const r=t.reduce((t,n)=>t+n,0)/e;return t.reduce((t,n)=>t+(n-r)**2,0)/(n?e-1:e)}function kt(t){return ut(t)?t:Ct(1,1,()=>t)}function Pt(t,n){const e=n??t[0][0];for(const[n]of t)if(n.rows!==e.rows||n.cols!==e.cols)return lt;const r=t.map(([,t])=>function(t){if("string"!=typeof t)return n=>null===t?null===n:null!==n&&0===Nt(n,t);const n=/^(<=|>=|<>|=|<|>)?([\s\S]*)$/.exec(t),e=n[1]??"=",r=n[2],o=st(r);if(o){const t=o.value;return n=>{const r="number"==typeof n;switch(e){case"=":return r&&n===t;case"<>":return!(r&&n===t);case"<":return r&&n<t;case">":return r&&n>t;case"<=":return r&&n<=t;default:return r&&n>=t}}}if("="===e||"<>"===e){if(""===r)return t=>"="===e?null===t||""===t:null!==t&&""!==t;const t=St(r);return n=>{const r=null!==n&&!(n instanceof ct)&&t.test(At(n));return"="===e?r:!r}}return t=>{if("string"!=typeof t)return!1;const n=Nt(t,r);return"<"===e?n<0:">"===e?n>0:"<="===e?n<=0:n>=0}}(t)),o=[];for(let n=0;n<e.rows;n++)for(let s=0;s<e.cols;s++)t.every(([t],e)=>r[e](t.at(n,s)))&&o.push(e.at(n,s));return o}function Vt(t){let n=0;for(const e of t){if(e instanceof ct)return e;"number"==typeof e&&(n+=e)}return n}function zt(t){let n=0,e=0;for(const r of t){if(r instanceof ct)return r;"number"==typeof r&&(n+=r,e++)}return e?n/e:at}function Gt(t,n){if((t.length-n)%2!=0||t.length-n<2)return lt;const e=[];for(let r=n;r<t.length;r+=2){const n=bt(t[r+1]);if(n instanceof ct)return n;e.push([kt(t[r]),n])}return e}function Wt(t,n,e,r=!1){const o=Math.max(n.rows,n.cols),s=t=>n.rows>=n.cols?n.at(t,0):n.at(0,t);if(0===e){const n=r&&"string"==typeof t?St(t):null;for(let e=0;e<o;e++){const r=s(e);if(n?"string"==typeof r&&n.test(r):null!==r&&!(r instanceof ct)&&0===Nt(r,t))return e}return-1}let c=-1;for(let n=0;n<o;n++){const r=s(n);if(null===r||r instanceof ct||typeof r!=typeof t)continue;const o=Nt(r,t);(1===e?o<=0:o>=0)&&(-1===c||(1===e?Nt(r,s(c))>0:Nt(r,s(c))<0))&&(c=n)}return c}function jt(t,n){const e=bt(t[0]);if(e instanceof ct)return e;if(void 0===t[1])return lt;const r=kt(t[1]),o=Ot(t[2]);if(o instanceof ct)return o;const s=void 0===t[3]||null===t[3]||Et(bt(t[3]));if(s instanceof ct)return s;const c=Math.trunc(o)-1,u=n?r.cols:r.rows,i=n?r.rows:r.cols;if(c<0)return lt;if(c>=i)return mt;const l=Wt(e,n?Ct(1,u,(t,n)=>r.at(0,n)):Ct(u,1,t=>r.at(t,0)),s?1:0,!s);return-1===l?ht:n?r.at(c,l):r.at(l,c)}function Ht(){const t=new Date;return F(t.getFullYear(),t.getMonth()+1,t.getDate())+(3600*t.getHours()+60*t.getMinutes()+t.getSeconds())/86400}var Kt=t=>n=>{const e=Ot(n[0]);return e instanceof ct?e:e<0?ft:t(k(e))};function Xt(t,n){const e=k(t),r=12*e.year+(e.month-1)+n;return{year:Math.floor(r/12),month:(r%12+12)%12+1,day:e.day}}function Zt(t,n){return new Date(Date.UTC(t,n,0)).getUTCDate()}var Yt=[!0,!1,!1,!1,!1,!1,!0],_t={1:[6,0],2:[0,1],3:[1,2],4:[2,3],5:[3,4],6:[4,5],7:[5,6],11:[0],12:[1],13:[2],14:[3],15:[4],16:[5],17:[6]};function Bt(t){const n=void 0===t?null:bt(t);if(n instanceof ct)return n;if(null===n)return Yt;if("string"==typeof n&&/^[01]{7}$/.test(n))return"1111111"===n?lt:["1"===n[6],...[...n.slice(0,6)].map(t=>"1"===t)];if("string"==typeof n&&!st(n))return lt;const e=yt(n);if(e instanceof ct)return e;const r=_t[Math.trunc(e)];return r?[0,1,2,3,4,5,6].map(t=>r.includes(t)):ft}var Qt=(t,n)=>n[k(t).weekday];function Jt(t){const n=new Set;if(void 0===t)return n;let e=null;return Tt(t,t=>{t instanceof ct?e??=t:"number"==typeof t&&n.add(Math.trunc(t))}),e??n}function qt(t,n,e){const r=Ot(t[0]),o=Ot(t[1]);if(r instanceof ct)return r;if(o instanceof ct)return o;if(n instanceof ct)return n;const s=Jt(e);if(s instanceof ct)return s;const c=Math.trunc(Math.min(r,o)),u=Math.trunc(Math.max(r,o));if(u-c>366e3)return ft;let i=0;for(let t=c;t<=u;t++)Qt(t,n)||s.has(t)||i++;return r<=o?i:-i}function tn(t,n,e){const r=Ot(t[0]),o=Ot(t[1]);if(r instanceof ct)return r;if(o instanceof ct)return o;if(n instanceof ct)return n;const s=Jt(e);if(s instanceof ct)return s;let c=Math.trunc(o);if(Math.abs(c)>1e6)return ft;const u=c<0?-1:1;let i=Math.trunc(r);for(;0!==c;)i+=u,Qt(i,n)||s.has(i)||(c-=u);return i<0?ft:i}var nn={1:0,2:1,11:1,12:2,13:3,14:4,15:5,16:6,17:0};function en(t){const n=Math.trunc(t),e=n+3-(k(n).weekday+6)%7,r=F(k(e).year,1,1);return Math.floor((e-r)/7)+1}var rn=t=>t%4==0&&t%100!=0||t%400==0;var on=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],sn=/^(\d{1,2}):(\d{2})(?::(\d{2}(?:\.\d+)?))?\s*([ap]m)?$/i,cn=/^([a-z]{3,9})\.?\s+(\d{1,2}),?\s+(\d{4})$/i,un=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i;function ln(t){let n=t.trim();const e=n.search(/\s\d{1,2}:\d{2}/);e>0&&sn.test(n.slice(e+1).trim())&&(n=n.slice(0,e));const r=st(n);if("date"===r?.kind)return r.value;const o=cn.exec(n)??un.exec(n);if(!o)return null;const[s,c]=cn.test(n)?[Number(o[2]),o[1]]:[Number(o[1]),o[2]],u=function(t){const n=t.toLowerCase(),e=on.indexOf(n.slice(0,3));if(-1===e)return 0;const r=new Date(Date.UTC(2e3,e,1)).toLocaleString("en",{month:"long",timeZone:"UTC"}).toLowerCase();return 3===n.length||r.startsWith(n)?e+1:0}(c),i=Number(o[3]);return!u||s<1||s>Zt(i,u)?null:F(i,u,s)}var an=(t,n)=>{const e=[];for(let r=0;r<n.length;r++){const o=Ot(t[r],n[r]);if(o instanceof ct)return o;e.push(o)}return e};function fn(t,n){if(!t.length||n<0||n>1)return ft;const e=[...t].sort((t,n)=>t-n),r=n*(e.length-1),o=Math.floor(r);return o+1<e.length?e[o]+(r-o)*(e[o+1]-e[o]):e[o]}var hn=t=>n=>{const e=Gt(n,1);if(e instanceof ct)return e;const r=Pt(e,kt(n[0]));if(r instanceof ct)return r;const o=[];for(const t of r){if(t instanceof ct)return t;"number"==typeof t&&o.push(t)}return o.length?t(o):0},mn=t=>{if(void 0===t)return lt;const n=bt(t);return n instanceof ct?n:null===n?"":"string"==typeof n?n:lt};function dn(t,n){let e=n?"g":"",r=t;const o=/^\(\?([ims]+)\)/.exec(r);if(o){for(const t of new Set(o[1]))e+=t;r=r.slice(o[0].length)}try{return new RegExp(r,e)}catch{return lt}}function gn(t,n){const e=bt(t[0]??null);if("boolean"==typeof e)return lt;const r=yt(e);return r instanceof ct?r:Math.abs(Math.trunc(r))%2===n}var pn=["AVERAGE","COUNT","COUNTA","MAX","MIN","PRODUCT","STDEV","STDEVP","SUM","VAR","VARP"],wn=/^=\s*SUBTOTAL\s*\(/i,Mn={SUM:Lt(t=>t.reduce((t,n)=>t+n,0)),AVERAGE:Lt(t=>t.length?t.reduce((t,n)=>t+n,0)/t.length:at),MIN:Lt(t=>t.length?Math.min(...t):0),MAX:Lt(t=>t.length?Math.max(...t):0),PRODUCT:Lt(t=>t.length?t.reduce((t,n)=>t*n,1):0),MEDIAN:Lt(t=>{if(!t.length)return ft;const n=[...t].sort((t,n)=>t-n),e=Math.floor(n.length/2);return n.length%2?n[e]:(n[e-1]+n[e])/2}),MODE:Lt(t=>{const n=new Map;let e=null,r=1;for(const o of t){const t=(n.get(o)??0)+1;n.set(o,t),t>r&&(r=t,e=o)}return e??ht}),STDEV:Lt(t=>{const n=Ft(t,!0);return n instanceof ct?n:Math.sqrt(n)}),STDEVP:Lt(t=>{const n=Ft(t,!1);return n instanceof ct?n:Math.sqrt(n)}),VAR:Lt(t=>Ft(t,!0)),VARP:Lt(t=>Ft(t,!1)),COUNT:t=>{let n=0;for(const e of t)Tt(e,(t,e)=>{"number"==typeof t?n++:e||"boolean"!=typeof t?!e&&"string"==typeof t&&st(t)&&n++:n++});return n},COUNTA:t=>{let n=0;for(const e of t)Tt(e,t=>{null!==t&&n++});return n},COUNTBLANK:t=>{let n=0;for(const e of t)Tt(e,t=>{null!==t&&""!==t||n++});return n},ABS:It(Math.abs),INT:It(Math.floor),TRUNC:Dt(Math.floor),ROUND:Dt(Math.round),ROUNDUP:Dt(Math.ceil),ROUNDDOWN:Dt(Math.floor),SIGN:It(Math.sign),SQRT:It(Math.sqrt),EXP:It(Math.exp),LN:It(Math.log),LOG10:It(Math.log10),SIN:It(Math.sin),COS:It(Math.cos),TAN:It(Math.tan),LOG:t=>{const n=Ot(t[0]),e=Ot(t[1],10);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=Math.log(n)/Math.log(e);return Number.isFinite(r)?r:ft},MOD:t=>{const n=Ot(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:0===e?at:n-e*Math.floor(n/e)},POWER:t=>vt("^",bt(t[0]??null),bt(t[1]??null)),PI:()=>Math.PI,RAND:()=>Math.random(),RANDBETWEEN:t=>{const n=Ot(t[0]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=Math.ceil(n),o=Math.floor(e);return r>o?ft:r+Math.floor(Math.random()*(o-r+1))},CEILING:t=>{const n=Ot(t[0]),e=Ot(t[1],1);return n instanceof ct?n:e instanceof ct?e:0===e?0:Math.ceil(Number((n/e).toPrecision(15)))*e},FLOOR:t=>{const n=Ot(t[0]),e=Ot(t[1],1);return n instanceof ct?n:e instanceof ct?e:0===e?at:Math.floor(Number((n/e).toPrecision(15)))*e},MROUND:t=>{const n=Ot(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:0===e||0===n?0:Math.sign(n)!==Math.sign(e)?ft:Math.sign(n)*Math.round(Number(Math.abs(n/e).toPrecision(15)))*Math.abs(e)},QUOTIENT:t=>{const n=Ot(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:0===e?at:Math.trunc(n/e)},SUMIF:t=>{const n=bt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[kt(t[0]),n]],void 0!==t[2]?kt(t[2]):null);return e instanceof ct?e:Vt(e)},SUMIFS:t=>{const n=Gt(t,1);if(n instanceof ct)return n;const e=Pt(n,kt(t[0]));return e instanceof ct?e:Vt(e)},AVERAGEIF:t=>{const n=bt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[kt(t[0]),n]],void 0!==t[2]?kt(t[2]):null);return e instanceof ct?e:zt(e)},AVERAGEIFS:t=>{const n=Gt(t,1);if(n instanceof ct)return n;const e=Pt(n,kt(t[0]));return e instanceof ct?e:zt(e)},COUNTIF:t=>{const n=bt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[kt(t[0]),n]],null);return e instanceof ct?e:e.length},COUNTIFS:t=>{const n=Gt(t,0);if(n instanceof ct)return n;const e=Pt(n,null);return e instanceof ct?e:e.length},MAXIFS:hn(t=>Math.max(...t)),MINIFS:hn(t=>Math.min(...t)),SUBTOTAL:(t,n)=>{const e=Ot(t[0]);if(e instanceof ct)return e;const r=Math.trunc(e),o=pn[(r>100?r-100:r)-1];if(!o||r>11&&r<101)return lt;const s=t.slice(1).map(t=>{if(!ut(t)||!t.raw)return t;const n=t.raw.bind(t);return Ct(t.rows,t.cols,(e,r)=>wn.test(n(e,r))?null:t.at(e,r))});return s.length?Mn[o](s,n):lt},SUMPRODUCT:t=>{if(!t.length)return lt;const n=t.map(kt),{rows:e,cols:r}=n[0];if(n.some(t=>t.rows!==e||t.cols!==r))return lt;let o=0;for(let t=0;t<e;t++)for(let e=0;e<r;e++){let r=1;for(const o of n){const s=o.at(t,e);if(s instanceof ct)return s;r*="number"==typeof s?s:"boolean"==typeof s&&1===n.length?Number(s):0}o+=r}return o},LARGE:t=>{const n=$t([t[0]??null]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[...n].sort((t,n)=>n-t);return e<1||e>r.length?ft:r[Math.trunc(e)-1]},SMALL:t=>{const n=$t([t[0]??null]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[...n].sort((t,n)=>t-n);return e<1||e>r.length?ft:r[Math.trunc(e)-1]},RANK:t=>{const n=Ot(t[0]),e=$t([t[1]??null]),r=Ot(t[2],0);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:e.includes(n)?1+e.filter(t=>r?t<n:t>n).length:ht},PERCENTILE:t=>{const n=$t([t[0]??null]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:fn(n,e)},QUARTILE:t=>{const n=$t([t[0]??null]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=Math.trunc(e);return r<0||r>4?ft:fn(n,r/4)},AND:t=>{let n=!1,e=!0,r=null;for(const o of t)Tt(o,(t,o)=>{if(r)return;if(o&&"string"==typeof t)return;if(null===t)return;const s=Et(t);s instanceof ct?r=s:(n=!0,s||(e=!1))});return r??(n?e:lt)},OR:t=>{let n=!1,e=!1,r=null;for(const o of t)Tt(o,(t,o)=>{if(r)return;if(o&&"string"==typeof t)return;if(null===t)return;const s=Et(t);s instanceof ct?r=s:(n=!0,s&&(e=!0))});return r??(n?e:lt)},XOR:t=>{let n=!1,e=null;for(const r of t)Tt(r,t=>{if(e||null===t)return;const r=Et(t);r instanceof ct?e=r:r&&(n=!n)});return e??n},NOT:t=>{const n=Et(bt(t[0]??null));return n instanceof ct?n:!n},TRUE:()=>!0,FALSE:()=>!1,CONCAT:t=>{let n="",e=null;for(const r of t)Tt(r,t=>{t instanceof ct?e??=t:n+=At(t)});return e??n},TEXTJOIN:t=>{const n=Ut(t[0]),e=Et(bt(t[1]??null));if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[];let o=null;for(const n of t.slice(2))Tt(n,t=>{if(t instanceof ct)return void(o??=t);const n=At(t);e&&""===n||r.push(n)});return o??r.join(n)},LEFT:t=>{const n=Ut(t[0]),e=Ot(t[1],1);return n instanceof ct?n:e instanceof ct?e:e<0?lt:n.slice(0,Math.trunc(e))},RIGHT:t=>{const n=Ut(t[0]),e=Ot(t[1],1);return n instanceof ct?n:e instanceof ct?e:e<0?lt:0===Math.trunc(e)?"":n.slice(-Math.trunc(e))},MID:t=>{const n=Ut(t[0]),e=Ot(t[1]),r=Ot(t[2]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:e<1||r<0?lt:n.slice(Math.trunc(e)-1,Math.trunc(e)-1+Math.trunc(r))},LEN:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.length},LOWER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toLowerCase()},UPPER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toUpperCase()},PROPER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toLowerCase().replace(/(^|[^\p{L}])(\p{L})/gu,(t,n,e)=>n+e.toUpperCase())},TRIM:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.trim().replace(/ +/g," ")},REPT:t=>{const n=Ut(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:e<0||n.length*e>32767?lt:n.repeat(Math.trunc(e))},EXACT:t=>{const n=Ut(t[0]),e=Ut(t[1]);return n instanceof ct?n:e instanceof ct?e:n===e},SUBSTITUTE:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Ut(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;if(""===e)return n;if(void 0===t[3])return n.split(e).join(r);const o=Ot(t[3]);if(o instanceof ct)return o;let s=-1;for(let t=0;t<o;t++)if(s=n.indexOf(e,s+1),-1===s)return n;return n.slice(0,s)+r+n.slice(s+e.length)},REPLACE:t=>{const n=Ut(t[0]),e=Ot(t[1]),r=Ot(t[2]),o=Ut(t[3]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:o instanceof ct?o:e<1||r<0?lt:n.slice(0,e-1)+o+n.slice(e-1+r)},FIND:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Ot(t[2],1);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=e.indexOf(n,r-1);return-1===o?lt:o+1},SEARCH:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Ot(t[2],1);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=new RegExp(St(n).source.slice(1,-1),"i").exec(e.slice(r-1));return o?o.index+r:lt},TEXT:t=>{const n=bt(t[0]??null),e=Ut(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r="string"==typeof n?st(n)?.value??null:null===n?0:"boolean"==typeof n?null:n;return null===r?_(At(n),e):Y(r,e).text},VALUE:t=>{const n=bt(t[0]??null);return n instanceof ct||"number"==typeof n?n:st(At(n))?.value??lt},CHAR:t=>{const n=Ot(t[0]);if(n instanceof ct)return n;const e=Math.trunc(n);return e<1||e>1114111||e>=55296&&e<=57343?lt:String.fromCodePoint(e)},CODE:t=>{const n=Ut(t[0]);return n instanceof ct?n:""===n?lt:n.codePointAt(0)},CLEAN:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.replace(/[\x00-\x1f]/g,"")},REGEXMATCH:t=>{const n=mn(t[0]),e=mn(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=dn(e,!1);return r instanceof ct?r:r.test(n)},REGEXEXTRACT:t=>{const n=mn(t[0]),e=mn(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=dn(e,!1);if(r instanceof ct)return r;const o=r.exec(n);if(!o)return ht;if(1===o.length)return o[0];const s=o.slice(1).map(t=>t??"");return 1===s.length?s[0]:Ct(1,s.length,(t,n)=>s[n])},REGEXREPLACE:t=>{const n=mn(t[0]),e=mn(t[1]),r=mn(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=dn(e,!0);return o instanceof ct?o:n.replace(o,r)},VLOOKUP:t=>jt(t,!1),HLOOKUP:t=>jt(t,!0),XLOOKUP:t=>{const n=bt(t[0]??null);if(n instanceof ct)return n;if(void 0===t[1]||void 0===t[2])return lt;const e=kt(t[1]),r=kt(t[2]),o=Ot(t[4],0);if(o instanceof ct)return o;const s=Wt(n,e,1===o?-1:-1===o?1:0,2===o);return-1===s?void 0!==t[3]&&null!==bt(t[3])?bt(t[3]):ht:e.rows>=e.cols?r.at(s,0):r.at(0,s)},MATCH:t=>{const n=bt(t[0]??null);if(n instanceof ct)return n;if(void 0===t[1])return lt;const e=kt(t[1]),r=Ot(t[2],1);if(r instanceof ct)return r;if(e.rows>1&&e.cols>1)return ht;const o=Wt(n,e,0===r?0:r<0?-1:1,0===r);return-1===o?ht:o+1},INDEX:t=>{if(void 0===t[0])return lt;const n=kt(t[0]),e=Ot(t[1],0),r=Ot(t[2],1===n.rows&&void 0===t[2]?0:1);if(e instanceof ct)return e;if(r instanceof ct)return r;const[o,s]=1===n.rows&&void 0===t[2]?[1,e]:[e,r];return o<0||s<0||o>n.rows||s>n.cols?mt:0===o?Ct(n.rows,1,t=>n.at(t,Math.max(s,1)-1)):0===s?Ct(1,n.cols,(t,e)=>n.at(o-1,e)):n.at(Math.trunc(o)-1,Math.trunc(s)-1)},ROWS:t=>void 0===t[0]?lt:kt(t[0]).rows,COLUMNS:t=>void 0===t[0]?lt:kt(t[0]).cols,TODAY:()=>Math.floor(Ht()),NOW:()=>Ht(),DATE:t=>{const n=Ot(t[0]),e=Ot(t[1]),r=Ot(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=n<1900?n+1900:n;return F(o,1,1)+Math.round((Date.UTC(o,e-1,r)-Date.UTC(o,0,1))/864e5)},TIME:t=>{const n=Ot(t[0]),e=Ot(t[1]),r=Ot(t[2]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:(3600*n+60*e+r)/86400%1},YEAR:Kt(t=>t.year),MONTH:Kt(t=>t.month),DAY:Kt(t=>t.day),HOUR:Kt(t=>t.hours),MINUTE:Kt(t=>t.minutes),SECOND:Kt(t=>t.seconds),WEEKDAY:t=>{const n=Ot(t[0]),e=Ot(t[1],1);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=k(n).weekday;return 1===e?r+1:2===e?(r+6)%7+1:3===e?(r+6)%7:ft},EDATE:t=>{const n=Ot(t[0]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const{year:r,month:o,day:s}=Xt(n,Math.trunc(e));return F(r,o,Math.min(s,Zt(r,o)))},EOMONTH:t=>{const n=Ot(t[0]),e=Ot(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const{year:r,month:o}=Xt(n,Math.trunc(e));return F(r,o,Zt(r,o))},DAYS:t=>{const n=Ot(t[0]),e=Ot(t[1]);return n instanceof ct?n:e instanceof ct?e:Math.trunc(n)-Math.trunc(e)},DATEDIF:t=>{const n=Ot(t[0]),e=Ot(t[1]),r=Ut(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;if(n>e)return ft;const o=k(n),s=k(e),c=12*(s.year-o.year)+(s.month-o.month)-(s.day<o.day?1:0);switch(r.toUpperCase()){case"D":return Math.trunc(e)-Math.trunc(n);case"M":return c;case"Y":return Math.floor(c/12);default:return ft}},NETWORKDAYS:t=>qt(t,Yt,t[2]),"NETWORKDAYS.INTL":t=>qt(t,Bt(t[2]),t[3]),WORKDAY:t=>tn(t,Yt,t[2]),"WORKDAY.INTL":t=>tn(t,Bt(t[2]),t[3]),WEEKNUM:t=>{const n=Ot(t[0]),e=Ot(t[1],1);if(n instanceof ct)return n;if(e instanceof ct)return e;if(n<0)return ft;const r=Math.trunc(e);if(21===r)return en(n);const o=nn[r];if(void 0===o)return ft;const s=Math.trunc(n),c=F(k(s).year,1,1),u=(k(c).weekday-o+7)%7;return Math.floor((s-c+u)/7)+1},ISOWEEKNUM:t=>{const n=Ot(t[0]);return n instanceof ct?n:n<0?ft:en(n)},YEARFRAC:t=>{const n=Ot(t[0]),e=Ot(t[1]),r=Ot(t[2],0);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:n<0||e<0?ft:function(t,n,e){const[r,o]=t<=n?[Math.trunc(t),Math.trunc(n)]:[Math.trunc(n),Math.trunc(t)],s=k(r),c=k(o),u=(t,n)=>(360*(c.year-s.year)+30*(c.month-s.month)+(n-t))/360;switch(e){case 0:{let t=s.day,n=c.day;const e=t=>2===t.month&&t.day===Zt(t.year,2);return 31===t&&31===n?(t=30,n=30):31===t?t=30:30===t&&31===n?n=30:e(s)&&e(c)?(t=30,n=30):e(s)&&(t=30),u(t,n)}case 1:if(s.year===c.year||c.year===s.year+1&&(s.month>c.month||s.month===c.month&&s.day>=c.day)){let t=!1;if(s.year===c.year)t=rn(s.year);else for(const n of[s.year,c.year]){if(!rn(n))continue;const e=F(n,2,29);e>=r&&e<=o&&(t=!0)}return(o-r)/(t?366:365)}return(o-r)/((F(c.year+1,1,1)-F(s.year,1,1))/(c.year-s.year+1));case 2:return(o-r)/360;case 3:return(o-r)/365;case 4:return u(Math.min(s.day,30),Math.min(c.day,30));default:return ft}}(n,e,Math.trunc(r))},DATEVALUE:t=>{const n=mn(t[0]);return n instanceof ct?n:ln(n)??lt},TIMEVALUE:t=>{const n=mn(t[0]);return n instanceof ct?n:function(t){const n=t.trim(),e=n.search(/\d{1,2}:\d{2}/);if(-1===e)return null;if(e>0&&null===ln(n.slice(0,e)))return null;const r=sn.exec(n.slice(e));if(!r)return null;let o=Number(r[1]);const s=Number(r[2]),c=Number(r[3]??0);if(s>59||c>=60)return null;if(r[4]){if(o<1||o>12)return null;o=o%12+("pm"===r[4].toLowerCase()?12:0)}return(3600*o+60*s+c)/86400%1}(n)??lt},ISBLANK:t=>null===bt(t[0]??null),ISNUMBER:t=>"number"==typeof bt(t[0]??null),ISTEXT:t=>"string"==typeof bt(t[0]??null),ISLOGICAL:t=>"boolean"==typeof bt(t[0]??null),ISERROR:t=>bt(t[0]??null)instanceof ct,ISNA:t=>{const n=bt(t[0]??null);return n instanceof ct&&"#N/A"===n.code},ISERR:t=>{const n=bt(t[0]??null);return n instanceof ct&&"#N/A"!==n.code},ISEVEN:t=>gn(t,0),ISODD:t=>gn(t,1),N:t=>{const n=bt(t[0]??null);return n instanceof ct||"number"==typeof n?n:"boolean"==typeof n?Number(n):0},NA:()=>ht,PMT:t=>{const n=an(t,[void 0,void 0,void 0,0,0]);return n instanceof ct?n:0===n[1]?ft:function(t,n,e,r,o){if(0===t)return-(e+r)/n;const s=(1+t)**n;return-t*(e*s+r)/((s-1)*(1+t*o))}(n[0],n[1],n[2],n[3],n[4])},FV:t=>{const n=an(t,[void 0,void 0,void 0,0,0]);if(n instanceof ct)return n;const[e,r,o,s,c]=n;if(0===e)return-(s+o*r);const u=(1+e)**r;return-(s*u+o*(1+e*c)*(u-1)/e)},PV:t=>{const n=an(t,[void 0,void 0,void 0,0,0]);if(n instanceof ct)return n;const[e,r,o,s,c]=n;if(0===e)return-(s+o*r);const u=(1+e)**r;return-(s+o*(1+e*c)*(u-1)/e)/u},NPV:t=>{const n=Ot(t[0]),e=$t(t.slice(1));return n instanceof ct?n:e instanceof ct?e:e.reduce((t,e,r)=>t+e/(1+n)**(r+1),0)}};Mn.CONCATENATE=Mn.CONCAT,Mn["STDEV.S"]=Mn.STDEV,Mn["STDEV.P"]=Mn.STDEVP,Mn["VAR.S"]=Mn.VAR,Mn["VAR.P"]=Mn.VARP,Mn["CEILING.MATH"]=Mn.CEILING,Mn["FLOOR.MATH"]=Mn.FLOOR,Mn["MODE.SNGL"]=Mn.MODE,Mn["RANK.EQ"]=Mn.RANK,Mn["PERCENTILE.INC"]=Mn.PERCENTILE,Mn["QUARTILE.INC"]=Mn.QUARTILE;var bn={IF:(t,n)=>{if(t.length<2)return lt;const e=Et(bt(n(t[0])));return e instanceof ct?e:e?n(t[1]):t.length>2&&n(t[2])},IFS:(t,n)=>{if(t.length<2||t.length%2)return lt;for(let e=0;e<t.length;e+=2){const r=Et(bt(n(t[e])));if(r instanceof ct)return r;if(r)return n(t[e+1])}return ht},IFERROR:(t,n)=>{if(t.length<1)return lt;const e=bt(n(t[0]));return e instanceof ct?t[1]?n(t[1]):"":e},IFNA:(t,n)=>{if(t.length<1)return lt;const e=bt(n(t[0]));return e instanceof ct&&"#N/A"===e.code?t[1]?n(t[1]):"":e},SWITCH:(t,n)=>{if(t.length<3)return lt;const e=bt(n(t[0]));if(e instanceof ct)return e;let r=1;for(;r+1<t.length;r+=2){const o=bt(n(t[r]));if(o instanceof ct)return o;if(0===Nt(e,o))return n(t[r+1])}return r<t.length?n(t[r]):ht},CHOOSE:(t,n)=>{if(t.length<2)return lt;const e=yt(bt(n(t[0])));if(e instanceof ct)return e;const r=Math.trunc(e);return r<1||r>=t.length?lt:n(t[r])},ROW:(t,n,e)=>t.length?"ref"===t[0].kind&&null!==t[0].ref.a.row?t[0].ref.a.row+1:lt:e.row+1,COLUMN:(t,n,e)=>t.length?"ref"===t[0].kind&&null!==t[0].ref.a.col?t[0].ref.a.col+1:lt:e.col+1},yn=[...new Set([...Object.keys(Mn),...Object.keys(bn)])].filter(t=>"TRUE"!==t&&"FALSE"!==t).sort();function An(t){const n=t.map(()=>new Map),e=t.map(()=>new Set),r=new Map(t.map((t,n)=>[t.name.toLowerCase(),n]));let o=0;const s=(r,s,c)=>{const i=t[r]?.cells[s]?.[c];if(void 0===i||""===i)return null;if(!x(i))return Mt(i);const l=((t,n)=>2e4*t+n)(s,c),f=n[r].get(l);if(void 0!==f)return f;if(e[r].has(l))return gt;let h;e[r].add(l),o++;try{const t=u(function(t){const n=C.get(t);if(n){if(n instanceof a)throw n;return n}let e;try{const{tokens:n,complete:r}=E(t.slice(1));if(!r)throw new a("Unreadable text");e=new v(n).run()}catch(t){if(!(t instanceof a))throw t;e=t}if(C.size>=2e4&&C.clear(),C.set(t,e),e instanceof a)throw e;return e}(i),{sheet:r,row:s,col:c});h=bt(t),null===h&&(h=0)}catch(t){if(!(t instanceof a)){if(!(t instanceof RangeError)||o>1)throw t;return gt}h=pt}finally{o--,e[r].delete(l)}return n[r].set(l,h),h},c=(n,e)=>{let o=e.sheet;if(null!==n.sheet){const t=r.get(n.sheet.toLowerCase());if(void 0===t)return mt;o=t}const c=n.b??n.a;if(null===n.b)return s(o,n.a.row,n.a.col);const u=Math.min(n.a.row??0,c.row??0),i=Math.min(n.a.col??0,c.col??0),l=null===n.a.row?(n=>t[n].cells.length)(o)-1:Math.max(n.a.row,c.row),a=null===n.a.col?(n=>t[n].cells.reduce((t,n)=>Math.max(t,n.length),0))(o)-1:Math.max(n.a.col,c.col);return{...Ct(Math.max(0,l-u+1),Math.max(0,a-i+1),(t,n)=>s(o,u+t,i+n)),raw:(n,e)=>t[o].cells[u+n]?.[i+e]??""}},u=(t,n)=>{switch(t.kind){case"num":case"str":case"bool":return t.value;case"err":return it(t.value);case"empty":return null;case"ref":return c(t.ref,n);case"unary":return xt(u(t.arg,n),null,n=>{const e=n instanceof ct?n:yt(n);return e instanceof ct?e:"-"===t.op?-e:e});case"percent":return xt(u(t.arg,n),100,(t,n)=>vt("/",t,n));case"binary":return xt(u(t.left,n),u(t.right,n),(n,e)=>vt(t.op,n,e));case"call":{const e=bn[t.name];if(e)return e(t.args,t=>u(t,n),n);const r=Mn[t.name];return r?r(t.args.map(t=>u(t,n)),n):dt}}};let i=!1;return{value:(n,e,r)=>t[n]?(i||(i=!0,t.forEach((t,n)=>{t.cells.forEach((t,e)=>t.forEach((t,r)=>{x(t)&&s(n,e,r)}));for(let e=t.cells.length-1;e>=0;e--){const r=t.cells[e];for(let t=r.length-1;t>=0;t--)x(r[t])&&s(n,e,t)}})),s(n,e,r)):null}}var En=100,Nn=24,vn=10;function Cn(t,n=[]){return{id:crypto.randomUUID(),name:t,rowCount:Math.max(1e3,n.length+100),colCount:Math.max(26,n.reduce((t,n)=>Math.max(t,n.length),0)),cells:n,formats:{},colWidths:{},rowHeights:{},hiddenRows:[],hiddenCols:[],merges:[],frozenRows:0,frozenCols:0,filter:null}}var xn=(t,n)=>`${t}:${n}`,Tn=(t,n,e)=>t.cells[n]?.[e]??"";function $n(t,n){const e=new Set(t.map(t=>t.name.toLowerCase()));for(let r=t.length+1;;r++){const t=`${n} ${r}`;if(!e.has(t.toLowerCase()))return t}}function Rn(t){return An(t)}function Sn(t){let n=0,e=!1;for(const r of t)'"'===r?e=!e:e||"("!==r?e||")"!==r||n--:n++;return!e&&n>0?t+")".repeat(n):t}function On(t,n){if(x(t))return{raw:Sn(t),numFmt:null};if(""===t||"'"===t[0])return{raw:t,numFmt:null};if("@"===n?.numFmt)return{raw:`'${t}`,numFmt:null};const e=st(t);return e?{raw:String(e.value),numFmt:e.format}:{raw:t,numFmt:null}}function Un(t,n){if(x(t)||""===t)return t;const e=Mt(t);if("number"!=typeof e||!n?.numFmt)return t;if(G(n.numFmt)){const t=k(e),n=`${t.year}-${U(t.month)}-${U(t.day)}`;return Number.isInteger(e)?n:`${n} ${U(t.hours)}:${U(t.minutes)}:${U(t.seconds)}`}return/%/.test(n.numFmt)?`${X(100*e)}%`:t}var In={text:"",color:null,align:"left",error:!1};function Ln(t,n,e,r,o){const s=Tn(t,r,o);return""===s?In:function(t,n,e){if(null===t)return In;if(t instanceof ct)return{text:t.code,color:null,align:"center",error:!0};if("boolean"==typeof t)return{text:t?"TRUE":"FALSE",color:null,align:"center",error:!1};const r=e?.numFmt;if("number"==typeof t){if(!(r&&"General"!==r||x(n)))return{text:n,color:null,align:"right",error:!1};const{text:e,color:o}=Y(t,r??"General");return{text:e,color:o,align:"right",error:!1}}return{text:r?_(t,r):t,color:null,align:"left",error:!1}}(e.value(n,r,o),s,t.formats[xn(r,o)])}function Dn(t){let n=-1,e=-1;return t.cells.forEach((t,r)=>{for(let o=t.length-1;o>=0;o--)if(""!==t[o]){n=Math.max(n,r),e=Math.max(e,o);break}}),n<0?null:{row:n,col:e}}function Fn(t,n){if(!n.length)return t;const e=[...t.cells],r=new Set;let o=t.rowCount,s=t.colCount;for(const{row:t,col:c,raw:u}of n)if(""!==u||""!==(e[t]?.[c]??"")){for(;e.length<=t;)e.push([]);for(r.has(t)||(e[t]=[...e[t]],r.add(t));e[t].length<=c;)e[t].push("");e[t][c]=u,o=Math.max(o,t+1),s=Math.max(s,c+1)}return{...t,cells:e,rowCount:o,colCount:s}}function kn(t,n,e,r){const o=xn(n,e),s=t.formats[o],{raw:c,numFmt:u}=On(r,s),i=Fn(t,[{row:n,col:e,raw:c}]);return!u||s?.numFmt&&"General"!==s.numFmt?i:{...i,formats:{...i.formats,[o]:{...s,numFmt:u}}}}function Pn(t,n){for(let e=t.r1;e<=t.r2;e++)for(let r=t.c1;r<=t.c2;r++)n(e,r)}function Vn(t,n){const e=[];return Pn(function(t,n){const e=Math.min(n.r2,t.cells.length-1);return{...n,r2:Math.max(e,n.r1-1)}}(t,n),(n,r)=>{""!==Tn(t,n,r)&&e.push({row:n,col:r,raw:""})}),Fn(t,e)}function zn(t,n,e){const r={...t.formats},o=(t,n)=>{const o=xn(t,n),s=e(r[o]??{});Object.keys(s).length?r[o]=s:delete r[o]};return Pn((n.r2-n.r1+1)*(n.c2-n.c1+1)>2e5?{...n,r2:Math.min(n.r2,Math.max(t.cells.length,2e3))}:n,o),{...t,formats:r}}function Gn(t,n,e){const r={...t};return void 0===e||!1===e?delete r[n]:r[n]=e,r}function Wn(t,n,e){const r={...t.formats};return Pn(n,(t,o)=>{const s=xn(t,o),c=r[s]??{},u=((t,e)=>({...t===n.r1?{top:!0}:{},...t===n.r2?{bottom:!0}:{},...e===n.c1?{left:!0}:{},...e===n.c2?{right:!0}:{}}))(t,o);let i;switch(e){case"none":i={};break;case"all":i={top:!0,right:!0,bottom:!0,left:!0};break;case"outer":i={...c.border,...u};break;default:i=u[e]?{...c.border,[e]:!0}:c.border??{}}const l=Gn(c,"border",Object.keys(i).length?i:void 0);Object.keys(l).length?r[s]=l:delete r[s]}),{...t,formats:r}}function jn(t,n,e){return t.merges.find(t=>u(t,n,e))??null}function Hn(t,n){let e=n;for(let n=!0;n;){n=!1;for(const r of t.merges){if(!i(e,r))continue;const t={r1:Math.min(e.r1,r.r1),c1:Math.min(e.c1,r.c1),r2:Math.max(e.r2,r.r2),c2:Math.max(e.c2,r.c2)};t.r1===e.r1&&t.c1===e.c1&&t.r2===e.r2&&t.c2===e.c2||(e=t,n=!0)}}return e}function Kn(t,n){if(n.r1===n.r2&&n.c1===n.c2)return t;const e=[];Pn(n,(r,o)=>{r===n.r1&&o===n.c1||""===Tn(t,r,o)||e.push({row:r,col:o,raw:""})});const r=Fn(t,e);return{...r,merges:[...r.merges.filter(t=>!i(t,n)),n]}}function Xn(t,n){return{...t,merges:t.merges.filter(t=>!i(t,n))}}function Zn(t,n,e){const r=t[n].name.toLowerCase();return t.map((t,o)=>{let s=!1;const c=t.cells.map(t=>{let c=!1;const u=t.map(t=>{if(!x(t))return t;const s=R(t,t=>(null===t.sheet?o===n:t.sheet.toLowerCase()===r)?e(t):t);return s!==t&&(c=!0),s});return c&&(s=!0),c?u:t});return s?{...t,cells:c}:t})}function Yn(t,n,e){if(e>0)return t>=n?t+e:t;const r=n-e;return t>=n&&t<r?null:t>=r?t+e:t}function _n(t,n,e){const r={};for(const[o,s]of Object.entries(t)){const t=Yn(Number(o),n,e);null!==t&&(r[t]=s)}return r}function Bn(t,n,e,r){const[o,s]="row"===n?[t.r1,t.r2]:[t.c1,t.c2];let c,u;if(r>0)c=o>=e?o+r:o,u=s>=e?s+r:s;else{const t=e-r;if(c=o<e?o:o>=t?o+r:e,u=s<e?s:s>=t?s+r:e-1,c>u)return null}return"row"===n?{...t,r1:c,r2:u}:{...t,c1:c,c2:u}}function Qn(t,n,e,r,o){const s=Zn(t,n,t=>function(t,n,e,r){const o=t=>"row"===n?t.row:t.col,s=(t,e)=>"row"===n?{...t,row:e}:{...t,col:e},c=o(t.a);if(null===c)return t;if(r>0){const n=t=>t>=e?t+r:t;return{...t,a:s(t.a,n(c)),b:t.b?s(t.b,n(o(t.b))):null}}const u=-r,i=e+u;if(!t.b)return c>=e&&c<i?null:{...t,a:s(t.a,c>=i?c-u:c)};const l=Math.min(c,o(t.b)),a=Math.max(c,o(t.b)),f=l<e?l:l>=i?l-u:e,h=a<e?a:a>=i?a-u:e-1;return f>h?null:{...t,a:s(t.a,f),b:s(t.b,h)}}(t,e,r,o));return s.map((t,s)=>{if(s!==n)return t;const c="row"===e?(()=>{const n=[...t.cells];return o>0?n.length>r&&n.splice(r,0,...Array.from({length:o},()=>[])):n.splice(r,-o),n})():t.cells.map(t=>{if(t.length<=r)return t;const n=[...t];return o>0?n.splice(r,0,...Array(o).fill("")):n.splice(r,-o),n}),u={};for(const[n,s]of Object.entries(t.formats)){const[t,c]=n.split(":").map(Number),i=Yn("row"===e?t:c,r,o);null!==i&&(u["row"===e?xn(i,c):xn(t,i)]=s)}const i=t.merges.map(t=>Bn(t,e,r,o)).filter(t=>null!==t&&(t.r1!==t.r2||t.c1!==t.c2)),l=t=>t.map(t=>Yn(t,r,o)).filter(t=>null!==t),a=t.filter?Bn(t.filter.range,e,r,o):null,f=t.filter&&a?{range:a,excluded:"col"===e?_n(t.filter.excluded,r,o):t.filter.excluded}:null,h=t=>r<t?o>0?t+o:Math.max(r,t+o):t;return{...t,cells:c,formats:u,merges:i,filter:f,rowCount:"row"===e?Math.max(1,t.rowCount+o):t.rowCount,colCount:"col"===e?Math.max(1,t.colCount+o):t.colCount,rowHeights:"row"===e?_n(t.rowHeights,r,o):t.rowHeights,colWidths:"col"===e?_n(t.colWidths,r,o):t.colWidths,hiddenRows:"row"===e?l(t.hiddenRows):t.hiddenRows,hiddenCols:"col"===e?l(t.hiddenCols):t.hiddenCols,frozenRows:"row"===e?h(t.frozenRows):t.frozenRows,frozenCols:"col"===e?h(t.frozenCols):t.frozenCols}})}function Jn(t,n,e){return Zn(t,n,t=>null===t.sheet?t:{...t,sheet:e}).map((t,r)=>r===n?{...t,name:e}:t)}function qn(t,n){return Zn(t,n,t=>null===t.sheet?t:null).filter((t,e)=>e!==n)}function te(t,n,e){const r={...t[n],id:crypto.randomUUID(),name:e};return[...t.slice(0,n+1),r,...t.slice(n+1)]}function ne(t,n,e,r,o,s){const c=[];for(let t=r.r1;t<=r.r2;t++)c.push(t);const u=new Map(c.map(t=>[t,e.value(n,t,o)])),i=[...c].sort((t,n)=>{const e=u.get(t),r=u.get(n),o=null===e||""===e,c=null===r||""===r;if(o||c)return o===c?t-n:o?1:-1;if(e instanceof ct||r instanceof ct)return e instanceof ct?1:-1;const i=Nt(e,r);return(s?i:-i)||t-n}),l=[],a={...t.formats},f=new Map;return Pn(r,(n,e)=>f.set(xn(n,e),t.formats[xn(n,e)])),i.forEach((n,e)=>{const o=r.r1+e;for(let e=r.c1;e<=r.c2;e++){const r=Tn(t,n,e);l.push({row:o,col:e,raw:x(r)?S(r,o-n,0):r});const s=f.get(xn(n,e));s?a[xn(o,e)]=s:delete a[xn(o,e)]}}),{...Fn(t,l),formats:a}}function ee(t,n,e){const r=new Set,{filter:o}=t;if(!o)return r;for(const[s,c]of Object.entries(o.excluded)){if(!c.length)continue;const u=Number(s),i=new Set(c);for(let s=o.range.r1+1;s<=o.range.r2;s++)i.has(Ln(t,n,e,s,u).text)&&r.add(s)}return r}function re(t,n){if(n.r1!==n.r2||n.c1!==n.c2)return n;const e=(n,e,r)=>{for(let o=e;o<=r;o++)if(""!==Tn(t,n,o))return!1;return!0},r=(n,e,r)=>{for(let o=e;o<=r;o++)if(""!==Tn(t,o,n))return!1;return!0};let{r1:o,r2:s,c1:c,c2:u}=n;for(let n=!0;n;)n=!1,o>0&&!e(o-1,c,u)&&(o--,n=!0),s<t.rowCount-1&&!e(s+1,c,u)&&(s++,n=!0),c>0&&!r(c-1,o,s)&&(c--,n=!0),u<t.colCount-1&&!r(u+1,o,s)&&(u++,n=!0);return{r1:o,c1:c,r2:s,c2:u}}var oe=/^(.*?)(\d+)$/;function se(t,n){const e=t.length,r=t.map(t=>{if(x(t))return null;const n=Mt(t);return"number"==typeof n?n:null});if(e>=2&&r.every(t=>null!==t)){const t=(r[e-1]-r[0])/(e-1);if(r.every((n,e)=>Math.abs(n-(r[0]+t*e))<1e-9))return String(Number((r[0]+t*n).toPrecision(15)))}const o=(n%e+e)%e,s=t[o];if("number"==typeof r[o]||x(s)||""===s||"'"===s[0])return s;const c=oe.exec(s);if(c&&c[1]&&1===e){const t=Number(c[2])+n;if(t>=0)return c[1]+String(t).padStart(c[2].length,"0")}return s}function ce(t,n,e){const r=[],o={...t.formats},s=n.r2-n.r1+1,c=n.c2-n.c1+1,i=e.r1<n.r1||e.r2>n.r2;return Pn(e,(e,l)=>{if(u(n,e,l))return;let a,f,h;if(i){const r=Array.from({length:s},(e,r)=>Tn(t,n.r1+r,l)),o=e-n.r1;a=n.r1+(o%s+s)%s,f=l;const c=Tn(t,a,f);h=x(c)?S(c,e-a,0):se(r,o)}else{const r=Array.from({length:c},(r,o)=>Tn(t,e,n.c1+o)),o=l-n.c1;a=e,f=n.c1+(o%c+c)%c;const s=Tn(t,a,f);h=x(s)?S(s,0,l-f):se(r,o)}r.push({row:e,col:l,raw:h});const m=t.formats[xn(a,f)];m?o[xn(e,l)]=m:delete o[xn(e,l)]}),{...Fn(t,r),formats:o}}function ue(t,n,e,r,o){const s=[];for(let o=r.r1;o<=r.r2;o++){const c=[];for(let s=r.c1;s<=r.c2;s++){const r=Tn(t,o,s);c.push({raw:r,display:Ln(t,n,e,o,s).text,value:""===r?null:e.value(n,o,s),format:t.formats[xn(o,s)]})}s.push(c)}return{sheetId:t.id,range:r,cut:o,cells:s,text:s.map(t=>t.map(t=>{return n=t.display,/["\t\n]/.test(n)?`"${n.replace(/"/g,'""')}"`:n;var n}).join("\t")).join("\n")}}function ie(t,n,e,r){const o=n.cells.length,s=n.cells[0]?.length??0,c=e.r2-e.r1+1,u=e.c2-e.c1+1,i=c%o===0&&u%s===0,l=i?c:o,a=i?u:s,f=[],h={...t.formats};for(let t=0;t<l;t++)for(let c=0;c<a;c++){const u=n.cells[t%o][c%s],i=e.r1+t,l=e.c1+c;if("formats"!==r){let e=u.raw;"values"===r?(e=u.value instanceof ct?u.value.code:null===u.value?"":At(u.value),"number"==typeof u.value&&(e=String(u.value))):x(e)&&!n.cut&&(e=S(e,i-(n.range.r1+t%o),l-(n.range.c1+c%s))),f.push({row:i,col:l,raw:e})}"values"!==r&&(u.format?h[xn(i,l)]=u.format:delete h[xn(i,l)])}return{sheet:{...Fn(t,f),formats:h},range:{r1:e.r1,c1:e.c1,r2:e.r1+l-1,c2:e.c1+a-1}}}function le(t,n,e,r,o){const{range:s}=e,c=o.r1-s.r1,i=o.c1-s.c1,l=t[r].name,a=n!==r,f=Zn(t,n,t=>{const n=t.a.row,e=t.a.col,r=t.b?t.b.row:t.a.row,o=t.b?t.b.col:t.a.col;if(null===n||null===e||null===r||null===o)return t;if(!u(s,n,e)||!u(s,r,o))return t;const f=t=>({...t,row:t.row+c,col:t.col+i});return{...t,sheet:a?l:t.sheet,a:f(t.a),b:t.b?f(t.b):null}}),h=f.map((t,e)=>{if(e!==n)return t;const r={...t.formats};return Pn(s,(t,n)=>{delete r[xn(t,n)]}),{...Vn(t,s),formats:r}}),m={...e,cells:e.cells.map((t,e)=>t.map((t,r)=>({...t,raw:Tn(f[n],s.r1+e,s.c1+r)})))},d={r1:o.r1,c1:o.c1,r2:o.r1+e.cells.length-1,c2:o.c1+(e.cells[0]?.length??1)-1},g=ie(h[r],m,d,"all");return{sheets:h.map((t,n)=>n===r?g.sheet:t),range:g.range}}function ae(t,n){const e=n.matchCase?t:t.toLowerCase();return t=>{const r=n.matchCase?t:t.toLowerCase();return n.wholeCell?r===e:r.includes(e)}}function fe(t,n,e,r,o){if(!r)return[];const s=ae(r,o),c=[];return t.cells.forEach((r,u)=>r.forEach((r,i)=>{if(""===r)return;const l=o.inFormulas?r:Ln(t,n,e,u,i).text;s(l)&&c.push({row:u,col:i})})),c}function he(t,n,e,r){if(x(t)&&!r.inFormulas)return t;if(r.wholeCell)return ae(n,r)(t)?e:t;const o=r.matchCase?"g":"gi";return t.replace(new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o),()=>e)}function me(t,n,e,r,o){let s,c=0,u=0,i=0,l=1/0,a=-1/0;const f=Math.min(r.r2,t.cells.length-1);for(let h=r.r1;h<=f;h++){if(o.has(h))continue;const f=t.cells[h];if(!f)continue;const m=Math.min(r.c2,f.length-1);for(let o=r.c1;o<=m;o++){if(""===f[o])continue;u++;const r=e.value(n,h,o);"number"==typeof r&&(i++,c+=r,r<l&&(l=r),r>a&&(a=r),s??=t.formats[xn(h,o)]?.numFmt)}}return{sum:c,average:i?c/i:null,count:u,numbers:i,min:l,max:a,firstFormat:s}}function de(t){const n=t.replace(/^/,""),e=n.slice(0,n.search(/\r?\n|$/)),r=e.includes("\t")&&!e.includes(",")||e.includes("\t")?"\t":",",o=[];let s=[],c="",u=!1,i=0;for(;i<n.length;){const t=n[i];if(u){if('"'===t){if('"'===n[i+1]){c+='"',i+=2;continue}u=!1,i++;continue}c+=t,i++}else'"'!==t||""!==c?t!==r?("\r"===t&&"\n"===n[i+1]&&i++,"\n"!==t&&"\r"!==t?(c+=t,i++):(s.push(c),o.push(s),s=[],c="",i++)):(s.push(c),c="",i++):(u=!0,i++)}return(""!==c||s.length)&&(s.push(c),o.push(s)),o.filter(t=>t.some(t=>""!==t))}function ge(t){return/[",\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function pe(t,n,e){const r=Dn(t);if(!r)return"";const o=[];for(let s=0;s<=r.row;s++){const c=[];for(let o=0;o<=r.col;o++){const r=Tn(t,s,o),u=Ln(t,n,e,s,o).text;c.push(ge("'"===r[0]&&/^[=+\-@]/.test(u)?r:u))}o.push(c.join(","))}return o.join("\n")}function we(t,n){const e=Cn(t),r={},o=n.map((t,n)=>t.map((t,e)=>{const{raw:o,numFmt:s}=On(t);return s&&(r[xn(n,e)]={numFmt:s}),o}));return{...e,cells:o,formats:r,rowCount:Math.max(e.rowCount,o.length+100),colCount:Math.max(e.colCount,o.reduce((t,n)=>Math.max(t,n.length),0))}}function Me(t,n,e,r,o){const s=new Set;for(let c=r.r1+1;c<=r.r2;c++)s.add(Ln(t,n,e,c,o).text);return[...s].sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}export{t as MAX_ROWS,n as MAX_COLS,e as colLabel,r as colIndex,o as cellLabel,s as normalizeRange,c as rangeLabel,u as rangeContains,l as parseRangeLabel,E as tokenize,x as isFormula,$ as printRef,S as shiftFormula,O as cycleRefAbsolute,I as NUMBER_FORMATS,Y as formatNumber,B as adjustDecimals,ct as FormulaError,yn as FUNCTION_NAMES,En as DEFAULT_COL_WIDTH,Nn as DEFAULT_ROW_HEIGHT,vn as DEFAULT_FONT_SIZE,Cn as newSheet,xn as formatKey,Tn as rawAt,$n as nextSheetName,Rn as makeEvaluator,On as readEntry,Un as editText,Ln as cellDisplay,Dn as usedBounds,Fn as writeCells,kn as commitEntry,Vn as clearValues,zn as updateFormats,Gn as withFormat,Wn as applyBorders,jn as mergedAt,Hn as expandForMerges,Kn as mergeRange,Xn as unmergeRange,Qn as changeStructure,Jn as renameSheet,qn as deleteSheet,te as duplicateSheet,ne as sortRange,ee as filteredRows,re as dataRegion,ce as fillRange,ue as copyClip,ie as pasteClip,le as moveCells,fe as findCells,he as replaceInCell,me as selectionStats,de as parseCsv,pe as serializeCsv,we as sheetFromRows,Me as columnValues};
@@ -1 +0,0 @@
1
- import{drawJpeg as t,embeddedFonts as o,jpegPdf as r,openStage as n,settled as e}from"./chunk-JKYJGXJE.js";import{SLIDE_FONT as i,SlideView as a}from"./chunk-B2X3NIQR.js";import{ENGLISH_WORDS as c}from"./chunk-PXOQN7D6.js";import"./chunk-B32ASXHM.js";import{flushSync as s}from"react-dom";import{createRoot as m}from"react-dom/client";import{jsx as l}from"react/jsx-runtime";async function d(o,r,n,i){const c=document.createElement("div");r.root.append(c);const d=m(c);try{s(()=>d.render(l(a,{slide:o,width:1600})));const r=c.firstElementChild;await e(r);return{jpeg:await t(r,{width:1600,height:900,pixelRatio:1,quality:i,fontCss:n,background:o.background}),width:720,height:405}}finally{d.unmount(),c.remove()}}async function u(t,e={}){const{signal:a,onProgress:s,quality:m}=e;a?.throwIfAborted();const l=n();try{const n=await async function(t){const r=document.createElement("div");r.style.fontFamily=i,t.root.append(r);try{return await o(r)}finally{r.remove()}}(l),e=[];for(const[o,r]of t.slides.entries()){a?.throwIfAborted();const i=await d(r,l,n,m).catch(t=>{throw new Error(c.pdfSlideFailed(o+1),{cause:t})});e.push(i),s?.(o+1,t.slides.length)}return r(e)}finally{l.close()}}export{u as deckToPdf};
@@ -1 +0,0 @@
1
- import{marginText as t,pageBlocks as e,pageStarts as o,pageStyles as n,printStyles as i}from"./chunk-EC6D54MM.js";import{boxesInWindow as r,pageWindows as s}from"./chunk-PWF37Y2N.js";import{ENGLISH_WORDS as a}from"./chunk-POH6OTTR.js";import{drawJpeg as p,embeddedFonts as c,jpegPdf as l,openStage as h,settled as d}from"./chunk-JKYJGXJE.js";import"./chunk-B32ASXHM.js";import{headerKindFor as f,readDocx as u}from"./chunk-YKQ5UKYZ.js";import"./chunk-D3JKD7KW.js";var g="pdf",m=t=>t/20*(4/3);function x(t){const e=t.getBoundingClientRect().top;return Array.from(t.children,t=>{const o=t.getBoundingClientRect();return{top:o.top-e,height:o.height}})}function w(e,o,n,i,r){const s=document.createElement("div");s.style.cssText=`position:absolute;display:flex;justify-content:space-between;font:9pt Calibri,Carlito,Arial,sans-serif;color:#555;white-space:pre;left:${m(o.left)}px;right:${m(o.right)}px;${r}`;for(const o of t(e,n,i))s.append(Object.assign(document.createElement("span"),{textContent:o}));return s}function y(t,e,o,n){const{page:i,headers:s,footers:a,titlePage:p,evenOdd:c}=t.doc,l=f(o,p,c),h=s[l],d=a[l],u=document.createElement("div");u.style.cssText=`position:relative;overflow:hidden;background:#fff;width:${m(i.width)}px;height:${m(i.height)}px`;const g=document.createElement("div");return g.style.cssText=`position:absolute;overflow:hidden;left:${m(i.left)}px;top:${m(i.top)}px;right:${m(i.right)}px;height:${e.height}px`,g.append(function({body:t,boxes:e},o){const n=t.cloneNode(!1),i=r(e,o);if(!i)return n;for(let e=i.first;e<=i.last;e+=1)n.append(t.children[e].cloneNode(!0));const s=parseFloat(getComputedStyle(t.children[i.first]).marginTop)||0;return n.style.position="absolute",n.style.left="0",n.style.top=e[i.first].top-s-o.top+"px",n}(t,e)),u.append(g),h.text&&u.append(w(h.text,i,o,n,`top:${m(i.header)}px`)),d.text&&u.append(w(d.text,i,o,n,`bottom:${m(i.footer)}px`)),u}async function b(t,e,o,n,i){e.append(t);try{await d(t);return{jpeg:await p(t,{width:m(o.width),height:m(o.height),pixelRatio:2,quality:i,fontCss:n}),width:o.width/20,height:o.height/20}}finally{t.remove()}}async function $(t,r={}){const{signal:p,onProgress:f,quality:w}=r;p?.throwIfAborted();const $=await u(new Uint8Array(await t.arrayBuffer())),C=h();try{const t=function(t,e){const o=document.createElement("style");o.textContent=`${n(t,g)}\n${i(g)}`;const r=document.createElement("div");return r.className="docs-page",r.dataset.doc=g,r.style.cssText=`display:flow-root;width:${m(t.page.width-t.page.left-t.page.right)}px`,r.innerHTML=t.html,e.append(o,r),r}($,C.root);await d(t);const r={doc:$,body:t,boxes:x(t)},h=function(t,n){const i=m(t.page.height-t.page.top-t.page.bottom),r=o(e(n,n.getBoundingClientRect().top),i);return s(r,i,n.getBoundingClientRect().height)}($,t),u=await c(t),j=[];for(const[t,e]of h.entries()){p?.throwIfAborted();const o=y(r,e,t+1,h.length);j.push(await b(o,C.root,$.page,u,w).catch(e=>{throw new Error(a.pdfPageFailed(t+1),{cause:e})})),f?.(t+1,h.length)}return l(j)}finally{C.close()}}export{$ as docxToPdf};
@@ -1 +0,0 @@
1
- import{importSpreadsheetFile as o}from"./chunk-DG4VDXLL.js";import"./chunk-MR7ZWQHF.js";import"./chunk-ZS45QEF4.js";import"./chunk-XYVQTQ6N.js";export{o as importSpreadsheetFile};
@@ -1 +0,0 @@
1
- import{rowPageStarts as t}from"./chunk-PWF37Y2N.js";import{ENGLISH_WORDS as e}from"./chunk-UKGIT2RS.js";import{DEFAULT_COL_WIDTH as o,cellDisplay as n,filteredRows as r,formatKey as s,makeEvaluator as a,usedBounds as i}from"./chunk-ZS45QEF4.js";import{drawJpeg as c,embeddedFonts as l,jpegPdf as d,openStage as p,settled as h}from"./chunk-JKYJGXJE.js";import"./chunk-B32ASXHM.js";var m=t=>t*(4/3),f=m(842),u=m(595),w=f-2*m(36),g=u-2*m(36),y="Calibri,Carlito,Arial,sans-serif",b=t=>Array.from({length:t},(t,e)=>e);function x(t,e,a){const c=i(t);if(!c)return{name:t.name,widths:[],rows:[],headerRows:0};const l=new Set([...t.hiddenRows,...r(t,e,a)]),d=new Set(t.hiddenCols),p=b(c.col+1).filter(t=>!d.has(t)),h=b(c.row+1).filter(t=>!l.has(t)).map(o=>p.map(r=>{const{text:i,align:c,color:l}=n(t,e,a,o,r),d=t.formats[s(o,r)];return{text:i,align:d?.align??c,color:d?.color??l,format:d}}));return{name:t.name,widths:p.map(e=>t.colWidths[e]??o),rows:h,headerRows:Math.min(Math.max(t.frozenRows,1),h.length)}}function R(t){const e=document.createElement("td");e.textContent=t.text;const{format:o}=t;return e.style.cssText=`border:.5pt solid #bbb;padding:1pt 3pt;vertical-align:top;overflow-wrap:anywhere;white-space:pre-wrap;text-align:${t.align}`,t.color&&(e.style.color=t.color),o?.fill&&(e.style.background=o.fill),o?.bold&&(e.style.fontWeight="700"),o?.italic&&(e.style.fontStyle="italic"),o?.fontSize&&(e.style.fontSize=`${o.fontSize}pt`),e}function E(t){const e=document.createElement("tr");return e.append(...t.map(R)),e}function v(t,e){const o=document.createElement("table"),n=t.widths.reduce((t,e)=>t+e,0);o.style.cssText=`border-collapse:collapse;table-layout:fixed;width:${n}px;font:10pt ${y};color:#000`;const r=document.createElement("colgroup");r.append(...t.widths.map(t=>Object.assign(document.createElement("col"),{style:`width:${t}px`})));const s=document.createElement("tbody");return s.append(...e.map(E)),o.append(r,s),o}function S(t){const e=document.createElement("div");return e.textContent=t,e.style.cssText=`font:600 13pt ${y};color:#000;margin-bottom:6pt`,e}function $({table:t,scale:e,starts:o},n){const r=document.createElement("div");if(r.style.cssText=`position:relative;overflow:hidden;background:#fff;width:${f}px;height:${u}px;padding:${m(36)}px;box-sizing:border-box`,r.append(S(t.name)),t.rows.length){const s=o[n+1]??t.rows.length,a=v(t,[...t.rows.slice(0,t.headerRows),...t.rows.slice(o[n],s)]);a.style.transform=`scale(${e})`,a.style.transformOrigin="0 0",r.append(a)}return r}async function k(t,e,o,n){e.append(t);try{await h(t);return{jpeg:await c(t,{width:f,height:u,pixelRatio:2,quality:n,fontCss:o}),width:842,height:595}}finally{t.remove()}}async function C(o,n={}){const{signal:r,onProgress:s,quality:i}=n;r?.throwIfAborted();const c=p();try{const n=a(o),p=o.map((e,o)=>function(e,o){const n=e.widths.reduce((t,e)=>t+e,0),r=n>w?w/n:1,s=S(e.name),a=v(e,e.rows);o.append(s,a);const i=s.getBoundingClientRect().height+m(6),c=Array.from(a.querySelectorAll("tr"),t=>t.getBoundingClientRect().height);s.remove(),a.remove();const l=c.slice(0,e.headerRows).reduce((t,e)=>t+e,0),d=(g-i)/r,p=t(c.slice(e.headerRows),d,l).map(t=>t+e.headerRows);return{table:e,scale:r,starts:p}}(x(e,o,n),c.root)),h=p.reduce((t,e)=>t+e.starts.length,0),f=await l(c.root),u=[];for(const t of p)for(const o of t.starts.keys())r?.throwIfAborted(),u.push(await k($(t,o),c.root,f,i).catch(t=>{throw new Error(e.pdfPageFailed(u.length+1),{cause:t})})),s?.(u.length,h);return d(u)}finally{c.close()}}export{x as sheetTable,C as workbookToPdf};
@@ -1 +0,0 @@
1
- import{readXlsx as o,unzip as r,writeXlsx as m,zip as p}from"./chunk-MR7ZWQHF.js";import"./chunk-ZS45QEF4.js";export{o as readXlsx,r as unzip,m as writeXlsx,p as zip};