@myop/react-native 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +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/C,GAAG,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;KAC9C,CAAC;CACL;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IAEX,iEAAiE;IACjE,KAAK,EAAE;QACH,mBAAmB,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;QACzC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;KACtE,CAAC;IAEF,yCAAyC;IACzC,OAAO,EAAE,aAAa,CAAC;IAEvB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;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AE,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,sBAwV9C,CAAA"}
@@ -106,8 +106,14 @@ 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
- // Snapshot of data passed to loader options - used to skip redundant callInitInterface
110
- const dataPassedToLoader = (0, react_1.useRef)(undefined);
109
+ // Tracks the JSON of the last data sent to the WebView (via loader or callInitInterface)
110
+ // to avoid redundant calls when the consumer passes a new object with identical values.
111
+ const lastSentDataJson = (0, react_1.useRef)(undefined);
112
+ // Always-current ref for props.data — read by loadComponent so the async callback
113
+ // always sees the latest value without needing props.data in its dependency array
114
+ // (which would cascade re-creations of loadComponent → onMessage on every render).
115
+ const dataRef = (0, react_1.useRef)(props.data);
116
+ dataRef.current = props.data;
111
117
  const fadeDuration = (_a = props.fadeDuration) !== null && _a !== void 0 ? _a : 200;
112
118
  // Function to call myop_init_interface in the WebView
113
119
  const callInitInterface = (0, react_1.useCallback)((data) => {
@@ -121,20 +127,16 @@ const MyopComponent = (props) => {
121
127
  true;
122
128
  `);
123
129
  }, [isComponentLoaded]);
124
- // Call myop_init_interface when data prop changes (after component is loaded)
125
- // Data is also pre-injected via loaderOptions for fast initial render,
126
- // so skip the first call only if data hasn't changed since it was passed to the loader.
127
- // If data changed during loading, we must send the current value.
130
+ // Call myop_init_interface when data prop changes (after component is loaded).
131
+ // Compares serialized JSON to skip calls when the data values haven't actually changed,
132
+ // even if the consumer creates a new object reference every render.
128
133
  (0, react_1.useEffect)(() => {
129
134
  if (isComponentLoaded && props.data !== undefined) {
130
135
  const currentDataJson = JSON.stringify(props.data);
131
- if (dataPassedToLoader.current !== undefined &&
132
- dataPassedToLoader.current === currentDataJson) {
133
- // Data hasn't changed since loading - already injected, skip
134
- dataPassedToLoader.current = undefined;
136
+ if (lastSentDataJson.current === currentDataJson) {
135
137
  return;
136
138
  }
137
- dataPassedToLoader.current = undefined;
139
+ lastSentDataJson.current = currentDataJson;
138
140
  callInitInterface(props.data);
139
141
  }
140
142
  }, [props.data, isComponentLoaded, callInitInterface]);
@@ -302,11 +304,14 @@ const MyopComponent = (props) => {
302
304
  if (isCancelled.current)
303
305
  return;
304
306
  const encoded = encodeURIComponent(JSON.stringify(componentConfig));
305
- const loaderOptions = props.data !== undefined ? { data: props.data } : undefined;
307
+ // Read latest data from ref (not stale closure) critical for consumers
308
+ // who compute data inline (e.g. data={transform(...)}) since props.data
309
+ // may have changed while fetchComponentV2 was in-flight.
310
+ const currentData = dataRef.current;
311
+ const loaderOptions = currentData !== undefined ? { data: currentData } : undefined;
306
312
  const encodedOptions = loaderOptions ? encodeURIComponent(JSON.stringify(loaderOptions)) : '';
307
- // Snapshot the data we're passing to the loader so useEffect can skip
308
- // the redundant callInitInterface if data hasn't changed by load time
309
- dataPassedToLoader.current = loaderOptions ? JSON.stringify(props.data) : undefined;
313
+ // Record what we sent so the useEffect deduplication skips the first post-load call
314
+ lastSentDataJson.current = loaderOptions ? JSON.stringify(currentData) : undefined;
310
315
  (_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`
311
316
  loadMyopComponent(\`${encoded}\`, ${encodedOptions ? `\`${encodedOptions}\`` : 'null'});
312
317
  `);
@@ -376,7 +381,14 @@ const MyopComponent = (props) => {
376
381
  };
377
382
  }, []);
378
383
  return (react_1.default.createElement(react_native_1.View, { style: props.style ? props.style : styles.root },
379
- react_1.default.createElement(react_native_webview_1.WebView, { ref: webviewRef, originWhitelist: ['*'], source: { html: getHtml((_b = props.zoomEnabled) !== null && _b !== void 0 ? _b : false, (_c = props.selectionEnabled) !== null && _c !== void 0 ? _c : false) }, onMessage: onMessage, style: styles.webview, javaScriptEnabled: true, domStorageEnabled: true, mixedContentMode: "always", allowFileAccess: true, allowUniversalAccessFromFileURLs: true, overScrollMode: "never", scrollEnabled: (_d = props.scrollEnabled) !== null && _d !== void 0 ? _d : false }),
384
+ react_1.default.createElement(react_native_webview_1.WebView, { ref: webviewRef, originWhitelist: ['*'], source: { html: getHtml((_b = props.zoomEnabled) !== null && _b !== void 0 ? _b : false, (_c = props.selectionEnabled) !== null && _c !== void 0 ? _c : false) }, onMessage: onMessage, style: [
385
+ styles.webview,
386
+ // When data is provided, hide the WebView until the component has loaded
387
+ // and real data has been applied. This prevents the pre-rendered preview
388
+ // content in the component's HTML from flashing before myop_init_interface
389
+ // is called with the customer's actual data.
390
+ props.data !== undefined && !isComponentLoaded && { opacity: 0 },
391
+ ], javaScriptEnabled: true, domStorageEnabled: true, mixedContentMode: "always", allowFileAccess: true, allowUniversalAccessFromFileURLs: true, overScrollMode: "never", scrollEnabled: (_d = props.scrollEnabled) !== null && _d !== void 0 ? _d : false }),
380
392
  showLoader && props.loader !== undefined && (react_1.default.createElement(react_native_1.View, { style: styles.loaderContainer }, (0, react_1.isValidElement)(props.loader)
381
393
  ? (0, react_1.cloneElement)(props.loader, { ref: loaderRef })
382
394
  : props.loader)),
@@ -1 +1 @@
1
- {"version":3,"file":"MyopComponent.js","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":";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AyE;gBACzE,yEAAyE;gBACzE,2EAA2E;gBAC3E,6CAA6C;gBAC7C,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,iBAAiB,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;aACnE,EACD,iBAAiB,EAAE,IAAI,EACvB,iBAAiB,EAAE,IAAI,EACvB,gBAAgB,EAAC,QAAQ,EACzB,eAAe,EAAE,IAAI,EACrB,gCAAgC,EAAE,IAAI,EACtC,cAAc,EAAC,OAAO,EACtB,aAAa,EAAE,MAAA,KAAK,CAAC,aAAa,mCAAI,KAAK,GAC7C;QACD,UAAU,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,CACzC,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe,IAC9B,IAAA,sBAAc,EAAC,KAAK,CAAC,MAAM,CAAC;YACzB,CAAC,CAAC,IAAA,oBAAY,EAAC,KAAK,CAAC,MAAiC,EAAE,EAAC,GAAG,EAAE,SAAS,EAAC,CAAC;YACzE,CAAC,CAAC,KAAK,CAAC,MAAM,CAEf,CACV;QACA,YAAY,IAAI,CACb,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe,IAC9B,MAAA,KAAK,CAAC,QAAQ,mCAAI,8BAAC,2BAAY,OAAG,CAChC,CACV,CACE,CACV,CAAC;AACN,CAAC,CAAA;AAxVY,QAAA,aAAa,iBAwVzB;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE;QACF,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACjB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,CAAC;KACV;IACD,eAAe,kCACR,yBAAU,CAAC,kBAAkB,KAChC,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 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,bn=m(()=>{\"use strict\";k();$t=class extends C{constructor(e,t){super();this.ref=e;r(this,\"messageType\",\"ChangeTextMessage\");this.content=t}}});var wn,xs,bs,Sn,D,se,Ft=m(()=>{\"use strict\";k();wn=\"ExecuteScriptReplyMessage\",xs=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,bs=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,Sn=o=>{let n=o.match(xs);if(n)return n[1]||n[3];{let e=o.match(bs);if(e)return e[1].trim()}},D=class extends _{constructor(e,t=()=>{},s){super(t);this.scriptInputs=s;r(this,\"replyMessageKey\",wn);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\",wn)}}});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 b=m(()=>{\"use strict\";k();xn();bn();Ft();En();vn();Rn();Ut();kn();Hn();Ge();Vt();Ln();Ut();On();An();Kn();Fn();zn();Wn()});var z,Ke=m(()=>{\"use strict\";I();b();$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();w();b();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,we,xe,ce,Qe,be,w=m(()=>{\"use strict\";Nn();qn();Vn();j={IframeLoader:\"IframeLoader\",WebComponentLoader:\"WebComponentLoader\",HTMLLoader:\"HTMLLoader\",MinimizedLoader:\"MinimizedLoader\"},de={open:\"open\",closed:\"closed\",none:\"none\",localFrame:\"localFrame\"},we={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\"},be=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,ws,Zt,O,me=m(()=>{\"use strict\";Xt=o=>o!==Object(o),ws=o=>typeof o==\"function\",Zt=o=>{if(Xt(o))return!0;if(ws(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();b();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){if(typeof this.customElement.myop_init_interface==\"function\")this.customElement.myop_init_interface(e);else{let t;Object.defineProperty(this.customElement,\"myop_init_interface\",{configurable:!0,enumerable:!0,set:s=>{t=s,typeof s==\"function\"&&(Object.defineProperty(this.customElement,\"myop_init_interface\",{configurable:!0,enumerable:!0,writable:!0,value:s}),s(e))},get:()=>t})}}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\";b();b();w();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===we.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===we.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();b();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();w();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();w();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\";w();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();b();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\";w();ot=class extends be{constructor(e,t){super(e,t);this.container=e;this.shadowRoot=t}}});var st,ro=m(()=>{\"use strict\";w();J();W();b();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();b();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();b();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();b();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\";w();I();sn();no();oo();so();ro();te();b();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,bo=m(()=>{\"use strict\";rn();en();Je();ne();w();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 wo,So,Eo=m(()=>{\"use strict\";ne();b();wo=(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\";b();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\";w();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: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}),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:()=>wo,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();w();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();b();Zn();eo();ze();w();je();bo();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();w();b();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();w();b();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 bt,No=m(()=>{\"use strict\";I();w();L();bt=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 wt,Uo=m(()=>{\"use strict\";I();b();w();pn();wt=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 be(document.documentElement))})}}});var St,qo=m(()=>{\"use strict\";I();w();b();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();w();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();w();$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();b();w();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();w();b();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();w();b();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\";b();I();w();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();w();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\";w();zo();Wo();No();Uo();te();qo();Vo();b();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 bt(this.messageToHost),new Ht(this.messageToHost),new xt(this.messageToHost),new Ct(this.messageToHost),new wt(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\";b();te();As=h({},Me);F(\"MyopMessages\",As)});var rs={};ee(rs,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ut,addClass:()=>Ro,applyStylesheet:()=>wo,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";
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 Ve=Object.defineProperty,Ds=Object.defineProperties,Bs=Object.getOwnPropertyDescriptor,Ls=Object.getOwnPropertyDescriptors,Ps=Object.getOwnPropertyNames,Rn=Object.getOwnPropertySymbols;var _n=Object.prototype.hasOwnProperty,Os=Object.prototype.propertyIsEnumerable;var At=(o,n,e)=>n in o?Ve(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e,M=(o,n)=>{for(var e in n||(n={}))_n.call(n,e)&&At(o,e,n[e]);if(Rn)for(var e of Rn(n))Os.call(n,e)&&At(o,e,n[e]);return o},V=(o,n)=>Ds(o,Ls(n));var m=(o,n)=>()=>(o&&(n=o(o=0)),n);var se=(o,n)=>{for(var e in n)Ve(o,e,{get:n[e],enumerable:!0})},As=(o,n,e,t)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let s of Ps(n))!_n.call(o,s)&&s!==e&&Ve(o,s,{get:()=>n[s],enumerable:!(t=Bs(n,s))||t.enumerable});return o};var Ks=o=>As(Ve({},\"__esModule\",{value:!0}),o);var r=(o,n,e)=>At(o,typeof n!=\"symbol\"?n+\"\":n,e);var je,Ge,Kt,W,re=m(()=>{\"use strict\";je=\"__federation__\",Ge=\"onLoad\",Kt=\"moduleInstance\",W=(o,n)=>{window[je]&&window[je][o]&&window[je][o][Ge]&&window[je][o][Ge]({[o]:n})}});var Ie,Ye=m(()=>{Ie=\"0.3.19\"});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,zs,Fs,zt,Ft=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)),zs=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(\"-\")},Fs=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))},zt=o=>{let n=Fs(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(zs(n.slice(t,t+16)));return e}});var Hn,ie=m(()=>{\"use strict\";Ft();Hn=o=>new Promise(n=>setTimeout(n,o))});var v,C,$t,R,_,Z,k=m(()=>{\"use strict\";ie();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}},$t=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())}},Z=class o{constructor(n,e){this.refConfig=n;this.component=e;r(this,\"myop\",!0);r(this,\"__nonProxied\");this.__nonProxied=V(M({},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 Dn,Wt,ae,Bn=m(()=>{\"use strict\";k();Dn=\"ClickReplayMessage\",Wt=class extends _{constructor(e,t){super(t);this.ref=e;r(this,\"replyMessageKey\",Dn);r(this,\"messageType\",\"BindClickMessage\");r(this,\"cleanable\",!0)}},ae=class extends R{constructor(){super(...arguments);r(this,\"messageType\",Dn)}}});var Nt,Ln=m(()=>{\"use strict\";k();Nt=class extends C{constructor(e,t){super();this.ref=e;r(this,\"messageType\",\"ChangeTextMessage\");this.content=t}}});var Pn,$s,Ws,On,D,pe,Ut=m(()=>{\"use strict\";k();Pn=\"ExecuteScriptReplyMessage\",$s=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,Ws=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,On=o=>{let n=o.match($s);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\",Pn);r(this,\"messageType\",\"ExecuteScriptMessage\");r(this,\"script\",\"\");this.script=e.toString(),this.content=e.toString(),this.content=On(this.content)}};r(D,\"replierKey\",\"send\"),r(D,\"completeStreamKey\",\"completeStream\");pe=class extends R{constructor(e,t){super(e);this.replayToHandler=e;this.content=t;r(this,\"messageType\",Pn)}}});var j,An=m(()=>{\"use strict\";Ut();j=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=V(M({},t),{_script:e.toString()})}}});var Kn,qt,de,zn=m(()=>{\"use strict\";k();Kn=\"EventListenerCallbackMessage\",qt=class extends _{constructor(e,t,s){super(s);this.ref=e;this.type=t;this.handler=s;r(this,\"replyMessageKey\",Kn);r(this,\"messageType\",\"AddEventListenerMessage\");r(this,\"cleanable\",!0);r(this,\"serializableSkeleton\",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},de=class extends R{constructor(e,t){super(e);this.replayToHandler=e;this.e=t;r(this,\"messageType\",Kn);this.content={e:t}}}});var Vt,Fn=m(()=>{\"use strict\";k();Vt=class extends C{constructor(e,t,s){super();this.ref=e;this.name=t;this.value=s;r(this,\"messageType\",\"SetAttributeMessage\")}}});var $n,jt,ce,Gt=m(()=>{\"use strict\";k();$n=\"ElementValueReplayMessage\",jt=class extends _{constructor(e,t){super(t);this.ref=e;r(this,\"replyMessageKey\",$n);r(this,\"messageType\",\"GetElementValueMessage\")}},ce=class extends R{constructor(e){super();this.content=e;r(this,\"messageType\",$n)}}});var Yt,Wn=m(()=>{\"use strict\";k();Yt=class extends C{constructor(e,t){super();this.ref=e;r(this,\"messageType\",\"SetInnerHtml\");this.content=t}}});var Ce,He,me,Nn=m(()=>{\"use strict\";k();Ce=class extends C{constructor(e){super();r(this,\"messageType\",\"InitMessage\");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},He=class extends Ce{constructor(){super(...arguments);r(this,\"messageType\",\"InitResponse\")}},me=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"InitRequest\")}}});var Un,De,G,Qe=m(()=>{\"use strict\";k();Un=\"RefComponentCreatedMessage\",De=class extends _{constructor(e,t,s,i){super(i);this.refConfig=e;this.nestedComponentConfig=t;this.options=s;r(this,\"replyMessageKey\",Un);r(this,\"messageType\",\"CreateRefComponentMessage\")}},G=class extends R{constructor(e,t,s){super(e);this.replayToHandler=e;this.nestedRefs=t;this.failed=s;r(this,\"messageType\",Un)}}});var Be,Qt=m(()=>{\"use strict\";k();Be=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 qn,Jt,le,Vn=m(()=>{\"use strict\";k();qn=\"DetectedMyopRefsMessage\",Jt=class extends _{constructor(){super(...arguments);r(this,\"messageType\",\"DetectMyopRefsMessage\");r(this,\"replyMessageKey\",qn)}},le=class extends R{constructor(e,t){super(e);this.replayToHandler=e;r(this,\"messageType\",qn);this.content=t}isTypeof(e){return e.messageType===this.messageType}}});var jn,Xt,Le,Gn=m(()=>{\"use strict\";k();jn=\"GetAttributeReplayMessage\",Xt=class extends _{constructor(e,t,s){super(s);this.ref=e;this.name=t;r(this,\"replyMessageKey\",jn);r(this,\"messageType\",\"GetAttributeMessage\")}},Le=class extends R{constructor(e){super();this.content=e;r(this,\"messageType\",jn)}}});var z,Yn=m(()=>{\"use strict\";k();z=class extends C{constructor(e){super();this.method=e;r(this,\"messageType\",\"ExecuteComponentMethod\")}}});var Zt,Pe,Qn=m(()=>{\"use strict\";k();Zt=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"SetMutationObserverMessage\")}},Pe=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"MutationObserverMessage\")}}});var Jn,Oe,Ae,Xn=m(()=>{\"use strict\";k();Jn=\"CleanupReplayMessage\",Oe=class extends _{constructor(e,t){super(t);this.cleanupForMessageId=e;r(this,\"replyMessageKey\",Jn);r(this,\"messageType\",\"CleanupMessage\")}},Ae=class extends R{constructor(e){super();this.customCleanup=e;r(this,\"messageType\",Jn)}}});var Ke,Zn=m(()=>{\"use strict\";k();Ke=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"DisposeMessage\")}}});var en,ze,eo=m(()=>{\"use strict\";k();en=class extends C{constructor(){super(...arguments);r(this,\"cleanable\",!0);r(this,\"messageType\",\"SetResizeObserverMessage\")}},ze=class extends C{constructor(){super(...arguments);r(this,\"messageType\",\"ResizeObserverMessage\")}}});var xe={};se(xe,{AddEventListenerMessage:()=>qt,BaseMyopMessage:()=>C,BindClickMessage:()=>Wt,ChangeTextMessage:()=>Nt,CleanupMessage:()=>Oe,CleanupReplayMessage:()=>Ae,ClickReplayMessage:()=>ae,CreateRefComponentMessage:()=>De,CustomRefMessage:()=>j,DetectMyopRefsMessage:()=>Jt,DetectedMyopRefsMessage:()=>le,DisposeMessage:()=>Ke,ElementValueReplayMessage:()=>ce,EnvelopedMessage:()=>Be,EventListenerCallbackMessage:()=>de,ExecuteComponentMethod:()=>z,ExecuteScriptMessage:()=>D,ExecuteScriptReplyMessage:()=>pe,GetAttributeMessage:()=>Xt,GetAttributeReplayMessage:()=>Le,GetElementValueMessage:()=>jt,InitMessage:()=>Ce,InitRequest:()=>me,InitResponse:()=>He,MessageDirection:()=>v,MutationObserverMessage:()=>Pe,MyopBindMessage:()=>_,MyopBindReplayMessage:()=>R,MyopElementMessage:()=>$t,Ref:()=>Z,RefComponentCreatedMessage:()=>G,ResizeObserverMessage:()=>ze,SetAttributeMessage:()=>Vt,SetInnerHtml:()=>Yt,SetMutationObserverMessage:()=>Zt,SetResizeObserverMessage:()=>en,stripFunction:()=>On});var b=m(()=>{\"use strict\";k();Bn();Ln();Ut();An();zn();Fn();Gt();Wn();Nn();Qe();Qt();Vn();Gt();Gn();Yn();Qn();Xn();Zn();eo()});var N,Fe=m(()=>{\"use strict\";I();b();$e();N=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 Oe(n.id,t=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log(\"disposing component\",this.id),this.send(new Ke);let n=this.messageHandlers.onDispose;n&&n.forEach(e=>{e(null)}),this.messageHandlers={},this.id+=\"_disposed\",this.isInitiated=!1}}});var be,to=m(()=>{\"use strict\";be=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 no,x,Je,oo=m(()=>{\"use strict\";no=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}},Je=class extends x{constructor(e,t){super(e);this.messageToHost=e;this.context=t}}});var tn,we,so=m(()=>{\"use strict\";I();w();b();tn=class{constructor(n,e){this.id=n;this.context=e;r(this,\"send\",n=>{})}},we=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 tn(s),this.messageToHost(new He(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 Ae(!!a);p.destination=t.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],no(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 Y,fe,Te,Se,ue,Xe,Ee,w=m(()=>{\"use strict\";to();oo();so();Y={IframeLoader:\"IframeLoader\",WebComponentLoader:\"WebComponentLoader\",HTMLLoader:\"HTMLLoader\",MinimizedLoader:\"MinimizedLoader\"},fe={open:\"open\",closed:\"closed\",none:\"none\",localFrame:\"localFrame\"},Te={message:\"message\",code:\"code\"},Se=class{};r(Se,\"code\",\"code\"),r(Se,\"component\",\"component\");ue={Segmented:\"Segmented\",Dedicated:\"Dedicated\",Default:\"Default\"},Xe={Segment:\"Segment\",Promo:\"Promo\",AB:\"AB\"},Ee=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 nn,Ns,on,A,ge=m(()=>{\"use strict\";nn=o=>o!==Object(o),Ns=o=>typeof o==\"function\",on=o=>{if(nn(o))return!0;if(Ns(o)||Object.getPrototypeOf(o))return!1;for(let n in o){let e=o[n];if(typeof e==\"object\"){if(!on(e))return!1}else{if(nn(e))continue;return!1}}return!0},A=(o,n={},e=!0,t=new WeakMap)=>{if(nn(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]=A(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]=A(o[i],!0,e,t)):typeof a==\"object\"&&(s[i]=A(o[i],a,e,t)))}return s}return{}}});var ro,io=m(()=>{\"use strict\";ro={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 We,ao=m(()=>{\"use strict\";Fe();b();Qt();We=class extends N{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 Be(this.id,e)),e.handler=t,s});r(this,\"dispose\",()=>{this.isInitiated&&this.send(new z(\"dispose\")),super.dispose()})}hide(){this.send(new z(\"hide\"))}show(){this.send(new z(\"show\"))}inspect(){return this.send(new z(\"inspect\"))}setHeightBasedOnDocumentElement(){this.send(new z(\"setHeightBasedOnDocumentElement\"))}setHeightBasedOnScrollHeight(){this.send(new z(\"setHeightBasedOnScrollHeight\"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var ye,sn=m(()=>{\"use strict\";Fe();Ne();ye=class extends N{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=ve(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 Us,ve,po,co,mo,qs,rn,an,Ne=m(()=>{\"use strict\";b();b();w();ge();io();ao();sn();Us=(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},ve=(o,n,e,t,s,i)=>{let a=Us(\"\".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)}},po=(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),co=(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.\"))},mo=(o,n,e)=>{let t=n.reduce((i,a)=>V(M({},i),{[a.name]:M({},a)}),{}),s={get:(i,a)=>{let p=t[a];if(po(p,a,o))return!1;if(p.behavior.type===Te.code){if(o instanceof ye)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===Y.HTMLLoader&&e.loader.shadowRootMode===fe.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return co(p,a,o),!1}return p.mode===\"output\"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(Z.create(p.behavior.ref)),c.push(u=>{d(u)}),p.behavior.params&&c.push(...p.behavior.params);let l=xe[p.behavior.message];o.send(new l(...c))}):null},set:(i,a,p)=>{let d=t[a];if(po(d,a,o))return!1;if(d.behavior.type===Te.code){if(o instanceof ye){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===Y.HTMLLoader&&e.loader.shadowRootMode===fe.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(h=>{o.markedForDisposed||p(h.action,h.payload)})}return!0}return co(d,a,o),!1}else if(d.mode===\"input\")if(d.behavior.type===\"message\"){let c=[];d.behavior.ref&&c.push(Z.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let l=xe[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},qs=(o,n)=>new Proxy(o,{get(e,t){return e[t]?e[t]:(...i)=>new Promise(a=>{i.forEach(p=>{on(p)||ro.notSerializableRefCall(t,p)}),n.send(new j(({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 j(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:s,propName:t},i=>{})),!0}}),rn=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 We(n.type,s,t);e.push(p),await s.initiated();let d=setTimeout(()=>{a(\"timeout\")},5e3);s.send(new De(o.refConfig,n,V(M({},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(h=>h.type.id===u.componentDefinitionId).type,y=new We(g,p);y.setInitiated(),p.refs[u.refName]=y,e.push(y)});try{await an(p,n,e,!0),s.setHeightBasedOnScrollHeight&&s.setHeightBasedOnScrollHeight(),i(p)}catch(u){a(u)}}))})},an=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==Se.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=Z.create(\"\",i,o);try{let g=await rn(u,l,e);o.refs[i.name]=g,a()}catch(g){p(g)}}else try{let c=Z.create(\"\",i,o);o.refs[i.name]=qs(c,o),a()}catch(c){}}));try{await Promise.all(s)}catch(i){throw i}}});var Re,pn=m(()=>{\"use strict\";Fe();b();Ne();I();Re=class extends N{constructor(e,t,s,i,a){super(e,s,a);this.componentConfig=e;this.container=s;this.IframeElement=i;r(this,\"sizeMeta\");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 Mn,In,Cn,xn,bn,wn,Sn;let t=this.IframeElement,s=t.contentDocument;if(!s)return console.warn(\"[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible\"),()=>{};let i=(H,K,Me)=>K!==void 0&&H<K?K:Me!==void 0&&H>Me?Me:H,a=H=>{if(H===void 0)return;if(typeof H==\"number\")return H;let K=parseFloat(H);return isNaN(K)?void 0:K},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=(Mn=e==null?void 0:e.loaderMinHeight)!=null?Mn:50,g=((In=this.sizeMeta)==null?void 0:In.width)===\"100%\"?\"100%\":void 0,y=((Cn=this.sizeMeta)==null?void 0:Cn.height)===\"100%\"?\"100%\":void 0,h=(bn=(xn=e==null?void 0:e.explicitWidth)!=null?xn:g)!=null?bn:\"100%\",Q=(wn=e==null?void 0:e.explicitHeight)!=null?wn:y,qe=h!==void 0,he=Q!==void 0,J=this.container.getBoundingClientRect(),L=J.width===0,O=J.height===0||J.height===u,q=(e!=null&&e.forceAutoSize||L)&&!qe,X=(e!=null&&e.forceAutoSize||O)&&!he;if(!q&&!X){let H=typeof h==\"number\"?h:void 0,K=typeof Q==\"number\"?Q:void 0;return(H!==void 0||K!==void 0)&&((Sn=e==null?void 0:e.onSizeChange)==null||Sn.call(e,{width:H,height:K,autoSizingWidth:!1,autoSizingHeight:!1})),()=>{}}let Pt=()=>{var K;let H=t.contentDocument;if(H){X&&(t.style.height=\"0px\"),q&&(t.style.width=\"0px\");let Me=Math.ceil(H.documentElement.scrollWidth),En=Math.ceil(H.documentElement.scrollHeight),Tn=i(Me,p,d),vn=i(En,c,l);q&&(t.style.width=\"\".concat(Tn,\"px\")),X&&(t.style.height=\"\".concat(vn,\"px\"));let ks=q&&d!==void 0&&Me>d,Hs=X&&l!==void 0&&En>l;H.documentElement.style.overflowX=ks?\"auto\":\"\",H.documentElement.style.overflowY=Hs?\"auto\":\"\",(K=e==null?void 0:e.onSizeChange)==null||K.call(e,{width:Tn,height:vn,autoSizingWidth:q,autoSizingHeight:X})}};Pt();let Ot=new ResizeObserver(Pt);Ot.observe(s.body),Ot.observe(s.documentElement);let hn=new MutationObserver(Pt);return hn.observe(s.body,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),()=>{Ot.disconnect(),hn.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=M({},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=ve(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 ee,Ze=m(()=>{\"use strict\";ee=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 Vs,et,lo=m(()=>{\"use strict\";pn();Ze();ie();w();Vs=(o,n,e)=>{let t=new URL(o);return t.searchParams.append(n,e),t.toString()},et=class extends ee{constructor(){super(...arguments);r(this,\"type\",Y.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=Vs(u,\"_myop-comp\",d)),a.src=u,s.querySelector('[id^=\"myop-comp-\"]')||(s.innerHTML=\"\"),a=this.appendChild(s,a,i)}return new Re(e,t,s,a,i)})}}});var tt,dn=m(()=>{\"use strict\";tt={webcomponent_message_key:\"myop_webcomponent_message\"}});var _e,cn=m(()=>{\"use strict\";dn();Fe();Ne();_e=class extends N{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=M({},e),s=super.send(t),i=new CustomEvent(tt.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=ve(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 mn,nt,fo=m(()=>{\"use strict\";cn();Ze();ie();w();mn={},nt=class extends ee{constructor(){super(...arguments);r(this,\"type\",Y.WebComponentLoader);r(this,\"load\",async(e,t,s,i)=>{let a=t.loader;mn[a.url]?console.log(\"Module alreday loaded or in loading process\"):mn[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 mn[a.url],await Hn(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 _e(e,t,s,d,i)})}}});var T,U=m(()=>{\"use strict\";w();T=class extends Je{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(V(M({},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,te=m(()=>{\"use strict\";B={id:\"myop-id\"}});var S,uo,P=m(()=>{\"use strict\";te();S=(o,n)=>n.querySelectorAll(\"[\".concat(B.id,\"='\").concat(o.refConfig.selector,\"']\")),uo=(o,n)=>{let e=S(o,n);return e.length?e.item(0):null}});var ot,go=m(()=>{\"use strict\";I();b();U();P();ot=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 ae(e.handlerUniqueId))};p.addEventListener(\"click\",d),a.push(()=>{p.removeEventListener(\"click\",d)})}),()=>{a.forEach(p=>p())}})}}});var st,yo=m(()=>{\"use strict\";I();U();P();st=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 rt,ho=m(()=>{\"use strict\";w();rt=class extends Ee{constructor(e,t){super(e,t);this.container=e;this.shadowRoot=t}}});var it,Mo=m(()=>{\"use strict\";w();te();U();b();I();it=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 be(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new le(e.handlerUniqueId,i))});r(this,\"messageType\",f.DetectMyopRefsMessage)}}});var at,Io=m(()=>{\"use strict\";I();U();P();at=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 pt,Co=m(()=>{\"use strict\";I();b();U();P();ge();pt=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 de(e.handlerUniqueId,A(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var dt,xo=m(()=>{\"use strict\";I();te();$e();Qe();U();dt=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 G(e.handlerUniqueId,u))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new G(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var ct,ln=m(()=>{\"use strict\";ge();ct=(o,n,e)=>{let t=o.scriptInputs?o.scriptInputs:{};t.makeSerializable=A,t.send=n,t.rootRef=e,t.__scriptInputs=t;let i=new Function(\"return (\".concat(o.script,\")(...arguments)\"))(t);n(i)}});var mt,bo=m(()=>{\"use strict\";I();b();U();ln();mt=class extends T{constructor(){super(...arguments);r(this,\"messageType\",f.ExecuteScriptMessage);r(this,\"innerExecutor\",(e,t,s)=>{ct(e,a=>{s(new pe(e.handlerUniqueId,a))},t)})}}});var wo,lt,So=m(()=>{\"use strict\";I();b();U();P();te();ge();wo=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:wo(i),required:i.required,validity:A(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},lt=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 ce(wo(a)),e)})})}}});var ft,Eo=m(()=>{\"use strict\";I();U();P();ft=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 To={};se(To,{WebComponentSDK:()=>ke});var ke,fn=m(()=>{\"use strict\";w();I();dn();go();yo();ho();Mo();re();b();Io();Co();xo();bo();So();Eo();ke=class extends we{constructor(){super(...arguments);r(this,\"alwaysPassEnvelopesToHost\",!0);r(this,\"connectedCallback\",(e,t)=>{e.addEventListener(tt.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 rt(e,t)}}}),setTimeout(()=>{this.messageToHost(new me)},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 st(this.messageToHost,this.components),new ft(this.messageToHost,this.components),new ot(this.messageToHost,this.components),new it(this.messageToHost,this.components),new at(this.messageToHost,this.components),new pt(this.messageToHost,this.components),new mt(this.messageToHost,this.components),new lt(this.messageToHost,this.components),new dt(this.messageToHost,this.components)]);r(this,\"init\",()=>{})}};W(\"WebComponentSDK\",ke)});var vo=m(()=>{\"use strict\";fn()});var Ro,_o=m(()=>{\"use strict\";Ro=\"\"});function Ys(o,n){return class extends HTMLElement{connectedCallback(){let e=n===fe.open?\"open\":\"closed\",t=this.attachShadow({mode:e});Bo().then(s=>{s.connectedCallback(this,t),t.innerHTML=o})}}}var js,Gs,Ho,Do,ut,Bo,Qs,Js,Xs,gt,Lo=m(()=>{\"use strict\";cn();sn();Ze();ie();w();vo();pn();_o();js=\"<!-- myop-web-component -->\",Gs=\"myop-web-component\",Ho=new Set,Do=[],Bo=async()=>(ut||(ut=new ke,ut.init()),ut);Qs=(o,n,e)=>{customElements.define(o,Ys(n,e)),console.log(\"define('\".concat(o,\"') was called, web component ready to use\"))},Js=o=>o.replace(/([a-z])([A-Z])/g,\"$1-$2\").replace(/(\\d+)/g,\"-$1\").toLowerCase(),Xs=o=>(o=Js(o),o.replace(/_/g,\"-\")),gt=class extends ee{constructor(){super(...arguments);r(this,\"type\",Y.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===fe.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=null;{let O=new DOMParser().parseFromString(a.HTML,\"text/html\").querySelector('meta[name=\"myop:size\"]');if(O)try{y=JSON.parse(O.getAttribute(\"content\")||\"{}\")}catch(q){}}let h=a.HTML;if(i!=null&&i._inspection){let L=new DOMParser().parseFromString(a.HTML,\"text/html\"),O=L.getElementById(\"myop_preview\");O==null||O.removeAttribute(\"type\");let q=L.implementation.createHTMLDocument();q.body.innerHTML=\"<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>\";let X=q.body.firstChild;X&&L.head&&L.head.insertBefore(L.importNode(X,!0),L.head.firstChild),h=L.documentElement.outerHTML}else if((i==null?void 0:i.data)!==void 0){let L=new DOMParser().parseFromString(a.HTML,\"text/html\"),O=L.getElementById(\"myop_preview\");O&&(O.remove(),h=L.documentElement.outerHTML)}g.writeln(h);let Q='<script src=\"'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'\"><\\/script>'),qe=\"<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(Q).concat(qe)),(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>\",L=JSON.stringify(i.data).replace(/<\\/script/gi,\"\\\\u003c/script\"),O='<script id=\"__myop_init_data_script\">\\n (function() {\\n var data = '.concat(L,\";\\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(J+O)}g.close();let he=new Re(e,t,s,u,i);return he.sizeMeta=y,a.autoHeight&&(u.onload=()=>{he.observeSizeBasedOnDocumentElement()}),he}if(a.shadowRootMode===fe.none){let c=document.createElement(\"template\");c.innerHTML=a.HTML,d=c.content.firstElementChild,Bo().then(l=>{l.connectedCallback(d,d)})}else{let c=Xs(e.name+t.id);Do.includes(c)||(Qs(c,a.HTML,a.shadowRootMode),Do.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 _e(e,t,s,d,i)})}isMyopWebComponent(e){return e.trimStart().startsWith(js)}extractWebComponentScript(e){let i=new DOMParser().parseFromString(e,\"text/html\").getElementById(Gs);return(i==null?void 0:i.textContent)||null}executeWebComponentScript(e,t){if(Ho.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),Ho.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 ye(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 Po,Oo,Ao=m(()=>{\"use strict\";ie();b();Po=(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}))}},Oo=(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 Zs,un,Ko,zo=m(()=>{\"use strict\";Zs=(o,n)=>{let e=new RegExp(Object.keys(n).join(\"|\"),\"g\");return o.replace(e,t=>(n[t]||t).toString())},un=(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=M({},o.loader),o.loader.url=Zs(o.loader.url,n),o},Ko=o=>async n=>un(n,o)});var Fo,$o,Wo=m(()=>{\"use strict\";b();Fo=(o,n,e)=>{o.send(new j(({ref:t,_className:s})=>{t==null||t.classList.add(s)},{elementId:e,_className:n}))},$o=(o,n,e)=>{o.send(new j(({ref:t,_className:s})=>{t==null||t.classList.remove(s)},{elementId:e,_className:n}))}});var Mt,yt,It,ht,No=m(()=>{\"use strict\";ie();Mt=class Mt{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(Mt,\"create\",()=>new Mt);yt=Mt,It=class It{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(It,\"create\",()=>new It);ht=It});var er,Ct,tr,nr,ne,F,Uo,gn=m(()=>{\"use strict\";w();er=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:Te.code}},{id:\"out_auto_v2_converted\",name:\"myop_cta_handler\",type:\"any\",behavior:{type:Te.code}}],refs:[],skins:[{id:\"skin_auto_v2_converted\",name:\"auto_v2_converted\",description:\"\",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),Ct=\"__MYOP_CLOUD_REPOSITORY_MAIN__\",tr=()=>{if(typeof window<\"u\")return window[Ct];if(typeof globalThis<\"u\")return globalThis[Ct]},nr=o=>{typeof window<\"u\"&&(window[Ct]=o),typeof globalThis<\"u\"&&(globalThis[Ct]=o)},ne=class ne{constructor(n=\"https://cloud.myop.dev\"){this._baseUrl=n;r(this,\"variants\",{});r(this,\"preloadedComponents\",{});r(this,\"userFlows\",{});r(this,\"_defaultEnv\",\"production\");r(this,\"_envExplicitlySet\",!1)}static get Main(){let n=tr();return n||(ne._main||(ne._main=new ne,nr(ne._main)),ne._main)}setEnvironment(n){this._defaultEnv=n,this._envExplicitlySet=!0}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;if(!i&&s)a=s.env,p=s.preview;else{a=e||this._defaultEnv;let c=e||this._envExplicitlySet;p=t===!0?!0:t===!1?!1:!c}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 h=(await(await fetch(u)).json()).item;if(!h){l(new Error('Component \"'.concat(n,'\" not found')));return}if(!h.consume_variant||!h.consume_variant.length){l(new Error('Component \"'.concat(n,'\" has no implementation for environment \"').concat(a,'\"')));return}let Q=er(h);c(Q)}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(ne,\"_main\",null);F=ne,Uo=F});var qo,Vo=m(()=>{\"use strict\";qo=async o=>await o()});var oe,jo,Go,Yo,Qo,Jo,Xo,Zo,es,ts=m(()=>{\"use strict\";gn();oe=F.Main,jo=()=>oe,Go=(o,n,e)=>oe.isPreloaded(o,n,e),Yo=o=>oe.getPreloadedParams(o),Qo=()=>{oe=new F(\"http://localhost:9292\")},Jo=o=>{oe=new F(o)},Xo=o=>{oe=o},Zo=o=>{oe.setEnvironment(o)},es=async(o,n,e)=>Promise.allSettled(o.map(t=>oe.fetchComponentV2(t,n,e)))});var yn={};se(yn,{CloudRepository:()=>F,ComponentConfig:()=>ht,SkinConfig:()=>yt,addClass:()=>Fo,applyStylesheet:()=>Po,applyStylesheetLink:()=>Oo,changeSkinUrlByTokenizer:()=>Ko,createIframeSkinByTokenizer:()=>un,enableLocalDev:()=>Qo,exec:()=>qo,getCloudRepository:()=>jo,getPreloadedParams:()=>Yo,isPreloaded:()=>Go,preloadComponents:()=>es,removeClass:()=>$o,setCloudRepository:()=>Xo,setCloudRepositoryUrl:()=>Jo,setEnvironment:()=>Zo,v2_CloudRepository:()=>Uo});var xt=m(()=>{\"use strict\";Ao();zo();Wo();No();gn();Vo();ts()});var ns,os=m(()=>{\"use strict\";Ft();xt();w();ns=async o=>{try{let n=new URL(window.location.href),t=new URLSearchParams(n.search).get(\"myopOverride\");if(t){let[s,...i]=zt(t);switch(s){case\"component\":{let[a,p]=i,d=await F.Main.fetchComponent(a);if(d&&d.type.skins.find(l=>l.id===p))return d.instance.skinSelector={type:ue.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=zt(t),c=(await F.Main.fetchFlow(a)).components.find(l=>l.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ue.Segmented&&c.instance.resolvedExperiences){let l=c.instance.resolvedExperiences.find(u=>u.id===p);if((l==null?void 0:l.type)===Xe.Segment){let u=l,y=c.instance.skinSelector.segments.find(h=>h.segmentId===u.segment.id);if(y)return c.instance.skinSelector=y==null?void 0:y.skinSelector,c}}}break}}}finally{return null}}});var is={};se(is,{HostSDK:()=>$,hostSDK:()=>rs});var ss,$,rs,$e=m(()=>{\"use strict\";re();I();b();lo();fo();Ne();w();Ye();Lo();os();ss=\"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\",Ie);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 Ce(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===z.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 et,new nt,new gt];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 ue.Dedicated:return((i=n.skin)==null?void 0:i.id)||n.skins[0].id;case ue.Segmented:{let p=await s(n.segments,async d=>{if(d.segmentId===\"Default\")return!0;let c=e.find(y=>y.type===Xe.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 ns(n);s&&(n=s);let i=M(M({},(l=this.loaderHooks)!=null?l:{}),(u=t==null?void 0:t.hooks)!=null?u:{}),a=e;if(a.myop)if(a.component){n=M({},n),n.instance=M({},n.instance);let h=await this.runSkinSelector(n,i);if(!h)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");return(g=t==null?void 0:t.hooks)!=null&&g.afterSkinSelected&&(h=await t.hooks.afterSkinSelected(M({},h))),n.instance.skinSelector={type:ue.Dedicated,skin:h},t&&(t=M({},t),delete t.hooks),await rn(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(M({},p)));let d=this.componentsLoaders.find(h=>h.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(h=>h!==c),this.components2init=this.components2init.filter(h=>h!==c),!0)),this.components.push(c),(!t||t.connectProps!==!1)&&(c=mo(c,n.type.props,p));try{await an(c,n,this.components)}catch(h){throw h}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,M({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,M({relative:{direction:\"before\",child:s}},t))}})}};r($,\"Instance\",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:ss});if(!window.myop.hostSDK){let o=new $;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:ss}),window.myop.hostSDK=o}rs=window.myop.hostSDK;W(\"hostSDK\",rs)});var bt,as=m(()=>{\"use strict\";I();te();w();b();bt=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 be(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new le(e.handlerUniqueId,s))})}}});var wt,ps=m(()=>{\"use strict\";I();w();b();P();wt=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 ae,e)};i.addEventListener(\"click\",a);let p=()=>{i.removeEventListener(\"click\",a)};t.push(p)}),()=>{t.forEach(i=>i())}})}}});var St,ds=m(()=>{\"use strict\";I();w();P();St=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 Et,cs=m(()=>{\"use strict\";I();b();w();ln();Et=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.ExecuteScriptMessage);r(this,\"executor\",e=>{ct(e,s=>{this.messageToHost(new pe(e.handlerUniqueId,s))},new Ee(document.documentElement))})}}});var Tt,ms=m(()=>{\"use strict\";I();w();b();ge();P();Tt=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 de(e.handlerUniqueId,A(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),s.push(()=>{i.removeEventListener(e.type,a)})}),()=>{s.forEach(i=>{i()})}})}}});var vt,ls=m(()=>{\"use strict\";I();w();P();vt=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 Rt,fs=m(()=>{\"use strict\";I();te();w();$e();Qe();Rt=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 G(e.handlerUniqueId,p))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new G(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var us,gs=m(()=>{\"use strict\";us=(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 _t,ys=m(()=>{\"use strict\";I();b();w();gs();_t=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.SetMutationObserverMessage);r(this,\"executor\",e=>{e.source&&us(document.body,()=>{this.messageToHost(new Pe)})})}}});var hs,kt,Ms=m(()=>{\"use strict\";I();te();w();b();ge();P();hs=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:hs(i),required:i.required,validity:A(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},kt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.GetElementValueMessage);r(this,\"executor\",e=>{S(e.ref,document).forEach(s=>{this.messageToHost(new ce(hs(s)),e)})})}}});var Ht,Is=m(()=>{\"use strict\";I();w();b();P();Ht=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.GetAttributeMessage);r(this,\"executor\",e=>{let t=uo(e.ref,document);t&&this.messageToHost(new Le(t.getAttribute(e.name)),e)})}}});var Dt,Cs=m(()=>{\"use strict\";b();I();w();Dt=class extends x{constructor(){super(...arguments);r(this,\"messageType\",f.SetResizeObserverMessage);r(this,\"executor\",e=>{let t=new ResizeObserver(s=>{this.messageToHost(new ze)});return t.observe(document.body),()=>{t.disconnect()}})}}});var Bt,xs=m(()=>{\"use strict\";I();w();P();Bt=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 bs={};se(bs,{IframeSDK:()=>Lt});var Lt,ws=m(()=>{\"use strict\";w();as();ps();ds();cs();re();ms();ls();b();fs();ys();Ms();Ye();Is();Cs();xs();Lt=class extends we{constructor(){super();r(this,\"version\",Ie);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(M({},e),\"*\")});r(this,\"supportedHandlers\",[new St(this.messageToHost),new Bt(this.messageToHost),new wt(this.messageToHost),new bt(this.messageToHost),new Et(this.messageToHost),new Tt(this.messageToHost),new vt(this.messageToHost),new kt(this.messageToHost),new _t(this.messageToHost),new Dt(this.messageToHost),new Ht(this.messageToHost),new Rt(this.messageToHost)]);r(this,\"init\",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new me)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};W(\"IframeSDK\",Lt)});var sr={};var or,Ss=m(()=>{\"use strict\";b();re();or=M({},xe);W(\"MyopMessages\",or)});var Es={};se(Es,{CloudRepository:()=>F,ComponentConfig:()=>ht,SkinConfig:()=>yt,addClass:()=>Fo,applyStylesheet:()=>Po,applyStylesheetLink:()=>Oo,changeSkinUrlByTokenizer:()=>Ko,createIframeSkinByTokenizer:()=>un,enableLocalDev:()=>Qo,exec:()=>qo,getCloudRepository:()=>jo,getPreloadedParams:()=>Yo,isPreloaded:()=>Go,preloadComponents:()=>es,removeClass:()=>$o,setCloudRepository:()=>Xo,setCloudRepositoryUrl:()=>Jo,setEnvironment:()=>Zo,v2_CloudRepository:()=>Uo});var Ts=m(()=>{\"use strict\";re();xt();xt();W(\"MyopHelpers\",yn)});var dr={};se(dr,{getHostModule:()=>vs,getIframeModule:()=>Rs,getWebcomponentModule:()=>_s});re();var kn;if(window.__federation__)console.log(\"__federation__ loaded more than once.\");else{let o=(kn=document.currentScript)==null?void 0:kn.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][Kt]);else{let t;window.__federation__[n]={},window.__federation__[n][Ge]=s=>{t&&(document.head.removeChild(t),t=null),window.__federation__[n][Kt]=s,e(s)},t=document.createElement(\"script\"),t.type=\"module\",t.src=o,t.async=!0,document.head.appendChild(t)}};Ye();console.log(\"myop root sdk - loaded\",document.location.origin);var rr=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",vs=()=>Promise.resolve().then(()=>($e(),is)),Rs=()=>Promise.resolve().then(()=>(ws(),bs)),_s=()=>Promise.resolve().then(()=>(fn(),To)),ir=()=>Promise.resolve().then(()=>(Ss(),sr)),ar=()=>Promise.resolve().then(()=>(Ts(),Es)),Ue=o=>async()=>(await o()).get(),pr={version:Ie,getHostModule:Ue(vs),getIframeModule:Ue(Rs),getWebcomponentModule:Ue(_s),getMyopMessages:Ue(ir),getMyopHelpers:Ue(ar)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:rr});window.myop.rootSDK?console.log(\"myop root host loaded more than once.\"):window.myop=M({rootSDK:pr},window.myop);return Ks(dr);})();\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,s2yEAgEhB,CAAC"}
1
+ {"version":3,"file":"componentHost.html.d.ts","sourceRoot":"","sources":["../src/componentHost.html.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,4r1EAgEhB,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 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,bn=m(()=>{"use strict";k();$t=class extends C{constructor(e,t){super();this.ref=e;r(this,"messageType","ChangeTextMessage");this.content=t}}});var wn,xs,bs,Sn,D,se,Ft=m(()=>{"use strict";k();wn="ExecuteScriptReplyMessage",xs=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,bs=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,Sn=o=>{let n=o.match(xs);if(n)return n[1]||n[3];{let e=o.match(bs);if(e)return e[1].trim()}},D=class extends _{constructor(e,t=()=>{},s){super(t);this.scriptInputs=s;r(this,"replyMessageKey",wn);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",wn)}}});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 b=m(()=>{"use strict";k();xn();bn();Ft();En();vn();Rn();Ut();kn();Hn();Ge();Vt();Ln();Ut();On();An();Kn();Fn();zn();Wn()});var z,Ke=m(()=>{"use strict";I();b();$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();w();b();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,we,xe,ce,Qe,be,w=m(()=>{"use strict";Nn();qn();Vn();j={IframeLoader:"IframeLoader",WebComponentLoader:"WebComponentLoader",HTMLLoader:"HTMLLoader",MinimizedLoader:"MinimizedLoader"},de={open:"open",closed:"closed",none:"none",localFrame:"localFrame"},we={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"},be=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,ws,Zt,O,me=m(()=>{"use strict";Xt=o=>o!==Object(o),ws=o=>typeof o=="function",Zt=o=>{if(Xt(o))return!0;if(ws(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();b();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){if(typeof this.customElement.myop_init_interface=="function")this.customElement.myop_init_interface(e);else{let t;Object.defineProperty(this.customElement,"myop_init_interface",{configurable:!0,enumerable:!0,set:s=>{t=s,typeof s=="function"&&(Object.defineProperty(this.customElement,"myop_init_interface",{configurable:!0,enumerable:!0,writable:!0,value:s}),s(e))},get:()=>t})}}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";b();b();w();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===we.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===we.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();b();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();w();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();w();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";w();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();b();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";w();ot=class extends be{constructor(e,t){super(e,t);this.container=e;this.shadowRoot=t}}});var st,ro=m(()=>{"use strict";w();J();W();b();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();b();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();b();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();b();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";w();I();sn();no();oo();so();ro();te();b();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,bo=m(()=>{"use strict";rn();en();Je();ne();w();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 wo,So,Eo=m(()=>{"use strict";ne();b();wo=(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";b();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";w();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: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}),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:()=>wo,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();w();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();b();Zn();eo();ze();w();je();bo();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();w();b();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();w();b();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 bt,No=m(()=>{"use strict";I();w();L();bt=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 wt,Uo=m(()=>{"use strict";I();b();w();pn();wt=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 be(document.documentElement))})}}});var St,qo=m(()=>{"use strict";I();w();b();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();w();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();w();$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();b();w();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();w();b();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();w();b();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";b();I();w();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();w();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";w();zo();Wo();No();Uo();te();qo();Vo();b();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 bt(this.messageToHost),new Ht(this.messageToHost),new xt(this.messageToHost),new Ct(this.messageToHost),new wt(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";b();te();As=h({},Me);F("MyopMessages",As)});var rs={};ee(rs,{CloudRepository:()=>Z,ComponentConfig:()=>gt,SkinConfig:()=>ut,addClass:()=>Ro,applyStylesheet:()=>wo,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);})();
6
+ const SDK_CONTENT = `"use strict";var MyopSDK=(()=>{var Ve=Object.defineProperty,Ds=Object.defineProperties,Bs=Object.getOwnPropertyDescriptor,Ls=Object.getOwnPropertyDescriptors,Ps=Object.getOwnPropertyNames,Rn=Object.getOwnPropertySymbols;var _n=Object.prototype.hasOwnProperty,Os=Object.prototype.propertyIsEnumerable;var At=(o,n,e)=>n in o?Ve(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e,M=(o,n)=>{for(var e in n||(n={}))_n.call(n,e)&&At(o,e,n[e]);if(Rn)for(var e of Rn(n))Os.call(n,e)&&At(o,e,n[e]);return o},V=(o,n)=>Ds(o,Ls(n));var m=(o,n)=>()=>(o&&(n=o(o=0)),n);var se=(o,n)=>{for(var e in n)Ve(o,e,{get:n[e],enumerable:!0})},As=(o,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of Ps(n))!_n.call(o,s)&&s!==e&&Ve(o,s,{get:()=>n[s],enumerable:!(t=Bs(n,s))||t.enumerable});return o};var Ks=o=>As(Ve({},"__esModule",{value:!0}),o);var r=(o,n,e)=>At(o,typeof n!="symbol"?n+"":n,e);var je,Ge,Kt,W,re=m(()=>{"use strict";je="__federation__",Ge="onLoad",Kt="moduleInstance",W=(o,n)=>{window[je]&&window[je][o]&&window[je][o][Ge]&&window[je][o][Ge]({[o]:n})}});var Ie,Ye=m(()=>{Ie="0.3.19"});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,zs,Fs,zt,Ft=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)),zs=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("-")},Fs=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))},zt=o=>{let n=Fs(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(zs(n.slice(t,t+16)));return e}});var Hn,ie=m(()=>{"use strict";Ft();Hn=o=>new Promise(n=>setTimeout(n,o))});var v,C,$t,R,_,Z,k=m(()=>{"use strict";ie();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}},$t=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())}},Z=class o{constructor(n,e){this.refConfig=n;this.component=e;r(this,"myop",!0);r(this,"__nonProxied");this.__nonProxied=V(M({},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 Dn,Wt,ae,Bn=m(()=>{"use strict";k();Dn="ClickReplayMessage",Wt=class extends _{constructor(e,t){super(t);this.ref=e;r(this,"replyMessageKey",Dn);r(this,"messageType","BindClickMessage");r(this,"cleanable",!0)}},ae=class extends R{constructor(){super(...arguments);r(this,"messageType",Dn)}}});var Nt,Ln=m(()=>{"use strict";k();Nt=class extends C{constructor(e,t){super();this.ref=e;r(this,"messageType","ChangeTextMessage");this.content=t}}});var Pn,$s,Ws,On,D,pe,Ut=m(()=>{"use strict";k();Pn="ExecuteScriptReplyMessage",$s=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,Ws=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,On=o=>{let n=o.match($s);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",Pn);r(this,"messageType","ExecuteScriptMessage");r(this,"script","");this.script=e.toString(),this.content=e.toString(),this.content=On(this.content)}};r(D,"replierKey","send"),r(D,"completeStreamKey","completeStream");pe=class extends R{constructor(e,t){super(e);this.replayToHandler=e;this.content=t;r(this,"messageType",Pn)}}});var j,An=m(()=>{"use strict";Ut();j=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=V(M({},t),{_script:e.toString()})}}});var Kn,qt,de,zn=m(()=>{"use strict";k();Kn="EventListenerCallbackMessage",qt=class extends _{constructor(e,t,s){super(s);this.ref=e;this.type=t;this.handler=s;r(this,"replyMessageKey",Kn);r(this,"messageType","AddEventListenerMessage");r(this,"cleanable",!0);r(this,"serializableSkeleton",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},de=class extends R{constructor(e,t){super(e);this.replayToHandler=e;this.e=t;r(this,"messageType",Kn);this.content={e:t}}}});var Vt,Fn=m(()=>{"use strict";k();Vt=class extends C{constructor(e,t,s){super();this.ref=e;this.name=t;this.value=s;r(this,"messageType","SetAttributeMessage")}}});var $n,jt,ce,Gt=m(()=>{"use strict";k();$n="ElementValueReplayMessage",jt=class extends _{constructor(e,t){super(t);this.ref=e;r(this,"replyMessageKey",$n);r(this,"messageType","GetElementValueMessage")}},ce=class extends R{constructor(e){super();this.content=e;r(this,"messageType",$n)}}});var Yt,Wn=m(()=>{"use strict";k();Yt=class extends C{constructor(e,t){super();this.ref=e;r(this,"messageType","SetInnerHtml");this.content=t}}});var Ce,He,me,Nn=m(()=>{"use strict";k();Ce=class extends C{constructor(e){super();r(this,"messageType","InitMessage");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},He=class extends Ce{constructor(){super(...arguments);r(this,"messageType","InitResponse")}},me=class extends C{constructor(){super(...arguments);r(this,"messageType","InitRequest")}}});var Un,De,G,Qe=m(()=>{"use strict";k();Un="RefComponentCreatedMessage",De=class extends _{constructor(e,t,s,i){super(i);this.refConfig=e;this.nestedComponentConfig=t;this.options=s;r(this,"replyMessageKey",Un);r(this,"messageType","CreateRefComponentMessage")}},G=class extends R{constructor(e,t,s){super(e);this.replayToHandler=e;this.nestedRefs=t;this.failed=s;r(this,"messageType",Un)}}});var Be,Qt=m(()=>{"use strict";k();Be=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 qn,Jt,le,Vn=m(()=>{"use strict";k();qn="DetectedMyopRefsMessage",Jt=class extends _{constructor(){super(...arguments);r(this,"messageType","DetectMyopRefsMessage");r(this,"replyMessageKey",qn)}},le=class extends R{constructor(e,t){super(e);this.replayToHandler=e;r(this,"messageType",qn);this.content=t}isTypeof(e){return e.messageType===this.messageType}}});var jn,Xt,Le,Gn=m(()=>{"use strict";k();jn="GetAttributeReplayMessage",Xt=class extends _{constructor(e,t,s){super(s);this.ref=e;this.name=t;r(this,"replyMessageKey",jn);r(this,"messageType","GetAttributeMessage")}},Le=class extends R{constructor(e){super();this.content=e;r(this,"messageType",jn)}}});var z,Yn=m(()=>{"use strict";k();z=class extends C{constructor(e){super();this.method=e;r(this,"messageType","ExecuteComponentMethod")}}});var Zt,Pe,Qn=m(()=>{"use strict";k();Zt=class extends C{constructor(){super(...arguments);r(this,"messageType","SetMutationObserverMessage")}},Pe=class extends C{constructor(){super(...arguments);r(this,"messageType","MutationObserverMessage")}}});var Jn,Oe,Ae,Xn=m(()=>{"use strict";k();Jn="CleanupReplayMessage",Oe=class extends _{constructor(e,t){super(t);this.cleanupForMessageId=e;r(this,"replyMessageKey",Jn);r(this,"messageType","CleanupMessage")}},Ae=class extends R{constructor(e){super();this.customCleanup=e;r(this,"messageType",Jn)}}});var Ke,Zn=m(()=>{"use strict";k();Ke=class extends C{constructor(){super(...arguments);r(this,"messageType","DisposeMessage")}}});var en,ze,eo=m(()=>{"use strict";k();en=class extends C{constructor(){super(...arguments);r(this,"cleanable",!0);r(this,"messageType","SetResizeObserverMessage")}},ze=class extends C{constructor(){super(...arguments);r(this,"messageType","ResizeObserverMessage")}}});var xe={};se(xe,{AddEventListenerMessage:()=>qt,BaseMyopMessage:()=>C,BindClickMessage:()=>Wt,ChangeTextMessage:()=>Nt,CleanupMessage:()=>Oe,CleanupReplayMessage:()=>Ae,ClickReplayMessage:()=>ae,CreateRefComponentMessage:()=>De,CustomRefMessage:()=>j,DetectMyopRefsMessage:()=>Jt,DetectedMyopRefsMessage:()=>le,DisposeMessage:()=>Ke,ElementValueReplayMessage:()=>ce,EnvelopedMessage:()=>Be,EventListenerCallbackMessage:()=>de,ExecuteComponentMethod:()=>z,ExecuteScriptMessage:()=>D,ExecuteScriptReplyMessage:()=>pe,GetAttributeMessage:()=>Xt,GetAttributeReplayMessage:()=>Le,GetElementValueMessage:()=>jt,InitMessage:()=>Ce,InitRequest:()=>me,InitResponse:()=>He,MessageDirection:()=>v,MutationObserverMessage:()=>Pe,MyopBindMessage:()=>_,MyopBindReplayMessage:()=>R,MyopElementMessage:()=>$t,Ref:()=>Z,RefComponentCreatedMessage:()=>G,ResizeObserverMessage:()=>ze,SetAttributeMessage:()=>Vt,SetInnerHtml:()=>Yt,SetMutationObserverMessage:()=>Zt,SetResizeObserverMessage:()=>en,stripFunction:()=>On});var b=m(()=>{"use strict";k();Bn();Ln();Ut();An();zn();Fn();Gt();Wn();Nn();Qe();Qt();Vn();Gt();Gn();Yn();Qn();Xn();Zn();eo()});var N,Fe=m(()=>{"use strict";I();b();$e();N=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 Oe(n.id,t=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log("disposing component",this.id),this.send(new Ke);let n=this.messageHandlers.onDispose;n&&n.forEach(e=>{e(null)}),this.messageHandlers={},this.id+="_disposed",this.isInitiated=!1}}});var be,to=m(()=>{"use strict";be=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 no,x,Je,oo=m(()=>{"use strict";no=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}},Je=class extends x{constructor(e,t){super(e);this.messageToHost=e;this.context=t}}});var tn,we,so=m(()=>{"use strict";I();w();b();tn=class{constructor(n,e){this.id=n;this.context=e;r(this,"send",n=>{})}},we=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 tn(s),this.messageToHost(new He(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 Ae(!!a);p.destination=t.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],no(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 Y,fe,Te,Se,ue,Xe,Ee,w=m(()=>{"use strict";to();oo();so();Y={IframeLoader:"IframeLoader",WebComponentLoader:"WebComponentLoader",HTMLLoader:"HTMLLoader",MinimizedLoader:"MinimizedLoader"},fe={open:"open",closed:"closed",none:"none",localFrame:"localFrame"},Te={message:"message",code:"code"},Se=class{};r(Se,"code","code"),r(Se,"component","component");ue={Segmented:"Segmented",Dedicated:"Dedicated",Default:"Default"},Xe={Segment:"Segment",Promo:"Promo",AB:"AB"},Ee=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 nn,Ns,on,A,ge=m(()=>{"use strict";nn=o=>o!==Object(o),Ns=o=>typeof o=="function",on=o=>{if(nn(o))return!0;if(Ns(o)||Object.getPrototypeOf(o))return!1;for(let n in o){let e=o[n];if(typeof e=="object"){if(!on(e))return!1}else{if(nn(e))continue;return!1}}return!0},A=(o,n={},e=!0,t=new WeakMap)=>{if(nn(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]=A(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]=A(o[i],!0,e,t)):typeof a=="object"&&(s[i]=A(o[i],a,e,t)))}return s}return{}}});var ro,io=m(()=>{"use strict";ro={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 We,ao=m(()=>{"use strict";Fe();b();Qt();We=class extends N{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 Be(this.id,e)),e.handler=t,s});r(this,"dispose",()=>{this.isInitiated&&this.send(new z("dispose")),super.dispose()})}hide(){this.send(new z("hide"))}show(){this.send(new z("show"))}inspect(){return this.send(new z("inspect"))}setHeightBasedOnDocumentElement(){this.send(new z("setHeightBasedOnDocumentElement"))}setHeightBasedOnScrollHeight(){this.send(new z("setHeightBasedOnScrollHeight"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var ye,sn=m(()=>{"use strict";Fe();Ne();ye=class extends N{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=ve(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 Us,ve,po,co,mo,qs,rn,an,Ne=m(()=>{"use strict";b();b();w();ge();io();ao();sn();Us=(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},ve=(o,n,e,t,s,i)=>{let a=Us("".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)}},po=(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),co=(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."))},mo=(o,n,e)=>{let t=n.reduce((i,a)=>V(M({},i),{[a.name]:M({},a)}),{}),s={get:(i,a)=>{let p=t[a];if(po(p,a,o))return!1;if(p.behavior.type===Te.code){if(o instanceof ye)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===Y.HTMLLoader&&e.loader.shadowRootMode===fe.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return co(p,a,o),!1}return p.mode==="output"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(Z.create(p.behavior.ref)),c.push(u=>{d(u)}),p.behavior.params&&c.push(...p.behavior.params);let l=xe[p.behavior.message];o.send(new l(...c))}):null},set:(i,a,p)=>{let d=t[a];if(po(d,a,o))return!1;if(d.behavior.type===Te.code){if(o instanceof ye){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===Y.HTMLLoader&&e.loader.shadowRootMode===fe.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(h=>{o.markedForDisposed||p(h.action,h.payload)})}return!0}return co(d,a,o),!1}else if(d.mode==="input")if(d.behavior.type==="message"){let c=[];d.behavior.ref&&c.push(Z.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let l=xe[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},qs=(o,n)=>new Proxy(o,{get(e,t){return e[t]?e[t]:(...i)=>new Promise(a=>{i.forEach(p=>{on(p)||ro.notSerializableRefCall(t,p)}),n.send(new j(({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 j(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:s,propName:t},i=>{})),!0}}),rn=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 We(n.type,s,t);e.push(p),await s.initiated();let d=setTimeout(()=>{a("timeout")},5e3);s.send(new De(o.refConfig,n,V(M({},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(h=>h.type.id===u.componentDefinitionId).type,y=new We(g,p);y.setInitiated(),p.refs[u.refName]=y,e.push(y)});try{await an(p,n,e,!0),s.setHeightBasedOnScrollHeight&&s.setHeightBasedOnScrollHeight(),i(p)}catch(u){a(u)}}))})},an=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==Se.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=Z.create("",i,o);try{let g=await rn(u,l,e);o.refs[i.name]=g,a()}catch(g){p(g)}}else try{let c=Z.create("",i,o);o.refs[i.name]=qs(c,o),a()}catch(c){}}));try{await Promise.all(s)}catch(i){throw i}}});var Re,pn=m(()=>{"use strict";Fe();b();Ne();I();Re=class extends N{constructor(e,t,s,i,a){super(e,s,a);this.componentConfig=e;this.container=s;this.IframeElement=i;r(this,"sizeMeta");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 Mn,In,Cn,xn,bn,wn,Sn;let t=this.IframeElement,s=t.contentDocument;if(!s)return console.warn("[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible"),()=>{};let i=(H,K,Me)=>K!==void 0&&H<K?K:Me!==void 0&&H>Me?Me:H,a=H=>{if(H===void 0)return;if(typeof H=="number")return H;let K=parseFloat(H);return isNaN(K)?void 0:K},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=(Mn=e==null?void 0:e.loaderMinHeight)!=null?Mn:50,g=((In=this.sizeMeta)==null?void 0:In.width)==="100%"?"100%":void 0,y=((Cn=this.sizeMeta)==null?void 0:Cn.height)==="100%"?"100%":void 0,h=(bn=(xn=e==null?void 0:e.explicitWidth)!=null?xn:g)!=null?bn:"100%",Q=(wn=e==null?void 0:e.explicitHeight)!=null?wn:y,qe=h!==void 0,he=Q!==void 0,J=this.container.getBoundingClientRect(),L=J.width===0,O=J.height===0||J.height===u,q=(e!=null&&e.forceAutoSize||L)&&!qe,X=(e!=null&&e.forceAutoSize||O)&&!he;if(!q&&!X){let H=typeof h=="number"?h:void 0,K=typeof Q=="number"?Q:void 0;return(H!==void 0||K!==void 0)&&((Sn=e==null?void 0:e.onSizeChange)==null||Sn.call(e,{width:H,height:K,autoSizingWidth:!1,autoSizingHeight:!1})),()=>{}}let Pt=()=>{var K;let H=t.contentDocument;if(H){X&&(t.style.height="0px"),q&&(t.style.width="0px");let Me=Math.ceil(H.documentElement.scrollWidth),En=Math.ceil(H.documentElement.scrollHeight),Tn=i(Me,p,d),vn=i(En,c,l);q&&(t.style.width="".concat(Tn,"px")),X&&(t.style.height="".concat(vn,"px"));let ks=q&&d!==void 0&&Me>d,Hs=X&&l!==void 0&&En>l;H.documentElement.style.overflowX=ks?"auto":"",H.documentElement.style.overflowY=Hs?"auto":"",(K=e==null?void 0:e.onSizeChange)==null||K.call(e,{width:Tn,height:vn,autoSizingWidth:q,autoSizingHeight:X})}};Pt();let Ot=new ResizeObserver(Pt);Ot.observe(s.body),Ot.observe(s.documentElement);let hn=new MutationObserver(Pt);return hn.observe(s.body,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),()=>{Ot.disconnect(),hn.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=M({},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=ve(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 ee,Ze=m(()=>{"use strict";ee=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 Vs,et,lo=m(()=>{"use strict";pn();Ze();ie();w();Vs=(o,n,e)=>{let t=new URL(o);return t.searchParams.append(n,e),t.toString()},et=class extends ee{constructor(){super(...arguments);r(this,"type",Y.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=Vs(u,"_myop-comp",d)),a.src=u,s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),a=this.appendChild(s,a,i)}return new Re(e,t,s,a,i)})}}});var tt,dn=m(()=>{"use strict";tt={webcomponent_message_key:"myop_webcomponent_message"}});var _e,cn=m(()=>{"use strict";dn();Fe();Ne();_e=class extends N{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=M({},e),s=super.send(t),i=new CustomEvent(tt.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=ve(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 mn,nt,fo=m(()=>{"use strict";cn();Ze();ie();w();mn={},nt=class extends ee{constructor(){super(...arguments);r(this,"type",Y.WebComponentLoader);r(this,"load",async(e,t,s,i)=>{let a=t.loader;mn[a.url]?console.log("Module alreday loaded or in loading process"):mn[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 mn[a.url],await Hn(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 _e(e,t,s,d,i)})}}});var T,U=m(()=>{"use strict";w();T=class extends Je{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(V(M({},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,te=m(()=>{"use strict";B={id:"myop-id"}});var S,uo,P=m(()=>{"use strict";te();S=(o,n)=>n.querySelectorAll("[".concat(B.id,"='").concat(o.refConfig.selector,"']")),uo=(o,n)=>{let e=S(o,n);return e.length?e.item(0):null}});var ot,go=m(()=>{"use strict";I();b();U();P();ot=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 ae(e.handlerUniqueId))};p.addEventListener("click",d),a.push(()=>{p.removeEventListener("click",d)})}),()=>{a.forEach(p=>p())}})}}});var st,yo=m(()=>{"use strict";I();U();P();st=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 rt,ho=m(()=>{"use strict";w();rt=class extends Ee{constructor(e,t){super(e,t);this.container=e;this.shadowRoot=t}}});var it,Mo=m(()=>{"use strict";w();te();U();b();I();it=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 be(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new le(e.handlerUniqueId,i))});r(this,"messageType",f.DetectMyopRefsMessage)}}});var at,Io=m(()=>{"use strict";I();U();P();at=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 pt,Co=m(()=>{"use strict";I();b();U();P();ge();pt=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 de(e.handlerUniqueId,A(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var dt,xo=m(()=>{"use strict";I();te();$e();Qe();U();dt=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 G(e.handlerUniqueId,u))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new G(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var ct,ln=m(()=>{"use strict";ge();ct=(o,n,e)=>{let t=o.scriptInputs?o.scriptInputs:{};t.makeSerializable=A,t.send=n,t.rootRef=e,t.__scriptInputs=t;let i=new Function("return (".concat(o.script,")(...arguments)"))(t);n(i)}});var mt,bo=m(()=>{"use strict";I();b();U();ln();mt=class extends T{constructor(){super(...arguments);r(this,"messageType",f.ExecuteScriptMessage);r(this,"innerExecutor",(e,t,s)=>{ct(e,a=>{s(new pe(e.handlerUniqueId,a))},t)})}}});var wo,lt,So=m(()=>{"use strict";I();b();U();P();te();ge();wo=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:wo(i),required:i.required,validity:A(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},lt=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 ce(wo(a)),e)})})}}});var ft,Eo=m(()=>{"use strict";I();U();P();ft=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 To={};se(To,{WebComponentSDK:()=>ke});var ke,fn=m(()=>{"use strict";w();I();dn();go();yo();ho();Mo();re();b();Io();Co();xo();bo();So();Eo();ke=class extends we{constructor(){super(...arguments);r(this,"alwaysPassEnvelopesToHost",!0);r(this,"connectedCallback",(e,t)=>{e.addEventListener(tt.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 rt(e,t)}}}),setTimeout(()=>{this.messageToHost(new me)},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 st(this.messageToHost,this.components),new ft(this.messageToHost,this.components),new ot(this.messageToHost,this.components),new it(this.messageToHost,this.components),new at(this.messageToHost,this.components),new pt(this.messageToHost,this.components),new mt(this.messageToHost,this.components),new lt(this.messageToHost,this.components),new dt(this.messageToHost,this.components)]);r(this,"init",()=>{})}};W("WebComponentSDK",ke)});var vo=m(()=>{"use strict";fn()});var Ro,_o=m(()=>{"use strict";Ro=""});function Ys(o,n){return class extends HTMLElement{connectedCallback(){let e=n===fe.open?"open":"closed",t=this.attachShadow({mode:e});Bo().then(s=>{s.connectedCallback(this,t),t.innerHTML=o})}}}var js,Gs,Ho,Do,ut,Bo,Qs,Js,Xs,gt,Lo=m(()=>{"use strict";cn();sn();Ze();ie();w();vo();pn();_o();js="<!-- myop-web-component -->",Gs="myop-web-component",Ho=new Set,Do=[],Bo=async()=>(ut||(ut=new ke,ut.init()),ut);Qs=(o,n,e)=>{customElements.define(o,Ys(n,e)),console.log("define('".concat(o,"') was called, web component ready to use"))},Js=o=>o.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/(\\d+)/g,"-$1").toLowerCase(),Xs=o=>(o=Js(o),o.replace(/_/g,"-")),gt=class extends ee{constructor(){super(...arguments);r(this,"type",Y.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===fe.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=null;{let O=new DOMParser().parseFromString(a.HTML,"text/html").querySelector('meta[name="myop:size"]');if(O)try{y=JSON.parse(O.getAttribute("content")||"{}")}catch(q){}}let h=a.HTML;if(i!=null&&i._inspection){let L=new DOMParser().parseFromString(a.HTML,"text/html"),O=L.getElementById("myop_preview");O==null||O.removeAttribute("type");let q=L.implementation.createHTMLDocument();q.body.innerHTML="<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>";let X=q.body.firstChild;X&&L.head&&L.head.insertBefore(L.importNode(X,!0),L.head.firstChild),h=L.documentElement.outerHTML}else if((i==null?void 0:i.data)!==void 0){let L=new DOMParser().parseFromString(a.HTML,"text/html"),O=L.getElementById("myop_preview");O&&(O.remove(),h=L.documentElement.outerHTML)}g.writeln(h);let Q='<script src="'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'"><\\/script>'),qe="<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(Q).concat(qe)),(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>",L=JSON.stringify(i.data).replace(/<\\/script/gi,"\\\\u003c/script"),O='<script id="__myop_init_data_script">\\n (function() {\\n var data = '.concat(L,";\\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(J+O)}g.close();let he=new Re(e,t,s,u,i);return he.sizeMeta=y,a.autoHeight&&(u.onload=()=>{he.observeSizeBasedOnDocumentElement()}),he}if(a.shadowRootMode===fe.none){let c=document.createElement("template");c.innerHTML=a.HTML,d=c.content.firstElementChild,Bo().then(l=>{l.connectedCallback(d,d)})}else{let c=Xs(e.name+t.id);Do.includes(c)||(Qs(c,a.HTML,a.shadowRootMode),Do.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 _e(e,t,s,d,i)})}isMyopWebComponent(e){return e.trimStart().startsWith(js)}extractWebComponentScript(e){let i=new DOMParser().parseFromString(e,"text/html").getElementById(Gs);return(i==null?void 0:i.textContent)||null}executeWebComponentScript(e,t){if(Ho.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),Ho.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 ye(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 Po,Oo,Ao=m(()=>{"use strict";ie();b();Po=(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}))}},Oo=(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 Zs,un,Ko,zo=m(()=>{"use strict";Zs=(o,n)=>{let e=new RegExp(Object.keys(n).join("|"),"g");return o.replace(e,t=>(n[t]||t).toString())},un=(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=M({},o.loader),o.loader.url=Zs(o.loader.url,n),o},Ko=o=>async n=>un(n,o)});var Fo,$o,Wo=m(()=>{"use strict";b();Fo=(o,n,e)=>{o.send(new j(({ref:t,_className:s})=>{t==null||t.classList.add(s)},{elementId:e,_className:n}))},$o=(o,n,e)=>{o.send(new j(({ref:t,_className:s})=>{t==null||t.classList.remove(s)},{elementId:e,_className:n}))}});var Mt,yt,It,ht,No=m(()=>{"use strict";ie();Mt=class Mt{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(Mt,"create",()=>new Mt);yt=Mt,It=class It{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(It,"create",()=>new It);ht=It});var er,Ct,tr,nr,ne,F,Uo,gn=m(()=>{"use strict";w();er=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:Te.code}},{id:"out_auto_v2_converted",name:"myop_cta_handler",type:"any",behavior:{type:Te.code}}],refs:[],skins:[{id:"skin_auto_v2_converted",name:"auto_v2_converted",description:"",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),Ct="__MYOP_CLOUD_REPOSITORY_MAIN__",tr=()=>{if(typeof window<"u")return window[Ct];if(typeof globalThis<"u")return globalThis[Ct]},nr=o=>{typeof window<"u"&&(window[Ct]=o),typeof globalThis<"u"&&(globalThis[Ct]=o)},ne=class ne{constructor(n="https://cloud.myop.dev"){this._baseUrl=n;r(this,"variants",{});r(this,"preloadedComponents",{});r(this,"userFlows",{});r(this,"_defaultEnv","production");r(this,"_envExplicitlySet",!1)}static get Main(){let n=tr();return n||(ne._main||(ne._main=new ne,nr(ne._main)),ne._main)}setEnvironment(n){this._defaultEnv=n,this._envExplicitlySet=!0}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;if(!i&&s)a=s.env,p=s.preview;else{a=e||this._defaultEnv;let c=e||this._envExplicitlySet;p=t===!0?!0:t===!1?!1:!c}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 h=(await(await fetch(u)).json()).item;if(!h){l(new Error('Component "'.concat(n,'" not found')));return}if(!h.consume_variant||!h.consume_variant.length){l(new Error('Component "'.concat(n,'" has no implementation for environment "').concat(a,'"')));return}let Q=er(h);c(Q)}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(ne,"_main",null);F=ne,Uo=F});var qo,Vo=m(()=>{"use strict";qo=async o=>await o()});var oe,jo,Go,Yo,Qo,Jo,Xo,Zo,es,ts=m(()=>{"use strict";gn();oe=F.Main,jo=()=>oe,Go=(o,n,e)=>oe.isPreloaded(o,n,e),Yo=o=>oe.getPreloadedParams(o),Qo=()=>{oe=new F("http://localhost:9292")},Jo=o=>{oe=new F(o)},Xo=o=>{oe=o},Zo=o=>{oe.setEnvironment(o)},es=async(o,n,e)=>Promise.allSettled(o.map(t=>oe.fetchComponentV2(t,n,e)))});var yn={};se(yn,{CloudRepository:()=>F,ComponentConfig:()=>ht,SkinConfig:()=>yt,addClass:()=>Fo,applyStylesheet:()=>Po,applyStylesheetLink:()=>Oo,changeSkinUrlByTokenizer:()=>Ko,createIframeSkinByTokenizer:()=>un,enableLocalDev:()=>Qo,exec:()=>qo,getCloudRepository:()=>jo,getPreloadedParams:()=>Yo,isPreloaded:()=>Go,preloadComponents:()=>es,removeClass:()=>$o,setCloudRepository:()=>Xo,setCloudRepositoryUrl:()=>Jo,setEnvironment:()=>Zo,v2_CloudRepository:()=>Uo});var xt=m(()=>{"use strict";Ao();zo();Wo();No();gn();Vo();ts()});var ns,os=m(()=>{"use strict";Ft();xt();w();ns=async o=>{try{let n=new URL(window.location.href),t=new URLSearchParams(n.search).get("myopOverride");if(t){let[s,...i]=zt(t);switch(s){case"component":{let[a,p]=i,d=await F.Main.fetchComponent(a);if(d&&d.type.skins.find(l=>l.id===p))return d.instance.skinSelector={type:ue.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=zt(t),c=(await F.Main.fetchFlow(a)).components.find(l=>l.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ue.Segmented&&c.instance.resolvedExperiences){let l=c.instance.resolvedExperiences.find(u=>u.id===p);if((l==null?void 0:l.type)===Xe.Segment){let u=l,y=c.instance.skinSelector.segments.find(h=>h.segmentId===u.segment.id);if(y)return c.instance.skinSelector=y==null?void 0:y.skinSelector,c}}}break}}}finally{return null}}});var is={};se(is,{HostSDK:()=>$,hostSDK:()=>rs});var ss,$,rs,$e=m(()=>{"use strict";re();I();b();lo();fo();Ne();w();Ye();Lo();os();ss="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",Ie);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 Ce(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===z.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 et,new nt,new gt];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 ue.Dedicated:return((i=n.skin)==null?void 0:i.id)||n.skins[0].id;case ue.Segmented:{let p=await s(n.segments,async d=>{if(d.segmentId==="Default")return!0;let c=e.find(y=>y.type===Xe.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 ns(n);s&&(n=s);let i=M(M({},(l=this.loaderHooks)!=null?l:{}),(u=t==null?void 0:t.hooks)!=null?u:{}),a=e;if(a.myop)if(a.component){n=M({},n),n.instance=M({},n.instance);let h=await this.runSkinSelector(n,i);if(!h)throw new Error("runSkinSelector failed to choose skin, check the provided config");return(g=t==null?void 0:t.hooks)!=null&&g.afterSkinSelected&&(h=await t.hooks.afterSkinSelected(M({},h))),n.instance.skinSelector={type:ue.Dedicated,skin:h},t&&(t=M({},t),delete t.hooks),await rn(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(M({},p)));let d=this.componentsLoaders.find(h=>h.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(h=>h!==c),this.components2init=this.components2init.filter(h=>h!==c),!0)),this.components.push(c),(!t||t.connectProps!==!1)&&(c=mo(c,n.type.props,p));try{await an(c,n,this.components)}catch(h){throw h}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,M({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,M({relative:{direction:"before",child:s}},t))}})}};r($,"Instance",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:ss});if(!window.myop.hostSDK){let o=new $;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:ss}),window.myop.hostSDK=o}rs=window.myop.hostSDK;W("hostSDK",rs)});var bt,as=m(()=>{"use strict";I();te();w();b();bt=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 be(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new le(e.handlerUniqueId,s))})}}});var wt,ps=m(()=>{"use strict";I();w();b();P();wt=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 ae,e)};i.addEventListener("click",a);let p=()=>{i.removeEventListener("click",a)};t.push(p)}),()=>{t.forEach(i=>i())}})}}});var St,ds=m(()=>{"use strict";I();w();P();St=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 Et,cs=m(()=>{"use strict";I();b();w();ln();Et=class extends x{constructor(){super(...arguments);r(this,"messageType",f.ExecuteScriptMessage);r(this,"executor",e=>{ct(e,s=>{this.messageToHost(new pe(e.handlerUniqueId,s))},new Ee(document.documentElement))})}}});var Tt,ms=m(()=>{"use strict";I();w();b();ge();P();Tt=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 de(e.handlerUniqueId,A(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),s.push(()=>{i.removeEventListener(e.type,a)})}),()=>{s.forEach(i=>{i()})}})}}});var vt,ls=m(()=>{"use strict";I();w();P();vt=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 Rt,fs=m(()=>{"use strict";I();te();w();$e();Qe();Rt=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 G(e.handlerUniqueId,p))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new G(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var us,gs=m(()=>{"use strict";us=(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 _t,ys=m(()=>{"use strict";I();b();w();gs();_t=class extends x{constructor(){super(...arguments);r(this,"messageType",f.SetMutationObserverMessage);r(this,"executor",e=>{e.source&&us(document.body,()=>{this.messageToHost(new Pe)})})}}});var hs,kt,Ms=m(()=>{"use strict";I();te();w();b();ge();P();hs=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:hs(i),required:i.required,validity:A(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},kt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.GetElementValueMessage);r(this,"executor",e=>{S(e.ref,document).forEach(s=>{this.messageToHost(new ce(hs(s)),e)})})}}});var Ht,Is=m(()=>{"use strict";I();w();b();P();Ht=class extends x{constructor(){super(...arguments);r(this,"messageType",f.GetAttributeMessage);r(this,"executor",e=>{let t=uo(e.ref,document);t&&this.messageToHost(new Le(t.getAttribute(e.name)),e)})}}});var Dt,Cs=m(()=>{"use strict";b();I();w();Dt=class extends x{constructor(){super(...arguments);r(this,"messageType",f.SetResizeObserverMessage);r(this,"executor",e=>{let t=new ResizeObserver(s=>{this.messageToHost(new ze)});return t.observe(document.body),()=>{t.disconnect()}})}}});var Bt,xs=m(()=>{"use strict";I();w();P();Bt=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 bs={};se(bs,{IframeSDK:()=>Lt});var Lt,ws=m(()=>{"use strict";w();as();ps();ds();cs();re();ms();ls();b();fs();ys();Ms();Ye();Is();Cs();xs();Lt=class extends we{constructor(){super();r(this,"version",Ie);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(M({},e),"*")});r(this,"supportedHandlers",[new St(this.messageToHost),new Bt(this.messageToHost),new wt(this.messageToHost),new bt(this.messageToHost),new Et(this.messageToHost),new Tt(this.messageToHost),new vt(this.messageToHost),new kt(this.messageToHost),new _t(this.messageToHost),new Dt(this.messageToHost),new Ht(this.messageToHost),new Rt(this.messageToHost)]);r(this,"init",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new me)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};W("IframeSDK",Lt)});var sr={};var or,Ss=m(()=>{"use strict";b();re();or=M({},xe);W("MyopMessages",or)});var Es={};se(Es,{CloudRepository:()=>F,ComponentConfig:()=>ht,SkinConfig:()=>yt,addClass:()=>Fo,applyStylesheet:()=>Po,applyStylesheetLink:()=>Oo,changeSkinUrlByTokenizer:()=>Ko,createIframeSkinByTokenizer:()=>un,enableLocalDev:()=>Qo,exec:()=>qo,getCloudRepository:()=>jo,getPreloadedParams:()=>Yo,isPreloaded:()=>Go,preloadComponents:()=>es,removeClass:()=>$o,setCloudRepository:()=>Xo,setCloudRepositoryUrl:()=>Jo,setEnvironment:()=>Zo,v2_CloudRepository:()=>Uo});var Ts=m(()=>{"use strict";re();xt();xt();W("MyopHelpers",yn)});var dr={};se(dr,{getHostModule:()=>vs,getIframeModule:()=>Rs,getWebcomponentModule:()=>_s});re();var kn;if(window.__federation__)console.log("__federation__ loaded more than once.");else{let o=(kn=document.currentScript)==null?void 0:kn.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][Kt]);else{let t;window.__federation__[n]={},window.__federation__[n][Ge]=s=>{t&&(document.head.removeChild(t),t=null),window.__federation__[n][Kt]=s,e(s)},t=document.createElement("script"),t.type="module",t.src=o,t.async=!0,document.head.appendChild(t)}};Ye();console.log("myop root sdk - loaded",document.location.origin);var rr="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",vs=()=>Promise.resolve().then(()=>($e(),is)),Rs=()=>Promise.resolve().then(()=>(ws(),bs)),_s=()=>Promise.resolve().then(()=>(fn(),To)),ir=()=>Promise.resolve().then(()=>(Ss(),sr)),ar=()=>Promise.resolve().then(()=>(Ts(),Es)),Ue=o=>async()=>(await o()).get(),pr={version:Ie,getHostModule:Ue(vs),getIframeModule:Ue(Rs),getWebcomponentModule:Ue(_s),getMyopMessages:Ue(ir),getMyopHelpers:Ue(ar)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:rr});window.myop.rootSDK?console.log("myop root host loaded more than once."):window.myop=M({rootSDK:pr},window.myop);return Ks(dr);})();
7
7
  `;
8
8
  exports.HTML = `
9
9
  <!DOCTYPE html>
package/dist/index.d.ts CHANGED
@@ -4,34 +4,5 @@ export { MyopLoader } from './MyopLoader';
4
4
  export { MyopFallback } from './MyopFallback';
5
5
  export type { MyopLoaderRef } from './MyopLoader';
6
6
  export type { IComponentInstanceConfig } from './types';
7
- import { CloudRepository } from '@myop/sdk/helpers';
8
- /**
9
- * Get the current CloudRepository instance
10
- */
11
- export declare const getCloudRepository: () => CloudRepository;
12
- /**
13
- * Check if a component is already preloaded/cached
14
- */
15
- export declare const isPreloaded: (componentId: string, env?: string, preview?: boolean) => boolean;
16
- /**
17
- * Enable local development mode
18
- */
19
- export declare const enableLocalDev: () => void;
20
- /**
21
- * Set a custom CloudRepository URL
22
- */
23
- export declare const setCloudRepositoryUrl: (url: string) => void;
24
- /**
25
- * Set a custom CloudRepository instance
26
- */
27
- export declare const setCloudRepository: (repository: CloudRepository) => void;
28
- /**
29
- * Set the default environment for component loading
30
- */
31
- export declare const setEnvironment: (env: string) => void;
32
- /**
33
- * Preload components for faster rendering.
34
- * Continues even if some components fail to load.
35
- */
36
- export declare const preloadComponents: (ids: string[], env?: string, preview?: boolean) => Promise<PromiseSettledResult<import("@myop/sdk/common").IComponentConfig>[]>;
7
+ export { getCloudRepository, isPreloaded, getPreloadedParams, enableLocalDev, setCloudRepositoryUrl, setCloudRepository, setEnvironment, preloadComponents, } from '@myop/sdk/helpers';
37
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;GAEG;AACH,eAAO,MAAM,kBAAkB,uBAAyB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,MAAM,MAAM,EAAE,UAAU,OAAO,KAAG,OAElF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,YAE1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,SAEhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,eAAe,SAE7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,SAEzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAU,KAAK,MAAM,EAAE,EAAE,MAAM,MAAM,EAAE,UAAU,OAAO,iFAIrF,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,60 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.preloadComponents = exports.setEnvironment = exports.setCloudRepository = exports.setCloudRepositoryUrl = exports.enableLocalDev = exports.isPreloaded = exports.getCloudRepository = exports.MyopFallback = exports.MyopLoader = exports.MyopComponent = void 0;
3
+ exports.preloadComponents = exports.setEnvironment = exports.setCloudRepository = exports.setCloudRepositoryUrl = exports.enableLocalDev = exports.getPreloadedParams = exports.isPreloaded = exports.getCloudRepository = exports.MyopFallback = exports.MyopLoader = exports.MyopComponent = void 0;
4
4
  var MyopComponent_1 = require("./MyopComponent");
5
5
  Object.defineProperty(exports, "MyopComponent", { enumerable: true, get: function () { return MyopComponent_1.MyopComponent; } });
6
6
  var MyopLoader_1 = require("./MyopLoader");
7
7
  Object.defineProperty(exports, "MyopLoader", { enumerable: true, get: function () { return MyopLoader_1.MyopLoader; } });
8
8
  var MyopFallback_1 = require("./MyopFallback");
9
9
  Object.defineProperty(exports, "MyopFallback", { enumerable: true, get: function () { return MyopFallback_1.MyopFallback; } });
10
- const helpers_1 = require("@myop/sdk/helpers");
11
- let _cloudRepository = helpers_1.CloudRepository.Main;
12
- /**
13
- * Get the current CloudRepository instance
14
- */
15
- const getCloudRepository = () => _cloudRepository;
16
- exports.getCloudRepository = getCloudRepository;
17
- /**
18
- * Check if a component is already preloaded/cached
19
- */
20
- const isPreloaded = (componentId, env, preview) => {
21
- return _cloudRepository.isPreloaded(componentId, env, preview);
22
- };
23
- exports.isPreloaded = isPreloaded;
24
- /**
25
- * Enable local development mode
26
- */
27
- const enableLocalDev = () => {
28
- _cloudRepository = new helpers_1.CloudRepository("http://localhost:9292");
29
- };
30
- exports.enableLocalDev = enableLocalDev;
31
- /**
32
- * Set a custom CloudRepository URL
33
- */
34
- const setCloudRepositoryUrl = (url) => {
35
- _cloudRepository = new helpers_1.CloudRepository(url);
36
- };
37
- exports.setCloudRepositoryUrl = setCloudRepositoryUrl;
38
- /**
39
- * Set a custom CloudRepository instance
40
- */
41
- const setCloudRepository = (repository) => {
42
- _cloudRepository = repository;
43
- };
44
- exports.setCloudRepository = setCloudRepository;
45
- /**
46
- * Set the default environment for component loading
47
- */
48
- const setEnvironment = (env) => {
49
- _cloudRepository.setEnvironment(env);
50
- };
51
- exports.setEnvironment = setEnvironment;
52
- /**
53
- * Preload components for faster rendering.
54
- * Continues even if some components fail to load.
55
- */
56
- const preloadComponents = async (ids, env, preview) => {
57
- return Promise.allSettled(ids.map((id) => _cloudRepository.fetchComponentV2(id, env, preview)));
58
- };
59
- exports.preloadComponents = preloadComponents;
10
+ var helpers_1 = require("@myop/sdk/helpers");
11
+ Object.defineProperty(exports, "getCloudRepository", { enumerable: true, get: function () { return helpers_1.getCloudRepository; } });
12
+ Object.defineProperty(exports, "isPreloaded", { enumerable: true, get: function () { return helpers_1.isPreloaded; } });
13
+ Object.defineProperty(exports, "getPreloadedParams", { enumerable: true, get: function () { return helpers_1.getPreloadedParams; } });
14
+ Object.defineProperty(exports, "enableLocalDev", { enumerable: true, get: function () { return helpers_1.enableLocalDev; } });
15
+ Object.defineProperty(exports, "setCloudRepositoryUrl", { enumerable: true, get: function () { return helpers_1.setCloudRepositoryUrl; } });
16
+ Object.defineProperty(exports, "setCloudRepository", { enumerable: true, get: function () { return helpers_1.setCloudRepository; } });
17
+ Object.defineProperty(exports, "setEnvironment", { enumerable: true, get: function () { return helpers_1.setEnvironment; } });
18
+ Object.defineProperty(exports, "preloadComponents", { enumerable: true, get: function () { return helpers_1.preloadComponents; } });
60
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AAEtB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAIrB,+CAAoD;AAEpD,IAAI,gBAAgB,GAAG,yBAAe,CAAC,IAAI,CAAC;AAE5C;;GAEG;AACI,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC;AAA5C,QAAA,kBAAkB,sBAA0B;AAEzD;;GAEG;AACI,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,GAAY,EAAE,OAAiB,EAAW,EAAE;IAC3F,OAAO,gBAAgB,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC,CAAA;AAFY,QAAA,WAAW,eAEvB;AAED;;GAEG;AACI,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,gBAAgB,GAAG,IAAI,yBAAe,CAAC,uBAAuB,CAAC,CAAC;AAClE,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEF;;GAEG;AACI,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAE,EAAE;IACnD,gBAAgB,GAAG,IAAI,yBAAe,CAAC,GAAG,CAAC,CAAC;AAC9C,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC;AAEF;;GAEG;AACI,MAAM,kBAAkB,GAAG,CAAC,UAA2B,EAAE,EAAE;IAChE,gBAAgB,GAAG,UAAU,CAAC;AAChC,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEF;;GAEG;AACI,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE;IAC5C,gBAAgB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEF;;;GAGG;AACI,MAAM,iBAAiB,GAAG,KAAK,EAAE,GAAa,EAAE,GAAY,EAAE,OAAiB,EAAE,EAAE;IACxF,OAAO,OAAO,CAAC,UAAU,CACvB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CACrE,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,iBAAiB,qBAI5B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AAEtB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAIrB,6CAS2B;AARzB,6GAAA,kBAAkB,OAAA;AAClB,sGAAA,WAAW,OAAA;AACX,6GAAA,kBAAkB,OAAA;AAClB,yGAAA,cAAc,OAAA;AACd,gHAAA,qBAAqB,OAAA;AACrB,6GAAA,kBAAkB,OAAA;AAClB,yGAAA,cAAc,OAAA;AACd,4GAAA,iBAAiB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myop/react-native",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
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",
@@ -14,7 +14,9 @@
14
14
  "prepare": "npm run build",
15
15
  "clean": "rm -rf dist",
16
16
  "release": "npm publish --access public",
17
- "start": "npm pack --pack-destination /tmp && cd ../playground/myop-react-native-host-test && npm install /tmp/myop-react-native-0.0.2.tgz && rm -rf node_modules/.cache .expo && npx expo start --clear"
17
+ "start": "npm pack --pack-destination /tmp && cd ../playground/myop-react-native-host-test && npm install /tmp/myop-react-native-0.0.2.tgz && rm -rf node_modules/.cache .expo && npx expo start --clear",
18
+ "test:e2e:build": "cd ../playground/myop-react-native-host-test && npx expo prebuild --platform android --clean && cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug",
19
+ "test:e2e": "detox test --configuration android.debug"
18
20
  },
19
21
  "peerDependencies": {
20
22
  "react": ">=16.8.0",
@@ -22,11 +24,16 @@
22
24
  "react-native-webview": ">=11.0.0"
23
25
  },
24
26
  "devDependencies": {
27
+ "@types/jest": "^30.0.0",
25
28
  "@types/react": "~19.1.0",
26
29
  "@types/react-native": "^0.73.0",
30
+ "detox": "^20.47.0",
31
+ "detox-cli": "^20.47.0",
32
+ "jest": "^30.2.0",
27
33
  "react": "19.1.0",
28
34
  "react-native": "0.81.4",
29
35
  "react-native-webview": "^13.16.0",
36
+ "ts-jest": "^29.4.6",
30
37
  "typescript": "~5.9.2"
31
38
  },
32
39
  "keywords": [
@@ -52,6 +59,6 @@
52
59
  "url": ""
53
60
  },
54
61
  "dependencies": {
55
- "@myop/sdk": "^0.3.17"
62
+ "@myop/sdk": "^0.3.19"
56
63
  }
57
64
  }