coveragebook_components 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/build/coco/app.css +129 -6
  3. data/app/assets/build/coco/app.js +793 -565
  4. data/app/assets/build/coco/book.css +63 -0
  5. data/app/assets/build/coco/book.js +769 -554
  6. data/app/assets/build/coco/icons/cake.svg +1 -1
  7. data/app/assets/build/coco/icons/check-circle-2.svg +1 -1
  8. data/app/assets/build/coco/icons/check-circle.svg +1 -1
  9. data/app/assets/build/coco/icons/check-square-2.svg +1 -0
  10. data/app/assets/build/coco/icons/check-square.svg +1 -1
  11. data/app/assets/build/coco/icons/check.svg +1 -1
  12. data/app/assets/build/coco/icons/radiation.svg +1 -1
  13. data/app/assets/build/coco/icons/ribbon.svg +1 -0
  14. data/app/assets/build/coco/icons/tree-deciduous.svg +1 -1
  15. data/app/assets/js/libs/alpine/directives/options.js +0 -1
  16. data/app/components/coco/app/blocks/sidebar_nav/item/item.css +2 -2
  17. data/app/components/coco/app/blocks/sidebar_nav/menu/menu.css +2 -2
  18. data/app/components/coco/app/blocks/sidebar_nav/navbar/navbar.css +2 -2
  19. data/app/components/coco/app/blocks/slide_editor/slide_editor.html.erb +1 -0
  20. data/app/components/coco/app/elements/image_picker_button/image_picker_button.js +8 -2
  21. data/app/components/coco/app/layouts/application/application.css +13 -0
  22. data/app/components/coco/app/layouts/application/application.rb +0 -2
  23. data/app/components/coco/app/layouts/page/page.css +23 -0
  24. data/app/components/coco/app/layouts/page/page.html.erb +27 -0
  25. data/app/components/coco/app/layouts/page/page.js +5 -0
  26. data/app/components/coco/app/layouts/page/page.rb +40 -0
  27. data/app/components/coco/base/pager_link/pager_link.css +26 -0
  28. data/app/components/coco/base/pager_link/pager_link.html.erb +3 -0
  29. data/app/components/coco/base/pager_link/pager_link.rb +32 -0
  30. data/app/components/coco/base/poll_controller/poll_controller.css +5 -0
  31. data/app/components/coco/base/poll_controller/poll_controller.html.erb +15 -0
  32. data/app/components/coco/base/poll_controller/poll_controller.js +67 -0
  33. data/app/components/coco/base/poll_controller/poll_controller.rb +9 -0
  34. data/app/helpers/coco/app_helper.rb +4 -0
  35. data/config/icons.json +2 -0
  36. data/lib/coco.rb +1 -1
  37. data/lib/tasks/coco_tasks.rake +0 -8
  38. metadata +15 -2
@@ -3848,10 +3848,10 @@
3848
3848
  return result2;
3849
3849
  };
3850
3850
  }
3851
- var bind4 = baseRest(function(func, thisArg, partials) {
3851
+ var bind3 = baseRest(function(func, thisArg, partials) {
3852
3852
  var bitmask = WRAP_BIND_FLAG;
3853
3853
  if (partials.length) {
3854
- var holders = replaceHolders(partials, getHolder(bind4));
3854
+ var holders = replaceHolders(partials, getHolder(bind3));
3855
3855
  bitmask |= WRAP_PARTIAL_FLAG;
3856
3856
  }
3857
3857
  return createWrap(func, bitmask, thisArg, partials, holders);
@@ -4858,7 +4858,7 @@
4858
4858
  var bindAll = flatRest(function(object, methodNames) {
4859
4859
  arrayEach(methodNames, function(key) {
4860
4860
  key = toKey(key);
4861
- baseAssignValue(object, key, bind4(object[key], object));
4861
+ baseAssignValue(object, key, bind3(object[key], object));
4862
4862
  });
4863
4863
  return object;
4864
4864
  });
@@ -5055,7 +5055,7 @@
5055
5055
  lodash.assignWith = assignWith;
5056
5056
  lodash.at = at2;
5057
5057
  lodash.before = before;
5058
- lodash.bind = bind4;
5058
+ lodash.bind = bind3;
5059
5059
  lodash.bindAll = bindAll;
5060
5060
  lodash.bindKey = bindKey;
5061
5061
  lodash.castArray = castArray;
@@ -7121,6 +7121,112 @@ ${t4.join("\n")}`);
7121
7121
  cleanup2();
7122
7122
  }];
7123
7123
  }
7124
+ function dispatch(el, name, detail = {}) {
7125
+ el.dispatchEvent(
7126
+ new CustomEvent(name, {
7127
+ detail,
7128
+ bubbles: true,
7129
+ // Allows events to pass the shadow DOM barrier.
7130
+ composed: true,
7131
+ cancelable: true
7132
+ })
7133
+ );
7134
+ }
7135
+ function walk(el, callback) {
7136
+ if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
7137
+ Array.from(el.children).forEach((el2) => walk(el2, callback));
7138
+ return;
7139
+ }
7140
+ let skip = false;
7141
+ callback(el, () => skip = true);
7142
+ if (skip)
7143
+ return;
7144
+ let node = el.firstElementChild;
7145
+ while (node) {
7146
+ walk(node, callback, false);
7147
+ node = node.nextElementSibling;
7148
+ }
7149
+ }
7150
+ function warn(message, ...args) {
7151
+ console.warn(`Alpine Warning: ${message}`, ...args);
7152
+ }
7153
+ var started = false;
7154
+ function start() {
7155
+ if (started)
7156
+ warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");
7157
+ started = true;
7158
+ if (!document.body)
7159
+ warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
7160
+ dispatch(document, "alpine:init");
7161
+ dispatch(document, "alpine:initializing");
7162
+ startObservingMutations();
7163
+ onElAdded((el) => initTree(el, walk));
7164
+ onElRemoved((el) => destroyTree(el));
7165
+ onAttributesAdded((el, attrs) => {
7166
+ directives(el, attrs).forEach((handle) => handle());
7167
+ });
7168
+ let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
7169
+ Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {
7170
+ initTree(el);
7171
+ });
7172
+ dispatch(document, "alpine:initialized");
7173
+ }
7174
+ var rootSelectorCallbacks = [];
7175
+ var initSelectorCallbacks = [];
7176
+ function rootSelectors() {
7177
+ return rootSelectorCallbacks.map((fn3) => fn3());
7178
+ }
7179
+ function allSelectors() {
7180
+ return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn3) => fn3());
7181
+ }
7182
+ function addRootSelector(selectorCallback) {
7183
+ rootSelectorCallbacks.push(selectorCallback);
7184
+ }
7185
+ function addInitSelector(selectorCallback) {
7186
+ initSelectorCallbacks.push(selectorCallback);
7187
+ }
7188
+ function closestRoot(el, includeInitSelectors = false) {
7189
+ return findClosest(el, (element) => {
7190
+ const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
7191
+ if (selectors.some((selector) => element.matches(selector)))
7192
+ return true;
7193
+ });
7194
+ }
7195
+ function findClosest(el, callback) {
7196
+ if (!el)
7197
+ return;
7198
+ if (callback(el))
7199
+ return el;
7200
+ if (el._x_teleportBack)
7201
+ el = el._x_teleportBack;
7202
+ if (!el.parentElement)
7203
+ return;
7204
+ return findClosest(el.parentElement, callback);
7205
+ }
7206
+ function isRoot(el) {
7207
+ return rootSelectors().some((selector) => el.matches(selector));
7208
+ }
7209
+ var initInterceptors = [];
7210
+ function interceptInit(callback) {
7211
+ initInterceptors.push(callback);
7212
+ }
7213
+ function initTree(el, walker = walk, intercept = () => {
7214
+ }) {
7215
+ deferHandlingDirectives(() => {
7216
+ walker(el, (el2, skip) => {
7217
+ intercept(el2, skip);
7218
+ initInterceptors.forEach((i2) => i2(el2, skip));
7219
+ directives(el2, el2.attributes).forEach((handle) => handle());
7220
+ el2._x_ignore && skip();
7221
+ });
7222
+ });
7223
+ }
7224
+ function destroyTree(root) {
7225
+ walk(root, (el) => {
7226
+ cleanupAttributes(el);
7227
+ cleanupElement(el);
7228
+ });
7229
+ }
7124
7230
  var onAttributeAddeds = [];
7125
7231
  var onElRemoveds = [];
7126
7232
  var onElAddeds = [];
@@ -7157,6 +7263,12 @@ ${t4.join("\n")}`);
7157
7263
  }
7158
7264
  });
7159
7265
  }
7266
+ function cleanupElement(el) {
7267
+ if (el._x_cleanups) {
7268
+ while (el._x_cleanups.length)
7269
+ el._x_cleanups.pop()();
7270
+ }
7271
+ }
7160
7272
  var observer = new MutationObserver(onMutate);
7161
7273
  var currentlyObserving = false;
7162
7274
  function startObservingMutations() {
@@ -7252,10 +7364,7 @@ ${t4.join("\n")}`);
7252
7364
  if (addedNodes.includes(node))
7253
7365
  continue;
7254
7366
  onElRemoveds.forEach((i2) => i2(node));
7255
- if (node._x_cleanups) {
7256
- while (node._x_cleanups.length)
7257
- node._x_cleanups.pop()();
7258
- }
7367
+ destroyTree(node);
7259
7368
  }
7260
7369
  addedNodes.forEach((node) => {
7261
7370
  node._x_ignoreSelf = true;
@@ -7302,53 +7411,50 @@ ${t4.join("\n")}`);
7302
7411
  return closestDataStack(node.parentNode);
7303
7412
  }
7304
7413
  function mergeProxies(objects) {
7305
- let thisProxy = new Proxy({}, {
7306
- ownKeys: () => {
7307
- return Array.from(new Set(objects.flatMap((i2) => Object.keys(i2))));
7308
- },
7309
- has: (target, name) => {
7310
- return objects.some((obj) => obj.hasOwnProperty(name));
7311
- },
7312
- get: (target, name) => {
7313
- return (objects.find((obj) => {
7314
- if (obj.hasOwnProperty(name)) {
7315
- let descriptor = Object.getOwnPropertyDescriptor(obj, name);
7316
- if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) {
7317
- return true;
7318
- }
7319
- if ((descriptor.get || descriptor.set) && descriptor.enumerable) {
7320
- let getter = descriptor.get;
7321
- let setter = descriptor.set;
7322
- let property = descriptor;
7323
- getter = getter && getter.bind(thisProxy);
7324
- setter = setter && setter.bind(thisProxy);
7325
- if (getter)
7326
- getter._x_alreadyBound = true;
7327
- if (setter)
7328
- setter._x_alreadyBound = true;
7329
- Object.defineProperty(obj, name, __spreadProps(__spreadValues({}, property), {
7330
- get: getter,
7331
- set: setter
7332
- }));
7333
- }
7334
- return true;
7335
- }
7336
- return false;
7337
- }) || {})[name];
7338
- },
7339
- set: (target, name, value) => {
7340
- let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name));
7341
- if (closestObjectWithKey) {
7342
- closestObjectWithKey[name] = value;
7343
- } else {
7344
- objects[objects.length - 1][name] = value;
7345
- }
7346
- return true;
7347
- }
7348
- });
7349
- return thisProxy;
7414
+ return new Proxy({ objects }, mergeProxyTrap);
7415
+ }
7416
+ var mergeProxyTrap = {
7417
+ ownKeys({ objects }) {
7418
+ return Array.from(
7419
+ new Set(objects.flatMap((i2) => Object.keys(i2)))
7420
+ );
7421
+ },
7422
+ has({ objects }, name) {
7423
+ if (name == Symbol.unscopables)
7424
+ return false;
7425
+ return objects.some(
7426
+ (obj) => Object.prototype.hasOwnProperty.call(obj, name)
7427
+ );
7428
+ },
7429
+ get({ objects }, name, thisProxy) {
7430
+ if (name == "toJSON")
7431
+ return collapseProxies;
7432
+ return Reflect.get(
7433
+ objects.find(
7434
+ (obj) => Object.prototype.hasOwnProperty.call(obj, name)
7435
+ ) || {},
7436
+ name,
7437
+ thisProxy
7438
+ );
7439
+ },
7440
+ set({ objects }, name, value, thisProxy) {
7441
+ const target = objects.find(
7442
+ (obj) => Object.prototype.hasOwnProperty.call(obj, name)
7443
+ ) || objects[objects.length - 1];
7444
+ const descriptor = Object.getOwnPropertyDescriptor(target, name);
7445
+ if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get))
7446
+ return Reflect.set(target, name, value, thisProxy);
7447
+ return Reflect.set(target, name, value);
7448
+ }
7449
+ };
7450
+ function collapseProxies() {
7451
+ let keys = Reflect.ownKeys(this);
7452
+ return keys.reduce((acc, key) => {
7453
+ acc[key] = Reflect.get(this, key);
7454
+ return acc;
7455
+ }, {});
7350
7456
  }
7351
- function initInterceptors(data2) {
7457
+ function initInterceptors2(data2) {
7352
7458
  let isObject22 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null;
7353
7459
  let recurse = (obj, basePath = "") => {
7354
7460
  Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => {
@@ -7455,8 +7561,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7455
7561
  function dontAutoEvaluateFunctions(callback) {
7456
7562
  let cache = shouldAutoEvaluateFunctions;
7457
7563
  shouldAutoEvaluateFunctions = false;
7458
- callback();
7564
+ let result = callback();
7459
7565
  shouldAutoEvaluateFunctions = cache;
7566
+ return result;
7460
7567
  }
7461
7568
  function evaluate(el, expression, extras = {}) {
7462
7569
  let result;
@@ -7491,10 +7598,17 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7491
7598
  }
7492
7599
  let AsyncFunction = Object.getPrototypeOf(async function() {
7493
7600
  }).constructor;
7494
- let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression) || /^(let|const)\s/.test(expression) ? `(async()=>{ ${expression} })()` : expression;
7601
+ let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression.trim()) || /^(let|const)\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression;
7495
7602
  const safeAsyncFunction = () => {
7496
7603
  try {
7497
- return new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);
7604
+ let func2 = new AsyncFunction(
7605
+ ["__self", "scope"],
7606
+ `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`
7607
+ );
7608
+ Object.defineProperty(func2, "name", {
7609
+ value: `[Alpine] ${expression}`
7610
+ });
7611
+ return func2;
7498
7612
  } catch (error2) {
7499
7613
  handleError(error2, el, expression);
7500
7614
  return Promise.resolve();
@@ -7551,7 +7665,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7551
7665
  return {
7552
7666
  before(directive2) {
7553
7667
  if (!directiveHandlers[directive2]) {
7554
- console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");
7668
+ console.warn(
7669
+ "Cannot find directive `${directive}`. `${name}` will use the default order of execution"
7670
+ );
7555
7671
  return;
7556
7672
  }
7557
7673
  const pos = directiveOrder.indexOf(directive2);
@@ -7622,15 +7738,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7622
7738
  function getDirectiveHandler(el, directive2) {
7623
7739
  let noop = () => {
7624
7740
  };
7625
- let handler3 = directiveHandlers[directive2.type] || noop;
7741
+ let handler4 = directiveHandlers[directive2.type] || noop;
7626
7742
  let [utilities, cleanup2] = getElementBoundUtilities(el);
7627
7743
  onAttributeRemoved(el, directive2.original, cleanup2);
7628
7744
  let fullHandler = () => {
7629
7745
  if (el._x_ignore || el._x_ignoreSelf)
7630
7746
  return;
7631
- handler3.inline && handler3.inline(el, directive2, utilities);
7632
- handler3 = handler3.bind(handler3, el, directive2, utilities);
7633
- isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3();
7747
+ handler4.inline && handler4.inline(el, directive2, utilities);
7748
+ handler4 = handler4.bind(handler4, el, directive2, utilities);
7749
+ isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4();
7634
7750
  };
7635
7751
  fullHandler.runCleanups = cleanup2;
7636
7752
  return fullHandler;
@@ -7663,7 +7779,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7663
7779
  function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {
7664
7780
  return ({ name, value }) => {
7665
7781
  let typeMatch = name.match(alpineAttributeRegex());
7666
- let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/);
7782
+ let valueMatch = name.match(/:([a-zA-Z0-9\-_:]+)/);
7667
7783
  let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || [];
7668
7784
  let original = originalAttributeOverride || transformedAttributeMap[name] || name;
7669
7785
  return {
@@ -7697,106 +7813,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7697
7813
  let typeB = directiveOrder.indexOf(b2.type) === -1 ? DEFAULT : b2.type;
7698
7814
  return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);
7699
7815
  }
7700
- function dispatch(el, name, detail = {}) {
7701
- el.dispatchEvent(new CustomEvent(name, {
7702
- detail,
7703
- bubbles: true,
7704
- composed: true,
7705
- cancelable: true
7706
- }));
7707
- }
7708
- function walk(el, callback) {
7709
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
7710
- Array.from(el.children).forEach((el2) => walk(el2, callback));
7711
- return;
7712
- }
7713
- let skip = false;
7714
- callback(el, () => skip = true);
7715
- if (skip)
7716
- return;
7717
- let node = el.firstElementChild;
7718
- while (node) {
7719
- walk(node, callback, false);
7720
- node = node.nextElementSibling;
7721
- }
7722
- }
7723
- function warn(message, ...args) {
7724
- console.warn(`Alpine Warning: ${message}`, ...args);
7725
- }
7726
- var started = false;
7727
- function start() {
7728
- if (started)
7729
- warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");
7730
- started = true;
7731
- if (!document.body)
7732
- warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
7733
- dispatch(document, "alpine:init");
7734
- dispatch(document, "alpine:initializing");
7735
- startObservingMutations();
7736
- onElAdded((el) => initTree(el, walk));
7737
- onElRemoved((el) => destroyTree(el));
7738
- onAttributesAdded((el, attrs) => {
7739
- directives(el, attrs).forEach((handle) => handle());
7740
- });
7741
- let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
7742
- Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {
7743
- initTree(el);
7744
- });
7745
- dispatch(document, "alpine:initialized");
7746
- }
7747
- var rootSelectorCallbacks = [];
7748
- var initSelectorCallbacks = [];
7749
- function rootSelectors() {
7750
- return rootSelectorCallbacks.map((fn3) => fn3());
7751
- }
7752
- function allSelectors() {
7753
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn3) => fn3());
7754
- }
7755
- function addRootSelector(selectorCallback) {
7756
- rootSelectorCallbacks.push(selectorCallback);
7757
- }
7758
- function addInitSelector(selectorCallback) {
7759
- initSelectorCallbacks.push(selectorCallback);
7760
- }
7761
- function closestRoot(el, includeInitSelectors = false) {
7762
- return findClosest(el, (element) => {
7763
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
7764
- if (selectors.some((selector) => element.matches(selector)))
7765
- return true;
7766
- });
7767
- }
7768
- function findClosest(el, callback) {
7769
- if (!el)
7770
- return;
7771
- if (callback(el))
7772
- return el;
7773
- if (el._x_teleportBack)
7774
- el = el._x_teleportBack;
7775
- if (!el.parentElement)
7776
- return;
7777
- return findClosest(el.parentElement, callback);
7778
- }
7779
- function isRoot(el) {
7780
- return rootSelectors().some((selector) => el.matches(selector));
7781
- }
7782
- var initInterceptors2 = [];
7783
- function interceptInit(callback) {
7784
- initInterceptors2.push(callback);
7785
- }
7786
- function initTree(el, walker = walk, intercept = () => {
7787
- }) {
7788
- deferHandlingDirectives(() => {
7789
- walker(el, (el2, skip) => {
7790
- intercept(el2, skip);
7791
- initInterceptors2.forEach((i2) => i2(el2, skip));
7792
- directives(el2, el2.attributes).forEach((handle) => handle());
7793
- el2._x_ignore && skip();
7794
- });
7795
- });
7796
- }
7797
- function destroyTree(root) {
7798
- walk(root, (el) => cleanupAttributes(el));
7799
- }
7800
7816
  var tickStack = [];
7801
7817
  var isHolding = false;
7802
7818
  function nextTick(callback = () => {
@@ -7926,7 +7942,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7926
7942
  function registerTransitionsFromClassString(el, classString, stage) {
7927
7943
  registerTransitionObject(el, setClasses, "");
7928
7944
  let directiveStorageMap = {
7929
- enter: (classes) => {
7945
+ "enter": (classes) => {
7930
7946
  el._x_transition.enter.during = classes;
7931
7947
  },
7932
7948
  "enter-start": (classes) => {
@@ -7935,7 +7951,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
7935
7951
  "enter-end": (classes) => {
7936
7952
  el._x_transition.enter.end = classes;
7937
7953
  },
7938
- leave: (classes) => {
7954
+ "leave": (classes) => {
7939
7955
  el._x_transition.leave.during = classes;
7940
7956
  },
7941
7957
  "leave-start": (classes) => {
@@ -8195,14 +8211,31 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8195
8211
  function onlyDuringClone(callback) {
8196
8212
  return (...args) => isCloning && callback(...args);
8197
8213
  }
8214
+ function cloneNode(from, to) {
8215
+ if (from._x_dataStack) {
8216
+ to._x_dataStack = from._x_dataStack;
8217
+ to.setAttribute("data-has-alpine-state", true);
8218
+ }
8219
+ isCloning = true;
8220
+ dontRegisterReactiveSideEffects(() => {
8221
+ initTree(to, (el, callback) => {
8222
+ callback(el, () => {
8223
+ });
8224
+ });
8225
+ });
8226
+ isCloning = false;
8227
+ }
8228
+ var isCloningLegacy = false;
8198
8229
  function clone(oldEl, newEl) {
8199
8230
  if (!newEl._x_dataStack)
8200
8231
  newEl._x_dataStack = oldEl._x_dataStack;
8201
8232
  isCloning = true;
8233
+ isCloningLegacy = true;
8202
8234
  dontRegisterReactiveSideEffects(() => {
8203
8235
  cloneTree(newEl);
8204
8236
  });
8205
8237
  isCloning = false;
8238
+ isCloningLegacy = false;
8206
8239
  }
8207
8240
  function cloneTree(el) {
8208
8241
  let hasRunThroughFirstEl = false;
@@ -8227,6 +8260,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8227
8260
  callback();
8228
8261
  overrideEffect(cache);
8229
8262
  }
8263
+ function shouldSkipRegisteringDataDuringClone(el) {
8264
+ if (!isCloning)
8265
+ return false;
8266
+ if (isCloningLegacy)
8267
+ return true;
8268
+ return el.hasAttribute("data-has-alpine-state");
8269
+ }
8230
8270
  function bind(el, name, value, modifiers = []) {
8231
8271
  if (!el._x_bindings)
8232
8272
  el._x_bindings = reactive({});
@@ -8262,7 +8302,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8262
8302
  } else if (el.type === "checkbox") {
8263
8303
  if (Number.isInteger(value)) {
8264
8304
  el.value = value;
8265
- } else if (!Number.isInteger(value) && !Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) {
8305
+ } else if (!Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) {
8266
8306
  el.value = String(value);
8267
8307
  } else {
8268
8308
  if (Array.isArray(value)) {
@@ -8276,7 +8316,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8276
8316
  } else {
8277
8317
  if (el.value === value)
8278
8318
  return;
8279
- el.value = value;
8319
+ el.value = value === void 0 ? "" : value;
8280
8320
  }
8281
8321
  }
8282
8322
  function bindClasses(el, value) {
@@ -8362,6 +8402,21 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8362
8402
  function getBinding(el, name, fallback) {
8363
8403
  if (el._x_bindings && el._x_bindings[name] !== void 0)
8364
8404
  return el._x_bindings[name];
8405
+ return getAttributeBinding(el, name, fallback);
8406
+ }
8407
+ function extractProp(el, name, fallback, extract = true) {
8408
+ if (el._x_bindings && el._x_bindings[name] !== void 0)
8409
+ return el._x_bindings[name];
8410
+ if (el._x_inlineBindings && el._x_inlineBindings[name] !== void 0) {
8411
+ let binding = el._x_inlineBindings[name];
8412
+ binding.extract = extract;
8413
+ return dontAutoEvaluateFunctions(() => {
8414
+ return evaluate(el, binding.expression);
8415
+ });
8416
+ }
8417
+ return getAttributeBinding(el, name, fallback);
8418
+ }
8419
+ function getAttributeBinding(el, name, fallback) {
8365
8420
  let attr = el.getAttribute(name);
8366
8421
  if (attr === null)
8367
8422
  return typeof fallback === "function" ? fallback() : fallback;
@@ -8395,6 +8450,36 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8395
8450
  }
8396
8451
  };
8397
8452
  }
8453
+ function entangle({ get: outerGet, set: outerSet }, { get: innerGet, set: innerSet }) {
8454
+ let firstRun = true;
8455
+ let outerHash;
8456
+ let reference2 = effect(() => {
8457
+ const outer = outerGet();
8458
+ const inner = innerGet();
8459
+ if (firstRun) {
8460
+ innerSet(cloneIfObject(outer));
8461
+ firstRun = false;
8462
+ outerHash = JSON.stringify(outer);
8463
+ } else {
8464
+ const outerHashLatest = JSON.stringify(outer);
8465
+ if (outerHashLatest !== outerHash) {
8466
+ innerSet(cloneIfObject(outer));
8467
+ outerHash = outerHashLatest;
8468
+ } else {
8469
+ outerSet(cloneIfObject(inner));
8470
+ outerHash = JSON.stringify(inner);
8471
+ }
8472
+ }
8473
+ JSON.stringify(innerGet());
8474
+ JSON.stringify(outerGet());
8475
+ });
8476
+ return () => {
8477
+ release(reference2);
8478
+ };
8479
+ }
8480
+ function cloneIfObject(value) {
8481
+ return typeof value === "object" ? JSON.parse(JSON.stringify(value)) : value;
8482
+ }
8398
8483
  function plugin(callback) {
8399
8484
  let callbacks = Array.isArray(callback) ? callback : [callback];
8400
8485
  callbacks.forEach((i2) => i2(alpine_default));
@@ -8413,7 +8498,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8413
8498
  if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") {
8414
8499
  stores[name].init();
8415
8500
  }
8416
- initInterceptors(stores[name]);
8501
+ initInterceptors2(stores[name]);
8417
8502
  }
8418
8503
  function getStores() {
8419
8504
  return stores;
@@ -8422,10 +8507,12 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8422
8507
  function bind2(name, bindings) {
8423
8508
  let getBindings = typeof bindings !== "function" ? () => bindings : bindings;
8424
8509
  if (name instanceof Element) {
8425
- applyBindingsObject(name, getBindings());
8510
+ return applyBindingsObject(name, getBindings());
8426
8511
  } else {
8427
8512
  binds[name] = getBindings;
8428
8513
  }
8514
+ return () => {
8515
+ };
8429
8516
  }
8430
8517
  function injectBindingProviders(obj) {
8431
8518
  Object.entries(binds).forEach(([name, callback]) => {
@@ -8458,6 +8545,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8458
8545
  cleanupRunners.push(handle.runCleanups);
8459
8546
  handle();
8460
8547
  });
8548
+ return () => {
8549
+ while (cleanupRunners.length)
8550
+ cleanupRunners.pop()();
8551
+ };
8461
8552
  }
8462
8553
  var datas = {};
8463
8554
  function data(name, callback) {
@@ -8489,13 +8580,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8489
8580
  get raw() {
8490
8581
  return raw;
8491
8582
  },
8492
- version: "3.12.2",
8583
+ version: "3.13.2",
8493
8584
  flushAndStopDeferringMutations,
8494
8585
  dontAutoEvaluateFunctions,
8495
8586
  disableEffectScheduling,
8496
8587
  startObservingMutations,
8497
8588
  stopObservingMutations,
8498
8589
  setReactivityEngine,
8590
+ onAttributeRemoved,
8591
+ onAttributesAdded,
8499
8592
  closestDataStack,
8500
8593
  skipDuringClone,
8501
8594
  onlyDuringClone,
@@ -8508,14 +8601,20 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8508
8601
  interceptInit,
8509
8602
  setEvaluator,
8510
8603
  mergeProxies,
8604
+ extractProp,
8511
8605
  findClosest,
8606
+ onElRemoved,
8512
8607
  closestRoot,
8513
8608
  destroyTree,
8514
8609
  interceptor,
8610
+ // INTERNAL: not public API and is subject to change without major release.
8515
8611
  transition,
8612
+ // INTERNAL
8516
8613
  setStyles,
8614
+ // INTERNAL
8517
8615
  mutateDom,
8518
8616
  directive,
8617
+ entangle,
8519
8618
  throttle,
8520
8619
  debounce,
8521
8620
  evaluate,
@@ -8528,6 +8627,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8528
8627
  store,
8529
8628
  start,
8530
8629
  clone,
8630
+ // INTERNAL
8631
+ cloneNode,
8632
+ // INTERNAL
8531
8633
  bound: getBinding,
8532
8634
  $data: scope,
8533
8635
  walk,
@@ -8547,7 +8649,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8547
8649
  var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
8548
8650
  var EMPTY_OBJ = true ? Object.freeze({}) : {};
8549
8651
  var EMPTY_ARR = true ? Object.freeze([]) : [];
8550
- var extend = Object.assign;
8551
8652
  var hasOwnProperty = Object.prototype.hasOwnProperty;
8552
8653
  var hasOwn = (val, key) => hasOwnProperty.call(val, key);
8553
8654
  var isArray = Array.isArray;
@@ -8757,34 +8858,34 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8757
8858
  var isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
8758
8859
  var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
8759
8860
  var get2 = /* @__PURE__ */ createGetter();
8760
- var shallowGet = /* @__PURE__ */ createGetter(false, true);
8761
8861
  var readonlyGet = /* @__PURE__ */ createGetter(true);
8762
- var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
8763
- var arrayInstrumentations = {};
8764
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
8765
- const method = Array.prototype[key];
8766
- arrayInstrumentations[key] = function(...args) {
8767
- const arr = toRaw(this);
8768
- for (let i2 = 0, l2 = this.length; i2 < l2; i2++) {
8769
- track(arr, "get", i2 + "");
8770
- }
8771
- const res = method.apply(arr, args);
8772
- if (res === -1 || res === false) {
8773
- return method.apply(arr, args.map(toRaw));
8774
- } else {
8862
+ var arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
8863
+ function createArrayInstrumentations() {
8864
+ const instrumentations = {};
8865
+ ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
8866
+ instrumentations[key] = function(...args) {
8867
+ const arr = toRaw(this);
8868
+ for (let i2 = 0, l2 = this.length; i2 < l2; i2++) {
8869
+ track(arr, "get", i2 + "");
8870
+ }
8871
+ const res = arr[key](...args);
8872
+ if (res === -1 || res === false) {
8873
+ return arr[key](...args.map(toRaw));
8874
+ } else {
8875
+ return res;
8876
+ }
8877
+ };
8878
+ });
8879
+ ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
8880
+ instrumentations[key] = function(...args) {
8881
+ pauseTracking();
8882
+ const res = toRaw(this)[key].apply(this, args);
8883
+ resetTracking();
8775
8884
  return res;
8776
- }
8777
- };
8778
- });
8779
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
8780
- const method = Array.prototype[key];
8781
- arrayInstrumentations[key] = function(...args) {
8782
- pauseTracking();
8783
- const res = method.apply(this, args);
8784
- resetTracking();
8785
- return res;
8786
- };
8787
- });
8885
+ };
8886
+ });
8887
+ return instrumentations;
8888
+ }
8788
8889
  function createGetter(isReadonly = false, shallow = false) {
8789
8890
  return function get3(target, key, receiver) {
8790
8891
  if (key === "__v_isReactive") {
@@ -8819,7 +8920,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8819
8920
  };
8820
8921
  }
8821
8922
  var set2 = /* @__PURE__ */ createSetter();
8822
- var shallowSet = /* @__PURE__ */ createSetter(true);
8823
8923
  function createSetter(shallow = false) {
8824
8924
  return function set3(target, key, value, receiver) {
8825
8925
  let oldValue = target[key];
@@ -8885,19 +8985,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8885
8985
  return true;
8886
8986
  }
8887
8987
  };
8888
- var shallowReactiveHandlers = extend({}, mutableHandlers, {
8889
- get: shallowGet,
8890
- set: shallowSet
8891
- });
8892
- var shallowReadonlyHandlers = extend({}, readonlyHandlers, {
8893
- get: shallowReadonlyGet
8894
- });
8895
8988
  var toReactive = (value) => isObject(value) ? reactive2(value) : value;
8896
8989
  var toReadonly = (value) => isObject(value) ? readonly(value) : value;
8897
8990
  var toShallow = (value) => value;
8898
8991
  var getProto = (v2) => Reflect.getPrototypeOf(v2);
8899
8992
  function get$1(target, key, isReadonly = false, isShallow = false) {
8900
- target = target["__v_raw"];
8993
+ target = target[
8994
+ "__v_raw"
8995
+ /* RAW */
8996
+ ];
8901
8997
  const rawTarget = toRaw(target);
8902
8998
  const rawKey = toRaw(key);
8903
8999
  if (key !== rawKey) {
@@ -8915,7 +9011,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8915
9011
  }
8916
9012
  }
8917
9013
  function has$1(key, isReadonly = false) {
8918
- const target = this["__v_raw"];
9014
+ const target = this[
9015
+ "__v_raw"
9016
+ /* RAW */
9017
+ ];
8919
9018
  const rawTarget = toRaw(target);
8920
9019
  const rawKey = toRaw(key);
8921
9020
  if (key !== rawKey) {
@@ -8925,7 +9024,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8925
9024
  return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
8926
9025
  }
8927
9026
  function size(target, isReadonly = false) {
8928
- target = target["__v_raw"];
9027
+ target = target[
9028
+ "__v_raw"
9029
+ /* RAW */
9030
+ ];
8929
9031
  !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY);
8930
9032
  return Reflect.get(target, "size", target);
8931
9033
  }
@@ -8990,7 +9092,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
8990
9092
  function createForEach(isReadonly, isShallow) {
8991
9093
  return function forEach(callback, thisArg) {
8992
9094
  const observed = this;
8993
- const target = observed["__v_raw"];
9095
+ const target = observed[
9096
+ "__v_raw"
9097
+ /* RAW */
9098
+ ];
8994
9099
  const rawTarget = toRaw(target);
8995
9100
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
8996
9101
  !isReadonly && track(rawTarget, "iterate", ITERATE_KEY);
@@ -9001,7 +9106,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9001
9106
  }
9002
9107
  function createIterableMethod(method, isReadonly, isShallow) {
9003
9108
  return function(...args) {
9004
- const target = this["__v_raw"];
9109
+ const target = this[
9110
+ "__v_raw"
9111
+ /* RAW */
9112
+ ];
9005
9113
  const rawTarget = toRaw(target);
9006
9114
  const targetIsMap = isMap(rawTarget);
9007
9115
  const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
@@ -9010,6 +9118,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9010
9118
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
9011
9119
  !isReadonly && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
9012
9120
  return {
9121
+ // iterator protocol
9013
9122
  next() {
9014
9123
  const { value, done } = innerIterator.next();
9015
9124
  return done ? { value, done } : {
@@ -9017,6 +9126,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9017
9126
  done
9018
9127
  };
9019
9128
  },
9129
+ // iterable protocol
9020
9130
  [Symbol.iterator]() {
9021
9131
  return this;
9022
9132
  }
@@ -9032,73 +9142,106 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9032
9142
  return type === "delete" ? false : this;
9033
9143
  };
9034
9144
  }
9035
- var mutableInstrumentations = {
9036
- get(key) {
9037
- return get$1(this, key);
9038
- },
9039
- get size() {
9040
- return size(this);
9041
- },
9042
- has: has$1,
9043
- add,
9044
- set: set$1,
9045
- delete: deleteEntry,
9046
- clear,
9047
- forEach: createForEach(false, false)
9048
- };
9049
- var shallowInstrumentations = {
9050
- get(key) {
9051
- return get$1(this, key, false, true);
9052
- },
9053
- get size() {
9054
- return size(this);
9055
- },
9056
- has: has$1,
9057
- add,
9058
- set: set$1,
9059
- delete: deleteEntry,
9060
- clear,
9061
- forEach: createForEach(false, true)
9062
- };
9063
- var readonlyInstrumentations = {
9064
- get(key) {
9065
- return get$1(this, key, true);
9066
- },
9067
- get size() {
9068
- return size(this, true);
9069
- },
9070
- has(key) {
9071
- return has$1.call(this, key, true);
9072
- },
9073
- add: createReadonlyMethod("add"),
9074
- set: createReadonlyMethod("set"),
9075
- delete: createReadonlyMethod("delete"),
9076
- clear: createReadonlyMethod("clear"),
9077
- forEach: createForEach(true, false)
9078
- };
9079
- var shallowReadonlyInstrumentations = {
9080
- get(key) {
9081
- return get$1(this, key, true, true);
9082
- },
9083
- get size() {
9084
- return size(this, true);
9085
- },
9086
- has(key) {
9087
- return has$1.call(this, key, true);
9088
- },
9089
- add: createReadonlyMethod("add"),
9090
- set: createReadonlyMethod("set"),
9091
- delete: createReadonlyMethod("delete"),
9092
- clear: createReadonlyMethod("clear"),
9093
- forEach: createForEach(true, true)
9094
- };
9095
- var iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
9096
- iteratorMethods.forEach((method) => {
9097
- mutableInstrumentations[method] = createIterableMethod(method, false, false);
9098
- readonlyInstrumentations[method] = createIterableMethod(method, true, false);
9099
- shallowInstrumentations[method] = createIterableMethod(method, false, true);
9100
- shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);
9101
- });
9145
+ function createInstrumentations() {
9146
+ const mutableInstrumentations2 = {
9147
+ get(key) {
9148
+ return get$1(this, key);
9149
+ },
9150
+ get size() {
9151
+ return size(this);
9152
+ },
9153
+ has: has$1,
9154
+ add,
9155
+ set: set$1,
9156
+ delete: deleteEntry,
9157
+ clear,
9158
+ forEach: createForEach(false, false)
9159
+ };
9160
+ const shallowInstrumentations2 = {
9161
+ get(key) {
9162
+ return get$1(this, key, false, true);
9163
+ },
9164
+ get size() {
9165
+ return size(this);
9166
+ },
9167
+ has: has$1,
9168
+ add,
9169
+ set: set$1,
9170
+ delete: deleteEntry,
9171
+ clear,
9172
+ forEach: createForEach(false, true)
9173
+ };
9174
+ const readonlyInstrumentations2 = {
9175
+ get(key) {
9176
+ return get$1(this, key, true);
9177
+ },
9178
+ get size() {
9179
+ return size(this, true);
9180
+ },
9181
+ has(key) {
9182
+ return has$1.call(this, key, true);
9183
+ },
9184
+ add: createReadonlyMethod(
9185
+ "add"
9186
+ /* ADD */
9187
+ ),
9188
+ set: createReadonlyMethod(
9189
+ "set"
9190
+ /* SET */
9191
+ ),
9192
+ delete: createReadonlyMethod(
9193
+ "delete"
9194
+ /* DELETE */
9195
+ ),
9196
+ clear: createReadonlyMethod(
9197
+ "clear"
9198
+ /* CLEAR */
9199
+ ),
9200
+ forEach: createForEach(true, false)
9201
+ };
9202
+ const shallowReadonlyInstrumentations2 = {
9203
+ get(key) {
9204
+ return get$1(this, key, true, true);
9205
+ },
9206
+ get size() {
9207
+ return size(this, true);
9208
+ },
9209
+ has(key) {
9210
+ return has$1.call(this, key, true);
9211
+ },
9212
+ add: createReadonlyMethod(
9213
+ "add"
9214
+ /* ADD */
9215
+ ),
9216
+ set: createReadonlyMethod(
9217
+ "set"
9218
+ /* SET */
9219
+ ),
9220
+ delete: createReadonlyMethod(
9221
+ "delete"
9222
+ /* DELETE */
9223
+ ),
9224
+ clear: createReadonlyMethod(
9225
+ "clear"
9226
+ /* CLEAR */
9227
+ ),
9228
+ forEach: createForEach(true, true)
9229
+ };
9230
+ const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
9231
+ iteratorMethods.forEach((method) => {
9232
+ mutableInstrumentations2[method] = createIterableMethod(method, false, false);
9233
+ readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
9234
+ shallowInstrumentations2[method] = createIterableMethod(method, false, true);
9235
+ shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
9236
+ });
9237
+ return [
9238
+ mutableInstrumentations2,
9239
+ readonlyInstrumentations2,
9240
+ shallowInstrumentations2,
9241
+ shallowReadonlyInstrumentations2
9242
+ ];
9243
+ }
9244
+ var [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
9102
9245
  function createInstrumentationGetter(isReadonly, shallow) {
9103
9246
  const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;
9104
9247
  return (target, key, receiver) => {
@@ -9113,16 +9256,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9113
9256
  };
9114
9257
  }
9115
9258
  var mutableCollectionHandlers = {
9116
- get: createInstrumentationGetter(false, false)
9117
- };
9118
- var shallowCollectionHandlers = {
9119
- get: createInstrumentationGetter(false, true)
9259
+ get: /* @__PURE__ */ createInstrumentationGetter(false, false)
9120
9260
  };
9121
9261
  var readonlyCollectionHandlers = {
9122
- get: createInstrumentationGetter(true, false)
9123
- };
9124
- var shallowReadonlyCollectionHandlers = {
9125
- get: createInstrumentationGetter(true, true)
9262
+ get: /* @__PURE__ */ createInstrumentationGetter(true, false)
9126
9263
  };
9127
9264
  function checkIdentityKeys(target, has2, key) {
9128
9265
  const rawKey = toRaw(key);
@@ -9150,10 +9287,16 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9150
9287
  }
9151
9288
  }
9152
9289
  function getTargetType(value) {
9153
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
9290
+ return value[
9291
+ "__v_skip"
9292
+ /* SKIP */
9293
+ ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
9154
9294
  }
9155
9295
  function reactive2(target) {
9156
- if (target && target["__v_isReadonly"]) {
9296
+ if (target && target[
9297
+ "__v_isReadonly"
9298
+ /* IS_READONLY */
9299
+ ]) {
9157
9300
  return target;
9158
9301
  }
9159
9302
  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
@@ -9168,7 +9311,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9168
9311
  }
9169
9312
  return target;
9170
9313
  }
9171
- if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) {
9314
+ if (target[
9315
+ "__v_raw"
9316
+ /* RAW */
9317
+ ] && !(isReadonly && target[
9318
+ "__v_isReactive"
9319
+ /* IS_REACTIVE */
9320
+ ])) {
9172
9321
  return target;
9173
9322
  }
9174
9323
  const existingProxy = proxyMap.get(target);
@@ -9184,7 +9333,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9184
9333
  return proxy;
9185
9334
  }
9186
9335
  function toRaw(observed) {
9187
- return observed && toRaw(observed["__v_raw"]) || observed;
9336
+ return observed && toRaw(observed[
9337
+ "__v_raw"
9338
+ /* RAW */
9339
+ ]) || observed;
9188
9340
  }
9189
9341
  function isRef(r2) {
9190
9342
  return Boolean(r2 && r2.__v_isRef === true);
@@ -9255,38 +9407,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9255
9407
  warnMissingPluginMagic("Focus", "focus", "focus");
9256
9408
  warnMissingPluginMagic("Persist", "persist", "persist");
9257
9409
  function warnMissingPluginMagic(name, magicName, slug) {
9258
- magic(magicName, (el) => warn(`You can't use [$${directiveName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el));
9259
- }
9260
- function entangle({ get: outerGet, set: outerSet }, { get: innerGet, set: innerSet }) {
9261
- let firstRun = true;
9262
- let outerHash, innerHash, outerHashLatest, innerHashLatest;
9263
- let reference2 = effect(() => {
9264
- let outer, inner;
9265
- if (firstRun) {
9266
- outer = outerGet();
9267
- innerSet(outer);
9268
- inner = innerGet();
9269
- firstRun = false;
9270
- } else {
9271
- outer = outerGet();
9272
- inner = innerGet();
9273
- outerHashLatest = JSON.stringify(outer);
9274
- innerHashLatest = JSON.stringify(inner);
9275
- if (outerHashLatest !== outerHash) {
9276
- inner = innerGet();
9277
- innerSet(outer);
9278
- inner = outer;
9279
- } else {
9280
- outerSet(inner);
9281
- outer = inner;
9282
- }
9283
- }
9284
- outerHash = JSON.stringify(outer);
9285
- innerHash = JSON.stringify(inner);
9286
- });
9287
- return () => {
9288
- release(reference2);
9289
- };
9410
+ magic(magicName, (el) => warn(`You can't use [$${magicName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el));
9290
9411
  }
9291
9412
  directive("modelable", (el, { expression }, { effect: effect32, evaluateLater: evaluateLater2, cleanup: cleanup2 }) => {
9292
9413
  let func = evaluateLater2(expression);
@@ -9297,7 +9418,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9297
9418
  };
9298
9419
  let evaluateInnerSet = evaluateLater2(`${expression} = __placeholder`);
9299
9420
  let innerSet = (val) => evaluateInnerSet(() => {
9300
- }, { scope: { __placeholder: val } });
9421
+ }, { scope: { "__placeholder": val } });
9301
9422
  let initialValue = innerGet();
9302
9423
  innerSet(initialValue);
9303
9424
  queueMicrotask(() => {
@@ -9306,38 +9427,36 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9306
9427
  el._x_removeModelListeners["default"]();
9307
9428
  let outerGet = el._x_model.get;
9308
9429
  let outerSet = el._x_model.set;
9309
- let releaseEntanglement = entangle({
9310
- get() {
9311
- return outerGet();
9312
- },
9313
- set(value) {
9314
- outerSet(value);
9315
- }
9316
- }, {
9317
- get() {
9318
- return innerGet();
9430
+ let releaseEntanglement = entangle(
9431
+ {
9432
+ get() {
9433
+ return outerGet();
9434
+ },
9435
+ set(value) {
9436
+ outerSet(value);
9437
+ }
9319
9438
  },
9320
- set(value) {
9321
- innerSet(value);
9439
+ {
9440
+ get() {
9441
+ return innerGet();
9442
+ },
9443
+ set(value) {
9444
+ innerSet(value);
9445
+ }
9322
9446
  }
9323
- });
9447
+ );
9324
9448
  cleanup2(releaseEntanglement);
9325
9449
  });
9326
9450
  });
9327
- var teleportContainerDuringClone = document.createElement("div");
9328
9451
  directive("teleport", (el, { modifiers, expression }, { cleanup: cleanup2 }) => {
9329
9452
  if (el.tagName.toLowerCase() !== "template")
9330
9453
  warn("x-teleport can only be used on a <template> tag", el);
9331
- let target = skipDuringClone(() => {
9332
- return document.querySelector(expression);
9333
- }, () => {
9334
- return teleportContainerDuringClone;
9335
- })();
9336
- if (!target)
9337
- warn(`Cannot find x-teleport element for selector: "${expression}"`);
9454
+ let target = getTarget(expression);
9338
9455
  let clone2 = el.content.cloneNode(true).firstElementChild;
9339
9456
  el._x_teleport = clone2;
9340
9457
  clone2._x_teleportBack = el;
9458
+ el.setAttribute("data-teleport-template", true);
9459
+ clone2.setAttribute("data-teleport-target", true);
9341
9460
  if (el._x_forwardEvents) {
9342
9461
  el._x_forwardEvents.forEach((eventName) => {
9343
9462
  clone2.addEventListener(eventName, (e2) => {
@@ -9347,19 +9466,39 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9347
9466
  });
9348
9467
  }
9349
9468
  addScopeToNode(clone2, {}, el);
9350
- mutateDom(() => {
9351
- if (modifiers.includes("prepend")) {
9352
- target.parentNode.insertBefore(clone2, target);
9353
- } else if (modifiers.includes("append")) {
9354
- target.parentNode.insertBefore(clone2, target.nextSibling);
9469
+ let placeInDom = (clone3, target2, modifiers2) => {
9470
+ if (modifiers2.includes("prepend")) {
9471
+ target2.parentNode.insertBefore(clone3, target2);
9472
+ } else if (modifiers2.includes("append")) {
9473
+ target2.parentNode.insertBefore(clone3, target2.nextSibling);
9355
9474
  } else {
9356
- target.appendChild(clone2);
9475
+ target2.appendChild(clone3);
9357
9476
  }
9477
+ };
9478
+ mutateDom(() => {
9479
+ placeInDom(clone2, target, modifiers);
9358
9480
  initTree(clone2);
9359
9481
  clone2._x_ignore = true;
9360
9482
  });
9483
+ el._x_teleportPutBack = () => {
9484
+ let target2 = getTarget(expression);
9485
+ mutateDom(() => {
9486
+ placeInDom(el._x_teleport, target2, modifiers);
9487
+ });
9488
+ };
9361
9489
  cleanup2(() => clone2.remove());
9362
9490
  });
9491
+ var teleportContainerDuringClone = document.createElement("div");
9492
+ function getTarget(expression) {
9493
+ let target = skipDuringClone(() => {
9494
+ return document.querySelector(expression);
9495
+ }, () => {
9496
+ return teleportContainerDuringClone;
9497
+ })();
9498
+ if (!target)
9499
+ warn(`Cannot find x-teleport element for selector: "${expression}"`);
9500
+ return target;
9501
+ }
9363
9502
  var handler = () => {
9364
9503
  };
9365
9504
  handler.inline = (el, { modifiers }, { cleanup: cleanup2 }) => {
@@ -9372,7 +9511,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9372
9511
  directive("effect", (el, { expression }, { effect: effect32 }) => effect32(evaluateLater(el, expression)));
9373
9512
  function on(el, event, modifiers, callback) {
9374
9513
  let listenerTarget = el;
9375
- let handler3 = (e2) => callback(e2);
9514
+ let handler4 = (e2) => callback(e2);
9376
9515
  let options = {};
9377
9516
  let wrapHandler = (callback2, wrapper) => (e2) => wrapper(callback2, e2);
9378
9517
  if (modifiers.includes("dot"))
@@ -9390,30 +9529,30 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9390
9529
  if (modifiers.includes("debounce")) {
9391
9530
  let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait";
9392
9531
  let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
9393
- handler3 = debounce(handler3, wait);
9532
+ handler4 = debounce(handler4, wait);
9394
9533
  }
9395
9534
  if (modifiers.includes("throttle")) {
9396
9535
  let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait";
9397
9536
  let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
9398
- handler3 = throttle(handler3, wait);
9537
+ handler4 = throttle(handler4, wait);
9399
9538
  }
9400
9539
  if (modifiers.includes("prevent"))
9401
- handler3 = wrapHandler(handler3, (next, e2) => {
9540
+ handler4 = wrapHandler(handler4, (next, e2) => {
9402
9541
  e2.preventDefault();
9403
9542
  next(e2);
9404
9543
  });
9405
9544
  if (modifiers.includes("stop"))
9406
- handler3 = wrapHandler(handler3, (next, e2) => {
9545
+ handler4 = wrapHandler(handler4, (next, e2) => {
9407
9546
  e2.stopPropagation();
9408
9547
  next(e2);
9409
9548
  });
9410
9549
  if (modifiers.includes("self"))
9411
- handler3 = wrapHandler(handler3, (next, e2) => {
9550
+ handler4 = wrapHandler(handler4, (next, e2) => {
9412
9551
  e2.target === el && next(e2);
9413
9552
  });
9414
9553
  if (modifiers.includes("away") || modifiers.includes("outside")) {
9415
9554
  listenerTarget = document;
9416
- handler3 = wrapHandler(handler3, (next, e2) => {
9555
+ handler4 = wrapHandler(handler4, (next, e2) => {
9417
9556
  if (el.contains(e2.target))
9418
9557
  return;
9419
9558
  if (e2.target.isConnected === false)
@@ -9426,12 +9565,12 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9426
9565
  });
9427
9566
  }
9428
9567
  if (modifiers.includes("once")) {
9429
- handler3 = wrapHandler(handler3, (next, e2) => {
9568
+ handler4 = wrapHandler(handler4, (next, e2) => {
9430
9569
  next(e2);
9431
- listenerTarget.removeEventListener(event, handler3, options);
9570
+ listenerTarget.removeEventListener(event, handler4, options);
9432
9571
  });
9433
9572
  }
9434
- handler3 = wrapHandler(handler3, (next, e2) => {
9573
+ handler4 = wrapHandler(handler4, (next, e2) => {
9435
9574
  if (isKeyEvent(event)) {
9436
9575
  if (isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers)) {
9437
9576
  return;
@@ -9439,9 +9578,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9439
9578
  }
9440
9579
  next(e2);
9441
9580
  });
9442
- listenerTarget.addEventListener(event, handler3, options);
9581
+ listenerTarget.addEventListener(event, handler4, options);
9443
9582
  return () => {
9444
- listenerTarget.removeEventListener(event, handler3, options);
9583
+ listenerTarget.removeEventListener(event, handler4, options);
9445
9584
  };
9446
9585
  }
9447
9586
  function dotSyntax(subject) {
@@ -9454,7 +9593,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9454
9593
  return !Array.isArray(subject) && !isNaN(subject);
9455
9594
  }
9456
9595
  function kebabCase2(subject) {
9457
- if ([" ", "_"].includes(subject))
9596
+ if ([" ", "_"].includes(
9597
+ subject
9598
+ ))
9458
9599
  return subject;
9459
9600
  return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
9460
9601
  }
@@ -9498,20 +9639,20 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9498
9639
  return [];
9499
9640
  key = kebabCase2(key);
9500
9641
  let modifierToKeyMap = {
9501
- ctrl: "control",
9502
- slash: "/",
9503
- space: " ",
9504
- spacebar: " ",
9505
- cmd: "meta",
9506
- esc: "escape",
9507
- up: "arrow-up",
9508
- down: "arrow-down",
9509
- left: "arrow-left",
9510
- right: "arrow-right",
9511
- period: ".",
9512
- equal: "=",
9513
- minus: "-",
9514
- underscore: "_"
9642
+ "ctrl": "control",
9643
+ "slash": "/",
9644
+ "space": " ",
9645
+ "spacebar": " ",
9646
+ "cmd": "meta",
9647
+ "esc": "escape",
9648
+ "up": "arrow-up",
9649
+ "down": "arrow-down",
9650
+ "left": "arrow-left",
9651
+ "right": "arrow-right",
9652
+ "period": ".",
9653
+ "equal": "=",
9654
+ "minus": "-",
9655
+ "underscore": "_"
9515
9656
  };
9516
9657
  modifierToKeyMap[key] = key;
9517
9658
  return Object.keys(modifierToKeyMap).map((modifier) => {
@@ -9547,7 +9688,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9547
9688
  } else {
9548
9689
  evaluateSet(() => {
9549
9690
  }, {
9550
- scope: { __placeholder: value }
9691
+ scope: { "__placeholder": value }
9551
9692
  });
9552
9693
  }
9553
9694
  };
@@ -9562,8 +9703,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9562
9703
  } : on(el, event, modifiers, (e2) => {
9563
9704
  setValue(getInputValue(el, modifiers, e2, getValue()));
9564
9705
  });
9565
- if (modifiers.includes("fill") && [null, ""].includes(getValue())) {
9566
- el.dispatchEvent(new Event(event, {}));
9706
+ if (modifiers.includes("fill")) {
9707
+ if ([null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue())) {
9708
+ el.dispatchEvent(new Event(event, {}));
9709
+ }
9567
9710
  }
9568
9711
  if (!el._x_removeModelListeners)
9569
9712
  el._x_removeModelListeners = {};
@@ -9584,7 +9727,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9584
9727
  }
9585
9728
  };
9586
9729
  el._x_forceModelUpdate = (value) => {
9587
- value = value === void 0 ? getValue() : value;
9588
9730
  if (value === void 0 && typeof expression === "string" && expression.match(/\./))
9589
9731
  value = "";
9590
9732
  window.fromModel = true;
@@ -9600,9 +9742,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9600
9742
  });
9601
9743
  function getInputValue(el, modifiers, event, currentValue) {
9602
9744
  return mutateDom(() => {
9603
- var _a;
9604
9745
  if (event instanceof CustomEvent && event.detail !== void 0)
9605
- return (_a = event.detail) != null ? _a : event.target.value;
9746
+ return event.detail !== null && event.detail !== void 0 ? event.detail : event.target.value;
9606
9747
  else if (el.type === "checkbox") {
9607
9748
  if (Array.isArray(currentValue)) {
9608
9749
  let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
@@ -9668,7 +9809,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9668
9809
  });
9669
9810
  });
9670
9811
  mapAttributes(startingWith(":", into(prefix("bind:"))));
9671
- directive("bind", (el, { value, modifiers, expression, original }, { effect: effect32 }) => {
9812
+ var handler2 = (el, { value, modifiers, expression, original }, { effect: effect32 }) => {
9672
9813
  if (!value) {
9673
9814
  let bindingProviders = {};
9674
9815
  injectBindingProviders(bindingProviders);
@@ -9680,6 +9821,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9680
9821
  }
9681
9822
  if (value === "key")
9682
9823
  return storeKeyForXFor(el, expression);
9824
+ if (el._x_inlineBindings && el._x_inlineBindings[value] && el._x_inlineBindings[value].extract) {
9825
+ return;
9826
+ }
9683
9827
  let evaluate2 = evaluateLater(el, expression);
9684
9828
  effect32(() => evaluate2((result) => {
9685
9829
  if (result === void 0 && typeof expression === "string" && expression.match(/\./)) {
@@ -9687,12 +9831,22 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9687
9831
  }
9688
9832
  mutateDom(() => bind(el, value, result, modifiers));
9689
9833
  }));
9690
- });
9834
+ };
9835
+ handler2.inline = (el, { value, modifiers, expression }) => {
9836
+ if (!value)
9837
+ return;
9838
+ if (!el._x_inlineBindings)
9839
+ el._x_inlineBindings = {};
9840
+ el._x_inlineBindings[value] = { expression, extract: false };
9841
+ };
9842
+ directive("bind", handler2);
9691
9843
  function storeKeyForXFor(el, expression) {
9692
9844
  el._x_keyExpression = expression;
9693
9845
  }
9694
9846
  addRootSelector(() => `[${prefix("data")}]`);
9695
- directive("data", skipDuringClone((el, { expression }, { cleanup: cleanup2 }) => {
9847
+ directive("data", (el, { expression }, { cleanup: cleanup2 }) => {
9848
+ if (shouldSkipRegisteringDataDuringClone(el))
9849
+ return;
9696
9850
  expression = expression === "" ? "{}" : expression;
9697
9851
  let magicContext = {};
9698
9852
  injectMagics(magicContext, el);
@@ -9703,14 +9857,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9703
9857
  data2 = {};
9704
9858
  injectMagics(data2, el);
9705
9859
  let reactiveData = reactive(data2);
9706
- initInterceptors(reactiveData);
9860
+ initInterceptors2(reactiveData);
9707
9861
  let undo = addScopeToNode(el, reactiveData);
9708
9862
  reactiveData["init"] && evaluate(el, reactiveData["init"]);
9709
9863
  cleanup2(() => {
9710
9864
  reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]);
9711
9865
  undo();
9712
9866
  });
9713
- }));
9867
+ });
9714
9868
  directive("show", (el, { modifiers, expression }, { effect: effect32 }) => {
9715
9869
  let evaluate2 = evaluateLater(el, expression);
9716
9870
  if (!el._x_doHide)
@@ -9738,13 +9892,16 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9738
9892
  el._x_isShown = true;
9739
9893
  };
9740
9894
  let clickAwayCompatibleShow = () => setTimeout(show);
9741
- let toggle = once((value) => value ? show() : hide2(), (value) => {
9742
- if (typeof el._x_toggleAndCascadeWithTransitions === "function") {
9743
- el._x_toggleAndCascadeWithTransitions(el, value, show, hide2);
9744
- } else {
9745
- value ? clickAwayCompatibleShow() : hide2();
9895
+ let toggle = once(
9896
+ (value) => value ? show() : hide2(),
9897
+ (value) => {
9898
+ if (typeof el._x_toggleAndCascadeWithTransitions === "function") {
9899
+ el._x_toggleAndCascadeWithTransitions(el, value, show, hide2);
9900
+ } else {
9901
+ value ? clickAwayCompatibleShow() : hide2();
9902
+ }
9746
9903
  }
9747
- });
9904
+ );
9748
9905
  let oldValue;
9749
9906
  let firstTime = true;
9750
9907
  effect32(() => evaluate2((value) => {
@@ -9760,7 +9917,11 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9760
9917
  directive("for", (el, { expression }, { effect: effect32, cleanup: cleanup2 }) => {
9761
9918
  let iteratorNames = parseForExpression(expression);
9762
9919
  let evaluateItems = evaluateLater(el, iteratorNames.items);
9763
- let evaluateKey = evaluateLater(el, el._x_keyExpression || "index");
9920
+ let evaluateKey = evaluateLater(
9921
+ el,
9922
+ // the x-bind:key expression is stored for our use instead of evaluated.
9923
+ el._x_keyExpression || "index"
9924
+ );
9764
9925
  el._x_prevKeys = [];
9765
9926
  el._x_lookup = {};
9766
9927
  effect32(() => loop(el, iteratorNames, evaluateItems, evaluateKey));
@@ -9926,17 +10087,19 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9926
10087
  function isNumeric3(subject) {
9927
10088
  return !Array.isArray(subject) && !isNaN(subject);
9928
10089
  }
9929
- function handler2() {
10090
+ function handler3() {
9930
10091
  }
9931
- handler2.inline = (el, { expression }, { cleanup: cleanup2 }) => {
10092
+ handler3.inline = (el, { expression }, { cleanup: cleanup2 }) => {
9932
10093
  let root = closestRoot(el);
9933
10094
  if (!root._x_refs)
9934
10095
  root._x_refs = {};
9935
10096
  root._x_refs[expression] = el;
9936
10097
  cleanup2(() => delete root._x_refs[expression]);
9937
10098
  };
9938
- directive("ref", handler2);
10099
+ directive("ref", handler3);
9939
10100
  directive("if", (el, { expression }, { effect: effect32, cleanup: cleanup2 }) => {
10101
+ if (el.tagName.toLowerCase() !== "template")
10102
+ warn("x-if can only be used on a <template> tag", el);
9940
10103
  let evaluate2 = evaluateLater(el, expression);
9941
10104
  let show = () => {
9942
10105
  if (el._x_currentIfEl)
@@ -9986,7 +10149,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9986
10149
  }
9987
10150
  let removeListener = on(el, value, modifiers, (e2) => {
9988
10151
  evaluate2(() => {
9989
- }, { scope: { $event: e2 }, params: [e2] });
10152
+ }, { scope: { "$event": e2 }, params: [e2] });
9990
10153
  });
9991
10154
  cleanup2(() => removeListener());
9992
10155
  }));
@@ -9994,8 +10157,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9994
10157
  warnMissingPluginDirective("Intersect", "intersect", "intersect");
9995
10158
  warnMissingPluginDirective("Focus", "trap", "focus");
9996
10159
  warnMissingPluginDirective("Mask", "mask", "mask");
9997
- function warnMissingPluginDirective(name, directiveName2, slug) {
9998
- directive(directiveName2, (el) => warn(`You can't use [x-${directiveName2}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el));
10160
+ function warnMissingPluginDirective(name, directiveName, slug) {
10161
+ directive(directiveName, (el) => warn(`You can't use [x-${directiveName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el));
9999
10162
  }
10000
10163
  alpine_default.setEvaluator(normalEvaluator);
10001
10164
  alpine_default.setReactivityEngine({ reactive: reactive2, effect: effect2, release: stop, raw: toRaw });
@@ -10003,72 +10166,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10003
10166
  var module_default = src_default;
10004
10167
 
10005
10168
  // ../../../node_modules/@alpinejs/morph/dist/module.esm.js
10006
- function createElement(html) {
10007
- const template = document.createElement("template");
10008
- template.innerHTML = html;
10009
- return template.content.firstElementChild;
10010
- }
10011
- function textOrComment(el) {
10012
- return el.nodeType === 3 || el.nodeType === 8;
10013
- }
10014
- var dom = {
10015
- replace(children, old, replacement) {
10016
- let index = children.indexOf(old);
10017
- if (index === -1)
10018
- throw "Cant find element in children";
10019
- old.replaceWith(replacement);
10020
- children[index] = replacement;
10021
- return children;
10022
- },
10023
- before(children, reference2, subject) {
10024
- let index = children.indexOf(reference2);
10025
- if (index === -1)
10026
- throw "Cant find element in children";
10027
- reference2.before(subject);
10028
- children.splice(index, 0, subject);
10029
- return children;
10030
- },
10031
- append(children, subject, appendFn) {
10032
- let last = children[children.length - 1];
10033
- appendFn(subject);
10034
- children.push(subject);
10035
- return children;
10036
- },
10037
- remove(children, subject) {
10038
- let index = children.indexOf(subject);
10039
- if (index === -1)
10040
- throw "Cant find element in children";
10041
- subject.remove();
10042
- return children.filter((i2) => i2 !== subject);
10043
- },
10044
- first(children) {
10045
- return this.teleportTo(children[0]);
10046
- },
10047
- next(children, reference2) {
10048
- let index = children.indexOf(reference2);
10049
- if (index === -1)
10050
- return;
10051
- return this.teleportTo(this.teleportBack(children[index + 1]));
10052
- },
10053
- teleportTo(el) {
10054
- if (!el)
10055
- return el;
10056
- if (el._x_teleport)
10057
- return el._x_teleport;
10058
- return el;
10059
- },
10060
- teleportBack(el) {
10061
- if (!el)
10062
- return el;
10063
- if (el._x_teleportBack)
10064
- return el._x_teleportBack;
10065
- return el;
10066
- }
10067
- };
10068
- var resolveStep = () => {
10069
- };
10070
- var logger = () => {
10071
- };
10072
10169
  function morph(from, toHtml, options) {
10073
10170
  monkeyPatchDomSetAttributeToAllowAtSymbols();
10074
10171
  let fromEl;
@@ -10089,12 +10186,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10089
10186
  }
10090
10187
  function patch(from2, to) {
10091
10188
  if (differentElementNamesTypesOrKeys(from2, to)) {
10092
- return patchElement(from2, to);
10189
+ return swapElements(from2, to);
10093
10190
  }
10094
10191
  let updateChildrenOnly = false;
10095
10192
  if (shouldSkip(updating, from2, to, () => updateChildrenOnly = true))
10096
10193
  return;
10097
- window.Alpine && initializeAlpineOnTo(from2, to, () => updateChildrenOnly = true);
10194
+ if (from2.nodeType === 1 && window.Alpine) {
10195
+ window.Alpine.cloneNode(from2, to);
10196
+ }
10098
10197
  if (textOrComment(to)) {
10099
10198
  patchNodeValue(from2, to);
10100
10199
  updated(from2, to);
@@ -10104,20 +10203,18 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10104
10203
  patchAttributes(from2, to);
10105
10204
  }
10106
10205
  updated(from2, to);
10107
- patchChildren(Array.from(from2.childNodes), Array.from(to.childNodes), (toAppend) => {
10108
- from2.appendChild(toAppend);
10109
- });
10206
+ patchChildren(from2, to);
10110
10207
  }
10111
10208
  function differentElementNamesTypesOrKeys(from2, to) {
10112
10209
  return from2.nodeType != to.nodeType || from2.nodeName != to.nodeName || getKey(from2) != getKey(to);
10113
10210
  }
10114
- function patchElement(from2, to) {
10211
+ function swapElements(from2, to) {
10115
10212
  if (shouldSkip(removing, from2))
10116
10213
  return;
10117
10214
  let toCloned = to.cloneNode(true);
10118
10215
  if (shouldSkip(adding, toCloned))
10119
10216
  return;
10120
- dom.replace([from2], from2, toCloned);
10217
+ from2.replaceWith(toCloned);
10121
10218
  removed(from2);
10122
10219
  added(toCloned);
10123
10220
  }
@@ -10128,6 +10225,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10128
10225
  }
10129
10226
  }
10130
10227
  function patchAttributes(from2, to) {
10228
+ if (from2._x_transitioning)
10229
+ return;
10131
10230
  if (from2._x_isShown && !to._x_isShown) {
10132
10231
  return;
10133
10232
  }
@@ -10150,120 +10249,120 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10150
10249
  }
10151
10250
  }
10152
10251
  }
10153
- function patchChildren(fromChildren, toChildren, appendFn) {
10154
- let fromKeyDomNodeMap = {};
10252
+ function patchChildren(from2, to) {
10253
+ let fromKeys = keyToMap(from2.children);
10155
10254
  let fromKeyHoldovers = {};
10156
- let currentTo = dom.first(toChildren);
10157
- let currentFrom = dom.first(fromChildren);
10255
+ let currentTo = getFirstNode(to);
10256
+ let currentFrom = getFirstNode(from2);
10158
10257
  while (currentTo) {
10159
10258
  let toKey = getKey(currentTo);
10160
10259
  let fromKey = getKey(currentFrom);
10161
10260
  if (!currentFrom) {
10162
10261
  if (toKey && fromKeyHoldovers[toKey]) {
10163
10262
  let holdover = fromKeyHoldovers[toKey];
10164
- fromChildren = dom.append(fromChildren, holdover, appendFn);
10263
+ from2.appendChild(holdover);
10165
10264
  currentFrom = holdover;
10166
10265
  } else {
10167
10266
  if (!shouldSkip(adding, currentTo)) {
10168
10267
  let clone2 = currentTo.cloneNode(true);
10169
- fromChildren = dom.append(fromChildren, clone2, appendFn);
10268
+ from2.appendChild(clone2);
10170
10269
  added(clone2);
10171
10270
  }
10172
- currentTo = dom.next(toChildren, currentTo);
10271
+ currentTo = getNextSibling(to, currentTo);
10173
10272
  continue;
10174
10273
  }
10175
10274
  }
10176
- let isIf = (node) => node.nodeType === 8 && node.textContent === " __BLOCK__ ";
10177
- let isEnd = (node) => node.nodeType === 8 && node.textContent === " __ENDBLOCK__ ";
10275
+ let isIf = (node) => node && node.nodeType === 8 && node.textContent === "[if BLOCK]><![endif]";
10276
+ let isEnd = (node) => node && node.nodeType === 8 && node.textContent === "[if ENDBLOCK]><![endif]";
10178
10277
  if (isIf(currentTo) && isIf(currentFrom)) {
10179
- let newFromChildren = [];
10180
- let appendPoint;
10181
10278
  let nestedIfCount = 0;
10279
+ let fromBlockStart = currentFrom;
10182
10280
  while (currentFrom) {
10183
- let next = dom.next(fromChildren, currentFrom);
10281
+ let next = getNextSibling(from2, currentFrom);
10184
10282
  if (isIf(next)) {
10185
10283
  nestedIfCount++;
10186
10284
  } else if (isEnd(next) && nestedIfCount > 0) {
10187
10285
  nestedIfCount--;
10188
10286
  } else if (isEnd(next) && nestedIfCount === 0) {
10189
- currentFrom = dom.next(fromChildren, next);
10190
- appendPoint = next;
10287
+ currentFrom = next;
10191
10288
  break;
10192
10289
  }
10193
- newFromChildren.push(next);
10194
10290
  currentFrom = next;
10195
10291
  }
10196
- let newToChildren = [];
10292
+ let fromBlockEnd = currentFrom;
10197
10293
  nestedIfCount = 0;
10294
+ let toBlockStart = currentTo;
10198
10295
  while (currentTo) {
10199
- let next = dom.next(toChildren, currentTo);
10296
+ let next = getNextSibling(to, currentTo);
10200
10297
  if (isIf(next)) {
10201
10298
  nestedIfCount++;
10202
10299
  } else if (isEnd(next) && nestedIfCount > 0) {
10203
10300
  nestedIfCount--;
10204
10301
  } else if (isEnd(next) && nestedIfCount === 0) {
10205
- currentTo = dom.next(toChildren, next);
10302
+ currentTo = next;
10206
10303
  break;
10207
10304
  }
10208
- newToChildren.push(next);
10209
10305
  currentTo = next;
10210
10306
  }
10211
- patchChildren(newFromChildren, newToChildren, (node) => appendPoint.before(node));
10307
+ let toBlockEnd = currentTo;
10308
+ let fromBlock = new Block(fromBlockStart, fromBlockEnd);
10309
+ let toBlock = new Block(toBlockStart, toBlockEnd);
10310
+ patchChildren(fromBlock, toBlock);
10212
10311
  continue;
10213
10312
  }
10214
- if (currentFrom.nodeType === 1 && lookahead) {
10215
- let nextToElementSibling = dom.next(toChildren, currentTo);
10313
+ if (currentFrom.nodeType === 1 && lookahead && !currentFrom.isEqualNode(currentTo)) {
10314
+ let nextToElementSibling = getNextSibling(to, currentTo);
10216
10315
  let found = false;
10217
10316
  while (!found && nextToElementSibling) {
10218
- if (currentFrom.isEqualNode(nextToElementSibling)) {
10317
+ if (nextToElementSibling.nodeType === 1 && currentFrom.isEqualNode(nextToElementSibling)) {
10219
10318
  found = true;
10220
- [fromChildren, currentFrom] = addNodeBefore(fromChildren, currentTo, currentFrom);
10319
+ currentFrom = addNodeBefore(from2, currentTo, currentFrom);
10221
10320
  fromKey = getKey(currentFrom);
10222
10321
  }
10223
- nextToElementSibling = dom.next(toChildren, nextToElementSibling);
10322
+ nextToElementSibling = getNextSibling(to, nextToElementSibling);
10224
10323
  }
10225
10324
  }
10226
10325
  if (toKey !== fromKey) {
10227
10326
  if (!toKey && fromKey) {
10228
10327
  fromKeyHoldovers[fromKey] = currentFrom;
10229
- [fromChildren, currentFrom] = addNodeBefore(fromChildren, currentTo, currentFrom);
10230
- fromChildren = dom.remove(fromChildren, fromKeyHoldovers[fromKey]);
10231
- currentFrom = dom.next(fromChildren, currentFrom);
10232
- currentTo = dom.next(toChildren, currentTo);
10328
+ currentFrom = addNodeBefore(from2, currentTo, currentFrom);
10329
+ fromKeyHoldovers[fromKey].remove();
10330
+ currentFrom = getNextSibling(from2, currentFrom);
10331
+ currentTo = getNextSibling(to, currentTo);
10233
10332
  continue;
10234
10333
  }
10235
10334
  if (toKey && !fromKey) {
10236
- if (fromKeyDomNodeMap[toKey]) {
10237
- fromChildren = dom.replace(fromChildren, currentFrom, fromKeyDomNodeMap[toKey]);
10238
- currentFrom = fromKeyDomNodeMap[toKey];
10335
+ if (fromKeys[toKey]) {
10336
+ currentFrom.replaceWith(fromKeys[toKey]);
10337
+ currentFrom = fromKeys[toKey];
10239
10338
  }
10240
10339
  }
10241
10340
  if (toKey && fromKey) {
10242
- let fromKeyNode = fromKeyDomNodeMap[toKey];
10341
+ let fromKeyNode = fromKeys[toKey];
10243
10342
  if (fromKeyNode) {
10244
10343
  fromKeyHoldovers[fromKey] = currentFrom;
10245
- fromChildren = dom.replace(fromChildren, currentFrom, fromKeyNode);
10344
+ currentFrom.replaceWith(fromKeyNode);
10246
10345
  currentFrom = fromKeyNode;
10247
10346
  } else {
10248
10347
  fromKeyHoldovers[fromKey] = currentFrom;
10249
- [fromChildren, currentFrom] = addNodeBefore(fromChildren, currentTo, currentFrom);
10250
- fromChildren = dom.remove(fromChildren, fromKeyHoldovers[fromKey]);
10251
- currentFrom = dom.next(fromChildren, currentFrom);
10252
- currentTo = dom.next(toChildren, currentTo);
10348
+ currentFrom = addNodeBefore(from2, currentTo, currentFrom);
10349
+ fromKeyHoldovers[fromKey].remove();
10350
+ currentFrom = getNextSibling(from2, currentFrom);
10351
+ currentTo = getNextSibling(to, currentTo);
10253
10352
  continue;
10254
10353
  }
10255
10354
  }
10256
10355
  }
10257
- let currentFromNext = currentFrom && dom.next(fromChildren, currentFrom);
10356
+ let currentFromNext = currentFrom && getNextSibling(from2, currentFrom);
10258
10357
  patch(currentFrom, currentTo);
10259
- currentTo = currentTo && dom.next(toChildren, currentTo);
10358
+ currentTo = currentTo && getNextSibling(to, currentTo);
10260
10359
  currentFrom = currentFromNext;
10261
10360
  }
10262
10361
  let removals = [];
10263
10362
  while (currentFrom) {
10264
10363
  if (!shouldSkip(removing, currentFrom))
10265
10364
  removals.push(currentFrom);
10266
- currentFrom = dom.next(fromChildren, currentFrom);
10365
+ currentFrom = getNextSibling(from2, currentFrom);
10267
10366
  }
10268
10367
  while (removals.length) {
10269
10368
  let domForRemoval = removals.shift();
@@ -10276,52 +10375,102 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10276
10375
  }
10277
10376
  function keyToMap(els) {
10278
10377
  let map = {};
10279
- els.forEach((el) => {
10378
+ for (let el of els) {
10280
10379
  let theKey = getKey(el);
10281
10380
  if (theKey) {
10282
10381
  map[theKey] = el;
10283
10382
  }
10284
- });
10383
+ }
10285
10384
  return map;
10286
10385
  }
10287
- function addNodeBefore(children, node, beforeMe) {
10386
+ function addNodeBefore(parent, node, beforeMe) {
10288
10387
  if (!shouldSkip(adding, node)) {
10289
10388
  let clone2 = node.cloneNode(true);
10290
- children = dom.before(children, beforeMe, clone2);
10389
+ parent.insertBefore(clone2, beforeMe);
10291
10390
  added(clone2);
10292
- return [children, clone2];
10391
+ return clone2;
10293
10392
  }
10294
- return [children, node];
10393
+ return node;
10295
10394
  }
10296
10395
  assignOptions(options);
10297
10396
  fromEl = from;
10298
10397
  toEl = typeof toHtml === "string" ? createElement(toHtml) : toHtml;
10299
10398
  if (window.Alpine && window.Alpine.closestDataStack && !from._x_dataStack) {
10300
10399
  toEl._x_dataStack = window.Alpine.closestDataStack(from);
10301
- toEl._x_dataStack && window.Alpine.clone(from, toEl);
10400
+ toEl._x_dataStack && window.Alpine.cloneNode(from, toEl);
10302
10401
  }
10303
10402
  patch(from, toEl);
10304
10403
  fromEl = void 0;
10305
10404
  toEl = void 0;
10306
10405
  return from;
10307
10406
  }
10308
- morph.step = () => resolveStep();
10309
- morph.log = (theLogger) => {
10310
- logger = theLogger;
10407
+ morph.step = () => {
10408
+ };
10409
+ morph.log = () => {
10311
10410
  };
10312
10411
  function shouldSkip(hook, ...args) {
10313
10412
  let skip = false;
10314
10413
  hook(...args, () => skip = true);
10315
10414
  return skip;
10316
10415
  }
10317
- function initializeAlpineOnTo(from, to, childrenOnly) {
10318
- if (from.nodeType !== 1)
10319
- return;
10320
- if (from._x_dataStack) {
10321
- window.Alpine.clone(from, to);
10416
+ var patched = false;
10417
+ function createElement(html) {
10418
+ const template = document.createElement("template");
10419
+ template.innerHTML = html;
10420
+ return template.content.firstElementChild;
10421
+ }
10422
+ function textOrComment(el) {
10423
+ return el.nodeType === 3 || el.nodeType === 8;
10424
+ }
10425
+ var Block = class {
10426
+ constructor(start3, end2) {
10427
+ this.startComment = start3;
10428
+ this.endComment = end2;
10429
+ }
10430
+ get children() {
10431
+ let children = [];
10432
+ let currentNode = this.startComment.nextSibling;
10433
+ while (currentNode && currentNode !== this.endComment) {
10434
+ children.push(currentNode);
10435
+ currentNode = currentNode.nextSibling;
10436
+ }
10437
+ return children;
10322
10438
  }
10439
+ appendChild(child) {
10440
+ this.endComment.before(child);
10441
+ }
10442
+ get firstChild() {
10443
+ let first = this.startComment.nextSibling;
10444
+ if (first === this.endComment)
10445
+ return;
10446
+ return first;
10447
+ }
10448
+ nextNode(reference2) {
10449
+ let next = reference2.nextSibling;
10450
+ if (next === this.endComment)
10451
+ return;
10452
+ return next;
10453
+ }
10454
+ insertBefore(newNode, reference2) {
10455
+ reference2.before(newNode);
10456
+ return newNode;
10457
+ }
10458
+ };
10459
+ function getFirstNode(parent) {
10460
+ return parent.firstChild;
10461
+ }
10462
+ function getNextSibling(parent, reference2) {
10463
+ if (reference2._x_teleport) {
10464
+ return reference2._x_teleport;
10465
+ }
10466
+ let next;
10467
+ if (parent instanceof Block) {
10468
+ next = parent.nextNode(reference2);
10469
+ } else {
10470
+ next = reference2.nextSibling;
10471
+ }
10472
+ return next;
10323
10473
  }
10324
- var patched = false;
10325
10474
  function monkeyPatchDomSetAttributeToAllowAtSymbols() {
10326
10475
  if (patched)
10327
10476
  return;
@@ -10443,7 +10592,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10443
10592
  let evaluate2 = evaluateLater2(expression);
10444
10593
  let options = {
10445
10594
  rootMargin: getRootMargin(modifiers),
10446
- threshold: getThreshhold(modifiers)
10595
+ threshold: getThreshold(modifiers)
10447
10596
  };
10448
10597
  let observer2 = new IntersectionObserver((entries) => {
10449
10598
  entries.forEach((entry) => {
@@ -10459,7 +10608,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10459
10608
  });
10460
10609
  });
10461
10610
  }
10462
- function getThreshhold(modifiers) {
10611
+ function getThreshold(modifiers) {
10463
10612
  if (modifiers.includes("full"))
10464
10613
  return 0.99;
10465
10614
  if (modifiers.includes("half"))
@@ -10621,7 +10770,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10621
10770
  return "-";
10622
10771
  if (/^\D+$/.test(input))
10623
10772
  return "9";
10624
- thousands = thousands != null ? thousands : delimiter === "," ? "." : ",";
10773
+ if (thousands === null || thousands === void 0) {
10774
+ thousands = delimiter === "," ? "." : ",";
10775
+ }
10625
10776
  let addThousands = (input2, thousands2) => {
10626
10777
  let output = "";
10627
10778
  let counter = 0;
@@ -10655,7 +10806,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10655
10806
  }
10656
10807
  var module_default5 = src_default5;
10657
10808
 
10658
- // ../../../node_modules/tabbable/dist/index.esm.js
10809
+ // ../../../node_modules/@alpinejs/focus/dist/module.esm.js
10659
10810
  var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"];
10660
10811
  var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
10661
10812
  var NoElement = typeof Element === "undefined";
@@ -10929,8 +11080,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
10929
11080
  }
10930
11081
  return isNodeMatchingSelectorFocusable(options, node);
10931
11082
  };
10932
-
10933
- // ../../../node_modules/focus-trap/dist/focus-trap.esm.js
10934
11083
  function ownKeys2(object, enumerableOnly) {
10935
11084
  var keys = Object.keys(object);
10936
11085
  if (Object.getOwnPropertySymbols) {
@@ -11452,8 +11601,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
11452
11601
  trap.updateContainerElements(elements);
11453
11602
  return trap;
11454
11603
  };
11455
-
11456
- // ../../../node_modules/@alpinejs/focus/dist/module.esm.js
11457
11604
  function src_default6(Alpine3) {
11458
11605
  let lastFocused;
11459
11606
  let currentFocused;
@@ -14078,17 +14225,17 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14078
14225
  updateTransitionEndListener(box, "add", listener);
14079
14226
  currentTransitionEndListener = listener;
14080
14227
  }
14081
- function on2(eventType, handler3, options) {
14228
+ function on2(eventType, handler4, options) {
14082
14229
  if (options === void 0) {
14083
14230
  options = false;
14084
14231
  }
14085
14232
  var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
14086
14233
  nodes.forEach(function(node) {
14087
- node.addEventListener(eventType, handler3, options);
14234
+ node.addEventListener(eventType, handler4, options);
14088
14235
  listeners.push({
14089
14236
  node,
14090
14237
  eventType,
14091
- handler: handler3,
14238
+ handler: handler4,
14092
14239
  options
14093
14240
  });
14094
14241
  });
@@ -14122,8 +14269,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14122
14269
  }
14123
14270
  function removeListeners() {
14124
14271
  listeners.forEach(function(_ref) {
14125
- var node = _ref.node, eventType = _ref.eventType, handler3 = _ref.handler, options = _ref.options;
14126
- node.removeEventListener(eventType, handler3, options);
14272
+ var node = _ref.node, eventType = _ref.eventType, handler4 = _ref.handler, options = _ref.options;
14273
+ node.removeEventListener(eventType, handler4, options);
14127
14274
  });
14128
14275
  listeners = [];
14129
14276
  }
@@ -15543,8 +15690,72 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15543
15690
  };
15544
15691
  });
15545
15692
 
15693
+ // ../../components/coco/base/poll_controller/poll_controller.js
15694
+ var poll_controller_exports = {};
15695
+ __export(poll_controller_exports, {
15696
+ default: () => poll_controller_default
15697
+ });
15698
+ var poll_controller_default = CocoComponent("pollController", () => {
15699
+ return {
15700
+ polling: false,
15701
+ frame: null,
15702
+ pollTimer: null,
15703
+ get interval() {
15704
+ return parseInt(this.$root.dataset.interval || 0, 10);
15705
+ },
15706
+ init() {
15707
+ this.frame = document.getElementById("polling-controller-frame");
15708
+ this.observer = new MutationObserver(() => this.onUpdate());
15709
+ this.observer.observe(this.$el, { attributes: true });
15710
+ },
15711
+ startPolling() {
15712
+ if (this.interval > 0 && !this.polling) {
15713
+ this.polling = true;
15714
+ this.queuePollRequest(500);
15715
+ }
15716
+ },
15717
+ onUpdate() {
15718
+ this.$nextTick(() => {
15719
+ this.$dispatch("dom-updates:complete", { html: document });
15720
+ });
15721
+ this.queuePollRequest();
15722
+ },
15723
+ queuePollRequest(wait) {
15724
+ if (this.pollTimer)
15725
+ clearTimeout(this.pollTimer);
15726
+ if (this.interval > 0 && this.polling) {
15727
+ this.pollTimer = setTimeout(
15728
+ () => this.reloadFrame(),
15729
+ wait || this.interval
15730
+ );
15731
+ }
15732
+ },
15733
+ reloadFrame() {
15734
+ this.frame.addEventListener(
15735
+ "turbo:before-fetch-request",
15736
+ addStreamHeaders,
15737
+ { once: true }
15738
+ );
15739
+ window.Turbo.visit(location.href, {
15740
+ frame: this.frame.id,
15741
+ action: "replace"
15742
+ });
15743
+ },
15744
+ destroy() {
15745
+ this.observer.disconnect();
15746
+ this.polling = false;
15747
+ }
15748
+ };
15749
+ });
15750
+ function addStreamHeaders(event) {
15751
+ const { headers } = event.detail.fetchOptions || {};
15752
+ if (headers) {
15753
+ headers.Accept = ["text/vnd.turbo-stream.html", headers.Accept].join(", ");
15754
+ }
15755
+ }
15756
+
15546
15757
  // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
15547
- var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports];
15758
+ var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
15548
15759
  var __default = modules;
15549
15760
 
15550
15761
  // base/components.js
@@ -15572,15 +15783,19 @@ lodash/lodash.js:
15572
15783
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
15573
15784
  *)
15574
15785
 
15575
- tabbable/dist/index.esm.js:
15576
- (*!
15577
- * tabbable 5.3.3
15578
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
15579
- *)
15580
-
15581
- focus-trap/dist/focus-trap.esm.js:
15582
- (*!
15583
- * focus-trap 6.9.4
15584
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
15786
+ @alpinejs/focus/dist/module.esm.js:
15787
+ (*! Bundled license information:
15788
+
15789
+ tabbable/dist/index.esm.js:
15790
+ (*!
15791
+ * tabbable 5.3.3
15792
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
15793
+ *)
15794
+
15795
+ focus-trap/dist/focus-trap.esm.js:
15796
+ (*!
15797
+ * focus-trap 6.9.4
15798
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
15799
+ *)
15585
15800
  *)
15586
15801
  */