squiffy-runtime 7.0.0-beta.1 → 7.0.0-beta.11
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/assets.d.ts +1 -0
- package/dist/classes.test.d.ts +1 -0
- package/dist/confirmDialog.d.ts +8 -0
- package/dist/events.d.ts +12 -0
- package/dist/every.d.ts +12 -0
- package/dist/every.test.d.ts +1 -0
- package/dist/helpers.test.d.ts +1 -0
- package/dist/numbers.d.ts +3 -0
- package/dist/panels.d.ts +14 -0
- package/dist/panels.test.d.ts +1 -0
- package/dist/paths.d.ts +15 -0
- package/dist/paths.test.d.ts +1 -0
- package/dist/persistent.test.d.ts +1 -0
- package/dist/playerSettings.d.ts +17 -0
- package/dist/preview-host.d.ts +7 -3
- package/dist/preview-host.js +47 -5
- package/dist/preview-host.js.map +2 -2
- package/dist/preview-html.js +1 -1
- package/dist/preview-protocol.d.ts +16 -0
- package/dist/preview.d.ts +1 -0
- package/dist/saveSlots.d.ts +16 -0
- package/dist/saves.test.d.ts +1 -0
- package/dist/savesDialog.d.ts +43 -0
- package/dist/savesDialog.test.d.ts +1 -0
- package/dist/scripts.test.d.ts +1 -0
- package/dist/settings.test.d.ts +1 -0
- package/dist/settingsDialog.d.ts +17 -0
- package/dist/skill.test.d.ts +1 -0
- package/dist/sound.d.ts +35 -0
- package/dist/sound.test.d.ts +1 -0
- package/dist/squiffy.page.css +155 -0
- package/dist/squiffy.preview.html +1469 -136
- package/dist/squiffy.runtime.css +1123 -20
- package/dist/squiffy.runtime.d.ts +13 -1
- package/dist/squiffy.runtime.global.js +144 -79
- package/dist/squiffy.runtime.global.js.map +1 -1
- package/dist/squiffy.runtime.js +6771 -4424
- package/dist/squiffy.runtime.js.map +1 -1
- package/dist/state.d.ts +17 -0
- package/dist/storyLists.d.ts +4 -0
- package/dist/storyLists.test.d.ts +1 -0
- package/dist/style.test.d.ts +1 -0
- package/dist/textProcessor.d.ts +27 -0
- package/dist/transitions.test.d.ts +1 -0
- package/dist/types.d.ts +125 -0
- package/dist/types.plugins.d.ts +1 -0
- package/dist/uiLinks.test.d.ts +1 -0
- package/dist/utils.d.ts +2 -1
- package/dist/utils.test.d.ts +1 -0
- package/package.json +11 -6
- package/src/__snapshots__/squiffy.runtime.test.ts.snap +22 -22
- package/src/animation.test.ts +44 -0
- package/src/animation.ts +9 -5
- package/src/assets.test.ts +1 -3
- package/src/assets.ts +1 -1
- package/src/classes.test.ts +201 -0
- package/src/confirmDialog.ts +66 -0
- package/src/events.ts +19 -0
- package/src/every.test.ts +25 -0
- package/src/every.ts +94 -0
- package/src/helpers.test.ts +34 -0
- package/src/numbers.ts +21 -0
- package/src/panels.test.ts +225 -0
- package/src/panels.ts +187 -0
- package/src/paths.test.ts +66 -0
- package/src/paths.ts +155 -0
- package/src/persistent.test.ts +155 -0
- package/src/playerSettings.ts +128 -0
- package/src/pluginManager.ts +1 -0
- package/src/plugins/animate.ts +28 -4
- package/src/plugins/live.ts +18 -5
- package/src/plugins/plugins.test.ts +93 -6
- package/src/plugins/replaceLabel.ts +7 -3
- package/src/preview-host.test.ts +97 -1
- package/src/preview-host.ts +71 -10
- package/src/preview-protocol.ts +25 -3
- package/src/preview.main.ts +1 -0
- package/src/preview.test.ts +203 -4
- package/src/preview.ts +178 -12
- package/src/saveSlots.ts +159 -0
- package/src/saves.test.ts +199 -0
- package/src/savesDialog.test.ts +290 -0
- package/src/savesDialog.ts +499 -0
- package/src/scripts.test.ts +130 -0
- package/src/settings.test.ts +233 -0
- package/src/settingsDialog.ts +160 -0
- package/src/skill.test.ts +67 -0
- package/src/sound.test.ts +273 -0
- package/src/sound.ts +207 -0
- package/src/squiffy.page.css +155 -0
- package/src/squiffy.runtime.css +1123 -20
- package/src/squiffy.runtime.test.ts +2806 -44
- package/src/squiffy.runtime.ts +1111 -64
- package/src/state.ts +172 -11
- package/src/storyLists.test.ts +134 -0
- package/src/storyLists.ts +57 -0
- package/src/style.test.ts +89 -0
- package/src/textProcessor.ts +739 -58
- package/src/transitions.test.ts +343 -0
- package/src/types.plugins.ts +3 -0
- package/src/types.ts +209 -1
- package/src/uiLinks.test.ts +156 -0
- package/src/updater.ts +26 -8
- package/src/utils.test.ts +60 -0
- package/src/utils.ts +46 -14
- package/vite.config.ts +3 -4
- package/vite.preview.config.ts +16 -5
- package/dist/infixExpressions.d.ts +0 -2
- package/src/infixExpressions.test.ts +0 -187
- package/src/infixExpressions.ts +0 -323
- /package/dist/{infixExpressions.test.d.ts → animation.test.d.ts} +0 -0
|
@@ -5,21 +5,52 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>Squiffy preview</title>
|
|
7
7
|
<style>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.
|
|
11
|
-
|
|
8
|
+
/* Core Squiffy Runtime Styles. See https://squiffystory.com/styling/ for how to customise these. */
|
|
9
|
+
|
|
10
|
+
/* Colours. Each has a light and a dark value, and light-dark() picks one from the page's
|
|
11
|
+
color-scheme. This file doesn't set color-scheme itself, so a story embedded in a page stays
|
|
12
|
+
light unless the page opts in to dark mode. The exported story's page (squiffy.page.css) sets
|
|
13
|
+
"color-scheme: light dark", so it follows the reader's system setting. */
|
|
14
|
+
:root
|
|
15
|
+
{
|
|
16
|
+
--squiffy-text: light-dark(#1f2328, #e4e4e7);
|
|
17
|
+
--squiffy-background: light-dark(#ffffff, #18181b);
|
|
18
|
+
/* Secondary text: the header buttons, and links waiting for valid input */
|
|
19
|
+
--squiffy-muted: light-dark(#6b6f76, #9a9ca3);
|
|
20
|
+
/* The lines between sections */
|
|
21
|
+
--squiffy-border: light-dark(#e2e2e6, #34343a);
|
|
22
|
+
--squiffy-link: light-dark(#1d5fd6, #7aa7ff);
|
|
23
|
+
--squiffy-link-hover: light-dark(#0f3f99, #b0cbff);
|
|
24
|
+
--squiffy-error: light-dark(#c62828, #ff7b72);
|
|
25
|
+
--squiffy-success: light-dark(#2e7d32, #6cc070);
|
|
26
|
+
}
|
|
12
27
|
|
|
13
28
|
/* Link styles */
|
|
14
29
|
a.squiffy-link
|
|
15
30
|
{
|
|
31
|
+
color: var(--squiffy-link);
|
|
16
32
|
text-decoration: underline;
|
|
17
|
-
text-decoration-color:
|
|
18
|
-
|
|
33
|
+
text-decoration-color: currentColor;
|
|
34
|
+
text-decoration-thickness: from-font;
|
|
35
|
+
text-underline-offset: 0.15em;
|
|
19
36
|
cursor: pointer;
|
|
20
37
|
transition: color 0.4s ease-in-out, text-decoration-color 0.4s ease-in-out;
|
|
21
38
|
}
|
|
22
39
|
|
|
40
|
+
a.squiffy-link:hover
|
|
41
|
+
{
|
|
42
|
+
color: var(--squiffy-link-hover);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
a.squiffy-link:focus-visible,
|
|
46
|
+
button.squiffy-header-button:focus-visible,
|
|
47
|
+
.squiffy-continue:focus-visible
|
|
48
|
+
{
|
|
49
|
+
outline: 2px solid var(--squiffy-link);
|
|
50
|
+
outline-offset: 2px;
|
|
51
|
+
border-radius: 2px;
|
|
52
|
+
}
|
|
53
|
+
|
|
23
54
|
/* Rotate/sequence links - visually distinct as they update in-place rather than advancing the story */
|
|
24
55
|
a.squiffy-link[data-handler="rotate"],
|
|
25
56
|
a.squiffy-link[data-handler="sequence"] {
|
|
@@ -43,10 +74,9 @@ a.squiffy-link.validation-disabled
|
|
|
43
74
|
{
|
|
44
75
|
text-decoration: inherit;
|
|
45
76
|
text-decoration-color: transparent;
|
|
46
|
-
color:
|
|
77
|
+
color: var(--squiffy-muted) !important;
|
|
47
78
|
cursor: not-allowed;
|
|
48
79
|
pointer-events: none;
|
|
49
|
-
opacity: 0.6;
|
|
50
80
|
}
|
|
51
81
|
|
|
52
82
|
/* Invalid input field states */
|
|
@@ -54,8 +84,8 @@ input.squiffy-invalid,
|
|
|
54
84
|
textarea.squiffy-invalid,
|
|
55
85
|
select.squiffy-invalid
|
|
56
86
|
{
|
|
57
|
-
border-color:
|
|
58
|
-
box-shadow: 0 0 0 0.2rem
|
|
87
|
+
border-color: var(--squiffy-error) !important;
|
|
88
|
+
box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--squiffy-error) 25%, transparent);
|
|
59
89
|
}
|
|
60
90
|
|
|
61
91
|
/* Valid input field states (optional, provides positive feedback) */
|
|
@@ -63,7 +93,7 @@ input:not([disabled]):valid,
|
|
|
63
93
|
textarea:not([disabled]):valid,
|
|
64
94
|
select:not([disabled]):valid
|
|
65
95
|
{
|
|
66
|
-
border-color:
|
|
96
|
+
border-color: var(--squiffy-success);
|
|
67
97
|
}
|
|
68
98
|
|
|
69
99
|
/* Focus state for invalid inputs */
|
|
@@ -72,19 +102,55 @@ textarea.squiffy-invalid:focus,
|
|
|
72
102
|
select.squiffy-invalid:focus
|
|
73
103
|
{
|
|
74
104
|
outline: none;
|
|
75
|
-
border-color:
|
|
76
|
-
box-shadow: 0 0 0 0.2rem
|
|
105
|
+
border-color: var(--squiffy-error) !important;
|
|
106
|
+
box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--squiffy-error) 50%, transparent);
|
|
77
107
|
}
|
|
78
108
|
|
|
79
|
-
/* Header button styles */
|
|
109
|
+
/* Header button styles: the Back, Restart and light/dark buttons, which are icons */
|
|
80
110
|
button.squiffy-header-button
|
|
81
111
|
{
|
|
82
|
-
|
|
83
|
-
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
color: var(--squiffy-muted);
|
|
84
116
|
cursor: pointer;
|
|
85
117
|
background: none;
|
|
86
118
|
border: none;
|
|
87
|
-
|
|
119
|
+
border-radius: 0.375em;
|
|
120
|
+
padding: 0.375em;
|
|
121
|
+
font: inherit;
|
|
122
|
+
vertical-align: middle;
|
|
123
|
+
transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button.squiffy-header-button:hover:not(:disabled)
|
|
127
|
+
{
|
|
128
|
+
color: var(--squiffy-text);
|
|
129
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
button.squiffy-header-button svg
|
|
133
|
+
{
|
|
134
|
+
width: 1.25em;
|
|
135
|
+
height: 1.25em;
|
|
136
|
+
fill: none;
|
|
137
|
+
stroke: currentColor;
|
|
138
|
+
stroke-width: 2;
|
|
139
|
+
stroke-linecap: round;
|
|
140
|
+
stroke-linejoin: round;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* The light/dark button, when the story's CSS fixes the theme */
|
|
144
|
+
button.squiffy-header-button[hidden]
|
|
145
|
+
{
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* The Back button, when there's nothing to go back to */
|
|
150
|
+
button.squiffy-header-button:disabled
|
|
151
|
+
{
|
|
152
|
+
cursor: default;
|
|
153
|
+
opacity: 0.5;
|
|
88
154
|
}
|
|
89
155
|
|
|
90
156
|
/* Output block spacing */
|
|
@@ -93,7 +159,20 @@ div.squiffy-output-passage:not(:last-child),
|
|
|
93
159
|
div.squiffy-output-section:not(:last-child)
|
|
94
160
|
{
|
|
95
161
|
margin-bottom: 1em;
|
|
96
|
-
border-bottom: 1px solid
|
|
162
|
+
border-bottom: 1px solid var(--squiffy-border);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* ...but a block, passage or section that output no text (such as a passage that only does
|
|
166
|
+
{{replace}}) gets no line, and nor does one followed only by those, so they don't add extra lines */
|
|
167
|
+
div.squiffy-output-block:not(:has(> div:not(:empty))),
|
|
168
|
+
div.squiffy-output-block:not(:has(~ div.squiffy-output-block > div:not(:empty), ~ div.squiffy-output-passage > div.squiffy-output-block > div:not(:empty))),
|
|
169
|
+
div.squiffy-output-passage:not(:has(> div.squiffy-output-block > div:not(:empty))),
|
|
170
|
+
div.squiffy-output-passage:not(:has(~ div.squiffy-output-block > div:not(:empty), ~ div.squiffy-output-passage > div.squiffy-output-block > div:not(:empty))),
|
|
171
|
+
div.squiffy-output-section:not(:has(div.squiffy-output-block > div:not(:empty))),
|
|
172
|
+
div.squiffy-output-section:not(:has(~ div.squiffy-output-section div.squiffy-output-block > div:not(:empty)))
|
|
173
|
+
{
|
|
174
|
+
margin-bottom: 0;
|
|
175
|
+
border-bottom: none;
|
|
97
176
|
}
|
|
98
177
|
|
|
99
178
|
/* Fade animations */
|
|
@@ -109,9 +188,11 @@ div.squiffy-output-section:not(:last-child)
|
|
|
109
188
|
|
|
110
189
|
/* Continue animation - click to proceed */
|
|
111
190
|
.squiffy-continue {
|
|
191
|
+
color: var(--squiffy-link);
|
|
112
192
|
text-decoration: underline;
|
|
113
|
-
text-decoration-color:
|
|
114
|
-
|
|
193
|
+
text-decoration-color: currentColor;
|
|
194
|
+
text-decoration-thickness: from-font;
|
|
195
|
+
text-underline-offset: 0.15em;
|
|
115
196
|
cursor: pointer;
|
|
116
197
|
}
|
|
117
198
|
|
|
@@ -131,8 +212,8 @@ div.squiffy-output-section:not(:last-child)
|
|
|
131
212
|
}
|
|
132
213
|
|
|
133
214
|
@keyframes squiffy-glow {
|
|
134
|
-
0%, 100% { text-shadow: 0 0 4px
|
|
135
|
-
50% { text-shadow: 0 0 12px
|
|
215
|
+
0%, 100% { text-shadow: 0 0 4px color-mix(in srgb, currentColor 50%, transparent); }
|
|
216
|
+
50% { text-shadow: 0 0 12px color-mix(in srgb, currentColor 80%, transparent), 0 0 20px color-mix(in srgb, currentColor 40%, transparent); }
|
|
136
217
|
}
|
|
137
218
|
|
|
138
219
|
/* Style: bounce - subtle vertical bounce */
|
|
@@ -149,149 +230,1401 @@ div.squiffy-output-section:not(:last-child)
|
|
|
149
230
|
/* Style: wave - character spans need special handling for underline */
|
|
150
231
|
.squiffy-continue-wave {
|
|
151
232
|
text-decoration: none;
|
|
152
|
-
border-bottom: 1px solid
|
|
233
|
+
border-bottom: 1px solid currentColor;
|
|
153
234
|
}
|
|
154
235
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
`)}return $}else throw new i.default("The partial "+C.name+" could not be compiled when running in runtime-only mode")}var A={strict:function(P,C,$){if(!P||!(C in P))throw new i.default('"'+C+'" not defined in '+P,{loc:$});return A.lookupProperty(P,C)},lookupProperty:function(P,C){var $=P[C];if($==null||Object.prototype.hasOwnProperty.call(P,C)&&!h.isPrototypeConstructor(P,C,$)||h.resultIsAllowed($,A.protoAccessControl,C))return $},lookup:function(P,C){for(var $=P.length,H=0;H<$;H++){var V=P[H]&&A.lookupProperty(P[H],C);if(V!=null)return V}},lambda:function(P,C){return typeof P=="function"?P.call(C):P},escapeExpression:r.escapeExpression,invokePartial:w,fn:function(P){var C=m[P];return C.decorator=m[P+"_d"],C},programs:[],program:function(P,C,$,H,V){var x=this.programs[P],M=this.fn(P);return C||V||H||$?x=c(this,P,M,C,$,H,V):x||(x=this.programs[P]=c(this,P,M)),x},data:function(P,C){for(;P&&C--;)P=P._parent;return P},mergeIfNeeded:function(P,C){var $=P||C;return P&&C&&P!==C&&($=r.extend({},C,P)),$},nullContext:Object.seal({}),noop:_.VM.noop,compilerInfo:m.compiler};function O(E){var P=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],C=P.data;O._setup(P),!P.partial&&m.useData&&(C=v(E,C));var $=void 0,H=m.useBlockParams?[]:void 0;m.useDepths&&(P.depths?$=E!=P.depths[0]?[E].concat(P.depths):P.depths:$=[E]);function V(x){return""+m.main(A,x,A.helpers,A.partials,C,H,$)}return V=b(m.main,V,A,P.depths||[],C,H),V(E,P)}return O.isTop=!0,O._setup=function(E){if(E.partial)A.protoAccessControl=E.protoAccessControl,A.helpers=E.helpers,A.partials=E.partials,A.decorators=E.decorators,A.hooks=E.hooks;else{var P={};S(P,_.helpers,A),S(P,E.helpers,A),A.helpers=P,m.usePartial&&(A.partials=A.mergeIfNeeded(E.partials,_.partials)),(m.usePartial||m.useDecorators)&&(A.decorators=r.extend({},_.decorators,E.decorators)),A.hooks={},A.protoAccessControl=h.createProtoAccessControl(E);var C=E.allowCallsToHelperMissing||k;o.moveHelperToHooks(A,"helperMissing",C),o.moveHelperToHooks(A,"blockHelperMissing",C)}},O._child=function(E,P,C,$){if(m.useBlockParams&&!C)throw new i.default("must pass block params");if(m.useDepths&&!$)throw new i.default("must pass parent depths");return c(A,E,m[E],P,0,C,$)},O}function c(m,_,k,w,A,O,E){function P(C){var $=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],H=E;return E&&C!=E[0]&&!(C===m.nullContext&&E[0]===null)&&(H=[C].concat(E)),k(m,C,m.helpers,m.partials,$.data||w,O&&[$.blockParams].concat(O),H)}return P=b(k,P,m,E,w,O),P.program=_,P.depth=E?E.length:0,P.blockParams=A||0,P}function f(m,_,k){return m?typeof m!="function"&&!k.name&&(k.name=m,m=g(k.partials,m)):k.name==="@partial-block"?m=g(k.data,"partial-block"):m=g(k.partials,k.name),m}function l(m,_,k){var w=g(k.data,"partial-block");k.partial=!0,k.ids&&(k.data.contextPath=k.ids[0]||k.data.contextPath);var A=void 0;if(k.fn&&k.fn!==d&&(function(){k.data=n.createFrame(k.data);var O=k.fn;A=k.data["partial-block"]=function(P){var C=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return C.data=n.createFrame(C.data),C.data["partial-block"]=w,O(P,C)},O.partials&&(k.partials=r.extend({},k.partials,O.partials))})(),m===void 0&&A&&(m=A),m===void 0)throw new i.default("The partial "+k.name+" could not be found");if(m instanceof Function)return m(_,k)}function d(){return""}function g(m,_){if(m&&Object.prototype.hasOwnProperty.call(m,_))return m[_]}function v(m,_){return(!_||!("root"in _))&&(_=_?n.createFrame(_):{},_.root=m),_}function b(m,_,k,w,A,O){if(m.decorator){var E={};_=m.decorator(_,E,k,w&&w[0],A,O,w),r.extend(_,E)}return _}function S(m,_,k){_&&Object.keys(_).forEach(function(w){var A=_[w];m[w]=y(A,k)})}function y(m,_){var k=_.lookupProperty;return a.wrapHelper(m,function(w){return w.lookupProperty=k,w})}})),Ji=he(((e,t)=>{e.__esModule=!0,e.default=function(s){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var r=globalThis.Handlebars;s.noConflict=function(){return globalThis.Handlebars===s&&(globalThis.Handlebars=r),s}},t.exports=e.default})),dl=he(((e,t)=>{e.__esModule=!0;function s(f){return f&&f.__esModule?f:{default:f}}function r(f){if(f&&f.__esModule)return f;var l={};if(f!=null)for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d]);return l.default=f,l}var i=r(Ir()),n=s(hl()),o=s(gt()),a=r(We()),h=r(fl()),u=s(Ji());function p(){var f=new i.HandlebarsEnvironment;return a.extend(f,i),f.SafeString=n.default,f.Exception=o.default,f.Utils=a,f.escapeExpression=a.escapeExpression,f.VM=h,f.template=function(l){return h.template(l,f)},f}var c=p();c.create=p,u.default(c),c.default=c,e.default=c,t.exports=e.default})),Ki=he(((e,t)=>{e.__esModule=!0;var s={helpers:{helperExpression:function(i){return i.type==="SubExpression"||(i.type==="MustacheStatement"||i.type==="BlockStatement")&&!!(i.params&&i.params.length||i.hash)},scopedId:function(i){return/^\.|this\b/.test(i.original)},simpleId:function(i){return i.parts.length===1&&!s.helpers.scopedId(i)&&!i.depth}}};e.default=s,t.exports=e.default})),gl=he(((e,t)=>{e.__esModule=!0;var s=(function(){var r={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,a,h,u,p,c,f){var l=c.length-1;switch(p){case 1:return c[l-1];case 2:this.$=u.prepareProgram(c[l]);break;case 3:this.$=c[l];break;case 4:this.$=c[l];break;case 5:this.$=c[l];break;case 6:this.$=c[l];break;case 7:this.$=c[l];break;case 8:this.$=c[l];break;case 9:this.$={type:"CommentStatement",value:u.stripComment(c[l]),strip:u.stripFlags(c[l],c[l]),loc:u.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:c[l],value:c[l],loc:u.locInfo(this._$)};break;case 11:this.$=u.prepareRawBlock(c[l-2],c[l-1],c[l],this._$);break;case 12:this.$={path:c[l-3],params:c[l-2],hash:c[l-1]};break;case 13:this.$=u.prepareBlock(c[l-3],c[l-2],c[l-1],c[l],!1,this._$);break;case 14:this.$=u.prepareBlock(c[l-3],c[l-2],c[l-1],c[l],!0,this._$);break;case 15:this.$={open:c[l-5],path:c[l-4],params:c[l-3],hash:c[l-2],blockParams:c[l-1],strip:u.stripFlags(c[l-5],c[l])};break;case 16:this.$={path:c[l-4],params:c[l-3],hash:c[l-2],blockParams:c[l-1],strip:u.stripFlags(c[l-5],c[l])};break;case 17:this.$={path:c[l-4],params:c[l-3],hash:c[l-2],blockParams:c[l-1],strip:u.stripFlags(c[l-5],c[l])};break;case 18:this.$={strip:u.stripFlags(c[l-1],c[l-1]),program:c[l]};break;case 19:var d=u.prepareBlock(c[l-2],c[l-1],c[l],c[l],!1,this._$),g=u.prepareProgram([d],c[l-1].loc);g.chained=!0,this.$={strip:c[l-2].strip,program:g,chain:!0};break;case 20:this.$=c[l];break;case 21:this.$={path:c[l-1],strip:u.stripFlags(c[l-2],c[l])};break;case 22:this.$=u.prepareMustache(c[l-3],c[l-2],c[l-1],c[l-4],u.stripFlags(c[l-4],c[l]),this._$);break;case 23:this.$=u.prepareMustache(c[l-3],c[l-2],c[l-1],c[l-4],u.stripFlags(c[l-4],c[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:c[l-3],params:c[l-2],hash:c[l-1],indent:"",strip:u.stripFlags(c[l-4],c[l]),loc:u.locInfo(this._$)};break;case 25:this.$=u.preparePartialBlock(c[l-2],c[l-1],c[l],this._$);break;case 26:this.$={path:c[l-3],params:c[l-2],hash:c[l-1],strip:u.stripFlags(c[l-4],c[l])};break;case 27:this.$=c[l];break;case 28:this.$=c[l];break;case 29:this.$={type:"SubExpression",path:c[l-3],params:c[l-2],hash:c[l-1],loc:u.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:c[l],loc:u.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:u.id(c[l-2]),value:c[l],loc:u.locInfo(this._$)};break;case 32:this.$=u.id(c[l-1]);break;case 33:this.$=c[l];break;case 34:this.$=c[l];break;case 35:this.$={type:"StringLiteral",value:c[l],original:c[l],loc:u.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(c[l]),original:Number(c[l]),loc:u.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:c[l]==="true",original:c[l]==="true",loc:u.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:u.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:u.locInfo(this._$)};break;case 40:this.$=c[l];break;case 41:this.$=c[l];break;case 42:this.$=u.preparePath(!0,c[l],this._$);break;case 43:this.$=u.preparePath(!1,c[l],this._$);break;case 44:c[l-2].push({part:u.id(c[l]),original:c[l],separator:c[l-1]}),this.$=c[l-2];break;case 45:this.$=[{part:u.id(c[l]),original:c[l]}];break;case 46:this.$=[];break;case 47:c[l-1].push(c[l]);break;case 48:this.$=[];break;case 49:c[l-1].push(c[l]);break;case 50:this.$=[];break;case 51:c[l-1].push(c[l]);break;case 58:this.$=[];break;case 59:c[l-1].push(c[l]);break;case 64:this.$=[];break;case 65:c[l-1].push(c[l]);break;case 70:this.$=[];break;case 71:c[l-1].push(c[l]);break;case 78:this.$=[];break;case 79:c[l-1].push(c[l]);break;case 82:this.$=[];break;case 83:c[l-1].push(c[l]);break;case 86:this.$=[];break;case 87:c[l-1].push(c[l]);break;case 90:this.$=[];break;case 91:c[l-1].push(c[l]);break;case 94:this.$=[];break;case 95:c[l-1].push(c[l]);break;case 98:this.$=[c[l]];break;case 99:c[l-1].push(c[l]);break;case 100:this.$=[c[l]];break;case 101:c[l-1].push(c[l])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,a){throw new Error(o)},parse:function(o){var a=this,h=[0],u=[null],p=[],c=this.table,f="",l=0,d=0,g=0;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var v=this.lexer.yylloc;p.push(v);var b=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function S(){var H=a.lexer.lex()||1;return typeof H!="number"&&(H=a.symbols_[H]||H),H}for(var y,m,_,k,w,A={},O,E,P,C;;){if(_=h[h.length-1],this.defaultActions[_]?k=this.defaultActions[_]:((y===null||typeof y>"u")&&(y=S()),k=c[_]&&c[_][y]),typeof k>"u"||!k.length||!k[0]){var $="";if(!g){C=[];for(O in c[_])this.terminals_[O]&&O>2&&C.push("'"+this.terminals_[O]+"'");this.lexer.showPosition?$="Parse error on line "+(l+1)+`:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return typeof a<"u"?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return n.options={},n.performAction=function(a,h,u,p){function c(f,l){return h.yytext=h.yytext.substring(f,h.yyleng-l+f)}switch(u){case 0:if(h.yytext.slice(-2)==="\\\\"?(c(0,1),this.begin("mu")):h.yytext.slice(-1)==="\\"?(c(0,1),this.begin("emu")):this.begin("mu"),h.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(c(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(h.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return h.yytext=c(1,2).replace(/\\"/g,'"'),80;case 32:return h.yytext=c(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return h.yytext=h.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();function i(){this.yy={}}return i.prototype=r,r.Parser=i,new i})();e.default=s,t.exports=e.default})),en=he((e=>{e.__esModule=!0;var t=["Program","BlockStatement","DecoratorBlock","PartialStatement","PartialBlockStatement","Decorator","MustacheStatement","ContentStatement","CommentStatement","SubExpression","PathExpression","StringLiteral","NumberLiteral","BooleanLiteral","UndefinedLiteral","NullLiteral","Hash","HashPair"];e.NODE_TYPES=t})),tn=he(((e,t)=>{e.__esModule=!0;function s(c){return c&&c.__esModule?c:{default:c}}var r=s(gt()),i=We(),n=en();function o(){this.parents=[]}function a(c,f){return i.indexOf(n.NODE_TYPES,f)!==-1||!(f in o.prototype)&&typeof c[f]=="function"}o.prototype={constructor:o,mutating:!1,acceptKey:function(f,l){var d=this.accept(f[l]);if(this.mutating){if(d&&!a(this,d.type))throw new r.default('Unexpected node type "'+d.type+'" found when accepting '+l+" on "+f.type);f[l]=d}},acceptRequired:function(f,l){if(this.acceptKey(f,l),!f[l])throw new r.default(f.type+" requires "+l)},acceptArray:function(f){for(var l=0,d=f.length;l<d;l++)this.acceptKey(f,l),f[l]||(f.splice(l,1),l--,d--)},accept:function(f){if(f){if(!a(this,f.type)||!this[f.type])throw new r.default("Unknown type: "+f.type,f);this.current&&this.parents.unshift(this.current),this.current=f;var l=this[f.type](f);if(this.current=this.parents.shift(),!this.mutating||l)return l;if(l!==!1)return f}},Program:function(f){this.acceptArray(f.body)},MustacheStatement:h,Decorator:h,BlockStatement:u,DecoratorBlock:u,PartialStatement:p,PartialBlockStatement:function(f){p.call(this,f),this.acceptKey(f,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:h,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(f){this.acceptArray(f.pairs)},HashPair:function(f){this.acceptRequired(f,"value")}};function h(c){this.acceptRequired(c,"path"),this.acceptArray(c.params),this.acceptKey(c,"hash")}function u(c){h.call(this,c),this.acceptKey(c,"program"),this.acceptKey(c,"inverse")}function p(c){this.acceptRequired(c,"name"),this.acceptArray(c.params),this.acceptKey(c,"hash")}e.default=o,t.exports=e.default})),ml=he(((e,t)=>{e.__esModule=!0;function s(u){return u&&u.__esModule?u:{default:u}}var r=s(tn());function i(){var u=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=u}i.prototype=new r.default,i.prototype.Program=function(u){var p=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var f=u.body,l=0,d=f.length;l<d;l++){var g=f[l],v=this.accept(g);if(v){var b=n(f,l,c),S=o(f,l,c),y=v.openStandalone&&b,m=v.closeStandalone&&S,_=v.inlineStandalone&&b&&S;v.close&&a(f,l,!0),v.open&&h(f,l,!0),p&&_&&(a(f,l),h(f,l)&&g.type==="PartialStatement"&&(g.indent=/(?:^|[^ \t])([ \t]+)$/.exec(f[l-1].original)[1])),p&&y&&(a((g.program||g.inverse).body),h(f,l)),p&&m&&(a(f,l),h((g.inverse||g.program).body))}}return u},i.prototype.BlockStatement=i.prototype.DecoratorBlock=i.prototype.PartialBlockStatement=function(u){this.accept(u.program),this.accept(u.inverse);var p=u.program||u.inverse,c=u.program&&u.inverse,f=c,l=c;if(c&&c.chained)for(f=c.body[0].program;l.chained;)l=l.body[l.body.length-1].program;var d={open:u.openStrip.open,close:u.closeStrip.close,openStandalone:o(p.body),closeStandalone:n((f||p).body)};if(u.openStrip.close&&a(p.body,null,!0),c){var g=u.inverseStrip;g.open&&h(p.body,null,!0),g.close&&a(f.body,null,!0),u.closeStrip.open&&h(l.body,null,!0),!this.options.ignoreStandalone&&n(p.body)&&o(f.body)&&(h(p.body),a(f.body))}else u.closeStrip.open&&h(p.body,null,!0);return d},i.prototype.Decorator=i.prototype.MustacheStatement=function(u){return u.strip},i.prototype.PartialStatement=i.prototype.CommentStatement=function(u){var p=u.strip||{};return{inlineStandalone:!0,open:p.open,close:p.close}};function n(u,p,c){p===void 0&&(p=u.length);var f=u[p-1],l=u[p-2];if(!f)return c;if(f.type==="ContentStatement")return(l||!c?/(?:^|\S)[^\S\n]*\n\s*$/:/^\s*$|(?:^|\S)[^\S\n]*\n\s*$/).test(f.original)}function o(u,p,c){p===void 0&&(p=-1);var f=u[p+1],l=u[p+2];if(!f)return c;if(f.type==="ContentStatement")return(l||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(f.original)}function a(u,p,c){var f=u[p==null?0:p+1];if(!(!f||f.type!=="ContentStatement"||!c&&f.rightStripped)){var l=f.value;f.value=f.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),f.rightStripped=f.value!==l}}function h(u,p,c){var f=u[p==null?u.length-1:p-1];if(!(!f||f.type!=="ContentStatement"||!c&&f.leftStripped)){var l=f.value;return f.value=f.value.replace(c?/(^|\S)\s+$/:/(^|[^ \t])[ \t]+$/,"$1"),f.leftStripped=f.value!==l,f.leftStripped}}e.default=i,t.exports=e.default})),vl=he((e=>{e.__esModule=!0,e.SourceLocation=i,e.id=n,e.stripFlags=o,e.stripComment=a,e.preparePath=h,e.prepareMustache=u,e.prepareRawBlock=p,e.prepareBlock=c,e.prepareProgram=f,e.preparePartialBlock=l;function t(d){return d&&d.__esModule?d:{default:d}}var s=t(gt());function r(d,g){if(g=g.path?g.path.original:g,d.path.original!==g){var v={loc:d.path.loc};throw new s.default(d.path.original+" doesn't match "+g,v)}}function i(d,g){this.source=d,this.start={line:g.first_line,column:g.first_column},this.end={line:g.last_line,column:g.last_column}}function n(d){return/^\[.*\]$/.test(d)?d.substring(1,d.length-1):d}function o(d,g){return{open:d.charAt(2)==="~",close:g.charAt(g.length-3)==="~"}}function a(d){return d.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function h(d,g,v){v=this.locInfo(v);for(var b=d?"@":"",S=[],y=0,m=0,_=g.length;m<_;m++){var k=g[m].part,w=g[m].original!==k;if(b+=(g[m].separator||"")+k,!w&&(k===".."||k==="."||k==="this")){if(S.length>0)throw new s.default("Invalid path: "+b,{loc:v});k===".."&&y++}else S.push(k)}return{type:"PathExpression",data:d,depth:y,parts:S,original:b,loc:v}}function u(d,g,v,b,S,y){var m=b.charAt(3)||b.charAt(2),_=m!=="{"&&m!=="&";return{type:/\*/.test(b)?"Decorator":"MustacheStatement",path:d,params:g,hash:v,escaped:_,strip:S,loc:this.locInfo(y)}}function p(d,g,v,b){r(d,v),b=this.locInfo(b);var S={type:"Program",body:g,strip:{},loc:b};return{type:"BlockStatement",path:d.path,params:d.params,hash:d.hash,program:S,openStrip:{},inverseStrip:{},closeStrip:{},loc:b}}function c(d,g,v,b,S,y){b&&b.path&&r(d,b);var m=/\*/.test(d.open);g.blockParams=d.blockParams;var _=void 0,k=void 0;if(v){if(m)throw new s.default("Unexpected inverse block on decorator",v);v.chain&&(v.program.body[0].closeStrip=b.strip),k=v.strip,_=v.program}return S&&(S=_,_=g,g=S),{type:m?"DecoratorBlock":"BlockStatement",path:d.path,params:d.params,hash:d.hash,program:g,inverse:_,openStrip:d.strip,inverseStrip:k,closeStrip:b&&b.strip,loc:this.locInfo(y)}}function f(d,g){if(!g&&d.length){var v=d[0].loc,b=d[d.length-1].loc;v&&b&&(g={source:v.source,start:{line:v.start.line,column:v.start.column},end:{line:b.end.line,column:b.end.column}})}return{type:"Program",body:d,strip:{},loc:g}}function l(d,g,v,b){return r(d,v),{type:"PartialBlockStatement",name:d.path,params:d.params,hash:d.hash,program:g,openStrip:d.strip,closeStrip:v&&v.strip,loc:this.locInfo(b)}}})),yl=he((e=>{e.__esModule=!0,e.parseWithoutProcessing=h,e.parse=u;function t(p){if(p&&p.__esModule)return p;var c={};if(p!=null)for(var f in p)Object.prototype.hasOwnProperty.call(p,f)&&(c[f]=p[f]);return c.default=p,c}function s(p){return p&&p.__esModule?p:{default:p}}var r=s(gl()),i=s(ml()),n=t(vl()),o=We();e.parser=r.default;var a={};o.extend(a,n);function h(p,c){return p.type==="Program"?p:(r.default.yy=a,a.locInfo=function(f){return new a.SourceLocation(c&&c.srcName,f)},r.default.parse(p))}function u(p,c){var f=h(p,c);return new i.default(c).accept(f)}})),bl=he((e=>{e.__esModule=!0,e.Compiler=a,e.precompile=h,e.compile=u;function t(S){return S&&S.__esModule?S:{default:S}}var s=t(gt()),r=We(),i=t(Ki()),n=en(),o=[].slice;function a(){}a.prototype={compiler:a,equals:function(y){var m=this.opcodes.length;if(y.opcodes.length!==m)return!1;for(var _=0;_<m;_++){var k=this.opcodes[_],w=y.opcodes[_];if(k.opcode!==w.opcode||!v(k.args,w.args))return!1}m=this.children.length;for(var _=0;_<m;_++)if(!this.children[_].equals(y.children[_]))return!1;return!0},guid:0,compile:function(y,m){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=m,this.stringParams=m.stringParams,this.trackIds=m.trackIds,m.blockParams=m.blockParams||[],m.knownHelpers=r.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},m.knownHelpers),this.accept(y)},compileProgram:function(y){var m=new this.compiler().compile(y,this.options),_=this.guid++;return this.usePartial=this.usePartial||m.usePartial,this.children[_]=m,this.useDepths=this.useDepths||m.useDepths,_},accept:function(y){if(r.indexOf(n.NODE_TYPES,y.type)===-1||!this[y.type])throw new s.default("Unknown type: "+y.type,y);this.sourceNode.unshift(y);var m=this[y.type](y);return this.sourceNode.shift(),m},Program:function(y){g(y),this.options.blockParams.unshift(y.blockParams);for(var m=y.body,_=m.length,k=0;k<_;k++)this.accept(m[k]);return this.options.blockParams.shift(),this.isSimple=_===1,this.blockParams=y.blockParams?y.blockParams.length:0,this},BlockStatement:function(y){b(y);var m=y.program,_=y.inverse;m=m&&this.compileProgram(m),_=_&&this.compileProgram(_);var k=this.classifySexpr(y);k==="helper"?this.helperSexpr(y,m,_):k==="simple"?(this.simpleSexpr(y),this.opcode("pushProgram",m),this.opcode("pushProgram",_),this.opcode("emptyHash"),this.opcode("blockValue",y.path.original)):(this.ambiguousSexpr(y,m,_),this.opcode("pushProgram",m),this.opcode("pushProgram",_),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(y){var m=y.program&&this.compileProgram(y.program),_=this.setupFullMustacheParams(y,m,void 0),k=y.path;this.useDecorators=!0,this.opcode("registerDecorator",_.length,k.original)},PartialStatement:function(y){this.usePartial=!0;var m=y.program;m&&(m=this.compileProgram(y.program));var _=y.params;if(_.length>1)throw new s.default("Unsupported number of partial arguments: "+_.length,y);_.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):_.push({type:"PathExpression",parts:[],depth:0}));var k=y.name.original,w=y.name.type==="SubExpression";w&&this.accept(y.name),this.setupFullMustacheParams(y,m,void 0,!0);var A=y.indent||"";this.options.preventIndent&&A&&(this.opcode("appendContent",A),A=""),this.opcode("invokePartial",w,k,A),this.opcode("append")},PartialBlockStatement:function(y){this.PartialStatement(y)},MustacheStatement:function(y){this.SubExpression(y),y.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(y){this.DecoratorBlock(y)},ContentStatement:function(y){if(y.value!=null&&typeof y.value!="string")throw p(y,"value must be a string");y.value&&this.opcode("appendContent",y.value)},CommentStatement:function(){},SubExpression:function(y){b(y);var m=this.classifySexpr(y);m==="simple"?this.simpleSexpr(y):m==="helper"?this.helperSexpr(y):this.ambiguousSexpr(y)},ambiguousSexpr:function(y,m,_){var k=y.path,w=k.parts[0],A=m!=null||_!=null;this.opcode("getContext",c(k)),this.opcode("pushProgram",m),this.opcode("pushProgram",_),k.strict=!0,this.accept(k),this.opcode("invokeAmbiguous",w,A)},simpleSexpr:function(y){var m=y.path;m.strict=!0,this.accept(m),this.opcode("resolvePossibleLambda")},helperSexpr:function(y,m,_){var k=this.setupFullMustacheParams(y,m,_),w=y.path,A=w.parts[0];if(this.options.knownHelpers[A])this.opcode("invokeKnownHelper",k.length,A);else{if(this.options.knownHelpersOnly)throw new s.default("You specified knownHelpersOnly, but used the unknown helper "+A,y);w.strict=!0,w.falsy=!0,this.accept(w),this.opcode("invokeHelper",k.length,w.original,i.default.helpers.simpleId(w))}},PathExpression:function(y){var m=c(y),_=d(y);this.addDepth(m),this.opcode("getContext",m);var k=_[0],w=i.default.helpers.scopedId(y),A=!m&&!w&&this.blockParamIndex(k);A?this.opcode("lookupBlockParam",A,_):k?y.data?(this.options.data=!0,this.opcode("lookupData",m,_,y.strict)):this.opcode("lookupOnContext",_,y.falsy,y.strict,w):this.opcode("pushContext")},StringLiteral:function(y){f(y),this.opcode("pushString",y.value)},NumberLiteral:function(y){f(y),this.opcode("pushLiteral",y.value)},BooleanLiteral:function(y){f(y),this.opcode("pushLiteral",y.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(y){var m=y.pairs,_=0,k=void 0;if(!r.isArray(m))throw p(y,"pairs must be an array");k=m.length;for(var w=0;w<k;w++)if(!m[w]||typeof m[w].key!="string")throw p(y,"pair keys must be strings");for(this.opcode("pushHash");_<k;_++)this.pushParam(m[_].value);for(;_--;)this.opcode("assignToHash",m[_].key);this.opcode("popHash")},opcode:function(y){this.opcodes.push({opcode:y,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(y){y&&(this.useDepths=!0)},classifySexpr:function(y){d(y.path);var m=i.default.helpers.simpleId(y.path),_=m&&!!this.blockParamIndex(y.path.parts[0]),k=!_&&i.default.helpers.helperExpression(y),w=!_&&(k||m);if(w&&!k){var A=y.path.parts[0],O=this.options;O.knownHelpers[A]?k=!0:O.knownHelpersOnly&&(w=!1)}return k?"helper":w?"ambiguous":"simple"},pushParams:function(y){for(var m=0,_=y.length;m<_;m++)this.pushParam(y[m])},pushParam:function(y){f(y);var m=y.value!=null?y.value:y.original||"",_=c(y);if(this.stringParams)typeof m!="number"&&typeof m!="boolean"&&(m=String(m)),m.replace&&(m=m.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),_&&this.addDepth(_),this.opcode("getContext",_),this.opcode("pushStringParam",m,y.type),y.type==="SubExpression"&&this.accept(y);else{if(this.trackIds){var k=void 0;if(y.parts&&!i.default.helpers.scopedId(y)&&!_&&(k=this.blockParamIndex(d(y)[0])),k){var w=y.parts.slice(1).join(".");this.opcode("pushId","BlockParam",k,w)}else m=y.original||m,m.replace&&(m=m.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",y.type,m)}this.accept(y)}},setupFullMustacheParams:function(y,m,_,k){var w=y.params;return this.pushParams(w),this.opcode("pushProgram",m),this.opcode("pushProgram",_),y.hash?this.accept(y.hash):this.opcode("emptyHash",k),w},blockParamIndex:function(y){for(var m=0,_=this.options.blockParams.length;m<_;m++){var k=this.options.blockParams[m],w=k&&r.indexOf(k,y);if(k&&w>=0)return[m,w]}}};function h(S,y,m){if(S==null||typeof S!="string"&&S.type!=="Program")throw new s.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+S);y=y||{},"data"in y||(y.data=!0),y.compat&&(y.useDepths=!0);var _=m.parse(S,y),k=new m.Compiler().compile(_,y);return new m.JavaScriptCompiler().compile(k,y)}function u(S,y,m){if(y===void 0&&(y={}),S==null||typeof S!="string"&&S.type!=="Program")throw new s.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+S);y=r.extend({},y),"data"in y||(y.data=!0),y.compat&&(y.useDepths=!0);var _=void 0;function k(){var A=m.parse(S,y),O=new m.Compiler().compile(A,y),E=new m.JavaScriptCompiler().compile(O,y,void 0,!0);return m.template(E)}function w(A,O){return _||(_=k()),_.call(this,A,O)}return w._setup=function(A){return _||(_=k()),_._setup(A)},w._child=function(A,O,E,P){return _||(_=k()),_._child(A,O,E,P)},w}function p(S,y){return new s.default("Invalid AST: "+S.type+" "+y,S)}function c(S){var y=S.depth;if(y==null)return 0;if(typeof y!="number"||!isFinite(y)||Math.floor(y)!==y||y<0)throw p(S,"depth must be a non-negative integer");return y}function f(S){var y=S.value;if(S.type==="StringLiteral"&&typeof y!="string")throw p(S,"value must be a string");if(S.type==="NumberLiteral"&&typeof y!="number")throw p(S,"value must be a number");if(S.type==="BooleanLiteral"&&typeof y!="boolean")throw p(S,"value must be a boolean")}function l(S,y,m){if(!r.isArray(y))throw p(S,m+" must be an array");for(var _=0;_<y.length;_++)if(typeof y[_]!="string")throw p(S,m+" must only contain strings");return y}function d(S){return l(S,S.parts,"parts")}function g(S){S.blockParams!=null&&l(S,S.blockParams,"blockParams")}function v(S,y){if(S===y)return!0;if(r.isArray(S)&&r.isArray(y)&&S.length===y.length){for(var m=0;m<S.length;m++)if(!v(S[m],y[m]))return!1;return!0}}function b(S){if(!S.path.parts){var y=S.path;S.path={type:"PathExpression",data:!1,depth:0,parts:[y.original+""],original:y.original+"",loc:y.loc}}}})),_l=he((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(s){if(0<=s&&s<t.length)return t[s];throw new TypeError("Must be between 0 and 63: "+s)},e.decode=function(s){var r=65,i=90,n=97,o=122,a=48,h=57,u=43,p=47,c=26,f=52;return r<=s&&s<=i?s-r:n<=s&&s<=o?s-n+c:a<=s&&s<=h?s-a+f:s==u?62:s==p?63:-1}})),sn=he((e=>{var t=_l(),s=5,r=1<<s,i=r-1,n=r;function o(h){return h<0?(-h<<1)+1:(h<<1)+0}function a(h){var u=(h&1)===1,p=h>>1;return u?-p:p}e.encode=function(u){var p="",c,f=o(u);do c=f&i,f>>>=s,f>0&&(c|=n),p+=t.encode(c);while(f>0);return p},e.decode=function(u,p,c){var f=u.length,l=0,d=0,g,v;do{if(p>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(v=t.decode(u.charCodeAt(p++)),v===-1)throw new Error("Invalid base64 digit: "+u.charAt(p-1));g=!!(v&n),v&=i,l=l+(v<<d),d+=s}while(g);c.value=a(l),c.rest=p}})),fs=he((e=>{function t(m,_,k){if(_ in m)return m[_];if(arguments.length===3)return k;throw new Error('"'+_+'" is a required argument.')}e.getArg=t;var s=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function i(m){var _=m.match(s);return _?{scheme:_[1],auth:_[2],host:_[3],port:_[4],path:_[5]}:null}e.urlParse=i;function n(m){var _="";return m.scheme&&(_+=m.scheme+":"),_+="//",m.auth&&(_+=m.auth+"@"),m.host&&(_+=m.host),m.port&&(_+=":"+m.port),m.path&&(_+=m.path),_}e.urlGenerate=n;function o(m){var _=m,k=i(m);if(k){if(!k.path)return m;_=k.path}for(var w=e.isAbsolute(_),A=_.split(/\/+/),O,E=0,P=A.length-1;P>=0;P--)O=A[P],O==="."?A.splice(P,1):O===".."?E++:E>0&&(O===""?(A.splice(P+1,E),E=0):(A.splice(P,2),E--));return _=A.join("/"),_===""&&(_=w?"/":"."),k?(k.path=_,n(k)):_}e.normalize=o;function a(m,_){m===""&&(m="."),_===""&&(_=".");var k=i(_),w=i(m);if(w&&(m=w.path||"/"),k&&!k.scheme)return w&&(k.scheme=w.scheme),n(k);if(k||_.match(r))return _;if(w&&!w.host&&!w.path)return w.host=_,n(w);var A=_.charAt(0)==="/"?_:o(m.replace(/\/+$/,"")+"/"+_);return w?(w.path=A,n(w)):A}e.join=a,e.isAbsolute=function(m){return m.charAt(0)==="/"||s.test(m)};function h(m,_){m===""&&(m="."),m=m.replace(/\/$/,"");for(var k=0;_.indexOf(m+"/")!==0;){var w=m.lastIndexOf("/");if(w<0||(m=m.slice(0,w),m.match(/^([^\/]+:\/)?\/*$/)))return _;++k}return Array(k+1).join("../")+_.substr(m.length+1)}e.relative=h;var u=(function(){return!("__proto__"in Object.create(null))})();function p(m){return m}function c(m){return l(m)?"$"+m:m}e.toSetString=u?p:c;function f(m){return l(m)?m.slice(1):m}e.fromSetString=u?p:f;function l(m){if(!m)return!1;var _=m.length;if(_<9||m.charCodeAt(_-1)!==95||m.charCodeAt(_-2)!==95||m.charCodeAt(_-3)!==111||m.charCodeAt(_-4)!==116||m.charCodeAt(_-5)!==111||m.charCodeAt(_-6)!==114||m.charCodeAt(_-7)!==112||m.charCodeAt(_-8)!==95||m.charCodeAt(_-9)!==95)return!1;for(var k=_-10;k>=0;k--)if(m.charCodeAt(k)!==36)return!1;return!0}function d(m,_,k){var w=v(m.source,_.source);return w!==0||(w=m.originalLine-_.originalLine,w!==0)||(w=m.originalColumn-_.originalColumn,w!==0||k)||(w=m.generatedColumn-_.generatedColumn,w!==0)||(w=m.generatedLine-_.generatedLine,w!==0)?w:v(m.name,_.name)}e.compareByOriginalPositions=d;function g(m,_,k){var w=m.generatedLine-_.generatedLine;return w!==0||(w=m.generatedColumn-_.generatedColumn,w!==0||k)||(w=v(m.source,_.source),w!==0)||(w=m.originalLine-_.originalLine,w!==0)||(w=m.originalColumn-_.originalColumn,w!==0)?w:v(m.name,_.name)}e.compareByGeneratedPositionsDeflated=g;function v(m,_){return m===_?0:m===null?1:_===null?-1:m>_?1:-1}function b(m,_){var k=m.generatedLine-_.generatedLine;return k!==0||(k=m.generatedColumn-_.generatedColumn,k!==0)||(k=v(m.source,_.source),k!==0)||(k=m.originalLine-_.originalLine,k!==0)||(k=m.originalColumn-_.originalColumn,k!==0)?k:v(m.name,_.name)}e.compareByGeneratedPositionsInflated=b;function S(m){return JSON.parse(m.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=S;function y(m,_,k){if(_=_||"",m&&(m[m.length-1]!=="/"&&_[0]!=="/"&&(m+="/"),_=m+_),k){var w=i(k);if(!w)throw new Error("sourceMapURL could not be parsed");if(w.path){var A=w.path.lastIndexOf("/");A>=0&&(w.path=w.path.substring(0,A+1))}_=a(n(w),_)}return o(_)}e.computeSourceURL=y})),rn=he((e=>{var t=fs(),s=Object.prototype.hasOwnProperty,r=typeof Map<"u";function i(){this._array=[],this._set=r?new Map:Object.create(null)}i.fromArray=function(o,a){for(var h=new i,u=0,p=o.length;u<p;u++)h.add(o[u],a);return h},i.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(o,a){var h=r?o:t.toSetString(o),u=r?this.has(o):s.call(this._set,h),p=this._array.length;(!u||a)&&this._array.push(o),u||(r?this._set.set(o,p):this._set[h]=p)},i.prototype.has=function(o){if(r)return this._set.has(o);var a=t.toSetString(o);return s.call(this._set,a)},i.prototype.indexOf=function(o){if(r){var a=this._set.get(o);if(a>=0)return a}else{var h=t.toSetString(o);if(s.call(this._set,h))return this._set[h]}throw new Error('"'+o+'" is not in the set.')},i.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)},i.prototype.toArray=function(){return this._array.slice()},e.ArraySet=i})),Sl=he((e=>{var t=fs();function s(i,n){var o=i.generatedLine,a=n.generatedLine,h=i.generatedColumn,u=n.generatedColumn;return a>o||a==o&&u>=h||t.compareByGeneratedPositionsInflated(i,n)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(n,o){this._array.forEach(n,o)},r.prototype.add=function(n){s(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),nn=he((e=>{var t=sn(),s=fs(),r=rn().ArraySet,i=Sl().MappingList;function n(o){o||(o={}),this._file=s.getArg(o,"file",null),this._sourceRoot=s.getArg(o,"sourceRoot",null),this._skipValidation=s.getArg(o,"skipValidation",!1),this._sources=new r,this._names=new r,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(a){var h=a.sourceRoot,u=new n({file:a.file,sourceRoot:h});return a.eachMapping(function(p){var c={generated:{line:p.generatedLine,column:p.generatedColumn}};p.source!=null&&(c.source=p.source,h!=null&&(c.source=s.relative(h,c.source)),c.original={line:p.originalLine,column:p.originalColumn},p.name!=null&&(c.name=p.name)),u.addMapping(c)}),a.sources.forEach(function(p){var c=p;h!==null&&(c=s.relative(h,p)),u._sources.has(c)||u._sources.add(c);var f=a.sourceContentFor(p);f!=null&&u.setSourceContent(p,f)}),u},n.prototype.addMapping=function(a){var h=s.getArg(a,"generated"),u=s.getArg(a,"original",null),p=s.getArg(a,"source",null),c=s.getArg(a,"name",null);this._skipValidation||this._validateMapping(h,u,p,c),p!=null&&(p=String(p),this._sources.has(p)||this._sources.add(p)),c!=null&&(c=String(c),this._names.has(c)||this._names.add(c)),this._mappings.add({generatedLine:h.line,generatedColumn:h.column,originalLine:u!=null&&u.line,originalColumn:u!=null&&u.column,source:p,name:c})},n.prototype.setSourceContent=function(a,h){var u=a;this._sourceRoot!=null&&(u=s.relative(this._sourceRoot,u)),h!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[s.toSetString(u)]=h):this._sourcesContents&&(delete this._sourcesContents[s.toSetString(u)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(a,h,u){var p=h;if(h==null){if(a.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);p=a.file}var c=this._sourceRoot;c!=null&&(p=s.relative(c,p));var f=new r,l=new r;this._mappings.unsortedForEach(function(d){if(d.source===p&&d.originalLine!=null){var g=a.originalPositionFor({line:d.originalLine,column:d.originalColumn});g.source!=null&&(d.source=g.source,u!=null&&(d.source=s.join(u,d.source)),c!=null&&(d.source=s.relative(c,d.source)),d.originalLine=g.line,d.originalColumn=g.column,g.name!=null&&(d.name=g.name))}var v=d.source;v!=null&&!f.has(v)&&f.add(v);var b=d.name;b!=null&&!l.has(b)&&l.add(b)},this),this._sources=f,this._names=l,a.sources.forEach(function(d){var g=a.sourceContentFor(d);g!=null&&(u!=null&&(d=s.join(u,d)),c!=null&&(d=s.relative(c,d)),this.setSourceContent(d,g))},this)},n.prototype._validateMapping=function(a,h,u,p){if(h&&typeof h.line!="number"&&typeof h.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(a&&"line"in a&&"column"in a&&a.line>0&&a.column>=0&&!h&&!u&&!p)){if(a&&"line"in a&&"column"in a&&h&&"line"in h&&"column"in h&&a.line>0&&a.column>=0&&h.line>0&&h.column>=0&&u)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:a,source:u,original:h,name:p}))}},n.prototype._serializeMappings=function(){for(var a=0,h=1,u=0,p=0,c=0,f=0,l="",d,g,v,b,S=this._mappings.toArray(),y=0,m=S.length;y<m;y++){if(g=S[y],d="",g.generatedLine!==h)for(a=0;g.generatedLine!==h;)d+=";",h++;else if(y>0){if(!s.compareByGeneratedPositionsInflated(g,S[y-1]))continue;d+=","}d+=t.encode(g.generatedColumn-a),a=g.generatedColumn,g.source!=null&&(b=this._sources.indexOf(g.source),d+=t.encode(b-f),f=b,d+=t.encode(g.originalLine-1-p),p=g.originalLine-1,d+=t.encode(g.originalColumn-u),u=g.originalColumn,g.name!=null&&(v=this._names.indexOf(g.name),d+=t.encode(v-c),c=v)),l+=d}return l},n.prototype._generateSourcesContent=function(a,h){return a.map(function(u){if(!this._sourcesContents)return null;h!=null&&(u=s.relative(h,u));var p=s.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,p)?this._sourcesContents[p]:null},this)},n.prototype.toJSON=function(){var a={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(a.file=this._file),this._sourceRoot!=null&&(a.sourceRoot=this._sourceRoot),this._sourcesContents&&(a.sourcesContent=this._generateSourcesContent(a.sources,a.sourceRoot)),a},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=n})),kl=he((e=>{e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(s,r,i,n,o,a){var h=Math.floor((r-s)/2)+s,u=o(i,n[h],!0);return u===0?h:u>0?r-h>1?t(h,r,i,n,o,a):a==e.LEAST_UPPER_BOUND?r<n.length?r:-1:h:h-s>1?t(s,h,i,n,o,a):a==e.LEAST_UPPER_BOUND?h:s<0?-1:s}e.search=function(r,i,n,o){if(i.length===0)return-1;var a=t(-1,i.length,r,i,n,o||e.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&n(i[a],i[a-1],!0)===0;)--a;return a}})),wl=he((e=>{function t(i,n,o){var a=i[n];i[n]=i[o],i[o]=a}function s(i,n){return Math.round(i+Math.random()*(n-i))}function r(i,n,o,a){if(o<a){var h=s(o,a),u=o-1;t(i,h,a);for(var p=i[a],c=o;c<a;c++)n(i[c],p)<=0&&(u+=1,t(i,u,c));t(i,u+1,c);var f=u+1;r(i,n,o,f-1),r(i,n,f+1,a)}}e.quickSort=function(i,n){r(i,n,0,i.length-1)}})),xl=he((e=>{var t=fs(),s=kl(),r=rn().ArraySet,i=sn(),n=wl().quickSort;function o(p,c){var f=p;return typeof p=="string"&&(f=t.parseSourceMapInput(p)),f.sections!=null?new u(f,c):new a(f,c)}o.fromSourceMap=function(p,c){return a.fromSourceMap(p,c)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(c,f){var l=c.charAt(f);return l===";"||l===","},o.prototype._parseMappings=function(c,f){throw new Error("Subclasses must implement _parseMappings")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(c,f,l){var d=f||null,g=l||o.GENERATED_ORDER,v;switch(g){case o.GENERATED_ORDER:v=this._generatedMappings;break;case o.ORIGINAL_ORDER:v=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var b=this.sourceRoot;v.map(function(S){var y=S.source===null?null:this._sources.at(S.source);return y=t.computeSourceURL(b,y,this._sourceMapURL),{source:y,generatedLine:S.generatedLine,generatedColumn:S.generatedColumn,originalLine:S.originalLine,originalColumn:S.originalColumn,name:S.name===null?null:this._names.at(S.name)}},this).forEach(c,d)},o.prototype.allGeneratedPositionsFor=function(c){var f=t.getArg(c,"line"),l={source:t.getArg(c,"source"),originalLine:f,originalColumn:t.getArg(c,"column",0)};if(l.source=this._findSourceIndex(l.source),l.source<0)return[];var d=[],g=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,s.LEAST_UPPER_BOUND);if(g>=0){var v=this._originalMappings[g];if(c.column===void 0)for(var b=v.originalLine;v&&v.originalLine===b;)d.push({line:t.getArg(v,"generatedLine",null),column:t.getArg(v,"generatedColumn",null),lastColumn:t.getArg(v,"lastGeneratedColumn",null)}),v=this._originalMappings[++g];else for(var S=v.originalColumn;v&&v.originalLine===f&&v.originalColumn==S;)d.push({line:t.getArg(v,"generatedLine",null),column:t.getArg(v,"generatedColumn",null),lastColumn:t.getArg(v,"lastGeneratedColumn",null)}),v=this._originalMappings[++g]}return d},e.SourceMapConsumer=o;function a(p,c){var f=p;typeof p=="string"&&(f=t.parseSourceMapInput(p));var l=t.getArg(f,"version"),d=t.getArg(f,"sources"),g=t.getArg(f,"names",[]),v=t.getArg(f,"sourceRoot",null),b=t.getArg(f,"sourcesContent",null),S=t.getArg(f,"mappings"),y=t.getArg(f,"file",null);if(l!=this._version)throw new Error("Unsupported version: "+l);v&&(v=t.normalize(v)),d=d.map(String).map(t.normalize).map(function(m){return v&&t.isAbsolute(v)&&t.isAbsolute(m)?t.relative(v,m):m}),this._names=r.fromArray(g.map(String),!0),this._sources=r.fromArray(d,!0),this._absoluteSources=this._sources.toArray().map(function(m){return t.computeSourceURL(v,m,c)}),this.sourceRoot=v,this.sourcesContent=b,this._mappings=S,this._sourceMapURL=c,this.file=y}a.prototype=Object.create(o.prototype),a.prototype.consumer=o,a.prototype._findSourceIndex=function(p){var c=p;if(this.sourceRoot!=null&&(c=t.relative(this.sourceRoot,c)),this._sources.has(c))return this._sources.indexOf(c);for(var f=0;f<this._absoluteSources.length;++f)if(this._absoluteSources[f]==p)return f;return-1},a.fromSourceMap=function(c,f){var l=Object.create(a.prototype),d=l._names=r.fromArray(c._names.toArray(),!0),g=l._sources=r.fromArray(c._sources.toArray(),!0);l.sourceRoot=c._sourceRoot,l.sourcesContent=c._generateSourcesContent(l._sources.toArray(),l.sourceRoot),l.file=c._file,l._sourceMapURL=f,l._absoluteSources=l._sources.toArray().map(function(w){return t.computeSourceURL(l.sourceRoot,w,f)});for(var v=c._mappings.toArray().slice(),b=l.__generatedMappings=[],S=l.__originalMappings=[],y=0,m=v.length;y<m;y++){var _=v[y],k=new h;k.generatedLine=_.generatedLine,k.generatedColumn=_.generatedColumn,_.source&&(k.source=g.indexOf(_.source),k.originalLine=_.originalLine,k.originalColumn=_.originalColumn,_.name&&(k.name=d.indexOf(_.name)),S.push(k)),b.push(k)}return n(l.__originalMappings,t.compareByOriginalPositions),l},a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function h(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}a.prototype._parseMappings=function(c,f){for(var l=1,d=0,g=0,v=0,b=0,S=0,y=c.length,m=0,_={},k={},w=[],A=[],O,E,P,C,$;m<y;)if(c.charAt(m)===";")l++,m++,d=0;else if(c.charAt(m)===",")m++;else{for(O=new h,O.generatedLine=l,C=m;C<y&&!this._charIsMappingSeparator(c,C);C++);if(E=c.slice(m,C),P=_[E],P)m+=E.length;else{for(P=[];m<C;)i.decode(c,m,k),$=k.value,m=k.rest,P.push($);if(P.length===2)throw new Error("Found a source, but no line and column");if(P.length===3)throw new Error("Found a source and line, but no column");_[E]=P}O.generatedColumn=d+P[0],d=O.generatedColumn,P.length>1&&(O.source=b+P[1],b+=P[1],O.originalLine=g+P[2],g=O.originalLine,O.originalLine+=1,O.originalColumn=v+P[3],v=O.originalColumn,P.length>4&&(O.name=S+P[4],S+=P[4])),A.push(O),typeof O.originalLine=="number"&&w.push(O)}n(A,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,n(w,t.compareByOriginalPositions),this.__originalMappings=w},a.prototype._findMapping=function(c,f,l,d,g,v){if(c[l]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+c[l]);if(c[d]<0)throw new TypeError("Column must be greater than or equal to 0, got "+c[d]);return s.search(c,f,g,v)},a.prototype.computeColumnSpans=function(){for(var c=0;c<this._generatedMappings.length;++c){var f=this._generatedMappings[c];if(c+1<this._generatedMappings.length){var l=this._generatedMappings[c+1];if(f.generatedLine===l.generatedLine){f.lastGeneratedColumn=l.generatedColumn-1;continue}}f.lastGeneratedColumn=1/0}},a.prototype.originalPositionFor=function(c){var f={generatedLine:t.getArg(c,"line"),generatedColumn:t.getArg(c,"column")},l=this._findMapping(f,this._generatedMappings,"generatedLine","generatedColumn",t.compareByGeneratedPositionsDeflated,t.getArg(c,"bias",o.GREATEST_LOWER_BOUND));if(l>=0){var d=this._generatedMappings[l];if(d.generatedLine===f.generatedLine){var g=t.getArg(d,"source",null);g!==null&&(g=this._sources.at(g),g=t.computeSourceURL(this.sourceRoot,g,this._sourceMapURL));var v=t.getArg(d,"name",null);return v!==null&&(v=this._names.at(v)),{source:g,line:t.getArg(d,"originalLine",null),column:t.getArg(d,"originalColumn",null),name:v}}}return{source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(c){return c==null}):!1},a.prototype.sourceContentFor=function(c,f){if(!this.sourcesContent)return null;var l=this._findSourceIndex(c);if(l>=0)return this.sourcesContent[l];var d=c;this.sourceRoot!=null&&(d=t.relative(this.sourceRoot,d));var g;if(this.sourceRoot!=null&&(g=t.urlParse(this.sourceRoot))){var v=d.replace(/^file:\/\//,"");if(g.scheme=="file"&&this._sources.has(v))return this.sourcesContent[this._sources.indexOf(v)];if((!g.path||g.path=="/")&&this._sources.has("/"+d))return this.sourcesContent[this._sources.indexOf("/"+d)]}if(f)return null;throw new Error('"'+d+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(c){var f=t.getArg(c,"source");if(f=this._findSourceIndex(f),f<0)return{line:null,column:null,lastColumn:null};var l={source:f,originalLine:t.getArg(c,"line"),originalColumn:t.getArg(c,"column")},d=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,t.getArg(c,"bias",o.GREATEST_LOWER_BOUND));if(d>=0){var g=this._originalMappings[d];if(g.source===l.source)return{line:t.getArg(g,"generatedLine",null),column:t.getArg(g,"generatedColumn",null),lastColumn:t.getArg(g,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},e.BasicSourceMapConsumer=a;function u(p,c){var f=p;typeof p=="string"&&(f=t.parseSourceMapInput(p));var l=t.getArg(f,"version"),d=t.getArg(f,"sections");if(l!=this._version)throw new Error("Unsupported version: "+l);this._sources=new r,this._names=new r;var g={line:-1,column:0};this._sections=d.map(function(v){if(v.url)throw new Error("Support for url field in sections not implemented.");var b=t.getArg(v,"offset"),S=t.getArg(b,"line"),y=t.getArg(b,"column");if(S<g.line||S===g.line&&y<g.column)throw new Error("Section offsets must be ordered and non-overlapping.");return g=b,{generatedOffset:{generatedLine:S+1,generatedColumn:y+1},consumer:new o(t.getArg(v,"map"),c)}})}u.prototype=Object.create(o.prototype),u.prototype.constructor=o,u.prototype._version=3,Object.defineProperty(u.prototype,"sources",{get:function(){for(var p=[],c=0;c<this._sections.length;c++)for(var f=0;f<this._sections[c].consumer.sources.length;f++)p.push(this._sections[c].consumer.sources[f]);return p}}),u.prototype.originalPositionFor=function(c){var f={generatedLine:t.getArg(c,"line"),generatedColumn:t.getArg(c,"column")},l=s.search(f,this._sections,function(g,v){var b=g.generatedLine-v.generatedOffset.generatedLine;return b||g.generatedColumn-v.generatedOffset.generatedColumn}),d=this._sections[l];return d?d.consumer.originalPositionFor({line:f.generatedLine-(d.generatedOffset.generatedLine-1),column:f.generatedColumn-(d.generatedOffset.generatedLine===f.generatedLine?d.generatedOffset.generatedColumn-1:0),bias:c.bias}):{source:null,line:null,column:null,name:null}},u.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(c){return c.consumer.hasContentsOfAllSources()})},u.prototype.sourceContentFor=function(c,f){for(var l=0;l<this._sections.length;l++){var d=this._sections[l].consumer.sourceContentFor(c,!0);if(d)return d}if(f)return null;throw new Error('"'+c+'" is not in the SourceMap.')},u.prototype.generatedPositionFor=function(c){for(var f=0;f<this._sections.length;f++){var l=this._sections[f];if(l.consumer._findSourceIndex(t.getArg(c,"source"))!==-1){var d=l.consumer.generatedPositionFor(c);if(d)return{line:d.line+(l.generatedOffset.generatedLine-1),column:d.column+(l.generatedOffset.generatedLine===d.line?l.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},u.prototype._parseMappings=function(c,f){this.__generatedMappings=[],this.__originalMappings=[];for(var l=0;l<this._sections.length;l++)for(var d=this._sections[l],g=d.consumer._generatedMappings,v=0;v<g.length;v++){var b=g[v],S=d.consumer._sources.at(b.source);S=t.computeSourceURL(d.consumer.sourceRoot,S,this._sourceMapURL),this._sources.add(S),S=this._sources.indexOf(S);var y=null;b.name&&(y=d.consumer._names.at(b.name),this._names.add(y),y=this._names.indexOf(y));var m={source:S,generatedLine:b.generatedLine+(d.generatedOffset.generatedLine-1),generatedColumn:b.generatedColumn+(d.generatedOffset.generatedLine===b.generatedLine?d.generatedOffset.generatedColumn-1:0),originalLine:b.originalLine,originalColumn:b.originalColumn,name:y};this.__generatedMappings.push(m),typeof m.originalLine=="number"&&this.__originalMappings.push(m)}n(this.__generatedMappings,t.compareByGeneratedPositionsDeflated),n(this.__originalMappings,t.compareByOriginalPositions)},e.IndexedSourceMapConsumer=u})),Tl=he((e=>{var t=nn().SourceMapGenerator,s=fs(),r=/(\r?\n)/,i=10,n="$$$isSourceNode$$$";function o(a,h,u,p,c){this.children=[],this.sourceContents={},this.line=a??null,this.column=h??null,this.source=u??null,this.name=c??null,this[n]=!0,p!=null&&this.add(p)}o.fromStringWithSourceMap=function(h,u,p){var c=new o,f=h.split(r),l=0,d=function(){return y()+(y()||"");function y(){return l<f.length?f[l++]:void 0}},g=1,v=0,b=null;return u.eachMapping(function(y){if(b!==null)if(g<y.generatedLine)S(b,d()),g++,v=0;else{var m=f[l]||"",_=m.substr(0,y.generatedColumn-v);f[l]=m.substr(y.generatedColumn-v),v=y.generatedColumn,S(b,_),b=y;return}for(;g<y.generatedLine;)c.add(d()),g++;if(v<y.generatedColumn){var m=f[l]||"";c.add(m.substr(0,y.generatedColumn)),f[l]=m.substr(y.generatedColumn),v=y.generatedColumn}b=y},this),l<f.length&&(b&&S(b,d()),c.add(f.splice(l).join(""))),u.sources.forEach(function(y){var m=u.sourceContentFor(y);m!=null&&(p!=null&&(y=s.join(p,y)),c.setSourceContent(y,m))}),c;function S(y,m){if(y===null||y.source===void 0)c.add(m);else{var _=p?s.join(p,y.source):y.source;c.add(new o(y.originalLine,y.originalColumn,_,m,y.name))}}},o.prototype.add=function(h){if(Array.isArray(h))h.forEach(function(u){this.add(u)},this);else if(h[n]||typeof h=="string")h&&this.children.push(h);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+h);return this},o.prototype.prepend=function(h){if(Array.isArray(h))for(var u=h.length-1;u>=0;u--)this.prepend(h[u]);else if(h[n]||typeof h=="string")this.children.unshift(h);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+h);return this},o.prototype.walk=function(h){for(var u,p=0,c=this.children.length;p<c;p++)u=this.children[p],u[n]?u.walk(h):u!==""&&h(u,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(h){var u,p,c=this.children.length;if(c>0){for(u=[],p=0;p<c-1;p++)u.push(this.children[p]),u.push(h);u.push(this.children[p]),this.children=u}return this},o.prototype.replaceRight=function(h,u){var p=this.children[this.children.length-1];return p[n]?p.replaceRight(h,u):typeof p=="string"?this.children[this.children.length-1]=p.replace(h,u):this.children.push("".replace(h,u)),this},o.prototype.setSourceContent=function(h,u){this.sourceContents[s.toSetString(h)]=u},o.prototype.walkSourceContents=function(h){for(var u=0,p=this.children.length;u<p;u++)this.children[u][n]&&this.children[u].walkSourceContents(h);for(var c=Object.keys(this.sourceContents),u=0,p=c.length;u<p;u++)h(s.fromSetString(c[u]),this.sourceContents[c[u]])},o.prototype.toString=function(){var h="";return this.walk(function(u){h+=u}),h},o.prototype.toStringWithSourceMap=function(h){var u={code:"",line:1,column:0},p=new t(h),c=!1,f=null,l=null,d=null,g=null;return this.walk(function(v,b){u.code+=v,b.source!==null&&b.line!==null&&b.column!==null?((f!==b.source||l!==b.line||d!==b.column||g!==b.name)&&p.addMapping({source:b.source,original:{line:b.line,column:b.column},generated:{line:u.line,column:u.column},name:b.name}),f=b.source,l=b.line,d=b.column,g=b.name,c=!0):c&&(p.addMapping({generated:{line:u.line,column:u.column}}),f=null,c=!1);for(var S=0,y=v.length;S<y;S++)v.charCodeAt(S)===i?(u.line++,u.column=0,S+1===y?(f=null,c=!1):c&&p.addMapping({source:b.source,original:{line:b.line,column:b.column},generated:{line:u.line,column:u.column},name:b.name})):u.column++}),this.walkSourceContents(function(v,b){p.setSourceContent(v,b)}),{code:u.code,map:p}},e.SourceNode=o})),Cl=he((e=>{e.SourceMapGenerator=nn().SourceMapGenerator,e.SourceMapConsumer=xl().SourceMapConsumer,e.SourceNode=Tl().SourceNode})),Pl=he((e=>{e.__esModule=!0,e.safeJsonLiteral=o;var t=We(),s=/[\x00-\x1f\\"\u2028\u2029<\ud800-\udfff]/,r=/<(?=!--|\/?script)/gi;function i(p){return p.replace(r,"\\u003C")}function n(p){return"\\u"+p.charCodeAt(0).toString(16)}function o(p){return i(JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/[\ud800-\udfff]/g,n))}var a=void 0;try{(typeof define!="function"||!define.amd)&&(a=Cl().SourceNode)}catch{}a||(a=function(p,c,f,l){this.src="",l&&this.add(l)},a.prototype={add:function(c){t.isArray(c)&&(c=c.join("")),this.src+=c},prepend:function(c){t.isArray(c)&&(c=c.join("")),this.src=c+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function h(p,c,f){if(t.isArray(p)){for(var l=[],d=0,g=p.length;d<g;d++)l.push(c.wrap(p[d],f));return l}else if(typeof p=="boolean"||typeof p=="number")return p+"";return p}function u(p){this.srcFile=p,this.source=[]}u.prototype={isEmpty:function(){return!this.source.length},prepend:function(c,f){this.source.unshift(this.wrap(c,f))},push:function(c,f){this.source.push(this.wrap(c,f))},merge:function(){var c=this.empty();return this.each(function(f){c.add([" ",f,`
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
236
|
+
/* Text effects for {{#style}} (#453), e.g. {{#style "shudder"}}...{{/style}} */
|
|
237
|
+
span.squiffy-style:is(.shake, .shudder, .rumble, .sway, .buoy, .mirror, .upside-down, .tall, .flat) {
|
|
238
|
+
/* Transforms don't apply to inline elements */
|
|
239
|
+
display: inline-block;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.squiffy-style.shake {
|
|
243
|
+
animation: squiffy-shake 0.4s ease-in-out infinite;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@keyframes squiffy-shake {
|
|
247
|
+
0%, 100% { transform: translateX(0); }
|
|
248
|
+
25% { transform: translateX(-3px); }
|
|
249
|
+
75% { transform: translateX(3px); }
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.squiffy-style.shudder {
|
|
253
|
+
animation: squiffy-shudder 0.1s linear infinite alternate;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@keyframes squiffy-shudder {
|
|
257
|
+
from { transform: translateX(-1px); }
|
|
258
|
+
to { transform: translateX(1px); }
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.squiffy-style.rumble {
|
|
262
|
+
animation: squiffy-rumble 0.1s linear infinite alternate;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@keyframes squiffy-rumble {
|
|
266
|
+
from { transform: translateY(-1px); }
|
|
267
|
+
to { transform: translateY(1px); }
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.squiffy-style.sway {
|
|
271
|
+
animation: squiffy-sway 2.5s ease-in-out infinite;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
@keyframes squiffy-sway {
|
|
275
|
+
0%, 100% { transform: rotate(-3deg); }
|
|
276
|
+
50% { transform: rotate(3deg); }
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.squiffy-style.buoy {
|
|
280
|
+
animation: squiffy-buoy 2.5s ease-in-out infinite;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@keyframes squiffy-buoy {
|
|
284
|
+
0%, 100% { transform: translateY(0); }
|
|
285
|
+
50% { transform: translateY(-0.25em); }
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.squiffy-style.pulse {
|
|
289
|
+
animation: squiffy-pulse 1.5s ease-in-out infinite;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.squiffy-style.fade-in-out {
|
|
293
|
+
animation: squiffy-fade-in-out 3s ease-in-out infinite;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
@keyframes squiffy-fade-in-out {
|
|
297
|
+
0%, 100% { opacity: 1; }
|
|
298
|
+
50% { opacity: 0; }
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.squiffy-style.blink {
|
|
302
|
+
animation: squiffy-blink 1s step-end infinite;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@keyframes squiffy-blink {
|
|
306
|
+
50% { opacity: 0; }
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.squiffy-style.flicker {
|
|
310
|
+
animation: squiffy-flicker 3s linear infinite;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
@keyframes squiffy-flicker {
|
|
314
|
+
0%, 19%, 21%, 23%, 54%, 56%, 100% { opacity: 1; }
|
|
315
|
+
20%, 22%, 55% { opacity: 0.2; }
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.squiffy-style.blur {
|
|
319
|
+
filter: blur(1px);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.squiffy-style.blurrier {
|
|
323
|
+
filter: blur(3px);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.squiffy-style.smear {
|
|
327
|
+
text-shadow: 0.15em 0 0.1em color-mix(in srgb, currentColor 50%, transparent), 0.3em 0 0.15em color-mix(in srgb, currentColor 25%, transparent);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.squiffy-style.mirror {
|
|
331
|
+
transform: scaleX(-1);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.squiffy-style.upside-down {
|
|
335
|
+
transform: scaleY(-1);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/* The typographic effects, which don't move (#541) */
|
|
339
|
+
.squiffy-style.shadow {
|
|
340
|
+
text-shadow: 0.08em 0.08em 0.08em color-mix(in srgb, currentColor 50%, transparent);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/* A dimmed face, lit from the top left and shadowed at the bottom right */
|
|
344
|
+
.squiffy-style.emboss {
|
|
345
|
+
color: color-mix(in srgb, currentColor 35%, var(--squiffy-background));
|
|
346
|
+
text-shadow: -1px -1px 0 color-mix(in srgb, var(--squiffy-text) 80%, white),
|
|
347
|
+
1px 1px 0 color-mix(in srgb, var(--squiffy-background) 40%, black);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.squiffy-style.outline {
|
|
351
|
+
color: var(--squiffy-background);
|
|
352
|
+
text-shadow: -1px -1px 0 var(--squiffy-text), 1px -1px 0 var(--squiffy-text),
|
|
353
|
+
-1px 1px 0 var(--squiffy-text), 1px 1px 0 var(--squiffy-text);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.squiffy-style.condense {
|
|
357
|
+
letter-spacing: -0.08em;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.squiffy-style.expand {
|
|
361
|
+
letter-spacing: 0.1em;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.squiffy-style.tall {
|
|
365
|
+
transform: scaleY(1.5);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.squiffy-style.flat {
|
|
369
|
+
transform: scaleY(0.5);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.squiffy-style.double-underline {
|
|
373
|
+
text-decoration: underline double;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.squiffy-style.wavy-underline {
|
|
377
|
+
text-decoration: underline wavy;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.squiffy-style.double-strike {
|
|
381
|
+
text-decoration: line-through double;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.squiffy-style.wavy-strike {
|
|
385
|
+
text-decoration: line-through wavy;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* Transitions for how a section or passage appears (#489), from @transition. The element has
|
|
389
|
+
squiffy-transition and the transition's name as classes while it plays, and @transition's
|
|
390
|
+
time in --squiffy-transition-time. @leave plays them backwards, with squiffy-leave too, except
|
|
391
|
+
the slides, which leave the way they're named. A story's stylesheet can add its own, e.g.
|
|
392
|
+
.squiffy-transition.swirl { animation-name: swirl; } */
|
|
393
|
+
.squiffy-transition {
|
|
394
|
+
animation-duration: var(--squiffy-transition-time, 0.5s);
|
|
395
|
+
animation-timing-function: ease-out;
|
|
396
|
+
animation-fill-mode: both;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.squiffy-transition:is(.fade, .dissolve) {
|
|
400
|
+
animation-name: squiffy-transition-fade;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
@keyframes squiffy-transition-fade {
|
|
404
|
+
from { opacity: 0; }
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* The slides move by --squiffy-slide-distance, e.g. 100% to slide all the way off and on */
|
|
408
|
+
@keyframes squiffy-transition-from-below {
|
|
409
|
+
from { opacity: 0; transform: translateY(var(--squiffy-slide-distance, 2em)); }
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
@keyframes squiffy-transition-from-above {
|
|
413
|
+
from { opacity: 0; transform: translateY(calc(-1 * var(--squiffy-slide-distance, 2em))); }
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
@keyframes squiffy-transition-from-right {
|
|
417
|
+
from { opacity: 0; transform: translateX(var(--squiffy-slide-distance, 3em)); }
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
@keyframes squiffy-transition-from-left {
|
|
421
|
+
from { opacity: 0; transform: translateX(calc(-1 * var(--squiffy-slide-distance, 3em))); }
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* A slide moves the way it's named: slide-left comes in from the right, and leaves to the left */
|
|
425
|
+
.squiffy-transition.slide-up {
|
|
426
|
+
animation-name: squiffy-transition-from-below;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.squiffy-transition.slide-down {
|
|
430
|
+
animation-name: squiffy-transition-from-above;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.squiffy-transition.slide-left {
|
|
434
|
+
animation-name: squiffy-transition-from-right;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.squiffy-transition.slide-right {
|
|
438
|
+
animation-name: squiffy-transition-from-left;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/* @leave plays the animations backwards, as the old text goes before the screen is cleared. So
|
|
442
|
+
that a slide leaves the way it's named, it plays the opposite slide backwards. */
|
|
443
|
+
.squiffy-transition.squiffy-leave {
|
|
444
|
+
animation-direction: reverse;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.squiffy-transition.squiffy-leave.slide-up {
|
|
448
|
+
animation-name: squiffy-transition-from-above;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.squiffy-transition.squiffy-leave.slide-down {
|
|
452
|
+
animation-name: squiffy-transition-from-below;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.squiffy-transition.squiffy-leave.slide-left {
|
|
456
|
+
animation-name: squiffy-transition-from-left;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.squiffy-transition.squiffy-leave.slide-right {
|
|
460
|
+
animation-name: squiffy-transition-from-right;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/* So a transition, a story's own too, doesn't make the page scroll sideways, or a slide make it
|
|
464
|
+
longer */
|
|
465
|
+
:has(> .squiffy-transition) {
|
|
466
|
+
overflow-x: clip;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
:has(> .squiffy-transition:is(.slide-up, .slide-down)) {
|
|
470
|
+
overflow-y: clip;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.squiffy-transition.zoom {
|
|
474
|
+
animation-name: squiffy-transition-zoom;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
@keyframes squiffy-transition-zoom {
|
|
478
|
+
from { opacity: 0; transform: scale(0.9); }
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.squiffy-transition.blur {
|
|
482
|
+
animation-name: squiffy-transition-blur;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
@keyframes squiffy-transition-blur {
|
|
486
|
+
from { opacity: 0; filter: blur(8px); }
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.squiffy-transition.pulse {
|
|
490
|
+
animation-name: squiffy-transition-pulse;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
@keyframes squiffy-transition-pulse {
|
|
494
|
+
from { opacity: 0; transform: scale(0.95); }
|
|
495
|
+
60% { opacity: 1; transform: scale(1.02); }
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.squiffy-transition.rumble {
|
|
499
|
+
animation-name: squiffy-transition-rumble;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
@keyframes squiffy-transition-rumble {
|
|
503
|
+
from { opacity: 0; }
|
|
504
|
+
10%, 30%, 50%, 70% { transform: translateY(-2px); }
|
|
505
|
+
20%, 40%, 60%, 80% { transform: translateY(2px); }
|
|
506
|
+
50% { opacity: 1; }
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.squiffy-transition.shudder {
|
|
510
|
+
animation-name: squiffy-transition-shudder;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
@keyframes squiffy-transition-shudder {
|
|
514
|
+
from { opacity: 0; }
|
|
515
|
+
10%, 30%, 50%, 70% { transform: translateX(-2px); }
|
|
516
|
+
20%, 40%, 60%, 80% { transform: translateX(2px); }
|
|
517
|
+
50% { opacity: 1; }
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.squiffy-transition.flicker {
|
|
521
|
+
animation-name: squiffy-transition-flicker;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
@keyframes squiffy-transition-flicker {
|
|
525
|
+
from, 15%, 35%, 55% { opacity: 0; }
|
|
526
|
+
10%, 25%, 45% { opacity: 0.6; }
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/* Respect the reader's reduced-motion setting */
|
|
530
|
+
@media (prefers-reduced-motion: reduce)
|
|
531
|
+
{
|
|
532
|
+
/* Every transition, a story's own too, is a plain fade */
|
|
533
|
+
.squiffy-transition {
|
|
534
|
+
animation-name: squiffy-transition-fade !important;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.squiffy-continue-pulse,
|
|
538
|
+
.squiffy-continue-glow,
|
|
539
|
+
.squiffy-continue-bounce,
|
|
540
|
+
.squiffy-style:is(.shake, .shudder, .rumble, .sway, .buoy, .pulse, .fade-in-out, .blink, .flicker)
|
|
541
|
+
{
|
|
542
|
+
animation: none;
|
|
248
543
|
}
|
|
249
|
-
`.trim()},blockValue:function(l){var d=this.aliasable("container.hooks.blockHelperMissing"),g=[this.contextName(0)];this.setupHelperArgs(l,0,g);var v=this.popStack();g.splice(1,0,v),this.push(this.source.functionCall(d,"call",g))},ambiguousBlockValue:function(){var l=this.aliasable("container.hooks.blockHelperMissing"),d=[this.contextName(0)];this.setupHelperArgs("",0,d,!0),this.flushInline();var g=this.topStack();d.splice(1,0,g),this.pushSource(["if (!",this.lastHelper,") { ",g," = ",this.source.functionCall(l,"call",d),"}"])},appendContent:function(l){this.pendingContent?l=this.pendingContent+l:this.pendingLocation=this.source.currentLocation,this.pendingContent=l},append:function(){if(this.isInline())this.replaceStack(function(d){return[" != null ? ",d,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var l=this.popStack();this.pushSource(["if (",l," != null) { ",this.appendToBuffer(l,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(l){this.lastContext=l},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(l,d,g,v){var b=0;!v&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(l[b++])):this.pushContext(),this.resolvePath("context",l,b,d,g)},lookupBlockParam:function(l,d){this.useBlockParams=!0,this.push(["blockParams[",l[0],"][",l[1],"]"]),this.resolvePath("context",d,1)},lookupData:function(l,d,g){l?this.pushStackLiteral("container.data(data, "+l+")"):this.pushStackLiteral("data"),this.resolvePath("data",d,0,!0,g)},resolvePath:function(l,d,g,v,b){var S=this;if(this.options.strict||this.options.assumeObjects){this.push(c(this.options.strict&&b,this,d,g,l));return}for(var y=d.length,m=function(k){S.replaceStack(function(w){var A=S.nameLookup(w,d[k],l);return v?[" && ",A]:[" != null ? ",A," : ",w]})},_=g;_<y;_++)m(_)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(l,d){this.pushContext(),this.pushString(d),d!=="SubExpression"&&(typeof l=="string"?this.pushString(l):this.pushStackLiteral(l))},emptyHash:function(l){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(l?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var l=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(l.ids)),this.stringParams&&(this.push(this.objectLiteral(l.contexts)),this.push(this.objectLiteral(l.types))),this.push(this.objectLiteral(l.values))},pushString:function(l){this.pushStackLiteral(this.quotedString(l))},pushLiteral:function(l){this.pushStackLiteral(l)},pushProgram:function(l){l!=null?this.pushStackLiteral(this.programExpression(l)):this.pushStackLiteral(null)},registerDecorator:function(l,d){var g=this.nameLookup("decorators",d,"decorator"),v=this.setupHelperArgs(d,l);this.decorators.push(["var decorator = ",g,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+d+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",v])," || fn;"])},invokeHelper:function(l,d,g){var v=this.popStack(),b=this.setupHelper(l,d),S=[];g&&S.push(b.name),S.push(v),this.options.strict||S.push(this.aliasable("container.hooks.helperMissing"));var y=["(",this.itemsSeparatedBy(S,"||"),")"],m=this.source.functionCall(y,"call",b.callParams);this.push(m)},itemsSeparatedBy:function(l,d){var g=[];g.push(l[0]);for(var v=1;v<l.length;v++)g.push(d,l[v]);return g},invokeKnownHelper:function(l,d){var g=this.setupHelper(l,d);this.push(this.source.functionCall(g.name,"call",g.callParams))},invokeAmbiguous:function(l,d){this.useRegister("helper");var g=this.popStack();this.emptyHash();var v=this.setupHelper(0,l,d),b=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",l,"helper")," || ",g,")"];this.options.strict||(b[0]="(helper = ",b.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",b,v.paramsInit?["),(",v.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",v.callParams)," : helper))"])},invokePartial:function(l,d,g){var v=[],b=this.setupParams(d,1,v);l&&(d=this.popStack(),delete b.name),g&&(b.indent=this.quotedString(g)),b.helpers="helpers",b.partials="partials",b.decorators="container.decorators",l?v.unshift(d):v.unshift(this.nameLookup("partials",d,"partial")),this.options.compat&&(b.depths="depths"),b=this.objectLiteral(b),v.push(b),this.push(this.source.functionCall("container.invokePartial","",v))},assignToHash:function(l){var d=this.popStack(),g=void 0,v=void 0,b=void 0;this.trackIds&&(b=this.popStack()),this.stringParams&&(v=this.popStack(),g=this.popStack());var S=this.hash;g&&(S.contexts[l]=g),v&&(S.types[l]=v),b&&(S.ids[l]=b),S.values[l]=d},pushId:function(l,d,g){l==="BlockParam"?this.pushStackLiteral("blockParams["+d[0]+"].path["+d[1]+"]"+(g?" + "+this.quotedString("."+g):"")):l==="PathExpression"?this.pushString(d):l==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:u,compileChildren:function(l,d){for(var g=l.children,v=void 0,b=void 0,S=0,y=g.length;S<y;S++){v=g[S],b=new this.compiler;var m=this.matchExistingProgram(v);if(m==null){var _=this.context.programs.push("")-1;v.index=_,v.name="program"+_,this.context.programs[_]=b.compile(v,d,this.context,!this.precompile),this.context.decorators[_]=b.decorators,this.context.environments[_]=v,this.useDepths=this.useDepths||b.useDepths,this.useBlockParams=this.useBlockParams||b.useBlockParams,v.useDepths=this.useDepths,v.useBlockParams=this.useBlockParams}else v.index=m.index,v.name="program"+m.index,this.useDepths=this.useDepths||m.useDepths,this.useBlockParams=this.useBlockParams||m.useBlockParams}},matchExistingProgram:function(l){for(var d=0,g=this.context.environments.length;d<g;d++){var v=this.context.environments[d];if(v&&v.equals(l))return v}},programExpression:function(l){var d=this.environment.children[l],g=[d.index,"data",d.blockParams];return(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths"),"container.program("+g.join(", ")+")"},useRegister:function(l){this.registers[l]||(this.registers[l]=!0,this.registers.list.push(l))},push:function(l){return l instanceof h||(l=this.source.wrap(l)),this.inlineStack.push(l),l},pushStackLiteral:function(l){this.push(new h(l))},pushSource:function(l){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),l&&this.source.push(l)},replaceStack:function(l){var d=["("],g=void 0,v=void 0,b=void 0;if(!this.isInline())throw new i.default("replaceStack on non-inline");var S=this.popStack(!0);if(S instanceof h)g=[S.value],d=["(",g],b=!0;else{v=!0;var y=this.incrStack();d=["((",this.push(y)," = ",S,")"],g=this.topStack()}var m=l.call(this,g);b||this.popStack(),v&&this.stackSlot--,this.push(d.concat(m,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var l=this.inlineStack;this.inlineStack=[];for(var d=0,g=l.length;d<g;d++){var v=l[d];if(v instanceof h)this.compileStack.push(v);else{var b=this.incrStack();this.pushSource([b," = ",v,";"]),this.compileStack.push(b)}}},isInline:function(){return this.inlineStack.length},popStack:function(l){var d=this.isInline(),g=(d?this.inlineStack:this.compileStack).pop();if(!l&&g instanceof h)return g.value;if(!d){if(!this.stackSlot)throw new i.default("Invalid stack pop");this.stackSlot--}return g},topStack:function(){var l=this.isInline()?this.inlineStack:this.compileStack,d=l[l.length-1];return d instanceof h?d.value:d},contextName:function(l){return this.useDepths&&l?"depths["+l+"]":"depth"+l},quotedString:function(l){return this.source.quotedString(l)},objectLiteral:function(l){return this.source.objectLiteral(l)},aliasable:function(l){var d=this.aliases[l];return d?(d.referenceCount++,d):(d=this.aliases[l]=this.source.wrap(l),d.aliasable=!0,d.referenceCount=1,d)},setupHelper:function(l,d,g){var v=[];return{params:v,paramsInit:this.setupHelperArgs(d,l,v,g),name:this.nameLookup("helpers",d,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(v)}},setupParams:function(l,d,g){var v={},b=[],S=[],y=[],m=!g,_=void 0;m&&(g=[]),v.name=this.quotedString(l),v.hash=this.popStack(),this.trackIds&&(v.hashIds=this.popStack()),this.stringParams&&(v.hashTypes=this.popStack(),v.hashContexts=this.popStack());var k=this.popStack(),w=this.popStack();(w||k)&&(v.fn=w||"container.noop",v.inverse=k||"container.noop");for(var A=d;A--;)_=this.popStack(),g[A]=_,this.trackIds&&(y[A]=this.popStack()),this.stringParams&&(S[A]=this.popStack(),b[A]=this.popStack());return m&&(v.args=this.source.generateArray(g)),this.trackIds&&(v.ids=this.source.generateArray(y)),this.stringParams&&(v.types=this.source.generateArray(S),v.contexts=this.source.generateArray(b)),this.options.data&&(v.data="data"),this.useBlockParams&&(v.blockParams="blockParams"),v},setupHelperArgs:function(l,d,g,v){var b=this.setupParams(l,d,g);return b.loc=p(this),b=this.objectLiteral(b),v?(this.useRegister("options"),g.push("options"),["options=",b]):g?(g.push(b),""):b}},(function(){for(var f="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),l=u.RESERVED_WORDS={},d=0,g=f.length;d<g;d++)l[f[d]]=!0})(),u.isValidJavaScriptVariableName=function(f){return!u.RESERVED_WORDS[f]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(f)};function p(f){var l=f.source.currentLocation;return l?o.safeJsonLiteral(l):"undefined"}function c(f,l,d,g,v){var b=l.popStack(),S=d.length;f&&S--;for(var y=g;y<S;y++)b=l.nameLookup(b,d[y],v);return f?[l.aliasable("container.strict"),"(",b,", ",l.quotedString(d[S]),", ",p(l)," )"]:b}e.default=u,t.exports=e.default})),Al=he(((e,t)=>{e.__esModule=!0;function s(l){return l&&l.__esModule?l:{default:l}}var r=s(dl()),i=s(Ki()),n=yl(),o=bl(),a=s(El()),h=s(tn()),u=s(Ji()),p=r.default.create;function c(){var l=p();return l.compile=function(d,g){return o.compile(d,g,l)},l.precompile=function(d,g){return o.precompile(d,g,l)},l.AST=i.default,l.Compiler=o.Compiler,l.JavaScriptCompiler=a.default,l.Parser=n.parser,l.parse=n.parse,l.parseWithoutProcessing=n.parseWithoutProcessing,l}var f=c();f.create=c,u.default(f),f.Visitor=h.default,f.default=f,e.default=f,t.exports=e.default})),je=Ko(Al(),1),Or={"=":"eq","==":"eq","!=":"ne",">":"gt","<":"lt",">=":"gte","<=":"lte"},Ll=["==","!=",">=","<=","&&","||","=",">","<","!"],Rl=["and","or","not"],Il=["true","false","null","undefined"],Ol=new Set([...` \r
|
|
250
|
-
!"'()<>=&|{}~`]),et=class extends Error{};function Nl(e){const t=[];let s=0;for(;s<e.length;){const r=e[s];if(/\s/.test(r)){s++;continue}if(r==="("||r===")"){t.push({type:r,text:r}),s++;continue}if(r==='"'||r==="'"){let a=s+1;for(;a<e.length&&e[a]!==r;)e[a]==="\\"&&a++,a++;if(a>=e.length)throw new et("unterminated string");t.push({type:"value",text:e.slice(s,a+1)}),s=a+1;continue}const i=Ll.find(a=>e.startsWith(a,s));if(i){t.push({type:"op",text:i}),s+=i.length;continue}let n=s;for(;n<e.length&&!Ol.has(e[n]);){if(e[n]==="["){const a=e.indexOf("]",n);if(a===-1)throw new et("missing ']'");n=a}n++}if(n===s)throw new et(`unexpected '${r}'`);const o=e.slice(s,n);Rl.includes(o)?t.push({type:"op",text:o}):Il.includes(o)||/^-?\d+(\.\d+)?$/.test(o)?t.push({type:"value",text:o}):t.push({type:"ident",text:o}),s=n}return t}var Ml=class{constructor(e){this.tokens=e,this.pos=0,this.usedInfix=!1}peek(e=0){return this.tokens[this.pos+e]}next(){return this.tokens[this.pos++]}isOp(e,...t){return e?.type==="op"&&t.includes(e.text)}startsPrimary(e){return e?.type==="ident"||e?.type==="value"||e?.type==="("}describe(e){return e?`'${e.text}'`:"end of expression"}parseCondition(){const e=[this.parseOr()];for(;this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=");)e.push(this.parseHashPair());if(this.peek())throw new et(`unexpected ${this.describe(this.peek())}`);return e}parseHashPair(){const e=this.next().text;return this.next(),{kind:"raw",text:`${e}=${Nr(this.parsePrimary())}`}}parseOr(){return this.parseChain(["or","||"],"or",()=>this.parseAnd())}parseAnd(){return this.parseChain(["and","&&"],"and",()=>this.parseNot())}parseChain(e,t,s){const r=[s()];for(;this.isOp(this.peek(),...e);){const i=this.next().text;if(!this.peek())throw new et(`expected a value after '${i}'`);r.push(s())}return r.length===1?r[0]:(this.usedInfix=!0,{kind:"call",name:t,args:r})}parseNot(){if(this.isOp(this.peek(),"not","!")){const e=this.next().text;if(!this.peek())throw new et(`expected a value after '${e}'`);return this.usedInfix=!0,{kind:"call",name:"not",args:[this.parseNot()]}}return this.parseComparison()}parseComparison(){const e=this.parsePrimary(),t=this.peek();if(t?.type!=="op"||!(t.text in Or))return e;if(this.next(),!this.peek())throw new et(`expected a value after '${t.text}'`);const s=this.parsePrimary(),r=this.peek();if(r?.type==="op"&&r.text in Or)throw new et(`comparisons can't be chained (at '${r.text}'), use "and" to combine them`);return this.usedInfix=!0,{kind:"call",name:Or[t.text],args:[e,s]}}parsePrimary(){const e=this.peek();if(e?.type==="ident"||e?.type==="value")return this.next(),{kind:"raw",text:e.text};if(e?.type==="("){this.next();const t=this.isHelperCall()?this.parseHelperCall():this.parseOr();if(this.peek()?.type!==")")throw new et(`expected ')' but found ${this.describe(this.peek())}`);return this.next(),t}if(this.isOp(e,"not","!")){const t=e?.text==="!"?"!value":"not value";throw new et(`'${e?.text}' must be inside parentheses here, e.g. (${t})`)}throw e?.type==="op"?new et(`expected a value before '${e.text}'`):new et(e?`unexpected ${this.describe(e)}`:"expected a value")}isHelperCall(){const e=this.peek(),t=this.peek(1);return this.isOp(e,"and","or")?!0:e?.type==="ident"&&this.startsPrimary(t)}parseHelperCall(){const e=this.next().text,t=[];for(;this.peek()&&this.peek()?.type!==")";)this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=")?t.push(this.parseHashPair()):t.push(this.parsePrimary());return{kind:"call",name:e,args:t}}};function Nr(e){return e.kind==="raw"?e.text:`(${e.name} ${e.args.map(Nr).join(" ")})`}function Dl(e){let t;try{t=Nl(e)}catch{return null}const s=t.some(o=>o.type==="op"),r=new Ml(t);let i,n=null;try{i=r.parseCondition()}catch(o){if(!s||!(o instanceof et))return null;n=o,i=[]}if(n)throw new Error(`Invalid condition "${e.trim()}": ${n.message}`);return r.usedInfix?i.map(Nr).join(" "):null}var Mr=/(\\*)\{\{(~?\s*)(#if|#unless|else\s+if|else\s+unless)(?=[\s(!])/g;function Bl(e,t){let s=null;for(let r=t;r<e.length;r++){const i=e[r];if(s)i==="\\"?r++:i===s&&(s=null);else if(i==='"'||i==="'")s=i;else{if(e.startsWith("~}}",r))return r;if(e.startsWith("}}",r))return r}}return-1}function $l(e){if(!e.includes("{{"))return e;let t="",s=0;Mr.lastIndex=0;let r;for(;(r=Mr.exec(e))!==null;){if(r[1].length%2===1)continue;const i=r.index+r[0].length,n=Bl(e,i);if(n===-1)break;const o=Dl(e.slice(i,n));o!==null&&(t+=e.slice(s,i)+" "+o,s=n),Mr.lastIndex=n}return t+e.slice(s)}var Hl=class{constructor(e,t,s){this.getStory=e,this.state=t,this.getCurrentSection=s,this.handlebars=je.default.create(),this.handlebars.registerHelper("embed",o=>{const a=this.getCurrentSection();if(a.passages&&o in a.passages)return new je.default.SafeString(this.process(a.passages[o].text||"",!0));const h=this.getStory();if(o in h.sections)return new je.default.SafeString(this.process(h.sections[o].text||"",!0))}),this.handlebars.registerHelper("seen",o=>this.state.getSeen(o)),this.handlebars.registerHelper("get",o=>this.state.get(o)),this.handlebars.registerHelper("at",o=>{const a=this.state.get("_section");return Array.isArray(o)?o.includes(a):a===o});const r=o=>o&&typeof o=="object"&&typeof o.toString=="function"&&!Array.isArray(o)?o.toString():o;this.handlebars.registerHelper("set",(o,a)=>(this.state.set(o,r(a)),"")),this.handlebars.registerHelper("unset",o=>(this.state.set(o,!1),"")),this.handlebars.registerHelper("inc",(o,a)=>{const h=typeof a=="number"?a:1,u=this.state.get(o)||0;return this.state.set(o,u+h),""}),this.handlebars.registerHelper("dec",(o,a)=>{const h=typeof a=="number"?a:1,u=this.state.get(o)||0;return this.state.set(o,u-h),""}),this.handlebars.registerHelper("and",(...o)=>o.slice(0,-1).every(Boolean)),this.handlebars.registerHelper("or",(...o)=>o.slice(0,-1).some(Boolean)),this.handlebars.registerHelper("not",o=>!o),this.handlebars.registerHelper("eq",(o,a)=>o==a),this.handlebars.registerHelper("ne",(o,a)=>o!=a),this.handlebars.registerHelper("gt",(o,a)=>o>a),this.handlebars.registerHelper("lt",(o,a)=>o<a),this.handlebars.registerHelper("gte",(o,a)=>o>=a),this.handlebars.registerHelper("lte",(o,a)=>o<=a),this.handlebars.registerHelper("array",function(...o){return o.pop(),o}),this.handlebars.registerHelper("append",(o,a)=>{const h=this.state.get(o)||[],u=Array.isArray(h)?[...h]:[h],p=r(a);return Array.isArray(p)?u.push(...p.map(r)):u.push(p),this.state.set(o,u),""}),this.handlebars.registerHelper("prepend",(o,a)=>{const h=this.state.get(o)||[],u=Array.isArray(h)?[...h]:[h],p=r(a);return Array.isArray(p)?u.unshift(...p.map(r)):u.unshift(p),this.state.set(o,u),""}),this.handlebars.registerHelper("pop",o=>{const a=this.state.get(o)||[];if(!Array.isArray(a)||a.length===0)return"";const h=[...a],u=h.shift();return this.state.set(o,h),u}),this.handlebars.registerHelper("remove",(o,a)=>{const h=this.state.get(o)||[];if(!Array.isArray(h))return"";const u=r(a),p=h.findIndex(c=>r(c)===u);if(p!==-1){const c=[...h];c.splice(p,1),this.state.set(o,c)}return""}),this.handlebars.registerHelper("contains",(o,a)=>{let h;if(typeof o=="string"){const p=this.state.get(o);h=Array.isArray(p)?p:[]}else if(Array.isArray(o))h=o;else return!1;const u=r(a);return h.some(p=>r(p)===u)}),this.handlebars.registerHelper("length",o=>{let a;if(typeof o=="string"){const h=this.state.get(o);a=Array.isArray(h)?h:[]}else if(Array.isArray(o))a=o;else return 0;return a.length});const i=o=>{let a="";const h=o.hash.set||"";return h&&(a+=` data-set='${JSON.stringify(h.split(",").map(u=>u.trim()))}'`),a},n=o=>String(o).replace(/&/g,"&").replace(/"/g,""");this.handlebars.registerHelper("section",(o,a)=>{const h=a.hash.text||o;return new je.default.SafeString(`<a class="squiffy-link link-section" data-section="${n(o)}"${i(a)} role="link" tabindex="0">${h}</a>`)}),this.handlebars.registerHelper("passage",(o,a)=>{const h=a.hash.text||o;return new je.default.SafeString(`<a class="squiffy-link link-passage" data-passage="${n(o)}"${i(a)} role="link" tabindex="0">${h}</a>`)})}process(e,t){try{return e=this.handlebars.compile($l(e))(this.state.getStore()),t?Lr(e,{async:!1}).trim():Rr(e,{async:!1}).trim()}catch(s){const r=s instanceof Error?s.message:String(s);return console.error("Squiffy template error:",r),`<div class="squiffy-error" style="color: red; background: #ffe0e0; padding: 8px; border: 1px solid red; margin: 4px 0; font-family: monospace; white-space: pre-wrap;"><strong>Template error:</strong> ${r}</div>`}}},ql=class{constructor(){this.listeners=new Map}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}off(e,t){this.listeners.get(e)?.delete(t)}once(e,t){const s=this.on(e,r=>{s(),t(r)});return s}emit(e,t){this.listeners.get(e)?.forEach(s=>{try{s(t)}catch(r){console.error(`[Squiffy] handler for "${String(e)}" failed`,r)}})}},Fl=class{constructor(e,t,s,r,i){this.store={},this.persist=e,this.storyId=t,this.onSet=s,this.emitter=r,this.onSetInternal=i}usePersistentStorage(){return this.persist&&window.localStorage&&this.storyId}set(e,t){this.setInternal(e,t,!0)}setInternal(e,t,s){typeof t>"u"&&(t=!0),s&&this.onSetInternal&&this.onSetInternal(e,this.get(e),structuredClone(t)),this.store[e]=structuredClone(t),this.usePersistentStorage()&&(localStorage[this.storyId+"-"+e]=JSON.stringify(t)),s&&this.emitter.emit("set",{attribute:e,value:t}),this.onSet(e,t)}get(e){return e in this.store?structuredClone(this.store[e]):null}getStore(){return new Proxy({},{get:(e,t)=>this.get(String(t)),has:(e,t)=>String(t)in this.store,ownKeys:()=>Object.keys(this.store),getOwnPropertyDescriptor:(e,t)=>{const s=String(t);if(s in this.store)return{enumerable:!0,configurable:!0,value:this.get(s)}}})}load(){if(!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)if(t.startsWith(this.storyId+"-")){const s=t.substring(this.storyId.length+1);this.store[s]=JSON.parse(localStorage[t])}}reset(){if(this.store={},!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)t.startsWith(this.storyId)&&localStorage.removeItem(t)}setSeen(e){let t=this.get("_seen_sections");t||(t=[]),t.indexOf(e)==-1&&(t.push(e),this.set("_seen_sections",t))}getSeen(e){const t=this.get("_seen_sections");return t?t.indexOf(e)>-1:!1}};function on(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every((s,r)=>s===t[r])}function Vl(e,t,s,r,i,n){function o(p){return p.replace(/'/g,"\\'")}function a(p){return s.querySelectorAll(`[data-source='[[${o(p)}]]']`)}function h(p,c){return s.querySelectorAll(`[data-source='[[${o(p)}]][${o(c)}]']`)}function u(p,c){const f=Array.from(p.querySelectorAll("a.link-passage.disabled")).map(l=>l.getAttribute("data-passage"));p.innerHTML=c;for(const l of f){const d=p.querySelector(`a.link-passage[data-passage="${l}"]`);d&&i(d)}}for(const p of Object.keys(e.sections)){const c=a(p);if(c.length){const f=t.sections[p];if(f){const l=e.sections[p],d=!on(l.attributes,f.attributes),g=f.text!=l.text;if(d&&n(f.attributes||[]),g||d)for(const v of c)u(v,r(f.text||"",f))}else for(const l of c)l.closest(".squiffy-output-section")?.remove()}if(e.sections[p].passages)for(const f of Object.keys(e.sections[p].passages)){const l=h(p,f);if(!l.length)continue;const d=t.sections[p]?.passages&&t.sections[p]?.passages[f];if(d){const g=e.sections[p].passages[f],v=!on(g.attributes,d.attributes),b=d.text!=g.text;if(v&&n(d.attributes||[]),b||v)for(const S of l)u(S,r(d.text||"",t.sections[p]))}else for(const g of l)g.closest(".squiffy-output-passage")?.remove()}}}var zl=class{constructor(e,t,s,r,i,n,o,a,h,u,p){this.plugins=[],this.outputElement=e,this.textProcessor=t,this.state=s,this.linkHandler=r,this.getSectionText=i,this.getPassageText=n,this.processText=o,this.addTransition=a,this.animation=h,this.emitter=u,this.resolveAssetsInHtml=p}add(e){const t=e.init({outputElement:this.outputElement,registerHelper:(s,r)=>{this.textProcessor.handlebars.registerHelper(s,r)},registerLinkHandler:(s,r)=>{this.linkHandler.registerLinkHandler(s,r)},get:s=>this.state.get(s),set:(s,r)=>this.state.set(s,r),getSectionText:this.getSectionText,getPassageText:this.getPassageText,processText:this.processText,resolveAssetsInHtml:this.resolveAssetsInHtml,addTransition:this.addTransition,animation:this.animation,on:(s,r)=>this.emitter.on(s,r),off:(s,r)=>this.emitter.off(s,r),once:(s,r)=>this.emitter.once(s,r)});return this.plugins.push(e),t}onWrite(e){this.plugins.forEach(t=>t.onWrite?.(e))}onLoad(){this.plugins.forEach(e=>e.onLoad?.())}};function an(e,t){return new Promise(s=>{e.addEventListener("transitionend",function(){e.innerHTML=t,e.addEventListener("transitionend",function(){e.classList.remove("fade-in"),s()},{once:!0}),e.classList.remove("fade-out"),e.classList.add("fade-in")},{once:!0}),e.classList.add("fade-out")})}function Ul(){return{name:"replaceLabel",init(e){e.registerHelper("label",function(t,s){return new je.default.SafeString(`<span class="squiffy-label-${t}">${s.fn(this)}</span>`)}),e.registerHelper("replace",function(t,s){const r=s.fn(this),i=e.outputElement.querySelector(`.squiffy-label-${t}`);if(i){const n=r.includes(`
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/* The Saved games dialog, opened by the page's Save button */
|
|
547
|
+
dialog.squiffy-saves
|
|
548
|
+
{
|
|
549
|
+
width: min(28rem, calc(100vw - 2rem));
|
|
550
|
+
max-height: calc(100vh - 2rem);
|
|
551
|
+
box-sizing: border-box;
|
|
552
|
+
padding: 1rem 1.25rem 1.25rem;
|
|
553
|
+
border: 1px solid var(--squiffy-border);
|
|
554
|
+
border-radius: 0.75rem;
|
|
555
|
+
background-color: var(--squiffy-background);
|
|
556
|
+
color: var(--squiffy-text);
|
|
557
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
558
|
+
font-size: 0.9375rem;
|
|
559
|
+
line-height: 1.4;
|
|
560
|
+
box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
dialog.squiffy-saves::backdrop
|
|
564
|
+
{
|
|
565
|
+
background-color: rgb(0 0 0 / 0.4);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
dialog.squiffy-saves svg
|
|
569
|
+
{
|
|
570
|
+
width: 1.25em;
|
|
571
|
+
height: 1.25em;
|
|
572
|
+
flex: none;
|
|
573
|
+
fill: none;
|
|
574
|
+
stroke: currentColor;
|
|
575
|
+
stroke-width: 2;
|
|
576
|
+
stroke-linecap: round;
|
|
577
|
+
stroke-linejoin: round;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.squiffy-saves-header
|
|
581
|
+
{
|
|
582
|
+
display: flex;
|
|
583
|
+
align-items: center;
|
|
584
|
+
justify-content: space-between;
|
|
585
|
+
margin-bottom: 0.75rem;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.squiffy-saves-header h2
|
|
589
|
+
{
|
|
590
|
+
margin: 0;
|
|
591
|
+
font-size: 1.125rem;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.squiffy-saves button
|
|
595
|
+
{
|
|
596
|
+
font: inherit;
|
|
597
|
+
color: inherit;
|
|
598
|
+
cursor: pointer;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.squiffy-saves button:focus-visible,
|
|
602
|
+
.squiffy-saves input:focus-visible
|
|
603
|
+
{
|
|
604
|
+
outline: 2px solid var(--squiffy-link);
|
|
605
|
+
outline-offset: 2px;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.squiffy-saves-button
|
|
609
|
+
{
|
|
610
|
+
flex: none;
|
|
611
|
+
padding: 0.3em 0.8em;
|
|
612
|
+
border: 1px solid var(--squiffy-border);
|
|
613
|
+
border-radius: 0.375em;
|
|
614
|
+
background: none;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.squiffy-saves-button:hover
|
|
618
|
+
{
|
|
619
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.squiffy-saves .squiffy-saves-primary
|
|
623
|
+
{
|
|
624
|
+
border-color: var(--squiffy-link);
|
|
625
|
+
background-color: var(--squiffy-link);
|
|
626
|
+
color: var(--squiffy-background);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.squiffy-saves .squiffy-saves-danger-button
|
|
630
|
+
{
|
|
631
|
+
border-color: var(--squiffy-error);
|
|
632
|
+
background-color: var(--squiffy-error);
|
|
633
|
+
color: var(--squiffy-background);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.squiffy-saves-icon-button
|
|
637
|
+
{
|
|
638
|
+
display: inline-flex;
|
|
639
|
+
padding: 0.3em;
|
|
640
|
+
border: none;
|
|
641
|
+
border-radius: 0.375em;
|
|
642
|
+
background: none;
|
|
643
|
+
color: var(--squiffy-muted) !important;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.squiffy-saves-icon-button:hover,
|
|
647
|
+
.squiffy-saves-icon-button[aria-expanded="true"]
|
|
648
|
+
{
|
|
649
|
+
color: var(--squiffy-text) !important;
|
|
650
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.squiffy-saves-error
|
|
654
|
+
{
|
|
655
|
+
margin: 0 0 0.75rem;
|
|
656
|
+
color: var(--squiffy-error);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.squiffy-saves-new
|
|
660
|
+
{
|
|
661
|
+
display: flex;
|
|
662
|
+
gap: 0.5rem;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
.squiffy-saves input[type="text"]
|
|
666
|
+
{
|
|
667
|
+
flex: 1;
|
|
668
|
+
min-width: 0;
|
|
669
|
+
padding: 0.3em 0.6em;
|
|
670
|
+
border: 1px solid var(--squiffy-border);
|
|
671
|
+
border-radius: 0.375em;
|
|
672
|
+
background-color: var(--squiffy-background);
|
|
673
|
+
color: inherit;
|
|
674
|
+
font: inherit;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.squiffy-saves-list
|
|
678
|
+
{
|
|
679
|
+
list-style: none;
|
|
680
|
+
margin: 0.75rem 0 0;
|
|
681
|
+
padding: 0;
|
|
682
|
+
max-height: 50vh;
|
|
683
|
+
overflow-y: auto;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.squiffy-saves-empty
|
|
687
|
+
{
|
|
688
|
+
padding: 0.75rem 0;
|
|
689
|
+
color: var(--squiffy-muted);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.squiffy-saves-row
|
|
693
|
+
{
|
|
694
|
+
padding: 0.5rem 0;
|
|
695
|
+
border-top: 1px solid var(--squiffy-border);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.squiffy-saves-line
|
|
699
|
+
{
|
|
700
|
+
display: flex;
|
|
701
|
+
align-items: center;
|
|
702
|
+
gap: 0.5rem;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.squiffy-saves-info
|
|
706
|
+
{
|
|
707
|
+
flex: 1;
|
|
708
|
+
min-width: 0;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.squiffy-saves-title
|
|
712
|
+
{
|
|
713
|
+
overflow: hidden;
|
|
714
|
+
text-overflow: ellipsis;
|
|
715
|
+
white-space: nowrap;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.squiffy-saves-meta
|
|
719
|
+
{
|
|
720
|
+
color: var(--squiffy-muted);
|
|
721
|
+
font-size: 0.8125rem;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.squiffy-saves-options
|
|
725
|
+
{
|
|
726
|
+
position: relative;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.squiffy-saves-menu
|
|
730
|
+
{
|
|
731
|
+
position: absolute;
|
|
732
|
+
right: 0;
|
|
733
|
+
top: 100%;
|
|
734
|
+
z-index: 1;
|
|
735
|
+
display: flex;
|
|
736
|
+
flex-direction: column;
|
|
737
|
+
min-width: 10rem;
|
|
738
|
+
margin-top: 0.25rem;
|
|
739
|
+
padding: 0.25rem;
|
|
740
|
+
border: 1px solid var(--squiffy-border);
|
|
741
|
+
border-radius: 0.5rem;
|
|
742
|
+
background-color: var(--squiffy-background);
|
|
743
|
+
box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.2);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.squiffy-saves-menu[hidden]
|
|
747
|
+
{
|
|
748
|
+
display: none;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/* In the top layer, placed by the script */
|
|
752
|
+
.squiffy-saves-menu:popover-open
|
|
753
|
+
{
|
|
754
|
+
position: fixed;
|
|
755
|
+
right: auto;
|
|
756
|
+
bottom: auto;
|
|
757
|
+
margin: 0;
|
|
758
|
+
color: inherit;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.squiffy-saves-menu button
|
|
762
|
+
{
|
|
763
|
+
padding: 0.4em 0.75em;
|
|
764
|
+
border: none;
|
|
765
|
+
border-radius: 0.25em;
|
|
766
|
+
background: none;
|
|
767
|
+
text-align: left;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.squiffy-saves-menu button:hover,
|
|
771
|
+
.squiffy-saves-menu button:focus-visible
|
|
772
|
+
{
|
|
773
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.squiffy-saves .squiffy-saves-danger
|
|
777
|
+
{
|
|
778
|
+
color: var(--squiffy-error);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.squiffy-saves-confirm
|
|
782
|
+
{
|
|
783
|
+
margin-top: 0.5rem;
|
|
784
|
+
padding: 0.75rem;
|
|
785
|
+
border: 1px solid var(--squiffy-border);
|
|
786
|
+
border-radius: 0.5rem;
|
|
787
|
+
background-color: color-mix(in srgb, var(--squiffy-text) 5%, transparent);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
.squiffy-saves-confirm p
|
|
791
|
+
{
|
|
792
|
+
margin: 0 0 0.5rem;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.squiffy-saves-confirm-buttons
|
|
796
|
+
{
|
|
797
|
+
display: flex;
|
|
798
|
+
justify-content: flex-end;
|
|
799
|
+
gap: 0.5rem;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.squiffy-saves-footer
|
|
803
|
+
{
|
|
804
|
+
display: flex;
|
|
805
|
+
flex-wrap: wrap;
|
|
806
|
+
gap: 0.5rem 1.25rem;
|
|
807
|
+
margin-top: 0.75rem;
|
|
808
|
+
padding-top: 0.75rem;
|
|
809
|
+
border-top: 1px solid var(--squiffy-border);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.squiffy-saves-link
|
|
813
|
+
{
|
|
814
|
+
display: inline-flex;
|
|
815
|
+
align-items: center;
|
|
816
|
+
gap: 0.375em;
|
|
817
|
+
padding: 0;
|
|
818
|
+
border: none;
|
|
819
|
+
background: none;
|
|
820
|
+
color: var(--squiffy-link) !important;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.squiffy-saves-link:hover
|
|
824
|
+
{
|
|
825
|
+
text-decoration: underline;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
/* A question for the player, such as whether to restart, in place of the browser's confirm() */
|
|
829
|
+
dialog.squiffy-confirm
|
|
830
|
+
{
|
|
831
|
+
width: min(24rem, calc(100vw - 2rem));
|
|
832
|
+
box-sizing: border-box;
|
|
833
|
+
padding: 1.25rem;
|
|
834
|
+
border: 1px solid var(--squiffy-border);
|
|
835
|
+
border-radius: 0.75rem;
|
|
836
|
+
background-color: var(--squiffy-background);
|
|
837
|
+
color: var(--squiffy-text);
|
|
838
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
839
|
+
font-size: 0.9375rem;
|
|
840
|
+
line-height: 1.4;
|
|
841
|
+
box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
dialog.squiffy-confirm::backdrop
|
|
845
|
+
{
|
|
846
|
+
background-color: rgb(0 0 0 / 0.4);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.squiffy-confirm p
|
|
850
|
+
{
|
|
851
|
+
margin: 0 0 1rem;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.squiffy-confirm-buttons
|
|
855
|
+
{
|
|
856
|
+
display: flex;
|
|
857
|
+
justify-content: flex-end;
|
|
858
|
+
gap: 0.5rem;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
.squiffy-confirm-button
|
|
862
|
+
{
|
|
863
|
+
padding: 0.3em 0.8em;
|
|
864
|
+
border: 1px solid var(--squiffy-border);
|
|
865
|
+
border-radius: 0.375em;
|
|
866
|
+
background: none;
|
|
867
|
+
font: inherit;
|
|
868
|
+
color: inherit;
|
|
869
|
+
cursor: pointer;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.squiffy-confirm-button:hover
|
|
873
|
+
{
|
|
874
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
.squiffy-confirm-button:focus-visible
|
|
878
|
+
{
|
|
879
|
+
outline: 2px solid var(--squiffy-link);
|
|
880
|
+
outline-offset: 2px;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.squiffy-confirm .squiffy-confirm-primary
|
|
884
|
+
{
|
|
885
|
+
border-color: var(--squiffy-link);
|
|
886
|
+
background-color: var(--squiffy-link);
|
|
887
|
+
color: var(--squiffy-background);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.squiffy-confirm .squiffy-confirm-danger
|
|
891
|
+
{
|
|
892
|
+
border-color: var(--squiffy-error);
|
|
893
|
+
background-color: var(--squiffy-error);
|
|
894
|
+
color: var(--squiffy-background);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
.squiffy-confirm .squiffy-confirm-primary:hover,
|
|
898
|
+
.squiffy-confirm .squiffy-confirm-danger:hover
|
|
899
|
+
{
|
|
900
|
+
filter: brightness(1.1);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/* The Settings dialog (#452), for a story with "settings" in its squiffy.json */
|
|
904
|
+
dialog.squiffy-settings
|
|
905
|
+
{
|
|
906
|
+
width: min(28rem, calc(100vw - 2rem));
|
|
907
|
+
max-height: calc(100vh - 2rem);
|
|
908
|
+
box-sizing: border-box;
|
|
909
|
+
padding: 1rem 1.25rem 1.25rem;
|
|
910
|
+
border: 1px solid var(--squiffy-border);
|
|
911
|
+
border-radius: 0.75rem;
|
|
912
|
+
background-color: var(--squiffy-background);
|
|
913
|
+
color: var(--squiffy-text);
|
|
914
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
915
|
+
font-size: 0.9375rem;
|
|
916
|
+
line-height: 1.4;
|
|
917
|
+
box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
dialog.squiffy-settings::backdrop
|
|
921
|
+
{
|
|
922
|
+
background-color: rgb(0 0 0 / 0.4);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
.squiffy-settings-header
|
|
926
|
+
{
|
|
927
|
+
display: flex;
|
|
928
|
+
align-items: center;
|
|
929
|
+
justify-content: space-between;
|
|
930
|
+
margin-bottom: 0.5rem;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.squiffy-settings-header h2
|
|
934
|
+
{
|
|
935
|
+
margin: 0;
|
|
936
|
+
font-size: 1.125rem;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.squiffy-settings button,
|
|
940
|
+
.squiffy-settings select
|
|
941
|
+
{
|
|
942
|
+
font: inherit;
|
|
943
|
+
color: inherit;
|
|
944
|
+
cursor: pointer;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.squiffy-settings button:focus-visible,
|
|
948
|
+
.squiffy-settings input:focus-visible,
|
|
949
|
+
.squiffy-settings select:focus-visible
|
|
950
|
+
{
|
|
951
|
+
outline: 2px solid var(--squiffy-link);
|
|
952
|
+
outline-offset: 2px;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
button.squiffy-settings-close
|
|
956
|
+
{
|
|
957
|
+
display: inline-flex;
|
|
958
|
+
padding: 0.25em;
|
|
959
|
+
border: none;
|
|
960
|
+
border-radius: 0.375em;
|
|
961
|
+
background: none;
|
|
962
|
+
color: var(--squiffy-muted);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
button.squiffy-settings-close:hover
|
|
966
|
+
{
|
|
967
|
+
color: var(--squiffy-text);
|
|
968
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
button.squiffy-settings-close svg
|
|
972
|
+
{
|
|
973
|
+
width: 1.25em;
|
|
974
|
+
height: 1.25em;
|
|
975
|
+
fill: none;
|
|
976
|
+
stroke: currentColor;
|
|
977
|
+
stroke-width: 2;
|
|
978
|
+
stroke-linecap: round;
|
|
979
|
+
stroke-linejoin: round;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.squiffy-setting
|
|
983
|
+
{
|
|
984
|
+
display: flex;
|
|
985
|
+
align-items: center;
|
|
986
|
+
justify-content: space-between;
|
|
987
|
+
gap: 1rem;
|
|
988
|
+
padding: 0.75rem 0;
|
|
989
|
+
border-bottom: 1px solid var(--squiffy-border);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
.squiffy-setting-text
|
|
993
|
+
{
|
|
994
|
+
min-width: 0;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.squiffy-setting-text label
|
|
998
|
+
{
|
|
999
|
+
display: block;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
.squiffy-setting-text p
|
|
1003
|
+
{
|
|
1004
|
+
margin: 0.125rem 0 0;
|
|
1005
|
+
color: var(--squiffy-muted);
|
|
1006
|
+
font-size: 0.875em;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.squiffy-setting select
|
|
1010
|
+
{
|
|
1011
|
+
flex: none;
|
|
1012
|
+
max-width: 50%;
|
|
1013
|
+
padding: 0.25em 0.5em;
|
|
1014
|
+
border: 1px solid var(--squiffy-border);
|
|
1015
|
+
border-radius: 0.375em;
|
|
1016
|
+
background-color: var(--squiffy-background);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/* A toggle is a switch */
|
|
1020
|
+
.squiffy-setting input[type=checkbox]
|
|
1021
|
+
{
|
|
1022
|
+
appearance: none;
|
|
1023
|
+
flex: none;
|
|
1024
|
+
position: relative;
|
|
1025
|
+
width: 2.5em;
|
|
1026
|
+
height: 1.5em;
|
|
1027
|
+
margin: 0;
|
|
1028
|
+
border-radius: 0.75em;
|
|
1029
|
+
background-color: color-mix(in srgb, var(--squiffy-text) 25%, transparent);
|
|
1030
|
+
cursor: pointer;
|
|
1031
|
+
transition: background-color 0.15s;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
.squiffy-setting input[type=checkbox]::before
|
|
1035
|
+
{
|
|
1036
|
+
content: "";
|
|
1037
|
+
position: absolute;
|
|
1038
|
+
top: 0.1875em;
|
|
1039
|
+
left: 0.1875em;
|
|
1040
|
+
width: 1.125em;
|
|
1041
|
+
height: 1.125em;
|
|
1042
|
+
border-radius: 50%;
|
|
1043
|
+
background-color: var(--squiffy-background);
|
|
1044
|
+
transition: transform 0.15s;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
.squiffy-setting input[type=checkbox]:checked
|
|
1048
|
+
{
|
|
1049
|
+
background-color: var(--squiffy-link);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
.squiffy-setting input[type=checkbox]:checked::before
|
|
1053
|
+
{
|
|
1054
|
+
transform: translateX(1em);
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
.squiffy-setting-slider
|
|
1058
|
+
{
|
|
1059
|
+
display: flex;
|
|
1060
|
+
flex: none;
|
|
1061
|
+
align-items: center;
|
|
1062
|
+
gap: 0.5rem;
|
|
1063
|
+
width: 45%;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
.squiffy-setting-slider input
|
|
1067
|
+
{
|
|
1068
|
+
flex: 1;
|
|
1069
|
+
min-width: 0;
|
|
1070
|
+
accent-color: var(--squiffy-link);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
.squiffy-setting-slider output
|
|
1074
|
+
{
|
|
1075
|
+
min-width: 2ch;
|
|
1076
|
+
text-align: end;
|
|
1077
|
+
font-variant-numeric: tabular-nums;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
.squiffy-settings-footer
|
|
1081
|
+
{
|
|
1082
|
+
display: flex;
|
|
1083
|
+
justify-content: flex-end;
|
|
1084
|
+
margin-top: 1rem;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
button.squiffy-settings-reset
|
|
1088
|
+
{
|
|
1089
|
+
padding: 0.3em 0.8em;
|
|
1090
|
+
border: 1px solid var(--squiffy-border);
|
|
1091
|
+
border-radius: 0.375em;
|
|
1092
|
+
background: none;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
button.squiffy-settings-reset:hover
|
|
1096
|
+
{
|
|
1097
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
@media (prefers-reduced-motion: reduce)
|
|
1101
|
+
{
|
|
1102
|
+
.squiffy-setting input[type=checkbox],
|
|
1103
|
+
.squiffy-setting input[type=checkbox]::before
|
|
1104
|
+
{
|
|
1105
|
+
transition: none;
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
/* Panels (squiffy.json's "panels"): passages always to hand, beside the story or in a dialog */
|
|
1110
|
+
:root
|
|
1111
|
+
{
|
|
1112
|
+
/* The width of a side panel */
|
|
1113
|
+
--squiffy-side-width: 16rem;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/* A panel's button in the header, when it has a label rather than an icon */
|
|
1117
|
+
button.squiffy-panel-text-button
|
|
1118
|
+
{
|
|
1119
|
+
padding: 0.375em 0.625em;
|
|
1120
|
+
line-height: 1.25;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
/* Space between the panels' buttons and the page's own */
|
|
1124
|
+
button.squiffy-panel-button:not(:has(+ button.squiffy-panel-button))
|
|
1125
|
+
{
|
|
1126
|
+
margin-right: 0.5em;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
/* The side panels. Like the header, they're smaller than the story text. */
|
|
1130
|
+
aside.squiffy-panels-side
|
|
1131
|
+
{
|
|
1132
|
+
font-size: 0.9375rem;
|
|
1133
|
+
line-height: 1.5;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
aside.squiffy-panels-side[hidden],
|
|
1137
|
+
aside.squiffy-panels-side > section.squiffy-panel[hidden]
|
|
1138
|
+
{
|
|
1139
|
+
display: none;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
aside.squiffy-panels-side > section.squiffy-panel + section.squiffy-panel
|
|
1143
|
+
{
|
|
1144
|
+
margin-top: 1rem;
|
|
1145
|
+
padding-top: 1rem;
|
|
1146
|
+
border-top: 1px solid var(--squiffy-border);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
.squiffy-panel > :first-child
|
|
1150
|
+
{
|
|
1151
|
+
margin-top: 0;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
.squiffy-panel > :last-child
|
|
1155
|
+
{
|
|
1156
|
+
margin-bottom: 0;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
.squiffy-panel img
|
|
1160
|
+
{
|
|
1161
|
+
max-width: 100%;
|
|
1162
|
+
height: auto;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/* On a screen too narrow for the story and a side panel, the panel is a button in the header,
|
|
1166
|
+
which shows it in a dialog */
|
|
1167
|
+
@media (min-width: 64rem)
|
|
1168
|
+
{
|
|
1169
|
+
button.squiffy-panel-side-button
|
|
1170
|
+
{
|
|
1171
|
+
display: none;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
@media (max-width: 63.99rem)
|
|
1176
|
+
{
|
|
1177
|
+
aside.squiffy-panels-side
|
|
1178
|
+
{
|
|
1179
|
+
display: none;
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
/* The dialog a panel's button opens */
|
|
1184
|
+
dialog.squiffy-panel-dialog
|
|
1185
|
+
{
|
|
1186
|
+
width: min(28rem, calc(100vw - 2rem));
|
|
1187
|
+
max-height: calc(100vh - 2rem);
|
|
1188
|
+
box-sizing: border-box;
|
|
1189
|
+
padding: 1rem 1.25rem 1.25rem;
|
|
1190
|
+
border: 1px solid var(--squiffy-border);
|
|
1191
|
+
border-radius: 0.75rem;
|
|
1192
|
+
background-color: var(--squiffy-background);
|
|
1193
|
+
color: var(--squiffy-text);
|
|
1194
|
+
font-family: var(--squiffy-font-family, inherit);
|
|
1195
|
+
font-size: var(--squiffy-font-size, 1rem);
|
|
1196
|
+
line-height: var(--squiffy-line-height, 1.5);
|
|
1197
|
+
box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.25);
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
dialog.squiffy-panel-dialog::backdrop
|
|
1201
|
+
{
|
|
1202
|
+
background-color: rgb(0 0 0 / 0.4);
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
.squiffy-panel-dialog-header
|
|
1206
|
+
{
|
|
1207
|
+
display: flex;
|
|
1208
|
+
align-items: center;
|
|
1209
|
+
justify-content: space-between;
|
|
1210
|
+
gap: 1rem;
|
|
1211
|
+
margin-bottom: 0.75rem;
|
|
1212
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.squiffy-panel-dialog-header h2
|
|
1216
|
+
{
|
|
1217
|
+
margin: 0;
|
|
1218
|
+
font-size: 1.125rem;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
button.squiffy-panel-dialog-close
|
|
1222
|
+
{
|
|
1223
|
+
display: inline-flex;
|
|
1224
|
+
padding: 0.25em;
|
|
1225
|
+
border: none;
|
|
1226
|
+
border-radius: 0.375em;
|
|
1227
|
+
background: none;
|
|
1228
|
+
color: var(--squiffy-muted);
|
|
1229
|
+
cursor: pointer;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
button.squiffy-panel-dialog-close:hover
|
|
1233
|
+
{
|
|
1234
|
+
color: var(--squiffy-text);
|
|
1235
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
button.squiffy-panel-dialog-close:focus-visible
|
|
1239
|
+
{
|
|
1240
|
+
outline: 2px solid var(--squiffy-link);
|
|
1241
|
+
outline-offset: 2px;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
button.squiffy-panel-dialog-close svg
|
|
1245
|
+
{
|
|
1246
|
+
width: 1.25em;
|
|
1247
|
+
height: 1.25em;
|
|
1248
|
+
fill: none;
|
|
1249
|
+
stroke: currentColor;
|
|
1250
|
+
stroke-width: 2;
|
|
1251
|
+
stroke-linecap: round;
|
|
1252
|
+
stroke-linejoin: round;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
/* Page layout styles for an exported story. See https://squiffystory.com/styling/ for how to customise these. */
|
|
1256
|
+
|
|
1257
|
+
:root
|
|
1258
|
+
{
|
|
1259
|
+
/* The width of the story text */
|
|
1260
|
+
--squiffy-max-width: 42rem;
|
|
1261
|
+
/* The story's font. Charter, or Georgia if the reader doesn't have it */
|
|
1262
|
+
--squiffy-font-family: Charter, "Bitstream Charter", Georgia, serif;
|
|
1263
|
+
/* The size of the story text. The header's buttons are smaller, and don't change with it */
|
|
1264
|
+
--squiffy-font-size: 1.125rem;
|
|
1265
|
+
/* The space between lines of text */
|
|
1266
|
+
--squiffy-line-height: 1.6;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/* Follow the reader's light or dark system setting, or what they chose with the theme button.
|
|
1270
|
+
To keep a story light (or dark) whatever the setting, set ":root { color-scheme: light; }"
|
|
1271
|
+
(or dark). These rules use :where() so that a :root rule like that overrides them, and the
|
|
1272
|
+
theme button is hidden. */
|
|
1273
|
+
:where(:root)
|
|
1274
|
+
{
|
|
1275
|
+
color-scheme: light dark;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
:where(:root[data-squiffy-theme="light"])
|
|
1279
|
+
{
|
|
1280
|
+
color-scheme: light;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
:where(:root[data-squiffy-theme="dark"])
|
|
1284
|
+
{
|
|
1285
|
+
color-scheme: dark;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
body
|
|
1289
|
+
{
|
|
1290
|
+
margin: 0;
|
|
1291
|
+
background-color: var(--squiffy-background);
|
|
1292
|
+
color: var(--squiffy-text);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
/* Wraps the header and the story: sets the page width and font */
|
|
1296
|
+
div#squiffy-container
|
|
1297
|
+
{
|
|
1298
|
+
max-width: var(--squiffy-max-width);
|
|
1299
|
+
margin-left: auto;
|
|
1300
|
+
margin-right: auto;
|
|
1301
|
+
padding: 0 1.25rem 3rem;
|
|
1302
|
+
font-family: var(--squiffy-font-family);
|
|
1303
|
+
line-height: var(--squiffy-line-height);
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
/* The bar above the story containing the Back, Restart and light/dark buttons. It stays at the
|
|
1307
|
+
top of the window as the story scrolls under it. */
|
|
1308
|
+
div#squiffy-header
|
|
1309
|
+
{
|
|
1310
|
+
position: sticky;
|
|
1311
|
+
top: 0;
|
|
1312
|
+
z-index: 1;
|
|
1313
|
+
padding: 0.5rem 0;
|
|
1314
|
+
background-color: var(--squiffy-background);
|
|
1315
|
+
font-size: 0.875rem;
|
|
1316
|
+
text-align: right;
|
|
1317
|
+
white-space: nowrap;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
/* A short fade under the header, so the story scrolls under it rather than being cut off */
|
|
1321
|
+
div#squiffy-header::after
|
|
1322
|
+
{
|
|
1323
|
+
content: "";
|
|
1324
|
+
position: absolute;
|
|
1325
|
+
left: 0;
|
|
1326
|
+
right: 0;
|
|
1327
|
+
top: 100%;
|
|
1328
|
+
height: 0.75rem;
|
|
1329
|
+
background: linear-gradient(var(--squiffy-background), transparent);
|
|
1330
|
+
pointer-events: none;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/* Space between the Back, Restart and light/dark buttons */
|
|
1334
|
+
button.squiffy-header-button + button.squiffy-header-button
|
|
1335
|
+
{
|
|
1336
|
+
margin-left: 0.25em;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/* The button that switches between light and dark mode. It shows a moon in light mode and a sun
|
|
1340
|
+
in dark mode. */
|
|
1341
|
+
button#squiffy-theme:not([data-next="light"]) .squiffy-icon-light,
|
|
1342
|
+
button#squiffy-theme[data-next="light"] .squiffy-icon-dark
|
|
1343
|
+
{
|
|
1344
|
+
display: none;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
/* The mute button (#444), for a story with music or sounds. It shows a speaker, crossed out
|
|
1348
|
+
when the story is muted. */
|
|
1349
|
+
button#squiffy-mute.squiffy-muted .squiffy-icon-sound,
|
|
1350
|
+
button#squiffy-mute:not(.squiffy-muted) .squiffy-icon-muted
|
|
1351
|
+
{
|
|
1352
|
+
display: none;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/* With a side panel (squiffy.json's "panels"), the page is wider, with the panel to the right of
|
|
1356
|
+
the story. It stays in view as the story scrolls, under the header. On a narrower screen, it's a
|
|
1357
|
+
button in the header instead. */
|
|
1358
|
+
@media (min-width: 64rem)
|
|
1359
|
+
{
|
|
1360
|
+
div#squiffy-container.squiffy-has-side
|
|
1361
|
+
{
|
|
1362
|
+
display: grid;
|
|
1363
|
+
grid-template-columns: minmax(0, 1fr) var(--squiffy-side-width);
|
|
1364
|
+
column-gap: 2.5rem;
|
|
1365
|
+
align-items: start;
|
|
1366
|
+
max-width: calc(var(--squiffy-max-width) + var(--squiffy-side-width) + 2.5rem);
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
div#squiffy-container.squiffy-has-side > div#squiffy-header
|
|
1370
|
+
{
|
|
1371
|
+
grid-column: 1 / -1;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/* :where() takes the container's id out of the selector's specificity, so a story's own
|
|
1375
|
+
aside.squiffy-panels-side { ... } rule, which comes after this, changes the border and the
|
|
1376
|
+
padding too */
|
|
1377
|
+
:where(div#squiffy-container.squiffy-has-side) > aside.squiffy-panels-side
|
|
1378
|
+
{
|
|
1379
|
+
position: sticky;
|
|
1380
|
+
top: 3.5rem;
|
|
1381
|
+
padding-left: 1.25rem;
|
|
1382
|
+
border-left: 1px solid var(--squiffy-border);
|
|
1383
|
+
max-height: calc(100vh - 4.5rem);
|
|
1384
|
+
overflow-y: auto;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
/* The story text */
|
|
1389
|
+
div#squiffy
|
|
1390
|
+
{
|
|
1391
|
+
font-size: var(--squiffy-font-size);
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
div#squiffy :is(h1, h2, h3, h4, h5, h6)
|
|
1395
|
+
{
|
|
1396
|
+
line-height: 1.25;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
div#squiffy p
|
|
1400
|
+
{
|
|
1401
|
+
text-wrap: pretty;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/* Stop images overflowing the page */
|
|
1405
|
+
div#squiffy img
|
|
1406
|
+
{
|
|
1407
|
+
max-width: 100%;
|
|
1408
|
+
height: auto;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
/* The preview scrolls the story within the frame, with the text centred as on the exported page */
|
|
1412
|
+
html, body { height: 100%; }
|
|
1413
|
+
div#squiffy-container { max-width: none; height: 100%; padding: 0; }
|
|
1414
|
+
#squiffy, .squiffy-preview-story, .squiffy-preview-story > div { height: 100%; box-sizing: border-box; }
|
|
1415
|
+
.squiffy-preview-story > div { padding: 1em max(1.25rem, calc((100% - var(--squiffy-max-width)) / 2)); }
|
|
1416
|
+
/* The story's panels: their buttons above the story, and side panels to its right */
|
|
1417
|
+
#squiffy { display: flex; flex-direction: column; }
|
|
1418
|
+
.squiffy-preview-header { flex: none; padding: 0.5rem 0.75rem 0; font-family: system-ui, sans-serif; font-size: 0.875rem; text-align: right; }
|
|
1419
|
+
.squiffy-preview-header:empty { display: none; }
|
|
1420
|
+
.squiffy-preview-body { flex: 1; min-height: 0; display: flex; }
|
|
1421
|
+
#squiffy .squiffy-preview-body > .squiffy-preview-story { flex: 1; min-width: 0; height: 100%; }
|
|
1422
|
+
.squiffy-preview-body > aside.squiffy-panels-side { flex: none; width: var(--squiffy-side-width); box-sizing: border-box; overflow-y: auto; padding: 1em 1.25rem 1em 0; }
|
|
1423
|
+
</style>
|
|
1424
|
+
</head>
|
|
1425
|
+
<body>
|
|
1426
|
+
<div id="squiffy-container"><div id="squiffy"></div></div>
|
|
1427
|
+
<script>
|
|
1428
|
+
(function(){var Dl=Object.create,_r=Object.defineProperty,ql=Object.getOwnPropertyDescriptor,Bl=Object.getOwnPropertyNames,Hl=Object.getPrototypeOf,Gn=Object.prototype.hasOwnProperty,fe=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),Ls=(e,t)=>{let s={};for(var r in e)_r(s,r,{get:e[r],enumerable:!0});return t||_r(s,Symbol.toStringTag,{value:"Module"}),s},Fl=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Bl(t),n=0,o=i.length,c;n<o;n++)c=i[n],!Gn.call(e,c)&&c!==s&&_r(e,c,{get:(u=>t[u]).bind(null,c),enumerable:!(r=ql(t,c))||r.enumerable});return e},Vl=(e,t,s)=>(s=e!=null?Dl(Hl(e)):{},Fl(t||!e||!e.__esModule||!Gn.call(e,"default")?_r(s,"default",{value:e,enumerable:!0}):s,e)),Xn=e=>e===void 0?[]:(Array.isArray(e)?e:String(e).split(/\s+/)).map(String).filter(t=>t);function Yn(e,t){const s=e.tags??[];return Xn(t.tagged).every(r=>s.includes(r))&&!Xn(t.untagged).some(r=>s.includes(r))}var zl=e=>e===""||e.startsWith("@");function Ul(e,t){const s=e.sections[t];if(!s)throw new Error(`There's no section called "${t}"`);return s}function wi(e,t,s,r={}){const i=t===void 0?[e.sections[s],e.sections[""]]:[Ul(e,t)],n=[];for(const o of i)for(const[c,u]of Object.entries(o?.passages??{}))!zl(c)&&!n.includes(c)&&Yn(u,r)&&n.push(c);return n}function ki(e,t={}){return Object.entries(e.sections).filter(([s,r])=>s!==""&&Yn(r,t)).map(([s])=>s)}function xi(e,t,s){const r=e.sections[s]?.passages?.[t]??e.sections[""]?.passages?.[t]??e.sections[t];if(!r)throw new Error(`There's no section or passage called "${t}"`);return[...r.tags??[]]}function Xs(e){"@babel/helpers - typeof";return Xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xs(e)}function Wl(e,t){if(Xs(e)!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||"default");if(Xs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jl(e){var t=Wl(e,"string");return Xs(t)=="symbol"?t:t+""}function qe(e,t,s){return(t=jl(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Gl(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xl(e,t){Gl(e,t),t.add(e)}function wr(e,t,s){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:s;throw new TypeError("Private element is not present on this object")}var Rs,kr;function Ti(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ms=Ti();function Zn(e){ms=e}var vs={exec:()=>null};function ys(e){let t=[];return s=>{let r=Math.max(0,Math.min(3,s-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function de(e,t=""){let s=typeof e=="string"?e:e.source,r={replace:(i,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(Qe.caret,"$1"),s=s.replace(i,o),r},getRegex:()=>new RegExp(s,t)};return r}var Jn=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Qe={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ys(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ys(e=>new RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:ys(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:ys(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:ys(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:ys(e=>new RegExp(`^ {0,${e}}(?:</?(?:${Zs})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:ys(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},Yl=/^(?:[ \t]*(?:\n|$))+/,Zl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,Ys=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ci=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Kn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,Qn=de(Kn).replace(/bull/g,Ci).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ql=de(Kn).replace(/bull/g,Ci).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ei=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ec=/^[^\n]+/,Ai=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,tc=de(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ai).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),sc=de(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ci).getRegex(),Zs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Pi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rc=de("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Pi).replace("tag",Zs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eo=e=>de(Ei).replace("hr",Ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Zs).getRegex(),ic=eo(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),nc=eo(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Li={blockquote:de(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",nc).getRegex(),code:Zl,def:tc,fences:Jl,heading:Kl,hr:Ys,html:rc,lheading:Qn,list:sc,newline:Yl,paragraph:ic,table:vs,text:ec},to=de("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Zs).getRegex(),oc={...Li,lheading:Ql,table:to,paragraph:de(Ei).replace("hr",Ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",to).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Zs).getRegex()},ac={...Li,html:de(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment",Pi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:de(Ei).replace("hr",Ys).replace("heading",` *#{1,6} *[^
|
|
1429
|
+
]`).replace("lheading",Qn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lc=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cc=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,so=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,uc=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ut=/[\p{P}\p{S}]/u,Os=/[\s\p{P}\p{S}]/u,Js=/[^\s\p{P}\p{S}]/u,hc=de(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Os).getRegex(),dc=/[\p{Pi}\p{Ps}"']/u,ro=/(?!~)[\p{P}\p{S}]/u,fc=/(?!~)[\s\p{P}\p{S}]/u,pc=/(?:[^\s\p{P}\p{S}]|~)/u,gc=de(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Jn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),io=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mc=de(io,"u").replace(/punct/g,Ut).getRegex(),vc=de(io,"u").replace(/punct/g,ro).getRegex(),yc=de(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,"u").replace(/openQuote/g,dc).replace(/punct/g,Ut).getRegex(),no="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bc=de(no,"gu").replace(/notPunctSpace/g,Js).replace(/punctSpace/g,Os).replace(/punct/g,Ut).getRegex(),Sc=de(no,"gu").replace(/notPunctSpace/g,pc).replace(/punctSpace/g,fc).replace(/punct/g,ro).getRegex(),_c=de("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Js).replace(/punctSpace/g,Os).replace(/punct/g,Ut).getRegex(),wc=de("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Js).replace(/punctSpace/g,Os).replace(/punct/g,Ut).getRegex(),kc=de("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Js).replace(/punctSpace/g,Os).replace(/punct/g,Ut).getRegex(),xc=de(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ut).getRegex(),Tc=de("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Js).replace(/punctSpace/g,Os).replace(/punct/g,Ut).getRegex(),Cc=de(/\\(punct)/,"gu").replace(/punct/g,Ut).getRegex(),Ec=de(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,Ut).getRegex(),Ac=de(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Pc=de(Pi).replace("(?:-->|$)","-->").getRegex(),Lc=de("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Pc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),oo=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,xr=de(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",oo).getRegex(),Rc=de(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",xr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Oc=de(/^!?\[(label)\]\[(ref)\]/).replace("label",xr).replace("ref",Ai).getRegex(),Ic=de(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ai).getRegex(),ao=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Mc=de(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",oo).getRegex(),Nc=de("reflink|nolink(?!\\()","g").replace("reflink",de(/^!?\[(label)\]\[(ref)\]/).replace("label",Mc).replace("ref",ao).getRegex()).replace("nolink",de(/^!?\[(ref)\](?:\[\])?/).replace("ref",ao).getRegex()).getRegex(),lo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,$c=de(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Ri={_backpedal:vs,anyPunctuation:Cc,anyPunctuationOutsideCode:Ec,autolink:Ac,blockSkip:gc,br:so,code:cc,del:vs,delLDelim:vs,delRDelim:vs,emStrongLDelim:mc,emStrongRDelimAst:bc,emStrongRDelimUnd:wc,escape:lc,link:Rc,nolink:Ic,punctuation:hc,reflink:Oc,reflinkSearch:Nc,tag:Lc,text:uc,url:vs},Dc={...Ri,emStrongLDelim:yc,emStrongRDelimAst:_c,emStrongRDelimUnd:kc,link:de(/^!?\[(label)\]\((.*?)\)/).replace("label",xr).getRegex(),reflink:de(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xr).getRegex()},Oi={...Ri,emStrongRDelimAst:Sc,emStrongLDelim:vc,delLDelim:xc,delRDelim:Tc,url:de(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",$c).replace("protocol",lo).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:de(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",lo).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",Jn?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},qc={...Oi,br:de(so).replace("{2,}","*").getRegex(),text:de(Oi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Tr={normal:Li,gfm:oc,pedantic:ac},Ks={normal:Ri,gfm:Oi,breaks:qc,pedantic:Dc},Bc={"&":"&","<":"<",">":">",'"':""","'":"'"},co=e=>Bc[e];function bt(e,t){if(t){if(Qe.escapeTest.test(e))return e.replace(Qe.escapeReplace,co)}else if(Qe.escapeTestNoEncode.test(e))return e.replace(Qe.escapeReplaceNoEncode,co);return e}function Hc(e){return Qe.numericCharacterReference.test(e)?e.replace(Qe.numericCharacterReferenceOrAmpersand,(t,s,r)=>{if(s===void 0&&r===void 0)return"&";let i=s===void 0?Number.parseInt(r,16):Number.parseInt(s,10);return i===0||i>1114111||i>=55296&&i<=57343?"�":i===38?"&":String.fromCodePoint(i)}):e}function uo(e){try{e=encodeURI(e).replace(Qe.percentDecode,"%")}catch{return null}return e}function ho(e,t){let s=e.replace(Qe.findPipe,(i,n,o)=>{let c=!1,u=n;for(;--u>=0&&o[u]==="\\";)c=!c;return c?"|":" |"}).split(Qe.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Qe.slashPipe,"|");return s}function Yt(e,t,s){let r=e.length;if(r===0)return"";let i=0;for(;i<r;){let n=e.charAt(r-i-1);if(n===t&&!s)i++;else if(n!==t&&s)i++;else break}return e.slice(0,r-i)}function fo(e){let t=e.split(`
|
|
1430
|
+
`),s=t.length-1;for(;s>=0&&Qe.blankLine.test(t[s]);)s--;return t.length-s<=2?e:t.slice(0,s+1).join(`
|
|
1431
|
+
`)}function Cr(e){return e.trim().replace(Qe.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function po(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let s=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])s++;else if(e[r]===t[1]&&(s--,s<0))return r;return s>0?-2:-1}var Is=new WeakMap;function Ii(e){let t={"*":-1,_:-1},s=-1,r=e.length;for(let i=0;i<r;i++){let n=e[i];if(n!=="*"&&n!=="_"&&n!=="~")continue;let o=i===0?`
|
|
1432
|
+
`:e[i-1],c=i+1;for(;c<r&&e[c]===n;)c++;o!==" "&&o!==" "&&o!==`
|
|
1433
|
+
`&&o!=="\r"&&o!=="\f"&&(n==="~"?s=i:t[n]=i),i=c-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:s}}function Fc(e,t){let s=Ii(t),r=Is.get(e);r?r.push(s):Is.set(e,[s])}function Vc(e){let t=Is.get(e);t&&(t.pop(),t.length===0&&Is.delete(e))}function zc(e,t,s){let r=Is.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[s]:Ii(t).lastPossibleEmStrongCloserIndex[s]}function Uc(e,t){let s=Is.get(e)?.at(-1);return s&&s.maskedSrc===t?s.lastPossibleDelCloserIndex:Ii(t).lastPossibleDelCloserIndex}function Er(e,t=0){let s=t,r="";for(let i of e)if(i===" "){let n=4-s%4;r+=" ".repeat(n),s+=n}else r+=i,s++;return r}function go(e,t,s,r,i){let n=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1"),u=e[0].charAt(0)==="!",h=r.state.inLink,d=r.state.linkEmitted,a=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(c),l=r.state.linkEmitted;if(r.state.linkEmitted=d,r.state.inLink=h,!u){if(l){r.state.inRawBlock=a;return}r.state.linkEmitted=!0}return{type:u?"image":"link",raw:s,href:n,title:o,text:c,tokens:f}}function Wc(e,t,s){let r=e.match(s.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
1434
|
+
`).map(n=>{let o=n.match(s.other.beginningSpace);if(o===null)return n;let[c]=o;return n.slice(Math.min(c.length,i.length))}).join(`
|
|
1435
|
+
`)}function mo(e,t,s,r){if(!t.includes("<"))return!1;for(let i=0;i<t.length;i++){if(t[i]==="\\"){i++;continue}if(t[i]==="`"){let c=r.inline.code.exec(t.slice(i));if(c){i+=c[0].length-1;continue}}if(t[i]!=="<")continue;let n=e.slice(s+i),o=r.inline.tag.exec(n)||r.inline.autolink.exec(n);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var Ms=class{constructor(e){qe(this,"options",void 0),qe(this,"rules",void 0),qe(this,"lexer",void 0),this.options=e||ms}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let s=this.options.pedantic?t[0]:fo(t[0]);return{type:"code",raw:s,codeBlockStyle:"indented",text:s.replace(this.rules.other.codeRemoveIndent,"")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let s=t[0],r=Wc(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){let r=Yt(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(s=r.trim())}return{type:"heading",raw:Yt(t[0],`
|
|
1436
|
+
`),depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Yt(t[0],`
|
|
1437
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let s=Yt(t[0],`
|
|
1438
|
+
`).split(`
|
|
1439
|
+
`),r="",i="",n=[];for(;s.length>0;){let o=!1,c=[],u=0;for(;u<s.length;u++)if(this.rules.other.blockquoteStart.test(s[u]))c.push(s[u]),o=!0;else if(!o)c.push(s[u]);else break;s=s.slice(u);let h=c.join(`
|
|
1440
|
+
`),d=h.replace(this.rules.other.blockquoteMarkerWhitespace,(l,p,g)=>p+Er(g,p.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
|
1441
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
1442
|
+
${h}`:h,i=i?`${i}
|
|
1443
|
+
${d}`:d;let a=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,n,!0),this.lexer.state.top=a,s.length===0)break;let f=n.at(-1);if(f?.type==="code"||f?.type==="heading"||f?.type==="hr"||f?.type==="html"||f?.type==="table")break;if(f?.type==="blockquote"){let l=f,p=s.join(`
|
|
1444
|
+
`),g=l.raw+`
|
|
1445
|
+
`+p.replace(this.rules.other.blockquoteSetextReplace2,""),v=this.blockquote(g);n[n.length-1]=v;let S=g.substring(v.raw.length).replace(/^\n/,""),w=S?S.split(`
|
|
1446
|
+
`).length:0,y=w?s.slice(0,-w):s;if(y.length>0&&(r=`${r}
|
|
1447
|
+
${y.join(`
|
|
1448
|
+
`)}`),i=i.substring(0,i.length-l.text.length)+v.text,s=s.slice(y.length),s.length>0&&this.rules.other.blockquoteStart.test(s[0]))continue;break}else if(f?.type==="list"){let l=f,p=l.raw+`
|
|
1449
|
+
`+s.join(`
|
|
1450
|
+
`),g=this.list(p);n[n.length-1]=g;let v=g.raw.length>l.raw.length?p.slice(l.raw.length+1,g.raw.length).split(`
|
|
1451
|
+
`).length:0;if(v>0){let S=s.slice(0,v).join(`
|
|
1452
|
+
`);r=`${r}
|
|
1453
|
+
${S}`,i=`${i}
|
|
1454
|
+
${S}`}s=s.slice(v);continue}}return{type:"blockquote",raw:r,tokens:n,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type==="text"&&!this.rules.other.listInterruptsParagraph.test(e))return;let s=e,r=()=>s.length-e.length,i=t[1].trim(),n=i.length>1,o={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let c=this.rules.other.listItemRegex(i),u=!1;for(;e;){let d=!1,a="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;let f=r();e=e.substring(t[0].length);let l=t[2].split(`
|
|
1455
|
+
`,1)[0],p=t[1].length,g=this.options.pedantic?Er(l,p):l.replace(this.rules.other.leadingSpaceTab,m=>Er(m,p)),v=e.split(`
|
|
1456
|
+
`,1)[0],S=!g.trim(),w=0;if(this.options.pedantic?(w=2,a=g.trimStart()):S?w=p+1:(w=g.search(this.rules.other.nonSpaceChar),w=w>4?1:w,a=g.slice(w),w+=p),S&&this.rules.other.blankLine.test(v)&&(e=e.substring(v.length+1),d=!0),!d){let m=this.rules.other.nextBulletRegex(w),_=this.rules.other.hrRegex(w),C=this.rules.other.fencesBeginRegex(w),R=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(w):this.rules.other.headingBeginRegex(w),b=this.rules.other.htmlBeginRegex(w),x=this.rules.other.blockquoteBeginRegex(w),T=!1;for(;e;){let A=e.split(`
|
|
1457
|
+
`,1)[0],L;if(v=A,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),L=v):L=v.replace(this.rules.other.leadingSpaceTab,D=>Er(D)),C.test(v)||R.test(v)||b.test(v)||x.test(v)||m.test(v)||_.test(v))break;if(L.search(this.rules.other.nonSpaceChar)>=w||!v.trim())a+=`
|
|
1458
|
+
`+L.slice(w),T=!1;else{if(S||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(g)||R.test(g)||b.test(g)||_.test(g))break;if(!this.options.pedantic&&!T){let B=g.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(B)||this.rules.block.heading.test(B)||this.rules.block.hr.test(B))break}let D=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(v)&&this.rules.block.lheading.test(`${g}
|
|
1459
|
+
${v}`)?` ${L.replace(/^ {0,3}/,"")}`:v;a+=`
|
|
1460
|
+
`+D,T=!0}S=!v.trim(),e=e.substring(A.length+1),g=L.slice(w)}}let y=s.slice(f,r());o.loose||(u?o.loose=!0:this.rules.other.doubleBlankLine.test(y)&&(u=!0)),o.items.push({type:"list_item",raw:y,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=s.slice(0,r()).trimEnd();for(let d of o.items)if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),!o.loose){let a=d.tokens.filter(f=>f.type==="space");o.loose=a.length>0&&a.some(f=>this.rules.other.anyLine.test(f.raw))}for(let d of o.items){let a=d.tokens[0];if(d.task&&(a?.type==="text"||a?.type==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),a.raw=a.raw.replace(this.rules.other.listReplaceTask,""),a.text=a.text.replace(this.rules.other.listReplaceTask,"");for(let l=this.lexer.inlineQueue.length-1;l>=0;l--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[l].src)){this.lexer.inlineQueue[l].src=this.lexer.inlineQueue[l].src.replace(this.rules.other.listReplaceTask,"");break}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let l={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=l.checked,o.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=l.raw+d.tokens[0].raw,d.tokens[0].text=l.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(l)):d.tokens.unshift({type:"paragraph",raw:l.raw,text:l.raw,tokens:[l]}):d.tokens.unshift(l)}}else d.task&&(d.task=!1)}if(o.loose)for(let d of o.items){d.loose=!0;for(let a of d.tokens)a.type==="text"&&(a.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let s=fo(t[0]);return{type:"html",block:!0,raw:s,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:s}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&po(t[2],"()")!==-1)return;let s=Cr(t[1]),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:Yt(t[0],`
|
|
1461
|
+
`),href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let s=ho(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
1462
|
+
`):[],n={type:"table",raw:Yt(t[0],`
|
|
1463
|
+
`),header:[],align:[],rows:[]};if(s.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<s.length;o++)n.header.push({text:s[o],tokens:this.lexer.inline(s[o]),header:!0,align:n.align[o]});for(let o of i)n.rows.push(ho(o,n.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:n.align[u]})));return n}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let s=t[1].trim();return{type:"heading",raw:Yt(t[0],`
|
|
1464
|
+
`),depth:t[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let s=t[1].charAt(t[1].length-1)===`
|
|
1465
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let s=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mo(e,t[1],s,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let c=Yt(r.slice(0,-1),"\\");if((r.length-c.length)%2===0)return}else{let c=po(t[2],"()");if(c===-2)return;if(c>-1){let u=(t[0].indexOf("!")===0?5:4)+t[1].length+c;t[2]=t[2].substring(0,c),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let i=Yt(t[0].slice(0,-1),"\\");if((t[0].length-i.length)%2===0)return;let n=t[2],o="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(n);c&&(n=c[1],o=c[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),go(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let r=s[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mo(e,s[1],r,this.rules))return;let i=t[Cr(s[2]||s[1])];if(!i){let n=s[0].charAt(0);return{type:"text",raw:n,text:n}}return go(s,i,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],n=s===i,o=t.length-e.length,c=o;for(;!this.options.pedantic&&c>0&&t[c-1]===i;)c--;let u=[...t.slice(Math.max(0,c-2),c)].at(-1)??"",h=u==="*"||u==="_"||!!this.rules.inline.punctuation.exec(u);c<o&&(s=u);let d=c<o?h:s==="*"||s==="_"||!!this.rules.inline.punctuation.exec(s);if(r[4]&&s.match(this.rules.other.unicodeAlphaNumeric))return;let a=r[1]||r[3]||"";if(!a||!s||d){let f=[...r[0]].length-1,l,p,g=f,v=0,S=o-c+f,w=!this.options.pedantic&&!!u.trim()&&(!!a||i==="*"&&!h);if(i!=="*"&&i!=="_")return;let y=i==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,m=zc(this,t,i),_=t.length-e.length+f;if(m<_)return;t=t.slice(-1*e.length+f);let C=m-_;for(y.lastIndex=0;(r=y.exec(t))!==null&&!(r.index>C);){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(p=[...l].length,r[3]||r[4]){g+=p;continue}else if(r[5]||r[6]||w){if(n&&(r[5]||r[6]))break;if(S%3&&!((S+p)%3)){v+=p;continue}}if(g-=p,g>0)continue;p=Math.min(p,p+g+v);let R=[...r[0]][0].length,b=e.slice(0,f+r.index+R+p);if(Math.min(f,p)%2){let T=b.slice(1,-1);return{type:"em",raw:b,text:T,tokens:this.lexer.inlineTokens(T)}}let x=b.slice(2,-2);return{type:"strong",raw:b,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(s),i=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&i&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,s=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!s||this.rules.inline.punctuation.exec(s))){let i=[...r[0]].length-1,n,o,c=i,u=this.rules.inline.delRDelim,h=Uc(this,t),d=t.length-e.length+i;if(h<d)return;t=t.slice(-1*e.length+i);let a=h-d;for(u.lastIndex=0;(r=u.exec(t))!==null&&!(r.index>a);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let f=[...r[0]][0].length,l=e.slice(0,i+r.index+f+o),p=l.slice(i,-i);return{type:"del",raw:l,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]==="@"?(s=t[1],r="mailto:"+s):(s=t[1],r=s),{type:"link",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let s,r;if(t[2]==="@")s=t[0],r="mailto:"+s;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);s=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:s,href:r,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:s?t[0]:Hc(t[0]),escaped:s}}}},$t=(Rs=new WeakSet,class Wn{constructor(t){Xl(this,Rs),qe(this,"tokens",void 0),qe(this,"options",void 0),qe(this,"state",void 0),qe(this,"inlineQueue",void 0),qe(this,"tokenizer",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ms,this.options.tokenizer=this.options.tokenizer||new Ms,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let s={other:Qe,block:Tr.normal,inline:Ks.normal};this.options.pedantic?(s.block=Tr.pedantic,s.inline=Ks.pedantic):this.options.gfm&&(s.block=Tr.gfm,this.options.breaks?s.inline=Ks.breaks:s.inline=Ks.gfm),this.tokenizer.rules=s}static get rules(){return{block:Tr,inline:Ks}}static lex(t,s){return new Wn(s).lex(t)}static lexInline(t,s){return new Wn(s).inlineTokens(t)}lex(t){t=t.replace(Qe.carriageReturn,`
|
|
1466
|
+
`),this.blockTokens(t,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let r=this.inlineQueue[s];this.state.inRawBlock=!1,this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,s=[],r=!1){this.tokenizer.lexer=this;let i=this.state.lastToken;this.options.pedantic&&(t=t.replace(Qe.tabCharGlobal," ").replace(Qe.spaceLine,""));let n=1/0;for(;t;){if(t.length<n)n=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}this.state.lastToken=s.at(-1);let o;if(this.options.extensions?.block?.some(u=>(o=u.call({lexer:this},t,s))?(t=t.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let u=s.at(-1);o.raw.length===1&&u!==void 0?u.raw+=`
|
|
1467
|
+
`:s.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let u=s.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
1468
|
+
`)?"":`
|
|
1469
|
+
`)+o.raw,u.text+=`
|
|
1470
|
+
`+o.text,this.inlineQueue.at(-1).src=u.text):s.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let u=s.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
1471
|
+
`)?"":`
|
|
1472
|
+
`)+o.raw,u.text+=`
|
|
1473
|
+
`+o.raw,this.inlineQueue.at(-1).src=u.text):(this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title}),s.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),s.push(o);continue}let c=t;if(this.options.extensions?.startBlock){let u=1/0,h=t.slice(1),d;this.options.extensions.startBlock.forEach(a=>{d=a.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(c))){let u=s.at(-1);r&&u?.type==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
1474
|
+
`)?"":`
|
|
1475
|
+
`)+o.raw,u.text+=`
|
|
1476
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):s.push(o),r=c.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let u=s.at(-1);u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
1477
|
+
`)?"":`
|
|
1478
|
+
`)+o.raw,u.text+=`
|
|
1479
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):s.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=i,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}linkInText(t){if(!t.includes("["))return!1;let s=this.tokenizer.rules.inline.link;for(let r of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(r[0])&&t.charAt(r.index-1)!=="!")return!0;for(let r of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=r[0],n=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Cr(i.slice(n+1,-1))))&&!(n>1&&this.linkInText(i.slice(1,n-1))))return!0}return!1}inlineTokens(t,s=[]){this.tokenizer.lexer=this;let r=this.state.linkParenPossible;this.state.linkParenPossible=r&&t.includes(")");try{return wr(Rs,this,jc).call(this,t,s)}finally{this.state.linkParenPossible=r}}infiniteLoopError(t){let s="Infinite loop on byte: "+t;if(this.options.silent)console.error(s);else throw new Error(s)}});function jc(e,t){let s=e.includes("*")||e.includes("_")||e.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==Ms.prototype.emStrong||this.tokenizer.del!==Ms.prototype.del?wr(Rs,this,Yc).call(this,e):e;Fc(this.tokenizer,s);try{return wr(Rs,this,Gc).call(this,e,s,t)}finally{Vc(this.tokenizer)}}function Gc(e,t,s){let r=!1,i="",n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},e,s))?(e=e.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let u=s.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(e,t,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),s.push(o);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0,h=e.slice(1),d;this.options.extensions.startInline.forEach(a=>{d=a.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(i=o.raw.slice(-1)),r=!0;let u=s.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):s.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}function Xc(e){let{blockSkip:t,tag:s,autolink:r}=this.tokenizer.rules.inline,i="",n=0,o;for(t.lastIndex=0;o=t.exec(e);){let c=o.index+(o[2]?o[2].length:0),u=o.index+o[0].length;if(e.charAt(c)==="<"){let h=e.slice(c),d=s.exec(h)||r.exec(h);if(!d){t.lastIndex=c+1;continue}u=c+d[0].length,t.lastIndex=u}i+=e.slice(n,c)+"["+"a".repeat(u-c-2)+"]",n=u}return i+e.slice(n)}function Yc(e){let t=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,r=i=>{let n=i.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Cr(i.slice(n+1,-1))))return i;if(n>1&&i.charAt(0)!=="!"){let o=i.slice(1,n-1);if(this.linkInText(o))return"["+o.replace(s,r)+"]["+"a".repeat(i.length-n-2)+"]"}return"["+"a".repeat(i.length-2)+"]"};t=t.replace(s,r)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(s,r,i)=>i?"+".repeat(s.length):r?r+s.slice(r.length,-r.length).replace(/`/g,"+")+r:s),t=wr(Rs,this,Xc).call(this,t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}var Ar=class{constructor(e){qe(this,"options",void 0),qe(this,"parser",void 0),this.options=e||ms}space(e){return""}code({text:e,lang:t,escaped:s}){let r=(t||"").match(Qe.notSpaceStart)?.[0],i=e?e.replace(Qe.endingNewline,"")+`
|
|
1480
|
+
`:"";return r?'<pre><code class="language-'+bt(r)+'">'+(s?i:bt(i,!0))+`</code></pre>
|
|
1481
|
+
`:"<pre><code>"+(s?i:bt(i,!0))+`</code></pre>
|
|
1482
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
1483
|
+
${this.parser.parse(e)}</blockquote>
|
|
1484
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
1485
|
+
`}hr(e){return`<hr>
|
|
1486
|
+
`}list(e){let t=e.ordered,s=e.start,r="";for(let o=0;o<e.items.length;o++){let c=e.items[o];r+=this.listitem(c)}let i=t?"ol":"ul",n=t&&s!==1?' start="'+s+'"':"";return"<"+i+n+`>
|
|
1487
|
+
`+r+"</"+i+`>
|
|
1488
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
1489
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
1490
|
+
`}table(e){let t="",s="";for(let i=0;i<e.header.length;i++)s+=this.tablecell(e.header[i]);t+=this.tablerow({text:s});let r="";for(let i=0;i<e.rows.length;i++){let n=e.rows[i];s="";for(let o=0;o<n.length;o++)s+=this.tablecell(n[o]);r+=this.tablerow({text:s})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
1491
|
+
<thead>
|
|
1492
|
+
`+t+`</thead>
|
|
1493
|
+
`+r+`</table>
|
|
1494
|
+
`}tablerow({text:e}){return`<tr>
|
|
1495
|
+
${e}</tr>
|
|
1496
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>
|
|
1497
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${bt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:s,tokens:r,autolink:i}){let n=i?bt(s,!0):this.parser.parseInline(r),o=uo(e);if(o===null)return n;e=bt(o,i);let c='<a href="'+e+'"';return t&&(c+=' title="'+bt(t)+'"'),c+=">"+n+"</a>",c}image({href:e,title:t,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));let i=uo(e);if(i===null)return bt(s);e=i;let n=`<img src="${bt(e)}" alt="${bt(s)}"`;return t&&(n+=` title="${bt(t)}"`),n+=">",n}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:bt(e.text)}},Mi=class{constructor(){qe(this,"parser",void 0)}strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`
|
|
1498
|
+
`}checkbox({raw:e}){return e}},Dt=class jn{constructor(t){qe(this,"options",void 0),qe(this,"renderer",void 0),qe(this,"textRenderer",void 0),this.options=t||ms,this.options.renderer=this.options.renderer||new Ar,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Mi,this.textRenderer.parser=this}static parse(t,s){return new jn(s).parse(t)}static parseInline(t,s){return new jn(s).parseInline(t)}parse(t){this.renderer.parser=this;let s="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let o=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){s+=c===!1?"":c??"";continue}}let n=i;switch(n.type){case"space":s+=this.renderer.space(n);break;case"hr":s+=this.renderer.hr(n);break;case"heading":s+=this.renderer.heading(n);break;case"code":s+=this.renderer.code(n);break;case"table":s+=this.renderer.table(n);break;case"blockquote":s+=this.renderer.blockquote(n);break;case"list":s+=this.renderer.list(n);break;case"checkbox":s+=this.renderer.checkbox(n);break;case"html":s+=this.renderer.html(n);break;case"def":s+=this.renderer.def(n);break;case"paragraph":s+=this.renderer.paragraph(n);break;case"text":s+=this.renderer.text(n);break;default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(t,s=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let n=t[i];if(this.options.extensions?.renderers?.[n.type]){let c=this.options.extensions.renderers[n.type].call({parser:this},n);if(c!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(n.type)){r+=c===!1?"":c??"";continue}}let o=n;switch(o.type){case"escape":r+=s.text(o);break;case"html":r+=s.html(o);break;case"link":r+=s.link(o);break;case"image":r+=s.image(o);break;case"checkbox":r+=s.checkbox(o);break;case"strong":r+=s.strong(o);break;case"em":r+=s.em(o);break;case"codespan":r+=s.codespan(o);break;case"br":r+=s.br(o);break;case"del":r+=s.del(o);break;case"text":r+=s.text(o);break;default:{let c='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},Qs=(kr=class{constructor(e){qe(this,"options",void 0),qe(this,"block",void 0),this.options=e||ms}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?$t.lex:$t.lexInline}provideParser(e=this.block){return e?Dt.parse:Dt.parseInline}},qe(kr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),qe(kr,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),kr);function rs(e,t){if(Array.isArray(t))for(let s=0;s<t.length;s++)e.push(t[s]);else e.push(t)}var Zc=class{constructor(...e){qe(this,"defaults",Ti()),qe(this,"options",this.setOptions),qe(this,"parse",this.parseMarkdown(!0)),qe(this,"parseInline",this.parseMarkdown(!1)),qe(this,"Parser",Dt),qe(this,"Renderer",Ar),qe(this,"TextRenderer",Mi),qe(this,"Lexer",$t),qe(this,"Tokenizer",Ms),qe(this,"Hooks",Qs),this.use(...e)}walkTokens(e,t){let s=[];for(let r of e)switch(rs(s,t.call(this,r)),r.type){case"table":{let i=r;for(let n of i.header)rs(s,this.walkTokens(n.tokens,t));for(let n of i.rows)for(let o of n)rs(s,this.walkTokens(o.tokens,t));break}case"list":{let i=r;rs(s,this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let o=i[n].flat(1/0);rs(s,this.walkTokens(o,t))}):i.tokens&&rs(s,this.walkTokens(i.tokens,t))}}return s}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(s=>{let r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let n=t.renderers[i.name];n?t.renderers[i.name]=function(...o){let c=i.renderer.apply(this,o);return c===!1&&(c=n.apply(this,o)),c}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=t[i.level];n?n.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),s.renderer){let i=this.defaults.renderer||new Ar(this.defaults);for(let n in s.renderer){if(!(n in i))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,c=s.renderer[o],u=i[o];i[o]=(...h)=>{let d=c.apply(i,h);return d===!1&&(d=u.apply(i,h)),d===!1?"":d??""}}r.renderer=i}if(s.tokenizer){let i=this.defaults.tokenizer||new Ms(this.defaults);for(let n in s.tokenizer){if(!(n in i))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,c=s.tokenizer[o],u=i[o];i[o]=(...h)=>{let d=c.apply(i,h);return d===!1&&(d=u.apply(i,h)),d}}r.tokenizer=i}if(s.hooks){let i=this.defaults.hooks||new Qs;for(let n in s.hooks){if(!(n in i))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,c=s.hooks[o],u=i[o];Qs.passThroughHooks.has(n)?i[o]=h=>{if(i.options.async&&Qs.passThroughHooksRespectAsync.has(n))return(async()=>{let a=await c.call(i,h);return u.call(i,a)})();let d=c.call(i,h);return u.call(i,d)}:i[o]=(...h)=>{if(i.options.async)return(async()=>{let a=await c.apply(i,h);return a===!1&&(a=await u.apply(i,h)),a})();let d=c.apply(i,h);return d===!1&&(d=u.apply(i,h)),d}}r.hooks=i}if(s.walkTokens){let i=this.defaults.walkTokens,n=s.walkTokens;r.walkTokens=function(o){let c=[];return rs(c,n.call(this,o)),i&&rs(c,i.call(this,o)),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return $t.lex(e,t??this.defaults)}parser(e,t){return Dt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,s)=>{let r={...s},i={...this.defaults,...r},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(t):t,c=await(i.hooks?await i.hooks.provideLexer(e):e?$t.lex:$t.lexInline)(o,i),u=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(u,i.walkTokens));let h=await(i.hooks?await i.hooks.provideParser(e):e?Dt.parse:Dt.parseInline)(u,i);return i.hooks?await i.hooks.postprocess(h):h})().catch(n);try{i.hooks&&(t=i.hooks.preprocess(t));let o=(i.hooks?i.hooks.provideLexer(e):e?$t.lex:$t.lexInline)(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(e):e?Dt.parse:Dt.parseInline)(o,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(o){return n(o)}}}onError(e,t){return s=>{if(s.message+=`
|
|
1499
|
+
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+bt(s.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(s);throw s}}},bs=new Zc;function Be(e,t){return bs.parse(e,t)}Be.options=Be.setOptions=function(e){return bs.setOptions(e),Be.defaults=bs.defaults,Zn(Be.defaults),Be},Be.getDefaults=Ti,Be.defaults=ms;function Jc(...e){return bs.use(...e),Be.defaults=bs.defaults,Zn(Be.defaults),Be}Be.use=Jc,Be.walkTokens=function(e,t){return bs.walkTokens(e,t)},Be.parseInline=bs.parseInline,Be.Parser=Dt,Be.parser=Dt.parse,Be.Renderer=Ar,Be.TextRenderer=Mi,Be.Lexer=$t,Be.lexer=$t.lex,Be.Tokenizer=Ms,Be.Hooks=Qs,Be.parse=Be;var Sf=Be.options,_f=Be.setOptions,wf=Be.walkTokens,Ni=Be.parseInline,$i=Be,kf=Dt.parse,xf=$t.lex,ut=fe((e=>{e.__esModule=!0,e.extend=n,e.indexOf=h,e.escapeExpression=d,e.isEmpty=a,e.createFrame=f,e.blockParams=l,e.appendContextPath=p;var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},s=/[&<>"'`=]/g,r=/[&<>"'`=]/;function i(g){return t[g]}function n(g){for(var v=1;v<arguments.length;v++)for(var S in arguments[v])Object.prototype.hasOwnProperty.call(arguments[v],S)&&(g[S]=arguments[v][S]);return g}var o=Object.prototype.toString;e.toString=o;var c=function(v){return typeof v=="function"};c(/x/)&&(e.isFunction=c=function(g){return typeof g=="function"&&o.call(g)==="[object Function]"}),e.isFunction=c;var u=Array.isArray||function(g){return g&&typeof g=="object"?o.call(g)==="[object Array]":!1};e.isArray=u;function h(g,v){for(var S=0,w=g.length;S<w;S++)if(g[S]===v)return S;return-1}function d(g){if(typeof g!="string"){if(g&&typeof g.toHTML=="function")return g.toHTML();if(g==null)return"";if(!g)return g+"";g=""+g}return r.test(g)?g.replace(s,i):g}function a(g){return!g&&g!==0?!0:!!(u(g)&&g.length===0)}function f(g){var v=n({},g);return v._parent=g,v}function l(g,v){return g.path=v,g}function p(g,v){return(g?g+".":"")+v}})),qt=fe(((e,t)=>{e.__esModule=!0;var s=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function r(i,n){var o=n&&n.loc,c=void 0,u=void 0,h=void 0,d=void 0;o&&o.start&&(c=o.start.line,h=o.start.column,o.end&&(u=o.end.line,d=o.end.column),i+=" - "+c+":"+h);for(var a=Error.prototype.constructor.call(this,i),f=0;f<s.length;f++)this[s[f]]=a[s[f]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{o&&(this.lineNumber=c,this.endLineNumber=u,Object.defineProperty?(Object.defineProperty(this,"column",{value:h,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:d,enumerable:!0})):(this.column=h,this.endColumn=d))}catch{}}r.prototype=new Error,e.default=r,t.exports=e.default})),Kc=fe(((e,t)=>{e.__esModule=!0;var s=ut();e.default=function(r){r.registerHelper("blockHelperMissing",function(i,n){var o=n.inverse,c=n.fn;if(i===!0)return c(this);if(i===!1||i==null)return o(this);if(s.isArray(i))return i.length>0?(n.ids&&(n.ids=[n.name]),r.helpers.each(i,n)):o(this);if(n.data&&n.ids){var u=s.createFrame(n.data);u.contextPath=s.appendContextPath(n.data.contextPath,n.name),n={data:u}}return c(i,n)})},t.exports=e.default})),Qc=fe(((e,t)=>{e.__esModule=!0;function s(o){return o&&o.__esModule?o:{default:o}}var r=ut(),i=s(qt());function n(o){try{var c=o.return;r.isFunction(c)&&c.call(o)}catch{}}e.default=function(o){o.registerHelper("each",function(c,u){if(!u)throw new i.default("Must pass iterator to #each");var h=u.fn,d=u.inverse,a=0,f="",l=void 0,p=void 0;u.data&&u.ids&&(p=r.appendContextPath(u.data.contextPath,u.ids[0])+"."),r.isFunction(c)&&(c=c.call(this)),u.data&&(l=r.createFrame(u.data));function g(m,_,C,R){l&&(l.key=m,l.index=_,l.first=_===0,l.last=!!C,p&&(l.contextPath=p+m)),f=f+h(R,{data:l,blockParams:r.blockParams([R,m],[p+m,null])})}if(c&&typeof c=="object")if(r.isArray(c))for(var v=c.length;a<v;a++)a in c&&g(a,a,a===c.length-1,c[a]);else if(typeof Symbol=="function"&&c[Symbol.iterator])for(var S=c[Symbol.iterator](),w=S.next();!w.done;){var y=S.next();try{g(a,a,y.done,w.value)}catch(m){throw y.done||n(S),m}w=y,a++}else(function(){var m=void 0;Object.keys(c).forEach(function(_){m!==void 0&&g(m,a-1,!1,c[m]),m=_,a++}),m!==void 0&&g(m,a-1,!0,c[m])})();return a===0&&(f=d(this)),f})},t.exports=e.default})),eu=fe(((e,t)=>{e.__esModule=!0;function s(i){return i&&i.__esModule?i:{default:i}}var r=s(qt());e.default=function(i){i.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new r.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e.default})),tu=fe(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=ut(),i=s(qt());e.default=function(n){n.registerHelper("if",function(o,c){if(arguments.length!=2)throw new i.default("#if requires exactly one argument");return r.isFunction(o)&&(o=o.call(this)),!c.hash.includeZero&&!o||r.isEmpty(o)?c.inverse(this):c.fn(this)}),n.registerHelper("unless",function(o,c){if(arguments.length!=2)throw new i.default("#unless requires exactly one argument");return n.helpers.if.call(this,o,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},t.exports=e.default})),su=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper("log",function(){for(var r=[void 0],i=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)r.push(arguments[n]);var o=1;i.hash.level!=null?o=i.hash.level:i.data&&i.data.level!=null&&(o=i.data.level),r[0]=o,s.log.apply(s,r)})},t.exports=e.default})),ru=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){s.registerHelper("lookup",function(r,i,n){return r&&n.lookupProperty(r,i)})},t.exports=e.default})),iu=fe(((e,t)=>{e.__esModule=!0;function s(n){return n&&n.__esModule?n:{default:n}}var r=ut(),i=s(qt());e.default=function(n){n.registerHelper("with",function(o,c){if(arguments.length!=2)throw new i.default("#with requires exactly one argument");r.isFunction(o)&&(o=o.call(this));var u=c.fn;if(r.isEmpty(o))return c.inverse(this);var h=c.data;return c.data&&c.ids&&(h=r.createFrame(c.data),h.contextPath=r.appendContextPath(c.data.contextPath,c.ids[0])),u(o,{data:h,blockParams:r.blockParams([o],[h&&h.contextPath])})})},t.exports=e.default})),vo=fe((e=>{e.__esModule=!0,e.registerDefaultHelpers=h,e.moveHelperToHooks=d;function t(a){return a&&a.__esModule?a:{default:a}}var s=t(Kc()),r=t(Qc()),i=t(eu()),n=t(tu()),o=t(su()),c=t(ru()),u=t(iu());function h(a){s.default(a),r.default(a),i.default(a),n.default(a),o.default(a),c.default(a),u.default(a)}function d(a,f,l){a.helpers[f]&&(a.hooks[f]=a.helpers[f],l||(a.helpers[f]=void 0))}})),nu=fe(((e,t)=>{e.__esModule=!0;var s=ut();e.default=function(r){r.registerDecorator("inline",function(i,n,o,c){var u=i;return n.partials||(n.partials={},u=function(h,d){var a=o.partials;o.partials=s.extend({},a,n.partials);var f=i(h,d);return o.partials=a,f}),n.partials[c.args[0]]=c.fn,u})},t.exports=e.default})),ou=fe((e=>{e.__esModule=!0,e.registerDefaultDecorators=r;function t(i){return i&&i.__esModule?i:{default:i}}var s=t(nu());function r(i){s.default(i)}})),yo=fe(((e,t)=>{e.__esModule=!0;var s=ut(),r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(n){if(typeof n=="string"){var o=s.indexOf(r.methodMap,n.toLowerCase());o>=0?n=o:n=parseInt(n,10)}return n},log:function(n){if(n=r.lookupLevel(n),typeof console<"u"&&r.lookupLevel(r.level)<=n){var o=r.methodMap[n];console[o]||(o="log");for(var c=arguments.length,u=Array(c>1?c-1:0),h=1;h<c;h++)u[h-1]=arguments[h];console[o].apply(console,u)}}};e.default=r,t.exports=e.default})),bo=fe((e=>{e.__esModule=!0,e.createProtoAccessControl=n,e.resultIsAllowed=o,e.isPrototypeConstructor=c,e.resetLoggedProperties=d;function t(a){return a&&a.__esModule?a:{default:a}}var s=ut(),r=t(yo()),i=Object.create(null);function n(a){var f=Object.create(null);f.__proto__=!1,s.extend(f,a.allowedProtoProperties);var l=Object.create(null);return l.constructor=!1,l.__defineGetter__=!1,l.__defineSetter__=!1,l.__lookupGetter__=!1,l.__lookupSetter__=!1,s.extend(l,a.allowedProtoMethods),{properties:{whitelist:f,defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:l,defaultValue:a.allowProtoMethodsByDefault}}}function o(a,f,l){return u(typeof a=="function"?f.methods:f.properties,l)}function c(a,f,l){return f==="constructor"&&typeof l=="function"&&a===l.prototype}function u(a,f){return a.whitelist[f]!==void 0?a.whitelist[f]===!0:a.defaultValue!==void 0?a.defaultValue:(h(f),!1)}function h(a){i[a]!==!0&&(i[a]=!0,r.default.log("error",'Handlebars: Access has been denied to resolve the property "'+a+`" because it is not an "own property" of its parent.
|
|
1500
|
+
You can add a runtime option to disable the check or this warning:
|
|
1501
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function d(){Object.keys(i).forEach(function(a){delete i[a]})}})),Di=fe((e=>{e.__esModule=!0,e.HandlebarsEnvironment=l;function t(g){return g&&g.__esModule?g:{default:g}}var s=ut(),r=t(qt()),i=vo(),n=ou(),o=t(yo()),c=bo(),u="4.7.10";e.VERSION=u;var h=8;e.COMPILER_REVISION=h;var d=7;e.LAST_COMPATIBLE_COMPILER_REVISION=d;var a={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};e.REVISION_CHANGES=a;var f="[object Object]";function l(g,v,S){this.helpers=g||{},this.partials=v||{},this.decorators=S||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:o.default,log:o.default.log,registerHelper:function(v,S){if(s.toString.call(v)===f){if(S)throw new r.default("Arg not supported with multiple helpers");s.extend(this.helpers,v)}else this.helpers[v]=S},unregisterHelper:function(v){delete this.helpers[v]},registerPartial:function(v,S){if(s.toString.call(v)===f)s.extend(this.partials,v);else{if(typeof S>"u")throw new r.default('Attempting to register a partial called "'+v+'" as undefined');this.partials[v]=S}},unregisterPartial:function(v){delete this.partials[v]},registerDecorator:function(v,S){if(s.toString.call(v)===f){if(S)throw new r.default("Arg not supported with multiple decorators");s.extend(this.decorators,v)}else this.decorators[v]=S},unregisterDecorator:function(v){delete this.decorators[v]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var p=o.default.log;e.log=p,e.createFrame=s.createFrame,e.logger=o.default})),au=fe(((e,t)=>{e.__esModule=!0;function s(r){this.string=r}s.prototype.toString=s.prototype.toHTML=function(){return""+this.string},e.default=s,t.exports=e.default})),lu=fe((e=>{e.__esModule=!0,e.wrapHelper=t;function t(s,r){return typeof s!="function"?s:function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=r(n),s.apply(this,arguments)}}})),cu=fe((e=>{e.__esModule=!0,e.checkRevision=h,e.template=d,e.wrapProgram=a,e.resolvePartial=f,e.invokePartial=l,e.noop=p;function t(m){return m&&m.__esModule?m:{default:m}}function s(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var C in m)Object.prototype.hasOwnProperty.call(m,C)&&(_[C]=m[C]);return _.default=m,_}var r=s(ut()),i=t(qt()),n=Di(),o=vo(),c=lu(),u=bo();function h(m){var _=m&&m[0]||1,C=n.COMPILER_REVISION;if(!(_>=n.LAST_COMPATIBLE_COMPILER_REVISION&&_<=n.COMPILER_REVISION))if(_<n.LAST_COMPATIBLE_COMPILER_REVISION){var R=n.REVISION_CHANGES[C],b=n.REVISION_CHANGES[_];throw new i.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+R+") or downgrade your runtime to an older version ("+b+").")}else throw new i.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+m[1]+").")}function d(m,_){if(!_)throw new i.default("No environment passed to template");if(!m||!m.main)throw new i.default("Unknown template object: "+typeof m);m.main.decorator=m.main_d,_.VM.checkRevision(m.compiler);var C=m.compiler&&m.compiler[0]===7;function R(T,A,L){L.hash&&(A=r.extend({},A,L.hash),L.ids&&(L.ids[0]=!0)),T=_.VM.resolvePartial.call(this,T,A,L),L.hooks=this.hooks,L.protoAccessControl=this.protoAccessControl;var D=_.VM.invokePartial.call(this,T,A,L);if(D==null&&r.isFunction(T))throw new i.default("The partial "+L.name+" returned no output: partials must return a string");if(D==null&&_.compile){if(typeof T!="string")throw new i.default("The partial "+L.name+" could not be compiled: partials must be strings or functions returning strings");L.partials[L.name]=_.compile(T,m.compilerOptions,_),D=L.partials[L.name](A,L)}if(D!=null){if(L.indent){for(var B=D.split(`
|
|
1502
|
+
`),F=0,P=B.length;F<P&&!(!B[F]&&F+1===P);F++)B[F]=L.indent+B[F];D=B.join(`
|
|
1503
|
+
`)}return D}else throw new i.default("The partial "+L.name+" could not be compiled when running in runtime-only mode")}var b={strict:function(A,L,D){if(!A||!(L in A))throw new i.default('"'+L+'" not defined in '+A,{loc:D});return b.lookupProperty(A,L)},lookupProperty:function(A,L){var D=A[L];if(D==null||Object.prototype.hasOwnProperty.call(A,L)&&!u.isPrototypeConstructor(A,L,D)||u.resultIsAllowed(D,b.protoAccessControl,L))return D},lookup:function(A,L){for(var D=A.length,B=0;B<D;B++){var F=A[B]&&b.lookupProperty(A[B],L);if(F!=null)return F}},lambda:function(A,L){return typeof A=="function"?A.call(L):A},escapeExpression:r.escapeExpression,invokePartial:R,fn:function(A){var L=m[A];return L.decorator=m[A+"_d"],L},programs:[],program:function(A,L,D,B,F){var P=this.programs[A],M=this.fn(A);return L||F||B||D?P=a(this,A,M,L,D,B,F):P||(P=this.programs[A]=a(this,A,M)),P},data:function(A,L){for(;A&&L--;)A=A._parent;return A},mergeIfNeeded:function(A,L){var D=A||L;return A&&L&&A!==L&&(D=r.extend({},L,A)),D},nullContext:Object.seal({}),noop:_.VM.noop,compilerInfo:m.compiler};function x(T){var A=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],L=A.data;x._setup(A),!A.partial&&m.useData&&(L=v(T,L));var D=void 0,B=m.useBlockParams?[]:void 0;m.useDepths&&(A.depths?D=T!=A.depths[0]?[T].concat(A.depths):A.depths:D=[T]);function F(P){return""+m.main(b,P,b.helpers,b.partials,L,B,D)}return F=S(m.main,F,b,A.depths||[],L,B),F(T,A)}return x.isTop=!0,x._setup=function(T){if(T.partial)b.protoAccessControl=T.protoAccessControl,b.helpers=T.helpers,b.partials=T.partials,b.decorators=T.decorators,b.hooks=T.hooks;else{var A={};w(A,_.helpers,b),w(A,T.helpers,b),b.helpers=A,m.usePartial&&(b.partials=b.mergeIfNeeded(T.partials,_.partials)),(m.usePartial||m.useDecorators)&&(b.decorators=r.extend({},_.decorators,T.decorators)),b.hooks={},b.protoAccessControl=u.createProtoAccessControl(T);var L=T.allowCallsToHelperMissing||C;o.moveHelperToHooks(b,"helperMissing",L),o.moveHelperToHooks(b,"blockHelperMissing",L)}},x._child=function(T,A,L,D){if(m.useBlockParams&&!L)throw new i.default("must pass block params");if(m.useDepths&&!D)throw new i.default("must pass parent depths");return a(b,T,m[T],A,0,L,D)},x}function a(m,_,C,R,b,x,T){function A(L){var D=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],B=T;return T&&L!=T[0]&&!(L===m.nullContext&&T[0]===null)&&(B=[L].concat(T)),C(m,L,m.helpers,m.partials,D.data||R,x&&[D.blockParams].concat(x),B)}return A=S(C,A,m,T,R,x),A.program=_,A.depth=T?T.length:0,A.blockParams=b||0,A}function f(m,_,C){return m?typeof m!="function"&&!C.name&&(C.name=m,m=g(C.partials,m)):C.name==="@partial-block"?m=g(C.data,"partial-block"):m=g(C.partials,C.name),m}function l(m,_,C){var R=g(C.data,"partial-block");C.partial=!0,C.ids&&(C.data.contextPath=C.ids[0]||C.data.contextPath);var b=void 0;if(C.fn&&C.fn!==p&&(function(){C.data=n.createFrame(C.data);var x=C.fn;b=C.data["partial-block"]=function(A){var L=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return L.data=n.createFrame(L.data),L.data["partial-block"]=R,x(A,L)},x.partials&&(C.partials=r.extend({},C.partials,x.partials))})(),m===void 0&&b&&(m=b),m===void 0)throw new i.default("The partial "+C.name+" could not be found");if(m instanceof Function)return m(_,C)}function p(){return""}function g(m,_){if(m&&Object.prototype.hasOwnProperty.call(m,_))return m[_]}function v(m,_){return(!_||!("root"in _))&&(_=_?n.createFrame(_):{},_.root=m),_}function S(m,_,C,R,b,x){if(m.decorator){var T={};_=m.decorator(_,T,C,R&&R[0],b,x,R),r.extend(_,T)}return _}function w(m,_,C){_&&Object.keys(_).forEach(function(R){var b=_[R];m[R]=y(b,C)})}function y(m,_){var C=_.lookupProperty;return c.wrapHelper(m,function(R){return R.lookupProperty=C,R})}})),So=fe(((e,t)=>{e.__esModule=!0,e.default=function(s){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var r=globalThis.Handlebars;s.noConflict=function(){return globalThis.Handlebars===s&&(globalThis.Handlebars=r),s}},t.exports=e.default})),uu=fe(((e,t)=>{e.__esModule=!0;function s(f){return f&&f.__esModule?f:{default:f}}function r(f){if(f&&f.__esModule)return f;var l={};if(f!=null)for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p]);return l.default=f,l}var i=r(Di()),n=s(au()),o=s(qt()),c=r(ut()),u=r(cu()),h=s(So());function d(){var f=new i.HandlebarsEnvironment;return c.extend(f,i),f.SafeString=n.default,f.Exception=o.default,f.Utils=c,f.escapeExpression=c.escapeExpression,f.VM=u,f.template=function(l){return u.template(l,f)},f}var a=d();a.create=d,h.default(a),a.default=a,e.default=a,t.exports=e.default})),_o=fe(((e,t)=>{e.__esModule=!0;var s={helpers:{helperExpression:function(i){return i.type==="SubExpression"||(i.type==="MustacheStatement"||i.type==="BlockStatement")&&!!(i.params&&i.params.length||i.hash)},scopedId:function(i){return/^\.|this\b/.test(i.original)},simpleId:function(i){return i.parts.length===1&&!s.helpers.scopedId(i)&&!i.depth}}};e.default=s,t.exports=e.default})),hu=fe(((e,t)=>{e.__esModule=!0;var s=(function(){var r={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,c,u,h,d,a,f){var l=a.length-1;switch(d){case 1:return a[l-1];case 2:this.$=h.prepareProgram(a[l]);break;case 3:this.$=a[l];break;case 4:this.$=a[l];break;case 5:this.$=a[l];break;case 6:this.$=a[l];break;case 7:this.$=a[l];break;case 8:this.$=a[l];break;case 9:this.$={type:"CommentStatement",value:h.stripComment(a[l]),strip:h.stripFlags(a[l],a[l]),loc:h.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:a[l],value:a[l],loc:h.locInfo(this._$)};break;case 11:this.$=h.prepareRawBlock(a[l-2],a[l-1],a[l],this._$);break;case 12:this.$={path:a[l-3],params:a[l-2],hash:a[l-1]};break;case 13:this.$=h.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!1,this._$);break;case 14:this.$=h.prepareBlock(a[l-3],a[l-2],a[l-1],a[l],!0,this._$);break;case 15:this.$={open:a[l-5],path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 16:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 17:this.$={path:a[l-4],params:a[l-3],hash:a[l-2],blockParams:a[l-1],strip:h.stripFlags(a[l-5],a[l])};break;case 18:this.$={strip:h.stripFlags(a[l-1],a[l-1]),program:a[l]};break;case 19:var p=h.prepareBlock(a[l-2],a[l-1],a[l],a[l],!1,this._$),g=h.prepareProgram([p],a[l-1].loc);g.chained=!0,this.$={strip:a[l-2].strip,program:g,chain:!0};break;case 20:this.$=a[l];break;case 21:this.$={path:a[l-1],strip:h.stripFlags(a[l-2],a[l])};break;case 22:this.$=h.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],h.stripFlags(a[l-4],a[l]),this._$);break;case 23:this.$=h.prepareMustache(a[l-3],a[l-2],a[l-1],a[l-4],h.stripFlags(a[l-4],a[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:a[l-3],params:a[l-2],hash:a[l-1],indent:"",strip:h.stripFlags(a[l-4],a[l]),loc:h.locInfo(this._$)};break;case 25:this.$=h.preparePartialBlock(a[l-2],a[l-1],a[l],this._$);break;case 26:this.$={path:a[l-3],params:a[l-2],hash:a[l-1],strip:h.stripFlags(a[l-4],a[l])};break;case 27:this.$=a[l];break;case 28:this.$=a[l];break;case 29:this.$={type:"SubExpression",path:a[l-3],params:a[l-2],hash:a[l-1],loc:h.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:a[l],loc:h.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:h.id(a[l-2]),value:a[l],loc:h.locInfo(this._$)};break;case 32:this.$=h.id(a[l-1]);break;case 33:this.$=a[l];break;case 34:this.$=a[l];break;case 35:this.$={type:"StringLiteral",value:a[l],original:a[l],loc:h.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(a[l]),original:Number(a[l]),loc:h.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:a[l]==="true",original:a[l]==="true",loc:h.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:h.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:h.locInfo(this._$)};break;case 40:this.$=a[l];break;case 41:this.$=a[l];break;case 42:this.$=h.preparePath(!0,a[l],this._$);break;case 43:this.$=h.preparePath(!1,a[l],this._$);break;case 44:a[l-2].push({part:h.id(a[l]),original:a[l],separator:a[l-1]}),this.$=a[l-2];break;case 45:this.$=[{part:h.id(a[l]),original:a[l]}];break;case 46:this.$=[];break;case 47:a[l-1].push(a[l]);break;case 48:this.$=[];break;case 49:a[l-1].push(a[l]);break;case 50:this.$=[];break;case 51:a[l-1].push(a[l]);break;case 58:this.$=[];break;case 59:a[l-1].push(a[l]);break;case 64:this.$=[];break;case 65:a[l-1].push(a[l]);break;case 70:this.$=[];break;case 71:a[l-1].push(a[l]);break;case 78:this.$=[];break;case 79:a[l-1].push(a[l]);break;case 82:this.$=[];break;case 83:a[l-1].push(a[l]);break;case 86:this.$=[];break;case 87:a[l-1].push(a[l]);break;case 90:this.$=[];break;case 91:a[l-1].push(a[l]);break;case 94:this.$=[];break;case 95:a[l-1].push(a[l]);break;case 98:this.$=[a[l]];break;case 99:a[l-1].push(a[l]);break;case 100:this.$=[a[l]];break;case 101:a[l-1].push(a[l])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,c){throw new Error(o)},parse:function(o){var c=this,u=[0],h=[null],d=[],a=this.table,f="",l=0,p=0,g=0;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var v=this.lexer.yylloc;d.push(v);var S=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function w(){var B=c.lexer.lex()||1;return typeof B!="number"&&(B=c.symbols_[B]||B),B}for(var y,m,_,C,R,b={},x,T,A,L;;){if(_=u[u.length-1],this.defaultActions[_]?C=this.defaultActions[_]:((y===null||typeof y>"u")&&(y=w()),C=a[_]&&a[_][y]),typeof C>"u"||!C.length||!C[0]){var D="";if(!g){L=[];for(x in a[_])this.terminals_[x]&&x>2&&L.push("'"+this.terminals_[x]+"'");this.lexer.showPosition?D="Parse error on line "+(l+1)+`:
|
|
1504
|
+
`+this.lexer.showPosition()+`
|
|
1505
|
+
Expecting `+L.join(", ")+", got '"+(this.terminals_[y]||y)+"'":D="Parse error on line "+(l+1)+": Unexpected "+(y==1?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(D,{text:this.lexer.match,token:this.terminals_[y]||y,line:this.lexer.yylineno,loc:v,expected:L})}}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+y);switch(C[0]){case 1:u.push(y),h.push(this.lexer.yytext),d.push(this.lexer.yylloc),u.push(C[1]),y=null,m?(y=m,m=null):(p=this.lexer.yyleng,f=this.lexer.yytext,l=this.lexer.yylineno,v=this.lexer.yylloc,g>0&&g--);break;case 2:if(T=this.productions_[C[1]][1],b.$=h[h.length-T],b._$={first_line:d[d.length-(T||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(T||1)].first_column,last_column:d[d.length-1].last_column},S&&(b._$.range=[d[d.length-(T||1)].range[0],d[d.length-1].range[1]]),R=this.performAction.call(b,f,p,l,this.yy,C[1],h,d),typeof R<"u")return R;T&&(u=u.slice(0,-1*T*2),h=h.slice(0,-1*T),d=d.slice(0,-1*T)),u.push(this.productions_[C[1]][0]),h.push(b.$),d.push(b._$),A=a[u[u.length-2]][u[u.length-1]],u.push(A);break;case 3:return!0}}return!0}};r.lexer=(function(){var n={EOF:1,parseError:function(c,u){if(this.yy.parser)this.yy.parser.parseError(c,u);else throw new Error(c)},setInput:function(c){return this._input=c,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var c=this._input[0];return this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c,c.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},unput:function(c){var u=c.length,h=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u-1),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-u]),this},more:function(){return this._more=!0,this},less:function(c){this.unput(this.match.slice(c))},pastInput:function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var c=this.pastInput(),u=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
|
|
1506
|
+
`+u+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,u,h,d,a;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),l=0;l<f.length&&(h=this._input.match(this.rules[f[l]]),!(h&&(!u||h[0].length>u[0].length)&&(u=h,d=l,!this.options.flex)));l++);return u?(a=u[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],c=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
1507
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var c=this.next();return typeof c<"u"?c:this.lex()},begin:function(c){this.conditionStack.push(c)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(c){this.begin(c)}};return n.options={},n.performAction=function(c,u,h,d){function a(f,l){return u.yytext=u.yytext.substring(f,u.yyleng-l+f)}switch(h){case 0:if(u.yytext.slice(-2)==="\\\\"?(a(0,1),this.begin("mu")):u.yytext.slice(-1)==="\\"?(a(0,1),this.begin("emu")):this.begin("mu"),u.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(a(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(u.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return u.yytext=a(1,2).replace(/\\"/g,'"'),80;case 32:return u.yytext=a(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return u.yytext=u.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();function i(){this.yy={}}return i.prototype=r,r.Parser=i,new i})();e.default=s,t.exports=e.default})),wo=fe((e=>{e.__esModule=!0;var t=["Program","BlockStatement","DecoratorBlock","PartialStatement","PartialBlockStatement","Decorator","MustacheStatement","ContentStatement","CommentStatement","SubExpression","PathExpression","StringLiteral","NumberLiteral","BooleanLiteral","UndefinedLiteral","NullLiteral","Hash","HashPair"];e.NODE_TYPES=t})),ko=fe(((e,t)=>{e.__esModule=!0;function s(a){return a&&a.__esModule?a:{default:a}}var r=s(qt()),i=ut(),n=wo();function o(){this.parents=[]}function c(a,f){return i.indexOf(n.NODE_TYPES,f)!==-1||!(f in o.prototype)&&typeof a[f]=="function"}o.prototype={constructor:o,mutating:!1,acceptKey:function(f,l){var p=this.accept(f[l]);if(this.mutating){if(p&&!c(this,p.type))throw new r.default('Unexpected node type "'+p.type+'" found when accepting '+l+" on "+f.type);f[l]=p}},acceptRequired:function(f,l){if(this.acceptKey(f,l),!f[l])throw new r.default(f.type+" requires "+l)},acceptArray:function(f){for(var l=0,p=f.length;l<p;l++)this.acceptKey(f,l),f[l]||(f.splice(l,1),l--,p--)},accept:function(f){if(f){if(!c(this,f.type)||!this[f.type])throw new r.default("Unknown type: "+f.type,f);this.current&&this.parents.unshift(this.current),this.current=f;var l=this[f.type](f);if(this.current=this.parents.shift(),!this.mutating||l)return l;if(l!==!1)return f}},Program:function(f){this.acceptArray(f.body)},MustacheStatement:u,Decorator:u,BlockStatement:h,DecoratorBlock:h,PartialStatement:d,PartialBlockStatement:function(f){d.call(this,f),this.acceptKey(f,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:u,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(f){this.acceptArray(f.pairs)},HashPair:function(f){this.acceptRequired(f,"value")}};function u(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function h(a){u.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function d(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}e.default=o,t.exports=e.default})),du=fe(((e,t)=>{e.__esModule=!0;function s(h){return h&&h.__esModule?h:{default:h}}var r=s(ko());function i(){var h=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=h}i.prototype=new r.default,i.prototype.Program=function(h){var d=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var f=h.body,l=0,p=f.length;l<p;l++){var g=f[l],v=this.accept(g);if(v){var S=n(f,l,a),w=o(f,l,a),y=v.openStandalone&&S,m=v.closeStandalone&&w,_=v.inlineStandalone&&S&&w;v.close&&c(f,l,!0),v.open&&u(f,l,!0),d&&_&&(c(f,l),u(f,l)&&g.type==="PartialStatement"&&(g.indent=/(?:^|[^ \t])([ \t]+)$/.exec(f[l-1].original)[1])),d&&y&&(c((g.program||g.inverse).body),u(f,l)),d&&m&&(c(f,l),u((g.inverse||g.program).body))}}return h},i.prototype.BlockStatement=i.prototype.DecoratorBlock=i.prototype.PartialBlockStatement=function(h){this.accept(h.program),this.accept(h.inverse);var d=h.program||h.inverse,a=h.program&&h.inverse,f=a,l=a;if(a&&a.chained)for(f=a.body[0].program;l.chained;)l=l.body[l.body.length-1].program;var p={open:h.openStrip.open,close:h.closeStrip.close,openStandalone:o(d.body),closeStandalone:n((f||d).body)};if(h.openStrip.close&&c(d.body,null,!0),a){var g=h.inverseStrip;g.open&&u(d.body,null,!0),g.close&&c(f.body,null,!0),h.closeStrip.open&&u(l.body,null,!0),!this.options.ignoreStandalone&&n(d.body)&&o(f.body)&&(u(d.body),c(f.body))}else h.closeStrip.open&&u(d.body,null,!0);return p},i.prototype.Decorator=i.prototype.MustacheStatement=function(h){return h.strip},i.prototype.PartialStatement=i.prototype.CommentStatement=function(h){var d=h.strip||{};return{inlineStandalone:!0,open:d.open,close:d.close}};function n(h,d,a){d===void 0&&(d=h.length);var f=h[d-1],l=h[d-2];if(!f)return a;if(f.type==="ContentStatement")return(l||!a?/(?:^|\S)[^\S\n]*\n\s*$/:/^\s*$|(?:^|\S)[^\S\n]*\n\s*$/).test(f.original)}function o(h,d,a){d===void 0&&(d=-1);var f=h[d+1],l=h[d+2];if(!f)return a;if(f.type==="ContentStatement")return(l||!a?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(f.original)}function c(h,d,a){var f=h[d==null?0:d+1];if(!(!f||f.type!=="ContentStatement"||!a&&f.rightStripped)){var l=f.value;f.value=f.value.replace(a?/^\s+/:/^[ \t]*\r?\n?/,""),f.rightStripped=f.value!==l}}function u(h,d,a){var f=h[d==null?h.length-1:d-1];if(!(!f||f.type!=="ContentStatement"||!a&&f.leftStripped)){var l=f.value;return f.value=f.value.replace(a?/(^|\S)\s+$/:/(^|[^ \t])[ \t]+$/,"$1"),f.leftStripped=f.value!==l,f.leftStripped}}e.default=i,t.exports=e.default})),fu=fe((e=>{e.__esModule=!0,e.SourceLocation=i,e.id=n,e.stripFlags=o,e.stripComment=c,e.preparePath=u,e.prepareMustache=h,e.prepareRawBlock=d,e.prepareBlock=a,e.prepareProgram=f,e.preparePartialBlock=l;function t(p){return p&&p.__esModule?p:{default:p}}var s=t(qt());function r(p,g){if(g=g.path?g.path.original:g,p.path.original!==g){var v={loc:p.path.loc};throw new s.default(p.path.original+" doesn't match "+g,v)}}function i(p,g){this.source=p,this.start={line:g.first_line,column:g.first_column},this.end={line:g.last_line,column:g.last_column}}function n(p){return/^\[.*\]$/.test(p)?p.substring(1,p.length-1):p}function o(p,g){return{open:p.charAt(2)==="~",close:g.charAt(g.length-3)==="~"}}function c(p){return p.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function u(p,g,v){v=this.locInfo(v);for(var S=p?"@":"",w=[],y=0,m=0,_=g.length;m<_;m++){var C=g[m].part,R=g[m].original!==C;if(S+=(g[m].separator||"")+C,!R&&(C===".."||C==="."||C==="this")){if(w.length>0)throw new s.default("Invalid path: "+S,{loc:v});C===".."&&y++}else w.push(C)}return{type:"PathExpression",data:p,depth:y,parts:w,original:S,loc:v}}function h(p,g,v,S,w,y){var m=S.charAt(3)||S.charAt(2),_=m!=="{"&&m!=="&";return{type:/\*/.test(S)?"Decorator":"MustacheStatement",path:p,params:g,hash:v,escaped:_,strip:w,loc:this.locInfo(y)}}function d(p,g,v,S){r(p,v),S=this.locInfo(S);var w={type:"Program",body:g,strip:{},loc:S};return{type:"BlockStatement",path:p.path,params:p.params,hash:p.hash,program:w,openStrip:{},inverseStrip:{},closeStrip:{},loc:S}}function a(p,g,v,S,w,y){S&&S.path&&r(p,S);var m=/\*/.test(p.open);g.blockParams=p.blockParams;var _=void 0,C=void 0;if(v){if(m)throw new s.default("Unexpected inverse block on decorator",v);v.chain&&(v.program.body[0].closeStrip=S.strip),C=v.strip,_=v.program}return w&&(w=_,_=g,g=w),{type:m?"DecoratorBlock":"BlockStatement",path:p.path,params:p.params,hash:p.hash,program:g,inverse:_,openStrip:p.strip,inverseStrip:C,closeStrip:S&&S.strip,loc:this.locInfo(y)}}function f(p,g){if(!g&&p.length){var v=p[0].loc,S=p[p.length-1].loc;v&&S&&(g={source:v.source,start:{line:v.start.line,column:v.start.column},end:{line:S.end.line,column:S.end.column}})}return{type:"Program",body:p,strip:{},loc:g}}function l(p,g,v,S){return r(p,v),{type:"PartialBlockStatement",name:p.path,params:p.params,hash:p.hash,program:g,openStrip:p.strip,closeStrip:v&&v.strip,loc:this.locInfo(S)}}})),pu=fe((e=>{e.__esModule=!0,e.parseWithoutProcessing=u,e.parse=h;function t(d){if(d&&d.__esModule)return d;var a={};if(d!=null)for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(a[f]=d[f]);return a.default=d,a}function s(d){return d&&d.__esModule?d:{default:d}}var r=s(hu()),i=s(du()),n=t(fu()),o=ut();e.parser=r.default;var c={};o.extend(c,n);function u(d,a){return d.type==="Program"?d:(r.default.yy=c,c.locInfo=function(f){return new c.SourceLocation(a&&a.srcName,f)},r.default.parse(d))}function h(d,a){var f=u(d,a);return new i.default(a).accept(f)}})),gu=fe((e=>{e.__esModule=!0,e.Compiler=c,e.precompile=u,e.compile=h;function t(w){return w&&w.__esModule?w:{default:w}}var s=t(qt()),r=ut(),i=t(_o()),n=wo(),o=[].slice;function c(){}c.prototype={compiler:c,equals:function(y){var m=this.opcodes.length;if(y.opcodes.length!==m)return!1;for(var _=0;_<m;_++){var C=this.opcodes[_],R=y.opcodes[_];if(C.opcode!==R.opcode||!v(C.args,R.args))return!1}m=this.children.length;for(var _=0;_<m;_++)if(!this.children[_].equals(y.children[_]))return!1;return!0},guid:0,compile:function(y,m){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=m,this.stringParams=m.stringParams,this.trackIds=m.trackIds,m.blockParams=m.blockParams||[],m.knownHelpers=r.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},m.knownHelpers),this.accept(y)},compileProgram:function(y){var m=new this.compiler().compile(y,this.options),_=this.guid++;return this.usePartial=this.usePartial||m.usePartial,this.children[_]=m,this.useDepths=this.useDepths||m.useDepths,_},accept:function(y){if(r.indexOf(n.NODE_TYPES,y.type)===-1||!this[y.type])throw new s.default("Unknown type: "+y.type,y);this.sourceNode.unshift(y);var m=this[y.type](y);return this.sourceNode.shift(),m},Program:function(y){g(y),this.options.blockParams.unshift(y.blockParams);for(var m=y.body,_=m.length,C=0;C<_;C++)this.accept(m[C]);return this.options.blockParams.shift(),this.isSimple=_===1,this.blockParams=y.blockParams?y.blockParams.length:0,this},BlockStatement:function(y){S(y);var m=y.program,_=y.inverse;m=m&&this.compileProgram(m),_=_&&this.compileProgram(_);var C=this.classifySexpr(y);C==="helper"?this.helperSexpr(y,m,_):C==="simple"?(this.simpleSexpr(y),this.opcode("pushProgram",m),this.opcode("pushProgram",_),this.opcode("emptyHash"),this.opcode("blockValue",y.path.original)):(this.ambiguousSexpr(y,m,_),this.opcode("pushProgram",m),this.opcode("pushProgram",_),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(y){var m=y.program&&this.compileProgram(y.program),_=this.setupFullMustacheParams(y,m,void 0),C=y.path;this.useDecorators=!0,this.opcode("registerDecorator",_.length,C.original)},PartialStatement:function(y){this.usePartial=!0;var m=y.program;m&&(m=this.compileProgram(y.program));var _=y.params;if(_.length>1)throw new s.default("Unsupported number of partial arguments: "+_.length,y);_.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):_.push({type:"PathExpression",parts:[],depth:0}));var C=y.name.original,R=y.name.type==="SubExpression";R&&this.accept(y.name),this.setupFullMustacheParams(y,m,void 0,!0);var b=y.indent||"";this.options.preventIndent&&b&&(this.opcode("appendContent",b),b=""),this.opcode("invokePartial",R,C,b),this.opcode("append")},PartialBlockStatement:function(y){this.PartialStatement(y)},MustacheStatement:function(y){this.SubExpression(y),y.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(y){this.DecoratorBlock(y)},ContentStatement:function(y){if(y.value!=null&&typeof y.value!="string")throw d(y,"value must be a string");y.value&&this.opcode("appendContent",y.value)},CommentStatement:function(){},SubExpression:function(y){S(y);var m=this.classifySexpr(y);m==="simple"?this.simpleSexpr(y):m==="helper"?this.helperSexpr(y):this.ambiguousSexpr(y)},ambiguousSexpr:function(y,m,_){var C=y.path,R=C.parts[0],b=m!=null||_!=null;this.opcode("getContext",a(C)),this.opcode("pushProgram",m),this.opcode("pushProgram",_),C.strict=!0,this.accept(C),this.opcode("invokeAmbiguous",R,b)},simpleSexpr:function(y){var m=y.path;m.strict=!0,this.accept(m),this.opcode("resolvePossibleLambda")},helperSexpr:function(y,m,_){var C=this.setupFullMustacheParams(y,m,_),R=y.path,b=R.parts[0];if(this.options.knownHelpers[b])this.opcode("invokeKnownHelper",C.length,b);else{if(this.options.knownHelpersOnly)throw new s.default("You specified knownHelpersOnly, but used the unknown helper "+b,y);R.strict=!0,R.falsy=!0,this.accept(R),this.opcode("invokeHelper",C.length,R.original,i.default.helpers.simpleId(R))}},PathExpression:function(y){var m=a(y),_=p(y);this.addDepth(m),this.opcode("getContext",m);var C=_[0],R=i.default.helpers.scopedId(y),b=!m&&!R&&this.blockParamIndex(C);b?this.opcode("lookupBlockParam",b,_):C?y.data?(this.options.data=!0,this.opcode("lookupData",m,_,y.strict)):this.opcode("lookupOnContext",_,y.falsy,y.strict,R):this.opcode("pushContext")},StringLiteral:function(y){f(y),this.opcode("pushString",y.value)},NumberLiteral:function(y){f(y),this.opcode("pushLiteral",y.value)},BooleanLiteral:function(y){f(y),this.opcode("pushLiteral",y.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(y){var m=y.pairs,_=0,C=void 0;if(!r.isArray(m))throw d(y,"pairs must be an array");C=m.length;for(var R=0;R<C;R++)if(!m[R]||typeof m[R].key!="string")throw d(y,"pair keys must be strings");for(this.opcode("pushHash");_<C;_++)this.pushParam(m[_].value);for(;_--;)this.opcode("assignToHash",m[_].key);this.opcode("popHash")},opcode:function(y){this.opcodes.push({opcode:y,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(y){y&&(this.useDepths=!0)},classifySexpr:function(y){p(y.path);var m=i.default.helpers.simpleId(y.path),_=m&&!!this.blockParamIndex(y.path.parts[0]),C=!_&&i.default.helpers.helperExpression(y),R=!_&&(C||m);if(R&&!C){var b=y.path.parts[0],x=this.options;x.knownHelpers[b]?C=!0:x.knownHelpersOnly&&(R=!1)}return C?"helper":R?"ambiguous":"simple"},pushParams:function(y){for(var m=0,_=y.length;m<_;m++)this.pushParam(y[m])},pushParam:function(y){f(y);var m=y.value!=null?y.value:y.original||"",_=a(y);if(this.stringParams)typeof m!="number"&&typeof m!="boolean"&&(m=String(m)),m.replace&&(m=m.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),_&&this.addDepth(_),this.opcode("getContext",_),this.opcode("pushStringParam",m,y.type),y.type==="SubExpression"&&this.accept(y);else{if(this.trackIds){var C=void 0;if(y.parts&&!i.default.helpers.scopedId(y)&&!_&&(C=this.blockParamIndex(p(y)[0])),C){var R=y.parts.slice(1).join(".");this.opcode("pushId","BlockParam",C,R)}else m=y.original||m,m.replace&&(m=m.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",y.type,m)}this.accept(y)}},setupFullMustacheParams:function(y,m,_,C){var R=y.params;return this.pushParams(R),this.opcode("pushProgram",m),this.opcode("pushProgram",_),y.hash?this.accept(y.hash):this.opcode("emptyHash",C),R},blockParamIndex:function(y){for(var m=0,_=this.options.blockParams.length;m<_;m++){var C=this.options.blockParams[m],R=C&&r.indexOf(C,y);if(C&&R>=0)return[m,R]}}};function u(w,y,m){if(w==null||typeof w!="string"&&w.type!=="Program")throw new s.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+w);y=y||{},"data"in y||(y.data=!0),y.compat&&(y.useDepths=!0);var _=m.parse(w,y),C=new m.Compiler().compile(_,y);return new m.JavaScriptCompiler().compile(C,y)}function h(w,y,m){if(y===void 0&&(y={}),w==null||typeof w!="string"&&w.type!=="Program")throw new s.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+w);y=r.extend({},y),"data"in y||(y.data=!0),y.compat&&(y.useDepths=!0);var _=void 0;function C(){var b=m.parse(w,y),x=new m.Compiler().compile(b,y),T=new m.JavaScriptCompiler().compile(x,y,void 0,!0);return m.template(T)}function R(b,x){return _||(_=C()),_.call(this,b,x)}return R._setup=function(b){return _||(_=C()),_._setup(b)},R._child=function(b,x,T,A){return _||(_=C()),_._child(b,x,T,A)},R}function d(w,y){return new s.default("Invalid AST: "+w.type+" "+y,w)}function a(w){var y=w.depth;if(y==null)return 0;if(typeof y!="number"||!isFinite(y)||Math.floor(y)!==y||y<0)throw d(w,"depth must be a non-negative integer");return y}function f(w){var y=w.value;if(w.type==="StringLiteral"&&typeof y!="string")throw d(w,"value must be a string");if(w.type==="NumberLiteral"&&typeof y!="number")throw d(w,"value must be a number");if(w.type==="BooleanLiteral"&&typeof y!="boolean")throw d(w,"value must be a boolean")}function l(w,y,m){if(!r.isArray(y))throw d(w,m+" must be an array");for(var _=0;_<y.length;_++)if(typeof y[_]!="string")throw d(w,m+" must only contain strings");return y}function p(w){return l(w,w.parts,"parts")}function g(w){w.blockParams!=null&&l(w,w.blockParams,"blockParams")}function v(w,y){if(w===y)return!0;if(r.isArray(w)&&r.isArray(y)&&w.length===y.length){for(var m=0;m<w.length;m++)if(!v(w[m],y[m]))return!1;return!0}}function S(w){if(!w.path.parts){var y=w.path;w.path={type:"PathExpression",data:!1,depth:0,parts:[y.original+""],original:y.original+"",loc:y.loc}}}})),mu=fe((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(s){if(0<=s&&s<t.length)return t[s];throw new TypeError("Must be between 0 and 63: "+s)},e.decode=function(s){var r=65,i=90,n=97,o=122,c=48,u=57,h=43,d=47,a=26,f=52;return r<=s&&s<=i?s-r:n<=s&&s<=o?s-n+a:c<=s&&s<=u?s-c+f:s==h?62:s==d?63:-1}})),xo=fe((e=>{var t=mu(),s=5,r=1<<s,i=r-1,n=r;function o(u){return u<0?(-u<<1)+1:(u<<1)+0}function c(u){var h=(u&1)===1,d=u>>1;return h?-d:d}e.encode=function(h){var d="",a,f=o(h);do a=f&i,f>>>=s,f>0&&(a|=n),d+=t.encode(a);while(f>0);return d},e.decode=function(h,d,a){var f=h.length,l=0,p=0,g,v;do{if(d>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(v=t.decode(h.charCodeAt(d++)),v===-1)throw new Error("Invalid base64 digit: "+h.charAt(d-1));g=!!(v&n),v&=i,l=l+(v<<p),p+=s}while(g);a.value=c(l),a.rest=d}})),er=fe((e=>{function t(m,_,C){if(_ in m)return m[_];if(arguments.length===3)return C;throw new Error('"'+_+'" is a required argument.')}e.getArg=t;var s=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function i(m){var _=m.match(s);return _?{scheme:_[1],auth:_[2],host:_[3],port:_[4],path:_[5]}:null}e.urlParse=i;function n(m){var _="";return m.scheme&&(_+=m.scheme+":"),_+="//",m.auth&&(_+=m.auth+"@"),m.host&&(_+=m.host),m.port&&(_+=":"+m.port),m.path&&(_+=m.path),_}e.urlGenerate=n;function o(m){var _=m,C=i(m);if(C){if(!C.path)return m;_=C.path}for(var R=e.isAbsolute(_),b=_.split(/\/+/),x,T=0,A=b.length-1;A>=0;A--)x=b[A],x==="."?b.splice(A,1):x===".."?T++:T>0&&(x===""?(b.splice(A+1,T),T=0):(b.splice(A,2),T--));return _=b.join("/"),_===""&&(_=R?"/":"."),C?(C.path=_,n(C)):_}e.normalize=o;function c(m,_){m===""&&(m="."),_===""&&(_=".");var C=i(_),R=i(m);if(R&&(m=R.path||"/"),C&&!C.scheme)return R&&(C.scheme=R.scheme),n(C);if(C||_.match(r))return _;if(R&&!R.host&&!R.path)return R.host=_,n(R);var b=_.charAt(0)==="/"?_:o(m.replace(/\/+$/,"")+"/"+_);return R?(R.path=b,n(R)):b}e.join=c,e.isAbsolute=function(m){return m.charAt(0)==="/"||s.test(m)};function u(m,_){m===""&&(m="."),m=m.replace(/\/$/,"");for(var C=0;_.indexOf(m+"/")!==0;){var R=m.lastIndexOf("/");if(R<0||(m=m.slice(0,R),m.match(/^([^\/]+:\/)?\/*$/)))return _;++C}return Array(C+1).join("../")+_.substr(m.length+1)}e.relative=u;var h=(function(){return!("__proto__"in Object.create(null))})();function d(m){return m}function a(m){return l(m)?"$"+m:m}e.toSetString=h?d:a;function f(m){return l(m)?m.slice(1):m}e.fromSetString=h?d:f;function l(m){if(!m)return!1;var _=m.length;if(_<9||m.charCodeAt(_-1)!==95||m.charCodeAt(_-2)!==95||m.charCodeAt(_-3)!==111||m.charCodeAt(_-4)!==116||m.charCodeAt(_-5)!==111||m.charCodeAt(_-6)!==114||m.charCodeAt(_-7)!==112||m.charCodeAt(_-8)!==95||m.charCodeAt(_-9)!==95)return!1;for(var C=_-10;C>=0;C--)if(m.charCodeAt(C)!==36)return!1;return!0}function p(m,_,C){var R=v(m.source,_.source);return R!==0||(R=m.originalLine-_.originalLine,R!==0)||(R=m.originalColumn-_.originalColumn,R!==0||C)||(R=m.generatedColumn-_.generatedColumn,R!==0)||(R=m.generatedLine-_.generatedLine,R!==0)?R:v(m.name,_.name)}e.compareByOriginalPositions=p;function g(m,_,C){var R=m.generatedLine-_.generatedLine;return R!==0||(R=m.generatedColumn-_.generatedColumn,R!==0||C)||(R=v(m.source,_.source),R!==0)||(R=m.originalLine-_.originalLine,R!==0)||(R=m.originalColumn-_.originalColumn,R!==0)?R:v(m.name,_.name)}e.compareByGeneratedPositionsDeflated=g;function v(m,_){return m===_?0:m===null?1:_===null?-1:m>_?1:-1}function S(m,_){var C=m.generatedLine-_.generatedLine;return C!==0||(C=m.generatedColumn-_.generatedColumn,C!==0)||(C=v(m.source,_.source),C!==0)||(C=m.originalLine-_.originalLine,C!==0)||(C=m.originalColumn-_.originalColumn,C!==0)?C:v(m.name,_.name)}e.compareByGeneratedPositionsInflated=S;function w(m){return JSON.parse(m.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=w;function y(m,_,C){if(_=_||"",m&&(m[m.length-1]!=="/"&&_[0]!=="/"&&(m+="/"),_=m+_),C){var R=i(C);if(!R)throw new Error("sourceMapURL could not be parsed");if(R.path){var b=R.path.lastIndexOf("/");b>=0&&(R.path=R.path.substring(0,b+1))}_=c(n(R),_)}return o(_)}e.computeSourceURL=y})),To=fe((e=>{var t=er(),s=Object.prototype.hasOwnProperty,r=typeof Map<"u";function i(){this._array=[],this._set=r?new Map:Object.create(null)}i.fromArray=function(o,c){for(var u=new i,h=0,d=o.length;h<d;h++)u.add(o[h],c);return u},i.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(o,c){var u=r?o:t.toSetString(o),h=r?this.has(o):s.call(this._set,u),d=this._array.length;(!h||c)&&this._array.push(o),h||(r?this._set.set(o,d):this._set[u]=d)},i.prototype.has=function(o){if(r)return this._set.has(o);var c=t.toSetString(o);return s.call(this._set,c)},i.prototype.indexOf=function(o){if(r){var c=this._set.get(o);if(c>=0)return c}else{var u=t.toSetString(o);if(s.call(this._set,u))return this._set[u]}throw new Error('"'+o+'" is not in the set.')},i.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)},i.prototype.toArray=function(){return this._array.slice()},e.ArraySet=i})),vu=fe((e=>{var t=er();function s(i,n){var o=i.generatedLine,c=n.generatedLine,u=i.generatedColumn,h=n.generatedColumn;return c>o||c==o&&h>=u||t.compareByGeneratedPositionsInflated(i,n)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(n,o){this._array.forEach(n,o)},r.prototype.add=function(n){s(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),Co=fe((e=>{var t=xo(),s=er(),r=To().ArraySet,i=vu().MappingList;function n(o){o||(o={}),this._file=s.getArg(o,"file",null),this._sourceRoot=s.getArg(o,"sourceRoot",null),this._skipValidation=s.getArg(o,"skipValidation",!1),this._sources=new r,this._names=new r,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(c){var u=c.sourceRoot,h=new n({file:c.file,sourceRoot:u});return c.eachMapping(function(d){var a={generated:{line:d.generatedLine,column:d.generatedColumn}};d.source!=null&&(a.source=d.source,u!=null&&(a.source=s.relative(u,a.source)),a.original={line:d.originalLine,column:d.originalColumn},d.name!=null&&(a.name=d.name)),h.addMapping(a)}),c.sources.forEach(function(d){var a=d;u!==null&&(a=s.relative(u,d)),h._sources.has(a)||h._sources.add(a);var f=c.sourceContentFor(d);f!=null&&h.setSourceContent(d,f)}),h},n.prototype.addMapping=function(c){var u=s.getArg(c,"generated"),h=s.getArg(c,"original",null),d=s.getArg(c,"source",null),a=s.getArg(c,"name",null);this._skipValidation||this._validateMapping(u,h,d,a),d!=null&&(d=String(d),this._sources.has(d)||this._sources.add(d)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:u.line,generatedColumn:u.column,originalLine:h!=null&&h.line,originalColumn:h!=null&&h.column,source:d,name:a})},n.prototype.setSourceContent=function(c,u){var h=c;this._sourceRoot!=null&&(h=s.relative(this._sourceRoot,h)),u!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[s.toSetString(h)]=u):this._sourcesContents&&(delete this._sourcesContents[s.toSetString(h)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(c,u,h){var d=u;if(u==null){if(c.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);d=c.file}var a=this._sourceRoot;a!=null&&(d=s.relative(a,d));var f=new r,l=new r;this._mappings.unsortedForEach(function(p){if(p.source===d&&p.originalLine!=null){var g=c.originalPositionFor({line:p.originalLine,column:p.originalColumn});g.source!=null&&(p.source=g.source,h!=null&&(p.source=s.join(h,p.source)),a!=null&&(p.source=s.relative(a,p.source)),p.originalLine=g.line,p.originalColumn=g.column,g.name!=null&&(p.name=g.name))}var v=p.source;v!=null&&!f.has(v)&&f.add(v);var S=p.name;S!=null&&!l.has(S)&&l.add(S)},this),this._sources=f,this._names=l,c.sources.forEach(function(p){var g=c.sourceContentFor(p);g!=null&&(h!=null&&(p=s.join(h,p)),a!=null&&(p=s.relative(a,p)),this.setSourceContent(p,g))},this)},n.prototype._validateMapping=function(c,u,h,d){if(u&&typeof u.line!="number"&&typeof u.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(c&&"line"in c&&"column"in c&&c.line>0&&c.column>=0&&!u&&!h&&!d)){if(c&&"line"in c&&"column"in c&&u&&"line"in u&&"column"in u&&c.line>0&&c.column>=0&&u.line>0&&u.column>=0&&h)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:c,source:h,original:u,name:d}))}},n.prototype._serializeMappings=function(){for(var c=0,u=1,h=0,d=0,a=0,f=0,l="",p,g,v,S,w=this._mappings.toArray(),y=0,m=w.length;y<m;y++){if(g=w[y],p="",g.generatedLine!==u)for(c=0;g.generatedLine!==u;)p+=";",u++;else if(y>0){if(!s.compareByGeneratedPositionsInflated(g,w[y-1]))continue;p+=","}p+=t.encode(g.generatedColumn-c),c=g.generatedColumn,g.source!=null&&(S=this._sources.indexOf(g.source),p+=t.encode(S-f),f=S,p+=t.encode(g.originalLine-1-d),d=g.originalLine-1,p+=t.encode(g.originalColumn-h),h=g.originalColumn,g.name!=null&&(v=this._names.indexOf(g.name),p+=t.encode(v-a),a=v)),l+=p}return l},n.prototype._generateSourcesContent=function(c,u){return c.map(function(h){if(!this._sourcesContents)return null;u!=null&&(h=s.relative(u,h));var d=s.toSetString(h);return Object.prototype.hasOwnProperty.call(this._sourcesContents,d)?this._sourcesContents[d]:null},this)},n.prototype.toJSON=function(){var c={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(c.file=this._file),this._sourceRoot!=null&&(c.sourceRoot=this._sourceRoot),this._sourcesContents&&(c.sourcesContent=this._generateSourcesContent(c.sources,c.sourceRoot)),c},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=n})),yu=fe((e=>{e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(s,r,i,n,o,c){var u=Math.floor((r-s)/2)+s,h=o(i,n[u],!0);return h===0?u:h>0?r-u>1?t(u,r,i,n,o,c):c==e.LEAST_UPPER_BOUND?r<n.length?r:-1:u:u-s>1?t(s,u,i,n,o,c):c==e.LEAST_UPPER_BOUND?u:s<0?-1:s}e.search=function(r,i,n,o){if(i.length===0)return-1;var c=t(-1,i.length,r,i,n,o||e.GREATEST_LOWER_BOUND);if(c<0)return-1;for(;c-1>=0&&n(i[c],i[c-1],!0)===0;)--c;return c}})),bu=fe((e=>{function t(i,n,o){var c=i[n];i[n]=i[o],i[o]=c}function s(i,n){return Math.round(i+Math.random()*(n-i))}function r(i,n,o,c){if(o<c){var u=s(o,c),h=o-1;t(i,u,c);for(var d=i[c],a=o;a<c;a++)n(i[a],d)<=0&&(h+=1,t(i,h,a));t(i,h+1,a);var f=h+1;r(i,n,o,f-1),r(i,n,f+1,c)}}e.quickSort=function(i,n){r(i,n,0,i.length-1)}})),Su=fe((e=>{var t=er(),s=yu(),r=To().ArraySet,i=xo(),n=bu().quickSort;function o(d,a){var f=d;return typeof d=="string"&&(f=t.parseSourceMapInput(d)),f.sections!=null?new h(f,a):new c(f,a)}o.fromSourceMap=function(d,a){return c.fromSourceMap(d,a)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(a,f){var l=a.charAt(f);return l===";"||l===","},o.prototype._parseMappings=function(a,f){throw new Error("Subclasses must implement _parseMappings")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(a,f,l){var p=f||null,g=l||o.GENERATED_ORDER,v;switch(g){case o.GENERATED_ORDER:v=this._generatedMappings;break;case o.ORIGINAL_ORDER:v=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var S=this.sourceRoot;v.map(function(w){var y=w.source===null?null:this._sources.at(w.source);return y=t.computeSourceURL(S,y,this._sourceMapURL),{source:y,generatedLine:w.generatedLine,generatedColumn:w.generatedColumn,originalLine:w.originalLine,originalColumn:w.originalColumn,name:w.name===null?null:this._names.at(w.name)}},this).forEach(a,p)},o.prototype.allGeneratedPositionsFor=function(a){var f=t.getArg(a,"line"),l={source:t.getArg(a,"source"),originalLine:f,originalColumn:t.getArg(a,"column",0)};if(l.source=this._findSourceIndex(l.source),l.source<0)return[];var p=[],g=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,s.LEAST_UPPER_BOUND);if(g>=0){var v=this._originalMappings[g];if(a.column===void 0)for(var S=v.originalLine;v&&v.originalLine===S;)p.push({line:t.getArg(v,"generatedLine",null),column:t.getArg(v,"generatedColumn",null),lastColumn:t.getArg(v,"lastGeneratedColumn",null)}),v=this._originalMappings[++g];else for(var w=v.originalColumn;v&&v.originalLine===f&&v.originalColumn==w;)p.push({line:t.getArg(v,"generatedLine",null),column:t.getArg(v,"generatedColumn",null),lastColumn:t.getArg(v,"lastGeneratedColumn",null)}),v=this._originalMappings[++g]}return p},e.SourceMapConsumer=o;function c(d,a){var f=d;typeof d=="string"&&(f=t.parseSourceMapInput(d));var l=t.getArg(f,"version"),p=t.getArg(f,"sources"),g=t.getArg(f,"names",[]),v=t.getArg(f,"sourceRoot",null),S=t.getArg(f,"sourcesContent",null),w=t.getArg(f,"mappings"),y=t.getArg(f,"file",null);if(l!=this._version)throw new Error("Unsupported version: "+l);v&&(v=t.normalize(v)),p=p.map(String).map(t.normalize).map(function(m){return v&&t.isAbsolute(v)&&t.isAbsolute(m)?t.relative(v,m):m}),this._names=r.fromArray(g.map(String),!0),this._sources=r.fromArray(p,!0),this._absoluteSources=this._sources.toArray().map(function(m){return t.computeSourceURL(v,m,a)}),this.sourceRoot=v,this.sourcesContent=S,this._mappings=w,this._sourceMapURL=a,this.file=y}c.prototype=Object.create(o.prototype),c.prototype.consumer=o,c.prototype._findSourceIndex=function(d){var a=d;if(this.sourceRoot!=null&&(a=t.relative(this.sourceRoot,a)),this._sources.has(a))return this._sources.indexOf(a);for(var f=0;f<this._absoluteSources.length;++f)if(this._absoluteSources[f]==d)return f;return-1},c.fromSourceMap=function(a,f){var l=Object.create(c.prototype),p=l._names=r.fromArray(a._names.toArray(),!0),g=l._sources=r.fromArray(a._sources.toArray(),!0);l.sourceRoot=a._sourceRoot,l.sourcesContent=a._generateSourcesContent(l._sources.toArray(),l.sourceRoot),l.file=a._file,l._sourceMapURL=f,l._absoluteSources=l._sources.toArray().map(function(R){return t.computeSourceURL(l.sourceRoot,R,f)});for(var v=a._mappings.toArray().slice(),S=l.__generatedMappings=[],w=l.__originalMappings=[],y=0,m=v.length;y<m;y++){var _=v[y],C=new u;C.generatedLine=_.generatedLine,C.generatedColumn=_.generatedColumn,_.source&&(C.source=g.indexOf(_.source),C.originalLine=_.originalLine,C.originalColumn=_.originalColumn,_.name&&(C.name=p.indexOf(_.name)),w.push(C)),S.push(C)}return n(l.__originalMappings,t.compareByOriginalPositions),l},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function u(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}c.prototype._parseMappings=function(a,f){for(var l=1,p=0,g=0,v=0,S=0,w=0,y=a.length,m=0,_={},C={},R=[],b=[],x,T,A,L,D;m<y;)if(a.charAt(m)===";")l++,m++,p=0;else if(a.charAt(m)===",")m++;else{for(x=new u,x.generatedLine=l,L=m;L<y&&!this._charIsMappingSeparator(a,L);L++);if(T=a.slice(m,L),A=_[T],A)m+=T.length;else{for(A=[];m<L;)i.decode(a,m,C),D=C.value,m=C.rest,A.push(D);if(A.length===2)throw new Error("Found a source, but no line and column");if(A.length===3)throw new Error("Found a source and line, but no column");_[T]=A}x.generatedColumn=p+A[0],p=x.generatedColumn,A.length>1&&(x.source=S+A[1],S+=A[1],x.originalLine=g+A[2],g=x.originalLine,x.originalLine+=1,x.originalColumn=v+A[3],v=x.originalColumn,A.length>4&&(x.name=w+A[4],w+=A[4])),b.push(x),typeof x.originalLine=="number"&&R.push(x)}n(b,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=b,n(R,t.compareByOriginalPositions),this.__originalMappings=R},c.prototype._findMapping=function(a,f,l,p,g,v){if(a[l]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+a[l]);if(a[p]<0)throw new TypeError("Column must be greater than or equal to 0, got "+a[p]);return s.search(a,f,g,v)},c.prototype.computeColumnSpans=function(){for(var a=0;a<this._generatedMappings.length;++a){var f=this._generatedMappings[a];if(a+1<this._generatedMappings.length){var l=this._generatedMappings[a+1];if(f.generatedLine===l.generatedLine){f.lastGeneratedColumn=l.generatedColumn-1;continue}}f.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(a){var f={generatedLine:t.getArg(a,"line"),generatedColumn:t.getArg(a,"column")},l=this._findMapping(f,this._generatedMappings,"generatedLine","generatedColumn",t.compareByGeneratedPositionsDeflated,t.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(l>=0){var p=this._generatedMappings[l];if(p.generatedLine===f.generatedLine){var g=t.getArg(p,"source",null);g!==null&&(g=this._sources.at(g),g=t.computeSourceURL(this.sourceRoot,g,this._sourceMapURL));var v=t.getArg(p,"name",null);return v!==null&&(v=this._names.at(v)),{source:g,line:t.getArg(p,"originalLine",null),column:t.getArg(p,"originalColumn",null),name:v}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null}):!1},c.prototype.sourceContentFor=function(a,f){if(!this.sourcesContent)return null;var l=this._findSourceIndex(a);if(l>=0)return this.sourcesContent[l];var p=a;this.sourceRoot!=null&&(p=t.relative(this.sourceRoot,p));var g;if(this.sourceRoot!=null&&(g=t.urlParse(this.sourceRoot))){var v=p.replace(/^file:\/\//,"");if(g.scheme=="file"&&this._sources.has(v))return this.sourcesContent[this._sources.indexOf(v)];if((!g.path||g.path=="/")&&this._sources.has("/"+p))return this.sourcesContent[this._sources.indexOf("/"+p)]}if(f)return null;throw new Error('"'+p+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(a){var f=t.getArg(a,"source");if(f=this._findSourceIndex(f),f<0)return{line:null,column:null,lastColumn:null};var l={source:f,originalLine:t.getArg(a,"line"),originalColumn:t.getArg(a,"column")},p=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,t.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(p>=0){var g=this._originalMappings[p];if(g.source===l.source)return{line:t.getArg(g,"generatedLine",null),column:t.getArg(g,"generatedColumn",null),lastColumn:t.getArg(g,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},e.BasicSourceMapConsumer=c;function h(d,a){var f=d;typeof d=="string"&&(f=t.parseSourceMapInput(d));var l=t.getArg(f,"version"),p=t.getArg(f,"sections");if(l!=this._version)throw new Error("Unsupported version: "+l);this._sources=new r,this._names=new r;var g={line:-1,column:0};this._sections=p.map(function(v){if(v.url)throw new Error("Support for url field in sections not implemented.");var S=t.getArg(v,"offset"),w=t.getArg(S,"line"),y=t.getArg(S,"column");if(w<g.line||w===g.line&&y<g.column)throw new Error("Section offsets must be ordered and non-overlapping.");return g=S,{generatedOffset:{generatedLine:w+1,generatedColumn:y+1},consumer:new o(t.getArg(v,"map"),a)}})}h.prototype=Object.create(o.prototype),h.prototype.constructor=o,h.prototype._version=3,Object.defineProperty(h.prototype,"sources",{get:function(){for(var d=[],a=0;a<this._sections.length;a++)for(var f=0;f<this._sections[a].consumer.sources.length;f++)d.push(this._sections[a].consumer.sources[f]);return d}}),h.prototype.originalPositionFor=function(a){var f={generatedLine:t.getArg(a,"line"),generatedColumn:t.getArg(a,"column")},l=s.search(f,this._sections,function(g,v){var S=g.generatedLine-v.generatedOffset.generatedLine;return S||g.generatedColumn-v.generatedOffset.generatedColumn}),p=this._sections[l];return p?p.consumer.originalPositionFor({line:f.generatedLine-(p.generatedOffset.generatedLine-1),column:f.generatedColumn-(p.generatedOffset.generatedLine===f.generatedLine?p.generatedOffset.generatedColumn-1:0),bias:a.bias}):{source:null,line:null,column:null,name:null}},h.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(a){return a.consumer.hasContentsOfAllSources()})},h.prototype.sourceContentFor=function(a,f){for(var l=0;l<this._sections.length;l++){var p=this._sections[l].consumer.sourceContentFor(a,!0);if(p)return p}if(f)return null;throw new Error('"'+a+'" is not in the SourceMap.')},h.prototype.generatedPositionFor=function(a){for(var f=0;f<this._sections.length;f++){var l=this._sections[f];if(l.consumer._findSourceIndex(t.getArg(a,"source"))!==-1){var p=l.consumer.generatedPositionFor(a);if(p)return{line:p.line+(l.generatedOffset.generatedLine-1),column:p.column+(l.generatedOffset.generatedLine===p.line?l.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},h.prototype._parseMappings=function(a,f){this.__generatedMappings=[],this.__originalMappings=[];for(var l=0;l<this._sections.length;l++)for(var p=this._sections[l],g=p.consumer._generatedMappings,v=0;v<g.length;v++){var S=g[v],w=p.consumer._sources.at(S.source);w=t.computeSourceURL(p.consumer.sourceRoot,w,this._sourceMapURL),this._sources.add(w),w=this._sources.indexOf(w);var y=null;S.name&&(y=p.consumer._names.at(S.name),this._names.add(y),y=this._names.indexOf(y));var m={source:w,generatedLine:S.generatedLine+(p.generatedOffset.generatedLine-1),generatedColumn:S.generatedColumn+(p.generatedOffset.generatedLine===S.generatedLine?p.generatedOffset.generatedColumn-1:0),originalLine:S.originalLine,originalColumn:S.originalColumn,name:y};this.__generatedMappings.push(m),typeof m.originalLine=="number"&&this.__originalMappings.push(m)}n(this.__generatedMappings,t.compareByGeneratedPositionsDeflated),n(this.__originalMappings,t.compareByOriginalPositions)},e.IndexedSourceMapConsumer=h})),_u=fe((e=>{var t=Co().SourceMapGenerator,s=er(),r=/(\r?\n)/,i=10,n="$$$isSourceNode$$$";function o(c,u,h,d,a){this.children=[],this.sourceContents={},this.line=c??null,this.column=u??null,this.source=h??null,this.name=a??null,this[n]=!0,d!=null&&this.add(d)}o.fromStringWithSourceMap=function(u,h,d){var a=new o,f=u.split(r),l=0,p=function(){return y()+(y()||"");function y(){return l<f.length?f[l++]:void 0}},g=1,v=0,S=null;return h.eachMapping(function(y){if(S!==null)if(g<y.generatedLine)w(S,p()),g++,v=0;else{var m=f[l]||"",_=m.substr(0,y.generatedColumn-v);f[l]=m.substr(y.generatedColumn-v),v=y.generatedColumn,w(S,_),S=y;return}for(;g<y.generatedLine;)a.add(p()),g++;if(v<y.generatedColumn){var m=f[l]||"";a.add(m.substr(0,y.generatedColumn)),f[l]=m.substr(y.generatedColumn),v=y.generatedColumn}S=y},this),l<f.length&&(S&&w(S,p()),a.add(f.splice(l).join(""))),h.sources.forEach(function(y){var m=h.sourceContentFor(y);m!=null&&(d!=null&&(y=s.join(d,y)),a.setSourceContent(y,m))}),a;function w(y,m){if(y===null||y.source===void 0)a.add(m);else{var _=d?s.join(d,y.source):y.source;a.add(new o(y.originalLine,y.originalColumn,_,m,y.name))}}},o.prototype.add=function(u){if(Array.isArray(u))u.forEach(function(h){this.add(h)},this);else if(u[n]||typeof u=="string")u&&this.children.push(u);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this},o.prototype.prepend=function(u){if(Array.isArray(u))for(var h=u.length-1;h>=0;h--)this.prepend(u[h]);else if(u[n]||typeof u=="string")this.children.unshift(u);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this},o.prototype.walk=function(u){for(var h,d=0,a=this.children.length;d<a;d++)h=this.children[d],h[n]?h.walk(u):h!==""&&u(h,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(u){var h,d,a=this.children.length;if(a>0){for(h=[],d=0;d<a-1;d++)h.push(this.children[d]),h.push(u);h.push(this.children[d]),this.children=h}return this},o.prototype.replaceRight=function(u,h){var d=this.children[this.children.length-1];return d[n]?d.replaceRight(u,h):typeof d=="string"?this.children[this.children.length-1]=d.replace(u,h):this.children.push("".replace(u,h)),this},o.prototype.setSourceContent=function(u,h){this.sourceContents[s.toSetString(u)]=h},o.prototype.walkSourceContents=function(u){for(var h=0,d=this.children.length;h<d;h++)this.children[h][n]&&this.children[h].walkSourceContents(u);for(var a=Object.keys(this.sourceContents),h=0,d=a.length;h<d;h++)u(s.fromSetString(a[h]),this.sourceContents[a[h]])},o.prototype.toString=function(){var u="";return this.walk(function(h){u+=h}),u},o.prototype.toStringWithSourceMap=function(u){var h={code:"",line:1,column:0},d=new t(u),a=!1,f=null,l=null,p=null,g=null;return this.walk(function(v,S){h.code+=v,S.source!==null&&S.line!==null&&S.column!==null?((f!==S.source||l!==S.line||p!==S.column||g!==S.name)&&d.addMapping({source:S.source,original:{line:S.line,column:S.column},generated:{line:h.line,column:h.column},name:S.name}),f=S.source,l=S.line,p=S.column,g=S.name,a=!0):a&&(d.addMapping({generated:{line:h.line,column:h.column}}),f=null,a=!1);for(var w=0,y=v.length;w<y;w++)v.charCodeAt(w)===i?(h.line++,h.column=0,w+1===y?(f=null,a=!1):a&&d.addMapping({source:S.source,original:{line:S.line,column:S.column},generated:{line:h.line,column:h.column},name:S.name})):h.column++}),this.walkSourceContents(function(v,S){d.setSourceContent(v,S)}),{code:h.code,map:d}},e.SourceNode=o})),wu=fe((e=>{e.SourceMapGenerator=Co().SourceMapGenerator,e.SourceMapConsumer=Su().SourceMapConsumer,e.SourceNode=_u().SourceNode})),ku=fe((e=>{e.__esModule=!0,e.safeJsonLiteral=o;var t=ut(),s=/[\x00-\x1f\\"\u2028\u2029<\ud800-\udfff]/,r=/<(?=!--|\/?script)/gi;function i(d){return d.replace(r,"\\u003C")}function n(d){return"\\u"+d.charCodeAt(0).toString(16)}function o(d){return i(JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/[\ud800-\udfff]/g,n))}var c=void 0;try{(typeof define!="function"||!define.amd)&&(c=wu().SourceNode)}catch{}c||(c=function(d,a,f,l){this.src="",l&&this.add(l)},c.prototype={add:function(a){t.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){t.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function u(d,a,f){if(t.isArray(d)){for(var l=[],p=0,g=d.length;p<g;p++)l.push(a.wrap(d[p],f));return l}else if(typeof d=="boolean"||typeof d=="number")return d+"";return d}function h(d){this.srcFile=d,this.source=[]}h.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,f){this.source.unshift(this.wrap(a,f))},push:function(a,f){this.source.push(this.wrap(a,f))},merge:function(){var a=this.empty();return this.each(function(f){a.add([" ",f,`
|
|
1508
|
+
`])}),a},each:function(a){for(var f=0,l=this.source.length;f<l;f++)a(this.source[f])},empty:function(){var a=this.currentLocation||{start:{}};return new c(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var f=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return a instanceof c?a:(a=u(a,this,f),new c(f.start.line,f.start.column,this.srcFile,a))},functionCall:function(a,f,l){return l=this.generateList(l),this.wrap([a,f?"."+f+"(":"(",l,")"])},quotedString:function(a){return a=a+"",s.test(a)?o(a):'"'+a+'"'},objectLiteral:function(a){var f=this,l=[];Object.keys(a).forEach(function(g){var v=u(a[g],f);v!=="undefined"&&l.push([f.quotedString(g),":",v])});var p=this.generateList(l);return p.prepend("{"),p.add("}"),p},generateList:function(a){for(var f=this.empty(),l=0,p=a.length;l<p;l++)l&&f.add(","),f.add(u(a[l],this));return f},generateArray:function(a){var f=this.generateList(a);return f.prepend("["),f.add("]"),f}},e.default=h})),xu=fe(((e,t)=>{e.__esModule=!0;function s(f){return f&&f.__esModule?f:{default:f}}var r=Di(),i=s(qt()),n=ut(),o=ku(),c=s(o);function u(f){this.value=f}function h(){}h.prototype={nameLookup:function(l,p){return this.internalNameLookup(l,p)},depthedLookup:function(l){return[this.aliasable("container.lookup"),"(depths, ",this.quotedString(l),")"]},compilerInfo:function(){var l=r.COMPILER_REVISION;return[l,r.REVISION_CHANGES[l]]},appendToBuffer:function(l,p,g){return n.isArray(l)||(l=[l]),l=this.source.wrap(l,p),this.environment.isSimple?["return ",l,";"]:g?["buffer += ",l,";"]:(l.appendToBuffer=!0,l)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(l,p){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",l,",",this.quotedString(p),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(l,p,g,v){this.environment=l,this.options=p,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!v,this.name=this.environment.name,this.isChild=!!g,this.context=g||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(l,p),this.useDepths=this.useDepths||l.useDepths||l.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||l.useBlockParams;var S=l.opcodes,w=void 0,y=void 0,m=void 0,_=void 0;for(m=0,_=S.length;m<_;m++)w=S[m],this.source.currentLocation=w.loc,y=y||w.loc,this[w.opcode].apply(this,w.args);if(this.source.currentLocation=y,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
|
|
1509
|
+
`]),this.decorators.push("return fn;"),v?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
|
|
1510
|
+
`),this.decorators.push(`}
|
|
1511
|
+
`),this.decorators=this.decorators.merge()));var C=this.createFunctionContext(v);if(this.isChild)return C;var R={compiler:this.compilerInfo(),main:C};this.decorators&&(R.main_d=this.decorators,R.useDecorators=!0);var b=this.context,x=b.programs,T=b.decorators;for(m=0,_=x.length;m<_;m++)R[m]=x[m],T[m]&&(R[m+"_d"]=T[m],R.useDecorators=!0);return this.environment.usePartial&&(R.usePartial=!0),this.options.data&&(R.useData=!0),this.useDepths&&(R.useDepths=!0),this.useBlockParams&&(R.useBlockParams=!0),this.options.compat&&(R.compat=!0),v?R.compilerOptions=this.options:(R.compiler=JSON.stringify(R.compiler),this.source.currentLocation={start:{line:1,column:0}},R=this.objectLiteral(R),p.srcName?(R=R.toStringWithSourceMap({file:p.destName}),R.map=R.map&&R.map.toString()):R=R.toString()),R},preamble:function(){this.lastContext=0,this.source=new c.default(this.options.srcName),this.decorators=new c.default(this.options.srcName)},createFunctionContext:function(l){var p=this,g="",v=this.stackVars.concat(this.registers.list);v.length>0&&(g+=", "+v.join(", "));var S=0;Object.keys(this.aliases).forEach(function(m){var _=p.aliases[m];_.children&&_.referenceCount>1&&(g+=", alias"+ ++S+"="+m,_.children[0]="alias"+S)}),this.lookupPropertyFunctionIsUsed&&(g+=", "+this.lookupPropertyFunctionVarDeclaration());var w=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&w.push("blockParams"),this.useDepths&&w.push("depths");var y=this.mergeSource(g);return l?(w.push(y),Function.apply(this,w)):this.source.wrap(["function(",w.join(","),`) {
|
|
1512
|
+
`,y,"}"])},mergeSource:function(l){var p=this.environment.isSimple,g=!this.forceBuffer,v=void 0,S=void 0,w=void 0,y=void 0;return this.source.each(function(m){m.appendToBuffer?(w?m.prepend(" + "):w=m,y=m):(w&&(S?w.prepend("buffer += "):v=!0,y.add(";"),w=y=void 0),S=!0,p||(g=!1))}),g?w?(w.prepend("return "),y.add(";")):S||this.source.push('return "";'):(l+=", buffer = "+(v?"":this.initializeBuffer()),w?(w.prepend("return buffer + "),y.add(";")):this.source.push("return buffer;")),l&&this.source.prepend("var "+l.substring(2)+(v?"":`;
|
|
1513
|
+
`)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`
|
|
1514
|
+
lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
1515
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
1516
|
+
return parent[propertyName];
|
|
1517
|
+
}
|
|
1518
|
+
return undefined
|
|
1519
|
+
}
|
|
1520
|
+
`.trim()},blockValue:function(l){var p=this.aliasable("container.hooks.blockHelperMissing"),g=[this.contextName(0)];this.setupHelperArgs(l,0,g);var v=this.popStack();g.splice(1,0,v),this.push(this.source.functionCall(p,"call",g))},ambiguousBlockValue:function(){var l=this.aliasable("container.hooks.blockHelperMissing"),p=[this.contextName(0)];this.setupHelperArgs("",0,p,!0),this.flushInline();var g=this.topStack();p.splice(1,0,g),this.pushSource(["if (!",this.lastHelper,") { ",g," = ",this.source.functionCall(l,"call",p),"}"])},appendContent:function(l){this.pendingContent?l=this.pendingContent+l:this.pendingLocation=this.source.currentLocation,this.pendingContent=l},append:function(){if(this.isInline())this.replaceStack(function(p){return[" != null ? ",p,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var l=this.popStack();this.pushSource(["if (",l," != null) { ",this.appendToBuffer(l,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(l){this.lastContext=l},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(l,p,g,v){var S=0;!v&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(l[S++])):this.pushContext(),this.resolvePath("context",l,S,p,g)},lookupBlockParam:function(l,p){this.useBlockParams=!0,this.push(["blockParams[",l[0],"][",l[1],"]"]),this.resolvePath("context",p,1)},lookupData:function(l,p,g){l?this.pushStackLiteral("container.data(data, "+l+")"):this.pushStackLiteral("data"),this.resolvePath("data",p,0,!0,g)},resolvePath:function(l,p,g,v,S){var w=this;if(this.options.strict||this.options.assumeObjects){this.push(a(this.options.strict&&S,this,p,g,l));return}for(var y=p.length,m=function(C){w.replaceStack(function(R){var b=w.nameLookup(R,p[C],l);return v?[" && ",b]:[" != null ? ",b," : ",R]})},_=g;_<y;_++)m(_)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(l,p){this.pushContext(),this.pushString(p),p!=="SubExpression"&&(typeof l=="string"?this.pushString(l):this.pushStackLiteral(l))},emptyHash:function(l){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(l?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var l=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(l.ids)),this.stringParams&&(this.push(this.objectLiteral(l.contexts)),this.push(this.objectLiteral(l.types))),this.push(this.objectLiteral(l.values))},pushString:function(l){this.pushStackLiteral(this.quotedString(l))},pushLiteral:function(l){this.pushStackLiteral(l)},pushProgram:function(l){l!=null?this.pushStackLiteral(this.programExpression(l)):this.pushStackLiteral(null)},registerDecorator:function(l,p){var g=this.nameLookup("decorators",p,"decorator"),v=this.setupHelperArgs(p,l);this.decorators.push(["var decorator = ",g,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+p+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",v])," || fn;"])},invokeHelper:function(l,p,g){var v=this.popStack(),S=this.setupHelper(l,p),w=[];g&&w.push(S.name),w.push(v),this.options.strict||w.push(this.aliasable("container.hooks.helperMissing"));var y=["(",this.itemsSeparatedBy(w,"||"),")"],m=this.source.functionCall(y,"call",S.callParams);this.push(m)},itemsSeparatedBy:function(l,p){var g=[];g.push(l[0]);for(var v=1;v<l.length;v++)g.push(p,l[v]);return g},invokeKnownHelper:function(l,p){var g=this.setupHelper(l,p);this.push(this.source.functionCall(g.name,"call",g.callParams))},invokeAmbiguous:function(l,p){this.useRegister("helper");var g=this.popStack();this.emptyHash();var v=this.setupHelper(0,l,p),S=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",l,"helper")," || ",g,")"];this.options.strict||(S[0]="(helper = ",S.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",S,v.paramsInit?["),(",v.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",v.callParams)," : helper))"])},invokePartial:function(l,p,g){var v=[],S=this.setupParams(p,1,v);l&&(p=this.popStack(),delete S.name),g&&(S.indent=this.quotedString(g)),S.helpers="helpers",S.partials="partials",S.decorators="container.decorators",l?v.unshift(p):v.unshift(this.nameLookup("partials",p,"partial")),this.options.compat&&(S.depths="depths"),S=this.objectLiteral(S),v.push(S),this.push(this.source.functionCall("container.invokePartial","",v))},assignToHash:function(l){var p=this.popStack(),g=void 0,v=void 0,S=void 0;this.trackIds&&(S=this.popStack()),this.stringParams&&(v=this.popStack(),g=this.popStack());var w=this.hash;g&&(w.contexts[l]=g),v&&(w.types[l]=v),S&&(w.ids[l]=S),w.values[l]=p},pushId:function(l,p,g){l==="BlockParam"?this.pushStackLiteral("blockParams["+p[0]+"].path["+p[1]+"]"+(g?" + "+this.quotedString("."+g):"")):l==="PathExpression"?this.pushString(p):l==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:h,compileChildren:function(l,p){for(var g=l.children,v=void 0,S=void 0,w=0,y=g.length;w<y;w++){v=g[w],S=new this.compiler;var m=this.matchExistingProgram(v);if(m==null){var _=this.context.programs.push("")-1;v.index=_,v.name="program"+_,this.context.programs[_]=S.compile(v,p,this.context,!this.precompile),this.context.decorators[_]=S.decorators,this.context.environments[_]=v,this.useDepths=this.useDepths||S.useDepths,this.useBlockParams=this.useBlockParams||S.useBlockParams,v.useDepths=this.useDepths,v.useBlockParams=this.useBlockParams}else v.index=m.index,v.name="program"+m.index,this.useDepths=this.useDepths||m.useDepths,this.useBlockParams=this.useBlockParams||m.useBlockParams}},matchExistingProgram:function(l){for(var p=0,g=this.context.environments.length;p<g;p++){var v=this.context.environments[p];if(v&&v.equals(l))return v}},programExpression:function(l){var p=this.environment.children[l],g=[p.index,"data",p.blockParams];return(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths"),"container.program("+g.join(", ")+")"},useRegister:function(l){this.registers[l]||(this.registers[l]=!0,this.registers.list.push(l))},push:function(l){return l instanceof u||(l=this.source.wrap(l)),this.inlineStack.push(l),l},pushStackLiteral:function(l){this.push(new u(l))},pushSource:function(l){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),l&&this.source.push(l)},replaceStack:function(l){var p=["("],g=void 0,v=void 0,S=void 0;if(!this.isInline())throw new i.default("replaceStack on non-inline");var w=this.popStack(!0);if(w instanceof u)g=[w.value],p=["(",g],S=!0;else{v=!0;var y=this.incrStack();p=["((",this.push(y)," = ",w,")"],g=this.topStack()}var m=l.call(this,g);S||this.popStack(),v&&this.stackSlot--,this.push(p.concat(m,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var l=this.inlineStack;this.inlineStack=[];for(var p=0,g=l.length;p<g;p++){var v=l[p];if(v instanceof u)this.compileStack.push(v);else{var S=this.incrStack();this.pushSource([S," = ",v,";"]),this.compileStack.push(S)}}},isInline:function(){return this.inlineStack.length},popStack:function(l){var p=this.isInline(),g=(p?this.inlineStack:this.compileStack).pop();if(!l&&g instanceof u)return g.value;if(!p){if(!this.stackSlot)throw new i.default("Invalid stack pop");this.stackSlot--}return g},topStack:function(){var l=this.isInline()?this.inlineStack:this.compileStack,p=l[l.length-1];return p instanceof u?p.value:p},contextName:function(l){return this.useDepths&&l?"depths["+l+"]":"depth"+l},quotedString:function(l){return this.source.quotedString(l)},objectLiteral:function(l){return this.source.objectLiteral(l)},aliasable:function(l){var p=this.aliases[l];return p?(p.referenceCount++,p):(p=this.aliases[l]=this.source.wrap(l),p.aliasable=!0,p.referenceCount=1,p)},setupHelper:function(l,p,g){var v=[];return{params:v,paramsInit:this.setupHelperArgs(p,l,v,g),name:this.nameLookup("helpers",p,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(v)}},setupParams:function(l,p,g){var v={},S=[],w=[],y=[],m=!g,_=void 0;m&&(g=[]),v.name=this.quotedString(l),v.hash=this.popStack(),this.trackIds&&(v.hashIds=this.popStack()),this.stringParams&&(v.hashTypes=this.popStack(),v.hashContexts=this.popStack());var C=this.popStack(),R=this.popStack();(R||C)&&(v.fn=R||"container.noop",v.inverse=C||"container.noop");for(var b=p;b--;)_=this.popStack(),g[b]=_,this.trackIds&&(y[b]=this.popStack()),this.stringParams&&(w[b]=this.popStack(),S[b]=this.popStack());return m&&(v.args=this.source.generateArray(g)),this.trackIds&&(v.ids=this.source.generateArray(y)),this.stringParams&&(v.types=this.source.generateArray(w),v.contexts=this.source.generateArray(S)),this.options.data&&(v.data="data"),this.useBlockParams&&(v.blockParams="blockParams"),v},setupHelperArgs:function(l,p,g,v){var S=this.setupParams(l,p,g);return S.loc=d(this),S=this.objectLiteral(S),v?(this.useRegister("options"),g.push("options"),["options=",S]):g?(g.push(S),""):S}},(function(){for(var f="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),l=h.RESERVED_WORDS={},p=0,g=f.length;p<g;p++)l[f[p]]=!0})(),h.isValidJavaScriptVariableName=function(f){return!h.RESERVED_WORDS[f]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(f)};function d(f){var l=f.source.currentLocation;return l?o.safeJsonLiteral(l):"undefined"}function a(f,l,p,g,v){var S=l.popStack(),w=p.length;f&&w--;for(var y=g;y<w;y++)S=l.nameLookup(S,p[y],v);return f?[l.aliasable("container.strict"),"(",S,", ",l.quotedString(p[w]),", ",d(l)," )"]:S}e.default=h,t.exports=e.default})),Tu=fe(((e,t)=>{e.__esModule=!0;function s(l){return l&&l.__esModule?l:{default:l}}var r=s(uu()),i=s(_o()),n=pu(),o=gu(),c=s(xu()),u=s(ko()),h=s(So()),d=r.default.create;function a(){var l=d();return l.compile=function(p,g){return o.compile(p,g,l)},l.precompile=function(p,g){return o.precompile(p,g,l)},l.AST=i.default,l.Compiler=o.Compiler,l.JavaScriptCompiler=c.default,l.Parser=n.parser,l.parse=n.parse,l.parseWithoutProcessing=n.parseWithoutProcessing,l}var f=a();f.create=a,h.default(f),f.Visitor=u.default,f.default=f,e.default=f,t.exports=e.default})),He=Vl(Tu(),1),Cu=new Set(["{","}",":",",","]"]),qi={"=":"eq","==":"eq","!=":"ne",">":"gt","<":"lt",">=":"gte","<=":"lte",contains:"__contains"},Eu={"+":"add","-":"sub","*":"mul","/":"div","%":"mod"},Au=["==","!=",">=","<=","&&","||","=",">","<","!","+","*","%","-","/","?"],Pu=["and","or","not"],Eo=["true","false","null","undefined"],Lu=new Set([...` \r
|
|
1521
|
+
!"'()<>=&|{}~+*%:,]?`]),Bi=/^-?\d+(\.\d+)?$/,Fe=class extends Error{};function Ru(e,t){const s=e.substring(t+1).trimStart();if(/^[\]"'{[(\d-]/.test(s))return!0;const r=e.indexOf("]",t);return r!==-1&&e.substring(t,r).includes(",")}function Ou(e){return e?.type==="ident"||e?.type==="value"||e?.type===")"||e?.type==="]"||e?.type==="}"}function Iu(e){const t=[];let s=0;for(;s<e.length;){const r=e[s];if(/\s/.test(r)){s++;continue}if(r==="("||r===")"||Cu.has(r)){t.push({type:r,text:r}),s++;continue}if(r==='"'||r==="'"){let c=s+1;for(;c<e.length&&e[c]!==r;)e[c]==="\\"&&c++,c++;if(c>=e.length)throw new Fe("unterminated string");t.push({type:"value",text:e.slice(s,c+1)}),s=c+1;continue}if(r==="["&&/[\w\])]/.test(e[s-1]??"")){t.push({type:"index",text:r}),s++;continue}if(r==="["&&Ru(e,s)){t.push({type:"[",text:r}),s++;continue}const i=Au.find(c=>e.startsWith(c,s)&&!(c==="-"&&/\d/.test(e[s+1]??"")));if(i){t.push({type:"op",text:i}),s+=i.length;continue}let n=s;for(;n<e.length&&!Lu.has(e[n])&&!(e[n]==="["&&n>s&&e[n-1]!=="."&&e[n-1]!=="/");){if(e[n]==="["){const c=e.indexOf("]",n);if(c===-1)throw new Fe("missing ']'");n=c}n++}if(n===s)throw new Fe(`unexpected '${r}'`);const o=e.slice(s,n);Pu.includes(o)||o==="contains"&&Ou(t[t.length-1])?t.push({type:"op",text:o}):Eo.includes(o)||Bi.test(o)?t.push({type:"value",text:o}):t.push({type:"ident",text:o}),s=n}return t}var Mu=class{constructor(e){Object.defineProperty(this,"tokens",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"pos",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"usedInfix",{enumerable:!0,configurable:!0,writable:!0,value:!1})}peek(e=0){return this.tokens[this.pos+e]}next(){return this.tokens[this.pos++]}isOp(e,...t){return e?.type==="op"&&t.includes(e.text)}startsPrimary(e){return e?.type==="ident"||e?.type==="value"||e?.type==="("||e?.type==="["||e?.type==="{"}describe(e){return e?`'${e.text}'`:"end of expression"}parseExpression(){const e=this.parseConditional();if(this.peek())throw new Fe(`unexpected ${this.describe(this.peek())}`);return e}parseArguments(e){const t=[];for(let s=0;s<e;s++)t.push(this.parsePrimary());if(!this.peek())throw new Fe("expected a value");return t.push(this.parseExpression()),t}parseEmbed(){const e=[this.parsePrimary()];for(;this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=");){const t=this.next().text;if(this.next(),!this.peek())throw new Fe(`expected a value after '${t}='`);e.push({kind:"raw",text:`${t}=${is(this.parseConditional())}`})}if(this.peek())throw new Fe(`unexpected ${this.describe(this.peek())}`);return e}parseCondition(){const e=[this.parseConditional()];for(;this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=");)e.push(this.parseHashPair());if(this.peek())throw new Fe(`unexpected ${this.describe(this.peek())}`);return e}parseHashPair(){const e=this.next().text;return this.next(),{kind:"raw",text:`${e}=${is(this.parsePrimary())}`}}parseConditional(){const e=this.parseOr();if(!this.isOp(this.peek(),"?"))return e;if(this.next(),!this.peek())throw new Fe("expected a value after '?'");const t=this.parseConditional();if(this.expect(":"),!this.peek())throw new Fe("expected a value after ':'");const s=this.parseConditional();return this.usedInfix=!0,{kind:"call",name:"cond",args:[e,t,s]}}parseOr(){return this.parseChain(["or","||"],"or",()=>this.parseAnd())}parseAnd(){return this.parseChain(["and","&&"],"and",()=>this.parseNot())}parseChain(e,t,s){const r=[s()];for(;this.isOp(this.peek(),...e);){const i=this.next().text;if(!this.peek())throw new Fe(`expected a value after '${i}'`);r.push(s())}return r.length===1?r[0]:(this.usedInfix=!0,{kind:"call",name:t,args:r})}parseNot(){if(this.isOp(this.peek(),"not","!")){const e=this.next().text;if(!this.peek())throw new Fe(`expected a value after '${e}'`);return this.usedInfix=!0,{kind:"call",name:"not",args:[this.parseNot()]}}return this.parseComparison()}parseComparison(){const e=this.parseAdditive(),t=this.peek();if(t?.type!=="op"||!(t.text in qi))return e;if(this.next(),!this.peek())throw new Fe(`expected a value after '${t.text}'`);const s=this.parseAdditive(),r=this.peek();if(r?.type==="op"&&r.text in qi)throw new Fe(`comparisons can't be chained (at '${r.text}'), use "and" to combine them`);return this.usedInfix=!0,{kind:"call",name:qi[t.text],args:[e,s]}}parseAdditive(){return this.parseArithmetic(["+","-"],()=>this.parseMultiplicative())}parseMultiplicative(){return this.parseArithmetic(["*","/","%"],()=>this.parseUnary())}parseArithmetic(e,t){let s=t();for(;;){let r;const i=this.peek();if(this.isOp(i,...e)){if(r=this.next().text,!this.peek())throw new Fe(`expected a value after '${r}'`)}else if(e.includes("-")&&i?.type==="value"&&i.text.startsWith("-")&&Bi.test(i.text))r="-",this.tokens[this.pos]={type:"value",text:i.text.slice(1)};else return s;this.usedInfix=!0,s={kind:"call",name:Eu[r],args:[s,t()]}}}parseUnary(){if(this.isOp(this.peek(),"-")){if(this.next(),!this.peek())throw new Fe("expected a value after '-'");return this.usedInfix=!0,{kind:"call",name:"sub",args:[{kind:"raw",text:"0"},this.parseUnary()]}}return this.parsePrimary()}parsePrimary(){let e=this.parseAtom();for(;;){const t=this.peek();if(t?.type==="index"){this.next();const s=this.parseConditional();this.expect("]"),this.usedInfix=!0,e={kind:"call",name:"lookup",args:[e,s]}}else if(t?.type==="ident"&&t.text.startsWith(".")&&this.tokens[this.pos-1]?.type==="]"){this.next();for(const s of t.text.substring(1).split(".")){const r=/^\[(.*)\]$/.exec(s)?.[1]??s;if(!r)throw new Fe(`unexpected '${t.text}'`);e={kind:"call",name:"lookup",args:[e,{kind:"raw",text:JSON.stringify(r)}]}}}else return e}}expect(e){if(this.peek()?.type!==e)throw new Fe(`expected '${e}' but found ${this.describe(this.peek())}`);this.next()}parseObject(){const e=[];for(;this.peek()?.type!=="}";){const t=this.next();if(!t)throw new Fe("expected '}' but found end of expression");if((t.type==="ident"||t.type==="value")&&/^\w+$/.test(t.text))e.push({kind:"raw",text:`"${t.text}"`});else if(t.type==="value"&&/^["']/.test(t.text))e.push({kind:"raw",text:t.text});else throw new Fe(`expected a name in the object, e.g. { hp: 10 }, but found '${t.text}'`);if(this.expect(":"),e.push(this.parseConditional()),this.peek()?.type!==",")break;this.next()}return this.expect("}"),this.usedInfix=!0,{kind:"call",name:"__object",args:e}}parseList(){const e=[];for(;this.peek()?.type!=="]";){if(!this.peek())throw new Fe("expected ']' but found end of expression");if(e.push(this.parseConditional()),this.peek()?.type!==",")break;this.next()}return this.expect("]"),this.usedInfix=!0,{kind:"call",name:"array",args:e}}parseAtom(){const e=this.peek();if(e?.type==="{")return this.next(),this.parseObject();if(e?.type==="[")return this.next(),this.parseList();if(e?.type==="ident"||e?.type==="value")return this.next(),{kind:"raw",text:e.text};if(e?.type==="("){this.next();const t=this.isHelperCall()?this.parseHelperCall():this.parseConditional();if(this.peek()?.type!==")")throw new Fe(`expected ')' but found ${this.describe(this.peek())}`);return this.next(),t}if(this.isOp(e,"not","!")){const t=e?.text==="!"?"!value":"not value";throw new Fe(`'${e?.text}' must be inside parentheses here, e.g. (${t})`)}throw e?.type==="op"?new Fe(`expected a value before '${e.text}'`):new Fe(e?`unexpected ${this.describe(e)}`:"expected a value")}isHelperCall(){const e=this.peek(),t=this.peek(1);return this.isOp(e,"and","or")?!0:e?.type==="ident"&&this.startsPrimary(t)}parseHelperCall(){const e=this.next().text,t=[];for(;this.peek()&&this.peek()?.type!==")";)this.peek()?.type==="ident"&&this.isOp(this.peek(1),"=")?t.push(this.parseHashPair()):t.push(this.parsePrimary());return{kind:"call",name:e,args:t}}};function is(e){return e.kind==="raw"?e.text:`(${e.name} ${e.args.map(is).join(" ")})`}function tr(e,t,s){const r=t==="display"||t==="value";let i=null,n=[];try{n=Iu(e)}catch(h){if(!r||!(h instanceof Fe))return null;i=h}const o=n.some(h=>h.type==="op"||h.type==="index"||h.type==="["||h.type==="{"),c=new Mu(n);let u=[];if(!i)try{u=t==="condition"?c.parseCondition():t==="arguments"?c.parseArguments(1):t==="embed"?c.parseEmbed():[c.parseExpression()]}catch(h){if(!(h instanceof Fe)||!o&&!r)return null;i=h}if(i)throw new Error(`Invalid ${s} "${e.trim()}": ${i.message}`);return!c.usedInfix&&!r?null:u}function Nu(e){const t=tr(e,"condition","condition");return t&&t.map(is).join(" ")}function $u(e){const t=tr(e,"arguments","expression");return t&&t.map(is).join(" ")}function Du(e,t="embed"){const s=tr(e,"embed",t);return s&&s.map(is).join(" ")}function qu(e){const t=tr(e,"display","expression")[0];if(t.kind==="call")return`${t.name} ${t.args.map(is).join(" ")}`;if(Eo.includes(t.text)||Bi.test(t.text)||/^["']/.test(t.text))throw new Error(`Invalid expression "${e.trim()}": expected an attribute or a calculation`);return t.text}function Bu(e){return is(tr(e,"value","expression")[0])}function Hu(e){const t=[];let s=0,r=null,i=0;for(let n=0;n<e.length;n++){const o=e[n];r?o==="\\"?n++:o===r&&(r=null):o==='"'||o==="'"?r=o:o==="("||o==="["||o==="{"?s++:o===")"||o==="]"||o==="}"?s=Math.max(0,s-1):o===","&&s===0&&(t.push(e.slice(i,n)),i=n+1)}return t.push(e.slice(i)),t.map(n=>n.trim()).filter(n=>n!=="")}var Hi=/(\\*)\{\{(~?\s*)(?:(#if|#unless|#each|#with|#every|else\s+if|else\s+unless)(?=[\s(!])|(set|inc|dec|append|prepend|remove)(?=\s)|(=)|(#?embed|goto|#animate)(?=\s))/g;function Ao(e,t){let s=null,r=0;for(let i=t;i<e.length;i++){const n=e[i];if(s)n==="\\"?i++:n===s&&(s=null);else if(n==='"'||n==="'")s=n;else if(n==="{")r++;else if(n==="}"&&r>0)r--;else{if(e.startsWith("~}}",i))return i;if(e.startsWith("}}",i))return i}}return-1}var Fu=class extends Error{constructor(e,t,s){super(e),Object.defineProperty(this,"start",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"end",{enumerable:!0,configurable:!0,writable:!0,value:s})}};function Po(e,t){if(!e.includes("{{"))return e;let s="",r=0;Hi.lastIndex=0;let i;for(;(i=Hi.exec(e))!==null;){if(i[1].length%2===1)continue;const n=i.index+i[0].length,o=Ao(e,n);if(o===-1)break;try{const c=e.slice(n,o);if(i[5]){const u=i.index+i[1].length,h="{{"+i[2]+qu(c);s+=e.slice(r,u),t?.push({start:u,end:o,length:h.length}),s+=h,r=o}else{const u=i[3]?Nu(c):i[6]?Du(c,i[6].replace("#","")):$u(c);u!==null&&(s+=e.slice(r,n),t?.push({start:n,end:o,length:u.length+1}),s+=" "+u,r=o)}}catch(c){throw c instanceof Error?new Fu(c.message,i.index+i[1].length,o):c}Hi.lastIndex=o}return s+e.slice(r)}var Ns=e=>e==null||e===!1||e==="",Fi=e=>typeof e=="number"||Ns(e)||typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e));function Ct(e,t){if(!Fi(t))throw new Error(`"${e}" needs numbers, but was given ${JSON.stringify(t)}`);return Ns(t)?0:Number(t)}var Vu=new Set(["__proto__","prototype","constructor"]);function Pr(e){if(Vu.has(e))throw new Error(`"${e}" can't be used as a name inside an object`)}function $s(e){if(!e.includes(".")&&!e.includes("["))return[e];const t=/^[^.[\]]+/.exec(e);if(!t)return[e];const s=[t[0]];let r=t[0].length;for(;r<e.length;)if(e[r]==="."){if(e[r+1]==="["){r++;continue}const i=/^[^.[\]]+/.exec(e.substring(r+1));if(!i)return[e];s.push(i[0]),r+=1+i[0].length}else if(e[r]==="["){const i=e.indexOf("]",r);if(i===-1)return[e];let n=e.substring(r+1,i).trim();const o=/^(["'])(.*)\1$/.exec(n);o&&(n=o[2]),s.push(n),r=i+1}else return[e];return s.forEach(Pr),s}var Vi=e=>typeof e=="object"&&e!==null;function zi(e,t){for(const s of t){if(!Vi(e)||!Object.prototype.hasOwnProperty.call(e,s))return null;e=e[s]}return e??null}function Lo(e,t,s,r){const i=Vi(e)?structuredClone(e):e==null?{}:null;if(i===null)throw new Error(`${s} isn't an object, so it has no ${t[0]}`);let n=i,o=s;return t.forEach((c,u)=>{if(Pr(c),u===t.length-1){n[c]=r;return}o+="."+c;let h=Object.prototype.hasOwnProperty.call(n,c)?n[c]:void 0;if(h==null&&(h={},n[c]=h),!Vi(h))throw new Error(`${o} isn't an object, so it has no ${t[u+1]}`);n=h}),i}function Ro(e){const t=/^\s*(\w+)/.exec(e);if(!t)return null;const s=[];let r=t[0].length;for(;;){const i=/^\.(\w+)/.exec(e.substring(r));if(i){s.push({name:i[1]}),r+=i[0].length;continue}if(e[r]!=="[")break;const n=zu(e,r);if(n===-1)return null;s.push({index:e.substring(r+1,n)}),r=n+1}return{attribute:t[1],segments:s,rest:e.substring(r)}}function zu(e,t){let s=0,r=null;for(let i=t;i<e.length;i++){const n=e[i];if(r)n==="\\"?i++:n===r&&(r=null);else if(n==='"'||n==="'")r=n;else if(n==="["||n==="("||n==="{")s++;else if((n==="]"||n===")"||n==="}")&&(s--,s===0))return n==="]"?i:-1}return-1}async function Oo(e,t,s){const r=Io(e);e.classList.add("fade-out"),await r,e.innerHTML=t,s?.(e);const i=Io(e);e.classList.remove("fade-out"),e.classList.add("fade-in"),await i,e.classList.remove("fade-in")}function Io(e,t=1e3){return new Promise(s=>{const r=()=>{e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",i),clearTimeout(n),s()},i=o=>{o.target===e&&r()};e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",i);const n=setTimeout(r,t)})}function Ui(e){if(typeof e=="number")return Number.isFinite(e)&&e>=0?e:null;if(typeof e!="string")return null;const t=/^\s*(\d+(?:\.\d+)?|\.\d+)\s*(ms|s)?\s*$/i.exec(e);if(!t)return null;const s=Number(t[1]);return t[2]?.toLowerCase()=="s"?s*1e3:s}var Wi=/(\\*)\{\{~?\s*(?:(#every)(?=[\s}~])|(\/every)\s*~?\}\})/g;function Uu(e){if(!e.includes("#every"))return e;const t=[],s=[];Wi.lastIndex=0;let r;for(;(r=Wi.exec(e))!==null;)if(r[1].length%2!==1)if(r[2]){const i=Ao(e,r.index+r[0].length);if(i===-1)break;const n=e.indexOf("}}",i)+2,o=e.slice(r.index+r[0].length,i).trim()!=="";s.push({tagEnd:o?i:-1,bodyStart:n}),Wi.lastIndex=n}else{const i=s.pop();if(!i||i.tagEnd===-1)continue;const n=e.slice(i.bodyStart,r.index+r[1].length);t.push({at:i.tagEnd,text:` __body="${encodeURIComponent(n)}"`})}t.sort((i,n)=>n.at-i.at);for(const{at:i,text:n}of t)e=e.slice(0,i)+n+e.slice(i);return e}var Wu=".squiffy-every:not([data-every-stopped])",ju="squiffyEvery",Gu=class{constructor(e,t){this.getRoot=e,this.tick=t,this.timers=new Map}sync(){const e=this.getRoot(),t=new Set(e?.isConnected?e.querySelectorAll(Wu):[]);for(const[s,r]of this.timers)t.has(s)||(clearTimeout(r),this.timers.delete(s));for(const s of t)this.timers.has(s)||this.schedule(s,Number(s.getAttribute("data-every-delay"))||0)}stopAll(){for(const e of this.timers.values())clearTimeout(e);this.timers.clear()}schedule(e,t){const s=()=>{if(this.timers.delete(e),!this.tick(e)){this.schedule(e,50);return}this.sync()};s[ju]=!0,this.timers.set(e,setTimeout(s,t))}},Xu=new Set(["shake","shudder","rumble","sway","buoy","pulse","fade-in-out","blink","flicker","blur","blurrier","smear","mirror","upside-down","shadow","emboss","outline","condense","expand","tall","flat","double-underline","wavy-underline","double-strike","wavy-strike"]),Yu="squiffy-clear";function Mo(e){if(!e.includes("<!--squiffy-clear-->"))return null;const t=document.createElement("template");t.innerHTML=e;const s=document.createTreeWalker(t.content,128);let r=null;for(;s.nextNode();)s.currentNode.data=="squiffy-clear"&&(r=s.currentNode);if(!r)return null;for(let i=r;i&&i!==t.content;i=i.parentNode)for(;i.previousSibling;)i.previousSibling.remove();return r.remove(),t.innerHTML.trim()}var Zu=class{constructor(e,t,s){this.strings={restart:"Restart",saves:"Saved games",settings:"Settings"},this.goto=null,this.deactivate=new Set,this.stopEvery=!1,this.scopes=[],this.processing=[],this.expressionCache=new Map,this.getStory=e,this.state=t,this.getCurrentSection=s,this.handlebars=He.default.create();const r=this;this.handlebars.registerHelper("embed",function(...b){const x=b.pop(),T=i(b[0]),A=r.embeddedText(T);if(A===void 0)return;const L=Object.create(null);for(const[F,P]of Object.entries(x.hash??{}))L[F]=i(P);const D=r.scopes,B=x.fn?()=>{const F=r.scopes;r.scopes=D;try{return x.fn(this,{data:x.data})}finally{r.scopes=F}}:void 0;r.scopes=[...D,{params:L,content:B}];try{return new He.default.SafeString(r.process(A,!0))}finally{r.scopes=D}}),this.handlebars.registerHelper("content",()=>{const b=this.scopes[this.scopes.length-1];return b?.content?new He.default.SafeString(b.content()):this.hasAttribute("content")?this.getAttribute("content"):""}),this.handlebars.registerHelper("seen",b=>this.state.getSeen(b)),this.handlebars.registerHelper("visits",b=>this.state.getVisits(b)),this.handlebars.registerHelper("lastvisited",b=>this.state.getLastVisited(b)),this.handlebars.registerHelper("get",b=>this.getAttribute(b)),this.handlebars.registerHelper("at",b=>{const x=this.getAttribute("_section");return Array.isArray(b)?b.includes(x):x===b});const i=b=>b&&typeof b=="object"&&typeof b.toHTML=="function"?b.toString():b;this.handlebars.registerHelper("goto",(...b)=>{const x=b.pop(),T=b.length?i(b[0]):void 0;if(typeof T!="string"||!T||!(T in this.getStory().sections))return new He.default.SafeString(Wt("Error in {{goto}}:",T===void 0?'expected a section name, e.g. {{goto "cave"}}':`there is no section called "${T}"`));let A=0;if(x.hash.after!==void 0){const L=Ui(i(x.hash.after));if(L===null)return new He.default.SafeString(Wt("Error in {{goto}}:",`after= should be a number of milliseconds or a time, e.g. after=3000 or after="3s", not "${x.hash.after}"`));A=L}return this.goto??(this.goto={section:T,after:A}),""}),this.handlebars.registerHelper("every",(...b)=>{const x=b.pop(),T=F=>new He.default.SafeString(Wt("Error in {{#every}}:",F)),A=b.length?Ui(i(b[0])):null;if(A===null||A<=0)return T(`expected how often to show the text, as a number of milliseconds or a time, e.g. {{#every 1000}} or {{#every "1s"}}${b.length?`, not "${b[0]}"`:""}`);const L=x.hash.__body;if(typeof x.fn!="function"||typeof L!="string")return T("it needs some text to show, e.g. {{#every 1000}}Tick.{{/every}}");let D=` data-every="${L}" data-every-delay="${A}" data-every-count="0"`;if(x.hash.times!==void 0){const F=Number(i(x.hash.times));if(!Number.isInteger(F)||F<1)return T(`times= should be a whole number of times, e.g. times=10, not "${x.hash.times}"`);D+=` data-every-times="${F}"`}x.hash.append&&(D+=' data-every-append=""');const B=decodeURIComponent(L).includes(`
|
|
1522
|
+
|
|
1523
|
+
`)?"div":"span";return new He.default.SafeString(`<${B} class="squiffy-every"${D}></${B}>`)}),this.handlebars.registerHelper("clear",()=>new He.default.SafeString(`<!--${Yu}-->`)),this.handlebars.registerHelper("stop",()=>(this.stopEvery=!0,"")),this.handlebars.registerHelper("deactivate",(...b)=>{b.pop();const x=b.length?b.map(i):[this.getAttribute("_passage")];for(const T of x){if(typeof T!="string"||!T)return new He.default.SafeString(Wt("Error in {{deactivate}}:",b.length?'expected a passage name, e.g. {{deactivate "door"}}':"{{deactivate}} with no passage name only works in a passage"));const A=this.getCurrentSection()?.passages,L=this.getStory().sections[""]?.passages;if(!(A&&T in A)&&!(L&&T in L))return new He.default.SafeString(Wt("Error in {{deactivate}}:",`there is no passage called "${T}" in this section`));this.deactivate.add(T)}return""}),this.handlebars.registerHelper("set",(b,x)=>(this.setAttribute(b,i(x)),"")),this.handlebars.registerHelper("__value",b=>(this.evaluated=i(b),"")),this.handlebars.registerHelper("unset",b=>(this.setAttribute(b,!1),"")),this.handlebars.registerHelper("forget",(...b)=>{b.pop();const x=b.map(T=>String(i(T)));return this.state.forget(x.length?x:void 0),""});const n=(b,x)=>{this.handlebars.registerHelper(b,(T,...A)=>{const L=A.length>1?Ct(b,i(A[0])):1,D=Ct(b,this.getAttribute(T));return this.setAttribute(T,D+x*L),""})};n("inc",1),n("dec",-1),this.handlebars.registerHelper("and",(...b)=>b.slice(0,-1).every(Boolean)),this.handlebars.registerHelper("or",(...b)=>b.slice(0,-1).some(Boolean)),this.handlebars.registerHelper("not",b=>!b),this.handlebars.registerHelper("eq",(b,x)=>b==x),this.handlebars.registerHelper("ne",(b,x)=>b!=x),this.handlebars.registerHelper("gt",(b,x)=>b>x),this.handlebars.registerHelper("lt",(b,x)=>b<x),this.handlebars.registerHelper("gte",(b,x)=>b>=x),this.handlebars.registerHelper("lte",(b,x)=>b<=x);const o=(b,x)=>{this.handlebars.registerHelper(b,(...T)=>{const A=T.slice(0,-1).map(i);if(A.length!==2)throw new Error(`"${b}" needs two values, but was given ${A.length}`);return x(Ct(b,A[0]),Ct(b,A[1]))})};this.handlebars.registerHelper("add",(...b)=>{const x=b.slice(0,-1).map(i);if(x.length!==2)throw new Error(`"add" needs two values, but was given ${x.length}`);const[T,A]=x;if(Fi(T)&&Fi(A))return Ct("add",T)+Ct("add",A);const L=D=>{if(Ns(D))return"";if(typeof D=="object")throw new Error(`"add" can't add ${Array.isArray(D)?"a list":"an object"}`);return String(D)};return L(T)+L(A)}),o("sub",(b,x)=>b-x),o("mul",(b,x)=>b*x),o("div",(b,x)=>{if(x===0)throw new Error("division by zero");return b/x}),o("mod",(b,x)=>{if(x===0)throw new Error("division by zero");return b%x});const c=(b,x,T)=>{this.handlebars.registerHelper(b,(...A)=>{const L=A.slice(0,-1).map(i);if(L.length===0&&this.hasAttribute(b))return this.getAttribute(b);if(L.length!==1&&!(T&&L.length===2))throw new Error(`"${b}" needs ${T?"one or two values":"one value"}, but was given ${L.length}`);const D=Ct(b,L[0]);if(L.length===1)return x(D);const B=10**Ct(b,L[1]);return x(Number((D*B).toPrecision(15)))/B})};c("round",Math.round,!0),c("floor",Math.floor,!1),c("ceil",Math.ceil,!1),c("abs",Math.abs,!1);const u=(b,x)=>{this.handlebars.registerHelper(b,(...T)=>{let A=T.slice(0,-1).map(i);if(A.length===0&&this.hasAttribute(b))return this.getAttribute(b);if(A.length===1&&Array.isArray(A[0])&&(A=A[0].map(i)),A.length===0)throw new Error(`"${b}" needs at least one value`);return x(...A.map(L=>Ct(b,L)))})};u("min",Math.min),u("max",Math.max);const h=(b,x)=>{if(Ns(x))return"";if(typeof x=="object")throw new Error(`"${b}" needs text, but was given ${Array.isArray(x)?"a list":"an object"}`);return String(x)},d=(b,x)=>{this.handlebars.registerHelper(b,(...T)=>{const A=T.slice(0,-1).map(i);if(A.length===0&&this.hasAttribute(b))return this.getAttribute(b);if(A.length!==1)throw new Error(`"${b}" needs one value, but was given ${A.length}`);return x(h(b,A[0]))})};d("upper",b=>b.toUpperCase()),d("lower",b=>b.toLowerCase());const a=b=>b.charAt(0).toUpperCase()+b.substring(1);d("capitalise",a),d("capitalize",a);const f=function(...b){const x=b.pop();if(typeof x?.fn!="function")throw new Error("once wraps the text to show the first time: {{#once}}...{{/once}}");const T=b.length?i(b[0]):void 0;if(b.length&&(typeof T!="string"||!T))throw new Error('the name of a {{#once}} is text, such as {{#once "warning"}}');const A=T??r.positionKey(x.loc),L=r.state.get("_once")||[];return L.includes(A)?x.inverse(this):(r.state.set("_once",[...L,A]),x.fn(this))};this.handlebars.registerHelper("once",f),this.handlebars.registerHelper("firsttime",f),this.handlebars.registerHelper("cond",(...b)=>{const x=b.slice(0,-1).map(i);if(x.length===0&&this.hasAttribute("cond"))return this.getAttribute("cond");if(x.length!==3)throw new Error(`"cond" needs three values, but was given ${x.length}`);return x[0]?x[1]:x[2]}),this.handlebars.registerHelper("__contains",(b,x)=>(b=i(b),x=i(x),Array.isArray(b)?b.some(T=>i(T)===x):Ns(b)?!1:typeof b=="object"?Object.prototype.hasOwnProperty.call(b,String(x)):String(b).includes(h("contains",x)))),this.handlebars.registerHelper("array",function(...b){return b.pop(),b.map(i)}),this.handlebars.registerHelper("__object",(...b)=>{b.pop();const x={};for(let T=0;T<b.length;T+=2){const A=String(i(b[T]));Pr(A),x[A]=i(b[T+1])}return x}),this.handlebars.registerHelper("append",(b,x)=>{const T=this.getAttribute(b)||[],A=Array.isArray(T)?[...T]:[T],L=i(x);return Array.isArray(L)?A.push(...L.map(i)):A.push(L),this.setAttribute(b,A),""}),this.handlebars.registerHelper("prepend",(b,x)=>{const T=this.getAttribute(b)||[],A=Array.isArray(T)?[...T]:[T],L=i(x);return Array.isArray(L)?A.unshift(...L.map(i)):A.unshift(L),this.setAttribute(b,A),""}),this.handlebars.registerHelper("pop",b=>{const x=this.getAttribute(b)||[];if(!Array.isArray(x)||x.length===0)return"";const T=[...x],A=T.shift();return this.setAttribute(b,T),A}),this.handlebars.registerHelper("remove",(b,x)=>{const T=this.getAttribute(b)||[];if(!Array.isArray(T))return"";const A=i(x),L=T.findIndex(D=>i(D)===A);if(L!==-1){const D=[...T];D.splice(L,1),this.setAttribute(b,D)}return""}),this.handlebars.registerHelper("contains",(b,x)=>{let T;if(typeof b=="string"){const L=this.getAttribute(b);T=Array.isArray(L)?L:[]}else if(Array.isArray(b))T=b;else return!1;const A=i(x);return T.some(L=>i(L)===A)}),this.handlebars.registerHelper("length",(...b)=>{if(b.length<2)return 0;const x=b[0],T=typeof x=="string"?this.getAttribute(x):x;return Array.isArray(T)?T.length:T&&typeof T=="object"&&!(T instanceof this.handlebars.SafeString)?Object.keys(T).length:0});const l=(b,x)=>{if(x=i(x),Array.isArray(x))return x.map(i);if(Ns(x))return[];throw typeof x=="string"?new Error(`"${b}" needs a list, but was given the text "${x}". To use an attribute's list, leave out the quotes: (${b} bag), not (${b} "bag")`):new Error(`"${b}" needs a list, but was given ${typeof x=="object"?"an object":String(x)}`)},p=(b,x,T,A)=>{this.handlebars.registerHelper(b,(...L)=>{const D=L.slice(0,-1).map(i);if(D.length===0&&this.hasAttribute(b))return this.getAttribute(b);if(D.length<x||D.length>T){const B=x===T?`${x} value${x===1?"":"s"}`:`${x} to ${T} values`;throw new Error(`"${b}" needs ${B}, but was given ${D.length}`)}return A(D)})},g=(b,x)=>Math.trunc(Ct(b,x)),v=(b,x,T)=>T===void 0||b.length<2?b.join(x):b.slice(0,-1).join(x)+T+b[b.length-1];this.handlebars.registerHelper("join",function(...b){const x=b.pop(),T=b.map(i),A=typeof x?.fn=="function";if(!A&&T.length===0&&r.hasAttribute("join"))return r.getAttribute("join");if(T.length<1||T.length>3)throw new Error(`"join" needs 1 to 3 values, but was given ${T.length}`);const[L,D,B]=T,F=D===void 0?", ":h("join",D),P=B===void 0?void 0:h("join",B),M=l("join",L);if(!A)return v(M.map($=>h("join",$)),F,P);if(M.length===0)return x.inverse(this);const O=He.default.Utils.escapeExpression,I=M.map(($,H)=>{const V=He.default.createFrame(x.data??{});return V.index=H,V.first=H===0,V.last=H===M.length-1,String(x.fn($,{data:V,blockParams:[$,H]}))});return v(I,O(F),P===void 0?void 0:O(P))});const S=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});p("sort",1,1,([b])=>l("sort",b).sort((x,T)=>{const A=typeof x=="number",L=typeof T=="number";return A&&L?x-T:A!==L?A?-1:1:S.compare(h("sort",x),h("sort",T))})),p("shuffle",1,1,([b])=>{const x=l("shuffle",b);for(let T=x.length-1;T>0;T--){const A=Math.floor(Math.random()*(T+1));[x[T],x[A]]=[x[A],x[T]]}return x}),p("slice",2,3,([b,x,T])=>{const A=g("slice",x),L=T===void 0?void 0:g("slice",T);return typeof b=="string"?b.slice(A,L):l("slice",b).slice(A,L)}),p("first",1,1,([b])=>l("first",b)[0]??""),p("last",1,1,([b])=>l("last",b).slice(-1)[0]??""),p("indexof",2,2,([b,x])=>typeof b=="string"?b.indexOf(h("indexof",x)):l("indexof",b).indexOf(x)),p("count",2,2,([b,x])=>{if(typeof b=="string"){const T=h("count",x);return T===""?0:b.split(T).length-1}return l("count",b).filter(T=>T===x).length}),p("range",2,2,([b,x])=>{const T=g("range",b),A=g("range",x);if(Math.abs(A-T)>=1e4)throw new Error(`"range" can make a list of up to 10,000 numbers, but was asked for ${Math.abs(A-T)+1}`);const L=A>=T?1:-1,D=[];for(let B=T;B!==A+L;B+=L)D.push(B);return D});const w=b=>({tagged:i(b.hash?.tagged),untagged:i(b.hash?.untagged)}),y=(b,x,T)=>{this.handlebars.registerHelper(b,(...A)=>{const L=A.pop(),D=A.map(i);if(!D.length&&!Object.keys(L.hash??{}).length&&this.hasAttribute(b))return this.getAttribute(b);if(D.length>x)throw new Error(`"${b}" needs ${x?`at most ${x} value`:"no values"}, but was given ${D.length}`);return T(D,L)})};y("passages",1,([b],x)=>wi(this.getStory(),b===void 0?void 0:String(b),this.getAttribute("_section"),w(x))),y("sections",0,(b,x)=>ki(this.getStory(),w(x))),y("tags",1,([b])=>{const x=this.getAttribute("_section");return b===void 0?[...this.getStory().sections[x]?.tags??[]]:xi(this.getStory(),String(b),x)});const m=b=>String(b).replace(/&/g,"&").replace(/"/g,"""),_=new Map,C=(b,x,T,A)=>{if(typeof b!="string"||!b.includes("{{"))return b;const L=(A?"h:":"t:")+b;let D=_.get(L);return D||(D=this.handlebars.compile(Po(b),{compat:!0,noEscape:!A}),_.set(L,D)),D(x,{data:T.data})},R=(b,x)=>{let T="";const A=C(x.hash.set||"",b,x,!1);if(A){const L=this.getStory().expressions?Hu(A):A.split(",").map(D=>D.trim());T+=` data-set="${m(JSON.stringify(L))}"`}return T};this.handlebars.registerHelper("section",function(b,x){const T=C(x.hash.text||b,this,x,!0);return new He.default.SafeString(`<a class="squiffy-link link-section" data-section="${m(b)}"${R(this,x)} role="link" tabindex="0">${T}</a>`)}),this.handlebars.registerHelper("passage",function(b,x){const T=C(x.hash.text||b,this,x,!0);return new He.default.SafeString(`<a class="squiffy-link link-passage" data-passage="${m(b)}"${R(this,x)} role="link" tabindex="0">${T}</a>`)}),this.handlebars.registerHelper("restart",function(b){const x=C(b.hash.text||r.strings.restart,this,b,!0),T=b.hash.confirm===!1||b.hash.confirm==="false"?' data-confirm="false"':"";return new He.default.SafeString(`<a class="squiffy-link link-restart" data-handler="restart"${T} role="link" tabindex="0">${x}</a>`)}),this.handlebars.registerHelper("saves",function(b){const x=C(b.hash.text||r.strings.saves,this,b,!0);return new He.default.SafeString(`<a class="squiffy-link link-saves" data-handler="saves" role="link" tabindex="0">${x}</a>`)}),this.handlebars.registerHelper("settings",function(b){const x=C(b.hash.text||r.strings.settings,this,b,!0);return new He.default.SafeString(`<a class="squiffy-link link-settings" data-handler="settings" role="link" tabindex="0">${x}</a>`)}),this.handlebars.registerHelper("style",function(...b){const x=b.pop(),T=typeof x?.fn=="function"?String(x.fn(this)):"",A=b.flatMap(M=>String(i(M)??"").split(/\s+/)).filter(M=>M.length>0),L=A.filter(M=>Xu.has(M)).slice(1),D=A.filter(M=>!L.includes(M)),B=T.includes(`
|
|
1524
|
+
|
|
1525
|
+
`),F=B?"div":"span";let P=B?`
|
|
1526
|
+
|
|
1527
|
+
${T.trim()}
|
|
1528
|
+
|
|
1529
|
+
`:T;for(const M of[...L].reverse())P=`<${F} class="squiffy-style ${m(M)}">${P}</${F}>`;return new He.default.SafeString(`<${F} class="${m(["squiffy-style",...D].join(" "))}">${P}</${F}>`)})}evaluate(e){let t=this.expressionCache.get(e);return t||(t=this.handlebars.compile(`{{__value ${Bu(e)}}}`),this.expressionCache.set(e,t)),this.evaluated=void 0,t(this.context()),this.evaluated}embeddedText(e){if(typeof e!="string")return;const t=this.getCurrentSection();if(t.passages&&Object.prototype.hasOwnProperty.call(t.passages,e))return t.passages[e].text||"";const s=this.getStory();if(Object.prototype.hasOwnProperty.call(s.sections,e))return s.sections[e].text||""}get params(){return this.scopes[this.scopes.length-1]?.params}isParam(e){const t=this.params;return!!t&&Object.prototype.hasOwnProperty.call(t,$s(e)[0])}hasAttribute(e){return this.isParam(e)||this.state.has(e)}getAttribute(e){if(this.isParam(e)){const[t,...s]=$s(e);return structuredClone(zi(this.params[t],s))}return this.state.get(e)}setAttribute(e,t){if(this.isParam(e)){const[s,...r]=$s(e);typeof t>"u"&&(t=!0),this.params[s]=r.length?Lo(this.params[s],r,s,t):structuredClone(t);return}this.state.set(e,t)}context(){const e=this.state.getStore(),t=this.params;if(!t||!Object.keys(t).length)return e;const s=r=>typeof r=="string"&&Object.prototype.hasOwnProperty.call(t,r);return new Proxy({},{get:(r,i)=>s(i)?structuredClone(t[i]):Reflect.get(e,i),has:(r,i)=>s(i)||Reflect.has(e,i),ownKeys:()=>[...new Set([...Object.keys(t),...Reflect.ownKeys(e)])],getOwnPropertyDescriptor:(r,i)=>s(i)?{enumerable:!0,configurable:!0,value:structuredClone(t[i])}:Reflect.getOwnPropertyDescriptor(e,i)})}positionKey(e){const t=this.processing[this.processing.length-1]??"";let s=5381;for(let r=0;r<t.length;r++)s=(s*33^t.charCodeAt(r))>>>0;return` ${s.toString(36)}:${e?.start.line??0}:${e?.start.column??0}`}process(e,t){this.processing.push(e);try{return e=this.handlebars.compile(Po(Uu(e)),{compat:!0})(this.context()),t?Ni(e,{async:!1}).trim():$i(e,{async:!1}).trim()}catch(s){const r=s instanceof Error?s.message:String(s);return console.error("Squiffy template error:",r),Wt("Template error:",r)}finally{this.processing.pop()}}};function Wt(e,t){const s=r=>r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return`<div class="squiffy-error" style="color: red; background: #ffe0e0; padding: 8px; border: 1px solid red; margin: 4px 0; font-family: monospace; white-space: pre-wrap;"><strong>${s(e)}</strong> ${s(t)}</div>`}var Ju=class{constructor(){this.listeners=new Map}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}off(e,t){this.listeners.get(e)?.delete(t)}once(e,t){const s=this.on(e,r=>{s(),t(r)});return s}has(e){return(this.listeners.get(e)?.size??0)>0}emit(e,t){this.listeners.get(e)?.forEach(s=>{try{s(t)}catch(r){console.error(`[Squiffy] handler for "${String(e)}" failed`,r)}})}},Lr="settings",Ku=class{constructor(e,t,s,r,i){this.store={},this.playerSettings=()=>null,this.persistentNames=()=>[],this.persistentValues={},this.readOnly=!1,this.persist=e,this.storyId=t,this.onSet=s,this.emitter=r,this.onSetInternal=i}usePersistentStorage(){return this.persist&&window.localStorage&&this.storyId}initPersistent(e,t){if(this.persistentKey=e,t){this.persistentValues=structuredClone(t);return}if(e)try{const s=JSON.parse(localStorage.getItem(e)??"{}");s&&typeof s=="object"&&!Array.isArray(s)&&(this.persistentValues=s)}catch{}}isPersistent(e){return this.persistentNames().includes(e)}getPersistent(){const e=this.persistentNames();return structuredClone(Object.fromEntries(Object.entries(this.persistentValues).filter(([t])=>e.includes(t))))}forget(e){if(this.readOnly)return;const t=(e??Object.keys(this.persistentValues)).filter(s=>this.isPersistent(s)&&Object.prototype.hasOwnProperty.call(this.persistentValues,s));if(t.length){for(const s of t)delete this.persistentValues[s];this.storePersistent();for(const s of t)this.emitter.emit("set",{attribute:s,value:null}),this.onSet(s,null)}}storePersistent(){if(this.persistentKey)try{localStorage.setItem(this.persistentKey,JSON.stringify(this.persistentValues))}catch{}}valuesFor(e){return this.isPersistent(e)?this.persistentValues:this.store}set(e,t){this.setAt($s(e),t)}setAt(e,t){if(this.readOnly)return;const[s,...r]=e;if(s==Lr&&this.playerSettings()){console.warn("Squiffy: the story can't change the player's settings.");return}if(!r.length){this.setInternal(s,t,!0);return}typeof t>"u"&&(t=!0);const i=this.has(s)?this.valuesFor(s)[s]:null;this.setInternal(s,Lo(i,r,s,t),!0)}setInternal(e,t,s){if(typeof t>"u"&&(t=!0),this.isPersistent(e)){if(!s)return;this.persistentValues[e]=structuredClone(t),this.storePersistent(),this.emitter.emit("set",{attribute:e,value:t}),this.onSet(e,t);return}s&&this.onSetInternal&&this.onSetInternal(e,this.getAt([e]),structuredClone(t)),this.store[e]=structuredClone(t),this.usePersistentStorage()&&(localStorage[this.storyId+"-"+e]=JSON.stringify(t)),s&&this.emitter.emit("set",{attribute:e,value:t}),this.onSet(e,t)}has(e){return e==Lr&&this.playerSettings()?!0:Object.prototype.hasOwnProperty.call(this.valuesFor(e),e)}get(e){return this.getAt($s(e))}getAt(e){const[t,...s]=e;if(!this.has(t))return null;const r=t==Lr?this.playerSettings():null;if(r)return s.length?structuredClone(zi(r,s)):{...r};const i=this.valuesFor(t),n=s.length?zi(i[t],s):i[t];return structuredClone(n)}getStore(){return new Proxy({},{get:(e,t)=>typeof t=="string"&&(this.has(t)||!(t in e))?this.getAt([t]):Reflect.get(e,t),has:(e,t)=>this.has(String(t)),ownKeys:()=>[...new Set([...Object.keys(this.store).filter(e=>!this.isPersistent(e)),...Object.keys(this.getPersistent()),...this.playerSettings()?[Lr]:[]])],getOwnPropertyDescriptor:(e,t)=>{const s=String(t);if(this.has(s))return{enumerable:!0,configurable:!0,value:this.getAt([s])}}})}load(){if(!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)if(t.startsWith(this.storyId+"-")){const s=t.substring(this.storyId.length+1);if(this.isPersistent(s))continue;this.store[s]=JSON.parse(localStorage[t])}}reset(){if(this.store={},!this.usePersistentStorage())return;const e=Object.keys(localStorage);for(const t of e)t.startsWith(this.storyId)&&localStorage.removeItem(t)}setSeen(e){let t=this.get("_seen_sections");t||(t=[]);const s=this.get("_visits")||{};s[e]=this.getVisitsFrom(s,t,e)+1,this.set("_visits",s);const r=this.get("_lastvisit")||{};r[e]=this.get("turns")||0,this.set("_lastvisit",r),t.indexOf(e)==-1&&(t.push(e),this.set("_seen_sections",t))}getSeen(e){const t=this.get("_seen_sections");return t?t.indexOf(e)>-1:!1}getVisits(e){return this.getVisitsFrom(this.get("_visits")||{},this.get("_seen_sections")||[],e)}getLastVisited(e){const t=this.get("_lastvisit")||{},s=this.get("turns")||0;return Object.prototype.hasOwnProperty.call(t,e)?s-t[e]:this.getSeen(e)?s:-1}getVisitsFrom(e,t,s){return Object.prototype.hasOwnProperty.call(e,s)?e[s]:t.indexOf(s)>-1?1:0}};function No(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every((s,r)=>s===t[r])}function Qu(e,t,s,r,i,n){function o(a){return a.replace(/'/g,"\\'")}function c(a){return s.querySelectorAll(`[data-source='[[${o(a)}]]']`)}function u(a,f){return s.querySelectorAll(`[data-source='[[${o(a)}]][${o(f)}]']`)}function h(a){const f=new Map;for(const l of a.querySelectorAll("a.link-passage[data-passage]")){const p=l.getAttribute("data-passage");f.has(p)||f.set(p,[]),f.get(p).push(l)}return f}function d(a,f){const l=h(a);a.innerHTML=f;const p=h(a);for(const[g,v]of l)v.forEach((S,w)=>{const y=p.get(g)?.[w];if(!(!y||!S.classList.contains("disabled"))){i(y);for(const m of["data-clicked","data-deactivated-by"]){const _=S.getAttribute(m);_!==null&&y.setAttribute(m,_)}}})}for(const a of Object.keys(e.sections)){const f=c(a);if(f.length){const l=t.sections[a];if(l){const p=e.sections[a],g=!No(p.attributes,l.attributes),v=l.text!=p.text;if(g&&n(l.attributes||[]),v||g)for(const S of f)d(S,r(l.text||"",l))}else for(const p of f)p.closest(".squiffy-output-section")?.remove()}if(e.sections[a].passages)for(const l of Object.keys(e.sections[a].passages)){const p=u(a,l);if(!p.length)continue;const g=t.sections[a]?.passages&&t.sections[a]?.passages[l];if(g){const v=e.sections[a].passages[l],S=!No(v.attributes,g.attributes),w=g.text!=v.text;if(S&&n(g.attributes||[]),w||S)for(const y of p)d(y,r(g.text||"",t.sections[a]))}else for(const v of p)v.closest(".squiffy-output-passage")?.remove()}}}var eh=class{constructor(e,t,s,r,i,n,o,c,u,h,d){this.plugins=[],this.outputElement=e,this.textProcessor=t,this.state=s,this.linkHandler=r,this.getSectionText=i,this.getPassageText=n,this.processText=o,this.addTransition=c,this.animation=u,this.emitter=h,this.resolveAssetsInHtml=d}add(e){const t=e.init({outputElement:this.outputElement,registerHelper:(s,r)=>{this.textProcessor.handlebars.registerHelper(s,r)},registerLinkHandler:(s,r)=>{this.linkHandler.registerLinkHandler(s,r)},get:s=>this.state.get(s),set:(s,r)=>this.state.set(s,r),getSectionText:this.getSectionText,getPassageText:this.getPassageText,processText:this.processText,resolveAssetsInHtml:this.resolveAssetsInHtml,addTransition:this.addTransition,written:s=>this.onWrite(s),animation:this.animation,on:(s,r)=>this.emitter.on(s,r),off:(s,r)=>this.emitter.off(s,r),once:(s,r)=>this.emitter.once(s,r)});return this.plugins.push(e),t}onWrite(e){this.plugins.forEach(t=>t.onWrite?.(e))}onLoad(){this.plugins.forEach(e=>e.onLoad?.())}};function th(){return{name:"replaceLabel",init(e){e.registerHelper("label",function(t,s){return new He.default.SafeString(`<span class="squiffy-label-${t}">${s.fn(this)}</span>`)}),e.registerHelper("replace",function(t,s){const r=String(s.fn(this)),i=e.outputElement.querySelectorAll(`.squiffy-label-${t}`),n=i[i.length-1];if(n){const o=r.includes(`
|
|
251
1530
|
|
|
252
|
-
`)
|
|
1531
|
+
`)?$i(r,{async:!1}).trim():Ni(r,{async:!1}).trim();e.addTransition(()=>Oo(n,o,e.written))}return""})}}}function sh(){const e=i=>i.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"),t=(i,n,o,c)=>{const u=o.map(l=>l.toString()),h=r(u,null),d=c.hash.set||"";d&&i.set(d,h[0]);const a=e(JSON.stringify(h.slice(1))||""),f=c.hash.show=="next"?h[1]:h[0];return new He.default.SafeString(`<a class="squiffy-link" data-handler="${n}" data-value="${e(h[0])}" data-show="${c.hash.show||""}" data-options='${a}' data-attribute="${d}" role="link">${f}</a>`)},s=(i,n,o)=>{const c={},u=JSON.parse(n.getAttribute("data-options")??"[]")||[],h=r(u,o?n.getAttribute("data-value"):"");n.innerHTML=n.getAttribute("data-show")=="next"?h[1]:h[0],n.setAttribute("data-value",h[0]),n.setAttribute("data-options",JSON.stringify(h.slice(1))||""),h[1]||(c.disableLink=!0);const d=n.getAttribute("data-attribute");return d&&i.set(d,n.getAttribute("data-value")),window.getSelection()?.removeAllRanges(),c},r=(i,n)=>{const o=i[0],c=i.slice(1);return n&&c.push(n),[o,...c]};return{name:"rotateSequence",init(i){i.registerHelper("rotate",(n,o)=>t(i,"rotate",n,o)),i.registerHelper("sequence",(n,o)=>t(i,"sequence",n,o)),i.registerLinkHandler("rotate",n=>s(i,n,!0)),i.registerLinkHandler("sequence",n=>s(i,n,!1))}}}function rh(){return{name:"random",init(e){e.registerHelper("random",(t,s)=>{const r=t.map(o=>o.toString()),i=r[Math.floor(Math.random()*r.length)],n=s.hash.set||"";return n&&e.set(n,i),new He.default.SafeString(i)})}}}function ih(){let e;return{name:"live",init(t){e=t,e.registerHelper("live",(r,i)=>{const n=i.hash.section||"";if(n)return new He.default.SafeString(`<span class="squiffy-live" data-attribute="${r}" data-section="${n}"></span>`);const o=i.hash.passage||"";return o?new He.default.SafeString(`<span class="squiffy-live" data-attribute="${r}" data-passage="${o}"></span>`):new He.default.SafeString(`<span class="squiffy-live" data-attribute="${r}"></span>`)});const s=async r=>{const i=[],n=[...e.outputElement.querySelectorAll(".squiffy-output-section")].filter(u=>!u.closest(".squiffy-clear-stack")),o=n[n.length-1],c=[...e.outputElement.querySelectorAll(".squiffy-live[data-attribute]")].filter(u=>$s(u.dataset.attribute)[0]===r.attribute).filter(u=>!(u.dataset.section||u.dataset.passage)||u.closest(".squiffy-output-section")===o);for(const u of c){const h=u.innerHTML;let d="";if(u.dataset.section){const a=e.getSectionText(u.dataset.section);a&&(d=e.processText(a,!0))}else if(u.dataset.passage){const a=e.getPassageText(u.dataset.passage);a&&(d=e.processText(a,!0))}else d=u.dataset.attribute==r.attribute?r.value:e.get(u.dataset.attribute);h!==String(d)&&i.push(Oo(u,d,e.written))}await Promise.all(i)};e.on("set",async r=>{await s(r)})},onWrite(t){e&&t.querySelectorAll(".squiffy-live").forEach(s=>{if(s.dataset.section){const r=e.getSectionText(s.dataset.section);r&&(s.innerHTML=e.processText(r,!0))}else if(s.dataset.passage){const r=e.getPassageText(s.dataset.passage);r&&(s.innerHTML=e.processText(r,!0))}else{const r=s.dataset.attribute;s.textContent=r?e.get(r):""}})}}}var nh=["start","interval","duration","fadeDuration"];function oh(){let e;const t=r=>{const i={};for(const[n,o]of Object.entries(r)){if(o==null){i[n]=o;continue}try{i[n]=JSON.parse(o)}catch{i[n]=o}}return i},s=r=>{for(const i of r.querySelectorAll(".squiffy-animate")){const n=t(i.dataset);if(!n.content)continue;const o=n.content.includes(`
|
|
253
1532
|
|
|
254
|
-
`)
|
|
1533
|
+
`)?$i(n.content,{async:!1}):Ni(n.content,{async:!1});if(i.innerHTML=e.resolveAssetsInHtml(o.trim()),!n.name)continue;const c=i.innerHTML;let u=[];const h=()=>{for(const f of u)e.animation.removeLinkAnimation(f);u=[...i.querySelectorAll("a")];for(const f of u)e.animation.addLinkAnimation(f,a)},d=()=>{if(n.trigger!=="link"){i.innerHTML=c;return}const f=u;i.innerHTML=c,h(),u.forEach((l,p)=>{const g=f[p];if(g){g.classList.contains("disabled")&&l.classList.add("disabled");for(const v of["tabindex","data-clicked","data-deactivated-by"]){const S=g.getAttribute(v);S!==null&&l.setAttribute(v,S)}}})},a=()=>{n.loop?e.animation.runAnimation(n.name,i,n,()=>{},!0):(e.animation.isInitiallyHidden(n.name)&&(i.style.opacity="0"),e.addTransition(()=>new Promise(f=>{i.style.opacity="",e.animation.runAnimation(n.name,i,n,()=>{i.classList.remove("squiffy-animate"),d(),f()},!1)})))};n.trigger==="link"?h():a()}};return{name:"animate",init(r){e=r,e.registerHelper("animate",function(i,n){const o=String(n.fn(this)),c={name:i,content:o,...n.hash};for(const d of nh){if(c[d]===void 0)continue;const a=Ui(c[d]);a!==null?c[d]=a:(console.warn(`Squiffy: {{#animate}}'s ${d} isn't a time: ${JSON.stringify(c[d])}`),delete c[d])}const u=Object.entries(c).map(([d,a])=>` data-${He.default.escapeExpression(d)}="${He.default.escapeExpression(JSON.stringify(a))}"`).join(""),h=o.includes(`
|
|
255
1534
|
|
|
256
|
-
`)?"div":"span";return new je.default.SafeString(`<${u} class="squiffy-animate"${h}></${u}>`)})},onWrite(r){s(r)},onLoad(){s(e.outputElement)}}}var ds={ReplaceLabel:Ul,RotateSequencePlugin:Wl,RandomPlugin:Xl,LivePlugin:Yl,AnimatePlugin:Gl},Zl=class{constructor(){this.linkHandlers={}}registerLinkHandler(e,t){this.linkHandlers[e]=t}handleLink(e){const t=e.getAttribute("data-handler")||"",s=this.linkHandlers[t];return s?[!0,t,s(e)]:[!1,t,{}]}},_t=typeof window<"u",Xe=_t?window:null,Q=_t?document:null,Le={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},ve={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},tt={NONE:0,AUTO:1,FORCE:2},$e={replace:0,none:1,blend:2},ln=Symbol(),Ft=Symbol(),Dr=Symbol(),gs=Symbol(),cn=Symbol(),Re=1e-11,mt=1e12,Ye=1e3,Fu="var(",qs=[],Br=(()=>{const e=new Map;return e.set("x","translateX"),e.set("y","translateY"),e.set("z","translateZ"),e})(),Vt=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],un=Vt.reduce((e,t)=>({...e,[t]:t+"("}),{}),ne=()=>{},jl=e=>e,Ql=/\)\s*[-.\d]/,Jl=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Kl=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,ec=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,tc=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,sc=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,hn=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,pn=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,rc=/([a-z])([A-Z])/g,fn=/(\*=|\+=|-=)/,ic=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,ms={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:Ye,delay:0,loopDelay:0,ease:"out(2)",composition:$e.replace,modifier:jl,onBegin:ne,onBeforeUpdate:ne,onUpdate:ne,onLoop:ne,onPause:ne,onComplete:ne,onRender:ne},Ie={current:null,root:Q},z={defaults:ms,precision:4,timeScale:1,tickThreshold:200,editor:null},dn={version:"4.5.0",engine:null};_t&&(Xe.AnimeJS||(Xe.AnimeJS=[]),Xe.AnimeJS.push(dn));var Fs=e=>e.replace(rc,"$1-$2").toLowerCase(),Ne=(e,t)=>e.indexOf(t)===0,At=Date.now,He=Array.isArray,De=e=>e&&e.constructor===Object,Fe=e=>typeof e=="number"&&!isNaN(e),Be=e=>typeof e=="string",Ae=e=>typeof e=="function",B=e=>typeof e>"u",zt=e=>B(e)||e===null,Vs=e=>_t&&e instanceof SVGElement,gn=e=>Jl.test(e),mn=e=>Ne(e,"rgb"),vn=e=>Ne(e,"hsl"),nc=e=>gn(e)||(mn(e)||vn(e))&&(e[e.length-1]===")"||!Ql.test(e)),Kt=e=>!z.defaults.hasOwnProperty(e),oc=["opacity","rotate","overflow","color"],ac=(e,t)=>{if(oc.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t==="scale"){const s=e.parentNode;return s&&s.tagName==="filter"}return!0}},Ut=e=>Be(e)?parseFloat(e):e,Wt=Math.pow,at=Math.sqrt,$r=Math.sin,Hr=Math.cos,lt=Math.abs,zs=Math.exp,lc=Math.ceil,es=Math.floor,cc=Math.asin,yn=Math.max,Us=Math.atan2,St=Math.PI,qr=Math.round,j=(e,t,s)=>e<t?t:e>s?s:e,F=(e,t)=>{if(t<0)return e;if(!t)return qr(e);const s=10**t;return qr(e*s)/s},Xt=(e,t)=>He(t)?t.reduce((s,r)=>lt(r-e)<lt(s-e)?r:s):t?qr(e/t)*t:e,Lt=(e,t,s)=>s===1?t:s===0?e:e+(t-e)*s,Ws=e=>e===1/0?mt:e===-1/0?-mt:e,ts=e=>e<=1e-11?Re:Ws(F(e,11)),Ue=e=>He(e)?[...e]:e,ct=(e,t)=>{const s={...e};for(let r in t){const i=e[r];s[r]=B(i)?t[r]:i}return s},ke=(e,t,s,r="_prev",i="_next")=>{let n=e._head,o=i;for(s&&(n=e._tail,o=r);n;){const a=n[o];t(n),n=a}},vt=(e,t,s="_prev",r="_next")=>{const i=t[s],n=t[r];i?i[r]=n:e._head=n,n?n[s]=i:e._tail=i,t[s]=null,t[r]=null},yt=(e,t,s,r="_prev",i="_next")=>{let n=e._tail;for(;n&&s&&s(n,t);)n=n[r];const o=n?n[i]:e._head;n?n[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=n,t[i]=o},uc=(e,t,s)=>{const r=e.style.transform;if(r){const i=e[gs];let n=0;const o=r.length;let a;for(;n<o;){for(;n<o&&r.charCodeAt(n)===32;)n++;if(n>=o)break;const u=n;for(;n<o&&r.charCodeAt(n)!==40;)n++;if(n>=o)break;const p=r.substring(u,n);let c=1;const f=n+1;let l=-1,d=-1;for(n++;n<o&&c>0;){const v=r.charCodeAt(n);v===40?c++:v===41?c--:v===44&&c===1&&(l===-1?l=n:d===-1&&(d=n)),n++}const g=n-1;p==="translate"||p==="translate3d"?(l===-1?i.translateX=r.substring(f,g).trim():(i.translateX=r.substring(f,l).trim(),d===-1?i.translateY=r.substring(l+1,g).trim():(i.translateY=r.substring(l+1,d).trim(),i.translateZ=r.substring(d+1,g).trim())),a=r.substring(f,g)):p==="scale"||p==="scale3d"?l===-1?i.scale=r.substring(f,g).trim():(i.scaleX=r.substring(f,l).trim(),d===-1?i.scaleY=r.substring(l+1,g).trim():(i.scaleY=r.substring(l+1,d).trim(),i.scaleZ=r.substring(d+1,g).trim())):i[p]=r.substring(f,g)}if(t==="translate3d"&&a)return s&&(s[t]=a),a;const h=i[t];if(!B(h))return s&&(s[t]=h),h}return t==="translate3d"?"0px, 0px, 0px":t==="rotate3d"?"0, 0, 0, 0deg":Ne(t,"scale")?"1":Ne(t,"rotate")||Ne(t,"skew")?"0deg":"0px"},bn=e=>{let t="";for(let s=0,r=Vt.length;s<r;s++){const i=Vt[s],n=e[i];if(n!==void 0){if(i==="translateX"){const o=e.translateY;if(o!==void 0){const a=e.translateZ;a!==void 0?(t+=`translate3d(${n},${o},${a}) `,s+=2):(t+=`translate(${n},${o}) `,s+=1);continue}}if(i==="scaleX"&&e.scale===void 0){const o=e.scaleY;if(o!==void 0){const a=e.scaleZ;a!==void 0?(t+=`scale3d(${n},${o},${a}) `,s+=2):(t+=`scale(${n},${o}) `,s+=1);continue}}t+=`${un[i]}${n}) `}i==="rotateZ"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Fr=[];function _n(e,t){if(!e)return null;const s=Fr.length;e:for(let r=0;r<s;r++){const i=Fr[r];if(i.detect&&!i.detect(e))continue;const n=i.targetAdapters;for(let o=0,a=n.length;o<a;o++){const h=n[o];if(h.detect(e)){const u=h.props[t];if(u&&(!u.gate||u.gate(e)))return u;break e}}}for(let r=0;r<s;r++){const i=Fr[r];if(i.detect&&!i.detect(e))continue;const n=i.propertyResolvers;for(let o=0,a=n.length;o<a;o++){const h=n[o](e,t);if(h)return h}}return null}var hc=e=>{const t=Kl.exec(e)||ec.exec(e),s=B(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],s]},pc=e=>{const t=e.length,s=t===4||t===5;return[+("0x"+e[1]+e[s?1:2]),+("0x"+e[s?2:3]+e[s?2:4]),+("0x"+e[s?3:5]+e[s?3:6]),t===5||t===9?+(+("0x"+e[s?4:7]+e[s?4:8])/255).toFixed(3):1]},Vr=(e,t,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e),fc=e=>{const t=tc.exec(e)||sc.exec(e),s=+t[1]/360,r=+t[2]/100,i=+t[3]/100,n=B(t[4])?1:+t[4];let o,a,h;if(r===0)o=a=h=i;else{const u=i<.5?i*(1+r):i+r-i*r,p=2*i-u;o=F(Vr(p,u,s+1/3)*255,0),a=F(Vr(p,u,s)*255,0),h=F(Vr(p,u,s-1/3)*255,0)}return[o,a,h,n]},dc=e=>mn(e)?hc(e):gn(e)?pc(e):vn(e)?fc(e):[0,0,0,1],U=(e,t)=>B(e)?t:e,Sn=(e,t)=>{const s=e.match(ic),r=t[Ft]?t:document.documentElement;let i=getComputedStyle(r)?.getPropertyValue(s[1]);return(!i||i.trim()==="")&&s[2]&&(i=s[2].trim()),i||0},Oe=(e,t,s,r,i,n)=>{if(Ae(e)){if(!i){const a=e(t,s,r,n);return isNaN(+a)?a||0:+a}const o=()=>{const a=e(t,s,r,n);return isNaN(+a)?a||0:+a};return i.func=o,o()}if(Be(e)&&Ne(e,"var(")){if(!i)return Sn(e,t);const o=()=>Sn(e,t);return i.func=o,o()}return e},zr=(e,t)=>e[Ft]?e[Dr]&&ac(e,t)?Le.ATTRIBUTE:Vt.includes(t)||Br.get(t)?Le.TRANSFORM:Ne(t,"--")?Le.CSS_VAR:t in e.style?Le.CSS:t in e?Le.OBJECT:Le.ATTRIBUTE:Le.OBJECT,kn=(e,t,s)=>{const r=e.style[t];r&&s&&(s[t]=r);const i=r||getComputedStyle(e[cn]||e).getPropertyValue(t);return i==="auto"?"0":i},Yt=(e,t,s,r)=>{const i=B(s)?zr(e,t):s,n=_n(e,t);if(n){const o=n.get(e);return o&&r&&(r[t]=o),o??0}if(i===Le.OBJECT){const o=e[t];return o&&r&&(r[t]=o),o||0}if(i===Le.ATTRIBUTE){const o=e.getAttribute(t);return o&&r&&(r[t]=o),o}return i===Le.TRANSFORM?uc(e,t,r):i===Le.CSS_VAR?kn(e,t,r).trimStart():kn(e,t,r)},Gt=(e,t,s)=>s==="-"?e-t:s==="+"?e+t:e*t,Ur=()=>({t:ve.NUMBER,n:0,u:null,o:null,d:null,s:null}),Qe=(e,t)=>{if(t.t=ve.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const s=+e;if(!isNaN(s))return t.n=s,t;let r=e;r[1]==="="&&(t.o=r[0],r=r.slice(2));const i=r.includes(" ")?!1:pn.exec(r);if(i)return t.t=ve.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(nc(r))return t.t=ve.COLOR,t.d=dc(r),t;{const n=r.match(hn);return t.t=ve.COMPLEX,t.d=n?n.map(Number):[],t.s=r.split(hn)||[],t}},wn=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=Ue(e._toNumbers),t.s=Ue(e._strings),t),Ve=Ur(),xn=(e,t,s)=>{const r=e._modifier,i=e._fromNumbers,n=e._toNumbers,o=e._strings;let a=o[0];for(let h=0,u=n.length;h<u;h++){const p=r(F(Lt(i[h],n[h],t),s)),c=o[h+1];a+=`${c?p+c:p}`,e._numbers[h]=p}return a},Xs=(e,t,s,r,i)=>{const n=e.parent,o=e.duration,a=e.completed,h=e.iterationDuration,u=e.iterationCount,p=e._currentIteration,c=e._loopDelay,f=e._reversed,l=e._alternate,d=e._hasChildren,g=e._delay,v=e._currentTime,b=g+h,S=t-g,y=j(v,-g,o),m=j(S,-g,o),_=S-v,k=m>0,w=m>=o,A=o<=Re,O=i===tt.FORCE;let E=0,P=S,C=0;if(u>1){const M=h+(w?0:c),I=~~(m/M);e._currentIteration=j(I,0,u),w&&e._currentIteration--,E=e._currentIteration%2,P=m-I*M||0}const $=f^(l&&E),H=e._ease;let V=w?$?0:o:$?h-P:P;H&&(V=h*H(V/h)||0);const x=(n?n.backwards:S<v)?!$:!!$;if(e._currentTime=S,e._iterationTime=V,e.backwards=x,k&&!e.began?(e.began=!0,!s&&!(n&&(x||!n.began))&&e.onBegin(e)):S<=0&&(e.began=!1),!s&&!d&&k&&e._currentIteration!==p&&e.onLoop(e),O||i===tt.AUTO&&(t>=(n&&g>0?0:g)&&t<=b||t<=g&&y>g||t>=b&&y!==o)||V>=b&&y!==o||V<=g&&y>0&&!w||t<=y&&y===o&&a||w&&!a&&A){if(k&&(e.computeDeltaTime(y),s||e.onBeforeUpdate(e)),!d){const M=O||(x?_*-1:_)>=z.tickThreshold,I=F(e._offset+(n?n._offset:0)+g+V,12);let R=e._head,q,J,G,W,ee=0;for(;R;){const X=R._composition,oe=R._currentTime,pe=R._changeDuration,ce=R._absoluteStartTime+R._changeDuration,ie=R._nextRep,K=R._prevRep,ae=X!==$e.none,xe=K?K._absoluteStartTime+K._changeDuration:0,ue=K&&K.parent!==R.parent,te=!ie||ie._isOverridden?ce:ie.parent===R.parent?ce+ie._delay:ie._absoluteStartTime<ie._absoluteUpdateStartTime?ie._absoluteStartTime:ie._absoluteUpdateStartTime;if((M||(oe!==pe||I<=te||K&&!ue&&(!ie||ie.parent!==R.parent))&&(oe!==0||I>=R._absoluteStartTime||ue&&!R._hasFromValue&&!K._isOverridden&&I>=xe||ie&&!ie._isOverridden&&ie.parent===R.parent&&ie._currentTime!==0&&V<ie._startTime))&&(!K||ue||V>=R._startTime)&&(!ae||!R._isOverridden&&(!R._isOverlapped||I<=ce)&&(!ie||ie._isOverridden||I<=te)&&(!K||K._isOverridden||(ue?I>=R._absoluteStartTime||!R._hasFromValue&&I>=xe:I>=xe+R._delay)))){const fe=R._currentTime=j(V-R._startTime,0,pe),me=R._ease(fe/R._updateDuration),_e=R._modifier,Ce=R._valueType,Te=R._tweenType,be=Te===Le.OBJECT,se=Ce===ve.NUMBER,ge=se&&be||me===0||me===1?-1:z.precision;let T,N;if(se)T=N=_e(F(Lt(R._fromNumber,R._toNumber,me),ge));else if(Ce===ve.UNIT)N=_e(F(Lt(R._fromNumber,R._toNumber,me),ge)),T=`${N}${R._unit}`;else if(Ce===ve.COLOR){const L=R._numbers,D=R._fromNumbers,Z=R._toNumbers,Y=1-me,we=D[0],ye=D[1],nt=D[2],Me=Z[0],Rs=Z[1],Mt=Z[2];L[0]=_e(Math.sqrt(we*we*Y+Me*Me*me)),L[1]=_e(Math.sqrt(ye*ye*Y+Rs*Rs*me)),L[2]=_e(Math.sqrt(nt*nt*Y+Mt*Mt*me)),L[3]=_e(Lt(D[3],Z[3],me)),(!R._setter||r)&&(T=`rgba(${F(L[0],0)},${F(L[1],0)},${F(L[2],0)},${L[3]})`)}else Ce===ve.COMPLEX&&(T=xn(R,me,ge));if(ae&&(R._number=N),!r&&X!==$e.blend){const L=R.property;q=R.target,R._setter?R._setter(q,N,R):be?q[L]=T:Te===Le.ATTRIBUTE?q.setAttribute(L,T):(J=q.style,Te===Le.TRANSFORM?(q!==G&&(G=q,W=q[gs]),W[L]=T,ee=1):Te===Le.CSS?J[L]=T:Te===Le.CSS_VAR&&J.setProperty(L,T)),k&&(C=1)}else R._value=T}else oe&&K&&!ue&&V<R._startTime&&(R._currentTime=0);ee&&R._renderTransforms&&(J.transform=bn(W),ee=0),R=R._next}!s&&C&&e.onRender(e)}!s&&k&&e.onUpdate(e)}return n&&A?!s&&(n.began&&!x&&S>0&&!a||x&&S<=1e-11&&a)&&(e.onComplete(e),e.completed=!x):k&&w?u===1/0?e._startTime+=e.duration:e._currentIteration>=u-1&&(e.paused=!0,!a&&!d&&(e.completed=!0,!s&&!(n&&(x||!n.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,C},Zt=(e,t,s,r,i)=>{const n=e._currentIteration;if(Xs(e,t,s,r,i),e._hasChildren){const o=e,a=o.backwards,h=r?t:o._iterationTime,u=At();let p=0,c=!0;if(!r&&o._currentIteration!==n){const f=o.iterationDuration;ke(o,l=>{if(!a)!l.completed&&!l.backwards&&l._currentTime<l.iterationDuration&&Xs(l,f,s,1,tt.FORCE),l.began=!1,l.completed=!1;else{const d=l.duration,g=l._offset+l._delay,v=g+d;!s&&d<=1e-11&&(!g||v===f)&&l.onComplete(l)}}),s||o.onLoop(o)}ke(o,f=>{const l=F((h-f._offset)*f._speed,12);if(a&&l>f._delay+f.duration)return;const d=f._fps<o._fps?f.requestTick(u):i;p+=Xs(f,l,s,r,d),!f.completed&&c&&(c=!1)},a),!s&&p&&o.onRender(o),(c||a)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},Tn={},Wr=(e,t,s)=>{if(s===Le.TRANSFORM){const r=Br.get(e);return r||e}else if(s===Le.CSS||s===Le.ATTRIBUTE&&Vs(t)&&e in t.style){const r=Tn[e];if(r)return r;{const i=e&&Fs(e);return Tn[e]=i,i}}else return e},Ys=(e,t=!1)=>{if(e._hasChildren)ke(e,s=>Ys(s,t),!0);else{const s=e;s.pause(),ke(s,r=>{const i=r.property,n=r.target,o=r._tweenType,a=r._inlineValue,h=zt(a)||a==="";if(r._setter){if(!t&&!h){if(Qe(a,Ve),Ve.d){const u=Ve.d,p=r._numbers;for(let c=0,f=u.length;c<f;c++)p[c]=u[c]}else r._number=Ve.n;r._setter(r.target,r._number,r)}}else if(o===Le.OBJECT)!t&&!h&&(n[i]=a);else if(n[Ft])if(o===Le.ATTRIBUTE)t||(h?n.removeAttribute(i):n.setAttribute(i,a));else{const u=n.style;if(o===Le.TRANSFORM){const p=n[gs];h?delete p[i]:p[i]=a,r._renderTransforms&&(Object.keys(p).length?u.transform=bn(p):u.removeProperty("transform"))}else h?u.removeProperty(Fs(i)):u[i]=a}n[Ft]&&s._tail===r&&s.targets.forEach(u=>{u.getAttribute&&u.getAttribute("style")===""&&u.removeAttribute("style")})})}return e},Cn=e=>Ys(e,!0),Pn=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=Ye/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){const t=+e,s=t<1e-11?Re:t,r=Ye/s;s>ms.frameRate&&(ms.frameRate=s),this._fps=s,this._frameDuration=r}get speed(){return this._speed}set speed(e){const t=+e;this._speed=t<1e-11?Re:t}requestTick(e){const t=this._frameDuration,s=e-this._lastTickTime,r=t*.25;return s+(r<4?r:4)<t?tt.NONE:(this._lastTickTime=s>=t?e-s%t:e,tt.AUTO)}computeDeltaTime(e){const t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},ss={animation:null,update:ne},gc=e=>{let t=ss.animation;return t||(t={duration:Re,computeDeltaTime:ne,_offset:0,_delay:0,_head:null,_tail:null},ss.animation=t,ss.update=()=>{e.forEach(s=>{for(let r in s){const i=s[r],n=i._head;if(n){const o=n._valueType,a=o===ve.COMPLEX||o===ve.COLOR?Ue(n._fromNumbers):null;let h=n._fromNumber,u=i._tail;for(;u&&u!==n;){if(a)for(let p=0,c=u._numbers.length;p<c;p++)a[p]+=u._numbers[p];else h+=u._number;u=u._prevAdd}n._toNumber=h,n._toNumbers=a}}}),Xs(t,1,1,0,tt.FORCE)}),t},En=_t?requestAnimationFrame:setImmediate,mc=_t?cancelAnimationFrame:clearImmediate,vc=class extends Pn{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=ms,this.paused=!0,this.reqId=0}update(){const e=this._currentTime=At();if(this.requestTick(e)){this.computeDeltaTime(e);const t=this._speed,s=this._fps;let r=this._head;for(;r;){const i=r._next;r.paused?(vt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Zt(r,(e-r._startTime)*r._speed*t,0,0,r._fps<s?r.requestTick(e):tt.AUTO),r=i}ss.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(At()),this.reqId=En(An)),this}pause(){if(this.reqId)return this.paused=!0,yc()}resume(){if(this.paused)return this.paused=!1,ke(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(z.timeScale===1?1:Ye)}set speed(e){const t=e*z.timeScale;this._speed!==t&&(this._speed=t,ke(this,s=>s.speed=s._speed))}get timeUnit(){return z.timeScale===1?"ms":"s"}set timeUnit(e){const s=e==="s",r=s?.001:1;if(z.timeScale!==r){z.timeScale=r,z.tickThreshold=200*r;const i=s?.001:Ye;this.defaults.duration*=i,this._speed*=i}}get precision(){return z.precision}set precision(e){z.precision=e}},ze=(()=>{const e=new vc(At());return _t&&(dn.engine=e,Q.addEventListener("visibilitychange",()=>{e.pauseOnDocumentHidden&&(Q.hidden?e.pause():e.resume())})),e})(),An=()=>{ze._head?(ze.reqId=En(An),ze.update()):ze.reqId=0},yc=()=>(mc(ze.reqId),ze.reqId=0,ze),Gs={_rep:new WeakMap,_add:new Map},Xr=(e,t,s="_rep")=>{const r=Gs[s];let i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},bc=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Zs=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=Re,e._currentTime=Re},Ln=(e,t)=>{const s=e._composition;if(s===$e.replace){const r=e._absoluteStartTime;yt(t,e,bc,"_prevRep","_nextRep");const i=e._prevRep;if(i){const n=i.parent,o=i._absoluteEndTime;if(e.parent.id!==n.id&&n.iterationCount>1&&o+(n.duration-n.iterationDuration)>r){Zs(i);let u=i._prevRep;for(;u&&u.parent.id===n.id;)Zs(u),u=u._prevRep}const a=e._absoluteUpdateStartTime;if(o>a){const u=i._startTime,p=o-(u+i._updateDuration),c=F(a-p-u,12);i._changeDuration=c,i._currentTime=c,i._isOverlapped=1,c<1e-11&&Zs(i)}const h=e.parent.parent;if(!h||h!==n.parent){let u=!0;if(ke(n,p=>{p._isOverlapped||(u=!1)}),u){const p=n.parent;if(p){let c=!0;ke(p,f=>{f!==n&&ke(f,l=>{l._isOverlapped||(c=!1)})}),c&&p.cancel()}else n.cancel()}}}}else if(s===$e.blend){const r=Xr(e.target,e.property,"_add"),i=gc(Gs._add);let n=r._head;n||(n={...e},n._composition=$e.replace,n._updateDuration=Re,n._startTime=0,n._numbers=Ue(e._fromNumbers),n._number=0,n._next=null,n._prev=null,yt(r,n),yt(i,n));const o=e._toNumber;if(e._fromNumber=n._fromNumber-o,e._toNumber=0,e._numbers=Ue(e._fromNumbers),e._number=0,n._fromNumber=o,e._toNumbers.length){const a=Ue(e._toNumbers);a.forEach((h,u)=>{e._fromNumbers[u]=n._fromNumbers[u]-h,e._toNumbers[u]=0}),n._fromNumbers=a}yt(r,e,null,"_prevAdd","_nextAdd")}return e},Rn=e=>{const t=e._composition;if(t!==$e.none){const s=e.target,r=e.property,i=Gs._rep.get(s)[r];if(vt(i,e,"_prevRep","_nextRep"),t===$e.blend){const n=Gs._add,o=n.get(s);if(!o)return;const a=o[r],h=ss.animation;vt(a,e,"_prevAdd","_nextAdd");const u=a._head;if(u&&u===a._tail){vt(a,u,"_prevAdd","_nextAdd"),vt(h,u);let p=!0;for(let c in o)if(o[c]._head){p=!1;break}p&&n.delete(s)}}}return e},In=(e,t,s)=>{let r=!1;return ke(t,i=>{const n=i.target;if(e.includes(n)){const o=i.property,a=i._tweenType,h=Wr(s,n,a);(!h||h&&h===o)&&(i.parent._tail===i&&i._tweenType===Le.TRANSFORM&&i._prev&&i._prev._tweenType===Le.TRANSFORM&&(i._prev._renderTransforms=1),vt(t,i),Rn(i),r=!0)}},!0),r},wt=(e,t,s)=>{const r=t||ze;let i;if(r._hasChildren){let n=0;ke(r,o=>{if(!o._hasChildren)if(i=In(e,o,s),i&&!o._head)o.cancel(),vt(r,o);else{const a=o._offset+o._delay+o.duration;a>n&&(n=a)}o._head?wt(e,o,s):o._hasChildren=!1},!0),B(r.iterationDuration)||(r.iterationDuration=n)}else i=In(e,r,s);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},On=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Yr=e=>(e._cancelled&&(e._hasChildren?ke(e,Yr):ke(e,t=>{t._composition!==$e.none&&Ln(t,Xr(t.target,t.property))}),e._cancelled=0),e),Nn=0,_c=(e,t)=>e._priority>t._priority,st=class extends Pn{constructor(e={},t=null,s=0){super(0),++Nn;const{id:r,delay:i,duration:n,reversed:o,alternate:a,loop:h,loopDelay:u,autoplay:p,frameRate:c,playbackRate:f,priority:l,onComplete:d,onLoop:g,onPause:v,onBegin:b,onBeforeUpdate:S,onUpdate:y}=e;Ie.current&&Ie.current.register(this);const m=t?0:ze._lastTickTime,_=t?t.defaults:z.defaults,k=Ae(i)||B(i)?_.delay:+i,w=Ae(n)||B(n)?1/0:+n,A=U(h,_.loop),O=U(u,_.loopDelay);let E=A===!0||A===1/0||A<0?1/0:A+1,P=0;t?P=s:(ze.reqId||ze.requestTick(At()),P=(ze._lastTickTime-ze._startTime)*z.timeScale),this.id=B(r)?Nn:r,this.parent=t,this.duration=Ws((w+O)*E-O)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=b||_.onBegin,this.onBeforeUpdate=S||_.onBeforeUpdate,this.onUpdate=y||_.onUpdate,this.onLoop=g||_.onLoop,this.onPause=v||_.onPause,this.onComplete=d||_.onComplete,this.iterationDuration=w,this.iterationCount=E,this._autoplay=t?!1:U(p,_.autoplay),this._offset=P,this._delay=k,this._loopDelay=O,this._iterationTime=0,this._currentIteration=0,this._resolve=ne,this._running=!1,this._reversed=+U(o,_.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=U(a,_.alternate),this._prev=null,this._next=null,this._lastTickTime=m,this._startTime=m,this._lastTime=m,this._fps=U(c,_.frameRate),this._speed=U(f,_.playbackRate),this._priority=+U(l,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return j(F(this._currentTime,z.precision),-this._delay,this.duration)}set currentTime(e){const t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return j(F(this._iterationTime,z.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return j(F(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return j(F(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){const t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*j(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Yr(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Zt(this,0,1,~~e,tt.FORCE),On(this),this._hasChildren&&ke(this,On),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Zt(this,this.duration,1,~~e,tt.FORCE),this.reset(e);const t=this._autoplay;return t===!0?this.resume():t&&!B(t.linked)&&t.link(this),this}resetTime(){const e=1/(this._speed*ze._speed);return this._startTime=At()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Zt(this,Re,0,0,tt.FORCE):(this._running||(yt(ze,this,_c),ze._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,ze.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,s=0){Yr(this),this.completed=!1;const r=this.paused;return this.paused=!0,Zt(this,e+this._delay,~~t,~~s,tt.AUTO),r?this:this.resume()}alternate(){const e=this._reversed,t=this.iterationCount,s=this.iterationDuration,r=t===1/0?es(mt/s):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?ke(this,e=>e.cancel(),!0):ke(this,Rn),this._cancelled=1,this.pause()}stretch(e){const t=this.duration,s=ts(e);if(t===s)return this;const r=e/t,i=e<=Re;return this.duration=i?Re:s,this.iterationDuration=i?Re:ts(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Zt(this,0,1,0,tt.AUTO);const e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=ne){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=ne};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Sc=e=>new st(e,null,0).init();function Gr(e){const t=Be(e)?Ie.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function rt(e){if(zt(e))return[];if(!_t)return He(e)&&e.flat(1/0)||[e];if(He(e)){const s=e.flat(1/0),r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];if(!zt(o)){const a=Gr(o);if(a)for(let h=0,u=a.length;h<u;h++){const p=a[h];if(!zt(p)){let c=!1;for(let f=0,l=r.length;f<l;f++)if(r[f]===p){c=!0;break}c||r.push(p)}}else{let h=!1;for(let u=0,p=r.length;u<p;u++)if(r[u]===o){h=!0;break}h||r.push(o)}}}return r}const t=Gr(e);return t?Array.from(t):[e]}function Rt(e){const t=rt(e),s=t.length;for(let r=0;r<s;r++){const i=t[r];if(!i[ln]){i[ln]=!0;const n=Vs(i);(i.nodeType||n)&&(i[Ft]=!0,i[Dr]=n,i[gs]={})}}return t}var Zr={deg:1,rad:180/St,turn:360},Mn={},js=(e,t,s,r=!1)=>{const i=t.u,n=t.n;if(t.t===ve.UNIT&&i===s)return t;const o=n+i+s,a=Mn[o];if(!B(a)&&!r)t.n=a;else{let h;if(i in Zr)h=n*Zr[i]/Zr[s];else{const p=e.cloneNode(),c=e.parentNode,f=c&&c!==Q?c:Q.body;f.appendChild(p);const l=p.style;l.width=100+i;const d=p.offsetWidth||100;l.width=100+s;const g=d/(p.offsetWidth||100);f.removeChild(p),h=g*n}t.n=h,Mn[o]=h}return t.t,ve.UNIT,t.u=s,t},it=e=>e,vs=(e=1.68)=>t=>Wt(t,+e),jr={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},kc=St/2,Dn=St*2,Bn={"":vs,Quad:vs(2),Cubic:vs(3),Quart:vs(4),Quint:vs(5),Sine:e=>1-Hr(e*kc),Circ:e=>1-at(1-e*e),Expo:e=>e?Wt(2,10*e-10):0,Bounce:e=>{let t,s=4;for(;e<((t=Wt(2,--s))-1)/11;);return 1/Wt(4,3-s)-7.5625*Wt((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const s=j(+e,1,10),r=j(+t,Re,2),i=r/Dn*cc(1/s),n=Dn/r;return o=>o===0||o===1?o:-s*Wt(2,-10*(1-o))*$r((1-o-i)*n)}},xt=(()=>{const e={linear:it,none:it};for(let t in jr)for(let s in Bn){const r=Bn[s],i=jr[t];e[t+s]=s===""||s==="Back"||s==="Elastic"?(n,o)=>i(r(n,o)):i(r)}return e})(),Qs={linear:it,none:it},$n=e=>{if(Qs[e])return Qs[e];if(e.indexOf("(")<=-1){const t=jr[e]||e.includes("Back")||e.includes("Elastic")?xt[e]():xt[e];return t?Qs[e]=t:it}else{const t=e.slice(0,-1).split("("),s=xt[t[0]];return s?Qs[e]=s(...t[1].split(",")):it}},Hn=["steps(","irregular(","linear(","cubicBezier("],Tt=e=>{if(Be(e)){for(let t=0,s=Hn.length;t<s;t++)if(Ne(e,Hn[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),it}return Ae(e)?e:Be(e)?$n(e):it},re=Ur(),de=Ur(),rs={},Js={func:null},Ks={func:null},er=[null],is=[null,null],tr={to:null},wc=0,qn=0,It,kt,xc=(e,t)=>{const s={};if(He(e)){const r=[].concat(...e.map(i=>Object.keys(i))).filter(Kt);for(let i=0,n=r.length;i<n;i++){const o=r[i];s[o]=e.map(a=>{const h={};for(let u in a){const p=a[u];Kt(u)?u===o&&(h.to=p):h[u]=p}return h})}}else{const r=U(t.duration,z.defaults.duration);Object.keys(e).map(i=>({o:parseFloat(i)/100,p:e[i]})).sort((i,n)=>i.o-n.o).forEach(i=>{const n=i.o,o=i.p;for(let a in o)if(Kt(a)){let h=s[a];h||(h=s[a]=[]);const u=n*r;let p=h.length,c=h[p-1];const f={to:o[a]};let l=0;for(let d=0;d<p;d++)l+=h[d].duration;p===1&&(f.from=c.to),o.ease&&(f.ease=o.ease),f.duration=u-(p?l:0),h.push(f)}return i});for(let i in s){const n=s[i];let o;for(let a=0,h=n.length;a<h;a++){const u=n[a],p=u.ease;u.ease=o||void 0,o=p}n[0].duration||n.shift()}}return s},Ct=class extends st{constructor(e,t,s,r,i=!1,n=0,o){super(t,s,r),this._head,this._tail,++qn;const a=Rt(e),h=a.length,u=t.keyframes,p=u?ct(xc(u,t),t):t,{id:c,delay:f,duration:l,ease:d,playbackEase:g,modifier:v,composition:b,onRender:S}=p,y=s?s.defaults:z.defaults,m=U(d,y.ease),_=U(g,y.playbackEase),k=_?Tt(_):null,w=!B(m.ease),A=w?m.ease:U(d,k?"linear":y.ease),O=w?m.settlingDuration:U(l,y.duration),E=U(f,y.delay),P=v||y.modifier,C=B(b)&&h>=1e3?$e.none:B(b)?y.composition:b,$=this._offset+(s?s._offset:0);w&&(m.parent=this);let H=NaN,V=NaN,x=0,M=0;for(let I=0;I<h;I++){const R=a[I],q=n||I,J=o||a;let G=NaN,W=NaN;for(let ee in p)if(Kt(ee)){const X=zr(R,ee),oe=_n(R,ee),pe=Wr(ee,R,X);let ce=p[ee];const ie=He(ce);if(i&&!ie&&(is[0]=ce,is[1]=ce,ce=is),ie){const fe=ce.length,me=!De(ce[0]);fe===2&&me?(tr.to=ce,er[0]=tr,It=er):fe>2&&me?(It=[],ce.forEach((_e,Ce)=>{Ce?Ce===1?(is[1]=_e,It.push(is)):It.push(_e):is[0]=_e})):It=ce}else er[0]=ce,It=er;let K=null,ae=null,xe=NaN,ue=0,te=0;for(let fe=It.length;te<fe;te++){const me=It[te];De(me)?kt=me:(tr.to=me,kt=tr),Js.func=null,Ks.func=null;const _e=Oe(U(kt.composition,C),R,q,J,null,null),Ce=Fe(_e)?_e:$e[_e];!K&&Ce!==$e.none&&(K=Xr(R,pe));const Te=K?K._tail:null,be=s&&Te&&Te.parent.parent===s?Te:ae,se=Oe(kt.to,R,q,J,Js,be);let ge;De(se)&&!B(se.to)?(kt=se,ge=se.to):ge=se;const T=Oe(kt.from,R,q,J,Ks,be),N=kt.ease||A,L=Oe(N,R,q,J,null,be),D=Ae(L)||Be(L)?L:N,Z=!B(D)&&!B(D.ease),Y=Z?D.ease:D,we=Z?D.settlingDuration:Oe(U(kt.duration,fe>1?Oe(O,R,q,J,null,be)/fe:O),R,q,J,null,be),ye=Oe(U(kt.delay,te?0:E),R,q,J,null,be),nt=kt.modifier||P,Me=!B(T),Rs=!B(ge),Mt=He(ge),Iu=Mt||Me&&Rs,Ou=ae?ue:0,ki=ae?ue+ye:ye,wi=F($+ki,12),Nu=F($+Ou,12);!M&&(Me||Mt)&&(M=1);let pt=ae;if(Ce!==$e.none){let Se=K._head;for(;Se&&Se._absoluteStartTime<=wi;)if(Se._isOverridden||(pt=Se),Se=Se._nextRep,Se&&Se._absoluteStartTime>=wi)for(;Se;)Zs(Se),Se=Se._nextRep}if(Iu){Qe(Mt?Oe(ge[0],R,q,J,Ks,be):T,re),Qe(Mt?Oe(ge[1],R,q,J,Js,be):ge,de);const Se=Yt(R,pe,X,rs);re.t===ve.NUMBER&&(pt?pt._valueType===ve.UNIT&&(re.t=ve.UNIT,re.u=pt._unit):(Qe(Se,Ve),Ve.t===ve.UNIT&&(re.t=ve.UNIT,re.u=Ve.u)))}else Rs?Qe(ge,de):ae?wn(ae,de):Qe(s&&pt&&pt.parent.parent===s?pt._value:Yt(R,pe,X,rs),de),Me?Qe(T,re):ae?wn(ae,re):Qe(s&&pt&&pt.parent.parent===s?pt._value:Yt(R,pe,X,rs),re);if(re.o&&(re.n=Gt(pt?pt._toNumber:Qe(Yt(R,pe,X,rs),Ve).n,re.n,re.o)),de.o&&(de.n=Gt(re.n,de.n,de.o)),re.t!==de.t){if(re.t===ve.COMPLEX||de.t===ve.COMPLEX){const Se=re.t===ve.COMPLEX?re:de,Ze=re.t===ve.COMPLEX?de:re;Ze.t=ve.COMPLEX,Ze.s=Ue(Se.s),Ze.d=Se.d.map(()=>Ze.n)}else if(re.t===ve.UNIT||de.t===ve.UNIT){const Se=re.t===ve.UNIT?re:de,Ze=re.t===ve.UNIT?de:re;Ze.t=ve.UNIT,Ze.u=Se.u}else if(re.t===ve.COLOR||de.t===ve.COLOR){const Se=re.t===ve.COLOR?re:de,Ze=re.t===ve.COLOR?de:re;Ze.t=ve.COLOR,Ze.d=Se.d.map(()=>0)}}if(re.u!==de.u){let Se=de.u?re:de;Se=js(R,Se,de.u?de.u:re.u,!1)}if(de.d&&re.d&&de.d.length!==re.d.length){const Se=re.d.length>de.d.length?re:de,Ze=Se===re?de:re;Ze.d=Se.d.map((Vu,Yo)=>B(Ze.d[Yo])?0:Ze.d[Yo]),Ze.s=Ue(Se.s)}const xi=F(+we||1e-11,12);let Uo=rs[pe];zt(Uo)||(rs[pe]=null);const Mu=oe?oe.set:null;ue=F(ki+xi,12);const _r=re.d,Wo=de.d,Xo=de.s,ot={parent:this,id:wc++,property:pe,target:R,_value:null,_toFunc:Js.func,_fromFunc:Ks.func,_ease:Tt(Y),_fromNumbers:_r?Ue(_r):qs,_toNumbers:Wo?Ue(Wo):qs,_strings:Xo?Ue(Xo):qs,_fromNumber:re.n,_toNumber:de.n,_numbers:_r?Ue(_r):qs,_number:re.n,_unit:de.u,_modifier:nt,_currentTime:0,_startTime:ki,_delay:+ye,_updateDuration:xi,_changeDuration:xi,_absoluteStartTime:wi,_absoluteUpdateStartTime:Nu,_absoluteEndTime:F($+ue,12),_hasFromValue:Me||Mt?1:0,_tweenType:X,_setter:Mu,_valueType:de.t,_composition:Ce,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Uo,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};Ce!==$e.none&&Ln(ot,K);const Ti=ot._valueType;if(Ti===ve.COMPLEX)ot._value=xn(ot,1,-1);else if(Ti===ve.UNIT)ot._value=`${nt(ot._toNumber)}${ot._unit}`;else if(Ti===ve.COLOR){const Se=de.d;ot._value=`rgba(${F(Se[0],0)},${F(Se[1],0)},${F(Se[2],0)},${Se[3]})`}else ot._value=nt(ot._toNumber);isNaN(xe)&&(xe=ot._startTime),ae=ot,x++,yt(this,ot)}(isNaN(V)||xe<V)&&(V=xe),(isNaN(H)||ue>H)&&(H=ue),X===Le.TRANSFORM&&(G=x-te,W=x)}if(!isNaN(G)){let ee=0;ke(this,X=>{ee>=G&&ee<W&&(X._renderTransforms=1,X._composition===$e.blend&&ke(ss.animation,oe=>{oe.id===X.id&&(oe._renderTransforms=1)})),ee++})}}h||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),V?(ke(this,I=>{I._startTime-I._delay||(I._delay-=V),I._startTime-=V}),H-=V):V=0,H||(H=Re,this.iterationCount=0),this.targets=a,this.id=B(c)?qn:c,this.duration=H===1e-11?Re:Ws((H+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=S||y.onRender,this._ease=k,this._delay=V,this.iterationDuration=H,!this._autoplay&&M&&this.onRender(this)}stretch(e){const t=this.duration;if(t===ts(e))return this;const s=e/t;return ke(this,r=>{r._updateDuration=ts(r._updateDuration*s),r._changeDuration=ts(r._changeDuration*s),r._currentTime*=s,r._delay*=s,r._startTime*=s,r._absoluteStartTime*=s,r._absoluteUpdateStartTime*=s,r._absoluteEndTime*=s}),super.stretch(e)}refresh(){return ke(this,e=>{const t=e._toFunc,s=e._fromFunc;(t||s)&&(s?(Qe(s(),re),re.u!==e._unit&&e.target[Ft]&&js(e.target,re,e._unit,!0),e._fromNumbers=Ue(re.d),e._fromNumber=re.n):t&&(Qe(Yt(e.target,e.property,e._tweenType),Ve),e._fromNumbers=Ue(Ve.d),e._fromNumber=Ve.n),t&&(Qe(t(),de),e._toNumbers=Ue(de.d),e._strings=Ue(de.s),e._toNumber=de.o?Gt(e._fromNumber,de.n,de.o):de.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Ys(this)}then(e){return super.then(e)}},ys=(e,t)=>z.editor?z.editor.addAnimation(e,t):new Ct(e,t,null,0,!1).init(),Tc=(e,t)=>{if(Ne(t,"<")){const s=t[1]==="<",r=e._tail,i=r?r._offset+r._delay:0;return s?i:i+r.duration}},bs=(e,t)=>{let s=e.iterationDuration;if(s===1e-11&&(s=0),B(t))return s;if(Fe(+t))return+t;const r=t,i=e?e.labels:null,n=!zt(i),o=Tc(e,r),a=!B(o),h=fn.exec(r);if(h){const u=h[0],p=r.split(u),c=n&&p[0]?i[p[0]]:s,f=a?o:n?c:s,l=+p[1];return Gt(f,l,u[0])}else return a?o:n?B(i[r])?s:i[r]:s};function Cc(e){return Ws((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function Qr(e,t,s,r,i,n){const o=Fe(e.duration)&&e.duration<=1e-11?s-Re:s;t.composition&&Zt(t,o,1,1,tt.AUTO);const a=r?new Ct(r,e,t,o,!1,i,n):new st(e,t,o);return t.composition&&a.init(!0),yt(t,a),ke(t,h=>{const u=h._offset+h._delay+h.duration;u>t.iterationDuration&&(t.iterationDuration=u)}),t.duration=Cc(t),t}var Fn=0,Vn=class extends st{constructor(e={}){super(e,null,0),++Fn,this.id=B(e.id)?Fn:e.id,this.duration=0,this.labels={};const t=e.defaults,s=z.defaults;this.defaults=t?ct(t,s):s,this.composition=U(e.composition,!0),this.onRender=e.onRender||s.onRender;const r=U(e.playbackEase,s.playbackEase);this._ease=r?Tt(r):null,this.iterationDuration=0}add(e,t,s){const r=De(t),i=De(e);if(r||i){if(this._hasChildren=!0,r){const n=t,o=z.editor&&z.editor.addTimelineChild,a=s&&s.type==="Stagger"&&z.editor,h=Ae(s)?s:null;if(h||a){const u=rt(e),p=this.duration,c=this.iterationDuration,f=n.id;let l=0;const d=u.length,g=o?o(e,n,this.id,s,d):null,v=h||z.editor.resolveStagger(s.defaultValue);u.forEach(b=>{const S={...g||n};this.duration=p,this.iterationDuration=c,B(f)||(S.id=f+"-"+l);const y=bs(this,v(b,l,u,null,this));Qr(S,this,y,b,l,u),l++})}else{const u=o?o(e,n,this.id,s):n,p=s&&s.type?s.defaultValue:s;Qr(u,this,bs(this,p),e)}}else Qr(e,this,bs(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(B(e)||e&&B(e.pause))return this;e.pause();const s=+(e.effect?e.effect.getTiming().duration:e.duration);!B(e)&&!B(e.persist)&&(e.persist=!0);const r=z.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);const n=this.add(e,{currentTime:[0,s],duration:s,delay:0,ease:"linear",playbackEase:"linear"},t);return r&&(r.addTimelineChild=i),n}set(e,t,s){return B(t)?this:(t.duration=Re,t.composition=$e.replace,this.add(e,t,s))}call(e,t){return B(e)||e&&!Ae(e)?this:(z.editor&&z.editor.addTimelineCall&&(t=z.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return B(e)||e&&!Be(e)?this:(z.editor&&z.editor.addTimelineLabel&&(t=z.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=bs(this,t),this)}remove(e,t){return wt(rt(e),this,t),this}stretch(e){const t=this.duration;if(t===ts(e))return this;const s=e/t,r=this.labels;ke(this,i=>i.stretch(i.duration*s));for(let i in r)r[i]*=s;return super.stretch(e)}refresh(){return ke(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),ke(this,e=>e.revert,!0),Ys(this)}then(e){return super.then(e)}},zn=e=>z.editor?z.editor.addTimeline(e):new Vn(e).init(),Jr=class{constructor(e,t){Ie.current&&Ie.current.register(this);const s=()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},r=()=>{if(this.callbacks.completed)return;let a=!0;for(let h in this.animations)if(!this.animations[h].paused&&a){a=!1;break}a&&this.callbacks.complete()},i={onBegin:s,onComplete:r,onPause:r},n={v:1,autoplay:!1},o={};if(this.targets=[],this.animations={},this.callbacks=null,!(B(e)||B(t))){for(let a in t){const h=t[a];Kt(a)?o[a]=h:Ne(a,"on")?n[a]=h:i[a]=h}this.callbacks=new Ct({v:0},n);for(let a in o){const h=o[a],u=De(h);let p={},c="+=0";if(u){const d=h.unit;Be(d)&&(c+=d)}else p.duration=h;p[a]=u?ct({to:c},h):c;const f=ct(i,p);f.composition=$e.replace,f.autoplay=!1;const l=this.animations[a]=new Ct(e,f,null,0,!1).init();this.targets.length||this.targets.push(...l.targets),this[a]=(d,g,v)=>{const b=l._head;if(B(d)&&b){const S=b._numbers;return S&&S.length?S:b._modifier(b._number)}else return ke(l,S=>{if(He(d))for(let y=0,m=d.length;y<m;y++)B(S._numbers[y])||(S._fromNumbers[y]=S._modifier(S._numbers[y]),S._toNumbers[y]=d[y]);else S._fromNumber=S._modifier(S._number),S._toNumber=d;B(v)||(S._ease=Tt(v)),S._currentTime=0}),B(g)||l.stretch(g),l.reset(!0).resume(),this}}}}revert(){for(let e in this.animations)this[e]=ne,this.animations[e].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}},Pc=(e,t)=>new Jr(e,t),Ec=jt({clamp:()=>j,damp:()=>Mc,degToRad:()=>Oc,lerp:()=>Lt,mapRange:()=>_s,padEnd:()=>Rc,padStart:()=>Lc,radToDeg:()=>Nc,round:()=>F,roundPad:()=>Ac,snap:()=>Xt,wrap:()=>Ic}),Ac=(e,t)=>(+e).toFixed(t),Lc=(e,t,s)=>`${e}`.padStart(t,s),Rc=(e,t,s)=>`${e}`.padEnd(t,s),Ic=(e,t,s)=>((e-t)%(s-t)+(s-t))%(s-t)+t,_s=(e,t,s,r,i)=>r+(e-t)/(s-t)*(i-r),Oc=e=>e*Math.PI/180,Nc=e=>e*180/Math.PI,Mc=(e,t,s,r)=>r?r===1?t:Lt(e,t,1-Math.exp(-r*s*.1)):e,Je=Ye*10,sr=class{constructor(e={}){const t=!B(e.bounce)||!B(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/Ye,this.maxIterations=this.maxDuration/this.timeStep/Ye,this.bn=j(U(e.bounce,.5),-1,1),this.pd=j(U(e.duration,628),10*z.timeScale,Je*z.timeScale),this.m=j(U(e.mass,1),1,Je),this.s=j(U(e.stiffness,100),Re,Je),this.d=j(U(e.damping,10),Re,Je),this.v=j(U(e.velocity,0),-Je,Je),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||ne,t&&this.calculateSDFromBD(),this.compute(),this.ease=s=>{const r=s*this.settlingDuration,i=this.completed,n=this.pd;return r>=n&&!i&&(this.completed=!0,this.onComplete(this.parent)),r<n&&i&&(this.completed=!1),s===0||s===1?s:this.solve(s*this.solverDuration)}}solve(e){const{zeta:t,w0:s,wd:r,b:i}=this;let n=e;return t<1?n=zs(-n*t*s)*(1*Hr(r*n)+i*$r(r*n)):t===1?n=(1+i*n)*zs(-n*s):n=((1+i)*zs((-t*s+r)*n)+(1-i)*zs((-t*s-r)*n))/2,1-n}calculateSDFromBD(){const e=z.timeScale===1?this.pd/Ye:this.pd;this.m=1,this.v=0,this.s=Wt(2*St/e,2),this.bn>=0?this.d=(1-this.bn)*4*St/e:this.d=4*St/(e*(1+this.bn)),this.s=F(j(this.s,Re,Je),3),this.d=F(j(this.d,Re,300),3)}calculateBDFromSD(){const e=2*St/at(this.s);this.pd=e*(z.timeScale===1?Ye:1),this.d/(2*at(this.s))<=1?this.bn=1-this.d*e/(4*St):this.bn=4*St/(this.d*e)-1,this.bn=F(j(this.bn,-1,1),3),this.pd=F(j(this.pd,10*z.timeScale,Je*z.timeScale),3)}compute(){const{maxRestSteps:e,maxIterations:t,restThreshold:s,timeStep:r,m:i,d:n,s:o,v:a}=this,h=this.w0=j(at(o/i),Re,Ye),u=this.zeta=n/(2*at(o*i));u<1?(this.wd=h*at(1-u*u),this.b=(u*h+-a)/this.wd):u===1?(this.wd=0,this.b=-a+h):(this.wd=h*at(u*u-1),this.b=(u*h+-a)/this.wd);let p=0,c=0,f=0;for(;c<=e&&f<=t;)lt(1-this.solve(p))<s?c++:c=0,this.solverDuration=p,p+=r,f++;this.settlingDuration=F(this.solverDuration*Ye,0)*z.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=j(U(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=j(U(e,1),10*z.timeScale,Je*z.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=j(U(e,100),Re,Je),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=j(U(e,10),Re,Je),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=j(U(e,1),1,Je),this.compute()}get velocity(){return this.v}set velocity(e){this.v=j(U(e,0),-Je,Je),this.compute()}},rr=e=>new sr(e),Un=e=>(console.warn("createSpring() is deprecated use spring() instead"),new sr(e)),Kr={_head:null,_tail:null},ei=(e,t,s)=>{let r=Kr._head,i;for(;r;){const n=r._next,o=r.$el===e,a=!t||r.property===t,h=!s||r.parent===s;if(o&&a&&h){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),vt(Kr,r);const u=r.parent;u&&(u._completed++,u.animations.length===u._completed&&(u.completed=!0,u.paused=!0,u.muteCallbacks||(u.onComplete(u),u._resolve(u))))}r=n}return i},Wn=(e,t,s,r,i)=>{const n=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;n.playbackRate=e._speed,e.paused&&n.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=n),e.animations.push(n),ei(t,s),yt(Kr,{parent:e,animation:n,$el:t,property:s,_next:null,_prev:null});const a=()=>ei(t,s,e);return n.oncancel=a,n.onremove=a,e.persist||(n.onfinish=a),n};function Ot(e,t,s){const r=Rt(e);if(!r.length)return;const[i]=r,n=zr(i,t),o=Wr(t,i,n);let a=Yt(i,o);if(B(s))return a;if(Qe(a,Ve),Ve.t===ve.NUMBER||Ve.t===ve.UNIT){if(s===!1)return Ve.n;{const h=js(i,Ve,s,!1);return`${F(h.n,z.precision)}${h.u}`}}}var Pt=(e,t)=>{if(!B(t))return z.editor&&z.editor.addSet?z.editor.addSet(e,t):(t.duration=Re,t.composition=U(t.composition,$e.none),new Ct(e,t,null,0,!0).resume())},Xn=(e,t,s)=>{const r=rt(e);for(let i=0,n=r.length;i<n;i++)ei(r[i],s,t&&t.controlAnimation&&t);return wt(r,t,s),r},Nt=e=>{e.cancelable&&e.preventDefault()},Dc=class{constructor(e){this.el=e,this.zIndex=0,this.parentElement=null,this.classList={add:ne,remove:ne}}get x(){return this.el.x||0}set x(e){this.el.x=e}get y(){return this.el.y||0}set y(e){this.el.y=e}get width(){return this.el.width||0}set width(e){this.el.width=e}get height(){return this.el.height||0}set height(e){this.el.height=e}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}},Bc=class{constructor(e){this.$el=e,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(e,t){return this.point.x=e,this.point.y=t,this.point.matrixTransform(this.inversedMatrix)}traverseUp(e){let t=this.$el.parentElement,s=0;for(;t&&t!==Q;)e(t,s),t=t.parentElement,s++}getMatrix(){const e=new DOMMatrix;return this.traverseUp(t=>{const s=getComputedStyle(t).transform;if(s){const r=new DOMMatrix(s);e.preMultiplySelf(r)}}),e}remove(){this.traverseUp((e,t)=>{this.inlineTransforms[t]=e.style.transform,e.style.transform="none"})}revert(){this.traverseUp((e,t)=>{const s=this.inlineTransforms[t];s===""?e.style.removeProperty("transform"):e.style.transform=s})}},Ge=(e,t)=>e&&Ae(e)?e(t):e,ir=0,Yn=class{constructor(e,t={}){if(!e)return;Ie.current&&Ie.current.register(this);const s=t.x,r=t.y,i=t.trigger,n=t.modifier,o=t.releaseEase,a=o&&Tt(o),h=!B(o)&&!B(o.ease),u=De(s)&&!B(s.mapTo)?s.mapTo:"translateX",p=De(r)&&!B(r.mapTo)?r.mapTo:"translateY",c=Ge(t.container,this);this.containerArray=He(c)?c:null,this.$container=c&&!this.containerArray?rt(c)[0]:Q.body,this.useWin=this.$container===Q.body,this.$scrollContainer=this.useWin?Xe:this.$container,this.$target=De(e)?new Dc(e):rt(e)[0],this.$trigger=rt(i||e)[0],this.fixed=Ot(this.$target,"position")==="fixed",this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=h?o:rr({mass:U(t.releaseMass,1),stiffness:U(t.releaseStiffness,80),damping:U(t.releaseDamping,20)}),this.releaseYSpring=h?o:rr({mass:U(t.releaseMass,1),stiffness:U(t.releaseStiffness,80),damping:U(t.releaseDamping,20)}),this.releaseEase=a||xt.outQuint,this.hasReleaseSpring=h,this.onGrab=t.onGrab||ne,this.onDrag=t.onDrag||ne,this.onRelease=t.onRelease||ne,this.onUpdate=t.onUpdate||ne,this.onSettle=t.onSettle||ne,this.onSnap=t.onSnap||ne,this.onResize=t.onResize||ne,this.onAfterResize=t.onAfterResize||ne,this.disabled=[0,0];const f={};if(n&&(f.modifier=n),B(s)||s===!0)f[u]=0;else if(De(s)){const l=s,d={};l.modifier&&(d.modifier=l.modifier),l.composition&&(d.composition=l.composition),f[u]=d}else s===!1&&(f[u]=0,this.disabled[0]=1);if(B(r)||r===!0)f[p]=0;else if(De(r)){const l=r,d={};l.modifier&&(d.modifier=l.modifier),l.composition&&(d.composition=l.composition),f[p]=d}else r===!1&&(f[p]=0,this.disabled[1]=1);this.animate=new Jr(this.$target,f),this.xProp=u,this.yProp=p,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-mt,mt,mt,-mt],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=At(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new Bc(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new st({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new st({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!B(c),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?u:p,this.animate.callbacks.onRender=()=>{const l=this.updated,d=!(this.grabbed&&l)&&this.released,g=this.x,v=this.y,b=g-this.coords[2],S=v-this.coords[3];this.deltaX=b,this.deltaY=S,this.coords[2]=g,this.coords[3]=v,l&&(b||S)&&this.onUpdate(this),d?(this.computeVelocity(b,S),this.angle=Us(S,b)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new st({autoplay:!1,duration:150*z.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=t,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),De(e)||this.resizeObserver.observe(this.$target)}computeVelocity(e,t){const s=this.velocityTime,r=At(),i=r-s;if(i<17)return this.velocity;this.velocityTime=r;const n=this.velocityStack,o=this.velocityMultiplier,a=this.minVelocity,h=this.maxVelocity,u=this.velocityStackIndex;n[u]=F(j(at(e*e+t*t)/i*o,a,h),5);const p=yn(n[0],n[1],n[2]);return this.velocity=p,this.velocityStackIndex=(u+1)%3,p}setX(e,t=!1){if(this.disabled[0])return;const s=F(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destX=s,this.snapped[0]=Xt(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(e,t=!1){if(this.disabled[1])return;const s=F(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destY=s,this.snapped[1]=Xt(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return F(this.animate[this.xProp](),z.precision)}set x(e){this.setX(e,!1)}get y(){return F(this.animate[this.yProp](),z.precision)}set y(e){this.setY(e,!1)}get progressX(){return _s(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(e){this.setX(_s(e,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return _s(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(e){this.setY(_s(e,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const e=F(this.useWin?Xe.scrollX:this.$container.scrollLeft,0),t=F(this.useWin?Xe.scrollY:this.$container.scrollTop,0),[s,r,i,n]=this.containerPadding,o=this.scrollThreshold;this.scroll.x=e,this.scroll.y=t,this.scrollBounds[0]=t-this.targetBounds[0]+s-o,this.scrollBounds[1]=e-this.targetBounds[1]-r+o,this.scrollBounds[2]=t-this.targetBounds[2]-i+o,this.scrollBounds[3]=e-this.targetBounds[3]+n-o}updateBoundingValues(){const e=this.$container;if(!e)return;const t=this.x,s=this.y,r=this.coords[2],i=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const n=this.window[0]=Xe.innerWidth,o=this.window[1]=Xe.innerHeight,a=this.useWin,h=e.scrollWidth,u=e.scrollHeight,p=this.fixed,c=e.getBoundingClientRect(),[f,l,d,g]=this.containerPadding;this.dragArea[0]=a?0:c.left,this.dragArea[1]=a?0:c.top,this.scrollView[0]=a?j(h,n,h):h,this.scrollView[1]=a?j(u,o,u):u,this.updateScrollCoords();const{width:v,height:b,left:S,top:y,right:m,bottom:_}=e.getBoundingClientRect();this.dragArea[2]=F(a?j(v,n,n):v,0),this.dragArea[3]=F(a?j(b,o,o):b,0);const k=Ot(e,"overflow"),w=k==="visible",A=k==="hidden";if(this.canScroll=p?!1:this.contained&&(e===Q.body&&w||!A&&!w)&&(h>this.dragArea[2]+g-l||u>this.dragArea[3]+f-d)&&(!this.containerArray||this.containerArray&&!He(this.containerArray)),this.contained){const O=this.scroll.x,E=this.scroll.y,P=this.canScroll,C=this.$target.getBoundingClientRect(),$=P?a?0:e.scrollLeft:0,H=P?a?0:e.scrollTop:0,V=P?this.scrollView[0]-$-v:0,x=P?this.scrollView[1]-H-b:0;this.targetBounds[0]=F(C.top+E-(a?0:y),0),this.targetBounds[1]=F(C.right+O-(a?n:m),0),this.targetBounds[2]=F(C.bottom+E-(a?o:_),0),this.targetBounds[3]=F(C.left+O-(a?0:S),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+f,this.containerBounds[1]=this.containerArray[1]-l,this.containerBounds[2]=this.containerArray[2]-d,this.containerBounds[3]=this.containerArray[3]+g):(this.containerBounds[0]=-F(C.top-(p?j(y,0,o):y)+H-f,0),this.containerBounds[1]=-F(C.right-(p?j(m,0,n):m)-V+l,0),this.containerBounds[2]=-F(C.bottom-(p?j(_,0,o):_)-x+d,0),this.containerBounds[3]=-F(C.left-(p?j(S,0,n):S)+$-g,0))}this.transforms.revert(),this.coords[2]=r,this.coords[3]=i,this.setX(t,!0),this.setY(s,!0)}isOutOfBounds(e,t,s){if(!this.contained)return 0;const[r,i,n,o]=e,[a,h]=this.disabled,u=!a&&t<o||!a&&t>i,p=!h&&s<r||!h&&s>n;return u&&!p?1:!u&&p?2:u&&p?3:0}refresh(){const e=this.parameters,t=e.x,s=e.y,r=Ge(e.container,this),i=Ge(e.containerPadding,this)||0,n=He(i)?i:[i,i,i,i],o=this.x,a=this.y,h=Ge(e.cursor,this),u={onHover:"grab",onGrab:"grabbing"};if(h){const{onHover:v,onGrab:b}=h;v&&(u.onHover=v),b&&(u.onGrab=b)}const p=Ge(e.dragThreshold,this),c={mouse:3,touch:7};if(Fe(p))c.mouse=p,c.touch=p;else if(p){const{mouse:v,touch:b}=p;B(v)||(c.mouse=v),B(b)||(c.touch=b)}this.containerArray=He(r)?r:null,this.$container=r&&!this.containerArray?rt(r)[0]:Q.body,this.useWin=this.$container===Q.body,this.$scrollContainer=this.useWin?Xe:this.$container,this.isFinePointer=matchMedia("(pointer:fine)").matches,this.containerPadding=U(n,[0,0,0,0]),this.containerFriction=j(U(Ge(e.containerFriction,this),.8),0,1),this.releaseContainerFriction=j(U(Ge(e.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=Ge(De(t)&&!B(t.snap)?t.snap:e.snap,this),this.snapY=Ge(De(s)&&!B(s.snap)?s.snap:e.snap,this),this.scrollSpeed=U(Ge(e.scrollSpeed,this),1.5),this.scrollThreshold=U(Ge(e.scrollThreshold,this),20),this.dragSpeed=U(Ge(e.dragSpeed,this),1),this.dragThreshold=this.isFinePointer?c.mouse:c.touch,this.minVelocity=U(Ge(e.minVelocity,this),0),this.maxVelocity=U(Ge(e.maxVelocity,this),50),this.velocityMultiplier=U(Ge(e.velocityMultiplier,this),1),this.cursor=h===!1?!1:u,this.updateBoundingValues();const[f,l,d,g]=this.containerBounds;this.setX(j(o,g,l),!0),this.setY(j(a,f,d),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[b,S,y,m]=this.containerPadding,[_,k]=this.scrollView,w=this.dragArea[2],A=this.dragArea[3],O=this.scroll.x,E=this.scroll.y,P=this.$container.scrollWidth,C=this.$container.scrollHeight,$=this.useWin?j(P,this.window[0],P):P,H=this.useWin?j(C,this.window[1],C):C,V=_-$,x=k-H;this.dragged&&V>0&&(this.coords[0]-=V,this.scrollView[0]=$),this.dragged&&x>0&&(this.coords[1]-=x,this.scrollView[1]=H);const M=this.scrollSpeed*10,I=this.scrollThreshold,[R,q]=this.coords,[J,G,W,ee]=this.scrollBounds,X=F(j((q-J+b)/I,-1,0)*M,0),oe=F(j((R-G-S)/I,0,1)*M,0),pe=F(j((q-W-y)/I,0,1)*M,0),ce=F(j((R-ee+m)/I,-1,0)*M,0);if(X||pe||ce||oe){const[ie,K]=this.disabled;let ae=O,xe=E;ie||(ae=F(j(O+(ce||oe),0,_-w),0),this.coords[0]-=O-ae),K||(xe=F(j(E+(X||pe),0,k-A),0),this.coords[1]-=E-xe),this.useWin?this.$scrollContainer.scrollBy(-(O-ae),-(E-xe)):this.$scrollContainer.scrollTo(ae,xe)}}const[e,t,s,r]=this.containerBounds,[i,n,o,a,h,u]=this.pointer;this.coords[0]+=(i-h)*this.dragSpeed,this.coords[1]+=(n-u)*this.dragSpeed,this.pointer[4]=i,this.pointer[5]=n;const[p,c]=this.coords,[f,l]=this.snapped,d=(1-this.containerFriction)*this.dragSpeed;this.setX(p>t?t+(p-t)*d:p<r?r+(p-r)*d:p,!1),this.setY(c>s?s+(c-s)*d:c<e?e+(c-e)*d:c,!1),this.computeVelocity(i-h,n-u),this.angle=Us(n-a,i-o);const[g,v]=this.snapped;(g!==f&&this.snapX||v!==l&&this.snapY)&&this.onSnap(this)}stop(){this.updateTicker.pause(),this.overshootTicker.pause();for(let e in this.animate.animations)this.animate.animations[e].pause();return wt([this],null,"x"),wt([this],null,"y"),wt([this],null,"progressX"),wt([this],null,"progressY"),wt([this.scroll]),wt([this.overshootCoords]),this}scrollInView(e,t=0,s=xt.inOutQuad){this.updateScrollCoords();const r=this.destX,i=this.destY,n=this.scroll,o=this.scrollBounds,a=this.canScroll;if(!this.containerArray&&this.isOutOfBounds(o,r,i)){const[h,u,p,c]=o,f=F(j(i-h,-mt,0),0),l=F(j(r-u,0,mt),0),d=F(j(i-p,0,mt),0),g=F(j(r-c,-mt,0),0);new Ct(n,{x:F(n.x+(g?g-t:l?l+t:0),0),y:F(n.y+(f?f-t:d?d+t:0),0),duration:B(e)?350*z.timeScale:e,ease:s,onUpdate:()=>{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then(()=>{this.canScroll=a})}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=Pt(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(e,t=0,s=xt.inOutQuad){this.stop(),this.updateBoundingValues();const r=this.x,i=this.y,[n,o,a,h]=this.containerPadding,u=this.scroll.y-this.targetBounds[0]+n+t,p=this.scroll.x-this.targetBounds[1]-o-t,c=this.scroll.y-this.targetBounds[2]-a-t,f=this.scroll.x-this.targetBounds[3]+h+t,l=this.isOutOfBounds([u,p,c,f],r,i);if(l){const[d,g]=this.disabled,v=j(Xt(r,this.snapX),f,p),b=j(Xt(i,this.snapY),u,c),S=B(e)?350*z.timeScale:e;!d&&(l===1||l===3)&&this.animate[this.xProp](v,S,s),!g&&(l===2||l===3)&&this.animate[this.yProp](b,S,s)}return this}handleDown(e){const t=e.target;if(this.grabbed||t.type==="range")return;e.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const s=e.changedTouches,r=s?s[0].clientX:e.clientX,i=s?s[0].clientY:e.clientY,{x:n,y:o}=this.transforms.normalizePoint(r,i),[a,h,u,p]=this.containerBounds,c=(1-this.containerFriction)*this.dragSpeed,f=this.x,l=this.y;this.coords[0]=this.coords[2]=c?f>h?h+(f-h)/c:f<p?p+(f-p)/c:f:f,this.coords[1]=this.coords[3]=c?l>u?u+(l-u)/c:l<a?a+(l-a)/c:l:l,this.pointer[0]=n,this.pointer[1]=o,this.pointer[2]=n,this.pointer[3]=o,this.pointer[4]=n,this.pointer[5]=o,this.pointer[6]=n,this.pointer[7]=o,this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null);const d=Ot(this.$target,"zIndex",!1);ir=(d>ir?d:ir)+1,this.targetStyles=Pt(this.$target,{zIndex:ir}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=Pt(Q.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,xt.out(3)),this.onGrab(this),Q.addEventListener("touchmove",this),Q.addEventListener("touchend",this),Q.addEventListener("touchcancel",this),Q.addEventListener("mousemove",this),Q.addEventListener("mouseup",this),Q.addEventListener("selectstart",this)}handleMove(e){if(!this.grabbed)return;const t=e.changedTouches,s=t?t[0].clientX:e.clientX,r=t?t[0].clientY:e.clientY,{x:i,y:n}=this.transforms.normalizePoint(s,r),o=i-this.pointer[6],a=n-this.pointer[7];let h=e.target,u=!1,p=!1,c=!1;for(;t&&h&&h!==this.$trigger;){const f=Ot(h,"overflow-y");if(f!=="hidden"&&f!=="visible"){const{scrollTop:l,scrollHeight:d,clientHeight:g}=h;if(d>g){c=!0,u=l<=3,p=l>=d-g-3;break}}h=h.parentElement}c&&(!u&&!p||u&&a<0||p&&a>0)?(this.pointer[0]=i,this.pointer[1]=n,this.pointer[2]=i,this.pointer[3]=n,this.pointer[4]=i,this.pointer[5]=n,this.pointer[6]=i,this.pointer[7]=n):(Nt(e),this.triggerStyles||(this.triggerStyles=Pt(this.$trigger,{pointerEvents:"none"})),this.$trigger.addEventListener("touchstart",Nt,{passive:!1}),this.$trigger.addEventListener("touchmove",Nt,{passive:!1}),this.$trigger.addEventListener("touchend",Nt),(this.dragged||!this.disabled[0]&<(o)>this.dragThreshold||!this.disabled[1]&<(a)>this.dragThreshold)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=i,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[e,t]=this.disabled,[s,r,i,n,o,a]=this.pointer,[h,u,p,c]=this.containerBounds,[f,l]=this.snapped,d=this.releaseXSpring,g=this.releaseYSpring,v=this.releaseEase,b=this.hasReleaseSpring,S=this.overshootCoords,y=this.x,m=this.y,_=this.computeVelocity(s-o,r-a),k=this.angle=Us(r-n,s-i),w=_*150,A=(1-this.releaseContainerFriction)*this.dragSpeed,O=y+Hr(k)*w,E=m+$r(k)*w,P=O>u?u+(O-u)*A:O<c?c+(O-c)*A:O,C=E>p?p+(E-p)*A:E<h?h+(E-h)*A:E,$=this.destX=j(F(Xt(P,this.snapX),5),c,u),H=this.destY=j(F(Xt(C,this.snapY),5),h,p),V=this.isOutOfBounds(this.containerBounds,O,E);let x=0,M=0,I=v,R=v,q=0;if(S.x=y,S.y=m,!e){const G=$===u?y>u?-1:1:y<c?-1:1,W=F(y-$,0);d.velocity=t&&b?W?w*G/lt(W):0:_;const{ease:ee,settlingDuration:X,restDuration:oe}=d;x=y===$?0:b?X:X-oe*z.timeScale,b&&(I=ee),x>q&&(q=x)}if(!t){const G=H===p?m>p?-1:1:m<h?-1:1,W=F(m-H,0);g.velocity=e&&b?W?w*G/lt(W):0:_;const{ease:ee,settlingDuration:X,restDuration:oe}=g;M=m===H?0:b?X:X-oe*z.timeScale,b&&(R=ee),M>q&&(q=M)}if(!b&&V&&A&&(x||M)){const G=$e.blend;new Ct(S,{x:{to:P,duration:x*.65},y:{to:C,duration:M*.65},ease:v,composition:G}).init(),new Ct(S,{x:{to:$,duration:x},y:{to:H,duration:M},ease:v,composition:G}).init(),this.overshootTicker.stretch(yn(x,M)).restart()}else e||this.animate[this.xProp]($,x,I),t||this.animate[this.yProp](H,M,R);this.scrollInView(q,this.scrollThreshold,v);let J=!1;$!==f&&(this.snapped[0]=$,this.snapX&&(J=!0)),H!==l&&this.snapY&&(this.snapped[1]=H,this.snapY&&(J=!0)),J&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener("touchstart",Nt),this.$trigger.removeEventListener("touchmove",Nt),this.$trigger.removeEventListener("touchend",Nt),Q.removeEventListener("touchmove",this),Q.removeEventListener("touchend",this),Q.removeEventListener("touchcancel",this),Q.removeEventListener("mousemove",this),Q.removeEventListener("mouseup",this),Q.removeEventListener("selectstart",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove("is-disabled"),this.touchActionStyles=Pt(this.$trigger,{touchAction:this.disabled[0]?"pan-x":this.disabled[1]?"pan-y":"none"}),this.$trigger.addEventListener("touchstart",this,{passive:!0}),this.$trigger.addEventListener("mousedown",this,{passive:!0}),this.$trigger.addEventListener("mouseenter",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.$target.classList.add("is-disabled"),this.$trigger.removeEventListener("touchstart",this),this.$trigger.removeEventListener("mousedown",this),this.$trigger.removeEventListener("mouseenter",this),Q.removeEventListener("touchmove",this),Q.removeEventListener("touchend",this),Q.removeEventListener("touchcancel",this),Q.removeEventListener("mousemove",this),Q.removeEventListener("mouseup",this),Q.removeEventListener("selectstart",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove("is-disabled"),this.updateTicker.revert(),this.overshootTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this.resizeObserver.disconnect(),this}handleEvent(e){switch(e.type){case"mousedown":this.handleDown(e);break;case"touchstart":this.handleDown(e);break;case"mousemove":this.handleMove(e);break;case"touchmove":this.handleMove(e);break;case"mouseup":this.handleUp();break;case"touchend":this.handleUp();break;case"touchcancel":this.handleUp();break;case"mouseenter":this.handleHover();break;case"selectstart":Nt(e)}}},$c=(e,t)=>new Yn(e,t),ti=(e=ne)=>new st({duration:1*z.timeScale,onComplete:e},null,0).resume(),nr=e=>{let t;return((...s)=>{let r,i,n,o,a;t&&(r=t.currentIteration,i=t.iterationProgress,n=t.reversed,o=t._alternate,a=t._startTime,t.revert());const h=e(...s);return h&&!Ae(h)&&h.revert&&(t=h),B(i)||(t.currentIteration=r,t.iterationProgress=(o&&r%2?!n:n)?1-i:i,t._startTime=a),h||ne})},Gn=class{constructor(e={}){Ie.current&&Ie.current.register(this);const t=e.root;let s=Q;t&&(s=t.current||t.nativeElement||rt(t)[0]||Q);const r=e.defaults,i=z.defaults,n=e.mediaQueries;if(this.defaults=r?ct(r,i):i,this.root=s,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.constructorsOnce=[],this.revertConstructorsOnce=[],this.revertiblesOnce=[],this.once=!1,this.onceIndex=0,this.methods={},this.matches={},this.mediaQueryLists={},this.data={},n)for(let o in n){const a=Xe.matchMedia(n[o]);this.mediaQueryLists[o]=a,a.addEventListener("change",this)}}register(e){(this.once?this.revertiblesOnce:this.revertibles).push(e)}execute(e){let t=Ie.current,s=Ie.root,r=z.defaults;Ie.current=this,Ie.root=this.root,z.defaults=this.defaults;const i=this.mediaQueryLists;for(let o in i)this.matches[o]=i[o].matches;const n=e(this);return Ie.current=t,Ie.root=s,z.defaults=r,n}refresh(){return this.onceIndex=0,this.execute(()=>{let e=this.revertibles.length,t=this.revertConstructors.length;for(;e--;)this.revertibles[e].revert();for(;t--;)this.revertConstructors[t](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach(s=>{const r=s(this);Ae(r)&&this.revertConstructors.push(r)})}),this}add(e,t){if(this.once=!1,Ae(e)){const s=e;this.constructors.push(s),this.execute(()=>{const r=s(this);Ae(r)&&this.revertConstructors.push(r)})}else this.methods[e]=(...s)=>this.execute(()=>t(...s));return this}addOnce(e){if(this.once=!0,Ae(e)){const t=this.onceIndex++;if(this.constructorsOnce[t])return this;const s=e;this.constructorsOnce[t]=s,this.execute(()=>{const r=s(this);Ae(r)&&this.revertConstructorsOnce.push(r)})}return this}keepTime(e){this.once=!0;const t=this.onceIndex++,s=this.constructorsOnce[t];if(Ae(s))return s(this);const r=nr(e);this.constructorsOnce[t]=r;let i;return this.execute(()=>{i=r(this)}),i}handleEvent(e){e.type==="change"&&this.refresh()}revert(){const e=this.revertibles,t=this.revertConstructors,s=this.revertiblesOnce,r=this.revertConstructorsOnce,i=this.mediaQueryLists;let n=e.length,o=t.length,a=s.length,h=r.length;for(;n--;)e[n].revert();for(;o--;)t[o](this);for(;a--;)s[a].revert();for(;h--;)r[h](this);for(let u in i)i[u].removeEventListener("change",this);e.length=0,t.length=0,this.constructors.length=0,s.length=0,r.length=0,this.constructorsOnce.length=0,this.onceIndex=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}},Hc=e=>new Gn(e),qc=()=>{const e=Q.createElement("div");Q.body.appendChild(e),e.style.height="100lvh";const t=e.offsetHeight;return Q.body.removeChild(e),t},or=(e,t)=>e&&Ae(e)?e(t):e,ar=new Map,Fc=class{constructor(e){this.element=e,this.useWin=this.element===Q.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.scale=1,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new st({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;ke(this,s=>s.handleScroll(),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new st({autoplay:!1,frameRate:30,onUpdate:t=>{const s=t.deltaTime,r=this.prevScrollX,i=this.prevScrollY,n=this.scrollX,o=this.scrollY,a=r-n,h=i-o;this.prevScrollX=n,this.prevScrollY=o,a&&(this.backwardX=r>n),h&&(this.backwardY=i>o),this.velocity=F(s>0?Math.sqrt(a*a+h*h)/s:0,5)}}).init(),this.resizeTicker=new st({autoplay:!1,duration:250*z.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new st({autoplay:!1,duration:500*z.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver(()=>this.resizeTicker.restart()),this.resizeObserver.observe(this.element),(this.useWin?Xe:this.element).addEventListener("scroll",this,!1)}updateScrollCoords(){const e=this.useWin,t=this.element;this.scrollX=F(e?Xe.scrollX:t.scrollLeft,0),this.scrollY=F(e?Xe.scrollY:t.scrollTop,0)}updateWindowBounds(){this.winWidth=Xe.innerWidth,this.winHeight=qc()}updateBounds(){const e=getComputedStyle(this.element),t=this.element;this.scrollWidth=t.scrollWidth+parseFloat(e.marginLeft)+parseFloat(e.marginRight),this.scrollHeight=t.scrollHeight+parseFloat(e.marginTop)+parseFloat(e.marginBottom),this.updateWindowBounds();let s,r;if(this.useWin)s=this.winWidth,r=this.winHeight;else{const i=t.getBoundingClientRect();s=t.clientWidth,r=t.clientHeight,this.top=i.top,this.left=i.left,this.scale=i.width?s/i.width:i.height?r/i.height:1}this.width=s,this.height=r}refreshScrollObservers(){ke(this,e=>{e.ready&&e._debug&&e.removeDebug()}),this.updateBounds(),ke(this,e=>{e.ready&&(e.refresh(),e.onResize(e),e._debug&&e.debug())})}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(e){e.type==="scroll"&&this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.disconnect(),(this.useWin?Xe:this.element).removeEventListener("scroll",this),ar.delete(this.element)}},Vc=e=>{const t=e&&rt(e)[0]||Q.body;let s=ar.get(t);return s||(s=new Fc(t),ar.set(t,s)),s},Ss=(e,t,s,r,i)=>{const n=t==="min",o=t==="max",{n:a,u:h}=Qe(t==="top"||t==="left"||t==="start"||n?0:t==="bottom"||t==="right"||t==="end"||o?"100%":t==="center"?"50%":t,Ve);let u=a;return h==="%"?u=a/100*s:h&&(u=js(e,Ve,"px",!0).n),o&&r<0&&(u+=r),n&&i>0&&(u+=i),u},lr=(e,t,s,r,i)=>{let n;if(Be(t)){const o=fn.exec(t);if(o){const a=o[0],h=a[0],u=t.split(a),p=u[0]==="min",c=u[0]==="max",f=Ss(e,u[0],s,r,i),l=Ss(e,u[1],s,r,i);if(p){const d=Gt(Ss(e,"min",s),l,h);n=d<f?f:d}else if(c){const d=Gt(Ss(e,"max",s),l,h);n=d>f?f:d}else n=Gt(f,l,h)}else n=Ss(e,t,s,r,i)}else n=t;return F(n,0)},Zn=e=>{let t;const s=e.targets;for(let r=0,i=s.length;r<i;r++){const n=s[r];if(n[Ft]){t=n;break}}return t},zc=0,jn=["#FF4B4B","#FF971B","#FFC730","#F9F640","#7AFF5A","#18FF74","#17E09B","#3CFFEC","#05DBE9","#33B3F1","#638CF9","#C563FE","#FF4FCF","#F93F8A"],Qn=class{constructor(e={}){Ie.current&&Ie.current.register(this);const t=U(e.sync,"play pause"),s=t?Tt(t):null,r=t&&(t==="linear"||t===it),i=t&&!(s===it&&!r),n=t&&(Fe(t)||t===!0||r),o=t&&Be(t)&&!i&&!n,a=o?t.split(" ").map(u=>()=>{const p=this.linked;return p&&p[u]?p[u]():null}):null,h=o&&a.length>2;this.index=zc++,this.id=B(e.id)?this.index:e.id,this.container=Vc(e.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=i||n||!!a,this.syncEase=i?s:null,this.syncSmooth=n?t===!0||r?1:t:null,this.onSyncEnter=a&&!h&&a[0]?a[0]:ne,this.onSyncLeave=a&&!h&&a[1]?a[1]:ne,this.onSyncEnterForward=a&&h&&a[0]?a[0]:ne,this.onSyncLeaveForward=a&&h&&a[1]?a[1]:ne,this.onSyncEnterBackward=a&&h&&a[2]?a[2]:ne,this.onSyncLeaveBackward=a&&h&&a[3]?a[3]:ne,this.onEnter=e.onEnter||ne,this.onLeave=e.onLeave||ne,this.onEnterForward=e.onEnterForward||ne,this.onLeaveForward=e.onLeaveForward||ne,this.onEnterBackward=e.onEnterBackward||ne,this.onLeaveBackward=e.onLeaveBackward||ne,this.onUpdate=e.onUpdate||ne,this.onResize=e.onResize||ne,this.onSyncComplete=e.onSyncComplete||ne,this.reverted=!1,this.ready=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=["start","end","end","start"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=e,this._debug=U(e.debug,!1),this._next=null,this._prev=null,yt(this.container,this),ti(()=>{if(!this.reverted){if(!this.target){const u=rt(e.target)[0];this.target=u||Q.body,this.refresh()}this._debug&&this.debug()}})}link(e){if(e&&(e.pause(),this.linked=e,!B(e)&&!B(e.persist)&&(e.persist=!0),!this._params.target)){let t;B(e.targets)?ke(e,s=>{s.targets&&!t&&(t=Zn(s))}):t=Zn(e),this.target=t||Q.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const e=(this.scroll-this.offsetStart)/this.distance;return e===1/0||isNaN(e)?0:F(j(e,0,1),6)}refresh(){this.ready=!0,this.reverted=!1;const e=this._params;return this.repeat=U(or(e.repeat,this),!0),this.horizontal=U(or(e.axis,this),"y")==="x",this.enter=U(or(e.enter,this),"end start"),this.leave=U(or(e.leave,this),"start end"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const e=this.container,t=this.horizontal,s=e.element.querySelector(":scope > .animejs-onscroll-debug"),r=Q.createElement("div"),i=Q.createElement("div"),n=Q.createElement("div"),o=jn[this.index%jn.length],a=e.useWin,h=a?e.winWidth:e.width,u=a?e.winHeight:e.height,p=e.scrollWidth,c=e.scrollHeight,f=this.container.width>360?320:260,l=t?0:10,d=t?10:0,g=t?24:f/2,v=t?g:15,b=t?60:g,S=t?b:v,y=t?"repeat-x":"repeat-y",m=A=>t?"0px "+A+"px":A+"px 2px",_=A=>`linear-gradient(${t?90:0}deg, ${A} 2px, transparent 1px)`,k=(A,O,E,P,C)=>`position:${A};left:${O}px;top:${E}px;width:${P}px;height:${C}px;`;r.style.cssText=`${k("absolute",l,d,t?p:f,t?f:c)}
|
|
1535
|
+
`)?"div":"span";return new He.default.SafeString(`<${h} class="squiffy-animate"${u}></${h}>`)})},onWrite(r){s(r)},onLoad(){s(e.outputElement)}}}var sr={ReplaceLabel:th,RotateSequencePlugin:sh,RandomPlugin:rh,LivePlugin:ih,AnimatePlugin:oh},ah=class{constructor(){this.linkHandlers={}}registerLinkHandler(e,t){this.linkHandlers[e]=t}handleLink(e){const t=e.getAttribute("data-handler")||"",s=this.linkHandlers[t];return s?[!0,t,s(e)]:[!1,t,{}]}},jt=typeof window<"u",ht=jt?window:null,ee=jt?document:null,We={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},Se={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},St={NONE:0,AUTO:1,FORCE:2},et={replace:0,none:1,blend:2},$o=Symbol(),Ss=Symbol(),ji=Symbol(),rr=Symbol(),Do=Symbol(),je=1e-11,Bt=1e12,dt=1e3,Tf="var(",Rr=[],Gi=(()=>{const e=new Map;return e.set("x","translateX"),e.set("y","translateY"),e.set("z","translateZ"),e})(),_s=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],qo=_s.reduce((e,t)=>({...e,[t]:t+"("}),{}),ae=()=>{},lh=e=>e,ch=/\)\s*[-.\d]/,uh=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,hh=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,dh=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,fh=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,ph=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Bo=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,Ho=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,gh=/([a-z])([A-Z])/g,Fo=/(\*=|\+=|-=)/,mh=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,ir={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:dt,delay:0,loopDelay:0,ease:"out(2)",composition:et.replace,modifier:lh,onBegin:ae,onBeforeUpdate:ae,onUpdate:ae,onLoop:ae,onPause:ae,onComplete:ae,onRender:ae},Ge={current:null,root:ee},X={defaults:ir,precision:4,timeScale:1,tickThreshold:200,editor:null},Vo={version:"4.5.0",engine:null};jt&&(ht.AnimeJS||(ht.AnimeJS=[]),ht.AnimeJS.push(Vo));var Or=e=>e.replace(gh,"$1-$2").toLowerCase(),Ze=(e,t)=>e.indexOf(t)===0,ns=Date.now,tt=Array.isArray,Je=e=>e&&e.constructor===Object,st=e=>typeof e=="number"&&!isNaN(e),Ke=e=>typeof e=="string",Ve=e=>typeof e=="function",W=e=>typeof e>"u",ws=e=>W(e)||e===null,Ir=e=>jt&&e instanceof SVGElement,zo=e=>uh.test(e),Uo=e=>Ze(e,"rgb"),Wo=e=>Ze(e,"hsl"),vh=e=>zo(e)||(Uo(e)||Wo(e))&&(e[e.length-1]===")"||!ch.test(e)),Ds=e=>!X.defaults.hasOwnProperty(e),yh=["opacity","rotate","overflow","color"],bh=(e,t)=>{if(yh.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t==="scale"){const s=e.parentNode;return s&&s.tagName==="filter"}return!0}},ks=e=>Ke(e)?parseFloat(e):e,xs=Math.pow,Et=Math.sqrt,Xi=Math.sin,Yi=Math.cos,At=Math.abs,Mr=Math.exp,Sh=Math.ceil,qs=Math.floor,_h=Math.asin,jo=Math.max,Nr=Math.atan2,Gt=Math.PI,Zi=Math.round,Q=(e,t,s)=>e<t?t:e>s?s:e,G=(e,t)=>{if(t<0)return e;if(!t)return Zi(e);const s=10**t;return Zi(e*s)/s},Ts=(e,t)=>tt(t)?t.reduce((s,r)=>At(r-e)<At(s-e)?r:s):t?Zi(e/t)*t:e,os=(e,t,s)=>s===1?t:s===0?e:e+(t-e)*s,$r=e=>e===1/0?Bt:e===-1/0?-Bt:e,Bs=e=>e<=1e-11?je:$r(G(e,11)),at=e=>tt(e)?[...e]:e,Pt=(e,t)=>{const s={...e};for(let r in t){const i=e[r];s[r]=W(i)?t[r]:i}return s},Pe=(e,t,s,r="_prev",i="_next")=>{let n=e._head,o=i;for(s&&(n=e._tail,o=r);n;){const c=n[o];t(n),n=c}},Ht=(e,t,s="_prev",r="_next")=>{const i=t[s],n=t[r];i?i[r]=n:e._head=n,n?n[s]=i:e._tail=i,t[s]=null,t[r]=null},Ft=(e,t,s,r="_prev",i="_next")=>{let n=e._tail;for(;n&&s&&s(n,t);)n=n[r];const o=n?n[i]:e._head;n?n[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=n,t[i]=o},wh=(e,t,s)=>{const r=e.style.transform;if(r){const i=e[rr];let n=0;const o=r.length;let c;for(;n<o;){for(;n<o&&r.charCodeAt(n)===32;)n++;if(n>=o)break;const h=n;for(;n<o&&r.charCodeAt(n)!==40;)n++;if(n>=o)break;const d=r.substring(h,n);let a=1;const f=n+1;let l=-1,p=-1;for(n++;n<o&&a>0;){const v=r.charCodeAt(n);v===40?a++:v===41?a--:v===44&&a===1&&(l===-1?l=n:p===-1&&(p=n)),n++}const g=n-1;d==="translate"||d==="translate3d"?(l===-1?i.translateX=r.substring(f,g).trim():(i.translateX=r.substring(f,l).trim(),p===-1?i.translateY=r.substring(l+1,g).trim():(i.translateY=r.substring(l+1,p).trim(),i.translateZ=r.substring(p+1,g).trim())),c=r.substring(f,g)):d==="scale"||d==="scale3d"?l===-1?i.scale=r.substring(f,g).trim():(i.scaleX=r.substring(f,l).trim(),p===-1?i.scaleY=r.substring(l+1,g).trim():(i.scaleY=r.substring(l+1,p).trim(),i.scaleZ=r.substring(p+1,g).trim())):i[d]=r.substring(f,g)}if(t==="translate3d"&&c)return s&&(s[t]=c),c;const u=i[t];if(!W(u))return s&&(s[t]=u),u}return t==="translate3d"?"0px, 0px, 0px":t==="rotate3d"?"0, 0, 0, 0deg":Ze(t,"scale")?"1":Ze(t,"rotate")||Ze(t,"skew")?"0deg":"0px"},Go=e=>{let t="";for(let s=0,r=_s.length;s<r;s++){const i=_s[s],n=e[i];if(n!==void 0){if(i==="translateX"){const o=e.translateY;if(o!==void 0){const c=e.translateZ;c!==void 0?(t+=`translate3d(${n},${o},${c}) `,s+=2):(t+=`translate(${n},${o}) `,s+=1);continue}}if(i==="scaleX"&&e.scale===void 0){const o=e.scaleY;if(o!==void 0){const c=e.scaleZ;c!==void 0?(t+=`scale3d(${n},${o},${c}) `,s+=2):(t+=`scale(${n},${o}) `,s+=1);continue}}t+=`${qo[i]}${n}) `}i==="rotateZ"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Ji=[];function Xo(e,t){if(!e)return null;const s=Ji.length;e:for(let r=0;r<s;r++){const i=Ji[r];if(i.detect&&!i.detect(e))continue;const n=i.targetAdapters;for(let o=0,c=n.length;o<c;o++){const u=n[o];if(u.detect(e)){const h=u.props[t];if(h&&(!h.gate||h.gate(e)))return h;break e}}}for(let r=0;r<s;r++){const i=Ji[r];if(i.detect&&!i.detect(e))continue;const n=i.propertyResolvers;for(let o=0,c=n.length;o<c;o++){const u=n[o](e,t);if(u)return u}}return null}var kh=e=>{const t=hh.exec(e)||dh.exec(e),s=W(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],s]},xh=e=>{const t=e.length,s=t===4||t===5;return[+("0x"+e[1]+e[s?1:2]),+("0x"+e[s?2:3]+e[s?2:4]),+("0x"+e[s?3:5]+e[s?3:6]),t===5||t===9?+(+("0x"+e[s?4:7]+e[s?4:8])/255).toFixed(3):1]},Ki=(e,t,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e),Th=e=>{const t=fh.exec(e)||ph.exec(e),s=+t[1]/360,r=+t[2]/100,i=+t[3]/100,n=W(t[4])?1:+t[4];let o,c,u;if(r===0)o=c=u=i;else{const h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;o=G(Ki(d,h,s+1/3)*255,0),c=G(Ki(d,h,s)*255,0),u=G(Ki(d,h,s-1/3)*255,0)}return[o,c,u,n]},Ch=e=>Uo(e)?kh(e):zo(e)?xh(e):Wo(e)?Th(e):[0,0,0,1],Y=(e,t)=>W(e)?t:e,Yo=(e,t)=>{const s=e.match(mh),r=t[Ss]?t:document.documentElement;let i=getComputedStyle(r)?.getPropertyValue(s[1]);return(!i||i.trim()==="")&&s[2]&&(i=s[2].trim()),i||0},Ye=(e,t,s,r,i,n)=>{if(Ve(e)){if(!i){const c=e(t,s,r,n);return isNaN(+c)?c||0:+c}const o=()=>{const c=e(t,s,r,n);return isNaN(+c)?c||0:+c};return i.func=o,o()}if(Ke(e)&&Ze(e,"var(")){if(!i)return Yo(e,t);const o=()=>Yo(e,t);return i.func=o,o()}return e},Qi=(e,t)=>e[Ss]?e[ji]&&bh(e,t)?We.ATTRIBUTE:_s.includes(t)||Gi.get(t)?We.TRANSFORM:Ze(t,"--")?We.CSS_VAR:t in e.style?We.CSS:t in e?We.OBJECT:We.ATTRIBUTE:We.OBJECT,Zo=(e,t,s)=>{const r=e.style[t];r&&s&&(s[t]=r);const i=r||getComputedStyle(e[Do]||e).getPropertyValue(t);return i==="auto"?"0":i},Cs=(e,t,s,r)=>{const i=W(s)?Qi(e,t):s,n=Xo(e,t);if(n){const o=n.get(e);return o&&r&&(r[t]=o),o??0}if(i===We.OBJECT){const o=e[t];return o&&r&&(r[t]=o),o||0}if(i===We.ATTRIBUTE){const o=e.getAttribute(t);return o&&r&&(r[t]=o),o}return i===We.TRANSFORM?wh(e,t,r):i===We.CSS_VAR?Zo(e,t,r).trimStart():Zo(e,t,r)},Es=(e,t,s)=>s==="-"?e-t:s==="+"?e+t:e*t,en=()=>({t:Se.NUMBER,n:0,u:null,o:null,d:null,s:null}),gt=(e,t)=>{if(t.t=Se.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const s=+e;if(!isNaN(s))return t.n=s,t;let r=e;r[1]==="="&&(t.o=r[0],r=r.slice(2));const i=r.includes(" ")?!1:Ho.exec(r);if(i)return t.t=Se.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(vh(r))return t.t=Se.COLOR,t.d=Ch(r),t;{const n=r.match(Bo);return t.t=Se.COMPLEX,t.d=n?n.map(Number):[],t.s=r.split(Bo)||[],t}},Jo=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=at(e._toNumbers),t.s=at(e._strings),t),rt=en(),Ko=(e,t,s)=>{const r=e._modifier,i=e._fromNumbers,n=e._toNumbers,o=e._strings;let c=o[0];for(let u=0,h=n.length;u<h;u++){const d=r(G(os(i[u],n[u],t),s)),a=o[u+1];c+=`${a?d+a:d}`,e._numbers[u]=d}return c},Dr=(e,t,s,r,i)=>{const n=e.parent,o=e.duration,c=e.completed,u=e.iterationDuration,h=e.iterationCount,d=e._currentIteration,a=e._loopDelay,f=e._reversed,l=e._alternate,p=e._hasChildren,g=e._delay,v=e._currentTime,S=g+u,w=t-g,y=Q(v,-g,o),m=Q(w,-g,o),_=w-v,C=m>0,R=m>=o,b=o<=je,x=i===St.FORCE;let T=0,A=w,L=0;if(h>1){const M=u+(R?0:a),O=~~(m/M);e._currentIteration=Q(O,0,h),R&&e._currentIteration--,T=e._currentIteration%2,A=m-O*M||0}const D=f^(l&&T),B=e._ease;let F=R?D?0:o:D?u-A:A;B&&(F=u*B(F/u)||0);const P=(n?n.backwards:w<v)?!D:!!D;if(e._currentTime=w,e._iterationTime=F,e.backwards=P,C&&!e.began?(e.began=!0,!s&&!(n&&(P||!n.began))&&e.onBegin(e)):w<=0&&(e.began=!1),!s&&!p&&C&&e._currentIteration!==d&&e.onLoop(e),x||i===St.AUTO&&(t>=(n&&g>0?0:g)&&t<=S||t<=g&&y>g||t>=S&&y!==o)||F>=S&&y!==o||F<=g&&y>0&&!R||t<=y&&y===o&&c||R&&!c&&b){if(C&&(e.computeDeltaTime(y),s||e.onBeforeUpdate(e)),!p){const M=x||(P?_*-1:_)>=X.tickThreshold,O=G(e._offset+(n?n._offset:0)+g+F,12);let I=e._head,$,H,V,z,Z=0;for(;I;){const K=I._composition,se=I._currentTime,ve=I._changeDuration,ye=I._absoluteStartTime+I._changeDuration,le=I._nextRep,te=I._prevRep,ie=K!==et.none,Le=te?te._absoluteStartTime+te._changeDuration:0,xe=te&&te.parent!==I.parent,Ie=!le||le._isOverridden?ye:le.parent===I.parent?ye+le._delay:le._absoluteStartTime<le._absoluteUpdateStartTime?le._absoluteStartTime:le._absoluteUpdateStartTime;if((M||(se!==ve||O<=Ie||te&&!xe&&(!le||le.parent!==I.parent))&&(se!==0||O>=I._absoluteStartTime||xe&&!I._hasFromValue&&!te._isOverridden&&O>=Le||le&&!le._isOverridden&&le.parent===I.parent&&le._currentTime!==0&&F<le._startTime))&&(!te||xe||F>=I._startTime)&&(!ie||!I._isOverridden&&(!I._isOverlapped||O<=ye)&&(!le||le._isOverridden||O<=Ie)&&(!te||te._isOverridden||(xe?O>=I._absoluteStartTime||!I._hasFromValue&&O>=Le:O>=Le+I._delay)))){const $e=I._currentTime=Q(F-I._startTime,0,ve),we=I._ease($e/I._updateDuration),Re=I._modifier,Te=I._valueType,Me=I._tweenType,ke=Me===We.OBJECT,oe=Te===Se.NUMBER,Ce=oe&&ke||we===0||we===1?-1:X.precision;let _e,Oe;if(oe)_e=Oe=Re(G(os(I._fromNumber,I._toNumber,we),Ce));else if(Te===Se.UNIT)Oe=Re(G(os(I._fromNumber,I._toNumber,we),Ce)),_e=`${Oe}${I._unit}`;else if(Te===Se.COLOR){const U=I._numbers,ce=I._fromNumbers,ue=I._toNumbers,he=1-we,ze=ce[0],De=ce[1],xt=ce[2],vt=ue[0],hs=ue[1],Xe=ue[2];U[0]=Re(Math.sqrt(ze*ze*he+vt*vt*we)),U[1]=Re(Math.sqrt(De*De*he+hs*hs*we)),U[2]=Re(Math.sqrt(xt*xt*he+Xe*Xe*we)),U[3]=Re(os(ce[3],ue[3],we)),(!I._setter||r)&&(_e=`rgba(${G(U[0],0)},${G(U[1],0)},${G(U[2],0)},${U[3]})`)}else Te===Se.COMPLEX&&(_e=Ko(I,we,Ce));if(ie&&(I._number=Oe),!r&&K!==et.blend){const U=I.property;$=I.target,I._setter?I._setter($,Oe,I):ke?$[U]=_e:Me===We.ATTRIBUTE?$.setAttribute(U,_e):(H=$.style,Me===We.TRANSFORM?($!==V&&(V=$,z=$[rr]),z[U]=_e,Z=1):Me===We.CSS?H[U]=_e:Me===We.CSS_VAR&&H.setProperty(U,_e)),C&&(L=1)}else I._value=_e}else se&&te&&!xe&&F<I._startTime&&(I._currentTime=0);Z&&I._renderTransforms&&(H.transform=Go(z),Z=0),I=I._next}!s&&L&&e.onRender(e)}!s&&C&&e.onUpdate(e)}return n&&b?!s&&(n.began&&!P&&w>0&&!c||P&&w<=1e-11&&c)&&(e.onComplete(e),e.completed=!P):C&&R?h===1/0?e._startTime+=e.duration:e._currentIteration>=h-1&&(e.paused=!0,!c&&!p&&(e.completed=!0,!s&&!(n&&(P||!n.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,L},As=(e,t,s,r,i)=>{const n=e._currentIteration;if(Dr(e,t,s,r,i),e._hasChildren){const o=e,c=o.backwards,u=r?t:o._iterationTime,h=ns();let d=0,a=!0;if(!r&&o._currentIteration!==n){const f=o.iterationDuration;Pe(o,l=>{if(!c)!l.completed&&!l.backwards&&l._currentTime<l.iterationDuration&&Dr(l,f,s,1,St.FORCE),l.began=!1,l.completed=!1;else{const p=l.duration,g=l._offset+l._delay,v=g+p;!s&&p<=1e-11&&(!g||v===f)&&l.onComplete(l)}}),s||o.onLoop(o)}Pe(o,f=>{const l=G((u-f._offset)*f._speed,12);if(c&&l>f._delay+f.duration)return;const p=f._fps<o._fps?f.requestTick(h):i;d+=Dr(f,l,s,r,p),!f.completed&&a&&(a=!1)},c),!s&&d&&o.onRender(o),(a||c)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},Qo={},tn=(e,t,s)=>{if(s===We.TRANSFORM){const r=Gi.get(e);return r||e}else if(s===We.CSS||s===We.ATTRIBUTE&&Ir(t)&&e in t.style){const r=Qo[e];if(r)return r;{const i=e&&Or(e);return Qo[e]=i,i}}else return e},qr=(e,t=!1)=>{if(e._hasChildren)Pe(e,s=>qr(s,t),!0);else{const s=e;s.pause(),Pe(s,r=>{const i=r.property,n=r.target,o=r._tweenType,c=r._inlineValue,u=ws(c)||c==="";if(r._setter){if(!t&&!u){if(gt(c,rt),rt.d){const h=rt.d,d=r._numbers;for(let a=0,f=h.length;a<f;a++)d[a]=h[a]}else r._number=rt.n;r._setter(r.target,r._number,r)}}else if(o===We.OBJECT)!t&&!u&&(n[i]=c);else if(n[Ss])if(o===We.ATTRIBUTE)t||(u?n.removeAttribute(i):n.setAttribute(i,c));else{const h=n.style;if(o===We.TRANSFORM){const d=n[rr];u?delete d[i]:d[i]=c,r._renderTransforms&&(Object.keys(d).length?h.transform=Go(d):h.removeProperty("transform"))}else u?h.removeProperty(Or(i)):h[i]=c}n[Ss]&&s._tail===r&&s.targets.forEach(h=>{h.getAttribute&&h.getAttribute("style")===""&&h.removeAttribute("style")})})}return e},ea=e=>qr(e,!0),ta=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=dt/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){const t=+e,s=t<1e-11?je:t,r=dt/s;s>ir.frameRate&&(ir.frameRate=s),this._fps=s,this._frameDuration=r}get speed(){return this._speed}set speed(e){const t=+e;this._speed=t<1e-11?je:t}requestTick(e){const t=this._frameDuration,s=e-this._lastTickTime,r=t*.25;return s+(r<4?r:4)<t?St.NONE:(this._lastTickTime=s>=t?e-s%t:e,St.AUTO)}computeDeltaTime(e){const t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Hs={animation:null,update:ae},Eh=e=>{let t=Hs.animation;return t||(t={duration:je,computeDeltaTime:ae,_offset:0,_delay:0,_head:null,_tail:null},Hs.animation=t,Hs.update=()=>{e.forEach(s=>{for(let r in s){const i=s[r],n=i._head;if(n){const o=n._valueType,c=o===Se.COMPLEX||o===Se.COLOR?at(n._fromNumbers):null;let u=n._fromNumber,h=i._tail;for(;h&&h!==n;){if(c)for(let d=0,a=h._numbers.length;d<a;d++)c[d]+=h._numbers[d];else u+=h._number;h=h._prevAdd}n._toNumber=u,n._toNumbers=c}}}),Dr(t,1,1,0,St.FORCE)}),t},sa=jt?requestAnimationFrame:setImmediate,Ah=jt?cancelAnimationFrame:clearImmediate,Ph=class extends ta{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=ir,this.paused=!0,this.reqId=0}update(){const e=this._currentTime=ns();if(this.requestTick(e)){this.computeDeltaTime(e);const t=this._speed,s=this._fps;let r=this._head;for(;r;){const i=r._next;r.paused?(Ht(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):As(r,(e-r._startTime)*r._speed*t,0,0,r._fps<s?r.requestTick(e):St.AUTO),r=i}Hs.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(ns()),this.reqId=sa(ra)),this}pause(){if(this.reqId)return this.paused=!0,Lh()}resume(){if(this.paused)return this.paused=!1,Pe(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(X.timeScale===1?1:dt)}set speed(e){const t=e*X.timeScale;this._speed!==t&&(this._speed=t,Pe(this,s=>s.speed=s._speed))}get timeUnit(){return X.timeScale===1?"ms":"s"}set timeUnit(e){const s=e==="s",r=s?.001:1;if(X.timeScale!==r){X.timeScale=r,X.tickThreshold=200*r;const i=s?.001:dt;this.defaults.duration*=i,this._speed*=i}}get precision(){return X.precision}set precision(e){X.precision=e}},it=(()=>{const e=new Ph(ns());return jt&&(Vo.engine=e,ee.addEventListener("visibilitychange",()=>{e.pauseOnDocumentHidden&&(ee.hidden?e.pause():e.resume())})),e})(),ra=()=>{it._head?(it.reqId=sa(ra),it.update()):it.reqId=0},Lh=()=>(Ah(it.reqId),it.reqId=0,it),Br={_rep:new WeakMap,_add:new Map},sn=(e,t,s="_rep")=>{const r=Br[s];let i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},Rh=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Hr=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=je,e._currentTime=je},ia=(e,t)=>{const s=e._composition;if(s===et.replace){const r=e._absoluteStartTime;Ft(t,e,Rh,"_prevRep","_nextRep");const i=e._prevRep;if(i){const n=i.parent,o=i._absoluteEndTime;if(e.parent.id!==n.id&&n.iterationCount>1&&o+(n.duration-n.iterationDuration)>r){Hr(i);let h=i._prevRep;for(;h&&h.parent.id===n.id;)Hr(h),h=h._prevRep}const c=e._absoluteUpdateStartTime;if(o>c){const h=i._startTime,d=o-(h+i._updateDuration),a=G(c-d-h,12);i._changeDuration=a,i._currentTime=a,i._isOverlapped=1,a<1e-11&&Hr(i)}const u=e.parent.parent;if(!u||u!==n.parent){let h=!0;if(Pe(n,d=>{d._isOverlapped||(h=!1)}),h){const d=n.parent;if(d){let a=!0;Pe(d,f=>{f!==n&&Pe(f,l=>{l._isOverlapped||(a=!1)})}),a&&d.cancel()}else n.cancel()}}}}else if(s===et.blend){const r=sn(e.target,e.property,"_add"),i=Eh(Br._add);let n=r._head;n||(n={...e},n._composition=et.replace,n._updateDuration=je,n._startTime=0,n._numbers=at(e._fromNumbers),n._number=0,n._next=null,n._prev=null,Ft(r,n),Ft(i,n));const o=e._toNumber;if(e._fromNumber=n._fromNumber-o,e._toNumber=0,e._numbers=at(e._fromNumbers),e._number=0,n._fromNumber=o,e._toNumbers.length){const c=at(e._toNumbers);c.forEach((u,h)=>{e._fromNumbers[h]=n._fromNumbers[h]-u,e._toNumbers[h]=0}),n._fromNumbers=c}Ft(r,e,null,"_prevAdd","_nextAdd")}return e},na=e=>{const t=e._composition;if(t!==et.none){const s=e.target,r=e.property,i=Br._rep.get(s)[r];if(Ht(i,e,"_prevRep","_nextRep"),t===et.blend){const n=Br._add,o=n.get(s);if(!o)return;const c=o[r],u=Hs.animation;Ht(c,e,"_prevAdd","_nextAdd");const h=c._head;if(h&&h===c._tail){Ht(c,h,"_prevAdd","_nextAdd"),Ht(u,h);let d=!0;for(let a in o)if(o[a]._head){d=!1;break}d&&n.delete(s)}}}return e},oa=(e,t,s)=>{let r=!1;return Pe(t,i=>{const n=i.target;if(e.includes(n)){const o=i.property,c=i._tweenType,u=tn(s,n,c);(!u||u&&u===o)&&(i.parent._tail===i&&i._tweenType===We.TRANSFORM&&i._prev&&i._prev._tweenType===We.TRANSFORM&&(i._prev._renderTransforms=1),Ht(t,i),na(i),r=!0)}},!0),r},Zt=(e,t,s)=>{const r=t||it;let i;if(r._hasChildren){let n=0;Pe(r,o=>{if(!o._hasChildren)if(i=oa(e,o,s),i&&!o._head)o.cancel(),Ht(r,o);else{const c=o._offset+o._delay+o.duration;c>n&&(n=c)}o._head?Zt(e,o,s):o._hasChildren=!1},!0),W(r.iterationDuration)||(r.iterationDuration=n)}else i=oa(e,r,s);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},aa=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),rn=e=>(e._cancelled&&(e._hasChildren?Pe(e,rn):Pe(e,t=>{t._composition!==et.none&&ia(t,sn(t.target,t.property))}),e._cancelled=0),e),la=0,Oh=(e,t)=>e._priority>t._priority,_t=class extends ta{constructor(e={},t=null,s=0){super(0),++la;const{id:r,delay:i,duration:n,reversed:o,alternate:c,loop:u,loopDelay:h,autoplay:d,frameRate:a,playbackRate:f,priority:l,onComplete:p,onLoop:g,onPause:v,onBegin:S,onBeforeUpdate:w,onUpdate:y}=e;Ge.current&&Ge.current.register(this);const m=t?0:it._lastTickTime,_=t?t.defaults:X.defaults,C=Ve(i)||W(i)?_.delay:+i,R=Ve(n)||W(n)?1/0:+n,b=Y(u,_.loop),x=Y(h,_.loopDelay);let T=b===!0||b===1/0||b<0?1/0:b+1,A=0;t?A=s:(it.reqId||it.requestTick(ns()),A=(it._lastTickTime-it._startTime)*X.timeScale),this.id=W(r)?la:r,this.parent=t,this.duration=$r((R+x)*T-x)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=S||_.onBegin,this.onBeforeUpdate=w||_.onBeforeUpdate,this.onUpdate=y||_.onUpdate,this.onLoop=g||_.onLoop,this.onPause=v||_.onPause,this.onComplete=p||_.onComplete,this.iterationDuration=R,this.iterationCount=T,this._autoplay=t?!1:Y(d,_.autoplay),this._offset=A,this._delay=C,this._loopDelay=x,this._iterationTime=0,this._currentIteration=0,this._resolve=ae,this._running=!1,this._reversed=+Y(o,_.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Y(c,_.alternate),this._prev=null,this._next=null,this._lastTickTime=m,this._startTime=m,this._lastTime=m,this._fps=Y(a,_.frameRate),this._speed=Y(f,_.playbackRate),this._priority=+Y(l,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return Q(G(this._currentTime,X.precision),-this._delay,this.duration)}set currentTime(e){const t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return Q(G(this._iterationTime,X.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return Q(G(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return Q(G(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){const t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*Q(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return rn(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,As(this,0,1,~~e,St.FORCE),aa(this),this._hasChildren&&Pe(this,aa),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&As(this,this.duration,1,~~e,St.FORCE),this.reset(e);const t=this._autoplay;return t===!0?this.resume():t&&!W(t.linked)&&t.link(this),this}resetTime(){const e=1/(this._speed*it._speed);return this._startTime=ns()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?As(this,je,0,0,St.FORCE):(this._running||(Ft(it,this,Oh),it._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,it.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,s=0){rn(this),this.completed=!1;const r=this.paused;return this.paused=!0,As(this,e+this._delay,~~t,~~s,St.AUTO),r?this:this.resume()}alternate(){const e=this._reversed,t=this.iterationCount,s=this.iterationDuration,r=t===1/0?qs(Bt/s):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Pe(this,e=>e.cancel(),!0):Pe(this,na),this._cancelled=1,this.pause()}stretch(e){const t=this.duration,s=Bs(e);if(t===s)return this;const r=e/t,i=e<=je;return this.duration=i?je:s,this.iterationDuration=i?je:Bs(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){As(this,0,1,0,St.AUTO);const e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=ae){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=ae};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Ih=e=>new _t(e,null,0).init();function nn(e){const t=Ke(e)?Ge.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function wt(e){if(ws(e))return[];if(!jt)return tt(e)&&e.flat(1/0)||[e];if(tt(e)){const s=e.flat(1/0),r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];if(!ws(o)){const c=nn(o);if(c)for(let u=0,h=c.length;u<h;u++){const d=c[u];if(!ws(d)){let a=!1;for(let f=0,l=r.length;f<l;f++)if(r[f]===d){a=!0;break}a||r.push(d)}}else{let u=!1;for(let h=0,d=r.length;h<d;h++)if(r[h]===o){u=!0;break}u||r.push(o)}}}return r}const t=nn(e);return t?Array.from(t):[e]}function as(e){const t=wt(e),s=t.length;for(let r=0;r<s;r++){const i=t[r];if(!i[$o]){i[$o]=!0;const n=Ir(i);(i.nodeType||n)&&(i[Ss]=!0,i[ji]=n,i[rr]={})}}return t}var on={deg:1,rad:180/Gt,turn:360},ca={},Fr=(e,t,s,r=!1)=>{const i=t.u,n=t.n;if(t.t===Se.UNIT&&i===s)return t;const o=n+i+s,c=ca[o];if(!W(c)&&!r)t.n=c;else{let u;if(i in on)u=n*on[i]/on[s];else{const d=e.cloneNode(),a=e.parentNode,f=a&&a!==ee?a:ee.body;f.appendChild(d);const l=d.style;l.width=100+i;const p=d.offsetWidth||100;l.width=100+s;const g=p/(d.offsetWidth||100);f.removeChild(d),u=g*n}t.n=u,ca[o]=u}return t.t,Se.UNIT,t.u=s,t},kt=e=>e,nr=(e=1.68)=>t=>xs(t,+e),an={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},Mh=Gt/2,ua=Gt*2,ha={"":nr,Quad:nr(2),Cubic:nr(3),Quart:nr(4),Quint:nr(5),Sine:e=>1-Yi(e*Mh),Circ:e=>1-Et(1-e*e),Expo:e=>e?xs(2,10*e-10):0,Bounce:e=>{let t,s=4;for(;e<((t=xs(2,--s))-1)/11;);return 1/xs(4,3-s)-7.5625*xs((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const s=Q(+e,1,10),r=Q(+t,je,2),i=r/ua*_h(1/s),n=ua/r;return o=>o===0||o===1?o:-s*xs(2,-10*(1-o))*Xi((1-o-i)*n)}},Jt=(()=>{const e={linear:kt,none:kt};for(let t in an)for(let s in ha){const r=ha[s],i=an[t];e[t+s]=s===""||s==="Back"||s==="Elastic"?(n,o)=>i(r(n,o)):i(r)}return e})(),Vr={linear:kt,none:kt},da=e=>{if(Vr[e])return Vr[e];if(e.indexOf("(")<=-1){const t=an[e]||e.includes("Back")||e.includes("Elastic")?Jt[e]():Jt[e];return t?Vr[e]=t:kt}else{const t=e.slice(0,-1).split("("),s=Jt[t[0]];return s?Vr[e]=s(...t[1].split(",")):kt}},fa=["steps(","irregular(","linear(","cubicBezier("],Kt=e=>{if(Ke(e)){for(let t=0,s=fa.length;t<s;t++)if(Ze(e,fa[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),kt}return Ve(e)?e:Ke(e)?da(e):kt},ne=en(),ge=en(),Fs={},zr={func:null},Ur={func:null},Wr=[null],Vs=[null,null],jr={to:null},Nh=0,pa=0,ls,Xt,$h=(e,t)=>{const s={};if(tt(e)){const r=[].concat(...e.map(i=>Object.keys(i))).filter(Ds);for(let i=0,n=r.length;i<n;i++){const o=r[i];s[o]=e.map(c=>{const u={};for(let h in c){const d=c[h];Ds(h)?h===o&&(u.to=d):u[h]=d}return u})}}else{const r=Y(t.duration,X.defaults.duration);Object.keys(e).map(i=>({o:parseFloat(i)/100,p:e[i]})).sort((i,n)=>i.o-n.o).forEach(i=>{const n=i.o,o=i.p;for(let c in o)if(Ds(c)){let u=s[c];u||(u=s[c]=[]);const h=n*r;let d=u.length,a=u[d-1];const f={to:o[c]};let l=0;for(let p=0;p<d;p++)l+=u[p].duration;d===1&&(f.from=a.to),o.ease&&(f.ease=o.ease),f.duration=h-(d?l:0),u.push(f)}return i});for(let i in s){const n=s[i];let o;for(let c=0,u=n.length;c<u;c++){const h=n[c],d=h.ease;h.ease=o||void 0,o=d}n[0].duration||n.shift()}}return s},Qt=class extends _t{constructor(e,t,s,r,i=!1,n=0,o){super(t,s,r),this._head,this._tail,++pa;const c=as(e),u=c.length,h=t.keyframes,d=h?Pt($h(h,t),t):t,{id:a,delay:f,duration:l,ease:p,playbackEase:g,modifier:v,composition:S,onRender:w}=d,y=s?s.defaults:X.defaults,m=Y(p,y.ease),_=Y(g,y.playbackEase),C=_?Kt(_):null,R=!W(m.ease),b=R?m.ease:Y(p,C?"linear":y.ease),x=R?m.settlingDuration:Y(l,y.duration),T=Y(f,y.delay),A=v||y.modifier,L=W(S)&&u>=1e3?et.none:W(S)?y.composition:S,D=this._offset+(s?s._offset:0);R&&(m.parent=this);let B=NaN,F=NaN,P=0,M=0;for(let O=0;O<u;O++){const I=c[O],$=n||O,H=o||c;let V=NaN,z=NaN;for(let Z in d)if(Ds(Z)){const K=Qi(I,Z),se=Xo(I,Z),ve=tn(Z,I,K);let ye=d[Z];const le=tt(ye);if(i&&!le&&(Vs[0]=ye,Vs[1]=ye,ye=Vs),le){const $e=ye.length,we=!Je(ye[0]);$e===2&&we?(jr.to=ye,Wr[0]=jr,ls=Wr):$e>2&&we?(ls=[],ye.forEach((Re,Te)=>{Te?Te===1?(Vs[1]=Re,ls.push(Vs)):ls.push(Re):Vs[0]=Re})):ls=ye}else Wr[0]=ye,ls=Wr;let te=null,ie=null,Le=NaN,xe=0,Ie=0;for(let $e=ls.length;Ie<$e;Ie++){const we=ls[Ie];Je(we)?Xt=we:(jr.to=we,Xt=jr),zr.func=null,Ur.func=null;const Re=Ye(Y(Xt.composition,L),I,$,H,null,null),Te=st(Re)?Re:et[Re];!te&&Te!==et.none&&(te=sn(I,ve));const Me=te?te._tail:null,ke=s&&Me&&Me.parent.parent===s?Me:ie,oe=Ye(Xt.to,I,$,H,zr,ke);let Ce;Je(oe)&&!W(oe.to)?(Xt=oe,Ce=oe.to):Ce=oe;const _e=Ye(Xt.from,I,$,H,Ur,ke),Oe=Xt.ease||b,U=Ye(Oe,I,$,H,null,ke),ce=Ve(U)||Ke(U)?U:Oe,ue=!W(ce)&&!W(ce.ease),he=ue?ce.ease:ce,ze=ue?ce.settlingDuration:Ye(Y(Xt.duration,$e>1?Ye(x,I,$,H,null,ke)/$e:x),I,$,H,null,ke),De=Ye(Y(Xt.delay,Ie?0:T),I,$,H,null,ke),xt=Xt.modifier||A,vt=!W(_e),hs=!W(Ce),Xe=tt(Ce),Dn=Xe||vt&&hs,qn=ie?xe:0,ds=ie?xe+De:De,fs=G(D+ds,12),di=G(D+qn,12);!M&&(vt||Xe)&&(M=1);let yt=ie;if(Te!==et.none){let me=te._head;for(;me&&me._absoluteStartTime<=fs;)if(me._isOverridden||(yt=me),me=me._nextRep,me&&me._absoluteStartTime>=fs)for(;me;)Hr(me),me=me._nextRep}if(Dn){gt(Xe?Ye(Ce[0],I,$,H,Ur,ke):_e,ne),gt(Xe?Ye(Ce[1],I,$,H,zr,ke):Ce,ge);const me=Cs(I,ve,K,Fs);ne.t===Se.NUMBER&&(yt?yt._valueType===Se.UNIT&&(ne.t=Se.UNIT,ne.u=yt._unit):(gt(me,rt),rt.t===Se.UNIT&&(ne.t=Se.UNIT,ne.u=rt.u)))}else hs?gt(Ce,ge):ie?Jo(ie,ge):gt(s&&yt&&yt.parent.parent===s?yt._value:Cs(I,ve,K,Fs),ge),vt?gt(_e,ne):ie?Jo(ie,ne):gt(s&&yt&&yt.parent.parent===s?yt._value:Cs(I,ve,K,Fs),ne);if(ne.o&&(ne.n=Es(yt?yt._toNumber:gt(Cs(I,ve,K,Fs),rt).n,ne.n,ne.o)),ge.o&&(ge.n=Es(ne.n,ge.n,ge.o)),ne.t!==ge.t){if(ne.t===Se.COMPLEX||ge.t===Se.COMPLEX){const me=ne.t===Se.COMPLEX?ne:ge,nt=ne.t===Se.COMPLEX?ge:ne;nt.t=Se.COMPLEX,nt.s=at(me.s),nt.d=me.d.map(()=>nt.n)}else if(ne.t===Se.UNIT||ge.t===Se.UNIT){const me=ne.t===Se.UNIT?ne:ge,nt=ne.t===Se.UNIT?ge:ne;nt.t=Se.UNIT,nt.u=me.u}else if(ne.t===Se.COLOR||ge.t===Se.COLOR){const me=ne.t===Se.COLOR?ne:ge,nt=ne.t===Se.COLOR?ge:ne;nt.t=Se.COLOR,nt.d=me.d.map(()=>0)}}if(ne.u!==ge.u){let me=ge.u?ne:ge;me=Fr(I,me,ge.u?ge.u:ne.u,!1)}if(ge.d&&ne.d&&ge.d.length!==ne.d.length){const me=ne.d.length>ge.d.length?ne:ge,nt=me===ne?ge:ne;nt.d=me.d.map((Hn,pi)=>W(nt.d[pi])?0:nt.d[pi]),nt.s=at(me.s)}const Tt=G(+ze||1e-11,12);let fi=Fs[ve];ws(fi)||(Fs[ve]=null);const Bn=se?se.set:null;xe=G(ds+Tt,12);const Ot=ne.d,Ee=ge.d,Ws=ge.s,Ue={parent:this,id:Nh++,property:ve,target:I,_value:null,_toFunc:zr.func,_fromFunc:Ur.func,_ease:Kt(he),_fromNumbers:Ot?at(Ot):Rr,_toNumbers:Ee?at(Ee):Rr,_strings:Ws?at(Ws):Rr,_fromNumber:ne.n,_toNumber:ge.n,_numbers:Ot?at(Ot):Rr,_number:ne.n,_unit:ge.u,_modifier:xt,_currentTime:0,_startTime:ds,_delay:+De,_updateDuration:Tt,_changeDuration:Tt,_absoluteStartTime:fs,_absoluteUpdateStartTime:di,_absoluteEndTime:G(D+xe,12),_hasFromValue:vt||Xe?1:0,_tweenType:K,_setter:Bn,_valueType:ge.t,_composition:Te,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:fi,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};Te!==et.none&&ia(Ue,te);const It=Ue._valueType;if(It===Se.COMPLEX)Ue._value=Ko(Ue,1,-1);else if(It===Se.UNIT)Ue._value=`${xt(Ue._toNumber)}${Ue._unit}`;else if(It===Se.COLOR){const me=ge.d;Ue._value=`rgba(${G(me[0],0)},${G(me[1],0)},${G(me[2],0)},${me[3]})`}else Ue._value=xt(Ue._toNumber);isNaN(Le)&&(Le=Ue._startTime),ie=Ue,P++,Ft(this,Ue)}(isNaN(F)||Le<F)&&(F=Le),(isNaN(B)||xe>B)&&(B=xe),K===We.TRANSFORM&&(V=P-Ie,z=P)}if(!isNaN(V)){let Z=0;Pe(this,K=>{Z>=V&&Z<z&&(K._renderTransforms=1,K._composition===et.blend&&Pe(Hs.animation,se=>{se.id===K.id&&(se._renderTransforms=1)})),Z++})}}u||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),F?(Pe(this,O=>{O._startTime-O._delay||(O._delay-=F),O._startTime-=F}),B-=F):F=0,B||(B=je,this.iterationCount=0),this.targets=c,this.id=W(a)?pa:a,this.duration=B===1e-11?je:$r((B+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=w||y.onRender,this._ease=C,this._delay=F,this.iterationDuration=B,!this._autoplay&&M&&this.onRender(this)}stretch(e){const t=this.duration;if(t===Bs(e))return this;const s=e/t;return Pe(this,r=>{r._updateDuration=Bs(r._updateDuration*s),r._changeDuration=Bs(r._changeDuration*s),r._currentTime*=s,r._delay*=s,r._startTime*=s,r._absoluteStartTime*=s,r._absoluteUpdateStartTime*=s,r._absoluteEndTime*=s}),super.stretch(e)}refresh(){return Pe(this,e=>{const t=e._toFunc,s=e._fromFunc;(t||s)&&(s?(gt(s(),ne),ne.u!==e._unit&&e.target[Ss]&&Fr(e.target,ne,e._unit,!0),e._fromNumbers=at(ne.d),e._fromNumber=ne.n):t&&(gt(Cs(e.target,e.property,e._tweenType),rt),e._fromNumbers=at(rt.d),e._fromNumber=rt.n),t&&(gt(t(),ge),e._toNumbers=at(ge.d),e._strings=at(ge.s),e._toNumber=ge.o?Es(e._fromNumber,ge.n,ge.o):ge.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),qr(this)}then(e){return super.then(e)}},or=(e,t)=>X.editor?X.editor.addAnimation(e,t):new Qt(e,t,null,0,!1).init(),Dh=(e,t)=>{if(Ze(t,"<")){const s=t[1]==="<",r=e._tail,i=r?r._offset+r._delay:0;return s?i:i+r.duration}},ar=(e,t)=>{let s=e.iterationDuration;if(s===1e-11&&(s=0),W(t))return s;if(st(+t))return+t;const r=t,i=e?e.labels:null,n=!ws(i),o=Dh(e,r),c=!W(o),u=Fo.exec(r);if(u){const h=u[0],d=r.split(h),a=n&&d[0]?i[d[0]]:s,f=c?o:n?a:s,l=+d[1];return Es(f,l,h[0])}else return c?o:n?W(i[r])?s:i[r]:s};function qh(e){return $r((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function ln(e,t,s,r,i,n){const o=st(e.duration)&&e.duration<=1e-11?s-je:s;t.composition&&As(t,o,1,1,St.AUTO);const c=r?new Qt(r,e,t,o,!1,i,n):new _t(e,t,o);return t.composition&&c.init(!0),Ft(t,c),Pe(t,u=>{const h=u._offset+u._delay+u.duration;h>t.iterationDuration&&(t.iterationDuration=h)}),t.duration=qh(t),t}var ga=0,ma=class extends _t{constructor(e={}){super(e,null,0),++ga,this.id=W(e.id)?ga:e.id,this.duration=0,this.labels={};const t=e.defaults,s=X.defaults;this.defaults=t?Pt(t,s):s,this.composition=Y(e.composition,!0),this.onRender=e.onRender||s.onRender;const r=Y(e.playbackEase,s.playbackEase);this._ease=r?Kt(r):null,this.iterationDuration=0}add(e,t,s){const r=Je(t),i=Je(e);if(r||i){if(this._hasChildren=!0,r){const n=t,o=X.editor&&X.editor.addTimelineChild,c=s&&s.type==="Stagger"&&X.editor,u=Ve(s)?s:null;if(u||c){const h=wt(e),d=this.duration,a=this.iterationDuration,f=n.id;let l=0;const p=h.length,g=o?o(e,n,this.id,s,p):null,v=u||X.editor.resolveStagger(s.defaultValue);h.forEach(S=>{const w={...g||n};this.duration=d,this.iterationDuration=a,W(f)||(w.id=f+"-"+l);const y=ar(this,v(S,l,h,null,this));ln(w,this,y,S,l,h),l++})}else{const h=o?o(e,n,this.id,s):n,d=s&&s.type?s.defaultValue:s;ln(h,this,ar(this,d),e)}}else ln(e,this,ar(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(W(e)||e&&W(e.pause))return this;e.pause();const s=+(e.effect?e.effect.getTiming().duration:e.duration);!W(e)&&!W(e.persist)&&(e.persist=!0);const r=X.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);const n=this.add(e,{currentTime:[0,s],duration:s,delay:0,ease:"linear",playbackEase:"linear"},t);return r&&(r.addTimelineChild=i),n}set(e,t,s){return W(t)?this:(t.duration=je,t.composition=et.replace,this.add(e,t,s))}call(e,t){return W(e)||e&&!Ve(e)?this:(X.editor&&X.editor.addTimelineCall&&(t=X.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return W(e)||e&&!Ke(e)?this:(X.editor&&X.editor.addTimelineLabel&&(t=X.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=ar(this,t),this)}remove(e,t){return Zt(wt(e),this,t),this}stretch(e){const t=this.duration;if(t===Bs(e))return this;const s=e/t,r=this.labels;Pe(this,i=>i.stretch(i.duration*s));for(let i in r)r[i]*=s;return super.stretch(e)}refresh(){return Pe(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Pe(this,e=>e.revert,!0),qr(this)}then(e){return super.then(e)}},va=e=>X.editor?X.editor.addTimeline(e):new ma(e).init(),cn=class{constructor(e,t){Ge.current&&Ge.current.register(this);const s=()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},r=()=>{if(this.callbacks.completed)return;let c=!0;for(let u in this.animations)if(!this.animations[u].paused&&c){c=!1;break}c&&this.callbacks.complete()},i={onBegin:s,onComplete:r,onPause:r},n={v:1,autoplay:!1},o={};if(this.targets=[],this.animations={},this.callbacks=null,!(W(e)||W(t))){for(let c in t){const u=t[c];Ds(c)?o[c]=u:Ze(c,"on")?n[c]=u:i[c]=u}this.callbacks=new Qt({v:0},n);for(let c in o){const u=o[c],h=Je(u);let d={},a="+=0";if(h){const p=u.unit;Ke(p)&&(a+=p)}else d.duration=u;d[c]=h?Pt({to:a},u):a;const f=Pt(i,d);f.composition=et.replace,f.autoplay=!1;const l=this.animations[c]=new Qt(e,f,null,0,!1).init();this.targets.length||this.targets.push(...l.targets),this[c]=(p,g,v)=>{const S=l._head;if(W(p)&&S){const w=S._numbers;return w&&w.length?w:S._modifier(S._number)}else return Pe(l,w=>{if(tt(p))for(let y=0,m=p.length;y<m;y++)W(w._numbers[y])||(w._fromNumbers[y]=w._modifier(w._numbers[y]),w._toNumbers[y]=p[y]);else w._fromNumber=w._modifier(w._number),w._toNumber=p;W(v)||(w._ease=Kt(v)),w._currentTime=0}),W(g)||l.stretch(g),l.reset(!0).resume(),this}}}}revert(){for(let e in this.animations)this[e]=ae,this.animations[e].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}},Bh=(e,t)=>new cn(e,t),Hh=Ls({clamp:()=>Q,damp:()=>Gh,degToRad:()=>Wh,lerp:()=>os,mapRange:()=>lr,padEnd:()=>zh,padStart:()=>Vh,radToDeg:()=>jh,round:()=>G,roundPad:()=>Fh,snap:()=>Ts,wrap:()=>Uh}),Fh=(e,t)=>(+e).toFixed(t),Vh=(e,t,s)=>`${e}`.padStart(t,s),zh=(e,t,s)=>`${e}`.padEnd(t,s),Uh=(e,t,s)=>((e-t)%(s-t)+(s-t))%(s-t)+t,lr=(e,t,s,r,i)=>r+(e-t)/(s-t)*(i-r),Wh=e=>e*Math.PI/180,jh=e=>e*180/Math.PI,Gh=(e,t,s,r)=>r?r===1?t:os(e,t,1-Math.exp(-r*s*.1)):e,mt=dt*10,Gr=class{constructor(e={}){const t=!W(e.bounce)||!W(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/dt,this.maxIterations=this.maxDuration/this.timeStep/dt,this.bn=Q(Y(e.bounce,.5),-1,1),this.pd=Q(Y(e.duration,628),10*X.timeScale,mt*X.timeScale),this.m=Q(Y(e.mass,1),1,mt),this.s=Q(Y(e.stiffness,100),je,mt),this.d=Q(Y(e.damping,10),je,mt),this.v=Q(Y(e.velocity,0),-mt,mt),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||ae,t&&this.calculateSDFromBD(),this.compute(),this.ease=s=>{const r=s*this.settlingDuration,i=this.completed,n=this.pd;return r>=n&&!i&&(this.completed=!0,this.onComplete(this.parent)),r<n&&i&&(this.completed=!1),s===0||s===1?s:this.solve(s*this.solverDuration)}}solve(e){const{zeta:t,w0:s,wd:r,b:i}=this;let n=e;return t<1?n=Mr(-n*t*s)*(1*Yi(r*n)+i*Xi(r*n)):t===1?n=(1+i*n)*Mr(-n*s):n=((1+i)*Mr((-t*s+r)*n)+(1-i)*Mr((-t*s-r)*n))/2,1-n}calculateSDFromBD(){const e=X.timeScale===1?this.pd/dt:this.pd;this.m=1,this.v=0,this.s=xs(2*Gt/e,2),this.bn>=0?this.d=(1-this.bn)*4*Gt/e:this.d=4*Gt/(e*(1+this.bn)),this.s=G(Q(this.s,je,mt),3),this.d=G(Q(this.d,je,300),3)}calculateBDFromSD(){const e=2*Gt/Et(this.s);this.pd=e*(X.timeScale===1?dt:1),this.d/(2*Et(this.s))<=1?this.bn=1-this.d*e/(4*Gt):this.bn=4*Gt/(this.d*e)-1,this.bn=G(Q(this.bn,-1,1),3),this.pd=G(Q(this.pd,10*X.timeScale,mt*X.timeScale),3)}compute(){const{maxRestSteps:e,maxIterations:t,restThreshold:s,timeStep:r,m:i,d:n,s:o,v:c}=this,u=this.w0=Q(Et(o/i),je,dt),h=this.zeta=n/(2*Et(o*i));h<1?(this.wd=u*Et(1-h*h),this.b=(h*u+-c)/this.wd):h===1?(this.wd=0,this.b=-c+u):(this.wd=u*Et(h*h-1),this.b=(h*u+-c)/this.wd);let d=0,a=0,f=0;for(;a<=e&&f<=t;)At(1-this.solve(d))<s?a++:a=0,this.solverDuration=d,d+=r,f++;this.settlingDuration=G(this.solverDuration*dt,0)*X.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=Q(Y(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=Q(Y(e,1),10*X.timeScale,mt*X.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=Q(Y(e,100),je,mt),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=Q(Y(e,10),je,mt),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=Q(Y(e,1),1,mt),this.compute()}get velocity(){return this.v}set velocity(e){this.v=Q(Y(e,0),-mt,mt),this.compute()}},Xr=e=>new Gr(e),ya=e=>(console.warn("createSpring() is deprecated use spring() instead"),new Gr(e)),un={_head:null,_tail:null},hn=(e,t,s)=>{let r=un._head,i;for(;r;){const n=r._next,o=r.$el===e,c=!t||r.property===t,u=!s||r.parent===s;if(o&&c&&u){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),Ht(un,r);const h=r.parent;h&&(h._completed++,h.animations.length===h._completed&&(h.completed=!0,h.paused=!0,h.muteCallbacks||(h.onComplete(h),h._resolve(h))))}r=n}return i},ba=(e,t,s,r,i)=>{const n=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;n.playbackRate=e._speed,e.paused&&n.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=n),e.animations.push(n),hn(t,s),Ft(un,{parent:e,animation:n,$el:t,property:s,_next:null,_prev:null});const c=()=>hn(t,s,e);return n.oncancel=c,n.onremove=c,e.persist||(n.onfinish=c),n};function cs(e,t,s){const r=as(e);if(!r.length)return;const[i]=r,n=Qi(i,t),o=tn(t,i,n);let c=Cs(i,o);if(W(s))return c;if(gt(c,rt),rt.t===Se.NUMBER||rt.t===Se.UNIT){if(s===!1)return rt.n;{const u=Fr(i,rt,s,!1);return`${G(u.n,X.precision)}${u.u}`}}}var es=(e,t)=>{if(!W(t))return X.editor&&X.editor.addSet?X.editor.addSet(e,t):(t.duration=je,t.composition=Y(t.composition,et.none),new Qt(e,t,null,0,!0).resume())},Sa=(e,t,s)=>{const r=wt(e);for(let i=0,n=r.length;i<n;i++)hn(r[i],s,t&&t.controlAnimation&&t);return Zt(r,t,s),r},us=e=>{e.cancelable&&e.preventDefault()},Xh=class{constructor(e){this.el=e,this.zIndex=0,this.parentElement=null,this.classList={add:ae,remove:ae}}get x(){return this.el.x||0}set x(e){this.el.x=e}get y(){return this.el.y||0}set y(e){this.el.y=e}get width(){return this.el.width||0}set width(e){this.el.width=e}get height(){return this.el.height||0}set height(e){this.el.height=e}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}},Yh=class{constructor(e){this.$el=e,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(e,t){return this.point.x=e,this.point.y=t,this.point.matrixTransform(this.inversedMatrix)}traverseUp(e){let t=this.$el.parentElement,s=0;for(;t&&t!==ee;)e(t,s),t=t.parentElement,s++}getMatrix(){const e=new DOMMatrix;return this.traverseUp(t=>{const s=getComputedStyle(t).transform;if(s){const r=new DOMMatrix(s);e.preMultiplySelf(r)}}),e}remove(){this.traverseUp((e,t)=>{this.inlineTransforms[t]=e.style.transform,e.style.transform="none"})}revert(){this.traverseUp((e,t)=>{const s=this.inlineTransforms[t];s===""?e.style.removeProperty("transform"):e.style.transform=s})}},ft=(e,t)=>e&&Ve(e)?e(t):e,Yr=0,_a=class{constructor(e,t={}){if(!e)return;Ge.current&&Ge.current.register(this);const s=t.x,r=t.y,i=t.trigger,n=t.modifier,o=t.releaseEase,c=o&&Kt(o),u=!W(o)&&!W(o.ease),h=Je(s)&&!W(s.mapTo)?s.mapTo:"translateX",d=Je(r)&&!W(r.mapTo)?r.mapTo:"translateY",a=ft(t.container,this);this.containerArray=tt(a)?a:null,this.$container=a&&!this.containerArray?wt(a)[0]:ee.body,this.useWin=this.$container===ee.body,this.$scrollContainer=this.useWin?ht:this.$container,this.$target=Je(e)?new Xh(e):wt(e)[0],this.$trigger=wt(i||e)[0],this.fixed=cs(this.$target,"position")==="fixed",this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=u?o:Xr({mass:Y(t.releaseMass,1),stiffness:Y(t.releaseStiffness,80),damping:Y(t.releaseDamping,20)}),this.releaseYSpring=u?o:Xr({mass:Y(t.releaseMass,1),stiffness:Y(t.releaseStiffness,80),damping:Y(t.releaseDamping,20)}),this.releaseEase=c||Jt.outQuint,this.hasReleaseSpring=u,this.onGrab=t.onGrab||ae,this.onDrag=t.onDrag||ae,this.onRelease=t.onRelease||ae,this.onUpdate=t.onUpdate||ae,this.onSettle=t.onSettle||ae,this.onSnap=t.onSnap||ae,this.onResize=t.onResize||ae,this.onAfterResize=t.onAfterResize||ae,this.disabled=[0,0];const f={};if(n&&(f.modifier=n),W(s)||s===!0)f[h]=0;else if(Je(s)){const l=s,p={};l.modifier&&(p.modifier=l.modifier),l.composition&&(p.composition=l.composition),f[h]=p}else s===!1&&(f[h]=0,this.disabled[0]=1);if(W(r)||r===!0)f[d]=0;else if(Je(r)){const l=r,p={};l.modifier&&(p.modifier=l.modifier),l.composition&&(p.composition=l.composition),f[d]=p}else r===!1&&(f[d]=0,this.disabled[1]=1);this.animate=new cn(this.$target,f),this.xProp=h,this.yProp=d,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-Bt,Bt,Bt,-Bt],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=ns(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new Yh(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new _t({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new _t({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!W(a),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?h:d,this.animate.callbacks.onRender=()=>{const l=this.updated,p=!(this.grabbed&&l)&&this.released,g=this.x,v=this.y,S=g-this.coords[2],w=v-this.coords[3];this.deltaX=S,this.deltaY=w,this.coords[2]=g,this.coords[3]=v,l&&(S||w)&&this.onUpdate(this),p?(this.computeVelocity(S,w),this.angle=Nr(w,S)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new _t({autoplay:!1,duration:150*X.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=t,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),Je(e)||this.resizeObserver.observe(this.$target)}computeVelocity(e,t){const s=this.velocityTime,r=ns(),i=r-s;if(i<17)return this.velocity;this.velocityTime=r;const n=this.velocityStack,o=this.velocityMultiplier,c=this.minVelocity,u=this.maxVelocity,h=this.velocityStackIndex;n[h]=G(Q(Et(e*e+t*t)/i*o,c,u),5);const d=jo(n[0],n[1],n[2]);return this.velocity=d,this.velocityStackIndex=(h+1)%3,d}setX(e,t=!1){if(this.disabled[0])return;const s=G(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destX=s,this.snapped[0]=Ts(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(e,t=!1){if(this.disabled[1])return;const s=G(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destY=s,this.snapped[1]=Ts(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return G(this.animate[this.xProp](),X.precision)}set x(e){this.setX(e,!1)}get y(){return G(this.animate[this.yProp](),X.precision)}set y(e){this.setY(e,!1)}get progressX(){return lr(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(e){this.setX(lr(e,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return lr(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(e){this.setY(lr(e,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const e=G(this.useWin?ht.scrollX:this.$container.scrollLeft,0),t=G(this.useWin?ht.scrollY:this.$container.scrollTop,0),[s,r,i,n]=this.containerPadding,o=this.scrollThreshold;this.scroll.x=e,this.scroll.y=t,this.scrollBounds[0]=t-this.targetBounds[0]+s-o,this.scrollBounds[1]=e-this.targetBounds[1]-r+o,this.scrollBounds[2]=t-this.targetBounds[2]-i+o,this.scrollBounds[3]=e-this.targetBounds[3]+n-o}updateBoundingValues(){const e=this.$container;if(!e)return;const t=this.x,s=this.y,r=this.coords[2],i=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const n=this.window[0]=ht.innerWidth,o=this.window[1]=ht.innerHeight,c=this.useWin,u=e.scrollWidth,h=e.scrollHeight,d=this.fixed,a=e.getBoundingClientRect(),[f,l,p,g]=this.containerPadding;this.dragArea[0]=c?0:a.left,this.dragArea[1]=c?0:a.top,this.scrollView[0]=c?Q(u,n,u):u,this.scrollView[1]=c?Q(h,o,h):h,this.updateScrollCoords();const{width:v,height:S,left:w,top:y,right:m,bottom:_}=e.getBoundingClientRect();this.dragArea[2]=G(c?Q(v,n,n):v,0),this.dragArea[3]=G(c?Q(S,o,o):S,0);const C=cs(e,"overflow"),R=C==="visible",b=C==="hidden";if(this.canScroll=d?!1:this.contained&&(e===ee.body&&R||!b&&!R)&&(u>this.dragArea[2]+g-l||h>this.dragArea[3]+f-p)&&(!this.containerArray||this.containerArray&&!tt(this.containerArray)),this.contained){const x=this.scroll.x,T=this.scroll.y,A=this.canScroll,L=this.$target.getBoundingClientRect(),D=A?c?0:e.scrollLeft:0,B=A?c?0:e.scrollTop:0,F=A?this.scrollView[0]-D-v:0,P=A?this.scrollView[1]-B-S:0;this.targetBounds[0]=G(L.top+T-(c?0:y),0),this.targetBounds[1]=G(L.right+x-(c?n:m),0),this.targetBounds[2]=G(L.bottom+T-(c?o:_),0),this.targetBounds[3]=G(L.left+x-(c?0:w),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+f,this.containerBounds[1]=this.containerArray[1]-l,this.containerBounds[2]=this.containerArray[2]-p,this.containerBounds[3]=this.containerArray[3]+g):(this.containerBounds[0]=-G(L.top-(d?Q(y,0,o):y)+B-f,0),this.containerBounds[1]=-G(L.right-(d?Q(m,0,n):m)-F+l,0),this.containerBounds[2]=-G(L.bottom-(d?Q(_,0,o):_)-P+p,0),this.containerBounds[3]=-G(L.left-(d?Q(w,0,n):w)+D-g,0))}this.transforms.revert(),this.coords[2]=r,this.coords[3]=i,this.setX(t,!0),this.setY(s,!0)}isOutOfBounds(e,t,s){if(!this.contained)return 0;const[r,i,n,o]=e,[c,u]=this.disabled,h=!c&&t<o||!c&&t>i,d=!u&&s<r||!u&&s>n;return h&&!d?1:!h&&d?2:h&&d?3:0}refresh(){const e=this.parameters,t=e.x,s=e.y,r=ft(e.container,this),i=ft(e.containerPadding,this)||0,n=tt(i)?i:[i,i,i,i],o=this.x,c=this.y,u=ft(e.cursor,this),h={onHover:"grab",onGrab:"grabbing"};if(u){const{onHover:v,onGrab:S}=u;v&&(h.onHover=v),S&&(h.onGrab=S)}const d=ft(e.dragThreshold,this),a={mouse:3,touch:7};if(st(d))a.mouse=d,a.touch=d;else if(d){const{mouse:v,touch:S}=d;W(v)||(a.mouse=v),W(S)||(a.touch=S)}this.containerArray=tt(r)?r:null,this.$container=r&&!this.containerArray?wt(r)[0]:ee.body,this.useWin=this.$container===ee.body,this.$scrollContainer=this.useWin?ht:this.$container,this.isFinePointer=matchMedia("(pointer:fine)").matches,this.containerPadding=Y(n,[0,0,0,0]),this.containerFriction=Q(Y(ft(e.containerFriction,this),.8),0,1),this.releaseContainerFriction=Q(Y(ft(e.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=ft(Je(t)&&!W(t.snap)?t.snap:e.snap,this),this.snapY=ft(Je(s)&&!W(s.snap)?s.snap:e.snap,this),this.scrollSpeed=Y(ft(e.scrollSpeed,this),1.5),this.scrollThreshold=Y(ft(e.scrollThreshold,this),20),this.dragSpeed=Y(ft(e.dragSpeed,this),1),this.dragThreshold=this.isFinePointer?a.mouse:a.touch,this.minVelocity=Y(ft(e.minVelocity,this),0),this.maxVelocity=Y(ft(e.maxVelocity,this),50),this.velocityMultiplier=Y(ft(e.velocityMultiplier,this),1),this.cursor=u===!1?!1:h,this.updateBoundingValues();const[f,l,p,g]=this.containerBounds;this.setX(Q(o,g,l),!0),this.setY(Q(c,f,p),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[S,w,y,m]=this.containerPadding,[_,C]=this.scrollView,R=this.dragArea[2],b=this.dragArea[3],x=this.scroll.x,T=this.scroll.y,A=this.$container.scrollWidth,L=this.$container.scrollHeight,D=this.useWin?Q(A,this.window[0],A):A,B=this.useWin?Q(L,this.window[1],L):L,F=_-D,P=C-B;this.dragged&&F>0&&(this.coords[0]-=F,this.scrollView[0]=D),this.dragged&&P>0&&(this.coords[1]-=P,this.scrollView[1]=B);const M=this.scrollSpeed*10,O=this.scrollThreshold,[I,$]=this.coords,[H,V,z,Z]=this.scrollBounds,K=G(Q(($-H+S)/O,-1,0)*M,0),se=G(Q((I-V-w)/O,0,1)*M,0),ve=G(Q(($-z-y)/O,0,1)*M,0),ye=G(Q((I-Z+m)/O,-1,0)*M,0);if(K||ve||ye||se){const[le,te]=this.disabled;let ie=x,Le=T;le||(ie=G(Q(x+(ye||se),0,_-R),0),this.coords[0]-=x-ie),te||(Le=G(Q(T+(K||ve),0,C-b),0),this.coords[1]-=T-Le),this.useWin?this.$scrollContainer.scrollBy(-(x-ie),-(T-Le)):this.$scrollContainer.scrollTo(ie,Le)}}const[e,t,s,r]=this.containerBounds,[i,n,o,c,u,h]=this.pointer;this.coords[0]+=(i-u)*this.dragSpeed,this.coords[1]+=(n-h)*this.dragSpeed,this.pointer[4]=i,this.pointer[5]=n;const[d,a]=this.coords,[f,l]=this.snapped,p=(1-this.containerFriction)*this.dragSpeed;this.setX(d>t?t+(d-t)*p:d<r?r+(d-r)*p:d,!1),this.setY(a>s?s+(a-s)*p:a<e?e+(a-e)*p:a,!1),this.computeVelocity(i-u,n-h),this.angle=Nr(n-c,i-o);const[g,v]=this.snapped;(g!==f&&this.snapX||v!==l&&this.snapY)&&this.onSnap(this)}stop(){this.updateTicker.pause(),this.overshootTicker.pause();for(let e in this.animate.animations)this.animate.animations[e].pause();return Zt([this],null,"x"),Zt([this],null,"y"),Zt([this],null,"progressX"),Zt([this],null,"progressY"),Zt([this.scroll]),Zt([this.overshootCoords]),this}scrollInView(e,t=0,s=Jt.inOutQuad){this.updateScrollCoords();const r=this.destX,i=this.destY,n=this.scroll,o=this.scrollBounds,c=this.canScroll;if(!this.containerArray&&this.isOutOfBounds(o,r,i)){const[u,h,d,a]=o,f=G(Q(i-u,-Bt,0),0),l=G(Q(r-h,0,Bt),0),p=G(Q(i-d,0,Bt),0),g=G(Q(r-a,-Bt,0),0);new Qt(n,{x:G(n.x+(g?g-t:l?l+t:0),0),y:G(n.y+(f?f-t:p?p+t:0),0),duration:W(e)?350*X.timeScale:e,ease:s,onUpdate:()=>{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then(()=>{this.canScroll=c})}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=es(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(e,t=0,s=Jt.inOutQuad){this.stop(),this.updateBoundingValues();const r=this.x,i=this.y,[n,o,c,u]=this.containerPadding,h=this.scroll.y-this.targetBounds[0]+n+t,d=this.scroll.x-this.targetBounds[1]-o-t,a=this.scroll.y-this.targetBounds[2]-c-t,f=this.scroll.x-this.targetBounds[3]+u+t,l=this.isOutOfBounds([h,d,a,f],r,i);if(l){const[p,g]=this.disabled,v=Q(Ts(r,this.snapX),f,d),S=Q(Ts(i,this.snapY),h,a),w=W(e)?350*X.timeScale:e;!p&&(l===1||l===3)&&this.animate[this.xProp](v,w,s),!g&&(l===2||l===3)&&this.animate[this.yProp](S,w,s)}return this}handleDown(e){const t=e.target;if(this.grabbed||t.type==="range")return;e.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const s=e.changedTouches,r=s?s[0].clientX:e.clientX,i=s?s[0].clientY:e.clientY,{x:n,y:o}=this.transforms.normalizePoint(r,i),[c,u,h,d]=this.containerBounds,a=(1-this.containerFriction)*this.dragSpeed,f=this.x,l=this.y;this.coords[0]=this.coords[2]=a?f>u?u+(f-u)/a:f<d?d+(f-d)/a:f:f,this.coords[1]=this.coords[3]=a?l>h?h+(l-h)/a:l<c?c+(l-c)/a:l:l,this.pointer[0]=n,this.pointer[1]=o,this.pointer[2]=n,this.pointer[3]=o,this.pointer[4]=n,this.pointer[5]=o,this.pointer[6]=n,this.pointer[7]=o,this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null);const p=cs(this.$target,"zIndex",!1);Yr=(p>Yr?p:Yr)+1,this.targetStyles=es(this.$target,{zIndex:Yr}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=es(ee.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,Jt.out(3)),this.onGrab(this),ee.addEventListener("touchmove",this),ee.addEventListener("touchend",this),ee.addEventListener("touchcancel",this),ee.addEventListener("mousemove",this),ee.addEventListener("mouseup",this),ee.addEventListener("selectstart",this)}handleMove(e){if(!this.grabbed)return;const t=e.changedTouches,s=t?t[0].clientX:e.clientX,r=t?t[0].clientY:e.clientY,{x:i,y:n}=this.transforms.normalizePoint(s,r),o=i-this.pointer[6],c=n-this.pointer[7];let u=e.target,h=!1,d=!1,a=!1;for(;t&&u&&u!==this.$trigger;){const f=cs(u,"overflow-y");if(f!=="hidden"&&f!=="visible"){const{scrollTop:l,scrollHeight:p,clientHeight:g}=u;if(p>g){a=!0,h=l<=3,d=l>=p-g-3;break}}u=u.parentElement}a&&(!h&&!d||h&&c<0||d&&c>0)?(this.pointer[0]=i,this.pointer[1]=n,this.pointer[2]=i,this.pointer[3]=n,this.pointer[4]=i,this.pointer[5]=n,this.pointer[6]=i,this.pointer[7]=n):(us(e),this.triggerStyles||(this.triggerStyles=es(this.$trigger,{pointerEvents:"none"})),this.$trigger.addEventListener("touchstart",us,{passive:!1}),this.$trigger.addEventListener("touchmove",us,{passive:!1}),this.$trigger.addEventListener("touchend",us),(this.dragged||!this.disabled[0]&&At(o)>this.dragThreshold||!this.disabled[1]&&At(c)>this.dragThreshold)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=i,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[e,t]=this.disabled,[s,r,i,n,o,c]=this.pointer,[u,h,d,a]=this.containerBounds,[f,l]=this.snapped,p=this.releaseXSpring,g=this.releaseYSpring,v=this.releaseEase,S=this.hasReleaseSpring,w=this.overshootCoords,y=this.x,m=this.y,_=this.computeVelocity(s-o,r-c),C=this.angle=Nr(r-n,s-i),R=_*150,b=(1-this.releaseContainerFriction)*this.dragSpeed,x=y+Yi(C)*R,T=m+Xi(C)*R,A=x>h?h+(x-h)*b:x<a?a+(x-a)*b:x,L=T>d?d+(T-d)*b:T<u?u+(T-u)*b:T,D=this.destX=Q(G(Ts(A,this.snapX),5),a,h),B=this.destY=Q(G(Ts(L,this.snapY),5),u,d),F=this.isOutOfBounds(this.containerBounds,x,T);let P=0,M=0,O=v,I=v,$=0;if(w.x=y,w.y=m,!e){const V=D===h?y>h?-1:1:y<a?-1:1,z=G(y-D,0);p.velocity=t&&S?z?R*V/At(z):0:_;const{ease:Z,settlingDuration:K,restDuration:se}=p;P=y===D?0:S?K:K-se*X.timeScale,S&&(O=Z),P>$&&($=P)}if(!t){const V=B===d?m>d?-1:1:m<u?-1:1,z=G(m-B,0);g.velocity=e&&S?z?R*V/At(z):0:_;const{ease:Z,settlingDuration:K,restDuration:se}=g;M=m===B?0:S?K:K-se*X.timeScale,S&&(I=Z),M>$&&($=M)}if(!S&&F&&b&&(P||M)){const V=et.blend;new Qt(w,{x:{to:A,duration:P*.65},y:{to:L,duration:M*.65},ease:v,composition:V}).init(),new Qt(w,{x:{to:D,duration:P},y:{to:B,duration:M},ease:v,composition:V}).init(),this.overshootTicker.stretch(jo(P,M)).restart()}else e||this.animate[this.xProp](D,P,O),t||this.animate[this.yProp](B,M,I);this.scrollInView($,this.scrollThreshold,v);let H=!1;D!==f&&(this.snapped[0]=D,this.snapX&&(H=!0)),B!==l&&this.snapY&&(this.snapped[1]=B,this.snapY&&(H=!0)),H&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener("touchstart",us),this.$trigger.removeEventListener("touchmove",us),this.$trigger.removeEventListener("touchend",us),ee.removeEventListener("touchmove",this),ee.removeEventListener("touchend",this),ee.removeEventListener("touchcancel",this),ee.removeEventListener("mousemove",this),ee.removeEventListener("mouseup",this),ee.removeEventListener("selectstart",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove("is-disabled"),this.touchActionStyles=es(this.$trigger,{touchAction:this.disabled[0]?"pan-x":this.disabled[1]?"pan-y":"none"}),this.$trigger.addEventListener("touchstart",this,{passive:!0}),this.$trigger.addEventListener("mousedown",this,{passive:!0}),this.$trigger.addEventListener("mouseenter",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.$target.classList.add("is-disabled"),this.$trigger.removeEventListener("touchstart",this),this.$trigger.removeEventListener("mousedown",this),this.$trigger.removeEventListener("mouseenter",this),ee.removeEventListener("touchmove",this),ee.removeEventListener("touchend",this),ee.removeEventListener("touchcancel",this),ee.removeEventListener("mousemove",this),ee.removeEventListener("mouseup",this),ee.removeEventListener("selectstart",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove("is-disabled"),this.updateTicker.revert(),this.overshootTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this.resizeObserver.disconnect(),this}handleEvent(e){switch(e.type){case"mousedown":this.handleDown(e);break;case"touchstart":this.handleDown(e);break;case"mousemove":this.handleMove(e);break;case"touchmove":this.handleMove(e);break;case"mouseup":this.handleUp();break;case"touchend":this.handleUp();break;case"touchcancel":this.handleUp();break;case"mouseenter":this.handleHover();break;case"selectstart":us(e)}}},Zh=(e,t)=>new _a(e,t),dn=(e=ae)=>new _t({duration:1*X.timeScale,onComplete:e},null,0).resume(),Zr=e=>{let t;return((...s)=>{let r,i,n,o,c;t&&(r=t.currentIteration,i=t.iterationProgress,n=t.reversed,o=t._alternate,c=t._startTime,t.revert());const u=e(...s);return u&&!Ve(u)&&u.revert&&(t=u),W(i)||(t.currentIteration=r,t.iterationProgress=(o&&r%2?!n:n)?1-i:i,t._startTime=c),u||ae})},wa=class{constructor(e={}){Ge.current&&Ge.current.register(this);const t=e.root;let s=ee;t&&(s=t.current||t.nativeElement||wt(t)[0]||ee);const r=e.defaults,i=X.defaults,n=e.mediaQueries;if(this.defaults=r?Pt(r,i):i,this.root=s,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.constructorsOnce=[],this.revertConstructorsOnce=[],this.revertiblesOnce=[],this.once=!1,this.onceIndex=0,this.methods={},this.matches={},this.mediaQueryLists={},this.data={},n)for(let o in n){const c=ht.matchMedia(n[o]);this.mediaQueryLists[o]=c,c.addEventListener("change",this)}}register(e){(this.once?this.revertiblesOnce:this.revertibles).push(e)}execute(e){let t=Ge.current,s=Ge.root,r=X.defaults;Ge.current=this,Ge.root=this.root,X.defaults=this.defaults;const i=this.mediaQueryLists;for(let o in i)this.matches[o]=i[o].matches;const n=e(this);return Ge.current=t,Ge.root=s,X.defaults=r,n}refresh(){return this.onceIndex=0,this.execute(()=>{let e=this.revertibles.length,t=this.revertConstructors.length;for(;e--;)this.revertibles[e].revert();for(;t--;)this.revertConstructors[t](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach(s=>{const r=s(this);Ve(r)&&this.revertConstructors.push(r)})}),this}add(e,t){if(this.once=!1,Ve(e)){const s=e;this.constructors.push(s),this.execute(()=>{const r=s(this);Ve(r)&&this.revertConstructors.push(r)})}else this.methods[e]=(...s)=>this.execute(()=>t(...s));return this}addOnce(e){if(this.once=!0,Ve(e)){const t=this.onceIndex++;if(this.constructorsOnce[t])return this;const s=e;this.constructorsOnce[t]=s,this.execute(()=>{const r=s(this);Ve(r)&&this.revertConstructorsOnce.push(r)})}return this}keepTime(e){this.once=!0;const t=this.onceIndex++,s=this.constructorsOnce[t];if(Ve(s))return s(this);const r=Zr(e);this.constructorsOnce[t]=r;let i;return this.execute(()=>{i=r(this)}),i}handleEvent(e){e.type==="change"&&this.refresh()}revert(){const e=this.revertibles,t=this.revertConstructors,s=this.revertiblesOnce,r=this.revertConstructorsOnce,i=this.mediaQueryLists;let n=e.length,o=t.length,c=s.length,u=r.length;for(;n--;)e[n].revert();for(;o--;)t[o](this);for(;c--;)s[c].revert();for(;u--;)r[u](this);for(let h in i)i[h].removeEventListener("change",this);e.length=0,t.length=0,this.constructors.length=0,s.length=0,r.length=0,this.constructorsOnce.length=0,this.onceIndex=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}},Jh=e=>new wa(e),Kh=()=>{const e=ee.createElement("div");ee.body.appendChild(e),e.style.height="100lvh";const t=e.offsetHeight;return ee.body.removeChild(e),t},Jr=(e,t)=>e&&Ve(e)?e(t):e,Kr=new Map,Qh=class{constructor(e){this.element=e,this.useWin=this.element===ee.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.scale=1,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new _t({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;Pe(this,s=>s.handleScroll(),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new _t({autoplay:!1,frameRate:30,onUpdate:t=>{const s=t.deltaTime,r=this.prevScrollX,i=this.prevScrollY,n=this.scrollX,o=this.scrollY,c=r-n,u=i-o;this.prevScrollX=n,this.prevScrollY=o,c&&(this.backwardX=r>n),u&&(this.backwardY=i>o),this.velocity=G(s>0?Math.sqrt(c*c+u*u)/s:0,5)}}).init(),this.resizeTicker=new _t({autoplay:!1,duration:250*X.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new _t({autoplay:!1,duration:500*X.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver(()=>this.resizeTicker.restart()),this.resizeObserver.observe(this.element),(this.useWin?ht:this.element).addEventListener("scroll",this,!1)}updateScrollCoords(){const e=this.useWin,t=this.element;this.scrollX=G(e?ht.scrollX:t.scrollLeft,0),this.scrollY=G(e?ht.scrollY:t.scrollTop,0)}updateWindowBounds(){this.winWidth=ht.innerWidth,this.winHeight=Kh()}updateBounds(){const e=getComputedStyle(this.element),t=this.element;this.scrollWidth=t.scrollWidth+parseFloat(e.marginLeft)+parseFloat(e.marginRight),this.scrollHeight=t.scrollHeight+parseFloat(e.marginTop)+parseFloat(e.marginBottom),this.updateWindowBounds();let s,r;if(this.useWin)s=this.winWidth,r=this.winHeight;else{const i=t.getBoundingClientRect();s=t.clientWidth,r=t.clientHeight,this.top=i.top,this.left=i.left,this.scale=i.width?s/i.width:i.height?r/i.height:1}this.width=s,this.height=r}refreshScrollObservers(){Pe(this,e=>{e.ready&&e._debug&&e.removeDebug()}),this.updateBounds(),Pe(this,e=>{e.ready&&(e.refresh(),e.onResize(e),e._debug&&e.debug())})}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(e){e.type==="scroll"&&this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.disconnect(),(this.useWin?ht:this.element).removeEventListener("scroll",this),Kr.delete(this.element)}},ed=e=>{const t=e&&wt(e)[0]||ee.body;let s=Kr.get(t);return s||(s=new Qh(t),Kr.set(t,s)),s},cr=(e,t,s,r,i)=>{const n=t==="min",o=t==="max",{n:c,u}=gt(t==="top"||t==="left"||t==="start"||n?0:t==="bottom"||t==="right"||t==="end"||o?"100%":t==="center"?"50%":t,rt);let h=c;return u==="%"?h=c/100*s:u&&(h=Fr(e,rt,"px",!0).n),o&&r<0&&(h+=r),n&&i>0&&(h+=i),h},Qr=(e,t,s,r,i)=>{let n;if(Ke(t)){const o=Fo.exec(t);if(o){const c=o[0],u=c[0],h=t.split(c),d=h[0]==="min",a=h[0]==="max",f=cr(e,h[0],s,r,i),l=cr(e,h[1],s,r,i);if(d){const p=Es(cr(e,"min",s),l,u);n=p<f?f:p}else if(a){const p=Es(cr(e,"max",s),l,u);n=p>f?f:p}else n=Es(f,l,u)}else n=cr(e,t,s,r,i)}else n=t;return G(n,0)},ka=e=>{let t;const s=e.targets;for(let r=0,i=s.length;r<i;r++){const n=s[r];if(n[Ss]){t=n;break}}return t},td=0,xa=["#FF4B4B","#FF971B","#FFC730","#F9F640","#7AFF5A","#18FF74","#17E09B","#3CFFEC","#05DBE9","#33B3F1","#638CF9","#C563FE","#FF4FCF","#F93F8A"],Ta=class{constructor(e={}){Ge.current&&Ge.current.register(this);const t=Y(e.sync,"play pause"),s=t?Kt(t):null,r=t&&(t==="linear"||t===kt),i=t&&!(s===kt&&!r),n=t&&(st(t)||t===!0||r),o=t&&Ke(t)&&!i&&!n,c=o?t.split(" ").map(h=>()=>{const d=this.linked;return d&&d[h]?d[h]():null}):null,u=o&&c.length>2;this.index=td++,this.id=W(e.id)?this.index:e.id,this.container=ed(e.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=i||n||!!c,this.syncEase=i?s:null,this.syncSmooth=n?t===!0||r?1:t:null,this.onSyncEnter=c&&!u&&c[0]?c[0]:ae,this.onSyncLeave=c&&!u&&c[1]?c[1]:ae,this.onSyncEnterForward=c&&u&&c[0]?c[0]:ae,this.onSyncLeaveForward=c&&u&&c[1]?c[1]:ae,this.onSyncEnterBackward=c&&u&&c[2]?c[2]:ae,this.onSyncLeaveBackward=c&&u&&c[3]?c[3]:ae,this.onEnter=e.onEnter||ae,this.onLeave=e.onLeave||ae,this.onEnterForward=e.onEnterForward||ae,this.onLeaveForward=e.onLeaveForward||ae,this.onEnterBackward=e.onEnterBackward||ae,this.onLeaveBackward=e.onLeaveBackward||ae,this.onUpdate=e.onUpdate||ae,this.onResize=e.onResize||ae,this.onSyncComplete=e.onSyncComplete||ae,this.reverted=!1,this.ready=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=["start","end","end","start"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=e,this._debug=Y(e.debug,!1),this._next=null,this._prev=null,Ft(this.container,this),dn(()=>{if(!this.reverted){if(!this.target){const h=wt(e.target)[0];this.target=h||ee.body,this.refresh()}this._debug&&this.debug()}})}link(e){if(e&&(e.pause(),this.linked=e,!W(e)&&!W(e.persist)&&(e.persist=!0),!this._params.target)){let t;W(e.targets)?Pe(e,s=>{s.targets&&!t&&(t=ka(s))}):t=ka(e),this.target=t||ee.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const e=(this.scroll-this.offsetStart)/this.distance;return e===1/0||isNaN(e)?0:G(Q(e,0,1),6)}refresh(){this.ready=!0,this.reverted=!1;const e=this._params;return this.repeat=Y(Jr(e.repeat,this),!0),this.horizontal=Y(Jr(e.axis,this),"y")==="x",this.enter=Y(Jr(e.enter,this),"end start"),this.leave=Y(Jr(e.leave,this),"start end"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const e=this.container,t=this.horizontal,s=e.element.querySelector(":scope > .animejs-onscroll-debug"),r=ee.createElement("div"),i=ee.createElement("div"),n=ee.createElement("div"),o=xa[this.index%xa.length],c=e.useWin,u=c?e.winWidth:e.width,h=c?e.winHeight:e.height,d=e.scrollWidth,a=e.scrollHeight,f=this.container.width>360?320:260,l=t?0:10,p=t?10:0,g=t?24:f/2,v=t?g:15,S=t?60:g,w=t?S:v,y=t?"repeat-x":"repeat-y",m=b=>t?"0px "+b+"px":b+"px 2px",_=b=>`linear-gradient(${t?90:0}deg, ${b} 2px, transparent 1px)`,C=(b,x,T,A,L)=>`position:${b};left:${x}px;top:${T}px;width:${A}px;height:${L}px;`;r.style.cssText=`${C("absolute",l,p,t?d:f,t?f:a)}
|
|
257
1536
|
pointer-events: none;
|
|
258
1537
|
z-index: ${this.container.zIndex++};
|
|
259
1538
|
display: flex;
|
|
260
1539
|
flex-direction: ${t?"column":"row"};
|
|
261
1540
|
filter: drop-shadow(0px 1px 0px rgba(0,0,0,.75));
|
|
262
|
-
`,i.style.cssText=`${
|
|
1541
|
+
`,i.style.cssText=`${C("sticky",0,0,t?u:g,t?g:h)}`,s||(i.style.cssText+=`background:
|
|
263
1542
|
${_("#FFFF")}${m(g-10)} / 100px 100px ${y},
|
|
264
1543
|
${_("#FFF8")}${m(g-10)} / 10px 10px ${y};
|
|
265
|
-
`),n.style.cssText=`${
|
|
1544
|
+
`),n.style.cssText=`${C("relative",0,0,t?d:g,t?g:a)}`,s||(n.style.cssText+=`background:
|
|
266
1545
|
${_("#FFFF")}${m(0)} / ${t?"100px 10px":"10px 100px"} ${y},
|
|
267
1546
|
${_("#FFF8")}${m(0)} / ${t?"10px 0px":"0px 10px"} ${y};
|
|
268
|
-
`);const
|
|
1547
|
+
`);const R=[" enter: "," leave: "];this.coords.forEach((b,x)=>{const T=x>1,A=(T?0:this.offset)+b,L=x%2,D=A<w,B=A>(T?t?u:h:t?d:a)-w,F=(T?L&&!D:!L&&!D)||B,P=ee.createElement("div"),M=ee.createElement("div"),O=t?F?"right":"left":F?"bottom":"top",I=F?(t?S:v)+(T?t?-1:B?0:-2:t?-1:-2):t?1:0;M.innerHTML=`${this.id}${R[L]}${this.thresholds[x]}`,P.style.cssText=`${C("absolute",0,0,S,v)}
|
|
269
1548
|
display: flex;
|
|
270
1549
|
flex-direction: ${t?"column":"row"};
|
|
271
|
-
justify-content: flex-${
|
|
272
|
-
align-items: flex-${
|
|
273
|
-
border-${
|
|
1550
|
+
justify-content: flex-${T?"start":"end"};
|
|
1551
|
+
align-items: flex-${F?"end":"start"};
|
|
1552
|
+
border-${O}: 2px solid ${o};
|
|
274
1553
|
`,M.style.cssText=`
|
|
275
1554
|
overflow: hidden;
|
|
276
1555
|
max-width: ${f/2-10}px;
|
|
277
1556
|
height: ${v};
|
|
278
|
-
margin-${t?
|
|
1557
|
+
margin-${t?F?"right":"left":F?"bottom":"top"}: -2px;
|
|
279
1558
|
padding: 1px;
|
|
280
1559
|
font-family: ui-monospace, monospace;
|
|
281
1560
|
font-size: 10px;
|
|
282
1561
|
letter-spacing: -.025em;
|
|
283
1562
|
line-height: 9px;
|
|
284
1563
|
font-weight: 600;
|
|
285
|
-
text-align: ${t&&
|
|
1564
|
+
text-align: ${t&&F||!t&&!T?"right":"left"};
|
|
286
1565
|
white-space: pre;
|
|
287
1566
|
text-overflow: ellipsis;
|
|
288
|
-
color: ${
|
|
289
|
-
background-color: ${
|
|
290
|
-
border: 2px solid ${
|
|
291
|
-
border-${t?
|
|
292
|
-
border-${t?
|
|
293
|
-
`,x.appendChild(M);let q=P-R+(t?1:0);x.style[t?"left":"top"]=`${q}px`,(E?i:n).appendChild(x)}),r.appendChild(i),r.appendChild(n),e.element.appendChild(r),s||r.classList.add("animejs-onscroll-debug"),this.$debug=r,Ot(e.element,"position")==="static"&&(this.debugStyles=Pt(e.element,{position:"relative "}))}updateBounds(){this._debug&&this.removeDebug();let e;const t=this.target,s=this.container,r=this.horizontal,i=this.linked;let n,o=t;for(i&&(n=i.currentTime,i.seek(0,!0));o&&o!==s.element&&o!==Q.body;){const C=Ot(o,"position")==="sticky"?Pt(o,{position:"static"}):!1;o=o.parentElement,C&&(e||(e=[]),e.push(C))}const a=t.getBoundingClientRect(),h=s.scale,u=(r?a.left+s.scrollX-s.left:a.top+s.scrollY-s.top)*h,p=(r?a.width:a.height)*h,c=r?s.width:s.height,f=(r?s.scrollWidth:s.scrollHeight)-c,l=this.enter,d=this.leave;let g="start",v="end",b="end",S="start";if(Be(l)){const C=l.split(" ");b=C[0],g=C.length>1?C[1]:g}else if(De(l)){const C=l;B(C.container)||(b=C.container),B(C.target)||(g=C.target)}else Fe(l)&&(b=l);if(Be(d)){const C=d.split(" ");S=C[0],v=C.length>1?C[1]:v}else if(De(d)){const C=d;B(C.container)||(S=C.container),B(C.target)||(v=C.target)}else Fe(d)&&(S=d);const y=lr(t,g,p),m=lr(t,v,p),_=y+u-c,k=m+u-f,w=lr(t,b,c,_,k),A=lr(t,S,c,_,k),O=y+u-w,E=m+u-A,P=E-O;this.offset=u,this.offsetStart=O,this.offsetEnd=E,this.distance=P<=0?0:P,this.thresholds=[g,v,b,S],this.coords=[y,m,w,A],e&&e.forEach(C=>C.revert()),i&&i.seek(n,!0),this._debug&&this.debug()}handleScroll(){if(!this.ready)return;const e=this.linked,t=this.sync,s=this.syncEase,r=this.syncSmooth,i=e&&(s||r),n=this.horizontal,o=this.container,a=this.scroll,h=a<=this.offsetStart,u=a>=this.offsetEnd,p=!h&&!u,c=a===this.offsetStart||a===this.offsetEnd,f=!this.hasEntered&&c,l=this._debug&&this.$debug;let d=!1,g=!1,v=this.progress;if(h&&this.began&&(this.began=!1),v>0&&!this.began&&(this.began=!0),i){const b=e.progress;if(r&&Fe(r)){if(r<1){const S=b<v&&v===1?1e-4:b>v&&!v?-1e-4:0;v=F(Lt(b,v,Lt(.01,.2,r))+S,6)}}else s&&(v=s(v));d=v!==this.prevProgress,g=b===1,d&&!g&&r&&b&&o.wakeTicker.restart()}if(l){const b=n?o.scrollY:o.scrollX;l.style[n?"top":"left"]=b+10+"px"}(p&&!this.isInView||f&&!this.forceEnter&&!this.hasEntered)&&(p&&(this.isInView=!0),!this.forceEnter||!this.hasEntered?(l&&p&&(l.style.zIndex=`${this.container.zIndex++}`),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,f&&(this.forceEnter=!0)):p&&(this.forceEnter=!1)),(p||!p&&this.isInView)&&(d=!0),d&&(i&&e.seek(e.duration*v),this.onUpdate(this)),!p&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),t&&!r&&(g=!0)),v>=1&&this.began&&!this.completed&&(t&&g||!t)&&(t&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!e||!this.repeat&&e&&e.completed)&&this.revert()),v<1&&this.completed&&(this.completed=!1),this.prevProgress=v}revert(){if(this.reverted)return;const e=this.container;return vt(e,this),e._head||e.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this.ready=!1,this}},Uc=(e={})=>new Qn(e),Jn=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,Wc=(e,t,s)=>{let r=0,i=1,n,o,a=0;do o=r+(i-r)/2,n=Jn(o,t,s)-e,n>0?i=o:r=o;while(lt(n)>1e-7&&++a<100);return o},Kn=(e=.5,t=0,s=.5,r=1)=>e===t&&s===r?it:i=>i===0||i===1?i:Jn(Wc(i,e,s),t,r),eo=(e=10,t)=>{const s=t?lc:es;return r=>s(j(r,0,1)*e)*(1/e)},si=(...e)=>{const t=e.length;if(!t)return it;const s=t-1,r=e[0],i=e[s],n=[0],o=[Ut(r)];for(let a=1;a<s;a++){const h=e[a],u=Be(h)?h.trim().split(" "):[h],p=u[0],c=u[1];n.push(B(c)?a/s:Ut(c)/100),o.push(Ut(p))}return o.push(Ut(i)),n.push(1),function(h){for(let u=1,p=n.length;u<p;u++){const c=n[u];if(h<=c){const f=n[u-1],l=o[u-1];return l+(o[u]-l)*(h-f)/(c-f)}}return o[o.length-1]}},to=(e=10,t=1)=>{const s=[0],r=e-1;for(let i=1;i<r;i++){const n=s[i-1],o=i/r,a=o+((i+1)/r-o)*Math.random(),h=o*(1-t)+a*t;s.push(j(h,n,1))}return s.push(1),si(...s)},Xc=jt({Spring:()=>sr,createSpring:()=>Un,cubicBezier:()=>Kn,eases:()=>xt,irregular:()=>to,linear:()=>si,spring:()=>rr,steps:()=>eo}),cr=(e,t=100)=>{const s=[];for(let r=0;r<=t;r++)s.push(F(e(r/t),4));return`linear(${s.join(", ")})`},so={},ro=e=>{let t=so[e];if(t)return t;if(t="linear",Be(e)){if(Ne(e,"linear")||Ne(e,"cubic-")||Ne(e,"steps")||Ne(e,"ease"))t=e;else if(Ne(e,"cubicB"))t=Fs(e);else{const s=$n(e);Ae(s)&&(t=s===it?"linear":cr(s))}so[e]=t}else if(Ae(e)){const s=cr(e);s&&(t=s)}else e.ease&&(t=cr(e.ease));return t},io=["x","y","z"],Yc=["perspective","width","height","margin","padding","top","right","bottom","left","borderWidth","fontSize","borderRadius",...io],Gc=[...io,...Vt.filter(e=>["X","Y","Z"].some(t=>e.endsWith(t)))],ri=null,ks=(e,t,s,r,i)=>{let n=Be(t)?t:Oe(t,s,r,i,null,null);return Fe(n)?Yc.includes(e)||Ne(e,"translate")?`${n}px`:Ne(e,"rotate")||Ne(e,"skew")?`${n}deg`:`${n}`:n},no=(e,t,s,r,i,n)=>{let o="0";const a=B(r)?getComputedStyle(e)[t]:ks(t,r,e,i,n);return B(s)?o=He(r)?r.map(h=>ks(t,h,e,i,n)):a:o=[ks(t,s,e,i,n),a],o},oo=class{constructor(e,t){Ie.current&&Ie.current.register(this),zt(ri)&&(_t&&(B(CSS)||!Object.hasOwnProperty.call(CSS,"registerProperty"))?ri=!1:(Vt.forEach(f=>{const l=Ne(f,"skew"),d=Ne(f,"scale"),g=Ne(f,"rotate"),v=Ne(f,"translate"),b=g||l,S=b?"<angle>":d?"<number>":v?"<length-percentage>":"*";try{CSS.registerProperty({name:"--"+f,syntax:S,inherits:!1,initialValue:v?"0px":b?"0deg":d?"1":"0"})}catch{}}),ri=!0));const s=Rt(e);s.length||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation.");const r=U(t.autoplay,z.defaults.autoplay),i=r&&r.link?r:!1,n=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,a=U(t.loop,z.defaults.loop),h=a===!0||a===1/0?1/0:Fe(a)?a+1:1,u=n?o?"alternate-reverse":"alternate":o?"reverse":"normal",p="both",c=z.timeScale===1?1:Ye;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||z.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=U(t.persist,z.defaults.persist),this.autoplay=r,this._speed=U(t.playbackRate,z.defaults.playbackRate),this._resolve=ne,this._completed=0,this._inlineStyles=[],s.forEach((f,l)=>{const d=f[gs],g=Gc.some(E=>t.hasOwnProperty(E)),v=f.style,b=this._inlineStyles[l]={},S=U(t.ease,z.defaults.ease),y=Oe(S,f,l,s,null,null),m=Ae(y)||Be(y)?y:S,_=S.ease&&S,k=ro(m),w=(_?_.settlingDuration:Oe(U(t.duration,z.defaults.duration),f,l,s,null,null))*c,A=Oe(U(t.delay,z.defaults.delay),f,l,s,null,null)*c,O=U(t.composition,"replace");for(let E in t){if(!Kt(E))continue;const P={},C={iterations:h,direction:u,fill:p,easing:k,duration:w,delay:A,composite:O},$=t[E],H=g?Vt.includes(E)?E:Br.get(E):!1,V=H?"transform":E;b[V]||(b[V]=v[V]);let x;if(De($)){const M=$,I=U(M.ease,k),R=I.ease&&I,q=M.to,J=M.from;if(C.duration=(R?R.settlingDuration:Oe(U(M.duration,w),f,l,s,null,null))*c,C.delay=Oe(U(M.delay,A),f,l,s,null,null)*c,C.composite=U(M.composition,O),C.easing=ro(I),x=no(f,E,J,q,l,s),H?(P[`--${H}`]=x,d[H]=x):P[E]=no(f,E,J,q,l,s),Wn(this,f,E,P,C),!B(J))if(!H)v[E]=P[E][0];else{const G=`--${H}`;v.setProperty(G,P[G][0])}}else x=He($)?$.map(M=>ks(E,M,f,l,s)):ks(E,$,f,l,s),H?(P[`--${H}`]=x,d[H]=x):P[E]=x,Wn(this,f,E,P,C)}if(g){let E="";for(let P in d)E+=`${un[P]}var(--${P})) `;v.transform=E}}),i&&this.autoplay.link(this)}forEach(e){try{const t=Be(e)?s=>s[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){const e=this.controlAnimation,t=z.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){const t=e*(z.timeScale===1?1:Ye);this.forEach(s=>{!this.persist&&t>=this.duration&&s.play(),s.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach("play")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach("pause"))}alternate(){return this.reversed=!this.reversed,this.forEach("reverse"),this.paused&&this.forEach("pause"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach("commitStyles")}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach("cancel"),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform==="none"&&e.style.removeProperty("transform")})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{const s=e.style,r=this._inlineStyles[t];for(let i in r){const n=r[i];B(n)||n===""?s.removeProperty(Fs(i)):e.style[i]=n}e.getAttribute("style")===""&&e.removeAttribute("style")}),this}then(e=ne){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=ne};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},ao={animate:(e,t)=>new oo(e,t),convertEase:cr},Zc=0,jc=0,ur=(e,t)=>!e||!t?!1:e===t||e.contains(t),ns=e=>{if(!e)return null;const t=e.style,s=t.transition||"";return t.setProperty("transition","none","important"),s},hr=(e,t)=>{if(!e)return;const s=e.style;t?s.transition=t:s.removeProperty("transition")},Qc=e=>{const t=e.layout.transitionMuteStore,s=e.$el,r=e.$measure;s&&!t.has(s)&&t.set(s,ns(s)),r&&!t.has(r)&&t.set(r,ns(r))},pr=e=>{e.forEach((t,s)=>hr(s,t)),e.clear()},Jc={display:"none",visibility:"hidden",opacity:"0",transform:"none",position:"static"},Kc=e=>{if(!e)return;const t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},lo=(e,t,s,r)=>{let i=e.dataset.layoutId;i||(i=e.dataset.layoutId=`node-${jc++}`);const n=r||{};return n.$el=e,n.$measure=e,n.id=i,n.index=0,n.targets=null,n.delay=0,n.duration=0,n.ease=null,n.state=s,n.layout=s.layout,n.parentNode=t||null,n.isTarget=!1,n.isEntering=!1,n.isLeaving=!1,n.isInlined=!1,n.hasTransform=!1,n.inlineStyles=[],n.inlineTransforms=null,n.inlineTransition=null,n.branchAdded=!1,n.branchRemoved=!1,n.branchNotRendered=!1,n.sizeChanged=!1,n.hasVisibilitySwap=!1,n.hasDisplayNone=!1,n.hasVisibilityHidden=!1,n.measuredInlineTransform=null,n.measuredInlineTransition=null,n.measuredDisplay=null,n.measuredVisibility=null,n.measuredPosition=null,n.measuredHasDisplayNone=!1,n.measuredHasVisibilityHidden=!1,n.measuredIsVisible=!1,n.measuredIsRemoved=!1,n.measuredIsInsideRoot=!1,n.properties={transform:"none",x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},n.layout.properties.forEach(o=>n.properties[o]=0),n._head=null,n._tail=null,n._prev=null,n._next=null,n},co=(e,t,s,r)=>{const i=e.$el,n=e.layout.root,o=n===i,a=e.properties,h=e.state.rootNode,u=e.parentNode,p=s.transform,c=i.style.transform,f=u?u.measuredIsRemoved:!1,l=s.position;o&&(e.layout.absoluteCoords=l==="fixed"||l==="absolute"),e.$measure=t,e.inlineTransforms=c,e.hasTransform=p&&p!=="none",e.measuredIsInsideRoot=ur(n,t),e.measuredInlineTransform=null,e.measuredDisplay=s.display,e.measuredVisibility=s.visibility,e.measuredPosition=l,e.measuredHasDisplayNone=s.display==="none",e.measuredHasVisibilityHidden=s.visibility==="hidden",e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||f;let d=!1,g=i.previousSibling;for(;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.previousSibling;if(g&&g.nodeType===Node.TEXT_NODE)d=!0;else{for(g=i.nextSibling;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.nextSibling;d=g!==null&&g.nodeType===Node.TEXT_NODE}if(e.isInlined=d,e.hasTransform&&!r){const k=e.layout.transitionMuteStore;k.get(i)||(e.inlineTransition=ns(i)),t===i?i.style.transform="none":(k.get(t)||(e.measuredInlineTransition=ns(t)),e.measuredInlineTransform=t.style.transform,t.style.transform="none")}let v=0,b=0,S=0,y=0;if(!r){const k=t.getBoundingClientRect();v=k.left,b=k.top,S=k.width,y=k.height}for(let k in a){const w=k==="transform"?p:s[k]||s.getPropertyValue&&s.getPropertyValue(k);B(w)||(a[k]=w)}a.left=v,a.top=b,a.clientLeft=r?0:t.clientLeft,a.clientTop=r?0:t.clientTop;let m,_;if(o)e.layout.absoluteCoords?(m=v,_=b):(m=0,_=0);else{const k=u||h,w=k.properties.left,A=k.properties.top,O=k.properties.clientLeft,E=k.properties.clientTop;if(e.layout.absoluteCoords)m=v-w-O,_=b-A-E;else if(k===h){const P=h.properties.left,C=h.properties.top,$=h.properties.clientLeft,H=h.properties.clientTop;m=v-P-$,_=b-C-H}else m=v-w-O,_=b-A-E}return a.x=m,a.y=_,a.width=S,a.height=y,e},uo=(e,t)=>{if(t)for(let s in t)e.properties[s]=t[s]},ws=(e,t)=>{const s=Oe(t.ease,e.$el,e.index,e.targets,null,null),r=Ae(s)?s:t.ease,i=!B(r)&&!B(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:Oe(t.duration,e.$el,e.index,e.targets,null,null),e.delay=Oe(t.delay,e.$el,e.index,e.targets,null,null)},eu=e=>{const t=e.$el.style,s=e.inlineStyles;s.length=0,e.layout.recordedProperties.forEach(r=>{s.push(r,t[r]||"")})},ho=e=>{const t=e.$el.style,s=e.inlineStyles;for(let r=0,i=s.length;r<i;r+=2){const n=s[r],o=s[r+1];o&&o!==""?t[n]=o:(t[n]="",t.removeProperty(n))}},tu=e=>{const t=e.inlineTransforms,s=e.$el.style;!e.hasTransform||!t||e.hasTransform&&s.transform==="none"||t&&t==="none"?s.removeProperty("transform"):t&&(s.transform=t);const r=e.$measure;if(e.hasTransform&&r!==e.$el){const i=r.style,n=e.measuredInlineTransform;n&&n!==""?i.transform=n:i.removeProperty("transform")}e.measuredInlineTransform=null,e.inlineTransition!==null&&(hr(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(hr(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},po=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty("display"),e.$el.style.removeProperty("visibility"),e.hasVisibilitySwap&&(e.$measure.style.removeProperty("display"),e.$measure.style.removeProperty("visibility"))),e.layout.pendingRemoval.delete(e.$el)},ii=(e,t,s)=>(t.properties={...e.properties},t.state=s,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),fo=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute("data-layout-id"),e.$measure.removeAttribute("data-layout-id")}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){const s=this.getNode(e);if(s)return s.properties[t]}forEach(e,t){let s=e,r=0;for(;s;)if(t(s,r++),s._head)s=s._head;else if(s._next)s=s._next;else{for(;s&&!s._next;)s=s.parentNode;s&&(s=s._next)}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(const t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,ns(e));const s=[e,t],r=this.layout.root;let i=null;for(;s.length;){const n=s.pop(),o=s.pop();if(!o||o.nodeType!==1||Vs(o))continue;const a=n?n.measuredIsRemoved:!1,h=a?Jc:getComputedStyle(o),u=a?!0:h.display==="none",p=a?!0:h.visibility==="hidden",c=!u&&!p,f=o.dataset.layoutId,l=ur(r,o);let d=f?this.nodes.get(f):null;if(d&&d.$el!==o){const v=ur(r,d.$el),b=d.measuredIsVisible,S=!v&&(l||!l&&!b&&c),y=v&&!b&&c;if(S)Kc(d),d=lo(o,n,this,d);else if(y){co(d,o,h,a);let m=o.lastElementChild;for(;m;)s.push(m,d),m=m.previousElementSibling;i||(i=d);continue}else{let m=o.lastElementChild;for(;m;)s.push(m,n),m=m.previousElementSibling;i||(i=d);continue}}else d=lo(o,n,this,d);d.branchAdded=!1,d.branchRemoved=!1,d.branchNotRendered=!1,d.isTarget=!1,d.sizeChanged=!1,d.hasVisibilityHidden=p,d.hasDisplayNone=u,d.hasVisibilitySwap=p&&!d.measuredHasVisibilityHidden||u&&!d.measuredHasDisplayNone,this.nodes.set(d.id,d),d.parentNode=n||null,d._prev=null,d._next=null,n?(this.rootNodes.delete(d),n._head?(n._tail._next=d,d._prev=n._tail,n._tail=d):(n._head=d,n._tail=d)):this.rootNodes.add(d),co(d,d.$el,h,a);let g=o.lastElementChild;for(;g;)s.push(g,d),g=g.previousElementSibling;i||(i=d)}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;const s=e.dataset.layoutId,r=s?this.nodes.get(s):null;if(r&&r.$el===e)return r;let i=null,n=e.parentElement;for(;n&&n!==this.layout.root;){if(t.has(n)){i=this.ensureDetachedNode(n,t);break}n=n.parentElement}return this.registerElement(e,i)}record(){const e=this.layout,t=e.children,s=e.root,r=He(t)?t:[t],i=[],n=t==="*"?s:Ie.root,o=[];let a=s.parentElement;for(;a&&a.nodeType===1;){const g=getComputedStyle(a);if(g.transform&&g.transform!=="none"){const v=a.style.transform||"",b=ns(a);o.push(a,v,b),a.style.transform="none"}a=a.parentElement}for(let g=0,v=r.length;g<v;g++){const b=r[g];i[g]=Be(b)?n.querySelectorAll(b):b}const h=Rt(i);this.nodes.clear(),this.rootNodes.clear();const u=this.registerElement(s,null);u.isTarget=!0,this.rootNode=u;const p=new Set;let c=0;const f=[];this.nodes.forEach(g=>{f.push(g.$el)}),this.nodes.forEach((g,v)=>{g.index=c++,g.targets=f,g&&g.measuredIsInsideRoot&&p.add(v)});const l=new Set,d=[];for(let g=0,v=h.length;g<v;g++){const b=h[g];if(!(!b||b.nodeType!==1||b===s)){if(!ur(s,b)){const S=b.dataset.layoutId;if(!S||!p.has(S))continue}l.has(b)||(l.add(b),d.push(b))}}for(let g=0,v=d.length;g<v;g++)this.ensureDetachedNode(d[g],l);for(let g=0,v=h.length;g<v;g++){const b=h[g],S=this.getNode(b);if(S){let y=S;for(;y&&!y.isTarget;)y.isTarget=!0,y=y.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(tu);for(let g=0,v=o.length;g<v;g+=3){const b=o[g],S=o[g+1],y=o[g+2];S&&S!==""?b.style.transform=S:b.style.removeProperty("transform"),hr(b,y)}return this}};function os(e){const t={},s={};for(let r in e){const i=e[r],n=r==="ease";r==="duration"||r==="delay"||n?s[r]=i:t[r]=i}return[t,s]}var go=class{constructor(e,t={}){Ie.current&&Ie.current.register(this);const s=os(t.swapAt),r=os(t.enterFrom),i=os(t.leaveTo),n=t.properties;if(t.duration=U(t.duration,350),t.delay=U(t.delay,0),t.ease=U(t.ease,"inOut(3.5)"),this.params=t,this.root=Rt(e)[0],this.id=t.id||Zc++,this.children=t.children||"*",this.absoluteCoords=!1,this.swapAtParams=ct(t.swapAt||{opacity:0},{ease:"inOut(1.75)"}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set(["opacity","fontSize","color","backgroundColor","borderRadius","border","filter","clipPath"]),s[0])for(let o in s[0])this.properties.add(o);if(r[0])for(let o in r[0])this.properties.add(o);if(i[0])for(let o in i[0])this.properties.add(o);if(n)for(let o=0,a=n.length;o<a;o++)this.properties.add(n[o]);this.recordedProperties=new Set(["display","visibility","translate","position","left","top","marginLeft","marginTop","width","height","maxWidth","maxHeight","minWidth","minHeight"]),this.properties.forEach(o=>this.recordedProperties.add(o)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new fo(this),this.newState=new fo(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),pr(this.transitionMuteStore)}revert(){return this.root.classList.remove("is-animated"),this.timeline&&(this.timeline.complete(),this.timeline=null),this.transformAnimation&&(this.transformAnimation.complete(),this.transformAnimation=null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>pr(this.transitionMuteStore)),this}record(){return this.transformAnimation&&(this.transformAnimation.cancel(),this.transformAnimation=null),this.oldState.record(),this.timeline&&(this.timeline.cancel(),this.timeline=null),this.newState.forEachRootNode(ho),this}animate(e={}){const t={ease:U(e.ease,this.params.ease),delay:U(e.delay,this.params.delay),duration:U(e.duration,this.params.duration)},s={id:this.id},r=U(e.onComplete,this.params.onComplete),i=U(e.onPause,this.params.onPause);for(let x in ms)x!=="ease"&&x!=="duration"&&x!=="delay"&&(B(e[x])?B(this.params[x])||(s[x]=this.params[x]):s[x]=e[x]);s.onComplete=()=>{const x=e.autoplay,M=z.editor;if(x&&x.linked||M&&M.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(I=>{po(I),ho(I)});for(let I=0,R=w.length;I<R;I++){const q=w[I];q.style.transform=g.getComputedValue(q,"transform")}this.root.classList.contains("is-animated")&&(this.root.classList.remove("is-animated"),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains("is-animated")||pr(this.transitionMuteStore)})},s.onPause=()=>{const x=e.autoplay;if(x&&x.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains("is-animated")&&(this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(po),this.root.classList.remove("is-animated"),r&&r(this.timeline),i&&i(this.timeline))},s.composition=!1;const n=ct(ct(e.swapAt||{},this.swapAtParams),t),o=ct(ct(e.enterFrom||{},this.enterFromParams),t),a=ct(ct(e.leaveTo||{},this.leaveToParams),t),[h,u]=os(n),[p,c]=os(o),[f,l]=os(a),d=this.oldState,g=this.newState,v=this.animating,b=this.swapping,S=this.entering,y=this.leaving,m=this.pendingRemoval;v.length=b.length=S.length=y.length=0,d.forEachRootNode(Qc),g.record(),g.forEachRootNode(eu);const _=[],k=[],w=[],A=[],O=g.rootNode,E=O.$el;g.forEachRootNode(x=>{const M=x.$el,I=x.id,R=x.parentNode,q=R?R.branchAdded:!1,J=R?R.branchRemoved:!1,G=R?R.branchNotRendered:!1;let W=d.nodes.get(I);const ee=!W;ee?(W=ii(x,{},d),d.nodes.set(I,W),W.measuredIsRemoved=!0):W.measuredIsRemoved&&!x.measuredIsRemoved&&(ii(x,W,d),W.measuredIsRemoved=!0);const X=W.parentNode,oe=(X?X.id:null)!==(R?R.id:null),pe=W.$el!==x.$el,ce=W.measuredIsRemoved,ie=x.measuredIsRemoved;if(!W.measuredIsRemoved&&!ie&&!ee&&(oe||pe)){const _e=W.properties.left,Ce=W.properties.top,Te=R||g.rootNode,be=Te.id?d.nodes.get(Te.id):null,se=be?be.properties.left:Te.properties.left,ge=be?be.properties.top:Te.properties.top,T=be?be.properties.clientLeft:Te.properties.clientLeft,N=be?be.properties.clientTop:Te.properties.clientTop;W.properties.x=_e-se-T,W.properties.y=Ce-ge-N}x.hasVisibilitySwap&&(x.hasVisibilityHidden&&(x.$el.style.visibility="visible",x.$measure.style.visibility="hidden"),x.hasDisplayNone&&(x.$el.style.display=W.measuredDisplay||x.measuredDisplay||"",x.$measure.style.visibility="hidden"));const K=m.has(M),ae=W.measuredIsVisible,xe=x.measuredIsVisible,ue=!ae&&xe&&!G,te=!ie&&(ce||K)&&!q,fe=ie&&!ce&&!J,me=fe||ie&&K&&!J;x.branchAdded=q||te,x.branchRemoved=J||me,x.branchNotRendered=G||ie,ie&&ae&&(x.$el.style.display=W.measuredDisplay,x.$el.style.visibility="visible",ii(W,x,g)),fe?(x.isTarget&&(y.push(M),x.isLeaving=!0),m.add(M)):!ie&&K&&m.delete(M),te&&!G||ue?(uo(W,p),x.isTarget&&(S.push(M),x.isEntering=!0)):me&&!G&&uo(x,f),x!==O&&x.isTarget&&!x.isEntering&&!x.isLeaving&&v.push(M),_.push(M)});let P=0,C=0,$=0;g.forEachRootNode(x=>{const M=x.$el,I=x.parentNode,R=d.nodes.get(x.id),q=x.properties,J=R.properties;let G=I!==O&&I;for(;G&&!G.isTarget&&G!==O;)G=G.parentNode;x===O?(x.index=0,x.targets=v,ws(x,t)):x.isEntering?(x.index=G?G.index:P,x.targets=G?v:S,ws(x,c),P++):x.isLeaving?(x.index=G?G.index:C,x.targets=G?v:y,C++,ws(x,l)):x.isTarget?(x.index=$++,x.targets=v,ws(x,t)):(x.index=G?G.index:0,x.targets=v,ws(x,u)),R.index=x.index,R.targets=x.targets;for(let oe in q)q[oe]=Oe(q[oe],M,x.index,x.targets,null,null),J[oe]=Oe(J[oe],M,R.index,R.targets,null,null);const W=1,ee=Math.abs(q.width-J.width)>W,X=Math.abs(q.height-J.height)>W;if(x.sizeChanged=ee||X,x.isTarget&&(!x.measuredIsRemoved&&R.measuredIsVisible||x.measuredIsRemoved&&x.measuredIsVisible)){(q.transform!=="none"||J.transform!=="none")&&(x.hasTransform=!0,w.push(M));for(let oe in q)if(oe!=="transform"&&q[oe]!==J[oe]){k.push(M);break}}x.isTarget||(b.push(M),x.sizeChanged&&I&&I.isTarget&&I.sizeChanged&&(h.transform&&(x.hasTransform=!0,w.push(M)),A.push(M)))});const H={delay:x=>g.getNode(x).delay,duration:x=>g.getNode(x).duration,ease:x=>g.getNode(x).ease};if(s.defaults=H,this.timeline=zn(s),!k.length&&!w.length&&!b.length)return pr(this.transitionMuteStore),this.timeline.complete();if(_.length){this.root.classList.add("is-animated");for(let x=0,M=_.length;x<M;x++){const I=_[x],R=I.dataset.layoutId,q=d.nodes.get(R),J=g.nodes.get(R),G=q.properties;J.isInlined||((q.measuredDisplay==="grid"||J.measuredDisplay==="grid")&&I.style.setProperty("display","block","important"),(I!==E||this.absoluteCoords)&&(I.style.position=this.absoluteCoords?"fixed":"absolute",I.style.left="0px",I.style.top="0px",I.style.marginLeft="0px",I.style.marginTop="0px",I.style.translate=`${G.x}px ${G.y}px`),I===E&&J.measuredPosition==="static"&&(I.style.position="relative",I.style.left="0px",I.style.top="0px")),I.style.width=`${G.width}px`,I.style.height=`${G.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none"}(d.scrollX!==window.scrollX||d.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(d.scrollX,d.scrollY));for(let x=0,M=k.length;x<M;x++){const I=k[x],R=I.dataset.layoutId,q=d.nodes.get(R),J=g.nodes.get(R),G=q.properties,W=J.properties;let ee=!1;const X={composition:"none"};G.width!==W.width&&(X.width=[G.width,W.width],ee=!0),G.height!==W.height&&(X.height=[G.height,W.height],ee=!0),!J.hasTransform&&!J.isInlined&&(X.translate=[`${G.x}px ${G.y}px`,`${W.x}px ${W.y}px`],ee=!0),this.properties.forEach(oe=>{const pe=G[oe],ce=W[oe];oe!=="transform"&&pe!==ce&&(X[oe]=[pe,ce],ee=!0)}),ee&&this.timeline.add(I,X,0)}}if(b.length){for(let x=0,M=b.length;x<M;x++){const I=b[x],R=d.getNode(I),q=R.properties;I.style.width=`${q.width}px`,I.style.height=`${q.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none",R.isInlined||(I.style.translate=`${q.x}px ${q.y}px`),this.properties.forEach(J=>{J!=="transform"&&(I.style[J]=`${d.getComputedValue(I,J)}`)})}for(let x=0,M=b.length;x<M;x++){const I=b[x],R=g.getNode(I),q=R.properties;this.timeline.call(()=>{I.style.width=`${q.width}px`,I.style.height=`${q.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none",R.isInlined||(I.style.translate=`${q.x}px ${q.y}px`),this.properties.forEach(J=>{J!=="transform"&&(I.style[J]=`${g.getComputedValue(I,J)}`)})},R.delay+R.duration/2)}if(A.length){const x=Tt(g.nodes.get(A[0].dataset.layoutId).ease),M=R=>1-x(1-R),I={};if(h)for(let R in h)R!=="transform"&&(I[R]=[{from:q=>d.getComputedValue(q,R),to:h[R]},{from:h[R],to:q=>g.getComputedValue(q,R),ease:M}]);this.timeline.add(A,I,0)}}const V=w.length;if(V){for(let x=0;x<V;x++){const M=w[x],I=g.getNode(M);I.isInlined||(M.style.translate=`${d.getComputedValue(M,"x")}px ${d.getComputedValue(M,"y")}px`),M.style.transform=d.getComputedValue(M,"transform"),A.includes(M)&&(I.ease=Oe(n.ease,M,I.index,I.targets,null,null),I.duration=Oe(n.duration,M,I.index,I.targets,null,null))}this.transformAnimation=ao.animate(w,{translate:x=>g.getNode(x).isInlined?"0px 0px":`${g.getComputedValue(x,"x")}px ${g.getComputedValue(x,"y")}px`,transform:x=>{const M=g.getComputedValue(x,"transform");if(!A.includes(x))return M;const I=d.getComputedValue(x,"transform"),R=g.getNode(x);return[I,Oe(h.transform,x,R.index,R.targets,null,null),M]},autoplay:!1,...H}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},su=(e,t)=>new go(e,t),ut=Ec,fr={},ru=(e,t=0)=>(...s)=>t?r=>e(...s,r):r=>e(r,...s),mo=e=>(...t)=>{const s=e(...t);return new Proxy(ne,{apply:(r,i,[n])=>s(n),get:(r,i)=>{if(fr[i])return mo((...n)=>{const o=fr[i](...n);return a=>o(s(a))})}})},ht=(e,t,s=0)=>{const r=(...i)=>(i.length<t.length?mo(ru(t,s)):t)(...i);return fr[e]||(fr[e]=r),r},vo=ht("roundPad",ut.roundPad),yo=ht("padStart",ut.padStart),bo=ht("padEnd",ut.padEnd),_o=ht("wrap",ut.wrap),So=ht("mapRange",ut.mapRange),ko=ht("degToRad",ut.degToRad),wo=ht("radToDeg",ut.radToDeg),xo=ht("snap",ut.snap),To=ht("clamp",ut.clamp),Co=ht("round",ut.round),Po=ht("lerp",ut.lerp,1),Eo=ht("damp",ut.damp,1),xs=(e=0,t=1,s=0)=>{const r=10**s;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},iu=0,Ts=(e,t=0,s=1,r=0)=>{let i=e===void 0?iu++:e;return(n=t,o=s,a=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);const h=10**a;return Math.floor((((i^i>>>14)>>>0)/4294967296*(o-n+1/h)+n)*h)/h}},Ao=e=>e[xs(0,e.length-1)],ni=(e,t=xs)=>{let s=e.length,r,i;for(;s;)i=t(0,--s),r=e[s],e[s]=e[i],e[i]=r;return e},Cs=(e,t={})=>{let s=[],r=0,i,n=null;const o=t.from,a=t.reversed,h=t.ease,u=!B(h),p=u&&!B(h.ease)?h.ease:u?Tt(h):null,c=t.grid,f=c===!0,l=t.axis,d=t.total,g=B(o)||o===0||o==="first",v=o==="center",b=o==="last",S=o==="random",y=He(o),m=He(e),_=t.use,k=Ut(m?e[0]:e),w=m?Ut(e[1]):0,A=pn.exec((m?e[1]:e)+""),O=t.start||0+(m?k:0),E=t.seed,P=!B(E)&&E!==!1?Ts(E===!0?0:E):xs,C=t.jitter,$=!B(C),H=He(C),V=H?C[0]:C||0,x=H?C[1]:C||0;let M=g?0:Fe(o)?o:0;return(I,R,q,J,G)=>{const[W]=Rt(I),ee=B(d)?q.length:d,X=B(_)?!1:Ae(_)?_(W,R,ee):Yt(W,_),oe=Fe(X)||Be(X)&&Fe(+X)?+X:R,pe=oe>=0&&oe<ee?oe:R;if(v&&(M=(ee-1)/2),b&&(M=ee-1),!s.length){if(f){let K=!0,ae=!1,xe=1/0,ue=1/0,te=1/0,fe=-1/0,me=-1/0,_e=-1/0;const Ce=[],Te=[],be=[];for(let se=0;se<ee;se++){const ge=q[se];let T=0,N=0,L=0,D=!1;if(ge&&Ae(ge.getBoundingClientRect)){const Z=ge.getBoundingClientRect();T=Z.left+Z.width/2,N=Z.top+Z.height/2,D=!0}else{const Z=ge;Z&&Fe(Z.x)&&Fe(Z.y)&&(T=Z.x,N=Z.y,Fe(Z.z)&&(L=Z.z,ae=!0),D=!0)}if(!D){K=!1;break}Ce.push(T),Te.push(N),be.push(L),T<xe&&(xe=T),N<ue&&(ue=N),L<te&&(te=L),T>fe&&(fe=T),N>me&&(me=N),L>_e&&(_e=L)}if(K){let se=Ce[0],ge=Te[0],T=be[0];y?(se=xe+o[0]*(fe-xe),ge=ue+o[1]*(me-ue),T=ae?te+(o.length>=3?o[2]:.5)*(_e-te):0):v?(se=(xe+fe)/2,ge=(ue+me)/2,T=(te+_e)/2):b?(se=Ce[ee-1],ge=Te[ee-1],T=be[ee-1]):Fe(o)&&(se=Ce[o],ge=Te[o],T=be[o]);for(let L=0;L<ee;L++){const D=se-Ce[L],Z=ge-Te[L],Y=T-be[L];let we=at(D*D+Z*Z+(ae?Y*Y:0));l==="x"&&(we=-D),l==="y"&&(we=-Z),l==="z"&&(we=-Y),s.push(we)}let N=1/0;for(let L=0;L<ee;L++){const D=lt(s[L]);D>0&&D<N&&(N=D)}if(N>0&&N<1/0)for(let L=0;L<ee;L++)s[L]=s[L]/N}else for(let se=0;se<ee;se++)s.push(lt(M-se))}else for(let K=0;K<ee;K++)if(!c)s.push(lt(M-K));else{const ae=c.length,xe=c[0]*c[1];let ue,te,fe;y?(ue=o[0]*(c[0]-1),te=o[1]*(c[1]-1),fe=ae===3?(o.length>=3?o[2]:.5)*(c[2]-1):0):v?(ue=(c[0]-1)/2,te=(c[1]-1)/2,fe=ae===3?(c[2]-1)/2:0):(ue=M%c[0],te=es(M/c[0])%c[1],fe=ae===3?es(M/xe):0);const me=K%c[0],_e=es(K/c[0])%c[1],Ce=ae===3?es(K/xe):0,Te=ue-me,be=te-_e,se=fe-Ce;let ge=at(Te*Te+be*be+(ae===3?se*se:0));l==="x"&&(ge=-Te),l==="y"&&(ge=-be),l==="z"&&(ge=-se),s.push(ge)}r=s[0];for(let K=1;K<ee;K++)s[K]>r&&(r=s[K]);if(p||a)for(let K=0;K<ee;K++){let ae=s[K];p&&(ae=p(ae/r)*r),a&&(ae=l?-ae:lt(r-ae)),s[K]=ae}if($){n=new Array(ee);for(let K=0;K<ee;K++)n[K]=P(-1,1,4)}S&&(s=ni(s,P))}const ce=m?(w-k)/r:k;B(i)&&(i=G?bs(G,B(t.start)?G.iterationDuration:O):O);let ie=i+(ce*F(s[pe],2)||0);if($){const K=r?s[pe]/r:0,ae=V+(x-V)*K;ie=ie+n[pe]*ae}return t.modifier&&(ie=t.modifier(ie)),A&&(ie=`${ie}${A[2]}`),ie}},nu=jt({$:()=>Rt,addChild:()=>yt,clamp:()=>To,cleanInlineStyles:()=>Cn,createSeededRandom:()=>Ts,damp:()=>Eo,degToRad:()=>ko,forEachChildren:()=>ke,get:()=>Ot,keepTime:()=>nr,lerp:()=>Po,mapRange:()=>So,padEnd:()=>bo,padStart:()=>yo,radToDeg:()=>wo,random:()=>xs,randomPick:()=>Ao,remove:()=>Xn,removeChild:()=>vt,round:()=>Co,roundPad:()=>vo,set:()=>Pt,shuffle:()=>ni,snap:()=>xo,stagger:()=>Cs,sync:()=>ti,wrap:()=>_o}),Lo=e=>{const t=rt(e)[0];return!t||!Vs(t)?console.warn(`${e} is not a valid SVGGeometryElement`):t},oi=(e,t,s,r,i)=>{const n=s+r,o=i?Math.max(0,Math.min(n,t)):(n%t+t)%t;return e.getPointAtLength(o)},ai=(e,t,s=0)=>r=>{const i=+e.getTotalLength(),n=r[Dr],o=e.getCTM(),a=s===0;return{from:0,to:i,modifier:h=>{const u=h+s*i;if(t==="a"){const p=oi(e,i,u,-1,a),c=oi(e,i,u,1,a);return Us(c.y-p.y,c.x-p.x)*180/St}else{const p=oi(e,i,u,0,a);return t==="x"?n||!o?p.x:p.x*o.a+p.y*o.c+o.e:n||!o?p.y:p.x*o.b+p.y*o.d+o.f}}}},Ro=(e,t=0)=>{const s=Lo(e);if(s)return{translateX:ai(s,"x",t),translateY:ai(s,"y",t),rotate:ai(s,"a",t)}},ou=e=>{let t=1;if(e&&e.getCTM){const s=e.getCTM();s&&(t=(at(s.a*s.a+s.b*s.b)+at(s.c*s.c+s.d*s.d))/2)}return t},au=(e,t,s)=>{const r=Ye,i=getComputedStyle(e),n=i.strokeLinecap,o=i.vectorEffect==="non-scaling-stroke"?e:null;let a=n;const h=new Proxy(e,{get(u,p){const c=u[p];return p===cn?u:p==="setAttribute"?(...f)=>{if(f[0]==="draw"){const l=f[1].split(" "),d=+l[0],g=+l[1],v=ou(o),b=d*-r*v,S=g*r*v+b,y=r*v+(d===0&&g===1||d===1&&g===0?0:10*v)-S;if(n!=="butt"){const m=d===g?"butt":n;a!==m&&(u.style.strokeLinecap=`${m}`,a=m)}u.setAttribute("stroke-dashoffset",`${b}`),u.setAttribute("stroke-dasharray",`${S} ${y}`)}return Reflect.apply(c,u,f)}:Ae(c)?(...f)=>Reflect.apply(c,u,f):c}});return e.getAttribute("pathLength")!==`${r}`&&(e.setAttribute("pathLength",`${r}`),h.setAttribute("draw",`${t} ${s}`)),h},Io=(e,t=0,s=0)=>rt(e).map(r=>au(r,t,s)),Oo=(e,t=.33)=>(s,r,i,n)=>{if(!(s.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${s.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const o=Lo(e);if(!o)throw new Error("Can't morph to an invalid target. 'path2' must resolve to an existing <path>, <polygon> or <polyline> SVG element.");if(!(o.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${o.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const a=s.tagName==="path",h=a?" ":",",u=n?n._value:null;u&&s.setAttribute(a?"d":"points",u);let p="",c="";if(!t)p=s.getAttribute(a?"d":"points"),c=o.getAttribute(a?"d":"points");else{const f=s.getTotalLength(),l=o.getTotalLength(),d=Math.max(Math.ceil(f*t),Math.ceil(l*t));for(let g=0;g<d;g++){const v=g/(d-1),b=s.getPointAtLength(f*v),S=o.getPointAtLength(l*v),y=a?g===0?"M":"L":"";p+=y+F(b.x,3)+h+b.y+" ",c+=y+F(S.x,3)+h+S.y+" "}}return[p,c]},lu=jt({createDrawable:()=>Io,createMotionPath:()=>Ro,morphTo:()=>Oo}),dr=typeof Intl<"u"&&Intl.Segmenter,cu=/\{value\}/g,uu=/\{i\}/g,li=/(\s+)/,ci=/^\s+$/,ui="line",Ps="word",Es="char",As="data-line",hi=null,pi=null,gr=null,No=e=>e.isWordLike||e.segment===" "||Fe(+e.segment),fi=e=>e.setAttribute("aria-hidden","true"),mr=(e,t)=>[...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)],hu={line:"#00D672",word:"#FF4B4B",char:"#5A87FF"},Mo=e=>{if(!e.childElementCount&&!e.textContent.trim()){const t=e.parentElement;e.remove(),t&&Mo(t)}},Do=(e,t,s)=>{const r=e.getAttribute(As);if(r!==null&&+r!==t||e.tagName==="BR"){s.add(e);const n=e.previousSibling,o=e.nextSibling;n&&n.nodeType===3&&ci.test(n.textContent)&&s.add(n),o&&o.nodeType===3&&ci.test(o.textContent)&&s.add(o)}let i=e.childElementCount;for(;i--;)Do(e.children[i],t,s);return s},di=(e,t={})=>{let s="";t||(t={});const r=Be(t.class)?` class="${t.class}"`:"",i=U(t.clone,!1),n=U(t.wrap,!1),o=n?n===!0?"clip":n:i?"clip":!1;if(n&&(s+=`<span${o?` style="overflow:${o};"`:""}>`),s+=`<span${r}${i?' style="position:relative;"':""} data-${e}="{i}">`,i){const a=i==="left"?"-100%":i==="right"?"100%":"0",h=i==="top"?"-100%":i==="bottom"?"100%":"0";s+="<span>{value}</span>",s+=`<span inert style="position:absolute;top:${h};left:${a};white-space:nowrap;">{value}</span>`}else s+="{value}";return s+="</span>",n&&(s+="</span>"),s},gi=(e,t,s,r,i,n,o,a,h)=>{const u=i===ui,p=i===Es,c=`_${i}_`,f=Ae(e)?e(s):e,l=u?"block":"inline-block";gr.innerHTML=f.replace(cu,`<i class="${c}"></i>`).replace(uu,`${p?h:u?o:a}`);const d=gr.content,g=d.firstElementChild,v=d.querySelector(`[data-${i}]`)||g,b=d.querySelectorAll(`i.${c}`),S=b.length;if(S){g.style.display=l,v.style.display=l,v.setAttribute(As,`${o}`),u||(v.setAttribute("data-word",`${a}`),p&&v.setAttribute("data-char",`${h}`));let y=S;for(;y--;){const m=b[y],_=m.parentElement;_.style.display=l,u?_.innerHTML=s.innerHTML:_.replaceChild(s.cloneNode(!0),m)}t.push(v),r.appendChild(d)}else console.warn('The expression "{value}" is missing from the provided template.');return n&&(g.style.outline=`1px dotted ${hu[i]}`),g},vr=class{constructor(e,t={}){hi||(hi=dr?new dr([],{granularity:Ps}):{segment:l=>{const d=[],g=l.split(li);for(let v=0,b=g.length;v<b;v++){const S=g[v];d.push({segment:S,isWordLike:!ci.test(S)})}return d}}),pi||(pi=dr?new dr([],{granularity:"grapheme"}):{segment:l=>[...l].map(d=>({segment:d}))}),!gr&&_t&&(gr=Q.createElement("template")),Ie.current&&Ie.current.register(this);const{words:s,chars:r,lines:i,accessible:n,includeSpaces:o,debug:a}=t,h=(e=He(e)?e[0]:e)&&e.nodeType?e:(Gr(e)||[])[0],u=i===!0?{}:i,p=s===!0||B(s)?{}:s,c=r===!0?{}:r;this.debug=U(a,!1),this.includeSpaces=U(o,!1),this.accessible=U(n,!0),this.linesOnly=u&&!p&&!c,this.lineTemplate=De(u)?di(ui,u):u,this.wordTemplate=De(p)||this.linesOnly?di(Ps,p):p,this.charTemplate=De(c)?di(Es,c):c,this.$target=h,this.html=h&&h.innerHTML,this.lines=[],this.words=[],this.chars=[],this.effects=[],this.effectsCleanups=[],this.cache=null,this.ready=!1,this.width=0,this.resizeTimeout=null;const f=()=>this.html&&(u||p||c)&&this.split();this.resizeObserver=new ResizeObserver(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{const l=h.offsetWidth;l!==this.width&&(this.width=l,f())},150)}),this.lineTemplate&&!this.ready?Q.fonts.ready.then(f):f(),h?this.resizeObserver.observe(h):console.warn("No Text Splitter target found.")}addEffect(e){if(!Ae(e))return console.warn("Effect must return a function."),this;const t=nr(e);return this.effects.push(t),this.ready&&(this.effectsCleanups[this.effects.length-1]=t(this)),this}revert(){return clearTimeout(this.resizeTimeout),this.lines.length=this.words.length=this.chars.length=0,this.resizeObserver.disconnect(),this.effectsCleanups.forEach(e=>Ae(e)?e(this):e.revert&&e.revert()),this.$target.innerHTML=this.html,this}splitNode(e){const t=this.wordTemplate,s=this.charTemplate,r=this.includeSpaces,i=this.debug,n=e.nodeType;if(n===3){const o=e.nodeValue;if(o.trim()){const a=[],h=this.words,u=this.chars,p=hi.segment(o),c=Q.createDocumentFragment();let f=null;for(const l of p){const d=l.segment,g=No(l);if(!f||g&&f&&No(f))a.push(d);else{const v=a.length-1,b=a[v];!li.test(b)&&!li.test(d)?a[v]+=d:a.push(d)}f=l}for(let l=0,d=a.length;l<d;l++){const g=a[l];if(g.trim()){const v=a[l+1],b=r&&v&&!v.trim(),S=g,y=s?pi.segment(S):null,m=s?Q.createDocumentFragment():Q.createTextNode(b?g+" ":g);if(s){const _=[...y];for(let k=0,w=_.length;k<w;k++){const A=_[k],O=k===w-1&&b?A.segment+" ":A.segment,E=Q.createTextNode(O);gi(s,u,E,m,Es,i,-1,h.length,u.length)}}t?gi(t,h,m,c,Ps,i,-1,h.length,u.length):s?c.appendChild(m):c.appendChild(Q.createTextNode(g)),b&&l++}else{if(l&&r)continue;c.appendChild(Q.createTextNode(g))}}e.parentNode.replaceChild(c,e)}}else if(n===1){const o=[...e.childNodes];for(let a=0,h=o.length;a<h;a++)this.splitNode(o[a])}}split(e=!1){const t=this.$target,s=!!this.cache&&!e,r=this.lineTemplate,i=this.wordTemplate,n=this.charTemplate,o=Q.fonts.status!=="loading",a=r&&o;this.ready=!r||o,(a||e)&&this.effectsCleanups.forEach(c=>Ae(c)&&c(this)),s||(e&&(t.innerHTML=this.html,this.words.length=this.chars.length=0),this.splitNode(t),this.cache=t.innerHTML),a&&(s&&(t.innerHTML=this.cache),this.lines.length=0,i&&(this.words=mr(t,Ps))),n&&(a||i)&&(this.chars=mr(t,Es));const h=this.words.length?this.words:this.chars;let u,p=0;for(let c=0,f=h.length;c<f;c++){const l=h[c],{top:d,height:g}=l.getBoundingClientRect();!B(u)&&d-u>g*.5&&p++,l.setAttribute(As,`${p}`);const v=l.querySelectorAll(`[${As}]`);let b=v.length;for(;b--;)v[b].setAttribute(As,`${p}`);u=d}if(a){const c=Q.createDocumentFragment(),f=new Set,l=[];for(let d=0;d<p+1;d++){const g=t.cloneNode(!0);Do(g,d,new Set).forEach(v=>{const b=v.parentNode;b&&(v.nodeType===1&&f.add(b),b.removeChild(v))}),l.push(g)}f.forEach(Mo);for(let d=0,g=l.length;d<g;d++)gi(r,this.lines,l[d],c,ui,this.debug,d);t.innerHTML="",t.appendChild(c),i&&(this.words=mr(t,Ps)),n&&(this.chars=mr(t,Es))}if(this.linesOnly){const c=this.words;let f=c.length;for(;f--;){const l=c[f];l.replaceWith(l.textContent)}c.length=0}if(this.accessible&&(a||!s)){const c=Q.createElement("span");c.style.cssText="position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;",c.innerHTML=this.html,t.insertBefore(c,t.firstChild),this.lines.forEach(fi),this.words.forEach(fi),this.chars.forEach(fi)}return this.width=t.offsetWidth,(a||e)&&this.effects.forEach((c,f)=>this.effectsCleanups[f]=c(this)),this}refresh(){this.split(!0)}},Bo=(e,t)=>new vr(e,t),Ls=(e,t)=>(console.warn("text.split() is deprecated, import splitText() directly, or text.splitText()"),new vr(e,t)),$o=e=>{let t="";for(let s=0,r=e.length;s<r;s++)if(s+2<r&&e[s+1]==="-"&&e.charCodeAt(s)<e.charCodeAt(s+2)){const i=e.charCodeAt(s),n=e.charCodeAt(s+2);for(let o=i;o<=n;o++)t+=String.fromCharCode(o);s+=2}else t+=e[s];return t},Ho={lowercase:"a-z",uppercase:"A-Z",numbers:"0-9",symbols:"!%#_|*+=",braille:"⠀-⣿",blocks:"▀-▟",shades:"░-▓"},mi=new WeakMap,qo=(e={})=>{e||(e={});const t=e.chars,s=Tt(e.ease||"linear"),r=e.text,i=e.from,n=e.reversed||!1,o=e.perturbation||0,a=e.cursor,h=a===!0?"_":typeof a=="number"?String.fromCharCode(a):typeof a=="string"?a:"",u=h.length,p=e.seed||0,c=e.override!==void 0?e.override:!0,f=e.revealRate||60,l=1e3*z.timeScale/f,d=e.settleDuration||300*z.timeScale,g=e.settleRate||30,v=e.duration,b=e.revealDelay,S=e.delay,y=e.onChange||ne;return(m,_,k,w)=>{const A=typeof t=="function"?t(m,_,k):t||"a-zA-Z0-9!%#_",O=$o(Ho[A]||A),E=O.length-1,P=typeof v=="function"?v(m,_,k):v,C=typeof b=="function"?b(m,_,k):b||0,$=typeof S=="function"?S(m,_,k):S||0,H=p?Ts(p):Ts();mi.has(m)||mi.set(m,m.textContent);const V=w?w._value:m.textContent,x=r!==void 0?typeof r=="function"?r(m,_,k):r:w?w._value:mi.get(m),M=x===" "||x===" "?" ":x,I=V===" "?0:V.length,R=M.length,q=c===!0?O:typeof c=="string"&&c.length>0?$o(Ho[c]||c):null,J=q?q.length-1:0,G=c===" "?" ":null,W=c===""?R:Math.max(I,R),ee=P>0?P:(W-1)*l+d,X=F((ee+C)/z.timeScale,0)*z.timeScale,oe=C>0?F(C/X,12):0,pe=i===void 0||i==="auto"?R<I?"right":"left":i,ce=new Int32Array(W);if(pe==="random"){for(let L=0;L<W;L++)ce[L]=L;for(let L=W-1;L>0;L--){const D=H(0,L),Z=ce[L];ce[L]=ce[D],ce[D]=Z}}else{const L=pe==="right"?(c===""||!I?W:I)-1:pe==="center"?((c===""||!I?W:I)-1)/2:typeof pe=="number"?pe:0,D=Math.abs,Z=new Array(W);for(let Y=0;Y<W;Y++)Z[Y]=Y;Z.sort((Y,we)=>D(Y-L)-D(we-L));for(let Y=0;Y<W;Y++)ce[Z[Y]]=Y}if(n){const L=W-1;for(let D=0;D<W;D++)ce[D]=L-ce[D]}const ie=F(d/ee,12),K=F((1-ie)/W,12),ae=u*K,xe=F(1e3*z.timeScale/(g*X),12),ue=new Float32Array(W),te=new Float32Array(W),fe=o>0?o*ie:0;for(let L=0;L<W;L++){const D=fe>0?(H(0,2e3)-1e3)/1e3*fe:0,Z=fe>0?(H(0,2e3)-1e3)/1e3*fe:0;ue[L]=ce[L]*K+D,te[L]=Math.ceil((ue[L]+ie+Z)/xe)*xe}if(R<W&&pe!=="left"&&pe!=="right"&&pe!=="random"){let L=0;for(let Y=R;Y<W;Y++)te[Y]>L&&(L=te[Y]);const D=new Array(R);for(let Y=0;Y<R;Y++)D[Y]=Y;D.sort((Y,we)=>ce[Y]-ce[we]);const Z=(1-L)/R;for(let Y=0;Y<R;Y++){const we=L+Y*Z;we>te[D[Y]]&&(te[D[Y]]=we)}}const me=new Array(W);for(let L=0;L<W;L++)me[L]=O[H(0,E)];const _e=q?q===O?me:new Array(W):null;if(_e&&_e!==me)for(let L=0;L<W;L++)_e[L]=G||q[H(0,q.length-1)];let Ce=V;if(!w){if(c==="")Ce="";else if(q){Ce="";for(let L=0;L<I;L++)Ce+=V[L]===" "?" ":_e[L]}}let Te=-1,be=-1,se="";const ge=c!=="",T=!!q,N=u>0;return{from:0,to:1,duration:X,delay:$,ease:"linear",modifier:L=>{if(L===Te)return se;if(Te=L,$>0&&L<=0)return se=V,V;if(L<=0)return se=Ce,Ce;if(L>=1)return se=M,M;se="";const D=L/xe|0,Z=D!==be;Z&&(be=D);const Y=oe>0?(L-oe)/(1-oe):L,we=Y>0?s(Y):0;for(let ye=0;ye<W;ye++){const nt=ue[ye];if(we>=te[ye]){ye<R&&(se+=M[ye]);continue}if(we<=0||we<nt){ge&&ye<I&&(T?V[ye]===" "?se+=" ":(Z&&(_e[ye]=G||q[H(0,J)]),se+=_e[ye]):se+=V[ye]);continue}ye<R&&M[ye]===" "||ye<I&&V[ye]===" "?se+=" ":N&&we-nt<ae?se+=h[u-1-((we-nt)/K|0)]:(Z&&(me[ye]=O[H(0,E)]),se+=me[ye])}return Z&&y(se,we),se}}}},pu=jt({TextSplitter:()=>vr,scrambleText:()=>qo,split:()=>Ls,splitText:()=>Bo}),fu=jt({$:()=>Rt,Animatable:()=>Jr,AutoLayout:()=>go,Draggable:()=>Yn,JSAnimation:()=>Ct,Scope:()=>Gn,ScrollObserver:()=>Qn,Spring:()=>sr,TextSplitter:()=>vr,Timeline:()=>Vn,Timer:()=>st,WAAPIAnimation:()=>oo,addChild:()=>yt,animate:()=>ys,clamp:()=>To,cleanInlineStyles:()=>Cn,createAnimatable:()=>Pc,createDraggable:()=>$c,createDrawable:()=>Io,createLayout:()=>su,createMotionPath:()=>Ro,createScope:()=>Hc,createSeededRandom:()=>Ts,createSpring:()=>Un,createTimeline:()=>zn,createTimer:()=>Sc,cubicBezier:()=>Kn,damp:()=>Eo,degToRad:()=>ko,eases:()=>xt,easings:()=>Xc,engine:()=>ze,forEachChildren:()=>ke,get:()=>Ot,globals:()=>z,irregular:()=>to,keepTime:()=>nr,lerp:()=>Po,linear:()=>si,mapRange:()=>So,morphTo:()=>Oo,onScroll:()=>Uc,padEnd:()=>bo,padStart:()=>yo,radToDeg:()=>wo,random:()=>xs,randomPick:()=>Ao,remove:()=>Xn,removeChild:()=>vt,round:()=>Co,roundPad:()=>vo,scrambleText:()=>qo,scrollContainers:()=>ar,set:()=>Pt,shuffle:()=>ni,snap:()=>xo,split:()=>Ls,splitText:()=>Bo,spring:()=>rr,stagger:()=>Cs,steps:()=>eo,svg:()=>lu,sync:()=>ti,text:()=>pu,utils:()=>nu,waapi:()=>ao,wrap:()=>_o}),du=class{registerAnimation(e,t,s={}){this.animations[e]={handler:t,options:s}}isInitiallyHidden(e){return this.animations[e]?.options.initiallyHidden??!1}runAnimation(e,t,s,r,i){const n=this.animations[e];n?n.handler(t,s,r,i):(console.warn(`No animation registered with name: ${e}`),r())}addLinkAnimation(e,t){this.linkAnimations.set(e,t)}removeLinkAnimation(e){this.linkAnimations.delete(e)}runLinkAnimation(e){const t=this.linkAnimations.get(e);t&&t()}constructor(){this.animations={},this.linkAnimations=new Map,this.registerAnimation("typewriter",function(e,t,s,r){const{chars:i}=Ls(e,{words:!1,chars:!0}),n=t.fadeDuration||100,o=t.interval||100;ys(i,{opacity:[0,1],easing:"linear",duration:n,delay:Cs(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("toast",function(e,t,s,r){const{words:i}=Ls(e,{words:!0,chars:!1}),n=t.fadeDuration||100,o=t.interval||200;ys(i,{opacity:[0,1],y:[{to:["100%","0%"]}],easing:"linear",duration:n,delay:Cs(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("fadeIn",function(e,t,s,r){const i=t.duration||500;ys(e,{opacity:[0,1],easing:t.easing||"easeOutQuad",duration:i,delay:t.start||0,loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("continue",function(e,t,s){e.classList.add("squiffy-continue");const r=t.style||"pulse";let i=null,n=null;r==="wave"?(e.classList.add("squiffy-continue-wave"),n=Ls(e,{words:!1,chars:!0}).chars,i=ys(n,{opacity:[1,.3,1],easing:"easeInOutSine",duration:1200,delay:Cs(80),loop:!0})):e.classList.add(`squiffy-continue-${r}`);const o=()=>{if(e.classList.remove("squiffy-continue","squiffy-continue-wave",`squiffy-continue-${r}`),e.removeEventListener("click",o),i&&(i.pause(),n))for(const a of n)a.style.opacity="1";s()};e.addEventListener("click",o)})}},gu={animejs:fu},Fo="input:not([disabled]), textarea:not([disabled]), select:not([disabled])",mu="a.squiffy-link[data-section], a.squiffy-link[data-passage]";function Vo(e){if(!e)return!0;const t=e.querySelectorAll(Fo);for(const s of t)if(!s.checkValidity())return!1;return!0}function vi(e){if(!e)return;const t=Vo(e),s=e.querySelectorAll(mu);for(const r of s)t?(r.classList.remove("validation-disabled"),r.removeAttribute("aria-disabled")):(r.classList.add("validation-disabled"),r.setAttribute("aria-disabled","true"))}function yr(e){if(!e)return;const t=e.querySelectorAll(Fo);for(const s of t)s.addEventListener("input",()=>vi(e)),s.addEventListener("change",()=>vi(e)),s.addEventListener("invalid",r=>{r.preventDefault(),s.classList.add("squiffy-invalid")}),s.addEventListener("input",()=>{s.checkValidity()&&s.classList.remove("squiffy-invalid")});vi(e)}var zo=["src","poster"],vu="data-squiffy-asset-",yu=[...zo,"srcset","style"].map(e=>`[${e}]`).join(","),bu=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")||e.startsWith("#"),yi=(e,t)=>{const s=e.trim();if(!s||bu(s))return e;let r=s;try{r=decodeURI(s)}catch{}return t(r)},_u=(e,t)=>e.split(",").map(s=>{const r=s.match(/^(\s*)(\S+)(.*)$/s);return r?r[1]+yi(r[2],t)+r[3]:s}).join(","),Su=(e,t)=>e.replace(/url\(\s*(['"]?)(.*?)\1\s*\)/gi,(s,r,i)=>{const n=yi(i,t);return n===i?s:`url("${n.replace(/["\\\n]/g,o=>"\\"+(o===`
|
|
294
|
-
`?"a ":o))}")`}),ku=(e,t,s)=>{const r=vu+t,i=e.getAttribute(r)??e.getAttribute(t);if(i===null)return;let n;t==="srcset"?n=_u(i,s):t==="style"?n=Su(i,s):n=yi(i,s),n===i?e.removeAttribute(r):e.setAttribute(r,i),e.setAttribute(t,n)},wu=e=>t=>{if(!e||!/\b(src|srcset|poster|style)\s*=/i.test(t))return t;const s=document.createElement("template");s.innerHTML=t;for(const r of s.content.querySelectorAll(yu))for(const i of[...zo,"srcset","style"])r.hasAttribute(i)&&ku(r,i,e);return s.innerHTML},xu=async e=>{let t,s,r,i,n,o=0;const a=new ql,h=[];let u=!1;async function p(T){if(u||T.closest(".squiffy-output-section")!==r||T.classList.contains("disabled")||!Vo(r))return!1;const N=T.getAttribute("data-passage"),L=T.getAttribute("data-section");if(N!==null)return f(T),fe("_turncount",te("_turncount")+1),await g(T),N&&(n=null,await _(N)),a.emit("linkClick",{linkType:"passage"}),!0;if(L!==null)return await g(T),L&&await b(L),a.emit("linkClick",{linkType:"section"}),!0;const[D,Z,Y]=_e.handleLink(T);return D?(Y?.disableLink&&f(T),A(),a.emit("linkClick",{linkType:Z}),!0):!1}async function c(T){const N=T.target;N.classList.contains("squiffy-link")&&await p(N)}function f(T){T.classList.add("disabled"),T.setAttribute("tabindex","-1")}function l(T){T.classList.remove("disabled"),T.removeAttribute("tabindex")}async function d(T){if(T&&T.section in t.sections){await b(T.section),T.passage!==void 0&&te("_section")==T.section&&await _(T.passage);return}O()||await b(t.start)}async function g(T){se.runLinkAnimation(T),await m();const N=T.getAttribute("data-set");if(N){const L=JSON.parse(N);for(const D of L)v(D)}}function v(T){T=T.replace(/^(\w*\s*):=(.*)$/,(L,D,Z)=>D+"="+x.processText(Z,!0));const N=/^([\w]*)\s*=\s*(.*)$/.exec(T);if(N){const L=N[1];let D=N[2];D==="true"?fe(L,!0):D==="false"?fe(L,!1):isNaN(D)?(D.startsWith("@")&&(D=te(D.substring(1))),fe(L,D)):fe(L,parseFloat(D))}else{const L=/^([\w]*)\s*([+\-*/])=\s*(.*)$/.exec(T);if(L){const D=L[1],Z=L[2];let Y=L[3];Y.startsWith("@")&&(Y=te(Y.substring(1)));const we=parseFloat(Y);let ye=te(D);ye===null&&(ye=0),Z=="+"&&(ye+=we),Z=="-"&&(ye-=we),Z=="*"&&(ye*=we),Z=="/"&&(ye/=we),fe(D,ye)}else{let D=!0;T.startsWith("not ")&&(T=T.substring(4),D=!1),fe(T,D)}}}async function b(T){const N=G();if(s=t.sections[T],!s)return;fe("_section",T),ue.setSeen(T);const L=t.sections[""];(L?.clear||s.clear)&&H(),P(T);const D=r;if(L&&(await y(L,"[[]]"),te("_section")!==T)){D.remove();return}if(await y(s,`[[${T}]]`),te("_section")!==T){D.remove();return}yr(r),fe("_turncount",0),ae(),A();const Z=G();Z!=N&&a.emit("canGoBackChanged",{canGoBack:Z}),a.emit("navigated",{section:T})}function S(T,N=null){const L={get:te,set:fe,ui:{transition:be,write:x.write,scrollToEnd:x.scrollToEnd},story:{go:b,seen:D=>ue.getSeen(D)},element:ee,import:gu,...N};t.js[T](L,te,fe)}async function y(T,N){if(T.attributes&&await k(T.attributes),T.jsIndex!==void 0){const L=te("_section");if(S(T.jsIndex),te("_section")!==L)return}x.write(T.text||"",N),await m()}async function m(){u=!0,r.classList.add("links-disabled");for(const T of h)await T();h.length=0,u=!1,r.classList.remove("links-disabled")}async function _(T){const N=G();let L=s.passages&&s.passages[T];const D=t.sections[""];if(!L&&D&&D.passages&&(L=D.passages[T]),!L)throw`No passage named ${T} in the current section or master section`;ue.setSeen(T);const Z=[],Y=[];if(D&&D.passages){const Me=D.passages[""];Me&&(Z.push(Me),Y.push(()=>y(Me,"[[]][]")))}const we=s.passages&&s.passages[""];we&&(Z.push(we),Y.push(()=>y(we,`[[${te("_section")}]][]`))),Z.push(L),Y.push(()=>y(L,`[[${te("_section")}]][${T}]`));const ye="@"+te("_turncount");if(s.passages){if(ye in s.passages){const Me=s.passages[ye];Z.push(Me),Y.push(()=>y(Me,`[[${te("_section")}]][${ye}]`))}if("@last"in s.passages&&te("_turncount")>=(s.passageCount||0)){const Me=s.passages["@last"];Z.push(Me),Y.push(()=>y(Me,`[[${te("_section")}]][${ye}]`))}}Z.some(Me=>Me.clear)&&(H(),C()),i=document.createElement("div"),i.classList.add("squiffy-output-passage"),i.setAttribute("data-passage",`${T}`),r.appendChild(i);for(const Me of Y)await Me();yr(r),ae(),A();const nt=G();nt!=N&&a.emit("canGoBackChanged",{canGoBack:nt}),a.emit("navigated",{section:te("_section"),passage:T})}async function k(T){for(const N of T)v(N)}function w(){ue.reset(),pe.scroll==="element"||pe.scroll==="none"?(X.innerHTML="",d()):location.reload()}function A(){fe("_output",X.innerHTML)}function O(){const T=()=>{t.uiJsIndex!==void 0&&S(t.uiJsIndex,{registerAnimation:se.registerAnimation.bind(se),registerHelper:me.handlebars.registerHelper.bind(me.handlebars),SafeString:me.handlebars.SafeString})};ue.load();const N=te("_output");return N?(X.innerHTML=oe(N),I(),R(),n=X.querySelector(".squiffy-output-block:last-child"),s=t.sections[te("_section")],T(),ge.onLoad(),yr(r),!0):(T(),!1)}function E(){n=document.createElement("div"),n.classList.add("squiffy-output-block"),(i||r)?.appendChild(n)}function P(T){r&&(r.querySelectorAll("input, textarea, select").forEach(N=>{const L=N,D=L.getAttribute("data-attribute")||L.id;D&&fe(D,L.value),L.disabled||(L.disabled=!0,L.setAttribute("data-squiffy-disabled",""))}),r.querySelectorAll("[contenteditable]").forEach(N=>{const L=N.getAttribute("data-attribute")||N.id;L&&fe(L,N.innerHTML),N.getAttribute("contenteditable")!=="false"&&(N.setAttribute("contenteditable","false"),N.setAttribute("data-squiffy-disabled",""))})),i=null,C(T),E()}function C(T){r=document.createElement("div"),r.classList.add("squiffy-output-section"),r.setAttribute("data-section",T??te("_section")),T||r.setAttribute("data-clear","true"),X.appendChild(r)}function $(){return X.querySelector(".squiffy-clear-stack")}function H(){let T=$();T||(T=document.createElement("div"),T.classList.add("squiffy-clear-stack"),T.style.display="none",X.prepend(T));const N=document.createElement("div");T.appendChild(N);for(const L of[...X.children])L!==T&&N.appendChild(L)}function V(){const T=$();if(!T)return;for(const L of[...X.children])L!==T&&L.remove();const N=T.children[T.children.length-1];for(const L of[...N.children])X.appendChild(L);N.remove()}const x={write:(T,N)=>{o=X.scrollHeight;const L=x.renderHtml(T,!1).trim();n||E();const D=document.createElement("div");N&&D.setAttribute("data-source",N),D.innerHTML=L,ge.onWrite(D),n.appendChild(D),yr(r),x.scrollToEnd()},clearScreen:()=>{H(),C()},scrollToEnd:()=>{if(pe.scroll!=="none")if(pe.scroll==="element")X.lastElementChild?.scrollIntoView({block:"end",inline:"nearest",behavior:"smooth"});else{let T=o;const N=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(T>N){const L=document.documentElement.scrollHeight-window.innerHeight;T>L&&(T=L),window.scrollTo({top:T,behavior:"smooth"})}}},processText:(T,N)=>me.process(T,N),renderHtml:(T,N)=>oe(x.processText(T,N))};function M(T){if(T.start!=t.start){t=T,ue.reset(),X.innerHTML="",b(t.start);return}const N=t;t=T,Vl(N,T,X,(D,Z)=>{const Y=s;s=Z;try{return x.renderHtml(D,!1)}finally{s=Y}},f,D=>k(D)),I(),R()}function I(){const T=X.querySelectorAll(".squiffy-output-section:last-child");r=T[T.length-1];const N=r.getAttribute("data-section");s=t.sections[N]}function R(){i=r.querySelector(".squiffy-output-passage:last-child")}function q(){const T=$(),N=X.querySelectorAll(".squiffy-output-section").length+X.querySelectorAll(".squiffy-output-passage").length;return T?N+T.children.length:N}function J(T){T.querySelectorAll("[data-squiffy-disabled]").forEach(N=>{N.hasAttribute("contenteditable")?N.setAttribute("contenteditable","true"):N.disabled=!1,N.removeAttribute("data-squiffy-disabled")})}function G(){return q()>1}function W(){if(u||!G())return;const T=$();if(i){const L=i.getAttribute("data-passage");xe(i.getAttribute("data-undo")),i.remove();let D=!1,Z=!1;for(const Y of X.children)if(Y!==T){if(Y.getAttribute("data-clear")=="true"&&Y.children.length==0){D=!0;continue}Z=!0;break}D&&!Z&&(V(),I());for(const Y of r.querySelectorAll("a.squiffy-link[data-passage]"))Y.getAttribute("data-passage")==L&&l(Y);R()}else{xe(r.getAttribute("data-undo")),r.remove();let L=!1;for(const D of[...X.children])if(D!==T){L=!0;break}L||V(),I(),R(),J(r)}G()||a.emit("canGoBackChanged",{canGoBack:!1});const N=i?.getAttribute("data-passage");a.emit("navigated",N?{section:te("_section"),passage:N}:{section:te("_section")})}const ee=e.element,X=document.createElement("div");ee.appendChild(X),t=e.story;const oe=wu(e.resolveAssetUrl),pe={scroll:e.scroll||"body",persist:e.persist===void 0?!0:e.persist,onSet:e.onSet||(()=>{})};let ce="";pe.persist&&(e.storyId!==void 0?ce=e.storyId:window.location.protocol==="file:"?ce=t.id||"":ce=window.location.pathname,ce||(console.warn("Persist is set to true in Squiffy runtime options, but no storage key could be determined. Persist will be disabled."),pe.persist=!1)),pe.scroll==="element"&&(X.style.overflowY="auto"),X.addEventListener("click",c),X.addEventListener("keypress",async function(T){T.key==="Enter"&&await c(T)});let ie={};const K=function(T,N){T!="_output"&&(T in ie||(ie[T]=N))},ae=function(){(i??r).setAttribute("data-undo",JSON.stringify(ie)),ie={}},xe=function(T){if(!T)return;const N=JSON.parse(T);if(N)for(const L of Object.keys(N))ue.setInternal(L,N[L],!1)},ue=new Fl(pe.persist,ce,pe.onSet,a,K),te=ue.get.bind(ue),fe=ue.set.bind(ue),me=new Hl(()=>t,ue,()=>s),_e=new Zl,Ce=T=>T in t.sections&&t.sections[T].text||null,Te=T=>s.passages&&T in s.passages?s.passages[T].text||null:"passages"in t.sections[""]&&t.sections[""].passages&&T in t.sections[""].passages&&t.sections[""].passages[T].text||null,be=T=>{h.push(T)},se=new du,ge=new zl(X,me,ue,_e,Ce,Te,x.renderHtml,be,se,a,oe);return ge.add(ds.ReplaceLabel()),ge.add(ds.RotateSequencePlugin()),ge.add(ds.RandomPlugin()),ge.add(ds.LivePlugin()),ge.add(ds.AnimatePlugin()),{begin:d,restart:w,get:te,set:fe,clickLink:p,update:M,goBack:W,on:(T,N)=>a.on(T,N),off:(T,N)=>a.off(T,N),once:(T,N)=>a.once(T,N)}},Tu={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp",mp3:"audio/mpeg",ogg:"audio/ogg",oga:"audio/ogg",wav:"audio/wav",m4a:"audio/mp4",flac:"audio/flac",mp4:"video/mp4",webm:"video/webm",ogv:"video/ogg",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",pdf:"application/pdf",vtt:"text/vtt"},Cu=e=>Tu[e.substring(e.lastIndexOf(".")+1).toLowerCase()]??"",bi=e=>e.replace(/^(\.\/)+/,"");async function Pu(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"}));try{return await import(t)}finally{URL.revokeObjectURL(t)}}function _i(e){return e instanceof Error?{type:"runtimeError",message:e.message,...e.stack?{stack:e.stack}:{}}:{type:"runtimeError",message:String(e)}}function Eu(e){const t=e.loadModule??Pu;let s,r=0;const i=new Map,n=[],o=[],a=l=>{try{e.send(l)}catch{l.type=="attributeSet"&&e.send({...l,value:String(l.value)})}},h=l=>i.get(bi(l))??l;function u(l){for(const d of n.splice(0))URL.revokeObjectURL(d);i.clear();for(const[d,g]of Object.entries(l.urls??{}))i.set(bi(d),g);for(const[d,g]of Object.entries(l.files??{})){const v=g instanceof Blob?g:new Blob([g],{type:Cu(d)}),b=URL.createObjectURL(v);n.push(b),i.set(bi(d),b)}}async function p(l){for(const d of o.splice(0))d.remove();for(const d of l.css??[]){const g=document.createElement("style");g.textContent=d,document.head.appendChild(g),o.push(g)}for(const d of l.scripts??[]){const g=document.createElement("script"),v=URL.createObjectURL(new Blob([d],{type:"text/javascript"}));await new Promise(b=>{g.onload=g.onerror=()=>b(),g.src=v,document.head.appendChild(g)}),URL.revokeObjectURL(v),o.push(g)}}async function c(l){const d=++r;s=void 0,e.element.innerHTML="",await p(l.story);const{story:g}=await t(l.story.js);if(d!=r)return;const v=document.createElement("div");v.className="squiffy-preview-story",e.element.appendChild(v);const b=await xu({element:v,story:g,persist:!1,scroll:"element",resolveAssetUrl:h,onSet:(S,y)=>{d==r&&!S.startsWith("_")&&a({type:"attributeSet",name:S,value:y})}});b.on("canGoBackChanged",S=>{d==r&&a({type:"canGoBackChanged",canGoBack:S.canGoBack})}),b.on("navigated",S=>{d==r&&a({type:"navigated",...S})}),s=b,a({type:"canGoBackChanged",canGoBack:!1}),await b.begin(l.startAt),d==r&&a({type:"loaded"})}async function f(l){try{switch(l.type){case"load":await c(l);break;case"update":s&&s.update((await t(l.js)).story);break;case"restart":s?.restart();break;case"back":s?.goBack();break;case"assets":u(l.assets)}}catch(d){a(_i(d))}}return{receive:f}}var Au="squiffy-preview",Lu=e=>typeof e=="object"&&e!==null&&e.channel==="squiffy-preview"&&typeof e.type=="string",Si=typeof acquireVsCodeApi=="function"?acquireVsCodeApi():void 0,br=e=>{const t={channel:Au,...e};Si?Si.postMessage(t):window.parent.postMessage(t,"*")},Ru=Eu({element:document.getElementById("squiffy"),send:br});window.addEventListener("message",e=>{!Si&&e.source!==window.parent||Lu(e.data)&&Ru.receive(e.data)}),window.addEventListener("error",e=>br(_i(e.error??e.message))),window.addEventListener("unhandledrejection",e=>br(_i(e.reason))),br({type:"ready"})})();
|
|
1567
|
+
color: ${L?o:"rgba(0,0,0,.75)"};
|
|
1568
|
+
background-color: ${L?"rgba(0,0,0,.65)":o};
|
|
1569
|
+
border: 2px solid ${L?o:"transparent"};
|
|
1570
|
+
border-${t?F?"top-left":"top-right":F?"top-left":"bottom-left"}-radius: 5px;
|
|
1571
|
+
border-${t?F?"bottom-left":"bottom-right":F?"top-right":"bottom-right"}-radius: 5px;
|
|
1572
|
+
`,P.appendChild(M);let $=A-I+(t?1:0);P.style[t?"left":"top"]=`${$}px`,(T?i:n).appendChild(P)}),r.appendChild(i),r.appendChild(n),e.element.appendChild(r),s||r.classList.add("animejs-onscroll-debug"),this.$debug=r,cs(e.element,"position")==="static"&&(this.debugStyles=es(e.element,{position:"relative "}))}updateBounds(){this._debug&&this.removeDebug();let e;const t=this.target,s=this.container,r=this.horizontal,i=this.linked;let n,o=t;for(i&&(n=i.currentTime,i.seek(0,!0));o&&o!==s.element&&o!==ee.body;){const L=cs(o,"position")==="sticky"?es(o,{position:"static"}):!1;o=o.parentElement,L&&(e||(e=[]),e.push(L))}const c=t.getBoundingClientRect(),u=s.scale,h=(r?c.left+s.scrollX-s.left:c.top+s.scrollY-s.top)*u,d=(r?c.width:c.height)*u,a=r?s.width:s.height,f=(r?s.scrollWidth:s.scrollHeight)-a,l=this.enter,p=this.leave;let g="start",v="end",S="end",w="start";if(Ke(l)){const L=l.split(" ");S=L[0],g=L.length>1?L[1]:g}else if(Je(l)){const L=l;W(L.container)||(S=L.container),W(L.target)||(g=L.target)}else st(l)&&(S=l);if(Ke(p)){const L=p.split(" ");w=L[0],v=L.length>1?L[1]:v}else if(Je(p)){const L=p;W(L.container)||(w=L.container),W(L.target)||(v=L.target)}else st(p)&&(w=p);const y=Qr(t,g,d),m=Qr(t,v,d),_=y+h-a,C=m+h-f,R=Qr(t,S,a,_,C),b=Qr(t,w,a,_,C),x=y+h-R,T=m+h-b,A=T-x;this.offset=h,this.offsetStart=x,this.offsetEnd=T,this.distance=A<=0?0:A,this.thresholds=[g,v,S,w],this.coords=[y,m,R,b],e&&e.forEach(L=>L.revert()),i&&i.seek(n,!0),this._debug&&this.debug()}handleScroll(){if(!this.ready)return;const e=this.linked,t=this.sync,s=this.syncEase,r=this.syncSmooth,i=e&&(s||r),n=this.horizontal,o=this.container,c=this.scroll,u=c<=this.offsetStart,h=c>=this.offsetEnd,d=!u&&!h,a=c===this.offsetStart||c===this.offsetEnd,f=!this.hasEntered&&a,l=this._debug&&this.$debug;let p=!1,g=!1,v=this.progress;if(u&&this.began&&(this.began=!1),v>0&&!this.began&&(this.began=!0),i){const S=e.progress;if(r&&st(r)){if(r<1){const w=S<v&&v===1?1e-4:S>v&&!v?-1e-4:0;v=G(os(S,v,os(.01,.2,r))+w,6)}}else s&&(v=s(v));p=v!==this.prevProgress,g=S===1,p&&!g&&r&&S&&o.wakeTicker.restart()}if(l){const S=n?o.scrollY:o.scrollX;l.style[n?"top":"left"]=S+10+"px"}(d&&!this.isInView||f&&!this.forceEnter&&!this.hasEntered)&&(d&&(this.isInView=!0),!this.forceEnter||!this.hasEntered?(l&&d&&(l.style.zIndex=`${this.container.zIndex++}`),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,f&&(this.forceEnter=!0)):d&&(this.forceEnter=!1)),(d||!d&&this.isInView)&&(p=!0),p&&(i&&e.seek(e.duration*v),this.onUpdate(this)),!d&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),t&&!r&&(g=!0)),v>=1&&this.began&&!this.completed&&(t&&g||!t)&&(t&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!e||!this.repeat&&e&&e.completed)&&this.revert()),v<1&&this.completed&&(this.completed=!1),this.prevProgress=v}revert(){if(this.reverted)return;const e=this.container;return Ht(e,this),e._head||e.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this.ready=!1,this}},sd=(e={})=>new Ta(e),Ca=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,rd=(e,t,s)=>{let r=0,i=1,n,o,c=0;do o=r+(i-r)/2,n=Ca(o,t,s)-e,n>0?i=o:r=o;while(At(n)>1e-7&&++c<100);return o},Ea=(e=.5,t=0,s=.5,r=1)=>e===t&&s===r?kt:i=>i===0||i===1?i:Ca(rd(i,e,s),t,r),Aa=(e=10,t)=>{const s=t?Sh:qs;return r=>s(Q(r,0,1)*e)*(1/e)},fn=(...e)=>{const t=e.length;if(!t)return kt;const s=t-1,r=e[0],i=e[s],n=[0],o=[ks(r)];for(let c=1;c<s;c++){const u=e[c],h=Ke(u)?u.trim().split(" "):[u],d=h[0],a=h[1];n.push(W(a)?c/s:ks(a)/100),o.push(ks(d))}return o.push(ks(i)),n.push(1),function(u){for(let h=1,d=n.length;h<d;h++){const a=n[h];if(u<=a){const f=n[h-1],l=o[h-1];return l+(o[h]-l)*(u-f)/(a-f)}}return o[o.length-1]}},Pa=(e=10,t=1)=>{const s=[0],r=e-1;for(let i=1;i<r;i++){const n=s[i-1],o=i/r,c=o+((i+1)/r-o)*Math.random(),u=o*(1-t)+c*t;s.push(Q(u,n,1))}return s.push(1),fn(...s)},id=Ls({Spring:()=>Gr,createSpring:()=>ya,cubicBezier:()=>Ea,eases:()=>Jt,irregular:()=>Pa,linear:()=>fn,spring:()=>Xr,steps:()=>Aa}),ei=(e,t=100)=>{const s=[];for(let r=0;r<=t;r++)s.push(G(e(r/t),4));return`linear(${s.join(", ")})`},La={},Ra=e=>{let t=La[e];if(t)return t;if(t="linear",Ke(e)){if(Ze(e,"linear")||Ze(e,"cubic-")||Ze(e,"steps")||Ze(e,"ease"))t=e;else if(Ze(e,"cubicB"))t=Or(e);else{const s=da(e);Ve(s)&&(t=s===kt?"linear":ei(s))}La[e]=t}else if(Ve(e)){const s=ei(e);s&&(t=s)}else e.ease&&(t=ei(e.ease));return t},Oa=["x","y","z"],nd=["perspective","width","height","margin","padding","top","right","bottom","left","borderWidth","fontSize","borderRadius",...Oa],od=[...Oa,..._s.filter(e=>["X","Y","Z"].some(t=>e.endsWith(t)))],pn=null,ur=(e,t,s,r,i)=>{let n=Ke(t)?t:Ye(t,s,r,i,null,null);return st(n)?nd.includes(e)||Ze(e,"translate")?`${n}px`:Ze(e,"rotate")||Ze(e,"skew")?`${n}deg`:`${n}`:n},Ia=(e,t,s,r,i,n)=>{let o="0";const c=W(r)?getComputedStyle(e)[t]:ur(t,r,e,i,n);return W(s)?o=tt(r)?r.map(u=>ur(t,u,e,i,n)):c:o=[ur(t,s,e,i,n),c],o},Ma=class{constructor(e,t){Ge.current&&Ge.current.register(this),ws(pn)&&(jt&&(W(CSS)||!Object.hasOwnProperty.call(CSS,"registerProperty"))?pn=!1:(_s.forEach(f=>{const l=Ze(f,"skew"),p=Ze(f,"scale"),g=Ze(f,"rotate"),v=Ze(f,"translate"),S=g||l,w=S?"<angle>":p?"<number>":v?"<length-percentage>":"*";try{CSS.registerProperty({name:"--"+f,syntax:w,inherits:!1,initialValue:v?"0px":S?"0deg":p?"1":"0"})}catch{}}),pn=!0));const s=as(e);s.length||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation.");const r=Y(t.autoplay,X.defaults.autoplay),i=r&&r.link?r:!1,n=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,c=Y(t.loop,X.defaults.loop),u=c===!0||c===1/0?1/0:st(c)?c+1:1,h=n?o?"alternate-reverse":"alternate":o?"reverse":"normal",d="both",a=X.timeScale===1?1:dt;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||X.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=Y(t.persist,X.defaults.persist),this.autoplay=r,this._speed=Y(t.playbackRate,X.defaults.playbackRate),this._resolve=ae,this._completed=0,this._inlineStyles=[],s.forEach((f,l)=>{const p=f[rr],g=od.some(T=>t.hasOwnProperty(T)),v=f.style,S=this._inlineStyles[l]={},w=Y(t.ease,X.defaults.ease),y=Ye(w,f,l,s,null,null),m=Ve(y)||Ke(y)?y:w,_=w.ease&&w,C=Ra(m),R=(_?_.settlingDuration:Ye(Y(t.duration,X.defaults.duration),f,l,s,null,null))*a,b=Ye(Y(t.delay,X.defaults.delay),f,l,s,null,null)*a,x=Y(t.composition,"replace");for(let T in t){if(!Ds(T))continue;const A={},L={iterations:u,direction:h,fill:d,easing:C,duration:R,delay:b,composite:x},D=t[T],B=g?_s.includes(T)?T:Gi.get(T):!1,F=B?"transform":T;S[F]||(S[F]=v[F]);let P;if(Je(D)){const M=D,O=Y(M.ease,C),I=O.ease&&O,$=M.to,H=M.from;if(L.duration=(I?I.settlingDuration:Ye(Y(M.duration,R),f,l,s,null,null))*a,L.delay=Ye(Y(M.delay,b),f,l,s,null,null)*a,L.composite=Y(M.composition,x),L.easing=Ra(O),P=Ia(f,T,H,$,l,s),B?(A[`--${B}`]=P,p[B]=P):A[T]=Ia(f,T,H,$,l,s),ba(this,f,T,A,L),!W(H))if(!B)v[T]=A[T][0];else{const V=`--${B}`;v.setProperty(V,A[V][0])}}else P=tt(D)?D.map(M=>ur(T,M,f,l,s)):ur(T,D,f,l,s),B?(A[`--${B}`]=P,p[B]=P):A[T]=P,ba(this,f,T,A,L)}if(g){let T="";for(let A in p)T+=`${qo[A]}var(--${A})) `;v.transform=T}}),i&&this.autoplay.link(this)}forEach(e){try{const t=Ke(e)?s=>s[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){const e=this.controlAnimation,t=X.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){const t=e*(X.timeScale===1?1:dt);this.forEach(s=>{!this.persist&&t>=this.duration&&s.play(),s.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach("play")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach("pause"))}alternate(){return this.reversed=!this.reversed,this.forEach("reverse"),this.paused&&this.forEach("pause"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach("commitStyles")}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach("cancel"),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform==="none"&&e.style.removeProperty("transform")})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{const s=e.style,r=this._inlineStyles[t];for(let i in r){const n=r[i];W(n)||n===""?s.removeProperty(Or(i)):e.style[i]=n}e.getAttribute("style")===""&&e.removeAttribute("style")}),this}then(e=ae){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=ae};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Na={animate:(e,t)=>new Ma(e,t),convertEase:ei},ad=0,ld=0,ti=(e,t)=>!e||!t?!1:e===t||e.contains(t),zs=e=>{if(!e)return null;const t=e.style,s=t.transition||"";return t.setProperty("transition","none","important"),s},si=(e,t)=>{if(!e)return;const s=e.style;t?s.transition=t:s.removeProperty("transition")},cd=e=>{const t=e.layout.transitionMuteStore,s=e.$el,r=e.$measure;s&&!t.has(s)&&t.set(s,zs(s)),r&&!t.has(r)&&t.set(r,zs(r))},ri=e=>{e.forEach((t,s)=>si(s,t)),e.clear()},ud={display:"none",visibility:"hidden",opacity:"0",transform:"none",position:"static"},hd=e=>{if(!e)return;const t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},$a=(e,t,s,r)=>{let i=e.dataset.layoutId;i||(i=e.dataset.layoutId=`node-${ld++}`);const n=r||{};return n.$el=e,n.$measure=e,n.id=i,n.index=0,n.targets=null,n.delay=0,n.duration=0,n.ease=null,n.state=s,n.layout=s.layout,n.parentNode=t||null,n.isTarget=!1,n.isEntering=!1,n.isLeaving=!1,n.isInlined=!1,n.hasTransform=!1,n.inlineStyles=[],n.inlineTransforms=null,n.inlineTransition=null,n.branchAdded=!1,n.branchRemoved=!1,n.branchNotRendered=!1,n.sizeChanged=!1,n.hasVisibilitySwap=!1,n.hasDisplayNone=!1,n.hasVisibilityHidden=!1,n.measuredInlineTransform=null,n.measuredInlineTransition=null,n.measuredDisplay=null,n.measuredVisibility=null,n.measuredPosition=null,n.measuredHasDisplayNone=!1,n.measuredHasVisibilityHidden=!1,n.measuredIsVisible=!1,n.measuredIsRemoved=!1,n.measuredIsInsideRoot=!1,n.properties={transform:"none",x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},n.layout.properties.forEach(o=>n.properties[o]=0),n._head=null,n._tail=null,n._prev=null,n._next=null,n},Da=(e,t,s,r)=>{const i=e.$el,n=e.layout.root,o=n===i,c=e.properties,u=e.state.rootNode,h=e.parentNode,d=s.transform,a=i.style.transform,f=h?h.measuredIsRemoved:!1,l=s.position;o&&(e.layout.absoluteCoords=l==="fixed"||l==="absolute"),e.$measure=t,e.inlineTransforms=a,e.hasTransform=d&&d!=="none",e.measuredIsInsideRoot=ti(n,t),e.measuredInlineTransform=null,e.measuredDisplay=s.display,e.measuredVisibility=s.visibility,e.measuredPosition=l,e.measuredHasDisplayNone=s.display==="none",e.measuredHasVisibilityHidden=s.visibility==="hidden",e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||f;let p=!1,g=i.previousSibling;for(;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.previousSibling;if(g&&g.nodeType===Node.TEXT_NODE)p=!0;else{for(g=i.nextSibling;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.nextSibling;p=g!==null&&g.nodeType===Node.TEXT_NODE}if(e.isInlined=p,e.hasTransform&&!r){const C=e.layout.transitionMuteStore;C.get(i)||(e.inlineTransition=zs(i)),t===i?i.style.transform="none":(C.get(t)||(e.measuredInlineTransition=zs(t)),e.measuredInlineTransform=t.style.transform,t.style.transform="none")}let v=0,S=0,w=0,y=0;if(!r){const C=t.getBoundingClientRect();v=C.left,S=C.top,w=C.width,y=C.height}for(let C in c){const R=C==="transform"?d:s[C]||s.getPropertyValue&&s.getPropertyValue(C);W(R)||(c[C]=R)}c.left=v,c.top=S,c.clientLeft=r?0:t.clientLeft,c.clientTop=r?0:t.clientTop;let m,_;if(o)e.layout.absoluteCoords?(m=v,_=S):(m=0,_=0);else{const C=h||u,R=C.properties.left,b=C.properties.top,x=C.properties.clientLeft,T=C.properties.clientTop;if(e.layout.absoluteCoords)m=v-R-x,_=S-b-T;else if(C===u){const A=u.properties.left,L=u.properties.top,D=u.properties.clientLeft,B=u.properties.clientTop;m=v-A-D,_=S-L-B}else m=v-R-x,_=S-b-T}return c.x=m,c.y=_,c.width=w,c.height=y,e},qa=(e,t)=>{if(t)for(let s in t)e.properties[s]=t[s]},hr=(e,t)=>{const s=Ye(t.ease,e.$el,e.index,e.targets,null,null),r=Ve(s)?s:t.ease,i=!W(r)&&!W(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:Ye(t.duration,e.$el,e.index,e.targets,null,null),e.delay=Ye(t.delay,e.$el,e.index,e.targets,null,null)},dd=e=>{const t=e.$el.style,s=e.inlineStyles;s.length=0,e.layout.recordedProperties.forEach(r=>{s.push(r,t[r]||"")})},Ba=e=>{const t=e.$el.style,s=e.inlineStyles;for(let r=0,i=s.length;r<i;r+=2){const n=s[r],o=s[r+1];o&&o!==""?t[n]=o:(t[n]="",t.removeProperty(n))}},fd=e=>{const t=e.inlineTransforms,s=e.$el.style;!e.hasTransform||!t||e.hasTransform&&s.transform==="none"||t&&t==="none"?s.removeProperty("transform"):t&&(s.transform=t);const r=e.$measure;if(e.hasTransform&&r!==e.$el){const i=r.style,n=e.measuredInlineTransform;n&&n!==""?i.transform=n:i.removeProperty("transform")}e.measuredInlineTransform=null,e.inlineTransition!==null&&(si(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(si(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},Ha=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty("display"),e.$el.style.removeProperty("visibility"),e.hasVisibilitySwap&&(e.$measure.style.removeProperty("display"),e.$measure.style.removeProperty("visibility"))),e.layout.pendingRemoval.delete(e.$el)},gn=(e,t,s)=>(t.properties={...e.properties},t.state=s,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),Fa=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute("data-layout-id"),e.$measure.removeAttribute("data-layout-id")}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){const s=this.getNode(e);if(s)return s.properties[t]}forEach(e,t){let s=e,r=0;for(;s;)if(t(s,r++),s._head)s=s._head;else if(s._next)s=s._next;else{for(;s&&!s._next;)s=s.parentNode;s&&(s=s._next)}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(const t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,zs(e));const s=[e,t],r=this.layout.root;let i=null;for(;s.length;){const n=s.pop(),o=s.pop();if(!o||o.nodeType!==1||Ir(o))continue;const c=n?n.measuredIsRemoved:!1,u=c?ud:getComputedStyle(o),h=c?!0:u.display==="none",d=c?!0:u.visibility==="hidden",a=!h&&!d,f=o.dataset.layoutId,l=ti(r,o);let p=f?this.nodes.get(f):null;if(p&&p.$el!==o){const v=ti(r,p.$el),S=p.measuredIsVisible,w=!v&&(l||!l&&!S&&a),y=v&&!S&&a;if(w)hd(p),p=$a(o,n,this,p);else if(y){Da(p,o,u,c);let m=o.lastElementChild;for(;m;)s.push(m,p),m=m.previousElementSibling;i||(i=p);continue}else{let m=o.lastElementChild;for(;m;)s.push(m,n),m=m.previousElementSibling;i||(i=p);continue}}else p=$a(o,n,this,p);p.branchAdded=!1,p.branchRemoved=!1,p.branchNotRendered=!1,p.isTarget=!1,p.sizeChanged=!1,p.hasVisibilityHidden=d,p.hasDisplayNone=h,p.hasVisibilitySwap=d&&!p.measuredHasVisibilityHidden||h&&!p.measuredHasDisplayNone,this.nodes.set(p.id,p),p.parentNode=n||null,p._prev=null,p._next=null,n?(this.rootNodes.delete(p),n._head?(n._tail._next=p,p._prev=n._tail,n._tail=p):(n._head=p,n._tail=p)):this.rootNodes.add(p),Da(p,p.$el,u,c);let g=o.lastElementChild;for(;g;)s.push(g,p),g=g.previousElementSibling;i||(i=p)}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;const s=e.dataset.layoutId,r=s?this.nodes.get(s):null;if(r&&r.$el===e)return r;let i=null,n=e.parentElement;for(;n&&n!==this.layout.root;){if(t.has(n)){i=this.ensureDetachedNode(n,t);break}n=n.parentElement}return this.registerElement(e,i)}record(){const e=this.layout,t=e.children,s=e.root,r=tt(t)?t:[t],i=[],n=t==="*"?s:Ge.root,o=[];let c=s.parentElement;for(;c&&c.nodeType===1;){const g=getComputedStyle(c);if(g.transform&&g.transform!=="none"){const v=c.style.transform||"",S=zs(c);o.push(c,v,S),c.style.transform="none"}c=c.parentElement}for(let g=0,v=r.length;g<v;g++){const S=r[g];i[g]=Ke(S)?n.querySelectorAll(S):S}const u=as(i);this.nodes.clear(),this.rootNodes.clear();const h=this.registerElement(s,null);h.isTarget=!0,this.rootNode=h;const d=new Set;let a=0;const f=[];this.nodes.forEach(g=>{f.push(g.$el)}),this.nodes.forEach((g,v)=>{g.index=a++,g.targets=f,g&&g.measuredIsInsideRoot&&d.add(v)});const l=new Set,p=[];for(let g=0,v=u.length;g<v;g++){const S=u[g];if(!(!S||S.nodeType!==1||S===s)){if(!ti(s,S)){const w=S.dataset.layoutId;if(!w||!d.has(w))continue}l.has(S)||(l.add(S),p.push(S))}}for(let g=0,v=p.length;g<v;g++)this.ensureDetachedNode(p[g],l);for(let g=0,v=u.length;g<v;g++){const S=u[g],w=this.getNode(S);if(w){let y=w;for(;y&&!y.isTarget;)y.isTarget=!0,y=y.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(fd);for(let g=0,v=o.length;g<v;g+=3){const S=o[g],w=o[g+1],y=o[g+2];w&&w!==""?S.style.transform=w:S.style.removeProperty("transform"),si(S,y)}return this}};function Us(e){const t={},s={};for(let r in e){const i=e[r],n=r==="ease";r==="duration"||r==="delay"||n?s[r]=i:t[r]=i}return[t,s]}var Va=class{constructor(e,t={}){Ge.current&&Ge.current.register(this);const s=Us(t.swapAt),r=Us(t.enterFrom),i=Us(t.leaveTo),n=t.properties;if(t.duration=Y(t.duration,350),t.delay=Y(t.delay,0),t.ease=Y(t.ease,"inOut(3.5)"),this.params=t,this.root=as(e)[0],this.id=t.id||ad++,this.children=t.children||"*",this.absoluteCoords=!1,this.swapAtParams=Pt(t.swapAt||{opacity:0},{ease:"inOut(1.75)"}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set(["opacity","fontSize","color","backgroundColor","borderRadius","border","filter","clipPath"]),s[0])for(let o in s[0])this.properties.add(o);if(r[0])for(let o in r[0])this.properties.add(o);if(i[0])for(let o in i[0])this.properties.add(o);if(n)for(let o=0,c=n.length;o<c;o++)this.properties.add(n[o]);this.recordedProperties=new Set(["display","visibility","translate","position","left","top","marginLeft","marginTop","width","height","maxWidth","maxHeight","minWidth","minHeight"]),this.properties.forEach(o=>this.recordedProperties.add(o)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new Fa(this),this.newState=new Fa(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),ri(this.transitionMuteStore)}revert(){return this.root.classList.remove("is-animated"),this.timeline&&(this.timeline.complete(),this.timeline=null),this.transformAnimation&&(this.transformAnimation.complete(),this.transformAnimation=null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>ri(this.transitionMuteStore)),this}record(){return this.transformAnimation&&(this.transformAnimation.cancel(),this.transformAnimation=null),this.oldState.record(),this.timeline&&(this.timeline.cancel(),this.timeline=null),this.newState.forEachRootNode(Ba),this}animate(e={}){const t={ease:Y(e.ease,this.params.ease),delay:Y(e.delay,this.params.delay),duration:Y(e.duration,this.params.duration)},s={id:this.id},r=Y(e.onComplete,this.params.onComplete),i=Y(e.onPause,this.params.onPause);for(let P in ir)P!=="ease"&&P!=="duration"&&P!=="delay"&&(W(e[P])?W(this.params[P])||(s[P]=this.params[P]):s[P]=e[P]);s.onComplete=()=>{const P=e.autoplay,M=X.editor;if(P&&P.linked||M&&M.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(O=>{Ha(O),Ba(O)});for(let O=0,I=R.length;O<I;O++){const $=R[O];$.style.transform=g.getComputedValue($,"transform")}this.root.classList.contains("is-animated")&&(this.root.classList.remove("is-animated"),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains("is-animated")||ri(this.transitionMuteStore)})},s.onPause=()=>{const P=e.autoplay;if(P&&P.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains("is-animated")&&(this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(Ha),this.root.classList.remove("is-animated"),r&&r(this.timeline),i&&i(this.timeline))},s.composition=!1;const n=Pt(Pt(e.swapAt||{},this.swapAtParams),t),o=Pt(Pt(e.enterFrom||{},this.enterFromParams),t),c=Pt(Pt(e.leaveTo||{},this.leaveToParams),t),[u,h]=Us(n),[d,a]=Us(o),[f,l]=Us(c),p=this.oldState,g=this.newState,v=this.animating,S=this.swapping,w=this.entering,y=this.leaving,m=this.pendingRemoval;v.length=S.length=w.length=y.length=0,p.forEachRootNode(cd),g.record(),g.forEachRootNode(dd);const _=[],C=[],R=[],b=[],x=g.rootNode,T=x.$el;g.forEachRootNode(P=>{const M=P.$el,O=P.id,I=P.parentNode,$=I?I.branchAdded:!1,H=I?I.branchRemoved:!1,V=I?I.branchNotRendered:!1;let z=p.nodes.get(O);const Z=!z;Z?(z=gn(P,{},p),p.nodes.set(O,z),z.measuredIsRemoved=!0):z.measuredIsRemoved&&!P.measuredIsRemoved&&(gn(P,z,p),z.measuredIsRemoved=!0);const K=z.parentNode,se=(K?K.id:null)!==(I?I.id:null),ve=z.$el!==P.$el,ye=z.measuredIsRemoved,le=P.measuredIsRemoved;if(!z.measuredIsRemoved&&!le&&!Z&&(se||ve)){const Re=z.properties.left,Te=z.properties.top,Me=I||g.rootNode,ke=Me.id?p.nodes.get(Me.id):null,oe=ke?ke.properties.left:Me.properties.left,Ce=ke?ke.properties.top:Me.properties.top,_e=ke?ke.properties.clientLeft:Me.properties.clientLeft,Oe=ke?ke.properties.clientTop:Me.properties.clientTop;z.properties.x=Re-oe-_e,z.properties.y=Te-Ce-Oe}P.hasVisibilitySwap&&(P.hasVisibilityHidden&&(P.$el.style.visibility="visible",P.$measure.style.visibility="hidden"),P.hasDisplayNone&&(P.$el.style.display=z.measuredDisplay||P.measuredDisplay||"",P.$measure.style.visibility="hidden"));const te=m.has(M),ie=z.measuredIsVisible,Le=P.measuredIsVisible,xe=!ie&&Le&&!V,Ie=!le&&(ye||te)&&!$,$e=le&&!ye&&!H,we=$e||le&&te&&!H;P.branchAdded=$||Ie,P.branchRemoved=H||we,P.branchNotRendered=V||le,le&&ie&&(P.$el.style.display=z.measuredDisplay,P.$el.style.visibility="visible",gn(z,P,g)),$e?(P.isTarget&&(y.push(M),P.isLeaving=!0),m.add(M)):!le&&te&&m.delete(M),Ie&&!V||xe?(qa(z,d),P.isTarget&&(w.push(M),P.isEntering=!0)):we&&!V&&qa(P,f),P!==x&&P.isTarget&&!P.isEntering&&!P.isLeaving&&v.push(M),_.push(M)});let A=0,L=0,D=0;g.forEachRootNode(P=>{const M=P.$el,O=P.parentNode,I=p.nodes.get(P.id),$=P.properties,H=I.properties;let V=O!==x&&O;for(;V&&!V.isTarget&&V!==x;)V=V.parentNode;P===x?(P.index=0,P.targets=v,hr(P,t)):P.isEntering?(P.index=V?V.index:A,P.targets=V?v:w,hr(P,a),A++):P.isLeaving?(P.index=V?V.index:L,P.targets=V?v:y,L++,hr(P,l)):P.isTarget?(P.index=D++,P.targets=v,hr(P,t)):(P.index=V?V.index:0,P.targets=v,hr(P,h)),I.index=P.index,I.targets=P.targets;for(let se in $)$[se]=Ye($[se],M,P.index,P.targets,null,null),H[se]=Ye(H[se],M,I.index,I.targets,null,null);const z=1,Z=Math.abs($.width-H.width)>z,K=Math.abs($.height-H.height)>z;if(P.sizeChanged=Z||K,P.isTarget&&(!P.measuredIsRemoved&&I.measuredIsVisible||P.measuredIsRemoved&&P.measuredIsVisible)){($.transform!=="none"||H.transform!=="none")&&(P.hasTransform=!0,R.push(M));for(let se in $)if(se!=="transform"&&$[se]!==H[se]){C.push(M);break}}P.isTarget||(S.push(M),P.sizeChanged&&O&&O.isTarget&&O.sizeChanged&&(u.transform&&(P.hasTransform=!0,R.push(M)),b.push(M)))});const B={delay:P=>g.getNode(P).delay,duration:P=>g.getNode(P).duration,ease:P=>g.getNode(P).ease};if(s.defaults=B,this.timeline=va(s),!C.length&&!R.length&&!S.length)return ri(this.transitionMuteStore),this.timeline.complete();if(_.length){this.root.classList.add("is-animated");for(let P=0,M=_.length;P<M;P++){const O=_[P],I=O.dataset.layoutId,$=p.nodes.get(I),H=g.nodes.get(I),V=$.properties;H.isInlined||(($.measuredDisplay==="grid"||H.measuredDisplay==="grid")&&O.style.setProperty("display","block","important"),(O!==T||this.absoluteCoords)&&(O.style.position=this.absoluteCoords?"fixed":"absolute",O.style.left="0px",O.style.top="0px",O.style.marginLeft="0px",O.style.marginTop="0px",O.style.translate=`${V.x}px ${V.y}px`),O===T&&H.measuredPosition==="static"&&(O.style.position="relative",O.style.left="0px",O.style.top="0px")),O.style.width=`${V.width}px`,O.style.height=`${V.height}px`,O.style.minWidth="auto",O.style.minHeight="auto",O.style.maxWidth="none",O.style.maxHeight="none"}(p.scrollX!==window.scrollX||p.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(p.scrollX,p.scrollY));for(let P=0,M=C.length;P<M;P++){const O=C[P],I=O.dataset.layoutId,$=p.nodes.get(I),H=g.nodes.get(I),V=$.properties,z=H.properties;let Z=!1;const K={composition:"none"};V.width!==z.width&&(K.width=[V.width,z.width],Z=!0),V.height!==z.height&&(K.height=[V.height,z.height],Z=!0),!H.hasTransform&&!H.isInlined&&(K.translate=[`${V.x}px ${V.y}px`,`${z.x}px ${z.y}px`],Z=!0),this.properties.forEach(se=>{const ve=V[se],ye=z[se];se!=="transform"&&ve!==ye&&(K[se]=[ve,ye],Z=!0)}),Z&&this.timeline.add(O,K,0)}}if(S.length){for(let P=0,M=S.length;P<M;P++){const O=S[P],I=p.getNode(O),$=I.properties;O.style.width=`${$.width}px`,O.style.height=`${$.height}px`,O.style.minWidth="auto",O.style.minHeight="auto",O.style.maxWidth="none",O.style.maxHeight="none",I.isInlined||(O.style.translate=`${$.x}px ${$.y}px`),this.properties.forEach(H=>{H!=="transform"&&(O.style[H]=`${p.getComputedValue(O,H)}`)})}for(let P=0,M=S.length;P<M;P++){const O=S[P],I=g.getNode(O),$=I.properties;this.timeline.call(()=>{O.style.width=`${$.width}px`,O.style.height=`${$.height}px`,O.style.minWidth="auto",O.style.minHeight="auto",O.style.maxWidth="none",O.style.maxHeight="none",I.isInlined||(O.style.translate=`${$.x}px ${$.y}px`),this.properties.forEach(H=>{H!=="transform"&&(O.style[H]=`${g.getComputedValue(O,H)}`)})},I.delay+I.duration/2)}if(b.length){const P=Kt(g.nodes.get(b[0].dataset.layoutId).ease),M=I=>1-P(1-I),O={};if(u)for(let I in u)I!=="transform"&&(O[I]=[{from:$=>p.getComputedValue($,I),to:u[I]},{from:u[I],to:$=>g.getComputedValue($,I),ease:M}]);this.timeline.add(b,O,0)}}const F=R.length;if(F){for(let P=0;P<F;P++){const M=R[P],O=g.getNode(M);O.isInlined||(M.style.translate=`${p.getComputedValue(M,"x")}px ${p.getComputedValue(M,"y")}px`),M.style.transform=p.getComputedValue(M,"transform"),b.includes(M)&&(O.ease=Ye(n.ease,M,O.index,O.targets,null,null),O.duration=Ye(n.duration,M,O.index,O.targets,null,null))}this.transformAnimation=Na.animate(R,{translate:P=>g.getNode(P).isInlined?"0px 0px":`${g.getComputedValue(P,"x")}px ${g.getComputedValue(P,"y")}px`,transform:P=>{const M=g.getComputedValue(P,"transform");if(!b.includes(P))return M;const O=p.getComputedValue(P,"transform"),I=g.getNode(P);return[O,Ye(u.transform,P,I.index,I.targets,null,null),M]},autoplay:!1,...B}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},pd=(e,t)=>new Va(e,t),Lt=Hh,ii={},gd=(e,t=0)=>(...s)=>t?r=>e(...s,r):r=>e(r,...s),za=e=>(...t)=>{const s=e(...t);return new Proxy(ae,{apply:(r,i,[n])=>s(n),get:(r,i)=>{if(ii[i])return za((...n)=>{const o=ii[i](...n);return c=>o(s(c))})}})},Rt=(e,t,s=0)=>{const r=(...i)=>(i.length<t.length?za(gd(t,s)):t)(...i);return ii[e]||(ii[e]=r),r},Ua=Rt("roundPad",Lt.roundPad),Wa=Rt("padStart",Lt.padStart),ja=Rt("padEnd",Lt.padEnd),Ga=Rt("wrap",Lt.wrap),Xa=Rt("mapRange",Lt.mapRange),Ya=Rt("degToRad",Lt.degToRad),Za=Rt("radToDeg",Lt.radToDeg),Ja=Rt("snap",Lt.snap),Ka=Rt("clamp",Lt.clamp),Qa=Rt("round",Lt.round),el=Rt("lerp",Lt.lerp,1),tl=Rt("damp",Lt.damp,1),dr=(e=0,t=1,s=0)=>{const r=10**s;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},md=0,fr=(e,t=0,s=1,r=0)=>{let i=e===void 0?md++:e;return(n=t,o=s,c=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);const u=10**c;return Math.floor((((i^i>>>14)>>>0)/4294967296*(o-n+1/u)+n)*u)/u}},sl=e=>e[dr(0,e.length-1)],mn=(e,t=dr)=>{let s=e.length,r,i;for(;s;)i=t(0,--s),r=e[s],e[s]=e[i],e[i]=r;return e},pr=(e,t={})=>{let s=[],r=0,i,n=null;const o=t.from,c=t.reversed,u=t.ease,h=!W(u),d=h&&!W(u.ease)?u.ease:h?Kt(u):null,a=t.grid,f=a===!0,l=t.axis,p=t.total,g=W(o)||o===0||o==="first",v=o==="center",S=o==="last",w=o==="random",y=tt(o),m=tt(e),_=t.use,C=ks(m?e[0]:e),R=m?ks(e[1]):0,b=Ho.exec((m?e[1]:e)+""),x=t.start||0+(m?C:0),T=t.seed,A=!W(T)&&T!==!1?fr(T===!0?0:T):dr,L=t.jitter,D=!W(L),B=tt(L),F=B?L[0]:L||0,P=B?L[1]:L||0;let M=g?0:st(o)?o:0;return(O,I,$,H,V)=>{const[z]=as(O),Z=W(p)?$.length:p,K=W(_)?!1:Ve(_)?_(z,I,Z):Cs(z,_),se=st(K)||Ke(K)&&st(+K)?+K:I,ve=se>=0&&se<Z?se:I;if(v&&(M=(Z-1)/2),S&&(M=Z-1),!s.length){if(f){let te=!0,ie=!1,Le=1/0,xe=1/0,Ie=1/0,$e=-1/0,we=-1/0,Re=-1/0;const Te=[],Me=[],ke=[];for(let oe=0;oe<Z;oe++){const Ce=$[oe];let _e=0,Oe=0,U=0,ce=!1;if(Ce&&Ve(Ce.getBoundingClientRect)){const ue=Ce.getBoundingClientRect();_e=ue.left+ue.width/2,Oe=ue.top+ue.height/2,ce=!0}else{const ue=Ce;ue&&st(ue.x)&&st(ue.y)&&(_e=ue.x,Oe=ue.y,st(ue.z)&&(U=ue.z,ie=!0),ce=!0)}if(!ce){te=!1;break}Te.push(_e),Me.push(Oe),ke.push(U),_e<Le&&(Le=_e),Oe<xe&&(xe=Oe),U<Ie&&(Ie=U),_e>$e&&($e=_e),Oe>we&&(we=Oe),U>Re&&(Re=U)}if(te){let oe=Te[0],Ce=Me[0],_e=ke[0];y?(oe=Le+o[0]*($e-Le),Ce=xe+o[1]*(we-xe),_e=ie?Ie+(o.length>=3?o[2]:.5)*(Re-Ie):0):v?(oe=(Le+$e)/2,Ce=(xe+we)/2,_e=(Ie+Re)/2):S?(oe=Te[Z-1],Ce=Me[Z-1],_e=ke[Z-1]):st(o)&&(oe=Te[o],Ce=Me[o],_e=ke[o]);for(let U=0;U<Z;U++){const ce=oe-Te[U],ue=Ce-Me[U],he=_e-ke[U];let ze=Et(ce*ce+ue*ue+(ie?he*he:0));l==="x"&&(ze=-ce),l==="y"&&(ze=-ue),l==="z"&&(ze=-he),s.push(ze)}let Oe=1/0;for(let U=0;U<Z;U++){const ce=At(s[U]);ce>0&&ce<Oe&&(Oe=ce)}if(Oe>0&&Oe<1/0)for(let U=0;U<Z;U++)s[U]=s[U]/Oe}else for(let oe=0;oe<Z;oe++)s.push(At(M-oe))}else for(let te=0;te<Z;te++)if(!a)s.push(At(M-te));else{const ie=a.length,Le=a[0]*a[1];let xe,Ie,$e;y?(xe=o[0]*(a[0]-1),Ie=o[1]*(a[1]-1),$e=ie===3?(o.length>=3?o[2]:.5)*(a[2]-1):0):v?(xe=(a[0]-1)/2,Ie=(a[1]-1)/2,$e=ie===3?(a[2]-1)/2:0):(xe=M%a[0],Ie=qs(M/a[0])%a[1],$e=ie===3?qs(M/Le):0);const we=te%a[0],Re=qs(te/a[0])%a[1],Te=ie===3?qs(te/Le):0,Me=xe-we,ke=Ie-Re,oe=$e-Te;let Ce=Et(Me*Me+ke*ke+(ie===3?oe*oe:0));l==="x"&&(Ce=-Me),l==="y"&&(Ce=-ke),l==="z"&&(Ce=-oe),s.push(Ce)}r=s[0];for(let te=1;te<Z;te++)s[te]>r&&(r=s[te]);if(d||c)for(let te=0;te<Z;te++){let ie=s[te];d&&(ie=d(ie/r)*r),c&&(ie=l?-ie:At(r-ie)),s[te]=ie}if(D){n=new Array(Z);for(let te=0;te<Z;te++)n[te]=A(-1,1,4)}w&&(s=mn(s,A))}const ye=m?(R-C)/r:C;W(i)&&(i=V?ar(V,W(t.start)?V.iterationDuration:x):x);let le=i+(ye*G(s[ve],2)||0);if(D){const te=r?s[ve]/r:0,ie=F+(P-F)*te;le=le+n[ve]*ie}return t.modifier&&(le=t.modifier(le)),b&&(le=`${le}${b[2]}`),le}},vd=Ls({$:()=>as,addChild:()=>Ft,clamp:()=>Ka,cleanInlineStyles:()=>ea,createSeededRandom:()=>fr,damp:()=>tl,degToRad:()=>Ya,forEachChildren:()=>Pe,get:()=>cs,keepTime:()=>Zr,lerp:()=>el,mapRange:()=>Xa,padEnd:()=>ja,padStart:()=>Wa,radToDeg:()=>Za,random:()=>dr,randomPick:()=>sl,remove:()=>Sa,removeChild:()=>Ht,round:()=>Qa,roundPad:()=>Ua,set:()=>es,shuffle:()=>mn,snap:()=>Ja,stagger:()=>pr,sync:()=>dn,wrap:()=>Ga}),rl=e=>{const t=wt(e)[0];return!t||!Ir(t)?console.warn(`${e} is not a valid SVGGeometryElement`):t},vn=(e,t,s,r,i)=>{const n=s+r,o=i?Math.max(0,Math.min(n,t)):(n%t+t)%t;return e.getPointAtLength(o)},yn=(e,t,s=0)=>r=>{const i=+e.getTotalLength(),n=r[ji],o=e.getCTM(),c=s===0;return{from:0,to:i,modifier:u=>{const h=u+s*i;if(t==="a"){const d=vn(e,i,h,-1,c),a=vn(e,i,h,1,c);return Nr(a.y-d.y,a.x-d.x)*180/Gt}else{const d=vn(e,i,h,0,c);return t==="x"?n||!o?d.x:d.x*o.a+d.y*o.c+o.e:n||!o?d.y:d.x*o.b+d.y*o.d+o.f}}}},il=(e,t=0)=>{const s=rl(e);if(s)return{translateX:yn(s,"x",t),translateY:yn(s,"y",t),rotate:yn(s,"a",t)}},yd=e=>{let t=1;if(e&&e.getCTM){const s=e.getCTM();s&&(t=(Et(s.a*s.a+s.b*s.b)+Et(s.c*s.c+s.d*s.d))/2)}return t},bd=(e,t,s)=>{const r=dt,i=getComputedStyle(e),n=i.strokeLinecap,o=i.vectorEffect==="non-scaling-stroke"?e:null;let c=n;const u=new Proxy(e,{get(h,d){const a=h[d];return d===Do?h:d==="setAttribute"?(...f)=>{if(f[0]==="draw"){const l=f[1].split(" "),p=+l[0],g=+l[1],v=yd(o),S=p*-r*v,w=g*r*v+S,y=r*v+(p===0&&g===1||p===1&&g===0?0:10*v)-w;if(n!=="butt"){const m=p===g?"butt":n;c!==m&&(h.style.strokeLinecap=`${m}`,c=m)}h.setAttribute("stroke-dashoffset",`${S}`),h.setAttribute("stroke-dasharray",`${w} ${y}`)}return Reflect.apply(a,h,f)}:Ve(a)?(...f)=>Reflect.apply(a,h,f):a}});return e.getAttribute("pathLength")!==`${r}`&&(e.setAttribute("pathLength",`${r}`),u.setAttribute("draw",`${t} ${s}`)),u},nl=(e,t=0,s=0)=>wt(e).map(r=>bd(r,t,s)),ol=(e,t=.33)=>(s,r,i,n)=>{if(!(s.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${s.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const o=rl(e);if(!o)throw new Error("Can't morph to an invalid target. 'path2' must resolve to an existing <path>, <polygon> or <polyline> SVG element.");if(!(o.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${o.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const c=s.tagName==="path",u=c?" ":",",h=n?n._value:null;h&&s.setAttribute(c?"d":"points",h);let d="",a="";if(!t)d=s.getAttribute(c?"d":"points"),a=o.getAttribute(c?"d":"points");else{const f=s.getTotalLength(),l=o.getTotalLength(),p=Math.max(Math.ceil(f*t),Math.ceil(l*t));for(let g=0;g<p;g++){const v=g/(p-1),S=s.getPointAtLength(f*v),w=o.getPointAtLength(l*v),y=c?g===0?"M":"L":"";d+=y+G(S.x,3)+u+S.y+" ",a+=y+G(w.x,3)+u+w.y+" "}}return[d,a]},Sd=Ls({createDrawable:()=>nl,createMotionPath:()=>il,morphTo:()=>ol}),ni=typeof Intl<"u"&&Intl.Segmenter,_d=/\{value\}/g,wd=/\{i\}/g,bn=/(\s+)/,Sn=/^\s+$/,_n="line",gr="word",mr="char",vr="data-line",wn=null,kn=null,oi=null,al=e=>e.isWordLike||e.segment===" "||st(+e.segment),xn=e=>e.setAttribute("aria-hidden","true"),ai=(e,t)=>[...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)],kd={line:"#00D672",word:"#FF4B4B",char:"#5A87FF"},ll=e=>{if(!e.childElementCount&&!e.textContent.trim()){const t=e.parentElement;e.remove(),t&&ll(t)}},cl=(e,t,s)=>{const r=e.getAttribute(vr);if(r!==null&&+r!==t||e.tagName==="BR"){s.add(e);const n=e.previousSibling,o=e.nextSibling;n&&n.nodeType===3&&Sn.test(n.textContent)&&s.add(n),o&&o.nodeType===3&&Sn.test(o.textContent)&&s.add(o)}let i=e.childElementCount;for(;i--;)cl(e.children[i],t,s);return s},Tn=(e,t={})=>{let s="";t||(t={});const r=Ke(t.class)?` class="${t.class}"`:"",i=Y(t.clone,!1),n=Y(t.wrap,!1),o=n?n===!0?"clip":n:i?"clip":!1;if(n&&(s+=`<span${o?` style="overflow:${o};"`:""}>`),s+=`<span${r}${i?' style="position:relative;"':""} data-${e}="{i}">`,i){const c=i==="left"?"-100%":i==="right"?"100%":"0",u=i==="top"?"-100%":i==="bottom"?"100%":"0";s+="<span>{value}</span>",s+=`<span inert style="position:absolute;top:${u};left:${c};white-space:nowrap;">{value}</span>`}else s+="{value}";return s+="</span>",n&&(s+="</span>"),s},Cn=(e,t,s,r,i,n,o,c,u)=>{const h=i===_n,d=i===mr,a=`_${i}_`,f=Ve(e)?e(s):e,l=h?"block":"inline-block";oi.innerHTML=f.replace(_d,`<i class="${a}"></i>`).replace(wd,`${d?u:h?o:c}`);const p=oi.content,g=p.firstElementChild,v=p.querySelector(`[data-${i}]`)||g,S=p.querySelectorAll(`i.${a}`),w=S.length;if(w){g.style.display=l,v.style.display=l,v.setAttribute(vr,`${o}`),h||(v.setAttribute("data-word",`${c}`),d&&v.setAttribute("data-char",`${u}`));let y=w;for(;y--;){const m=S[y],_=m.parentElement;_.style.display=l,h?_.innerHTML=s.innerHTML:_.replaceChild(s.cloneNode(!0),m)}t.push(v),r.appendChild(p)}else console.warn('The expression "{value}" is missing from the provided template.');return n&&(g.style.outline=`1px dotted ${kd[i]}`),g},li=class{constructor(e,t={}){wn||(wn=ni?new ni([],{granularity:gr}):{segment:l=>{const p=[],g=l.split(bn);for(let v=0,S=g.length;v<S;v++){const w=g[v];p.push({segment:w,isWordLike:!Sn.test(w)})}return p}}),kn||(kn=ni?new ni([],{granularity:"grapheme"}):{segment:l=>[...l].map(p=>({segment:p}))}),!oi&&jt&&(oi=ee.createElement("template")),Ge.current&&Ge.current.register(this);const{words:s,chars:r,lines:i,accessible:n,includeSpaces:o,debug:c}=t,u=(e=tt(e)?e[0]:e)&&e.nodeType?e:(nn(e)||[])[0],h=i===!0?{}:i,d=s===!0||W(s)?{}:s,a=r===!0?{}:r;this.debug=Y(c,!1),this.includeSpaces=Y(o,!1),this.accessible=Y(n,!0),this.linesOnly=h&&!d&&!a,this.lineTemplate=Je(h)?Tn(_n,h):h,this.wordTemplate=Je(d)||this.linesOnly?Tn(gr,d):d,this.charTemplate=Je(a)?Tn(mr,a):a,this.$target=u,this.html=u&&u.innerHTML,this.lines=[],this.words=[],this.chars=[],this.effects=[],this.effectsCleanups=[],this.cache=null,this.ready=!1,this.width=0,this.resizeTimeout=null;const f=()=>this.html&&(h||d||a)&&this.split();this.resizeObserver=new ResizeObserver(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{const l=u.offsetWidth;l!==this.width&&(this.width=l,f())},150)}),this.lineTemplate&&!this.ready?ee.fonts.ready.then(f):f(),u?this.resizeObserver.observe(u):console.warn("No Text Splitter target found.")}addEffect(e){if(!Ve(e))return console.warn("Effect must return a function."),this;const t=Zr(e);return this.effects.push(t),this.ready&&(this.effectsCleanups[this.effects.length-1]=t(this)),this}revert(){return clearTimeout(this.resizeTimeout),this.lines.length=this.words.length=this.chars.length=0,this.resizeObserver.disconnect(),this.effectsCleanups.forEach(e=>Ve(e)?e(this):e.revert&&e.revert()),this.$target.innerHTML=this.html,this}splitNode(e){const t=this.wordTemplate,s=this.charTemplate,r=this.includeSpaces,i=this.debug,n=e.nodeType;if(n===3){const o=e.nodeValue;if(o.trim()){const c=[],u=this.words,h=this.chars,d=wn.segment(o),a=ee.createDocumentFragment();let f=null;for(const l of d){const p=l.segment,g=al(l);if(!f||g&&f&&al(f))c.push(p);else{const v=c.length-1,S=c[v];!bn.test(S)&&!bn.test(p)?c[v]+=p:c.push(p)}f=l}for(let l=0,p=c.length;l<p;l++){const g=c[l];if(g.trim()){const v=c[l+1],S=r&&v&&!v.trim(),w=g,y=s?kn.segment(w):null,m=s?ee.createDocumentFragment():ee.createTextNode(S?g+" ":g);if(s){const _=[...y];for(let C=0,R=_.length;C<R;C++){const b=_[C],x=C===R-1&&S?b.segment+" ":b.segment,T=ee.createTextNode(x);Cn(s,h,T,m,mr,i,-1,u.length,h.length)}}t?Cn(t,u,m,a,gr,i,-1,u.length,h.length):s?a.appendChild(m):a.appendChild(ee.createTextNode(g)),S&&l++}else{if(l&&r)continue;a.appendChild(ee.createTextNode(g))}}e.parentNode.replaceChild(a,e)}}else if(n===1){const o=[...e.childNodes];for(let c=0,u=o.length;c<u;c++)this.splitNode(o[c])}}split(e=!1){const t=this.$target,s=!!this.cache&&!e,r=this.lineTemplate,i=this.wordTemplate,n=this.charTemplate,o=ee.fonts.status!=="loading",c=r&&o;this.ready=!r||o,(c||e)&&this.effectsCleanups.forEach(a=>Ve(a)&&a(this)),s||(e&&(t.innerHTML=this.html,this.words.length=this.chars.length=0),this.splitNode(t),this.cache=t.innerHTML),c&&(s&&(t.innerHTML=this.cache),this.lines.length=0,i&&(this.words=ai(t,gr))),n&&(c||i)&&(this.chars=ai(t,mr));const u=this.words.length?this.words:this.chars;let h,d=0;for(let a=0,f=u.length;a<f;a++){const l=u[a],{top:p,height:g}=l.getBoundingClientRect();!W(h)&&p-h>g*.5&&d++,l.setAttribute(vr,`${d}`);const v=l.querySelectorAll(`[${vr}]`);let S=v.length;for(;S--;)v[S].setAttribute(vr,`${d}`);h=p}if(c){const a=ee.createDocumentFragment(),f=new Set,l=[];for(let p=0;p<d+1;p++){const g=t.cloneNode(!0);cl(g,p,new Set).forEach(v=>{const S=v.parentNode;S&&(v.nodeType===1&&f.add(S),S.removeChild(v))}),l.push(g)}f.forEach(ll);for(let p=0,g=l.length;p<g;p++)Cn(r,this.lines,l[p],a,_n,this.debug,p);t.innerHTML="",t.appendChild(a),i&&(this.words=ai(t,gr)),n&&(this.chars=ai(t,mr))}if(this.linesOnly){const a=this.words;let f=a.length;for(;f--;){const l=a[f];l.replaceWith(l.textContent)}a.length=0}if(this.accessible&&(c||!s)){const a=ee.createElement("span");a.style.cssText="position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;",a.innerHTML=this.html,t.insertBefore(a,t.firstChild),this.lines.forEach(xn),this.words.forEach(xn),this.chars.forEach(xn)}return this.width=t.offsetWidth,(c||e)&&this.effects.forEach((a,f)=>this.effectsCleanups[f]=a(this)),this}refresh(){this.split(!0)}},yr=(e,t)=>new li(e,t),ul=(e,t)=>(console.warn("text.split() is deprecated, import splitText() directly, or text.splitText()"),new li(e,t)),hl=e=>{let t="";for(let s=0,r=e.length;s<r;s++)if(s+2<r&&e[s+1]==="-"&&e.charCodeAt(s)<e.charCodeAt(s+2)){const i=e.charCodeAt(s),n=e.charCodeAt(s+2);for(let o=i;o<=n;o++)t+=String.fromCharCode(o);s+=2}else t+=e[s];return t},dl={lowercase:"a-z",uppercase:"A-Z",numbers:"0-9",symbols:"!%#_|*+=",braille:"⠀-⣿",blocks:"▀-▟",shades:"░-▓"},En=new WeakMap,fl=(e={})=>{e||(e={});const t=e.chars,s=Kt(e.ease||"linear"),r=e.text,i=e.from,n=e.reversed||!1,o=e.perturbation||0,c=e.cursor,u=c===!0?"_":typeof c=="number"?String.fromCharCode(c):typeof c=="string"?c:"",h=u.length,d=e.seed||0,a=e.override!==void 0?e.override:!0,f=e.revealRate||60,l=1e3*X.timeScale/f,p=e.settleDuration||300*X.timeScale,g=e.settleRate||30,v=e.duration,S=e.revealDelay,w=e.delay,y=e.onChange||ae;return(m,_,C,R)=>{const b=typeof t=="function"?t(m,_,C):t||"a-zA-Z0-9!%#_",x=hl(dl[b]||b),T=x.length-1,A=typeof v=="function"?v(m,_,C):v,L=typeof S=="function"?S(m,_,C):S||0,D=typeof w=="function"?w(m,_,C):w||0,B=d?fr(d):fr();En.has(m)||En.set(m,m.textContent);const F=R?R._value:m.textContent,P=r!==void 0?typeof r=="function"?r(m,_,C):r:R?R._value:En.get(m),M=P===" "||P===" "?" ":P,O=F===" "?0:F.length,I=M.length,$=a===!0?x:typeof a=="string"&&a.length>0?hl(dl[a]||a):null,H=$?$.length-1:0,V=a===" "?" ":null,z=a===""?I:Math.max(O,I),Z=A>0?A:(z-1)*l+p,K=G((Z+L)/X.timeScale,0)*X.timeScale,se=L>0?G(L/K,12):0,ve=i===void 0||i==="auto"?I<O?"right":"left":i,ye=new Int32Array(z);if(ve==="random"){for(let U=0;U<z;U++)ye[U]=U;for(let U=z-1;U>0;U--){const ce=B(0,U),ue=ye[U];ye[U]=ye[ce],ye[ce]=ue}}else{const U=ve==="right"?(a===""||!O?z:O)-1:ve==="center"?((a===""||!O?z:O)-1)/2:typeof ve=="number"?ve:0,ce=Math.abs,ue=new Array(z);for(let he=0;he<z;he++)ue[he]=he;ue.sort((he,ze)=>ce(he-U)-ce(ze-U));for(let he=0;he<z;he++)ye[ue[he]]=he}if(n){const U=z-1;for(let ce=0;ce<z;ce++)ye[ce]=U-ye[ce]}const le=G(p/Z,12),te=G((1-le)/z,12),ie=h*te,Le=G(1e3*X.timeScale/(g*K),12),xe=new Float32Array(z),Ie=new Float32Array(z),$e=o>0?o*le:0;for(let U=0;U<z;U++){const ce=$e>0?(B(0,2e3)-1e3)/1e3*$e:0,ue=$e>0?(B(0,2e3)-1e3)/1e3*$e:0;xe[U]=ye[U]*te+ce,Ie[U]=Math.ceil((xe[U]+le+ue)/Le)*Le}if(I<z&&ve!=="left"&&ve!=="right"&&ve!=="random"){let U=0;for(let he=I;he<z;he++)Ie[he]>U&&(U=Ie[he]);const ce=new Array(I);for(let he=0;he<I;he++)ce[he]=he;ce.sort((he,ze)=>ye[he]-ye[ze]);const ue=(1-U)/I;for(let he=0;he<I;he++){const ze=U+he*ue;ze>Ie[ce[he]]&&(Ie[ce[he]]=ze)}}const we=new Array(z);for(let U=0;U<z;U++)we[U]=x[B(0,T)];const Re=$?$===x?we:new Array(z):null;if(Re&&Re!==we)for(let U=0;U<z;U++)Re[U]=V||$[B(0,$.length-1)];let Te=F;if(!R){if(a==="")Te="";else if($){Te="";for(let U=0;U<O;U++)Te+=F[U]===" "?" ":Re[U]}}let Me=-1,ke=-1,oe="";const Ce=a!=="",_e=!!$,Oe=h>0;return{from:0,to:1,duration:K,delay:D,ease:"linear",modifier:U=>{if(U===Me)return oe;if(Me=U,D>0&&U<=0)return oe=F,F;if(U<=0)return oe=Te,Te;if(U>=1)return oe=M,M;oe="";const ce=U/Le|0,ue=ce!==ke;ue&&(ke=ce);const he=se>0?(U-se)/(1-se):U,ze=he>0?s(he):0;for(let De=0;De<z;De++){const xt=xe[De];if(ze>=Ie[De]){De<I&&(oe+=M[De]);continue}if(ze<=0||ze<xt){Ce&&De<O&&(_e?F[De]===" "?oe+=" ":(ue&&(Re[De]=V||$[B(0,H)]),oe+=Re[De]):oe+=F[De]);continue}De<I&&M[De]===" "||De<O&&F[De]===" "?oe+=" ":Oe&&ze-xt<ie?oe+=u[h-1-((ze-xt)/te|0)]:(ue&&(we[De]=x[B(0,T)]),oe+=we[De])}return ue&&y(oe,ze),oe}}}},xd=Ls({TextSplitter:()=>li,scrambleText:()=>fl,split:()=>ul,splitText:()=>yr}),Td=Ls({$:()=>as,Animatable:()=>cn,AutoLayout:()=>Va,Draggable:()=>_a,JSAnimation:()=>Qt,Scope:()=>wa,ScrollObserver:()=>Ta,Spring:()=>Gr,TextSplitter:()=>li,Timeline:()=>ma,Timer:()=>_t,WAAPIAnimation:()=>Ma,addChild:()=>Ft,animate:()=>or,clamp:()=>Ka,cleanInlineStyles:()=>ea,createAnimatable:()=>Bh,createDraggable:()=>Zh,createDrawable:()=>nl,createLayout:()=>pd,createMotionPath:()=>il,createScope:()=>Jh,createSeededRandom:()=>fr,createSpring:()=>ya,createTimeline:()=>va,createTimer:()=>Ih,cubicBezier:()=>Ea,damp:()=>tl,degToRad:()=>Ya,eases:()=>Jt,easings:()=>id,engine:()=>it,forEachChildren:()=>Pe,get:()=>cs,globals:()=>X,irregular:()=>Pa,keepTime:()=>Zr,lerp:()=>el,linear:()=>fn,mapRange:()=>Xa,morphTo:()=>ol,onScroll:()=>sd,padEnd:()=>ja,padStart:()=>Wa,radToDeg:()=>Za,random:()=>dr,randomPick:()=>sl,remove:()=>Sa,removeChild:()=>Ht,round:()=>Qa,roundPad:()=>Ua,scrambleText:()=>fl,scrollContainers:()=>Kr,set:()=>es,shuffle:()=>mn,snap:()=>Ja,split:()=>ul,splitText:()=>yr,spring:()=>Xr,stagger:()=>pr,steps:()=>Aa,svg:()=>Sd,sync:()=>dn,text:()=>xd,utils:()=>vd,waapi:()=>Na,wrap:()=>Ga}),Cd=class{registerAnimation(e,t,s={}){this.animations[e]={handler:t,options:s}}isInitiallyHidden(e){return this.animations[e]?.options.initiallyHidden??!1}runAnimation(e,t,s,r,i){const n=this.animations[e];n?n.handler(t,s,r,i):(console.warn(`No animation registered with name: ${e}`),r())}addLinkAnimation(e,t){this.linkAnimations.set(e,t)}removeLinkAnimation(e){this.linkAnimations.delete(e)}runLinkAnimation(e){const t=this.linkAnimations.get(e);t&&t()}constructor(){this.animations={},this.linkAnimations=new Map,this.registerAnimation("typewriter",function(e,t,s,r){const{chars:i}=yr(e,{words:!0,chars:!0}),n=t.fadeDuration||100,o=t.interval||100;or(i,{opacity:[0,1],easing:"linear",duration:n,delay:pr(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("toast",function(e,t,s,r){const{words:i}=yr(e,{words:!0,chars:!1}),n=t.fadeDuration||100,o=t.interval||200;or(i,{opacity:[0,1],y:[{to:["100%","0%"]}],easing:"linear",duration:n,delay:pr(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("fadeIn",function(e,t,s,r){const i=t.duration||500;or(e,{opacity:[0,1],easing:t.easing||"easeOutQuad",duration:i,delay:t.start||0,loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("continue",function(e,t,s){e.classList.add("squiffy-continue");const r=t.style||"pulse";let i=null,n=null;r==="wave"?(e.classList.add("squiffy-continue-wave"),n=yr(e,{words:!0,chars:!0}).chars,i=or(n,{opacity:[1,.3,1],easing:"easeInOutSine",duration:1200,delay:pr(80),loop:!0})):e.classList.add(`squiffy-continue-${r}`);const o=()=>{if(e.classList.remove("squiffy-continue","squiffy-continue-wave",`squiffy-continue-${r}`),e.removeEventListener("click",o),i&&(i.pause(),n))for(const c of n)c.style.opacity="1";s()};e.addEventListener("click",o)})}},Ed={animejs:Td},pl="input:not([disabled]), textarea:not([disabled]), select:not([disabled])",Ad="a.squiffy-link[data-section], a.squiffy-link[data-passage]";function An(e){if(!e)return!0;const t=e.querySelectorAll(pl);for(const s of t)if(!s.checkValidity())return!1;return!0}function Pn(e){if(!e)return;const t=An(e),s=e.querySelectorAll(Ad);for(const r of s)t?(r.classList.remove("validation-disabled"),r.removeAttribute("aria-disabled")):(r.classList.add("validation-disabled"),r.setAttribute("aria-disabled","true"))}function br(e){if(!e)return;const t=e.querySelectorAll(pl);for(const s of t)s.addEventListener("input",()=>Pn(e)),s.addEventListener("change",()=>Pn(e)),s.addEventListener("invalid",r=>{r.preventDefault(),s.classList.add("squiffy-invalid")}),s.addEventListener("input",()=>{s.checkValidity()&&s.classList.remove("squiffy-invalid")});Pn(e)}var gl=["src","poster"],Pd="data-squiffy-asset-",Ld=[...gl,"srcset","style"].map(e=>`[${e}]`).join(","),ml=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")||e.startsWith("#"),Ln=(e,t)=>{const s=e.trim();if(!s||ml(s))return e;let r=s;try{r=decodeURI(s)}catch{}return t(r)},Rd=(e,t)=>e.split(",").map(s=>{const r=s.match(/^(\s*)(\S+)(.*)$/s);return r?r[1]+Ln(r[2],t)+r[3]:s}).join(","),Od=(e,t)=>e.replace(/url\(\s*(['"]?)(.*?)\1\s*\)/gi,(s,r,i)=>{const n=Ln(i,t);return n===i?s:`url("${n.replace(/["\\\n]/g,o=>"\\"+(o===`
|
|
1573
|
+
`?"a ":o))}")`}),Id=(e,t,s)=>{const r=Pd+t,i=e.getAttribute(r)??e.getAttribute(t);if(i===null)return;let n;t==="srcset"?n=Rd(i,s):t==="style"?n=Od(i,s):n=Ln(i,s),n===i?e.removeAttribute(r):e.setAttribute(r,i),e.setAttribute(t,n)},Md=e=>t=>{if(!e||!/\b(src|srcset|poster|style)\s*=/i.test(t))return t;const s=document.createElement("template");s.innerHTML=t;for(const r of s.content.querySelectorAll(Ld))for(const i of[...gl,"srcset","style"])r.hasAttribute(i)&&Id(r,i,e);return s.innerHTML},Cf=1,vl=50,Nd=class{constructor(e){this.options=e,this.music=null,this.effects=new Set,this.preloaded=new Map,this.muted=!1,this.waitingForGesture=!1,this.disposed=!1,this.onGesture=()=>{this.removeGestureListeners();const t=this.music;t&&t.audio.paused&&(t.audio.volume=1,this.playTrack(t,0))},this.muted=this.readMuted()}preload(e){if(!(typeof Audio>"u"))for(const t of e){if(this.preloaded.has(t))continue;const s=new Audio;s.preload="auto",s.src=this.options.resolveUrl(t),this.preloaded.set(t,s)}}sync(e=1){if(this.disposed)return;const t=this.options.getMusic()||null;t!==(this.music?.file??null)&&(this.stopMusic(e),t&&this.startMusic(t,e))}play(e,t=1){if(this.disposed||typeof Audio>"u")return;const s=this.newAudio(e);s.volume=yl(t),this.effects.add(s);const r=()=>this.effects.delete(s);s.addEventListener("ended",r),s.addEventListener("error",r),this.options.onPlay?.(),s.play()?.catch(r)}stopSounds(){for(const e of this.effects)e.pause();this.effects.clear()}isMuted(){return this.muted}setMuted(e){this.muted=e,this.music&&(this.music.audio.muted=e);for(const t of this.effects)t.muted=e;this.writeMuted()}dispose(){this.disposed=!0,this.stopMusic(0),this.stopSounds(),this.removeGestureListeners()}newAudio(e){const t=new Audio(this.options.resolveUrl(e));return t.muted=this.muted,t}startMusic(e,t){if(typeof Audio>"u")return;const s=this.newAudio(e);s.loop=!0;const r={file:e,audio:s};this.music=r,this.options.onPlay?.(),s.volume=t>0?0:1,this.playTrack(r,t)}playTrack(e,t){const s=e.audio.play();t>0&&this.fade(e,1,t),s?.catch(r=>{e===this.music&&r?.name=="NotAllowedError"&&this.waitForGesture()})}stopMusic(e){const t=this.music;t&&(this.music=null,e>0&&!t.audio.paused?this.fade(t,0,e,()=>t.audio.pause()):(clearInterval(t.fadeTimer),t.audio.pause()))}fade(e,t,s,r){clearInterval(e.fadeTimer);const i=e.audio.volume,n=Math.max(1,Math.round(s*1e3/vl));let o=0;e.fadeTimer=setInterval(()=>{o++,e.audio.volume=yl(i+(t-i)*o/n),o>=n&&(clearInterval(e.fadeTimer),e.fadeTimer=void 0,r?.())},vl)}waitForGesture(){this.waitingForGesture||typeof document>"u"||(this.waitingForGesture=!0,document.addEventListener("pointerdown",this.onGesture,!0),document.addEventListener("keydown",this.onGesture,!0))}removeGestureListeners(){this.waitingForGesture&&(this.waitingForGesture=!1,document.removeEventListener("pointerdown",this.onGesture,!0),document.removeEventListener("keydown",this.onGesture,!0))}readMuted(){if(!this.options.mutedKey)return!1;try{return localStorage.getItem(this.options.mutedKey)=="true"}catch{return!1}}writeMuted(){if(this.options.mutedKey)try{this.muted?localStorage.setItem(this.options.mutedKey,"true"):localStorage.removeItem(this.options.mutedKey)}catch{}}},yl=e=>Math.min(1,Math.max(0,Number.isFinite(e)?e:1)),$d=0;function Dd(e){const t=`squiffy-confirm-${++$d}`,s=document.createElement("dialog");s.className="squiffy-confirm",s.setAttribute("role","alertdialog"),s.setAttribute("aria-labelledby",`${t}-message`),s.innerHTML=`
|
|
1574
|
+
<p id="${t}-message"></p>
|
|
1575
|
+
<div class="squiffy-confirm-buttons">
|
|
1576
|
+
<button type="button" class="squiffy-confirm-button" data-answer="no"></button>
|
|
1577
|
+
<button type="button" class="squiffy-confirm-button ${e.danger?"squiffy-confirm-danger":"squiffy-confirm-primary"}" data-answer="yes"></button>
|
|
1578
|
+
</div>`,s.querySelector("p").textContent=e.message;const r=s.querySelector("[data-answer=no]"),i=s.querySelector("[data-answer=yes]");return r.textContent=e.cancel??"Cancel",i.textContent=e.confirm,(e.container??document.body).appendChild(s),new Promise(n=>{let o=!1;const c=u=>{o||(o=!0,s.open&&s.close(),s.remove(),n(u))};r.addEventListener("click",()=>c(!1)),i.addEventListener("click",()=>c(!0)),s.addEventListener("cancel",u=>{u.preventDefault(),c(!1)}),s.addEventListener("close",()=>c(!1)),s.addEventListener("click",u=>{if(u.target!==s)return;const h=s.getBoundingClientRect();u.clientX>=h.left&&u.clientX<=h.right&&u.clientY>=h.top&&u.clientY<=h.bottom||c(!1)}),s.showModal(),i.focus()})}var qd="squiffy-saves",Rn="saves",bl=(e,t)=>t.save.savedAt.localeCompare(e.save.savedAt)||t.id-e.id,On=e=>({id:e.id,name:e.name,save:e.save}),ci=e=>e?.trim()||null;function In(e){return new Promise((t,s)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>s(e.error)})}function Sl(e){return new Promise((t,s)=>{e.oncomplete=()=>t(),e.onerror=()=>s(e.error),e.onabort=()=>s(e.error)})}function Bd(e){let t;const s=()=>t??(t=new Promise((h,d)=>{const a=indexedDB.open(qd,1);a.onupgradeneeded=()=>{a.result.createObjectStore(Rn,{keyPath:["key","id"]})},a.onsuccess=()=>h(a.result),a.onerror=()=>{t=void 0,d(a.error)}})),r=()=>IDBKeyRange.bound([e,-1/0],[e,1/0]),i=async h=>(await s()).transaction(Rn,h).objectStore(Rn),n=async h=>In((await i("readonly")).get([e,h])),o=async h=>{const d=await i("readwrite");d.put(h),await Sl(d.transaction)};let c=!1;const u=()=>{c||(c=!0,navigator.storage?.persist?.().catch(()=>{}))};return{async list(){return(await In((await i("readonly")).getAll(r()))).map(On).sort(bl)},async get(h){const d=await n(h);return d?On(d):null},async add(h,d){const a={key:e,id:(await In((await i("readonly")).getAllKeys(r()))).reduce((f,l)=>Math.max(f,l[1]),0)+1,name:ci(d),save:h};return await o(a),u(),On(a)},async overwrite(h,d){const a=await n(h);await o({key:e,id:h,name:a?.name??null,save:d})},async rename(h,d){const a=await n(h);a&&await o({...a,name:ci(d)})},async delete(h){const d=await i("readwrite");d.delete([e,h]),await Sl(d.transaction)}}}function Hd(){const e=new Map;let t=1;const s=r=>structuredClone(r);return{async list(){return[...e.values()].map(s).sort(bl)},async get(r){const i=e.get(r);return i?s(i):null},async add(r,i){const n={id:t++,name:ci(i),save:structuredClone(r)};return e.set(n.id,n),s(n)},async overwrite(r,i){e.set(r,{id:r,name:e.get(r)?.name??null,save:structuredClone(i)})},async rename(r,i){const n=e.get(r);n&&(n.name=ci(i))},async delete(r){e.delete(r)}}}var Mn={saves:"Saved games",saveName:"Name (optional)",save:"Save",noSaves:"No saved games yet.",savedGame:"Saved game",savedToday:"Today, [time]",savedYesterday:"Yesterday, [time]",load:"Load",loadConfirm:`Load "[name]"? You'll lose anything you've done since you last saved.`,saveOptions:"Options for [name]",overwrite:"Overwrite",overwriteConfirm:'Overwrite "[name]"?',rename:"Rename",newName:"New name",saveToFile:"Save to file",loadFromFile:"Load from file",delete:"Delete",deleteConfirm:`Delete "[name]"? This can't be undone.`,cancel:"Cancel",close:"Close",wrongStory:"This saved game is for a different story.",notASave:"This file isn't a saved game.",cantSave:"The game couldn't be saved. Try Save to file instead."},_l=".squiffy-save",Fd='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>',Vd='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></svg>',zd='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>',Ud='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"/></svg>',Wd=0;function jd(e,t=Mn,s=new Date){const r=new Date(e);if(isNaN(r.getTime()))return"";const i=r.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),n=c=>new Date(c.getFullYear(),c.getMonth(),c.getDate()).getTime(),o=Math.round((n(s)-n(r))/864e5);return o===0?t.savedToday.replace("[time]",i):o===1?t.savedYesterday.replace("[time]",i):`${r.toLocaleDateString(void 0,{day:"numeric",month:"short",...r.getFullYear()!==s.getFullYear()?{year:"numeric"}:{}})}, ${i}`}function Gd(e,t={}){const s={...Mn};for(const O of Object.keys(Mn)){const I=t.strings?.[O];typeof I=="string"&&(s[O]=I)}const r=t.slots??(typeof indexedDB<"u"?Bd(t.key??window.location.pathname):Hd()),i=`squiffy-saves-${++Wd}`,n=document.createElement("dialog");n.className="squiffy-saves",n.setAttribute("aria-labelledby",`${i}-heading`),n.innerHTML=`
|
|
1579
|
+
<div class="squiffy-saves-header">
|
|
1580
|
+
<h2 id="${i}-heading"></h2>
|
|
1581
|
+
<button type="button" class="squiffy-saves-icon-button" data-close>${Fd}</button>
|
|
1582
|
+
</div>
|
|
1583
|
+
<p class="squiffy-saves-error" role="alert" hidden></p>
|
|
1584
|
+
<form class="squiffy-saves-new">
|
|
1585
|
+
<input type="text" autocomplete="off">
|
|
1586
|
+
<button type="submit" class="squiffy-saves-button squiffy-saves-primary"></button>
|
|
1587
|
+
</form>
|
|
1588
|
+
<ul class="squiffy-saves-list"></ul>
|
|
1589
|
+
<div class="squiffy-saves-footer">
|
|
1590
|
+
<button type="button" class="squiffy-saves-link" data-save-to-file>${zd}<span></span></button>
|
|
1591
|
+
<button type="button" class="squiffy-saves-link" data-load-from-file>${Ud}<span></span></button>
|
|
1592
|
+
<input type="file" accept="${_l},.json,application/json" hidden>
|
|
1593
|
+
</div>
|
|
1594
|
+
<div class="squiffy-saves-footer-confirm"></div>`;const o=O=>n.querySelector(O);o("h2").textContent=s.saves;const c=o("[data-close]");c.title=s.close,c.setAttribute("aria-label",s.close);const u=o(".squiffy-saves-error"),h=o("form"),d=o("form input");d.placeholder=s.saveName,d.setAttribute("aria-label",s.saveName),o("form button").textContent=s.save;const a=o(".squiffy-saves-list");o("[data-save-to-file] span").textContent=s.saveToFile,o("[data-load-from-file] span").textContent=s.loadFromFile;const f=o("input[type=file]"),l=o(".squiffy-saves-footer-confirm");(t.container??document.body).appendChild(n);let p=!1;e.on("navigated",()=>{p=!1});const g=()=>!p&&e.canGoBack();let v=[],S=null;const w=O=>{u.textContent=O,u.hidden=!1},y=()=>{u.hidden=!0},m=O=>O.name||O.save.summary||s.savedGame,_=O=>[jd(O.save.savedAt,s),O.name&&O.save.summary].filter(Boolean).join(" · "),C=O=>a.querySelector(`[data-slot="${O}"]`);function R(){if(a.replaceChildren(),!v.length){const O=document.createElement("li");O.className="squiffy-saves-empty",O.textContent=s.noSaves,a.appendChild(O);return}for(const O of v){const I=m(O),$=document.createElement("li");$.className="squiffy-saves-row",$.dataset.slot=String(O.id),$.innerHTML=`
|
|
1595
|
+
<div class="squiffy-saves-line">
|
|
1596
|
+
<div class="squiffy-saves-info">
|
|
1597
|
+
<div class="squiffy-saves-title" id="${i}-title-${O.id}"></div>
|
|
1598
|
+
<div class="squiffy-saves-meta"></div>
|
|
1599
|
+
</div>
|
|
1600
|
+
<button type="button" class="squiffy-saves-button" data-action="load" aria-describedby="${i}-title-${O.id}"></button>
|
|
1601
|
+
<div class="squiffy-saves-options">
|
|
1602
|
+
<button type="button" class="squiffy-saves-icon-button" data-action="options" aria-haspopup="menu" aria-expanded="false" aria-controls="${i}-menu-${O.id}">${Vd}</button>
|
|
1603
|
+
<div class="squiffy-saves-menu" id="${i}-menu-${O.id}" role="menu" hidden>
|
|
1604
|
+
<button type="button" role="menuitem" data-action="overwrite"></button>
|
|
1605
|
+
<button type="button" role="menuitem" data-action="rename"></button>
|
|
1606
|
+
<button type="button" role="menuitem" data-action="download"></button>
|
|
1607
|
+
<button type="button" role="menuitem" data-action="delete" class="squiffy-saves-danger"></button>
|
|
1608
|
+
</div>
|
|
1609
|
+
</div>
|
|
1610
|
+
</div>`;const H=Z=>$.querySelector(Z);H(".squiffy-saves-title").textContent=I;const V=_(O);V?H(".squiffy-saves-meta").textContent=V:H(".squiffy-saves-meta").remove(),H("[data-action=load]").textContent=s.load;const z=H("[data-action=options]");z.title=s.saveOptions.replace("[name]",I),z.setAttribute("aria-label",z.title),H("[data-action=overwrite]").textContent=s.overwrite,H("[data-action=rename]").textContent=s.rename,H("[data-action=download]").textContent=s.saveToFile,H("[data-action=delete]").textContent=s.delete,a.appendChild($)}}async function b(){try{v=await r.list()}catch{v=[],w(s.cantSave)}R()}function x(O,I,$,H=!1){S?.();const V=document.createElement("div");V.className="squiffy-saves-confirm",V.setAttribute("role","group"),V.innerHTML=`<p id="${i}-confirm"></p>
|
|
1611
|
+
<div class="squiffy-saves-confirm-buttons">
|
|
1612
|
+
<button type="button" class="squiffy-saves-button" data-answer="no"></button>
|
|
1613
|
+
<button type="button" class="squiffy-saves-button ${H?"squiffy-saves-danger-button":"squiffy-saves-primary"}" data-answer="yes" aria-describedby="${i}-confirm"></button>
|
|
1614
|
+
</div>`,V.setAttribute("aria-labelledby",`${i}-confirm`),V.querySelector("p").textContent=I;const z=V.querySelector("[data-answer=no]"),Z=V.querySelector("[data-answer=yes]");return z.textContent=s.cancel,Z.textContent=$,O.appendChild(V),new Promise(K=>{const se=ve=>{S=null,V.remove(),K(ve)};S=()=>se(!1),z.addEventListener("click",()=>se(!1)),Z.addEventListener("click",()=>se(!0)),Z.focus()})}const T=typeof HTMLElement.prototype.showPopover=="function";function A(O,I){if(!T){O.hidden=!1;return}O.hidden=!1,O.popover="manual",O.showPopover();const $=I.getBoundingClientRect(),{width:H,height:V}=O.getBoundingClientRect(),z=$.bottom+4;O.style.top=`${z+V>window.innerHeight-8?Math.max(8,$.top-4-V):z}px`,O.style.left=`${Math.max(8,Math.min($.right-H,window.innerWidth-8-H))}px`}function L(O){T&&O.matches(":popover-open")&&O.hidePopover(),O.hidden=!0}function D(O){const I=document.getElementById(O.getAttribute("aria-controls")),$=O.getAttribute("aria-expanded")=="true";if(S?.(),$)return;A(I,O),O.setAttribute("aria-expanded","true");const H=[...I.querySelectorAll("[role=menuitem]")];H[0].focus();const V=K=>{S=null,L(I),O.setAttribute("aria-expanded","false"),I.removeEventListener("keydown",z),n.removeEventListener("pointerdown",Z),K&&O.focus()},z=K=>{const se=H.indexOf(document.activeElement),ve={ArrowDown:se+1,ArrowUp:se-1,Home:0,End:H.length-1}[K.key];ve!==void 0?(K.preventDefault(),H[(ve+H.length)%H.length].focus()):K.key=="Tab"&&V(!1)},Z=K=>{const se=K.target;!I.contains(se)&&!O.contains(se)&&V(!1)};I.addEventListener("keydown",z),n.addEventListener("pointerdown",Z),S=()=>V(!0)}function B(O){const I=C(O.id)?.querySelector(".squiffy-saves-title");if(!I)return;const $=document.createElement("input");$.type="text",$.className="squiffy-saves-rename",$.autocomplete="off",$.value=O.name??"",$.placeholder=m(O),$.setAttribute("aria-label",s.newName),I.replaceWith($),$.focus(),$.select();let H=!1;const V=async z=>{if(H)return;H=!0,S=null;const Z=$.value.trim()||null;z&&Z!==O.name&&await r.rename(O.id,Z).catch(()=>w(s.cantSave)),await b(),C(O.id)?.querySelector("[data-action=load]")?.focus()};S=()=>{V(!1)},$.addEventListener("keydown",z=>{z.key=="Enter"&&(z.preventDefault(),V(!0))}),$.addEventListener("blur",()=>V(!0))}function F(){return((t.fileName??document.title).replace(/[\\/:*?"<>|]+/g,"").replace(/\s+/g," ").trim()||"story")+_l}function P(O){const I=URL.createObjectURL(new Blob([JSON.stringify(O)],{type:"application/json"})),$=document.createElement("a");$.href=I,$.download=F(),n.appendChild($),$.click(),$.remove(),setTimeout(()=>URL.revokeObjectURL(I),0)}async function M(O){const I=await e.loadSave(O);if(!I.success){w(s[I.error]);return}p=!0,n.close()}return n.addEventListener("cancel",O=>{S&&(O.preventDefault(),S())}),c.addEventListener("click",()=>n.close()),h.addEventListener("submit",async O=>{O.preventDefault(),y(),S?.();try{await r.add(e.getSave(),d.value),p=!0,d.value=""}catch{w(s.cantSave)}await b(),d.focus()}),a.addEventListener("click",async O=>{const I=O.target.closest("[data-action]"),$=I?.closest("[data-slot]");if(!I||!$)return;const H=v.find(Z=>Z.id===Number($.dataset.slot));if(!H)return;const V=I.dataset.action;if(V=="options"){D(I);return}I.getAttribute("role")=="menuitem"&&S?.(),y();const z=m(H);if(V=="load"){if(g()&&!await x($,s.loadConfirm.replace("[name]",z),s.load)){I.focus();return}const Z=await r.get(H.id).catch(()=>null);Z&&await M(Z.save)}else if(V=="overwrite"){if(!await x($,s.overwriteConfirm.replace("[name]",z),s.overwrite))return;try{await r.overwrite(H.id,e.getSave()),p=!0}catch{w(s.cantSave)}await b(),C(H.id)?.querySelector("[data-action=load]")?.focus()}else if(V=="rename")B(H);else if(V=="download")P(H.save);else if(V=="delete"){if(!await x($,s.deleteConfirm.replace("[name]",z),s.delete,!0))return;await r.delete(H.id).catch(()=>w(s.cantSave)),await b(),d.focus()}}),o("[data-save-to-file]").addEventListener("click",()=>{y(),P(e.getSave()),p=!0}),o("[data-load-from-file]").addEventListener("click",()=>{y(),f.click()}),f.addEventListener("change",async()=>{const O=f.files?.[0];if(f.value="",!O)return;let I;try{I=JSON.parse(await O.text())}catch{w(s.notASave);return}g()&&!await x(l,s.loadConfirm.replace("[name]",O.name),s.load)||await M(I)}),{element:n,async open(){y(),S?.(),d.value="",n.open||n.showModal(),d.focus(),await b()},close(){S?.(),n.close()}}}var wl={settings:"Settings",resetSettings:"Reset to defaults",close:"Close"},Xd='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>',Yd='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>',Zd=0;function kl(e,t={}){const s={...wl};for(const a of Object.keys(wl)){const f=t.strings?.[a];typeof f=="string"&&(s[a]=f)}const r=`squiffy-settings-${++Zd}`,i=document.createElement("dialog");i.className="squiffy-settings",i.setAttribute("aria-labelledby",`${r}-heading`),i.innerHTML=`
|
|
1615
|
+
<div class="squiffy-settings-header">
|
|
1616
|
+
<h2 id="${r}-heading"></h2>
|
|
1617
|
+
<button type="button" class="squiffy-settings-close" data-close>${Yd}</button>
|
|
1618
|
+
</div>
|
|
1619
|
+
<div class="squiffy-settings-list"></div>
|
|
1620
|
+
<div class="squiffy-settings-footer">
|
|
1621
|
+
<button type="button" class="squiffy-settings-reset" data-reset></button>
|
|
1622
|
+
</div>`;const n=a=>i.querySelector(a);n("h2").textContent=s.settings;const o=n("[data-close]");o.title=s.close,o.setAttribute("aria-label",s.close),o.addEventListener("click",()=>i.close());const c=n(".squiffy-settings-list"),u=n("[data-reset]");u.textContent=s.resetSettings,u.addEventListener("click",()=>{e.resetSettings(),h()}),i.addEventListener("click",a=>{a.target===i&&i.close()}),(t.container??document.body).appendChild(i);function h(){c.replaceChildren(...e.getSettings().map((a,f)=>d(a,`${r}-${f}`)))}function d(a,f){const l=document.createElement("div");l.className=`squiffy-setting squiffy-setting-${a.type}`;const p=document.createElement("div");p.className="squiffy-setting-text";const g=document.createElement("label");if(g.htmlFor=f,g.textContent=a.label||a.name,p.appendChild(g),a.description){const w=document.createElement("p");w.id=`${f}-description`,w.textContent=a.description,p.appendChild(w)}l.appendChild(p);const v=e.getSetting(a.name);let S;if(a.type=="toggle"){const w=document.createElement("input");w.type="checkbox",w.setAttribute("role","switch"),w.checked=v===!0,w.addEventListener("change",()=>e.setSetting(a.name,w.checked)),S=w}else if(a.type=="list"){const w=document.createElement("select");for(const y of a.options){const m=document.createElement("option");m.value=y.value,m.textContent=y.label,w.appendChild(m)}w.value=String(v),w.addEventListener("change",()=>e.setSetting(a.name,w.value)),S=w}else{const w=document.createElement("input");w.type="range",w.min=String(a.min),w.max=String(a.max),w.step=a.step?String(a.step):"any",w.value=String(v);const y=document.createElement("output");y.htmlFor.add(f),y.textContent=String(v),w.addEventListener("input",()=>{e.setSetting(a.name,Number(w.value)),y.textContent=String(e.getSetting(a.name))});const m=document.createElement("div");return m.className="squiffy-setting-slider",m.append(w,y),S=w,S.id=f,a.description&&S.setAttribute("aria-describedby",`${f}-description`),l.appendChild(m),l}return S.id=f,a.description&&S.setAttribute("aria-describedby",`${f}-description`),l.appendChild(S),l}return{element:i,open(){h(),i.open||i.showModal(),c.querySelector("input, select")?.focus()},close(){i.close()}}}var Jd=class{constructor(e,t){if(this.getDefinitions=e,this.storageKey=t,this.values={},!!t)try{const s=JSON.parse(localStorage.getItem(t)??"{}");s&&typeof s=="object"&&!Array.isArray(s)&&(this.values=s)}catch{}}definitions(){return this.getDefinitions().filter(e=>e&&typeof e.name=="string")}find(e){return this.definitions().find(t=>t.name==e)}any(){return this.definitions().length>0}get(e){const t=this.find(e);if(!t)return null;const s=Object.prototype.hasOwnProperty.call(this.values,e)?this.values[e]:void 0;return s!==void 0&&Qd(t,s)?s:Kd(t)}all(){return Object.fromEntries(this.definitions().map(e=>[e.name,this.get(e.name)]))}set(e,t){const s=this.find(e);if(!s)return!1;const r=xl(s,t);return r===null||r===this.get(e)?!1:(this.values[e]=r,this.store(),!0)}reset(){this.values={},this.store()}classes(){const e=[];for(const t of this.definitions()){const s=this.get(t.name);t.type=="toggle"?s===!0&&e.push(`setting-${t.name}`):s!==null&&e.push(`setting-${t.name}-${String(s).replace(/[^A-Za-z0-9_-]+/g,"-")}`)}return e}store(){if(this.storageKey)try{Object.keys(this.values).length?localStorage.setItem(this.storageKey,JSON.stringify(this.values)):localStorage.removeItem(this.storageKey)}catch{}}};function Kd(e){switch(e.type){case"toggle":return e.default??!1;case"list":return e.default??e.options[0]?.value??"";case"range":return e.default??e.min}}function Qd(e,t){return xl(e,t)===t}function xl(e,t){switch(e.type){case"toggle":return typeof t=="boolean"?t:t==="true"?!0:t==="false"?!1:null;case"list":{const s=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):null;return s!==null&&e.options.some(r=>r.value===s)?s:null}case"range":{const s=typeof t=="number"?t:typeof t=="string"&&t.trim()?Number(t):NaN;if(!Number.isFinite(s))return null;const r=Math.min(e.max,Math.max(e.min,s));if(!e.step)return r;const i=e.min+Math.round((r-e.min)/e.step)*e.step;return Number(Math.min(e.max,i).toFixed(10))}}}var ef=["bag","person","map","help","info","list","book","star","heart"],tf='<path d="M18 6 6 18M6 6l12 12"/>',sf={bag:'<path d="M4 10a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"/><path d="M8 10h8"/><path d="M8 18h8"/><path d="M8 22v-6a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v6"/><path d="M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"/>',person:'<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',map:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>',help:'<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',info:'<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',list:'<path d="M3 6h.01M3 12h.01M3 18h.01M8 6h13M8 12h13M8 18h13"/>',book:'<path d="M12 7v14"/><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"/>',star:'<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>',heart:'<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/>'},Tl=e=>`<svg viewBox="0 0 24 24" aria-hidden="true">${e}</svg>`,rf=0;function nf(e,t){const s=typeof t.strings?.close=="string"?t.strings.close:"Close",r=`squiffy-panel-${++rf}`,i=[],n=document.createElement("dialog");n.className="squiffy-panel-dialog",n.setAttribute("aria-labelledby",`${r}-heading`),n.innerHTML=`
|
|
1623
|
+
<div class="squiffy-panel-dialog-header">
|
|
1624
|
+
<h2 id="${r}-heading"></h2>
|
|
1625
|
+
<button type="button" class="squiffy-panel-dialog-close">${Tl(tf)}</button>
|
|
1626
|
+
</div>
|
|
1627
|
+
<div class="squiffy-panel squiffy-panel-dialog-content"></div>`;const o=n.querySelector("h2"),c=n.querySelector(".squiffy-panel-dialog-close");c.title=s,c.setAttribute("aria-label",s),c.addEventListener("click",()=>n.close());const u=n.querySelector(".squiffy-panel-dialog-content");n.addEventListener("click",m=>{m.target===n&&n.close()}),(t.container??document.body).appendChild(n),i.push(()=>n.remove());let h=null;const d=t.panels.filter(m=>m&&typeof m.passage=="string"),a=t.side?d.filter(m=>m.position=="side"):[],f=new Map;let l=null;if(a.length&&t.side){l=document.createElement("aside"),l.className="squiffy-panels-side";for(const _ of a){const C=document.createElement("section");C.className="squiffy-panel",C.dataset.passage=_.passage,C.setAttribute("aria-label",_.label||_.passage),l.appendChild(C),f.set(_,C)}const m=t.side;m.appendChild(l),m.classList.add("squiffy-has-side"),i.push(()=>{l.remove(),m.classList.remove("squiffy-has-side")})}const p=t.buttons.firstChild;for(const m of d){const _=m.label||m.passage,C=document.createElement("button");C.type="button",C.className="squiffy-header-button squiffy-panel-button",m.position=="side"&&f.has(m)&&C.classList.add("squiffy-panel-side-button"),C.dataset.passage=m.passage,C.setAttribute("aria-haspopup","dialog");const R=m.icon&&ef.includes(m.icon)?sf[m.icon]:null;R?(C.innerHTML=Tl(R),C.title=_,C.setAttribute("aria-label",_)):(C.classList.add("squiffy-panel-text-button"),C.textContent=_),C.addEventListener("click",()=>g(m)),t.buttons.insertBefore(C,p),i.push(()=>C.remove())}function g(m){h=m,o.textContent=m.label||m.passage,u.innerHTML=e.renderPassage(m.passage),n.open||n.showModal()}function v(){for(const[m,_]of f)_.innerHTML=e.renderPassage(m.passage),_.hidden=!_.textContent?.trim()&&!_.querySelector("img, svg, video, canvas, iframe");l&&(l.hidden=[...f.values()].every(m=>m.hidden)),n.open&&h&&(u.innerHTML=e.renderPassage(h.passage))}let S=!1;const w=()=>{S||(S=!0,queueMicrotask(()=>{S=!1,y||v()}))};for(const m of["set","navigated","storyUpdated"])i.push(e.on(m,w));n.addEventListener("close",()=>{h=null});let y=!1;return v(),{refresh:v,open(m){const _=d.find(C=>C.passage==m);_&&g(_)},dispose(){y=!0,n.open&&n.close();for(const m of i.splice(0))m()}}}var of=async e=>{let t,s,r,i,n,o=0,c=!1,u=[];const h=[],d=new Ju,a=[];let f=!1,l,p=0;const g=100,v=new Gu(()=>r,mf);let S=0;async function w(k){if(f||k.closest(".squiffy-output-section")!==r||k.classList.contains("disabled")||!An(r))return!1;const E=k.getAttribute("data-passage"),N=k.getAttribute("data-section");if(E!==null||N!==null){if(p=0,k instanceof window.HTMLInputElement){const be=k.getAttribute("data-attribute")||k.id;be&&Ne(be,k.value)}Ne("turns",(re("turns")||0)+1)}if(E!==null){let be;return m(E)||(_(k),be=R(k),Ne("_turncount",re("_turncount")+1)),await F(k),E&&(n=null,await ve(E,be)),d.emit("linkClick",{linkType:"passage"}),!0}if(N!==null)return await F(k),N&&await H(N),d.emit("linkClick",{linkType:"section"}),!0;const[q,j,J]=Sr.handleLink(k);return q?(J?.disableLink&&_(k),ie(),d.emit("linkClick",{linkType:j}),!0):!1}async function y(k){const E=k.target;E.classList.contains("squiffy-link")&&await w(E)}function m(k){if(!k)return!1;const E=s?.passages;if(E&&k in E)return!!E[k].repeat;const N=t.sections[""]?.passages;return!!(N&&k in N&&N[k].repeat)}function _(k){if(k instanceof window.HTMLInputElement){k.disabled=!0,k.classList.add("disabled");return}k.classList.add("disabled"),k.setAttribute("tabindex","-1")}function C(k){if(k instanceof window.HTMLInputElement){k.disabled=!1,k.classList.remove("disabled");return}k.classList.remove("disabled"),k.removeAttribute("tabindex")}function R(k){let E=0;for(const q of Ee.querySelectorAll("[data-clicked]"))E=Math.max(E,Number(q.getAttribute("data-clicked"))||0);const N=String(E+1);return k.setAttribute("data-clicked",N),N}async function b(k){if(k&&k.section in t.sections){xe(),await H(k.section),k.passage!==void 0&&re("_section")==k.section&&await ve(k.passage);return}if(!Ie()){await H(t.start);return}const E=re("_passage");d.emit("navigated",E?{section:re("_section"),passage:E}:{section:re("_section")}),await x(),v.sync()}async function x(){const k=i??r,E=k?.getAttribute("data-goto");E&&E in t.sections&&await B({section:E,after:Number(k.getAttribute("data-goto-after")||0)})}function T(){clearTimeout(l),l=void 0,Ae.goto=null,Ae.deactivate.clear()}function A(k){const E=Ae.deactivate;if(E.size==0)return;const N=String((re("_deactivations")||0)+1);Ne("_deactivations",Number(N)),k.setAttribute("data-deactivates",N);for(const q of r.querySelectorAll("a.squiffy-link[data-passage]"))E.has(q.getAttribute("data-passage"))&&!q.classList.contains("disabled")&&(_(q),q.setAttribute("data-deactivated-by",N));E.clear()}function L(k){const E=k.getAttribute("data-deactivates");if(E)for(const N of r.querySelectorAll(`a.squiffy-link[data-deactivated-by="${E}"]`))C(N),N.removeAttribute("data-deactivated-by")}function D(k){const E=Ae.goto;return Ae.goto=null,E&&(k.setAttribute("data-goto",E.section),E.after&&k.setAttribute("data-goto-after",String(E.after))),E}async function B(k){if(k){if(k.after>0){l=setTimeout(()=>{l=void 0,p=0,H(k.section)},k.after);return}if(++p>g){p=0;const E=i??r;E.removeAttribute("data-goto");const N=`stopped after ${g} in a row without the player clicking anything, going to "${k.section}". Is there a loop?`;console.error("Squiffy error in {{goto}}:",N),E.insertAdjacentHTML("beforeend",Wt("Error in {{goto}}:",N)),ie();return}await H(k.section)}}async function F(k){Si.runLinkAnimation(k),await se();const E=k.getAttribute("data-set");if(E){const N=JSON.parse(E);for(const q of N)P(q)}}function P(k){try{t.expressions?I(k):$(k)}catch(E){const N=E instanceof Error?E.message:String(E);console.error(`Squiffy error in "${k}":`,N),h.push(Wt(`Error in "${k}":`,N))}}function M(k,E,N){const q=E+"=",j=Ct(q,N),J=typeof k=="string"?[k]:k;let be=Ct(q,pe.getAt(J));E=="+"&&(be+=j),E=="-"&&(be-=j),E=="*"&&(be*=j),E=="/"&&(be/=j),pe.setAt(J,be)}function O(k){return[k.attribute,...k.segments.map(E=>{if("name"in E)return E.name;const N=Ae.evaluate(E.index);if(typeof N!="string"&&typeof N!="number")throw new Error(`[${E.index.trim()}] should be a number or text, to say which value to set`);const q=String(N);return Pr(q),q})]}function I(k){const E=Ro(k),N=E&&/^\s*:=(.*)$/.exec(E.rest);if(E&&N){pe.setAt(O(E),Xe.processText(N[1],!0));return}const q=E&&/^\s*([+\-*/]?)=(?!=)(.*)$/.exec(E.rest);if(E&&q){const[,be,ot]=q,zt=O(E),Nt=Ae.evaluate(ot);be?M(zt,be,Nt):pe.setAt(zt,Nt);return}const j=/^\s*not\s+/.exec(k),J=Ro(j?k.substring(j[0].length):k);if(!J||J.rest.trim())throw new Error("expected an attribute name, e.g. gold = 10, gold += 5, has_key or not has_key");pe.setAt(O(J),!j)}function $(k){k=k.replace(/^(\w*\s*):=(.*)$/,(N,q,j)=>q+"="+Xe.processText(j,!0));const E=/^([\w]*)\s*=\s*(.*)$/.exec(k);if(E){const N=E[1];let q=E[2];q==="true"?Ne(N,!0):q==="false"?Ne(N,!1):isNaN(q)?(q.startsWith("@")&&(q=re(q.substring(1))),Ne(N,q)):Ne(N,parseFloat(q))}else{const N=/^([\w]*)\s*([+\-*/])=\s*(.*)$/.exec(k);if(N){const q=N[1],j=N[2],J=N[3].trim();M(q,j,J.startsWith("@")?re(J.substring(1)):J)}else{let q=!0;k.startsWith("not ")&&(k=k.substring(4),q=!1),Ne(k,q)}}}async function H(k){S++;try{await V(k)}finally{S--,v.sync()}}async function V(k){T();const E=Tt();if(s=t.sections[k],!s)return;const N=re("_section");N!==null&&(Ne("previous",re("_passage")??N),Ne("previous_section",N)),re("_passage")!==null&&Ne("_passage",null),Ne("_section",k),re("turns")===null&&pe.setInternal("turns",0,!1),pe.setSeen(k);const q=t.sections[""],j=q?.clear||s.clear;u=[s,q],j&&await De(u),Ol([...q?.classes??[],...s.classes??[]]),j&&ue(),Ce(k),ze(r,[s,q]);const J=r;if(q&&(await K(q,"[[]]"),re("_section")!==k)){J.remove();return}if(await K(s,`[[${k}]]`),re("_section")!==k){J.remove();return}br(r),Ne("_turncount",0),A(r);const be=D(r);Hn(),ie();const ot=Tt();ot!=E&&d.emit("canGoBackChanged",{canGoBack:ot}),d.emit("navigated",{section:k}),await B(be)}let z=!1;function Z(k,E=null,N){const q={get:re,set:Ne,ui:{transition:Ml,write:Xe.write,scrollToEnd:Xe.scrollToEnd,afterWrite:j=>{if(!N)throw new Error("squiffy.ui.afterWrite can only be used in a section or passage's JavaScript");N.push(j)}},story:{go:j=>z?(Ae.goto??(Ae.goto={section:j,after:0}),Promise.resolve()):H(j),seen:j=>pe.getSeen(j),visits:j=>pe.getVisits(j),lastVisited:j=>pe.getLastVisited(j),passages:(j,J)=>wi(t,j,re("_section"),J),sections:j=>ki(t,j),tags:j=>j===void 0?[...t.sections[re("_section")]?.tags??[]]:xi(t,j,re("_section"))},element:Ot,import:Ed,...E};t.js[k](q,re,Ne)}async function K(k,E){k.attributes&&await le(k.attributes),k.music!==void 0&&Ne("_music",k.music);for(const J of k.sounds??[])J=="stop"?lt.stopSounds():lt.play(J);const N=[];if(k.jsIndex!==void 0){const J=re("_section");if(Z(k.jsIndex,null,N),re("_section")!==J)return}let q=Xe.renderHtml(k.text||"",!1);const j=Mo(q);j!==null&&(q=j,await he()),Xe.writeHtml(q,E),z=!0;try{for(const J of N)J()}finally{z=!1}await se()}async function se(){f=!0,r.classList.add("links-disabled");for(const k of a)await k();a.length=0,f=!1,r.classList.remove("links-disabled")}async function ve(k,E){S++;try{await ye(k,E)}finally{S--,v.sync()}}async function ye(k,E){T();const N=Tt();let q=s.passages&&s.passages[k];const j=t.sections[""];if(!q&&j&&j.passages&&(q=j.passages[k]),!q)throw`No passage named ${k} in the current section or master section`;Ne("previous",re("_passage")??re("_section")),Ne("_passage",k),pe.setSeen(k);const J=[],be=[];if(j&&j.passages){const pt=j.passages[""];pt&&(J.push(pt),be.push(()=>K(pt,"[[]][]")))}const ot=s.passages&&s.passages[""];ot&&(J.push(ot),be.push(()=>K(ot,`[[${re("_section")}]][]`))),J.push(q),be.push(()=>K(q,`[[${re("_section")}]][${k}]`));const zt=s.passages?.["@after"];zt&&(J.push(zt),be.push(()=>K(zt,`[[${re("_section")}]][@after]`)));const Nt=j?.passages?.["@after"];Nt&&(J.push(Nt),be.push(()=>K(Nt,"[[]][@after]")));const ct="@"+re("_turncount");if(s.passages&&!q.repeat){if(ct in s.passages){const pt=s.passages[ct];J.push(pt),be.push(()=>K(pt,`[[${re("_section")}]][${ct}]`))}if("@last"in s.passages&&re("_turncount")>=(s.passageCount||0)){const pt=s.passages["@last"];J.push(pt),be.push(()=>K(pt,`[[${re("_section")}]][@last]`))}}const Ps=J.some(pt=>pt.clear);u=[q,ot,j?.passages?.[""],s,j],Ps&&await De(u);const gs=J.flatMap(pt=>pt.classes??[]);gs.length&&Ol([...mi(),...gs]),Ps&&(ue(),_e()),i=document.createElement("div"),i.classList.add("squiffy-output-passage"),i.setAttribute("data-passage",`${k}`),E&&i.setAttribute("data-clicked-link",E),r.appendChild(i),ze(i,u);for(const pt of be)await pt();br(r),A(i);const _i=D(i);Hn(),ie();const $l=Tt();$l!=N&&d.emit("canGoBackChanged",{canGoBack:$l}),d.emit("navigated",{section:re("_section"),passage:k}),await B(_i)}async function le(k){for(const E of k)P(E)}function te(){T(),v.stopAll(),pe.reset(),Le=!1,lt.sync(),ps(),Ue.scroll==="element"||Ue.scroll==="none"?(Ee.innerHTML="",b()):location.reload()}function ie(){let k=Ee;k.querySelector(".squiffy-transition")&&(k=Ee.cloneNode(!0),k.querySelectorAll(".squiffy-transition").forEach(vt)),Ne("_output",k.innerHTML)}let Le=!1;function xe(){Le||(Le=!0,t.uiJsIndex!==void 0&&Z(t.uiJsIndex,{registerAnimation:Si.registerAnimation.bind(Si),registerHelper:Ae.handlebars.registerHelper.bind(Ae.handlebars),SafeString:Ae.handlebars.SafeString}))}function Ie(){pe.load(),lt.sync(),ps();const k=re("_output");return k?($e(k),xe(),ss.onLoad(),br(r),!0):(xe(),!1)}function $e(k){Ee.innerHTML=Ws(k),ds(),fs(),n=Ee.querySelector(".squiffy-output-block:last-child"),s=t.sections[re("_section")]}function we(){return{format:"squiffy-save",version:1,storyId:t.projectId??null,section:re("_section"),passage:re("_passage"),summary:Re(),savedAt:new Date().toISOString(),state:Object.fromEntries(Object.entries(structuredClone(pe.store)).filter(([k])=>!pe.isPersistent(k)))}}function Re(){const E=r?.querySelectorAll(".squiffy-output-block")??[];for(const N of E){const q=Te(N);if(!q)continue;const j=[...N.querySelectorAll("h1, h2, h3, h4, h5, h6, p, li")].find(ot=>Te(ot));if(j&&/^H[1-6]$/.test(j.tagName)&&Te(N).startsWith(Te(j)))return Te(j).substring(0,100);if(q.length<=100)return q;const J=q.substring(0,100),be=J.lastIndexOf(" ");return(be>100/2?J.substring(0,be):J)+"…"}return""}function Te(k){const E=k.cloneNode(!0);return E.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, div, br, tr, blockquote").forEach(N=>N.after(" ")),(E.textContent??"").replace(/\s+/g," ").trim()}function Me(k){if(!k||typeof k!="object")return!1;const E=k;return E.format==="squiffy-save"&&E.version===1&&!!E.state&&typeof E.state=="object"&&!Array.isArray(E.state)&&typeof E.state._output=="string"}async function ke(k){if(!Me(k))return{success:!1,error:"notASave"};if(k.storyId&&t.projectId&&k.storyId!==t.projectId)return{success:!1,error:"wrongStory"};for(;f;)await new Promise(N=>setTimeout(N,50));T(),v.stopAll(),h.length=0,pe.reset();for(const[N,q]of Object.entries(k.state))pe.setInternal(N,q,!1);if(lt.sync(),ps(),me={},o=0,c=!1,$e(k.state._output),xe(),!s)return Ee.innerHTML="",await H(t.start),d.emit("canGoBackChanged",{canGoBack:Tt()}),{success:!0};ss.onLoad(),br(r),d.emit("canGoBackChanged",{canGoBack:Tt()});const E=re("_passage");return d.emit("navigated",E?{section:re("_section"),passage:E}:{section:re("_section")}),await x(),v.sync(),{success:!0}}function oe(){n=document.createElement("div"),n.classList.add("squiffy-output-block"),(i||r)?.appendChild(n)}function Ce(k){r&&(r.querySelectorAll("input, textarea, select").forEach(E=>{const N=E,q=N.getAttribute("data-attribute")||N.id;q&&Ne(q,N.value),N.disabled||(N.disabled=!0,N.setAttribute("data-squiffy-disabled",""))}),r.querySelectorAll("[contenteditable]").forEach(E=>{const N=E.getAttribute("data-attribute")||E.id;N&&Ne(N,E.innerHTML),E.getAttribute("contenteditable")!=="false"&&(E.setAttribute("contenteditable","false"),E.setAttribute("data-squiffy-disabled",""))})),i=null,_e(k),oe()}function _e(k){r=document.createElement("div"),r.classList.add("squiffy-output-section"),r.setAttribute("data-section",k??re("_section")),k||r.setAttribute("data-clear","true"),Ee.appendChild(r)}function Oe(){return Ee.querySelector(".squiffy-clear-stack")}function U(k,E){const N=k.getBoundingClientRect(),q=ce(k);if(q){const j=q.getBoundingClientRect(),J=E==="start"?N.top-j.top:N.bottom-j.bottom;q.scrollTo({top:q.scrollTop+J,behavior:"smooth"})}else{const j=E==="start"?N.top:N.bottom-window.innerHeight;window.scrollTo({top:window.scrollY+j,behavior:"smooth"})}}function ce(k){for(let E=k.parentElement;E&&E!==document.body&&E!==document.documentElement;E=E.parentElement){const N=getComputedStyle(E).overflowY;if((N==="auto"||N==="scroll")&&E.scrollHeight>E.clientHeight)return E}return null}function ue(k){let E=Oe();E||(E=document.createElement("div"),E.classList.add("squiffy-clear-stack"),E.style.display="none",Ee.prepend(E));const N=document.createElement("div");E.appendChild(N),c=!0;for(const q of[...Ee.children])q!==E&&q!==k&&N.appendChild(q);N.querySelectorAll(".squiffy-transition").forEach(vt)}async function he(){if(i){await De(u);const k=i.cloneNode(!1);i.remove(),vt(k),ue(),_e(),i=k,r.appendChild(k),ze(k,u)}else{const k=r;await De(u,[...xt().filter(E=>E!==k),...k.children]),k.replaceChildren(),ue(k)}oe()}function ze(k,E){const N=E.find(J=>J?.transition),q=N?.transition;if(!q||q=="none"||q=="instant")return;k.classList.add("squiffy-transition",q),k.setAttribute("data-transition",q),N.transitionTime!==void 0&&k.style.setProperty("--squiffy-transition-time",`${N.transitionTime}ms`);const j=J=>{J.target!==k||k.classList.contains("squiffy-leave")||(k.removeEventListener("animationend",j),k.removeEventListener("animationcancel",j),vt(k))};k.addEventListener("animationend",j),k.addEventListener("animationcancel",j)}async function De(k,E=xt()){const N=k.find(ct=>ct?.leave),q=N?.leave;if(!q||q=="none"||q=="instant")return;const j=E.filter(ct=>ct instanceof HTMLElement);if(!j.length)return;for(const ct of j)vt(ct),ct.classList.add("squiffy-transition","squiffy-leave",q),ct.setAttribute("data-transition",q),N.leaveTime!==void 0&&ct.style.setProperty("--squiffy-transition-time",`${N.leaveTime}ms`);const J=j[0],be=getComputedStyle(J);if(!be.animationName||be.animationName=="none")return;const ot=ct=>Math.max(0,...ct.split(",").map(Ps=>parseFloat(Ps)*(Ps.trim().endsWith("ms")?.001:1)||0)),zt=(ot(be.animationDuration)+ot(be.animationDelay))*1e3+1e3,Nt=f;f=!0;try{await new Promise(ct=>{const Ps=setTimeout(gs,zt);function gs(_i){_i&&_i.target!==J||(clearTimeout(Ps),J.removeEventListener("animationend",gs),J.removeEventListener("animationcancel",gs),ct())}J.addEventListener("animationend",gs),J.addEventListener("animationcancel",gs)})}finally{f=Nt}}function xt(){const k=Oe();return[...Ee.children].filter(E=>E!==k)}function vt(k){const E=k.getAttribute("data-transition");E&&k.classList.remove(E),k.classList.remove("squiffy-transition","squiffy-leave"),k.classList.length||k.removeAttribute("class"),k.removeAttribute("data-transition"),k.style.removeProperty("--squiffy-transition-time"),k.getAttribute("style")||k.removeAttribute("style")}function hs(){const k=Oe();if(!k)return;k.querySelectorAll(".squiffy-transition").forEach(vt);for(const N of[...Ee.children])N!==k&&N.remove();const E=k.children[k.children.length-1];for(const N of[...E.children])Ee.appendChild(N);E.remove()}const Xe={write:(k,E)=>{Xe.writeHtml(Xe.renderHtml(k,!1),E)},writeHtml:(k,E)=>{o=Ee.scrollHeight;const N=h.splice(0).join("")+k.trim();n||oe();const q=document.createElement("div");E&&q.setAttribute("data-source",E),q.innerHTML=N,ss.onWrite(q),n.appendChild(q),br(r),Xe.scrollToEnd()},clearScreen:()=>{ue(),_e()},scrollToEnd:()=>{if(Ue.scroll!=="none")if(c)if(c=!1,Ue.scroll==="element")U(r,"start");else{const k=Math.max(document.body.scrollTop,document.documentElement.scrollTop),E=Ee.getBoundingClientRect().top+k;E<k&&window.scrollTo({top:E,behavior:"smooth"})}else if(Ue.scroll==="element"){const k=Ee.lastElementChild;k&&U(k,"end")}else{let k=o;const E=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(k>E){const N=document.documentElement.scrollHeight-window.innerHeight;k>N&&(k=N),window.scrollTo({top:k,behavior:"smooth"})}}},processText:(k,E)=>Ae.process(k,E),renderHtml:(k,E)=>Ws(Xe.processText(k,E))};function Dn(k){if(k.start!=t.start){t=k,pe.reset(),lt.sync(),ps(),lt.preload(t.audio??[]),Ee.innerHTML="",H(t.start);return}const E=t;t=k,ps(),lt.preload(t.audio??[]),Qu(E,k,Ee,(q,j)=>{const J=s;s=j,gi=!0;try{const be=Xe.renderHtml(q,!1);return Mo(be)??be}finally{s=J,gi=!1}},_,q=>le(q)),ds(),fs(),v.sync(),d.emit("storyUpdated",{})}function qn(k){const E=t.sections[""]?.passages?.[k];if(!E)return Wt("Error in panel:",`there is no passage called "${k}" in the master section [[]]`);const N=Ae.goto,q=[...Ae.deactivate];pe.readOnly=!0;let j;try{j=Xe.renderHtml(E.text||"",!1)}finally{pe.readOnly=!1,Ae.goto=N,Ae.deactivate=new Set(q)}const J=document.createElement("template");return J.innerHTML=j,J.content.querySelectorAll("a.squiffy-link").forEach(_),J.innerHTML}function ds(){const k=Ee.querySelectorAll(".squiffy-output-section:last-child");r=k[k.length-1];const E=r.getAttribute("data-section");s=t.sections[E]}function fs(){i=r.querySelector(".squiffy-output-passage:last-child")}function di(){const k=Oe(),E=Ee.querySelectorAll(".squiffy-output-section").length+Ee.querySelectorAll(".squiffy-output-passage").length;return k?E+k.children.length:E}function yt(k){k.querySelectorAll("[data-squiffy-disabled]").forEach(E=>{E.hasAttribute("contenteditable")?E.setAttribute("contenteditable","true"):E.disabled=!1,E.removeAttribute("data-squiffy-disabled")})}function Tt(){const k=i??r,E=[...Ee.querySelectorAll("[data-goto]")].filter(N=>N!==k).length;return di()-E>1}function fi(){if(f||!Tt())return;T();do Bn();while((i??r).hasAttribute("data-goto")&&di()>1);lt.sync(),ps(),ie(),Tt()||d.emit("canGoBackChanged",{canGoBack:!1});const k=i?.getAttribute("data-passage");d.emit("navigated",k?{section:re("_section"),passage:k}:{section:re("_section")}),v.sync()}function Bn(){const k=Oe();if(i){const E=i.getAttribute("data-passage"),N=i.getAttribute("data-clicked-link");El(i.getAttribute("data-undo")),L(i),i.remove();let q=!1,j=!1;for(const J of Ee.children)if(J!==k){if(J.getAttribute("data-clear")=="true"&&J.children.length==0){q=!0;continue}j=!0;break}if(q&&!j&&(hs(),ds()),N)for(const J of r.querySelectorAll(`a.squiffy-link[data-clicked="${N}"], input[data-clicked="${N}"]`))C(J),J.removeAttribute("data-clicked");else if(E&&!m(E))for(const J of r.querySelectorAll("a.squiffy-link[data-passage]"))J.getAttribute("data-passage")==E&&C(J);fs()}else{El(r.getAttribute("data-undo")),r.remove();let E=!1;for(const N of[...Ee.children])if(N!==k){E=!0;break}E||hs(),ds(),fs(),yt(r)}}const Ot=e.element,Ee=document.createElement("div");Ot.appendChild(Ee),t=e.story;const Ws=Md(e.resolveAssetUrl),Ue={scroll:e.scroll||"body",persist:e.persist===void 0?!0:e.persist,onSet:e.onSet||(()=>{})};let It="";Ue.persist&&(e.storyId!==void 0?It=e.storyId:window.location.protocol==="file:"?It=t.id||"":It=window.location.pathname,It||(console.warn("Persist is set to true in Squiffy runtime options, but no storage key could be determined. Persist will be disabled."),Ue.persist=!1)),Ue.scroll==="element"&&(Ee.style.overflowY="auto"),Ee.addEventListener("click",y),Ee.addEventListener("keypress",async function(k){if(k.key!=="Enter")return;const E=k.target;if(E instanceof window.HTMLInputElement&&(E.hasAttribute("data-section")||E.hasAttribute("data-passage"))){if(k.isComposing)return;if(k.preventDefault(),!An(r)){for(const N of r.querySelectorAll("input:not([disabled]), textarea:not([disabled]), select:not([disabled])"))N.reportValidity();return}await w(E);return}await y(k)});let me={};const nt=function(k,E){k!="_output"&&(k in me||(me[k]=E))},Hn=function(){(i??r).setAttribute("data-undo",JSON.stringify(me)),me={}},pi=function(){const k=i??r,E=JSON.parse(k.getAttribute("data-undo")||"{}");for(const[N,q]of Object.entries(me))N in E||(E[N]=q);k.setAttribute("data-undo",JSON.stringify(E)),me={}};function mf(k){if(f||S>0)return!1;const E=k.tagName=="SPAN",N=decodeURIComponent(k.getAttribute("data-every")||"");let q;Ae.stopEvery=!1;try{q=Xe.renderHtml(N,E),E&&(q=(/^\s/.test(N)?" ":"")+q+(/\s$/.test(N)?" ":""))}catch(Nt){q=Wt("Error in {{#every}}:",Nt instanceof Error?Nt.message:String(Nt)),Ae.stopEvery=!0}const j=document.createElement(E?"span":"div");j.className="squiffy-every-text",j.innerHTML=q,k.hasAttribute("data-every-append")?k.append(j):k.replaceChildren(j),ss.onWrite(j),Xe.scrollToEnd();const J=(Number(k.getAttribute("data-every-count"))||0)+1;k.setAttribute("data-every-count",String(J));const be=Number(k.getAttribute("data-every-times"))||0;(Ae.stopEvery||be&&J>=be)&&k.setAttribute("data-every-stopped",""),Ae.stopEvery=!1;const ot=i??r;A(ot);const zt=D(ot);return pi(),ie(),zt&&(clearTimeout(l),p=0,B(zt)),!0}const El=function(k){if(!k)return;const E=JSON.parse(k);if(E)for(const N of Object.keys(E))pe.setInternal(N,E[N],!1)},pe=new Ku(Ue.persist,It,Ue.onSet,d,nt),re=pe.get.bind(pe),Ne=pe.set.bind(pe);pe.persistentNames=()=>t.persistent??[],pe.initPersistent(Ue.persist?"squiffy-persistent:"+It:void 0,e.persistent);const Mt=new Jd(()=>t.settings??[],Ue.persist?"squiffy-settings:"+It:void 0);pe.playerSettings=()=>Mt.any()?Mt.all():null;const Al=(k,E)=>{ps(),d.emit("settingChanged",{name:k,value:E}),d.emit("set",{attribute:"settings",value:Mt.all()})},Ae=new Zu(()=>t,pe,()=>s),Vt=e.strings??{};typeof Vt.restart=="string"&&(Ae.strings.restart=Vt.restart),typeof Vt.saves=="string"&&(Ae.strings.saves=Vt.saves),typeof Vt.settings=="string"&&(Ae.strings.settings=Vt.settings);let Pl=!1,gi=!1,js=1;const lt=new Nd({resolveUrl:k=>ml(k)||!e.resolveAssetUrl?k:e.resolveAssetUrl(k.replace(/^(\.\/)+/,"")),getMusic:()=>re("_music"),mutedKey:Ue.persist?"squiffy-muted:"+It:void 0,onPlay:()=>{Pl=!0,d.emit("sound",{})}});lt.preload(t.audio??[]),d.on("set",({attribute:k})=>{if(k!="_music")return;const E=js;js=1,lt.sync(E)});const Ll=k=>{const E=Number(k?.hash?.fade);return k?.hash&&"fade"in k.hash&&Number.isFinite(E)&&E>=0?E:1},Fn=k=>typeof k=="object"&&k!==null&&"hash"in k;Ae.handlebars.registerHelper("music",(k,E)=>Fn(k)?re("music"):(pe.readOnly||typeof k!="string"||(js=Ll(E),Ne("_music",k||null),js=1),"")),Ae.handlebars.registerHelper("stopmusic",k=>(pe.readOnly||(js=Ll(k),Ne("_music",null),js=1),"")),Ae.handlebars.registerHelper("sound",(k,E)=>{if(Fn(k))return re("sound");if(pe.readOnly||gi||typeof k!="string"||!k)return"";const N=Number(E?.hash?.volume??1);return lt.play(k,N),""}),Ae.handlebars.registerHelper("stopsounds",()=>(!pe.readOnly&&!gi&<.stopSounds(),""));const Vn="_sectionclasses",ts="_classes";let Rl=[];const Gs=k=>{const E=re(k);return Array.isArray(E)?E.filter(N=>typeof N=="string"&&N.length>0):[]},mi=()=>Gs(Vn),vi=k=>k.filter(E=>!Fn(E)).flatMap(E=>String(E??"").split(/\s+/)).filter(E=>E.length>0);function Ol(k){const E=[...new Set(k)],N=mi();E.length==N.length&&E.every((q,j)=>q==N[j])||Ne(Vn,E)}function Il(k){for(const E of Rl)k.includes(E)||Ot.classList.remove(E);for(const E of k)Ot.classList.add(E);Rl=k}function ps(){Il([...new Set([...mi(),...Gs(ts),...Mt.classes()])])}d.on("set",({attribute:k})=>{(k==Vn||k==ts)&&ps()}),Ae.handlebars.registerHelper("addclass",(...k)=>{if(pe.readOnly)return"";const E=Gs(ts),N=vi(k).filter(q=>!E.includes(q));return N.length&&Ne(ts,[...E,...N]),""}),Ae.handlebars.registerHelper("removeclass",(...k)=>{if(pe.readOnly)return"";const E=vi(k),N=Gs(ts);return N.some(q=>E.includes(q))&&Ne(ts,N.filter(q=>!E.includes(q))),""}),Ae.handlebars.registerHelper("toggleclass",(...k)=>{if(pe.readOnly)return"";let E=Gs(ts);for(const N of new Set(vi(k)))E=E.includes(N)?E.filter(q=>q!=N):[...E,N];return Ne(ts,E),""}),Ae.handlebars.registerHelper("hasclass",(...k)=>{const E=vi(k),N=[...mi(),...Gs(ts)];return E.length>0&&E.every(q=>N.includes(q))});const Sr=new ah;let yi=null;Sr.registerLinkHandler("restart",k=>{const E=k.getAttribute("data-confirm")!=="false";return queueMicrotask(async()=>{if(d.has("restartRequested")){d.emit("restartRequested",{confirm:E});return}E&&!await Dd({message:Vt.restartConfirm??"Are you sure you want to restart?",confirm:Vt.restart??"Restart",cancel:Vt.cancel})||te()}),{}});let bi=null;Sr.registerLinkHandler("settings",()=>(d.has("settingsRequested")?d.emit("settingsRequested",{}):(bi??(bi=kl(zn,{strings:Vt})),bi.open()),{})),Sr.registerLinkHandler("saves",()=>(d.has("savesRequested")?d.emit("savesRequested",{}):(yi??(yi=Gd(zn,{strings:Vt})),yi.open()),{}));const vf=k=>k in t.sections&&t.sections[k].text||null,yf=k=>s.passages&&k in s.passages?s.passages[k].text||null:t.sections[""]?.passages&&k in t.sections[""].passages&&t.sections[""].passages[k].text||null,Ml=k=>{a.push(k)},Si=new Cd,ss=new eh(Ee,Ae,pe,Sr,vf,yf,Xe.renderHtml,Ml,Si,d,Ws);ss.add(sr.ReplaceLabel()),ss.add(sr.RotateSequencePlugin()),ss.add(sr.RandomPlugin()),ss.add(sr.LivePlugin()),ss.add(sr.AnimatePlugin());const zn={begin:b,restart:te,get:re,set:Ne,clickLink:w,update:Dn,goBack:fi,canGoBack:Tt,getSave:we,loadSave:ke,renderPassage:qn,isMuted:()=>lt.isMuted(),setMuted:k=>lt.setMuted(k),usesSound:()=>Pl||!!t.audio?.length,getSettings:()=>structuredClone(Mt.definitions()),getSetting:k=>Mt.get(k),setSetting:(k,E)=>{Mt.set(k,E)&&Al(k,Mt.get(k))},resetSettings:()=>{const k=Mt.all();Mt.reset();for(const[E,N]of Object.entries(Mt.all()))N!==k[E]&&Al(E,N)},getPersistent:()=>pe.getPersistent(),forget:k=>pe.forget(k),dispose:()=>{T(),v.stopAll(),lt.dispose(),Il([]),yi?.element.remove(),bi?.element.remove()},on:(k,E)=>d.on(k,E),off:(k,E)=>d.off(k,E),once:(k,E)=>d.once(k,E)},Un=k=>{if(!Cl.includes(k))throw new Error(`A story's script can't listen for "${k}": it can listen for ${Cl.map(E=>`"${E}"`).join(", ")}`);return k},bf={get:re,set:Ne,story:{go:k=>H(k),seen:k=>pe.getSeen(k),visits:k=>pe.getVisits(k),lastVisited:k=>pe.getLastVisited(k),passages:(k,E)=>wi(t,k,re("_section"),E),sections:k=>ki(t,k),tags:k=>k===void 0?[...t.sections[re("_section")]?.tags??[]]:xi(t,k,re("_section"))},getSetting:k=>Mt.get(k),element:Ot,on:(k,E)=>d.on(Un(k),E),off:(k,E)=>d.off(Un(k),E),once:(k,E)=>d.once(Un(k),E)},Nl=Ot.ownerDocument.defaultView;return Nl&&Ot.dispatchEvent(new Nl.CustomEvent("squiffy:ready",{bubbles:!0,detail:bf})),zn},Cl=["navigated","set","settingChanged"],af={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp",mp3:"audio/mpeg",ogg:"audio/ogg",oga:"audio/ogg",wav:"audio/wav",m4a:"audio/mp4",flac:"audio/flac",mp4:"video/mp4",webm:"video/webm",ogv:"video/ogg",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",pdf:"application/pdf",vtt:"text/vtt"},lf=e=>af[e.substring(e.lastIndexOf(".")+1).toLowerCase()]??"",ui=e=>e.replace(/^(\.\/)+/,""),cf=/url\(\s*(?:"((?:[^"\\\n]|\\.)*)"|'((?:[^'\\\n]|\\.)*)'|([^)"'\s]*))\s*\)/gi,uf=e=>e!=""&&!/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(e);async function hf(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"}));try{return await import(t)}finally{URL.revokeObjectURL(t)}}function Nn(e){return e instanceof Error?{type:"runtimeError",message:e.message,...e.stack?{stack:e.stack}:{}}:{type:"runtimeError",message:String(e)}}function df(e){const t=e.loadModule??hf;let s,r,i="",n,o,c,u,h,d=[],a=!1,f=!1,l=0;const p=new Map,g=[];let v=[],S=[],w=[];const y=document.createElement("style");document.head.appendChild(y);const m=P=>{try{e.send(P)}catch{P.type=="attributeSet"&&e.send({...P,value:String(P.value)})}};function _(){const P=y.textContent,M=I=>(y.textContent=`:root { color-scheme: ${I}; }`,getComputedStyle(document.documentElement).getPropertyValue("color-scheme")),O=M("light")==M("dark");return y.textContent=P,O}const C=P=>p.get(ui(P))??P;function R(P){for(const M of g.splice(0))URL.revokeObjectURL(M);p.clear();for(const[M,O]of Object.entries(P.urls??{}))p.set(ui(M),O);for(const[M,O]of Object.entries(P.files??{})){const I=O instanceof Blob?O:new Blob([O],{type:lf(M)}),$=URL.createObjectURL(I);g.push($),p.set(ui(M),$)}v.forEach((M,O)=>{M.textContent=b(S[O])})}const b=P=>P.replace(cf,(M,O,I,$)=>{const H=(O??I??$??"").trim(),V=uf(H)?p.get(ui(H)):void 0;return V?`url("${V}")`:M});function x(P){if(P.length==S.length&&P.every((I,$)=>S[$]==I))return!1;const M=v[0]??w[0]??null,O=P.map(I=>{const $=document.createElement("style");return $.textContent=b(I),document.head.insertBefore($,M),$});for(const I of v)I.remove();return v=O,S=[...P],!0}async function T(P){for(const M of[...v,...w])M.remove();v=[],S=[],w=[],x(P.css??[]);for(const M of P.scripts??[]){const O=document.createElement("script"),I=URL.createObjectURL(new Blob([M],{type:"text/javascript"}));await new Promise($=>{O.onload=O.onerror=()=>$(),O.src=I,document.head.appendChild(O)}),URL.revokeObjectURL(I),w.push(O)}}function A(P){const M=P?[...P.classList].filter(O=>O!="squiffy-preview-story"):[];for(const O of d)M.includes(O)||e.element.classList.remove(O);for(const O of M)e.element.classList.add(O);d=M}async function L(P){const M=++l;s?.dispose(),s=void 0,h?.disconnect(),h=void 0,A(void 0),e.element.innerHTML="",await T(P.story);const{story:O}=await t(P.story.js);if(M!=l)return;m({type:"themeFixed",fixed:_()}),r?.dispose(),r=void 0,i="",c?.element.remove(),c=void 0,o=void 0,n=document.createElement("div"),n.className="squiffy-preview-header",u=document.createElement("div"),u.className="squiffy-preview-body";const I=document.createElement("div");I.className="squiffy-preview-story",u.appendChild(I),e.element.append(n,u),h=new MutationObserver(()=>A(I)),h.observe(I,{attributes:!0,attributeFilter:["class"]});const $=await of({element:I,story:O,persist:!1,scroll:"element",resolveAssetUrl:C,onSet:(H,V)=>{M==l&&!H.startsWith("_")&&m({type:"attributeSet",name:H,value:V})}});$.on("canGoBackChanged",H=>{M==l&&m({type:"canGoBackChanged",canGoBack:H.canGoBack})}),$.on("navigated",H=>{M==l&&m({type:"navigated",...H})}),$.on("sound",()=>{M==l&&!f&&(f=!0,m({type:"usesSound",usesSound:f}))}),$.setMuted(a),f=$.usesSound(),m({type:"usesSound",usesSound:f}),s=$,D(O.panels),B(O.settings),m({type:"canGoBackChanged",canGoBack:!1}),await $.begin(P.startAt),M==l&&A(I),M==l&&m({type:"loaded"})}function D(P){const M=JSON.stringify(P??[]);!s||!n||M==i||(i=M,r?.dispose(),r=P?.length?nf(s,{panels:P,buttons:n,side:u}):void 0)}function B(P){if(!s||!n)return;if(!P?.length){o?.remove(),o=void 0;return}if(o){n.appendChild(o);return}const M=document.createElement("button");M.type="button",M.className="squiffy-header-button squiffy-settings-button",M.title="Settings",M.setAttribute("aria-label","Settings"),M.setAttribute("aria-haspopup","dialog"),M.innerHTML=Xd,M.addEventListener("click",()=>{s&&(c??(c=kl(s)),c.open())}),n.appendChild(M),o=M}async function F(P){try{switch(P.type){case"load":await L(P);break;case"update":if(!s)break;P.css&&x(P.css)&&m({type:"themeFixed",fixed:_()});{const{story:M}=await t(P.js);s.update(M),D(M.panels),B(M.settings)}break;case"restart":s?.restart();break;case"back":s?.goBack();break;case"assets":R(P.assets);break;case"muted":a=P.muted,s?.setMuted(a);break;case"reload":e.reload?.();break;case"theme":y.textContent=P.theme=="system"?"":`:root { color-scheme: ${P.theme}; }`}}catch(M){m(Nn(M))}}return{receive:F}}var ff="squiffy-preview",pf=e=>typeof e=="object"&&e!==null&&e.channel==="squiffy-preview"&&typeof e.type=="string",$n=typeof acquireVsCodeApi=="function"?acquireVsCodeApi():void 0,hi=e=>{const t={channel:ff,...e};$n?$n.postMessage(t):window.parent.postMessage(t,"*")},gf=df({element:document.getElementById("squiffy"),send:hi,reload:()=>location.reload()});window.addEventListener("message",e=>{!$n&&e.source!==window.parent||pf(e.data)&&gf.receive(e.data)}),window.addEventListener("error",e=>hi(Nn(e.error??e.message))),window.addEventListener("unhandledrejection",e=>hi(Nn(e.reason))),hi({type:"ready"})})();
|
|
295
1628
|
|
|
296
1629
|
</script>
|
|
297
1630
|
</body>
|