@justybase/spreadsheet-tasks 3.1.0 → 3.2.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.
- package/CHANGELOG.md +85 -1
- package/README.md +125 -4
- package/browser/browser-spreadsheet.js +3659 -1784
- package/browser/justybase-spreadsheet.min.js +50 -23
- package/dist/cjs/index.d.ts +460 -61
- package/dist/cjs/index.js +5645 -2525
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +5625 -2525
- package/dist/esm/index.js.map +1 -1
- package/docs/API.md +130 -7
- package/package.json +6 -2
|
@@ -1,36 +1,63 @@
|
|
|
1
|
-
"use strict";var JustybaseSpreadsheet=(()=>{var N=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var G=(h,t)=>{for(var e in t)N(h,e,{get:t[e],enumerable:!0})},K=(h,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let x of Y(t))!j.call(h,x)&&x!==e&&N(h,x,{get:()=>t[x],enumerable:!(r=q(t,x))||r.enumerable});return h};var J=h=>K(N({},"__esModule",{value:!0}),h);var s0={};G(s0,{BrowserBigBuffer:()=>g,BrowserXlsbWriter:()=>U,BrowserXlsxWriter:()=>E,BrowserZip:()=>B,F:()=>z,downloadXlsb:()=>i0,downloadXlsbMultiSheet:()=>n0,downloadXlsx:()=>r0,downloadXlsxMultiSheet:()=>x0});var g=class{constructor(t=65536){this.chunkSize=t,this.chunks=[],this.currentBuffer=new Uint8Array(t),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0,this._textEncoder=new TextEncoder}ensureCapacity(t){this.cursor+t>this.chunkSize&&this._flush()}_flush(){this.cursor>0&&(this.chunks.push(this.currentBuffer.slice(0,this.cursor)),this.currentBuffer=new Uint8Array(this.chunkSize),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0)}write(t){let e=t.length,r=0;for(;e>0;){let x=this.chunkSize-this.cursor;x===0&&(this._flush(),x=this.chunkSize);let i=Math.min(e,x);this.currentBuffer.set(t.subarray(r,r+i),this.cursor),this.cursor+=i,r+=i,e-=i}}writeByte(t){this.ensureCapacity(1),this.currentBuffer[this.cursor]=t,this.cursor++}writeUnsafeByte(t){this.currentBuffer[this.cursor++]=t}writeInt32LE(t){this.ensureCapacity(4),this.dataView.setInt32(this.cursor,t,!0),this.cursor+=4}writeUnsafeInt32LE(t){this.dataView.setInt32(this.cursor,t,!0),this.cursor+=4}writeDoubleLE(t){this.ensureCapacity(8),this.dataView.setFloat64(this.cursor,t,!0),this.cursor+=8}writeUnsafeDoubleLE(t){this.dataView.setFloat64(this.cursor,t,!0),this.cursor+=8}writeString(t){let e=this._textEncoder.encode(t),r=e.length;if(this.cursor+r<=this.chunkSize){this.currentBuffer.set(e,this.cursor),this.cursor+=r;return}this._flush(),r>this.chunkSize?this.chunks.push(e):(this.currentBuffer.set(e,this.cursor),this.cursor+=r)}writeUtf16LE(t){let e=t.length*2;if(this.cursor+e<=this.chunkSize){for(let r=0;r<t.length;r++){let x=t.charCodeAt(r);this.currentBuffer[this.cursor++]=x&255,this.currentBuffer[this.cursor++]=x>>8&255}return}if(this._flush(),e>this.chunkSize){let r=new Uint8Array(e);for(let x=0;x<t.length;x++){let i=t.charCodeAt(x);r[x*2]=i&255,r[x*2+1]=i>>8&255}this.chunks.push(r)}else for(let r=0;r<t.length;r++){let x=t.charCodeAt(r);this.currentBuffer[this.cursor++]=x&255,this.currentBuffer[this.cursor++]=x>>8&255}}getChunks(){return this.cursor>0&&(this.chunks.push(this.currentBuffer.slice(0,this.cursor)),this.currentBuffer=new Uint8Array(this.chunkSize),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0),this.chunks}toUint8Array(){let t=this.getChunks(),e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),x=0;for(let i of t)r.set(i,x),x+=i.length;return r}reset(){this.chunks=[],this.cursor=0}};var B=class h{constructor(){this.files=[];this.files=[]}static{this._crc32Table=null}addFile(t,e){let r;if(typeof e=="string")r=new TextEncoder().encode(e);else if(Array.isArray(e)){let x=0;for(let l of e)x+=l.length;r=new Uint8Array(x);let i=0;for(let l of e)r.set(l,i),i+=l.length}else r=e;this.files.push({name:t,data:r})}toBlob(){let t=[],e=[],r=0;for(let s of this.files){let u=new TextEncoder().encode(s.name),d=this._crc32(s.data),a=new Uint8Array(30+u.length),n=new DataView(a.buffer);n.setUint32(0,67324752,!0),n.setUint16(4,20,!0),n.setUint16(6,0,!0),n.setUint16(8,0,!0),n.setUint16(10,0,!0),n.setUint16(12,0,!0),n.setUint32(14,d,!0),n.setUint32(18,s.data.length,!0),n.setUint32(22,s.data.length,!0),n.setUint16(26,u.length,!0),n.setUint16(28,0,!0),a.set(u,30),t.push(a),t.push(s.data);let f=new Uint8Array(46+u.length),c=new DataView(f.buffer);c.setUint32(0,33639248,!0),c.setUint16(4,20,!0),c.setUint16(6,20,!0),c.setUint16(8,0,!0),c.setUint16(10,0,!0),c.setUint16(12,0,!0),c.setUint16(14,0,!0),c.setUint32(16,d,!0),c.setUint32(20,s.data.length,!0),c.setUint32(24,s.data.length,!0),c.setUint16(28,u.length,!0),c.setUint16(30,0,!0),c.setUint16(32,0,!0),c.setUint16(34,0,!0),c.setUint16(36,0,!0),c.setUint32(38,0,!0),c.setUint32(42,r,!0),f.set(u,46),e.push(f),r+=a.length+s.data.length}let x=r,i=0;for(let s of e)t.push(s),i+=s.length;let l=new Uint8Array(22),o=new DataView(l.buffer);return o.setUint32(0,101010256,!0),o.setUint16(4,0,!0),o.setUint16(6,0,!0),o.setUint16(8,this.files.length,!0),o.setUint16(10,this.files.length,!0),o.setUint32(12,i,!0),o.setUint32(16,x,!0),o.setUint16(20,0,!0),t.push(l),new Blob(t,{type:"application/octet-stream"})}_crc32(t){if(!h._crc32Table){h._crc32Table=new Uint32Array(256);for(let x=0;x<256;x++){let i=x;for(let l=0;l<8;l++)i=i&1?3988292384^i>>>1:i>>>1;h._crc32Table[x]=i}}let e=h._crc32Table,r=4294967295;for(let x=0;x<t.length;x++)r=e[(r^t[x])&255]^r>>>8;return(r^4294967295)>>>0}};var z={THOUSANDS_SEP:"#,##0",CURRENCY_PLN:'#,##0.00 "z\u0142"',CURRENCY_EUR:"#,##0.00 \u20AC",PERCENTAGE:"0%",SCIENTIFIC:"0.00E+00",TWO_DECIMALS:"#,##0.00",TEXT:"@",LEADING_ZEROS:"000000000",DATE_SHORT:"dd.mm.yyyy",DATE_LONG:"d mmmm yyyy",DATE_DAY_MONTH_YEAR:"dd-mm-yyyy",DATE_ISO:"yyyy-mm-dd",DATE_MONTH_YEAR:"mmmm yyyy",DATE_WEEKDAY:"dddd, d mmmm yyyy",DATE_DAY_MONTH:"d mmmm",DATE_YEAR_ONLY:"yyyy",DATETIME_SHORT:"dd.mm.yyyy hh:mm",DATETIME_LONG:"d mmmm yyyy hh:mm:ss",TIME_HH_MM:"hh:mm",TIME_HH_MM_SS:"hh:mm:ss",TIME_12H:"h:mm AM/PM",DATETIME_24H:"dd.mm.yyyy hh:mm:ss",DATETIME_ISO:'yyyy-mm-dd"T"hh:mm:ss',TIME_MS:"hh:mm:ss.000"};function C(h){return h!=null&&typeof h=="object"&&"format"in h&&typeof h.format=="string"}function R(h){return C(h)?h.value:h}function L(h){return C(h)?h.format:null}function H(h){let t=h+1,e="";for(;t>0;){let r=(t-1)%26;e=String.fromCharCode(65+r)+e,t=Math.floor((t-1)/26)}return e}var Q=Date.UTC(1899,11,30),t0=Date.UTC(1900,2,1);function k(h,t){let e=(h-t)/864e5;return t===Q&&h<t0&&(e-=1),e}var X=1048576,W=16384,P=32767;function y(h){if(h.length>P)throw new Error(`Excel cell text exceeds ${P} UTF-16 code units (got ${h.length}).`)}function I(h){if(!Number.isInteger(h)||h<1||h>W)throw new Error(`Excel column count must be 1..${W} (got ${h}).`)}function S(h,t,e){if(t>e)throw new Error(`Excel ${h} length ${t} exceeds columnCount ${e}.`)}function v(h){if(h>X)throw new Error(`Excel row count exceeds ${X} (got ${h}).`)}function Z(h,t,e,r){return h===t+1?"":` r="${e}${r}"`}var E=class{constructor(){this._zip=new B,this._sc=0,this._sl=[],this._sstA=[],this._sstM=new Map,this._sstCnt=0,this._cw=[],this._afOn=!1,this._oaE=Date.UTC(1899,11,30),this._csb=null,this._csrn=0,this._csSC=0,this._csEC=0,this._csAF=!1,this._isS=!1,this._csCL=[],this._fmtReg=new Map,this._fmtXf=new Map,this._nextNfmt=165,this._nextXf=6}_cl(t){return H(t)}_san(t){if(!t||typeof t!="string")return`Sheet${this._sc+1}`;let e=t.replace(/[\\/*?[\]:]/g,"_");return e.length>31&&(e=e.substring(0,31)),e.trim()||(e=`Sheet${this._sc+1}`),e}_ex(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}_esc(t){t=t.replace(/_x([0-9A-Fa-f]{4})_/g,"_x005F_x$1_");let e=!1;for(let i=0;i<t.length;i++){let l=t.charCodeAt(i);if(l===38||l===60||l===62||l===34||l===39||l===13||l>=0&&l<=8||l===11||l===12||l>=14&&l<=31){e=!0;break}}if(!e)return t;let r=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\r/g," "),x="";for(let i=0;i<r.length;i++){let l=r.charCodeAt(i);l<=8||l===11||l===12||l>=14&&l<=31||(x+=r[i])}return x}_fmn(t){return/[\s\-+=()!@#$%^&]/.test(t)||/^[0-9]/.test(t)?`'${t.replace(/'/g,"''")}'`:t}addSheet(t,e=!1){let r=this._san(t);this._sc++,this._sl.push({name:r,path:`xl/worksheets/sheet${this._sc}.xml`,hidden:e,fn:`sheet${this._sc}.xml`,id:this._sc,rId:`rId${this._sc}`,fhr:null})}_wsc(t,e,r,x){y(e);let i=this._sstM.get(e);i===void 0&&(i=this._sstA.length,this._sstA.push(e),this._sstM.set(e,i)),this._sstCnt++;let l=x!==void 0?` s="${x}"`:"";t.writeString(`<c${r} t="s"${l}><v>${i}</v></c>`)}_wscStyle(t,e,r,x){y(e);let i=this._sstM.get(e);i===void 0&&(i=this._sstA.length,this._sstA.push(e),this._sstM.set(e,i)),this._sstCnt++,t.writeString(`<c${r} t="s" s="${x}"><v>${i}</v></c>`)}_oa(t){return k(t.getTime(),this._oaE)}_regFmt(t){let e=this._fmtXf.get(t);if(e!==void 0)return e;let r=this._nextNfmt++;this._fmtReg.set(t,r);let x=this._nextXf++;return this._fmtXf.set(t,x),x}_wcv(t,e,r,x,i,l){if(e==null)return l;let o=L(e),s=R(e),u=o!==null?this._regFmt(o):-1,d=u>=0?` s="${u}"`:"";if(s==null)return l;let a=Z(r,l,x,i),n=u>=0?u:void 0;if(typeof s=="number")Number.isFinite(s)?t.writeString(`<c${a}${d}><v>${s}</v></c>`):this._wsc(t,s.toString(),a,n);else if(typeof s=="bigint")this._wsc(t,s.toString(),a,n);else if(typeof s=="boolean")t.writeString(`<c${a} t="b"${d}><v>${s?1:0}</v></c>`);else if(s instanceof Date){let f=this._oa(s);Number.isFinite(f)?t.writeString(`<c${a} s="${u>=0?u:1}"><v>${f}</v></c>`):this._wsc(t,s.toString(),a,n)}else this._wsc(t,s.toString(),a,n);return r}_sheetHead(t,e,r,x){t.writeString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),t.writeString('<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'),t.writeString('<dimension ref="A1"/>'),x?t.writeString(`<sheetViews><sheetView ${r?'tabSelected="1" ':""}workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft"/></sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>`):t.writeString(`<sheetViews><sheetView ${r?'tabSelected="1" ':""}workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/>`),t.writeString("<cols>");for(let i=0;i<e;i++){let l=this._cw[i]>0?this._cw[i]:10;t.writeString(`<col min="${i+1}" max="${i+1}" width="${l}" bestFit="1" customWidth="1"/>`)}t.writeString("</cols><sheetData>")}startSheet(t,e,r,x={}){if(this._isS)throw new Error("Already streaming");if(I(e),r!==void 0){S("header",r.length,e);for(let a of r)y(a)}let{hidden:i=!1,doAutofilter:l=!0,headerStyle:o="bold"}=x,s=3;o==="fill"?s=4:o==="bold+fill"&&(s=5),this.addSheet(t,i),this._isS=!0;let u=new g;this._csb=u,this._csrn=0,this._csSC=0,this._csEC=e,this._csAF=l&&r!==void 0,this._cw=new Array(e).fill(-1);let d=new Array(e);for(let a=0;a<e;a++)d[a]=this._cl(a);if(this._csCL=d,r)for(let a=0;a<e;a++){let n=1.3*(r[a]?r[a].length:0)+3;n>80&&(n=80),this._cw[a]<n&&(this._cw[a]=n)}if(this._sheetHead(u,e,this._sc===1,this._csAF),r){this._csrn++,u.writeString(`<row r="${this._csrn}">`);for(let a=0;a<r.length;a++)this._wscStyle(u,r[a],"",s);u.writeString("</row>")}}writeRow(t){if(!this._isS||this._csb===null)throw new Error("Not streaming");if(t.length!==this._csEC)throw new Error(`Row length mismatch. Expected ${this._csEC} columns, got ${t.length}`);let e=this._csb;this._csrn++,v(this._csrn),e.writeString(`<row r="${this._csrn}">`);let r=-1;for(let x=0;x<t.length;x++)r=this._wcv(e,t[x],x,this._csCL[x],this._csrn,r);e.writeString("</row>")}endSheet(){if(!this._isS||this._csb===null)throw new Error("Not streaming");let t=this._csb;if(t.writeString("</sheetData>"),this._csAF&&this._csEC>0){this._afOn=!0;let e=`A1:${this._csCL[this._csEC-1]}${this._csrn}`;t.writeString(`<autoFilter ref="${e}"/>`);let r=this._sl[this._sc-1];r.fhr=`${this._fmn(r.name)}!$A$1:$${this._csCL[this._csEC-1]}$${this._csrn}`}t.writeString("</worksheet>"),this._zip.addFile(this._sl[this._sc-1].path,t.toUint8Array()),this._isS=!1,this._csb=null}writeSheet(t,e=null,r={}){let x=r.doAutofilter!==!1,i=r.headerStyle||"bold",l=3;i==="fill"?l=4:i==="bold+fill"&&(l=5);let o=new g,s=t.length>0?t[0].length:e?e.length:0;s>0&&I(s);let u=t.length+(e?1:0);if(v(u),e){S("header",e.length,s);for(let n of e)y(n)}for(let n=0;n<t.length;n++)S("row",t[n].length,s);this._cw=new Array(s).fill(-1);let d=new Array(s);for(let n=0;n<s;n++)d[n]=this._cl(n);if(e)for(let n=0;n<s;n++){let f=1.3*(e[n]?e[n].length:0)+3;f>80&&(f=80),this._cw[n]<f&&(this._cw[n]=f)}for(let n=0;n<Math.min(t.length,100);n++)for(let f=0;f<t[n].length;f++){let c=t[n][f];if(c==null)continue;let p=C(c)?c.value:c;if(p==null)continue;let F=1.3*(p instanceof Date?10:p.toString().length)+3;F>80&&(F=80),this._cw[f]<F&&(this._cw[f]=F)}this._sheetHead(o,s,this._sc===1,x&&!!e);let a=0;if(e){a++,o.writeString(`<row r="${a}">`);for(let n=0;n<e.length;n++)this._wscStyle(o,e[n],"",l);o.writeString("</row>")}for(let n=0;n<t.length;n++){a++,o.writeString(`<row r="${a}">`);let f=-1;for(let c=0;c<t[n].length;c++)f=this._wcv(o,t[n][c],c,d[c],a,f);o.writeString("</row>")}if(o.writeString("</sheetData>"),x&&e&&s>0){this._afOn=!0;let n=`A1:${d[s-1]}${u}`;o.writeString(`<autoFilter ref="${n}"/>`);let f=this._sl[this._sc-1];f.fhr=`${this._fmn(f.name)}!$A$1:$${d[s-1]}$${u}`}o.writeString("</worksheet>"),this._zip.addFile(this._sl[this._sc-1].path,o.toUint8Array())}finalize(){return this._writeSst(),this._writeStyles(),this._writeWb(),this._writeCt(),this._writeRels(),this._zip.toBlob()}_writeSst(){let t=new g;t.writeString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),t.writeString(`<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${this._sstCnt}" uniqueCount="${this._sstA.length}">`);for(let e of this._sstA){let r=this._esc(e);r.length>0&&(r[0]===" "||r[r.length-1]===" "||/[\t\n\r]/.test(r))?t.writeString(`<si><t xml:space="preserve">${r}</t></si>`):t.writeString(`<si><t>${r}</t></si>`)}t.writeString("</sst>"),this._zip.addFile("xl/sharedStrings.xml",t.toUint8Array())}_writeStyles(){let t='<numFmt numFmtId="164" formatCode="yyyy\\-mm\\-dd\\ hh:mm:ss"/>',e=1,r=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>','<xf numFmtId="14" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>','<xf numFmtId="164" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>','<xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/>','<xf numFmtId="0" fontId="0" fillId="1" borderId="0" xfId="0" applyFill="1"/>','<xf numFmtId="0" fontId="1" fillId="1" borderId="0" xfId="0" applyFont="1" applyFill="1"/>'];for(let[i,l]of this._fmtReg){let o=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");t+=`<numFmt numFmtId="${l}" formatCode="${o}"/>`,e++}let x=[...this._fmtXf.entries()].sort((i,l)=>i[1]-l[1]);for(let[i]of x){let l=this._fmtReg.get(i);r.push(`<xf numFmtId="${l}" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>`)}this._zip.addFile("xl/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
1
|
+
"use strict";var JustybaseSpreadsheet=(()=>{var xe=Object.defineProperty;var Yt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Kt=Object.prototype.hasOwnProperty;var Jt=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},er=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zt(t))!Kt.call(e,i)&&i!==r&&xe(e,i,{get:()=>t[i],enumerable:!(n=Yt(t,i))||n.enumerable});return e};var tr=e=>er(xe({},"__esModule",{value:!0}),e);var di={};Jt(di,{BrowserBigBuffer:()=>w,BrowserXlsbWriter:()=>L,BrowserXlsxWriter:()=>D,BrowserZip:()=>C,F:()=>Ve,downloadXlsb:()=>ui,downloadXlsbMultiSheet:()=>fi,downloadXlsx:()=>li,downloadXlsxMultiSheet:()=>ai});var w=class{constructor(t=65536){this.chunkSize=t,this.chunks=[],this.currentBuffer=new Uint8Array(t),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0,this._textEncoder=new TextEncoder}ensureCapacity(t){this.cursor+t>this.chunkSize&&this._flush()}_flush(){this.cursor>0&&(this.chunks.push(this.currentBuffer.subarray(0,this.cursor)),this.currentBuffer=new Uint8Array(this.chunkSize),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0)}write(t){let r=t.length,n=0;for(;r>0;){let i=this.chunkSize-this.cursor;i===0&&(this._flush(),i=this.chunkSize);let s=Math.min(r,i);this.currentBuffer.set(t.subarray(n,n+s),this.cursor),this.cursor+=s,n+=s,r-=s}}writeByte(t){this.ensureCapacity(1),this.currentBuffer[this.cursor]=t,this.cursor++}writeUnsafeByte(t){this.currentBuffer[this.cursor++]=t}writeInt32LE(t){this.ensureCapacity(4),this.dataView.setInt32(this.cursor,t,!0),this.cursor+=4}writeUnsafeInt32LE(t){this.dataView.setInt32(this.cursor,t,!0),this.cursor+=4}writeDoubleLE(t){this.ensureCapacity(8),this.dataView.setFloat64(this.cursor,t,!0),this.cursor+=8}writeUnsafeDoubleLE(t){this.dataView.setFloat64(this.cursor,t,!0),this.cursor+=8}writeString(t){if(this.cursor+t.length<=this.chunkSize){let i=!0;for(let s=0;s<t.length;s++)if(t.charCodeAt(s)>=128){i=!1;break}if(i){for(let s=0;s<t.length;s++)this.currentBuffer[this.cursor++]=t.charCodeAt(s);return}}let r=this._textEncoder.encode(t),n=r.length;if(this.cursor+n<=this.chunkSize){this.currentBuffer.set(r,this.cursor),this.cursor+=n;return}this._flush(),n>this.chunkSize?this.chunks.push(r):(this.currentBuffer.set(r,this.cursor),this.cursor+=n)}writeUtf16LE(t){let r=t.length*2;if(this.cursor+r<=this.chunkSize){for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);this.currentBuffer[this.cursor++]=i&255,this.currentBuffer[this.cursor++]=i>>8&255}return}if(this._flush(),r>this.chunkSize){let n=new Uint8Array(r);for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);n[i*2]=s&255,n[i*2+1]=s>>8&255}this.chunks.push(n)}else for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);this.currentBuffer[this.cursor++]=i&255,this.currentBuffer[this.cursor++]=i>>8&255}}getChunks(){return this.cursor>0&&(this.chunks.push(this.currentBuffer.subarray(0,this.cursor)),this.currentBuffer=new Uint8Array(this.chunkSize),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0),this.chunks}patchInt32LE(t,r){let n=0;for(let i of this.chunks){if(t>=n&&t+4<=n+i.length)return new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(t-n,r,!0),!0;n+=i.length}return t>=n&&t+4<=n+this.cursor?(this.dataView.setInt32(t-n,r,!0),!0):!1}toUint8Array(){let t=this.getChunks(),r=0;for(let s of t)r+=s.length;let n=new Uint8Array(r),i=0;for(let s of t)n.set(s,i),i+=s.length;return n}reset(){this.chunks=[],this.cursor=0}};var C=class e{constructor(){this.files=[];this.files=[]}static{this._crc32Table=null}addFile(t,r){let n;if(typeof r=="string")n=new TextEncoder().encode(r);else if(Array.isArray(r)){let i=0;for(let l of r)i+=l.length;n=new Uint8Array(i);let s=0;for(let l of r)n.set(l,s),s+=l.length}else n=r;this.files.push({name:t,data:n})}toBlob(){let t=[],r=[],n=0;for(let a of this.files){let u=new TextEncoder().encode(a.name),f=this._crc32(a.data),d=new Uint8Array(30+u.length),c=new DataView(d.buffer);c.setUint32(0,67324752,!0),c.setUint16(4,20,!0),c.setUint16(6,0,!0),c.setUint16(8,0,!0),c.setUint16(10,0,!0),c.setUint16(12,0,!0),c.setUint32(14,f,!0),c.setUint32(18,a.data.length,!0),c.setUint32(22,a.data.length,!0),c.setUint16(26,u.length,!0),c.setUint16(28,0,!0),d.set(u,30),t.push(d),t.push(a.data);let x=new Uint8Array(46+u.length),m=new DataView(x.buffer);m.setUint32(0,33639248,!0),m.setUint16(4,20,!0),m.setUint16(6,20,!0),m.setUint16(8,0,!0),m.setUint16(10,0,!0),m.setUint16(12,0,!0),m.setUint16(14,0,!0),m.setUint32(16,f,!0),m.setUint32(20,a.data.length,!0),m.setUint32(24,a.data.length,!0),m.setUint16(28,u.length,!0),m.setUint16(30,0,!0),m.setUint16(32,0,!0),m.setUint16(34,0,!0),m.setUint16(36,0,!0),m.setUint32(38,0,!0),m.setUint32(42,n,!0),x.set(u,46),r.push(x),n+=d.length+a.data.length}let i=n,s=0;for(let a of r)t.push(a),s+=a.length;let l=new Uint8Array(22),o=new DataView(l.buffer);return o.setUint32(0,101010256,!0),o.setUint16(4,0,!0),o.setUint16(6,0,!0),o.setUint16(8,this.files.length,!0),o.setUint16(10,this.files.length,!0),o.setUint32(12,s,!0),o.setUint32(16,i,!0),o.setUint16(20,0,!0),t.push(l),new Blob(t,{type:"application/octet-stream"})}_crc32(t){if(!e._crc32Table){e._crc32Table=new Uint32Array(256);for(let i=0;i<256;i++){let s=i;for(let l=0;l<8;l++)s=s&1?3988292384^s>>>1:s>>>1;e._crc32Table[i]=s}}let r=e._crc32Table,n=4294967295;for(let i=0;i<t.length;i++)n=r[(n^t[i])&255]^n>>>8;return(n^4294967295)>>>0}};function De(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<32&&r!==9&&r!==10&&r!==13)return!0}return!1}function rr(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);(n===9||n===10||n===13||n>=32&&n<=55295||n>=57344&&n<=65533)&&(t+=e[r])}return t}function g(e){if(!/[&<>"'\r]/.test(e)&&!De(e))return e;let t=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\r/g," ");return De(t)&&(t=rr(t)),t}function $(e){return g(e.replace(/_x([0-9A-Fa-f]{4})_/g,"_x005F_x$1_"))}function Z(e){let t=e+1,r="";for(;t>0;){let n=(t-1)%26;r=String.fromCharCode(65+n)+r,t=Math.floor((t-1)/26)}return r}var _=class{constructor(t){this.code=t}toString(){return this.code}},he=class{constructor(t){this.runs=t}toString(){return this.runs.map(t=>t.text).join("")}},Ve={THOUSANDS_SEP:"#,##0",CURRENCY_PLN:'#,##0.00 "z\u0142"',CURRENCY_EUR:"#,##0.00 \u20AC",PERCENTAGE:"0%",SCIENTIFIC:"0.00E+00",TWO_DECIMALS:"#,##0.00",TEXT:"@",LEADING_ZEROS:"000000000",DATE_SHORT:"dd.mm.yyyy",DATE_LONG:"d mmmm yyyy",DATE_DAY_MONTH_YEAR:"dd-mm-yyyy",DATE_ISO:"yyyy-mm-dd",DATE_MONTH_YEAR:"mmmm yyyy",DATE_WEEKDAY:"dddd, d mmmm yyyy",DATE_DAY_MONTH:"d mmmm",DATE_YEAR_ONLY:"yyyy",DATETIME_SHORT:"dd.mm.yyyy hh:mm",DATETIME_LONG:"d mmmm yyyy hh:mm:ss",TIME_HH_MM:"hh:mm",TIME_HH_MM_SS:"hh:mm:ss",TIME_12H:"h:mm AM/PM",DATETIME_24H:"dd.mm.yyyy hh:mm:ss",DATETIME_ISO:'yyyy-mm-dd"T"hh:mm:ss',TIME_MS:"hh:mm:ss.000"};function Le(e){return e!=null&&typeof e=="object"&&"format"in e&&typeof e.format=="string"}function E(e){return e instanceof he}function Ne(e){return e!=null&&typeof e=="object"&&"style"in e&&"value"in e&&!("formula"in e)}function me(e){return e!=null&&typeof e=="object"&&"formula"in e}function N(e){return Le(e)?{numFmt:e.format}:Ne(e)?e.style:me(e)?e.style??null:null}function K(e){return me(e)?e.formula:null}function O(e){return Le(e)||Ne(e)?e.value:me(e)?e.value??null:e}var nr=Date.UTC(1899,11,30),ir=Date.UTC(1900,2,1);function k(e,t){let r=(e-t)/864e5;return t===nr&&e<ir&&(r-=1),r}function F(e){return e.getUTCHours()!==0||e.getUTCMinutes()!==0||e.getUTCSeconds()!==0||e.getUTCMilliseconds()!==0}var Oe=1048576,ke=16384,Xe=32767;function I(e){if(e.length>Xe)throw new Error(`Excel cell text exceeds ${Xe} UTF-16 code units (got ${e.length}).`)}function X(e){if(!Number.isInteger(e)||e<1||e>ke)throw new Error(`Excel column count must be 1..${ke} (got ${e}).`)}function T(e,t,r){if(t>r)throw new Error(`Excel ${e} length ${t} exceeds columnCount ${r}.`)}function M(e){if(e>Oe)throw new Error(`Excel row count exceeds ${Oe} (got ${e}).`)}function J(e){return new Array(e).fill(-1)}var Qe=8.43,ee=200,pe=5/7,sr=2.4,U=200;function H(e){if(e===void 0)return U;if(!Number.isInteger(e)||e<0)throw new RangeError(`autofitRows must be a non-negative integer, got ${e}`);return e}var or=1.2,lr=29/28,ar=1.08,ur=1.05,Me=11,fr=9/7;function Ae(e){let t=Object.create(null);for(let[r,n]of e)for(let i of r)t[i]=n;return t}var dr=Ae([["@W",1.75],["%M",1.7],["m",1.7],["OQwGHN",1.45],["CD",1.4],["&U",1.35],["R",1.25],["BKAPT",1.2],["ESXbdpqu",1.15],["$0123456789Yhno",1.1],["#+<=>^`ae~",1.1],["?FZcg",1.05],["*_kLsvy|",1],["xz",.95],["J",.9],['"/',.85],["\\r",.8],["!-t",.75],["()[]f{}",.7],["I",.65],[",.:;",.65],["l",.6],[" ij",.6],["'",.5]]),cr=Ae([["@W",2.5],["M",2.35],["%",2.3],["m",2.25],["w",2.05],["&",1.95],["OQ",1.9],["NU",1.85],["GHD",1.75],["#K",1.7],["A",1.7],["+<=>^~",1.65],["V",1.65],["C",1.6],["BRXY",1.6],["Pbdhnopqu",1.5],["$0123456789e",1.45],["ESTZ",1.45],["*_ag",1.4],["FJLckvx|?`y{}",1.35],['"/\\',1.3],["s",1.25],[" !'(),-.:;I[]fijlrtz",1.25]]),xr=new Set(["calibri","calibri light","aptos","aptos narrow","arial narrow"]);function hr(e){return e?xr.has(e.trim().toLowerCase()):!0}function mr(e){return e>=4352&&e<=4447||e>=11904&&e<=12350||e>=12353&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=40960&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=262141}function gr(e){return e>=126976&&e<=129791||e>=8960&&e<=9215||e>=9728&&e<=10175||e>=11008&&e<=11263}function pr(e){return e<32||e>=127&&e<=159||e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071}var Ar=Ae([["\xA5\xC8\xC9\xCA\xCB\xDE\xE8\xE9\xEA\xEB\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFE\u0112\u0113\u0114\u0115\u0116\u0117\u0118\u0119\u011A\u011B\u0125\u0133\u0144\u0146\u0148\u014B\u014D\u014F\u0151\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0169\u016B\u016D\u016F\u0171\u0173\u0179\u017B\u017D\u0183\u018C\u018D\u018E\u019E\u01A5\u01A7\u01B4\u01BB\u01BC\u01BF\u01C9\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01EB\u01ED\u01F9\u01FF\u0204\u0205\u0206\u0207\u020D\u020F\u0215\u0217\u0218\u021A\u021F\u0222\u0223\u0228\u0229\u022B\u022D\u022F\u0231\u0232\u023B\u023E\u0246\u024B",1.35],["\u0127\u0185\u01AC\u01E8",1.4],["\xA3\xAB\xB5\xBB\xC7\xDD\xDF\u0106\u0108\u010A\u010C\u0111\u013F\u0154\u0156\u0158\u0176\u0178\u0180\u0182\u0184\u0186\u018B\u0198\u01A6\u01B3\u01E5\u0210\u0212\u0243\u024C",1.45],["\xAC\xB1\xD7\xF7\u0194\u01C2\u0245\u024E",1.5],["\xB6\xC0\xC1\xC2\xC3\xC4\xC5\u0100\u0102\u0104\u010F\u0136\u0187\u01CD\u01DE\u01E0\u01F7\u01FA\u0200\u0202\u0221\u0226\u023A",1.55],["\xD0\u010E\u0110\u011C\u011E\u0120\u0122\u0124\u0149\u014A\u0189\u01A1\u01A4\u01E6\u01F4\u021E\u0220\u0235\u024A",1.6],["\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\u0126\u0143\u0145\u0147\u014C\u014E\u0150\u0168\u016A\u016C\u016E\u0170\u0172\u0181\u018F\u0193\u019D\u019F\u01B0\u01B1\u01B2\u01C8\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01E4\u01EA\u01EC\u01F8\u01FE\u020C\u020E\u0214\u0216\u022A\u022C\u022E\u0230\u0244",1.7],["\xAE\u01A3",1.8],["\u018A",1.85],["\u0175\u01A0\u01AF",1.9],["\u01E2",1.95],["\xBC\xBD\xBE\u0195\u01A2\u01C7\u01CC\u01E3",2],["\u0132\u03E3\u0416\u04C1\u04DC\u0502\u0503\u050B\u0906\u0911\u0912\u0913\u0914\u0974\u0975\u0E33\u1E3F\u1E41\u1E43\u20A5\u2106\u210B\u21FF\u220F\u226A\u226B",2.05],["\xC6\xE6\u01FC\u01FD\u0238\u0239\u03D6\u046D\u0518\u2105\u2154\u25EF",2.1],["\xA9\u205B\u2117",2.15],["\u0152\u0153\u039C\u041C\u1E3E\u1E40\u1E42\u2180\u2182\u21AD\u21AE\u21CE\u21D4\u21DC\u21DD\u221E",2.2],["\u019C\u03E2\u0409\u040A\u0428\u042E\u0468\u0496\u04CD\u0514\u20A8\u2120\u2188",2.25],["\u0174\u01CB\u01F6\u0429\u04A6\u0508\u050A\u051C\u0520\u0522\u1E80\u1E82\u1E84\u1E86\u1E88\u2014\u2015\u2162\u2177\u2190\u2191\u2192\u2193\u2196\u2197\u2198\u2199\u222D",2.3],["\u01C6\u01F3\u046C\u0479\u047C\u20A9\u2133\u214F",2.35],["\u2230",2.4],["\u01CA\u2152",2.45],["\u0460\u047E",2.5],["\u01C5\u01F2\u052B\u2001\u2003\u25FD\u25FE",2.55],["\u0478\u2116\u2121\u213B\u22D8\u22D9",2.65],["\u2166\u216B",2.7],["\u01C4\u01F1\u20AF",2.75],["\u2030",3],["\u052A\u20A7",3.1],["\u2194",3.25],["\u2460\u2461\u2462\u2463\u2464\u2465\u2466\u2467\u2468\u2469\u246A\u246B\u246C\u246D\u246E\u246F\u2470\u2471\u2472\u2473\u24EA\u24EB\u24EC\u24ED\u24EE\u24EF\u24F0\u24F1\u24F2\u24F3\u24F4\u24FF",3.35],["\u2167",3.45],["\u2031",3.6]]);function W(e,t){let r=hr(t)?dr:cr,n=0;for(let i of e){let s=i.codePointAt(0);if(pr(s))continue;if(gr(s)){n+=3.4;continue}if(mr(s)){n+=2.2;continue}let l=r[i]??Ar[i];if(l!==void 0){n+=l;continue}n+=s<592?1.3:2}return n}function ye(e){let t=Math.max(1,(e?.size??Me)/Me);return e?.bold&&(t*=ar),e?.italic&&(t*=ur),t}function je(e){let t=e?.indent??0;if(!Number.isFinite(t)||t<=0)return 0;let r=e?.horizontal==="center"||e?.horizontal==="distributed"?2:1;return t*r*fr}function qe(e,t=1,r=0){let n=(or*(e*lr+1)+2)*t+r;return Math.min(ee,Math.max(Qe,n))}function yr(e,t,r=0){return qe(W(e,t?.name),ye(t),r)}function ge(e,t,r=0){return Math.min(ee,yr(e,t,r)+pe)}function He(e,t=0){return Math.min(ee,qe(e,1,t)+pe)}function wr(e,t){let r=0;for(let n of e.runs){let i=n.style?.font??t;r+=W(n.text,i?.name)*ye(i)}return r}function br(e,t){let r=[0];for(let n of e.runs){let i=n.style?.font??t,s=n.text.split(`
|
|
2
|
+
`);for(let l=0;l<s.length;l++)l>0&&r.push(0),r[r.length-1]+=W(s[l],i?.name)*ye(i)}return r}var Sr=/^(yyyy|yy|mmmmm|mmmm|mmm|mm|m|dddd|ddd|dd|d|hh|h|ss|s|am\/pm|a\/p|\.0+)/i,_r=/(yyyy|yy|mmmmm|mmmm|mmm|mm|m|dddd|ddd|dd|d|hh|h|ss|s|am\/pm|a\/p)/i,Br={yyyy:"2024",yy:"24",mmmmm:"W",mmmm:"pa\u017Adziernik",mmm:"Sep",mm:"12",m:"12",dddd:"poniedzia\u0142ek",ddd:"Wed",dd:"30",d:"30",hh:"23",h:"23",ss:"59",s:"59","am/pm":"PM","a/p":"P"};function Rr(e){let t=[],r="",n=!1;for(let i of e)i==='"'&&(n=!n),i===";"&&!n?(t.push(r),r=""):r+=i;return t.push(r),t}function Ye(e){return e.replace(/"[^"]*"/g,"")}function Cr(e){if(!_r.test(Ye(e)))return null;let t="",r=0;for(;r<e.length;){let n=e[r];if(n==='"'){let s=e.indexOf('"',r+1);if(s<0){t+=e.slice(r+1);break}t+=e.slice(r+1,s),r=s+1;continue}if(n==="\\"&&r+1<e.length){t+=e[r+1],r+=2;continue}if(n==="["){let s=e.indexOf("]",r+1);r=s<0?e.length:s+1;continue}let i=Sr.exec(e.slice(r));if(i){let s=i[1].toLowerCase();s.startsWith(".0")?t+="."+"0".repeat(i[1].length-1):t+=Br[s]??i[1],r+=i[1].length;continue}t+=n,r++}return t}function Pe(e){let t="",r=0;for(;r<e.length;){let n=e[r];if(n==='"'){let i=e.indexOf('"',r+1);if(i<0){t+=e.slice(r+1);break}t+=e.slice(r+1,i),r=i+1;continue}if(n==="\\"&&r+1<e.length){t+=e[r+1],r+=2;continue}if(n==="["){let i=e.indexOf("]",r+1);if(i<0)break;let s=e.slice(r+1,i);s.startsWith("$")&&(t+=s.slice(1).replace(/-?\d+$/,"").trim()),r=i+1;continue}if("0#?.,@".includes(n)){r++;continue}if("Ee+-".includes(n)){r++;continue}t+=n,r++}return t}function Er(e){let t=/^(-?)(\d+)(?:\.(\d+))?[eE]([+-]?\d+)$/.exec(e);if(!t)return e;let r=t[1],n=t[2],i=t[3]??"",s=n+i,l=n.length+Number(t[4]);return l<=0?`${r}0.${"0".repeat(-l)}${s}`:l>=s.length?`${r}${s}${"0".repeat(l-s.length)}`:`${r}${s.slice(0,l)}.${s.slice(l)}`}function ze(e){let[t,r]=Math.abs(e).toExponential(5).split("e"),n=t.replace(/\.?0+$/,""),i=Number(r);return`${n}E${i<0?"-":"+"}${String(Math.abs(i)).padStart(2,"0")}`}function Fr(e){if(!Number.isFinite(e))return Number.isNaN(e)?"NaN":e<0?"-\u221E":"\u221E";if(e===0)return"0";let t=e<0?"-":"",r=Math.abs(e);if(Number.isInteger(r)){let n=String(r);return!/[eE]/.test(n)&&n.length<=11?t+n:t+ze(r)}if(r>=1e-9&&r<1e11){let n=Math.trunc(r),i=String(n).length,s=Math.max(0,10-i),l=Number(r.toFixed(s)),o=l.toFixed(s);o.includes(".")&&(o=o.replace(/0+$/,"").replace(/\.$/,""));let a=l===r,u=n>0?s+i:s+Math.floor(Math.log10(r))+1;if(o!=="0"&&(a||u>=6))return t+o}return t+ze(r)}function Ir(e,t){if(!Number.isFinite(e))return String(e);let r=String(e);return/[eE]/.test(r)&&(t||Math.abs(e)<1e-6)&&(r=Er(r)),r.endsWith(".0")&&(r=r.slice(0,-2)),r}function We(e,t=!1){return e==null?"":typeof e=="boolean"?"PRAWDA":e instanceof Date?F(e)?"12/31/2024 23:45":"12/31/2024":typeof e=="number"?t?Ir(e,!0):Fr(e):typeof e=="bigint"?e.toString():e instanceof _?e.code:String(e)}function Tr(e,t){let r=We(e);if(!t||/^general$/i.test(t.trim()))return r;let n=Rr(t),i=typeof e=="bigint"?e<0n:typeof e=="number"&&e<0,s=n[1]??"",l=i&&s.trim()!=="",o=l?s:n[0]??"",a=l?typeof e=="bigint"?-e:Math.abs(e):e;if(typeof a!="number"&&typeof a!="bigint"&&!(a instanceof Date))return r+Pe(o);r=We(a,!0);let u=Cr(o);if(u!==null)return W(u)>=W(r)?u:r+u;let f=r+Pe(o),d=Ye(o).replace(/\[[^\]]*\]/g,""),c=/[0#?][0#?,.]*/.exec(d);if(c){let[h,y=""]=c[0].split("."),R=(h.match(/0/g)??[]).length,ve=/^-?\d+/.exec(r),Gt=ve?ve[0].replace("-","").length:0;f+="0".repeat(Math.max(0,R-Gt));let Qt=(y.match(/[0#?]/g)??[]).length,jt=r.includes(".")?r.split(".")[1].length:0,$e=Math.max(0,Qt-jt);if($e>0&&(f+=(r.includes(".")?"":".")+"0".repeat($e)),h.includes(",")){let qt=(r.match(/\d/g)??[]).length;f+=",".repeat(Math.max(0,Math.floor((qt-1)/3)))}}let x=/[eE][+-]([0#]+)/.exec(d);x&&(f+="E+"+"0".repeat(Math.max(2,x[1].length)));let m=(d.match(/%/g)??[]).length;return m>0&&(f+="00".repeat(m)+"%".repeat(m)),f}function te(e,t,r,n){let i=n?.bold?{bold:!0}:null;for(let s=0;s<r;s++){let l=ge(t[s]??"",i);n?.filterButton&&(l=Math.min(ee,l+sr)),e[s]<l&&(e[s]=l)}}function Ge(e,t,r){let n=je(r);if(r?.wrapText&&e.runs.some(i=>i.text.includes(`
|
|
3
|
+
`))){let i=0;for(let s of br(e,t))i=Math.max(i,He(s,n));return i}return He(wr(e,t),n)}function Ur(e){if(E(e))return Ge(e);let t=N(e),r=O(e);if(r==null)return-1;let n=je(t?.alignment);if(E(r))return Ge(r,t?.font,t?.alignment);let i=Tr(r,t?.numFmt);if(t?.alignment?.wrapText&&i.includes(`
|
|
4
|
+
`)){let s=0;for(let l of i.split(`
|
|
5
|
+
`))s=Math.max(s,ge(l,t?.font,n));return s}return ge(i,t?.font,n)}function P(e,t,r=U){for(let n=0;n<Math.min(t.length,r);n++){let i=t[n];for(let s=0;s<i.length;s++){let l=i[s];if(l==null)continue;let o=Ur(l);o>=0&&e[s]<o&&(e[s]=o)}}}function re(e,t=!1){let r=e>0?e:Qe+pe;return t?Math.floor(r):r}function ne(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new TypeError(`columnWidths[${t}] must be a finite number`);if(e<.5||e>255)throw new RangeError(`columnWidths[${t}] must be between 0.5 and 255, got ${e}`);return e}function Ze(e){return String(Math.round(e*100)/100)}function Ke(e,t,r,n){return e===t+1?"":` r="${r}${n}"`}function b(e){return g(e)}function vr(e){return/[\s\-+=()!@#$%^&]/.test(e)||/^[0-9]/.test(e)?`'${e.replace(/'/g,"''")}'`:e}var $r=new Set(["thin","medium","dashed","dotted","thick","double","hair","mediumDashed","dashDot","mediumDashDot","dashDotDot","mediumDashDotDot","slantDashDot"]),Dr=new Set(["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"]),Vr=new Set(["general","left","center","right","fill","justify","centerContinuous","distributed"]),Lr=new Set(["top","center","bottom","justify","distributed"]);function we(e){if(typeof e=="string"){let r=e.trim().replace(/^#/,"").toUpperCase();if(r.length===6&&(r=`FF${r}`),!/^[0-9A-F]{8}$/.test(r))throw new Error(`Invalid color '${e}'. Use RRGGBB, AARRGGBB or '#' + hex.`);return`rgb:${r}`}if("indexed"in e)return`indexed:${e.indexed}`;let t=e.tint??0;return`theme:${e.theme}:${t}`}function Q(e){if(e===void 0)return"";if(typeof e=="string")return`<color rgb="${we(e).slice(4)}"/>`;if("indexed"in e)return`<color indexed="${e.indexed}"/>`;let t=e.tint;return`<color theme="${e.theme}"${t!==void 0?` tint="${t}"`:""}/>`}function Je(e){if(!e)return null;let t={};if(e.name!==void 0&&(t.name=e.name),e.size!==void 0){if(!Number.isFinite(e.size)||e.size<=0||e.size>409)throw new RangeError(`font.size must be in (0, 409], got ${e.size}`);t.size=e.size}return e.bold&&(t.bold=!0),e.italic&&(t.italic=!0),e.strike&&(t.strike=!0),e.outline&&(t.outline=!0),e.shadow&&(t.shadow=!0),e.condense&&(t.condense=!0),e.extend&&(t.extend=!0),e.underline===!0?t.underline="single":typeof e.underline=="string"&&(t.underline=e.underline),e.color!==void 0&&(t.color=e.color),e.family!==void 0&&(t.family=e.family),e.scheme!==void 0&&(t.scheme=e.scheme),e.vertAlign!==void 0&&e.vertAlign!=="baseline"&&(t.vertAlign=e.vertAlign),e.charset!==void 0&&(t.charset=e.charset),Object.keys(t).length>0?t:null}function Nr(e){if(!e)return null;let t={};if(e.patternType!==void 0){if(!Dr.has(e.patternType))throw new Error(`Unknown fill pattern '${e.patternType}'`);t.patternType=e.patternType}return e.fgColor!==void 0&&(t.fgColor=e.fgColor),e.bgColor!==void 0&&(t.bgColor=e.bgColor),Object.keys(t).length===0?null:(t.patternType===void 0&&(t.patternType="solid"),t)}function Or(e){if(!e)return null;if(e.style!==void 0&&!$r.has(e.style))throw new Error(`Unknown border style '${e.style}'`);let t={};return e.style!==void 0&&(t.style=e.style),e.color!==void 0&&(t.color=e.color),Object.keys(t).length>0?t:null}function kr(e){if(!e)return null;let t={};for(let r of["top","bottom","left","right","diagonal"]){let n=Or(e[r]);n&&(t[r]=n)}return e.diagonalUp&&(t.diagonalUp=!0),e.diagonalDown&&(t.diagonalDown=!0),e.outline===!1&&(t.outline=!1),Object.keys(t).length>0?t:null}function Xr(e){if(!e)return null;let t={};if(e.horizontal!==void 0){if(!Vr.has(e.horizontal))throw new Error(`Unknown horizontal alignment '${e.horizontal}'`);t.horizontal=e.horizontal}if(e.vertical!==void 0){if(!Lr.has(e.vertical))throw new Error(`Unknown vertical alignment '${e.vertical}'`);t.vertical=e.vertical}if(e.wrapText&&(t.wrapText=!0),e.shrinkToFit&&(t.shrinkToFit=!0),e.indent!==void 0){if(!Number.isInteger(e.indent)||e.indent<0||e.indent>250)throw new RangeError(`alignment.indent must be 0..250, got ${e.indent}`);t.indent=e.indent}if(e.textRotation!==void 0){let r=e.textRotation;if(!Number.isInteger(r)||!(r>=0&&r<=180||r===255))throw new RangeError(`alignment.textRotation must be 0..180 or 255, got ${r}`);t.textRotation=r}return e.justifyLastLine&&(t.justifyLastLine=!0),e.readingOrder!==void 0&&(t.readingOrder=e.readingOrder),Object.keys(t).length>0?t:null}function Mr(e){if(!e)return null;let t={};return e.locked===!1&&(t.locked=!1),e.hidden&&(t.hidden=!0),Object.keys(t).length>0?t:null}function ie(e){if(!e)return null;let t={};e.numFmt!==void 0&&e.numFmt!==""&&(t.numFmt=e.numFmt);let r=Je(e.font),n=Nr(e.fill),i=kr(e.border),s=Xr(e.alignment),l=Mr(e.protection);return r&&(t.font=r),n&&(t.fill=n),i&&(t.border=i),s&&(t.alignment=s),l&&(t.protection=l),Object.keys(t).length>0?t:null}var Hr='<font><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font>',Pr='<font><b/><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font>',zr='<fill><patternFill patternType="none"/></fill>',Wr='<fill><patternFill patternType="gray125"/></fill>',Gr='<fill><patternFill patternType="solid"><fgColor rgb="FFD9E1F2"/><bgColor indexed="64"/></patternFill></fill>',Qr="<border><left/><right/><top/><bottom/><diagonal/></border>",jr=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>','<xf numFmtId="14" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>','<xf numFmtId="22" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>','<xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/>','<xf numFmtId="0" fontId="0" fillId="2" borderId="0" xfId="0" applyFill="1"/>','<xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1"/>'];function be(e){let t="<font>";return e.name!==void 0&&(t+=`<name val="${b(e.name)}"/>`),e.charset!==void 0&&(t+=`<charset val="${e.charset}"/>`),e.family!==void 0&&(t+=`<family val="${e.family}"/>`),e.bold&&(t+="<b/>"),e.italic&&(t+="<i/>"),e.strike&&(t+="<strike/>"),e.outline&&(t+="<outline/>"),e.shadow&&(t+="<shadow/>"),e.condense&&(t+="<condense/>"),e.extend&&(t+="<extend/>"),e.color!==void 0&&(t+=Q(e.color)),e.size!==void 0&&(t+=`<sz val="${e.size}"/>`),e.underline!==void 0&&(t+=e.underline==="single"?"<u/>":`<u val="${e.underline}"/>`),e.vertAlign!==void 0&&(t+=`<vertAlign val="${e.vertAlign}"/>`),e.scheme!==void 0&&(t+=`<scheme val="${e.scheme}"/>`),`${t}</font>`}function qr(e){let r=`<fill><patternFill patternType="${e.patternType??"solid"}">`;return e.fgColor!==void 0&&(r+=Q(e.fgColor).replace("<color","<fgColor")),e.bgColor!==void 0&&(r+=Q(e.bgColor).replace("<color","<bgColor")),`${r}</patternFill></fill>`}function G(e,t){if(!t||t.style===void 0&&t.color===void 0)return`<${e}/>`;let r=`<${e}`;return t.style!==void 0&&(r+=` style="${t.style}"`),r+=">",t.color!==void 0&&(r+=Q(t.color)),`${r}</${e}>`}function et(e){let t="<border";return e.diagonalUp&&(t+=' diagonalUp="1"'),e.diagonalDown&&(t+=' diagonalDown="1"'),e.outline===!1&&(t+=' outline="0"'),t+=">",t+=G("left",e.left),t+=G("right",e.right),t+=G("top",e.top),t+=G("bottom",e.bottom),t+=G("diagonal",e.diagonal),`${t}</border>`}function tt(e){let t="<alignment";return e.horizontal!==void 0&&(t+=` horizontal="${e.horizontal}"`),e.vertical!==void 0&&(t+=` vertical="${e.vertical}"`),e.wrapText&&(t+=' wrapText="1"'),e.shrinkToFit&&(t+=' shrinkToFit="1"'),e.indent!==void 0&&(t+=` indent="${e.indent}"`),e.textRotation!==void 0&&(t+=` textRotation="${e.textRotation}"`),e.justifyLastLine&&(t+=' justifyLastLine="1"'),e.readingOrder!==void 0&&(t+=` readingOrder="${e.readingOrder}"`),`${t}/>`}function rt(e){let t="<protection";return e.locked===!1&&(t+=' locked="0"'),e.hidden&&(t+=' hidden="1"'),`${t}/>`}function Yr(e,t){let r="<dxf>";if(e.font&&(r+=be(e.font)),e.numFmt!==void 0&&t!==null&&(r+=`<numFmt numFmtId="${t}" formatCode="${b(e.numFmt)}"/>`),e.fill){let n=e.fill.bgColor??e.fill.fgColor;r+="<fill><patternFill>",n!==void 0&&(r+=Q(n).replace("<color","<bgColor")),r+="</patternFill></fill>"}return e.alignment&&(r+=tt(e.alignment)),e.border&&(r+=et(e.border)),e.protection&&(r+=rt(e.protection)),r+="</dxf>",r}var se=class{constructor(){this.numFmts=new Map;this.fontIds=new Map;this.fillIds=new Map;this.borderIds=new Map;this.xfIds=new Map;this.fonts=[Hr,Pr];this.fills=[zr,Wr,Gr];this.borders=[Qr];this.xfs=[...jr];this.styles=[null,null,null,null,null,null];this.dxfIds=new Map;this.dxfs=[];this.nextNumFmtId=165}numFmtIdFor(t){let r=this.numFmts.get(t);return r===void 0&&(r=this.nextNumFmtId++,this.numFmts.set(t,r)),r}register(t){let r=ie(t);if(r===null)return 0;let n=JSON.stringify(r),i=this.xfIds.get(n);if(i!==void 0)return i;let s=0;r.numFmt!==void 0&&(s=this.numFmtIdFor(r.numFmt));let l=0;if(r.font)if(r.font.bold&&Object.keys(r.font).length===1)l=1;else{let c=JSON.stringify(r.font),x=this.fontIds.get(c);x===void 0&&(x=this.fonts.length,this.fontIds.set(c,x),this.fonts.push(be(r.font))),l=x}let o=0;if(r.fill){let c=JSON.stringify(r.fill),x=this.fillIds.get(c);x===void 0&&(x=this.fills.length,this.fillIds.set(c,x),this.fills.push(qr(r.fill))),o=x}let a=0;if(r.border){let c=JSON.stringify(r.border),x=this.borderIds.get(c);x===void 0&&(x=this.borders.length,this.borderIds.set(c,x),this.borders.push(et(r.border))),a=x}let u=`<xf numFmtId="${s}" fontId="${l}" fillId="${o}" borderId="${a}" xfId="0"`;s!==0&&(u+=' applyNumberFormat="1"'),l!==0&&(u+=' applyFont="1"'),o!==0&&(u+=' applyFill="1"'),a!==0&&(u+=' applyBorder="1"'),r.alignment&&(u+=' applyAlignment="1"'),r.protection&&(u+=' applyProtection="1"');let f=(r.alignment?tt(r.alignment):"")+(r.protection?rt(r.protection):"");f?u+=`>${f}</xf>`:u+="/>";let d=this.xfs.length;return this.xfIds.set(n,d),this.xfs.push(u),this.styles.push(r),d}registerDxf(t){let r=ie(t);if(r===null)return-1;let n=JSON.stringify(r),i=this.dxfIds.get(n);if(i!==void 0)return i;let s=r.numFmt!==void 0?this.numFmtIdFor(r.numFmt):null,l=this.dxfs.length;return this.dxfIds.set(n,l),this.dxfs.push(Yr(r,s)),l}registerFormat(t){return this.register({numFmt:t})}toXml(){let t="";for(let[i,s]of this.numFmts)t+=`<numFmt numFmtId="${s}" formatCode="${b(i)}"/>`;let r=this.numFmts.size>0?`<numFmts count="${this.numFmts.size}">${t}</numFmts>`:"",n=this.dxfs.length>0?`<dxfs count="${this.dxfs.length}">${this.dxfs.join(`
|
|
6
|
+
`)}</dxfs>`:'<dxfs count="0"/>';return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
7
|
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
3
|
-
|
|
4
|
-
<fonts count="
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
${r}
|
|
9
|
+
<fonts count="${this.fonts.length}">
|
|
10
|
+
${this.fonts.join(`
|
|
11
|
+
`)}
|
|
7
12
|
</fonts>
|
|
8
|
-
<fills count="
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
${
|
|
13
|
+
<fills count="${this.fills.length}">
|
|
14
|
+
${this.fills.join(`
|
|
15
|
+
`)}
|
|
16
|
+
</fills>
|
|
17
|
+
<borders count="${this.borders.length}">
|
|
18
|
+
${this.borders.join(`
|
|
19
|
+
`)}
|
|
20
|
+
</borders>
|
|
21
|
+
<cellStyleXfs count="1">
|
|
22
|
+
<xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>
|
|
23
|
+
</cellStyleXfs>
|
|
24
|
+
<cellXfs count="${this.xfs.length}">
|
|
25
|
+
${this.xfs.join(`
|
|
13
26
|
`)}
|
|
14
27
|
</cellXfs>
|
|
15
|
-
<cellStyles count="1"
|
|
16
|
-
<
|
|
17
|
-
</styleSheet>`)}_writeWb(){let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4505"/><workbookPr defaultThemeVersion="124226"/><bookViews><workbookView xWindow="240" yWindow="15" windowWidth="16095" windowHeight="9660"/></bookViews><sheets>';for(let e of this._sl)t+=`<sheet name="${this._ex(e.name)}" sheetId="${e.id}"${e.hidden?' state="hidden"':""} r:id="${e.rId}"/>`;if(t+="</sheets>",this._afOn){t+="<definedNames>";for(let e of this._sl)e.fhr&&(t+=`<definedName name="_xlnm._FilterDatabase" localSheetId="${e.id-1}" hidden="1">${this._esc(e.fhr)}</definedName>`);t+="</definedNames>"}t+='<calcPr calcId="124519" fullCalcOnLoad="1"/></workbook>',this._zip.addFile("xl/workbook.xml",t)}_writeCt(){let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>';for(let e of this._sl)t+=`<Override PartName="/${e.path}" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`;t+="</Types>",this._zip.addFile("[Content_Types].xml",t)}_writeRels(){this._zip.addFile("_rels/.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>');let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';for(let r of this._sl)t+=`<Relationship Id="${r.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/${r.fn}"/>`;let e=this._sl.length+1;t+=`<Relationship Id="rId${e++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>`,t+=`<Relationship Id="rId${e++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>`,t+="</Relationships>",this._zip.addFile("xl/_rels/workbook.xml.rels",t)}};var e0=/[\\/*?[\]:]/g,U=class{constructor(){this._zip=new B,this._sheetCount=0,this._sheetList=[],this._sstDic=new Map,this._sstCntUnique=0,this._sstCntAll=0,this._colWidths=[],this._autofilterIsOn=!1,this._oaEpoch=Date.UTC(1899,11,30),this._isStreaming=!1,this._currentSheetBuffer=null,this._currentSheetRowNum=0,this._currentSheetStartCol=0,this._currentSheetEndCol=0,this._currentSheetDoAutofilter=!1,this._fmtMap=new Map,this._nextNid=167,this._nextXf=4,this._sheet1Bytes=new Uint8Array([129,1,0,147,1,23,203,4,2,0,64,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,148,1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,1,0,137,1,30,220,3,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,152,1,36,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,1,0,134,1,0,37,6,1,0,2,14,0,128,149,8,2,5,0,38,0,229,3,12,255,255,255,255,8,0,44,1,0,0,0,0,145,1,0,37,6,1,0,2,14,0,128,128,8,2,5,0,38,0,0,25,0,0,0,0,0,0,0,0,44,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,7,12,0,0,0,0,0,0,0,0,0,0,0,0,146,1,0,151,4,66,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,221,3,2,16,0,220,3,48,102,102,102,102,102,102,230,63,102,102,102,102,102,102,230,63,0,0,0,0,0,0,232,63,0,0,0,0,0,0,232,63,51,51,51,51,51,51,211,63,51,51,51,51,51,51,211,63,37,6,1,0,0,16,0,128,128,24,16,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,38,0,130,1,0]),this._workbookBinStart=new Uint8Array([131,1,0,128,1,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,120,0,108,0,1,0,0,0,55,0,1,0,0,0,54,0,5,0,0,0,50,0,52,0,51,0,50,0,54,0,153,1,12,32,0,1,0,0,0,0,0,0,0,0,0,37,6,1,0,3,15,0,128,151,16,52,24,0,0,0,67,0,58,0,92,0,115,0,113,0,108,0,115,0,92,0,84,0,101,0,115,0,116,0,121,0,90,0,97,0,112,0,105,0,115,0,117,0,88,0,108,0,115,0,98,0,92,0,38,0,37,6,1,0,0,16,0,128,129,24,130,1,0,0,0,0,0,0,0,0,47,0,0,0,49,0,51,0,95,0,110,0,99,0,114,0,58,0,49,0,95,0,123,0,49,0,54,0,53,0,48,0,56,0,68,0,54,0,57,0,45,0,67,0,70,0,56,0,55,0,45,0,52,0,55,0,54,0,57,0,45,0,56,0,52,0,53,0,54,0,45,0,68,0,52,0,65,0,52,0,48,0,49,0,49,0,51,0,49,0,53,0,54,0,55,0,125,0,47,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,135,1,0,37,6,1,0,2,16,0,128,128,24,16,0,0,0,0,13,0,0,0,255,255,255,255,0,0,0,0,38,0,158,1,29,0,0,0,0,158,22,0,0,180,105,0,0,232,38,0,0,88,2,0,0,0,0,0,0,0,0,0,0,120,136,1,0,143,1,0]),this._workbookBinMiddle=new Uint8Array([144,1,0]),this._workbookBinEnd=new Uint8Array([157,1,26,53,234,2,0,1,0,0,0,100,0,0,0,252,169,241,210,77,98,80,63,1,0,0,0,106,0,155,1,1,0,35,4,3,15,0,0,171,16,1,1,36,0,132,1,0]),this._stylesBin=new Uint8Array([150,2,0,231,4,4,2,0,0,0,44,44,164,0,19,0,0,0,121,0,121,0,121,0,121,0,92,0,45,0,109,0,109,0,92,0,45,0,100,0,100,0,92,0,32,0,104,0,104,0,58,0,109,0,109,0,44,30,166,0,12,0,0,0,121,0,121,0,121,0,121,0,92,0,45,0,109,0,109,0,92,0,45,0,100,0,100,0,232,4,0,227,4,4,2,0,0,0,43,39,220,0,0,0,144,1,0,0,0,2,0,0,7,1,0,0,0,0,0,255,2,7,0,0,0,67,0,97,0,108,0,105,0,98,0,114,0,105,0,43,39,220,0,1,0,188,2,0,0,0,2,238,0,7,1,0,0,0,0,0,255,2,7,0,0,0,67,0,97,0,108,0,105,0,98,0,114,0,105,0,37,6,1,0,2,14,0,128,129,8,0,38,0,228,4,0,219,4,4,2,0,0,0,45,68,0,0,0,0,3,64,0,0,0,0,0,255,3,65,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,68,17,0,0,0,3,64,0,0,0,0,0,255,3,65,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,220,4,0,229,4,4,1,0,0,0,46,51,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,230,4,0,242,4,4,1,0,0,0,47,16,255,255,0,0,0,0,0,0,0,0,0,0,16,16,0,0,243,4,0,233,4,4,6,0,0,0,47,16,0,0,0,0,0,0,0,0,0,0,0,0,16,16,0,0,47,16,0,0,164,0,0,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,166,0,0,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,1,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,0,0,1,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,1,0,1,0,0,0,0,0,16,16,1,0,234,4,0,235,4,4,1,0,0,0,37,6,1,0,2,17,0,128,128,24,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,48,28,0,0,0,0,1,0,0,0,8,0,0,0,78,0,111,0,114,0,109,0,97,0,108,0,110,0,121,0,236,4,0,249,3,4,0,0,0,0,250,3,0,252,3,80,0,0,0,0,17,0,0,0,84,0,97,0,98,0,108,0,101,0,83,0,116,0,121,0,108,0,101,0,77,0,101,0,100,0,105,0,117,0,109,0,50,0,17,0,0,0,80,0,105,0,118,0,111,0,116,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,54,0,253,3,0,35,4,2,14,0,0,235,8,0,246,8,42,0,0,0,0,17,0,0,0,83,0,108,0,105,0,99,0,101,0,114,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,247,8,0,236,8,0,36,0,35,4,3,15,0,0,176,16,0,178,16,50,0,0,0,0,21,0,0,0,84,0,105,0,109,0,101,0,83,0,108,0,105,0,99,0,101,0,114,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,179,16,0,177,16,0,36,0,151,2,0]),this._binaryIndexBin=new Uint8Array([42,24,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,149,2,0]),this._rRkIntegerLowerLimit=-1<<29,this._rRkIntegerUpperLimit=(1<<29)-1,this._autoFilterStartBytes=new Uint8Array([161,1,16]),this._autoFilterEndBytes=new Uint8Array([162,1,0]),this._stickHeaderA1bytes=new Uint8Array([151,1,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,1,0,0,0,0,0,0,0,2,0,0,0,3]),this._magicFilterExcel2016Fix0=new Uint8Array([225,2,0,229,2,0,234,2]),this._magicFilterExcel2016Fix1=new Uint8Array([39,70,33,0,0,0,0,255,0,0,0,15,0,0,0,95,0,70,0,105,0,108,0,116,0,101,0,114,0,68,0,97,0,116,0,97,0,98,0,97,0,115,0,101,0,15,0,0,0,59,255,0]),this._magicFilterExcel2016Fix2=new Uint8Array([0,0,0,0,255,255,255,255])}_sanitizeSheetName(t){if(!t||typeof t!="string")return`Sheet${this._sheetCount+1}`;let e=t.replace(e0,"_");return e.length>31&&(e=e.substring(0,31)),e.trim().length===0&&(e=`Sheet${this._sheetCount+1}`),e}_registerFormat(t){let e=this._fmtMap.get(t);if(e!==void 0)return e.xf;let r=this._nextNid++,x=this._nextXf++;return this._fmtMap.set(t,{nid:r,xf:x}),x}_buildStylesBin(){if(this._fmtMap.size===0)return this._stylesBin;let t=this._stylesBin,e=-1;for(let m=3;m<t.length-3;m++)if(t[m]===232&&t[m+1]===4&&t[m+2]===0){e=m;break}let r=-1;for(let m=e+3;m<t.length-2;m++)if(t[m]===233&&t[m+1]===4){r=m;break}let x=-1;for(let m=r;m<t.length-3;m++)if(t[m]===234&&t[m+1]===4&&t[m+2]===0){x=m;break}let i=-1;for(let m=e+3;m<t.length-2;m++)if(t[m]===227&&t[m+1]===4){i=m;break}let l=2+this._fmtMap.size,o=4+this._fmtMap.size,s=[];function u(m){let w=[];for(;m>=128;)w.push(m&127|128),m>>>=7;return w.push(m&127),w}function d(m,w){return new Uint8Array([...u(m),...u(w.length),...w])}function a(m,w){let D=w.length,$=6+D*2,_=new Uint8Array(2+$);_[0]=44,_[1]=$;let b=new DataView(_.buffer);b.setUint16(2,m,!0),b.setUint32(4,D,!0);for(let T=0;T<D;T++){let O=w.charCodeAt(T);_[8+T*2]=O&255,_[8+T*2+1]=O>>8&255}return _}function n(m,w,D,$=0){let _=new Uint8Array(18),b=new DataView(_.buffer);return _[0]=47,_[1]=16,b.setUint16(2,m,!0),b.setUint16(4,w,!0),_[6]=$,_[14]=16,_[15]=16,b.setUint16(16,D,!0),_}s.push(t.subarray(0,3));let f=new Uint8Array(4);new DataView(f.buffer).setUint16(0,l,!0),s.push(d(615,f)),s.push(a(164,"yyyy\\-mm\\-dd\\ hh:mm:ss")),s.push(a(166,"yyyy\\-mm\\-dd"));for(let[m,w]of this._fmtMap)s.push(a(w.nid,m));s.push(d(616,new Uint8Array(0))),s.push(t.subarray(i,r));let c=new Uint8Array(4);new DataView(c.buffer).setUint16(0,o,!0),s.push(d(617,c)),s.push(n(0,0,0)),s.push(n(0,164,1)),s.push(n(0,166,1)),s.push(n(1,0,0,1));let p=[...this._fmtMap.entries()].sort((m,w)=>m[1].xf-w[1].xf);for(let[,m]of p)s.push(n(0,m.nid,1));s.push(d(618,new Uint8Array(0))),s.push(t.subarray(x+3));let F=0;for(let m of s)F+=m.length;let A=new Uint8Array(F),M=0;for(let m of s)A.set(m,M),M+=m.length;return A}addSheet(t,e=!1){let r=this._sanitizeSheetName(t);this._sheetCount++,this._sheetList.push({name:r,pathInArchive:`xl/worksheets/sheet${this._sheetCount}.bin`,hidden:e,nameInArchive:`sheet${this._sheetCount}.bin`,sheetId:this._sheetCount,filterHeaderRange:null})}startSheet(t,e,r,x={}){if(this._isStreaming)throw new Error("Already streaming");if(I(e),r!==void 0){S("header",r.length,e);for(let u of r)y(u)}let{hidden:i=!1,doAutofilter:l=!0,headerStyle:o="bold"}=x,s=3;if(o==="fill"?s=4:o==="bold+fill"&&(s=5),this.addSheet(t,i),this._isStreaming=!0,this._currentSheetBuffer=new g,this._currentSheetRowNum=0,this._currentSheetStartCol=0,this._currentSheetEndCol=e,this._currentSheetDoAutofilter=l&&r!==void 0,this._colWidths=new Array(e).fill(-1),r)for(let u=0;u<e;u++){let a=1.3*(r[u]?r[u].length:0)+3;a>80&&(a=80),this._colWidths[u]<a&&(this._colWidths[u]=a)}if(this._writeSheetHeader(this._currentSheetBuffer,this._currentSheetStartCol,this._currentSheetEndCol,this._currentSheetDoAutofilter),r){this.createRowHeader(this._currentSheetBuffer,this._currentSheetRowNum,this._currentSheetStartCol,this._currentSheetEndCol);for(let u=0;u<r.length;u++)this.writeString(this._currentSheetBuffer,r[u],u,s);this._currentSheetRowNum++}}writeRow(t){let e=this._currentSheetBuffer;if(!this._isStreaming||e===null)throw new Error("Not streaming");if(t.length!==this._currentSheetEndCol-this._currentSheetStartCol)throw new Error(`Row length mismatch. Expected ${this._currentSheetEndCol-this._currentSheetStartCol} columns, got ${t.length}`);v(this._currentSheetRowNum+1),this.createRowHeader(e,this._currentSheetRowNum,this._currentSheetStartCol,this._currentSheetEndCol);for(let r=0;r<t.length;r++)this._writeCell(e,t[r],r);this._currentSheetRowNum++}endSheet(){let t=this._currentSheetBuffer;if(!this._isStreaming||t===null)throw new Error("Not streaming");if(t.write(this._sheet1Bytes.subarray(218,290)),this._currentSheetDoAutofilter){this._autofilterIsOn=!0,t.write(this._autoFilterStartBytes);let e=new Uint8Array(8),r=new DataView(e.buffer);r.setInt32(0,0,!0),r.setInt32(4,this._currentSheetRowNum-1,!0),t.write(e);let x=new Uint8Array(8),i=new DataView(x.buffer);i.setInt32(0,this._currentSheetStartCol,!0),i.setInt32(4,this._currentSheetEndCol-1,!0),t.write(x),t.write(this._autoFilterEndBytes),this._sheetList[this._sheetCount-1].filterData={startRow:0,endRow:this._currentSheetRowNum-1,startColumn:this._currentSheetStartCol,endColumn:this._currentSheetEndCol-1}}t.write(this._sheet1Bytes.subarray(290)),this._zip.addFile(this._sheetList[this._sheetCount-1].pathInArchive,t.toUint8Array()),this._isStreaming=!1,this._currentSheetBuffer=null}writeSheet(t,e=null,r={}){let x=r.doAutofilter!==!1,i=r.headerStyle||"bold",l=3;i==="fill"?l=4:i==="bold+fill"&&(l=5);let o=new g,s=t.length>0?t[0].length:e?e.length:0;s>0&&I(s);let u=t.length+(e?1:0);if(v(u),e){S("header",e.length,s);for(let n of e)y(n)}for(let n=0;n<t.length;n++)S("row",t[n].length,s);if(this._colWidths=new Array(s).fill(-1),e)for(let n=0;n<s;n++){let c=1.3*(e[n]?e[n].length:0)+3;c>80&&(c=80),this._colWidths[n]<c&&(this._colWidths[n]=c)}for(let n=0;n<Math.min(t.length,100);n++)for(let f=0;f<t[n].length;f++){let c=t[n][f];if(c==null)continue;let p=C(c)?c.value:c;if(p==null)continue;let A=1.3*(p instanceof Date?10:p.toString().length)+3;A>80&&(A=80),this._colWidths[f]<A&&(this._colWidths[f]=A)}let d=x&&!!e;this._writeSheetHeader(o,0,s,d);let a=0;if(e){this.createRowHeader(o,a,0,s);for(let n=0;n<e.length;n++)this.writeString(o,e[n],n,l);a++}for(let n=0;n<t.length;n++){this.createRowHeader(o,a,0,s);for(let f=0;f<t[n].length;f++)this._writeCell(o,t[n][f],f);a++}if(o.write(this._sheet1Bytes.subarray(218,290)),d){this._autofilterIsOn=!0,o.write(this._autoFilterStartBytes);let n=new Uint8Array(8),f=new DataView(n.buffer);f.setInt32(0,0,!0),f.setInt32(4,a-1,!0),o.write(n);let c=new Uint8Array(8),p=new DataView(c.buffer);p.setInt32(0,0,!0),p.setInt32(4,s-1,!0),o.write(c),o.write(this._autoFilterEndBytes),this._sheetList[this._sheetCount-1].filterData={startRow:0,endRow:a,startColumn:0,endColumn:s-1}}o.write(this._sheet1Bytes.subarray(290)),this._zip.addFile(this._sheetList[this._sheetCount-1].pathInArchive,o.toUint8Array())}_writeSheetHeader(t,e,r,x){let i=new Uint8Array(this._sheet1Bytes),l=new DataView(i.buffer);l.setInt32(40,e,!0),l.setInt32(44,r,!0),this._sheetCount!==1&&(i[54]=156),t.write(i.subarray(0,84)),x&&t.write(this._stickHeaderA1bytes),t.write(i.subarray(84,159)),t.writeByte(134),t.writeByte(3);for(let o=e;o<r;o++){t.writeByte(0),t.writeByte(60),t.writeByte(18),t.writeInt32LE(o),t.writeInt32LE(o);let s=this._colWidths[o]>0?this._colWidths[o]:10;t.writeInt32LE(Math.round(s*256)),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(2)}t.writeByte(0),t.writeByte(135),t.writeByte(3),t.writeByte(0),t.write(i.subarray(159,175)),t.write(new Uint8Array([38,0]))}_writeCell(t,e,r){if(e==null)return;let x=L(e),i=R(e),l=x!==null?this._registerFormat(x):0;if(typeof i=="number")Number.isInteger(i)&&i>=this._rRkIntegerLowerLimit&&i<=this._rRkIntegerUpperLimit?this.writeRkNumberInteger(t,i,r,l):this.writeDouble(t,i,r,l);else if(typeof i=="bigint")this.writeString(t,i.toString(),r);else if(typeof i=="boolean")this.writeBool(t,i,r);else if(i instanceof Date){let o=k(i.getTime(),this._oaEpoch);this.writeDouble(t,o,r,x!==null?l:1)}else i!=null&&this.writeString(t,i.toString(),r,0,x!==null?l:void 0)}createRowHeader(t,e,r,x){t.ensureCapacity(27),t.writeUnsafeByte(0),t.writeUnsafeByte(25),t.writeUnsafeInt32LE(e),t.writeUnsafeInt32LE(0),t.writeUnsafeByte(44),t.writeUnsafeByte(1),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(1),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(r),t.writeUnsafeInt32LE(x)}writeRkNumberInteger(t,e,r,x=0){t.ensureCapacity(14),t.writeUnsafeByte(2),t.writeUnsafeByte(12),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(x),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(e<<2|2)}writeDouble(t,e,r,x=0){t.ensureCapacity(18),t.writeUnsafeByte(5),t.writeUnsafeByte(16),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(x),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeDoubleLE(e)}writeBool(t,e,r){t.ensureCapacity(13),t.writeUnsafeByte(4),t.writeUnsafeByte(9),t.writeUnsafeInt32LE(r),t.writeUnsafeInt32LE(0),t.writeUnsafeByte(e?1:0)}writeDateTime(t,e,r){this.writeDouble(t,k(e.getTime(),this._oaEpoch),r,1)}writeString(t,e,r,x=0,i){y(e);let l=this._sstDic.get(e);l===void 0&&(l=this._sstCntUnique++,this._sstDic.set(e,l)),this._sstCntAll++;let o=i!==void 0?i:x;t.ensureCapacity(17),t.writeUnsafeByte(7),t.writeUnsafeByte(12),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(o),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(l)}_saveSst(){let t=new g;t.writeByte(159),t.writeByte(1),t.writeByte(8),t.writeInt32LE(this._sstCntAll),t.writeInt32LE(this._sstCntUnique);for(let[e]of this._sstDic){let r=e.length;t.writeByte(19);let x=5+2*r;if(x>=128){t.writeByte(128+x%128);let i=x>>7;i>=256?t.writeByte(128+i%128):t.writeByte(i),t.writeByte(x>>14),x>>14>0&&t.writeByte(0)}else t.writeByte(x&255),t.writeByte(x>>8&255);t.writeInt32LE(r),t.writeUtf16LE(e)}t.writeByte(160),t.writeByte(1),t.writeByte(0),this._zip.addFile("xl/sharedStrings.bin",t.toUint8Array())}_writeFilterDefinedName(t,e,r){let x=e.filterData,i=new Uint8Array(this._magicFilterExcel2016Fix1);i[7]=e.sheetId-1,i[i.length-2]=r,t.push(i);let l=new Uint8Array(8),o=new DataView(l.buffer);o.setInt32(0,x.startRow,!0),o.setInt32(4,x.endRow,!0),t.push(l);let s=new Uint8Array(4),u=new DataView(s.buffer);u.setInt16(0,x.startColumn,!0),u.setInt16(2,x.endColumn,!0),t.push(s),t.push(this._magicFilterExcel2016Fix2)}finalize(){this._saveSst(),this._zip.addFile("xl/styles.bin",this._buildStylesBin());let t=[this._workbookBinStart];for(let o of this._sheetList){let s=`rId${o.sheetId}`,u=o.name,d=16+u.length*2+s.length*2,a=new Uint8Array(3+d),n=new DataView(a.buffer);a[0]=156,a[1]=1,a[2]=d;let f=3;n.setInt32(f,o.hidden?1:0,!0),f+=4,n.setInt32(f,o.sheetId,!0),f+=4,n.setInt32(f,s.length,!0),f+=4;for(let c=0;c<s.length;c++){let p=s.charCodeAt(c);a[f++]=p&255,a[f++]=p>>8&255}n.setInt32(f,u.length,!0),f+=4;for(let c=0;c<u.length;c++){let p=u.charCodeAt(c);a[f++]=p&255,a[f++]=p>>8&255}t.push(a)}if(t.push(this._workbookBinMiddle),this._autofilterIsOn){let o=this._sheetList.filter(s=>s.filterData!==void 0);if(o.length>0){t.push(this._magicFilterExcel2016Fix0);let s=o.length,u=s<=20?16+(s-1)*12:128+(s-21)*12;t.push(s<=10?new Uint8Array([u,s,0,0,0]):new Uint8Array([u,Math.floor((s-1)/10),s,0,0,0]));for(let d=0;d<o.length;d++){let a=o[d].sheetId-1,n=new Uint8Array(12);n[4]=a,n[8]=a,t.push(n)}t.push(new Uint8Array([226,2,0]));for(let d=0;d<o.length;d++)this._writeFilterDefinedName(t,o[d],d)}}t.push(this._workbookBinEnd);let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),x=0;for(let o of t)r.set(o,x),x+=o.length;this._zip.addFile("xl/workbook.bin",r);for(let o of this._sheetList)this._zip.addFile(`xl/worksheets/binaryIndex${o.sheetId}.bin`,this._binaryIndexBin);let i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
28
|
+
<cellStyles count="1">
|
|
29
|
+
<cellStyle name="Normal" xfId="0" builtinId="0"/>
|
|
30
|
+
</cellStyles>
|
|
31
|
+
${n}
|
|
32
|
+
<tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/>
|
|
33
|
+
</styleSheet>`}};function Zr(e){return typeof e=="string"?`s:${e}`:`r:${JSON.stringify(e.runs)}`}function nt(e){let t="";for(let r of e.runs){t+="<r>";let n=Je(r.style?.font);n&&(t+=be(n).replace("<font>","<rPr>").replace("</font>","</rPr>")),t+=`<t xml:space="preserve">${$(r.text)}</t></r>`}return t}function Kr(e){if(typeof e!="string")return`<si>${nt(e)}</si>`;let t=$(e);return t.length>0&&(t[0]===" "||t[t.length-1]===" "||/[\t\n\r]/.test(t))?`<si><t xml:space="preserve">${t}</t></si>`:`<si><t>${t}</t></si>`}function it(e,t){let r='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';r+=`<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${t}" uniqueCount="${e.length}">`;for(let n of e)r+=Kr(n);return r+="</sst>",r}function st(e,t){let r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
34
|
+
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
35
|
+
<fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4505"/>
|
|
36
|
+
<workbookPr defaultThemeVersion="124226"/>
|
|
37
|
+
<bookViews><workbookView xWindow="240" yWindow="15" windowWidth="16095" windowHeight="9660"/></bookViews>
|
|
38
|
+
<sheets>`;for(let n of e){let i=n.hidden?' state="hidden"':"";r+=`<sheet name="${b(n.name)}" sheetId="${n.sheetId}"${i} r:id="${n.rId}"/>`}if(r+="</sheets>",t){r+="<definedNames>";for(let n of e){if(!n.filterHeaderRange)continue;let i=$(n.filterHeaderRange);r+=`<definedName name="_xlnm._FilterDatabase" localSheetId="${n.sheetId-1}" hidden="1">${i}</definedName>`}r+="</definedNames>"}return r+='<calcPr calcId="124519" fullCalcOnLoad="1"/></workbook>',r}function ot(e,t){let r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
39
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
40
|
+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
41
|
+
<Default Extension="xml" ContentType="application/xml"/>
|
|
42
|
+
${t&&t.length>0?'<Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing"/>':""}
|
|
43
|
+
<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
|
|
44
|
+
<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
|
|
45
|
+
<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>`;for(let n of e)r+=`<Override PartName="/${n.pathInArchive}" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`;for(let n of t??[])r+=`<Override PartName="/${n.path}" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"/>`;return r+="</Types>",r}function lt(e){let t=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
46
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
47
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
|
|
48
|
+
</Relationships>`,r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
49
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`;for(let i of e)r+=`<Relationship Id="${i.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/${i.nameInArchive}"/>`;let n=e.length+1;return r+=`<Relationship Id="rId${n++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>`,r+=`<Relationship Id="rId${n++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>`,r+="</Relationships>",{global:t,workbook:r}}function Se(e,t){let{dimensionRef:r,columnCount:n,isFirstSheet:i,hasHeaders:s,colWidths:l}=t;e.writeString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),e.writeString('<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'),e.writeString(`<dimension ref="${r}"/>`),s?e.writeString(i?'<sheetViews><sheetView tabSelected="1" workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen" /><selection pane="bottomLeft" /></sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>':'<sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen" /><selection pane="bottomLeft" /></sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>'):e.writeString(i?'<sheetViews><sheetView tabSelected="1" workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/>':'<sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/>'),e.writeString("<cols>");for(let o=0;o<n;o++){let a=re(l[o]);e.writeString(`<col min="${o+1}" max="${o+1}" width="${Ze(a)}" bestFit="1" customWidth="1" />`)}e.writeString("</cols><sheetData>")}function _e(e,t){let{doAutofilter:r,columnCount:n,lastColumnLetter:i,rowNum:s,sheetName:l,merges:o,hyperlinks:a,dataValidations:u,conditionalFormats:f,legacyDrawingRId:d,cfPriorityStart:c=1,registerDxf:x}=t;e.writeString("</sheetData>");let m=null;if(r&&n>0){let h=`A1:${i}${s}`;e.writeString(`<autoFilter ref="${h}"/>`),m=`${vr(l)}!$A$1:$${i}$${s}`}if(o&&o.length>0){e.writeString(`<mergeCells count="${o.length}">`);for(let h of o)e.writeString(`<mergeCell ref="${g(h)}"/>`);e.writeString("</mergeCells>")}return f&&f.length>0&&sn(e,f,c,x),u&&u.length>0&&rn(e,u),a&&a.length>0&&on(e,a),d&&e.writeString(`<legacyDrawing r:id="${d}"/>`),e.writeString("</worksheet>"),m}function Jr(e){let t=/^([A-Za-z]{1,3})(\d+)$/.exec(e.trim());if(!t)throw new Error(`Invalid cell reference '${e}'`);let r=0;for(let n of t[1].toUpperCase())r=r*26+(n.charCodeAt(0)-64);return{col:r-1,row:parseInt(t[2],10)-1}}function at(e){let t=[],r=new Map;for(let i of e){let s=i.author??"";r.has(s)||(r.set(s,t.length),t.push(s))}let n='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';n+='<comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors>';for(let i of t)n+=`<author>${$(i)}</author>`;n+="</authors><commentList>";for(let i of e){let s=$(i.text),l=s.length>0&&(s[0]===" "||s[s.length-1]===" "||/[\t\n\r]/.test(s))?' xml:space="preserve"':"";n+=`<comment ref="${g(i.ref)}" authorId="${r.get(i.author??"")}"><text><t${l}>${s}</t></text></comment>`}return n+="</commentList></comments>",n}function ut(e){let i='<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">';i+='<v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>';let s=1025;for(let l of e){let{col:o,row:a}=Jr(l.ref);i+=`<v:shape id="_x0000_s${s++}" type="#_x0000_t202" style="position:absolute;margin-left:59.25pt;margin-top:1.5pt;width:108pt;height:59.25pt;z-index:1;visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto"><v:fill color2="#ffffe1"/><v:shadow on="t" color="black" obscured="t"/><v:path o:connecttype="none"/><v:textbox style="mso-direction-alt:auto"><div style="text-align:left"/></v:textbox><x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:AutoFill>False</x:AutoFill><x:Row>${a}</x:Row><x:Column>${o}</x:Column></x:ClientData></v:shape>`}return i+="</xml>",i}function ft(e){let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';t+='<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';for(let r of e)t+=`<Relationship Id="${r.id}" Type="${r.type}" Target="${b(r.target)}"`,r.external&&(t+=' TargetMode="External"'),t+="/>";return t+="</Relationships>",t}var dt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",ct="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",xt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";function ht(e,t,r,n,i){let s=Zr(r),l=t.index.get(s);l===void 0&&(l=t.values.length,t.values.push(r),t.index.set(s,l));let o=i!==void 0?` s="${i}"`:"";e.writeString(`<c${n} t="s"${o}><v>${l}</v></c>`)}function mt(e,t,r,n){let i=n!==void 0?` s="${n}"`:"";if(typeof t!="string"){e.writeString(`<c${r} t="inlineStr"${i}><is>${nt(t)}</is></c>`);return}let s=$(t);s.length>0&&(s[0]===" "||s[s.length-1]===" "||/[\t\n\r]/.test(s))?e.writeString(`<c${r} t="inlineStr"${i}><is><t xml:space="preserve">${s}</t></is></c>`):e.writeString(`<c${r} t="inlineStr"${i}><is><t>${s}</t></is></c>`)}var en={whole:"whole",decimal:"decimal",list:"list",date:"date",time:"time",textLength:"textLength",custom:"custom"},tn={between:"between",notBetween:"notBetween",equal:"equal",notEqual:"notEqual",lessThan:"lessThan",lessThanOrEqual:"lessThanOrEqual",greaterThan:"greaterThan",greaterThanOrEqual:"greaterThanOrEqual"};function rn(e,t){if(t.length!==0){e.writeString(`<dataValidations count="${t.length}">`);for(let r of t){let n=` type="${en[r.type]}" sqref="${g(r.sqref)}"`;if(r.operator!==void 0&&(n+=` operator="${tn[r.operator]}"`),r.allowBlank&&(n+=' allowBlank="1"'),r.showDropdown===!1&&(n+=' showDropDown="1"'),r.showInputMessage&&(n+=' showInputMessage="1"'),r.showErrorMessage&&(n+=' showErrorMessage="1"'),r.errorStyle!==void 0&&(n+=` errorStyle="${r.errorStyle}"`),r.promptTitle!==void 0&&(n+=` promptTitle="${b(r.promptTitle)}"`),r.prompt!==void 0&&(n+=` prompt="${b(r.prompt)}"`),r.errorTitle!==void 0&&(n+=` errorTitle="${b(r.errorTitle)}"`),r.error!==void 0&&(n+=` error="${b(r.error)}"`),e.writeString(`<dataValidation${n}>`),r.values!==void 0){let i=r.values.map(s=>s.replace(/"/g,'""')).join(",");e.writeString(`<formula1>"${g(i)}"</formula1>`)}else r.formula1!==void 0&&e.writeString(`<formula1>${g(r.formula1.replace(/^=/,""))}</formula1>`);r.formula2!==void 0&&e.writeString(`<formula2>${g(r.formula2.replace(/^=/,""))}</formula2>`),e.writeString("</dataValidation>")}e.writeString("</dataValidations>")}}function nn(e){return(e.trim().split(/\s+/)[0]??"A1").split(":")[0]||"A1"}function sn(e,t,r,n){let i=r;for(let s of t){e.writeString(`<conditionalFormatting sqref="${g(s.sqref)}">`);let l=nn(s.sqref);for(let o of s.rules){let a=i++,u="style"in o&&o.style?n?.(o.style)??-1:-1,f=u>=0?` dxfId="${u}"`:"";switch(o.type){case"cellIs":{let d=` type="cellIs" operator="${o.operator}" priority="${a}"${f}`;o.stopIfTrue&&(d+=' stopIfTrue="1"'),e.writeString(`<cfRule${d}>`);for(let c of o.formula)e.writeString(`<formula>${g(c.replace(/^=/,""))}</formula>`);e.writeString("</cfRule>");break}case"expression":{let d=` type="expression" priority="${a}"${f}`;o.stopIfTrue&&(d+=' stopIfTrue="1"'),e.writeString(`<cfRule${d}><formula>${g(o.formula.replace(/^=/,""))}</formula></cfRule>`);break}case"colorScale":{e.writeString(`<cfRule type="colorScale" priority="${a}"><colorScale>`);for(let d of o.cfvo)e.writeString(`<cfvo type="${d.type}"${d.value!==void 0?` val="${g(d.value)}"`:""}/>`);for(let d of o.colors)e.writeString(`<color rgb="${we(d).slice(4)}"/>`);e.writeString("</colorScale></cfRule>");break}case"dataBar":{e.writeString(`<cfRule type="dataBar" priority="${a}"><dataBar${o.showValue===!1?' showValue="0"':""}>`);for(let d of o.cfvo)e.writeString(`<cfvo type="${d.type}"${d.value!==void 0?` val="${g(d.value)}"`:""}/>`);e.writeString(`<color rgb="${we(o.color).slice(4)}"/></dataBar></cfRule>`);break}case"iconSet":{let d=` type="iconSet" priority="${a}"`;o.showValue===!1&&(d+=' showValue="0"'),o.reverse&&(d+=' reverse="1"'),e.writeString(`<cfRule${d}><iconSet iconSet="${o.iconSet??"3TrafficLights1"}">`);for(let c of o.cfvo??[])e.writeString(`<cfvo type="${c.type}"${c.value!==void 0?` val="${g(c.value)}"`:""}/>`);e.writeString("</iconSet></cfRule>");break}case"top10":{let d=` type="top10" priority="${a}"${f}`;o.rank!==void 0&&(d+=` rank="${o.rank}"`),o.percent&&(d+=' percent="1"'),o.bottom&&(d+=' bottom="1"'),e.writeString(`<cfRule${d}/>`);break}case"duplicateValues":case"uniqueValues":e.writeString(`<cfRule type="${o.type}" priority="${a}"${f}/>`);break;case"containsText":case"notContainsText":case"beginsWith":case"endsWith":{let d=o.type==="containsText"?"containsText":o.type==="notContainsText"?"notContains":o.type==="beginsWith"?"beginsWith":"endsWith",c=o.text.replace(/"/g,'""');e.writeString(`<cfRule type="${o.type}" operator="${d}" text="${b(o.text)}" priority="${a}"${f}><formula>${g(`NOT(ISERROR(SEARCH("${c}",${l})))`)}</formula></cfRule>`);break}}}e.writeString("</conditionalFormatting>")}}function on(e,t){if(t.length!==0){e.writeString("<hyperlinks>");for(let{spec:r,rId:n}of t){let i=` ref="${g(r.ref)}"`;n&&(i+=` r:id="${n}"`),r.location!==void 0&&(i+=` location="${b(r.location)}"`),r.tooltip!==void 0&&(i+=` tooltip="${b(r.tooltip)}"`),r.display!==void 0&&(i+=` display="${b(r.display)}"`),e.writeString(`<hyperlink${i}/>`)}e.writeString("</hyperlinks>")}}function ln(e,t,r,n,i,s,l){let o=r.formula.trim().replace(/^=/,"");if(!o)throw new Error("FormulaCell.formula must not be empty");let a=r.value,u="",f="";if(a instanceof _)u=' t="e"',f=`<v>${g(a.code)}</v>`;else if(a instanceof Date){let d=t.toOaDate(a),c=i||` s="${F(a)?l:s}"`;e.writeString(`<c${n}${c}><f>${g(o)}</f><v>${d}</v></c>`);return}else typeof a=="number"&&Number.isFinite(a)?f=`<v>${a}</v>`:typeof a=="boolean"?(u=' t="b"',f=`<v>${a?1:0}</v>`):a!=null&&(u=' t="str"',f=`<v>${g(String(a))}</v>`);e.writeString(`<c${n}${u}${i}><f>${g(o)}</f>${f}</c>`)}function Be(e,t,r,n,i,s,l,o=1,a=2){if(r==null)return i;let u=N(r),f=u!==null?t.registerStyle(u):-1,d=f>0?` s="${f}"`:"",c=Ke(n,i,s,l),x=f>0?f:void 0;if(K(r)!==null)return ln(e,t,r,c,d,o,a),n;let h=O(r);if(h==null)return i;if(E(h))t.writeStringCell(e,h,c,x);else if(typeof h=="number")Number.isFinite(h)?e.writeString(`<c${c}${d}><v>${h}</v></c>`):t.writeStringCell(e,h.toString(),c,x);else if(h instanceof _)e.writeString(`<c${c} t="e"${d}><v>${g(h.code)}</v></c>`);else if(typeof h=="bigint")t.writeStringCell(e,h.toString(),c,x);else if(typeof h=="boolean")e.writeString(`<c${c} t="b"${d}><v>${h?1:0}</v></c>`);else if(h instanceof Date){let y=t.toOaDate(h);if(Number.isFinite(y)){let R=f>0?f:F(h)?a:o;e.writeString(`<c${c} s="${R}"><v>${y}</v></c>`)}else t.writeStringCell(e,h.toString(),c,x)}else t.writeStringCell(e,h.toString(),c,x);return n}function gt(e){return e==="fill"?4:e==="bold+fill"?5:3}var D=class{constructor(t={}){this._sheetCount=0;this._sheets=[];this._sstValues=[];this._sstIndex=new Map;this._sstCount=0;this._autofilterOn=!1;this._oaEpoch=Date.UTC(1899,11,30);this._styles=new se;this._streamBuffer=null;this._streamRowNum=0;this._streamColumnCount=0;this._streamDoAutofilter=!1;this._streamColLetters=[];this._streamColWidths=[];this._streamPending=null;this._streamHeadFlushed=!0;this._streamHasHeaders=!1;this._streamDataRows=0;this._streamAutofitRows=U;this._zip=new C,this._useSharedStrings=t.useSharedStrings!==!1}addSheet(t,r=!1){let n=this._sanitizeSheetName(t);this._sheetCount++;let i=`sheet${this._sheetCount}.xml`;this._sheets.push({name:n,pathInArchive:`xl/worksheets/${i}`,nameInArchive:i,hidden:r,sheetId:this._sheetCount,rId:`rId${this._sheetCount}`,filterHeaderRange:null})}_cl(t){return Z(t)}_sanitizeSheetName(t){if(!t||typeof t!="string")return`Sheet${this._sheetCount+1}`;let r=t.replace(/[\\/*?[\]:]/g,"_");return r.length>31&&(r=r.substring(0,31)),r.trim()||(r=`Sheet${this._sheetCount+1}`),r}writeStringCell(t,r,n,i){if(I(typeof r=="string"?r:r.toString()),this._useSharedStrings){ht(t,{values:this._sstValues,index:this._sstIndex},r,n,i),this._sstCount++;return}mt(t,r,n,i)}registerStyle(t){return this._styles.register(t)}registerFormat(t){return this._styles.registerFormat(t)}toOaDate(t){return k(t.getTime(),this._oaEpoch)}_resolveColumnWidths(t,r,n,i,s){let l=J(t);if(i.columnWidths){for(let u=0;u<t;u++){let f=i.columnWidths[u];f!=null&&(l[u]=ne(f,u))}return l}if(i.autofit===!1)return l;r&&te(l,r,t,{bold:i.headerStyle!=="fill",filterButton:s});let o=i.sampleRows??n,a=i.sampleRows?o?.length??0:H(i.autofitRows);return o&&a>0&&P(l,o,a),l}_applySheetFeatures(t,r){r.merges&&(t.merges=r.merges),r.dataValidations&&(t.dataValidations=r.dataValidations),r.conditionalFormats&&(t.conditionalFormats=r.conditionalFormats);let n=[],i=1,s=[];for(let o of r.hyperlinks??[])if(o.target){let a=`rId${i++}`;n.push({id:a,type:dt,target:o.target,external:!0}),s.push({spec:o,rId:a})}else s.push({spec:o});s.length>0&&(t.hyperlinks=s);let l=r.comments??[];if(l.length>0){let o=`xl/comments/sheet${t.sheetId}.xml`,a=`xl/drawings/commentsDrawing${t.sheetId}.vml`,u=`rId${i++}`,f=`rId${i++}`;n.push({id:u,type:xt,target:`../comments/sheet${t.sheetId}.xml`}),n.push({id:f,type:ct,target:`../drawings/commentsDrawing${t.sheetId}.vml`}),t.comments=l,t.legacyDrawingRId=f,t.extraParts=[{name:o,data:at(l)},{name:a,data:ut(l)}]}n.length>0&&(t.sheetRelsXml=ft(n))}_appendExtraParts(t){t.sheetRelsXml&&this._zip.addFile(`xl/worksheets/_rels/${t.nameInArchive}.rels`,t.sheetRelsXml);for(let r of t.extraParts??[])this._zip.addFile(r.name,r.data)}startSheet(t,r,n,i={}){if(this._streamBuffer!==null)throw new Error("Already streaming");if(X(r),n!==void 0){T("header",n.length,r);for(let u of n)I(u)}let{hidden:s=!1,doAutofilter:l=!0,headerStyle:o="bold"}=i;this.addSheet(t,s);let a=this._sheets[this._sheetCount-1];this._applySheetFeatures(a,i),this._streamBuffer=new w,this._streamRowNum=0,this._streamColumnCount=r,this._streamDoAutofilter=l&&n!==void 0,this._streamColWidths=this._resolveColumnWidths(r,n,void 0,i,l&&n!==void 0),this._streamColLetters=new Array(r);for(let u=0;u<r;u++)this._streamColLetters[u]=Z(u);if(this._streamHasHeaders=n!==void 0,this._streamDataRows=0,this._streamAutofitRows=H(i.autofitRows),this._streamHeadFlushed=!1,this._streamPending=new w,n){let u=this._streamPending;this._streamRowNum++,u.writeString(`<row r="${this._streamRowNum}">`);let f=gt(o);for(let d=0;d<n.length;d++)this.writeStringCell(u,n[d],"",f);u.writeString("</row>")}this._streamAutofitRows===0&&this._flushStreamHead()}_flushStreamHead(){if(this._streamHeadFlushed)return;if(this._streamBuffer===null)throw new Error("Not streaming");let t=this._streamBuffer,r=this._streamPending;if(Se(t,{dimensionRef:"A1",columnCount:this._streamColumnCount,isFirstSheet:this._sheetCount===1,hasHeaders:this._streamHasHeaders,colWidths:this._streamColWidths}),r)for(let n of r.getChunks())t.write(n);this._streamPending=null,this._streamHeadFlushed=!0}_writeStreamRow(t,r){this._streamRowNum++,M(this._streamRowNum),t.writeString(`<row r="${this._streamRowNum}">`);let n=-1;for(let i=0;i<r.length;i++)n=Be(t,this,r[i],i,n,this._streamColLetters[i],this._streamRowNum);t.writeString("</row>")}writeRow(t){if(this._streamBuffer===null)throw new Error("Not streaming");if(t.length!==this._streamColumnCount)throw new Error(`Row length mismatch. Expected ${this._streamColumnCount} columns, got ${t.length}`);if(!this._streamHeadFlushed&&this._streamPending){this._streamDataRows++,P(this._streamColWidths,[t]),this._writeStreamRow(this._streamPending,t),this._streamDataRows>=this._streamAutofitRows&&this._flushStreamHead();return}this._writeStreamRow(this._streamBuffer,t)}endSheet(){if(this._flushStreamHead(),this._streamBuffer===null)throw new Error("Not streaming");let t=this._streamBuffer,r=this._sheets[this._sheetCount-1],n=_e(t,{doAutofilter:this._streamDoAutofilter,columnCount:this._streamColumnCount,lastColumnLetter:this._streamColLetters[this._streamColumnCount-1]??"A",rowNum:this._streamRowNum,sheetName:r.name,merges:r.merges,hyperlinks:r.hyperlinks,dataValidations:r.dataValidations,conditionalFormats:r.conditionalFormats,legacyDrawingRId:r.legacyDrawingRId,registerDxf:i=>this._styles.registerDxf(i)});n!==null&&(this._autofilterOn=!0,r.filterHeaderRange=n),this._zip.addFile(r.pathInArchive,t.toUint8Array()),this._appendExtraParts(r),this._streamBuffer=null,this._streamPending=null,this._streamHeadFlushed=!0,this._streamHasHeaders=!1,this._streamDataRows=0,this._streamAutofitRows=U,this._streamColWidths=[]}writeSheet(t,r=null,n={}){let i=n.doAutofilter!==!1,s=n.headerStyle??"bold",l=new w,o=t.length>0?t[0].length:r?r.length:0;o>0&&X(o);let a=t.length+(r?1:0);if(M(a),r){T("header",r.length,o);for(let h of r)I(h)}for(let h of t)T("row",h.length,o);let u=this._sheets[this._sheetCount-1];if(!u)throw new Error("Call addSheet() before writeSheet()");let f=this._resolveColumnWidths(o,r,t,n,i&&r!==null),d=new Array(o);for(let h=0;h<o;h++)d[h]=Z(h);let c=a>0&&o>0?`A1:${d[o-1]}${a}`:"A1";Se(l,{dimensionRef:c,columnCount:o,isFirstSheet:this._sheetCount===1,hasHeaders:r!==null,colWidths:f});let x=0;if(r){x++,l.writeString(`<row r="${x}">`);let h=gt(s);for(let y=0;y<r.length;y++)this.writeStringCell(l,r[y],"",h);l.writeString("</row>")}for(let h of t){x++,l.writeString(`<row r="${x}">`);let y=-1;for(let R=0;R<h.length;R++)y=Be(l,this,h[R],R,y,d[R],x);l.writeString("</row>")}this._applySheetFeatures(u,n);let m=_e(l,{doAutofilter:i&&r!==null,columnCount:o,lastColumnLetter:o>0?d[o-1]:"A",rowNum:a,sheetName:u.name,merges:u.merges,hyperlinks:u.hyperlinks,dataValidations:u.dataValidations,conditionalFormats:u.conditionalFormats,legacyDrawingRId:u.legacyDrawingRId,registerDxf:h=>this._styles.registerDxf(h)});m!==null&&(this._autofilterOn=!0,u.filterHeaderRange=m),this._zip.addFile(u.pathInArchive,l.toUint8Array()),this._appendExtraParts(u)}finalize(){this._zip.addFile("xl/sharedStrings.xml",it(this._sstValues,this._sstCount)),this._zip.addFile("xl/styles.xml",this._styles.toXml()),this._zip.addFile("xl/workbook.xml",st(this._sheets,this._autofilterOn));let t=this._sheets.filter(n=>(n.comments?.length??0)>0).map(n=>({path:`xl/comments/sheet${n.sheetId}.xml`}));this._zip.addFile("[Content_Types].xml",ot(this._sheets,t));let r=lt(this._sheets);return this._zip.addFile("_rels/.rels",r.global),this._zip.addFile("xl/_rels/workbook.xml.rels",r.workbook),this._zip.toBlob()}};function oe(e){switch(e){case"#NULL!":return 0;case"#DIV/0!":return 7;case"#VALUE!":return 15;case"#REF!":return 23;case"#NAME?":return 29;case"#NUM!":return 36;case"#N/A":return 42;case"#GETTING_DATA":return 43;default:return 15}}function an(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}var At=an("lgIA5wQEAgAAACwspAATAAAAeQB5AHkAeQBcAC0AbQBtAFwALQBkAGQAXAAgAGgAaAA6AG0AbQAsHqYADAAAAHkAeQB5AHkAXAAtAG0AbQBcAC0AZABkAOgEAOMEBAIAAAArJ9wAAACQAQAAAAIAAAcBAAAAAAD/AgcAAABDAGEAbABpAGIAcgBpACsn3AABALwCAAAAAu4ABwEAAAAAAP8CBwAAAEMAYQBsAGkAYgByAGkAJQYBAAIOAICBCAAmAOQEANsEBAIAAAAtRAAAAAADQAAAAAAA/wNBAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALUQRAAAAA0AAAAAAAP8DQQAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANwEAOUEBAEAAAAuMwAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAOYEAPIEBAEAAAAvEP//AAAAAAAAAAAAABAQAADzBADpBAQGAAAALxAAAAAAAAAAAAAAAAAQEAAALxAAAKQAAAAAAAAAAAAQEAEALxAAAKYAAAAAAAAAAAAQEAEALxAAAAAAAQAAAAAAAAAQEAEALxAAAAAAAAABAAAAAAAQEAEALxAAAAAAAQABAAAAAAAQEAEA6gQA6wQEAQAAACUGAQACEQCAgBgQAAAAAAAAAAAAAAAAAAAAACYAMBwAAAAAAQAAAAgAAABOAG8AcgBtAGEAbABuAHkA7AQA+QMEAAAAAPoDAPwDUAAAAAARAAAAVABhAGIAbABlAFMAdAB5AGwAZQBNAGUAZABpAHUAbQAyABEAAABQAGkAdgBvAHQAUwB0AHkAbABlAEwAaQBnAGgAdAAxADYA/QMAIwQCDgAA6wgA9ggqAAAAABEAAABTAGwAaQBjAGUAcgBTAHQAeQBsAGUATABpAGcAaAB0ADEA9wgA7AgAJAAjBAMPAACwEACyEDIAAAAAFQAAAFQAaQBtAGUAUwBsAGkAYwBlAHIAUwB0AHkAbABlAEwAaQBnAGgAdAAxALMQALEQACQAlwIA"),yt=6;function z(e){let t=0;for(let i of e)t+=i.length;let r=new Uint8Array(t),n=0;for(let i of e)r.set(i,n),n+=i.length;return r}function pt(e){let t=[];for(;e>=128;)t.push(e&127|128),e>>>=7;return t.push(e&127),t}function A(e,t){let r=[...pt(e),...pt(t.length)];return z([new Uint8Array(r),t])}function wt(e,t,r,n){e.ensureCapacity(27),e.writeUnsafeByte(0),e.writeUnsafeByte(25),e.writeUnsafeInt32LE(t),e.writeUnsafeInt32LE(0),e.writeUnsafeByte(44),e.writeUnsafeByte(1),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(1),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeInt32LE(r),e.writeUnsafeInt32LE(n)}function bt(e,t,r,n=0){e.ensureCapacity(14),e.writeUnsafeByte(2),e.writeUnsafeByte(12),e.writeUnsafeInt32LE(r),e.writeUnsafeByte(n),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeInt32LE(t<<2|2)}function St(e,t,r,n=0){e.ensureCapacity(18),e.writeUnsafeByte(5),e.writeUnsafeByte(16),e.writeUnsafeInt32LE(r),e.writeUnsafeByte(n),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeDoubleLE(t)}function _t(e,t,r,n=0){e.ensureCapacity(13),e.writeUnsafeByte(4),e.writeUnsafeByte(9),e.writeUnsafeInt32LE(r),e.writeUnsafeByte(n),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(t?1:0)}function Bt(e,t,r,n=0){e.ensureCapacity(13),e.writeUnsafeByte(3),e.writeUnsafeByte(9),e.writeUnsafeInt32LE(r),e.writeUnsafeByte(n),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(oe(t))}function Rt(e,t,r,n=0){e.ensureCapacity(17),e.writeUnsafeByte(7),e.writeUnsafeByte(12),e.writeUnsafeInt32LE(r),e.writeUnsafeByte(n),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeInt32LE(t)}function Ct(e,t,r,n=0){let i=t.length,s=12+i*2;e.ensureCapacity(4+s),e.writeUnsafeByte(6);let l=s;for(;l>=128;)e.writeUnsafeByte(l&127|128),l>>>=7;e.writeUnsafeByte(l),e.writeUnsafeInt32LE(r),e.writeUnsafeByte(n),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeByte(0),e.writeUnsafeInt32LE(i),e.writeUtf16LE(t)}function Et(e,t,r,n){e.writeByte(159),e.writeByte(1),e.writeByte(8),e.writeInt32LE(r),e.writeInt32LE(n);for(let i of t){let s=i.length;e.writeByte(19);let l=5+2*s;if(l>=128){e.writeByte(128+l%128);let o=l>>7;o>=256?e.writeByte(128+o%128):e.writeByte(o),e.writeByte(l>>14),l>>14>0&&e.writeByte(0)}else e.writeByte(l&255),e.writeByte(l>>8&255);e.writeInt32LE(s),e.writeUtf16LE(i)}e.writeByte(160),e.writeByte(1),e.writeByte(0)}var Ut=43,un=44,vt=45,$t=46,fn=47,Ft=615,dn=616,cn=611,xn=612,hn=603,mn=604,gn=613,pn=614,It=617,An=618,yn=626,wn=627,Tt={none:0,single:1,double:2,singleAccounting:33,doubleAccounting:34},bn={baseline:0,superscript:1,subscript:2},Sn={none:0,solid:1,mediumGray:2,darkGray:3,lightGray:4,darkHorizontal:5,darkVertical:6,darkDown:7,darkUp:8,darkGrid:9,darkTrellis:10,lightHorizontal:11,lightVertical:12,lightDown:13,lightUp:14,lightGrid:15,lightTrellis:16,gray125:17,gray0625:18},_n={none:0,thin:1,medium:2,dashed:3,dotted:4,thick:5,double:6,hair:7,mediumDashed:8,dashDot:9,mediumDashDot:10,dashDotDot:11,mediumDashDotDot:12,slantDashDot:13},Bn={general:0,left:1,center:2,right:3,fill:4,justify:5,centerContinuous:6,distributed:7},Rn={top:0,center:1,bottom:2,justify:3,distributed:4};function B(e){let t=e&65535;return[t&255,t>>>8&255]}function ue(e){let t=e>>>0;return[t&255,t>>>8&255,t>>>16&255,t>>>24&255]}function Dt(e){let t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t.push(n&255,n>>>8&255)}return t}function le(e){if(e===void 0)return[0,0,0,0,0,0,0,0];if(typeof e=="string"){let r=e.trim().replace(/^#/,"").toUpperCase();if(r.length===6&&(r=`FF${r}`),!/^[0-9A-F]{8}$/.test(r))throw new Error(`Invalid color '${e}'. Use RRGGBB, AARRGGBB or '#' + hex.`);let n=parseInt(r.slice(0,2),16),i=parseInt(r.slice(2,4),16),s=parseInt(r.slice(4,6),16),l=parseInt(r.slice(6,8),16);return[5,0,0,0,i,s,l,n]}if("indexed"in e)return[3,e.indexed&255,0,0,0,0,0,255];let t=Math.max(-32768,Math.min(32767,Math.round((e.tint??0)*32767)));return[7,e.theme&255,...B(t),0,0,0,255]}function Cn(e){if(e.name!==void 0&&e.name.length>31)throw new RangeError("XLSB font names are limited to 31 characters");let t=0;e.bold&&(t|=1),e.italic&&(t|=2),e.strike&&(t|=8),e.outline&&(t|=16),e.shadow&&(t|=32),e.condense&&(t|=64),e.extend&&(t|=128);let r=Math.max(20,Math.min(8191,Math.round((e.size??11)*20))),n=bn[e.vertAlign??"baseline"]??0,i=e.underline===!0?Tt.single:typeof e.underline=="string"?Tt[e.underline]??0:0,s=[...B(r),...B(t),...B(e.bold?700:400),...B(n),i,e.family??2,e.charset??0,0,...le(e.color)],l=e.scheme==="major"?1:e.scheme==="minor"?2:0;e.scheme===void 0&&e.name===void 0&&(l=2),s.push(l);let o=Dt(e.name??"Calibri");return s.push(...ue(o.length/2),...o),A(Ut,Uint8Array.from(s))}function En(e){let t=[...ue(Sn[e.patternType??"none"]??0),...le(e.fgColor),...le(e.bgColor)];for(;t.length<68;)t.push(0);return A(vt,Uint8Array.from(t))}function j(e){return[e?.style!==void 0?_n[e.style]??0:0,0,...le(e?.color)]}function Fn(e){let t=0;e.diagonalDown&&(t|=1),e.diagonalUp&&(t|=2);let r=[t,...j(e.top),...j(e.bottom),...j(e.left),...j(e.right),...j(e.diagonal)];return A($t,Uint8Array.from(r))}function In(e){let{ifmt:t=0,fontId:r=0,fillId:n=0,borderId:i=0,style:s}=e,l=s?.alignment,o=s?.protection,a=0,u=0,f=16,d=16;l&&(a=l.textRotation??0,u=l.indent??0,f=(Bn[l.horizontal??"general"]??0)|(Rn[l.vertical??"bottom"]??2)<<3|(l.wrapText?64:0)|(l.justifyLastLine?128:0),d=16|(l.shrinkToFit?1:0)|(l.readingOrder??0)<<2),o&&(d=d&207|(o.locked!==!1?16:0)|(o.hidden?32:0));let c=0;t!==0&&(c|=1),r!==0&&(c|=2),l&&(c|=4),i!==0&&(c|=8),n!==0&&(c|=16),o&&(c|=32);let x=[0,0,...B(t),...B(r),...B(n),...B(i),a&255,u&255,f&255,d&255,...B(c)];return A(fn,Uint8Array.from(x))}function Tn(e,t){if(t.length>255)throw new RangeError("XLSB number formats are limited to 255 characters");let r=Dt(t),n=[...B(e),...ue(r.length/2),...r];return A(un,Uint8Array.from(n))}function Un(e){let t=[],r=0;for(;r<e.length;){let n=r,i=0,s=0,l;do{if(r>=e.length)return t;l=e[r++],i|=(l&127)<<s,s+=7}while(l&128);let o=0;s=0;do{if(r>=e.length)return t;l=e[r++],o|=(l&127)<<s,s+=7}while(l&128);if(r+o>e.length)return t;t.push({id:i,start:n,dataStart:r,end:r+o}),r+=o}return t}function Ce(e,t){return A(e,Uint8Array.from(ue(t)))}var ae=class{constructor(){this.fontIds=new Map;this.fillIds=new Map;this.borderIds=new Map;this.xfIds=new Map;this.formats=new Map;this.fonts=[];this.fills=[];this.borders=[];this.xfs=[];this.formatRecords=[];this.nextNumFmtId=167;this.nextFontId=2;this.nextFillId=2;this.nextBorderId=1}register(t){let r=ie(t);if(r===null)return 0;let n=JSON.stringify(r),i=this.xfIds.get(n);if(i!==void 0)return i;let s=vn(r);if(s!==null)return this.xfIds.set(n,s),s;let l=this.componentId(this.fontIds,r.font?JSON.stringify(r.font):null,r.font?Cn(r.font):null,this.fonts,r.font?.bold&&Object.keys(r.font).length===1?1:null,()=>this.nextFontId++),o=this.componentId(this.fillIds,r.fill?JSON.stringify(r.fill):null,r.fill?En(r.fill):null,this.fills,null,()=>this.nextFillId++),a=this.componentId(this.borderIds,r.border?JSON.stringify(r.border):null,r.border?Fn(r.border):null,this.borders,null,()=>this.nextBorderId++),u=0;r.numFmt!==void 0&&(u=this.numFmtIdFor(r.numFmt));let f=yt+this.xfs.length;return this.xfs.push(In({ifmt:u,fontId:l,fillId:o,borderId:a,style:r})),this.xfIds.set(n,f),f}registerFormat(t){return this.register({numFmt:t})}numFmtIdFor(t){let r=this.formats.get(t);if(r===void 0){if(this.nextNumFmtId>382)throw new RangeError("XLSB supports at most 216 custom number formats");r=this.nextNumFmtId++,this.formats.set(t,r),this.formatRecords.push({ifmt:r,format:t})}return r}componentId(t,r,n,i,s,l){if(r===null)return 0;let o=t.get(r);if(o!==void 0)return o;if(s!==null)return t.set(r,s),s;let a=l();return t.set(r,a),n&&i.push(n),a}toStylesBin(t){if(this.xfs.length===0&&this.fonts.length===0&&this.fills.length===0&&this.borders.length===0&&this.formatRecords.length===0)return t;let r=Un(t),n=f=>{let d=r.find(c=>c.id===f);if(!d)throw new Error(`XLSB styles template is missing record 0x${f.toString(16)}`);return d},i=(f,d)=>{let c=n(f),x=n(d),m=r.filter(h=>h.start>=c.end&&h.end<=x.start);return{begin:c,end:x,inner:m}},s=[],l=i(Ft,dn);s.push(t.subarray(0,l.begin.start)),s.push(Ce(Ft,l.inner.length+this.formatRecords.length));for(let f of l.inner)s.push(t.subarray(f.start,f.end));for(let f of this.formatRecords)s.push(Tn(f.ifmt,f.format));s.push(t.subarray(l.end.start,l.end.end)),Re(s,t,i(cn,xn),Ut,this.fonts),Re(s,t,i(hn,mn),vt,this.fills),Re(s,t,i(gn,pn),$t,this.borders);let o=n(yn),a=n(wn);s.push(t.subarray(o.start,a.end));let u=i(It,An);s.push(Ce(It,u.inner.length+this.xfs.length));for(let f of u.inner)s.push(t.subarray(f.start,f.end));for(let f of this.xfs)s.push(f);return s.push(t.subarray(u.end.start,u.end.end)),s.push(t.subarray(u.end.end)),z(s)}};function Re(e,t,r,n,i){e.push(Ce(r.begin.id,r.inner.length+i.length));let s=r.begin.end;for(let l of r.inner)l.id===n&&(s=l.end);e.push(t.subarray(r.begin.end,s));for(let l of i)e.push(l);e.push(t.subarray(s,r.end.start)),e.push(t.subarray(r.end.start,r.end.end))}function vn(e){let t=Object.keys(e);return t.length===1&&t[0]==="font"&&e.font?.bold===!0&&Object.keys(e.font).length===1?3:t.length===1&&t[0]==="fill"&&e.fill?.patternType==="gray125"&&Object.keys(e.fill).length===1?4:t.length===2&&e.font?.bold===!0&&Object.keys(e.font).length===1&&e.fill?.patternType==="gray125"&&Object.keys(e.fill).length===1?5:null}var $n=8,Dn=9,Vn=10,Ln=11,Nn={COUNT:{id:0,min:0,max:255,fixed:null,classes:"R"},IF:{id:1,min:2,max:3,fixed:null,classes:"VRR"},ISNA:{id:2,min:1,max:1,fixed:1,classes:"V"},ISERROR:{id:3,min:1,max:1,fixed:1,classes:"V"},SUM:{id:4,min:0,max:255,fixed:null,classes:"R"},AVERAGE:{id:5,min:1,max:255,fixed:null,classes:"R"},MIN:{id:6,min:1,max:255,fixed:null,classes:"R"},MAX:{id:7,min:1,max:255,fixed:null,classes:"R"},ROW:{id:8,min:0,max:1,fixed:null,classes:"R"},COLUMN:{id:9,min:0,max:1,fixed:null,classes:"R"},NA:{id:10,min:0,max:0,fixed:0,classes:""},STDEV:{id:12,min:1,max:255,fixed:null,classes:"R"},SIN:{id:15,min:1,max:1,fixed:1,classes:"V"},COS:{id:16,min:1,max:1,fixed:1,classes:"V"},TAN:{id:17,min:1,max:1,fixed:1,classes:"V"},ATAN:{id:18,min:1,max:1,fixed:1,classes:"V"},PI:{id:19,min:0,max:0,fixed:0,classes:""},SQRT:{id:20,min:1,max:1,fixed:1,classes:"V"},EXP:{id:21,min:1,max:1,fixed:1,classes:"V"},LN:{id:22,min:1,max:1,fixed:1,classes:"V"},LOG10:{id:23,min:1,max:1,fixed:1,classes:"V"},ABS:{id:24,min:1,max:1,fixed:1,classes:"V"},INT:{id:25,min:1,max:1,fixed:1,classes:"V"},SIGN:{id:26,min:1,max:1,fixed:1,classes:"V"},ROUND:{id:27,min:2,max:2,fixed:2,classes:"VV"},INDEX:{id:29,min:2,max:4,fixed:null,classes:"RVVV"},MID:{id:31,min:3,max:3,fixed:3,classes:"VVV"},LEN:{id:32,min:1,max:1,fixed:1,classes:"V"},VALUE:{id:33,min:1,max:1,fixed:1,classes:"V"},AND:{id:36,min:1,max:255,fixed:null,classes:"R"},OR:{id:37,min:1,max:255,fixed:null,classes:"R"},NOT:{id:38,min:1,max:1,fixed:1,classes:"V"},MOD:{id:39,min:2,max:2,fixed:2,classes:"VV"},VAR:{id:46,min:1,max:255,fixed:null,classes:"R"},TEXT:{id:48,min:2,max:2,fixed:2,classes:"VV"},MATCH:{id:64,min:2,max:3,fixed:null,classes:"VRR"},DATE:{id:65,min:3,max:3,fixed:3,classes:"VVV"},DAY:{id:67,min:1,max:1,fixed:1,classes:"V"},MONTH:{id:68,min:1,max:1,fixed:1,classes:"V"},YEAR:{id:69,min:1,max:1,fixed:1,classes:"V"},HOUR:{id:71,min:1,max:1,fixed:1,classes:"V"},MINUTE:{id:72,min:1,max:1,fixed:1,classes:"V"},SECOND:{id:73,min:1,max:1,fixed:1,classes:"V"},NOW:{id:74,min:0,max:0,fixed:0,classes:""},ROWS:{id:76,min:1,max:1,fixed:1,classes:"R"},COLUMNS:{id:77,min:1,max:1,fixed:1,classes:"R"},SEARCH:{id:82,min:2,max:3,fixed:null,classes:"VVV"},HLOOKUP:{id:101,min:3,max:4,fixed:null,classes:"VRRV"},VLOOKUP:{id:102,min:3,max:4,fixed:null,classes:"VRRV"},LOG:{id:109,min:1,max:2,fixed:null,classes:"VV"},LOWER:{id:112,min:1,max:1,fixed:1,classes:"V"},UPPER:{id:113,min:1,max:1,fixed:1,classes:"V"},LEFT:{id:115,min:1,max:2,fixed:null,classes:"VV"},RIGHT:{id:116,min:1,max:2,fixed:null,classes:"VV"},EXACT:{id:117,min:2,max:2,fixed:2,classes:"VV"},TRIM:{id:118,min:1,max:1,fixed:1,classes:"V"},REPLACE:{id:119,min:4,max:4,fixed:4,classes:"VVVV"},SUBSTITUTE:{id:120,min:3,max:4,fixed:null,classes:"VVVV"},FIND:{id:124,min:2,max:3,fixed:null,classes:"VVV"},ISTEXT:{id:127,min:1,max:1,fixed:1,classes:"V"},ISNUMBER:{id:128,min:1,max:1,fixed:1,classes:"V"},ISBLANK:{id:129,min:1,max:1,fixed:1,classes:"V"},T:{id:130,min:1,max:1,fixed:1,classes:"R"},N:{id:131,min:1,max:1,fixed:1,classes:"R"},TRUNC:{id:197,min:1,max:2,fixed:null,classes:"VV"},ROUNDUP:{id:212,min:2,max:2,fixed:2,classes:"VV"},ROUNDDOWN:{id:213,min:2,max:2,fixed:2,classes:"VV"},RANK:{id:216,min:2,max:3,fixed:null,classes:"VRV"},TODAY:{id:221,min:0,max:0,fixed:0,classes:""},SUMPRODUCT:{id:228,min:1,max:255,fixed:null,classes:"A"},FLOOR:{id:285,min:2,max:2,fixed:2,classes:"VV"},CEILING:{id:288,min:2,max:2,fixed:2,classes:"VV"},CONCATENATE:{id:336,min:0,max:255,fixed:null,classes:"V"},POWER:{id:337,min:2,max:2,fixed:2,classes:"VV"},SUMIF:{id:345,min:2,max:3,fixed:null,classes:"RVR"},COUNTIF:{id:346,min:2,max:2,fixed:2,classes:"RV"},COUNTBLANK:{id:347,min:1,max:1,fixed:1,classes:"R"},AVERAGEA:{id:361,min:1,max:255,fixed:null,classes:"R"},MAXA:{id:362,min:1,max:255,fixed:null,classes:"R"},MINA:{id:363,min:1,max:255,fixed:null,classes:"R"},IFERROR:{id:480,min:2,max:2,fixed:2,classes:"VV"},COUNTIFS:{id:481,min:2,max:255,fixed:null,classes:"RV"},SUMIFS:{id:482,min:3,max:255,fixed:null,classes:"RRV"},AVERAGEIF:{id:483,min:2,max:3,fixed:null,classes:"RVR"}},On=new Set(["NOW","TODAY","RAND","RANDBETWEEN","OFFSET","INDIRECT","CELL","INFO"]),kn={"+":3,"-":4,"*":5,"/":6,"^":7,"&":8,"<":9,"<=":10,"=":11,">=":12,">":13,"<>":14," ":15,",":16,":":17},Xn={",":1,"=":2,"<":2,">":2,"<=":2,">=":2,"<>":2,"&":3,"+":4,"-":4,"*":5,"/":5,"^":6," ":9,":":10},Mn={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43},Ot=String.raw`(?:\$?[A-Za-z]{1,3}\$?[1-9]\d*(?::\$?[A-Za-z]{1,3}\$?[1-9]\d*)?|\$?[A-Za-z]{1,3}:\$?[A-Za-z]{1,3}|\$?[1-9]\d*:\$?[1-9]\d*)`,Ee=new RegExp(String.raw`\s+|"(?:[^"]|"")*"|'(?:[^']|'')*'`+String.raw`|#(?:NULL!|DIV/0!|VALUE!|REF!|NAME\?|NUM!|N/A|GETTING_DATA)`+`|${Ot}(?![\\w.])`+String.raw`|(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?|[^\W\d][\w.]*|<>|<=|>=|[+\-*/^&%=<>(),:]`,"giu");function Hn(e){let t=[],r=0;for(;r<e.length;){Ee.lastIndex=r;let n=Ee.exec(e);if(!n||n.index!==r)throw new Error(`Unsupported XLSB formula syntax near '${e.slice(r)}'`);r=Ee.lastIndex;let i=n[0];/^\s+$/.test(i)||t.push(i)}return t}var Te=class{constructor(t){this.tokens=t;this.index=0}peek(){return this.tokens[this.index]}pop(){let t=this.tokens[this.index++];if(t===void 0)throw new Error("Unexpected end of XLSB formula");return t}parse(){let t=this.expression(0);if(this.peek()!==void 0)throw new Error(`Unsupported XLSB formula token '${this.peek()}'`);return t}expression(t){let r=this.primary();for(;this.peek()==="%";)this.pop(),r={kind:"percent",value:r};for(;;){let n=this.peek();if(n===void 0)break;let i=Xn[n];if(i===void 0||i<t)break;this.pop();let s=this.expression(i+1);r={kind:"binary",op:n,left:r,right:s}}return r}primary(){let t=this.pop();if(t==="+"||t==="-")return{kind:"unary",op:t,value:this.expression(7)};if(t==="("){let r=this.expression(0);if(this.pop()!==")")throw new Error("Missing ) in XLSB formula");return{kind:"paren",value:r}}if(t.startsWith('"'))return{kind:"string",value:t.slice(1,-1).replace(/""/g,'"')};if(t.startsWith("#")){let r=Mn[t.toUpperCase()];if(r===void 0)throw new Error(`Unsupported XLSB formula error literal '${t}'`);return{kind:"error",value:r}}if(/^(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?$/.test(t))return{kind:"number",value:Number(t)};if(/^[A-Za-z_\\]/.test(t)){let r=t.toUpperCase();if(this.peek()==="("){this.pop();let n=[];if(this.peek()!==")")for(;n.push(this.peek()===","||this.peek()===")"?{kind:"missing"}:this.expression(2)),this.peek()===",";)this.pop();if(this.pop()!==")")throw new Error("Missing ) in XLSB function call");return{kind:"function",name:r,args:n}}if(r==="TRUE"||r==="FALSE")return{kind:"bool",value:r==="TRUE"};if(Vt.test(t))return{kind:"reference",value:t};throw new Error(`Unsupported XLSB formula name '${t}' (defined names are not supported)`)}if(Vt.test(t))return{kind:"reference",value:t};throw new Error(`Unsupported XLSB formula token '${t}'`)}},Vt=new RegExp(`^(?:${Ot})$`,"i");function Lt(e){let t=0;for(let r of e.toUpperCase())t=t*26+(r.charCodeAt(0)-64);return t-1}function Fe(e,t){if(t==="cell"){let n=/^(\$?)([A-Za-z]{1,3})(\$?)([1-9]\d*)$/.exec(e);if(!n)throw new Error(`Invalid XLSB cell reference '${e}'`);let i=Lt(n[2]),s=parseInt(n[4],10)-1;if(i>16383||s>1048575)throw new RangeError(`Cell reference '${e}' is outside the Excel grid`);return{row:s,col:i,colRelative:n[1]==="",rowRelative:n[3]===""}}if(t==="col"){let n=/^(\$?)([A-Za-z]{1,3})$/.exec(e);if(!n)throw new Error(`Invalid XLSB column reference '${e}'`);return{row:0,col:Lt(n[2]),rowRelative:!1,colRelative:n[1]===""}}let r=/^(\$?)([1-9]\d*)$/.exec(e);if(!r)throw new Error(`Invalid XLSB row reference '${e}'`);return{row:parseInt(r[2],10)-1,col:0,rowRelative:r[1]==="",colRelative:!1}}function Nt(e){return/^[A-Za-z]/.test(e.replace(/^\$/,""))?/^\d|^\$\d/.test(e.replace(/^\$?[A-Za-z]{1,3}/,""))?"cell":"col":"row"}function Ie(e){return e.col&16383|(e.colRelative?16384:0)|(e.rowRelative?32768:0)}function Pn(e,t){let r=e.split(":"),n=t==="R"?32:t==="A"?96:64;if(r.length===1){let o=Fe(r[0],"cell");return[n|4,...v(o.row),...S(Ie(o))]}if(r.length!==2)throw new Error(`Invalid XLSB range '${e}'`);let i=Nt(r[0]);if(i!==Nt(r[1]))throw new Error(`Invalid XLSB range '${e}'`);let s=Fe(r[0],i),l=Fe(r[1],i);return i==="col"?(s={...s,row:0,rowRelative:!1},l={...l,row:1048575,rowRelative:!1}):i==="row"&&(s={...s,col:0,colRelative:!1},l={...l,col:16383,colRelative:!1}),[n|5,...v(s.row),...v(l.row),...S(Ie(s)),...S(Ie(l))]}function S(e){let t=e&65535;return[t&255,t>>>8&255]}function v(e){let t=e>>>0;return[t&255,t>>>8&255,t>>>16&255,t>>>24&255]}function kt(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),[...t]}function zn(e){if(e.length>255)throw new RangeError("XLSB formula string literals are limited to 255 UTF-16 units");let t=[...S(e.length)];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t.push(n&255,n>>>8&255)}return t}function Wn(e,t){if(e.id===481)return t%2===0?"R":"V";if(e.id===482||e.id===484)return t===0||t%2===0?"R":"V";let r=e.classes;return r.length===0?"V":r[Math.min(t,r.length-1)]==="R"?"R":"V"}function V(e,t="V"){switch(e.kind){case"number":return Number.isInteger(e.value)&&e.value>=0&&e.value<=65535?[30,...S(e.value)]:[31,...kt(e.value)];case"string":return[23,...zn(e.value)];case"bool":return[29,e.value?1:0];case"error":return[28,e.value];case"missing":return[22];case"reference":return Pn(e.value,t);case"paren":return[...V(e.value,t),21];case"percent":return[...V(e.value),20];case"unary":return[...V(e.value),e.op==="+"?18:19];case"binary":{let r=e.op===","||e.op===" "||e.op===":"?"R":"V";return[...V(e.left,r),...V(e.right,r),kn[e.op]]}case"function":{let r=Nn[e.name];if(!r)throw new Error(`Unsupported XLSB function '${e.name}'`);if(e.args.length<r.min||e.args.length>r.max)throw new RangeError(`${e.name} expects ${r.min}..${r.max} arguments, got ${e.args.length}`);let n=e.args.map((l,o)=>V(l,Wn(r,o))),i=t==="R"?32:t==="A"?96:64,s=r.fixed!==null?[i|1,...S(r.id)]:[i|2,e.args.length,...S(r.id)];if(r.id===1){let l=n[1]??[],o=n[2]??[],a=[25,8,...S(o.length+(o.length>0?4:0)+s.length-1)],u=o.length>0?[25,8,...S(s.length-1)]:[];return[...n[0]??[],25,2,...S(l.length+4),...l,...a,...o,...u,...s]}if(r.id===480){let l=n[1]??[];return[...n[0]??[],25,128,...S(l.length),...l,25,8,...S(s.length-1),...s]}return[...n.flat(),...s]}}}function q(e){switch(e.kind){case"function":return On.has(e.name)||e.args.some(q);case"paren":case"percent":case"unary":return q(e.value);case"binary":return q(e.left)||q(e.right);default:return!1}}function Ue(e){let t=e.trim().replace(/^=/,"");if(!t)throw new Error("FormulaCell.formula must not be empty");if(t.length>8192)throw new RangeError("XLSB formula text is limited to 8192 characters");let r=new Te(Hn(t)).parse(),n=V(r);if(q(r)&&(n=[25,1,0,0,...n]),n.length===0||n.length>16384)throw new RangeError("XLSB formula token length exceeds the BIFF12 limit");return Uint8Array.from(n)}function Gn(e){let t=[...v(e.length)];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t.push(n&255,n>>>8&255)}return t}function Xt(e,t,r,n){let i=Dn,s;if(n instanceof _)i=Ln,s=[oe(n.code)];else if(typeof n=="string")i=$n,s=Gn(n);else if(typeof n=="boolean")i=Vn,s=[n?1:0];else{let a=typeof n=="number"?n:0;if(!Number.isFinite(a))throw new RangeError("XLSB formula cached values must be finite");s=kt(a)}let l=Ue(r),o=[...v(e),...v(t),...s,1,0,...v(l.length),...l,...v(0)];return A(i,Uint8Array.from(o))}var Qn=177,jn=176,qn=178,Yn=573,Zn=64,Kn=574,Jn=494,ei={whole:1,decimal:2,list:3,date:4,time:5,textLength:6,custom:7},ti={stop:0,warning:1,information:2},ri={between:0,notBetween:1,equal:2,notEqual:3,lessThan:4,lessThanOrEqual:5,greaterThan:6,greaterThanOrEqual:7};function ni(e){let t=e&65535;return[t&255,t>>>8&255]}function p(e){let t=e>>>0;return[t&255,t>>>8&255,t>>>16&255,t>>>24&255]}function Y(e){let t=[...p(e.length)];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t.push(n&255,n>>>8&255)}return t}function fe(e){return e===void 0||e===""?[255,255,255,255]:Y(e)}function ii(e){let t=0;for(let r of e.toUpperCase())t=t*26+(r.charCodeAt(0)-64);return t-1}function Mt(e){let t=/^\$?([A-Za-z]{1,3})\$?([1-9]\d*)$/.exec(e.trim());if(!t)throw new Error(`Invalid cell reference '${e}'`);let r=ii(t[1]),n=parseInt(t[2],10)-1;if(r<0||r>16383||n<0||n>1048575)throw new RangeError(`Cell reference '${e}' is outside the Excel grid`);return{col:r,row:n}}function de(e){let t=e.split(":");if(t.length>2)throw new Error(`Invalid range '${e}'`);let r=Mt(t[0]),n=t.length===2?Mt(t[1]):r;return{c1:Math.min(r.col,n.col),r1:Math.min(r.row,n.row),c2:Math.max(r.col,n.col),r2:Math.max(r.row,n.row)}}function Pt(e){if(e.length===0)return new Uint8Array(0);let t=[A(Qn,Uint8Array.from(p(e.length)))];for(let r of e){let n=de(r);t.push(A(jn,Uint8Array.from([...p(n.r1),...p(n.r2),...p(n.c1),...p(n.c2)])))}return t.push(A(qn,new Uint8Array(0))),z(t)}function zt(e,t,r,n){let i=r.target===void 0,s=i?"":n??"",l=i?r.location??"":"",o=r.display??(i?r.location??"":r.target??""),a=[...p(e),...p(e),...p(t),...p(t),...Y(s),...Y(l),...Y(r.tooltip??""),...Y(o)];return A(Jn,Uint8Array.from(a))}function si(e){return`"${e.map(t=>t.replace(/"/g,'""')).join(",")}"`}function Ht(e){if(e===void 0||e==="")return new Uint8Array(8);let t=Ue(e);return Uint8Array.from([...p(t.length),...t,...p(0)])}function Wt(e){if(e.length===0)return new Uint8Array(0);let t=[A(Yn,Uint8Array.from([...ni(0),...p(0),...p(0),...p(0),...p(e.length)]))];for(let r of e){let n=r.sqref.trim().split(/\s+/).map(de);if(n.length===0)throw new Error("Data validation sqref must not be empty");let i=ei[r.type]??0;i|=(ti[r.errorStyle??"stop"]??0)<<4;let s=r.type==="list"&&r.values!==void 0;s&&(i|=128),r.allowBlank&&(i|=256),r.showDropdown===!1&&(i|=512),r.showInputMessage&&(i|=1<<18),r.showErrorMessage&&(i|=1<<19),r.operator!==void 0&&(i|=(ri[r.operator]??0)<<20);let l=[...p(i),...p(n.length)];for(let a of n)l.push(...p(a.r1),...p(a.r2),...p(a.c1),...p(a.c2));l.push(...fe(r.errorTitle),...fe(r.error),...fe(r.promptTitle),...fe(r.prompt));let o=s?si(r.values):r.formula1;l.push(...Ht(o)),l.push(...Ht(r.formula2)),t.push(A(Zn,Uint8Array.from(l)))}return t.push(A(Kn,new Uint8Array(0))),z(t)}var oi=/[\\/*?[\]:]/g,L=class{constructor(t={}){this._useSharedStrings=t.useSharedStrings!==!1,this._zip=new C,this._sheetCount=0,this._sheetList=[],this._sstDic=new Map,this._sstCntUnique=0,this._sstCntAll=0,this._colWidths=[],this._autofilterIsOn=!1,this._oaEpoch=Date.UTC(1899,11,30),this._isStreaming=!1,this._currentSheetBuffer=null,this._currentSheetRowNum=0,this._currentSheetStartCol=0,this._currentSheetEndCol=0,this._currentSheetDoAutofilter=!1,this._streamPending=null,this._streamHeadFlushed=!0,this._streamHasHeaders=!1,this._streamDataRows=0,this._streamAutofitRows=U,this._styles=new ae,this._sheet1Bytes=new Uint8Array([129,1,0,147,1,23,203,4,2,0,64,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,148,1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,1,0,137,1,30,220,3,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,152,1,36,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,1,0,134,1,0,37,6,1,0,2,14,0,128,149,8,2,5,0,38,0,229,3,12,255,255,255,255,8,0,44,1,0,0,0,0,145,1,0,37,6,1,0,2,14,0,128,128,8,2,5,0,38,0,0,25,0,0,0,0,0,0,0,0,44,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,7,12,0,0,0,0,0,0,0,0,0,0,0,0,146,1,0,151,4,66,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,221,3,2,16,0,220,3,48,102,102,102,102,102,102,230,63,102,102,102,102,102,102,230,63,0,0,0,0,0,0,232,63,0,0,0,0,0,0,232,63,51,51,51,51,51,51,211,63,51,51,51,51,51,51,211,63,37,6,1,0,0,16,0,128,128,24,16,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,38,0,130,1,0]),this._workbookBinStart=new Uint8Array([131,1,0,128,1,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,120,0,108,0,1,0,0,0,55,0,1,0,0,0,54,0,5,0,0,0,50,0,52,0,51,0,50,0,54,0,153,1,12,32,0,1,0,0,0,0,0,0,0,0,0,37,6,1,0,3,15,0,128,151,16,52,24,0,0,0,67,0,58,0,92,0,115,0,113,0,108,0,115,0,92,0,84,0,101,0,115,0,116,0,121,0,90,0,97,0,112,0,105,0,115,0,117,0,88,0,108,0,115,0,98,0,92,0,38,0,37,6,1,0,0,16,0,128,129,24,130,1,0,0,0,0,0,0,0,0,47,0,0,0,49,0,51,0,95,0,110,0,99,0,114,0,58,0,49,0,95,0,123,0,49,0,54,0,53,0,48,0,56,0,68,0,54,0,57,0,45,0,67,0,70,0,56,0,55,0,45,0,52,0,55,0,54,0,57,0,45,0,56,0,52,0,53,0,54,0,45,0,68,0,52,0,65,0,52,0,48,0,49,0,49,0,51,0,49,0,53,0,54,0,55,0,125,0,47,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,135,1,0,37,6,1,0,2,16,0,128,128,24,16,0,0,0,0,13,0,0,0,255,255,255,255,0,0,0,0,38,0,158,1,29,0,0,0,0,158,22,0,0,180,105,0,0,232,38,0,0,88,2,0,0,0,0,0,0,0,0,0,0,120,136,1,0,143,1,0]),this._workbookBinMiddle=new Uint8Array([144,1,0]),this._workbookBinEnd=new Uint8Array([157,1,26,53,234,2,0,1,0,0,0,100,0,0,0,252,169,241,210,77,98,80,63,1,0,0,0,106,0,155,1,1,0,35,4,3,15,0,0,171,16,1,1,36,0,132,1,0]),this._stylesBin=new Uint8Array(At),this._binaryIndexBin=new Uint8Array([42,24,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,149,2,0]),this._rRkIntegerLowerLimit=-1<<29,this._rRkIntegerUpperLimit=(1<<29)-1,this._autoFilterStartBytes=new Uint8Array([161,1,16]),this._autoFilterEndBytes=new Uint8Array([162,1,0]),this._stickHeaderA1bytes=new Uint8Array([151,1,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,1,0,0,0,0,0,0,0,2,0,0,0,3]),this._magicFilterExcel2016Fix0=new Uint8Array([225,2,0,229,2,0,234,2]),this._magicFilterExcel2016Fix1=new Uint8Array([39,70,33,0,0,0,0,255,0,0,0,15,0,0,0,95,0,70,0,105,0,108,0,116,0,101,0,114,0,68,0,97,0,116,0,97,0,98,0,97,0,115,0,101,0,15,0,0,0,59,255,0]),this._magicFilterExcel2016Fix2=new Uint8Array([0,0,0,0,255,255,255,255])}_sanitizeSheetName(t){if(!t||typeof t!="string")return`Sheet${this._sheetCount+1}`;let r=t.replace(oi,"_");return r.length>31&&(r=r.substring(0,31)),r.trim().length===0&&(r=`Sheet${this._sheetCount+1}`),r}_buildStylesBin(){return new Uint8Array(this._styles.toStylesBin(this._stylesBin))}_resolveColumnWidths(t,r,n,i,s){let l=J(t);if(i.columnWidths){for(let u=0;u<t;u++){let f=i.columnWidths[u];f!=null&&(l[u]=ne(f,u))}return l}if(i.autofit===!1)return l;r&&te(l,r,t,{bold:i.headerStyle!=="fill",filterButton:s});let o=i.sampleRows??n,a=i.sampleRows?o?.length??0:H(i.autofitRows);return o&&a>0&&P(l,o,a),l}_applySheetFeatures(t,r){if(r.conditionalFormats&&r.conditionalFormats.length>0)throw new Error("Conditional formatting is not supported by BrowserXlsbWriter yet; use BrowserXlsxWriter.");if(r.comments&&r.comments.length>0)throw new Error("Cell comments are not supported by BrowserXlsbWriter yet; use BrowserXlsxWriter.");if(r.merges&&(t.merges=r.merges),r.dataValidations&&(t.dataValidations=r.dataValidations),r.hyperlinks&&r.hyperlinks.length>0){let n=2;t.hyperlinks=r.hyperlinks.map(i=>{let s=de(i.ref),l=i.target===void 0;return{spec:i,rId:l?void 0:`rId${n++}`,row:s.r1,col:s.c1}})}}_writeFeatureRecords(t,r){r.merges&&r.merges.length>0&&t.write(Pt(r.merges)),r.dataValidations&&r.dataValidations.length>0&&t.write(Wt(r.dataValidations));for(let n of r.hyperlinks??[])t.write(zt(n.row,n.col,n.spec,n.rId))}addSheet(t,r=!1){let n=this._sanitizeSheetName(t);this._sheetCount++,this._sheetList.push({name:n,pathInArchive:`xl/worksheets/sheet${this._sheetCount}.bin`,hidden:r,nameInArchive:`sheet${this._sheetCount}.bin`,sheetId:this._sheetCount,filterHeaderRange:null})}startSheet(t,r,n,i={}){if(this._isStreaming)throw new Error("Already streaming");if(X(r),n!==void 0){T("header",n.length,r);for(let f of n)I(f)}let{hidden:s=!1,doAutofilter:l=!0,headerStyle:o="bold"}=i,a=3;o==="fill"?a=4:o==="bold+fill"&&(a=5),this.addSheet(t,s);let u=this._sheetList[this._sheetCount-1];if(this._applySheetFeatures(u,i),this._isStreaming=!0,this._currentSheetBuffer=new w,this._currentSheetRowNum=0,this._currentSheetStartCol=0,this._currentSheetEndCol=r,this._currentSheetDoAutofilter=l&&n!==void 0,this._colWidths=this._resolveColumnWidths(r,n,void 0,i,l&&n!==void 0),this._streamPending=new w,this._streamHeadFlushed=!1,this._streamHasHeaders=n!==void 0,this._streamDataRows=0,this._streamAutofitRows=H(i.autofitRows),n){let f=this._streamPending;this.createRowHeader(f,this._currentSheetRowNum,this._currentSheetStartCol,this._currentSheetEndCol);for(let d=0;d<n.length;d++)this.writeString(f,n[d],d,a);this._currentSheetRowNum++}this._streamAutofitRows===0&&this._flushStreamHead()}_flushStreamHead(){if(this._streamHeadFlushed)return;let t=this._currentSheetBuffer;if(!this._isStreaming||t===null)throw new Error("Not streaming");this._writeSheetHeader(t,this._currentSheetStartCol,this._currentSheetEndCol,this._currentSheetDoAutofilter);let r=this._streamPending;if(r)for(let n of r.getChunks())t.write(n);this._streamPending=null,this._streamHeadFlushed=!0}_writeStreamRow(t,r){M(this._currentSheetRowNum+1),this.createRowHeader(t,this._currentSheetRowNum,this._currentSheetStartCol,this._currentSheetEndCol);for(let n=0;n<r.length;n++)this._writeCell(t,r[n],n);this._currentSheetRowNum++}writeRow(t){let r=this._currentSheetBuffer;if(!this._isStreaming||r===null)throw new Error("Not streaming");if(t.length!==this._currentSheetEndCol-this._currentSheetStartCol)throw new Error(`Row length mismatch. Expected ${this._currentSheetEndCol-this._currentSheetStartCol} columns, got ${t.length}`);if(!this._streamHeadFlushed&&this._streamPending){this._streamDataRows++,P(this._colWidths,[t]),this._writeStreamRow(this._streamPending,t),this._streamDataRows>=this._streamAutofitRows&&this._flushStreamHead();return}this._writeStreamRow(r,t)}endSheet(){this._flushStreamHead();let t=this._currentSheetBuffer;if(!this._isStreaming||t===null)throw new Error("Not streaming");if(t.write(this._sheet1Bytes.subarray(218,290)),this._currentSheetDoAutofilter){this._autofilterIsOn=!0,t.write(this._autoFilterStartBytes);let r=new Uint8Array(8),n=new DataView(r.buffer);n.setInt32(0,0,!0),n.setInt32(4,this._currentSheetRowNum-1,!0),t.write(r);let i=new Uint8Array(8),s=new DataView(i.buffer);s.setInt32(0,this._currentSheetStartCol,!0),s.setInt32(4,this._currentSheetEndCol-1,!0),t.write(i),t.write(this._autoFilterEndBytes),this._sheetList[this._sheetCount-1].filterData={startRow:0,endRow:this._currentSheetRowNum-1,startColumn:this._currentSheetStartCol,endColumn:this._currentSheetEndCol-1}}this._writeFeatureRecords(t,this._sheetList[this._sheetCount-1]),t.write(this._sheet1Bytes.subarray(290)),t.patchInt32LE(36,Math.max(0,this._currentSheetRowNum-1)),this._zip.addFile(this._sheetList[this._sheetCount-1].pathInArchive,t.toUint8Array()),this._isStreaming=!1,this._currentSheetBuffer=null,this._streamPending=null,this._streamHeadFlushed=!0,this._streamHasHeaders=!1,this._streamDataRows=0,this._streamAutofitRows=U}writeSheet(t,r=null,n={}){let i=n.doAutofilter!==!1,s=n.headerStyle||"bold",l=3;s==="fill"?l=4:s==="bold+fill"&&(l=5);let o=new w,a=t.length>0?t[0].length:r?r.length:0;a>0&&X(a);let u=t.length+(r?1:0);if(M(u),r){T("header",r.length,a);for(let x of r)I(x)}for(let x=0;x<t.length;x++)T("row",t[x].length,a);let f=this._sheetList[this._sheetCount-1];if(!f)throw new Error("Call addSheet() before writeSheet()");this._applySheetFeatures(f,n),this._colWidths=this._resolveColumnWidths(a,r,t,n,i&&r!==null);let d=i&&!!r;this._writeSheetHeader(o,0,a,d);let c=0;if(r){this.createRowHeader(o,c,0,a);for(let x=0;x<r.length;x++)this.writeString(o,r[x],x,l);c++}for(let x=0;x<t.length;x++){this.createRowHeader(o,c,0,a);for(let m=0;m<t[x].length;m++)this._writeCell(o,t[x][m],m);c++}if(o.write(this._sheet1Bytes.subarray(218,290)),d){this._autofilterIsOn=!0,o.write(this._autoFilterStartBytes);let x=new Uint8Array(8),m=new DataView(x.buffer);m.setInt32(0,0,!0),m.setInt32(4,c-1,!0),o.write(x);let h=new Uint8Array(8),y=new DataView(h.buffer);y.setInt32(0,0,!0),y.setInt32(4,a-1,!0),o.write(h),o.write(this._autoFilterEndBytes),this._sheetList[this._sheetCount-1].filterData={startRow:0,endRow:c-1,startColumn:0,endColumn:a-1}}this._writeFeatureRecords(o,f),o.write(this._sheet1Bytes.subarray(290)),o.patchInt32LE(36,Math.max(0,c-1)),this._zip.addFile(this._sheetList[this._sheetCount-1].pathInArchive,o.toUint8Array())}_writeSheetHeader(t,r,n,i){let s=new Uint8Array(this._sheet1Bytes),l=new DataView(s.buffer);l.setInt32(40,r,!0),l.setInt32(44,n-1,!0),this._sheetCount!==1&&(s[54]=156),t.write(s.subarray(0,84)),i&&t.write(this._stickHeaderA1bytes),t.write(s.subarray(84,159)),t.writeByte(134),t.writeByte(3),t.writeByte(0);for(let o=r;o<n;o++){t.writeByte(60),t.writeByte(18),t.writeInt32LE(o),t.writeInt32LE(o);let a=re(this._colWidths[o]);t.writeInt32LE(Math.max(0,Math.min(255*256,Math.round(a*256)))),t.writeInt32LE(0),t.writeByte(2),t.writeByte(0)}t.writeByte(135),t.writeByte(3),t.writeByte(0),t.write(s.subarray(159,175)),t.write(new Uint8Array([38,0]))}_writeCell(t,r,n){if(r==null)return;let i=N(r),s=i!==null?this._styles.register(i):0,l=K(r);if(l!==null){let a=r.value,u;a instanceof Date?(u=k(a.getTime(),this._oaEpoch),s===0&&(s=F(a)?2:1)):E(a)||typeof a=="bigint"?u=a.toString():u=a,t.write(Xt(n,s,l,u));return}let o=O(r);if(o!=null){if(E(o))throw new Error("Rich text is not supported by BrowserXlsbWriter yet; use BrowserXlsxWriter.");if(typeof o=="number")Number.isInteger(o)&&o>=this._rRkIntegerLowerLimit&&o<=this._rRkIntegerUpperLimit?this.writeRkNumberInteger(t,o,n,s):this.writeDouble(t,o,n,s);else if(o instanceof _)this.writeError(t,o.code,n,s);else if(typeof o=="bigint")this.writeString(t,o.toString(),n,0,s);else if(typeof o=="boolean")this.writeBool(t,o,n,s);else if(o instanceof Date){let a=k(o.getTime(),this._oaEpoch),u=F(o)?2:1;this.writeDouble(t,a,n,s!==0?s:u)}else this.writeString(t,o.toString(),n,0,s)}}createRowHeader(t,r,n,i){wt(t,r,n,i)}writeRkNumberInteger(t,r,n,i=0){bt(t,r,n,i)}writeDouble(t,r,n,i=0){St(t,r,n,i)}writeBool(t,r,n,i=0){_t(t,r,n,i)}writeError(t,r,n,i=0){Bt(t,r,n,i)}writeDateTime(t,r,n){this.writeDouble(t,k(r.getTime(),this._oaEpoch),n,F(r)?2:1)}writeString(t,r,n,i=0,s){I(r);let l=s!==void 0?s:i;if(!this._useSharedStrings){Ct(t,r,n,l);return}let o=this._sstDic.get(r);o===void 0&&(o=this._sstCntUnique++,this._sstDic.set(r,o)),this._sstCntAll++,Rt(t,o,n,l)}_saveSst(){let t=new w;Et(t,this._sstDic.keys(),this._sstCntAll,this._sstCntUnique),this._zip.addFile("xl/sharedStrings.bin",t.toUint8Array())}_writeFilterDefinedName(t,r,n){let i=r.filterData,s=new Uint8Array(this._magicFilterExcel2016Fix1);s[7]=r.sheetId-1,s[s.length-2]=n,t.push(s);let l=new Uint8Array(8),o=new DataView(l.buffer);o.setInt32(0,i.startRow,!0),o.setInt32(4,i.endRow,!0),t.push(l);let a=new Uint8Array(4),u=new DataView(a.buffer);u.setInt16(0,i.startColumn,!0),u.setInt16(2,i.endColumn,!0),t.push(a),t.push(this._magicFilterExcel2016Fix2)}finalize(){this._saveSst(),this._zip.addFile("xl/styles.bin",this._buildStylesBin());let t=[this._workbookBinStart];for(let o of this._sheetList){let a=`rId${o.sheetId}`,u=o.name,f=16+u.length*2+a.length*2,d=new Uint8Array(3+f),c=new DataView(d.buffer);d[0]=156,d[1]=1,d[2]=f;let x=3;c.setInt32(x,o.hidden?1:0,!0),x+=4,c.setInt32(x,o.sheetId,!0),x+=4,c.setInt32(x,a.length,!0),x+=4;for(let m=0;m<a.length;m++){let h=a.charCodeAt(m);d[x++]=h&255,d[x++]=h>>8&255}c.setInt32(x,u.length,!0),x+=4;for(let m=0;m<u.length;m++){let h=u.charCodeAt(m);d[x++]=h&255,d[x++]=h>>8&255}t.push(d)}if(t.push(this._workbookBinMiddle),this._autofilterIsOn){let o=this._sheetList.filter(a=>a.filterData!==void 0);if(o.length>0){t.push(this._magicFilterExcel2016Fix0);let a=o.length,u=a<=20?16+(a-1)*12:128+(a-21)*12;t.push(a<=10?new Uint8Array([u,a,0,0,0]):new Uint8Array([u,Math.floor((a-1)/10),a,0,0,0]));for(let f=0;f<o.length;f++){let d=o[f].sheetId-1,c=new Uint8Array(12);c[4]=d,c[8]=d,t.push(c)}t.push(new Uint8Array([226,2,0]));for(let f=0;f<o.length;f++)this._writeFilterDefinedName(t,o[f],f)}}t.push(this._workbookBinEnd);let r=0;for(let o of t)r+=o.length;let n=new Uint8Array(r),i=0;for(let o of t)n.set(o,i),i+=o.length;this._zip.addFile("xl/workbook.bin",n);for(let o of this._sheetList)this._zip.addFile(`xl/worksheets/binaryIndex${o.sheetId}.bin`,this._binaryIndexBin);let s=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
18
50
|
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
19
51
|
<Default Extension="bin" ContentType="application/vnd.ms-excel.sheet.binary.macroEnabled.main"/>
|
|
20
52
|
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
21
|
-
<Default Extension="xml" ContentType="application/xml"/>`;for(let o of this._sheetList)
|
|
22
|
-
<Override PartName="/xl/worksheets/binaryIndex${o.sheetId}.bin" ContentType="application/vnd.ms-excel.binIndexWs"/>
|
|
23
|
-
`;i+=`<Override PartName="/xl/styles.bin" ContentType="application/vnd.ms-excel.styles"/>
|
|
53
|
+
<Default Extension="xml" ContentType="application/xml"/>`;for(let o of this._sheetList)s+=`<Override PartName="/${o.pathInArchive}" ContentType="application/vnd.ms-excel.worksheet"/>`,s+=`<Override PartName="/xl/worksheets/binaryIndex${o.sheetId}.bin" ContentType="application/vnd.ms-excel.binIndexWs"/>`;s+=`<Override PartName="/xl/styles.bin" ContentType="application/vnd.ms-excel.styles"/>
|
|
24
54
|
<Override PartName="/xl/sharedStrings.bin" ContentType="application/vnd.ms-excel.sharedStrings"/>
|
|
25
|
-
</Types>`,this._zip.addFile("[Content_Types].xml",
|
|
26
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"
|
|
27
|
-
`;for(let o of this._sheetList)l+=`<Relationship Id="rId${o.sheetId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/${o.nameInArchive}"/>
|
|
28
|
-
`;l+=`<Relationship Id="rId${this._sheetList.length+2}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.bin"/>
|
|
55
|
+
</Types>`,this._zip.addFile("[Content_Types].xml",s);let l=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
56
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`;for(let o of this._sheetList)l+=`<Relationship Id="rId${o.sheetId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/${o.nameInArchive}"/>`;l+=`<Relationship Id="rId${this._sheetList.length+2}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.bin"/>
|
|
29
57
|
<Relationship Id="rId${this._sheetList.length+3}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.bin"/>
|
|
30
58
|
</Relationships>`,this._zip.addFile("xl/_rels/workbook.bin.rels",l),this._zip.addFile("_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
31
59
|
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
32
60
|
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.bin"/>
|
|
33
|
-
</Relationships>`);for(let o of this._sheetList)
|
|
61
|
+
</Relationships>`);for(let o of this._sheetList){let a=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
34
62
|
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
35
|
-
<Relationship Id="rId1" Type="http://schemas.microsoft.com/office/2006/relationships/xlBinaryIndex" Target="binaryIndex${o.sheetId}.bin"
|
|
36
|
-
</Relationships>`);return this._zip.toBlob()}};function V(h,t){let e=URL.createObjectURL(h),r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout(()=>URL.revokeObjectURL(e),5e3)}function r0(h,t,e,r="Sheet1"){let x=new E;x.addSheet(r),x.writeSheet(t,e,{doAutofilter:!0}),V(x.finalize(),h)}function x0(h,t){let e=new E;for(let r of t)e.addSheet(r.name),e.writeSheet(r.rows,r.headers,{doAutofilter:!0});V(e.finalize(),h)}function i0(h,t,e,r="Sheet1"){let x=new U;x.addSheet(r),x.writeSheet(t,e,{doAutofilter:!0}),V(x.finalize(),h)}function n0(h,t){let e=new U;for(let r of t)e.addSheet(r.name),e.writeSheet(r.rows,r.headers,{doAutofilter:!0});V(e.finalize(),h)}return J(s0);})();
|
|
63
|
+
<Relationship Id="rId1" Type="http://schemas.microsoft.com/office/2006/relationships/xlBinaryIndex" Target="binaryIndex${o.sheetId}.bin"/>`;for(let u of o.hyperlinks??[])!u.rId||u.spec.target===void 0||(a+=`<Relationship Id="${u.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="${g(u.spec.target)}" TargetMode="External"/>`);a+="</Relationships>",this._zip.addFile(`xl/worksheets/_rels/${o.nameInArchive}.rels`,a)}return this._zip.toBlob()}};function ce(e,t){let r=URL.createObjectURL(e),n=document.createElement("a");n.href=r,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),setTimeout(()=>URL.revokeObjectURL(r),5e3)}function li(e,t,r,n="Sheet1"){let i=new D;i.addSheet(n),i.writeSheet(t,r,{doAutofilter:!0}),ce(i.finalize(),e)}function ai(e,t){let r=new D;for(let n of t)r.addSheet(n.name),r.writeSheet(n.rows,n.headers,{doAutofilter:!0});ce(r.finalize(),e)}function ui(e,t,r,n="Sheet1"){let i=new L;i.addSheet(n),i.writeSheet(t,r,{doAutofilter:!0}),ce(i.finalize(),e)}function fi(e,t){let r=new L;for(let n of t)r.addSheet(n.name),r.writeSheet(n.rows,n.headers,{doAutofilter:!0});ce(r.finalize(),e)}return tr(di);})();
|