@syncify/cli 0.2.1-beta → 0.2.3-beta
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/cjs.js +49 -49
- package/dist/cli.js +3 -3
- package/hot.js.liquid +1 -2236
- package/package.json +3 -1
- package/pnpm-lock.yaml +14 -0
- package/readme.md +13 -43
- package/types/cli.d.ts +18 -4
- package/types/internal/index.d.ts +4 -0
package/hot.js.liquid
CHANGED
@@ -1,2238 +1,3 @@
|
|
1
1
|
<script>
|
2
|
-
"use strict";
|
3
|
-
(() => {
|
4
|
-
var __create = Object.create;
|
5
|
-
var __defProp = Object.defineProperty;
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
10
|
-
var __commonJS = (cb, mod) => function __require() {
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
12
|
-
};
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
15
|
-
for (let key of __getOwnPropNames(from))
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
18
|
-
}
|
19
|
-
return to;
|
20
|
-
};
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
27
|
-
mod
|
28
|
-
));
|
29
|
-
|
30
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/vnode.js
|
31
|
-
var require_vnode = __commonJS({
|
32
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/vnode.js"(exports, module) {
|
33
|
-
"use strict";
|
34
|
-
function Vnode(tag, key, attrs, children, text, dom) {
|
35
|
-
return { tag, key, attrs, children, text, dom, domSize: void 0, state: void 0, events: void 0, instance: void 0 };
|
36
|
-
}
|
37
|
-
Vnode.normalize = function(node) {
|
38
|
-
if (Array.isArray(node))
|
39
|
-
return Vnode("[", void 0, void 0, Vnode.normalizeChildren(node), void 0, void 0);
|
40
|
-
if (node == null || typeof node === "boolean")
|
41
|
-
return null;
|
42
|
-
if (typeof node === "object")
|
43
|
-
return node;
|
44
|
-
return Vnode("#", void 0, void 0, String(node), void 0, void 0);
|
45
|
-
};
|
46
|
-
Vnode.normalizeChildren = function(input) {
|
47
|
-
var children = [];
|
48
|
-
if (input.length) {
|
49
|
-
var isKeyed = input[0] != null && input[0].key != null;
|
50
|
-
for (var i = 1; i < input.length; i++) {
|
51
|
-
if ((input[i] != null && input[i].key != null) !== isKeyed) {
|
52
|
-
throw new TypeError(
|
53
|
-
isKeyed && (input[i] != null || typeof input[i] === "boolean") ? "In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole." : "In fragments, vnodes must either all have keys or none have keys."
|
54
|
-
);
|
55
|
-
}
|
56
|
-
}
|
57
|
-
for (var i = 0; i < input.length; i++) {
|
58
|
-
children[i] = Vnode.normalize(input[i]);
|
59
|
-
}
|
60
|
-
}
|
61
|
-
return children;
|
62
|
-
};
|
63
|
-
module.exports = Vnode;
|
64
|
-
}
|
65
|
-
});
|
66
|
-
|
67
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/hyperscriptVnode.js
|
68
|
-
var require_hyperscriptVnode = __commonJS({
|
69
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/hyperscriptVnode.js"(exports, module) {
|
70
|
-
"use strict";
|
71
|
-
var Vnode = require_vnode();
|
72
|
-
module.exports = function() {
|
73
|
-
var attrs = arguments[this], start = this + 1, children;
|
74
|
-
if (attrs == null) {
|
75
|
-
attrs = {};
|
76
|
-
} else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) {
|
77
|
-
attrs = {};
|
78
|
-
start = this;
|
79
|
-
}
|
80
|
-
if (arguments.length === start + 1) {
|
81
|
-
children = arguments[start];
|
82
|
-
if (!Array.isArray(children))
|
83
|
-
children = [children];
|
84
|
-
} else {
|
85
|
-
children = [];
|
86
|
-
while (start < arguments.length)
|
87
|
-
children.push(arguments[start++]);
|
88
|
-
}
|
89
|
-
return Vnode("", attrs.key, attrs, children);
|
90
|
-
};
|
91
|
-
}
|
92
|
-
});
|
93
|
-
|
94
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/util/hasOwn.js
|
95
|
-
var require_hasOwn = __commonJS({
|
96
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/util/hasOwn.js"(exports, module) {
|
97
|
-
"use strict";
|
98
|
-
module.exports = {}.hasOwnProperty;
|
99
|
-
}
|
100
|
-
});
|
101
|
-
|
102
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/hyperscript.js
|
103
|
-
var require_hyperscript = __commonJS({
|
104
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/hyperscript.js"(exports, module) {
|
105
|
-
"use strict";
|
106
|
-
var Vnode = require_vnode();
|
107
|
-
var hyperscriptVnode = require_hyperscriptVnode();
|
108
|
-
var hasOwn = require_hasOwn();
|
109
|
-
var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g;
|
110
|
-
var selectorCache = {};
|
111
|
-
function isEmpty(object) {
|
112
|
-
for (var key in object)
|
113
|
-
if (hasOwn.call(object, key))
|
114
|
-
return false;
|
115
|
-
return true;
|
116
|
-
}
|
117
|
-
function compileSelector(selector) {
|
118
|
-
var match, tag = "div", classes = [], attrs = {};
|
119
|
-
while (match = selectorParser.exec(selector)) {
|
120
|
-
var type = match[1], value = match[2];
|
121
|
-
if (type === "" && value !== "")
|
122
|
-
tag = value;
|
123
|
-
else if (type === "#")
|
124
|
-
attrs.id = value;
|
125
|
-
else if (type === ".")
|
126
|
-
classes.push(value);
|
127
|
-
else if (match[3][0] === "[") {
|
128
|
-
var attrValue = match[6];
|
129
|
-
if (attrValue)
|
130
|
-
attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\");
|
131
|
-
if (match[4] === "class")
|
132
|
-
classes.push(attrValue);
|
133
|
-
else
|
134
|
-
attrs[match[4]] = attrValue === "" ? attrValue : attrValue || true;
|
135
|
-
}
|
136
|
-
}
|
137
|
-
if (classes.length > 0)
|
138
|
-
attrs.className = classes.join(" ");
|
139
|
-
return selectorCache[selector] = { tag, attrs };
|
140
|
-
}
|
141
|
-
function execSelector(state, vnode) {
|
142
|
-
var attrs = vnode.attrs;
|
143
|
-
var hasClass = hasOwn.call(attrs, "class");
|
144
|
-
var className = hasClass ? attrs.class : attrs.className;
|
145
|
-
vnode.tag = state.tag;
|
146
|
-
vnode.attrs = {};
|
147
|
-
if (!isEmpty(state.attrs) && !isEmpty(attrs)) {
|
148
|
-
var newAttrs = {};
|
149
|
-
for (var key in attrs) {
|
150
|
-
if (hasOwn.call(attrs, key))
|
151
|
-
newAttrs[key] = attrs[key];
|
152
|
-
}
|
153
|
-
attrs = newAttrs;
|
154
|
-
}
|
155
|
-
for (var key in state.attrs) {
|
156
|
-
if (hasOwn.call(state.attrs, key) && key !== "className" && !hasOwn.call(attrs, key)) {
|
157
|
-
attrs[key] = state.attrs[key];
|
158
|
-
}
|
159
|
-
}
|
160
|
-
if (className != null || state.attrs.className != null)
|
161
|
-
attrs.className = className != null ? state.attrs.className != null ? String(state.attrs.className) + " " + String(className) : className : state.attrs.className != null ? state.attrs.className : null;
|
162
|
-
if (hasClass)
|
163
|
-
attrs.class = null;
|
164
|
-
for (var key in attrs) {
|
165
|
-
if (hasOwn.call(attrs, key) && key !== "key") {
|
166
|
-
vnode.attrs = attrs;
|
167
|
-
break;
|
168
|
-
}
|
169
|
-
}
|
170
|
-
return vnode;
|
171
|
-
}
|
172
|
-
function hyperscript(selector) {
|
173
|
-
if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") {
|
174
|
-
throw Error("The selector must be either a string or a component.");
|
175
|
-
}
|
176
|
-
var vnode = hyperscriptVnode.apply(1, arguments);
|
177
|
-
if (typeof selector === "string") {
|
178
|
-
vnode.children = Vnode.normalizeChildren(vnode.children);
|
179
|
-
if (selector !== "[")
|
180
|
-
return execSelector(selectorCache[selector] || compileSelector(selector), vnode);
|
181
|
-
}
|
182
|
-
vnode.tag = selector;
|
183
|
-
return vnode;
|
184
|
-
}
|
185
|
-
module.exports = hyperscript;
|
186
|
-
}
|
187
|
-
});
|
188
|
-
|
189
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/trust.js
|
190
|
-
var require_trust = __commonJS({
|
191
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/trust.js"(exports, module) {
|
192
|
-
"use strict";
|
193
|
-
var Vnode = require_vnode();
|
194
|
-
module.exports = function(html) {
|
195
|
-
if (html == null)
|
196
|
-
html = "";
|
197
|
-
return Vnode("<", void 0, void 0, html, void 0, void 0);
|
198
|
-
};
|
199
|
-
}
|
200
|
-
});
|
201
|
-
|
202
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/fragment.js
|
203
|
-
var require_fragment = __commonJS({
|
204
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/fragment.js"(exports, module) {
|
205
|
-
"use strict";
|
206
|
-
var Vnode = require_vnode();
|
207
|
-
var hyperscriptVnode = require_hyperscriptVnode();
|
208
|
-
module.exports = function() {
|
209
|
-
var vnode = hyperscriptVnode.apply(0, arguments);
|
210
|
-
vnode.tag = "[";
|
211
|
-
vnode.children = Vnode.normalizeChildren(vnode.children);
|
212
|
-
return vnode;
|
213
|
-
};
|
214
|
-
}
|
215
|
-
});
|
216
|
-
|
217
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/hyperscript.js
|
218
|
-
var require_hyperscript2 = __commonJS({
|
219
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/hyperscript.js"(exports, module) {
|
220
|
-
"use strict";
|
221
|
-
var hyperscript = require_hyperscript();
|
222
|
-
hyperscript.trust = require_trust();
|
223
|
-
hyperscript.fragment = require_fragment();
|
224
|
-
module.exports = hyperscript;
|
225
|
-
}
|
226
|
-
});
|
227
|
-
|
228
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/promise/polyfill.js
|
229
|
-
var require_polyfill = __commonJS({
|
230
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/promise/polyfill.js"(exports, module) {
|
231
|
-
"use strict";
|
232
|
-
var PromisePolyfill = function(executor) {
|
233
|
-
if (!(this instanceof PromisePolyfill))
|
234
|
-
throw new Error("Promise must be called with 'new'.");
|
235
|
-
if (typeof executor !== "function")
|
236
|
-
throw new TypeError("executor must be a function.");
|
237
|
-
var self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false);
|
238
|
-
var instance = self._instance = { resolvers, rejectors };
|
239
|
-
var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout;
|
240
|
-
function handler(list, shouldAbsorb) {
|
241
|
-
return function execute(value) {
|
242
|
-
var then;
|
243
|
-
try {
|
244
|
-
if (shouldAbsorb && value != null && (typeof value === "object" || typeof value === "function") && typeof (then = value.then) === "function") {
|
245
|
-
if (value === self)
|
246
|
-
throw new TypeError("Promise can't be resolved with itself.");
|
247
|
-
executeOnce(then.bind(value));
|
248
|
-
} else {
|
249
|
-
callAsync(function() {
|
250
|
-
if (!shouldAbsorb && list.length === 0)
|
251
|
-
console.error("Possible unhandled promise rejection:", value);
|
252
|
-
for (var i = 0; i < list.length; i++)
|
253
|
-
list[i](value);
|
254
|
-
resolvers.length = 0, rejectors.length = 0;
|
255
|
-
instance.state = shouldAbsorb;
|
256
|
-
instance.retry = function() {
|
257
|
-
execute(value);
|
258
|
-
};
|
259
|
-
});
|
260
|
-
}
|
261
|
-
} catch (e) {
|
262
|
-
rejectCurrent(e);
|
263
|
-
}
|
264
|
-
};
|
265
|
-
}
|
266
|
-
function executeOnce(then) {
|
267
|
-
var runs = 0;
|
268
|
-
function run(fn) {
|
269
|
-
return function(value) {
|
270
|
-
if (runs++ > 0)
|
271
|
-
return;
|
272
|
-
fn(value);
|
273
|
-
};
|
274
|
-
}
|
275
|
-
var onerror = run(rejectCurrent);
|
276
|
-
try {
|
277
|
-
then(run(resolveCurrent), onerror);
|
278
|
-
} catch (e) {
|
279
|
-
onerror(e);
|
280
|
-
}
|
281
|
-
}
|
282
|
-
executeOnce(executor);
|
283
|
-
};
|
284
|
-
PromisePolyfill.prototype.then = function(onFulfilled, onRejection) {
|
285
|
-
var self = this, instance = self._instance;
|
286
|
-
function handle(callback, list, next, state) {
|
287
|
-
list.push(function(value) {
|
288
|
-
if (typeof callback !== "function")
|
289
|
-
next(value);
|
290
|
-
else
|
291
|
-
try {
|
292
|
-
resolveNext(callback(value));
|
293
|
-
} catch (e) {
|
294
|
-
if (rejectNext)
|
295
|
-
rejectNext(e);
|
296
|
-
}
|
297
|
-
});
|
298
|
-
if (typeof instance.retry === "function" && state === instance.state)
|
299
|
-
instance.retry();
|
300
|
-
}
|
301
|
-
var resolveNext, rejectNext;
|
302
|
-
var promise = new PromisePolyfill(function(resolve, reject) {
|
303
|
-
resolveNext = resolve, rejectNext = reject;
|
304
|
-
});
|
305
|
-
handle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false);
|
306
|
-
return promise;
|
307
|
-
};
|
308
|
-
PromisePolyfill.prototype.catch = function(onRejection) {
|
309
|
-
return this.then(null, onRejection);
|
310
|
-
};
|
311
|
-
PromisePolyfill.prototype.finally = function(callback) {
|
312
|
-
return this.then(
|
313
|
-
function(value) {
|
314
|
-
return PromisePolyfill.resolve(callback()).then(function() {
|
315
|
-
return value;
|
316
|
-
});
|
317
|
-
},
|
318
|
-
function(reason) {
|
319
|
-
return PromisePolyfill.resolve(callback()).then(function() {
|
320
|
-
return PromisePolyfill.reject(reason);
|
321
|
-
});
|
322
|
-
}
|
323
|
-
);
|
324
|
-
};
|
325
|
-
PromisePolyfill.resolve = function(value) {
|
326
|
-
if (value instanceof PromisePolyfill)
|
327
|
-
return value;
|
328
|
-
return new PromisePolyfill(function(resolve) {
|
329
|
-
resolve(value);
|
330
|
-
});
|
331
|
-
};
|
332
|
-
PromisePolyfill.reject = function(value) {
|
333
|
-
return new PromisePolyfill(function(resolve, reject) {
|
334
|
-
reject(value);
|
335
|
-
});
|
336
|
-
};
|
337
|
-
PromisePolyfill.all = function(list) {
|
338
|
-
return new PromisePolyfill(function(resolve, reject) {
|
339
|
-
var total = list.length, count = 0, values = [];
|
340
|
-
if (list.length === 0)
|
341
|
-
resolve([]);
|
342
|
-
else
|
343
|
-
for (var i = 0; i < list.length; i++) {
|
344
|
-
(function(i2) {
|
345
|
-
function consume(value) {
|
346
|
-
count++;
|
347
|
-
values[i2] = value;
|
348
|
-
if (count === total)
|
349
|
-
resolve(values);
|
350
|
-
}
|
351
|
-
if (list[i2] != null && (typeof list[i2] === "object" || typeof list[i2] === "function") && typeof list[i2].then === "function") {
|
352
|
-
list[i2].then(consume, reject);
|
353
|
-
} else
|
354
|
-
consume(list[i2]);
|
355
|
-
})(i);
|
356
|
-
}
|
357
|
-
});
|
358
|
-
};
|
359
|
-
PromisePolyfill.race = function(list) {
|
360
|
-
return new PromisePolyfill(function(resolve, reject) {
|
361
|
-
for (var i = 0; i < list.length; i++) {
|
362
|
-
list[i].then(resolve, reject);
|
363
|
-
}
|
364
|
-
});
|
365
|
-
};
|
366
|
-
module.exports = PromisePolyfill;
|
367
|
-
}
|
368
|
-
});
|
369
|
-
|
370
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/promise/promise.js
|
371
|
-
var require_promise = __commonJS({
|
372
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/promise/promise.js"(exports, module) {
|
373
|
-
"use strict";
|
374
|
-
var PromisePolyfill = require_polyfill();
|
375
|
-
if (typeof window !== "undefined") {
|
376
|
-
if (typeof window.Promise === "undefined") {
|
377
|
-
window.Promise = PromisePolyfill;
|
378
|
-
} else if (!window.Promise.prototype.finally) {
|
379
|
-
window.Promise.prototype.finally = PromisePolyfill.prototype.finally;
|
380
|
-
}
|
381
|
-
module.exports = window.Promise;
|
382
|
-
} else if (typeof global !== "undefined") {
|
383
|
-
if (typeof global.Promise === "undefined") {
|
384
|
-
global.Promise = PromisePolyfill;
|
385
|
-
} else if (!global.Promise.prototype.finally) {
|
386
|
-
global.Promise.prototype.finally = PromisePolyfill.prototype.finally;
|
387
|
-
}
|
388
|
-
module.exports = global.Promise;
|
389
|
-
} else {
|
390
|
-
module.exports = PromisePolyfill;
|
391
|
-
}
|
392
|
-
}
|
393
|
-
});
|
394
|
-
|
395
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/render.js
|
396
|
-
var require_render = __commonJS({
|
397
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render/render.js"(exports, module) {
|
398
|
-
"use strict";
|
399
|
-
var Vnode = require_vnode();
|
400
|
-
module.exports = function($window) {
|
401
|
-
var $doc = $window && $window.document;
|
402
|
-
var currentRedraw;
|
403
|
-
var nameSpace = {
|
404
|
-
svg: "http://www.w3.org/2000/svg",
|
405
|
-
math: "http://www.w3.org/1998/Math/MathML"
|
406
|
-
};
|
407
|
-
function getNameSpace(vnode) {
|
408
|
-
return vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag];
|
409
|
-
}
|
410
|
-
function checkState(vnode, original) {
|
411
|
-
if (vnode.state !== original)
|
412
|
-
throw new Error("'vnode.state' must not be modified.");
|
413
|
-
}
|
414
|
-
function callHook(vnode) {
|
415
|
-
var original = vnode.state;
|
416
|
-
try {
|
417
|
-
return this.apply(original, arguments);
|
418
|
-
} finally {
|
419
|
-
checkState(vnode, original);
|
420
|
-
}
|
421
|
-
}
|
422
|
-
function activeElement() {
|
423
|
-
try {
|
424
|
-
return $doc.activeElement;
|
425
|
-
} catch (e) {
|
426
|
-
return null;
|
427
|
-
}
|
428
|
-
}
|
429
|
-
function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {
|
430
|
-
for (var i = start; i < end; i++) {
|
431
|
-
var vnode = vnodes[i];
|
432
|
-
if (vnode != null) {
|
433
|
-
createNode(parent, vnode, hooks, ns, nextSibling);
|
434
|
-
}
|
435
|
-
}
|
436
|
-
}
|
437
|
-
function createNode(parent, vnode, hooks, ns, nextSibling) {
|
438
|
-
var tag = vnode.tag;
|
439
|
-
if (typeof tag === "string") {
|
440
|
-
vnode.state = {};
|
441
|
-
if (vnode.attrs != null)
|
442
|
-
initLifecycle(vnode.attrs, vnode, hooks);
|
443
|
-
switch (tag) {
|
444
|
-
case "#":
|
445
|
-
createText(parent, vnode, nextSibling);
|
446
|
-
break;
|
447
|
-
case "<":
|
448
|
-
createHTML(parent, vnode, ns, nextSibling);
|
449
|
-
break;
|
450
|
-
case "[":
|
451
|
-
createFragment(parent, vnode, hooks, ns, nextSibling);
|
452
|
-
break;
|
453
|
-
default:
|
454
|
-
createElement(parent, vnode, hooks, ns, nextSibling);
|
455
|
-
}
|
456
|
-
} else
|
457
|
-
createComponent(parent, vnode, hooks, ns, nextSibling);
|
458
|
-
}
|
459
|
-
function createText(parent, vnode, nextSibling) {
|
460
|
-
vnode.dom = $doc.createTextNode(vnode.children);
|
461
|
-
insertNode(parent, vnode.dom, nextSibling);
|
462
|
-
}
|
463
|
-
var possibleParents = { caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup" };
|
464
|
-
function createHTML(parent, vnode, ns, nextSibling) {
|
465
|
-
var match = vnode.children.match(/^\s*?<(\w+)/im) || [];
|
466
|
-
var temp = $doc.createElement(possibleParents[match[1]] || "div");
|
467
|
-
if (ns === "http://www.w3.org/2000/svg") {
|
468
|
-
temp.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg">' + vnode.children + "</svg>";
|
469
|
-
temp = temp.firstChild;
|
470
|
-
} else {
|
471
|
-
temp.innerHTML = vnode.children;
|
472
|
-
}
|
473
|
-
vnode.dom = temp.firstChild;
|
474
|
-
vnode.domSize = temp.childNodes.length;
|
475
|
-
vnode.instance = [];
|
476
|
-
var fragment = $doc.createDocumentFragment();
|
477
|
-
var child;
|
478
|
-
while (child = temp.firstChild) {
|
479
|
-
vnode.instance.push(child);
|
480
|
-
fragment.appendChild(child);
|
481
|
-
}
|
482
|
-
insertNode(parent, fragment, nextSibling);
|
483
|
-
}
|
484
|
-
function createFragment(parent, vnode, hooks, ns, nextSibling) {
|
485
|
-
var fragment = $doc.createDocumentFragment();
|
486
|
-
if (vnode.children != null) {
|
487
|
-
var children = vnode.children;
|
488
|
-
createNodes(fragment, children, 0, children.length, hooks, null, ns);
|
489
|
-
}
|
490
|
-
vnode.dom = fragment.firstChild;
|
491
|
-
vnode.domSize = fragment.childNodes.length;
|
492
|
-
insertNode(parent, fragment, nextSibling);
|
493
|
-
}
|
494
|
-
function createElement(parent, vnode, hooks, ns, nextSibling) {
|
495
|
-
var tag = vnode.tag;
|
496
|
-
var attrs = vnode.attrs;
|
497
|
-
var is = attrs && attrs.is;
|
498
|
-
ns = getNameSpace(vnode) || ns;
|
499
|
-
var element = ns ? is ? $doc.createElementNS(ns, tag, { is }) : $doc.createElementNS(ns, tag) : is ? $doc.createElement(tag, { is }) : $doc.createElement(tag);
|
500
|
-
vnode.dom = element;
|
501
|
-
if (attrs != null) {
|
502
|
-
setAttrs(vnode, attrs, ns);
|
503
|
-
}
|
504
|
-
insertNode(parent, element, nextSibling);
|
505
|
-
if (!maybeSetContentEditable(vnode)) {
|
506
|
-
if (vnode.children != null) {
|
507
|
-
var children = vnode.children;
|
508
|
-
createNodes(element, children, 0, children.length, hooks, null, ns);
|
509
|
-
if (vnode.tag === "select" && attrs != null)
|
510
|
-
setLateSelectAttrs(vnode, attrs);
|
511
|
-
}
|
512
|
-
}
|
513
|
-
}
|
514
|
-
function initComponent(vnode, hooks) {
|
515
|
-
var sentinel;
|
516
|
-
if (typeof vnode.tag.view === "function") {
|
517
|
-
vnode.state = Object.create(vnode.tag);
|
518
|
-
sentinel = vnode.state.view;
|
519
|
-
if (sentinel.$$reentrantLock$$ != null)
|
520
|
-
return;
|
521
|
-
sentinel.$$reentrantLock$$ = true;
|
522
|
-
} else {
|
523
|
-
vnode.state = void 0;
|
524
|
-
sentinel = vnode.tag;
|
525
|
-
if (sentinel.$$reentrantLock$$ != null)
|
526
|
-
return;
|
527
|
-
sentinel.$$reentrantLock$$ = true;
|
528
|
-
vnode.state = vnode.tag.prototype != null && typeof vnode.tag.prototype.view === "function" ? new vnode.tag(vnode) : vnode.tag(vnode);
|
529
|
-
}
|
530
|
-
initLifecycle(vnode.state, vnode, hooks);
|
531
|
-
if (vnode.attrs != null)
|
532
|
-
initLifecycle(vnode.attrs, vnode, hooks);
|
533
|
-
vnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode));
|
534
|
-
if (vnode.instance === vnode)
|
535
|
-
throw Error("A view cannot return the vnode it received as argument");
|
536
|
-
sentinel.$$reentrantLock$$ = null;
|
537
|
-
}
|
538
|
-
function createComponent(parent, vnode, hooks, ns, nextSibling) {
|
539
|
-
initComponent(vnode, hooks);
|
540
|
-
if (vnode.instance != null) {
|
541
|
-
createNode(parent, vnode.instance, hooks, ns, nextSibling);
|
542
|
-
vnode.dom = vnode.instance.dom;
|
543
|
-
vnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0;
|
544
|
-
} else {
|
545
|
-
vnode.domSize = 0;
|
546
|
-
}
|
547
|
-
}
|
548
|
-
function updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {
|
549
|
-
if (old === vnodes || old == null && vnodes == null)
|
550
|
-
return;
|
551
|
-
else if (old == null || old.length === 0)
|
552
|
-
createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns);
|
553
|
-
else if (vnodes == null || vnodes.length === 0)
|
554
|
-
removeNodes(parent, old, 0, old.length);
|
555
|
-
else {
|
556
|
-
var isOldKeyed = old[0] != null && old[0].key != null;
|
557
|
-
var isKeyed = vnodes[0] != null && vnodes[0].key != null;
|
558
|
-
var start = 0, oldStart = 0;
|
559
|
-
if (!isOldKeyed)
|
560
|
-
while (oldStart < old.length && old[oldStart] == null)
|
561
|
-
oldStart++;
|
562
|
-
if (!isKeyed)
|
563
|
-
while (start < vnodes.length && vnodes[start] == null)
|
564
|
-
start++;
|
565
|
-
if (isOldKeyed !== isKeyed) {
|
566
|
-
removeNodes(parent, old, oldStart, old.length);
|
567
|
-
createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns);
|
568
|
-
} else if (!isKeyed) {
|
569
|
-
var commonLength = old.length < vnodes.length ? old.length : vnodes.length;
|
570
|
-
start = start < oldStart ? start : oldStart;
|
571
|
-
for (; start < commonLength; start++) {
|
572
|
-
o = old[start];
|
573
|
-
v = vnodes[start];
|
574
|
-
if (o === v || o == null && v == null)
|
575
|
-
continue;
|
576
|
-
else if (o == null)
|
577
|
-
createNode(parent, v, hooks, ns, getNextSibling(old, start + 1, nextSibling));
|
578
|
-
else if (v == null)
|
579
|
-
removeNode(parent, o);
|
580
|
-
else
|
581
|
-
updateNode(parent, o, v, hooks, getNextSibling(old, start + 1, nextSibling), ns);
|
582
|
-
}
|
583
|
-
if (old.length > commonLength)
|
584
|
-
removeNodes(parent, old, start, old.length);
|
585
|
-
if (vnodes.length > commonLength)
|
586
|
-
createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns);
|
587
|
-
} else {
|
588
|
-
var oldEnd = old.length - 1, end = vnodes.length - 1, map, o, v, oe, ve, topSibling;
|
589
|
-
while (oldEnd >= oldStart && end >= start) {
|
590
|
-
oe = old[oldEnd];
|
591
|
-
ve = vnodes[end];
|
592
|
-
if (oe.key !== ve.key)
|
593
|
-
break;
|
594
|
-
if (oe !== ve)
|
595
|
-
updateNode(parent, oe, ve, hooks, nextSibling, ns);
|
596
|
-
if (ve.dom != null)
|
597
|
-
nextSibling = ve.dom;
|
598
|
-
oldEnd--, end--;
|
599
|
-
}
|
600
|
-
while (oldEnd >= oldStart && end >= start) {
|
601
|
-
o = old[oldStart];
|
602
|
-
v = vnodes[start];
|
603
|
-
if (o.key !== v.key)
|
604
|
-
break;
|
605
|
-
oldStart++, start++;
|
606
|
-
if (o !== v)
|
607
|
-
updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns);
|
608
|
-
}
|
609
|
-
while (oldEnd >= oldStart && end >= start) {
|
610
|
-
if (start === end)
|
611
|
-
break;
|
612
|
-
if (o.key !== ve.key || oe.key !== v.key)
|
613
|
-
break;
|
614
|
-
topSibling = getNextSibling(old, oldStart, nextSibling);
|
615
|
-
moveNodes(parent, oe, topSibling);
|
616
|
-
if (oe !== v)
|
617
|
-
updateNode(parent, oe, v, hooks, topSibling, ns);
|
618
|
-
if (++start <= --end)
|
619
|
-
moveNodes(parent, o, nextSibling);
|
620
|
-
if (o !== ve)
|
621
|
-
updateNode(parent, o, ve, hooks, nextSibling, ns);
|
622
|
-
if (ve.dom != null)
|
623
|
-
nextSibling = ve.dom;
|
624
|
-
oldStart++;
|
625
|
-
oldEnd--;
|
626
|
-
oe = old[oldEnd];
|
627
|
-
ve = vnodes[end];
|
628
|
-
o = old[oldStart];
|
629
|
-
v = vnodes[start];
|
630
|
-
}
|
631
|
-
while (oldEnd >= oldStart && end >= start) {
|
632
|
-
if (oe.key !== ve.key)
|
633
|
-
break;
|
634
|
-
if (oe !== ve)
|
635
|
-
updateNode(parent, oe, ve, hooks, nextSibling, ns);
|
636
|
-
if (ve.dom != null)
|
637
|
-
nextSibling = ve.dom;
|
638
|
-
oldEnd--, end--;
|
639
|
-
oe = old[oldEnd];
|
640
|
-
ve = vnodes[end];
|
641
|
-
}
|
642
|
-
if (start > end)
|
643
|
-
removeNodes(parent, old, oldStart, oldEnd + 1);
|
644
|
-
else if (oldStart > oldEnd)
|
645
|
-
createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns);
|
646
|
-
else {
|
647
|
-
var originalNextSibling = nextSibling, vnodesLength = end - start + 1, oldIndices = new Array(vnodesLength), li = 0, i = 0, pos = 2147483647, matched = 0, map, lisIndices;
|
648
|
-
for (i = 0; i < vnodesLength; i++)
|
649
|
-
oldIndices[i] = -1;
|
650
|
-
for (i = end; i >= start; i--) {
|
651
|
-
if (map == null)
|
652
|
-
map = getKeyMap(old, oldStart, oldEnd + 1);
|
653
|
-
ve = vnodes[i];
|
654
|
-
var oldIndex = map[ve.key];
|
655
|
-
if (oldIndex != null) {
|
656
|
-
pos = oldIndex < pos ? oldIndex : -1;
|
657
|
-
oldIndices[i - start] = oldIndex;
|
658
|
-
oe = old[oldIndex];
|
659
|
-
old[oldIndex] = null;
|
660
|
-
if (oe !== ve)
|
661
|
-
updateNode(parent, oe, ve, hooks, nextSibling, ns);
|
662
|
-
if (ve.dom != null)
|
663
|
-
nextSibling = ve.dom;
|
664
|
-
matched++;
|
665
|
-
}
|
666
|
-
}
|
667
|
-
nextSibling = originalNextSibling;
|
668
|
-
if (matched !== oldEnd - oldStart + 1)
|
669
|
-
removeNodes(parent, old, oldStart, oldEnd + 1);
|
670
|
-
if (matched === 0)
|
671
|
-
createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns);
|
672
|
-
else {
|
673
|
-
if (pos === -1) {
|
674
|
-
lisIndices = makeLisIndices(oldIndices);
|
675
|
-
li = lisIndices.length - 1;
|
676
|
-
for (i = end; i >= start; i--) {
|
677
|
-
v = vnodes[i];
|
678
|
-
if (oldIndices[i - start] === -1)
|
679
|
-
createNode(parent, v, hooks, ns, nextSibling);
|
680
|
-
else {
|
681
|
-
if (lisIndices[li] === i - start)
|
682
|
-
li--;
|
683
|
-
else
|
684
|
-
moveNodes(parent, v, nextSibling);
|
685
|
-
}
|
686
|
-
if (v.dom != null)
|
687
|
-
nextSibling = vnodes[i].dom;
|
688
|
-
}
|
689
|
-
} else {
|
690
|
-
for (i = end; i >= start; i--) {
|
691
|
-
v = vnodes[i];
|
692
|
-
if (oldIndices[i - start] === -1)
|
693
|
-
createNode(parent, v, hooks, ns, nextSibling);
|
694
|
-
if (v.dom != null)
|
695
|
-
nextSibling = vnodes[i].dom;
|
696
|
-
}
|
697
|
-
}
|
698
|
-
}
|
699
|
-
}
|
700
|
-
}
|
701
|
-
}
|
702
|
-
}
|
703
|
-
function updateNode(parent, old, vnode, hooks, nextSibling, ns) {
|
704
|
-
var oldTag = old.tag, tag = vnode.tag;
|
705
|
-
if (oldTag === tag) {
|
706
|
-
vnode.state = old.state;
|
707
|
-
vnode.events = old.events;
|
708
|
-
if (shouldNotUpdate(vnode, old))
|
709
|
-
return;
|
710
|
-
if (typeof oldTag === "string") {
|
711
|
-
if (vnode.attrs != null) {
|
712
|
-
updateLifecycle(vnode.attrs, vnode, hooks);
|
713
|
-
}
|
714
|
-
switch (oldTag) {
|
715
|
-
case "#":
|
716
|
-
updateText(old, vnode);
|
717
|
-
break;
|
718
|
-
case "<":
|
719
|
-
updateHTML(parent, old, vnode, ns, nextSibling);
|
720
|
-
break;
|
721
|
-
case "[":
|
722
|
-
updateFragment(parent, old, vnode, hooks, nextSibling, ns);
|
723
|
-
break;
|
724
|
-
default:
|
725
|
-
updateElement(old, vnode, hooks, ns);
|
726
|
-
}
|
727
|
-
} else
|
728
|
-
updateComponent(parent, old, vnode, hooks, nextSibling, ns);
|
729
|
-
} else {
|
730
|
-
removeNode(parent, old);
|
731
|
-
createNode(parent, vnode, hooks, ns, nextSibling);
|
732
|
-
}
|
733
|
-
}
|
734
|
-
function updateText(old, vnode) {
|
735
|
-
if (old.children.toString() !== vnode.children.toString()) {
|
736
|
-
old.dom.nodeValue = vnode.children;
|
737
|
-
}
|
738
|
-
vnode.dom = old.dom;
|
739
|
-
}
|
740
|
-
function updateHTML(parent, old, vnode, ns, nextSibling) {
|
741
|
-
if (old.children !== vnode.children) {
|
742
|
-
removeHTML(parent, old);
|
743
|
-
createHTML(parent, vnode, ns, nextSibling);
|
744
|
-
} else {
|
745
|
-
vnode.dom = old.dom;
|
746
|
-
vnode.domSize = old.domSize;
|
747
|
-
vnode.instance = old.instance;
|
748
|
-
}
|
749
|
-
}
|
750
|
-
function updateFragment(parent, old, vnode, hooks, nextSibling, ns) {
|
751
|
-
updateNodes(parent, old.children, vnode.children, hooks, nextSibling, ns);
|
752
|
-
var domSize = 0, children = vnode.children;
|
753
|
-
vnode.dom = null;
|
754
|
-
if (children != null) {
|
755
|
-
for (var i = 0; i < children.length; i++) {
|
756
|
-
var child = children[i];
|
757
|
-
if (child != null && child.dom != null) {
|
758
|
-
if (vnode.dom == null)
|
759
|
-
vnode.dom = child.dom;
|
760
|
-
domSize += child.domSize || 1;
|
761
|
-
}
|
762
|
-
}
|
763
|
-
if (domSize !== 1)
|
764
|
-
vnode.domSize = domSize;
|
765
|
-
}
|
766
|
-
}
|
767
|
-
function updateElement(old, vnode, hooks, ns) {
|
768
|
-
var element = vnode.dom = old.dom;
|
769
|
-
ns = getNameSpace(vnode) || ns;
|
770
|
-
if (vnode.tag === "textarea") {
|
771
|
-
if (vnode.attrs == null)
|
772
|
-
vnode.attrs = {};
|
773
|
-
}
|
774
|
-
updateAttrs(vnode, old.attrs, vnode.attrs, ns);
|
775
|
-
if (!maybeSetContentEditable(vnode)) {
|
776
|
-
updateNodes(element, old.children, vnode.children, hooks, null, ns);
|
777
|
-
}
|
778
|
-
}
|
779
|
-
function updateComponent(parent, old, vnode, hooks, nextSibling, ns) {
|
780
|
-
vnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode));
|
781
|
-
if (vnode.instance === vnode)
|
782
|
-
throw Error("A view cannot return the vnode it received as argument");
|
783
|
-
updateLifecycle(vnode.state, vnode, hooks);
|
784
|
-
if (vnode.attrs != null)
|
785
|
-
updateLifecycle(vnode.attrs, vnode, hooks);
|
786
|
-
if (vnode.instance != null) {
|
787
|
-
if (old.instance == null)
|
788
|
-
createNode(parent, vnode.instance, hooks, ns, nextSibling);
|
789
|
-
else
|
790
|
-
updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, ns);
|
791
|
-
vnode.dom = vnode.instance.dom;
|
792
|
-
vnode.domSize = vnode.instance.domSize;
|
793
|
-
} else if (old.instance != null) {
|
794
|
-
removeNode(parent, old.instance);
|
795
|
-
vnode.dom = void 0;
|
796
|
-
vnode.domSize = 0;
|
797
|
-
} else {
|
798
|
-
vnode.dom = old.dom;
|
799
|
-
vnode.domSize = old.domSize;
|
800
|
-
}
|
801
|
-
}
|
802
|
-
function getKeyMap(vnodes, start, end) {
|
803
|
-
var map = /* @__PURE__ */ Object.create(null);
|
804
|
-
for (; start < end; start++) {
|
805
|
-
var vnode = vnodes[start];
|
806
|
-
if (vnode != null) {
|
807
|
-
var key = vnode.key;
|
808
|
-
if (key != null)
|
809
|
-
map[key] = start;
|
810
|
-
}
|
811
|
-
}
|
812
|
-
return map;
|
813
|
-
}
|
814
|
-
var lisTemp = [];
|
815
|
-
function makeLisIndices(a) {
|
816
|
-
var result = [0];
|
817
|
-
var u = 0, v = 0, i = 0;
|
818
|
-
var il = lisTemp.length = a.length;
|
819
|
-
for (var i = 0; i < il; i++)
|
820
|
-
lisTemp[i] = a[i];
|
821
|
-
for (var i = 0; i < il; ++i) {
|
822
|
-
if (a[i] === -1)
|
823
|
-
continue;
|
824
|
-
var j = result[result.length - 1];
|
825
|
-
if (a[j] < a[i]) {
|
826
|
-
lisTemp[i] = j;
|
827
|
-
result.push(i);
|
828
|
-
continue;
|
829
|
-
}
|
830
|
-
u = 0;
|
831
|
-
v = result.length - 1;
|
832
|
-
while (u < v) {
|
833
|
-
var c = (u >>> 1) + (v >>> 1) + (u & v & 1);
|
834
|
-
if (a[result[c]] < a[i]) {
|
835
|
-
u = c + 1;
|
836
|
-
} else {
|
837
|
-
v = c;
|
838
|
-
}
|
839
|
-
}
|
840
|
-
if (a[i] < a[result[u]]) {
|
841
|
-
if (u > 0)
|
842
|
-
lisTemp[i] = result[u - 1];
|
843
|
-
result[u] = i;
|
844
|
-
}
|
845
|
-
}
|
846
|
-
u = result.length;
|
847
|
-
v = result[u - 1];
|
848
|
-
while (u-- > 0) {
|
849
|
-
result[u] = v;
|
850
|
-
v = lisTemp[v];
|
851
|
-
}
|
852
|
-
lisTemp.length = 0;
|
853
|
-
return result;
|
854
|
-
}
|
855
|
-
function getNextSibling(vnodes, i, nextSibling) {
|
856
|
-
for (; i < vnodes.length; i++) {
|
857
|
-
if (vnodes[i] != null && vnodes[i].dom != null)
|
858
|
-
return vnodes[i].dom;
|
859
|
-
}
|
860
|
-
return nextSibling;
|
861
|
-
}
|
862
|
-
function moveNodes(parent, vnode, nextSibling) {
|
863
|
-
var frag = $doc.createDocumentFragment();
|
864
|
-
moveChildToFrag(parent, frag, vnode);
|
865
|
-
insertNode(parent, frag, nextSibling);
|
866
|
-
}
|
867
|
-
function moveChildToFrag(parent, frag, vnode) {
|
868
|
-
while (vnode.dom != null && vnode.dom.parentNode === parent) {
|
869
|
-
if (typeof vnode.tag !== "string") {
|
870
|
-
vnode = vnode.instance;
|
871
|
-
if (vnode != null)
|
872
|
-
continue;
|
873
|
-
} else if (vnode.tag === "<") {
|
874
|
-
for (var i = 0; i < vnode.instance.length; i++) {
|
875
|
-
frag.appendChild(vnode.instance[i]);
|
876
|
-
}
|
877
|
-
} else if (vnode.tag !== "[") {
|
878
|
-
frag.appendChild(vnode.dom);
|
879
|
-
} else if (vnode.children.length === 1) {
|
880
|
-
vnode = vnode.children[0];
|
881
|
-
if (vnode != null)
|
882
|
-
continue;
|
883
|
-
} else {
|
884
|
-
for (var i = 0; i < vnode.children.length; i++) {
|
885
|
-
var child = vnode.children[i];
|
886
|
-
if (child != null)
|
887
|
-
moveChildToFrag(parent, frag, child);
|
888
|
-
}
|
889
|
-
}
|
890
|
-
break;
|
891
|
-
}
|
892
|
-
}
|
893
|
-
function insertNode(parent, dom, nextSibling) {
|
894
|
-
if (nextSibling != null)
|
895
|
-
parent.insertBefore(dom, nextSibling);
|
896
|
-
else
|
897
|
-
parent.appendChild(dom);
|
898
|
-
}
|
899
|
-
function maybeSetContentEditable(vnode) {
|
900
|
-
if (vnode.attrs == null || vnode.attrs.contenteditable == null && // attribute
|
901
|
-
vnode.attrs.contentEditable == null)
|
902
|
-
return false;
|
903
|
-
var children = vnode.children;
|
904
|
-
if (children != null && children.length === 1 && children[0].tag === "<") {
|
905
|
-
var content = children[0].children;
|
906
|
-
if (vnode.dom.innerHTML !== content)
|
907
|
-
vnode.dom.innerHTML = content;
|
908
|
-
} else if (children != null && children.length !== 0)
|
909
|
-
throw new Error("Child node of a contenteditable must be trusted.");
|
910
|
-
return true;
|
911
|
-
}
|
912
|
-
function removeNodes(parent, vnodes, start, end) {
|
913
|
-
for (var i = start; i < end; i++) {
|
914
|
-
var vnode = vnodes[i];
|
915
|
-
if (vnode != null)
|
916
|
-
removeNode(parent, vnode);
|
917
|
-
}
|
918
|
-
}
|
919
|
-
function removeNode(parent, vnode) {
|
920
|
-
var mask = 0;
|
921
|
-
var original = vnode.state;
|
922
|
-
var stateResult, attrsResult;
|
923
|
-
if (typeof vnode.tag !== "string" && typeof vnode.state.onbeforeremove === "function") {
|
924
|
-
var result = callHook.call(vnode.state.onbeforeremove, vnode);
|
925
|
-
if (result != null && typeof result.then === "function") {
|
926
|
-
mask = 1;
|
927
|
-
stateResult = result;
|
928
|
-
}
|
929
|
-
}
|
930
|
-
if (vnode.attrs && typeof vnode.attrs.onbeforeremove === "function") {
|
931
|
-
var result = callHook.call(vnode.attrs.onbeforeremove, vnode);
|
932
|
-
if (result != null && typeof result.then === "function") {
|
933
|
-
mask |= 2;
|
934
|
-
attrsResult = result;
|
935
|
-
}
|
936
|
-
}
|
937
|
-
checkState(vnode, original);
|
938
|
-
if (!mask) {
|
939
|
-
onremove(vnode);
|
940
|
-
removeChild(parent, vnode);
|
941
|
-
} else {
|
942
|
-
if (stateResult != null) {
|
943
|
-
var next = function() {
|
944
|
-
if (mask & 1) {
|
945
|
-
mask &= 2;
|
946
|
-
if (!mask)
|
947
|
-
reallyRemove();
|
948
|
-
}
|
949
|
-
};
|
950
|
-
stateResult.then(next, next);
|
951
|
-
}
|
952
|
-
if (attrsResult != null) {
|
953
|
-
var next = function() {
|
954
|
-
if (mask & 2) {
|
955
|
-
mask &= 1;
|
956
|
-
if (!mask)
|
957
|
-
reallyRemove();
|
958
|
-
}
|
959
|
-
};
|
960
|
-
attrsResult.then(next, next);
|
961
|
-
}
|
962
|
-
}
|
963
|
-
function reallyRemove() {
|
964
|
-
checkState(vnode, original);
|
965
|
-
onremove(vnode);
|
966
|
-
removeChild(parent, vnode);
|
967
|
-
}
|
968
|
-
}
|
969
|
-
function removeHTML(parent, vnode) {
|
970
|
-
for (var i = 0; i < vnode.instance.length; i++) {
|
971
|
-
parent.removeChild(vnode.instance[i]);
|
972
|
-
}
|
973
|
-
}
|
974
|
-
function removeChild(parent, vnode) {
|
975
|
-
while (vnode.dom != null && vnode.dom.parentNode === parent) {
|
976
|
-
if (typeof vnode.tag !== "string") {
|
977
|
-
vnode = vnode.instance;
|
978
|
-
if (vnode != null)
|
979
|
-
continue;
|
980
|
-
} else if (vnode.tag === "<") {
|
981
|
-
removeHTML(parent, vnode);
|
982
|
-
} else {
|
983
|
-
if (vnode.tag !== "[") {
|
984
|
-
parent.removeChild(vnode.dom);
|
985
|
-
if (!Array.isArray(vnode.children))
|
986
|
-
break;
|
987
|
-
}
|
988
|
-
if (vnode.children.length === 1) {
|
989
|
-
vnode = vnode.children[0];
|
990
|
-
if (vnode != null)
|
991
|
-
continue;
|
992
|
-
} else {
|
993
|
-
for (var i = 0; i < vnode.children.length; i++) {
|
994
|
-
var child = vnode.children[i];
|
995
|
-
if (child != null)
|
996
|
-
removeChild(parent, child);
|
997
|
-
}
|
998
|
-
}
|
999
|
-
}
|
1000
|
-
break;
|
1001
|
-
}
|
1002
|
-
}
|
1003
|
-
function onremove(vnode) {
|
1004
|
-
if (typeof vnode.tag !== "string" && typeof vnode.state.onremove === "function")
|
1005
|
-
callHook.call(vnode.state.onremove, vnode);
|
1006
|
-
if (vnode.attrs && typeof vnode.attrs.onremove === "function")
|
1007
|
-
callHook.call(vnode.attrs.onremove, vnode);
|
1008
|
-
if (typeof vnode.tag !== "string") {
|
1009
|
-
if (vnode.instance != null)
|
1010
|
-
onremove(vnode.instance);
|
1011
|
-
} else {
|
1012
|
-
var children = vnode.children;
|
1013
|
-
if (Array.isArray(children)) {
|
1014
|
-
for (var i = 0; i < children.length; i++) {
|
1015
|
-
var child = children[i];
|
1016
|
-
if (child != null)
|
1017
|
-
onremove(child);
|
1018
|
-
}
|
1019
|
-
}
|
1020
|
-
}
|
1021
|
-
}
|
1022
|
-
function setAttrs(vnode, attrs, ns) {
|
1023
|
-
if (vnode.tag === "input" && attrs.type != null)
|
1024
|
-
vnode.dom.setAttribute("type", attrs.type);
|
1025
|
-
var isFileInput = attrs != null && vnode.tag === "input" && attrs.type === "file";
|
1026
|
-
for (var key in attrs) {
|
1027
|
-
setAttr(vnode, key, null, attrs[key], ns, isFileInput);
|
1028
|
-
}
|
1029
|
-
}
|
1030
|
-
function setAttr(vnode, key, old, value, ns, isFileInput) {
|
1031
|
-
if (key === "key" || key === "is" || value == null || isLifecycleMethod(key) || old === value && !isFormAttribute(vnode, key) && typeof value !== "object" || key === "type" && vnode.tag === "input")
|
1032
|
-
return;
|
1033
|
-
if (key[0] === "o" && key[1] === "n")
|
1034
|
-
return updateEvent(vnode, key, value);
|
1035
|
-
if (key.slice(0, 6) === "xlink:")
|
1036
|
-
vnode.dom.setAttributeNS("http://www.w3.org/1999/xlink", key.slice(6), value);
|
1037
|
-
else if (key === "style")
|
1038
|
-
updateStyle(vnode.dom, old, value);
|
1039
|
-
else if (hasPropertyKey(vnode, key, ns)) {
|
1040
|
-
if (key === "value") {
|
1041
|
-
if ((vnode.tag === "input" || vnode.tag === "textarea") && vnode.dom.value === "" + value && (isFileInput || vnode.dom === activeElement()))
|
1042
|
-
return;
|
1043
|
-
if (vnode.tag === "select" && old !== null && vnode.dom.value === "" + value)
|
1044
|
-
return;
|
1045
|
-
if (vnode.tag === "option" && old !== null && vnode.dom.value === "" + value)
|
1046
|
-
return;
|
1047
|
-
if (isFileInput && "" + value !== "") {
|
1048
|
-
console.error("`value` is read-only on file inputs!");
|
1049
|
-
return;
|
1050
|
-
}
|
1051
|
-
}
|
1052
|
-
vnode.dom[key] = value;
|
1053
|
-
} else {
|
1054
|
-
if (typeof value === "boolean") {
|
1055
|
-
if (value)
|
1056
|
-
vnode.dom.setAttribute(key, "");
|
1057
|
-
else
|
1058
|
-
vnode.dom.removeAttribute(key);
|
1059
|
-
} else
|
1060
|
-
vnode.dom.setAttribute(key === "className" ? "class" : key, value);
|
1061
|
-
}
|
1062
|
-
}
|
1063
|
-
function removeAttr(vnode, key, old, ns) {
|
1064
|
-
if (key === "key" || key === "is" || old == null || isLifecycleMethod(key))
|
1065
|
-
return;
|
1066
|
-
if (key[0] === "o" && key[1] === "n")
|
1067
|
-
updateEvent(vnode, key, void 0);
|
1068
|
-
else if (key === "style")
|
1069
|
-
updateStyle(vnode.dom, old, null);
|
1070
|
-
else if (hasPropertyKey(vnode, key, ns) && key !== "className" && key !== "title" && !(key === "value" && (vnode.tag === "option" || vnode.tag === "select" && vnode.dom.selectedIndex === -1 && vnode.dom === activeElement())) && !(vnode.tag === "input" && key === "type")) {
|
1071
|
-
vnode.dom[key] = null;
|
1072
|
-
} else {
|
1073
|
-
var nsLastIndex = key.indexOf(":");
|
1074
|
-
if (nsLastIndex !== -1)
|
1075
|
-
key = key.slice(nsLastIndex + 1);
|
1076
|
-
if (old !== false)
|
1077
|
-
vnode.dom.removeAttribute(key === "className" ? "class" : key);
|
1078
|
-
}
|
1079
|
-
}
|
1080
|
-
function setLateSelectAttrs(vnode, attrs) {
|
1081
|
-
if ("value" in attrs) {
|
1082
|
-
if (attrs.value === null) {
|
1083
|
-
if (vnode.dom.selectedIndex !== -1)
|
1084
|
-
vnode.dom.value = null;
|
1085
|
-
} else {
|
1086
|
-
var normalized = "" + attrs.value;
|
1087
|
-
if (vnode.dom.value !== normalized || vnode.dom.selectedIndex === -1) {
|
1088
|
-
vnode.dom.value = normalized;
|
1089
|
-
}
|
1090
|
-
}
|
1091
|
-
}
|
1092
|
-
if ("selectedIndex" in attrs)
|
1093
|
-
setAttr(vnode, "selectedIndex", null, attrs.selectedIndex, void 0);
|
1094
|
-
}
|
1095
|
-
function updateAttrs(vnode, old, attrs, ns) {
|
1096
|
-
if (old && old === attrs) {
|
1097
|
-
console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major");
|
1098
|
-
}
|
1099
|
-
if (attrs != null) {
|
1100
|
-
if (vnode.tag === "input" && attrs.type != null)
|
1101
|
-
vnode.dom.setAttribute("type", attrs.type);
|
1102
|
-
var isFileInput = vnode.tag === "input" && attrs.type === "file";
|
1103
|
-
for (var key in attrs) {
|
1104
|
-
setAttr(vnode, key, old && old[key], attrs[key], ns, isFileInput);
|
1105
|
-
}
|
1106
|
-
}
|
1107
|
-
var val;
|
1108
|
-
if (old != null) {
|
1109
|
-
for (var key in old) {
|
1110
|
-
if ((val = old[key]) != null && (attrs == null || attrs[key] == null)) {
|
1111
|
-
removeAttr(vnode, key, val, ns);
|
1112
|
-
}
|
1113
|
-
}
|
1114
|
-
}
|
1115
|
-
}
|
1116
|
-
function isFormAttribute(vnode, attr) {
|
1117
|
-
return attr === "value" || attr === "checked" || attr === "selectedIndex" || attr === "selected" && vnode.dom === activeElement() || vnode.tag === "option" && vnode.dom.parentNode === $doc.activeElement;
|
1118
|
-
}
|
1119
|
-
function isLifecycleMethod(attr) {
|
1120
|
-
return attr === "oninit" || attr === "oncreate" || attr === "onupdate" || attr === "onremove" || attr === "onbeforeremove" || attr === "onbeforeupdate";
|
1121
|
-
}
|
1122
|
-
function hasPropertyKey(vnode, key, ns) {
|
1123
|
-
return ns === void 0 && // If it's a custom element, just keep it.
|
1124
|
-
(vnode.tag.indexOf("-") > -1 || vnode.attrs != null && vnode.attrs.is || // If it's a normal element, let's try to avoid a few browser bugs.
|
1125
|
-
key !== "href" && key !== "list" && key !== "form" && key !== "width" && key !== "height") && key in vnode.dom;
|
1126
|
-
}
|
1127
|
-
var uppercaseRegex = /[A-Z]/g;
|
1128
|
-
function toLowerCase(capital) {
|
1129
|
-
return "-" + capital.toLowerCase();
|
1130
|
-
}
|
1131
|
-
function normalizeKey(key) {
|
1132
|
-
return key[0] === "-" && key[1] === "-" ? key : key === "cssFloat" ? "float" : key.replace(uppercaseRegex, toLowerCase);
|
1133
|
-
}
|
1134
|
-
function updateStyle(element, old, style) {
|
1135
|
-
if (old === style) {
|
1136
|
-
} else if (style == null) {
|
1137
|
-
element.style.cssText = "";
|
1138
|
-
} else if (typeof style !== "object") {
|
1139
|
-
element.style.cssText = style;
|
1140
|
-
} else if (old == null || typeof old !== "object") {
|
1141
|
-
element.style.cssText = "";
|
1142
|
-
for (var key in style) {
|
1143
|
-
var value = style[key];
|
1144
|
-
if (value != null)
|
1145
|
-
element.style.setProperty(normalizeKey(key), String(value));
|
1146
|
-
}
|
1147
|
-
} else {
|
1148
|
-
for (var key in style) {
|
1149
|
-
var value = style[key];
|
1150
|
-
if (value != null && (value = String(value)) !== String(old[key])) {
|
1151
|
-
element.style.setProperty(normalizeKey(key), value);
|
1152
|
-
}
|
1153
|
-
}
|
1154
|
-
for (var key in old) {
|
1155
|
-
if (old[key] != null && style[key] == null) {
|
1156
|
-
element.style.removeProperty(normalizeKey(key));
|
1157
|
-
}
|
1158
|
-
}
|
1159
|
-
}
|
1160
|
-
}
|
1161
|
-
function EventDict() {
|
1162
|
-
this._ = currentRedraw;
|
1163
|
-
}
|
1164
|
-
EventDict.prototype = /* @__PURE__ */ Object.create(null);
|
1165
|
-
EventDict.prototype.handleEvent = function(ev) {
|
1166
|
-
var handler = this["on" + ev.type];
|
1167
|
-
var result;
|
1168
|
-
if (typeof handler === "function")
|
1169
|
-
result = handler.call(ev.currentTarget, ev);
|
1170
|
-
else if (typeof handler.handleEvent === "function")
|
1171
|
-
handler.handleEvent(ev);
|
1172
|
-
if (this._ && ev.redraw !== false)
|
1173
|
-
(0, this._)();
|
1174
|
-
if (result === false) {
|
1175
|
-
ev.preventDefault();
|
1176
|
-
ev.stopPropagation();
|
1177
|
-
}
|
1178
|
-
};
|
1179
|
-
function updateEvent(vnode, key, value) {
|
1180
|
-
if (vnode.events != null) {
|
1181
|
-
vnode.events._ = currentRedraw;
|
1182
|
-
if (vnode.events[key] === value)
|
1183
|
-
return;
|
1184
|
-
if (value != null && (typeof value === "function" || typeof value === "object")) {
|
1185
|
-
if (vnode.events[key] == null)
|
1186
|
-
vnode.dom.addEventListener(key.slice(2), vnode.events, false);
|
1187
|
-
vnode.events[key] = value;
|
1188
|
-
} else {
|
1189
|
-
if (vnode.events[key] != null)
|
1190
|
-
vnode.dom.removeEventListener(key.slice(2), vnode.events, false);
|
1191
|
-
vnode.events[key] = void 0;
|
1192
|
-
}
|
1193
|
-
} else if (value != null && (typeof value === "function" || typeof value === "object")) {
|
1194
|
-
vnode.events = new EventDict();
|
1195
|
-
vnode.dom.addEventListener(key.slice(2), vnode.events, false);
|
1196
|
-
vnode.events[key] = value;
|
1197
|
-
}
|
1198
|
-
}
|
1199
|
-
function initLifecycle(source, vnode, hooks) {
|
1200
|
-
if (typeof source.oninit === "function")
|
1201
|
-
callHook.call(source.oninit, vnode);
|
1202
|
-
if (typeof source.oncreate === "function")
|
1203
|
-
hooks.push(callHook.bind(source.oncreate, vnode));
|
1204
|
-
}
|
1205
|
-
function updateLifecycle(source, vnode, hooks) {
|
1206
|
-
if (typeof source.onupdate === "function")
|
1207
|
-
hooks.push(callHook.bind(source.onupdate, vnode));
|
1208
|
-
}
|
1209
|
-
function shouldNotUpdate(vnode, old) {
|
1210
|
-
do {
|
1211
|
-
if (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === "function") {
|
1212
|
-
var force = callHook.call(vnode.attrs.onbeforeupdate, vnode, old);
|
1213
|
-
if (force !== void 0 && !force)
|
1214
|
-
break;
|
1215
|
-
}
|
1216
|
-
if (typeof vnode.tag !== "string" && typeof vnode.state.onbeforeupdate === "function") {
|
1217
|
-
var force = callHook.call(vnode.state.onbeforeupdate, vnode, old);
|
1218
|
-
if (force !== void 0 && !force)
|
1219
|
-
break;
|
1220
|
-
}
|
1221
|
-
return false;
|
1222
|
-
} while (false);
|
1223
|
-
vnode.dom = old.dom;
|
1224
|
-
vnode.domSize = old.domSize;
|
1225
|
-
vnode.instance = old.instance;
|
1226
|
-
vnode.attrs = old.attrs;
|
1227
|
-
vnode.children = old.children;
|
1228
|
-
vnode.text = old.text;
|
1229
|
-
return true;
|
1230
|
-
}
|
1231
|
-
var currentDOM;
|
1232
|
-
return function(dom, vnodes, redraw) {
|
1233
|
-
if (!dom)
|
1234
|
-
throw new TypeError("DOM element being rendered to does not exist.");
|
1235
|
-
if (currentDOM != null && dom.contains(currentDOM)) {
|
1236
|
-
throw new TypeError("Node is currently being rendered to and thus is locked.");
|
1237
|
-
}
|
1238
|
-
var prevRedraw = currentRedraw;
|
1239
|
-
var prevDOM = currentDOM;
|
1240
|
-
var hooks = [];
|
1241
|
-
var active = activeElement();
|
1242
|
-
var namespace = dom.namespaceURI;
|
1243
|
-
currentDOM = dom;
|
1244
|
-
currentRedraw = typeof redraw === "function" ? redraw : void 0;
|
1245
|
-
try {
|
1246
|
-
if (dom.vnodes == null)
|
1247
|
-
dom.textContent = "";
|
1248
|
-
vnodes = Vnode.normalizeChildren(Array.isArray(vnodes) ? vnodes : [vnodes]);
|
1249
|
-
updateNodes(dom, dom.vnodes, vnodes, hooks, null, namespace === "http://www.w3.org/1999/xhtml" ? void 0 : namespace);
|
1250
|
-
dom.vnodes = vnodes;
|
1251
|
-
if (active != null && activeElement() !== active && typeof active.focus === "function")
|
1252
|
-
active.focus();
|
1253
|
-
for (var i = 0; i < hooks.length; i++)
|
1254
|
-
hooks[i]();
|
1255
|
-
} finally {
|
1256
|
-
currentRedraw = prevRedraw;
|
1257
|
-
currentDOM = prevDOM;
|
1258
|
-
}
|
1259
|
-
};
|
1260
|
-
};
|
1261
|
-
}
|
1262
|
-
});
|
1263
|
-
|
1264
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render.js
|
1265
|
-
var require_render2 = __commonJS({
|
1266
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/render.js"(exports, module) {
|
1267
|
-
"use strict";
|
1268
|
-
module.exports = require_render()(typeof window !== "undefined" ? window : null);
|
1269
|
-
}
|
1270
|
-
});
|
1271
|
-
|
1272
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/api/mount-redraw.js
|
1273
|
-
var require_mount_redraw = __commonJS({
|
1274
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/api/mount-redraw.js"(exports, module) {
|
1275
|
-
"use strict";
|
1276
|
-
var Vnode = require_vnode();
|
1277
|
-
module.exports = function(render, schedule, console2) {
|
1278
|
-
var subscriptions = [];
|
1279
|
-
var pending = false;
|
1280
|
-
var offset = -1;
|
1281
|
-
function sync() {
|
1282
|
-
for (offset = 0; offset < subscriptions.length; offset += 2) {
|
1283
|
-
try {
|
1284
|
-
render(subscriptions[offset], Vnode(subscriptions[offset + 1]), redraw);
|
1285
|
-
} catch (e) {
|
1286
|
-
console2.error(e);
|
1287
|
-
}
|
1288
|
-
}
|
1289
|
-
offset = -1;
|
1290
|
-
}
|
1291
|
-
function redraw() {
|
1292
|
-
if (!pending) {
|
1293
|
-
pending = true;
|
1294
|
-
schedule(function() {
|
1295
|
-
pending = false;
|
1296
|
-
sync();
|
1297
|
-
});
|
1298
|
-
}
|
1299
|
-
}
|
1300
|
-
redraw.sync = sync;
|
1301
|
-
function mount(root, component) {
|
1302
|
-
if (component != null && component.view == null && typeof component !== "function") {
|
1303
|
-
throw new TypeError("m.mount expects a component, not a vnode.");
|
1304
|
-
}
|
1305
|
-
var index = subscriptions.indexOf(root);
|
1306
|
-
if (index >= 0) {
|
1307
|
-
subscriptions.splice(index, 2);
|
1308
|
-
if (index <= offset)
|
1309
|
-
offset -= 2;
|
1310
|
-
render(root, []);
|
1311
|
-
}
|
1312
|
-
if (component != null) {
|
1313
|
-
subscriptions.push(root, component);
|
1314
|
-
render(root, Vnode(component), redraw);
|
1315
|
-
}
|
1316
|
-
}
|
1317
|
-
return { mount, redraw };
|
1318
|
-
};
|
1319
|
-
}
|
1320
|
-
});
|
1321
|
-
|
1322
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/mount-redraw.js
|
1323
|
-
var require_mount_redraw2 = __commonJS({
|
1324
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/mount-redraw.js"(exports, module) {
|
1325
|
-
"use strict";
|
1326
|
-
var render = require_render2();
|
1327
|
-
module.exports = require_mount_redraw()(render, typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : null, typeof console !== "undefined" ? console : null);
|
1328
|
-
}
|
1329
|
-
});
|
1330
|
-
|
1331
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/querystring/build.js
|
1332
|
-
var require_build = __commonJS({
|
1333
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/querystring/build.js"(exports, module) {
|
1334
|
-
"use strict";
|
1335
|
-
module.exports = function(object) {
|
1336
|
-
if (Object.prototype.toString.call(object) !== "[object Object]")
|
1337
|
-
return "";
|
1338
|
-
var args = [];
|
1339
|
-
for (var key in object) {
|
1340
|
-
destructure(key, object[key]);
|
1341
|
-
}
|
1342
|
-
return args.join("&");
|
1343
|
-
function destructure(key2, value) {
|
1344
|
-
if (Array.isArray(value)) {
|
1345
|
-
for (var i = 0; i < value.length; i++) {
|
1346
|
-
destructure(key2 + "[" + i + "]", value[i]);
|
1347
|
-
}
|
1348
|
-
} else if (Object.prototype.toString.call(value) === "[object Object]") {
|
1349
|
-
for (var i in value) {
|
1350
|
-
destructure(key2 + "[" + i + "]", value[i]);
|
1351
|
-
}
|
1352
|
-
} else
|
1353
|
-
args.push(encodeURIComponent(key2) + (value != null && value !== "" ? "=" + encodeURIComponent(value) : ""));
|
1354
|
-
}
|
1355
|
-
};
|
1356
|
-
}
|
1357
|
-
});
|
1358
|
-
|
1359
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/util/assign.js
|
1360
|
-
var require_assign = __commonJS({
|
1361
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/util/assign.js"(exports, module) {
|
1362
|
-
"use strict";
|
1363
|
-
var hasOwn = require_hasOwn();
|
1364
|
-
module.exports = Object.assign || function(target, source) {
|
1365
|
-
for (var key in source) {
|
1366
|
-
if (hasOwn.call(source, key))
|
1367
|
-
target[key] = source[key];
|
1368
|
-
}
|
1369
|
-
};
|
1370
|
-
}
|
1371
|
-
});
|
1372
|
-
|
1373
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/pathname/build.js
|
1374
|
-
var require_build2 = __commonJS({
|
1375
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/pathname/build.js"(exports, module) {
|
1376
|
-
"use strict";
|
1377
|
-
var buildQueryString = require_build();
|
1378
|
-
var assign = require_assign();
|
1379
|
-
module.exports = function(template, params) {
|
1380
|
-
if (/:([^\/\.-]+)(\.{3})?:/.test(template)) {
|
1381
|
-
throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.");
|
1382
|
-
}
|
1383
|
-
if (params == null)
|
1384
|
-
return template;
|
1385
|
-
var queryIndex = template.indexOf("?");
|
1386
|
-
var hashIndex = template.indexOf("#");
|
1387
|
-
var queryEnd = hashIndex < 0 ? template.length : hashIndex;
|
1388
|
-
var pathEnd = queryIndex < 0 ? queryEnd : queryIndex;
|
1389
|
-
var path = template.slice(0, pathEnd);
|
1390
|
-
var query = {};
|
1391
|
-
assign(query, params);
|
1392
|
-
var resolved = path.replace(/:([^\/\.-]+)(\.{3})?/g, function(m2, key, variadic) {
|
1393
|
-
delete query[key];
|
1394
|
-
if (params[key] == null)
|
1395
|
-
return m2;
|
1396
|
-
return variadic ? params[key] : encodeURIComponent(String(params[key]));
|
1397
|
-
});
|
1398
|
-
var newQueryIndex = resolved.indexOf("?");
|
1399
|
-
var newHashIndex = resolved.indexOf("#");
|
1400
|
-
var newQueryEnd = newHashIndex < 0 ? resolved.length : newHashIndex;
|
1401
|
-
var newPathEnd = newQueryIndex < 0 ? newQueryEnd : newQueryIndex;
|
1402
|
-
var result = resolved.slice(0, newPathEnd);
|
1403
|
-
if (queryIndex >= 0)
|
1404
|
-
result += template.slice(queryIndex, queryEnd);
|
1405
|
-
if (newQueryIndex >= 0)
|
1406
|
-
result += (queryIndex < 0 ? "?" : "&") + resolved.slice(newQueryIndex, newQueryEnd);
|
1407
|
-
var querystring = buildQueryString(query);
|
1408
|
-
if (querystring)
|
1409
|
-
result += (queryIndex < 0 && newQueryIndex < 0 ? "?" : "&") + querystring;
|
1410
|
-
if (hashIndex >= 0)
|
1411
|
-
result += template.slice(hashIndex);
|
1412
|
-
if (newHashIndex >= 0)
|
1413
|
-
result += (hashIndex < 0 ? "" : "&") + resolved.slice(newHashIndex);
|
1414
|
-
return result;
|
1415
|
-
};
|
1416
|
-
}
|
1417
|
-
});
|
1418
|
-
|
1419
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/request/request.js
|
1420
|
-
var require_request = __commonJS({
|
1421
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/request/request.js"(exports, module) {
|
1422
|
-
"use strict";
|
1423
|
-
var buildPathname = require_build2();
|
1424
|
-
var hasOwn = require_hasOwn();
|
1425
|
-
module.exports = function($window, Promise2, oncompletion) {
|
1426
|
-
var callbackCount = 0;
|
1427
|
-
function PromiseProxy(executor) {
|
1428
|
-
return new Promise2(executor);
|
1429
|
-
}
|
1430
|
-
PromiseProxy.prototype = Promise2.prototype;
|
1431
|
-
PromiseProxy.__proto__ = Promise2;
|
1432
|
-
function makeRequest(factory) {
|
1433
|
-
return function(url, args) {
|
1434
|
-
if (typeof url !== "string") {
|
1435
|
-
args = url;
|
1436
|
-
url = url.url;
|
1437
|
-
} else if (args == null)
|
1438
|
-
args = {};
|
1439
|
-
var promise = new Promise2(function(resolve, reject) {
|
1440
|
-
factory(buildPathname(url, args.params), args, function(data) {
|
1441
|
-
if (typeof args.type === "function") {
|
1442
|
-
if (Array.isArray(data)) {
|
1443
|
-
for (var i = 0; i < data.length; i++) {
|
1444
|
-
data[i] = new args.type(data[i]);
|
1445
|
-
}
|
1446
|
-
} else
|
1447
|
-
data = new args.type(data);
|
1448
|
-
}
|
1449
|
-
resolve(data);
|
1450
|
-
}, reject);
|
1451
|
-
});
|
1452
|
-
if (args.background === true)
|
1453
|
-
return promise;
|
1454
|
-
var count = 0;
|
1455
|
-
function complete() {
|
1456
|
-
if (--count === 0 && typeof oncompletion === "function")
|
1457
|
-
oncompletion();
|
1458
|
-
}
|
1459
|
-
return wrap(promise);
|
1460
|
-
function wrap(promise2) {
|
1461
|
-
var then = promise2.then;
|
1462
|
-
promise2.constructor = PromiseProxy;
|
1463
|
-
promise2.then = function() {
|
1464
|
-
count++;
|
1465
|
-
var next = then.apply(promise2, arguments);
|
1466
|
-
next.then(complete, function(e) {
|
1467
|
-
complete();
|
1468
|
-
if (count === 0)
|
1469
|
-
throw e;
|
1470
|
-
});
|
1471
|
-
return wrap(next);
|
1472
|
-
};
|
1473
|
-
return promise2;
|
1474
|
-
}
|
1475
|
-
};
|
1476
|
-
}
|
1477
|
-
function hasHeader(args, name) {
|
1478
|
-
for (var key in args.headers) {
|
1479
|
-
if (hasOwn.call(args.headers, key) && key.toLowerCase() === name)
|
1480
|
-
return true;
|
1481
|
-
}
|
1482
|
-
return false;
|
1483
|
-
}
|
1484
|
-
return {
|
1485
|
-
request: makeRequest(function(url, args, resolve, reject) {
|
1486
|
-
var method = args.method != null ? args.method.toUpperCase() : "GET";
|
1487
|
-
var body = args.body;
|
1488
|
-
var assumeJSON = (args.serialize == null || args.serialize === JSON.serialize) && !(body instanceof $window.FormData || body instanceof $window.URLSearchParams);
|
1489
|
-
var responseType = args.responseType || (typeof args.extract === "function" ? "" : "json");
|
1490
|
-
var xhr = new $window.XMLHttpRequest(), aborted = false, isTimeout = false;
|
1491
|
-
var original = xhr, replacedAbort;
|
1492
|
-
var abort = xhr.abort;
|
1493
|
-
xhr.abort = function() {
|
1494
|
-
aborted = true;
|
1495
|
-
abort.call(this);
|
1496
|
-
};
|
1497
|
-
xhr.open(method, url, args.async !== false, typeof args.user === "string" ? args.user : void 0, typeof args.password === "string" ? args.password : void 0);
|
1498
|
-
if (assumeJSON && body != null && !hasHeader(args, "content-type")) {
|
1499
|
-
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");
|
1500
|
-
}
|
1501
|
-
if (typeof args.deserialize !== "function" && !hasHeader(args, "accept")) {
|
1502
|
-
xhr.setRequestHeader("Accept", "application/json, text/*");
|
1503
|
-
}
|
1504
|
-
if (args.withCredentials)
|
1505
|
-
xhr.withCredentials = args.withCredentials;
|
1506
|
-
if (args.timeout)
|
1507
|
-
xhr.timeout = args.timeout;
|
1508
|
-
xhr.responseType = responseType;
|
1509
|
-
for (var key in args.headers) {
|
1510
|
-
if (hasOwn.call(args.headers, key)) {
|
1511
|
-
xhr.setRequestHeader(key, args.headers[key]);
|
1512
|
-
}
|
1513
|
-
}
|
1514
|
-
xhr.onreadystatechange = function(ev) {
|
1515
|
-
if (aborted)
|
1516
|
-
return;
|
1517
|
-
if (ev.target.readyState === 4) {
|
1518
|
-
try {
|
1519
|
-
var success = ev.target.status >= 200 && ev.target.status < 300 || ev.target.status === 304 || /^file:\/\//i.test(url);
|
1520
|
-
var response = ev.target.response, message;
|
1521
|
-
if (responseType === "json") {
|
1522
|
-
if (!ev.target.responseType && typeof args.extract !== "function") {
|
1523
|
-
try {
|
1524
|
-
response = JSON.parse(ev.target.responseText);
|
1525
|
-
} catch (e) {
|
1526
|
-
response = null;
|
1527
|
-
}
|
1528
|
-
}
|
1529
|
-
} else if (!responseType || responseType === "text") {
|
1530
|
-
if (response == null)
|
1531
|
-
response = ev.target.responseText;
|
1532
|
-
}
|
1533
|
-
if (typeof args.extract === "function") {
|
1534
|
-
response = args.extract(ev.target, args);
|
1535
|
-
success = true;
|
1536
|
-
} else if (typeof args.deserialize === "function") {
|
1537
|
-
response = args.deserialize(response);
|
1538
|
-
}
|
1539
|
-
if (success)
|
1540
|
-
resolve(response);
|
1541
|
-
else {
|
1542
|
-
var completeErrorResponse = function() {
|
1543
|
-
try {
|
1544
|
-
message = ev.target.responseText;
|
1545
|
-
} catch (e) {
|
1546
|
-
message = response;
|
1547
|
-
}
|
1548
|
-
var error = new Error(message);
|
1549
|
-
error.code = ev.target.status;
|
1550
|
-
error.response = response;
|
1551
|
-
reject(error);
|
1552
|
-
};
|
1553
|
-
if (xhr.status === 0) {
|
1554
|
-
setTimeout(function() {
|
1555
|
-
if (isTimeout)
|
1556
|
-
return;
|
1557
|
-
completeErrorResponse();
|
1558
|
-
});
|
1559
|
-
} else
|
1560
|
-
completeErrorResponse();
|
1561
|
-
}
|
1562
|
-
} catch (e) {
|
1563
|
-
reject(e);
|
1564
|
-
}
|
1565
|
-
}
|
1566
|
-
};
|
1567
|
-
xhr.ontimeout = function(ev) {
|
1568
|
-
isTimeout = true;
|
1569
|
-
var error = new Error("Request timed out");
|
1570
|
-
error.code = ev.target.status;
|
1571
|
-
reject(error);
|
1572
|
-
};
|
1573
|
-
if (typeof args.config === "function") {
|
1574
|
-
xhr = args.config(xhr, args, url) || xhr;
|
1575
|
-
if (xhr !== original) {
|
1576
|
-
replacedAbort = xhr.abort;
|
1577
|
-
xhr.abort = function() {
|
1578
|
-
aborted = true;
|
1579
|
-
replacedAbort.call(this);
|
1580
|
-
};
|
1581
|
-
}
|
1582
|
-
}
|
1583
|
-
if (body == null)
|
1584
|
-
xhr.send();
|
1585
|
-
else if (typeof args.serialize === "function")
|
1586
|
-
xhr.send(args.serialize(body));
|
1587
|
-
else if (body instanceof $window.FormData || body instanceof $window.URLSearchParams)
|
1588
|
-
xhr.send(body);
|
1589
|
-
else
|
1590
|
-
xhr.send(JSON.stringify(body));
|
1591
|
-
}),
|
1592
|
-
jsonp: makeRequest(function(url, args, resolve, reject) {
|
1593
|
-
var callbackName = args.callbackName || "_mithril_" + Math.round(Math.random() * 1e16) + "_" + callbackCount++;
|
1594
|
-
var script = $window.document.createElement("script");
|
1595
|
-
$window[callbackName] = function(data) {
|
1596
|
-
delete $window[callbackName];
|
1597
|
-
script.parentNode.removeChild(script);
|
1598
|
-
resolve(data);
|
1599
|
-
};
|
1600
|
-
script.onerror = function() {
|
1601
|
-
delete $window[callbackName];
|
1602
|
-
script.parentNode.removeChild(script);
|
1603
|
-
reject(new Error("JSONP request failed"));
|
1604
|
-
};
|
1605
|
-
script.src = url + (url.indexOf("?") < 0 ? "?" : "&") + encodeURIComponent(args.callbackKey || "callback") + "=" + encodeURIComponent(callbackName);
|
1606
|
-
$window.document.documentElement.appendChild(script);
|
1607
|
-
})
|
1608
|
-
};
|
1609
|
-
};
|
1610
|
-
}
|
1611
|
-
});
|
1612
|
-
|
1613
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/request.js
|
1614
|
-
var require_request2 = __commonJS({
|
1615
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/request.js"(exports, module) {
|
1616
|
-
"use strict";
|
1617
|
-
var PromisePolyfill = require_promise();
|
1618
|
-
var mountRedraw = require_mount_redraw2();
|
1619
|
-
module.exports = require_request()(typeof window !== "undefined" ? window : null, PromisePolyfill, mountRedraw.redraw);
|
1620
|
-
}
|
1621
|
-
});
|
1622
|
-
|
1623
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/querystring/parse.js
|
1624
|
-
var require_parse = __commonJS({
|
1625
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/querystring/parse.js"(exports, module) {
|
1626
|
-
"use strict";
|
1627
|
-
function decodeURIComponentSave(str) {
|
1628
|
-
try {
|
1629
|
-
return decodeURIComponent(str);
|
1630
|
-
} catch (err) {
|
1631
|
-
return str;
|
1632
|
-
}
|
1633
|
-
}
|
1634
|
-
module.exports = function(string) {
|
1635
|
-
if (string === "" || string == null)
|
1636
|
-
return {};
|
1637
|
-
if (string.charAt(0) === "?")
|
1638
|
-
string = string.slice(1);
|
1639
|
-
var entries = string.split("&"), counters = {}, data = {};
|
1640
|
-
for (var i = 0; i < entries.length; i++) {
|
1641
|
-
var entry = entries[i].split("=");
|
1642
|
-
var key = decodeURIComponentSave(entry[0]);
|
1643
|
-
var value = entry.length === 2 ? decodeURIComponentSave(entry[1]) : "";
|
1644
|
-
if (value === "true")
|
1645
|
-
value = true;
|
1646
|
-
else if (value === "false")
|
1647
|
-
value = false;
|
1648
|
-
var levels = key.split(/\]\[?|\[/);
|
1649
|
-
var cursor = data;
|
1650
|
-
if (key.indexOf("[") > -1)
|
1651
|
-
levels.pop();
|
1652
|
-
for (var j = 0; j < levels.length; j++) {
|
1653
|
-
var level = levels[j], nextLevel = levels[j + 1];
|
1654
|
-
var isNumber = nextLevel == "" || !isNaN(parseInt(nextLevel, 10));
|
1655
|
-
if (level === "") {
|
1656
|
-
var key = levels.slice(0, j).join();
|
1657
|
-
if (counters[key] == null) {
|
1658
|
-
counters[key] = Array.isArray(cursor) ? cursor.length : 0;
|
1659
|
-
}
|
1660
|
-
level = counters[key]++;
|
1661
|
-
} else if (level === "__proto__")
|
1662
|
-
break;
|
1663
|
-
if (j === levels.length - 1)
|
1664
|
-
cursor[level] = value;
|
1665
|
-
else {
|
1666
|
-
var desc = Object.getOwnPropertyDescriptor(cursor, level);
|
1667
|
-
if (desc != null)
|
1668
|
-
desc = desc.value;
|
1669
|
-
if (desc == null)
|
1670
|
-
cursor[level] = desc = isNumber ? [] : {};
|
1671
|
-
cursor = desc;
|
1672
|
-
}
|
1673
|
-
}
|
1674
|
-
}
|
1675
|
-
return data;
|
1676
|
-
};
|
1677
|
-
}
|
1678
|
-
});
|
1679
|
-
|
1680
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/pathname/parse.js
|
1681
|
-
var require_parse2 = __commonJS({
|
1682
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/pathname/parse.js"(exports, module) {
|
1683
|
-
"use strict";
|
1684
|
-
var parseQueryString = require_parse();
|
1685
|
-
module.exports = function(url) {
|
1686
|
-
var queryIndex = url.indexOf("?");
|
1687
|
-
var hashIndex = url.indexOf("#");
|
1688
|
-
var queryEnd = hashIndex < 0 ? url.length : hashIndex;
|
1689
|
-
var pathEnd = queryIndex < 0 ? queryEnd : queryIndex;
|
1690
|
-
var path = url.slice(0, pathEnd).replace(/\/{2,}/g, "/");
|
1691
|
-
if (!path)
|
1692
|
-
path = "/";
|
1693
|
-
else {
|
1694
|
-
if (path[0] !== "/")
|
1695
|
-
path = "/" + path;
|
1696
|
-
if (path.length > 1 && path[path.length - 1] === "/")
|
1697
|
-
path = path.slice(0, -1);
|
1698
|
-
}
|
1699
|
-
return {
|
1700
|
-
path,
|
1701
|
-
params: queryIndex < 0 ? {} : parseQueryString(url.slice(queryIndex + 1, queryEnd))
|
1702
|
-
};
|
1703
|
-
};
|
1704
|
-
}
|
1705
|
-
});
|
1706
|
-
|
1707
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/pathname/compileTemplate.js
|
1708
|
-
var require_compileTemplate = __commonJS({
|
1709
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/pathname/compileTemplate.js"(exports, module) {
|
1710
|
-
"use strict";
|
1711
|
-
var parsePathname = require_parse2();
|
1712
|
-
module.exports = function(template) {
|
1713
|
-
var templateData = parsePathname(template);
|
1714
|
-
var templateKeys = Object.keys(templateData.params);
|
1715
|
-
var keys = [];
|
1716
|
-
var regexp = new RegExp("^" + templateData.path.replace(
|
1717
|
-
// I escape literal text so people can use things like `:file.:ext` or
|
1718
|
-
// `:lang-:locale` in routes. This is all merged into one pass so I
|
1719
|
-
// don't also accidentally escape `-` and make it harder to detect it to
|
1720
|
-
// ban it from template parameters.
|
1721
|
-
/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,
|
1722
|
-
function(m2, key, extra) {
|
1723
|
-
if (key == null)
|
1724
|
-
return "\\" + m2;
|
1725
|
-
keys.push({ k: key, r: extra === "..." });
|
1726
|
-
if (extra === "...")
|
1727
|
-
return "(.*)";
|
1728
|
-
if (extra === ".")
|
1729
|
-
return "([^/]+)\\.";
|
1730
|
-
return "([^/]+)" + (extra || "");
|
1731
|
-
}
|
1732
|
-
) + "$");
|
1733
|
-
return function(data) {
|
1734
|
-
for (var i = 0; i < templateKeys.length; i++) {
|
1735
|
-
if (templateData.params[templateKeys[i]] !== data.params[templateKeys[i]])
|
1736
|
-
return false;
|
1737
|
-
}
|
1738
|
-
if (!keys.length)
|
1739
|
-
return regexp.test(data.path);
|
1740
|
-
var values = regexp.exec(data.path);
|
1741
|
-
if (values == null)
|
1742
|
-
return false;
|
1743
|
-
for (var i = 0; i < keys.length; i++) {
|
1744
|
-
data.params[keys[i].k] = keys[i].r ? values[i + 1] : decodeURIComponent(values[i + 1]);
|
1745
|
-
}
|
1746
|
-
return true;
|
1747
|
-
};
|
1748
|
-
};
|
1749
|
-
}
|
1750
|
-
});
|
1751
|
-
|
1752
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/util/censor.js
|
1753
|
-
var require_censor = __commonJS({
|
1754
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/util/censor.js"(exports, module) {
|
1755
|
-
"use strict";
|
1756
|
-
var hasOwn = require_hasOwn();
|
1757
|
-
var magic = new RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");
|
1758
|
-
module.exports = function(attrs, extras) {
|
1759
|
-
var result = {};
|
1760
|
-
if (extras != null) {
|
1761
|
-
for (var key in attrs) {
|
1762
|
-
if (hasOwn.call(attrs, key) && !magic.test(key) && extras.indexOf(key) < 0) {
|
1763
|
-
result[key] = attrs[key];
|
1764
|
-
}
|
1765
|
-
}
|
1766
|
-
} else {
|
1767
|
-
for (var key in attrs) {
|
1768
|
-
if (hasOwn.call(attrs, key) && !magic.test(key)) {
|
1769
|
-
result[key] = attrs[key];
|
1770
|
-
}
|
1771
|
-
}
|
1772
|
-
}
|
1773
|
-
return result;
|
1774
|
-
};
|
1775
|
-
}
|
1776
|
-
});
|
1777
|
-
|
1778
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/api/router.js
|
1779
|
-
var require_router = __commonJS({
|
1780
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/api/router.js"(exports, module) {
|
1781
|
-
"use strict";
|
1782
|
-
var Vnode = require_vnode();
|
1783
|
-
var m2 = require_hyperscript();
|
1784
|
-
var Promise2 = require_promise();
|
1785
|
-
var buildPathname = require_build2();
|
1786
|
-
var parsePathname = require_parse2();
|
1787
|
-
var compileTemplate = require_compileTemplate();
|
1788
|
-
var assign = require_assign();
|
1789
|
-
var censor = require_censor();
|
1790
|
-
var sentinel = {};
|
1791
|
-
function decodeURIComponentSave(component) {
|
1792
|
-
try {
|
1793
|
-
return decodeURIComponent(component);
|
1794
|
-
} catch (e) {
|
1795
|
-
return component;
|
1796
|
-
}
|
1797
|
-
}
|
1798
|
-
module.exports = function($window, mountRedraw) {
|
1799
|
-
var callAsync = $window == null ? null : typeof $window.setImmediate === "function" ? $window.setImmediate : $window.setTimeout;
|
1800
|
-
var p = Promise2.resolve();
|
1801
|
-
var scheduled = false;
|
1802
|
-
var ready = false;
|
1803
|
-
var state = 0;
|
1804
|
-
var compiled, fallbackRoute;
|
1805
|
-
var currentResolver = sentinel, component, attrs, currentPath, lastUpdate;
|
1806
|
-
var RouterRoot = {
|
1807
|
-
onbeforeupdate: function() {
|
1808
|
-
state = state ? 2 : 1;
|
1809
|
-
return !(!state || sentinel === currentResolver);
|
1810
|
-
},
|
1811
|
-
onremove: function() {
|
1812
|
-
$window.removeEventListener("popstate", fireAsync, false);
|
1813
|
-
$window.removeEventListener("hashchange", resolveRoute, false);
|
1814
|
-
},
|
1815
|
-
view: function() {
|
1816
|
-
if (!state || sentinel === currentResolver)
|
1817
|
-
return;
|
1818
|
-
var vnode = [Vnode(component, attrs.key, attrs)];
|
1819
|
-
if (currentResolver)
|
1820
|
-
vnode = currentResolver.render(vnode[0]);
|
1821
|
-
return vnode;
|
1822
|
-
}
|
1823
|
-
};
|
1824
|
-
var SKIP = route.SKIP = {};
|
1825
|
-
function resolveRoute() {
|
1826
|
-
scheduled = false;
|
1827
|
-
var prefix = $window.location.hash;
|
1828
|
-
if (route.prefix[0] !== "#") {
|
1829
|
-
prefix = $window.location.search + prefix;
|
1830
|
-
if (route.prefix[0] !== "?") {
|
1831
|
-
prefix = $window.location.pathname + prefix;
|
1832
|
-
if (prefix[0] !== "/")
|
1833
|
-
prefix = "/" + prefix;
|
1834
|
-
}
|
1835
|
-
}
|
1836
|
-
var path = prefix.concat().replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponentSave).slice(route.prefix.length);
|
1837
|
-
var data = parsePathname(path);
|
1838
|
-
assign(data.params, $window.history.state);
|
1839
|
-
function reject(e) {
|
1840
|
-
console.error(e);
|
1841
|
-
setPath(fallbackRoute, null, { replace: true });
|
1842
|
-
}
|
1843
|
-
loop(0);
|
1844
|
-
function loop(i) {
|
1845
|
-
for (; i < compiled.length; i++) {
|
1846
|
-
if (compiled[i].check(data)) {
|
1847
|
-
var payload = compiled[i].component;
|
1848
|
-
var matchedRoute = compiled[i].route;
|
1849
|
-
var localComp = payload;
|
1850
|
-
var update = lastUpdate = function(comp) {
|
1851
|
-
if (update !== lastUpdate)
|
1852
|
-
return;
|
1853
|
-
if (comp === SKIP)
|
1854
|
-
return loop(i + 1);
|
1855
|
-
component = comp != null && (typeof comp.view === "function" || typeof comp === "function") ? comp : "div";
|
1856
|
-
attrs = data.params, currentPath = path, lastUpdate = null;
|
1857
|
-
currentResolver = payload.render ? payload : null;
|
1858
|
-
if (state === 2)
|
1859
|
-
mountRedraw.redraw();
|
1860
|
-
else {
|
1861
|
-
state = 2;
|
1862
|
-
mountRedraw.redraw.sync();
|
1863
|
-
}
|
1864
|
-
};
|
1865
|
-
if (payload.view || typeof payload === "function") {
|
1866
|
-
payload = {};
|
1867
|
-
update(localComp);
|
1868
|
-
} else if (payload.onmatch) {
|
1869
|
-
p.then(function() {
|
1870
|
-
return payload.onmatch(data.params, path, matchedRoute);
|
1871
|
-
}).then(update, path === fallbackRoute ? null : reject);
|
1872
|
-
} else
|
1873
|
-
update("div");
|
1874
|
-
return;
|
1875
|
-
}
|
1876
|
-
}
|
1877
|
-
if (path === fallbackRoute) {
|
1878
|
-
throw new Error("Could not resolve default route " + fallbackRoute + ".");
|
1879
|
-
}
|
1880
|
-
setPath(fallbackRoute, null, { replace: true });
|
1881
|
-
}
|
1882
|
-
}
|
1883
|
-
function fireAsync() {
|
1884
|
-
if (!scheduled) {
|
1885
|
-
scheduled = true;
|
1886
|
-
callAsync(resolveRoute);
|
1887
|
-
}
|
1888
|
-
}
|
1889
|
-
function setPath(path, data, options) {
|
1890
|
-
path = buildPathname(path, data);
|
1891
|
-
if (ready) {
|
1892
|
-
fireAsync();
|
1893
|
-
var state2 = options ? options.state : null;
|
1894
|
-
var title = options ? options.title : null;
|
1895
|
-
if (options && options.replace)
|
1896
|
-
$window.history.replaceState(state2, title, route.prefix + path);
|
1897
|
-
else
|
1898
|
-
$window.history.pushState(state2, title, route.prefix + path);
|
1899
|
-
} else {
|
1900
|
-
$window.location.href = route.prefix + path;
|
1901
|
-
}
|
1902
|
-
}
|
1903
|
-
function route(root, defaultRoute, routes) {
|
1904
|
-
if (!root)
|
1905
|
-
throw new TypeError("DOM element being rendered to does not exist.");
|
1906
|
-
compiled = Object.keys(routes).map(function(route2) {
|
1907
|
-
if (route2[0] !== "/")
|
1908
|
-
throw new SyntaxError("Routes must start with a '/'.");
|
1909
|
-
if (/:([^\/\.-]+)(\.{3})?:/.test(route2)) {
|
1910
|
-
throw new SyntaxError("Route parameter names must be separated with either '/', '.', or '-'.");
|
1911
|
-
}
|
1912
|
-
return {
|
1913
|
-
route: route2,
|
1914
|
-
component: routes[route2],
|
1915
|
-
check: compileTemplate(route2)
|
1916
|
-
};
|
1917
|
-
});
|
1918
|
-
fallbackRoute = defaultRoute;
|
1919
|
-
if (defaultRoute != null) {
|
1920
|
-
var defaultData = parsePathname(defaultRoute);
|
1921
|
-
if (!compiled.some(function(i) {
|
1922
|
-
return i.check(defaultData);
|
1923
|
-
})) {
|
1924
|
-
throw new ReferenceError("Default route doesn't match any known routes.");
|
1925
|
-
}
|
1926
|
-
}
|
1927
|
-
if (typeof $window.history.pushState === "function") {
|
1928
|
-
$window.addEventListener("popstate", fireAsync, false);
|
1929
|
-
} else if (route.prefix[0] === "#") {
|
1930
|
-
$window.addEventListener("hashchange", resolveRoute, false);
|
1931
|
-
}
|
1932
|
-
ready = true;
|
1933
|
-
mountRedraw.mount(root, RouterRoot);
|
1934
|
-
resolveRoute();
|
1935
|
-
}
|
1936
|
-
route.set = function(path, data, options) {
|
1937
|
-
if (lastUpdate != null) {
|
1938
|
-
options = options || {};
|
1939
|
-
options.replace = true;
|
1940
|
-
}
|
1941
|
-
lastUpdate = null;
|
1942
|
-
setPath(path, data, options);
|
1943
|
-
};
|
1944
|
-
route.get = function() {
|
1945
|
-
return currentPath;
|
1946
|
-
};
|
1947
|
-
route.prefix = "#!";
|
1948
|
-
route.Link = {
|
1949
|
-
view: function(vnode) {
|
1950
|
-
var child = m2(
|
1951
|
-
vnode.attrs.selector || "a",
|
1952
|
-
censor(vnode.attrs, ["options", "params", "selector", "onclick"]),
|
1953
|
-
vnode.children
|
1954
|
-
);
|
1955
|
-
var options, onclick, href;
|
1956
|
-
if (child.attrs.disabled = Boolean(child.attrs.disabled)) {
|
1957
|
-
child.attrs.href = null;
|
1958
|
-
child.attrs["aria-disabled"] = "true";
|
1959
|
-
} else {
|
1960
|
-
options = vnode.attrs.options;
|
1961
|
-
onclick = vnode.attrs.onclick;
|
1962
|
-
href = buildPathname(child.attrs.href, vnode.attrs.params);
|
1963
|
-
child.attrs.href = route.prefix + href;
|
1964
|
-
child.attrs.onclick = function(e) {
|
1965
|
-
var result;
|
1966
|
-
if (typeof onclick === "function") {
|
1967
|
-
result = onclick.call(e.currentTarget, e);
|
1968
|
-
} else if (onclick == null || typeof onclick !== "object") {
|
1969
|
-
} else if (typeof onclick.handleEvent === "function") {
|
1970
|
-
onclick.handleEvent(e);
|
1971
|
-
}
|
1972
|
-
if (
|
1973
|
-
// Skip if `onclick` prevented default
|
1974
|
-
result !== false && !e.defaultPrevented && // Ignore everything but left clicks
|
1975
|
-
(e.button === 0 || e.which === 0 || e.which === 1) && // Let the browser handle `target=_blank`, etc.
|
1976
|
-
(!e.currentTarget.target || e.currentTarget.target === "_self") && // No modifier keys
|
1977
|
-
!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey
|
1978
|
-
) {
|
1979
|
-
e.preventDefault();
|
1980
|
-
e.redraw = false;
|
1981
|
-
route.set(href, null, options);
|
1982
|
-
}
|
1983
|
-
};
|
1984
|
-
}
|
1985
|
-
return child;
|
1986
|
-
}
|
1987
|
-
};
|
1988
|
-
route.param = function(key) {
|
1989
|
-
return attrs && key != null ? attrs[key] : attrs;
|
1990
|
-
};
|
1991
|
-
return route;
|
1992
|
-
};
|
1993
|
-
}
|
1994
|
-
});
|
1995
|
-
|
1996
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/route.js
|
1997
|
-
var require_route = __commonJS({
|
1998
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/route.js"(exports, module) {
|
1999
|
-
"use strict";
|
2000
|
-
var mountRedraw = require_mount_redraw2();
|
2001
|
-
module.exports = require_router()(typeof window !== "undefined" ? window : null, mountRedraw);
|
2002
|
-
}
|
2003
|
-
});
|
2004
|
-
|
2005
|
-
// node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/index.js
|
2006
|
-
var require_mithril = __commonJS({
|
2007
|
-
"node_modules/.pnpm/mithril@2.2.2/node_modules/mithril/index.js"(exports, module) {
|
2008
|
-
"use strict";
|
2009
|
-
var hyperscript = require_hyperscript2();
|
2010
|
-
var request = require_request2();
|
2011
|
-
var mountRedraw = require_mount_redraw2();
|
2012
|
-
var m2 = function m3() {
|
2013
|
-
return hyperscript.apply(this, arguments);
|
2014
|
-
};
|
2015
|
-
m2.m = hyperscript;
|
2016
|
-
m2.trust = hyperscript.trust;
|
2017
|
-
m2.fragment = hyperscript.fragment;
|
2018
|
-
m2.Fragment = "[";
|
2019
|
-
m2.mount = mountRedraw.mount;
|
2020
|
-
m2.route = require_route();
|
2021
|
-
m2.render = require_render2();
|
2022
|
-
m2.redraw = mountRedraw.redraw;
|
2023
|
-
m2.request = request.request;
|
2024
|
-
m2.jsonp = request.jsonp;
|
2025
|
-
m2.parseQueryString = require_parse();
|
2026
|
-
m2.buildQueryString = require_build();
|
2027
|
-
m2.parsePathname = require_parse2();
|
2028
|
-
m2.buildPathname = require_build2();
|
2029
|
-
m2.vnode = require_vnode();
|
2030
|
-
m2.PromisePolyfill = require_polyfill();
|
2031
|
-
m2.censor = require_censor();
|
2032
|
-
module.exports = m2;
|
2033
|
-
}
|
2034
|
-
});
|
2035
|
-
|
2036
|
-
// src/hot/snippet.ts
|
2037
|
-
var import_mithril = __toESM(require_mithril());
|
2038
|
-
(function syncify(syncify) {
|
2039
|
-
window.syncify = window.syncify || { ready: false };
|
2040
|
-
const server = `http://localhost:${syncify.server}/`;
|
2041
|
-
const socket = new WebSocket(`ws://localhost:${syncify.socket}/ws`);
|
2042
|
-
const parser = new DOMParser();
|
2043
|
-
const label = function vnode() {
|
2044
|
-
let state = "Syncify Connected";
|
2045
|
-
const node = document.createElement("div");
|
2046
|
-
const nodeStyle = {
|
2047
|
-
position: "fixed",
|
2048
|
-
left: "0",
|
2049
|
-
bottom: "0",
|
2050
|
-
right: "0",
|
2051
|
-
margin: "0 auto",
|
2052
|
-
display: "flex",
|
2053
|
-
color: "#f7f7f7",
|
2054
|
-
zIndex: "99999",
|
2055
|
-
fontFamily: "system-ui,sans-serif",
|
2056
|
-
textAlign: "center",
|
2057
|
-
justifyContent: "space-around",
|
2058
|
-
alignItems: "center",
|
2059
|
-
fontSize: "11px"
|
2060
|
-
};
|
2061
|
-
const childStyle = {
|
2062
|
-
padding: "5px 20px",
|
2063
|
-
backgroundColor: "#232326",
|
2064
|
-
border: "0.8px solid transparent",
|
2065
|
-
borderRadius: "5px",
|
2066
|
-
borderTopLeftRadius: "0",
|
2067
|
-
borderTopRightRadius: "0",
|
2068
|
-
borderBottomLeftRadius: "0",
|
2069
|
-
borderBottomRightRadius: "0",
|
2070
|
-
borderBottom: "0"
|
2071
|
-
};
|
2072
|
-
const child = { view: () => (0, import_mithril.default)("div", { style: childStyle }, state) };
|
2073
|
-
Object.assign(node.style, nodeStyle);
|
2074
|
-
window.syncify.style = {
|
2075
|
-
parent: (style) => {
|
2076
|
-
Object.assign(node.style, nodeStyle, style);
|
2077
|
-
import_mithril.default.redraw();
|
2078
|
-
},
|
2079
|
-
label: (style) => {
|
2080
|
-
Object.assign(childStyle, style);
|
2081
|
-
import_mithril.default.redraw();
|
2082
|
-
}
|
2083
|
-
};
|
2084
|
-
import_mithril.default.mount(node, child);
|
2085
|
-
return {
|
2086
|
-
get node() {
|
2087
|
-
return node;
|
2088
|
-
},
|
2089
|
-
event: (label2) => {
|
2090
|
-
if (label2 !== void 0)
|
2091
|
-
state = label2;
|
2092
|
-
import_mithril.default.redraw();
|
2093
|
-
return state;
|
2094
|
-
},
|
2095
|
-
render: (dom) => {
|
2096
|
-
dom.append(node);
|
2097
|
-
}
|
2098
|
-
};
|
2099
|
-
}();
|
2100
|
-
const timer = function(mark) {
|
2101
|
-
let timeout = null;
|
2102
|
-
return {
|
2103
|
-
start: () => {
|
2104
|
-
const time = performance.now();
|
2105
|
-
mark.push(time);
|
2106
|
-
},
|
2107
|
-
stop: () => {
|
2108
|
-
if (timeout !== null) {
|
2109
|
-
clearTimeout(timeout);
|
2110
|
-
timeout = null;
|
2111
|
-
}
|
2112
|
-
timeout = setTimeout(() => {
|
2113
|
-
label.event("Waiting for changes...");
|
2114
|
-
timeout = null;
|
2115
|
-
}, 5e3);
|
2116
|
-
const ms = performance.now() - mark.pop();
|
2117
|
-
if (ms < 1e3)
|
2118
|
-
return `${ms.toFixed(0)}ms`;
|
2119
|
-
const s = ms / 1e3;
|
2120
|
-
if (s < 60)
|
2121
|
-
return `${s.toFixed(0)}s ${+ms.toFixed(0).slice(1)}ms`;
|
2122
|
-
const m2 = (s / 60).toFixed(0);
|
2123
|
-
return `${m2}m ${s - 60 * Number(m2)}s ${+ms.toFixed(0).slice(1)}ms`;
|
2124
|
-
}
|
2125
|
-
};
|
2126
|
-
}([]);
|
2127
|
-
function params(url) {
|
2128
|
-
const p = url.lastIndexOf("/") + 1;
|
2129
|
-
const q = url.indexOf("?", p);
|
2130
|
-
return (q > -1 ? url.substring(p, q) : url.substring(p)) + "?v=" + Date.now();
|
2131
|
-
}
|
2132
|
-
;
|
2133
|
-
function assetMatch(src, uri) {
|
2134
|
-
if (typeof uri !== "string")
|
2135
|
-
return false;
|
2136
|
-
return src.slice(src.lastIndexOf("/") + 1).startsWith(uri);
|
2137
|
-
}
|
2138
|
-
;
|
2139
|
-
function stylesheets(dom, uri) {
|
2140
|
-
dom.querySelectorAll("link[rel=stylesheet]").forEach((node) => {
|
2141
|
-
const href = node.getAttribute("href");
|
2142
|
-
if (!assetMatch(href, uri))
|
2143
|
-
return;
|
2144
|
-
node.setAttribute("href", server + params(href));
|
2145
|
-
});
|
2146
|
-
return dom;
|
2147
|
-
}
|
2148
|
-
;
|
2149
|
-
function scripts(dom, uri) {
|
2150
|
-
dom.querySelectorAll("script").forEach((node) => {
|
2151
|
-
if (!node.hasAttribute("src"))
|
2152
|
-
return;
|
2153
|
-
const href = node.getAttribute("src");
|
2154
|
-
if (!assetMatch(href, uri))
|
2155
|
-
return;
|
2156
|
-
const script = document.createElement("script");
|
2157
|
-
script.setAttribute("src", server + params(href));
|
2158
|
-
for (const attr of Array.from(node.attributes)) {
|
2159
|
-
if (attr.nodeName !== "src")
|
2160
|
-
script.setAttribute(attr.nodeName, attr.nodeValue);
|
2161
|
-
}
|
2162
|
-
node.replaceWith(script);
|
2163
|
-
});
|
2164
|
-
return dom;
|
2165
|
-
}
|
2166
|
-
;
|
2167
|
-
function assets(dom) {
|
2168
|
-
scripts(dom);
|
2169
|
-
stylesheets(dom);
|
2170
|
-
return dom;
|
2171
|
-
}
|
2172
|
-
;
|
2173
|
-
function req(uri, type) {
|
2174
|
-
return new Promise(function(resolve, reject) {
|
2175
|
-
const xhr = new XMLHttpRequest();
|
2176
|
-
xhr.responseType = type;
|
2177
|
-
xhr.open("GET", uri);
|
2178
|
-
xhr.setRequestHeader("X-Syncify-Reload", "true");
|
2179
|
-
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
|
2180
|
-
xhr.onload = () => resolve(xhr.response);
|
2181
|
-
xhr.onerror = () => reject(xhr.statusText);
|
2182
|
-
xhr.send();
|
2183
|
-
});
|
2184
|
-
}
|
2185
|
-
;
|
2186
|
-
socket.addEventListener("message", function({ data }) {
|
2187
|
-
if (data === "reload") {
|
2188
|
-
label.event("Refreshing");
|
2189
|
-
return top.location.reload();
|
2190
|
-
} else if (data === "replace") {
|
2191
|
-
timer.start();
|
2192
|
-
label.event("Reloading");
|
2193
|
-
return req(location.href, "text").then((doc) => {
|
2194
|
-
const dom = parser.parseFromString(doc, "text/html");
|
2195
|
-
const newDom = assets(dom);
|
2196
|
-
document.body.replaceWith(newDom.body);
|
2197
|
-
label.render(document.body);
|
2198
|
-
label.event(`Reloaded in ${timer.stop()}`);
|
2199
|
-
});
|
2200
|
-
} else {
|
2201
|
-
timer.start();
|
2202
|
-
const [type, uri] = data.split(",");
|
2203
|
-
if (type === "section") {
|
2204
|
-
label.event(`Reloading Section: ${uri}`);
|
2205
|
-
return req(`${location.pathname}?sections=${uri}`, "json").then((value) => {
|
2206
|
-
const { firstElementChild } = parser.parseFromString(value[uri], "text/html").body;
|
2207
|
-
document.body.querySelector(`#shopify-section-${data}`).replaceWith(firstElementChild);
|
2208
|
-
label.event(`Reloaded in ${timer.stop()}`);
|
2209
|
-
});
|
2210
|
-
} else if (type === "script") {
|
2211
|
-
label.event(`Reloading JavaScript: ${uri}`);
|
2212
|
-
scripts(document, uri);
|
2213
|
-
label.event(`Reloaded in ${timer.stop()}`);
|
2214
|
-
} else if (type === "stylesheet") {
|
2215
|
-
label.event(`Reloading Stylesheet: ${uri}`);
|
2216
|
-
stylesheets(document, uri);
|
2217
|
-
label.event(`Reloaded in ${timer.stop()}`);
|
2218
|
-
}
|
2219
|
-
}
|
2220
|
-
});
|
2221
|
-
window.syncify.assets = () => assets(document);
|
2222
|
-
window.syncify.refresh = () => top.location.reload();
|
2223
|
-
window.syncify.reload = () => req(location.href, "text").then((doc) => {
|
2224
|
-
const dom = parser.parseFromString(doc, "text/html");
|
2225
|
-
document.body.replaceWith(assets(dom).body);
|
2226
|
-
label.render(document.body);
|
2227
|
-
});
|
2228
|
-
document.addEventListener("DOMContentLoaded", () => {
|
2229
|
-
label.render(document.body);
|
2230
|
-
window.syncify.ready = true;
|
2231
|
-
});
|
2232
|
-
})({
|
2233
|
-
server: "{{- server | default: 3000 -}}",
|
2234
|
-
socket: "{{- socket | default: 8089 -}}",
|
2235
|
-
label: '{{- label | default: "visible" -}}'
|
2236
|
-
});
|
2237
|
-
})();
|
2
|
+
"use strict";(()=>{var fr=Object.create;var ft=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var sr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty;var $=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var or=(r,i,a,f)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of ur(i))!cr.call(r,s)&&s!==a&&ft(r,s,{get:()=>i[s],enumerable:!(f=lr(i,s))||f.enumerable});return r};var hr=(r,i,a)=>(a=r!=null?fr(sr(r)):{},or(i||!r||!r.__esModule?ft(a,"default",{value:r,enumerable:!0}):a,r));var ue=$((en,lt)=>{"use strict";function he(r,i,a,f,s,o){return{tag:r,key:i,attrs:a,children:f,text:s,dom:o,domSize:void 0,state:void 0,events:void 0,instance:void 0}}he.normalize=function(r){return Array.isArray(r)?he("[",void 0,void 0,he.normalizeChildren(r),void 0,void 0):r==null||typeof r=="boolean"?null:typeof r=="object"?r:he("#",void 0,void 0,String(r),void 0,void 0)};he.normalizeChildren=function(r){var i=[];if(r.length){for(var a=r[0]!=null&&r[0].key!=null,f=1;f<r.length;f++)if((r[f]!=null&&r[f].key!=null)!==a)throw new TypeError(a&&(r[f]!=null||typeof r[f]=="boolean")?"In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole.":"In fragments, vnodes must either all have keys or none have keys.");for(var f=0;f<r.length;f++)i[f]=he.normalize(r[f])}return i};lt.exports=he});var Be=$((tn,ut)=>{"use strict";var pr=ue();ut.exports=function(){var r=arguments[this],i=this+1,a;if(r==null?r={}:(typeof r!="object"||r.tag!=null||Array.isArray(r))&&(r={},i=this),arguments.length===i+1)a=arguments[i],Array.isArray(a)||(a=[a]);else for(a=[];i<arguments.length;)a.push(arguments[i++]);return pr("",r.key,r,a)}});var ve=$((rn,st)=>{"use strict";st.exports={}.hasOwnProperty});var Ke=$((nn,ht)=>{"use strict";var mr=ue(),yr=Be(),ye=ve(),gr=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,ot={};function ct(r){for(var i in r)if(ye.call(r,i))return!1;return!0}function dr(r){for(var i,a="div",f=[],s={};i=gr.exec(r);){var o=i[1],u=i[2];if(o===""&&u!=="")a=u;else if(o==="#")s.id=u;else if(o===".")f.push(u);else if(i[3][0]==="["){var p=i[6];p&&(p=p.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),i[4]==="class"?f.push(p):s[i[4]]=p===""?p:p||!0}}return f.length>0&&(s.className=f.join(" ")),ot[r]={tag:a,attrs:s}}function wr(r,i){var a=i.attrs,f=ye.call(a,"class"),s=f?a.class:a.className;if(i.tag=r.tag,i.attrs={},!ct(r.attrs)&&!ct(a)){var o={};for(var u in a)ye.call(a,u)&&(o[u]=a[u]);a=o}for(var u in r.attrs)ye.call(r.attrs,u)&&u!=="className"&&!ye.call(a,u)&&(a[u]=r.attrs[u]);(s!=null||r.attrs.className!=null)&&(a.className=s!=null?r.attrs.className!=null?String(r.attrs.className)+" "+String(s):s:r.attrs.className!=null?r.attrs.className:null),f&&(a.class=null);for(var u in a)if(ye.call(a,u)&&u!=="key"){i.attrs=a;break}return i}function br(r){if(r==null||typeof r!="string"&&typeof r!="function"&&typeof r.view!="function")throw Error("The selector must be either a string or a component.");var i=yr.apply(1,arguments);return typeof r=="string"&&(i.children=mr.normalizeChildren(i.children),r!=="[")?wr(ot[r]||dr(r),i):(i.tag=r,i)}ht.exports=br});var mt=$((an,pt)=>{"use strict";var vr=ue();pt.exports=function(r){return r==null&&(r=""),vr("<",void 0,void 0,r,void 0,void 0)}});var gt=$((fn,yt)=>{"use strict";var xr=ue(),Tr=Be();yt.exports=function(){var r=Tr.apply(0,arguments);return r.tag="[",r.children=xr.normalizeChildren(r.children),r}});var wt=$((ln,dt)=>{"use strict";var Xe=Ke();Xe.trust=mt();Xe.fragment=gt();dt.exports=Xe});var Ge=$((un,bt)=>{"use strict";var J=function(r){if(!(this instanceof J))throw new Error("Promise must be called with 'new'.");if(typeof r!="function")throw new TypeError("executor must be a function.");var i=this,a=[],f=[],s=h(a,!0),o=h(f,!1),u=i._instance={resolvers:a,rejectors:f},p=typeof setImmediate=="function"?setImmediate:setTimeout;function h(T,N){return function A(S){var y;try{if(N&&S!=null&&(typeof S=="object"||typeof S=="function")&&typeof(y=S.then)=="function"){if(S===i)throw new TypeError("Promise can't be resolved with itself.");w(y.bind(S))}else p(function(){!N&&T.length===0&&console.error("Possible unhandled promise rejection:",S);for(var m=0;m<T.length;m++)T[m](S);a.length=0,f.length=0,u.state=N,u.retry=function(){A(S)}})}catch(m){o(m)}}}function w(T){var N=0;function A(y){return function(m){N++>0||y(m)}}var S=A(o);try{T(A(s),S)}catch(y){S(y)}}w(r)};J.prototype.then=function(r,i){var a=this,f=a._instance;function s(h,w,T,N){w.push(function(A){if(typeof h!="function")T(A);else try{o(h(A))}catch(S){u&&u(S)}}),typeof f.retry=="function"&&N===f.state&&f.retry()}var o,u,p=new J(function(h,w){o=h,u=w});return s(r,f.resolvers,o,!0),s(i,f.rejectors,u,!1),p};J.prototype.catch=function(r){return this.then(null,r)};J.prototype.finally=function(r){return this.then(function(i){return J.resolve(r()).then(function(){return i})},function(i){return J.resolve(r()).then(function(){return J.reject(i)})})};J.resolve=function(r){return r instanceof J?r:new J(function(i){i(r)})};J.reject=function(r){return new J(function(i,a){a(r)})};J.all=function(r){return new J(function(i,a){var f=r.length,s=0,o=[];if(r.length===0)i([]);else for(var u=0;u<r.length;u++)(function(p){function h(w){s++,o[p]=w,s===f&&i(o)}r[p]!=null&&(typeof r[p]=="object"||typeof r[p]=="function")&&typeof r[p].then=="function"?r[p].then(h,a):h(r[p])})(u)})};J.race=function(r){return new J(function(i,a){for(var f=0;f<r.length;f++)r[f].then(i,a)})};bt.exports=J});var Je=$((sn,Ce)=>{"use strict";var xe=Ge();typeof window<"u"?(typeof window.Promise>"u"?window.Promise=xe:window.Promise.prototype.finally||(window.Promise.prototype.finally=xe.prototype.finally),Ce.exports=window.Promise):typeof global<"u"?(typeof global.Promise>"u"?global.Promise=xe:global.Promise.prototype.finally||(global.Promise.prototype.finally=xe.prototype.finally),Ce.exports=global.Promise):Ce.exports=xe});var xt=$((cn,vt)=>{"use strict";var We=ue();vt.exports=function(r){var i=r&&r.document,a,f={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function s(t){return t.attrs&&t.attrs.xmlns||f[t.tag]}function o(t,e){if(t.state!==e)throw new Error("'vnode.state' must not be modified.")}function u(t){var e=t.state;try{return this.apply(e,arguments)}finally{o(t,e)}}function p(){try{return i.activeElement}catch{return null}}function h(t,e,n,l,c,g,R){for(var j=n;j<l;j++){var v=e[j];v!=null&&w(t,v,c,R,g)}}function w(t,e,n,l,c){var g=e.tag;if(typeof g=="string")switch(e.state={},e.attrs!=null&&ze(e.attrs,e,n),g){case"#":T(t,e,c);break;case"<":A(t,e,l,c);break;case"[":S(t,e,n,l,c);break;default:y(t,e,n,l,c)}else d(t,e,n,l,c)}function T(t,e,n){e.dom=i.createTextNode(e.children),Y(t,e.dom,n)}var N={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function A(t,e,n,l){var c=e.children.match(/^\s*?<(\w+)/im)||[],g=i.createElement(N[c[1]]||"div");n==="http://www.w3.org/2000/svg"?(g.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e.children+"</svg>",g=g.firstChild):g.innerHTML=e.children,e.dom=g.firstChild,e.domSize=g.childNodes.length,e.instance=[];for(var R=i.createDocumentFragment(),j;j=g.firstChild;)e.instance.push(j),R.appendChild(j);Y(t,R,l)}function S(t,e,n,l,c){var g=i.createDocumentFragment();if(e.children!=null){var R=e.children;h(g,R,0,R.length,n,null,l)}e.dom=g.firstChild,e.domSize=g.childNodes.length,Y(t,g,c)}function y(t,e,n,l,c){var g=e.tag,R=e.attrs,j=R&&R.is;l=s(e)||l;var v=l?j?i.createElementNS(l,g,{is:j}):i.createElementNS(l,g):j?i.createElement(g,{is:j}):i.createElement(g);if(e.dom=v,R!=null&&F(e,R,l),Y(t,v,c),!Ae(e)&&e.children!=null){var H=e.children;h(v,H,0,H.length,n,null,l),e.tag==="select"&&R!=null&&se(e,R)}}function m(t,e){var n;if(typeof t.tag.view=="function"){if(t.state=Object.create(t.tag),n=t.state.view,n.$$reentrantLock$$!=null)return;n.$$reentrantLock$$=!0}else{if(t.state=void 0,n=t.tag,n.$$reentrantLock$$!=null)return;n.$$reentrantLock$$=!0,t.state=t.tag.prototype!=null&&typeof t.tag.prototype.view=="function"?new t.tag(t):t.tag(t)}if(ze(t.state,t,e),t.attrs!=null&&ze(t.attrs,t,e),t.instance=We.normalize(u.call(t.state.view,t)),t.instance===t)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}function d(t,e,n,l,c){m(e,n),e.instance!=null?(w(t,e.instance,n,l,c),e.dom=e.instance.dom,e.domSize=e.dom!=null?e.instance.domSize:0):e.domSize=0}function x(t,e,n,l,c,g){if(!(e===n||e==null&&n==null))if(e==null||e.length===0)h(t,n,0,n.length,l,c,g);else if(n==null||n.length===0)le(t,e,0,e.length);else{var R=e[0]!=null&&e[0].key!=null,j=n[0]!=null&&n[0].key!=null,v=0,H=0;if(!R)for(;H<e.length&&e[H]==null;)H++;if(!j)for(;v<n.length&&n[v]==null;)v++;if(R!==j)le(t,e,H,e.length),h(t,n,v,n.length,l,c,g);else if(j){for(var Z=e.length-1,G=n.length-1,qe,k,K,Q,V,Ie;Z>=H&&G>=v&&(Q=e[Z],V=n[G],Q.key===V.key);)Q!==V&&q(t,Q,V,l,c,g),V.dom!=null&&(c=V.dom),Z--,G--;for(;Z>=H&&G>=v&&(k=e[H],K=n[v],k.key===K.key);)H++,v++,k!==K&&q(t,k,K,l,U(e,H,c),g);for(;Z>=H&&G>=v&&!(v===G||k.key!==V.key||Q.key!==K.key);)Ie=U(e,H,c),te(t,Q,Ie),Q!==K&&q(t,Q,K,l,Ie,g),++v<=--G&&te(t,k,c),k!==V&&q(t,k,V,l,c,g),V.dom!=null&&(c=V.dom),H++,Z--,Q=e[Z],V=n[G],k=e[H],K=n[v];for(;Z>=H&&G>=v&&Q.key===V.key;)Q!==V&&q(t,Q,V,l,c,g),V.dom!=null&&(c=V.dom),Z--,G--,Q=e[Z],V=n[G];if(v>G)le(t,e,H,Z+1);else if(H>Z)h(t,n,v,G+1,l,c,g);else{var ar=c,at=G-v+1,be=new Array(at),_e=0,B=0,Fe=2147483647,$e=0,qe,Ve;for(B=0;B<at;B++)be[B]=-1;for(B=G;B>=v;B--){qe==null&&(qe=z(e,H,Z+1)),V=n[B];var me=qe[V.key];me!=null&&(Fe=me<Fe?me:-1,be[B-v]=me,Q=e[me],e[me]=null,Q!==V&&q(t,Q,V,l,c,g),V.dom!=null&&(c=V.dom),$e++)}if(c=ar,$e!==Z-H+1&&le(t,e,H,Z+1),$e===0)h(t,n,v,G+1,l,c,g);else if(Fe===-1)for(Ve=X(be),_e=Ve.length-1,B=G;B>=v;B--)K=n[B],be[B-v]===-1?w(t,K,l,g,c):Ve[_e]===B-v?_e--:te(t,K,c),K.dom!=null&&(c=n[B].dom);else for(B=G;B>=v;B--)K=n[B],be[B-v]===-1&&w(t,K,l,g,c),K.dom!=null&&(c=n[B].dom)}}else{var He=e.length<n.length?e.length:n.length;for(v=v<H?v:H;v<He;v++)k=e[v],K=n[v],!(k===K||k==null&&K==null)&&(k==null?w(t,K,l,g,U(e,v+1,c)):K==null?C(t,k):q(t,k,K,l,U(e,v+1,c),g));e.length>He&&le(t,e,v,e.length),n.length>He&&h(t,n,v,n.length,l,c,g)}}}function q(t,e,n,l,c,g){var R=e.tag,j=n.tag;if(R===j){if(n.state=e.state,n.events=e.events,ir(n,e))return;if(typeof R=="string")switch(n.attrs!=null&&Ue(n.attrs,n,l),R){case"#":M(e,n);break;case"<":b(t,e,n,g,c);break;case"[":D(t,e,n,l,c,g);break;default:P(e,n,l,g)}else I(t,e,n,l,c,g)}else C(t,e),w(t,n,l,g,c)}function M(t,e){t.children.toString()!==e.children.toString()&&(t.dom.nodeValue=e.children),e.dom=t.dom}function b(t,e,n,l,c){e.children!==n.children?(O(t,e),A(t,n,l,c)):(n.dom=e.dom,n.domSize=e.domSize,n.instance=e.instance)}function D(t,e,n,l,c,g){x(t,e.children,n.children,l,c,g);var R=0,j=n.children;if(n.dom=null,j!=null){for(var v=0;v<j.length;v++){var H=j[v];H!=null&&H.dom!=null&&(n.dom==null&&(n.dom=H.dom),R+=H.domSize||1)}R!==1&&(n.domSize=R)}}function P(t,e,n,l){var c=e.dom=t.dom;l=s(e)||l,e.tag==="textarea"&&e.attrs==null&&(e.attrs={}),pe(e,t.attrs,e.attrs,l),Ae(e)||x(c,t.children,e.children,n,null,l)}function I(t,e,n,l,c,g){if(n.instance=We.normalize(u.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");Ue(n.state,n,l),n.attrs!=null&&Ue(n.attrs,n,l),n.instance!=null?(e.instance==null?w(t,n.instance,l,g,c):q(t,e.instance,n.instance,l,c,g),n.dom=n.instance.dom,n.domSize=n.instance.domSize):e.instance!=null?(C(t,e.instance),n.dom=void 0,n.domSize=0):(n.dom=e.dom,n.domSize=e.domSize)}function z(t,e,n){for(var l=Object.create(null);e<n;e++){var c=t[e];if(c!=null){var g=c.key;g!=null&&(l[g]=e)}}return l}var E=[];function X(t){for(var e=[0],n=0,l=0,c=0,g=E.length=t.length,c=0;c<g;c++)E[c]=t[c];for(var c=0;c<g;++c)if(t[c]!==-1){var R=e[e.length-1];if(t[R]<t[c]){E[c]=R,e.push(c);continue}for(n=0,l=e.length-1;n<l;){var j=(n>>>1)+(l>>>1)+(n&l&1);t[e[j]]<t[c]?n=j+1:l=j}t[c]<t[e[n]]&&(n>0&&(E[c]=e[n-1]),e[n]=c)}for(n=e.length,l=e[n-1];n-- >0;)e[n]=l,l=E[l];return E.length=0,e}function U(t,e,n){for(;e<t.length;e++)if(t[e]!=null&&t[e].dom!=null)return t[e].dom;return n}function te(t,e,n){var l=i.createDocumentFragment();ne(t,l,e),Y(t,l,n)}function ne(t,e,n){for(;n.dom!=null&&n.dom.parentNode===t;){if(typeof n.tag!="string"){if(n=n.instance,n!=null)continue}else if(n.tag==="<")for(var l=0;l<n.instance.length;l++)e.appendChild(n.instance[l]);else if(n.tag!=="[")e.appendChild(n.dom);else if(n.children.length===1){if(n=n.children[0],n!=null)continue}else for(var l=0;l<n.children.length;l++){var c=n.children[l];c!=null&&ne(t,e,c)}break}}function Y(t,e,n){n!=null?t.insertBefore(e,n):t.appendChild(e)}function Ae(t){if(t.attrs==null||t.attrs.contenteditable==null&&t.attrs.contentEditable==null)return!1;var e=t.children;if(e!=null&&e.length===1&&e[0].tag==="<"){var n=e[0].children;t.dom.innerHTML!==n&&(t.dom.innerHTML=n)}else if(e!=null&&e.length!==0)throw new Error("Child node of a contenteditable must be trusted.");return!0}function le(t,e,n,l){for(var c=n;c<l;c++){var g=e[c];g!=null&&C(t,g)}}function C(t,e){var n=0,l=e.state,c,g;if(typeof e.tag!="string"&&typeof e.state.onbeforeremove=="function"){var R=u.call(e.state.onbeforeremove,e);R!=null&&typeof R.then=="function"&&(n=1,c=R)}if(e.attrs&&typeof e.attrs.onbeforeremove=="function"){var R=u.call(e.attrs.onbeforeremove,e);R!=null&&typeof R.then=="function"&&(n|=2,g=R)}if(o(e,l),!n)L(e),_(t,e);else{if(c!=null){var j=function(){n&1&&(n&=2,n||v())};c.then(j,j)}if(g!=null){var j=function(){n&2&&(n&=1,n||v())};g.then(j,j)}}function v(){o(e,l),L(e),_(t,e)}}function O(t,e){for(var n=0;n<e.instance.length;n++)t.removeChild(e.instance[n])}function _(t,e){for(;e.dom!=null&&e.dom.parentNode===t;){if(typeof e.tag!="string"){if(e=e.instance,e!=null)continue}else if(e.tag==="<")O(t,e);else{if(e.tag!=="["&&(t.removeChild(e.dom),!Array.isArray(e.children)))break;if(e.children.length===1){if(e=e.children[0],e!=null)continue}else for(var n=0;n<e.children.length;n++){var l=e.children[n];l!=null&&_(t,l)}}break}}function L(t){if(typeof t.tag!="string"&&typeof t.state.onremove=="function"&&u.call(t.state.onremove,t),t.attrs&&typeof t.attrs.onremove=="function"&&u.call(t.attrs.onremove,t),typeof t.tag!="string")t.instance!=null&&L(t.instance);else{var e=t.children;if(Array.isArray(e))for(var n=0;n<e.length;n++){var l=e[n];l!=null&&L(l)}}}function F(t,e,n){t.tag==="input"&&e.type!=null&&t.dom.setAttribute("type",e.type);var l=e!=null&&t.tag==="input"&&e.type==="file";for(var c in e)ie(t,c,null,e[c],n,l)}function ie(t,e,n,l,c,g){if(!(e==="key"||e==="is"||l==null||oe(e)||n===l&&!fe(t,e)&&typeof l!="object"||e==="type"&&t.tag==="input")){if(e[0]==="o"&&e[1]==="n")return it(t,e,l);if(e.slice(0,6)==="xlink:")t.dom.setAttributeNS("http://www.w3.org/1999/xlink",e.slice(6),l);else if(e==="style")nt(t.dom,n,l);else if(re(t,e,c)){if(e==="value"){if((t.tag==="input"||t.tag==="textarea")&&t.dom.value===""+l&&(g||t.dom===p())||t.tag==="select"&&n!==null&&t.dom.value===""+l||t.tag==="option"&&n!==null&&t.dom.value===""+l)return;if(g&&""+l!=""){console.error("`value` is read-only on file inputs!");return}}t.dom[e]=l}else typeof l=="boolean"?l?t.dom.setAttribute(e,""):t.dom.removeAttribute(e):t.dom.setAttribute(e==="className"?"class":e,l)}}function ae(t,e,n,l){if(!(e==="key"||e==="is"||n==null||oe(e)))if(e[0]==="o"&&e[1]==="n")it(t,e,void 0);else if(e==="style")nt(t.dom,n,null);else if(re(t,e,l)&&e!=="className"&&e!=="title"&&!(e==="value"&&(t.tag==="option"||t.tag==="select"&&t.dom.selectedIndex===-1&&t.dom===p()))&&!(t.tag==="input"&&e==="type"))t.dom[e]=null;else{var c=e.indexOf(":");c!==-1&&(e=e.slice(c+1)),n!==!1&&t.dom.removeAttribute(e==="className"?"class":e)}}function se(t,e){if("value"in e)if(e.value===null)t.dom.selectedIndex!==-1&&(t.dom.value=null);else{var n=""+e.value;(t.dom.value!==n||t.dom.selectedIndex===-1)&&(t.dom.value=n)}"selectedIndex"in e&&ie(t,"selectedIndex",null,e.selectedIndex,void 0)}function pe(t,e,n,l){if(e&&e===n&&console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major"),n!=null){t.tag==="input"&&n.type!=null&&t.dom.setAttribute("type",n.type);var c=t.tag==="input"&&n.type==="file";for(var g in n)ie(t,g,e&&e[g],n[g],l,c)}var R;if(e!=null)for(var g in e)(R=e[g])!=null&&(n==null||n[g]==null)&&ae(t,g,R,l)}function fe(t,e){return e==="value"||e==="checked"||e==="selectedIndex"||e==="selected"&&t.dom===p()||t.tag==="option"&&t.dom.parentNode===i.activeElement}function oe(t){return t==="oninit"||t==="oncreate"||t==="onupdate"||t==="onremove"||t==="onbeforeremove"||t==="onbeforeupdate"}function re(t,e,n){return n===void 0&&(t.tag.indexOf("-")>-1||t.attrs!=null&&t.attrs.is||e!=="href"&&e!=="list"&&e!=="form"&&e!=="width"&&e!=="height")&&e in t.dom}var de=/[A-Z]/g;function Ne(t){return"-"+t.toLowerCase()}function je(t){return t[0]==="-"&&t[1]==="-"?t:t==="cssFloat"?"float":t.replace(de,Ne)}function nt(t,e,n){if(e!==n)if(n==null)t.style.cssText="";else if(typeof n!="object")t.style.cssText=n;else if(e==null||typeof e!="object"){t.style.cssText="";for(var l in n){var c=n[l];c!=null&&t.style.setProperty(je(l),String(c))}}else{for(var l in n){var c=n[l];c!=null&&(c=String(c))!==String(e[l])&&t.style.setProperty(je(l),c)}for(var l in e)e[l]!=null&&n[l]==null&&t.style.removeProperty(je(l))}}function Me(){this._=a}Me.prototype=Object.create(null),Me.prototype.handleEvent=function(t){var e=this["on"+t.type],n;typeof e=="function"?n=e.call(t.currentTarget,t):typeof e.handleEvent=="function"&&e.handleEvent(t),this._&&t.redraw!==!1&&(0,this._)(),n===!1&&(t.preventDefault(),t.stopPropagation())};function it(t,e,n){if(t.events!=null){if(t.events._=a,t.events[e]===n)return;n!=null&&(typeof n=="function"||typeof n=="object")?(t.events[e]==null&&t.dom.addEventListener(e.slice(2),t.events,!1),t.events[e]=n):(t.events[e]!=null&&t.dom.removeEventListener(e.slice(2),t.events,!1),t.events[e]=void 0)}else n!=null&&(typeof n=="function"||typeof n=="object")&&(t.events=new Me,t.dom.addEventListener(e.slice(2),t.events,!1),t.events[e]=n)}function ze(t,e,n){typeof t.oninit=="function"&&u.call(t.oninit,e),typeof t.oncreate=="function"&&n.push(u.bind(t.oncreate,e))}function Ue(t,e,n){typeof t.onupdate=="function"&&n.push(u.bind(t.onupdate,e))}function ir(t,e){do{if(t.attrs!=null&&typeof t.attrs.onbeforeupdate=="function"){var n=u.call(t.attrs.onbeforeupdate,t,e);if(n!==void 0&&!n)break}if(typeof t.tag!="string"&&typeof t.state.onbeforeupdate=="function"){var n=u.call(t.state.onbeforeupdate,t,e);if(n!==void 0&&!n)break}return!1}while(!1);return t.dom=e.dom,t.domSize=e.domSize,t.instance=e.instance,t.attrs=e.attrs,t.children=e.children,t.text=e.text,!0}var we;return function(t,e,n){if(!t)throw new TypeError("DOM element being rendered to does not exist.");if(we!=null&&t.contains(we))throw new TypeError("Node is currently being rendered to and thus is locked.");var l=a,c=we,g=[],R=p(),j=t.namespaceURI;we=t,a=typeof n=="function"?n:void 0;try{t.vnodes==null&&(t.textContent=""),e=We.normalizeChildren(Array.isArray(e)?e:[e]),x(t,t.vnodes,e,g,null,j==="http://www.w3.org/1999/xhtml"?void 0:j),t.vnodes=e,R!=null&&p()!==R&&typeof R.focus=="function"&&R.focus();for(var v=0;v<g.length;v++)g[v]()}finally{a=l,we=c}}}});var Qe=$((on,Tt)=>{"use strict";Tt.exports=xt()(typeof window<"u"?window:null)});var qt=$((hn,Nt)=>{"use strict";var At=ue();Nt.exports=function(r,i,a){var f=[],s=!1,o=-1;function u(){for(o=0;o<f.length;o+=2)try{r(f[o],At(f[o+1]),p)}catch(w){a.error(w)}o=-1}function p(){s||(s=!0,i(function(){s=!1,u()}))}p.sync=u;function h(w,T){if(T!=null&&T.view==null&&typeof T!="function")throw new TypeError("m.mount expects a component, not a vnode.");var N=f.indexOf(w);N>=0&&(f.splice(N,2),N<=o&&(o-=2),r(w,[])),T!=null&&(f.push(w,T),r(w,At(T),p))}return{mount:h,redraw:p}}});var Se=$((pn,Ct)=>{"use strict";var Ar=Qe();Ct.exports=qt()(Ar,typeof requestAnimationFrame<"u"?requestAnimationFrame:null,typeof console<"u"?console:null)});var Ye=$((mn,St)=>{"use strict";St.exports=function(r){if(Object.prototype.toString.call(r)!=="[object Object]")return"";var i=[];for(var a in r)f(a,r[a]);return i.join("&");function f(s,o){if(Array.isArray(o))for(var u=0;u<o.length;u++)f(s+"["+u+"]",o[u]);else if(Object.prototype.toString.call(o)==="[object Object]")for(var u in o)f(s+"["+u+"]",o[u]);else i.push(encodeURIComponent(s)+(o!=null&&o!==""?"="+encodeURIComponent(o):""))}}});var Ze=$((yn,Ot)=>{"use strict";var Nr=ve();Ot.exports=Object.assign||function(r,i){for(var a in i)Nr.call(i,a)&&(r[a]=i[a])}});var Oe=$((gn,Rt)=>{"use strict";var qr=Ye(),Cr=Ze();Rt.exports=function(r,i){if(/:([^\/\.-]+)(\.{3})?:/.test(r))throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.");if(i==null)return r;var a=r.indexOf("?"),f=r.indexOf("#"),s=f<0?r.length:f,o=a<0?s:a,u=r.slice(0,o),p={};Cr(p,i);var h=u.replace(/:([^\/\.-]+)(\.{3})?/g,function(m,d,x){return delete p[d],i[d]==null?m:x?i[d]:encodeURIComponent(String(i[d]))}),w=h.indexOf("?"),T=h.indexOf("#"),N=T<0?h.length:T,A=w<0?N:w,S=h.slice(0,A);a>=0&&(S+=r.slice(a,s)),w>=0&&(S+=(a<0?"?":"&")+h.slice(w,N));var y=qr(p);return y&&(S+=(a<0&&w<0?"?":"&")+y),f>=0&&(S+=r.slice(f)),T>=0&&(S+=(f<0?"":"&")+h.slice(T)),S}});var Lt=$((dn,Et)=>{"use strict";var Sr=Oe(),Pt=ve();Et.exports=function(r,i,a){var f=0;function s(p){return new i(p)}s.prototype=i.prototype,s.__proto__=i;function o(p){return function(h,w){typeof h!="string"?(w=h,h=h.url):w==null&&(w={});var T=new i(function(y,m){p(Sr(h,w.params),w,function(d){if(typeof w.type=="function")if(Array.isArray(d))for(var x=0;x<d.length;x++)d[x]=new w.type(d[x]);else d=new w.type(d);y(d)},m)});if(w.background===!0)return T;var N=0;function A(){--N===0&&typeof a=="function"&&a()}return S(T);function S(y){var m=y.then;return y.constructor=s,y.then=function(){N++;var d=m.apply(y,arguments);return d.then(A,function(x){if(A(),N===0)throw x}),S(d)},y}}}function u(p,h){for(var w in p.headers)if(Pt.call(p.headers,w)&&w.toLowerCase()===h)return!0;return!1}return{request:o(function(p,h,w,T){var N=h.method!=null?h.method.toUpperCase():"GET",A=h.body,S=(h.serialize==null||h.serialize===JSON.serialize)&&!(A instanceof r.FormData||A instanceof r.URLSearchParams),y=h.responseType||(typeof h.extract=="function"?"":"json"),m=new r.XMLHttpRequest,d=!1,x=!1,q=m,M,b=m.abort;m.abort=function(){d=!0,b.call(this)},m.open(N,p,h.async!==!1,typeof h.user=="string"?h.user:void 0,typeof h.password=="string"?h.password:void 0),S&&A!=null&&!u(h,"content-type")&&m.setRequestHeader("Content-Type","application/json; charset=utf-8"),typeof h.deserialize!="function"&&!u(h,"accept")&&m.setRequestHeader("Accept","application/json, text/*"),h.withCredentials&&(m.withCredentials=h.withCredentials),h.timeout&&(m.timeout=h.timeout),m.responseType=y;for(var D in h.headers)Pt.call(h.headers,D)&&m.setRequestHeader(D,h.headers[D]);m.onreadystatechange=function(P){if(!d&&P.target.readyState===4)try{var I=P.target.status>=200&&P.target.status<300||P.target.status===304||/^file:\/\//i.test(p),z=P.target.response,E;if(y==="json"){if(!P.target.responseType&&typeof h.extract!="function")try{z=JSON.parse(P.target.responseText)}catch{z=null}}else(!y||y==="text")&&z==null&&(z=P.target.responseText);if(typeof h.extract=="function"?(z=h.extract(P.target,h),I=!0):typeof h.deserialize=="function"&&(z=h.deserialize(z)),I)w(z);else{var X=function(){try{E=P.target.responseText}catch{E=z}var U=new Error(E);U.code=P.target.status,U.response=z,T(U)};m.status===0?setTimeout(function(){x||X()}):X()}}catch(U){T(U)}},m.ontimeout=function(P){x=!0;var I=new Error("Request timed out");I.code=P.target.status,T(I)},typeof h.config=="function"&&(m=h.config(m,h,p)||m,m!==q&&(M=m.abort,m.abort=function(){d=!0,M.call(this)})),A==null?m.send():typeof h.serialize=="function"?m.send(h.serialize(A)):A instanceof r.FormData||A instanceof r.URLSearchParams?m.send(A):m.send(JSON.stringify(A))}),jsonp:o(function(p,h,w,T){var N=h.callbackName||"_mithril_"+Math.round(Math.random()*1e16)+"_"+f++,A=r.document.createElement("script");r[N]=function(S){delete r[N],A.parentNode.removeChild(A),w(S)},A.onerror=function(){delete r[N],A.parentNode.removeChild(A),T(new Error("JSONP request failed"))},A.src=p+(p.indexOf("?")<0?"?":"&")+encodeURIComponent(h.callbackKey||"callback")+"="+encodeURIComponent(N),r.document.documentElement.appendChild(A)})}}});var jt=$((wn,Dt)=>{"use strict";var Or=Je(),Rr=Se();Dt.exports=Lt()(typeof window<"u"?window:null,Or,Rr.redraw)});var ke=$((bn,zt)=>{"use strict";function Mt(r){try{return decodeURIComponent(r)}catch{return r}}zt.exports=function(r){if(r===""||r==null)return{};r.charAt(0)==="?"&&(r=r.slice(1));for(var i=r.split("&"),a={},f={},s=0;s<i.length;s++){var o=i[s].split("="),u=Mt(o[0]),p=o.length===2?Mt(o[1]):"";p==="true"?p=!0:p==="false"&&(p=!1);var h=u.split(/\]\[?|\[/),w=f;u.indexOf("[")>-1&&h.pop();for(var T=0;T<h.length;T++){var N=h[T],A=h[T+1],S=A==""||!isNaN(parseInt(A,10));if(N===""){var u=h.slice(0,T).join();a[u]==null&&(a[u]=Array.isArray(w)?w.length:0),N=a[u]++}else if(N==="__proto__")break;if(T===h.length-1)w[N]=p;else{var y=Object.getOwnPropertyDescriptor(w,N);y!=null&&(y=y.value),y==null&&(w[N]=y=S?[]:{}),w=y}}}return f}});var Re=$((vn,Ut)=>{"use strict";var Pr=ke();Ut.exports=function(r){var i=r.indexOf("?"),a=r.indexOf("#"),f=a<0?r.length:a,s=i<0?f:i,o=r.slice(0,s).replace(/\/{2,}/g,"/");return o?(o[0]!=="/"&&(o="/"+o),o.length>1&&o[o.length-1]==="/"&&(o=o.slice(0,-1))):o="/",{path:o,params:i<0?{}:Pr(r.slice(i+1,f))}}});var It=$((xn,Ht)=>{"use strict";var Er=Re();Ht.exports=function(r){var i=Er(r),a=Object.keys(i.params),f=[],s=new RegExp("^"+i.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(o,u,p){return u==null?"\\"+o:(f.push({k:u,r:p==="..."}),p==="..."?"(.*)":p==="."?"([^/]+)\\.":"([^/]+)"+(p||""))})+"$");return function(o){for(var u=0;u<a.length;u++)if(i.params[a[u]]!==o.params[a[u]])return!1;if(!f.length)return s.test(o.path);var p=s.exec(o.path);if(p==null)return!1;for(var u=0;u<f.length;u++)o.params[f[u].k]=f[u].r?p[u+1]:decodeURIComponent(p[u+1]);return!0}}});var et=$((Tn,$t)=>{"use strict";var _t=ve(),Ft=new RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");$t.exports=function(r,i){var a={};if(i!=null)for(var f in r)_t.call(r,f)&&!Ft.test(f)&&i.indexOf(f)<0&&(a[f]=r[f]);else for(var f in r)_t.call(r,f)&&!Ft.test(f)&&(a[f]=r[f]);return a}});var Xt=$((An,Kt)=>{"use strict";var Lr=ue(),Dr=Ke(),jr=Je(),Vt=Oe(),Bt=Re(),Mr=It(),zr=Ze(),Ur=et(),tt={};function Hr(r){try{return decodeURIComponent(r)}catch{return r}}Kt.exports=function(r,i){var a=r==null?null:typeof r.setImmediate=="function"?r.setImmediate:r.setTimeout,f=jr.resolve(),s=!1,o=!1,u=0,p,h,w=tt,T,N,A,S,y={onbeforeupdate:function(){return u=u?2:1,!(!u||tt===w)},onremove:function(){r.removeEventListener("popstate",x,!1),r.removeEventListener("hashchange",d,!1)},view:function(){if(!(!u||tt===w)){var b=[Lr(T,N.key,N)];return w&&(b=w.render(b[0])),b}}},m=M.SKIP={};function d(){s=!1;var b=r.location.hash;M.prefix[0]!=="#"&&(b=r.location.search+b,M.prefix[0]!=="?"&&(b=r.location.pathname+b,b[0]!=="/"&&(b="/"+b)));var D=b.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,Hr).slice(M.prefix.length),P=Bt(D);zr(P.params,r.history.state);function I(E){console.error(E),q(h,null,{replace:!0})}z(0);function z(E){for(;E<p.length;E++)if(p[E].check(P)){var X=p[E].component,U=p[E].route,te=X,ne=S=function(Y){if(ne===S){if(Y===m)return z(E+1);T=Y!=null&&(typeof Y.view=="function"||typeof Y=="function")?Y:"div",N=P.params,A=D,S=null,w=X.render?X:null,u===2?i.redraw():(u=2,i.redraw.sync())}};X.view||typeof X=="function"?(X={},ne(te)):X.onmatch?f.then(function(){return X.onmatch(P.params,D,U)}).then(ne,D===h?null:I):ne("div");return}if(D===h)throw new Error("Could not resolve default route "+h+".");q(h,null,{replace:!0})}}function x(){s||(s=!0,a(d))}function q(b,D,P){if(b=Vt(b,D),o){x();var I=P?P.state:null,z=P?P.title:null;P&&P.replace?r.history.replaceState(I,z,M.prefix+b):r.history.pushState(I,z,M.prefix+b)}else r.location.href=M.prefix+b}function M(b,D,P){if(!b)throw new TypeError("DOM element being rendered to does not exist.");if(p=Object.keys(P).map(function(z){if(z[0]!=="/")throw new SyntaxError("Routes must start with a '/'.");if(/:([^\/\.-]+)(\.{3})?:/.test(z))throw new SyntaxError("Route parameter names must be separated with either '/', '.', or '-'.");return{route:z,component:P[z],check:Mr(z)}}),h=D,D!=null){var I=Bt(D);if(!p.some(function(z){return z.check(I)}))throw new ReferenceError("Default route doesn't match any known routes.")}typeof r.history.pushState=="function"?r.addEventListener("popstate",x,!1):M.prefix[0]==="#"&&r.addEventListener("hashchange",d,!1),o=!0,i.mount(b,y),d()}return M.set=function(b,D,P){S!=null&&(P=P||{},P.replace=!0),S=null,q(b,D,P)},M.get=function(){return A},M.prefix="#!",M.Link={view:function(b){var D=Dr(b.attrs.selector||"a",Ur(b.attrs,["options","params","selector","onclick"]),b.children),P,I,z;return(D.attrs.disabled=!!D.attrs.disabled)?(D.attrs.href=null,D.attrs["aria-disabled"]="true"):(P=b.attrs.options,I=b.attrs.onclick,z=Vt(D.attrs.href,b.attrs.params),D.attrs.href=M.prefix+z,D.attrs.onclick=function(E){var X;typeof I=="function"?X=I.call(E.currentTarget,E):I==null||typeof I!="object"||typeof I.handleEvent=="function"&&I.handleEvent(E),X!==!1&&!E.defaultPrevented&&(E.button===0||E.which===0||E.which===1)&&(!E.currentTarget.target||E.currentTarget.target==="_self")&&!E.ctrlKey&&!E.metaKey&&!E.shiftKey&&!E.altKey&&(E.preventDefault(),E.redraw=!1,M.set(z,null,P))}),D}},M.param=function(b){return N&&b!=null?N[b]:N},M}});var Jt=$((Nn,Gt)=>{"use strict";var Ir=Se();Gt.exports=Xt()(typeof window<"u"?window:null,Ir)});var Zt=$((qn,Yt)=>{"use strict";var Pe=wt(),Wt=jt(),Qt=Se(),W=function(){return Pe.apply(this,arguments)};W.m=Pe;W.trust=Pe.trust;W.fragment=Pe.fragment;W.Fragment="[";W.mount=Qt.mount;W.route=Jt();W.render=Qe();W.redraw=Qt.redraw;W.request=Wt.request;W.jsonp=Wt.jsonp;W.parseQueryString=ke();W.buildQueryString=Ye();W.parsePathname=Re();W.buildPathname=Oe();W.vnode=ue();W.PromisePolyfill=Ge();W.censor=et();Yt.exports=W});var ge=hr(Zt());var kt=11;function _r(r,i){var a=i.attributes,f,s,o,u,p;if(!(i.nodeType===kt||r.nodeType===kt)){for(var h=a.length-1;h>=0;h--)f=a[h],s=f.name,o=f.namespaceURI,u=f.value,o?(s=f.localName||s,p=r.getAttributeNS(o,s),p!==u&&(f.prefix==="xmlns"&&(s=f.name),r.setAttributeNS(o,s,u))):(p=r.getAttribute(s),p!==u&&r.setAttribute(s,u));for(var w=r.attributes,T=w.length-1;T>=0;T--)f=w[T],s=f.name,o=f.namespaceURI,o?(s=f.localName||s,i.hasAttributeNS(o,s)||r.removeAttributeNS(o,s)):i.hasAttribute(s)||r.removeAttribute(s)}}var Ee,Fr="http://www.w3.org/1999/xhtml",ee=typeof document>"u"?void 0:document,$r=!!ee&&"content"in ee.createElement("template"),Vr=!!ee&&ee.createRange&&"createContextualFragment"in ee.createRange();function Br(r){var i=ee.createElement("template");return i.innerHTML=r,i.content.childNodes[0]}function Kr(r){Ee||(Ee=ee.createRange(),Ee.selectNode(ee.body));var i=Ee.createContextualFragment(r);return i.childNodes[0]}function Xr(r){var i=ee.createElement("body");return i.innerHTML=r,i.childNodes[0]}function Gr(r){return r=r.trim(),$r?Br(r):Vr?Kr(r):Xr(r)}function Le(r,i){var a=r.nodeName,f=i.nodeName,s,o;return a===f?!0:(s=a.charCodeAt(0),o=f.charCodeAt(0),s<=90&&o>=97?a===f.toUpperCase():o<=90&&s>=97?f===a.toUpperCase():!1)}function Jr(r,i){return!i||i===Fr?ee.createElement(r):ee.createElementNS(i,r)}function Wr(r,i){for(var a=r.firstChild;a;){var f=a.nextSibling;i.appendChild(a),a=f}return i}function rt(r,i,a){r[a]!==i[a]&&(r[a]=i[a],r[a]?r.setAttribute(a,""):r.removeAttribute(a))}var er={OPTION:function(r,i){var a=r.parentNode;if(a){var f=a.nodeName.toUpperCase();f==="OPTGROUP"&&(a=a.parentNode,f=a&&a.nodeName.toUpperCase()),f==="SELECT"&&!a.hasAttribute("multiple")&&(r.hasAttribute("selected")&&!i.selected&&(r.setAttribute("selected","selected"),r.removeAttribute("selected")),a.selectedIndex=-1)}rt(r,i,"selected")},INPUT:function(r,i){rt(r,i,"checked"),rt(r,i,"disabled"),r.value!==i.value&&(r.value=i.value),i.hasAttribute("value")||r.removeAttribute("value")},TEXTAREA:function(r,i){var a=i.value;r.value!==a&&(r.value=a);var f=r.firstChild;if(f){var s=f.nodeValue;if(s==a||!a&&s==r.placeholder)return;f.nodeValue=a}},SELECT:function(r,i){if(!i.hasAttribute("multiple")){for(var a=-1,f=0,s=r.firstChild,o,u;s;)if(u=s.nodeName&&s.nodeName.toUpperCase(),u==="OPTGROUP")o=s,s=o.firstChild;else{if(u==="OPTION"){if(s.hasAttribute("selected")){a=f;break}f++}s=s.nextSibling,!s&&o&&(s=o.nextSibling,o=null)}r.selectedIndex=a}}},Te=1,tr=11,rr=3,nr=8;function ce(){}function Qr(r){if(r)return r.getAttribute&&r.getAttribute("id")||r.id}function Yr(r){return function(a,f,s){if(s||(s={}),typeof f=="string")if(a.nodeName==="#document"||a.nodeName==="HTML"||a.nodeName==="BODY"){var o=f;f=ee.createElement("html"),f.innerHTML=o}else f=Gr(f);else f.nodeType===tr&&(f=f.firstElementChild);var u=s.getNodeKey||Qr,p=s.onBeforeNodeAdded||ce,h=s.onNodeAdded||ce,w=s.onBeforeElUpdated||ce,T=s.onElUpdated||ce,N=s.onBeforeNodeDiscarded||ce,A=s.onNodeDiscarded||ce,S=s.onBeforeElChildrenUpdated||ce,y=s.skipFromChildren||ce,m=s.addChild||function(C,O){return C.appendChild(O)},d=s.childrenOnly===!0,x=Object.create(null),q=[];function M(C){q.push(C)}function b(C,O){if(C.nodeType===Te)for(var _=C.firstChild;_;){var L=void 0;O&&(L=u(_))?M(L):(A(_),_.firstChild&&b(_,O)),_=_.nextSibling}}function D(C,O,_){N(C)!==!1&&(O&&O.removeChild(C),A(C),b(C,_))}function P(C){if(C.nodeType===Te||C.nodeType===tr)for(var O=C.firstChild;O;){var _=u(O);_&&(x[_]=O),P(O),O=O.nextSibling}}P(a);function I(C){h(C);for(var O=C.firstChild;O;){var _=O.nextSibling,L=u(O);if(L){var F=x[L];F&&Le(O,F)?(O.parentNode.replaceChild(F,O),E(F,O)):I(O)}else I(O);O=_}}function z(C,O,_){for(;O;){var L=O.nextSibling;(_=u(O))?M(_):D(O,C,!0),O=L}}function E(C,O,_){var L=u(O);L&&delete x[L],!(!_&&(w(C,O)===!1||(r(C,O),T(C),S(C,O)===!1)))&&(C.nodeName!=="TEXTAREA"?X(C,O):er.TEXTAREA(C,O))}function X(C,O){var _=y(C),L=O.firstChild,F=C.firstChild,ie,ae,se,pe,fe;e:for(;L;){for(pe=L.nextSibling,ie=u(L);!_&&F;){if(se=F.nextSibling,L.isSameNode&&L.isSameNode(F)){L=pe,F=se;continue e}ae=u(F);var oe=F.nodeType,re=void 0;if(oe===L.nodeType&&(oe===Te?(ie?ie!==ae&&((fe=x[ie])?se===fe?re=!1:(C.insertBefore(fe,F),ae?M(ae):D(F,C,!0),F=fe):re=!1):ae&&(re=!1),re=re!==!1&&Le(F,L),re&&E(F,L)):(oe===rr||oe==nr)&&(re=!0,F.nodeValue!==L.nodeValue&&(F.nodeValue=L.nodeValue))),re){L=pe,F=se;continue e}ae?M(ae):D(F,C,!0),F=se}if(ie&&(fe=x[ie])&&Le(fe,L))_||m(C,fe),E(fe,L);else{var de=p(L);de!==!1&&(de&&(L=de),L.actualize&&(L=L.actualize(C.ownerDocument||ee)),m(C,L),I(L))}L=pe,F=se}z(C,F,ae);var Ne=er[C.nodeName];Ne&&Ne(C,O)}var U=a,te=U.nodeType,ne=f.nodeType;if(!d){if(te===Te)ne===Te?Le(a,f)||(A(a),U=Wr(a,Jr(f.nodeName,f.namespaceURI))):U=f;else if(te===rr||te===nr){if(ne===te)return U.nodeValue!==f.nodeValue&&(U.nodeValue=f.nodeValue),U;U=f}}if(U===f)A(a);else{if(f.isSameNode&&f.isSameNode(U))return;if(E(U,f,d),q)for(var Y=0,Ae=q.length;Y<Ae;Y++){var le=x[q[Y]];le&&D(le,le.parentNode,!1)}}return!d&&U!==a&&a.parentNode&&(U.actualize&&(U=U.actualize(a.ownerDocument||ee)),a.parentNode.replaceChild(U,a)),U}}var Zr=Yr(_r),De=Zr;(function(r){window.syncify=window.syncify||{ready:!1};let i=`http://localhost:${r.server}/`,a=new WebSocket(`ws://localhost:${r.socket}/ws`),f=new DOMParser,s={onBeforeElUpdated:function(y,m){return!(y.id==="syncify-hot-label-status"||y.tagName==="SCRIPT"||y.tagName==="STYLE"||y.isEqualNode(m))}};function o(y){return{list:()=>Object.keys(y).length>0?y:null,get:m=>m in y?document.body.querySelectorAll(y[m].join(",")):null,load:()=>{y={};let m=document.body.querySelectorAll(".shopify-section");return m?(m.forEach(d=>{let x=/_{2}[\w-]+$/g.exec(d.id),q=x!==null?x[0].slice(2):d.id;q in y?y[q].push("#"+d.id):y[q]=["#"+d.id]}),y):null}}}let u=function(){let m="Syncify Connected",d=document.createElement("div");d.id="syncify-hot-label-status";let x={position:"fixed",left:"0",bottom:"0",right:"0",margin:"0 auto",display:"flex",color:"#f7f7f7",zIndex:"99999",fontFamily:"system-ui,sans-serif",textAlign:"center",justifyContent:"space-around",alignItems:"center",fontSize:"11px"},q={padding:"5px 20px",backgroundColor:"#232326",border:"0.8px solid transparent",borderRadius:"5px",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",borderBottom:"0"},M={view:()=>(0,ge.default)("div",{style:q},m)};return Object.assign(d.style,x),window.syncify.style={parent:b=>{Object.assign(d.style,x,b),ge.default.redraw()},label:b=>{Object.assign(q,b),ge.default.redraw()}},ge.default.mount(d,M),{get node(){return d},event:b=>(b!==void 0&&(m=b),ge.default.redraw(),m),render:b=>{b.contains(d)||b.append(d)}}}(),p=function(y){let m=null;return{start:()=>{let d=performance.now();y.push(d)},stop:()=>{m!==null&&(clearTimeout(m),m=null),m=setTimeout(()=>{u.event("Waiting for changes..."),m=null},5e3);let d=performance.now()-y.pop();if(d<1e3)return`${d.toFixed(0)}ms`;let x=d/1e3;if(x<60)return`${x.toFixed(0)}s ${+d.toFixed(0).slice(1)}ms`;let q=(x/60).toFixed(0);return`${q}m ${x-60*Number(q)}s ${+d.toFixed(0).slice(1)}ms`}}}([]);function h(y){let m=y.lastIndexOf("/")+1,d=y.indexOf("?",m);return(d>-1?y.substring(m,d):y.substring(m))+"?v="+Date.now()}function w(y,m){return typeof m!="string"?!1:y.slice(y.lastIndexOf("/")+1).startsWith(m)}function T(y,m){return y.querySelectorAll("link[rel=stylesheet]").forEach(d=>{let x=d.getAttribute("href");w(x,m)&&d.setAttribute("href",i+h(x))}),y}function N(y,m){return y.querySelectorAll("script").forEach(d=>{if(!d.hasAttribute("src"))return;let x=d.getAttribute("src");if(!w(x,m))return;let q=document.createElement("script");q.setAttribute("src",i+h(x));for(let M of Array.from(d.attributes))M.nodeName!=="src"&&q.setAttribute(M.nodeName,M.nodeValue);d.replaceWith(q)}),y}function A(y){return N(y),T(y),y}function S(y,m){return new Promise(function(d,x){let q=new XMLHttpRequest;q.responseType=m,q.open("GET",y),q.setRequestHeader("X-Syncify-Reload","true"),q.setRequestHeader("X-Requested-With","XMLHttpRequest"),q.onload=()=>d(q.response),q.onerror=()=>x(q.statusText),q.send()})}a.addEventListener("message",function({data:y}){if(y==="reload")return u.event("Refreshing"),top.location.reload();if(y==="replace")return p.start(),u.event("Reloading"),S(location.href,"text").then(m=>{let d=f.parseFromString(m,"text/html"),x=A(d);console.log(x.body),De(document.body,x.body,s),u.render(document.body),u.event(`Reloaded in ${p.stop()}`)});{p.start();let[m,d]=y.split(",");if(m==="section"){let x=window.syncify.sections.get(d);if(u.event(`Reloading Section: ${d}`),x===null){window.syncify.reload();return}return S(`${location.pathname}?sections=${d}`,"json").then(q=>{x!==null&&(x.forEach(M=>{De(M,q[d],{childrenOnly:!0,onBeforeElUpdated:function(b,D){return!(b.tagName==="SCRIPT"||b.tagName==="STYLE"||b.isEqualNode(D))}})}),u.event(`Reloaded in ${p.stop()}`))})}else m==="script"?(u.event(`Reloading JavaScript: ${d}`),N(document,d),u.event(`Reloaded in ${p.stop()}`)):m==="stylesheet"&&(u.event(`Reloading Stylesheet: ${d}`),T(document,d),u.event(`Reloaded in ${p.stop()}`))}}),window.syncify.sections=o({}),window.syncify.assets=()=>A(document),window.syncify.refresh=()=>top.location.reload(),window.syncify.reload=()=>S(location.href,"text").then(y=>{let m=f.parseFromString(y,"text/html");De(document.body,A(m).body,s),u.render(document.body),window.syncify.sections.load()}),document.addEventListener("DOMContentLoaded",()=>{u.render(document.body),window.syncify.sections.load(),window.syncify.ready=!0})})({server:"{{- server | default: 3000 -}}",socket:"{{- socket | default: 8089 -}}",label:'{{- label | default: "visible" -}}'});})();
|
2238
3
|
</script>
|