UNPKG

mr-excel

Version:

A versatile JavaScript library for effortlessly generating .xlsx files from input objects. Seamlessly create Excel spreadsheets with data, formatting, formulas, and more.

31 lines 85.8 kB
"use strict";function Rt(e){return e.replace(/ /g,"")}function Dt(e){if(e=e.replace(/^#/,""),e.length==3){const t=e.charAt(0),r=e.charAt(1),o=e.charAt(2);return t+t+r+r+o+o}else return e}function Vt(e){/^#?([a-f\d]{3})$/i.test(e)&&(e=Dt(e));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]}function kt(e){const t=Vt(e);return t==null?void 0:(.299*t[0]+.587*t[1]+.114*t[2])/255>.5?"rgb(0,0,0)":"rgb(255,255,255)"}function Ot(e){/^#?([a-f\d]{3})$/i.test(e)&&(e=Dt(e));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?"rgb("+(255-parseInt(t[1],16))+","+(255-parseInt(t[2],16))+","+(255-parseInt(t[3],16))+")":"rgb(0,0,0)"}function tt(e){e=Number(e);var t=e.toString(16);return t.length==1?"0"+t:t}function me(e){e=Rt(e);let t=e.indexOf("rgba")>=0?e.substring(5,e.length-1).split(","):e.substring(4,e.length-1).split(","),r=t.reduce((o,n)=>o&&!Number.isNaN(Number(n)),!0);return t.length==4&&t[3]=="0"||t.length!=3&&t.length!=4||!r?null:(tt(t[0])+tt(t[1])+tt(t[2])).toUpperCase()}function he(e,t){if(typeof e>"u"||e===null)return null;if(!t){let r=Rt(e);r.indexOf("var(")==0&&r.lastIndexOf(")")==r.length-1&&(r=r.substring(4,r.length-1),e=getComputedStyle(document.documentElement).getPropertyValue(r))}if(e.indexOf("rgb")>=0){const r=me(e);e=r||""}return e.replace(/^#/,"")}function zt(e){let t="";return e.indexOf("_")>0?e.replace(/[a-z]/g,"").length==e.length?t=e.split(/_/).reduce((r,o)=>r+o.charAt(0)+o.substring(1).toLowerCase()+" ","").trim():t=e.replace(/_/g," ").trim():(t=e.replace(/([A-Z])/g," $1").trim(),t=t.charAt(0).toUpperCase()+t.substring(1).trim()),t}function Ft(e,t){let r=Object.keys(e).filter(l=>!t.includes(l)),o=[];return r.reduce((l,g)=>(l.push({label:g,text:zt(g)}),l),o)}const ot={fileName:"MR-Excel",headerBackgroundColor:"#393E46",headerColor:"#EEEEEE",negativeColor:!1,rowBackgroundColor:"#EEEEEE",rowColor:"#393E46",filterKeys:[]},Ut=function(e,t={...ot}){let r;if(typeof e=="object"&&Array.isArray(e))if(e.length>0)if(Array.isArray(e[0])){let m=[];for(let s=0;s<e.length;s++){const f=e[s];if(f.length>0){const v=Ft(f[0],Array.isArray(t.filterKeys)?t.filterKeys:[]);m.push({headers:v,data:f})}}r={sheet:m}}else e.length>0?r={sheet:[{headers:Ft(e[0],Array.isArray(t.filterKeys)?t.filterKeys:[]),data:e}]}:r={sheet:[]};else r={sheet:[]};else r=e;let o=t&&t.headerBackgroundColor?t.headerBackgroundColor:ot.headerBackgroundColor,n=t&&t.rowBackgroundColor?t.rowBackgroundColor:ot.rowBackgroundColor,l=t&&t.negativeColor?Ot(o):t&&t.headerColor?t.headerColor:kt(o),g=t&&t.negativeColor?Ot(n):t&&t.rowColor?t.rowColor:kt(n);typeof r.styles>"u"&&(r.styles={}),r.styles.themeStyleHeader={backgroundColor:o,color:l},r.styles.themeStyleBody={backgroundColor:n,color:g};const u=r.sheet.length;for(let m=0;m<u;m++)r.sheet[m].styleCellCondition=function(s,f,v,D,j,k){return j?"themeStyleHeader":"themeStyleBody"};return typeof(t==null?void 0:t.fileName)=="string"&&(r.fileName=t.fileName),r};async function Wt(e,t,r){let o={};const l=(await Promise.resolve().then(()=>require("./jszip.min-jYEVHKmD.cjs")).then(m=>m.jszip_min)).default;let g;if(typeof e=="string"&&e.length){let m,s=!1;typeof(r==null?void 0:r.fetch)=="function"?(m=r==null?void 0:r.fetch,s=!0):m=fetch,g=await m(e).then(f=>{if(f==null||f==null)throw"response is null";return s?f:r!=null&&r.backend?f.arrayBuffer():f.blob()})}else g=r==null?void 0:r.data;let u=await l.loadAsync(g).then(async function(m){let s=Object.keys(m.files).filter(f=>f.indexOf("xl/worksheets/")==0&&f.length-4==f.lastIndexOf(".xml")||f=="xl/sharedStrings.xml");for(let f=0;f<s.length;f++){const v=s[f];await m.files[v].async("string").then(D=>{let j=D;Object.keys(t).forEach(k=>{var d;j=j.replace(new RegExp("{{"+k+"}}","g"),(d=t[k])==null?void 0:d.toString())}),o[v]=j})}return m});if(Object.keys(o).forEach(m=>{u.file(m,o[m])}),r!=null&&r.backend)return u.generateAsync({type:r.generateType?r.generateType:"nodebuffer"}).then(m=>m);if(r!=null&&r.notSave)return u.generateAsync({type:"blob"}).then(m=>m.slice(0,m.size,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));{let m=await u.generateAsync({type:"blob"});(await Promise.resolve().then(()=>require("./FileSaver.min-3zGNM-lE.cjs")).then(f=>f.FileSaver_min)).saveAs(m,(r!=null&&r.fileName?r==null?void 0:r.fileName:"tableRecord")+".xlsx")}}function Gt(e,t,r,o,n,l,g,u){let m=[],s="both",f=[];!t||t===0?(t=1,s="col"):f.push(t-1),!e||e===0?(e=0,s="row"):f.push(e-1);let v=n||{};v.mergeType=u&&u.mergeType?[...u.mergeType,s]:[s],v.mergeValue=u&&u.mergeValue?[...u.mergeValue,f]:[f],v.mergeStart=u&&u.mergeStart?[...u.mergeStart,r]:[r];for(let D=0;D<t;D++){let j=e;for(let k=0;k<o;k++)r<=k?j>=1?(v["c"+k]=l,l="",g+="*",j--):t>=2&&r==k?(v["c"+k]=l,l="",g+="+"):g+="-":D>0&&(g+="-");m.push({...v,mergeString:g}),v={},g=""}return m}function Zt(e,t,r,o,n){var v;if(!e&&!t)throw"Error: One of the function inputs is required.";let l;e?l=(v=document.querySelector(e))==null?void 0:v.querySelectorAll("tr"):l=t==null?void 0:t.querySelectorAll("tr");let g=[],u=[],m={header:{},rows:[]},s=40;if(l){let D=!1,j=0;l.forEach((k,d)=>{var q=[].slice.call(k.children);const U=window.getComputedStyle(k,null);let J=me(U.backgroundColor);if(!D)j=q.length,D=!0,typeof o=="function"?s=o(Number(U.height.substring(0,U.height.length-2)),d,!0):s=Number(U.height.substring(0,U.height.length-2)),q.forEach((N,oe)=>{let P=window.getComputedStyle(N,null),B=null;if(P.borderBottomWidth!=="0px"){const W=me(P.borderBottomColor);W&&(B||(B={}),B.bottom={style:"thin",color:W})}if(P.borderTopWidth!=="0px"){const W=me(P.borderTopColor);W&&(B||(B={}),B.top={style:"thin",color:W})}if(P.borderLeftWidth!=="0px"){const W=me(P.borderLeftColor);W&&(B||(B={}),B.left={style:"thin",color:W})}if(P.borderRightWidth!=="0px"){const W=me(P.borderRightColor);W&&(B||(B={}),B.right={style:"thin",color:W})}let X=me(P.backgroundColor);!X&&J&&(X=J);const $=parseInt(P.fontSize.substring(0,P.fontSize.indexOf("p")));let L={...X?{backgroundColor:X}:{},bold:parseInt(P.fontWeight)>500,...isNaN($)?{}:{size:$},...B?{border:B}:{},alignment:{...typeof P.textAlign=="string"&&P.textAlign.length>0?{horizontal:P.textAlign}:{},vertical:"center",...P.direction=="rtl"?{rtl:!0}:{ltr:!0}}};m.header[d+"-"+oe]=L;let E;typeof n=="function"?E=n(Number(P.width.substring(0,P.width.length-2)),oe):E=Number(P.width.substring(0,P.width.length-2))*.15;const M=N.getAttribute("colspan"),Y=N.getAttribute("rowspan");g.push({label:"c"+oe,...M?{colspan:M}:{},...Y?{rowspan:Y}:{},text:N.textContent,...isNaN(E)||E<=0?{}:{size:E}})});else{let N={},oe="",P=!1;u.length>=d&&(N=u[d-1],oe="mergeString"in N?N.mergeString:"",P=!0);let B=0;q.forEach((X,$)=>{if("c"+($+B)in N)for(let K=0;K<=j+1&&"c"+($+K)in N;K++)B++;$+=B;let L=window.getComputedStyle(X,null);if(X.getAttribute("colspan")||X.getAttribute("rowspan")){let K=Gt(X.getAttribute("colspan")*1,X.getAttribute("rowspan")*1,$,j,N,X.textContent,oe,N);u.length<d?u.push(...K):K.forEach((Ce,Q)=>{u.length<d+Q?u.push(...K):u[d+Q]={...u[d+Q],...Ce}}),N=K[0],oe=K[0].mergeString,P=!0}else P||(oe+="-");let E=null;if(L.borderBottomWidth!=="0px"){const K=me(L.borderBottomColor);K&&(E||(E={}),E.bottom={style:"thin",color:K})}if(L.borderTopWidth!=="0px"){const K=me(L.borderTopColor);K&&(E||(E={}),E.top={style:"thin",color:K})}if(L.borderLeftWidth!=="0px"){const K=me(L.borderLeftColor);K&&(E||(E={}),E.left={style:"thin",color:K})}if(L.borderRightWidth!=="0px"){const K=me(L.borderRightColor);K&&(E||(E={}),E.right={style:"thin",color:K})}let M=me(L.backgroundColor);!M&&J&&(M=J);const Y=parseInt(L.fontSize.substring(0,L.fontSize.indexOf("p")));let W={...M?{backgroundColor:M}:{},bold:parseInt(L.fontWeight)>500,...isNaN(Y)?{}:{size:Y},...E?{border:E}:{},alignment:{...typeof L.textAlign=="string"&&L.textAlign.length>0?{horizontal:L.textAlign}:{},vertical:"center",...L.direction=="rtl"?{rtl:!0}:{ltr:!0}}};m.header[d+"-"+$]=W,N["c"+$]=X.textContent}),typeof o=="function"?N.height=o(Number(U.height.substring(0,U.height.length-2)),d,!1):N.height=U.height.substring(0,U.height.length-2),typeof N.height=="string"&&N.height.length==0&&delete N.height,u.length<d?u.push(N):u[d-1]=N}})}else throw"Error: DOM Element Not Found";return{styles:m.header,sheet:[{...s?{headerHeight:s}:{},styleCellCondition:function(D,j,k,d,q,U){return r?U.includes(k-1+"-"+d)?k-1+"-"+d:"":null},data:u,headers:g}]}}function $e(e,t,r="",o=[],n=-1){const l=e.length;for(let g=0;g<l;g++)o.push(r+e[g]);return t<o.length?o:$e(e,t,o[n+1],o,n+1)}function Jt(e,t){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">`+(e.format.count>0?'<numFmts count="'+e.format.count+'">'+e.format.value+"</numFmts>":"")+'<fonts count="'+e.font.count+'"><font><sz val="11" /><color theme="1" /><name val="Calibri" /><family val="2" /><scheme val="minor" /></font><font><sz val="11" /><color rgb="FFFF0000" /><name val="Calibri" /><family val="2" /><scheme val="minor" /></font>'+e.font.value+'</fonts><fills count="'+e.fill.count+'"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="lightGray" /></fill>'+e.fill.value+'</fills><borders count="'+e.border.count+'"><border />'+e.border.value+'</borders><cellStyleXfs count="1"><xf borderId="0" fillId="0" fontId="0" numFmtId="0" applyAlignment="1" applyFont="1" /></cellStyleXfs><cellXfs count="'+e.cell.count+'"><xf borderId="0" fillId="0" fontId="0" numFmtId="0" xfId="0" applyAlignment="1" applyFont="1"><alignment readingOrder="0" shrinkToFit="0" vertical="bottom" wrapText="0" /></xf><xf borderId="0" fillId="0" fontId="1" numFmtId="0" xfId="0" applyAlignment="1" applyFont="1"><alignment readingOrder="0" /></xf>'+e.cell.value+'</cellXfs><cellStyles count="1"><cellStyle xfId="0" name="Normal" builtinId="0" /></cellStyles> '+(t?'<dxfs count="'+e.conditionalFormatting.count+'" >'+e.conditionalFormatting.value+"</dxfs>":'<dxfs count="0" />')+"</styleSheet>"}function Xt(e,t,r,o,n,l,g){let u={};return`<?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="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing" /><Default Extension="xml" ContentType="application/xml" /><Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" PartName="/xl/workbook.xml" /><Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" PartName="/xl/styles.xml" /><Override ContentType="application/vnd.openxmlformats-officedocument.theme+xml" PartName="/xl/theme/theme1.xml" />`+r.reduce((m,s)=>(s=s.toLowerCase(),u[s]?m:s=="svg"?(u.png=!0,u.svg=!0,m+'<Default Extension="png" ContentType="image/png"/><Default Extension="svg" ContentType="image/svg+xml"/>'):s=="jpeg"||s=="jpg"?(u.jpeg=!0,u.jpg=!0,m+'<Default Extension="'+s+'" ContentType="image/jpeg"/>'):(u[s]=!0,m+'<Default Extension="'+s+'" ContentType="image/'+s+'"/>')),"")+t.reduce((m,s)=>m+'<Override PartName="/xl/comments'+s+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" />',"")+e+(g.length>0?g.reduce((m,s)=>m+'<Override PartName="/xl/tables/'+s+'" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"/>',""):"")+'<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" PartName="/xl/sharedStrings.xml" />'+(l?'<Override PartName="/xl/calcChain.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"/>':"")+'<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />'+o.reduce((m,s)=>m+'<Override PartName="/xl/drawings/'+s+'" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml" />',"")+(n.length>0?n.reduce((m,s,f)=>m+'<Override PartName="/xl/ctrlProps/ctrlProp'+(f+1)+'.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>',""):"")+'<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /></Types>'}function Qt(e,t){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>`+e+'</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="'+e+'" baseType="lpstr"> '+t+"</vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion></Properties>"}function rt(e,t,r,o){e=e.toUpperCase();let n="";if(t.formula){let s=t,f=s.formula.indexOf("=")==0?s.formula.substring(1):s.formula,v=e.indexOf(":")>0,D=s.referenceCells?s.referenceCells:e,j=v?e.substring(0,e.indexOf(":")):e,k=j.replace(/[0-9]/g,""),d=parseInt(e.substr(k.length)),q=s.returnType?s.returnType:s.isArray||v?' t="str"':"",U="styleId"in s&&o&&typeof s.styleId=="string"&&o[s.styleId]?' s="'+o[s.styleId].index+'"':"",J=s.isArray||v?' t="array" ref="'+D+'"':"";return n='<c r="'+j+'"'+U+q+"><f"+J+">"+f+"</f></c>",{column:k,row:d,needCalcChain:!1,isCustom:!0,cell:n}}let l=e.replace(/[0-9]/g,""),g=parseInt(e.substr(l.length)),u=!1,m="";if(t.noArgType){const s=t;if(s.noArgType=="NOW"||s.noArgType=="TODAY"){const f="styleId"in s&&o&&typeof s.styleId=="string"&&o[s.styleId]?' s="'+o[s.styleId].index+'"':"";n='<c r="'+e+'"'+f+"><f>"+s.noArgType+"()</f></c>"}else{let f="NOW()";const v="styleId"in s&&o&&typeof s.styleId=="string"&&o[s.styleId]?' s="'+o[s.styleId].index+'"':"";n='<c r="'+e+'"'+v+"><f>"+s.noArgType.substring(4)+"("+f+")</f></c>"}m='<c r="'+e+'" i="'+r+'"/>',u=!0}else if(t.referenceCell){const s=t;let f="";typeof s.value<"u"&&(f=","+s.value);let v="";s.type=="COT"&&(v="_xlfn.");const D="styleId"in s&&o&&typeof s.styleId=="string"&&o[s.styleId]?' s="'+o[s.styleId].index+'"':"";n='<c r="'+e+'"'+D+"><f>"+v+s.type+"("+s.referenceCell.toUpperCase()+f+")</f></c>",m='<c r="'+e+'" i="'+r+'"/>',u=!0}else{const s=t;n='<c r="'+e+'"'+(o&&typeof s.styleId=="string"&&o[s.styleId]?' s="'+o[s.styleId].index+'"':"")+"><f>"+s.type+"("+s.start.toUpperCase()+":"+s.end.toUpperCase()+")</f></c>"}return{column:l,row:g,cell:n,needCalcChain:u,chainCell:m}}function nt(e,t,r){let o=!1,n,l;if(typeof e=="object"){if("author"in e&&e.author&&(o=!0,l=e.author),"styleId"in e&&typeof e.styleId=="string"){let g=t[e.styleId];typeof g=="string"&&(r=g)}n="comment"in e&&typeof e.comment=="string"?At(e.comment):[""]}else n=e?At(e):[""];return o&&n.unshift(l+":"),{hasAuthor:o,author:l,commentStyle:r,commentStr:n}}function At(e){var t=e.split(/\r?\n|\r|\n/g);return t}function lt(e,t,r,o){let n='<comment ref="'+e+'" authorId="'+Math.max(0,o-1)+'" shapeId="0"><text>',l="";return t.forEach((g,u)=>{let m="";if(g.length==0){l+=` `;return}u>0&&(m=' xml:space="preserve"',l+=` `),n+="<r>"+r+"<t"+m+">"+l+g+"</t></r>",l=""}),l.length>0&&n.indexOf("<r>")>0&&(n=n.substring(0,n.length-8)+l+"</t></r>"),n+="</text></comment>",n}const eo='<rPr><b /><sz val="9" /><color rgb="000000" /><rFont val="Tahoma" /></rPr>',Me=function(e){return e.replace(/\&/g,"&amp;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;")};function at(e,t,r){let o="";return e.forEach(n=>{typeof n.value=="string"&&(n.value=Me(n.value)),o+="<r>"+(n.styleId&&t[n.styleId]?t[n.styleId]:t[r])+'<t xml:space="preserve">'+n.value+"</t></r>"}),"<si>"+o+"</si>"}const Lt={percentage:{key:9},fraction:{key:13},short_date:{key:14},yen:{key:160,value:'<numFmt numFmtId="160" formatCode="_ [$¥-804]* #,##0.00_ ;_ [$¥-804]* \\-#,##0.00_ ;_ [$¥-804]* &quot;-&quot;??_ ;_ @_ " />'},"¥":{key:160,value:'<numFmt numFmtId="160" formatCode="_ [$¥-804]* #,##0.00_ ;_ [$¥-804]* \\-#,##0.00_ ;_ [$¥-804]* &quot;-&quot;??_ ;_ @_ " />'},euro:{key:161,value:'<numFmt numFmtId="161" formatCode="_([$€-2]\\ * #,##0.00_);_([$€-2]\\ * \\(#,##0.00\\);_([$€-2]\\ * &quot;-&quot;??_);_(@_)" />'},"€":{key:161,value:'<numFmt numFmtId="161" formatCode="_([$€-2]\\ * #,##0.00_);_([$€-2]\\ * \\(#,##0.00\\);_([$€-2]\\ * &quot;-&quot;??_);_(@_)" />'},pound:{key:162,value:'<numFmt numFmtId="162" formatCode="_-[$£-809]* #,##0.00_-;\\-[$£-809]* #,##0.00_-;_-[$£-809]* &quot;-&quot;??_-;_-@_-" />'},"£":{key:162,value:'<numFmt numFmtId="162" formatCode="_-[$£-809]* #,##0.00_-;\\-[$£-809]* #,##0.00_-;_-[$£-809]* &quot;-&quot;??_-;_-@_-" />'},dollar:{key:163,value:'<numFmt numFmtId="163" formatCode="_([$$-409]* #,##0.00_);_([$$-409]* \\(#,##0.00\\);_([$$-409]* &quot;-&quot;??_);_(@_)" />'},$:{key:163,value:'<numFmt numFmtId="163" formatCode="_([$$-409]* #,##0.00_);_([$$-409]* \\(#,##0.00\\);_([$$-409]* &quot;-&quot;??_);_(@_)" />'},float_3:{key:164,value:'<numFmt numFmtId="164" formatCode="0.000" />'},time:{key:165,value:'<numFmt numFmtId="165" formatCode="[$-F400]h:mm:ss\\ AM/PM" />'},ريال:{key:171,value:'<numFmt numFmtId="171" formatCode="_ * #,##0.00_-[$ريال-429]_ ;_ * #,##0.00\\-[$ريال-429]_ ;_ * &quot;-&quot;??_-[$ريال-429]_ ;_ @_ " />'},"₽3":{key:172,value:'<numFmt numFmtId="172" formatCode="_-* #,##0.00\\ [$₽-444]_-;\\-* #,##0.00\\ [$₽-444]_-;_-* &quot;-&quot;??\\ [$₽-444]_-;_-@_-" />'},"₽2":{key:173,value:'<numFmt numFmtId="173" formatCode="_-* #,##0.00\\ [$₽-485]_-;\\-* #,##0.00\\ [$₽-485]_-;_-* &quot;-&quot;??\\ [$₽-485]_-;_-@_-" />'},"₽1":{key:174,value:'<numFmt numFmtId="174" formatCode="_-* #,##0.00\\ [$₽-46D]_-;\\-* #,##0.00\\ [$₽-46D]_-;_-* &quot;-&quot;??\\ [$₽-46D]_-;_-@_-" />'},"₼1":{key:175,value:'<numFmt numFmtId="175" formatCode="_-* #,##0.00\\ [$₼-42C]_-;\\-* #,##0.00\\ [$₼-42C]_-;_-* &quot;-&quot;??\\ [$₼-42C]_-;_-@_-" />'},manat:{key:176,value:'<numFmt numFmtId="176" formatCode="_-* #,##0.00\\ [$₼-82C]_-;\\-* #,##0.00\\ [$₼-82C]_-;_-* &quot;-&quot;??\\ [$₼-82C]_-;_-@_-" />'},"₼":{key:176,value:'<numFmt numFmtId="176" formatCode="_-* #,##0.00\\ [$₼-82C]_-;\\-* #,##0.00\\ [$₼-82C]_-;_-* &quot;-&quot;??\\ [$₼-82C]_-;_-@_-" />'},"֏":{key:177,value:'<numFmt numFmtId="177" formatCode="_-* #,##0.00\\ [$֏-42B]_-;\\-* #,##0.00\\ [$֏-42B]_-;_-* &quot;-&quot;??\\ [$֏-42B]_-;_-@_-" />'},ruble:{key:178,value:'<numFmt numFmtId="178" formatCode="_-* #,##0.00\\ [$₽-419]_-;\\-* #,##0.00\\ [$₽-419]_-;_-* &quot;-&quot;??\\ [$₽-419]_-;_-@_-" />'},"₽":{key:178,value:'<numFmt numFmtId="178" formatCode="_-* #,##0.00\\ [$₽-419]_-;\\-* #,##0.00\\ [$₽-419]_-;_-* &quot;-&quot;??\\ [$₽-419]_-;_-@_-" />'},CHF:{key:179,value:'<numFmt numFmtId="179" formatCode="_-* #,##0.00\\ [$CHF-100C]_-;\\-* #,##0.00\\ [$CHF-100C]_-;_-* &quot;-&quot;??\\ [$CHF-100C]_-;_-@_-" />'},float_1:{key:180,value:'<numFmt numFmtId="180" formatCode="0.0" />'},float_2:{key:181,value:'<numFmt numFmtId="181" formatCode="0.00" />'},float_4:{key:182,value:'<numFmt numFmtId="182" formatCode="0.0000" />'},dollar_2:{key:183,value:'<numFmt numFmtId="183" formatCode="&quot;$&quot;#,##0.00" />'},num_sep:{key:184,value:'<numFmt numFmtId="184" formatCode="#,##0" />'},num_sep_1:{key:185,value:'<numFmt numFmtId="185" formatCode="#,##0.0" />'},num_sep_2:{key:186,value:'<numFmt numFmtId="186" formatCode="#,##0.00" />'},date:{key:187,value:'<numFmt numFmtId="187" formatCode="[$-F800]dddd\\,\\ mmmm\\ dd\\,\\ yyyy" />'},dollar_rounded:{key:188,value:'<numFmt numFmtId="188" formatCode="&quot;$&quot;#,##0" />'}},Ht=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_t=(e,t,r=!1,o)=>{let n,l=!1;return typeof o=="function"?(n=o,l=!0):n=fetch,n(e).then(g=>l?g:r?g.arrayBuffer():g.blob()).then(g=>l||r?g:new File([g],t)).catch(g=>{throw g})};function _e(e,t){e=e.toUpperCase();let r=e.replace(/[0-9]/g,"");if(r.length==0)throw"Invalid Column";let o=parseInt(e.substring(r.length));if(isNaN(o))throw"Invalid Row";o=Math.max(0,o-1);let n=t.indexOf(r);return n<0&&(t=$e(t,Math.pow(10,r.length+1),""),n=t.indexOf(r),n<0&&(n=0)),{col:n,row:o}}let to={},it=new Proxy(to,{get(e,t){return t in e?e[t]:(this.set(e,t,{},!0),{})},set(e,t,r,o){return e[t]=r,!0}});function Nt(e,t,r){it[e],it[e][t]=r}function Bt(e,t,r){Object.keys(r).forEach(n=>{const l=r[n];typeof l=="object"?n!="data"&&n!="headers"&&Bt(e,t.length>0?t+"."+n:n,l):Nt(e,t.length>0?t+"."+n:n,l)})}function oo(e,t){Bt(e,"",t)}function ro(e,t){let r=t,o=it[e];return Object.keys(o).forEach(l=>{const g=l.split(".");let u=r,m=o[l];for(let s=0;s<g.length;s++){const f=g[s];u[f]?u=u[f]:g.length-1==s?u[f]=m:(u[f]={},u=u[f])}}),r}function no(e){if(!Array.isArray(e)||!e.length)return"";const t=e.length;let r="<dataValidations>";for(let o=0;o<t;o++){const n=e[o],l=n.for.reduce((u,m)=>u+" "+m,""),g=n.option.join(",");r+='<dataValidation type="list" allowBlank="1" showErrorMessage="1" sqref="'+l.trim()+'"><formula1>&quot;'+g+"&quot;</formula1></dataValidation>"}return r+="</dataValidations>",r}async function Ke(e,t=""){if(typeof t=="string"&&t.length>0&&(e=ro(t,e)),typeof e.creator=="string"&&e.creator.trim().length<=0)throw'length of "creator" most be bigger then 0';if(typeof e.created=="string"&&new Date(e.created).toString()=="Invalid Date")throw'"created" is not valid date';if(typeof e.modified=="string"&&new Date(e.modified).toString()=="Invalid Date")throw'"modified" is not valid date';let r=Lt;e.formatMap&&typeof e.formatMap=="object"&&(r={...r,...e.formatMap});const o=e.backend,n={lt:"lessThan",gt:"greaterThan",between:"between",ct:"containsText",eq:"equal"};let l=[...Ht];e.numberOfColumn&&e.numberOfColumn>25&&(l=$e(l,e.numberOfColumn));const u=(await Promise.resolve().then(()=>require("./jszip.min-jYEVHKmD.cjs")).then(w=>w.jszip_min)).default;let m=new u;e.sheet||(e.sheet=[{headers:[],data:[]}]);const s=e.sheet.length;let f=m.folder("xl"),v=null,D=null,j=null;e.styles||(e.styles={}),e.addDefaultTitleStyle&&(e.styles.titleStyle={alignment:{horizontal:"center",vertical:"center"}});const k=Object.keys(e.styles),d=eo,q=e.activateConditionalFormatting?e.activateConditionalFormatting:!1,U={},J={};let N=k.reduce((w,a,b)=>{const x=e.styles[a];if(x.type&&(x.type=="headerFooter"||x.type=="HF")){let C="",G="-",ce="Regular";if(x.fontFamily&&(G=x.fontFamily),x.bold&&(ce="Bold"),x.italic&&(ce=="Regular"&&(ce=""),ce+="Italic"),(G!="-"||ce!="Regular")&&(C='&amp;"'+G+","+ce+'"'),x.size&&(C+="&amp;"+x.size),x.doubleUnderline?C+="&amp;E":x.underline&&(C+="&amp;U"),x.color){const Te=he(x.color,o);typeof Te=="string"&&Te.length>0&&(C+="&amp;K"+Te.toUpperCase())}return U[a]=C,w}if(q&&typeof x.type=="string"&&x.type&&(x.type=="conditionalFormatting"||x.type.toUpperCase()=="CF")){J[a]=w.conditionalFormatting.count;let C=he(x.color,o),G=he(x.backgroundColor,o);return w.conditionalFormatting.value+='<dxf><font><color rgb="'+C+'"/></font><fill> <patternFill> <bgColor rgb="'+G+'"/></patternFill></fill></dxf>',w.conditionalFormatting.count++,w}const V={fillIndex:0,fontIndex:0,borderIndex:0,formatIndex:0};if(x.backgroundColor){let C=he(x.backgroundColor,o);V.fillIndex=w.fill.count,w.fill.count++,w.fill.value=w.fill.value+'<fill><patternFill patternType="solid">'+(C?'<fgColor rgb="'+C.replace("#","")+'" />':"")+"</patternFill></fill>"}if(x.color||x.fontFamily||x.size||x.bold||x.italic||x.underline||x.doubleUnderline){const C=he(x.color,o);V.fontIndex=w.font.count,w.font.count++,w.font.value=w.font.value+"<font>"+(x.bold?"<b/>":"")+(x.italic?"<i />":"")+(x.underline||x.doubleUnderline?"<u "+(x.doubleUnderline?' val="double" ':"")+"/>":"")+(x.size?'<sz val="'+x.size+'" />':"")+(C?'<color rgb="'+C.replace("#","")+'" />':"")+(x.fontFamily?'<name val="'+x.fontFamily+'" />':"")+"</font>",w.commentSyntax.value[a]="<rPr>"+(x.bold?"<b/>":"")+(x.italic?"<i/>":"")+(x.underline||x.doubleUnderline?"<u "+(x.doubleUnderline?'val="double" ':"")+"/>":"")+'<sz val="'+(x.size?x.size:"9")+'" />'+(C?'<color rgb="'+C.replace("#","")+'" />':"")+'<rFont val="'+(x.fontFamily?x.fontFamily:"Tahoma")+'" /></rPr>'}let se="/>";x.alignment&&(x.alignment.rtl&&(x.alignment.readingOrder=2),delete x.alignment.rtl,x.alignment.ltr&&(x.alignment.readingOrder=1),delete x.alignment.ltr,se=' applyAlignment="1"><alignment '+Object.keys(x.alignment).reduce((C,G)=>C+" "+G+'="'+x.alignment[G]+'" ',"")+" /></xf>");const H=x.border;let O="";if(typeof H=="object"&&((H.left||H.full)&&(O+='<left style="'+(H.left||H.full).style+'"><color rgb="'+he((H.left||H.full).color,o).replace("#","")+'" /></left>'),(H.right||H.full)&&(O+='<right style="'+(H.right||H.full).style+'"><color rgb="'+he((H.right||H.full).color,o).replace("#","")+'" /></right>'),(H.top||H.full)&&(O+='<top style="'+(H.top||H.full).style+'"><color rgb="'+he((H.top||H.full).color,o).replace("#","")+'" /></top>'),(H.bottom||H.full)&&(O+='<bottom style="'+(H.bottom||H.full).style+'"><color rgb="'+he((H.bottom||H.full).color,o).replace("#","")+'" /></bottom>'),V.borderIndex=w.border.count,w.border.count++,w.border.value+="<border>"+O+"<diagonal /></border>"),x.format){const C=r[x.format];C&&(V.formatIndex=C.key,"value"in C&&(w.format.count++,w.format.value+=C.value))}return w.cell.value=w.cell.value+'<xf numFmtId="'+V.formatIndex+'" fontId="'+V.fontIndex+'" fillId="'+V.fillIndex+'" borderId="'+V.borderIndex+'" xfId="0"'+(V.borderIndex>0?' applyBorder="1" ':"")+(V.fillIndex>0?' applyFill="1" ':"")+(V.fontIndex>=0?' applyFont="1" ':"")+(V.formatIndex>0?' applyNumberFormat="1" ':"")+se,e.styles[a].index=w.cell.count,w.cell.count++,w},{conditionalFormatting:{count:q?1:0,value:'<dxf><font><color rgb="FF9C0006"/></font><fill> <patternFill> <bgColor rgb="FFFFC7CE"/></patternFill></fill></dxf>'},commentSyntax:{value:{}},format:{count:0,value:""},border:{count:1,value:""},fill:{count:2,value:""},font:{count:2,value:""},cell:{count:2,value:""}});f==null||f.file("styles.xml",Jt(N,q));let oe='<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" PartName="/xl/worksheets/sheet1.xml" />',P="",B=0,X="",$="",L={};const E={};let M="",Y=4,W=!1,K=-1,Ce=[],Q=1;const ye={checkbox:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <formControlPr xmlns="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" objectType="CheckBox" **value** **fmlaLink** lockText="1" noThreeD="1"/>`};let ve=1024;const we={checkbox:`<v:shape id="***id***" type="#_x0000_t201" style='position:absolute; margin-left:1.5pt;margin-top:1.5pt;width:63pt;height:16.5pt;z-index:1; mso-wrap-style:tight' filled="f" fillcolor="window [65]" stroked="f" strokecolor="windowText [64]" o:insetmode="auto"> <v:path shadowok="t" strokeok="t" fillok="t"/> <o:lock v:ext="edit" rotation="t"/> <v:textbox style='mso-direction-alt:auto' o:singleclick="f"> <div style='text-align:left'><font face="Segoe UI" size="160" color="auto">***text***</font></div> </v:textbox> <x:ClientData ObjectType="Checkbox"> <x:SizeWithCells/> <x:Anchor> 0, 2, 0, 2, 0, 86, 1, 0</x:Anchor> <x:AutoFill>False</x:AutoFill> <x:AutoLine>False</x:AutoLine> <x:TextVAlign>Center</x:TextVAlign> <x:NoThreeD/> </x:ClientData> </v:shape>`},Se={checkbox:`<v:shapetype id="_x0000_t201" coordsize="21600,21600" o:spt="201" path="m,l,21600r21600,l21600,xe"> <v:stroke joinstyle="miter"/> <v:path shadowok="f" o:extrusionok="f" strokeok="f" fillok="f" o:connecttype="rect"/> <o:lock v:ext="edit" shapetype="t"/> </v:shapetype>`};let ae=[],ie="",ge=!1,de=null;for(let w=0;w<s;w++){const a=e.sheet[w],b=w+1;let x={},V={start:"",end:""};const se=a.asTable;let H="",O=a.shiftTop&&a.shiftTop>=0?a.shiftTop+1:1,C="",G="",ce="",Te="",Ee="",Ie="",Ue=!1,dt="",pt="",ht="",ut="",xe=Object.assign([],a.merges),ue=Object.assign({},a.formula),We=Object.assign([],a.conditionalFormatting),Pe=!1,pe=[],Le="",He=[],yt=[],Ge=[],Ze=[],ke={},je="",Re=!1,Je="";if(a.rtl&&(Ee+=' rightToLeft="1" '),a.pageBreak){const T=a.pageBreak;if(T.row&&Array.isArray(T.row)){Ie="pageBreakPreview";const i=T.row.length;Je+='<rowBreaks count="'+i+'" manualBreakCount="'+i+'">'+T.row.reduce((y,p)=>y+'<brk id="'+p+'" max="16383" man="1"/>',"")+"</rowBreaks>"}if(T.column&&Array.isArray(T.column)){Ie="pageBreakPreview";const i=T.column.length;Je+='<colBreaks count="'+i+'" manualBreakCount="'+i+'">'+T.column.reduce((y,p)=>y+'<brk id="'+p+'" max="16383" man="1"/>',"")+"</colBreaks>"}}let gt="";if(a.pageOption){const T=a.pageOption;if(T.isPortrait&&(Re=!0),T.margin){const S=T.margin;let F={left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3};Object.keys(F).forEach(h=>{typeof S[h]=="number"&&(F[h]=S[h])}),gt='<pageMargins left="'+F.left+'" right="'+F.right+'" top="'+F.top+'" bottom="'+F.bottom+'" header="'+F.header+'" footer="'+F.footer+'"/>'}let i="",y="",p="",c="";if(["header","footer"].forEach(S=>{const F=S.charAt(0).toUpperCase()+S.substring(1);if(T[S]){const h=T[S];typeof h=="object"&&Object.keys(h).forEach(A=>{i.indexOf(A)<0&&(i+=A);const le=h[A];let z="";if(Object.keys(le).reduce((R,I)=>(I=="l"?R.splice(0,0,I):I=="c"?R.splice(1,0,I):I=="r"&&R.splice(2,0,I),R),[]).forEach(R=>{const I=le[R];z+="&amp;"+R.toUpperCase(),I.styleId&&U[I.styleId]&&(z+=U[I.styleId]),I.text&&(z+=I.text)}),z="<"+A+F+">"+z+"</"+A+F+">",A=="odd")y+=z;else if(A=="even")p+=z;else if(A=="first")c+=z;else throw"type error"})}}),je=y+p+c,je.length>0){Re=!0;const S=i.length==7||i.length==12?' differentOddEven="1"':"",F=i.indexOf("first")>=0?' differentFirst="1"':"";je="<headerFooter"+S+F+">"+je+"</headerFooter>"}}if(a.viewOption){let T="";const i=a.viewOption;i.type&&(Ie=i.type),i.hideRuler&&(Ee+=' showRuler="0" '),i.hideGrid&&(Ee+=' showGridLines="0" '),i.hideHeadlines&&(Ee+=' showRowColHeaders="0" ');let y=i.splitOption;if(typeof y>"u"&&(Re=!1,typeof i.frozenOption=="object")){const p=i.frozenOption;if(T=' state="frozen" ',p.type=="R"||p.type=="ROW"){let c;typeof p.index=="object"?c=p.index.r:c=p.index,y={startAt:{b:"A"+(c+1)},type:"H",split:c}}else if(p.type=="C"||p.type=="COLUMN"){let c;typeof p.index=="object"?c=p.index.c:c=p.index,c>l.length-1&&(l=$e(l,c)),y={type:"V",startAt:{r:l[c]+1},split:c}}else if(p.type=="B"||p.type=="BOTH"){let c="",_;typeof p.index=="number"?(_=p.index,c=l[p.index]+(p.index+1)):(_={y:p.index.r,x:p.index.c},c=l[p.index.c]+(p.index.r+1)),y={startAt:{two:c},type:"B",split:_}}}if(y)if(y.type=="H"||y.type=="HORIZONTAL"){let p;y.startAt&&(p=y.startAt.b,y.startAt.t&&(Ee+=' topLeftCell="'+y.startAt.t+'"')),p||(p="A1"),Te='<pane ySplit="'+(typeof y.split=="object"&&y.split.y||y.split)+'" topLeftCell="'+p+'" activePane="bottomLeft"'+T+"/>"}else if(y.type=="V"||y.type=="VERTICAL"){let p;y.startAt&&(p=y.startAt.r,y.startAt.l&&(Ee+=' topLeftCell="'+y.startAt.l+'"')),p||(p="A1"),Te='<pane xSplit="'+(typeof y.split=="object"&&y.split.x||y.split)+'" topLeftCell="'+p+'" activePane="topLeft"'+T+"/>"}else{let p;y.startAt&&(p=y.startAt.two,y.startAt.one&&(Ee+=' topLeftCell="'+y.startAt.one+'"')),p||(p="A1"),Te='<pane xSplit="'+(typeof y.split=="object"&&y.split.x||y.split)+'" ySplit="'+(typeof y.split=="object"&&y.split.y||y.split)+'" topLeftCell="'+p+'" activePane="bottomLeft"'+T+"/>"}}if(Re&&(Ie="pageLayout"),a.checkbox){Ue=!0;const T=ye.checkbox;a.checkbox.forEach((i,y)=>{let p=T;if(i.link){let A=_e(i.link,l);p=p.replace("**fmlaLink**",'fmlaLink="$'+l[A.col]+"$"+(A.row+1)+'"')}else p=p.replace("**fmlaLink**","");i.mixed?p=p.replace("**value**",'checked="Mixed"'):i.checked?p=p.replace("**value**",'checked="Checked"'):p=p.replace("**value**",""),i.threeD&&p.replace('noThreeD="1"',""),ae.push(p),ve++;let c=w+""+ve++;const _="_x0000_s"+c;pt+=we.checkbox.replace("***id***",_).replace("***text***",i.text);let S=i.startStr,F=i.endStr,h={start:{col:0,row:0},end:{col:1,row:1}};if(i.col&&i.row&&(h={start:{col:i.col,row:i.row-1},end:{col:i.col,row:i.row}}),typeof S=="string"&&S.length>=2){let A=_e(S,l);h.start={...A},h.end={col:A.col+1,row:A.row+1}}if(typeof F=="string"&&F.length>=2){let A=_e(F,l);A.row+=1,A.col+=1,h.end={...A}}ut+='<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x14"><control shapeId="'+c+'" r:id="rId'+(7+y)+'" name="'+i.text+'"><controlPr defaultSize="0" autoFill="0" autoLine="0" autoPict="0"><anchor moveWithCells="1"><from><xdr:col>'+h.start.col+"</xdr:col><xdr:colOff>19050</xdr:colOff><xdr:row>"+h.start.row+"</xdr:row><xdr:rowOff>19050</xdr:rowOff></from><to><xdr:col>"+h.end.col+"</xdr:col><xdr:colOff>819150</xdr:colOff><xdr:row>"+h.end.row+"</xdr:row><xdr:rowOff>0</xdr:rowOff></to></anchor></controlPr></control></mc:Choice></mc:AlternateContent>",ht+='<Relationship Id="rId'+(7+y)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp" Target="../ctrlProps/ctrlProp'+ae.length+'.xml" />',dt+='<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" Requires="a14"><xdr:twoCellAnchor editAs="oneCell"><xdr:from><xdr:col>'+h.start.col+"</xdr:col><xdr:colOff>19050</xdr:colOff><xdr:row>"+h.start.row+"</xdr:row><xdr:rowOff>19050</xdr:rowOff></xdr:from><xdr:to><xdr:col>"+h.end.col+"</xdr:col><xdr:colOff>819150</xdr:colOff><xdr:row>"+h.end.row+'</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:to><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="'+c+'" name="'+i.text+'" hidden="1"><a:extLst><a:ext uri=""><a14:compatExt spid="'+_+'"/></a:ext><a:ext uri=""><a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id=""/></a:ext></a:extLst></xdr:cNvPr><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr bwMode="auto"><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/><a:ln><a:noFill/></a:ln></xdr:spPr><xdr:txBody><a:bodyPr vertOverflow="clip" wrap="square" lIns="27432" tIns="18288" rIns="0" bIns="18288" anchor="ctr" upright="1"/><a:lstStyle/><a:p><a:pPr algn="l" rtl="0"><a:defRPr sz="1000"/></a:pPr><a:r><a:rPr lang="en-US" sz="800" b="0" i="0" u="none" strike="noStrike" baseline="0"><a:solidFill><a:srgbClr val="000000"/></a:solidFill><a:latin typeface="Segoe UI"/><a:cs typeface="Segoe UI"/></a:rPr><a:t>'+i.text+"</a:t></a:r></a:p></xdr:txBody></xdr:sp><xdr:clientData/></xdr:twoCellAnchor></mc:Choice><mc:Fallback/></mc:AlternateContent>"})}let Xe;if(a.backgroundImage){v==null&&(v=f==null?void 0:f.folder("media"));const T=a.backgroundImage;Xe=new Promise(async(i,y)=>{let p=T.lastIndexOf("."),c;p>0?(c=T.substring(p+1).toLowerCase(),c.length>4&&(c.indexOf("gif")>=0?c="gif":c.indexOf("jpg")>=0?c="jpg":c.indexOf("jpeg")>=0?c="jpeg":c="png")):c="png";const _=Q++,S="image"+_+"."+c,F=await _t(T,S,o,e.fetch);F||y("image not load"),Ce.push(c),i({name:S,type:c,image:F,ref:_})})}let Qe;if(a.images&&(v==null&&(v=f==null?void 0:f.folder("media")),Qe=Promise.all([...a.images.map(async(T,i)=>{let y=T.url.lastIndexOf("."),p;y>0?(p=T.url.substring(y+1).toLowerCase(),p.length>4&&(p.indexOf("gif")>=0?p="gif":p.indexOf("jpg")>=0?p="jpg":p.indexOf("jpeg")>=0?p="jpeg":p="png")):p="png",Ce.push(p);const c="image"+Q+++"."+p;return{type:p,image:await _t(T.url,c,o,e.fetch),obj:T,i,name:c}})])),Array.isArray(a.headers)&&a.headers.length){const T=a.headers.length;let i="";if(a.title){const c=a.title,_=c.comment,S=c.shiftTop&&c.shiftTop>=0?c.shiftTop:0,F=a.shiftLeft&&a.shiftLeft>=0?a.shiftLeft:0,h=c.shiftLeft&&c.shiftLeft+F>=0?c.shiftLeft+F:F,A=c.consommeRow?c.consommeRow-1:1,le=c.consommeCol?c.consommeCol:T,z=A==0&&typeof c.height=="number"?' ht="'+c.height+'" customHeight="1" ':"",R=c.styleId?c.styleId:"titleStyle",I=l[h]+""+(O+S);if(xe.push(I+":"+l[h+le-1]+(O+A+S)),typeof _<"u"){Pe=!0;const ee=nt(_,N.commentSyntax.value,d);let fe=pe.length;if(ee.hasAuthor&&typeof ee.author<"u"){let Z=ee.author.toString();const re=pe.indexOf(Z);re<0?pe.push(Z):fe=re}He.push({row:O+S-1,col:h}),Le+=lt(I,ee.commentStr,ee.commentStyle,fe)}typeof c.text=="string"&&(x[O+S]={startTag:'<row r="'+(O+S)+'" '+z+' spans="1:'+Math.max(h+le-1,1)+'">',details:'<c r="'+I+'" '+(e.styles[R]?' s="'+e.styles[R].index+'" ':"")+' t="s"><v>'+B+"</v></c>",endTag:"</row>"},i+='<row r="'+(O+S)+'" '+z+' spans="1:'+Math.max(h+le-1,1)+'">',i+='<c r="'+I+'" '+(e.styles[R]?' s="'+e.styles[R].index+'" ':"")+' t="s"><v>'+B+"</v></c>",i+="</row>",B++,L[c.text]=c.text,c.multiStyleValue&&Array.isArray(c.multiStyleValue)?P+=at(c.multiStyleValue,N.commentSyntax.value,R):P+="<si><t>"+Me(c.text)+"</t></si>"),O+=S+A+1}let y=a.headerStyleKey?a.headerStyleKey:null,p=0;if(typeof a.shiftLeft=="number"&&a.shiftLeft>=0&&(p=a.shiftLeft),se&&(H+='<tableColumns count="'+a.headers.length+'">',de||(de=f==null?void 0:f.folder("tables"))),V.start=l[p]+""+O,V.end=l[p+a.headers.length-1]+""+(O+a.data.length),a.headers.forEach((c,_)=>{if(se&&(H+='<tableColumn id="'+(_+1)+'" name="'+c.text+'"/>'),p&&(_+=p),c.formula&&Ge.push(_),c.conditionalFormatting&&q&&Ze.push(_),yt.push(c.label),a.mergeRowDataCondition&&typeof a.mergeRowDataCondition=="function"&&a.mergeRowDataCondition(c,null,_,!0)===!0&&(ke[l[_]]={inProgress:!0,start:O}),a.styleCellCondition&&typeof a.styleCellCondition=="function"&&(y=a.styleCellCondition(c,c,O,_,!0,k)||y),c.size&&c.size>0&&(G+='<col min="'+(_+1)+'" max="'+(_+1)+'" width="'+c.size+'" customWidth="1" />'),a.withoutHeader)return;const S=l[_]+""+O;if(typeof a.commentCondition=="function"){const h=a.commentCondition(c,null,c.label,O,_,!0);(typeof h=="string"||typeof h=="object"&&h!=null)&&(c.comment=h)}if(c.comment){Pe=!0;const h=nt(c.comment,N.commentSyntax.value,d);let A=pe.length;if(h.hasAuthor&&typeof h.author<"u"){let le=h.author.toString();const z=pe.indexOf(le);z<0?pe.push(le):A=z}He.push({row:O-1,col:_}),Le+=lt(S,h.commentStr,h.commentStyle,A)}const F=ue&&ue[S];if(F){const h=rt(S,F,b,e.styles);h.needCalcChain&&(ge=!0,ie+=h.chainCell),C+=h.cell,delete ue[S]}else{if(C+='<c r="'+l[_]+O+'" '+(y&&e.styles&&e.styles[y]?' s="'+e.styles[y].index+'" ':"")+' t="s"><v>'+B+"</v></c>",typeof a.multiStyleCondition=="function"){const h=a.multiStyleCondition(c,null,c.label,O,_,!0);h&&(c.multiStyleValue=h)}c.multiStyleValue&&Array.isArray(c.multiStyleValue)?P+=at(c.multiStyleValue,N.commentSyntax.value,y||""):P+="<si><t>"+Me(c.text)+"</t></si>",L[c.text]=c.text,B++}}),se&&(H+="</tableColumns>"),a.withoutHeader)C+=i;else{const c='<row r="'+O+'" spans="1:'+Math.max(T,1)+'" '+(a.headerHeight?'ht="'+a.headerHeight+'" customHeight="1"':"")+(a.headerRowOption?Object.keys(a.headerRowOption).reduce((_,S)=>_+" "+S+'="'+a.headerRowOption[S]+'" '," "):"")+">";x[O]={startTag:c,endTag:"</row>",details:C},C=i+c+C+"</row>",O++}if(Array.isArray(a.data)){const c=a.mapSheetDataOption&&a.mapSheetDataOption.outlineLevel?a.mapSheetDataOption.outlineLevel:"outlineLevel",_=a.mapSheetDataOption&&a.mapSheetDataOption.hidden?a.mapSheetDataOption.hidden:"hidden",S=a.mapSheetDataOption&&a.mapSheetDataOption.height?a.mapSheetDataOption.height:"height",F=a.data.length;a.data.forEach((h,A)=>{if(h.mergeType)for(let I=0;I<h.mergeType.length;I++){const ee=h.mergeType[I],fe=h.mergeStart[I],Z=h.mergeValue[w];let re="";ee=="both"?re=l[fe]+""+O+":"+l[fe+Z[1]]+(O+Z[0]):ee=="col"?re=l[fe]+""+O+":"+l[fe+Z[0]]+O:re=l[fe]+""+O+":"+l[fe]+(O+Z[0]),xe.push(re)}const le=h.rowStyle,z='<row r="'+O+'" spans="1:'+Math.max(T,1)+'" '+(S in h?'ht="'+h[S]+'" customHeight="1"':"")+(c in h?' outlineLevel="'+h[c]+'"':"")+(_ in h?' hidden="'+h[_]+'"':"")+" >";C+=z;let R="";yt.forEach((I,ee)=>{p&&(ee+=p);const fe=h[I]*1;let Z=a.convertStringToNumber&&!isNaN(fe)?fe:h[I];typeof Z=="boolean"&&(Z=Z+"");let re=le;if(a.styleCellCondition&&typeof a.styleCellCondition=="function"&&(re=a.styleCellCondition(Z,h,O,ee,!1,k)||le),a.mergeRowDataCondition&&typeof a.mergeRowDataCondition=="function"){let te=a.mergeRowDataCondition(Z,I,ee,!1);const ne=l[ee];let be=ke[ne];te===!0?(!be||be&&!be.inProgress)&&(ke[ne]={inProgress:!0,start:O}):be&&be.inProgress&&(xe.push(ne+be.start+":"+ne+(O-1)),ke[ne]={inProgress:!1,start:-1})}typeof Z>"u"&&(Z="");const Be=l[ee]+""+O;if(typeof a.commentCondition=="function"){const te=a.commentCondition(Z,h,I,O,ee,!1);(typeof te=="string"||typeof te=="object"&&te!=null)&&(typeof h.comment!="object"&&(h.comment={}),h.comment[I]=te)}if(typeof h.comment=="object"&&I in h.comment){const te=h.comment[I];Pe=!0;const ne=nt(te,N.commentSyntax.value,d);ne.hasAuthor&&typeof ne.author<"u"&&pe.push(ne.author.toString()),He.push({row:O-1,col:ee});let be=pe.length;if(ne.hasAuthor&&typeof ne.author<"u"){let Et=ne.author.toString();const St=pe.indexOf(Et);St<0?pe.push(Et):be=St}Le+=lt(Be,ne.commentStr,ne.commentStyle,be)}const Tt=ue&&ue[Be];if(Tt){const te=rt(Be,Tt,b);te.needCalcChain&&(ge=!0,ie+=te.chainCell),C+=te.cell,R+=te.cell,delete ue[Be]}else if(typeof Z=="string"){const te='<c r="'+l[ee]+O+'" t="s" '+(re&&e.styles&&e.styles[re]?'s="'+e.styles[re].index+'"':"")+"><v>"+B+"</v></c>";if(R+=te,C+=te,typeof a.multiStyleCondition=="function"){const ne=a.multiStyleCondition(Z,h,I,O,ee,!1);ne&&((!("multiStyleValue"in h)||typeof h.multiStyleValue>"u")&&(h.multiStyleValue={}),h.multiStyleValue[I]=ne)}"multiStyleValue"in h&&h.multiStyleValue&&I in h.multiStyleValue&&Array.isArray(h.multiStyleValue[I])?P+=at(h.multiStyleValue[I],N.commentSyntax.value,re||""):P+="<si><t>"+Me(Z)+"</t></si>",L[Z]=Z,B++}else{const te='<c r="'+l[ee]+O+'" '+(re&&e.styles&&e.styles[re]?'s="'+e.styles[re].index+'"':"")+"><v>"+Z+"</v></c>";C+=te,R+=te}}),F-1==A&&Object.keys(ke).forEach(I=>{ke[I].inProgress&&xe.push(I+ke[I].start+":"+I+O)}),x[O]={startTag:z,endTag:"</row>",details:R},O++,C+="</row>"}),a.sortAndFilter&&(a.sortAndFilter.mode=="all"?ce+='<autoFilter ref="A1:'+l[T-1]+(O-1)+'" />':typeof a.sortAndFilter.ref=="string"&&a.sortAndFilter.ref.length>0&&(ce+='<autoFilter ref="'+a.sortAndFilter.ref+'" />'))}if(Ge.length>0&&Ge.forEach(c=>{const _=a.shiftLeft?a.shiftLeft:0,S=a.headers[c-_],F=l[c];ue[F+""+O]={start:a.withoutHeader?F+"1":F+"2",end:F+""+(O-1),type:S.formula.type,...S.formula.styleId?{styleId:S.formula.styleId}:{}}}),Ze.length>0&&q&&Ze.forEach(c=>{const _=a.headers[c];_.conditionalFormatting&&We.push({..._.conditionalFormatting,start:a.withoutHeader?l[c]+"1":l[c]+"2",end:l[c]+""+(O-1)})}),ue){const c=Object.keys(ue).sort((_,S)=>_>S?1:-1);if(c.length){let _={};c.forEach(S=>{const F=rt(S,ue[S],b,e.styles);F.needCalcChain&&(ge=!0,ie+=F.chainCell),_[F.row]?_[F.row]+=F.cell:_[F.row]=F.cell}),Object.keys(_).sort((S,F)=>+S>+F?1:-1).forEach(S=>{const F=S,h=_[F];let A=x[F];if(A){const le=A.startTag+A.details+h+A.endTag;let z=new RegExp(A.startTag+"[\\n\\s\\S]*?</row>");C=C.replace(z,le)}else C+='<row r="'+S+'" spans="1:'+Math.max(T,1)+'" >'+h+"</row>",x[F]={startTag:'<row r="'+S+'" spans="1:'+Math.max(T,1)+'" >',endTag:"</row>",details:h}})}}}w>0&&(oe+='<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" PartName="/xl/worksheets/sheet'+(w+1)+'.xml" />');const xt=a.name?a.name:"sheet"+(w+1),Yt=a.state?a.state:"visible";X+='<sheet state="'+Yt+'" name="'+xt+'" sheetId="'+(w+1)+'" r:id="rId'+(Y+1)+'" />',$+='<Relationship Id="rId'+(Y+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(w+1)+'.xml" />',M+="<vt:lpstr>"+("sheet"+(w+1))+"</vt:lpstr>",a.selected&&(W=!0,K=w);const bt=a.sortAndFilter?'filterMode="1"':"";let Ct=-1;Xe&&await Xe.then(T=>{let i=T;Ct=i.ref,v==null||v.file(i.name,i.image)});let Ne=!1,et="",vt="";Qe&&(Ne=!0,await Qe.then(T=>{let i="";T.forEach((y,p)=>{const c=p+1;let _=y.image;const S=y.name;let F=y.obj.from,h=y.obj.to,A=y.obj.margin,le=y.obj.type,z=y.obj.extent;typeof z>"u"&&(z={cx:2e5,cy:2e5});let R={start:{col:0,row:0,mL:0,mT:0},end:{col:1,row:1,mR:0,mB:0}};if(typeof F=="string"&&F.length>=2){let I=_e(F,l);R.start={...I},R.end={col:I.col+1,row:I.row+1}}if(typeof h=="string"&&h.length>=2){let I=_e(h,l);I.row+=1,I.col+=1,R.end={...I}}R.end.mR=0,R.end.mB=0,R.start.mL=0,R.start.mT=0,A&&((A.right||A.all)&&(R.end.mR=A.right||A.all),(A.bottom||A.all)&&(R.end.mB=A.bottom||A.all),(A.left||A.all)&&(R.start.mL=A.left||A.all),(A.top||A.all)&&(R.start.mT=A.top||A.all)),le=="one"?et+="<xdr:oneCellAnchor><xdr:from><xdr:col>"+R.start.col+"</xdr:col><xdr:colOff>"+R.start.mT+"</xdr:colOff><xdr:row>"+R.start.row+"</xdr:row><xdr:rowOff>"+R.start.mL+'</xdr:rowOff></xdr:from><xdr:ext cx="'+z.cx+'" cy="'+z.cy+'"/><xdr:pic><xdr:nvPicPr><xdr:cNvPr id="'+c+'" name="Picture '+c+'"></xdr:cNvPr><xdr:cNvPicPr preferRelativeResize="0" /></xdr:nvPicPr><xdr:blipFill><a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId'+c+'"></a:blip><a:stretch><a:fillRect /></a:stretch></xdr:blipFill><xdr:spPr><a:prstGeom prst="rect"><a:avLst /></a:prstGeom><a:noFill /></xdr:spPr></xdr:pic><xdr:clientData /></xdr:oneCellAnchor>':et+='<xdr:twoCellAnchor editAs="oneCell"><xdr:from><xdr:col>'+R.start.col+"</xdr:col><xdr:colOff>"+R.start.mT+"</xdr:colOff><xdr:row>"+R.start.row+"</xdr:row><xdr:rowOff>"+R.start.mL+"</xdr:rowOff></xdr:from><xdr:to><xdr:col>"+R.end.col+"</xdr:col><xdr:colOff>"+R.end.mB+"</xdr:colOff><xdr:row>"+R.end.row+"</xdr:row><xdr:rowOff>"+R.end.mR+'</xdr:rowOff></xdr:to><xdr:pic><xdr:nvPicPr><xdr:cNvPr id="'+c+'" name="Picture '+c+'"></xdr:cNvPr><xdr:cNvPicPr preferRelativeResize="0" /></xdr:nvPicPr><xdr:blipFill><a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId'+c+'"></a:blip><a:stretch><a:fillRect /></a:stretch></xdr:blipFill><xdr:spPr><a:prstGeom prst="rect"><a:avLst /></a:prstGeom><a:noFill /></xdr:spPr></xdr:pic><xdr:clientData /></xdr:twoCellAnchor>',v==null||v.file(S,_),i+='<Relationship Id="rId'+c+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/'+S+'" />'}),vt=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+i+"</Relationships>"})),xe=[...new Set(xe)];let wt="",Ae=1;We.length>0&&q&&(wt=We.reduce((T,i)=>{if(i.type=="cells")return i.operator=="ct"?T+'<conditionalFormatting sqref="'+i.start+":"+i.end+'"><cfRule type="containsText" dxfId="'+(i.styleId&&J[i.styleId]?J[i.styleId]:0)+'" priority="'+(i.priority?i.priority:Ae++)+'" operator="containsText" text="'+i.value+'"><formula>NOT(ISERROR(SEARCH("'+i.value+'",'+i.start+")))</formula></cfRule></conditionalFormatting>":typeof i.operator>"u"||typeof n[i.operator]>"u"?T:T+'<conditionalFormatting sqref="'+i.start+":"+i.end+'"><cfRule type="cellIs" dxfId="'+(i.styleId&&typeof J[i.styleId]<"u"?J[i.styleId]:0)+'" priority="'+(i.priority?i.priority:Ae++)+'" operator="'+n[i.operator]+'">'+(Array.isArray(i.value)?i.value.reduce((y,p)=>y+"<formula>"+p.value+"</formula>",""):"<formula>"+i.value+"</formula>")+"</cfRule></conditionalFormatting>";if(i.type=="top")return T+'<conditionalFormatting sqref="'+i.start+":"+i.end+'"><cfRule type="'+(i.operator?"aboveAverage":"top10")+'" dxfId="'+(i.styleId&&typeof J[i.styleId]<"u"?J[i.styleId]:0)+'" priority="'+(i.priority?i.priority:Ae++)+'" '+(i.bottom?'bottom="1"':"")+" "+(i.percent?'percent="1"':"")+' rank="'+i.value+'" '+(i.operator=="belowAverage"?'aboveAverage="0"':"")+"/></conditionalFormatting>";if(i.type=="iconSet"){let y="";return typeof i.operator>"u"?T:(i.operator.indexOf("5")==0?y='<cfvo type="percent" val="0"/><cfvo type="percent" val="20"/><cfvo type="percent" val="40"/><cfvo type="percent" val="60"/><cfvo type="percent" val="80"/>':i.operator.indexOf("4")==0?y='<cfvo type="percent" val="0"/><cfvo type="percent" val="25"/><cfvo type="percent" val="50"/><cfvo type="percent" val="75"/>':y='<cfvo type="percent" val="0"/><cfvo type="percent" val="33"/><cfvo type="percent" val="67"/>',T+'<conditionalFormatting sqref="'+i.start+":"+i.end+'"><cfRule type="iconSet" priority="'+(i.priority?i.priority:Ae++)+'"><iconSet iconSet="'+i.operator+'">'+y+"</iconSet></cfRule></conditionalFormatting>")}else return i.type=="colorScale"?T+'<conditionalFormatting sqref="'+i.start+":"+i.end+'"><cfRule type="colorScale" priority="'+(i.priority?i.priority:Ae++)+'"><colorScale><cfvo type="min"/>'+(i.operator=="percentile"?'<cfvo type="percentile" val="'+i.value+'"/>':"")+'<cfvo type="max"/>'+(i.colors&&Array.isArray(i.colors)?i.colors.reduce((y,p)=>y+'<color rgb="'+he(p,o)+'"/>',""):'<color rgb="FFF8696B"/><color rgb="FFFFEB84"/><color rgb="FF63BE7B"/>')+"</colorScale></cfRule></conditionalFormatting>":i.type=="dataBar"?T+'<conditionalFormatting sqref="'+i.start+":"+i.end+'"><cfRule type="dataBar" priority="'+(i.priority?i.priority:Ae++)+'"><dataBar><cfvo type="min"/><cfvo type="max"/>'+(i.colors&&Array.isArray(i.colors)?i.colors.reduce((y,p)=>y+'<color rgb="'+he(p,o)+'"/>',""):'<color rgb="FF638EC6"/>')+"</dataBar></cfRule></conditionalFormatting>":T},"")),(Ue||Pe||Ne)&&D==null&&(D=f==null?void 0:f.folder("drawings")),Ne&&j==null&&(j=D==null?void 0:D.folder("_rels")),E["sheet"+(w+1)]={indexId:Y+1,key:"sheet"+(w+1),sheetName:xt,sheetDataTableColumns:H,backgroundImageRef:Ct,sheetDimensions:V,asTable:se||!1,sheetDataString:C,sheetDropDown:no(a.dropDowns),sheetBreakLine:Je,viewType:Ie,hasComment:Pe,drawersContent:et,cFDataString:wt,sheetMargin:gt,sheetHeaderFooter:je,isPortrait:Re,drawersRels:vt,hasImages:Ne,hasCheckbox:Ue,formRel:ht,checkboxDrawingContent:dt,checkboxForm:ae,checkboxSheetContent:ut,checkboxShape:pt,commentString:Le,commentAuthor:pe,shapeCommentRowCol:He,splitOption:Te,sheetViewProperties:Ee,sheetSizeString:G.length>0?"<cols>"+G+"</cols>":"",protectionOption:a.protectionOption?Object.keys(a.protectionOption).reduce((T,i)=>T+" "+i+'="'+a.protectionOption[i]+'" ',"<sheetProtection ")+"/>":"",merges:xe.length>0?xe.reduce((T,i)=>T+' <mergeC