@myop/vue 0.0.1-security → 0.0.23

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.
package/dist/index.js ADDED
@@ -0,0 +1,2231 @@
1
+ import { defineComponent as Ut, useAttrs as qt, useSlots as Wt, ref as K, getCurrentInstance as jt, onMounted as Gt, reactive as Jt, watchEffect as Yt, createElementBlock as Xt, openBlock as Qt, Fragment as Zt, createElementVNode as es, renderSlot as ts, createCommentVNode as ss, mergeProps as ns, unref as is } from "vue";
2
+ var os = Object.defineProperty, rs = (e, t, s) => t in e ? os(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, p = (e, t, s) => rs(e, typeof t != "symbol" ? t + "" : t, s), z = (e, t, s) => new Promise((n, i) => {
3
+ var o = (l) => {
4
+ try {
5
+ c(s.next(l));
6
+ } catch (d) {
7
+ i(d);
8
+ }
9
+ }, r = (l) => {
10
+ try {
11
+ c(s.throw(l));
12
+ } catch (d) {
13
+ i(d);
14
+ }
15
+ }, c = (l) => l.done ? n(l.value) : Promise.resolve(l.value).then(o, r);
16
+ c((s = s.apply(e, t)).next());
17
+ }), k = () => "10000000-1000-4000-8000-100000000000".replace(
18
+ /[018]/g,
19
+ (e) => (+e ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +e / 4).toString(16)
20
+ ), as = class {
21
+ constructor() {
22
+ p(this, "id", k()), p(this, "myop", !0), p(this, "content"), p(this, "source"), p(this, "destination"), p(this, "route"), p(this, "ref"), p(this, "direction"), p(this, "cleanable", !1);
23
+ }
24
+ static create(...t) {
25
+ return new this(...t);
26
+ }
27
+ isTypeof(t) {
28
+ return t.messageType === this.messageType;
29
+ }
30
+ }, cs = class extends as {
31
+ constructor(t) {
32
+ super(), this.handler = t, p(this, "handlerUniqueId", k());
33
+ }
34
+ }, ls = "ExecuteScriptReplyMessage", ds = /(?:function\s*\w*\s*\([^)]*\)\s*\{([\s\S]*?)\}|(\([^)]*\)\s*=>\s*\{([\s\S]*?)\}))\s*$/, us = /\(\s*[^)]+\s*\)\s*=>\s*(.+)/, hs = (e) => {
35
+ let t = e.match(ds);
36
+ if (t)
37
+ return t[1] || t[3];
38
+ {
39
+ let s = e.match(us);
40
+ if (s)
41
+ return s[1].trim();
42
+ }
43
+ }, Ke = class extends cs {
44
+ constructor(t, s = () => {
45
+ }, n) {
46
+ super(s), this.scriptInputs = n, p(this, "replyMessageKey", ls), p(this, "messageType", "ExecuteScriptMessage"), p(this, "script", ""), this.script = t.toString(), this.content = t.toString(), this.content = hs(this.content);
47
+ }
48
+ };
49
+ p(Ke, "replierKey", "send");
50
+ p(Ke, "completeStreamKey", "completeStream");
51
+ var Ne = class {
52
+ constructor() {
53
+ p(this, "_runTimeInstanceId", "runtime-instance-id-" + k()), p(this, "_runTimeId", "runtime-id-" + k()), p(this, "_runTimeName", "runtime-name-" + k()), p(this, "id", this._runTimeId), p(this, "name", this._runTimeName), p(this, "description", ""), p(this, "loader", null), p(this, "withLoader", (t) => (this.loader = t, this)), p(this, "withHTMLLoader", (t) => (t.type = "HTMLLoader", this.loader = t, this)), p(this, "build", () => this);
54
+ }
55
+ };
56
+ p(Ne, "create", () => new Ne());
57
+ var $e = class {
58
+ constructor() {
59
+ p(this, "_runTimeInstanceId", "runtime-instance-id-" + k()), p(this, "_runTimeId", "runtime-id-" + k()), p(this, "_runTimeName", "runtime-name-" + k()), p(this, "instance", {
60
+ id: this._runTimeInstanceId,
61
+ componentId: this._runTimeId,
62
+ componentName: this._runTimeName,
63
+ skinSelector: null
64
+ }), p(this, "name", this._runTimeName), p(this, "type", {
65
+ id: this._runTimeId,
66
+ name: this._runTimeName,
67
+ description: "",
68
+ props: [],
69
+ refs: [],
70
+ skins: [],
71
+ defaultSkin: 0
72
+ }), p(this, "withInstance", (t) => (this.instance = t, this)), p(this, "withType", (t) => (this.type = t, this)), p(this, "withName", (t) => (this.name = t, this)), p(this, "withDefaultSkin", (t) => (this.type.skins.push(t), this.type.defaultSkin = this.type.skins.length - 1, this.instance.skinSelector = {
73
+ type: "Dedicated",
74
+ skin: {
75
+ id: t.id
76
+ }
77
+ }, this)), p(this, "withRef", (t) => (this.type.refs.push(t), this)), p(this, "withBasicRef", (t) => {
78
+ const s = {
79
+ id: "",
80
+ name: t,
81
+ description: "",
82
+ selectorType: "id-attribute",
83
+ selector: t,
84
+ behavior: {
85
+ type: "code"
86
+ }
87
+ };
88
+ return this.type.refs.push(s), this;
89
+ }), p(this, "build", () => JSON.parse(JSON.stringify(this)));
90
+ }
91
+ };
92
+ p($e, "create", () => new $e());
93
+ var pe = class {
94
+ // private components: Record<string, Promise<IUserFlow>> = {};
95
+ constructor(t = "https://cloud.myop.dev") {
96
+ this._baseUrl = t, p(this, "userFlows", {});
97
+ }
98
+ fetchComponent(t, s) {
99
+ return z(this, null, function* () {
100
+ return s ? (yield this.fetchFlow(s)).components.find((i) => i.type.id === t) : (yield this.fetchAutoFlow(t)).components[0];
101
+ });
102
+ }
103
+ fetchAutoFlow(t) {
104
+ return z(this, null, function* () {
105
+ return this.userFlows[t] || (this.userFlows[t] = new Promise(
106
+ (s, n) => z(this, null, function* () {
107
+ try {
108
+ const o = yield (yield fetch(
109
+ `${this._baseUrl}/flow?id=${t}&auto=true`
110
+ )).json();
111
+ s(o.item);
112
+ } catch (i) {
113
+ n(i);
114
+ }
115
+ })
116
+ )), yield this.userFlows[t];
117
+ });
118
+ }
119
+ fetchFlow(t) {
120
+ return z(this, null, function* () {
121
+ return this.userFlows[t] || (this.userFlows[t] = new Promise(
122
+ (s, n) => z(this, null, function* () {
123
+ try {
124
+ const o = yield (yield fetch(
125
+ `${this._baseUrl}/flow?id=${t}&resolve=components`
126
+ )).json();
127
+ s(o.item);
128
+ } catch (i) {
129
+ n(i);
130
+ }
131
+ })
132
+ )), yield this.userFlows[t];
133
+ });
134
+ }
135
+ };
136
+ p(pe, "Main", new pe());
137
+ var ps = pe, ze = Object.defineProperty, fs = Object.defineProperties, ms = Object.getOwnPropertyDescriptors, Pe = Object.getOwnPropertySymbols, gs = Object.prototype.hasOwnProperty, ys = Object.prototype.propertyIsEnumerable, fe = (e, t, s) => t in e ? ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, g = (e, t) => {
138
+ for (var s in t || (t = {}))
139
+ gs.call(t, s) && fe(e, s, t[s]);
140
+ if (Pe)
141
+ for (var s of Pe(t))
142
+ ys.call(t, s) && fe(e, s, t[s]);
143
+ return e;
144
+ }, G = (e, t) => fs(e, ms(t)), vs = (e, t) => {
145
+ for (var s in t)
146
+ ze(e, s, { get: t[s], enumerable: !0 });
147
+ }, a = (e, t, s) => fe(e, typeof t != "symbol" ? t + "" : t, s), y = (e, t, s) => new Promise((n, i) => {
148
+ var o = (l) => {
149
+ try {
150
+ c(s.next(l));
151
+ } catch (d) {
152
+ i(d);
153
+ }
154
+ }, r = (l) => {
155
+ try {
156
+ c(s.throw(l));
157
+ } catch (d) {
158
+ i(d);
159
+ }
160
+ }, c = (l) => l.done ? n(l.value) : Promise.resolve(l.value).then(o, r);
161
+ c((s = s.apply(e, t)).next());
162
+ }), J = "__federation__", Le = "onLoad", Ue = (e, t) => {
163
+ window[J] && window[J][e] && window[J][e][Le] && window[J][e][Le]({ [e]: t });
164
+ }, f = {
165
+ //host to component
166
+ InitRequest: "InitRequest",
167
+ InitResponse: "InitResponse",
168
+ InitMessage: "InitMessage",
169
+ DisposeMessage: "DisposeMessage",
170
+ ChangeTextMessage: "ChangeTextMessage",
171
+ BindClickMessage: "BindClickMessage",
172
+ DetectMyopRefsMessage: "DetectMyopRefsMessage",
173
+ ExecuteScriptMessage: "ExecuteScriptMessage",
174
+ AddEventListenerMessage: "AddEventListenerMessage",
175
+ SetAttributeMessage: "SetAttributeMessage",
176
+ CreateRefComponentMessage: "CreateRefComponentMessage",
177
+ EnvelopedMessage: "EnvelopedMessage",
178
+ GetElementValueMessage: "GetElementValueMessage",
179
+ SetInnerHtml: "SetInnerHtml",
180
+ //component messages
181
+ ExecuteComponentMethod: "ExecuteComponentMethod",
182
+ CleanupMessage: "CleanupMessage",
183
+ // external to host :
184
+ In: {
185
+ MutationObserverMessage: "MutationObserverMessage",
186
+ ResizeObserverMessage: "ResizeObserverMessage"
187
+ }
188
+ }, me = {};
189
+ vs(me, {
190
+ AddEventListenerMessage: () => Ss,
191
+ BaseMyopMessage: () => v,
192
+ BindClickMessage: () => _s,
193
+ ChangeTextMessage: () => Es,
194
+ CleanupMessage: () => dt,
195
+ CleanupReplayMessage: () => ut,
196
+ ClickReplayMessage: () => je,
197
+ CreateRefComponentMessage: () => it,
198
+ CustomRefMessage: () => ge,
199
+ DetectMyopRefsMessage: () => Rs,
200
+ DetectedMyopRefsMessage: () => at,
201
+ DisposeMessage: () => ht,
202
+ ElementValueReplayMessage: () => et,
203
+ EnvelopedMessage: () => ot,
204
+ EventListenerCallbackMessage: () => Qe,
205
+ ExecuteComponentMethod: () => x,
206
+ ExecuteScriptMessage: () => H,
207
+ ExecuteScriptReplyMessage: () => Ye,
208
+ GetAttributeMessage: () => Hs,
209
+ GetAttributeReplayMessage: () => ks,
210
+ GetElementValueMessage: () => Ts,
211
+ InitMessage: () => be,
212
+ InitRequest: () => st,
213
+ InitResponse: () => tt,
214
+ MessageDirection: () => E,
215
+ MutationObserverMessage: () => Os,
216
+ MyopBindMessage: () => I,
217
+ MyopBindReplayMessage: () => S,
218
+ MyopElementMessage: () => Ms,
219
+ Ref: () => U,
220
+ RefComponentCreatedMessage: () => ye,
221
+ ResizeObserverMessage: () => $s,
222
+ SetAttributeMessage: () => Is,
223
+ SetInnerHtml: () => xs,
224
+ SetMutationObserverMessage: () => Ds,
225
+ SetResizeObserverMessage: () => Ns,
226
+ stripFunction: () => Je
227
+ });
228
+ var A = () => "10000000-1000-4000-8000-100000000000".replace(
229
+ /[018]/g,
230
+ (e) => (+e ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +e / 4).toString(16)
231
+ ), ws = (e) => new Promise((t) => setTimeout(t, e)), E = class {
232
+ };
233
+ a(E, "down", "down");
234
+ a(E, "up", "up");
235
+ var v = class {
236
+ constructor() {
237
+ a(this, "id", A()), a(this, "myop", !0), a(this, "content"), a(this, "source"), a(this, "destination"), a(this, "route"), a(this, "ref"), a(this, "direction"), a(this, "cleanable", !1);
238
+ }
239
+ static create(...e) {
240
+ return new this(...e);
241
+ }
242
+ isTypeof(e) {
243
+ return e.messageType === this.messageType;
244
+ }
245
+ }, Ms = class extends v {
246
+ constructor(e) {
247
+ super(), this.ref = e;
248
+ }
249
+ }, S = class extends v {
250
+ constructor(e) {
251
+ super(), this.replayToHandler = e;
252
+ }
253
+ }, I = class extends v {
254
+ constructor(e) {
255
+ super(), this.handler = e, a(this, "handlerUniqueId", A());
256
+ }
257
+ }, U = class qe {
258
+ constructor(t, s) {
259
+ this.refConfig = t, this.component = s, a(this, "myop", !0), a(this, "__nonProxied"), this.__nonProxied = G(g({}, this), {
260
+ component: null
261
+ // in order to be serializable
262
+ });
263
+ }
264
+ static create(t, s, n) {
265
+ let i = s;
266
+ return i || (i = {
267
+ id: "",
268
+ name: "",
269
+ description: "",
270
+ selectorType: "id-attribute",
271
+ selector: t,
272
+ behavior: {
273
+ type: "code"
274
+ }
275
+ }), new qe(i, n);
276
+ }
277
+ }, We = "ClickReplayMessage", _s = class extends I {
278
+ constructor(e, t) {
279
+ super(t), this.ref = e, a(this, "replyMessageKey", We), a(this, "messageType", "BindClickMessage"), a(this, "cleanable", !0);
280
+ }
281
+ }, je = class extends S {
282
+ constructor() {
283
+ super(...arguments), a(this, "messageType", We);
284
+ }
285
+ }, Es = class extends v {
286
+ constructor(e, t) {
287
+ super(), this.ref = e, a(this, "messageType", "ChangeTextMessage"), this.content = t;
288
+ }
289
+ }, Ge = "ExecuteScriptReplyMessage", bs = /(?:function\s*\w*\s*\([^)]*\)\s*\{([\s\S]*?)\}|(\([^)]*\)\s*=>\s*\{([\s\S]*?)\}))\s*$/, Cs = /\(\s*[^)]+\s*\)\s*=>\s*(.+)/, Je = (e) => {
290
+ let t = e.match(bs);
291
+ if (t)
292
+ return t[1] || t[3];
293
+ {
294
+ let s = e.match(Cs);
295
+ if (s)
296
+ return s[1].trim();
297
+ }
298
+ }, H = class extends I {
299
+ constructor(e, t = () => {
300
+ }, s) {
301
+ super(t), this.scriptInputs = s, a(this, "replyMessageKey", Ge), a(this, "messageType", "ExecuteScriptMessage"), a(this, "script", ""), this.script = e.toString(), this.content = e.toString(), this.content = Je(this.content);
302
+ }
303
+ };
304
+ a(H, "replierKey", "send");
305
+ a(H, "completeStreamKey", "completeStream");
306
+ var Ye = class extends S {
307
+ constructor(e, t) {
308
+ super(e), this.replayToHandler = e, this.content = t, a(this, "messageType", Ge);
309
+ }
310
+ }, ge = class extends H {
311
+ constructor(e, t, s = () => {
312
+ }) {
313
+ super(({ rootRef: n, elementId: i, _script: o, __scriptInputs: r }) => {
314
+ const c = (n.shadowRoot || n.container).querySelectorAll(`[myop-id='${i}']`);
315
+ return c.length ? (r.ref = c[0], new Function(`return (${o})(...arguments)`)(r)) : null;
316
+ }, s), this.scriptInputs = t, this.scriptInputs = G(g({}, t), {
317
+ //_script: stripFunction(script.toString()),
318
+ _script: e.toString()
319
+ });
320
+ }
321
+ }, Xe = "EventListenerCallbackMessage", Ss = class extends I {
322
+ // {} // empty
323
+ constructor(e, t, s) {
324
+ super(s), this.ref = e, this.type = t, this.handler = s, a(this, "replyMessageKey", Xe), a(this, "messageType", "AddEventListenerMessage"), a(this, "cleanable", !0), a(this, "serializableSkeleton", !1);
325
+ }
326
+ withSerializableSkeleton(e) {
327
+ return this.serializableSkeleton = e, this;
328
+ }
329
+ }, Qe = class extends S {
330
+ constructor(e, t) {
331
+ super(e), this.replayToHandler = e, this.e = t, a(this, "messageType", Xe), this.content = {
332
+ e: t
333
+ };
334
+ }
335
+ }, Is = class extends v {
336
+ constructor(e, t, s) {
337
+ super(), this.ref = e, this.name = t, this.value = s, a(this, "messageType", "SetAttributeMessage");
338
+ }
339
+ }, Ze = "ElementValueReplayMessage", Ts = class extends I {
340
+ constructor(e, t) {
341
+ super(t), this.ref = e, a(this, "replyMessageKey", Ze), a(this, "messageType", "GetElementValueMessage");
342
+ }
343
+ }, et = class extends S {
344
+ constructor(e) {
345
+ super(), this.content = e, a(this, "messageType", Ze);
346
+ }
347
+ }, xs = class extends v {
348
+ constructor(e, t) {
349
+ super(), this.ref = e, a(this, "messageType", "SetInnerHtml"), this.content = t;
350
+ }
351
+ }, be = class extends v {
352
+ constructor(e) {
353
+ super(), a(this, "messageType", "InitMessage"), this.content = { id: e };
354
+ }
355
+ isTypeof(e) {
356
+ return e.messageType === this.messageType;
357
+ }
358
+ }, tt = class extends be {
359
+ constructor() {
360
+ super(...arguments), a(this, "messageType", "InitResponse");
361
+ }
362
+ }, st = class extends v {
363
+ constructor() {
364
+ super(...arguments), a(this, "messageType", "InitRequest");
365
+ }
366
+ }, nt = "RefComponentCreatedMessage", it = class extends I {
367
+ constructor(e, t, s, n) {
368
+ super(n), this.refConfig = e, this.nestedComponentConfig = t, this.options = s, a(this, "replyMessageKey", nt), a(this, "messageType", "CreateRefComponentMessage");
369
+ }
370
+ }, ye = class extends S {
371
+ constructor(e, t, s) {
372
+ super(e), this.replayToHandler = e, this.nestedRefs = t, this.failed = s, a(this, "messageType", nt);
373
+ }
374
+ }, ot = class extends v {
375
+ constructor(e, t) {
376
+ super(), this.destination = e, this.message = t, a(this, "messageType", "EnvelopedMessage");
377
+ const s = t;
378
+ this.route = [e, ...s.route ? s.route : []];
379
+ }
380
+ }, rt = "DetectedMyopRefsMessage", Rs = class extends I {
381
+ constructor() {
382
+ super(...arguments), a(this, "messageType", "DetectMyopRefsMessage"), a(this, "replyMessageKey", rt);
383
+ }
384
+ }, at = class extends S {
385
+ constructor(e, t) {
386
+ super(e), this.replayToHandler = e, a(this, "messageType", rt), this.content = t;
387
+ }
388
+ isTypeof(e) {
389
+ return e.messageType === this.messageType;
390
+ }
391
+ }, ct = "GetAttributeReplayMessage", Hs = class extends I {
392
+ constructor(e, t, s) {
393
+ super(s), this.ref = e, this.name = t, a(this, "replyMessageKey", ct), a(this, "messageType", "GetAttributeMessage");
394
+ }
395
+ }, ks = class extends S {
396
+ constructor(e) {
397
+ super(), this.content = e, a(this, "messageType", ct);
398
+ }
399
+ }, x = class extends v {
400
+ constructor(e) {
401
+ super(), this.method = e, a(this, "messageType", "ExecuteComponentMethod");
402
+ }
403
+ }, Ds = class extends v {
404
+ constructor() {
405
+ super(...arguments), a(this, "messageType", "SetMutationObserverMessage");
406
+ }
407
+ }, Os = class extends v {
408
+ constructor() {
409
+ super(...arguments), a(this, "messageType", "MutationObserverMessage");
410
+ }
411
+ }, lt = "CleanupReplayMessage", dt = class extends I {
412
+ constructor(e, t) {
413
+ super(t), this.cleanupForMessageId = e, a(this, "replyMessageKey", lt), a(this, "messageType", "CleanupMessage");
414
+ }
415
+ }, ut = class extends S {
416
+ constructor(e) {
417
+ super(), this.customCleanup = e, a(this, "messageType", lt);
418
+ }
419
+ }, ht = class extends v {
420
+ constructor() {
421
+ super(...arguments), a(this, "messageType", "DisposeMessage");
422
+ }
423
+ }, Ns = class extends v {
424
+ constructor() {
425
+ super(...arguments), a(this, "cleanable", !0), a(this, "messageType", "SetResizeObserverMessage");
426
+ }
427
+ }, $s = class extends v {
428
+ constructor() {
429
+ super(...arguments), a(this, "messageType", "ResizeObserverMessage");
430
+ }
431
+ }, Ce = class {
432
+ constructor(e, t, s) {
433
+ this.componentDefinition = e, this.container = t, a(this, "id", ""), a(this, "messageHandlers", {}), a(this, "element"), a(this, "_markedForDisposed", !1), a(this, "bind", (i, o) => {
434
+ this.messageHandlers[i] || (this.messageHandlers[i] = []), this.messageHandlers[i].includes(o) || this.messageHandlers[i].push(o);
435
+ }), a(this, "bindWhen", (i, o, r) => {
436
+ if (!r)
437
+ throw new Error("can't use component.bindWhen without an handler");
438
+ this.messageHandlers[i] || (this.messageHandlers[i] = []);
439
+ const c = this.messageHandlers[i], l = (d) => o(d) ? (r(d), !0) : !1;
440
+ return c.push(l), () => {
441
+ const d = c.indexOf(l);
442
+ d > -1 && c.splice(d, 1);
443
+ };
444
+ }), a(this, "setInitiated", () => {
445
+ this.isInitiated = !0, this._whenInitiatedResolve && this._whenInitiatedResolve();
446
+ }), a(this, "isInitiated", !1), a(this, "_whenInitiatedResolve"), a(this, "_whenInitiatedReject"), a(this, "_whenInitiated", new Promise((i, o) => {
447
+ this._whenInitiatedResolve = i, this._whenInitiatedReject = o;
448
+ })), a(this, "initiated", () => this._whenInitiated), a(this, "props", {}), a(this, "refs", {}), this.id = (s == null ? void 0 : s.id) || ie.Instance().assignId(e);
449
+ const n = s != null && s.timeout ? s == null ? void 0 : s.timeout : 5 * 1e3;
450
+ setTimeout(() => {
451
+ !this.isInitiated && this._whenInitiatedReject && !this._markedForDisposed && this._whenInitiatedReject(`timeout_${n} ${this.id}`);
452
+ }, n), this.initiated().then(() => {
453
+ window.myop.hostSDK.inspected && this.inspect();
454
+ });
455
+ }
456
+ get markedForDisposed() {
457
+ return this._markedForDisposed;
458
+ }
459
+ set markedForDisposed(e) {
460
+ if (this._markedForDisposed)
461
+ throw new Error("InvalidOperationException: The component is already in the process of being disposed. Dispose operation cannot be performed again until the current disposal process is complete.");
462
+ this._markedForDisposed = e;
463
+ }
464
+ onMessageReceived(e) {
465
+ if (e.messageType === f.ExecuteComponentMethod) {
466
+ const s = e;
467
+ return this[s.method] ? this[s.method](s.content) : console.log(`method not found ${s.method} on component`, this), !0;
468
+ }
469
+ const t = this.messageHandlers[e.messageType];
470
+ if (t && t.length) {
471
+ let s = !1;
472
+ return t.forEach((n) => {
473
+ s = s || n(e);
474
+ }), s;
475
+ }
476
+ return !1;
477
+ }
478
+ sendCleanupMessage(e) {
479
+ e.source = this.id, e.destination = this.id, e.direction = E.down;
480
+ const t = this.bindWhen(e.replyMessageKey, (n) => n.replayToHandler === e.handlerUniqueId, (n) => {
481
+ e.handler(n), t();
482
+ }), s = e.handler;
483
+ delete e.handler, this.send(e), e.handler = s;
484
+ }
485
+ send(e) {
486
+ e.source || (e.source = this.id), e.destination || (e.destination = this.id), e.direction = E.down;
487
+ let t;
488
+ if (e.handler) {
489
+ const s = e;
490
+ t = this.bindWhen(s.replyMessageKey, (n) => n.replayToHandler === s.handlerUniqueId, s.handler), delete e.handler;
491
+ }
492
+ return e.ref && (e.ref = e.ref.__nonProxied || e.ref), e.cleanable ? () => {
493
+ this.sendCleanupMessage(new dt(e.id, (s) => {
494
+ })), t && t();
495
+ } : () => {
496
+ };
497
+ }
498
+ dispose() {
499
+ if (this.markedForDisposed = !0, !this.isInitiated)
500
+ return;
501
+ console.log("disposing component", this.id), this.send(new ht());
502
+ const e = this.messageHandlers.onDispose;
503
+ e && e.forEach((t) => {
504
+ t(null);
505
+ }), this.messageHandlers = {}, this.id += "_disposed", this.isInitiated = !1;
506
+ }
507
+ }, Ps = class {
508
+ constructor(e, t, s, n, i) {
509
+ this.myopId = e, this.htmlTagName = t, this.BoundingRect = s, this.offsetTop = n, this.offsetLeft = i, a(this, "type", "MyopElementRef");
510
+ }
511
+ }, Ls = (e) => y(void 0, null, function* () {
512
+ if (typeof e == "function")
513
+ e();
514
+ else if (e instanceof Promise) {
515
+ const t = yield e;
516
+ typeof t == "function" && t();
517
+ }
518
+ }), Fs = class {
519
+ //TODO : add dispose method
520
+ constructor(e) {
521
+ this.messageToHost = e;
522
+ }
523
+ }, As = class extends Fs {
524
+ constructor(e, t) {
525
+ super(e), this.messageToHost = e, this.context = t;
526
+ }
527
+ }, Vs = class {
528
+ //onMessageReceived: (msg: IMyopMessage) => void;
529
+ constructor(e, t) {
530
+ this.id = e, this.context = t, a(this, "send", (s) => {
531
+ });
532
+ }
533
+ }, Bs = class {
534
+ constructor() {
535
+ a(this, "messageToHandleAfterInit", []), a(this, "components", {}), a(this, "alwaysPassEnvelopesToHost", !1), a(this, "messageCleanupCache", {});
536
+ }
537
+ handleIncomeMessages(e) {
538
+ const t = e.data ? e.data : e.detail;
539
+ if (!(!t || !t.myop)) {
540
+ let s = t;
541
+ if (s.direction !== E.down)
542
+ return;
543
+ if (s.messageType === f.DisposeMessage) {
544
+ s.destination && delete this.components[s.destination];
545
+ return;
546
+ }
547
+ if (s.messageType === f.InitMessage) {
548
+ const n = s.content.id;
549
+ if (this.components[n])
550
+ return;
551
+ this.components[n] = new Vs(n), this.messageToHost(new tt(n));
552
+ return;
553
+ }
554
+ if (s.messageType === f.EnvelopedMessage) {
555
+ const n = s, i = n.message;
556
+ if (s = i, this.alwaysPassEnvelopesToHost || this.components[s.destination]) {
557
+ const o = myop.hostSDK.components.find((c) => c.id === i.destination);
558
+ if (o) {
559
+ o.send(i);
560
+ return;
561
+ }
562
+ const r = myop.hostSDK.components.find((c) => c.id === n.destination);
563
+ if (r) {
564
+ r.send(i);
565
+ return;
566
+ }
567
+ } else
568
+ return;
569
+ }
570
+ if (s.messageType) {
571
+ if (s.messageType === f.CleanupMessage) {
572
+ const n = s, i = this.messageCleanupCache[n.cleanupForMessageId], o = new ut(!!i);
573
+ o.destination = s.destination, i ? (delete this.messageCleanupCache[n.cleanupForMessageId], Ls(i).then(() => {
574
+ this.messageToHost(o, n);
575
+ }).catch(() => {
576
+ })) : this.messageToHost(o, n);
577
+ return;
578
+ }
579
+ this.supportedHandlers.forEach((n) => {
580
+ if (n.messageType === s.messageType) {
581
+ const i = n.executor(s);
582
+ if (s.cleanable && i && (this.messageCleanupCache[s.id] = i), i && !s.cleanable)
583
+ throw new Error(`Cleanup handler generated for non-cleanable message.
584
+ messageType - ${s.messageType}, handler executor was - ${n.executor}
585
+
586
+ Please review the message definition object & message handler.
587
+ To ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers.`);
588
+ if (!i && s.cleanable)
589
+ throw new Error(`No cleanup handler generated for a cleanable message.
590
+ messageType - ${s.messageType}, handler executor was - ${n.executor}
591
+
592
+ Please review the message definition object & message handler.
593
+ To ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers.`);
594
+ }
595
+ });
596
+ } else
597
+ console.log("unsupported message type");
598
+ }
599
+ }
600
+ }, Se = {
601
+ IframeLoader: "IframeLoader",
602
+ WebComponentLoader: "WebComponentLoader",
603
+ HTMLLoader: "HTMLLoader"
604
+ }, ve = {
605
+ open: "open",
606
+ none: "none",
607
+ localFrame: "localFrame"
608
+ }, Ie = class {
609
+ };
610
+ a(Ie, "code", "code");
611
+ a(Ie, "component", "component");
612
+ var ce = {
613
+ Segmented: "Segmented",
614
+ Dedicated: "Dedicated"
615
+ }, Ks = {
616
+ Segment: "Segment"
617
+ }, zs = class {
618
+ constructor(e, t) {
619
+ this.container = e, this.shadowRoot = t, a(this, "getRootDiv", () => (this.shadowRoot || this.container).querySelector("div")), a(this, "getRoot", () => this.shadowRoot || this.container);
620
+ }
621
+ }, we = (e) => e !== Object(e), Us = (e) => typeof e == "function", pt = (e) => {
622
+ if (we(e))
623
+ return !0;
624
+ if (Us(e) || Object.getPrototypeOf(e))
625
+ return !1;
626
+ for (const t in e) {
627
+ const s = e[t];
628
+ if (typeof s == "object") {
629
+ if (!pt(s))
630
+ return !1;
631
+ } else {
632
+ if (we(s))
633
+ continue;
634
+ return !1;
635
+ }
636
+ }
637
+ return !0;
638
+ }, L = (e, t = {}, s = !0, n = /* @__PURE__ */ new WeakMap()) => {
639
+ if (we(e))
640
+ return e;
641
+ if (Array.isArray(e)) {
642
+ if (n.has(e))
643
+ return n.get(e);
644
+ const i = [];
645
+ n.set(e, i);
646
+ for (let o = 0; o < e.length; o++) {
647
+ const r = e[o];
648
+ i[o] = L(r, t, s, n);
649
+ }
650
+ return i;
651
+ }
652
+ if (e !== null && typeof e == "object") {
653
+ if (n.has(e))
654
+ return n.get(e);
655
+ const i = {};
656
+ n.set(e, i);
657
+ for (const o in e) {
658
+ const r = typeof t == "boolean" ? t : t[o];
659
+ r && (r === !0 ? (s ? e[o] !== void 0 : e[o]) && (i[o] = L(e[o], !0, s, n)) : typeof r == "object" && (i[o] = L(e[o], r, s, n)));
660
+ }
661
+ return i;
662
+ }
663
+ return {};
664
+ }, qs = {
665
+ notSerializableRefCall: (e, t) => {
666
+ throw new Error(`
667
+ The input provided to '${e.toString()}' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation.
668
+ The following types of data are considered non-serializable and cannot be processed:
669
+
670
+ - Functions
671
+ - DOM elements
672
+ - Class instances
673
+ - Circular references
674
+ - Symbols
675
+ - BigInt values
676
+
677
+ In the following execution we detected :
678
+ ~~~~~~~~
679
+ ${t}
680
+ ~~~~~~~~
681
+ as not serializable.
682
+
683
+ To resolve this issue, please ensure that all inputs passed to '${e.toString()}' are in a serializable format.
684
+ This typically includes primitive types (strings, numbers, booleans), arrays, and plain objects.
685
+ If you need to include complex data types, consider converting them to a serializable structure before passing them to the function.
686
+ Or use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.
687
+
688
+ Suggested Fix:
689
+ 1. Remove or replace non-serializable values from your input.
690
+ 2. If using objects, ensure they do not contain any functions or circular references.
691
+ 3. Convert any class instances to plain objects or JSON-compatible formats.
692
+ 4. Use dedicated Myop message.
693
+
694
+ For more details on serialization and Myop message examples, refer to https://docs.myop.dev.
695
+
696
+ `);
697
+ }
698
+ }, Fe = class extends Ce {
699
+ constructor(e, t, s) {
700
+ super(e, t.container, s), this.componentDefinition = e, this.parent = t, a(this, "send", (n) => {
701
+ const i = n.handler, o = super.send(n);
702
+ return this.parent.send(new ot(this.id, n)), n.handler = i, o;
703
+ }), a(this, "dispose", () => {
704
+ this.isInitiated && this.send(new x("dispose")), super.dispose();
705
+ });
706
+ }
707
+ hide() {
708
+ this.send(new x("hide"));
709
+ }
710
+ show() {
711
+ this.send(new x("show"));
712
+ }
713
+ inspect() {
714
+ return this.send(new x("inspect"));
715
+ }
716
+ setHeightBasedOnDocumentElement() {
717
+ this.send(new x("setHeightBasedOnDocumentElement"));
718
+ }
719
+ setHeightBasedOnScrollHeight() {
720
+ this.send(new x("setHeightBasedOnScrollHeight"));
721
+ }
722
+ onMessageReceived(e) {
723
+ return super.onMessageReceived(e);
724
+ }
725
+ }, Ws = (e, t, s) => {
726
+ const n = document.createElement("a");
727
+ return n.textContent = e, n.style.position = "relative", n.style.padding = "0 5px", n.style.fontSize = "14px", n.style.top = "0", n.style.top = `${t}px`, n.style.transform = "translateX(-50%)", n.target = "_blank", n.href = `https://dashboard.myop.dev/dashboard/component/${s.id}`, n;
728
+ }, ft = (e, t, s, n, i, o) => {
729
+ const r = Ws(`${o.name} : ${t}`, s, o);
730
+ return n.insertBefore(r, i), i.style.border = "1px solid #007BFF", i.style.display = "block", () => {
731
+ i.style.border = "unset", n.removeChild(r);
732
+ };
733
+ }, js = (e, t) => {
734
+ const s = t.reduce((i, o) => G(g({}, i), {
735
+ [o.name]: g({}, o)
736
+ }), {}), n = {
737
+ get: (i, o) => {
738
+ const r = s[o];
739
+ return r.mode === "output" ? new Promise((c) => {
740
+ const l = [];
741
+ r.behavior.ref && l.push(U.create(r.behavior.ref)), l.push((u) => {
742
+ c(u);
743
+ }), r.behavior.params && l.push(...r.behavior.params);
744
+ const d = me[r.behavior.message];
745
+ e.send(new d(...l));
746
+ }) : null;
747
+ },
748
+ set: (i, o, r) => {
749
+ const c = s[o];
750
+ if (!c)
751
+ throw new Error(
752
+ `Error: Undefined Prop
753
+
754
+ It looks like you've tried to use a prop that hasn't been defined.
755
+ Please check the prop name for any typos or ensure that it is properly defined in the component's prop list.
756
+
757
+ Prop Name: ${o}
758
+ Component: ${e.componentDefinition.name}, ID: ${e.componentDefinition.id}
759
+
760
+ For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/${e.componentDefinition.id} or consult the developer guide.`
761
+ );
762
+ if (c.mode === "input")
763
+ if (c.behavior.type === "message") {
764
+ const l = [];
765
+ c.behavior.ref && l.push(U.create(c.behavior.ref)), l.push(r), c.behavior.params && l.push(...c.behavior.params);
766
+ const d = me[c.behavior.message];
767
+ return e.send(new d(...l)), !0;
768
+ } else
769
+ throw new Error(
770
+ `Error: Unsupported Behavior
771
+
772
+ The 'behavior' field provided is not supported.
773
+ Component: ${e.componentDefinition.name}, ID: ${e.componentDefinition.id}
774
+
775
+ Prop Name: ${o}
776
+ Behavior Field: ${c.behavior.type}
777
+
778
+ Check the documentation for valid behavior options.`
779
+ );
780
+ return !1;
781
+ }
782
+ };
783
+ return e.props = {}, e.props = new Proxy(e.props, n), e;
784
+ }, Gs = (e, t) => new Proxy(e, {
785
+ get(s, n) {
786
+ return s[n] ? s[n] : (...o) => new Promise((r) => {
787
+ o.forEach((c) => {
788
+ pt(c) || qs.notSerializableRefCall(n, c);
789
+ }), t.send(new ge(
790
+ ({ ref: c, propName: l, functionArgs: d, makeSerializable: u }) => {
791
+ if (c) {
792
+ const h = c[l];
793
+ return u(typeof h == "function" ? c[l](...d) : h, !0);
794
+ }
795
+ return null;
796
+ },
797
+ {
798
+ //TODO : turn it to config
799
+ elementId: s.refConfig.selector,
800
+ propName: n,
801
+ functionArgs: o
802
+ },
803
+ (c) => {
804
+ r(c.content);
805
+ }
806
+ ));
807
+ });
808
+ },
809
+ set(s, n, i) {
810
+ return t.send(new ge(
811
+ ({ ref: o, propName: r, propValue: c }) => {
812
+ o && (o[r] = c);
813
+ },
814
+ {
815
+ //TODO : fix that
816
+ elementId: s.refConfig.selector,
817
+ propValue: i,
818
+ propName: n
819
+ },
820
+ (o) => {
821
+ }
822
+ )), !0;
823
+ }
824
+ }), mt = (e, t, s, n) => y(void 0, null, function* () {
825
+ const i = e.component;
826
+ if (!i)
827
+ throw new Error("cant createRefComponent with detached ref");
828
+ return new Promise((o, r) => y(void 0, null, function* () {
829
+ const c = new Fe(t.type, i, n);
830
+ s.push(c), yield i.initiated();
831
+ const l = setTimeout(() => {
832
+ r("timeout");
833
+ }, 5e3);
834
+ i.send(new it(
835
+ e.refConfig,
836
+ t,
837
+ G(g({}, n || {}), {
838
+ id: c.id,
839
+ _hasParent: !0
840
+ }),
841
+ (d) => y(void 0, null, function* () {
842
+ if (clearTimeout(l), d.failed) {
843
+ r("CreateRefComponentMessage failed");
844
+ return;
845
+ }
846
+ const u = s.find((h) => h.id == c.id);
847
+ if (u !== c) {
848
+ i.refs[e.refConfig.name] = u, o(u);
849
+ return;
850
+ } else
851
+ c.setInitiated(), i.refs[e.refConfig.name] = c;
852
+ d.nestedRefs.forEach((h) => {
853
+ const m = t.instance.resolvedNestedComponents.find((B) => B.type.id === h.componentDefinitionId).type, w = new Fe(m, c);
854
+ w.setInitiated(), c.refs[h.refName] = w, s.push(w);
855
+ });
856
+ try {
857
+ yield gt(c, t, s, !0), i.setHeightBasedOnScrollHeight && i.setHeightBasedOnScrollHeight(), o(c);
858
+ } catch (h) {
859
+ r(h);
860
+ }
861
+ })
862
+ ));
863
+ }));
864
+ }), gt = (e, t, s, n = !1) => y(void 0, null, function* () {
865
+ e.refs || (e.refs = {});
866
+ const i = Object.values(e.componentDefinition.refs).map((o) => new Promise((r, c) => y(void 0, null, function* () {
867
+ var l;
868
+ if (o.behavior.type == Ie.component) {
869
+ if (n) {
870
+ r();
871
+ return;
872
+ }
873
+ let d = o.behavior.componentId;
874
+ d || (d = o.behavior.instance.componentId);
875
+ const u = (l = t.instance.resolvedNestedComponents) == null ? void 0 : l.find((m) => m.type.id === d);
876
+ if (!u)
877
+ throw new Error("componentConfig provided without nestedComponentConfig check the config object");
878
+ const h = U.create("", o, e);
879
+ try {
880
+ const m = yield mt(h, u, s);
881
+ e.refs[o.name] = m, r();
882
+ } catch (m) {
883
+ c(m);
884
+ }
885
+ } else
886
+ try {
887
+ const d = U.create("", o, e);
888
+ e.refs[o.name] = Gs(d, e), r();
889
+ } catch {
890
+ }
891
+ })));
892
+ try {
893
+ yield Promise.all(i);
894
+ } catch (o) {
895
+ throw o;
896
+ }
897
+ }), yt = class extends Ce {
898
+ constructor(e, t, s, n, i) {
899
+ super(e, s, i), this.componentConfig = e, this.container = s, this.IframeElement = n, a(this, "cleanupInspect"), a(this, "setHeightBasedOnDocumentElement", () => {
900
+ const o = this.send(new H(() => window.document.documentElement.scrollHeight, (r) => {
901
+ this.IframeElement.style.height = `${r.content}px`, o();
902
+ }));
903
+ }), a(this, "observeSizeBasedOnDocumentElement", () => {
904
+ this.send(new H(({ send: o }) => {
905
+ const { height: r, width: c } = document.documentElement.getBoundingClientRect(), l = new ResizeObserver(() => {
906
+ const { height: d, width: u } = document.documentElement.getBoundingClientRect();
907
+ o({ height: d, width: u });
908
+ });
909
+ return l.observe(document.documentElement), l.observe(document.body), { height: r, width: c };
910
+ }, (o) => {
911
+ this.IframeElement.style.width = `${o.content.width}px`, this.IframeElement.style.height = `${o.content.height}px`;
912
+ }));
913
+ }), a(this, "setSizeBasedOnDocumentElement", () => {
914
+ const o = this.send(new H(() => {
915
+ const { height: r, width: c } = document.documentElement.getBoundingClientRect();
916
+ return { height: r, width: c };
917
+ }, (r) => {
918
+ this.IframeElement.style.width = `${r.content.width}px`, this.IframeElement.style.height = `${r.content.height}px`, o();
919
+ }));
920
+ }), a(this, "setHeightBasedOnScrollHeight", () => {
921
+ const o = this.send(new H(() => {
922
+ let c = 0;
923
+ return c++, c--, Math.max(
924
+ Math.max(
925
+ window.document.body.clientHeight,
926
+ window.document.body.scrollHeight
927
+ ),
928
+ window.document.body.offsetHeight
929
+ ) + c + "px";
930
+ }, (r) => {
931
+ this.IframeElement.style.height = r.content, o();
932
+ }));
933
+ }), a(this, "send", (o) => {
934
+ var r, c;
935
+ let l = g({}, o);
936
+ if (l.messageType === f.ExecuteComponentMethod)
937
+ return this[l.method](), () => {
938
+ };
939
+ l.direction = E.down;
940
+ const d = super.send(l);
941
+ return (c = (r = this.IframeElement) == null ? void 0 : r.contentWindow) == null || c.postMessage(l, "*"), d;
942
+ }), a(this, "dispose", () => {
943
+ this.cleanupInspect && this.cleanupInspect(), super.dispose(), this.IframeElement.parentNode.removeChild(this.IframeElement);
944
+ }), t.loader.autoHeight && this.initiated().then(() => {
945
+ this.setHeightBasedOnScrollHeight();
946
+ }), this.element = this.IframeElement;
947
+ }
948
+ inspect() {
949
+ return this.cleanupInspect ? this.cleanupInspect : (this.cleanupInspect = ft(this.id, "MyopIframeComponent", 10, this.container, this.IframeElement, this.componentDefinition), () => {
950
+ this.cleanupInspect(), this.cleanupInspect = void 0;
951
+ });
952
+ }
953
+ hide() {
954
+ this.IframeElement.style.opacity = "0", this.IframeElement.style.position = "absolute", this.IframeElement.style.pointerEvents = "none", this.IframeElement.style.visibility = "hidden";
955
+ }
956
+ show() {
957
+ this.IframeElement.style.opacity = "1", this.IframeElement.style.position = "unset", this.IframeElement.style.pointerEvents = "all", this.IframeElement.style.visibility = "visible";
958
+ }
959
+ onMessageReceived(e) {
960
+ return e.messageType === f.In.MutationObserverMessage || e.messageType === f.In.ResizeObserverMessage ? (this.setHeightBasedOnScrollHeight(), !0) : super.onMessageReceived(e);
961
+ }
962
+ }, Te = class {
963
+ constructor() {
964
+ a(this, "appendChild", (e, t, s) => {
965
+ var n;
966
+ if (s != null && s.relative) {
967
+ if (s.relative.direction === "before")
968
+ return e.insertBefore(t, s.relative.child);
969
+ if (s.relative.direction === "after") {
970
+ const i = (n = s.relative.child) == null ? void 0 : n.nextSibling;
971
+ return e.insertBefore(t, i || null);
972
+ }
973
+ } else
974
+ return e.appendChild(t);
975
+ });
976
+ }
977
+ }, Js = (e, t, s) => {
978
+ const n = new URL(e);
979
+ return n.searchParams.append(t, s), n.toString();
980
+ }, Ys = class extends Te {
981
+ constructor() {
982
+ super(...arguments), a(this, "type", Se.IframeLoader), a(this, "load", (e, t, s, n) => y(this, null, function* () {
983
+ let i;
984
+ const o = t.loader;
985
+ if ((s == null ? void 0 : s.nodeName) === "IFRAME")
986
+ console.log("needs to load into an exsisting Iframe...", o.url, s), i = s, i.src = o.url;
987
+ else {
988
+ const r = A(), c = `myop-comp-${r}`;
989
+ i = document.createElement("iframe"), s.querySelector('[id^="myop-comp-"]') || (s.innerHTML = ""), n != null && n.hidden && (i.style.visibility = "hidden"), i = this.appendChild(s, i, n);
990
+ let l = t.loader.url;
991
+ n != null && n._hasParent && (l = Js(l, "_myop-comp", r));
992
+ let d = "";
993
+ n != null && n.elementAttributes && (d = Object.entries(n == null ? void 0 : n.elementAttributes).map(([u, h]) => h === "" || h === null || h === void 0 ? u : `${u}="${String(h)}"`).join(" ")), i.outerHTML = `<iframe
994
+ id="${c}"
995
+ style="
996
+ padding: 0;
997
+ margin: 0;
998
+ height: ${o.autoHeight || !o.height ? "" : o.height};
999
+ width : 100%;
1000
+ overflow: hidden;
1001
+ border: none;
1002
+ opacity: ${n != null && n.hidden ? "0" : "1"};
1003
+ position: ${n != null && n.hidden ? "absolute" : "static"};
1004
+ pointer-events: ${n != null && n.hidden ? "none" : "all"};
1005
+ "
1006
+ src="${l}"
1007
+ ${d}
1008
+ ></iframe>`, i = s.querySelector(`#${c}`);
1009
+ }
1010
+ return new yt(e, t, s, i, n);
1011
+ }));
1012
+ }
1013
+ }, vt = {
1014
+ webcomponent_message_key: "myop_webcomponent_message"
1015
+ }, wt = class extends Ce {
1016
+ constructor(e, t, s, n, i) {
1017
+ super(e, s, i), this.container = s, this.customElement = n, a(this, "cleanupInspect", () => {
1018
+ }), a(this, "send", (o) => {
1019
+ let r = g({}, o);
1020
+ const c = super.send(r), l = new CustomEvent(vt.webcomponent_message_key, {
1021
+ // @ts-ignore
1022
+ detail: r
1023
+ // bubbles: true,
1024
+ // cancelable: false,
1025
+ // composed: true
1026
+ });
1027
+ try {
1028
+ this.customElement.dispatchEvent(l);
1029
+ } catch (d) {
1030
+ console.log("error while trying to dispatchEvent", d);
1031
+ }
1032
+ return c;
1033
+ }), a(this, "dispose", () => {
1034
+ var o;
1035
+ super.dispose(), (o = this.customElement.parentNode) == null || o.removeChild(this.customElement);
1036
+ }), this.element = n;
1037
+ }
1038
+ inspect() {
1039
+ return this.cleanupInspect = ft(this.id, "MyopWebComponent", 0, this.container, this.customElement, this.componentDefinition), this.cleanupInspect;
1040
+ }
1041
+ hide() {
1042
+ this.customElement.style.opacity = "0", this.customElement.style.position = "absolute", this.customElement.style.pointerEvents = "none", this.customElement.style.visibility = "hidden", this.customElement.style.height = "0", this.customElement.style.width = "0";
1043
+ }
1044
+ show() {
1045
+ this.customElement.style.opacity = "1", this.customElement.style.position = "unset", this.customElement.style.pointerEvents = "all", this.customElement.style.visibility = "visible", this.customElement.style.height = "", this.customElement.style.width = "";
1046
+ }
1047
+ }, le = {}, Xs = class extends Te {
1048
+ constructor() {
1049
+ super(...arguments), a(this, "type", Se.WebComponentLoader), a(this, "load", (e, t, s, n) => y(this, null, function* () {
1050
+ const i = t.loader;
1051
+ le[i.url] ? console.log("Module alreday loaded or in loading process") : le[i.url] = new Promise((c, l) => {
1052
+ const d = i.url, u = document.createElement("script");
1053
+ u.type = "module", u.src = d, u.onload = () => {
1054
+ c();
1055
+ }, u.onerror = () => {
1056
+ l();
1057
+ }, document.head.appendChild(u);
1058
+ }), yield le[i.url], yield ws(1);
1059
+ let o = `myop-comp-${A()}`;
1060
+ const r = document.createElement(i.tag);
1061
+ return s.querySelector('[id^="myop-comp-"]') || (s.innerHTML = ""), r.id = o, n != null && n.hidden && (r.style.opacity = "0", r.style.position = "absolute", r.style.height = "0", r.style.width = "0", r.style.pointerEvents = "none", r.style.visibility = "hidden"), n != null && n._environment && (r._myopEnvironment = n == null ? void 0 : n._environment), this.appendChild(s, r, n), new wt(e, t, s, r, n);
1062
+ }));
1063
+ }
1064
+ }, Qs = "0.1.36", T = class extends As {
1065
+ constructor(e, t) {
1066
+ super(e), this.context = t, a(this, "executor", (s) => {
1067
+ if (s.destination) {
1068
+ const n = s.destination;
1069
+ if (this.context[n].context) {
1070
+ const i = (o, r) => {
1071
+ this.messageToHost(G(g({}, o), {
1072
+ source: s.destination ? s.destination : s.source,
1073
+ destination: s.source ? s.source : s.destination
1074
+ }), r);
1075
+ };
1076
+ return this.innerExecutor(s, this.context[n].context, i);
1077
+ } else
1078
+ debugger;
1079
+ } else
1080
+ debugger;
1081
+ });
1082
+ }
1083
+ }, q = {
1084
+ id: "myop-id"
1085
+ }, V = (e, t) => t.querySelectorAll(`[${q.id}='${e.refConfig.selector}']`), Zs = class extends T {
1086
+ constructor() {
1087
+ super(...arguments), a(this, "messageType", f.BindClickMessage), a(this, "innerExecutor", (e, t, s) => {
1088
+ const n = V(e.ref, t.shadowRoot), i = [];
1089
+ return n.forEach((o) => {
1090
+ const r = () => {
1091
+ s(new je(e.handlerUniqueId));
1092
+ };
1093
+ o.addEventListener("click", r), i.push(() => {
1094
+ o.removeEventListener("click", r);
1095
+ });
1096
+ }), () => {
1097
+ i.forEach((o) => o());
1098
+ };
1099
+ });
1100
+ }
1101
+ }, en = class extends T {
1102
+ constructor() {
1103
+ super(...arguments), a(this, "messageType", f.ChangeTextMessage), a(this, "innerExecutor", (e, t) => {
1104
+ V(e.ref, t.shadowRoot).forEach((n) => {
1105
+ n.textContent = e.content;
1106
+ });
1107
+ });
1108
+ }
1109
+ }, tn = class extends zs {
1110
+ constructor(e, t) {
1111
+ super(e, t), this.container = e, this.shadowRoot = t;
1112
+ }
1113
+ }, sn = class extends T {
1114
+ constructor() {
1115
+ super(...arguments), a(this, "innerExecutor", (e, t) => {
1116
+ const s = t.shadowRoot.querySelectorAll(`[${q.id}]`);
1117
+ let n = [];
1118
+ s.forEach((i) => {
1119
+ const o = i.getAttribute(q.id);
1120
+ o && n.push(new Ps(o, i.tagName, i.getBoundingClientRect(), i.offsetTop, i.offsetLeft));
1121
+ }), this.messageToHost(new at(e.handlerUniqueId, n));
1122
+ }), a(this, "messageType", f.DetectMyopRefsMessage);
1123
+ }
1124
+ }, nn = class extends T {
1125
+ constructor() {
1126
+ super(...arguments), a(this, "messageType", f.SetAttributeMessage), a(this, "innerExecutor", (e, t) => {
1127
+ V(e.ref, t.shadowRoot).forEach((n) => {
1128
+ n.setAttribute(e.name, e.value);
1129
+ });
1130
+ });
1131
+ }
1132
+ }, on = class extends T {
1133
+ constructor() {
1134
+ super(...arguments), a(this, "messageType", f.AddEventListenerMessage), a(this, "innerExecutor", (e, t, s) => {
1135
+ const n = V(e.ref, t.shadowRoot), i = [];
1136
+ return n.forEach((o) => {
1137
+ const r = (c) => {
1138
+ s(new Qe(e.handlerUniqueId, L(c, e.serializableSkeleton)));
1139
+ };
1140
+ o.addEventListener(e.type, r), i.push(() => {
1141
+ o.removeEventListener(e.type, r);
1142
+ });
1143
+ }), () => {
1144
+ i.forEach((o) => o());
1145
+ };
1146
+ });
1147
+ }
1148
+ }, rn = class extends T {
1149
+ constructor() {
1150
+ super(...arguments), a(this, "messageType", f.CreateRefComponentMessage), a(this, "innerExecutor", (e, t, s) => {
1151
+ y(this, null, function* () {
1152
+ const i = t.shadowRoot.querySelectorAll(`[${q.id}='${e.refConfig.selector}']`);
1153
+ if (i.length === 1) {
1154
+ const o = ie.Instance(), r = o.components.find((u) => u.id === e.options.id);
1155
+ r && r.dispose();
1156
+ const c = o.components.indexOf(r);
1157
+ c !== -1 && o.components.splice(c, 1);
1158
+ const l = yield o.loadComponent(
1159
+ e.nestedComponentConfig,
1160
+ i.item(0),
1161
+ e.options
1162
+ ), d = [];
1163
+ Object.keys(l.refs).forEach((u) => {
1164
+ let h = l.refs[u];
1165
+ h = h.__nonProxied || h, h.componentDefinition && d.push({
1166
+ refName: u,
1167
+ componentDefinitionId: h.componentDefinition.id
1168
+ });
1169
+ }), s(new ye(e.handlerUniqueId, d));
1170
+ } else {
1171
+ console.error("CreateRefComponentMessageHandler - DOM element not found"), this.messageToHost(new ye(e.handlerUniqueId, [], !0));
1172
+ debugger;
1173
+ }
1174
+ }).then();
1175
+ });
1176
+ }
1177
+ }, an = (e, t, s) => {
1178
+ const n = e.scriptInputs ? e.scriptInputs : {};
1179
+ n.makeSerializable = L, n.send = t, n.rootRef = s, n.__scriptInputs = n;
1180
+ const o = new Function(`return (${e.script})(...arguments)`)(n);
1181
+ t(o);
1182
+ }, cn = class extends T {
1183
+ constructor() {
1184
+ super(...arguments), a(this, "messageType", f.ExecuteScriptMessage), a(this, "innerExecutor", (e, t, s) => {
1185
+ an(e, (i) => {
1186
+ s(new Ye(e.handlerUniqueId, i));
1187
+ }, t);
1188
+ });
1189
+ }
1190
+ }, Mt = (e) => {
1191
+ if (!e) return null;
1192
+ if (e.tagName === "FORM") {
1193
+ new FormData(e);
1194
+ const t = {
1195
+ formData: {},
1196
+ unmappedData: []
1197
+ };
1198
+ return e.querySelectorAll("input, select, textarea").forEach((n) => {
1199
+ if (typeof n.value == "string") {
1200
+ const i = n.getAttribute(q.id);
1201
+ let o = n.getAttribute("name");
1202
+ const r = {
1203
+ id: n.id,
1204
+ name: o,
1205
+ value: Mt(n),
1206
+ required: n.required,
1207
+ validity: L(n.validity, !0),
1208
+ myopId: i
1209
+ };
1210
+ o ? t.formData[o] ? t.formData[o].value ? t.unmappedData.push(r) : (t.unmappedData.push(t.formData[o]), t.formData[o] = r) : t.formData[o] = r : t.unmappedData.push(r);
1211
+ }
1212
+ }), t;
1213
+ }
1214
+ return e.type === "checkbox" || e.type === "radio" ? e.checked ? e.value : null : e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.tagName === "SELECT" ? e.value : e.isContentEditable ? e.innerText || e.textContent : null;
1215
+ }, ln = class extends T {
1216
+ constructor() {
1217
+ super(...arguments), a(this, "messageType", f.GetElementValueMessage), a(this, "innerExecutor", (e, t, s) => {
1218
+ V(e.ref, t.shadowRoot).forEach((i) => {
1219
+ s(new et(Mt(i)), e);
1220
+ });
1221
+ });
1222
+ }
1223
+ }, dn = class extends T {
1224
+ constructor() {
1225
+ super(...arguments), a(this, "messageType", f.SetInnerHtml), a(this, "innerExecutor", (e, t) => {
1226
+ V(e.ref, t.shadowRoot).forEach((n) => {
1227
+ n.innerHTML = e.content;
1228
+ });
1229
+ });
1230
+ }
1231
+ }, _t = class extends Bs {
1232
+ constructor() {
1233
+ super(...arguments), a(this, "alwaysPassEnvelopesToHost", !0), a(this, "connectedCallback", (e, t) => {
1234
+ e.addEventListener(vt.webcomponent_message_key, (s) => {
1235
+ const n = s.data ? s.data : s.detail;
1236
+ if (!n || !n.myop) {
1237
+ debugger;
1238
+ throw new Error("recvied webcomponent_message with wrong type");
1239
+ } else {
1240
+ const i = n;
1241
+ if (this.handleIncomeMessages(s), i.messageType === f.InitMessage) {
1242
+ const o = i.content.id;
1243
+ this.components[o].context = new tn(e, t);
1244
+ }
1245
+ }
1246
+ }), setTimeout(() => {
1247
+ this.messageToHost(new st());
1248
+ }, 1);
1249
+ }), a(this, "messageToHost", (e, t) => {
1250
+ e.direction = E.up, !e.replayToHandler && (t != null && t.handlerUniqueId) && (e.replayToHandler = t.handlerUniqueId), window.myop.hostSDK.send(e);
1251
+ }), a(this, "supportedHandlers", [
1252
+ new en(this.messageToHost, this.components),
1253
+ new dn(this.messageToHost, this.components),
1254
+ new Zs(this.messageToHost, this.components),
1255
+ new sn(this.messageToHost, this.components),
1256
+ new nn(this.messageToHost, this.components),
1257
+ new on(this.messageToHost, this.components),
1258
+ new cn(this.messageToHost, this.components),
1259
+ new ln(this.messageToHost, this.components),
1260
+ //
1261
+ new rn(this.messageToHost, this.components)
1262
+ ]), a(this, "init", () => {
1263
+ });
1264
+ }
1265
+ };
1266
+ Ue("WebComponentSDK", _t);
1267
+ var Ae = [], Y, Et = () => y(void 0, null, function* () {
1268
+ return Y || (Y = new _t(), Y.init()), Y;
1269
+ });
1270
+ function un(e, t) {
1271
+ return class extends HTMLElement {
1272
+ connectedCallback() {
1273
+ const s = t === ve.open ? "open" : "closed", n = this.attachShadow({ mode: s });
1274
+ Et().then((i) => {
1275
+ i.connectedCallback(this, n), n.innerHTML = e;
1276
+ });
1277
+ }
1278
+ };
1279
+ }
1280
+ var hn = (e, t, s) => {
1281
+ customElements.define(e, un(t, s)), console.log(`define('${e}') was called, web component ready to use`);
1282
+ }, pn = (e) => e.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/(\d+)/g, "-$1").toLowerCase(), fn = (e) => (e = pn(e), e.replace(/_/g, "-")), mn = class extends Te {
1283
+ constructor() {
1284
+ super(...arguments), a(this, "type", Se.HTMLLoader), a(this, "load", (e, t, s, n) => y(this, null, function* () {
1285
+ const i = t.loader;
1286
+ let o = `myop-comp-${A()}`, r;
1287
+ if (i.shadowRootMode === ve.localFrame) {
1288
+ const l = `myop-comp-${A()}`;
1289
+ let d = document.createElement("iframe");
1290
+ s.querySelector('[id^="myop-comp-"]') || (s.innerHTML = ""), n != null && n.hidden && (d.style.visibility = "hidden"), d = this.appendChild(s, d, n), d.id = l, d.setAttribute("style", `
1291
+ padding: 0;
1292
+ margin: 0;
1293
+ overflow: hidden;
1294
+ border: none;
1295
+ opacity: ${n != null && n.hidden ? "0" : "1"};
1296
+ width: 100%;
1297
+ height: 100%;
1298
+ position: ${n != null && n.hidden ? "absolute" : "static"};
1299
+ pointer-events: ${n != null && n.hidden ? "none" : "all"};
1300
+ `), s.appendChild(d);
1301
+ const u = d.contentDocument || d.contentWindow.document;
1302
+ u.open(), u.writeln(i.HTML), u.writeln(`<script src="${window.myop.__ROOT_SDK_PUBLIC_URL__}"><\/script>
1303
+ <script>
1304
+ window.__federation__ =
1305
+ { ...window.__federation__,
1306
+ //TODO : get from ENV at build time,
1307
+ // inject value to module at build time
1308
+ // today we doing so just for the CJS version
1309
+ __public_path__ :'https://cdn.myop.dev/sdk/next',
1310
+ ...${JSON.stringify(
1311
+ // @ts-ignore
1312
+ window.__federation__
1313
+ )}};
1314
+ const init = async () => {
1315
+ const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());
1316
+ const sdk = new IframeSDK()
1317
+ sdk.init();
1318
+ }
1319
+ init().then();
1320
+ <\/script>`), u.close();
1321
+ const h = new yt(e, t, s, d, n);
1322
+ return d.onload = () => {
1323
+ h.observeSizeBasedOnDocumentElement();
1324
+ }, h;
1325
+ }
1326
+ if (i.shadowRootMode === ve.none) {
1327
+ const c = document.createElement("template");
1328
+ c.innerHTML = i.HTML, r = c.content.firstElementChild, Et().then((l) => {
1329
+ l.connectedCallback(r, r);
1330
+ });
1331
+ } else {
1332
+ const c = fn(e.name + t.id);
1333
+ Ae.includes(c) || (hn(c, i.HTML, i.shadowRootMode), Ae.push(c)), r = document.createElement(c);
1334
+ }
1335
+ return s.querySelector('[id^="myop-comp-"]') || (s.innerHTML = ""), r.id = o, n != null && n.hidden && (r.style.opacity = "0", r.style.position = "absolute", r.style.height = "0", r.style.width = "0", r.style.pointerEvents = "none", r.style.visibility = "hidden"), this.appendChild(s, r, n), new wt(e, t, s, r, n);
1336
+ }));
1337
+ }
1338
+ }, bt = "https://cdn.myop.dev/sdk/next/myop_sdk.min.js", ie = class {
1339
+ constructor() {
1340
+ a(this, "components2init", []), a(this, "components", []), a(this, "componentsLoaders", []), a(this, "initiated", !1), a(this, "version", Qs), a(this, "type2InstanceCount", {}), a(this, "assignId", (e) => (this.type2InstanceCount[e.id] || (this.type2InstanceCount[e.id] = 0), `${e.id}_${++this.type2InstanceCount[e.id]}`)), a(this, "inspected", !1), a(this, "inspect", () => {
1341
+ this.inspected || (this.inspected = !0, this.components.forEach((e) => {
1342
+ e.inspect && e.inspect();
1343
+ }));
1344
+ }), a(this, "incomingMessageHandler", (e) => {
1345
+ if (e.origin, document.location.origin, e.data.myop) {
1346
+ if (e.data.direction !== E.up && e.data.messageType !== f.EnvelopedMessage)
1347
+ return;
1348
+ const t = e.data;
1349
+ if (t.messageType === f.InitRequest) {
1350
+ this.components2init.forEach((n) => {
1351
+ n.send(new be(n.id));
1352
+ });
1353
+ return;
1354
+ }
1355
+ if (t.messageType === f.InitResponse) {
1356
+ this.components2init = this.components2init.filter((i) => i.id !== t.content.id);
1357
+ const n = this.components.find((i) => {
1358
+ var o;
1359
+ return i.id === ((o = t.content) == null ? void 0 : o.id);
1360
+ });
1361
+ n == null || n.setInitiated();
1362
+ return;
1363
+ }
1364
+ if (t.messageType === f.EnvelopedMessage) {
1365
+ const n = t, i = this.components.find((o) => o.id === n.destination);
1366
+ if (i) {
1367
+ if (n.direction === E.down) {
1368
+ n.message.messageType === x.name ? i.onMessageReceived(n.message) : (n.message.route = n.route, i.send(n.message));
1369
+ return;
1370
+ }
1371
+ } else {
1372
+ const o = this.components.find((r) => r.id === n.message.destination);
1373
+ o && o.send(n.message);
1374
+ }
1375
+ return;
1376
+ }
1377
+ const s = this.components.find((n) => n.id === t.destination);
1378
+ if (!s) {
1379
+ window.myop.IframeSDK && window.myop.IframeSDK.messageToHost(t);
1380
+ return;
1381
+ }
1382
+ if (s) {
1383
+ if (s.onMessageReceived(t))
1384
+ return;
1385
+ window.myop.IframeSDK && window.myop.IframeSDK.messageToHost(t);
1386
+ }
1387
+ }
1388
+ }), a(this, "send", (e) => {
1389
+ const t = new MessageEvent(
1390
+ "",
1391
+ { data: e }
1392
+ );
1393
+ this.incomingMessageHandler(t);
1394
+ }), a(this, "init", (e) => {
1395
+ if (this.initiated)
1396
+ throw new Error("hostSDK already initiated");
1397
+ const t = [
1398
+ new Ys(),
1399
+ new Xs(),
1400
+ new mn()
1401
+ ];
1402
+ if (this.componentsLoaders = [
1403
+ ...t
1404
+ ], e) {
1405
+ const s = {};
1406
+ e.forEach((n) => {
1407
+ const i = new n(this.componentsLoaders);
1408
+ s[i.type] = i;
1409
+ }), this.componentsLoaders.forEach((n) => {
1410
+ s[n.type] || (s[n.type] = n);
1411
+ }), this.componentsLoaders = Object.values(s);
1412
+ }
1413
+ window.addEventListener(
1414
+ "message",
1415
+ this.incomingMessageHandler,
1416
+ !1
1417
+ ), console.log("myop hostSDK initiated", document.location.href), this.initiated = !0;
1418
+ }), a(this, "_getSkinIdBySkinSelector", (e, ...t) => y(this, [e, ...t], function* (s, n = [], i) {
1419
+ var o;
1420
+ function r(c, l) {
1421
+ return y(this, null, function* () {
1422
+ for (const d of c)
1423
+ if (yield l(d))
1424
+ return d;
1425
+ });
1426
+ }
1427
+ switch (s.type) {
1428
+ case "DedicatedSkin":
1429
+ case ce.Dedicated:
1430
+ return ((o = s.skin) == null ? void 0 : o.id) || s.skins[0].id;
1431
+ case ce.Segmented:
1432
+ {
1433
+ const l = yield r(s.segments, (d) => y(this, null, function* () {
1434
+ if (d.segmentId === "Default")
1435
+ return !0;
1436
+ const u = n.find((B) => B.type === Ks.Segment ? B.segment.id === d.segmentId : !1);
1437
+ if (!u)
1438
+ throw new Error("experience not found");
1439
+ const m = u.segment, w = (i || {})[m.function];
1440
+ return w ? yield w() : (console.warn(`segmentId:${d.segmentId}, ${m.function} function not provided !`), !1);
1441
+ }));
1442
+ if (l)
1443
+ return this._getSkinIdBySkinSelector(l.skinSelector, n);
1444
+ debugger;
1445
+ }
1446
+ break;
1447
+ default:
1448
+ debugger;
1449
+ }
1450
+ return "";
1451
+ })), a(this, "runSkinSelector", (e, t) => y(this, null, function* () {
1452
+ const s = yield this._getSkinIdBySkinSelector(e.instance.skinSelector, e.instance.resolvedExperiences, t);
1453
+ return e.type.skins.find((n) => n.id === s);
1454
+ })), a(this, "loaderHooks"), a(this, "loadComponent", (e, t, s) => y(this, null, function* () {
1455
+ var n, i, o, r;
1456
+ if (!t) {
1457
+ debugger;
1458
+ throw new Error("no container was found for this component");
1459
+ }
1460
+ const c = t;
1461
+ if (c.myop)
1462
+ if (c.component) {
1463
+ e = g({}, e), e.instance = g({}, e.instance);
1464
+ const h = g(g({}, (n = this.loaderHooks) != null ? n : {}), (i = s == null ? void 0 : s.hooks) != null ? i : {});
1465
+ let m = yield this.runSkinSelector(e, h);
1466
+ if (!m)
1467
+ throw new Error("runSkinSelector failed to choose skin, check the provided config");
1468
+ return (o = s == null ? void 0 : s.hooks) != null && o.afterSkinSelected && (m = yield s.hooks.afterSkinSelected(g({}, m))), e.instance.skinSelector = {
1469
+ type: ce.Dedicated,
1470
+ skin: m
1471
+ // skins: [selectedSkin]
1472
+ }, s && (s = g({}, s), delete s.hooks), yield mt(c, e, this.components, s);
1473
+ } else
1474
+ throw new Error("load component got a detached ref.");
1475
+ t = t;
1476
+ let l = yield this.runSkinSelector(e, s == null ? void 0 : s.hooks);
1477
+ if (!l)
1478
+ throw new Error("runSkinSelector failed to choose skin, check the provided config");
1479
+ (r = s == null ? void 0 : s.hooks) != null && r.afterSkinSelected && (l = yield s.hooks.afterSkinSelected(g({}, l)));
1480
+ const d = this.componentsLoaders.find((h) => h.type === l.loader.type);
1481
+ if (!d) {
1482
+ debugger;
1483
+ throw new Error(`no loader "${l.loader.type}" was found for component`);
1484
+ }
1485
+ let u = yield d.load(e.type, l, t, s);
1486
+ u.isInitiated || this.components2init.push(u), u.bind("onDispose", () => (this.components = this.components.filter((h) => h !== u), this.components2init = this.components2init.filter((h) => h !== u), !0)), this.components.push(u), s != null && s.connectProps && (u = js(u, e.type.props));
1487
+ try {
1488
+ yield gt(u, e, this.components);
1489
+ } catch (h) {
1490
+ throw h;
1491
+ }
1492
+ return s != null && s.skipInit || (yield u.initiated()), u;
1493
+ })), a(this, "navigate", (e, t, s) => y(this, null, function* () {
1494
+ if (e.parent)
1495
+ throw new Error("Navigating on remote ref components is not implemented yet");
1496
+ if (s != null && s.staged) {
1497
+ let n = yield this.loadComponent(t, e.container, g({
1498
+ hidden: !0,
1499
+ relative: { direction: "after", child: e.element }
1500
+ }, s));
1501
+ return s.init && (yield s.init(n)), n.show(), e.dispose(), n;
1502
+ } else {
1503
+ const n = e.element.nextSibling;
1504
+ return e.dispose(), this.loadComponent(t, e.container, g({
1505
+ relative: {
1506
+ direction: "before",
1507
+ child: n
1508
+ }
1509
+ }, s));
1510
+ }
1511
+ }));
1512
+ }
1513
+ };
1514
+ a(ie, "Instance", () => window.myop.hostSDK);
1515
+ window.myop || (window.myop = {
1516
+ __ROOT_SDK_PUBLIC_URL__: bt
1517
+ });
1518
+ if (!window.myop.hostSDK) {
1519
+ const e = new ie();
1520
+ e.init(), window.myop || (window.myop = {
1521
+ __ROOT_SDK_PUBLIC_URL__: bt
1522
+ }), window.myop.hostSDK = e;
1523
+ }
1524
+ var Ct = window.myop.hostSDK;
1525
+ Ue("hostSDK", Ct);
1526
+ /**
1527
+ * @vue/shared v3.5.17
1528
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
1529
+ * @license MIT
1530
+ **/
1531
+ const gn = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
1532
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
1533
+ const St = () => {
1534
+ }, yn = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // uppercase letter
1535
+ (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), xe = Object.assign, b = Array.isArray, _ = (e) => typeof e == "function", D = (e) => typeof e == "string", vn = (e) => typeof e == "symbol", W = (e) => e !== null && typeof e == "object", wn = (e) => (W(e) || _(e)) && _(e.then) && _(e.catch), It = (e) => {
1536
+ const t = /* @__PURE__ */ Object.create(null);
1537
+ return (s) => t[s] || (t[s] = e(s));
1538
+ }, Mn = It((e) => e.charAt(0).toUpperCase() + e.slice(1)), _n = It(
1539
+ (e) => e ? `on${Mn(e)}` : ""
1540
+ );
1541
+ let Ve;
1542
+ const oe = () => Ve || (Ve = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
1543
+ function Re(e) {
1544
+ if (b(e)) {
1545
+ const t = {};
1546
+ for (let s = 0; s < e.length; s++) {
1547
+ const n = e[s], i = D(n) ? Sn(n) : Re(n);
1548
+ if (i)
1549
+ for (const o in i)
1550
+ t[o] = i[o];
1551
+ }
1552
+ return t;
1553
+ } else if (D(e) || W(e))
1554
+ return e;
1555
+ }
1556
+ const En = /;(?![^(]*\))/g, bn = /:([^]+)/, Cn = /\/\*[^]*?\*\//g;
1557
+ function Sn(e) {
1558
+ const t = {};
1559
+ return e.replace(Cn, "").split(En).forEach((s) => {
1560
+ if (s) {
1561
+ const n = s.split(bn);
1562
+ n.length > 1 && (t[n[0].trim()] = n[1].trim());
1563
+ }
1564
+ }), t;
1565
+ }
1566
+ function He(e) {
1567
+ let t = "";
1568
+ if (D(e))
1569
+ t = e;
1570
+ else if (b(e))
1571
+ for (let s = 0; s < e.length; s++) {
1572
+ const n = He(e[s]);
1573
+ n && (t += n + " ");
1574
+ }
1575
+ else if (W(e))
1576
+ for (const s in e)
1577
+ e[s] && (t += s + " ");
1578
+ return t.trim();
1579
+ }
1580
+ /**
1581
+ * @vue/reactivity v3.5.17
1582
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
1583
+ * @license MIT
1584
+ **/
1585
+ Symbol(
1586
+ process.env.NODE_ENV !== "production" ? "Object iterate" : ""
1587
+ );
1588
+ Symbol(
1589
+ process.env.NODE_ENV !== "production" ? "Map keys iterate" : ""
1590
+ );
1591
+ Symbol(
1592
+ process.env.NODE_ENV !== "production" ? "Array iterate" : ""
1593
+ );
1594
+ new Set(
1595
+ /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(vn)
1596
+ );
1597
+ function Me(e) {
1598
+ return e ? !!e.__v_raw : !1;
1599
+ }
1600
+ function Z(e) {
1601
+ const t = e && e.__v_raw;
1602
+ return t ? Z(t) : e;
1603
+ }
1604
+ function Tt(e) {
1605
+ return e ? e.__v_isRef === !0 : !1;
1606
+ }
1607
+ /**
1608
+ * @vue/runtime-core v3.5.17
1609
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
1610
+ * @license MIT
1611
+ **/
1612
+ const N = [];
1613
+ function In(e) {
1614
+ N.push(e);
1615
+ }
1616
+ function Tn() {
1617
+ N.pop();
1618
+ }
1619
+ let de = !1;
1620
+ function O(e, ...t) {
1621
+ if (de) return;
1622
+ de = !0;
1623
+ const s = N.length ? N[N.length - 1].component : null, n = s && s.appContext.config.warnHandler, i = xn();
1624
+ if (n)
1625
+ re(
1626
+ n,
1627
+ s,
1628
+ 11,
1629
+ [
1630
+ // eslint-disable-next-line no-restricted-syntax
1631
+ e + t.map((o) => {
1632
+ var r, c;
1633
+ return (c = (r = o.toString) == null ? void 0 : r.call(o)) != null ? c : JSON.stringify(o);
1634
+ }).join(""),
1635
+ s && s.proxy,
1636
+ i.map(
1637
+ ({ vnode: o }) => `at <${Kt(s, o.type)}>`
1638
+ ).join(`
1639
+ `),
1640
+ i
1641
+ ]
1642
+ );
1643
+ else {
1644
+ const o = [`[Vue warn]: ${e}`, ...t];
1645
+ i.length && o.push(`
1646
+ `, ...Rn(i)), console.warn(...o);
1647
+ }
1648
+ de = !1;
1649
+ }
1650
+ function xn() {
1651
+ let e = N[N.length - 1];
1652
+ if (!e)
1653
+ return [];
1654
+ const t = [];
1655
+ for (; e; ) {
1656
+ const s = t[0];
1657
+ s && s.vnode === e ? s.recurseCount++ : t.push({
1658
+ vnode: e,
1659
+ recurseCount: 0
1660
+ });
1661
+ const n = e.component && e.component.parent;
1662
+ e = n && n.vnode;
1663
+ }
1664
+ return t;
1665
+ }
1666
+ function Rn(e) {
1667
+ const t = [];
1668
+ return e.forEach((s, n) => {
1669
+ t.push(...n === 0 ? [] : [`
1670
+ `], ...Hn(s));
1671
+ }), t;
1672
+ }
1673
+ function Hn({ vnode: e, recurseCount: t }) {
1674
+ const s = t > 0 ? `... (${t} recursive calls)` : "", n = e.component ? e.component.parent == null : !1, i = ` at <${Kt(
1675
+ e.component,
1676
+ e.type,
1677
+ n
1678
+ )}`, o = ">" + s;
1679
+ return e.props ? [i, ...kn(e.props), o] : [i + o];
1680
+ }
1681
+ function kn(e) {
1682
+ const t = [], s = Object.keys(e);
1683
+ return s.slice(0, 3).forEach((n) => {
1684
+ t.push(...xt(n, e[n]));
1685
+ }), s.length > 3 && t.push(" ..."), t;
1686
+ }
1687
+ function xt(e, t, s) {
1688
+ return D(t) ? (t = JSON.stringify(t), s ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? s ? t : [`${e}=${t}`] : Tt(t) ? (t = xt(e, Z(t.value), !0), s ? t : [`${e}=Ref<`, t, ">"]) : _(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = Z(t), s ? t : [`${e}=`, t]);
1689
+ }
1690
+ const ke = {
1691
+ sp: "serverPrefetch hook",
1692
+ bc: "beforeCreate hook",
1693
+ c: "created hook",
1694
+ bm: "beforeMount hook",
1695
+ m: "mounted hook",
1696
+ bu: "beforeUpdate hook",
1697
+ u: "updated",
1698
+ bum: "beforeUnmount hook",
1699
+ um: "unmounted hook",
1700
+ a: "activated hook",
1701
+ da: "deactivated hook",
1702
+ ec: "errorCaptured hook",
1703
+ rtc: "renderTracked hook",
1704
+ rtg: "renderTriggered hook",
1705
+ 0: "setup function",
1706
+ 1: "render function",
1707
+ 2: "watcher getter",
1708
+ 3: "watcher callback",
1709
+ 4: "watcher cleanup function",
1710
+ 5: "native event handler",
1711
+ 6: "component event handler",
1712
+ 7: "vnode hook",
1713
+ 8: "directive hook",
1714
+ 9: "transition hook",
1715
+ 10: "app errorHandler",
1716
+ 11: "app warnHandler",
1717
+ 12: "ref function",
1718
+ 13: "async component loader",
1719
+ 14: "scheduler flush",
1720
+ 15: "component update",
1721
+ 16: "app unmount cleanup function"
1722
+ };
1723
+ function re(e, t, s, n) {
1724
+ try {
1725
+ return n ? e(...n) : e();
1726
+ } catch (i) {
1727
+ De(i, t, s);
1728
+ }
1729
+ }
1730
+ function Rt(e, t, s, n) {
1731
+ if (_(e)) {
1732
+ const i = re(e, t, s, n);
1733
+ return i && wn(i) && i.catch((o) => {
1734
+ De(o, t, s);
1735
+ }), i;
1736
+ }
1737
+ if (b(e)) {
1738
+ const i = [];
1739
+ for (let o = 0; o < e.length; o++)
1740
+ i.push(Rt(e[o], t, s, n));
1741
+ return i;
1742
+ } else process.env.NODE_ENV !== "production" && O(
1743
+ `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`
1744
+ );
1745
+ }
1746
+ function De(e, t, s, n = !0) {
1747
+ const i = t ? t.vnode : null, { errorHandler: o, throwUnhandledErrorInProduction: r } = t && t.appContext.config || gn;
1748
+ if (t) {
1749
+ let c = t.parent;
1750
+ const l = t.proxy, d = process.env.NODE_ENV !== "production" ? ke[s] : `https://vuejs.org/error-reference/#runtime-${s}`;
1751
+ for (; c; ) {
1752
+ const u = c.ec;
1753
+ if (u) {
1754
+ for (let h = 0; h < u.length; h++)
1755
+ if (u[h](e, l, d) === !1)
1756
+ return;
1757
+ }
1758
+ c = c.parent;
1759
+ }
1760
+ if (o) {
1761
+ re(o, null, 10, [
1762
+ e,
1763
+ l,
1764
+ d
1765
+ ]);
1766
+ return;
1767
+ }
1768
+ }
1769
+ Dn(e, s, i, n, r);
1770
+ }
1771
+ function Dn(e, t, s, n = !0, i = !1) {
1772
+ if (process.env.NODE_ENV !== "production") {
1773
+ const o = ke[t];
1774
+ if (s && In(s), O(`Unhandled error${o ? ` during execution of ${o}` : ""}`), s && Tn(), n)
1775
+ throw e;
1776
+ console.error(e);
1777
+ } else {
1778
+ if (i)
1779
+ throw e;
1780
+ console.error(e);
1781
+ }
1782
+ }
1783
+ const M = [];
1784
+ let C = -1;
1785
+ const F = [];
1786
+ let R = null, $ = 0;
1787
+ const On = /* @__PURE__ */ Promise.resolve();
1788
+ let _e = null;
1789
+ const Nn = 100;
1790
+ function $n(e) {
1791
+ let t = C + 1, s = M.length;
1792
+ for (; t < s; ) {
1793
+ const n = t + s >>> 1, i = M[n], o = j(i);
1794
+ o < e || o === e && i.flags & 2 ? t = n + 1 : s = n;
1795
+ }
1796
+ return t;
1797
+ }
1798
+ function Pn(e) {
1799
+ if (!(e.flags & 1)) {
1800
+ const t = j(e), s = M[M.length - 1];
1801
+ !s || // fast path when the job id is larger than the tail
1802
+ !(e.flags & 2) && t >= j(s) ? M.push(e) : M.splice($n(t), 0, e), e.flags |= 1, Ht();
1803
+ }
1804
+ }
1805
+ function Ht() {
1806
+ _e || (_e = On.then(kt));
1807
+ }
1808
+ function Ln(e) {
1809
+ b(e) ? F.push(...e) : R && e.id === -1 ? R.splice($ + 1, 0, e) : e.flags & 1 || (F.push(e), e.flags |= 1), Ht();
1810
+ }
1811
+ function Fn(e) {
1812
+ if (F.length) {
1813
+ const t = [...new Set(F)].sort(
1814
+ (s, n) => j(s) - j(n)
1815
+ );
1816
+ if (F.length = 0, R) {
1817
+ R.push(...t);
1818
+ return;
1819
+ }
1820
+ for (R = t, process.env.NODE_ENV !== "production" && (e = e || /* @__PURE__ */ new Map()), $ = 0; $ < R.length; $++) {
1821
+ const s = R[$];
1822
+ process.env.NODE_ENV !== "production" && Dt(e, s) || (s.flags & 4 && (s.flags &= -2), s.flags & 8 || s(), s.flags &= -2);
1823
+ }
1824
+ R = null, $ = 0;
1825
+ }
1826
+ }
1827
+ const j = (e) => e.id == null ? e.flags & 2 ? -1 : 1 / 0 : e.id;
1828
+ function kt(e) {
1829
+ process.env.NODE_ENV !== "production" && (e = e || /* @__PURE__ */ new Map());
1830
+ const t = process.env.NODE_ENV !== "production" ? (s) => Dt(e, s) : St;
1831
+ try {
1832
+ for (C = 0; C < M.length; C++) {
1833
+ const s = M[C];
1834
+ if (s && !(s.flags & 8)) {
1835
+ if (process.env.NODE_ENV !== "production" && t(s))
1836
+ continue;
1837
+ s.flags & 4 && (s.flags &= -2), re(
1838
+ s,
1839
+ s.i,
1840
+ s.i ? 15 : 14
1841
+ ), s.flags & 4 || (s.flags &= -2);
1842
+ }
1843
+ }
1844
+ } finally {
1845
+ for (; C < M.length; C++) {
1846
+ const s = M[C];
1847
+ s && (s.flags &= -2);
1848
+ }
1849
+ C = -1, M.length = 0, Fn(e), _e = null, (M.length || F.length) && kt(e);
1850
+ }
1851
+ }
1852
+ function Dt(e, t) {
1853
+ const s = e.get(t) || 0;
1854
+ if (s > Nn) {
1855
+ const n = t.i, i = n && Bt(n.type);
1856
+ return De(
1857
+ `Maximum recursive updates exceeded${i ? ` in component <${i}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
1858
+ null,
1859
+ 10
1860
+ ), !0;
1861
+ }
1862
+ return e.set(t, s + 1), !1;
1863
+ }
1864
+ const ue = /* @__PURE__ */ new Map();
1865
+ process.env.NODE_ENV !== "production" && (oe().__VUE_HMR_RUNTIME__ = {
1866
+ createRecord: he(An),
1867
+ rerender: he(Vn),
1868
+ reload: he(Bn)
1869
+ });
1870
+ const ee = /* @__PURE__ */ new Map();
1871
+ function An(e, t) {
1872
+ return ee.has(e) ? !1 : (ee.set(e, {
1873
+ initialDef: te(t),
1874
+ instances: /* @__PURE__ */ new Set()
1875
+ }), !0);
1876
+ }
1877
+ function te(e) {
1878
+ return zt(e) ? e.__vccOpts : e;
1879
+ }
1880
+ function Vn(e, t) {
1881
+ const s = ee.get(e);
1882
+ s && (s.initialDef.render = t, [...s.instances].forEach((n) => {
1883
+ t && (n.render = t, te(n.type).render = t), n.renderCache = [], n.update();
1884
+ }));
1885
+ }
1886
+ function Bn(e, t) {
1887
+ const s = ee.get(e);
1888
+ if (!s) return;
1889
+ t = te(t), Be(s.initialDef, t);
1890
+ const n = [...s.instances];
1891
+ for (let i = 0; i < n.length; i++) {
1892
+ const o = n[i], r = te(o.type);
1893
+ let c = ue.get(r);
1894
+ c || (r !== s.initialDef && Be(r, t), ue.set(r, c = /* @__PURE__ */ new Set())), c.add(o), o.appContext.propsCache.delete(o.type), o.appContext.emitsCache.delete(o.type), o.appContext.optionsCache.delete(o.type), o.ceReload ? (c.add(o), o.ceReload(t.styles), c.delete(o)) : o.parent ? Pn(() => {
1895
+ o.parent.update(), c.delete(o);
1896
+ }) : o.appContext.reload ? o.appContext.reload() : typeof window < "u" ? window.location.reload() : console.warn(
1897
+ "[HMR] Root or manually mounted instance modified. Full reload required."
1898
+ ), o.root.ce && o !== o.root && o.root.ce._removeChildStyle(r);
1899
+ }
1900
+ Ln(() => {
1901
+ ue.clear();
1902
+ });
1903
+ }
1904
+ function Be(e, t) {
1905
+ xe(e, t);
1906
+ for (const s in e)
1907
+ s !== "__file" && !(s in t) && delete e[s];
1908
+ }
1909
+ function he(e) {
1910
+ return (t, s) => {
1911
+ try {
1912
+ return e(t, s);
1913
+ } catch (n) {
1914
+ console.error(n), console.warn(
1915
+ "[HMR] Something went wrong during Vue component hot-reload. Full reload required."
1916
+ );
1917
+ }
1918
+ };
1919
+ }
1920
+ let P, X = [];
1921
+ function Ot(e, t) {
1922
+ var s, n;
1923
+ P = e, P ? (P.enabled = !0, X.forEach(({ event: i, args: o }) => P.emit(i, ...o)), X = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
1924
+ window.HTMLElement && // also exclude jsdom
1925
+ // eslint-disable-next-line no-restricted-syntax
1926
+ !((n = (s = window.navigator) == null ? void 0 : s.userAgent) != null && n.includes("jsdom")) ? ((t.__VUE_DEVTOOLS_HOOK_REPLAY__ = t.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((o) => {
1927
+ Ot(o, t);
1928
+ }), setTimeout(() => {
1929
+ P || (t.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, X = []);
1930
+ }, 3e3)) : X = [];
1931
+ }
1932
+ let se = null, Kn = null;
1933
+ const zn = (e) => e.__isTeleport;
1934
+ function Nt(e, t) {
1935
+ e.shapeFlag & 6 && e.component ? (e.transition = t, Nt(e.component.subTree, t)) : e.shapeFlag & 128 ? (e.ssContent.transition = t.clone(e.ssContent), e.ssFallback.transition = t.clone(e.ssFallback)) : e.transition = t;
1936
+ }
1937
+ oe().requestIdleCallback;
1938
+ oe().cancelIdleCallback;
1939
+ function Un(e, t, s = ae, n = !1) {
1940
+ if (s) {
1941
+ const i = s[e] || (s[e] = []), o = t.__weh || (t.__weh = (...r) => {
1942
+ const c = ri(s), l = Rt(t, s, e, r);
1943
+ return c(), l;
1944
+ });
1945
+ return n ? i.unshift(o) : i.push(o), o;
1946
+ } else if (process.env.NODE_ENV !== "production") {
1947
+ const i = _n(ke[e].replace(/ hook$/, ""));
1948
+ O(
1949
+ `${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`
1950
+ );
1951
+ }
1952
+ }
1953
+ const qn = (e) => (t, s = ae) => {
1954
+ (!Vt || e === "sp") && Un(e, (...n) => t(...n), s);
1955
+ }, Wn = qn("u"), jn = Symbol.for("v-ndc"), Gn = {};
1956
+ process.env.NODE_ENV !== "production" && (Gn.ownKeys = (e) => (O(
1957
+ "Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
1958
+ ), Reflect.ownKeys(e)));
1959
+ const Jn = {}, $t = (e) => Object.getPrototypeOf(e) === Jn, Yn = (e) => e.__isSuspense, Pt = Symbol.for("v-fgt"), Xn = Symbol.for("v-txt"), Qn = Symbol.for("v-cmt");
1960
+ function Zn(e) {
1961
+ return e ? e.__v_isVNode === !0 : !1;
1962
+ }
1963
+ const ei = (...e) => Ft(
1964
+ ...e
1965
+ ), Lt = ({ key: e }) => e ?? null, Q = ({
1966
+ ref: e,
1967
+ ref_key: t,
1968
+ ref_for: s
1969
+ }) => (typeof e == "number" && (e = "" + e), e != null ? D(e) || Tt(e) || _(e) ? { i: se, r: e, k: t, f: !!s } : e : null);
1970
+ function ti(e, t = null, s = null, n = 0, i = null, o = e === Pt ? 0 : 1, r = !1, c = !1) {
1971
+ const l = {
1972
+ __v_isVNode: !0,
1973
+ __v_skip: !0,
1974
+ type: e,
1975
+ props: t,
1976
+ key: t && Lt(t),
1977
+ ref: t && Q(t),
1978
+ scopeId: Kn,
1979
+ slotScopeIds: null,
1980
+ children: s,
1981
+ component: null,
1982
+ suspense: null,
1983
+ ssContent: null,
1984
+ ssFallback: null,
1985
+ dirs: null,
1986
+ transition: null,
1987
+ el: null,
1988
+ anchor: null,
1989
+ target: null,
1990
+ targetStart: null,
1991
+ targetAnchor: null,
1992
+ staticCount: 0,
1993
+ shapeFlag: o,
1994
+ patchFlag: n,
1995
+ dynamicProps: i,
1996
+ dynamicChildren: null,
1997
+ appContext: null,
1998
+ ctx: se
1999
+ };
2000
+ return c ? (Oe(l, s), o & 128 && e.normalize(l)) : s && (l.shapeFlag |= D(s) ? 8 : 16), process.env.NODE_ENV !== "production" && l.key !== l.key && O("VNode created with invalid key (NaN). VNode type:", l.type), l;
2001
+ }
2002
+ const si = process.env.NODE_ENV !== "production" ? ei : Ft;
2003
+ function Ft(e, t = null, s = null, n = 0, i = null, o = !1) {
2004
+ if ((!e || e === jn) && (process.env.NODE_ENV !== "production" && !e && O(`Invalid vnode type when creating vnode: ${e}.`), e = Qn), Zn(e)) {
2005
+ const c = ne(
2006
+ e,
2007
+ t,
2008
+ !0
2009
+ /* mergeRef: true */
2010
+ );
2011
+ return s && Oe(c, s), c.patchFlag = -2, c;
2012
+ }
2013
+ if (zt(e) && (e = e.__vccOpts), t) {
2014
+ t = ni(t);
2015
+ let { class: c, style: l } = t;
2016
+ c && !D(c) && (t.class = He(c)), W(l) && (Me(l) && !b(l) && (l = xe({}, l)), t.style = Re(l));
2017
+ }
2018
+ const r = D(e) ? 1 : Yn(e) ? 128 : zn(e) ? 64 : W(e) ? 4 : _(e) ? 2 : 0;
2019
+ return process.env.NODE_ENV !== "production" && r & 4 && Me(e) && (e = Z(e), O(
2020
+ "Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
2021
+ `
2022
+ Component that was made reactive: `,
2023
+ e
2024
+ )), ti(
2025
+ e,
2026
+ t,
2027
+ s,
2028
+ n,
2029
+ i,
2030
+ r,
2031
+ o,
2032
+ !0
2033
+ );
2034
+ }
2035
+ function ni(e) {
2036
+ return e ? Me(e) || $t(e) ? xe({}, e) : e : null;
2037
+ }
2038
+ function ne(e, t, s = !1, n = !1) {
2039
+ const { props: i, ref: o, patchFlag: r, children: c, transition: l } = e, d = t ? oi(i || {}, t) : i, u = {
2040
+ __v_isVNode: !0,
2041
+ __v_skip: !0,
2042
+ type: e.type,
2043
+ props: d,
2044
+ key: d && Lt(d),
2045
+ ref: t && t.ref ? (
2046
+ // #2078 in the case of <component :is="vnode" ref="extra"/>
2047
+ // if the vnode itself already has a ref, cloneVNode will need to merge
2048
+ // the refs so the single vnode can be set on multiple refs
2049
+ s && o ? b(o) ? o.concat(Q(t)) : [o, Q(t)] : Q(t)
2050
+ ) : o,
2051
+ scopeId: e.scopeId,
2052
+ slotScopeIds: e.slotScopeIds,
2053
+ children: process.env.NODE_ENV !== "production" && r === -1 && b(c) ? c.map(At) : c,
2054
+ target: e.target,
2055
+ targetStart: e.targetStart,
2056
+ targetAnchor: e.targetAnchor,
2057
+ staticCount: e.staticCount,
2058
+ shapeFlag: e.shapeFlag,
2059
+ // if the vnode is cloned with extra props, we can no longer assume its
2060
+ // existing patch flag to be reliable and need to add the FULL_PROPS flag.
2061
+ // note: preserve flag for fragments since they use the flag for children
2062
+ // fast paths only.
2063
+ patchFlag: t && e.type !== Pt ? r === -1 ? 16 : r | 16 : r,
2064
+ dynamicProps: e.dynamicProps,
2065
+ dynamicChildren: e.dynamicChildren,
2066
+ appContext: e.appContext,
2067
+ dirs: e.dirs,
2068
+ transition: l,
2069
+ // These should technically only be non-null on mounted VNodes. However,
2070
+ // they *should* be copied for kept-alive vnodes. So we just always copy
2071
+ // them since them being non-null during a mount doesn't affect the logic as
2072
+ // they will simply be overwritten.
2073
+ component: e.component,
2074
+ suspense: e.suspense,
2075
+ ssContent: e.ssContent && ne(e.ssContent),
2076
+ ssFallback: e.ssFallback && ne(e.ssFallback),
2077
+ el: e.el,
2078
+ anchor: e.anchor,
2079
+ ctx: e.ctx,
2080
+ ce: e.ce
2081
+ };
2082
+ return l && n && Nt(
2083
+ u,
2084
+ l.clone(u)
2085
+ ), u;
2086
+ }
2087
+ function At(e) {
2088
+ const t = ne(e);
2089
+ return b(e.children) && (t.children = e.children.map(At)), t;
2090
+ }
2091
+ function ii(e = " ", t = 0) {
2092
+ return si(Xn, null, e, t);
2093
+ }
2094
+ function Oe(e, t) {
2095
+ let s = 0;
2096
+ const { shapeFlag: n } = e;
2097
+ if (t == null)
2098
+ t = null;
2099
+ else if (b(t))
2100
+ s = 16;
2101
+ else if (typeof t == "object")
2102
+ if (n & 65) {
2103
+ const i = t.default;
2104
+ i && (i._c && (i._d = !1), Oe(e, i()), i._c && (i._d = !0));
2105
+ return;
2106
+ } else
2107
+ s = 32, !t._ && !$t(t) && (t._ctx = se);
2108
+ else _(t) ? (t = { default: t, _ctx: se }, s = 32) : (t = String(t), n & 64 ? (s = 16, t = [ii(t)]) : s = 8);
2109
+ e.children = t, e.shapeFlag |= s;
2110
+ }
2111
+ function oi(...e) {
2112
+ const t = {};
2113
+ for (let s = 0; s < e.length; s++) {
2114
+ const n = e[s];
2115
+ for (const i in n)
2116
+ if (i === "class")
2117
+ t.class !== n.class && (t.class = He([t.class, n.class]));
2118
+ else if (i === "style")
2119
+ t.style = Re([t.style, n.style]);
2120
+ else if (yn(i)) {
2121
+ const o = t[i], r = n[i];
2122
+ r && o !== r && !(b(o) && o.includes(r)) && (t[i] = o ? [].concat(o, r) : r);
2123
+ } else i !== "" && (t[i] = n[i]);
2124
+ }
2125
+ return t;
2126
+ }
2127
+ let ae = null, Ee;
2128
+ {
2129
+ const e = oe(), t = (s, n) => {
2130
+ let i;
2131
+ return (i = e[s]) || (i = e[s] = []), i.push(n), (o) => {
2132
+ i.length > 1 ? i.forEach((r) => r(o)) : i[0](o);
2133
+ };
2134
+ };
2135
+ Ee = t(
2136
+ "__VUE_INSTANCE_SETTERS__",
2137
+ (s) => ae = s
2138
+ ), t(
2139
+ "__VUE_SSR_SETTERS__",
2140
+ (s) => Vt = s
2141
+ );
2142
+ }
2143
+ const ri = (e) => {
2144
+ const t = ae;
2145
+ return Ee(e), e.scope.on(), () => {
2146
+ e.scope.off(), Ee(t);
2147
+ };
2148
+ };
2149
+ let Vt = !1;
2150
+ process.env.NODE_ENV;
2151
+ const ai = /(?:^|[-_])(\w)/g, ci = (e) => e.replace(ai, (t) => t.toUpperCase()).replace(/[-_]/g, "");
2152
+ function Bt(e, t = !0) {
2153
+ return _(e) ? e.displayName || e.name : e.name || t && e.__name;
2154
+ }
2155
+ function Kt(e, t, s = !1) {
2156
+ let n = Bt(t);
2157
+ if (!n && t.__file) {
2158
+ const i = t.__file.match(/([^/\\]+)\.\w+$/);
2159
+ i && (n = i[1]);
2160
+ }
2161
+ if (!n && e && e.parent) {
2162
+ const i = (o) => {
2163
+ for (const r in o)
2164
+ if (o[r] === t)
2165
+ return r;
2166
+ };
2167
+ n = i(
2168
+ e.components || e.parent.type.components
2169
+ ) || i(e.appContext.components);
2170
+ }
2171
+ return n ? ci(n) : s ? "App" : "Anonymous";
2172
+ }
2173
+ function zt(e) {
2174
+ return _(e) && "__vccOpts" in e;
2175
+ }
2176
+ process.env.NODE_ENV;
2177
+ process.env.NODE_ENV;
2178
+ process.env.NODE_ENV;
2179
+ const gi = /* @__PURE__ */ Ut({
2180
+ inheritAttrs: !0,
2181
+ __name: "MyopVueComponent",
2182
+ props: {
2183
+ flowId: {},
2184
+ componentId: {},
2185
+ onReady: { type: Function }
2186
+ },
2187
+ setup(e, { expose: t }) {
2188
+ const s = e, n = qt(), i = Wt(), o = K(null), r = K(!0), c = K(null), l = K(null), d = jt(), u = K(null);
2189
+ Wn(() => {
2190
+ l && l.value && l.value(n);
2191
+ }), Gt(async () => {
2192
+ if (o.value) {
2193
+ const m = await ps.Main.fetchComponent(s.componentId, s.flowId);
2194
+ c.value = await Ct.loadComponent(
2195
+ m,
2196
+ o == null ? void 0 : o.value,
2197
+ {
2198
+ _environment: {
2199
+ // inputs: { ...attrs, ...props },
2200
+ props: n,
2201
+ slots: i,
2202
+ context: d == null ? void 0 : d.appContext,
2203
+ vueContainerRef: o,
2204
+ //@ts-ignore
2205
+ defineUpdater: (w) => {
2206
+ l.value = w;
2207
+ },
2208
+ //@ts-ignore
2209
+ defineInnerVueComponentRef: (w) => {
2210
+ u.value = w.value;
2211
+ }
2212
+ }
2213
+ }
2214
+ ), r.value = !1, s.onReady && s.onReady(c.value, u.value);
2215
+ }
2216
+ });
2217
+ const h = Jt({});
2218
+ return t(h), Yt(() => {
2219
+ Object.assign(h, u.value);
2220
+ }), (m, w) => (Qt(), Xt(Zt, null, [
2221
+ es("div", ns(is(n), {
2222
+ ref_key: "myopContainer",
2223
+ ref: o
2224
+ }), null, 16),
2225
+ r.value ? ts(m.$slots, "loading", { key: 0 }) : ss("", !0)
2226
+ ], 64));
2227
+ }
2228
+ });
2229
+ export {
2230
+ gi as MyopContainer
2231
+ };