@pie-element/simple-cloze 0.1.7-next.20261007184841 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/{i18n-DYt9GMkT.js → i18n-CXqnW0mV.js} +1065 -807
- package/dist/browser/editor-runtime/i18n-CXqnW0mV.js.map +1 -0
- package/dist/browser/{mathjax-BKrHE4xs-DcNS5jDI.js → editor-runtime/mathjax-BKrHE4xs-BTRY2LLA.js} +2 -2
- package/dist/browser/editor-runtime/{mathjax-BKrHE4xs-DcNS5jDI.js.map → mathjax-BKrHE4xs-BTRY2LLA.js.map} +1 -1
- package/dist/browser/editor-runtime/print/index.js +1 -1
- package/dist/browser/{i18n-DYt9GMkT.js → i18n-CXqnW0mV.js} +1065 -807
- package/dist/browser/i18n-CXqnW0mV.js.map +1 -0
- package/dist/browser/{editor-runtime/mathjax-BKrHE4xs-DcNS5jDI.js → mathjax-BKrHE4xs-BTRY2LLA.js} +2 -2
- package/dist/browser/{mathjax-BKrHE4xs-DcNS5jDI.js.map → mathjax-BKrHE4xs-BTRY2LLA.js.map} +1 -1
- package/dist/browser/print/index.js +1 -1
- package/dist/delivery/index.js +548 -279
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +21 -21
- package/dist/print/index.js +548 -279
- package/dist/print/index.js.map +1 -1
- package/module/print.js +982 -724
- package/module/print.js.map +1 -1
- package/package.json +4 -4
- package/dist/browser/editor-runtime/i18n-DYt9GMkT.js.map +0 -1
- package/dist/browser/i18n-DYt9GMkT.js.map +0 -1
|
@@ -102,24 +102,24 @@ p ||= function(e) {
|
|
|
102
102
|
}, v ||= function(e) {
|
|
103
103
|
return new e(...[...arguments].slice(1));
|
|
104
104
|
};
|
|
105
|
-
var y =
|
|
105
|
+
var y = w(Array.prototype.forEach);
|
|
106
106
|
Array.prototype.indexOf;
|
|
107
|
-
var ee =
|
|
107
|
+
var ee = w(Array.prototype.lastIndexOf), te = w(Array.prototype.pop), ne = w(Array.prototype.push);
|
|
108
108
|
Array.prototype.slice;
|
|
109
|
-
var re =
|
|
110
|
-
function
|
|
109
|
+
var re = w(Array.prototype.splice), ie = Array.isArray, b = w(String.prototype.toLowerCase), x = w(String.prototype.toString), ae = w(String.prototype.match), oe = w(String.prototype.replace), se = w(String.prototype.indexOf), ce = w(String.prototype.trim), le = w(Number.prototype.toString), ue = w(Boolean.prototype.toString), de = typeof BigInt > "u" ? null : w(BigInt.prototype.toString), fe = typeof Symbol > "u" ? null : w(Symbol.prototype.toString), S = w(Object.prototype.hasOwnProperty), pe = w(Object.prototype.toString), C = w(RegExp.prototype.test), me = he(TypeError);
|
|
110
|
+
function w(e) {
|
|
111
111
|
return function(t) {
|
|
112
112
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
113
113
|
var n = [...arguments].slice(1);
|
|
114
114
|
return _(e, t, n);
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function he(e) {
|
|
118
118
|
return function() {
|
|
119
119
|
return v(e, [...arguments]);
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function T(e, t) {
|
|
123
123
|
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : b;
|
|
124
124
|
if (l && l(e, null), !ie(t)) return e;
|
|
125
125
|
let r = t.length;
|
|
@@ -133,46 +133,46 @@ function D(e, t) {
|
|
|
133
133
|
}
|
|
134
134
|
return e;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
for (let t = 0; t < e.length; t++)
|
|
136
|
+
function ge(e) {
|
|
137
|
+
for (let t = 0; t < e.length; t++) S(e, t) || (e[t] = null);
|
|
138
138
|
return e;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function E(e) {
|
|
141
141
|
let t = h(null);
|
|
142
142
|
for (let r of c(e)) {
|
|
143
143
|
var n = a(r, 2);
|
|
144
144
|
let i = n[0], o = n[1];
|
|
145
|
-
|
|
145
|
+
S(e, i) && (ie(o) ? t[i] = ge(o) : o && typeof o == "object" && o.constructor === Object ? t[i] = E(o) : t[i] = o);
|
|
146
146
|
}
|
|
147
147
|
return t;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function _e(e) {
|
|
150
150
|
switch (typeof e) {
|
|
151
151
|
case "string": return e;
|
|
152
152
|
case "number": return le(e);
|
|
153
153
|
case "boolean": return ue(e);
|
|
154
|
-
case "bigint": return
|
|
155
|
-
case "symbol": return
|
|
156
|
-
case "undefined": return
|
|
154
|
+
case "bigint": return de ? de(e) : "0";
|
|
155
|
+
case "symbol": return fe ? fe(e) : "Symbol()";
|
|
156
|
+
case "undefined": return pe(e);
|
|
157
157
|
case "function":
|
|
158
158
|
case "object": {
|
|
159
|
-
if (e === null) return
|
|
160
|
-
let t = e, n =
|
|
159
|
+
if (e === null) return pe(e);
|
|
160
|
+
let t = e, n = D(t, "toString");
|
|
161
161
|
if (typeof n == "function") {
|
|
162
162
|
let e = n(t);
|
|
163
|
-
return typeof e == "string" ? e :
|
|
163
|
+
return typeof e == "string" ? e : pe(e);
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return pe(e);
|
|
166
166
|
}
|
|
167
|
-
default: return
|
|
167
|
+
default: return pe(e);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function D(e, t) {
|
|
171
171
|
for (; e !== null;) {
|
|
172
172
|
let n = f(e, t);
|
|
173
173
|
if (n) {
|
|
174
|
-
if (n.get) return
|
|
175
|
-
if (typeof n.value == "function") return
|
|
174
|
+
if (n.get) return w(n.get);
|
|
175
|
+
if (typeof n.value == "function") return w(n.value);
|
|
176
176
|
}
|
|
177
177
|
e = d(e);
|
|
178
178
|
}
|
|
@@ -181,14 +181,14 @@ function k(e, t) {
|
|
|
181
181
|
}
|
|
182
182
|
return n;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function ve(e) {
|
|
185
185
|
try {
|
|
186
|
-
return
|
|
186
|
+
return C(e, ""), !0;
|
|
187
187
|
} catch {
|
|
188
188
|
return !1;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
var
|
|
191
|
+
var ye = p(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), be = p(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), xe = p([
|
|
192
192
|
"feBlend",
|
|
193
193
|
"feColorMatrix",
|
|
194
194
|
"feComponentTransfer",
|
|
@@ -214,7 +214,7 @@ var _e = p(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
214
214
|
"feSpotLight",
|
|
215
215
|
"feTile",
|
|
216
216
|
"feTurbulence"
|
|
217
|
-
]),
|
|
217
|
+
]), Se = p([
|
|
218
218
|
"animate",
|
|
219
219
|
"color-profile",
|
|
220
220
|
"cursor",
|
|
@@ -237,7 +237,7 @@ var _e = p(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
237
237
|
"solidcolor",
|
|
238
238
|
"unknown",
|
|
239
239
|
"use"
|
|
240
|
-
]),
|
|
240
|
+
]), Ce = p(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), we = p([
|
|
241
241
|
"maction",
|
|
242
242
|
"maligngroup",
|
|
243
243
|
"malignmark",
|
|
@@ -253,13 +253,13 @@ var _e = p(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
253
253
|
"annotation-xml",
|
|
254
254
|
"mprescripts",
|
|
255
255
|
"none"
|
|
256
|
-
]),
|
|
256
|
+
]), Te = p(["#text"]), Ee = p(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), De = p(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Oe = p(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), ke = p([
|
|
257
257
|
"xlink:href",
|
|
258
258
|
"xml:id",
|
|
259
259
|
"xlink:title",
|
|
260
260
|
"xml:space",
|
|
261
261
|
"xmlns:xlink"
|
|
262
|
-
]),
|
|
262
|
+
]), Ae = m(/{{[\w\W]*|^[\w\W]*}}/g), je = m(/<%[\w\W]*|^[\w\W]*%>/g), Me = m(/\${[\w\W]*/g), Ne = m(/^data-[\-\w.\u00B7-\uFFFF]+$/), Pe = m(/^aria-[\-\w]+$/), Fe = m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ie = m(/^(?:\w+script|data):/i), Le = m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Re = m(/^html$/i), ze = m(/^[a-z][.\w]*(-[.\w]+)+$/i), Be = m(/<[/\w!]/g), Ve = m(/<[/\w]/g), He = m(/<\/no(script|embed|frames)/i), Ue = m(/\/>/i), O = {
|
|
263
263
|
element: 1,
|
|
264
264
|
attribute: 2,
|
|
265
265
|
text: 3,
|
|
@@ -272,7 +272,7 @@ var _e = p(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
272
272
|
documentType: 10,
|
|
273
273
|
documentFragment: 11,
|
|
274
274
|
notation: 12
|
|
275
|
-
},
|
|
275
|
+
}, We = [
|
|
276
276
|
"style",
|
|
277
277
|
"script",
|
|
278
278
|
"xmp",
|
|
@@ -281,14 +281,14 @@ var _e = p(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
281
281
|
"noframes",
|
|
282
282
|
"plaintext",
|
|
283
283
|
"noscript"
|
|
284
|
-
],
|
|
284
|
+
], Ge = p(T({}, We)), Ke = function() {
|
|
285
285
|
let e = {};
|
|
286
|
-
return y(
|
|
286
|
+
return y(We, (t) => {
|
|
287
287
|
e[t] = m(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
288
288
|
}), p(e);
|
|
289
|
-
}(),
|
|
289
|
+
}(), qe = function() {
|
|
290
290
|
return typeof window > "u" ? null : window;
|
|
291
|
-
},
|
|
291
|
+
}, Je = function(e, t) {
|
|
292
292
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
293
293
|
let n = null, r = "data-tt-policy-suffix";
|
|
294
294
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -305,7 +305,7 @@ var _e = p(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
305
305
|
} catch {
|
|
306
306
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, Ye = function() {
|
|
309
309
|
return {
|
|
310
310
|
afterSanitizeAttributes: [],
|
|
311
311
|
afterSanitizeElements: [],
|
|
@@ -317,60 +317,60 @@ var _e = p(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
317
317
|
uponSanitizeElement: [],
|
|
318
318
|
uponSanitizeShadowNode: []
|
|
319
319
|
};
|
|
320
|
-
},
|
|
321
|
-
return
|
|
322
|
-
},
|
|
323
|
-
let r =
|
|
324
|
-
return r && typeof r == "object" ?
|
|
320
|
+
}, Xe = function(e, t, n, r) {
|
|
321
|
+
return S(e, t) && ie(e[t]) ? T(r.base ? E(r.base) : {}, e[t], r.transform) : n;
|
|
322
|
+
}, Ze = function(e, t, n) {
|
|
323
|
+
let r = S(e, t) ? e[t] : void 0;
|
|
324
|
+
return r && typeof r == "object" ? E(r) : n();
|
|
325
325
|
};
|
|
326
|
-
function
|
|
327
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
328
|
-
if (t.version = "3.4.16", t.removed = [], !e || !e.document || e.document.nodeType !==
|
|
326
|
+
function Qe() {
|
|
327
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : qe(), t = (e) => Qe(e);
|
|
328
|
+
if (t.version = "3.4.16", t.removed = [], !e || !e.document || e.document.nodeType !== O.document || !e.Element) return t.isSupported = !1, t;
|
|
329
329
|
let n = e.document, r = n, i = r.currentScript;
|
|
330
330
|
e.DocumentFragment;
|
|
331
331
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, l = e.NodeFilter;
|
|
332
332
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
333
|
-
let u = e.DOMParser, d = e.trustedTypes, f = s.prototype, g =
|
|
334
|
-
return
|
|
335
|
-
},
|
|
336
|
-
return
|
|
333
|
+
let u = e.DOMParser, d = e.trustedTypes, f = s.prototype, g = D(f, "cloneNode"), _ = D(f, "remove"), v = D(f, "removeAttributeNode"), le = D(f, "nextSibling"), ue = D(f, "childNodes"), de = D(f, "parentNode"), fe = D(f, "shadowRoot"), pe = D(f, "attributes"), w = o && o.prototype ? D(o.prototype, "nodeType") : null, he = o && o.prototype ? D(o.prototype, "nodeName") : null, ge = o && o.prototype ? D(o.prototype, "ownerDocument") : null, We = function(e) {
|
|
334
|
+
return w ? w(e) : e.nodeType;
|
|
335
|
+
}, $e = function(e) {
|
|
336
|
+
return he ? he(e) : e.nodeName;
|
|
337
337
|
};
|
|
338
338
|
if (typeof a == "function") {
|
|
339
339
|
let e = n.createElement("template");
|
|
340
340
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
341
341
|
}
|
|
342
|
-
let
|
|
343
|
-
if (
|
|
344
|
-
},
|
|
345
|
-
|
|
342
|
+
let k, et = "", tt, nt = !1, rt = 0, it = function() {
|
|
343
|
+
if (rt > 0) throw me("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
344
|
+
}, at = function(e) {
|
|
345
|
+
it(), rt++;
|
|
346
346
|
try {
|
|
347
|
-
return
|
|
347
|
+
return k.createHTML(e);
|
|
348
348
|
} finally {
|
|
349
|
-
|
|
349
|
+
rt--;
|
|
350
350
|
}
|
|
351
|
-
},
|
|
352
|
-
|
|
351
|
+
}, ot = function(e) {
|
|
352
|
+
it(), rt++;
|
|
353
353
|
try {
|
|
354
|
-
return
|
|
354
|
+
return k.createScriptURL(e);
|
|
355
355
|
} finally {
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
return
|
|
360
|
-
},
|
|
361
|
-
t.isSupported = typeof c == "function" && typeof
|
|
362
|
-
let
|
|
363
|
-
..._e,
|
|
364
|
-
...ve,
|
|
356
|
+
rt--;
|
|
357
|
+
}
|
|
358
|
+
}, st = function() {
|
|
359
|
+
return nt ||= (tt = Je(d, i), !0), tt;
|
|
360
|
+
}, ct = n, lt = ct.implementation, ut = ct.createNodeIterator, dt = ct.createDocumentFragment, ft = ct.getElementsByTagName, A = r.importNode, j = Ye();
|
|
361
|
+
t.isSupported = typeof c == "function" && typeof de == "function" && lt && lt.createHTMLDocument !== void 0;
|
|
362
|
+
let pt = Ae, mt = je, ht = Me, gt = Ne, _t = Pe, vt = Ie, yt = Le, bt = ze, xt = Fe, M = null, St = T({}, [
|
|
365
363
|
...ye,
|
|
364
|
+
...be,
|
|
366
365
|
...xe,
|
|
367
|
-
...Ce
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
...Te,
|
|
366
|
+
...Ce,
|
|
367
|
+
...Te
|
|
368
|
+
]), N = null, Ct = T({}, [
|
|
371
369
|
...Ee,
|
|
372
|
-
...De
|
|
373
|
-
|
|
370
|
+
...De,
|
|
371
|
+
...Oe,
|
|
372
|
+
...ke
|
|
373
|
+
]), P = Object.seal(h(null, {
|
|
374
374
|
tagNameCheck: {
|
|
375
375
|
writable: !0,
|
|
376
376
|
configurable: !1,
|
|
@@ -389,7 +389,7 @@ function Xe() {
|
|
|
389
389
|
enumerable: !0,
|
|
390
390
|
value: !1
|
|
391
391
|
}
|
|
392
|
-
})),
|
|
392
|
+
})), F = null, wt = null, I = Object.seal(h(null, {
|
|
393
393
|
tagCheck: {
|
|
394
394
|
writable: !0,
|
|
395
395
|
configurable: !1,
|
|
@@ -402,14 +402,14 @@ function Xe() {
|
|
|
402
402
|
enumerable: !0,
|
|
403
403
|
value: null
|
|
404
404
|
}
|
|
405
|
-
})),
|
|
405
|
+
})), Tt = !0, Et = !0, Dt = !1, Ot = !0, L = !1, R = !0, kt = !1, At = !1, z = null, jt = null, Mt = !1, B = !1, Nt = !1, Pt = !1, Ft = !0, It = !1, Lt = "user-content-", Rt = !0, zt = !1, Bt = {}, Vt = null, Ht = T({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Ut = null, Wt = T({}, [
|
|
406
406
|
"audio",
|
|
407
407
|
"video",
|
|
408
408
|
"img",
|
|
409
409
|
"source",
|
|
410
410
|
"image",
|
|
411
411
|
"track"
|
|
412
|
-
]),
|
|
412
|
+
]), Gt = null, Kt = T({}, [
|
|
413
413
|
"alt",
|
|
414
414
|
"class",
|
|
415
415
|
"for",
|
|
@@ -424,77 +424,77 @@ function Xe() {
|
|
|
424
424
|
"value",
|
|
425
425
|
"style",
|
|
426
426
|
"xmlns"
|
|
427
|
-
]),
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
], x),
|
|
427
|
+
]), qt = "http://www.w3.org/1998/Math/MathML", Jt = "http://www.w3.org/2000/svg", V = "http://www.w3.org/1999/xhtml", Yt = V, Xt = !1, Zt = null, Qt = T({}, [
|
|
428
|
+
qt,
|
|
429
|
+
Jt,
|
|
430
|
+
V
|
|
431
|
+
], x), $t = p([
|
|
432
432
|
"mi",
|
|
433
433
|
"mo",
|
|
434
434
|
"mn",
|
|
435
435
|
"ms",
|
|
436
436
|
"mtext"
|
|
437
|
-
]),
|
|
437
|
+
]), en = T({}, $t), tn = p(["annotation-xml"]), nn = T({}, tn), rn = T({}, [
|
|
438
438
|
"title",
|
|
439
439
|
"style",
|
|
440
440
|
"font",
|
|
441
441
|
"a",
|
|
442
442
|
"script"
|
|
443
|
-
]),
|
|
443
|
+
]), an = null, on = ["application/xhtml+xml", "text/html"], H = null, U = null, sn = n.createElement("form"), cn = function(e) {
|
|
444
444
|
return e instanceof RegExp || e instanceof Function;
|
|
445
|
-
},
|
|
445
|
+
}, ln = function() {
|
|
446
446
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
447
|
-
if (
|
|
448
|
-
(!e || typeof e != "object") && (e = {}), e =
|
|
449
|
-
transform:
|
|
447
|
+
if (U && U === e) return;
|
|
448
|
+
(!e || typeof e != "object") && (e = {}), e = E(e), an = on.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, H = an === "application/xhtml+xml" ? x : b, M = Xe(e, "ALLOWED_TAGS", St, { transform: H }), N = Xe(e, "ALLOWED_ATTR", Ct, { transform: H }), Zt = Xe(e, "ALLOWED_NAMESPACES", Qt, { transform: x }), Gt = Xe(e, "ADD_URI_SAFE_ATTR", Kt, {
|
|
449
|
+
transform: H,
|
|
450
|
+
base: Kt
|
|
451
|
+
}), Ut = Xe(e, "ADD_DATA_URI_TAGS", Wt, {
|
|
452
|
+
transform: H,
|
|
450
453
|
base: Wt
|
|
451
|
-
}), Vt =
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}), zt = Je(e, "FORBID_CONTENTS", Bt, { transform: W }), R = Je(e, "FORBID_TAGS", O({}), { transform: W }), xt = Je(e, "FORBID_ATTR", O({}), { transform: W }), Rt = C(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? O(e.USE_PROFILES) : e.USE_PROFILES : !1, St = e.ALLOW_ARIA_ATTR !== !1, Ct = e.ALLOW_DATA_ATTR !== !1, wt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Tt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, B = e.SAFE_FOR_TEMPLATES || !1, Et = e.SAFE_FOR_XML !== !1, Dt = e.WHOLE_DOCUMENT || !1, H = e.RETURN_DOM || !1, jt = e.RETURN_DOM_FRAGMENT || !1, Mt = e.RETURN_TRUSTED_TYPE || !1, At = e.FORCE_BODY || !1, Nt = e.SANITIZE_DOM !== !1, Pt = e.SANITIZE_NAMED_PROPS || !1, It = e.KEEP_CONTENT !== !1, Lt = e.IN_PLACE || !1, vt = ge(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Ne, qt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : U, Qt = Ye(e, "MATHML_TEXT_INTEGRATION_POINTS", () => D({}, Zt)), en = Ye(e, "HTML_INTEGRATION_POINTS", () => D({}, $t));
|
|
455
|
-
let t = Ye(e, "CUSTOM_ELEMENT_HANDLING", () => h(null));
|
|
456
|
-
if (L = h(null), C(t, "tagNameCheck") && on(t.tagNameCheck) && (L.tagNameCheck = t.tagNameCheck), C(t, "attributeNameCheck") && on(t.attributeNameCheck) && (L.attributeNameCheck = t.attributeNameCheck), C(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (L.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), m(L), B && (Ct = !1), jt && (H = !0), Rt && (F = D({}, Ce), I = h(null), Rt.html === !0 && (D(F, _e), D(I, we)), Rt.svg === !0 && (D(F, ve), D(I, Te), D(I, De)), Rt.svgFilters === !0 && (D(F, ye), D(I, Te), D(I, De)), Rt.mathMl === !0 && (D(F, xe), D(I, Ee), D(I, De))), z.tagCheck = null, z.attributeCheck = null, C(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? z.tagCheck = e.ADD_TAGS : ie(e.ADD_TAGS) && (F === yt && (F = O(F)), D(F, e.ADD_TAGS, W))), C(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? z.attributeCheck = e.ADD_ATTR : ie(e.ADD_ATTR) && (I === bt && (I = O(I)), D(I, e.ADD_ATTR, W))), C(e, "ADD_FORBID_CONTENTS") && ie(e.ADD_FORBID_CONTENTS) && (zt === Bt && (zt = O(zt)), D(zt, e.ADD_FORBID_CONTENTS, W)), It && (F["#text"] = !0), Dt && D(F, [
|
|
454
|
+
}), Vt = Xe(e, "FORBID_CONTENTS", Ht, { transform: H }), F = Xe(e, "FORBID_TAGS", E({}), { transform: H }), wt = Xe(e, "FORBID_ATTR", E({}), { transform: H }), Bt = S(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? E(e.USE_PROFILES) : e.USE_PROFILES : !1, Tt = e.ALLOW_ARIA_ATTR !== !1, Et = e.ALLOW_DATA_ATTR !== !1, Dt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ot = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, L = e.SAFE_FOR_TEMPLATES || !1, R = e.SAFE_FOR_XML !== !1, kt = e.WHOLE_DOCUMENT || !1, B = e.RETURN_DOM || !1, Nt = e.RETURN_DOM_FRAGMENT || !1, Pt = e.RETURN_TRUSTED_TYPE || !1, Mt = e.FORCE_BODY || !1, Ft = e.SANITIZE_DOM !== !1, It = e.SANITIZE_NAMED_PROPS || !1, Rt = e.KEEP_CONTENT !== !1, zt = e.IN_PLACE || !1, xt = ve(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Fe, Yt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : V, en = Ze(e, "MATHML_TEXT_INTEGRATION_POINTS", () => T({}, $t)), nn = Ze(e, "HTML_INTEGRATION_POINTS", () => T({}, tn));
|
|
455
|
+
let t = Ze(e, "CUSTOM_ELEMENT_HANDLING", () => h(null));
|
|
456
|
+
if (P = h(null), S(t, "tagNameCheck") && cn(t.tagNameCheck) && (P.tagNameCheck = t.tagNameCheck), S(t, "attributeNameCheck") && cn(t.attributeNameCheck) && (P.attributeNameCheck = t.attributeNameCheck), S(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), m(P), L && (Et = !1), Nt && (B = !0), Bt && (M = T({}, Te), N = h(null), Bt.html === !0 && (T(M, ye), T(N, Ee)), Bt.svg === !0 && (T(M, be), T(N, De), T(N, ke)), Bt.svgFilters === !0 && (T(M, xe), T(N, De), T(N, ke)), Bt.mathMl === !0 && (T(M, Ce), T(N, Oe), T(N, ke))), I.tagCheck = null, I.attributeCheck = null, S(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? I.tagCheck = e.ADD_TAGS : ie(e.ADD_TAGS) && (M === St && (M = E(M)), T(M, e.ADD_TAGS, H))), S(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? I.attributeCheck = e.ADD_ATTR : ie(e.ADD_ATTR) && (N === Ct && (N = E(N)), T(N, e.ADD_ATTR, H))), S(e, "ADD_FORBID_CONTENTS") && ie(e.ADD_FORBID_CONTENTS) && (Vt === Ht && (Vt = E(Vt)), T(Vt, e.ADD_FORBID_CONTENTS, H)), Rt && (M["#text"] = !0), kt && T(M, [
|
|
457
457
|
"html",
|
|
458
458
|
"head",
|
|
459
459
|
"body"
|
|
460
|
-
]),
|
|
461
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
462
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
463
|
-
let t =
|
|
464
|
-
|
|
460
|
+
]), M.table && (T(M, ["tbody"]), delete F.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
461
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw me("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
462
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw me("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
463
|
+
let t = k;
|
|
464
|
+
k = e.TRUSTED_TYPES_POLICY;
|
|
465
465
|
try {
|
|
466
|
-
|
|
466
|
+
et = at("");
|
|
467
467
|
} catch (e) {
|
|
468
|
-
throw
|
|
468
|
+
throw k = t, e;
|
|
469
469
|
}
|
|
470
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
471
|
-
p && p(e),
|
|
472
|
-
},
|
|
473
|
-
...
|
|
474
|
-
...
|
|
475
|
-
...
|
|
476
|
-
]),
|
|
477
|
-
return t.namespaceURI ===
|
|
478
|
-
},
|
|
479
|
-
return t.namespaceURI ===
|
|
480
|
-
},
|
|
481
|
-
return t.namespaceURI ===
|
|
482
|
-
},
|
|
483
|
-
let t =
|
|
470
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (k = void 0, et = "") : (k === void 0 && (k = st()), k && typeof et == "string" && (et = at("")));
|
|
471
|
+
p && p(e), U = e;
|
|
472
|
+
}, un = T({}, [
|
|
473
|
+
...be,
|
|
474
|
+
...xe,
|
|
475
|
+
...Se
|
|
476
|
+
]), dn = T({}, [...Ce, ...we]), fn = function(e, t, n) {
|
|
477
|
+
return t.namespaceURI === V ? e === "svg" : t.namespaceURI === qt ? e === "svg" && (n === "annotation-xml" || en[n]) : !!un[e];
|
|
478
|
+
}, pn = function(e, t, n) {
|
|
479
|
+
return t.namespaceURI === V ? e === "math" : t.namespaceURI === Jt ? e === "math" && nn[n] : !!dn[e];
|
|
480
|
+
}, mn = function(e, t, n) {
|
|
481
|
+
return t.namespaceURI === Jt && !nn[n] || t.namespaceURI === qt && !en[n] ? !1 : !dn[e] && (rn[e] || !un[e]);
|
|
482
|
+
}, hn = function(e) {
|
|
483
|
+
let t = de(e);
|
|
484
484
|
(!t || !t.tagName) && (t = {
|
|
485
|
-
namespaceURI:
|
|
485
|
+
namespaceURI: Yt,
|
|
486
486
|
tagName: "template"
|
|
487
487
|
});
|
|
488
488
|
let n = b(e.tagName), r = b(t.tagName);
|
|
489
|
-
return
|
|
490
|
-
},
|
|
489
|
+
return Zt[e.namespaceURI] ? e.namespaceURI === Jt ? fn(n, t, r) : e.namespaceURI === qt ? pn(n, t, r) : e.namespaceURI === V ? mn(n, t, r) : !!(an === "application/xhtml+xml" && Zt[e.namespaceURI]) : !1;
|
|
490
|
+
}, gn = function(e) {
|
|
491
491
|
ne(t.removed, { element: e });
|
|
492
492
|
try {
|
|
493
|
-
|
|
493
|
+
de(e).removeChild(e);
|
|
494
494
|
} catch {
|
|
495
|
-
if (_(e), !
|
|
495
|
+
if (_(e), !de(e)) throw me("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
496
496
|
}
|
|
497
|
-
},
|
|
497
|
+
}, _n = function(e, t, n) {
|
|
498
498
|
try {
|
|
499
499
|
v(e, t);
|
|
500
500
|
} catch {
|
|
@@ -502,8 +502,8 @@ function Xe() {
|
|
|
502
502
|
e.removeAttribute(n);
|
|
503
503
|
} catch {}
|
|
504
504
|
}
|
|
505
|
-
},
|
|
506
|
-
|
|
505
|
+
}, vn = function(e) {
|
|
506
|
+
bn(e);
|
|
507
507
|
let t = ue(e);
|
|
508
508
|
if (t) {
|
|
509
509
|
let e = [];
|
|
@@ -515,12 +515,12 @@ function Xe() {
|
|
|
515
515
|
} catch {}
|
|
516
516
|
});
|
|
517
517
|
}
|
|
518
|
-
let n =
|
|
518
|
+
let n = pe(e);
|
|
519
519
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
520
520
|
let r = n[t], i = r && r.name;
|
|
521
|
-
typeof i == "string" &&
|
|
521
|
+
typeof i == "string" && _n(e, r, i);
|
|
522
522
|
}
|
|
523
|
-
},
|
|
523
|
+
}, W = function(e, n, r) {
|
|
524
524
|
if (!r) try {
|
|
525
525
|
r = n.getAttributeNode(e);
|
|
526
526
|
} catch {
|
|
@@ -537,112 +537,112 @@ function Xe() {
|
|
|
537
537
|
n.removeAttribute(e);
|
|
538
538
|
} catch {}
|
|
539
539
|
}
|
|
540
|
-
if (e === "is") if (
|
|
541
|
-
|
|
540
|
+
if (e === "is") if (B || Nt) try {
|
|
541
|
+
gn(n);
|
|
542
542
|
} catch {}
|
|
543
543
|
else try {
|
|
544
544
|
n.setAttribute(e, "");
|
|
545
545
|
} catch {}
|
|
546
|
-
},
|
|
547
|
-
let t =
|
|
546
|
+
}, yn = function(e) {
|
|
547
|
+
let t = pe(e);
|
|
548
548
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
549
549
|
let r = t[n], i = r && r.name;
|
|
550
|
-
typeof i != "string" ||
|
|
550
|
+
typeof i != "string" || N[H(i)] || _n(e, r, i);
|
|
551
551
|
}
|
|
552
|
-
},
|
|
552
|
+
}, bn = function(e) {
|
|
553
553
|
let t = [e];
|
|
554
554
|
for (; t.length > 0;) {
|
|
555
555
|
let e = t.pop();
|
|
556
|
-
|
|
556
|
+
We(e) === O.element && yn(e);
|
|
557
557
|
let n = ue(e);
|
|
558
558
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
559
559
|
}
|
|
560
|
-
},
|
|
561
|
-
return
|
|
562
|
-
},
|
|
563
|
-
if (!
|
|
560
|
+
}, xn = function(e, t) {
|
|
561
|
+
return R ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
562
|
+
}, Sn = function(e) {
|
|
563
|
+
if (!R) return;
|
|
564
564
|
let t = [e];
|
|
565
565
|
for (; t.length > 0;) {
|
|
566
|
-
let e = t.pop(), n =
|
|
567
|
-
if (n ===
|
|
566
|
+
let e = t.pop(), n = We(e);
|
|
567
|
+
if (n === O.processingInstruction || n === O.comment && C(Ve, e.data)) {
|
|
568
568
|
try {
|
|
569
569
|
_(e);
|
|
570
570
|
} catch {}
|
|
571
571
|
continue;
|
|
572
572
|
}
|
|
573
|
-
if (n ===
|
|
574
|
-
let t = e, n =
|
|
573
|
+
if (n === O.element) {
|
|
574
|
+
let t = e, n = H($e(e));
|
|
575
575
|
try {
|
|
576
|
-
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") &&
|
|
576
|
+
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && xn("for", n) && t.removeAttribute("for");
|
|
577
577
|
} catch {}
|
|
578
578
|
}
|
|
579
579
|
let r = ue(e);
|
|
580
580
|
if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
|
|
581
581
|
}
|
|
582
|
-
},
|
|
582
|
+
}, Cn = function(e) {
|
|
583
583
|
let t = null, r = null;
|
|
584
|
-
if (
|
|
584
|
+
if (Mt) e = "<remove></remove>" + e;
|
|
585
585
|
else {
|
|
586
586
|
let t = ae(e, /^[\r\n\t ]+/);
|
|
587
587
|
r = t && t[0];
|
|
588
588
|
}
|
|
589
|
-
|
|
590
|
-
let i =
|
|
591
|
-
if (
|
|
592
|
-
t = new u().parseFromString(i,
|
|
589
|
+
an === "application/xhtml+xml" && Yt === V && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
590
|
+
let i = k ? at(e) : e;
|
|
591
|
+
if (Yt === V) try {
|
|
592
|
+
t = new u().parseFromString(i, an);
|
|
593
593
|
} catch {}
|
|
594
594
|
if (!t || !t.documentElement) {
|
|
595
|
-
t =
|
|
595
|
+
t = lt.createDocument(Yt, "template", null);
|
|
596
596
|
try {
|
|
597
|
-
t.documentElement.innerHTML =
|
|
597
|
+
t.documentElement.innerHTML = Xt ? et : i;
|
|
598
598
|
} catch {}
|
|
599
599
|
}
|
|
600
600
|
let a = t.body || t.documentElement;
|
|
601
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
602
|
-
}, Sn = function(e) {
|
|
603
|
-
let t = me ? me(e) : e.ownerDocument;
|
|
604
|
-
return st.call(t || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
605
|
-
}, Cn = function(e) {
|
|
606
|
-
return e = oe(e, ut, " "), e = oe(e, dt, " "), e = oe(e, ft, " "), e;
|
|
601
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Yt === V ? ft.call(t, kt ? "html" : "body")[0] : kt ? t.documentElement : a;
|
|
607
602
|
}, wn = function(e) {
|
|
603
|
+
let t = ge ? ge(e) : e.ownerDocument;
|
|
604
|
+
return ut.call(t || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
605
|
+
}, Tn = function(e) {
|
|
606
|
+
return e = oe(e, pt, " "), e = oe(e, mt, " "), e = oe(e, ht, " "), e;
|
|
607
|
+
}, En = function(e) {
|
|
608
608
|
e.normalize();
|
|
609
|
-
let t =
|
|
610
|
-
for (; r;) r.data =
|
|
609
|
+
let t = ge ? ge(e) : e.ownerDocument, n = ut.call(t || e, e, l.SHOW_TEXT | l.SHOW_COMMENT | l.SHOW_CDATA_SECTION | l.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
610
|
+
for (; r;) r.data = Tn(r.data), r = n.nextNode();
|
|
611
611
|
let i = e.querySelectorAll?.call(e, "template");
|
|
612
612
|
i && y(i, (e) => {
|
|
613
|
-
|
|
613
|
+
K(e.content) && En(e.content);
|
|
614
614
|
});
|
|
615
|
-
},
|
|
616
|
-
let t =
|
|
617
|
-
return typeof t != "string" ||
|
|
618
|
-
},
|
|
619
|
-
if (!
|
|
615
|
+
}, G = function(e) {
|
|
616
|
+
let t = he ? he(e) : null;
|
|
617
|
+
return typeof t != "string" || H(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== pe(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== w(e) || e.childNodes !== ue(e);
|
|
618
|
+
}, K = function(e) {
|
|
619
|
+
if (!w || typeof e != "object" || !e) return !1;
|
|
620
620
|
try {
|
|
621
|
-
return
|
|
621
|
+
return w(e) === O.documentFragment;
|
|
622
622
|
} catch {
|
|
623
623
|
return !1;
|
|
624
624
|
}
|
|
625
|
-
},
|
|
626
|
-
if (!
|
|
625
|
+
}, Dn = function(e) {
|
|
626
|
+
if (!w || typeof e != "object" || !e) return !1;
|
|
627
627
|
try {
|
|
628
|
-
return typeof
|
|
628
|
+
return typeof w(e) == "number";
|
|
629
629
|
} catch {
|
|
630
630
|
return !1;
|
|
631
631
|
}
|
|
632
632
|
};
|
|
633
|
-
function
|
|
633
|
+
function q(e, n, r) {
|
|
634
634
|
e.length !== 0 && y(e, (e) => {
|
|
635
|
-
e.call(t, n, r,
|
|
635
|
+
e.call(t, n, r, U);
|
|
636
636
|
});
|
|
637
637
|
}
|
|
638
|
-
let
|
|
639
|
-
return !!(
|
|
640
|
-
},
|
|
641
|
-
return e instanceof RegExp ?
|
|
642
|
-
},
|
|
643
|
-
if (!
|
|
644
|
-
if (
|
|
645
|
-
let t =
|
|
638
|
+
let On = function(e, t) {
|
|
639
|
+
return !!(R && e.hasChildNodes() && !Dn(e.firstElementChild) && C(Be, e.textContent) && C(Be, e.innerHTML) || R && e.namespaceURI === V && Ge[t] && (Dn(e.firstElementChild) || typeof e.textContent == "string" && C(Ke[t], e.textContent)) || e.nodeType === O.processingInstruction || R && e.nodeType === O.comment && C(Ve, e.data));
|
|
640
|
+
}, J = function(e, t) {
|
|
641
|
+
return e instanceof RegExp ? C(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
642
|
+
}, kn = function(e, t, n) {
|
|
643
|
+
if (!F[t] && Fn(t) && J(P.tagNameCheck, t)) return !1;
|
|
644
|
+
if (Rt && !Vt[t]) {
|
|
645
|
+
let t = de(e), r = ue(e);
|
|
646
646
|
if (r && t) {
|
|
647
647
|
let i = r.length;
|
|
648
648
|
for (let a = i - 1; a >= 0; --a) {
|
|
@@ -651,35 +651,35 @@ function Xe() {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
return
|
|
655
|
-
},
|
|
656
|
-
return e.length === 0 ? t : t === n || t === r ?
|
|
657
|
-
},
|
|
658
|
-
return e === t ||
|
|
659
|
-
},
|
|
660
|
-
if (
|
|
661
|
-
if (
|
|
662
|
-
let r =
|
|
663
|
-
if (
|
|
654
|
+
return gn(e), !0;
|
|
655
|
+
}, An = function(e, t, n, r) {
|
|
656
|
+
return e.length === 0 ? t : t === n || t === r ? E(t) : t;
|
|
657
|
+
}, jn = function(e, t) {
|
|
658
|
+
return e === t || de(e) !== null ? !1 : (zt && bn(e), !0);
|
|
659
|
+
}, Mn = function(e, n) {
|
|
660
|
+
if (q(j.beforeSanitizeElements, e, null), jn(e, n)) return !0;
|
|
661
|
+
if (G(e)) return gn(e), !0;
|
|
662
|
+
let r = H($e(e));
|
|
663
|
+
if (M = An(j.uponSanitizeElement, M, St, z), q(j.uponSanitizeElement, e, {
|
|
664
664
|
tagName: r,
|
|
665
|
-
allowedTags:
|
|
666
|
-
}),
|
|
667
|
-
if (
|
|
668
|
-
if (
|
|
669
|
-
let t =
|
|
670
|
-
return t === !1 && (
|
|
671
|
-
}
|
|
672
|
-
if (
|
|
673
|
-
if (
|
|
674
|
-
let n =
|
|
665
|
+
allowedTags: M
|
|
666
|
+
}), jn(e, n)) return !0;
|
|
667
|
+
if (On(e, r)) return gn(e), !0;
|
|
668
|
+
if (F[r] || !(I.tagCheck instanceof Function && I.tagCheck(r)) && !M[r]) {
|
|
669
|
+
let t = kn(e, r, n);
|
|
670
|
+
return t === !1 && (q(j.afterSanitizeElements, e, null), jn(e, n)) ? !0 : t;
|
|
671
|
+
}
|
|
672
|
+
if (We(e) === O.element && !hn(e) || (r === "noscript" || r === "noembed" || r === "noframes") && C(He, e.innerHTML)) return gn(e), !0;
|
|
673
|
+
if (L && e.nodeType === O.text) {
|
|
674
|
+
let n = Tn(e.textContent);
|
|
675
675
|
e.textContent !== n && (ne(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
676
676
|
}
|
|
677
|
-
return
|
|
678
|
-
},
|
|
679
|
-
if (
|
|
680
|
-
let i =
|
|
681
|
-
return
|
|
682
|
-
},
|
|
677
|
+
return q(j.afterSanitizeElements, e, null), jn(e, n);
|
|
678
|
+
}, Nn = function(e, t, r) {
|
|
679
|
+
if (wt[t] || xn(t, e) || Ft && (t === "id" || t === "name") && (r in n || r in sn)) return !1;
|
|
680
|
+
let i = N[t] || I.attributeCheck instanceof Function && I.attributeCheck(t, e);
|
|
681
|
+
return Et && C(gt, t) || Tt && C(_t, t) ? !0 : i ? Gt[t] || C(xt, oe(r, yt, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && se(r, "data:") === 0 && Ut[e] || Dt && !C(vt, oe(r, yt, "")) ? !0 : !r : Fn(e) && J(P.tagNameCheck, e) && J(P.attributeNameCheck, t, e) || t === "is" && P.allowCustomizedBuiltInElements && J(P.tagNameCheck, r);
|
|
682
|
+
}, Pn = T({}, [
|
|
683
683
|
"annotation-xml",
|
|
684
684
|
"color-profile",
|
|
685
685
|
"font-face",
|
|
@@ -688,67 +688,67 @@ function Xe() {
|
|
|
688
688
|
"font-face-src",
|
|
689
689
|
"font-face-uri",
|
|
690
690
|
"missing-glyph"
|
|
691
|
-
]),
|
|
692
|
-
return !
|
|
693
|
-
},
|
|
694
|
-
if (
|
|
695
|
-
case "TrustedHTML": return
|
|
696
|
-
case "TrustedScriptURL": return
|
|
691
|
+
]), Fn = function(e) {
|
|
692
|
+
return !Pn[b(e)] && C(bt, e);
|
|
693
|
+
}, In = function(e, t, n, r) {
|
|
694
|
+
if (k && typeof d == "object" && typeof d.getAttributeType == "function" && !n) switch (d.getAttributeType(e, t)) {
|
|
695
|
+
case "TrustedHTML": return at(r);
|
|
696
|
+
case "TrustedScriptURL": return ot(r);
|
|
697
697
|
}
|
|
698
698
|
return r;
|
|
699
|
-
},
|
|
699
|
+
}, Ln = function(e, t, n, r) {
|
|
700
700
|
try {
|
|
701
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r),
|
|
701
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), G(e) ? (gn(e), !1) : !0;
|
|
702
702
|
} catch {
|
|
703
|
-
return
|
|
703
|
+
return W(t, e), !1;
|
|
704
704
|
}
|
|
705
|
-
},
|
|
706
|
-
if (
|
|
705
|
+
}, Rn = function(e, n) {
|
|
706
|
+
if (q(j.beforeSanitizeAttributes, e, null), jn(e, n)) return;
|
|
707
707
|
let r = e.attributes;
|
|
708
|
-
if (!r ||
|
|
709
|
-
|
|
708
|
+
if (!r || G(e)) return;
|
|
709
|
+
N = An(j.uponSanitizeAttribute, N, Ct, jt);
|
|
710
710
|
let i = {
|
|
711
711
|
attrName: "",
|
|
712
712
|
attrValue: "",
|
|
713
713
|
keepAttr: !0,
|
|
714
|
-
allowedAttributes:
|
|
714
|
+
allowedAttributes: N,
|
|
715
715
|
forceKeepAttr: void 0
|
|
716
|
-
}, a = r.length, o =
|
|
716
|
+
}, a = r.length, o = H(e.nodeName);
|
|
717
717
|
for (; a--;) {
|
|
718
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
719
|
-
if (i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0,
|
|
720
|
-
|
|
718
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = H(s), d = l, f = s === "value" ? d : ce(d), p = !1;
|
|
719
|
+
if (i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, q(j.uponSanitizeAttribute, e, i), f = i.attrValue, It && (u === "id" || u === "name") && se(f, Lt) !== 0 && (W(s, e, n), f = Lt + f, p = !0), R && C(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f)) {
|
|
720
|
+
W(s, e, n);
|
|
721
721
|
continue;
|
|
722
722
|
}
|
|
723
723
|
if (u === "attributename" && ae(f, "href")) {
|
|
724
|
-
|
|
724
|
+
W(s, e, n);
|
|
725
725
|
continue;
|
|
726
726
|
}
|
|
727
727
|
if (!i.forceKeepAttr) {
|
|
728
728
|
if (!i.keepAttr) {
|
|
729
|
-
|
|
729
|
+
W(s, e, n);
|
|
730
730
|
continue;
|
|
731
731
|
}
|
|
732
|
-
if (!
|
|
733
|
-
|
|
732
|
+
if (!Ot && C(Ue, f)) {
|
|
733
|
+
W(s, e, n);
|
|
734
734
|
continue;
|
|
735
735
|
}
|
|
736
|
-
if (
|
|
737
|
-
|
|
736
|
+
if (L && (f = Tn(f)), !Nn(o, u, f)) {
|
|
737
|
+
W(s, e, n);
|
|
738
738
|
continue;
|
|
739
739
|
}
|
|
740
|
-
f =
|
|
740
|
+
f = In(o, u, c, f), f !== d && Ln(e, s, c, f) && p && te(t.removed);
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
|
|
744
|
-
},
|
|
745
|
-
let t = null, n =
|
|
746
|
-
for (
|
|
747
|
-
let e =
|
|
748
|
-
|
|
743
|
+
q(j.afterSanitizeAttributes, e, null), jn(e, n);
|
|
744
|
+
}, zn = function(e) {
|
|
745
|
+
let t = null, n = wn(e);
|
|
746
|
+
for (q(j.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (q(j.uponSanitizeShadowNode, t, null), Mn(t, e), Rn(t, e), K(t.content) && zn(t.content), We(t) === O.element) {
|
|
747
|
+
let e = fe(t);
|
|
748
|
+
K(e) && (Bn(e), zn(e));
|
|
749
749
|
}
|
|
750
|
-
|
|
751
|
-
},
|
|
750
|
+
q(j.afterSanitizeShadowDOM, e, null);
|
|
751
|
+
}, Bn = function(e) {
|
|
752
752
|
let t = [{
|
|
753
753
|
node: e,
|
|
754
754
|
shadow: null
|
|
@@ -756,27 +756,27 @@ function Xe() {
|
|
|
756
756
|
for (; t.length > 0;) {
|
|
757
757
|
let e = t.pop();
|
|
758
758
|
if (e.shadow) {
|
|
759
|
-
|
|
759
|
+
zn(e.shadow);
|
|
760
760
|
continue;
|
|
761
761
|
}
|
|
762
|
-
let n = e.node, r =
|
|
762
|
+
let n = e.node, r = We(n) === O.element, i = ue(n);
|
|
763
763
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
764
764
|
node: i[e],
|
|
765
765
|
shadow: null
|
|
766
766
|
});
|
|
767
767
|
if (r) {
|
|
768
|
-
let e =
|
|
769
|
-
if (typeof e == "string" &&
|
|
768
|
+
let e = he ? he(n) : null;
|
|
769
|
+
if (typeof e == "string" && H(e) === "template") {
|
|
770
770
|
let e = n.content;
|
|
771
|
-
|
|
771
|
+
K(e) && t.push({
|
|
772
772
|
node: e,
|
|
773
773
|
shadow: null
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
if (r) {
|
|
778
|
-
let e =
|
|
779
|
-
|
|
778
|
+
let e = fe(n);
|
|
779
|
+
K(e) && t.push({
|
|
780
780
|
node: null,
|
|
781
781
|
shadow: e
|
|
782
782
|
}, {
|
|
@@ -788,83 +788,83 @@ function Xe() {
|
|
|
788
788
|
};
|
|
789
789
|
return t.sanitize = function(e) {
|
|
790
790
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
791
|
-
if (
|
|
791
|
+
if (Xt = !e, Xt && (e = "<!-->"), typeof e != "string" && !Dn(e) && (e = _e(e), typeof e != "string")) throw me("dirty is not a string, aborting");
|
|
792
792
|
if (!t.isSupported) return e;
|
|
793
|
-
|
|
794
|
-
let c =
|
|
793
|
+
At ? (M = z, N = jt) : ln(n), (j.uponSanitizeElement.length > 0 || j.uponSanitizeAttribute.length > 0) && (M = E(M)), j.uponSanitizeAttribute.length > 0 && (N = E(N)), t.removed = [];
|
|
794
|
+
let c = zt && typeof e != "string" && Dn(e);
|
|
795
795
|
if (c) {
|
|
796
|
-
|
|
797
|
-
let t =
|
|
796
|
+
Sn(e);
|
|
797
|
+
let t = $e(e);
|
|
798
798
|
if (typeof t == "string") {
|
|
799
|
-
let n =
|
|
800
|
-
if (!
|
|
799
|
+
let n = H(t);
|
|
800
|
+
if (!M[n] || F[n]) throw vn(e), me("root node is forbidden and cannot be sanitized in-place");
|
|
801
801
|
}
|
|
802
|
-
if (
|
|
802
|
+
if (G(e)) throw vn(e), me("root node is clobbered and cannot be sanitized in-place");
|
|
803
803
|
try {
|
|
804
|
-
|
|
804
|
+
Bn(e);
|
|
805
805
|
} catch (t) {
|
|
806
|
-
throw
|
|
806
|
+
throw vn(e), t;
|
|
807
807
|
}
|
|
808
|
-
} else if (
|
|
808
|
+
} else if (Dn(e)) i = Cn("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === O.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Bn(i);
|
|
809
809
|
else {
|
|
810
|
-
if (!
|
|
811
|
-
if (i =
|
|
810
|
+
if (!B && !L && !kt && e.indexOf("<") === -1) return k && Pt ? at(e) : e;
|
|
811
|
+
if (i = Cn(e), !i) return B ? null : Pt ? et : "";
|
|
812
812
|
}
|
|
813
|
-
i &&
|
|
813
|
+
i && Mt && gn(i.firstChild);
|
|
814
814
|
let l = c ? e : i;
|
|
815
815
|
try {
|
|
816
|
-
let e =
|
|
817
|
-
for (; o = e.nextNode();)
|
|
816
|
+
let e = wn(l);
|
|
817
|
+
for (; o = e.nextNode();) Mn(o, l), Rn(o, l), K(o.content) && zn(o.content);
|
|
818
818
|
} catch (n) {
|
|
819
|
-
throw c && (
|
|
820
|
-
e.element &&
|
|
819
|
+
throw c && (vn(e), y(t.removed, (e) => {
|
|
820
|
+
e.element && bn(e.element);
|
|
821
821
|
})), n;
|
|
822
822
|
}
|
|
823
823
|
if (c) {
|
|
824
824
|
let n = !1;
|
|
825
825
|
if (y(t.removed, (t) => {
|
|
826
|
-
t.element && (t.element === e && (n = !0),
|
|
827
|
-
}), n) throw
|
|
828
|
-
return
|
|
826
|
+
t.element && (t.element === e && (n = !0), bn(t.element));
|
|
827
|
+
}), n) throw me("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
828
|
+
return L && En(e), e;
|
|
829
829
|
}
|
|
830
|
-
if (
|
|
831
|
-
if (
|
|
830
|
+
if (B) {
|
|
831
|
+
if (L && En(i), Nt) for (s = dt.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
832
832
|
else s = i;
|
|
833
|
-
return (
|
|
833
|
+
return (N.shadowroot || N.shadowrootmode) && (s = A.call(r, s, !0)), s;
|
|
834
834
|
}
|
|
835
|
-
let u =
|
|
836
|
-
return
|
|
835
|
+
let u = kt ? i.outerHTML : i.innerHTML;
|
|
836
|
+
return kt && M["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && C(Re, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), L && (u = Tn(u)), k && Pt ? at(u) : u;
|
|
837
837
|
}, t.setConfig = function() {
|
|
838
838
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
839
|
-
|
|
839
|
+
ln(e), At = !0, z = M, jt = N;
|
|
840
840
|
}, t.clearConfig = function() {
|
|
841
|
-
|
|
841
|
+
U = null, At = !1, z = null, jt = null, k = tt, et = "";
|
|
842
842
|
}, t.isValidAttribute = function(e, t, n) {
|
|
843
|
-
|
|
844
|
-
let r =
|
|
845
|
-
return
|
|
843
|
+
U || ln({});
|
|
844
|
+
let r = H(e), i = H(t);
|
|
845
|
+
return Nn(r, i, n);
|
|
846
846
|
}, t.addHook = function(e, t) {
|
|
847
|
-
typeof t == "function" &&
|
|
847
|
+
typeof t == "function" && S(j, e) && ne(j[e], t);
|
|
848
848
|
}, t.removeHook = function(e, t) {
|
|
849
|
-
if (
|
|
849
|
+
if (S(j, e)) {
|
|
850
850
|
if (t !== void 0) {
|
|
851
|
-
let n = ee(
|
|
852
|
-
return n === -1 ? void 0 : re(
|
|
851
|
+
let n = ee(j[e], t);
|
|
852
|
+
return n === -1 ? void 0 : re(j[e], n, 1)[0];
|
|
853
853
|
}
|
|
854
|
-
return te(
|
|
854
|
+
return te(j[e]);
|
|
855
855
|
}
|
|
856
856
|
}, t.removeHooks = function(e) {
|
|
857
|
-
|
|
857
|
+
S(j, e) && (j[e] = []);
|
|
858
858
|
}, t.removeAllHooks = function() {
|
|
859
|
-
|
|
859
|
+
j = Ye();
|
|
860
860
|
}, t;
|
|
861
861
|
}
|
|
862
|
-
var
|
|
862
|
+
var $e = Qe(), k = "data-pie-authored-ink", et = "data-pie-authored-fill", tt = "data-pie-authored-border", nt = [
|
|
863
863
|
"border-top-color",
|
|
864
864
|
"border-right-color",
|
|
865
865
|
"border-bottom-color",
|
|
866
866
|
"border-left-color"
|
|
867
|
-
],
|
|
867
|
+
], rt = /* @__PURE__ */ new Set([
|
|
868
868
|
"currentcolor",
|
|
869
869
|
"inherit",
|
|
870
870
|
"initial",
|
|
@@ -873,35 +873,35 @@ var Ze = Xe(), j = "data-pie-authored-ink", M = "data-pie-authored-fill", Qe = "
|
|
|
873
873
|
"revert-layer",
|
|
874
874
|
"transparent"
|
|
875
875
|
]);
|
|
876
|
-
function
|
|
876
|
+
function it(e) {
|
|
877
877
|
let t = e?.trim().toLowerCase();
|
|
878
|
-
return !t ||
|
|
878
|
+
return !t || rt.has(t) || t.includes("var(") ? !1 : ct(t)?.a !== 0;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
881
|
-
let t =
|
|
880
|
+
function at(e) {
|
|
881
|
+
let t = ct(e);
|
|
882
882
|
if (!t) return "shade";
|
|
883
883
|
let n = (e) => (e * t.a + 255 * (1 - t.a)) / 255, [r, i, a] = [
|
|
884
884
|
n(t.r),
|
|
885
885
|
n(t.g),
|
|
886
886
|
n(t.b)
|
|
887
|
-
], o = .2126 *
|
|
887
|
+
], o = .2126 * P(r) + .7152 * P(i) + .0722 * P(a), s = Math.max(r, i, a) - Math.min(r, i, a);
|
|
888
888
|
return o >= .85 && s <= .08 ? "light" : "shade";
|
|
889
889
|
}
|
|
890
|
-
function
|
|
891
|
-
e.removeAttribute(
|
|
890
|
+
function ot(e) {
|
|
891
|
+
e.removeAttribute(k), e.removeAttribute(et), e.removeAttribute(tt);
|
|
892
892
|
let t = e.hasAttribute("style") ? e.style : void 0, n = (e) => t?.getPropertyValue(e).trim() ?? "", r = [], i = n("color"), a = e.localName === "font" ? e.getAttribute("color") : null;
|
|
893
|
-
|
|
894
|
-
let o = n("background-color"), s = o ||
|
|
895
|
-
|
|
896
|
-
let c =
|
|
893
|
+
it(i || a) && (e.setAttribute("data-pie-authored-ink", ""), i && r.push("color"));
|
|
894
|
+
let o = n("background-color"), s = o || st(e.getAttribute("bgcolor"));
|
|
895
|
+
it(s) && (e.setAttribute("data-pie-authored-fill", at(s)), o && r.push("background-color"));
|
|
896
|
+
let c = nt.filter((e) => it(n(e)));
|
|
897
897
|
c.length && (e.setAttribute("data-pie-authored-border", ""), r.push(...c));
|
|
898
898
|
for (let e of r) t?.getPropertyPriority(e) === "important" && t.setProperty(e, t.getPropertyValue(e));
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function st(e) {
|
|
901
901
|
let t = e?.trim() ?? "";
|
|
902
902
|
return /^(?:[\da-f]{3}|[\da-f]{6})$/i.test(t) ? `#${t}` : t;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function ct(e) {
|
|
905
905
|
let t = e.trim().toLowerCase();
|
|
906
906
|
if (t === "transparent") return {
|
|
907
907
|
r: 0,
|
|
@@ -909,14 +909,14 @@ function at(e) {
|
|
|
909
909
|
b: 0,
|
|
910
910
|
a: 0
|
|
911
911
|
};
|
|
912
|
-
let n =
|
|
913
|
-
if (n) return
|
|
914
|
-
if (t.startsWith("#")) return
|
|
912
|
+
let n = ut().get(t);
|
|
913
|
+
if (n) return dt(n);
|
|
914
|
+
if (t.startsWith("#")) return dt(t.slice(1));
|
|
915
915
|
let r = /^([a-z]+)\(([^()]*)\)$/.exec(t);
|
|
916
916
|
if (!r) return null;
|
|
917
917
|
let i = r[2].trim().split(/\s*[\s,/]\s*/);
|
|
918
918
|
if (i.length !== 3 && i.length !== 4) return null;
|
|
919
|
-
let [a, o, s, c] = i, l =
|
|
919
|
+
let [a, o, s, c] = i, l = pt(c), u;
|
|
920
920
|
switch (r[1]) {
|
|
921
921
|
case "rgb":
|
|
922
922
|
case "rgba":
|
|
@@ -924,31 +924,31 @@ function at(e) {
|
|
|
924
924
|
a,
|
|
925
925
|
o,
|
|
926
926
|
s
|
|
927
|
-
].map((e) =>
|
|
927
|
+
].map((e) => A(e, 255) / 255);
|
|
928
928
|
break;
|
|
929
929
|
case "hsl":
|
|
930
930
|
case "hsla":
|
|
931
|
-
u =
|
|
931
|
+
u = ht(j(a), A(o, 100) / 100, A(s, 100) / 100);
|
|
932
932
|
break;
|
|
933
933
|
case "hwb":
|
|
934
|
-
u =
|
|
934
|
+
u = gt(j(a), A(o, 100) / 100, A(s, 100) / 100);
|
|
935
935
|
break;
|
|
936
936
|
case "lab":
|
|
937
|
-
u =
|
|
937
|
+
u = M(A(a, 100), A(o, 125), A(s, 125));
|
|
938
938
|
break;
|
|
939
939
|
case "lch":
|
|
940
|
-
u =
|
|
940
|
+
u = M(A(a, 100), ...mt(A(o, 150), j(s)));
|
|
941
941
|
break;
|
|
942
942
|
case "oklab":
|
|
943
|
-
u =
|
|
943
|
+
u = St(A(a, 1), A(o, .4), A(s, .4));
|
|
944
944
|
break;
|
|
945
945
|
case "oklch":
|
|
946
|
-
u =
|
|
946
|
+
u = St(A(a, 1), ...mt(A(o, .4), j(s)));
|
|
947
947
|
break;
|
|
948
948
|
default: return null;
|
|
949
949
|
}
|
|
950
950
|
if (Number.isNaN(l) || u.some(Number.isNaN)) return null;
|
|
951
|
-
let [d, f, p] = u.map((e) =>
|
|
951
|
+
let [d, f, p] = u.map((e) => F(e, 0, 1) * 255);
|
|
952
952
|
return {
|
|
953
953
|
r: d,
|
|
954
954
|
g: f,
|
|
@@ -956,11 +956,11 @@ function at(e) {
|
|
|
956
956
|
a: l
|
|
957
957
|
};
|
|
958
958
|
}
|
|
959
|
-
var
|
|
960
|
-
function
|
|
961
|
-
return
|
|
959
|
+
var lt;
|
|
960
|
+
function ut() {
|
|
961
|
+
return lt ??= new Map("aliceblue:f0f8ff antiquewhite:faebd7 aqua:00ffff aquamarine:7fffd4 azure:f0ffff beige:f5f5dc bisque:ffe4c4 black:000000 blanchedalmond:ffebcd blue:0000ff blueviolet:8a2be2 brown:a52a2a burlywood:deb887 cadetblue:5f9ea0 chartreuse:7fff00 chocolate:d2691e coral:ff7f50 cornflowerblue:6495ed cornsilk:fff8dc crimson:dc143c cyan:00ffff darkblue:00008b darkcyan:008b8b darkgoldenrod:b8860b darkgray:a9a9a9 darkgreen:006400 darkgrey:a9a9a9 darkkhaki:bdb76b darkmagenta:8b008b darkolivegreen:556b2f darkorange:ff8c00 darkorchid:9932cc darkred:8b0000 darksalmon:e9967a darkseagreen:8fbc8f darkslateblue:483d8b darkslategray:2f4f4f darkslategrey:2f4f4f darkturquoise:00ced1 darkviolet:9400d3 deeppink:ff1493 deepskyblue:00bfff dimgray:696969 dimgrey:696969 dodgerblue:1e90ff firebrick:b22222 floralwhite:fffaf0 forestgreen:228b22 fuchsia:ff00ff gainsboro:dcdcdc ghostwhite:f8f8ff gold:ffd700 goldenrod:daa520 gray:808080 green:008000 greenyellow:adff2f grey:808080 honeydew:f0fff0 hotpink:ff69b4 indianred:cd5c5c indigo:4b0082 ivory:fffff0 khaki:f0e68c lavender:e6e6fa lavenderblush:fff0f5 lawngreen:7cfc00 lemonchiffon:fffacd lightblue:add8e6 lightcoral:f08080 lightcyan:e0ffff lightgoldenrodyellow:fafad2 lightgray:d3d3d3 lightgreen:90ee90 lightgrey:d3d3d3 lightpink:ffb6c1 lightsalmon:ffa07a lightseagreen:20b2aa lightskyblue:87cefa lightslategray:778899 lightslategrey:778899 lightsteelblue:b0c4de lightyellow:ffffe0 lime:00ff00 limegreen:32cd32 linen:faf0e6 magenta:ff00ff maroon:800000 mediumaquamarine:66cdaa mediumblue:0000cd mediumorchid:ba55d3 mediumpurple:9370db mediumseagreen:3cb371 mediumslateblue:7b68ee mediumspringgreen:00fa9a mediumturquoise:48d1cc mediumvioletred:c71585 midnightblue:191970 mintcream:f5fffa mistyrose:ffe4e1 moccasin:ffe4b5 navajowhite:ffdead navy:000080 oldlace:fdf5e6 olive:808000 olivedrab:6b8e23 orange:ffa500 orangered:ff4500 orchid:da70d6 palegoldenrod:eee8aa palegreen:98fb98 paleturquoise:afeeee palevioletred:db7093 papayawhip:ffefd5 peachpuff:ffdab9 peru:cd853f pink:ffc0cb plum:dda0dd powderblue:b0e0e6 purple:800080 rebeccapurple:663399 red:ff0000 rosybrown:bc8f8f royalblue:4169e1 saddlebrown:8b4513 salmon:fa8072 sandybrown:f4a460 seagreen:2e8b57 seashell:fff5ee sienna:a0522d silver:c0c0c0 skyblue:87ceeb slateblue:6a5acd slategray:708090 slategrey:708090 snow:fffafa springgreen:00ff7f steelblue:4682b4 tan:d2b48c teal:008080 thistle:d8bfd8 tomato:ff6347 turquoise:40e0d0 violet:ee82ee wheat:f5deb3 white:ffffff whitesmoke:f5f5f5 yellow:ffff00 yellowgreen:9acd32".split(" ").map((e) => e.split(":"))), lt;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function dt(e) {
|
|
964
964
|
if (!/^(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/.test(e)) return null;
|
|
965
965
|
let [t, n, r, i = 255] = (e.length <= 4 ? [...e].map((e) => e + e) : e.match(/../g) ?? []).map((e) => Number.parseInt(e, 16));
|
|
966
966
|
return {
|
|
@@ -970,28 +970,28 @@ function ct(e) {
|
|
|
970
970
|
a: i / 255
|
|
971
971
|
};
|
|
972
972
|
}
|
|
973
|
-
var
|
|
974
|
-
function
|
|
973
|
+
var ft = /^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%|deg|rad|grad|turn)?$/;
|
|
974
|
+
function A(e, t) {
|
|
975
975
|
if (e === "none") return 0;
|
|
976
|
-
let n =
|
|
976
|
+
let n = ft.exec(e);
|
|
977
977
|
return !n || n[2] && n[2] !== "%" ? NaN : n[2] ? Number(n[1]) / 100 * t : Number(n[1]);
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function j(e) {
|
|
980
980
|
if (e === "none") return 0;
|
|
981
|
-
let t =
|
|
981
|
+
let t = ft.exec(e);
|
|
982
982
|
if (!t || t[2] === "%") return NaN;
|
|
983
983
|
let n = Number(t[1]);
|
|
984
984
|
return ((t[2] === "rad" ? n * 180 / Math.PI : t[2] === "grad" ? n * .9 : t[2] === "turn" ? n * 360 : n) % 360 + 360) % 360;
|
|
985
985
|
}
|
|
986
|
-
function
|
|
987
|
-
return e === void 0 ? 1 :
|
|
986
|
+
function pt(e) {
|
|
987
|
+
return e === void 0 ? 1 : F(A(e, 1), 0, 1);
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function mt(e, t) {
|
|
990
990
|
let n = Math.max(0, e), r = t * Math.PI / 180;
|
|
991
991
|
return [n * Math.cos(r), n * Math.sin(r)];
|
|
992
992
|
}
|
|
993
|
-
function
|
|
994
|
-
let r =
|
|
993
|
+
function ht(e, t, n) {
|
|
994
|
+
let r = F(t, 0, 1), i = F(n, 0, 1), a = (t) => {
|
|
995
995
|
let n = (t + e / 30) % 12, a = r * Math.min(i, 1 - i);
|
|
996
996
|
return i - a * Math.max(-1, Math.min(n - 3, 9 - n, 1));
|
|
997
997
|
};
|
|
@@ -1001,19 +1001,19 @@ function ft(e, t, n) {
|
|
|
1001
1001
|
a(4)
|
|
1002
1002
|
];
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1005
|
-
let r =
|
|
1004
|
+
function gt(e, t, n) {
|
|
1005
|
+
let r = F(t, 0, 1), i = F(n, 0, 1);
|
|
1006
1006
|
return r + i >= 1 ? [
|
|
1007
1007
|
,
|
|
1008
1008
|
,
|
|
1009
1009
|
,
|
|
1010
|
-
].fill(r / (r + i)) :
|
|
1010
|
+
].fill(r / (r + i)) : ht(e, 1, .5).map((e) => e * (1 - r - i) + r);
|
|
1011
1011
|
}
|
|
1012
|
-
var
|
|
1012
|
+
var _t = 24389 / 27, vt = 216 / 24389, yt = [
|
|
1013
1013
|
.3457 / .3585,
|
|
1014
1014
|
1,
|
|
1015
1015
|
.2958 / .3585
|
|
1016
|
-
],
|
|
1016
|
+
], bt = [
|
|
1017
1017
|
[
|
|
1018
1018
|
.955473421488075,
|
|
1019
1019
|
-.02309845494876471,
|
|
@@ -1029,7 +1029,7 @@ var mt = 24389 / 27, ht = 216 / 24389, gt = [
|
|
|
1029
1029
|
-.020507649298898964,
|
|
1030
1030
|
1.330365926242124
|
|
1031
1031
|
]
|
|
1032
|
-
],
|
|
1032
|
+
], xt = [
|
|
1033
1033
|
[
|
|
1034
1034
|
12831 / 3959,
|
|
1035
1035
|
-329 / 214,
|
|
@@ -1046,17 +1046,17 @@ var mt = 24389 / 27, ht = 216 / 24389, gt = [
|
|
|
1046
1046
|
705 / 667
|
|
1047
1047
|
]
|
|
1048
1048
|
];
|
|
1049
|
-
function
|
|
1050
|
-
let r =
|
|
1051
|
-
return
|
|
1052
|
-
a ** 3 >
|
|
1053
|
-
r >
|
|
1054
|
-
o ** 3 >
|
|
1055
|
-
].map((e, t) => e *
|
|
1056
|
-
}
|
|
1057
|
-
function
|
|
1058
|
-
let r =
|
|
1059
|
-
return
|
|
1049
|
+
function M(e, t, n) {
|
|
1050
|
+
let r = F(e, 0, 100), i = (r + 16) / 116, a = t / 500 + i, o = i - n / 200;
|
|
1051
|
+
return N(xt, N(bt, [
|
|
1052
|
+
a ** 3 > vt ? a ** 3 : (116 * a - 16) / _t,
|
|
1053
|
+
r > _t * vt ? i ** 3 : r / _t,
|
|
1054
|
+
o ** 3 > vt ? o ** 3 : (116 * o - 16) / _t
|
|
1055
|
+
].map((e, t) => e * yt[t]))).map(Ct);
|
|
1056
|
+
}
|
|
1057
|
+
function St(e, t, n) {
|
|
1058
|
+
let r = F(e, 0, 1);
|
|
1059
|
+
return N([
|
|
1060
1060
|
[
|
|
1061
1061
|
4.0767416621,
|
|
1062
1062
|
-3.3077115913,
|
|
@@ -1076,22 +1076,22 @@ function yt(e, t, n) {
|
|
|
1076
1076
|
r + .3963377774 * t + .2158037573 * n,
|
|
1077
1077
|
r - .1055613458 * t - .0638541728 * n,
|
|
1078
1078
|
r - .0894841775 * t - 1.291485548 * n
|
|
1079
|
-
].map((e) => e ** 3)).map(
|
|
1079
|
+
].map((e) => e ** 3)).map(Ct);
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function N(e, t) {
|
|
1082
1082
|
return e.map((e) => e[0] * t[0] + e[1] * t[1] + e[2] * t[2]);
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1085
|
-
let t =
|
|
1084
|
+
function Ct(e) {
|
|
1085
|
+
let t = F(e, 0, 1);
|
|
1086
1086
|
return t <= .0031308 ? 12.92 * t : 1.055 * t ** (1 / 2.4) - .055;
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function P(e) {
|
|
1089
1089
|
return e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function F(e, t, n) {
|
|
1092
1092
|
return Math.min(n, Math.max(t, e));
|
|
1093
1093
|
}
|
|
1094
|
-
var
|
|
1094
|
+
var wt = [
|
|
1095
1095
|
"script",
|
|
1096
1096
|
"embed",
|
|
1097
1097
|
"base",
|
|
@@ -1100,7 +1100,7 @@ var xt = [
|
|
|
1100
1100
|
"link",
|
|
1101
1101
|
"style",
|
|
1102
1102
|
"foreignobject"
|
|
1103
|
-
],
|
|
1103
|
+
], I = [
|
|
1104
1104
|
"onerror",
|
|
1105
1105
|
"onload",
|
|
1106
1106
|
"onclick",
|
|
@@ -1118,7 +1118,7 @@ var xt = [
|
|
|
1118
1118
|
"onbeforeunload",
|
|
1119
1119
|
"formaction",
|
|
1120
1120
|
"xlink:href"
|
|
1121
|
-
],
|
|
1121
|
+
], Tt = /* @__PURE__ */ new Set([
|
|
1122
1122
|
"iframe",
|
|
1123
1123
|
"object",
|
|
1124
1124
|
"mstack",
|
|
@@ -1131,7 +1131,7 @@ var xt = [
|
|
|
1131
1131
|
"semantics",
|
|
1132
1132
|
"annotation",
|
|
1133
1133
|
"none"
|
|
1134
|
-
]),
|
|
1134
|
+
]), Et = /^[a-z_][\w.-]*:[a-z][\w.-]*$/, Dt = [
|
|
1135
1135
|
"alignment",
|
|
1136
1136
|
"target",
|
|
1137
1137
|
"allow",
|
|
@@ -1151,18 +1151,18 @@ var xt = [
|
|
|
1151
1151
|
"rightoverhang",
|
|
1152
1152
|
"mslinethickness",
|
|
1153
1153
|
"linebreak"
|
|
1154
|
-
],
|
|
1155
|
-
ADD_TAGS: (e) =>
|
|
1156
|
-
ADD_ATTR:
|
|
1157
|
-
FORBID_TAGS:
|
|
1158
|
-
FORBID_ATTR:
|
|
1154
|
+
], Ot = /^\s*document\.getElementById\((['"])([^'"]+)\1\)\.play\(\)\s*;?\s*(?:return\s+false\s*;?\s*)?$/, L = "data-pie-play-audio", R = {
|
|
1155
|
+
ADD_TAGS: (e) => Tt.has(e) || Et.test(e),
|
|
1156
|
+
ADD_ATTR: Dt,
|
|
1157
|
+
FORBID_TAGS: wt,
|
|
1158
|
+
FORBID_ATTR: I,
|
|
1159
1159
|
ALLOW_UNKNOWN_PROTOCOLS: !1,
|
|
1160
1160
|
RETURN_TRUSTED_TYPE: !1
|
|
1161
|
-
},
|
|
1162
|
-
function
|
|
1161
|
+
}, kt = !1;
|
|
1162
|
+
function At(e) {
|
|
1163
1163
|
for (let t of e.composedPath()) {
|
|
1164
1164
|
if (!(t instanceof Element)) continue;
|
|
1165
|
-
let n = t.getAttribute(
|
|
1165
|
+
let n = t.getAttribute(L);
|
|
1166
1166
|
if (n === null) continue;
|
|
1167
1167
|
e.preventDefault();
|
|
1168
1168
|
let r = t.getRootNode().getElementById?.(n) ?? document.getElementById(n);
|
|
@@ -1170,31 +1170,31 @@ function Ot(e) {
|
|
|
1170
1170
|
return;
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
|
-
var
|
|
1174
|
-
function
|
|
1175
|
-
return
|
|
1173
|
+
var z = null;
|
|
1174
|
+
function jt() {
|
|
1175
|
+
return z || (z = $e(window), z.addHook("beforeSanitizeAttributes", (e) => {
|
|
1176
1176
|
if (e.nodeName !== "A") return;
|
|
1177
|
-
let t =
|
|
1178
|
-
t !== void 0 && (e.removeAttribute("onclick"), e.setAttribute("data-pie-play-audio", t),
|
|
1179
|
-
}),
|
|
1180
|
-
}
|
|
1181
|
-
var
|
|
1182
|
-
function
|
|
1183
|
-
if (e == null || e === "" ||
|
|
1184
|
-
let t = typeof e == "string" ? e : String(e), n =
|
|
1177
|
+
let t = Ot.exec(e.getAttribute("onclick") ?? "")?.[2];
|
|
1178
|
+
t !== void 0 && (e.removeAttribute("onclick"), e.setAttribute("data-pie-play-audio", t), kt ||= (document.addEventListener("click", At), !0));
|
|
1179
|
+
}), z.addHook("afterSanitizeAttributes", ot), z);
|
|
1180
|
+
}
|
|
1181
|
+
var Mt = 1e6, B = /* @__PURE__ */ new Map(), Nt = 0;
|
|
1182
|
+
function Pt(e) {
|
|
1183
|
+
if (e == null || e === "" || !$e.isSupported) return "";
|
|
1184
|
+
let t = typeof e == "string" ? e : String(e), n = B.get(t);
|
|
1185
1185
|
if (n !== void 0) return n;
|
|
1186
|
-
let r = String(
|
|
1187
|
-
if (i >
|
|
1188
|
-
for (let [e, t] of
|
|
1189
|
-
if (
|
|
1190
|
-
|
|
1186
|
+
let r = String(jt().sanitize(t, R)), i = t.length + r.length;
|
|
1187
|
+
if (i > Mt) return r;
|
|
1188
|
+
for (let [e, t] of B) {
|
|
1189
|
+
if (Nt + i <= Mt) break;
|
|
1190
|
+
B.delete(e), Nt -= e.length + t.length;
|
|
1191
1191
|
}
|
|
1192
|
-
return
|
|
1192
|
+
return B.set(t, r), Nt += i, r;
|
|
1193
1193
|
}
|
|
1194
1194
|
//#endregion
|
|
1195
1195
|
//#region ../../shared/math-rendering-mathjax/dist/browser/speech-worker-CP5P4gRS.js
|
|
1196
|
-
var
|
|
1197
|
-
function
|
|
1196
|
+
var Ft = "4.1.3", It = "https://github.com/pie-framework/pie-elements-ng/blob/develop/docs/MATH-RENDERING.md#assets", Lt = "@pie-lib/math-rendering@2", Rt = ["nemeth", "euro"], zt = `mathjax@${Ft}/sre`, Bt = /^[^@]+@[^@]+$/;
|
|
1197
|
+
function Vt(e) {
|
|
1198
1198
|
if (!e) return;
|
|
1199
1199
|
let t;
|
|
1200
1200
|
try {
|
|
@@ -1207,16 +1207,16 @@ function zt(e) {
|
|
|
1207
1207
|
for (let e = n.length - 1; e > 0; e--) {
|
|
1208
1208
|
let r = n[e];
|
|
1209
1209
|
if (r === "node_modules") return;
|
|
1210
|
-
if (!
|
|
1210
|
+
if (!Bt.test(r)) continue;
|
|
1211
1211
|
let i = n[e - 1]?.startsWith("@") ? e - 1 : e;
|
|
1212
1212
|
return t.origin + n.slice(0, i).join("/");
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1216
|
-
let e = globalThis[
|
|
1215
|
+
function Ht() {
|
|
1216
|
+
let e = globalThis[Lt]?.opts;
|
|
1217
1217
|
return e && typeof e == "object" ? e : {};
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function Ut(e) {
|
|
1220
1220
|
if (typeof e != "string" || !e) return;
|
|
1221
1221
|
let t = typeof document > "u" ? void 0 : document.baseURI;
|
|
1222
1222
|
try {
|
|
@@ -1225,90 +1225,90 @@ function Vt(e) {
|
|
|
1225
1225
|
return;
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1228
|
+
function Wt(e) {
|
|
1229
1229
|
if (!e || typeof e != "object") return;
|
|
1230
1230
|
let t = /* @__PURE__ */ new Map();
|
|
1231
1231
|
for (let [n, r] of Object.entries(e)) {
|
|
1232
|
-
let e =
|
|
1232
|
+
let e = Ut(r);
|
|
1233
1233
|
e && t.set(n, e);
|
|
1234
1234
|
}
|
|
1235
1235
|
return t.size ? t : void 0;
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function Gt(e) {
|
|
1238
1238
|
if (Array.isArray(e)) return new Map(e.filter((e) => typeof e == "string").map((e) => [e, void 0]));
|
|
1239
1239
|
if (e && typeof e == "object") return new Map(Object.entries(e).map(([e, t]) => [e, typeof t == "string" ? t : void 0]));
|
|
1240
1240
|
}
|
|
1241
|
-
function
|
|
1242
|
-
let n =
|
|
1241
|
+
function Kt(e, t) {
|
|
1242
|
+
let n = Ht(), r = Ut(e.assetRoot ?? n.assetRoot) ?? Vt(t);
|
|
1243
1243
|
return {
|
|
1244
1244
|
root: r,
|
|
1245
|
-
speechPath:
|
|
1246
|
-
speechLocales:
|
|
1247
|
-
urls:
|
|
1245
|
+
speechPath: Ut(e.speechPath ?? n.speechPath) ?? (r ? `${r}/${zt}` : void 0),
|
|
1246
|
+
speechLocales: Gt(e.speechLocales ?? n.speechLocales),
|
|
1247
|
+
urls: Wt(e.assetUrls ?? n.assetUrls)
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function qt({ root: e, urls: t }, n) {
|
|
1251
1251
|
return t?.get(n) ?? (e ? `${e}/${n}` : void 0);
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1254
|
-
return t?.get(`${
|
|
1253
|
+
function Jt({ speechPath: e, urls: t }, n) {
|
|
1254
|
+
return t?.get(`${zt}/${n}`) ?? (e ? `${e}/${n}` : void 0);
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function V(e, t) {
|
|
1257
1257
|
if (!(!e || !t)) {
|
|
1258
|
-
for (let n of [...e.keys()]) !t.has(n) && !
|
|
1258
|
+
for (let n of [...e.keys()]) !t.has(n) && !Rt.includes(n) && e.delete(n);
|
|
1259
1259
|
for (let [n, r] of t) (r || !e.has(n)) && e.set(n, r ?? n);
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1263
|
-
if (!(!e || e.has("en"))) return [...e.keys()].find((e) => !
|
|
1262
|
+
function Yt(e) {
|
|
1263
|
+
if (!(!e || e.has("en"))) return [...e.keys()].find((e) => !Rt.includes(e));
|
|
1264
1264
|
}
|
|
1265
|
-
var
|
|
1265
|
+
var Xt = {
|
|
1266
1266
|
untypeset: "no MathJax loads, so math stays untypeset",
|
|
1267
1267
|
"no-web-fonts": "math renders without web fonts",
|
|
1268
1268
|
"no-web-fonts-or-speech": "math renders without web fonts and speech"
|
|
1269
|
-
},
|
|
1270
|
-
function
|
|
1269
|
+
}, Zt = Symbol.for("@pie-element/shared-math-rendering-mathjax/no-assets");
|
|
1270
|
+
function Qt(e) {
|
|
1271
1271
|
let t = globalThis;
|
|
1272
|
-
t[
|
|
1273
|
-
let n = t[
|
|
1272
|
+
t[Zt] ??= [];
|
|
1273
|
+
let n = t[Zt];
|
|
1274
1274
|
if (n.includes(e)) return;
|
|
1275
1275
|
n.push(e);
|
|
1276
|
-
let r = `[math-rendering] No asset root for MathJax: ${
|
|
1276
|
+
let r = `[math-rendering] No asset root for MathJax: ${Xt[e]}. Set window['${Lt}'].opts.assetRoot to an npm root. See ${It}`;
|
|
1277
1277
|
e === "untypeset" ? console.error(r) : console.warn(r), !(typeof window > "u") && window.dispatchEvent(new CustomEvent("pie-mathjax-no-asset-root", { detail: {
|
|
1278
1278
|
effect: e,
|
|
1279
1279
|
message: r,
|
|
1280
|
-
docsUrl:
|
|
1280
|
+
docsUrl: It
|
|
1281
1281
|
} }));
|
|
1282
1282
|
}
|
|
1283
|
-
var
|
|
1284
|
-
function
|
|
1283
|
+
var $t = Symbol.for("@pie-element/shared-math-rendering-mathjax/speech-worker-failed");
|
|
1284
|
+
function en() {
|
|
1285
1285
|
let e = globalThis;
|
|
1286
|
-
e[
|
|
1286
|
+
e[$t] || (e[$t] = !0, console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${It}`));
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1288
|
+
function tn(e) {
|
|
1289
1289
|
let t = e.webworker;
|
|
1290
1290
|
if (!t || t.ready) return;
|
|
1291
1291
|
e.options ??= {};
|
|
1292
1292
|
let n = e.options;
|
|
1293
|
-
n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(),
|
|
1293
|
+
n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(), en();
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1295
|
+
function nn(e) {
|
|
1296
1296
|
let t = e?.adaptor, n = t?.createWorker;
|
|
1297
1297
|
!e || !t || !n || (t.createWorker = async (r, i) => {
|
|
1298
1298
|
let a = await n.call(t, r, i);
|
|
1299
|
-
return a.addEventListener("error", () =>
|
|
1299
|
+
return a.addEventListener("error", () => tn(e), { once: !0 }), a;
|
|
1300
1300
|
});
|
|
1301
1301
|
}
|
|
1302
|
-
var
|
|
1303
|
-
function
|
|
1304
|
-
let t =
|
|
1302
|
+
var rn = `${zt}/mathmaps/`;
|
|
1303
|
+
function an(e) {
|
|
1304
|
+
let t = Jt(e, "speech-worker.js");
|
|
1305
1305
|
if (!t) return;
|
|
1306
1306
|
let n = e.speechPath ? `${e.speechPath}/mathmaps` : "mathmaps", r = {};
|
|
1307
|
-
for (let [t, i] of e.urls ?? []) t.startsWith(
|
|
1307
|
+
for (let [t, i] of e.urls ?? []) t.startsWith(rn) && (r[`${n}/${t.slice(rn.length)}`] = i);
|
|
1308
1308
|
let i = [`self.maps = ${JSON.stringify(n)};`];
|
|
1309
1309
|
return Object.keys(r).length && i.push("{", ` const urls = new Map(Object.entries(${JSON.stringify(r)}));`, " const fetchFile = self.fetch.bind(self);", " self.fetch = (input, init) => fetchFile(urls.get(input) ?? input, init);", "}"), i.push(`importScripts(${JSON.stringify(t)});`), i.join("\n");
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1311
|
+
function on(e, t) {
|
|
1312
1312
|
let n = URL.createObjectURL(new Blob([e], { type: "text/javascript" }));
|
|
1313
1313
|
try {
|
|
1314
1314
|
let e = new Worker(n);
|
|
@@ -1319,88 +1319,88 @@ function rn(e, t) {
|
|
|
1319
1319
|
}
|
|
1320
1320
|
//#endregion
|
|
1321
1321
|
//#region ../../shared/math-rendering-mathjax/dist/browser/index.js
|
|
1322
|
-
var
|
|
1323
|
-
function
|
|
1324
|
-
return
|
|
1325
|
-
}
|
|
1326
|
-
var
|
|
1327
|
-
|
|
1328
|
-
async function
|
|
1329
|
-
let { createMathJax: n } = await
|
|
1330
|
-
return
|
|
1331
|
-
}
|
|
1332
|
-
var
|
|
1333
|
-
function
|
|
1322
|
+
var H;
|
|
1323
|
+
function U() {
|
|
1324
|
+
return H;
|
|
1325
|
+
}
|
|
1326
|
+
var sn = import("./mathjax-BKrHE4xs-BTRY2LLA.js");
|
|
1327
|
+
sn.catch(() => {});
|
|
1328
|
+
async function cn(e, t) {
|
|
1329
|
+
let { createMathJax: n } = await sn;
|
|
1330
|
+
return H = n(e, t, fn), (e.startup?.ready ?? H.startup?.defaultReady)?.(), !0;
|
|
1331
|
+
}
|
|
1332
|
+
var ln = {}, un = Symbol.for("@pie-element/shared-math-rendering-mathjax/bundled");
|
|
1333
|
+
function dn() {
|
|
1334
1334
|
let e = globalThis;
|
|
1335
|
-
return e[
|
|
1335
|
+
return e[un] = (e[un] ?? 0) + 1, e[un];
|
|
1336
1336
|
}
|
|
1337
|
-
var
|
|
1338
|
-
function
|
|
1337
|
+
var fn = dn(), pn = `PIE-MJX-CHTML-styles-${fn}`, mn = ["MJX-CHTML-styles"], hn = "http://www.w3.org/1998/Math/MathML", gn = /^([a-z_][\w.-]*):math$/, _n = /^[a-z][a-z0-9-]*$/;
|
|
1338
|
+
function vn(e) {
|
|
1339
1339
|
for (let t of e.querySelectorAll("*")) {
|
|
1340
|
-
let n =
|
|
1341
|
-
!n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(
|
|
1340
|
+
let n = gn.exec(t.tagName.toLowerCase())?.[1];
|
|
1341
|
+
!n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(W(t, `${n}:`));
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function W(e, t) {
|
|
1345
1345
|
let n = e.tagName.toLowerCase().slice(t.length);
|
|
1346
|
-
if (!
|
|
1347
|
-
let r = e.ownerDocument.createElementNS(
|
|
1346
|
+
if (!_n.test(n)) return e;
|
|
1347
|
+
let r = e.ownerDocument.createElementNS(hn, n);
|
|
1348
1348
|
for (let t of e.attributes) r.setAttribute(t.name, t.value);
|
|
1349
1349
|
for (let n of [...e.childNodes]) {
|
|
1350
1350
|
let e = n instanceof Element && n.tagName.toLowerCase().startsWith(t);
|
|
1351
|
-
r.appendChild(e ?
|
|
1351
|
+
r.appendChild(e ? W(n, t) : n);
|
|
1352
1352
|
}
|
|
1353
1353
|
return r;
|
|
1354
1354
|
}
|
|
1355
|
-
var
|
|
1355
|
+
var yn = /* @__PURE__ */ new Set([
|
|
1356
1356
|
"updiagonalstrike",
|
|
1357
1357
|
"downdiagonalstrike",
|
|
1358
1358
|
"verticalstrike",
|
|
1359
1359
|
"horizontalstrike"
|
|
1360
|
-
]),
|
|
1360
|
+
]), bn = {
|
|
1361
1361
|
thin: "0.035em",
|
|
1362
1362
|
medium: "0.07em",
|
|
1363
1363
|
thick: "0.14em"
|
|
1364
|
-
},
|
|
1364
|
+
}, xn = {
|
|
1365
1365
|
tight: "0em",
|
|
1366
1366
|
medium: "0.1em",
|
|
1367
1367
|
loose: "0.2em"
|
|
1368
|
-
},
|
|
1368
|
+
}, Sn = /^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/, Cn = /^(#[0-9a-f]{3,8}|[a-z]+)$/i, wn = /^(\d+(\.\d*)?|\.\d+)$/, Tn = /* @__PURE__ */ new Set([
|
|
1369
1369
|
"mn",
|
|
1370
1370
|
"mo",
|
|
1371
1371
|
"mi",
|
|
1372
1372
|
"mtext"
|
|
1373
|
-
]),
|
|
1373
|
+
]), En = /* @__PURE__ */ new Set([
|
|
1374
1374
|
"stackalign",
|
|
1375
1375
|
"charalign",
|
|
1376
1376
|
"charspacing",
|
|
1377
1377
|
"longdivstyle"
|
|
1378
1378
|
]);
|
|
1379
|
-
function
|
|
1380
|
-
let i = e.createElementNS(
|
|
1379
|
+
function G(e, t, n = [], r = {}) {
|
|
1380
|
+
let i = e.createElementNS(hn, t);
|
|
1381
1381
|
for (let [e, t] of Object.entries(r)) i.setAttribute(e, t);
|
|
1382
1382
|
for (let e of n) e && i.appendChild(e);
|
|
1383
1383
|
return i;
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1386
|
-
let n =
|
|
1385
|
+
function K(e, t) {
|
|
1386
|
+
let n = G(e.document, "mo");
|
|
1387
1387
|
return n.textContent = t, n;
|
|
1388
1388
|
}
|
|
1389
|
-
function
|
|
1390
|
-
let t =
|
|
1391
|
-
return t.textContent = "0",
|
|
1389
|
+
function Dn(e) {
|
|
1390
|
+
let t = G(e.document, "mn");
|
|
1391
|
+
return t.textContent = "0", G(e.document, "mphantom", [t]);
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1393
|
+
function q(e, t) {
|
|
1394
1394
|
return e.getAttribute(t)?.trim().toLowerCase() || void 0;
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function On(e, t) {
|
|
1397
1397
|
let n = Number.parseInt(e.getAttribute(t) ?? "", 10);
|
|
1398
1398
|
return Number.isFinite(n) ? n : 0;
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1400
|
+
function J(e) {
|
|
1401
1401
|
return e.localName === "none" || e.localName === "mrow" && e.children.length === 0 && !e.textContent?.trim();
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function kn(e, t, n = e) {
|
|
1404
1404
|
switch (t) {
|
|
1405
1405
|
case "left": return 0;
|
|
1406
1406
|
case "center": return Math.floor(e / 2);
|
|
@@ -1408,14 +1408,14 @@ function Dn(e, t, n = e) {
|
|
|
1408
1408
|
default: return n;
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1411
|
+
function An(e, t, n) {
|
|
1412
1412
|
let r = [], i, a, o = (e, t) => {
|
|
1413
1413
|
let s = (e) => t.reduceRight((e, t) => {
|
|
1414
1414
|
let n = t.cloneNode(!1);
|
|
1415
1415
|
return n.appendChild(e), n;
|
|
1416
1416
|
}, e);
|
|
1417
1417
|
if (e.localName === "mstyle") for (let n of [...e.children]) o(n, [...t, e]);
|
|
1418
|
-
else if (
|
|
1418
|
+
else if (J(e)) r.push(null);
|
|
1419
1419
|
else if (e.localName === "mn" && e.children.length === 0) {
|
|
1420
1420
|
let t = [...(e.textContent ?? "").trim()];
|
|
1421
1421
|
for (let a of t) {
|
|
@@ -1424,28 +1424,28 @@ function On(e, t, n) {
|
|
|
1424
1424
|
t.textContent = a, r.push(s(t));
|
|
1425
1425
|
}
|
|
1426
1426
|
t.length && (a ??= r.length);
|
|
1427
|
-
} else
|
|
1427
|
+
} else Tn.has(e.localName) && e.textContent?.trim() === n.decimalPoint && (i ??= r.length), r.push(s(e));
|
|
1428
1428
|
};
|
|
1429
1429
|
for (let t of e) o(t, []);
|
|
1430
1430
|
return {
|
|
1431
1431
|
kind: "digits",
|
|
1432
1432
|
cells: r,
|
|
1433
|
-
anchor:
|
|
1433
|
+
anchor: kn(r.length, n.stackAlign, i ?? a),
|
|
1434
1434
|
position: t
|
|
1435
1435
|
};
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1438
|
-
return (e ?? "").toLowerCase().split(/\s+/).filter((e) =>
|
|
1437
|
+
function jn(e) {
|
|
1438
|
+
return (e ?? "").toLowerCase().split(/\s+/).filter((e) => yn.has(e));
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1441
|
-
let n = [...e.children].filter((e) => !
|
|
1442
|
-
return n.length <= 1 ? n[0] ?? null :
|
|
1440
|
+
function Mn(e, t) {
|
|
1441
|
+
let n = [...e.children].filter((e) => !J(e));
|
|
1442
|
+
return n.length <= 1 ? n[0] ?? null : G(t.document, "mrow", n);
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1445
|
-
let r =
|
|
1446
|
-
content:
|
|
1447
|
-
location:
|
|
1448
|
-
crossout: e.hasAttribute("crossout") ?
|
|
1444
|
+
function Nn(e, t, n) {
|
|
1445
|
+
let r = q(e, "location") ?? "n", i = jn(e.getAttribute("crossout")), a = [...e.children].map((e) => J(e) ? null : e.localName === "mscarry" ? {
|
|
1446
|
+
content: Mn(e, n),
|
|
1447
|
+
location: q(e, "location") ?? r,
|
|
1448
|
+
crossout: e.hasAttribute("crossout") ? jn(e.getAttribute("crossout")) : i
|
|
1449
1449
|
} : {
|
|
1450
1450
|
content: e,
|
|
1451
1451
|
location: r,
|
|
@@ -1454,60 +1454,60 @@ function jn(e, t, n) {
|
|
|
1454
1454
|
return {
|
|
1455
1455
|
kind: "carries",
|
|
1456
1456
|
carries: a,
|
|
1457
|
-
anchor:
|
|
1457
|
+
anchor: kn(a.length, n.stackAlign),
|
|
1458
1458
|
position: t,
|
|
1459
|
-
scale:
|
|
1459
|
+
scale: wn.test(o) ? o : "0.6"
|
|
1460
1460
|
};
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1463
|
-
let t =
|
|
1464
|
-
return `${n} solid ${
|
|
1462
|
+
function Pn(e) {
|
|
1463
|
+
let t = q(e, "mslinethickness") ?? "medium", n = bn[t] ?? (Sn.test(t) ? t : "0.07em"), r = e.getAttribute("mathcolor")?.trim() ?? "";
|
|
1464
|
+
return `${n} solid ${Cn.test(r) ? r : "currentColor"}`;
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1467
|
-
let r = Math.max(0,
|
|
1466
|
+
function Fn(e, t, n) {
|
|
1467
|
+
let r = Math.max(0, On(e, "length"));
|
|
1468
1468
|
return {
|
|
1469
1469
|
kind: "line",
|
|
1470
1470
|
length: r,
|
|
1471
|
-
anchor:
|
|
1471
|
+
anchor: kn(r, n.stackAlign),
|
|
1472
1472
|
position: t,
|
|
1473
|
-
border:
|
|
1473
|
+
border: Pn(e)
|
|
1474
1474
|
};
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function In(e, t, n, r, i) {
|
|
1477
1477
|
e.forEach((e, a) => {
|
|
1478
|
-
let o = t + a * n +
|
|
1478
|
+
let o = t + a * n + On(e, "position");
|
|
1479
1479
|
switch (e.localName) {
|
|
1480
1480
|
case "msgroup":
|
|
1481
|
-
|
|
1481
|
+
In([...e.children], o, On(e, "shift"), r, i);
|
|
1482
1482
|
break;
|
|
1483
1483
|
case "msline":
|
|
1484
|
-
i.push(
|
|
1484
|
+
i.push(Fn(e, o, r));
|
|
1485
1485
|
break;
|
|
1486
1486
|
case "mscarries":
|
|
1487
|
-
i.push(
|
|
1487
|
+
i.push(Nn(e, o, r));
|
|
1488
1488
|
break;
|
|
1489
1489
|
case "msrow":
|
|
1490
1490
|
case "mrow":
|
|
1491
|
-
i.push(
|
|
1491
|
+
i.push(An([...e.children], o, r));
|
|
1492
1492
|
break;
|
|
1493
|
-
default: i.push(
|
|
1493
|
+
default: i.push(An([e], o, r));
|
|
1494
1494
|
}
|
|
1495
1495
|
});
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function Ln(e) {
|
|
1498
1498
|
return -e.anchor - e.position;
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function Rn(e) {
|
|
1501
1501
|
return e.kind === "digits" ? e.cells.length : e.kind === "carries" ? e.carries.length : e.length;
|
|
1502
1502
|
}
|
|
1503
|
-
function
|
|
1504
|
-
return
|
|
1503
|
+
function zn(e) {
|
|
1504
|
+
return Ln(e) + Rn(e) - 1;
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1507
|
-
let i = (e) =>
|
|
1506
|
+
function Bn(e, t, n, r) {
|
|
1507
|
+
let i = (e) => G(r.document, "mpadded", [t], {
|
|
1508
1508
|
width: "0",
|
|
1509
1509
|
...e ? { lspace: e } : {}
|
|
1510
|
-
}), a = (e, t) =>
|
|
1510
|
+
}), a = (e, t) => G(r.document, e, t);
|
|
1511
1511
|
switch (n) {
|
|
1512
1512
|
case "s": return a("munder", [e, i("-0.5width")]);
|
|
1513
1513
|
case "ne": return a("msup", [e, i()]);
|
|
@@ -1529,49 +1529,49 @@ function Rn(e, t, n, r) {
|
|
|
1529
1529
|
default: return a("mover", [e, i("-0.5width")]);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1533
|
-
let r =
|
|
1532
|
+
function Vn(e, t, n) {
|
|
1533
|
+
let r = G(n.document, "menclose", [e], {
|
|
1534
1534
|
notation: t.join(" "),
|
|
1535
1535
|
"data-padding": "0.1em",
|
|
1536
1536
|
"data-thickness": "0.067em"
|
|
1537
1537
|
}), i = t.some((e) => e.endsWith("diagonalstrike")) ? .167 : t.includes("horizontalstrike") ? .1 : 0;
|
|
1538
|
-
return i ?
|
|
1538
|
+
return i ? G(n.document, "mpadded", [r], {
|
|
1539
1539
|
lspace: `-${i}em`,
|
|
1540
1540
|
width: `-${2 * i}em`
|
|
1541
1541
|
}) : r;
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1544
|
-
let a = e && t.crossout.length ?
|
|
1543
|
+
function Hn(e, t, n, r, i) {
|
|
1544
|
+
let a = e && t.crossout.length ? Vn(e, t.crossout, i) : e;
|
|
1545
1545
|
if (!t.content) return a;
|
|
1546
|
-
let o =
|
|
1547
|
-
return
|
|
1546
|
+
let o = G(i.document, "mstyle", [t.content], { scriptsizemultiplier: r });
|
|
1547
|
+
return Bn(a ?? Dn(i), o, n, i);
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1550
|
-
return e.carries[t -
|
|
1549
|
+
function Un(e, t) {
|
|
1550
|
+
return e.carries[t - Ln(e)] ?? null;
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1552
|
+
function Wn(e, t, n, r) {
|
|
1553
1553
|
let i = e.content;
|
|
1554
1554
|
n.forEach((e, a) => {
|
|
1555
|
-
let o = n.length - 1 - a, s = n[o], c =
|
|
1555
|
+
let o = n.length - 1 - a, s = n[o], c = Un(s, t), l = n.slice(0, o).some((e) => Un(e, t));
|
|
1556
1556
|
if (!c && !l) return;
|
|
1557
1557
|
let u = c ?? {
|
|
1558
|
-
content:
|
|
1558
|
+
content: Dn(r),
|
|
1559
1559
|
location: "n",
|
|
1560
1560
|
crossout: []
|
|
1561
1561
|
}, d = a === 0 ? u.location : "n";
|
|
1562
|
-
i =
|
|
1562
|
+
i = Hn(i, u, d, s.scale, r);
|
|
1563
1563
|
}), e.content = i;
|
|
1564
1564
|
}
|
|
1565
|
-
function
|
|
1566
|
-
let n = e.filter((e) =>
|
|
1565
|
+
function Gn(e, t) {
|
|
1566
|
+
let n = e.filter((e) => Rn(e) > 0), r = Math.min(0, ...n.map(Ln)), i = Math.max(r, ...n.map(zn)) - r + 1, a = -r, o = [], s = /* @__PURE__ */ new Map(), c = () => Array.from({ length: i }, () => ({
|
|
1567
1567
|
content: null,
|
|
1568
1568
|
borders: {}
|
|
1569
|
-
})), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a +
|
|
1569
|
+
})), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a + Ln(e) + n), u = [], d = [], f = (e) => {
|
|
1570
1570
|
let n = c();
|
|
1571
1571
|
e.cells.forEach((t, r) => {
|
|
1572
|
-
n[a +
|
|
1572
|
+
n[a + Ln(e) + r].content = t;
|
|
1573
1573
|
}), u.length && n.forEach((e, n) => {
|
|
1574
|
-
|
|
1574
|
+
Wn(e, n - a, u, t);
|
|
1575
1575
|
});
|
|
1576
1576
|
for (let e of d) for (let t of l(e)) n[t].borders.top = e.border;
|
|
1577
1577
|
u = [], d = [], s.set(e, o.length), o.push(n);
|
|
@@ -1591,44 +1591,44 @@ function Un(e, t) {
|
|
|
1591
1591
|
origin: a
|
|
1592
1592
|
};
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1595
|
-
let r =
|
|
1594
|
+
function Kn(e, { rows: t }, n) {
|
|
1595
|
+
let r = G(n.document, "mtable", t.map((e) => G(n.document, "mtr", e.map((e) => {
|
|
1596
1596
|
let t = Object.entries(e.borders).map(([e, t]) => `border-${e}:${t}`).join(";");
|
|
1597
|
-
return
|
|
1597
|
+
return G(n.document, "mtd", [e.content], {
|
|
1598
1598
|
...t ? { style: t } : {},
|
|
1599
1599
|
...e.align ? { columnalign: e.align } : {}
|
|
1600
1600
|
});
|
|
1601
1601
|
}))));
|
|
1602
|
-
for (let { name: t, value: n } of [...e.attributes])
|
|
1603
|
-
let i =
|
|
1604
|
-
return r.setAttribute("columnspacing",
|
|
1602
|
+
for (let { name: t, value: n } of [...e.attributes]) En.has(t) || r.setAttribute(t, n);
|
|
1603
|
+
let i = q(e, "charspacing") ?? "medium", a = q(e, "charalign");
|
|
1604
|
+
return r.setAttribute("columnspacing", xn[i] ?? (Sn.test(i) ? i : xn.medium)), r.setAttribute("columnalign", a === "left" || a === "center" ? a : "right"), r.setAttribute("rowspacing", "0"), r.setAttribute("align", e.getAttribute("align") ?? "baseline"), r;
|
|
1605
1605
|
}
|
|
1606
|
-
function
|
|
1606
|
+
function qn(e) {
|
|
1607
1607
|
return {
|
|
1608
1608
|
document: e.ownerDocument,
|
|
1609
|
-
stackAlign:
|
|
1609
|
+
stackAlign: q(e, "stackalign") ?? "decimalpoint",
|
|
1610
1610
|
decimalPoint: e.closest("[decimalpoint]")?.getAttribute("decimalpoint")?.trim().charAt(0) || "."
|
|
1611
1611
|
};
|
|
1612
1612
|
}
|
|
1613
|
-
function
|
|
1614
|
-
let t =
|
|
1615
|
-
return
|
|
1613
|
+
function Jn(e) {
|
|
1614
|
+
let t = qn(e), n = [];
|
|
1615
|
+
return In([...e.children], 0, 0, t, n), Kn(e, Gn(n, t), t);
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1617
|
+
function Yn(e, t, n, r, i, a) {
|
|
1618
1618
|
for (let o = n; o <= r; o++) e[t][o].borders[i] = a;
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1621
|
-
let n =
|
|
1622
|
-
return n.setAttribute("minsize", "1.2em"), [
|
|
1620
|
+
function Xn(e, t) {
|
|
1621
|
+
let n = K(t, ")");
|
|
1622
|
+
return n.setAttribute("minsize", "1.2em"), [G(t.document, "mrow", [e, G(t.document, "mspace", [], { width: "0.2em" })]), G(t.document, "mpadded", [n], {
|
|
1623
1623
|
voffset: "0.1em",
|
|
1624
1624
|
lspace: "-0.15em",
|
|
1625
1625
|
depth: "-0.2em",
|
|
1626
1626
|
height: "-0.2em"
|
|
1627
1627
|
})];
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1630
|
-
let t =
|
|
1631
|
-
|
|
1629
|
+
function Zn(e) {
|
|
1630
|
+
let t = qn(e), [n, r, ...i] = [...e.children], a = n && !J(n) ? n : null, o = r && !J(r) ? r : null, s = q(e, "longdivstyle") ?? "lefttop", c = Pn(e), l = [];
|
|
1631
|
+
In(i, 0, 0, t, l);
|
|
1632
1632
|
let u = l.find((e) => e.kind === "digits");
|
|
1633
1633
|
u || (u = {
|
|
1634
1634
|
kind: "digits",
|
|
@@ -1640,51 +1640,51 @@ function Yn(e) {
|
|
|
1640
1640
|
u.cells.unshift(...e), u.anchor += e.length;
|
|
1641
1641
|
}, p = (...e) => {
|
|
1642
1642
|
let n = e.flatMap((e) => e ? e.localName === "mrow" ? [...e.children] : [e] : []);
|
|
1643
|
-
u.cells.push(...
|
|
1643
|
+
u.cells.push(...An(n, 0, t).cells);
|
|
1644
1644
|
};
|
|
1645
1645
|
switch (s) {
|
|
1646
1646
|
case "left/\\right":
|
|
1647
|
-
f(a,
|
|
1647
|
+
f(a, K(t, "/")), p(K(t, "\\"), o);
|
|
1648
1648
|
break;
|
|
1649
1649
|
case "left)(right":
|
|
1650
|
-
f(a,
|
|
1650
|
+
f(a, K(t, ")")), p(K(t, "("), o);
|
|
1651
1651
|
break;
|
|
1652
1652
|
case ":right=right":
|
|
1653
|
-
p(
|
|
1653
|
+
p(K(t, ":"), a, K(t, "="), o);
|
|
1654
1654
|
break;
|
|
1655
1655
|
case "righttop":
|
|
1656
1656
|
case "stackedleftlinetop":
|
|
1657
1657
|
case "lefttop":
|
|
1658
|
-
o &&
|
|
1658
|
+
o && In([o], 0, 0, t, d), l.splice(l.indexOf(u), 0, ...d), s === "righttop" ? p(a) : s === "stackedleftlinetop" ? f(a) : f(...Xn(a, t));
|
|
1659
1659
|
break;
|
|
1660
1660
|
}
|
|
1661
|
-
let m =
|
|
1661
|
+
let m = Gn(l, t), h = m.rows, g = m.rowOf.get(u) ?? 0, _ = (e) => m.origin + Ln(u) + e, v = Math.max(_(u.cells.length - 1), ...d.map((e) => m.origin + zn(e)));
|
|
1662
1662
|
switch (s) {
|
|
1663
1663
|
case "left/\\right":
|
|
1664
1664
|
case "left)(right":
|
|
1665
1665
|
case ":right=right": break;
|
|
1666
1666
|
case "righttop": {
|
|
1667
1667
|
let e = h[g][_(u.cells.length - 1)];
|
|
1668
|
-
e.borders.left = c, e.borders.bottom = c,
|
|
1668
|
+
e.borders.left = c, e.borders.bottom = c, Yn(h, g, _(0), _(u.cells.length - 1), "top", c);
|
|
1669
1669
|
break;
|
|
1670
1670
|
}
|
|
1671
1671
|
case "stackedleftlinetop": {
|
|
1672
1672
|
let e = h[g][_(0)];
|
|
1673
|
-
e.borders.right = c, e.borders.bottom = c,
|
|
1673
|
+
e.borders.right = c, e.borders.bottom = c, Yn(h, g, _(1), v, "top", c);
|
|
1674
1674
|
break;
|
|
1675
1675
|
}
|
|
1676
1676
|
case "stackedrightright":
|
|
1677
1677
|
case "mediumstackedrightright":
|
|
1678
1678
|
case "shortstackedrightright":
|
|
1679
1679
|
case "stackedleftleft":
|
|
1680
|
-
|
|
1680
|
+
Qn(h, g, s, a, o, c, t);
|
|
1681
1681
|
break;
|
|
1682
|
-
default:
|
|
1682
|
+
default: Yn(h, g, _(1), v, "top", c);
|
|
1683
1683
|
}
|
|
1684
|
-
return
|
|
1684
|
+
return Kn(e, m, t);
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1687
|
-
let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e &&
|
|
1686
|
+
function Qn(e, t, n, r, i, a, o) {
|
|
1687
|
+
let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e && G(o.document, "mpadded", [e], {
|
|
1688
1688
|
lspace: "0.2em",
|
|
1689
1689
|
width: "+0.4em"
|
|
1690
1690
|
});
|
|
@@ -1703,132 +1703,407 @@ function Xn(e, t, n, r, i, a, o) {
|
|
|
1703
1703
|
}) : o === t + 1 ? (u.content = l(i), n !== "shortstackedrightright" && (u.borders[c] = a)) : o > t + 1 && (n === "stackedrightright" || s) && (u.borders[c] = a), s ? e.unshift(u) : e.push(u);
|
|
1704
1704
|
});
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1707
|
-
for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ?
|
|
1706
|
+
function $n(e) {
|
|
1707
|
+
for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ? Jn(t) : Zn(t));
|
|
1708
1708
|
}
|
|
1709
|
-
var
|
|
1709
|
+
var er = "PIE-MJX-explorer-styles", tr = "var(--pie-text, black)", nr = "var(--pie-background, #ffffff)", rr = "var(--pie-border-dark, #66686A)", ir = "var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))", ar = `color-mix(in srgb, ${ir} 15%, transparent)`, or = `
|
|
1710
1710
|
:root mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect) {
|
|
1711
|
-
color: ${
|
|
1712
|
-
fill: ${
|
|
1711
|
+
color: ${tr} !important;
|
|
1712
|
+
fill: ${tr} !important;
|
|
1713
1713
|
}
|
|
1714
1714
|
:root mjx-container:not([data-mjx-clone-container]) [data-sre-highlight-1]:not([data-sre-enclosed], rect) {
|
|
1715
|
-
background-color: ${
|
|
1715
|
+
background-color: ${ar} !important;
|
|
1716
1716
|
}
|
|
1717
1717
|
:root mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed]) {
|
|
1718
|
-
fill: ${
|
|
1718
|
+
fill: ${ar} !important;
|
|
1719
1719
|
}
|
|
1720
1720
|
:root mjx-container .mjx-selected {
|
|
1721
|
-
outline: 2px solid ${
|
|
1721
|
+
outline: 2px solid ${ir} !important;
|
|
1722
1722
|
}
|
|
1723
1723
|
:root mjx-container [data-sre-highlight-2] {
|
|
1724
|
-
color: ${
|
|
1724
|
+
color: ${tr} !important;
|
|
1725
1725
|
background-color: transparent !important;
|
|
1726
|
-
fill: ${
|
|
1727
|
-
outline: 2px dashed ${
|
|
1726
|
+
fill: ${tr} !important;
|
|
1727
|
+
outline: 2px dashed ${ir} !important;
|
|
1728
1728
|
}
|
|
1729
1729
|
:root mjx-container rect[data-sre-highlight-2] {
|
|
1730
1730
|
fill: transparent !important;
|
|
1731
|
-
stroke: ${
|
|
1731
|
+
stroke: ${ir} !important;
|
|
1732
1732
|
stroke-width: 2px !important;
|
|
1733
1733
|
vector-effect: non-scaling-stroke;
|
|
1734
1734
|
}
|
|
1735
1735
|
:root .MJX_LiveRegion, :root .MJX_HoverRegion, :root .MJX_ToolTip {
|
|
1736
|
-
color: ${
|
|
1737
|
-
background-color: ${
|
|
1738
|
-
border-color: ${
|
|
1736
|
+
color: ${tr} !important;
|
|
1737
|
+
background-color: ${nr} !important;
|
|
1738
|
+
border-color: ${rr} !important;
|
|
1739
1739
|
}
|
|
1740
1740
|
:root .MJX_LiveRegion > div, :root .MJX_HoverRegion > div {
|
|
1741
|
-
color: ${
|
|
1742
|
-
background-color: ${
|
|
1741
|
+
color: ${tr} !important;
|
|
1742
|
+
background-color: ${ar} !important;
|
|
1743
1743
|
}
|
|
1744
1744
|
`;
|
|
1745
|
-
function
|
|
1745
|
+
function sr(e = document) {
|
|
1746
1746
|
if (e.getElementById("PIE-MJX-explorer-styles")) return;
|
|
1747
1747
|
let t = e.createElement("style");
|
|
1748
|
-
t.id =
|
|
1748
|
+
t.id = er, t.textContent = or, e.head.appendChild(t);
|
|
1749
|
+
}
|
|
1750
|
+
var cr = /[-]/g, lr = {
|
|
1751
|
+
"+": "positive",
|
|
1752
|
+
"-": "negative",
|
|
1753
|
+
"−": "negative",
|
|
1754
|
+
"±": "plus or minus",
|
|
1755
|
+
"∓": "minus or plus"
|
|
1756
|
+
}, ur = {
|
|
1757
|
+
"(": "open parenthesis",
|
|
1758
|
+
"[": "open bracket",
|
|
1759
|
+
"{": "open brace",
|
|
1760
|
+
"⟨": "open angle bracket",
|
|
1761
|
+
"⌊": "open floor",
|
|
1762
|
+
"⌈": "open ceiling"
|
|
1763
|
+
}, dr = {
|
|
1764
|
+
")": "close parenthesis",
|
|
1765
|
+
"]": "close bracket",
|
|
1766
|
+
"}": "close brace",
|
|
1767
|
+
"⟩": "close angle bracket",
|
|
1768
|
+
"⌋": "close floor",
|
|
1769
|
+
"⌉": "close ceiling"
|
|
1770
|
+
}, fr = {
|
|
1771
|
+
"!": "factorial",
|
|
1772
|
+
"%": "percent",
|
|
1773
|
+
"°": "degrees",
|
|
1774
|
+
"′": "prime",
|
|
1775
|
+
"″": "double prime"
|
|
1776
|
+
}, pr = {
|
|
1777
|
+
"+": "plus",
|
|
1778
|
+
"-": "minus",
|
|
1779
|
+
"−": "minus",
|
|
1780
|
+
"±": "plus or minus",
|
|
1781
|
+
"∓": "minus or plus",
|
|
1782
|
+
"×": "times",
|
|
1783
|
+
"⋅": "times",
|
|
1784
|
+
"·": "times",
|
|
1785
|
+
"*": "times",
|
|
1786
|
+
"÷": "divided by",
|
|
1787
|
+
"/": "divided by",
|
|
1788
|
+
"=": "equals",
|
|
1789
|
+
"≠": "does not equal",
|
|
1790
|
+
"<": "is less than",
|
|
1791
|
+
">": "is greater than",
|
|
1792
|
+
"≤": "is less than or equal to",
|
|
1793
|
+
"≥": "is greater than or equal to",
|
|
1794
|
+
"≈": "is approximately equal to",
|
|
1795
|
+
"≡": "is equivalent to",
|
|
1796
|
+
"∝": "is proportional to",
|
|
1797
|
+
"∈": "is an element of",
|
|
1798
|
+
"∉": "is not an element of",
|
|
1799
|
+
"⊂": "is a subset of",
|
|
1800
|
+
"⊆": "is a subset of or equal to",
|
|
1801
|
+
"∪": "union",
|
|
1802
|
+
"∩": "intersection",
|
|
1803
|
+
"→": "right arrow",
|
|
1804
|
+
"←": "left arrow",
|
|
1805
|
+
"⇒": "implies",
|
|
1806
|
+
"⇔": "if and only if",
|
|
1807
|
+
"∑": "sum",
|
|
1808
|
+
"∏": "product",
|
|
1809
|
+
"∫": "integral",
|
|
1810
|
+
"∞": "infinity",
|
|
1811
|
+
"∠": "angle",
|
|
1812
|
+
"⊥": "is perpendicular to",
|
|
1813
|
+
"∥": "is parallel to",
|
|
1814
|
+
"∴": "therefore",
|
|
1815
|
+
",": "comma",
|
|
1816
|
+
";": "semicolon",
|
|
1817
|
+
":": "colon",
|
|
1818
|
+
"|": "vertical bar",
|
|
1819
|
+
"‖": "double vertical bar",
|
|
1820
|
+
...ur,
|
|
1821
|
+
...dr,
|
|
1822
|
+
...fr
|
|
1823
|
+
}, mr = /* @__PURE__ */ new Set(["|", "‖"]), hr = /* @__PURE__ */ new Set([
|
|
1824
|
+
"∑",
|
|
1825
|
+
"∏",
|
|
1826
|
+
"∫",
|
|
1827
|
+
"∪",
|
|
1828
|
+
"∩"
|
|
1829
|
+
]), gr = {
|
|
1830
|
+
α: "alpha",
|
|
1831
|
+
β: "beta",
|
|
1832
|
+
γ: "gamma",
|
|
1833
|
+
δ: "delta",
|
|
1834
|
+
ε: "epsilon",
|
|
1835
|
+
θ: "theta",
|
|
1836
|
+
λ: "lambda",
|
|
1837
|
+
μ: "mu",
|
|
1838
|
+
π: "pi",
|
|
1839
|
+
ρ: "rho",
|
|
1840
|
+
σ: "sigma",
|
|
1841
|
+
τ: "tau",
|
|
1842
|
+
φ: "phi",
|
|
1843
|
+
ω: "omega",
|
|
1844
|
+
Δ: "capital delta",
|
|
1845
|
+
Σ: "capital sigma",
|
|
1846
|
+
Ω: "capital omega",
|
|
1847
|
+
"∞": "infinity",
|
|
1848
|
+
sin: "sine",
|
|
1849
|
+
cos: "cosine",
|
|
1850
|
+
tan: "tangent",
|
|
1851
|
+
sec: "secant",
|
|
1852
|
+
csc: "cosecant",
|
|
1853
|
+
cot: "cotangent",
|
|
1854
|
+
ln: "natural log",
|
|
1855
|
+
lim: "limit"
|
|
1856
|
+
}, _r = {
|
|
1857
|
+
"¯": "bar",
|
|
1858
|
+
"‾": "bar",
|
|
1859
|
+
"―": "bar",
|
|
1860
|
+
"^": "hat",
|
|
1861
|
+
ˆ: "hat",
|
|
1862
|
+
"~": "tilde",
|
|
1863
|
+
"˜": "tilde",
|
|
1864
|
+
"→": "vector",
|
|
1865
|
+
"⃗": "vector",
|
|
1866
|
+
"˙": "dot"
|
|
1867
|
+
}, Y = (e) => (e.textContent ?? "").replace(cr, "").replace(/\s+/g, " ").trim(), vr = (e) => e.replace(/\s+/g, " ").trim(), yr = (e) => [...e.children];
|
|
1868
|
+
function br(e) {
|
|
1869
|
+
return !e || [
|
|
1870
|
+
"mn",
|
|
1871
|
+
"mi",
|
|
1872
|
+
"mtext",
|
|
1873
|
+
"mo"
|
|
1874
|
+
].includes(e.localName) ? !0 : ["mrow", "mstyle"].includes(e.localName) && e.children.length === 1 ? br(e.children[0]) : !1;
|
|
1875
|
+
}
|
|
1876
|
+
function xr(e) {
|
|
1877
|
+
let t = e ? Y(e) : "";
|
|
1878
|
+
return /^\d{1,3}$/.test(t) ? Number(t) : void 0;
|
|
1879
|
+
}
|
|
1880
|
+
function Sr(e) {
|
|
1881
|
+
return `${e}${e % 100 >= 11 && e % 100 <= 13 ? "th" : {
|
|
1882
|
+
1: "st",
|
|
1883
|
+
2: "nd",
|
|
1884
|
+
3: "rd"
|
|
1885
|
+
}[e % 10] ?? "th"}`;
|
|
1886
|
+
}
|
|
1887
|
+
function Cr(e) {
|
|
1888
|
+
return gr[e] ?? e;
|
|
1889
|
+
}
|
|
1890
|
+
function wr(e) {
|
|
1891
|
+
return pr[e] ?? e;
|
|
1892
|
+
}
|
|
1893
|
+
function Tr(e) {
|
|
1894
|
+
let t = [], n = !1;
|
|
1895
|
+
for (let r of e) {
|
|
1896
|
+
if (r.localName !== "mo") {
|
|
1897
|
+
t.push(X(r)), n = !0;
|
|
1898
|
+
continue;
|
|
1899
|
+
}
|
|
1900
|
+
let e = Y(r);
|
|
1901
|
+
e && (!n && lr[e] ? t.push(lr[e]) : e in fr ? t.push(fr[e]) : (t.push(wr(e)), n = e in dr || mr.has(e) && n));
|
|
1902
|
+
}
|
|
1903
|
+
return t.filter(Boolean).join(" ");
|
|
1904
|
+
}
|
|
1905
|
+
function Er(e) {
|
|
1906
|
+
let [t, ...n] = e, r = n[n.length - 1], i = (e) => e?.localName === "mo" && ["|", "‖"].includes(Y(e)), a = n.slice(0, -1);
|
|
1907
|
+
if (a.length && i(t) && i(r) && Y(t) === Y(r) && !a.some(i)) {
|
|
1908
|
+
let e = vr(Tr(a));
|
|
1909
|
+
return Y(t) === "|" ? `absolute value of ${e} end absolute value` : `norm of ${e} end norm`;
|
|
1910
|
+
}
|
|
1911
|
+
return Tr(e);
|
|
1912
|
+
}
|
|
1913
|
+
function Dr(e, t) {
|
|
1914
|
+
let n = e ? X(e) : "", r = t ? X(t) : "";
|
|
1915
|
+
return br(e) && br(t) ? `${n} over ${r}` : `the fraction with numerator ${n} and denominator ${r}`;
|
|
1916
|
+
}
|
|
1917
|
+
function Or(e, t, n) {
|
|
1918
|
+
return n ? `${t} of ${e}` : `${t} of ${e} end root`;
|
|
1919
|
+
}
|
|
1920
|
+
function kr(e, t) {
|
|
1921
|
+
let n = t ? Y(t) : "";
|
|
1922
|
+
if (t && br(t)) {
|
|
1923
|
+
if (n === "2") return `${e} squared`;
|
|
1924
|
+
if (n === "3") return `${e} cubed`;
|
|
1925
|
+
if (n in fr) return `${e} ${fr[n]}`;
|
|
1926
|
+
}
|
|
1927
|
+
let r = t ? X(t) : "";
|
|
1928
|
+
return br(t) ? `${e} to the power of ${r}` : `${e} to the power of ${r} end power`;
|
|
1929
|
+
}
|
|
1930
|
+
function Ar(e, t) {
|
|
1931
|
+
let n = t ? X(t) : "";
|
|
1932
|
+
return br(t) ? `${e} sub ${n}` : `${e} sub ${n} end sub`;
|
|
1933
|
+
}
|
|
1934
|
+
function jr(e, t, n) {
|
|
1935
|
+
let r = Y(e);
|
|
1936
|
+
if (r === "lim") return `limit as ${t ? X(t) : ""} of`;
|
|
1937
|
+
if (!hr.has(r)) return;
|
|
1938
|
+
let i = t ? `from ${X(t)}` : "", a = n ? `to ${X(n)}` : "";
|
|
1939
|
+
return `${wr(r)} ${i} ${a} of`;
|
|
1940
|
+
}
|
|
1941
|
+
function Mr(e) {
|
|
1942
|
+
let t = yr(e).filter((e) => ["mtr", "mlabeledtr"].includes(e.localName)), n = t.map((e) => yr(e).filter((e) => e.localName === "mtd")), r = Math.max(0, ...n.map((e) => e.length)), i = n.map((e, t) => `row ${t + 1}: ${e.map((e) => vr(Tr(yr(e)))).join(", ")}`);
|
|
1943
|
+
return `table with ${t.length} ${t.length === 1 ? "row" : "rows"} and ${r} ${r === 1 ? "column" : "columns"}. ${i.join(". ")}`;
|
|
1944
|
+
}
|
|
1945
|
+
function Nr(e) {
|
|
1946
|
+
let t = e.getAttribute("open") ?? "(", n = e.getAttribute("close") ?? ")", r = (e.getAttribute("separators") ?? ",").replace(/\s+/g, "").split(""), i = yr(e).map((e, t, n) => t < n.length - 1 ? `${X(e)} ${wr(r[Math.min(t, r.length - 1)] ?? ",")}` : X(e));
|
|
1947
|
+
return [
|
|
1948
|
+
wr(t),
|
|
1949
|
+
...i,
|
|
1950
|
+
wr(n)
|
|
1951
|
+
].filter(Boolean).join(" ");
|
|
1952
|
+
}
|
|
1953
|
+
function X(e) {
|
|
1954
|
+
let t = yr(e);
|
|
1955
|
+
switch (e.localName) {
|
|
1956
|
+
case "mi": return Cr(Y(e));
|
|
1957
|
+
case "mn":
|
|
1958
|
+
case "mtext":
|
|
1959
|
+
case "ms": return Y(e);
|
|
1960
|
+
case "mo": return wr(Y(e));
|
|
1961
|
+
case "mspace":
|
|
1962
|
+
case "mphantom":
|
|
1963
|
+
case "annotation":
|
|
1964
|
+
case "annotation-xml": return "";
|
|
1965
|
+
case "semantics": return t[0] ? X(t[0]) : "";
|
|
1966
|
+
case "mfrac": return Dr(t[0], t[1]);
|
|
1967
|
+
case "msqrt": return Or(vr(Tr(t)), "square root", t.length === 1 && br(t[0]));
|
|
1968
|
+
case "mroot": {
|
|
1969
|
+
let e = xr(t[1]), n = e === 2 ? "square root" : e === 3 ? "cube root" : e ? `${Sr(e)} root` : `root with index ${t[1] ? X(t[1]) : ""}`;
|
|
1970
|
+
return Or(t[0] ? X(t[0]) : "", n, br(t[0]));
|
|
1971
|
+
}
|
|
1972
|
+
case "msup": return kr(t[0] ? X(t[0]) : "", t[1]);
|
|
1973
|
+
case "msub": return Ar(t[0] ? X(t[0]) : "", t[1]);
|
|
1974
|
+
case "msubsup": return (t[0] ? jr(t[0], t[1], t[2]) : void 0) || kr(Ar(t[0] ? X(t[0]) : "", t[1]), t[2]);
|
|
1975
|
+
case "munder":
|
|
1976
|
+
case "mover":
|
|
1977
|
+
case "munderover": {
|
|
1978
|
+
let [n, r, i] = t, a = e.localName === "mover" ? void 0 : r, o = e.localName === "munder" ? void 0 : e.localName === "mover" ? r : i, s = n ? jr(n, a, o) : void 0;
|
|
1979
|
+
if (s) return s;
|
|
1980
|
+
let c = n ? X(n) : "", l = e.localName === "mover" && r ? _r[Y(r)] : void 0;
|
|
1981
|
+
return l ? l === "vector" ? `vector ${c}` : `${c} ${l}` : [
|
|
1982
|
+
c,
|
|
1983
|
+
a ? `with ${X(a)} below` : "",
|
|
1984
|
+
o ? `with ${X(o)} above` : ""
|
|
1985
|
+
].filter(Boolean).join(" ");
|
|
1986
|
+
}
|
|
1987
|
+
case "mfenced": return Nr(e);
|
|
1988
|
+
case "mtable": return Mr(e);
|
|
1989
|
+
case "mrow":
|
|
1990
|
+
case "math": return Er(t);
|
|
1991
|
+
default: return t.length ? Tr(t) : Y(e);
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
function Pr(e) {
|
|
1995
|
+
return vr(X(e));
|
|
1996
|
+
}
|
|
1997
|
+
var Fr = [
|
|
1998
|
+
"a[href]",
|
|
1999
|
+
"button",
|
|
2000
|
+
"label",
|
|
2001
|
+
"summary",
|
|
2002
|
+
...[
|
|
2003
|
+
"button",
|
|
2004
|
+
"checkbox",
|
|
2005
|
+
"combobox",
|
|
2006
|
+
"link",
|
|
2007
|
+
"menuitem",
|
|
2008
|
+
"menuitemcheckbox",
|
|
2009
|
+
"menuitemradio",
|
|
2010
|
+
"option",
|
|
2011
|
+
"radio",
|
|
2012
|
+
"switch",
|
|
2013
|
+
"tab",
|
|
2014
|
+
"treeitem"
|
|
2015
|
+
].map((e) => `[role="${e}"]`)
|
|
2016
|
+
].join(", ");
|
|
2017
|
+
function Ir(e) {
|
|
2018
|
+
if (e.hasAttribute("aria-label") || !e.closest(Fr)) return;
|
|
2019
|
+
let t = e.querySelector("math"), n = t ? Pr(t) : "";
|
|
2020
|
+
n && e.setAttribute("aria-label", n);
|
|
2021
|
+
}
|
|
2022
|
+
function Lr(e) {
|
|
2023
|
+
for (let t of e.querySelectorAll("mjx-container")) Ir(t);
|
|
1749
2024
|
}
|
|
1750
|
-
var
|
|
1751
|
-
function
|
|
2025
|
+
var Rr = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page", zr = "pie-mathjax-version-conflict", Br = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
|
|
2026
|
+
function Vr(e, t) {
|
|
1752
2027
|
if (typeof window > "u") return;
|
|
1753
2028
|
let n = globalThis;
|
|
1754
|
-
n[
|
|
2029
|
+
n[Br] ??= {
|
|
1755
2030
|
logged: !1,
|
|
1756
2031
|
conditions: []
|
|
1757
2032
|
};
|
|
1758
|
-
let r = n[
|
|
2033
|
+
let r = n[Br];
|
|
1759
2034
|
if (r.conditions.includes(e)) return;
|
|
1760
2035
|
r.conditions.push(e);
|
|
1761
|
-
let i = `[math-rendering] Unsupported page (${e}): ${t}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${
|
|
1762
|
-
r.logged || (r.logged = !0, console.error(i)), window.dispatchEvent(new CustomEvent(
|
|
2036
|
+
let i = `[math-rendering] Unsupported page (${e}): ${t}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${Rr}`;
|
|
2037
|
+
r.logged || (r.logged = !0, console.error(i)), window.dispatchEvent(new CustomEvent(zr, { detail: {
|
|
1763
2038
|
condition: e,
|
|
1764
2039
|
message: i,
|
|
1765
|
-
docsUrl:
|
|
2040
|
+
docsUrl: Rr
|
|
1766
2041
|
} }));
|
|
1767
2042
|
}
|
|
1768
|
-
var
|
|
2043
|
+
var Hr = {
|
|
1769
2044
|
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
1770
2045
|
overarc: "\\overparen",
|
|
1771
2046
|
napprox: "\\not\\approx",
|
|
1772
2047
|
longdiv: "\\enclose{longdiv}",
|
|
1773
2048
|
abs: ["\\left|#1\\right|", 1]
|
|
1774
|
-
},
|
|
2049
|
+
}, Ur = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", Wr = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, Gr = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, Kr = /\\embed\{newLine\}\[\]/g, qr = [
|
|
1775
2050
|
["$$", "$$"],
|
|
1776
2051
|
["$", "$"],
|
|
1777
2052
|
["\\[", "\\]"],
|
|
1778
2053
|
["\\(", "\\)"]
|
|
1779
|
-
],
|
|
2054
|
+
], Jr = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), Yr = "MJX-CHTML-styles", Xr = "PIE-MJX-SVG-styles", Zr = "PIE-MathJax-Menu-Settings", Qr = { "mjx-container[overflow=\"linebreak\"][display]": {
|
|
1780
2055
|
overflow: "auto clip",
|
|
1781
2056
|
"min-width": "initial !important"
|
|
1782
|
-
} },
|
|
1783
|
-
function
|
|
2057
|
+
} }, $r = 200, ei = 201, ti = 202;
|
|
2058
|
+
function ni(e) {
|
|
1784
2059
|
let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
|
|
1785
2060
|
for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
|
|
1786
2061
|
}
|
|
1787
|
-
function
|
|
1788
|
-
for (let [t, n] of
|
|
2062
|
+
function ri(e) {
|
|
2063
|
+
for (let [t, n] of qr) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
1789
2064
|
return e;
|
|
1790
2065
|
}
|
|
1791
|
-
function
|
|
1792
|
-
return
|
|
2066
|
+
function ii(e) {
|
|
2067
|
+
return ri(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
|
|
1793
2068
|
}
|
|
1794
|
-
var
|
|
1795
|
-
function
|
|
1796
|
-
let n = e.closest(`.${
|
|
1797
|
-
return n !== null && t.contains(n) && !n.classList.contains(
|
|
2069
|
+
var ai = "mathjax_ignore", oi = "mathjax_process";
|
|
2070
|
+
function si(e, t) {
|
|
2071
|
+
let n = e.closest(`.${ai}, .${oi}`);
|
|
2072
|
+
return n !== null && t.contains(n) && !n.classList.contains(oi);
|
|
1798
2073
|
}
|
|
1799
|
-
function
|
|
2074
|
+
function ci(e) {
|
|
1800
2075
|
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
1801
|
-
if (t.dataset.mathHandled || t.closest("mjx-container") ||
|
|
2076
|
+
if (t.dataset.mathHandled || t.closest("mjx-container") || si(t, e)) continue;
|
|
1802
2077
|
let n = t.textContent;
|
|
1803
|
-
n && (t.textContent = `\\(${
|
|
2078
|
+
n && (t.textContent = `\\(${ii(n)}\\)`.replace(Kr, "\\newline "), t.dataset.mathHandled = "true");
|
|
1804
2079
|
}
|
|
1805
2080
|
}
|
|
1806
|
-
function
|
|
2081
|
+
function li(e) {
|
|
1807
2082
|
for (let t of e.querySelectorAll("math")) t.closest("mjx-container") || t.setAttribute("displaystyle", "true");
|
|
1808
2083
|
}
|
|
1809
|
-
function
|
|
2084
|
+
function ui(e, t) {
|
|
1810
2085
|
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
1811
|
-
return (t ?
|
|
2086
|
+
return (t ? Gr : Wr).test(e.textContent ?? "");
|
|
1812
2087
|
}
|
|
1813
|
-
function
|
|
2088
|
+
function di(e) {
|
|
1814
2089
|
return new Promise((t, n) => {
|
|
1815
|
-
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s =
|
|
2090
|
+
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = Kt(e, import.meta.url), c = {
|
|
1816
2091
|
loader: {
|
|
1817
2092
|
load: i ? ["a11y/assistive-mml"] : [],
|
|
1818
2093
|
failed: (e) => n(e),
|
|
1819
2094
|
"output/svg": { ready: (e) => {
|
|
1820
|
-
let t =
|
|
1821
|
-
return
|
|
2095
|
+
let t = U();
|
|
2096
|
+
return fi(t) && pi(t), e;
|
|
1822
2097
|
} }
|
|
1823
2098
|
},
|
|
1824
2099
|
startup: {
|
|
1825
2100
|
typeset: !1,
|
|
1826
2101
|
ready: () => {
|
|
1827
|
-
let e =
|
|
1828
|
-
i && (
|
|
2102
|
+
let e = U(), r = e?.startup, i = fi(e);
|
|
2103
|
+
i && (pi(e), mi(e, s.speechLocales), V(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (hi(r?.document), gi(r?.document), r?.document?.addStyles?.(Qr), nn(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
|
|
1829
2104
|
}
|
|
1830
2105
|
},
|
|
1831
|
-
tex: { macros: { ...
|
|
2106
|
+
tex: { macros: { ...Hr } },
|
|
1832
2107
|
output: { displayOverflow: "linebreak" },
|
|
1833
2108
|
options: {
|
|
1834
2109
|
enableMenu: i,
|
|
@@ -1840,9 +2115,9 @@ function Mr(e) {
|
|
|
1840
2115
|
a11y: { inTabOrder: !1 }
|
|
1841
2116
|
}
|
|
1842
2117
|
};
|
|
1843
|
-
r && c.tex && (console.warn(
|
|
1844
|
-
let l =
|
|
1845
|
-
l && c.options && (c.options.sre = { locale: l }),
|
|
2118
|
+
r && c.tex && (console.warn(Ur), c.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], c.tex.processEscapes = !0), a || (c.chtml = { fontURL: "" });
|
|
2119
|
+
let l = Yt(s.speechLocales);
|
|
2120
|
+
l && c.options && (c.options.sre = { locale: l }), cn(c, {
|
|
1846
2121
|
...s,
|
|
1847
2122
|
srcUrl: o
|
|
1848
2123
|
}).then((e) => {
|
|
@@ -1850,194 +2125,177 @@ function Mr(e) {
|
|
|
1850
2125
|
}, n);
|
|
1851
2126
|
});
|
|
1852
2127
|
}
|
|
1853
|
-
function
|
|
2128
|
+
function fi(e) {
|
|
1854
2129
|
return !!e?.version?.startsWith("4.");
|
|
1855
2130
|
}
|
|
1856
|
-
function
|
|
2131
|
+
function pi(e) {
|
|
1857
2132
|
let t = e?._?.output, n = t?.chtml_ts?.CHTML;
|
|
1858
|
-
n && (n.STYLESHEETID =
|
|
2133
|
+
n && (n.STYLESHEETID = pn);
|
|
1859
2134
|
let r = t?.svg_ts?.SVG;
|
|
1860
|
-
r && (r.STYLESHEETID =
|
|
2135
|
+
r && (r.STYLESHEETID = Xr);
|
|
1861
2136
|
}
|
|
1862
|
-
function
|
|
2137
|
+
function mi(e, t) {
|
|
1863
2138
|
let n = e?._?.ui?.menu?.Menu?.Menu;
|
|
1864
2139
|
if (n) {
|
|
1865
|
-
n.MENU_STORAGE =
|
|
2140
|
+
n.MENU_STORAGE = Zr;
|
|
1866
2141
|
try {
|
|
1867
|
-
let e = localStorage.getItem(
|
|
2142
|
+
let e = localStorage.getItem(Zr);
|
|
1868
2143
|
if (!e) return;
|
|
1869
2144
|
let { assistiveMml: n, locale: r, ...i } = JSON.parse(e), a = r === void 0 || !t || t.has(r);
|
|
1870
2145
|
if (n === void 0 && a) return;
|
|
1871
|
-
a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem(
|
|
2146
|
+
a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem(Zr, JSON.stringify(i)) : localStorage.removeItem(Zr);
|
|
1872
2147
|
} catch {}
|
|
1873
2148
|
}
|
|
1874
2149
|
}
|
|
1875
|
-
function
|
|
2150
|
+
function hi(e) {
|
|
1876
2151
|
if (!e) return;
|
|
1877
2152
|
let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
|
|
1878
2153
|
let n = e.typesetRoot;
|
|
1879
|
-
!n || t.has(n) || (
|
|
2154
|
+
!n || t.has(n) || (ni(n), t.add(n));
|
|
1880
2155
|
};
|
|
1881
|
-
e.addRenderAction?.("pie-strip-latex",
|
|
2156
|
+
e.addRenderAction?.("pie-strip-latex", ei, (e) => {
|
|
1882
2157
|
for (let t of e.math ?? []) n(t);
|
|
1883
2158
|
return !1;
|
|
1884
2159
|
}, (e) => {
|
|
1885
2160
|
let t = e.typesetRoot;
|
|
1886
|
-
return t &&
|
|
2161
|
+
return t && ni(t), !1;
|
|
1887
2162
|
});
|
|
1888
2163
|
let r = e.outputJax?.chtmlStyles;
|
|
1889
|
-
r?.id ===
|
|
2164
|
+
r?.id === Yr && (r.id = pn), yi();
|
|
1890
2165
|
}
|
|
1891
|
-
function
|
|
1892
|
-
|
|
2166
|
+
function gi(e) {
|
|
2167
|
+
let t = (e) => {
|
|
2168
|
+
e.typesetRoot && Ir(e.typesetRoot);
|
|
2169
|
+
};
|
|
2170
|
+
e?.addRenderAction?.("pie-name-math", ti, (e) => {
|
|
2171
|
+
for (let n of e.math ?? []) t(n);
|
|
2172
|
+
return !1;
|
|
2173
|
+
}, (e) => (t(e), !1));
|
|
1893
2174
|
}
|
|
1894
|
-
function
|
|
1895
|
-
|
|
2175
|
+
function _i(e) {
|
|
2176
|
+
return e instanceof HTMLStyleElement && mn.includes(e.id);
|
|
1896
2177
|
}
|
|
1897
|
-
function
|
|
1898
|
-
|
|
2178
|
+
function vi(e) {
|
|
2179
|
+
Vr("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
|
|
2180
|
+
}
|
|
2181
|
+
function yi() {
|
|
2182
|
+
let e = document.head, t = [...e.children].find(_i);
|
|
1899
2183
|
if (t) {
|
|
1900
|
-
|
|
2184
|
+
vi(t);
|
|
1901
2185
|
return;
|
|
1902
2186
|
}
|
|
1903
2187
|
let n = new MutationObserver((e) => {
|
|
1904
2188
|
for (let t of e) {
|
|
1905
|
-
let e = [...t.addedNodes].find(
|
|
2189
|
+
let e = [...t.addedNodes].find(_i);
|
|
1906
2190
|
if (e) {
|
|
1907
|
-
|
|
2191
|
+
vi(e), n.disconnect();
|
|
1908
2192
|
return;
|
|
1909
2193
|
}
|
|
1910
2194
|
}
|
|
1911
2195
|
});
|
|
1912
2196
|
n.observe(e, { childList: !0 });
|
|
1913
2197
|
}
|
|
1914
|
-
function
|
|
2198
|
+
function bi(e) {
|
|
1915
2199
|
let t = e?.math;
|
|
1916
2200
|
if (!t?.remove) return;
|
|
1917
|
-
let n = [...t].filter((e) => (e.state?.() ?? 0) >=
|
|
2201
|
+
let n = [...t].filter((e) => (e.state?.() ?? 0) >= $r && e.typesetRoot?.isConnected === !1);
|
|
1918
2202
|
if (n.length !== 0) {
|
|
1919
2203
|
for (let e of [...n].reverse()) e.clear?.();
|
|
1920
2204
|
t.remove(...n);
|
|
1921
2205
|
}
|
|
1922
2206
|
}
|
|
1923
|
-
function
|
|
2207
|
+
function xi(e) {
|
|
1924
2208
|
return new Promise((t, n) => {
|
|
1925
2209
|
let r = e.startup ?? {};
|
|
1926
2210
|
e.startup = r;
|
|
1927
2211
|
let i = r.ready;
|
|
1928
2212
|
r.ready = () => {
|
|
1929
|
-
let e =
|
|
2213
|
+
let e = U()?.startup;
|
|
1930
2214
|
i ? i.call(r) : e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
|
|
1931
2215
|
};
|
|
1932
2216
|
});
|
|
1933
2217
|
}
|
|
1934
|
-
function
|
|
1935
|
-
let t =
|
|
1936
|
-
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() :
|
|
2218
|
+
function Si(e) {
|
|
2219
|
+
let t = U();
|
|
2220
|
+
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : xi(t) : di(e);
|
|
1937
2221
|
}
|
|
1938
|
-
function
|
|
1939
|
-
return
|
|
1940
|
-
let e =
|
|
2222
|
+
function Ci(e) {
|
|
2223
|
+
return Si(e).then(() => {
|
|
2224
|
+
let e = U();
|
|
1941
2225
|
e && typeof e.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
|
|
1942
2226
|
});
|
|
1943
2227
|
}
|
|
1944
|
-
function
|
|
1945
|
-
let t =
|
|
1946
|
-
return n || (n =
|
|
2228
|
+
function wi(e) {
|
|
2229
|
+
let t = ln, n = t[Jr];
|
|
2230
|
+
return n || (n = Ci(e), t[Jr] = n), n;
|
|
1947
2231
|
}
|
|
1948
|
-
function
|
|
2232
|
+
function Ti(e = {}) {
|
|
1949
2233
|
let t = e.useSingleDollar ?? !1;
|
|
1950
2234
|
return async (n) => {
|
|
1951
2235
|
if (typeof window > "u") return;
|
|
1952
|
-
|
|
1953
|
-
let r =
|
|
1954
|
-
if (!
|
|
2236
|
+
ci(n), vn(n), li(n), $n(n);
|
|
2237
|
+
let r = wi(e);
|
|
2238
|
+
if (!ui(n, t)) {
|
|
1955
2239
|
r.catch(() => {});
|
|
1956
2240
|
return;
|
|
1957
2241
|
}
|
|
1958
2242
|
await r;
|
|
1959
|
-
let i =
|
|
2243
|
+
let i = U();
|
|
1960
2244
|
if (await i?.startup?.promise, typeof i?.typesetPromise == "function") {
|
|
1961
|
-
|
|
2245
|
+
sr(), bi(i.startup?.document);
|
|
1962
2246
|
try {
|
|
1963
2247
|
await i.typesetPromise([n]);
|
|
1964
2248
|
} catch (e) {
|
|
1965
2249
|
throw i.typesetClear?.([n]), e;
|
|
1966
2250
|
}
|
|
1967
|
-
|
|
2251
|
+
ni(n), Lr(n);
|
|
1968
2252
|
}
|
|
1969
2253
|
};
|
|
1970
2254
|
}
|
|
1971
|
-
var
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
"{": "open brace",
|
|
1975
|
-
"⟨": "open angle bracket",
|
|
1976
|
-
"⌊": "open floor",
|
|
1977
|
-
"⌈": "open ceiling"
|
|
1978
|
-
}, qr = {
|
|
1979
|
-
")": "close parenthesis",
|
|
1980
|
-
"]": "close bracket",
|
|
1981
|
-
"}": "close brace",
|
|
1982
|
-
"⟩": "close angle bracket",
|
|
1983
|
-
"⌋": "close floor",
|
|
1984
|
-
"⌉": "close ceiling"
|
|
1985
|
-
}, Jr = {
|
|
1986
|
-
"!": "factorial",
|
|
1987
|
-
"%": "percent",
|
|
1988
|
-
"°": "degrees",
|
|
1989
|
-
"′": "prime",
|
|
1990
|
-
"″": "double prime"
|
|
1991
|
-
};
|
|
1992
|
-
({
|
|
1993
|
-
...Kr,
|
|
1994
|
-
...qr,
|
|
1995
|
-
...Jr
|
|
1996
|
-
});
|
|
1997
|
-
var Yr = "@pie-lib/math-rendering", Xr = "@pie-lib/math-rendering@2", Zr = "pie-print", Qr = 50, $r = 1e4, ei = null;
|
|
1998
|
-
function ti() {
|
|
1999
|
-
return !!window[Xr]?.opts?.useSingleDollar;
|
|
2255
|
+
var Ei = "@pie-lib/math-rendering", Di = "@pie-lib/math-rendering@2", Oi = "pie-print", ki = 50, Ai = 1e4, ji = null;
|
|
2256
|
+
function Mi() {
|
|
2257
|
+
return !!window[Di]?.opts?.useSingleDollar;
|
|
2000
2258
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return
|
|
2259
|
+
function Ni() {
|
|
2260
|
+
return ji ||= Ti({ useSingleDollar: Mi() }), ji;
|
|
2003
2261
|
}
|
|
2004
|
-
function
|
|
2262
|
+
function Pi() {
|
|
2005
2263
|
if (typeof window > "u") return null;
|
|
2006
|
-
let e = window[
|
|
2007
|
-
return typeof e?.renderMath == "function" && e.renderMath !==
|
|
2264
|
+
let e = window[Ei];
|
|
2265
|
+
return typeof e?.renderMath == "function" && e.renderMath !== Ri ? e : null;
|
|
2008
2266
|
}
|
|
2009
|
-
function
|
|
2267
|
+
function Fi(e) {
|
|
2010
2268
|
let t = e;
|
|
2011
2269
|
for (; t;) {
|
|
2012
|
-
if (t instanceof Element && t.localName ===
|
|
2270
|
+
if (t instanceof Element && t.localName === Oi) return t;
|
|
2013
2271
|
t = t instanceof ShadowRoot ? t.host : t.parentNode;
|
|
2014
2272
|
}
|
|
2015
2273
|
return null;
|
|
2016
2274
|
}
|
|
2017
|
-
function
|
|
2275
|
+
function Ii() {
|
|
2018
2276
|
let e = window.renderMath;
|
|
2019
2277
|
return typeof e == "function" ? e : null;
|
|
2020
2278
|
}
|
|
2021
|
-
async function
|
|
2022
|
-
let t =
|
|
2279
|
+
async function Li(e) {
|
|
2280
|
+
let t = Fi(e);
|
|
2023
2281
|
if (!t) return null;
|
|
2024
|
-
let n =
|
|
2282
|
+
let n = Ii();
|
|
2025
2283
|
if (n || t.mathRenderingModuleUrlImported !== !0) return n;
|
|
2026
|
-
let r = Date.now() +
|
|
2284
|
+
let r = Date.now() + Ai;
|
|
2027
2285
|
for (; Date.now() < r;) {
|
|
2028
|
-
await new Promise((e) => setTimeout(e,
|
|
2029
|
-
let e =
|
|
2286
|
+
await new Promise((e) => setTimeout(e, ki));
|
|
2287
|
+
let e = Ii();
|
|
2030
2288
|
if (e) return e;
|
|
2031
2289
|
}
|
|
2032
2290
|
return null;
|
|
2033
2291
|
}
|
|
2034
|
-
var
|
|
2292
|
+
var Ri = async (e) => {
|
|
2035
2293
|
if (typeof window > "u") return;
|
|
2036
2294
|
let t = typeof e == "string", n;
|
|
2037
2295
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
2038
|
-
let r =
|
|
2039
|
-
return r ? await r.renderMath?.(n) : i && i !==
|
|
2040
|
-
},
|
|
2296
|
+
let r = Pi(), i = r || t ? null : await Li(n);
|
|
2297
|
+
return r ? (await r.renderMath?.(n), Lr(n)) : i && i !== Ri ? (await i(n), Lr(n)) : await Ni()(n), t ? n.innerHTML : void 0;
|
|
2298
|
+
}, zi = {
|
|
2041
2299
|
translation: {
|
|
2042
2300
|
categorize: {
|
|
2043
2301
|
limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
|
|
@@ -2324,7 +2582,7 @@ var si = async (e) => {
|
|
|
2324
2582
|
cancel: "Cancel",
|
|
2325
2583
|
playAudio: "Play audio"
|
|
2326
2584
|
}
|
|
2327
|
-
},
|
|
2585
|
+
}, Bi = {
|
|
2328
2586
|
translation: {
|
|
2329
2587
|
categorize: {
|
|
2330
2588
|
limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
|
|
@@ -2611,55 +2869,55 @@ var si = async (e) => {
|
|
|
2611
2869
|
cancel: "Cancelar",
|
|
2612
2870
|
playAudio: "Reproducir audio"
|
|
2613
2871
|
}
|
|
2614
|
-
}, Z = (e) => typeof e == "string",
|
|
2872
|
+
}, Z = (e) => typeof e == "string", Vi = () => {
|
|
2615
2873
|
let e, t, n = new Promise((n, r) => {
|
|
2616
2874
|
e = n, t = r;
|
|
2617
2875
|
});
|
|
2618
2876
|
return n.resolve = e, n.reject = t, n;
|
|
2619
|
-
},
|
|
2877
|
+
}, Hi = (e) => e == null ? "" : "" + e, Ui = (e, t, n) => {
|
|
2620
2878
|
e.forEach((e) => {
|
|
2621
2879
|
t[e] && (n[e] = t[e]);
|
|
2622
2880
|
});
|
|
2623
|
-
},
|
|
2881
|
+
}, Wi = /###/g, Gi = (e) => e && e.indexOf("###") > -1 ? e.replace(Wi, ".") : e, Ki = (e) => !e || Z(e), qi = (e, t, n) => {
|
|
2624
2882
|
let r = Z(t) ? t.split(".") : t, i = 0;
|
|
2625
2883
|
for (; i < r.length - 1;) {
|
|
2626
|
-
if (
|
|
2627
|
-
let t =
|
|
2884
|
+
if (Ki(e)) return {};
|
|
2885
|
+
let t = Gi(r[i]);
|
|
2628
2886
|
!e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
|
|
2629
2887
|
}
|
|
2630
|
-
return
|
|
2888
|
+
return Ki(e) ? {} : {
|
|
2631
2889
|
obj: e,
|
|
2632
|
-
k:
|
|
2890
|
+
k: Gi(r[i])
|
|
2633
2891
|
};
|
|
2634
|
-
},
|
|
2635
|
-
let { obj: r, k: i } =
|
|
2892
|
+
}, Ji = (e, t, n) => {
|
|
2893
|
+
let { obj: r, k: i } = qi(e, t, Object);
|
|
2636
2894
|
if (r !== void 0 || t.length === 1) {
|
|
2637
2895
|
r[i] = n;
|
|
2638
2896
|
return;
|
|
2639
2897
|
}
|
|
2640
|
-
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s =
|
|
2641
|
-
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s =
|
|
2898
|
+
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = qi(e, o, Object);
|
|
2899
|
+
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = qi(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
|
|
2642
2900
|
s.obj[`${s.k}.${a}`] = n;
|
|
2643
|
-
},
|
|
2644
|
-
let { obj: i, k: a } =
|
|
2901
|
+
}, Yi = (e, t, n, r) => {
|
|
2902
|
+
let { obj: i, k: a } = qi(e, t, Object);
|
|
2645
2903
|
i[a] = i[a] || [], i[a].push(n);
|
|
2646
|
-
},
|
|
2647
|
-
let { obj: n, k: r } =
|
|
2904
|
+
}, Xi = (e, t) => {
|
|
2905
|
+
let { obj: n, k: r } = qi(e, t);
|
|
2648
2906
|
if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
|
|
2649
|
-
},
|
|
2650
|
-
let r =
|
|
2651
|
-
return r === void 0 ?
|
|
2652
|
-
},
|
|
2653
|
-
for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? Z(e[r]) || e[r] instanceof String || Z(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) :
|
|
2907
|
+
}, Zi = (e, t, n) => {
|
|
2908
|
+
let r = Xi(e, n);
|
|
2909
|
+
return r === void 0 ? Xi(t, n) : r;
|
|
2910
|
+
}, Qi = (e, t, n) => {
|
|
2911
|
+
for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? Z(e[r]) || e[r] instanceof String || Z(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : Qi(e[r], t[r], n) : e[r] = t[r]);
|
|
2654
2912
|
return e;
|
|
2655
|
-
},
|
|
2913
|
+
}, $i = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), ea = {
|
|
2656
2914
|
"&": "&",
|
|
2657
2915
|
"<": "<",
|
|
2658
2916
|
">": ">",
|
|
2659
2917
|
"\"": """,
|
|
2660
2918
|
"'": "'",
|
|
2661
2919
|
"/": "/"
|
|
2662
|
-
},
|
|
2920
|
+
}, ta = (e) => Z(e) ? e.replace(/[&<>"'\/]/g, (e) => ea[e]) : e, na = class {
|
|
2663
2921
|
constructor(e) {
|
|
2664
2922
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
2665
2923
|
}
|
|
@@ -2669,23 +2927,23 @@ var si = async (e) => {
|
|
|
2669
2927
|
let n = new RegExp(e);
|
|
2670
2928
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
2671
2929
|
}
|
|
2672
|
-
},
|
|
2930
|
+
}, ra = [
|
|
2673
2931
|
" ",
|
|
2674
2932
|
",",
|
|
2675
2933
|
"?",
|
|
2676
2934
|
"!",
|
|
2677
2935
|
";"
|
|
2678
|
-
],
|
|
2936
|
+
], ia = new na(20), aa = (e, t, n) => {
|
|
2679
2937
|
t ||= "", n ||= "";
|
|
2680
|
-
let r =
|
|
2938
|
+
let r = ra.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
|
|
2681
2939
|
if (r.length === 0) return !0;
|
|
2682
|
-
let i =
|
|
2940
|
+
let i = ia.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
|
|
2683
2941
|
if (!a) {
|
|
2684
2942
|
let t = e.indexOf(n);
|
|
2685
2943
|
t > 0 && !i.test(e.substring(0, t)) && (a = !0);
|
|
2686
2944
|
}
|
|
2687
2945
|
return a;
|
|
2688
|
-
},
|
|
2946
|
+
}, oa = (e, t, n = ".") => {
|
|
2689
2947
|
if (!e) return;
|
|
2690
2948
|
if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
2691
2949
|
let r = t.split(n), i = e;
|
|
@@ -2704,7 +2962,7 @@ var si = async (e) => {
|
|
|
2704
2962
|
i = t;
|
|
2705
2963
|
}
|
|
2706
2964
|
return i;
|
|
2707
|
-
},
|
|
2965
|
+
}, sa = (e) => e?.replace(/_/g, "-"), ca = {
|
|
2708
2966
|
type: "logger",
|
|
2709
2967
|
log(e) {
|
|
2710
2968
|
this.output("log", e);
|
|
@@ -2723,7 +2981,7 @@ var si = async (e) => {
|
|
|
2723
2981
|
this.init(e, t);
|
|
2724
2982
|
}
|
|
2725
2983
|
init(e, t = {}) {
|
|
2726
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
2984
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || ca, this.options = t, this.debug = t.debug;
|
|
2727
2985
|
}
|
|
2728
2986
|
log(...e) {
|
|
2729
2987
|
return this.forward(e, "log", "", !0);
|
|
@@ -2749,7 +3007,7 @@ var si = async (e) => {
|
|
|
2749
3007
|
clone(t) {
|
|
2750
3008
|
return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
|
|
2751
3009
|
}
|
|
2752
|
-
}(),
|
|
3010
|
+
}(), la = class {
|
|
2753
3011
|
constructor() {
|
|
2754
3012
|
this.observers = {};
|
|
2755
3013
|
}
|
|
@@ -2776,7 +3034,7 @@ var si = async (e) => {
|
|
|
2776
3034
|
for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
|
|
2777
3035
|
});
|
|
2778
3036
|
}
|
|
2779
|
-
},
|
|
3037
|
+
}, ua = class extends la {
|
|
2780
3038
|
constructor(e, t = {
|
|
2781
3039
|
ns: ["translation"],
|
|
2782
3040
|
defaultNS: "translation"
|
|
@@ -2793,12 +3051,12 @@ var si = async (e) => {
|
|
|
2793
3051
|
getResource(e, t, n, r = {}) {
|
|
2794
3052
|
let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
|
|
2795
3053
|
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : Z(n) && i ? o.push(...n.split(i)) : o.push(n)));
|
|
2796
|
-
let s =
|
|
2797
|
-
return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !Z(n) ? s :
|
|
3054
|
+
let s = Xi(this.data, o);
|
|
3055
|
+
return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !Z(n) ? s : oa(this.data?.[e]?.[t], n, i);
|
|
2798
3056
|
}
|
|
2799
3057
|
addResource(e, t, n, r, i = { silent: !1 }) {
|
|
2800
3058
|
let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
|
|
2801
|
-
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t),
|
|
3059
|
+
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), Ji(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
|
|
2802
3060
|
}
|
|
2803
3061
|
addResources(e, t, n, r = { silent: !1 }) {
|
|
2804
3062
|
for (let r in n) (Z(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
|
|
@@ -2810,11 +3068,11 @@ var si = async (e) => {
|
|
|
2810
3068
|
}) {
|
|
2811
3069
|
let o = [e, t];
|
|
2812
3070
|
e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
2813
|
-
let s =
|
|
2814
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ?
|
|
3071
|
+
let s = Xi(this.data, o) || {};
|
|
3072
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? Qi(s, n, i) : s = {
|
|
2815
3073
|
...s,
|
|
2816
3074
|
...n
|
|
2817
|
-
},
|
|
3075
|
+
}, Ji(this.data, o, s), a.silent || this.emit("added", e, t, n);
|
|
2818
3076
|
}
|
|
2819
3077
|
removeResourceBundle(e, t) {
|
|
2820
3078
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -2835,7 +3093,7 @@ var si = async (e) => {
|
|
|
2835
3093
|
toJSON() {
|
|
2836
3094
|
return this.data;
|
|
2837
3095
|
}
|
|
2838
|
-
},
|
|
3096
|
+
}, da = {
|
|
2839
3097
|
processors: {},
|
|
2840
3098
|
addPostProcessor(e) {
|
|
2841
3099
|
this.processors[e.name] = e;
|
|
@@ -2845,22 +3103,22 @@ var si = async (e) => {
|
|
|
2845
3103
|
t = this.processors[e]?.process(t, n, r, i) ?? t;
|
|
2846
3104
|
}), t;
|
|
2847
3105
|
}
|
|
2848
|
-
},
|
|
2849
|
-
function
|
|
3106
|
+
}, fa = Symbol("i18next/PATH_KEY");
|
|
3107
|
+
function pa() {
|
|
2850
3108
|
let e = [], t = Object.create(null), n;
|
|
2851
|
-
return t.get = (r, i) => (n?.revoke?.(), i ===
|
|
3109
|
+
return t.get = (r, i) => (n?.revoke?.(), i === fa ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
|
|
2852
3110
|
}
|
|
2853
|
-
function
|
|
2854
|
-
let { [
|
|
3111
|
+
function ma(e, t) {
|
|
3112
|
+
let { [fa]: n } = e(pa()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
|
|
2855
3113
|
if (n.length > 1 && i) {
|
|
2856
3114
|
let e = t?.ns, a = Array.isArray(e) ? e : null;
|
|
2857
3115
|
if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
|
|
2858
3116
|
}
|
|
2859
3117
|
return n.join(r);
|
|
2860
3118
|
}
|
|
2861
|
-
var
|
|
3119
|
+
var ha = {}, ga = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number", _a = class e extends la {
|
|
2862
3120
|
constructor(e, t = {}) {
|
|
2863
|
-
super(),
|
|
3121
|
+
super(), Ui([
|
|
2864
3122
|
"resourceStore",
|
|
2865
3123
|
"languageUtils",
|
|
2866
3124
|
"pluralResolver",
|
|
@@ -2878,13 +3136,13 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2878
3136
|
if (e == null) return !1;
|
|
2879
3137
|
let r = this.resolve(e, n);
|
|
2880
3138
|
if (r?.res === void 0) return !1;
|
|
2881
|
-
let i =
|
|
3139
|
+
let i = ga(r.res);
|
|
2882
3140
|
return !(n.returnObjects === !1 && i);
|
|
2883
3141
|
}
|
|
2884
3142
|
extractFromKey(e, t) {
|
|
2885
3143
|
let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
|
|
2886
3144
|
n === void 0 && (n = ":");
|
|
2887
|
-
let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
3145
|
+
let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !aa(e, n, r);
|
|
2888
3146
|
if (a && !o) {
|
|
2889
3147
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2890
3148
|
if (t && t.length > 0) return {
|
|
@@ -2902,10 +3160,10 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2902
3160
|
translate(t, n, r) {
|
|
2903
3161
|
let i = typeof n == "object" ? { ...n } : n;
|
|
2904
3162
|
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
|
|
2905
|
-
typeof t == "function" && (t =
|
|
3163
|
+
typeof t == "function" && (t = ma(t, {
|
|
2906
3164
|
...this.options,
|
|
2907
3165
|
...i
|
|
2908
|
-
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ?
|
|
3166
|
+
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? ma(e, {
|
|
2909
3167
|
...this.options,
|
|
2910
3168
|
...i
|
|
2911
3169
|
}) : String(e));
|
|
@@ -2933,7 +3191,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2933
3191
|
"[object RegExp]"
|
|
2934
3192
|
], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, ee = i.count !== void 0 && !Z(i.count), te = e.hasDefaultValue(i), ne = ee ? this.pluralResolver.getSuffix(d, i.count, i) : "", re = i.ordinal && ee ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", ie = ee && !i.ordinal && i.count === 0, b = ie && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${ne}`] || i[`defaultValue${re}`] || i.defaultValue, x = m;
|
|
2935
3193
|
y && !m && te && (x = b);
|
|
2936
|
-
let ae =
|
|
3194
|
+
let ae = ga(x), oe = Object.prototype.toString.apply(x);
|
|
2937
3195
|
if (y && x && ae && _.indexOf(oe) < 0 && !(Z(v) && Array.isArray(x))) {
|
|
2938
3196
|
if (!i.returnObjects && !this.options.returnObjects) {
|
|
2939
3197
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
@@ -2949,7 +3207,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2949
3207
|
let r = `${n}${o}${e}`;
|
|
2950
3208
|
te && !m ? t[e] = this.translate(r, {
|
|
2951
3209
|
...i,
|
|
2952
|
-
defaultValue:
|
|
3210
|
+
defaultValue: ga(b) ? b[e] : void 0,
|
|
2953
3211
|
joinArrays: !1,
|
|
2954
3212
|
ns: c
|
|
2955
3213
|
}) : t[e] = this.translate(r, {
|
|
@@ -3020,7 +3278,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3020
3278
|
!n.lng && r && r.res && (n.lng = this.language || r.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...e) => i?.[0] === e[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : this.translate(...e, t), n)), n.interpolation && this.interpolator.reset();
|
|
3021
3279
|
}
|
|
3022
3280
|
let a = n.postProcess || this.options.postProcess, o = Z(a) ? [a] : a;
|
|
3023
|
-
return e != null && o?.length && n.applyPostProcessor !== !1 && (e =
|
|
3281
|
+
return e != null && o?.length && n.applyPostProcessor !== !1 && (e = da.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
3024
3282
|
i18nResolved: {
|
|
3025
3283
|
...r,
|
|
3026
3284
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -3030,7 +3288,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3030
3288
|
}
|
|
3031
3289
|
resolve(e, t = {}) {
|
|
3032
3290
|
let n, r, i, a, o;
|
|
3033
|
-
return Z(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ?
|
|
3291
|
+
return Z(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? ma(e, {
|
|
3034
3292
|
...this.options,
|
|
3035
3293
|
...t
|
|
3036
3294
|
}) : e)), e.forEach((e) => {
|
|
@@ -3041,7 +3299,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3041
3299
|
this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
|
|
3042
3300
|
let u = t.count !== void 0 && !Z(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (Z(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
3043
3301
|
l.forEach((e) => {
|
|
3044
|
-
this.isValidLookup(n) || (o = e, !
|
|
3302
|
+
this.isValidLookup(n) || (o = e, !ha[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (ha[`${p[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), p.forEach((r) => {
|
|
3045
3303
|
if (this.isValidLookup(n)) return;
|
|
3046
3304
|
a = r;
|
|
3047
3305
|
let o = [c];
|
|
@@ -3104,17 +3362,17 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3104
3362
|
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
|
|
3105
3363
|
return !1;
|
|
3106
3364
|
}
|
|
3107
|
-
},
|
|
3365
|
+
}, va = class {
|
|
3108
3366
|
constructor(e) {
|
|
3109
3367
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Q.create("languageUtils");
|
|
3110
3368
|
}
|
|
3111
3369
|
getScriptPartFromCode(e) {
|
|
3112
|
-
if (e =
|
|
3370
|
+
if (e = sa(e), !e || e.indexOf("-") < 0) return null;
|
|
3113
3371
|
let t = e.split("-");
|
|
3114
3372
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
3115
3373
|
}
|
|
3116
3374
|
getLanguagePartFromCode(e) {
|
|
3117
|
-
if (e =
|
|
3375
|
+
if (e = sa(e), !e || e.indexOf("-") < 0) return e;
|
|
3118
3376
|
let t = e.split("-");
|
|
3119
3377
|
return this.formatLanguageCode(t[0]);
|
|
3120
3378
|
}
|
|
@@ -3164,17 +3422,17 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3164
3422
|
r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
|
|
3165
3423
|
}), r;
|
|
3166
3424
|
}
|
|
3167
|
-
},
|
|
3425
|
+
}, ya = {
|
|
3168
3426
|
zero: 0,
|
|
3169
3427
|
one: 1,
|
|
3170
3428
|
two: 2,
|
|
3171
3429
|
few: 3,
|
|
3172
3430
|
many: 4,
|
|
3173
3431
|
other: 5
|
|
3174
|
-
},
|
|
3432
|
+
}, ba = {
|
|
3175
3433
|
select: (e) => e === 1 ? "one" : "other",
|
|
3176
3434
|
resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
|
|
3177
|
-
},
|
|
3435
|
+
}, xa = class {
|
|
3178
3436
|
constructor(e, t = {}) {
|
|
3179
3437
|
this.languageUtils = e, this.options = t, this.logger = Q.create("pluralResolver"), this.pluralRulesCache = {};
|
|
3180
3438
|
}
|
|
@@ -3182,7 +3440,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3182
3440
|
this.pluralRulesCache = {};
|
|
3183
3441
|
}
|
|
3184
3442
|
getRule(e, t = {}) {
|
|
3185
|
-
let n =
|
|
3443
|
+
let n = sa(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
|
|
3186
3444
|
cleanedCode: n,
|
|
3187
3445
|
type: r
|
|
3188
3446
|
});
|
|
@@ -3191,8 +3449,8 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3191
3449
|
try {
|
|
3192
3450
|
a = new Intl.PluralRules(n, { type: r });
|
|
3193
3451
|
} catch {
|
|
3194
|
-
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
3195
|
-
if (!e.match(/-|_/)) return
|
|
3452
|
+
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), ba;
|
|
3453
|
+
if (!e.match(/-|_/)) return ba;
|
|
3196
3454
|
let n = this.languageUtils.getLanguagePartFromCode(e);
|
|
3197
3455
|
a = this.getRule(n, t);
|
|
3198
3456
|
}
|
|
@@ -3207,23 +3465,23 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3207
3465
|
}
|
|
3208
3466
|
getSuffixes(e, t = {}) {
|
|
3209
3467
|
let n = this.getRule(e, t);
|
|
3210
|
-
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) =>
|
|
3468
|
+
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => ya[e] - ya[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
|
|
3211
3469
|
}
|
|
3212
3470
|
getSuffix(e, t, n = {}) {
|
|
3213
3471
|
let r = this.getRule(e, n);
|
|
3214
3472
|
return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
|
|
3215
3473
|
}
|
|
3216
|
-
},
|
|
3217
|
-
let a =
|
|
3218
|
-
return !a && i && Z(n) && (a =
|
|
3219
|
-
},
|
|
3474
|
+
}, Sa = (e, t, n, r = ".", i = !0) => {
|
|
3475
|
+
let a = Zi(e, t, n);
|
|
3476
|
+
return !a && i && Z(n) && (a = oa(e, n, r), a === void 0 && (a = oa(t, n, r))), a;
|
|
3477
|
+
}, Ca = (e) => e.replace(/\$/g, "$$$$"), wa = class {
|
|
3220
3478
|
constructor(e = {}) {
|
|
3221
3479
|
this.logger = Q.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
|
|
3222
3480
|
}
|
|
3223
3481
|
init(e = {}) {
|
|
3224
3482
|
e.interpolation ||= { escapeValue: !0 };
|
|
3225
3483
|
let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: g, alwaysFormat: _ } = e.interpolation;
|
|
3226
|
-
this.escape = t === void 0 ?
|
|
3484
|
+
this.escape = t === void 0 ? ta : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? $i(i) : a || "{{", this.suffix = o ? $i(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? $i(d) : f || $i("$t("), this.nestingSuffix = p ? $i(p) : m || $i(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
|
|
3227
3485
|
}
|
|
3228
3486
|
reset() {
|
|
3229
3487
|
this.options && this.init(this.options);
|
|
@@ -3235,7 +3493,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3235
3493
|
interpolate(e, t, n, r) {
|
|
3236
3494
|
let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
|
|
3237
3495
|
if (e.indexOf(this.formatSeparator) < 0) {
|
|
3238
|
-
let i =
|
|
3496
|
+
let i = Sa(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
3239
3497
|
return this.alwaysFormat ? this.format(i, void 0, n, {
|
|
3240
3498
|
...r,
|
|
3241
3499
|
...t,
|
|
@@ -3243,7 +3501,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3243
3501
|
}) : i;
|
|
3244
3502
|
}
|
|
3245
3503
|
let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
|
|
3246
|
-
return this.format(
|
|
3504
|
+
return this.format(Sa(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
|
|
3247
3505
|
...r,
|
|
3248
3506
|
...t,
|
|
3249
3507
|
interpolationkey: a
|
|
@@ -3253,10 +3511,10 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3253
3511
|
let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
|
|
3254
3512
|
return [{
|
|
3255
3513
|
regex: this.regexpUnescape,
|
|
3256
|
-
safeValue: (e) =>
|
|
3514
|
+
safeValue: (e) => Ca(e)
|
|
3257
3515
|
}, {
|
|
3258
3516
|
regex: this.regexp,
|
|
3259
|
-
safeValue: (e) => this.escapeValue ?
|
|
3517
|
+
safeValue: (e) => this.escapeValue ? Ca(this.escape(e)) : Ca(e)
|
|
3260
3518
|
}].forEach((t) => {
|
|
3261
3519
|
for (o = 0; i = t.regex.exec(e);) {
|
|
3262
3520
|
let n = i[1].trim();
|
|
@@ -3268,7 +3526,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3268
3526
|
a = i[0];
|
|
3269
3527
|
continue;
|
|
3270
3528
|
} else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
|
|
3271
|
-
else !Z(a) && !this.useRawValueToEscape && (a =
|
|
3529
|
+
else !Z(a) && !this.useRawValueToEscape && (a = Hi(a));
|
|
3272
3530
|
let s = t.safeValue(a);
|
|
3273
3531
|
if (e = e.replace(i[0], s), u ? (t.regex.lastIndex += a.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
|
|
3274
3532
|
}
|
|
@@ -3278,7 +3536,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3278
3536
|
let r, i, a, o = (e, t) => {
|
|
3279
3537
|
let n = this.nestingOptionsSeparator;
|
|
3280
3538
|
if (e.indexOf(n) < 0) return e;
|
|
3281
|
-
let r = e.split(RegExp(`${
|
|
3539
|
+
let r = e.split(RegExp(`${$i(n)}[ ]*{`)), i = `{${r[1]}`;
|
|
3282
3540
|
e = r[0], i = this.interpolate(i, a);
|
|
3283
3541
|
let o = i.match(/'/g), s = i.match(/"/g);
|
|
3284
3542
|
((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
|
|
@@ -3297,14 +3555,14 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3297
3555
|
a = { ...n }, a = a.replace && !Z(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
3298
3556
|
let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
|
|
3299
3557
|
if (c !== -1 && (s = r[1].slice(c).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), r[1] = r[1].slice(0, c)), i = t(o.call(this, r[1].trim(), a), a), i && r[0] === e && !Z(i)) return i;
|
|
3300
|
-
Z(i) || (i =
|
|
3558
|
+
Z(i) || (i = Hi(i)), i ||= (this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`), ""), s.length && (i = s.reduce((e, t) => this.format(e, t, n.lng, {
|
|
3301
3559
|
...n,
|
|
3302
3560
|
interpolationkey: r[1].trim()
|
|
3303
3561
|
}), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
|
|
3304
3562
|
}
|
|
3305
3563
|
return e;
|
|
3306
3564
|
}
|
|
3307
|
-
},
|
|
3565
|
+
}, Ta = (e) => {
|
|
3308
3566
|
let t = e.toLowerCase().trim(), n = {};
|
|
3309
3567
|
if (e.indexOf("(") > -1) {
|
|
3310
3568
|
let r = e.split("(");
|
|
@@ -3321,7 +3579,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3321
3579
|
formatName: t,
|
|
3322
3580
|
formatOptions: n
|
|
3323
3581
|
};
|
|
3324
|
-
},
|
|
3582
|
+
}, Ea = (e) => {
|
|
3325
3583
|
let t = {};
|
|
3326
3584
|
return (n, r, i) => {
|
|
3327
3585
|
let a = i;
|
|
@@ -3330,15 +3588,15 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3330
3588
|
[i.interpolationkey]: void 0
|
|
3331
3589
|
});
|
|
3332
3590
|
let o = r + JSON.stringify(a), s = t[o];
|
|
3333
|
-
return s || (s = e(
|
|
3591
|
+
return s || (s = e(sa(r), i), t[o] = s), s(n);
|
|
3334
3592
|
};
|
|
3335
|
-
},
|
|
3593
|
+
}, Da = (e) => (t, n, r) => e(sa(n), r)(t), Oa = class {
|
|
3336
3594
|
constructor(e = {}) {
|
|
3337
3595
|
this.logger = Q.create("formatter"), this.options = e, this.init(e);
|
|
3338
3596
|
}
|
|
3339
3597
|
init(e, t = { interpolation: {} }) {
|
|
3340
3598
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
3341
|
-
let n = t.cacheInBuiltFormats ?
|
|
3599
|
+
let n = t.cacheInBuiltFormats ? Ea : Da;
|
|
3342
3600
|
this.formats = {
|
|
3343
3601
|
number: n((e, t) => {
|
|
3344
3602
|
let n = new Intl.NumberFormat(e, { ...t });
|
|
@@ -3369,7 +3627,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3369
3627
|
this.formats[e.toLowerCase().trim()] = t;
|
|
3370
3628
|
}
|
|
3371
3629
|
addCached(e, t) {
|
|
3372
|
-
this.formats[e.toLowerCase().trim()] =
|
|
3630
|
+
this.formats[e.toLowerCase().trim()] = Ea(t);
|
|
3373
3631
|
}
|
|
3374
3632
|
format(e, t, n, r = {}) {
|
|
3375
3633
|
let i = t.split(this.formatSeparator);
|
|
@@ -3378,7 +3636,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3378
3636
|
i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
|
|
3379
3637
|
}
|
|
3380
3638
|
return i.reduce((e, t) => {
|
|
3381
|
-
let { formatName: i, formatOptions: a } =
|
|
3639
|
+
let { formatName: i, formatOptions: a } = Ta(t);
|
|
3382
3640
|
if (this.formats[i]) {
|
|
3383
3641
|
let t = e;
|
|
3384
3642
|
try {
|
|
@@ -3396,9 +3654,9 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3396
3654
|
return e;
|
|
3397
3655
|
}, e);
|
|
3398
3656
|
}
|
|
3399
|
-
},
|
|
3657
|
+
}, ka = (e, t) => {
|
|
3400
3658
|
e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
|
|
3401
|
-
},
|
|
3659
|
+
}, Aa = class extends la {
|
|
3402
3660
|
constructor(e, t, n, r = {}) {
|
|
3403
3661
|
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = Q.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
|
|
3404
3662
|
}
|
|
@@ -3428,7 +3686,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3428
3686
|
t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
|
|
3429
3687
|
let o = {};
|
|
3430
3688
|
this.queue.forEach((n) => {
|
|
3431
|
-
|
|
3689
|
+
Yi(n.loaded, [i], a), ka(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
|
|
3432
3690
|
o[e] || (o[e] = {});
|
|
3433
3691
|
let t = n.loaded[e];
|
|
3434
3692
|
t.length && t.forEach((t) => {
|
|
@@ -3518,7 +3776,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3518
3776
|
!e || !e[0] || this.store.addResource(e[0], t, n, r);
|
|
3519
3777
|
}
|
|
3520
3778
|
}
|
|
3521
|
-
},
|
|
3779
|
+
}, ja = () => ({
|
|
3522
3780
|
debug: !1,
|
|
3523
3781
|
initAsync: !0,
|
|
3524
3782
|
ns: ["translation"],
|
|
@@ -3575,15 +3833,15 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3575
3833
|
skipOnVariables: !0
|
|
3576
3834
|
},
|
|
3577
3835
|
cacheInBuiltFormats: !0
|
|
3578
|
-
}),
|
|
3836
|
+
}), Ma = (e) => (Z(e.ns) && (e.ns = [e.ns]), Z(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), Z(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs?.indexOf?.("cimode") < 0 && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), typeof e.initImmediate == "boolean" && (e.initAsync = e.initImmediate), e), Na = () => {}, Pa = (e) => {
|
|
3579
3837
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
|
|
3580
3838
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
3581
3839
|
});
|
|
3582
|
-
},
|
|
3583
|
-
typeof globalThis < "u" && (globalThis[
|
|
3584
|
-
},
|
|
3840
|
+
}, Fa = "__i18next_supportNoticeShown", Ia = () => !!(typeof globalThis < "u" && globalThis[Fa] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), La = () => {
|
|
3841
|
+
typeof globalThis < "u" && (globalThis[Fa] = !0);
|
|
3842
|
+
}, Ra = (e) => !!(e?.modules?.backend?.name?.indexOf("Locize") > 0 || e?.modules?.backend?.constructor?.name?.indexOf("Locize") > 0 || e?.options?.backend?.backends && e.options.backend.backends.some((e) => e?.name?.indexOf("Locize") > 0 || e?.constructor?.name?.indexOf("Locize") > 0) || e?.options?.backend?.projectId || e?.options?.backend?.backendOptions && e.options.backend.backendOptions.some((e) => e?.projectId)), $ = class e extends la {
|
|
3585
3843
|
constructor(e = {}, t) {
|
|
3586
|
-
if (super(), this.options =
|
|
3844
|
+
if (super(), this.options = Ma(e), this.services = {}, this.logger = Q, this.modules = { external: [] }, Pa(this), t && !this.isInitialized && !e.isClone) {
|
|
3587
3845
|
if (!this.options.initAsync) return this.init(e, t), this;
|
|
3588
3846
|
setTimeout(() => {
|
|
3589
3847
|
this.init(e, t);
|
|
@@ -3592,35 +3850,35 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3592
3850
|
}
|
|
3593
3851
|
init(e = {}, t) {
|
|
3594
3852
|
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (Z(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
3595
|
-
let n =
|
|
3853
|
+
let n = ja();
|
|
3596
3854
|
this.options = {
|
|
3597
3855
|
...n,
|
|
3598
3856
|
...this.options,
|
|
3599
|
-
...
|
|
3857
|
+
...Ma(e)
|
|
3600
3858
|
}, this.options.interpolation = {
|
|
3601
3859
|
...n.interpolation,
|
|
3602
3860
|
...this.options.interpolation
|
|
3603
|
-
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = n.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !
|
|
3861
|
+
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = n.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !Ra(this) && !Ia() && (typeof console < "u" && console.info !== void 0 && console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"), La());
|
|
3604
3862
|
let r = (e) => e ? typeof e == "function" ? new e() : e : null;
|
|
3605
3863
|
if (!this.options.isClone) {
|
|
3606
3864
|
this.modules.logger ? Q.init(r(this.modules.logger), this.options) : Q.init(null, this.options);
|
|
3607
3865
|
let e;
|
|
3608
|
-
e = this.modules.formatter ? this.modules.formatter :
|
|
3609
|
-
let t = new
|
|
3610
|
-
this.store = new
|
|
3866
|
+
e = this.modules.formatter ? this.modules.formatter : Oa;
|
|
3867
|
+
let t = new va(this.options);
|
|
3868
|
+
this.store = new ua(this.options.resources, this.options);
|
|
3611
3869
|
let i = this.services;
|
|
3612
|
-
i.logger = Q, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new
|
|
3870
|
+
i.logger = Q, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new xa(t, {
|
|
3613
3871
|
prepend: this.options.pluralSeparator,
|
|
3614
3872
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
3615
|
-
}), this.options.interpolation.format && this.options.interpolation.format !== n.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), e && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (i.formatter = r(e), i.formatter.init && i.formatter.init(i, this.options), this.options.interpolation.format = i.formatter.format.bind(i.formatter)), i.interpolator = new
|
|
3873
|
+
}), this.options.interpolation.format && this.options.interpolation.format !== n.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), e && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (i.formatter = r(e), i.formatter.init && i.formatter.init(i, this.options), this.options.interpolation.format = i.formatter.format.bind(i.formatter)), i.interpolator = new wa(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new Aa(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
|
|
3616
3874
|
this.emit(e, ...t);
|
|
3617
|
-
}), this.modules.languageDetector && (i.languageDetector = r(this.modules.languageDetector), i.languageDetector.init && i.languageDetector.init(i, this.options.detection, this.options)), this.modules.i18nFormat && (i.i18nFormat = r(this.modules.i18nFormat), i.i18nFormat.init && i.i18nFormat.init(this)), this.translator = new
|
|
3875
|
+
}), this.modules.languageDetector && (i.languageDetector = r(this.modules.languageDetector), i.languageDetector.init && i.languageDetector.init(i, this.options.detection, this.options)), this.modules.i18nFormat && (i.i18nFormat = r(this.modules.i18nFormat), i.i18nFormat.init && i.i18nFormat.init(this)), this.translator = new _a(this.services, this.options), this.translator.on("*", (e, ...t) => {
|
|
3618
3876
|
this.emit(e, ...t);
|
|
3619
3877
|
}), this.modules.external.forEach((e) => {
|
|
3620
3878
|
e.init && e.init(this);
|
|
3621
3879
|
});
|
|
3622
3880
|
}
|
|
3623
|
-
if (this.format = this.options.interpolation.format, t ||=
|
|
3881
|
+
if (this.format = this.options.interpolation.format, t ||= Na, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
3624
3882
|
let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
3625
3883
|
e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
|
|
3626
3884
|
}
|
|
@@ -3639,7 +3897,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3639
3897
|
].forEach((e) => {
|
|
3640
3898
|
this[e] = (...t) => (this.store[e](...t), this);
|
|
3641
3899
|
});
|
|
3642
|
-
let i =
|
|
3900
|
+
let i = Vi(), a = () => {
|
|
3643
3901
|
let e = (e, n) => {
|
|
3644
3902
|
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), i.resolve(n), t(e, n);
|
|
3645
3903
|
};
|
|
@@ -3648,7 +3906,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3648
3906
|
};
|
|
3649
3907
|
return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
|
|
3650
3908
|
}
|
|
3651
|
-
loadResources(e, t =
|
|
3909
|
+
loadResources(e, t = Na) {
|
|
3652
3910
|
let n = t, r = Z(e) ? e : this.language;
|
|
3653
3911
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
3654
3912
|
if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
@@ -3663,15 +3921,15 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3663
3921
|
} else n(null);
|
|
3664
3922
|
}
|
|
3665
3923
|
reloadResources(e, t, n) {
|
|
3666
|
-
let r =
|
|
3667
|
-
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||=
|
|
3924
|
+
let r = Vi();
|
|
3925
|
+
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||= Na, this.services.backendConnector.reload(e, t, (e) => {
|
|
3668
3926
|
r.resolve(), n(e);
|
|
3669
3927
|
}), r;
|
|
3670
3928
|
}
|
|
3671
3929
|
use(e) {
|
|
3672
3930
|
if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
3673
3931
|
if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
3674
|
-
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" &&
|
|
3932
|
+
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && da.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
3675
3933
|
}
|
|
3676
3934
|
setResolvedLanguage(e) {
|
|
3677
3935
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
@@ -3687,7 +3945,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3687
3945
|
}
|
|
3688
3946
|
changeLanguage(e, t) {
|
|
3689
3947
|
this.isLanguageChangingTo = e;
|
|
3690
|
-
let n =
|
|
3948
|
+
let n = Vi();
|
|
3691
3949
|
this.emit("languageChanging", e);
|
|
3692
3950
|
let r = (e) => {
|
|
3693
3951
|
this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
|
|
@@ -3710,9 +3968,9 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3710
3968
|
...this.options,
|
|
3711
3969
|
...a
|
|
3712
3970
|
};
|
|
3713
|
-
typeof a.keyPrefix == "function" && (a.keyPrefix =
|
|
3971
|
+
typeof a.keyPrefix == "function" && (a.keyPrefix = ma(a.keyPrefix, o));
|
|
3714
3972
|
let s = this.options.keySeparator || ".", c;
|
|
3715
|
-
return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e =
|
|
3973
|
+
return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = ma(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = ma(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
|
|
3716
3974
|
};
|
|
3717
3975
|
return Z(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
|
|
3718
3976
|
}
|
|
@@ -3741,7 +3999,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3741
3999
|
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
|
|
3742
4000
|
}
|
|
3743
4001
|
loadNamespaces(e, t) {
|
|
3744
|
-
let n =
|
|
4002
|
+
let n = Vi();
|
|
3745
4003
|
return this.options.ns ? (Z(e) && (e = [e]), e.forEach((e) => {
|
|
3746
4004
|
this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
|
|
3747
4005
|
}), this.loadResources((e) => {
|
|
@@ -3749,7 +4007,7 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3749
4007
|
}), n) : (t && t(), Promise.resolve());
|
|
3750
4008
|
}
|
|
3751
4009
|
loadLanguages(e, t) {
|
|
3752
|
-
let n =
|
|
4010
|
+
let n = Vi();
|
|
3753
4011
|
Z(e) && (e = [e]);
|
|
3754
4012
|
let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
|
|
3755
4013
|
return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
|
|
@@ -3765,14 +4023,14 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3765
4023
|
if (e && e.direction) return e.direction;
|
|
3766
4024
|
}
|
|
3767
4025
|
} catch {}
|
|
3768
|
-
let t = /* @__PURE__ */ "ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb".split("."), n = this.services?.languageUtils || new
|
|
4026
|
+
let t = /* @__PURE__ */ "ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb".split("."), n = this.services?.languageUtils || new va(ja());
|
|
3769
4027
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
3770
4028
|
}
|
|
3771
4029
|
static createInstance(t = {}, n) {
|
|
3772
4030
|
let r = new e(t, n);
|
|
3773
4031
|
return r.createInstance = e.createInstance, r;
|
|
3774
4032
|
}
|
|
3775
|
-
cloneInstance(t = {}, n =
|
|
4033
|
+
cloneInstance(t = {}, n = Na) {
|
|
3776
4034
|
let r = t.forkResourceStore;
|
|
3777
4035
|
r && delete t.forkResourceStore;
|
|
3778
4036
|
let i = {
|
|
@@ -3786,18 +4044,18 @@ var Ri = {}, zi = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3786
4044
|
"language"
|
|
3787
4045
|
].forEach((e) => {
|
|
3788
4046
|
a[e] = this[e];
|
|
3789
|
-
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new
|
|
4047
|
+
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new ua(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, e[t] = Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), e[t]), e), {}), i), a.services.resourceStore = a.store), t.interpolation) {
|
|
3790
4048
|
let e = {
|
|
3791
|
-
...
|
|
4049
|
+
...ja().interpolation,
|
|
3792
4050
|
...this.options.interpolation,
|
|
3793
4051
|
...t.interpolation
|
|
3794
4052
|
}, n = {
|
|
3795
4053
|
...i,
|
|
3796
4054
|
interpolation: e
|
|
3797
4055
|
};
|
|
3798
|
-
a.services.interpolator = new
|
|
4056
|
+
a.services.interpolator = new wa(n);
|
|
3799
4057
|
}
|
|
3800
|
-
return a.translator = new
|
|
4058
|
+
return a.translator = new _a(a.services, i), a.translator.on("*", (e, ...t) => {
|
|
3801
4059
|
a.emit(e, ...t);
|
|
3802
4060
|
}), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
|
|
3803
4061
|
}
|
|
@@ -3818,13 +4076,13 @@ $.createInstance, $.dir, $.init, $.loadResources, $.reloadResources, $.use, $.ch
|
|
|
3818
4076
|
lng: "en",
|
|
3819
4077
|
showSupportNotice: !1,
|
|
3820
4078
|
resources: {
|
|
3821
|
-
en:
|
|
3822
|
-
es:
|
|
4079
|
+
en: zi,
|
|
4080
|
+
es: Bi
|
|
3823
4081
|
}
|
|
3824
4082
|
});
|
|
3825
4083
|
//#endregion
|
|
3826
4084
|
//#region src/i18n.ts
|
|
3827
|
-
var { translator:
|
|
4085
|
+
var { translator: za } = {
|
|
3828
4086
|
translator: {
|
|
3829
4087
|
...$,
|
|
3830
4088
|
t: (e, t) => {
|
|
@@ -3856,13 +4114,13 @@ var { translator: ca } = {
|
|
|
3856
4114
|
label: "Spanish"
|
|
3857
4115
|
}]
|
|
3858
4116
|
};
|
|
3859
|
-
function
|
|
3860
|
-
return
|
|
4117
|
+
function Ba(e, t) {
|
|
4118
|
+
return za.t(`translation:simpleCloze:${e}`, { lng: t });
|
|
3861
4119
|
}
|
|
3862
|
-
function
|
|
3863
|
-
return
|
|
4120
|
+
function Va(e, t) {
|
|
4121
|
+
return za.t(`common:${e}`, { lng: t });
|
|
3864
4122
|
}
|
|
3865
4123
|
//#endregion
|
|
3866
|
-
export {
|
|
4124
|
+
export { an as a, Qt as c, on as i, Pt as l, Va as n, Ft as o, Ri as r, qt as s, Ba as t };
|
|
3867
4125
|
|
|
3868
|
-
//# sourceMappingURL=i18n-
|
|
4126
|
+
//# sourceMappingURL=i18n-CXqnW0mV.js.map
|