@myop/react-native 0.0.6 → 0.0.8

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/README.md CHANGED
@@ -1,19 +1,14 @@
1
1
  # @myop/react-native
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/@myop/react-native.svg)](https://www.npmjs.com/package/@myop/react-native)
4
- [![license](https://img.shields.io/npm/l/@myop/react-native.svg)](https://github.com/myop-dev/react-native/blob/main/LICENSE)
3
+ Official React Native bindings for embedding [Myop](https://myop.dev) components in your React Native applications.
5
4
 
6
- Embed [Myop](https://myop.dev) components in your React Native applications.
5
+ Myop components are framework-agnostic UI components that can be updated in real-time without redeploying your application. Build once, embed anywhere, and iterate instantly. Perfect for teams that need to ship UI changes fast, A/B test components, or empower non-developers to customize the interface. Myop is also the safest way to adopt AI-generated components in your application—whether created by developers or non-developers—with built-in sandboxing and controlled integration.
7
6
 
8
- ## Features
7
+ [![npm version](https://img.shields.io/npm/v/@myop/react-native.svg)](https://www.npmjs.com/package/@myop/react-native)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
9
+ [![Discord](https://img.shields.io/badge/Discord-Join%20us-5865F2?logo=discord&logoColor=white)](https://myop.dev/discord)
9
10
 
10
- - Load Myop components by ID or custom configuration
11
- - Two-way communication between React Native and embedded components
12
- - Customizable loading and fallback states
13
- - Component preloading for instant rendering
14
- - Full component proxy API for DOM manipulation
15
- - Configurable scroll, zoom, and text selection
16
- - TypeScript support
11
+ [Website](https://www.myop.dev/) | [Documentation](https://docs.myop.dev/) | [Dashboard](https://dashboard.myop.dev/) | [Discord](https://myop.dev/discord)
17
12
 
18
13
  ## Installation
19
14
 
@@ -27,6 +22,85 @@ Install the required peer dependency:
27
22
  npm install react-native-webview
28
23
  ```
29
24
 
25
+ ## Auto-Generated React Native Components
26
+
27
+ Myop automatically generates a typed React Native component package for every component you create in the [dashboard](https://dashboard.myop.dev/). Install it directly via npm:
28
+
29
+ ```bash
30
+ npm install https://cloud.myop.dev/npm/{component-id}/react-native
31
+ ```
32
+
33
+ Then import and use it like any React Native component. For example, if you created a table component called "users-table" in the dashboard:
34
+
35
+ ```tsx
36
+ import { UsersTable } from "@myop/users-table";
37
+
38
+ export default function App() {
39
+ const users = [
40
+ { id: 1, name: "Alice", email: "alice@example.com", role: "Admin" },
41
+ { id: 2, name: "Bob", email: "bob@example.com", role: "User" },
42
+ { id: 3, name: "Charlie", email: "charlie@example.com", role: "User" },
43
+ ];
44
+
45
+ return (
46
+ <UsersTable
47
+ data={{ rows: users }}
48
+ onRowClicked={(payload) => {
49
+ console.log("Selected user:", payload.rowData);
50
+ }}
51
+ onDeleteClicked={(payload) => {
52
+ deleteUser(payload.userId);
53
+ }}
54
+ onExportRequested={(payload) => {
55
+ exportToFormat(payload.format); // "csv" | "xlsx"
56
+ }}
57
+ style={{ flex: 1 }}
58
+ />
59
+ );
60
+ }
61
+ ```
62
+
63
+ **Why this is powerful:**
64
+
65
+ - **Fully typed** — The generated package includes complete TypeScript types for your component's data interface and all CTA event payloads
66
+ - **Auto loaded** — Components are fetched and rendered automatically, no manual setup required
67
+ - **Not in your code** — The actual component implementation lives on Myop and is loaded at runtime. Update your component in the dashboard and it's instantly live—no rebuild, no redeploy
68
+ - **Zero bundle impact** — Auto-generated component packages are just thin typed wrappers. The actual component implementations are loaded at runtime via WebView, meaning your Myop components can be as complex, feature-rich, and heavy as you need without adding to your application bundle
69
+
70
+ **Environment options:**
71
+
72
+ Set the default environment for all components using `setEnvironment`:
73
+
74
+ ```tsx
75
+ import { setEnvironment } from "@myop/react-native";
76
+
77
+ // Set default environment for all component loads
78
+ setEnvironment("staging");
79
+ ```
80
+
81
+ You can also override the environment directly on a specific component:
82
+
83
+ ```tsx
84
+ <UsersTable
85
+ data={{ rows: users }}
86
+ preview={true} // Load unpublished preview version
87
+ environment="staging" // Load from specific environment (prod, staging, etc.)
88
+ style={{ flex: 1 }}
89
+ />
90
+ ```
91
+
92
+ Environments are fully configurable in the [dashboard](https://dashboard.myop.dev/), allowing you to test changes in staging before publishing to production.
93
+
94
+ For more details on auto-generated packages, see the [Auto-Generated Packages documentation](https://docs.myop.dev/docs/learnMyop/AutoGeneratedPackages).
95
+
96
+ ## Requirements
97
+
98
+ | Dependency | Version |
99
+ |------------|---------|
100
+ | React | >= 16.8.0 |
101
+ | React Native | >= 0.60.0 |
102
+ | react-native-webview | >= 11.0.0 |
103
+
30
104
  ## Quick Start
31
105
 
32
106
  ```tsx
@@ -362,18 +436,6 @@ interface MyopLoaderRef {
362
436
  }
363
437
  ```
364
438
 
365
- ## Requirements
366
-
367
- | Dependency | Version |
368
- |------------|---------|
369
- | React | >= 16.8.0 |
370
- | React Native | >= 0.60.0 |
371
- | react-native-webview | >= 11.0.0 |
372
-
373
- ## Contributing
374
-
375
- Contributions are welcome. Please open an issue to discuss proposed changes before submitting a pull request.
376
-
377
439
  ## License
378
440
 
379
441
  MIT
@@ -1 +1 @@
1
- {"version":3,"file":"MyopComponent.d.ts","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmB,SAAS,EAAuD,MAAM,OAAO,CAAC;AAG/G,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,SAAS,CAAC;AAuEtD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,6EAA6E;IAC7E,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,yFAAyF;IACzF,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,wCAAwC;IACxC,KAAK,EAAE;QACH,GAAG,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAC/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AyC;IACzC,OAAO,EAAE,aAAa,CAAC;IAEvB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB,yBAAyB;IACzB,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB,yBAAyB;IACzB,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB,oCAAoC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,UAAU,UAAU;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,UAAU,sBAiU9C,CAAA"}
@@ -106,6 +106,7 @@ const MyopComponent = (props) => {
106
106
  const [showLoader, setShowLoader] = (0, react_1.useState)(!componentIsPreloaded);
107
107
  const [showFallback, setShowFallback] = (0, react_1.useState)(false);
108
108
  const [isComponentLoaded, setIsComponentLoaded] = (0, react_1.useState)(false);
109
+ const hasCalledInitialData = (0, react_1.useRef)(false);
109
110
  const fadeDuration = (_a = props.fadeDuration) !== null && _a !== void 0 ? _a : 200;
110
111
  // Function to call myop_init_interface in the WebView
111
112
  const callInitInterface = (0, react_1.useCallback)((data) => {
@@ -120,8 +121,13 @@ const MyopComponent = (props) => {
120
121
  `);
121
122
  }, [isComponentLoaded]);
122
123
  // Call myop_init_interface when data prop changes (after component is loaded)
124
+ // Skip the first call after load - data was already passed through loader options
123
125
  (0, react_1.useEffect)(() => {
124
126
  if (isComponentLoaded && props.data !== undefined) {
127
+ if (!hasCalledInitialData.current) {
128
+ hasCalledInitialData.current = true;
129
+ return;
130
+ }
125
131
  callInitInterface(props.data);
126
132
  }
127
133
  }, [props.data, isComponentLoaded, callInitInterface]);
@@ -289,8 +295,10 @@ const MyopComponent = (props) => {
289
295
  if (isCancelled.current)
290
296
  return;
291
297
  const encoded = encodeURIComponent(JSON.stringify(componentConfig));
298
+ const loaderOptions = props.data !== undefined ? { data: props.data } : undefined;
299
+ const encodedOptions = loaderOptions ? encodeURIComponent(JSON.stringify(loaderOptions)) : '';
292
300
  (_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`
293
- loadMyopComponent(\`${encoded}\`);
301
+ loadMyopComponent(\`${encoded}\`, ${encodedOptions ? `\`${encodedOptions}\`` : 'null'});
294
302
  `);
295
303
  }
296
304
  catch (err) {
@@ -300,7 +308,7 @@ const MyopComponent = (props) => {
300
308
  }
301
309
  }, [props.componentConfig, props.componentId, props.environment, props.preview, handleError]);
302
310
  const onMessage = (0, react_1.useCallback)((event) => {
303
- var _a, _b, _c, _d, _e;
311
+ var _a, _b, _c, _d;
304
312
  const message = event.nativeEvent.data;
305
313
  //console.log('[MyopComponent] Message from WebView:', message);
306
314
  if (message === 'WEBVIEW_READY') {
@@ -310,20 +318,12 @@ const MyopComponent = (props) => {
310
318
  else if (message === 'COMPONENT_LOADED') {
311
319
  setIsComponentLoaded(true);
312
320
  hideLoader();
313
- // Call myop_init_interface immediately with initial data if provided
314
- if (props.data !== undefined) {
315
- const encoded = encodeURIComponent(JSON.stringify(props.data));
316
- (_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`
317
- if (window.myopComponent) {
318
- window.myopComponent.props.myop_init_interface(JSON.parse(decodeURIComponent('${encoded}')));
319
- }
320
- `);
321
- }
321
+ // Initial data is now passed through loader options (SDK handles injection)
322
322
  if (props.onLoad) {
323
323
  props.onLoad(createMyopComponentProxy(props.componentId || 'unknown'));
324
324
  }
325
325
  }
326
- else if (((_b = message === null || message === void 0 ? void 0 : message.startsWith) === null || _b === void 0 ? void 0 : _b.call(message, 'COMPONENT_ERROR:')) || ((_c = message === null || message === void 0 ? void 0 : message.startsWith) === null || _c === void 0 ? void 0 : _c.call(message, 'SDK_INIT_ERROR:'))) {
326
+ else if (((_a = message === null || message === void 0 ? void 0 : message.startsWith) === null || _a === void 0 ? void 0 : _a.call(message, 'COMPONENT_ERROR:')) || ((_b = message === null || message === void 0 ? void 0 : message.startsWith) === null || _b === void 0 ? void 0 : _b.call(message, 'SDK_INIT_ERROR:'))) {
327
327
  const errorMsg = message.replace('COMPONENT_ERROR:', '').replace('SDK_INIT_ERROR:', '');
328
328
  console.error('[MyopComponent] Error loading component:', errorMsg);
329
329
  hideLoader();
@@ -332,7 +332,7 @@ const MyopComponent = (props) => {
332
332
  props.onError(errorMsg);
333
333
  }
334
334
  }
335
- else if ((_d = message === null || message === void 0 ? void 0 : message.startsWith) === null || _d === void 0 ? void 0 : _d.call(message, 'CTA:')) {
335
+ else if ((_c = message === null || message === void 0 ? void 0 : message.startsWith) === null || _c === void 0 ? void 0 : _c.call(message, 'CTA:')) {
336
336
  // Handle myop_cta_handler calls
337
337
  try {
338
338
  const ctaData = JSON.parse(message.substring(4));
@@ -344,7 +344,7 @@ const MyopComponent = (props) => {
344
344
  console.error('[MyopComponent] Failed to parse CTA message:', e);
345
345
  }
346
346
  }
347
- else if ((_e = message === null || message === void 0 ? void 0 : message.startsWith) === null || _e === void 0 ? void 0 : _e.call(message, 'GET_RESULT:')) {
347
+ else if ((_d = message === null || message === void 0 ? void 0 : message.startsWith) === null || _d === void 0 ? void 0 : _d.call(message, 'GET_RESULT:')) {
348
348
  // Handle element.get() responses
349
349
  try {
350
350
  const result = JSON.parse(message.substring(11));
@@ -1 +1 @@
1
- {"version":3,"file":"MyopComponent.js","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+G;AAC/G,+CAA8C;AAC9C,+DAA6C;AAG7C,mEAA6C;AAE7C,MAAM,OAAO,GAAG,CAAC,WAAoB,EAAE,gBAAyB,EAAE,EAAE;IAChE,IAAI,IAAI,GAAG,4BAAI,CAAC;IAEhB,eAAe;IACf,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,IAAI,GAAG,IAAI,CAAC,OAAO,CACf,uCAAuC,EACvC,4EAA4E,CAC/E,CAAC;IACN,CAAC;IAED,yCAAyC;IACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpB,MAAM,WAAW,GAAG;;;;;;;;;;;SAWnB,CAAC;QACF,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;QAE1D,sCAAsC;QACtC,IAAI,GAAG,IAAI,CAAC,OAAO,CACf,SAAS,EACT;;gCAEoB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;6BAyBd,CACpB,CAAC;IACN,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAGF,iDAA4C;AAC5C,mCAAwD;AAiEjD,MAAM,aAAa,GAAG,CAAC,KAAiB,EAAE,EAAE;;IAC/C,MAAM,UAAU,GAAG,IAAA,cAAM,EAAU,IAAI,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,IAAA,cAAM,EAAgB,IAAI,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,IAAA,cAAM,EAAC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,MAAM,EAAE,CAAC,GACZ;CACJ,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const HTML = "\n<!DOCTYPE html>\n<html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <style>\n html, body {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-family: sans-serif;\n }\n #myop-container {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n }\n </style>\n <script>\"use strict\";var MyopSDK=(()=>{var ze=Object.defineProperty,ds=Object.defineProperties,cs=Object.getOwnPropertyDescriptor,ms=Object.getOwnPropertyDescriptors,ls=Object.getOwnPropertyNames,gn=Object.getOwnPropertySymbols;var un=Object.prototype.hasOwnProperty,fs=Object.prototype.propertyIsEnumerable;var Dt=(o,t,e)=>t in o?ze(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,h=(o,t)=>{for(var e in t||(t={}))un.call(t,e)&&Dt(o,e,t[e]);if(gn)for(var e of gn(t))fs.call(t,e)&&Dt(o,e,t[e]);return o},N=(o,t)=>ds(o,ms(t));var m=(o,t)=>()=>(o&&(t=o(o=0)),t);var ee=(o,t)=>{for(var e in t)ze(o,e,{get:t[e],enumerable:!0})},gs=(o,t,e,n)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let r of ls(t))!un.call(o,r)&&r!==e&&ze(o,r,{get:()=>t[r],enumerable:!(n=cs(t,r))||n.enumerable});return o};var us=o=>gs(ze({},\"__esModule\",{value:!0}),o);var s=(o,t,e)=>Dt(o,typeof t!=\"symbol\"?t+\"\":t,e);var $e,Ue,Bt,z,te=m(()=>{\"use strict\";$e=\"__federation__\",Ue=\"onLoad\",Bt=\"moduleInstance\",z=(o,t)=>{window[$e]&&window[$e][o]&&window[$e][o][Ue]&&window[$e][o][Ue]({[o]:t})}});var ue,Ne=m(()=>{ue=\"0.3.13\"});var l,I=m(()=>{\"use strict\";l={InitRequest:\"InitRequest\",InitResponse:\"InitResponse\",InitMessage:\"InitMessage\",DisposeMessage:\"DisposeMessage\",ChangeTextMessage:\"ChangeTextMessage\",BindClickMessage:\"BindClickMessage\",DetectMyopRefsMessage:\"DetectMyopRefsMessage\",ExecuteScriptMessage:\"ExecuteScriptMessage\",AddEventListenerMessage:\"AddEventListenerMessage\",SetAttributeMessage:\"SetAttributeMessage\",CreateRefComponentMessage:\"CreateRefComponentMessage\",EnvelopedMessage:\"EnvelopedMessage\",GetElementValueMessage:\"GetElementValueMessage\",GetAttributeMessage:\"GetAttributeMessage\",SetInnerHtml:\"SetInnerHtml\",ExecuteComponentMethod:\"ExecuteComponentMethod\",SetMutationObserverMessage:\"SetMutationObserverMessage\",SetResizeObserverMessage:\"SetResizeObserverMessage\",CleanupMessage:\"CleanupMessage\",In:{DetectedMyopRefsMessage:\"DetectedMyopRefsMessage\",ClickReplayMessage:\"ClickReplayMessage\",ExecuteScriptReplyMessage:\"ExecuteScriptReplyMessage\",EventListenerCallbackMessage:\"EventListenerCallbackMessage\",ElementValueReplayMessage:\"ElementValueReplayMessage\",GetAttributeReplayMessage:\"GetAttributeReplayMessage\",RefComponentCreatedMessage:\"RefComponentCreatedMessage\",EnvelopedMessage:\"EnvelopedMessage\",MutationObserverMessage:\"MutationObserverMessage\",CleanupReplayMessage:\"CleanupReplayMessage\",ResizeObserverMessage:\"ResizeObserverMessage\"}}});var T,ys,hs,Lt,Ot=m(()=>{\"use strict\";T=()=>\"10000000-1000-4000-8000-100000000000\".replace(/[018]/g,o=>(+o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+o/4).toString(16)),ys=o=>{let t=[...o].map(e=>e.toString(16).padStart(2,\"0\")).join(\"\");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join(\"-\")},hs=o=>{let t=o.replace(/-/g,\"+\").replace(/_/g,\"/\");for(;t.length%4;)t+=\"=\";let e=atob(t);return Uint8Array.from(e,n=>n.charCodeAt(0))},Lt=o=>{let t=hs(o);if(t.length%16!==0)throw new Error(\"Invalid input length\");let e=[];for(let n=0;n<t.length;n+=16)e.push(ys(t.slice(n,n+16)));return e}});var hn,ne=m(()=>{\"use strict\";Ot();hn=o=>new Promise(t=>setTimeout(t,o))});var R,C,Pt,v,_,G,k=m(()=>{\"use strict\";ne();R=class{};s(R,\"down\",\"down\"),s(R,\"up\",\"up\");C=class{constructor(){s(this,\"id\",T());s(this,\"myop\",!0);s(this,\"content\");s(this,\"source\");s(this,\"destination\");s(this,\"route\");s(this,\"ref\");s(this,\"direction\");s(this,\"cleanable\",!1)}static create(...t){return new this(...t)}isTypeof(t){return t.messageType===this.messageType}},Pt=class extends C{constructor(e){super();this.ref=e}},v=class extends C{constructor(e){super();this.replayToHandler=e}},_=class extends C{constructor(e){super();this.handler=e;s(this,\"handlerUniqueId\",T())}},G=class o{constructor(t,e){this.refConfig=t;this.component=e;s(this,\"myop\",!0);s(this,\"__nonProxied\");this.__nonProxied=N(h({},this),{component:null})}static create(t,e,n){let r=e;return r||(r={id:\"\",name:\"\",description:\"\",selectorType:\"id-attribute\",selector:t,behavior:{type:\"code\"}}),new o(r,n)}}});var Mn,Kt,oe,In=m(()=>{\"use strict\";k();Mn=\"ClickReplayMessage\",Kt=class extends _{constructor(e,n){super(n);this.ref=e;s(this,\"replyMessageKey\",Mn);s(this,\"messageType\",\"BindClickMessage\");s(this,\"cleanable\",!0)}},oe=class extends v{constructor(){super(...arguments);s(this,\"messageType\",Mn)}}});var At,Cn=m(()=>{\"use strict\";k();At=class extends C{constructor(e,n){super();this.ref=e;s(this,\"messageType\",\"ChangeTextMessage\");this.content=n}}});var xn,Ms,Is,wn,D,se,Ft=m(()=>{\"use strict\";k();xn=\"ExecuteScriptReplyMessage\",Ms=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,Is=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,wn=o=>{let t=o.match(Ms);if(t)return t[1]||t[3];{let e=o.match(Is);if(e)return e[1].trim()}},D=class extends _{constructor(e,n=()=>{},r){super(n);this.scriptInputs=r;s(this,\"replyMessageKey\",xn);s(this,\"messageType\",\"ExecuteScriptMessage\");s(this,\"script\",\"\");this.script=e.toString(),this.content=e.toString(),this.content=wn(this.content)}};s(D,\"replierKey\",\"send\"),s(D,\"completeStreamKey\",\"completeStream\");se=class extends v{constructor(e,n){super(e);this.replayToHandler=e;this.content=n;s(this,\"messageType\",xn)}}});var W,bn=m(()=>{\"use strict\";Ft();W=class extends D{constructor(e,n,r=()=>{}){super(({rootRef:i,elementId:a,_script:p,__scriptInputs:d})=>{let c=(i.shadowRoot||i.container).querySelectorAll(\"[myop-id='\".concat(a,\"']\"));return c.length?(d.ref=c[0],new Function(\"return (\".concat(p,\")(...arguments)\"))(d)):null},r);this.scriptInputs=n;this.scriptInputs=N(h({},n),{_script:e.toString()})}}});var Sn,zt,re,Tn=m(()=>{\"use strict\";k();Sn=\"EventListenerCallbackMessage\",zt=class extends _{constructor(e,n,r){super(r);this.ref=e;this.type=n;this.handler=r;s(this,\"replyMessageKey\",Sn);s(this,\"messageType\",\"AddEventListenerMessage\");s(this,\"cleanable\",!0);s(this,\"serializableSkeleton\",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},re=class extends v{constructor(e,n){super(e);this.replayToHandler=e;this.e=n;s(this,\"messageType\",Sn);this.content={e:n}}}});var $t,En=m(()=>{\"use strict\";k();$t=class extends C{constructor(e,n,r){super();this.ref=e;this.name=n;this.value=r;s(this,\"messageType\",\"SetAttributeMessage\")}}});var Rn,Ut,ie,Nt=m(()=>{\"use strict\";k();Rn=\"ElementValueReplayMessage\",Ut=class extends _{constructor(e,n){super(n);this.ref=e;s(this,\"replyMessageKey\",Rn);s(this,\"messageType\",\"GetElementValueMessage\")}},ie=class extends v{constructor(e){super();this.content=e;s(this,\"messageType\",Rn)}}});var Wt,vn=m(()=>{\"use strict\";k();Wt=class extends C{constructor(e,n){super();this.ref=e;s(this,\"messageType\",\"SetInnerHtml\");this.content=n}}});var ye,Re,ae,_n=m(()=>{\"use strict\";k();ye=class extends C{constructor(e){super();s(this,\"messageType\",\"InitMessage\");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},Re=class extends ye{constructor(){super(...arguments);s(this,\"messageType\",\"InitResponse\")}},ae=class extends C{constructor(){super(...arguments);s(this,\"messageType\",\"InitRequest\")}}});var kn,ve,V,We=m(()=>{\"use strict\";k();kn=\"RefComponentCreatedMessage\",ve=class extends _{constructor(e,n,r,i){super(i);this.refConfig=e;this.nestedComponentConfig=n;this.options=r;s(this,\"replyMessageKey\",kn);s(this,\"messageType\",\"CreateRefComponentMessage\")}},V=class extends v{constructor(e,n,r){super(e);this.replayToHandler=e;this.nestedRefs=n;this.failed=r;s(this,\"messageType\",kn)}}});var _e,Vt=m(()=>{\"use strict\";k();_e=class extends C{constructor(e,n){super();this.destination=e;this.message=n;s(this,\"messageType\",\"EnvelopedMessage\");let r=n;this.route=[e,...r.route?r.route:[]]}}});var Hn,qt,pe,Dn=m(()=>{\"use strict\";k();Hn=\"DetectedMyopRefsMessage\",qt=class extends _{constructor(){super(...arguments);s(this,\"messageType\",\"DetectMyopRefsMessage\");s(this,\"replyMessageKey\",Hn)}},pe=class extends v{constructor(e,n){super(e);this.replayToHandler=e;s(this,\"messageType\",Hn);this.content=n}isTypeof(e){return e.messageType===this.messageType}}});var Bn,jt,ke,Ln=m(()=>{\"use strict\";k();Bn=\"GetAttributeReplayMessage\",jt=class extends _{constructor(e,n,r){super(r);this.ref=e;this.name=n;s(this,\"replyMessageKey\",Bn);s(this,\"messageType\",\"GetAttributeMessage\")}},ke=class extends v{constructor(e){super();this.content=e;s(this,\"messageType\",Bn)}}});var K,On=m(()=>{\"use strict\";k();K=class extends C{constructor(e){super();this.method=e;s(this,\"messageType\",\"ExecuteComponentMethod\")}}});var Gt,He,Pn=m(()=>{\"use strict\";k();Gt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",\"SetMutationObserverMessage\")}},He=class extends C{constructor(){super(...arguments);s(this,\"messageType\",\"MutationObserverMessage\")}}});var Kn,De,Be,An=m(()=>{\"use strict\";k();Kn=\"CleanupReplayMessage\",De=class extends _{constructor(e,n){super(n);this.cleanupForMessageId=e;s(this,\"replyMessageKey\",Kn);s(this,\"messageType\",\"CleanupMessage\")}},Be=class extends v{constructor(e){super();this.customCleanup=e;s(this,\"messageType\",Kn)}}});var Le,Fn=m(()=>{\"use strict\";k();Le=class extends C{constructor(){super(...arguments);s(this,\"messageType\",\"DisposeMessage\")}}});var Jt,Oe,zn=m(()=>{\"use strict\";k();Jt=class extends C{constructor(){super(...arguments);s(this,\"cleanable\",!0);s(this,\"messageType\",\"SetResizeObserverMessage\")}},Oe=class extends C{constructor(){super(...arguments);s(this,\"messageType\",\"ResizeObserverMessage\")}}});var he={};ee(he,{AddEventListenerMessage:()=>zt,BaseMyopMessage:()=>C,BindClickMessage:()=>Kt,ChangeTextMessage:()=>At,CleanupMessage:()=>De,CleanupReplayMessage:()=>Be,ClickReplayMessage:()=>oe,CreateRefComponentMessage:()=>ve,CustomRefMessage:()=>W,DetectMyopRefsMessage:()=>qt,DetectedMyopRefsMessage:()=>pe,DisposeMessage:()=>Le,ElementValueReplayMessage:()=>ie,EnvelopedMessage:()=>_e,EventListenerCallbackMessage:()=>re,ExecuteComponentMethod:()=>K,ExecuteScriptMessage:()=>D,ExecuteScriptReplyMessage:()=>se,GetAttributeMessage:()=>jt,GetAttributeReplayMessage:()=>ke,GetElementValueMessage:()=>Ut,InitMessage:()=>ye,InitRequest:()=>ae,InitResponse:()=>Re,MessageDirection:()=>R,MutationObserverMessage:()=>He,MyopBindMessage:()=>_,MyopBindReplayMessage:()=>v,MyopElementMessage:()=>Pt,Ref:()=>G,RefComponentCreatedMessage:()=>V,ResizeObserverMessage:()=>Oe,SetAttributeMessage:()=>$t,SetInnerHtml:()=>Wt,SetMutationObserverMessage:()=>Gt,SetResizeObserverMessage:()=>Jt,stripFunction:()=>wn});var w=m(()=>{\"use strict\";k();In();Cn();Ft();bn();Tn();En();Nt();vn();_n();We();Vt();Dn();Nt();Ln();On();Pn();An();Fn();zn()});var J,Ve=m(()=>{\"use strict\";I();w();Pe();J=class{constructor(t,e,n){this.componentDefinition=t;this.container=e;s(this,\"id\",\"\");s(this,\"messageHandlers\",{});s(this,\"element\");s(this,\"_markedForDisposed\",!1);s(this,\"bind\",(t,e)=>{this.messageHandlers[t]||(this.messageHandlers[t]=[]),this.messageHandlers[t].includes(e)||this.messageHandlers[t].push(e)});s(this,\"bindWhen\",(t,e,n)=>{if(!n)throw new Error(\"can't use component.bindWhen without an handler\");this.messageHandlers[t]||(this.messageHandlers[t]=[]);let r=this.messageHandlers[t],i=a=>e(a)?(n(a),!0):!1;return r.push(i),()=>{let a=r.indexOf(i);a>-1&&r.splice(a,1)}});s(this,\"setInitiated\",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});s(this,\"isInitiated\",!1);s(this,\"_whenInitiatedResolve\");s(this,\"_whenInitiatedReject\");s(this,\"_whenInitiated\",new Promise((t,e)=>{this._whenInitiatedResolve=t,this._whenInitiatedReject=e}));s(this,\"initiated\",()=>this._whenInitiated);s(this,\"props\",{});s(this,\"refs\",{});this.id=(n==null?void 0:n.id)||F.Instance().assignId(t);let r=n!=null&&n.timeout?n==null?void 0:n.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject(\"timeout_\".concat(r,\" \").concat(this.id))},r),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(t){if(this._markedForDisposed)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.\");this._markedForDisposed=t}onMessageReceived(t){if(t.messageType===l.ExecuteComponentMethod){let n=t;return this[n.method]?this[n.method](n.content):console.log(\"method not found \".concat(n.method,\" on component\"),this),!0}let e=this.messageHandlers[t.messageType];if(e&&e.length){let n=!1;return e.forEach(r=>{n=n||r(t)}),n}return!1}sendCleanupMessage(t){t.source=this.id,t.destination=this.id,t.direction=R.down;let e=this.bindWhen(t.replyMessageKey,r=>r.replayToHandler===t.handlerUniqueId,r=>{t.handler(r),e()}),n=t.handler;delete t.handler,this.send(t),t.handler=n}send(t){t.source||(t.source=this.id),t.destination||(t.destination=this.id),t.direction=R.down;let e;if(t.handler){let n=t;e=this.bindWhen(n.replyMessageKey,r=>r.replayToHandler===n.handlerUniqueId,n.handler),delete t.handler}return t.ref&&(t.ref=t.ref.__nonProxied||t.ref),t.cleanable?()=>{this.sendCleanupMessage(new De(t.id,n=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log(\"disposing component\",this.id),this.send(new Le);let t=this.messageHandlers.onDispose;t&&t.forEach(e=>{e(null)}),this.messageHandlers={},this.id+=\"_disposed\",this.isInitiated=!1}}});var Me,$n=m(()=>{\"use strict\";Me=class{constructor(t,e,n,r,i){this.myopId=t;this.htmlTagName=e;this.BoundingRect=n;this.offsetTop=r;this.offsetLeft=i;s(this,\"type\",\"MyopElementRef\")}}});var Un,x,qe,Nn=m(()=>{\"use strict\";Un=async o=>{if(typeof o==\"function\")o();else if(o instanceof Promise){let t=await o;typeof t==\"function\"&&t()}},x=class{constructor(t){this.messageToHost=t}},qe=class extends x{constructor(e,n){super(e);this.messageToHost=e;this.context=n}}});var Yt,Ie,Wn=m(()=>{\"use strict\";I();b();w();Yt=class{constructor(t,e){this.id=t;this.context=e;s(this,\"send\",t=>{})}},Ie=class{constructor(){s(this,\"messageToHandleAfterInit\",[]);s(this,\"components\",{});s(this,\"alwaysPassEnvelopesToHost\",!1);s(this,\"messageCleanupCache\",{})}handleIncomeMessages(t){let e=t.data?t.data:t.detail;if(!(!e||!e.myop)){let n=e;if(n.direction!==R.down)return;if(n.messageType===l.DisposeMessage){n.destination&&delete this.components[n.destination];return}if(n.messageType===l.InitMessage){let r=n.content.id;if(this.components[r])return;this.components[r]=new Yt(r),this.messageToHost(new Re(r));return}if(n.messageType===l.EnvelopedMessage){let r=n,i=r.message;if(n=i,this.alwaysPassEnvelopesToHost||this.components[n.destination]){let a=myop.hostSDK.components.find(d=>d.id===i.destination);if(a){a.send(i);return}let p=myop.hostSDK.components.find(d=>d.id===r.destination);if(p){p.send(i);return}}else return}if(n.messageType){if(n.messageType===l.CleanupMessage){let i=n,a=this.messageCleanupCache[i.cleanupForMessageId],p=new Be(!!a);p.destination=n.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],Un(a).then(()=>{this.messageToHost(p,i)}).catch(()=>{})):this.messageToHost(p,i);return}let r=!1;this.supportedHandlers.forEach(i=>{if(i.messageType===n.messageType){r=!0;let a=i.executor(n);if(n.cleanable&&a&&(this.messageCleanupCache[n.id]=a),a&&!n.cleanable)throw new Error(\"Cleanup handler generated for non-cleanable message. \\nmessageType - \".concat(n.messageType,\", handler executor was - \").concat(i.executor,\"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers.\"));if(!a&&n.cleanable)throw new Error(\"No cleanup handler generated for a cleanable message. \\nmessageType - \".concat(n.messageType,\", handler executor was - \").concat(i.executor,\"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers.\"))}})}else console.log(\"unsupported message type\")}}}});var q,de,we,Ce,ce,je,xe,b=m(()=>{\"use strict\";$n();Nn();Wn();q={IframeLoader:\"IframeLoader\",WebComponentLoader:\"WebComponentLoader\",HTMLLoader:\"HTMLLoader\",MinimizedLoader:\"MinimizedLoader\"},de={open:\"open\",closed:\"closed\",none:\"none\",localFrame:\"localFrame\"},we={message:\"message\",code:\"code\"},Ce=class{};s(Ce,\"code\",\"code\"),s(Ce,\"component\",\"component\");ce={Segmented:\"Segmented\",Dedicated:\"Dedicated\",Default:\"Default\"},je={Segment:\"Segment\",Promo:\"Promo\",AB:\"AB\"},xe=class{constructor(t,e){this.container=t;this.shadowRoot=e;s(this,\"getRootDiv\",()=>(this.shadowRoot||this.container).querySelector(\"div\"));s(this,\"getRoot\",()=>this.shadowRoot||this.container)}}});var Xt,Cs,Qt,P,me=m(()=>{\"use strict\";Xt=o=>o!==Object(o),Cs=o=>typeof o==\"function\",Qt=o=>{if(Xt(o))return!0;if(Cs(o)||Object.getPrototypeOf(o))return!1;for(let t in o){let e=o[t];if(typeof e==\"object\"){if(!Qt(e))return!1}else{if(Xt(e))continue;return!1}}return!0},P=(o,t={},e=!0,n=new WeakMap)=>{if(Xt(o))return o;if(Array.isArray(o)){if(n.has(o))return n.get(o);let r=[];n.set(o,r);for(let i=0;i<o.length;i++){let a=o[i];r[i]=P(a,t,e,n)}return r}if(o!==null&&typeof o==\"object\"){if(n.has(o))return n.get(o);let r={};n.set(o,r);for(let i in o){let a=typeof t==\"boolean\"?t:t[i];a&&(a===!0?(e?o[i]!==void 0:o[i])&&(r[i]=P(o[i],!0,e,n)):typeof a==\"object\"&&(r[i]=P(o[i],a,e,n)))}return r}return{}}});var Vn,qn=m(()=>{\"use strict\";Vn={notSerializableRefCall:(o,t)=>{throw new Error(\"\\nThe input provided to '\".concat(o.toString(),\"' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \\nThe following types of data are considered non-serializable and cannot be processed:\\n\\n- Functions\\n- DOM elements\\n- Class instances\\n- Circular references\\n- Symbols\\n- BigInt values\\n\\nIn the following execution we detected :\\n~~~~~~~~\\n\").concat(t,\" \\n~~~~~~~~\\nas not serializable.\\n\\nTo resolve this issue, please ensure that all inputs passed to '\").concat(o.toString(),\"' are in a serializable format.\\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \\nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\\n\\nSuggested Fix:\\n1. Remove or replace non-serializable values from your input.\\n2. If using objects, ensure they do not contain any functions or circular references.\\n3. Convert any class instances to plain objects or JSON-compatible formats.\\n4. Use dedicated Myop message.\\n\\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev.\\n\\n\"))}}});var Ke,jn=m(()=>{\"use strict\";Ve();w();Vt();Ke=class extends J{constructor(e,n,r){super(e,n.container,r);this.componentDefinition=e;this.parent=n;s(this,\"send\",e=>{let n=e.handler,r=super.send(e);return this.parent.send(new _e(this.id,e)),e.handler=n,r});s(this,\"dispose\",()=>{this.isInitiated&&this.send(new K(\"dispose\")),super.dispose()})}hide(){this.send(new K(\"hide\"))}show(){this.send(new K(\"show\"))}inspect(){return this.send(new K(\"inspect\"))}setHeightBasedOnDocumentElement(){this.send(new K(\"setHeightBasedOnDocumentElement\"))}setHeightBasedOnScrollHeight(){this.send(new K(\"setHeightBasedOnScrollHeight\"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var xs,Ge,Gn,Jn,Yn,ws,Zt,en,Je=m(()=>{\"use strict\";w();w();b();me();qn();jn();xs=(o,t,e)=>{let n=document.createElement(\"a\");return n.textContent=o,n.style.position=\"relative\",n.style.padding=\"0 5px\",n.style.fontSize=\"14px\",n.style.top=\"0\",n.style.top=\"\".concat(t,\"px\"),n.style.transform=\"translateX(-50%)\",n.target=\"_blank\",n.href=\"https://dashboard.myop.dev/dashboard/component/\".concat(e.id),n},Ge=(o,t,e,n,r,i)=>{let a=xs(\"\".concat(i.name,\" : \").concat(t),e,i);return n.insertBefore(a,r),r.style.border=\"1px solid #007BFF\",r.style.display=\"block\",()=>{r.style.border=\"unset\",n.removeChild(a)}},Gn=(o,t,e)=>o?!1:(console.error(\"Error: Undefined Prop\\n\\nIt looks like you've tried to use a prop that hasn't been defined.\\nPlease check the prop name for any typos or ensure that it is properly defined in the component's prop list.\\n\\n\"+\"Prop Name: \".concat(t,\"\\n\")+\"Component: \".concat(e.componentDefinition.name,\", ID: \").concat(e.componentDefinition.id,\"\\n\\n\")+\"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/\".concat(e.componentDefinition.id,\" or consult the developer guide.\")),!0),Jn=(o,t,e)=>{console.error(\"Error: Code Prop Not Supported\\n\\nCurrently, code props are only supported in local frame components.\\n\\u26A0\\uFE0F This is a work in progress feature \\u2014 code props will be supported in upcoming versions.\\n\\nIn the meantime, you can use message props.\\n\\n\"+\"Prop Name: \".concat(t,\"\\n\")+\"Component: \".concat(e.componentDefinition.name,\", ID: \").concat(e.componentDefinition.id,\"\\n\\n\")+\"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/\".concat(e.componentDefinition.id,\" or consult the developer guide.\"))},Yn=(o,t,e)=>{let n=t.reduce((i,a)=>N(h({},i),{[a.name]:h({},a)}),{}),r={get:(i,a)=>{let p=n[a];if(Gn(p,a,o))return!1;if(p.behavior.type===we.code){if(e.loader.type===q.HTMLLoader&&e.loader.shadowRootMode===de.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return Jn(p,a,o),!1}return p.mode===\"output\"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(G.create(p.behavior.ref)),c.push(f=>{d(f)}),p.behavior.params&&c.push(...p.behavior.params);let g=he[p.behavior.message];o.send(new g(...c))}):null},set:(i,a,p)=>{let d=n[a];if(Gn(d,a,o))return!1;if(d.behavior.type===we.code){if(e.loader.type===q.HTMLLoader&&e.loader.shadowRootMode===de.localFrame){let g=d.behavior,f=o.element.contentWindow,u=g.remap||a;if(f[u]=p,u===\"myop_cta_handler\"&&f.__myop_cta_queue){let y=f.__myop_cta_queue;f.__myop_cta_queue=null,y.forEach(M=>{o.markedForDisposed||p(M.action,M.payload)})}return!0}return Jn(d,a,o),!1}else if(d.mode===\"input\")if(d.behavior.type===\"message\"){let c=[];d.behavior.ref&&c.push(G.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let g=he[d.behavior.message];return o.send(new g(...c)),!0}else throw new Error(\"Error: Unsupported Behavior\\n\\nThe 'behavior' field provided is not supported.\\n\"+\"Component: \".concat(o.componentDefinition.name,\", ID: \").concat(o.componentDefinition.id,\"\\n\\n\")+\"Prop Name: \".concat(a,\"\\n\")+\"Behavior Field: \".concat(d.behavior.type,\"\\n\\n\")+\"Check the documentation for valid behavior options.\");return!1}};return o.props={},o.props=new Proxy(o.props,r),o},ws=(o,t)=>new Proxy(o,{get(e,n){return e[n]?e[n]:(...i)=>new Promise(a=>{i.forEach(p=>{Qt(p)||Vn.notSerializableRefCall(n,p)}),t.send(new W(({ref:p,propName:d,functionArgs:c,makeSerializable:g})=>{if(p){let f=p[d];return g(typeof f==\"function\"?p[d](...c):f,!0)}return null},{elementId:e.refConfig.selector,propName:n,functionArgs:i},p=>{a(p.content)}))})},set(e,n,r){return t.send(new W(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:r,propName:n},i=>{})),!0}}),Zt=async(o,t,e,n)=>{let r=o.component;if(!r)throw new Error(\"cant createRefComponent with detached ref\");return new Promise(async(i,a)=>{let p=new Ke(t.type,r,n);e.push(p),await r.initiated();let d=setTimeout(()=>{a(\"timeout\")},5e3);r.send(new ve(o.refConfig,t,N(h({},n||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(d),c.failed){a(\"CreateRefComponentMessage failed\");return}let g=e.find(f=>f.id==p.id);if(g!==p){r.refs[o.refConfig.name]=g,i(g);return}else p.setInitiated(),r.refs[o.refConfig.name]=p;c.nestedRefs.forEach(f=>{let u=t.instance.resolvedNestedComponents.find(M=>M.type.id===f.componentDefinitionId).type,y=new Ke(u,p);y.setInitiated(),p.refs[f.refName]=y,e.push(y)});try{await en(p,t,e,!0),r.setHeightBasedOnScrollHeight&&r.setHeightBasedOnScrollHeight(),i(p)}catch(f){a(f)}}))})},en=async(o,t,e,n=!1)=>{o.refs||(o.refs={});let r=Object.values(o.componentDefinition.refs).map(i=>new Promise(async(a,p)=>{var d;if(i.behavior.type==Ce.component){if(n){a();return}let c=i.behavior.componentId;c||(c=i.behavior.instance.componentId);let g=(d=t.instance.resolvedNestedComponents)==null?void 0:d.find(u=>u.type.id===c);if(!g)throw new Error(\"componentConfig provided without nestedComponentConfig check the config object\");let f=G.create(\"\",i,o);try{let u=await Zt(f,g,e);o.refs[i.name]=u,a()}catch(u){p(u)}}else try{let c=G.create(\"\",i,o);o.refs[i.name]=ws(c,o),a()}catch(c){}}));try{await Promise.all(r)}catch(i){throw i}}});var be,tn=m(()=>{\"use strict\";Ve();w();Je();I();be=class extends J{constructor(e,n,r,i,a){super(e,r,a);this.componentConfig=e;this.container=r;this.IframeElement=i;s(this,\"cleanupInspect\");s(this,\"setHeightBasedOnDocumentElement\",()=>{let e=this.send(new D(()=>window.document.documentElement.scrollHeight,n=>{this.IframeElement.style.height=\"\".concat(n.content,\"px\"),e()}))});s(this,\"observeSizeBasedOnDocumentElement\",()=>this.send(new D(({send:n})=>{let{height:r,width:i}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:d}=document.documentElement.getBoundingClientRect();n({height:p,width:d})});return a.observe(document.documentElement),a.observe(document.body),{height:r,width:i}},n=>{this.IframeElement.style.width=\"\".concat(n.content.width,\"px\"),this.IframeElement.style.height=\"\".concat(n.content.height,\"px\")})));s(this,\"observeAutoSize\",e=>{var Ee;let n=this.IframeElement,r=n.contentDocument;if(!r)return console.warn(\"[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible\"),()=>{};let i=(O,U,ge)=>U!==void 0&&O<U?U:ge!==void 0&&O>ge?ge:O,a=O=>{if(O===void 0)return;if(typeof O==\"number\")return O;let U=parseFloat(O);return isNaN(U)?void 0:U},p=a(e==null?void 0:e.minWidth),d=a(e==null?void 0:e.maxWidth),c=a(e==null?void 0:e.minHeight),g=a(e==null?void 0:e.maxHeight),f=(Ee=e==null?void 0:e.loaderMinHeight)!=null?Ee:50,u=(e==null?void 0:e.explicitWidth)!==void 0,y=(e==null?void 0:e.explicitHeight)!==void 0,M=this.container.getBoundingClientRect(),le=M.width===0,Fe=M.height===0||M.height===f,j=(e!=null&&e.forceAutoSize||le)&&!u,H=(e!=null&&e.forceAutoSize||Fe)&&!y;if(!j&&!H)return()=>{};let A=()=>{var U;let O=n.contentDocument;if(O){let ge=O.documentElement.getBoundingClientRect(),cn=Math.ceil(ge.width),mn=Math.ceil(ge.height),ln=i(cn,p,d),fn=i(mn,c,g);j&&(n.style.width=\"\".concat(ln,\"px\")),H&&(n.style.height=\"\".concat(fn,\"px\"));let as=j&&d!==void 0&&cn>d,ps=H&&g!==void 0&&mn>g;O.documentElement.style.overflowX=as?\"auto\":\"hidden\",O.documentElement.style.overflowY=ps?\"auto\":\"hidden\",(U=e==null?void 0:e.onSizeChange)==null||U.call(e,{width:ln,height:fn,autoSizingWidth:j,autoSizingHeight:H})}};A();let fe=new ResizeObserver(A);return fe.observe(r.body),fe.observe(r.documentElement),()=>{fe.disconnect()}});s(this,\"setSizeBasedOnDocumentElement\",()=>{let e=this.send(new D(()=>{let{height:n,width:r}=document.documentElement.getBoundingClientRect();return{height:n,width:r}},n=>{this.IframeElement.style.width=\"\".concat(n.content.width,\"px\"),this.IframeElement.style.height=\"\".concat(n.content.height,\"px\"),e()}))});s(this,\"setHeightBasedOnScrollHeight\",()=>{let e=this.send(new D(()=>{let r=0;return r++,r--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+r+\"px\"},n=>{this.IframeElement.style.height=n.content,e()}))});s(this,\"send\",e=>{var i,a;let n=h({},e);if(n.messageType===l.ExecuteComponentMethod)return this[n.method](),()=>{};n.direction=R.down;let r=super.send(n);return(a=(i=this.IframeElement)==null?void 0:i.contentWindow)==null||a.postMessage(n,\"*\"),r});s(this,\"dispose\",()=>{this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});n.loader.autoHeight&&this.initiated().then(()=>{this.setHeightBasedOnScrollHeight()}),this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=Ge(this.id,\"MyopIframeComponent\",10,this.container,this.IframeElement,this.componentDefinition),()=>{this.cleanupInspect(),this.cleanupInspect=void 0})}hide(){this.IframeElement.style.opacity=\"0\",this.IframeElement.style.position=\"absolute\",this.IframeElement.style.pointerEvents=\"none\",this.IframeElement.style.visibility=\"hidden\"}show(){this.IframeElement.style.opacity=\"1\",this.IframeElement.style.position=\"unset\",this.IframeElement.style.pointerEvents=\"all\",this.IframeElement.style.visibility=\"visible\"}onMessageReceived(e){return e.messageType===l.In.MutationObserverMessage||e.messageType===l.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var Y,Ye=m(()=>{\"use strict\";Y=class{constructor(){s(this,\"appendChild\",(t,e,n)=>{var r;if(n!=null&&n.relative){if(n.relative.direction===\"before\")return t.insertBefore(e,n.relative.child);if(n.relative.direction===\"after\"){let i=(r=n.relative.child)==null?void 0:r.nextSibling;return t.insertBefore(e,i||null)}}else return t.appendChild(e)})}}});var bs,Xe,Xn=m(()=>{\"use strict\";tn();Ye();ne();b();bs=(o,t,e)=>{let n=new URL(o);return n.searchParams.append(t,e),n.toString()},Xe=class extends Y{constructor(){super(...arguments);s(this,\"type\",q.IframeLoader);s(this,\"load\",async(e,n,r,i)=>{let a,p=n.loader;if((r==null?void 0:r.nodeName)===\"IFRAME\")console.log(\"needs to load into an exsisting Iframe...\",p.url,r),a=r,a.src=p.url;else{let d=T(),c=\"myop-comp-\".concat(d);a=document.createElement(\"iframe\"),a.id=c;let g=\"\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n height: \".concat(p.autoHeight||!p.height?\"100%\":p.height,\";\\n width: 100%;\\n overflow: hidden;\\n border: none;\\n opacity: \").concat(i!=null&&i.hidden?\"0\":\"1\",\";\\n pointer-events: \").concat(i!=null&&i.hidden?\"none\":\"all\",\";\\n \");a.style.cssText=g,i!=null&&i.elementAttributes&&Object.entries(i.elementAttributes).forEach(([u,y])=>{y===\"\"||y===null||y===void 0?a.setAttribute(u,\"\"):a.setAttribute(u,String(y))});let f=n.loader.url;i!=null&&i._hasParent&&(f=bs(f,\"_myop-comp\",d)),a.src=f,r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),a=this.appendChild(r,a,i)}return new be(e,n,r,a,i)})}}});var Qe,nn=m(()=>{\"use strict\";Qe={webcomponent_message_key:\"myop_webcomponent_message\"}});var Se,on=m(()=>{\"use strict\";nn();Ve();Je();Se=class extends J{constructor(e,n,r,i,a){super(e,r,a);this.container=r;this.customElement=i;s(this,\"cleanupInspect\",()=>{});s(this,\"send\",e=>{let n=h({},e),r=super.send(n),i=new CustomEvent(Qe.webcomponent_message_key,{detail:n});try{this.customElement.dispatchEvent(i)}catch(a){console.log(\"error while trying to dispatchEvent\",a)}return r});s(this,\"dispose\",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i}inspect(){return this.cleanupInspect=Ge(this.id,\"MyopWebComponent\",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){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\"}show(){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=\"\"}}});var sn,Ze,Qn=m(()=>{\"use strict\";on();Ye();ne();b();sn={},Ze=class extends Y{constructor(){super(...arguments);s(this,\"type\",q.WebComponentLoader);s(this,\"load\",async(e,n,r,i)=>{let a=n.loader;sn[a.url]?console.log(\"Module alreday loaded or in loading process\"):sn[a.url]=new Promise((c,g)=>{let f=a.url,u=document.createElement(\"script\");u.type=\"module\",u.src=f,u.onload=()=>{c()},u.onerror=()=>{g()},document.head.appendChild(u)}),await sn[a.url],await hn(1);let p=\"myop-comp-\".concat(T()),d=document.createElement(a.tag);return r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),d.id=p,i!=null&&i.hidden&&(d.style.opacity=\"0\",d.style.position=\"absolute\",d.style.height=\"0\",d.style.width=\"0\",d.style.pointerEvents=\"none\",d.style.visibility=\"hidden\"),i!=null&&i._environment&&(d._myopEnvironment=i==null?void 0:i._environment),this.appendChild(r,d,i),new Se(e,n,r,d,i)})}}});var E,$=m(()=>{\"use strict\";b();E=class extends qe{constructor(e,n){super(e);this.context=n;s(this,\"executor\",e=>{if(e.destination){let n=e.destination;if(this.context[n].context){let r=(i,a)=>{this.messageToHost(N(h({},i),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[n].context,r)}else debugger}else debugger})}}});var B,X=m(()=>{\"use strict\";B={id:\"myop-id\"}});var S,Zn,L=m(()=>{\"use strict\";X();S=(o,t)=>t.querySelectorAll(\"[\".concat(B.id,\"='\").concat(o.refConfig.selector,\"']\")),Zn=(o,t)=>{let e=S(o,t);return e.length?e.item(0):null}});var et,eo=m(()=>{\"use strict\";I();w();$();L();et=class extends E{constructor(){super(...arguments);s(this,\"messageType\",l.BindClickMessage);s(this,\"innerExecutor\",(e,n,r)=>{let i=S(e.ref,n.shadowRoot),a=[];return i.forEach(p=>{let d=()=>{r(new oe(e.handlerUniqueId))};p.addEventListener(\"click\",d),a.push(()=>{p.removeEventListener(\"click\",d)})}),()=>{a.forEach(p=>p())}})}}});var tt,to=m(()=>{\"use strict\";I();$();L();tt=class extends E{constructor(){super(...arguments);s(this,\"messageType\",l.ChangeTextMessage);s(this,\"innerExecutor\",(e,n)=>{S(e.ref,n.shadowRoot).forEach(i=>{i.textContent=e.content})})}}});var nt,no=m(()=>{\"use strict\";b();nt=class extends xe{constructor(e,n){super(e,n);this.container=e;this.shadowRoot=n}}});var ot,oo=m(()=>{\"use strict\";b();X();$();w();I();ot=class extends E{constructor(){super(...arguments);s(this,\"innerExecutor\",(e,n)=>{let r=n.shadowRoot.querySelectorAll(\"[\".concat(B.id,\"]\")),i=[];r.forEach(a=>{let p=a.getAttribute(B.id);p&&i.push(new Me(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new pe(e.handlerUniqueId,i))});s(this,\"messageType\",l.DetectMyopRefsMessage)}}});var st,so=m(()=>{\"use strict\";I();$();L();st=class extends E{constructor(){super(...arguments);s(this,\"messageType\",l.SetAttributeMessage);s(this,\"innerExecutor\",(e,n)=>{S(e.ref,n.shadowRoot).forEach(i=>{i.setAttribute(e.name,e.value)})})}}});var rt,ro=m(()=>{\"use strict\";I();w();$();L();me();rt=class extends E{constructor(){super(...arguments);s(this,\"messageType\",l.AddEventListenerMessage);s(this,\"innerExecutor\",(e,n,r)=>{let i=S(e.ref,n.shadowRoot),a=[];return i.forEach(p=>{let d=c=>{r(new re(e.handlerUniqueId,P(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var it,io=m(()=>{\"use strict\";I();X();Pe();We();$();it=class extends E{constructor(){super(...arguments);s(this,\"messageType\",l.CreateRefComponentMessage);s(this,\"innerExecutor\",(e,n,r)=>{(async()=>{let a=n.shadowRoot.querySelectorAll(\"[\".concat(B.id,\"='\").concat(e.refConfig.selector,\"']\"));if(a.length===1){let p=F.Instance(),d=p.components.find(u=>u.id===e.options.id);d&&d.dispose();let c=p.components.indexOf(d);c!==-1&&p.components.splice(c,1);let g=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),f=[];Object.keys(g.refs).forEach(u=>{let y=g.refs[u];y=y.__nonProxied||y,y.componentDefinition&&f.push({refName:u,componentDefinitionId:y.componentDefinition.id})}),r(new V(e.handlerUniqueId,f))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new V(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var at,rn=m(()=>{\"use strict\";me();at=(o,t,e)=>{let n=o.scriptInputs?o.scriptInputs:{};n.makeSerializable=P,n.send=t,n.rootRef=e,n.__scriptInputs=n;let i=new Function(\"return (\".concat(o.script,\")(...arguments)\"))(n);t(i)}});var pt,ao=m(()=>{\"use strict\";I();w();$();rn();pt=class extends E{constructor(){super(...arguments);s(this,\"messageType\",l.ExecuteScriptMessage);s(this,\"innerExecutor\",(e,n,r)=>{at(e,a=>{r(new se(e.handlerUniqueId,a))},n)})}}});var po,dt,co=m(()=>{\"use strict\";I();w();$();L();X();me();po=o=>{if(!o)return null;if(o.tagName===\"FORM\"){let t=new FormData(o),e={formData:{},unmappedData:[]},n=o.querySelectorAll(\"input, select, textarea\"),r=-1;return n.forEach(i=>{if(typeof i.value==\"string\"){let a=i.getAttribute(B.id),p=i.getAttribute(\"name\"),d={id:i.id,name:p,value:po(i),required:i.required,validity:P(i.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(d):(e.unmappedData.push(e.formData[p]),e.formData[p]=d):e.formData[p]=d:e.unmappedData.push(d)}}),e}return o.type===\"checkbox\"||o.type===\"radio\"?o.checked?o.value:null:o.tagName===\"INPUT\"||o.tagName===\"TEXTAREA\"||o.tagName===\"SELECT\"?o.value:o.isContentEditable?o.innerText||o.textContent:null},dt=class extends E{constructor(){super(...arguments);s(this,\"messageType\",l.GetElementValueMessage);s(this,\"innerExecutor\",(e,n,r)=>{S(e.ref,n.shadowRoot).forEach(a=>{r(new ie(po(a)),e)})})}}});var ct,mo=m(()=>{\"use strict\";I();$();L();ct=class extends E{constructor(){super(...arguments);s(this,\"messageType\",l.SetInnerHtml);s(this,\"innerExecutor\",(e,n)=>{S(e.ref,n.shadowRoot).forEach(i=>{i.innerHTML=e.content})})}}});var lo={};ee(lo,{WebComponentSDK:()=>Te});var Te,an=m(()=>{\"use strict\";b();I();nn();eo();to();no();oo();te();w();so();ro();io();ao();co();mo();Te=class extends Ie{constructor(){super(...arguments);s(this,\"alwaysPassEnvelopesToHost\",!0);s(this,\"connectedCallback\",(e,n)=>{e.addEventListener(Qe.webcomponent_message_key,r=>{let i=r.data?r.data:r.detail;if(!i||!i.myop){debugger;throw new Error(\"recvied webcomponent_message with wrong type\")}else{let a=i;if(this.handleIncomeMessages(r),a.messageType===l.InitMessage){let p=a.content.id;this.components[p].context=new nt(e,n)}}}),setTimeout(()=>{this.messageToHost(new ae)},1)});s(this,\"messageToHost\",(e,n)=>{e.direction=R.up,!e.replayToHandler&&(n!=null&&n.handlerUniqueId)&&(e.replayToHandler=n.handlerUniqueId),window.myop.hostSDK.send(e)});s(this,\"supportedHandlers\",[new tt(this.messageToHost,this.components),new ct(this.messageToHost,this.components),new et(this.messageToHost,this.components),new ot(this.messageToHost,this.components),new st(this.messageToHost,this.components),new rt(this.messageToHost,this.components),new pt(this.messageToHost,this.components),new dt(this.messageToHost,this.components),new it(this.messageToHost,this.components)]);s(this,\"init\",()=>{})}};z(\"WebComponentSDK\",Te)});var fo=m(()=>{\"use strict\";an()});var go,uo=m(()=>{\"use strict\";go=\"\"});function Ss(o,t){return class extends HTMLElement{connectedCallback(){let e=t===de.open?\"open\":\"closed\",n=this.attachShadow({mode:e});Mo().then(r=>{r.connectedCallback(this,n),n.innerHTML=o})}}}var ho,mt,Mo,Ts,Es,Rs,lt,Io=m(()=>{\"use strict\";on();Ye();ne();b();fo();tn();uo();ho=[],Mo=async()=>(mt||(mt=new Te,mt.init()),mt);Ts=(o,t,e)=>{customElements.define(o,Ss(t,e)),console.log(\"define('\".concat(o,\"') was called, web component ready to use\"))},Es=o=>o.replace(/([a-z])([A-Z])/g,\"$1-$2\").replace(/(\\d+)/g,\"-$1\").toLowerCase(),Rs=o=>(o=Es(o),o.replace(/_/g,\"-\")),lt=class extends Y{constructor(){super(...arguments);s(this,\"type\",q.HTMLLoader);s(this,\"load\",async(e,n,r,i)=>{let a=n.loader,p=\"myop-comp-\".concat(T()),d;if(a.shadowRootMode===de.localFrame){let c=T(),g=\"myop-comp-\".concat(c),f=document.createElement(\"iframe\");f.id=g,f.style.cssText=\"\\n display: block;\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n overflow: hidden;\\n border: none;\\n opacity: \".concat(i!=null&&i.hidden?\"0\":\"1\",\";\\n width: 100%;\\n height: 100%;\\n pointer-events: \").concat(i!=null&&i.hidden?\"none\":\"all\",\";\\n \"),r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),f=this.appendChild(r,f,i);let u=f.contentDocument||f.contentWindow.document;u.open();let y=a.HTML;if(i!=null&&i._inspection){let H=new DOMParser().parseFromString(a.HTML,\"text/html\"),A=H.getElementById(\"myop_preview\");A==null||A.removeAttribute(\"type\");let fe=H.implementation.createHTMLDocument();fe.body.innerHTML=\"<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>\";let Ee=fe.body.firstChild;Ee&&H.head&&H.head.insertBefore(H.importNode(Ee,!0),H.head.firstChild),y=H.documentElement.outerHTML}else{let H=new DOMParser().parseFromString(a.HTML,\"text/html\"),A=H.getElementById(\"myop_preview\");A&&(A.remove(),y=H.documentElement.outerHTML)}u.writeln(y);let M='<script src=\"'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'\"><\\/script>'),le=\"<script>\\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\\n const __myop_init = async () => {\\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\\n const sdk = new IframeSDK();\\n sdk.init();\\n }\\n __myop_init().then();\\n <\\/script>\";if(u.writeln(\"\".concat(M).concat(le)),(i==null?void 0:i.data)!==void 0){let j=\"<script>\\n window.__myop_cta_queue = [];\\n window.myop_cta_handler = function(action, payload) {\\n window.__myop_cta_queue.push({action: action, payload: payload});\\n };\\n <\\/script>\",H=JSON.stringify(i.data).replace(/<\\/script/gi,\"\\\\u003c/script\"),A='<script id=\"__myop_init_data_script\">\\n (function() {\\n var data = '.concat(H,\";\\n var scriptEl = document.getElementById('__myop_init_data_script');\\n\\n var callInitInterface = function(fn) {\\n var startTime = performance.now();\\n // Mark as pre-injected data call for extension tracking\\n window.__myop_init_preinjected = true;\\n try {\\n fn(data);\\n } finally {\\n window.__myop_init_preinjected = false;\\n }\\n var duration = performance.now() - startTime;\\n\\n // Notify extension via postMessage (init* = pre-injected)\\n try {\\n window.parent.postMessage({\\n type: 'MYOP_PREINJECTED_INIT',\\n payload: {\\n data: data,\\n duration: duration,\\n timestamp: Date.now()\\n }\\n }, '*');\\n } catch (e) {}\\n\\n // Cleanup: remove script tag and stored data\\n if (scriptEl && scriptEl.parentNode) {\\n scriptEl.parentNode.removeChild(scriptEl);\\n }\\n delete window.__myop_init_data;\\n };\\n\\n if (typeof window.myop_init_interface === 'function') {\\n // Function already exists - call immediately\\n callInitInterface(window.myop_init_interface);\\n } else {\\n // Function not yet defined - store data and watch for definition\\n window.__myop_init_data = data;\\n\\n var _original;\\n Object.defineProperty(window, 'myop_init_interface', {\\n configurable: true,\\n enumerable: true,\\n set: function(fn) {\\n _original = fn;\\n if (window.__myop_init_data !== undefined) {\\n var storedData = window.__myop_init_data;\\n delete window.__myop_init_data;\\n callInitInterface(fn);\\n }\\n },\\n get: function() {\\n return _original;\\n }\\n });\\n }\\n })();\\n <\\/script>\");u.writeln(j+A)}u.close();let Fe=new be(e,n,r,f,i);return a.autoHeight&&(f.onload=()=>{Fe.observeSizeBasedOnDocumentElement()}),Fe}if(a.shadowRootMode===de.none){let c=document.createElement(\"template\");c.innerHTML=a.HTML,d=c.content.firstElementChild,Mo().then(g=>{g.connectedCallback(d,d)})}else{let c=Rs(e.name+n.id);ho.includes(c)||(Ts(c,a.HTML,a.shadowRootMode),ho.push(c)),d=document.createElement(c)}return r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),d.id=p,i!=null&&i.hidden&&(d.style.opacity=\"0\",d.style.position=\"absolute\",d.style.height=\"0\",d.style.width=\"0\",d.style.pointerEvents=\"none\",d.style.visibility=\"hidden\"),this.appendChild(r,d,i),new Se(e,n,r,d,i)})}}});var Co,xo,wo=m(()=>{\"use strict\";ne();w();Co=(o,t,e)=>{let n=\"myop-css-\".concat(T());return o.send(new D(({rootRef:r,_stylesheet:i,_tagId:a,_css:p})=>{let d=document.createElement(\"style\");d.type=\"text/css\";let c=p;for(let g in i){c+=\"\".concat(g,\" { \");let f=i[g];for(let u in f)c+=\"\".concat(u,\": \").concat(f[u],\"; \");c+=\"} \"}d.appendChild(document.createTextNode(c)),d.id=a,(r.shadowRoot||r.container).appendChild(d)},()=>{},{_stylesheet:t,_css:e||\"\",_tagId:n})),()=>{o.send(new D(({rootRef:r,_tagId:i})=>{let a=(r.shadowRoot||document).getElementById(i);a&&a.remove()},()=>{},{_tagId:n}))}},xo=(o,t)=>{let e=\"myop-css-\".concat(T());return o.send(new D(({rootRef:n,_tagId:r,_link:i})=>{let a=document.createElement(\"link\");a.id=r,a.rel=\"stylesheet\",a.href=i,document.head.appendChild(a),(n.shadowRoot||n.container).appendChild(a)},()=>{},{_link:t,_tagId:e})),()=>{o.send(new D(({rootRef:n,_tagId:r})=>{let i=(n.shadowRoot||document).getElementById(r);i&&i.remove()},()=>{},{_tagId:e}))}}});var vs,pn,bo,So=m(()=>{\"use strict\";vs=(o,t)=>{let e=new RegExp(Object.keys(t).join(\"|\"),\"g\");return o.replace(e,n=>(t[n]||n).toString())},pn=(o,t)=>{let e=o.loader;if(e.type!==\"IframeLoader\")throw new Error('iframeSkinUrlTokenizer received skin with loader type \"'.concat(e.type,'\", currently only \"IframeLoader\" is supported'));return o.loader=h({},o.loader),o.loader.url=vs(o.loader.url,t),o},bo=o=>async t=>pn(t,o)});var To,Eo,Ro=m(()=>{\"use strict\";w();To=(o,t,e)=>{o.send(new W(({ref:n,_className:r})=>{n==null||n.classList.add(r)},{elementId:e,_className:t}))},Eo=(o,t,e)=>{o.send(new W(({ref:n,_className:r})=>{n==null||n.classList.remove(r)},{elementId:e,_className:t}))}});var ut,ft,yt,gt,vo=m(()=>{\"use strict\";ne();ut=class ut{constructor(){s(this,\"_runTimeInstanceId\",\"runtime-instance-id-\"+T());s(this,\"_runTimeId\",\"runtime-id-\"+T());s(this,\"_runTimeName\",\"runtime-name-\"+T());s(this,\"id\",this._runTimeId);s(this,\"name\",this._runTimeName);s(this,\"description\",\"\");s(this,\"loader\",null);s(this,\"withLoader\",t=>(this.loader=t,this));s(this,\"withHTMLLoader\",t=>(t.type=\"HTMLLoader\",this.loader=t,this));s(this,\"build\",()=>this)}};s(ut,\"create\",()=>new ut);ft=ut,yt=class yt{constructor(){s(this,\"_runTimeInstanceId\",\"runtime-instance-id-\"+T());s(this,\"_runTimeId\",\"runtime-id-\"+T());s(this,\"_runTimeName\",\"runtime-name-\"+T());s(this,\"instance\",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});s(this,\"name\",this._runTimeName);s(this,\"type\",{id:this._runTimeId,name:this._runTimeName,description:\"\",props:[],refs:[],skins:[],defaultSkin:0});s(this,\"withInstance\",t=>(this.instance=t,this));s(this,\"withType\",t=>(this.type=t,this));s(this,\"withName\",t=>(this.name=t,this));s(this,\"withDefaultSkin\",t=>(this.type.skins.push(t),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:\"Dedicated\",skin:{id:t.id}},this));s(this,\"withRef\",t=>(this.type.refs.push(t),this));s(this,\"withBasicRef\",t=>{let e={id:\"\",name:t,description:\"\",selectorType:\"id-attribute\",selector:t,behavior:{type:\"code\"}};return this.type.refs.push(e),this});s(this,\"build\",()=>JSON.parse(JSON.stringify(this)))}};s(yt,\"create\",()=>new yt);gt=yt});var _s,ht,ks,Hs,Q,Z,_o,ko=m(()=>{\"use strict\";b();_s=o=>({instance:{id:\"auto\",componentId:o.componentId,componentName:o.name,skinSelector:{type:\"Dedicated\",skin:{id:\"skin_auto_v2_converted\"}}},type:{id:o.id,name:o.name,description:o.description,props:[{id:\"in_auto_v2_converted\",name:\"myop_init_interface\",type:\"any\",behavior:{type:we.code}},{id:\"out_auto_v2_converted\",name:\"myop_cta_handler\",type:\"any\",behavior:{type:we.code}}],refs:[],skins:[{id:\"skin_auto_v2_converted\",name:\"auto_v2_converted\",description:\"\",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),ht=\"__MYOP_CLOUD_REPOSITORY_MAIN__\",ks=()=>{if(typeof window<\"u\")return window[ht];if(typeof globalThis<\"u\")return globalThis[ht]},Hs=o=>{typeof window<\"u\"&&(window[ht]=o),typeof globalThis<\"u\"&&(globalThis[ht]=o)},Q=class Q{constructor(t=\"https://cloud.myop.dev\"){this._baseUrl=t;s(this,\"variants\",{});s(this,\"preloadedComponents\",{});s(this,\"userFlows\",{});s(this,\"_defaultEnv\",\"production\")}static get Main(){let t=ks();return t||(Q._main||(Q._main=new Q,Hs(Q._main)),Q._main)}setEnvironment(t){this._defaultEnv=t}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(t,e,n){return e!==void 0||n!==void 0?\"\".concat(t,\":\").concat(e||this._defaultEnv,\":\").concat(n?\"preview\":\"live\")in this.variants:t in this.preloadedComponents}getPreloadedParams(t){return this.preloadedComponents[t]}async fetchComponentV2(t,e,n){let r=this.preloadedComponents[t],i=e!==void 0||n!==void 0,a,p;!i&&r?(a=r.env,p=r.preview):(a=e||this._defaultEnv,p=n===!0?!0:n===!1?!1:!e);let d=\"\".concat(t,\":\").concat(a,\":\").concat(p?\"preview\":\"live\");return console.log(\"[CloudRepository] fetchComponentV2\",{componentId:t.slice(0,8)+\"...\",env:a,usePreview:p,cacheKey:d,cached:d in this.variants}),this.variants[d]||(this.preloadedComponents[t]||(this.preloadedComponents[t]={env:a,preview:p}),this.variants[d]=new Promise(async(c,g)=>{try{let f=\"\".concat(this._baseUrl,\"/consume?id=\").concat(t,\"&env=\").concat(a);p&&(f+=\"&preview=true\");let M=(await(await fetch(f)).json()).item;if(!M){g(new Error('Component \"'.concat(t,'\" not found')));return}if(!M.consume_variant||!M.consume_variant.length){g(new Error('Component \"'.concat(t,'\" has no implementation for environment \"').concat(a,'\"')));return}let le=_s(M);c(le)}catch(f){g(f)}})),await this.variants[d]}async fetchComponentV1(t,e){return e?(await this.fetchFlow(e)).components.find(r=>r.type.id===t):(await this.fetchAutoFlow(t)).components[0]}async fetchAutoFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,n)=>{try{let i=await(await fetch(\"\".concat(this._baseUrl,\"/flow?id=\").concat(t,\"&auto=true\"))).json();e(i.item)}catch(r){n(r)}})),await this.userFlows[t]}async fetchFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,n)=>{try{let i=await(await fetch(\"\".concat(this._baseUrl,\"/flow?id=\").concat(t,\"&resolve=components\"))).json();e(i.item)}catch(r){n(r)}})),await this.userFlows[t]}async fetchComponent(t,e){return this.fetchComponentV1(t,e)}};s(Q,\"_main\",null);Z=Q,_o=Z});var Ho,Do=m(()=>{\"use strict\";Ho=async o=>await o()});var dn={};ee(dn,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ft,addClass:()=>To,applyStylesheet:()=>Co,applyStylesheetLink:()=>xo,changeSkinUrlByTokenizer:()=>bo,createIframeSkinByTokenizer:()=>pn,exec:()=>Ho,removeClass:()=>Eo,v2_CloudRepository:()=>_o});var Mt=m(()=>{\"use strict\";wo();So();Ro();vo();ko();Do()});var Bo,Lo=m(()=>{\"use strict\";Ot();Mt();b();Bo=async o=>{try{let t=new URL(window.location.href),n=new URLSearchParams(t.search).get(\"myopOverride\");if(n){let[r,...i]=Lt(n);switch(r){case\"component\":{let[a,p]=i,d=await Z.Main.fetchComponent(a);if(d&&d.type.skins.find(g=>g.id===p))return d.instance.skinSelector={type:ce.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=Lt(n),c=(await Z.Main.fetchFlow(a)).components.find(g=>g.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ce.Segmented&&c.instance.resolvedExperiences){let g=c.instance.resolvedExperiences.find(f=>f.id===p);if((g==null?void 0:g.type)===je.Segment){let f=g,y=c.instance.skinSelector.segments.find(M=>M.segmentId===f.segment.id);if(y)return c.instance.skinSelector=y==null?void 0:y.skinSelector,c}}}break}}}finally{return null}}});var Ko={};ee(Ko,{HostSDK:()=>F,hostSDK:()=>Po});var Oo,F,Po,Pe=m(()=>{\"use strict\";te();I();w();Xn();Qn();Je();b();Ne();Io();Lo();Oo=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",F=class{constructor(){s(this,\"components2init\",[]);s(this,\"components\",[]);s(this,\"componentsLoaders\",[]);s(this,\"initiated\",!1);s(this,\"version\",ue);s(this,\"type2InstanceCount\",{});s(this,\"assignId\",t=>(this.type2InstanceCount[t.id]||(this.type2InstanceCount[t.id]=0),\"\".concat(t.id,\"_\").concat(++this.type2InstanceCount[t.id])));s(this,\"inspected\",!1);s(this,\"inspect\",()=>{this.inspected||(this.inspected=!0,this.components.forEach(t=>{t.inspect&&t.inspect()}))});s(this,\"incomingMessageHandler\",t=>{if(t.origin,document.location.origin,t.data.myop){if(t.data.direction!==R.up&&t.data.messageType!==l.EnvelopedMessage)return;let e=t.data;if(e.messageType===l.InitRequest){this.components2init.forEach(r=>{r.send(new ye(r.id))});return}if(e.messageType===l.InitResponse){this.components2init=this.components2init.filter(i=>i.id!==e.content.id);let r=this.components.find(i=>{var a;return i.id===((a=e.content)==null?void 0:a.id)});r==null||r.setInitiated();return}if(e.messageType===l.EnvelopedMessage){let r=e,i=this.components.find(a=>a.id===r.destination);if(i){if(r.direction===R.down){r.message.messageType===K.name?i.onMessageReceived(r.message):(r.message.route=r.route,i.send(r.message));return}}else{let a=this.components.find(p=>p.id===r.message.destination);a&&a.send(r.message)}return}let n=this.components.find(r=>r.id===e.destination);if(!n){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(n){if(n.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});s(this,\"send\",t=>{let e=new MessageEvent(\"\",{data:t});this.incomingMessageHandler(e)});s(this,\"init\",t=>{if(this.initiated)throw new Error(\"hostSDK already initiated\");let e=[new Xe,new Ze,new lt];if(this.componentsLoaders=[...e],t){let n={};t.forEach(r=>{let i=new r(this.componentsLoaders);n[i.type]=i}),this.componentsLoaders.forEach(r=>{n[r.type]||(n[r.type]=r)}),this.componentsLoaders=Object.values(n)}window.addEventListener(\"message\",this.incomingMessageHandler,!1),console.log(\"myop hostSDK initiated\",document.location.href),this.initiated=!0});s(this,\"_getSkinIdBySkinSelector\",async(t,e=[],n)=>{var i;async function r(a,p){for(let d of a)if(await p(d))return d}switch(t.type){case\"DedicatedSkin\":case ce.Dedicated:return((i=t.skin)==null?void 0:i.id)||t.skins[0].id;case ce.Segmented:{let p=await r(t.segments,async d=>{if(d.segmentId===\"Default\")return!0;let c=e.find(y=>y.type===je.Segment?y.segment.id===d.segmentId:!1);if(!c)throw new Error(\"experience not found\");let f=c.segment,u=(n||{})[f.function];return u?await u():(console.warn(\"segmentId:\".concat(d.segmentId,\", \").concat(f.function,\" function not provided !\")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return\"\"});s(this,\"runSkinSelector\",async(t,e)=>{let n=await this._getSkinIdBySkinSelector(t.instance.skinSelector,t.instance.resolvedExperiences,e);return t.type.skins.find(r=>r.id===n)});s(this,\"loaderHooks\");s(this,\"loadComponent\",async(t,e,n)=>{var g,f,u,y;if(!e){debugger;throw new Error(\"no container was found for this component\")}let r=await Bo(t);r&&(t=r);let i=h(h({},(g=this.loaderHooks)!=null?g:{}),(f=n==null?void 0:n.hooks)!=null?f:{}),a=e;if(a.myop)if(a.component){t=h({},t),t.instance=h({},t.instance);let M=await this.runSkinSelector(t,i);if(!M)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");return(u=n==null?void 0:n.hooks)!=null&&u.afterSkinSelected&&(M=await n.hooks.afterSkinSelected(h({},M))),t.instance.skinSelector={type:ce.Dedicated,skin:M},n&&(n=h({},n),delete n.hooks),await Zt(a,t,this.components,n)}else throw new Error(\"load component got a detached ref.\");e=e;let p=await this.runSkinSelector(t,i);if(!p)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");(y=n==null?void 0:n.hooks)!=null&&y.afterSkinSelected&&(p=await n.hooks.afterSkinSelected(h({},p)));let d=this.componentsLoaders.find(M=>M.type===p.loader.type);if(!d){debugger;throw new Error('no loader \"'.concat(p.loader.type,'\" was found for component'))}let c=await d.load(t.type,p,e,n);c.isInitiated||this.components2init.push(c),c.bind(\"onDispose\",()=>(this.components=this.components.filter(M=>M!==c),this.components2init=this.components2init.filter(M=>M!==c),!0)),this.components.push(c),(!n||n.connectProps!==!1)&&(c=Yn(c,t.type.props,p));try{await en(c,t,this.components)}catch(M){throw M}return n!=null&&n.skipInit||await c.initiated(),c});s(this,\"navigate\",async(t,e,n)=>{if(t.parent)throw new Error(\"Navigating on remote ref components is not implemented yet\");if(n!=null&&n.staged){let r=await this.loadComponent(e,t.container,h({hidden:!0,relative:{direction:\"after\",child:t.element}},n));return n.init&&await n.init(r),r.show(),t.dispose(),r}else{let r=t.element.nextSibling;return t.dispose(),this.loadComponent(e,t.container,h({relative:{direction:\"before\",child:r}},n))}})}};s(F,\"Instance\",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Oo});if(!window.myop.hostSDK){let o=new F;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Oo}),window.myop.hostSDK=o}Po=window.myop.hostSDK;z(\"hostSDK\",Po)});var It,Ao=m(()=>{\"use strict\";I();X();b();w();It=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.DetectMyopRefsMessage);s(this,\"executor\",e=>{let n=document.querySelectorAll(\"[\".concat(B.id,\"]\")),r=[];n.forEach(i=>{let a=i.getAttribute(B.id);a&&r.push(new Me(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new pe(e.handlerUniqueId,r))})}}});var Ct,Fo=m(()=>{\"use strict\";I();b();w();L();Ct=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.BindClickMessage);s(this,\"executor\",e=>{let n=[];return S(e.ref,document).forEach(i=>{let a=()=>{this.messageToHost(new oe,e)};i.addEventListener(\"click\",a);let p=()=>{i.removeEventListener(\"click\",a)};n.push(p)}),()=>{n.forEach(i=>i())}})}}});var xt,zo=m(()=>{\"use strict\";I();b();L();xt=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.ChangeTextMessage);s(this,\"executor\",e=>{S(e.ref,document).forEach(r=>{r.textContent=e.content})})}}});var wt,$o=m(()=>{\"use strict\";I();w();b();rn();wt=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.ExecuteScriptMessage);s(this,\"executor\",e=>{at(e,r=>{this.messageToHost(new se(e.handlerUniqueId,r))},new xe(document.documentElement))})}}});var bt,Uo=m(()=>{\"use strict\";I();b();w();me();L();bt=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.AddEventListenerMessage);s(this,\"executor\",e=>{let n=S(e.ref,document),r=[];return n.forEach(i=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new re(e.handlerUniqueId,P(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),r.push(()=>{i.removeEventListener(e.type,a)})}),()=>{r.forEach(i=>{i()})}})}}});var St,No=m(()=>{\"use strict\";I();b();L();St=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.SetAttributeMessage);s(this,\"executor\",e=>{S(e.ref,document).forEach(r=>{r.setAttribute(e.name,e.value)})})}}});var Tt,Wo=m(()=>{\"use strict\";I();X();b();Pe();We();Tt=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.CreateRefComponentMessage);s(this,\"executor\",e=>{(async()=>{let r=document.querySelectorAll(\"[\".concat(B.id,\"='\").concat(e.refConfig.selector,\"']\"));if(r.length===1){let a=await F.Instance().loadComponent(e.nestedComponentConfig,r.item(0),e.options),p=[];Object.keys(a.refs).forEach(d=>{let c=a.refs[d];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:d,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new V(e.handlerUniqueId,p))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new V(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var Vo,qo=m(()=>{\"use strict\";Vo=(o,t)=>{if(!o){console.log(\"n\");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!o||o.nodeType!==1))if(e){let n=new e(t),r={attributes:!0,childList:!0,subtree:!0};return n.observe(o,r),n}else window.addEventListener&&(o.addEventListener(\"DOMNodeInserted\",t,!1),o.addEventListener(\"DOMNodeRemoved\",t,!1))}});var Et,jo=m(()=>{\"use strict\";I();w();b();qo();Et=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.SetMutationObserverMessage);s(this,\"executor\",e=>{e.source&&Vo(document.body,()=>{this.messageToHost(new He)})})}}});var Go,Rt,Jo=m(()=>{\"use strict\";I();X();b();w();me();L();Go=o=>{if(!o)return null;if(o.tagName===\"FORM\"){let t=new FormData(o),e={formData:{},unmappedData:[]},n=o.querySelectorAll(\"input, select, textarea\"),r=-1;return n.forEach(i=>{if(typeof i.value==\"string\"){let a=i.getAttribute(B.id),p=i.getAttribute(\"name\"),d={id:i.id,name:p,value:Go(i),required:i.required,validity:P(i.validity,!0),myopId:a};e.unmappedData.push(d),p&&(!e.formData[p]||!e.formData[p].value||d.value)&&(e.formData[p]=d)}}),e}return o.type===\"checkbox\"||o.type===\"radio\"?o.checked?o.value:null:o.tagName===\"INPUT\"||o.tagName===\"TEXTAREA\"||o.tagName===\"SELECT\"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Rt=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.GetElementValueMessage);s(this,\"executor\",e=>{S(e.ref,document).forEach(r=>{this.messageToHost(new ie(Go(r)),e)})})}}});var vt,Yo=m(()=>{\"use strict\";I();b();w();L();vt=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.GetAttributeMessage);s(this,\"executor\",e=>{let n=Zn(e.ref,document);n&&this.messageToHost(new ke(n.getAttribute(e.name)),e)})}}});var _t,Xo=m(()=>{\"use strict\";w();I();b();_t=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.SetResizeObserverMessage);s(this,\"executor\",e=>{let n=new ResizeObserver(r=>{this.messageToHost(new Oe)});return n.observe(document.body),()=>{n.disconnect()}})}}});var kt,Qo=m(()=>{\"use strict\";I();b();L();kt=class extends x{constructor(){super(...arguments);s(this,\"messageType\",l.SetInnerHtml);s(this,\"executor\",e=>{S(e.ref,document).forEach(r=>{r.innerHTML=e.content})})}}});var Zo={};ee(Zo,{IframeSDK:()=>Ht});var Ht,es=m(()=>{\"use strict\";b();Ao();Fo();zo();$o();te();Uo();No();w();Wo();jo();Jo();Ne();Yo();Xo();Qo();Ht=class extends Ie{constructor(){super();s(this,\"version\",ue);s(this,\"messageToHost\",(e,n)=>{var i;!e.replayToHandler&&(n!=null&&n.handlerUniqueId)&&(e.replayToHandler=n.handlerUniqueId);let r=Object.keys(this.components);e.destination||(n!=null&&n.route?e.destination=n.route[n.route.length-1]:e.destination=r[0]),e.source||(e.source=r[0]),e.direction=R.up,(i=window.parent)==null||i.postMessage(h({},e),\"*\")});s(this,\"supportedHandlers\",[new xt(this.messageToHost),new kt(this.messageToHost),new Ct(this.messageToHost),new It(this.messageToHost),new wt(this.messageToHost),new bt(this.messageToHost),new St(this.messageToHost),new Rt(this.messageToHost),new Et(this.messageToHost),new _t(this.messageToHost),new vt(this.messageToHost),new Tt(this.messageToHost)]);s(this,\"init\",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new ae)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};z(\"IframeSDK\",Ht)});var Bs={};var Ds,ts=m(()=>{\"use strict\";w();te();Ds=h({},he);z(\"MyopMessages\",Ds)});var ns={};ee(ns,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ft,addClass:()=>To,applyStylesheet:()=>Co,applyStylesheetLink:()=>xo,changeSkinUrlByTokenizer:()=>bo,createIframeSkinByTokenizer:()=>pn,exec:()=>Ho,removeClass:()=>Eo,v2_CloudRepository:()=>_o});var os=m(()=>{\"use strict\";te();Mt();Mt();z(\"MyopHelpers\",dn)});var As={};ee(As,{getHostModule:()=>ss,getIframeModule:()=>rs,getWebcomponentModule:()=>is});te();var yn;if(window.__federation__)console.log(\"__federation__ loaded more than once.\");else{let o=(yn=document.currentScript)==null?void 0:yn.src,t=o?o.split(\"/\").slice(0,-1).join(\"/\"):\"\";window.__federation__={__public_auto_path__:t,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(o,t,e)=>{if(window.__federation__[t])console.log(\"__federation__ module \".concat(t,\" already loaded.\")),e(window.__federation__[t][Bt]);else{let n;window.__federation__[t]={},window.__federation__[t][Ue]=r=>{n&&(document.head.removeChild(n),n=null),window.__federation__[t][Bt]=r,e(r)},n=document.createElement(\"script\"),n.type=\"module\",n.src=o,n.async=!0,document.head.appendChild(n)}};Ne();console.log(\"myop root sdk - loaded\",document.location.origin);var Ls=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",ss=()=>Promise.resolve().then(()=>(Pe(),Ko)),rs=()=>Promise.resolve().then(()=>(es(),Zo)),is=()=>Promise.resolve().then(()=>(an(),lo)),Os=()=>Promise.resolve().then(()=>(ts(),Bs)),Ps=()=>Promise.resolve().then(()=>(os(),ns)),Ae=o=>async()=>(await o()).get(),Ks={version:ue,getHostModule:Ae(ss),getIframeModule:Ae(rs),getWebcomponentModule:Ae(is),getMyopMessages:Ae(Os),getMyopHelpers:Ae(Ps)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ls});window.myop.rootSDK?console.log(\"myop root host loaded more than once.\"):window.myop=h({rootSDK:Ks},window.myop);return us(As);})();\n</script>\n </head>\n <body>\n <div id=\"myop-container\"></div>\n <script>\n // Initialize hostSDK on page load\n (async function initSDK() {\n try {\n // Use the internal getHostModule which returns the module directly\n const hostModule = await MyopSDK.getHostModule();\n // hostModule is the exports object with { hostSDK, HostSDK }\n window.__myopHostSDK = hostModule.hostSDK || window.myop.hostSDK;\n window.ReactNativeWebView.postMessage('WEBVIEW_READY');\n } catch (err) {\n window.ReactNativeWebView.postMessage('SDK_INIT_ERROR:' + err.message);\n }\n })();\n\n async function loadMyopComponent(configAsString) {\n try {\n const componentConfig = JSON.parse(decodeURIComponent(configAsString));\n const container = document.getElementById('myop-container');\n window.myopComponent = await window.__myopHostSDK.loadComponent(componentConfig, container);\n\n // Set up myop_cta_handler to forward calls to React Native\n if (window.myopComponent && window.myopComponent.element && window.myopComponent.element.contentWindow) {\n window.myopComponent.element.contentWindow.myop_cta_handler = function(action, payload) {\n window.ReactNativeWebView.postMessage('CTA:' + JSON.stringify({ action: action, payload: payload }));\n };\n }\n\n window.ReactNativeWebView.postMessage('COMPONENT_LOADED');\n } catch (err) {\n window.ReactNativeWebView.postMessage('COMPONENT_ERROR:' + err.message);\n }\n }\n </script>\n </body>\n</html>\n";
1
+ export declare const HTML = "\n<!DOCTYPE html>\n<html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <style>\n html, body {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-family: sans-serif;\n }\n #myop-container {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n }\n </style>\n <script>\"use strict\";var MyopSDK=(()=>{var Ue=Object.defineProperty,ls=Object.defineProperties,fs=Object.getOwnPropertyDescriptor,us=Object.getOwnPropertyDescriptors,gs=Object.getOwnPropertyNames,yn=Object.getOwnPropertySymbols;var hn=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable;var Bt=(o,n,e)=>n in o?Ue(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e,h=(o,n)=>{for(var e in n||(n={}))hn.call(n,e)&&Bt(o,e,n[e]);if(yn)for(var e of yn(n))ys.call(n,e)&&Bt(o,e,n[e]);return o},U=(o,n)=>ls(o,us(n));var m=(o,n)=>()=>(o&&(n=o(o=0)),n);var ee=(o,n)=>{for(var e in n)Ue(o,e,{get:n[e],enumerable:!0})},hs=(o,n,e,t)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let s of gs(n))!hn.call(o,s)&&s!==e&&Ue(o,s,{get:()=>n[s],enumerable:!(t=fs(n,s))||t.enumerable});return o};var Ms=o=>hs(Ue({},\"__esModule\",{value:!0}),o);var r=(o,n,e)=>Bt(o,typeof n!=\"symbol\"?n+\"\":n,e);var qe,Ve,Lt,F,te=m(()=>{\"use strict\";qe=\"__federation__\",Ve=\"onLoad\",Lt=\"moduleInstance\",F=(o,n)=>{window[qe]&&window[qe][o]&&window[qe][o][Ve]&&window[qe][o][Ve]({[o]:n})}});var ye,je=m(()=>{ye=\"0.3.17\"});var f,I=m(()=>{\"use strict\";f={InitRequest:\"InitRequest\",InitResponse:\"InitResponse\",InitMessage:\"InitMessage\",DisposeMessage:\"DisposeMessage\",ChangeTextMessage:\"ChangeTextMessage\",BindClickMessage:\"BindClickMessage\",DetectMyopRefsMessage:\"DetectMyopRefsMessage\",ExecuteScriptMessage:\"ExecuteScriptMessage\",AddEventListenerMessage:\"AddEventListenerMessage\",SetAttributeMessage:\"SetAttributeMessage\",CreateRefComponentMessage:\"CreateRefComponentMessage\",EnvelopedMessage:\"EnvelopedMessage\",GetElementValueMessage:\"GetElementValueMessage\",GetAttributeMessage:\"GetAttributeMessage\",SetInnerHtml:\"SetInnerHtml\",ExecuteComponentMethod:\"ExecuteComponentMethod\",SetMutationObserverMessage:\"SetMutationObserverMessage\",SetResizeObserverMessage:\"SetResizeObserverMessage\",CleanupMessage:\"CleanupMessage\",In:{DetectedMyopRefsMessage:\"DetectedMyopRefsMessage\",ClickReplayMessage:\"ClickReplayMessage\",ExecuteScriptReplyMessage:\"ExecuteScriptReplyMessage\",EventListenerCallbackMessage:\"EventListenerCallbackMessage\",ElementValueReplayMessage:\"ElementValueReplayMessage\",GetAttributeReplayMessage:\"GetAttributeReplayMessage\",RefComponentCreatedMessage:\"RefComponentCreatedMessage\",EnvelopedMessage:\"EnvelopedMessage\",MutationObserverMessage:\"MutationObserverMessage\",CleanupReplayMessage:\"CleanupReplayMessage\",ResizeObserverMessage:\"ResizeObserverMessage\"}}});var E,Is,Cs,Pt,Ot=m(()=>{\"use strict\";E=()=>\"10000000-1000-4000-8000-100000000000\".replace(/[018]/g,o=>(+o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+o/4).toString(16)),Is=o=>{let n=[...o].map(e=>e.toString(16).padStart(2,\"0\")).join(\"\");return[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20)].join(\"-\")},Cs=o=>{let n=o.replace(/-/g,\"+\").replace(/_/g,\"/\");for(;n.length%4;)n+=\"=\";let e=atob(n);return Uint8Array.from(e,t=>t.charCodeAt(0))},Pt=o=>{let n=Cs(o);if(n.length%16!==0)throw new Error(\"Invalid input length\");let e=[];for(let t=0;t<n.length;t+=16)e.push(Is(n.slice(t,t+16)));return e}});var In,ne=m(()=>{\"use strict\";Ot();In=o=>new Promise(n=>setTimeout(n,o))});var v,C,At,R,_,Y,k=m(()=>{\"use strict\";ne();v=class{};r(v,\"down\",\"down\"),r(v,\"up\",\"up\");C=class{constructor(){r(this,\"id\",E());r(this,\"myop\",!0);r(this,\"content\");r(this,\"source\");r(this,\"destination\");r(this,\"route\");r(this,\"ref\");r(this,\"direction\");r(this,\"cleanable\",!1)}static create(...n){return new this(...n)}isTypeof(n){return n.messageType===this.messageType}},At=class extends C{constructor(e){super();this.ref=e}},R=class extends C{constructor(e){super();this.replayToHandler=e}},_=class extends C{constructor(e){super();this.handler=e;r(this,\"handlerUniqueId\",E())}},Y=class o{constructor(n,e){this.refConfig=n;this.component=e;r(this,\"myop\",!0);r(this,\"__nonProxied\");this.__nonProxied=U(h({},this),{component:null})}static create(n,e,t){let s=e;return s||(s={id:\"\",name:\"\",description:\"\",selectorType:\"id-attribute\",selector:n,behavior:{type:\"code\"}}),new o(s,t)}}});var Cn,Kt,oe,xn=m(()=>{\"use strict\";k();Cn=\"ClickReplayMessage\",Kt=class extends _{constructor(e,t){super(t);this.ref=e;r(this,\"replyMessageKey\",Cn);r(this,\"messageType\",\"BindClickMessage\");r(this,\"cleanable\",!0)}},oe=class extends R{constructor(){super(...arguments);r(this,\"messageType\",Cn)}}});var $t,wn=m(()=>{\"use strict\";k();$t=class extends C{constructor(e,t){super();this.ref=e;r(this,\"messageType\",\"ChangeTextMessage\");this.content=t}}});var bn,xs,ws,Sn,D,se,Ft=m(()=>{\"use strict\";k();bn=\"ExecuteScriptReplyMessage\",xs=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,ws=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,Sn=o=>{let n=o.match(xs);if(n)return n[1]||n[3];{let e=o.match(ws);if(e)return e[1].trim()}},D=class extends _{constructor(e,t=()=>{},s){super(t);this.scriptInputs=s;r(this,\"replyMessageKey\",bn);r(this,\"messageType\",\"ExecuteScriptMessage\");r(this,\"script\",\"\");this.script=e.toString(),this.content=e.toString(),this.content=Sn(this.content)}};r(D,\"replierKey\",\"send\"),r(D,\"completeStreamKey\",\"completeStream\");se=class extends R{constructor(e,t){super(e);this.replayToHandler=e;this.content=t;r(this,\"messageType\",bn)}}});var q,En=m(()=>{\"use strict\";Ft();q=class extends D{constructor(e,t,s=()=>{}){super(({rootRef:i,elementId:a,_script:p,__scriptInputs:d})=>{let c=(i.shadowRoot||i.container).querySelectorAll(\"[myop-id='\".concat(a,\"']\"));return c.length?(d.ref=c[0],new Function(\"return (\".concat(p,\")(...arguments)\"))(d)):null},s);this.scriptInputs=t;this.scriptInputs=U(h({},t),{_script:e.toString()})}}});var Tn,zt,re,vn=m(()=>{\"use strict\";k();Tn=\"EventListenerCallbackMessage\",zt=class extends _{constructor(e,t,s){super(s);this.ref=e;this.type=t;this.handler=s;r(this,\"replyMessageKey\",Tn);r(this,\"messageType\",\"AddEventListenerMessage\");r(this,\"cleanable\",!0);r(this,\"serializableSkeleton\",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},re=class extends R{constructor(e,t){super(e);this.replayToHandler=e;this.e=t;r(this,\"messageType\",Tn);this.content={e:t}}}});var Wt,Rn=m(()=>{\"use strict\";k();Wt=class extends C{constructor(e,t,s){super();this.ref=e;this.name=t;this.value=s;r(this,\"messageType\",\"SetAttributeMessage\")}}});var _n,Nt,ie,Ut=m(()=>{\"use strict\";k();_n=\"ElementValueReplayMessage\",Nt=class extends _{constructor(e,t){super(t);this.ref=e;r(this,\"replyMessageKey\",_n);r(this,\"messageType\",\"GetElementValueMessage\")}},ie=class extends R{constructor(e){super();this.content=e;r(this,\"messageType\",_n)}}});var qt,kn=m(()=>{\"use strict\";k();qt=class extends C{constructor(e,t){super();this.ref=e;r(this,\"messageType\",\"SetInnerHtml\");this.content=t}}});var he,_e,ae,Hn=m(()=>{\"use strict\";k();he=class extends C{constructor(e){super();r(this,\"messageType\",\"InitMessage\");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},_e=class extends he{constructor(){super(...arguments);r(this,\"messageType\",\"InitResponse\")}},ae=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"InitRequest\")}}});var Dn,ke,V,Ge=m(()=>{\"use strict\";k();Dn=\"RefComponentCreatedMessage\",ke=class extends _{constructor(e,t,s,i){super(i);this.refConfig=e;this.nestedComponentConfig=t;this.options=s;r(this,\"replyMessageKey\",Dn);r(this,\"messageType\",\"CreateRefComponentMessage\")}},V=class extends R{constructor(e,t,s){super(e);this.replayToHandler=e;this.nestedRefs=t;this.failed=s;r(this,\"messageType\",Dn)}}});var He,Vt=m(()=>{\"use strict\";k();He=class extends C{constructor(e,t){super();this.destination=e;this.message=t;r(this,\"messageType\",\"EnvelopedMessage\");let s=t;this.route=[e,...s.route?s.route:[]]}}});var Bn,jt,pe,Ln=m(()=>{\"use strict\";k();Bn=\"DetectedMyopRefsMessage\",jt=class extends _{constructor(){super(...arguments);r(this,\"messageType\",\"DetectMyopRefsMessage\");r(this,\"replyMessageKey\",Bn)}},pe=class extends R{constructor(e,t){super(e);this.replayToHandler=e;r(this,\"messageType\",Bn);this.content=t}isTypeof(e){return e.messageType===this.messageType}}});var Pn,Gt,De,On=m(()=>{\"use strict\";k();Pn=\"GetAttributeReplayMessage\",Gt=class extends _{constructor(e,t,s){super(s);this.ref=e;this.name=t;r(this,\"replyMessageKey\",Pn);r(this,\"messageType\",\"GetAttributeMessage\")}},De=class extends R{constructor(e){super();this.content=e;r(this,\"messageType\",Pn)}}});var A,An=m(()=>{\"use strict\";k();A=class extends C{constructor(e){super();this.method=e;r(this,\"messageType\",\"ExecuteComponentMethod\")}}});var Yt,Be,Kn=m(()=>{\"use strict\";k();Yt=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"SetMutationObserverMessage\")}},Be=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"MutationObserverMessage\")}}});var $n,Le,Pe,Fn=m(()=>{\"use strict\";k();$n=\"CleanupReplayMessage\",Le=class extends _{constructor(e,t){super(t);this.cleanupForMessageId=e;r(this,\"replyMessageKey\",$n);r(this,\"messageType\",\"CleanupMessage\")}},Pe=class extends R{constructor(e){super();this.customCleanup=e;r(this,\"messageType\",$n)}}});var Oe,zn=m(()=>{\"use strict\";k();Oe=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"DisposeMessage\")}}});var Qt,Ae,Wn=m(()=>{\"use strict\";k();Qt=class extends C{constructor(){super(...arguments);r(this,\"cleanable\",!0);r(this,\"messageType\",\"SetResizeObserverMessage\")}},Ae=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"ResizeObserverMessage\")}}});var Me={};ee(Me,{AddEventListenerMessage:()=>zt,BaseMyopMessage:()=>C,BindClickMessage:()=>Kt,ChangeTextMessage:()=>$t,CleanupMessage:()=>Le,CleanupReplayMessage:()=>Pe,ClickReplayMessage:()=>oe,CreateRefComponentMessage:()=>ke,CustomRefMessage:()=>q,DetectMyopRefsMessage:()=>jt,DetectedMyopRefsMessage:()=>pe,DisposeMessage:()=>Oe,ElementValueReplayMessage:()=>ie,EnvelopedMessage:()=>He,EventListenerCallbackMessage:()=>re,ExecuteComponentMethod:()=>A,ExecuteScriptMessage:()=>D,ExecuteScriptReplyMessage:()=>se,GetAttributeMessage:()=>Gt,GetAttributeReplayMessage:()=>De,GetElementValueMessage:()=>Nt,InitMessage:()=>he,InitRequest:()=>ae,InitResponse:()=>_e,MessageDirection:()=>v,MutationObserverMessage:()=>Be,MyopBindMessage:()=>_,MyopBindReplayMessage:()=>R,MyopElementMessage:()=>At,Ref:()=>Y,RefComponentCreatedMessage:()=>V,ResizeObserverMessage:()=>Ae,SetAttributeMessage:()=>Wt,SetInnerHtml:()=>qt,SetMutationObserverMessage:()=>Yt,SetResizeObserverMessage:()=>Qt,stripFunction:()=>Sn});var w=m(()=>{\"use strict\";k();xn();wn();Ft();En();vn();Rn();Ut();kn();Hn();Ge();Vt();Ln();Ut();On();An();Kn();Fn();zn();Wn()});var z,Ke=m(()=>{\"use strict\";I();w();$e();z=class{constructor(n,e,t){this.componentDefinition=n;this.container=e;r(this,\"id\",\"\");r(this,\"messageHandlers\",{});r(this,\"element\");r(this,\"_markedForDisposed\",!1);r(this,\"bind\",(n,e)=>{this.messageHandlers[n]||(this.messageHandlers[n]=[]),this.messageHandlers[n].includes(e)||this.messageHandlers[n].push(e)});r(this,\"bindWhen\",(n,e,t)=>{if(!t)throw new Error(\"can't use component.bindWhen without an handler\");this.messageHandlers[n]||(this.messageHandlers[n]=[]);let s=this.messageHandlers[n],i=a=>e(a)?(t(a),!0):!1;return s.push(i),()=>{let a=s.indexOf(i);a>-1&&s.splice(a,1)}});r(this,\"setInitiated\",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});r(this,\"isInitiated\",!1);r(this,\"_whenInitiatedResolve\");r(this,\"_whenInitiatedReject\");r(this,\"_whenInitiated\",new Promise((n,e)=>{this._whenInitiatedResolve=n,this._whenInitiatedReject=e}));r(this,\"initiated\",()=>this._whenInitiated);r(this,\"props\",{});r(this,\"refs\",{});this.id=(t==null?void 0:t.id)||$.Instance().assignId(n);let s=t!=null&&t.timeout?t==null?void 0:t.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject(\"timeout_\".concat(s,\" \").concat(this.id))},s),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(n){if(this._markedForDisposed)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.\");this._markedForDisposed=n}onMessageReceived(n){if(n.messageType===f.ExecuteComponentMethod){let t=n;return this[t.method]?this[t.method](t.content):console.log(\"method not found \".concat(t.method,\" on component\"),this),!0}let e=this.messageHandlers[n.messageType];if(e&&e.length){let t=!1;return e.forEach(s=>{t=t||s(n)}),t}return!1}sendCleanupMessage(n){n.source=this.id,n.destination=this.id,n.direction=v.down;let e=this.bindWhen(n.replyMessageKey,s=>s.replayToHandler===n.handlerUniqueId,s=>{n.handler(s),e()}),t=n.handler;delete n.handler,this.send(n),n.handler=t}send(n){n.source||(n.source=this.id),n.destination||(n.destination=this.id),n.direction=v.down;let e;if(n.handler){let t=n;e=this.bindWhen(t.replyMessageKey,s=>s.replayToHandler===t.handlerUniqueId,t.handler),delete n.handler}return n.ref&&(n.ref=n.ref.__nonProxied||n.ref),n.cleanable?()=>{this.sendCleanupMessage(new Le(n.id,t=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log(\"disposing component\",this.id),this.send(new Oe);let n=this.messageHandlers.onDispose;n&&n.forEach(e=>{e(null)}),this.messageHandlers={},this.id+=\"_disposed\",this.isInitiated=!1}}});var Ie,Nn=m(()=>{\"use strict\";Ie=class{constructor(n,e,t,s,i){this.myopId=n;this.htmlTagName=e;this.BoundingRect=t;this.offsetTop=s;this.offsetLeft=i;r(this,\"type\",\"MyopElementRef\")}}});var Un,x,Ye,qn=m(()=>{\"use strict\";Un=async o=>{if(typeof o==\"function\")o();else if(o instanceof Promise){let n=await o;typeof n==\"function\"&&n()}},x=class{constructor(n){this.messageToHost=n}},Ye=class extends x{constructor(e,t){super(e);this.messageToHost=e;this.context=t}}});var Jt,Ce,Vn=m(()=>{\"use strict\";I();b();w();Jt=class{constructor(n,e){this.id=n;this.context=e;r(this,\"send\",n=>{})}},Ce=class{constructor(){r(this,\"messageToHandleAfterInit\",[]);r(this,\"components\",{});r(this,\"alwaysPassEnvelopesToHost\",!1);r(this,\"messageCleanupCache\",{})}handleIncomeMessages(n){let e=n.data?n.data:n.detail;if(!(!e||!e.myop)){let t=e;if(t.direction!==v.down)return;if(t.messageType===f.DisposeMessage){t.destination&&delete this.components[t.destination];return}if(t.messageType===f.InitMessage){let s=t.content.id;if(this.components[s])return;this.components[s]=new Jt(s),this.messageToHost(new _e(s));return}if(t.messageType===f.EnvelopedMessage){let s=t,i=s.message;if(t=i,this.alwaysPassEnvelopesToHost||this.components[t.destination]){let a=myop.hostSDK.components.find(d=>d.id===i.destination);if(a){a.send(i);return}let p=myop.hostSDK.components.find(d=>d.id===s.destination);if(p){p.send(i);return}}else return}if(t.messageType){if(t.messageType===f.CleanupMessage){let i=t,a=this.messageCleanupCache[i.cleanupForMessageId],p=new Pe(!!a);p.destination=t.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],Un(a).then(()=>{this.messageToHost(p,i)}).catch(()=>{})):this.messageToHost(p,i);return}let s=!1;this.supportedHandlers.forEach(i=>{if(i.messageType===t.messageType){s=!0;let a=i.executor(t);if(t.cleanable&&a&&(this.messageCleanupCache[t.id]=a),a&&!t.cleanable)throw new Error(\"Cleanup handler generated for non-cleanable message. \\nmessageType - \".concat(t.messageType,\", handler executor was - \").concat(i.executor,\"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers.\"));if(!a&&t.cleanable)throw new Error(\"No cleanup handler generated for a cleanable message. \\nmessageType - \".concat(t.messageType,\", handler executor was - \").concat(i.executor,\"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers.\"))}})}else console.log(\"unsupported message type\")}}}});var j,de,be,xe,ce,Qe,we,b=m(()=>{\"use strict\";Nn();qn();Vn();j={IframeLoader:\"IframeLoader\",WebComponentLoader:\"WebComponentLoader\",HTMLLoader:\"HTMLLoader\",MinimizedLoader:\"MinimizedLoader\"},de={open:\"open\",closed:\"closed\",none:\"none\",localFrame:\"localFrame\"},be={message:\"message\",code:\"code\"},xe=class{};r(xe,\"code\",\"code\"),r(xe,\"component\",\"component\");ce={Segmented:\"Segmented\",Dedicated:\"Dedicated\",Default:\"Default\"},Qe={Segment:\"Segment\",Promo:\"Promo\",AB:\"AB\"},we=class{constructor(n,e){this.container=n;this.shadowRoot=e;r(this,\"getRootDiv\",()=>(this.shadowRoot||this.container).querySelector(\"div\"));r(this,\"getRoot\",()=>this.shadowRoot||this.container)}}});var Xt,bs,Zt,O,me=m(()=>{\"use strict\";Xt=o=>o!==Object(o),bs=o=>typeof o==\"function\",Zt=o=>{if(Xt(o))return!0;if(bs(o)||Object.getPrototypeOf(o))return!1;for(let n in o){let e=o[n];if(typeof e==\"object\"){if(!Zt(e))return!1}else{if(Xt(e))continue;return!1}}return!0},O=(o,n={},e=!0,t=new WeakMap)=>{if(Xt(o))return o;if(Array.isArray(o)){if(t.has(o))return t.get(o);let s=[];t.set(o,s);for(let i=0;i<o.length;i++){let a=o[i];s[i]=O(a,n,e,t)}return s}if(o!==null&&typeof o==\"object\"){if(t.has(o))return t.get(o);let s={};t.set(o,s);for(let i in o){let a=typeof n==\"boolean\"?n:n[i];a&&(a===!0?(e?o[i]!==void 0:o[i])&&(s[i]=O(o[i],!0,e,t)):typeof a==\"object\"&&(s[i]=O(o[i],a,e,t)))}return s}return{}}});var jn,Gn=m(()=>{\"use strict\";jn={notSerializableRefCall:(o,n)=>{throw new Error(\"\\nThe input provided to '\".concat(o.toString(),\"' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \\nThe following types of data are considered non-serializable and cannot be processed:\\n\\n- Functions\\n- DOM elements\\n- Class instances\\n- Circular references\\n- Symbols\\n- BigInt values\\n\\nIn the following execution we detected :\\n~~~~~~~~\\n\").concat(n,\" \\n~~~~~~~~\\nas not serializable.\\n\\nTo resolve this issue, please ensure that all inputs passed to '\").concat(o.toString(),\"' are in a serializable format.\\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \\nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\\n\\nSuggested Fix:\\n1. Remove or replace non-serializable values from your input.\\n2. If using objects, ensure they do not contain any functions or circular references.\\n3. Convert any class instances to plain objects or JSON-compatible formats.\\n4. Use dedicated Myop message.\\n\\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev.\\n\\n\"))}}});var Fe,Yn=m(()=>{\"use strict\";Ke();w();Vt();Fe=class extends z{constructor(e,t,s){super(e,t.container,s);this.componentDefinition=e;this.parent=t;r(this,\"send\",e=>{let t=e.handler,s=super.send(e);return this.parent.send(new He(this.id,e)),e.handler=t,s});r(this,\"dispose\",()=>{this.isInitiated&&this.send(new A(\"dispose\")),super.dispose()})}hide(){this.send(new A(\"hide\"))}show(){this.send(new A(\"show\"))}inspect(){return this.send(new A(\"inspect\"))}setHeightBasedOnDocumentElement(){this.send(new A(\"setHeightBasedOnDocumentElement\"))}setHeightBasedOnScrollHeight(){this.send(new A(\"setHeightBasedOnScrollHeight\"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var le,en=m(()=>{\"use strict\";Ke();ze();le=class extends z{constructor(e,t,s,i,a,p){super(e,s,p);this.container=s;this.customElement=i;this.tagName=a;r(this,\"ctaCleanup\");r(this,\"_ctaHandler\");r(this,\"_ctaQueue\",[]);r(this,\"cleanupInspect\",()=>{});r(this,\"send\",e=>{let t=super.send(e);return console.debug(\"[MyopExtractedWebComponent] send() called - web components use direct API instead\",e),t});r(this,\"dispose\",()=>{var e;this.ctaCleanup&&this.ctaCleanup(),super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i,this.setInitiated()}inspect(){return this.cleanupInspect=Se(this.id,\"MyopExtractedWebComponent\",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){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\"}show(){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=\"\"}initWithData(e){typeof this.customElement.myop_init_interface==\"function\"&&this.customElement.myop_init_interface(e)}getData(){if(typeof this.customElement.myop_init_interface==\"function\")return this.customElement.myop_init_interface()}setCtaHandler(e){if(this.ctaCleanup&&this.ctaCleanup(),this._ctaHandler=e,this._ctaQueue.length>0){let s=[...this._ctaQueue];this._ctaQueue=[],s.forEach(i=>{this.markedForDisposed||e(i.action,i.payload)})}let t=s=>{var a;let i=s;(a=i.detail)!=null&&a.action&&(this._ctaHandler&&!this.markedForDisposed?this._ctaHandler(i.detail.action,i.detail.payload):this._ctaHandler||this._ctaQueue.push({action:i.detail.action,payload:i.detail.payload}))};this.customElement.addEventListener(\"myop-cta\",t),this.ctaCleanup=()=>{this.customElement.removeEventListener(\"myop-cta\",t)}}}});var Ss,Se,Qn,Jn,Xn,Es,tn,nn,ze=m(()=>{\"use strict\";w();w();b();me();Gn();Yn();en();Ss=(o,n,e)=>{let t=document.createElement(\"a\");return t.textContent=o,t.style.position=\"relative\",t.style.padding=\"0 5px\",t.style.fontSize=\"14px\",t.style.top=\"0\",t.style.top=\"\".concat(n,\"px\"),t.style.transform=\"translateX(-50%)\",t.target=\"_blank\",t.href=\"https://dashboard.myop.dev/dashboard/component/\".concat(e.id),t},Se=(o,n,e,t,s,i)=>{let a=Ss(\"\".concat(i.name,\" : \").concat(n),e,i);return t.insertBefore(a,s),s.style.border=\"1px solid #007BFF\",s.style.display=\"block\",()=>{s.style.border=\"unset\",t.removeChild(a)}},Qn=(o,n,e)=>o?!1:(console.error(\"Error: Undefined Prop\\n\\nIt looks like you've tried to use a prop that hasn't been defined.\\nPlease check the prop name for any typos or ensure that it is properly defined in the component's prop list.\\n\\n\"+\"Prop Name: \".concat(n,\"\\n\")+\"Component: \".concat(e.componentDefinition.name,\", ID: \").concat(e.componentDefinition.id,\"\\n\\n\")+\"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/\".concat(e.componentDefinition.id,\" or consult the developer guide.\")),!0),Jn=(o,n,e)=>{console.error(\"Error: Code Prop Not Supported\\n\\nCurrently, code props are only supported in local frame components.\\n\\u26A0\\uFE0F This is a work in progress feature \\u2014 code props will be supported in upcoming versions.\\n\\nIn the meantime, you can use message props.\\n\\n\"+\"Prop Name: \".concat(n,\"\\n\")+\"Component: \".concat(e.componentDefinition.name,\", ID: \").concat(e.componentDefinition.id,\"\\n\\n\")+\"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/\".concat(e.componentDefinition.id,\" or consult the developer guide.\"))},Xn=(o,n,e)=>{let t=n.reduce((i,a)=>U(h({},i),{[a.name]:h({},a)}),{}),s={get:(i,a)=>{let p=t[a];if(Qn(p,a,o))return!1;if(p.behavior.type===be.code){if(o instanceof le)return(p.behavior.remap||a)===\"myop_init_interface\"?l=>{if(l===void 0)return o.getData();o.initWithData(l)}:void 0;if(e.loader.type===j.HTMLLoader&&e.loader.shadowRootMode===de.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return Jn(p,a,o),!1}return p.mode===\"output\"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(Y.create(p.behavior.ref)),c.push(u=>{d(u)}),p.behavior.params&&c.push(...p.behavior.params);let l=Me[p.behavior.message];o.send(new l(...c))}):null},set:(i,a,p)=>{let d=t[a];if(Qn(d,a,o))return!1;if(d.behavior.type===be.code){if(o instanceof le){let l=d.behavior.remap||a;if(l===\"myop_cta_handler\")return o.setCtaHandler(p),!0;if(l===\"myop_init_interface\")return o.initWithData(p),!0}if(e.loader.type===j.HTMLLoader&&e.loader.shadowRootMode===de.localFrame){let l=d.behavior,u=o.element.contentWindow,g=l.remap||a;if(u[g]=p,g===\"myop_cta_handler\"&&u.__myop_cta_queue){let y=u.__myop_cta_queue;u.__myop_cta_queue=null,y.forEach(M=>{o.markedForDisposed||p(M.action,M.payload)})}return!0}return Jn(d,a,o),!1}else if(d.mode===\"input\")if(d.behavior.type===\"message\"){let c=[];d.behavior.ref&&c.push(Y.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let l=Me[d.behavior.message];return o.send(new l(...c)),!0}else throw new Error(\"Error: Unsupported Behavior\\n\\nThe 'behavior' field provided is not supported.\\n\"+\"Component: \".concat(o.componentDefinition.name,\", ID: \").concat(o.componentDefinition.id,\"\\n\\n\")+\"Prop Name: \".concat(a,\"\\n\")+\"Behavior Field: \".concat(d.behavior.type,\"\\n\\n\")+\"Check the documentation for valid behavior options.\");return!1}};return o.props={},o.props=new Proxy(o.props,s),o},Es=(o,n)=>new Proxy(o,{get(e,t){return e[t]?e[t]:(...i)=>new Promise(a=>{i.forEach(p=>{Zt(p)||jn.notSerializableRefCall(t,p)}),n.send(new q(({ref:p,propName:d,functionArgs:c,makeSerializable:l})=>{if(p){let u=p[d];return l(typeof u==\"function\"?p[d](...c):u,!0)}return null},{elementId:e.refConfig.selector,propName:t,functionArgs:i},p=>{a(p.content)}))})},set(e,t,s){return n.send(new q(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:s,propName:t},i=>{})),!0}}),tn=async(o,n,e,t)=>{let s=o.component;if(!s)throw new Error(\"cant createRefComponent with detached ref\");return new Promise(async(i,a)=>{let p=new Fe(n.type,s,t);e.push(p),await s.initiated();let d=setTimeout(()=>{a(\"timeout\")},5e3);s.send(new ke(o.refConfig,n,U(h({},t||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(d),c.failed){a(\"CreateRefComponentMessage failed\");return}let l=e.find(u=>u.id==p.id);if(l!==p){s.refs[o.refConfig.name]=l,i(l);return}else p.setInitiated(),s.refs[o.refConfig.name]=p;c.nestedRefs.forEach(u=>{let g=n.instance.resolvedNestedComponents.find(M=>M.type.id===u.componentDefinitionId).type,y=new Fe(g,p);y.setInitiated(),p.refs[u.refName]=y,e.push(y)});try{await nn(p,n,e,!0),s.setHeightBasedOnScrollHeight&&s.setHeightBasedOnScrollHeight(),i(p)}catch(u){a(u)}}))})},nn=async(o,n,e,t=!1)=>{o.refs||(o.refs={});let s=Object.values(o.componentDefinition.refs).map(i=>new Promise(async(a,p)=>{var d;if(i.behavior.type==xe.component){if(t){a();return}let c=i.behavior.componentId;c||(c=i.behavior.instance.componentId);let l=(d=n.instance.resolvedNestedComponents)==null?void 0:d.find(g=>g.type.id===c);if(!l)throw new Error(\"componentConfig provided without nestedComponentConfig check the config object\");let u=Y.create(\"\",i,o);try{let g=await tn(u,l,e);o.refs[i.name]=g,a()}catch(g){p(g)}}else try{let c=Y.create(\"\",i,o);o.refs[i.name]=Es(c,o),a()}catch(c){}}));try{await Promise.all(s)}catch(i){throw i}}});var Ee,on=m(()=>{\"use strict\";Ke();w();ze();I();Ee=class extends z{constructor(e,t,s,i,a){super(e,s,a);this.componentConfig=e;this.container=s;this.IframeElement=i;r(this,\"cleanupInspect\");r(this,\"setHeightBasedOnDocumentElement\",()=>{let e=this.send(new D(()=>window.document.documentElement.scrollHeight,t=>{this.IframeElement.style.height=\"\".concat(t.content,\"px\"),e()}))});r(this,\"observeSizeBasedOnDocumentElement\",()=>this.send(new D(({send:t})=>{let{height:s,width:i}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:d}=document.documentElement.getBoundingClientRect();t({height:p,width:d})});return a.observe(document.documentElement),a.observe(document.body),{height:s,width:i}},t=>{this.IframeElement.style.width=\"\".concat(t.content.width,\"px\"),this.IframeElement.style.height=\"\".concat(t.content.height,\"px\")})));r(this,\"observeAutoSize\",e=>{var Re;let t=this.IframeElement,s=t.contentDocument;if(!s)return console.warn(\"[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible\"),()=>{};let i=(P,N,ge)=>N!==void 0&&P<N?N:ge!==void 0&&P>ge?ge:P,a=P=>{if(P===void 0)return;if(typeof P==\"number\")return P;let N=parseFloat(P);return isNaN(N)?void 0:N},p=a(e==null?void 0:e.minWidth),d=a(e==null?void 0:e.maxWidth),c=a(e==null?void 0:e.minHeight),l=a(e==null?void 0:e.maxHeight),u=(Re=e==null?void 0:e.loaderMinHeight)!=null?Re:50,g=(e==null?void 0:e.explicitWidth)!==void 0,y=(e==null?void 0:e.explicitHeight)!==void 0,M=this.container.getBoundingClientRect(),fe=M.width===0,Ne=M.height===0||M.height===u,G=(e!=null&&e.forceAutoSize||fe)&&!g,H=(e!=null&&e.forceAutoSize||Ne)&&!y;if(!G&&!H)return()=>{};let K=()=>{var N;let P=t.contentDocument;if(P){let ge=P.documentElement.getBoundingClientRect(),ln=Math.ceil(ge.width),fn=Math.ceil(ge.height),un=i(ln,p,d),gn=i(fn,c,l);G&&(t.style.width=\"\".concat(un,\"px\")),H&&(t.style.height=\"\".concat(gn,\"px\"));let cs=G&&d!==void 0&&ln>d,ms=H&&l!==void 0&&fn>l;P.documentElement.style.overflowX=cs?\"auto\":\"hidden\",P.documentElement.style.overflowY=ms?\"auto\":\"hidden\",(N=e==null?void 0:e.onSizeChange)==null||N.call(e,{width:un,height:gn,autoSizingWidth:G,autoSizingHeight:H})}};K();let ue=new ResizeObserver(K);return ue.observe(s.body),ue.observe(s.documentElement),()=>{ue.disconnect()}});r(this,\"setSizeBasedOnDocumentElement\",()=>{let e=this.send(new D(()=>{let{height:t,width:s}=document.documentElement.getBoundingClientRect();return{height:t,width:s}},t=>{this.IframeElement.style.width=\"\".concat(t.content.width,\"px\"),this.IframeElement.style.height=\"\".concat(t.content.height,\"px\"),e()}))});r(this,\"setHeightBasedOnScrollHeight\",()=>{let e=this.send(new D(()=>{let s=0;return s++,s--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+s+\"px\"},t=>{this.IframeElement.style.height=t.content,e()}))});r(this,\"send\",e=>{var i,a;let t=h({},e);if(t.messageType===f.ExecuteComponentMethod)return this[t.method](),()=>{};t.direction=v.down;let s=super.send(t);return(a=(i=this.IframeElement)==null?void 0:i.contentWindow)==null||a.postMessage(t,\"*\"),s});r(this,\"dispose\",()=>{this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});t.loader.autoHeight&&this.initiated().then(()=>{this.setHeightBasedOnScrollHeight()}),this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=Se(this.id,\"MyopIframeComponent\",10,this.container,this.IframeElement,this.componentDefinition),()=>{this.cleanupInspect(),this.cleanupInspect=void 0})}hide(){this.IframeElement.style.opacity=\"0\",this.IframeElement.style.position=\"absolute\",this.IframeElement.style.pointerEvents=\"none\",this.IframeElement.style.visibility=\"hidden\"}show(){this.IframeElement.style.opacity=\"1\",this.IframeElement.style.position=\"unset\",this.IframeElement.style.pointerEvents=\"all\",this.IframeElement.style.visibility=\"visible\"}onMessageReceived(e){return e.messageType===f.In.MutationObserverMessage||e.messageType===f.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var Q,Je=m(()=>{\"use strict\";Q=class{constructor(){r(this,\"appendChild\",(n,e,t)=>{var s;if(t!=null&&t.relative){if(t.relative.direction===\"before\")return n.insertBefore(e,t.relative.child);if(t.relative.direction===\"after\"){let i=(s=t.relative.child)==null?void 0:s.nextSibling;return n.insertBefore(e,i||null)}}else return n.appendChild(e)})}}});var Ts,Xe,Zn=m(()=>{\"use strict\";on();Je();ne();b();Ts=(o,n,e)=>{let t=new URL(o);return t.searchParams.append(n,e),t.toString()},Xe=class extends Q{constructor(){super(...arguments);r(this,\"type\",j.IframeLoader);r(this,\"load\",async(e,t,s,i)=>{let a,p=t.loader;if((s==null?void 0:s.nodeName)===\"IFRAME\")console.log(\"needs to load into an exsisting Iframe...\",p.url,s),a=s,a.src=p.url;else{let d=E(),c=\"myop-comp-\".concat(d);a=document.createElement(\"iframe\"),a.id=c;let l=\"\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n height: \".concat(p.autoHeight||!p.height?\"100%\":p.height,\";\\n width: 100%;\\n overflow: hidden;\\n border: none;\\n opacity: \").concat(i!=null&&i.hidden?\"0\":\"1\",\";\\n pointer-events: \").concat(i!=null&&i.hidden?\"none\":\"all\",\";\\n \");a.style.cssText=l,i!=null&&i.elementAttributes&&Object.entries(i.elementAttributes).forEach(([g,y])=>{y===\"\"||y===null||y===void 0?a.setAttribute(g,\"\"):a.setAttribute(g,String(y))});let u=t.loader.url;i!=null&&i._hasParent&&(u=Ts(u,\"_myop-comp\",d)),a.src=u,s.querySelector('[id^=\"myop-comp-\"]')||(s.innerHTML=\"\"),a=this.appendChild(s,a,i)}return new Ee(e,t,s,a,i)})}}});var Ze,sn=m(()=>{\"use strict\";Ze={webcomponent_message_key:\"myop_webcomponent_message\"}});var Te,rn=m(()=>{\"use strict\";sn();Ke();ze();Te=class extends z{constructor(e,t,s,i,a){super(e,s,a);this.container=s;this.customElement=i;r(this,\"cleanupInspect\",()=>{});r(this,\"send\",e=>{let t=h({},e),s=super.send(t),i=new CustomEvent(Ze.webcomponent_message_key,{detail:t});try{this.customElement.dispatchEvent(i)}catch(a){console.log(\"error while trying to dispatchEvent\",a)}return s});r(this,\"dispose\",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i}inspect(){return this.cleanupInspect=Se(this.id,\"MyopWebComponent\",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){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\"}show(){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=\"\"}}});var an,et,eo=m(()=>{\"use strict\";rn();Je();ne();b();an={},et=class extends Q{constructor(){super(...arguments);r(this,\"type\",j.WebComponentLoader);r(this,\"load\",async(e,t,s,i)=>{let a=t.loader;an[a.url]?console.log(\"Module alreday loaded or in loading process\"):an[a.url]=new Promise((c,l)=>{let u=a.url,g=document.createElement(\"script\");g.type=\"module\",g.src=u,g.onload=()=>{c()},g.onerror=()=>{l()},document.head.appendChild(g)}),await an[a.url],await In(1);let p=\"myop-comp-\".concat(E()),d=document.createElement(a.tag);return s.querySelector('[id^=\"myop-comp-\"]')||(s.innerHTML=\"\"),d.id=p,i!=null&&i.hidden&&(d.style.opacity=\"0\",d.style.position=\"absolute\",d.style.height=\"0\",d.style.width=\"0\",d.style.pointerEvents=\"none\",d.style.visibility=\"hidden\"),i!=null&&i._environment&&(d._myopEnvironment=i==null?void 0:i._environment),this.appendChild(s,d,i),new Te(e,t,s,d,i)})}}});var T,W=m(()=>{\"use strict\";b();T=class extends Ye{constructor(e,t){super(e);this.context=t;r(this,\"executor\",e=>{if(e.destination){let t=e.destination;if(this.context[t].context){let s=(i,a)=>{this.messageToHost(U(h({},i),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[t].context,s)}else debugger}else debugger})}}});var B,J=m(()=>{\"use strict\";B={id:\"myop-id\"}});var S,to,L=m(()=>{\"use strict\";J();S=(o,n)=>n.querySelectorAll(\"[\".concat(B.id,\"='\").concat(o.refConfig.selector,\"']\")),to=(o,n)=>{let e=S(o,n);return e.length?e.item(0):null}});var tt,no=m(()=>{\"use strict\";I();w();W();L();tt=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.BindClickMessage);r(this,\"innerExecutor\",(e,t,s)=>{let i=S(e.ref,t.shadowRoot),a=[];return i.forEach(p=>{let d=()=>{s(new oe(e.handlerUniqueId))};p.addEventListener(\"click\",d),a.push(()=>{p.removeEventListener(\"click\",d)})}),()=>{a.forEach(p=>p())}})}}});var nt,oo=m(()=>{\"use strict\";I();W();L();nt=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.ChangeTextMessage);r(this,\"innerExecutor\",(e,t)=>{S(e.ref,t.shadowRoot).forEach(i=>{i.textContent=e.content})})}}});var ot,so=m(()=>{\"use strict\";b();ot=class extends we{constructor(e,t){super(e,t);this.container=e;this.shadowRoot=t}}});var st,ro=m(()=>{\"use strict\";b();J();W();w();I();st=class extends T{constructor(){super(...arguments);r(this,\"innerExecutor\",(e,t)=>{let s=t.shadowRoot.querySelectorAll(\"[\".concat(B.id,\"]\")),i=[];s.forEach(a=>{let p=a.getAttribute(B.id);p&&i.push(new Ie(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new pe(e.handlerUniqueId,i))});r(this,\"messageType\",f.DetectMyopRefsMessage)}}});var rt,io=m(()=>{\"use strict\";I();W();L();rt=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.SetAttributeMessage);r(this,\"innerExecutor\",(e,t)=>{S(e.ref,t.shadowRoot).forEach(i=>{i.setAttribute(e.name,e.value)})})}}});var it,ao=m(()=>{\"use strict\";I();w();W();L();me();it=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.AddEventListenerMessage);r(this,\"innerExecutor\",(e,t,s)=>{let i=S(e.ref,t.shadowRoot),a=[];return i.forEach(p=>{let d=c=>{s(new re(e.handlerUniqueId,O(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var at,po=m(()=>{\"use strict\";I();J();$e();Ge();W();at=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.CreateRefComponentMessage);r(this,\"innerExecutor\",(e,t,s)=>{(async()=>{let a=t.shadowRoot.querySelectorAll(\"[\".concat(B.id,\"='\").concat(e.refConfig.selector,\"']\"));if(a.length===1){let p=$.Instance(),d=p.components.find(g=>g.id===e.options.id);d&&d.dispose();let c=p.components.indexOf(d);c!==-1&&p.components.splice(c,1);let l=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),u=[];Object.keys(l.refs).forEach(g=>{let y=l.refs[g];y=y.__nonProxied||y,y.componentDefinition&&u.push({refName:g,componentDefinitionId:y.componentDefinition.id})}),s(new V(e.handlerUniqueId,u))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new V(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var pt,pn=m(()=>{\"use strict\";me();pt=(o,n,e)=>{let t=o.scriptInputs?o.scriptInputs:{};t.makeSerializable=O,t.send=n,t.rootRef=e,t.__scriptInputs=t;let i=new Function(\"return (\".concat(o.script,\")(...arguments)\"))(t);n(i)}});var dt,co=m(()=>{\"use strict\";I();w();W();pn();dt=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.ExecuteScriptMessage);r(this,\"innerExecutor\",(e,t,s)=>{pt(e,a=>{s(new se(e.handlerUniqueId,a))},t)})}}});var mo,ct,lo=m(()=>{\"use strict\";I();w();W();L();J();me();mo=o=>{if(!o)return null;if(o.tagName===\"FORM\"){let n=new FormData(o),e={formData:{},unmappedData:[]},t=o.querySelectorAll(\"input, select, textarea\"),s=-1;return t.forEach(i=>{if(typeof i.value==\"string\"){let a=i.getAttribute(B.id),p=i.getAttribute(\"name\"),d={id:i.id,name:p,value:mo(i),required:i.required,validity:O(i.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(d):(e.unmappedData.push(e.formData[p]),e.formData[p]=d):e.formData[p]=d:e.unmappedData.push(d)}}),e}return o.type===\"checkbox\"||o.type===\"radio\"?o.checked?o.value:null:o.tagName===\"INPUT\"||o.tagName===\"TEXTAREA\"||o.tagName===\"SELECT\"?o.value:o.isContentEditable?o.innerText||o.textContent:null},ct=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.GetElementValueMessage);r(this,\"innerExecutor\",(e,t,s)=>{S(e.ref,t.shadowRoot).forEach(a=>{s(new ie(mo(a)),e)})})}}});var mt,fo=m(()=>{\"use strict\";I();W();L();mt=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.SetInnerHtml);r(this,\"innerExecutor\",(e,t)=>{S(e.ref,t.shadowRoot).forEach(i=>{i.innerHTML=e.content})})}}});var uo={};ee(uo,{WebComponentSDK:()=>ve});var ve,dn=m(()=>{\"use strict\";b();I();sn();no();oo();so();ro();te();w();io();ao();po();co();lo();fo();ve=class extends Ce{constructor(){super(...arguments);r(this,\"alwaysPassEnvelopesToHost\",!0);r(this,\"connectedCallback\",(e,t)=>{e.addEventListener(Ze.webcomponent_message_key,s=>{let i=s.data?s.data:s.detail;if(!i||!i.myop){debugger;throw new Error(\"recvied webcomponent_message with wrong type\")}else{let a=i;if(this.handleIncomeMessages(s),a.messageType===f.InitMessage){let p=a.content.id;this.components[p].context=new ot(e,t)}}}),setTimeout(()=>{this.messageToHost(new ae)},1)});r(this,\"messageToHost\",(e,t)=>{e.direction=v.up,!e.replayToHandler&&(t!=null&&t.handlerUniqueId)&&(e.replayToHandler=t.handlerUniqueId),window.myop.hostSDK.send(e)});r(this,\"supportedHandlers\",[new nt(this.messageToHost,this.components),new mt(this.messageToHost,this.components),new tt(this.messageToHost,this.components),new st(this.messageToHost,this.components),new rt(this.messageToHost,this.components),new it(this.messageToHost,this.components),new dt(this.messageToHost,this.components),new ct(this.messageToHost,this.components),new at(this.messageToHost,this.components)]);r(this,\"init\",()=>{})}};F(\"WebComponentSDK\",ve)});var go=m(()=>{\"use strict\";dn()});var yo,ho=m(()=>{\"use strict\";yo=\"\"});function _s(o,n){return class extends HTMLElement{connectedCallback(){let e=n===de.open?\"open\":\"closed\",t=this.attachShadow({mode:e});xo().then(s=>{s.connectedCallback(this,t),t.innerHTML=o})}}}var vs,Rs,Io,Co,lt,xo,ks,Hs,Ds,ft,wo=m(()=>{\"use strict\";rn();en();Je();ne();b();go();on();ho();vs=\"<!-- myop-web-component -->\",Rs=\"myop-web-component\",Io=new Set,Co=[],xo=async()=>(lt||(lt=new ve,lt.init()),lt);ks=(o,n,e)=>{customElements.define(o,_s(n,e)),console.log(\"define('\".concat(o,\"') was called, web component ready to use\"))},Hs=o=>o.replace(/([a-z])([A-Z])/g,\"$1-$2\").replace(/(\\d+)/g,\"-$1\").toLowerCase(),Ds=o=>(o=Hs(o),o.replace(/_/g,\"-\")),ft=class extends Q{constructor(){super(...arguments);r(this,\"type\",j.HTMLLoader);r(this,\"load\",async(e,t,s,i)=>{let a=t.loader;if(this.isMyopWebComponent(a.HTML))return this.loadExtractedWebComponent(e,t,s,a.HTML,i);let p=\"myop-comp-\".concat(E()),d;if(a.shadowRootMode===de.localFrame){let c=E(),l=\"myop-comp-\".concat(c),u=document.createElement(\"iframe\");u.id=l,u.style.cssText=\"\\n display: block;\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n overflow: hidden;\\n border: none;\\n opacity: \".concat(i!=null&&i.hidden?\"0\":\"1\",\";\\n width: 100%;\\n height: 100%;\\n pointer-events: \").concat(i!=null&&i.hidden?\"none\":\"all\",\";\\n \"),s.querySelector('[id^=\"myop-comp-\"]')||(s.innerHTML=\"\"),u=this.appendChild(s,u,i);let g=u.contentDocument||u.contentWindow.document;g.open();let y=a.HTML;if(i!=null&&i._inspection){let H=new DOMParser().parseFromString(a.HTML,\"text/html\"),K=H.getElementById(\"myop_preview\");K==null||K.removeAttribute(\"type\");let ue=H.implementation.createHTMLDocument();ue.body.innerHTML=\"<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>\";let Re=ue.body.firstChild;Re&&H.head&&H.head.insertBefore(H.importNode(Re,!0),H.head.firstChild),y=H.documentElement.outerHTML}else if((i==null?void 0:i.data)!==void 0){let H=new DOMParser().parseFromString(a.HTML,\"text/html\"),K=H.getElementById(\"myop_preview\");K&&(K.remove(),y=H.documentElement.outerHTML)}g.writeln(y);let M='<script src=\"'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'\"><\\/script>'),fe=\"<script>\\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\\n const __myop_init = async () => {\\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\\n const sdk = new IframeSDK();\\n sdk.init();\\n }\\n __myop_init().then();\\n <\\/script>\";if(g.writeln(\"\".concat(M).concat(fe)),(i==null?void 0:i.data)!==void 0){let G=\"<script>\\n window.__myop_cta_queue = [];\\n window.myop_cta_handler = function(action, payload) {\\n window.__myop_cta_queue.push({action: action, payload: payload});\\n };\\n <\\/script>\",H=JSON.stringify(i.data).replace(/<\\/script/gi,\"\\\\u003c/script\"),K='<script id=\"__myop_init_data_script\">\\n (function() {\\n var data = '.concat(H,\";\\n var scriptEl = document.getElementById('__myop_init_data_script');\\n\\n var callInitInterface = function(fn) {\\n var startTime = performance.now();\\n // Mark as pre-injected data call for extension tracking\\n window.__myop_init_preinjected = true;\\n try {\\n fn(data);\\n } finally {\\n window.__myop_init_preinjected = false;\\n }\\n var duration = performance.now() - startTime;\\n\\n // Notify extension via postMessage (init* = pre-injected)\\n try {\\n window.parent.postMessage({\\n type: 'MYOP_PREINJECTED_INIT',\\n payload: {\\n data: data,\\n duration: duration,\\n timestamp: Date.now()\\n }\\n }, '*');\\n } catch (e) {}\\n\\n // Cleanup: remove script tag and stored data\\n if (scriptEl && scriptEl.parentNode) {\\n scriptEl.parentNode.removeChild(scriptEl);\\n }\\n delete window.__myop_init_data;\\n };\\n\\n if (typeof window.myop_init_interface === 'function') {\\n // Function already exists - call immediately\\n callInitInterface(window.myop_init_interface);\\n } else {\\n // Function not yet defined - store data and watch for definition\\n window.__myop_init_data = data;\\n\\n var _original;\\n Object.defineProperty(window, 'myop_init_interface', {\\n configurable: true,\\n enumerable: true,\\n set: function(fn) {\\n _original = fn;\\n if (window.__myop_init_data !== undefined) {\\n var storedData = window.__myop_init_data;\\n delete window.__myop_init_data;\\n callInitInterface(fn);\\n }\\n },\\n get: function() {\\n return _original;\\n }\\n });\\n }\\n })();\\n <\\/script>\");g.writeln(G+K)}g.close();let Ne=new Ee(e,t,s,u,i);return a.autoHeight&&(u.onload=()=>{Ne.observeSizeBasedOnDocumentElement()}),Ne}if(a.shadowRootMode===de.none){let c=document.createElement(\"template\");c.innerHTML=a.HTML,d=c.content.firstElementChild,xo().then(l=>{l.connectedCallback(d,d)})}else{let c=Ds(e.name+t.id);Co.includes(c)||(ks(c,a.HTML,a.shadowRootMode),Co.push(c)),d=document.createElement(c)}return s.querySelector('[id^=\"myop-comp-\"]')||(s.innerHTML=\"\"),d.id=p,i!=null&&i.hidden&&(d.style.opacity=\"0\",d.style.position=\"absolute\",d.style.height=\"0\",d.style.width=\"0\",d.style.pointerEvents=\"none\",d.style.visibility=\"hidden\"),this.appendChild(s,d,i),new Te(e,t,s,d,i)})}isMyopWebComponent(e){return e.trimStart().startsWith(vs)}extractWebComponentScript(e){let i=new DOMParser().parseFromString(e,\"text/html\").getElementById(Rs);return(i==null?void 0:i.textContent)||null}executeWebComponentScript(e,t){if(Io.has(t)){console.log(\"[MyopWebComponent] Script already executed for \".concat(t,\", skipping\"));return}let s=document.createElement(\"script\");s.textContent=e,s.id=\"myop-extracted-\".concat(t),document.head.appendChild(s),Io.add(t),console.log(\"[MyopWebComponent] Executed web component script: \".concat(t))}async loadExtractedWebComponent(e,t,s,i,a){let p=this.extractWebComponentScript(i);if(!p)throw new Error('[MyopWebComponent] No <script id=\"myop-web-component\"> found in HTML');let d=\"\".concat(e.id,\"-\").concat(t.id),c=window.__MYOP_TAG_NAME__;this.executeWebComponentScript(p,d);let l=window.__MYOP_TAG_NAME__;if(!l)throw new Error(\"[MyopWebComponent] Script did not set window.__MYOP_TAG_NAME__\");c&&c!==l&&console.warn(\"[MyopWebComponent] __MYOP_TAG_NAME__ changed from \".concat(c,\" to \").concat(l));let u=\"myop-comp-\".concat(E()),g=document.createElement(l);g.id=u,a!=null&&a.hidden&&(g.style.opacity=\"0\",g.style.position=\"absolute\",g.style.height=\"0\",g.style.width=\"0\",g.style.pointerEvents=\"none\",g.style.visibility=\"hidden\"),s.querySelector('[id^=\"myop-comp-\"]')||(s.innerHTML=\"\"),this.appendChild(s,g,a);let y=new le(e,t,s,g,l,a);return(a==null?void 0:a.data)!==void 0&&y.initWithData(a.data),console.log(\"[MyopWebComponent] Loaded <\".concat(l,\"> into container\")),y}}});var bo,So,Eo=m(()=>{\"use strict\";ne();w();bo=(o,n,e)=>{let t=\"myop-css-\".concat(E());return o.send(new D(({rootRef:s,_stylesheet:i,_tagId:a,_css:p})=>{let d=document.createElement(\"style\");d.type=\"text/css\";let c=p;for(let l in i){c+=\"\".concat(l,\" { \");let u=i[l];for(let g in u)c+=\"\".concat(g,\": \").concat(u[g],\"; \");c+=\"} \"}d.appendChild(document.createTextNode(c)),d.id=a,(s.shadowRoot||s.container).appendChild(d)},()=>{},{_stylesheet:n,_css:e||\"\",_tagId:t})),()=>{o.send(new D(({rootRef:s,_tagId:i})=>{let a=(s.shadowRoot||document).getElementById(i);a&&a.remove()},()=>{},{_tagId:t}))}},So=(o,n)=>{let e=\"myop-css-\".concat(E());return o.send(new D(({rootRef:t,_tagId:s,_link:i})=>{let a=document.createElement(\"link\");a.id=s,a.rel=\"stylesheet\",a.href=i,document.head.appendChild(a),(t.shadowRoot||t.container).appendChild(a)},()=>{},{_link:n,_tagId:e})),()=>{o.send(new D(({rootRef:t,_tagId:s})=>{let i=(t.shadowRoot||document).getElementById(s);i&&i.remove()},()=>{},{_tagId:e}))}}});var Bs,cn,To,vo=m(()=>{\"use strict\";Bs=(o,n)=>{let e=new RegExp(Object.keys(n).join(\"|\"),\"g\");return o.replace(e,t=>(n[t]||t).toString())},cn=(o,n)=>{let e=o.loader;if(e.type!==\"IframeLoader\")throw new Error('iframeSkinUrlTokenizer received skin with loader type \"'.concat(e.type,'\", currently only \"IframeLoader\" is supported'));return o.loader=h({},o.loader),o.loader.url=Bs(o.loader.url,n),o},To=o=>async n=>cn(n,o)});var Ro,_o,ko=m(()=>{\"use strict\";w();Ro=(o,n,e)=>{o.send(new q(({ref:t,_className:s})=>{t==null||t.classList.add(s)},{elementId:e,_className:n}))},_o=(o,n,e)=>{o.send(new q(({ref:t,_className:s})=>{t==null||t.classList.remove(s)},{elementId:e,_className:n}))}});var yt,ut,ht,gt,Ho=m(()=>{\"use strict\";ne();yt=class yt{constructor(){r(this,\"_runTimeInstanceId\",\"runtime-instance-id-\"+E());r(this,\"_runTimeId\",\"runtime-id-\"+E());r(this,\"_runTimeName\",\"runtime-name-\"+E());r(this,\"id\",this._runTimeId);r(this,\"name\",this._runTimeName);r(this,\"description\",\"\");r(this,\"loader\",null);r(this,\"withLoader\",n=>(this.loader=n,this));r(this,\"withHTMLLoader\",n=>(n.type=\"HTMLLoader\",this.loader=n,this));r(this,\"build\",()=>this)}};r(yt,\"create\",()=>new yt);ut=yt,ht=class ht{constructor(){r(this,\"_runTimeInstanceId\",\"runtime-instance-id-\"+E());r(this,\"_runTimeId\",\"runtime-id-\"+E());r(this,\"_runTimeName\",\"runtime-name-\"+E());r(this,\"instance\",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});r(this,\"name\",this._runTimeName);r(this,\"type\",{id:this._runTimeId,name:this._runTimeName,description:\"\",props:[],refs:[],skins:[],defaultSkin:0});r(this,\"withInstance\",n=>(this.instance=n,this));r(this,\"withType\",n=>(this.type=n,this));r(this,\"withName\",n=>(this.name=n,this));r(this,\"withDefaultSkin\",n=>(this.type.skins.push(n),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:\"Dedicated\",skin:{id:n.id}},this));r(this,\"withRef\",n=>(this.type.refs.push(n),this));r(this,\"withBasicRef\",n=>{let e={id:\"\",name:n,description:\"\",selectorType:\"id-attribute\",selector:n,behavior:{type:\"code\"}};return this.type.refs.push(e),this});r(this,\"build\",()=>JSON.parse(JSON.stringify(this)))}};r(ht,\"create\",()=>new ht);gt=ht});var Ls,Mt,Ps,Os,X,Z,Do,Bo=m(()=>{\"use strict\";b();Ls=o=>({instance:{id:\"auto\",componentId:o.componentId,componentName:o.name,skinSelector:{type:\"Dedicated\",skin:{id:\"skin_auto_v2_converted\"}}},type:{id:o.id,name:o.name,description:o.description,props:[{id:\"in_auto_v2_converted\",name:\"myop_init_interface\",type:\"any\",behavior:{type:be.code}},{id:\"out_auto_v2_converted\",name:\"myop_cta_handler\",type:\"any\",behavior:{type:be.code}}],refs:[],skins:[{id:\"skin_auto_v2_converted\",name:\"auto_v2_converted\",description:\"\",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),Mt=\"__MYOP_CLOUD_REPOSITORY_MAIN__\",Ps=()=>{if(typeof window<\"u\")return window[Mt];if(typeof globalThis<\"u\")return globalThis[Mt]},Os=o=>{typeof window<\"u\"&&(window[Mt]=o),typeof globalThis<\"u\"&&(globalThis[Mt]=o)},X=class X{constructor(n=\"https://cloud.myop.dev\"){this._baseUrl=n;r(this,\"variants\",{});r(this,\"preloadedComponents\",{});r(this,\"userFlows\",{});r(this,\"_defaultEnv\",\"production\")}static get Main(){let n=Ps();return n||(X._main||(X._main=new X,Os(X._main)),X._main)}setEnvironment(n){this._defaultEnv=n}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(n,e,t){return e!==void 0||t!==void 0?\"\".concat(n,\":\").concat(e||this._defaultEnv,\":\").concat(t?\"preview\":\"live\")in this.variants:n in this.preloadedComponents}getPreloadedParams(n){return this.preloadedComponents[n]}async fetchComponentV2(n,e,t){let s=this.preloadedComponents[n],i=e!==void 0||t!==void 0,a,p;!i&&s?(a=s.env,p=s.preview):(a=e||this._defaultEnv,p=t===!0?!0:t===!1?!1:!e);let d=\"\".concat(n,\":\").concat(a,\":\").concat(p?\"preview\":\"live\");return console.log(\"[CloudRepository] fetchComponentV2\",{componentId:n.slice(0,8)+\"...\",env:a,usePreview:p,cacheKey:d,cached:d in this.variants}),this.variants[d]||(this.preloadedComponents[n]||(this.preloadedComponents[n]={env:a,preview:p}),this.variants[d]=new Promise(async(c,l)=>{try{let u=\"\".concat(this._baseUrl,\"/consume?id=\").concat(n,\"&env=\").concat(a);p&&(u+=\"&preview=true\");let M=(await(await fetch(u)).json()).item;if(!M){l(new Error('Component \"'.concat(n,'\" not found')));return}if(!M.consume_variant||!M.consume_variant.length){l(new Error('Component \"'.concat(n,'\" has no implementation for environment \"').concat(a,'\"')));return}let fe=Ls(M);c(fe)}catch(u){l(u)}})),await this.variants[d]}async fetchComponentV1(n,e){return e?(await this.fetchFlow(e)).components.find(s=>s.type.id===n):(await this.fetchAutoFlow(n)).components[0]}async fetchAutoFlow(n){return this.userFlows[n]||(this.userFlows[n]=new Promise(async(e,t)=>{try{let i=await(await fetch(\"\".concat(this._baseUrl,\"/flow?id=\").concat(n,\"&auto=true\"))).json();e(i.item)}catch(s){t(s)}})),await this.userFlows[n]}async fetchFlow(n){return this.userFlows[n]||(this.userFlows[n]=new Promise(async(e,t)=>{try{let i=await(await fetch(\"\".concat(this._baseUrl,\"/flow?id=\").concat(n,\"&resolve=components\"))).json();e(i.item)}catch(s){t(s)}})),await this.userFlows[n]}async fetchComponent(n,e){return this.fetchComponentV1(n,e)}};r(X,\"_main\",null);Z=X,Do=Z});var Lo,Po=m(()=>{\"use strict\";Lo=async o=>await o()});var mn={};ee(mn,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ut,addClass:()=>Ro,applyStylesheet:()=>bo,applyStylesheetLink:()=>So,changeSkinUrlByTokenizer:()=>To,createIframeSkinByTokenizer:()=>cn,exec:()=>Lo,removeClass:()=>_o,v2_CloudRepository:()=>Do});var It=m(()=>{\"use strict\";Eo();vo();ko();Ho();Bo();Po()});var Oo,Ao=m(()=>{\"use strict\";Ot();It();b();Oo=async o=>{try{let n=new URL(window.location.href),t=new URLSearchParams(n.search).get(\"myopOverride\");if(t){let[s,...i]=Pt(t);switch(s){case\"component\":{let[a,p]=i,d=await Z.Main.fetchComponent(a);if(d&&d.type.skins.find(l=>l.id===p))return d.instance.skinSelector={type:ce.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=Pt(t),c=(await Z.Main.fetchFlow(a)).components.find(l=>l.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ce.Segmented&&c.instance.resolvedExperiences){let l=c.instance.resolvedExperiences.find(u=>u.id===p);if((l==null?void 0:l.type)===Qe.Segment){let u=l,y=c.instance.skinSelector.segments.find(M=>M.segmentId===u.segment.id);if(y)return c.instance.skinSelector=y==null?void 0:y.skinSelector,c}}}break}}}finally{return null}}});var Fo={};ee(Fo,{HostSDK:()=>$,hostSDK:()=>$o});var Ko,$,$o,$e=m(()=>{\"use strict\";te();I();w();Zn();eo();ze();b();je();wo();Ao();Ko=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",$=class{constructor(){r(this,\"components2init\",[]);r(this,\"components\",[]);r(this,\"componentsLoaders\",[]);r(this,\"initiated\",!1);r(this,\"version\",ye);r(this,\"type2InstanceCount\",{});r(this,\"assignId\",n=>(this.type2InstanceCount[n.id]||(this.type2InstanceCount[n.id]=0),\"\".concat(n.id,\"_\").concat(++this.type2InstanceCount[n.id])));r(this,\"inspected\",!1);r(this,\"inspect\",()=>{this.inspected||(this.inspected=!0,this.components.forEach(n=>{n.inspect&&n.inspect()}))});r(this,\"incomingMessageHandler\",n=>{if(n.origin,document.location.origin,n.data.myop){if(n.data.direction!==v.up&&n.data.messageType!==f.EnvelopedMessage)return;let e=n.data;if(e.messageType===f.InitRequest){this.components2init.forEach(s=>{s.send(new he(s.id))});return}if(e.messageType===f.InitResponse){this.components2init=this.components2init.filter(i=>i.id!==e.content.id);let s=this.components.find(i=>{var a;return i.id===((a=e.content)==null?void 0:a.id)});s==null||s.setInitiated();return}if(e.messageType===f.EnvelopedMessage){let s=e,i=this.components.find(a=>a.id===s.destination);if(i){if(s.direction===v.down){s.message.messageType===A.name?i.onMessageReceived(s.message):(s.message.route=s.route,i.send(s.message));return}}else{let a=this.components.find(p=>p.id===s.message.destination);a&&a.send(s.message)}return}let t=this.components.find(s=>s.id===e.destination);if(!t){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(t){if(t.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});r(this,\"send\",n=>{let e=new MessageEvent(\"\",{data:n});this.incomingMessageHandler(e)});r(this,\"init\",n=>{if(this.initiated)throw new Error(\"hostSDK already initiated\");let e=[new Xe,new et,new ft];if(this.componentsLoaders=[...e],n){let t={};n.forEach(s=>{let i=new s(this.componentsLoaders);t[i.type]=i}),this.componentsLoaders.forEach(s=>{t[s.type]||(t[s.type]=s)}),this.componentsLoaders=Object.values(t)}window.addEventListener(\"message\",this.incomingMessageHandler,!1),console.log(\"myop hostSDK initiated\",document.location.href),this.initiated=!0});r(this,\"_getSkinIdBySkinSelector\",async(n,e=[],t)=>{var i;async function s(a,p){for(let d of a)if(await p(d))return d}switch(n.type){case\"DedicatedSkin\":case ce.Dedicated:return((i=n.skin)==null?void 0:i.id)||n.skins[0].id;case ce.Segmented:{let p=await s(n.segments,async d=>{if(d.segmentId===\"Default\")return!0;let c=e.find(y=>y.type===Qe.Segment?y.segment.id===d.segmentId:!1);if(!c)throw new Error(\"experience not found\");let u=c.segment,g=(t||{})[u.function];return g?await g():(console.warn(\"segmentId:\".concat(d.segmentId,\", \").concat(u.function,\" function not provided !\")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return\"\"});r(this,\"runSkinSelector\",async(n,e)=>{let t=await this._getSkinIdBySkinSelector(n.instance.skinSelector,n.instance.resolvedExperiences,e);return n.type.skins.find(s=>s.id===t)});r(this,\"loaderHooks\");r(this,\"loadComponent\",async(n,e,t)=>{var l,u,g,y;if(!e){debugger;throw new Error(\"no container was found for this component\")}let s=await Oo(n);s&&(n=s);let i=h(h({},(l=this.loaderHooks)!=null?l:{}),(u=t==null?void 0:t.hooks)!=null?u:{}),a=e;if(a.myop)if(a.component){n=h({},n),n.instance=h({},n.instance);let M=await this.runSkinSelector(n,i);if(!M)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");return(g=t==null?void 0:t.hooks)!=null&&g.afterSkinSelected&&(M=await t.hooks.afterSkinSelected(h({},M))),n.instance.skinSelector={type:ce.Dedicated,skin:M},t&&(t=h({},t),delete t.hooks),await tn(a,n,this.components,t)}else throw new Error(\"load component got a detached ref.\");e=e;let p=await this.runSkinSelector(n,i);if(!p)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");(y=t==null?void 0:t.hooks)!=null&&y.afterSkinSelected&&(p=await t.hooks.afterSkinSelected(h({},p)));let d=this.componentsLoaders.find(M=>M.type===p.loader.type);if(!d){debugger;throw new Error('no loader \"'.concat(p.loader.type,'\" was found for component'))}let c=await d.load(n.type,p,e,t);c.isInitiated||this.components2init.push(c),c.bind(\"onDispose\",()=>(this.components=this.components.filter(M=>M!==c),this.components2init=this.components2init.filter(M=>M!==c),!0)),this.components.push(c),(!t||t.connectProps!==!1)&&(c=Xn(c,n.type.props,p));try{await nn(c,n,this.components)}catch(M){throw M}return t!=null&&t.skipInit||await c.initiated(),c});r(this,\"navigate\",async(n,e,t)=>{if(n.parent)throw new Error(\"Navigating on remote ref components is not implemented yet\");if(t!=null&&t.staged){let s=await this.loadComponent(e,n.container,h({hidden:!0,relative:{direction:\"after\",child:n.element}},t));return t.init&&await t.init(s),s.show(),n.dispose(),s}else{let s=n.element.nextSibling;return n.dispose(),this.loadComponent(e,n.container,h({relative:{direction:\"before\",child:s}},t))}})}};r($,\"Instance\",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ko});if(!window.myop.hostSDK){let o=new $;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ko}),window.myop.hostSDK=o}$o=window.myop.hostSDK;F(\"hostSDK\",$o)});var Ct,zo=m(()=>{\"use strict\";I();J();b();w();Ct=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.DetectMyopRefsMessage);r(this,\"executor\",e=>{let t=document.querySelectorAll(\"[\".concat(B.id,\"]\")),s=[];t.forEach(i=>{let a=i.getAttribute(B.id);a&&s.push(new Ie(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new pe(e.handlerUniqueId,s))})}}});var xt,Wo=m(()=>{\"use strict\";I();b();w();L();xt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.BindClickMessage);r(this,\"executor\",e=>{let t=[];return S(e.ref,document).forEach(i=>{let a=()=>{this.messageToHost(new oe,e)};i.addEventListener(\"click\",a);let p=()=>{i.removeEventListener(\"click\",a)};t.push(p)}),()=>{t.forEach(i=>i())}})}}});var wt,No=m(()=>{\"use strict\";I();b();L();wt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.ChangeTextMessage);r(this,\"executor\",e=>{S(e.ref,document).forEach(s=>{s.textContent=e.content})})}}});var bt,Uo=m(()=>{\"use strict\";I();w();b();pn();bt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.ExecuteScriptMessage);r(this,\"executor\",e=>{pt(e,s=>{this.messageToHost(new se(e.handlerUniqueId,s))},new we(document.documentElement))})}}});var St,qo=m(()=>{\"use strict\";I();b();w();me();L();St=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.AddEventListenerMessage);r(this,\"executor\",e=>{let t=S(e.ref,document),s=[];return t.forEach(i=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new re(e.handlerUniqueId,O(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),s.push(()=>{i.removeEventListener(e.type,a)})}),()=>{s.forEach(i=>{i()})}})}}});var Et,Vo=m(()=>{\"use strict\";I();b();L();Et=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.SetAttributeMessage);r(this,\"executor\",e=>{S(e.ref,document).forEach(s=>{s.setAttribute(e.name,e.value)})})}}});var Tt,jo=m(()=>{\"use strict\";I();J();b();$e();Ge();Tt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.CreateRefComponentMessage);r(this,\"executor\",e=>{(async()=>{let s=document.querySelectorAll(\"[\".concat(B.id,\"='\").concat(e.refConfig.selector,\"']\"));if(s.length===1){let a=await $.Instance().loadComponent(e.nestedComponentConfig,s.item(0),e.options),p=[];Object.keys(a.refs).forEach(d=>{let c=a.refs[d];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:d,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new V(e.handlerUniqueId,p))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new V(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var Go,Yo=m(()=>{\"use strict\";Go=(o,n)=>{if(!o){console.log(\"n\");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!o||o.nodeType!==1))if(e){let t=new e(n),s={attributes:!0,childList:!0,subtree:!0};return t.observe(o,s),t}else window.addEventListener&&(o.addEventListener(\"DOMNodeInserted\",n,!1),o.addEventListener(\"DOMNodeRemoved\",n,!1))}});var vt,Qo=m(()=>{\"use strict\";I();w();b();Yo();vt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.SetMutationObserverMessage);r(this,\"executor\",e=>{e.source&&Go(document.body,()=>{this.messageToHost(new Be)})})}}});var Jo,Rt,Xo=m(()=>{\"use strict\";I();J();b();w();me();L();Jo=o=>{if(!o)return null;if(o.tagName===\"FORM\"){let n=new FormData(o),e={formData:{},unmappedData:[]},t=o.querySelectorAll(\"input, select, textarea\"),s=-1;return t.forEach(i=>{if(typeof i.value==\"string\"){let a=i.getAttribute(B.id),p=i.getAttribute(\"name\"),d={id:i.id,name:p,value:Jo(i),required:i.required,validity:O(i.validity,!0),myopId:a};e.unmappedData.push(d),p&&(!e.formData[p]||!e.formData[p].value||d.value)&&(e.formData[p]=d)}}),e}return o.type===\"checkbox\"||o.type===\"radio\"?o.checked?o.value:null:o.tagName===\"INPUT\"||o.tagName===\"TEXTAREA\"||o.tagName===\"SELECT\"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Rt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.GetElementValueMessage);r(this,\"executor\",e=>{S(e.ref,document).forEach(s=>{this.messageToHost(new ie(Jo(s)),e)})})}}});var _t,Zo=m(()=>{\"use strict\";I();b();w();L();_t=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.GetAttributeMessage);r(this,\"executor\",e=>{let t=to(e.ref,document);t&&this.messageToHost(new De(t.getAttribute(e.name)),e)})}}});var kt,es=m(()=>{\"use strict\";w();I();b();kt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.SetResizeObserverMessage);r(this,\"executor\",e=>{let t=new ResizeObserver(s=>{this.messageToHost(new Ae)});return t.observe(document.body),()=>{t.disconnect()}})}}});var Ht,ts=m(()=>{\"use strict\";I();b();L();Ht=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.SetInnerHtml);r(this,\"executor\",e=>{S(e.ref,document).forEach(s=>{s.innerHTML=e.content})})}}});var ns={};ee(ns,{IframeSDK:()=>Dt});var Dt,os=m(()=>{\"use strict\";b();zo();Wo();No();Uo();te();qo();Vo();w();jo();Qo();Xo();je();Zo();es();ts();Dt=class extends Ce{constructor(){super();r(this,\"version\",ye);r(this,\"messageToHost\",(e,t)=>{var i;!e.replayToHandler&&(t!=null&&t.handlerUniqueId)&&(e.replayToHandler=t.handlerUniqueId);let s=Object.keys(this.components);e.destination||(t!=null&&t.route?e.destination=t.route[t.route.length-1]:e.destination=s[0]),e.source||(e.source=s[0]),e.direction=v.up,(i=window.parent)==null||i.postMessage(h({},e),\"*\")});r(this,\"supportedHandlers\",[new wt(this.messageToHost),new Ht(this.messageToHost),new xt(this.messageToHost),new Ct(this.messageToHost),new bt(this.messageToHost),new St(this.messageToHost),new Et(this.messageToHost),new Rt(this.messageToHost),new vt(this.messageToHost),new kt(this.messageToHost),new _t(this.messageToHost),new Tt(this.messageToHost)]);r(this,\"init\",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new ae)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};F(\"IframeSDK\",Dt)});var Ks={};var As,ss=m(()=>{\"use strict\";w();te();As=h({},Me);F(\"MyopMessages\",As)});var rs={};ee(rs,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ut,addClass:()=>Ro,applyStylesheet:()=>bo,applyStylesheetLink:()=>So,changeSkinUrlByTokenizer:()=>To,createIframeSkinByTokenizer:()=>cn,exec:()=>Lo,removeClass:()=>_o,v2_CloudRepository:()=>Do});var is=m(()=>{\"use strict\";te();It();It();F(\"MyopHelpers\",mn)});var Ns={};ee(Ns,{getHostModule:()=>as,getIframeModule:()=>ps,getWebcomponentModule:()=>ds});te();var Mn;if(window.__federation__)console.log(\"__federation__ loaded more than once.\");else{let o=(Mn=document.currentScript)==null?void 0:Mn.src,n=o?o.split(\"/\").slice(0,-1).join(\"/\"):\"\";window.__federation__={__public_auto_path__:n,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(o,n,e)=>{if(window.__federation__[n])console.log(\"__federation__ module \".concat(n,\" already loaded.\")),e(window.__federation__[n][Lt]);else{let t;window.__federation__[n]={},window.__federation__[n][Ve]=s=>{t&&(document.head.removeChild(t),t=null),window.__federation__[n][Lt]=s,e(s)},t=document.createElement(\"script\"),t.type=\"module\",t.src=o,t.async=!0,document.head.appendChild(t)}};je();console.log(\"myop root sdk - loaded\",document.location.origin);var $s=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",as=()=>Promise.resolve().then(()=>($e(),Fo)),ps=()=>Promise.resolve().then(()=>(os(),ns)),ds=()=>Promise.resolve().then(()=>(dn(),uo)),Fs=()=>Promise.resolve().then(()=>(ss(),Ks)),zs=()=>Promise.resolve().then(()=>(is(),rs)),We=o=>async()=>(await o()).get(),Ws={version:ye,getHostModule:We(as),getIframeModule:We(ps),getWebcomponentModule:We(ds),getMyopMessages:We(Fs),getMyopHelpers:We(zs)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:$s});window.myop.rootSDK?console.log(\"myop root host loaded more than once.\"):window.myop=h({rootSDK:Ws},window.myop);return Ms(Ns);})();\n</script>\n </head>\n <body>\n <div id=\"myop-container\"></div>\n <script>\n // Initialize hostSDK on page load\n (async function initSDK() {\n try {\n // Use the internal getHostModule which returns the module directly\n const hostModule = await MyopSDK.getHostModule();\n // hostModule is the exports object with { hostSDK, HostSDK }\n window.__myopHostSDK = hostModule.hostSDK || window.myop.hostSDK;\n window.ReactNativeWebView.postMessage('WEBVIEW_READY');\n } catch (err) {\n window.ReactNativeWebView.postMessage('SDK_INIT_ERROR:' + err.message);\n }\n })();\n\n async function loadMyopComponent(configAsString, optionsAsString) {\n try {\n const componentConfig = JSON.parse(decodeURIComponent(configAsString));\n const options = optionsAsString ? JSON.parse(decodeURIComponent(optionsAsString)) : undefined;\n const container = document.getElementById('myop-container');\n window.myopComponent = await window.__myopHostSDK.loadComponent(componentConfig, container, options);\n\n // Set up myop_cta_handler to forward calls to React Native via SDK prop system\n if (window.myopComponent) {\n window.myopComponent.props.myop_cta_handler = function(action, payload) {\n window.ReactNativeWebView.postMessage('CTA:' + JSON.stringify({ action: action, payload: payload }));\n };\n }\n\n window.ReactNativeWebView.postMessage('COMPONENT_LOADED');\n } catch (err) {\n window.ReactNativeWebView.postMessage('COMPONENT_ERROR:' + err.message);\n }\n }\n </script>\n </body>\n</html>\n";
2
2
  //# sourceMappingURL=componentHost.html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"componentHost.html.d.ts","sourceRoot":"","sources":["../src/componentHost.html.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,u7pEA+DhB,CAAC"}
1
+ {"version":3,"file":"componentHost.html.d.ts","sourceRoot":"","sources":["../src/componentHost.html.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,0kyEAgEhB,CAAC"}
@@ -3,7 +3,7 @@
3
3
  // SDK loaded from @myop/sdk at build time
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.HTML = void 0;
6
- const SDK_CONTENT = `"use strict";var MyopSDK=(()=>{var ze=Object.defineProperty,ds=Object.defineProperties,cs=Object.getOwnPropertyDescriptor,ms=Object.getOwnPropertyDescriptors,ls=Object.getOwnPropertyNames,gn=Object.getOwnPropertySymbols;var un=Object.prototype.hasOwnProperty,fs=Object.prototype.propertyIsEnumerable;var Dt=(o,t,e)=>t in o?ze(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,h=(o,t)=>{for(var e in t||(t={}))un.call(t,e)&&Dt(o,e,t[e]);if(gn)for(var e of gn(t))fs.call(t,e)&&Dt(o,e,t[e]);return o},N=(o,t)=>ds(o,ms(t));var m=(o,t)=>()=>(o&&(t=o(o=0)),t);var ee=(o,t)=>{for(var e in t)ze(o,e,{get:t[e],enumerable:!0})},gs=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ls(t))!un.call(o,r)&&r!==e&&ze(o,r,{get:()=>t[r],enumerable:!(n=cs(t,r))||n.enumerable});return o};var us=o=>gs(ze({},"__esModule",{value:!0}),o);var s=(o,t,e)=>Dt(o,typeof t!="symbol"?t+"":t,e);var $e,Ue,Bt,z,te=m(()=>{"use strict";$e="__federation__",Ue="onLoad",Bt="moduleInstance",z=(o,t)=>{window[$e]&&window[$e][o]&&window[$e][o][Ue]&&window[$e][o][Ue]({[o]:t})}});var ue,Ne=m(()=>{ue="0.3.13"});var l,I=m(()=>{"use strict";l={InitRequest:"InitRequest",InitResponse:"InitResponse",InitMessage:"InitMessage",DisposeMessage:"DisposeMessage",ChangeTextMessage:"ChangeTextMessage",BindClickMessage:"BindClickMessage",DetectMyopRefsMessage:"DetectMyopRefsMessage",ExecuteScriptMessage:"ExecuteScriptMessage",AddEventListenerMessage:"AddEventListenerMessage",SetAttributeMessage:"SetAttributeMessage",CreateRefComponentMessage:"CreateRefComponentMessage",EnvelopedMessage:"EnvelopedMessage",GetElementValueMessage:"GetElementValueMessage",GetAttributeMessage:"GetAttributeMessage",SetInnerHtml:"SetInnerHtml",ExecuteComponentMethod:"ExecuteComponentMethod",SetMutationObserverMessage:"SetMutationObserverMessage",SetResizeObserverMessage:"SetResizeObserverMessage",CleanupMessage:"CleanupMessage",In:{DetectedMyopRefsMessage:"DetectedMyopRefsMessage",ClickReplayMessage:"ClickReplayMessage",ExecuteScriptReplyMessage:"ExecuteScriptReplyMessage",EventListenerCallbackMessage:"EventListenerCallbackMessage",ElementValueReplayMessage:"ElementValueReplayMessage",GetAttributeReplayMessage:"GetAttributeReplayMessage",RefComponentCreatedMessage:"RefComponentCreatedMessage",EnvelopedMessage:"EnvelopedMessage",MutationObserverMessage:"MutationObserverMessage",CleanupReplayMessage:"CleanupReplayMessage",ResizeObserverMessage:"ResizeObserverMessage"}}});var T,ys,hs,Lt,Ot=m(()=>{"use strict";T=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+o/4).toString(16)),ys=o=>{let t=[...o].map(e=>e.toString(16).padStart(2,"0")).join("");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join("-")},hs=o=>{let t=o.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";let e=atob(t);return Uint8Array.from(e,n=>n.charCodeAt(0))},Lt=o=>{let t=hs(o);if(t.length%16!==0)throw new Error("Invalid input length");let e=[];for(let n=0;n<t.length;n+=16)e.push(ys(t.slice(n,n+16)));return e}});var hn,ne=m(()=>{"use strict";Ot();hn=o=>new Promise(t=>setTimeout(t,o))});var R,C,Pt,v,_,G,k=m(()=>{"use strict";ne();R=class{};s(R,"down","down"),s(R,"up","up");C=class{constructor(){s(this,"id",T());s(this,"myop",!0);s(this,"content");s(this,"source");s(this,"destination");s(this,"route");s(this,"ref");s(this,"direction");s(this,"cleanable",!1)}static create(...t){return new this(...t)}isTypeof(t){return t.messageType===this.messageType}},Pt=class extends C{constructor(e){super();this.ref=e}},v=class extends C{constructor(e){super();this.replayToHandler=e}},_=class extends C{constructor(e){super();this.handler=e;s(this,"handlerUniqueId",T())}},G=class o{constructor(t,e){this.refConfig=t;this.component=e;s(this,"myop",!0);s(this,"__nonProxied");this.__nonProxied=N(h({},this),{component:null})}static create(t,e,n){let r=e;return r||(r={id:"",name:"",description:"",selectorType:"id-attribute",selector:t,behavior:{type:"code"}}),new o(r,n)}}});var Mn,Kt,oe,In=m(()=>{"use strict";k();Mn="ClickReplayMessage",Kt=class extends _{constructor(e,n){super(n);this.ref=e;s(this,"replyMessageKey",Mn);s(this,"messageType","BindClickMessage");s(this,"cleanable",!0)}},oe=class extends v{constructor(){super(...arguments);s(this,"messageType",Mn)}}});var At,Cn=m(()=>{"use strict";k();At=class extends C{constructor(e,n){super();this.ref=e;s(this,"messageType","ChangeTextMessage");this.content=n}}});var xn,Ms,Is,wn,D,se,Ft=m(()=>{"use strict";k();xn="ExecuteScriptReplyMessage",Ms=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,Is=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,wn=o=>{let t=o.match(Ms);if(t)return t[1]||t[3];{let e=o.match(Is);if(e)return e[1].trim()}},D=class extends _{constructor(e,n=()=>{},r){super(n);this.scriptInputs=r;s(this,"replyMessageKey",xn);s(this,"messageType","ExecuteScriptMessage");s(this,"script","");this.script=e.toString(),this.content=e.toString(),this.content=wn(this.content)}};s(D,"replierKey","send"),s(D,"completeStreamKey","completeStream");se=class extends v{constructor(e,n){super(e);this.replayToHandler=e;this.content=n;s(this,"messageType",xn)}}});var W,bn=m(()=>{"use strict";Ft();W=class extends D{constructor(e,n,r=()=>{}){super(({rootRef:i,elementId:a,_script:p,__scriptInputs:d})=>{let c=(i.shadowRoot||i.container).querySelectorAll("[myop-id='".concat(a,"']"));return c.length?(d.ref=c[0],new Function("return (".concat(p,")(...arguments)"))(d)):null},r);this.scriptInputs=n;this.scriptInputs=N(h({},n),{_script:e.toString()})}}});var Sn,zt,re,Tn=m(()=>{"use strict";k();Sn="EventListenerCallbackMessage",zt=class extends _{constructor(e,n,r){super(r);this.ref=e;this.type=n;this.handler=r;s(this,"replyMessageKey",Sn);s(this,"messageType","AddEventListenerMessage");s(this,"cleanable",!0);s(this,"serializableSkeleton",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},re=class extends v{constructor(e,n){super(e);this.replayToHandler=e;this.e=n;s(this,"messageType",Sn);this.content={e:n}}}});var $t,En=m(()=>{"use strict";k();$t=class extends C{constructor(e,n,r){super();this.ref=e;this.name=n;this.value=r;s(this,"messageType","SetAttributeMessage")}}});var Rn,Ut,ie,Nt=m(()=>{"use strict";k();Rn="ElementValueReplayMessage",Ut=class extends _{constructor(e,n){super(n);this.ref=e;s(this,"replyMessageKey",Rn);s(this,"messageType","GetElementValueMessage")}},ie=class extends v{constructor(e){super();this.content=e;s(this,"messageType",Rn)}}});var Wt,vn=m(()=>{"use strict";k();Wt=class extends C{constructor(e,n){super();this.ref=e;s(this,"messageType","SetInnerHtml");this.content=n}}});var ye,Re,ae,_n=m(()=>{"use strict";k();ye=class extends C{constructor(e){super();s(this,"messageType","InitMessage");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},Re=class extends ye{constructor(){super(...arguments);s(this,"messageType","InitResponse")}},ae=class extends C{constructor(){super(...arguments);s(this,"messageType","InitRequest")}}});var kn,ve,V,We=m(()=>{"use strict";k();kn="RefComponentCreatedMessage",ve=class extends _{constructor(e,n,r,i){super(i);this.refConfig=e;this.nestedComponentConfig=n;this.options=r;s(this,"replyMessageKey",kn);s(this,"messageType","CreateRefComponentMessage")}},V=class extends v{constructor(e,n,r){super(e);this.replayToHandler=e;this.nestedRefs=n;this.failed=r;s(this,"messageType",kn)}}});var _e,Vt=m(()=>{"use strict";k();_e=class extends C{constructor(e,n){super();this.destination=e;this.message=n;s(this,"messageType","EnvelopedMessage");let r=n;this.route=[e,...r.route?r.route:[]]}}});var Hn,qt,pe,Dn=m(()=>{"use strict";k();Hn="DetectedMyopRefsMessage",qt=class extends _{constructor(){super(...arguments);s(this,"messageType","DetectMyopRefsMessage");s(this,"replyMessageKey",Hn)}},pe=class extends v{constructor(e,n){super(e);this.replayToHandler=e;s(this,"messageType",Hn);this.content=n}isTypeof(e){return e.messageType===this.messageType}}});var Bn,jt,ke,Ln=m(()=>{"use strict";k();Bn="GetAttributeReplayMessage",jt=class extends _{constructor(e,n,r){super(r);this.ref=e;this.name=n;s(this,"replyMessageKey",Bn);s(this,"messageType","GetAttributeMessage")}},ke=class extends v{constructor(e){super();this.content=e;s(this,"messageType",Bn)}}});var K,On=m(()=>{"use strict";k();K=class extends C{constructor(e){super();this.method=e;s(this,"messageType","ExecuteComponentMethod")}}});var Gt,He,Pn=m(()=>{"use strict";k();Gt=class extends C{constructor(){super(...arguments);s(this,"messageType","SetMutationObserverMessage")}},He=class extends C{constructor(){super(...arguments);s(this,"messageType","MutationObserverMessage")}}});var Kn,De,Be,An=m(()=>{"use strict";k();Kn="CleanupReplayMessage",De=class extends _{constructor(e,n){super(n);this.cleanupForMessageId=e;s(this,"replyMessageKey",Kn);s(this,"messageType","CleanupMessage")}},Be=class extends v{constructor(e){super();this.customCleanup=e;s(this,"messageType",Kn)}}});var Le,Fn=m(()=>{"use strict";k();Le=class extends C{constructor(){super(...arguments);s(this,"messageType","DisposeMessage")}}});var Jt,Oe,zn=m(()=>{"use strict";k();Jt=class extends C{constructor(){super(...arguments);s(this,"cleanable",!0);s(this,"messageType","SetResizeObserverMessage")}},Oe=class extends C{constructor(){super(...arguments);s(this,"messageType","ResizeObserverMessage")}}});var he={};ee(he,{AddEventListenerMessage:()=>zt,BaseMyopMessage:()=>C,BindClickMessage:()=>Kt,ChangeTextMessage:()=>At,CleanupMessage:()=>De,CleanupReplayMessage:()=>Be,ClickReplayMessage:()=>oe,CreateRefComponentMessage:()=>ve,CustomRefMessage:()=>W,DetectMyopRefsMessage:()=>qt,DetectedMyopRefsMessage:()=>pe,DisposeMessage:()=>Le,ElementValueReplayMessage:()=>ie,EnvelopedMessage:()=>_e,EventListenerCallbackMessage:()=>re,ExecuteComponentMethod:()=>K,ExecuteScriptMessage:()=>D,ExecuteScriptReplyMessage:()=>se,GetAttributeMessage:()=>jt,GetAttributeReplayMessage:()=>ke,GetElementValueMessage:()=>Ut,InitMessage:()=>ye,InitRequest:()=>ae,InitResponse:()=>Re,MessageDirection:()=>R,MutationObserverMessage:()=>He,MyopBindMessage:()=>_,MyopBindReplayMessage:()=>v,MyopElementMessage:()=>Pt,Ref:()=>G,RefComponentCreatedMessage:()=>V,ResizeObserverMessage:()=>Oe,SetAttributeMessage:()=>$t,SetInnerHtml:()=>Wt,SetMutationObserverMessage:()=>Gt,SetResizeObserverMessage:()=>Jt,stripFunction:()=>wn});var w=m(()=>{"use strict";k();In();Cn();Ft();bn();Tn();En();Nt();vn();_n();We();Vt();Dn();Nt();Ln();On();Pn();An();Fn();zn()});var J,Ve=m(()=>{"use strict";I();w();Pe();J=class{constructor(t,e,n){this.componentDefinition=t;this.container=e;s(this,"id","");s(this,"messageHandlers",{});s(this,"element");s(this,"_markedForDisposed",!1);s(this,"bind",(t,e)=>{this.messageHandlers[t]||(this.messageHandlers[t]=[]),this.messageHandlers[t].includes(e)||this.messageHandlers[t].push(e)});s(this,"bindWhen",(t,e,n)=>{if(!n)throw new Error("can't use component.bindWhen without an handler");this.messageHandlers[t]||(this.messageHandlers[t]=[]);let r=this.messageHandlers[t],i=a=>e(a)?(n(a),!0):!1;return r.push(i),()=>{let a=r.indexOf(i);a>-1&&r.splice(a,1)}});s(this,"setInitiated",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});s(this,"isInitiated",!1);s(this,"_whenInitiatedResolve");s(this,"_whenInitiatedReject");s(this,"_whenInitiated",new Promise((t,e)=>{this._whenInitiatedResolve=t,this._whenInitiatedReject=e}));s(this,"initiated",()=>this._whenInitiated);s(this,"props",{});s(this,"refs",{});this.id=(n==null?void 0:n.id)||F.Instance().assignId(t);let r=n!=null&&n.timeout?n==null?void 0:n.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject("timeout_".concat(r," ").concat(this.id))},r),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(t){if(this._markedForDisposed)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.");this._markedForDisposed=t}onMessageReceived(t){if(t.messageType===l.ExecuteComponentMethod){let n=t;return this[n.method]?this[n.method](n.content):console.log("method not found ".concat(n.method," on component"),this),!0}let e=this.messageHandlers[t.messageType];if(e&&e.length){let n=!1;return e.forEach(r=>{n=n||r(t)}),n}return!1}sendCleanupMessage(t){t.source=this.id,t.destination=this.id,t.direction=R.down;let e=this.bindWhen(t.replyMessageKey,r=>r.replayToHandler===t.handlerUniqueId,r=>{t.handler(r),e()}),n=t.handler;delete t.handler,this.send(t),t.handler=n}send(t){t.source||(t.source=this.id),t.destination||(t.destination=this.id),t.direction=R.down;let e;if(t.handler){let n=t;e=this.bindWhen(n.replyMessageKey,r=>r.replayToHandler===n.handlerUniqueId,n.handler),delete t.handler}return t.ref&&(t.ref=t.ref.__nonProxied||t.ref),t.cleanable?()=>{this.sendCleanupMessage(new De(t.id,n=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log("disposing component",this.id),this.send(new Le);let t=this.messageHandlers.onDispose;t&&t.forEach(e=>{e(null)}),this.messageHandlers={},this.id+="_disposed",this.isInitiated=!1}}});var Me,$n=m(()=>{"use strict";Me=class{constructor(t,e,n,r,i){this.myopId=t;this.htmlTagName=e;this.BoundingRect=n;this.offsetTop=r;this.offsetLeft=i;s(this,"type","MyopElementRef")}}});var Un,x,qe,Nn=m(()=>{"use strict";Un=async o=>{if(typeof o=="function")o();else if(o instanceof Promise){let t=await o;typeof t=="function"&&t()}},x=class{constructor(t){this.messageToHost=t}},qe=class extends x{constructor(e,n){super(e);this.messageToHost=e;this.context=n}}});var Yt,Ie,Wn=m(()=>{"use strict";I();b();w();Yt=class{constructor(t,e){this.id=t;this.context=e;s(this,"send",t=>{})}},Ie=class{constructor(){s(this,"messageToHandleAfterInit",[]);s(this,"components",{});s(this,"alwaysPassEnvelopesToHost",!1);s(this,"messageCleanupCache",{})}handleIncomeMessages(t){let e=t.data?t.data:t.detail;if(!(!e||!e.myop)){let n=e;if(n.direction!==R.down)return;if(n.messageType===l.DisposeMessage){n.destination&&delete this.components[n.destination];return}if(n.messageType===l.InitMessage){let r=n.content.id;if(this.components[r])return;this.components[r]=new Yt(r),this.messageToHost(new Re(r));return}if(n.messageType===l.EnvelopedMessage){let r=n,i=r.message;if(n=i,this.alwaysPassEnvelopesToHost||this.components[n.destination]){let a=myop.hostSDK.components.find(d=>d.id===i.destination);if(a){a.send(i);return}let p=myop.hostSDK.components.find(d=>d.id===r.destination);if(p){p.send(i);return}}else return}if(n.messageType){if(n.messageType===l.CleanupMessage){let i=n,a=this.messageCleanupCache[i.cleanupForMessageId],p=new Be(!!a);p.destination=n.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],Un(a).then(()=>{this.messageToHost(p,i)}).catch(()=>{})):this.messageToHost(p,i);return}let r=!1;this.supportedHandlers.forEach(i=>{if(i.messageType===n.messageType){r=!0;let a=i.executor(n);if(n.cleanable&&a&&(this.messageCleanupCache[n.id]=a),a&&!n.cleanable)throw new Error("Cleanup handler generated for non-cleanable message. \\nmessageType - ".concat(n.messageType,", handler executor was - ").concat(i.executor,"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."));if(!a&&n.cleanable)throw new Error("No cleanup handler generated for a cleanable message. \\nmessageType - ".concat(n.messageType,", handler executor was - ").concat(i.executor,"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."))}})}else console.log("unsupported message type")}}}});var q,de,we,Ce,ce,je,xe,b=m(()=>{"use strict";$n();Nn();Wn();q={IframeLoader:"IframeLoader",WebComponentLoader:"WebComponentLoader",HTMLLoader:"HTMLLoader",MinimizedLoader:"MinimizedLoader"},de={open:"open",closed:"closed",none:"none",localFrame:"localFrame"},we={message:"message",code:"code"},Ce=class{};s(Ce,"code","code"),s(Ce,"component","component");ce={Segmented:"Segmented",Dedicated:"Dedicated",Default:"Default"},je={Segment:"Segment",Promo:"Promo",AB:"AB"},xe=class{constructor(t,e){this.container=t;this.shadowRoot=e;s(this,"getRootDiv",()=>(this.shadowRoot||this.container).querySelector("div"));s(this,"getRoot",()=>this.shadowRoot||this.container)}}});var Xt,Cs,Qt,P,me=m(()=>{"use strict";Xt=o=>o!==Object(o),Cs=o=>typeof o=="function",Qt=o=>{if(Xt(o))return!0;if(Cs(o)||Object.getPrototypeOf(o))return!1;for(let t in o){let e=o[t];if(typeof e=="object"){if(!Qt(e))return!1}else{if(Xt(e))continue;return!1}}return!0},P=(o,t={},e=!0,n=new WeakMap)=>{if(Xt(o))return o;if(Array.isArray(o)){if(n.has(o))return n.get(o);let r=[];n.set(o,r);for(let i=0;i<o.length;i++){let a=o[i];r[i]=P(a,t,e,n)}return r}if(o!==null&&typeof o=="object"){if(n.has(o))return n.get(o);let r={};n.set(o,r);for(let i in o){let a=typeof t=="boolean"?t:t[i];a&&(a===!0?(e?o[i]!==void 0:o[i])&&(r[i]=P(o[i],!0,e,n)):typeof a=="object"&&(r[i]=P(o[i],a,e,n)))}return r}return{}}});var Vn,qn=m(()=>{"use strict";Vn={notSerializableRefCall:(o,t)=>{throw new Error("\\nThe input provided to '".concat(o.toString(),"' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \\nThe following types of data are considered non-serializable and cannot be processed:\\n\\n- Functions\\n- DOM elements\\n- Class instances\\n- Circular references\\n- Symbols\\n- BigInt values\\n\\nIn the following execution we detected :\\n~~~~~~~~\\n").concat(t," \\n~~~~~~~~\\nas not serializable.\\n\\nTo resolve this issue, please ensure that all inputs passed to '").concat(o.toString(),"' are in a serializable format.\\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \\nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\\n\\nSuggested Fix:\\n1. Remove or replace non-serializable values from your input.\\n2. If using objects, ensure they do not contain any functions or circular references.\\n3. Convert any class instances to plain objects or JSON-compatible formats.\\n4. Use dedicated Myop message.\\n\\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev.\\n\\n"))}}});var Ke,jn=m(()=>{"use strict";Ve();w();Vt();Ke=class extends J{constructor(e,n,r){super(e,n.container,r);this.componentDefinition=e;this.parent=n;s(this,"send",e=>{let n=e.handler,r=super.send(e);return this.parent.send(new _e(this.id,e)),e.handler=n,r});s(this,"dispose",()=>{this.isInitiated&&this.send(new K("dispose")),super.dispose()})}hide(){this.send(new K("hide"))}show(){this.send(new K("show"))}inspect(){return this.send(new K("inspect"))}setHeightBasedOnDocumentElement(){this.send(new K("setHeightBasedOnDocumentElement"))}setHeightBasedOnScrollHeight(){this.send(new K("setHeightBasedOnScrollHeight"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var xs,Ge,Gn,Jn,Yn,ws,Zt,en,Je=m(()=>{"use strict";w();w();b();me();qn();jn();xs=(o,t,e)=>{let n=document.createElement("a");return n.textContent=o,n.style.position="relative",n.style.padding="0 5px",n.style.fontSize="14px",n.style.top="0",n.style.top="".concat(t,"px"),n.style.transform="translateX(-50%)",n.target="_blank",n.href="https://dashboard.myop.dev/dashboard/component/".concat(e.id),n},Ge=(o,t,e,n,r,i)=>{let a=xs("".concat(i.name," : ").concat(t),e,i);return n.insertBefore(a,r),r.style.border="1px solid #007BFF",r.style.display="block",()=>{r.style.border="unset",n.removeChild(a)}},Gn=(o,t,e)=>o?!1:(console.error("Error: Undefined Prop\\n\\nIt looks like you've tried to use a prop that hasn't been defined.\\nPlease check the prop name for any typos or ensure that it is properly defined in the component's prop list.\\n\\n"+"Prop Name: ".concat(t,"\\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\\n\\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide.")),!0),Jn=(o,t,e)=>{console.error("Error: Code Prop Not Supported\\n\\nCurrently, code props are only supported in local frame components.\\n\\u26A0\\uFE0F This is a work in progress feature \\u2014 code props will be supported in upcoming versions.\\n\\nIn the meantime, you can use message props.\\n\\n"+"Prop Name: ".concat(t,"\\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\\n\\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide."))},Yn=(o,t,e)=>{let n=t.reduce((i,a)=>N(h({},i),{[a.name]:h({},a)}),{}),r={get:(i,a)=>{let p=n[a];if(Gn(p,a,o))return!1;if(p.behavior.type===we.code){if(e.loader.type===q.HTMLLoader&&e.loader.shadowRootMode===de.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return Jn(p,a,o),!1}return p.mode==="output"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(G.create(p.behavior.ref)),c.push(f=>{d(f)}),p.behavior.params&&c.push(...p.behavior.params);let g=he[p.behavior.message];o.send(new g(...c))}):null},set:(i,a,p)=>{let d=n[a];if(Gn(d,a,o))return!1;if(d.behavior.type===we.code){if(e.loader.type===q.HTMLLoader&&e.loader.shadowRootMode===de.localFrame){let g=d.behavior,f=o.element.contentWindow,u=g.remap||a;if(f[u]=p,u==="myop_cta_handler"&&f.__myop_cta_queue){let y=f.__myop_cta_queue;f.__myop_cta_queue=null,y.forEach(M=>{o.markedForDisposed||p(M.action,M.payload)})}return!0}return Jn(d,a,o),!1}else if(d.mode==="input")if(d.behavior.type==="message"){let c=[];d.behavior.ref&&c.push(G.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let g=he[d.behavior.message];return o.send(new g(...c)),!0}else throw new Error("Error: Unsupported Behavior\\n\\nThe 'behavior' field provided is not supported.\\n"+"Component: ".concat(o.componentDefinition.name,", ID: ").concat(o.componentDefinition.id,"\\n\\n")+"Prop Name: ".concat(a,"\\n")+"Behavior Field: ".concat(d.behavior.type,"\\n\\n")+"Check the documentation for valid behavior options.");return!1}};return o.props={},o.props=new Proxy(o.props,r),o},ws=(o,t)=>new Proxy(o,{get(e,n){return e[n]?e[n]:(...i)=>new Promise(a=>{i.forEach(p=>{Qt(p)||Vn.notSerializableRefCall(n,p)}),t.send(new W(({ref:p,propName:d,functionArgs:c,makeSerializable:g})=>{if(p){let f=p[d];return g(typeof f=="function"?p[d](...c):f,!0)}return null},{elementId:e.refConfig.selector,propName:n,functionArgs:i},p=>{a(p.content)}))})},set(e,n,r){return t.send(new W(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:r,propName:n},i=>{})),!0}}),Zt=async(o,t,e,n)=>{let r=o.component;if(!r)throw new Error("cant createRefComponent with detached ref");return new Promise(async(i,a)=>{let p=new Ke(t.type,r,n);e.push(p),await r.initiated();let d=setTimeout(()=>{a("timeout")},5e3);r.send(new ve(o.refConfig,t,N(h({},n||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(d),c.failed){a("CreateRefComponentMessage failed");return}let g=e.find(f=>f.id==p.id);if(g!==p){r.refs[o.refConfig.name]=g,i(g);return}else p.setInitiated(),r.refs[o.refConfig.name]=p;c.nestedRefs.forEach(f=>{let u=t.instance.resolvedNestedComponents.find(M=>M.type.id===f.componentDefinitionId).type,y=new Ke(u,p);y.setInitiated(),p.refs[f.refName]=y,e.push(y)});try{await en(p,t,e,!0),r.setHeightBasedOnScrollHeight&&r.setHeightBasedOnScrollHeight(),i(p)}catch(f){a(f)}}))})},en=async(o,t,e,n=!1)=>{o.refs||(o.refs={});let r=Object.values(o.componentDefinition.refs).map(i=>new Promise(async(a,p)=>{var d;if(i.behavior.type==Ce.component){if(n){a();return}let c=i.behavior.componentId;c||(c=i.behavior.instance.componentId);let g=(d=t.instance.resolvedNestedComponents)==null?void 0:d.find(u=>u.type.id===c);if(!g)throw new Error("componentConfig provided without nestedComponentConfig check the config object");let f=G.create("",i,o);try{let u=await Zt(f,g,e);o.refs[i.name]=u,a()}catch(u){p(u)}}else try{let c=G.create("",i,o);o.refs[i.name]=ws(c,o),a()}catch(c){}}));try{await Promise.all(r)}catch(i){throw i}}});var be,tn=m(()=>{"use strict";Ve();w();Je();I();be=class extends J{constructor(e,n,r,i,a){super(e,r,a);this.componentConfig=e;this.container=r;this.IframeElement=i;s(this,"cleanupInspect");s(this,"setHeightBasedOnDocumentElement",()=>{let e=this.send(new D(()=>window.document.documentElement.scrollHeight,n=>{this.IframeElement.style.height="".concat(n.content,"px"),e()}))});s(this,"observeSizeBasedOnDocumentElement",()=>this.send(new D(({send:n})=>{let{height:r,width:i}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:d}=document.documentElement.getBoundingClientRect();n({height:p,width:d})});return a.observe(document.documentElement),a.observe(document.body),{height:r,width:i}},n=>{this.IframeElement.style.width="".concat(n.content.width,"px"),this.IframeElement.style.height="".concat(n.content.height,"px")})));s(this,"observeAutoSize",e=>{var Ee;let n=this.IframeElement,r=n.contentDocument;if(!r)return console.warn("[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible"),()=>{};let i=(O,U,ge)=>U!==void 0&&O<U?U:ge!==void 0&&O>ge?ge:O,a=O=>{if(O===void 0)return;if(typeof O=="number")return O;let U=parseFloat(O);return isNaN(U)?void 0:U},p=a(e==null?void 0:e.minWidth),d=a(e==null?void 0:e.maxWidth),c=a(e==null?void 0:e.minHeight),g=a(e==null?void 0:e.maxHeight),f=(Ee=e==null?void 0:e.loaderMinHeight)!=null?Ee:50,u=(e==null?void 0:e.explicitWidth)!==void 0,y=(e==null?void 0:e.explicitHeight)!==void 0,M=this.container.getBoundingClientRect(),le=M.width===0,Fe=M.height===0||M.height===f,j=(e!=null&&e.forceAutoSize||le)&&!u,H=(e!=null&&e.forceAutoSize||Fe)&&!y;if(!j&&!H)return()=>{};let A=()=>{var U;let O=n.contentDocument;if(O){let ge=O.documentElement.getBoundingClientRect(),cn=Math.ceil(ge.width),mn=Math.ceil(ge.height),ln=i(cn,p,d),fn=i(mn,c,g);j&&(n.style.width="".concat(ln,"px")),H&&(n.style.height="".concat(fn,"px"));let as=j&&d!==void 0&&cn>d,ps=H&&g!==void 0&&mn>g;O.documentElement.style.overflowX=as?"auto":"hidden",O.documentElement.style.overflowY=ps?"auto":"hidden",(U=e==null?void 0:e.onSizeChange)==null||U.call(e,{width:ln,height:fn,autoSizingWidth:j,autoSizingHeight:H})}};A();let fe=new ResizeObserver(A);return fe.observe(r.body),fe.observe(r.documentElement),()=>{fe.disconnect()}});s(this,"setSizeBasedOnDocumentElement",()=>{let e=this.send(new D(()=>{let{height:n,width:r}=document.documentElement.getBoundingClientRect();return{height:n,width:r}},n=>{this.IframeElement.style.width="".concat(n.content.width,"px"),this.IframeElement.style.height="".concat(n.content.height,"px"),e()}))});s(this,"setHeightBasedOnScrollHeight",()=>{let e=this.send(new D(()=>{let r=0;return r++,r--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+r+"px"},n=>{this.IframeElement.style.height=n.content,e()}))});s(this,"send",e=>{var i,a;let n=h({},e);if(n.messageType===l.ExecuteComponentMethod)return this[n.method](),()=>{};n.direction=R.down;let r=super.send(n);return(a=(i=this.IframeElement)==null?void 0:i.contentWindow)==null||a.postMessage(n,"*"),r});s(this,"dispose",()=>{this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});n.loader.autoHeight&&this.initiated().then(()=>{this.setHeightBasedOnScrollHeight()}),this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=Ge(this.id,"MyopIframeComponent",10,this.container,this.IframeElement,this.componentDefinition),()=>{this.cleanupInspect(),this.cleanupInspect=void 0})}hide(){this.IframeElement.style.opacity="0",this.IframeElement.style.position="absolute",this.IframeElement.style.pointerEvents="none",this.IframeElement.style.visibility="hidden"}show(){this.IframeElement.style.opacity="1",this.IframeElement.style.position="unset",this.IframeElement.style.pointerEvents="all",this.IframeElement.style.visibility="visible"}onMessageReceived(e){return e.messageType===l.In.MutationObserverMessage||e.messageType===l.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var Y,Ye=m(()=>{"use strict";Y=class{constructor(){s(this,"appendChild",(t,e,n)=>{var r;if(n!=null&&n.relative){if(n.relative.direction==="before")return t.insertBefore(e,n.relative.child);if(n.relative.direction==="after"){let i=(r=n.relative.child)==null?void 0:r.nextSibling;return t.insertBefore(e,i||null)}}else return t.appendChild(e)})}}});var bs,Xe,Xn=m(()=>{"use strict";tn();Ye();ne();b();bs=(o,t,e)=>{let n=new URL(o);return n.searchParams.append(t,e),n.toString()},Xe=class extends Y{constructor(){super(...arguments);s(this,"type",q.IframeLoader);s(this,"load",async(e,n,r,i)=>{let a,p=n.loader;if((r==null?void 0:r.nodeName)==="IFRAME")console.log("needs to load into an exsisting Iframe...",p.url,r),a=r,a.src=p.url;else{let d=T(),c="myop-comp-".concat(d);a=document.createElement("iframe"),a.id=c;let g="\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n height: ".concat(p.autoHeight||!p.height?"100%":p.height,";\\n width: 100%;\\n overflow: hidden;\\n border: none;\\n opacity: ").concat(i!=null&&i.hidden?"0":"1",";\\n pointer-events: ").concat(i!=null&&i.hidden?"none":"all",";\\n ");a.style.cssText=g,i!=null&&i.elementAttributes&&Object.entries(i.elementAttributes).forEach(([u,y])=>{y===""||y===null||y===void 0?a.setAttribute(u,""):a.setAttribute(u,String(y))});let f=n.loader.url;i!=null&&i._hasParent&&(f=bs(f,"_myop-comp",d)),a.src=f,r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),a=this.appendChild(r,a,i)}return new be(e,n,r,a,i)})}}});var Qe,nn=m(()=>{"use strict";Qe={webcomponent_message_key:"myop_webcomponent_message"}});var Se,on=m(()=>{"use strict";nn();Ve();Je();Se=class extends J{constructor(e,n,r,i,a){super(e,r,a);this.container=r;this.customElement=i;s(this,"cleanupInspect",()=>{});s(this,"send",e=>{let n=h({},e),r=super.send(n),i=new CustomEvent(Qe.webcomponent_message_key,{detail:n});try{this.customElement.dispatchEvent(i)}catch(a){console.log("error while trying to dispatchEvent",a)}return r});s(this,"dispose",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i}inspect(){return this.cleanupInspect=Ge(this.id,"MyopWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){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"}show(){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=""}}});var sn,Ze,Qn=m(()=>{"use strict";on();Ye();ne();b();sn={},Ze=class extends Y{constructor(){super(...arguments);s(this,"type",q.WebComponentLoader);s(this,"load",async(e,n,r,i)=>{let a=n.loader;sn[a.url]?console.log("Module alreday loaded or in loading process"):sn[a.url]=new Promise((c,g)=>{let f=a.url,u=document.createElement("script");u.type="module",u.src=f,u.onload=()=>{c()},u.onerror=()=>{g()},document.head.appendChild(u)}),await sn[a.url],await hn(1);let p="myop-comp-".concat(T()),d=document.createElement(a.tag);return r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),d.id=p,i!=null&&i.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),i!=null&&i._environment&&(d._myopEnvironment=i==null?void 0:i._environment),this.appendChild(r,d,i),new Se(e,n,r,d,i)})}}});var E,$=m(()=>{"use strict";b();E=class extends qe{constructor(e,n){super(e);this.context=n;s(this,"executor",e=>{if(e.destination){let n=e.destination;if(this.context[n].context){let r=(i,a)=>{this.messageToHost(N(h({},i),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[n].context,r)}else debugger}else debugger})}}});var B,X=m(()=>{"use strict";B={id:"myop-id"}});var S,Zn,L=m(()=>{"use strict";X();S=(o,t)=>t.querySelectorAll("[".concat(B.id,"='").concat(o.refConfig.selector,"']")),Zn=(o,t)=>{let e=S(o,t);return e.length?e.item(0):null}});var et,eo=m(()=>{"use strict";I();w();$();L();et=class extends E{constructor(){super(...arguments);s(this,"messageType",l.BindClickMessage);s(this,"innerExecutor",(e,n,r)=>{let i=S(e.ref,n.shadowRoot),a=[];return i.forEach(p=>{let d=()=>{r(new oe(e.handlerUniqueId))};p.addEventListener("click",d),a.push(()=>{p.removeEventListener("click",d)})}),()=>{a.forEach(p=>p())}})}}});var tt,to=m(()=>{"use strict";I();$();L();tt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.ChangeTextMessage);s(this,"innerExecutor",(e,n)=>{S(e.ref,n.shadowRoot).forEach(i=>{i.textContent=e.content})})}}});var nt,no=m(()=>{"use strict";b();nt=class extends xe{constructor(e,n){super(e,n);this.container=e;this.shadowRoot=n}}});var ot,oo=m(()=>{"use strict";b();X();$();w();I();ot=class extends E{constructor(){super(...arguments);s(this,"innerExecutor",(e,n)=>{let r=n.shadowRoot.querySelectorAll("[".concat(B.id,"]")),i=[];r.forEach(a=>{let p=a.getAttribute(B.id);p&&i.push(new Me(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new pe(e.handlerUniqueId,i))});s(this,"messageType",l.DetectMyopRefsMessage)}}});var st,so=m(()=>{"use strict";I();$();L();st=class extends E{constructor(){super(...arguments);s(this,"messageType",l.SetAttributeMessage);s(this,"innerExecutor",(e,n)=>{S(e.ref,n.shadowRoot).forEach(i=>{i.setAttribute(e.name,e.value)})})}}});var rt,ro=m(()=>{"use strict";I();w();$();L();me();rt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.AddEventListenerMessage);s(this,"innerExecutor",(e,n,r)=>{let i=S(e.ref,n.shadowRoot),a=[];return i.forEach(p=>{let d=c=>{r(new re(e.handlerUniqueId,P(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var it,io=m(()=>{"use strict";I();X();Pe();We();$();it=class extends E{constructor(){super(...arguments);s(this,"messageType",l.CreateRefComponentMessage);s(this,"innerExecutor",(e,n,r)=>{(async()=>{let a=n.shadowRoot.querySelectorAll("[".concat(B.id,"='").concat(e.refConfig.selector,"']"));if(a.length===1){let p=F.Instance(),d=p.components.find(u=>u.id===e.options.id);d&&d.dispose();let c=p.components.indexOf(d);c!==-1&&p.components.splice(c,1);let g=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),f=[];Object.keys(g.refs).forEach(u=>{let y=g.refs[u];y=y.__nonProxied||y,y.componentDefinition&&f.push({refName:u,componentDefinitionId:y.componentDefinition.id})}),r(new V(e.handlerUniqueId,f))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new V(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var at,rn=m(()=>{"use strict";me();at=(o,t,e)=>{let n=o.scriptInputs?o.scriptInputs:{};n.makeSerializable=P,n.send=t,n.rootRef=e,n.__scriptInputs=n;let i=new Function("return (".concat(o.script,")(...arguments)"))(n);t(i)}});var pt,ao=m(()=>{"use strict";I();w();$();rn();pt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.ExecuteScriptMessage);s(this,"innerExecutor",(e,n,r)=>{at(e,a=>{r(new se(e.handlerUniqueId,a))},n)})}}});var po,dt,co=m(()=>{"use strict";I();w();$();L();X();me();po=o=>{if(!o)return null;if(o.tagName==="FORM"){let t=new FormData(o),e={formData:{},unmappedData:[]},n=o.querySelectorAll("input, select, textarea"),r=-1;return n.forEach(i=>{if(typeof i.value=="string"){let a=i.getAttribute(B.id),p=i.getAttribute("name"),d={id:i.id,name:p,value:po(i),required:i.required,validity:P(i.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(d):(e.unmappedData.push(e.formData[p]),e.formData[p]=d):e.formData[p]=d:e.unmappedData.push(d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},dt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.GetElementValueMessage);s(this,"innerExecutor",(e,n,r)=>{S(e.ref,n.shadowRoot).forEach(a=>{r(new ie(po(a)),e)})})}}});var ct,mo=m(()=>{"use strict";I();$();L();ct=class extends E{constructor(){super(...arguments);s(this,"messageType",l.SetInnerHtml);s(this,"innerExecutor",(e,n)=>{S(e.ref,n.shadowRoot).forEach(i=>{i.innerHTML=e.content})})}}});var lo={};ee(lo,{WebComponentSDK:()=>Te});var Te,an=m(()=>{"use strict";b();I();nn();eo();to();no();oo();te();w();so();ro();io();ao();co();mo();Te=class extends Ie{constructor(){super(...arguments);s(this,"alwaysPassEnvelopesToHost",!0);s(this,"connectedCallback",(e,n)=>{e.addEventListener(Qe.webcomponent_message_key,r=>{let i=r.data?r.data:r.detail;if(!i||!i.myop){debugger;throw new Error("recvied webcomponent_message with wrong type")}else{let a=i;if(this.handleIncomeMessages(r),a.messageType===l.InitMessage){let p=a.content.id;this.components[p].context=new nt(e,n)}}}),setTimeout(()=>{this.messageToHost(new ae)},1)});s(this,"messageToHost",(e,n)=>{e.direction=R.up,!e.replayToHandler&&(n!=null&&n.handlerUniqueId)&&(e.replayToHandler=n.handlerUniqueId),window.myop.hostSDK.send(e)});s(this,"supportedHandlers",[new tt(this.messageToHost,this.components),new ct(this.messageToHost,this.components),new et(this.messageToHost,this.components),new ot(this.messageToHost,this.components),new st(this.messageToHost,this.components),new rt(this.messageToHost,this.components),new pt(this.messageToHost,this.components),new dt(this.messageToHost,this.components),new it(this.messageToHost,this.components)]);s(this,"init",()=>{})}};z("WebComponentSDK",Te)});var fo=m(()=>{"use strict";an()});var go,uo=m(()=>{"use strict";go=""});function Ss(o,t){return class extends HTMLElement{connectedCallback(){let e=t===de.open?"open":"closed",n=this.attachShadow({mode:e});Mo().then(r=>{r.connectedCallback(this,n),n.innerHTML=o})}}}var ho,mt,Mo,Ts,Es,Rs,lt,Io=m(()=>{"use strict";on();Ye();ne();b();fo();tn();uo();ho=[],Mo=async()=>(mt||(mt=new Te,mt.init()),mt);Ts=(o,t,e)=>{customElements.define(o,Ss(t,e)),console.log("define('".concat(o,"') was called, web component ready to use"))},Es=o=>o.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/(\\d+)/g,"-$1").toLowerCase(),Rs=o=>(o=Es(o),o.replace(/_/g,"-")),lt=class extends Y{constructor(){super(...arguments);s(this,"type",q.HTMLLoader);s(this,"load",async(e,n,r,i)=>{let a=n.loader,p="myop-comp-".concat(T()),d;if(a.shadowRootMode===de.localFrame){let c=T(),g="myop-comp-".concat(c),f=document.createElement("iframe");f.id=g,f.style.cssText="\\n display: block;\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n overflow: hidden;\\n border: none;\\n opacity: ".concat(i!=null&&i.hidden?"0":"1",";\\n width: 100%;\\n height: 100%;\\n pointer-events: ").concat(i!=null&&i.hidden?"none":"all",";\\n "),r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),f=this.appendChild(r,f,i);let u=f.contentDocument||f.contentWindow.document;u.open();let y=a.HTML;if(i!=null&&i._inspection){let H=new DOMParser().parseFromString(a.HTML,"text/html"),A=H.getElementById("myop_preview");A==null||A.removeAttribute("type");let fe=H.implementation.createHTMLDocument();fe.body.innerHTML="<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>";let Ee=fe.body.firstChild;Ee&&H.head&&H.head.insertBefore(H.importNode(Ee,!0),H.head.firstChild),y=H.documentElement.outerHTML}else{let H=new DOMParser().parseFromString(a.HTML,"text/html"),A=H.getElementById("myop_preview");A&&(A.remove(),y=H.documentElement.outerHTML)}u.writeln(y);let M='<script src="'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'"><\\/script>'),le="<script>\\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\\n const __myop_init = async () => {\\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\\n const sdk = new IframeSDK();\\n sdk.init();\\n }\\n __myop_init().then();\\n <\\/script>";if(u.writeln("".concat(M).concat(le)),(i==null?void 0:i.data)!==void 0){let j="<script>\\n window.__myop_cta_queue = [];\\n window.myop_cta_handler = function(action, payload) {\\n window.__myop_cta_queue.push({action: action, payload: payload});\\n };\\n <\\/script>",H=JSON.stringify(i.data).replace(/<\\/script/gi,"\\\\u003c/script"),A='<script id="__myop_init_data_script">\\n (function() {\\n var data = '.concat(H,";\\n var scriptEl = document.getElementById('__myop_init_data_script');\\n\\n var callInitInterface = function(fn) {\\n var startTime = performance.now();\\n // Mark as pre-injected data call for extension tracking\\n window.__myop_init_preinjected = true;\\n try {\\n fn(data);\\n } finally {\\n window.__myop_init_preinjected = false;\\n }\\n var duration = performance.now() - startTime;\\n\\n // Notify extension via postMessage (init* = pre-injected)\\n try {\\n window.parent.postMessage({\\n type: 'MYOP_PREINJECTED_INIT',\\n payload: {\\n data: data,\\n duration: duration,\\n timestamp: Date.now()\\n }\\n }, '*');\\n } catch (e) {}\\n\\n // Cleanup: remove script tag and stored data\\n if (scriptEl && scriptEl.parentNode) {\\n scriptEl.parentNode.removeChild(scriptEl);\\n }\\n delete window.__myop_init_data;\\n };\\n\\n if (typeof window.myop_init_interface === 'function') {\\n // Function already exists - call immediately\\n callInitInterface(window.myop_init_interface);\\n } else {\\n // Function not yet defined - store data and watch for definition\\n window.__myop_init_data = data;\\n\\n var _original;\\n Object.defineProperty(window, 'myop_init_interface', {\\n configurable: true,\\n enumerable: true,\\n set: function(fn) {\\n _original = fn;\\n if (window.__myop_init_data !== undefined) {\\n var storedData = window.__myop_init_data;\\n delete window.__myop_init_data;\\n callInitInterface(fn);\\n }\\n },\\n get: function() {\\n return _original;\\n }\\n });\\n }\\n })();\\n <\\/script>");u.writeln(j+A)}u.close();let Fe=new be(e,n,r,f,i);return a.autoHeight&&(f.onload=()=>{Fe.observeSizeBasedOnDocumentElement()}),Fe}if(a.shadowRootMode===de.none){let c=document.createElement("template");c.innerHTML=a.HTML,d=c.content.firstElementChild,Mo().then(g=>{g.connectedCallback(d,d)})}else{let c=Rs(e.name+n.id);ho.includes(c)||(Ts(c,a.HTML,a.shadowRootMode),ho.push(c)),d=document.createElement(c)}return r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),d.id=p,i!=null&&i.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),this.appendChild(r,d,i),new Se(e,n,r,d,i)})}}});var Co,xo,wo=m(()=>{"use strict";ne();w();Co=(o,t,e)=>{let n="myop-css-".concat(T());return o.send(new D(({rootRef:r,_stylesheet:i,_tagId:a,_css:p})=>{let d=document.createElement("style");d.type="text/css";let c=p;for(let g in i){c+="".concat(g," { ");let f=i[g];for(let u in f)c+="".concat(u,": ").concat(f[u],"; ");c+="} "}d.appendChild(document.createTextNode(c)),d.id=a,(r.shadowRoot||r.container).appendChild(d)},()=>{},{_stylesheet:t,_css:e||"",_tagId:n})),()=>{o.send(new D(({rootRef:r,_tagId:i})=>{let a=(r.shadowRoot||document).getElementById(i);a&&a.remove()},()=>{},{_tagId:n}))}},xo=(o,t)=>{let e="myop-css-".concat(T());return o.send(new D(({rootRef:n,_tagId:r,_link:i})=>{let a=document.createElement("link");a.id=r,a.rel="stylesheet",a.href=i,document.head.appendChild(a),(n.shadowRoot||n.container).appendChild(a)},()=>{},{_link:t,_tagId:e})),()=>{o.send(new D(({rootRef:n,_tagId:r})=>{let i=(n.shadowRoot||document).getElementById(r);i&&i.remove()},()=>{},{_tagId:e}))}}});var vs,pn,bo,So=m(()=>{"use strict";vs=(o,t)=>{let e=new RegExp(Object.keys(t).join("|"),"g");return o.replace(e,n=>(t[n]||n).toString())},pn=(o,t)=>{let e=o.loader;if(e.type!=="IframeLoader")throw new Error('iframeSkinUrlTokenizer received skin with loader type "'.concat(e.type,'", currently only "IframeLoader" is supported'));return o.loader=h({},o.loader),o.loader.url=vs(o.loader.url,t),o},bo=o=>async t=>pn(t,o)});var To,Eo,Ro=m(()=>{"use strict";w();To=(o,t,e)=>{o.send(new W(({ref:n,_className:r})=>{n==null||n.classList.add(r)},{elementId:e,_className:t}))},Eo=(o,t,e)=>{o.send(new W(({ref:n,_className:r})=>{n==null||n.classList.remove(r)},{elementId:e,_className:t}))}});var ut,ft,yt,gt,vo=m(()=>{"use strict";ne();ut=class ut{constructor(){s(this,"_runTimeInstanceId","runtime-instance-id-"+T());s(this,"_runTimeId","runtime-id-"+T());s(this,"_runTimeName","runtime-name-"+T());s(this,"id",this._runTimeId);s(this,"name",this._runTimeName);s(this,"description","");s(this,"loader",null);s(this,"withLoader",t=>(this.loader=t,this));s(this,"withHTMLLoader",t=>(t.type="HTMLLoader",this.loader=t,this));s(this,"build",()=>this)}};s(ut,"create",()=>new ut);ft=ut,yt=class yt{constructor(){s(this,"_runTimeInstanceId","runtime-instance-id-"+T());s(this,"_runTimeId","runtime-id-"+T());s(this,"_runTimeName","runtime-name-"+T());s(this,"instance",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});s(this,"name",this._runTimeName);s(this,"type",{id:this._runTimeId,name:this._runTimeName,description:"",props:[],refs:[],skins:[],defaultSkin:0});s(this,"withInstance",t=>(this.instance=t,this));s(this,"withType",t=>(this.type=t,this));s(this,"withName",t=>(this.name=t,this));s(this,"withDefaultSkin",t=>(this.type.skins.push(t),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:"Dedicated",skin:{id:t.id}},this));s(this,"withRef",t=>(this.type.refs.push(t),this));s(this,"withBasicRef",t=>{let e={id:"",name:t,description:"",selectorType:"id-attribute",selector:t,behavior:{type:"code"}};return this.type.refs.push(e),this});s(this,"build",()=>JSON.parse(JSON.stringify(this)))}};s(yt,"create",()=>new yt);gt=yt});var _s,ht,ks,Hs,Q,Z,_o,ko=m(()=>{"use strict";b();_s=o=>({instance:{id:"auto",componentId:o.componentId,componentName:o.name,skinSelector:{type:"Dedicated",skin:{id:"skin_auto_v2_converted"}}},type:{id:o.id,name:o.name,description:o.description,props:[{id:"in_auto_v2_converted",name:"myop_init_interface",type:"any",behavior:{type:we.code}},{id:"out_auto_v2_converted",name:"myop_cta_handler",type:"any",behavior:{type:we.code}}],refs:[],skins:[{id:"skin_auto_v2_converted",name:"auto_v2_converted",description:"",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),ht="__MYOP_CLOUD_REPOSITORY_MAIN__",ks=()=>{if(typeof window<"u")return window[ht];if(typeof globalThis<"u")return globalThis[ht]},Hs=o=>{typeof window<"u"&&(window[ht]=o),typeof globalThis<"u"&&(globalThis[ht]=o)},Q=class Q{constructor(t="https://cloud.myop.dev"){this._baseUrl=t;s(this,"variants",{});s(this,"preloadedComponents",{});s(this,"userFlows",{});s(this,"_defaultEnv","production")}static get Main(){let t=ks();return t||(Q._main||(Q._main=new Q,Hs(Q._main)),Q._main)}setEnvironment(t){this._defaultEnv=t}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(t,e,n){return e!==void 0||n!==void 0?"".concat(t,":").concat(e||this._defaultEnv,":").concat(n?"preview":"live")in this.variants:t in this.preloadedComponents}getPreloadedParams(t){return this.preloadedComponents[t]}async fetchComponentV2(t,e,n){let r=this.preloadedComponents[t],i=e!==void 0||n!==void 0,a,p;!i&&r?(a=r.env,p=r.preview):(a=e||this._defaultEnv,p=n===!0?!0:n===!1?!1:!e);let d="".concat(t,":").concat(a,":").concat(p?"preview":"live");return console.log("[CloudRepository] fetchComponentV2",{componentId:t.slice(0,8)+"...",env:a,usePreview:p,cacheKey:d,cached:d in this.variants}),this.variants[d]||(this.preloadedComponents[t]||(this.preloadedComponents[t]={env:a,preview:p}),this.variants[d]=new Promise(async(c,g)=>{try{let f="".concat(this._baseUrl,"/consume?id=").concat(t,"&env=").concat(a);p&&(f+="&preview=true");let M=(await(await fetch(f)).json()).item;if(!M){g(new Error('Component "'.concat(t,'" not found')));return}if(!M.consume_variant||!M.consume_variant.length){g(new Error('Component "'.concat(t,'" has no implementation for environment "').concat(a,'"')));return}let le=_s(M);c(le)}catch(f){g(f)}})),await this.variants[d]}async fetchComponentV1(t,e){return e?(await this.fetchFlow(e)).components.find(r=>r.type.id===t):(await this.fetchAutoFlow(t)).components[0]}async fetchAutoFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,n)=>{try{let i=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(t,"&auto=true"))).json();e(i.item)}catch(r){n(r)}})),await this.userFlows[t]}async fetchFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,n)=>{try{let i=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(t,"&resolve=components"))).json();e(i.item)}catch(r){n(r)}})),await this.userFlows[t]}async fetchComponent(t,e){return this.fetchComponentV1(t,e)}};s(Q,"_main",null);Z=Q,_o=Z});var Ho,Do=m(()=>{"use strict";Ho=async o=>await o()});var dn={};ee(dn,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ft,addClass:()=>To,applyStylesheet:()=>Co,applyStylesheetLink:()=>xo,changeSkinUrlByTokenizer:()=>bo,createIframeSkinByTokenizer:()=>pn,exec:()=>Ho,removeClass:()=>Eo,v2_CloudRepository:()=>_o});var Mt=m(()=>{"use strict";wo();So();Ro();vo();ko();Do()});var Bo,Lo=m(()=>{"use strict";Ot();Mt();b();Bo=async o=>{try{let t=new URL(window.location.href),n=new URLSearchParams(t.search).get("myopOverride");if(n){let[r,...i]=Lt(n);switch(r){case"component":{let[a,p]=i,d=await Z.Main.fetchComponent(a);if(d&&d.type.skins.find(g=>g.id===p))return d.instance.skinSelector={type:ce.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=Lt(n),c=(await Z.Main.fetchFlow(a)).components.find(g=>g.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ce.Segmented&&c.instance.resolvedExperiences){let g=c.instance.resolvedExperiences.find(f=>f.id===p);if((g==null?void 0:g.type)===je.Segment){let f=g,y=c.instance.skinSelector.segments.find(M=>M.segmentId===f.segment.id);if(y)return c.instance.skinSelector=y==null?void 0:y.skinSelector,c}}}break}}}finally{return null}}});var Ko={};ee(Ko,{HostSDK:()=>F,hostSDK:()=>Po});var Oo,F,Po,Pe=m(()=>{"use strict";te();I();w();Xn();Qn();Je();b();Ne();Io();Lo();Oo="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",F=class{constructor(){s(this,"components2init",[]);s(this,"components",[]);s(this,"componentsLoaders",[]);s(this,"initiated",!1);s(this,"version",ue);s(this,"type2InstanceCount",{});s(this,"assignId",t=>(this.type2InstanceCount[t.id]||(this.type2InstanceCount[t.id]=0),"".concat(t.id,"_").concat(++this.type2InstanceCount[t.id])));s(this,"inspected",!1);s(this,"inspect",()=>{this.inspected||(this.inspected=!0,this.components.forEach(t=>{t.inspect&&t.inspect()}))});s(this,"incomingMessageHandler",t=>{if(t.origin,document.location.origin,t.data.myop){if(t.data.direction!==R.up&&t.data.messageType!==l.EnvelopedMessage)return;let e=t.data;if(e.messageType===l.InitRequest){this.components2init.forEach(r=>{r.send(new ye(r.id))});return}if(e.messageType===l.InitResponse){this.components2init=this.components2init.filter(i=>i.id!==e.content.id);let r=this.components.find(i=>{var a;return i.id===((a=e.content)==null?void 0:a.id)});r==null||r.setInitiated();return}if(e.messageType===l.EnvelopedMessage){let r=e,i=this.components.find(a=>a.id===r.destination);if(i){if(r.direction===R.down){r.message.messageType===K.name?i.onMessageReceived(r.message):(r.message.route=r.route,i.send(r.message));return}}else{let a=this.components.find(p=>p.id===r.message.destination);a&&a.send(r.message)}return}let n=this.components.find(r=>r.id===e.destination);if(!n){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(n){if(n.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});s(this,"send",t=>{let e=new MessageEvent("",{data:t});this.incomingMessageHandler(e)});s(this,"init",t=>{if(this.initiated)throw new Error("hostSDK already initiated");let e=[new Xe,new Ze,new lt];if(this.componentsLoaders=[...e],t){let n={};t.forEach(r=>{let i=new r(this.componentsLoaders);n[i.type]=i}),this.componentsLoaders.forEach(r=>{n[r.type]||(n[r.type]=r)}),this.componentsLoaders=Object.values(n)}window.addEventListener("message",this.incomingMessageHandler,!1),console.log("myop hostSDK initiated",document.location.href),this.initiated=!0});s(this,"_getSkinIdBySkinSelector",async(t,e=[],n)=>{var i;async function r(a,p){for(let d of a)if(await p(d))return d}switch(t.type){case"DedicatedSkin":case ce.Dedicated:return((i=t.skin)==null?void 0:i.id)||t.skins[0].id;case ce.Segmented:{let p=await r(t.segments,async d=>{if(d.segmentId==="Default")return!0;let c=e.find(y=>y.type===je.Segment?y.segment.id===d.segmentId:!1);if(!c)throw new Error("experience not found");let f=c.segment,u=(n||{})[f.function];return u?await u():(console.warn("segmentId:".concat(d.segmentId,", ").concat(f.function," function not provided !")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return""});s(this,"runSkinSelector",async(t,e)=>{let n=await this._getSkinIdBySkinSelector(t.instance.skinSelector,t.instance.resolvedExperiences,e);return t.type.skins.find(r=>r.id===n)});s(this,"loaderHooks");s(this,"loadComponent",async(t,e,n)=>{var g,f,u,y;if(!e){debugger;throw new Error("no container was found for this component")}let r=await Bo(t);r&&(t=r);let i=h(h({},(g=this.loaderHooks)!=null?g:{}),(f=n==null?void 0:n.hooks)!=null?f:{}),a=e;if(a.myop)if(a.component){t=h({},t),t.instance=h({},t.instance);let M=await this.runSkinSelector(t,i);if(!M)throw new Error("runSkinSelector failed to choose skin, check the provided config");return(u=n==null?void 0:n.hooks)!=null&&u.afterSkinSelected&&(M=await n.hooks.afterSkinSelected(h({},M))),t.instance.skinSelector={type:ce.Dedicated,skin:M},n&&(n=h({},n),delete n.hooks),await Zt(a,t,this.components,n)}else throw new Error("load component got a detached ref.");e=e;let p=await this.runSkinSelector(t,i);if(!p)throw new Error("runSkinSelector failed to choose skin, check the provided config");(y=n==null?void 0:n.hooks)!=null&&y.afterSkinSelected&&(p=await n.hooks.afterSkinSelected(h({},p)));let d=this.componentsLoaders.find(M=>M.type===p.loader.type);if(!d){debugger;throw new Error('no loader "'.concat(p.loader.type,'" was found for component'))}let c=await d.load(t.type,p,e,n);c.isInitiated||this.components2init.push(c),c.bind("onDispose",()=>(this.components=this.components.filter(M=>M!==c),this.components2init=this.components2init.filter(M=>M!==c),!0)),this.components.push(c),(!n||n.connectProps!==!1)&&(c=Yn(c,t.type.props,p));try{await en(c,t,this.components)}catch(M){throw M}return n!=null&&n.skipInit||await c.initiated(),c});s(this,"navigate",async(t,e,n)=>{if(t.parent)throw new Error("Navigating on remote ref components is not implemented yet");if(n!=null&&n.staged){let r=await this.loadComponent(e,t.container,h({hidden:!0,relative:{direction:"after",child:t.element}},n));return n.init&&await n.init(r),r.show(),t.dispose(),r}else{let r=t.element.nextSibling;return t.dispose(),this.loadComponent(e,t.container,h({relative:{direction:"before",child:r}},n))}})}};s(F,"Instance",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Oo});if(!window.myop.hostSDK){let o=new F;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Oo}),window.myop.hostSDK=o}Po=window.myop.hostSDK;z("hostSDK",Po)});var It,Ao=m(()=>{"use strict";I();X();b();w();It=class extends x{constructor(){super(...arguments);s(this,"messageType",l.DetectMyopRefsMessage);s(this,"executor",e=>{let n=document.querySelectorAll("[".concat(B.id,"]")),r=[];n.forEach(i=>{let a=i.getAttribute(B.id);a&&r.push(new Me(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new pe(e.handlerUniqueId,r))})}}});var Ct,Fo=m(()=>{"use strict";I();b();w();L();Ct=class extends x{constructor(){super(...arguments);s(this,"messageType",l.BindClickMessage);s(this,"executor",e=>{let n=[];return S(e.ref,document).forEach(i=>{let a=()=>{this.messageToHost(new oe,e)};i.addEventListener("click",a);let p=()=>{i.removeEventListener("click",a)};n.push(p)}),()=>{n.forEach(i=>i())}})}}});var xt,zo=m(()=>{"use strict";I();b();L();xt=class extends x{constructor(){super(...arguments);s(this,"messageType",l.ChangeTextMessage);s(this,"executor",e=>{S(e.ref,document).forEach(r=>{r.textContent=e.content})})}}});var wt,$o=m(()=>{"use strict";I();w();b();rn();wt=class extends x{constructor(){super(...arguments);s(this,"messageType",l.ExecuteScriptMessage);s(this,"executor",e=>{at(e,r=>{this.messageToHost(new se(e.handlerUniqueId,r))},new xe(document.documentElement))})}}});var bt,Uo=m(()=>{"use strict";I();b();w();me();L();bt=class extends x{constructor(){super(...arguments);s(this,"messageType",l.AddEventListenerMessage);s(this,"executor",e=>{let n=S(e.ref,document),r=[];return n.forEach(i=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new re(e.handlerUniqueId,P(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),r.push(()=>{i.removeEventListener(e.type,a)})}),()=>{r.forEach(i=>{i()})}})}}});var St,No=m(()=>{"use strict";I();b();L();St=class extends x{constructor(){super(...arguments);s(this,"messageType",l.SetAttributeMessage);s(this,"executor",e=>{S(e.ref,document).forEach(r=>{r.setAttribute(e.name,e.value)})})}}});var Tt,Wo=m(()=>{"use strict";I();X();b();Pe();We();Tt=class extends x{constructor(){super(...arguments);s(this,"messageType",l.CreateRefComponentMessage);s(this,"executor",e=>{(async()=>{let r=document.querySelectorAll("[".concat(B.id,"='").concat(e.refConfig.selector,"']"));if(r.length===1){let a=await F.Instance().loadComponent(e.nestedComponentConfig,r.item(0),e.options),p=[];Object.keys(a.refs).forEach(d=>{let c=a.refs[d];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:d,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new V(e.handlerUniqueId,p))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new V(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var Vo,qo=m(()=>{"use strict";Vo=(o,t)=>{if(!o){console.log("n");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!o||o.nodeType!==1))if(e){let n=new e(t),r={attributes:!0,childList:!0,subtree:!0};return n.observe(o,r),n}else window.addEventListener&&(o.addEventListener("DOMNodeInserted",t,!1),o.addEventListener("DOMNodeRemoved",t,!1))}});var Et,jo=m(()=>{"use strict";I();w();b();qo();Et=class extends x{constructor(){super(...arguments);s(this,"messageType",l.SetMutationObserverMessage);s(this,"executor",e=>{e.source&&Vo(document.body,()=>{this.messageToHost(new He)})})}}});var Go,Rt,Jo=m(()=>{"use strict";I();X();b();w();me();L();Go=o=>{if(!o)return null;if(o.tagName==="FORM"){let t=new FormData(o),e={formData:{},unmappedData:[]},n=o.querySelectorAll("input, select, textarea"),r=-1;return n.forEach(i=>{if(typeof i.value=="string"){let a=i.getAttribute(B.id),p=i.getAttribute("name"),d={id:i.id,name:p,value:Go(i),required:i.required,validity:P(i.validity,!0),myopId:a};e.unmappedData.push(d),p&&(!e.formData[p]||!e.formData[p].value||d.value)&&(e.formData[p]=d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Rt=class extends x{constructor(){super(...arguments);s(this,"messageType",l.GetElementValueMessage);s(this,"executor",e=>{S(e.ref,document).forEach(r=>{this.messageToHost(new ie(Go(r)),e)})})}}});var vt,Yo=m(()=>{"use strict";I();b();w();L();vt=class extends x{constructor(){super(...arguments);s(this,"messageType",l.GetAttributeMessage);s(this,"executor",e=>{let n=Zn(e.ref,document);n&&this.messageToHost(new ke(n.getAttribute(e.name)),e)})}}});var _t,Xo=m(()=>{"use strict";w();I();b();_t=class extends x{constructor(){super(...arguments);s(this,"messageType",l.SetResizeObserverMessage);s(this,"executor",e=>{let n=new ResizeObserver(r=>{this.messageToHost(new Oe)});return n.observe(document.body),()=>{n.disconnect()}})}}});var kt,Qo=m(()=>{"use strict";I();b();L();kt=class extends x{constructor(){super(...arguments);s(this,"messageType",l.SetInnerHtml);s(this,"executor",e=>{S(e.ref,document).forEach(r=>{r.innerHTML=e.content})})}}});var Zo={};ee(Zo,{IframeSDK:()=>Ht});var Ht,es=m(()=>{"use strict";b();Ao();Fo();zo();$o();te();Uo();No();w();Wo();jo();Jo();Ne();Yo();Xo();Qo();Ht=class extends Ie{constructor(){super();s(this,"version",ue);s(this,"messageToHost",(e,n)=>{var i;!e.replayToHandler&&(n!=null&&n.handlerUniqueId)&&(e.replayToHandler=n.handlerUniqueId);let r=Object.keys(this.components);e.destination||(n!=null&&n.route?e.destination=n.route[n.route.length-1]:e.destination=r[0]),e.source||(e.source=r[0]),e.direction=R.up,(i=window.parent)==null||i.postMessage(h({},e),"*")});s(this,"supportedHandlers",[new xt(this.messageToHost),new kt(this.messageToHost),new Ct(this.messageToHost),new It(this.messageToHost),new wt(this.messageToHost),new bt(this.messageToHost),new St(this.messageToHost),new Rt(this.messageToHost),new Et(this.messageToHost),new _t(this.messageToHost),new vt(this.messageToHost),new Tt(this.messageToHost)]);s(this,"init",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new ae)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};z("IframeSDK",Ht)});var Bs={};var Ds,ts=m(()=>{"use strict";w();te();Ds=h({},he);z("MyopMessages",Ds)});var ns={};ee(ns,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ft,addClass:()=>To,applyStylesheet:()=>Co,applyStylesheetLink:()=>xo,changeSkinUrlByTokenizer:()=>bo,createIframeSkinByTokenizer:()=>pn,exec:()=>Ho,removeClass:()=>Eo,v2_CloudRepository:()=>_o});var os=m(()=>{"use strict";te();Mt();Mt();z("MyopHelpers",dn)});var As={};ee(As,{getHostModule:()=>ss,getIframeModule:()=>rs,getWebcomponentModule:()=>is});te();var yn;if(window.__federation__)console.log("__federation__ loaded more than once.");else{let o=(yn=document.currentScript)==null?void 0:yn.src,t=o?o.split("/").slice(0,-1).join("/"):"";window.__federation__={__public_auto_path__:t,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(o,t,e)=>{if(window.__federation__[t])console.log("__federation__ module ".concat(t," already loaded.")),e(window.__federation__[t][Bt]);else{let n;window.__federation__[t]={},window.__federation__[t][Ue]=r=>{n&&(document.head.removeChild(n),n=null),window.__federation__[t][Bt]=r,e(r)},n=document.createElement("script"),n.type="module",n.src=o,n.async=!0,document.head.appendChild(n)}};Ne();console.log("myop root sdk - loaded",document.location.origin);var Ls="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",ss=()=>Promise.resolve().then(()=>(Pe(),Ko)),rs=()=>Promise.resolve().then(()=>(es(),Zo)),is=()=>Promise.resolve().then(()=>(an(),lo)),Os=()=>Promise.resolve().then(()=>(ts(),Bs)),Ps=()=>Promise.resolve().then(()=>(os(),ns)),Ae=o=>async()=>(await o()).get(),Ks={version:ue,getHostModule:Ae(ss),getIframeModule:Ae(rs),getWebcomponentModule:Ae(is),getMyopMessages:Ae(Os),getMyopHelpers:Ae(Ps)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ls});window.myop.rootSDK?console.log("myop root host loaded more than once."):window.myop=h({rootSDK:Ks},window.myop);return us(As);})();
6
+ const SDK_CONTENT = `"use strict";var MyopSDK=(()=>{var Ue=Object.defineProperty,ls=Object.defineProperties,fs=Object.getOwnPropertyDescriptor,us=Object.getOwnPropertyDescriptors,gs=Object.getOwnPropertyNames,yn=Object.getOwnPropertySymbols;var hn=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable;var Bt=(o,n,e)=>n in o?Ue(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e,h=(o,n)=>{for(var e in n||(n={}))hn.call(n,e)&&Bt(o,e,n[e]);if(yn)for(var e of yn(n))ys.call(n,e)&&Bt(o,e,n[e]);return o},U=(o,n)=>ls(o,us(n));var m=(o,n)=>()=>(o&&(n=o(o=0)),n);var ee=(o,n)=>{for(var e in n)Ue(o,e,{get:n[e],enumerable:!0})},hs=(o,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of gs(n))!hn.call(o,s)&&s!==e&&Ue(o,s,{get:()=>n[s],enumerable:!(t=fs(n,s))||t.enumerable});return o};var Ms=o=>hs(Ue({},"__esModule",{value:!0}),o);var r=(o,n,e)=>Bt(o,typeof n!="symbol"?n+"":n,e);var qe,Ve,Lt,F,te=m(()=>{"use strict";qe="__federation__",Ve="onLoad",Lt="moduleInstance",F=(o,n)=>{window[qe]&&window[qe][o]&&window[qe][o][Ve]&&window[qe][o][Ve]({[o]:n})}});var ye,je=m(()=>{ye="0.3.17"});var f,I=m(()=>{"use strict";f={InitRequest:"InitRequest",InitResponse:"InitResponse",InitMessage:"InitMessage",DisposeMessage:"DisposeMessage",ChangeTextMessage:"ChangeTextMessage",BindClickMessage:"BindClickMessage",DetectMyopRefsMessage:"DetectMyopRefsMessage",ExecuteScriptMessage:"ExecuteScriptMessage",AddEventListenerMessage:"AddEventListenerMessage",SetAttributeMessage:"SetAttributeMessage",CreateRefComponentMessage:"CreateRefComponentMessage",EnvelopedMessage:"EnvelopedMessage",GetElementValueMessage:"GetElementValueMessage",GetAttributeMessage:"GetAttributeMessage",SetInnerHtml:"SetInnerHtml",ExecuteComponentMethod:"ExecuteComponentMethod",SetMutationObserverMessage:"SetMutationObserverMessage",SetResizeObserverMessage:"SetResizeObserverMessage",CleanupMessage:"CleanupMessage",In:{DetectedMyopRefsMessage:"DetectedMyopRefsMessage",ClickReplayMessage:"ClickReplayMessage",ExecuteScriptReplyMessage:"ExecuteScriptReplyMessage",EventListenerCallbackMessage:"EventListenerCallbackMessage",ElementValueReplayMessage:"ElementValueReplayMessage",GetAttributeReplayMessage:"GetAttributeReplayMessage",RefComponentCreatedMessage:"RefComponentCreatedMessage",EnvelopedMessage:"EnvelopedMessage",MutationObserverMessage:"MutationObserverMessage",CleanupReplayMessage:"CleanupReplayMessage",ResizeObserverMessage:"ResizeObserverMessage"}}});var E,Is,Cs,Pt,Ot=m(()=>{"use strict";E=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+o/4).toString(16)),Is=o=>{let n=[...o].map(e=>e.toString(16).padStart(2,"0")).join("");return[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20)].join("-")},Cs=o=>{let n=o.replace(/-/g,"+").replace(/_/g,"/");for(;n.length%4;)n+="=";let e=atob(n);return Uint8Array.from(e,t=>t.charCodeAt(0))},Pt=o=>{let n=Cs(o);if(n.length%16!==0)throw new Error("Invalid input length");let e=[];for(let t=0;t<n.length;t+=16)e.push(Is(n.slice(t,t+16)));return e}});var In,ne=m(()=>{"use strict";Ot();In=o=>new Promise(n=>setTimeout(n,o))});var v,C,At,R,_,Y,k=m(()=>{"use strict";ne();v=class{};r(v,"down","down"),r(v,"up","up");C=class{constructor(){r(this,"id",E());r(this,"myop",!0);r(this,"content");r(this,"source");r(this,"destination");r(this,"route");r(this,"ref");r(this,"direction");r(this,"cleanable",!1)}static create(...n){return new this(...n)}isTypeof(n){return n.messageType===this.messageType}},At=class extends C{constructor(e){super();this.ref=e}},R=class extends C{constructor(e){super();this.replayToHandler=e}},_=class extends C{constructor(e){super();this.handler=e;r(this,"handlerUniqueId",E())}},Y=class o{constructor(n,e){this.refConfig=n;this.component=e;r(this,"myop",!0);r(this,"__nonProxied");this.__nonProxied=U(h({},this),{component:null})}static create(n,e,t){let s=e;return s||(s={id:"",name:"",description:"",selectorType:"id-attribute",selector:n,behavior:{type:"code"}}),new o(s,t)}}});var Cn,Kt,oe,xn=m(()=>{"use strict";k();Cn="ClickReplayMessage",Kt=class extends _{constructor(e,t){super(t);this.ref=e;r(this,"replyMessageKey",Cn);r(this,"messageType","BindClickMessage");r(this,"cleanable",!0)}},oe=class extends R{constructor(){super(...arguments);r(this,"messageType",Cn)}}});var $t,wn=m(()=>{"use strict";k();$t=class extends C{constructor(e,t){super();this.ref=e;r(this,"messageType","ChangeTextMessage");this.content=t}}});var bn,xs,ws,Sn,D,se,Ft=m(()=>{"use strict";k();bn="ExecuteScriptReplyMessage",xs=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,ws=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,Sn=o=>{let n=o.match(xs);if(n)return n[1]||n[3];{let e=o.match(ws);if(e)return e[1].trim()}},D=class extends _{constructor(e,t=()=>{},s){super(t);this.scriptInputs=s;r(this,"replyMessageKey",bn);r(this,"messageType","ExecuteScriptMessage");r(this,"script","");this.script=e.toString(),this.content=e.toString(),this.content=Sn(this.content)}};r(D,"replierKey","send"),r(D,"completeStreamKey","completeStream");se=class extends R{constructor(e,t){super(e);this.replayToHandler=e;this.content=t;r(this,"messageType",bn)}}});var q,En=m(()=>{"use strict";Ft();q=class extends D{constructor(e,t,s=()=>{}){super(({rootRef:i,elementId:a,_script:p,__scriptInputs:d})=>{let c=(i.shadowRoot||i.container).querySelectorAll("[myop-id='".concat(a,"']"));return c.length?(d.ref=c[0],new Function("return (".concat(p,")(...arguments)"))(d)):null},s);this.scriptInputs=t;this.scriptInputs=U(h({},t),{_script:e.toString()})}}});var Tn,zt,re,vn=m(()=>{"use strict";k();Tn="EventListenerCallbackMessage",zt=class extends _{constructor(e,t,s){super(s);this.ref=e;this.type=t;this.handler=s;r(this,"replyMessageKey",Tn);r(this,"messageType","AddEventListenerMessage");r(this,"cleanable",!0);r(this,"serializableSkeleton",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},re=class extends R{constructor(e,t){super(e);this.replayToHandler=e;this.e=t;r(this,"messageType",Tn);this.content={e:t}}}});var Wt,Rn=m(()=>{"use strict";k();Wt=class extends C{constructor(e,t,s){super();this.ref=e;this.name=t;this.value=s;r(this,"messageType","SetAttributeMessage")}}});var _n,Nt,ie,Ut=m(()=>{"use strict";k();_n="ElementValueReplayMessage",Nt=class extends _{constructor(e,t){super(t);this.ref=e;r(this,"replyMessageKey",_n);r(this,"messageType","GetElementValueMessage")}},ie=class extends R{constructor(e){super();this.content=e;r(this,"messageType",_n)}}});var qt,kn=m(()=>{"use strict";k();qt=class extends C{constructor(e,t){super();this.ref=e;r(this,"messageType","SetInnerHtml");this.content=t}}});var he,_e,ae,Hn=m(()=>{"use strict";k();he=class extends C{constructor(e){super();r(this,"messageType","InitMessage");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},_e=class extends he{constructor(){super(...arguments);r(this,"messageType","InitResponse")}},ae=class extends C{constructor(){super(...arguments);r(this,"messageType","InitRequest")}}});var Dn,ke,V,Ge=m(()=>{"use strict";k();Dn="RefComponentCreatedMessage",ke=class extends _{constructor(e,t,s,i){super(i);this.refConfig=e;this.nestedComponentConfig=t;this.options=s;r(this,"replyMessageKey",Dn);r(this,"messageType","CreateRefComponentMessage")}},V=class extends R{constructor(e,t,s){super(e);this.replayToHandler=e;this.nestedRefs=t;this.failed=s;r(this,"messageType",Dn)}}});var He,Vt=m(()=>{"use strict";k();He=class extends C{constructor(e,t){super();this.destination=e;this.message=t;r(this,"messageType","EnvelopedMessage");let s=t;this.route=[e,...s.route?s.route:[]]}}});var Bn,jt,pe,Ln=m(()=>{"use strict";k();Bn="DetectedMyopRefsMessage",jt=class extends _{constructor(){super(...arguments);r(this,"messageType","DetectMyopRefsMessage");r(this,"replyMessageKey",Bn)}},pe=class extends R{constructor(e,t){super(e);this.replayToHandler=e;r(this,"messageType",Bn);this.content=t}isTypeof(e){return e.messageType===this.messageType}}});var Pn,Gt,De,On=m(()=>{"use strict";k();Pn="GetAttributeReplayMessage",Gt=class extends _{constructor(e,t,s){super(s);this.ref=e;this.name=t;r(this,"replyMessageKey",Pn);r(this,"messageType","GetAttributeMessage")}},De=class extends R{constructor(e){super();this.content=e;r(this,"messageType",Pn)}}});var A,An=m(()=>{"use strict";k();A=class extends C{constructor(e){super();this.method=e;r(this,"messageType","ExecuteComponentMethod")}}});var Yt,Be,Kn=m(()=>{"use strict";k();Yt=class extends C{constructor(){super(...arguments);r(this,"messageType","SetMutationObserverMessage")}},Be=class extends C{constructor(){super(...arguments);r(this,"messageType","MutationObserverMessage")}}});var $n,Le,Pe,Fn=m(()=>{"use strict";k();$n="CleanupReplayMessage",Le=class extends _{constructor(e,t){super(t);this.cleanupForMessageId=e;r(this,"replyMessageKey",$n);r(this,"messageType","CleanupMessage")}},Pe=class extends R{constructor(e){super();this.customCleanup=e;r(this,"messageType",$n)}}});var Oe,zn=m(()=>{"use strict";k();Oe=class extends C{constructor(){super(...arguments);r(this,"messageType","DisposeMessage")}}});var Qt,Ae,Wn=m(()=>{"use strict";k();Qt=class extends C{constructor(){super(...arguments);r(this,"cleanable",!0);r(this,"messageType","SetResizeObserverMessage")}},Ae=class extends C{constructor(){super(...arguments);r(this,"messageType","ResizeObserverMessage")}}});var Me={};ee(Me,{AddEventListenerMessage:()=>zt,BaseMyopMessage:()=>C,BindClickMessage:()=>Kt,ChangeTextMessage:()=>$t,CleanupMessage:()=>Le,CleanupReplayMessage:()=>Pe,ClickReplayMessage:()=>oe,CreateRefComponentMessage:()=>ke,CustomRefMessage:()=>q,DetectMyopRefsMessage:()=>jt,DetectedMyopRefsMessage:()=>pe,DisposeMessage:()=>Oe,ElementValueReplayMessage:()=>ie,EnvelopedMessage:()=>He,EventListenerCallbackMessage:()=>re,ExecuteComponentMethod:()=>A,ExecuteScriptMessage:()=>D,ExecuteScriptReplyMessage:()=>se,GetAttributeMessage:()=>Gt,GetAttributeReplayMessage:()=>De,GetElementValueMessage:()=>Nt,InitMessage:()=>he,InitRequest:()=>ae,InitResponse:()=>_e,MessageDirection:()=>v,MutationObserverMessage:()=>Be,MyopBindMessage:()=>_,MyopBindReplayMessage:()=>R,MyopElementMessage:()=>At,Ref:()=>Y,RefComponentCreatedMessage:()=>V,ResizeObserverMessage:()=>Ae,SetAttributeMessage:()=>Wt,SetInnerHtml:()=>qt,SetMutationObserverMessage:()=>Yt,SetResizeObserverMessage:()=>Qt,stripFunction:()=>Sn});var w=m(()=>{"use strict";k();xn();wn();Ft();En();vn();Rn();Ut();kn();Hn();Ge();Vt();Ln();Ut();On();An();Kn();Fn();zn();Wn()});var z,Ke=m(()=>{"use strict";I();w();$e();z=class{constructor(n,e,t){this.componentDefinition=n;this.container=e;r(this,"id","");r(this,"messageHandlers",{});r(this,"element");r(this,"_markedForDisposed",!1);r(this,"bind",(n,e)=>{this.messageHandlers[n]||(this.messageHandlers[n]=[]),this.messageHandlers[n].includes(e)||this.messageHandlers[n].push(e)});r(this,"bindWhen",(n,e,t)=>{if(!t)throw new Error("can't use component.bindWhen without an handler");this.messageHandlers[n]||(this.messageHandlers[n]=[]);let s=this.messageHandlers[n],i=a=>e(a)?(t(a),!0):!1;return s.push(i),()=>{let a=s.indexOf(i);a>-1&&s.splice(a,1)}});r(this,"setInitiated",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});r(this,"isInitiated",!1);r(this,"_whenInitiatedResolve");r(this,"_whenInitiatedReject");r(this,"_whenInitiated",new Promise((n,e)=>{this._whenInitiatedResolve=n,this._whenInitiatedReject=e}));r(this,"initiated",()=>this._whenInitiated);r(this,"props",{});r(this,"refs",{});this.id=(t==null?void 0:t.id)||$.Instance().assignId(n);let s=t!=null&&t.timeout?t==null?void 0:t.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject("timeout_".concat(s," ").concat(this.id))},s),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(n){if(this._markedForDisposed)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.");this._markedForDisposed=n}onMessageReceived(n){if(n.messageType===f.ExecuteComponentMethod){let t=n;return this[t.method]?this[t.method](t.content):console.log("method not found ".concat(t.method," on component"),this),!0}let e=this.messageHandlers[n.messageType];if(e&&e.length){let t=!1;return e.forEach(s=>{t=t||s(n)}),t}return!1}sendCleanupMessage(n){n.source=this.id,n.destination=this.id,n.direction=v.down;let e=this.bindWhen(n.replyMessageKey,s=>s.replayToHandler===n.handlerUniqueId,s=>{n.handler(s),e()}),t=n.handler;delete n.handler,this.send(n),n.handler=t}send(n){n.source||(n.source=this.id),n.destination||(n.destination=this.id),n.direction=v.down;let e;if(n.handler){let t=n;e=this.bindWhen(t.replyMessageKey,s=>s.replayToHandler===t.handlerUniqueId,t.handler),delete n.handler}return n.ref&&(n.ref=n.ref.__nonProxied||n.ref),n.cleanable?()=>{this.sendCleanupMessage(new Le(n.id,t=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log("disposing component",this.id),this.send(new Oe);let n=this.messageHandlers.onDispose;n&&n.forEach(e=>{e(null)}),this.messageHandlers={},this.id+="_disposed",this.isInitiated=!1}}});var Ie,Nn=m(()=>{"use strict";Ie=class{constructor(n,e,t,s,i){this.myopId=n;this.htmlTagName=e;this.BoundingRect=t;this.offsetTop=s;this.offsetLeft=i;r(this,"type","MyopElementRef")}}});var Un,x,Ye,qn=m(()=>{"use strict";Un=async o=>{if(typeof o=="function")o();else if(o instanceof Promise){let n=await o;typeof n=="function"&&n()}},x=class{constructor(n){this.messageToHost=n}},Ye=class extends x{constructor(e,t){super(e);this.messageToHost=e;this.context=t}}});var Jt,Ce,Vn=m(()=>{"use strict";I();b();w();Jt=class{constructor(n,e){this.id=n;this.context=e;r(this,"send",n=>{})}},Ce=class{constructor(){r(this,"messageToHandleAfterInit",[]);r(this,"components",{});r(this,"alwaysPassEnvelopesToHost",!1);r(this,"messageCleanupCache",{})}handleIncomeMessages(n){let e=n.data?n.data:n.detail;if(!(!e||!e.myop)){let t=e;if(t.direction!==v.down)return;if(t.messageType===f.DisposeMessage){t.destination&&delete this.components[t.destination];return}if(t.messageType===f.InitMessage){let s=t.content.id;if(this.components[s])return;this.components[s]=new Jt(s),this.messageToHost(new _e(s));return}if(t.messageType===f.EnvelopedMessage){let s=t,i=s.message;if(t=i,this.alwaysPassEnvelopesToHost||this.components[t.destination]){let a=myop.hostSDK.components.find(d=>d.id===i.destination);if(a){a.send(i);return}let p=myop.hostSDK.components.find(d=>d.id===s.destination);if(p){p.send(i);return}}else return}if(t.messageType){if(t.messageType===f.CleanupMessage){let i=t,a=this.messageCleanupCache[i.cleanupForMessageId],p=new Pe(!!a);p.destination=t.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],Un(a).then(()=>{this.messageToHost(p,i)}).catch(()=>{})):this.messageToHost(p,i);return}let s=!1;this.supportedHandlers.forEach(i=>{if(i.messageType===t.messageType){s=!0;let a=i.executor(t);if(t.cleanable&&a&&(this.messageCleanupCache[t.id]=a),a&&!t.cleanable)throw new Error("Cleanup handler generated for non-cleanable message. \\nmessageType - ".concat(t.messageType,", handler executor was - ").concat(i.executor,"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."));if(!a&&t.cleanable)throw new Error("No cleanup handler generated for a cleanable message. \\nmessageType - ".concat(t.messageType,", handler executor was - ").concat(i.executor,"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."))}})}else console.log("unsupported message type")}}}});var j,de,be,xe,ce,Qe,we,b=m(()=>{"use strict";Nn();qn();Vn();j={IframeLoader:"IframeLoader",WebComponentLoader:"WebComponentLoader",HTMLLoader:"HTMLLoader",MinimizedLoader:"MinimizedLoader"},de={open:"open",closed:"closed",none:"none",localFrame:"localFrame"},be={message:"message",code:"code"},xe=class{};r(xe,"code","code"),r(xe,"component","component");ce={Segmented:"Segmented",Dedicated:"Dedicated",Default:"Default"},Qe={Segment:"Segment",Promo:"Promo",AB:"AB"},we=class{constructor(n,e){this.container=n;this.shadowRoot=e;r(this,"getRootDiv",()=>(this.shadowRoot||this.container).querySelector("div"));r(this,"getRoot",()=>this.shadowRoot||this.container)}}});var Xt,bs,Zt,O,me=m(()=>{"use strict";Xt=o=>o!==Object(o),bs=o=>typeof o=="function",Zt=o=>{if(Xt(o))return!0;if(bs(o)||Object.getPrototypeOf(o))return!1;for(let n in o){let e=o[n];if(typeof e=="object"){if(!Zt(e))return!1}else{if(Xt(e))continue;return!1}}return!0},O=(o,n={},e=!0,t=new WeakMap)=>{if(Xt(o))return o;if(Array.isArray(o)){if(t.has(o))return t.get(o);let s=[];t.set(o,s);for(let i=0;i<o.length;i++){let a=o[i];s[i]=O(a,n,e,t)}return s}if(o!==null&&typeof o=="object"){if(t.has(o))return t.get(o);let s={};t.set(o,s);for(let i in o){let a=typeof n=="boolean"?n:n[i];a&&(a===!0?(e?o[i]!==void 0:o[i])&&(s[i]=O(o[i],!0,e,t)):typeof a=="object"&&(s[i]=O(o[i],a,e,t)))}return s}return{}}});var jn,Gn=m(()=>{"use strict";jn={notSerializableRefCall:(o,n)=>{throw new Error("\\nThe input provided to '".concat(o.toString(),"' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \\nThe following types of data are considered non-serializable and cannot be processed:\\n\\n- Functions\\n- DOM elements\\n- Class instances\\n- Circular references\\n- Symbols\\n- BigInt values\\n\\nIn the following execution we detected :\\n~~~~~~~~\\n").concat(n," \\n~~~~~~~~\\nas not serializable.\\n\\nTo resolve this issue, please ensure that all inputs passed to '").concat(o.toString(),"' are in a serializable format.\\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \\nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\\n\\nSuggested Fix:\\n1. Remove or replace non-serializable values from your input.\\n2. If using objects, ensure they do not contain any functions or circular references.\\n3. Convert any class instances to plain objects or JSON-compatible formats.\\n4. Use dedicated Myop message.\\n\\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev.\\n\\n"))}}});var Fe,Yn=m(()=>{"use strict";Ke();w();Vt();Fe=class extends z{constructor(e,t,s){super(e,t.container,s);this.componentDefinition=e;this.parent=t;r(this,"send",e=>{let t=e.handler,s=super.send(e);return this.parent.send(new He(this.id,e)),e.handler=t,s});r(this,"dispose",()=>{this.isInitiated&&this.send(new A("dispose")),super.dispose()})}hide(){this.send(new A("hide"))}show(){this.send(new A("show"))}inspect(){return this.send(new A("inspect"))}setHeightBasedOnDocumentElement(){this.send(new A("setHeightBasedOnDocumentElement"))}setHeightBasedOnScrollHeight(){this.send(new A("setHeightBasedOnScrollHeight"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var le,en=m(()=>{"use strict";Ke();ze();le=class extends z{constructor(e,t,s,i,a,p){super(e,s,p);this.container=s;this.customElement=i;this.tagName=a;r(this,"ctaCleanup");r(this,"_ctaHandler");r(this,"_ctaQueue",[]);r(this,"cleanupInspect",()=>{});r(this,"send",e=>{let t=super.send(e);return console.debug("[MyopExtractedWebComponent] send() called - web components use direct API instead",e),t});r(this,"dispose",()=>{var e;this.ctaCleanup&&this.ctaCleanup(),super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i,this.setInitiated()}inspect(){return this.cleanupInspect=Se(this.id,"MyopExtractedWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){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"}show(){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=""}initWithData(e){typeof this.customElement.myop_init_interface=="function"&&this.customElement.myop_init_interface(e)}getData(){if(typeof this.customElement.myop_init_interface=="function")return this.customElement.myop_init_interface()}setCtaHandler(e){if(this.ctaCleanup&&this.ctaCleanup(),this._ctaHandler=e,this._ctaQueue.length>0){let s=[...this._ctaQueue];this._ctaQueue=[],s.forEach(i=>{this.markedForDisposed||e(i.action,i.payload)})}let t=s=>{var a;let i=s;(a=i.detail)!=null&&a.action&&(this._ctaHandler&&!this.markedForDisposed?this._ctaHandler(i.detail.action,i.detail.payload):this._ctaHandler||this._ctaQueue.push({action:i.detail.action,payload:i.detail.payload}))};this.customElement.addEventListener("myop-cta",t),this.ctaCleanup=()=>{this.customElement.removeEventListener("myop-cta",t)}}}});var Ss,Se,Qn,Jn,Xn,Es,tn,nn,ze=m(()=>{"use strict";w();w();b();me();Gn();Yn();en();Ss=(o,n,e)=>{let t=document.createElement("a");return t.textContent=o,t.style.position="relative",t.style.padding="0 5px",t.style.fontSize="14px",t.style.top="0",t.style.top="".concat(n,"px"),t.style.transform="translateX(-50%)",t.target="_blank",t.href="https://dashboard.myop.dev/dashboard/component/".concat(e.id),t},Se=(o,n,e,t,s,i)=>{let a=Ss("".concat(i.name," : ").concat(n),e,i);return t.insertBefore(a,s),s.style.border="1px solid #007BFF",s.style.display="block",()=>{s.style.border="unset",t.removeChild(a)}},Qn=(o,n,e)=>o?!1:(console.error("Error: Undefined Prop\\n\\nIt looks like you've tried to use a prop that hasn't been defined.\\nPlease check the prop name for any typos or ensure that it is properly defined in the component's prop list.\\n\\n"+"Prop Name: ".concat(n,"\\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\\n\\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide.")),!0),Jn=(o,n,e)=>{console.error("Error: Code Prop Not Supported\\n\\nCurrently, code props are only supported in local frame components.\\n\\u26A0\\uFE0F This is a work in progress feature \\u2014 code props will be supported in upcoming versions.\\n\\nIn the meantime, you can use message props.\\n\\n"+"Prop Name: ".concat(n,"\\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\\n\\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide."))},Xn=(o,n,e)=>{let t=n.reduce((i,a)=>U(h({},i),{[a.name]:h({},a)}),{}),s={get:(i,a)=>{let p=t[a];if(Qn(p,a,o))return!1;if(p.behavior.type===be.code){if(o instanceof le)return(p.behavior.remap||a)==="myop_init_interface"?l=>{if(l===void 0)return o.getData();o.initWithData(l)}:void 0;if(e.loader.type===j.HTMLLoader&&e.loader.shadowRootMode===de.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return Jn(p,a,o),!1}return p.mode==="output"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(Y.create(p.behavior.ref)),c.push(u=>{d(u)}),p.behavior.params&&c.push(...p.behavior.params);let l=Me[p.behavior.message];o.send(new l(...c))}):null},set:(i,a,p)=>{let d=t[a];if(Qn(d,a,o))return!1;if(d.behavior.type===be.code){if(o instanceof le){let l=d.behavior.remap||a;if(l==="myop_cta_handler")return o.setCtaHandler(p),!0;if(l==="myop_init_interface")return o.initWithData(p),!0}if(e.loader.type===j.HTMLLoader&&e.loader.shadowRootMode===de.localFrame){let l=d.behavior,u=o.element.contentWindow,g=l.remap||a;if(u[g]=p,g==="myop_cta_handler"&&u.__myop_cta_queue){let y=u.__myop_cta_queue;u.__myop_cta_queue=null,y.forEach(M=>{o.markedForDisposed||p(M.action,M.payload)})}return!0}return Jn(d,a,o),!1}else if(d.mode==="input")if(d.behavior.type==="message"){let c=[];d.behavior.ref&&c.push(Y.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let l=Me[d.behavior.message];return o.send(new l(...c)),!0}else throw new Error("Error: Unsupported Behavior\\n\\nThe 'behavior' field provided is not supported.\\n"+"Component: ".concat(o.componentDefinition.name,", ID: ").concat(o.componentDefinition.id,"\\n\\n")+"Prop Name: ".concat(a,"\\n")+"Behavior Field: ".concat(d.behavior.type,"\\n\\n")+"Check the documentation for valid behavior options.");return!1}};return o.props={},o.props=new Proxy(o.props,s),o},Es=(o,n)=>new Proxy(o,{get(e,t){return e[t]?e[t]:(...i)=>new Promise(a=>{i.forEach(p=>{Zt(p)||jn.notSerializableRefCall(t,p)}),n.send(new q(({ref:p,propName:d,functionArgs:c,makeSerializable:l})=>{if(p){let u=p[d];return l(typeof u=="function"?p[d](...c):u,!0)}return null},{elementId:e.refConfig.selector,propName:t,functionArgs:i},p=>{a(p.content)}))})},set(e,t,s){return n.send(new q(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:s,propName:t},i=>{})),!0}}),tn=async(o,n,e,t)=>{let s=o.component;if(!s)throw new Error("cant createRefComponent with detached ref");return new Promise(async(i,a)=>{let p=new Fe(n.type,s,t);e.push(p),await s.initiated();let d=setTimeout(()=>{a("timeout")},5e3);s.send(new ke(o.refConfig,n,U(h({},t||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(d),c.failed){a("CreateRefComponentMessage failed");return}let l=e.find(u=>u.id==p.id);if(l!==p){s.refs[o.refConfig.name]=l,i(l);return}else p.setInitiated(),s.refs[o.refConfig.name]=p;c.nestedRefs.forEach(u=>{let g=n.instance.resolvedNestedComponents.find(M=>M.type.id===u.componentDefinitionId).type,y=new Fe(g,p);y.setInitiated(),p.refs[u.refName]=y,e.push(y)});try{await nn(p,n,e,!0),s.setHeightBasedOnScrollHeight&&s.setHeightBasedOnScrollHeight(),i(p)}catch(u){a(u)}}))})},nn=async(o,n,e,t=!1)=>{o.refs||(o.refs={});let s=Object.values(o.componentDefinition.refs).map(i=>new Promise(async(a,p)=>{var d;if(i.behavior.type==xe.component){if(t){a();return}let c=i.behavior.componentId;c||(c=i.behavior.instance.componentId);let l=(d=n.instance.resolvedNestedComponents)==null?void 0:d.find(g=>g.type.id===c);if(!l)throw new Error("componentConfig provided without nestedComponentConfig check the config object");let u=Y.create("",i,o);try{let g=await tn(u,l,e);o.refs[i.name]=g,a()}catch(g){p(g)}}else try{let c=Y.create("",i,o);o.refs[i.name]=Es(c,o),a()}catch(c){}}));try{await Promise.all(s)}catch(i){throw i}}});var Ee,on=m(()=>{"use strict";Ke();w();ze();I();Ee=class extends z{constructor(e,t,s,i,a){super(e,s,a);this.componentConfig=e;this.container=s;this.IframeElement=i;r(this,"cleanupInspect");r(this,"setHeightBasedOnDocumentElement",()=>{let e=this.send(new D(()=>window.document.documentElement.scrollHeight,t=>{this.IframeElement.style.height="".concat(t.content,"px"),e()}))});r(this,"observeSizeBasedOnDocumentElement",()=>this.send(new D(({send:t})=>{let{height:s,width:i}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:d}=document.documentElement.getBoundingClientRect();t({height:p,width:d})});return a.observe(document.documentElement),a.observe(document.body),{height:s,width:i}},t=>{this.IframeElement.style.width="".concat(t.content.width,"px"),this.IframeElement.style.height="".concat(t.content.height,"px")})));r(this,"observeAutoSize",e=>{var Re;let t=this.IframeElement,s=t.contentDocument;if(!s)return console.warn("[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible"),()=>{};let i=(P,N,ge)=>N!==void 0&&P<N?N:ge!==void 0&&P>ge?ge:P,a=P=>{if(P===void 0)return;if(typeof P=="number")return P;let N=parseFloat(P);return isNaN(N)?void 0:N},p=a(e==null?void 0:e.minWidth),d=a(e==null?void 0:e.maxWidth),c=a(e==null?void 0:e.minHeight),l=a(e==null?void 0:e.maxHeight),u=(Re=e==null?void 0:e.loaderMinHeight)!=null?Re:50,g=(e==null?void 0:e.explicitWidth)!==void 0,y=(e==null?void 0:e.explicitHeight)!==void 0,M=this.container.getBoundingClientRect(),fe=M.width===0,Ne=M.height===0||M.height===u,G=(e!=null&&e.forceAutoSize||fe)&&!g,H=(e!=null&&e.forceAutoSize||Ne)&&!y;if(!G&&!H)return()=>{};let K=()=>{var N;let P=t.contentDocument;if(P){let ge=P.documentElement.getBoundingClientRect(),ln=Math.ceil(ge.width),fn=Math.ceil(ge.height),un=i(ln,p,d),gn=i(fn,c,l);G&&(t.style.width="".concat(un,"px")),H&&(t.style.height="".concat(gn,"px"));let cs=G&&d!==void 0&&ln>d,ms=H&&l!==void 0&&fn>l;P.documentElement.style.overflowX=cs?"auto":"hidden",P.documentElement.style.overflowY=ms?"auto":"hidden",(N=e==null?void 0:e.onSizeChange)==null||N.call(e,{width:un,height:gn,autoSizingWidth:G,autoSizingHeight:H})}};K();let ue=new ResizeObserver(K);return ue.observe(s.body),ue.observe(s.documentElement),()=>{ue.disconnect()}});r(this,"setSizeBasedOnDocumentElement",()=>{let e=this.send(new D(()=>{let{height:t,width:s}=document.documentElement.getBoundingClientRect();return{height:t,width:s}},t=>{this.IframeElement.style.width="".concat(t.content.width,"px"),this.IframeElement.style.height="".concat(t.content.height,"px"),e()}))});r(this,"setHeightBasedOnScrollHeight",()=>{let e=this.send(new D(()=>{let s=0;return s++,s--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+s+"px"},t=>{this.IframeElement.style.height=t.content,e()}))});r(this,"send",e=>{var i,a;let t=h({},e);if(t.messageType===f.ExecuteComponentMethod)return this[t.method](),()=>{};t.direction=v.down;let s=super.send(t);return(a=(i=this.IframeElement)==null?void 0:i.contentWindow)==null||a.postMessage(t,"*"),s});r(this,"dispose",()=>{this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});t.loader.autoHeight&&this.initiated().then(()=>{this.setHeightBasedOnScrollHeight()}),this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=Se(this.id,"MyopIframeComponent",10,this.container,this.IframeElement,this.componentDefinition),()=>{this.cleanupInspect(),this.cleanupInspect=void 0})}hide(){this.IframeElement.style.opacity="0",this.IframeElement.style.position="absolute",this.IframeElement.style.pointerEvents="none",this.IframeElement.style.visibility="hidden"}show(){this.IframeElement.style.opacity="1",this.IframeElement.style.position="unset",this.IframeElement.style.pointerEvents="all",this.IframeElement.style.visibility="visible"}onMessageReceived(e){return e.messageType===f.In.MutationObserverMessage||e.messageType===f.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var Q,Je=m(()=>{"use strict";Q=class{constructor(){r(this,"appendChild",(n,e,t)=>{var s;if(t!=null&&t.relative){if(t.relative.direction==="before")return n.insertBefore(e,t.relative.child);if(t.relative.direction==="after"){let i=(s=t.relative.child)==null?void 0:s.nextSibling;return n.insertBefore(e,i||null)}}else return n.appendChild(e)})}}});var Ts,Xe,Zn=m(()=>{"use strict";on();Je();ne();b();Ts=(o,n,e)=>{let t=new URL(o);return t.searchParams.append(n,e),t.toString()},Xe=class extends Q{constructor(){super(...arguments);r(this,"type",j.IframeLoader);r(this,"load",async(e,t,s,i)=>{let a,p=t.loader;if((s==null?void 0:s.nodeName)==="IFRAME")console.log("needs to load into an exsisting Iframe...",p.url,s),a=s,a.src=p.url;else{let d=E(),c="myop-comp-".concat(d);a=document.createElement("iframe"),a.id=c;let l="\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n height: ".concat(p.autoHeight||!p.height?"100%":p.height,";\\n width: 100%;\\n overflow: hidden;\\n border: none;\\n opacity: ").concat(i!=null&&i.hidden?"0":"1",";\\n pointer-events: ").concat(i!=null&&i.hidden?"none":"all",";\\n ");a.style.cssText=l,i!=null&&i.elementAttributes&&Object.entries(i.elementAttributes).forEach(([g,y])=>{y===""||y===null||y===void 0?a.setAttribute(g,""):a.setAttribute(g,String(y))});let u=t.loader.url;i!=null&&i._hasParent&&(u=Ts(u,"_myop-comp",d)),a.src=u,s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),a=this.appendChild(s,a,i)}return new Ee(e,t,s,a,i)})}}});var Ze,sn=m(()=>{"use strict";Ze={webcomponent_message_key:"myop_webcomponent_message"}});var Te,rn=m(()=>{"use strict";sn();Ke();ze();Te=class extends z{constructor(e,t,s,i,a){super(e,s,a);this.container=s;this.customElement=i;r(this,"cleanupInspect",()=>{});r(this,"send",e=>{let t=h({},e),s=super.send(t),i=new CustomEvent(Ze.webcomponent_message_key,{detail:t});try{this.customElement.dispatchEvent(i)}catch(a){console.log("error while trying to dispatchEvent",a)}return s});r(this,"dispose",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i}inspect(){return this.cleanupInspect=Se(this.id,"MyopWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){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"}show(){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=""}}});var an,et,eo=m(()=>{"use strict";rn();Je();ne();b();an={},et=class extends Q{constructor(){super(...arguments);r(this,"type",j.WebComponentLoader);r(this,"load",async(e,t,s,i)=>{let a=t.loader;an[a.url]?console.log("Module alreday loaded or in loading process"):an[a.url]=new Promise((c,l)=>{let u=a.url,g=document.createElement("script");g.type="module",g.src=u,g.onload=()=>{c()},g.onerror=()=>{l()},document.head.appendChild(g)}),await an[a.url],await In(1);let p="myop-comp-".concat(E()),d=document.createElement(a.tag);return s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),d.id=p,i!=null&&i.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),i!=null&&i._environment&&(d._myopEnvironment=i==null?void 0:i._environment),this.appendChild(s,d,i),new Te(e,t,s,d,i)})}}});var T,W=m(()=>{"use strict";b();T=class extends Ye{constructor(e,t){super(e);this.context=t;r(this,"executor",e=>{if(e.destination){let t=e.destination;if(this.context[t].context){let s=(i,a)=>{this.messageToHost(U(h({},i),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[t].context,s)}else debugger}else debugger})}}});var B,J=m(()=>{"use strict";B={id:"myop-id"}});var S,to,L=m(()=>{"use strict";J();S=(o,n)=>n.querySelectorAll("[".concat(B.id,"='").concat(o.refConfig.selector,"']")),to=(o,n)=>{let e=S(o,n);return e.length?e.item(0):null}});var tt,no=m(()=>{"use strict";I();w();W();L();tt=class extends T{constructor(){super(...arguments);r(this,"messageType",f.BindClickMessage);r(this,"innerExecutor",(e,t,s)=>{let i=S(e.ref,t.shadowRoot),a=[];return i.forEach(p=>{let d=()=>{s(new oe(e.handlerUniqueId))};p.addEventListener("click",d),a.push(()=>{p.removeEventListener("click",d)})}),()=>{a.forEach(p=>p())}})}}});var nt,oo=m(()=>{"use strict";I();W();L();nt=class extends T{constructor(){super(...arguments);r(this,"messageType",f.ChangeTextMessage);r(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(i=>{i.textContent=e.content})})}}});var ot,so=m(()=>{"use strict";b();ot=class extends we{constructor(e,t){super(e,t);this.container=e;this.shadowRoot=t}}});var st,ro=m(()=>{"use strict";b();J();W();w();I();st=class extends T{constructor(){super(...arguments);r(this,"innerExecutor",(e,t)=>{let s=t.shadowRoot.querySelectorAll("[".concat(B.id,"]")),i=[];s.forEach(a=>{let p=a.getAttribute(B.id);p&&i.push(new Ie(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new pe(e.handlerUniqueId,i))});r(this,"messageType",f.DetectMyopRefsMessage)}}});var rt,io=m(()=>{"use strict";I();W();L();rt=class extends T{constructor(){super(...arguments);r(this,"messageType",f.SetAttributeMessage);r(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(i=>{i.setAttribute(e.name,e.value)})})}}});var it,ao=m(()=>{"use strict";I();w();W();L();me();it=class extends T{constructor(){super(...arguments);r(this,"messageType",f.AddEventListenerMessage);r(this,"innerExecutor",(e,t,s)=>{let i=S(e.ref,t.shadowRoot),a=[];return i.forEach(p=>{let d=c=>{s(new re(e.handlerUniqueId,O(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var at,po=m(()=>{"use strict";I();J();$e();Ge();W();at=class extends T{constructor(){super(...arguments);r(this,"messageType",f.CreateRefComponentMessage);r(this,"innerExecutor",(e,t,s)=>{(async()=>{let a=t.shadowRoot.querySelectorAll("[".concat(B.id,"='").concat(e.refConfig.selector,"']"));if(a.length===1){let p=$.Instance(),d=p.components.find(g=>g.id===e.options.id);d&&d.dispose();let c=p.components.indexOf(d);c!==-1&&p.components.splice(c,1);let l=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),u=[];Object.keys(l.refs).forEach(g=>{let y=l.refs[g];y=y.__nonProxied||y,y.componentDefinition&&u.push({refName:g,componentDefinitionId:y.componentDefinition.id})}),s(new V(e.handlerUniqueId,u))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new V(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var pt,pn=m(()=>{"use strict";me();pt=(o,n,e)=>{let t=o.scriptInputs?o.scriptInputs:{};t.makeSerializable=O,t.send=n,t.rootRef=e,t.__scriptInputs=t;let i=new Function("return (".concat(o.script,")(...arguments)"))(t);n(i)}});var dt,co=m(()=>{"use strict";I();w();W();pn();dt=class extends T{constructor(){super(...arguments);r(this,"messageType",f.ExecuteScriptMessage);r(this,"innerExecutor",(e,t,s)=>{pt(e,a=>{s(new se(e.handlerUniqueId,a))},t)})}}});var mo,ct,lo=m(()=>{"use strict";I();w();W();L();J();me();mo=o=>{if(!o)return null;if(o.tagName==="FORM"){let n=new FormData(o),e={formData:{},unmappedData:[]},t=o.querySelectorAll("input, select, textarea"),s=-1;return t.forEach(i=>{if(typeof i.value=="string"){let a=i.getAttribute(B.id),p=i.getAttribute("name"),d={id:i.id,name:p,value:mo(i),required:i.required,validity:O(i.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(d):(e.unmappedData.push(e.formData[p]),e.formData[p]=d):e.formData[p]=d:e.unmappedData.push(d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},ct=class extends T{constructor(){super(...arguments);r(this,"messageType",f.GetElementValueMessage);r(this,"innerExecutor",(e,t,s)=>{S(e.ref,t.shadowRoot).forEach(a=>{s(new ie(mo(a)),e)})})}}});var mt,fo=m(()=>{"use strict";I();W();L();mt=class extends T{constructor(){super(...arguments);r(this,"messageType",f.SetInnerHtml);r(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(i=>{i.innerHTML=e.content})})}}});var uo={};ee(uo,{WebComponentSDK:()=>ve});var ve,dn=m(()=>{"use strict";b();I();sn();no();oo();so();ro();te();w();io();ao();po();co();lo();fo();ve=class extends Ce{constructor(){super(...arguments);r(this,"alwaysPassEnvelopesToHost",!0);r(this,"connectedCallback",(e,t)=>{e.addEventListener(Ze.webcomponent_message_key,s=>{let i=s.data?s.data:s.detail;if(!i||!i.myop){debugger;throw new Error("recvied webcomponent_message with wrong type")}else{let a=i;if(this.handleIncomeMessages(s),a.messageType===f.InitMessage){let p=a.content.id;this.components[p].context=new ot(e,t)}}}),setTimeout(()=>{this.messageToHost(new ae)},1)});r(this,"messageToHost",(e,t)=>{e.direction=v.up,!e.replayToHandler&&(t!=null&&t.handlerUniqueId)&&(e.replayToHandler=t.handlerUniqueId),window.myop.hostSDK.send(e)});r(this,"supportedHandlers",[new nt(this.messageToHost,this.components),new mt(this.messageToHost,this.components),new tt(this.messageToHost,this.components),new st(this.messageToHost,this.components),new rt(this.messageToHost,this.components),new it(this.messageToHost,this.components),new dt(this.messageToHost,this.components),new ct(this.messageToHost,this.components),new at(this.messageToHost,this.components)]);r(this,"init",()=>{})}};F("WebComponentSDK",ve)});var go=m(()=>{"use strict";dn()});var yo,ho=m(()=>{"use strict";yo=""});function _s(o,n){return class extends HTMLElement{connectedCallback(){let e=n===de.open?"open":"closed",t=this.attachShadow({mode:e});xo().then(s=>{s.connectedCallback(this,t),t.innerHTML=o})}}}var vs,Rs,Io,Co,lt,xo,ks,Hs,Ds,ft,wo=m(()=>{"use strict";rn();en();Je();ne();b();go();on();ho();vs="<!-- myop-web-component -->",Rs="myop-web-component",Io=new Set,Co=[],xo=async()=>(lt||(lt=new ve,lt.init()),lt);ks=(o,n,e)=>{customElements.define(o,_s(n,e)),console.log("define('".concat(o,"') was called, web component ready to use"))},Hs=o=>o.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/(\\d+)/g,"-$1").toLowerCase(),Ds=o=>(o=Hs(o),o.replace(/_/g,"-")),ft=class extends Q{constructor(){super(...arguments);r(this,"type",j.HTMLLoader);r(this,"load",async(e,t,s,i)=>{let a=t.loader;if(this.isMyopWebComponent(a.HTML))return this.loadExtractedWebComponent(e,t,s,a.HTML,i);let p="myop-comp-".concat(E()),d;if(a.shadowRootMode===de.localFrame){let c=E(),l="myop-comp-".concat(c),u=document.createElement("iframe");u.id=l,u.style.cssText="\\n display: block;\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n overflow: hidden;\\n border: none;\\n opacity: ".concat(i!=null&&i.hidden?"0":"1",";\\n width: 100%;\\n height: 100%;\\n pointer-events: ").concat(i!=null&&i.hidden?"none":"all",";\\n "),s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),u=this.appendChild(s,u,i);let g=u.contentDocument||u.contentWindow.document;g.open();let y=a.HTML;if(i!=null&&i._inspection){let H=new DOMParser().parseFromString(a.HTML,"text/html"),K=H.getElementById("myop_preview");K==null||K.removeAttribute("type");let ue=H.implementation.createHTMLDocument();ue.body.innerHTML="<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>";let Re=ue.body.firstChild;Re&&H.head&&H.head.insertBefore(H.importNode(Re,!0),H.head.firstChild),y=H.documentElement.outerHTML}else if((i==null?void 0:i.data)!==void 0){let H=new DOMParser().parseFromString(a.HTML,"text/html"),K=H.getElementById("myop_preview");K&&(K.remove(),y=H.documentElement.outerHTML)}g.writeln(y);let M='<script src="'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'"><\\/script>'),fe="<script>\\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\\n const __myop_init = async () => {\\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\\n const sdk = new IframeSDK();\\n sdk.init();\\n }\\n __myop_init().then();\\n <\\/script>";if(g.writeln("".concat(M).concat(fe)),(i==null?void 0:i.data)!==void 0){let G="<script>\\n window.__myop_cta_queue = [];\\n window.myop_cta_handler = function(action, payload) {\\n window.__myop_cta_queue.push({action: action, payload: payload});\\n };\\n <\\/script>",H=JSON.stringify(i.data).replace(/<\\/script/gi,"\\\\u003c/script"),K='<script id="__myop_init_data_script">\\n (function() {\\n var data = '.concat(H,";\\n var scriptEl = document.getElementById('__myop_init_data_script');\\n\\n var callInitInterface = function(fn) {\\n var startTime = performance.now();\\n // Mark as pre-injected data call for extension tracking\\n window.__myop_init_preinjected = true;\\n try {\\n fn(data);\\n } finally {\\n window.__myop_init_preinjected = false;\\n }\\n var duration = performance.now() - startTime;\\n\\n // Notify extension via postMessage (init* = pre-injected)\\n try {\\n window.parent.postMessage({\\n type: 'MYOP_PREINJECTED_INIT',\\n payload: {\\n data: data,\\n duration: duration,\\n timestamp: Date.now()\\n }\\n }, '*');\\n } catch (e) {}\\n\\n // Cleanup: remove script tag and stored data\\n if (scriptEl && scriptEl.parentNode) {\\n scriptEl.parentNode.removeChild(scriptEl);\\n }\\n delete window.__myop_init_data;\\n };\\n\\n if (typeof window.myop_init_interface === 'function') {\\n // Function already exists - call immediately\\n callInitInterface(window.myop_init_interface);\\n } else {\\n // Function not yet defined - store data and watch for definition\\n window.__myop_init_data = data;\\n\\n var _original;\\n Object.defineProperty(window, 'myop_init_interface', {\\n configurable: true,\\n enumerable: true,\\n set: function(fn) {\\n _original = fn;\\n if (window.__myop_init_data !== undefined) {\\n var storedData = window.__myop_init_data;\\n delete window.__myop_init_data;\\n callInitInterface(fn);\\n }\\n },\\n get: function() {\\n return _original;\\n }\\n });\\n }\\n })();\\n <\\/script>");g.writeln(G+K)}g.close();let Ne=new Ee(e,t,s,u,i);return a.autoHeight&&(u.onload=()=>{Ne.observeSizeBasedOnDocumentElement()}),Ne}if(a.shadowRootMode===de.none){let c=document.createElement("template");c.innerHTML=a.HTML,d=c.content.firstElementChild,xo().then(l=>{l.connectedCallback(d,d)})}else{let c=Ds(e.name+t.id);Co.includes(c)||(ks(c,a.HTML,a.shadowRootMode),Co.push(c)),d=document.createElement(c)}return s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),d.id=p,i!=null&&i.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),this.appendChild(s,d,i),new Te(e,t,s,d,i)})}isMyopWebComponent(e){return e.trimStart().startsWith(vs)}extractWebComponentScript(e){let i=new DOMParser().parseFromString(e,"text/html").getElementById(Rs);return(i==null?void 0:i.textContent)||null}executeWebComponentScript(e,t){if(Io.has(t)){console.log("[MyopWebComponent] Script already executed for ".concat(t,", skipping"));return}let s=document.createElement("script");s.textContent=e,s.id="myop-extracted-".concat(t),document.head.appendChild(s),Io.add(t),console.log("[MyopWebComponent] Executed web component script: ".concat(t))}async loadExtractedWebComponent(e,t,s,i,a){let p=this.extractWebComponentScript(i);if(!p)throw new Error('[MyopWebComponent] No <script id="myop-web-component"> found in HTML');let d="".concat(e.id,"-").concat(t.id),c=window.__MYOP_TAG_NAME__;this.executeWebComponentScript(p,d);let l=window.__MYOP_TAG_NAME__;if(!l)throw new Error("[MyopWebComponent] Script did not set window.__MYOP_TAG_NAME__");c&&c!==l&&console.warn("[MyopWebComponent] __MYOP_TAG_NAME__ changed from ".concat(c," to ").concat(l));let u="myop-comp-".concat(E()),g=document.createElement(l);g.id=u,a!=null&&a.hidden&&(g.style.opacity="0",g.style.position="absolute",g.style.height="0",g.style.width="0",g.style.pointerEvents="none",g.style.visibility="hidden"),s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),this.appendChild(s,g,a);let y=new le(e,t,s,g,l,a);return(a==null?void 0:a.data)!==void 0&&y.initWithData(a.data),console.log("[MyopWebComponent] Loaded <".concat(l,"> into container")),y}}});var bo,So,Eo=m(()=>{"use strict";ne();w();bo=(o,n,e)=>{let t="myop-css-".concat(E());return o.send(new D(({rootRef:s,_stylesheet:i,_tagId:a,_css:p})=>{let d=document.createElement("style");d.type="text/css";let c=p;for(let l in i){c+="".concat(l," { ");let u=i[l];for(let g in u)c+="".concat(g,": ").concat(u[g],"; ");c+="} "}d.appendChild(document.createTextNode(c)),d.id=a,(s.shadowRoot||s.container).appendChild(d)},()=>{},{_stylesheet:n,_css:e||"",_tagId:t})),()=>{o.send(new D(({rootRef:s,_tagId:i})=>{let a=(s.shadowRoot||document).getElementById(i);a&&a.remove()},()=>{},{_tagId:t}))}},So=(o,n)=>{let e="myop-css-".concat(E());return o.send(new D(({rootRef:t,_tagId:s,_link:i})=>{let a=document.createElement("link");a.id=s,a.rel="stylesheet",a.href=i,document.head.appendChild(a),(t.shadowRoot||t.container).appendChild(a)},()=>{},{_link:n,_tagId:e})),()=>{o.send(new D(({rootRef:t,_tagId:s})=>{let i=(t.shadowRoot||document).getElementById(s);i&&i.remove()},()=>{},{_tagId:e}))}}});var Bs,cn,To,vo=m(()=>{"use strict";Bs=(o,n)=>{let e=new RegExp(Object.keys(n).join("|"),"g");return o.replace(e,t=>(n[t]||t).toString())},cn=(o,n)=>{let e=o.loader;if(e.type!=="IframeLoader")throw new Error('iframeSkinUrlTokenizer received skin with loader type "'.concat(e.type,'", currently only "IframeLoader" is supported'));return o.loader=h({},o.loader),o.loader.url=Bs(o.loader.url,n),o},To=o=>async n=>cn(n,o)});var Ro,_o,ko=m(()=>{"use strict";w();Ro=(o,n,e)=>{o.send(new q(({ref:t,_className:s})=>{t==null||t.classList.add(s)},{elementId:e,_className:n}))},_o=(o,n,e)=>{o.send(new q(({ref:t,_className:s})=>{t==null||t.classList.remove(s)},{elementId:e,_className:n}))}});var yt,ut,ht,gt,Ho=m(()=>{"use strict";ne();yt=class yt{constructor(){r(this,"_runTimeInstanceId","runtime-instance-id-"+E());r(this,"_runTimeId","runtime-id-"+E());r(this,"_runTimeName","runtime-name-"+E());r(this,"id",this._runTimeId);r(this,"name",this._runTimeName);r(this,"description","");r(this,"loader",null);r(this,"withLoader",n=>(this.loader=n,this));r(this,"withHTMLLoader",n=>(n.type="HTMLLoader",this.loader=n,this));r(this,"build",()=>this)}};r(yt,"create",()=>new yt);ut=yt,ht=class ht{constructor(){r(this,"_runTimeInstanceId","runtime-instance-id-"+E());r(this,"_runTimeId","runtime-id-"+E());r(this,"_runTimeName","runtime-name-"+E());r(this,"instance",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});r(this,"name",this._runTimeName);r(this,"type",{id:this._runTimeId,name:this._runTimeName,description:"",props:[],refs:[],skins:[],defaultSkin:0});r(this,"withInstance",n=>(this.instance=n,this));r(this,"withType",n=>(this.type=n,this));r(this,"withName",n=>(this.name=n,this));r(this,"withDefaultSkin",n=>(this.type.skins.push(n),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:"Dedicated",skin:{id:n.id}},this));r(this,"withRef",n=>(this.type.refs.push(n),this));r(this,"withBasicRef",n=>{let e={id:"",name:n,description:"",selectorType:"id-attribute",selector:n,behavior:{type:"code"}};return this.type.refs.push(e),this});r(this,"build",()=>JSON.parse(JSON.stringify(this)))}};r(ht,"create",()=>new ht);gt=ht});var Ls,Mt,Ps,Os,X,Z,Do,Bo=m(()=>{"use strict";b();Ls=o=>({instance:{id:"auto",componentId:o.componentId,componentName:o.name,skinSelector:{type:"Dedicated",skin:{id:"skin_auto_v2_converted"}}},type:{id:o.id,name:o.name,description:o.description,props:[{id:"in_auto_v2_converted",name:"myop_init_interface",type:"any",behavior:{type:be.code}},{id:"out_auto_v2_converted",name:"myop_cta_handler",type:"any",behavior:{type:be.code}}],refs:[],skins:[{id:"skin_auto_v2_converted",name:"auto_v2_converted",description:"",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),Mt="__MYOP_CLOUD_REPOSITORY_MAIN__",Ps=()=>{if(typeof window<"u")return window[Mt];if(typeof globalThis<"u")return globalThis[Mt]},Os=o=>{typeof window<"u"&&(window[Mt]=o),typeof globalThis<"u"&&(globalThis[Mt]=o)},X=class X{constructor(n="https://cloud.myop.dev"){this._baseUrl=n;r(this,"variants",{});r(this,"preloadedComponents",{});r(this,"userFlows",{});r(this,"_defaultEnv","production")}static get Main(){let n=Ps();return n||(X._main||(X._main=new X,Os(X._main)),X._main)}setEnvironment(n){this._defaultEnv=n}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(n,e,t){return e!==void 0||t!==void 0?"".concat(n,":").concat(e||this._defaultEnv,":").concat(t?"preview":"live")in this.variants:n in this.preloadedComponents}getPreloadedParams(n){return this.preloadedComponents[n]}async fetchComponentV2(n,e,t){let s=this.preloadedComponents[n],i=e!==void 0||t!==void 0,a,p;!i&&s?(a=s.env,p=s.preview):(a=e||this._defaultEnv,p=t===!0?!0:t===!1?!1:!e);let d="".concat(n,":").concat(a,":").concat(p?"preview":"live");return console.log("[CloudRepository] fetchComponentV2",{componentId:n.slice(0,8)+"...",env:a,usePreview:p,cacheKey:d,cached:d in this.variants}),this.variants[d]||(this.preloadedComponents[n]||(this.preloadedComponents[n]={env:a,preview:p}),this.variants[d]=new Promise(async(c,l)=>{try{let u="".concat(this._baseUrl,"/consume?id=").concat(n,"&env=").concat(a);p&&(u+="&preview=true");let M=(await(await fetch(u)).json()).item;if(!M){l(new Error('Component "'.concat(n,'" not found')));return}if(!M.consume_variant||!M.consume_variant.length){l(new Error('Component "'.concat(n,'" has no implementation for environment "').concat(a,'"')));return}let fe=Ls(M);c(fe)}catch(u){l(u)}})),await this.variants[d]}async fetchComponentV1(n,e){return e?(await this.fetchFlow(e)).components.find(s=>s.type.id===n):(await this.fetchAutoFlow(n)).components[0]}async fetchAutoFlow(n){return this.userFlows[n]||(this.userFlows[n]=new Promise(async(e,t)=>{try{let i=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(n,"&auto=true"))).json();e(i.item)}catch(s){t(s)}})),await this.userFlows[n]}async fetchFlow(n){return this.userFlows[n]||(this.userFlows[n]=new Promise(async(e,t)=>{try{let i=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(n,"&resolve=components"))).json();e(i.item)}catch(s){t(s)}})),await this.userFlows[n]}async fetchComponent(n,e){return this.fetchComponentV1(n,e)}};r(X,"_main",null);Z=X,Do=Z});var Lo,Po=m(()=>{"use strict";Lo=async o=>await o()});var mn={};ee(mn,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ut,addClass:()=>Ro,applyStylesheet:()=>bo,applyStylesheetLink:()=>So,changeSkinUrlByTokenizer:()=>To,createIframeSkinByTokenizer:()=>cn,exec:()=>Lo,removeClass:()=>_o,v2_CloudRepository:()=>Do});var It=m(()=>{"use strict";Eo();vo();ko();Ho();Bo();Po()});var Oo,Ao=m(()=>{"use strict";Ot();It();b();Oo=async o=>{try{let n=new URL(window.location.href),t=new URLSearchParams(n.search).get("myopOverride");if(t){let[s,...i]=Pt(t);switch(s){case"component":{let[a,p]=i,d=await Z.Main.fetchComponent(a);if(d&&d.type.skins.find(l=>l.id===p))return d.instance.skinSelector={type:ce.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=Pt(t),c=(await Z.Main.fetchFlow(a)).components.find(l=>l.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ce.Segmented&&c.instance.resolvedExperiences){let l=c.instance.resolvedExperiences.find(u=>u.id===p);if((l==null?void 0:l.type)===Qe.Segment){let u=l,y=c.instance.skinSelector.segments.find(M=>M.segmentId===u.segment.id);if(y)return c.instance.skinSelector=y==null?void 0:y.skinSelector,c}}}break}}}finally{return null}}});var Fo={};ee(Fo,{HostSDK:()=>$,hostSDK:()=>$o});var Ko,$,$o,$e=m(()=>{"use strict";te();I();w();Zn();eo();ze();b();je();wo();Ao();Ko="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",$=class{constructor(){r(this,"components2init",[]);r(this,"components",[]);r(this,"componentsLoaders",[]);r(this,"initiated",!1);r(this,"version",ye);r(this,"type2InstanceCount",{});r(this,"assignId",n=>(this.type2InstanceCount[n.id]||(this.type2InstanceCount[n.id]=0),"".concat(n.id,"_").concat(++this.type2InstanceCount[n.id])));r(this,"inspected",!1);r(this,"inspect",()=>{this.inspected||(this.inspected=!0,this.components.forEach(n=>{n.inspect&&n.inspect()}))});r(this,"incomingMessageHandler",n=>{if(n.origin,document.location.origin,n.data.myop){if(n.data.direction!==v.up&&n.data.messageType!==f.EnvelopedMessage)return;let e=n.data;if(e.messageType===f.InitRequest){this.components2init.forEach(s=>{s.send(new he(s.id))});return}if(e.messageType===f.InitResponse){this.components2init=this.components2init.filter(i=>i.id!==e.content.id);let s=this.components.find(i=>{var a;return i.id===((a=e.content)==null?void 0:a.id)});s==null||s.setInitiated();return}if(e.messageType===f.EnvelopedMessage){let s=e,i=this.components.find(a=>a.id===s.destination);if(i){if(s.direction===v.down){s.message.messageType===A.name?i.onMessageReceived(s.message):(s.message.route=s.route,i.send(s.message));return}}else{let a=this.components.find(p=>p.id===s.message.destination);a&&a.send(s.message)}return}let t=this.components.find(s=>s.id===e.destination);if(!t){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(t){if(t.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});r(this,"send",n=>{let e=new MessageEvent("",{data:n});this.incomingMessageHandler(e)});r(this,"init",n=>{if(this.initiated)throw new Error("hostSDK already initiated");let e=[new Xe,new et,new ft];if(this.componentsLoaders=[...e],n){let t={};n.forEach(s=>{let i=new s(this.componentsLoaders);t[i.type]=i}),this.componentsLoaders.forEach(s=>{t[s.type]||(t[s.type]=s)}),this.componentsLoaders=Object.values(t)}window.addEventListener("message",this.incomingMessageHandler,!1),console.log("myop hostSDK initiated",document.location.href),this.initiated=!0});r(this,"_getSkinIdBySkinSelector",async(n,e=[],t)=>{var i;async function s(a,p){for(let d of a)if(await p(d))return d}switch(n.type){case"DedicatedSkin":case ce.Dedicated:return((i=n.skin)==null?void 0:i.id)||n.skins[0].id;case ce.Segmented:{let p=await s(n.segments,async d=>{if(d.segmentId==="Default")return!0;let c=e.find(y=>y.type===Qe.Segment?y.segment.id===d.segmentId:!1);if(!c)throw new Error("experience not found");let u=c.segment,g=(t||{})[u.function];return g?await g():(console.warn("segmentId:".concat(d.segmentId,", ").concat(u.function," function not provided !")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return""});r(this,"runSkinSelector",async(n,e)=>{let t=await this._getSkinIdBySkinSelector(n.instance.skinSelector,n.instance.resolvedExperiences,e);return n.type.skins.find(s=>s.id===t)});r(this,"loaderHooks");r(this,"loadComponent",async(n,e,t)=>{var l,u,g,y;if(!e){debugger;throw new Error("no container was found for this component")}let s=await Oo(n);s&&(n=s);let i=h(h({},(l=this.loaderHooks)!=null?l:{}),(u=t==null?void 0:t.hooks)!=null?u:{}),a=e;if(a.myop)if(a.component){n=h({},n),n.instance=h({},n.instance);let M=await this.runSkinSelector(n,i);if(!M)throw new Error("runSkinSelector failed to choose skin, check the provided config");return(g=t==null?void 0:t.hooks)!=null&&g.afterSkinSelected&&(M=await t.hooks.afterSkinSelected(h({},M))),n.instance.skinSelector={type:ce.Dedicated,skin:M},t&&(t=h({},t),delete t.hooks),await tn(a,n,this.components,t)}else throw new Error("load component got a detached ref.");e=e;let p=await this.runSkinSelector(n,i);if(!p)throw new Error("runSkinSelector failed to choose skin, check the provided config");(y=t==null?void 0:t.hooks)!=null&&y.afterSkinSelected&&(p=await t.hooks.afterSkinSelected(h({},p)));let d=this.componentsLoaders.find(M=>M.type===p.loader.type);if(!d){debugger;throw new Error('no loader "'.concat(p.loader.type,'" was found for component'))}let c=await d.load(n.type,p,e,t);c.isInitiated||this.components2init.push(c),c.bind("onDispose",()=>(this.components=this.components.filter(M=>M!==c),this.components2init=this.components2init.filter(M=>M!==c),!0)),this.components.push(c),(!t||t.connectProps!==!1)&&(c=Xn(c,n.type.props,p));try{await nn(c,n,this.components)}catch(M){throw M}return t!=null&&t.skipInit||await c.initiated(),c});r(this,"navigate",async(n,e,t)=>{if(n.parent)throw new Error("Navigating on remote ref components is not implemented yet");if(t!=null&&t.staged){let s=await this.loadComponent(e,n.container,h({hidden:!0,relative:{direction:"after",child:n.element}},t));return t.init&&await t.init(s),s.show(),n.dispose(),s}else{let s=n.element.nextSibling;return n.dispose(),this.loadComponent(e,n.container,h({relative:{direction:"before",child:s}},t))}})}};r($,"Instance",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ko});if(!window.myop.hostSDK){let o=new $;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ko}),window.myop.hostSDK=o}$o=window.myop.hostSDK;F("hostSDK",$o)});var Ct,zo=m(()=>{"use strict";I();J();b();w();Ct=class extends x{constructor(){super(...arguments);r(this,"messageType",f.DetectMyopRefsMessage);r(this,"executor",e=>{let t=document.querySelectorAll("[".concat(B.id,"]")),s=[];t.forEach(i=>{let a=i.getAttribute(B.id);a&&s.push(new Ie(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new pe(e.handlerUniqueId,s))})}}});var xt,Wo=m(()=>{"use strict";I();b();w();L();xt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.BindClickMessage);r(this,"executor",e=>{let t=[];return S(e.ref,document).forEach(i=>{let a=()=>{this.messageToHost(new oe,e)};i.addEventListener("click",a);let p=()=>{i.removeEventListener("click",a)};t.push(p)}),()=>{t.forEach(i=>i())}})}}});var wt,No=m(()=>{"use strict";I();b();L();wt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.ChangeTextMessage);r(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.textContent=e.content})})}}});var bt,Uo=m(()=>{"use strict";I();w();b();pn();bt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.ExecuteScriptMessage);r(this,"executor",e=>{pt(e,s=>{this.messageToHost(new se(e.handlerUniqueId,s))},new we(document.documentElement))})}}});var St,qo=m(()=>{"use strict";I();b();w();me();L();St=class extends x{constructor(){super(...arguments);r(this,"messageType",f.AddEventListenerMessage);r(this,"executor",e=>{let t=S(e.ref,document),s=[];return t.forEach(i=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new re(e.handlerUniqueId,O(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),s.push(()=>{i.removeEventListener(e.type,a)})}),()=>{s.forEach(i=>{i()})}})}}});var Et,Vo=m(()=>{"use strict";I();b();L();Et=class extends x{constructor(){super(...arguments);r(this,"messageType",f.SetAttributeMessage);r(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.setAttribute(e.name,e.value)})})}}});var Tt,jo=m(()=>{"use strict";I();J();b();$e();Ge();Tt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.CreateRefComponentMessage);r(this,"executor",e=>{(async()=>{let s=document.querySelectorAll("[".concat(B.id,"='").concat(e.refConfig.selector,"']"));if(s.length===1){let a=await $.Instance().loadComponent(e.nestedComponentConfig,s.item(0),e.options),p=[];Object.keys(a.refs).forEach(d=>{let c=a.refs[d];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:d,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new V(e.handlerUniqueId,p))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new V(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var Go,Yo=m(()=>{"use strict";Go=(o,n)=>{if(!o){console.log("n");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!o||o.nodeType!==1))if(e){let t=new e(n),s={attributes:!0,childList:!0,subtree:!0};return t.observe(o,s),t}else window.addEventListener&&(o.addEventListener("DOMNodeInserted",n,!1),o.addEventListener("DOMNodeRemoved",n,!1))}});var vt,Qo=m(()=>{"use strict";I();w();b();Yo();vt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.SetMutationObserverMessage);r(this,"executor",e=>{e.source&&Go(document.body,()=>{this.messageToHost(new Be)})})}}});var Jo,Rt,Xo=m(()=>{"use strict";I();J();b();w();me();L();Jo=o=>{if(!o)return null;if(o.tagName==="FORM"){let n=new FormData(o),e={formData:{},unmappedData:[]},t=o.querySelectorAll("input, select, textarea"),s=-1;return t.forEach(i=>{if(typeof i.value=="string"){let a=i.getAttribute(B.id),p=i.getAttribute("name"),d={id:i.id,name:p,value:Jo(i),required:i.required,validity:O(i.validity,!0),myopId:a};e.unmappedData.push(d),p&&(!e.formData[p]||!e.formData[p].value||d.value)&&(e.formData[p]=d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Rt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.GetElementValueMessage);r(this,"executor",e=>{S(e.ref,document).forEach(s=>{this.messageToHost(new ie(Jo(s)),e)})})}}});var _t,Zo=m(()=>{"use strict";I();b();w();L();_t=class extends x{constructor(){super(...arguments);r(this,"messageType",f.GetAttributeMessage);r(this,"executor",e=>{let t=to(e.ref,document);t&&this.messageToHost(new De(t.getAttribute(e.name)),e)})}}});var kt,es=m(()=>{"use strict";w();I();b();kt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.SetResizeObserverMessage);r(this,"executor",e=>{let t=new ResizeObserver(s=>{this.messageToHost(new Ae)});return t.observe(document.body),()=>{t.disconnect()}})}}});var Ht,ts=m(()=>{"use strict";I();b();L();Ht=class extends x{constructor(){super(...arguments);r(this,"messageType",f.SetInnerHtml);r(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.innerHTML=e.content})})}}});var ns={};ee(ns,{IframeSDK:()=>Dt});var Dt,os=m(()=>{"use strict";b();zo();Wo();No();Uo();te();qo();Vo();w();jo();Qo();Xo();je();Zo();es();ts();Dt=class extends Ce{constructor(){super();r(this,"version",ye);r(this,"messageToHost",(e,t)=>{var i;!e.replayToHandler&&(t!=null&&t.handlerUniqueId)&&(e.replayToHandler=t.handlerUniqueId);let s=Object.keys(this.components);e.destination||(t!=null&&t.route?e.destination=t.route[t.route.length-1]:e.destination=s[0]),e.source||(e.source=s[0]),e.direction=v.up,(i=window.parent)==null||i.postMessage(h({},e),"*")});r(this,"supportedHandlers",[new wt(this.messageToHost),new Ht(this.messageToHost),new xt(this.messageToHost),new Ct(this.messageToHost),new bt(this.messageToHost),new St(this.messageToHost),new Et(this.messageToHost),new Rt(this.messageToHost),new vt(this.messageToHost),new kt(this.messageToHost),new _t(this.messageToHost),new Tt(this.messageToHost)]);r(this,"init",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new ae)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};F("IframeSDK",Dt)});var Ks={};var As,ss=m(()=>{"use strict";w();te();As=h({},Me);F("MyopMessages",As)});var rs={};ee(rs,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ut,addClass:()=>Ro,applyStylesheet:()=>bo,applyStylesheetLink:()=>So,changeSkinUrlByTokenizer:()=>To,createIframeSkinByTokenizer:()=>cn,exec:()=>Lo,removeClass:()=>_o,v2_CloudRepository:()=>Do});var is=m(()=>{"use strict";te();It();It();F("MyopHelpers",mn)});var Ns={};ee(Ns,{getHostModule:()=>as,getIframeModule:()=>ps,getWebcomponentModule:()=>ds});te();var Mn;if(window.__federation__)console.log("__federation__ loaded more than once.");else{let o=(Mn=document.currentScript)==null?void 0:Mn.src,n=o?o.split("/").slice(0,-1).join("/"):"";window.__federation__={__public_auto_path__:n,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(o,n,e)=>{if(window.__federation__[n])console.log("__federation__ module ".concat(n," already loaded.")),e(window.__federation__[n][Lt]);else{let t;window.__federation__[n]={},window.__federation__[n][Ve]=s=>{t&&(document.head.removeChild(t),t=null),window.__federation__[n][Lt]=s,e(s)},t=document.createElement("script"),t.type="module",t.src=o,t.async=!0,document.head.appendChild(t)}};je();console.log("myop root sdk - loaded",document.location.origin);var $s="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",as=()=>Promise.resolve().then(()=>($e(),Fo)),ps=()=>Promise.resolve().then(()=>(os(),ns)),ds=()=>Promise.resolve().then(()=>(dn(),uo)),Fs=()=>Promise.resolve().then(()=>(ss(),Ks)),zs=()=>Promise.resolve().then(()=>(is(),rs)),We=o=>async()=>(await o()).get(),Ws={version:ye,getHostModule:We(as),getIframeModule:We(ps),getWebcomponentModule:We(ds),getMyopMessages:We(Fs),getMyopHelpers:We(zs)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:$s});window.myop.rootSDK?console.log("myop root host loaded more than once."):window.myop=h({rootSDK:Ws},window.myop);return Ms(Ns);})();
7
7
  `;
8
8
  exports.HTML = `
9
9
  <!DOCTYPE html>
@@ -47,15 +47,16 @@ exports.HTML = `
47
47
  }
48
48
  })();
49
49
 
50
- async function loadMyopComponent(configAsString) {
50
+ async function loadMyopComponent(configAsString, optionsAsString) {
51
51
  try {
52
52
  const componentConfig = JSON.parse(decodeURIComponent(configAsString));
53
+ const options = optionsAsString ? JSON.parse(decodeURIComponent(optionsAsString)) : undefined;
53
54
  const container = document.getElementById('myop-container');
54
- window.myopComponent = await window.__myopHostSDK.loadComponent(componentConfig, container);
55
+ window.myopComponent = await window.__myopHostSDK.loadComponent(componentConfig, container, options);
55
56
 
56
- // Set up myop_cta_handler to forward calls to React Native
57
- if (window.myopComponent && window.myopComponent.element && window.myopComponent.element.contentWindow) {
58
- window.myopComponent.element.contentWindow.myop_cta_handler = function(action, payload) {
57
+ // Set up myop_cta_handler to forward calls to React Native via SDK prop system
58
+ if (window.myopComponent) {
59
+ window.myopComponent.props.myop_cta_handler = function(action, payload) {
59
60
  window.ReactNativeWebView.postMessage('CTA:' + JSON.stringify({ action: action, payload: payload }));
60
61
  };
61
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"componentHost.html.js","sourceRoot":"","sources":["../src/componentHost.html.ts"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,0CAA0C;;;AAE1C,MAAM,WAAW,GAAG;CACnB,CAAC;AAEW,QAAA,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;cAwBN,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCxB,CAAC"}
1
+ {"version":3,"file":"componentHost.html.js","sourceRoot":"","sources":["../src/componentHost.html.ts"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,0CAA0C;;;AAE1C,MAAM,WAAW,GAAG;CACnB,CAAC;AAEW,QAAA,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;cAwBN,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myop/react-native",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "React Native component for embedding Myop components via WebView",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -30,10 +30,20 @@
30
30
  "typescript": "~5.9.2"
31
31
  },
32
32
  "keywords": [
33
- "react-native",
34
33
  "myop",
34
+ "react-native",
35
35
  "webview",
36
- "component"
36
+ "components",
37
+ "dynamic-ui",
38
+ "real-time",
39
+ "no-deploy",
40
+ "remote-components",
41
+ "micro-frontend",
42
+ "ab-testing",
43
+ "feature-flags",
44
+ "sandboxed",
45
+ "ai-components",
46
+ "mobile"
37
47
  ],
38
48
  "author": "",
39
49
  "license": "MIT",
@@ -42,6 +52,6 @@
42
52
  "url": ""
43
53
  },
44
54
  "dependencies": {
45
- "@myop/sdk": "^0.3.13"
55
+ "@myop/sdk": "^0.3.17"
46
56
  }
47
57
  }