bhl-forms 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,18 +5,18 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
8
+ var __spreadValues = (a2, b2) => {
9
+ for (var prop in b2 || (b2 = {}))
10
+ if (__hasOwnProp.call(b2, prop))
11
+ __defNormalProp(a2, prop, b2[prop]);
12
12
  if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
13
+ for (var prop of __getOwnPropSymbols(b2)) {
14
+ if (__propIsEnum.call(b2, prop))
15
+ __defNormalProp(a2, prop, b2[prop]);
16
16
  }
17
- return a;
17
+ return a2;
18
18
  };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
19
+ var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
20
20
  var __objRest = (source, exclude) => {
21
21
  var target = {};
22
22
  for (var prop in source)
@@ -137,7 +137,7 @@ const cacheStringFunction = (fn) => {
137
137
  };
138
138
  const camelizeRE = /-(\w)/g;
139
139
  const camelize = cacheStringFunction((str) => {
140
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
140
+ return str.replace(camelizeRE, (_, c2) => c2 ? c2.toUpperCase() : "");
141
141
  });
142
142
  const hyphenateRE = /\B([A-Z])/g;
143
143
  const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
@@ -157,8 +157,8 @@ const def = (obj, key, value) => {
157
157
  });
158
158
  };
159
159
  const toNumber = (val) => {
160
- const n = parseFloat(val);
161
- return isNaN(n) ? val : n;
160
+ const n2 = parseFloat(val);
161
+ return isNaN(n2) ? val : n2;
162
162
  };
163
163
  let _globalThis;
164
164
  const getGlobalThis = () => {
@@ -194,15 +194,15 @@ class EffectScope {
194
194
  }
195
195
  stop(fromParent) {
196
196
  if (this.active) {
197
- let i2, l;
198
- for (i2 = 0, l = this.effects.length; i2 < l; i2++) {
197
+ let i2, l2;
198
+ for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
199
199
  this.effects[i2].stop();
200
200
  }
201
- for (i2 = 0, l = this.cleanups.length; i2 < l; i2++) {
201
+ for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) {
202
202
  this.cleanups[i2]();
203
203
  }
204
204
  if (this.scopes) {
205
- for (i2 = 0, l = this.scopes.length; i2 < l; i2++) {
205
+ for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
206
206
  this.scopes[i2].stop(true);
207
207
  }
208
208
  }
@@ -460,7 +460,7 @@ function createArrayInstrumentations() {
460
460
  ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
461
461
  instrumentations[key] = function(...args) {
462
462
  const arr = toRaw(this);
463
- for (let i2 = 0, l = this.length; i2 < l; i2++) {
463
+ for (let i2 = 0, l2 = this.length; i2 < l2; i2++) {
464
464
  track(arr, "get", i2 + "");
465
465
  }
466
466
  const res = arr[key](...args);
@@ -909,8 +909,8 @@ function triggerRefValue(ref2, newVal) {
909
909
  }
910
910
  }
911
911
  }
912
- function isRef(r) {
913
- return !!(r && r.__v_isRef === true);
912
+ function isRef(r2) {
913
+ return !!(r2 && r2.__v_isRef === true);
914
914
  }
915
915
  function ref(value) {
916
916
  return createRef(value, false);
@@ -1169,7 +1169,7 @@ function flushPostFlushCbs(seen) {
1169
1169
  return;
1170
1170
  }
1171
1171
  activePostFlushCbs = deduped;
1172
- activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
1172
+ activePostFlushCbs.sort((a2, b2) => getId(a2) - getId(b2));
1173
1173
  for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
1174
1174
  activePostFlushCbs[postFlushIndex]();
1175
1175
  }
@@ -1182,7 +1182,7 @@ function flushJobs(seen) {
1182
1182
  isFlushPending = false;
1183
1183
  isFlushing = true;
1184
1184
  flushPreFlushCbs(seen);
1185
- queue.sort((a, b) => getId(a) - getId(b));
1185
+ queue.sort((a2, b2) => getId(a2) - getId(b2));
1186
1186
  const check = NOOP;
1187
1187
  try {
1188
1188
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
@@ -1215,7 +1215,7 @@ function emit$1$2(instance, event, ...rawArgs) {
1215
1215
  const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
1216
1216
  const { number: number3, trim } = props2[modifiersKey] || EMPTY_OBJ;
1217
1217
  if (trim) {
1218
- args = rawArgs.map((a) => a.trim());
1218
+ args = rawArgs.map((a2) => a2.trim());
1219
1219
  }
1220
1220
  if (number3) {
1221
1221
  args = rawArgs.map(toNumber);
@@ -1816,9 +1816,9 @@ const PublicInstanceProxyHandlers = {
1816
1816
  const { ctx, setupState, data, props: props2, accessCache, type, appContext } = instance;
1817
1817
  let normalizedProps;
1818
1818
  if (key[0] !== "$") {
1819
- const n = accessCache[key];
1820
- if (n !== void 0) {
1821
- switch (n) {
1819
+ const n2 = accessCache[key];
1820
+ if (n2 !== void 0) {
1821
+ switch (n2) {
1822
1822
  case 1:
1823
1823
  return setupState[key];
1824
1824
  case 2:
@@ -1962,15 +1962,15 @@ function applyOptions(instance) {
1962
1962
  const opt = computedOptions[key];
1963
1963
  const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
1964
1964
  const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;
1965
- const c = computed({
1965
+ const c2 = computed({
1966
1966
  get: get2,
1967
1967
  set: set2
1968
1968
  });
1969
1969
  Object.defineProperty(ctx, key, {
1970
1970
  enumerable: true,
1971
1971
  configurable: true,
1972
- get: () => c.value,
1973
- set: (v) => c.value = v
1972
+ get: () => c2.value,
1973
+ set: (v) => c2.value = v
1974
1974
  });
1975
1975
  }
1976
1976
  }
@@ -2077,7 +2077,7 @@ function createWatcher(raw2, ctx, publicThis, key) {
2077
2077
  watch$1(getter, raw2.bind(publicThis));
2078
2078
  } else if (isObject$1(raw2)) {
2079
2079
  if (isArray(raw2)) {
2080
- raw2.forEach((r) => createWatcher(r, ctx, publicThis, key));
2080
+ raw2.forEach((r2) => createWatcher(r2, ctx, publicThis, key));
2081
2081
  } else {
2082
2082
  const handler = isFunction(raw2.handler) ? raw2.handler.bind(publicThis) : ctx[raw2.handler];
2083
2083
  if (isFunction(handler)) {
@@ -2102,7 +2102,7 @@ function resolveMergedOptions(instance) {
2102
2102
  } else {
2103
2103
  resolved = {};
2104
2104
  if (globalMixins.length) {
2105
- globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
2105
+ globalMixins.forEach((m2) => mergeOptions(resolved, m2, optionMergeStrategies, true));
2106
2106
  }
2107
2107
  mergeOptions(resolved, base, optionMergeStrategies);
2108
2108
  }
@@ -2115,7 +2115,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
2115
2115
  mergeOptions(to, extendsOptions, strats, true);
2116
2116
  }
2117
2117
  if (mixins) {
2118
- mixins.forEach((m) => mergeOptions(to, m, strats, true));
2118
+ mixins.forEach((m2) => mergeOptions(to, m2, strats, true));
2119
2119
  }
2120
2120
  for (const key in from) {
2121
2121
  if (asMixin && key === "expose")
@@ -2412,12 +2412,12 @@ function getType(ctor) {
2412
2412
  const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
2413
2413
  return match ? match[1] : ctor === null ? "null" : "";
2414
2414
  }
2415
- function isSameType(a, b) {
2416
- return getType(a) === getType(b);
2415
+ function isSameType(a2, b2) {
2416
+ return getType(a2) === getType(b2);
2417
2417
  }
2418
2418
  function getTypeIndex(type, expectedTypes) {
2419
2419
  if (isArray(expectedTypes)) {
2420
- return expectedTypes.findIndex((t) => isSameType(t, type));
2420
+ return expectedTypes.findIndex((t2) => isSameType(t2, type));
2421
2421
  } else if (isFunction(expectedTypes)) {
2422
2422
  return isSameType(expectedTypes, type) ? 0 : -1;
2423
2423
  }
@@ -2614,7 +2614,7 @@ function createAppAPI(render, hydrate2) {
2614
2614
  }
2615
2615
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
2616
2616
  if (isArray(rawRef)) {
2617
- rawRef.forEach((r, i2) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i2] : oldRawRef), parentSuspense, vnode, isUnmount));
2617
+ rawRef.forEach((r2, i2) => setRef(r2, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i2] : oldRawRef), parentSuspense, vnode, isUnmount));
2618
2618
  return;
2619
2619
  }
2620
2620
  if (isAsyncWrapper(vnode) && !isUnmount) {
@@ -3017,7 +3017,7 @@ function baseCreateRenderer(options2, createHydrationFns) {
3017
3017
  if (!instance.isMounted) {
3018
3018
  let vnodeHook;
3019
3019
  const { el, props: props2 } = initialVNode;
3020
- const { bm, m, parent } = instance;
3020
+ const { bm, m: m2, parent } = instance;
3021
3021
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
3022
3022
  toggleRecurse(instance, false);
3023
3023
  if (bm) {
@@ -3042,8 +3042,8 @@ function baseCreateRenderer(options2, createHydrationFns) {
3042
3042
  patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);
3043
3043
  initialVNode.el = subTree.el;
3044
3044
  }
3045
- if (m) {
3046
- queuePostRenderEffect(m, parentSuspense);
3045
+ if (m2) {
3046
+ queuePostRenderEffect(m2, parentSuspense);
3047
3047
  }
3048
3048
  if (!isAsyncWrapperVNode && (vnodeHook = props2 && props2.onVnodeMounted)) {
3049
3049
  const scopedInitialVNode = initialVNode;
@@ -3055,7 +3055,7 @@ function baseCreateRenderer(options2, createHydrationFns) {
3055
3055
  instance.isMounted = true;
3056
3056
  initialVNode = container = anchor = null;
3057
3057
  } else {
3058
- let { next, bu, u, parent, vnode } = instance;
3058
+ let { next, bu, u: u2, parent, vnode } = instance;
3059
3059
  let originNext = next;
3060
3060
  let vnodeHook;
3061
3061
  toggleRecurse(instance, false);
@@ -3080,8 +3080,8 @@ function baseCreateRenderer(options2, createHydrationFns) {
3080
3080
  if (originNext === null) {
3081
3081
  updateHOCHostEl(instance, nextTree.el);
3082
3082
  }
3083
- if (u) {
3084
- queuePostRenderEffect(u, parentSuspense);
3083
+ if (u2) {
3084
+ queuePostRenderEffect(u2, parentSuspense);
3085
3085
  }
3086
3086
  if (vnodeHook = next.props && next.props.onVnodeUpdated) {
3087
3087
  queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
@@ -3210,7 +3210,7 @@ function baseCreateRenderer(options2, createHydrationFns) {
3210
3210
  keyToNewIndexMap.set(nextChild.key, i2);
3211
3211
  }
3212
3212
  }
3213
- let j;
3213
+ let j2;
3214
3214
  let patched = 0;
3215
3215
  const toBePatched = e2 - s2 + 1;
3216
3216
  let moved = false;
@@ -3228,9 +3228,9 @@ function baseCreateRenderer(options2, createHydrationFns) {
3228
3228
  if (prevChild.key != null) {
3229
3229
  newIndex = keyToNewIndexMap.get(prevChild.key);
3230
3230
  } else {
3231
- for (j = s2; j <= e2; j++) {
3232
- if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
3233
- newIndex = j;
3231
+ for (j2 = s2; j2 <= e2; j2++) {
3232
+ if (newIndexToOldIndexMap[j2 - s2] === 0 && isSameVNodeType(prevChild, c2[j2])) {
3233
+ newIndex = j2;
3234
3234
  break;
3235
3235
  }
3236
3236
  }
@@ -3249,7 +3249,7 @@ function baseCreateRenderer(options2, createHydrationFns) {
3249
3249
  }
3250
3250
  }
3251
3251
  const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
3252
- j = increasingNewIndexSequence.length - 1;
3252
+ j2 = increasingNewIndexSequence.length - 1;
3253
3253
  for (i2 = toBePatched - 1; i2 >= 0; i2--) {
3254
3254
  const nextIndex = s2 + i2;
3255
3255
  const nextChild = c2[nextIndex];
@@ -3257,10 +3257,10 @@ function baseCreateRenderer(options2, createHydrationFns) {
3257
3257
  if (newIndexToOldIndexMap[i2] === 0) {
3258
3258
  patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
3259
3259
  } else if (moved) {
3260
- if (j < 0 || i2 !== increasingNewIndexSequence[j]) {
3260
+ if (j2 < 0 || i2 !== increasingNewIndexSequence[j2]) {
3261
3261
  move(nextChild, container, anchor, 2);
3262
3262
  } else {
3263
- j--;
3263
+ j2--;
3264
3264
  }
3265
3265
  }
3266
3266
  }
@@ -3494,39 +3494,39 @@ function traverseStaticChildren(n1, n2, shallow = false) {
3494
3494
  function getSequence(arr) {
3495
3495
  const p2 = arr.slice();
3496
3496
  const result = [0];
3497
- let i2, j, u, v, c;
3497
+ let i2, j2, u2, v, c2;
3498
3498
  const len = arr.length;
3499
3499
  for (i2 = 0; i2 < len; i2++) {
3500
3500
  const arrI = arr[i2];
3501
3501
  if (arrI !== 0) {
3502
- j = result[result.length - 1];
3503
- if (arr[j] < arrI) {
3504
- p2[i2] = j;
3502
+ j2 = result[result.length - 1];
3503
+ if (arr[j2] < arrI) {
3504
+ p2[i2] = j2;
3505
3505
  result.push(i2);
3506
3506
  continue;
3507
3507
  }
3508
- u = 0;
3508
+ u2 = 0;
3509
3509
  v = result.length - 1;
3510
- while (u < v) {
3511
- c = u + v >> 1;
3512
- if (arr[result[c]] < arrI) {
3513
- u = c + 1;
3510
+ while (u2 < v) {
3511
+ c2 = u2 + v >> 1;
3512
+ if (arr[result[c2]] < arrI) {
3513
+ u2 = c2 + 1;
3514
3514
  } else {
3515
- v = c;
3515
+ v = c2;
3516
3516
  }
3517
3517
  }
3518
- if (arrI < arr[result[u]]) {
3519
- if (u > 0) {
3520
- p2[i2] = result[u - 1];
3518
+ if (arrI < arr[result[u2]]) {
3519
+ if (u2 > 0) {
3520
+ p2[i2] = result[u2 - 1];
3521
3521
  }
3522
- result[u] = i2;
3522
+ result[u2] = i2;
3523
3523
  }
3524
3524
  }
3525
3525
  }
3526
- u = result.length;
3527
- v = result[u - 1];
3528
- while (u-- > 0) {
3529
- result[u] = v;
3526
+ u2 = result.length;
3527
+ v = result[u2 - 1];
3528
+ while (u2-- > 0) {
3529
+ result[u2] = v;
3530
3530
  v = p2[v];
3531
3531
  }
3532
3532
  return result;
@@ -3894,8 +3894,8 @@ function setupStatefulComponent(instance, isSSR) {
3894
3894
  if (isSSR) {
3895
3895
  return setupResult.then((resolvedResult) => {
3896
3896
  handleSetupResult(instance, resolvedResult, isSSR);
3897
- }).catch((e) => {
3898
- handleError(e, instance, 0);
3897
+ }).catch((e2) => {
3898
+ handleError(e2, instance, 0);
3899
3899
  });
3900
3900
  } else {
3901
3901
  instance.asyncDep = setupResult;
@@ -3992,9 +3992,9 @@ function isClassComponent(value) {
3992
3992
  const computed = (getterOrOptions, debugOptions) => {
3993
3993
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
3994
3994
  };
3995
- function h(type, propsOrChildren, children) {
3996
- const l = arguments.length;
3997
- if (l === 2) {
3995
+ function h$1(type, propsOrChildren, children) {
3996
+ const l2 = arguments.length;
3997
+ if (l2 === 2) {
3998
3998
  if (isObject$1(propsOrChildren) && !isArray(propsOrChildren)) {
3999
3999
  if (isVNode(propsOrChildren)) {
4000
4000
  return createVNode(type, null, [propsOrChildren]);
@@ -4004,9 +4004,9 @@ function h(type, propsOrChildren, children) {
4004
4004
  return createVNode(type, null, propsOrChildren);
4005
4005
  }
4006
4006
  } else {
4007
- if (l > 3) {
4007
+ if (l2 > 3) {
4008
4008
  children = Array.prototype.slice.call(arguments, 2);
4009
- } else if (l === 3 && isVNode(children)) {
4009
+ } else if (l2 === 3 && isVNode(children)) {
4010
4010
  children = [children];
4011
4011
  }
4012
4012
  return createVNode(type, propsOrChildren, children);
@@ -4211,7 +4211,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
4211
4211
  }
4212
4212
  try {
4213
4213
  el[key] = value;
4214
- } catch (e) {
4214
+ } catch (e2) {
4215
4215
  }
4216
4216
  needRemove && el.removeAttribute(key);
4217
4217
  }
@@ -4260,33 +4260,33 @@ function parseName(name) {
4260
4260
  let options2;
4261
4261
  if (optionsModifierRE.test(name)) {
4262
4262
  options2 = {};
4263
- let m;
4264
- while (m = name.match(optionsModifierRE)) {
4265
- name = name.slice(0, name.length - m[0].length);
4266
- options2[m[0].toLowerCase()] = true;
4263
+ let m2;
4264
+ while (m2 = name.match(optionsModifierRE)) {
4265
+ name = name.slice(0, name.length - m2[0].length);
4266
+ options2[m2[0].toLowerCase()] = true;
4267
4267
  }
4268
4268
  }
4269
4269
  return [hyphenate(name.slice(2)), options2];
4270
4270
  }
4271
4271
  function createInvoker(initialValue2, instance) {
4272
- const invoker = (e) => {
4273
- const timeStamp = e.timeStamp || _getNow();
4272
+ const invoker = (e2) => {
4273
+ const timeStamp = e2.timeStamp || _getNow();
4274
4274
  if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {
4275
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
4275
+ callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, invoker.value), instance, 5, [e2]);
4276
4276
  }
4277
4277
  };
4278
4278
  invoker.value = initialValue2;
4279
4279
  invoker.attached = getNow();
4280
4280
  return invoker;
4281
4281
  }
4282
- function patchStopImmediatePropagation(e, value) {
4282
+ function patchStopImmediatePropagation(e2, value) {
4283
4283
  if (isArray(value)) {
4284
- const originalStop = e.stopImmediatePropagation;
4285
- e.stopImmediatePropagation = () => {
4286
- originalStop.call(e);
4287
- e._stopped = true;
4284
+ const originalStop = e2.stopImmediatePropagation;
4285
+ e2.stopImmediatePropagation = () => {
4286
+ originalStop.call(e2);
4287
+ e2._stopped = true;
4288
4288
  };
4289
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
4289
+ return value.map((fn) => (e3) => !e3._stopped && fn && fn(e3));
4290
4290
  } else {
4291
4291
  return value;
4292
4292
  }
@@ -4379,18 +4379,18 @@ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
4379
4379
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
4380
4380
  var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
4381
4381
  var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4382
- var __spreadValues2 = (a, b) => {
4383
- for (var prop in b || (b = {}))
4384
- if (__hasOwnProp2.call(b, prop))
4385
- __defNormalProp2(a, prop, b[prop]);
4382
+ var __spreadValues2 = (a2, b2) => {
4383
+ for (var prop in b2 || (b2 = {}))
4384
+ if (__hasOwnProp2.call(b2, prop))
4385
+ __defNormalProp2(a2, prop, b2[prop]);
4386
4386
  if (__getOwnPropSymbols2)
4387
- for (var prop of __getOwnPropSymbols2(b)) {
4388
- if (__propIsEnum2.call(b, prop))
4389
- __defNormalProp2(a, prop, b[prop]);
4387
+ for (var prop of __getOwnPropSymbols2(b2)) {
4388
+ if (__propIsEnum2.call(b2, prop))
4389
+ __defNormalProp2(a2, prop, b2[prop]);
4390
4390
  }
4391
- return a;
4391
+ return a2;
4392
4392
  };
4393
- var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
4393
+ var __spreadProps2 = (a2, b2) => __defProps2(a2, __getOwnPropDescs2(b2));
4394
4394
  function token$1() {
4395
4395
  return Math.random().toString(36).substring(2, 15);
4396
4396
  }
@@ -4408,8 +4408,8 @@ function eq$1(valA, valB, deep = true, explicit = ["__key"]) {
4408
4408
  return false;
4409
4409
  if (Object.keys(valA).length !== Object.keys(valB).length)
4410
4410
  return false;
4411
- for (const k of explicit) {
4412
- if ((k in valA || k in valB) && valA[k] !== valB[k])
4411
+ for (const k2 of explicit) {
4412
+ if ((k2 in valA || k2 in valB) && valA[k2] !== valB[k2])
4413
4413
  return false;
4414
4414
  }
4415
4415
  for (const key in valA) {
@@ -4425,7 +4425,7 @@ function eq$1(valA, valB, deep = true, explicit = ["__key"]) {
4425
4425
  return false;
4426
4426
  }
4427
4427
  function camel$1(str) {
4428
- return str.replace(/-([a-z0-9])/gi, (_s, g) => g.toUpperCase());
4428
+ return str.replace(/-([a-z0-9])/gi, (_s, g2) => g2.toUpperCase());
4429
4429
  }
4430
4430
  function kebab$1(str) {
4431
4431
  return str.replace(/([a-z0-9])([A-Z])/g, (_s, trail, cap) => trail + "-" + cap.toLowerCase()).replace(" ", "-").toLowerCase();
@@ -4574,7 +4574,7 @@ function bubble$1(node, _context, event) {
4574
4574
  }
4575
4575
  return node;
4576
4576
  }
4577
- function on$1(_node, context, name, listener) {
4577
+ function on$2(_node, context, name, listener) {
4578
4578
  return context._e.on(name, listener);
4579
4579
  }
4580
4580
  function off$1(node, context, receipt) {
@@ -4603,18 +4603,18 @@ function error$1(code, data = {}) {
4603
4603
  throw Error(errorHandler$1.dispatch({ code, data }).message);
4604
4604
  }
4605
4605
  function createMessage$1(conf, node) {
4606
- const m = __spreadValues2({
4606
+ const m2 = __spreadValues2({
4607
4607
  blocking: false,
4608
4608
  key: token$1(),
4609
4609
  meta: {},
4610
4610
  type: "state",
4611
4611
  visible: true
4612
4612
  }, conf);
4613
- if (node && m.value && m.meta.localize !== false) {
4614
- m.value = node.t(m);
4615
- m.meta.locale = node.config.locale;
4613
+ if (node && m2.value && m2.meta.localize !== false) {
4614
+ m2.value = node.t(m2);
4615
+ m2.meta.locale = node.config.locale;
4616
4616
  }
4617
- return m;
4617
+ return m2;
4618
4618
  }
4619
4619
  function createMessages$1(node, ...errors2) {
4620
4620
  const sourceKey = `${node.name}-set`;
@@ -4624,7 +4624,7 @@ function createMessages$1(node, ...errors2) {
4624
4624
  value: error2,
4625
4625
  meta: { source: sourceKey, autoClear: true }
4626
4626
  });
4627
- return errors2.filter((m) => !!m).map((errorSet) => {
4627
+ return errors2.filter((m2) => !!m2).map((errorSet) => {
4628
4628
  if (typeof errorSet === "string")
4629
4629
  errorSet = [errorSet];
4630
4630
  if (Array.isArray(errorSet)) {
@@ -4680,13 +4680,13 @@ function submitForm$1(id) {
4680
4680
  warn$1(151, id);
4681
4681
  }
4682
4682
  function clearState$1(node) {
4683
- const clear2 = (n) => {
4684
- for (const key in n.store) {
4685
- const message2 = n.store[key];
4683
+ const clear2 = (n2) => {
4684
+ for (const key in n2.store) {
4685
+ const message2 = n2.store[key];
4686
4686
  if (message2.type === "error" || message2.type === "ui" && key === "incomplete") {
4687
- n.store.remove(key);
4687
+ n2.store.remove(key);
4688
4688
  } else if (message2.type === "state") {
4689
- n.store.set(__spreadProps2(__spreadValues2({}, message2), { value: false }));
4689
+ n2.store.set(__spreadProps2(__spreadValues2({}, message2), { value: false }));
4690
4690
  }
4691
4691
  }
4692
4692
  };
@@ -4696,7 +4696,7 @@ function clearState$1(node) {
4696
4696
  function reset$1(id, resetTo) {
4697
4697
  const node = typeof id === "string" ? getNode$1$1(id) : id;
4698
4698
  if (node) {
4699
- const initial = (n) => cloneAny$1(n.props.initial) || (n.type === "group" ? {} : n.type === "list" ? [] : void 0);
4699
+ const initial = (n2) => cloneAny$1(n2.props.initial) || (n2.type === "group" ? {} : n2.type === "list" ? [] : void 0);
4700
4700
  node._e.pause(node);
4701
4701
  node.input(cloneAny$1(resetTo) || initial(node), false);
4702
4702
  node.walk((child) => child.input(initial(child), false));
@@ -4748,7 +4748,7 @@ const invalidSetter$1 = (node, _context, property) => {
4748
4748
  each: trap$1(eachChild$1),
4749
4749
  emit: trap$1(emit$1$1),
4750
4750
  find: trap$1(find$1),
4751
- on: trap$1(on$1),
4751
+ on: trap$1(on$2),
4752
4752
  off: trap$1(off$1),
4753
4753
  parent: trap$1(false, setParent$1),
4754
4754
  plugins: trap$1(false),
@@ -5026,7 +5026,7 @@ function walkTree$1(_node, context, callback, stopIfFalse = false) {
5026
5026
  function resetConfig$1(node, context) {
5027
5027
  const parent = node.parent || void 0;
5028
5028
  context.config = createConfig$2(node.config._t, parent);
5029
- node.walk((n) => n.resetConfig());
5029
+ node.walk((n2) => n2.resetConfig());
5030
5030
  }
5031
5031
  function use$1(node, context, plugin2, run2 = true, library = true) {
5032
5032
  if (Array.isArray(plugin2) || plugin2 instanceof Set) {
@@ -5104,7 +5104,7 @@ function getNode$2(node, _context, locator) {
5104
5104
  pointer = node;
5105
5105
  break;
5106
5106
  default:
5107
- pointer = pointer.children.find((c) => String(c.name) === String(name)) || select$4(pointer, name);
5107
+ pointer = pointer.children.find((c2) => String(c2.name) === String(name)) || select$4(pointer, name);
5108
5108
  }
5109
5109
  }
5110
5110
  return pointer || void 0;
@@ -5127,7 +5127,7 @@ function find$1(node, _context, searchTerm, searcher) {
5127
5127
  return bfs$1(node, searchTerm, searcher);
5128
5128
  }
5129
5129
  function bfs$1(tree, searchValue, searchGoal = "name") {
5130
- const search2 = typeof searchGoal === "string" ? (n) => n[searchGoal] == searchValue : searchGoal;
5130
+ const search2 = typeof searchGoal === "string" ? (n2) => n2[searchGoal] == searchValue : searchGoal;
5131
5131
  const stack = [tree];
5132
5132
  while (stack.length) {
5133
5133
  const node = stack.shift();
@@ -5137,8 +5137,8 @@ function bfs$1(tree, searchValue, searchGoal = "name") {
5137
5137
  }
5138
5138
  return void 0;
5139
5139
  }
5140
- function getRoot$1(n) {
5141
- let node = n;
5140
+ function getRoot$1(n2) {
5141
+ let node = n2;
5142
5142
  while (node.parent) {
5143
5143
  node = node.parent;
5144
5144
  }
@@ -5188,7 +5188,7 @@ function createConfig$2(target = {}, parent) {
5188
5188
  if (node) {
5189
5189
  node.emit(`config:${prop}`, value, false);
5190
5190
  configChange$1(node, prop, value);
5191
- node.walk((n) => configChange$1(n, prop, value), true);
5191
+ node.walk((n2) => configChange$1(n2, prop, value), true);
5192
5192
  }
5193
5193
  return didSet;
5194
5194
  }
@@ -5273,8 +5273,8 @@ function useSteps() {
5273
5273
  const currentStep = activeStep2.value;
5274
5274
  console.debug("validating", currentStep);
5275
5275
  const node = steps2[currentStep].node;
5276
- node.walk((n) => {
5277
- n.store.set(createMessage$1({
5276
+ node.walk((n2) => {
5277
+ n2.store.set(createMessage$1({
5278
5278
  key: "submitted",
5279
5279
  value: true,
5280
5280
  visible: false
@@ -5302,6 +5302,12 @@ function useSteps() {
5302
5302
  setStep2({ nextStep: currentIndex() - 1, validate: false });
5303
5303
  };
5304
5304
  const stepPlugin2 = (node) => {
5305
+ if (node.props.type == "form") {
5306
+ if (node.props.attrs.defaultOrder) {
5307
+ defaultOrder2.push(...node.props.attrs.defaultOrder);
5308
+ }
5309
+ return true;
5310
+ }
5305
5311
  if (node.props.type == "group") {
5306
5312
  console.debug("Adding step node", node);
5307
5313
  steps2[node.name] = steps2[node.name] || {};
@@ -5348,20 +5354,35 @@ const redirect = (url3) => {
5348
5354
  console.debug("redirect to " + url3);
5349
5355
  window.location.href = url3;
5350
5356
  };
5351
- const getKey = (d, path) => {
5357
+ const getKey = (d2, path) => {
5352
5358
  if (typeof path === "string") {
5353
5359
  path = path.split(".");
5354
5360
  }
5355
- return path.reduce((x, y) => x[y], d);
5361
+ return path.reduce((x2, y) => x2[y], d2);
5356
5362
  };
5357
- const strSubUrl = (str, obj) => str.replace(/\${(.*?)}/g, (x, g) => encodeURIComponent(getKey(obj, g)));
5363
+ const strSubUrl = (str, obj) => str.replace(/\${(.*?)}/g, (x2, g2) => encodeURIComponent(getKey(obj, g2)));
5358
5364
  let { stepPlugin, steps, stepOrder, defaultOrder, setStepOrder, activeStep, firstStep, lastStep, setStep, setNextStep, setPreviousStep } = useSteps();
5365
+ let prepopValues = {};
5366
+ const prepopPlugin = (node) => {
5367
+ if (node.props.type == "form") {
5368
+ prepopValues = node.props.attrs.prepop || prepopValues;
5369
+ return true;
5370
+ }
5371
+ if (node.props.type == "group") {
5372
+ return true;
5373
+ }
5374
+ if (prepopValues[node.name]) {
5375
+ console.debug("Setting prepop value for:", node.name, prepopValues[node.name]);
5376
+ node.input(prepopValues[node.name]);
5377
+ }
5378
+ };
5359
5379
  const dataDefaults = {
5360
5380
  steps,
5361
5381
  stepOrder,
5362
5382
  activeStep,
5363
5383
  plugins: [
5364
- stepPlugin
5384
+ stepPlugin,
5385
+ prepopPlugin
5365
5386
  ],
5366
5387
  firstStep: () => {
5367
5388
  return firstStep();
@@ -5392,6 +5413,9 @@ const dataDefaults = {
5392
5413
  return steps[stepName].valid && steps[stepName].errorCount === 0;
5393
5414
  },
5394
5415
  stepIsEnabled: (stepName) => {
5416
+ if (!stepOrder.value.length) {
5417
+ return true;
5418
+ }
5395
5419
  return stepOrder.value.indexOf(stepName) > -1;
5396
5420
  },
5397
5421
  submit: (postUrl, redirectUrl = null) => async (formData, node) => {
@@ -5458,8 +5482,8 @@ function eq(valA, valB, deep = true, explicit = ["__key"]) {
5458
5482
  return false;
5459
5483
  if (Object.keys(valA).length !== Object.keys(valB).length)
5460
5484
  return false;
5461
- for (const k of explicit) {
5462
- if ((k in valA || k in valB) && valA[k] !== valB[k])
5485
+ for (const k2 of explicit) {
5486
+ if ((k2 in valA || k2 in valB) && valA[k2] !== valB[k2])
5463
5487
  return false;
5464
5488
  }
5465
5489
  for (const key in valA) {
@@ -5514,18 +5538,18 @@ function regexForFormat(format) {
5514
5538
  return regex.replace(format2, formats[format2]);
5515
5539
  }, escaped));
5516
5540
  }
5517
- function isRecord(o) {
5518
- return Object.prototype.toString.call(o) === "[object Object]";
5541
+ function isRecord(o2) {
5542
+ return Object.prototype.toString.call(o2) === "[object Object]";
5519
5543
  }
5520
- function isObject(o) {
5521
- return isRecord(o) || Array.isArray(o);
5544
+ function isObject(o2) {
5545
+ return isRecord(o2) || Array.isArray(o2);
5522
5546
  }
5523
- function isPojo(o) {
5524
- if (isRecord(o) === false)
5547
+ function isPojo(o2) {
5548
+ if (isRecord(o2) === false)
5525
5549
  return false;
5526
- if (o.__FKNode__ || o.__POJO__ === false)
5550
+ if (o2.__FKNode__ || o2.__POJO__ === false)
5527
5551
  return false;
5528
- const ctor = o.constructor;
5552
+ const ctor = o2.constructor;
5529
5553
  if (ctor === void 0)
5530
5554
  return true;
5531
5555
  const prot = ctor.prototype;
@@ -5632,7 +5656,7 @@ function parseArgs(str) {
5632
5656
  }
5633
5657
  function except(obj, toRemove) {
5634
5658
  const clean = {};
5635
- const exps = toRemove.filter((n) => n instanceof RegExp);
5659
+ const exps = toRemove.filter((n2) => n2 instanceof RegExp);
5636
5660
  const keysToRemove = new Set(toRemove);
5637
5661
  for (const key in obj) {
5638
5662
  if (!keysToRemove.has(key) && !exps.some((exp) => exp.test(key))) {
@@ -5643,7 +5667,7 @@ function except(obj, toRemove) {
5643
5667
  }
5644
5668
  function only(obj, include) {
5645
5669
  const clean = {};
5646
- const exps = include.filter((n) => n instanceof RegExp);
5670
+ const exps = include.filter((n2) => n2 instanceof RegExp);
5647
5671
  include.forEach((key) => {
5648
5672
  if (!(key instanceof RegExp)) {
5649
5673
  clean[key] = obj[key];
@@ -5657,7 +5681,7 @@ function only(obj, include) {
5657
5681
  return clean;
5658
5682
  }
5659
5683
  function camel(str) {
5660
- return str.replace(/-([a-z0-9])/gi, (_s, g) => g.toUpperCase());
5684
+ return str.replace(/-([a-z0-9])/gi, (_s, g2) => g2.toUpperCase());
5661
5685
  }
5662
5686
  function kebab(str) {
5663
5687
  return str.replace(/([a-z0-9])([A-Z])/g, (_s, trail, cap) => trail + "-" + cap.toLowerCase()).replace(" ", "-").toLowerCase();
@@ -5695,15 +5719,15 @@ function getAt(obj, addr) {
5695
5719
  if (!obj || typeof obj !== "object")
5696
5720
  return null;
5697
5721
  const segments = addr.split(".");
5698
- let o = obj;
5722
+ let o2 = obj;
5699
5723
  for (const i2 in segments) {
5700
5724
  const segment = segments[i2];
5701
- if (has(o, segment)) {
5702
- o = o[segment];
5725
+ if (has(o2, segment)) {
5726
+ o2 = o2[segment];
5703
5727
  }
5704
5728
  if (+i2 === segments.length - 1)
5705
- return o;
5706
- if (!o || typeof o !== "object")
5729
+ return o2;
5730
+ if (!o2 || typeof o2 !== "object")
5707
5731
  return null;
5708
5732
  }
5709
5733
  return null;
@@ -5823,7 +5847,7 @@ function bubble(node, _context, event) {
5823
5847
  }
5824
5848
  return node;
5825
5849
  }
5826
- function on(_node, context, name, listener) {
5850
+ function on$1(_node, context, name, listener) {
5827
5851
  return context._e.on(name, listener);
5828
5852
  }
5829
5853
  function off(node, context, receipt) {
@@ -5852,18 +5876,18 @@ function error(code, data = {}) {
5852
5876
  throw Error(errorHandler.dispatch({ code, data }).message);
5853
5877
  }
5854
5878
  function createMessage(conf, node) {
5855
- const m = __spreadValues({
5879
+ const m2 = __spreadValues({
5856
5880
  blocking: false,
5857
5881
  key: token(),
5858
5882
  meta: {},
5859
5883
  type: "state",
5860
5884
  visible: true
5861
5885
  }, conf);
5862
- if (node && m.value && m.meta.localize !== false) {
5863
- m.value = node.t(m);
5864
- m.meta.locale = node.config.locale;
5886
+ if (node && m2.value && m2.meta.localize !== false) {
5887
+ m2.value = node.t(m2);
5888
+ m2.meta.locale = node.config.locale;
5865
5889
  }
5866
- return m;
5890
+ return m2;
5867
5891
  }
5868
5892
  const storeTraps = {
5869
5893
  apply: applyMessages,
@@ -5932,9 +5956,9 @@ function setMessage(messageStore, store, node, message2) {
5932
5956
  message2.meta.locale = node.props.locale;
5933
5957
  }
5934
5958
  }
5935
- const e = `message-${has(messageStore, message2.key) ? "updated" : "added"}`;
5959
+ const e2 = `message-${has(messageStore, message2.key) ? "updated" : "added"}`;
5936
5960
  messageStore[message2.key] = Object.freeze(node.hook.message.dispatch(message2));
5937
- node.emit(e, message2);
5961
+ node.emit(e2, message2);
5938
5962
  }
5939
5963
  return store;
5940
5964
  }
@@ -5952,7 +5976,7 @@ function removeMessage$1(messageStore, store, node, key) {
5952
5976
  }
5953
5977
  if (store.buffer === true) {
5954
5978
  store._b = store._b.filter((buffered) => {
5955
- buffered[0] = buffered[0].filter((m) => m.key !== key);
5979
+ buffered[0] = buffered[0].filter((m2) => m2.key !== key);
5956
5980
  return buffered[1] || buffered[0].length;
5957
5981
  });
5958
5982
  }
@@ -6007,7 +6031,7 @@ function createMessages(node, ...errors2) {
6007
6031
  value: error2,
6008
6032
  meta: { source: sourceKey, autoClear: true }
6009
6033
  });
6010
- return errors2.filter((m) => !!m).map((errorSet) => {
6034
+ return errors2.filter((m2) => !!m2).map((errorSet) => {
6011
6035
  if (typeof errorSet === "string")
6012
6036
  errorSet = [errorSet];
6013
6037
  if (Array.isArray(errorSet)) {
@@ -6057,19 +6081,19 @@ function releaseBuffer(_messageStore, store) {
6057
6081
  }
6058
6082
  function createLedger() {
6059
6083
  const ledger = {};
6060
- let n;
6084
+ let n2;
6061
6085
  return {
6062
- count: (...args) => createCounter(n, ledger, ...args),
6086
+ count: (...args) => createCounter(n2, ledger, ...args),
6063
6087
  init(node) {
6064
- n = node;
6088
+ n2 = node;
6065
6089
  node.on("message-added.deep", add(ledger, 1));
6066
6090
  node.on("message-removed.deep", add(ledger, -1));
6067
6091
  },
6068
- merge: (child) => merge(n, ledger, child),
6092
+ merge: (child) => merge(n2, ledger, child),
6069
6093
  settled(counterName) {
6070
6094
  return has(ledger, counterName) ? ledger[counterName].promise : Promise.resolve();
6071
6095
  },
6072
- unmerge: (child) => merge(n, ledger, child, true),
6096
+ unmerge: (child) => merge(n2, ledger, child, true),
6073
6097
  value(counterName) {
6074
6098
  return has(ledger, counterName) ? ledger[counterName].count : 0;
6075
6099
  }
@@ -6088,7 +6112,7 @@ function createCounter(node, ledger, counterName, condition, increment = 0) {
6088
6112
  }
6089
6113
  };
6090
6114
  ledger[counterName] = counter;
6091
- increment = node.store.reduce((sum, m) => sum + counter.condition(m) * 1, increment);
6115
+ increment = node.store.reduce((sum, m2) => sum + counter.condition(m2) * 1, increment);
6092
6116
  node.each((child) => {
6093
6117
  child.ledger.count(counter.name, counter.condition);
6094
6118
  increment += child.ledger.value(counter.name);
@@ -6100,7 +6124,7 @@ function parseCondition(condition) {
6100
6124
  if (typeof condition === "function") {
6101
6125
  return condition;
6102
6126
  }
6103
- return (m) => m.type === condition;
6127
+ return (m2) => m2.type === condition;
6104
6128
  }
6105
6129
  function count(counter, increment) {
6106
6130
  const initial = counter.count;
@@ -6108,7 +6132,7 @@ function count(counter, increment) {
6108
6132
  counter.count = post;
6109
6133
  if (initial === 0 && post !== 0) {
6110
6134
  counter.node.emit(`unsettled:${counter.name}`, counter.count, false);
6111
- counter.promise = new Promise((r) => counter.resolve = r);
6135
+ counter.promise = new Promise((r2) => counter.resolve = r2);
6112
6136
  } else if (initial !== 0 && post === 0) {
6113
6137
  counter.node.emit(`settled:${counter.name}`, counter.count, false);
6114
6138
  counter.resolve();
@@ -6117,10 +6141,10 @@ function count(counter, increment) {
6117
6141
  return counter;
6118
6142
  }
6119
6143
  function add(ledger, delta) {
6120
- return (e) => {
6144
+ return (e2) => {
6121
6145
  for (const name in ledger) {
6122
6146
  const counter = ledger[name];
6123
- if (counter.condition(e.payload)) {
6147
+ if (counter.condition(e2.payload)) {
6124
6148
  count(counter, delta);
6125
6149
  }
6126
6150
  }
@@ -6191,11 +6215,11 @@ function createConfig$1(options2 = {}) {
6191
6215
  _rm: (node) => node.remove(node)
6192
6216
  });
6193
6217
  const rootConfig = new Proxy(target, {
6194
- set(t, prop, value, r) {
6218
+ set(t2, prop, value, r2) {
6195
6219
  if (typeof prop === "string") {
6196
6220
  nodes.forEach((node) => configChange(node, prop, value));
6197
6221
  }
6198
- return Reflect.set(t, prop, value, r);
6222
+ return Reflect.set(t2, prop, value, r2);
6199
6223
  }
6200
6224
  });
6201
6225
  return rootConfig;
@@ -6210,13 +6234,13 @@ function submitForm(id) {
6210
6234
  warn(151, id);
6211
6235
  }
6212
6236
  function clearState(node) {
6213
- const clear2 = (n) => {
6214
- for (const key in n.store) {
6215
- const message2 = n.store[key];
6237
+ const clear2 = (n2) => {
6238
+ for (const key in n2.store) {
6239
+ const message2 = n2.store[key];
6216
6240
  if (message2.type === "error" || message2.type === "ui" && key === "incomplete") {
6217
- n.store.remove(key);
6241
+ n2.store.remove(key);
6218
6242
  } else if (message2.type === "state") {
6219
- n.store.set(__spreadProps(__spreadValues({}, message2), { value: false }));
6243
+ n2.store.set(__spreadProps(__spreadValues({}, message2), { value: false }));
6220
6244
  }
6221
6245
  }
6222
6246
  };
@@ -6226,7 +6250,7 @@ function clearState(node) {
6226
6250
  function reset(id, resetTo) {
6227
6251
  const node = typeof id === "string" ? getNode$1(id) : id;
6228
6252
  if (node) {
6229
- const initial = (n) => cloneAny(n.props.initial) || (n.type === "group" ? {} : n.type === "list" ? [] : void 0);
6253
+ const initial = (n2) => cloneAny(n2.props.initial) || (n2.type === "group" ? {} : n2.type === "list" ? [] : void 0);
6230
6254
  node._e.pause(node);
6231
6255
  node.input(cloneAny(resetTo) || initial(node), false);
6232
6256
  node.walk((child) => child.input(initial(child), false));
@@ -6278,7 +6302,7 @@ const traps = {
6278
6302
  each: trap(eachChild),
6279
6303
  emit: trap(emit$1),
6280
6304
  find: trap(find),
6281
- on: trap(on),
6305
+ on: trap(on$1),
6282
6306
  off: trap(off),
6283
6307
  parent: trap(false, setParent),
6284
6308
  plugins: trap(false),
@@ -6578,7 +6602,7 @@ function walkTree(_node, context, callback, stopIfFalse = false) {
6578
6602
  function resetConfig(node, context) {
6579
6603
  const parent = node.parent || void 0;
6580
6604
  context.config = createConfig(node.config._t, parent);
6581
- node.walk((n) => n.resetConfig());
6605
+ node.walk((n2) => n2.resetConfig());
6582
6606
  }
6583
6607
  function use(node, context, plugin2, run2 = true, library = true) {
6584
6608
  if (Array.isArray(plugin2) || plugin2 instanceof Set) {
@@ -6656,7 +6680,7 @@ function getNode(node, _context, locator) {
6656
6680
  pointer = node;
6657
6681
  break;
6658
6682
  default:
6659
- pointer = pointer.children.find((c) => String(c.name) === String(name)) || select$3(pointer, name);
6683
+ pointer = pointer.children.find((c2) => String(c2.name) === String(name)) || select$3(pointer, name);
6660
6684
  }
6661
6685
  }
6662
6686
  return pointer || void 0;
@@ -6679,7 +6703,7 @@ function find(node, _context, searchTerm, searcher) {
6679
6703
  return bfs(node, searchTerm, searcher);
6680
6704
  }
6681
6705
  function bfs(tree, searchValue, searchGoal = "name") {
6682
- const search2 = typeof searchGoal === "string" ? (n) => n[searchGoal] == searchValue : searchGoal;
6706
+ const search2 = typeof searchGoal === "string" ? (n2) => n2[searchGoal] == searchValue : searchGoal;
6683
6707
  const stack = [tree];
6684
6708
  while (stack.length) {
6685
6709
  const node = stack.shift();
@@ -6689,8 +6713,8 @@ function bfs(tree, searchValue, searchGoal = "name") {
6689
6713
  }
6690
6714
  return void 0;
6691
6715
  }
6692
- function getRoot(n) {
6693
- let node = n;
6716
+ function getRoot(n2) {
6717
+ let node = n2;
6694
6718
  while (node.parent) {
6695
6719
  node = node.parent;
6696
6720
  }
@@ -6740,7 +6764,7 @@ function createConfig(target = {}, parent) {
6740
6764
  if (node) {
6741
6765
  node.emit(`config:${prop}`, value, false);
6742
6766
  configChange(node, prop, value);
6743
- node.walk((n) => configChange(n, prop, value), true);
6767
+ node.walk((n2) => configChange(n2, prop, value), true);
6744
6768
  }
6745
6769
  return didSet;
6746
6770
  }
@@ -6958,36 +6982,36 @@ function sugar(node) {
6958
6982
  function compile(expr) {
6959
6983
  let provideTokens;
6960
6984
  const requirements = /* @__PURE__ */ new Set();
6961
- const x = function expand(operand, tokens) {
6985
+ const x2 = function expand(operand, tokens) {
6962
6986
  return typeof operand === "function" ? operand(tokens) : operand;
6963
6987
  };
6964
6988
  const operatorRegistry = [
6965
6989
  {
6966
- "&&": (l, r, t) => x(l, t) && x(r, t),
6967
- "||": (l, r, t) => x(l, t) || x(r, t)
6990
+ "&&": (l2, r2, t2) => x2(l2, t2) && x2(r2, t2),
6991
+ "||": (l2, r2, t2) => x2(l2, t2) || x2(r2, t2)
6968
6992
  },
6969
6993
  {
6970
- "===": (l, r, t) => !!(x(l, t) === x(r, t)),
6971
- "!==": (l, r, t) => !!(x(l, t) !== x(r, t)),
6972
- "==": (l, r, t) => !!(x(l, t) == x(r, t)),
6973
- "!=": (l, r, t) => !!(x(l, t) != x(r, t)),
6974
- ">=": (l, r, t) => !!(x(l, t) >= x(r, t)),
6975
- "<=": (l, r, t) => !!(x(l, t) <= x(r, t)),
6976
- ">": (l, r, t) => !!(x(l, t) > x(r, t)),
6977
- "<": (l, r, t) => !!(x(l, t) < x(r, t))
6994
+ "===": (l2, r2, t2) => !!(x2(l2, t2) === x2(r2, t2)),
6995
+ "!==": (l2, r2, t2) => !!(x2(l2, t2) !== x2(r2, t2)),
6996
+ "==": (l2, r2, t2) => !!(x2(l2, t2) == x2(r2, t2)),
6997
+ "!=": (l2, r2, t2) => !!(x2(l2, t2) != x2(r2, t2)),
6998
+ ">=": (l2, r2, t2) => !!(x2(l2, t2) >= x2(r2, t2)),
6999
+ "<=": (l2, r2, t2) => !!(x2(l2, t2) <= x2(r2, t2)),
7000
+ ">": (l2, r2, t2) => !!(x2(l2, t2) > x2(r2, t2)),
7001
+ "<": (l2, r2, t2) => !!(x2(l2, t2) < x2(r2, t2))
6978
7002
  },
6979
7003
  {
6980
- "+": (l, r, t) => x(l, t) + x(r, t),
6981
- "-": (l, r, t) => x(l, t) - x(r, t)
7004
+ "+": (l2, r2, t2) => x2(l2, t2) + x2(r2, t2),
7005
+ "-": (l2, r2, t2) => x2(l2, t2) - x2(r2, t2)
6982
7006
  },
6983
7007
  {
6984
- "*": (l, r, t) => x(l, t) * x(r, t),
6985
- "/": (l, r, t) => x(l, t) / x(r, t),
6986
- "%": (l, r, t) => x(l, t) % x(r, t)
7008
+ "*": (l2, r2, t2) => x2(l2, t2) * x2(r2, t2),
7009
+ "/": (l2, r2, t2) => x2(l2, t2) / x2(r2, t2),
7010
+ "%": (l2, r2, t2) => x2(l2, t2) % x2(r2, t2)
6987
7011
  }
6988
7012
  ];
6989
- const operatorSymbols = operatorRegistry.reduce((s, g) => {
6990
- return s.concat(Object.keys(g));
7013
+ const operatorSymbols = operatorRegistry.reduce((s, g2) => {
7014
+ return s.concat(Object.keys(g2));
6991
7015
  }, []);
6992
7016
  const operatorChars = new Set(operatorSymbols.map((key) => key.charAt(0)));
6993
7017
  function getOp(symbols, char, p2, expression) {
@@ -7145,8 +7169,8 @@ function compile(expr) {
7145
7169
  }
7146
7170
  op = !op && left ? left : op;
7147
7171
  if (!op && operand) {
7148
- op = (v, t) => {
7149
- return typeof v === "function" ? v(t) : v;
7172
+ op = (v, t2) => {
7173
+ return typeof v === "function" ? v(t2) : v;
7150
7174
  };
7151
7175
  op = op.bind(null, evaluate(operand, step));
7152
7176
  }
@@ -7172,7 +7196,7 @@ function compile(expr) {
7172
7196
  if (tailCall) {
7173
7197
  tailCall = tailCall.provide((subTokens) => {
7174
7198
  const rootTokens = provideTokens(subTokens);
7175
- const t = subTokens.reduce((tokenSet, token2) => {
7199
+ const t2 = subTokens.reduce((tokenSet, token2) => {
7176
7200
  const isTail = token2 === tail || (tail === null || tail === void 0 ? void 0 : tail.startsWith(`${token2}(`));
7177
7201
  if (isTail) {
7178
7202
  const value = getAt(userFuncReturn, token2);
@@ -7182,7 +7206,7 @@ function compile(expr) {
7182
7206
  }
7183
7207
  return tokenSet;
7184
7208
  }, {});
7185
- return t;
7209
+ return t2;
7186
7210
  });
7187
7211
  }
7188
7212
  return tailCall ? tailCall() : userFuncReturn;
@@ -7853,9 +7877,9 @@ function isSelected(node, option2) {
7853
7877
  const value = optionValue(node.props.options, option2);
7854
7878
  return Array.isArray(node._value) ? node._value.some((optionA) => shouldSelect(optionA, value)) : node.value === void 0 && !option2 || shouldSelect(value, node._value);
7855
7879
  }
7856
- function selectInput(node, e) {
7857
- const target = e.target;
7858
- const value = target.hasAttribute("multiple") ? Array.from(target.selectedOptions).map((o) => optionValue(node.props.options, o.value)) : optionValue(node.props.options, target.value);
7880
+ function selectInput(node, e2) {
7881
+ const target = e2.target;
7882
+ const value = target.hasAttribute("multiple") ? Array.from(target.selectedOptions).map((o2) => optionValue(node.props.options, o2.value)) : optionValue(node.props.options, target.value);
7859
7883
  node.input(value);
7860
7884
  }
7861
7885
  function applyPlaceholder(options2, placeholder) {
@@ -7944,8 +7968,8 @@ function normalizeBoxes(node) {
7944
7968
  return next(prop);
7945
7969
  };
7946
7970
  }
7947
- function toggleChecked$1(node, e) {
7948
- const el = e.target;
7971
+ function toggleChecked$1(node, e2) {
7972
+ const el = e2.target;
7949
7973
  if (el instanceof HTMLInputElement) {
7950
7974
  const value = Array.isArray(node.props.options) ? optionValue(node.props.options, el.value) : el.value;
7951
7975
  if (Array.isArray(node.props.options) && node.props.options.length) {
@@ -8034,8 +8058,8 @@ function disables(node) {
8034
8058
  async function handleSubmit(node, submitEvent) {
8035
8059
  submitEvent.preventDefault();
8036
8060
  await node.settled;
8037
- node.walk((n) => {
8038
- n.store.set(createMessage({
8061
+ node.walk((n2) => {
8062
+ n2.store.set(createMessage({
8039
8063
  key: "submitted",
8040
8064
  value: true,
8041
8065
  visible: false
@@ -8109,19 +8133,19 @@ function localize(key, value) {
8109
8133
  };
8110
8134
  }
8111
8135
  const isBrowser = typeof window !== "undefined";
8112
- function removeHover(e) {
8113
- if (e.target instanceof HTMLElement && e.target.hasAttribute("data-file-hover")) {
8114
- e.target.removeAttribute("data-file-hover");
8136
+ function removeHover(e2) {
8137
+ if (e2.target instanceof HTMLElement && e2.target.hasAttribute("data-file-hover")) {
8138
+ e2.target.removeAttribute("data-file-hover");
8115
8139
  }
8116
8140
  }
8117
- function preventStrayDrop(type, e) {
8118
- if (!(e.target instanceof HTMLInputElement)) {
8119
- e.preventDefault();
8141
+ function preventStrayDrop(type, e2) {
8142
+ if (!(e2.target instanceof HTMLInputElement)) {
8143
+ e2.preventDefault();
8120
8144
  } else if (type === "dragover") {
8121
- e.target.setAttribute("data-file-hover", "true");
8145
+ e2.target.setAttribute("data-file-hover", "true");
8122
8146
  }
8123
8147
  if (type === "drop") {
8124
- removeHover(e);
8148
+ removeHover(e2);
8125
8149
  }
8126
8150
  }
8127
8151
  function files(node) {
@@ -8142,8 +8166,8 @@ function files(node) {
8142
8166
  }
8143
8167
  if (!node.context)
8144
8168
  return;
8145
- node.context.handlers.resetFiles = (e) => {
8146
- e.preventDefault();
8169
+ node.context.handlers.resetFiles = (e2) => {
8170
+ e2.preventDefault();
8147
8171
  node.input([]);
8148
8172
  if (node.props.id && isBrowser) {
8149
8173
  const el = document.getElementById(node.props.id);
@@ -8151,13 +8175,13 @@ function files(node) {
8151
8175
  el.value = "";
8152
8176
  }
8153
8177
  };
8154
- node.context.handlers.files = (e) => {
8178
+ node.context.handlers.files = (e2) => {
8155
8179
  var _a, _b;
8156
8180
  const files2 = [];
8157
- if (e.target instanceof HTMLInputElement && e.target.files) {
8158
- for (let i2 = 0; i2 < e.target.files.length; i2++) {
8181
+ if (e2.target instanceof HTMLInputElement && e2.target.files) {
8182
+ for (let i2 = 0; i2 < e2.target.files.length; i2++) {
8159
8183
  let file2;
8160
- if (file2 = e.target.files.item(i2)) {
8184
+ if (file2 = e2.target.files.item(i2)) {
8161
8185
  files2.push({ name: file2.name, file: file2 });
8162
8186
  }
8163
8187
  }
@@ -8166,7 +8190,7 @@ function files(node) {
8166
8190
  if (node.context)
8167
8191
  node.context.files = files2;
8168
8192
  if (typeof ((_a = node.props.attrs) === null || _a === void 0 ? void 0 : _a.onChange) === "function") {
8169
- (_b = node.props.attrs) === null || _b === void 0 ? void 0 : _b.onChange(e);
8193
+ (_b = node.props.attrs) === null || _b === void 0 ? void 0 : _b.onChange(e2);
8170
8194
  }
8171
8195
  };
8172
8196
  });
@@ -8347,8 +8371,8 @@ const between = function between2({ value }, from, to) {
8347
8371
  const val = 1 * value;
8348
8372
  from = Number(from);
8349
8373
  to = Number(to);
8350
- const [a, b] = from <= to ? [from, to] : [to, from];
8351
- return val >= 1 * a && val <= 1 * b;
8374
+ const [a2, b2] = from <= to ? [from, to] : [to, from];
8375
+ return val >= 1 * a2 && val <= 1 * b2;
8352
8376
  }
8353
8377
  return false;
8354
8378
  };
@@ -8724,7 +8748,7 @@ function run(current, validations, node, state, removeImmediately, complete) {
8724
8748
  if ((!empty(node.value) || !validation.skipEmpty) && (state.isPassing || validation.force)) {
8725
8749
  if (validation.queued) {
8726
8750
  runRule(validation, node, (result) => {
8727
- result instanceof Promise ? result.then((r) => next(true, r)) : next(false, result);
8751
+ result instanceof Promise ? result.then((r2) => next(true, r2)) : next(false, result);
8728
8752
  });
8729
8753
  } else {
8730
8754
  run(current + 1, validations, node, state, removeImmediately, complete);
@@ -8958,8 +8982,8 @@ const validation$m = {
8958
8982
  if (isNaN(args[0]) || isNaN(args[1])) {
8959
8983
  return `This field was configured incorrectly and can\u2019t be submitted.`;
8960
8984
  }
8961
- const [a, b] = order(args[0], args[1]);
8962
- return `${sentence(name)} must be between ${a} and ${b}.`;
8985
+ const [a2, b2] = order(args[0], args[1]);
8986
+ return `${sentence(name)} must be between ${a2} and ${b2}.`;
8963
8987
  },
8964
8988
  confirm({ name }) {
8965
8989
  return `${sentence(name)} does not match.`;
@@ -9051,11 +9075,11 @@ function createI18nPlugin(registry2) {
9051
9075
  var _a, _b;
9052
9076
  const key = ((_a = fragment2.meta) === null || _a === void 0 ? void 0 : _a.messageKey) || fragment2.key;
9053
9077
  if (has(locale, fragment2.type) && has(locale[fragment2.type], key)) {
9054
- const t = locale[fragment2.type][key];
9055
- if (typeof t === "function") {
9056
- fragment2.value = Array.isArray((_b = fragment2.meta) === null || _b === void 0 ? void 0 : _b.i18nArgs) ? t(...fragment2.meta.i18nArgs) : t(fragment2);
9078
+ const t2 = locale[fragment2.type][key];
9079
+ if (typeof t2 === "function") {
9080
+ fragment2.value = Array.isArray((_b = fragment2.meta) === null || _b === void 0 ? void 0 : _b.i18nArgs) ? t2(...fragment2.meta.i18nArgs) : t2(fragment2);
9057
9081
  } else {
9058
- fragment2.value = t;
9082
+ fragment2.value = t2;
9059
9083
  }
9060
9084
  }
9061
9085
  return next(fragment2);
@@ -9182,25 +9206,25 @@ function parseSchema(library, schema) {
9182
9206
  function parseConditionAttr(attr, _default2) {
9183
9207
  var _a, _b;
9184
9208
  const condition = provider(compile(attr.if));
9185
- let b = () => _default2;
9186
- let a = () => _default2;
9209
+ let b2 = () => _default2;
9210
+ let a2 = () => _default2;
9187
9211
  if (typeof attr.then === "object") {
9188
- a = parseAttrs(attr.then, void 0);
9212
+ a2 = parseAttrs(attr.then, void 0);
9189
9213
  } else if (typeof attr.then === "string" && ((_a = attr.then) === null || _a === void 0 ? void 0 : _a.startsWith("$"))) {
9190
- a = provider(compile(attr.then));
9214
+ a2 = provider(compile(attr.then));
9191
9215
  } else {
9192
- a = () => attr.then;
9216
+ a2 = () => attr.then;
9193
9217
  }
9194
9218
  if (has(attr, "else")) {
9195
9219
  if (typeof attr.else === "object") {
9196
- b = parseAttrs(attr.else);
9220
+ b2 = parseAttrs(attr.else);
9197
9221
  } else if (typeof attr.else === "string" && ((_b = attr.else) === null || _b === void 0 ? void 0 : _b.startsWith("$"))) {
9198
- b = provider(compile(attr.else));
9222
+ b2 = provider(compile(attr.else));
9199
9223
  } else {
9200
- b = () => attr.else;
9224
+ b2 = () => attr.else;
9201
9225
  }
9202
9226
  }
9203
- return () => condition() ? a() : b();
9227
+ return () => condition() ? a2() : b2();
9204
9228
  }
9205
9229
  function parseAttrs(unparsedAttrs, bindExp, _default2 = {}) {
9206
9230
  const explicitAttrs = new Set(Object.keys(unparsedAttrs || {}));
@@ -9293,8 +9317,8 @@ function parseSchema(library, schema) {
9293
9317
  } else if (Array.isArray(node.children)) {
9294
9318
  children = createElements(library2, node.children);
9295
9319
  } else {
9296
- const [childCondition, c, a] = parseCondition2(library2, node.children);
9297
- children = (iterationData) => childCondition && childCondition() ? c && c(iterationData) : a && a(iterationData);
9320
+ const [childCondition, c2, a2] = parseCondition2(library2, node.children);
9321
+ children = (iterationData) => childCondition && childCondition() ? c2 && c2(iterationData) : a2 && a2(iterationData);
9298
9322
  }
9299
9323
  }
9300
9324
  if (isComponent(node)) {
@@ -9311,13 +9335,13 @@ function parseSchema(library, schema) {
9311
9335
  (_a = instanceScopes.get(instanceKey)) === null || _a === void 0 ? void 0 : _a.unshift(slotData2);
9312
9336
  if (iterationData)
9313
9337
  (_b = instanceScopes.get(instanceKey)) === null || _b === void 0 ? void 0 : _b.unshift(iterationData);
9314
- const c = produceChildren(iterationData);
9338
+ const c2 = produceChildren(iterationData);
9315
9339
  if (slotData2)
9316
9340
  (_c = instanceScopes.get(instanceKey)) === null || _c === void 0 ? void 0 : _c.shift();
9317
9341
  if (iterationData)
9318
9342
  (_d = instanceScopes.get(instanceKey)) === null || _d === void 0 ? void 0 : _d.shift();
9319
9343
  instanceKey = currentKey;
9320
- return c;
9344
+ return c2;
9321
9345
  }
9322
9346
  };
9323
9347
  };
@@ -9362,7 +9386,7 @@ function parseSchema(library, schema) {
9362
9386
  return children(iterationData);
9363
9387
  const el = resolve2 ? resolveComponent(element) : element;
9364
9388
  const slots = (children === null || children === void 0 ? void 0 : children.slot) ? createSlots(children, iterationData) : null;
9365
- return h(el, attrs(), slots || (children ? children(iterationData) : []));
9389
+ return h$1(el, attrs(), slots || (children ? children(iterationData) : []));
9366
9390
  }
9367
9391
  return typeof alternate === "function" ? alternate(iterationData) : alternate;
9368
9392
  };
@@ -9466,7 +9490,7 @@ function createRenderFn(instanceCreator, data, instanceKey2) {
9466
9490
  }, {});
9467
9491
  }, instanceKey2);
9468
9492
  }
9469
- let i = 0;
9493
+ let i$3 = 0;
9470
9494
  const FormKitSchema = defineComponent({
9471
9495
  name: "FormKitSchema",
9472
9496
  props: {
@@ -9485,14 +9509,14 @@ const FormKitSchema = defineComponent({
9485
9509
  },
9486
9510
  setup(props2, context) {
9487
9511
  const instance = getCurrentInstance();
9488
- let instanceKey2 = Symbol(String(i++));
9512
+ let instanceKey2 = Symbol(String(i$3++));
9489
9513
  instanceScopes.set(instanceKey2, []);
9490
9514
  let provider = parseSchema(props2.library, props2.schema);
9491
9515
  let render;
9492
9516
  let data;
9493
9517
  watch$1(() => props2.schema, (newSchema, oldSchema) => {
9494
9518
  var _a;
9495
- instanceKey2 = Symbol(String(i++));
9519
+ instanceKey2 = Symbol(String(i$3++));
9496
9520
  provider = parseSchema(props2.library, props2.schema);
9497
9521
  render = createRenderFn(provider, data, instanceKey2);
9498
9522
  if (newSchema === oldSchema) {
@@ -9597,7 +9621,7 @@ const FormKit = defineComponent({
9597
9621
  if (node.props.definition.component) {
9598
9622
  return () => {
9599
9623
  var _a;
9600
- return h((_a = node.props.definition) === null || _a === void 0 ? void 0 : _a.component, {
9624
+ return h$1((_a = node.props.definition) === null || _a === void 0 ? void 0 : _a.component, {
9601
9625
  context: node.context
9602
9626
  }, __spreadValues({}, context.slots));
9603
9627
  };
@@ -9615,7 +9639,7 @@ const FormKit = defineComponent({
9615
9639
  context.emit("node", node);
9616
9640
  const library = node.props.definition.library;
9617
9641
  context.expose({ node });
9618
- return () => h(FormKitSchema, { schema: schema.value, data: node.context, library }, __spreadValues({}, context.slots));
9642
+ return () => h$1(FormKitSchema, { schema: schema.value, data: node.context, library }, __spreadValues({}, context.slots));
9619
9643
  }
9620
9644
  });
9621
9645
  function createPlugin$4(app, options2) {
@@ -9924,9 +9948,9 @@ function useInput(props2, context, options2 = {}) {
9924
9948
  return node;
9925
9949
  }
9926
9950
  const vueBindings = function vueBindings2(node) {
9927
- node.ledger.count("blocking", (m) => m.blocking);
9951
+ node.ledger.count("blocking", (m2) => m2.blocking);
9928
9952
  const isValid = ref(!node.ledger.value("blocking"));
9929
- node.ledger.count("errors", (m) => m.type === "error");
9953
+ node.ledger.count("errors", (m2) => m2.type === "error");
9930
9954
  const hasErrors = ref(!!node.ledger.value("errors"));
9931
9955
  let hasTicked = false;
9932
9956
  nextTick(() => {
@@ -10032,9 +10056,9 @@ const vueBindings = function vueBindings2(node) {
10032
10056
  touch: () => {
10033
10057
  node.store.set(createMessage({ key: "dirty", visible: false, value: true }));
10034
10058
  },
10035
- DOMInput: (e) => {
10036
- node.input(e.target.value);
10037
- node.emit("dom-input-event", e);
10059
+ DOMInput: (e2) => {
10060
+ node.input(e2.target.value);
10061
+ node.emit("dom-input-event", e2);
10038
10062
  }
10039
10063
  },
10040
10064
  help: node.props.help,
@@ -10125,8 +10149,8 @@ const vueBindings = function vueBindings2(node) {
10125
10149
  context.state[message2.key] = !!message2.value;
10126
10150
  }
10127
10151
  };
10128
- node.on("message-added", (e) => updateState(e.payload));
10129
- node.on("message-updated", (e) => updateState(e.payload));
10152
+ node.on("message-added", (e2) => updateState(e2.payload));
10153
+ node.on("message-updated", (e2) => updateState(e2.payload));
10130
10154
  node.on("message-removed", ({ payload: message2 }) => {
10131
10155
  delete ui[message2.key];
10132
10156
  delete availableMessages[message2.key];
@@ -10285,6 +10309,206 @@ plugin(({ addVariant }) => {
10285
10309
  '[data-message-type="error"]&'
10286
10310
  ]);
10287
10311
  });
10312
+ var e = "undefined", o$1 = "object", g$1 = "any", m = "*", j = "__", F$1 = typeof process != "undefined" ? process : {};
10313
+ F$1.env && F$1.env.NODE_ENV || "";
10314
+ var $ = typeof window != "undefined";
10315
+ F$1.versions != null && F$1.versions.node != null;
10316
+ typeof Deno != "undefined" && Deno.core !== void 0;
10317
+ $ && window.name === "nodejs" || typeof navigator != "undefined" && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
10318
+ function M(n2, t2) {
10319
+ return t2.charAt(0)[n2]() + t2.slice(1);
10320
+ }
10321
+ var U = M.bind(null, "toUpperCase"), H = M.bind(null, "toLowerCase");
10322
+ function J(n2) {
10323
+ return Y(n2) ? U("null") : typeof n2 == "object" ? yn(n2) : Object.prototype.toString.call(n2).slice(8, -1);
10324
+ }
10325
+ function R(n2, t2) {
10326
+ t2 === void 0 && (t2 = true);
10327
+ var e2 = J(n2);
10328
+ return t2 ? H(e2) : e2;
10329
+ }
10330
+ function V(n2, t2) {
10331
+ return typeof t2 === n2;
10332
+ }
10333
+ var W = V.bind(null, "function"), q = V.bind(null, "string"), I$1 = V.bind(null, "undefined");
10334
+ V.bind(null, "boolean");
10335
+ V.bind(null, "symbol");
10336
+ function Y(n2) {
10337
+ return n2 === null;
10338
+ }
10339
+ function nn(n2) {
10340
+ return R(n2) === "number" && !isNaN(n2);
10341
+ }
10342
+ function on(n2) {
10343
+ if (!un(n2))
10344
+ return false;
10345
+ for (var t2 = n2; Object.getPrototypeOf(t2) !== null; )
10346
+ t2 = Object.getPrototypeOf(t2);
10347
+ return Object.getPrototypeOf(n2) === t2;
10348
+ }
10349
+ function un(n2) {
10350
+ return n2 && (typeof n2 == "object" || n2 !== null);
10351
+ }
10352
+ function yn(n2) {
10353
+ return W(n2.constructor) ? n2.constructor.name : null;
10354
+ }
10355
+ function hn(n2) {
10356
+ return n2 instanceof Error || q(n2.message) && n2.constructor && nn(n2.constructor.stackTraceLimit);
10357
+ }
10358
+ function On(n2, t2) {
10359
+ if (typeof t2 != "object" || Y(t2))
10360
+ return false;
10361
+ if (t2 instanceof n2)
10362
+ return true;
10363
+ var e2 = R(new n2(""));
10364
+ if (hn(t2))
10365
+ for (; t2; ) {
10366
+ if (R(t2) === e2)
10367
+ return true;
10368
+ t2 = Object.getPrototypeOf(t2);
10369
+ }
10370
+ return false;
10371
+ }
10372
+ On.bind(null, TypeError);
10373
+ On.bind(null, SyntaxError);
10374
+ function $n(n2, t2) {
10375
+ var e2 = n2 instanceof Element || n2 instanceof HTMLDocument;
10376
+ return e2 && t2 ? Tn(n2, t2) : e2;
10377
+ }
10378
+ function Tn(n2, t2) {
10379
+ return t2 === void 0 && (t2 = ""), n2 && n2.nodeName === t2.toUpperCase();
10380
+ }
10381
+ function _n(n2) {
10382
+ var t2 = [].slice.call(arguments, 1);
10383
+ return function() {
10384
+ return n2.apply(void 0, [].slice.call(arguments).concat(t2));
10385
+ };
10386
+ }
10387
+ _n($n, "form");
10388
+ _n($n, "button");
10389
+ _n($n, "input");
10390
+ _n($n, "select");
10391
+ var l = "global", o = j + "global" + j, n = typeof self === o$1 && self.self === self && self || typeof global === o$1 && global.global === global && global || void 0;
10392
+ function a$2(t2) {
10393
+ return n[o][t2];
10394
+ }
10395
+ function f(t2, e2) {
10396
+ return n[o][t2] = e2;
10397
+ }
10398
+ function i$2(t2) {
10399
+ delete n[o][t2];
10400
+ }
10401
+ function u$1(t2, e2, r2) {
10402
+ var l2;
10403
+ try {
10404
+ if (b(t2)) {
10405
+ var o2 = window[t2];
10406
+ l2 = o2[e2].bind(o2);
10407
+ }
10408
+ } catch (t3) {
10409
+ }
10410
+ return l2 || r2;
10411
+ }
10412
+ n[o] || (n[o] = {});
10413
+ var c$1 = {};
10414
+ function b(t2) {
10415
+ if (typeof c$1[t2] !== e)
10416
+ return c$1[t2];
10417
+ try {
10418
+ var e$1 = window[t2];
10419
+ e$1.setItem(e, e), e$1.removeItem(e);
10420
+ } catch (e2) {
10421
+ return c$1[t2] = false;
10422
+ }
10423
+ return c$1[t2] = true;
10424
+ }
10425
+ var t = "cookie", i$1 = a$1(), r$1 = d$1, c = d$1;
10426
+ function u(o2) {
10427
+ return i$1 ? d$1(o2, "", -1) : i$2(o2);
10428
+ }
10429
+ function a$1() {
10430
+ if (i$1 !== void 0)
10431
+ return i$1;
10432
+ var e2 = "cookiecookie";
10433
+ try {
10434
+ d$1(e2, e2), i$1 = document.cookie.indexOf(e2) !== -1, u(e2);
10435
+ } catch (e3) {
10436
+ i$1 = false;
10437
+ }
10438
+ return i$1;
10439
+ }
10440
+ function d$1(e2, t2, r2, c2, u2, a2) {
10441
+ if (typeof window != "undefined") {
10442
+ var d2 = arguments.length > 1;
10443
+ return i$1 === false && (d2 ? f(e2, t2) : a$2(e2)), d2 ? document.cookie = e2 + "=" + encodeURIComponent(t2) + (r2 ? "; expires=" + new Date(+new Date() + 1e3 * r2).toUTCString() + (c2 ? "; path=" + c2 : "") + (u2 ? "; domain=" + u2 : "") + (a2 ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + e2 + "=")[1] || "").split(";")[0]);
10444
+ }
10445
+ }
10446
+ var r = "localStorage", g = b.bind(null, "localStorage");
10447
+ u$1("localStorage", "getItem", a$2);
10448
+ u$1("localStorage", "setItem", f);
10449
+ u$1("localStorage", "removeItem", i$2);
10450
+ var a = "sessionStorage", i = b.bind(null, "sessionStorage");
10451
+ u$1("sessionStorage", "getItem", a$2);
10452
+ u$1("sessionStorage", "setItem", f);
10453
+ u$1("sessionStorage", "removeItem", i$2);
10454
+ function I(t2) {
10455
+ var o2 = t2;
10456
+ try {
10457
+ if ((o2 = JSON.parse(t2)) === "true")
10458
+ return true;
10459
+ if (o2 === "false")
10460
+ return false;
10461
+ if (on(o2))
10462
+ return o2;
10463
+ parseFloat(o2) === o2 && (o2 = parseFloat(o2));
10464
+ } catch (t3) {
10465
+ }
10466
+ if (o2 !== null && o2 !== "")
10467
+ return o2;
10468
+ }
10469
+ var k = g(), O = i(), x = a$1();
10470
+ function C(o2, e2) {
10471
+ if (o2) {
10472
+ var r2 = A(e2), a2 = !N(r2), i2 = d(r2) ? I(localStorage.getItem(o2)) : void 0;
10473
+ if (a2 && !I$1(i2))
10474
+ return i2;
10475
+ var n2 = h(r2) ? I(r$1(o2)) : void 0;
10476
+ if (a2 && n2)
10477
+ return n2;
10478
+ var l2 = E(r2) ? I(sessionStorage.getItem(o2)) : void 0;
10479
+ if (a2 && l2)
10480
+ return l2;
10481
+ var u2 = a$2(o2);
10482
+ return a2 ? u2 : { localStorage: i2, sessionStorage: l2, cookie: n2, global: u2 };
10483
+ }
10484
+ }
10485
+ function L(r$2, a$12, l$1) {
10486
+ if (r$2 && !I$1(a$12)) {
10487
+ var u2 = {}, g2 = A(l$1), m2 = JSON.stringify(a$12), S = !N(g2);
10488
+ return d(g2) && (u2[r] = F(r, a$12, I(localStorage.getItem(r$2))), localStorage.setItem(r$2, m2), S) ? u2[r] : h(g2) && (u2[t] = F(t, a$12, I(r$1(r$2))), c(r$2, m2), S) ? u2[t] : E(g2) && (u2[a] = F(a, a$12, I(sessionStorage.getItem(r$2))), sessionStorage.setItem(r$2, m2), S) ? u2[a] : (u2[l] = F(l, a$12, a$2(r$2)), f(r$2, a$12), S ? u2[l] : u2);
10489
+ }
10490
+ }
10491
+ function A(t2) {
10492
+ return t2 ? q(t2) ? t2 : t2.storage : g$1;
10493
+ }
10494
+ function d(t2) {
10495
+ return k && G(t2, r);
10496
+ }
10497
+ function h(t$1) {
10498
+ return x && G(t$1, t);
10499
+ }
10500
+ function E(t2) {
10501
+ return O && G(t2, a);
10502
+ }
10503
+ function N(t2) {
10504
+ return t2 === m || t2 === "all";
10505
+ }
10506
+ function G(t2, o2) {
10507
+ return t2 === g$1 || t2 === o2 || N(t2);
10508
+ }
10509
+ function F(t2, o2, e2) {
10510
+ return { location: t2, current: o2, previous: e2 };
10511
+ }
10288
10512
  const textClassification = {
10289
10513
  label: "block mb-1 font-bold text-sm formkit-invalid:text-red-500",
10290
10514
  inner: `
@@ -10357,12 +10581,48 @@ var theme = {
10357
10581
  week: textClassification
10358
10582
  };
10359
10583
  var index = "";
10584
+ const EXPERIMENT_KEY = "__form_experiments";
10360
10585
  const classes = generateClasses(theme);
10361
10586
  const forms = window.bhlForms || [];
10362
10587
  const apps = {};
10363
- forms.forEach(function(form2) {
10364
- console.log("Mounting form:", form2);
10365
- const app = createApp(_sfc_main, { schema: form2.schema }).use(plugin$1, defaultConfig({
10588
+ function chooseVariant(exp) {
10589
+ let variant = null, active = {}, fromCache = false;
10590
+ active = C(EXPERIMENT_KEY) || {};
10591
+ if (!exp.noCache && active && active[exp.name]) {
10592
+ variant = active[exp.name];
10593
+ fromCache = true;
10594
+ } else {
10595
+ const vs = exp.variants;
10596
+ variant = vs[Math.floor(Math.random() * vs.length)];
10597
+ active[exp.name] = variant;
10598
+ L(EXPERIMENT_KEY, active);
10599
+ }
10600
+ console.debug("Chose variant:", variant, "fromCache:", fromCache);
10601
+ return { variant, fromCache };
10602
+ }
10603
+ forms.forEach(async function(form2) {
10604
+ console.debug("Mounting form:", form2);
10605
+ if (form2.schema && form2.schemaExperiment) {
10606
+ throw Error("Only one of schema and schemaExperiment allowed");
10607
+ }
10608
+ let schema;
10609
+ if (form2.schema) {
10610
+ schema = form2.schema;
10611
+ } else if (form2.schemaExperiment) {
10612
+ const res = chooseVariant(form2.schemaExperiment);
10613
+ schema = res.variant.schema;
10614
+ if (form2.experimentCallback) {
10615
+ experimentCallback(form2, res.variant, res.fromCache);
10616
+ }
10617
+ }
10618
+ let schemaObj = schema;
10619
+ if (typeof schema === "string") {
10620
+ console.debug("Fetching:", schema);
10621
+ const res = await fetch(schema);
10622
+ schemaObj = await res.json();
10623
+ console.debug("Got schema:", schemaObj);
10624
+ }
10625
+ const app = createApp(_sfc_main, { schema: schemaObj }).use(plugin$1, defaultConfig({
10366
10626
  config: {
10367
10627
  classes
10368
10628
  }
@@ -10370,4 +10630,5 @@ forms.forEach(function(form2) {
10370
10630
  app.mount("#" + form2.target);
10371
10631
  apps[form2.target] = app;
10372
10632
  });
10633
+ console.debug("Apps:", apps);
10373
10634
  export { apps as bhlForms };