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.
1,127 lines • 112 kB
JavaScript
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 Yt(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 = Yt(e);
return t == null ? void 0 : (0.299 * t[0] + 0.587 * t[1] + 0.114 * t[2]) / 255 > 0.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 et(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 : (et(t[0]) + et(t[1]) + et(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 Vt(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: Vt(g)
}), l), o);
}
const tt = {
fileName: "MR-Excel",
headerBackgroundColor: "#393E46",
headerColor: "#EEEEEE",
negativeColor: !1,
rowBackgroundColor: "#EEEEEE",
rowColor: "#393E46",
filterKeys: []
}, zt = function(e, t = {
...tt
}) {
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 : tt.headerBackgroundColor, n = t && t.rowBackgroundColor ? t.rowBackgroundColor : tt.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 po(e, t, r) {
let o = {};
const l = (await import("./jszip.min-D-TEDr9v.js").then((m) => m.j)).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 import("./FileSaver.min-BEH1o5YI.js").then((f) => f.F)).saveAs(
m,
(r != null && r.fileName ? r == null ? void 0 : r.fileName : "tableRecord") + ".xlsx"
);
}
}
function Ut(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 Wt(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 X = 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 J = me(P.backgroundColor);
!J && X && (J = X);
const $ = parseInt(
P.fontSize.substring(0, P.fontSize.indexOf("p"))
);
let L = {
...J ? { backgroundColor: J } : {},
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)) * 0.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((J, $) => {
if ("c" + ($ + B) in N)
for (let K = 0; K <= j + 1 && "c" + ($ + K) in N; K++)
B++;
$ += B;
let L = window.getComputedStyle(J, null);
if (J.getAttribute("colspan") || J.getAttribute("rowspan")) {
let K = Ut(
J.getAttribute("colspan") * 1,
J.getAttribute("rowspan") * 1,
$,
j,
N,
J.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 && X && (M = X);
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" + $] = J.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 Gt(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 Zt(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 Xt(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 ot(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 + '"' : "", X = s.isArray || v ? ' t="array" ref="' + D + '"' : "";
return n = '<c r="' + j + '"' + U + q + "><f" + X + ">" + 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 rt(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 nt(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 Jt = '<rPr><b /><sz val="9" /><color rgb="000000" /><rFont val="Tahoma" /></rPr>', Me = function(e) {
return e.replace(/\&/g, "&").replace(/\</g, "<").replace(/\>/g, ">");
};
function lt(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]* "-"??_ ;_ @_ " />'
},
"¥": {
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" />'
}
}, Qt = [
"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 Re(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 eo = {}, at = new Proxy(eo, {
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 Ht(e, t, r) {
at[e], at[e][t] = r;
}
function Nt(e, t, r) {
Object.keys(r).forEach((n) => {
const l = r[n];
typeof l == "object" ? n != "data" && n != "headers" && Nt(e, t.length > 0 ? t + "." + n : n, l) : Ht(e, t.length > 0 ? t + "." + n : n, l);
});
}
function to(e, t) {
Nt(e, "", t);
}
function oo(e, t) {
let r = t, o = at[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 ro(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>"' + g + ""</formula1></dataValidation>";
}
return r += "</dataValidations>", r;
}
async function ct(e, t = "") {
if (typeof t == "string" && t.length > 0 && (e = oo(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 = [...Qt];
e.numberOfColumn && e.numberOfColumn > 25 && (l = $e(l, e.numberOfColumn));
const u = (await import("./jszip.min-D-TEDr9v.js").then((w) => w.j)).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 = Jt, q = e.activateConditionalFormatting ? e.activateConditionalFormatting : !1, U = {}, X = {};
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 = '&"' + G + "," + ce + '"'), x.size && (C += "&" + x.size), x.doubleUnderline ? C += "&E" : x.underline && (C += "&U"), x.color) {
const Te = he(x.color, o);
typeof Te == "string" && Te.length > 0 && (C += "&K" + Te.toUpperCase());
}
return U[a] = C, w;
}
if (q && typeof x.type == "string" && x.type && (x.type == "conditionalFormatting" || x.type.toUpperCase() == "CF")) {
X[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", Gt(N, q));
let oe = '<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" PartName="/xl/worksheets/sheet1.xml" />', P = "", B = 0, J = "", $ = "", 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 = "", _e = "", ze = !1, dt = "", pt = "", ht = "", ut = "", xe = Object.assign([], a.merges), ue = Object.assign({}, a.formula), Ue = Object.assign(
[],
a.conditionalFormatting
), Ie = !1, pe = [], Le = "", He = [], yt = [], We = [], Ge = [], ke = {}, Pe = "", je = !1, Ze = "";
if (a.rtl && (Ee += ' rightToLeft="1" '), a.pageBreak) {
const T = a.pageBreak;
if (T.row && Array.isArray(T.row)) {
_e = "pageBreakPreview";
const i = T.row.length;
Ze += '<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)) {
_e = "pageBreakPreview";
const i = T.column.length;
Ze += '<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 && (je = !0), T.margin) {
const S = T.margin;
let F = {
left: 0.7,
right: 0.7,
top: 0.75,
bottom: 0.75,
header: 0.3,
footer: 0.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 += "&" + 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";
});
}
}), Pe = y + p + c, Pe.length > 0) {
je = !0;
const S = i.length == 7 || i.length == 12 ? ' differentOddEven="1"' : "", F = i.indexOf("first") >= 0 ? ' differentFirst="1"' : "";
Pe = "<headerFooter" + S + F + ">" + Pe + "</headerFooter>";
}
}
if (a.viewOption) {
let T = "";
const i = a.viewOption;
i.type && (_e = 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" && (je = !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 (je && (_e = "pageLayout"), a.checkbox) {
ze = !0;
const T = ye.checkbox;
a.checkbox.forEach((i, y) => {
let p = T;
if (i.link) {
let A = Re(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 = Re(S, l);
h.start = {
...A
}, h.end = {
col: A.col + 1,
row: A.row + 1
};
}
if (typeof F == "string" && F.length >= 2) {
let A = Re(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 Je;
if (a.images && (v == null && (v = f == null ? void 0 : f.folder("media")), Je = 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") {
Ie = !0;
const ee = rt(
_,
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 += nt(
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 += lt(
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 && We.push(_), c.conditionalFormatting && q && Ge.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