@encatch/ws-react 0.0.35 → 0.0.36

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.
@@ -18010,7 +18010,7 @@ function xN() {
18010
18010
  return N();
18011
18011
  } }), P(B), mr(B, (E) => $(M, E), () => l(M)), z(i, B), Je(ue);
18012
18012
  }
18013
- customElements.define("encatch-form", yd(hf, { themeMode: {}, feedbackConfiguration: {}, apiKey: {}, hostUrl: {}, deviceInfo: {}, sessionId: {}, userInfo: {}, language: {}, configurationData: {}, onClose: {}, trackPopupHeight: {}, feedbackConfigId: {}, identifier: {}, cssLinks: {} }, [], [], !0));
18013
+ yd(hf, { themeMode: {}, feedbackConfiguration: {}, apiKey: {}, hostUrl: {}, deviceInfo: {}, sessionId: {}, userInfo: {}, language: {}, configurationData: {}, onClose: {}, trackPopupHeight: {}, feedbackConfigId: {}, identifier: {}, cssLinks: {} }, [], [], !0);
18014
18014
  const cx = hf, lx = Us;
18015
18015
  o.App = Ds, o.EncatchApp = Us, o.EncatchAppElement = lx, o.EncatchFormElement = cx, o.PopupUi = gf, Object.defineProperty(o, Symbol.toStringTag, { value: "Module" });
18016
18016
  }));
@@ -1,5 +1,5 @@
1
1
  import I, { useState as U, useRef as se, useEffect as S, useCallback as ie } from "react";
2
- var k = { exports: {} }, P = {};
2
+ var k = { exports: {} }, A = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -11,7 +11,7 @@ var k = { exports: {} }, P = {};
11
11
  */
12
12
  var J;
13
13
  function ue() {
14
- if (J) return P;
14
+ if (J) return A;
15
15
  J = 1;
16
16
  var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
17
17
  function n(u, s, c) {
@@ -29,9 +29,9 @@ function ue() {
29
29
  props: c
30
30
  };
31
31
  }
32
- return P.Fragment = r, P.jsx = n, P.jsxs = n, P;
32
+ return A.Fragment = r, A.jsx = n, A.jsxs = n, A;
33
33
  }
34
- var A = {};
34
+ var P = {};
35
35
  /**
36
36
  * @license React
37
37
  * react-jsx-runtime.development.js
@@ -146,17 +146,17 @@ function ce() {
146
146
  }
147
147
  function R() {
148
148
  var e = t(this.type);
149
- return W[e] || (W[e] = !0, console.error(
149
+ return q[e] || (q[e] = !0, console.error(
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
151
  )), e = this.props.ref, e !== void 0 ? e : null;
152
152
  }
153
- function T(e, o, l, d, w, E, x, j) {
153
+ function T(e, o, l, d, g, E, x, j) {
154
154
  return l = E.ref, e = {
155
155
  $$typeof: y,
156
156
  type: e,
157
157
  key: o,
158
158
  props: E,
159
- _owner: w
159
+ _owner: g
160
160
  }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
161
161
  enumerable: !1,
162
162
  get: R
@@ -182,19 +182,19 @@ function ce() {
182
182
  value: j
183
183
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
184
184
  }
185
- function h(e, o, l, d, w, E, x, j) {
185
+ function h(e, o, l, d, g, E, x, j) {
186
186
  var b = o.children;
187
187
  if (b !== void 0)
188
188
  if (d)
189
189
  if (ne(b)) {
190
190
  for (d = 0; d < b.length; d++)
191
- v(b[d]);
191
+ w(b[d]);
192
192
  Object.freeze && Object.freeze(b);
193
193
  } else
194
194
  console.error(
195
195
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
196
196
  );
197
- else v(b);
197
+ else w(b);
198
198
  if (Y.call(o, "key")) {
199
199
  b = t(e);
200
200
  var _ = Object.keys(o).filter(function(oe) {
@@ -225,14 +225,14 @@ React keys must be passed directly to JSX without using spread:
225
225
  e,
226
226
  b,
227
227
  E,
228
- w,
228
+ g,
229
229
  s(),
230
230
  l,
231
231
  x,
232
232
  j
233
233
  );
234
234
  }
235
- function v(e) {
235
+ function w(e) {
236
236
  typeof e == "object" && e !== null && e.$$typeof === y && e._store && (e._store.validated = 1);
237
237
  }
238
238
  var a = I, y = Symbol.for("react.transitional.element"), i = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), Q = Symbol.for("react.strict_mode"), X = Symbol.for("react.profiler"), B = Symbol.for("react.consumer"), H = Symbol.for("react.context"), Z = Symbol.for("react.forward_ref"), K = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), ee = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), re = Symbol.for("react.activity"), te = Symbol.for("react.client.reference"), C = a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, ne = Array.isArray, O = console.createTask ? console.createTask : function() {
@@ -243,11 +243,11 @@ React keys must be passed directly to JSX without using spread:
243
243
  return e();
244
244
  }
245
245
  };
246
- var L, W = {}, $ = a.react_stack_bottom_frame.bind(
246
+ var L, q = {}, W = a.react_stack_bottom_frame.bind(
247
247
  a,
248
248
  c
249
- )(), q = O(u(c)), V = {};
250
- A.Fragment = f, A.jsx = function(e, o, l, d, w) {
249
+ )(), $ = O(u(c)), V = {};
250
+ P.Fragment = f, P.jsx = function(e, o, l, d, g) {
251
251
  var E = 1e4 > C.recentlyCreatedOwnerStacks++;
252
252
  return h(
253
253
  e,
@@ -255,11 +255,11 @@ React keys must be passed directly to JSX without using spread:
255
255
  l,
256
256
  !1,
257
257
  d,
258
- w,
259
- E ? Error("react-stack-top-frame") : $,
260
- E ? O(u(e)) : q
258
+ g,
259
+ E ? Error("react-stack-top-frame") : W,
260
+ E ? O(u(e)) : $
261
261
  );
262
- }, A.jsxs = function(e, o, l, d, w) {
262
+ }, P.jsxs = function(e, o, l, d, g) {
263
263
  var E = 1e4 > C.recentlyCreatedOwnerStacks++;
264
264
  return h(
265
265
  e,
@@ -267,12 +267,12 @@ React keys must be passed directly to JSX without using spread:
267
267
  l,
268
268
  !0,
269
269
  d,
270
- w,
271
- E ? Error("react-stack-top-frame") : $,
272
- E ? O(u(e)) : q
270
+ g,
271
+ E ? Error("react-stack-top-frame") : W,
272
+ E ? O(u(e)) : $
273
273
  );
274
274
  };
275
- })()), A;
275
+ })()), P;
276
276
  }
277
277
  var G;
278
278
  function ae() {
@@ -386,8 +386,8 @@ class fe extends EventTarget {
386
386
  }));
387
387
  }
388
388
  }
389
- const g = new fe(), M = "encatch-app-react";
390
- typeof window < "u" && import("./web-form-engine-core.umd-AECjqIjA.js").then((t) => t.w).then(({ EncatchAppElement: t }) => {
389
+ const v = new fe(), M = "encatch-app-react";
390
+ typeof window < "u" && import("./web-form-engine-core.umd-DWVcgyyq.js").then((t) => t.w).then(({ EncatchAppElement: t }) => {
391
391
  try {
392
392
  customElements.get(M) || customElements.define(M, t);
393
393
  } catch (r) {
@@ -402,7 +402,7 @@ const be = ({
402
402
  instanceId: s,
403
403
  onFormEvent: c
404
404
  }) => {
405
- const [m, p] = U(!1), [R, T] = U(!0), h = I.useRef(null), v = I.useRef(
405
+ const [m, p] = U(!1), [R, T] = U(!0), h = I.useRef(null), w = I.useRef(
406
406
  null
407
407
  ), a = se({});
408
408
  S(() => {
@@ -431,37 +431,37 @@ const be = ({
431
431
  if (!s) return;
432
432
  const i = [];
433
433
  return a.current.onSubmit && i.push(
434
- g.subscribe(
434
+ v.subscribe(
435
435
  "form:submit",
436
436
  a.current.onSubmit,
437
437
  { formId: s }
438
438
  )
439
439
  ), a.current.onView && i.push(
440
- g.subscribe(
440
+ v.subscribe(
441
441
  "form:view",
442
442
  a.current.onView,
443
443
  { formId: s }
444
444
  )
445
445
  ), a.current.onClose && i.push(
446
- g.subscribe(
446
+ v.subscribe(
447
447
  "form:close",
448
448
  a.current.onClose,
449
449
  { formId: s }
450
450
  )
451
451
  ), a.current.onSectionChange && i.push(
452
- g.subscribe(
452
+ v.subscribe(
453
453
  "form:section:change",
454
454
  a.current.onSectionChange,
455
455
  { formId: s }
456
456
  )
457
457
  ), a.current.onQuestionAnswered && i.push(
458
- g.subscribe(
458
+ v.subscribe(
459
459
  "form:question:answered",
460
460
  a.current.onQuestionAnswered,
461
461
  { formId: s }
462
462
  )
463
463
  ), a.current.onError && i.push(
464
- g.subscribe(
464
+ v.subscribe(
465
465
  "form:error",
466
466
  a.current.onError,
467
467
  { formId: s }
@@ -487,20 +487,22 @@ const be = ({
487
487
  if (!m || !h.current)
488
488
  return;
489
489
  const i = document.createElement(M);
490
- return i.theme = t.theme, i.currentMode = t.currentMode, i.currentLanguage = t.currentLanguage, i.questions = t.questions, i.questionLanguages = t.questionLanguages, i.otherConfigurationProperties = t.otherConfigurationProperties, i.welcomeScreenProperties = t.welcomeScreenProperties, i.endScreenProperties = t.endScreenProperties, i.translations = t.translations, i.sections = t.sections, i.themeSettings = t.themeSettings, i.onClose = y, i.onSectionChange = t.onSectionChange, i.apiKey = t.apiKey, i.hostUrl = t.hostUrl, i.feedbackConfigId = t.feedbackConfigId, i.identifier = t.identifier, r && (i.cssLink = r), i.scale = n, i.persistMode = u, s && (i.instanceId = s), v.current = i, h.current.appendChild(i), () => {
491
- h.current && v.current && h.current.removeChild(v.current), v.current = null;
490
+ return w.current = i, h.current.appendChild(i), requestAnimationFrame(() => {
491
+ w.current && (i.theme = t.theme, i.currentMode = t.currentMode, i.currentLanguage = t.currentLanguage, i.questions = t.questions, i.questionLanguages = t.questionLanguages, i.otherConfigurationProperties = t.otherConfigurationProperties, i.welcomeScreenProperties = t.welcomeScreenProperties, i.endScreenProperties = t.endScreenProperties, i.translations = t.translations, i.sections = t.sections, i.themeSettings = t.themeSettings, i.onClose = y, i.onSectionChange = t.onSectionChange, i.apiKey = t.apiKey, i.hostUrl = t.hostUrl, i.feedbackConfigId = t.feedbackConfigId, i.identifier = t.identifier, r && (i.cssLink = r), i.scale = n, i.persistMode = u, s && (i.instanceId = s));
492
+ }), () => {
493
+ h.current && w.current && h.current.removeChild(w.current), w.current = null;
492
494
  };
493
495
  }, [m, t, r, n, y, u, s]), R ? /* @__PURE__ */ le.jsx("div", { ref: h }) : null;
494
496
  };
495
497
  function me(t, r, n) {
496
- S(() => g.subscribe(
498
+ S(() => v.subscribe(
497
499
  t,
498
500
  r,
499
501
  n
500
502
  ), [t, n?.formId, r]);
501
503
  }
502
504
  function pe(t, r) {
503
- S(() => g.subscribeAll(t, r), [r?.formId, t]);
505
+ S(() => v.subscribeAll(t, r), [r?.formId, t]);
504
506
  }
505
507
  export {
506
508
  be as EncatchPreview,
@@ -19,7 +19,7 @@
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,qt,Ht,Mt,Ht),lo[Ht+qt]=!0)}if(Ht=null,Ct!==void 0&&(o(Ct),Ht=""+Ct),m(Be)&&(o(Be.key),Ht=""+Be.key),"key"in Be){Ct={};for(var Kn in Be)Kn!=="key"&&(Ct[Kn]=Be[Kn])}else Ct=Be;return Ht&&_(Ct,typeof ve=="function"?ve.displayName||ve.name||"Unknown":ve),K(ve,Ht,Dr,$t,t(),Ct,Yn,bi)}function se(ve){typeof ve=="object"&&ve!==null&&ve.$$typeof===be&&ve._store&&(ve._store.validated=1)}var ze=or,be=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),_e=Symbol.for("react.fragment"),Ae=Symbol.for("react.strict_mode"),ht=Symbol.for("react.profiler"),ct=Symbol.for("react.consumer"),mt=Symbol.for("react.context"),bt=Symbol.for("react.forward_ref"),mr=Symbol.for("react.suspense"),Hr=Symbol.for("react.suspense_list"),Kt=Symbol.for("react.memo"),$a=Symbol.for("react.lazy"),fc=Symbol.for("react.activity"),wa=Symbol.for("react.client.reference"),uo=ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Vn=Object.prototype.hasOwnProperty,mc=Array.isArray,Jn=console.createTask?console.createTask:function(){return null};ze={react_stack_bottom_frame:function(ve){return ve()}};var Bn,Sn={},Ur=ze.react_stack_bottom_frame.bind(ze,s)(),co=Jn(a(s)),lo={};Zi.Fragment=_e,Zi.jsx=function(ve,Be,Ct,qt,$t){var Dr=1e4>uo.recentlyCreatedOwnerStacks++;return fe(ve,Be,Ct,!1,qt,$t,Dr?Error("react-stack-top-frame"):Ur,Dr?Jn(a(ve)):co)},Zi.jsxs=function(ve,Be,Ct,qt,$t){var Dr=1e4>uo.recentlyCreatedOwnerStacks++;return fe(ve,Be,Ct,!0,qt,$t,Dr?Error("react-stack-top-frame"):Ur,Dr?Jn(a(ve)):co)}})()),Zi}var pl;function Kb(){return pl||(pl=1,process.env.NODE_ENV==="production"?Oo.exports=Bb():Oo.exports=Yb()),Oo.exports}var Hb=Kb();class Xb extends EventTarget{subscriptions=new Map;targetOrigin="*";matchesFilter(r,o){return!o||o==="*"||o===null||o===void 0?!0:typeof o=="string"?r===o:Array.isArray(o)?o.includes(r||""):typeof o=="function"?o(r||""):!1}getFormIdFromPayload(r){return r?.feedbackConfigurationId}publish(r,o,a){typeof window<"u"&&window.dispatchEvent(new CustomEvent(r,{detail:o,bubbles:!0})),a?.usePostMessage!==!1&&this.sendPostMessage(r,o)}subscribe(r,o,a){const t=Symbol("subscription"),s={eventType:r,handler:o,filter:a?.formId,id:t,once:a?.once};this.subscriptions.has(r)||this.subscriptions.set(r,[]),this.subscriptions.get(r).push(s);const m=_=>{const Z=_,K=this.getFormIdFromPayload(Z.detail);this.matchesFilter(K,a?.formId)&&(o(Z.detail),a?.once&&typeof window<"u"&&window.removeEventListener(r,m))};return typeof window<"u"&&window.addEventListener(r,m),()=>{this.unsubscribe(t),typeof window<"u"&&window.removeEventListener(r,m)}}unsubscribe(r){for(const[o,a]of this.subscriptions.entries()){const t=a.findIndex(s=>s.id===r);if(t!==-1){a.splice(t,1),a.length===0&&this.subscriptions.delete(o);break}}}subscribeAll(r,o){const a=["form:view","form:submit","form:close","form:section:change","form:question:answered","form:error"],t=[];return a.forEach(s=>{const m=this.subscribe(s,_=>r(s,_),o);t.push(m)}),()=>{t.forEach(s=>s())}}getSubscriptionCount(r){return r?this.subscriptions.get(r)?.length||0:Array.from(this.subscriptions.values()).reduce((o,a)=>o+a.length,0)}clearSubscriptions(r){r?this.subscriptions.delete(r):this.subscriptions.clear()}sendPostMessage(r,o){const a={type:`encatch:${r}`,payload:o,source:"encatch-form-engine"};window.parent&&window.parent!==window&&window.parent.postMessage(a,this.targetOrigin),document.querySelectorAll("iframe").forEach(t=>{t.contentWindow&&t.contentWindow.postMessage(a,this.targetOrigin)}),typeof window.ReactNativeWebView<"u"&&window.ReactNativeWebView.postMessage(JSON.stringify({action:r.replace("form:",""),data:JSON.stringify(o)}))}}const _n=new Xb,ts="encatch-app-react";typeof window<"u"&&Promise.resolve().then(()=>Wk).then(({EncatchAppElement:e})=>{try{customElements.get(ts)||customElements.define(ts,e)}catch(r){console.debug("Custom element registration:",r)}});const ey=({formData:e,cssLink:r,scale:o=100,persistMode:a="none",instanceId:t,onFormEvent:s})=>{const[m,_]=or.useState(!1),[Z,K]=or.useState(!0),fe=or.useRef(null),se=or.useRef(null),ze=or.useRef({});or.useEffect(()=>{if(!s)return;s({onSubmit:_e=>{ze.current.onSubmit=_e},onView:_e=>{ze.current.onView=_e},onClose:_e=>{ze.current.onClose=_e},onSectionChange:_e=>{ze.current.onSectionChange=_e},onQuestionAnswered:_e=>{ze.current.onQuestionAnswered=_e},onError:_e=>{ze.current.onError=_e}})},[s]),or.useEffect(()=>{if(!t)return;const M=[];return ze.current.onSubmit&&M.push(_n.subscribe("form:submit",ze.current.onSubmit,{formId:t})),ze.current.onView&&M.push(_n.subscribe("form:view",ze.current.onView,{formId:t})),ze.current.onClose&&M.push(_n.subscribe("form:close",ze.current.onClose,{formId:t})),ze.current.onSectionChange&&M.push(_n.subscribe("form:section:change",ze.current.onSectionChange,{formId:t})),ze.current.onQuestionAnswered&&M.push(_n.subscribe("form:question:answered",ze.current.onQuestionAnswered,{formId:t})),ze.current.onError&&M.push(_n.subscribe("form:error",ze.current.onError,{formId:t})),()=>{M.forEach(_e=>_e())}},[t]),or.useEffect(()=>{(()=>{try{return e?!0:(console.warn("[EncatchPreview] formData is not defined"),!1)}catch(_e){return console.error("[EncatchPreview] Error during data validation:",_e),!1}})()?_(!0):console.warn("[EncatchPreview] Data validation failed, retrying in 100ms...")},[e]);const be=or.useCallback(()=>{e.onClose&&e.onClose(),K(!1)},[e.onClose]);return or.useEffect(()=>{if(!m||!fe.current)return;const M=document.createElement(ts);return M.theme=e.theme,M.currentMode=e.currentMode,M.currentLanguage=e.currentLanguage,M.questions=e.questions,M.questionLanguages=e.questionLanguages,M.otherConfigurationProperties=e.otherConfigurationProperties,M.welcomeScreenProperties=e.welcomeScreenProperties,M.endScreenProperties=e.endScreenProperties,M.translations=e.translations,M.sections=e.sections,M.themeSettings=e.themeSettings,M.onClose=be,M.onSectionChange=e.onSectionChange,M.apiKey=e.apiKey,M.hostUrl=e.hostUrl,M.feedbackConfigId=e.feedbackConfigId,M.identifier=e.identifier,r&&(M.cssLink=r),M.scale=o,M.persistMode=a,t&&(M.instanceId=t),se.current=M,fe.current.appendChild(M),()=>{fe.current&&se.current&&fe.current.removeChild(se.current),se.current=null}},[m,e,r,o,be,a,t]),Z?Hb.jsx("div",{ref:fe}):null};function ty(e,r,o){or.useEffect(()=>_n.subscribe(e,r,o),[e,o?.formId,r])}function ry(e,r){or.useEffect(()=>_n.subscribeAll(e,r),[r?.formId,e])}var Ri={exports:{}};const gl=Object.freeze({status:"aborted"});function C(e,r,o){function a(_,Z){var K;Object.defineProperty(_,"_zod",{value:_._zod??{},enumerable:!1}),(K=_._zod).traits??(K.traits=new Set),_._zod.traits.add(e),r(_,Z);for(const fe in m.prototype)fe in _||Object.defineProperty(_,fe,{value:m.prototype[fe].bind(_)});_._zod.constr=m,_._zod.def=Z}const t=o?.Parent??Object;class s extends t{}Object.defineProperty(s,"name",{value:e});function m(_){var Z;const K=o?.Parent?new s:this;a(K,_),(Z=K._zod).deferred??(Z.deferred=[]);for(const fe of K._zod.deferred)fe();return K}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:_=>o?.Parent&&_ instanceof o.Parent?!0:_?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}const hl=Symbol("zod_brand");class Mn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Eo extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const Co={};function fr(e){return e&&Object.assign(Co,e),Co}function ny(e){return e}function iy(e){return e}function oy(e){}function ay(e){throw new Error}function sy(e){}function rs(e){const r=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,t])=>r.indexOf(+a)===-1).map(([a,t])=>t)}function $e(e,r="|"){return e.map(o=>Qe(o)).join(r)}function Po(e,r){return typeof r=="bigint"?r.toString():r}function qi(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function Ln(e){return e==null}function Uo(e){const r=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(r,o)}function vl(e,r){const o=(e.toString().split(".")[1]||"").length,a=r.toString();let t=(a.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(a)){const Z=a.match(/\d?e-(\d?)/);Z?.[1]&&(t=Number.parseInt(Z[1]))}const s=o>t?o:t,m=Number.parseInt(e.toFixed(s).replace(".","")),_=Number.parseInt(r.toFixed(s).replace(".",""));return m%_/10**s}const bl=Symbol("evaluating");function ot(e,r,o){let a;Object.defineProperty(e,r,{get(){if(a!==bl)return a===void 0&&(a=bl,a=o()),a},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Do(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function qr(e,r,o){Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}function kn(...e){const r={};for(const o of e){const a=Object.getOwnPropertyDescriptors(o);Object.assign(r,a)}return Object.defineProperties({},r)}function uy(e){return kn(e._zod.def)}function cy(e,r){return r?r.reduce((o,a)=>o?.[a],e):e}function ly(e){const r=Object.keys(e),o=r.map(a=>e[a]);return Promise.all(o).then(a=>{const t={};for(let s=0;s<r.length;s++)t[r[s]]=a[s];return t})}function dy(e=10){const r="abcdefghijklmnopqrstuvwxyz";let o="";for(let a=0;a<e;a++)o+=r[Math.floor(Math.random()*r.length)];return o}function ns(e){return JSON.stringify(e)}const is="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const yl=qi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Zn(e){if(fi(e)===!1)return!1;const r=e.constructor;if(r===void 0)return!0;const o=r.prototype;return!(fi(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function Ao(e){return Zn(e)?{...e}:Array.isArray(e)?[...e]:e}function fy(e){let r=0;for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&r++;return r}const my=e=>{const r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},Mo=new Set(["string","number","symbol"]),$l=new Set(["string","number","bigint","boolean","symbol","undefined"]);function xn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pr(e,r,o){const a=new e._zod.constr(r??e._zod.def);return(!r||o?.parent)&&(a._zod.parent=e),a}function ie(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function py(e){let r;return new Proxy({},{get(o,a,t){return r??(r=e()),Reflect.get(r,a,t)},set(o,a,t,s){return r??(r=e()),Reflect.set(r,a,t,s)},has(o,a){return r??(r=e()),Reflect.has(r,a)},deleteProperty(o,a){return r??(r=e()),Reflect.deleteProperty(r,a)},ownKeys(o){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(o,a){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,a)},defineProperty(o,a,t){return r??(r=e()),Reflect.defineProperty(r,a,t)}})}function Qe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function wl(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const _l={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},kl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xl(e,r){const o=e._zod.def,a=kn(e._zod.def,{get shape(){const t={};for(const s in r){if(!(s in o.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(t[s]=o.shape[s])}return qr(this,"shape",t),t},checks:[]});return Pr(e,a)}function Sl(e,r){const o=e._zod.def,a=kn(e._zod.def,{get shape(){const t={...e._zod.def.shape};for(const s in r){if(!(s in o.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&delete t[s]}return qr(this,"shape",t),t},checks:[]});return Pr(e,a)}function Il(e,r){if(!Zn(r))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const t=kn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...r};return qr(this,"shape",s),s},checks:[]});return Pr(e,t)}function Nl(e,r){if(!Zn(r))throw new Error("Invalid input to safeExtend: expected a plain object");const o={...e._zod.def,get shape(){const a={...e._zod.def.shape,...r};return qr(this,"shape",a),a},checks:e._zod.def.checks};return Pr(e,o)}function zl(e,r){const o=kn(e._zod.def,{get shape(){const a={...e._zod.def.shape,...r._zod.def.shape};return qr(this,"shape",a),a},get catchall(){return r._zod.def.catchall},checks:[]});return Pr(e,o)}function jl(e,r,o){const a=kn(r._zod.def,{get shape(){const t=r._zod.def.shape,s={...t};if(o)for(const m in o){if(!(m in t))throw new Error(`Unrecognized key: "${m}"`);o[m]&&(s[m]=e?new e({type:"optional",innerType:t[m]}):t[m])}else for(const m in t)s[m]=e?new e({type:"optional",innerType:t[m]}):t[m];return qr(this,"shape",s),s},checks:[]});return Pr(r,a)}function Tl(e,r,o){const a=kn(r._zod.def,{get shape(){const t=r._zod.def.shape,s={...t};if(o)for(const m in o){if(!(m in s))throw new Error(`Unrecognized key: "${m}"`);o[m]&&(s[m]=new e({type:"nonoptional",innerType:t[m]}))}else for(const m in t)s[m]=new e({type:"nonoptional",innerType:t[m]});return qr(this,"shape",s),s},checks:[]});return Pr(r,a)}function Rn(e,r=0){if(e.aborted===!0)return!0;for(let o=r;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function Fr(e,r){return r.map(o=>{var a;return(a=o).path??(a.path=[]),o.path.unshift(e),o})}function Fi(e){return typeof e=="string"?e:e?.message}function Wr(e,r,o){const a={...e,path:e.path??[]};if(!e.message){const t=Fi(e.inst?._zod.def?.error?.(e))??Fi(r?.error?.(e))??Fi(o.customError?.(e))??Fi(o.localeError?.(e))??"Invalid input";a.message=t}return delete a.inst,delete a.continue,r?.reportInput||delete a.input,a}function Lo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Zo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function mi(...e){const[r,o,a]=e;return typeof r=="string"?{message:r,code:"custom",input:o,inst:a}:{...r}}function gy(e){return Object.entries(e).filter(([r,o])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Ol(e){const r=atob(e),o=new Uint8Array(r.length);for(let a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return o}function El(e){let r="";for(let o=0;o<e.length;o++)r+=String.fromCharCode(e[o]);return btoa(r)}function hy(e){const r=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-r.length%4)%4);return Ol(r+o)}function vy(e){return El(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function by(e){const r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");const o=new Uint8Array(r.length/2);for(let a=0;a<r.length;a+=2)o[a/2]=Number.parseInt(r.slice(a,a+2),16);return o}function yy(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}class $y{constructor(...r){}}const Cl=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:kl,Class:$y,NUMBER_FORMAT_RANGES:_l,aborted:Rn,allowsEval:yl,assert:sy,assertEqual:ny,assertIs:oy,assertNever:ay,assertNotEqual:iy,assignProp:qr,base64ToUint8Array:Ol,base64urlToUint8Array:hy,cached:qi,captureStackTrace:is,cleanEnum:gy,cleanRegex:Uo,clone:Pr,cloneDef:uy,createTransparentProxy:py,defineLazy:ot,esc:ns,escapeRegex:xn,extend:Il,finalizeIssue:Wr,floatSafeRemainder:vl,getElementAtPath:cy,getEnumValues:rs,getLengthableOrigin:Zo,getParsedType:my,getSizableOrigin:Lo,hexToUint8Array:by,isObject:fi,isPlainObject:Zn,issue:mi,joinValues:$e,jsonStringifyReplacer:Po,merge:zl,mergeDefs:kn,normalizeParams:ie,nullish:Ln,numKeys:fy,objectClone:Do,omit:Sl,optionalKeys:wl,partial:jl,pick:xl,prefixIssues:Fr,primitiveTypes:$l,promiseAllObject:ly,propertyKeyTypes:Mo,randomString:dy,required:Tl,safeExtend:Nl,shallowClone:Ao,stringifyPrimitive:Qe,uint8ArrayToBase64:El,uint8ArrayToBase64url:vy,uint8ArrayToHex:yy,unwrapMessage:Fi},Symbol.toStringTag,{value:"Module"})),Pl=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,Po,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},os=C("$ZodError",Pl),kr=C("$ZodError",Pl,{Parent:Error});function as(e,r=o=>o.message){const o={},a=[];for(const t of e.issues)t.path.length>0?(o[t.path[0]]=o[t.path[0]]||[],o[t.path[0]].push(r(t))):a.push(r(t));return{formErrors:a,fieldErrors:o}}function ss(e,r){const o=r||function(s){return s.message},a={_errors:[]},t=s=>{for(const m of s.issues)if(m.code==="invalid_union"&&m.errors.length)m.errors.map(_=>t({issues:_}));else if(m.code==="invalid_key")t({issues:m.issues});else if(m.code==="invalid_element")t({issues:m.issues});else if(m.path.length===0)a._errors.push(o(m));else{let _=a,Z=0;for(;Z<m.path.length;){const K=m.path[Z];Z===m.path.length-1?(_[K]=_[K]||{_errors:[]},_[K]._errors.push(o(m))):_[K]=_[K]||{_errors:[]},_=_[K],Z++}}};return t(e),a}function Ul(e,r){const o=r||function(s){return s.message},a={errors:[]},t=(s,m=[])=>{var _,Z;for(const K of s.issues)if(K.code==="invalid_union"&&K.errors.length)K.errors.map(fe=>t({issues:fe},K.path));else if(K.code==="invalid_key")t({issues:K.issues},K.path);else if(K.code==="invalid_element")t({issues:K.issues},K.path);else{const fe=[...m,...K.path];if(fe.length===0){a.errors.push(o(K));continue}let se=a,ze=0;for(;ze<fe.length;){const be=fe[ze],M=ze===fe.length-1;typeof be=="string"?(se.properties??(se.properties={}),(_=se.properties)[be]??(_[be]={errors:[]}),se=se.properties[be]):(se.items??(se.items=[]),(Z=se.items)[be]??(Z[be]={errors:[]}),se=se.items[be]),M&&se.errors.push(o(K)),ze++}}};return t(e),a}function Dl(e){const r=[],o=e.map(a=>typeof a=="object"?a.key:a);for(const a of o)typeof a=="number"?r.push(`[${a}]`):typeof a=="symbol"?r.push(`[${JSON.stringify(String(a))}]`):/[^\w$]/.test(a)?r.push(`[${JSON.stringify(a)}]`):(r.length&&r.push("."),r.push(a));return r.join("")}function Al(e){const r=[],o=[...e.issues].sort((a,t)=>(a.path??[]).length-(t.path??[]).length);for(const a of o)r.push(`✖ ${a.message}`),a.path?.length&&r.push(` → at ${Dl(a.path)}`);return r.join(`
22
+ <%s key={someKey} {...props} />`,qt,Ht,Mt,Ht),lo[Ht+qt]=!0)}if(Ht=null,Ct!==void 0&&(o(Ct),Ht=""+Ct),m(Be)&&(o(Be.key),Ht=""+Be.key),"key"in Be){Ct={};for(var Kn in Be)Kn!=="key"&&(Ct[Kn]=Be[Kn])}else Ct=Be;return Ht&&_(Ct,typeof ve=="function"?ve.displayName||ve.name||"Unknown":ve),K(ve,Ht,Dr,$t,t(),Ct,Yn,bi)}function se(ve){typeof ve=="object"&&ve!==null&&ve.$$typeof===be&&ve._store&&(ve._store.validated=1)}var ze=or,be=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),_e=Symbol.for("react.fragment"),Ae=Symbol.for("react.strict_mode"),ht=Symbol.for("react.profiler"),ct=Symbol.for("react.consumer"),mt=Symbol.for("react.context"),bt=Symbol.for("react.forward_ref"),mr=Symbol.for("react.suspense"),Hr=Symbol.for("react.suspense_list"),Kt=Symbol.for("react.memo"),$a=Symbol.for("react.lazy"),fc=Symbol.for("react.activity"),wa=Symbol.for("react.client.reference"),uo=ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Vn=Object.prototype.hasOwnProperty,mc=Array.isArray,Jn=console.createTask?console.createTask:function(){return null};ze={react_stack_bottom_frame:function(ve){return ve()}};var Bn,Sn={},Ur=ze.react_stack_bottom_frame.bind(ze,s)(),co=Jn(a(s)),lo={};Zi.Fragment=_e,Zi.jsx=function(ve,Be,Ct,qt,$t){var Dr=1e4>uo.recentlyCreatedOwnerStacks++;return fe(ve,Be,Ct,!1,qt,$t,Dr?Error("react-stack-top-frame"):Ur,Dr?Jn(a(ve)):co)},Zi.jsxs=function(ve,Be,Ct,qt,$t){var Dr=1e4>uo.recentlyCreatedOwnerStacks++;return fe(ve,Be,Ct,!0,qt,$t,Dr?Error("react-stack-top-frame"):Ur,Dr?Jn(a(ve)):co)}})()),Zi}var pl;function Kb(){return pl||(pl=1,process.env.NODE_ENV==="production"?Oo.exports=Bb():Oo.exports=Yb()),Oo.exports}var Hb=Kb();class Xb extends EventTarget{subscriptions=new Map;targetOrigin="*";matchesFilter(r,o){return!o||o==="*"||o===null||o===void 0?!0:typeof o=="string"?r===o:Array.isArray(o)?o.includes(r||""):typeof o=="function"?o(r||""):!1}getFormIdFromPayload(r){return r?.feedbackConfigurationId}publish(r,o,a){typeof window<"u"&&window.dispatchEvent(new CustomEvent(r,{detail:o,bubbles:!0})),a?.usePostMessage!==!1&&this.sendPostMessage(r,o)}subscribe(r,o,a){const t=Symbol("subscription"),s={eventType:r,handler:o,filter:a?.formId,id:t,once:a?.once};this.subscriptions.has(r)||this.subscriptions.set(r,[]),this.subscriptions.get(r).push(s);const m=_=>{const Z=_,K=this.getFormIdFromPayload(Z.detail);this.matchesFilter(K,a?.formId)&&(o(Z.detail),a?.once&&typeof window<"u"&&window.removeEventListener(r,m))};return typeof window<"u"&&window.addEventListener(r,m),()=>{this.unsubscribe(t),typeof window<"u"&&window.removeEventListener(r,m)}}unsubscribe(r){for(const[o,a]of this.subscriptions.entries()){const t=a.findIndex(s=>s.id===r);if(t!==-1){a.splice(t,1),a.length===0&&this.subscriptions.delete(o);break}}}subscribeAll(r,o){const a=["form:view","form:submit","form:close","form:section:change","form:question:answered","form:error"],t=[];return a.forEach(s=>{const m=this.subscribe(s,_=>r(s,_),o);t.push(m)}),()=>{t.forEach(s=>s())}}getSubscriptionCount(r){return r?this.subscriptions.get(r)?.length||0:Array.from(this.subscriptions.values()).reduce((o,a)=>o+a.length,0)}clearSubscriptions(r){r?this.subscriptions.delete(r):this.subscriptions.clear()}sendPostMessage(r,o){const a={type:`encatch:${r}`,payload:o,source:"encatch-form-engine"};window.parent&&window.parent!==window&&window.parent.postMessage(a,this.targetOrigin),document.querySelectorAll("iframe").forEach(t=>{t.contentWindow&&t.contentWindow.postMessage(a,this.targetOrigin)}),typeof window.ReactNativeWebView<"u"&&window.ReactNativeWebView.postMessage(JSON.stringify({action:r.replace("form:",""),data:JSON.stringify(o)}))}}const _n=new Xb,ts="encatch-app-react";typeof window<"u"&&Promise.resolve().then(()=>Wk).then(({EncatchAppElement:e})=>{try{customElements.get(ts)||customElements.define(ts,e)}catch(r){console.debug("Custom element registration:",r)}});const ey=({formData:e,cssLink:r,scale:o=100,persistMode:a="none",instanceId:t,onFormEvent:s})=>{const[m,_]=or.useState(!1),[Z,K]=or.useState(!0),fe=or.useRef(null),se=or.useRef(null),ze=or.useRef({});or.useEffect(()=>{if(!s)return;s({onSubmit:_e=>{ze.current.onSubmit=_e},onView:_e=>{ze.current.onView=_e},onClose:_e=>{ze.current.onClose=_e},onSectionChange:_e=>{ze.current.onSectionChange=_e},onQuestionAnswered:_e=>{ze.current.onQuestionAnswered=_e},onError:_e=>{ze.current.onError=_e}})},[s]),or.useEffect(()=>{if(!t)return;const M=[];return ze.current.onSubmit&&M.push(_n.subscribe("form:submit",ze.current.onSubmit,{formId:t})),ze.current.onView&&M.push(_n.subscribe("form:view",ze.current.onView,{formId:t})),ze.current.onClose&&M.push(_n.subscribe("form:close",ze.current.onClose,{formId:t})),ze.current.onSectionChange&&M.push(_n.subscribe("form:section:change",ze.current.onSectionChange,{formId:t})),ze.current.onQuestionAnswered&&M.push(_n.subscribe("form:question:answered",ze.current.onQuestionAnswered,{formId:t})),ze.current.onError&&M.push(_n.subscribe("form:error",ze.current.onError,{formId:t})),()=>{M.forEach(_e=>_e())}},[t]),or.useEffect(()=>{(()=>{try{return e?!0:(console.warn("[EncatchPreview] formData is not defined"),!1)}catch(_e){return console.error("[EncatchPreview] Error during data validation:",_e),!1}})()?_(!0):console.warn("[EncatchPreview] Data validation failed, retrying in 100ms...")},[e]);const be=or.useCallback(()=>{e.onClose&&e.onClose(),K(!1)},[e.onClose]);return or.useEffect(()=>{if(!m||!fe.current)return;const M=document.createElement(ts);return se.current=M,fe.current.appendChild(M),requestAnimationFrame(()=>{se.current&&(M.theme=e.theme,M.currentMode=e.currentMode,M.currentLanguage=e.currentLanguage,M.questions=e.questions,M.questionLanguages=e.questionLanguages,M.otherConfigurationProperties=e.otherConfigurationProperties,M.welcomeScreenProperties=e.welcomeScreenProperties,M.endScreenProperties=e.endScreenProperties,M.translations=e.translations,M.sections=e.sections,M.themeSettings=e.themeSettings,M.onClose=be,M.onSectionChange=e.onSectionChange,M.apiKey=e.apiKey,M.hostUrl=e.hostUrl,M.feedbackConfigId=e.feedbackConfigId,M.identifier=e.identifier,r&&(M.cssLink=r),M.scale=o,M.persistMode=a,t&&(M.instanceId=t))}),()=>{fe.current&&se.current&&fe.current.removeChild(se.current),se.current=null}},[m,e,r,o,be,a,t]),Z?Hb.jsx("div",{ref:fe}):null};function ty(e,r,o){or.useEffect(()=>_n.subscribe(e,r,o),[e,o?.formId,r])}function ry(e,r){or.useEffect(()=>_n.subscribeAll(e,r),[r?.formId,e])}var Ri={exports:{}};const gl=Object.freeze({status:"aborted"});function C(e,r,o){function a(_,Z){var K;Object.defineProperty(_,"_zod",{value:_._zod??{},enumerable:!1}),(K=_._zod).traits??(K.traits=new Set),_._zod.traits.add(e),r(_,Z);for(const fe in m.prototype)fe in _||Object.defineProperty(_,fe,{value:m.prototype[fe].bind(_)});_._zod.constr=m,_._zod.def=Z}const t=o?.Parent??Object;class s extends t{}Object.defineProperty(s,"name",{value:e});function m(_){var Z;const K=o?.Parent?new s:this;a(K,_),(Z=K._zod).deferred??(Z.deferred=[]);for(const fe of K._zod.deferred)fe();return K}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:_=>o?.Parent&&_ instanceof o.Parent?!0:_?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}const hl=Symbol("zod_brand");class Mn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Eo extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const Co={};function fr(e){return e&&Object.assign(Co,e),Co}function ny(e){return e}function iy(e){return e}function oy(e){}function ay(e){throw new Error}function sy(e){}function rs(e){const r=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,t])=>r.indexOf(+a)===-1).map(([a,t])=>t)}function $e(e,r="|"){return e.map(o=>Qe(o)).join(r)}function Po(e,r){return typeof r=="bigint"?r.toString():r}function qi(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function Ln(e){return e==null}function Uo(e){const r=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(r,o)}function vl(e,r){const o=(e.toString().split(".")[1]||"").length,a=r.toString();let t=(a.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(a)){const Z=a.match(/\d?e-(\d?)/);Z?.[1]&&(t=Number.parseInt(Z[1]))}const s=o>t?o:t,m=Number.parseInt(e.toFixed(s).replace(".","")),_=Number.parseInt(r.toFixed(s).replace(".",""));return m%_/10**s}const bl=Symbol("evaluating");function ot(e,r,o){let a;Object.defineProperty(e,r,{get(){if(a!==bl)return a===void 0&&(a=bl,a=o()),a},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Do(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function qr(e,r,o){Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}function kn(...e){const r={};for(const o of e){const a=Object.getOwnPropertyDescriptors(o);Object.assign(r,a)}return Object.defineProperties({},r)}function uy(e){return kn(e._zod.def)}function cy(e,r){return r?r.reduce((o,a)=>o?.[a],e):e}function ly(e){const r=Object.keys(e),o=r.map(a=>e[a]);return Promise.all(o).then(a=>{const t={};for(let s=0;s<r.length;s++)t[r[s]]=a[s];return t})}function dy(e=10){const r="abcdefghijklmnopqrstuvwxyz";let o="";for(let a=0;a<e;a++)o+=r[Math.floor(Math.random()*r.length)];return o}function ns(e){return JSON.stringify(e)}const is="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const yl=qi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Zn(e){if(fi(e)===!1)return!1;const r=e.constructor;if(r===void 0)return!0;const o=r.prototype;return!(fi(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function Ao(e){return Zn(e)?{...e}:Array.isArray(e)?[...e]:e}function fy(e){let r=0;for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&r++;return r}const my=e=>{const r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},Mo=new Set(["string","number","symbol"]),$l=new Set(["string","number","bigint","boolean","symbol","undefined"]);function xn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pr(e,r,o){const a=new e._zod.constr(r??e._zod.def);return(!r||o?.parent)&&(a._zod.parent=e),a}function ie(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function py(e){let r;return new Proxy({},{get(o,a,t){return r??(r=e()),Reflect.get(r,a,t)},set(o,a,t,s){return r??(r=e()),Reflect.set(r,a,t,s)},has(o,a){return r??(r=e()),Reflect.has(r,a)},deleteProperty(o,a){return r??(r=e()),Reflect.deleteProperty(r,a)},ownKeys(o){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(o,a){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,a)},defineProperty(o,a,t){return r??(r=e()),Reflect.defineProperty(r,a,t)}})}function Qe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function wl(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const _l={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},kl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xl(e,r){const o=e._zod.def,a=kn(e._zod.def,{get shape(){const t={};for(const s in r){if(!(s in o.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(t[s]=o.shape[s])}return qr(this,"shape",t),t},checks:[]});return Pr(e,a)}function Sl(e,r){const o=e._zod.def,a=kn(e._zod.def,{get shape(){const t={...e._zod.def.shape};for(const s in r){if(!(s in o.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&delete t[s]}return qr(this,"shape",t),t},checks:[]});return Pr(e,a)}function Il(e,r){if(!Zn(r))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const t=kn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...r};return qr(this,"shape",s),s},checks:[]});return Pr(e,t)}function Nl(e,r){if(!Zn(r))throw new Error("Invalid input to safeExtend: expected a plain object");const o={...e._zod.def,get shape(){const a={...e._zod.def.shape,...r};return qr(this,"shape",a),a},checks:e._zod.def.checks};return Pr(e,o)}function zl(e,r){const o=kn(e._zod.def,{get shape(){const a={...e._zod.def.shape,...r._zod.def.shape};return qr(this,"shape",a),a},get catchall(){return r._zod.def.catchall},checks:[]});return Pr(e,o)}function jl(e,r,o){const a=kn(r._zod.def,{get shape(){const t=r._zod.def.shape,s={...t};if(o)for(const m in o){if(!(m in t))throw new Error(`Unrecognized key: "${m}"`);o[m]&&(s[m]=e?new e({type:"optional",innerType:t[m]}):t[m])}else for(const m in t)s[m]=e?new e({type:"optional",innerType:t[m]}):t[m];return qr(this,"shape",s),s},checks:[]});return Pr(r,a)}function Tl(e,r,o){const a=kn(r._zod.def,{get shape(){const t=r._zod.def.shape,s={...t};if(o)for(const m in o){if(!(m in s))throw new Error(`Unrecognized key: "${m}"`);o[m]&&(s[m]=new e({type:"nonoptional",innerType:t[m]}))}else for(const m in t)s[m]=new e({type:"nonoptional",innerType:t[m]});return qr(this,"shape",s),s},checks:[]});return Pr(r,a)}function Rn(e,r=0){if(e.aborted===!0)return!0;for(let o=r;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function Fr(e,r){return r.map(o=>{var a;return(a=o).path??(a.path=[]),o.path.unshift(e),o})}function Fi(e){return typeof e=="string"?e:e?.message}function Wr(e,r,o){const a={...e,path:e.path??[]};if(!e.message){const t=Fi(e.inst?._zod.def?.error?.(e))??Fi(r?.error?.(e))??Fi(o.customError?.(e))??Fi(o.localeError?.(e))??"Invalid input";a.message=t}return delete a.inst,delete a.continue,r?.reportInput||delete a.input,a}function Lo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Zo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function mi(...e){const[r,o,a]=e;return typeof r=="string"?{message:r,code:"custom",input:o,inst:a}:{...r}}function gy(e){return Object.entries(e).filter(([r,o])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Ol(e){const r=atob(e),o=new Uint8Array(r.length);for(let a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return o}function El(e){let r="";for(let o=0;o<e.length;o++)r+=String.fromCharCode(e[o]);return btoa(r)}function hy(e){const r=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-r.length%4)%4);return Ol(r+o)}function vy(e){return El(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function by(e){const r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");const o=new Uint8Array(r.length/2);for(let a=0;a<r.length;a+=2)o[a/2]=Number.parseInt(r.slice(a,a+2),16);return o}function yy(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}class $y{constructor(...r){}}const Cl=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:kl,Class:$y,NUMBER_FORMAT_RANGES:_l,aborted:Rn,allowsEval:yl,assert:sy,assertEqual:ny,assertIs:oy,assertNever:ay,assertNotEqual:iy,assignProp:qr,base64ToUint8Array:Ol,base64urlToUint8Array:hy,cached:qi,captureStackTrace:is,cleanEnum:gy,cleanRegex:Uo,clone:Pr,cloneDef:uy,createTransparentProxy:py,defineLazy:ot,esc:ns,escapeRegex:xn,extend:Il,finalizeIssue:Wr,floatSafeRemainder:vl,getElementAtPath:cy,getEnumValues:rs,getLengthableOrigin:Zo,getParsedType:my,getSizableOrigin:Lo,hexToUint8Array:by,isObject:fi,isPlainObject:Zn,issue:mi,joinValues:$e,jsonStringifyReplacer:Po,merge:zl,mergeDefs:kn,normalizeParams:ie,nullish:Ln,numKeys:fy,objectClone:Do,omit:Sl,optionalKeys:wl,partial:jl,pick:xl,prefixIssues:Fr,primitiveTypes:$l,promiseAllObject:ly,propertyKeyTypes:Mo,randomString:dy,required:Tl,safeExtend:Nl,shallowClone:Ao,stringifyPrimitive:Qe,uint8ArrayToBase64:El,uint8ArrayToBase64url:vy,uint8ArrayToHex:yy,unwrapMessage:Fi},Symbol.toStringTag,{value:"Module"})),Pl=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,Po,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},os=C("$ZodError",Pl),kr=C("$ZodError",Pl,{Parent:Error});function as(e,r=o=>o.message){const o={},a=[];for(const t of e.issues)t.path.length>0?(o[t.path[0]]=o[t.path[0]]||[],o[t.path[0]].push(r(t))):a.push(r(t));return{formErrors:a,fieldErrors:o}}function ss(e,r){const o=r||function(s){return s.message},a={_errors:[]},t=s=>{for(const m of s.issues)if(m.code==="invalid_union"&&m.errors.length)m.errors.map(_=>t({issues:_}));else if(m.code==="invalid_key")t({issues:m.issues});else if(m.code==="invalid_element")t({issues:m.issues});else if(m.path.length===0)a._errors.push(o(m));else{let _=a,Z=0;for(;Z<m.path.length;){const K=m.path[Z];Z===m.path.length-1?(_[K]=_[K]||{_errors:[]},_[K]._errors.push(o(m))):_[K]=_[K]||{_errors:[]},_=_[K],Z++}}};return t(e),a}function Ul(e,r){const o=r||function(s){return s.message},a={errors:[]},t=(s,m=[])=>{var _,Z;for(const K of s.issues)if(K.code==="invalid_union"&&K.errors.length)K.errors.map(fe=>t({issues:fe},K.path));else if(K.code==="invalid_key")t({issues:K.issues},K.path);else if(K.code==="invalid_element")t({issues:K.issues},K.path);else{const fe=[...m,...K.path];if(fe.length===0){a.errors.push(o(K));continue}let se=a,ze=0;for(;ze<fe.length;){const be=fe[ze],M=ze===fe.length-1;typeof be=="string"?(se.properties??(se.properties={}),(_=se.properties)[be]??(_[be]={errors:[]}),se=se.properties[be]):(se.items??(se.items=[]),(Z=se.items)[be]??(Z[be]={errors:[]}),se=se.items[be]),M&&se.errors.push(o(K)),ze++}}};return t(e),a}function Dl(e){const r=[],o=e.map(a=>typeof a=="object"?a.key:a);for(const a of o)typeof a=="number"?r.push(`[${a}]`):typeof a=="symbol"?r.push(`[${JSON.stringify(String(a))}]`):/[^\w$]/.test(a)?r.push(`[${JSON.stringify(a)}]`):(r.length&&r.push("."),r.push(a));return r.join("")}function Al(e){const r=[],o=[...e.issues].sort((a,t)=>(a.path??[]).length-(t.path??[]).length);for(const a of o)r.push(`✖ ${a.message}`),a.path?.length&&r.push(` → at ${Dl(a.path)}`);return r.join(`
23
23
  `)}const Wi=e=>(r,o,a,t)=>{const s=a?Object.assign(a,{async:!1}):{async:!1},m=r._zod.run({value:o,issues:[]},s);if(m instanceof Promise)throw new Mn;if(m.issues.length){const _=new(t?.Err??e)(m.issues.map(Z=>Wr(Z,s,fr())));throw is(_,t?.callee),_}return m.value},us=Wi(kr),Gi=e=>async(r,o,a,t)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let m=r._zod.run({value:o,issues:[]},s);if(m instanceof Promise&&(m=await m),m.issues.length){const _=new(t?.Err??e)(m.issues.map(Z=>Wr(Z,s,fr())));throw is(_,t?.callee),_}return m.value},cs=Gi(kr),Qi=e=>(r,o,a)=>{const t=a?{...a,async:!1}:{async:!1},s=r._zod.run({value:o,issues:[]},t);if(s instanceof Promise)throw new Mn;return s.issues.length?{success:!1,error:new(e??os)(s.issues.map(m=>Wr(m,t,fr())))}:{success:!0,data:s.value}},Ml=Qi(kr),Vi=e=>async(r,o,a)=>{const t=a?Object.assign(a,{async:!0}):{async:!0};let s=r._zod.run({value:o,issues:[]},t);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(m=>Wr(m,t,fr())))}:{success:!0,data:s.value}},Ll=Vi(kr),ls=e=>(r,o,a)=>{const t=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Wi(e)(r,o,t)},wy=ls(kr),ds=e=>(r,o,a)=>Wi(e)(r,o,a),_y=ds(kr),fs=e=>async(r,o,a)=>{const t=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gi(e)(r,o,t)},ky=fs(kr),ms=e=>async(r,o,a)=>Gi(e)(r,o,a),xy=ms(kr),ps=e=>(r,o,a)=>{const t=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Qi(e)(r,o,t)},Sy=ps(kr),gs=e=>(r,o,a)=>Qi(e)(r,o,a),Iy=gs(kr),hs=e=>async(r,o,a)=>{const t=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Vi(e)(r,o,t)},Ny=hs(kr),vs=e=>async(r,o,a)=>Vi(e)(r,o,a),zy=vs(kr),Zl=/^[cC][^\s-]{8,}$/,Rl=/^[0-9a-z]+$/,ql=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fl=/^[0-9a-vA-V]{20}$/,Wl=/^[A-Za-z0-9]{27}$/,Gl=/^[a-zA-Z0-9_-]{21}$/,Ql=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jy=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Vl=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,pi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ty=pi(4),Oy=pi(6),Ey=pi(7),Jl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Cy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Py=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Bl=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Uy=Bl,Dy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ay="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Yl(){return new RegExp(Ay,"u")}const Kl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Xl=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ed=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,td=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bs=/^[A-Za-z0-9_-]*$/,ys=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,rd=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,nd=/^\+(?:[0-9]){6,14}[0-9]$/,id="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",od=new RegExp(`^${id}$`);function ad(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sd(e){return new RegExp(`^${ad(e)}$`)}function ud(e){const r=ad({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${r}(?:${o.join("|")})`;return new RegExp(`^${id}T(?:${a})$`)}const cd=e=>{const r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},ld=/^-?\d+n?$/,dd=/^-?\d+$/,fd=/^-?\d+(?:\.\d+)?/,md=/^(?:true|false)$/i,pd=/^null$/i,gd=/^undefined$/i,hd=/^[^A-Z]*$/,vd=/^[^a-z]*$/,bd=/^[0-9a-fA-F]*$/;function Ji(e,r){return new RegExp(`^[A-Za-z0-9+/]{${e}}${r}$`)}function Bi(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const $s=Object.freeze(Object.defineProperty({__proto__:null,base64:td,base64url:bs,bigint:ld,boolean:md,browserEmail:Dy,cidrv4:Xl,cidrv6:ed,cuid:Zl,cuid2:Rl,date:od,datetime:ud,domain:rd,duration:Ql,e164:nd,email:Jl,emoji:Yl,extendedDuration:jy,guid:Vl,hex:bd,hostname:ys,html5Email:Cy,idnEmail:Uy,integer:dd,ipv4:Kl,ipv6:Hl,ksuid:Wl,lowercase:hd,md5_base64:Ji(22,"=="),md5_base64url:Bi(22),md5_hex:/^[0-9a-fA-F]{32}$/,nanoid:Gl,null:pd,number:fd,rfc5322Email:Py,sha1_base64:Ji(27,"="),sha1_base64url:Bi(27),sha1_hex:/^[0-9a-fA-F]{40}$/,sha256_base64:Ji(43,"="),sha256_base64url:Bi(43),sha256_hex:/^[0-9a-fA-F]{64}$/,sha384_base64:Ji(64,""),sha384_base64url:Bi(64),sha384_hex:/^[0-9a-fA-F]{96}$/,sha512_base64:Ji(86,"=="),sha512_base64url:Bi(86),sha512_hex:/^[0-9a-fA-F]{128}$/,string:cd,time:sd,ulid:ql,undefined:gd,unicodeEmail:Bl,uppercase:vd,uuid:pi,uuid4:Ty,uuid6:Oy,uuid7:Ey,xid:Fl},Symbol.toStringTag,{value:"Module"})),Zt=C("$ZodCheck",(e,r)=>{var o;e._zod??(e._zod={}),e._zod.def=r,(o=e._zod).onattach??(o.onattach=[])}),yd={number:"number",bigint:"bigint",object:"date"},ws=C("$ZodCheckLessThan",(e,r)=>{Zt.init(e,r);const o=yd[typeof r.value];e._zod.onattach.push(a=>{const t=a._zod.bag,s=(r.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<s&&(r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value)}),e._zod.check=a=>{(r.inclusive?a.value<=r.value:a.value<r.value)||a.issues.push({origin:o,code:"too_big",maximum:r.value,input:a.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),_s=C("$ZodCheckGreaterThan",(e,r)=>{Zt.init(e,r);const o=yd[typeof r.value];e._zod.onattach.push(a=>{const t=a._zod.bag,s=(r.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>s&&(r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value)}),e._zod.check=a=>{(r.inclusive?a.value>=r.value:a.value>r.value)||a.issues.push({origin:o,code:"too_small",minimum:r.value,input:a.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),$d=C("$ZodCheckMultipleOf",(e,r)=>{Zt.init(e,r),e._zod.onattach.push(o=>{var a;(a=o._zod.bag).multipleOf??(a.multipleOf=r.value)}),e._zod.check=o=>{if(typeof o.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%r.value===BigInt(0):vl(o.value,r.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:r.value,input:o.value,inst:e,continue:!r.abort})}}),wd=C("$ZodCheckNumberFormat",(e,r)=>{Zt.init(e,r),r.format=r.format||"float64";const o=r.format?.includes("int"),a=o?"int":"number",[t,s]=_l[r.format];e._zod.onattach.push(m=>{const _=m._zod.bag;_.format=r.format,_.minimum=t,_.maximum=s,o&&(_.pattern=dd)}),e._zod.check=m=>{const _=m.value;if(o){if(!Number.isInteger(_)){m.issues.push({expected:a,format:r.format,code:"invalid_type",continue:!1,input:_,inst:e});return}if(!Number.isSafeInteger(_)){_>0?m.issues.push({input:_,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!r.abort}):m.issues.push({input:_,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!r.abort});return}}_<t&&m.issues.push({origin:"number",input:_,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!r.abort}),_>s&&m.issues.push({origin:"number",input:_,code:"too_big",maximum:s,inst:e})}}),_d=C("$ZodCheckBigIntFormat",(e,r)=>{Zt.init(e,r);const[o,a]=kl[r.format];e._zod.onattach.push(t=>{const s=t._zod.bag;s.format=r.format,s.minimum=o,s.maximum=a}),e._zod.check=t=>{const s=t.value;s<o&&t.issues.push({origin:"bigint",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!r.abort}),s>a&&t.issues.push({origin:"bigint",input:s,code:"too_big",maximum:a,inst:e})}}),kd=C("$ZodCheckMaxSize",(e,r)=>{var o;Zt.init(e,r),(o=e._zod.def).when??(o.when=a=>{const t=a.value;return!Ln(t)&&t.size!==void 0}),e._zod.onattach.push(a=>{const t=a._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<t&&(a._zod.bag.maximum=r.maximum)}),e._zod.check=a=>{const t=a.value;t.size<=r.maximum||a.issues.push({origin:Lo(t),code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),xd=C("$ZodCheckMinSize",(e,r)=>{var o;Zt.init(e,r),(o=e._zod.def).when??(o.when=a=>{const t=a.value;return!Ln(t)&&t.size!==void 0}),e._zod.onattach.push(a=>{const t=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>t&&(a._zod.bag.minimum=r.minimum)}),e._zod.check=a=>{const t=a.value;t.size>=r.minimum||a.issues.push({origin:Lo(t),code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Sd=C("$ZodCheckSizeEquals",(e,r)=>{var o;Zt.init(e,r),(o=e._zod.def).when??(o.when=a=>{const t=a.value;return!Ln(t)&&t.size!==void 0}),e._zod.onattach.push(a=>{const t=a._zod.bag;t.minimum=r.size,t.maximum=r.size,t.size=r.size}),e._zod.check=a=>{const t=a.value,s=t.size;if(s===r.size)return;const m=s>r.size;a.issues.push({origin:Lo(t),...m?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!r.abort})}}),Id=C("$ZodCheckMaxLength",(e,r)=>{var o;Zt.init(e,r),(o=e._zod.def).when??(o.when=a=>{const t=a.value;return!Ln(t)&&t.length!==void 0}),e._zod.onattach.push(a=>{const t=a._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<t&&(a._zod.bag.maximum=r.maximum)}),e._zod.check=a=>{const t=a.value;if(t.length<=r.maximum)return;const m=Zo(t);a.issues.push({origin:m,code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Nd=C("$ZodCheckMinLength",(e,r)=>{var o;Zt.init(e,r),(o=e._zod.def).when??(o.when=a=>{const t=a.value;return!Ln(t)&&t.length!==void 0}),e._zod.onattach.push(a=>{const t=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>t&&(a._zod.bag.minimum=r.minimum)}),e._zod.check=a=>{const t=a.value;if(t.length>=r.minimum)return;const m=Zo(t);a.issues.push({origin:m,code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),zd=C("$ZodCheckLengthEquals",(e,r)=>{var o;Zt.init(e,r),(o=e._zod.def).when??(o.when=a=>{const t=a.value;return!Ln(t)&&t.length!==void 0}),e._zod.onattach.push(a=>{const t=a._zod.bag;t.minimum=r.length,t.maximum=r.length,t.length=r.length}),e._zod.check=a=>{const t=a.value,s=t.length;if(s===r.length)return;const m=Zo(t),_=s>r.length;a.issues.push({origin:m,..._?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!r.abort})}}),Yi=C("$ZodCheckStringFormat",(e,r)=>{var o,a;Zt.init(e,r),e._zod.onattach.push(t=>{const s=t._zod.bag;s.format=r.format,r.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(r.pattern))}),r.pattern?(o=e._zod).check??(o.check=t=>{r.pattern.lastIndex=0,!r.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:r.format,input:t.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(a=e._zod).check??(a.check=()=>{})}),jd=C("$ZodCheckRegex",(e,r)=>{Yi.init(e,r),e._zod.check=o=>{r.pattern.lastIndex=0,!r.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),Td=C("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=hd),Yi.init(e,r)}),Od=C("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=vd),Yi.init(e,r)}),Ed=C("$ZodCheckIncludes",(e,r)=>{Zt.init(e,r);const o=xn(r.includes),a=new RegExp(typeof r.position=="number"?`^.{${r.position}}${o}`:o);r.pattern=a,e._zod.onattach.push(t=>{const s=t._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(a)}),e._zod.check=t=>{t.value.includes(r.includes,r.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:t.value,inst:e,continue:!r.abort})}}),Cd=C("$ZodCheckStartsWith",(e,r)=>{Zt.init(e,r);const o=new RegExp(`^${xn(r.prefix)}.*`);r.pattern??(r.pattern=o),e._zod.onattach.push(a=>{const t=a._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)}),e._zod.check=a=>{a.value.startsWith(r.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:a.value,inst:e,continue:!r.abort})}}),Pd=C("$ZodCheckEndsWith",(e,r)=>{Zt.init(e,r);const o=new RegExp(`.*${xn(r.suffix)}$`);r.pattern??(r.pattern=o),e._zod.onattach.push(a=>{const t=a._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)}),e._zod.check=a=>{a.value.endsWith(r.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:a.value,inst:e,continue:!r.abort})}});function Ud(e,r,o){e.issues.length&&r.issues.push(...Fr(o,e.issues))}const Dd=C("$ZodCheckProperty",(e,r)=>{Zt.init(e,r),e._zod.check=o=>{const a=r.schema._zod.run({value:o.value[r.property],issues:[]},{});if(a instanceof Promise)return a.then(t=>Ud(t,o,r.property));Ud(a,o,r.property)}}),Ad=C("$ZodCheckMimeType",(e,r)=>{Zt.init(e,r);const o=new Set(r.mime);e._zod.onattach.push(a=>{a._zod.bag.mime=r.mime}),e._zod.check=a=>{o.has(a.value.type)||a.issues.push({code:"invalid_value",values:r.mime,input:a.value.type,inst:e,continue:!r.abort})}}),Md=C("$ZodCheckOverwrite",(e,r)=>{Zt.init(e,r),e._zod.check=o=>{o.value=r.tx(o.value)}});class Ld{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const a=r.split(`
24
24
  `).filter(m=>m),t=Math.min(...a.map(m=>m.length-m.trimStart().length)),s=a.map(m=>m.slice(t)).map(m=>" ".repeat(this.indent*2)+m);for(const m of s)this.content.push(m)}compile(){const r=Function,o=this?.args,t=[...(this?.content??[""]).map(s=>` ${s}`)];return new r(...o,t.join(`
25
25
  `))}}const Zd={major:4,minor:1,patch:8},Ve=C("$ZodType",(e,r)=>{var o;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=Zd;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const t of a)for(const s of t._zod.onattach)s(e);if(a.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(m,_,Z)=>{let K=Rn(m),fe;for(const se of _){if(se._zod.def.when){if(!se._zod.def.when(m))continue}else if(K)continue;const ze=m.issues.length,be=se._zod.check(m);if(be instanceof Promise&&Z?.async===!1)throw new Mn;if(fe||be instanceof Promise)fe=(fe??Promise.resolve()).then(async()=>{await be,m.issues.length!==ze&&(K||(K=Rn(m,ze)))});else{if(m.issues.length===ze)continue;K||(K=Rn(m,ze))}}return fe?fe.then(()=>m):m},s=(m,_,Z)=>{if(Rn(m))return m.aborted=!0,m;const K=t(_,a,Z);if(K instanceof Promise){if(Z.async===!1)throw new Mn;return K.then(fe=>e._zod.parse(fe,Z))}return e._zod.parse(K,Z)};e._zod.run=(m,_)=>{if(_.skipChecks)return e._zod.parse(m,_);if(_.direction==="backward"){const K=e._zod.parse({value:m.value,issues:[]},{..._,skipChecks:!0});return K instanceof Promise?K.then(fe=>s(fe,m,_)):s(K,m,_)}const Z=e._zod.parse(m,_);if(Z instanceof Promise){if(_.async===!1)throw new Mn;return Z.then(K=>t(K,a,_))}return t(Z,a,_)}}e["~standard"]={validate:t=>{try{const s=Ml(e,t);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Ll(e,t).then(m=>m.success?{value:m.data}:{issues:m.error?.issues})}},vendor:"zod",version:1}}),Ki=C("$ZodString",(e,r)=>{Ve.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??cd(e._zod.bag),e._zod.parse=(o,a)=>{if(r.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Et=C("$ZodStringFormat",(e,r)=>{Yi.init(e,r),Ki.init(e,r)}),Rd=C("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=Vl),Et.init(e,r)}),qd=C("$ZodUUID",(e,r)=>{if(r.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(a===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=pi(a))}else r.pattern??(r.pattern=pi());Et.init(e,r)}),Fd=C("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=Jl),Et.init(e,r)}),Wd=C("$ZodURL",(e,r)=>{Et.init(e,r),e._zod.check=o=>{try{const a=o.value.trim(),t=new URL(a);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(t.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ys.source,input:o.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:o.value,inst:e,continue:!r.abort})),r.normalize?o.value=t.href:o.value=a;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!r.abort})}}}),Gd=C("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=Yl()),Et.init(e,r)}),Qd=C("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=Gl),Et.init(e,r)}),Vd=C("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=Zl),Et.init(e,r)}),Jd=C("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=Rl),Et.init(e,r)}),Bd=C("$ZodULID",(e,r)=>{r.pattern??(r.pattern=ql),Et.init(e,r)}),Yd=C("$ZodXID",(e,r)=>{r.pattern??(r.pattern=Fl),Et.init(e,r)}),Kd=C("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=Wl),Et.init(e,r)}),Hd=C("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=ud(r)),Et.init(e,r)}),Xd=C("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=od),Et.init(e,r)}),ef=C("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=sd(r)),Et.init(e,r)}),tf=C("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=Ql),Et.init(e,r)}),rf=C("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=Kl),Et.init(e,r),e._zod.onattach.push(o=>{const a=o._zod.bag;a.format="ipv4"})}),nf=C("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=Hl),Et.init(e,r),e._zod.onattach.push(o=>{const a=o._zod.bag;a.format="ipv6"}),e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!r.abort})}}}),of=C("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=Xl),Et.init(e,r)}),af=C("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=ed),Et.init(e,r),e._zod.check=o=>{const a=o.value.split("/");try{if(a.length!==2)throw new Error;const[t,s]=a;if(!s)throw new Error;const m=Number(s);if(`${m}`!==s)throw new Error;if(m<0||m>128)throw new Error;new URL(`http://[${t}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!r.abort})}}});function ks(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const sf=C("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=td),Et.init(e,r),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64"}),e._zod.check=o=>{ks(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!r.abort})}});function uf(e){if(!bs.test(e))return!1;const r=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),o=r.padEnd(Math.ceil(r.length/4)*4,"=");return ks(o)}const cf=C("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=bs),Et.init(e,r),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64url"}),e._zod.check=o=>{uf(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!r.abort})}}),lf=C("$ZodE164",(e,r)=>{r.pattern??(r.pattern=nd),Et.init(e,r)});function df(e,r=null){try{const o=e.split(".");if(o.length!==3)return!1;const[a]=o;if(!a)return!1;const t=JSON.parse(atob(a));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||r&&(!("alg"in t)||t.alg!==r))}catch{return!1}}const ff=C("$ZodJWT",(e,r)=>{Et.init(e,r),e._zod.check=o=>{df(o.value,r.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!r.abort})}}),mf=C("$ZodCustomStringFormat",(e,r)=>{Et.init(e,r),e._zod.check=o=>{r.fn(o.value)||o.issues.push({code:"invalid_format",format:r.format,input:o.value,inst:e,continue:!r.abort})}}),xs=C("$ZodNumber",(e,r)=>{Ve.init(e,r),e._zod.pattern=e._zod.bag.pattern??fd,e._zod.parse=(o,a)=>{if(r.coerce)try{o.value=Number(o.value)}catch{}const t=o.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return o;const s=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...s?{received:s}:{}}),o}}),pf=C("$ZodNumber",(e,r)=>{wd.init(e,r),xs.init(e,r)}),Ss=C("$ZodBoolean",(e,r)=>{Ve.init(e,r),e._zod.pattern=md,e._zod.parse=(o,a)=>{if(r.coerce)try{o.value=!!o.value}catch{}const t=o.value;return typeof t=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),o}}),Is=C("$ZodBigInt",(e,r)=>{Ve.init(e,r),e._zod.pattern=ld,e._zod.parse=(o,a)=>{if(r.coerce)try{o.value=BigInt(o.value)}catch{}return typeof o.value=="bigint"||o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),gf=C("$ZodBigInt",(e,r)=>{_d.init(e,r),Is.init(e,r)}),hf=C("$ZodSymbol",(e,r)=>{Ve.init(e,r),e._zod.parse=(o,a)=>{const t=o.value;return typeof t=="symbol"||o.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),o}}),vf=C("$ZodUndefined",(e,r)=>{Ve.init(e,r),e._zod.pattern=gd,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(o,a)=>{const t=o.value;return typeof t>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),o}}),bf=C("$ZodNull",(e,r)=>{Ve.init(e,r),e._zod.pattern=pd,e._zod.values=new Set([null]),e._zod.parse=(o,a)=>{const t=o.value;return t===null||o.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),o}}),yf=C("$ZodAny",(e,r)=>{Ve.init(e,r),e._zod.parse=o=>o}),$f=C("$ZodUnknown",(e,r)=>{Ve.init(e,r),e._zod.parse=o=>o}),wf=C("$ZodNever",(e,r)=>{Ve.init(e,r),e._zod.parse=(o,a)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),_f=C("$ZodVoid",(e,r)=>{Ve.init(e,r),e._zod.parse=(o,a)=>{const t=o.value;return typeof t>"u"||o.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),o}}),kf=C("$ZodDate",(e,r)=>{Ve.init(e,r),e._zod.parse=(o,a)=>{if(r.coerce)try{o.value=new Date(o.value)}catch{}const t=o.value,s=t instanceof Date;return s&&!Number.isNaN(t.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:t,...s?{received:"Invalid Date"}:{},inst:e}),o}});function xf(e,r,o){e.issues.length&&r.issues.push(...Fr(o,e.issues)),r.value[o]=e.value}const Sf=C("$ZodArray",(e,r)=>{Ve.init(e,r),e._zod.parse=(o,a)=>{const t=o.value;if(!Array.isArray(t))return o.issues.push({expected:"array",code:"invalid_type",input:t,inst:e}),o;o.value=Array(t.length);const s=[];for(let m=0;m<t.length;m++){const _=t[m],Z=r.element._zod.run({value:_,issues:[]},a);Z instanceof Promise?s.push(Z.then(K=>xf(K,o,m))):xf(Z,o,m)}return s.length?Promise.all(s).then(()=>o):o}});function Ro(e,r,o,a){e.issues.length&&r.issues.push(...Fr(o,e.issues)),e.value===void 0?o in a&&(r.value[o]=void 0):r.value[o]=e.value}function If(e){const r=Object.keys(e.shape);for(const a of r)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const o=wl(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(o)}}function Nf(e,r,o,a,t,s){const m=[],_=t.keySet,Z=t.catchall._zod,K=Z.def.type;for(const fe of Object.keys(r)){if(_.has(fe))continue;if(K==="never"){m.push(fe);continue}const se=Z.run({value:r[fe],issues:[]},a);se instanceof Promise?e.push(se.then(ze=>Ro(ze,o,fe,r))):Ro(se,o,fe,r)}return m.length&&o.issues.push({code:"unrecognized_keys",keys:m,input:r,inst:s}),e.length?Promise.all(e).then(()=>o):o}const zf=C("$ZodObject",(e,r)=>{Ve.init(e,r);const o=qi(()=>If(r));ot(e._zod,"propValues",()=>{const m=r.shape,_={};for(const Z in m){const K=m[Z]._zod;if(K.values){_[Z]??(_[Z]=new Set);for(const fe of K.values)_[Z].add(fe)}}return _});const a=fi,t=r.catchall;let s;e._zod.parse=(m,_)=>{s??(s=o.value);const Z=m.value;if(!a(Z))return m.issues.push({expected:"object",code:"invalid_type",input:Z,inst:e}),m;m.value={};const K=[],fe=s.shape;for(const se of s.keys){const be=fe[se]._zod.run({value:Z[se],issues:[]},_);be instanceof Promise?K.push(be.then(M=>Ro(M,m,se,Z))):Ro(be,m,se,Z)}return t?Nf(K,Z,m,_,o.value,e):K.length?Promise.all(K).then(()=>m):m}}),jf=C("$ZodObjectJIT",(e,r)=>{zf.init(e,r);const o=e._zod.parse,a=qi(()=>If(r)),t=ze=>{const be=new Ld(["shape","payload","ctx"]),M=a.value,_e=mt=>{const bt=ns(mt);return`shape[${bt}]._zod.run({ value: input[${bt}], issues: [] }, ctx)`};be.write("const input = payload.value;");const Ae=Object.create(null);let ht=0;for(const mt of M.keys)Ae[mt]=`key_${ht++}`;be.write("const newResult = {};");for(const mt of M.keys){const bt=Ae[mt],mr=ns(mt);be.write(`const ${bt} = ${_e(mt)};`),be.write(`
@@ -279,4 +279,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
279
279
  .encatch-scale-wrapper {
280
280
  zoom: ${J} !important;
281
281
  }
282
- `),Q};let oe=ee(),ae=ee("");Pn(()=>{R()||$(he,!0)}),$o(()=>{u.clearResponses()}),ye(()=>(l(le),l(oe),I(E())),()=>{if(l(le)){const S=ue(l(le));if(S&&l(oe)){const Q=S.adoptedStyleSheets.indexOf(l(oe));Q>-1&&S.adoptedStyleSheets.splice(Q,1)}$(oe,me(E())),S&&(S.adoptedStyleSheets=[...S.adoptedStyleSheets,l(oe)])}}),ye(()=>(l(le),l(Ne)),()=>{l(le)&&!l(Ne)&&setTimeout(()=>{const S=ue(l(le)),Q=document.createElement("link");Q.rel="stylesheet",Q.href=H,Q.onload=()=>{$(Ne,!0)},Q.onerror=()=>{console.error("Failed to load base CSS"),$(Ne,!0)},S?S.appendChild(Q):document.head.appendChild(Q)},0)}),ye(()=>(l(le),I(R()),l(ae)),()=>{l(le)&&R()&&l(ae)!==R()&&($(he,!1),$(Se,!1),setTimeout(()=>{const S=ue(l(le)),Q=document.createElement("link");Q.rel="stylesheet",Q.href=R(),Q.onload=()=>{$(he,!0),$(ae,R())},Q.onerror=()=>{$(Se,!0),$(ae,R())},S?S.appendChild(Q):document.head.appendChild(Q)},0))}),cr();var G={get theme(){return c()},set theme(S){c(S),at()},get currentMode(){return d()},set currentMode(S){d(S),at()},get currentLanguage(){return f()},set currentLanguage(S){f(S),at()},get questions(){return p()},set questions(S){p(S),at()},get questionLanguages(){return g()},set questionLanguages(S){g(S),at()},get otherConfigurationProperties(){return h()},set otherConfigurationProperties(S){h(S),at()},get welcomeScreenProperties(){return b()},set welcomeScreenProperties(S){b(S),at()},get endScreenProperties(){return y()},set endScreenProperties(S){y(S),at()},get translations(){return k()},set translations(S){k(S),at()},get sections(){return v()},set sections(S){v(S),at()},get themeSettings(){return x()},set themeSettings(S){x(S),at()},get onClose(){return z()},set onClose(S){z(S),at()},get onSectionChange(){return T()},set onSectionChange(S){T(S),at()},get apiKey(){return A()},set apiKey(S){A(S),at()},get hostUrl(){return W()},set hostUrl(S){W(S),at()},get feedbackConfigId(){return ce()},set feedbackConfigId(S){ce(S),at()},get identifier(){return B()},set identifier(S){B(S),at()},get cssLink(){return R()},set cssLink(S){R(S),at()},get scale(){return E()},set scale(S){E(S),at()},get persistMode(){return q()},set persistMode(S){q(S),at()},get instanceId(){return re()},set instanceId(S){re(S),at()}};Xt();var V=gz(),de=L(V);{var P=S=>{cl(S,{get theme(){return c()},get currentMode(){return d()},get currentLanguage(){return f()},get questions(){return p()},get questionLanguages(){return g()},get otherConfigurationProperties(){return h()},get welcomeScreenProperties(){return b()},get endScreenProperties(){return y()},get translations(){return k()},get sections(){return v()},get themeSettings(){return x()},get onClose(){return z()},get onSectionChange(){return T()},get apiKey(){return A()},get hostUrl(){return W()},get feedbackConfigId(){return ce()},get identifier(){return B()},get persistMode(){return q()},get instanceId(){return re()}})};ne(de,S=>{l(he)&&S(P)})}return D(V),$r(V,S=>$(le,S),()=>l(le)),N(i,V),Ke(G)}Vv(ll,{theme:{},currentMode:{},currentLanguage:{},questions:{},questionLanguages:{},otherConfigurationProperties:{},welcomeScreenProperties:{},endScreenProperties:{},translations:{},sections:{},themeSettings:{},onClose:{},onSectionChange:{},apiKey:{},hostUrl:{},feedbackConfigId:{},identifier:{},cssLink:{},scale:{},persistMode:{},instanceId:{}},[],[],!0);var hz=te("<div><!></div>");function Fb(i,n){Ye(n,!1);let u=w(n,"themeMode",12,"light"),c=w(n,"feedbackConfiguration",12,null),d=w(n,"apiKey",12,""),f=w(n,"hostUrl",12,""),p=w(n,"deviceInfo",12,null),g=w(n,"sessionId",12,""),h=w(n,"userInfo",12,null),b=w(n,"language",12,"en"),y=w(n,"configurationData",12,null),k=w(n,"onClose",12,void 0),v=w(n,"trackPopupHeight",12,void 0),x=w(n,"feedbackConfigId",12,void 0),z=w(n,"identifier",12,void 0),T=w(n,"cssLinks",28,()=>[]),A=ee();const W=E=>{if(!E)return null;let q=E;for(;q;){if(q instanceof ShadowRoot)return q;q=q.parentNode}return null};ye(()=>(l(A),I(T())),()=>{if(l(A)&&T()&&T().length>0){const E=W(l(A));E&&T().forEach(q=>{if(!Array.from(E.querySelectorAll('link[rel="stylesheet"]')).find(re=>re.href===q)){const re=document.createElement("link");re.rel="stylesheet",re.href=q,E.appendChild(re)}})}}),cr();var ce={get themeMode(){return u()},set themeMode(E){u(E),at()},get feedbackConfiguration(){return c()},set feedbackConfiguration(E){c(E),at()},get apiKey(){return d()},set apiKey(E){d(E),at()},get hostUrl(){return f()},set hostUrl(E){f(E),at()},get deviceInfo(){return p()},set deviceInfo(E){p(E),at()},get sessionId(){return g()},set sessionId(E){g(E),at()},get userInfo(){return h()},set userInfo(E){h(E),at()},get language(){return b()},set language(E){b(E),at()},get configurationData(){return y()},set configurationData(E){y(E),at()},get onClose(){return k()},set onClose(E){k(E),at()},get trackPopupHeight(){return v()},set trackPopupHeight(E){v(E),at()},get feedbackConfigId(){return x()},set feedbackConfigId(E){x(E),at()},get identifier(){return z()},set identifier(E){z(E),at()},get cssLinks(){return T()},set cssLinks(E){T(E),at()}};Xt();var B=hz(),R=L(B);return qb(R,{get themeMode(){return u()},get feedbackConfiguration(){return c()},get apiKey(){return d()},get hostUrl(){return f()},get deviceInfo(){return p()},get sessionId(){return g()},get userInfo(){return h()},get language(){return b()},get configurationData(){return y()},get onClose(){return k()},get trackPopupHeight(){return v()},get feedbackConfigId(){return x()},get identifier(){return z()}}),D(B),$r(B,E=>$(A,E),()=>l(A)),N(i,B),Ke(ce)}customElements.define("encatch-form",Vv(Fb,{themeMode:{},feedbackConfiguration:{},apiKey:{},hostUrl:{},deviceInfo:{},sessionId:{},userInfo:{},language:{},configurationData:{},onClose:{},trackPopupHeight:{},feedbackConfigId:{},identifier:{},cssLinks:{}},[],[],!0));const vz=Fb,bz=ll;o.App=cl,o.EncatchApp=ll,o.EncatchAppElement=bz,o.EncatchFormElement=vz,o.PopupUi=qb,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}))})(Ri,Ri.exports)),Ri.exports}var Fk=qk();const Wk=Vb({__proto__:null},[Fk]);nn.EncatchPreview=ey,nn.useEncatchFormEvent=ty,nn.useEncatchFormEventAll=ry,Object.defineProperty(nn,Symbol.toStringTag,{value:"Module"})}));
282
+ `),Q};let oe=ee(),ae=ee("");Pn(()=>{R()||$(he,!0)}),$o(()=>{u.clearResponses()}),ye(()=>(l(le),l(oe),I(E())),()=>{if(l(le)){const S=ue(l(le));if(S&&l(oe)){const Q=S.adoptedStyleSheets.indexOf(l(oe));Q>-1&&S.adoptedStyleSheets.splice(Q,1)}$(oe,me(E())),S&&(S.adoptedStyleSheets=[...S.adoptedStyleSheets,l(oe)])}}),ye(()=>(l(le),l(Ne)),()=>{l(le)&&!l(Ne)&&setTimeout(()=>{const S=ue(l(le)),Q=document.createElement("link");Q.rel="stylesheet",Q.href=H,Q.onload=()=>{$(Ne,!0)},Q.onerror=()=>{console.error("Failed to load base CSS"),$(Ne,!0)},S?S.appendChild(Q):document.head.appendChild(Q)},0)}),ye(()=>(l(le),I(R()),l(ae)),()=>{l(le)&&R()&&l(ae)!==R()&&($(he,!1),$(Se,!1),setTimeout(()=>{const S=ue(l(le)),Q=document.createElement("link");Q.rel="stylesheet",Q.href=R(),Q.onload=()=>{$(he,!0),$(ae,R())},Q.onerror=()=>{$(Se,!0),$(ae,R())},S?S.appendChild(Q):document.head.appendChild(Q)},0))}),cr();var G={get theme(){return c()},set theme(S){c(S),at()},get currentMode(){return d()},set currentMode(S){d(S),at()},get currentLanguage(){return f()},set currentLanguage(S){f(S),at()},get questions(){return p()},set questions(S){p(S),at()},get questionLanguages(){return g()},set questionLanguages(S){g(S),at()},get otherConfigurationProperties(){return h()},set otherConfigurationProperties(S){h(S),at()},get welcomeScreenProperties(){return b()},set welcomeScreenProperties(S){b(S),at()},get endScreenProperties(){return y()},set endScreenProperties(S){y(S),at()},get translations(){return k()},set translations(S){k(S),at()},get sections(){return v()},set sections(S){v(S),at()},get themeSettings(){return x()},set themeSettings(S){x(S),at()},get onClose(){return z()},set onClose(S){z(S),at()},get onSectionChange(){return T()},set onSectionChange(S){T(S),at()},get apiKey(){return A()},set apiKey(S){A(S),at()},get hostUrl(){return W()},set hostUrl(S){W(S),at()},get feedbackConfigId(){return ce()},set feedbackConfigId(S){ce(S),at()},get identifier(){return B()},set identifier(S){B(S),at()},get cssLink(){return R()},set cssLink(S){R(S),at()},get scale(){return E()},set scale(S){E(S),at()},get persistMode(){return q()},set persistMode(S){q(S),at()},get instanceId(){return re()},set instanceId(S){re(S),at()}};Xt();var V=gz(),de=L(V);{var P=S=>{cl(S,{get theme(){return c()},get currentMode(){return d()},get currentLanguage(){return f()},get questions(){return p()},get questionLanguages(){return g()},get otherConfigurationProperties(){return h()},get welcomeScreenProperties(){return b()},get endScreenProperties(){return y()},get translations(){return k()},get sections(){return v()},get themeSettings(){return x()},get onClose(){return z()},get onSectionChange(){return T()},get apiKey(){return A()},get hostUrl(){return W()},get feedbackConfigId(){return ce()},get identifier(){return B()},get persistMode(){return q()},get instanceId(){return re()}})};ne(de,S=>{l(he)&&S(P)})}return D(V),$r(V,S=>$(le,S),()=>l(le)),N(i,V),Ke(G)}Vv(ll,{theme:{},currentMode:{},currentLanguage:{},questions:{},questionLanguages:{},otherConfigurationProperties:{},welcomeScreenProperties:{},endScreenProperties:{},translations:{},sections:{},themeSettings:{},onClose:{},onSectionChange:{},apiKey:{},hostUrl:{},feedbackConfigId:{},identifier:{},cssLink:{},scale:{},persistMode:{},instanceId:{}},[],[],!0);var hz=te("<div><!></div>");function Fb(i,n){Ye(n,!1);let u=w(n,"themeMode",12,"light"),c=w(n,"feedbackConfiguration",12,null),d=w(n,"apiKey",12,""),f=w(n,"hostUrl",12,""),p=w(n,"deviceInfo",12,null),g=w(n,"sessionId",12,""),h=w(n,"userInfo",12,null),b=w(n,"language",12,"en"),y=w(n,"configurationData",12,null),k=w(n,"onClose",12,void 0),v=w(n,"trackPopupHeight",12,void 0),x=w(n,"feedbackConfigId",12,void 0),z=w(n,"identifier",12,void 0),T=w(n,"cssLinks",28,()=>[]),A=ee();const W=E=>{if(!E)return null;let q=E;for(;q;){if(q instanceof ShadowRoot)return q;q=q.parentNode}return null};ye(()=>(l(A),I(T())),()=>{if(l(A)&&T()&&T().length>0){const E=W(l(A));E&&T().forEach(q=>{if(!Array.from(E.querySelectorAll('link[rel="stylesheet"]')).find(re=>re.href===q)){const re=document.createElement("link");re.rel="stylesheet",re.href=q,E.appendChild(re)}})}}),cr();var ce={get themeMode(){return u()},set themeMode(E){u(E),at()},get feedbackConfiguration(){return c()},set feedbackConfiguration(E){c(E),at()},get apiKey(){return d()},set apiKey(E){d(E),at()},get hostUrl(){return f()},set hostUrl(E){f(E),at()},get deviceInfo(){return p()},set deviceInfo(E){p(E),at()},get sessionId(){return g()},set sessionId(E){g(E),at()},get userInfo(){return h()},set userInfo(E){h(E),at()},get language(){return b()},set language(E){b(E),at()},get configurationData(){return y()},set configurationData(E){y(E),at()},get onClose(){return k()},set onClose(E){k(E),at()},get trackPopupHeight(){return v()},set trackPopupHeight(E){v(E),at()},get feedbackConfigId(){return x()},set feedbackConfigId(E){x(E),at()},get identifier(){return z()},set identifier(E){z(E),at()},get cssLinks(){return T()},set cssLinks(E){T(E),at()}};Xt();var B=hz(),R=L(B);return qb(R,{get themeMode(){return u()},get feedbackConfiguration(){return c()},get apiKey(){return d()},get hostUrl(){return f()},get deviceInfo(){return p()},get sessionId(){return g()},get userInfo(){return h()},get language(){return b()},get configurationData(){return y()},get onClose(){return k()},get trackPopupHeight(){return v()},get feedbackConfigId(){return x()},get identifier(){return z()}}),D(B),$r(B,E=>$(A,E),()=>l(A)),N(i,B),Ke(ce)}Vv(Fb,{themeMode:{},feedbackConfiguration:{},apiKey:{},hostUrl:{},deviceInfo:{},sessionId:{},userInfo:{},language:{},configurationData:{},onClose:{},trackPopupHeight:{},feedbackConfigId:{},identifier:{},cssLinks:{}},[],[],!0);const vz=Fb,bz=ll;o.App=cl,o.EncatchApp=ll,o.EncatchAppElement=bz,o.EncatchFormElement=vz,o.PopupUi=qb,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}))})(Ri,Ri.exports)),Ri.exports}var Fk=qk();const Wk=Vb({__proto__:null},[Fk]);nn.EncatchPreview=ey,nn.useEncatchFormEvent=ty,nn.useEncatchFormEventAll=ry,Object.defineProperty(nn,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@encatch/ws-react",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "type": "module",
5
5
  "main": "./dist/ws-react.umd.js",
6
6
  "module": "./dist/ws-react.es.js",