@encatch/ws-react 0.0.32 → 0.0.34

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.
@@ -1,5 +1,5 @@
1
- import I, { useState as V, useRef as oe, useEffect as S, useCallback as se } from "react";
2
- var A = { exports: {} }, P = {};
1
+ import I, { useState as U, useRef as se, useEffect as S, useCallback as ie } from "react";
2
+ var k = { exports: {} }, P = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -9,10 +9,10 @@ var A = { exports: {} }, P = {};
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
- var U;
13
- function ie() {
14
- if (U) return P;
15
- U = 1;
12
+ var J;
13
+ function ue() {
14
+ if (J) return P;
15
+ J = 1;
16
16
  var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
17
17
  function n(u, s, c) {
18
18
  var m = null;
@@ -31,7 +31,7 @@ function ie() {
31
31
  }
32
32
  return P.Fragment = r, P.jsx = n, P.jsxs = n, P;
33
33
  }
34
- var k = {};
34
+ var A = {};
35
35
  /**
36
36
  * @license React
37
37
  * react-jsx-runtime.development.js
@@ -41,26 +41,26 @@ var k = {};
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
43
  */
44
- var J;
45
- function ue() {
46
- return J || (J = 1, process.env.NODE_ENV !== "production" && (function() {
44
+ var z;
45
+ function ce() {
46
+ return z || (z = 1, process.env.NODE_ENV !== "production" && (function() {
47
47
  function t(e) {
48
48
  if (e == null) return null;
49
49
  if (typeof e == "function")
50
- return e.$$typeof === re ? null : e.displayName || e.name || null;
50
+ return e.$$typeof === te ? null : e.displayName || e.name || null;
51
51
  if (typeof e == "string") return e;
52
52
  switch (e) {
53
53
  case f:
54
54
  return "Fragment";
55
- case Q:
55
+ case X:
56
56
  return "Profiler";
57
- case G:
57
+ case Q:
58
58
  return "StrictMode";
59
- case Z:
60
- return "Suspense";
61
59
  case K:
60
+ return "Suspense";
61
+ case D:
62
62
  return "SuspenseList";
63
- case ee:
63
+ case re:
64
64
  return "Activity";
65
65
  }
66
66
  if (typeof e == "object")
@@ -69,16 +69,16 @@ function ue() {
69
69
  ), e.$$typeof) {
70
70
  case i:
71
71
  return "Portal";
72
- case B:
72
+ case H:
73
73
  return (e.displayName || "Context") + ".Provider";
74
- case X:
74
+ case B:
75
75
  return (e._context.displayName || "Context") + ".Consumer";
76
- case H:
76
+ case Z:
77
77
  var o = e.render;
78
78
  return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case D:
79
+ case ee:
80
80
  return o = e.displayName || null, o !== null ? o : t(e.type) || "Memo";
81
- case M:
81
+ case F:
82
82
  o = e._payload, e = e._init;
83
83
  try {
84
84
  return t(e(o));
@@ -109,7 +109,7 @@ function ue() {
109
109
  }
110
110
  function u(e) {
111
111
  if (e === f) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === M)
112
+ if (typeof e == "object" && e !== null && e.$$typeof === F)
113
113
  return "<...>";
114
114
  try {
115
115
  var o = t(e);
@@ -126,7 +126,7 @@ function ue() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
128
  function m(e) {
129
- if (F.call(e, "key")) {
129
+ if (Y.call(e, "key")) {
130
130
  var o = Object.getOwnPropertyDescriptor(e, "key").get;
131
131
  if (o && o.isReactWarning) return !1;
132
132
  }
@@ -134,7 +134,7 @@ function ue() {
134
134
  }
135
135
  function p(e, o) {
136
136
  function l() {
137
- Y || (Y = !0, console.error(
137
+ L || (L = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
139
  o
140
140
  ));
@@ -146,16 +146,16 @@ function ue() {
146
146
  }
147
147
  function R() {
148
148
  var e = t(this.type);
149
- return L[e] || (L[e] = !0, console.error(
149
+ return W[e] || (W[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, h, x, j) {
154
- return l = h.ref, e = {
153
+ function T(e, o, l, d, w, E, x, j) {
154
+ return l = E.ref, e = {
155
155
  $$typeof: y,
156
156
  type: e,
157
157
  key: o,
158
- props: h,
158
+ props: E,
159
159
  _owner: w
160
160
  }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
161
161
  enumerable: !1,
@@ -182,11 +182,11 @@ function ue() {
182
182
  value: j
183
183
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
184
184
  }
185
- function E(e, o, l, d, w, h, x, j) {
185
+ function h(e, o, l, d, w, E, x, j) {
186
186
  var b = o.children;
187
187
  if (b !== void 0)
188
188
  if (d)
189
- if (te(b)) {
189
+ if (ne(b)) {
190
190
  for (d = 0; d < b.length; d++)
191
191
  v(b[d]);
192
192
  Object.freeze && Object.freeze(b);
@@ -195,12 +195,12 @@ function ue() {
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
197
  else v(b);
198
- if (F.call(o, "key")) {
198
+ if (Y.call(o, "key")) {
199
199
  b = t(e);
200
- var _ = Object.keys(o).filter(function(ne) {
201
- return ne !== "key";
200
+ var _ = Object.keys(o).filter(function(oe) {
201
+ return oe !== "key";
202
202
  });
203
- d = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", q[b + d] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
203
+ d = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", V[b + d] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
204
204
  `A props object containing a "key" prop is being spread into JSX:
205
205
  let props = %s;
206
206
  <%s {...props} />
@@ -211,7 +211,7 @@ React keys must be passed directly to JSX without using spread:
211
211
  b,
212
212
  _,
213
213
  b
214
- ), q[b + d] = !0);
214
+ ), V[b + d] = !0);
215
215
  }
216
216
  if (b = null, l !== void 0 && (n(l), b = "" + l), m(o) && (n(o.key), b = "" + o.key), "key" in o) {
217
217
  l = {};
@@ -224,7 +224,7 @@ React keys must be passed directly to JSX without using spread:
224
224
  ), T(
225
225
  e,
226
226
  b,
227
- h,
227
+ E,
228
228
  w,
229
229
  s(),
230
230
  l,
@@ -235,7 +235,7 @@ React keys must be passed directly to JSX without using spread:
235
235
  function v(e) {
236
236
  typeof e == "object" && e !== null && e.$$typeof === y && e._store && (e._store.validated = 1);
237
237
  }
238
- var a = I, y = Symbol.for("react.transitional.element"), i = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), G = Symbol.for("react.strict_mode"), Q = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), B = Symbol.for("react.context"), H = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), K = Symbol.for("react.suspense_list"), D = Symbol.for("react.memo"), M = Symbol.for("react.lazy"), ee = Symbol.for("react.activity"), re = Symbol.for("react.client.reference"), C = a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, te = Array.isArray, O = console.createTask ? console.createTask : function() {
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() {
239
239
  return null;
240
240
  };
241
241
  a = {
@@ -243,43 +243,43 @@ React keys must be passed directly to JSX without using spread:
243
243
  return e();
244
244
  }
245
245
  };
246
- var Y, L = {}, W = a.react_stack_bottom_frame.bind(
246
+ var L, W = {}, $ = a.react_stack_bottom_frame.bind(
247
247
  a,
248
248
  c
249
- )(), $ = O(u(c)), q = {};
250
- k.Fragment = f, k.jsx = function(e, o, l, d, w) {
251
- var h = 1e4 > C.recentlyCreatedOwnerStacks++;
252
- return E(
249
+ )(), q = O(u(c)), V = {};
250
+ A.Fragment = f, A.jsx = function(e, o, l, d, w) {
251
+ var E = 1e4 > C.recentlyCreatedOwnerStacks++;
252
+ return h(
253
253
  e,
254
254
  o,
255
255
  l,
256
256
  !1,
257
257
  d,
258
258
  w,
259
- h ? Error("react-stack-top-frame") : W,
260
- h ? O(u(e)) : $
259
+ E ? Error("react-stack-top-frame") : $,
260
+ E ? O(u(e)) : q
261
261
  );
262
- }, k.jsxs = function(e, o, l, d, w) {
263
- var h = 1e4 > C.recentlyCreatedOwnerStacks++;
264
- return E(
262
+ }, A.jsxs = function(e, o, l, d, w) {
263
+ var E = 1e4 > C.recentlyCreatedOwnerStacks++;
264
+ return h(
265
265
  e,
266
266
  o,
267
267
  l,
268
268
  !0,
269
269
  d,
270
270
  w,
271
- h ? Error("react-stack-top-frame") : W,
272
- h ? O(u(e)) : $
271
+ E ? Error("react-stack-top-frame") : $,
272
+ E ? O(u(e)) : q
273
273
  );
274
274
  };
275
- })()), k;
275
+ })()), A;
276
276
  }
277
- var z;
278
- function ce() {
279
- return z || (z = 1, process.env.NODE_ENV === "production" ? A.exports = ie() : A.exports = ue()), A.exports;
277
+ var G;
278
+ function ae() {
279
+ return G || (G = 1, process.env.NODE_ENV === "production" ? k.exports = ue() : k.exports = ce()), k.exports;
280
280
  }
281
- var ae = ce();
282
- class le extends EventTarget {
281
+ var le = ae();
282
+ class fe extends EventTarget {
283
283
  subscriptions = /* @__PURE__ */ new Map();
284
284
  targetOrigin = "*";
285
285
  /**
@@ -386,15 +386,15 @@ class le extends EventTarget {
386
386
  }));
387
387
  }
388
388
  }
389
- const g = new le();
390
- typeof window < "u" && import("./web-form-engine-core.umd-Bo6D7slA.js").then((t) => t.w).then(({ EncatchAppElement: t }) => {
389
+ const g = new fe(), M = "encatch-app-react";
390
+ typeof window < "u" && import("./web-form-engine-core.umd-Qp6qpr0V.js").then((t) => t.w).then(({ EncatchAppElement: t }) => {
391
391
  try {
392
- customElements.get("encatch-app") || customElements.define("encatch-app", t);
392
+ customElements.get(M) || customElements.define(M, t);
393
393
  } catch (r) {
394
394
  console.debug("Custom element registration:", r);
395
395
  }
396
396
  });
397
- const de = ({
397
+ const be = ({
398
398
  formData: t,
399
399
  cssLink: r,
400
400
  scale: n = 100,
@@ -402,9 +402,9 @@ const de = ({
402
402
  instanceId: s,
403
403
  onFormEvent: c
404
404
  }) => {
405
- const [m, p] = V(!1), [R, T] = V(!0), E = I.useRef(null), v = I.useRef(
405
+ const [m, p] = U(!1), [R, T] = U(!0), h = I.useRef(null), v = I.useRef(
406
406
  null
407
- ), a = oe({});
407
+ ), a = se({});
408
408
  S(() => {
409
409
  if (!c) return;
410
410
  c({
@@ -480,30 +480,30 @@ const de = ({
480
480
  "[EncatchPreview] Data validation failed, retrying in 100ms..."
481
481
  );
482
482
  }, [t]);
483
- const y = se(() => {
483
+ const y = ie(() => {
484
484
  t.onClose && t.onClose(), T(!1);
485
485
  }, [t.onClose]);
486
486
  return S(() => {
487
- if (!m || !E.current)
487
+ if (!m || !h.current)
488
488
  return;
489
- const i = document.createElement("encatch-app");
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, E.current.appendChild(i), () => {
491
- E.current && v.current && E.current.removeChild(v.current), v.current = null;
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;
492
492
  };
493
- }, [m, t, r, n, y, u, s]), R ? /* @__PURE__ */ ae.jsx("div", { ref: E }) : null;
493
+ }, [m, t, r, n, y, u, s]), R ? /* @__PURE__ */ le.jsx("div", { ref: h }) : null;
494
494
  };
495
- function be(t, r, n) {
495
+ function me(t, r, n) {
496
496
  S(() => g.subscribe(
497
497
  t,
498
498
  r,
499
499
  n
500
500
  ), [t, n?.formId, r]);
501
501
  }
502
- function me(t, r) {
502
+ function pe(t, r) {
503
503
  S(() => g.subscribeAll(t, r), [r?.formId, t]);
504
504
  }
505
505
  export {
506
- de as EncatchPreview,
507
- be as useEncatchFormEvent,
508
- me as useEncatchFormEventAll
506
+ be as EncatchPreview,
507
+ me as useEncatchFormEvent,
508
+ pe as useEncatchFormEventAll
509
509
  };