@inploi/plugin-chatbot 3.11.0 → 3.12.0

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.
@@ -4,8 +4,8 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { NotFoundError, createPlugin } from "@inploi/sdk";
8
- var n$2, l$4, u$3, t$3, i$3, o$4, r$4, f$3, e$3, c$3 = {}, s$3 = [], a$3 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, h$2 = Array.isArray;
7
+ import { createPlugin } from "@inploi/sdk";
8
+ var n$1, l$4, u$3, t$3, i$3, o$4, r$4, f$3, e$3, c$3 = {}, s$3 = [], a$3 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, h$2 = Array.isArray;
9
9
  function v$3(n2, l2) {
10
10
  for (var u2 in l2)
11
11
  n2[u2] = l2[u2];
@@ -19,7 +19,7 @@ function y$3(l2, u2, t2) {
19
19
  var i2, o2, r2, f2 = {};
20
20
  for (r2 in u2)
21
21
  "key" == r2 ? i2 = u2[r2] : "ref" == r2 ? o2 = u2[r2] : f2[r2] = u2[r2];
22
- if (arguments.length > 2 && (f2.children = arguments.length > 3 ? n$2.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps)
22
+ if (arguments.length > 2 && (f2.children = arguments.length > 3 ? n$1.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps)
23
23
  for (r2 in l2.defaultProps)
24
24
  void 0 === f2[r2] && (f2[r2] = l2.defaultProps[r2]);
25
25
  return d$4(l2, f2, i2, o2, null);
@@ -217,7 +217,7 @@ function N$2(l2, u2, t2, i2, o2, r2, f2, e2, s2) {
217
217
  if (null === k2)
218
218
  d2 === _2 || e2 && l2.data === _2 || (l2.data = _2);
219
219
  else {
220
- if (r2 = r2 && n$2.call(l2.childNodes), v2 = (d2 = t2.props || c$3).dangerouslySetInnerHTML, y2 = _2.dangerouslySetInnerHTML, !e2) {
220
+ if (r2 = r2 && n$1.call(l2.childNodes), v2 = (d2 = t2.props || c$3).dangerouslySetInnerHTML, y2 = _2.dangerouslySetInnerHTML, !e2) {
221
221
  if (null != r2)
222
222
  for (d2 = {}, b2 = 0; b2 < l2.attributes.length; b2++)
223
223
  d2[l2.attributes[b2].name] = l2.attributes[b2].value;
@@ -260,7 +260,7 @@ function B$3(n2, l2, u2) {
260
260
  }
261
261
  function D$1(u2, t2, i2) {
262
262
  var o2, r2, f2, e2;
263
- l$4.__ && l$4.__(u2, t2), r2 = (o2 = "function" == typeof i2) ? null : i2 && i2.__k || t2.__k, f2 = [], e2 = [], L$1(t2, u2 = (!o2 && i2 || t2).__k = y$3(k$3, null, [u2]), r2 || c$3, c$3, void 0 !== t2.ownerSVGElement, !o2 && i2 ? [i2] : r2 ? null : t2.firstChild ? n$2.call(t2.childNodes) : null, f2, !o2 && i2 ? i2 : r2 ? r2.__e : t2.firstChild, o2, e2), M$1(f2, u2, e2);
263
+ l$4.__ && l$4.__(u2, t2), r2 = (o2 = "function" == typeof i2) ? null : i2 && i2.__k || t2.__k, f2 = [], e2 = [], L$1(t2, u2 = (!o2 && i2 || t2).__k = y$3(k$3, null, [u2]), r2 || c$3, c$3, void 0 !== t2.ownerSVGElement, !o2 && i2 ? [i2] : r2 ? null : t2.firstChild ? n$1.call(t2.childNodes) : null, f2, !o2 && i2 ? i2 : r2 ? r2.__e : t2.firstChild, o2, e2), M$1(f2, u2, e2);
264
264
  }
265
265
  function E$3(n2, l2) {
266
266
  D$1(n2, l2, E$3);
@@ -269,7 +269,7 @@ function F$2(l2, u2, t2) {
269
269
  var i2, o2, r2, f2, e2 = v$3({}, l2.props);
270
270
  for (r2 in l2.type && l2.type.defaultProps && (f2 = l2.type.defaultProps), u2)
271
271
  "key" == r2 ? i2 = u2[r2] : "ref" == r2 ? o2 = u2[r2] : e2[r2] = void 0 === u2[r2] && void 0 !== f2 ? f2[r2] : u2[r2];
272
- return arguments.length > 2 && (e2.children = arguments.length > 3 ? n$2.call(arguments, 2) : t2), d$4(l2.type, e2, i2 || l2.key, o2 || l2.ref, null);
272
+ return arguments.length > 2 && (e2.children = arguments.length > 3 ? n$1.call(arguments, 2) : t2), d$4(l2.type, e2, i2 || l2.key, o2 || l2.ref, null);
273
273
  }
274
274
  function G$1(n2, l2) {
275
275
  var u2 = { __c: l2 = "__cC" + e$3++, __: n2, Consumer: function(n3, l3) {
@@ -292,7 +292,7 @@ function G$1(n2, l2) {
292
292
  } };
293
293
  return u2.Provider.__ = u2.Consumer.contextType = u2;
294
294
  }
295
- n$2 = s$3.slice, l$4 = { __e: function(n2, l2, u2, t2) {
295
+ n$1 = s$3.slice, l$4 = { __e: function(n2, l2, u2, t2) {
296
296
  for (var i2, o2, r2; l2 = l2.__; )
297
297
  if ((i2 = l2.__c) && !i2.__)
298
298
  try {
@@ -312,731 +312,507 @@ n$2 = s$3.slice, l$4 = { __e: function(n2, l2, u2, t2) {
312
312
  }, b$3.prototype.render = k$3, i$3 = [], r$4 = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, f$3 = function(n2, l2) {
313
313
  return n2.__v.__b - l2.__v.__b;
314
314
  }, x$4.__r = 0, e$3 = 0;
315
- var t$2, r$3, u$2, i$2, o$3 = 0, f$2 = [], c$2 = [], e$2 = l$4.__b, a$2 = l$4.__r, v$2 = l$4.diffed, l$3 = l$4.__c, m$2 = l$4.unmount;
316
- function d$3(t2, u2) {
317
- l$4.__h && l$4.__h(r$3, t2, o$3 || u2), o$3 = 0;
318
- var i2 = r$3.__H || (r$3.__H = { __: [], __h: [] });
319
- return t2 >= i2.__.length && i2.__.push({ __V: c$2 }), i2.__[t2];
320
- }
321
- function h$1(n2) {
322
- return o$3 = 1, s$2(B$2, n2);
323
- }
324
- function s$2(n2, u2, i2) {
325
- var o2 = d$3(t$2++, 2);
326
- if (o2.t = n2, !o2.__c && (o2.__ = [i2 ? i2(u2) : B$2(void 0, u2), function(n3) {
327
- var t2 = o2.__N ? o2.__N[0] : o2.__[0], r2 = o2.t(t2, n3);
328
- t2 !== r2 && (o2.__N = [r2, o2.__[1]], o2.__c.setState({}));
329
- }], o2.__c = r$3, !r$3.u)) {
330
- var f2 = function(n3, t2, r2) {
331
- if (!o2.__c.__H)
332
- return true;
333
- var u3 = o2.__c.__H.__.filter(function(n4) {
334
- return n4.__c;
335
- });
336
- if (u3.every(function(n4) {
337
- return !n4.__N;
338
- }))
339
- return !c2 || c2.call(this, n3, t2, r2);
340
- var i3 = false;
341
- return u3.forEach(function(n4) {
342
- if (n4.__N) {
343
- var t3 = n4.__[0];
344
- n4.__ = n4.__N, n4.__N = void 0, t3 !== n4.__[0] && (i3 = true);
345
- }
346
- }), !(!i3 && o2.__c.props === n3) && (!c2 || c2.call(this, n3, t2, r2));
347
- };
348
- r$3.u = true;
349
- var c2 = r$3.shouldComponentUpdate, e2 = r$3.componentWillUpdate;
350
- r$3.componentWillUpdate = function(n3, t2, r2) {
351
- if (this.__e) {
352
- var u3 = c2;
353
- c2 = void 0, f2(n3, t2, r2), c2 = u3;
354
- }
355
- e2 && e2.call(this, n3, t2, r2);
356
- }, r$3.shouldComponentUpdate = f2;
315
+ var ValiError = class extends Error {
316
+ /**
317
+ * Creates a Valibot error with useful information.
318
+ *
319
+ * @param issues The error issues.
320
+ */
321
+ constructor(issues) {
322
+ super(issues[0].message);
323
+ __publicField(this, "issues");
324
+ this.name = "ValiError";
325
+ this.issues = issues;
357
326
  }
358
- return o2.__N || o2.__;
359
- }
360
- function p$3(u2, i2) {
361
- var o2 = d$3(t$2++, 3);
362
- !l$4.__s && z$1(o2.__H, i2) && (o2.__ = u2, o2.i = i2, r$3.__H.__h.push(o2));
327
+ };
328
+ function coerce(schema, action) {
329
+ return {
330
+ ...schema,
331
+ _parse(input, info) {
332
+ return schema._parse(action(input), info);
333
+ }
334
+ };
363
335
  }
364
- function y$2(u2, i2) {
365
- var o2 = d$3(t$2++, 4);
366
- !l$4.__s && z$1(o2.__H, i2) && (o2.__ = u2, o2.i = i2, r$3.__h.push(o2));
336
+ function getIssues(issues) {
337
+ return { issues };
367
338
  }
368
- function _$4(n2) {
369
- return o$3 = 5, F$1(function() {
370
- return { current: n2 };
371
- }, []);
339
+ function getOutput(output) {
340
+ return { output };
372
341
  }
373
- function A$2(n2, t2, r2) {
374
- o$3 = 6, y$2(function() {
375
- return "function" == typeof n2 ? (n2(t2()), function() {
376
- return n2(null);
377
- }) : n2 ? (n2.current = t2(), function() {
378
- return n2.current = null;
379
- }) : void 0;
380
- }, null == r2 ? r2 : r2.concat(n2));
342
+ function getIssue(info, issue) {
343
+ return {
344
+ reason: info == null ? void 0 : info.reason,
345
+ validation: issue.validation,
346
+ origin: (info == null ? void 0 : info.origin) || "value",
347
+ message: issue.message,
348
+ input: issue.input,
349
+ path: issue.path,
350
+ abortEarly: info == null ? void 0 : info.abortEarly,
351
+ abortPipeEarly: info == null ? void 0 : info.abortPipeEarly,
352
+ skipPipe: info == null ? void 0 : info.skipPipe
353
+ };
381
354
  }
382
- function F$1(n2, r2) {
383
- var u2 = d$3(t$2++, 7);
384
- return z$1(u2.__H, r2) ? (u2.__V = n2(), u2.i = r2, u2.__h = n2, u2.__V) : u2.__;
355
+ function getPipeInfo(info, reason) {
356
+ return {
357
+ reason,
358
+ origin: info == null ? void 0 : info.origin,
359
+ abortEarly: info == null ? void 0 : info.abortEarly,
360
+ abortPipeEarly: info == null ? void 0 : info.abortPipeEarly,
361
+ skipPipe: info == null ? void 0 : info.skipPipe
362
+ };
385
363
  }
386
- function T$2(n2, t2) {
387
- return o$3 = 8, F$1(function() {
388
- return n2;
389
- }, t2);
364
+ function executePipe(input, pipe2, parseInfo, reason) {
365
+ if (!pipe2 || !pipe2.length || (parseInfo == null ? void 0 : parseInfo.skipPipe)) {
366
+ return getOutput(input);
367
+ }
368
+ let pipeInfo;
369
+ let issues;
370
+ let output = input;
371
+ for (const action of pipe2) {
372
+ const result = action._parse(output);
373
+ if (result.issues) {
374
+ pipeInfo = pipeInfo || getPipeInfo(parseInfo, reason);
375
+ for (const issueInfo of result.issues) {
376
+ const issue = getIssue(pipeInfo, issueInfo);
377
+ issues ? issues.push(issue) : issues = [issue];
378
+ }
379
+ if (pipeInfo.abortEarly || pipeInfo.abortPipeEarly) {
380
+ break;
381
+ }
382
+ } else {
383
+ output = result.output;
384
+ }
385
+ }
386
+ return issues ? getIssues(issues) : getOutput(output);
390
387
  }
391
- function q$1(n2) {
392
- var u2 = r$3.context[n2.__c], i2 = d$3(t$2++, 9);
393
- return i2.c = n2, u2 ? (null == i2.__ && (i2.__ = true, u2.sub(r$3)), u2.props.value) : n2.__;
388
+ function getDefaultArgs(arg1, arg2) {
389
+ return Array.isArray(arg1) ? [void 0, arg1] : [arg1, arg2];
394
390
  }
395
- function x$3(t2, r2) {
396
- l$4.useDebugValue && l$4.useDebugValue(r2 ? r2(t2) : t2);
391
+ function getErrorMessage(message) {
392
+ return typeof message === "function" ? message() : message;
397
393
  }
398
- function P$2(n2) {
399
- var u2 = d$3(t$2++, 10), i2 = h$1();
400
- return u2.__ = n2, r$3.componentDidCatch || (r$3.componentDidCatch = function(n3, t2) {
401
- u2.__ && u2.__(n3, t2), i2[1](n3);
402
- }), [i2[0], function() {
403
- i2[1](void 0);
404
- }];
394
+ function getPipeIssues(validation, message, input, requirement) {
395
+ return getIssues([
396
+ {
397
+ validation,
398
+ message: getErrorMessage(message),
399
+ input,
400
+ requirement
401
+ }
402
+ ]);
405
403
  }
406
- function V$1() {
407
- var n2 = d$3(t$2++, 11);
408
- if (!n2.__) {
409
- for (var u2 = r$3.__v; null !== u2 && !u2.__m && null !== u2.__; )
410
- u2 = u2.__;
411
- var i2 = u2.__m || (u2.__m = [0, 0]);
412
- n2.__ = "P" + i2[0] + "-" + i2[1]++;
404
+ function getRestAndDefaultArgs(arg1, arg2, arg3) {
405
+ if (!arg1 || typeof arg1 === "object" && !Array.isArray(arg1)) {
406
+ const [error2, pipe22] = getDefaultArgs(arg2, arg3);
407
+ return [arg1, error2, pipe22];
413
408
  }
414
- return n2.__;
409
+ const [error, pipe2] = getDefaultArgs(
410
+ arg1,
411
+ arg2
412
+ );
413
+ return [void 0, error, pipe2];
415
414
  }
416
- function b$2() {
417
- for (var t2; t2 = f$2.shift(); )
418
- if (t2.__P && t2.__H)
419
- try {
420
- t2.__H.__h.forEach(k$2), t2.__H.__h.forEach(w$3), t2.__H.__h = [];
421
- } catch (r2) {
422
- t2.__H.__h = [], l$4.__e(r2, t2.__v);
415
+ function getSchemaIssues(info, reason, validation, message, input, issues) {
416
+ return {
417
+ issues: [
418
+ {
419
+ reason,
420
+ validation,
421
+ origin: (info == null ? void 0 : info.origin) || "value",
422
+ message: getErrorMessage(message),
423
+ input,
424
+ issues,
425
+ abortEarly: info == null ? void 0 : info.abortEarly,
426
+ abortPipeEarly: info == null ? void 0 : info.abortPipeEarly,
427
+ skipPipe: info == null ? void 0 : info.skipPipe
423
428
  }
429
+ ]
430
+ };
424
431
  }
425
- l$4.__b = function(n2) {
426
- r$3 = null, e$2 && e$2(n2);
427
- }, l$4.__r = function(n2) {
428
- a$2 && a$2(n2), t$2 = 0;
429
- var i2 = (r$3 = n2.__c).__H;
430
- i2 && (u$2 === r$3 ? (i2.__h = [], r$3.__h = [], i2.__.forEach(function(n3) {
431
- n3.__N && (n3.__ = n3.__N), n3.__V = c$2, n3.__N = n3.i = void 0;
432
- })) : (i2.__h.forEach(k$2), i2.__h.forEach(w$3), i2.__h = [], t$2 = 0)), u$2 = r$3;
433
- }, l$4.diffed = function(t2) {
434
- v$2 && v$2(t2);
435
- var o2 = t2.__c;
436
- o2 && o2.__H && (o2.__H.__h.length && (1 !== f$2.push(o2) && i$2 === l$4.requestAnimationFrame || ((i$2 = l$4.requestAnimationFrame) || j$2)(b$2)), o2.__H.__.forEach(function(n2) {
437
- n2.i && (n2.__H = n2.i), n2.__V !== c$2 && (n2.__ = n2.__V), n2.i = void 0, n2.__V = c$2;
438
- })), u$2 = r$3 = null;
439
- }, l$4.__c = function(t2, r2) {
440
- r2.some(function(t3) {
441
- try {
442
- t3.__h.forEach(k$2), t3.__h = t3.__h.filter(function(n2) {
443
- return !n2.__ || w$3(n2);
444
- });
445
- } catch (u2) {
446
- r2.some(function(n2) {
447
- n2.__h && (n2.__h = []);
448
- }), r2 = [], l$4.__e(u2, t3.__v);
449
- }
450
- }), l$3 && l$3(t2, r2);
451
- }, l$4.unmount = function(t2) {
452
- m$2 && m$2(t2);
453
- var r2, u2 = t2.__c;
454
- u2 && u2.__H && (u2.__H.__.forEach(function(n2) {
455
- try {
456
- k$2(n2);
457
- } catch (n3) {
458
- r2 = n3;
432
+ function any(pipe2) {
433
+ return {
434
+ type: "any",
435
+ async: false,
436
+ pipe: pipe2,
437
+ _parse(input, info) {
438
+ return executePipe(input, this.pipe, info, "any");
459
439
  }
460
- }), u2.__H = void 0, r2 && l$4.__e(r2, u2.__v));
461
- };
462
- var g$3 = "function" == typeof requestAnimationFrame;
463
- function j$2(n2) {
464
- var t2, r2 = function() {
465
- clearTimeout(u2), g$3 && cancelAnimationFrame(t2), setTimeout(n2);
466
- }, u2 = setTimeout(r2, 100);
467
- g$3 && (t2 = requestAnimationFrame(r2));
468
- }
469
- function k$2(n2) {
470
- var t2 = r$3, u2 = n2.__c;
471
- "function" == typeof u2 && (n2.__c = void 0, u2()), r$3 = t2;
440
+ };
472
441
  }
473
- function w$3(n2) {
474
- var t2 = r$3;
475
- n2.__c = n2.__(), r$3 = t2;
476
- }
477
- function z$1(n2, t2) {
478
- return !n2 || n2.length !== t2.length || t2.some(function(t3, r2) {
479
- return t3 !== n2[r2];
480
- });
481
- }
482
- function B$2(n2, t2) {
483
- return "function" == typeof t2 ? t2(n2) : t2;
484
- }
485
- function i$1() {
486
- throw new Error("Cycle detected");
487
- }
488
- var t$1 = Symbol.for("preact-signals");
489
- function r$2() {
490
- if (!(v$1 > 1)) {
491
- var i2, t2 = false;
492
- while (void 0 !== f$1) {
493
- var r2 = f$1;
494
- f$1 = void 0;
495
- e$1++;
496
- while (void 0 !== r2) {
497
- var n2 = r2.o;
498
- r2.o = void 0;
499
- r2.f &= -3;
500
- if (!(8 & r2.f) && l$2(r2))
501
- try {
502
- r2.c();
503
- } catch (r3) {
504
- if (!t2) {
505
- i2 = r3;
506
- t2 = true;
442
+ function array(item, arg2, arg3) {
443
+ const [message = "Invalid type", pipe2] = getDefaultArgs(arg2, arg3);
444
+ return {
445
+ type: "array",
446
+ async: false,
447
+ item,
448
+ message,
449
+ pipe: pipe2,
450
+ _parse(input, info) {
451
+ if (!Array.isArray(input)) {
452
+ return getSchemaIssues(info, "type", "array", this.message, input);
453
+ }
454
+ let issues;
455
+ const output = [];
456
+ for (let key = 0; key < input.length; key++) {
457
+ const value2 = input[key];
458
+ const result = this.item._parse(value2, info);
459
+ if (result.issues) {
460
+ const pathItem = {
461
+ type: "array",
462
+ input,
463
+ key,
464
+ value: value2
465
+ };
466
+ for (const issue of result.issues) {
467
+ if (issue.path) {
468
+ issue.path.unshift(pathItem);
469
+ } else {
470
+ issue.path = [pathItem];
507
471
  }
472
+ issues == null ? void 0 : issues.push(issue);
508
473
  }
509
- r2 = n2;
474
+ if (!issues) {
475
+ issues = result.issues;
476
+ }
477
+ if (info == null ? void 0 : info.abortEarly) {
478
+ break;
479
+ }
480
+ } else {
481
+ output.push(result.output);
482
+ }
510
483
  }
484
+ return issues ? getIssues(issues) : executePipe(output, this.pipe, info, "array");
511
485
  }
512
- e$1 = 0;
513
- v$1--;
514
- if (t2)
515
- throw i2;
516
- } else
517
- v$1--;
486
+ };
518
487
  }
519
- function n$1(i2) {
520
- if (v$1 > 0)
521
- return i2();
522
- v$1++;
523
- try {
524
- return i2();
525
- } finally {
526
- r$2();
527
- }
488
+ function boolean(arg1, arg2) {
489
+ const [message = "Invalid type", pipe2] = getDefaultArgs(arg1, arg2);
490
+ return {
491
+ type: "boolean",
492
+ async: false,
493
+ message,
494
+ pipe: pipe2,
495
+ _parse(input, info) {
496
+ if (typeof input !== "boolean") {
497
+ return getSchemaIssues(info, "type", "boolean", this.message, input);
498
+ }
499
+ return executePipe(input, this.pipe, info, "boolean");
500
+ }
501
+ };
528
502
  }
529
- var o$2 = void 0;
530
- var f$1 = void 0, v$1 = 0, e$1 = 0, u$1 = 0;
531
- function c$1(i2) {
532
- if (void 0 !== o$2) {
533
- var t2 = i2.n;
534
- if (void 0 === t2 || t2.t !== o$2) {
535
- t2 = { i: 0, S: i2, p: o$2.s, n: void 0, t: o$2, e: void 0, x: void 0, r: t2 };
536
- if (void 0 !== o$2.s)
537
- o$2.s.n = t2;
538
- o$2.s = t2;
539
- i2.n = t2;
540
- if (32 & o$2.f)
541
- i2.S(t2);
542
- return t2;
543
- } else if (-1 === t2.i) {
544
- t2.i = 0;
545
- if (void 0 !== t2.n) {
546
- t2.n.p = t2.p;
547
- if (void 0 !== t2.p)
548
- t2.p.n = t2.n;
549
- t2.p = o$2.s;
550
- t2.n = void 0;
551
- o$2.s.n = t2;
552
- o$2.s = t2;
503
+ function number$1(arg1, arg2) {
504
+ const [message = "Invalid type", pipe2] = getDefaultArgs(arg1, arg2);
505
+ return {
506
+ type: "number",
507
+ async: false,
508
+ message,
509
+ pipe: pipe2,
510
+ _parse(input, info) {
511
+ if (typeof input !== "number" || isNaN(input)) {
512
+ return getSchemaIssues(info, "type", "number", this.message, input);
553
513
  }
554
- return t2;
514
+ return executePipe(input, this.pipe, info, "number");
555
515
  }
556
- }
516
+ };
557
517
  }
558
- function d$2(i2) {
559
- this.v = i2;
560
- this.i = 0;
561
- this.n = void 0;
562
- this.t = void 0;
518
+ function object(entries, arg2, arg3, arg4) {
519
+ const [rest, message = "Invalid type", pipe2] = getRestAndDefaultArgs(arg2, arg3, arg4);
520
+ let cachedEntries;
521
+ return {
522
+ type: "object",
523
+ async: false,
524
+ entries,
525
+ rest,
526
+ message,
527
+ pipe: pipe2,
528
+ _parse(input, info) {
529
+ if (!input || typeof input !== "object") {
530
+ return getSchemaIssues(info, "type", "object", this.message, input);
531
+ }
532
+ cachedEntries = cachedEntries || Object.entries(this.entries);
533
+ let issues;
534
+ const output = {};
535
+ for (const [key, schema] of cachedEntries) {
536
+ const value2 = input[key];
537
+ const result = schema._parse(value2, info);
538
+ if (result.issues) {
539
+ const pathItem = {
540
+ type: "object",
541
+ input,
542
+ key,
543
+ value: value2
544
+ };
545
+ for (const issue of result.issues) {
546
+ if (issue.path) {
547
+ issue.path.unshift(pathItem);
548
+ } else {
549
+ issue.path = [pathItem];
550
+ }
551
+ issues == null ? void 0 : issues.push(issue);
552
+ }
553
+ if (!issues) {
554
+ issues = result.issues;
555
+ }
556
+ if (info == null ? void 0 : info.abortEarly) {
557
+ break;
558
+ }
559
+ } else if (result.output !== void 0 || key in input) {
560
+ output[key] = result.output;
561
+ }
562
+ }
563
+ if (this.rest && !((info == null ? void 0 : info.abortEarly) && issues)) {
564
+ for (const key in input) {
565
+ if (!(key in this.entries)) {
566
+ const value2 = input[key];
567
+ const result = this.rest._parse(value2, info);
568
+ if (result.issues) {
569
+ const pathItem = {
570
+ type: "object",
571
+ input,
572
+ key,
573
+ value: value2
574
+ };
575
+ for (const issue of result.issues) {
576
+ if (issue.path) {
577
+ issue.path.unshift(pathItem);
578
+ } else {
579
+ issue.path = [pathItem];
580
+ }
581
+ issues == null ? void 0 : issues.push(issue);
582
+ }
583
+ if (!issues) {
584
+ issues = result.issues;
585
+ }
586
+ if (info == null ? void 0 : info.abortEarly) {
587
+ break;
588
+ }
589
+ } else {
590
+ output[key] = result.output;
591
+ }
592
+ }
593
+ }
594
+ }
595
+ return issues ? getIssues(issues) : executePipe(
596
+ output,
597
+ this.pipe,
598
+ info,
599
+ "object"
600
+ );
601
+ }
602
+ };
563
603
  }
564
- d$2.prototype.brand = t$1;
565
- d$2.prototype.h = function() {
566
- return true;
567
- };
568
- d$2.prototype.S = function(i2) {
569
- if (this.t !== i2 && void 0 === i2.e) {
570
- i2.x = this.t;
571
- if (void 0 !== this.t)
572
- this.t.e = i2;
573
- this.t = i2;
574
- }
575
- };
576
- d$2.prototype.U = function(i2) {
577
- if (void 0 !== this.t) {
578
- var t2 = i2.e, r2 = i2.x;
579
- if (void 0 !== t2) {
580
- t2.x = r2;
581
- i2.e = void 0;
604
+ function picklist(options, message = "Invalid type") {
605
+ return {
606
+ type: "picklist",
607
+ async: false,
608
+ options,
609
+ message,
610
+ _parse(input, info) {
611
+ if (!this.options.includes(input)) {
612
+ return getSchemaIssues(info, "type", "picklist", this.message, input);
613
+ }
614
+ return getOutput(input);
582
615
  }
583
- if (void 0 !== r2) {
584
- r2.e = t2;
585
- i2.x = void 0;
616
+ };
617
+ }
618
+ function string(arg1, arg2) {
619
+ const [message = "Invalid type", pipe2] = getDefaultArgs(arg1, arg2);
620
+ return {
621
+ type: "string",
622
+ async: false,
623
+ message,
624
+ pipe: pipe2,
625
+ _parse(input, info) {
626
+ if (typeof input !== "string") {
627
+ return getSchemaIssues(info, "type", "string", this.message, input);
628
+ }
629
+ return executePipe(input, this.pipe, info, "string");
586
630
  }
587
- if (i2 === this.t)
588
- this.t = r2;
631
+ };
632
+ }
633
+ function getRecordArgs(arg1, arg2, arg3, arg4) {
634
+ if (typeof arg2 === "object" && !Array.isArray(arg2)) {
635
+ const [message2, pipe22] = getDefaultArgs(arg3, arg4);
636
+ return [arg1, arg2, message2, pipe22];
589
637
  }
590
- };
591
- d$2.prototype.subscribe = function(i2) {
592
- var t2 = this;
593
- return O$2(function() {
594
- var r2 = t2.value, n2 = 32 & this.f;
595
- this.f &= -33;
596
- try {
597
- i2(r2);
598
- } finally {
599
- this.f |= n2;
600
- }
601
- });
602
- };
603
- d$2.prototype.valueOf = function() {
604
- return this.value;
605
- };
606
- d$2.prototype.toString = function() {
607
- return this.value + "";
608
- };
609
- d$2.prototype.toJSON = function() {
610
- return this.value;
611
- };
612
- d$2.prototype.peek = function() {
613
- return this.v;
614
- };
615
- Object.defineProperty(d$2.prototype, "value", { get: function() {
616
- var i2 = c$1(this);
617
- if (void 0 !== i2)
618
- i2.i = this.i;
619
- return this.v;
620
- }, set: function(t2) {
621
- if (o$2 instanceof _$3)
622
- !function() {
623
- throw new Error("Computed cannot have side-effects");
624
- }();
625
- if (t2 !== this.v) {
626
- if (e$1 > 100)
627
- i$1();
628
- this.v = t2;
629
- this.i++;
630
- u$1++;
631
- v$1++;
632
- try {
633
- for (var n2 = this.t; void 0 !== n2; n2 = n2.x)
634
- n2.t.N();
635
- } finally {
636
- r$2();
637
- }
638
- }
639
- } });
640
- function a$1(i2) {
641
- return new d$2(i2);
642
- }
643
- function l$2(i2) {
644
- for (var t2 = i2.s; void 0 !== t2; t2 = t2.n)
645
- if (t2.S.i !== t2.i || !t2.S.h() || t2.S.i !== t2.i)
646
- return true;
647
- return false;
638
+ const [message, pipe2] = getDefaultArgs(
639
+ arg2,
640
+ arg3
641
+ );
642
+ return [string(), arg1, message, pipe2];
648
643
  }
649
- function y$1(i2) {
650
- for (var t2 = i2.s; void 0 !== t2; t2 = t2.n) {
651
- var r2 = t2.S.n;
652
- if (void 0 !== r2)
653
- t2.r = r2;
654
- t2.S.n = t2;
655
- t2.i = -1;
656
- if (void 0 === t2.n) {
657
- i2.s = t2;
658
- break;
644
+ var BLOCKED_KEYS = ["__proto__", "prototype", "constructor"];
645
+ function record(arg1, arg2, arg3, arg4) {
646
+ const [key, value2, message = "Invalid type", pipe2] = getRecordArgs(arg1, arg2, arg3, arg4);
647
+ return {
648
+ type: "record",
649
+ async: false,
650
+ key,
651
+ value: value2,
652
+ message,
653
+ pipe: pipe2,
654
+ _parse(input, info) {
655
+ if (!input || typeof input !== "object") {
656
+ return getSchemaIssues(info, "type", "record", this.message, input);
657
+ }
658
+ let issues;
659
+ const output = {};
660
+ for (const [inputKey, inputValue] of Object.entries(input)) {
661
+ if (!BLOCKED_KEYS.includes(inputKey)) {
662
+ let pathItem;
663
+ const keyResult = this.key._parse(inputKey, {
664
+ origin: "key",
665
+ abortEarly: info == null ? void 0 : info.abortEarly,
666
+ abortPipeEarly: info == null ? void 0 : info.abortPipeEarly,
667
+ skipPipe: info == null ? void 0 : info.skipPipe
668
+ });
669
+ if (keyResult.issues) {
670
+ pathItem = {
671
+ type: "record",
672
+ input,
673
+ key: inputKey,
674
+ value: inputValue
675
+ };
676
+ for (const issue of keyResult.issues) {
677
+ issue.path = [pathItem];
678
+ issues == null ? void 0 : issues.push(issue);
679
+ }
680
+ if (!issues) {
681
+ issues = keyResult.issues;
682
+ }
683
+ if (info == null ? void 0 : info.abortEarly) {
684
+ break;
685
+ }
686
+ }
687
+ const valueResult = this.value._parse(inputValue, info);
688
+ if (valueResult.issues) {
689
+ pathItem = pathItem || {
690
+ type: "record",
691
+ input,
692
+ key: inputKey,
693
+ value: inputValue
694
+ };
695
+ for (const issue of valueResult.issues) {
696
+ if (issue.path) {
697
+ issue.path.unshift(pathItem);
698
+ } else {
699
+ issue.path = [pathItem];
700
+ }
701
+ issues == null ? void 0 : issues.push(issue);
702
+ }
703
+ if (!issues) {
704
+ issues = valueResult.issues;
705
+ }
706
+ if (info == null ? void 0 : info.abortEarly) {
707
+ break;
708
+ }
709
+ }
710
+ if (!keyResult.issues && !valueResult.issues) {
711
+ output[keyResult.output] = valueResult.output;
712
+ }
713
+ }
714
+ }
715
+ return issues ? getIssues(issues) : executePipe(
716
+ output,
717
+ this.pipe,
718
+ info,
719
+ "record"
720
+ );
659
721
  }
660
- }
722
+ };
661
723
  }
662
- function w$2(i2) {
663
- var t2 = i2.s, r2 = void 0;
664
- while (void 0 !== t2) {
665
- var n2 = t2.p;
666
- if (-1 === t2.i) {
667
- t2.S.U(t2);
668
- if (void 0 !== n2)
669
- n2.n = t2.n;
670
- if (void 0 !== t2.n)
671
- t2.n.p = n2;
672
- } else
673
- r2 = t2;
674
- t2.S.n = t2.r;
675
- if (void 0 !== t2.r)
676
- t2.r = void 0;
677
- t2 = n2;
724
+ function parse$1(schema, input, info) {
725
+ const result = schema._parse(input, info);
726
+ if (result.issues) {
727
+ throw new ValiError(result.issues);
678
728
  }
679
- i2.s = r2;
680
- }
681
- function _$3(i2) {
682
- d$2.call(this, void 0);
683
- this.x = i2;
684
- this.s = void 0;
685
- this.g = u$1 - 1;
686
- this.f = 4;
729
+ return result.output;
687
730
  }
688
- (_$3.prototype = new d$2()).h = function() {
689
- this.f &= -3;
690
- if (1 & this.f)
691
- return false;
692
- if (32 == (36 & this.f))
693
- return true;
694
- this.f &= -5;
695
- if (this.g === u$1)
696
- return true;
697
- this.g = u$1;
698
- this.f |= 1;
699
- if (this.i > 0 && !l$2(this)) {
700
- this.f &= -2;
701
- return true;
731
+ async function parseAsync(schema, input, info) {
732
+ const result = await schema._parse(input, info);
733
+ if (result.issues) {
734
+ throw new ValiError(result.issues);
702
735
  }
703
- var i2 = o$2;
704
- try {
705
- y$1(this);
706
- o$2 = this;
707
- var t2 = this.x();
708
- if (16 & this.f || this.v !== t2 || 0 === this.i) {
709
- this.v = t2;
710
- this.f &= -17;
711
- this.i++;
736
+ return result.output;
737
+ }
738
+ function transform(schema, action, arg1) {
739
+ return {
740
+ ...schema,
741
+ _parse(input, info) {
742
+ const result = schema._parse(input, info);
743
+ if (result.issues) {
744
+ return result;
745
+ }
746
+ const output = action(result.output);
747
+ if (arg1 && !Array.isArray(arg1)) {
748
+ return arg1._parse(output, info);
749
+ }
750
+ return executePipe(output, arg1, info, typeof output);
712
751
  }
713
- } catch (i3) {
714
- this.v = i3;
715
- this.f |= 16;
716
- this.i++;
717
- }
718
- o$2 = i2;
719
- w$2(this);
720
- this.f &= -2;
721
- return true;
722
- };
723
- _$3.prototype.S = function(i2) {
724
- if (void 0 === this.t) {
725
- this.f |= 36;
726
- for (var t2 = this.s; void 0 !== t2; t2 = t2.n)
727
- t2.S.S(t2);
728
- }
729
- d$2.prototype.S.call(this, i2);
730
- };
731
- _$3.prototype.U = function(i2) {
732
- if (void 0 !== this.t) {
733
- d$2.prototype.U.call(this, i2);
734
- if (void 0 === this.t) {
735
- this.f &= -33;
736
- for (var t2 = this.s; void 0 !== t2; t2 = t2.n)
737
- t2.S.U(t2);
752
+ };
753
+ }
754
+ var EMAIL_REGEX = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
755
+ function email(message = "Invalid email") {
756
+ return {
757
+ type: "email",
758
+ async: false,
759
+ message,
760
+ requirement: EMAIL_REGEX,
761
+ _parse(input) {
762
+ return !this.requirement.test(input) ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
738
763
  }
739
- }
740
- };
741
- _$3.prototype.N = function() {
742
- if (!(2 & this.f)) {
743
- this.f |= 6;
744
- for (var i2 = this.t; void 0 !== i2; i2 = i2.x)
745
- i2.t.N();
746
- }
747
- };
748
- _$3.prototype.peek = function() {
749
- if (!this.h())
750
- i$1();
751
- if (16 & this.f)
752
- throw this.v;
753
- return this.v;
754
- };
755
- Object.defineProperty(_$3.prototype, "value", { get: function() {
756
- if (1 & this.f)
757
- i$1();
758
- var t2 = c$1(this);
759
- this.h();
760
- if (void 0 !== t2)
761
- t2.i = this.i;
762
- if (16 & this.f)
763
- throw this.v;
764
- return this.v;
765
- } });
766
- function p$2(i2) {
767
- return new _$3(i2);
764
+ };
768
765
  }
769
- function g$2(i2) {
770
- var t2 = i2.u;
771
- i2.u = void 0;
772
- if ("function" == typeof t2) {
773
- v$1++;
774
- var n2 = o$2;
775
- o$2 = void 0;
776
- try {
777
- t2();
778
- } catch (t3) {
779
- i2.f &= -2;
780
- i2.f |= 8;
781
- b$1(i2);
782
- throw t3;
783
- } finally {
784
- o$2 = n2;
785
- r$2();
766
+ function maxLength(requirement, message = "Invalid length") {
767
+ return {
768
+ type: "max_length",
769
+ async: false,
770
+ message,
771
+ requirement,
772
+ _parse(input) {
773
+ return input.length > this.requirement ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
786
774
  }
787
- }
775
+ };
788
776
  }
789
- function b$1(i2) {
790
- for (var t2 = i2.s; void 0 !== t2; t2 = t2.n)
791
- t2.S.U(t2);
792
- i2.x = void 0;
793
- i2.s = void 0;
794
- g$2(i2);
795
- }
796
- function x$2(i2) {
797
- if (o$2 !== this)
798
- throw new Error("Out-of-order effect");
799
- w$2(this);
800
- o$2 = i2;
801
- this.f &= -2;
802
- if (8 & this.f)
803
- b$1(this);
804
- r$2();
805
- }
806
- function E$2(i2) {
807
- this.x = i2;
808
- this.u = void 0;
809
- this.s = void 0;
810
- this.o = void 0;
811
- this.f = 32;
812
- }
813
- E$2.prototype.c = function() {
814
- var i2 = this.S();
815
- try {
816
- if (8 & this.f)
817
- return;
818
- if (void 0 === this.x)
819
- return;
820
- var t2 = this.x();
821
- if ("function" == typeof t2)
822
- this.u = t2;
823
- } finally {
824
- i2();
825
- }
826
- };
827
- E$2.prototype.S = function() {
828
- if (1 & this.f)
829
- i$1();
830
- this.f |= 1;
831
- this.f &= -9;
832
- g$2(this);
833
- y$1(this);
834
- v$1++;
835
- var t2 = o$2;
836
- o$2 = this;
837
- return x$2.bind(this, t2);
838
- };
839
- E$2.prototype.N = function() {
840
- if (!(2 & this.f)) {
841
- this.f |= 2;
842
- this.o = f$1;
843
- f$1 = this;
844
- }
845
- };
846
- E$2.prototype.d = function() {
847
- this.f |= 8;
848
- if (!(1 & this.f))
849
- b$1(this);
850
- };
851
- function O$2(i2) {
852
- var t2 = new E$2(i2);
853
- try {
854
- t2.c();
855
- } catch (i3) {
856
- t2.d();
857
- throw i3;
858
- }
859
- return t2.d.bind(t2);
860
- }
861
- var s$1;
862
- function l$1(n2, i2) {
863
- l$4[n2] = i2.bind(null, l$4[n2] || function() {
864
- });
865
- }
866
- function d$1(n2) {
867
- if (s$1)
868
- s$1();
869
- s$1 = n2 && n2.S();
870
- }
871
- function p$1(n2) {
872
- var r2 = this, f2 = n2.data, o2 = useSignal(f2);
873
- o2.value = f2;
874
- var e2 = F$1(function() {
875
- var n3 = r2.__v;
876
- while (n3 = n3.__)
877
- if (n3.__c) {
878
- n3.__c.__$f |= 4;
879
- break;
880
- }
881
- r2.__$u.c = function() {
882
- var n4;
883
- if (!t$3(e2.peek()) && 3 === (null == (n4 = r2.base) ? void 0 : n4.nodeType))
884
- r2.base.data = e2.peek();
885
- else {
886
- r2.__$f |= 1;
887
- r2.setState({});
888
- }
889
- };
890
- return p$2(function() {
891
- var n4 = o2.value.value;
892
- return 0 === n4 ? 0 : true === n4 ? "" : n4 || "";
893
- });
894
- }, []);
895
- return e2.value;
896
- }
897
- p$1.displayName = "_st";
898
- Object.defineProperties(d$2.prototype, { constructor: { configurable: true, value: void 0 }, type: { configurable: true, value: p$1 }, props: { configurable: true, get: function() {
899
- return { data: this };
900
- } }, __b: { configurable: true, value: 1 } });
901
- l$1("__b", function(n2, r2) {
902
- if ("string" == typeof r2.type) {
903
- var i2, t2 = r2.props;
904
- for (var f2 in t2)
905
- if ("children" !== f2) {
906
- var o2 = t2[f2];
907
- if (o2 instanceof d$2) {
908
- if (!i2)
909
- r2.__np = i2 = {};
910
- i2[f2] = o2;
911
- t2[f2] = o2.peek();
912
- }
913
- }
914
- }
915
- n2(r2);
916
- });
917
- l$1("__r", function(n2, r2) {
918
- d$1();
919
- var i2, t2 = r2.__c;
920
- if (t2) {
921
- t2.__$f &= -2;
922
- if (void 0 === (i2 = t2.__$u))
923
- t2.__$u = i2 = function(n3) {
924
- var r3;
925
- O$2(function() {
926
- r3 = this;
927
- });
928
- r3.c = function() {
929
- t2.__$f |= 1;
930
- t2.setState({});
931
- };
932
- return r3;
933
- }();
934
- }
935
- d$1(i2);
936
- n2(r2);
937
- });
938
- l$1("__e", function(n2, r2, i2, t2) {
939
- d$1();
940
- n2(r2, i2, t2);
941
- });
942
- l$1("diffed", function(n2, r2) {
943
- d$1();
944
- var i2;
945
- if ("string" == typeof r2.type && (i2 = r2.__e)) {
946
- var t2 = r2.__np, f2 = r2.props;
947
- if (t2) {
948
- var o2 = i2.U;
949
- if (o2)
950
- for (var e2 in o2) {
951
- var u2 = o2[e2];
952
- if (void 0 !== u2 && !(e2 in t2)) {
953
- u2.d();
954
- o2[e2] = void 0;
955
- }
956
- }
957
- else
958
- i2.U = o2 = {};
959
- for (var a2 in t2) {
960
- var c2 = o2[a2], s2 = t2[a2];
961
- if (void 0 === c2) {
962
- c2 = _$2(i2, a2, s2, f2);
963
- o2[a2] = c2;
964
- } else
965
- c2.o(s2, f2);
966
- }
967
- }
968
- }
969
- n2(r2);
970
- });
971
- function _$2(n2, r2, i2, t2) {
972
- var f2 = r2 in n2 && void 0 === n2.ownerSVGElement, o2 = a$1(i2);
973
- return { o: function(n3, r3) {
974
- o2.value = n3;
975
- t2 = r3;
976
- }, d: O$2(function() {
977
- var i3 = o2.value.value;
978
- if (t2[r2] !== i3) {
979
- t2[r2] = i3;
980
- if (f2)
981
- n2[r2] = i3;
982
- else if (i3)
983
- n2.setAttribute(r2, i3);
984
- else
985
- n2.removeAttribute(r2);
777
+ function minLength(requirement, message = "Invalid length") {
778
+ return {
779
+ type: "min_length",
780
+ async: false,
781
+ message,
782
+ requirement,
783
+ _parse(input) {
784
+ return input.length < this.requirement ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
986
785
  }
987
- }) };
786
+ };
988
787
  }
989
- l$1("unmount", function(n2, r2) {
990
- if ("string" == typeof r2.type) {
991
- var i2 = r2.__e;
992
- if (i2) {
993
- var t2 = i2.U;
994
- if (t2) {
995
- i2.U = void 0;
996
- for (var f2 in t2) {
997
- var o2 = t2[f2];
998
- if (o2)
999
- o2.d();
1000
- }
1001
- }
788
+ function regex(requirement, message = "Invalid regex") {
789
+ return {
790
+ type: "regex",
791
+ async: false,
792
+ message,
793
+ requirement,
794
+ _parse(input) {
795
+ return !this.requirement.test(input) ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
1002
796
  }
1003
- } else {
1004
- var e2 = r2.__c;
1005
- if (e2) {
1006
- var u2 = e2.__$u;
1007
- if (u2) {
1008
- e2.__$u = void 0;
1009
- u2.d();
797
+ };
798
+ }
799
+ function url(message = "Invalid URL") {
800
+ return {
801
+ type: "url",
802
+ async: false,
803
+ message,
804
+ requirement(input) {
805
+ try {
806
+ new URL(input);
807
+ return true;
808
+ } catch {
809
+ return false;
1010
810
  }
811
+ },
812
+ _parse(input) {
813
+ return !this.requirement(input) ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
1011
814
  }
1012
- }
1013
- n2(r2);
1014
- });
1015
- l$1("__h", function(n2, r2, i2, t2) {
1016
- if (t2 < 3 || 9 === t2)
1017
- r2.__$f |= 2;
1018
- n2(r2, i2, t2);
1019
- });
1020
- b$3.prototype.shouldComponentUpdate = function(n2, r2) {
1021
- var i2 = this.__$u;
1022
- if (!(i2 && void 0 !== i2.s || 4 & this.__$f))
1023
- return true;
1024
- if (3 & this.__$f)
1025
- return true;
1026
- for (var t2 in r2)
1027
- return true;
1028
- for (var f2 in n2)
1029
- if ("__source" !== f2 && n2[f2] !== this.props[f2])
1030
- return true;
1031
- for (var o2 in this.props)
1032
- if (!(o2 in n2))
1033
- return true;
1034
- return false;
1035
- };
1036
- function useSignal(n2) {
1037
- return F$1(function() {
1038
- return a$1(n2);
1039
- }, []);
815
+ };
1040
816
  }
1041
817
  var exhaustive = (value) => {
1042
818
  throw new Error(`Unhandled discriminated union member: ${JSON.stringify(value)}`);
@@ -1064,37 +840,207 @@ function _extends() {
1064
840
  };
1065
841
  return _extends.apply(this, arguments);
1066
842
  }
1067
- function g$1(n2, t2) {
1068
- for (var e2 in t2)
1069
- n2[e2] = t2[e2];
1070
- return n2;
1071
- }
1072
- function C(n2, t2) {
1073
- for (var e2 in n2)
1074
- if ("__source" !== e2 && !(e2 in t2))
1075
- return true;
1076
- for (var r2 in t2)
1077
- if ("__source" !== r2 && n2[r2] !== t2[r2])
1078
- return true;
1079
- return false;
1080
- }
1081
- function E$1(n2, t2) {
1082
- return n2 === t2 && (0 !== n2 || 1 / n2 == 1 / t2) || n2 != n2 && t2 != t2;
843
+ var t$2, r$3, u$2, i$2, o$3 = 0, f$2 = [], c$2 = [], e$2 = l$4.__b, a$2 = l$4.__r, v$2 = l$4.diffed, l$3 = l$4.__c, m$2 = l$4.unmount;
844
+ function d$3(t2, u2) {
845
+ l$4.__h && l$4.__h(r$3, t2, o$3 || u2), o$3 = 0;
846
+ var i2 = r$3.__H || (r$3.__H = { __: [], __h: [] });
847
+ return t2 >= i2.__.length && i2.__.push({ __V: c$2 }), i2.__[t2];
1083
848
  }
1084
- function w$1(n2) {
1085
- this.props = n2;
849
+ function h$1(n2) {
850
+ return o$3 = 1, s$2(B$2, n2);
1086
851
  }
1087
- function x$1(n2, e2) {
1088
- function r2(n3) {
1089
- var t2 = this.props.ref, r3 = t2 == n3.ref;
1090
- return !r3 && t2 && (t2.call ? t2(null) : t2.current = null), e2 ? !e2(this.props, n3) || !r3 : C(this.props, n3);
1091
- }
1092
- function u2(e3) {
1093
- return this.shouldComponentUpdate = r2, y$3(n2, e3);
1094
- }
852
+ function s$2(n2, u2, i2) {
853
+ var o2 = d$3(t$2++, 2);
854
+ if (o2.t = n2, !o2.__c && (o2.__ = [i2 ? i2(u2) : B$2(void 0, u2), function(n3) {
855
+ var t2 = o2.__N ? o2.__N[0] : o2.__[0], r2 = o2.t(t2, n3);
856
+ t2 !== r2 && (o2.__N = [r2, o2.__[1]], o2.__c.setState({}));
857
+ }], o2.__c = r$3, !r$3.u)) {
858
+ var f2 = function(n3, t2, r2) {
859
+ if (!o2.__c.__H)
860
+ return true;
861
+ var u3 = o2.__c.__H.__.filter(function(n4) {
862
+ return n4.__c;
863
+ });
864
+ if (u3.every(function(n4) {
865
+ return !n4.__N;
866
+ }))
867
+ return !c2 || c2.call(this, n3, t2, r2);
868
+ var i3 = false;
869
+ return u3.forEach(function(n4) {
870
+ if (n4.__N) {
871
+ var t3 = n4.__[0];
872
+ n4.__ = n4.__N, n4.__N = void 0, t3 !== n4.__[0] && (i3 = true);
873
+ }
874
+ }), !(!i3 && o2.__c.props === n3) && (!c2 || c2.call(this, n3, t2, r2));
875
+ };
876
+ r$3.u = true;
877
+ var c2 = r$3.shouldComponentUpdate, e2 = r$3.componentWillUpdate;
878
+ r$3.componentWillUpdate = function(n3, t2, r2) {
879
+ if (this.__e) {
880
+ var u3 = c2;
881
+ c2 = void 0, f2(n3, t2, r2), c2 = u3;
882
+ }
883
+ e2 && e2.call(this, n3, t2, r2);
884
+ }, r$3.shouldComponentUpdate = f2;
885
+ }
886
+ return o2.__N || o2.__;
887
+ }
888
+ function p$3(u2, i2) {
889
+ var o2 = d$3(t$2++, 3);
890
+ !l$4.__s && z$1(o2.__H, i2) && (o2.__ = u2, o2.i = i2, r$3.__H.__h.push(o2));
891
+ }
892
+ function y$2(u2, i2) {
893
+ var o2 = d$3(t$2++, 4);
894
+ !l$4.__s && z$1(o2.__H, i2) && (o2.__ = u2, o2.i = i2, r$3.__h.push(o2));
895
+ }
896
+ function _$4(n2) {
897
+ return o$3 = 5, F$1(function() {
898
+ return { current: n2 };
899
+ }, []);
900
+ }
901
+ function A$2(n2, t2, r2) {
902
+ o$3 = 6, y$2(function() {
903
+ return "function" == typeof n2 ? (n2(t2()), function() {
904
+ return n2(null);
905
+ }) : n2 ? (n2.current = t2(), function() {
906
+ return n2.current = null;
907
+ }) : void 0;
908
+ }, null == r2 ? r2 : r2.concat(n2));
909
+ }
910
+ function F$1(n2, r2) {
911
+ var u2 = d$3(t$2++, 7);
912
+ return z$1(u2.__H, r2) ? (u2.__V = n2(), u2.i = r2, u2.__h = n2, u2.__V) : u2.__;
913
+ }
914
+ function T$2(n2, t2) {
915
+ return o$3 = 8, F$1(function() {
916
+ return n2;
917
+ }, t2);
918
+ }
919
+ function q$1(n2) {
920
+ var u2 = r$3.context[n2.__c], i2 = d$3(t$2++, 9);
921
+ return i2.c = n2, u2 ? (null == i2.__ && (i2.__ = true, u2.sub(r$3)), u2.props.value) : n2.__;
922
+ }
923
+ function x$3(t2, r2) {
924
+ l$4.useDebugValue && l$4.useDebugValue(r2 ? r2(t2) : t2);
925
+ }
926
+ function P$2(n2) {
927
+ var u2 = d$3(t$2++, 10), i2 = h$1();
928
+ return u2.__ = n2, r$3.componentDidCatch || (r$3.componentDidCatch = function(n3, t2) {
929
+ u2.__ && u2.__(n3, t2), i2[1](n3);
930
+ }), [i2[0], function() {
931
+ i2[1](void 0);
932
+ }];
933
+ }
934
+ function V$1() {
935
+ var n2 = d$3(t$2++, 11);
936
+ if (!n2.__) {
937
+ for (var u2 = r$3.__v; null !== u2 && !u2.__m && null !== u2.__; )
938
+ u2 = u2.__;
939
+ var i2 = u2.__m || (u2.__m = [0, 0]);
940
+ n2.__ = "P" + i2[0] + "-" + i2[1]++;
941
+ }
942
+ return n2.__;
943
+ }
944
+ function b$2() {
945
+ for (var t2; t2 = f$2.shift(); )
946
+ if (t2.__P && t2.__H)
947
+ try {
948
+ t2.__H.__h.forEach(k$2), t2.__H.__h.forEach(w$3), t2.__H.__h = [];
949
+ } catch (r2) {
950
+ t2.__H.__h = [], l$4.__e(r2, t2.__v);
951
+ }
952
+ }
953
+ l$4.__b = function(n2) {
954
+ r$3 = null, e$2 && e$2(n2);
955
+ }, l$4.__r = function(n2) {
956
+ a$2 && a$2(n2), t$2 = 0;
957
+ var i2 = (r$3 = n2.__c).__H;
958
+ i2 && (u$2 === r$3 ? (i2.__h = [], r$3.__h = [], i2.__.forEach(function(n3) {
959
+ n3.__N && (n3.__ = n3.__N), n3.__V = c$2, n3.__N = n3.i = void 0;
960
+ })) : (i2.__h.forEach(k$2), i2.__h.forEach(w$3), i2.__h = [], t$2 = 0)), u$2 = r$3;
961
+ }, l$4.diffed = function(t2) {
962
+ v$2 && v$2(t2);
963
+ var o2 = t2.__c;
964
+ o2 && o2.__H && (o2.__H.__h.length && (1 !== f$2.push(o2) && i$2 === l$4.requestAnimationFrame || ((i$2 = l$4.requestAnimationFrame) || j$2)(b$2)), o2.__H.__.forEach(function(n2) {
965
+ n2.i && (n2.__H = n2.i), n2.__V !== c$2 && (n2.__ = n2.__V), n2.i = void 0, n2.__V = c$2;
966
+ })), u$2 = r$3 = null;
967
+ }, l$4.__c = function(t2, r2) {
968
+ r2.some(function(t3) {
969
+ try {
970
+ t3.__h.forEach(k$2), t3.__h = t3.__h.filter(function(n2) {
971
+ return !n2.__ || w$3(n2);
972
+ });
973
+ } catch (u2) {
974
+ r2.some(function(n2) {
975
+ n2.__h && (n2.__h = []);
976
+ }), r2 = [], l$4.__e(u2, t3.__v);
977
+ }
978
+ }), l$3 && l$3(t2, r2);
979
+ }, l$4.unmount = function(t2) {
980
+ m$2 && m$2(t2);
981
+ var r2, u2 = t2.__c;
982
+ u2 && u2.__H && (u2.__H.__.forEach(function(n2) {
983
+ try {
984
+ k$2(n2);
985
+ } catch (n3) {
986
+ r2 = n3;
987
+ }
988
+ }), u2.__H = void 0, r2 && l$4.__e(r2, u2.__v));
989
+ };
990
+ var g$3 = "function" == typeof requestAnimationFrame;
991
+ function j$2(n2) {
992
+ var t2, r2 = function() {
993
+ clearTimeout(u2), g$3 && cancelAnimationFrame(t2), setTimeout(n2);
994
+ }, u2 = setTimeout(r2, 100);
995
+ g$3 && (t2 = requestAnimationFrame(r2));
996
+ }
997
+ function k$2(n2) {
998
+ var t2 = r$3, u2 = n2.__c;
999
+ "function" == typeof u2 && (n2.__c = void 0, u2()), r$3 = t2;
1000
+ }
1001
+ function w$3(n2) {
1002
+ var t2 = r$3;
1003
+ n2.__c = n2.__(), r$3 = t2;
1004
+ }
1005
+ function z$1(n2, t2) {
1006
+ return !n2 || n2.length !== t2.length || t2.some(function(t3, r2) {
1007
+ return t3 !== n2[r2];
1008
+ });
1009
+ }
1010
+ function B$2(n2, t2) {
1011
+ return "function" == typeof t2 ? t2(n2) : t2;
1012
+ }
1013
+ function g$2(n2, t2) {
1014
+ for (var e2 in t2)
1015
+ n2[e2] = t2[e2];
1016
+ return n2;
1017
+ }
1018
+ function C(n2, t2) {
1019
+ for (var e2 in n2)
1020
+ if ("__source" !== e2 && !(e2 in t2))
1021
+ return true;
1022
+ for (var r2 in t2)
1023
+ if ("__source" !== r2 && n2[r2] !== t2[r2])
1024
+ return true;
1025
+ return false;
1026
+ }
1027
+ function E$2(n2, t2) {
1028
+ return n2 === t2 && (0 !== n2 || 1 / n2 == 1 / t2) || n2 != n2 && t2 != t2;
1029
+ }
1030
+ function w$2(n2) {
1031
+ this.props = n2;
1032
+ }
1033
+ function x$2(n2, e2) {
1034
+ function r2(n3) {
1035
+ var t2 = this.props.ref, r3 = t2 == n3.ref;
1036
+ return !r3 && t2 && (t2.call ? t2(null) : t2.current = null), e2 ? !e2(this.props, n3) || !r3 : C(this.props, n3);
1037
+ }
1038
+ function u2(e3) {
1039
+ return this.shouldComponentUpdate = r2, y$3(n2, e3);
1040
+ }
1095
1041
  return u2.displayName = "Memo(" + (n2.displayName || n2.name) + ")", u2.prototype.isReactComponent = true, u2.__f = true, u2;
1096
1042
  }
1097
- (w$1.prototype = new b$3()).isPureReactComponent = true, w$1.prototype.shouldComponentUpdate = function(n2, t2) {
1043
+ (w$2.prototype = new b$3()).isPureReactComponent = true, w$2.prototype.shouldComponentUpdate = function(n2, t2) {
1098
1044
  return C(this.props, n2) || C(this.state, t2);
1099
1045
  };
1100
1046
  var R = l$4.__b;
@@ -1104,14 +1050,14 @@ l$4.__b = function(n2) {
1104
1050
  var N$1 = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.forward_ref") || 3911;
1105
1051
  function k$1(n2) {
1106
1052
  function t2(t3) {
1107
- var e2 = g$1({}, t3);
1053
+ var e2 = g$2({}, t3);
1108
1054
  return delete e2.ref, n2(e2, t3.ref || null);
1109
1055
  }
1110
1056
  return t2.$$typeof = N$1, t2.render = t2, t2.prototype.isReactComponent = t2.__f = true, t2.displayName = "ForwardRef(" + (n2.displayName || n2.name) + ")", t2;
1111
1057
  }
1112
1058
  var A$1 = function(n2, t2) {
1113
1059
  return null == n2 ? null : S$1(S$1(n2).map(t2));
1114
- }, O$1 = { map: A$1, forEach: A$1, count: function(n2) {
1060
+ }, O$2 = { map: A$1, forEach: A$1, count: function(n2) {
1115
1061
  return n2 ? S$1(n2).length : 0;
1116
1062
  }, only: function(n2) {
1117
1063
  var t2 = S$1(n2);
@@ -1131,7 +1077,7 @@ var I = l$4.unmount;
1131
1077
  function L(n2, t2, e2) {
1132
1078
  return n2 && (n2.__c && n2.__c.__H && (n2.__c.__H.__.forEach(function(n3) {
1133
1079
  "function" == typeof n3.__c && n3.__c();
1134
- }), n2.__c.__H = null), null != (n2 = g$1({}, n2)).__c && (n2.__c.__P === e2 && (n2.__c.__P = t2), n2.__c = null), n2.__k = n2.__k && n2.__k.map(function(n3) {
1080
+ }), n2.__c.__H = null), null != (n2 = g$2({}, n2)).__c && (n2.__c.__P === e2 && (n2.__c.__P = t2), n2.__c = null), n2.__k = n2.__k && n2.__k.map(function(n3) {
1135
1081
  return L(n3, t2, e2);
1136
1082
  })), n2;
1137
1083
  }
@@ -1346,20 +1292,20 @@ var Sn = y$2;
1346
1292
  function gn(n2, t2) {
1347
1293
  var e2 = t2(), r2 = h$1({ h: { __: e2, v: t2 } }), u2 = r2[0].h, o2 = r2[1];
1348
1294
  return y$2(function() {
1349
- u2.__ = e2, u2.v = t2, E$1(u2.__, t2()) || o2({ h: u2 });
1295
+ u2.__ = e2, u2.v = t2, E$2(u2.__, t2()) || o2({ h: u2 });
1350
1296
  }, [n2, e2, t2]), p$3(function() {
1351
- return E$1(u2.__, u2.v()) || o2({ h: u2 }), n2(function() {
1352
- E$1(u2.__, u2.v()) || o2({ h: u2 });
1297
+ return E$2(u2.__, u2.v()) || o2({ h: u2 }), n2(function() {
1298
+ E$2(u2.__, u2.v()) || o2({ h: u2 });
1353
1299
  });
1354
1300
  }, [n2]), e2;
1355
1301
  }
1356
- var Cn = { useState: h$1, useId: V$1, useReducer: s$2, useEffect: p$3, useLayoutEffect: y$2, useInsertionEffect: Sn, useTransition: bn, useDeferredValue: _n, useSyncExternalStore: gn, startTransition: yn, useRef: _$4, useImperativeHandle: A$2, useMemo: F$1, useCallback: T$2, useContext: q$1, useDebugValue: x$3, version: "17.0.2", Children: O$1, render: G, hydrate: J, unmountComponentAtNode: hn, createPortal: z, createElement: y$3, createContext: G$1, createFactory: fn, cloneElement: sn, createRef: _$5, Fragment: k$3, isValidElement: an, findDOMNode: vn, Component: b$3, PureComponent: w$1, memo: x$1, forwardRef: k$1, flushSync: pn, unstable_batchedUpdates: dn, StrictMode: mn, Suspense: D, SuspenseList: V, lazy: M, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ln };
1302
+ var Cn = { useState: h$1, useId: V$1, useReducer: s$2, useEffect: p$3, useLayoutEffect: y$2, useInsertionEffect: Sn, useTransition: bn, useDeferredValue: _n, useSyncExternalStore: gn, startTransition: yn, useRef: _$4, useImperativeHandle: A$2, useMemo: F$1, useCallback: T$2, useContext: q$1, useDebugValue: x$3, version: "17.0.2", Children: O$2, render: G, hydrate: J, unmountComponentAtNode: hn, createPortal: z, createElement: y$3, createContext: G$1, createFactory: fn, cloneElement: sn, createRef: _$5, Fragment: k$3, isValidElement: an, findDOMNode: vn, Component: b$3, PureComponent: w$2, memo: x$2, forwardRef: k$1, flushSync: pn, unstable_batchedUpdates: dn, StrictMode: mn, Suspense: D, SuspenseList: V, lazy: M, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ln };
1357
1303
  const $2AODx$react = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1358
1304
  __proto__: null,
1359
- Children: O$1,
1305
+ Children: O$2,
1360
1306
  Component: b$3,
1361
1307
  Fragment: k$3,
1362
- PureComponent: w$1,
1308
+ PureComponent: w$2,
1363
1309
  StrictMode: mn,
1364
1310
  Suspense: D,
1365
1311
  SuspenseList: V,
@@ -1377,7 +1323,7 @@ const $2AODx$react = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
1377
1323
  hydrate: J,
1378
1324
  isValidElement: an,
1379
1325
  lazy: M,
1380
- memo: x$1,
1326
+ memo: x$2,
1381
1327
  render: G,
1382
1328
  startTransition: yn,
1383
1329
  unmountComponentAtNode: hn,
@@ -1591,14 +1537,14 @@ function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
1591
1537
  }
1592
1538
  const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ k$1((props, forwardedRef) => {
1593
1539
  const { children, ...slotProps } = props;
1594
- const childrenArray = O$1.toArray(children);
1540
+ const childrenArray = O$2.toArray(children);
1595
1541
  const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
1596
1542
  if (slottable) {
1597
1543
  const newElement = slottable.props.children;
1598
1544
  const newChildren = childrenArray.map((child) => {
1599
1545
  if (child === slottable) {
1600
- if (O$1.count(newElement) > 1)
1601
- return O$1.only(null);
1546
+ if (O$2.count(newElement) > 1)
1547
+ return O$2.only(null);
1602
1548
  return /* @__PURE__ */ an(newElement) ? newElement.props.children : null;
1603
1549
  } else
1604
1550
  return child;
@@ -1619,7 +1565,7 @@ const $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ k$1((props, forwardedRef
1619
1565
  ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
1620
1566
  ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
1621
1567
  });
1622
- return O$1.count(children) > 1 ? O$1.only(null) : null;
1568
+ return O$2.count(children) > 1 ? O$2.only(null) : null;
1623
1569
  });
1624
1570
  $5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
1625
1571
  const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => {
@@ -2184,7 +2130,7 @@ const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props) => {
2184
2130
  const presence = $921a889cee6df7e8$var$usePresence(present);
2185
2131
  const child = typeof children === "function" ? children({
2186
2132
  present: presence.isPresent
2187
- }) : O$1.only(children);
2133
+ }) : O$2.only(children);
2188
2134
  const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
2189
2135
  const forceMount = typeof children === "function";
2190
2136
  return forceMount || presence.isPresent ? /* @__PURE__ */ sn(child, {
@@ -2510,7 +2456,7 @@ var RemoveScroll = k$1(function(props, parentRef) {
2510
2456
  k$3,
2511
2457
  null,
2512
2458
  enabled && y$3(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref }),
2513
- forwardProps ? sn(O$1.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : y$3(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
2459
+ forwardProps ? sn(O$2.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : y$3(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
2514
2460
  );
2515
2461
  });
2516
2462
  RemoveScroll.defaultProps = {
@@ -2602,7 +2548,7 @@ var zeroGap = {
2602
2548
  right: 0,
2603
2549
  gap: 0
2604
2550
  };
2605
- var parse$1 = function(x2) {
2551
+ var parse = function(x2) {
2606
2552
  return parseInt(x2 || "", 10) || 0;
2607
2553
  };
2608
2554
  var getOffset = function(gapMode) {
@@ -2610,7 +2556,7 @@ var getOffset = function(gapMode) {
2610
2556
  var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
2611
2557
  var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
2612
2558
  var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
2613
- return [parse$1(left), parse$1(top), parse$1(right)];
2559
+ return [parse(left), parse(top), parse(right)];
2614
2560
  };
2615
2561
  var getGapWidth = function(gapMode) {
2616
2562
  if (gapMode === void 0) {
@@ -3538,17 +3484,17 @@ const getValueAsType = (value, type) => {
3538
3484
  return type && typeof value === "number" ? type.transform(value) : value;
3539
3485
  };
3540
3486
  const clamp = (min, max, v2) => Math.min(Math.max(v2, min), max);
3541
- const number$1 = {
3487
+ const number = {
3542
3488
  test: (v2) => typeof v2 === "number",
3543
3489
  parse: parseFloat,
3544
3490
  transform: (v2) => v2
3545
3491
  };
3546
3492
  const alpha = {
3547
- ...number$1,
3493
+ ...number,
3548
3494
  transform: (v2) => clamp(0, 1, v2)
3549
3495
  };
3550
3496
  const scale = {
3551
- ...number$1,
3497
+ ...number,
3552
3498
  default: 1
3553
3499
  };
3554
3500
  const sanitize = (v2) => Math.round(v2 * 1e5) / 1e5;
@@ -3574,7 +3520,7 @@ const progressPercentage = {
3574
3520
  transform: (v2) => percent.transform(v2 * 100)
3575
3521
  };
3576
3522
  const int = {
3577
- ...number$1,
3523
+ ...number,
3578
3524
  transform: Math.round
3579
3525
  };
3580
3526
  const numberValueTypes = {
@@ -4722,7 +4668,7 @@ const splitColor = (aName, bName, cName) => (v2) => {
4722
4668
  };
4723
4669
  const clampRgbUnit = (v2) => clamp(0, 255, v2);
4724
4670
  const rgbUnit = {
4725
- ...number$1,
4671
+ ...number,
4726
4672
  transform: (v2) => Math.round(clampRgbUnit(v2))
4727
4673
  };
4728
4674
  const rgba = {
@@ -4868,7 +4814,7 @@ const numberTokeniser = {
4868
4814
  regex: floatRegex,
4869
4815
  countKey: "Numbers",
4870
4816
  token: "${n}",
4871
- parse: number$1.parse
4817
+ parse: number.parse
4872
4818
  };
4873
4819
  function tokenise(info, { regex: regex2, countKey, token, parse: parse2 }) {
4874
4820
  const matches = info.tokenised.match(regex2);
@@ -6187,7 +6133,7 @@ const auto = {
6187
6133
  test: (v2) => v2 === "auto",
6188
6134
  parse: (v2) => v2
6189
6135
  };
6190
- const dimensionValueTypes = [number$1, px, percent, degrees, vw, vh, auto];
6136
+ const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];
6191
6137
  const findDimensionValueType = (v2) => dimensionValueTypes.find(testValueType(v2));
6192
6138
  const valueTypes = [...dimensionValueTypes, color, complex];
6193
6139
  const findValueType = (v2) => valueTypes.find(testValueType(v2));
@@ -6689,7 +6635,7 @@ const isPositionalKey = (key) => positionalKeys.has(key);
6689
6635
  const hasPositionalKey = (target) => {
6690
6636
  return Object.keys(target).some(isPositionalKey);
6691
6637
  };
6692
- const isNumOrPxType = (v2) => v2 === number$1 || v2 === px;
6638
+ const isNumOrPxType = (v2) => v2 === number || v2 === px;
6693
6639
  const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
6694
6640
  const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform2 }) => {
6695
6641
  if (transform2 === "none" || !transform2)
@@ -7509,7 +7455,7 @@ function updateChildLookup(children, allChildren) {
7509
7455
  }
7510
7456
  function onlyElements(children) {
7511
7457
  const filtered = [];
7512
- O$1.forEach(children, (child) => {
7458
+ O$2.forEach(children, (child) => {
7513
7459
  if (an(child))
7514
7460
  filtered.push(child);
7515
7461
  });
@@ -7620,13 +7566,13 @@ const domAnimation = {
7620
7566
  ...animations,
7621
7567
  ...gestureAnimations
7622
7568
  };
7623
- const t = Symbol.for("@ts-pattern/matcher"), e = Symbol.for("@ts-pattern/isVariadic"), n = "@ts-pattern/anonymous-select-key", r$1 = (t2) => Boolean(t2 && "object" == typeof t2), i = (e2) => e2 && !!e2[t], s = (n2, o2, c2) => {
7624
- if (i(n2)) {
7625
- const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(o2);
7569
+ const t$1 = Symbol.for("@ts-pattern/matcher"), e$1 = Symbol.for("@ts-pattern/isVariadic"), n = "@ts-pattern/anonymous-select-key", r$2 = (t2) => Boolean(t2 && "object" == typeof t2), i$1 = (e2) => e2 && !!e2[t$1], s$1 = (n2, o2, c2) => {
7570
+ if (i$1(n2)) {
7571
+ const e2 = n2[t$1](), { matched: r2, selections: i2 } = e2.match(o2);
7626
7572
  return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
7627
7573
  }
7628
- if (r$1(n2)) {
7629
- if (!r$1(o2))
7574
+ if (r$2(n2)) {
7575
+ if (!r$2(o2))
7630
7576
  return false;
7631
7577
  if (Array.isArray(n2)) {
7632
7578
  if (!Array.isArray(o2))
@@ -7634,7 +7580,7 @@ const t = Symbol.for("@ts-pattern/matcher"), e = Symbol.for("@ts-pattern/isVaria
7634
7580
  let t2 = [], r2 = [], a2 = [];
7635
7581
  for (const s2 of n2.keys()) {
7636
7582
  const o3 = n2[s2];
7637
- i(o3) && o3[e] ? a2.push(o3) : a2.length ? r2.push(o3) : t2.push(o3);
7583
+ i$1(o3) && o3[e$1] ? a2.push(o3) : a2.length ? r2.push(o3) : t2.push(o3);
7638
7584
  }
7639
7585
  if (a2.length) {
7640
7586
  if (a2.length > 1)
@@ -7642,124 +7588,124 @@ const t = Symbol.for("@ts-pattern/matcher"), e = Symbol.for("@ts-pattern/isVaria
7642
7588
  if (o2.length < t2.length + r2.length)
7643
7589
  return false;
7644
7590
  const e2 = o2.slice(0, t2.length), n3 = 0 === r2.length ? [] : o2.slice(-r2.length), i2 = o2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
7645
- return t2.every((t3, n4) => s(t3, e2[n4], c2)) && r2.every((t3, e3) => s(t3, n3[e3], c2)) && (0 === a2.length || s(a2[0], i2, c2));
7591
+ return t2.every((t3, n4) => s$1(t3, e2[n4], c2)) && r2.every((t3, e3) => s$1(t3, n3[e3], c2)) && (0 === a2.length || s$1(a2[0], i2, c2));
7646
7592
  }
7647
- return n2.length === o2.length && n2.every((t3, e2) => s(t3, o2[e2], c2));
7593
+ return n2.length === o2.length && n2.every((t3, e2) => s$1(t3, o2[e2], c2));
7648
7594
  }
7649
7595
  return Object.keys(n2).every((e2) => {
7650
7596
  const r2 = n2[e2];
7651
- return (e2 in o2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && s(r2, o2[e2], c2);
7597
+ return (e2 in o2 || i$1(a2 = r2) && "optional" === a2[t$1]().matcherType) && s$1(r2, o2[e2], c2);
7652
7598
  var a2;
7653
7599
  });
7654
7600
  }
7655
7601
  return Object.is(o2, n2);
7656
- }, o$1 = (e2) => {
7602
+ }, o$2 = (e2) => {
7657
7603
  var n2, s2, a2;
7658
- return r$1(e2) ? i(e2) ? null != (n2 = null == (s2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : s2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, o$1) : c(Object.values(e2), o$1) : [];
7659
- }, c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
7660
- function a(...t2) {
7604
+ return r$2(e2) ? i$1(e2) ? null != (n2 = null == (s2 = (a2 = e2[t$1]()).getSelectionKeys) ? void 0 : s2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c$1(e2, o$2) : c$1(Object.values(e2), o$2) : [];
7605
+ }, c$1 = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
7606
+ function a$1(...t2) {
7661
7607
  if (1 === t2.length) {
7662
7608
  const [e2] = t2;
7663
- return (t3) => s(e2, t3, () => {
7609
+ return (t3) => s$1(e2, t3, () => {
7664
7610
  });
7665
7611
  }
7666
7612
  if (2 === t2.length) {
7667
7613
  const [e2, n2] = t2;
7668
- return s(e2, n2, () => {
7614
+ return s$1(e2, n2, () => {
7669
7615
  });
7670
7616
  }
7671
7617
  throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
7672
7618
  }
7673
- function u(t2) {
7674
- return Object.assign(t2, { optional: () => l(t2), and: (e2) => m(t2, e2), or: (e2) => y(t2, e2), select: (e2) => void 0 === e2 ? p(t2) : p(e2, t2) });
7619
+ function u$1(t2) {
7620
+ return Object.assign(t2, { optional: () => l$2(t2), and: (e2) => m(t2, e2), or: (e2) => y$1(t2, e2), select: (e2) => void 0 === e2 ? p$2(t2) : p$2(e2, t2) });
7675
7621
  }
7676
7622
  function h(t2) {
7677
7623
  return Object.assign(((t3) => Object.assign(t3, { *[Symbol.iterator]() {
7678
- yield Object.assign(t3, { [e]: true });
7679
- } }))(t2), { optional: () => h(l(t2)), select: (e2) => h(void 0 === e2 ? p(t2) : p(e2, t2)) });
7624
+ yield Object.assign(t3, { [e$1]: true });
7625
+ } }))(t2), { optional: () => h(l$2(t2)), select: (e2) => h(void 0 === e2 ? p$2(t2) : p$2(e2, t2)) });
7680
7626
  }
7681
- function l(e2) {
7682
- return u({ [t]: () => ({ match: (t2) => {
7627
+ function l$2(e2) {
7628
+ return u$1({ [t$1]: () => ({ match: (t2) => {
7683
7629
  let n2 = {};
7684
7630
  const r2 = (t3, e3) => {
7685
7631
  n2[t3] = e3;
7686
7632
  };
7687
- return void 0 === t2 ? (o$1(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: s(e2, t2, r2), selections: n2 };
7688
- }, getSelectionKeys: () => o$1(e2), matcherType: "optional" }) });
7633
+ return void 0 === t2 ? (o$2(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: s$1(e2, t2, r2), selections: n2 };
7634
+ }, getSelectionKeys: () => o$2(e2), matcherType: "optional" }) });
7689
7635
  }
7690
- const f = (t2, e2) => {
7636
+ const f$1 = (t2, e2) => {
7691
7637
  for (const n2 of t2)
7692
7638
  if (!e2(n2))
7693
7639
  return false;
7694
7640
  return true;
7695
- }, g = (t2, e2) => {
7641
+ }, g$1 = (t2, e2) => {
7696
7642
  for (const [n2, r2] of t2.entries())
7697
7643
  if (!e2(r2, n2))
7698
7644
  return false;
7699
7645
  return true;
7700
7646
  };
7701
7647
  function m(...e2) {
7702
- return u({ [t]: () => ({ match: (t2) => {
7648
+ return u$1({ [t$1]: () => ({ match: (t2) => {
7703
7649
  let n2 = {};
7704
7650
  const r2 = (t3, e3) => {
7705
7651
  n2[t3] = e3;
7706
7652
  };
7707
- return { matched: e2.every((e3) => s(e3, t2, r2)), selections: n2 };
7708
- }, getSelectionKeys: () => c(e2, o$1), matcherType: "and" }) });
7653
+ return { matched: e2.every((e3) => s$1(e3, t2, r2)), selections: n2 };
7654
+ }, getSelectionKeys: () => c$1(e2, o$2), matcherType: "and" }) });
7709
7655
  }
7710
- function y(...e2) {
7711
- return u({ [t]: () => ({ match: (t2) => {
7656
+ function y$1(...e2) {
7657
+ return u$1({ [t$1]: () => ({ match: (t2) => {
7712
7658
  let n2 = {};
7713
7659
  const r2 = (t3, e3) => {
7714
7660
  n2[t3] = e3;
7715
7661
  };
7716
- return c(e2, o$1).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => s(e3, t2, r2)), selections: n2 };
7717
- }, getSelectionKeys: () => c(e2, o$1), matcherType: "or" }) });
7662
+ return c$1(e2, o$2).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => s$1(e3, t2, r2)), selections: n2 };
7663
+ }, getSelectionKeys: () => c$1(e2, o$2), matcherType: "or" }) });
7718
7664
  }
7719
- function d(e2) {
7720
- return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
7665
+ function d$2(e2) {
7666
+ return { [t$1]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
7721
7667
  }
7722
- function p(...e2) {
7668
+ function p$2(...e2) {
7723
7669
  const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
7724
- return u({ [t]: () => ({ match: (t2) => {
7670
+ return u$1({ [t$1]: () => ({ match: (t2) => {
7725
7671
  let e3 = { [null != r2 ? r2 : n]: t2 };
7726
- return { matched: void 0 === i2 || s(i2, t2, (t3, n2) => {
7672
+ return { matched: void 0 === i2 || s$1(i2, t2, (t3, n2) => {
7727
7673
  e3[t3] = n2;
7728
7674
  }), selections: e3 };
7729
- }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : o$1(i2)) }) });
7675
+ }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : o$2(i2)) }) });
7730
7676
  }
7731
- function v(t2) {
7677
+ function v$1(t2) {
7732
7678
  return "number" == typeof t2;
7733
7679
  }
7734
- function b(t2) {
7680
+ function b$1(t2) {
7735
7681
  return "string" == typeof t2;
7736
7682
  }
7737
- function w(t2) {
7683
+ function w$1(t2) {
7738
7684
  return "bigint" == typeof t2;
7739
7685
  }
7740
- const S = u(d(function(t2) {
7686
+ const S = u$1(d$2(function(t2) {
7741
7687
  return true;
7742
- })), O = S, j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
7743
- return j(m(t2, (n2 = e2, d((t3) => b(t3) && t3.startsWith(n2)))));
7688
+ })), O$1 = S, j = (t2) => Object.assign(u$1(t2), { startsWith: (e2) => {
7689
+ return j(m(t2, (n2 = e2, d$2((t3) => b$1(t3) && t3.startsWith(n2)))));
7744
7690
  var n2;
7745
7691
  }, endsWith: (e2) => {
7746
- return j(m(t2, (n2 = e2, d((t3) => b(t3) && t3.endsWith(n2)))));
7692
+ return j(m(t2, (n2 = e2, d$2((t3) => b$1(t3) && t3.endsWith(n2)))));
7747
7693
  var n2;
7748
- }, minLength: (e2) => j(m(t2, ((t3) => d((e3) => b(e3) && e3.length >= t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => d((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
7749
- return j(m(t2, (n2 = e2, d((t3) => b(t3) && t3.includes(n2)))));
7694
+ }, minLength: (e2) => j(m(t2, ((t3) => d$2((e3) => b$1(e3) && e3.length >= t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => d$2((e3) => b$1(e3) && e3.length <= t3))(e2))), includes: (e2) => {
7695
+ return j(m(t2, (n2 = e2, d$2((t3) => b$1(t3) && t3.includes(n2)))));
7750
7696
  var n2;
7751
7697
  }, regex: (e2) => {
7752
- return j(m(t2, (n2 = e2, d((t3) => b(t3) && Boolean(t3.match(n2))))));
7698
+ return j(m(t2, (n2 = e2, d$2((t3) => b$1(t3) && Boolean(t3.match(n2))))));
7753
7699
  var n2;
7754
- } }), E = j(d(b)), K = (t2) => Object.assign(u(t2), { between: (e2, n2) => K(m(t2, ((t3, e3) => d((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => K(m(t2, ((t3) => d((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => K(m(t2, ((t3) => d((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => K(m(t2, ((t3) => d((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => K(m(t2, ((t3) => d((e3) => v(e3) && e3 >= t3))(e2))), int: () => K(m(t2, d((t3) => v(t3) && Number.isInteger(t3)))), finite: () => K(m(t2, d((t3) => v(t3) && Number.isFinite(t3)))), positive: () => K(m(t2, d((t3) => v(t3) && t3 > 0))), negative: () => K(m(t2, d((t3) => v(t3) && t3 < 0))) }), A = K(d(v)), x = (t2) => Object.assign(u(t2), { between: (e2, n2) => x(m(t2, ((t3, e3) => d((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => x(m(t2, ((t3) => d((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => x(m(t2, ((t3) => d((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => x(m(t2, ((t3) => d((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => x(m(t2, ((t3) => d((e3) => w(e3) && e3 >= t3))(e2))), positive: () => x(m(t2, d((t3) => w(t3) && t3 > 0))), negative: () => x(m(t2, d((t3) => w(t3) && t3 < 0))) }), P = x(d(w)), T = u(d(function(t2) {
7700
+ } }), E$1 = j(d$2(b$1)), K = (t2) => Object.assign(u$1(t2), { between: (e2, n2) => K(m(t2, ((t3, e3) => d$2((n3) => v$1(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => K(m(t2, ((t3) => d$2((e3) => v$1(e3) && e3 < t3))(e2))), gt: (e2) => K(m(t2, ((t3) => d$2((e3) => v$1(e3) && e3 > t3))(e2))), lte: (e2) => K(m(t2, ((t3) => d$2((e3) => v$1(e3) && e3 <= t3))(e2))), gte: (e2) => K(m(t2, ((t3) => d$2((e3) => v$1(e3) && e3 >= t3))(e2))), int: () => K(m(t2, d$2((t3) => v$1(t3) && Number.isInteger(t3)))), finite: () => K(m(t2, d$2((t3) => v$1(t3) && Number.isFinite(t3)))), positive: () => K(m(t2, d$2((t3) => v$1(t3) && t3 > 0))), negative: () => K(m(t2, d$2((t3) => v$1(t3) && t3 < 0))) }), A = K(d$2(v$1)), x$1 = (t2) => Object.assign(u$1(t2), { between: (e2, n2) => x$1(m(t2, ((t3, e3) => d$2((n3) => w$1(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => x$1(m(t2, ((t3) => d$2((e3) => w$1(e3) && e3 < t3))(e2))), gt: (e2) => x$1(m(t2, ((t3) => d$2((e3) => w$1(e3) && e3 > t3))(e2))), lte: (e2) => x$1(m(t2, ((t3) => d$2((e3) => w$1(e3) && e3 <= t3))(e2))), gte: (e2) => x$1(m(t2, ((t3) => d$2((e3) => w$1(e3) && e3 >= t3))(e2))), positive: () => x$1(m(t2, d$2((t3) => w$1(t3) && t3 > 0))), negative: () => x$1(m(t2, d$2((t3) => w$1(t3) && t3 < 0))) }), P = x$1(d$2(w$1)), T = u$1(d$2(function(t2) {
7755
7701
  return "boolean" == typeof t2;
7756
- })), k = u(d(function(t2) {
7702
+ })), k = u$1(d$2(function(t2) {
7757
7703
  return "symbol" == typeof t2;
7758
- })), B = u(d(function(t2) {
7704
+ })), B = u$1(d$2(function(t2) {
7759
7705
  return null == t2;
7760
7706
  }));
7761
- var _$1 = { __proto__: null, matcher: t, optional: l, array: function(...e2) {
7762
- return h({ [t]: () => ({ match: (t2) => {
7707
+ var _$3 = { __proto__: null, matcher: t$1, optional: l$2, array: function(...e2) {
7708
+ return h({ [t$1]: () => ({ match: (t2) => {
7763
7709
  if (!Array.isArray(t2))
7764
7710
  return { matched: false };
7765
7711
  if (0 === e2.length)
@@ -7767,16 +7713,16 @@ var _$1 = { __proto__: null, matcher: t, optional: l, array: function(...e2) {
7767
7713
  const n2 = e2[0];
7768
7714
  let r2 = {};
7769
7715
  if (0 === t2.length)
7770
- return o$1(n2).forEach((t3) => {
7716
+ return o$2(n2).forEach((t3) => {
7771
7717
  r2[t3] = [];
7772
7718
  }), { matched: true, selections: r2 };
7773
7719
  const i2 = (t3, e3) => {
7774
7720
  r2[t3] = (r2[t3] || []).concat([e3]);
7775
7721
  };
7776
- return { matched: t2.every((t3) => s(n2, t3, i2)), selections: r2 };
7777
- }, getSelectionKeys: () => 0 === e2.length ? [] : o$1(e2[0]) }) });
7722
+ return { matched: t2.every((t3) => s$1(n2, t3, i2)), selections: r2 };
7723
+ }, getSelectionKeys: () => 0 === e2.length ? [] : o$2(e2[0]) }) });
7778
7724
  }, set: function(...e2) {
7779
- return u({ [t]: () => ({ match: (t2) => {
7725
+ return u$1({ [t$1]: () => ({ match: (t2) => {
7780
7726
  if (!(t2 instanceof Set))
7781
7727
  return { matched: false };
7782
7728
  let n2 = {};
@@ -7787,10 +7733,10 @@ var _$1 = { __proto__: null, matcher: t, optional: l, array: function(...e2) {
7787
7733
  const r2 = (t3, e3) => {
7788
7734
  n2[t3] = (n2[t3] || []).concat([e3]);
7789
7735
  }, i2 = e2[0];
7790
- return { matched: f(t2, (t3) => s(i2, t3, r2)), selections: n2 };
7791
- }, getSelectionKeys: () => 0 === e2.length ? [] : o$1(e2[0]) }) });
7736
+ return { matched: f$1(t2, (t3) => s$1(i2, t3, r2)), selections: n2 };
7737
+ }, getSelectionKeys: () => 0 === e2.length ? [] : o$2(e2[0]) }) });
7792
7738
  }, map: function(...e2) {
7793
- return u({ [t]: () => ({ match: (t2) => {
7739
+ return u$1({ [t$1]: () => ({ match: (t2) => {
7794
7740
  if (!(t2 instanceof Map))
7795
7741
  return { matched: false };
7796
7742
  let n2 = {};
@@ -7805,20 +7751,20 @@ var _$1 = { __proto__: null, matcher: t, optional: l, array: function(...e2) {
7805
7751
  if (1 === e2.length)
7806
7752
  throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
7807
7753
  const [o2, c2] = e2;
7808
- return { matched: g(t2, (t3, e3) => {
7809
- const n3 = s(o2, e3, r2), i3 = s(c2, t3, r2);
7754
+ return { matched: g$1(t2, (t3, e3) => {
7755
+ const n3 = s$1(o2, e3, r2), i3 = s$1(c2, t3, r2);
7810
7756
  return n3 && i3;
7811
7757
  }), selections: n2 };
7812
- }, getSelectionKeys: () => 0 === e2.length ? [] : [...o$1(e2[0]), ...o$1(e2[1])] }) });
7813
- }, intersection: m, union: y, not: function(e2) {
7814
- return u({ [t]: () => ({ match: (t2) => ({ matched: !s(e2, t2, () => {
7758
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...o$2(e2[0]), ...o$2(e2[1])] }) });
7759
+ }, intersection: m, union: y$1, not: function(e2) {
7760
+ return u$1({ [t$1]: () => ({ match: (t2) => ({ matched: !s$1(e2, t2, () => {
7815
7761
  }) }), getSelectionKeys: () => [], matcherType: "not" }) });
7816
- }, when: d, select: p, any: S, _: O, string: E, number: A, bigint: P, boolean: T, symbol: k, nullish: B, instanceOf: function(t2) {
7817
- return u(d(function(t3) {
7762
+ }, when: d$2, select: p$2, any: S, _: O$1, string: E$1, number: A, bigint: P, boolean: T, symbol: k, nullish: B, instanceOf: function(t2) {
7763
+ return u$1(d$2(function(t3) {
7818
7764
  return (e2) => e2 instanceof t3;
7819
7765
  }(t2)));
7820
7766
  }, shape: function(t2) {
7821
- return u(d(a(t2)));
7767
+ return u$1(d$2(a$1(t2)));
7822
7768
  } };
7823
7769
  const W = { matched: false, value: void 0 };
7824
7770
  function N(t2) {
@@ -7837,7 +7783,7 @@ class $ {
7837
7783
  let o2 = false, c2 = {};
7838
7784
  const a2 = (t3, e3) => {
7839
7785
  o2 = true, c2[t3] = e3;
7840
- }, u2 = !r2.some((t3) => s(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? W : { matched: true, value: e2(o2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
7786
+ }, u2 = !r2.some((t3) => s$1(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? W : { matched: true, value: e2(o2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
7841
7787
  return new $(this.input, u2);
7842
7788
  }
7843
7789
  when(t2, e2) {
@@ -7875,1225 +7821,1426 @@ const ERROR_MESSAGES = {
7875
7821
  no_submissions: "Application ended without any fields submitted",
7876
7822
  invalid_state: "Invalid state"
7877
7823
  };
7878
- function promisifyRequest(request) {
7879
- return new Promise((resolve, reject) => {
7880
- request.oncomplete = request.onsuccess = () => resolve(request.result);
7881
- request.onabort = request.onerror = () => reject(request.error);
7882
- });
7824
+ function i() {
7825
+ throw new Error("Cycle detected");
7883
7826
  }
7884
- function createStore(dbName, storeName) {
7885
- const request = indexedDB.open(dbName);
7886
- request.onupgradeneeded = () => request.result.createObjectStore(storeName);
7887
- const dbp = promisifyRequest(request);
7888
- return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
7827
+ var t = Symbol.for("preact-signals");
7828
+ function r$1() {
7829
+ if (!(v > 1)) {
7830
+ var i2, t2 = false;
7831
+ while (void 0 !== f) {
7832
+ var r2 = f;
7833
+ f = void 0;
7834
+ e++;
7835
+ while (void 0 !== r2) {
7836
+ var n2 = r2.o;
7837
+ r2.o = void 0;
7838
+ r2.f &= -3;
7839
+ if (!(8 & r2.f) && l$1(r2))
7840
+ try {
7841
+ r2.c();
7842
+ } catch (r3) {
7843
+ if (!t2) {
7844
+ i2 = r3;
7845
+ t2 = true;
7846
+ }
7847
+ }
7848
+ r2 = n2;
7849
+ }
7850
+ }
7851
+ e = 0;
7852
+ v--;
7853
+ if (t2)
7854
+ throw i2;
7855
+ } else
7856
+ v--;
7889
7857
  }
7890
- let defaultGetStoreFunc;
7891
- function defaultGetStore() {
7892
- if (!defaultGetStoreFunc) {
7893
- defaultGetStoreFunc = createStore("keyval-store", "keyval");
7858
+ var o$1 = void 0;
7859
+ var f = void 0, v = 0, e = 0, u = 0;
7860
+ function c(i2) {
7861
+ if (void 0 !== o$1) {
7862
+ var t2 = i2.n;
7863
+ if (void 0 === t2 || t2.t !== o$1) {
7864
+ t2 = { i: 0, S: i2, p: o$1.s, n: void 0, t: o$1, e: void 0, x: void 0, r: t2 };
7865
+ if (void 0 !== o$1.s)
7866
+ o$1.s.n = t2;
7867
+ o$1.s = t2;
7868
+ i2.n = t2;
7869
+ if (32 & o$1.f)
7870
+ i2.S(t2);
7871
+ return t2;
7872
+ } else if (-1 === t2.i) {
7873
+ t2.i = 0;
7874
+ if (void 0 !== t2.n) {
7875
+ t2.n.p = t2.p;
7876
+ if (void 0 !== t2.p)
7877
+ t2.p.n = t2.n;
7878
+ t2.p = o$1.s;
7879
+ t2.n = void 0;
7880
+ o$1.s.n = t2;
7881
+ o$1.s = t2;
7882
+ }
7883
+ return t2;
7884
+ }
7894
7885
  }
7895
- return defaultGetStoreFunc;
7896
- }
7897
- function get(key, customStore = defaultGetStore()) {
7898
- return customStore("readonly", (store2) => promisifyRequest(store2.get(key)));
7899
7886
  }
7900
- function set(key, value, customStore = defaultGetStore()) {
7901
- return customStore("readwrite", (store2) => {
7902
- store2.put(value, key);
7903
- return promisifyRequest(store2.transaction);
7904
- });
7887
+ function d$1(i2) {
7888
+ this.v = i2;
7889
+ this.i = 0;
7890
+ this.n = void 0;
7891
+ this.t = void 0;
7905
7892
  }
7906
- const store = typeof window === "undefined" ? void 0 : createStore("inploi", "applications");
7907
- const idb = {
7908
- getApplicationData: async (application2) => {
7909
- const key = getCacheKey(application2);
7910
- return await get(key, store);
7911
- },
7912
- setApplicationData: async (params) => {
7913
- const key = getCacheKey(params.application);
7914
- return await set(key, params.data, store);
7915
- }
7893
+ d$1.prototype.brand = t;
7894
+ d$1.prototype.h = function() {
7895
+ return true;
7916
7896
  };
7917
- const getChatbotFlowProgress = (nodes, node, onCalculate, stepsMade = 0) => {
7918
- if (!node.nextId) {
7919
- onCalculate(node.id, {
7920
- stepsMade,
7921
- remainingSteps: 0
7922
- });
7923
- return {
7924
- stepsMade,
7925
- remainingSteps: 0
7926
- };
7927
- }
7928
- const nextNode = nodes.find((newNode) => newNode.id === node.nextId);
7929
- if (nextNode === void 0) {
7930
- return {
7931
- stepsMade,
7932
- remainingSteps: 0
7933
- };
7897
+ d$1.prototype.S = function(i2) {
7898
+ if (this.t !== i2 && void 0 === i2.e) {
7899
+ i2.x = this.t;
7900
+ if (void 0 !== this.t)
7901
+ this.t.e = i2;
7902
+ this.t = i2;
7934
7903
  }
7935
- const branchId = node.type === "if-block" ? node.branchId : void 0;
7936
- const branchNode = nodes.find((node2) => node2.id === branchId);
7937
- const increment = node.type.includes("question") ? 1 : 0;
7938
- if (branchNode) {
7939
- const remainingSteps2 = increment + Math.max(getChatbotFlowProgress(nodes, nextNode, onCalculate, stepsMade + increment).remainingSteps, getChatbotFlowProgress(nodes, branchNode, onCalculate, stepsMade + increment).remainingSteps);
7940
- onCalculate(node.id, {
7941
- stepsMade,
7942
- remainingSteps: remainingSteps2
7943
- });
7944
- return {
7945
- stepsMade,
7946
- remainingSteps: remainingSteps2
7947
- };
7904
+ };
7905
+ d$1.prototype.U = function(i2) {
7906
+ if (void 0 !== this.t) {
7907
+ var t2 = i2.e, r2 = i2.x;
7908
+ if (void 0 !== t2) {
7909
+ t2.x = r2;
7910
+ i2.e = void 0;
7911
+ }
7912
+ if (void 0 !== r2) {
7913
+ r2.e = t2;
7914
+ i2.x = void 0;
7915
+ }
7916
+ if (i2 === this.t)
7917
+ this.t = r2;
7948
7918
  }
7949
- const remainingSteps = increment + getChatbotFlowProgress(nodes, nextNode, onCalculate, stepsMade + increment).remainingSteps;
7950
- onCalculate(node.id, {
7951
- stepsMade,
7952
- remainingSteps
7953
- });
7954
- return {
7955
- stepsMade,
7956
- remainingSteps
7957
- };
7958
7919
  };
7959
- const getNodesProgress = (nodes) => {
7960
- const nodeIdToProgress = {};
7961
- const firstNode = nodes.find((node) => node.isHead);
7962
- if (!firstNode)
7963
- return nodeIdToProgress;
7964
- getChatbotFlowProgress(nodes, firstNode, (nodeId, progress2) => {
7965
- nodeIdToProgress[nodeId] = progress2;
7920
+ d$1.prototype.subscribe = function(i2) {
7921
+ var t2 = this;
7922
+ return O(function() {
7923
+ var r2 = t2.value, n2 = 32 & this.f;
7924
+ this.f &= -33;
7925
+ try {
7926
+ i2(r2);
7927
+ } finally {
7928
+ this.f |= n2;
7929
+ }
7966
7930
  });
7967
- return nodeIdToProgress;
7968
7931
  };
7969
- const getCacheKey = (application2) => [application2.job.id, application2.flow.id, application2.flow.version].join("/");
7970
- const viewState = a$1("maximised");
7971
- const inputHeight = a$1(53);
7972
- const currentApplication = a$1({
7973
- state: "idle"
7974
- });
7975
- const updateApplicationData = (updateFn) => {
7976
- const {
7977
- state,
7978
- application: application2
7979
- } = currentApplication.value;
7980
- if (state !== "loaded")
7981
- return;
7982
- invariant$1(application2, "No application to update");
7983
- const newData = updateFn(application2.data);
7984
- const newApplication = {
7985
- ...application2,
7986
- data: newData
7987
- };
7988
- currentApplication.value = {
7989
- state,
7990
- application: newApplication
7991
- };
7992
- idb.setApplicationData({
7993
- application: application2,
7994
- data: newData
7995
- });
7932
+ d$1.prototype.valueOf = function() {
7933
+ return this.value;
7996
7934
  };
7997
- const application = {
7998
- current$: currentApplication,
7999
- start: async (application2) => {
8000
- const data = await idb.getApplicationData(application2) ?? createNewApplicationData();
8001
- const nodeIdToProgress = getNodesProgress(application2.flow.nodes);
8002
- currentApplication.value = {
8003
- state: "loaded",
8004
- application: {
8005
- ...application2,
8006
- data,
8007
- startedAt: /* @__PURE__ */ new Date(),
8008
- nodeIdToProgress
8009
- }
8010
- };
8011
- idb.setApplicationData({
8012
- application: application2,
8013
- data
8014
- });
8015
- },
8016
- cancel: () => {
8017
- currentApplication.value = {
8018
- state: "idle"
8019
- };
8020
- },
8021
- markAsFinished: () => updateApplicationData((data) => ({
8022
- ...data,
8023
- isFinished: true
8024
- })),
8025
- setCurrentNodeId: (currentNodeId) => updateApplicationData((data) => ({
8026
- ...data,
8027
- currentNodeId
8028
- })),
8029
- restart: () => {
8030
- const {
8031
- state,
8032
- application: application2
8033
- } = currentApplication.value;
8034
- if (state !== "loaded")
8035
- throw new Error("Application cannot be restarted: not in valid state");
8036
- const data = createNewApplicationData();
8037
- currentApplication.value = {
8038
- state,
8039
- application: {
8040
- ...application2,
8041
- data,
8042
- startedAt: /* @__PURE__ */ new Date()
8043
- }
8044
- };
8045
- idb.setApplicationData({
8046
- application: application2,
8047
- data
8048
- });
8049
- },
8050
- addMessage: (message, groupId) => {
8051
- const newMessage = {
8052
- ...message,
8053
- groupId
8054
- };
8055
- return updateApplicationData((data) => ({
8056
- ...data,
8057
- messages: [...data.messages, newMessage]
8058
- }));
8059
- },
8060
- /** Removes from the last message backwards, all the messages that have the groupId passed, until it reaches one that doesn't */
8061
- removeLastGroupMessagesById: (groupId) => {
8062
- var _a;
8063
- const {
8064
- state,
8065
- application: application2
8066
- } = currentApplication.value;
8067
- invariant$1(state === "loaded", "Application not loaded");
8068
- const messages = [...application2.data.messages];
8069
- let i2 = messages.length - 1;
8070
- while (i2 >= 0 && messages[i2] && ((_a = messages[i2]) == null ? void 0 : _a.groupId) === groupId) {
8071
- messages.pop();
8072
- i2--;
8073
- }
8074
- application2.data.messages = messages;
8075
- idb.setApplicationData({
8076
- application: application2,
8077
- data: application2.data
8078
- });
8079
- },
8080
- setSubmission: (fieldKey, submission) => updateApplicationData((data) => {
8081
- const newSubmissions = {
8082
- ...data.submissions
8083
- };
8084
- if (submission === null) {
8085
- delete newSubmissions[fieldKey];
8086
- } else {
8087
- newSubmissions[fieldKey] = submission;
7935
+ d$1.prototype.toString = function() {
7936
+ return this.value + "";
7937
+ };
7938
+ d$1.prototype.toJSON = function() {
7939
+ return this.value;
7940
+ };
7941
+ d$1.prototype.peek = function() {
7942
+ return this.v;
7943
+ };
7944
+ Object.defineProperty(d$1.prototype, "value", { get: function() {
7945
+ var i2 = c(this);
7946
+ if (void 0 !== i2)
7947
+ i2.i = this.i;
7948
+ return this.v;
7949
+ }, set: function(t2) {
7950
+ if (o$1 instanceof _$2)
7951
+ !function() {
7952
+ throw new Error("Computed cannot have side-effects");
7953
+ }();
7954
+ if (t2 !== this.v) {
7955
+ if (e > 100)
7956
+ i();
7957
+ this.v = t2;
7958
+ this.i++;
7959
+ u++;
7960
+ v++;
7961
+ try {
7962
+ for (var n2 = this.t; void 0 !== n2; n2 = n2.x)
7963
+ n2.t.N();
7964
+ } finally {
7965
+ r$1();
8088
7966
  }
8089
- return {
8090
- ...data,
8091
- submissions: newSubmissions
8092
- };
8093
- }),
8094
- setInput: (input) => updateApplicationData((data) => ({
8095
- ...data,
8096
- currentInput: input
8097
- }))
7967
+ }
7968
+ } });
7969
+ function a(i2) {
7970
+ return new d$1(i2);
7971
+ }
7972
+ function l$1(i2) {
7973
+ for (var t2 = i2.s; void 0 !== t2; t2 = t2.n)
7974
+ if (t2.S.i !== t2.i || !t2.S.h() || t2.S.i !== t2.i)
7975
+ return true;
7976
+ return false;
7977
+ }
7978
+ function y(i2) {
7979
+ for (var t2 = i2.s; void 0 !== t2; t2 = t2.n) {
7980
+ var r2 = t2.S.n;
7981
+ if (void 0 !== r2)
7982
+ t2.r = r2;
7983
+ t2.S.n = t2;
7984
+ t2.i = -1;
7985
+ if (void 0 === t2.n) {
7986
+ i2.s = t2;
7987
+ break;
7988
+ }
7989
+ }
7990
+ }
7991
+ function w(i2) {
7992
+ var t2 = i2.s, r2 = void 0;
7993
+ while (void 0 !== t2) {
7994
+ var n2 = t2.p;
7995
+ if (-1 === t2.i) {
7996
+ t2.S.U(t2);
7997
+ if (void 0 !== n2)
7998
+ n2.n = t2.n;
7999
+ if (void 0 !== t2.n)
8000
+ t2.n.p = n2;
8001
+ } else
8002
+ r2 = t2;
8003
+ t2.S.n = t2.r;
8004
+ if (void 0 !== t2.r)
8005
+ t2.r = void 0;
8006
+ t2 = n2;
8007
+ }
8008
+ i2.s = r2;
8009
+ }
8010
+ function _$2(i2) {
8011
+ d$1.call(this, void 0);
8012
+ this.x = i2;
8013
+ this.s = void 0;
8014
+ this.g = u - 1;
8015
+ this.f = 4;
8016
+ }
8017
+ (_$2.prototype = new d$1()).h = function() {
8018
+ this.f &= -3;
8019
+ if (1 & this.f)
8020
+ return false;
8021
+ if (32 == (36 & this.f))
8022
+ return true;
8023
+ this.f &= -5;
8024
+ if (this.g === u)
8025
+ return true;
8026
+ this.g = u;
8027
+ this.f |= 1;
8028
+ if (this.i > 0 && !l$1(this)) {
8029
+ this.f &= -2;
8030
+ return true;
8031
+ }
8032
+ var i2 = o$1;
8033
+ try {
8034
+ y(this);
8035
+ o$1 = this;
8036
+ var t2 = this.x();
8037
+ if (16 & this.f || this.v !== t2 || 0 === this.i) {
8038
+ this.v = t2;
8039
+ this.f &= -17;
8040
+ this.i++;
8041
+ }
8042
+ } catch (i3) {
8043
+ this.v = i3;
8044
+ this.f |= 16;
8045
+ this.i++;
8046
+ }
8047
+ o$1 = i2;
8048
+ w(this);
8049
+ this.f &= -2;
8050
+ return true;
8098
8051
  };
8099
- const genRandomId = () => typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : Math.random().toString(36).slice(2);
8100
- const createNewApplicationData = () => ({
8101
- messages: [],
8102
- submissions: {},
8103
- currentNodeId: null,
8104
- isFinished: false,
8105
- sequence: 0,
8106
- flowSessionId: genRandomId()
8107
- });
8108
- var _ = 0;
8109
- function o(o2, e2, n2, t2, f2, l2) {
8110
- var s2, u2, a2 = {};
8111
- for (u2 in e2)
8112
- "ref" == u2 ? s2 = e2[u2] : a2[u2] = e2[u2];
8113
- var i2 = { type: o2, props: a2, key: n2, ref: s2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --_, __source: f2, __self: l2 };
8114
- if ("function" == typeof o2 && (s2 = o2.defaultProps))
8115
- for (u2 in s2)
8116
- void 0 === a2[u2] && (a2[u2] = s2[u2]);
8117
- return l$4.vnode && l$4.vnode(i2), i2;
8052
+ _$2.prototype.S = function(i2) {
8053
+ if (void 0 === this.t) {
8054
+ this.f |= 36;
8055
+ for (var t2 = this.s; void 0 !== t2; t2 = t2.n)
8056
+ t2.S.S(t2);
8057
+ }
8058
+ d$1.prototype.S.call(this, i2);
8059
+ };
8060
+ _$2.prototype.U = function(i2) {
8061
+ if (void 0 !== this.t) {
8062
+ d$1.prototype.U.call(this, i2);
8063
+ if (void 0 === this.t) {
8064
+ this.f &= -33;
8065
+ for (var t2 = this.s; void 0 !== t2; t2 = t2.n)
8066
+ t2.S.U(t2);
8067
+ }
8068
+ }
8069
+ };
8070
+ _$2.prototype.N = function() {
8071
+ if (!(2 & this.f)) {
8072
+ this.f |= 6;
8073
+ for (var i2 = this.t; void 0 !== i2; i2 = i2.x)
8074
+ i2.t.N();
8075
+ }
8076
+ };
8077
+ _$2.prototype.peek = function() {
8078
+ if (!this.h())
8079
+ i();
8080
+ if (16 & this.f)
8081
+ throw this.v;
8082
+ return this.v;
8083
+ };
8084
+ Object.defineProperty(_$2.prototype, "value", { get: function() {
8085
+ if (1 & this.f)
8086
+ i();
8087
+ var t2 = c(this);
8088
+ this.h();
8089
+ if (void 0 !== t2)
8090
+ t2.i = this.i;
8091
+ if (16 & this.f)
8092
+ throw this.v;
8093
+ return this.v;
8094
+ } });
8095
+ function p$1(i2) {
8096
+ return new _$2(i2);
8118
8097
  }
8119
- const ChatError = ({
8120
- message
8121
- }) => {
8122
- return o("div", {
8123
- class: "flex flex-grow flex-col items-center justify-center",
8124
- children: [o("svg", {
8125
- class: "text-error-9 h-16 w-16",
8126
- fill: "none",
8127
- xmlns: "http://www.w3.org/2000/svg",
8128
- "stroke-width": "2",
8129
- stroke: "currentColor",
8130
- "stroke-linecap": "round",
8131
- viewBox: "0 0 96 96",
8132
- children: [o("path", {
8133
- d: "M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z",
8134
- fill: "#fff"
8135
- }), o("path", {
8136
- d: "M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z"
8137
- }), o("line", {
8138
- x1: "36.7",
8139
- y1: "39.3",
8140
- x2: "44.8",
8141
- y2: "47.4"
8142
- }), o("line", {
8143
- x1: "52.2",
8144
- y1: "39.3",
8145
- x2: "60.3",
8146
- y2: "47.4"
8147
- }), o("line", {
8148
- x1: "44.7",
8149
- y1: "39.2",
8150
- x2: "36.6",
8151
- y2: "47.3"
8152
- }), o("line", {
8153
- x1: "60.2",
8154
- y1: "39.2",
8155
- x2: "52.1",
8156
- y2: "47.3"
8157
- }), o("path", {
8158
- d: "M38 56h19"
8159
- })]
8160
- }), o("div", {
8161
- class: "flex flex-col gap-2 text-center",
8162
- children: [o("p", {
8163
- class: "text-error-11 font-bold",
8164
- children: "Something unexpected happened"
8165
- }), message && o("p", {
8166
- class: "text-neutral-9 text-sm",
8167
- children: message
8168
- })]
8169
- })]
8170
- });
8171
- };
8172
- const LoadingIndicator = (props) => o("svg", {
8173
- role: "img",
8174
- viewBox: "0 0 24 24",
8175
- ...props,
8176
- children: [o("title", {
8177
- children: "Loading"
8178
- }), o("style", {
8179
- children: `#s1{animation:3s linear infinite forwards s1__to}@keyframes s1__to{0%{transform:translate(12px,0)}66.666667%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,12px)}}#s2{animation:3s linear infinite forwards s2__ts}@keyframes s2__ts{0%{transform:scale(0,0)}70%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%{transform:scale(1,1)}}#s3{animation:3s linear infinite forwards s3__to}@keyframes s3__to{0%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,33.333333%{transform:translate(12px,24px)}}#s4{animation:3s linear infinite forwards s4__ts}@keyframes s4__ts{0%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%,30%{transform:scale(0,0)}}#s5{animation:3s linear infinite forwards s5__to}@keyframes s5__to{0%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}33.333333%{transform:translate(12px,12.045742px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,66.666667%{transform:translate(12px,24px)}}#s6{animation:3s linear infinite forwards s6__ts}@keyframes s6__ts{0%,100%,63.333333%{transform:scale(0,0)}3.333333%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}33.333333%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}#s7{animation:3s linear infinite forwards s7__to}@keyframes s7__to{0%{transform:translate(12px,0)}33.333333%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}66.666667%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,24px)}}#s8{animation:3s linear infinite forwards s8__ts}@keyframes s8__ts{0%,100%,96.666667%{transform:scale(0,0)}36.666667%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}66.666667%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}`
8180
- }), o("g", {
8181
- id: "s1",
8182
- transform: "translate(12,0)",
8183
- children: o("g", {
8184
- id: "s2",
8185
- transform: "scale(0,0)",
8186
- children: o("circle", {
8187
- r: "6.5",
8188
- transform: "translate(0,0)",
8189
- fill: "currentColor"
8190
- })
8191
- })
8192
- }), o("g", {
8193
- id: "s3",
8194
- transform: "translate(12,12)",
8195
- children: o("g", {
8196
- id: "s4",
8197
- transform: "scale(1,1)",
8198
- children: o("circle", {
8199
- r: "6.5",
8200
- transform: "translate(0,0)",
8201
- fill: "currentColor"
8202
- })
8203
- })
8204
- }), o("g", {
8205
- id: "s5",
8206
- transform: "translate(12,0)",
8207
- children: o("g", {
8208
- id: "s6",
8209
- transform: "scale(0,0)",
8210
- children: o("path", {
8211
- d: "M6.5,13c3.5899,0,6.5-2.9101,6.5-6.5s-2.9101-6.5-6.5-6.5-6.5,2.91015-6.5,6.5s2.91015,6.5,6.5,6.5Zm0-4C7.88071,9,9,7.88071,9,6.5s-1.11929-2.5-2.5-2.5-2.5,1.11929-2.5,2.5s1.11929,2.5,2.5,2.5Z",
8212
- transform: "translate(-6.5,-6.5)",
8213
- "clip-rule": "evenodd",
8214
- fill: "currentColor",
8215
- "fill-rule": "evenodd"
8216
- })
8217
- })
8218
- }), o("g", {
8219
- id: "s7",
8220
- transform: "translate(12,0)",
8221
- children: o("g", {
8222
- id: "s8",
8223
- transform: "scale(0,0)",
8224
- children: o("path", {
8225
- d: "M0,6c0,3.58984,2.91016,6.5,6.5,6.5s6.5-2.91016,6.5-6.5h-4C9,7.38086,7.88086,8.5,6.5,8.5s-2.5-1.11914-2.5-2.5h-4Z",
8226
- transform: "translate(-6.5,-9.25)",
8227
- fill: "currentColor"
8228
- })
8229
- })
8230
- })]
8231
- });
8232
- const ChatLoading = () => o("div", {
8233
- class: "flex flex-grow flex-col items-center justify-center",
8234
- children: o(LoadingIndicator, {
8235
- class: "text-neutral-6 h-8 w-8"
8236
- })
8237
- });
8238
- function r(e2) {
8239
- var t2, f2, n2 = "";
8240
- if ("string" == typeof e2 || "number" == typeof e2)
8241
- n2 += e2;
8242
- else if ("object" == typeof e2)
8243
- if (Array.isArray(e2))
8244
- for (t2 = 0; t2 < e2.length; t2++)
8245
- e2[t2] && (f2 = r(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
8246
- else
8247
- for (t2 in e2)
8248
- e2[t2] && (n2 && (n2 += " "), n2 += t2);
8249
- return n2;
8250
- }
8251
- function clsx() {
8252
- for (var e2, t2, f2 = 0, n2 = ""; f2 < arguments.length; )
8253
- (e2 = arguments[f2++]) && (t2 = r(e2)) && (n2 && (n2 += " "), n2 += t2);
8254
- return n2;
8255
- }
8256
- const optimisticProgress = (progress2) => {
8257
- const prefilled = 0.1;
8258
- const unitProgress = progress2 / 100;
8259
- const concavity = 1.3;
8260
- if (progress2 < 0)
8261
- return "0%";
8262
- if (progress2 > 100)
8263
- return "100%";
8264
- return `${Math.round((1 - (1 - prefilled) * Math.pow(1 - unitProgress, concavity)) * 100)}%`;
8265
- };
8266
- const StatusbarIconButton = ({
8267
- class: className,
8268
- children,
8269
- ...props
8270
- }) => {
8271
- return o("button", {
8272
- class: clsx("touch-hitbox text-interactive-copy hover:text-interactive-copy-hover active:text-interactive-copy-active hover:bg-interactive-bg-hover active:bg-interactive-bg-active fr relative rounded-full p-2 transition-all", className),
8273
- ...props,
8274
- children: o("svg", {
8275
- class: "block",
8276
- width: "16",
8277
- height: "16",
8278
- viewBox: "0 0 16 16",
8279
- fill: "none",
8280
- stroke: "currentColor",
8281
- "stroke-width": "1.5",
8282
- "stroke-linecap": "round",
8283
- xmlns: "http://www.w3.org/2000/svg",
8284
- children
8285
- })
8286
- });
8287
- };
8288
- const ProgressBar = () => {
8289
- if (application.current$.value.state !== "loaded")
8290
- return null;
8291
- const nodeIdToProgress = application.current$.value.application.nodeIdToProgress;
8292
- const currentNodeId = application.current$.value.application.data.currentNodeId;
8293
- if (currentNodeId === null)
8294
- return null;
8295
- const currentProgress = nodeIdToProgress[currentNodeId];
8296
- if (currentProgress === void 0)
8297
- return null;
8298
- const percentage = 100 * (currentProgress.stepsMade / (currentProgress.remainingSteps + currentProgress.stepsMade));
8299
- return o("div", {
8300
- style: {
8301
- width: optimisticProgress(percentage)
8302
- },
8303
- class: "bg-accent-8 h-[2px] transition-all duration-1000"
8304
- });
8305
- };
8306
- const StatusBar = ({
8307
- children
8308
- }) => {
8309
- const view = viewState.value;
8310
- return o(k$3, {
8311
- children: o("header", {
8312
- class: "ring-divider bg-statusbar absolute left-0 right-0 top-0 z-20 mx-auto items-center ring-1 backdrop-blur-md backdrop-saturate-150",
8313
- children: [o("div", {
8314
- class: "flex h-[var(--header-height)] gap-2",
8315
- children: [o("p", {
8316
- id: "chatbot-status-bar",
8317
- class: "sr-only",
8318
- children
8319
- }), o("button", {
8320
- tabIndex: -1,
8321
- "aria-hidden": true,
8322
- onClick: () => {
8323
- if (view === "minimised") {
8324
- viewState.value = "maximised";
8325
- } else {
8326
- viewState.value = "minimised";
8327
- }
8328
- },
8329
- class: "h-full flex-grow overflow-hidden px-4 py-1",
8330
- children: o("p", {
8331
- "aria-hidden": true,
8332
- class: "text-neutral-12 truncate text-sm font-bold tracking-tight",
8333
- children
8334
- })
8335
- }), o("div", {
8336
- class: "flex flex-shrink-0 items-center gap-3 p-1.5",
8337
- children: viewState.value === "minimised" ? o(k$3, {
8338
- children: [o(StatusbarIconButton, {
8339
- "aria-label": "Maximise job application",
8340
- onClick: () => viewState.value = "maximised",
8341
- children: o("path", {
8342
- d: "M12.5 9.5L8 5L3.5 9.5"
8343
- })
8344
- }, "minmax"), o(StatusbarIconButton, {
8345
- "aria-label": "Close application",
8346
- onClick: application.cancel,
8347
- children: o("path", {
8348
- d: "M12.5 6.5L8 11L3.5 6.5"
8349
- })
8350
- }, "close")]
8351
- }) : o(k$3, {
8352
- children: [application.current$.value.state === "loaded" && o(StatusbarIconButton, {
8353
- "aria-label": "Restart",
8354
- onClick: () => {
8355
- application.restart();
8356
- },
8357
- children: [o("path", {
8358
- d: "M12 8.5C12 9.29113 11.7654 10.0645 11.3259 10.7223C10.8864 11.3801 10.2616 11.8928 9.53073 12.1955C8.79983 12.4983 7.99556 12.5775 7.21964 12.4231C6.44371 12.2688 5.73098 11.8878 5.17157 11.3284C4.61216 10.769 4.2312 10.0563 4.07686 9.28036C3.92252 8.50444 4.00173 7.70017 4.30448 6.96927C4.60723 6.23836 5.11992 5.61365 5.77772 5.17412C6.43552 4.7346 7.20887 4.5 8 4.5H9"
8359
- }), o("path", {
8360
- d: "M8 7L10 4.5L8 2.5"
8361
- })]
8362
- }, "restart"), o(StatusbarIconButton, {
8363
- "aria-label": "Minimise application",
8364
- onClick: () => viewState.value = "minimised",
8365
- children: o("path", {
8366
- d: "M12.5 6.5L8 11L3.5 6.5"
8367
- })
8368
- }, "minmax")]
8369
- })
8370
- })]
8371
- }), o(ProgressBar, {})]
8372
- })
8373
- });
8374
- };
8375
- const JobApplicationContent = M(() => import("./job-application-content-3cc77e28.js").then((module) => module.JobApplicationContent));
8376
- const MotionProvider = ({
8377
- children
8378
- }) => {
8379
- return o(LazyMotion, {
8380
- features: domAnimation,
8381
- children
8382
- });
8383
- };
8384
- const chatbotVariants = {
8385
- closed: {
8386
- y: "calc(100% + 1rem)",
8387
- height: HEADER_HEIGHT
8388
- },
8389
- maximised: {
8390
- y: 0,
8391
- height: "75vh"
8392
- },
8393
- minimised: {
8394
- y: 0,
8395
- height: HEADER_HEIGHT
8396
- }
8397
- };
8398
- const Chatbot = ({
8399
- logger,
8400
- apiClient,
8401
- analytics
8402
- }) => {
8403
- const {
8404
- state,
8405
- application: currentApplication2,
8406
- error
8407
- } = application.current$.value;
8408
- const view = viewState.value;
8409
- const isApplying = state !== "idle" && view === "maximised";
8410
- const drawerRef = _$4(null);
8411
- return o(MotionProvider, {
8412
- children: o($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, {
8413
- open: isApplying,
8414
- modal: isApplying,
8415
- children: o(AnimatePresence, {
8416
- children: [o($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, {
8417
- forceMount: true,
8418
- asChild: true,
8419
- children: isApplying && o(m$1.div, {
8420
- initial: {
8421
- opacity: 0
8422
- },
8423
- animate: {
8424
- opacity: 1
8425
- },
8426
- exit: {
8427
- opacity: 0
8428
- },
8429
- class: "bg-overlay fixed inset-0"
8430
- })
8431
- }, "bg"), o($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, {
8432
- forceMount: true,
8433
- asChild: true,
8434
- children: o(m$1.div, {
8435
- ref: drawerRef,
8436
- "aria-modal": "true",
8437
- role: "dialog",
8438
- "aria-labelledby": "chatbot-status-bar",
8439
- variants: chatbotVariants,
8440
- initial: "closed",
8441
- animate: N({
8442
- state,
8443
- view
8444
- }).with({
8445
- state: "idle"
8446
- }, () => "closed").with({
8447
- state: _$1.union("loaded", "error", "loading")
8448
- }, ({
8449
- view: view2
8450
- }) => view2).exhaustive(),
8451
- exit: "closed",
8452
- style: {
8453
- "--header-height": `${HEADER_HEIGHT}px`
8454
- },
8455
- class: "selection:bg-accent-4 selection:text-accent-12 fixed bottom-2 left-2 right-2 isolate mx-auto max-h-full max-w-[450px] focus:outline-none",
8456
- children: o("div", {
8457
- class: "outline-neutral-3 bg-neutral-1 relative flex h-full flex-col overflow-hidden rounded-3xl outline outline-1",
8458
- children: [o(StatusBar, {
8459
- children: currentApplication2 ? `Applying for “${currentApplication2.job.title}” at ${currentApplication2.company.name}` : "inploi chatbot: " + state
8460
- }), (() => {
8461
- switch (state) {
8462
- case "idle":
8463
- return null;
8464
- case "loading":
8465
- return o(ChatLoading, {}, "loading");
8466
- case "loaded":
8467
- if (view !== "maximised")
8468
- return null;
8469
- return o(D, {
8470
- fallback: o(ChatLoading, {}, "loading"),
8471
- children: o(JobApplicationContent, {
8472
- analytics,
8473
- currentApplication: currentApplication2,
8474
- apiClient,
8475
- logger
8476
- })
8477
- });
8478
- case "error":
8479
- return o(ChatError, {
8480
- message: error
8481
- });
8482
- default:
8483
- exhaustive(state);
8484
- }
8485
- })()]
8486
- })
8487
- }, "content")
8488
- })]
8489
- })
8490
- })
8491
- });
8492
- };
8493
- function flatten$1(arg1) {
8494
- return (Array.isArray(arg1) ? arg1 : arg1.issues).reduce(
8495
- (flatErrors, issue) => {
8496
- if (issue.path) {
8497
- if (issue.path.every(
8498
- ({ key }) => typeof key === "string" || typeof key === "number"
8499
- )) {
8500
- const path = issue.path.map(({ key }) => key).join(".");
8501
- if (flatErrors.nested[path]) {
8502
- flatErrors.nested[path].push(issue.message);
8503
- } else {
8504
- flatErrors.nested[path] = [issue.message];
8505
- }
8506
- }
8507
- } else {
8508
- if (flatErrors.root) {
8509
- flatErrors.root.push(issue.message);
8510
- } else {
8511
- flatErrors.root = [issue.message];
8512
- }
8513
- }
8514
- return flatErrors;
8515
- },
8516
- { nested: {} }
8517
- );
8518
- }
8519
- var ValiError = class extends Error {
8520
- /**
8521
- * Creates a Valibot error with useful information.
8522
- *
8523
- * @param issues The error issues.
8524
- */
8525
- constructor(issues) {
8526
- super(issues[0].message);
8527
- __publicField(this, "issues");
8528
- this.name = "ValiError";
8529
- this.issues = issues;
8530
- }
8531
- };
8532
- function coerce(schema, action) {
8533
- return {
8534
- ...schema,
8535
- _parse(input, info) {
8536
- return schema._parse(action(input), info);
8537
- }
8538
- };
8539
- }
8540
- function getIssues(issues) {
8541
- return { issues };
8542
- }
8543
- function getOutput(output) {
8544
- return { output };
8545
- }
8546
- function getIssue(info, issue) {
8547
- return {
8548
- reason: info == null ? void 0 : info.reason,
8549
- validation: issue.validation,
8550
- origin: (info == null ? void 0 : info.origin) || "value",
8551
- message: issue.message,
8552
- input: issue.input,
8553
- path: issue.path,
8554
- abortEarly: info == null ? void 0 : info.abortEarly,
8555
- abortPipeEarly: info == null ? void 0 : info.abortPipeEarly,
8556
- skipPipe: info == null ? void 0 : info.skipPipe
8557
- };
8558
- }
8559
- function getPipeInfo(info, reason) {
8560
- return {
8561
- reason,
8562
- origin: info == null ? void 0 : info.origin,
8563
- abortEarly: info == null ? void 0 : info.abortEarly,
8564
- abortPipeEarly: info == null ? void 0 : info.abortPipeEarly,
8565
- skipPipe: info == null ? void 0 : info.skipPipe
8566
- };
8567
- }
8568
- function executePipe(input, pipe2, parseInfo, reason) {
8569
- if (!pipe2 || !pipe2.length || (parseInfo == null ? void 0 : parseInfo.skipPipe)) {
8570
- return getOutput(input);
8571
- }
8572
- let pipeInfo;
8573
- let issues;
8574
- let output = input;
8575
- for (const action of pipe2) {
8576
- const result = action._parse(output);
8577
- if (result.issues) {
8578
- pipeInfo = pipeInfo || getPipeInfo(parseInfo, reason);
8579
- for (const issueInfo of result.issues) {
8580
- const issue = getIssue(pipeInfo, issueInfo);
8581
- issues ? issues.push(issue) : issues = [issue];
8582
- }
8583
- if (pipeInfo.abortEarly || pipeInfo.abortPipeEarly) {
8584
- break;
8585
- }
8586
- } else {
8587
- output = result.output;
8588
- }
8589
- }
8590
- return issues ? getIssues(issues) : getOutput(output);
8591
- }
8592
- function getDefaultArgs(arg1, arg2) {
8593
- return Array.isArray(arg1) ? [void 0, arg1] : [arg1, arg2];
8594
- }
8595
- function getErrorMessage(message) {
8596
- return typeof message === "function" ? message() : message;
8597
- }
8598
- function getPipeIssues(validation, message, input, requirement) {
8599
- return getIssues([
8600
- {
8601
- validation,
8602
- message: getErrorMessage(message),
8603
- input,
8604
- requirement
8098
+ function g(i2) {
8099
+ var t2 = i2.u;
8100
+ i2.u = void 0;
8101
+ if ("function" == typeof t2) {
8102
+ v++;
8103
+ var n2 = o$1;
8104
+ o$1 = void 0;
8105
+ try {
8106
+ t2();
8107
+ } catch (t3) {
8108
+ i2.f &= -2;
8109
+ i2.f |= 8;
8110
+ b(i2);
8111
+ throw t3;
8112
+ } finally {
8113
+ o$1 = n2;
8114
+ r$1();
8605
8115
  }
8606
- ]);
8607
- }
8608
- function getRestAndDefaultArgs(arg1, arg2, arg3) {
8609
- if (!arg1 || typeof arg1 === "object" && !Array.isArray(arg1)) {
8610
- const [error2, pipe22] = getDefaultArgs(arg2, arg3);
8611
- return [arg1, error2, pipe22];
8612
8116
  }
8613
- const [error, pipe2] = getDefaultArgs(
8614
- arg1,
8615
- arg2
8616
- );
8617
- return [void 0, error, pipe2];
8618
8117
  }
8619
- function getSchemaIssues(info, reason, validation, message, input, issues) {
8620
- return {
8621
- issues: [
8622
- {
8623
- reason,
8624
- validation,
8625
- origin: (info == null ? void 0 : info.origin) || "value",
8626
- message: getErrorMessage(message),
8627
- input,
8628
- issues,
8629
- abortEarly: info == null ? void 0 : info.abortEarly,
8630
- abortPipeEarly: info == null ? void 0 : info.abortPipeEarly,
8631
- skipPipe: info == null ? void 0 : info.skipPipe
8632
- }
8633
- ]
8634
- };
8118
+ function b(i2) {
8119
+ for (var t2 = i2.s; void 0 !== t2; t2 = t2.n)
8120
+ t2.S.U(t2);
8121
+ i2.x = void 0;
8122
+ i2.s = void 0;
8123
+ g(i2);
8635
8124
  }
8636
- function getDefault(schema) {
8637
- return typeof schema.default === "function" ? schema.default() : schema.default;
8125
+ function x(i2) {
8126
+ if (o$1 !== this)
8127
+ throw new Error("Out-of-order effect");
8128
+ w(this);
8129
+ o$1 = i2;
8130
+ this.f &= -2;
8131
+ if (8 & this.f)
8132
+ b(this);
8133
+ r$1();
8638
8134
  }
8639
- function any(pipe2) {
8640
- return {
8641
- type: "any",
8642
- async: false,
8643
- pipe: pipe2,
8644
- _parse(input, info) {
8645
- return executePipe(input, this.pipe, info, "any");
8646
- }
8647
- };
8135
+ function E(i2) {
8136
+ this.x = i2;
8137
+ this.u = void 0;
8138
+ this.s = void 0;
8139
+ this.o = void 0;
8140
+ this.f = 32;
8648
8141
  }
8649
- function array(item, arg2, arg3) {
8650
- const [message = "Invalid type", pipe2] = getDefaultArgs(arg2, arg3);
8651
- return {
8652
- type: "array",
8653
- async: false,
8654
- item,
8655
- message,
8656
- pipe: pipe2,
8657
- _parse(input, info) {
8658
- if (!Array.isArray(input)) {
8659
- return getSchemaIssues(info, "type", "array", this.message, input);
8660
- }
8661
- let issues;
8662
- const output = [];
8663
- for (let key = 0; key < input.length; key++) {
8664
- const value2 = input[key];
8665
- const result = this.item._parse(value2, info);
8666
- if (result.issues) {
8667
- const pathItem = {
8668
- type: "array",
8669
- input,
8670
- key,
8671
- value: value2
8672
- };
8673
- for (const issue of result.issues) {
8674
- if (issue.path) {
8675
- issue.path.unshift(pathItem);
8676
- } else {
8677
- issue.path = [pathItem];
8678
- }
8679
- issues == null ? void 0 : issues.push(issue);
8680
- }
8681
- if (!issues) {
8682
- issues = result.issues;
8683
- }
8684
- if (info == null ? void 0 : info.abortEarly) {
8685
- break;
8686
- }
8687
- } else {
8688
- output.push(result.output);
8689
- }
8690
- }
8691
- return issues ? getIssues(issues) : executePipe(output, this.pipe, info, "array");
8692
- }
8693
- };
8142
+ E.prototype.c = function() {
8143
+ var i2 = this.S();
8144
+ try {
8145
+ if (8 & this.f)
8146
+ return;
8147
+ if (void 0 === this.x)
8148
+ return;
8149
+ var t2 = this.x();
8150
+ if ("function" == typeof t2)
8151
+ this.u = t2;
8152
+ } finally {
8153
+ i2();
8154
+ }
8155
+ };
8156
+ E.prototype.S = function() {
8157
+ if (1 & this.f)
8158
+ i();
8159
+ this.f |= 1;
8160
+ this.f &= -9;
8161
+ g(this);
8162
+ y(this);
8163
+ v++;
8164
+ var t2 = o$1;
8165
+ o$1 = this;
8166
+ return x.bind(this, t2);
8167
+ };
8168
+ E.prototype.N = function() {
8169
+ if (!(2 & this.f)) {
8170
+ this.f |= 2;
8171
+ this.o = f;
8172
+ f = this;
8173
+ }
8174
+ };
8175
+ E.prototype.d = function() {
8176
+ this.f |= 8;
8177
+ if (!(1 & this.f))
8178
+ b(this);
8179
+ };
8180
+ function O(i2) {
8181
+ var t2 = new E(i2);
8182
+ try {
8183
+ t2.c();
8184
+ } catch (i3) {
8185
+ t2.d();
8186
+ throw i3;
8187
+ }
8188
+ return t2.d.bind(t2);
8694
8189
  }
8695
- function boolean(arg1, arg2) {
8696
- const [message = "Invalid type", pipe2] = getDefaultArgs(arg1, arg2);
8697
- return {
8698
- type: "boolean",
8699
- async: false,
8700
- message,
8701
- pipe: pipe2,
8702
- _parse(input, info) {
8703
- if (typeof input !== "boolean") {
8704
- return getSchemaIssues(info, "type", "boolean", this.message, input);
8705
- }
8706
- return executePipe(input, this.pipe, info, "boolean");
8707
- }
8708
- };
8190
+ var s;
8191
+ function l(n2, i2) {
8192
+ l$4[n2] = i2.bind(null, l$4[n2] || function() {
8193
+ });
8709
8194
  }
8710
- function number(arg1, arg2) {
8711
- const [message = "Invalid type", pipe2] = getDefaultArgs(arg1, arg2);
8712
- return {
8713
- type: "number",
8714
- async: false,
8715
- message,
8716
- pipe: pipe2,
8717
- _parse(input, info) {
8718
- if (typeof input !== "number" || isNaN(input)) {
8719
- return getSchemaIssues(info, "type", "number", this.message, input);
8720
- }
8721
- return executePipe(input, this.pipe, info, "number");
8722
- }
8723
- };
8195
+ function d(n2) {
8196
+ if (s)
8197
+ s();
8198
+ s = n2 && n2.S();
8724
8199
  }
8725
- function object(entries, arg2, arg3, arg4) {
8726
- const [rest, message = "Invalid type", pipe2] = getRestAndDefaultArgs(arg2, arg3, arg4);
8727
- let cachedEntries;
8728
- return {
8729
- type: "object",
8730
- async: false,
8731
- entries,
8732
- rest,
8733
- message,
8734
- pipe: pipe2,
8735
- _parse(input, info) {
8736
- if (!input || typeof input !== "object") {
8737
- return getSchemaIssues(info, "type", "object", this.message, input);
8200
+ function p(n2) {
8201
+ var r2 = this, f2 = n2.data, o2 = useSignal(f2);
8202
+ o2.value = f2;
8203
+ var e2 = F$1(function() {
8204
+ var n3 = r2.__v;
8205
+ while (n3 = n3.__)
8206
+ if (n3.__c) {
8207
+ n3.__c.__$f |= 4;
8208
+ break;
8738
8209
  }
8739
- cachedEntries = cachedEntries || Object.entries(this.entries);
8740
- let issues;
8741
- const output = {};
8742
- for (const [key, schema] of cachedEntries) {
8743
- const value2 = input[key];
8744
- const result = schema._parse(value2, info);
8745
- if (result.issues) {
8746
- const pathItem = {
8747
- type: "object",
8748
- input,
8749
- key,
8750
- value: value2
8751
- };
8752
- for (const issue of result.issues) {
8753
- if (issue.path) {
8754
- issue.path.unshift(pathItem);
8755
- } else {
8756
- issue.path = [pathItem];
8757
- }
8758
- issues == null ? void 0 : issues.push(issue);
8759
- }
8760
- if (!issues) {
8761
- issues = result.issues;
8762
- }
8763
- if (info == null ? void 0 : info.abortEarly) {
8764
- break;
8765
- }
8766
- } else if (result.output !== void 0 || key in input) {
8767
- output[key] = result.output;
8210
+ r2.__$u.c = function() {
8211
+ var n4;
8212
+ if (!t$3(e2.peek()) && 3 === (null == (n4 = r2.base) ? void 0 : n4.nodeType))
8213
+ r2.base.data = e2.peek();
8214
+ else {
8215
+ r2.__$f |= 1;
8216
+ r2.setState({});
8217
+ }
8218
+ };
8219
+ return p$1(function() {
8220
+ var n4 = o2.value.value;
8221
+ return 0 === n4 ? 0 : true === n4 ? "" : n4 || "";
8222
+ });
8223
+ }, []);
8224
+ return e2.value;
8225
+ }
8226
+ p.displayName = "_st";
8227
+ Object.defineProperties(d$1.prototype, { constructor: { configurable: true, value: void 0 }, type: { configurable: true, value: p }, props: { configurable: true, get: function() {
8228
+ return { data: this };
8229
+ } }, __b: { configurable: true, value: 1 } });
8230
+ l("__b", function(n2, r2) {
8231
+ if ("string" == typeof r2.type) {
8232
+ var i2, t2 = r2.props;
8233
+ for (var f2 in t2)
8234
+ if ("children" !== f2) {
8235
+ var o2 = t2[f2];
8236
+ if (o2 instanceof d$1) {
8237
+ if (!i2)
8238
+ r2.__np = i2 = {};
8239
+ i2[f2] = o2;
8240
+ t2[f2] = o2.peek();
8768
8241
  }
8769
8242
  }
8770
- if (this.rest && !((info == null ? void 0 : info.abortEarly) && issues)) {
8771
- for (const key in input) {
8772
- if (!(key in this.entries)) {
8773
- const value2 = input[key];
8774
- const result = this.rest._parse(value2, info);
8775
- if (result.issues) {
8776
- const pathItem = {
8777
- type: "object",
8778
- input,
8779
- key,
8780
- value: value2
8781
- };
8782
- for (const issue of result.issues) {
8783
- if (issue.path) {
8784
- issue.path.unshift(pathItem);
8785
- } else {
8786
- issue.path = [pathItem];
8787
- }
8788
- issues == null ? void 0 : issues.push(issue);
8789
- }
8790
- if (!issues) {
8791
- issues = result.issues;
8792
- }
8793
- if (info == null ? void 0 : info.abortEarly) {
8794
- break;
8795
- }
8796
- } else {
8797
- output[key] = result.output;
8798
- }
8243
+ }
8244
+ n2(r2);
8245
+ });
8246
+ l("__r", function(n2, r2) {
8247
+ d();
8248
+ var i2, t2 = r2.__c;
8249
+ if (t2) {
8250
+ t2.__$f &= -2;
8251
+ if (void 0 === (i2 = t2.__$u))
8252
+ t2.__$u = i2 = function(n3) {
8253
+ var r3;
8254
+ O(function() {
8255
+ r3 = this;
8256
+ });
8257
+ r3.c = function() {
8258
+ t2.__$f |= 1;
8259
+ t2.setState({});
8260
+ };
8261
+ return r3;
8262
+ }();
8263
+ }
8264
+ d(i2);
8265
+ n2(r2);
8266
+ });
8267
+ l("__e", function(n2, r2, i2, t2) {
8268
+ d();
8269
+ n2(r2, i2, t2);
8270
+ });
8271
+ l("diffed", function(n2, r2) {
8272
+ d();
8273
+ var i2;
8274
+ if ("string" == typeof r2.type && (i2 = r2.__e)) {
8275
+ var t2 = r2.__np, f2 = r2.props;
8276
+ if (t2) {
8277
+ var o2 = i2.U;
8278
+ if (o2)
8279
+ for (var e2 in o2) {
8280
+ var u2 = o2[e2];
8281
+ if (void 0 !== u2 && !(e2 in t2)) {
8282
+ u2.d();
8283
+ o2[e2] = void 0;
8799
8284
  }
8800
8285
  }
8286
+ else
8287
+ i2.U = o2 = {};
8288
+ for (var a2 in t2) {
8289
+ var c2 = o2[a2], s2 = t2[a2];
8290
+ if (void 0 === c2) {
8291
+ c2 = _$1(i2, a2, s2, f2);
8292
+ o2[a2] = c2;
8293
+ } else
8294
+ c2.o(s2, f2);
8801
8295
  }
8802
- return issues ? getIssues(issues) : executePipe(
8803
- output,
8804
- this.pipe,
8805
- info,
8806
- "object"
8807
- );
8808
8296
  }
8809
- };
8297
+ }
8298
+ n2(r2);
8299
+ });
8300
+ function _$1(n2, r2, i2, t2) {
8301
+ var f2 = r2 in n2 && void 0 === n2.ownerSVGElement, o2 = a(i2);
8302
+ return { o: function(n3, r3) {
8303
+ o2.value = n3;
8304
+ t2 = r3;
8305
+ }, d: O(function() {
8306
+ var i3 = o2.value.value;
8307
+ if (t2[r2] !== i3) {
8308
+ t2[r2] = i3;
8309
+ if (f2)
8310
+ n2[r2] = i3;
8311
+ else if (i3)
8312
+ n2.setAttribute(r2, i3);
8313
+ else
8314
+ n2.removeAttribute(r2);
8315
+ }
8316
+ }) };
8810
8317
  }
8811
- function optional(wrapped, default_) {
8812
- return {
8813
- type: "optional",
8814
- async: false,
8815
- wrapped,
8816
- default: default_,
8817
- _parse(input, info) {
8818
- if (input === void 0) {
8819
- const override = getDefault(this);
8820
- if (override === void 0) {
8821
- return getOutput(input);
8318
+ l("unmount", function(n2, r2) {
8319
+ if ("string" == typeof r2.type) {
8320
+ var i2 = r2.__e;
8321
+ if (i2) {
8322
+ var t2 = i2.U;
8323
+ if (t2) {
8324
+ i2.U = void 0;
8325
+ for (var f2 in t2) {
8326
+ var o2 = t2[f2];
8327
+ if (o2)
8328
+ o2.d();
8822
8329
  }
8823
- input = override;
8824
8330
  }
8825
- return this.wrapped._parse(input, info);
8826
8331
  }
8827
- };
8828
- }
8829
- function picklist(options, message = "Invalid type") {
8830
- return {
8831
- type: "picklist",
8832
- async: false,
8833
- options,
8834
- message,
8835
- _parse(input, info) {
8836
- if (!this.options.includes(input)) {
8837
- return getSchemaIssues(info, "type", "picklist", this.message, input);
8332
+ } else {
8333
+ var e2 = r2.__c;
8334
+ if (e2) {
8335
+ var u2 = e2.__$u;
8336
+ if (u2) {
8337
+ e2.__$u = void 0;
8338
+ u2.d();
8838
8339
  }
8839
- return getOutput(input);
8840
8340
  }
8841
- };
8341
+ }
8342
+ n2(r2);
8343
+ });
8344
+ l("__h", function(n2, r2, i2, t2) {
8345
+ if (t2 < 3 || 9 === t2)
8346
+ r2.__$f |= 2;
8347
+ n2(r2, i2, t2);
8348
+ });
8349
+ b$3.prototype.shouldComponentUpdate = function(n2, r2) {
8350
+ var i2 = this.__$u;
8351
+ if (!(i2 && void 0 !== i2.s || 4 & this.__$f))
8352
+ return true;
8353
+ if (3 & this.__$f)
8354
+ return true;
8355
+ for (var t2 in r2)
8356
+ return true;
8357
+ for (var f2 in n2)
8358
+ if ("__source" !== f2 && n2[f2] !== this.props[f2])
8359
+ return true;
8360
+ for (var o2 in this.props)
8361
+ if (!(o2 in n2))
8362
+ return true;
8363
+ return false;
8364
+ };
8365
+ function useSignal(n2) {
8366
+ return F$1(function() {
8367
+ return a(n2);
8368
+ }, []);
8842
8369
  }
8843
- function string(arg1, arg2) {
8844
- const [message = "Invalid type", pipe2] = getDefaultArgs(arg1, arg2);
8845
- return {
8846
- type: "string",
8847
- async: false,
8848
- message,
8849
- pipe: pipe2,
8850
- _parse(input, info) {
8851
- if (typeof input !== "string") {
8852
- return getSchemaIssues(info, "type", "string", this.message, input);
8853
- }
8854
- return executePipe(input, this.pipe, info, "string");
8855
- }
8856
- };
8370
+ const instanceOfAny = (object2, constructors) => constructors.some((c2) => object2 instanceof c2);
8371
+ let idbProxyableTypes;
8372
+ let cursorAdvanceMethods;
8373
+ function getIdbProxyableTypes() {
8374
+ return idbProxyableTypes || (idbProxyableTypes = [
8375
+ IDBDatabase,
8376
+ IDBObjectStore,
8377
+ IDBIndex,
8378
+ IDBCursor,
8379
+ IDBTransaction
8380
+ ]);
8857
8381
  }
8858
- function getRecordArgs(arg1, arg2, arg3, arg4) {
8859
- if (typeof arg2 === "object" && !Array.isArray(arg2)) {
8860
- const [message2, pipe22] = getDefaultArgs(arg3, arg4);
8861
- return [arg1, arg2, message2, pipe22];
8862
- }
8863
- const [message, pipe2] = getDefaultArgs(
8864
- arg2,
8865
- arg3
8866
- );
8867
- return [string(), arg1, message, pipe2];
8382
+ function getCursorAdvanceMethods() {
8383
+ return cursorAdvanceMethods || (cursorAdvanceMethods = [
8384
+ IDBCursor.prototype.advance,
8385
+ IDBCursor.prototype.continue,
8386
+ IDBCursor.prototype.continuePrimaryKey
8387
+ ]);
8868
8388
  }
8869
- var BLOCKED_KEYS = ["__proto__", "prototype", "constructor"];
8870
- function record(arg1, arg2, arg3, arg4) {
8871
- const [key, value2, message = "Invalid type", pipe2] = getRecordArgs(arg1, arg2, arg3, arg4);
8872
- return {
8873
- type: "record",
8874
- async: false,
8875
- key,
8876
- value: value2,
8877
- message,
8878
- pipe: pipe2,
8879
- _parse(input, info) {
8880
- if (!input || typeof input !== "object") {
8881
- return getSchemaIssues(info, "type", "record", this.message, input);
8882
- }
8883
- let issues;
8884
- const output = {};
8885
- for (const [inputKey, inputValue] of Object.entries(input)) {
8886
- if (!BLOCKED_KEYS.includes(inputKey)) {
8887
- let pathItem;
8888
- const keyResult = this.key._parse(inputKey, {
8889
- origin: "key",
8890
- abortEarly: info == null ? void 0 : info.abortEarly,
8891
- abortPipeEarly: info == null ? void 0 : info.abortPipeEarly,
8892
- skipPipe: info == null ? void 0 : info.skipPipe
8893
- });
8894
- if (keyResult.issues) {
8895
- pathItem = {
8896
- type: "record",
8897
- input,
8898
- key: inputKey,
8899
- value: inputValue
8900
- };
8901
- for (const issue of keyResult.issues) {
8902
- issue.path = [pathItem];
8903
- issues == null ? void 0 : issues.push(issue);
8904
- }
8905
- if (!issues) {
8906
- issues = keyResult.issues;
8907
- }
8908
- if (info == null ? void 0 : info.abortEarly) {
8909
- break;
8910
- }
8911
- }
8912
- const valueResult = this.value._parse(inputValue, info);
8913
- if (valueResult.issues) {
8914
- pathItem = pathItem || {
8915
- type: "record",
8916
- input,
8917
- key: inputKey,
8918
- value: inputValue
8919
- };
8920
- for (const issue of valueResult.issues) {
8921
- if (issue.path) {
8922
- issue.path.unshift(pathItem);
8923
- } else {
8924
- issue.path = [pathItem];
8925
- }
8926
- issues == null ? void 0 : issues.push(issue);
8927
- }
8928
- if (!issues) {
8929
- issues = valueResult.issues;
8930
- }
8931
- if (info == null ? void 0 : info.abortEarly) {
8932
- break;
8933
- }
8934
- }
8935
- if (!keyResult.issues && !valueResult.issues) {
8936
- output[keyResult.output] = valueResult.output;
8937
- }
8938
- }
8389
+ const transactionDoneMap = /* @__PURE__ */ new WeakMap();
8390
+ const transformCache = /* @__PURE__ */ new WeakMap();
8391
+ const reverseTransformCache = /* @__PURE__ */ new WeakMap();
8392
+ function promisifyRequest(request) {
8393
+ const promise = new Promise((resolve, reject) => {
8394
+ const unlisten = () => {
8395
+ request.removeEventListener("success", success);
8396
+ request.removeEventListener("error", error);
8397
+ };
8398
+ const success = () => {
8399
+ resolve(wrap(request.result));
8400
+ unlisten();
8401
+ };
8402
+ const error = () => {
8403
+ reject(request.error);
8404
+ unlisten();
8405
+ };
8406
+ request.addEventListener("success", success);
8407
+ request.addEventListener("error", error);
8408
+ });
8409
+ reverseTransformCache.set(promise, request);
8410
+ return promise;
8411
+ }
8412
+ function cacheDonePromiseForTransaction(tx) {
8413
+ if (transactionDoneMap.has(tx))
8414
+ return;
8415
+ const done = new Promise((resolve, reject) => {
8416
+ const unlisten = () => {
8417
+ tx.removeEventListener("complete", complete);
8418
+ tx.removeEventListener("error", error);
8419
+ tx.removeEventListener("abort", error);
8420
+ };
8421
+ const complete = () => {
8422
+ resolve();
8423
+ unlisten();
8424
+ };
8425
+ const error = () => {
8426
+ reject(tx.error || new DOMException("AbortError", "AbortError"));
8427
+ unlisten();
8428
+ };
8429
+ tx.addEventListener("complete", complete);
8430
+ tx.addEventListener("error", error);
8431
+ tx.addEventListener("abort", error);
8432
+ });
8433
+ transactionDoneMap.set(tx, done);
8434
+ }
8435
+ let idbProxyTraps = {
8436
+ get(target, prop, receiver) {
8437
+ if (target instanceof IDBTransaction) {
8438
+ if (prop === "done")
8439
+ return transactionDoneMap.get(target);
8440
+ if (prop === "store") {
8441
+ return receiver.objectStoreNames[1] ? void 0 : receiver.objectStore(receiver.objectStoreNames[0]);
8939
8442
  }
8940
- return issues ? getIssues(issues) : executePipe(
8941
- output,
8942
- this.pipe,
8943
- info,
8944
- "record"
8945
- );
8946
8443
  }
8947
- };
8444
+ return wrap(target[prop]);
8445
+ },
8446
+ set(target, prop, value) {
8447
+ target[prop] = value;
8448
+ return true;
8449
+ },
8450
+ has(target, prop) {
8451
+ if (target instanceof IDBTransaction && (prop === "done" || prop === "store")) {
8452
+ return true;
8453
+ }
8454
+ return prop in target;
8455
+ }
8456
+ };
8457
+ function replaceTraps(callback) {
8458
+ idbProxyTraps = callback(idbProxyTraps);
8948
8459
  }
8949
- function parse(schema, input, info) {
8950
- const result = schema._parse(input, info);
8951
- if (result.issues) {
8952
- throw new ValiError(result.issues);
8460
+ function wrapFunction(func) {
8461
+ if (getCursorAdvanceMethods().includes(func)) {
8462
+ return function(...args) {
8463
+ func.apply(unwrap(this), args);
8464
+ return wrap(this.request);
8465
+ };
8953
8466
  }
8954
- return result.output;
8467
+ return function(...args) {
8468
+ return wrap(func.apply(unwrap(this), args));
8469
+ };
8955
8470
  }
8956
- async function parseAsync(schema, input, info) {
8957
- const result = await schema._parse(input, info);
8958
- if (result.issues) {
8959
- throw new ValiError(result.issues);
8471
+ function transformCachableValue(value) {
8472
+ if (typeof value === "function")
8473
+ return wrapFunction(value);
8474
+ if (value instanceof IDBTransaction)
8475
+ cacheDonePromiseForTransaction(value);
8476
+ if (instanceOfAny(value, getIdbProxyableTypes()))
8477
+ return new Proxy(value, idbProxyTraps);
8478
+ return value;
8479
+ }
8480
+ function wrap(value) {
8481
+ if (value instanceof IDBRequest)
8482
+ return promisifyRequest(value);
8483
+ if (transformCache.has(value))
8484
+ return transformCache.get(value);
8485
+ const newValue = transformCachableValue(value);
8486
+ if (newValue !== value) {
8487
+ transformCache.set(value, newValue);
8488
+ reverseTransformCache.set(newValue, value);
8489
+ }
8490
+ return newValue;
8491
+ }
8492
+ const unwrap = (value) => reverseTransformCache.get(value);
8493
+ function openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {
8494
+ const request = indexedDB.open(name, version);
8495
+ const openPromise = wrap(request);
8496
+ if (upgrade) {
8497
+ request.addEventListener("upgradeneeded", (event) => {
8498
+ upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);
8499
+ });
8960
8500
  }
8961
- return result.output;
8501
+ if (blocked) {
8502
+ request.addEventListener("blocked", (event) => blocked(
8503
+ // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
8504
+ event.oldVersion,
8505
+ event.newVersion,
8506
+ event
8507
+ ));
8508
+ }
8509
+ openPromise.then((db2) => {
8510
+ if (terminated)
8511
+ db2.addEventListener("close", () => terminated());
8512
+ if (blocking) {
8513
+ db2.addEventListener("versionchange", (event) => blocking(event.oldVersion, event.newVersion, event));
8514
+ }
8515
+ }).catch(() => {
8516
+ });
8517
+ return openPromise;
8962
8518
  }
8963
- function transform(schema, action, arg1) {
8964
- return {
8965
- ...schema,
8966
- _parse(input, info) {
8967
- const result = schema._parse(input, info);
8968
- if (result.issues) {
8969
- return result;
8970
- }
8971
- const output = action(result.output);
8972
- if (arg1 && !Array.isArray(arg1)) {
8973
- return arg1._parse(output, info);
8974
- }
8975
- return executePipe(output, arg1, info, typeof output);
8976
- }
8519
+ const readMethods = ["get", "getKey", "getAll", "getAllKeys", "count"];
8520
+ const writeMethods = ["put", "add", "delete", "clear"];
8521
+ const cachedMethods = /* @__PURE__ */ new Map();
8522
+ function getMethod(target, prop) {
8523
+ if (!(target instanceof IDBDatabase && !(prop in target) && typeof prop === "string")) {
8524
+ return;
8525
+ }
8526
+ if (cachedMethods.get(prop))
8527
+ return cachedMethods.get(prop);
8528
+ const targetFuncName = prop.replace(/FromIndex$/, "");
8529
+ const useIndex = prop !== targetFuncName;
8530
+ const isWrite = writeMethods.includes(targetFuncName);
8531
+ if (
8532
+ // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
8533
+ !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || !(isWrite || readMethods.includes(targetFuncName))
8534
+ ) {
8535
+ return;
8536
+ }
8537
+ const method = async function(storeName, ...args) {
8538
+ const tx = this.transaction(storeName, isWrite ? "readwrite" : "readonly");
8539
+ let target2 = tx.store;
8540
+ if (useIndex)
8541
+ target2 = target2.index(args.shift());
8542
+ return (await Promise.all([
8543
+ target2[targetFuncName](...args),
8544
+ isWrite && tx.done
8545
+ ]))[0];
8977
8546
  };
8547
+ cachedMethods.set(prop, method);
8548
+ return method;
8978
8549
  }
8979
- var EMAIL_REGEX = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
8980
- function email(message = "Invalid email") {
8981
- return {
8982
- type: "email",
8983
- async: false,
8984
- message,
8985
- requirement: EMAIL_REGEX,
8986
- _parse(input) {
8987
- return !this.requirement.test(input) ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
8550
+ replaceTraps((oldTraps) => ({
8551
+ ...oldTraps,
8552
+ get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),
8553
+ has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop)
8554
+ }));
8555
+ const advanceMethodProps = ["continue", "continuePrimaryKey", "advance"];
8556
+ const methodMap = {};
8557
+ const advanceResults = /* @__PURE__ */ new WeakMap();
8558
+ const ittrProxiedCursorToOriginalProxy = /* @__PURE__ */ new WeakMap();
8559
+ const cursorIteratorTraps = {
8560
+ get(target, prop) {
8561
+ if (!advanceMethodProps.includes(prop))
8562
+ return target[prop];
8563
+ let cachedFunc = methodMap[prop];
8564
+ if (!cachedFunc) {
8565
+ cachedFunc = methodMap[prop] = function(...args) {
8566
+ advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));
8567
+ };
8988
8568
  }
8989
- };
8569
+ return cachedFunc;
8570
+ }
8571
+ };
8572
+ async function* iterate(...args) {
8573
+ let cursor = this;
8574
+ if (!(cursor instanceof IDBCursor)) {
8575
+ cursor = await cursor.openCursor(...args);
8576
+ }
8577
+ if (!cursor)
8578
+ return;
8579
+ cursor = cursor;
8580
+ const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);
8581
+ ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);
8582
+ reverseTransformCache.set(proxiedCursor, unwrap(cursor));
8583
+ while (cursor) {
8584
+ yield proxiedCursor;
8585
+ cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());
8586
+ advanceResults.delete(proxiedCursor);
8587
+ }
8588
+ }
8589
+ function isIteratorProp(target, prop) {
8590
+ return prop === Symbol.asyncIterator && instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor]) || prop === "iterate" && instanceOfAny(target, [IDBIndex, IDBObjectStore]);
8591
+ }
8592
+ replaceTraps((oldTraps) => ({
8593
+ ...oldTraps,
8594
+ get(target, prop, receiver) {
8595
+ if (isIteratorProp(target, prop))
8596
+ return iterate;
8597
+ return oldTraps.get(target, prop, receiver);
8598
+ },
8599
+ has(target, prop) {
8600
+ return isIteratorProp(target, prop) || oldTraps.has(target, prop);
8601
+ }
8602
+ }));
8603
+ const kbToReadableSize = (kb) => N(kb).with(_$3.number.lte(1e3), () => `${Math.round(kb)}KB`).with(_$3.number.lt(1e3 * 10), () => `${(kb / 1e3).toFixed(1)}MB`).otherwise(() => `${Math.round(kb / 1e3)}MB`);
8604
+ const getHeadOrThrow = (nodes) => {
8605
+ const head = nodes.find((n2) => n2.isHead);
8606
+ if (!head)
8607
+ throw new Error("No head node found");
8608
+ return head;
8609
+ };
8610
+ const getFlowSubmissionsPayload = (submissions) => {
8611
+ const payload = Object.entries(submissions).reduce((acc, [key, submission]) => {
8612
+ acc[key] = submission.value;
8613
+ return acc;
8614
+ }, {});
8615
+ return payload;
8616
+ };
8617
+ const isSubmissionOfType = (type) => (submission) => {
8618
+ if (!submission)
8619
+ return false;
8620
+ return submission.type === type;
8621
+ };
8622
+ class AbortedError extends Error {
8623
+ constructor() {
8624
+ super("Aborted");
8625
+ }
8990
8626
  }
8991
- function maxLength(requirement, message = "Invalid length") {
8992
- return {
8993
- type: "max_length",
8994
- async: false,
8995
- message,
8996
- requirement,
8997
- _parse(input) {
8998
- return input.length > this.requirement ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
8999
- }
8627
+ function debounce(func, timeout = 300) {
8628
+ let timer = void 0;
8629
+ return (...args) => {
8630
+ clearTimeout(timer);
8631
+ timer = setTimeout(() => {
8632
+ func.apply(this, args);
8633
+ }, timeout);
9000
8634
  };
9001
8635
  }
9002
- function minLength(requirement, message = "Invalid length") {
8636
+ const db = typeof window === "undefined" ? void 0 : openDB("inploi-chatbot", 2, {
8637
+ upgrade(db2) {
8638
+ try {
8639
+ db2.deleteObjectStore("state");
8640
+ } catch {
8641
+ }
8642
+ db2.createObjectStore("state");
8643
+ }
8644
+ });
8645
+ const idb = {
8646
+ getStateData: async (flow, flowKeys) => {
8647
+ var _a;
8648
+ const key = getCacheKey({
8649
+ ...flow,
8650
+ flowKeys
8651
+ });
8652
+ return (_a = await db) == null ? void 0 : _a.get("state", key);
8653
+ },
8654
+ setStateData: debounce(async (params) => {
8655
+ var _a;
8656
+ const key = getCacheKey(params);
8657
+ return (_a = await db) == null ? void 0 : _a.put("state", params.data, key);
8658
+ }, 1e3)
8659
+ };
8660
+ const getChatbotFlowProgress = (nodes, node, onCalculate, stepsMade = 0) => {
8661
+ if (!node.nextId) {
8662
+ onCalculate(node.id, {
8663
+ stepsMade,
8664
+ remainingSteps: 0
8665
+ });
8666
+ return {
8667
+ stepsMade,
8668
+ remainingSteps: 0
8669
+ };
8670
+ }
8671
+ const nextNode = nodes.find((newNode) => newNode.id === node.nextId);
8672
+ if (nextNode === void 0) {
8673
+ return {
8674
+ stepsMade,
8675
+ remainingSteps: 0
8676
+ };
8677
+ }
8678
+ const branchId = node.type === "if-block" ? node.branchId : void 0;
8679
+ const branchNode = nodes.find((node2) => node2.id === branchId);
8680
+ const increment = node.type.includes("question") ? 1 : 0;
8681
+ if (branchNode) {
8682
+ const remainingSteps2 = increment + Math.max(getChatbotFlowProgress(nodes, nextNode, onCalculate, stepsMade + increment).remainingSteps, getChatbotFlowProgress(nodes, branchNode, onCalculate, stepsMade + increment).remainingSteps);
8683
+ onCalculate(node.id, {
8684
+ stepsMade,
8685
+ remainingSteps: remainingSteps2
8686
+ });
8687
+ return {
8688
+ stepsMade,
8689
+ remainingSteps: remainingSteps2
8690
+ };
8691
+ }
8692
+ const remainingSteps = increment + getChatbotFlowProgress(nodes, nextNode, onCalculate, stepsMade + increment).remainingSteps;
8693
+ onCalculate(node.id, {
8694
+ stepsMade,
8695
+ remainingSteps
8696
+ });
9003
8697
  return {
9004
- type: "min_length",
9005
- async: false,
9006
- message,
9007
- requirement,
9008
- _parse(input) {
9009
- return input.length < this.requirement ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
9010
- }
8698
+ stepsMade,
8699
+ remainingSteps
9011
8700
  };
9012
- }
9013
- function regex(requirement, message = "Invalid regex") {
9014
- return {
9015
- type: "regex",
9016
- async: false,
9017
- message,
9018
- requirement,
9019
- _parse(input) {
9020
- return !this.requirement.test(input) ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
9021
- }
8701
+ };
8702
+ const getNodesProgress = (nodes) => {
8703
+ const nodeIdToProgress = {};
8704
+ const firstNode = nodes.find((node) => node.isHead);
8705
+ if (!firstNode)
8706
+ return nodeIdToProgress;
8707
+ getChatbotFlowProgress(nodes, firstNode, (nodeId, progress2) => {
8708
+ nodeIdToProgress[nodeId] = progress2;
8709
+ });
8710
+ return nodeIdToProgress;
8711
+ };
8712
+ const getCacheKey = (flow) => [...flow.flowKeys, flow.id, flow.version].join("/");
8713
+ const currentFlow = a({
8714
+ state: "idle"
8715
+ });
8716
+ const updateFlowState = (updateFn) => {
8717
+ const {
8718
+ state,
8719
+ flow
8720
+ } = currentFlow.value;
8721
+ if (state !== "loaded")
8722
+ return;
8723
+ invariant$1(flow, "No flow to update");
8724
+ const newData = updateFn(flow.data);
8725
+ flow.data = newData;
8726
+ currentFlow.value = {
8727
+ state,
8728
+ flow
9022
8729
  };
9023
- }
9024
- function url(message = "Invalid URL") {
9025
- return {
9026
- type: "url",
9027
- async: false,
9028
- message,
9029
- requirement(input) {
9030
- try {
9031
- new URL(input);
9032
- return true;
9033
- } catch {
9034
- return false;
8730
+ idb.setStateData(flow);
8731
+ };
8732
+ const store = {
8733
+ current$: currentFlow,
8734
+ viewState$: a("maximised"),
8735
+ inputHeight$: a(53),
8736
+ startFlow: async ({
8737
+ flow,
8738
+ context,
8739
+ flowKeys,
8740
+ title
8741
+ }) => {
8742
+ const data = await idb.getStateData(flow, flowKeys) ?? initialiseFlowStateData();
8743
+ const startedFlow = {
8744
+ data,
8745
+ startedAt: /* @__PURE__ */ new Date(),
8746
+ nodeIdToProgress: getNodesProgress(flow.nodes),
8747
+ flowKeys,
8748
+ id: flow.id,
8749
+ version: flow.version,
8750
+ nodes: flow.nodes,
8751
+ context,
8752
+ title
8753
+ };
8754
+ currentFlow.value = {
8755
+ state: "loaded",
8756
+ flow: startedFlow
8757
+ };
8758
+ idb.setStateData(startedFlow);
8759
+ },
8760
+ cancelCurrentFlow: () => {
8761
+ currentFlow.value = {
8762
+ state: "idle"
8763
+ };
8764
+ },
8765
+ markAsFinished: () => updateFlowState((data) => ({
8766
+ ...data,
8767
+ isFinished: true
8768
+ })),
8769
+ setCurrentNodeId: (currentNodeId) => updateFlowState((data) => {
8770
+ data.nodeHistory.push(currentNodeId);
8771
+ return data;
8772
+ }),
8773
+ restart: () => {
8774
+ const {
8775
+ state,
8776
+ flow
8777
+ } = currentFlow.value;
8778
+ if (state !== "loaded")
8779
+ throw new Error("Flow cannot be restarted: not in valid state");
8780
+ const data = initialiseFlowStateData();
8781
+ currentFlow.value = {
8782
+ state,
8783
+ flow: {
8784
+ ...flow,
8785
+ data,
8786
+ startedAt: /* @__PURE__ */ new Date()
9035
8787
  }
9036
- },
9037
- _parse(input) {
9038
- return !this.requirement(input) ? getPipeIssues(this.type, this.message, input, this.requirement) : getOutput(input);
8788
+ };
8789
+ idb.setStateData(flow);
8790
+ },
8791
+ addMessage: (message, groupId) => {
8792
+ const newMessage = {
8793
+ ...message,
8794
+ groupId
8795
+ };
8796
+ return updateFlowState((data) => {
8797
+ data.messages.push(newMessage);
8798
+ return data;
8799
+ });
8800
+ },
8801
+ /** Removes messages from nodeId, all the messages that have the groupId passed, until it reaches one that doesn't */
8802
+ removeMessagesSentByNodeIds: (nodeIds) => {
8803
+ const {
8804
+ state,
8805
+ flow
8806
+ } = currentFlow.value;
8807
+ invariant$1(state === "loaded", "Application not loaded");
8808
+ const messages = flow.data.messages.filter((message) => !message.groupId || !nodeIds.includes(message.groupId));
8809
+ flow.data.messages = messages;
8810
+ idb.setStateData(flow);
8811
+ },
8812
+ setSubmission: (fieldKey, submission) => updateFlowState((data) => {
8813
+ if (submission === null) {
8814
+ delete data.submissions[fieldKey];
8815
+ } else {
8816
+ data.submissions[fieldKey] = submission;
9039
8817
  }
9040
- };
8818
+ return data;
8819
+ }),
8820
+ setInput: (input) => updateFlowState((data) => ({
8821
+ ...data,
8822
+ currentInput: input ?? null
8823
+ }))
8824
+ };
8825
+ const genRandomId = () => typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : Math.random().toString(36).slice(2);
8826
+ const initialiseFlowStateData = () => ({
8827
+ messages: [],
8828
+ submissions: {},
8829
+ currentInput: null,
8830
+ nodeHistory: [],
8831
+ isFinished: false,
8832
+ sequence: 0,
8833
+ flowSessionId: genRandomId()
8834
+ });
8835
+ var _ = 0;
8836
+ function o(o2, e2, n2, t2, f2, l2) {
8837
+ var s2, u2, a2 = {};
8838
+ for (u2 in e2)
8839
+ "ref" == u2 ? s2 = e2[u2] : a2[u2] = e2[u2];
8840
+ var i2 = { type: o2, props: a2, key: n2, ref: s2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --_, __source: f2, __self: l2 };
8841
+ if ("function" == typeof o2 && (s2 = o2.defaultProps))
8842
+ for (u2 in s2)
8843
+ void 0 === a2[u2] && (a2[u2] = s2[u2]);
8844
+ return l$4.vnode && l$4.vnode(i2), i2;
8845
+ }
8846
+ const ChatError = ({
8847
+ message
8848
+ }) => {
8849
+ return o("div", {
8850
+ class: "flex flex-grow flex-col items-center justify-center",
8851
+ children: [o("svg", {
8852
+ class: "text-error-9 h-16 w-16",
8853
+ fill: "none",
8854
+ xmlns: "http://www.w3.org/2000/svg",
8855
+ "stroke-width": "2",
8856
+ stroke: "currentColor",
8857
+ "stroke-linecap": "round",
8858
+ viewBox: "0 0 96 96",
8859
+ children: [o("path", {
8860
+ d: "M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z",
8861
+ fill: "#fff"
8862
+ }), o("path", {
8863
+ d: "M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z"
8864
+ }), o("line", {
8865
+ x1: "36.7",
8866
+ y1: "39.3",
8867
+ x2: "44.8",
8868
+ y2: "47.4"
8869
+ }), o("line", {
8870
+ x1: "52.2",
8871
+ y1: "39.3",
8872
+ x2: "60.3",
8873
+ y2: "47.4"
8874
+ }), o("line", {
8875
+ x1: "44.7",
8876
+ y1: "39.2",
8877
+ x2: "36.6",
8878
+ y2: "47.3"
8879
+ }), o("line", {
8880
+ x1: "60.2",
8881
+ y1: "39.2",
8882
+ x2: "52.1",
8883
+ y2: "47.3"
8884
+ }), o("path", {
8885
+ d: "M38 56h19"
8886
+ })]
8887
+ }), o("div", {
8888
+ class: "flex flex-col gap-2 text-center",
8889
+ children: [o("p", {
8890
+ class: "text-error-11 font-bold",
8891
+ children: "Something unexpected happened"
8892
+ }), message && o("p", {
8893
+ class: "text-neutral-9 text-sm",
8894
+ children: message
8895
+ })]
8896
+ })]
8897
+ });
8898
+ };
8899
+ const LoadingIndicator = (props) => o("svg", {
8900
+ role: "img",
8901
+ viewBox: "0 0 24 24",
8902
+ ...props,
8903
+ children: [o("title", {
8904
+ children: "Loading"
8905
+ }), o("style", {
8906
+ children: `#s1{animation:3s linear infinite forwards s1__to}@keyframes s1__to{0%{transform:translate(12px,0)}66.666667%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,12px)}}#s2{animation:3s linear infinite forwards s2__ts}@keyframes s2__ts{0%{transform:scale(0,0)}70%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%{transform:scale(1,1)}}#s3{animation:3s linear infinite forwards s3__to}@keyframes s3__to{0%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,33.333333%{transform:translate(12px,24px)}}#s4{animation:3s linear infinite forwards s4__ts}@keyframes s4__ts{0%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%,30%{transform:scale(0,0)}}#s5{animation:3s linear infinite forwards s5__to}@keyframes s5__to{0%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}33.333333%{transform:translate(12px,12.045742px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,66.666667%{transform:translate(12px,24px)}}#s6{animation:3s linear infinite forwards s6__ts}@keyframes s6__ts{0%,100%,63.333333%{transform:scale(0,0)}3.333333%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}33.333333%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}#s7{animation:3s linear infinite forwards s7__to}@keyframes s7__to{0%{transform:translate(12px,0)}33.333333%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}66.666667%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,24px)}}#s8{animation:3s linear infinite forwards s8__ts}@keyframes s8__ts{0%,100%,96.666667%{transform:scale(0,0)}36.666667%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}66.666667%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}`
8907
+ }), o("g", {
8908
+ id: "s1",
8909
+ transform: "translate(12,0)",
8910
+ children: o("g", {
8911
+ id: "s2",
8912
+ transform: "scale(0,0)",
8913
+ children: o("circle", {
8914
+ r: "6.5",
8915
+ transform: "translate(0,0)",
8916
+ fill: "currentColor"
8917
+ })
8918
+ })
8919
+ }), o("g", {
8920
+ id: "s3",
8921
+ transform: "translate(12,12)",
8922
+ children: o("g", {
8923
+ id: "s4",
8924
+ transform: "scale(1,1)",
8925
+ children: o("circle", {
8926
+ r: "6.5",
8927
+ transform: "translate(0,0)",
8928
+ fill: "currentColor"
8929
+ })
8930
+ })
8931
+ }), o("g", {
8932
+ id: "s5",
8933
+ transform: "translate(12,0)",
8934
+ children: o("g", {
8935
+ id: "s6",
8936
+ transform: "scale(0,0)",
8937
+ children: o("path", {
8938
+ d: "M6.5,13c3.5899,0,6.5-2.9101,6.5-6.5s-2.9101-6.5-6.5-6.5-6.5,2.91015-6.5,6.5s2.91015,6.5,6.5,6.5Zm0-4C7.88071,9,9,7.88071,9,6.5s-1.11929-2.5-2.5-2.5-2.5,1.11929-2.5,2.5s1.11929,2.5,2.5,2.5Z",
8939
+ transform: "translate(-6.5,-6.5)",
8940
+ "clip-rule": "evenodd",
8941
+ fill: "currentColor",
8942
+ "fill-rule": "evenodd"
8943
+ })
8944
+ })
8945
+ }), o("g", {
8946
+ id: "s7",
8947
+ transform: "translate(12,0)",
8948
+ children: o("g", {
8949
+ id: "s8",
8950
+ transform: "scale(0,0)",
8951
+ children: o("path", {
8952
+ d: "M0,6c0,3.58984,2.91016,6.5,6.5,6.5s6.5-2.91016,6.5-6.5h-4C9,7.38086,7.88086,8.5,6.5,8.5s-2.5-1.11914-2.5-2.5h-4Z",
8953
+ transform: "translate(-6.5,-9.25)",
8954
+ fill: "currentColor"
8955
+ })
8956
+ })
8957
+ })]
8958
+ });
8959
+ const ChatLoading = () => o("div", {
8960
+ class: "flex flex-grow flex-col items-center justify-center",
8961
+ children: o(LoadingIndicator, {
8962
+ class: "text-neutral-6 h-8 w-8"
8963
+ })
8964
+ });
8965
+ function r(e2) {
8966
+ var t2, f2, n2 = "";
8967
+ if ("string" == typeof e2 || "number" == typeof e2)
8968
+ n2 += e2;
8969
+ else if ("object" == typeof e2)
8970
+ if (Array.isArray(e2))
8971
+ for (t2 = 0; t2 < e2.length; t2++)
8972
+ e2[t2] && (f2 = r(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
8973
+ else
8974
+ for (t2 in e2)
8975
+ e2[t2] && (n2 && (n2 += " "), n2 += t2);
8976
+ return n2;
8977
+ }
8978
+ function clsx() {
8979
+ for (var e2, t2, f2 = 0, n2 = ""; f2 < arguments.length; )
8980
+ (e2 = arguments[f2++]) && (t2 = r(e2)) && (n2 && (n2 += " "), n2 += t2);
8981
+ return n2;
9041
8982
  }
9042
- const ApplicationSchema = object({
9043
- job: object({
9044
- id: coerce(string(), String),
9045
- title: string()
9046
- }),
8983
+ const optimisticProgress = (progress2) => {
8984
+ const prefilled = 0.1;
8985
+ const unitProgress = progress2 / 100;
8986
+ const concavity = 1.3;
8987
+ if (progress2 < 0)
8988
+ return "0%";
8989
+ if (progress2 > 100)
8990
+ return "100%";
8991
+ return `${Math.round((1 - (1 - prefilled) * Math.pow(1 - unitProgress, concavity)) * 100)}%`;
8992
+ };
8993
+ const StatusbarIconButton = ({
8994
+ class: className,
8995
+ children,
8996
+ ...props
8997
+ }) => {
8998
+ return o("button", {
8999
+ class: clsx("touch-hitbox text-interactive-copy hover:text-interactive-copy-hover active:text-interactive-copy-active hover:bg-interactive-bg-hover active:bg-interactive-bg-active fr relative rounded-full p-2 transition-all", className),
9000
+ ...props,
9001
+ children: o("svg", {
9002
+ class: "block",
9003
+ width: "16",
9004
+ height: "16",
9005
+ viewBox: "0 0 16 16",
9006
+ fill: "none",
9007
+ stroke: "currentColor",
9008
+ "stroke-width": "1.5",
9009
+ "stroke-linecap": "round",
9010
+ xmlns: "http://www.w3.org/2000/svg",
9011
+ children
9012
+ })
9013
+ });
9014
+ };
9015
+ const ProgressBar = () => {
9016
+ if (store.current$.value.state !== "loaded")
9017
+ return null;
9018
+ const nodeIdToProgress = store.current$.value.flow.nodeIdToProgress;
9019
+ const currentNodeId = store.current$.value.flow.data.nodeHistory.at(-1);
9020
+ if (currentNodeId === void 0)
9021
+ return null;
9022
+ const currentProgress = nodeIdToProgress[currentNodeId];
9023
+ if (currentProgress === void 0)
9024
+ return null;
9025
+ const percentage = 100 * (currentProgress.stepsMade / (currentProgress.remainingSteps + currentProgress.stepsMade));
9026
+ return o("div", {
9027
+ style: {
9028
+ width: optimisticProgress(percentage)
9029
+ },
9030
+ class: "bg-accent-9 h-[2px] transition-all duration-1000"
9031
+ });
9032
+ };
9033
+ const StatusBar = ({
9034
+ children
9035
+ }) => {
9036
+ const view = store.viewState$;
9037
+ return o(k$3, {
9038
+ children: o("header", {
9039
+ class: "ring-divider bg-statusbar absolute left-0 right-0 top-0 z-20 mx-auto items-center ring-1 backdrop-blur-md backdrop-saturate-150",
9040
+ children: [o("div", {
9041
+ class: "flex h-[var(--header-height)] gap-2",
9042
+ children: [o("p", {
9043
+ id: "chatbot-status-bar",
9044
+ class: "sr-only",
9045
+ children
9046
+ }), o("button", {
9047
+ tabIndex: -1,
9048
+ "aria-hidden": true,
9049
+ onClick: () => {
9050
+ if (view.value === "minimised") {
9051
+ view.value = "maximised";
9052
+ } else {
9053
+ view.value = "minimised";
9054
+ }
9055
+ },
9056
+ class: "h-full flex-grow overflow-hidden px-4 py-1",
9057
+ children: o("p", {
9058
+ "aria-hidden": true,
9059
+ class: "text-neutral-12 truncate text-sm font-bold tracking-tight",
9060
+ children
9061
+ })
9062
+ }), o("div", {
9063
+ class: "flex flex-shrink-0 items-center gap-3 p-1.5",
9064
+ children: view.value === "minimised" ? o(k$3, {
9065
+ children: [o(StatusbarIconButton, {
9066
+ "aria-label": "Maximise job application",
9067
+ onClick: () => view.value = "maximised",
9068
+ children: o("path", {
9069
+ d: "M12.5 9.5L8 5L3.5 9.5"
9070
+ })
9071
+ }, "minmax"), o(StatusbarIconButton, {
9072
+ "aria-label": "Close application",
9073
+ onClick: store.cancelCurrentFlow,
9074
+ children: o("path", {
9075
+ d: "M12.5 6.5L8 11L3.5 6.5"
9076
+ })
9077
+ }, "close")]
9078
+ }) : o(k$3, {
9079
+ children: [store.current$.value.state === "loaded" && o(StatusbarIconButton, {
9080
+ "aria-label": "Restart",
9081
+ onClick: () => {
9082
+ store.restart();
9083
+ },
9084
+ children: [o("path", {
9085
+ d: "M12 8.5C12 9.29113 11.7654 10.0645 11.3259 10.7223C10.8864 11.3801 10.2616 11.8928 9.53073 12.1955C8.79983 12.4983 7.99556 12.5775 7.21964 12.4231C6.44371 12.2688 5.73098 11.8878 5.17157 11.3284C4.61216 10.769 4.2312 10.0563 4.07686 9.28036C3.92252 8.50444 4.00173 7.70017 4.30448 6.96927C4.60723 6.23836 5.11992 5.61365 5.77772 5.17412C6.43552 4.7346 7.20887 4.5 8 4.5H9"
9086
+ }), o("path", {
9087
+ d: "M8 7L10 4.5L8 2.5"
9088
+ })]
9089
+ }, "restart"), o(StatusbarIconButton, {
9090
+ "aria-label": "Minimise application",
9091
+ onClick: () => view.value = "minimised",
9092
+ children: o("path", {
9093
+ d: "M12.5 6.5L8 11L3.5 6.5"
9094
+ })
9095
+ }, "minmax")]
9096
+ })
9097
+ })]
9098
+ }), o(ProgressBar, {})]
9099
+ })
9100
+ });
9101
+ };
9102
+ const ChatbotBody = M(() => import("./chatbot-body-04c70e40.js").then((module) => module.ChatbotBody));
9103
+ const MotionProvider = ({
9104
+ children
9105
+ }) => {
9106
+ return o(LazyMotion, {
9107
+ features: domAnimation,
9108
+ children
9109
+ });
9110
+ };
9111
+ const chatbotVariants = {
9112
+ closed: {
9113
+ y: "calc(100% + 1rem)",
9114
+ height: HEADER_HEIGHT
9115
+ },
9116
+ maximised: {
9117
+ y: 0,
9118
+ height: "75vh"
9119
+ },
9120
+ minimised: {
9121
+ y: 0,
9122
+ height: HEADER_HEIGHT
9123
+ }
9124
+ };
9125
+ const Chatbot = ({
9126
+ logger,
9127
+ apiClient,
9128
+ analytics
9129
+ }) => {
9130
+ const {
9131
+ state,
9132
+ flow,
9133
+ error
9134
+ } = store.current$.value;
9135
+ const view = store.viewState$.value;
9136
+ const isApplying = state !== "idle" && view === "maximised";
9137
+ const drawerRef = _$4(null);
9138
+ return o(MotionProvider, {
9139
+ children: o($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, {
9140
+ open: isApplying,
9141
+ modal: isApplying,
9142
+ children: o(AnimatePresence, {
9143
+ children: [o($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, {
9144
+ forceMount: true,
9145
+ asChild: true,
9146
+ children: isApplying && o(m$1.div, {
9147
+ initial: {
9148
+ opacity: 0
9149
+ },
9150
+ animate: {
9151
+ opacity: 1
9152
+ },
9153
+ exit: {
9154
+ opacity: 0
9155
+ },
9156
+ class: "bg-overlay fixed inset-0"
9157
+ })
9158
+ }, "bg"), o($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, {
9159
+ forceMount: true,
9160
+ asChild: true,
9161
+ children: o(m$1.div, {
9162
+ ref: drawerRef,
9163
+ "aria-modal": "true",
9164
+ role: "dialog",
9165
+ "aria-labelledby": "chatbot-status-bar",
9166
+ variants: chatbotVariants,
9167
+ initial: "closed",
9168
+ animate: N({
9169
+ state,
9170
+ view
9171
+ }).with({
9172
+ state: "idle"
9173
+ }, () => "closed").with({
9174
+ state: _$3.union("loaded", "error", "loading")
9175
+ }, ({
9176
+ view: view2
9177
+ }) => view2).exhaustive(),
9178
+ exit: "closed",
9179
+ style: {
9180
+ "--header-height": `${HEADER_HEIGHT}px`
9181
+ },
9182
+ class: "selection:bg-accent-4 selection:text-accent-12 fixed bottom-2 left-2 right-2 isolate mx-auto max-h-full max-w-[450px] focus:outline-none",
9183
+ children: o("div", {
9184
+ class: "outline-neutral-3 bg-neutral-1 relative flex h-full flex-col overflow-hidden rounded-3xl outline outline-1",
9185
+ children: [o(StatusBar, {
9186
+ children: flow == null ? void 0 : flow.title
9187
+ }), (() => {
9188
+ if (view !== "maximised")
9189
+ return null;
9190
+ switch (state) {
9191
+ case "idle":
9192
+ return null;
9193
+ case "loading":
9194
+ return o(ChatLoading, {}, "loading");
9195
+ case "loaded":
9196
+ return o(D, {
9197
+ fallback: o(ChatLoading, {}, "loading"),
9198
+ children: o(ChatbotBody, {
9199
+ analytics,
9200
+ apiClient,
9201
+ logger
9202
+ })
9203
+ });
9204
+ case "error":
9205
+ return o(ChatError, {
9206
+ message: error
9207
+ });
9208
+ default:
9209
+ exhaustive(state);
9210
+ }
9211
+ })()]
9212
+ })
9213
+ }, "content")
9214
+ })]
9215
+ })
9216
+ })
9217
+ });
9218
+ };
9219
+ const FlowSchema = object({
9220
+ id: coerce(string(), String),
9221
+ version: number$1(),
9222
+ nodes: array(any())
9223
+ });
9224
+ const FlowByIdPayloadSchema = object({
9225
+ flow: FlowSchema
9226
+ });
9227
+ const FlowByJobPayloadSchema = object({
9047
9228
  company: object({
9048
- name: string(),
9049
- logo: optional(string())
9229
+ name: string()
9050
9230
  }),
9051
- flow: object({
9231
+ flow: FlowSchema,
9232
+ job: object({
9052
9233
  id: coerce(string(), String),
9053
- version: number(),
9054
- nodes: array(any())
9234
+ title: string()
9055
9235
  })
9056
9236
  });
9057
- async function getApplicationData({
9058
- jobId,
9059
- apiClient,
9060
- logger
9061
- }) {
9062
- try {
9063
- const rawData = await apiClient.fetch(`/flow/job/${jobId}`);
9064
- return {
9065
- ok: true,
9066
- value: parse(ApplicationSchema, rawData)
9067
- };
9068
- } catch (e2) {
9069
- if (e2 instanceof ValiError) {
9070
- logger.error(flatten$1(e2).nested);
9071
- return {
9072
- ok: false,
9073
- error: "API error: Invalid application data received"
9074
- };
9075
- }
9076
- if (e2 instanceof NotFoundError) {
9077
- return {
9078
- ok: false,
9079
- error: "Application flow not found."
9080
- };
9081
- }
9082
- if (e2 instanceof Error) {
9083
- logger.error(e2);
9084
- return {
9085
- ok: false,
9086
- error: e2.message
9087
- };
9088
- }
9089
- logger.error(e2);
9090
- return {
9091
- ok: false,
9092
- error: "Unknown error"
9093
- };
9094
- }
9095
- }
9096
- const tailwind = "#isdk {\n position: relative;\n z-index: 99999;\n font-size: 16px;\n font-family: sans-serif;\n\n /* Lowest colour */\n --i-lowest: 0 0% 100%;\n\n /** Error colours */\n --i-e-1: 340 100% 99%;\n --i-e-2: 353 100% 98%;\n --i-e-3: 351 91% 96%;\n --i-e-4: 351 100% 93%;\n --i-e-5: 350 100% 90%;\n --i-e-6: 351 80% 86%;\n --i-e-7: 349 68% 81%;\n --i-e-8: 348 61% 74%;\n --i-e-9: 348 75% 59%;\n --i-e-10: 347 70% 55%;\n --i-e-11: 345 70% 47%;\n --i-e-12: 344 63% 24%;\n --tw-content: '';\n font-family:\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n Open Sans,\n Helvetica Neue,\n sans-serif;\n}\n\n #isdk * {\n box-sizing: border-box;\n border-style: solid;\n border-width: 0;\n -webkit-tap-highlight-color: transparent;\n }\n\n #isdk ::before,\n #isdk ::after {\n box-sizing: border-box;\n }\n\n #isdk :is(ul, ol) {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n #isdk :is(p) {\n margin: 0;\n padding: 0;\n }\n\n #isdk :is(li) {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n #isdk :is(button) {\n margin: 0;\n padding: 0;\n border: unset;\n background: unset;\n text-align: unset;\n }\n\n #isdk *, #isdk ::before, #isdk ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n\n #isdk ::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n\n #isdk .container {\n width: 100%;\n}\n\n @media (min-width: 640px) {\n\n #isdk .container {\n max-width: 640px;\n }\n}\n\n @media (min-width: 768px) {\n\n #isdk .container {\n max-width: 768px;\n }\n}\n\n @media (min-width: 1024px) {\n\n #isdk .container {\n max-width: 1024px;\n }\n}\n\n @media (min-width: 1280px) {\n\n #isdk .container {\n max-width: 1280px;\n }\n}\n\n @media (min-width: 1536px) {\n\n #isdk .container {\n max-width: 1536px;\n }\n}\n\n #isdk .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n #isdk .visible {\n visibility: visible;\n}\n\n #isdk .collapse {\n visibility: collapse;\n}\n\n #isdk .static {\n position: static;\n}\n\n #isdk .fixed {\n position: fixed;\n}\n\n #isdk .absolute {\n position: absolute;\n}\n\n #isdk .relative {\n position: relative;\n}\n\n #isdk .sticky {\n position: sticky;\n}\n\n #isdk .inset-0 {\n inset: 0px;\n}\n\n #isdk .bottom-0 {\n bottom: 0px;\n}\n\n #isdk .bottom-2 {\n bottom: 0.5rem;\n}\n\n #isdk .left-0 {\n left: 0px;\n}\n\n #isdk .left-2 {\n left: 0.5rem;\n}\n\n #isdk .right-0 {\n right: 0px;\n}\n\n #isdk .right-2 {\n right: 0.5rem;\n}\n\n #isdk .top-0 {\n top: 0px;\n}\n\n #isdk .isolate {\n isolation: isolate;\n}\n\n #isdk .z-20 {\n z-index: 20;\n}\n\n #isdk .mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n #isdk .mb-1 {\n margin-bottom: 0.25rem;\n}\n\n #isdk .ml-auto {\n margin-left: auto;\n}\n\n #isdk .block {\n display: block;\n}\n\n #isdk .inline-block {\n display: inline-block;\n}\n\n #isdk .inline {\n display: inline;\n}\n\n #isdk .flex {\n display: flex;\n}\n\n #isdk .inline-flex {\n display: inline-flex;\n}\n\n #isdk .table {\n display: table;\n}\n\n #isdk .table-row {\n display: table-row;\n}\n\n #isdk .flow-root {\n display: flow-root;\n}\n\n #isdk .grid {\n display: grid;\n}\n\n #isdk .inline-grid {\n display: inline-grid;\n}\n\n #isdk .contents {\n display: contents;\n}\n\n #isdk .list-item {\n display: list-item;\n}\n\n #isdk .\\!hidden {\n display: none !important;\n}\n\n #isdk .hidden {\n display: none;\n}\n\n #isdk .h-1 {\n height: 0.25rem;\n}\n\n #isdk .h-1\\.5 {\n height: 0.375rem;\n}\n\n #isdk .h-16 {\n height: 4rem;\n}\n\n #isdk .h-4 {\n height: 1rem;\n}\n\n #isdk .h-48 {\n height: 12rem;\n}\n\n #isdk .h-8 {\n height: 2rem;\n}\n\n #isdk .h-\\[2px\\] {\n height: 2px;\n}\n\n #isdk .h-\\[var\\(--header-height\\)\\] {\n height: var(--header-height);\n}\n\n #isdk .h-full {\n height: 100%;\n}\n\n #isdk .max-h-full {\n max-height: 100%;\n}\n\n #isdk .min-h-\\[36px\\] {\n min-height: 36px;\n}\n\n #isdk .w-1 {\n width: 0.25rem;\n}\n\n #isdk .w-1\\.5 {\n width: 0.375rem;\n}\n\n #isdk .w-16 {\n width: 4rem;\n}\n\n #isdk .w-4 {\n width: 1rem;\n}\n\n #isdk .w-8 {\n width: 2rem;\n}\n\n #isdk .w-full {\n width: 100%;\n}\n\n #isdk .min-w-0 {\n min-width: 0px;\n}\n\n #isdk .min-w-\\[2rem\\] {\n min-width: 2rem;\n}\n\n #isdk .max-w-\\[450px\\] {\n max-width: 450px;\n}\n\n #isdk .max-w-\\[min\\(100\\%\\2c 24rem\\)\\] {\n max-width: min(100%,24rem);\n}\n\n #isdk .max-w-full {\n max-width: 100%;\n}\n\n #isdk .flex-1 {\n flex: 1 1 0%;\n}\n\n #isdk .flex-none {\n flex: none;\n}\n\n #isdk .flex-shrink {\n flex-shrink: 1;\n}\n\n #isdk .flex-shrink-0 {\n flex-shrink: 0;\n}\n\n #isdk .shrink {\n flex-shrink: 1;\n}\n\n #isdk .flex-grow {\n flex-grow: 1;\n}\n\n #isdk .grow {\n flex-grow: 1;\n}\n\n #isdk .border-collapse {\n border-collapse: collapse;\n}\n\n #isdk .translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n #isdk .translate-y-8 {\n --tw-translate-y: 2rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n #isdk .scale-0 {\n --tw-scale-x: 0;\n --tw-scale-y: 0;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n #isdk .transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n @keyframes bounce {\n\n 0%, 100% {\n transform: translateY(-25%);\n animation-timing-function: cubic-bezier(0.8,0,1,1);\n }\n\n 50% {\n transform: none;\n animation-timing-function: cubic-bezier(0,0,0.2,1);\n }\n}\n\n #isdk .animate-bounce {\n animation: bounce 1s infinite;\n}\n\n #isdk .cursor-pointer {\n cursor: pointer;\n}\n\n #isdk .select-none {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n #isdk .resize {\n resize: both;\n}\n\n #isdk .flex-col {\n flex-direction: column;\n}\n\n #isdk .flex-wrap {\n flex-wrap: wrap;\n}\n\n #isdk .items-center {\n align-items: center;\n}\n\n #isdk .justify-end {\n justify-content: flex-end;\n}\n\n #isdk .justify-center {\n justify-content: center;\n}\n\n #isdk .gap-0 {\n gap: 0px;\n}\n\n #isdk .gap-1 {\n gap: 0.25rem;\n}\n\n #isdk .gap-1\\.5 {\n gap: 0.375rem;\n}\n\n #isdk .gap-2 {\n gap: 0.5rem;\n}\n\n #isdk .gap-3 {\n gap: 0.75rem;\n}\n\n #isdk .gap-4 {\n gap: 1rem;\n}\n\n #isdk .gap-px {\n gap: 1px;\n}\n\n #isdk .overflow-hidden {\n overflow: hidden;\n}\n\n #isdk .overflow-y-auto {\n overflow-y: auto;\n}\n\n #isdk .overflow-y-scroll {\n overflow-y: scroll;\n}\n\n #isdk .truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n #isdk .break-words {\n overflow-wrap: break-word;\n}\n\n #isdk .rounded {\n border-radius: 0.25rem;\n}\n\n #isdk .rounded-2xl {\n border-radius: 1rem;\n}\n\n #isdk .rounded-3xl {\n border-radius: 1.5rem;\n}\n\n #isdk .rounded-\\[18px\\] {\n border-radius: 18px;\n}\n\n #isdk .rounded-full {\n border-radius: 9999px;\n}\n\n #isdk .rounded-lg {\n border-radius: 0.5rem;\n}\n\n #isdk .rounded-md {\n border-radius: 0.375rem;\n}\n\n #isdk .rounded-xl {\n border-radius: 0.75rem;\n}\n\n #isdk .rounded-b-3xl {\n border-bottom-right-radius: 1.5rem;\n border-bottom-left-radius: 1.5rem;\n}\n\n #isdk .rounded-bl-md {\n border-bottom-left-radius: 0.375rem;\n}\n\n #isdk .rounded-br-md {\n border-bottom-right-radius: 0.375rem;\n}\n\n #isdk .border {\n border-width: 1px;\n}\n\n #isdk .border-t {\n border-top-width: 1px;\n}\n\n #isdk .border-dashed {\n border-style: dashed;\n}\n\n #isdk .border-divider {\n border-color: var(--i-color-divider);\n}\n\n #isdk .border-neutral-8 {\n border-color: var(--i-color-n-8);\n}\n\n #isdk .bg-accent-1 {\n background-color: var(--i-color-a-1);\n}\n\n #isdk .bg-accent-3 {\n background-color: var(--i-color-a-3);\n}\n\n #isdk .bg-accent-8 {\n background-color: var(--i-color-a-8);\n}\n\n #isdk .bg-accent-9 {\n background-color: var(--i-color-a-9);\n}\n\n #isdk .bg-bubble-weak-bg {\n background-color: var(--i-bubble-weak-bg);\n}\n\n #isdk .bg-lowest {\n background-color: var(--i-color-lowest);\n}\n\n #isdk .bg-neutral-1 {\n background-color: var(--i-color-n-1);\n}\n\n #isdk .bg-neutral-2 {\n background-color: var(--i-color-n-2);\n}\n\n #isdk .bg-overlay {\n background-color: var(--i-overlay-bg);\n}\n\n #isdk .bg-statusbar {\n background-color: var(--i-status-bar-bg);\n}\n\n #isdk .bg-transparent {\n background-color: transparent;\n}\n\n #isdk .p-1 {\n padding: 0.25rem;\n}\n\n #isdk .p-1\\.5 {\n padding: 0.375rem;\n}\n\n #isdk .p-2 {\n padding: 0.5rem;\n}\n\n #isdk .p-2\\.5 {\n padding: 0.625rem;\n}\n\n #isdk .p-4 {\n padding: 1rem;\n}\n\n #isdk .px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n\n #isdk .px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n\n #isdk .px-2\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n}\n\n #isdk .px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n\n #isdk .px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n #isdk .py-0 {\n padding-top: 0px;\n padding-bottom: 0px;\n}\n\n #isdk .py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n}\n\n #isdk .py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n\n #isdk .py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n #isdk .py-2\\.5 {\n padding-top: 0.625rem;\n padding-bottom: 0.625rem;\n}\n\n #isdk .py-\\[6px\\] {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n\n #isdk .pb-2 {\n padding-bottom: 0.5rem;\n}\n\n #isdk .pb-6 {\n padding-bottom: 1.5rem;\n}\n\n #isdk .pl-2 {\n padding-left: 0.5rem;\n}\n\n #isdk .pl-4 {\n padding-left: 1rem;\n}\n\n #isdk .pr-1 {\n padding-right: 0.25rem;\n}\n\n #isdk .pr-2 {\n padding-right: 0.5rem;\n}\n\n #isdk .pr-2\\.5 {\n padding-right: 0.625rem;\n}\n\n #isdk .pr-3 {\n padding-right: 0.75rem;\n}\n\n #isdk .pr-4 {\n padding-right: 1rem;\n}\n\n #isdk .pt-5 {\n padding-top: 1.25rem;\n}\n\n #isdk .pt-\\[calc\\(var\\(--header-height\\)\\+1rem\\)\\] {\n padding-top: calc(var(--header-height) + 1rem);\n}\n\n #isdk .text-center {\n text-align: center;\n}\n\n #isdk .text-justify {\n text-align: justify;\n}\n\n #isdk .text-\\[10px\\] {\n font-size: 10px;\n}\n\n #isdk .text-\\[11px\\] {\n font-size: 11px;\n}\n\n #isdk .text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n #isdk .text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n #isdk .text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n #isdk .font-bold {\n font-weight: 700;\n}\n\n #isdk .uppercase {\n text-transform: uppercase;\n}\n\n #isdk .lowercase {\n text-transform: lowercase;\n}\n\n #isdk .capitalize {\n text-transform: capitalize;\n}\n\n #isdk .italic {\n font-style: italic;\n}\n\n #isdk .ordinal {\n --tw-ordinal: ordinal;\n font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);\n}\n\n #isdk .leading-snug {\n line-height: 1.375;\n}\n\n #isdk .tracking-\\[-0\\.01em\\] {\n letter-spacing: -0.01em;\n}\n\n #isdk .tracking-tight {\n letter-spacing: -0.025em;\n}\n\n #isdk .tracking-wide {\n letter-spacing: 0.025em;\n}\n\n #isdk .tracking-widest {\n letter-spacing: 0.1em;\n}\n\n #isdk .text-\\[\\#4CAF50\\] {\n --tw-text-opacity: 1;\n color: rgb(76 175 80 / var(--tw-text-opacity));\n}\n\n #isdk .text-\\[\\#FFC107\\] {\n --tw-text-opacity: 1;\n color: rgb(255 193 7 / var(--tw-text-opacity));\n}\n\n #isdk .text-accent-11 {\n color: var(--i-color-a-11);\n}\n\n #isdk .text-accent-12 {\n color: var(--i-color-a-12);\n}\n\n #isdk .text-accent-9 {\n color: var(--i-color-a-9);\n}\n\n #isdk .text-error-11 {\n color: var(--i-color-e-11);\n}\n\n #isdk .text-error-9 {\n color: var(--i-color-e-9);\n}\n\n #isdk .text-interactive-copy {\n color: var(--i-interactive-copy);\n}\n\n #isdk .text-neutral-10 {\n color: var(--i-color-n-10);\n}\n\n #isdk .text-neutral-11 {\n color: var(--i-color-n-11);\n}\n\n #isdk .text-neutral-12 {\n color: var(--i-color-n-12);\n}\n\n #isdk .text-neutral-6 {\n color: var(--i-color-n-6);\n}\n\n #isdk .text-neutral-8 {\n color: var(--i-color-n-8);\n}\n\n #isdk .text-neutral-9 {\n color: var(--i-color-n-9);\n}\n\n #isdk .text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n #isdk .underline {\n text-decoration-line: underline;\n}\n\n #isdk .no-underline {\n text-decoration-line: none;\n}\n\n #isdk .underline-offset-2 {\n text-underline-offset: 2px;\n}\n\n #isdk .caret-accent-9 {\n caret-color: var(--i-color-a-9);\n}\n\n #isdk .opacity-0 {\n opacity: 0;\n}\n\n #isdk .opacity-100 {\n opacity: 1;\n}\n\n #isdk .shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n #isdk .shadow-surface-md {\n --tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / 0.03), 0px 6px 4px 0px oklch(0% 0 0 / 0.02), 0px 6px 4px 0px oklch(0% 0 0 / 0.01);\n --tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n #isdk .shadow-surface-sm {\n --tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / 0.03), 0px 4px 4px 0px oklch(0% 0 0 / 0.02);\n --tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 4px 4px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n #isdk .shadow-bubble-strong-shadow {\n --tw-shadow-color: var(--i-bubble-strong-shadow);\n --tw-shadow: var(--tw-shadow-colored);\n}\n\n #isdk .outline {\n outline-style: solid;\n}\n\n #isdk .outline-1 {\n outline-width: 1px;\n}\n\n #isdk .outline-2 {\n outline-width: 2px;\n}\n\n #isdk .outline-accent-4 {\n outline-color: var(--i-color-a-4);\n}\n\n #isdk .outline-bubble-weak {\n outline-color: var(--i-bubble-weak-outline);\n}\n\n #isdk .outline-divider {\n outline-color: var(--i-color-divider);\n}\n\n #isdk .outline-neutral-3 {\n outline-color: var(--i-color-n-3);\n}\n\n #isdk .outline-neutral-6 {\n outline-color: var(--i-color-n-6);\n}\n\n #isdk .ring-0 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .ring-2 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .ring-accent-6 {\n --tw-ring-color: var(--i-color-a-6);\n}\n\n #isdk .ring-divider {\n --tw-ring-color: var(--i-color-divider);\n}\n\n #isdk .ring-lowest {\n --tw-ring-color: var(--i-color-lowest);\n}\n\n #isdk .ring-transparent {\n --tw-ring-color: transparent;\n}\n\n #isdk .blur {\n --tw-blur: blur(8px);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .drop-shadow {\n --tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06));\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .drop-shadow-\\[0_1\\.5px_var\\(--i-color-n-1\\)\\] {\n --tw-drop-shadow: drop-shadow(0 1.5px var(--i-color-n-1));\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .grayscale {\n --tw-grayscale: grayscale(100%);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .invert {\n --tw-invert: invert(100%);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .sepia {\n --tw-sepia: sepia(100%);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .backdrop-blur-md {\n --tw-backdrop-blur: blur(12px);\n -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n\n #isdk .backdrop-saturate-150 {\n --tw-backdrop-saturate: saturate(1.5);\n -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n\n #isdk .backdrop-filter {\n -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n\n #isdk .transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n #isdk .transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n #isdk .duration-1000 {\n transition-duration: 1000ms;\n}\n\n #isdk .ease-expo-out {\n transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n #isdk .ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n #isdk .text-wrap-balance {\n text-wrap: balance;\n}\n\n #isdk .fr {\n outline: none;\n}\n\n #isdk .fr:focus {\n outline: none;\n}\n\n #isdk .fr:focus-visible {\n outline: none;\n --tw-ring-offset-width: 1px;\n --tw-ring-offset-color: var(--i-color-lowest);\n --tw-ring-opacity: 1;\n --tw-ring-color: var(--i-color-a-9);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .gutter-stable {\n scrollbar-gutter: stable;\n}\n\n #isdk .hide-scrollbars::-webkit-scrollbar {\n display: none;\n}\n\n #isdk .hide-scrollbars {\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n #isdk .touch-hitbox::before {\n content: '';\n position: absolute;\n display: block;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n min-height: 44px;\n min-width: 44px;\n z-index: 9999;\n}\n\n #isdk .\\[a-zA-Z0-9-_\\:\\.\\$\\@\\?\\] {\n a-z-a--z0-9-_: .$@?;\n}\n\n #isdk .\\[text-wrap\\:pretty\\] {\n text-wrap: pretty;\n}\n\n #isdk .selection\\:bg-accent-4 *::-moz-selection {\n background-color: var(--i-color-a-4);\n}\n\n #isdk .selection\\:bg-accent-4 *::selection {\n background-color: var(--i-color-a-4);\n}\n\n #isdk .selection\\:bg-transparent *::-moz-selection {\n background-color: transparent;\n}\n\n #isdk .selection\\:bg-transparent *::selection {\n background-color: transparent;\n}\n\n #isdk .selection\\:text-accent-12 *::-moz-selection {\n color: var(--i-color-a-12);\n}\n\n #isdk .selection\\:text-accent-12 *::selection {\n color: var(--i-color-a-12);\n}\n\n #isdk .selection\\:bg-accent-4::-moz-selection {\n background-color: var(--i-color-a-4);\n}\n\n #isdk .selection\\:bg-accent-4::selection {\n background-color: var(--i-color-a-4);\n}\n\n #isdk .selection\\:bg-transparent::-moz-selection {\n background-color: transparent;\n}\n\n #isdk .selection\\:bg-transparent::selection {\n background-color: transparent;\n}\n\n #isdk .selection\\:text-accent-12::-moz-selection {\n color: var(--i-color-a-12);\n}\n\n #isdk .selection\\:text-accent-12::selection {\n color: var(--i-color-a-12);\n}\n\n #isdk .placeholder\\:text-neutral-10::-moz-placeholder {\n color: var(--i-color-n-10);\n}\n\n #isdk .placeholder\\:text-neutral-10::placeholder {\n color: var(--i-color-n-10);\n}\n\n #isdk .hover\\:bg-interactive-bg-hover:hover {\n background-color: var(--i-interactive-bg-hover);\n}\n\n #isdk .hover\\:text-interactive-copy-hover:hover {\n color: var(--i-interactive-copy-hover);\n}\n\n #isdk .hover\\:ring-accent-8:hover {\n --tw-ring-color: var(--i-color-a-8);\n}\n\n #isdk .focus\\:outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n #isdk .focus-visible\\:outline-accent-7:focus-visible {\n outline-color: var(--i-color-a-7);\n}\n\n #isdk .focus-visible\\:ring-4:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .focus-visible\\:ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n\n #isdk .active\\:bg-accent-10:active {\n background-color: var(--i-color-a-10);\n}\n\n #isdk .active\\:bg-accent-2:active {\n background-color: var(--i-color-a-2);\n}\n\n #isdk .active\\:bg-interactive-bg-active:active {\n background-color: var(--i-interactive-bg-active);\n}\n\n #isdk .active\\:text-accent-10:active {\n color: var(--i-color-a-10);\n}\n\n #isdk .active\\:text-accent-11:active {\n color: var(--i-color-a-11);\n}\n\n #isdk .active\\:text-interactive-copy-active:active {\n color: var(--i-interactive-copy-active);\n}\n\n #isdk .active\\:outline-neutral-10:active {\n outline-color: var(--i-color-n-10);\n}\n\n #isdk .active\\:ring-accent-7:active {\n --tw-ring-color: var(--i-color-a-7);\n}\n\n #isdk .disabled\\:cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n\n #isdk .disabled\\:opacity-50:disabled {\n opacity: 0.5;\n}\n\n #isdk .peer:checked ~ .peer-checked\\:bg-accent-2 {\n background-color: var(--i-color-a-2);\n}\n\n #isdk .peer:checked ~ .peer-checked\\:text-accent-9 {\n color: var(--i-color-a-9);\n}\n\n #isdk .peer:checked ~ .peer-checked\\:outline-accent-7 {\n outline-color: var(--i-color-a-7);\n}\n\n #isdk .peer:focus-visible ~ .peer-focus-visible\\:ring-4 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .peer:focus-visible ~ .peer-focus-visible\\:ring-accent-7 {\n --tw-ring-color: var(--i-color-a-7);\n}\n\n #isdk .peer:focus-visible ~ .peer-focus-visible\\:ring-offset-2 {\n --tw-ring-offset-width: 2px;\n}\n\n @media (pointer: coarse) {\n\n #isdk .pointer-coarse\\:touch-hitbox\\:\\:before::before {\n content: '';\n position: absolute;\n display: block;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n min-height: 44px;\n min-width: 44px;\n z-index: 9999;\n }\n}\n";
9237
+ const StartFlowSchema = object({
9238
+ flow: FlowSchema,
9239
+ title: string(),
9240
+ flowKeys: array(string()),
9241
+ context: record(string(), any())
9242
+ });
9243
+ const tailwind = "#isdk {\n position: relative;\n z-index: 99999;\n font-size: 16px;\n font-family: sans-serif;\n\n /* Lowest colour */\n --i-lowest: 0 0% 100%;\n\n /** Error colours */\n --i-e-1: 340 100% 99%;\n --i-e-2: 353 100% 98%;\n --i-e-3: 351 91% 96%;\n --i-e-4: 351 100% 93%;\n --i-e-5: 350 100% 90%;\n --i-e-6: 351 80% 86%;\n --i-e-7: 349 68% 81%;\n --i-e-8: 348 61% 74%;\n --i-e-9: 348 75% 59%;\n --i-e-10: 347 70% 55%;\n --i-e-11: 345 70% 47%;\n --i-e-12: 344 63% 24%;\n --tw-content: '';\n font-family:\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n Open Sans,\n Helvetica Neue,\n sans-serif;\n}\n\n #isdk * {\n font-weight: inherit;\n font-style: inherit;\n box-sizing: border-box;\n font-family: inherit;\n border-style: solid;\n border-width: 0;\n -webkit-tap-highlight-color: transparent;\n }\n\n #isdk ::before,\n #isdk ::after {\n box-sizing: border-box;\n }\n\n #isdk :is(ul, ol) {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n #isdk :is(p) {\n margin: 0;\n padding: 0;\n }\n\n #isdk :is(li) {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n #isdk :is(button) {\n margin: 0;\n padding: 0;\n border: unset;\n background: unset;\n text-align: unset;\n }\n\n #isdk *, #isdk ::before, #isdk ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n\n #isdk ::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n\n #isdk .container {\n width: 100%;\n}\n\n @media (min-width: 640px) {\n\n #isdk .container {\n max-width: 640px;\n }\n}\n\n @media (min-width: 768px) {\n\n #isdk .container {\n max-width: 768px;\n }\n}\n\n @media (min-width: 1024px) {\n\n #isdk .container {\n max-width: 1024px;\n }\n}\n\n @media (min-width: 1280px) {\n\n #isdk .container {\n max-width: 1280px;\n }\n}\n\n @media (min-width: 1536px) {\n\n #isdk .container {\n max-width: 1536px;\n }\n}\n\n #isdk .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n #isdk .visible {\n visibility: visible;\n}\n\n #isdk .collapse {\n visibility: collapse;\n}\n\n #isdk .static {\n position: static;\n}\n\n #isdk .fixed {\n position: fixed;\n}\n\n #isdk .absolute {\n position: absolute;\n}\n\n #isdk .relative {\n position: relative;\n}\n\n #isdk .sticky {\n position: sticky;\n}\n\n #isdk .inset-0 {\n inset: 0px;\n}\n\n #isdk .bottom-0 {\n bottom: 0px;\n}\n\n #isdk .bottom-2 {\n bottom: 0.5rem;\n}\n\n #isdk .bottom-\\[2px\\] {\n bottom: 2px;\n}\n\n #isdk .left-0 {\n left: 0px;\n}\n\n #isdk .left-2 {\n left: 0.5rem;\n}\n\n #isdk .right-0 {\n right: 0px;\n}\n\n #isdk .right-2 {\n right: 0.5rem;\n}\n\n #isdk .top-0 {\n top: 0px;\n}\n\n #isdk .top-\\[-2px\\] {\n top: -2px;\n}\n\n #isdk .isolate {\n isolation: isolate;\n}\n\n #isdk .z-20 {\n z-index: 20;\n}\n\n #isdk .mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n #isdk .mb-1 {\n margin-bottom: 0.25rem;\n}\n\n #isdk .ml-auto {\n margin-left: auto;\n}\n\n #isdk .block {\n display: block;\n}\n\n #isdk .inline-block {\n display: inline-block;\n}\n\n #isdk .inline {\n display: inline;\n}\n\n #isdk .flex {\n display: flex;\n}\n\n #isdk .inline-flex {\n display: inline-flex;\n}\n\n #isdk .table {\n display: table;\n}\n\n #isdk .table-row {\n display: table-row;\n}\n\n #isdk .flow-root {\n display: flow-root;\n}\n\n #isdk .grid {\n display: grid;\n}\n\n #isdk .inline-grid {\n display: inline-grid;\n}\n\n #isdk .contents {\n display: contents;\n}\n\n #isdk .list-item {\n display: list-item;\n}\n\n #isdk .\\!hidden {\n display: none !important;\n}\n\n #isdk .hidden {\n display: none;\n}\n\n #isdk .h-1 {\n height: 0.25rem;\n}\n\n #isdk .h-1\\.5 {\n height: 0.375rem;\n}\n\n #isdk .h-16 {\n height: 4rem;\n}\n\n #isdk .h-4 {\n height: 1rem;\n}\n\n #isdk .h-48 {\n height: 12rem;\n}\n\n #isdk .h-8 {\n height: 2rem;\n}\n\n #isdk .h-\\[2px\\] {\n height: 2px;\n}\n\n #isdk .h-\\[var\\(--header-height\\)\\] {\n height: var(--header-height);\n}\n\n #isdk .h-full {\n height: 100%;\n}\n\n #isdk .max-h-full {\n max-height: 100%;\n}\n\n #isdk .min-h-\\[36px\\] {\n min-height: 36px;\n}\n\n #isdk .w-1 {\n width: 0.25rem;\n}\n\n #isdk .w-1\\.5 {\n width: 0.375rem;\n}\n\n #isdk .w-16 {\n width: 4rem;\n}\n\n #isdk .w-4 {\n width: 1rem;\n}\n\n #isdk .w-8 {\n width: 2rem;\n}\n\n #isdk .w-full {\n width: 100%;\n}\n\n #isdk .min-w-0 {\n min-width: 0px;\n}\n\n #isdk .min-w-\\[2rem\\] {\n min-width: 2rem;\n}\n\n #isdk .max-w-\\[450px\\] {\n max-width: 450px;\n}\n\n #isdk .max-w-\\[min\\(100\\%\\2c 24rem\\)\\] {\n max-width: min(100%,24rem);\n}\n\n #isdk .max-w-full {\n max-width: 100%;\n}\n\n #isdk .flex-1 {\n flex: 1 1 0%;\n}\n\n #isdk .flex-none {\n flex: none;\n}\n\n #isdk .flex-shrink {\n flex-shrink: 1;\n}\n\n #isdk .flex-shrink-0 {\n flex-shrink: 0;\n}\n\n #isdk .shrink {\n flex-shrink: 1;\n}\n\n #isdk .flex-grow {\n flex-grow: 1;\n}\n\n #isdk .grow {\n flex-grow: 1;\n}\n\n #isdk .border-collapse {\n border-collapse: collapse;\n}\n\n #isdk .translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n #isdk .translate-y-8 {\n --tw-translate-y: 2rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n #isdk .translate-y-full {\n --tw-translate-y: 100%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n #isdk .scale-0 {\n --tw-scale-x: 0;\n --tw-scale-y: 0;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n #isdk .transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n @keyframes bounce {\n\n 0%, 100% {\n transform: translateY(-25%);\n animation-timing-function: cubic-bezier(0.8,0,1,1);\n }\n\n 50% {\n transform: none;\n animation-timing-function: cubic-bezier(0,0,0.2,1);\n }\n}\n\n #isdk .animate-bounce {\n animation: bounce 1s infinite;\n}\n\n #isdk .cursor-pointer {\n cursor: pointer;\n}\n\n #isdk .select-none {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n #isdk .resize {\n resize: both;\n}\n\n #isdk .flex-col {\n flex-direction: column;\n}\n\n #isdk .flex-wrap {\n flex-wrap: wrap;\n}\n\n #isdk .items-center {\n align-items: center;\n}\n\n #isdk .justify-end {\n justify-content: flex-end;\n}\n\n #isdk .justify-center {\n justify-content: center;\n}\n\n #isdk .gap-0 {\n gap: 0px;\n}\n\n #isdk .gap-1 {\n gap: 0.25rem;\n}\n\n #isdk .gap-1\\.5 {\n gap: 0.375rem;\n}\n\n #isdk .gap-2 {\n gap: 0.5rem;\n}\n\n #isdk .gap-3 {\n gap: 0.75rem;\n}\n\n #isdk .gap-4 {\n gap: 1rem;\n}\n\n #isdk .gap-px {\n gap: 1px;\n}\n\n #isdk .overflow-hidden {\n overflow: hidden;\n}\n\n #isdk .overflow-y-auto {\n overflow-y: auto;\n}\n\n #isdk .overflow-y-scroll {\n overflow-y: scroll;\n}\n\n #isdk .truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n #isdk .break-words {\n overflow-wrap: break-word;\n}\n\n #isdk .rounded {\n border-radius: 0.25rem;\n}\n\n #isdk .rounded-2xl {\n border-radius: 1rem;\n}\n\n #isdk .rounded-3xl {\n border-radius: 1.5rem;\n}\n\n #isdk .rounded-\\[18px\\] {\n border-radius: 18px;\n}\n\n #isdk .rounded-full {\n border-radius: 9999px;\n}\n\n #isdk .rounded-lg {\n border-radius: 0.5rem;\n}\n\n #isdk .rounded-md {\n border-radius: 0.375rem;\n}\n\n #isdk .rounded-xl {\n border-radius: 0.75rem;\n}\n\n #isdk .rounded-b-3xl {\n border-bottom-right-radius: 1.5rem;\n border-bottom-left-radius: 1.5rem;\n}\n\n #isdk .rounded-bl-md {\n border-bottom-left-radius: 0.375rem;\n}\n\n #isdk .rounded-br-md {\n border-bottom-right-radius: 0.375rem;\n}\n\n #isdk .border {\n border-width: 1px;\n}\n\n #isdk .border-t {\n border-top-width: 1px;\n}\n\n #isdk .border-solid {\n border-style: solid;\n}\n\n #isdk .border-dashed {\n border-style: dashed;\n}\n\n #isdk .border-accent-9 {\n border-color: var(--i-color-a-9);\n}\n\n #isdk .border-divider {\n border-color: var(--i-color-divider);\n}\n\n #isdk .border-neutral-8 {\n border-color: var(--i-color-n-8);\n}\n\n #isdk .bg-accent-1 {\n background-color: var(--i-color-a-1);\n}\n\n #isdk .bg-accent-3 {\n background-color: var(--i-color-a-3);\n}\n\n #isdk .bg-accent-9 {\n background-color: var(--i-color-a-9);\n}\n\n #isdk .bg-bubble-weak-bg {\n background-color: var(--i-bubble-weak-bg);\n}\n\n #isdk .bg-lowest {\n background-color: var(--i-color-lowest);\n}\n\n #isdk .bg-neutral-1 {\n background-color: var(--i-color-n-1);\n}\n\n #isdk .bg-neutral-2 {\n background-color: var(--i-color-n-2);\n}\n\n #isdk .bg-overlay {\n background-color: var(--i-overlay-bg);\n}\n\n #isdk .bg-statusbar {\n background-color: var(--i-status-bar-bg);\n}\n\n #isdk .bg-transparent {\n background-color: transparent;\n}\n\n #isdk .p-1 {\n padding: 0.25rem;\n}\n\n #isdk .p-1\\.5 {\n padding: 0.375rem;\n}\n\n #isdk .p-2 {\n padding: 0.5rem;\n}\n\n #isdk .p-2\\.5 {\n padding: 0.625rem;\n}\n\n #isdk .p-4 {\n padding: 1rem;\n}\n\n #isdk .px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n\n #isdk .px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n\n #isdk .px-2\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n}\n\n #isdk .px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n\n #isdk .px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n #isdk .px-5 {\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n}\n\n #isdk .py-0 {\n padding-top: 0px;\n padding-bottom: 0px;\n}\n\n #isdk .py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n}\n\n #isdk .py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n\n #isdk .py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n #isdk .py-2\\.5 {\n padding-top: 0.625rem;\n padding-bottom: 0.625rem;\n}\n\n #isdk .py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n\n #isdk .py-\\[6px\\] {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n\n #isdk .pb-2 {\n padding-bottom: 0.5rem;\n}\n\n #isdk .pb-6 {\n padding-bottom: 1.5rem;\n}\n\n #isdk .pl-2 {\n padding-left: 0.5rem;\n}\n\n #isdk .pl-4 {\n padding-left: 1rem;\n}\n\n #isdk .pr-1 {\n padding-right: 0.25rem;\n}\n\n #isdk .pr-2 {\n padding-right: 0.5rem;\n}\n\n #isdk .pr-2\\.5 {\n padding-right: 0.625rem;\n}\n\n #isdk .pr-3 {\n padding-right: 0.75rem;\n}\n\n #isdk .pr-4 {\n padding-right: 1rem;\n}\n\n #isdk .pt-5 {\n padding-top: 1.25rem;\n}\n\n #isdk .pt-\\[calc\\(var\\(--header-height\\)\\+1rem\\)\\] {\n padding-top: calc(var(--header-height) + 1rem);\n}\n\n #isdk .text-center {\n text-align: center;\n}\n\n #isdk .text-right {\n text-align: right;\n}\n\n #isdk .text-justify {\n text-align: justify;\n}\n\n #isdk .text-\\[10px\\] {\n font-size: 10px;\n}\n\n #isdk .text-\\[11px\\] {\n font-size: 11px;\n}\n\n #isdk .text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n #isdk .text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n #isdk .text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n #isdk .font-bold {\n font-weight: 700;\n}\n\n #isdk .font-medium {\n font-weight: 500;\n}\n\n #isdk .uppercase {\n text-transform: uppercase;\n}\n\n #isdk .lowercase {\n text-transform: lowercase;\n}\n\n #isdk .capitalize {\n text-transform: capitalize;\n}\n\n #isdk .italic {\n font-style: italic;\n}\n\n #isdk .ordinal {\n --tw-ordinal: ordinal;\n font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);\n}\n\n #isdk .leading-snug {\n line-height: 1.375;\n}\n\n #isdk .tracking-\\[-0\\.01em\\] {\n letter-spacing: -0.01em;\n}\n\n #isdk .tracking-tight {\n letter-spacing: -0.025em;\n}\n\n #isdk .tracking-wide {\n letter-spacing: 0.025em;\n}\n\n #isdk .tracking-widest {\n letter-spacing: 0.1em;\n}\n\n #isdk .text-\\[\\#4CAF50\\] {\n --tw-text-opacity: 1;\n color: rgb(76 175 80 / var(--tw-text-opacity));\n}\n\n #isdk .text-\\[\\#FFC107\\] {\n --tw-text-opacity: 1;\n color: rgb(255 193 7 / var(--tw-text-opacity));\n}\n\n #isdk .text-accent-11 {\n color: var(--i-color-a-11);\n}\n\n #isdk .text-accent-12 {\n color: var(--i-color-a-12);\n}\n\n #isdk .text-accent-9 {\n color: var(--i-color-a-9);\n}\n\n #isdk .text-error-11 {\n color: var(--i-color-e-11);\n}\n\n #isdk .text-error-9 {\n color: var(--i-color-e-9);\n}\n\n #isdk .text-interactive-copy {\n color: var(--i-interactive-copy);\n}\n\n #isdk .text-neutral-10 {\n color: var(--i-color-n-10);\n}\n\n #isdk .text-neutral-11 {\n color: var(--i-color-n-11);\n}\n\n #isdk .text-neutral-12 {\n color: var(--i-color-n-12);\n}\n\n #isdk .text-neutral-6 {\n color: var(--i-color-n-6);\n}\n\n #isdk .text-neutral-8 {\n color: var(--i-color-n-8);\n}\n\n #isdk .text-neutral-9 {\n color: var(--i-color-n-9);\n}\n\n #isdk .text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n #isdk .underline {\n text-decoration-line: underline;\n}\n\n #isdk .no-underline {\n text-decoration-line: none;\n}\n\n #isdk .underline-offset-2 {\n text-underline-offset: 2px;\n}\n\n #isdk .caret-accent-9 {\n caret-color: var(--i-color-a-9);\n}\n\n #isdk .opacity-0 {\n opacity: 0;\n}\n\n #isdk .opacity-100 {\n opacity: 1;\n}\n\n #isdk .shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n #isdk .shadow-\\[inset_0px_-6px_2px_-1px_oklch\\(100_0_0\\/\\.45\\)\\2c inset_0px_1px_1px_oklch\\(100_0_0\\/\\.3\\)\\] {\n --tw-shadow: inset 0px -6px 2px -1px oklch(100 0 0/.45),inset 0px 1px 1px oklch(100 0 0/.3);\n --tw-shadow-colored: inset 0px -6px 2px -1px var(--tw-shadow-color), inset 0px 1px 1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n #isdk .shadow-surface-md {\n --tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / 0.03), 0px 6px 4px 0px oklch(0% 0 0 / 0.02), 0px 6px 4px 0px oklch(0% 0 0 / 0.01);\n --tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n #isdk .shadow-surface-sm {\n --tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / 0.03), 0px 4px 4px 0px oklch(0% 0 0 / 0.02);\n --tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 4px 4px 0px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n #isdk .shadow-bubble-strong-shadow {\n --tw-shadow-color: var(--i-bubble-strong-shadow);\n --tw-shadow: var(--tw-shadow-colored);\n}\n\n #isdk .outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n #isdk .outline {\n outline-style: solid;\n}\n\n #isdk .outline-1 {\n outline-width: 1px;\n}\n\n #isdk .outline-2 {\n outline-width: 2px;\n}\n\n #isdk .outline-accent-4 {\n outline-color: var(--i-color-a-4);\n}\n\n #isdk .outline-bubble-weak {\n outline-color: var(--i-bubble-weak-outline);\n}\n\n #isdk .outline-divider {\n outline-color: var(--i-color-divider);\n}\n\n #isdk .outline-neutral-3 {\n outline-color: var(--i-color-n-3);\n}\n\n #isdk .outline-neutral-6 {\n outline-color: var(--i-color-n-6);\n}\n\n #isdk .ring-0 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .ring-2 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .ring-accent-6 {\n --tw-ring-color: var(--i-color-a-6);\n}\n\n #isdk .ring-divider {\n --tw-ring-color: var(--i-color-divider);\n}\n\n #isdk .ring-lowest {\n --tw-ring-color: var(--i-color-lowest);\n}\n\n #isdk .ring-transparent {\n --tw-ring-color: transparent;\n}\n\n #isdk .ring-offset-\\[1\\.5px\\] {\n --tw-ring-offset-width: 1.5px;\n}\n\n #isdk .ring-offset-neutral-1 {\n --tw-ring-offset-color: var(--i-color-n-1);\n}\n\n #isdk .blur {\n --tw-blur: blur(8px);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .drop-shadow {\n --tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06));\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .drop-shadow-\\[0_1\\.5px_var\\(--i-color-n-1\\)\\] {\n --tw-drop-shadow: drop-shadow(0 1.5px var(--i-color-n-1));\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .grayscale {\n --tw-grayscale: grayscale(100%);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .invert {\n --tw-invert: invert(100%);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .sepia {\n --tw-sepia: sepia(100%);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n #isdk .backdrop-blur-md {\n --tw-backdrop-blur: blur(12px);\n -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n\n #isdk .backdrop-saturate-150 {\n --tw-backdrop-saturate: saturate(1.5);\n -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n\n #isdk .backdrop-filter {\n -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n\n #isdk .transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n #isdk .transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n #isdk .duration-1000 {\n transition-duration: 1000ms;\n}\n\n #isdk .duration-300 {\n transition-duration: 300ms;\n}\n\n #isdk .ease-expo-out {\n transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n #isdk .ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n #isdk .text-wrap-balance {\n text-wrap: balance;\n}\n\n #isdk .fr {\n outline: none;\n}\n\n #isdk .fr:focus {\n outline: none;\n}\n\n #isdk .fr:focus-visible {\n outline: none;\n --tw-ring-offset-width: 1px;\n --tw-ring-offset-color: var(--i-color-lowest);\n --tw-ring-opacity: 1;\n --tw-ring-color: var(--i-color-a-9);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .gutter-stable {\n scrollbar-gutter: stable;\n}\n\n #isdk .hide-scrollbars::-webkit-scrollbar {\n display: none;\n}\n\n #isdk .hide-scrollbars {\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n #isdk .touch-hitbox::before {\n content: '';\n position: absolute;\n display: block;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n min-height: 44px;\n min-width: 44px;\n z-index: 9999;\n}\n\n #isdk .\\[a-zA-Z0-9-_\\:\\.\\$\\@\\?\\] {\n a-z-a--z0-9-_: .$@?;\n}\n\n #isdk .\\[text-wrap\\:pretty\\] {\n text-wrap: pretty;\n}\n\n #isdk .selection\\:bg-accent-4 *::-moz-selection {\n background-color: var(--i-color-a-4);\n}\n\n #isdk .selection\\:bg-accent-4 *::selection {\n background-color: var(--i-color-a-4);\n}\n\n #isdk .selection\\:bg-transparent *::-moz-selection {\n background-color: transparent;\n}\n\n #isdk .selection\\:bg-transparent *::selection {\n background-color: transparent;\n}\n\n #isdk .selection\\:text-accent-12 *::-moz-selection {\n color: var(--i-color-a-12);\n}\n\n #isdk .selection\\:text-accent-12 *::selection {\n color: var(--i-color-a-12);\n}\n\n #isdk .selection\\:bg-accent-4::-moz-selection {\n background-color: var(--i-color-a-4);\n}\n\n #isdk .selection\\:bg-accent-4::selection {\n background-color: var(--i-color-a-4);\n}\n\n #isdk .selection\\:bg-transparent::-moz-selection {\n background-color: transparent;\n}\n\n #isdk .selection\\:bg-transparent::selection {\n background-color: transparent;\n}\n\n #isdk .selection\\:text-accent-12::-moz-selection {\n color: var(--i-color-a-12);\n}\n\n #isdk .selection\\:text-accent-12::selection {\n color: var(--i-color-a-12);\n}\n\n #isdk .placeholder\\:text-neutral-10::-moz-placeholder {\n color: var(--i-color-n-10);\n}\n\n #isdk .placeholder\\:text-neutral-10::placeholder {\n color: var(--i-color-n-10);\n}\n\n #isdk .hover\\:border-accent-10:hover {\n border-color: var(--i-color-a-10);\n}\n\n #isdk .hover\\:bg-accent-10:hover {\n background-color: var(--i-color-a-10);\n}\n\n #isdk .hover\\:bg-interactive-bg-hover:hover {\n background-color: var(--i-interactive-bg-hover);\n}\n\n #isdk .hover\\:text-interactive-copy-hover:hover {\n color: var(--i-interactive-copy-hover);\n}\n\n #isdk .hover\\:text-neutral-12:hover {\n color: var(--i-color-n-12);\n}\n\n #isdk .hover\\:ring-accent-8:hover {\n --tw-ring-color: var(--i-color-a-8);\n}\n\n #isdk .focus\\:outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n #isdk .focus-visible\\:outline-2:focus-visible {\n outline-width: 2px;\n}\n\n #isdk .focus-visible\\:outline-accent-7:focus-visible {\n outline-color: var(--i-color-a-7);\n}\n\n #isdk .focus-visible\\:outline-accent-8:focus-visible {\n outline-color: var(--i-color-a-8);\n}\n\n #isdk .focus-visible\\:ring-4:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .focus-visible\\:ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n\n #isdk .active\\:border-submit-bg-active:active {\n border-color: var(--i-submit-button-bg-active);\n}\n\n #isdk .active\\:bg-accent-10:active {\n background-color: var(--i-color-a-10);\n}\n\n #isdk .active\\:bg-accent-2:active {\n background-color: var(--i-color-a-2);\n}\n\n #isdk .active\\:bg-interactive-bg-active:active {\n background-color: var(--i-interactive-bg-active);\n}\n\n #isdk .active\\:bg-submit-bg-active:active {\n background-color: var(--i-submit-button-bg-active);\n}\n\n #isdk .active\\:text-accent-10:active {\n color: var(--i-color-a-10);\n}\n\n #isdk .active\\:text-accent-11:active {\n color: var(--i-color-a-11);\n}\n\n #isdk .active\\:text-interactive-copy-active:active {\n color: var(--i-interactive-copy-active);\n}\n\n #isdk .active\\:shadow-\\[inset_0px_0px_2px_-1px_oklch\\(100_0_0\\/\\.45\\)\\2c inset_0px_3px_1px_\\.5px_oklch\\(0_0_0\\/\\.08\\)\\]:active {\n --tw-shadow: inset 0px 0px 2px -1px oklch(100 0 0/.45),inset 0px 3px 1px .5px oklch(0 0 0/.08);\n --tw-shadow-colored: inset 0px 0px 2px -1px var(--tw-shadow-color), inset 0px 3px 1px .5px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n #isdk .active\\:outline-neutral-10:active {\n outline-color: var(--i-color-n-10);\n}\n\n #isdk .active\\:ring-2:active {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .active\\:ring-accent-7:active {\n --tw-ring-color: var(--i-color-a-7);\n}\n\n #isdk .active\\:ring-offset-2:active {\n --tw-ring-offset-width: 2px;\n}\n\n #isdk .disabled\\:cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n\n #isdk .disabled\\:opacity-50:disabled {\n opacity: 0.5;\n}\n\n #isdk .group:active .group-active\\:bottom-0 {\n bottom: 0px;\n}\n\n #isdk .group:active .group-active\\:top-0 {\n top: 0px;\n}\n\n #isdk .peer:checked ~ .peer-checked\\:bg-accent-2 {\n background-color: var(--i-color-a-2);\n}\n\n #isdk .peer:checked ~ .peer-checked\\:text-accent-9 {\n color: var(--i-color-a-9);\n}\n\n #isdk .peer:checked ~ .peer-checked\\:outline-accent-7 {\n outline-color: var(--i-color-a-7);\n}\n\n #isdk .peer:focus-visible ~ .peer-focus-visible\\:ring-4 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n #isdk .peer:focus-visible ~ .peer-focus-visible\\:ring-accent-7 {\n --tw-ring-color: var(--i-color-a-7);\n}\n\n #isdk .peer:focus-visible ~ .peer-focus-visible\\:ring-offset-2 {\n --tw-ring-offset-width: 2px;\n}\n\n @media (pointer: coarse) {\n\n #isdk .pointer-coarse\\:touch-hitbox\\:\\:before::before {\n content: '';\n position: absolute;\n display: block;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n min-height: 44px;\n min-width: 44px;\n z-index: 9999;\n }\n}\n";
9097
9244
  const createChatbotDomManager = () => {
9098
9245
  return {
9099
9246
  getOrCreateChatbotElement: () => {
@@ -9119,7 +9266,7 @@ var OKLCH_PRESETS = {
9119
9266
  "7": [80.5, 0.08],
9120
9267
  "8": [74, 0.11],
9121
9268
  "9": [60, 0.22],
9122
- "10": [60.5, 0.2],
9269
+ "10": [56, 0.23],
9123
9270
  "11": [50, 0.19],
9124
9271
  "12": [25, 0.18]
9125
9272
  },
@@ -9317,6 +9464,9 @@ const tokens = designTokens().core(({
9317
9464
  "bg-button": transparent,
9318
9465
  "bg-button-hover": withOpacity("n-10", 0.4),
9319
9466
  "bg-button-active": withOpacity("n-10", 0.5)
9467
+ },
9468
+ "submit-button": {
9469
+ "bg-active": core(theme.mode === "dark" ? "color.a-9" : "color.a-10")
9320
9470
  }
9321
9471
  };
9322
9472
  });
@@ -9359,7 +9509,7 @@ const chatbotPlugin = ({
9359
9509
  prepared = true;
9360
9510
  };
9361
9511
  return {
9362
- /** Optionally eagerly renders the interface ahead of application requests. */
9512
+ /** Optionally eagerly renders the interface ahead of needing the chatbot. */
9363
9513
  prepare: async () => {
9364
9514
  if (typeof window === "undefined")
9365
9515
  return;
@@ -9369,86 +9519,112 @@ const chatbotPlugin = ({
9369
9519
  renderAndPrepare();
9370
9520
  logger.info("Chatbot plugin prepared");
9371
9521
  } catch (error) {
9372
- console.error(error);
9373
9522
  logger.error("Error preparing chatbot plugin", error);
9374
9523
  }
9375
9524
  },
9376
- startApplication: async ({
9377
- jobId
9378
- }) => {
9525
+ /** Fetches a flow by job ID.
9526
+ * @param jobId - The job ID to fetch the flow for. This is the job ID according to the **ATS**, and not the inploi job ID.
9527
+ */
9528
+ fetchFlowByJobId: async (jobId) => apiClient.fetch(`/flow/job/${jobId}`).then((res) => {
9529
+ const data = parse$1(FlowByJobPayloadSchema, res);
9530
+ return {
9531
+ context: {
9532
+ job_id: data.job.id,
9533
+ flow_id: data.flow.id
9534
+ },
9535
+ flow: data.flow,
9536
+ title: `Applying for “${data.job.title}”`,
9537
+ flowKeys: [data.job.id]
9538
+ };
9539
+ }),
9540
+ fetchFlowById: async (flowId) => apiClient.fetch(`/flow/${flowId}`).then((res) => {
9541
+ const data = parse$1(FlowByIdPayloadSchema, res);
9542
+ return {
9543
+ flow: data.flow,
9544
+ context: {
9545
+ flow_id: data.flow.id
9546
+ },
9547
+ title: "Chatbot",
9548
+ flowKeys: []
9549
+ };
9550
+ }),
9551
+ open: async (params) => {
9379
9552
  if (typeof window === "undefined")
9380
9553
  return;
9381
9554
  try {
9382
- application.cancel();
9383
- n$1(() => {
9384
- viewState.value = "maximised";
9385
- application.current$.value = {
9555
+ store.cancelCurrentFlow();
9556
+ store.viewState$.value = "maximised";
9557
+ if (params instanceof Promise) {
9558
+ store.current$.value = {
9386
9559
  state: "loading"
9387
9560
  };
9388
- });
9389
- getApplicationData({
9390
- jobId,
9391
- apiClient,
9392
- logger
9393
- }).then(async (res) => {
9394
- if (res.ok) {
9395
- application.start(res.value);
9396
- } else {
9397
- application.current$.value = {
9561
+ params.then(async (params2) => {
9562
+ const parsedParams = parse$1(StartFlowSchema, params2);
9563
+ store.startFlow(parsedParams);
9564
+ }).catch((error) => {
9565
+ const message = error instanceof Error ? error.message : "An error occurred";
9566
+ store.current$.value = {
9398
9567
  state: "error",
9399
- error: res.error
9568
+ error: message
9400
9569
  };
9401
- }
9402
- });
9403
- if (!prepared)
9404
- renderAndPrepare();
9570
+ });
9571
+ } else {
9572
+ store.startFlow(params);
9573
+ }
9405
9574
  } catch (error) {
9406
- console.error(error);
9407
- logger.error("Error starting application", error);
9575
+ logger.error("Error starting flow", error);
9408
9576
  }
9409
9577
  },
9410
- closeApplication: async () => {
9578
+ /** @deprecated - Please use `open` instead. */
9579
+ startApplication: void 0,
9580
+ /** @deprecated - Please use `close` instead */
9581
+ closeApplication: void 0,
9582
+ close: async () => {
9411
9583
  if (typeof window === "undefined")
9412
9584
  return;
9413
- logger.info("Closing application from an external source");
9414
- application.cancel();
9585
+ store.cancelCurrentFlow();
9586
+ logger.info("Closed flow from an external source");
9415
9587
  }
9416
9588
  };
9417
9589
  });
9418
9590
  export {
9419
- AnimatePresence as A,
9420
- chatbotPlugin as B,
9591
+ AbortedError as A,
9592
+ url as B,
9421
9593
  Cn as C,
9422
- ERROR_MESSAGES as E,
9594
+ regex as D,
9595
+ m$1 as E,
9423
9596
  F$1 as F,
9597
+ AnimatePresence as G,
9598
+ ERROR_MESSAGES as H,
9599
+ chatbotPlugin as I,
9424
9600
  N,
9425
9601
  T$2 as T,
9426
9602
  ValiError as V,
9427
- _$1 as _,
9428
- _$4 as a,
9429
- parse as b,
9603
+ _$3 as _,
9604
+ getFlowSubmissionsPayload as a,
9605
+ a as b,
9430
9606
  clsx as c,
9431
- picklist as d,
9432
- application as e,
9433
- h$1 as f,
9434
- parseAsync as g,
9607
+ _$4 as d,
9608
+ parse$1 as e,
9609
+ picklist as f,
9610
+ getHeadOrThrow as g,
9435
9611
  hasProp as h,
9436
9612
  invariant$1 as i,
9437
- object as j,
9438
- k$3 as k,
9439
- minLength as l,
9440
- maxLength as m,
9441
- boolean as n,
9613
+ h$1 as j,
9614
+ kbToReadableSize as k,
9615
+ k$3 as l,
9616
+ isSubmissionOfType as m,
9617
+ parseAsync as n,
9442
9618
  o,
9443
9619
  p$3 as p,
9444
- email as q,
9445
- record as r,
9446
- string as s,
9620
+ object as q,
9621
+ maxLength as r,
9622
+ store as s,
9447
9623
  transform as t,
9448
- url as u,
9449
- regex as v,
9450
- inputHeight as w,
9451
- m$1 as x,
9624
+ minLength as u,
9625
+ record as v,
9626
+ boolean as w,
9627
+ string as x,
9452
9628
  y$2 as y,
9453
- viewState as z
9629
+ email as z
9454
9630
  };