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 • 188 kB
JavaScript
var ExcelTable=function(Ie){"use strict";function kt(h,w){for(var o=0;o<w.length;o++){const b=w[o];if(typeof b!="string"&&!Array.isArray(b)){for(const c in b)if(c!=="default"&&!(c in h)){const r=Object.getOwnPropertyDescriptor(b,c);r&&Object.defineProperty(h,c,r.get?r:{enumerable:!0,get:()=>b[c]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}function St(h){return h.replace(/ /g,"")}function Et(h){if(h=h.replace(/^#/,""),h.length==3){const w=h.charAt(0),o=h.charAt(1),b=h.charAt(2);return w+w+o+o+b+b}else return h}function rr(h){/^#?([a-f\d]{3})$/i.test(h)&&(h=Et(h));var w=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(h);return w?[parseInt(w[1],16),parseInt(w[2],16),parseInt(w[3],16)]:[0,0,0]}function Tt(h){const w=rr(h);return w==null?void 0:(.299*w[0]+.587*w[1]+.114*w[2])/255>.5?"rgb(0,0,0)":"rgb(255,255,255)"}function At(h){/^#?([a-f\d]{3})$/i.test(h)&&(h=Et(h));var w=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(h);return w?"rgb("+(255-parseInt(w[1],16))+","+(255-parseInt(w[2],16))+","+(255-parseInt(w[3],16))+")":"rgb(0,0,0)"}function ft(h){h=Number(h);var w=h.toString(16);return w.length==1?"0"+w:w}function je(h){h=St(h);let w=h.indexOf("rgba")>=0?h.substring(5,h.length-1).split(","):h.substring(4,h.length-1).split(","),o=w.reduce((b,c)=>b&&!Number.isNaN(Number(c)),!0);return w.length==4&&w[3]=="0"||w.length!=3&&w.length!=4||!o?null:(ft(w[0])+ft(w[1])+ft(w[2])).toUpperCase()}function Ue(h,w){if(typeof h>"u"||h===null)return null;if(!w){let o=St(h);o.indexOf("var(")==0&&o.lastIndexOf(")")==o.length-1&&(o=o.substring(4,o.length-1),h=getComputedStyle(document.documentElement).getPropertyValue(o))}if(h.indexOf("rgb")>=0){const o=je(h);h=o||""}return h.replace(/^#/,"")}function nr(h){let w="";return h.indexOf("_")>0?h.replace(/[a-z]/g,"").length==h.length?w=h.split(/_/).reduce((o,b)=>o+b.charAt(0)+b.substring(1).toLowerCase()+" ","").trim():w=h.replace(/_/g," ").trim():(w=h.replace(/([A-Z])/g," $1").trim(),w=w.charAt(0).toUpperCase()+w.substring(1).trim()),w}function Ot(h,w){let o=Object.keys(h).filter(r=>!w.includes(r)),b=[];return o.reduce((r,f)=>(r.push({label:f,text:nr(f)}),r),b)}const ct={fileName:"MR-Excel",headerBackgroundColor:"#393E46",headerColor:"#EEEEEE",negativeColor:!1,rowBackgroundColor:"#EEEEEE",rowColor:"#393E46",filterKeys:[]},ir=function(h,w={...ct}){let o;if(typeof h=="object"&&Array.isArray(h))if(h.length>0)if(Array.isArray(h[0])){let l=[];for(let s=0;s<h.length;s++){const u=h[s];if(u.length>0){const _=Ot(u[0],Array.isArray(w.filterKeys)?w.filterKeys:[]);l.push({headers:_,data:u})}}o={sheet:l}}else h.length>0?o={sheet:[{headers:Ot(h[0],Array.isArray(w.filterKeys)?w.filterKeys:[]),data:h}]}:o={sheet:[]};else o={sheet:[]};else o=h;let b=w&&w.headerBackgroundColor?w.headerBackgroundColor:ct.headerBackgroundColor,c=w&&w.rowBackgroundColor?w.rowBackgroundColor:ct.rowBackgroundColor,r=w&&w.negativeColor?At(b):w&&w.headerColor?w.headerColor:Tt(b),f=w&&w.negativeColor?At(c):w&&w.rowColor?w.rowColor:Tt(c);typeof o.styles>"u"&&(o.styles={}),o.styles.themeStyleHeader={backgroundColor:b,color:r},o.styles.themeStyleBody={backgroundColor:c,color:f};const i=o.sheet.length;for(let l=0;l<i;l++)o.sheet[l].styleCellCondition=function(s,u,_,v,a,g){return a?"themeStyleHeader":"themeStyleBody"};return typeof(w==null?void 0:w.fileName)=="string"&&(o.fileName=w.fileName),o};async function or(h,w,o){let b={};const r=(await Promise.resolve().then(()=>ot)).default;let f;if(typeof h=="string"&&h.length){let l,s=!1;typeof(o==null?void 0:o.fetch)=="function"?(l=o==null?void 0:o.fetch,s=!0):l=fetch,f=await l(h).then(u=>{if(u==null||u==null)throw"response is null";return s?u:o!=null&&o.backend?u.arrayBuffer():u.blob()})}else f=o==null?void 0:o.data;let i=await r.loadAsync(f).then(async function(l){let s=Object.keys(l.files).filter(u=>u.indexOf("xl/worksheets/")==0&&u.length-4==u.lastIndexOf(".xml")||u=="xl/sharedStrings.xml");for(let u=0;u<s.length;u++){const _=s[u];await l.files[_].async("string").then(v=>{let a=v;Object.keys(w).forEach(g=>{var t;a=a.replace(new RegExp("{{"+g+"}}","g"),(t=w[g])==null?void 0:t.toString())}),b[_]=a})}return l});if(Object.keys(b).forEach(l=>{i.file(l,b[l])}),o!=null&&o.backend)return i.generateAsync({type:o.generateType?o.generateType:"nodebuffer"}).then(l=>l);if(o!=null&&o.notSave)return i.generateAsync({type:"blob"}).then(l=>l.slice(0,l.size,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));{let l=await i.generateAsync({type:"blob"});(await Promise.resolve().then(()=>bt)).saveAs(l,(o!=null&&o.fileName?o==null?void 0:o.fileName:"tableRecord")+".xlsx")}}function ar(h,w,o,b,c,r,f,i){let l=[],s="both",u=[];!w||w===0?(w=1,s="col"):u.push(w-1),!h||h===0?(h=0,s="row"):u.push(h-1);let _=c||{};_.mergeType=i&&i.mergeType?[...i.mergeType,s]:[s],_.mergeValue=i&&i.mergeValue?[...i.mergeValue,u]:[u],_.mergeStart=i&&i.mergeStart?[...i.mergeStart,o]:[o];for(let v=0;v<w;v++){let a=h;for(let g=0;g<b;g++)o<=g?a>=1?(_["c"+g]=r,r="",f+="*",a--):w>=2&&o==g?(_["c"+g]=r,r="",f+="+"):f+="-":v>0&&(f+="-");l.push({..._,mergeString:f}),_={},f=""}return l}function sr(h,w,o,b,c){var _;if(!h&&!w)throw"Error: One of the function inputs is required.";let r;h?r=(_=document.querySelector(h))==null?void 0:_.querySelectorAll("tr"):r=w==null?void 0:w.querySelectorAll("tr");let f=[],i=[],l={header:{},rows:[]},s=40;if(r){let v=!1,a=0;r.forEach((g,t)=>{var y=[].slice.call(g.children);const m=window.getComputedStyle(g,null);let x=je(m.backgroundColor);if(!v)a=y.length,v=!0,typeof b=="function"?s=b(Number(m.height.substring(0,m.height.length-2)),t,!0):s=Number(m.height.substring(0,m.height.length-2)),y.forEach((S,I)=>{let E=window.getComputedStyle(S,null),R=null;if(E.borderBottomWidth!=="0px"){const j=je(E.borderBottomColor);j&&(R||(R={}),R.bottom={style:"thin",color:j})}if(E.borderTopWidth!=="0px"){const j=je(E.borderTopColor);j&&(R||(R={}),R.top={style:"thin",color:j})}if(E.borderLeftWidth!=="0px"){const j=je(E.borderLeftColor);j&&(R||(R={}),R.left={style:"thin",color:j})}if(E.borderRightWidth!=="0px"){const j=je(E.borderRightColor);j&&(R||(R={}),R.right={style:"thin",color:j})}let D=je(E.backgroundColor);!D&&x&&(D=x);const U=parseInt(E.fontSize.substring(0,E.fontSize.indexOf("p")));let F={...D?{backgroundColor:D}:{},bold:parseInt(E.fontWeight)>500,...isNaN(U)?{}:{size:U},...R?{border:R}:{},alignment:{...typeof E.textAlign=="string"&&E.textAlign.length>0?{horizontal:E.textAlign}:{},vertical:"center",...E.direction=="rtl"?{rtl:!0}:{ltr:!0}}};l.header[t+"-"+I]=F;let L;typeof c=="function"?L=c(Number(E.width.substring(0,E.width.length-2)),I):L=Number(E.width.substring(0,E.width.length-2))*.15;const V=S.getAttribute("colspan"),k=S.getAttribute("rowspan");f.push({label:"c"+I,...V?{colspan:V}:{},...k?{rowspan:k}:{},text:S.textContent,...isNaN(L)||L<=0?{}:{size:L}})});else{let S={},I="",E=!1;i.length>=t&&(S=i[t-1],I="mergeString"in S?S.mergeString:"",E=!0);let R=0;y.forEach((D,U)=>{if("c"+(U+R)in S)for(let n=0;n<=a+1&&"c"+(U+n)in S;n++)R++;U+=R;let F=window.getComputedStyle(D,null);if(D.getAttribute("colspan")||D.getAttribute("rowspan")){let n=ar(D.getAttribute("colspan")*1,D.getAttribute("rowspan")*1,U,a,S,D.textContent,I,S);i.length<t?i.push(...n):n.forEach((H,te)=>{i.length<t+te?i.push(...n):i[t+te]={...i[t+te],...H}}),S=n[0],I=n[0].mergeString,E=!0}else E||(I+="-");let L=null;if(F.borderBottomWidth!=="0px"){const n=je(F.borderBottomColor);n&&(L||(L={}),L.bottom={style:"thin",color:n})}if(F.borderTopWidth!=="0px"){const n=je(F.borderTopColor);n&&(L||(L={}),L.top={style:"thin",color:n})}if(F.borderLeftWidth!=="0px"){const n=je(F.borderLeftColor);n&&(L||(L={}),L.left={style:"thin",color:n})}if(F.borderRightWidth!=="0px"){const n=je(F.borderRightColor);n&&(L||(L={}),L.right={style:"thin",color:n})}let V=je(F.backgroundColor);!V&&x&&(V=x);const k=parseInt(F.fontSize.substring(0,F.fontSize.indexOf("p")));let j={...V?{backgroundColor:V}:{},bold:parseInt(F.fontWeight)>500,...isNaN(k)?{}:{size:k},...L?{border:L}:{},alignment:{...typeof F.textAlign=="string"&&F.textAlign.length>0?{horizontal:F.textAlign}:{},vertical:"center",...F.direction=="rtl"?{rtl:!0}:{ltr:!0}}};l.header[t+"-"+U]=j,S["c"+U]=D.textContent}),typeof b=="function"?S.height=b(Number(m.height.substring(0,m.height.length-2)),t,!1):S.height=m.height.substring(0,m.height.length-2),typeof S.height=="string"&&S.height.length==0&&delete S.height,i.length<t?i.push(S):i[t-1]=S}})}else throw"Error: DOM Element Not Found";return{styles:l.header,sheet:[{...s?{headerHeight:s}:{},styleCellCondition:function(v,a,g,t,y,m){return o?m.includes(g-1+"-"+t)?g-1+"-"+t:"":null},data:i,headers:f}]}}function et(h,w,o="",b=[],c=-1){const r=h.length;for(let f=0;f<r;f++)b.push(o+h[f]);return w<b.length?b:et(h,w,b[c+1],b,c+1)}function lr(h,w){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">`+(h.format.count>0?'<numFmts count="'+h.format.count+'">'+h.format.value+"</numFmts>":"")+'<fonts count="'+h.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>'+h.font.value+'</fonts><fills count="'+h.fill.count+'"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="lightGray" /></fill>'+h.fill.value+'</fills><borders count="'+h.border.count+'"><border />'+h.border.value+'</borders><cellStyleXfs count="1"><xf borderId="0" fillId="0" fontId="0" numFmtId="0" applyAlignment="1" applyFont="1" /></cellStyleXfs><cellXfs count="'+h.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>'+h.cell.value+'</cellXfs><cellStyles count="1"><cellStyle xfId="0" name="Normal" builtinId="0" /></cellStyles> '+(w?'<dxfs count="'+h.conditionalFormatting.count+'" >'+h.conditionalFormatting.value+"</dxfs>":'<dxfs count="0" />')+"</styleSheet>"}function fr(h,w,o,b,c,r,f){let i={};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" />`+o.reduce((l,s)=>(s=s.toLowerCase(),i[s]?l:s=="svg"?(i.png=!0,i.svg=!0,l+'<Default Extension="png" ContentType="image/png"/><Default Extension="svg" ContentType="image/svg+xml"/>'):s=="jpeg"||s=="jpg"?(i.jpeg=!0,i.jpg=!0,l+'<Default Extension="'+s+'" ContentType="image/jpeg"/>'):(i[s]=!0,l+'<Default Extension="'+s+'" ContentType="image/'+s+'"/>')),"")+w.reduce((l,s)=>l+'<Override PartName="/xl/comments'+s+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" />',"")+h+(f.length>0?f.reduce((l,s)=>l+'<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" />'+(r?'<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" />'+b.reduce((l,s)=>l+'<Override PartName="/xl/drawings/'+s+'" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml" />',"")+(c.length>0?c.reduce((l,s,u)=>l+'<Override PartName="/xl/ctrlProps/ctrlProp'+(u+1)+'.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>',""):"")+'<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /></Types>'}function cr(h,w){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>`+h+'</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="'+h+'" baseType="lpstr"> '+w+"</vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion></Properties>"}function ht(h,w,o,b){h=h.toUpperCase();let c="";if(w.formula){let s=w,u=s.formula.indexOf("=")==0?s.formula.substring(1):s.formula,_=h.indexOf(":")>0,v=s.referenceCells?s.referenceCells:h,a=_?h.substring(0,h.indexOf(":")):h,g=a.replace(/[0-9]/g,""),t=parseInt(h.substr(g.length)),y=s.returnType?s.returnType:s.isArray||_?' t="str"':"",m="styleId"in s&&b&&typeof s.styleId=="string"&&b[s.styleId]?' s="'+b[s.styleId].index+'"':"",x=s.isArray||_?' t="array" ref="'+v+'"':"";return c='<c r="'+a+'"'+m+y+"><f"+x+">"+u+"</f></c>",{column:g,row:t,needCalcChain:!1,isCustom:!0,cell:c}}let r=h.replace(/[0-9]/g,""),f=parseInt(h.substr(r.length)),i=!1,l="";if(w.noArgType){const s=w;if(s.noArgType=="NOW"||s.noArgType=="TODAY"){const u="styleId"in s&&b&&typeof s.styleId=="string"&&b[s.styleId]?' s="'+b[s.styleId].index+'"':"";c='<c r="'+h+'"'+u+"><f>"+s.noArgType+"()</f></c>"}else{let u="NOW()";const _="styleId"in s&&b&&typeof s.styleId=="string"&&b[s.styleId]?' s="'+b[s.styleId].index+'"':"";c='<c r="'+h+'"'+_+"><f>"+s.noArgType.substring(4)+"("+u+")</f></c>"}l='<c r="'+h+'" i="'+o+'"/>',i=!0}else if(w.referenceCell){const s=w;let u="";typeof s.value<"u"&&(u=","+s.value);let _="";s.type=="COT"&&(_="_xlfn.");const v="styleId"in s&&b&&typeof s.styleId=="string"&&b[s.styleId]?' s="'+b[s.styleId].index+'"':"";c='<c r="'+h+'"'+v+"><f>"+_+s.type+"("+s.referenceCell.toUpperCase()+u+")</f></c>",l='<c r="'+h+'" i="'+o+'"/>',i=!0}else{const s=w;c='<c r="'+h+'"'+(b&&typeof s.styleId=="string"&&b[s.styleId]?' s="'+b[s.styleId].index+'"':"")+"><f>"+s.type+"("+s.start.toUpperCase()+":"+s.end.toUpperCase()+")</f></c>"}return{column:r,row:f,cell:c,needCalcChain:i,chainCell:l}}function dt(h,w,o){let b=!1,c,r;if(typeof h=="object"){if("author"in h&&h.author&&(b=!0,r=h.author),"styleId"in h&&typeof h.styleId=="string"){let f=w[h.styleId];typeof f=="string"&&(o=f)}c="comment"in h&&typeof h.comment=="string"?It(h.comment):[""]}else c=h?It(h):[""];return b&&c.unshift(r+":"),{hasAuthor:b,author:r,commentStyle:o,commentStr:c}}function It(h){var w=h.split(/\r?\n|\r|\n/g);return w}function ut(h,w,o,b){let c='<comment ref="'+h+'" authorId="'+Math.max(0,b-1)+'" shapeId="0"><text>',r="";return w.forEach((f,i)=>{let l="";if(f.length==0){r+=`
`;return}i>0&&(l=' xml:space="preserve"',r+=`
`),c+="<r>"+o+"<t"+l+">"+r+f+"</t></r>",r=""}),r.length>0&&c.indexOf("<r>")>0&&(c=c.substring(0,c.length-8)+r+"</t></r>"),c+="</text></comment>",c}const hr='<rPr><b /><sz val="9" /><color rgb="000000" /><rFont val="Tahoma" /></rPr>',tt=function(h){return h.replace(/\&/g,"&").replace(/\</g,"<").replace(/\>/g,">")};function mt(h,w,o){let b="";return h.forEach(c=>{typeof c.value=="string"&&(c.value=tt(c.value)),b+="<r>"+(c.styleId&&w[c.styleId]?w[c.styleId]:w[o])+'<t xml:space="preserve">'+c.value+"</t></r>"}),"<si>"+b+"</si>"}const Ft={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]* "-"??_ ;_ @_ " />'},"¥":{key:160,value:'<numFmt numFmtId="160" formatCode="_ [$¥-804]* #,##0.00_ ;_ [$¥-804]* \\-#,##0.00_ ;_ [$¥-804]* "-"??_ ;_ @_ " />'},euro:{key:161,value:'<numFmt numFmtId="161" formatCode="_([$€-2]\\ * #,##0.00_);_([$€-2]\\ * \\(#,##0.00\\);_([$€-2]\\ * "-"??_);_(@_)" />'},"€":{key:161,value:'<numFmt numFmtId="161" formatCode="_([$€-2]\\ * #,##0.00_);_([$€-2]\\ * \\(#,##0.00\\);_([$€-2]\\ * "-"??_);_(@_)" />'},pound:{key:162,value:'<numFmt numFmtId="162" formatCode="_-[$£-809]* #,##0.00_-;\\-[$£-809]* #,##0.00_-;_-[$£-809]* "-"??_-;_-@_-" />'},"£":{key:162,value:'<numFmt numFmtId="162" formatCode="_-[$£-809]* #,##0.00_-;\\-[$£-809]* #,##0.00_-;_-[$£-809]* "-"??_-;_-@_-" />'},dollar:{key:163,value:'<numFmt numFmtId="163" formatCode="_([$$-409]* #,##0.00_);_([$$-409]* \\(#,##0.00\\);_([$$-409]* "-"??_);_(@_)" />'},$:{key:163,value:'<numFmt numFmtId="163" formatCode="_([$$-409]* #,##0.00_);_([$$-409]* \\(#,##0.00\\);_([$$-409]* "-"??_);_(@_)" />'},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]_ ;_ * "-"??_-[$ريال-429]_ ;_ @_ " />'},"₽3":{key:172,value:'<numFmt numFmtId="172" formatCode="_-* #,##0.00\\ [$₽-444]_-;\\-* #,##0.00\\ [$₽-444]_-;_-* "-"??\\ [$₽-444]_-;_-@_-" />'},"₽2":{key:173,value:'<numFmt numFmtId="173" formatCode="_-* #,##0.00\\ [$₽-485]_-;\\-* #,##0.00\\ [$₽-485]_-;_-* "-"??\\ [$₽-485]_-;_-@_-" />'},"₽1":{key:174,value:'<numFmt numFmtId="174" formatCode="_-* #,##0.00\\ [$₽-46D]_-;\\-* #,##0.00\\ [$₽-46D]_-;_-* "-"??\\ [$₽-46D]_-;_-@_-" />'},"₼1":{key:175,value:'<numFmt numFmtId="175" formatCode="_-* #,##0.00\\ [$₼-42C]_-;\\-* #,##0.00\\ [$₼-42C]_-;_-* "-"??\\ [$₼-42C]_-;_-@_-" />'},manat:{key:176,value:'<numFmt numFmtId="176" formatCode="_-* #,##0.00\\ [$₼-82C]_-;\\-* #,##0.00\\ [$₼-82C]_-;_-* "-"??\\ [$₼-82C]_-;_-@_-" />'},"₼":{key:176,value:'<numFmt numFmtId="176" formatCode="_-* #,##0.00\\ [$₼-82C]_-;\\-* #,##0.00\\ [$₼-82C]_-;_-* "-"??\\ [$₼-82C]_-;_-@_-" />'},"֏":{key:177,value:'<numFmt numFmtId="177" formatCode="_-* #,##0.00\\ [$֏-42B]_-;\\-* #,##0.00\\ [$֏-42B]_-;_-* "-"??\\ [$֏-42B]_-;_-@_-" />'},ruble:{key:178,value:'<numFmt numFmtId="178" formatCode="_-* #,##0.00\\ [$₽-419]_-;\\-* #,##0.00\\ [$₽-419]_-;_-* "-"??\\ [$₽-419]_-;_-@_-" />'},"₽":{key:178,value:'<numFmt numFmtId="178" formatCode="_-* #,##0.00\\ [$₽-419]_-;\\-* #,##0.00\\ [$₽-419]_-;_-* "-"??\\ [$₽-419]_-;_-@_-" />'},CHF:{key:179,value:'<numFmt numFmtId="179" formatCode="_-* #,##0.00\\ [$CHF-100C]_-;\\-* #,##0.00\\ [$CHF-100C]_-;_-* "-"??\\ [$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=""$"#,##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=""$"#,##0" />'}},zt=["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"],Rt=(h,w,o=!1,b)=>{let c,r=!1;return typeof b=="function"?(c=b,r=!0):c=fetch,c(h).then(f=>r?f:o?f.arrayBuffer():f.blob()).then(f=>r||o?f:new File([f],w)).catch(f=>{throw f})};function qe(h,w){h=h.toUpperCase();let o=h.replace(/[0-9]/g,"");if(o.length==0)throw"Invalid Column";let b=parseInt(h.substring(o.length));if(isNaN(b))throw"Invalid Row";b=Math.max(0,b-1);let c=w.indexOf(o);return c<0&&(w=et(w,Math.pow(10,o.length+1),""),c=w.indexOf(o),c<0&&(c=0)),{col:c,row:b}}let dr={},pt=new Proxy(dr,{get(h,w){return w in h?h[w]:(this.set(h,w,{},!0),{})},set(h,w,o,b){return h[w]=o,!0}});function Pt(h,w,o){pt[h],pt[h][w]=o}function Bt(h,w,o){Object.keys(o).forEach(c=>{const r=o[c];typeof r=="object"?c!="data"&&c!="headers"&&Bt(h,w.length>0?w+"."+c:c,r):Pt(h,w.length>0?w+"."+c:c,r)})}function ur(h,w){Bt(h,"",w)}function mr(h,w){let o=w,b=pt[h];return Object.keys(b).forEach(r=>{const f=r.split(".");let i=o,l=b[r];for(let s=0;s<f.length;s++){const u=f[s];i[u]?i=i[u]:f.length-1==s?i[u]=l:(i[u]={},i=i[u])}}),o}function pr(h){if(!Array.isArray(h)||!h.length)return"";const w=h.length;let o="<dataValidations>";for(let b=0;b<w;b++){const c=h[b],r=c.for.reduce((i,l)=>i+" "+l,""),f=c.option.join(",");o+='<dataValidation type="list" allowBlank="1" showErrorMessage="1" sqref="'+r.trim()+'"><formula1>"'+f+""</formula1></dataValidation>"}return o+="</dataValidations>",o}async function rt(h,w=""){if(typeof w=="string"&&w.length>0&&(h=mr(w,h)),typeof h.creator=="string"&&h.creator.trim().length<=0)throw'length of "creator" most be bigger then 0';if(typeof h.created=="string"&&new Date(h.created).toString()=="Invalid Date")throw'"created" is not valid date';if(typeof h.modified=="string"&&new Date(h.modified).toString()=="Invalid Date")throw'"modified" is not valid date';let o=Ft;h.formatMap&&typeof h.formatMap=="object"&&(o={...o,...h.formatMap});const b=h.backend,c={lt:"lessThan",gt:"greaterThan",between:"between",ct:"containsText",eq:"equal"};let r=[...zt];h.numberOfColumn&&h.numberOfColumn>25&&(r=et(r,h.numberOfColumn));const i=(await Promise.resolve().then(()=>ot)).default;let l=new i;h.sheet||(h.sheet=[{headers:[],data:[]}]);const s=h.sheet.length;let u=l.folder("xl"),_=null,v=null,a=null;h.styles||(h.styles={}),h.addDefaultTitleStyle&&(h.styles.titleStyle={alignment:{horizontal:"center",vertical:"center"}});const g=Object.keys(h.styles),t=hr,y=h.activateConditionalFormatting?h.activateConditionalFormatting:!1,m={},x={};let S=g.reduce((e,C,A)=>{const d=h.styles[C];if(d.type&&(d.type=="headerFooter"||d.type=="HF")){let T="",K="-",J="Regular";if(d.fontFamily&&(K=d.fontFamily),d.bold&&(J="Bold"),d.italic&&(J=="Regular"&&(J=""),J+="Italic"),(K!="-"||J!="Regular")&&(T='&"'+K+","+J+'"'),d.size&&(T+="&"+d.size),d.doubleUnderline?T+="&E":d.underline&&(T+="&U"),d.color){const q=Ue(d.color,b);typeof q=="string"&&q.length>0&&(T+="&K"+q.toUpperCase())}return m[C]=T,e}if(y&&typeof d.type=="string"&&d.type&&(d.type=="conditionalFormatting"||d.type.toUpperCase()=="CF")){x[C]=e.conditionalFormatting.count;let T=Ue(d.color,b),K=Ue(d.backgroundColor,b);return e.conditionalFormatting.value+='<dxf><font><color rgb="'+T+'"/></font><fill> <patternFill> <bgColor rgb="'+K+'"/></patternFill></fill></dxf>',e.conditionalFormatting.count++,e}const p={fillIndex:0,fontIndex:0,borderIndex:0,formatIndex:0};if(d.backgroundColor){let T=Ue(d.backgroundColor,b);p.fillIndex=e.fill.count,e.fill.count++,e.fill.value=e.fill.value+'<fill><patternFill patternType="solid">'+(T?'<fgColor rgb="'+T.replace("#","")+'" />':"")+"</patternFill></fill>"}if(d.color||d.fontFamily||d.size||d.bold||d.italic||d.underline||d.doubleUnderline){const T=Ue(d.color,b);p.fontIndex=e.font.count,e.font.count++,e.font.value=e.font.value+"<font>"+(d.bold?"<b/>":"")+(d.italic?"<i />":"")+(d.underline||d.doubleUnderline?"<u "+(d.doubleUnderline?' val="double" ':"")+"/>":"")+(d.size?'<sz val="'+d.size+'" />':"")+(T?'<color rgb="'+T.replace("#","")+'" />':"")+(d.fontFamily?'<name val="'+d.fontFamily+'" />':"")+"</font>",e.commentSyntax.value[C]="<rPr>"+(d.bold?"<b/>":"")+(d.italic?"<i/>":"")+(d.underline||d.doubleUnderline?"<u "+(d.doubleUnderline?'val="double" ':"")+"/>":"")+'<sz val="'+(d.size?d.size:"9")+'" />'+(T?'<color rgb="'+T.replace("#","")+'" />':"")+'<rFont val="'+(d.fontFamily?d.fontFamily:"Tahoma")+'" /></rPr>'}let O="/>";d.alignment&&(d.alignment.rtl&&(d.alignment.readingOrder=2),delete d.alignment.rtl,d.alignment.ltr&&(d.alignment.readingOrder=1),delete d.alignment.ltr,O=' applyAlignment="1"><alignment '+Object.keys(d.alignment).reduce((T,K)=>T+" "+K+'="'+d.alignment[K]+'" ',"")+" /></xf>");const N=d.border;let P="";if(typeof N=="object"&&((N.left||N.full)&&(P+='<left style="'+(N.left||N.full).style+'"><color rgb="'+Ue((N.left||N.full).color,b).replace("#","")+'" /></left>'),(N.right||N.full)&&(P+='<right style="'+(N.right||N.full).style+'"><color rgb="'+Ue((N.right||N.full).color,b).replace("#","")+'" /></right>'),(N.top||N.full)&&(P+='<top style="'+(N.top||N.full).style+'"><color rgb="'+Ue((N.top||N.full).color,b).replace("#","")+'" /></top>'),(N.bottom||N.full)&&(P+='<bottom style="'+(N.bottom||N.full).style+'"><color rgb="'+Ue((N.bottom||N.full).color,b).replace("#","")+'" /></bottom>'),p.borderIndex=e.border.count,e.border.count++,e.border.value+="<border>"+P+"<diagonal /></border>"),d.format){const T=o[d.format];T&&(p.formatIndex=T.key,"value"in T&&(e.format.count++,e.format.value+=T.value))}return e.cell.value=e.cell.value+'<xf numFmtId="'+p.formatIndex+'" fontId="'+p.fontIndex+'" fillId="'+p.fillIndex+'" borderId="'+p.borderIndex+'" xfId="0"'+(p.borderIndex>0?' applyBorder="1" ':"")+(p.fillIndex>0?' applyFill="1" ':"")+(p.fontIndex>=0?' applyFont="1" ':"")+(p.formatIndex>0?' applyNumberFormat="1" ':"")+O,h.styles[C].index=e.cell.count,e.cell.count++,e},{conditionalFormatting:{count:y?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:""}});u==null||u.file("styles.xml",lr(S,y));let I='<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" PartName="/xl/worksheets/sheet1.xml" />',E="",R=0,D="",U="",F={};const L={};let V="",k=4,j=!1,n=-1,H=[],te=1;const $={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 he=1024;const Z={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>`},oe={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 B=[],z="",ne=!1,Q=null;for(let e=0;e<s;e++){const C=h.sheet[e],A=e+1;let d={},p={start:"",end:""};const O=C.asTable;let N="",P=C.shiftTop&&C.shiftTop>=0?C.shiftTop+1:1,T="",K="",J="",q="",re="",ge="",me=!1,Fe="",Ke="",De="",$e="",ye=Object.assign([],C.merges),ze=Object.assign({},C.formula),Ze=Object.assign([],C.conditionalFormatting),Re=!1,Pe=[],Ye="",Ve=[],at=[],Ge=[],He=[],Le={},Je="",Qe=!1,vt="";if(C.rtl&&(re+=' rightToLeft="1" '),C.pageBreak){const ie=C.pageBreak;if(ie.row&&Array.isArray(ie.row)){ge="pageBreakPreview";const M=ie.row.length;vt+='<rowBreaks count="'+M+'" manualBreakCount="'+M+'">'+ie.row.reduce((ee,Y)=>ee+'<brk id="'+Y+'" max="16383" man="1"/>',"")+"</rowBreaks>"}if(ie.column&&Array.isArray(ie.column)){ge="pageBreakPreview";const M=ie.column.length;vt+='<colBreaks count="'+M+'" manualBreakCount="'+M+'">'+ie.column.reduce((ee,Y)=>ee+'<brk id="'+Y+'" max="16383" man="1"/>',"")+"</colBreaks>"}}let qt="";if(C.pageOption){const ie=C.pageOption;if(ie.isPortrait&&(Qe=!0),ie.margin){const ae=ie.margin;let se={left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3};Object.keys(se).forEach(G=>{typeof ae[G]=="number"&&(se[G]=ae[G])}),qt='<pageMargins left="'+se.left+'" right="'+se.right+'" top="'+se.top+'" bottom="'+se.bottom+'" header="'+se.header+'" footer="'+se.footer+'"/>'}let M="",ee="",Y="",W="";if(["header","footer"].forEach(ae=>{const se=ae.charAt(0).toUpperCase()+ae.substring(1);if(ie[ae]){const G=ie[ae];typeof G=="object"&&Object.keys(G).forEach(le=>{M.indexOf(le)<0&&(M+=le);const Oe=G[le];let xe="";if(Object.keys(Oe).reduce((de,ce)=>(ce=="l"?de.splice(0,0,ce):ce=="c"?de.splice(1,0,ce):ce=="r"&&de.splice(2,0,ce),de),[]).forEach(de=>{const ce=Oe[de];xe+="&"+de.toUpperCase(),ce.styleId&&m[ce.styleId]&&(xe+=m[ce.styleId]),ce.text&&(xe+=ce.text)}),xe="<"+le+se+">"+xe+"</"+le+se+">",le=="odd")ee+=xe;else if(le=="even")Y+=xe;else if(le=="first")W+=xe;else throw"type error"})}}),Je=ee+Y+W,Je.length>0){Qe=!0;const ae=M.length==7||M.length==12?' differentOddEven="1"':"",se=M.indexOf("first")>=0?' differentFirst="1"':"";Je="<headerFooter"+ae+se+">"+Je+"</headerFooter>"}}if(C.viewOption){let ie="";const M=C.viewOption;M.type&&(ge=M.type),M.hideRuler&&(re+=' showRuler="0" '),M.hideGrid&&(re+=' showGridLines="0" '),M.hideHeadlines&&(re+=' showRowColHeaders="0" ');let ee=M.splitOption;if(typeof ee>"u"&&(Qe=!1,typeof M.frozenOption=="object")){const Y=M.frozenOption;if(ie=' state="frozen" ',Y.type=="R"||Y.type=="ROW"){let W;typeof Y.index=="object"?W=Y.index.r:W=Y.index,ee={startAt:{b:"A"+(W+1)},type:"H",split:W}}else if(Y.type=="C"||Y.type=="COLUMN"){let W;typeof Y.index=="object"?W=Y.index.c:W=Y.index,W>r.length-1&&(r=et(r,W)),ee={type:"V",startAt:{r:r[W]+1},split:W}}else if(Y.type=="B"||Y.type=="BOTH"){let W="",fe;typeof Y.index=="number"?(fe=Y.index,W=r[Y.index]+(Y.index+1)):(fe={y:Y.index.r,x:Y.index.c},W=r[Y.index.c]+(Y.index.r+1)),ee={startAt:{two:W},type:"B",split:fe}}}if(ee)if(ee.type=="H"||ee.type=="HORIZONTAL"){let Y;ee.startAt&&(Y=ee.startAt.b,ee.startAt.t&&(re+=' topLeftCell="'+ee.startAt.t+'"')),Y||(Y="A1"),q='<pane ySplit="'+(typeof ee.split=="object"&&ee.split.y||ee.split)+'" topLeftCell="'+Y+'" activePane="bottomLeft"'+ie+"/>"}else if(ee.type=="V"||ee.type=="VERTICAL"){let Y;ee.startAt&&(Y=ee.startAt.r,ee.startAt.l&&(re+=' topLeftCell="'+ee.startAt.l+'"')),Y||(Y="A1"),q='<pane xSplit="'+(typeof ee.split=="object"&&ee.split.x||ee.split)+'" topLeftCell="'+Y+'" activePane="topLeft"'+ie+"/>"}else{let Y;ee.startAt&&(Y=ee.startAt.two,ee.startAt.one&&(re+=' topLeftCell="'+ee.startAt.one+'"')),Y||(Y="A1"),q='<pane xSplit="'+(typeof ee.split=="object"&&ee.split.x||ee.split)+'" ySplit="'+(typeof ee.split=="object"&&ee.split.y||ee.split)+'" topLeftCell="'+Y+'" activePane="bottomLeft"'+ie+"/>"}}if(Qe&&(ge="pageLayout"),C.checkbox){me=!0;const ie=$.checkbox;C.checkbox.forEach((M,ee)=>{let Y=ie;if(M.link){let le=qe(M.link,r);Y=Y.replace("**fmlaLink**",'fmlaLink="$'+r[le.col]+"$"+(le.row+1)+'"')}else Y=Y.replace("**fmlaLink**","");M.mixed?Y=Y.replace("**value**",'checked="Mixed"'):M.checked?Y=Y.replace("**value**",'checked="Checked"'):Y=Y.replace("**value**",""),M.threeD&&Y.replace('noThreeD="1"',""),B.push(Y),he++;let W=e+""+he++;const fe="_x0000_s"+W;Ke+=Z.checkbox.replace("***id***",fe).replace("***text***",M.text);let ae=M.startStr,se=M.endStr,G={start:{col:0,row:0},end:{col:1,row:1}};if(M.col&&M.row&&(G={start:{col:M.col,row:M.row-1},end:{col:M.col,row:M.row}}),typeof ae=="string"&&ae.length>=2){let le=qe(ae,r);G.start={...le},G.end={col:le.col+1,row:le.row+1}}if(typeof se=="string"&&se.length>=2){let le=qe(se,r);le.row+=1,le.col+=1,G.end={...le}}$e+='<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x14"><control shapeId="'+W+'" r:id="rId'+(7+ee)+'" name="'+M.text+'"><controlPr defaultSize="0" autoFill="0" autoLine="0" autoPict="0"><anchor moveWithCells="1"><from><xdr:col>'+G.start.col+"</xdr:col><xdr:colOff>19050</xdr:colOff><xdr:row>"+G.start.row+"</xdr:row><xdr:rowOff>19050</xdr:rowOff></from><to><xdr:col>"+G.end.col+"</xdr:col><xdr:colOff>819150</xdr:colOff><xdr:row>"+G.end.row+"</xdr:row><xdr:rowOff>0</xdr:rowOff></to></anchor></controlPr></control></mc:Choice></mc:AlternateContent>",De+='<Relationship Id="rId'+(7+ee)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp" Target="../ctrlProps/ctrlProp'+B.length+'.xml" />',Fe+='<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>'+G.start.col+"</xdr:col><xdr:colOff>19050</xdr:colOff><xdr:row>"+G.start.row+"</xdr:row><xdr:rowOff>19050</xdr:rowOff></xdr:from><xdr:to><xdr:col>"+G.end.col+"</xdr:col><xdr:colOff>819150</xdr:colOff><xdr:row>"+G.end.row+'</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:to><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="'+W+'" name="'+M.text+'" hidden="1"><a:extLst><a:ext uri=""><a14:compatExt spid="'+fe+'"/></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>'+M.text+"</a:t></a:r></a:p></xdr:txBody></xdr:sp><xdr:clientData/></xdr:twoCellAnchor></mc:Choice><mc:Fallback/></mc:AlternateContent>"})}let xt;if(C.backgroundImage){_==null&&(_=u==null?void 0:u.folder("media"));const ie=C.backgroundImage;xt=new Promise(async(M,ee)=>{let Y=ie.lastIndexOf("."),W;Y>0?(W=ie.substring(Y+1).toLowerCase(),W.length>4&&(W.indexOf("gif")>=0?W="gif":W.indexOf("jpg")>=0?W="jpg":W.indexOf("jpeg")>=0?W="jpeg":W="png")):W="png";const fe=te++,ae="image"+fe+"."+W,se=await Rt(ie,ae,b,h.fetch);se||ee("image not load"),H.push(W),M({name:ae,type:W,image:se,ref:fe})})}let wt;if(C.images&&(_==null&&(_=u==null?void 0:u.folder("media")),wt=Promise.all([...C.images.map(async(ie,M)=>{let ee=ie.url.lastIndexOf("."),Y;ee>0?(Y=ie.url.substring(ee+1).toLowerCase(),Y.length>4&&(Y.indexOf("gif")>=0?Y="gif":Y.indexOf("jpg")>=0?Y="jpg":Y.indexOf("jpeg")>=0?Y="jpeg":Y="png")):Y="png",H.push(Y);const W="image"+te+++"."+Y;return{type:Y,image:await Rt(ie.url,W,b,h.fetch),obj:ie,i:M,name:W}})])),Array.isArray(C.headers)&&C.headers.length){const ie=C.headers.length;let M="";if(C.title){const W=C.title,fe=W.comment,ae=W.shiftTop&&W.shiftTop>=0?W.shiftTop:0,se=C.shiftLeft&&C.shiftLeft>=0?C.shiftLeft:0,G=W.shiftLeft&&W.shiftLeft+se>=0?W.shiftLeft+se:se,le=W.consommeRow?W.consommeRow-1:1,Oe=W.consommeCol?W.consommeCol:ie,xe=le==0&&typeof W.height=="number"?' ht="'+W.height+'" customHeight="1" ':"",de=W.styleId?W.styleId:"titleStyle",ce=r[G]+""+(P+ae);if(ye.push(ce+":"+r[G+Oe-1]+(P+le+ae)),typeof fe<"u"){Re=!0;const ke=dt(fe,S.commentSyntax.value,t);let Ne=Pe.length;if(ke.hasAuthor&&typeof ke.author<"u"){let Ce=ke.author.toString();const Ee=Pe.indexOf(Ce);Ee<0?Pe.push(Ce):Ne=Ee}Ve.push({row:P+ae-1,col:G}),Ye+=ut(ce,ke.commentStr,ke.commentStyle,Ne)}typeof W.text=="string"&&(d[P+ae]={startTag:'<row r="'+(P+ae)+'" '+xe+' spans="1:'+Math.max(G+Oe-1,1)+'">',details:'<c r="'+ce+'" '+(h.styles[de]?' s="'+h.styles[de].index+'" ':"")+' t="s"><v>'+R+"</v></c>",endTag:"</row>"},M+='<row r="'+(P+ae)+'" '+xe+' spans="1:'+Math.max(G+Oe-1,1)+'">',M+='<c r="'+ce+'" '+(h.styles[de]?' s="'+h.styles[de].index+'" ':"")+' t="s"><v>'+R+"</v></c>",M+="</row>",R++,F[W.text]=W.text,W.multiStyleValue&&Array.isArray(W.multiStyleValue)?E+=mt(W.multiStyleValue,S.commentSyntax.value,de):E+="<si><t>"+tt(W.text)+"</t></si>"),P+=ae+le+1}let ee=C.headerStyleKey?C.headerStyleKey:null,Y=0;if(typeof C.shiftLeft=="number"&&C.shiftLeft>=0&&(Y=C.shiftLeft),O&&(N+='<tableColumns count="'+C.headers.length+'">',Q||(Q=u==null?void 0:u.folder("tables"))),p.start=r[Y]+""+P,p.end=r[Y+C.headers.length-1]+""+(P+C.data.length),C.headers.forEach((W,fe)=>{if(O&&(N+='<tableColumn id="'+(fe+1)+'" name="'+W.text+'"/>'),Y&&(fe+=Y),W.formula&&Ge.push(fe),W.conditionalFormatting&&y&&He.push(fe),at.push(W.label),C.mergeRowDataCondition&&typeof C.mergeRowDataCondition=="function"&&C.mergeRowDataCondition(W,null,fe,!0)===!0&&(Le[r[fe]]={inProgress:!0,start:P}),C.styleCellCondition&&typeof C.styleCellCondition=="function"&&(ee=C.styleCellCondition(W,W,P,fe,!0,g)||ee),W.size&&W.size>0&&(K+='<col min="'+(fe+1)+'" max="'+(fe+1)+'" width="'+W.size+'" customWidth="1" />'),C.withoutHeader)return;const ae=r[fe]+""+P;if(typeof C.commentCondition=="function"){const G=C.commentCondition(W,null,W.label,P,fe,!0);(typeof G=="string"||typeof G=="object"&&G!=null)&&(W.comment=G)}if(W.comment){Re=!0;const G=dt(W.comment,S.commentSyntax.value,t);let le=Pe.length;if(G.hasAuthor&&typeof G.author<"u"){let Oe=G.author.toString();const xe=Pe.indexOf(Oe);xe<0?Pe.push(Oe):le=xe}Ve.push({row:P-1,col:fe}),Ye+=ut(ae,G.commentStr,G.commentStyle,le)}const se=ze&&ze[ae];if(se){const G=ht(ae,se,A,h.styles);G.needCalcChain&&(ne=!0,z+=G.chainCell),T+=G.cell,delete ze[ae]}else{if(T+='<c r="'+r[fe]+P+'" '+(ee&&h.styles&&h.styles[ee]?' s="'+h.styles[ee].index+'" ':"")+' t="s"><v>'+R+"</v></c>",typeof C.multiStyleCondition=="function"){const G=C.multiStyleCondition(W,null,W.label,P,fe,!0);G&&(W.multiStyleValue=G)}W.multiStyleValue&&Array.isArray(W.multiStyleValue)?E+=mt(W.multiStyleValue,S.commentSyntax.value,ee||""):E+="<si><t>"+tt(W.text)+"</t></si>",F[W.text]=W.text,R++}}),O&&(N+="</tableColumns>"),C.withoutHeader)T+=M;else{const W='<row r="'+P+'" spans="1:'+Math.max(ie,1)+'" '+(C.headerHeight?'ht="'+C.headerHeight+'" customHeight="1"':"")+(C.headerRowOption?Object.keys(C.headerRowOption).reduce((fe,ae)=>fe+" "+ae+'="'+C.headerRowOption[ae]+'" '," "):"")+">";d[P]={startTag:W,endTag:"</row>",details:T},T=M+W+T+"</row>",P++}if(Array.isArray(C.data)){const W=C.mapSheetDataOption&&C.mapSheetDataOption.outlineLevel?C.mapSheetDataOption.outlineLevel:"outlineLevel",fe=C.mapSheetDataOption&&C.mapSheetDataOption.hidden?C.mapSheetDataOption.hidden:"hidden",ae=C.mapSheetDataOption&&C.mapSheetDataOption.height?C.mapSheetDataOption.height:"height",se=C.data.length;C.data.forEach((G,le)=>{if(G.mergeType)for(let ce=0;ce<G.mergeType.length;ce++){const ke=G.mergeType[ce],Ne=G.mergeStart[ce],Ce=G.mergeValue[e];let Ee="";ke=="both"?Ee=r[Ne]+""+P+":"+r[Ne+Ce[1]]+(P+Ce[0]):ke=="col"?Ee=r[Ne]+""+P+":"+r[Ne+Ce[0]]+P:Ee=r[Ne]+""+P+":"+r[Ne]+(P+Ce[0]),ye.push(Ee)}const Oe=G.rowStyle,xe='<row r="'+P+'" spans="1:'+Math.max(ie,1)+'" '+(ae in G?'ht="'+G[ae]+'" customHeight="1"':"")+(W in G?' outlineLevel="'+G[W]+'"':"")+(fe in G?' hidden="'+G[fe]+'"':"")+" >";T+=xe;let de="";at.forEach((ce,ke)=>{Y&&(ke+=Y);const Ne=G[ce]*1;let Ce=C.convertStringToNumber&&!isNaN(Ne)?Ne:G[ce];typeof Ce=="boolean"&&(Ce=Ce+"");let Ee=Oe;if(C.styleCellCondition&&typeof C.styleCellCondition=="function"&&(Ee=C.styleCellCondition(Ce,G,P,ke,!1,g)||Oe),C.mergeRowDataCondition&&typeof C.mergeRowDataCondition=="function"){let Se=C.mergeRowDataCondition(Ce,ce,ke,!1);const Te=r[ke];let We=Le[Te];Se===!0?(!We||We&&!We.inProgress)&&(Le[Te]={inProgress:!0,start:P}):We&&We.inProgress&&(ye.push(Te+We.start+":"+Te+(P-1)),Le[Te]={inProgress:!1,start:-1})}typeof Ce>"u"&&(Ce="");const lt=r[ke]+""+P;if(typeof C.commentCondition=="function"){const Se=C.commentCondition(Ce,G,ce,P,ke,!1);(typeof Se=="string"||typeof Se=="object"&&Se!=null)&&(typeof G.comment!="object"&&(G.comment={}),G.comment[ce]=Se)}if(typeof G.comment=="object"&&ce in G.comment){const Se=G.comment[ce];Re=!0;const Te=dt(Se,S.commentSyntax.value,t);Te.hasAuthor&&typeof Te.author<"u"&&Pe.push(Te.author.toString()),Ve.push({row:P-1,col:ke});let We=Pe.length;if(Te.hasAuthor&&typeof Te.author<"u"){let er=Te.author.toString();const tr=Pe.indexOf(er);tr<0?Pe.push(er):We=tr}Ye+=ut(lt,Te.commentStr,Te.commentStyle,We)}const Qt=ze&&ze[lt];if(Qt){const Se=ht(lt,Qt,A);Se.needCalcChain&&(ne=!0,z+=Se.chainCell),T+=Se.cell,de+=Se.cell,delete ze[lt]}else if(typeof Ce=="string"){const Se='<c r="'+r[ke]+P+'" t="s" '+(Ee&&h.styles&&h.styles[Ee]?'s="'+h.styles[Ee].index+'"':"")+"><v>"+R+"</v></c>";if(de+=Se,T+=Se,typeof C.multiStyleCondition=="function"){const Te=C.multiStyleCondition(Ce,G,ce,P,ke,!1);Te&&((!("multiStyleValue"in G)||typeof G.multiStyleValue>"u")&&(G.multiStyleValue={}),G.multiStyleValue[ce]=Te)}"multiStyleValue"in G&&G.multiStyleValue&&ce in G.multiStyleValue&&Array.isArray(G.multiStyleValue[ce])?E+=mt(G.multiStyleValue[ce],S.commentSyntax.value,Ee||""):E+="<si><t>"+tt(Ce)+"</t></si>",F[Ce]=Ce,R++}else{const Se='<c r="'+r[ke]+P+'" '+(Ee&&h.styles&&h.styles[Ee]?'s="'+h.styles[Ee].index+'"':"")+"><v>"+Ce+"</v></c>";T+=Se,de+=Se}}),se-1==le&&Object.keys(Le).forEach(ce=>{Le[ce].inProgress&&ye.push(ce+Le[ce].start+":"+ce+P)}),d[P]={startTag:xe,endTag:"</row>",details:de},P++,T+="</row>"}),C.sortAndFilter&&(C.sortAndFilter.mode=="all"?J+='<autoFilter ref="A1:'+r[ie-1]+(P-1)+'" />':typeof C.sortAndFilter.ref=="string"&&C.sortAndFilter.ref.length>0&&(J+='<autoFilter ref="'+C.sortAndFilter.ref+'" />'))}if(Ge.length>0&&Ge.forEach(W=>{const fe=C.shiftLeft?C.shiftLeft:0,ae=C.headers[W-fe],se=r[W];ze[se+""+P]={start:C.withoutHeader?se+"1":se+"2",end:se+""+(P-1),type:ae.formula.type,...ae.formula.styleId?{styleId:ae.formula.styleId}:{}}}),He.length>0&&y&&He.forEach(W=>{const fe=C.headers[W];fe.conditionalFormatting&&Ze.push({...fe.conditionalFormatting,start:C.withoutHeader?r[W]+"1":r[W]+"2",end:r[W]+""+(P-1)})}),ze){const W=Object.keys(ze).sort((fe,ae)=>fe>ae?1:-1);if(W.length){let fe={};W.forEach(ae=>{const se=ht(ae,ze[ae],A,h.styles);se.needCalcChain&&(ne=!0,z+=se.chainCell),fe[se.row]?fe[se.row]+=se.cell:fe[se.row]=se.cell}),Object.keys(fe).sort((ae,se)=>+ae>+se?1:-1).forEach(ae=>{const se=ae,G=fe[se];let le=d[se];if(le){const Oe=le.startTag+le.details+G+le.endTag;let xe=new RegExp(le.startTag+"[\\n\\s\\S]*?</row>");T=T.replace(xe,Oe)}else T+='<row r="'+ae+'" spans="1:'+Math.max(ie,1)+'" >'+G+"</row>",d[se]={startTag:'<row r="'+ae+'" spans="1:'+Math.max(ie,1)+'" >',endTag:"</row>",details:G}})}}}e>0&&(I+='<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" PartName="/xl/worksheets/sheet'+(e+1)+'.xml" />');const Yt=C.name?C.name:"sheet"+(e+1),Nr=C.state?C.state:"visible";D+='<sheet state="'+Nr+'" name="'+Yt+'" sheetId="'+(e+1)+'" r:id="rId'+(k+1)+'" />',U+='<Relationship Id="rId'+(k+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(e+1)+'.xml" />',V+="<vt:lpstr>"+("sheet"+(e+1))+"</vt:lpstr>",C.selected&&(j=!0,n=e);const Vt=C.sortAndFilter?'filterMode="1"':"";let Gt=-1;xt&&await xt.then(ie=>{let M=ie;Gt=M.ref,_==null||_.file(M.name,M.image)});let st=!1,Ct="",Xt="";wt&&(st=!0,await wt.then(ie=>{let M="";ie.forEach((ee,Y)=>{const W=Y+1;let fe=ee.image;const ae=ee.name;let se=ee.obj.from,G=ee.obj.to,le=ee.obj.margin,Oe=ee.obj.type,xe=ee.obj.extent;typeof xe>"u"&&(xe={cx:2e5,cy:2e5});let de={start:{col:0,row:0,mL:0,mT:0},end:{col:1,row:1,mR:0,mB:0}};if(typeof se=="string"&&se.length>=2){let ce=qe(se,r);de.start={...ce},de.end={col:ce.col+1,row:ce.row+1}}if(typeof G=="string"&&G.length>=2){let ce=qe(G,r);ce.row+=1,ce.col+=1,de.end={...ce}}de.end.mR=0,de.end.mB=0,de.start.mL=0,de.start.mT=0,le&&((le.right||le.all)&&(de.end.mR=le.right||le.all),(le.bottom||le.all)&&(de.end.mB=le.bottom||le.all),(le.left||le.all)&&(de.start.mL=le.left||le.all),(le.top||le.all)&&(de.start.mT=le.top||le.all)),Oe=="one"?Ct+="<xdr:oneCellAnchor><xdr:from><xdr:col>"+de.start.col+"</xdr:col><xdr:colOff>"+de.start.mT+"</xdr:colOff><xdr:row>"+de.start.row+"</xdr:row><xdr:rowOff>"+de.start.mL+'</xdr:rowOff></xdr:from><xdr:ext cx="'+xe.cx+'" cy="'+xe.cy+'"/><xdr:pic><xdr:nvPicPr><xdr:cNvPr id="'+W+'" name="Picture '+W+'"></xdr:cNvPr><xdr:cNvPicPr preferRelativeResize="0" /></xdr:nvPicPr><xdr:blipFill><a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId'+W+'"></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>':Ct+='<xdr:twoCellAnchor editAs="oneCell"><xdr:from><xdr:col>'+de.start.col+"</xdr:col><xdr:colOff>"+de.start.mT+"</xdr:colOff><xdr:row>"+de.start.row+"</xdr:row><xdr:rowOff>"+de.start.mL+"</xdr:rowOff></xdr:from><xdr:to><xdr:col>"+de.end.col+"</xdr:col><xdr:colOff>"+de.end.mB+"</xdr:colOff><xdr:row>"+de.end.row+"</xdr:row><xdr:rowOff>"+de.end.mR+'</xdr:rowOff></xdr:to><xdr:pic><xdr:nvPicPr><xdr:cNvPr id="'+W+'" name="Picture '+W+'"></xdr:cNvPr><xdr:cNvPicPr preferRelativeResize="0" /></xdr:nvPicPr><xdr:blipFill><a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId'+W+'"></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>',_==null||_.file(ae,fe),M+='<Relationship Id="rId'+W+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/'+ae+'" />'}),Xt=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+M+"</Relationships>"})),ye=[...new Set(ye)];let Jt="",Xe=1;Ze.length>0&&y&&(Jt=Ze.reduce((ie,M)=>{if(M.type=="cells")return M.operator=="ct"?ie+'<conditionalFormatting sqref="'+M.start+":"+M.end+'"><cfRule type="containsText" dxfId="'+(M.styleId&&x[M.styleId]?x[M.styleId]:0)+'" priority="'+(M.priority?M.priority:Xe++)+'" operator="containsText" text="'+M.value+'"><formula>NOT(ISERROR(SEARCH("'+M.value+'",'+M.start+")))</formula></cfRule></conditionalFormatting>":typeof M.operator>"u"||typeof c[M.operator]>"u"?ie:ie+'<conditionalFormatting sqref="'+M.start+":"+M.end+'"><cfRule type="cellIs" dxfId="'+(M.styleId&&typeof x[M.styleId]<"u"?x[M.styleId]:0)+'" priority="'+(M.priority?M.priority:Xe++)+'" operator="'+c[M.operator]+'">'+(Array.isArray(M.value)?M.value.reduce((ee,Y)=>ee+"<formula>"+Y.value+"</formula>",""):"<formula>"+M.value+"</formula>")+"</cfRule></conditionalFormatting>";if(M.type=="top")return ie+'<conditionalFormatting sqref="'+M.start+":"+M.end+'"><cfRule type="'+(M.operator?"aboveAverage":"top10")+'" dxfId="'+(M.styleId&&typeof x[M.styleId]<"u"?x[M.styleId]:0)+'" priority="'+(M.priority?M.priority:Xe++)+'" '+(M.bottom?'bottom="1"':"")+" "+(M.percent?'percent="1"':"")+' rank="'+M.value+'" '+(M.operator=="belowAverage"?'aboveAverage="0"':"")+"/></conditionalFormatting>";if(M.type=="iconSet"){let ee="";return typeof M.operator>"u"?ie:(M.operator.indexOf("5")==0?ee='<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"/>':M.operator.indexOf("4")==0?ee='<cfvo type="percent" val="0"/><cfvo type="percent" val="25"/><cfvo type="percent" val="50"/><cfvo type="percent" val="75"/>':ee='<cfvo type="percent" val="0"/><cfvo type="percent" val="33"/><cfvo type="percent" val="67"/>',ie+'<conditionalFormatting sqref="'+M.start+":"+M.end+'"><cfRule type="iconSet" priority="'+(M.priority?M.priority:Xe++)+'"><iconSet iconSet="'+M.operator+'">'+ee+"</iconSet></cfRule></conditionalFormatting>")}else return M.type=="colorScale"?ie+'<conditionalFormatting sqref="'+M.start+":"+M.end+'"><cfRule type="colorScale" priority="'+(M.priority?M.priority:Xe++)+'"><colorScale><cfvo type="min"/>'+(M.operator=="percentile"?'<cfvo type="percentile" val="'+M.value+'"/>':"")+'<cfvo type="max"/>'+(M.colors&&Array.isArray(M.colors)?M.colors.reduce((ee,Y)=>ee+'<color rgb="'+Ue(Y,b)+'"/>',""):'<color rgb="FFF8696B"/><color rgb="FFFFEB84"/><color rgb="FF63BE7B"/>')+"</colorScale></cfRule></conditionalFormatting>":M.type=="dataBar"?ie+'<conditionalFormatting sqref="'+M.start+":"+M.end+'"><cfRule type="dataBar" priority="'+(M.priority?M.priority:Xe++)+'"><dataBar><cfvo type="min"/><cfvo type="max"/>'+(M.colors&&Array.isArray(M.colors)?M.colors.reduce((ee,Y)=>ee+'<color rgb="'+Ue(Y,b)+'"/>',""):'<color rgb="FF638EC6"/>')+"</dataBar></cfRule></conditionalFormatting>":ie},"")),(me||Re||st)&&v==null&&(v=u==null?void 0:u.folder("drawings")),st&&a==null&&(a=v==null?void 0:v.folder("_rels")),L["sheet"+(e+1)]={indexId:k+1,key:"sheet"+(e+1),sheetName:Yt,sheetDataTableColumns:N,backgroundImageRef:Gt,sheetDimensions:p,asTable:O||!1,sheetDataString:T,sheetDrop