@aevantec/litevue 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/litevue-plugins.dev.iife.js +4 -85
- package/dist/litevue-plugins.dev.mjs +4 -85
- package/dist/litevue-plugins.iife.js +1 -1
- package/dist/litevue-plugins.mjs +1 -1
- package/dist/litevue-plugins.umd.js +1 -1
- package/dist/litevue.dev.iife.js +2 -121
- package/dist/litevue.dev.mjs +2 -121
- package/dist/litevue.iife.js +1 -1
- package/dist/litevue.mjs +1 -1
- package/dist/litevue.umd.js +1 -1
- package/dist/plugins/media.dev.iife.js +2 -35
- package/dist/plugins/media.dev.mjs +2 -35
- package/dist/plugins/media.iife.js +1 -1
- package/dist/plugins/media.mjs +1 -1
- package/dist/plugins/media.umd.js +1 -1
- package/dist/plugins/morph.dev.iife.js +2 -42
- package/dist/plugins/morph.dev.mjs +2 -42
- package/dist/plugins/morph.iife.js +1 -1
- package/dist/plugins/morph.mjs +1 -1
- package/dist/plugins/morph.umd.js +1 -1
- package/dist/plugins/navigate.dev.iife.js +1 -10
- package/dist/plugins/navigate.dev.mjs +1 -10
- package/dist/plugins/persist.dev.iife.js +0 -7
- package/dist/plugins/persist.dev.mjs +0 -7
- package/dist/plugins/transition.iife.js +1 -1
- package/dist/plugins/transition.mjs +1 -1
- package/dist/plugins/transition.umd.js +1 -1
- package/dist/types/app.d.mts +2 -5
- package/dist/types/app.d.ts +2 -5
- package/dist/types/block.d.mts +0 -4
- package/dist/types/block.d.ts +0 -4
- package/dist/types/context.d.mts +0 -5
- package/dist/types/context.d.ts +0 -5
- package/dist/types/devtools-panel/chrome.d.mts +0 -3
- package/dist/types/devtools-panel/chrome.d.ts +0 -3
- package/dist/types/devtools-panel/menu.d.mts +0 -2
- package/dist/types/devtools-panel/menu.d.ts +0 -2
- package/dist/types/devtools-panel/plugins.d.mts +0 -4
- package/dist/types/devtools-panel/plugins.d.ts +0 -4
- package/dist/types/devtools-panel/styles.d.mts +2 -17
- package/dist/types/devtools-panel/styles.d.ts +2 -17
- package/dist/types/devtools-panel/values.d.mts +0 -25
- package/dist/types/devtools-panel/values.d.ts +0 -25
- package/dist/types/devtools.d.mts +0 -7
- package/dist/types/devtools.d.ts +0 -7
- package/dist/types/directives/on.d.mts +0 -1
- package/dist/types/directives/on.d.ts +0 -1
- package/dist/types/errors.d.mts +0 -7
- package/dist/types/errors.d.ts +0 -7
- package/dist/types/eval.d.mts +0 -3
- package/dist/types/eval.d.ts +0 -3
- package/dist/types/lazy.d.mts +0 -10
- package/dist/types/lazy.d.ts +0 -10
- package/dist/types/magics.d.mts +0 -9
- package/dist/types/magics.d.ts +0 -9
- package/dist/types/ownership.d.mts +0 -19
- package/dist/types/ownership.d.ts +0 -19
- package/dist/types/plugins/media/index.d.mts +0 -5
- package/dist/types/plugins/media/index.d.ts +0 -5
- package/dist/types/plugins/morph/index.d.mts +0 -8
- package/dist/types/plugins/morph/index.d.ts +0 -8
- package/dist/types/scheduler.d.mts +0 -5
- package/dist/types/scheduler.d.ts +0 -5
- package/dist/types/utils.d.mts +0 -5
- package/dist/types/utils.d.ts +0 -5
- package/dist/types/warn.d.mts +0 -12
- package/dist/types/warn.d.ts +0 -12
- package/package.json +1 -1
|
@@ -143,7 +143,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
143
143
|
});
|
|
144
144
|
elem.__leave = () => {
|
|
145
145
|
live = false;
|
|
146
|
-
elem.__leaving = 1;
|
|
147
146
|
return new Promise((resolve) => run("leave", resolve));
|
|
148
147
|
};
|
|
149
148
|
return () => {
|
|
@@ -177,7 +176,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
177
176
|
};
|
|
178
177
|
// src/plugins/persist/index.ts
|
|
179
178
|
var PREFIX = "litevue:";
|
|
180
|
-
/** Custom storages registered by name, usable as a directive modifier. */
|
|
181
179
|
var registry = Object.create(null);
|
|
182
180
|
var defaultStorage = "local";
|
|
183
181
|
var builtin = (name) => {
|
|
@@ -211,11 +209,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
211
209
|
var setDefaultStorage = (storage) => {
|
|
212
210
|
defaultStorage = storage;
|
|
213
211
|
};
|
|
214
|
-
/**
|
|
215
|
-
* Which own properties of `target` can round-trip through storage. Methods are
|
|
216
|
-
* behavior, not state; getter-only properties are derived and would throw on
|
|
217
|
-
* restore. An explicit list is filtered too, so naming a getter is a no-op.
|
|
218
|
-
*/
|
|
219
212
|
var persistable = (target, keys) => (keys ?? Object.keys(target)).filter((k) => {
|
|
220
213
|
if (k[0] === "$") return false;
|
|
221
214
|
const desc = Object.getOwnPropertyDescriptor(target, k);
|
|
@@ -224,7 +217,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
224
217
|
if (raw && raw.__v_isRef === true && raw.__v_isReadonly === true) return false;
|
|
225
218
|
return typeof target[k] !== "function";
|
|
226
219
|
});
|
|
227
|
-
/** Restore saved values, then keep storage in sync with every change. */
|
|
228
220
|
var sync = (target, key, keys, storage, run) => {
|
|
229
221
|
if (!storage) return run(() => {});
|
|
230
222
|
const fields = persistable(target, keys);
|
|
@@ -431,22 +423,11 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
431
423
|
});
|
|
432
424
|
};
|
|
433
425
|
// src/plugins/morph/index.ts
|
|
434
|
-
/**
|
|
435
|
-
* A `data-` attribute rather than `v-preserve`: an unrecognised `v-` attribute
|
|
436
|
-
* logs an unknown-directive error, and registering one would have the walker
|
|
437
|
-
* strip it, leaving nothing for the next morph. Matches `data-morph-skip`.
|
|
438
|
-
*/
|
|
439
426
|
var preserved = (node, opts) => node.nodeType === 1 && (node.hasAttribute("data-morph-preserve") || node.__marker || !!opts.preserve?.(node));
|
|
440
427
|
var LAZY = "[v-scope\\.visible],[v-scope\\.idle],[v-scope\\.interaction]";
|
|
441
428
|
var dirRE = /^(?:v-|:|@)/;
|
|
442
429
|
var bindRE = /^(?::|v-bind:)/;
|
|
443
430
|
var clientStyleRE = /^v-(?!scope|on:)/;
|
|
444
|
-
/**
|
|
445
|
-
* Attributes tried in order when no `key` option is given. All three express
|
|
446
|
-
* identity, so none repeat among siblings the way `name` does on a radio group
|
|
447
|
-
* — hence its absence. The attribute name is part of the key, so `id="5"` and
|
|
448
|
-
* `data-id="5"` stay distinct.
|
|
449
|
-
*/
|
|
450
431
|
var KEY_ATTRS = [
|
|
451
432
|
"id",
|
|
452
433
|
"data-key",
|
|
@@ -459,26 +440,11 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
459
440
|
}
|
|
460
441
|
return null;
|
|
461
442
|
};
|
|
462
|
-
/**
|
|
463
|
-
* The nearest stashed context, walking up from a live node. `v-scope` elements
|
|
464
|
-
* record theirs during walk, so inserted markup binds with the scope it landed
|
|
465
|
-
* in rather than the root.
|
|
466
|
-
*/
|
|
467
443
|
var nearestCtx = (node) => {
|
|
468
444
|
for (let el = node; el; el = el.parentElement) if (el.__ctx) return el.__ctx;
|
|
469
445
|
};
|
|
470
|
-
/**
|
|
471
|
-
* Disposal is per node, so any context can release any subtree. Outside every
|
|
472
|
-
* scope there is no parent context to ask, but a root inside the subtree has
|
|
473
|
-
* one; without this, its effects and listeners outlive it.
|
|
474
|
-
*/
|
|
475
446
|
var ctxIn = (n) => n.__ctx || [...n.children || []].map(ctxIn).find(Boolean);
|
|
476
447
|
var release = (node, ctx) => (ctx || ctxIn(node))?.dispose?.(node);
|
|
477
|
-
/**
|
|
478
|
-
* Attributes the client owns, read from the *incoming* markup — it still
|
|
479
|
-
* carries the directives the live DOM had stripped. `:class` there means the
|
|
480
|
-
* live `class` is bound and must survive the server's static value.
|
|
481
|
-
*/
|
|
482
448
|
var boundAttrs = (to) => {
|
|
483
449
|
const owned = /* @__PURE__ */ new Set();
|
|
484
450
|
if (to.matches("details,dialog")) owned.add("open");
|
|
@@ -495,13 +461,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
495
461
|
}
|
|
496
462
|
return owned;
|
|
497
463
|
};
|
|
498
|
-
/**
|
|
499
|
-
* `v-for` and `v-if` render into Blocks: the live DOM holds anchors plus the
|
|
500
|
-
* clones the data produced, while the server still sends one template. Matched
|
|
501
|
-
* positionally, the rest would be deleted as "no longer sent".
|
|
502
|
-
*/
|
|
503
464
|
var isBlockRoot = (el) => el.hasAttribute("v-for") || el.hasAttribute("v-if") || el.hasAttribute("v-else") || el.hasAttribute("v-else-if");
|
|
504
|
-
/** True when the client, not the server, decides this element's contents. */
|
|
505
465
|
var ownsChildren = (to) => {
|
|
506
466
|
if (to.hasAttribute("v-text") || to.hasAttribute("v-html") || to.hasAttribute("v-pre") || to.hasAttribute("v-once") || isBlockRoot(to)) return true;
|
|
507
467
|
for (let c = to.firstElementChild; c; c = c.nextElementSibling) if (isBlockRoot(c)) return true;
|
|
@@ -525,6 +485,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
525
485
|
var patchAttrs = (from, to, values) => {
|
|
526
486
|
const owned = boundAttrs(to);
|
|
527
487
|
if (from.__anchor) owned.add("style");
|
|
488
|
+
for (const name of from.constructor.morphOwnedAttributes || []) owned.add(name);
|
|
528
489
|
if (values) syncValues(from, to, owned);
|
|
529
490
|
const bound = Object(from.__bound);
|
|
530
491
|
for (const { name, value } of to.attributes) {
|
|
@@ -536,10 +497,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
536
497
|
from.removeAttribute(name);
|
|
537
498
|
}
|
|
538
499
|
};
|
|
539
|
-
/**
|
|
540
|
-
* Incoming text still holding `{{ }}` is rendered by a text directive on the
|
|
541
|
-
* live side, so the live value wins.
|
|
542
|
-
*/
|
|
543
500
|
var isInterpolation = (data, ctx) => data.includes(ctx ? ctx.delimiters[0] : "{{");
|
|
544
501
|
var patchNode = (from, to, ctx, opts) => {
|
|
545
502
|
if (from.nodeType !== to.nodeType) return replaceNode(from, to, ctx, opts);
|
|
@@ -570,11 +527,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
570
527
|
mountNew(fresh, ctx);
|
|
571
528
|
return fresh;
|
|
572
529
|
};
|
|
573
|
-
/**
|
|
574
|
-
* Bind never-walked markup with the scope it was inserted into. The walker
|
|
575
|
-
* comes off the context, not an import, so this plugin doesn't pull a second
|
|
576
|
-
* copy of the core into the plugins bundle.
|
|
577
|
-
*/
|
|
578
530
|
var mountNew = (node, ctx) => {
|
|
579
531
|
if (node.parentElement?.closest(LAZY)) return;
|
|
580
532
|
const target = ctx || nearestCtx(node.parentNode);
|
|
@@ -619,7 +571,7 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
619
571
|
keyed.delete(wantKey);
|
|
620
572
|
patchNode(match, newChild, ctx, opts);
|
|
621
573
|
} else insert(newChild);
|
|
622
|
-
} else if (oldChild && keyOf(oldChild) == null) {
|
|
574
|
+
} else if (oldChild && (keyOf(oldChild) == null || !wanted.has(keyOf(oldChild)) && oldChild.tagName === newChild.tagName)) {
|
|
623
575
|
if (preserved(oldChild, opts) && !preserved(newChild, opts)) {
|
|
624
576
|
oldChild = oldChild.nextSibling;
|
|
625
577
|
continue;
|
|
@@ -718,15 +670,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
718
670
|
desktop: "lg"
|
|
719
671
|
};
|
|
720
672
|
var NUMERIC = /^\d+$/;
|
|
721
|
-
/**
|
|
722
|
-
* Two reactive primitives, deliberately:
|
|
723
|
-
*
|
|
724
|
-
* - `bp`, one string, so named keys / `atLeast` / `device` cost each consumer
|
|
725
|
-
* a single dependency however many responsive maps the page declares.
|
|
726
|
-
* - `tick`, for arbitrary `match()` queries. Their results are read off the
|
|
727
|
-
* MediaQueryList rather than mirrored, since registering a query inside a
|
|
728
|
-
* running effect would write a dependency it just read and re-run it.
|
|
729
|
-
*/
|
|
730
673
|
var state = /* @__PURE__ */ (0, _aevantec_litevue.reactive)({
|
|
731
674
|
bp: "base",
|
|
732
675
|
tick: 0
|
|
@@ -740,17 +683,10 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
740
683
|
var MAX_QUERIES = 64;
|
|
741
684
|
var supported = () => typeof window !== "undefined" && typeof window.matchMedia === "function";
|
|
742
685
|
var subscribe = (mql, cb) => {
|
|
743
|
-
|
|
744
|
-
mql.addEventListener("change", cb);
|
|
745
|
-
return {
|
|
746
|
-
mql,
|
|
747
|
-
off: () => mql.removeEventListener("change", cb)
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
mql.addListener(cb);
|
|
686
|
+
mql.addEventListener("change", cb);
|
|
751
687
|
return {
|
|
752
688
|
mql,
|
|
753
|
-
off: () => mql.
|
|
689
|
+
off: () => mql.removeEventListener("change", cb)
|
|
754
690
|
};
|
|
755
691
|
};
|
|
756
692
|
var currentBp = () => {
|
|
@@ -770,26 +706,15 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
770
706
|
});
|
|
771
707
|
state.bp = currentBp();
|
|
772
708
|
};
|
|
773
|
-
/**
|
|
774
|
-
* Started by the first read, not by `app.use()`, so `mq` works in a plain
|
|
775
|
-
* module with no app mounted — otherwise it would report a frozen 'base'.
|
|
776
|
-
*/
|
|
777
709
|
var activate = () => {
|
|
778
710
|
if (active) return;
|
|
779
711
|
active = true;
|
|
780
712
|
buildScale();
|
|
781
713
|
};
|
|
782
|
-
/**
|
|
783
|
-
* Entry point for every public read: activates, and depends on `tick` so
|
|
784
|
-
* `configure()` can invalidate all of them. `bp` alone is not enough — a key
|
|
785
|
-
* absent from the current scale returns false without touching reactive state,
|
|
786
|
-
* so that effect could never recover once a later scale defined the key.
|
|
787
|
-
*/
|
|
788
714
|
var trackAll = () => {
|
|
789
715
|
activate();
|
|
790
716
|
state.tick;
|
|
791
717
|
};
|
|
792
|
-
/** SSR and jsdom have no matchMedia; every query reads false and bp stays base. */
|
|
793
718
|
var rawMatch = (query) => {
|
|
794
719
|
if (!supported()) return false;
|
|
795
720
|
let sub = querySubs.get(query);
|
|
@@ -803,7 +728,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
803
728
|
}
|
|
804
729
|
return sub.mql.matches;
|
|
805
730
|
};
|
|
806
|
-
/** A key's lower bound in pixels, or undefined if it names nothing. */
|
|
807
731
|
var keyToPx = (key) => {
|
|
808
732
|
if (typeof key === "number") return key;
|
|
809
733
|
if (key === "base") return 0;
|
|
@@ -898,11 +822,6 @@ var LiteVuePlugins = (function(exports, _aevantec_litevue) {
|
|
|
898
822
|
}
|
|
899
823
|
} }
|
|
900
824
|
});
|
|
901
|
-
/**
|
|
902
|
-
* Drops every live subscription; `activate()` rebuilds them on the next read.
|
|
903
|
-
* The scale is deliberately left alone — a page that configured one still
|
|
904
|
-
* wants it.
|
|
905
|
-
*/
|
|
906
825
|
var releaseSubscriptions = () => {
|
|
907
826
|
scaleSubs.forEach((s) => s.off());
|
|
908
827
|
querySubs.forEach((s) => s.off());
|
|
@@ -143,7 +143,6 @@ var transition = (app) => {
|
|
|
143
143
|
});
|
|
144
144
|
elem.__leave = () => {
|
|
145
145
|
live = false;
|
|
146
|
-
elem.__leaving = 1;
|
|
147
146
|
return new Promise((resolve) => run("leave", resolve));
|
|
148
147
|
};
|
|
149
148
|
return () => {
|
|
@@ -177,7 +176,6 @@ var transition = (app) => {
|
|
|
177
176
|
};
|
|
178
177
|
// src/plugins/persist/index.ts
|
|
179
178
|
var PREFIX = "litevue:";
|
|
180
|
-
/** Custom storages registered by name, usable as a directive modifier. */
|
|
181
179
|
var registry = Object.create(null);
|
|
182
180
|
var defaultStorage = "local";
|
|
183
181
|
var builtin = (name) => {
|
|
@@ -211,11 +209,6 @@ var registerStorage = (name, storage) => {
|
|
|
211
209
|
var setDefaultStorage = (storage) => {
|
|
212
210
|
defaultStorage = storage;
|
|
213
211
|
};
|
|
214
|
-
/**
|
|
215
|
-
* Which own properties of `target` can round-trip through storage. Methods are
|
|
216
|
-
* behavior, not state; getter-only properties are derived and would throw on
|
|
217
|
-
* restore. An explicit list is filtered too, so naming a getter is a no-op.
|
|
218
|
-
*/
|
|
219
212
|
var persistable = (target, keys) => (keys ?? Object.keys(target)).filter((k) => {
|
|
220
213
|
if (k[0] === "$") return false;
|
|
221
214
|
const desc = Object.getOwnPropertyDescriptor(target, k);
|
|
@@ -224,7 +217,6 @@ var persistable = (target, keys) => (keys ?? Object.keys(target)).filter((k) =>
|
|
|
224
217
|
if (raw && raw.__v_isRef === true && raw.__v_isReadonly === true) return false;
|
|
225
218
|
return typeof target[k] !== "function";
|
|
226
219
|
});
|
|
227
|
-
/** Restore saved values, then keep storage in sync with every change. */
|
|
228
220
|
var sync = (target, key, keys, storage, run) => {
|
|
229
221
|
if (!storage) return run(() => {});
|
|
230
222
|
const fields = persistable(target, keys);
|
|
@@ -431,22 +423,11 @@ var collapse = (app) => {
|
|
|
431
423
|
});
|
|
432
424
|
};
|
|
433
425
|
// src/plugins/morph/index.ts
|
|
434
|
-
/**
|
|
435
|
-
* A `data-` attribute rather than `v-preserve`: an unrecognised `v-` attribute
|
|
436
|
-
* logs an unknown-directive error, and registering one would have the walker
|
|
437
|
-
* strip it, leaving nothing for the next morph. Matches `data-morph-skip`.
|
|
438
|
-
*/
|
|
439
426
|
var preserved = (node, opts) => node.nodeType === 1 && (node.hasAttribute("data-morph-preserve") || node.__marker || !!opts.preserve?.(node));
|
|
440
427
|
var LAZY = "[v-scope\\.visible],[v-scope\\.idle],[v-scope\\.interaction]";
|
|
441
428
|
var dirRE = /^(?:v-|:|@)/;
|
|
442
429
|
var bindRE = /^(?::|v-bind:)/;
|
|
443
430
|
var clientStyleRE = /^v-(?!scope|on:)/;
|
|
444
|
-
/**
|
|
445
|
-
* Attributes tried in order when no `key` option is given. All three express
|
|
446
|
-
* identity, so none repeat among siblings the way `name` does on a radio group
|
|
447
|
-
* — hence its absence. The attribute name is part of the key, so `id="5"` and
|
|
448
|
-
* `data-id="5"` stay distinct.
|
|
449
|
-
*/
|
|
450
431
|
var KEY_ATTRS = [
|
|
451
432
|
"id",
|
|
452
433
|
"data-key",
|
|
@@ -459,26 +440,11 @@ var defaultKey = (el) => {
|
|
|
459
440
|
}
|
|
460
441
|
return null;
|
|
461
442
|
};
|
|
462
|
-
/**
|
|
463
|
-
* The nearest stashed context, walking up from a live node. `v-scope` elements
|
|
464
|
-
* record theirs during walk, so inserted markup binds with the scope it landed
|
|
465
|
-
* in rather than the root.
|
|
466
|
-
*/
|
|
467
443
|
var nearestCtx = (node) => {
|
|
468
444
|
for (let el = node; el; el = el.parentElement) if (el.__ctx) return el.__ctx;
|
|
469
445
|
};
|
|
470
|
-
/**
|
|
471
|
-
* Disposal is per node, so any context can release any subtree. Outside every
|
|
472
|
-
* scope there is no parent context to ask, but a root inside the subtree has
|
|
473
|
-
* one; without this, its effects and listeners outlive it.
|
|
474
|
-
*/
|
|
475
446
|
var ctxIn = (n) => n.__ctx || [...n.children || []].map(ctxIn).find(Boolean);
|
|
476
447
|
var release = (node, ctx) => (ctx || ctxIn(node))?.dispose?.(node);
|
|
477
|
-
/**
|
|
478
|
-
* Attributes the client owns, read from the *incoming* markup — it still
|
|
479
|
-
* carries the directives the live DOM had stripped. `:class` there means the
|
|
480
|
-
* live `class` is bound and must survive the server's static value.
|
|
481
|
-
*/
|
|
482
448
|
var boundAttrs = (to) => {
|
|
483
449
|
const owned = /* @__PURE__ */ new Set();
|
|
484
450
|
if (to.matches("details,dialog")) owned.add("open");
|
|
@@ -495,13 +461,7 @@ var boundAttrs = (to) => {
|
|
|
495
461
|
}
|
|
496
462
|
return owned;
|
|
497
463
|
};
|
|
498
|
-
/**
|
|
499
|
-
* `v-for` and `v-if` render into Blocks: the live DOM holds anchors plus the
|
|
500
|
-
* clones the data produced, while the server still sends one template. Matched
|
|
501
|
-
* positionally, the rest would be deleted as "no longer sent".
|
|
502
|
-
*/
|
|
503
464
|
var isBlockRoot = (el) => el.hasAttribute("v-for") || el.hasAttribute("v-if") || el.hasAttribute("v-else") || el.hasAttribute("v-else-if");
|
|
504
|
-
/** True when the client, not the server, decides this element's contents. */
|
|
505
465
|
var ownsChildren = (to) => {
|
|
506
466
|
if (to.hasAttribute("v-text") || to.hasAttribute("v-html") || to.hasAttribute("v-pre") || to.hasAttribute("v-once") || isBlockRoot(to)) return true;
|
|
507
467
|
for (let c = to.firstElementChild; c; c = c.nextElementSibling) if (isBlockRoot(c)) return true;
|
|
@@ -525,6 +485,7 @@ var syncValues = (from, to, owned) => {
|
|
|
525
485
|
var patchAttrs = (from, to, values) => {
|
|
526
486
|
const owned = boundAttrs(to);
|
|
527
487
|
if (from.__anchor) owned.add("style");
|
|
488
|
+
for (const name of from.constructor.morphOwnedAttributes || []) owned.add(name);
|
|
528
489
|
if (values) syncValues(from, to, owned);
|
|
529
490
|
const bound = Object(from.__bound);
|
|
530
491
|
for (const { name, value } of to.attributes) {
|
|
@@ -536,10 +497,6 @@ var patchAttrs = (from, to, values) => {
|
|
|
536
497
|
from.removeAttribute(name);
|
|
537
498
|
}
|
|
538
499
|
};
|
|
539
|
-
/**
|
|
540
|
-
* Incoming text still holding `{{ }}` is rendered by a text directive on the
|
|
541
|
-
* live side, so the live value wins.
|
|
542
|
-
*/
|
|
543
500
|
var isInterpolation = (data, ctx) => data.includes(ctx ? ctx.delimiters[0] : "{{");
|
|
544
501
|
var patchNode = (from, to, ctx, opts) => {
|
|
545
502
|
if (from.nodeType !== to.nodeType) return replaceNode(from, to, ctx, opts);
|
|
@@ -570,11 +527,6 @@ var replaceNode = (from, to, ctx, opts) => {
|
|
|
570
527
|
mountNew(fresh, ctx);
|
|
571
528
|
return fresh;
|
|
572
529
|
};
|
|
573
|
-
/**
|
|
574
|
-
* Bind never-walked markup with the scope it was inserted into. The walker
|
|
575
|
-
* comes off the context, not an import, so this plugin doesn't pull a second
|
|
576
|
-
* copy of the core into the plugins bundle.
|
|
577
|
-
*/
|
|
578
530
|
var mountNew = (node, ctx) => {
|
|
579
531
|
if (node.parentElement?.closest(LAZY)) return;
|
|
580
532
|
const target = ctx || nearestCtx(node.parentNode);
|
|
@@ -619,7 +571,7 @@ var patchChildren = (from, to, ctx, opts) => {
|
|
|
619
571
|
keyed.delete(wantKey);
|
|
620
572
|
patchNode(match, newChild, ctx, opts);
|
|
621
573
|
} else insert(newChild);
|
|
622
|
-
} else if (oldChild && keyOf(oldChild) == null) {
|
|
574
|
+
} else if (oldChild && (keyOf(oldChild) == null || !wanted.has(keyOf(oldChild)) && oldChild.tagName === newChild.tagName)) {
|
|
623
575
|
if (preserved(oldChild, opts) && !preserved(newChild, opts)) {
|
|
624
576
|
oldChild = oldChild.nextSibling;
|
|
625
577
|
continue;
|
|
@@ -718,15 +670,6 @@ var ALIASES = {
|
|
|
718
670
|
desktop: "lg"
|
|
719
671
|
};
|
|
720
672
|
var NUMERIC = /^\d+$/;
|
|
721
|
-
/**
|
|
722
|
-
* Two reactive primitives, deliberately:
|
|
723
|
-
*
|
|
724
|
-
* - `bp`, one string, so named keys / `atLeast` / `device` cost each consumer
|
|
725
|
-
* a single dependency however many responsive maps the page declares.
|
|
726
|
-
* - `tick`, for arbitrary `match()` queries. Their results are read off the
|
|
727
|
-
* MediaQueryList rather than mirrored, since registering a query inside a
|
|
728
|
-
* running effect would write a dependency it just read and re-run it.
|
|
729
|
-
*/
|
|
730
673
|
var state = /* @__PURE__ */ reactive({
|
|
731
674
|
bp: "base",
|
|
732
675
|
tick: 0
|
|
@@ -740,17 +683,10 @@ var querySubs = /* @__PURE__ */ new Map();
|
|
|
740
683
|
var MAX_QUERIES = 64;
|
|
741
684
|
var supported = () => typeof window !== "undefined" && typeof window.matchMedia === "function";
|
|
742
685
|
var subscribe = (mql, cb) => {
|
|
743
|
-
|
|
744
|
-
mql.addEventListener("change", cb);
|
|
745
|
-
return {
|
|
746
|
-
mql,
|
|
747
|
-
off: () => mql.removeEventListener("change", cb)
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
mql.addListener(cb);
|
|
686
|
+
mql.addEventListener("change", cb);
|
|
751
687
|
return {
|
|
752
688
|
mql,
|
|
753
|
-
off: () => mql.
|
|
689
|
+
off: () => mql.removeEventListener("change", cb)
|
|
754
690
|
};
|
|
755
691
|
};
|
|
756
692
|
var currentBp = () => {
|
|
@@ -770,26 +706,15 @@ var buildScale = () => {
|
|
|
770
706
|
});
|
|
771
707
|
state.bp = currentBp();
|
|
772
708
|
};
|
|
773
|
-
/**
|
|
774
|
-
* Started by the first read, not by `app.use()`, so `mq` works in a plain
|
|
775
|
-
* module with no app mounted — otherwise it would report a frozen 'base'.
|
|
776
|
-
*/
|
|
777
709
|
var activate = () => {
|
|
778
710
|
if (active) return;
|
|
779
711
|
active = true;
|
|
780
712
|
buildScale();
|
|
781
713
|
};
|
|
782
|
-
/**
|
|
783
|
-
* Entry point for every public read: activates, and depends on `tick` so
|
|
784
|
-
* `configure()` can invalidate all of them. `bp` alone is not enough — a key
|
|
785
|
-
* absent from the current scale returns false without touching reactive state,
|
|
786
|
-
* so that effect could never recover once a later scale defined the key.
|
|
787
|
-
*/
|
|
788
714
|
var trackAll = () => {
|
|
789
715
|
activate();
|
|
790
716
|
state.tick;
|
|
791
717
|
};
|
|
792
|
-
/** SSR and jsdom have no matchMedia; every query reads false and bp stays base. */
|
|
793
718
|
var rawMatch = (query) => {
|
|
794
719
|
if (!supported()) return false;
|
|
795
720
|
let sub = querySubs.get(query);
|
|
@@ -803,7 +728,6 @@ var rawMatch = (query) => {
|
|
|
803
728
|
}
|
|
804
729
|
return sub.mql.matches;
|
|
805
730
|
};
|
|
806
|
-
/** A key's lower bound in pixels, or undefined if it names nothing. */
|
|
807
731
|
var keyToPx = (key) => {
|
|
808
732
|
if (typeof key === "number") return key;
|
|
809
733
|
if (key === "base") return 0;
|
|
@@ -898,11 +822,6 @@ var mq = /* @__PURE__ */ Object.defineProperties(mqFn, {
|
|
|
898
822
|
}
|
|
899
823
|
} }
|
|
900
824
|
});
|
|
901
|
-
/**
|
|
902
|
-
* Drops every live subscription; `activate()` rebuilds them on the next read.
|
|
903
|
-
* The scale is deliberately left alone — a page that configured one still
|
|
904
|
-
* wants it.
|
|
905
|
-
*/
|
|
906
825
|
var releaseSubscriptions = () => {
|
|
907
826
|
scaleSubs.forEach((s) => s.off());
|
|
908
827
|
querySubs.forEach((s) => s.off());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var LiteVuePlugins=function(e,t){var n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},i=(e,t,i)=>{let r="",o="",s=0;for(let a=0;a<t.length;a++){const i=n[t[a]];if(i){for(;s<e.length&&!i.test(e[s]);)s++;if(s>=e.length)return r;r+=o+e[s++],o=""}else o+=t[a],e[s]===t[a]&&s++}return i?r+o:r},r=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),o=(e,t)=>{const n=e.split(","),i=t.split(",");let o=0;for(let s=0;s<n.length;s++)o=Math.max(o,r(n[s])+r(i[s%i.length]));return o},s="litevue:",a=Object.create(null),c="local",l=e=>{const t=e??c;return"string"!=typeof t?t:a[t.toLowerCase()]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},d=(e,t,n,i,r)=>{if(!i)return r(()=>{});const o=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const i=n&&n.value;return(!i||!0!==i.__v_isRef||!0!==i.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(i.getItem(t)||"null");if(n)for(const t of o)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}catch{}return r(()=>{const n={};for(const t of o)n[t]=e[t];try{i.setItem(t,JSON.stringify(n))}catch{}})},f=[],u=(e,t,n)=>"radio"!==e.type||!e.name||e===(n.find(t=>"radio"===t.type&&t.name===e.name&&t.checked)||n.find(t=>"radio"===t.type&&t.name===e.name)),p=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||e.__marker||!!t.preserve?.(e)),m="[v-scope\\.visible],[v-scope\\.idle],[v-scope\\.interaction]",v=/^(?:v-|:|@)/,h=/^(?::|v-bind:)/,b=/^v-(?!scope|on:)/,g=["id","data-key","data-id"],y=e=>{for(const t of g){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},w=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},k=e=>e.__ctx||[...e.children||[]].map(k).find(Boolean),x=(e,t)=>(t||k(e))?.dispose?.(e),E=e=>{const t=new Set;e.matches("details,dialog")&&t.add("open");for(const{name:n}of e.attributes)if(h.test(n)){const e=n.replace(h,"").split(".")[0];t.add(/\.camel\b/.test(n)?e.replace(/-(\w)/g,(e,t)=>t.toUpperCase()):e)}else/^v-model\b/.test(n)?(t.add("value"),t.add("checked")):"v-bind"===n?t.add("*"):b.test(n)&&(t.add("style"),"v-popover"==n&&t.add("popover"));return t},S=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),_=["Value","Checked","Selected"],L=(e,t,n)=>{const i=E(t);e.__anchor&&i.add("style"),n&&((e,t,n)=>{const i=E(t.closest("select")||t);if(!(n.has("*")||i.has("*")||i.has("value")||"output"==e.type||"textarea"==e.type&&t.value.includes("{{")))for(const r of _){const i=r.toLowerCase(),o="default"+r,s="Selected"==r?o:i;!n.has(i)&&o in e&&e[i]!==t[s]&&(e[i]=t[s])}})(e,t,i);const r=Object(e.__bound);for(const{name:o,value:s}of t.attributes)v.test(o)||i.has(o)||o in r||e.getAttribute(o)!==s&&e.setAttribute(o,s);for(const{name:o}of[...e.attributes])i.has("*")||i.has(o)||t.hasAttribute(o)||e.removeAttribute(o)},T=(e,t,n,i)=>{if(e.nodeType!==t.nodeType)return A(e,t,n,i);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n)&&"SCRIPT"!=e.parentNode?.nodeName)return;return e.data?void(e.data!==r&&(e.data=r)):A(e,t,n,i)}if(1!==e.nodeType)return;const r=e,o=t;if(r.tagName!==o.tagName)return A(e,t,n,i);if(!i.skip?.(r,o)&&!r.hasAttribute("data-morph-skip")){if(r.matches(m))return r.isEqualNode(o)?void 0:A(e,t,n,i);L(r,o,i.values),"TEMPLATE"!=r.tagName||r.content.isEqualNode(o.content)||(r.innerHTML=o.innerHTML),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||S(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(S(t))return!0;return!1})(o)||Object.getOwnPropertyDescriptor(Object(r.__ctx?.scope),"$template")||N(r,o,r.__ctx||n,i)}},A=(e,t,n,i)=>{if(p(e,i))return;const r=t.cloneNode(!0);return!1!==i.beforeNodeAdded?.(r)?(x(e,n),e.parentNode.replaceChild(r,e),i.afterNodeRemoved?.(e),O(r,n),r):void 0},O=(e,t)=>{if(e.parentElement?.closest(m))return;const n=t||w(e.parentNode);n?.walk?.(e,n)},N=(e,t,n,i)=>{const r=i.key||y,o=new Map;for(let u=e.firstChild;u;u=u.nextSibling)if(1===u.nodeType){const e=r(u);if(null==e)continue;o.set(e,u)}const s=e=>e&&1===e.nodeType?r(e):null,a=new Set;for(let u=t.firstChild;u;u=u.nextSibling)a.add(s(u));const c=t=>{p(t,i)||(x(t,n),e.removeChild(t),i.afterNodeRemoved?.(t))};let l=e.firstChild,d=t.firstChild;const f=t=>{const r=t.cloneNode(!0);!1!==i.beforeNodeAdded?.(r)&&(e.insertBefore(r,l),O(r,n))};for(;d;){const t=d.nextSibling,r=s(d);if(""===l?.data&&d.hasAttribute?.("v-teleport"))l=l.nextSibling;else if(null!=r){const t=o.get(r);t?(t===l?l=l.nextSibling:e.insertBefore(t,l),o.delete(r),T(t,d,n,i)):f(d)}else if(l&&null==s(l)){if(p(l,i)&&!p(d,i)){l=l.nextSibling;continue}const e=l.nextSibling;T(l,d,n,i),l=e}else{if(l&&!a.has(s(l))){const e=l.nextSibling;c(l),l=e;continue}f(d)}d=t}for(;l;){const e=l.nextSibling;c(l),l=e}},$=(e,t,n={})=>{let i;if("string"==typeof t){const n=document.createElement("template"),r=e instanceof SVGElement;n.innerHTML=r?`<svg>${t.trim()}</svg>`:t.trim();const o=r?n.content.firstChild:n.content;i=1===o.childNodes.length&&o.firstElementChild?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.append(...o.childNodes),t})()}else i=t;if(i){const t=()=>{const t=C();e=T(e,i,w(e.parentNode),n)||e,t()};n.transition&&document.startViewTransition?document.startViewTransition(t):t()}return e},C=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,i=null;try{n=t.selectionStart,i=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,i)}catch{}}},P={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},j=Object.freeze({...P}),q={mobile:"base",tablet:"md",desktop:"lg"},M=/^\d+$/,D=(0,t.reactive)({bp:"base",tick:0}),R={...P},z=["base"],I=!1,V=[],B=new Map,H=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,W=(e,t)=>e.addEventListener?(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}):(e.addListener(t),{mql:e,off:()=>e.removeListener(t)}),K=()=>{for(let e=V.length-1;e>=0;e--)if(V[e].mql.matches)return z[e+1];return"base"},J=()=>{V.forEach(e=>e.off()),V=[];const e=Object.keys(R).filter(e=>R[e]>0).sort((e,t)=>R[e]-R[t]);z=["base",...e],H()&&(V=e.map(e=>{const t=window.matchMedia(`(min-width: ${R[e]}px)`);return W(t,()=>{D.bp=K()})}),D.bp=K())},Z=()=>{I||(I=!0,J()),D.tick},F=e=>{if(!H())return!1;let t=B.get(e);t?B.delete(e):t=W(window.matchMedia(e),()=>D.tick++),B.set(e,t);for(const[n,i]of B){if(B.size<=64)break;i.off(),B.delete(n)}return t.mql.matches},G=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(M.test(e))return Number(e);const t=void 0===R[e]?q[e]:void 0;return void 0!==t?"base"===t?0:R[t]:R[e]},U=e=>{if(e<=0)return!0;const t=z.findIndex(t=>"base"!==t&&R[t]===e);return-1!==t?z.indexOf(D.bp)>=t:(D.tick,F(`(min-width: ${e}px)`))},Q=(e,t)=>{if(Z(),!e||"object"!=typeof e)return t;let n,i=-1;for(const r of Object.keys(e)){const t=G(r);void 0!==t&&(t>=i&&U(t)&&(i=t,n=e[r]))}return void 0!==n?n:t},X=e=>{const t=q[e],n=R[t];return void 0!==n?n:P[t]},Y=(e,t)=>Q(e,t),ee=Object.defineProperties(Y,{props:{value:e=>{Z();const t={};for(const n of Object.keys(e))t[n]=Q(e[n]);return t}},breakpoint:{get:()=>(Z(),D.bp),enumerable:!0},device:{get:()=>(Z(),U(X("tablet"))?U(X("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{Z();const t=G(e);return void 0!==t&&U(t)}},match:{value:e=>(Z(),F(e))},configure:{value:({breakpoints:e})=>{e&&(R={...e},I&&(J(),D.tick++))}}}),te=()=>{V.forEach(e=>e.off()),B.forEach(e=>e.off()),V=[],B.clear(),I=!1};return e.collapse=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:i})=>{const r=e;let o=250;for(const u in i||{}){const e=/^duration-(\d+)$/.exec(u);e&&(o=+e[1])}const s=["overflow","height","transition","visibility"],a=s.map(e=>r.style[e]);let c,l=0;const d=new Set,f=(e,t)=>{const n=setTimeout(()=>{d.delete(n),e()},t);d.add(n)};return n(()=>{const e=!!t();if(e===c)return;const n=++l;var i;i=!e,r.style.visibility=i?"hidden":a[3],r.style.overflow=e&&null==c?a[0]:"hidden",null==c?f(()=>{r.style.transition=`height ${o}ms ease, visibility ${o}ms`}):(r.style.height=a[1]||r.scrollHeight+"px",e?f(()=>{n===l&&(r.style.height=a[1],r.style.overflow=a[0])},o):r.offsetHeight),e||(r.style.height="0px"),c=e}),()=>{d.forEach(clearTimeout),s.forEach((e,t)=>r.style[e]=a[t])}})},e.defaultBreakpoints=j,e.focus=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:i})=>{let r=!0,o=!1;return n(()=>{o!==(o=!!t())&&Promise.resolve().then(()=>{r&&o&&(e.focus(),i?.select&&e.select&&e.select())})}),()=>{r=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let i=!1,r=null;const o=()=>[...e.querySelectorAll("a[href],area[href],button,input:not([type=hidden]),select,textarea,summary,iframe,audio[controls],video[controls],[contenteditable],[tabindex]")].filter(e=>e.tabIndex>=0&&!e.matches(":disabled,[inert],[inert] *")&&!1!==e.checkVisibility?.({visibilityProperty:!0})).filter(u),s=t=>{if("Tab"!==t.key||f.at(-1)!==e)return;const n=o();if(!n.length)return void t.preventDefault();const i=n[0],r=n[n.length-1],s=document.activeElement;e.contains(s)?(t.shiftKey?i:r).compareDocumentPosition(s)&(t.shiftKey?4:2)||(t.preventDefault(),(t.shiftKey?r:i).focus()):(t.preventDefault(),i.focus())},a=()=>{i=!1,f.splice(f.indexOf(e),1),document.removeEventListener("keydown",s,!0),r&&r.focus&&r.focus()};return n(()=>{const n=!!t();n&&!i?(i=!0,r=document.activeElement,f.splice(f.findIndex(t=>e.contains(t))>>>0,0,e),document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{i&&f.at(-1)===e&&(o()[0]||e).focus()})):!n&&i&&a()}),()=>{i&&a()}})},e.intersect=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{let i=!1;const r=new IntersectionObserver(e=>{for(const o of e){const e=n?.full?o.intersectionRatio>=1:o.isIntersecting,s=n?.leave?i&&!e:e&&!i;i=e,s&&(t(),n?.once&&r.disconnect())}},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},e.mask=e=>{e.directive("mask",({el:e,exp:t})=>{const r=e,o=e=>{const{value:o,selectionStart:s}=r,a=e?.inputType,c=i(o,t,!a?.startsWith("del"));if(c===o)return!1;if(r.value=c,null!=s&&document.activeElement===r){let e=i(o.slice(0,s),t).length;if(!e||!a?.endsWith("Backward"))for(;e<c.length&&!n[t[e]];)e++;r.setSelectionRange(e,e)}return!0};e.addEventListener("input",o);const s=o();let a=!0;return Promise.resolve().then(()=>{a&&(o()||s)&&(e.dispatchEvent(new Event("input")),e.dispatchEvent(new Event("change")))}),()=>{a=!1,e.removeEventListener("input",o)}})},e.media=(e,t)=>(t&&ee.configure(t),e.scope.$mq=ee,e.scope.$mqProps=ee.props,e.scope.$mqAtLeast=ee.atLeast,e.scope.$mqMatch=ee.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>ee.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>ee.device,enumerable:!0,configurable:!0}),()=>{te(),D.tick++}),e.morph=$,e.morphPlugin=e=>{e.scope.$morph=$},e.mq=ee,e.persist=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:i,modifiers:r,effect:o})=>{const a=s+(n||t.id);let c=r?void 0:l();for(const s in r)if(c=l(s))break;const f=i?i.split(",").map(e=>e.trim()).filter(Boolean):void 0;d(e.scope,a,f,c,o)})},e.persistStore=(e,n={})=>{const i=(0,t.store)(e);if(!i)return()=>{};const r=l(n.storage);return d(i,s+(n.key??e),n.keys,r,t.watchEffect)},e.registerStorage=(e,t)=>{a[e.toLowerCase()]=t},e.resetMedia=()=>{te(),R={...P},z=["base",...Object.keys(R).sort((e,t)=>R[e]-R[t])],I=!1,D.bp="base",D.tick=0},e.resize=e=>{e.directive("resize",({el:e,get:t,exp:n,modifiers:i})=>{const r=t(`(($width, $height) => { ${n} })`);if(i?.window||i?.visual){const e=i.visual&&window.visualViewport||window,t=()=>r(e.width||innerWidth,e.height||innerHeight);return e.addEventListener("resize",t),t(),()=>e.removeEventListener("resize",t)}const o=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;r(e.width,e.height)}});return o.observe(e),()=>o.disconnect()})},e.setDefaultStorage=e=>{c=e},e.transition=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:i,modifiers:r,exp:s})=>{const a=e,c=i||"v",l=e=>`${c}-${e}`;let d,f=0;const u=()=>{a.classList.remove(l("enter-from"),l("enter-active"),l("enter-to"),l("leave-from"),l("leave-active"),l("leave-to"))},p=(e,t)=>{const n=++f;u(),a.classList.add(l(e+"-from"),l(e+"-active")),a.offsetWidth,a.classList.remove(l(e+"-from")),a.classList.add(l(e+"-to")),clearTimeout(d),d=setTimeout(()=>{n===f&&(u(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(o(t.transitionDuration,t.transitionDelay),o(t.animationDuration,t.animationDelay))})(a))};if(!s){let e=!0;return Promise.resolve().then(()=>{e&&p("enter")}),a.__leave=()=>(e=!1,a.__leaving=1,new Promise(e=>p("leave",e))),()=>{e=!1,clearTimeout(d),u(),delete a.__leave}}const m="none"==a.style.display?"":a.style.display;let v;return n(()=>{const e=!!t();if(e===v)return;const n=null!=v;v=e,e?(a.style.display=m,(n||r?.appear)&&p("enter")):n?p("leave",()=>{a.style.display="none"}):a.style.display="none"}),()=>{clearTimeout(d),u(),!1===v&&(a.style.display="none")}})},e}({},LiteVue);
|
|
1
|
+
var LiteVuePlugins=function(e,t){var n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},i=(e,t,i)=>{let r="",o="",s=0;for(let a=0;a<t.length;a++){const i=n[t[a]];if(i){for(;s<e.length&&!i.test(e[s]);)s++;if(s>=e.length)return r;r+=o+e[s++],o=""}else o+=t[a],e[s]===t[a]&&s++}return i?r+o:r},r=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),o=(e,t)=>{const n=e.split(","),i=t.split(",");let o=0;for(let s=0;s<n.length;s++)o=Math.max(o,r(n[s])+r(i[s%i.length]));return o},s="litevue:",a=Object.create(null),c="local",l=e=>{const t=e??c;return"string"!=typeof t?t:a[t.toLowerCase()]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},d=(e,t,n,i,r)=>{if(!i)return r(()=>{});const o=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const i=n&&n.value;return(!i||!0!==i.__v_isRef||!0!==i.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(i.getItem(t)||"null");if(n)for(const t of o)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}catch{}return r(()=>{const n={};for(const t of o)n[t]=e[t];try{i.setItem(t,JSON.stringify(n))}catch{}})},f=[],u=(e,t,n)=>"radio"!==e.type||!e.name||e===(n.find(t=>"radio"===t.type&&t.name===e.name&&t.checked)||n.find(t=>"radio"===t.type&&t.name===e.name)),p=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||e.__marker||!!t.preserve?.(e)),m="[v-scope\\.visible],[v-scope\\.idle],[v-scope\\.interaction]",h=/^(?:v-|:|@)/,v=/^(?::|v-bind:)/,b=/^v-(?!scope|on:)/,g=["id","data-key","data-id"],y=e=>{for(const t of g){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},w=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},k=e=>e.__ctx||[...e.children||[]].map(k).find(Boolean),x=(e,t)=>(t||k(e))?.dispose?.(e),E=e=>{const t=new Set;e.matches("details,dialog")&&t.add("open");for(const{name:n}of e.attributes)if(v.test(n)){const e=n.replace(v,"").split(".")[0];t.add(/\.camel\b/.test(n)?e.replace(/-(\w)/g,(e,t)=>t.toUpperCase()):e)}else/^v-model\b/.test(n)?(t.add("value"),t.add("checked")):"v-bind"===n?t.add("*"):b.test(n)&&(t.add("style"),"v-popover"==n&&t.add("popover"));return t},S=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),_=["Value","Checked","Selected"],A=(e,t,n)=>{const i=E(t);e.__anchor&&i.add("style");for(const o of e.constructor.morphOwnedAttributes||[])i.add(o);n&&((e,t,n)=>{const i=E(t.closest("select")||t);if(!(n.has("*")||i.has("*")||i.has("value")||"output"==e.type||"textarea"==e.type&&t.value.includes("{{")))for(const r of _){const i=r.toLowerCase(),o="default"+r,s="Selected"==r?o:i;!n.has(i)&&o in e&&e[i]!==t[s]&&(e[i]=t[s])}})(e,t,i);const r=Object(e.__bound);for(const{name:o,value:s}of t.attributes)h.test(o)||i.has(o)||o in r||e.getAttribute(o)!==s&&e.setAttribute(o,s);for(const{name:o}of[...e.attributes])i.has("*")||i.has(o)||t.hasAttribute(o)||e.removeAttribute(o)},L=(e,t,n,i)=>{if(e.nodeType!==t.nodeType)return N(e,t,n,i);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n)&&"SCRIPT"!=e.parentNode?.nodeName)return;return e.data?void(e.data!==r&&(e.data=r)):N(e,t,n,i)}if(1!==e.nodeType)return;const r=e,o=t;if(r.tagName!==o.tagName)return N(e,t,n,i);if(!i.skip?.(r,o)&&!r.hasAttribute("data-morph-skip")){if(r.matches(m))return r.isEqualNode(o)?void 0:N(e,t,n,i);A(r,o,i.values),"TEMPLATE"!=r.tagName||r.content.isEqualNode(o.content)||(r.innerHTML=o.innerHTML),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||S(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(S(t))return!0;return!1})(o)||Object.getOwnPropertyDescriptor(Object(r.__ctx?.scope),"$template")||T(r,o,r.__ctx||n,i)}},N=(e,t,n,i)=>{if(p(e,i))return;const r=t.cloneNode(!0);return!1!==i.beforeNodeAdded?.(r)?(x(e,n),e.parentNode.replaceChild(r,e),i.afterNodeRemoved?.(e),O(r,n),r):void 0},O=(e,t)=>{if(e.parentElement?.closest(m))return;const n=t||w(e.parentNode);n?.walk?.(e,n)},T=(e,t,n,i)=>{const r=i.key||y,o=new Map;for(let u=e.firstChild;u;u=u.nextSibling)if(1===u.nodeType){const e=r(u);if(null==e)continue;o.set(e,u)}const s=e=>e&&1===e.nodeType?r(e):null,a=new Set;for(let u=t.firstChild;u;u=u.nextSibling)a.add(s(u));const c=t=>{p(t,i)||(x(t,n),e.removeChild(t),i.afterNodeRemoved?.(t))};let l=e.firstChild,d=t.firstChild;const f=t=>{const r=t.cloneNode(!0);!1!==i.beforeNodeAdded?.(r)&&(e.insertBefore(r,l),O(r,n))};for(;d;){const t=d.nextSibling,r=s(d);if(""===l?.data&&d.hasAttribute?.("v-teleport"))l=l.nextSibling;else if(null!=r){const t=o.get(r);t?(t===l?l=l.nextSibling:e.insertBefore(t,l),o.delete(r),L(t,d,n,i)):f(d)}else if(l&&(null==s(l)||!a.has(s(l))&&l.tagName===d.tagName)){if(p(l,i)&&!p(d,i)){l=l.nextSibling;continue}const e=l.nextSibling;L(l,d,n,i),l=e}else{if(l&&!a.has(s(l))){const e=l.nextSibling;c(l),l=e;continue}f(d)}d=t}for(;l;){const e=l.nextSibling;c(l),l=e}},$=(e,t,n={})=>{let i;if("string"==typeof t){const n=document.createElement("template"),r=e instanceof SVGElement;n.innerHTML=r?`<svg>${t.trim()}</svg>`:t.trim();const o=r?n.content.firstChild:n.content;i=1===o.childNodes.length&&o.firstElementChild?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.append(...o.childNodes),t})()}else i=t;if(i){const t=()=>{const t=C();e=L(e,i,w(e.parentNode),n)||e,t()};n.transition&&document.startViewTransition?document.startViewTransition(t):t()}return e},C=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,i=null;try{n=t.selectionStart,i=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,i)}catch{}}},P={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},j=Object.freeze({...P}),q={mobile:"base",tablet:"md",desktop:"lg"},M=/^\d+$/,D=(0,t.reactive)({bp:"base",tick:0}),R={...P},z=["base"],I=!1,V=[],B=new Map,H=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,W=(e,t)=>(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}),K=()=>{for(let e=V.length-1;e>=0;e--)if(V[e].mql.matches)return z[e+1];return"base"},J=()=>{V.forEach(e=>e.off()),V=[];const e=Object.keys(R).filter(e=>R[e]>0).sort((e,t)=>R[e]-R[t]);z=["base",...e],H()&&(V=e.map(e=>{const t=window.matchMedia(`(min-width: ${R[e]}px)`);return W(t,()=>{D.bp=K()})}),D.bp=K())},Z=()=>{I||(I=!0,J()),D.tick},F=e=>{if(!H())return!1;let t=B.get(e);t?B.delete(e):t=W(window.matchMedia(e),()=>D.tick++),B.set(e,t);for(const[n,i]of B){if(B.size<=64)break;i.off(),B.delete(n)}return t.mql.matches},G=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(M.test(e))return Number(e);const t=void 0===R[e]?q[e]:void 0;return void 0!==t?"base"===t?0:R[t]:R[e]},U=e=>{if(e<=0)return!0;const t=z.findIndex(t=>"base"!==t&&R[t]===e);return-1!==t?z.indexOf(D.bp)>=t:(D.tick,F(`(min-width: ${e}px)`))},Q=(e,t)=>{if(Z(),!e||"object"!=typeof e)return t;let n,i=-1;for(const r of Object.keys(e)){const t=G(r);void 0!==t&&(t>=i&&U(t)&&(i=t,n=e[r]))}return void 0!==n?n:t},X=e=>{const t=q[e],n=R[t];return void 0!==n?n:P[t]},Y=(e,t)=>Q(e,t),ee=Object.defineProperties(Y,{props:{value:e=>{Z();const t={};for(const n of Object.keys(e))t[n]=Q(e[n]);return t}},breakpoint:{get:()=>(Z(),D.bp),enumerable:!0},device:{get:()=>(Z(),U(X("tablet"))?U(X("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{Z();const t=G(e);return void 0!==t&&U(t)}},match:{value:e=>(Z(),F(e))},configure:{value:({breakpoints:e})=>{e&&(R={...e},I&&(J(),D.tick++))}}}),te=()=>{V.forEach(e=>e.off()),B.forEach(e=>e.off()),V=[],B.clear(),I=!1};return e.collapse=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:i})=>{const r=e;let o=250;for(const u in i||{}){const e=/^duration-(\d+)$/.exec(u);e&&(o=+e[1])}const s=["overflow","height","transition","visibility"],a=s.map(e=>r.style[e]);let c,l=0;const d=new Set,f=(e,t)=>{const n=setTimeout(()=>{d.delete(n),e()},t);d.add(n)};return n(()=>{const e=!!t();if(e===c)return;const n=++l;var i;i=!e,r.style.visibility=i?"hidden":a[3],r.style.overflow=e&&null==c?a[0]:"hidden",null==c?f(()=>{r.style.transition=`height ${o}ms ease, visibility ${o}ms`}):(r.style.height=a[1]||r.scrollHeight+"px",e?f(()=>{n===l&&(r.style.height=a[1],r.style.overflow=a[0])},o):r.offsetHeight),e||(r.style.height="0px"),c=e}),()=>{d.forEach(clearTimeout),s.forEach((e,t)=>r.style[e]=a[t])}})},e.defaultBreakpoints=j,e.focus=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:i})=>{let r=!0,o=!1;return n(()=>{o!==(o=!!t())&&Promise.resolve().then(()=>{r&&o&&(e.focus(),i?.select&&e.select&&e.select())})}),()=>{r=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let i=!1,r=null;const o=()=>[...e.querySelectorAll("a[href],area[href],button,input:not([type=hidden]),select,textarea,summary,iframe,audio[controls],video[controls],[contenteditable],[tabindex]")].filter(e=>e.tabIndex>=0&&!e.matches(":disabled,[inert],[inert] *")&&!1!==e.checkVisibility?.({visibilityProperty:!0})).filter(u),s=t=>{if("Tab"!==t.key||f.at(-1)!==e)return;const n=o();if(!n.length)return void t.preventDefault();const i=n[0],r=n[n.length-1],s=document.activeElement;e.contains(s)?(t.shiftKey?i:r).compareDocumentPosition(s)&(t.shiftKey?4:2)||(t.preventDefault(),(t.shiftKey?r:i).focus()):(t.preventDefault(),i.focus())},a=()=>{i=!1,f.splice(f.indexOf(e),1),document.removeEventListener("keydown",s,!0),r&&r.focus&&r.focus()};return n(()=>{const n=!!t();n&&!i?(i=!0,r=document.activeElement,f.splice(f.findIndex(t=>e.contains(t))>>>0,0,e),document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{i&&f.at(-1)===e&&(o()[0]||e).focus()})):!n&&i&&a()}),()=>{i&&a()}})},e.intersect=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{let i=!1;const r=new IntersectionObserver(e=>{for(const o of e){const e=n?.full?o.intersectionRatio>=1:o.isIntersecting,s=n?.leave?i&&!e:e&&!i;i=e,s&&(t(),n?.once&&r.disconnect())}},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},e.mask=e=>{e.directive("mask",({el:e,exp:t})=>{const r=e,o=e=>{const{value:o,selectionStart:s}=r,a=e?.inputType,c=i(o,t,!a?.startsWith("del"));if(c===o)return!1;if(r.value=c,null!=s&&document.activeElement===r){let e=i(o.slice(0,s),t).length;if(!e||!a?.endsWith("Backward"))for(;e<c.length&&!n[t[e]];)e++;r.setSelectionRange(e,e)}return!0};e.addEventListener("input",o);const s=o();let a=!0;return Promise.resolve().then(()=>{a&&(o()||s)&&(e.dispatchEvent(new Event("input")),e.dispatchEvent(new Event("change")))}),()=>{a=!1,e.removeEventListener("input",o)}})},e.media=(e,t)=>(t&&ee.configure(t),e.scope.$mq=ee,e.scope.$mqProps=ee.props,e.scope.$mqAtLeast=ee.atLeast,e.scope.$mqMatch=ee.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>ee.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>ee.device,enumerable:!0,configurable:!0}),()=>{te(),D.tick++}),e.morph=$,e.morphPlugin=e=>{e.scope.$morph=$},e.mq=ee,e.persist=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:i,modifiers:r,effect:o})=>{const a=s+(n||t.id);let c=r?void 0:l();for(const s in r)if(c=l(s))break;const f=i?i.split(",").map(e=>e.trim()).filter(Boolean):void 0;d(e.scope,a,f,c,o)})},e.persistStore=(e,n={})=>{const i=(0,t.store)(e);if(!i)return()=>{};const r=l(n.storage);return d(i,s+(n.key??e),n.keys,r,t.watchEffect)},e.registerStorage=(e,t)=>{a[e.toLowerCase()]=t},e.resetMedia=()=>{te(),R={...P},z=["base",...Object.keys(R).sort((e,t)=>R[e]-R[t])],I=!1,D.bp="base",D.tick=0},e.resize=e=>{e.directive("resize",({el:e,get:t,exp:n,modifiers:i})=>{const r=t(`(($width, $height) => { ${n} })`);if(i?.window||i?.visual){const e=i.visual&&window.visualViewport||window,t=()=>r(e.width||innerWidth,e.height||innerHeight);return e.addEventListener("resize",t),t(),()=>e.removeEventListener("resize",t)}const o=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;r(e.width,e.height)}});return o.observe(e),()=>o.disconnect()})},e.setDefaultStorage=e=>{c=e},e.transition=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:i,modifiers:r,exp:s})=>{const a=e,c=i||"v",l=e=>`${c}-${e}`;let d,f=0;const u=()=>{a.classList.remove(l("enter-from"),l("enter-active"),l("enter-to"),l("leave-from"),l("leave-active"),l("leave-to"))},p=(e,t)=>{const n=++f;u(),a.classList.add(l(e+"-from"),l(e+"-active")),a.offsetWidth,a.classList.remove(l(e+"-from")),a.classList.add(l(e+"-to")),clearTimeout(d),d=setTimeout(()=>{n===f&&(u(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(o(t.transitionDuration,t.transitionDelay),o(t.animationDuration,t.animationDelay))})(a))};if(!s){let e=!0;return Promise.resolve().then(()=>{e&&p("enter")}),a.__leave=()=>(e=!1,new Promise(e=>p("leave",e))),()=>{e=!1,clearTimeout(d),u(),delete a.__leave}}const m="none"==a.style.display?"":a.style.display;let h;return n(()=>{const e=!!t();if(e===h)return;const n=null!=h;h=e,e?(a.style.display=m,(n||r?.appear)&&p("enter")):n?p("leave",()=>{a.style.display="none"}):a.style.display="none"}),()=>{clearTimeout(d),u(),!1===h&&(a.style.display="none")}})},e}({},LiteVue);
|
package/dist/litevue-plugins.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,store as t,watchEffect as n}from"@aevantec/litevue";var i=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{let i=!1;const o=new IntersectionObserver(e=>{for(const r of e){const e=n?.full?r.intersectionRatio>=1:r.isIntersecting,s=n?.leave?i&&!e:e&&!i;i=e,s&&(t(),n?.once&&o.disconnect())}},{threshold:n?.full?1:0});return o.observe(e),()=>o.disconnect()})},o={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},r=(e,t,n)=>{let i="",r="",s=0;for(let a=0;a<t.length;a++){const n=o[t[a]];if(n){for(;s<e.length&&!n.test(e[s]);)s++;if(s>=e.length)return i;i+=r+e[s++],r=""}else r+=t[a],e[s]===t[a]&&s++}return n?i+r:i},s=e=>{e.directive("mask",({el:e,exp:t})=>{const n=e,i=e=>{const{value:i,selectionStart:s}=n,a=e?.inputType,c=r(i,t,!a?.startsWith("del"));if(c===i)return!1;if(n.value=c,null!=s&&document.activeElement===n){let e=r(i.slice(0,s),t).length;if(!e||!a?.endsWith("Backward"))for(;e<c.length&&!o[t[e]];)e++;n.setSelectionRange(e,e)}return!0};e.addEventListener("input",i);const s=i();let a=!0;return Promise.resolve().then(()=>{a&&(i()||s)&&(e.dispatchEvent(new Event("input")),e.dispatchEvent(new Event("change")))}),()=>{a=!1,e.removeEventListener("input",i)}})},a=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),c=(e,t)=>{const n=e.split(","),i=t.split(",");let o=0;for(let r=0;r<n.length;r++)o=Math.max(o,a(n[r])+a(i[r%i.length]));return o},l=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:i,modifiers:o,exp:r})=>{const s=e,a=i||"v",l=e=>`${a}-${e}`;let d,f=0;const u=()=>{s.classList.remove(l("enter-from"),l("enter-active"),l("enter-to"),l("leave-from"),l("leave-active"),l("leave-to"))},p=(e,t)=>{const n=++f;u(),s.classList.add(l(e+"-from"),l(e+"-active")),s.offsetWidth,s.classList.remove(l(e+"-from")),s.classList.add(l(e+"-to")),clearTimeout(d),d=setTimeout(()=>{n===f&&(u(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(c(t.transitionDuration,t.transitionDelay),c(t.animationDuration,t.animationDelay))})(s))};if(!r){let e=!0;return Promise.resolve().then(()=>{e&&p("enter")}),s.__leave=()=>(e=!1,s.__leaving=1,new Promise(e=>p("leave",e))),()=>{e=!1,clearTimeout(d),u(),delete s.__leave}}const m="none"==s.style.display?"":s.style.display;let v;return n(()=>{const e=!!t();if(e===v)return;const n=null!=v;v=e,e?(s.style.display=m,(n||o?.appear)&&p("enter")):n?p("leave",()=>{s.style.display="none"}):s.style.display="none"}),()=>{clearTimeout(d),u(),!1===v&&(s.style.display="none")}})},d="litevue:",f=Object.create(null),u="local",p=e=>{const t=e??u;return"string"!=typeof t?t:f[t.toLowerCase()]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},m=(e,t)=>{f[e.toLowerCase()]=t},v=e=>{u=e},h=(e,t,n,i,o)=>{if(!i)return o(()=>{});const r=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const i=n&&n.value;return(!i||!0!==i.__v_isRef||!0!==i.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(i.getItem(t)||"null");if(n)for(const t of r)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}catch{}return o(()=>{const n={};for(const t of r)n[t]=e[t];try{i.setItem(t,JSON.stringify(n))}catch{}})},b=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:i,modifiers:o,effect:r})=>{const s=d+(n||t.id);let a=o?void 0:p();for(const l in o)if(a=p(l))break;const c=i?i.split(",").map(e=>e.trim()).filter(Boolean):void 0;h(e.scope,s,c,a,r)})},y=(e,i={})=>{const o=t(e);if(!o)return()=>{};const r=p(i.storage);return h(o,d+(i.key??e),i.keys,r,n)},g=[],w=(e,t,n)=>"radio"!==e.type||!e.name||e===(n.find(t=>"radio"===t.type&&t.name===e.name&&t.checked)||n.find(t=>"radio"===t.type&&t.name===e.name)),x=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:i})=>{let o=!0,r=!1;return n(()=>{r!==(r=!!t())&&Promise.resolve().then(()=>{o&&r&&(e.focus(),i?.select&&e.select&&e.select())})}),()=>{o=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let i=!1,o=null;const r=()=>[...e.querySelectorAll("a[href],area[href],button,input:not([type=hidden]),select,textarea,summary,iframe,audio[controls],video[controls],[contenteditable],[tabindex]")].filter(e=>e.tabIndex>=0&&!e.matches(":disabled,[inert],[inert] *")&&!1!==e.checkVisibility?.({visibilityProperty:!0})).filter(w),s=t=>{if("Tab"!==t.key||g.at(-1)!==e)return;const n=r();if(!n.length)return void t.preventDefault();const i=n[0],o=n[n.length-1],s=document.activeElement;e.contains(s)?(t.shiftKey?i:o).compareDocumentPosition(s)&(t.shiftKey?4:2)||(t.preventDefault(),(t.shiftKey?o:i).focus()):(t.preventDefault(),i.focus())},a=()=>{i=!1,g.splice(g.indexOf(e),1),document.removeEventListener("keydown",s,!0),o&&o.focus&&o.focus()};return n(()=>{const n=!!t();n&&!i?(i=!0,o=document.activeElement,g.splice(g.findIndex(t=>e.contains(t))>>>0,0,e),document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{i&&g.at(-1)===e&&(r()[0]||e).focus()})):!n&&i&&a()}),()=>{i&&a()}})},k=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:i})=>{const o=e;let r=250;for(const u in i||{}){const e=/^duration-(\d+)$/.exec(u);e&&(r=+e[1])}const s=["overflow","height","transition","visibility"],a=s.map(e=>o.style[e]);let c,l=0;const d=/* @__PURE__ */new Set,f=(e,t)=>{const n=setTimeout(()=>{d.delete(n),e()},t);d.add(n)};return n(()=>{const e=!!t();if(e===c)return;const n=++l;var i;i=!e,o.style.visibility=i?"hidden":a[3],o.style.overflow=e&&null==c?a[0]:"hidden",null==c?f(()=>{o.style.transition=`height ${r}ms ease, visibility ${r}ms`}):(o.style.height=a[1]||o.scrollHeight+"px",e?f(()=>{n===l&&(o.style.height=a[1],o.style.overflow=a[0])},r):o.offsetHeight),e||(o.style.height="0px"),c=e}),()=>{d.forEach(clearTimeout),s.forEach((e,t)=>o.style[e]=a[t])}})},E=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||e.__marker||!!t.preserve?.(e)),S="[v-scope\\.visible],[v-scope\\.idle],[v-scope\\.interaction]",_=/^(?:v-|:|@)/,L=/^(?::|v-bind:)/,T=/^v-(?!scope|on:)/,A=["id","data-key","data-id"],O=e=>{for(const t of A){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},N=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},$=e=>e.__ctx||[...e.children||[]].map($).find(Boolean),C=(e,t)=>(t||$(e))?.dispose?.(e),P=e=>{const t=/* @__PURE__ */new Set;e.matches("details,dialog")&&t.add("open");for(const{name:n}of e.attributes)if(L.test(n)){const e=n.replace(L,"").split(".")[0];t.add(/\.camel\b/.test(n)?e.replace(/-(\w)/g,(e,t)=>t.toUpperCase()):e)}else/^v-model\b/.test(n)?(t.add("value"),t.add("checked")):"v-bind"===n?t.add("*"):T.test(n)&&(t.add("style"),"v-popover"==n&&t.add("popover"));return t},j=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),q=["Value","Checked","Selected"],M=(e,t,n)=>{const i=P(t);e.__anchor&&i.add("style"),n&&((e,t,n)=>{const i=P(t.closest("select")||t);if(!(n.has("*")||i.has("*")||i.has("value")||"output"==e.type||"textarea"==e.type&&t.value.includes("{{")))for(const o of q){const i=o.toLowerCase(),r="default"+o,s="Selected"==o?r:i;!n.has(i)&&r in e&&e[i]!==t[s]&&(e[i]=t[s])}})(e,t,i);const o=Object(e.__bound);for(const{name:r,value:s}of t.attributes)_.test(r)||i.has(r)||r in o||e.getAttribute(r)!==s&&e.setAttribute(r,s);for(const{name:r}of[...e.attributes])i.has("*")||i.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},D=(e,t,n,i)=>{if(e.nodeType!==t.nodeType)return R(e,t,n,i);if(3===e.nodeType||8===e.nodeType){const o=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(o,n)&&"SCRIPT"!=e.parentNode?.nodeName)return;return e.data?void(e.data!==o&&(e.data=o)):R(e,t,n,i)}if(1!==e.nodeType)return;const o=e,r=t;if(o.tagName!==r.tagName)return R(e,t,n,i);if(!i.skip?.(o,r)&&!o.hasAttribute("data-morph-skip")){if(o.matches(S))return o.isEqualNode(r)?void 0:R(e,t,n,i);M(o,r,i.values),"TEMPLATE"!=o.tagName||o.content.isEqualNode(r.content)||(o.innerHTML=r.innerHTML),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||j(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(j(t))return!0;return!1})(r)||Object.getOwnPropertyDescriptor(Object(o.__ctx?.scope),"$template")||I(o,r,o.__ctx||n,i)}},R=(e,t,n,i)=>{if(E(e,i))return;const o=t.cloneNode(!0);return!1!==i.beforeNodeAdded?.(o)?(C(e,n),e.parentNode.replaceChild(o,e),i.afterNodeRemoved?.(e),z(o,n),o):void 0},z=(e,t)=>{if(e.parentElement?.closest(S))return;const n=t||N(e.parentNode);n?.walk?.(e,n)},I=(e,t,n,i)=>{const o=i.key||O,r=/* @__PURE__ */new Map;for(let u=e.firstChild;u;u=u.nextSibling)if(1===u.nodeType){const e=o(u);if(null==e)continue;r.set(e,u)}const s=e=>e&&1===e.nodeType?o(e):null,a=/* @__PURE__ */new Set;for(let u=t.firstChild;u;u=u.nextSibling)a.add(s(u));const c=t=>{E(t,i)||(C(t,n),e.removeChild(t),i.afterNodeRemoved?.(t))};let l=e.firstChild,d=t.firstChild;const f=t=>{const o=t.cloneNode(!0);!1!==i.beforeNodeAdded?.(o)&&(e.insertBefore(o,l),z(o,n))};for(;d;){const t=d.nextSibling,o=s(d);if(""===l?.data&&d.hasAttribute?.("v-teleport"))l=l.nextSibling;else if(null!=o){const t=r.get(o);t?(t===l?l=l.nextSibling:e.insertBefore(t,l),r.delete(o),D(t,d,n,i)):f(d)}else if(l&&null==s(l)){if(E(l,i)&&!E(d,i)){l=l.nextSibling;continue}const e=l.nextSibling;D(l,d,n,i),l=e}else{if(l&&!a.has(s(l))){const e=l.nextSibling;c(l),l=e;continue}f(d)}d=t}for(;l;){const e=l.nextSibling;c(l),l=e}},B=(e,t,n={})=>{let i;if("string"==typeof t){const n=document.createElement("template"),o=e instanceof SVGElement;n.innerHTML=o?`<svg>${t.trim()}</svg>`:t.trim();const r=o?n.content.firstChild:n.content;i=1===r.childNodes.length&&r.firstElementChild?r.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.append(...r.childNodes),t})()}else i=t;if(i){const t=()=>{const t=H();e=D(e,i,N(e.parentNode),n)||e,t()};n.transition&&document.startViewTransition?document.startViewTransition(t):t()}return e},H=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,i=null;try{n=t.selectionStart,i=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,i)}catch{}}},V=e=>{e.scope.$morph=B},W={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},K=/* @__PURE__ */Object.freeze({...W}),J={mobile:"base",tablet:"md",desktop:"lg"},Z=/^\d+$/,F=/* @__PURE__ */e({bp:"base",tick:0}),G={...W},U=["base"],Q=!1,X=[],Y=/* @__PURE__ */new Map,ee=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,te=(e,t)=>e.addEventListener?(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}):(e.addListener(t),{mql:e,off:()=>e.removeListener(t)}),ne=()=>{for(let e=X.length-1;e>=0;e--)if(X[e].mql.matches)return U[e+1];return"base"},ie=()=>{X.forEach(e=>e.off()),X=[];const e=Object.keys(G).filter(e=>G[e]>0).sort((e,t)=>G[e]-G[t]);U=["base",...e],ee()&&(X=e.map(e=>{const t=window.matchMedia(`(min-width: ${G[e]}px)`);return te(t,()=>{F.bp=ne()})}),F.bp=ne())},oe=()=>{Q||(Q=!0,ie()),F.tick},re=e=>{if(!ee())return!1;let t=Y.get(e);t?Y.delete(e):t=te(window.matchMedia(e),()=>F.tick++),Y.set(e,t);for(const[n,i]of Y){if(Y.size<=64)break;i.off(),Y.delete(n)}return t.mql.matches},se=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(Z.test(e))return Number(e);const t=void 0===G[e]?J[e]:void 0;return void 0!==t?"base"===t?0:G[t]:G[e]},ae=e=>{if(e<=0)return!0;const t=U.findIndex(t=>"base"!==t&&G[t]===e);return-1!==t?U.indexOf(F.bp)>=t:(F.tick,re(`(min-width: ${e}px)`))},ce=(e,t)=>{if(oe(),!e||"object"!=typeof e)return t;let n,i=-1;for(const o of Object.keys(e)){const t=se(o);void 0!==t&&(t>=i&&ae(t)&&(i=t,n=e[o]))}return void 0!==n?n:t},le=e=>{const t=J[e],n=G[t];return void 0!==n?n:W[t]},de=(e,t)=>ce(e,t),fe=/* @__PURE__ */Object.defineProperties(de,{props:{value:e=>{oe();const t={};for(const n of Object.keys(e))t[n]=ce(e[n]);return t}},breakpoint:{get:()=>(oe(),F.bp),enumerable:!0},device:{get:()=>(oe(),ae(le("tablet"))?ae(le("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{oe();const t=se(e);return void 0!==t&&ae(t)}},match:{value:e=>(oe(),re(e))},configure:{value:({breakpoints:e})=>{e&&(G={...e},Q&&(ie(),F.tick++))}}}),ue=()=>{X.forEach(e=>e.off()),Y.forEach(e=>e.off()),X=[],Y.clear(),Q=!1},pe=()=>{ue(),G={...W},U=["base",...Object.keys(G).sort((e,t)=>G[e]-G[t])],Q=!1,F.bp="base",F.tick=0},me=(e,t)=>(t&&fe.configure(t),e.scope.$mq=fe,e.scope.$mqProps=fe.props,e.scope.$mqAtLeast=fe.atLeast,e.scope.$mqMatch=fe.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>fe.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>fe.device,enumerable:!0,configurable:!0}),()=>{ue(),F.tick++}),ve=e=>{e.directive("resize",({el:e,get:t,exp:n,modifiers:i})=>{const o=t(`(($width, $height) => { ${n} })`);if(i?.window||i?.visual){const e=i.visual&&window.visualViewport||window,t=()=>o(e.width||innerWidth,e.height||innerHeight);return e.addEventListener("resize",t),t(),()=>e.removeEventListener("resize",t)}const r=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;o(e.width,e.height)}});return r.observe(e),()=>r.disconnect()})};export{k as collapse,K as defaultBreakpoints,x as focus,i as intersect,s as mask,me as media,B as morph,V as morphPlugin,fe as mq,b as persist,y as persistStore,m as registerStorage,pe as resetMedia,ve as resize,v as setDefaultStorage,l as transition};
|
|
1
|
+
import{reactive as e,store as t,watchEffect as n}from"@aevantec/litevue";var o=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{let o=!1;const i=new IntersectionObserver(e=>{for(const r of e){const e=n?.full?r.intersectionRatio>=1:r.isIntersecting,s=n?.leave?o&&!e:e&&!o;o=e,s&&(t(),n?.once&&i.disconnect())}},{threshold:n?.full?1:0});return i.observe(e),()=>i.disconnect()})},i={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},r=(e,t,n)=>{let o="",r="",s=0;for(let a=0;a<t.length;a++){const n=i[t[a]];if(n){for(;s<e.length&&!n.test(e[s]);)s++;if(s>=e.length)return o;o+=r+e[s++],r=""}else r+=t[a],e[s]===t[a]&&s++}return n?o+r:o},s=e=>{e.directive("mask",({el:e,exp:t})=>{const n=e,o=e=>{const{value:o,selectionStart:s}=n,a=e?.inputType,c=r(o,t,!a?.startsWith("del"));if(c===o)return!1;if(n.value=c,null!=s&&document.activeElement===n){let e=r(o.slice(0,s),t).length;if(!e||!a?.endsWith("Backward"))for(;e<c.length&&!i[t[e]];)e++;n.setSelectionRange(e,e)}return!0};e.addEventListener("input",o);const s=o();let a=!0;return Promise.resolve().then(()=>{a&&(o()||s)&&(e.dispatchEvent(new Event("input")),e.dispatchEvent(new Event("change")))}),()=>{a=!1,e.removeEventListener("input",o)}})},a=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),c=(e,t)=>{const n=e.split(","),o=t.split(",");let i=0;for(let r=0;r<n.length;r++)i=Math.max(i,a(n[r])+a(o[r%o.length]));return i},l=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:o,modifiers:i,exp:r})=>{const s=e,a=o||"v",l=e=>`${a}-${e}`;let d,f=0;const u=()=>{s.classList.remove(l("enter-from"),l("enter-active"),l("enter-to"),l("leave-from"),l("leave-active"),l("leave-to"))},p=(e,t)=>{const n=++f;u(),s.classList.add(l(e+"-from"),l(e+"-active")),s.offsetWidth,s.classList.remove(l(e+"-from")),s.classList.add(l(e+"-to")),clearTimeout(d),d=setTimeout(()=>{n===f&&(u(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(c(t.transitionDuration,t.transitionDelay),c(t.animationDuration,t.animationDelay))})(s))};if(!r){let e=!0;return Promise.resolve().then(()=>{e&&p("enter")}),s.__leave=()=>(e=!1,new Promise(e=>p("leave",e))),()=>{e=!1,clearTimeout(d),u(),delete s.__leave}}const m="none"==s.style.display?"":s.style.display;let v;return n(()=>{const e=!!t();if(e===v)return;const n=null!=v;v=e,e?(s.style.display=m,(n||i?.appear)&&p("enter")):n?p("leave",()=>{s.style.display="none"}):s.style.display="none"}),()=>{clearTimeout(d),u(),!1===v&&(s.style.display="none")}})},d="litevue:",f=Object.create(null),u="local",p=e=>{const t=e??u;return"string"!=typeof t?t:f[t.toLowerCase()]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},m=(e,t)=>{f[e.toLowerCase()]=t},v=e=>{u=e},h=(e,t,n,o,i)=>{if(!o)return i(()=>{});const r=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const o=n&&n.value;return(!o||!0!==o.__v_isRef||!0!==o.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(o.getItem(t)||"null");if(n)for(const t of r)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}catch{}return i(()=>{const n={};for(const t of r)n[t]=e[t];try{o.setItem(t,JSON.stringify(n))}catch{}})},b=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:o,modifiers:i,effect:r})=>{const s=d+(n||t.id);let a=i?void 0:p();for(const l in i)if(a=p(l))break;const c=o?o.split(",").map(e=>e.trim()).filter(Boolean):void 0;h(e.scope,s,c,a,r)})},y=(e,o={})=>{const i=t(e);if(!i)return()=>{};const r=p(o.storage);return h(i,d+(o.key??e),o.keys,r,n)},g=[],w=(e,t,n)=>"radio"!==e.type||!e.name||e===(n.find(t=>"radio"===t.type&&t.name===e.name&&t.checked)||n.find(t=>"radio"===t.type&&t.name===e.name)),x=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:o})=>{let i=!0,r=!1;return n(()=>{r!==(r=!!t())&&Promise.resolve().then(()=>{i&&r&&(e.focus(),o?.select&&e.select&&e.select())})}),()=>{i=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let o=!1,i=null;const r=()=>[...e.querySelectorAll("a[href],area[href],button,input:not([type=hidden]),select,textarea,summary,iframe,audio[controls],video[controls],[contenteditable],[tabindex]")].filter(e=>e.tabIndex>=0&&!e.matches(":disabled,[inert],[inert] *")&&!1!==e.checkVisibility?.({visibilityProperty:!0})).filter(w),s=t=>{if("Tab"!==t.key||g.at(-1)!==e)return;const n=r();if(!n.length)return void t.preventDefault();const o=n[0],i=n[n.length-1],s=document.activeElement;e.contains(s)?(t.shiftKey?o:i).compareDocumentPosition(s)&(t.shiftKey?4:2)||(t.preventDefault(),(t.shiftKey?i:o).focus()):(t.preventDefault(),o.focus())},a=()=>{o=!1,g.splice(g.indexOf(e),1),document.removeEventListener("keydown",s,!0),i&&i.focus&&i.focus()};return n(()=>{const n=!!t();n&&!o?(o=!0,i=document.activeElement,g.splice(g.findIndex(t=>e.contains(t))>>>0,0,e),document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{o&&g.at(-1)===e&&(r()[0]||e).focus()})):!n&&o&&a()}),()=>{o&&a()}})},k=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:o})=>{const i=e;let r=250;for(const u in o||{}){const e=/^duration-(\d+)$/.exec(u);e&&(r=+e[1])}const s=["overflow","height","transition","visibility"],a=s.map(e=>i.style[e]);let c,l=0;const d=/* @__PURE__ */new Set,f=(e,t)=>{const n=setTimeout(()=>{d.delete(n),e()},t);d.add(n)};return n(()=>{const e=!!t();if(e===c)return;const n=++l;var o;o=!e,i.style.visibility=o?"hidden":a[3],i.style.overflow=e&&null==c?a[0]:"hidden",null==c?f(()=>{i.style.transition=`height ${r}ms ease, visibility ${r}ms`}):(i.style.height=a[1]||i.scrollHeight+"px",e?f(()=>{n===l&&(i.style.height=a[1],i.style.overflow=a[0])},r):i.offsetHeight),e||(i.style.height="0px"),c=e}),()=>{d.forEach(clearTimeout),s.forEach((e,t)=>i.style[e]=a[t])}})},E=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||e.__marker||!!t.preserve?.(e)),S="[v-scope\\.visible],[v-scope\\.idle],[v-scope\\.interaction]",_=/^(?:v-|:|@)/,A=/^(?::|v-bind:)/,N=/^v-(?!scope|on:)/,O=["id","data-key","data-id"],T=e=>{for(const t of O){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},L=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},$=e=>e.__ctx||[...e.children||[]].map($).find(Boolean),C=(e,t)=>(t||$(e))?.dispose?.(e),P=e=>{const t=/* @__PURE__ */new Set;e.matches("details,dialog")&&t.add("open");for(const{name:n}of e.attributes)if(A.test(n)){const e=n.replace(A,"").split(".")[0];t.add(/\.camel\b/.test(n)?e.replace(/-(\w)/g,(e,t)=>t.toUpperCase()):e)}else/^v-model\b/.test(n)?(t.add("value"),t.add("checked")):"v-bind"===n?t.add("*"):N.test(n)&&(t.add("style"),"v-popover"==n&&t.add("popover"));return t},j=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),q=["Value","Checked","Selected"],M=(e,t,n)=>{const o=P(t);e.__anchor&&o.add("style");for(const r of e.constructor.morphOwnedAttributes||[])o.add(r);n&&((e,t,n)=>{const o=P(t.closest("select")||t);if(!(n.has("*")||o.has("*")||o.has("value")||"output"==e.type||"textarea"==e.type&&t.value.includes("{{")))for(const i of q){const o=i.toLowerCase(),r="default"+i,s="Selected"==i?r:o;!n.has(o)&&r in e&&e[o]!==t[s]&&(e[o]=t[s])}})(e,t,o);const i=Object(e.__bound);for(const{name:r,value:s}of t.attributes)_.test(r)||o.has(r)||r in i||e.getAttribute(r)!==s&&e.setAttribute(r,s);for(const{name:r}of[...e.attributes])o.has("*")||o.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},D=(e,t,n,o)=>{if(e.nodeType!==t.nodeType)return R(e,t,n,o);if(3===e.nodeType||8===e.nodeType){const i=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(i,n)&&"SCRIPT"!=e.parentNode?.nodeName)return;return e.data?void(e.data!==i&&(e.data=i)):R(e,t,n,o)}if(1!==e.nodeType)return;const i=e,r=t;if(i.tagName!==r.tagName)return R(e,t,n,o);if(!o.skip?.(i,r)&&!i.hasAttribute("data-morph-skip")){if(i.matches(S))return i.isEqualNode(r)?void 0:R(e,t,n,o);M(i,r,o.values),"TEMPLATE"!=i.tagName||i.content.isEqualNode(r.content)||(i.innerHTML=r.innerHTML),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||j(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(j(t))return!0;return!1})(r)||Object.getOwnPropertyDescriptor(Object(i.__ctx?.scope),"$template")||I(i,r,i.__ctx||n,o)}},R=(e,t,n,o)=>{if(E(e,o))return;const i=t.cloneNode(!0);return!1!==o.beforeNodeAdded?.(i)?(C(e,n),e.parentNode.replaceChild(i,e),o.afterNodeRemoved?.(e),z(i,n),i):void 0},z=(e,t)=>{if(e.parentElement?.closest(S))return;const n=t||L(e.parentNode);n?.walk?.(e,n)},I=(e,t,n,o)=>{const i=o.key||T,r=/* @__PURE__ */new Map;for(let u=e.firstChild;u;u=u.nextSibling)if(1===u.nodeType){const e=i(u);if(null==e)continue;r.set(e,u)}const s=e=>e&&1===e.nodeType?i(e):null,a=/* @__PURE__ */new Set;for(let u=t.firstChild;u;u=u.nextSibling)a.add(s(u));const c=t=>{E(t,o)||(C(t,n),e.removeChild(t),o.afterNodeRemoved?.(t))};let l=e.firstChild,d=t.firstChild;const f=t=>{const i=t.cloneNode(!0);!1!==o.beforeNodeAdded?.(i)&&(e.insertBefore(i,l),z(i,n))};for(;d;){const t=d.nextSibling,i=s(d);if(""===l?.data&&d.hasAttribute?.("v-teleport"))l=l.nextSibling;else if(null!=i){const t=r.get(i);t?(t===l?l=l.nextSibling:e.insertBefore(t,l),r.delete(i),D(t,d,n,o)):f(d)}else if(l&&(null==s(l)||!a.has(s(l))&&l.tagName===d.tagName)){if(E(l,o)&&!E(d,o)){l=l.nextSibling;continue}const e=l.nextSibling;D(l,d,n,o),l=e}else{if(l&&!a.has(s(l))){const e=l.nextSibling;c(l),l=e;continue}f(d)}d=t}for(;l;){const e=l.nextSibling;c(l),l=e}},B=(e,t,n={})=>{let o;if("string"==typeof t){const n=document.createElement("template"),i=e instanceof SVGElement;n.innerHTML=i?`<svg>${t.trim()}</svg>`:t.trim();const r=i?n.content.firstChild:n.content;o=1===r.childNodes.length&&r.firstElementChild?r.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.append(...r.childNodes),t})()}else o=t;if(o){const t=()=>{const t=H();e=D(e,o,L(e.parentNode),n)||e,t()};n.transition&&document.startViewTransition?document.startViewTransition(t):t()}return e},H=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,o=null;try{n=t.selectionStart,o=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,o)}catch{}}},V=e=>{e.scope.$morph=B},W={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},K=/* @__PURE__ */Object.freeze({...W}),J={mobile:"base",tablet:"md",desktop:"lg"},Z=/^\d+$/,F=/* @__PURE__ */e({bp:"base",tick:0}),G={...W},U=["base"],Q=!1,X=[],Y=/* @__PURE__ */new Map,ee=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,te=(e,t)=>(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}),ne=()=>{for(let e=X.length-1;e>=0;e--)if(X[e].mql.matches)return U[e+1];return"base"},oe=()=>{X.forEach(e=>e.off()),X=[];const e=Object.keys(G).filter(e=>G[e]>0).sort((e,t)=>G[e]-G[t]);U=["base",...e],ee()&&(X=e.map(e=>{const t=window.matchMedia(`(min-width: ${G[e]}px)`);return te(t,()=>{F.bp=ne()})}),F.bp=ne())},ie=()=>{Q||(Q=!0,oe()),F.tick},re=e=>{if(!ee())return!1;let t=Y.get(e);t?Y.delete(e):t=te(window.matchMedia(e),()=>F.tick++),Y.set(e,t);for(const[n,o]of Y){if(Y.size<=64)break;o.off(),Y.delete(n)}return t.mql.matches},se=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(Z.test(e))return Number(e);const t=void 0===G[e]?J[e]:void 0;return void 0!==t?"base"===t?0:G[t]:G[e]},ae=e=>{if(e<=0)return!0;const t=U.findIndex(t=>"base"!==t&&G[t]===e);return-1!==t?U.indexOf(F.bp)>=t:(F.tick,re(`(min-width: ${e}px)`))},ce=(e,t)=>{if(ie(),!e||"object"!=typeof e)return t;let n,o=-1;for(const i of Object.keys(e)){const t=se(i);void 0!==t&&(t>=o&&ae(t)&&(o=t,n=e[i]))}return void 0!==n?n:t},le=e=>{const t=J[e],n=G[t];return void 0!==n?n:W[t]},de=(e,t)=>ce(e,t),fe=/* @__PURE__ */Object.defineProperties(de,{props:{value:e=>{ie();const t={};for(const n of Object.keys(e))t[n]=ce(e[n]);return t}},breakpoint:{get:()=>(ie(),F.bp),enumerable:!0},device:{get:()=>(ie(),ae(le("tablet"))?ae(le("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{ie();const t=se(e);return void 0!==t&&ae(t)}},match:{value:e=>(ie(),re(e))},configure:{value:({breakpoints:e})=>{e&&(G={...e},Q&&(oe(),F.tick++))}}}),ue=()=>{X.forEach(e=>e.off()),Y.forEach(e=>e.off()),X=[],Y.clear(),Q=!1},pe=()=>{ue(),G={...W},U=["base",...Object.keys(G).sort((e,t)=>G[e]-G[t])],Q=!1,F.bp="base",F.tick=0},me=(e,t)=>(t&&fe.configure(t),e.scope.$mq=fe,e.scope.$mqProps=fe.props,e.scope.$mqAtLeast=fe.atLeast,e.scope.$mqMatch=fe.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>fe.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>fe.device,enumerable:!0,configurable:!0}),()=>{ue(),F.tick++}),ve=e=>{e.directive("resize",({el:e,get:t,exp:n,modifiers:o})=>{const i=t(`(($width, $height) => { ${n} })`);if(o?.window||o?.visual){const e=o.visual&&window.visualViewport||window,t=()=>i(e.width||innerWidth,e.height||innerHeight);return e.addEventListener("resize",t),t(),()=>e.removeEventListener("resize",t)}const r=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;i(e.width,e.height)}});return r.observe(e),()=>r.disconnect()})};export{k as collapse,K as defaultBreakpoints,x as focus,o as intersect,s as mask,me as media,B as morph,V as morphPlugin,fe as mq,b as persist,y as persistStore,m as registerStorage,pe as resetMedia,ve as resize,v as setDefaultStorage,l as transition};
|