@rokt/dcui-orchestrator 1.2.1-rc.41 → 1.2.1-rc.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/dist/schema.d.ts +8 -0
- package/node_modules/@rokt/dcui-layout-schema/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@rokt/dcui-layout-schema/package.json +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.30/index.d.ts +7659 -0
- package/node_modules/@rokt/dcui-layout-schema/v1.30/index.js +4 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom/client"),i=require("react-redux"),a=require("ramda"),o=require("@emotion/css"),r=require("redux-saga/effects"),s=require("redux-saga"),l=require("@reduxjs/toolkit"),c=require("@redux-saga/core/effects"),d=require("embla-carousel-react"),u=require("insane"),p=require("@emotion/css/create-instance"),f=require("embla-carousel-autoplay"),h=require("embla-carousel-fade");function v(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y,m,C=v(t);function g(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],o=["default","dimension","minWidth"],r=a.path(t,e);return r&&Array.isArray(r)&&r.length?a.assocPath(t,r.map(a.when(a.allPass([a.hasPath(n),a.complement(a.hasPath(o)),a.pathEq("fixed",n)]),(e=>a.assocPath(o,a.path(i,e),e)))),e):e}function b(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function E(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function I(){return"ontouchstart"in document.documentElement}function x(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function L(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function D(e){return L(e)&&"Fulfillment"===e.action}function w(e){return L(e)&&"Url"===e.action}function S(e){return L(e)&&"CaptureOnly"===e.action}function A(e){return L(e)&&"ExternalPaymentTrigger"===e.action}function O(e){return(D(e)||w(e))&&"RealTime"===e.conversionType&&"rclid"in e}function T(e){return(D(e)||w(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}function j(e){switch(e){case"SignalGatedResponse":return"SignalGatedResponse";case"SignalOptInResponse":return"SignalOptInResponse";case"SignalOptOutResponse":return"SignalOptOutResponse";default:return"SignalResponse"}}function k(e){return e.slice(e.lastIndexOf(":")+1)}function M(e){return{oldCartItem:null,cartItem:{cartItemId:e,catalogItemId:"",name:"",description:"",quantity:0,unitPrice:0,totalPrice:0,currency:"",providerData:""}}}!function(e){e.Unknown="Unknown",e.InStock="InStock",e.OutOfStock="OutOfStock"}(y||(y={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Other=1]="Other",e[e.Card=2]="Card",e[e.PayPal=3]="PayPal",e[e.ApplePay=4]="ApplePay",e[e.GooglePay=5]="GooglePay",e[e.Afterpay=6]="Afterpay"}(m||(m={}));const R="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function V(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"string"==typeof e.cartItemId&&"quantity"in e&&"number"==typeof e.quantity&&!("unitPrice"in e)}const H={pluginId:"shared",pageInstanceGuid:"N/A"},P="offerComplete",_="checkout",N="layoutMinimized";function F(e){return e.registrationCount>0}function $(e){return e.validated&&!e.valid&&e.errorVisible}function Z(e,t=[]){const n=0===e.trim().length;for(const i of t){if(n&&"Required"!==i.type)continue;const t=G(e,i);if(t)return t}return""}function G(e,t){switch(t.type){case"Required":return 0===e.trim().length?t.value.message:"";case"MinLength":return e.length<t.value.length?t.value.message:"";case"MaxLength":return e.length>t.value.length?t.value.message:"";case"Pattern":return function(e,t){try{return new RegExp(t).test(e)}catch(e){return!0}}(e,t.value.pattern)?"":t.value.message;default:return""}}function B(e,t){return t.flatMap((t=>{var n;const i=t.indexOf(".");if(-1===i){const i=null!==(n=e[t])&&void 0!==n?n:{};return Object.entries(i).filter((([,e])=>F(e))).map((([e])=>({formKey:t,fieldKey:e})))}return[{formKey:t.slice(0,i),fieldKey:t.slice(i+1)}]}))}var U;!function(e){e.DCUI="DCUI",e.Partner="partner"}(U||(U={}));const z=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction","SignalOptInResponse","SignalOptOutResponse"],q="ERROR",K="INFO",W="WARNING";class Y extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const J=["V2_CART_ITEM_UPDATED","UPDATE_CART_ITEM_MESSAGE","CART_ITEM_INSTANT_PURCHASE","UPSELL_ITEM_INSTANT_PURCHASE","DELIVERY_DETAILS_SENT","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","INITIATE_INSTANT_PURCHASE_EVENT","INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT","INITIATE_CART_ITEM_EVENT","PREPARE_DEVICE_PAY_EVENT","INITIATE_DEVICE_PAY_EVENT","ABORT_DEVICE_PAY_EVENT","COMPLETE_DEVICE_PAY_EVENT","LEAD_CAPTURE_SUBMITTED","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];function X(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];return"positive"===t&&w(n)&&n.isPositive&&"string"==typeof n.url&&n.url.trim()&&"SignalSecondaryResponse"!==n.signalType&&(void 0===n.conversionType||"Default"===n.conversionType)?n:void 0}function Q(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];if(n&&Boolean(n.isPositive)===("positive"===t)&&"SignalSecondaryResponse"!==n.signalType)return S(n)?n:!w(n)||"negative"!==t||void 0!==n.conversionType&&"Default"!==n.conversionType?X(e,t):n}const ee=(e,t)=>a.concat(e,a.slice(e.length,t.length,t)),te=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?ee(t,e):t,i=t.length>e.length?ee(e,t):e;return a.zipWith(re,i,n)}return t},ne=e=>null==e,ie=e=>!ne(e),ae=(e,t)=>ne(t)?e:t,oe=(e,t)=>{throw new Y("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function re(e,t){return a.cond([[(e,t)=>ie(e)&&ie(t)&&a.type(e)!==a.type(t)&&("Object"===a.type(e)||"Object"===a.type(t)),oe],[(e,t)=>ne(e)||ne(t),ae],[(e,t)=>"Object"===a.type(e),a.mergeDeepWith(re)],[(e,t)=>"Array"===a.type(e),te],[a.T,a.flip(a.unary(a.identity))]])(e,t)}function se(e,t){return re(e,t)}function le(e=0){return`breakpoint-${e}px`}function ce(e,t){return t?`${t}-child${e}`:void 0}const de="GLOBAL/RAISE_METRIC",ue="GLOBAL/OFFER_ENGAGEMENT";function pe(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&D(e.responseOption)&&"fulfillment"in e&&x(e.fulfillment)}function fe(e){return A(e)}function he(e){return w(e)}function ve(e){return S(e)}function ye(e){return!!(O(e)||"responseOption"in e&&O(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function me(e){return!!(T(e)||"responseOption"in e&&T(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function Ce(e){return"string"==typeof e&&""!==e?{adID:e}:{}}function ge(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(x(n))return Object.assign({fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId},Ce(e.adId));throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign(Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId}),Ce(e.adId)),{urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}const be="GLOBAL/RAISE_SIGNAL",Ee="GLOBAL/OFFER_LIFECYCLE",Ie=new Set(["__proto__","constructor","prototype"]);function xe(e){return"string"==typeof e&&e.length>0&&!Ie.has(e)}const Le="GLOBAL/SET_CUSTOM_STATE";const De="ProcessingState",we="DevicePayErrorState",Se="applePayUnavailable",Ae="GLOBAL/SEND_PARTNER",Oe="GLOBAL/SET_DOMAIN_STATE",Te="GLOBAL/LAYOUT_EVENT",je="GLOBAL/PREPARE_SIGNAL",ke="GLOBAL/OPEN_LINK",Me="GLOBAL/SET_PARTNER_VALIDATION_STATUS",Re="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",Ve="GLOBAL/LAUNCH_CHILD_LAYOUT",He="GLOBAL/CART_ITEM_EVENT/INITIATE",Pe="GLOBAL/CART_ITEM_EVENT/RESPONSE",_e="OVERLAY/DISMISS_OVERLAY",Ne="plugin-overlay",Fe="GLOBAL/TRIGGER_ACTION";const $e="ERROR/REPORT",Ze="GLOBAL/REGISTER_FORM_FIELD",Ge="GLOBAL/UNREGISTER_FORM_FIELD",Be="GLOBAL/SET_FORM_FIELD_VALUE",Ue="GLOBAL/SET_FORM_FIELD_TOUCHED",ze="GLOBAL/VALIDATE_FORM_FIELDS";function qe(e){const{formKey:t,fieldKey:n}=null!=e?e:{};return xe(t)&&xe(n)}const Ke={RAISE_METRIC:de,PREPARE_SIGNAL:je,OFFER_ENGAGEMENT:ue,RAISE_SIGNAL:be,OFFER_LIFECYCLE:Ee,SEND_PARTNER:Ae,SET_CUSTOM_STATE:Le,SET_DOMAIN_STATE:Oe,LAYOUT_EVENT:Te,OPEN_LINK:ke,SET_PARTNER_VALIDATION_STATUS:Me,SET_GLOBAL_OFFER_DATA_CART:Re,LAUNCH_CHILD_LAYOUT:Ve,INITIATE_CART_ITEM_EVENT:He,CART_ITEM_RESPONSE:Pe,DISMISS_OVERLAY:_e,TRIGGER_ACTION:Fe,REGISTER_FORM_FIELD:Ze,UNREGISTER_FORM_FIELD:Ge,SET_FORM_FIELD_VALUE:Be,SET_FORM_FIELD_TOUCHED:Ue,VALIDATE_FORM_FIELDS:ze,REPORT_ERROR:$e},We="CHILD_LAYOUT/DISPATCH_BEHAVIOR",Ye="CHILD_LAYOUT/STATE_SYNC",Je="CHILD_LAYOUT/READY",Xe="CHILD_LAYOUT/REQUEST_DEVICE_PAY";function Qe(e){return xe(e)&&!e.includes("%^")}const et={[Fe]:function(e){const{action:t}=null!=e?e:{};return"object"==typeof t&&null!==t},[Le]:function(e){const{key:t,value:n}=null!=e?e:{};return xe(t)&&"number"==typeof n&&isFinite(n)},[Ze]:function(e){const{formKey:t,fieldKey:n,defaultValue:i,validations:a}=null!=e?e:{};return xe(t)&&xe(n)&&"string"==typeof i&&Array.isArray(a)},[Ge]:qe,[Be]:function(e){const{formKey:t,fieldKey:n,value:i,validate:a}=null!=e?e:{};return xe(t)&&xe(n)&&"string"==typeof i&&"boolean"==typeof a},[Ue]:qe,[ze]:function(e){const{entries:t}=null!=e?e:{};return Array.isArray(t)&&t.every((e=>"string"==typeof e))}};function tt(e){return"object"==typeof e&&null!==e&&1===e.version&&"payload"in e}const nt="stage"===(it="undefined"==typeof __environment?void 0:__environment.ENVIRONMENT)||"uat"===it||"prod"===it;var it;const at="CONTINUOUS_CHILD/READY",ot="CONTINUOUS_CHILD/PRESENTATION",rt="CONTINUOUS_CHILD/APPLIED",st="CONTINUOUS_CHILD/REQUEST",lt="CONTINUOUS_CHILD/EXPOSURE";function ct(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const dt=e=>"string"==typeof e&&e.trim().length>0&&e.length<=256;function ut(e){return ct(e)&&dt(e.sessionId)&&dt(e.creativeInstanceGuid)&&(void 0===e.childInstanceGuid||dt(e.childInstanceGuid))&&Number.isSafeInteger(e.revision)&&Number(e.revision)>0&&Number.isSafeInteger(e.position)&&Number(e.position)>=0}function pt(e,t){return e.sessionId===t.sessionId&&e.revision===t.revision&&e.position===t.position&&e.creativeInstanceGuid===t.creativeInstanceGuid&&e.childInstanceGuid===t.childInstanceGuid}const ft="data-open-in-app",ht="data-click-signal-context";function vt(e,n){function i(e){var t;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(t=e.target)||void 0===t?void 0:t.closest("a");if(i){const t=i.getAttribute("href"),a=i.getAttribute(ht);if(a&&n({type:be,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),t){e.preventDefault();let a="newTab";i.hasAttribute(ft)?a="inApp":"_top"===i.getAttribute("target")&&(a="self"),n({type:ke,payload:{url:t,urlBehaviour:a}})}}}t.useEffect((()=>null!==e?(e.addEventListener("click",i),()=>{e.removeEventListener("click",i)}):()=>{}),[e])}function yt(){const e=t.useRef(null);return t.useEffect((()=>{const t=t=>{"Tab"===t.key&&mt(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const mt=(e,t)=>{var n;const i=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i)return;const a=i[0],o=i[i.length-1],{activeElement:r}=window.document;if(1!==i.length)return r===a&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(a&&a.focus(),void e.preventDefault());e.preventDefault()},Ct="both",gt="linear",bt={hasOverflow:!1,atStart:!0,atEnd:!0};function Et(e,t){if("horizontal"===t){const t=e.scrollWidth-e.clientWidth;return{hasOverflow:t>0,atStart:e.scrollLeft<=0,atEnd:e.scrollLeft>=t}}const n=function(e){if("undefined"==typeof window)return e.scrollHeight;const t=window.getComputedStyle(e),n=t.webkitLineClamp;if(!n||"none"===n||"normal"===n)return e.scrollHeight;const i=e.style,a={webkitLineClamp:i.webkitLineClamp,display:i.display,overflow:i.overflow,maxHeight:i.maxHeight};i.setProperty("-webkit-line-clamp","unset"),i.display="block",i.overflow="visible",i.maxHeight="none";const o=e.scrollHeight;return i.webkitLineClamp=a.webkitLineClamp,i.display=a.display,i.overflow=a.overflow,i.maxHeight=a.maxHeight,o}(e),i=n-e.clientHeight;return{hasOverflow:i>0,atStart:e.scrollTop<=0,atEnd:e.scrollTop>=i}}function It(e,n){const i=t.useRef(null),[a,o]=t.useState(null),[r,s]=t.useState(bt),l=t.useCallback((e=>{i.current=e,o(e)}),[]),c=!!n;t.useEffect((()=>{if(!a||!c)return;const t=()=>s(Et(a,e));let n;return t(),a.addEventListener("scroll",t,{passive:!0}),"undefined"!=typeof ResizeObserver&&(n=new ResizeObserver(t),n.observe(a),Array.from(a.children).forEach((e=>null==n?void 0:n.observe(e)))),()=>{a.removeEventListener("scroll",t),null==n||n.disconnect()}}),[a,e,c]);const d=t.useMemo((()=>function(e,t,{hasOverflow:n,atStart:i,atEnd:a}){var o,r,s,l,c,d;if(!t||!n)return{};const u=null!==(o=t.edges)&&void 0!==o?o:Ct,p=null!==(r=t.easing)&&void 0!==r?r:gt,f=null!==(s=t.size)&&void 0!==s?s:36,h=null!==(l=t.startSize)&&void 0!==l?l:f,v=null!==(c=t.endSize)&&void 0!==c?c:f,y=("start"===u||"both"===u)&&!i,m=("end"===u||"both"===u)&&!a;if(!y&&!m)return{};const C="horizontal"===e?"to right":"to bottom",g=`linear-gradient(${C},${E=y?function(e,t){switch(e){case"ease-in":return["transparent 0",`transparent ${.3*t}px`,`black ${t}px`];case"ease-out":return["transparent 0",`black ${.7*t}px`,`black ${t}px`];case"ease-in-out":return["transparent 0",`rgba(0,0,0,0.5) ${.5*t}px`,`black ${t}px`];default:return["transparent 0",`black ${t}px`]}}(p,h):["black 0"],I=m?function(e,t){switch(e){case"ease-in":return[`black calc(100% - ${t}px)`,`transparent calc(100% - ${.3*t}px)`,"transparent 100%"];case"ease-out":return[`black calc(100% - ${t}px)`,`black calc(100% - ${.7*t}px)`,"transparent 100%"];case"ease-in-out":return[`black calc(100% - ${t}px)`,`rgba(0,0,0,0.5) calc(100% - ${.5*t}px)`,"transparent 100%"];default:return[`black calc(100% - ${t}px)`,"transparent 100%"]}}(p,v):["black 100%"],[...E,...I].join(",")})`,b=null!==(d=t.clip)&&void 0!==d?d:"border-box";var E,I;return{maskImage:g,WebkitMaskImage:g,maskMode:"alpha",WebkitMaskMode:"alpha",maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskClip:b,WebkitMaskClip:b}}(e,n,r)),[e,n,r]);return Object.assign({ref:i,setRef:l,maskStyle:d},r)}function xt(e){var t,n,i,a,o,r;return null!==(r=null===(o=null===(a=null===(i=null===(n=null===(t=null==e?void 0:e.elements)||void 0===t?void 0:t.own)||void 0===n?void 0:n[0])||void 0===i?void 0:i.default)||void 0===a?void 0:a.container)||void 0===o?void 0:o.scrollMask)&&void 0!==r?r:null}const Lt=a.sortBy(a.prop(1)),Dt=a.map(a.prop(0)),wt="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function St(e,t){return t?"false"!==wt.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${le(e)} ${t.trim()}`:`#app-container.${le(e)} & {${t}}`:"";var n}const At={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"},Ot={selected:'[data-selected="true"]',errored:'[data-errored="true"]'};function Tt(e){return function(e){return Object.keys(At).indexOf(e)>-1}(e)?At[e]:function(e){return Object.keys(Ot).indexOf(e)>-1}(e)?Ot[e]:""}const jt={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",scrollMask:"",blur:"filter",opacity:"opacity"},text:{textColor:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",lineHeight:"line-height",lineLimit:"",letterSpacing:"letter-spacing",baselineTextAlign:"vertical-align",horizontalTextAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform"},background:{backgroundColor:"background-color",backgroundImage:""},dimension:{width:"width",maxWidth:"max-width",minWidth:"min-width",height:"height",maxHeight:"max-height",minHeight:"min-height",rotateZ:"transform"},flexChild:{alignSelf:"align-self",weight:"flex",order:"order"},spacing:{margin:"margin",padding:"padding",offset:""},border:{borderColor:"border-color",borderRadius:"border-radius",borderWidth:"border-width",borderStyle:"border-style"}};function kt(e,t){if(!jt[e]||!jt[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return jt[e][t]}function Mt(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function Rt(...e){let t="";const n=(...e)=>e.reduce(((e,n)=>(e&&n?e=e+t+n:n&&(e=n),e)),"");return 1===e.length?(t=e[0],n):n(...e)}function Vt(e,t){return`${e}:${t};`}function Ht(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Pt extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function _t(e,t){if(null===t)return!1;const n=("function"==typeof e?[e]:e).map((e=>e(t))).reduce(((e,t)=>t?e?e+=`, ${t}`:t:e),void 0);if(n)throw new Pt(n,JSON.stringify(t));return!0}function Nt(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Ft(e){return t=>{const n=t&&"symbol"!=typeof t?t.toString():t;if(!(e.indexOf(n)>=0))return`value must be one of [${e.join(",")}]`}}function $t(e){if(null==e||""===e)return"value must not be omitted"}function Zt(e){const t=new RegExp(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/);if("string"!=typeof e||!t.test(e))return"value must be a valid hex color"}function Gt(e){const t=new RegExp(/^(?:(?:data:image\/[^;]+;base64[^"]+)|(?:(?:https?:)?\/\/[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*(?::\d{1,10})?)?(?:\.\.?\/?)*\/(?:[a-zA-Z\d\-_]+\/)*[a-zA-Z\d\-_]+\.[a-zA-Z\d]{2,6}(?:\?(?:.+=.+&?)*)?)(?:#.+)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function Bt(e){if(null!=e&&""!==e)return"value must not be specified"}function Ut(e){return t=>{if(t&&"object"==typeof t&&"value"in t&&"type"in t&&"string"==typeof t.type&&function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t.type)&&"function"==typeof e[t.type]){const n=e[t.type](t.value);if(!n)return;return`object must have valid "value" for type: ${t.type}: ${n}`}return`value must be an object that has a "type" property that matches one of: [${Object.keys(e).join(", ")}] and a "value" property`}}function zt(...e){return t=>{if("string"==typeof t){const n=t.split(" ");if(n.length>1&&e.indexOf(n.length)>-1){if(!n.reduce(((e,t)=>e||Nt(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function qt(e,t){return n=>{const i=e(n),a=t(n);if(i&&a)return`one of these must be true: ${i} -OR- ${a}`}}function Kt(e){if("string"!=typeof e)return"value must be a string"}const Wt=a.is(Object);function Yt(e){const t=Object.entries(e);return n=>Wt(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Jt(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Xt(e,t,n){return _t(Nt,n)?Vt(kt(e,t),`${n}`):""}function Qt(e){return(t,n,i)=>_t(Ft(Object.keys(e)),i)?Vt(kt(t,n),`${e[i]}`):""}function en(e){return _t($t,e)?Mt({light:t(Gt,!1),dark:t(qt(Bt,Gt),!0)},Rt("\n "))(e):"";function t(e,t){return n=>{if(_t(e,n)&&n){const e=Vt("background-image",`url("${n}")`);return t?Ht(e):e}return""}}}function tn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),_t(qt(Bt,Ft(Object.keys(t))),e)&&e?Vt("background-size",t[e]):""}const nn=a.cond([[a.equals("top-left"),a.always("top left")],[a.equals("top-right"),a.always("top right")],[a.equals("bottom-left"),a.always("bottom left")],[a.equals("bottom-right"),a.always("bottom right")],[a.T,a.identity]]);function an(e){const t="string"==typeof e?e.toLowerCase():e;return _t(qt(Bt,Ft(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Vt("background-position",nn(t)):""}function on(e,t,n){return _t(qt(Nt,zt(2,3,4)),n)?Vt(kt(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function rn(e){return(t,n,i)=>_t(Ut({fit:Ft(e),percentage:Nt,fixed:Nt}),i)?Vt(kt(t,n),sn(i)):""}function sn(e){const t={"wrap-content":"fit-content","fit-width":"100%","fit-height":"100%"};switch(e.type){case"fixed":return`${e.value}px`;case"percentage":return`${e.value}%`;case"fit":return t[e.value]}}const ln=Yt({light:Zt,dark:qt(Bt,Zt)});function cn(e,t,n){return i=>{if(i){const a=Vt(kt(e,t),un(String(i)));return n?Ht(a):a}return""}}function dn(e,t,n){return _t(ln,n)?Mt({light:cn(e,t,!1),dark:cn(e,t,!0)},Rt("\n "))(n):""}function un(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t.toUpperCase()}}const pn=Yt({offsetX:qt(Bt,Nt),offsetY:qt(Bt,Nt),blurRadius:qt(Bt,Nt),spreadRadius:qt(Bt,Nt),color:ln}),fn=e=>t=>null!=t?String(t):e,hn=a.compose(a.concat(a.__,"px"),fn("0")),vn=e=>t=>"string"==typeof t?e(t):t,yn=a.compose(vn(a.concat(a.__,"px")),fn(void 0)),mn=a.compose(vn(un),a.prop("dark"));function Cn(e,t,n){return Vt(e,Mt({offsetX:hn,offsetY:hn,blurRadius:t.spreadRadius?hn:yn,spreadRadius:yn,color:n},Rt(" "))(t))}const gn=Yt({edges:qt(Bt,Ft(["start","end","both"])),size:qt(Bt,Nt),startSize:qt(Bt,Nt),endSize:qt(Bt,Nt),easing:qt(Bt,Ft(["linear","ease-in","ease-out","ease-in-out"])),clip:qt(Bt,Ft(["border-box","padding-box","content-box"]))});const bn={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},En={container:{justifyContent:Qt(bn),alignItems:Qt(bn),shadow:function(e,t,n){var i,o,r;if(_t(pn,n)){const s=kt(e,t);return Rt("\n")(Cn(s,n,(o="light",r="#80000000",a.compose(un,a.propOr(r,o)))),(null===(i=n.color)||void 0===i?void 0:i.dark)?Ht(Cn(s,n,mn)):"")}return""},gap:on,overflow:Qt({hidden:"hidden",visible:"visible"}),scrollMask:function(e,t,n){return null==n||_t(gn,n),""},blur:function(e,t,n){return _t(Jt,n)?Vt(kt(e,t),`blur(${n.toString()}px)`):""},opacity:Xt},text:{textColor:dn,fontSize:on,fontFamily:function(e,t,n){return _t(Kt,n)?Vt(kt(e,t),(i=`${n}`,i.replace(/['();{}@:[\]!/=]/g,"")).split(",").map(((e,t)=>{const n=0===t?e:e.trim();if(n.includes(" ")){const e=n.startsWith('"')?"":'"',t=n.endsWith('"')?"":'"';return`${e}${n}${t}`}return n})).join(",")):"";var i},fontWeight:Qt({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Qt({normal:"normal",italic:"italic"}),lineHeight:on,lineLimit:function(e,t,n){return _t(Nt,n)?`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: ${n};\n line-clamp: ${n}; \n -webkit-box-orient: vertical;\n `:""},letterSpacing:on,baselineTextAlign:Qt({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Qt({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Qt({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Qt({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:dn,backgroundImage:function(e,t,n){return _t($t,n)?Mt({url:en,position:an,scale:tn},Rt)(n):""}},dimension:{width:rn(["wrap-content","fit-width"]),maxWidth:on,minWidth:on,height:rn(["wrap-content","fit-height"]),maxHeight:on,minHeight:on,rotateZ:(In="Z",(e,t,n)=>{const i=`rotate${In}`;return _t(Nt,n)?Vt(kt(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Qt(bn),weight:Xt,order:Xt},spacing:{margin:on,padding:on,offset:function(e,t,n){return _t(zt(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:dn,borderRadius:on,borderWidth:on,borderStyle:Qt({solid:"solid",dashed:"dashed"})}};var In;function xn(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!En[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=En[n][i];if(!a)throw new Error(`No styling transformer exists for property: ${n}.${i.toString()}`);try{t+=a(n,i,e[n][i])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${i.toString()}: ${e.message}`),e}})),t)),"")}const Ln="FAILED_TEMPLATING_DATA",Dn="UNRESOLVED_FORM_VALIDATION_TARGET",wn=new Map;function Sn(e){return String.fromCharCode(97+e)}function An(e,t,n){const i=`${e||H.pluginId}-${void 0!==t?String(t):"outer"}`,a=wn.get(i);if(a&&a.sheet.container.isConnected)return a;const o=function(e,t){const n={key:void 0!==e?`inner-css-${Sn(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),p(n)}(t,n);return wn.set(i,o),o}function On(e,t,n){return An(e,t,n).css}function Tn(e,t,n){return An(e,t,n).cx}const jn="%%%OWN_CLASS_REF%%%",kn={placeholderText:"::placeholder"},Mn=a.memoizeWith(((e,t,n,i)=>`${String(e)}-${t}-${n}`),Rn);function Rn(e,t,n,i){const a=On(t,n,i);let o=1;return function t(n,i=!1){var r;if("string"==typeof n){const e={scopeClass:n};return t.bind(e)}const s=n,l=this.scopeClass,c=Object.entries(null!==(r=s.elements)&&void 0!==r?r:{});try{const t=c.reduce(((t,[n,a])=>Object.assign(Object.assign({},t),{[n]:Vn(a,l,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?a(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const i=n.replace(jn,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function Vn(e,t,n,i,a){return e.map(function(e,t,n){var i;const a=null!==(i=kn[n])&&void 0!==i?i:"";return i=>Object.entries(i).map((([i,o])=>{const r=o?xn(o):"";switch(!0){case"default"===i:return r?a?`\n &${a} {\n${r}\n}\n`:`\n${r}\n`:"";case Boolean(e):return`\n .${e}${Tt(i)} &${a} {\n${r}\n}\n`;case t&&"own"!==n:return`\n .${jn}${Tt(i)} &${a} {\n${r}\n}\n`;default:return`\n &${Tt(i)}${a} {\n${r}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${St(i,t)}\n`):e}),"")}const Hn=t.createContext(a.always(void 0)),Pn=()=>t.useContext(Hn),_n=t.createContext(null);function Nn(e,n){var i;const a=t.useContext(_n);return a&&null!==(i=n(a))&&void 0!==i?i:e}const Fn=t.createContext((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),$n=Fn.Consumer,Zn=()=>t.useContext(Fn),Gn=t=>e.jsx(Fn.Provider,{value:(e,n,i,a)=>t.value(e,null!=n?n:t.overrides,i,a),children:t.children}),Bn=t.createContext(null),Un=()=>t.useContext(Bn),zn=t.createContext({get(){throw Error("Offer context has not been set")}}),qn=t=>e.jsx(zn.Provider,{value:{get:()=>t.context},children:t.children}),Kn=()=>t.useContext(zn).get(),Wn=()=>{try{return t.useContext(zn).get().creative.copy}catch(e){return}},Yn=t.createContext((()=>{})),Jn=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Xn=a.compose(a.not,a.isEmpty),Qn=a.where({url:Xn,title:Xn});function ei(e,t,n){return t.reduce(((t,n)=>{const i=n.indexOf("["),a=-1===i?n.slice(0,-1):n.slice(0,i),o=-1===i?"":n.slice(i+1,-1),r="append"===a?[o]:o?o.split(","):[];if(!a)throw new Error(ni(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){ti(t,e,"openLinks",1,2);const i=ii(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=ai(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Jn,((e,t)=>`<a ${ft} ${a?`${ht}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){ti(t,e,"sliceText",2,2);const i=ii(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=ii(t,e,1,(e=>{const t=Number(e);return!Number.isNaN(t)&&t>=0?t:null}),"sliceText meta attribute second argument must be a positive number");if("Chars"===i)return function(e,t){const n=new RegExp(">.*(?:</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,a);throw Error(ni(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);case"timerFormat":return function(e,t,n){var i;ti(t,e,"timerFormat",1,1);const a=null!==(i=t[0])&&void 0!==i?i:"";return function(e,t){const n=/(?:^|[^\\])hh?/.test(t),i=/(?:^|[^\\])mm?/.test(t),a=n?Math.floor(e/3600):0,o=e-3600*a,r=i?n?Math.floor(o/60):Math.floor(e/60):0,s=i?o-60*r:n?o:e,l=[[/hh/,String(a).padStart(2,"0")],[/h/,String(a)],[/mm/,String(r).padStart(2,"0")],[/m/,String(r)],[/ss/,String(s).padStart(2,"0")],[/s/,String(s)]];let c="",d=0;for(;d<t.length;){if("\\"===t[d]&&d+1<t.length){c+=t[d+1],d+=2;continue}let e=!1;for(const[n,i]of l){const a=t.slice(d).match(n);if(a&&0===a.index){c+=i,d+=a[0].length,e=!0;break}}e||(c+=t[d],d++)}return c}(Math.max(0,Math.floor(Number(n)||0)),a)}(e,n,i);case"append":return function(e,t,n){if(1!==t.length)throw new Error(ni(e,`append meta attribute takes 1 argument; received ${t.length}.`));return n+t[0]}(e,n,i);default:throw new Error(ni(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,r,t)}),n)}function ti(e,t,n,i,a){const o=new Error(ni(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} ${1===(a||i)?"argument":"arguments"}; received ${e.length}.`));if(a&&(e.length<i||e.length>a))throw o;if(!a&&e.length!==i)throw o}function ni(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function ii(e,t,n,i,a){const o=ai(e,n,i);if(null!==o)return o;throw Error(ni(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function ai(e,t,n){return n(e[t])}const oi="DATA",ri="STATE",si="ATTRIBUTE",li=new RegExp(`^(${`${oi}|${ri}|${si}`})\\.`),ci=new RegExp(`^${si}`),di=new RegExp(`%\\^(?:(?:${oi}|${ri})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*|${si}\\.[a-zA-Z0-9][a-zA-Z0-9\\._-]*)(?:\\:(?:append\\[[^\\]\\[|:]*\\]|[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,:\\\\ -]*\\]))*(?:\\|.*?)?\\^%`,"g");function ui(e){const t=`${si}.`;if(!e.startsWith(t))return e;return`${t}${e.slice(t.length).toLowerCase().replace(/^rokt\./,"").replace(/[_-]/g,"")}`}function pi(e){const t=new Map,n=new Map,i=new Set;for(const[a,o]of e){if("string"!=typeof o)continue;if(!a.startsWith(`${si}.`))continue;const e=ui(a),r=n.get(e);void 0===r||r===o?(n.set(e,o),e!==a&&t.set(e,o)):i.add(e)}for(const e of i)t.delete(e);return t}const fi=Symbol("invalid");function hi(e,t="creativeCopy"){const n=vi({data:e},t),i=new Map;return function e(t,n){if("string"!=typeof t){const i=vi(t,n,this.dataMap),a="attribute"in t;return e.bind({dataMap:i,attributeAliases:a?pi(i):this.attributeAliases,hasAttributeData:this.hasAttributeData||a})}let i=!1;const o=t,r=a.pipe(a.slice(2,-2),a.split("|"),(e=>a.reduce(((e,t)=>{var n;let i;if(li.test(t)){const o=function(e){const t=[];let n="",i=0;for(const a of e)"["===a?i++:"]"===a&&i--,":"===a&&0===i?(t.push(n),n=""):n+=a;return t.push(n),t}(t),r=o[0];if(r){if(i=null!==(n=this.dataMap.get(r))&&void 0!==n?n:this.attributeAliases.get(ui(r)),i&&i===fi)throw new Y(Ln,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(o.length>1&&i)try{i=ei(r,o.slice(1),i)}catch(e){throw new Y(Ln,`Failed to apply meta attributes. ${function(e){return null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:String(e)}(e)}`)}}return i?a.reduced({provided:!0,value:i}):e}return a.reduced({provided:!0,value:t})}),{provided:!1,value:""},e))),s=a.replace(di,(e=>{const t=ci.test(e.slice(2));if(t&&!this.hasAttributeData)return e;const n=r(e);return n.provided?n.value:t?e:(i=!0,n.value)}),o);return!1===i?s:""}.bind({dataMap:n,attributeAliases:i,hasAttributeData:!1})}function vi(e,t,n){const i=new Map(n);return"data"in e&&o(e.data,`${oi}${t?"."+t:""}`),"state"in e&&o(e.state,`${ri}${t?"."+t:""}`),"attribute"in e&&o(e.attribute,`${si}${t?"."+t:""}`),i;function o(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?i.set(t,(null==e?void 0:e.toString())||""):i.set(t,fi),e&&"object"==typeof e&&a.forEachObjIndexed(((e,n)=>o(e,`${t}.${n}`)),e)}}const yi=t.createContext(hi({})),mi=yi.Consumer,Ci=yi.Provider,gi=()=>t.useContext(yi),bi=t.createContext(null),Ei=bi.Provider,Ii=t.createContext("OUTER"),xi=()=>"VARIANT"===t.useContext(Ii),Li=t.createContext(void 0),Di=()=>t.useContext(Li);var wi,Si,Ai,Oi,Ti,ji,ki,Mi=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))},Ri=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Vi=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};class Hi{constructor(e,t,n,i,o,r,s,l){wi.set(this,void 0),Si.set(this,void 0),Ai.set(this,new Set),Oi.set(this,void 0),Ti.set(this,void 0),ji.set(this,void 0),ki.set(this,void 0),l&&(this.launchContinuousChild=e=>l.launch(n,e),this.registerContinuousResponseHandler=e=>{const t=l.register(n,e),i=()=>{t(),Ri(this,Ai,"f").delete(i)};return Ri(this,Ai,"f").add(i),i}),Vi(this,wi,a.partial(e.subscribe.bind(e),[n]),"f"),Vi(this,Si,a.partial(e.dispatch.bind(e),[n]),"f"),Vi(this,Oi,t,"f"),Vi(this,Ti,i,"f"),Vi(this,ji,o,"f"),Vi(this,ki,r,"f"),this.scrollHostToViewportOffset=s,this.onGlobalStateChange=this.onGlobalStateChange.bind(this),this.onInteractivityChange=this.onInteractivityChange.bind(this),this.onEvent=this.onEvent.bind(this),this.globalDispatch=this.globalDispatch.bind(this),this.createChildPlugin=this.createChildPlugin.bind(this)}onGlobalStateChange(e){const t=Ri(this,wi,"f").call(this,e),n=()=>{t(),Ri(this,Ai,"f").delete(n)};return Ri(this,Ai,"f").add(n),n}onInteractivityChange(e){return Ri(this,Ti,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=Ri(this,ji,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),Ri(this,Ai,"f").delete(n)};return Ri(this,Ai,"f").add(n),n}globalDispatch(e){Ri(this,Si,"f").call(this,e)}dispose(){Ri(this,Ai,"f").forEach((e=>e())),Vi(this,Ai,new Set,"f"),Ri(this,Ti,"f").clear()}createChildPlugin(e){return"dcui-child"===e.name&&Ri(this,ki,"f")&&e.config?Ri(this,Oi,"f").call(this,Object.assign(Object.assign({},e),{config:Object.assign(Object.assign({},e.config),{fonts:Ri(this,ki,"f").call(this)})})):Ri(this,Oi,"f").call(this,e)}}wi=new WeakMap,Si=new WeakMap,Ai=new WeakMap,Oi=new WeakMap,Ti=new WeakMap,ji=new WeakMap,ki=new WeakMap;class Pi{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>Mi(this,void 0,void 0,(function*(){})),onClose:()=>Mi(this,void 0,void 0,(function*(){})),putConfig:()=>Mi(this,void 0,void 0,(function*(){})),send:()=>Mi(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var _i,Ni,Fi=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},$i=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Zi{constructor(e){_i.set(this,void 0),Ni.set(this,new Set),Fi(this,_i,e,"f")}subscribe(e){return $i(this,Ni,"f").add(e),!0===e($i(this,_i,"f"))&&$i(this,Ni,"f").delete(e),()=>{$i(this,Ni,"f").delete(e)}}publish(e){Fi(this,_i,e,"f"),$i(this,Ni,"f").forEach((e=>{!0===e($i(this,_i,"f"))&&$i(this,Ni,"f").delete(e)}))}clear(){$i(this,Ni,"f").clear()}}_i=new WeakMap,Ni=new WeakMap;var Gi=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Bi=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};const Ui="breakpoint-0px";class zi{constructor(){this.logger=()=>{}}withAppFactory(e){return this.appFactory=e,this}withLogger(e){return this.logger=e,this}withGatewayFactory(e){return this.gatewayFactory=e,this}build(){var e,t,n,i,a,o,r,s,l,c,d,u,p,f,h,v,y,m,C,g,b,E,I,x,L,D,w,S;const A=this.appFactory,O=this.logger,T=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new Pi;return S=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint","measurement-occluded"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.set(this,void 0),o.set(this,!1),r.set(this,!1),s.set(this,(()=>null)),l.set(this,!1),c.set(this,null),d.set(this,null),u.set(this,null),p.set(this,null),f.set(this,null),h.set(this,null),v.set(this,!1),y.set(this,null),m.set(this,null);const e=this.attachShadow({mode:"open"});Bi(this,a,document.createElement("div"),"f"),Gi(this,a,"f").id="app-container",Gi(this,a,"f").classList.add("default"),e.appendChild(Gi(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":Gi(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Gi(this,i,"f").call(this,o);break;case"measurement-occluded":Gi(this,s,"f").call(this);break;case"active-breakpoint":Gi(this,t,"m",C).call(this,o,a)}}makeInteractivityUpdateHandler(e){Bi(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),l=this.getAttribute("slotInstanceGuid");if(Bi(this,r,"true"===this.getAttribute("continuous-measurement"),"f"),Gi(this,r,"f")){let o=!1;const r=()=>{const n="true"===this.getAttribute("visible"),r="true"===this.getAttribute("measurement-occluded");if(n&&!o&&(o=!0,0===e&&a.globalDispatch({type:Ee,payload:{event:"Interactive"}}),l&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:l}})),!n||r)return Gi(this,t,"m",I).call(this,i,a),void Gi(this,t,"m",E).call(this);i&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:i}}),i&&Gi(this,t,"m",w).call(this,i,a)};return Bi(this,s,r,"f"),Bi(this,n,r,"f"),void r()}Bi(this,n,(o=>{o?(Bi(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:Ee,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:i}}),Gi(this,t,"m",w).call(this,i,a)),l&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:l}})):Gi(this,t,"m",E).call(this)}),"f"),Gi(this,n,"f").call(this,o)}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&j(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e,t="{}"){const n=this.getAttribute(e);try{return JSON.parse(null!=n?n:t)}catch(t){j(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){Gi(this,t,"m",E).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");Gi(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),{layoutSchema:l,variantTimers:c}=function(e){var t;return"LayoutVariantRoot"===e.type?{layoutSchema:e.node.layout,variantTimers:null!==(t=e.node.timers)&&void 0!==t?t:void 0}:{layoutSchema:e}}(s),d=this.getJSONAttr("childLayouts","[]"),u=this.getJSONAttr("offerData"),p=new Zi("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),f=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",h=this.getJSONAttr("offerState","{}");A||j("Cannot create app without factory. Please build the connector withAppFactory.");const v=T({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==u?void 0:u.creative)||void 0===t?void 0:t.instanceGuid},p);this.makeInteractivityUpdateHandler(p),A({rootElement:Gi(this,a,"f"),gateway:v,logger:O,offerPositionIndex:r,offerData:u,layoutSchema:l,childLayouts:d,schemaVersion:f,pluginId:o||H.pluginId,offerState:h,variantTimers:c}),this.makeVisbilityUpdateHandler(r,null===(n=null==u?void 0:u.creative)||void 0===n?void 0:n.instanceGuid,v)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,h=new WeakMap,v=new WeakMap,y=new WeakMap,m=new WeakMap,t=new WeakSet,C=function(e,t){Gi(this,a,"f").classList.remove(t||Ui),Gi(this,a,"f").classList.add(e||Ui)},g=function(){Gi(this,p,"f")&&(clearTimeout(Gi(this,p,"f")),Bi(this,p,null,"f"))},b=function(e){Gi(this,t,"m",g).call(this),Bi(this,p,window.setTimeout(e,1e3),"f")},E=function(){Gi(this,t,"m",g).call(this),Gi(this,t,"m",L).call(this),Gi(this,u,"f")&&(Gi(this,u,"f").disconnect(),Bi(this,u,null,"f")),Gi(this,f,"f")&&(document.removeEventListener("visibilitychange",Gi(this,f,"f")),Bi(this,f,null,"f")),Gi(this,y,"f")&&(window.removeEventListener("beforeunload",Gi(this,y,"f")),Bi(this,y,null,"f")),Gi(this,m,"f")&&(Gi(this,a,"f").removeEventListener("click",Gi(this,m,"f")),Bi(this,m,null,"f")),Bi(this,v,!1,"f"),Bi(this,h,null,"f")},I=function(e,t){if(!Gi(this,v,"f")||null==Gi(this,h,"f"))return;const n=Gi(this,h,"f"),i=Date.now();if(i<=n)return Bi(this,v,!1,"f"),void Bi(this,h,null,"f");t.globalDispatch({type:be,payload:{name:"SignalUserInteraction",parentGuid:e,action:"ViewabilityDurationTracking",context:"Offer Visibility Duration",objectData:{startTimestamp:n.toString(),endTimestamp:i.toString()}}}),Bi(this,v,!1,"f"),Bi(this,h,null,"f")},x=function(e,n){Gi(this,l,"f")||Gi(this,c,"f")||!("ResizeObserver"in window)||(Bi(this,c,new ResizeObserver((i=>{var a;if(Gi(this,l,"f"))return;const o=i[0];if(!o)return;const r=null===(a=o.borderBoxSize)||void 0===a?void 0:a[0],s=r?r.inlineSize:o.contentRect.width,c=r?r.blockSize:o.contentRect.height;0!==s&&0!==c&&(Gi(this,t,"m",D).call(this),Bi(this,d,window.setTimeout((()=>{Bi(this,l,!0,"f"),Gi(this,t,"m",L).call(this),window.requestAnimationFrame((()=>{n.globalDispatch({type:be,payload:{name:"SignalRenderGeometry",parentGuid:e,objectData:{widthPx:Math.round(s),heightPx:Math.round(c)}}})}))}),250),"f"))})),"f"),Gi(this,c,"f").observe(Gi(this,a,"f")))},L=function(){Gi(this,t,"m",D).call(this),Gi(this,c,"f")&&(Gi(this,c,"f").disconnect(),Bi(this,c,null,"f"))},D=function(){Gi(this,d,"f")&&(clearTimeout(Gi(this,d,"f")),Bi(this,d,null,"f"))},w=function(e,n){if(Gi(this,o,"f")&&!Gi(this,r,"f"))return;const i=this.getAttribute("slotInstanceGuid");i&&Gi(this,t,"m",x).call(this,i,n);const s=Gi(this,r,"f")&&"true"===this.getAttribute("expanded-owns-viewability");if(!("IntersectionObserver"in window)){if(s||Gi(this,o,"f"))return;return n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),void Bi(this,o,!0,"f")}Gi(this,u,"f")||(Bi(this,u,new IntersectionObserver((i=>{i.forEach((i=>{(!Gi(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(i.isIntersecting&&i.intersectionRatio>=.5?(s||Gi(this,o,"f")||Gi(this,t,"m",b).call(this,(()=>{Gi(this,o,"f")||Gi(this,r,"f")&&("true"===this.getAttribute("measurement-occluded")||"true"!==this.getAttribute("visible")||"hidden"===document.visibilityState)||(n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),Bi(this,o,!0,"f"))})),Gi(this,v,"f")||(Bi(this,h,Date.now(),"f"),Bi(this,v,!0,"f"))):(Gi(this,t,"m",g).call(this),Gi(this,v,"f")&&Gi(this,t,"m",I).call(this,e,n)))}))}),{threshold:.5}),"f"),Gi(this,u,"f").observe(Gi(this,a,"f")),Bi(this,m,(()=>{(!Gi(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(s||Gi(this,o,"f")||(n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),Bi(this,o,!0,"f"),Gi(this,t,"m",g).call(this)),Gi(this,v,"f")&&Gi(this,t,"m",I).call(this,e,n))}),"f"),Gi(this,a,"f").addEventListener("click",Gi(this,m,"f")),Bi(this,f,(()=>{Gi(this,u,"f")&&("hidden"===document.visibilityState?(Gi(this,t,"m",g).call(this),Gi(this,v,"f")&&Gi(this,t,"m",I).call(this,e,n),Gi(this,u,"f").unobserve(Gi(this,a,"f"))):"visible"===document.visibilityState&&Gi(this,u,"f").observe(Gi(this,a,"f")))}),"f"),document.addEventListener("visibilitychange",Gi(this,f,"f")),Bi(this,y,(()=>{Gi(this,v,"f")&&Gi(this,t,"m",I).call(this,e,n)}),"f"),window.addEventListener("beforeunload",Gi(this,y,"f")))},S;function j(e){throw O({level:q,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const qi=t.createContext({get:()=>new Pi}),Ki=t=>e.jsx(qi.Provider,{value:{get:()=>t.context},children:t.children});const Wi=t.createContext({get(){throw Error("Layout Schema context has not been set")}}),Yi=t=>e.jsx(Wi.Provider,{value:{get:()=>t.context},children:t.children}),Ji=()=>t.useContext(Wi).get(),Xi=t.createContext("ENABLED"),Qi=()=>t.useContext(Xi);function ea(e){const t=na(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:na(t,this.dataMap)});if(!n)throw new Y("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");const i=t;return a.path([n,i],this.dataMap)}.bind({dataMap:t})}const ta={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function na(e,t=ta){return["images","links","icons","copy","responseOptionsMap"].reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},t[n]),e[n])})),t)}const ia=t.createContext(ea({}));ia.Consumer;const aa=ia.Provider,oa=e=>{const n=t.useContext(ia),i=e.split("|");for(const e of i){const t=n(e.trim(),"images");if(t)return t}},ra=()=>t.useContext(ia),sa=t.createContext({});function la({info:n,children:i}){const a=t.useContext(sa);return e.jsx(sa.Provider,{value:Object.assign(Object.assign({},a),n),children:i})}const ca=t.createContext({get(){throw Error("Catalog Item context has not been set")}}),da=t=>e.jsx(ca.Provider,{value:{get:()=>t.context},children:t.children}),ua=()=>t.useContext(ca).get(),pa=t.createContext(""),fa=()=>t.useContext(pa),ha=t.createContext(""),va=t.createContext(void 0);function ya({children:n}){const i=t.useMemo((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return e.jsx(va.Provider,{value:i,children:n})}const ma=t.createContext(!0),Ca=t.createContext(null),ga=Ca.Provider,ba=t.createContext(null);function Ea(n){const[i,a]=t.useState({}),o=t.useRef([]),r=t.useContext(qi).get().scrollHostToViewportOffset;function s(e){if(e in i)return[e];const t=`${e}-`;return Object.keys(i).filter((e=>e.startsWith(t)))}return e.jsx(ba.Provider,{value:{registerValidators:function(e,t,n){a((i=>Object.assign(Object.assign({},i),{[e]:{validators:t,isValid:!0,element:n}})))},validateFieldKeys:function(e){const t={},n=[];let r=!0;const l=e.flatMap(s);if(0===l.length)return o.current=[],!1;for(const e of l){const a=i[e];if(a){const i=Object.assign({},a),o=a.validators.every((e=>e()));o!==i.isValid&&(t[e]=Object.assign(Object.assign({},i),{isValid:o})),!o&&a.element&&n.push(a.element),r&&(r=o)}else r=!1}return o.current=n,Object.values(t).length>0&&a((e=>Object.assign(Object.assign({},e),t))),r},getFieldKeyValidity:function(e){const t=s(e);return 0!==t.length&&t.every((e=>{var t,n;return null!==(n=null===(t=i[e])||void 0===t?void 0:t.isValid)&&void 0!==n&&n}))},focusFirstInvalidField:function(){var e;const t=o.current.filter((e=>e.isConnected)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))[0];if(t){if(null===(e=t.scrollIntoView)||void 0===e||e.call(t,{behavior:r?"instant":"smooth",block:"center"}),r){const e=t.getBoundingClientRect();r(e.top+e.height/2)}t.focus({preventScroll:!0})}}},children:n.children})}function Ia(){const e=t.useContext(ba);if(!e)throw new Error("useValidator must be used within a ValidatorProvider");return e}function xa(e,n,i){const a=Ia();t.useEffect((()=>{var t;e&&a.registerValidators(e,n,null!==(t=null==i?void 0:i.current)&&void 0!==t?t:void 0)}),[e,n.length,i])}function La(e,t){return t?t.validators.map((t=>e[t])).filter((e=>void 0!==e)):[]}const Da=a.compose(a.anyPass([a.isEmpty,a.all(a.isEmpty)]),a.flatten,a.map(a.values),a.map(a.ifElse(a.isNil,a.always({}),a.identity)),a.values,a.propOr({},"value")),wa=a.compose(a.isEmpty,a.prop("predicates"));function Sa(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const Aa=a.curry(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(xn(i)),transitionBaseClassname:e(Sa(t,(o=i,a.toPairs(o).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?a.keys(n).map((e=>kt(t,e))):[]})))))};var o})),Oa=a.anyPass([Da,wa]);function Ta(e){return e.value!==e.defaultValue}function ja(e,t){const n=function(e,t){return B(t,[e]).flatMap((({formKey:e,fieldKey:n})=>{var i;const a=null===(i=t[e])||void 0===i?void 0:i[n];return a&&F(a)?a:[]}))}(e.key,t);switch(e.state){case"is-valid":return n.length>0&&n.every((e=>e.validated&&e.valid));case"is-invalid":return n.some($);case"is-touched":return n.some((e=>e.touched));case"is-untouched":return n.every((e=>!e.touched));case"is-dirty":return n.some(Ta);case"is-pristine":return n.every((e=>!Ta(e)));default:return!1}}const ka={is:a.equals,"is-not":a.compose(a.not,a.equals),"is-below":a.lt,"is-above":a.gt};function Ma(e,t){return e.includes(t)}const Ra={is:a.equals,"is-not":a.compose(a.not,a.equals),exists:Ma,"not-exists":a.compose(a.not,Ma)},Va={exists:a.compose(a.not,a.either(a.isNil,a.isEmpty)),"not-exists":a.either(a.isNil,a.isEmpty)},Ha={"is-true":a.equals(!0),"is-false":a.equals(!1)},Pa={is:a.equals,"is-not":a.compose(a.not,a.equals)};function _a(e){return(t,n)=>n[e]}const Na=a.cond([[(e,t)=>a.equals("Breakpoint",e),_a("activeBreakpoint")],[(e,t)=>a.equals("Progression",e),_a("progressionIndex")],[(e,t)=>a.equals("Position",e),_a("positionIndex")]]);function Fa(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const $a=a.cond([[(e,t,n)=>a.equals("Breakpoint",e),(e,t,n)=>{const i=a.lensPath(["breakpoints",t]);return a.pipe(a.over(i,Number),a.view(i))(n)}],[(e,t,n)=>a.equals("Progression",e),(e,t,n)=>a.cond([[a.gt(0),a.add(n.totalGroups)],[a.lte(0),a.identity]])(Number(t))],[(e,t,n)=>a.equals("Position",e),(e,t,n)=>a.cond([[a.gt(0),a.add(n.totalOffers)],[a.lte(0),a.identity]])(Number(t))]]),Za=a.compose(a.not,isNaN);function Ga(e,t){return e.map((e=>{var n,i,a,o;switch(e.type){case"StaticString":return(0,Pa[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Va[e.predicate.condition])(Fa(t,e.predicate.value));case"StaticBoolean":return(0,Ha[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,ka[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,ka[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"OnFirstEvent":return null!==(a=t.firedEvents[e.predicate.event])&&void 0!==a&&a;case"FormState":return ja(e.predicate,t.formStates);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,Ra[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,ka[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,ka[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=ka[e.predicate.condition],i=null!==(o=Na(e.type,t))&&void 0!==o?o:NaN,a=$a(e.type,e.predicate.value,t);return!!Za(i)&&n(i,a)}}}))}function Ba(e){return a.pathOr(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const Ua={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{},firedEvents:{},formStates:{}};function za(e,t,n,i){const o=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:r,uncached:s}=o.reduce(((t,i)=>function(e,t,n,i){if("FormState"===e.type)return a.evolve({cached:a.append(ja(e.predicate,t.formStates))},i);const o=function(e,t){var n;switch(e.type){case"Position":case"StaticBoolean":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"StaticString":return`${e.type}:${e.predicate.input}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"CreativeCopy":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${Fa(t,e.predicate.value)}:${t.totalGroups}`;case"CustomState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.customStates[e.predicate.key]}`;case"DomainState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.domainStates[e.predicate.key]}`;case"Placeholder":return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;case"OnFirstEvent":return`${e.type}:${e.predicate.event}:state:${null!==(n=t.firedEvents[e.predicate.event])&&void 0!==n&&n}`;case"FormState":throw new Error("FormState predicates bypass the When result cache (see groupByCache)");default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${Na(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(o);return a.evolve(qa(r)?{cached:a.append(r)}:{uncached:a.append({key:o,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),l=Ga(s.map((({predicate:e})=>e)),n);return a.zip(s,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(l)}const qa=a.is(Boolean);const Ka=a.curry(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:Ba(n),progressionIndex:null!==(a=null===(i=n.progression)||void 0===i?void 0:i.activeGroupIndex)&&void 0!==a?a:0,totalOffers:null!==(r=null===(o=n.progression)||void 0===o?void 0:o.totalOffers)&&void 0!==r?r:0,totalGroups:null!==(l=null===(s=n.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:0,customStates:n.customStates,domainStates:n.domainStates,firedEvents:n.firedEvents,formStates:n.formStates,positionIndex:e,creativeCopy:t}})),Wa=a.lensPath(["predicate","content","input"]),Ya=a.lensPath(["predicate","content","value"]),Ja=a.lensPath(["predicate","key"]);function Xa(e,t){const n=a.over(Wa,(t=>t?e(t):"")),i=a.over(Ya,(t=>"string"==typeof t?e(t):t)),o=a.compose(n,i),r=a.over(Ja,(t=>t?e(t):""));return t.map((e=>{switch(e.type){case"Placeholder":return"TextValue"===e.predicate.type?o(e):n(e);case"CustomState":return r(e);default:return e}}))}const Qa=a.all(a.equals(!0));function eo(e){const n=xi(),i=Di(),a=t.useRef(new Map),o=Wn(),r=Nn(Ua,Ka(i,o)),s=Xa(gi(),e);return t.useMemo((()=>Qa(za(a,s,r,n))),[a,s,r,n])}function to(e){const n=xi(),i=Di(),o=t.useRef(new Map),r=Wn(),s=Nn(Ua,Ka(i,r)),l=gi();return t.useMemo((()=>a.mapObjIndexed((e=>{const t=Xa(l,e);return Qa(za(o,t,s,n))}),e)),[o,e,s,n,l])}function no(e){e&&(e.style.display="")}function io(e){e&&(e.style.display="none")}function ao(e){return e.settings.duration}const oo=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],ro=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function so(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?oo:ro,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?no(e):io(e)},a.oncancel=()=>{t?no(e):io(e)},()=>{a.finish()}}return t?no(e):io(e),()=>{}}function lo({inTransitions:n,outTransitions:i,visible:a,children:o,containerClassName:r}){const s=t.useRef(null);return t.useEffect((()=>a&&n?n.forEach((e=>{s.current&&function(e,t,n,i){if("FadeIn"===i)so(e,t,n)}(s.current,a,ao(e),e.type)})):!a&&i?i.forEach((e=>{s.current&&function(e,t,n,i){if("FadeOut"===i)so(e,t,n)}(s.current,a,ao(e),e.type)})):()=>{}),[a]),e.jsx("div",{ref:s,style:{display:"none"},className:r,children:o})}function co(n){const i=Zn(),a=eo(n.schema.predicates),o=t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,n.testId?`${n.testId}-child${t}`:void 0))));return n.schema.transition?e.jsx(lo,{inTransitions:n.schema.transition.inTransition,outTransitions:n.schema.transition.outTransition,visible:a,children:o}):"functionally"===n.schema.hide?e.jsx(Xi.Provider,{value:a?"ENABLED":"DISABLED",children:o}):a?e.jsx(e.Fragment,{children:o}):null}const uo=a.mergeWith(((e,t)=>`${e||""} ${t||""}`.trim())),po=e=>{var n;const i=t.useContext(bi),o=Di(),r=Un()||document.head,s=fa(),l=On(s,o,r),c=t.useCallback(Mn,[]),d=Nn([],(e=>Object.values(e.breakpoint.breakpoints))),u=i||c(d,s,o,r),p=e.styles?u(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=Aa(e);return a.mapObjIndexed((e=>Oa(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(l,null===(n=e.styles)||void 0===n?void 0:n.conditionalTransitions):void 0,h=to(f?a.mapObjIndexed(a.propOr([],"predicates"),f):{}),v=a.mapObjIndexed(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(f,t):void 0),h),y=f?a.mapObjIndexed(a.prop("transitionBaseClassname"),f):{},m=e.styles?((e,t,n)=>uo(uo(e,t),n))(p,v,y):void 0;return e.children({classnames:m,mapperRef:u})};function fo(n){const i=Zn();return e.jsx(po,{styles:n.schema.styles,children:({classnames:a})=>{var o;return e.jsx("div",{className:a?a.own:void 0,"data-testid":n.testId,"data-e2e-item":n.e2eItemId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:void 0,children:t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,ce(t,n.testId)))))})}})}function ho(n){const i=Zn();return e.jsx(po,{styles:n.schema.styles,children:({classnames:a})=>{var o;return e.jsx("div",{className:a?a.own:void 0,"data-testid":n.testId,"data-e2e-item":n.e2eItemId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:void 0,children:t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,ce(t,n.testId)))))})}})}const vo={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",ft,ht],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},yo=new Map([["&","_;^;_"]]),mo=new RegExp(`<a *(?=${vo.allowedAttributes.a.join("|")}|>)`,"g"),Co=new RegExp('<a [^>]*href="([^"]+)"',"g"),go=new RegExp("(<br *?>)|(<br *?/>)","g"),bo="<br/>";function Eo(n){const i=gi(),a=Qi(),o=t.useMemo((()=>{const e=i(n.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Co,((e,t)=>{const n=t.replaceAll("&",yo.get("&"));return e.replace(t,n)})).replaceAll(go,bo)}(e);return t===u(t,vo)}(e))throw new Y("FAILED_SANITISING_HTML","Invalid HTML tags");return e.trim()?e:""}),[n.schema.value,i]),{tabIndex:r,styles:s,isDisabled:l}=b(a),{setRef:c,maskStyle:d}=It("vertical",xt(n.schema.styles));return o?e.jsx(po,{styles:n.schema.styles,children:({classnames:t})=>{const i=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0)),a=Object.assign(Object.assign({},s),d);return u=o,new RegExp("</(p|ul|ol)>").test(u)?e.jsx("div",{ref:c,tabIndex:r,style:a,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":n.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(mo,`<a ${i.join(" ")}`)}}):e.jsx("p",{ref:c,tabIndex:r,style:a,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":n.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(mo,`<a ${i.join(" ")}`)}});var u}}):null}function Io(t){const n=gi()(t.schema.value),i=Qi(),{tabIndex:a,styles:o,isDisabled:r}=b(i);return n?e.jsx(po,{styles:t.schema.styles,children:({classnames:i})=>{const s={tabIndex:a,"aria-hidden":r,className:null==i?void 0:i.own,"data-testid":t.testId,"data-e2e":"BasicText"};return t.isInline?e.jsx("span",Object.assign({style:o},s,{children:n})):e.jsx("p",Object.assign({style:o},s,{children:n}))}}):null}function xo(t,n,i){if("BasicText"===t.type)return e.jsx(Io,{schema:t.node,testId:n,isInline:null!=i&&i})}function Lo(t,n,i,a,o){return e.jsx(Ei,{value:i(n),children:Do(t,a,o)})}function Do(e,n,i){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,ce(t,i)))))}function wo(n){const i=Pn(),a=Zn(),o=Kn(),r=gi(),s=Di(),l=Qi(),c=o.creative.responseOptionsMap[n.schema.responseKey],d=t.useRef(null),u=t.useRef(!1),p=t.useCallback((()=>{u.current||(d.current=Date.now())}),[]),f=t.useCallback((()=>{const e=d.current;if(null===e)return;const t=Date.now(),a="positive"===n.schema.responseKey?"-Positive":"-Negative";t>e&&i({type:be,payload:{name:"SignalUserInteraction",action:"Hover",context:`CreativeResponse${a}`,parentGuid:o.creative.instanceGuid,objectData:{startTimestamp:e.toString(),endTimestamp:t.toString()}}}),u.current=!1,d.current=null}),[i,o.creative.instanceGuid,n.schema.responseKey]),h=A(c);t.useEffect((()=>{h&&i(function(e){if(e.paymentTriggerConfig)return{type:je,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:j(e.signalType),parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:"PAYMENT_OFFER_SELECTED"}}}};throw new Error(`Invalid External Response: No 'paymentTriggerConfig' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,i,h]);const v=c?r({data:c},"creativeResponse"):r,{tabIndex:y,styles:m,isDisabled:C}=b(l);return L(c)&&!h&&void 0!==s?e.jsx(po,{styles:n.schema.styles,children:({classnames:t,mapperRef:r})=>e.jsx("button",{type:"button",tabIndex:y,"aria-disabled":C,"aria-label":n.schema.a11yLabel?v(n.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},m),"data-testid":n.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":n.schema.responseKey,onMouseOver:p,onMouseLeave:f,onClick:e=>{e.preventDefault(),f();const t=ge(o,c,n.schema.openLinks);i({type:ue,payload:t})},className:null==t?void 0:t.own,disabled:C,children:e.jsx(Ci,{value:v,children:(null==t?void 0:t.own)?Lo(n.schema.children,t.own,r,a,n.testId):Do(n.schema.children,a,n.testId)})})}):null}function So(t){const n=Qi(),{styles:i,isDisabled:a}=b(n);return t.schema.url.light?e.jsx(po,{styles:g(t.schema.styles),children:({classnames:n})=>e.jsx("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:a?void 0:t.schema.alt||void 0,title:t.schema.title||void 0,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"StaticImage",src:t.schema.url.light})}):null}function Ao(t){const n=Qi(),{styles:i,isDisabled:a}=b(n),o=oa(t.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?e.jsx(po,{styles:g(t.schema.styles),children:({classnames:n})=>e.jsx("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"DataImage",src:o.light})}):null;var r}const Oo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function To(t){const n=t.schema.name,i=t.schema.description,a=t.schema.styles?se(Oo,t.schema.styles):Oo,o=Qi(),{styles:r,isDisabled:s}=b(o);return n?e.jsx(po,{styles:a,children:({classnames:a})=>e.jsx("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==a?void 0:a.own)?" "+a.own:""),"data-testid":t.testId,"data-e2e":`StaticIcon-${n}`},!s&&i?{title:i}:{"aria-hidden":"true"},{children:n}))}):null}function jo(t,n){if("StaticIcon"===t.type)return e.jsx(To,{schema:t.node,testId:n})}const ko={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Mo extends t.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===wt.REPORT_RENDER_ERRORS&&this.props.reporter({level:q,code:null!==(n=e.code)&&void 0!==n?n:"UNHANDLED_RENDERING_EXCEPTION",message:e.message,additionalInformation:Object.assign({componentStack:t.componentStack,stack:e.stack},this.context||{})})}render(){return this.state.errorMessage?"true"===wt.DISPLAY_ERRORS?e.jsxs("pre",{style:ko,children:[e.jsx("strong",{children:"Error:"})," [",e.jsx("em",{children:this.props.schema.type}),"]"," ",this.state.errorMessage]}):void 0:this.props.children}}Mo.contextType=sa;const Ro={internally:"_top",externally:"_blank"};function Vo(t,n,i,a,o){return e.jsx(Ei,{value:i(n),children:Ho(t,a,o)})}function Ho(e,n,i){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,i?`${i}-child${t}`:void 0))))}function Po(t){var n;const i=Ro[t.schema.open],a=Zn(),o=Qi(),{tabIndex:r,styles:s,isDisabled:l}=b(o);return(null===(n=t.schema.children)||void 0===n?void 0:n.length)>0?e.jsx(po,{styles:t.schema.styles,children:({classnames:n,mapperRef:o})=>{var c;return e.jsx("a",{href:t.schema.src,"data-testid":t.testId,"data-e2e":"StaticLink",target:null!=i?i:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=t.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:t.isInline?"inline":"block"},s),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Vo(t.schema.children,null==n?void 0:n.own,o,a,t.testId):Ho(t.schema.children,a,t.testId)})}}):null}function _o(t,n,i){if("StaticLink"===t.type)return e.jsx(Po,{schema:t.node,testId:n,isInline:null!=i&&i})}const No={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Fo(n){const i=(a=n.schema.iconKey,t.useContext(ia)(a,"icons"));var a;const o=null==i?void 0:i.name,r=n.schema.styles?se(No,n.schema.styles):No,s=Qi(),{styles:l}=b(s);return o?e.jsx(po,{styles:r,children:({classnames:t})=>e.jsx("span",{style:Object.assign(Object.assign({},l),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":n.testId,"data-e2e":`DataIcon-${o}`,children:o})}):null}function $o(n){const i=Zn(),a=t.useRef(null),r=fa(),s=Di(),l=Un(),c=(l?On(r,s,l):o.css)`
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom/client"),i=require("react-redux"),a=require("ramda"),o=require("@emotion/css"),r=require("redux-saga/effects"),s=require("redux-saga"),l=require("@reduxjs/toolkit"),c=require("@redux-saga/core/effects"),d=require("embla-carousel-react"),u=require("insane"),p=require("@emotion/css/create-instance"),f=require("embla-carousel-autoplay"),h=require("embla-carousel-fade");function v(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y,m,C=v(t);function g(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],o=["default","dimension","minWidth"],r=a.path(t,e);return r&&Array.isArray(r)&&r.length?a.assocPath(t,r.map(a.when(a.allPass([a.hasPath(n),a.complement(a.hasPath(o)),a.pathEq("fixed",n)]),(e=>a.assocPath(o,a.path(i,e),e)))),e):e}function b(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function E(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function I(){return"ontouchstart"in document.documentElement}function x(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function L(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function D(e){return L(e)&&"Fulfillment"===e.action}function w(e){return L(e)&&"Url"===e.action}function S(e){return L(e)&&"CaptureOnly"===e.action}function A(e){return L(e)&&"ExternalPaymentTrigger"===e.action}function O(e){return(D(e)||w(e))&&"RealTime"===e.conversionType&&"rclid"in e}function T(e){return(D(e)||w(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}function j(e){switch(e){case"SignalGatedResponse":return"SignalGatedResponse";case"SignalOptInResponse":return"SignalOptInResponse";case"SignalOptOutResponse":return"SignalOptOutResponse";default:return"SignalResponse"}}function k(e){return e.slice(e.lastIndexOf(":")+1)}function M(e){return{oldCartItem:null,cartItem:{cartItemId:e,catalogItemId:"",name:"",description:"",quantity:0,unitPrice:0,totalPrice:0,currency:"",providerData:""}}}!function(e){e.Unknown="Unknown",e.InStock="InStock",e.OutOfStock="OutOfStock"}(y||(y={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Other=1]="Other",e[e.Card=2]="Card",e[e.PayPal=3]="PayPal",e[e.ApplePay=4]="ApplePay",e[e.GooglePay=5]="GooglePay",e[e.Afterpay=6]="Afterpay"}(m||(m={}));const R="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function V(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"string"==typeof e.cartItemId&&"quantity"in e&&"number"==typeof e.quantity&&!("unitPrice"in e)}const H={pluginId:"shared",pageInstanceGuid:"N/A"},P="offerComplete",_="checkout",N="layoutMinimized";function F(e){return e.registrationCount>0}function $(e){return e.validated&&!e.valid&&e.errorVisible}function Z(e,t=[]){const n=0===e.trim().length;for(const i of t){if(n&&"Required"!==i.type)continue;const t=G(e,i);if(t)return t}return""}function G(e,t){switch(t.type){case"Required":return 0===e.trim().length?t.value.message:"";case"MinLength":return e.length<t.value.length?t.value.message:"";case"MaxLength":return e.length>t.value.length?t.value.message:"";case"Pattern":return function(e,t){try{return new RegExp(t).test(e)}catch(e){return!0}}(e,t.value.pattern)?"":t.value.message;default:return""}}function B(e,t){return t.flatMap((t=>{var n;const i=t.indexOf(".");if(-1===i){const i=null!==(n=e[t])&&void 0!==n?n:{};return Object.entries(i).filter((([,e])=>F(e))).map((([e])=>({formKey:t,fieldKey:e})))}return[{formKey:t.slice(0,i),fieldKey:t.slice(i+1)}]}))}var U;!function(e){e.DCUI="DCUI",e.Partner="partner"}(U||(U={}));const z=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction","SignalOptInResponse","SignalOptOutResponse"],q="ERROR",K="INFO",W="WARNING";class Y extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const J=["V2_CART_ITEM_UPDATED","UPDATE_CART_ITEM_MESSAGE","CART_ITEM_INSTANT_PURCHASE","UPSELL_ITEM_INSTANT_PURCHASE","DELIVERY_DETAILS_SENT","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","INITIATE_INSTANT_PURCHASE_EVENT","INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT","INITIATE_CART_ITEM_EVENT","PREPARE_DEVICE_PAY_EVENT","INITIATE_DEVICE_PAY_EVENT","ABORT_DEVICE_PAY_EVENT","COMPLETE_DEVICE_PAY_EVENT","LEAD_CAPTURE_SUBMITTED","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];function X(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];return"positive"===t&&w(n)&&n.isPositive&&"string"==typeof n.url&&n.url.trim()&&"SignalSecondaryResponse"!==n.signalType&&(void 0===n.conversionType||"Default"===n.conversionType)?n:void 0}function Q(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];if(n&&Boolean(n.isPositive)===("positive"===t)&&"SignalSecondaryResponse"!==n.signalType)return S(n)?n:!w(n)||"negative"!==t||void 0!==n.conversionType&&"Default"!==n.conversionType?X(e,t):n}const ee=(e,t)=>a.concat(e,a.slice(e.length,t.length,t)),te=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?ee(t,e):t,i=t.length>e.length?ee(e,t):e;return a.zipWith(re,i,n)}return t},ne=e=>null==e,ie=e=>!ne(e),ae=(e,t)=>ne(t)?e:t,oe=(e,t)=>{throw new Y("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function re(e,t){return a.cond([[(e,t)=>ie(e)&&ie(t)&&a.type(e)!==a.type(t)&&("Object"===a.type(e)||"Object"===a.type(t)),oe],[(e,t)=>ne(e)||ne(t),ae],[(e,t)=>"Object"===a.type(e),a.mergeDeepWith(re)],[(e,t)=>"Array"===a.type(e),te],[a.T,a.flip(a.unary(a.identity))]])(e,t)}function se(e,t){return re(e,t)}function le(e=0){return`breakpoint-${e}px`}function ce(e,t){return t?`${t}-child${e}`:void 0}const de="GLOBAL/RAISE_METRIC",ue="GLOBAL/OFFER_ENGAGEMENT";function pe(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&D(e.responseOption)&&"fulfillment"in e&&x(e.fulfillment)}function fe(e){return A(e)}function he(e){return w(e)}function ve(e){return S(e)}function ye(e){return!!(O(e)||"responseOption"in e&&O(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function me(e){return!!(T(e)||"responseOption"in e&&T(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function Ce(e){return"string"==typeof e&&""!==e?{adID:e}:{}}function ge(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(x(n))return Object.assign({fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId},Ce(e.adId));throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign(Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId}),Ce(e.adId)),{urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}const be="GLOBAL/RAISE_SIGNAL",Ee="GLOBAL/OFFER_LIFECYCLE",Ie=new Set(["__proto__","constructor","prototype"]);function xe(e){return"string"==typeof e&&e.length>0&&!Ie.has(e)}const Le="GLOBAL/SET_CUSTOM_STATE";const De="ProcessingState",we="DevicePayErrorState",Se="applePayUnavailable",Ae="GLOBAL/SEND_PARTNER",Oe="GLOBAL/SET_DOMAIN_STATE",Te="GLOBAL/LAYOUT_EVENT",je="GLOBAL/PREPARE_SIGNAL",ke="GLOBAL/OPEN_LINK",Me="GLOBAL/SET_PARTNER_VALIDATION_STATUS",Re="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",Ve="GLOBAL/LAUNCH_CHILD_LAYOUT",He="GLOBAL/CART_ITEM_EVENT/INITIATE",Pe="GLOBAL/CART_ITEM_EVENT/RESPONSE",_e="OVERLAY/DISMISS_OVERLAY",Ne="plugin-overlay",Fe="GLOBAL/TRIGGER_ACTION";const $e="ERROR/REPORT",Ze="GLOBAL/REGISTER_FORM_FIELD",Ge="GLOBAL/UNREGISTER_FORM_FIELD",Be="GLOBAL/SET_FORM_FIELD_VALUE",Ue="GLOBAL/SET_FORM_FIELD_TOUCHED",ze="GLOBAL/VALIDATE_FORM_FIELDS";function qe(e){const{formKey:t,fieldKey:n}=null!=e?e:{};return xe(t)&&xe(n)}const Ke={RAISE_METRIC:de,PREPARE_SIGNAL:je,OFFER_ENGAGEMENT:ue,RAISE_SIGNAL:be,OFFER_LIFECYCLE:Ee,SEND_PARTNER:Ae,SET_CUSTOM_STATE:Le,SET_DOMAIN_STATE:Oe,LAYOUT_EVENT:Te,OPEN_LINK:ke,SET_PARTNER_VALIDATION_STATUS:Me,SET_GLOBAL_OFFER_DATA_CART:Re,LAUNCH_CHILD_LAYOUT:Ve,INITIATE_CART_ITEM_EVENT:He,CART_ITEM_RESPONSE:Pe,DISMISS_OVERLAY:_e,TRIGGER_ACTION:Fe,REGISTER_FORM_FIELD:Ze,UNREGISTER_FORM_FIELD:Ge,SET_FORM_FIELD_VALUE:Be,SET_FORM_FIELD_TOUCHED:Ue,VALIDATE_FORM_FIELDS:ze,REPORT_ERROR:$e},We="CHILD_LAYOUT/DISPATCH_BEHAVIOR",Ye="CHILD_LAYOUT/STATE_SYNC",Je="CHILD_LAYOUT/READY",Xe="CHILD_LAYOUT/REQUEST_DEVICE_PAY";function Qe(e){return xe(e)&&!e.includes("%^")}const et={[Fe]:function(e){const{action:t}=null!=e?e:{};return"object"==typeof t&&null!==t},[Le]:function(e){const{key:t,value:n}=null!=e?e:{};return xe(t)&&"number"==typeof n&&isFinite(n)},[Ze]:function(e){const{formKey:t,fieldKey:n,defaultValue:i,validations:a}=null!=e?e:{};return xe(t)&&xe(n)&&"string"==typeof i&&Array.isArray(a)},[Ge]:qe,[Be]:function(e){const{formKey:t,fieldKey:n,value:i,validate:a}=null!=e?e:{};return xe(t)&&xe(n)&&"string"==typeof i&&"boolean"==typeof a},[Ue]:qe,[ze]:function(e){const{entries:t}=null!=e?e:{};return Array.isArray(t)&&t.every((e=>"string"==typeof e))}};function tt(e){return"object"==typeof e&&null!==e&&1===e.version&&"payload"in e}const nt="stage"===(it="undefined"==typeof __environment?void 0:__environment.ENVIRONMENT)||"uat"===it||"prod"===it;var it;const at="CONTINUOUS_CHILD/READY",ot="CONTINUOUS_CHILD/PRESENTATION",rt="CONTINUOUS_CHILD/APPLIED",st="CONTINUOUS_CHILD/REQUEST",lt="CONTINUOUS_CHILD/EXPOSURE";function ct(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const dt=e=>"string"==typeof e&&e.trim().length>0&&e.length<=256;function ut(e){return ct(e)&&dt(e.sessionId)&&dt(e.creativeInstanceGuid)&&(void 0===e.childInstanceGuid||dt(e.childInstanceGuid))&&Number.isSafeInteger(e.revision)&&Number(e.revision)>0&&Number.isSafeInteger(e.position)&&Number(e.position)>=0}function pt(e,t){return e.sessionId===t.sessionId&&e.revision===t.revision&&e.position===t.position&&e.creativeInstanceGuid===t.creativeInstanceGuid&&e.childInstanceGuid===t.childInstanceGuid}const ft="data-open-in-app",ht="data-click-signal-context";function vt(e,n){function i(e){var t;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(t=e.target)||void 0===t?void 0:t.closest("a");if(i){const t=i.getAttribute("href"),a=i.getAttribute(ht);if(a&&n({type:be,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),t){e.preventDefault();let a="newTab";i.hasAttribute(ft)?a="inApp":"_top"===i.getAttribute("target")&&(a="self"),n({type:ke,payload:{url:t,urlBehaviour:a}})}}}t.useEffect((()=>null!==e?(e.addEventListener("click",i),()=>{e.removeEventListener("click",i)}):()=>{}),[e])}function yt(){const e=t.useRef(null);return t.useEffect((()=>{const t=t=>{"Tab"===t.key&&mt(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const mt=(e,t)=>{var n;const i=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i)return;const a=i[0],o=i[i.length-1],{activeElement:r}=window.document;if(1!==i.length)return r===a&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(a&&a.focus(),void e.preventDefault());e.preventDefault()},Ct="both",gt="linear",bt={hasOverflow:!1,atStart:!0,atEnd:!0};function Et(e,t){if("horizontal"===t){const t=e.scrollWidth-e.clientWidth;return{hasOverflow:t>0,atStart:e.scrollLeft<=0,atEnd:e.scrollLeft>=t}}const n=function(e){if("undefined"==typeof window)return e.scrollHeight;const t=window.getComputedStyle(e),n=t.webkitLineClamp;if(!n||"none"===n||"normal"===n)return e.scrollHeight;const i=e.style,a={webkitLineClamp:i.webkitLineClamp,display:i.display,overflow:i.overflow,maxHeight:i.maxHeight};i.setProperty("-webkit-line-clamp","unset"),i.display="block",i.overflow="visible",i.maxHeight="none";const o=e.scrollHeight;return i.webkitLineClamp=a.webkitLineClamp,i.display=a.display,i.overflow=a.overflow,i.maxHeight=a.maxHeight,o}(e),i=n-e.clientHeight;return{hasOverflow:i>0,atStart:e.scrollTop<=0,atEnd:e.scrollTop>=i}}function It(e,n){const i=t.useRef(null),[a,o]=t.useState(null),[r,s]=t.useState(bt),l=t.useCallback((e=>{i.current=e,o(e)}),[]),c=!!n;t.useEffect((()=>{if(!a||!c)return;const t=()=>s(Et(a,e));let n;return t(),a.addEventListener("scroll",t,{passive:!0}),"undefined"!=typeof ResizeObserver&&(n=new ResizeObserver(t),n.observe(a),Array.from(a.children).forEach((e=>null==n?void 0:n.observe(e)))),()=>{a.removeEventListener("scroll",t),null==n||n.disconnect()}}),[a,e,c]);const d=t.useMemo((()=>function(e,t,{hasOverflow:n,atStart:i,atEnd:a}){var o,r,s,l,c,d;if(!t||!n)return{};const u=null!==(o=t.edges)&&void 0!==o?o:Ct,p=null!==(r=t.easing)&&void 0!==r?r:gt,f=null!==(s=t.size)&&void 0!==s?s:36,h=null!==(l=t.startSize)&&void 0!==l?l:f,v=null!==(c=t.endSize)&&void 0!==c?c:f,y=("start"===u||"both"===u)&&!i,m=("end"===u||"both"===u)&&!a;if(!y&&!m)return{};const C="horizontal"===e?"to right":"to bottom",g=`linear-gradient(${C},${E=y?function(e,t){switch(e){case"ease-in":return["transparent 0",`transparent ${.3*t}px`,`black ${t}px`];case"ease-out":return["transparent 0",`black ${.7*t}px`,`black ${t}px`];case"ease-in-out":return["transparent 0",`rgba(0,0,0,0.5) ${.5*t}px`,`black ${t}px`];default:return["transparent 0",`black ${t}px`]}}(p,h):["black 0"],I=m?function(e,t){switch(e){case"ease-in":return[`black calc(100% - ${t}px)`,`transparent calc(100% - ${.3*t}px)`,"transparent 100%"];case"ease-out":return[`black calc(100% - ${t}px)`,`black calc(100% - ${.7*t}px)`,"transparent 100%"];case"ease-in-out":return[`black calc(100% - ${t}px)`,`rgba(0,0,0,0.5) calc(100% - ${.5*t}px)`,"transparent 100%"];default:return[`black calc(100% - ${t}px)`,"transparent 100%"]}}(p,v):["black 100%"],[...E,...I].join(",")})`,b=null!==(d=t.clip)&&void 0!==d?d:"border-box";var E,I;return{maskImage:g,WebkitMaskImage:g,maskMode:"alpha",WebkitMaskMode:"alpha",maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskClip:b,WebkitMaskClip:b}}(e,n,r)),[e,n,r]);return Object.assign({ref:i,setRef:l,maskStyle:d},r)}function xt(e){var t,n,i,a,o,r;return null!==(r=null===(o=null===(a=null===(i=null===(n=null===(t=null==e?void 0:e.elements)||void 0===t?void 0:t.own)||void 0===n?void 0:n[0])||void 0===i?void 0:i.default)||void 0===a?void 0:a.container)||void 0===o?void 0:o.scrollMask)&&void 0!==r?r:null}const Lt=a.sortBy(a.prop(1)),Dt=a.map(a.prop(0)),wt="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function St(e,t){return t?"false"!==wt.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${le(e)} ${t.trim()}`:`#app-container.${le(e)} & {${t}}`:"";var n}const At={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"},Ot={selected:'[data-selected="true"]',errored:'[data-errored="true"]'};function Tt(e){return function(e){return Object.keys(At).indexOf(e)>-1}(e)?At[e]:function(e){return Object.keys(Ot).indexOf(e)>-1}(e)?Ot[e]:""}const jt={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",scrollMask:"",blur:"filter",opacity:"opacity"},text:{textColor:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",lineHeight:"line-height",lineLimit:"",letterSpacing:"letter-spacing",baselineTextAlign:"vertical-align",horizontalTextAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform"},background:{backgroundColor:"background-color",backgroundImage:""},dimension:{width:"width",maxWidth:"max-width",minWidth:"min-width",height:"height",maxHeight:"max-height",minHeight:"min-height",rotateZ:"transform"},flexChild:{alignSelf:"align-self",weight:"flex",order:"order"},spacing:{margin:"margin",padding:"padding",offset:""},border:{borderColor:"border-color",borderRadius:"border-radius",borderWidth:"border-width",borderStyle:"border-style"}};function kt(e,t){if(!jt[e]||!jt[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return jt[e][t]}function Mt(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function Rt(...e){let t="";const n=(...e)=>e.reduce(((e,n)=>(e&&n?e=e+t+n:n&&(e=n),e)),"");return 1===e.length?(t=e[0],n):n(...e)}function Vt(e,t){return`${e}:${t};`}function Ht(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Pt extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function _t(e,t){if(null===t)return!1;const n=("function"==typeof e?[e]:e).map((e=>e(t))).reduce(((e,t)=>t?e?e+=`, ${t}`:t:e),void 0);if(n)throw new Pt(n,JSON.stringify(t));return!0}function Nt(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Ft(e){return t=>{const n=t&&"symbol"!=typeof t?t.toString():t;if(!(e.indexOf(n)>=0))return`value must be one of [${e.join(",")}]`}}function $t(e){if(null==e||""===e)return"value must not be omitted"}function Zt(e){const t=new RegExp(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/);if("string"!=typeof e||!t.test(e))return"value must be a valid hex color"}function Gt(e){const t=new RegExp(/^(?:(?:data:image\/[^;]+;base64[^"]+)|(?:(?:https?:)?\/\/[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*(?::\d{1,10})?)?(?:\.\.?\/?)*\/(?:[a-zA-Z\d\-_]+\/)*[a-zA-Z\d\-_]+\.[a-zA-Z\d]{2,6}(?:\?(?:.+=.+&?)*)?)(?:#.+)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function Bt(e){if(null!=e&&""!==e)return"value must not be specified"}function Ut(e){return t=>{if(t&&"object"==typeof t&&"value"in t&&"type"in t&&"string"==typeof t.type&&function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t.type)&&"function"==typeof e[t.type]){const n=e[t.type](t.value);if(!n)return;return`object must have valid "value" for type: ${t.type}: ${n}`}return`value must be an object that has a "type" property that matches one of: [${Object.keys(e).join(", ")}] and a "value" property`}}function zt(...e){return t=>{if("string"==typeof t){const n=t.split(" ");if(n.length>1&&e.indexOf(n.length)>-1){if(!n.reduce(((e,t)=>e||Nt(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function qt(e,t){return n=>{const i=e(n),a=t(n);if(i&&a)return`one of these must be true: ${i} -OR- ${a}`}}function Kt(e){if("string"!=typeof e)return"value must be a string"}const Wt=a.is(Object);function Yt(e){const t=Object.entries(e);return n=>Wt(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Jt(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Xt(e,t,n){return _t(Nt,n)?Vt(kt(e,t),`${n}`):""}function Qt(e){return(t,n,i)=>_t(Ft(Object.keys(e)),i)?Vt(kt(t,n),`${e[i]}`):""}function en(e){return _t($t,e)?Mt({light:t(Gt,!1),dark:t(qt(Bt,Gt),!0)},Rt("\n "))(e):"";function t(e,t){return n=>{if(_t(e,n)&&n){const e=Vt("background-image",`url("${n}")`);return t?Ht(e):e}return""}}}function tn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),_t(qt(Bt,Ft(Object.keys(t))),e)&&e?Vt("background-size",t[e]):""}const nn=a.cond([[a.equals("top-left"),a.always("top left")],[a.equals("top-right"),a.always("top right")],[a.equals("bottom-left"),a.always("bottom left")],[a.equals("bottom-right"),a.always("bottom right")],[a.T,a.identity]]);function an(e){const t="string"==typeof e?e.toLowerCase():e;return _t(qt(Bt,Ft(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Vt("background-position",nn(t)):""}function on(e,t,n){return _t(qt(Nt,zt(2,3,4)),n)?Vt(kt(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function rn(e){return(t,n,i)=>_t(Ut({fit:Ft(e),percentage:Nt,fixed:Nt}),i)?Vt(kt(t,n),sn(i)):""}function sn(e){const t={"wrap-content":"fit-content","fit-width":"100%","fit-height":"100%"};switch(e.type){case"fixed":return`${e.value}px`;case"percentage":return`${e.value}%`;case"fit":return t[e.value]}}const ln=Yt({light:Zt,dark:qt(Bt,Zt)});function cn(e,t,n){return i=>{if(i){const a=Vt(kt(e,t),un(String(i)));return n?Ht(a):a}return""}}function dn(e,t,n){return _t(ln,n)?Mt({light:cn(e,t,!1),dark:cn(e,t,!0)},Rt("\n "))(n):""}function un(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t.toUpperCase()}}const pn=Yt({offsetX:qt(Bt,Nt),offsetY:qt(Bt,Nt),blurRadius:qt(Bt,Nt),spreadRadius:qt(Bt,Nt),color:ln}),fn=e=>t=>null!=t?String(t):e,hn=a.compose(a.concat(a.__,"px"),fn("0")),vn=e=>t=>"string"==typeof t?e(t):t,yn=a.compose(vn(a.concat(a.__,"px")),fn(void 0)),mn=a.compose(vn(un),a.prop("dark"));function Cn(e,t,n){return Vt(e,Mt({offsetX:hn,offsetY:hn,blurRadius:t.spreadRadius?hn:yn,spreadRadius:yn,color:n},Rt(" "))(t))}const gn=Yt({edges:qt(Bt,Ft(["start","end","both"])),size:qt(Bt,Nt),startSize:qt(Bt,Nt),endSize:qt(Bt,Nt),easing:qt(Bt,Ft(["linear","ease-in","ease-out","ease-in-out"])),clip:qt(Bt,Ft(["border-box","padding-box","content-box"]))});const bn={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},En={container:{justifyContent:Qt(bn),alignItems:Qt(bn),shadow:function(e,t,n){var i,o,r;if(_t(pn,n)){const s=kt(e,t);return Rt("\n")(Cn(s,n,(o="light",r="#80000000",a.compose(un,a.propOr(r,o)))),(null===(i=n.color)||void 0===i?void 0:i.dark)?Ht(Cn(s,n,mn)):"")}return""},gap:on,overflow:Qt({hidden:"hidden",visible:"visible"}),scrollMask:function(e,t,n){return null==n||_t(gn,n),""},blur:function(e,t,n){return _t(Jt,n)?Vt(kt(e,t),`blur(${n.toString()}px)`):""},opacity:Xt},text:{textColor:dn,fontSize:on,fontFamily:function(e,t,n){return _t(Kt,n)?Vt(kt(e,t),(i=`${n}`,i.replace(/['();{}@:[\]!/=]/g,"")).split(",").map(((e,t)=>{const n=0===t?e:e.trim();if(n.includes(" ")){const e=n.startsWith('"')?"":'"',t=n.endsWith('"')?"":'"';return`${e}${n}${t}`}return n})).join(",")):"";var i},fontWeight:Qt({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Qt({normal:"normal",italic:"italic"}),lineHeight:on,lineLimit:function(e,t,n){return _t(Nt,n)?`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: ${n};\n line-clamp: ${n}; \n -webkit-box-orient: vertical;\n `:""},letterSpacing:on,baselineTextAlign:Qt({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Qt({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Qt({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Qt({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:dn,backgroundImage:function(e,t,n){return _t($t,n)?Mt({url:en,position:an,scale:tn},Rt)(n):""}},dimension:{width:rn(["wrap-content","fit-width"]),maxWidth:on,minWidth:on,height:rn(["wrap-content","fit-height"]),maxHeight:on,minHeight:on,rotateZ:(In="Z",(e,t,n)=>{const i=`rotate${In}`;return _t(Nt,n)?Vt(kt(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Qt(bn),weight:Xt,order:Xt},spacing:{margin:on,padding:on,offset:function(e,t,n){return _t(zt(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:dn,borderRadius:on,borderWidth:on,borderStyle:Qt({solid:"solid",dashed:"dashed"})}};var In;function xn(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!En[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=En[n][i];if(!a)throw new Error(`No styling transformer exists for property: ${n}.${i.toString()}`);try{t+=a(n,i,e[n][i])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${i.toString()}: ${e.message}`),e}})),t)),"")}const Ln="FAILED_TEMPLATING_DATA",Dn="UNRESOLVED_FORM_VALIDATION_TARGET",wn=new Map;function Sn(e){return String.fromCharCode(97+e)}function An(e,t,n){const i=`${e||H.pluginId}-${void 0!==t?String(t):"outer"}`,a=wn.get(i);if(a&&a.sheet.container.isConnected)return a;const o=function(e,t){const n={key:void 0!==e?`inner-css-${Sn(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),p(n)}(t,n);return wn.set(i,o),o}function On(e,t,n){return An(e,t,n).css}function Tn(e,t,n){return An(e,t,n).cx}const jn="%%%OWN_CLASS_REF%%%",kn={placeholderText:"::placeholder"},Mn=a.memoizeWith(((e,t,n,i)=>`${String(e)}-${t}-${n}`),Rn);function Rn(e,t,n,i){const a=On(t,n,i);let o=1;return function t(n,i=!1){var r;if("string"==typeof n){const e={scopeClass:n};return t.bind(e)}const s=n,l=this.scopeClass,c=Object.entries(null!==(r=s.elements)&&void 0!==r?r:{});try{const t=c.reduce(((t,[n,a])=>Object.assign(Object.assign({},t),{[n]:Vn(a,l,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?a(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const i=n.replace(jn,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function Vn(e,t,n,i,a){return e.map(function(e,t,n){var i;const a=null!==(i=kn[n])&&void 0!==i?i:"";return i=>Object.entries(i).map((([i,o])=>{const r=o?xn(o):"";switch(!0){case"default"===i:return r?a?`\n &${a} {\n${r}\n}\n`:`\n${r}\n`:"";case Boolean(e):return`\n .${e}${Tt(i)} &${a} {\n${r}\n}\n`;case t&&"own"!==n:return`\n .${jn}${Tt(i)} &${a} {\n${r}\n}\n`;default:return`\n &${Tt(i)}${a} {\n${r}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${St(i,t)}\n`):e}),"")}const Hn=t.createContext(a.always(void 0)),Pn=()=>t.useContext(Hn),_n=t.createContext(null);function Nn(e,n){var i;const a=t.useContext(_n);return a&&null!==(i=n(a))&&void 0!==i?i:e}const Fn=t.createContext((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),$n=Fn.Consumer,Zn=()=>t.useContext(Fn),Gn=t=>e.jsx(Fn.Provider,{value:(e,n,i,a)=>t.value(e,null!=n?n:t.overrides,i,a),children:t.children}),Bn=t.createContext(null),Un=()=>t.useContext(Bn),zn=t.createContext({get(){throw Error("Offer context has not been set")}}),qn=t=>e.jsx(zn.Provider,{value:{get:()=>t.context},children:t.children}),Kn=()=>t.useContext(zn).get(),Wn=()=>{try{return t.useContext(zn).get().creative.copy}catch(e){return}},Yn=t.createContext((()=>{})),Jn=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Xn=a.compose(a.not,a.isEmpty),Qn=a.where({url:Xn,title:Xn});function ei(e,t,n){return t.reduce(((t,n)=>{const i=n.indexOf("["),a=-1===i?n.slice(0,-1):n.slice(0,i),o=-1===i?"":n.slice(i+1,-1),r="append"===a?[o]:o?o.split(","):[];if(!a)throw new Error(ni(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){ti(t,e,"openLinks",1,2);const i=ii(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=ai(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Jn,((e,t)=>`<a ${ft} ${a?`${ht}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){ti(t,e,"sliceText",2,2);const i=ii(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=ii(t,e,1,(e=>{const t=Number(e);return!Number.isNaN(t)&&t>=0?t:null}),"sliceText meta attribute second argument must be a positive number");if("Chars"===i)return function(e,t){const n=new RegExp(">.*(?:</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,a);throw Error(ni(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);case"timerFormat":return function(e,t,n){var i;ti(t,e,"timerFormat",1,1);const a=null!==(i=t[0])&&void 0!==i?i:"";return function(e,t){const n=/(?:^|[^\\])hh?/.test(t),i=/(?:^|[^\\])mm?/.test(t),a=n?Math.floor(e/3600):0,o=e-3600*a,r=i?n?Math.floor(o/60):Math.floor(e/60):0,s=i?o-60*r:n?o:e,l=[[/hh/,String(a).padStart(2,"0")],[/h/,String(a)],[/mm/,String(r).padStart(2,"0")],[/m/,String(r)],[/ss/,String(s).padStart(2,"0")],[/s/,String(s)]];let c="",d=0;for(;d<t.length;){if("\\"===t[d]&&d+1<t.length){c+=t[d+1],d+=2;continue}let e=!1;for(const[n,i]of l){const a=t.slice(d).match(n);if(a&&0===a.index){c+=i,d+=a[0].length,e=!0;break}}e||(c+=t[d],d++)}return c}(Math.max(0,Math.floor(Number(n)||0)),a)}(e,n,i);case"append":return function(e,t,n){if(1!==t.length)throw new Error(ni(e,`append meta attribute takes 1 argument; received ${t.length}.`));return n+t[0]}(e,n,i);default:throw new Error(ni(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,r,t)}),n)}function ti(e,t,n,i,a){const o=new Error(ni(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} ${1===(a||i)?"argument":"arguments"}; received ${e.length}.`));if(a&&(e.length<i||e.length>a))throw o;if(!a&&e.length!==i)throw o}function ni(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function ii(e,t,n,i,a){const o=ai(e,n,i);if(null!==o)return o;throw Error(ni(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function ai(e,t,n){return n(e[t])}const oi="DATA",ri="STATE",si="ATTRIBUTE",li=new RegExp(`^(${`${oi}|${ri}|${si}`})\\.`),ci=new RegExp(`^${si}`),di=new RegExp(`%\\^(?:(?:${oi}|${ri})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*|${si}\\.[a-zA-Z0-9][a-zA-Z0-9\\._-]*)(?:\\:(?:append\\[[^\\]\\[|:]*\\]|[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,:\\\\ -]*\\]))*(?:\\|.*?)?\\^%`,"g");function ui(e){const t=`${si}.`;if(!e.startsWith(t))return e;return`${t}${e.slice(t.length).toLowerCase().replace(/^rokt\./,"").replace(/[_-]/g,"")}`}function pi(e){const t=new Map,n=new Map,i=new Set;for(const[a,o]of e){if("string"!=typeof o)continue;if(!a.startsWith(`${si}.`))continue;const e=ui(a),r=n.get(e);void 0===r||r===o?(n.set(e,o),e!==a&&t.set(e,o)):i.add(e)}for(const e of i)t.delete(e);return t}const fi=Symbol("invalid");function hi(e,t="creativeCopy"){const n=vi({data:e},t),i=new Map;return function e(t,n){if("string"!=typeof t){const i=vi(t,n,this.dataMap),a="attribute"in t;return e.bind({dataMap:i,attributeAliases:a?pi(i):this.attributeAliases,hasAttributeData:this.hasAttributeData||a})}let i=!1;const o=t,r=a.pipe(a.slice(2,-2),a.split("|"),(e=>a.reduce(((e,t)=>{var n;let i;if(li.test(t)){const o=function(e){const t=[];let n="",i=0;for(const a of e)"["===a?i++:"]"===a&&i--,":"===a&&0===i?(t.push(n),n=""):n+=a;return t.push(n),t}(t),r=o[0];if(r){if(i=null!==(n=this.dataMap.get(r))&&void 0!==n?n:this.attributeAliases.get(ui(r)),i&&i===fi)throw new Y(Ln,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(o.length>1&&i)try{i=ei(r,o.slice(1),i)}catch(e){throw new Y(Ln,`Failed to apply meta attributes. ${function(e){return null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:String(e)}(e)}`)}}return i?a.reduced({provided:!0,value:i}):e}return a.reduced({provided:!0,value:t})}),{provided:!1,value:""},e))),s=a.replace(di,(e=>{const t=ci.test(e.slice(2));if(t&&!this.hasAttributeData)return e;const n=r(e);return n.provided?n.value:t?e:(i=!0,n.value)}),o);return!1===i?s:""}.bind({dataMap:n,attributeAliases:i,hasAttributeData:!1})}function vi(e,t,n){const i=new Map(n);return"data"in e&&o(e.data,`${oi}${t?"."+t:""}`),"state"in e&&o(e.state,`${ri}${t?"."+t:""}`),"attribute"in e&&o(e.attribute,`${si}${t?"."+t:""}`),i;function o(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?i.set(t,(null==e?void 0:e.toString())||""):i.set(t,fi),e&&"object"==typeof e&&a.forEachObjIndexed(((e,n)=>o(e,`${t}.${n}`)),e)}}const yi=t.createContext(hi({})),mi=yi.Consumer,Ci=yi.Provider,gi=()=>t.useContext(yi),bi=t.createContext(null),Ei=bi.Provider,Ii=t.createContext("OUTER"),xi=()=>"VARIANT"===t.useContext(Ii),Li=t.createContext(void 0),Di=()=>t.useContext(Li);var wi,Si,Ai,Oi,Ti,ji,ki,Mi=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))},Ri=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Vi=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};class Hi{constructor(e,t,n,i,o,r,s,l){wi.set(this,void 0),Si.set(this,void 0),Ai.set(this,new Set),Oi.set(this,void 0),Ti.set(this,void 0),ji.set(this,void 0),ki.set(this,void 0),l&&(this.launchContinuousChild=e=>l.launch(n,e),this.registerContinuousResponseHandler=e=>{const t=l.register(n,e),i=()=>{t(),Ri(this,Ai,"f").delete(i)};return Ri(this,Ai,"f").add(i),i}),Vi(this,wi,a.partial(e.subscribe.bind(e),[n]),"f"),Vi(this,Si,a.partial(e.dispatch.bind(e),[n]),"f"),Vi(this,Oi,t,"f"),Vi(this,Ti,i,"f"),Vi(this,ji,o,"f"),Vi(this,ki,r,"f"),this.scrollHostToViewportOffset=s,this.onGlobalStateChange=this.onGlobalStateChange.bind(this),this.onInteractivityChange=this.onInteractivityChange.bind(this),this.onEvent=this.onEvent.bind(this),this.globalDispatch=this.globalDispatch.bind(this),this.createChildPlugin=this.createChildPlugin.bind(this)}onGlobalStateChange(e){const t=Ri(this,wi,"f").call(this,e),n=()=>{t(),Ri(this,Ai,"f").delete(n)};return Ri(this,Ai,"f").add(n),n}onInteractivityChange(e){return Ri(this,Ti,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=Ri(this,ji,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),Ri(this,Ai,"f").delete(n)};return Ri(this,Ai,"f").add(n),n}globalDispatch(e){Ri(this,Si,"f").call(this,e)}dispose(){Ri(this,Ai,"f").forEach((e=>e())),Vi(this,Ai,new Set,"f"),Ri(this,Ti,"f").clear()}createChildPlugin(e){return"dcui-child"===e.name&&Ri(this,ki,"f")&&e.config?Ri(this,Oi,"f").call(this,Object.assign(Object.assign({},e),{config:Object.assign(Object.assign({},e.config),{fonts:Ri(this,ki,"f").call(this)})})):Ri(this,Oi,"f").call(this,e)}}wi=new WeakMap,Si=new WeakMap,Ai=new WeakMap,Oi=new WeakMap,Ti=new WeakMap,ji=new WeakMap,ki=new WeakMap;class Pi{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>Mi(this,void 0,void 0,(function*(){})),onClose:()=>Mi(this,void 0,void 0,(function*(){})),putConfig:()=>Mi(this,void 0,void 0,(function*(){})),send:()=>Mi(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var _i,Ni,Fi=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},$i=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Zi{constructor(e){_i.set(this,void 0),Ni.set(this,new Set),Fi(this,_i,e,"f")}subscribe(e){return $i(this,Ni,"f").add(e),!0===e($i(this,_i,"f"))&&$i(this,Ni,"f").delete(e),()=>{$i(this,Ni,"f").delete(e)}}publish(e){Fi(this,_i,e,"f"),$i(this,Ni,"f").forEach((e=>{!0===e($i(this,_i,"f"))&&$i(this,Ni,"f").delete(e)}))}clear(){$i(this,Ni,"f").clear()}}_i=new WeakMap,Ni=new WeakMap;var Gi=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Bi=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};const Ui="breakpoint-0px";class zi{constructor(){this.logger=()=>{}}withAppFactory(e){return this.appFactory=e,this}withLogger(e){return this.logger=e,this}withGatewayFactory(e){return this.gatewayFactory=e,this}build(){var e,t,n,i,a,o,r,s,l,c,d,u,p,f,h,v,y,m,C,g,b,E,I,x,L,D,w,S;const A=this.appFactory,O=this.logger,T=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new Pi;return S=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint","measurement-occluded"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.set(this,void 0),o.set(this,!1),r.set(this,!1),s.set(this,(()=>null)),l.set(this,!1),c.set(this,null),d.set(this,null),u.set(this,null),p.set(this,null),f.set(this,null),h.set(this,null),v.set(this,!1),y.set(this,null),m.set(this,null);const e=this.attachShadow({mode:"open"});Bi(this,a,document.createElement("div"),"f"),Gi(this,a,"f").id="app-container",Gi(this,a,"f").classList.add("default"),e.appendChild(Gi(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":Gi(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Gi(this,i,"f").call(this,o);break;case"measurement-occluded":Gi(this,s,"f").call(this);break;case"active-breakpoint":Gi(this,t,"m",C).call(this,o,a)}}makeInteractivityUpdateHandler(e){Bi(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),l=this.getAttribute("slotInstanceGuid");if(Bi(this,r,"true"===this.getAttribute("continuous-measurement"),"f"),Gi(this,r,"f")){let o=!1;const r=()=>{const n="true"===this.getAttribute("visible"),r="true"===this.getAttribute("measurement-occluded");if(n&&!o&&(o=!0,0===e&&a.globalDispatch({type:Ee,payload:{event:"Interactive"}}),l&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:l}})),!n||r)return Gi(this,t,"m",I).call(this,i,a),void Gi(this,t,"m",E).call(this);i&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:i}}),i&&Gi(this,t,"m",w).call(this,i,a)};return Bi(this,s,r,"f"),Bi(this,n,r,"f"),void r()}Bi(this,n,(o=>{o?(Bi(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:Ee,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:i}}),Gi(this,t,"m",w).call(this,i,a)),l&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:l}})):Gi(this,t,"m",E).call(this)}),"f"),Gi(this,n,"f").call(this,o)}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&j(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e,t="{}"){const n=this.getAttribute(e);try{return JSON.parse(null!=n?n:t)}catch(t){j(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){Gi(this,t,"m",E).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");Gi(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),{layoutSchema:l,variantTimers:c}=function(e){var t;return"LayoutVariantRoot"===e.type?{layoutSchema:e.node.layout,variantTimers:null!==(t=e.node.timers)&&void 0!==t?t:void 0}:{layoutSchema:e}}(s),d=this.getJSONAttr("childLayouts","[]"),u=this.getJSONAttr("offerData"),p=new Zi("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),f=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",h=this.getJSONAttr("offerState","{}");A||j("Cannot create app without factory. Please build the connector withAppFactory.");const v=T({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==u?void 0:u.creative)||void 0===t?void 0:t.instanceGuid},p);this.makeInteractivityUpdateHandler(p),A({rootElement:Gi(this,a,"f"),gateway:v,logger:O,offerPositionIndex:r,offerData:u,layoutSchema:l,childLayouts:d,schemaVersion:f,pluginId:o||H.pluginId,offerState:h,variantTimers:c}),this.makeVisbilityUpdateHandler(r,null===(n=null==u?void 0:u.creative)||void 0===n?void 0:n.instanceGuid,v)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,h=new WeakMap,v=new WeakMap,y=new WeakMap,m=new WeakMap,t=new WeakSet,C=function(e,t){Gi(this,a,"f").classList.remove(t||Ui),Gi(this,a,"f").classList.add(e||Ui)},g=function(){Gi(this,p,"f")&&(clearTimeout(Gi(this,p,"f")),Bi(this,p,null,"f"))},b=function(e){Gi(this,t,"m",g).call(this),Bi(this,p,window.setTimeout(e,1e3),"f")},E=function(){Gi(this,t,"m",g).call(this),Gi(this,t,"m",L).call(this),Gi(this,u,"f")&&(Gi(this,u,"f").disconnect(),Bi(this,u,null,"f")),Gi(this,f,"f")&&(document.removeEventListener("visibilitychange",Gi(this,f,"f")),Bi(this,f,null,"f")),Gi(this,y,"f")&&(window.removeEventListener("beforeunload",Gi(this,y,"f")),Bi(this,y,null,"f")),Gi(this,m,"f")&&(Gi(this,a,"f").removeEventListener("click",Gi(this,m,"f")),Bi(this,m,null,"f")),Bi(this,v,!1,"f"),Bi(this,h,null,"f")},I=function(e,t){if(!Gi(this,v,"f")||null==Gi(this,h,"f"))return;const n=Gi(this,h,"f"),i=Date.now();if(i<=n)return Bi(this,v,!1,"f"),void Bi(this,h,null,"f");t.globalDispatch({type:be,payload:{name:"SignalUserInteraction",parentGuid:e,action:"ViewabilityDurationTracking",context:"Offer Visibility Duration",objectData:{startTimestamp:n.toString(),endTimestamp:i.toString()}}}),Bi(this,v,!1,"f"),Bi(this,h,null,"f")},x=function(e,n){Gi(this,l,"f")||Gi(this,c,"f")||!("ResizeObserver"in window)||(Bi(this,c,new ResizeObserver((i=>{var a;if(Gi(this,l,"f"))return;const o=i[0];if(!o)return;const r=null===(a=o.borderBoxSize)||void 0===a?void 0:a[0],s=r?r.inlineSize:o.contentRect.width,c=r?r.blockSize:o.contentRect.height;0!==s&&0!==c&&(Gi(this,t,"m",D).call(this),Bi(this,d,window.setTimeout((()=>{Bi(this,l,!0,"f"),Gi(this,t,"m",L).call(this),window.requestAnimationFrame((()=>{n.globalDispatch({type:be,payload:{name:"SignalRenderGeometry",parentGuid:e,objectData:{widthPx:Math.round(s),heightPx:Math.round(c)}}})}))}),250),"f"))})),"f"),Gi(this,c,"f").observe(Gi(this,a,"f")))},L=function(){Gi(this,t,"m",D).call(this),Gi(this,c,"f")&&(Gi(this,c,"f").disconnect(),Bi(this,c,null,"f"))},D=function(){Gi(this,d,"f")&&(clearTimeout(Gi(this,d,"f")),Bi(this,d,null,"f"))},w=function(e,n){if(Gi(this,o,"f")&&!Gi(this,r,"f"))return;const i=this.getAttribute("slotInstanceGuid");i&&Gi(this,t,"m",x).call(this,i,n);const s=Gi(this,r,"f")&&"true"===this.getAttribute("expanded-owns-viewability");if(!("IntersectionObserver"in window)){if(s||Gi(this,o,"f"))return;return n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),void Bi(this,o,!0,"f")}Gi(this,u,"f")||(Bi(this,u,new IntersectionObserver((i=>{i.forEach((i=>{(!Gi(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(i.isIntersecting&&i.intersectionRatio>=.5?(s||Gi(this,o,"f")||Gi(this,t,"m",b).call(this,(()=>{Gi(this,o,"f")||Gi(this,r,"f")&&("true"===this.getAttribute("measurement-occluded")||"true"!==this.getAttribute("visible")||"hidden"===document.visibilityState)||(n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),Bi(this,o,!0,"f"))})),Gi(this,v,"f")||(Bi(this,h,Date.now(),"f"),Bi(this,v,!0,"f"))):(Gi(this,t,"m",g).call(this),Gi(this,v,"f")&&Gi(this,t,"m",I).call(this,e,n)))}))}),{threshold:.5}),"f"),Gi(this,u,"f").observe(Gi(this,a,"f")),Bi(this,m,(()=>{(!Gi(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(s||Gi(this,o,"f")||(n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),Bi(this,o,!0,"f"),Gi(this,t,"m",g).call(this)),Gi(this,v,"f")&&Gi(this,t,"m",I).call(this,e,n))}),"f"),Gi(this,a,"f").addEventListener("click",Gi(this,m,"f")),Bi(this,f,(()=>{Gi(this,u,"f")&&("hidden"===document.visibilityState?(Gi(this,t,"m",g).call(this),Gi(this,v,"f")&&Gi(this,t,"m",I).call(this,e,n),Gi(this,u,"f").unobserve(Gi(this,a,"f"))):"visible"===document.visibilityState&&Gi(this,u,"f").observe(Gi(this,a,"f")))}),"f"),document.addEventListener("visibilitychange",Gi(this,f,"f")),Bi(this,y,(()=>{Gi(this,v,"f")&&Gi(this,t,"m",I).call(this,e,n)}),"f"),window.addEventListener("beforeunload",Gi(this,y,"f")))},S;function j(e){throw O({level:q,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const qi=t.createContext({get:()=>new Pi}),Ki=t=>e.jsx(qi.Provider,{value:{get:()=>t.context},children:t.children});const Wi=t.createContext({get(){throw Error("Layout Schema context has not been set")}}),Yi=t=>e.jsx(Wi.Provider,{value:{get:()=>t.context},children:t.children}),Ji=()=>t.useContext(Wi).get(),Xi=t.createContext("ENABLED"),Qi=()=>t.useContext(Xi);function ea(e){const t=na(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:na(t,this.dataMap)});if(!n)throw new Y("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");const i=t;return a.path([n,i],this.dataMap)}.bind({dataMap:t})}const ta={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function na(e,t=ta){return["images","links","icons","copy","responseOptionsMap"].reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},t[n]),e[n])})),t)}const ia=t.createContext(ea({}));ia.Consumer;const aa=ia.Provider,oa=e=>{const n=t.useContext(ia),i=e.split("|");for(const e of i){const t=n(e.trim(),"images");if(t)return t}},ra=()=>t.useContext(ia),sa=t.createContext({});function la({info:n,children:i}){const a=t.useContext(sa);return e.jsx(sa.Provider,{value:Object.assign(Object.assign({},a),n),children:i})}const ca=t.createContext({get(){throw Error("Catalog Item context has not been set")}}),da=t=>e.jsx(ca.Provider,{value:{get:()=>t.context},children:t.children}),ua=()=>t.useContext(ca).get(),pa=t.createContext(""),fa=()=>t.useContext(pa),ha=t.createContext(""),va=t.createContext(void 0);function ya({children:n}){const i=t.useMemo((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return e.jsx(va.Provider,{value:i,children:n})}const ma=t.createContext(!0),Ca=t.createContext(null),ga=Ca.Provider,ba=t.createContext(null);function Ea(n){const[i,a]=t.useState({}),o=t.useRef([]),r=t.useContext(qi).get().scrollHostToViewportOffset;function s(e){if(e in i)return[e];const t=`${e}-`;return Object.keys(i).filter((e=>e.startsWith(t)))}return e.jsx(ba.Provider,{value:{registerValidators:function(e,t,n){a((i=>Object.assign(Object.assign({},i),{[e]:{validators:t,isValid:!0,element:n}})))},validateFieldKeys:function(e){const t={},n=[];let r=!0;const l=e.flatMap(s);if(0===l.length)return o.current=[],!1;for(const e of l){const a=i[e];if(a){const i=Object.assign({},a),o=a.validators.every((e=>e()));o!==i.isValid&&(t[e]=Object.assign(Object.assign({},i),{isValid:o})),!o&&a.element&&n.push(a.element),r&&(r=o)}else r=!1}return o.current=n,Object.values(t).length>0&&a((e=>Object.assign(Object.assign({},e),t))),r},getFieldKeyValidity:function(e){const t=s(e);return 0!==t.length&&t.every((e=>{var t,n;return null!==(n=null===(t=i[e])||void 0===t?void 0:t.isValid)&&void 0!==n&&n}))},focusFirstInvalidField:function(){var e;const t=o.current.filter((e=>e.isConnected)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))[0];if(t){if(null===(e=t.scrollIntoView)||void 0===e||e.call(t,{behavior:r?"instant":"smooth",block:"center"}),r){const e=t.getBoundingClientRect();r(e.top+e.height/2)}t.focus({preventScroll:!0})}}},children:n.children})}function Ia(){const e=t.useContext(ba);if(!e)throw new Error("useValidator must be used within a ValidatorProvider");return e}function xa(e,n,i){const a=Ia();t.useEffect((()=>{var t;e&&a.registerValidators(e,n,null!==(t=null==i?void 0:i.current)&&void 0!==t?t:void 0)}),[e,n.length,i])}function La(e,t){return t?t.validators.map((t=>e[t])).filter((e=>void 0!==e)):[]}const Da=a.compose(a.anyPass([a.isEmpty,a.all(a.isEmpty)]),a.flatten,a.map(a.values),a.map(a.ifElse(a.isNil,a.always({}),a.identity)),a.values,a.propOr({},"value")),wa=a.compose(a.isEmpty,a.prop("predicates"));function Sa(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const Aa=a.curry(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(xn(i)),transitionBaseClassname:e(Sa(t,(o=i,a.toPairs(o).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?a.keys(n).map((e=>kt(t,e))):[]})))))};var o})),Oa=a.anyPass([Da,wa]);function Ta(e){return e.value!==e.defaultValue}function ja(e,t){const n=function(e,t){return B(t,[e]).flatMap((({formKey:e,fieldKey:n})=>{var i;const a=null===(i=t[e])||void 0===i?void 0:i[n];return a&&F(a)?a:[]}))}(e.key,t);switch(e.state){case"is-valid":return n.length>0&&n.every((e=>e.validated&&e.valid));case"is-invalid":return n.some($);case"is-touched":return n.some((e=>e.touched));case"is-untouched":return n.every((e=>!e.touched));case"is-dirty":return n.some(Ta);case"is-pristine":return n.every((e=>!Ta(e)));default:return!1}}const ka={is:a.equals,"is-not":a.compose(a.not,a.equals),"is-below":a.lt,"is-above":a.gt};function Ma(e,t){return e.includes(t)}const Ra={is:a.equals,"is-not":a.compose(a.not,a.equals),exists:Ma,"not-exists":a.compose(a.not,Ma)},Va={exists:a.compose(a.not,a.either(a.isNil,a.isEmpty)),"not-exists":a.either(a.isNil,a.isEmpty)},Ha={"is-true":a.equals(!0),"is-false":a.equals(!1)},Pa={is:a.equals,"is-not":a.compose(a.not,a.equals)};function _a(e){return(t,n)=>n[e]}const Na=a.cond([[(e,t)=>a.equals("Breakpoint",e),_a("activeBreakpoint")],[(e,t)=>a.equals("Progression",e),_a("progressionIndex")],[(e,t)=>a.equals("Position",e),_a("positionIndex")]]);function Fa(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const $a=a.cond([[(e,t,n)=>a.equals("Breakpoint",e),(e,t,n)=>{const i=a.lensPath(["breakpoints",t]);return a.pipe(a.over(i,Number),a.view(i))(n)}],[(e,t,n)=>a.equals("Progression",e),(e,t,n)=>a.cond([[a.gt(0),a.add(n.totalGroups)],[a.lte(0),a.identity]])(Number(t))],[(e,t,n)=>a.equals("Position",e),(e,t,n)=>a.cond([[a.gt(0),a.add(n.totalOffers)],[a.lte(0),a.identity]])(Number(t))]]),Za=a.compose(a.not,isNaN);function Ga(e,t){return e.map((e=>{var n,i,a,o;switch(e.type){case"StaticString":return(0,Pa[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Va[e.predicate.condition])(Fa(t,e.predicate.value));case"StaticBoolean":return(0,Ha[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,ka[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,ka[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"OnFirstEvent":return null!==(a=t.firedEvents[e.predicate.event])&&void 0!==a&&a;case"FormState":return ja(e.predicate,t.formStates);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,Ra[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,ka[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"NumericCompare":{const{left:t,right:n,condition:i}=e.predicate.content;if(!t.trim()||!n.trim())return!1;const a=Number(t),o=Number(n);return!(!Number.isFinite(a)||!Number.isFinite(o))&&ka[i](a,o)}case"Numeric":return(0,ka[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=ka[e.predicate.condition],i=null!==(o=Na(e.type,t))&&void 0!==o?o:NaN,a=$a(e.type,e.predicate.value,t);return!!Za(i)&&n(i,a)}}}))}function Ba(e){return a.pathOr(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const Ua={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{},firedEvents:{},formStates:{}};function za(e,t,n,i){const o=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:r,uncached:s}=o.reduce(((t,i)=>function(e,t,n,i){if("FormState"===e.type)return a.evolve({cached:a.append(ja(e.predicate,t.formStates))},i);const o=function(e,t){var n;switch(e.type){case"Position":case"StaticBoolean":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"StaticString":return`${e.type}:${e.predicate.input}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"CreativeCopy":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${Fa(t,e.predicate.value)}:${t.totalGroups}`;case"CustomState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.customStates[e.predicate.key]}`;case"DomainState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.domainStates[e.predicate.key]}`;case"Placeholder":if("NumericCompare"===e.predicate.type){const{left:t,right:n,condition:i}=e.predicate.content;return`${e.type}:${e.predicate.type}:${i}:data:${t}:${n}`}return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;case"OnFirstEvent":return`${e.type}:${e.predicate.event}:state:${null!==(n=t.firedEvents[e.predicate.event])&&void 0!==n&&n}`;case"FormState":throw new Error("FormState predicates bypass the When result cache (see groupByCache)");default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${Na(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(o);return a.evolve(qa(r)?{cached:a.append(r)}:{uncached:a.append({key:o,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),l=Ga(s.map((({predicate:e})=>e)),n);return a.zip(s,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(l)}const qa=a.is(Boolean);const Ka=a.curry(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:Ba(n),progressionIndex:null!==(a=null===(i=n.progression)||void 0===i?void 0:i.activeGroupIndex)&&void 0!==a?a:0,totalOffers:null!==(r=null===(o=n.progression)||void 0===o?void 0:o.totalOffers)&&void 0!==r?r:0,totalGroups:null!==(l=null===(s=n.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:0,customStates:n.customStates,domainStates:n.domainStates,firedEvents:n.firedEvents,formStates:n.formStates,positionIndex:e,creativeCopy:t}})),Wa=a.lensPath(["predicate","content","input"]),Ya=a.lensPath(["predicate","content","value"]),Ja=a.lensPath(["predicate","key"]);function Xa(e,t){const n=a.over(Wa,(t=>t?e(t):"")),i=a.over(Ya,(t=>"string"==typeof t?e(t):t)),o=a.compose(n,i),r=a.over(Ja,(t=>t?e(t):""));return t.map((t=>{switch(t.type){case"Placeholder":if("NumericCompare"===t.predicate.type){const{content:n}=t.predicate;return Object.assign(Object.assign({},t),{predicate:Object.assign(Object.assign({},t.predicate),{content:Object.assign(Object.assign({},n),{left:e(n.left),right:e(n.right)})})})}return"TextValue"===t.predicate.type?o(t):n(t);case"CustomState":return r(t);default:return t}}))}const Qa=a.all(a.equals(!0));function eo(e){const n=xi(),i=Di(),a=t.useRef(new Map),o=Wn(),r=Nn(Ua,Ka(i,o)),s=Xa(gi(),e);return t.useMemo((()=>Qa(za(a,s,r,n))),[a,s,r,n])}function to(e){const n=xi(),i=Di(),o=t.useRef(new Map),r=Wn(),s=Nn(Ua,Ka(i,r)),l=gi();return t.useMemo((()=>a.mapObjIndexed((e=>{const t=Xa(l,e);return Qa(za(o,t,s,n))}),e)),[o,e,s,n,l])}function no(e){e&&(e.style.display="")}function io(e){e&&(e.style.display="none")}function ao(e){return e.settings.duration}const oo=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],ro=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function so(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?oo:ro,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?no(e):io(e)},a.oncancel=()=>{t?no(e):io(e)},()=>{a.finish()}}return t?no(e):io(e),()=>{}}function lo({inTransitions:n,outTransitions:i,visible:a,children:o,containerClassName:r}){const s=t.useRef(null);return t.useEffect((()=>a&&n?n.forEach((e=>{s.current&&function(e,t,n,i){if("FadeIn"===i)so(e,t,n)}(s.current,a,ao(e),e.type)})):!a&&i?i.forEach((e=>{s.current&&function(e,t,n,i){if("FadeOut"===i)so(e,t,n)}(s.current,a,ao(e),e.type)})):()=>{}),[a]),e.jsx("div",{ref:s,style:{display:"none"},className:r,children:o})}function co(n){const i=Zn(),a=eo(n.schema.predicates),o=t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,n.testId?`${n.testId}-child${t}`:void 0))));return n.schema.transition?e.jsx(lo,{inTransitions:n.schema.transition.inTransition,outTransitions:n.schema.transition.outTransition,visible:a,children:o}):"functionally"===n.schema.hide?e.jsx(Xi.Provider,{value:a?"ENABLED":"DISABLED",children:o}):a?e.jsx(e.Fragment,{children:o}):null}const uo=a.mergeWith(((e,t)=>`${e||""} ${t||""}`.trim())),po=e=>{var n;const i=t.useContext(bi),o=Di(),r=Un()||document.head,s=fa(),l=On(s,o,r),c=t.useCallback(Mn,[]),d=Nn([],(e=>Object.values(e.breakpoint.breakpoints))),u=i||c(d,s,o,r),p=e.styles?u(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=Aa(e);return a.mapObjIndexed((e=>Oa(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(l,null===(n=e.styles)||void 0===n?void 0:n.conditionalTransitions):void 0,h=to(f?a.mapObjIndexed(a.propOr([],"predicates"),f):{}),v=a.mapObjIndexed(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(f,t):void 0),h),y=f?a.mapObjIndexed(a.prop("transitionBaseClassname"),f):{},m=e.styles?((e,t,n)=>uo(uo(e,t),n))(p,v,y):void 0;return e.children({classnames:m,mapperRef:u})};function fo(n){const i=Zn();return e.jsx(po,{styles:n.schema.styles,children:({classnames:a})=>{var o;return e.jsx("div",{className:a?a.own:void 0,"data-testid":n.testId,"data-e2e-item":n.e2eItemId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:void 0,children:t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,ce(t,n.testId)))))})}})}function ho(n){const i=Zn();return e.jsx(po,{styles:n.schema.styles,children:({classnames:a})=>{var o;return e.jsx("div",{className:a?a.own:void 0,"data-testid":n.testId,"data-e2e-item":n.e2eItemId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:void 0,children:t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,ce(t,n.testId)))))})}})}const vo={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",ft,ht],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},yo=new Map([["&","_;^;_"]]),mo=new RegExp(`<a *(?=${vo.allowedAttributes.a.join("|")}|>)`,"g"),Co=new RegExp('<a [^>]*href="([^"]+)"',"g"),go=new RegExp("(<br *?>)|(<br *?/>)","g"),bo="<br/>";function Eo(n){const i=gi(),a=Qi(),o=t.useMemo((()=>{const e=i(n.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Co,((e,t)=>{const n=t.replaceAll("&",yo.get("&"));return e.replace(t,n)})).replaceAll(go,bo)}(e);return t===u(t,vo)}(e))throw new Y("FAILED_SANITISING_HTML","Invalid HTML tags");return e.trim()?e:""}),[n.schema.value,i]),{tabIndex:r,styles:s,isDisabled:l}=b(a),{setRef:c,maskStyle:d}=It("vertical",xt(n.schema.styles));return o?e.jsx(po,{styles:n.schema.styles,children:({classnames:t})=>{const i=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0)),a=Object.assign(Object.assign({},s),d);return u=o,new RegExp("</(p|ul|ol)>").test(u)?e.jsx("div",{ref:c,tabIndex:r,style:a,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":n.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(mo,`<a ${i.join(" ")}`)}}):e.jsx("p",{ref:c,tabIndex:r,style:a,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":n.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(mo,`<a ${i.join(" ")}`)}});var u}}):null}function Io(t){const n=gi()(t.schema.value),i=Qi(),{tabIndex:a,styles:o,isDisabled:r}=b(i);return n?e.jsx(po,{styles:t.schema.styles,children:({classnames:i})=>{const s={tabIndex:a,"aria-hidden":r,className:null==i?void 0:i.own,"data-testid":t.testId,"data-e2e":"BasicText"};return t.isInline?e.jsx("span",Object.assign({style:o},s,{children:n})):e.jsx("p",Object.assign({style:o},s,{children:n}))}}):null}function xo(t,n,i){if("BasicText"===t.type)return e.jsx(Io,{schema:t.node,testId:n,isInline:null!=i&&i})}function Lo(t,n,i,a,o){return e.jsx(Ei,{value:i(n),children:Do(t,a,o)})}function Do(e,n,i){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,ce(t,i)))))}function wo(n){const i=Pn(),a=Zn(),o=Kn(),r=gi(),s=Di(),l=Qi(),c=o.creative.responseOptionsMap[n.schema.responseKey],d=t.useRef(null),u=t.useRef(!1),p=t.useCallback((()=>{u.current||(d.current=Date.now())}),[]),f=t.useCallback((()=>{const e=d.current;if(null===e)return;const t=Date.now(),a="positive"===n.schema.responseKey?"-Positive":"-Negative";t>e&&i({type:be,payload:{name:"SignalUserInteraction",action:"Hover",context:`CreativeResponse${a}`,parentGuid:o.creative.instanceGuid,objectData:{startTimestamp:e.toString(),endTimestamp:t.toString()}}}),u.current=!1,d.current=null}),[i,o.creative.instanceGuid,n.schema.responseKey]),h=A(c);t.useEffect((()=>{h&&i(function(e){if(e.paymentTriggerConfig)return{type:je,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:j(e.signalType),parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:"PAYMENT_OFFER_SELECTED"}}}};throw new Error(`Invalid External Response: No 'paymentTriggerConfig' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,i,h]);const v=c?r({data:c},"creativeResponse"):r,{tabIndex:y,styles:m,isDisabled:C}=b(l);return L(c)&&!h&&void 0!==s?e.jsx(po,{styles:n.schema.styles,children:({classnames:t,mapperRef:r})=>e.jsx("button",{type:"button",tabIndex:y,"aria-disabled":C,"aria-label":n.schema.a11yLabel?v(n.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},m),"data-testid":n.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":n.schema.responseKey,onMouseOver:p,onMouseLeave:f,onClick:e=>{e.preventDefault(),f();const t=ge(o,c,n.schema.openLinks);i({type:ue,payload:t})},className:null==t?void 0:t.own,disabled:C,children:e.jsx(Ci,{value:v,children:(null==t?void 0:t.own)?Lo(n.schema.children,t.own,r,a,n.testId):Do(n.schema.children,a,n.testId)})})}):null}function So(t){const n=Qi(),{styles:i,isDisabled:a}=b(n);return t.schema.url.light?e.jsx(po,{styles:g(t.schema.styles),children:({classnames:n})=>e.jsx("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:a?void 0:t.schema.alt||void 0,title:t.schema.title||void 0,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"StaticImage",src:t.schema.url.light})}):null}function Ao(t){const n=Qi(),{styles:i,isDisabled:a}=b(n),o=oa(t.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?e.jsx(po,{styles:g(t.schema.styles),children:({classnames:n})=>e.jsx("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"DataImage",src:o.light})}):null;var r}const Oo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function To(t){const n=t.schema.name,i=t.schema.description,a=t.schema.styles?se(Oo,t.schema.styles):Oo,o=Qi(),{styles:r,isDisabled:s}=b(o);return n?e.jsx(po,{styles:a,children:({classnames:a})=>e.jsx("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==a?void 0:a.own)?" "+a.own:""),"data-testid":t.testId,"data-e2e":`StaticIcon-${n}`},!s&&i?{title:i}:{"aria-hidden":"true"},{children:n}))}):null}function jo(t,n){if("StaticIcon"===t.type)return e.jsx(To,{schema:t.node,testId:n})}const ko={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Mo extends t.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===wt.REPORT_RENDER_ERRORS&&this.props.reporter({level:q,code:null!==(n=e.code)&&void 0!==n?n:"UNHANDLED_RENDERING_EXCEPTION",message:e.message,additionalInformation:Object.assign({componentStack:t.componentStack,stack:e.stack},this.context||{})})}render(){return this.state.errorMessage?"true"===wt.DISPLAY_ERRORS?e.jsxs("pre",{style:ko,children:[e.jsx("strong",{children:"Error:"})," [",e.jsx("em",{children:this.props.schema.type}),"]"," ",this.state.errorMessage]}):void 0:this.props.children}}Mo.contextType=sa;const Ro={internally:"_top",externally:"_blank"};function Vo(t,n,i,a,o){return e.jsx(Ei,{value:i(n),children:Ho(t,a,o)})}function Ho(e,n,i){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,i?`${i}-child${t}`:void 0))))}function Po(t){var n;const i=Ro[t.schema.open],a=Zn(),o=Qi(),{tabIndex:r,styles:s,isDisabled:l}=b(o);return(null===(n=t.schema.children)||void 0===n?void 0:n.length)>0?e.jsx(po,{styles:t.schema.styles,children:({classnames:n,mapperRef:o})=>{var c;return e.jsx("a",{href:t.schema.src,"data-testid":t.testId,"data-e2e":"StaticLink",target:null!=i?i:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=t.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:t.isInline?"inline":"block"},s),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Vo(t.schema.children,null==n?void 0:n.own,o,a,t.testId):Ho(t.schema.children,a,t.testId)})}}):null}function _o(t,n,i){if("StaticLink"===t.type)return e.jsx(Po,{schema:t.node,testId:n,isInline:null!=i&&i})}const No={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Fo(n){const i=(a=n.schema.iconKey,t.useContext(ia)(a,"icons"));var a;const o=null==i?void 0:i.name,r=n.schema.styles?se(No,n.schema.styles):No,s=Qi(),{styles:l}=b(s);return o?e.jsx(po,{styles:r,children:({classnames:t})=>e.jsx("span",{style:Object.assign(Object.assign({},l),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":n.testId,"data-e2e":`DataIcon-${o}`,children:o})}):null}function $o(n){const i=Zn(),a=t.useRef(null),r=fa(),s=Di(),l=Un(),c=(l?On(r,s,l):o.css)`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
overflow: hidden;
|