@templatical/editor 0.0.1 → 0.0.3
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/AiChatSidebar-busJk9hm.js +214 -0
- package/dist/AiFeatureMenu-DLGv_-pj.js +63 -0
- package/dist/CloudEditor-BDnHd6Um.js +919 -0
- package/dist/CollaboratorBar-Dv3l52vC.js +91 -0
- package/dist/CommentsSidebar-4tjp0VU5.js +439 -0
- package/dist/DesignReferenceSidebar-CmwXvltV.js +273 -0
- package/dist/LoadingTrack-vK8W2PJf.js +10 -0
- package/dist/ModuleBrowserModal-lrk3Fr0H.js +205 -0
- package/dist/ModulePreviewCanvas-BcBJLnwL.js +106 -0
- package/dist/ParagraphEditor-DH8cSC6m.js +625 -0
- package/dist/RichTextEditorContent-CQqodi7p.js +133 -0
- package/dist/SaveModuleDialog-Bmzi72td.js +122 -0
- package/dist/SnapshotHistory-AEgi9Xsn.js +126 -0
- package/dist/TemplateScoringPanel-CTgMtc0-.js +249 -0
- package/dist/TestEmailModal-Dpq1is9S.js +94 -0
- package/dist/TitleEditor-CLcDdcWI.js +167 -0
- package/dist/TplModal-CGzRjR96.js +44 -0
- package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
- package/dist/blockTypeIcons-BpPTqcok.js +126 -0
- package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +3 -0
- package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +2 -0
- package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +3 -0
- package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +1 -0
- package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
- package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
- package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
- package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
- package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
- package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
- package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
- package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
- package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
- package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
- package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
- package/dist/cdn/chunks/extensions-ea_ewKUl.js +2 -0
- package/dist/cdn/chunks/extensions-ea_ewKUl.js.map +1 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
- package/dist/cdn/chunks/styleConstants-CNejCb-L.js +2 -0
- package/dist/cdn/chunks/styleConstants-CNejCb-L.js.map +1 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
- package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +2 -0
- package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +1 -0
- package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +2 -0
- package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +1 -0
- package/dist/cdn/editor.css +1 -0
- package/dist/cdn/editor.js +2 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/check-B7kDuZmP.js +7 -0
- package/dist/chevron-down-DJLW2Q9Z.js +7 -0
- package/dist/circle-alert-E2vYPs5r.js +25 -0
- package/dist/clock-lWIIQA3C.js +12 -0
- package/dist/de-B4Ob4vCo.js +682 -0
- package/dist/dist-4LiM9FDd.js +35 -0
- package/dist/dist-Bu7veieH.js +776 -0
- package/dist/dist-C1BIRHCQ.js +61 -0
- package/dist/dist-CG-vEqSU.js +314 -0
- package/dist/dist-C_ymrGFi.js +10625 -0
- package/dist/dist-ChAGLpWo.js +35 -0
- package/dist/dist-D_HQYSY-.js +189 -0
- package/dist/dist-DkypH7qG.js +5 -0
- package/dist/dist-DmOE-Ubp.js +74 -0
- package/dist/dist-DmpMJbmZ.js +513 -0
- package/dist/dist-DrvKRSU6.js +47 -0
- package/dist/dist-Dxnd0GRf.js +5 -0
- package/dist/dist-DysAFIPy.js +2054 -0
- package/dist/emojiData-BfWQS72m.js +17 -0
- package/dist/en-YXsspZJG.js +682 -0
- package/dist/extensions-CKM99njP.js +420 -0
- package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
- package/dist/i18n-CJsFtdbZ.js +23 -0
- package/dist/image-up-X4xIq4ea.js +23 -0
- package/dist/keys-Dwa2PmdD.js +10 -0
- package/dist/liquid.browser-BemTg3sZ.js +3272 -0
- package/dist/loader-circle-BTQQxC3l.js +7 -0
- package/dist/message-circle-Blgm6V_h.js +7 -0
- package/dist/refresh-cw-Bb4PEeW1.js +44 -0
- package/dist/scan-line-7lZPfOdm.js +25 -0
- package/dist/send-C0ltAQrv.js +10 -0
- package/dist/shield-check-f-qv4RKs.js +10 -0
- package/dist/sparkles-KhBCGlqB.js +23 -0
- package/dist/styleConstants-D4SOZGBV.js +94 -0
- package/dist/styles-DSw1VNU3.js +3406 -0
- package/dist/templatical-editor.css +2 -1
- package/dist/templatical-editor.js +242 -9
- package/dist/templatical-editor.umd.cjs +112 -524
- package/dist/timeouts-CmBrLeZA.js +4 -0
- package/dist/trash-2-OwjZ-guZ.js +25 -0
- package/dist/triangle-alert-DOSRIUYZ.js +17 -0
- package/dist/useEditorCore-Cc4RCwWq.js +5556 -0
- package/dist/useI18n-DUirdXEX.js +17 -0
- package/dist/useMergeTag-DVnlvPYJ.js +33 -0
- package/dist/x-CGlq2XQe.js +10 -0
- package/package.json +30 -20
- package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
- package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
- package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
- package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
- package/dist/CommentsSidebar-PVUlloyB.js +0 -655
- package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
- package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
- package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
- package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
- package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
- package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
- package/dist/TestEmailModal-Cwre5elw.js +0 -128
- package/dist/TextEditor-BuUOIByX.js +0 -780
- package/dist/de-BWIAblxs.js +0 -685
- package/dist/en-cYyUzNV1.js +0 -685
- package/dist/index-0tWUczNu.js +0 -47
- package/dist/index-4okvXjqk.js +0 -41
- package/dist/index-BSc6h5zo.js +0 -967
- package/dist/index-CrvwWlhN.js +0 -41
- package/dist/index-D-iD-7lO.js +0 -10961
- package/dist/index-D-ygXbc8.js +0 -2452
- package/dist/index-DbrWKz-e.js +0 -1415
- package/dist/index-DeUeHy6g.js +0 -422
- package/dist/index-Ude6e9RU.js +0 -41
- package/dist/index-ZQzHBwkr.js +0 -12767
- package/dist/liquid.browser-CeNxS2GL.js +0 -3493
- package/dist/loader-circle-tM9j2mRh.js +0 -13
- package/dist/shield-check-Ngi9jAQc.js +0 -20
|
@@ -1,3493 +0,0 @@
|
|
|
1
|
-
class z {
|
|
2
|
-
constructor(e, s, i, r, n) {
|
|
3
|
-
this.kind = e, this.input = s, this.begin = i, this.end = r, this.file = n;
|
|
4
|
-
}
|
|
5
|
-
getText() {
|
|
6
|
-
return this.input.slice(this.begin, this.end);
|
|
7
|
-
}
|
|
8
|
-
getPosition() {
|
|
9
|
-
let [e, s] = [1, 1];
|
|
10
|
-
for (let i = 0; i < this.begin; i++)
|
|
11
|
-
this.input[i] === `
|
|
12
|
-
` ? (e++, s = 1) : s++;
|
|
13
|
-
return [e, s];
|
|
14
|
-
}
|
|
15
|
-
size() {
|
|
16
|
-
return this.end - this.begin;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
class Y {
|
|
20
|
-
liquidMethodMissing(e, s) {
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
const Wt = Object.prototype.toString, Pe = String.prototype.toLowerCase, Le = Object.hasOwnProperty;
|
|
24
|
-
function f(t) {
|
|
25
|
-
return typeof t == "string";
|
|
26
|
-
}
|
|
27
|
-
function v(t) {
|
|
28
|
-
return typeof t == "function";
|
|
29
|
-
}
|
|
30
|
-
function Yt(t) {
|
|
31
|
-
return t && v(t.then);
|
|
32
|
-
}
|
|
33
|
-
function le(t) {
|
|
34
|
-
return t && v(t.next) && v(t.throw) && v(t.return);
|
|
35
|
-
}
|
|
36
|
-
function u(t) {
|
|
37
|
-
return t = p(t), f(t) ? t : O(t) ? "" : x(t) ? t.map((e) => u(e)).join("") : String(t);
|
|
38
|
-
}
|
|
39
|
-
function ie(t) {
|
|
40
|
-
return t = p(t), x(t) ? t : f(t) && t.length > 0 ? [t] : Zt(t) ? Array.from(t) : pe(t) ? Object.keys(t).map((e) => [e, t[e]]) : [];
|
|
41
|
-
}
|
|
42
|
-
function S(t) {
|
|
43
|
-
return t = p(t), O(t) ? [] : x(t) ? t : [t];
|
|
44
|
-
}
|
|
45
|
-
function p(t) {
|
|
46
|
-
return t instanceof Y && v(t.valueOf) ? t.valueOf() : t;
|
|
47
|
-
}
|
|
48
|
-
function ve(t) {
|
|
49
|
-
return +p(t) || 0;
|
|
50
|
-
}
|
|
51
|
-
function de(t) {
|
|
52
|
-
return typeof t == "number";
|
|
53
|
-
}
|
|
54
|
-
function pt(t) {
|
|
55
|
-
return t && v(t.toLiquid) ? pt(t.toLiquid()) : t;
|
|
56
|
-
}
|
|
57
|
-
function O(t) {
|
|
58
|
-
return t == null;
|
|
59
|
-
}
|
|
60
|
-
function Jt(t) {
|
|
61
|
-
return t === void 0;
|
|
62
|
-
}
|
|
63
|
-
function x(t) {
|
|
64
|
-
return Wt.call(t) === "[object Array]";
|
|
65
|
-
}
|
|
66
|
-
function gt(t) {
|
|
67
|
-
return t && de(t.length);
|
|
68
|
-
}
|
|
69
|
-
function Zt(t) {
|
|
70
|
-
return pe(t) && Symbol.iterator in t;
|
|
71
|
-
}
|
|
72
|
-
function Ie(t, e) {
|
|
73
|
-
t = t || {};
|
|
74
|
-
for (const s in t)
|
|
75
|
-
if (Le.call(t, s) && e(t[s], s, t) === !1)
|
|
76
|
-
break;
|
|
77
|
-
return t;
|
|
78
|
-
}
|
|
79
|
-
function mt(t) {
|
|
80
|
-
return t[t.length - 1];
|
|
81
|
-
}
|
|
82
|
-
function pe(t) {
|
|
83
|
-
const e = typeof t;
|
|
84
|
-
return t !== null && (e === "object" || e === "function");
|
|
85
|
-
}
|
|
86
|
-
function yt(t, e, s = 1) {
|
|
87
|
-
const i = [];
|
|
88
|
-
for (let r = t; r < e; r += s)
|
|
89
|
-
i.push(r);
|
|
90
|
-
return i;
|
|
91
|
-
}
|
|
92
|
-
function se(t, e, s = " ") {
|
|
93
|
-
return wt(t, e, s, (i, r) => r + i);
|
|
94
|
-
}
|
|
95
|
-
function Qt(t, e, s = " ") {
|
|
96
|
-
return wt(t, e, s, (i, r) => i + r);
|
|
97
|
-
}
|
|
98
|
-
function wt(t, e, s, i) {
|
|
99
|
-
t = String(t);
|
|
100
|
-
let r = e - t.length;
|
|
101
|
-
for (; r-- > 0; )
|
|
102
|
-
t = i(t, s);
|
|
103
|
-
return t;
|
|
104
|
-
}
|
|
105
|
-
function bt(t) {
|
|
106
|
-
return t;
|
|
107
|
-
}
|
|
108
|
-
function Gt(t) {
|
|
109
|
-
return [...t].some((s) => s >= "a" && s <= "z") ? t.toUpperCase() : t.toLowerCase();
|
|
110
|
-
}
|
|
111
|
-
function Xt(t, e) {
|
|
112
|
-
return t.length > e ? t.slice(0, e - 3) + "..." : t;
|
|
113
|
-
}
|
|
114
|
-
function $e(t, e) {
|
|
115
|
-
return t == null && e == null ? 0 : t == null ? 1 : e == null || (t = Pe.call(t), e = Pe.call(e), t < e) ? -1 : t > e ? 1 : 0;
|
|
116
|
-
}
|
|
117
|
-
function ge(t) {
|
|
118
|
-
return function(...e) {
|
|
119
|
-
return t.call(this, ...e.map(p));
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function D(t) {
|
|
123
|
-
return function(...e) {
|
|
124
|
-
return t.call(this, ...e.map(ve));
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
function* re(t) {
|
|
128
|
-
const e = /* @__PURE__ */ new Set();
|
|
129
|
-
for (const s of t) {
|
|
130
|
-
const i = JSON.stringify(s);
|
|
131
|
-
e.has(i) || (e.add(i), yield s);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
const Be = "__liquidClass__";
|
|
135
|
-
class J extends Error {
|
|
136
|
-
constructor(e, s) {
|
|
137
|
-
super(typeof e == "string" ? e : e.message), this.context = "", typeof e != "string" && Object.defineProperty(this, "originalError", { value: e, enumerable: !1 }), Object.defineProperty(this, "token", { value: s, enumerable: !1 }), Object.defineProperty(this, Be, { value: "LiquidError", enumerable: !1 });
|
|
138
|
-
}
|
|
139
|
-
update() {
|
|
140
|
-
Object.defineProperty(this, "context", { value: ns(this.token), enumerable: !1 }), this.message = os(this.message, this.token), this.stack = this.message + `
|
|
141
|
-
` + this.context + `
|
|
142
|
-
` + this.stack, this.originalError && (this.stack += `
|
|
143
|
-
From ` + this.originalError.stack);
|
|
144
|
-
}
|
|
145
|
-
static is(e) {
|
|
146
|
-
return (e == null ? void 0 : e[Be]) === "LiquidError";
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
class Kt extends J {
|
|
150
|
-
constructor(e, s) {
|
|
151
|
-
super(e, s), this.name = "TokenizationError", super.update();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
class es extends J {
|
|
155
|
-
constructor(e, s) {
|
|
156
|
-
super(e, s), this.name = "ParseError", this.message = e.message, super.update();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
class ts extends J {
|
|
160
|
-
constructor(e, s) {
|
|
161
|
-
super(e, s.token), this.name = "RenderError", this.message = e.message, super.update();
|
|
162
|
-
}
|
|
163
|
-
static is(e) {
|
|
164
|
-
return e.name === "RenderError";
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
class Tt extends J {
|
|
168
|
-
constructor(e) {
|
|
169
|
-
super(e[0], e[0].token), this.errors = e, this.name = "LiquidErrors";
|
|
170
|
-
const s = e.length > 1 ? "s" : "";
|
|
171
|
-
this.message = `${e.length} error${s} found`, super.update();
|
|
172
|
-
}
|
|
173
|
-
static is(e) {
|
|
174
|
-
return e.name === "LiquidErrors";
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
class ss extends J {
|
|
178
|
-
constructor(e, s) {
|
|
179
|
-
super(e, s), this.name = "UndefinedVariableError", this.message = e.message, super.update();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
class is extends Error {
|
|
183
|
-
constructor(e) {
|
|
184
|
-
super(`undefined variable: ${e}`), this.name = "InternalUndefinedVariableError", this.variableName = e;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
class rs extends Error {
|
|
188
|
-
constructor(e) {
|
|
189
|
-
super(e), this.name = "AssertionError", this.message = e + "";
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function ns(t) {
|
|
193
|
-
const [e, s] = t.getPosition(), i = t.input.split(`
|
|
194
|
-
`), r = Math.max(e - 2, 1), n = Math.min(e + 3, i.length);
|
|
195
|
-
return yt(r, n + 1).map((a) => {
|
|
196
|
-
const l = a === e ? ">> " : " ", c = se(String(a), String(n).length);
|
|
197
|
-
let h = `${l}${c}| `;
|
|
198
|
-
const d = a === e ? `
|
|
199
|
-
` + se("^", s + h.length) : "";
|
|
200
|
-
return h += i[a - 1], h += d, h;
|
|
201
|
-
}).join(`
|
|
202
|
-
`);
|
|
203
|
-
}
|
|
204
|
-
function os(t, e) {
|
|
205
|
-
e.file && (t += `, file:${e.file}`);
|
|
206
|
-
const [s, i] = e.getPosition();
|
|
207
|
-
return t += `, line:${s}, col:${i}`, t;
|
|
208
|
-
}
|
|
209
|
-
const m = [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 4, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 8, 0, 0, 0, 0, 8, 0, 0, 0, 64, 0, 65, 0, 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 0, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], as = 1, X = 4, Ue = 8, kt = 16, ls = 32, hs = 64, cs = 128;
|
|
210
|
-
function ne(t) {
|
|
211
|
-
const e = t.charCodeAt(0);
|
|
212
|
-
return e >= 128 ? !m[e] : !!(m[e] & as);
|
|
213
|
-
}
|
|
214
|
-
m[160] = m[5760] = m[6158] = m[8192] = m[8193] = m[8194] = m[8195] = m[8196] = m[8197] = m[8198] = m[8199] = m[8200] = m[8201] = m[8202] = m[8232] = m[8233] = m[8239] = m[8287] = m[12288] = X;
|
|
215
|
-
m[8220] = m[8221] = cs;
|
|
216
|
-
function _(t, e) {
|
|
217
|
-
if (!t) {
|
|
218
|
-
const s = typeof e == "function" ? e() : e || `expect ${t} to be true`;
|
|
219
|
-
throw new rs(s);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
function he(t, e = `unexpected ${JSON.stringify(t)}`) {
|
|
223
|
-
_(!t, e);
|
|
224
|
-
}
|
|
225
|
-
class us extends Y {
|
|
226
|
-
equals(e) {
|
|
227
|
-
return O(p(e));
|
|
228
|
-
}
|
|
229
|
-
gt() {
|
|
230
|
-
return !1;
|
|
231
|
-
}
|
|
232
|
-
geq() {
|
|
233
|
-
return !1;
|
|
234
|
-
}
|
|
235
|
-
lt() {
|
|
236
|
-
return !1;
|
|
237
|
-
}
|
|
238
|
-
leq() {
|
|
239
|
-
return !1;
|
|
240
|
-
}
|
|
241
|
-
valueOf() {
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
class K extends Y {
|
|
246
|
-
equals(e) {
|
|
247
|
-
return e instanceof K ? !1 : (e = p(e), f(e) || x(e) ? e.length === 0 : pe(e) ? Object.keys(e).length === 0 : !1);
|
|
248
|
-
}
|
|
249
|
-
gt() {
|
|
250
|
-
return !1;
|
|
251
|
-
}
|
|
252
|
-
geq() {
|
|
253
|
-
return !1;
|
|
254
|
-
}
|
|
255
|
-
lt() {
|
|
256
|
-
return !1;
|
|
257
|
-
}
|
|
258
|
-
leq() {
|
|
259
|
-
return !1;
|
|
260
|
-
}
|
|
261
|
-
valueOf() {
|
|
262
|
-
return "";
|
|
263
|
-
}
|
|
264
|
-
static is(e) {
|
|
265
|
-
return e instanceof K;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
class Oe extends K {
|
|
269
|
-
equals(e) {
|
|
270
|
-
return e === !1 || O(p(e)) ? !0 : f(e) ? /^\s*$/.test(e) : super.equals(e);
|
|
271
|
-
}
|
|
272
|
-
static is(e) {
|
|
273
|
-
return e instanceof Oe;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
class ze extends Y {
|
|
277
|
-
constructor(e, s, i) {
|
|
278
|
-
super(), this.i = 0, this.length = e, this.name = `${i}-${s}`;
|
|
279
|
-
}
|
|
280
|
-
next() {
|
|
281
|
-
this.i++;
|
|
282
|
-
}
|
|
283
|
-
index0() {
|
|
284
|
-
return this.i;
|
|
285
|
-
}
|
|
286
|
-
index() {
|
|
287
|
-
return this.i + 1;
|
|
288
|
-
}
|
|
289
|
-
first() {
|
|
290
|
-
return this.i === 0;
|
|
291
|
-
}
|
|
292
|
-
last() {
|
|
293
|
-
return this.i === this.length - 1;
|
|
294
|
-
}
|
|
295
|
-
rindex() {
|
|
296
|
-
return this.length - this.i;
|
|
297
|
-
}
|
|
298
|
-
rindex0() {
|
|
299
|
-
return this.length - this.i - 1;
|
|
300
|
-
}
|
|
301
|
-
valueOf() {
|
|
302
|
-
return JSON.stringify(this);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
class vt {
|
|
306
|
-
constructor() {
|
|
307
|
-
this.buffer = "";
|
|
308
|
-
}
|
|
309
|
-
write(e) {
|
|
310
|
-
this.buffer += u(e);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
class fs {
|
|
314
|
-
constructor() {
|
|
315
|
-
throw this.buffer = "", this.stream = null, new Error("streaming not supported in browser");
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
class ds {
|
|
319
|
-
constructor() {
|
|
320
|
-
this.buffer = "";
|
|
321
|
-
}
|
|
322
|
-
write(e) {
|
|
323
|
-
e = p(e), typeof e != "string" && this.buffer === "" ? this.buffer = e : this.buffer = u(this.buffer) + u(e);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
class He extends Y {
|
|
327
|
-
constructor(e = () => "") {
|
|
328
|
-
super(), this.superBlockRender = e;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Provide parent access in child block by
|
|
332
|
-
* {{ block.super }}
|
|
333
|
-
*/
|
|
334
|
-
*super() {
|
|
335
|
-
const e = new vt();
|
|
336
|
-
return yield this.superBlockRender(e), e.buffer;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
function A(t) {
|
|
340
|
-
return t && v(t.equals) && v(t.gt) && v(t.geq) && v(t.lt) && v(t.leq);
|
|
341
|
-
}
|
|
342
|
-
const We = new us(), St = {
|
|
343
|
-
true: !0,
|
|
344
|
-
false: !1,
|
|
345
|
-
nil: We,
|
|
346
|
-
null: We,
|
|
347
|
-
empty: new K(),
|
|
348
|
-
blank: new Oe()
|
|
349
|
-
};
|
|
350
|
-
function Ye(t) {
|
|
351
|
-
const e = {};
|
|
352
|
-
for (const [s, i] of Object.entries(t)) {
|
|
353
|
-
let r = e;
|
|
354
|
-
for (let n = 0; n < s.length; n++) {
|
|
355
|
-
const o = s[n];
|
|
356
|
-
r[o] = r[o] || {}, n === s.length - 1 && ne(s[n]) && (r[o].needBoundary = !0), r = r[o];
|
|
357
|
-
}
|
|
358
|
-
r.data = i, r.end = !0;
|
|
359
|
-
}
|
|
360
|
-
return e;
|
|
361
|
-
}
|
|
362
|
-
var ce = function() {
|
|
363
|
-
return ce = Object.assign || function(e) {
|
|
364
|
-
for (var s, i = 1, r = arguments.length; i < r; i++) {
|
|
365
|
-
s = arguments[i];
|
|
366
|
-
for (var n in s) Object.prototype.hasOwnProperty.call(s, n) && (e[n] = s[n]);
|
|
367
|
-
}
|
|
368
|
-
return e;
|
|
369
|
-
}, ce.apply(this, arguments);
|
|
370
|
-
};
|
|
371
|
-
function k(t, e, s, i) {
|
|
372
|
-
function r(n) {
|
|
373
|
-
return n instanceof s ? n : new s(function(o) {
|
|
374
|
-
o(n);
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
return new (s || (s = Promise))(function(n, o) {
|
|
378
|
-
function a(h) {
|
|
379
|
-
try {
|
|
380
|
-
c(i.next(h));
|
|
381
|
-
} catch (d) {
|
|
382
|
-
o(d);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
function l(h) {
|
|
386
|
-
try {
|
|
387
|
-
c(i.throw(h));
|
|
388
|
-
} catch (d) {
|
|
389
|
-
o(d);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
function c(h) {
|
|
393
|
-
h.done ? n(h.value) : r(h.value).then(a, l);
|
|
394
|
-
}
|
|
395
|
-
c((i = i.apply(t, [])).next());
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
function M(t) {
|
|
399
|
-
return k(this, void 0, void 0, function* () {
|
|
400
|
-
if (!le(t))
|
|
401
|
-
return t;
|
|
402
|
-
let e, s = !1, i = "next";
|
|
403
|
-
do {
|
|
404
|
-
const r = t[i](e);
|
|
405
|
-
s = r.done, e = r.value, i = "next";
|
|
406
|
-
try {
|
|
407
|
-
le(e) && (e = M(e)), Yt(e) && (e = yield e);
|
|
408
|
-
} catch (n) {
|
|
409
|
-
i = "throw", e = n;
|
|
410
|
-
}
|
|
411
|
-
} while (!s);
|
|
412
|
-
return e;
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
function V(t) {
|
|
416
|
-
if (!le(t))
|
|
417
|
-
return t;
|
|
418
|
-
let e, s = !1, i = "next";
|
|
419
|
-
do {
|
|
420
|
-
const r = t[i](e);
|
|
421
|
-
if (s = r.done, e = r.value, i = "next", le(e))
|
|
422
|
-
try {
|
|
423
|
-
e = V(e);
|
|
424
|
-
} catch (n) {
|
|
425
|
-
i = "throw", e = n;
|
|
426
|
-
}
|
|
427
|
-
} while (!s);
|
|
428
|
-
return e;
|
|
429
|
-
}
|
|
430
|
-
const ps = /%([-_0^#:]+)?(\d+)?([EO])?(.)/;
|
|
431
|
-
function gs(t) {
|
|
432
|
-
return [31, ms(t) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
433
|
-
}
|
|
434
|
-
function xt(t) {
|
|
435
|
-
let e = 0;
|
|
436
|
-
for (let s = 0; s < t.getMonth(); ++s)
|
|
437
|
-
e += gs(t)[s];
|
|
438
|
-
return e + t.getDate();
|
|
439
|
-
}
|
|
440
|
-
function Je(t, e) {
|
|
441
|
-
const s = xt(t) + (e - t.getDay()), r = 7 - new Date(t.getFullYear(), 0, 1).getDay() + e;
|
|
442
|
-
return String(Math.floor((s - r) / 7) + 1);
|
|
443
|
-
}
|
|
444
|
-
function ms(t) {
|
|
445
|
-
const e = t.getFullYear();
|
|
446
|
-
return !!((e & 3) === 0 && (e % 100 || e % 400 === 0 && e));
|
|
447
|
-
}
|
|
448
|
-
function ys(t) {
|
|
449
|
-
const e = t.getDate();
|
|
450
|
-
if ([11, 12, 13].includes(e))
|
|
451
|
-
return "th";
|
|
452
|
-
switch (e % 10) {
|
|
453
|
-
case 1:
|
|
454
|
-
return "st";
|
|
455
|
-
case 2:
|
|
456
|
-
return "nd";
|
|
457
|
-
case 3:
|
|
458
|
-
return "rd";
|
|
459
|
-
default:
|
|
460
|
-
return "th";
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
function ws(t) {
|
|
464
|
-
return parseInt(t.getFullYear().toString().substring(0, 2), 10);
|
|
465
|
-
}
|
|
466
|
-
const bs = {
|
|
467
|
-
d: 2,
|
|
468
|
-
e: 2,
|
|
469
|
-
H: 2,
|
|
470
|
-
I: 2,
|
|
471
|
-
j: 3,
|
|
472
|
-
k: 2,
|
|
473
|
-
l: 2,
|
|
474
|
-
L: 3,
|
|
475
|
-
m: 2,
|
|
476
|
-
M: 2,
|
|
477
|
-
S: 2,
|
|
478
|
-
U: 2,
|
|
479
|
-
W: 2
|
|
480
|
-
}, Ts = new Set("aAbBceklpP");
|
|
481
|
-
function Ze(t, e) {
|
|
482
|
-
const s = Math.abs(t.getTimezoneOffset()), i = Math.floor(s / 60), r = s % 60;
|
|
483
|
-
return (t.getTimezoneOffset() > 0 ? "-" : "+") + se(i, 2, "0") + (e.flags[":"] ? ":" : "") + se(r, 2, "0");
|
|
484
|
-
}
|
|
485
|
-
const Se = {
|
|
486
|
-
a: (t) => t.getShortWeekdayName(),
|
|
487
|
-
A: (t) => t.getLongWeekdayName(),
|
|
488
|
-
b: (t) => t.getShortMonthName(),
|
|
489
|
-
B: (t) => t.getLongMonthName(),
|
|
490
|
-
c: (t) => t.toLocaleString(),
|
|
491
|
-
C: (t) => ws(t),
|
|
492
|
-
d: (t) => t.getDate(),
|
|
493
|
-
e: (t) => t.getDate(),
|
|
494
|
-
H: (t) => t.getHours(),
|
|
495
|
-
I: (t) => String(t.getHours() % 12 || 12),
|
|
496
|
-
j: (t) => xt(t),
|
|
497
|
-
k: (t) => t.getHours(),
|
|
498
|
-
l: (t) => String(t.getHours() % 12 || 12),
|
|
499
|
-
L: (t) => t.getMilliseconds(),
|
|
500
|
-
m: (t) => t.getMonth() + 1,
|
|
501
|
-
M: (t) => t.getMinutes(),
|
|
502
|
-
N: (t, e) => {
|
|
503
|
-
const s = Number(e.width) || 9, i = String(t.getMilliseconds()).slice(0, s);
|
|
504
|
-
return Qt(i, s, "0");
|
|
505
|
-
},
|
|
506
|
-
p: (t) => t.getHours() < 12 ? "AM" : "PM",
|
|
507
|
-
P: (t) => t.getHours() < 12 ? "am" : "pm",
|
|
508
|
-
q: (t) => ys(t),
|
|
509
|
-
s: (t) => Math.round(t.getTime() / 1e3),
|
|
510
|
-
S: (t) => t.getSeconds(),
|
|
511
|
-
u: (t) => t.getDay() || 7,
|
|
512
|
-
U: (t) => Je(t, 0),
|
|
513
|
-
w: (t) => t.getDay(),
|
|
514
|
-
W: (t) => Je(t, 1),
|
|
515
|
-
x: (t) => t.toLocaleDateString(),
|
|
516
|
-
X: (t) => t.toLocaleTimeString(),
|
|
517
|
-
y: (t) => t.getFullYear().toString().slice(2, 4),
|
|
518
|
-
Y: (t) => t.getFullYear(),
|
|
519
|
-
z: Ze,
|
|
520
|
-
Z: (t, e) => t.getTimeZoneName() || Ze(t, e),
|
|
521
|
-
t: () => " ",
|
|
522
|
-
n: () => `
|
|
523
|
-
`,
|
|
524
|
-
"%": () => "%"
|
|
525
|
-
};
|
|
526
|
-
Se.h = Se.b;
|
|
527
|
-
function oe(t, e) {
|
|
528
|
-
let s = "", i = e, r;
|
|
529
|
-
for (; r = ps.exec(i); )
|
|
530
|
-
s += i.slice(0, r.index), i = i.slice(r.index + r[0].length), s += ks(t, r);
|
|
531
|
-
return s + i;
|
|
532
|
-
}
|
|
533
|
-
function ks(t, e) {
|
|
534
|
-
const [s, i = "", r, n, o] = e, a = Se[o];
|
|
535
|
-
if (!a)
|
|
536
|
-
return s;
|
|
537
|
-
const l = {};
|
|
538
|
-
for (const g of i)
|
|
539
|
-
l[g] = !0;
|
|
540
|
-
let c = String(a(t, { flags: l, width: r, modifier: n })), h = Ts.has(o) ? " " : "0", d = r || bs[o] || 0;
|
|
541
|
-
return l["^"] ? c = c.toUpperCase() : l["#"] && (c = Gt(c)), l._ ? h = " " : l[0] && (h = "0"), l["-"] && (d = 0), se(c, d, h);
|
|
542
|
-
}
|
|
543
|
-
function _t() {
|
|
544
|
-
return typeof Intl < "u" ? Intl.DateTimeFormat : void 0;
|
|
545
|
-
}
|
|
546
|
-
const vs = 6e4, Ss = /([zZ]|([+-])(\d{2}):?(\d{2}))$/, Ft = [
|
|
547
|
-
"January",
|
|
548
|
-
"February",
|
|
549
|
-
"March",
|
|
550
|
-
"April",
|
|
551
|
-
"May",
|
|
552
|
-
"June",
|
|
553
|
-
"July",
|
|
554
|
-
"August",
|
|
555
|
-
"September",
|
|
556
|
-
"October",
|
|
557
|
-
"November",
|
|
558
|
-
"December"
|
|
559
|
-
], xs = Ft.map((t) => t.slice(0, 3)), Lt = [
|
|
560
|
-
"Sunday",
|
|
561
|
-
"Monday",
|
|
562
|
-
"Tuesday",
|
|
563
|
-
"Wednesday",
|
|
564
|
-
"Thursday",
|
|
565
|
-
"Friday",
|
|
566
|
-
"Saturday"
|
|
567
|
-
], _s = Lt.map((t) => t.slice(0, 3));
|
|
568
|
-
class R {
|
|
569
|
-
constructor(e, s, i) {
|
|
570
|
-
this.locale = s, this.DateTimeFormat = _t(), this.date = new Date(e), this.timezoneFixed = i !== void 0, i === void 0 && (i = this.date.getTimezoneOffset()), this.timezoneOffset = f(i) ? R.getTimezoneOffset(i, this.date) : i, this.timezoneName = f(i) ? i : "";
|
|
571
|
-
const r = (this.date.getTimezoneOffset() - this.timezoneOffset) * vs, n = this.date.getTime() + r;
|
|
572
|
-
this.displayDate = new Date(n);
|
|
573
|
-
}
|
|
574
|
-
getTime() {
|
|
575
|
-
return this.displayDate.getTime();
|
|
576
|
-
}
|
|
577
|
-
getMilliseconds() {
|
|
578
|
-
return this.displayDate.getMilliseconds();
|
|
579
|
-
}
|
|
580
|
-
getSeconds() {
|
|
581
|
-
return this.displayDate.getSeconds();
|
|
582
|
-
}
|
|
583
|
-
getMinutes() {
|
|
584
|
-
return this.displayDate.getMinutes();
|
|
585
|
-
}
|
|
586
|
-
getHours() {
|
|
587
|
-
return this.displayDate.getHours();
|
|
588
|
-
}
|
|
589
|
-
getDay() {
|
|
590
|
-
return this.displayDate.getDay();
|
|
591
|
-
}
|
|
592
|
-
getDate() {
|
|
593
|
-
return this.displayDate.getDate();
|
|
594
|
-
}
|
|
595
|
-
getMonth() {
|
|
596
|
-
return this.displayDate.getMonth();
|
|
597
|
-
}
|
|
598
|
-
getFullYear() {
|
|
599
|
-
return this.displayDate.getFullYear();
|
|
600
|
-
}
|
|
601
|
-
toLocaleString(e, s) {
|
|
602
|
-
return s != null && s.timeZone ? this.date.toLocaleString(e, s) : this.displayDate.toLocaleString(e, s);
|
|
603
|
-
}
|
|
604
|
-
toLocaleTimeString(e) {
|
|
605
|
-
return this.displayDate.toLocaleTimeString(e);
|
|
606
|
-
}
|
|
607
|
-
toLocaleDateString(e) {
|
|
608
|
-
return this.displayDate.toLocaleDateString(e);
|
|
609
|
-
}
|
|
610
|
-
getTimezoneOffset() {
|
|
611
|
-
return this.timezoneOffset;
|
|
612
|
-
}
|
|
613
|
-
getTimeZoneName() {
|
|
614
|
-
if (this.timezoneFixed)
|
|
615
|
-
return this.timezoneName;
|
|
616
|
-
if (this.DateTimeFormat)
|
|
617
|
-
return this.DateTimeFormat().resolvedOptions().timeZone;
|
|
618
|
-
}
|
|
619
|
-
getLongMonthName() {
|
|
620
|
-
var e;
|
|
621
|
-
return (e = this.format({ month: "long" })) !== null && e !== void 0 ? e : Ft[this.getMonth()];
|
|
622
|
-
}
|
|
623
|
-
getShortMonthName() {
|
|
624
|
-
var e;
|
|
625
|
-
return (e = this.format({ month: "short" })) !== null && e !== void 0 ? e : xs[this.getMonth()];
|
|
626
|
-
}
|
|
627
|
-
getLongWeekdayName() {
|
|
628
|
-
var e;
|
|
629
|
-
return (e = this.format({ weekday: "long" })) !== null && e !== void 0 ? e : Lt[this.displayDate.getDay()];
|
|
630
|
-
}
|
|
631
|
-
getShortWeekdayName() {
|
|
632
|
-
var e;
|
|
633
|
-
return (e = this.format({ weekday: "short" })) !== null && e !== void 0 ? e : _s[this.displayDate.getDay()];
|
|
634
|
-
}
|
|
635
|
-
valid() {
|
|
636
|
-
return !isNaN(this.getTime());
|
|
637
|
-
}
|
|
638
|
-
format(e) {
|
|
639
|
-
return this.DateTimeFormat && this.DateTimeFormat(this.locale, e).format(this.displayDate);
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* Create a Date object fixed to it's declared Timezone. Both
|
|
643
|
-
* - 2021-08-06T02:29:00.000Z and
|
|
644
|
-
* - 2021-08-06T02:29:00.000+08:00
|
|
645
|
-
* will always be displayed as
|
|
646
|
-
* - 2021-08-06 02:29:00
|
|
647
|
-
* regardless timezoneOffset in JavaScript realm
|
|
648
|
-
*
|
|
649
|
-
* The implementation hack:
|
|
650
|
-
* Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`,
|
|
651
|
-
* we create a different Date to trick strftime, it's both simpler and more performant.
|
|
652
|
-
* Given that a template is expected to be parsed fewer times than rendered.
|
|
653
|
-
*/
|
|
654
|
-
static createDateFixedToTimezone(e, s) {
|
|
655
|
-
const i = e.match(Ss);
|
|
656
|
-
if (i && i[1] === "Z")
|
|
657
|
-
return new R(+new Date(e), s, 0);
|
|
658
|
-
if (i && i[2] && i[3] && i[4]) {
|
|
659
|
-
const [, , r, n, o] = i, a = (r === "+" ? -1 : 1) * (parseInt(n, 10) * 60 + parseInt(o, 10));
|
|
660
|
-
return new R(+new Date(e), s, a);
|
|
661
|
-
}
|
|
662
|
-
return new R(e, s);
|
|
663
|
-
}
|
|
664
|
-
static getTimezoneOffset(e, s) {
|
|
665
|
-
const i = s.toLocaleString("en-US", { timeZone: e }), r = s.toLocaleString("en-US", { timeZone: "UTC" }), n = new Date(i);
|
|
666
|
-
return (+new Date(r) - +n) / (60 * 1e3);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
class xe {
|
|
670
|
-
constructor(e, s) {
|
|
671
|
-
this.base = 0, this.message = `${e} limit exceeded`, this.limit = s;
|
|
672
|
-
}
|
|
673
|
-
use(e) {
|
|
674
|
-
+e > 0 && (_(this.base + +e <= this.limit, this.message), this.base += +e);
|
|
675
|
-
}
|
|
676
|
-
check(e) {
|
|
677
|
-
+e > 0 && _(+e <= this.limit, this.message);
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
class Re extends z {
|
|
681
|
-
constructor(e, [s, i], r, n, o, a, l, c) {
|
|
682
|
-
super(e, r, n, o, c), this.trimLeft = !1, this.trimRight = !1;
|
|
683
|
-
const h = r[s] === "-", d = r[i - 1] === "-";
|
|
684
|
-
let g = h ? s + 1 : s, w = d ? i - 1 : i;
|
|
685
|
-
for (; g < w && m[r.charCodeAt(g)] & X; )
|
|
686
|
-
g++;
|
|
687
|
-
for (; w > g && m[r.charCodeAt(w - 1)] & X; )
|
|
688
|
-
w--;
|
|
689
|
-
this.contentRange = [g, w], this.trimLeft = h || a, this.trimRight = d || l;
|
|
690
|
-
}
|
|
691
|
-
get content() {
|
|
692
|
-
return this.input.slice(this.contentRange[0], this.contentRange[1]);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
class Qe extends Re {
|
|
696
|
-
constructor(e, s, i, r, n) {
|
|
697
|
-
const { trimTagLeft: o, trimTagRight: a, tagDelimiterLeft: l, tagDelimiterRight: c } = r, [h, d] = [s + l.length, i - c.length];
|
|
698
|
-
super(y.Tag, [h, d], e, s, i, o, a, n), this.tokenizer = new N(e, r.operators, n, this.contentRange), this.name = this.tokenizer.readTagName(), this.tokenizer.assert(this.name, "illegal tag syntax, tag name expected"), this.tokenizer.skipBlank(), this.args = this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1]);
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
class Fs extends Re {
|
|
702
|
-
constructor(e, s, i, r, n) {
|
|
703
|
-
const { trimOutputLeft: o, trimOutputRight: a, outputDelimiterLeft: l, outputDelimiterRight: c } = r, h = [s + l.length, i - c.length];
|
|
704
|
-
super(y.Output, h, e, s, i, o, a, n);
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
class Ge extends z {
|
|
708
|
-
constructor(e, s, i, r) {
|
|
709
|
-
super(y.HTML, e, s, i, r), this.input = e, this.begin = s, this.end = i, this.file = r, this.trimLeft = 0, this.trimRight = 0;
|
|
710
|
-
}
|
|
711
|
-
getContent() {
|
|
712
|
-
return this.input.slice(this.begin + this.trimLeft, this.end - this.trimRight);
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
class Ls extends z {
|
|
716
|
-
constructor(e, s, i, r) {
|
|
717
|
-
super(y.Number, e, s, i, r), this.input = e, this.begin = s, this.end = i, this.file = r, this.content = Number(this.getText());
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
class we extends z {
|
|
721
|
-
constructor(e, s, i, r) {
|
|
722
|
-
super(y.Word, e, s, i, r), this.input = e, this.begin = s, this.end = i, this.file = r, this.content = this.getText();
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
class Os extends z {
|
|
726
|
-
constructor(e, s, i, r) {
|
|
727
|
-
super(y.Literal, e, s, i, r), this.input = e, this.begin = s, this.end = i, this.file = r, this.literal = this.getText(), this.content = St[this.literal];
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
const Xe = {
|
|
731
|
-
"==": 2,
|
|
732
|
-
"!=": 2,
|
|
733
|
-
">": 2,
|
|
734
|
-
"<": 2,
|
|
735
|
-
">=": 2,
|
|
736
|
-
"<=": 2,
|
|
737
|
-
contains: 2,
|
|
738
|
-
not: 1,
|
|
739
|
-
and: 0,
|
|
740
|
-
or: 0
|
|
741
|
-
}, zs = {
|
|
742
|
-
"==": 0,
|
|
743
|
-
"!=": 0,
|
|
744
|
-
">": 0,
|
|
745
|
-
"<": 0,
|
|
746
|
-
">=": 0,
|
|
747
|
-
"<=": 0,
|
|
748
|
-
contains: 0,
|
|
749
|
-
not: 1,
|
|
750
|
-
and: 0,
|
|
751
|
-
or: 0
|
|
752
|
-
/* OperatorType.Binary */
|
|
753
|
-
};
|
|
754
|
-
class Rs extends z {
|
|
755
|
-
constructor(e, s, i, r) {
|
|
756
|
-
super(y.Operator, e, s, i, r), this.input = e, this.begin = s, this.end = i, this.file = r, this.operator = this.getText();
|
|
757
|
-
}
|
|
758
|
-
getPrecedence() {
|
|
759
|
-
const e = this.getText();
|
|
760
|
-
return e in Xe ? Xe[e] : 1;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
class Ke extends z {
|
|
764
|
-
constructor(e, s, i, r, n, o) {
|
|
765
|
-
super(y.PropertyAccess, i, r, n, o), this.variable = e, this.props = s;
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
class Ot extends z {
|
|
769
|
-
constructor(e, s, i, r, n, o) {
|
|
770
|
-
super(y.Filter, i, r, n, o), this.name = e, this.args = s;
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
class Es extends z {
|
|
774
|
-
constructor(e, s, i, r, n, o) {
|
|
775
|
-
super(y.Hash, e, s, i, o), this.input = e, this.begin = s, this.end = i, this.name = r, this.value = n, this.file = o;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
const As = /[\da-fA-F]/, et = /[0-7]/, tt = {
|
|
779
|
-
b: "\b",
|
|
780
|
-
f: "\f",
|
|
781
|
-
n: `
|
|
782
|
-
`,
|
|
783
|
-
r: "\r",
|
|
784
|
-
t: " ",
|
|
785
|
-
v: "\v"
|
|
786
|
-
};
|
|
787
|
-
function st(t) {
|
|
788
|
-
const e = t.charCodeAt(0);
|
|
789
|
-
return e >= 97 ? e - 87 : e >= 65 ? e - 55 : e - 48;
|
|
790
|
-
}
|
|
791
|
-
function Ns(t) {
|
|
792
|
-
let e = "";
|
|
793
|
-
for (let s = 1; s < t.length - 1; s++) {
|
|
794
|
-
if (t[s] !== "\\") {
|
|
795
|
-
e += t[s];
|
|
796
|
-
continue;
|
|
797
|
-
}
|
|
798
|
-
if (tt[t[s + 1]] !== void 0)
|
|
799
|
-
e += tt[t[++s]];
|
|
800
|
-
else if (t[s + 1] === "u") {
|
|
801
|
-
let i = 0, r = s + 2;
|
|
802
|
-
for (; r <= s + 5 && As.test(t[r]); )
|
|
803
|
-
i = i * 16 + st(t[r++]);
|
|
804
|
-
s = r - 1, e += String.fromCharCode(i);
|
|
805
|
-
} else if (!et.test(t[s + 1]))
|
|
806
|
-
e += t[++s];
|
|
807
|
-
else {
|
|
808
|
-
let i = s + 1, r = 0;
|
|
809
|
-
for (; i <= s + 3 && et.test(t[i]); )
|
|
810
|
-
r = r * 8 + st(t[i++]);
|
|
811
|
-
s = i - 1, e += String.fromCharCode(r);
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
return e;
|
|
815
|
-
}
|
|
816
|
-
class Ds extends z {
|
|
817
|
-
constructor(e, s, i, r) {
|
|
818
|
-
super(y.Quoted, e, s, i, r), this.input = e, this.begin = s, this.end = i, this.file = r, this.content = Ns(this.getText());
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
class Ms extends z {
|
|
822
|
-
constructor(e, s, i, r, n, o) {
|
|
823
|
-
super(y.Range, e, s, i, o), this.input = e, this.begin = s, this.end = i, this.lhs = r, this.rhs = n, this.file = o;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
class Vs extends Re {
|
|
827
|
-
constructor(e, s, i, r, n) {
|
|
828
|
-
super(y.Tag, [s, i], e, s, i, !1, !1, n), this.tokenizer = new N(e, r.operators, n, this.contentRange), this.name = this.tokenizer.readTagName(), this.tokenizer.assert(this.name, "illegal liquid tag syntax"), this.tokenizer.skipBlank();
|
|
829
|
-
}
|
|
830
|
-
get args() {
|
|
831
|
-
return this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1]);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
class js extends z {
|
|
835
|
-
constructor(e, s, i, r, n, o) {
|
|
836
|
-
super(y.FilteredValue, i, r, n, o), this.initial = e, this.filters = s, this.input = i, this.begin = r, this.end = n, this.file = o;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
const qs = {
|
|
840
|
-
now: () => Date.now()
|
|
841
|
-
};
|
|
842
|
-
function zt() {
|
|
843
|
-
return typeof global == "object" && global.performance || typeof window == "object" && window.performance || qs;
|
|
844
|
-
}
|
|
845
|
-
class Cs {
|
|
846
|
-
renderTemplatesToNodeStream(e, s) {
|
|
847
|
-
const i = new fs();
|
|
848
|
-
return Promise.resolve().then(() => M(this.renderTemplates(e, s, i))).then(() => i.end(), (r) => i.error(r)), i.stream;
|
|
849
|
-
}
|
|
850
|
-
*renderTemplates(e, s, i) {
|
|
851
|
-
i || (i = s.opts.keepOutputType ? new ds() : new vt());
|
|
852
|
-
const r = [];
|
|
853
|
-
for (const n of e) {
|
|
854
|
-
s.renderLimit.check(zt().now());
|
|
855
|
-
try {
|
|
856
|
-
const o = yield n.render(s, i);
|
|
857
|
-
if (o && i.write(o), s.breakCalled || s.continueCalled)
|
|
858
|
-
break;
|
|
859
|
-
} catch (o) {
|
|
860
|
-
const a = J.is(o) ? o : new ts(o, n);
|
|
861
|
-
if (s.opts.catchAllErrors)
|
|
862
|
-
r.push(a);
|
|
863
|
-
else
|
|
864
|
-
throw a;
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
if (r.length)
|
|
868
|
-
throw new Tt(r);
|
|
869
|
-
return i.buffer;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
class Ps {
|
|
873
|
-
constructor(e) {
|
|
874
|
-
this.postfix = [...Us(e)];
|
|
875
|
-
}
|
|
876
|
-
*evaluate(e, s) {
|
|
877
|
-
_(e, "unable to evaluate: context not defined");
|
|
878
|
-
const i = [];
|
|
879
|
-
for (const r of this.postfix)
|
|
880
|
-
if (Vt(r)) {
|
|
881
|
-
const n = i.pop();
|
|
882
|
-
let o;
|
|
883
|
-
if (zs[r.operator] === 1)
|
|
884
|
-
o = yield e.opts.operators[r.operator](n, e);
|
|
885
|
-
else {
|
|
886
|
-
const a = i.pop();
|
|
887
|
-
o = yield e.opts.operators[r.operator](a, n, e);
|
|
888
|
-
}
|
|
889
|
-
i.push(o);
|
|
890
|
-
} else
|
|
891
|
-
i.push(yield T(r, e, s));
|
|
892
|
-
return i[0];
|
|
893
|
-
}
|
|
894
|
-
valid() {
|
|
895
|
-
return !!this.postfix.length;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
function* T(t, e, s = !1) {
|
|
899
|
-
if (t) {
|
|
900
|
-
if ("content" in t)
|
|
901
|
-
return t.content;
|
|
902
|
-
if (fe(t))
|
|
903
|
-
return yield Is(t, e, s);
|
|
904
|
-
if (jt(t))
|
|
905
|
-
return yield Bs(t, e);
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
function* Is(t, e, s) {
|
|
909
|
-
const i = [];
|
|
910
|
-
for (const r of t.props)
|
|
911
|
-
i.push(yield T(r, e, !1));
|
|
912
|
-
try {
|
|
913
|
-
if (t.variable) {
|
|
914
|
-
const r = yield T(t.variable, e, s);
|
|
915
|
-
return yield e._getFromScope(r, i);
|
|
916
|
-
} else
|
|
917
|
-
return yield e._get(i);
|
|
918
|
-
} catch (r) {
|
|
919
|
-
if (s && r.name === "InternalUndefinedVariableError")
|
|
920
|
-
return null;
|
|
921
|
-
throw new ss(r, t);
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
function $s(t) {
|
|
925
|
-
return t.content;
|
|
926
|
-
}
|
|
927
|
-
function* Bs(t, e) {
|
|
928
|
-
const s = yield T(t.lhs, e), i = yield T(t.rhs, e);
|
|
929
|
-
return e.memoryLimit.use(i - s + 1), yt(+s, +i + 1);
|
|
930
|
-
}
|
|
931
|
-
function* Us(t) {
|
|
932
|
-
const e = [];
|
|
933
|
-
for (const s of t)
|
|
934
|
-
if (Vt(s)) {
|
|
935
|
-
for (; e.length && e[e.length - 1].getPrecedence() > s.getPrecedence(); )
|
|
936
|
-
yield e.pop();
|
|
937
|
-
e.push(s);
|
|
938
|
-
} else
|
|
939
|
-
yield s;
|
|
940
|
-
for (; e.length; )
|
|
941
|
-
yield e.pop();
|
|
942
|
-
}
|
|
943
|
-
function B(t, e) {
|
|
944
|
-
return !me(t, e);
|
|
945
|
-
}
|
|
946
|
-
function me(t, e) {
|
|
947
|
-
return t = p(t), e.opts.jsTruthy ? !t : t === !1 || t === void 0 || t === null;
|
|
948
|
-
}
|
|
949
|
-
const Hs = {
|
|
950
|
-
"==": j,
|
|
951
|
-
"!=": (t, e) => !j(t, e),
|
|
952
|
-
">": (t, e) => A(t) ? t.gt(e) : A(e) ? e.lt(t) : p(t) > p(e),
|
|
953
|
-
"<": (t, e) => A(t) ? t.lt(e) : A(e) ? e.gt(t) : p(t) < p(e),
|
|
954
|
-
">=": (t, e) => A(t) ? t.geq(e) : A(e) ? e.leq(t) : p(t) >= p(e),
|
|
955
|
-
"<=": (t, e) => A(t) ? t.leq(e) : A(e) ? e.geq(t) : p(t) <= p(e),
|
|
956
|
-
contains: (t, e) => (t = p(t), x(t) ? t.some((s) => j(s, e)) : v(t == null ? void 0 : t.indexOf) ? t.indexOf(p(e)) > -1 : !1),
|
|
957
|
-
not: (t, e) => me(p(t), e),
|
|
958
|
-
and: (t, e, s) => B(p(t), s) && B(p(e), s),
|
|
959
|
-
or: (t, e, s) => B(p(t), s) || B(p(e), s)
|
|
960
|
-
};
|
|
961
|
-
function j(t, e) {
|
|
962
|
-
return A(t) ? t.equals(e) : A(e) ? e.equals(t) : (t = p(t), e = p(e), x(t) ? x(e) && Ws(t, e) : t === e);
|
|
963
|
-
}
|
|
964
|
-
function Ws(t, e) {
|
|
965
|
-
return t.length !== e.length ? !1 : !t.some((s, i) => !j(s, e[i]));
|
|
966
|
-
}
|
|
967
|
-
function Ys(t, e) {
|
|
968
|
-
return t.some((s) => j(s, e));
|
|
969
|
-
}
|
|
970
|
-
class be {
|
|
971
|
-
constructor(e, s, i, r) {
|
|
972
|
-
this.key = e, this.value = s, this.next = i, this.prev = r;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
class it {
|
|
976
|
-
constructor(e, s = 0) {
|
|
977
|
-
this.limit = e, this.size = s, this.cache = {}, this.head = new be("HEAD", null, null, null), this.tail = new be("TAIL", null, null, null), this.head.next = this.tail, this.tail.prev = this.head;
|
|
978
|
-
}
|
|
979
|
-
write(e, s) {
|
|
980
|
-
if (this.cache[e])
|
|
981
|
-
this.cache[e].value = s;
|
|
982
|
-
else {
|
|
983
|
-
const i = new be(e, s, this.head.next, this.head);
|
|
984
|
-
this.head.next.prev = i, this.head.next = i, this.cache[e] = i, this.size++, this.ensureLimit();
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
read(e) {
|
|
988
|
-
if (!this.cache[e])
|
|
989
|
-
return;
|
|
990
|
-
const { value: s } = this.cache[e];
|
|
991
|
-
return this.remove(e), this.write(e, s), s;
|
|
992
|
-
}
|
|
993
|
-
remove(e) {
|
|
994
|
-
const s = this.cache[e];
|
|
995
|
-
s.prev.next = s.next, s.next.prev = s.prev, delete this.cache[e], this.size--;
|
|
996
|
-
}
|
|
997
|
-
clear() {
|
|
998
|
-
this.head.next = this.tail, this.tail.prev = this.head, this.size = 0, this.cache = {};
|
|
999
|
-
}
|
|
1000
|
-
ensureLimit() {
|
|
1001
|
-
this.size > this.limit && this.remove(this.tail.prev.key);
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
function Rt(t, e) {
|
|
1005
|
-
const s = document.createElement("base");
|
|
1006
|
-
s.href = t;
|
|
1007
|
-
const i = document.getElementsByTagName("head")[0];
|
|
1008
|
-
i.insertBefore(s, i.firstChild);
|
|
1009
|
-
const r = document.createElement("a");
|
|
1010
|
-
r.href = e;
|
|
1011
|
-
const n = r.href;
|
|
1012
|
-
return i.removeChild(s), n;
|
|
1013
|
-
}
|
|
1014
|
-
function Js(t, e, s) {
|
|
1015
|
-
return t.length && mt(t) !== "/" && (t += "/"), Rt(t, e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/, (r, n, o) => {
|
|
1016
|
-
const a = o.split("/").pop();
|
|
1017
|
-
return /\.\w+$/.test(a) ? r : n + o + s;
|
|
1018
|
-
});
|
|
1019
|
-
}
|
|
1020
|
-
function Zs(t) {
|
|
1021
|
-
return k(this, void 0, void 0, function* () {
|
|
1022
|
-
return new Promise((e, s) => {
|
|
1023
|
-
const i = new XMLHttpRequest();
|
|
1024
|
-
i.onload = () => {
|
|
1025
|
-
i.status >= 200 && i.status < 300 ? e(i.responseText) : s(new Error(i.statusText));
|
|
1026
|
-
}, i.onerror = () => {
|
|
1027
|
-
s(new Error("An error occurred whilst receiving the response."));
|
|
1028
|
-
}, i.open("GET", t), i.send();
|
|
1029
|
-
});
|
|
1030
|
-
});
|
|
1031
|
-
}
|
|
1032
|
-
function Qs(t) {
|
|
1033
|
-
const e = new XMLHttpRequest();
|
|
1034
|
-
if (e.open("GET", t, !1), e.send(), e.status < 200 || e.status >= 300)
|
|
1035
|
-
throw new Error(e.statusText);
|
|
1036
|
-
return e.responseText;
|
|
1037
|
-
}
|
|
1038
|
-
function Gs(t) {
|
|
1039
|
-
return k(this, void 0, void 0, function* () {
|
|
1040
|
-
return !0;
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
function Xs(t) {
|
|
1044
|
-
return !0;
|
|
1045
|
-
}
|
|
1046
|
-
function Ks(t) {
|
|
1047
|
-
return Rt(t, ".");
|
|
1048
|
-
}
|
|
1049
|
-
const ei = "/";
|
|
1050
|
-
var ti = /* @__PURE__ */ Object.freeze({
|
|
1051
|
-
__proto__: null,
|
|
1052
|
-
resolve: Js,
|
|
1053
|
-
readFile: Zs,
|
|
1054
|
-
readFileSync: Qs,
|
|
1055
|
-
exists: Gs,
|
|
1056
|
-
existsSync: Xs,
|
|
1057
|
-
dirname: Ks,
|
|
1058
|
-
sep: ei
|
|
1059
|
-
});
|
|
1060
|
-
function si(t, e, ...s) {
|
|
1061
|
-
return t = p(t), x(t) || f(t) ? t.length ? t : e : t === !1 && new Map(s).get("allow_false") ? !1 : me(t, this.context) ? e : t;
|
|
1062
|
-
}
|
|
1063
|
-
function rt(t, e = 0) {
|
|
1064
|
-
return JSON.stringify(t, null, e);
|
|
1065
|
-
}
|
|
1066
|
-
function ii(t, e = 0) {
|
|
1067
|
-
const s = [];
|
|
1068
|
-
return JSON.stringify(t, function(i, r) {
|
|
1069
|
-
if (typeof r != "object" || r === null)
|
|
1070
|
-
return r;
|
|
1071
|
-
for (; s.length > 0 && s[s.length - 1] !== this; )
|
|
1072
|
-
s.pop();
|
|
1073
|
-
return s.includes(r) ? "[Circular]" : (s.push(r), r);
|
|
1074
|
-
}, e);
|
|
1075
|
-
}
|
|
1076
|
-
function ri(t) {
|
|
1077
|
-
return Number(t);
|
|
1078
|
-
}
|
|
1079
|
-
const ni = {
|
|
1080
|
-
raw: !0,
|
|
1081
|
-
handler: bt
|
|
1082
|
-
};
|
|
1083
|
-
var Et = {
|
|
1084
|
-
default: si,
|
|
1085
|
-
raw: ni,
|
|
1086
|
-
jsonify: rt,
|
|
1087
|
-
to_integer: ri,
|
|
1088
|
-
json: rt,
|
|
1089
|
-
inspect: ii
|
|
1090
|
-
};
|
|
1091
|
-
const oi = {
|
|
1092
|
-
"&": "&",
|
|
1093
|
-
"<": "<",
|
|
1094
|
-
">": ">",
|
|
1095
|
-
'"': """,
|
|
1096
|
-
"'": "'"
|
|
1097
|
-
}, ai = {
|
|
1098
|
-
"&": "&",
|
|
1099
|
-
"<": "<",
|
|
1100
|
-
">": ">",
|
|
1101
|
-
""": '"',
|
|
1102
|
-
"'": "'"
|
|
1103
|
-
};
|
|
1104
|
-
function ye(t) {
|
|
1105
|
-
return t = u(t), this.context.memoryLimit.use(t.length), t.replace(/&|<|>|"|'/g, (e) => oi[e]);
|
|
1106
|
-
}
|
|
1107
|
-
function li(t) {
|
|
1108
|
-
return ye.call(this, t);
|
|
1109
|
-
}
|
|
1110
|
-
function hi(t) {
|
|
1111
|
-
return t = u(t), this.context.memoryLimit.use(t.length), t.replace(/&(amp|lt|gt|#34|#39);/g, (e) => ai[e]);
|
|
1112
|
-
}
|
|
1113
|
-
function ci(t) {
|
|
1114
|
-
return ye.call(this, hi.call(this, t));
|
|
1115
|
-
}
|
|
1116
|
-
function ui(t) {
|
|
1117
|
-
const e = u(t);
|
|
1118
|
-
return this.context.memoryLimit.use(e.length), e.replace(/\r?\n/gm, `<br />
|
|
1119
|
-
`);
|
|
1120
|
-
}
|
|
1121
|
-
function fi(t) {
|
|
1122
|
-
const e = u(t);
|
|
1123
|
-
return this.context.memoryLimit.use(e.length), e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g, "");
|
|
1124
|
-
}
|
|
1125
|
-
var di = /* @__PURE__ */ Object.freeze({
|
|
1126
|
-
__proto__: null,
|
|
1127
|
-
escape: ye,
|
|
1128
|
-
xml_escape: li,
|
|
1129
|
-
escape_once: ci,
|
|
1130
|
-
newline_to_br: ui,
|
|
1131
|
-
strip_html: fi
|
|
1132
|
-
});
|
|
1133
|
-
class pi {
|
|
1134
|
-
constructor(e) {
|
|
1135
|
-
this.mapping = e, this.sep = "/";
|
|
1136
|
-
}
|
|
1137
|
-
exists(e) {
|
|
1138
|
-
return k(this, void 0, void 0, function* () {
|
|
1139
|
-
return this.existsSync(e);
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
|
-
existsSync(e) {
|
|
1143
|
-
return !O(this.mapping[e]);
|
|
1144
|
-
}
|
|
1145
|
-
readFile(e) {
|
|
1146
|
-
return k(this, void 0, void 0, function* () {
|
|
1147
|
-
return this.readFileSync(e);
|
|
1148
|
-
});
|
|
1149
|
-
}
|
|
1150
|
-
readFileSync(e) {
|
|
1151
|
-
const s = this.mapping[e];
|
|
1152
|
-
if (O(s))
|
|
1153
|
-
throw new Error(`ENOENT: ${e}`);
|
|
1154
|
-
return s;
|
|
1155
|
-
}
|
|
1156
|
-
dirname(e) {
|
|
1157
|
-
const s = e.split(this.sep);
|
|
1158
|
-
return s.pop(), s.join(this.sep);
|
|
1159
|
-
}
|
|
1160
|
-
resolve(e, s, i) {
|
|
1161
|
-
if (s += i, e === ".")
|
|
1162
|
-
return s;
|
|
1163
|
-
const r = e.split(/\/+/);
|
|
1164
|
-
for (const n of s.split(this.sep))
|
|
1165
|
-
n === "." || n === "" || (n === ".." ? (r.length > 1 || r[0] !== "") && r.pop() : r.push(n));
|
|
1166
|
-
return r.join(this.sep);
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
const Q = {
|
|
1170
|
-
root: ["."],
|
|
1171
|
-
layouts: ["."],
|
|
1172
|
-
partials: ["."],
|
|
1173
|
-
relativeReference: !0,
|
|
1174
|
-
jekyllInclude: !1,
|
|
1175
|
-
keyValueSeparator: ":",
|
|
1176
|
-
cache: void 0,
|
|
1177
|
-
extname: "",
|
|
1178
|
-
fs: ti,
|
|
1179
|
-
dynamicPartials: !0,
|
|
1180
|
-
jsTruthy: !1,
|
|
1181
|
-
dateFormat: "%A, %B %-e, %Y at %-l:%M %P %z",
|
|
1182
|
-
locale: "",
|
|
1183
|
-
trimTagRight: !1,
|
|
1184
|
-
trimTagLeft: !1,
|
|
1185
|
-
trimOutputRight: !1,
|
|
1186
|
-
trimOutputLeft: !1,
|
|
1187
|
-
greedy: !0,
|
|
1188
|
-
tagDelimiterLeft: "{%",
|
|
1189
|
-
tagDelimiterRight: "%}",
|
|
1190
|
-
outputDelimiterLeft: "{{",
|
|
1191
|
-
outputDelimiterRight: "}}",
|
|
1192
|
-
preserveTimezones: !1,
|
|
1193
|
-
strictFilters: !1,
|
|
1194
|
-
strictVariables: !1,
|
|
1195
|
-
ownPropertyOnly: !0,
|
|
1196
|
-
lenientIf: !1,
|
|
1197
|
-
globals: {},
|
|
1198
|
-
keepOutputType: !1,
|
|
1199
|
-
operators: Hs,
|
|
1200
|
-
memoryLimit: 1 / 0,
|
|
1201
|
-
parseLimit: 1 / 0,
|
|
1202
|
-
renderLimit: 1 / 0
|
|
1203
|
-
};
|
|
1204
|
-
function gi(t) {
|
|
1205
|
-
var e, s;
|
|
1206
|
-
if (t.hasOwnProperty("root") && (t.hasOwnProperty("partials") || (t.partials = t.root), t.hasOwnProperty("layouts") || (t.layouts = t.root)), t.hasOwnProperty("cache")) {
|
|
1207
|
-
let i;
|
|
1208
|
-
typeof t.cache == "number" ? i = t.cache > 0 ? new it(t.cache) : void 0 : typeof t.cache == "object" ? i = t.cache : i = t.cache ? new it(1024) : void 0, t.cache = i;
|
|
1209
|
-
}
|
|
1210
|
-
return t = Object.assign(Object.assign(Object.assign({}, Q), t.jekyllInclude ? { dynamicPartials: !1 } : {}), t), (!t.fs.dirname || !t.fs.sep) && t.relativeReference && (console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"), t.relativeReference = !1), t.root = ae(t.root), t.partials = ae(t.partials), t.layouts = ae(t.layouts), t.outputEscape = t.outputEscape && mi(t.outputEscape), t.locale || (t.locale = (s = (e = _t()) === null || e === void 0 ? void 0 : e().resolvedOptions().locale) !== null && s !== void 0 ? s : "en-US"), t.templates && (t.fs = new pi(t.templates), t.relativeReference = !0, t.root = t.partials = t.layouts = "."), t;
|
|
1211
|
-
}
|
|
1212
|
-
function mi(t) {
|
|
1213
|
-
return t === "escape" ? ye : t === "json" ? Et.json : (_(v(t), "`outputEscape` need to be of type string or function"), t);
|
|
1214
|
-
}
|
|
1215
|
-
function ae(t) {
|
|
1216
|
-
let e = [];
|
|
1217
|
-
return x(t) && (e = t), f(t) && (e = [t]), e;
|
|
1218
|
-
}
|
|
1219
|
-
function yi(t, e) {
|
|
1220
|
-
let s = !1;
|
|
1221
|
-
for (let i = 0; i < t.length; i++) {
|
|
1222
|
-
const r = t[i];
|
|
1223
|
-
Fi(r) && (!s && r.trimLeft && wi(t[i - 1], e.greedy), Z(r) && (r.name === "raw" ? s = !0 : r.name === "endraw" && (s = !1)), !s && r.trimRight && bi(t[i + 1], e.greedy));
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
function wi(t, e) {
|
|
1227
|
-
if (!t || !Ae(t))
|
|
1228
|
-
return;
|
|
1229
|
-
const s = e ? X : kt;
|
|
1230
|
-
for (; m[t.input.charCodeAt(t.end - 1 - t.trimRight)] & s; )
|
|
1231
|
-
t.trimRight++;
|
|
1232
|
-
}
|
|
1233
|
-
function bi(t, e) {
|
|
1234
|
-
if (!t || !Ae(t))
|
|
1235
|
-
return;
|
|
1236
|
-
const s = e ? X : kt;
|
|
1237
|
-
for (; m[t.input.charCodeAt(t.begin + t.trimLeft)] & s; )
|
|
1238
|
-
t.trimLeft++;
|
|
1239
|
-
t.input.charAt(t.begin + t.trimLeft) === `
|
|
1240
|
-
` && t.trimLeft++;
|
|
1241
|
-
}
|
|
1242
|
-
class N {
|
|
1243
|
-
constructor(e, s = Q.operators, i, r) {
|
|
1244
|
-
this.input = e, this.file = i, this.rawBeginAt = -1, this.p = r ? r[0] : 0, this.N = r ? r[1] : e.length, this.opTrie = Ye(s), this.literalTrie = Ye(St);
|
|
1245
|
-
}
|
|
1246
|
-
readExpression() {
|
|
1247
|
-
return new Ps(this.readExpressionTokens());
|
|
1248
|
-
}
|
|
1249
|
-
*readExpressionTokens() {
|
|
1250
|
-
for (; this.p < this.N; ) {
|
|
1251
|
-
const e = this.readOperator();
|
|
1252
|
-
if (e) {
|
|
1253
|
-
yield e;
|
|
1254
|
-
continue;
|
|
1255
|
-
}
|
|
1256
|
-
const s = this.readValue();
|
|
1257
|
-
if (s) {
|
|
1258
|
-
yield s;
|
|
1259
|
-
continue;
|
|
1260
|
-
}
|
|
1261
|
-
return;
|
|
1262
|
-
}
|
|
1263
|
-
}
|
|
1264
|
-
readOperator() {
|
|
1265
|
-
this.skipBlank();
|
|
1266
|
-
const e = this.matchTrie(this.opTrie);
|
|
1267
|
-
if (e !== -1)
|
|
1268
|
-
return new Rs(this.input, this.p, this.p = e, this.file);
|
|
1269
|
-
}
|
|
1270
|
-
matchTrie(e) {
|
|
1271
|
-
let s = e, i = this.p, r;
|
|
1272
|
-
for (; s[this.input[i]] && i < this.N; )
|
|
1273
|
-
s = s[this.input[i++]], s.end && (r = s);
|
|
1274
|
-
return !r || r.needBoundary && ne(this.peek(i - this.p)) ? -1 : i;
|
|
1275
|
-
}
|
|
1276
|
-
readFilteredValue() {
|
|
1277
|
-
const e = this.p, s = this.readExpression();
|
|
1278
|
-
this.assert(s.valid(), `invalid value expression: ${this.snapshot()}`);
|
|
1279
|
-
const i = this.readFilters();
|
|
1280
|
-
return new js(s, i, this.input, e, this.p, this.file);
|
|
1281
|
-
}
|
|
1282
|
-
readFilters() {
|
|
1283
|
-
const e = [];
|
|
1284
|
-
for (; ; ) {
|
|
1285
|
-
const s = this.readFilter();
|
|
1286
|
-
if (!s)
|
|
1287
|
-
return e;
|
|
1288
|
-
e.push(s);
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
readFilter() {
|
|
1292
|
-
if (this.skipBlank(), this.end())
|
|
1293
|
-
return null;
|
|
1294
|
-
this.assert(this.read() === "|", 'expected "|" before filter');
|
|
1295
|
-
const e = this.readIdentifier();
|
|
1296
|
-
if (!e.size())
|
|
1297
|
-
return this.assert(this.end(), "expected filter name"), null;
|
|
1298
|
-
const s = [];
|
|
1299
|
-
if (this.skipBlank(), this.peek() === ":")
|
|
1300
|
-
do {
|
|
1301
|
-
++this.p;
|
|
1302
|
-
const i = this.readFilterArg();
|
|
1303
|
-
i && s.push(i), this.skipBlank(), this.assert(this.end() || this.peek() === "," || this.peek() === "|", () => `unexpected character ${this.snapshot()}`);
|
|
1304
|
-
} while (this.peek() === ",");
|
|
1305
|
-
else if (!(this.peek() === "|" || this.end())) throw this.error('expected ":" after filter name');
|
|
1306
|
-
return new Ot(e.getText(), s, this.input, e.begin, this.p, this.file);
|
|
1307
|
-
}
|
|
1308
|
-
readFilterArg() {
|
|
1309
|
-
const e = this.readValue();
|
|
1310
|
-
if (!e)
|
|
1311
|
-
return;
|
|
1312
|
-
if (this.skipBlank(), this.peek() !== ":")
|
|
1313
|
-
return e;
|
|
1314
|
-
++this.p;
|
|
1315
|
-
const s = this.readValue();
|
|
1316
|
-
return [e.getText(), s];
|
|
1317
|
-
}
|
|
1318
|
-
readTopLevelTokens(e = Q) {
|
|
1319
|
-
const s = [];
|
|
1320
|
-
for (; this.p < this.N; ) {
|
|
1321
|
-
const i = this.readTopLevelToken(e);
|
|
1322
|
-
s.push(i);
|
|
1323
|
-
}
|
|
1324
|
-
return yi(s, e), s;
|
|
1325
|
-
}
|
|
1326
|
-
readTopLevelToken(e) {
|
|
1327
|
-
const { tagDelimiterLeft: s, outputDelimiterLeft: i } = e;
|
|
1328
|
-
return this.rawBeginAt > -1 ? this.readEndrawOrRawContent(e) : this.match(s) ? this.readTagToken(e) : this.match(i) ? this.readOutputToken(e) : this.readHTMLToken([s, i]);
|
|
1329
|
-
}
|
|
1330
|
-
readHTMLToken(e) {
|
|
1331
|
-
const s = this.p;
|
|
1332
|
-
for (; this.p < this.N && !e.some((i) => this.match(i)); )
|
|
1333
|
-
++this.p;
|
|
1334
|
-
return new Ge(this.input, s, this.p, this.file);
|
|
1335
|
-
}
|
|
1336
|
-
readTagToken(e) {
|
|
1337
|
-
const { file: s, input: i } = this, r = this.p;
|
|
1338
|
-
if (this.readToDelimiter(e.tagDelimiterRight) === -1)
|
|
1339
|
-
throw this.error(`tag ${this.snapshot(r)} not closed`, r);
|
|
1340
|
-
const n = new Qe(i, r, this.p, e, s);
|
|
1341
|
-
return n.name === "raw" && (this.rawBeginAt = r), n;
|
|
1342
|
-
}
|
|
1343
|
-
readToDelimiter(e, s = !1) {
|
|
1344
|
-
for (this.skipBlank(); this.p < this.N; ) {
|
|
1345
|
-
if (s && this.peekType() & Ue) {
|
|
1346
|
-
this.readQuoted();
|
|
1347
|
-
continue;
|
|
1348
|
-
}
|
|
1349
|
-
if (++this.p, this.rmatch(e))
|
|
1350
|
-
return this.p;
|
|
1351
|
-
}
|
|
1352
|
-
return -1;
|
|
1353
|
-
}
|
|
1354
|
-
readOutputToken(e = Q) {
|
|
1355
|
-
const { file: s, input: i } = this, { outputDelimiterRight: r } = e, n = this.p;
|
|
1356
|
-
if (this.readToDelimiter(r, !0) === -1)
|
|
1357
|
-
throw this.error(`output ${this.snapshot(n)} not closed`, n);
|
|
1358
|
-
return new Fs(i, n, this.p, e, s);
|
|
1359
|
-
}
|
|
1360
|
-
readEndrawOrRawContent(e) {
|
|
1361
|
-
const { tagDelimiterLeft: s, tagDelimiterRight: i } = e, r = this.p;
|
|
1362
|
-
let n = this.readTo(s) - s.length;
|
|
1363
|
-
for (; this.p < this.N; ) {
|
|
1364
|
-
if (this.readIdentifier().getText() !== "endraw") {
|
|
1365
|
-
n = this.readTo(s) - s.length;
|
|
1366
|
-
continue;
|
|
1367
|
-
}
|
|
1368
|
-
for (; this.p <= this.N; ) {
|
|
1369
|
-
if (this.rmatch(i)) {
|
|
1370
|
-
const o = this.p;
|
|
1371
|
-
return r === n ? (this.rawBeginAt = -1, new Qe(this.input, r, o, e, this.file)) : (this.p = n, new Ge(this.input, r, n, this.file));
|
|
1372
|
-
}
|
|
1373
|
-
if (this.rmatch(s))
|
|
1374
|
-
break;
|
|
1375
|
-
this.p++;
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`, r);
|
|
1379
|
-
}
|
|
1380
|
-
readLiquidTagTokens(e = Q) {
|
|
1381
|
-
const s = [];
|
|
1382
|
-
for (; this.p < this.N; ) {
|
|
1383
|
-
const i = this.readLiquidTagToken(e);
|
|
1384
|
-
i && s.push(i);
|
|
1385
|
-
}
|
|
1386
|
-
return s;
|
|
1387
|
-
}
|
|
1388
|
-
readLiquidTagToken(e) {
|
|
1389
|
-
if (this.skipBlank(), this.end())
|
|
1390
|
-
return;
|
|
1391
|
-
const s = this.p;
|
|
1392
|
-
this.readToDelimiter(`
|
|
1393
|
-
`);
|
|
1394
|
-
const i = this.p;
|
|
1395
|
-
return new Vs(this.input, s, i, e, this.file);
|
|
1396
|
-
}
|
|
1397
|
-
error(e, s = this.p) {
|
|
1398
|
-
return new Kt(e, new we(this.input, s, this.N, this.file));
|
|
1399
|
-
}
|
|
1400
|
-
assert(e, s, i) {
|
|
1401
|
-
if (!e)
|
|
1402
|
-
throw this.error(typeof s == "function" ? s() : s, i);
|
|
1403
|
-
}
|
|
1404
|
-
snapshot(e = this.p) {
|
|
1405
|
-
return JSON.stringify(Xt(this.input.slice(e, this.N), 32));
|
|
1406
|
-
}
|
|
1407
|
-
/**
|
|
1408
|
-
* @deprecated use #readIdentifier instead
|
|
1409
|
-
*/
|
|
1410
|
-
readWord() {
|
|
1411
|
-
return this.readIdentifier();
|
|
1412
|
-
}
|
|
1413
|
-
readIdentifier() {
|
|
1414
|
-
this.skipBlank();
|
|
1415
|
-
const e = this.p;
|
|
1416
|
-
for (; !this.end() && ne(this.peek()); )
|
|
1417
|
-
++this.p;
|
|
1418
|
-
return new we(this.input, e, this.p, this.file);
|
|
1419
|
-
}
|
|
1420
|
-
readNonEmptyIdentifier() {
|
|
1421
|
-
const e = this.readIdentifier();
|
|
1422
|
-
return e.size() ? e : void 0;
|
|
1423
|
-
}
|
|
1424
|
-
readTagName() {
|
|
1425
|
-
return this.skipBlank(), this.input[this.p] === "#" ? this.input.slice(this.p, ++this.p) : this.readIdentifier().getText();
|
|
1426
|
-
}
|
|
1427
|
-
readHashes(e) {
|
|
1428
|
-
const s = [];
|
|
1429
|
-
for (; ; ) {
|
|
1430
|
-
const i = this.readHash(e);
|
|
1431
|
-
if (!i)
|
|
1432
|
-
return s;
|
|
1433
|
-
s.push(i);
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
readHash(e) {
|
|
1437
|
-
this.skipBlank(), this.peek() === "," && ++this.p;
|
|
1438
|
-
const s = this.p, i = this.readNonEmptyIdentifier();
|
|
1439
|
-
if (!i)
|
|
1440
|
-
return;
|
|
1441
|
-
let r;
|
|
1442
|
-
this.skipBlank();
|
|
1443
|
-
const n = f(e) ? e : e ? "=" : ":";
|
|
1444
|
-
return this.peek() === n && (++this.p, r = this.readValue()), new Es(this.input, s, this.p, i, r, this.file);
|
|
1445
|
-
}
|
|
1446
|
-
remaining() {
|
|
1447
|
-
return this.input.slice(this.p, this.N);
|
|
1448
|
-
}
|
|
1449
|
-
advance(e = 1) {
|
|
1450
|
-
this.p += e;
|
|
1451
|
-
}
|
|
1452
|
-
end() {
|
|
1453
|
-
return this.p >= this.N;
|
|
1454
|
-
}
|
|
1455
|
-
read() {
|
|
1456
|
-
return this.input[this.p++];
|
|
1457
|
-
}
|
|
1458
|
-
readTo(e) {
|
|
1459
|
-
for (; this.p < this.N; )
|
|
1460
|
-
if (++this.p, this.rmatch(e))
|
|
1461
|
-
return this.p;
|
|
1462
|
-
return -1;
|
|
1463
|
-
}
|
|
1464
|
-
readValue() {
|
|
1465
|
-
this.skipBlank();
|
|
1466
|
-
const e = this.p, s = this.readLiteral() || this.readQuoted() || this.readRange() || this.readNumber(), i = this.readProperties(!s);
|
|
1467
|
-
return i.length ? new Ke(s, i, this.input, e, this.p) : s;
|
|
1468
|
-
}
|
|
1469
|
-
readScopeValue() {
|
|
1470
|
-
this.skipBlank();
|
|
1471
|
-
const e = this.p, s = this.readProperties();
|
|
1472
|
-
if (s.length)
|
|
1473
|
-
return new Ke(void 0, s, this.input, e, this.p);
|
|
1474
|
-
}
|
|
1475
|
-
readProperties(e = !0) {
|
|
1476
|
-
const s = [];
|
|
1477
|
-
for (; ; ) {
|
|
1478
|
-
if (this.peek() === "[") {
|
|
1479
|
-
this.p++;
|
|
1480
|
-
const i = this.readValue() || new we(this.input, this.p, this.p, this.file);
|
|
1481
|
-
this.assert(this.readTo("]") !== -1, "[ not closed"), s.push(i);
|
|
1482
|
-
continue;
|
|
1483
|
-
}
|
|
1484
|
-
if (e && !s.length) {
|
|
1485
|
-
const i = this.readNonEmptyIdentifier();
|
|
1486
|
-
if (i) {
|
|
1487
|
-
s.push(i);
|
|
1488
|
-
continue;
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
if (this.peek() === "." && this.peek(1) !== ".") {
|
|
1492
|
-
this.p++;
|
|
1493
|
-
const i = this.readNonEmptyIdentifier();
|
|
1494
|
-
if (!i)
|
|
1495
|
-
break;
|
|
1496
|
-
s.push(i);
|
|
1497
|
-
continue;
|
|
1498
|
-
}
|
|
1499
|
-
break;
|
|
1500
|
-
}
|
|
1501
|
-
return s;
|
|
1502
|
-
}
|
|
1503
|
-
readNumber() {
|
|
1504
|
-
this.skipBlank();
|
|
1505
|
-
let e = !1, s = !1, i = 0;
|
|
1506
|
-
for (this.peekType() & hs && i++; this.p + i <= this.N; )
|
|
1507
|
-
if (this.peekType(i) & ls)
|
|
1508
|
-
s = !0, i++;
|
|
1509
|
-
else if (this.peek(i) === "." && this.peek(i + 1) !== ".") {
|
|
1510
|
-
if (e || !s)
|
|
1511
|
-
return;
|
|
1512
|
-
e = !0, i++;
|
|
1513
|
-
} else
|
|
1514
|
-
break;
|
|
1515
|
-
if (s && !ne(this.peek(i))) {
|
|
1516
|
-
const r = new Ls(this.input, this.p, this.p + i, this.file);
|
|
1517
|
-
return this.advance(i), r;
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
readLiteral() {
|
|
1521
|
-
this.skipBlank();
|
|
1522
|
-
const e = this.matchTrie(this.literalTrie);
|
|
1523
|
-
if (e === -1)
|
|
1524
|
-
return;
|
|
1525
|
-
const s = new Os(this.input, this.p, e, this.file);
|
|
1526
|
-
return this.p = e, s;
|
|
1527
|
-
}
|
|
1528
|
-
readRange() {
|
|
1529
|
-
this.skipBlank();
|
|
1530
|
-
const e = this.p;
|
|
1531
|
-
if (this.peek() !== "(")
|
|
1532
|
-
return;
|
|
1533
|
-
++this.p;
|
|
1534
|
-
const s = this.readValueOrThrow();
|
|
1535
|
-
this.skipBlank(), this.assert(this.read() === "." && this.read() === ".", "invalid range syntax");
|
|
1536
|
-
const i = this.readValueOrThrow();
|
|
1537
|
-
return this.skipBlank(), this.assert(this.read() === ")", "invalid range syntax"), new Ms(this.input, e, this.p, s, i, this.file);
|
|
1538
|
-
}
|
|
1539
|
-
readValueOrThrow() {
|
|
1540
|
-
const e = this.readValue();
|
|
1541
|
-
return this.assert(e, () => `unexpected token ${this.snapshot()}, value expected`), e;
|
|
1542
|
-
}
|
|
1543
|
-
readQuoted() {
|
|
1544
|
-
this.skipBlank();
|
|
1545
|
-
const e = this.p;
|
|
1546
|
-
if (!(this.peekType() & Ue))
|
|
1547
|
-
return;
|
|
1548
|
-
++this.p;
|
|
1549
|
-
let s = !1;
|
|
1550
|
-
for (; this.p < this.N && (++this.p, !(this.input[this.p - 1] === this.input[e] && !s)); )
|
|
1551
|
-
s ? s = !1 : this.input[this.p - 1] === "\\" && (s = !0);
|
|
1552
|
-
return new Ds(this.input, e, this.p, this.file);
|
|
1553
|
-
}
|
|
1554
|
-
*readFileNameTemplate(e) {
|
|
1555
|
-
const { outputDelimiterLeft: s } = e, i = [",", " ", "\r", `
|
|
1556
|
-
`, " ", s], r = new Set(i);
|
|
1557
|
-
for (; this.p < this.N && !r.has(this.peek()); )
|
|
1558
|
-
yield this.match(s) ? this.readOutputToken(e) : this.readHTMLToken(i);
|
|
1559
|
-
}
|
|
1560
|
-
match(e) {
|
|
1561
|
-
for (let s = 0; s < e.length; s++)
|
|
1562
|
-
if (e[s] !== this.input[this.p + s])
|
|
1563
|
-
return !1;
|
|
1564
|
-
return !0;
|
|
1565
|
-
}
|
|
1566
|
-
rmatch(e) {
|
|
1567
|
-
for (let s = 0; s < e.length; s++)
|
|
1568
|
-
if (e[e.length - 1 - s] !== this.input[this.p - 1 - s])
|
|
1569
|
-
return !1;
|
|
1570
|
-
return !0;
|
|
1571
|
-
}
|
|
1572
|
-
peekType(e = 0) {
|
|
1573
|
-
return this.p + e >= this.N ? 0 : m[this.input.charCodeAt(this.p + e)];
|
|
1574
|
-
}
|
|
1575
|
-
peek(e = 0) {
|
|
1576
|
-
return this.p + e >= this.N ? "" : this.input[this.p + e];
|
|
1577
|
-
}
|
|
1578
|
-
skipBlank() {
|
|
1579
|
-
for (; this.peekType() & X; )
|
|
1580
|
-
++this.p;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
class Ti {
|
|
1584
|
-
constructor(e, s) {
|
|
1585
|
-
this.handlers = {}, this.stopRequested = !1, this.tokens = e, this.parseToken = s;
|
|
1586
|
-
}
|
|
1587
|
-
on(e, s) {
|
|
1588
|
-
return this.handlers[e] = s, this;
|
|
1589
|
-
}
|
|
1590
|
-
trigger(e, s) {
|
|
1591
|
-
const i = this.handlers[e];
|
|
1592
|
-
return i ? (i.call(this, s), !0) : !1;
|
|
1593
|
-
}
|
|
1594
|
-
start() {
|
|
1595
|
-
this.trigger("start");
|
|
1596
|
-
let e;
|
|
1597
|
-
for (; !this.stopRequested && (e = this.tokens.shift()); ) {
|
|
1598
|
-
if (this.trigger("token", e) || Z(e) && this.trigger(`tag:${e.name}`, e))
|
|
1599
|
-
continue;
|
|
1600
|
-
const s = this.parseToken(e, this.tokens);
|
|
1601
|
-
this.trigger("template", s);
|
|
1602
|
-
}
|
|
1603
|
-
return this.stopRequested || this.trigger("end"), this;
|
|
1604
|
-
}
|
|
1605
|
-
stop() {
|
|
1606
|
-
return this.stopRequested = !0, this;
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
class Ee {
|
|
1610
|
-
constructor(e) {
|
|
1611
|
-
this.token = e;
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
class b extends Ee {
|
|
1615
|
-
constructor(e, s, i) {
|
|
1616
|
-
super(e), this.name = e.name, this.liquid = i, this.tokenizer = e.tokenizer;
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
class ee {
|
|
1620
|
-
constructor(e, s) {
|
|
1621
|
-
this.hash = {};
|
|
1622
|
-
const i = e instanceof N ? e : new N(e, {});
|
|
1623
|
-
for (const r of i.readHashes(s))
|
|
1624
|
-
this.hash[r.name.content] = r.value;
|
|
1625
|
-
}
|
|
1626
|
-
*render(e) {
|
|
1627
|
-
const s = {};
|
|
1628
|
-
for (const i of Object.keys(this.hash))
|
|
1629
|
-
s[i] = this.hash[i] === void 0 ? !0 : yield T(this.hash[i], e);
|
|
1630
|
-
return s;
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
function ki(t) {
|
|
1634
|
-
return class extends b {
|
|
1635
|
-
constructor(e, s, i) {
|
|
1636
|
-
super(e, s, i), v(t.parse) && t.parse.call(this, e, s);
|
|
1637
|
-
}
|
|
1638
|
-
*render(e, s) {
|
|
1639
|
-
const i = yield new ee(this.token.args, e.opts.keyValueSeparator).render(e);
|
|
1640
|
-
return yield t.render.call(this, e, s, i);
|
|
1641
|
-
}
|
|
1642
|
-
};
|
|
1643
|
-
}
|
|
1644
|
-
function At(t) {
|
|
1645
|
-
return x(t);
|
|
1646
|
-
}
|
|
1647
|
-
class Nt {
|
|
1648
|
-
constructor(e, s, i) {
|
|
1649
|
-
this.token = e, this.name = e.name, this.handler = v(s) ? s : v(s == null ? void 0 : s.handler) ? s.handler : bt, this.raw = !v(s) && !!(s != null && s.raw), this.args = e.args, this.liquid = i;
|
|
1650
|
-
}
|
|
1651
|
-
*render(e, s) {
|
|
1652
|
-
const i = [];
|
|
1653
|
-
for (const r of this.args)
|
|
1654
|
-
At(r) ? i.push([r[0], yield T(r[1], s)]) : i.push(yield T(r, s));
|
|
1655
|
-
return yield this.handler.apply({ context: s, token: this.token, liquid: this.liquid }, [e, ...i]);
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
class L {
|
|
1659
|
-
/**
|
|
1660
|
-
* @param str the value to be valuated, eg.: "foobar" | truncate: 3
|
|
1661
|
-
*/
|
|
1662
|
-
constructor(e, s) {
|
|
1663
|
-
this.filters = [];
|
|
1664
|
-
const i = typeof e == "string" ? new N(e, s.options.operators).readFilteredValue() : e;
|
|
1665
|
-
this.initial = i.initial, this.filters = i.filters.map((r) => new Nt(r, this.getFilter(s, r.name), s));
|
|
1666
|
-
}
|
|
1667
|
-
*value(e, s) {
|
|
1668
|
-
s = s || e.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === "default";
|
|
1669
|
-
let i = yield this.initial.evaluate(e, s);
|
|
1670
|
-
for (const r of this.filters)
|
|
1671
|
-
i = yield r.render(i, e);
|
|
1672
|
-
return i;
|
|
1673
|
-
}
|
|
1674
|
-
getFilter(e, s) {
|
|
1675
|
-
const i = e.filters[s];
|
|
1676
|
-
return _(i || !e.options.strictFilters, () => `undefined filter: ${s}`), i;
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
class vi extends Ee {
|
|
1680
|
-
constructor(e, s) {
|
|
1681
|
-
var i;
|
|
1682
|
-
super(e);
|
|
1683
|
-
const r = new N(e.input, s.options.operators, e.file, e.contentRange);
|
|
1684
|
-
this.value = new L(r.readFilteredValue(), s);
|
|
1685
|
-
const n = this.value.filters, o = s.options.outputEscape;
|
|
1686
|
-
if (!(!((i = n[n.length - 1]) === null || i === void 0) && i.raw) && o) {
|
|
1687
|
-
const a = new Ot(toString.call(o), [], "", 0, 0);
|
|
1688
|
-
n.push(new Nt(a, o, s));
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
*render(e, s) {
|
|
1692
|
-
const i = yield this.value.value(e, !1);
|
|
1693
|
-
s.write(i);
|
|
1694
|
-
}
|
|
1695
|
-
*arguments() {
|
|
1696
|
-
yield this.value;
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
class Si extends Ee {
|
|
1700
|
-
constructor(e) {
|
|
1701
|
-
super(e), this.str = e.getContent();
|
|
1702
|
-
}
|
|
1703
|
-
*render(e, s) {
|
|
1704
|
-
s.write(this.str);
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
class H {
|
|
1708
|
-
constructor(e, s) {
|
|
1709
|
-
this.segments = e, this.location = s;
|
|
1710
|
-
}
|
|
1711
|
-
toString() {
|
|
1712
|
-
return ue(this.segments, !0);
|
|
1713
|
-
}
|
|
1714
|
-
/** Return this variable's segments as an array, possibly with nested arrays for nested paths. */
|
|
1715
|
-
toArray() {
|
|
1716
|
-
function* e(...s) {
|
|
1717
|
-
for (const i of s)
|
|
1718
|
-
i instanceof H ? yield Array.from(e(...i.segments)) : yield i;
|
|
1719
|
-
}
|
|
1720
|
-
return Array.from(e(...this.segments));
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
class Te {
|
|
1724
|
-
constructor() {
|
|
1725
|
-
this.map = /* @__PURE__ */ new Map();
|
|
1726
|
-
}
|
|
1727
|
-
get(e) {
|
|
1728
|
-
const s = ue([e.segments[0]]);
|
|
1729
|
-
return this.map.has(s) || this.map.set(s, []), this.map.get(s);
|
|
1730
|
-
}
|
|
1731
|
-
has(e) {
|
|
1732
|
-
return this.map.has(ue([e.segments[0]]));
|
|
1733
|
-
}
|
|
1734
|
-
push(e) {
|
|
1735
|
-
this.get(e).push(e);
|
|
1736
|
-
}
|
|
1737
|
-
asObject() {
|
|
1738
|
-
return Object.fromEntries(this.map);
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
const Dt = {
|
|
1742
|
-
partials: !0
|
|
1743
|
-
};
|
|
1744
|
-
function* Mt(t, e, s) {
|
|
1745
|
-
const i = new Te(), r = new Te(), n = new Te(), o = new nt(/* @__PURE__ */ new Set()), a = /* @__PURE__ */ new Set();
|
|
1746
|
-
function l(h, d) {
|
|
1747
|
-
i.push(h);
|
|
1748
|
-
const g = d.alias(h);
|
|
1749
|
-
if (g !== void 0) {
|
|
1750
|
-
const w = g.segments[0];
|
|
1751
|
-
f(w) && !o.has(w) && r.push(g);
|
|
1752
|
-
} else {
|
|
1753
|
-
const w = h.segments[0];
|
|
1754
|
-
f(w) && !d.has(w) && r.push(h);
|
|
1755
|
-
}
|
|
1756
|
-
for (const w of h.segments)
|
|
1757
|
-
w instanceof H && l(w, d);
|
|
1758
|
-
}
|
|
1759
|
-
function* c(h, d) {
|
|
1760
|
-
if (h.arguments)
|
|
1761
|
-
for (const g of h.arguments())
|
|
1762
|
-
for (const w of ot(g))
|
|
1763
|
-
l(w, d);
|
|
1764
|
-
if (h.localScope)
|
|
1765
|
-
for (const g of h.localScope()) {
|
|
1766
|
-
d.add(g.content), d.deleteAlias(g.content);
|
|
1767
|
-
const [w, te] = g.getPosition();
|
|
1768
|
-
n.push(new H([g.content], { row: w, col: te, file: g.file }));
|
|
1769
|
-
}
|
|
1770
|
-
if (h.children)
|
|
1771
|
-
if (h.partialScope) {
|
|
1772
|
-
const g = h.partialScope();
|
|
1773
|
-
if (g === void 0) {
|
|
1774
|
-
for (const P of yield h.children(e, s))
|
|
1775
|
-
yield c(P, d);
|
|
1776
|
-
return;
|
|
1777
|
-
}
|
|
1778
|
-
if (a.has(g.name))
|
|
1779
|
-
return;
|
|
1780
|
-
const w = /* @__PURE__ */ new Set(), te = g.isolated ? new nt(w) : d.push(w);
|
|
1781
|
-
for (const P of g.scope)
|
|
1782
|
-
if (f(P))
|
|
1783
|
-
w.add(P);
|
|
1784
|
-
else {
|
|
1785
|
-
const [qe, Ht] = P;
|
|
1786
|
-
w.add(qe);
|
|
1787
|
-
const Ce = Array.from(ot(Ht));
|
|
1788
|
-
Ce.length && te.setAlias(qe, Ce[0].segments);
|
|
1789
|
-
}
|
|
1790
|
-
for (const P of yield h.children(e, s))
|
|
1791
|
-
yield c(P, te), a.add(g.name);
|
|
1792
|
-
te.pop();
|
|
1793
|
-
} else {
|
|
1794
|
-
h.blockScope && d.push(new Set(h.blockScope()));
|
|
1795
|
-
for (const g of yield h.children(e, s))
|
|
1796
|
-
yield c(g, d);
|
|
1797
|
-
h.blockScope && d.pop();
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
for (const h of t)
|
|
1801
|
-
yield c(h, o);
|
|
1802
|
-
return {
|
|
1803
|
-
variables: i.asObject(),
|
|
1804
|
-
globals: r.asObject(),
|
|
1805
|
-
locals: n.asObject()
|
|
1806
|
-
};
|
|
1807
|
-
}
|
|
1808
|
-
function q(t, e = {}) {
|
|
1809
|
-
const s = Object.assign(Object.assign({}, Dt), e);
|
|
1810
|
-
return M(Mt(t, s.partials, !1));
|
|
1811
|
-
}
|
|
1812
|
-
function C(t, e = {}) {
|
|
1813
|
-
const s = Object.assign(Object.assign({}, Dt), e);
|
|
1814
|
-
return V(Mt(t, s.partials, !0));
|
|
1815
|
-
}
|
|
1816
|
-
class nt {
|
|
1817
|
-
constructor(e) {
|
|
1818
|
-
this.stack = [{ names: e, aliases: /* @__PURE__ */ new Map() }];
|
|
1819
|
-
}
|
|
1820
|
-
/** Return true if `name` is in scope. */
|
|
1821
|
-
has(e) {
|
|
1822
|
-
for (const s of this.stack)
|
|
1823
|
-
if (s.names.has(e))
|
|
1824
|
-
return !0;
|
|
1825
|
-
return !1;
|
|
1826
|
-
}
|
|
1827
|
-
push(e) {
|
|
1828
|
-
return this.stack.push({ names: e, aliases: /* @__PURE__ */ new Map() }), this;
|
|
1829
|
-
}
|
|
1830
|
-
pop() {
|
|
1831
|
-
var e;
|
|
1832
|
-
return (e = this.stack.pop()) === null || e === void 0 ? void 0 : e.names;
|
|
1833
|
-
}
|
|
1834
|
-
// Add a name to the template scope.
|
|
1835
|
-
add(e) {
|
|
1836
|
-
this.stack[0].names.add(e);
|
|
1837
|
-
}
|
|
1838
|
-
/** Return the variable that `variable` aliases, or `variable` if it doesn't alias anything. */
|
|
1839
|
-
alias(e) {
|
|
1840
|
-
const s = e.segments[0];
|
|
1841
|
-
if (!f(s))
|
|
1842
|
-
return;
|
|
1843
|
-
const i = this.getAlias(s);
|
|
1844
|
-
if (i !== void 0)
|
|
1845
|
-
return new H([...i, ...e.segments.slice(1)], e.location);
|
|
1846
|
-
}
|
|
1847
|
-
// TODO: `from` could be a path with multiple segments, like `include.x`.
|
|
1848
|
-
setAlias(e, s) {
|
|
1849
|
-
this.stack[this.stack.length - 1].aliases.set(e, s);
|
|
1850
|
-
}
|
|
1851
|
-
deleteAlias(e) {
|
|
1852
|
-
this.stack[this.stack.length - 1].aliases.delete(e);
|
|
1853
|
-
}
|
|
1854
|
-
getAlias(e) {
|
|
1855
|
-
for (const s of this.stack) {
|
|
1856
|
-
if (s.aliases.has(e))
|
|
1857
|
-
return s.aliases.get(e);
|
|
1858
|
-
if (s.names.has(e))
|
|
1859
|
-
return;
|
|
1860
|
-
}
|
|
1861
|
-
}
|
|
1862
|
-
}
|
|
1863
|
-
function* ot(t) {
|
|
1864
|
-
F(t) ? yield* G(t) : t instanceof L && (yield* xi(t));
|
|
1865
|
-
}
|
|
1866
|
-
function* xi(t) {
|
|
1867
|
-
for (const e of t.initial.postfix)
|
|
1868
|
-
F(e) && (yield* G(e));
|
|
1869
|
-
for (const e of t.filters)
|
|
1870
|
-
for (const s of e.args)
|
|
1871
|
-
At(s) && s[1] ? yield* G(s[1]) : F(s) && (yield* G(s));
|
|
1872
|
-
}
|
|
1873
|
-
function* G(t) {
|
|
1874
|
-
jt(t) ? (yield* G(t.lhs), yield* G(t.rhs)) : fe(t) && (yield _e(t));
|
|
1875
|
-
}
|
|
1876
|
-
function _e(t) {
|
|
1877
|
-
const e = [];
|
|
1878
|
-
let s = t.file;
|
|
1879
|
-
const i = t.props[0];
|
|
1880
|
-
s = s || i.file, Fe(i) || lt(i) || ht(i) ? e.push(i.content) : fe(i) && e.push(..._e(i).segments);
|
|
1881
|
-
for (const o of t.props.slice(1))
|
|
1882
|
-
s = s || o.file, Fe(o) || lt(o) || ht(o) ? e.push(o.content) : fe(o) && e.push(_e(o));
|
|
1883
|
-
const [r, n] = t.getPosition();
|
|
1884
|
-
return new H(e, {
|
|
1885
|
-
row: r,
|
|
1886
|
-
col: n,
|
|
1887
|
-
file: s
|
|
1888
|
-
});
|
|
1889
|
-
}
|
|
1890
|
-
const at = /^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;
|
|
1891
|
-
function ue(t, e = !1) {
|
|
1892
|
-
const s = [], i = t[0];
|
|
1893
|
-
f(i) && (!e || i.match(at) ? s.push(`${i}`) : s.push(`['${i}']`));
|
|
1894
|
-
for (const r of t.slice(1))
|
|
1895
|
-
r instanceof H ? s.push(`[${ue(r.segments)}]`) : f(r) ? r.match(at) ? s.push(`.${r}`) : s.push(`['${r}']`) : s.push(`[${r}]`);
|
|
1896
|
-
return s.join("");
|
|
1897
|
-
}
|
|
1898
|
-
var W;
|
|
1899
|
-
(function(t) {
|
|
1900
|
-
t.Partials = "partials", t.Layouts = "layouts", t.Root = "root";
|
|
1901
|
-
})(W || (W = {}));
|
|
1902
|
-
class _i {
|
|
1903
|
-
constructor(e) {
|
|
1904
|
-
if (this.options = e, e.relativeReference) {
|
|
1905
|
-
const s = e.fs.sep;
|
|
1906
|
-
_(s, "`fs.sep` is required for relative reference");
|
|
1907
|
-
const i = ["." + s, ".." + s, "./", "../"];
|
|
1908
|
-
this.shouldLoadRelative = (r) => i.some((n) => r.startsWith(n));
|
|
1909
|
-
} else
|
|
1910
|
-
this.shouldLoadRelative = (s) => !1;
|
|
1911
|
-
this.contains = this.options.fs.contains || (() => !0);
|
|
1912
|
-
}
|
|
1913
|
-
*lookup(e, s, i, r) {
|
|
1914
|
-
const { fs: n } = this.options, o = this.options[s];
|
|
1915
|
-
for (const a of this.candidates(e, o, r, s !== W.Root))
|
|
1916
|
-
if (i ? n.existsSync(a) : yield n.exists(a))
|
|
1917
|
-
return a;
|
|
1918
|
-
throw this.lookupError(e, o);
|
|
1919
|
-
}
|
|
1920
|
-
*candidates(e, s, i, r) {
|
|
1921
|
-
const { fs: n, extname: o } = this.options, a = (l) => {
|
|
1922
|
-
if (!r)
|
|
1923
|
-
return !0;
|
|
1924
|
-
for (const c of s)
|
|
1925
|
-
if (this.contains(c, l))
|
|
1926
|
-
return !0;
|
|
1927
|
-
return !1;
|
|
1928
|
-
};
|
|
1929
|
-
if (this.shouldLoadRelative(e) && i) {
|
|
1930
|
-
const l = n.resolve(this.dirname(i), e, o);
|
|
1931
|
-
a(l) && (yield l);
|
|
1932
|
-
}
|
|
1933
|
-
for (const l of s) {
|
|
1934
|
-
const c = n.resolve(l, e, o);
|
|
1935
|
-
a(c) && (yield c);
|
|
1936
|
-
}
|
|
1937
|
-
if (n.fallback !== void 0) {
|
|
1938
|
-
const l = n.fallback(e);
|
|
1939
|
-
l !== void 0 && a(l) && (yield l);
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
dirname(e) {
|
|
1943
|
-
const s = this.options.fs;
|
|
1944
|
-
return _(s.dirname, "`fs.dirname` is required for relative reference"), s.dirname(e);
|
|
1945
|
-
}
|
|
1946
|
-
lookupError(e, s) {
|
|
1947
|
-
const i = new Error("ENOENT");
|
|
1948
|
-
return i.message = `ENOENT: Failed to lookup "${e}" in "${s}"`, i.code = "ENOENT", i;
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
class I {
|
|
1952
|
-
constructor(e) {
|
|
1953
|
-
this.liquid = e, this.cache = this.liquid.options.cache, this.fs = this.liquid.options.fs, this.parseFile = this.cache ? this._parseFileCached : this._parseFile, this.loader = new _i(this.liquid.options), this.parseLimit = new xe("parse length", e.options.parseLimit);
|
|
1954
|
-
}
|
|
1955
|
-
parse(e, s) {
|
|
1956
|
-
e = String(e), this.parseLimit.use(e.length);
|
|
1957
|
-
const r = new N(e, this.liquid.options.operators, s).readTopLevelTokens(this.liquid.options);
|
|
1958
|
-
return this.parseTokens(r);
|
|
1959
|
-
}
|
|
1960
|
-
parseTokens(e) {
|
|
1961
|
-
let s;
|
|
1962
|
-
const i = [], r = [];
|
|
1963
|
-
for (; s = e.shift(); )
|
|
1964
|
-
try {
|
|
1965
|
-
i.push(this.parseToken(s, e));
|
|
1966
|
-
} catch (n) {
|
|
1967
|
-
if (this.liquid.options.catchAllErrors)
|
|
1968
|
-
r.push(n);
|
|
1969
|
-
else
|
|
1970
|
-
throw n;
|
|
1971
|
-
}
|
|
1972
|
-
if (r.length)
|
|
1973
|
-
throw new Tt(r);
|
|
1974
|
-
return i;
|
|
1975
|
-
}
|
|
1976
|
-
parseToken(e, s) {
|
|
1977
|
-
try {
|
|
1978
|
-
if (Z(e)) {
|
|
1979
|
-
const i = this.liquid.tags[e.name];
|
|
1980
|
-
return _(i, `tag "${e.name}" not found`), new i(e, s, this.liquid, this);
|
|
1981
|
-
}
|
|
1982
|
-
return Li(e) ? new vi(e, this.liquid) : new Si(e);
|
|
1983
|
-
} catch (i) {
|
|
1984
|
-
throw J.is(i) ? i : new es(i, e);
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
parseStream(e) {
|
|
1988
|
-
return new Ti(e, (s, i) => this.parseToken(s, i));
|
|
1989
|
-
}
|
|
1990
|
-
*_parseFileCached(e, s, i = W.Root, r) {
|
|
1991
|
-
const n = this.cache, o = this.loader.shouldLoadRelative(e) ? r + "," + e : i + ":" + e, a = yield n.read(o);
|
|
1992
|
-
if (a)
|
|
1993
|
-
return a;
|
|
1994
|
-
const l = this._parseFile(e, s, i, r), c = s ? yield l : M(l);
|
|
1995
|
-
n.write(o, c);
|
|
1996
|
-
try {
|
|
1997
|
-
return yield c;
|
|
1998
|
-
} catch (h) {
|
|
1999
|
-
throw n.remove(o), h;
|
|
2000
|
-
}
|
|
2001
|
-
}
|
|
2002
|
-
*_parseFile(e, s, i = W.Root, r) {
|
|
2003
|
-
const n = yield this.loader.lookup(e, i, s, r);
|
|
2004
|
-
return this.parse(s ? this.fs.readFileSync(n) : yield this.fs.readFile(n), n);
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
var y;
|
|
2008
|
-
(function(t) {
|
|
2009
|
-
t[t.Number = 1] = "Number", t[t.Literal = 2] = "Literal", t[t.Tag = 4] = "Tag", t[t.Output = 8] = "Output", t[t.HTML = 16] = "HTML", t[t.Filter = 32] = "Filter", t[t.Hash = 64] = "Hash", t[t.PropertyAccess = 128] = "PropertyAccess", t[t.Word = 256] = "Word", t[t.Range = 512] = "Range", t[t.Quoted = 1024] = "Quoted", t[t.Operator = 2048] = "Operator", t[t.FilteredValue = 4096] = "FilteredValue", t[t.Delimited = 12] = "Delimited";
|
|
2010
|
-
})(y || (y = {}));
|
|
2011
|
-
function Fi(t) {
|
|
2012
|
-
return !!(E(t) & y.Delimited);
|
|
2013
|
-
}
|
|
2014
|
-
function Vt(t) {
|
|
2015
|
-
return E(t) === y.Operator;
|
|
2016
|
-
}
|
|
2017
|
-
function Ae(t) {
|
|
2018
|
-
return E(t) === y.HTML;
|
|
2019
|
-
}
|
|
2020
|
-
function Li(t) {
|
|
2021
|
-
return E(t) === y.Output;
|
|
2022
|
-
}
|
|
2023
|
-
function Z(t) {
|
|
2024
|
-
return E(t) === y.Tag;
|
|
2025
|
-
}
|
|
2026
|
-
function Fe(t) {
|
|
2027
|
-
return E(t) === y.Quoted;
|
|
2028
|
-
}
|
|
2029
|
-
function lt(t) {
|
|
2030
|
-
return E(t) === y.Number;
|
|
2031
|
-
}
|
|
2032
|
-
function fe(t) {
|
|
2033
|
-
return E(t) === y.PropertyAccess;
|
|
2034
|
-
}
|
|
2035
|
-
function ht(t) {
|
|
2036
|
-
return E(t) === y.Word;
|
|
2037
|
-
}
|
|
2038
|
-
function jt(t) {
|
|
2039
|
-
return E(t) === y.Range;
|
|
2040
|
-
}
|
|
2041
|
-
function F(t) {
|
|
2042
|
-
return (E(t) & 1667) > 0;
|
|
2043
|
-
}
|
|
2044
|
-
function E(t) {
|
|
2045
|
-
return t ? t.kind : -1;
|
|
2046
|
-
}
|
|
2047
|
-
class $ {
|
|
2048
|
-
constructor(e = {}, s = Q, i = {}, { memoryLimit: r, renderLimit: n } = {}) {
|
|
2049
|
-
var o, a, l, c, h;
|
|
2050
|
-
this.scopes = [{}], this.registers = {}, this.breakCalled = !1, this.continueCalled = !1, this.sync = !!i.sync, this.opts = s, this.globals = (o = i.globals) !== null && o !== void 0 ? o : s.globals, this.environments = pe(e) ? e : Object(e), this.strictVariables = (a = i.strictVariables) !== null && a !== void 0 ? a : this.opts.strictVariables, this.ownPropertyOnly = (l = i.ownPropertyOnly) !== null && l !== void 0 ? l : s.ownPropertyOnly, this.memoryLimit = r ?? new xe("memory alloc", (c = i.memoryLimit) !== null && c !== void 0 ? c : s.memoryLimit), this.renderLimit = n ?? new xe("template render", zt().now() + ((h = i.renderLimit) !== null && h !== void 0 ? h : s.renderLimit));
|
|
2051
|
-
}
|
|
2052
|
-
getRegister(e) {
|
|
2053
|
-
return this.registers[e] = this.registers[e] || {};
|
|
2054
|
-
}
|
|
2055
|
-
setRegister(e, s) {
|
|
2056
|
-
return this.registers[e] = s;
|
|
2057
|
-
}
|
|
2058
|
-
saveRegister(...e) {
|
|
2059
|
-
return e.map((s) => [s, this.getRegister(s)]);
|
|
2060
|
-
}
|
|
2061
|
-
restoreRegister(e) {
|
|
2062
|
-
return e.forEach(([s, i]) => this.setRegister(s, i));
|
|
2063
|
-
}
|
|
2064
|
-
getAll() {
|
|
2065
|
-
return [this.globals, this.environments, ...this.scopes].reduce((e, s) => ce(e, s), {});
|
|
2066
|
-
}
|
|
2067
|
-
/**
|
|
2068
|
-
* @deprecated use `_get()` or `getSync()` instead
|
|
2069
|
-
*/
|
|
2070
|
-
get(e) {
|
|
2071
|
-
return this.getSync(e);
|
|
2072
|
-
}
|
|
2073
|
-
getSync(e) {
|
|
2074
|
-
return V(this._get(e));
|
|
2075
|
-
}
|
|
2076
|
-
*_get(e) {
|
|
2077
|
-
const s = this.findScope(e[0]);
|
|
2078
|
-
return yield this._getFromScope(s, e);
|
|
2079
|
-
}
|
|
2080
|
-
/**
|
|
2081
|
-
* @deprecated use `_get()` instead
|
|
2082
|
-
*/
|
|
2083
|
-
getFromScope(e, s) {
|
|
2084
|
-
return V(this._getFromScope(e, s));
|
|
2085
|
-
}
|
|
2086
|
-
*_getFromScope(e, s, i = this.strictVariables) {
|
|
2087
|
-
f(s) && (s = s.split("."));
|
|
2088
|
-
for (let r = 0; r < s.length; r++)
|
|
2089
|
-
if (e = yield this.readProperty(e, s[r]), i && Jt(e))
|
|
2090
|
-
throw new is(s.slice(0, r + 1).join("."));
|
|
2091
|
-
return e;
|
|
2092
|
-
}
|
|
2093
|
-
push(e) {
|
|
2094
|
-
return this.scopes.push(e);
|
|
2095
|
-
}
|
|
2096
|
-
pop() {
|
|
2097
|
-
return this.scopes.pop();
|
|
2098
|
-
}
|
|
2099
|
-
bottom() {
|
|
2100
|
-
return this.scopes[0];
|
|
2101
|
-
}
|
|
2102
|
-
spawn(e = {}) {
|
|
2103
|
-
return new $(e, this.opts, {
|
|
2104
|
-
sync: this.sync,
|
|
2105
|
-
globals: this.globals,
|
|
2106
|
-
strictVariables: this.strictVariables
|
|
2107
|
-
}, {
|
|
2108
|
-
renderLimit: this.renderLimit,
|
|
2109
|
-
memoryLimit: this.memoryLimit
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
findScope(e) {
|
|
2113
|
-
for (let s = this.scopes.length - 1; s >= 0; s--) {
|
|
2114
|
-
const i = this.scopes[s];
|
|
2115
|
-
if (e in i)
|
|
2116
|
-
return i;
|
|
2117
|
-
}
|
|
2118
|
-
return e in this.environments ? this.environments : this.globals;
|
|
2119
|
-
}
|
|
2120
|
-
readProperty(e, s) {
|
|
2121
|
-
if (e = pt(e), s = p(s), O(e))
|
|
2122
|
-
return e;
|
|
2123
|
-
if (x(e) && s < 0)
|
|
2124
|
-
return e[e.length + +s];
|
|
2125
|
-
const i = Oi(e, s, this.ownPropertyOnly);
|
|
2126
|
-
return i === void 0 && e instanceof Y ? e.liquidMethodMissing(s, this) : v(i) ? i.call(e) : s === "size" ? Ei(e) : s === "first" ? zi(e) : s === "last" ? Ri(e) : i;
|
|
2127
|
-
}
|
|
2128
|
-
}
|
|
2129
|
-
function Oi(t, e, s) {
|
|
2130
|
-
if (!(s && !Le.call(t, e) && !(t instanceof Y)))
|
|
2131
|
-
return t[e];
|
|
2132
|
-
}
|
|
2133
|
-
function zi(t) {
|
|
2134
|
-
return x(t) ? t[0] : t.first;
|
|
2135
|
-
}
|
|
2136
|
-
function Ri(t) {
|
|
2137
|
-
return x(t) ? t[t.length - 1] : t.last;
|
|
2138
|
-
}
|
|
2139
|
-
function Ei(t) {
|
|
2140
|
-
if (Le.call(t, "size") || t.size !== void 0)
|
|
2141
|
-
return t.size;
|
|
2142
|
-
if (x(t) || f(t))
|
|
2143
|
-
return t.length;
|
|
2144
|
-
if (typeof t == "object")
|
|
2145
|
-
return Object.keys(t).length;
|
|
2146
|
-
}
|
|
2147
|
-
var U;
|
|
2148
|
-
(function(t) {
|
|
2149
|
-
t[t.OUTPUT = 0] = "OUTPUT", t[t.STORE = 1] = "STORE";
|
|
2150
|
-
})(U || (U = {}));
|
|
2151
|
-
const Ai = D(Math.abs), Ni = D(Math.max), Di = D(Math.min), Mi = D(Math.ceil), Vi = D((t, e, s = !1) => s ? Math.floor(t / e) : t / e), ji = D(Math.floor), qi = D((t, e) => t - e), Ci = D((t, e) => t + e), Pi = D((t, e) => t % e), Ii = D((t, e) => t * e);
|
|
2152
|
-
function $i(t, e = 0) {
|
|
2153
|
-
t = ve(t), e = ve(e);
|
|
2154
|
-
const s = Math.pow(10, e);
|
|
2155
|
-
return Math.round(t * s) / s;
|
|
2156
|
-
}
|
|
2157
|
-
var Bi = /* @__PURE__ */ Object.freeze({
|
|
2158
|
-
__proto__: null,
|
|
2159
|
-
abs: Ai,
|
|
2160
|
-
at_least: Ni,
|
|
2161
|
-
at_most: Di,
|
|
2162
|
-
ceil: Mi,
|
|
2163
|
-
divided_by: Vi,
|
|
2164
|
-
floor: ji,
|
|
2165
|
-
minus: qi,
|
|
2166
|
-
plus: Ci,
|
|
2167
|
-
modulo: Pi,
|
|
2168
|
-
times: Ii,
|
|
2169
|
-
round: $i
|
|
2170
|
-
});
|
|
2171
|
-
const Ui = (t) => decodeURIComponent(u(t)).replace(/\+/g, " "), Hi = (t) => encodeURIComponent(u(t)).replace(/%20/g, "+"), Wi = (t) => encodeURIComponent(u(t)).replace(/%20/g, "+").replace(/[!'()*]/g, (e) => "%" + e.charCodeAt(0).toString(16).toUpperCase()), Yi = (t) => encodeURI(u(t)).replace(/%5B/g, "[").replace(/%5D/g, "]"), ct = /[^\p{M}\p{L}\p{Nd}]+/ug, Ji = {
|
|
2172
|
-
raw: /\s+/g,
|
|
2173
|
-
default: ct,
|
|
2174
|
-
pretty: /[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/ug,
|
|
2175
|
-
ascii: /[^A-Za-z0-9]+/g,
|
|
2176
|
-
latin: ct,
|
|
2177
|
-
none: null
|
|
2178
|
-
};
|
|
2179
|
-
function Zi(t, e = "default", s = !1) {
|
|
2180
|
-
t = u(t);
|
|
2181
|
-
const i = Ji[e];
|
|
2182
|
-
return i && (e === "latin" && (t = Qi(t)), t = t.replace(i, "-").replace(/^-|-$/g, "")), s ? t : t.toLowerCase();
|
|
2183
|
-
}
|
|
2184
|
-
function Qi(t) {
|
|
2185
|
-
return t.replace(/[àáâãäå]/g, "a").replace(/[æ]/g, "ae").replace(/[ç]/g, "c").replace(/[èéêë]/g, "e").replace(/[ìíîï]/g, "i").replace(/[ð]/g, "d").replace(/[ñ]/g, "n").replace(/[òóôõöø]/g, "o").replace(/[ùúûü]/g, "u").replace(/[ýÿ]/g, "y").replace(/[ß]/g, "ss").replace(/[œ]/g, "oe").replace(/[þ]/g, "th").replace(/[ẞ]/g, "SS").replace(/[Œ]/g, "OE").replace(/[Þ]/g, "TH");
|
|
2186
|
-
}
|
|
2187
|
-
var Gi = /* @__PURE__ */ Object.freeze({
|
|
2188
|
-
__proto__: null,
|
|
2189
|
-
url_decode: Ui,
|
|
2190
|
-
url_encode: Hi,
|
|
2191
|
-
cgi_escape: Wi,
|
|
2192
|
-
uri_escape: Yi,
|
|
2193
|
-
slugify: Zi
|
|
2194
|
-
});
|
|
2195
|
-
const Xi = ge(function(t, e) {
|
|
2196
|
-
const s = S(t), i = O(e) ? " " : u(e), r = s.length * (1 + i.length);
|
|
2197
|
-
return this.context.memoryLimit.use(r), s.join(i);
|
|
2198
|
-
}), Ki = ge((t) => gt(t) ? mt(t) : ""), er = ge((t) => gt(t) ? t[0] : ""), tr = ge(function(t) {
|
|
2199
|
-
const e = S(t);
|
|
2200
|
-
return this.context.memoryLimit.use(e.length), [...e].reverse();
|
|
2201
|
-
});
|
|
2202
|
-
function* sr(t, e) {
|
|
2203
|
-
const s = [], i = S(t);
|
|
2204
|
-
this.context.memoryLimit.use(i.length);
|
|
2205
|
-
for (const r of i)
|
|
2206
|
-
s.push([
|
|
2207
|
-
r,
|
|
2208
|
-
e ? yield this.context._getFromScope(r, u(e).split("."), !1) : r
|
|
2209
|
-
]);
|
|
2210
|
-
return s.sort((r, n) => {
|
|
2211
|
-
const o = r[1], a = n[1];
|
|
2212
|
-
return o < a ? -1 : o > a ? 1 : 0;
|
|
2213
|
-
}).map((r) => r[0]);
|
|
2214
|
-
}
|
|
2215
|
-
function ir(t, e) {
|
|
2216
|
-
const s = u(e), i = e === void 0 ? $e : (n, o) => $e(n[s], o[s]), r = S(t);
|
|
2217
|
-
return this.context.memoryLimit.use(r.length), [...r].sort(i);
|
|
2218
|
-
}
|
|
2219
|
-
const rr = (t) => t && t.length || 0;
|
|
2220
|
-
function* nr(t, e) {
|
|
2221
|
-
const s = [], i = S(t);
|
|
2222
|
-
this.context.memoryLimit.use(i.length);
|
|
2223
|
-
for (const r of i)
|
|
2224
|
-
s.push(yield this.context._getFromScope(r, u(e), !1));
|
|
2225
|
-
return s;
|
|
2226
|
-
}
|
|
2227
|
-
function* or(t, e) {
|
|
2228
|
-
let s = 0;
|
|
2229
|
-
const i = S(t);
|
|
2230
|
-
for (const r of i) {
|
|
2231
|
-
const n = Number(e ? yield this.context._getFromScope(r, u(e), !1) : r);
|
|
2232
|
-
s += Number.isNaN(n) ? 0 : n;
|
|
2233
|
-
}
|
|
2234
|
-
return s;
|
|
2235
|
-
}
|
|
2236
|
-
function ar(t) {
|
|
2237
|
-
const e = S(t);
|
|
2238
|
-
return this.context.memoryLimit.use(e.length), e.filter((s) => !O(p(s)));
|
|
2239
|
-
}
|
|
2240
|
-
function qt(t, e = []) {
|
|
2241
|
-
const s = S(t), i = S(e);
|
|
2242
|
-
return this.context.memoryLimit.use(s.length + i.length), s.concat(i);
|
|
2243
|
-
}
|
|
2244
|
-
function lr(t, e) {
|
|
2245
|
-
return qt.call(this, t, [e]);
|
|
2246
|
-
}
|
|
2247
|
-
function hr(t, e) {
|
|
2248
|
-
const s = S(t);
|
|
2249
|
-
this.context.memoryLimit.use(s.length);
|
|
2250
|
-
const i = [...s];
|
|
2251
|
-
return i.unshift(e), i;
|
|
2252
|
-
}
|
|
2253
|
-
function cr(t) {
|
|
2254
|
-
const e = [...S(t)];
|
|
2255
|
-
return e.pop(), e;
|
|
2256
|
-
}
|
|
2257
|
-
function ur(t) {
|
|
2258
|
-
const e = S(t);
|
|
2259
|
-
this.context.memoryLimit.use(e.length);
|
|
2260
|
-
const s = [...e];
|
|
2261
|
-
return s.shift(), s;
|
|
2262
|
-
}
|
|
2263
|
-
function fr(t, e, s = 1) {
|
|
2264
|
-
return t = p(t), O(t) ? [] : (x(t) || (t = u(t)), e = e < 0 ? t.length + e : e, this.context.memoryLimit.use(s), t.slice(e, e + s));
|
|
2265
|
-
}
|
|
2266
|
-
function Ct(t) {
|
|
2267
|
-
return this.context.opts.jekyllWhere ? (e) => K.is(t) ? j(e, t) : x(e) ? Ys(e, t) : j(e, t) : t === void 0 ? (e) => B(e, this.context) : (e) => j(e, t);
|
|
2268
|
-
}
|
|
2269
|
-
function* Pt(t, e, s, i) {
|
|
2270
|
-
const r = [];
|
|
2271
|
-
e = S(e), this.context.memoryLimit.use(e.length);
|
|
2272
|
-
const n = new N(u(s)).readScopeValue();
|
|
2273
|
-
for (const a of e)
|
|
2274
|
-
r.push(yield T(n, this.context.spawn(a)));
|
|
2275
|
-
const o = Ct.call(this, i);
|
|
2276
|
-
return e.filter((a, l) => o(r[l]) === t);
|
|
2277
|
-
}
|
|
2278
|
-
function* It(t, e, s, i) {
|
|
2279
|
-
const r = [], n = new L(u(i), this.liquid), o = S(e);
|
|
2280
|
-
this.context.memoryLimit.use(o.length);
|
|
2281
|
-
for (const a of o) {
|
|
2282
|
-
this.context.push({ [s]: a });
|
|
2283
|
-
const l = yield n.value(this.context);
|
|
2284
|
-
this.context.pop(), l === t && r.push(a);
|
|
2285
|
-
}
|
|
2286
|
-
return r;
|
|
2287
|
-
}
|
|
2288
|
-
function* dr(t, e, s) {
|
|
2289
|
-
return yield* Pt.call(this, !0, t, e, s);
|
|
2290
|
-
}
|
|
2291
|
-
function* pr(t, e, s) {
|
|
2292
|
-
return yield* Pt.call(this, !1, t, e, s);
|
|
2293
|
-
}
|
|
2294
|
-
function* gr(t, e, s) {
|
|
2295
|
-
return yield* It.call(this, !0, t, e, s);
|
|
2296
|
-
}
|
|
2297
|
-
function* mr(t, e, s) {
|
|
2298
|
-
return yield* It.call(this, !1, t, e, s);
|
|
2299
|
-
}
|
|
2300
|
-
function* yr(t, e) {
|
|
2301
|
-
const s = /* @__PURE__ */ new Map();
|
|
2302
|
-
t = ie(t);
|
|
2303
|
-
const i = new N(u(e)).readScopeValue();
|
|
2304
|
-
this.context.memoryLimit.use(t.length);
|
|
2305
|
-
for (const r of t) {
|
|
2306
|
-
const n = yield T(i, this.context.spawn(r));
|
|
2307
|
-
s.has(n) || s.set(n, []), s.get(n).push(r);
|
|
2308
|
-
}
|
|
2309
|
-
return [...s.entries()].map(([r, n]) => ({ name: r, items: n }));
|
|
2310
|
-
}
|
|
2311
|
-
function* wr(t, e, s) {
|
|
2312
|
-
const i = /* @__PURE__ */ new Map(), r = new L(u(s), this.liquid);
|
|
2313
|
-
t = ie(t), this.context.memoryLimit.use(t.length);
|
|
2314
|
-
for (const n of t) {
|
|
2315
|
-
this.context.push({ [e]: n });
|
|
2316
|
-
const o = yield r.value(this.context);
|
|
2317
|
-
this.context.pop(), i.has(o) || i.set(o, []), i.get(o).push(n);
|
|
2318
|
-
}
|
|
2319
|
-
return [...i.entries()].map(([n, o]) => ({ name: n, items: o }));
|
|
2320
|
-
}
|
|
2321
|
-
function* Ne(t, e, s) {
|
|
2322
|
-
const i = new N(u(e)).readScopeValue(), r = S(t), n = Ct.call(this, s);
|
|
2323
|
-
for (let o = 0; o < r.length; o++) {
|
|
2324
|
-
const a = yield T(i, this.context.spawn(r[o]));
|
|
2325
|
-
if (n(a))
|
|
2326
|
-
return [o, r[o]];
|
|
2327
|
-
}
|
|
2328
|
-
}
|
|
2329
|
-
function* De(t, e, s) {
|
|
2330
|
-
const i = new L(u(s), this.liquid), r = S(t);
|
|
2331
|
-
for (let n = 0; n < r.length; n++) {
|
|
2332
|
-
this.context.push({ [e]: r[n] });
|
|
2333
|
-
const o = yield i.value(this.context);
|
|
2334
|
-
if (this.context.pop(), o)
|
|
2335
|
-
return [n, r[n]];
|
|
2336
|
-
}
|
|
2337
|
-
}
|
|
2338
|
-
function* br(t, e, s) {
|
|
2339
|
-
return !!(yield* Ne.call(this, t, e, s));
|
|
2340
|
-
}
|
|
2341
|
-
function* Tr(t, e, s) {
|
|
2342
|
-
return !!(yield* De.call(this, t, e, s));
|
|
2343
|
-
}
|
|
2344
|
-
function* kr(t, e, s) {
|
|
2345
|
-
const i = yield* Ne.call(this, t, e, s);
|
|
2346
|
-
return i ? i[0] : void 0;
|
|
2347
|
-
}
|
|
2348
|
-
function* vr(t, e, s) {
|
|
2349
|
-
const i = yield* De.call(this, t, e, s);
|
|
2350
|
-
return i ? i[0] : void 0;
|
|
2351
|
-
}
|
|
2352
|
-
function* Sr(t, e, s) {
|
|
2353
|
-
const i = yield* Ne.call(this, t, e, s);
|
|
2354
|
-
return i ? i[1] : void 0;
|
|
2355
|
-
}
|
|
2356
|
-
function* xr(t, e, s) {
|
|
2357
|
-
const i = yield* De.call(this, t, e, s);
|
|
2358
|
-
return i ? i[1] : void 0;
|
|
2359
|
-
}
|
|
2360
|
-
function _r(t) {
|
|
2361
|
-
return t = S(t), this.context.memoryLimit.use(t.length), [...new Set(t)];
|
|
2362
|
-
}
|
|
2363
|
-
function Fr(t, e = 1) {
|
|
2364
|
-
if (t = p(t), O(t))
|
|
2365
|
-
return [];
|
|
2366
|
-
x(t) || (t = u(t)), this.context.memoryLimit.use(e);
|
|
2367
|
-
const s = [...t].sort(() => Math.random() - 0.5);
|
|
2368
|
-
return e === 1 ? s[0] : s.slice(0, e);
|
|
2369
|
-
}
|
|
2370
|
-
var Lr = /* @__PURE__ */ Object.freeze({
|
|
2371
|
-
__proto__: null,
|
|
2372
|
-
join: Xi,
|
|
2373
|
-
last: Ki,
|
|
2374
|
-
first: er,
|
|
2375
|
-
reverse: tr,
|
|
2376
|
-
sort: sr,
|
|
2377
|
-
sort_natural: ir,
|
|
2378
|
-
size: rr,
|
|
2379
|
-
map: nr,
|
|
2380
|
-
sum: or,
|
|
2381
|
-
compact: ar,
|
|
2382
|
-
concat: qt,
|
|
2383
|
-
push: lr,
|
|
2384
|
-
unshift: hr,
|
|
2385
|
-
pop: cr,
|
|
2386
|
-
shift: ur,
|
|
2387
|
-
slice: fr,
|
|
2388
|
-
where: dr,
|
|
2389
|
-
reject: pr,
|
|
2390
|
-
where_exp: gr,
|
|
2391
|
-
reject_exp: mr,
|
|
2392
|
-
group_by: yr,
|
|
2393
|
-
group_by_exp: wr,
|
|
2394
|
-
has: br,
|
|
2395
|
-
has_exp: Tr,
|
|
2396
|
-
find_index: kr,
|
|
2397
|
-
find_index_exp: vr,
|
|
2398
|
-
find: Sr,
|
|
2399
|
-
find_exp: xr,
|
|
2400
|
-
uniq: _r,
|
|
2401
|
-
sample: Fr
|
|
2402
|
-
});
|
|
2403
|
-
function Me(t, e, s) {
|
|
2404
|
-
var i, r, n;
|
|
2405
|
-
const o = ((i = t == null ? void 0 : t.length) !== null && i !== void 0 ? i : 0) + ((r = e == null ? void 0 : e.length) !== null && r !== void 0 ? r : 0) + ((n = s == null ? void 0 : s.length) !== null && n !== void 0 ? n : 0);
|
|
2406
|
-
this.context.memoryLimit.use(o);
|
|
2407
|
-
const a = Bt(t, this.context.opts, s);
|
|
2408
|
-
return a ? (e = p(e), e = O(e) ? this.context.opts.dateFormat : u(e), oe(a, e)) : t;
|
|
2409
|
-
}
|
|
2410
|
-
function Or(t) {
|
|
2411
|
-
return Me.call(this, t, "%Y-%m-%dT%H:%M:%S%:z");
|
|
2412
|
-
}
|
|
2413
|
-
function zr(t) {
|
|
2414
|
-
return Me.call(this, t, "%a, %d %b %Y %H:%M:%S %z");
|
|
2415
|
-
}
|
|
2416
|
-
function Rr(t, e, s) {
|
|
2417
|
-
return $t.call(this, t, "%b", e, s);
|
|
2418
|
-
}
|
|
2419
|
-
function Er(t, e, s) {
|
|
2420
|
-
return $t.call(this, t, "%B", e, s);
|
|
2421
|
-
}
|
|
2422
|
-
function $t(t, e, s, i) {
|
|
2423
|
-
const r = Bt(t, this.context.opts);
|
|
2424
|
-
if (!r)
|
|
2425
|
-
return t;
|
|
2426
|
-
if (s === "ordinal") {
|
|
2427
|
-
const n = r.getDate();
|
|
2428
|
-
return i === "US" ? oe(r, `${e} ${n}%q, %Y`) : oe(r, `${n}%q ${e} %Y`);
|
|
2429
|
-
}
|
|
2430
|
-
return oe(r, `%d ${e} %Y`);
|
|
2431
|
-
}
|
|
2432
|
-
function Bt(t, e, s) {
|
|
2433
|
-
let i;
|
|
2434
|
-
const r = s ?? e.timezoneOffset, n = e.locale;
|
|
2435
|
-
return t = p(t), t === "now" || t === "today" ? i = new R(Date.now(), n, r) : de(t) ? i = new R(t * 1e3, n, r) : f(t) ? /^\d+$/.test(t) ? i = new R(+t * 1e3, n, r) : e.preserveTimezones && s === void 0 ? i = R.createDateFixedToTimezone(t, n) : i = new R(t, n, r) : i = new R(t, n, r), i.valid() ? i : void 0;
|
|
2436
|
-
}
|
|
2437
|
-
var Ar = /* @__PURE__ */ Object.freeze({
|
|
2438
|
-
__proto__: null,
|
|
2439
|
-
date: Me,
|
|
2440
|
-
date_to_xmlschema: Or,
|
|
2441
|
-
date_to_rfc822: zr,
|
|
2442
|
-
date_to_string: Rr,
|
|
2443
|
-
date_to_long_string: Er
|
|
2444
|
-
});
|
|
2445
|
-
const ke = /[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu, ut = /[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;
|
|
2446
|
-
function Nr(t, e) {
|
|
2447
|
-
_(arguments.length === 2, "append expect 2 arguments");
|
|
2448
|
-
const s = u(t), i = u(e);
|
|
2449
|
-
return this.context.memoryLimit.use(s.length + i.length), s + i;
|
|
2450
|
-
}
|
|
2451
|
-
function Dr(t, e) {
|
|
2452
|
-
_(arguments.length === 2, "prepend expect 2 arguments");
|
|
2453
|
-
const s = u(t), i = u(e);
|
|
2454
|
-
return this.context.memoryLimit.use(s.length + i.length), i + s;
|
|
2455
|
-
}
|
|
2456
|
-
function Mr(t, e) {
|
|
2457
|
-
const s = u(t);
|
|
2458
|
-
if (this.context.memoryLimit.use(s.length), e) {
|
|
2459
|
-
e = u(e), this.context.memoryLimit.use(e.length);
|
|
2460
|
-
for (let i = 0, r = new Set(e); i < s.length; i++)
|
|
2461
|
-
if (!r.has(s[i]))
|
|
2462
|
-
return s.slice(i);
|
|
2463
|
-
return "";
|
|
2464
|
-
}
|
|
2465
|
-
return s.trimStart();
|
|
2466
|
-
}
|
|
2467
|
-
function Vr(t) {
|
|
2468
|
-
const e = u(t);
|
|
2469
|
-
return this.context.memoryLimit.use(e.length), e.toLowerCase();
|
|
2470
|
-
}
|
|
2471
|
-
function jr(t) {
|
|
2472
|
-
const e = u(t);
|
|
2473
|
-
return this.context.memoryLimit.use(e.length), u(e).toUpperCase();
|
|
2474
|
-
}
|
|
2475
|
-
function qr(t, e) {
|
|
2476
|
-
const s = u(t);
|
|
2477
|
-
return e = u(e), this.context.memoryLimit.use(s.length + e.length), s.split(e).join("");
|
|
2478
|
-
}
|
|
2479
|
-
function Cr(t, e) {
|
|
2480
|
-
const s = u(t);
|
|
2481
|
-
return e = u(e), this.context.memoryLimit.use(s.length + e.length), s.replace(e, "");
|
|
2482
|
-
}
|
|
2483
|
-
function Pr(t, e) {
|
|
2484
|
-
const s = u(t), i = u(e);
|
|
2485
|
-
this.context.memoryLimit.use(s.length + i.length);
|
|
2486
|
-
const r = s.lastIndexOf(i);
|
|
2487
|
-
return r === -1 ? s : s.substring(0, r) + s.substring(r + i.length);
|
|
2488
|
-
}
|
|
2489
|
-
function Ir(t, e) {
|
|
2490
|
-
if (t = u(t), this.context.memoryLimit.use(t.length), e) {
|
|
2491
|
-
e = u(e), this.context.memoryLimit.use(e.length);
|
|
2492
|
-
for (let s = t.length - 1, i = new Set(e); s >= 0; s--)
|
|
2493
|
-
if (!i.has(t[s]))
|
|
2494
|
-
return t.slice(0, s + 1);
|
|
2495
|
-
return "";
|
|
2496
|
-
}
|
|
2497
|
-
return t.trimEnd();
|
|
2498
|
-
}
|
|
2499
|
-
function $r(t, e) {
|
|
2500
|
-
const s = u(t);
|
|
2501
|
-
this.context.memoryLimit.use(s.length);
|
|
2502
|
-
const i = s.split(u(e));
|
|
2503
|
-
for (; i.length && i[i.length - 1] === ""; )
|
|
2504
|
-
i.pop();
|
|
2505
|
-
return i;
|
|
2506
|
-
}
|
|
2507
|
-
function Br(t, e) {
|
|
2508
|
-
const s = u(t);
|
|
2509
|
-
if (this.context.memoryLimit.use(s.length), e) {
|
|
2510
|
-
const i = new Set(u(e));
|
|
2511
|
-
this.context.memoryLimit.use(i.size);
|
|
2512
|
-
let r = 0, n = s.length - 1;
|
|
2513
|
-
for (; i.has(s[r]); )
|
|
2514
|
-
r++;
|
|
2515
|
-
for (; n >= r && i.has(s[n]); )
|
|
2516
|
-
n--;
|
|
2517
|
-
return s.slice(r, n + 1);
|
|
2518
|
-
}
|
|
2519
|
-
return s.trim();
|
|
2520
|
-
}
|
|
2521
|
-
function Ur(t) {
|
|
2522
|
-
const e = u(t);
|
|
2523
|
-
return this.context.memoryLimit.use(e.length), e.replace(/\r?\n/gm, "");
|
|
2524
|
-
}
|
|
2525
|
-
function Hr(t) {
|
|
2526
|
-
return t = u(t), this.context.memoryLimit.use(t.length), t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
2527
|
-
}
|
|
2528
|
-
function Wr(t, e, s) {
|
|
2529
|
-
const i = u(t);
|
|
2530
|
-
return e = u(e), this.context.memoryLimit.use(i.length + e.length + s.length), i.split(e).join(s);
|
|
2531
|
-
}
|
|
2532
|
-
function Yr(t, e, s) {
|
|
2533
|
-
const i = u(t);
|
|
2534
|
-
return e = u(e), s = u(s), this.context.memoryLimit.use(i.length + e.length + s.length), i.replace(e, () => s);
|
|
2535
|
-
}
|
|
2536
|
-
function Jr(t, e, s) {
|
|
2537
|
-
const i = u(t), r = u(e), n = u(s);
|
|
2538
|
-
this.context.memoryLimit.use(i.length + r.length + n.length);
|
|
2539
|
-
const o = i.lastIndexOf(r);
|
|
2540
|
-
return o === -1 ? i : i.substring(0, o) + n + i.substring(o + r.length);
|
|
2541
|
-
}
|
|
2542
|
-
function Zr(t, e = 50, s = "...") {
|
|
2543
|
-
const i = u(t);
|
|
2544
|
-
return s = u(s), this.context.memoryLimit.use(i.length + s.length), i.length <= e ? t : i.substring(0, e - s.length) + s;
|
|
2545
|
-
}
|
|
2546
|
-
function Qr(t, e = 15, s = "...") {
|
|
2547
|
-
const i = u(t);
|
|
2548
|
-
s = u(s), this.context.memoryLimit.use(i.length + s.length);
|
|
2549
|
-
const r = i.split(/\s+/);
|
|
2550
|
-
e <= 0 && (e = 1);
|
|
2551
|
-
let n = r.slice(0, e).join(" ");
|
|
2552
|
-
return r.length >= e && (n += s), n;
|
|
2553
|
-
}
|
|
2554
|
-
function Gr(t) {
|
|
2555
|
-
const e = u(t);
|
|
2556
|
-
return this.context.memoryLimit.use(e.length), e.replace(/\s+/g, " ");
|
|
2557
|
-
}
|
|
2558
|
-
function Xr(t, e) {
|
|
2559
|
-
const s = u(t);
|
|
2560
|
-
if (this.context.memoryLimit.use(s.length), t = s.trim(), !t)
|
|
2561
|
-
return 0;
|
|
2562
|
-
switch (e) {
|
|
2563
|
-
case "cjk":
|
|
2564
|
-
return (t.match(ke) || []).length + (t.match(ut) || []).length;
|
|
2565
|
-
case "auto":
|
|
2566
|
-
return ke.test(t) ? t.match(ke).length + (t.match(ut) || []).length : t.split(/\s+/).length;
|
|
2567
|
-
default:
|
|
2568
|
-
return t.split(/\s+/).length;
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
function Kr(t, e = "and") {
|
|
2572
|
-
switch (e = u(e), this.context.memoryLimit.use(t.length + e.length), t.length) {
|
|
2573
|
-
case 0:
|
|
2574
|
-
return "";
|
|
2575
|
-
case 1:
|
|
2576
|
-
return t[0];
|
|
2577
|
-
case 2:
|
|
2578
|
-
return `${t[0]} ${e} ${t[1]}`;
|
|
2579
|
-
default:
|
|
2580
|
-
return `${t.slice(0, -1).join(", ")}, ${e} ${t[t.length - 1]}`;
|
|
2581
|
-
}
|
|
2582
|
-
}
|
|
2583
|
-
var en = /* @__PURE__ */ Object.freeze({
|
|
2584
|
-
__proto__: null,
|
|
2585
|
-
append: Nr,
|
|
2586
|
-
prepend: Dr,
|
|
2587
|
-
lstrip: Mr,
|
|
2588
|
-
downcase: Vr,
|
|
2589
|
-
upcase: jr,
|
|
2590
|
-
remove: qr,
|
|
2591
|
-
remove_first: Cr,
|
|
2592
|
-
remove_last: Pr,
|
|
2593
|
-
rstrip: Ir,
|
|
2594
|
-
split: $r,
|
|
2595
|
-
strip: Br,
|
|
2596
|
-
strip_newlines: Ur,
|
|
2597
|
-
capitalize: Hr,
|
|
2598
|
-
replace: Wr,
|
|
2599
|
-
replace_first: Yr,
|
|
2600
|
-
replace_last: Jr,
|
|
2601
|
-
truncate: Zr,
|
|
2602
|
-
truncatewords: Qr,
|
|
2603
|
-
normalize_whitespace: Gr,
|
|
2604
|
-
number_of_words: Xr,
|
|
2605
|
-
array_to_sentence_string: Kr
|
|
2606
|
-
});
|
|
2607
|
-
function tn(t) {
|
|
2608
|
-
return btoa(String.fromCharCode(...new TextEncoder().encode(t)));
|
|
2609
|
-
}
|
|
2610
|
-
function sn(t) {
|
|
2611
|
-
return new TextDecoder().decode(Uint8Array.from(atob(t), (e) => e.charCodeAt(0)));
|
|
2612
|
-
}
|
|
2613
|
-
function rn(t) {
|
|
2614
|
-
const e = u(t);
|
|
2615
|
-
return this.context.memoryLimit.use(e.length), tn(e);
|
|
2616
|
-
}
|
|
2617
|
-
function nn(t) {
|
|
2618
|
-
const e = u(t);
|
|
2619
|
-
return this.context.memoryLimit.use(e.length), sn(e);
|
|
2620
|
-
}
|
|
2621
|
-
var on = /* @__PURE__ */ Object.freeze({
|
|
2622
|
-
__proto__: null,
|
|
2623
|
-
base64_encode: rn,
|
|
2624
|
-
base64_decode: nn
|
|
2625
|
-
});
|
|
2626
|
-
const an = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, di), Bi), Gi), Lr), Ar), en), on), Et);
|
|
2627
|
-
class ln extends b {
|
|
2628
|
-
constructor(e, s, i) {
|
|
2629
|
-
super(e, s, i), this.identifier = this.tokenizer.readIdentifier(), this.key = this.identifier.content, this.tokenizer.assert(this.key, "expected variable name"), this.tokenizer.skipBlank(), this.tokenizer.assert(this.tokenizer.peek() === "=", 'expected "="'), this.tokenizer.advance(), this.value = new L(this.tokenizer.readFilteredValue(), this.liquid);
|
|
2630
|
-
}
|
|
2631
|
-
*render(e) {
|
|
2632
|
-
e.bottom()[this.key] = yield this.value.value(e, this.liquid.options.lenientIf);
|
|
2633
|
-
}
|
|
2634
|
-
*arguments() {
|
|
2635
|
-
yield this.value;
|
|
2636
|
-
}
|
|
2637
|
-
*localScope() {
|
|
2638
|
-
yield this.identifier;
|
|
2639
|
-
}
|
|
2640
|
-
}
|
|
2641
|
-
const ft = ["offset", "limit", "reversed"];
|
|
2642
|
-
class hn extends b {
|
|
2643
|
-
constructor(e, s, i, r) {
|
|
2644
|
-
super(e, s, i);
|
|
2645
|
-
const n = this.tokenizer.readIdentifier(), o = this.tokenizer.readIdentifier(), a = this.tokenizer.readValue();
|
|
2646
|
-
if (!n.size() || o.content !== "in" || !a)
|
|
2647
|
-
throw new Error(`illegal tag: ${e.getText()}`);
|
|
2648
|
-
this.variable = n.content, this.collection = a, this.hash = new ee(this.tokenizer, i.options.keyValueSeparator), this.templates = [], this.elseTemplates = [];
|
|
2649
|
-
let l;
|
|
2650
|
-
const c = r.parseStream(s).on("start", () => l = this.templates).on("tag:else", (h) => {
|
|
2651
|
-
he(h.args), l = this.elseTemplates;
|
|
2652
|
-
}).on("tag:endfor", (h) => {
|
|
2653
|
-
he(h.args), c.stop();
|
|
2654
|
-
}).on("template", (h) => l.push(h)).on("end", () => {
|
|
2655
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
2656
|
-
});
|
|
2657
|
-
c.start();
|
|
2658
|
-
}
|
|
2659
|
-
*render(e, s) {
|
|
2660
|
-
const i = this.liquid.renderer;
|
|
2661
|
-
let r = ie(yield T(this.collection, e));
|
|
2662
|
-
if (!r.length) {
|
|
2663
|
-
yield i.renderTemplates(this.elseTemplates, e, s);
|
|
2664
|
-
return;
|
|
2665
|
-
}
|
|
2666
|
-
const n = "continue-" + this.variable + "-" + this.collection.getText();
|
|
2667
|
-
e.push({ continue: e.getRegister(n) });
|
|
2668
|
-
const o = yield this.hash.render(e);
|
|
2669
|
-
e.pop(), r = (this.liquid.options.orderedFilterParameters ? Object.keys(o).filter((c) => ft.includes(c)) : ft.filter((c) => o[c] !== void 0)).reduce((c, h) => h === "offset" ? un(c, o.offset) : h === "limit" ? fn(c, o.limit) : cn(c), r), e.setRegister(n, (o.offset || 0) + r.length);
|
|
2670
|
-
const l = { forloop: new ze(r.length, this.collection.getText(), this.variable) };
|
|
2671
|
-
e.push(l);
|
|
2672
|
-
for (const c of r) {
|
|
2673
|
-
if (l[this.variable] = c, e.continueCalled = e.breakCalled = !1, yield i.renderTemplates(this.templates, e, s), e.breakCalled)
|
|
2674
|
-
break;
|
|
2675
|
-
l.forloop.next();
|
|
2676
|
-
}
|
|
2677
|
-
e.continueCalled = e.breakCalled = !1, e.pop();
|
|
2678
|
-
}
|
|
2679
|
-
*children() {
|
|
2680
|
-
const e = this.templates.slice();
|
|
2681
|
-
return this.elseTemplates && e.push(...this.elseTemplates), e;
|
|
2682
|
-
}
|
|
2683
|
-
*arguments() {
|
|
2684
|
-
yield this.collection;
|
|
2685
|
-
for (const e of Object.values(this.hash.hash))
|
|
2686
|
-
F(e) && (yield e);
|
|
2687
|
-
}
|
|
2688
|
-
blockScope() {
|
|
2689
|
-
return [this.variable, "forloop"];
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
function cn(t) {
|
|
2693
|
-
return [...t].reverse();
|
|
2694
|
-
}
|
|
2695
|
-
function un(t, e) {
|
|
2696
|
-
return t.slice(e);
|
|
2697
|
-
}
|
|
2698
|
-
function fn(t, e) {
|
|
2699
|
-
return t.slice(0, e);
|
|
2700
|
-
}
|
|
2701
|
-
class dn extends b {
|
|
2702
|
-
constructor(e, s, i, r) {
|
|
2703
|
-
for (super(e, s, i), this.templates = [], this.identifier = this.readVariable(), this.variable = this.identifier.content; s.length; ) {
|
|
2704
|
-
const n = s.shift();
|
|
2705
|
-
if (Z(n) && n.name === "endcapture")
|
|
2706
|
-
return;
|
|
2707
|
-
this.templates.push(r.parseToken(n, s));
|
|
2708
|
-
}
|
|
2709
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
2710
|
-
}
|
|
2711
|
-
readVariable() {
|
|
2712
|
-
let e = this.tokenizer.readIdentifier();
|
|
2713
|
-
if (e.content || (e = this.tokenizer.readQuoted(), e))
|
|
2714
|
-
return e;
|
|
2715
|
-
throw this.tokenizer.error("invalid capture name");
|
|
2716
|
-
}
|
|
2717
|
-
*render(e) {
|
|
2718
|
-
const i = yield this.liquid.renderer.renderTemplates(this.templates, e);
|
|
2719
|
-
e.bottom()[this.variable] = i;
|
|
2720
|
-
}
|
|
2721
|
-
*children() {
|
|
2722
|
-
return this.templates;
|
|
2723
|
-
}
|
|
2724
|
-
*localScope() {
|
|
2725
|
-
yield this.identifier;
|
|
2726
|
-
}
|
|
2727
|
-
}
|
|
2728
|
-
class pn extends b {
|
|
2729
|
-
constructor(e, s, i, r) {
|
|
2730
|
-
super(e, s, i), this.branches = [], this.elseTemplates = [], this.value = new L(this.tokenizer.readFilteredValue(), this.liquid), this.elseTemplates = [];
|
|
2731
|
-
let n = [], o = 0;
|
|
2732
|
-
const a = r.parseStream(s).on("tag:when", (l) => {
|
|
2733
|
-
if (o > 0)
|
|
2734
|
-
return;
|
|
2735
|
-
n = [];
|
|
2736
|
-
const c = [];
|
|
2737
|
-
for (; !l.tokenizer.end(); )
|
|
2738
|
-
c.push(l.tokenizer.readValueOrThrow()), l.tokenizer.skipBlank(), l.tokenizer.peek() === "," ? l.tokenizer.readTo(",") : l.tokenizer.readTo("or");
|
|
2739
|
-
this.branches.push({
|
|
2740
|
-
values: c,
|
|
2741
|
-
templates: n
|
|
2742
|
-
});
|
|
2743
|
-
}).on("tag:else", () => {
|
|
2744
|
-
o++, n = this.elseTemplates;
|
|
2745
|
-
}).on("tag:endcase", () => a.stop()).on("template", (l) => {
|
|
2746
|
-
(n !== this.elseTemplates || o === 1) && n.push(l);
|
|
2747
|
-
}).on("end", () => {
|
|
2748
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
2749
|
-
});
|
|
2750
|
-
a.start();
|
|
2751
|
-
}
|
|
2752
|
-
*render(e, s) {
|
|
2753
|
-
const i = this.liquid.renderer, r = p(yield this.value.value(e, e.opts.lenientIf));
|
|
2754
|
-
let n = !1;
|
|
2755
|
-
for (const o of this.branches)
|
|
2756
|
-
for (const a of o.values) {
|
|
2757
|
-
const l = yield T(a, e, e.opts.lenientIf);
|
|
2758
|
-
if (j(r, l)) {
|
|
2759
|
-
yield i.renderTemplates(o.templates, e, s), n = !0;
|
|
2760
|
-
break;
|
|
2761
|
-
}
|
|
2762
|
-
}
|
|
2763
|
-
n || (yield i.renderTemplates(this.elseTemplates, e, s));
|
|
2764
|
-
}
|
|
2765
|
-
*arguments() {
|
|
2766
|
-
yield this.value, yield* this.branches.flatMap((e) => e.values);
|
|
2767
|
-
}
|
|
2768
|
-
*children() {
|
|
2769
|
-
const e = this.branches.flatMap((s) => s.templates);
|
|
2770
|
-
return this.elseTemplates && e.push(...this.elseTemplates), e;
|
|
2771
|
-
}
|
|
2772
|
-
}
|
|
2773
|
-
class gn extends b {
|
|
2774
|
-
constructor(e, s, i) {
|
|
2775
|
-
for (super(e, s, i); s.length; ) {
|
|
2776
|
-
const r = s.shift();
|
|
2777
|
-
if (Z(r) && r.name === "endcomment")
|
|
2778
|
-
return;
|
|
2779
|
-
}
|
|
2780
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
2781
|
-
}
|
|
2782
|
-
render() {
|
|
2783
|
-
}
|
|
2784
|
-
}
|
|
2785
|
-
class mn extends b {
|
|
2786
|
-
constructor(e, s, i, r) {
|
|
2787
|
-
super(e, s, i);
|
|
2788
|
-
const n = this.tokenizer;
|
|
2789
|
-
for (this.file = Ve(n, this.liquid, r), this.currentFile = e.file; !n.end(); ) {
|
|
2790
|
-
n.skipBlank();
|
|
2791
|
-
const o = n.p, a = n.readIdentifier();
|
|
2792
|
-
if ((a.content === "with" || a.content === "for") && (n.skipBlank(), n.peek() !== ":")) {
|
|
2793
|
-
const l = n.readValue();
|
|
2794
|
-
if (l) {
|
|
2795
|
-
const c = n.p, h = n.readIdentifier();
|
|
2796
|
-
let d;
|
|
2797
|
-
h.content === "as" ? d = n.readIdentifier() : n.p = c, this[a.content] = { value: l, alias: d && d.content }, n.skipBlank(), n.peek() === "," && n.advance();
|
|
2798
|
-
continue;
|
|
2799
|
-
}
|
|
2800
|
-
}
|
|
2801
|
-
n.p = o;
|
|
2802
|
-
break;
|
|
2803
|
-
}
|
|
2804
|
-
this.hash = new ee(n, i.options.keyValueSeparator);
|
|
2805
|
-
}
|
|
2806
|
-
*render(e, s) {
|
|
2807
|
-
const { liquid: i, hash: r } = this, n = yield je(this.file, e, i);
|
|
2808
|
-
_(n, () => `illegal file path "${n}"`);
|
|
2809
|
-
const o = e.spawn(), a = o.bottom();
|
|
2810
|
-
if (ce(a, yield r.render(e)), this.with) {
|
|
2811
|
-
const { value: l, alias: c } = this.with;
|
|
2812
|
-
a[c || n] = yield T(l, e);
|
|
2813
|
-
}
|
|
2814
|
-
if (this.for) {
|
|
2815
|
-
const { value: l, alias: c } = this.for, h = ie(yield T(l, e));
|
|
2816
|
-
a.forloop = new ze(h.length, l.getText(), c);
|
|
2817
|
-
for (const d of h) {
|
|
2818
|
-
a[c] = d;
|
|
2819
|
-
const g = yield i._parsePartialFile(n, o.sync, this.currentFile);
|
|
2820
|
-
yield i.renderer.renderTemplates(g, o, s), a.forloop.next();
|
|
2821
|
-
}
|
|
2822
|
-
} else {
|
|
2823
|
-
const l = yield i._parsePartialFile(n, o.sync, this.currentFile);
|
|
2824
|
-
yield i.renderer.renderTemplates(l, o, s);
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
*children(e, s) {
|
|
2828
|
-
return e && f(this.file) ? yield this.liquid._parsePartialFile(this.file, s, this.currentFile) : [];
|
|
2829
|
-
}
|
|
2830
|
-
partialScope() {
|
|
2831
|
-
if (f(this.file)) {
|
|
2832
|
-
const e = Object.keys(this.hash.hash);
|
|
2833
|
-
if (this.with) {
|
|
2834
|
-
const { value: s, alias: i } = this.with;
|
|
2835
|
-
f(i) ? e.push([i, s]) : f(this.file) && e.push([this.file, s]);
|
|
2836
|
-
}
|
|
2837
|
-
if (this.for) {
|
|
2838
|
-
const { value: s, alias: i } = this.for;
|
|
2839
|
-
f(i) ? e.push([i, s]) : f(this.file) && e.push([this.file, s]);
|
|
2840
|
-
}
|
|
2841
|
-
return { name: this.file, isolated: !0, scope: e };
|
|
2842
|
-
}
|
|
2843
|
-
}
|
|
2844
|
-
*arguments() {
|
|
2845
|
-
for (const e of Object.values(this.hash.hash))
|
|
2846
|
-
F(e) && (yield e);
|
|
2847
|
-
if (this.with) {
|
|
2848
|
-
const { value: e } = this.with;
|
|
2849
|
-
F(e) && (yield e);
|
|
2850
|
-
}
|
|
2851
|
-
if (this.for) {
|
|
2852
|
-
const { value: e } = this.for;
|
|
2853
|
-
F(e) && (yield e);
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
}
|
|
2857
|
-
function Ve(t, e, s) {
|
|
2858
|
-
if (e.options.dynamicPartials) {
|
|
2859
|
-
const n = t.readValue();
|
|
2860
|
-
if (t.assert(n, "illegal file path"), n.getText() === "none")
|
|
2861
|
-
return;
|
|
2862
|
-
if (Fe(n)) {
|
|
2863
|
-
const o = s.parse($s(n));
|
|
2864
|
-
return dt(o);
|
|
2865
|
-
}
|
|
2866
|
-
return n;
|
|
2867
|
-
}
|
|
2868
|
-
const i = [...t.readFileNameTemplate(e.options)], r = dt(s.parseTokens(i));
|
|
2869
|
-
return r === "none" ? void 0 : r;
|
|
2870
|
-
}
|
|
2871
|
-
function dt(t) {
|
|
2872
|
-
return t.length === 1 && Ae(t[0].token) ? t[0].token.getContent() : t;
|
|
2873
|
-
}
|
|
2874
|
-
function* je(t, e, s) {
|
|
2875
|
-
return typeof t == "string" ? t : Array.isArray(t) ? s.renderer.renderTemplates(t, e) : yield T(t, e);
|
|
2876
|
-
}
|
|
2877
|
-
class yn extends b {
|
|
2878
|
-
constructor(e, s, i, r) {
|
|
2879
|
-
super(e, s, i);
|
|
2880
|
-
const { tokenizer: n } = e;
|
|
2881
|
-
this.file = Ve(n, this.liquid, r), this.currentFile = e.file;
|
|
2882
|
-
const o = n.p;
|
|
2883
|
-
n.readIdentifier().content === "with" ? (n.skipBlank(), n.peek() !== ":" ? this.withVar = n.readValue() : n.p = o) : n.p = o, this.hash = new ee(n, i.options.jekyllInclude || i.options.keyValueSeparator);
|
|
2884
|
-
}
|
|
2885
|
-
*render(e, s) {
|
|
2886
|
-
const { liquid: i, hash: r, withVar: n } = this, { renderer: o } = i, a = yield je(this.file, e, i);
|
|
2887
|
-
_(a, () => `illegal file path "${a}"`);
|
|
2888
|
-
const l = e.saveRegister("blocks", "blockMode");
|
|
2889
|
-
e.setRegister("blocks", {}), e.setRegister("blockMode", U.OUTPUT);
|
|
2890
|
-
const c = yield r.render(e);
|
|
2891
|
-
n && (c[a] = yield T(n, e));
|
|
2892
|
-
const h = yield i._parsePartialFile(a, e.sync, this.currentFile);
|
|
2893
|
-
e.push(e.opts.jekyllInclude ? { include: c } : c), yield o.renderTemplates(h, e, s), e.pop(), e.restoreRegister(l);
|
|
2894
|
-
}
|
|
2895
|
-
*children(e, s) {
|
|
2896
|
-
return e && f(this.file) ? yield this.liquid._parsePartialFile(this.file, s, this.currentFile) : [];
|
|
2897
|
-
}
|
|
2898
|
-
partialScope() {
|
|
2899
|
-
if (f(this.file)) {
|
|
2900
|
-
let e;
|
|
2901
|
-
return this.liquid.options.jekyllInclude ? e = ["include"] : (e = Object.keys(this.hash.hash), this.withVar && e.push([this.file, this.withVar])), { name: this.file, isolated: !1, scope: e };
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2904
|
-
*arguments() {
|
|
2905
|
-
yield* Object.values(this.hash.hash).filter(F), F(this.file) && (yield this.file), F(this.withVar) && (yield this.withVar);
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
class wn extends b {
|
|
2909
|
-
constructor(e, s, i) {
|
|
2910
|
-
super(e, s, i), this.identifier = this.tokenizer.readIdentifier(), this.variable = this.identifier.content;
|
|
2911
|
-
}
|
|
2912
|
-
render(e, s) {
|
|
2913
|
-
const i = e.environments;
|
|
2914
|
-
de(i[this.variable]) || (i[this.variable] = 0), s.write(u(--i[this.variable]));
|
|
2915
|
-
}
|
|
2916
|
-
*localScope() {
|
|
2917
|
-
yield this.identifier;
|
|
2918
|
-
}
|
|
2919
|
-
}
|
|
2920
|
-
class bn extends b {
|
|
2921
|
-
constructor(e, s, i) {
|
|
2922
|
-
super(e, s, i), this.candidates = [];
|
|
2923
|
-
const r = this.tokenizer.readValue();
|
|
2924
|
-
for (this.tokenizer.skipBlank(), r && (this.tokenizer.peek() === ":" ? (this.group = r, this.tokenizer.advance()) : this.candidates.push(r)); !this.tokenizer.end(); ) {
|
|
2925
|
-
const n = this.tokenizer.readValue();
|
|
2926
|
-
n && this.candidates.push(n), this.tokenizer.readTo(",");
|
|
2927
|
-
}
|
|
2928
|
-
this.tokenizer.assert(this.candidates.length, () => `empty candidates: "${e.getText()}"`);
|
|
2929
|
-
}
|
|
2930
|
-
*render(e, s) {
|
|
2931
|
-
const r = `cycle:${yield T(this.group, e)}:` + this.candidates.join(","), n = e.getRegister("cycle");
|
|
2932
|
-
let o = n[r];
|
|
2933
|
-
o === void 0 && (o = n[r] = 0);
|
|
2934
|
-
const a = this.candidates[o];
|
|
2935
|
-
return o = (o + 1) % this.candidates.length, n[r] = o, yield T(a, e);
|
|
2936
|
-
}
|
|
2937
|
-
*arguments() {
|
|
2938
|
-
yield* this.candidates, this.group && (yield this.group);
|
|
2939
|
-
}
|
|
2940
|
-
}
|
|
2941
|
-
class Tn extends b {
|
|
2942
|
-
constructor(e, s, i, r) {
|
|
2943
|
-
super(e, s, i), this.branches = [];
|
|
2944
|
-
let n = [];
|
|
2945
|
-
r.parseStream(s).on("start", () => this.branches.push({
|
|
2946
|
-
value: new L(e.tokenizer.readFilteredValue(), this.liquid),
|
|
2947
|
-
templates: n = []
|
|
2948
|
-
})).on("tag:elsif", (o) => {
|
|
2949
|
-
_(!this.elseTemplates, "unexpected elsif after else"), this.branches.push({
|
|
2950
|
-
value: new L(o.tokenizer.readFilteredValue(), this.liquid),
|
|
2951
|
-
templates: n = []
|
|
2952
|
-
});
|
|
2953
|
-
}).on("tag:else", (o) => {
|
|
2954
|
-
he(o.args), _(!this.elseTemplates, "duplicated else"), n = this.elseTemplates = [];
|
|
2955
|
-
}).on("tag:endif", function(o) {
|
|
2956
|
-
he(o.args), this.stop();
|
|
2957
|
-
}).on("template", (o) => n.push(o)).on("end", () => {
|
|
2958
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
2959
|
-
}).start();
|
|
2960
|
-
}
|
|
2961
|
-
*render(e, s) {
|
|
2962
|
-
const i = this.liquid.renderer;
|
|
2963
|
-
for (const { value: r, templates: n } of this.branches) {
|
|
2964
|
-
const o = yield r.value(e, e.opts.lenientIf);
|
|
2965
|
-
if (B(o, e)) {
|
|
2966
|
-
yield i.renderTemplates(n, e, s);
|
|
2967
|
-
return;
|
|
2968
|
-
}
|
|
2969
|
-
}
|
|
2970
|
-
yield i.renderTemplates(this.elseTemplates || [], e, s);
|
|
2971
|
-
}
|
|
2972
|
-
*children() {
|
|
2973
|
-
const e = this.branches.flatMap((s) => s.templates);
|
|
2974
|
-
return this.elseTemplates && e.push(...this.elseTemplates), e;
|
|
2975
|
-
}
|
|
2976
|
-
arguments() {
|
|
2977
|
-
return this.branches.map((e) => e.value);
|
|
2978
|
-
}
|
|
2979
|
-
}
|
|
2980
|
-
class kn extends b {
|
|
2981
|
-
constructor(e, s, i) {
|
|
2982
|
-
super(e, s, i), this.identifier = this.tokenizer.readIdentifier(), this.variable = this.identifier.content;
|
|
2983
|
-
}
|
|
2984
|
-
render(e, s) {
|
|
2985
|
-
const i = e.environments;
|
|
2986
|
-
de(i[this.variable]) || (i[this.variable] = 0);
|
|
2987
|
-
const r = i[this.variable];
|
|
2988
|
-
i[this.variable]++, s.write(u(r));
|
|
2989
|
-
}
|
|
2990
|
-
*localScope() {
|
|
2991
|
-
yield this.identifier;
|
|
2992
|
-
}
|
|
2993
|
-
}
|
|
2994
|
-
class vn extends b {
|
|
2995
|
-
constructor(e, s, i, r) {
|
|
2996
|
-
super(e, s, i), this.file = Ve(this.tokenizer, this.liquid, r), this.currentFile = e.file, this.args = new ee(this.tokenizer, i.options.keyValueSeparator), this.templates = r.parseTokens(s);
|
|
2997
|
-
}
|
|
2998
|
-
*render(e, s) {
|
|
2999
|
-
const { liquid: i, args: r, file: n } = this, { renderer: o } = i;
|
|
3000
|
-
if (n === void 0) {
|
|
3001
|
-
e.setRegister("blockMode", U.OUTPUT), yield o.renderTemplates(this.templates, e, s);
|
|
3002
|
-
return;
|
|
3003
|
-
}
|
|
3004
|
-
const a = yield je(this.file, e, i);
|
|
3005
|
-
_(a, () => `illegal file path "${a}"`);
|
|
3006
|
-
const l = yield i._parseLayoutFile(a, e.sync, this.currentFile);
|
|
3007
|
-
e.setRegister("blockMode", U.STORE);
|
|
3008
|
-
const c = yield o.renderTemplates(this.templates, e), h = e.getRegister("blocks");
|
|
3009
|
-
h[""] === void 0 && (h[""] = (d, g) => g.write(c)), e.setRegister("blockMode", U.OUTPUT), e.push(yield r.render(e)), yield o.renderTemplates(l, e, s), e.pop();
|
|
3010
|
-
}
|
|
3011
|
-
*children(e) {
|
|
3012
|
-
const s = this.templates.slice();
|
|
3013
|
-
return e && f(this.file) && s.push(...yield this.liquid._parsePartialFile(this.file, !0, this.currentFile)), s;
|
|
3014
|
-
}
|
|
3015
|
-
*arguments() {
|
|
3016
|
-
for (const e of Object.values(this.args.hash))
|
|
3017
|
-
F(e) && (yield e);
|
|
3018
|
-
F(this.file) && (yield this.file);
|
|
3019
|
-
}
|
|
3020
|
-
partialScope() {
|
|
3021
|
-
if (f(this.file))
|
|
3022
|
-
return { name: this.file, isolated: !1, scope: Object.keys(this.args.hash) };
|
|
3023
|
-
}
|
|
3024
|
-
}
|
|
3025
|
-
class Sn extends b {
|
|
3026
|
-
constructor(e, s, i, r) {
|
|
3027
|
-
super(e, s, i), this.templates = [];
|
|
3028
|
-
const n = /\w+/.exec(e.args);
|
|
3029
|
-
for (this.block = n ? n[0] : ""; s.length; ) {
|
|
3030
|
-
const o = s.shift();
|
|
3031
|
-
if (Z(o) && o.name === "endblock")
|
|
3032
|
-
return;
|
|
3033
|
-
const a = r.parseToken(o, s);
|
|
3034
|
-
this.templates.push(a);
|
|
3035
|
-
}
|
|
3036
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
3037
|
-
}
|
|
3038
|
-
*render(e, s) {
|
|
3039
|
-
const i = this.getBlockRender(e);
|
|
3040
|
-
e.getRegister("blockMode") === U.STORE ? e.getRegister("blocks")[this.block] = i : yield i(new He(), s);
|
|
3041
|
-
}
|
|
3042
|
-
getBlockRender(e) {
|
|
3043
|
-
const { liquid: s, templates: i } = this, r = e.getRegister("blocks")[this.block], n = function* (o, a) {
|
|
3044
|
-
e.push({ block: o }), yield s.renderer.renderTemplates(i, e, a), e.pop();
|
|
3045
|
-
};
|
|
3046
|
-
return r ? (o, a) => r(new He((l) => n(o, l)), a) : n;
|
|
3047
|
-
}
|
|
3048
|
-
*children() {
|
|
3049
|
-
return this.templates;
|
|
3050
|
-
}
|
|
3051
|
-
blockScope() {
|
|
3052
|
-
return ["block"];
|
|
3053
|
-
}
|
|
3054
|
-
}
|
|
3055
|
-
class xn extends b {
|
|
3056
|
-
constructor(e, s, i) {
|
|
3057
|
-
for (super(e, s, i), this.tokens = []; s.length; ) {
|
|
3058
|
-
const r = s.shift();
|
|
3059
|
-
if (Z(r) && r.name === "endraw")
|
|
3060
|
-
return;
|
|
3061
|
-
this.tokens.push(r);
|
|
3062
|
-
}
|
|
3063
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
3064
|
-
}
|
|
3065
|
-
render() {
|
|
3066
|
-
return this.tokens.map((e) => e.getText()).join("");
|
|
3067
|
-
}
|
|
3068
|
-
}
|
|
3069
|
-
class _n extends ze {
|
|
3070
|
-
constructor(e, s, i, r) {
|
|
3071
|
-
super(e, i, r), this.length = e, this.cols = s;
|
|
3072
|
-
}
|
|
3073
|
-
row() {
|
|
3074
|
-
return Math.floor(this.i / this.cols) + 1;
|
|
3075
|
-
}
|
|
3076
|
-
col0() {
|
|
3077
|
-
return this.i % this.cols;
|
|
3078
|
-
}
|
|
3079
|
-
col() {
|
|
3080
|
-
return this.col0() + 1;
|
|
3081
|
-
}
|
|
3082
|
-
col_first() {
|
|
3083
|
-
return this.col0() === 0;
|
|
3084
|
-
}
|
|
3085
|
-
col_last() {
|
|
3086
|
-
return this.col() === this.cols;
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3089
|
-
class Fn extends b {
|
|
3090
|
-
constructor(e, s, i, r) {
|
|
3091
|
-
super(e, s, i);
|
|
3092
|
-
const n = this.tokenizer.readIdentifier();
|
|
3093
|
-
this.tokenizer.skipBlank();
|
|
3094
|
-
const o = this.tokenizer.readIdentifier(), a = this.tokenizer.readValue();
|
|
3095
|
-
if (o.content !== "in" || !a)
|
|
3096
|
-
throw new Error(`illegal tag: ${e.getText()}`);
|
|
3097
|
-
this.variable = n.content, this.collection = a, this.args = new ee(this.tokenizer, i.options.keyValueSeparator), this.templates = [];
|
|
3098
|
-
let l;
|
|
3099
|
-
const c = r.parseStream(s).on("start", () => l = this.templates).on("tag:endtablerow", () => c.stop()).on("template", (h) => l.push(h)).on("end", () => {
|
|
3100
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
3101
|
-
});
|
|
3102
|
-
c.start();
|
|
3103
|
-
}
|
|
3104
|
-
*render(e, s) {
|
|
3105
|
-
let i = ie(yield T(this.collection, e));
|
|
3106
|
-
const r = yield this.args.render(e), n = r.offset || 0, o = r.limit === void 0 ? i.length : r.limit;
|
|
3107
|
-
i = i.slice(n, n + o);
|
|
3108
|
-
const a = r.cols || i.length, l = this.liquid.renderer, c = new _n(i.length, a, this.collection.getText(), this.variable), h = { tablerowloop: c };
|
|
3109
|
-
e.push(h);
|
|
3110
|
-
for (let d = 0; d < i.length; d++, c.next())
|
|
3111
|
-
h[this.variable] = i[d], c.col0() === 0 && (c.row() !== 1 && s.write("</tr>"), s.write(`<tr class="row${c.row()}">`)), s.write(`<td class="col${c.col()}">`), yield l.renderTemplates(this.templates, e, s), s.write("</td>");
|
|
3112
|
-
i.length && s.write("</tr>"), e.pop();
|
|
3113
|
-
}
|
|
3114
|
-
*children() {
|
|
3115
|
-
return this.templates;
|
|
3116
|
-
}
|
|
3117
|
-
*arguments() {
|
|
3118
|
-
yield this.collection;
|
|
3119
|
-
for (const e of Object.values(this.args.hash))
|
|
3120
|
-
F(e) && (yield e);
|
|
3121
|
-
}
|
|
3122
|
-
blockScope() {
|
|
3123
|
-
return [this.variable, "tablerowloop"];
|
|
3124
|
-
}
|
|
3125
|
-
}
|
|
3126
|
-
class Ln extends b {
|
|
3127
|
-
constructor(e, s, i, r) {
|
|
3128
|
-
super(e, s, i), this.branches = [], this.elseTemplates = [];
|
|
3129
|
-
let n = [], o = 0;
|
|
3130
|
-
r.parseStream(s).on("start", () => this.branches.push({
|
|
3131
|
-
value: new L(e.tokenizer.readFilteredValue(), this.liquid),
|
|
3132
|
-
test: me,
|
|
3133
|
-
templates: n = []
|
|
3134
|
-
})).on("tag:elsif", (a) => {
|
|
3135
|
-
if (o > 0) {
|
|
3136
|
-
n = [];
|
|
3137
|
-
return;
|
|
3138
|
-
}
|
|
3139
|
-
this.branches.push({
|
|
3140
|
-
value: new L(a.tokenizer.readFilteredValue(), this.liquid),
|
|
3141
|
-
test: B,
|
|
3142
|
-
templates: n = []
|
|
3143
|
-
});
|
|
3144
|
-
}).on("tag:else", () => {
|
|
3145
|
-
o++, n = this.elseTemplates;
|
|
3146
|
-
}).on("tag:endunless", function() {
|
|
3147
|
-
this.stop();
|
|
3148
|
-
}).on("template", (a) => {
|
|
3149
|
-
(n !== this.elseTemplates || o === 1) && n.push(a);
|
|
3150
|
-
}).on("end", () => {
|
|
3151
|
-
throw new Error(`tag ${e.getText()} not closed`);
|
|
3152
|
-
}).start();
|
|
3153
|
-
}
|
|
3154
|
-
*render(e, s) {
|
|
3155
|
-
const i = this.liquid.renderer;
|
|
3156
|
-
for (const { value: r, test: n, templates: o } of this.branches) {
|
|
3157
|
-
const a = yield r.value(e, e.opts.lenientIf);
|
|
3158
|
-
if (n(a, e)) {
|
|
3159
|
-
yield i.renderTemplates(o, e, s);
|
|
3160
|
-
return;
|
|
3161
|
-
}
|
|
3162
|
-
}
|
|
3163
|
-
yield i.renderTemplates(this.elseTemplates, e, s);
|
|
3164
|
-
}
|
|
3165
|
-
*children() {
|
|
3166
|
-
const e = this.branches.flatMap((s) => s.templates);
|
|
3167
|
-
return this.elseTemplates && e.push(...this.elseTemplates), e;
|
|
3168
|
-
}
|
|
3169
|
-
arguments() {
|
|
3170
|
-
return this.branches.map((e) => e.value);
|
|
3171
|
-
}
|
|
3172
|
-
}
|
|
3173
|
-
class On extends b {
|
|
3174
|
-
render(e, s) {
|
|
3175
|
-
e.breakCalled = !0;
|
|
3176
|
-
}
|
|
3177
|
-
}
|
|
3178
|
-
class zn extends b {
|
|
3179
|
-
render(e, s) {
|
|
3180
|
-
e.continueCalled = !0;
|
|
3181
|
-
}
|
|
3182
|
-
}
|
|
3183
|
-
class Rn extends b {
|
|
3184
|
-
constructor(e, s, i) {
|
|
3185
|
-
super(e, s, i), this.tokenizer.skipBlank(), this.tokenizer.end() || (this.value = new L(this.tokenizer.readFilteredValue(), this.liquid));
|
|
3186
|
-
}
|
|
3187
|
-
*render(e, s) {
|
|
3188
|
-
if (!this.value)
|
|
3189
|
-
return;
|
|
3190
|
-
const i = yield this.value.value(e, !1);
|
|
3191
|
-
s.write(i);
|
|
3192
|
-
}
|
|
3193
|
-
*arguments() {
|
|
3194
|
-
this.value && (yield this.value);
|
|
3195
|
-
}
|
|
3196
|
-
}
|
|
3197
|
-
class En extends b {
|
|
3198
|
-
constructor(e, s, i, r) {
|
|
3199
|
-
super(e, s, i);
|
|
3200
|
-
const n = this.tokenizer.readLiquidTagTokens(this.liquid.options);
|
|
3201
|
-
this.templates = r.parseTokens(n);
|
|
3202
|
-
}
|
|
3203
|
-
*render(e, s) {
|
|
3204
|
-
yield this.liquid.renderer.renderTemplates(this.templates, e, s);
|
|
3205
|
-
}
|
|
3206
|
-
*children() {
|
|
3207
|
-
return this.templates;
|
|
3208
|
-
}
|
|
3209
|
-
}
|
|
3210
|
-
class An extends b {
|
|
3211
|
-
constructor(e, s, i) {
|
|
3212
|
-
if (super(e, s, i), e.args.search(/\n\s*[^#\s]/g) !== -1)
|
|
3213
|
-
throw new Error("every line of an inline comment must start with a '#' character");
|
|
3214
|
-
}
|
|
3215
|
-
render() {
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
|
-
const Nn = {
|
|
3219
|
-
assign: ln,
|
|
3220
|
-
for: hn,
|
|
3221
|
-
capture: dn,
|
|
3222
|
-
case: pn,
|
|
3223
|
-
comment: gn,
|
|
3224
|
-
include: yn,
|
|
3225
|
-
render: mn,
|
|
3226
|
-
decrement: wn,
|
|
3227
|
-
increment: kn,
|
|
3228
|
-
cycle: bn,
|
|
3229
|
-
if: Tn,
|
|
3230
|
-
layout: vn,
|
|
3231
|
-
block: Sn,
|
|
3232
|
-
raw: xn,
|
|
3233
|
-
tablerow: Fn,
|
|
3234
|
-
unless: Ln,
|
|
3235
|
-
break: On,
|
|
3236
|
-
continue: zn,
|
|
3237
|
-
echo: Rn,
|
|
3238
|
-
liquid: En,
|
|
3239
|
-
"#": An
|
|
3240
|
-
};
|
|
3241
|
-
class Ut {
|
|
3242
|
-
constructor(e = {}) {
|
|
3243
|
-
this.renderer = new Cs(), this.filters = {}, this.tags = {}, this.options = gi(e), this.parser = new I(this), Ie(Nn, (s, i) => this.registerTag(i, s)), Ie(an, (s, i) => this.registerFilter(i, s));
|
|
3244
|
-
}
|
|
3245
|
-
parse(e, s) {
|
|
3246
|
-
return new I(this).parse(e, s);
|
|
3247
|
-
}
|
|
3248
|
-
_render(e, s, i) {
|
|
3249
|
-
const r = s instanceof $ ? s : new $(s, this.options, i);
|
|
3250
|
-
return this.renderer.renderTemplates(e, r);
|
|
3251
|
-
}
|
|
3252
|
-
render(e, s, i) {
|
|
3253
|
-
return k(this, void 0, void 0, function* () {
|
|
3254
|
-
return M(this._render(e, s, Object.assign(Object.assign({}, i), { sync: !1 })));
|
|
3255
|
-
});
|
|
3256
|
-
}
|
|
3257
|
-
renderSync(e, s, i) {
|
|
3258
|
-
return V(this._render(e, s, Object.assign(Object.assign({}, i), { sync: !0 })));
|
|
3259
|
-
}
|
|
3260
|
-
renderToNodeStream(e, s, i = {}) {
|
|
3261
|
-
const r = new $(s, this.options, i);
|
|
3262
|
-
return this.renderer.renderTemplatesToNodeStream(e, r);
|
|
3263
|
-
}
|
|
3264
|
-
_parseAndRender(e, s, i) {
|
|
3265
|
-
const r = this.parse(e);
|
|
3266
|
-
return this._render(r, s, i);
|
|
3267
|
-
}
|
|
3268
|
-
parseAndRender(e, s, i) {
|
|
3269
|
-
return k(this, void 0, void 0, function* () {
|
|
3270
|
-
return M(this._parseAndRender(e, s, Object.assign(Object.assign({}, i), { sync: !1 })));
|
|
3271
|
-
});
|
|
3272
|
-
}
|
|
3273
|
-
parseAndRenderSync(e, s, i) {
|
|
3274
|
-
return V(this._parseAndRender(e, s, Object.assign(Object.assign({}, i), { sync: !0 })));
|
|
3275
|
-
}
|
|
3276
|
-
_parsePartialFile(e, s, i) {
|
|
3277
|
-
return new I(this).parseFile(e, s, W.Partials, i);
|
|
3278
|
-
}
|
|
3279
|
-
_parseLayoutFile(e, s, i) {
|
|
3280
|
-
return new I(this).parseFile(e, s, W.Layouts, i);
|
|
3281
|
-
}
|
|
3282
|
-
_parseFile(e, s, i, r) {
|
|
3283
|
-
return new I(this).parseFile(e, s, i, r);
|
|
3284
|
-
}
|
|
3285
|
-
parseFile(e, s) {
|
|
3286
|
-
return k(this, void 0, void 0, function* () {
|
|
3287
|
-
return M(new I(this).parseFile(e, !1, s));
|
|
3288
|
-
});
|
|
3289
|
-
}
|
|
3290
|
-
parseFileSync(e, s) {
|
|
3291
|
-
return V(new I(this).parseFile(e, !0, s));
|
|
3292
|
-
}
|
|
3293
|
-
*_renderFile(e, s, i) {
|
|
3294
|
-
const r = yield this._parseFile(e, i.sync, i.lookupType);
|
|
3295
|
-
return yield this._render(r, s, i);
|
|
3296
|
-
}
|
|
3297
|
-
renderFile(e, s, i) {
|
|
3298
|
-
return k(this, void 0, void 0, function* () {
|
|
3299
|
-
return M(this._renderFile(e, s, Object.assign(Object.assign({}, i), { sync: !1 })));
|
|
3300
|
-
});
|
|
3301
|
-
}
|
|
3302
|
-
renderFileSync(e, s, i) {
|
|
3303
|
-
return V(this._renderFile(e, s, Object.assign(Object.assign({}, i), { sync: !0 })));
|
|
3304
|
-
}
|
|
3305
|
-
renderFileToNodeStream(e, s, i) {
|
|
3306
|
-
return k(this, void 0, void 0, function* () {
|
|
3307
|
-
const r = yield this.parseFile(e);
|
|
3308
|
-
return this.renderToNodeStream(r, s, i);
|
|
3309
|
-
});
|
|
3310
|
-
}
|
|
3311
|
-
_evalValue(e, s) {
|
|
3312
|
-
const i = new L(e, this), r = s instanceof $ ? s : new $(s, this.options);
|
|
3313
|
-
return i.value(r);
|
|
3314
|
-
}
|
|
3315
|
-
evalValue(e, s) {
|
|
3316
|
-
return k(this, void 0, void 0, function* () {
|
|
3317
|
-
return M(this._evalValue(e, s));
|
|
3318
|
-
});
|
|
3319
|
-
}
|
|
3320
|
-
evalValueSync(e, s) {
|
|
3321
|
-
return V(this._evalValue(e, s));
|
|
3322
|
-
}
|
|
3323
|
-
registerFilter(e, s) {
|
|
3324
|
-
this.filters[e] = s;
|
|
3325
|
-
}
|
|
3326
|
-
registerTag(e, s) {
|
|
3327
|
-
this.tags[e] = v(s) ? s : ki(s);
|
|
3328
|
-
}
|
|
3329
|
-
plugin(e) {
|
|
3330
|
-
return e.call(this, Ut);
|
|
3331
|
-
}
|
|
3332
|
-
express() {
|
|
3333
|
-
const e = this;
|
|
3334
|
-
let s = !0;
|
|
3335
|
-
return function(i, r, n) {
|
|
3336
|
-
if (s) {
|
|
3337
|
-
s = !1;
|
|
3338
|
-
const o = ae(this.root);
|
|
3339
|
-
e.options.root.unshift(...o), e.options.layouts.unshift(...o), e.options.partials.unshift(...o);
|
|
3340
|
-
}
|
|
3341
|
-
e.renderFile(i, r).then((o) => n(null, o), n);
|
|
3342
|
-
};
|
|
3343
|
-
}
|
|
3344
|
-
analyze(e, s = {}) {
|
|
3345
|
-
return k(this, void 0, void 0, function* () {
|
|
3346
|
-
return q(e, s);
|
|
3347
|
-
});
|
|
3348
|
-
}
|
|
3349
|
-
analyzeSync(e, s = {}) {
|
|
3350
|
-
return C(e, s);
|
|
3351
|
-
}
|
|
3352
|
-
parseAndAnalyze(e, s, i = {}) {
|
|
3353
|
-
return k(this, void 0, void 0, function* () {
|
|
3354
|
-
return q(this.parse(e, s), i);
|
|
3355
|
-
});
|
|
3356
|
-
}
|
|
3357
|
-
parseAndAnalyzeSync(e, s, i = {}) {
|
|
3358
|
-
return C(this.parse(e, s), i);
|
|
3359
|
-
}
|
|
3360
|
-
/** Return an array of all variables without their properties. */
|
|
3361
|
-
variables(e, s = {}) {
|
|
3362
|
-
return k(this, void 0, void 0, function* () {
|
|
3363
|
-
const i = yield q(f(e) ? this.parse(e) : e, s);
|
|
3364
|
-
return Object.keys(i.variables);
|
|
3365
|
-
});
|
|
3366
|
-
}
|
|
3367
|
-
/** Return an array of all variables without their properties. */
|
|
3368
|
-
variablesSync(e, s = {}) {
|
|
3369
|
-
const i = C(f(e) ? this.parse(e) : e, s);
|
|
3370
|
-
return Object.keys(i.variables);
|
|
3371
|
-
}
|
|
3372
|
-
/** Return an array of all variables including their properties/paths. */
|
|
3373
|
-
fullVariables(e, s = {}) {
|
|
3374
|
-
return k(this, void 0, void 0, function* () {
|
|
3375
|
-
const i = yield q(f(e) ? this.parse(e) : e, s);
|
|
3376
|
-
return Array.from(new Set(Object.values(i.variables).flatMap((r) => r.map((n) => String(n)))));
|
|
3377
|
-
});
|
|
3378
|
-
}
|
|
3379
|
-
/** Return an array of all variables including their properties/paths. */
|
|
3380
|
-
fullVariablesSync(e, s = {}) {
|
|
3381
|
-
const i = C(f(e) ? this.parse(e) : e, s);
|
|
3382
|
-
return Array.from(new Set(Object.values(i.variables).flatMap((r) => r.map((n) => String(n)))));
|
|
3383
|
-
}
|
|
3384
|
-
/** Return an array of all variables, each as an array of properties/segments. */
|
|
3385
|
-
variableSegments(e, s = {}) {
|
|
3386
|
-
return k(this, void 0, void 0, function* () {
|
|
3387
|
-
const i = yield q(f(e) ? this.parse(e) : e, s);
|
|
3388
|
-
return Array.from(re(Object.values(i.variables).flatMap((r) => r.map((n) => n.toArray()))));
|
|
3389
|
-
});
|
|
3390
|
-
}
|
|
3391
|
-
/** Return an array of all variables, each as an array of properties/segments. */
|
|
3392
|
-
variableSegmentsSync(e, s = {}) {
|
|
3393
|
-
const i = C(f(e) ? this.parse(e) : e, s);
|
|
3394
|
-
return Array.from(re(Object.values(i.variables).flatMap((r) => r.map((n) => n.toArray()))));
|
|
3395
|
-
}
|
|
3396
|
-
/** Return an array of all expected context variables without their properties. */
|
|
3397
|
-
globalVariables(e, s = {}) {
|
|
3398
|
-
return k(this, void 0, void 0, function* () {
|
|
3399
|
-
const i = yield q(f(e) ? this.parse(e) : e, s);
|
|
3400
|
-
return Object.keys(i.globals);
|
|
3401
|
-
});
|
|
3402
|
-
}
|
|
3403
|
-
/** Return an array of all expected context variables without their properties. */
|
|
3404
|
-
globalVariablesSync(e, s = {}) {
|
|
3405
|
-
const i = C(f(e) ? this.parse(e) : e, s);
|
|
3406
|
-
return Object.keys(i.globals);
|
|
3407
|
-
}
|
|
3408
|
-
/** Return an array of all expected context variables including their properties/paths. */
|
|
3409
|
-
globalFullVariables(e, s = {}) {
|
|
3410
|
-
return k(this, void 0, void 0, function* () {
|
|
3411
|
-
const i = yield q(f(e) ? this.parse(e) : e, s);
|
|
3412
|
-
return Array.from(new Set(Object.values(i.globals).flatMap((r) => r.map((n) => String(n)))));
|
|
3413
|
-
});
|
|
3414
|
-
}
|
|
3415
|
-
/** Return an array of all expected context variables including their properties/paths. */
|
|
3416
|
-
globalFullVariablesSync(e, s = {}) {
|
|
3417
|
-
const i = C(f(e) ? this.parse(e) : e, s);
|
|
3418
|
-
return Array.from(new Set(Object.values(i.globals).flatMap((r) => r.map((n) => String(n)))));
|
|
3419
|
-
}
|
|
3420
|
-
/** Return an array of all expected context variables, each as an array of properties/segments. */
|
|
3421
|
-
globalVariableSegments(e, s = {}) {
|
|
3422
|
-
return k(this, void 0, void 0, function* () {
|
|
3423
|
-
const i = yield q(f(e) ? this.parse(e) : e, s);
|
|
3424
|
-
return Array.from(re(Object.values(i.globals).flatMap((r) => r.map((n) => n.toArray()))));
|
|
3425
|
-
});
|
|
3426
|
-
}
|
|
3427
|
-
/** Return an array of all expected context variables, each as an array of properties/segments. */
|
|
3428
|
-
globalVariableSegmentsSync(e, s = {}) {
|
|
3429
|
-
const i = C(f(e) ? this.parse(e) : e, s);
|
|
3430
|
-
return Array.from(re(Object.values(i.globals).flatMap((r) => r.map((n) => n.toArray()))));
|
|
3431
|
-
}
|
|
3432
|
-
}
|
|
3433
|
-
export {
|
|
3434
|
-
rs as AssertionError,
|
|
3435
|
-
ln as AssignTag,
|
|
3436
|
-
Sn as BlockTag,
|
|
3437
|
-
On as BreakTag,
|
|
3438
|
-
dn as CaptureTag,
|
|
3439
|
-
pn as CaseTag,
|
|
3440
|
-
gn as CommentTag,
|
|
3441
|
-
$ as Context,
|
|
3442
|
-
zn as ContinueTag,
|
|
3443
|
-
bn as CycleTag,
|
|
3444
|
-
wn as DecrementTag,
|
|
3445
|
-
Y as Drop,
|
|
3446
|
-
Rn as EchoTag,
|
|
3447
|
-
Ps as Expression,
|
|
3448
|
-
Nt as Filter,
|
|
3449
|
-
hn as ForTag,
|
|
3450
|
-
ee as Hash,
|
|
3451
|
-
Tn as IfTag,
|
|
3452
|
-
yn as IncludeTag,
|
|
3453
|
-
kn as IncrementTag,
|
|
3454
|
-
An as InlineCommentTag,
|
|
3455
|
-
vn as LayoutTag,
|
|
3456
|
-
Ut as Liquid,
|
|
3457
|
-
J as LiquidError,
|
|
3458
|
-
En as LiquidTag,
|
|
3459
|
-
W as LookupType,
|
|
3460
|
-
vi as Output,
|
|
3461
|
-
es as ParseError,
|
|
3462
|
-
Ti as ParseStream,
|
|
3463
|
-
I as Parser,
|
|
3464
|
-
xn as RawTag,
|
|
3465
|
-
ts as RenderError,
|
|
3466
|
-
mn as RenderTag,
|
|
3467
|
-
Fn as TablerowTag,
|
|
3468
|
-
b as Tag,
|
|
3469
|
-
Qe as TagToken,
|
|
3470
|
-
z as Token,
|
|
3471
|
-
y as TokenKind,
|
|
3472
|
-
Kt as TokenizationError,
|
|
3473
|
-
N as Tokenizer,
|
|
3474
|
-
ss as UndefinedVariableError,
|
|
3475
|
-
Ln as UnlessTag,
|
|
3476
|
-
L as Value,
|
|
3477
|
-
H as Variable,
|
|
3478
|
-
q as analyze,
|
|
3479
|
-
C as analyzeSync,
|
|
3480
|
-
_ as assert,
|
|
3481
|
-
Ye as createTrie,
|
|
3482
|
-
Hs as defaultOperators,
|
|
3483
|
-
Q as defaultOptions,
|
|
3484
|
-
$s as evalQuotedToken,
|
|
3485
|
-
T as evalToken,
|
|
3486
|
-
an as filters,
|
|
3487
|
-
me as isFalsy,
|
|
3488
|
-
B as isTruthy,
|
|
3489
|
-
Nn as tags,
|
|
3490
|
-
M as toPromise,
|
|
3491
|
-
p as toValue,
|
|
3492
|
-
V as toValueSync
|
|
3493
|
-
};
|