@rokt/dcui-orchestrator 1.2.1-rc.10 → 1.2.1-rc.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -115,7 +115,7 @@
115
115
  `),[C]),{mergedStyles:b,tailClass:E,backgroundColor:I,darkBackgroundColor:x}=t.useMemo((()=>{var e,t;return Cl(C,n.styles?a.mergeRight(yl,n.styles):yl,120,null===(t=null===(e=n.styles)||void 0===e?void 0:e.elements)||void 0===t?void 0:t.own)}),[C,n.styles]),L=t.useMemo((()=>C`
116
116
  background-color: ${I};
117
117
  ${x?`@media (prefers-color-scheme: dark) { background-color: ${x}; }`:""}
118
- `),[C,I,x]);!function(e){const n=t.useCallback((()=>{const t=e.current;if(!t)return;const n=Array.from(t.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0),i=getComputedStyle(t),a="border-box"===i.boxSizing?(parseFloat(i.paddingTop)||0)+(parseFloat(i.paddingBottom)||0):0;t.style.height=`${n+a}px`}),[e]);t.useEffect((()=>{const t=e.current;if(!t)return;const i=new ResizeObserver((()=>n())),a=()=>{i.disconnect(),Array.from(t.children).forEach((e=>i.observe(e))),n()};a();const o=new MutationObserver(a);return o.observe(t,{childList:!0}),()=>{i.disconnect(),o.disconnect()}}),[n,e])}(v);const D=t.useRef(null),w=t.useRef(!1),S=t.useCallback((e=>{u&&p&&(w.current=!0,D.current=e.clientY)}),[u,p]),A=t.useCallback((()=>{u&&p&&w.current&&(w.current=!1,p(!1))}),[u,p]),T=t.useCallback((e=>{if(!u||!p)return;const t=D.current;null!==t&&t-e.clientY>=24&&(D.current=null,p(!1))}),[u,p]),M=t.useCallback((e=>{D.current=null,"pointercancel"===e.type&&(w.current=!1)}),[]);return e.jsx(Ka,{styles:b,children:({classnames:t})=>{var a;return e.jsx("div",{style:{width:"100%",position:"absolute",bottom:"-120vh",zIndex:9999,transform:"translateY(1000px)",visibility:"hidden"},ref:s,children:e.jsxs("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:h,children:[e.jsx("div",{ref:o,className:null==t?void 0:t.own,style:{height:"100%",position:"relative",outline:"none",pointerEvents:u?"auto":void 0},tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:e.jsxs("div",{"data-testid":i&&u?`${i}-expand`:void 0,style:u?{cursor:"pointer",touchAction:"none"}:void 0,role:u?"button":void 0,tabIndex:u?0:void 0,"aria-label":u?"Expand":void 0,onClick:u?A:void 0,onPointerDown:u?S:void 0,onPointerMove:u?T:void 0,onPointerUp:u?M:void 0,onPointerCancel:u?M:void 0,onKeyDown:u&&p?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),p(!1))}:void 0,children:[!1!==n.showDragHandle&&!1!==n.isMinimizable&&e.jsx(ul,{className:null==t?void 0:t.dragHandle,style:{pointerEvents:u?"none":void 0}}),e.jsx("div",{className:u?void 0:g,children:e.jsxs("div",{ref:v,className:y,"aria-label":u?void 0:null!==(a=n.a11yLabel)&&void 0!==a?a:void 0,style:{pointerEvents:u?"auto":void 0},[Ws]:"",children:[e.jsx("div",{ref:l,style:{width:"100%"},children:c}),e.jsx("div",{ref:r,className:`${L}${u?` ${m}`:""}`,style:{width:"100%",padding:"0px 16px 6px"},children:d})]})})]})}),e.jsx("div",{className:E,style:{marginTop:"-1px"}})]})})}})}));const gl=zs((function(n){var a;const o=i.useSelector((e=>e.breakpoint.activeBreakpoint)),r=i.useSelector((e=>e.settings.explicitCloseOnComplete)),s=i.useDispatch(),l=!1!==n.schema.isMinimizable;t.useEffect((()=>{l&&!0===n.schema.minimizeOnComplete&&!r&&s({type:Wr,payload:{minimizeOnComplete:!0}})}),[]),t.useEffect((()=>{const e=document.documentElement,t=e.style.overscrollBehavior;return e.style.overscrollBehavior="none",()=>{e.style.overscrollBehavior=t}}),[]);const c=!!l&&(null!==(a=n.schema.startMinimized)&&void 0!==a&&a),{wrapperRef:d,containerRef:u,sheetRef:p,minimizedChildRef:f,maximizedChildRef:h,isMinimized:v,setMinimized:C}=sl(c,o,l);return e.jsx(ea.Provider,{value:l,children:e.jsx(Dn,{children:i=>{var a,r;const c=t.Children.toArray(null===(a=n.schema.children)||void 0===a?void 0:a.map(((e,t)=>i(e,void 0,re(t,n.testId))))),y=l?t.Children.toArray(null===(r=n.schema.minimizedChildren)||void 0===r?void 0:r.map(((e,t)=>i(e,void 0,re(t,n.testId))))):[];return"default"===o?e.jsxs("div",{ref:d,style:{height:"100000px"},children:[e.jsx(dl,{schema:n.schema,testId:n.testId,minimized:v,onClose:n.schema.allowBackdropToClose?()=>s({type:vs.DISMISS_OVERLAY,payload:{id:Re,dismissalMethod:"rokt_backdrop"}}):void 0,onMinimize:l&&n.schema.allowBackdropToMinimize?()=>C(!0):void 0}),e.jsx(ml,Object.assign({},n,{containerRef:u,sheetRef:p,minimizedChildRef:f,maximizedChildRef:h,maximizedChildren:c,minimizedChildren:y,isMinimized:!!l&&v,setMinimized:l?C:void 0}))]}):e.jsx(Fs,Object.assign({},n,{children:(t,i)=>e.jsx(Bs,Object.assign({},n,{isAttached:!0,ref:i,children:c}))}))}})})}));const bl=i.connect((function(e){return{isOpen:e.active.has(Re)}})),El={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Il=t.forwardRef((function({schema:n,testId:i,children:o},r){Zs();const s=t.useRef(null),l=n.styles?a.mergeRight(El,n.styles):El;return t.useEffect((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e.jsx(Ka,{styles:l,children:({classnames:t})=>e.jsx("div",{style:{width:"100%",height:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end",display:"flex",flexDirection:"column",justifyContent:"flex-end"},ref:s,children:e.jsx("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",maxHeight:"100%",overflowY:"auto",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:r,tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:o})})})}));const xl=bl((function(t){const n=i.useSelector((e=>e.breakpoint.activeBreakpoint));return e.jsx(Ps,Object.assign({},t,{children:(i,a)=>"default"===n?e.jsx(Il,Object.assign({},t,{ref:a,children:i})):e.jsx(Bs,Object.assign({},t,{ref:a,children:i}))}))}));const Ll="DisplayPreset.FULLSCREEN",Dl="DisplayPreset.EMBEDDED",wl="DisplayPreset.ATTACHED",Sl="ERROR",Al="INFO",Tl="WARNING",Ml="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*jl(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(Be).includes(e.type)})(n)&&!e.includes(n.type)&&(yield r.call(t.globalDispatch.bind(t),n))}function*Ol(e,t,n){var i;const{action:a,offer:o,offerPositionIndex:s}=n.payload,l=null==t?void 0:t[a.type];if(l)yield*l(a,{offer:o,offerPositionIndex:s},e);else switch(a.type){case"Close":yield r.call(e.globalDispatch.bind(e),{type:Ve,payload:{id:Re,dismissalMethod:null!==(i=a.action.dismissalMethod)&&void 0!==i?i:void 0}});break;case"SetCustomState":yield r.call(e.globalDispatch.bind(e),{type:be,payload:{key:a.action.key,value:a.action.value}});break;case"CreativeResponse":{if(!o)break;const e=o.creative.responseOptionsMap[a.action.responseKey];if(!e||S(e))break;const t=ve(o,e,a.action.openLinks);yield r.put({type:le,payload:Object.assign(Object.assign({},t),{offerPositionIndex:s})});break}}}function kl(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function Vl(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Rl(e){return a.map(Vl,e)}function*Hl(e,t){const n=yield r.actionChannel(e,s.buffers.expanding(10));for(;n;){const e=yield r.take(n);yield r.call(t,e)}}function*_l(e,t){const n=yield r.take(e);yield r.call(t,n)}function*Pl(e){for(;;){const t=yield r.take(e);yield r.put(t)}}function*Nl(e,t){const n=a.over(a.lensProp("moduleName"),a.defaultTo("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Rl(n):{}});try{yield r.call(e,i)}catch(e){}t.payload.level===Sl&&(yield r.put({type:Le,payload:{name:"PLACEMENT_FAILURE"}}),yield r.put({type:vs.CLOSE_PLUGIN}))}const Fl="INVALID_RESPONSE_OBJECT",$l="FAILED_TO_OPEN_LINK",Zl="NO_PARENT_GUID",Gl="FAILED_TO_NOTIFY_INTERACTIVE",Bl="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var Ul=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function zl(e,t){return n=>n&&n.replace(e,t)}const ql=zl(/['""();{}@:[\]!/=]/g,""),Kl=/^(normal|italic|oblique( \d+deg)*)$/i,Wl=(e="")=>Kl.test(e)?e:void 0,Yl=zl(/[;{}@[\]!]/g,"");function Jl(e){const{fontFamily:t,sources:n}=e,i=Ul(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function Xl(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:ql(e.fontFamily)||"",style:Wl(e.style),weight:ql(e.weight),sources:e.sources.map((e=>Yl(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():Jl(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',Jl(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function Ql(e){const n=i.useDispatch(),a=i.useSelector((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=Ml.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return t.useEffect((()=>{Xl(JSON.parse(a)).catch((e=>{const t={type:os,payload:{level:Al,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};n(t)}))}),[a]),t.useEffect((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function*ec(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,s.eventChannel((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield r.take(a);for(yield r.put({type:hs.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield r.take(a),yield r.put({type:hs.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield r.put({type:os,payload:{level:Tl,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield r.cancelled())&&a.close()}}catch(e){const n=e;yield r.put({type:os,payload:{level:Sl,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function tc(e,t,n,i){return s.eventChannel((a=>{const o=e.subscribe((e=>{const t=n(e);t&&a({type:qr,payload:t})}),(e=>{a(e)})),r=t.fonts.subscribe((e=>{a({type:Ur,payload:e})}),(e=>{a(e)})),s=null==i?void 0:i.subscribe((e=>{a({type:Br,payload:e})}),(e=>{a(e)}));return()=>{o.unsubscribe(),r.unsubscribe(),null==s||s.unsubscribe()}}),s.buffers.sliding(3))}var nc=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),ic=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),ac=Object.freeze({__proto__:null,V1:nc,V2:ic}),oc=Object.freeze({__proto__:null,PartnerMessage:{UpsellItemInstantPurchaseResponse:"UPSELL_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{UpsellItemInstantPurchase:"UPSELL_ITEM_INSTANT_PURCHASE"}}),rc=Object.freeze({__proto__:null,V2:oc,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),sc=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const lc="LINK_NAVIGATION_REQUEST",cc="REALTIME_OFFER_FULFILLMENT_SUCCESS",dc="REALTIME_OFFER_FULFILLMENT_FAILURE";var uc=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())}))};const pc={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function fc(e){return uc(this,arguments,void 0,(function*({url:e,urlBehavior:t,external:n},i=window){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(lc,{url:e}).then((()=>null));const a=pc[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var hc=Object.freeze({__proto__:null,openLink:fc});function vc(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:os,payload:{level:Tl,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var Cc=Object.freeze({__proto__:null,makePluginWarningAction:vc});function yc(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var mc=Object.freeze({__proto__:null,isWindow:yc}),gc=Object.assign(Object.assign(Object.assign({},hc),Cc),mc);function bc(e){switch(e){case"ATTACHED":return wl;case"EMBEDDED":return Dl;default:return Ll}}function Ec(e,t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e.offsetBottom&&{bottom:Ut(e.offsetBottom)}),e.offsetLeft&&{left:Ut(e.offsetLeft)}),e.offsetRight&&{right:Ut(e.offsetRight)}),e.offsetTop&&{top:Ut(e.offsetTop)}),(e.offsetAnchorX||e.offsetAnchorY)&&{transform:`translate(${"center"===e.offsetAnchorX?e.offsetLeft?"-50%":"50%":"0"}, ${"center"===e.offsetAnchorY?e.offsetTop?"-50%":"50%":"0"})`}),e.maxWidth?{maxWidth:Ut(e.maxWidth)}:void 0),e.zIndex?{zIndex:e.zIndex}:void 0),t)}const Ic={position:"fixed",top:"0",right:"0",left:"0",width:"100vw",minWidth:"1px",height:"100dvh"};function xc(e){return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!0,outerCss:Object.assign(Object.assign({},Ic),e?Ec(e,{}):{})}}function Lc(e,t){const n={position:"fixed",top:"auto",right:"0",bottom:"0",left:"0",width:"100vw",minWidth:"1px",height:`${e}px`};return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!1,outerCss:Object.assign(Object.assign({},n),t?Ec(t,{}):{})}}const Dc=e=>e.settings.bottomsheetVisibleHeight,wc=e=>e.breakpoint.activeBreakpoint;function*Sc(e,t){const n={isMinimized:!1,lastSettings:null,controls:null!=t?t:null};yield c.all([c.takeLatest((e=>{var t;return e.type===ls&&(null===(t=e.payload)||void 0===t?void 0:t.key)===P}),Tc,e,n),c.takeLatest($r,jc,e,n),c.takeLatest(Yr,Mc,e,n)])}function*Ac(e,t,n){a.equals(t.lastSettings,n)||(t.lastSettings=n,yield c.call(e.setDisplaySettings,n))}function*Tc(e,t,n){t.isMinimized=1===n.payload.value;if("default"!==(yield c.select(wc)))return;if(!t.isMinimized)return void(yield*Ac(e,t,xc(t.controls)));const i=yield c.select(Dc);null!==i&&(yield*Ac(e,t,Lc(i,t.controls)))}function*Mc(e,t,n){if(!t.isMinimized)return;"default"===(yield c.select(wc))&&(yield*Ac(e,t,Lc(n.payload.height,t.controls)))}function*jc(e,t,n){if(!("default"===n.payload.activeBreakpoint))return void(yield*Ac(e,t,xc(t.controls)));if(!t.isMinimized)return void(yield*Ac(e,t,xc(t.controls)));const i=yield c.select(Dc);null!==i&&(yield*Ac(e,t,Lc(i,t.controls)))}function*Oc(e=10){(yield r.select((e=>e.signal.queue.length>0)))&&(yield c.delay(30),e>=1&&(yield*Oc(e-1)))}function*kc(e){try{yield*Oc(10),yield c.call(e.close)}catch(e){const t=gc.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield c.put(t)}}function*Vc(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&Y.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"UPDATE_CART_ITEM_MESSAGE":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_ITEM_INSTANT_PURCHASE":case"DELIVERY_DETAILS_SENT":case"UPSELL_CREATIVE_SENT":case"INITIATE_INSTANT_PURCHASE_EVENT":case"INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT":case"INITIATE_CART_ITEM_EVENT":case"PREPARE_DEVICE_PAY_EVENT":case"INITIATE_DEVICE_PAY_EVENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"ABORT_DEVICE_PAY_EVENT":case"COMPLETE_DEVICE_PAY_EVENT":case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Rc=a.propOr("FAILED_TO_PARSE_CONFIG","code");function*Hc(e,t){var n;const i=yield c.call(tc,e.configService,e.themeService,t,e.attributesService);for(;;)try{const e=yield c.take(i);yield c.put(e)}catch(e){const t=e;yield c.put({type:os,payload:{level:Sl,code:Rc(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*_c(e,t){yield c.all([c.spawn(Hc,e,t),c.takeEvery(Le,Vc,e.partnerInteractionService)])}function*Pc(e,t,n){const i=function(e,t){if("ATTACHEDBOTTOMSHEET"===e)return xc(t);if(!t)return{preset:bc(e)};switch(e){case"ATTACHED":return{autoresize:!0,applyHighestZIndex:!0,replaceTargetElement:"body",outerCss:Ec(t,{position:"fixed",width:"100%",minWidth:"1px"}),innerCss:{width:"100%"}};case"EMBEDDED":return{autoresize:!0,css:Ec(t,{width:"1px",minWidth:"100%"})};default:return{autoresize:!1,applyHighestZIndex:!0,replaceTargetElement:"body",css:Ec(t,{position:"fixed",height:"100%",width:"100%"})}}}(t,n);yield c.call(e.setDisplaySettings,i),"ATTACHEDBOTTOMSHEET"===t&&(yield c.spawn(Sc,e,n)),yield c.put({type:hs.ACTIVE_ADD,payload:{id:ys}})}function*Nc(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield r.call(e,{code:t.payload.code,level:Al,message:t.payload.message||"Plugin Generic Log",additionalInformation:Rl(i)})}catch(e){}}function*Fc(e){yield r.put({type:hs.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield r.put({type:ns})}function*$c(e){yield r.put({type:hs.QUEUE_SIGNAL,payload:e.payload}),yield r.put({type:ns})}function*Zc(e,t){const n=yield r.select((e=>e.signal.queue.filter((t=>Rs(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*Gc(e.signal,i(t));break;case"SignalViewed":yield*Bc(e.signal,i(t));break;case"SignalRenderGeometry":yield*Uc(e.signal,i(t));break;case"SignalDismissal":yield*zc(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*qc(e.signal,i(t));break;case"SignalLoadStart":yield*Kc(e.signal,i(t));break;case"SignalGatedResponse":case"SignalOptInResponse":case"SignalOptOutResponse":case"SignalResponse":yield*Wc(e.signal,i(t,!0));break;case"SignalProductItemResponse":yield*Yc(e.signal,i(t));break;case"SignalUserInteraction":yield*Jc(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*Xc(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*Qc(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*ed(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*td(e.signal,i(t))}yield r.put({type:hs.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?r.call(e.prepareExternalSignal,t.key,i,a,o):n?r.call(e.issueSignalSync,i,a,o):r.call(e.issueSignal,i,a,o)}}}function*Gc(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function*Bc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.supportedByBrowser.toString()},metadata:[{name:"inferred",value:e.inferred.toString()}]})}catch(t){yield nd(e,t)}}function*Uc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{widthPx:e.objectData.widthPx.toString(),heightPx:e.objectData.heightPx.toString()}})}catch(t){yield nd(e,t)}}function*zc(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield nd(e,t)}}function*qc(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield nd(e,t)}}function*Kc(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield nd(e,t)}}function*Wc(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return"SignalOptInResponse"===e.name&&(t.objectData={action:"opt-in"}),t}(e))}catch(t){yield nd(e,t)}}function*Yc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{catalogItemId:e.objectData.catalogItemId,productSku:e.objectData.productSku,catalogId:e.objectData.catalogId,accountId:e.objectData.accountId}})}catch(t){yield nd(e,t)}}function*Jc(e,t){var n,i,a,o;const s=e.parentGuid?e.parentGuid:yield r.select((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!s||"string"!=typeof s)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,s,{objectData:Object.assign(Object.assign(Object.assign(Object.assign({action:e.action,context:e.context},(null===(n=e.objectData)||void 0===n?void 0:n.startTimestamp)&&{startTimestamp:e.objectData.startTimestamp}),(null===(i=e.objectData)||void 0===i?void 0:i.endTimestamp)&&{endTimestamp:e.objectData.endTimestamp}),null!=(null===(a=e.objectData)||void 0===a?void 0:a.cardIndex)&&{cardIndex:e.objectData.cardIndex.toString()}),null!=(null===(o=e.objectData)||void 0===o?void 0:o.lastCardIndex)&&{lastCardIndex:e.objectData.lastCardIndex.toString()})})}catch(t){yield nd(e,t)}}function*Xc(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function*Qc(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function*ed(e,t){const n={objectData:Object.assign({catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy},e.objectData.purchaseId&&{purchaseId:e.objectData.purchaseId})};try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function*td(e,t){const n={objectData:Object.assign({catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId},e.objectData.purchaseId&&{purchaseId:e.objectData.purchaseId})};try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function nd(e,t){const n=gc.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return r.put(n)}function*id(e){yield r.put({type:ss,payload:e.payload})}const ad={[Pe]:cs,[Ne]:ds,[Fe]:us,[$e]:ps,[Ze]:fs},od=Object.keys(ad);function*rd(e){yield r.put({type:ad[e.type],payload:e.payload})}function*sd(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield r.select((e=>e.serializableCache.has(t))))||(yield r.call(e.notifyInteractive),yield r.put({type:Jr,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield r.put({type:os,payload:{level:Al,code:Gl,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*ld(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield r.call(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield r.call(fc,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield r.put(vc(e,"Failed to open link",$l,{url:t.payload.url,urlBehaviour:n}))}}function*cd(e){const t=yield r.select((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));if(e.payload.dismissalMethod===is&&t)return yield r.put({type:hs.SET_DOMAIN_STATE_REDUCER,payload:{key:P,value:1}}),void(yield r.put({type:Ce,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}));yield r.put({type:hs.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield r.put({type:Kr}),t?yield r.put({type:Ce,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield r.put({type:os,payload:{level:Al,code:Zl,message:"ParentGuid does not exist"}})}const dd=i.connect((function(e){return{isOpen:e.active.has(Re)}})),ud="undefined"!=typeof window;function pd(e,n){t.useEffect((()=>{if(!ud||n)return;const t=e.current;if(!t)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{t.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{t.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,n])}const fd="Minimized",hd="Maximized",vd=e=>{const n=t.useRef(null),i=t.useRef(null),a=t.useRef(null),o=t.useRef(null),r=t.useRef(null),s=t.useRef(0),l=t.useRef(0),c=t.useRef(!e),d=t.useRef(!1),u=e?hd:fd,p=xn(0,(e=>u?e.customStates[u]:0)),f=e?p?0:1:p,h=En(),v=Hi(),C=t.useRef(0),y=t.useRef(!1),m=t.useRef(0),g=t.useRef([]),E=t.useRef(void 0),{isDisabled:x}=b(v);pd(n,!!f);const L=e=>{if(c.current)(()=>{const e=n.current,t=i.current,r=a.current,s=o.current;e&&t&&r&&s&&0!==s.clientHeight&&(N(s.clientHeight),requestAnimationFrame((()=>{F(!0,800),N(0),c.current=!1})))})();else if(F(!!e),f){const e=(l.current||0)-(s.current||0);N(e);const t=n.current;if(t){const e=(s.current||0)+1;t.style.height=e+"px"}}else N(0),n.current&&(n.current.style.height="100000px")},D=({key:e,value:t})=>({type:be,payload:{key:e,value:t}}),w=()=>{const e=P();return f?e<=-.2:e>=.2},S=t.useCallback((()=>{G(),E.current=void 0,y.current=!1,F(!0);w()?j():N(0)}),[w]);t.useEffect((()=>{if(!d.current)return Z(!f,a),Z(!!f,o),void requestAnimationFrame((()=>{$(),d.current=!0}));f?(k(),h(yd(!0))):(V(),h(yd(!1)))}),[f,h]),t.useEffect((()=>{const e=function(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout((()=>{t(),n=void 0}),e)}}(100,(()=>{var e,t,n,i;s.current=null!==(t=null===(e=a.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,l.current=null!==(i=null===(n=o.current)||void 0===n?void 0:n.clientHeight)&&void 0!==i?i:0,L(c.current)})),t=new ResizeObserver(e),n=a.current,i=o.current;return n&&t.observe(n),i&&t.observe(i),()=>{t.disconnect()}}),[L]);const A=t.useCallback((e=>{if(i.current){e.preventDefault();const t=M(e);N(t)}}),[i]),T=t.useCallback((e=>{Date.now()-m.current<200||(m.current=Date.now(),f?O(!1):y.current||x||(y.current=!0,_(),E.current=Cd(e),F(!1),B()))}),[f,x]);t.useEffect((()=>{const e=i.current;return e&&(e.addEventListener("mousedown",T),e.addEventListener("touchstart",T)),()=>{null==e||e.removeEventListener("mousedown",T),null==e||e.removeEventListener("touchstart",T)}}),[i,T]);const M=e=>{var t,n;return(null!==(t=Cd(e))&&void 0!==t?t:0)-(null!==(n=E.current)&&void 0!==n?n:0)},j=()=>{O(!f)},O=e=>{[D({key:fd,value:e?1:0}),D({key:hd,value:e?0:1})].forEach((e=>{e&&h(e)}))},k=()=>{var e,t,n,i;if(c.current)return;const r=null!==(t=null===(e=a.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(i=null===(n=o.current)||void 0===n?void 0:n.clientHeight)&&void 0!==i?i:0)-r;F(!0),$(!0,!0),N(s),Z(!1,a),Z(!0,o),U()},V=()=>{c.current||(F(!0),$(!0,!1),N(0),E.current=void 0,Z(!0,a),Z(!1,o),z())},R=t.useCallback((()=>{y.current&&(H(),requestAnimationFrame(R))}),[]),H=()=>{g.current.push({yPosition:C.current,timestamp:Date.now()}),g.current.length>20&&g.current.shift()},_=t.useCallback((()=>{g.current=[],R()}),[R]),P=()=>{const e=g.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},N=e=>{const t=Math.round(e);C.current=t,i.current&&(i.current.style.transform=`translateY(${t}px)`)},F=(e,t=200)=>{e?i.current&&(i.current.style.transition=`transform ${t}ms`):i.current&&(i.current.style.transition="")},$=(e,t=!1)=>{const n=t?o:a,i=t?a:o;i.current&&(i.current.style.transition="opacity .5s"),n.current&&(n.current.style.transition="opacity .2s")},Z=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},G=t.useCallback((()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",S)}),[A,S]),B=t.useCallback((()=>{I()?(document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",S)):(document.addEventListener("mousemove",A,{passive:!1}),document.addEventListener("mouseup",S))}),[A,S]),U=()=>{const e=n.current;e&&(r.current=setTimeout((()=>{var t;const n=((null===(t=a.current)||void 0===t?void 0:t.clientHeight)||0)+1;e.style.height=n+"px"}),200))},z=()=>{r.current&&clearTimeout(r.current),n.current&&(n.current.style.height="100000px")};return{wrapperRef:n,containerRef:i,minimizedChildRef:a,maximizedChildRef:o}};function Cd(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const yd=e=>({type:Ce,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}});const md={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var gd;function bd({schema:n,testId:o}){var r;const s=tt(),l=i.useSelector((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=i.useSelector((e=>e.active.has(ys))),d=t.useRef(null),u=i.useDispatch(),p=()=>{u({type:vs.DISMISS_OVERLAY,payload:{id:Re,dismissalMethod:as}})},f=null!==(r=n.startMinimized)&&void 0!==r&&r,h=f?hd:fd,v=xn(0,(e=>h?e.customStates[h]:0)),C=f?v?0:1:v;t.useEffect((()=>{y(!!C)}),[C]),pd(d,!!C);const y=e=>{const t=d.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};t.useEffect((()=>{l&&u({type:Ce,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),t.useEffect((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const m=Hi(),{tabIndex:g,isDisabled:E,styles:I}=b(m),x=n.styles?a.mergeRight(md,n.styles):md;return e.jsx(Ka,{styles:x,children:({classnames:t})=>{var i;return e.jsx("div",{className:null==t?void 0:t.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:f?"0":"1",transition:"opacity 0.2s ease-in-out"},I),"aria-label":null!==(i=n.a11yLabel)&&void 0!==i?i:void 0,"aria-hidden":E,role:"dialog","aria-modal":!0,tabIndex:g,"data-testid":o,"data-e2e":"Overlay-Wrapper",ref:d,children:e.jsx("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:n.allowBackdropToClose?p:void 0,"data-testid":o&&`${o}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function Ed(){return e.jsx("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(gd||(gd={}));const Id={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function xd(t){const n=i.useSelector((e=>e.slots)),a=i.useSelector((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e.jsx(Ld,Object.assign({},t,{slots:n,currentIndex:a}))}function Ld(t){var n;const i=null!==(n=t.schema.startMinimized)&&void 0!==n&&n,{wrapperRef:a,containerRef:o,minimizedChildRef:r,maximizedChildRef:s}=vd(i);return t.isOpen?e.jsxs("div",{ref:a,style:{height:"100000px"},children:[e.jsx(bd,Object.assign({},t)),e.jsx(wd,Object.assign({},t,{startMinimized:i,containerRef:o,minimizedChildRef:r,maximizedChildRef:s}))]}):null}const Dd=o.css`
118
+ `),[C,I,x]);!function(e){const n=t.useCallback((()=>{const t=e.current;if(!t)return;const n=Array.from(t.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0),i=getComputedStyle(t),a="border-box"===i.boxSizing?(parseFloat(i.paddingTop)||0)+(parseFloat(i.paddingBottom)||0):0;t.style.height=`${n+a}px`}),[e]);t.useEffect((()=>{const t=e.current;if(!t)return;const i=new ResizeObserver((()=>n())),a=()=>{i.disconnect(),Array.from(t.children).forEach((e=>i.observe(e))),n()};a();const o=new MutationObserver(a);return o.observe(t,{childList:!0}),()=>{i.disconnect(),o.disconnect()}}),[n,e])}(v);const D=t.useRef(null),w=t.useRef(!1),S=t.useCallback((e=>{u&&p&&(w.current=!0,D.current=e.clientY)}),[u,p]),A=t.useCallback((()=>{u&&p&&w.current&&(w.current=!1,p(!1))}),[u,p]),T=t.useCallback((e=>{if(!u||!p)return;const t=D.current;null!==t&&t-e.clientY>=24&&(D.current=null,p(!1))}),[u,p]),M=t.useCallback((e=>{D.current=null,"pointercancel"===e.type&&(w.current=!1)}),[]);return e.jsx(Ka,{styles:b,children:({classnames:t})=>{var a;return e.jsx("div",{style:{width:"100%",position:"absolute",bottom:"-120vh",zIndex:9999,transform:"translateY(1000px)",visibility:"hidden"},ref:s,children:e.jsxs("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:h,children:[e.jsx("div",{ref:o,className:null==t?void 0:t.own,style:{height:"100%",position:"relative",outline:"none",pointerEvents:u?"auto":void 0},tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:e.jsxs("div",{"data-testid":i&&u?`${i}-expand`:void 0,style:u?{cursor:"pointer",touchAction:"none"}:void 0,role:u?"button":void 0,tabIndex:u?0:void 0,"aria-label":u?"Expand":void 0,onClick:u?A:void 0,onPointerDown:u?S:void 0,onPointerMove:u?T:void 0,onPointerUp:u?M:void 0,onPointerCancel:u?M:void 0,onKeyDown:u&&p?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),p(!1))}:void 0,children:[!1!==n.showDragHandle&&!1!==n.isMinimizable&&e.jsx(ul,{className:null==t?void 0:t.dragHandle,style:{pointerEvents:u?"none":void 0}}),e.jsx("div",{className:u?void 0:g,children:e.jsxs("div",{ref:v,className:y,"aria-label":u?void 0:null!==(a=n.a11yLabel)&&void 0!==a?a:void 0,style:{pointerEvents:u?"auto":void 0},[Ws]:"",children:[e.jsx("div",{ref:l,style:{width:"100%"},children:c}),e.jsx("div",{ref:r,className:`${L}${u?` ${m}`:""}`,style:{width:"100%",padding:"0px 16px 6px"},children:d})]})})]})}),e.jsx("div",{className:E,style:{marginTop:"-1px"}})]})})}})}));const gl=zs((function(n){var a;const o=i.useSelector((e=>e.breakpoint.activeBreakpoint)),r=i.useSelector((e=>e.settings.explicitCloseOnComplete)),s=i.useDispatch(),l=!1!==n.schema.isMinimizable;t.useEffect((()=>{l&&!0===n.schema.minimizeOnComplete&&!r&&s({type:Wr,payload:{minimizeOnComplete:!0}})}),[]),t.useEffect((()=>{const e=document.documentElement,t=e.style.overscrollBehavior;return e.style.overscrollBehavior="none",()=>{e.style.overscrollBehavior=t}}),[]);const c=!!l&&(null!==(a=n.schema.startMinimized)&&void 0!==a&&a),{wrapperRef:d,containerRef:u,sheetRef:p,minimizedChildRef:f,maximizedChildRef:h,isMinimized:v,setMinimized:C}=sl(c,o,l);return e.jsx(ea.Provider,{value:l,children:e.jsx(Dn,{children:i=>{var a,r;const c=t.Children.toArray(null===(a=n.schema.children)||void 0===a?void 0:a.map(((e,t)=>i(e,void 0,re(t,n.testId))))),y=l?t.Children.toArray(null===(r=n.schema.minimizedChildren)||void 0===r?void 0:r.map(((e,t)=>i(e,void 0,re(t,n.testId))))):[];return"default"===o?e.jsxs("div",{ref:d,style:{height:"100000px"},children:[e.jsx(dl,{schema:n.schema,testId:n.testId,minimized:v,onClose:n.schema.allowBackdropToClose?()=>s({type:vs.DISMISS_OVERLAY,payload:{id:Re,dismissalMethod:"rokt_backdrop"}}):void 0,onMinimize:l&&n.schema.allowBackdropToMinimize?()=>C(!0):void 0}),e.jsx(ml,Object.assign({},n,{containerRef:u,sheetRef:p,minimizedChildRef:f,maximizedChildRef:h,maximizedChildren:c,minimizedChildren:y,isMinimized:!!l&&v,setMinimized:l?C:void 0}))]}):e.jsx(Fs,Object.assign({},n,{children:(t,i)=>e.jsx(Bs,Object.assign({},n,{isAttached:!0,ref:i,children:c}))}))}})})}));const bl=i.connect((function(e){return{isOpen:e.active.has(Re)}})),El={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Il=t.forwardRef((function({schema:n,testId:i,children:o},r){Zs();const s=t.useRef(null),l=n.styles?a.mergeRight(El,n.styles):El;return t.useEffect((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e.jsx(Ka,{styles:l,children:({classnames:t})=>e.jsx("div",{style:{width:"100%",height:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end",display:"flex",flexDirection:"column",justifyContent:"flex-end"},ref:s,children:e.jsx("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",maxHeight:"100%",overflowY:"auto",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:r,tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:o})})})}));const xl=bl((function(t){const n=i.useSelector((e=>e.breakpoint.activeBreakpoint));return e.jsx(Ps,Object.assign({},t,{children:(i,a)=>"default"===n?e.jsx(Il,Object.assign({},t,{ref:a,children:i})):e.jsx(Bs,Object.assign({},t,{ref:a,children:i}))}))}));const Ll="DisplayPreset.FULLSCREEN",Dl="DisplayPreset.EMBEDDED",wl="DisplayPreset.ATTACHED",Sl="ERROR",Al="INFO",Tl="WARNING",Ml="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*jl(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(Be).includes(e.type)})(n)&&!e.includes(n.type)&&(yield r.call(t.globalDispatch.bind(t),n))}function*Ol(e,t,n){var i;const{action:a,offer:o,offerPositionIndex:s}=n.payload,l=null==t?void 0:t[a.type];if(l)yield*l(a,{offer:o,offerPositionIndex:s},e);else switch(a.type){case"Close":yield r.call(e.globalDispatch.bind(e),{type:Ve,payload:{id:Re,dismissalMethod:null!==(i=a.action.dismissalMethod)&&void 0!==i?i:void 0}});break;case"SetCustomState":yield r.call(e.globalDispatch.bind(e),{type:be,payload:{key:a.action.key,value:a.action.value}});break;case"CreativeResponse":{if(!o)break;const e=o.creative.responseOptionsMap[a.action.responseKey];if(!e||S(e))break;const t=ve(o,e,a.action.openLinks);yield r.put({type:le,payload:Object.assign(Object.assign({},t),{offerPositionIndex:s})});break}}}function kl(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function Vl(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Rl(e){return a.map(Vl,e)}function*Hl(e,t){const n=yield r.actionChannel(e,s.buffers.expanding(10));for(;n;){const e=yield r.take(n);yield r.call(t,e)}}function*_l(e,t){const n=yield r.take(e);yield r.call(t,n)}function*Pl(e){for(;;){const t=yield r.take(e);yield r.put(t)}}function*Nl(e,t){const n=a.over(a.lensProp("moduleName"),a.defaultTo("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Rl(n):{}});try{yield r.call(e,i)}catch(e){}t.payload.level===Sl&&(yield r.put({type:Le,payload:{name:"PLACEMENT_FAILURE"}}),yield r.put({type:vs.CLOSE_PLUGIN}))}const Fl="INVALID_RESPONSE_OBJECT",$l="FAILED_TO_OPEN_LINK",Zl="NO_PARENT_GUID",Gl="FAILED_TO_NOTIFY_INTERACTIVE",Bl="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var Ul=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function zl(e,t){return n=>n&&n.replace(e,t)}const ql=zl(/['""();{}@:[\]!/=]/g,""),Kl=/^(normal|italic|oblique( \d+deg)*)$/i,Wl=(e="")=>Kl.test(e)?e:void 0,Yl=zl(/[;{}@[\]!]/g,"");function Jl(e){const{fontFamily:t,sources:n}=e,i=Ul(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function Xl(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:ql(e.fontFamily)||"",style:Wl(e.style),weight:ql(e.weight),sources:e.sources.map((e=>Yl(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():Jl(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',Jl(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function Ql(e){const n=i.useDispatch(),a=i.useSelector((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=Ml.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return t.useEffect((()=>{Xl(JSON.parse(a)).catch((e=>{const t={type:os,payload:{level:Al,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};n(t)}))}),[a]),t.useEffect((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function*ec(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,s.eventChannel((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield r.take(a);for(yield r.put({type:hs.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield r.take(a),yield r.put({type:hs.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield r.put({type:os,payload:{level:Tl,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield r.cancelled())&&a.close()}}catch(e){const n=e;yield r.put({type:os,payload:{level:Sl,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function tc(e,t,n,i){return s.eventChannel((a=>{const o=e.subscribe((e=>{const t=n(e);t&&a({type:qr,payload:t})}),(e=>{a(e)})),r=t.fonts.subscribe((e=>{a({type:Ur,payload:e})}),(e=>{a(e)})),s=null==i?void 0:i.subscribe((e=>{a({type:Br,payload:e})}),(e=>{a(e)}));return()=>{o.unsubscribe(),r.unsubscribe(),null==s||s.unsubscribe()}}),s.buffers.sliding(3))}var nc=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),ic=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),ac=Object.freeze({__proto__:null,V1:nc,V2:ic}),oc=Object.freeze({__proto__:null,PartnerMessage:{UpsellItemInstantPurchaseResponse:"UPSELL_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{UpsellItemInstantPurchase:"UPSELL_ITEM_INSTANT_PURCHASE"}}),rc=Object.freeze({__proto__:null,V2:oc,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),sc=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const lc="LINK_NAVIGATION_REQUEST",cc="REALTIME_OFFER_FULFILLMENT_SUCCESS",dc="REALTIME_OFFER_FULFILLMENT_FAILURE";var uc=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())}))};const pc={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function fc(e){return uc(this,arguments,void 0,(function*({url:e,urlBehavior:t,external:n},i=window){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(lc,{url:e}).then((()=>null));const a=pc[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var hc=Object.freeze({__proto__:null,openLink:fc});function vc(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:os,payload:{level:Tl,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var Cc=Object.freeze({__proto__:null,makePluginWarningAction:vc});function yc(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var mc=Object.freeze({__proto__:null,isWindow:yc}),gc=Object.assign(Object.assign(Object.assign({},hc),Cc),mc);function bc(e){switch(e){case"ATTACHED":return wl;case"EMBEDDED":return Dl;default:return Ll}}function Ec(e,t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e.offsetBottom&&{bottom:Ut(e.offsetBottom)}),e.offsetLeft&&{left:Ut(e.offsetLeft)}),e.offsetRight&&{right:Ut(e.offsetRight)}),e.offsetTop&&{top:Ut(e.offsetTop)}),(e.offsetAnchorX||e.offsetAnchorY)&&{transform:`translate(${"center"===e.offsetAnchorX?e.offsetLeft?"-50%":"50%":"0"}, ${"center"===e.offsetAnchorY?e.offsetTop?"-50%":"50%":"0"})`}),e.maxWidth?{maxWidth:Ut(e.maxWidth)}:void 0),e.zIndex?{zIndex:e.zIndex}:void 0),t)}const Ic={position:"fixed",top:"0",right:"0",left:"0",width:"100vw",minWidth:"1px",height:"100dvh"};function xc(e){return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!0,outerCss:Object.assign(Object.assign({},Ic),e?Ec(e,{}):{})}}function Lc(e,t){const n={position:"fixed",top:"auto",right:"0",bottom:"0",left:"0",width:"100vw",minWidth:"1px",height:`${e}px`};return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!1,outerCss:Object.assign(Object.assign({},n),t?Ec(t,{}):{})}}const Dc=e=>e.settings.bottomsheetVisibleHeight,wc=e=>e.breakpoint.activeBreakpoint;function*Sc(e,t){const n={isMinimized:!1,lastSettings:null,controls:null!=t?t:null};yield c.all([c.takeLatest((e=>{var t;return e.type===ls&&(null===(t=e.payload)||void 0===t?void 0:t.key)===P}),Tc,e,n),c.takeLatest($r,jc,e,n),c.takeLatest(Yr,Mc,e,n)])}function*Ac(e,t,n){a.equals(t.lastSettings,n)||(t.lastSettings=n,yield c.call(e.setDisplaySettings,n))}function*Tc(e,t,n){t.isMinimized=1===n.payload.value;if("default"!==(yield c.select(wc)))return;if(!t.isMinimized)return void(yield*Ac(e,t,xc(t.controls)));const i=yield c.select(Dc);null!==i&&(yield*Ac(e,t,Lc(i,t.controls)))}function*Mc(e,t,n){if(!t.isMinimized)return;"default"===(yield c.select(wc))&&(yield*Ac(e,t,Lc(n.payload.height,t.controls)))}function*jc(e,t,n){if(!("default"===n.payload.activeBreakpoint))return void(yield*Ac(e,t,xc(t.controls)));if(!t.isMinimized)return void(yield*Ac(e,t,xc(t.controls)));const i=yield c.select(Dc);null!==i&&(yield*Ac(e,t,Lc(i,t.controls)))}function*Oc(e=10){(yield r.select((e=>e.signal.queue.length>0)))&&(yield c.delay(30),e>=1&&(yield*Oc(e-1)))}function*kc(e){try{yield*Oc(10),yield c.call(e.close)}catch(e){const t=gc.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield c.put(t)}}function*Vc(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&Y.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"UPDATE_CART_ITEM_MESSAGE":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_ITEM_INSTANT_PURCHASE":case"DELIVERY_DETAILS_SENT":case"UPSELL_CREATIVE_SENT":case"INITIATE_INSTANT_PURCHASE_EVENT":case"INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT":case"INITIATE_CART_ITEM_EVENT":case"PREPARE_DEVICE_PAY_EVENT":case"INITIATE_DEVICE_PAY_EVENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"ABORT_DEVICE_PAY_EVENT":case"COMPLETE_DEVICE_PAY_EVENT":case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Rc=a.propOr("FAILED_TO_PARSE_CONFIG","code");function*Hc(e,t){var n;const i=yield c.call(tc,e.configService,e.themeService,t,e.attributesService);for(;;)try{const e=yield c.take(i);yield c.put(e)}catch(e){const t=e;yield c.put({type:os,payload:{level:Sl,code:Rc(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*_c(e,t){yield c.all([c.spawn(Hc,e,t),c.takeEvery(Le,Vc,e.partnerInteractionService)])}function*Pc(e,t,n){const i=function(e,t){if("ATTACHEDBOTTOMSHEET"===e)return xc(t);if(!t)return{preset:bc(e)};switch(e){case"ATTACHED":return{autoresize:!0,applyHighestZIndex:!0,replaceTargetElement:"body",outerCss:Ec(t,{position:"fixed",width:"100%",minWidth:"1px"}),innerCss:{width:"100%"}};case"EMBEDDED":return{autoresize:!0,css:Ec(t,{width:"1px",minWidth:"100%"})};default:return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!0,replaceTargetElement:"body",css:Ec(t,{position:"fixed",height:"100%",width:"100%"})}}}(t,n);yield c.call(e.setDisplaySettings,i),"ATTACHEDBOTTOMSHEET"===t&&(yield c.spawn(Sc,e,n)),yield c.put({type:hs.ACTIVE_ADD,payload:{id:ys}})}function*Nc(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield r.call(e,{code:t.payload.code,level:Al,message:t.payload.message||"Plugin Generic Log",additionalInformation:Rl(i)})}catch(e){}}function*Fc(e){yield r.put({type:hs.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield r.put({type:ns})}function*$c(e){yield r.put({type:hs.QUEUE_SIGNAL,payload:e.payload}),yield r.put({type:ns})}function*Zc(e,t){const n=yield r.select((e=>e.signal.queue.filter((t=>Rs(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*Gc(e.signal,i(t));break;case"SignalViewed":yield*Bc(e.signal,i(t));break;case"SignalRenderGeometry":yield*Uc(e.signal,i(t));break;case"SignalDismissal":yield*zc(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*qc(e.signal,i(t));break;case"SignalLoadStart":yield*Kc(e.signal,i(t));break;case"SignalGatedResponse":case"SignalOptInResponse":case"SignalOptOutResponse":case"SignalResponse":yield*Wc(e.signal,i(t,!0));break;case"SignalProductItemResponse":yield*Yc(e.signal,i(t));break;case"SignalUserInteraction":yield*Jc(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*Xc(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*Qc(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*ed(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*td(e.signal,i(t))}yield r.put({type:hs.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?r.call(e.prepareExternalSignal,t.key,i,a,o):n?r.call(e.issueSignalSync,i,a,o):r.call(e.issueSignal,i,a,o)}}}function*Gc(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function*Bc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.supportedByBrowser.toString()},metadata:[{name:"inferred",value:e.inferred.toString()}]})}catch(t){yield nd(e,t)}}function*Uc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{widthPx:e.objectData.widthPx.toString(),heightPx:e.objectData.heightPx.toString()}})}catch(t){yield nd(e,t)}}function*zc(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield nd(e,t)}}function*qc(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield nd(e,t)}}function*Kc(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield nd(e,t)}}function*Wc(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return"SignalOptInResponse"===e.name&&(t.objectData={action:"opt-in"}),t}(e))}catch(t){yield nd(e,t)}}function*Yc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{catalogItemId:e.objectData.catalogItemId,productSku:e.objectData.productSku,catalogId:e.objectData.catalogId,accountId:e.objectData.accountId}})}catch(t){yield nd(e,t)}}function*Jc(e,t){var n,i,a,o;const s=e.parentGuid?e.parentGuid:yield r.select((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!s||"string"!=typeof s)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,s,{objectData:Object.assign(Object.assign(Object.assign(Object.assign({action:e.action,context:e.context},(null===(n=e.objectData)||void 0===n?void 0:n.startTimestamp)&&{startTimestamp:e.objectData.startTimestamp}),(null===(i=e.objectData)||void 0===i?void 0:i.endTimestamp)&&{endTimestamp:e.objectData.endTimestamp}),null!=(null===(a=e.objectData)||void 0===a?void 0:a.cardIndex)&&{cardIndex:e.objectData.cardIndex.toString()}),null!=(null===(o=e.objectData)||void 0===o?void 0:o.lastCardIndex)&&{lastCardIndex:e.objectData.lastCardIndex.toString()})})}catch(t){yield nd(e,t)}}function*Xc(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function*Qc(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function*ed(e,t){const n={objectData:Object.assign({catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy},e.objectData.purchaseId&&{purchaseId:e.objectData.purchaseId})};try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function*td(e,t){const n={objectData:Object.assign({catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId},e.objectData.purchaseId&&{purchaseId:e.objectData.purchaseId})};try{yield t(e.name,e.parentGuid,n)}catch(t){yield nd(e,t)}}function nd(e,t){const n=gc.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return r.put(n)}function*id(e){yield r.put({type:ss,payload:e.payload})}const ad={[Pe]:cs,[Ne]:ds,[Fe]:us,[$e]:ps,[Ze]:fs},od=Object.keys(ad);function*rd(e){yield r.put({type:ad[e.type],payload:e.payload})}function*sd(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield r.select((e=>e.serializableCache.has(t))))||(yield r.call(e.notifyInteractive),yield r.put({type:Jr,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield r.put({type:os,payload:{level:Al,code:Gl,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*ld(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield r.call(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield r.call(fc,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield r.put(vc(e,"Failed to open link",$l,{url:t.payload.url,urlBehaviour:n}))}}function*cd(e){const t=yield r.select((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));if(e.payload.dismissalMethod===is&&t)return yield r.put({type:hs.SET_DOMAIN_STATE_REDUCER,payload:{key:P,value:1}}),void(yield r.put({type:Ce,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}));yield r.put({type:hs.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield r.put({type:Kr}),t?yield r.put({type:Ce,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield r.put({type:os,payload:{level:Al,code:Zl,message:"ParentGuid does not exist"}})}const dd=i.connect((function(e){return{isOpen:e.active.has(Re)}})),ud="undefined"!=typeof window;function pd(e,n){t.useEffect((()=>{if(!ud||n)return;const t=e.current;if(!t)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{t.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{t.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,n])}const fd="Minimized",hd="Maximized",vd=e=>{const n=t.useRef(null),i=t.useRef(null),a=t.useRef(null),o=t.useRef(null),r=t.useRef(null),s=t.useRef(0),l=t.useRef(0),c=t.useRef(!e),d=t.useRef(!1),u=e?hd:fd,p=xn(0,(e=>u?e.customStates[u]:0)),f=e?p?0:1:p,h=En(),v=Hi(),C=t.useRef(0),y=t.useRef(!1),m=t.useRef(0),g=t.useRef([]),E=t.useRef(void 0),{isDisabled:x}=b(v);pd(n,!!f);const L=e=>{if(c.current)(()=>{const e=n.current,t=i.current,r=a.current,s=o.current;e&&t&&r&&s&&0!==s.clientHeight&&(N(s.clientHeight),requestAnimationFrame((()=>{F(!0,800),N(0),c.current=!1})))})();else if(F(!!e),f){const e=(l.current||0)-(s.current||0);N(e);const t=n.current;if(t){const e=(s.current||0)+1;t.style.height=e+"px"}}else N(0),n.current&&(n.current.style.height="100000px")},D=({key:e,value:t})=>({type:be,payload:{key:e,value:t}}),w=()=>{const e=P();return f?e<=-.2:e>=.2},S=t.useCallback((()=>{G(),E.current=void 0,y.current=!1,F(!0);w()?j():N(0)}),[w]);t.useEffect((()=>{if(!d.current)return Z(!f,a),Z(!!f,o),void requestAnimationFrame((()=>{$(),d.current=!0}));f?(k(),h(yd(!0))):(V(),h(yd(!1)))}),[f,h]),t.useEffect((()=>{const e=function(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout((()=>{t(),n=void 0}),e)}}(100,(()=>{var e,t,n,i;s.current=null!==(t=null===(e=a.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,l.current=null!==(i=null===(n=o.current)||void 0===n?void 0:n.clientHeight)&&void 0!==i?i:0,L(c.current)})),t=new ResizeObserver(e),n=a.current,i=o.current;return n&&t.observe(n),i&&t.observe(i),()=>{t.disconnect()}}),[L]);const A=t.useCallback((e=>{if(i.current){e.preventDefault();const t=M(e);N(t)}}),[i]),T=t.useCallback((e=>{Date.now()-m.current<200||(m.current=Date.now(),f?O(!1):y.current||x||(y.current=!0,_(),E.current=Cd(e),F(!1),B()))}),[f,x]);t.useEffect((()=>{const e=i.current;return e&&(e.addEventListener("mousedown",T),e.addEventListener("touchstart",T)),()=>{null==e||e.removeEventListener("mousedown",T),null==e||e.removeEventListener("touchstart",T)}}),[i,T]);const M=e=>{var t,n;return(null!==(t=Cd(e))&&void 0!==t?t:0)-(null!==(n=E.current)&&void 0!==n?n:0)},j=()=>{O(!f)},O=e=>{[D({key:fd,value:e?1:0}),D({key:hd,value:e?0:1})].forEach((e=>{e&&h(e)}))},k=()=>{var e,t,n,i;if(c.current)return;const r=null!==(t=null===(e=a.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(i=null===(n=o.current)||void 0===n?void 0:n.clientHeight)&&void 0!==i?i:0)-r;F(!0),$(!0,!0),N(s),Z(!1,a),Z(!0,o),U()},V=()=>{c.current||(F(!0),$(!0,!1),N(0),E.current=void 0,Z(!0,a),Z(!1,o),z())},R=t.useCallback((()=>{y.current&&(H(),requestAnimationFrame(R))}),[]),H=()=>{g.current.push({yPosition:C.current,timestamp:Date.now()}),g.current.length>20&&g.current.shift()},_=t.useCallback((()=>{g.current=[],R()}),[R]),P=()=>{const e=g.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},N=e=>{const t=Math.round(e);C.current=t,i.current&&(i.current.style.transform=`translateY(${t}px)`)},F=(e,t=200)=>{e?i.current&&(i.current.style.transition=`transform ${t}ms`):i.current&&(i.current.style.transition="")},$=(e,t=!1)=>{const n=t?o:a,i=t?a:o;i.current&&(i.current.style.transition="opacity .5s"),n.current&&(n.current.style.transition="opacity .2s")},Z=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},G=t.useCallback((()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",S)}),[A,S]),B=t.useCallback((()=>{I()?(document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",S)):(document.addEventListener("mousemove",A,{passive:!1}),document.addEventListener("mouseup",S))}),[A,S]),U=()=>{const e=n.current;e&&(r.current=setTimeout((()=>{var t;const n=((null===(t=a.current)||void 0===t?void 0:t.clientHeight)||0)+1;e.style.height=n+"px"}),200))},z=()=>{r.current&&clearTimeout(r.current),n.current&&(n.current.style.height="100000px")};return{wrapperRef:n,containerRef:i,minimizedChildRef:a,maximizedChildRef:o}};function Cd(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const yd=e=>({type:Ce,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}});const md={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var gd;function bd({schema:n,testId:o}){var r;const s=tt(),l=i.useSelector((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=i.useSelector((e=>e.active.has(ys))),d=t.useRef(null),u=i.useDispatch(),p=()=>{u({type:vs.DISMISS_OVERLAY,payload:{id:Re,dismissalMethod:as}})},f=null!==(r=n.startMinimized)&&void 0!==r&&r,h=f?hd:fd,v=xn(0,(e=>h?e.customStates[h]:0)),C=f?v?0:1:v;t.useEffect((()=>{y(!!C)}),[C]),pd(d,!!C);const y=e=>{const t=d.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};t.useEffect((()=>{l&&u({type:Ce,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),t.useEffect((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const m=Hi(),{tabIndex:g,isDisabled:E,styles:I}=b(m),x=n.styles?a.mergeRight(md,n.styles):md;return e.jsx(Ka,{styles:x,children:({classnames:t})=>{var i;return e.jsx("div",{className:null==t?void 0:t.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:f?"0":"1",transition:"opacity 0.2s ease-in-out"},I),"aria-label":null!==(i=n.a11yLabel)&&void 0!==i?i:void 0,"aria-hidden":E,role:"dialog","aria-modal":!0,tabIndex:g,"data-testid":o,"data-e2e":"Overlay-Wrapper",ref:d,children:e.jsx("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:n.allowBackdropToClose?p:void 0,"data-testid":o&&`${o}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function Ed(){return e.jsx("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(gd||(gd={}));const Id={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function xd(t){const n=i.useSelector((e=>e.slots)),a=i.useSelector((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e.jsx(Ld,Object.assign({},t,{slots:n,currentIndex:a}))}function Ld(t){var n;const i=null!==(n=t.schema.startMinimized)&&void 0!==n&&n,{wrapperRef:a,containerRef:o,minimizedChildRef:r,maximizedChildRef:s}=vd(i);return t.isOpen?e.jsxs("div",{ref:a,style:{height:"100000px"},children:[e.jsx(bd,Object.assign({},t)),e.jsx(wd,Object.assign({},t,{startMinimized:i,containerRef:o,minimizedChildRef:r,maximizedChildRef:s}))]}):null}const Dd=o.css`
119
119
  display: flex;
120
120
  position: relative;
121
121
  overflow: hidden;
package/dist/index.js CHANGED
@@ -115,7 +115,7 @@ import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as i from
115
115
  `),[g]),{mergedStyles:L,tailClass:D,backgroundColor:w,darkBackgroundColor:S}=c((()=>{var e,n;return Ld(g,t.styles?Me(Dd,t.styles):Dd,120,null===(n=null===(e=t.styles)||void 0===e?void 0:e.elements)||void 0===n?void 0:n.own)}),[g,t.styles]),A=c((()=>g`
116
116
  background-color: ${w};
117
117
  ${S?`@media (prefers-color-scheme: dark) { background-color: ${S}; }`:""}
118
- `),[g,w,S]);!function(e){const t=s((()=>{const t=e.current;if(!t)return;const n=Array.from(t.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0),i=getComputedStyle(t),a="border-box"===i.boxSizing?(parseFloat(i.paddingTop)||0)+(parseFloat(i.paddingBottom)||0):0;t.style.height=`${n+a}px`}),[e]);o((()=>{const n=e.current;if(!n)return;const i=new ResizeObserver((()=>t())),a=()=>{i.disconnect(),Array.from(n.children).forEach((e=>i.observe(e))),t()};a();const o=new MutationObserver(a);return o.observe(n,{childList:!0}),()=>{i.disconnect(),o.disconnect()}}),[t,e])}(m);const x=r(null),T=r(!1),O=s((e=>{f&&v&&(T.current=!0,x.current=e.clientY)}),[f,v]),M=s((()=>{f&&v&&T.current&&(T.current=!1,v(!1))}),[f,v]),V=s((e=>{if(!f||!v)return;const t=x.current;null!==t&&t-e.clientY>=24&&(x.current=null,v(!1))}),[f,v]),H=s((e=>{x.current=null,"pointercancel"===e.type&&(T.current=!1)}),[]);return e(nl,{styles:L,children:({classnames:o})=>{var r;return e("div",{style:{width:"100%",position:"absolute",bottom:"-120vh",zIndex:9999,transform:"translateY(1000px)",visibility:"hidden"},ref:d,children:n("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:C,children:[e("div",{ref:a,className:null==o?void 0:o.own,style:{height:"100%",position:"relative",outline:"none",pointerEvents:f?"auto":void 0},tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:n("div",{"data-testid":i&&f?`${i}-expand`:void 0,style:f?{cursor:"pointer",touchAction:"none"}:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,"aria-label":f?"Expand":void 0,onClick:f?M:void 0,onPointerDown:f?O:void 0,onPointerMove:f?V:void 0,onPointerUp:f?H:void 0,onPointerCancel:f?H:void 0,onKeyDown:f&&v?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v(!1))}:void 0,children:[!1!==t.showDragHandle&&!1!==t.isMinimizable&&e(md,{className:null==o?void 0:o.dragHandle,style:{pointerEvents:f?"none":void 0}}),e("div",{className:f?void 0:E,children:n("div",{ref:m,className:b,"aria-label":f?void 0:null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,style:{pointerEvents:f?"auto":void 0},[nd]:"",children:[e("div",{ref:u,style:{width:"100%"},children:p}),e("div",{ref:l,className:`${A}${f?` ${I}`:""}`,style:{width:"100%",padding:"0px 16px 6px"},children:h})]})})]})}),e("div",{className:D,style:{marginTop:"-1px"}})]})})}})}));const Sd=Qc((function(t){var i;const r=y((e=>e.breakpoint.activeBreakpoint)),l=y((e=>e.settings.explicitCloseOnComplete)),s=v(),c=!1!==t.schema.isMinimizable;o((()=>{c&&!0===t.schema.minimizeOnComplete&&!l&&s({type:nc,payload:{minimizeOnComplete:!0}})}),[]),o((()=>{const e=document.documentElement,t=e.style.overscrollBehavior;return e.style.overscrollBehavior="none",()=>{e.style.overscrollBehavior=t}}),[]);const d=!!c&&(null!==(i=t.schema.startMinimized)&&void 0!==i&&i),{wrapperRef:u,containerRef:p,sheetRef:h,minimizedChildRef:f,maximizedChildRef:C,isMinimized:m,setMinimized:g}=fd(d,r,c);return e(sr.Provider,{value:c,children:e(Va,{children:i=>{var o,l;const d=a.Children.toArray(null===(o=t.schema.children)||void 0===o?void 0:o.map(((e,n)=>i(e,void 0,fn(n,t.testId))))),v=c?a.Children.toArray(null===(l=t.schema.minimizedChildren)||void 0===l?void 0:l.map(((e,n)=>i(e,void 0,fn(n,t.testId))))):[];return"default"===r?n("div",{ref:u,style:{height:"100000px"},children:[e(Cd,{schema:t.schema,testId:t.testId,minimized:m,onClose:t.schema.allowBackdropToClose?()=>s({type:Ec.DISMISS_OVERLAY,payload:{id:Gn,dismissalMethod:"rokt_backdrop"}}):void 0,onMinimize:c&&t.schema.allowBackdropToMinimize?()=>g(!0):void 0}),e(wd,Object.assign({},t,{containerRef:p,sheetRef:h,minimizedChildRef:f,maximizedChildRef:C,maximizedChildren:d,minimizedChildren:v,isMinimized:!!c&&m,setMinimized:c?g:void 0}))]}):e(Kc,Object.assign({},t,{children:(n,i)=>e(Jc,Object.assign({},t,{isAttached:!0,ref:i,children:d}))}))}})})}));const Ad=C((function(e){return{isOpen:e.active.has(Gn)}})),xd={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Td=h((function({schema:t,testId:n,children:i},a){Yc();const l=r(null),s=t.styles?Me(xd,t.styles):xd;return o((()=>{if(l.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(l.current)}),[]),e(nl,{styles:s,children:({classnames:t})=>e("div",{style:{width:"100%",height:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end",display:"flex",flexDirection:"column",justifyContent:"flex-end"},ref:l,children:e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",maxHeight:"100%",overflowY:"auto",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:a,tabIndex:-1,"data-testid":n&&`${n}-container`,"data-e2e":"BottomSheet-Container",children:i})})})}));const Od=Ad((function(t){const n=y((e=>e.breakpoint.activeBreakpoint));return e(Uc,Object.assign({},t,{children:(i,a)=>e("default"===n?Td:Jc,Object.assign({},t,{ref:a,children:i}))}))}));const Md="DisplayPreset.FULLSCREEN",Vd="DisplayPreset.EMBEDDED",Hd="DisplayPreset.ATTACHED",kd="ERROR",_d="INFO",Rd="WARNING",Nd="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*Pd(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(Xn).includes(e.type)})(n)&&!e.includes(n.type)&&(yield Ue(t.globalDispatch.bind(t),n))}function*Fd(e,t,n){var i;const{action:a,offer:o,offerPositionIndex:r}=n.payload,l=null==t?void 0:t[a.type];if(l)yield*l(a,{offer:o,offerPositionIndex:r},e);else switch(a.type){case"Close":yield Ue(e.globalDispatch.bind(e),{type:Zn,payload:{id:Gn,dismissalMethod:null!==(i=a.action.dismissalMethod)&&void 0!==i?i:void 0}});break;case"SetCustomState":yield Ue(e.globalDispatch.bind(e),{type:xn,payload:{key:a.action.key,value:a.action.value}});break;case"CreativeResponse":{if(!o)break;const e=o.creative.responseOptionsMap[a.action.responseKey];if(!e||Vt(e))break;const t=Ln(o,e,a.action.openLinks);yield ze({type:yn,payload:Object.assign(Object.assign({},t),{offerPositionIndex:r})});break}}}function jd(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function $d(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Zd(e){return F($d,e)}function*Gd(e,t){const n=yield Ke(e,ot.expanding(10));for(;n;){const e=yield We(n);yield Ue(t,e)}}function*Bd(e,t){const n=yield We(e);yield Ue(t,n)}function*Ud(e){for(;;){const t=yield We(e);yield ze(t)}}function*zd(e,t){const n=fe(Ve("moduleName"),He("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Zd(n):{}});try{yield Ue(e,i)}catch(e){}t.payload.level===kd&&(yield ze({type:Vn,payload:{name:"PLACEMENT_FAILURE"}}),yield ze({type:Ec.CLOSE_PLUGIN}))}const Kd="INVALID_RESPONSE_OBJECT",Wd="FAILED_TO_OPEN_LINK",Yd="NO_PARENT_GUID",qd="FAILED_TO_NOTIFY_INTERACTIVE",Jd="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var Xd=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function Qd(e,t){return n=>n&&n.replace(e,t)}const eu=Qd(/['""();{}@:[\]!/=]/g,""),tu=/^(normal|italic|oblique( \d+deg)*)$/i,nu=(e="")=>tu.test(e)?e:void 0,iu=Qd(/[;{}@[\]!]/g,"");function au(e){const{fontFamily:t,sources:n}=e,i=Xd(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function ou(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:eu(e.fontFamily)||"",style:nu(e.style),weight:eu(e.weight),sources:e.sources.map((e=>iu(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():au(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',au(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function ru(e){const t=v(),n=y((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=Nd.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return o((()=>{ou(JSON.parse(n)).catch((e=>{const n={type:pc,payload:{level:_d,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};t(n)}))}),[n]),o((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function*lu(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,rt((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield We(a);for(yield ze({type:Ic.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield ze({type:Ic.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield ze({type:pc,payload:{level:Rd,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield Ye())&&a.close()}}catch(e){const n=e;yield ze({type:pc,payload:{level:kd,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function su(e,t,n,i){return rt((a=>{const o=e.subscribe((e=>{const t=n(e);t&&a({type:ec,payload:t})}),(e=>{a(e)})),r=t.fonts.subscribe((e=>{a({type:Xs,payload:e})}),(e=>{a(e)})),l=null==i?void 0:i.subscribe((e=>{a({type:Js,payload:e})}),(e=>{a(e)}));return()=>{o.unsubscribe(),r.unsubscribe(),null==l||l.unsubscribe()}}),ot.sliding(3))}var cu=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),du=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),uu=Object.freeze({__proto__:null,V1:cu,V2:du}),pu=Object.freeze({__proto__:null,PartnerMessage:{UpsellItemInstantPurchaseResponse:"UPSELL_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{UpsellItemInstantPurchase:"UPSELL_ITEM_INSTANT_PURCHASE"}}),hu=Object.freeze({__proto__:null,V2:pu,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),fu=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const vu="LINK_NAVIGATION_REQUEST",yu="REALTIME_OFFER_FULFILLMENT_SUCCESS",Cu="REALTIME_OFFER_FULFILLMENT_FAILURE";var mu=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}s((i=i.apply(e,t||[])).next())}))};const gu={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function bu(e){return mu(this,arguments,void 0,(function*({url:e,urlBehavior:t,external:n},i=window){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(vu,{url:e}).then((()=>null));const a=gu[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var Iu=Object.freeze({__proto__:null,openLink:bu});function Eu(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:pc,payload:{level:Rd,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var Lu=Object.freeze({__proto__:null,makePluginWarningAction:Eu});function Du(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var wu=Object.freeze({__proto__:null,isWindow:Du}),Su=Object.assign(Object.assign(Object.assign({},Iu),Lu),wu);function Au(e){switch(e){case"ATTACHED":return Hd;case"EMBEDDED":return Vd;default:return Md}}function xu(e,t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e.offsetBottom&&{bottom:Qi(e.offsetBottom)}),e.offsetLeft&&{left:Qi(e.offsetLeft)}),e.offsetRight&&{right:Qi(e.offsetRight)}),e.offsetTop&&{top:Qi(e.offsetTop)}),(e.offsetAnchorX||e.offsetAnchorY)&&{transform:`translate(${"center"===e.offsetAnchorX?e.offsetLeft?"-50%":"50%":"0"}, ${"center"===e.offsetAnchorY?e.offsetTop?"-50%":"50%":"0"})`}),e.maxWidth?{maxWidth:Qi(e.maxWidth)}:void 0),e.zIndex?{zIndex:e.zIndex}:void 0),t)}const Tu={position:"fixed",top:"0",right:"0",left:"0",width:"100vw",minWidth:"1px",height:"100dvh"};function Ou(e){return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!0,outerCss:Object.assign(Object.assign({},Tu),e?xu(e,{}):{})}}function Mu(e,t){const n={position:"fixed",top:"auto",right:"0",bottom:"0",left:"0",width:"100vw",minWidth:"1px",height:`${e}px`};return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!1,outerCss:Object.assign(Object.assign({},n),t?xu(t,{}):{})}}const Vu=e=>e.settings.bottomsheetVisibleHeight,Hu=e=>e.breakpoint.activeBreakpoint;function*ku(e,t){const n={isMinimized:!1,lastSettings:null,controls:null!=t?t:null};yield dt([ut((e=>{var t;return e.type===vc&&(null===(t=e.payload)||void 0===t?void 0:t.key)===Ut}),Ru,e,n),ut(Ws,Pu,e,n),ut(ic,Nu,e,n)])}function*_u(e,t,n){P(t.lastSettings,n)||(t.lastSettings=n,yield ht(e.setDisplaySettings,n))}function*Ru(e,t,n){t.isMinimized=1===n.payload.value;if("default"!==(yield pt(Hu)))return;if(!t.isMinimized)return void(yield*_u(e,t,Ou(t.controls)));const i=yield pt(Vu);null!==i&&(yield*_u(e,t,Mu(i,t.controls)))}function*Nu(e,t,n){if(!t.isMinimized)return;"default"===(yield pt(Hu))&&(yield*_u(e,t,Mu(n.payload.height,t.controls)))}function*Pu(e,t,n){if(!("default"===n.payload.activeBreakpoint))return void(yield*_u(e,t,Ou(t.controls)));if(!t.isMinimized)return void(yield*_u(e,t,Ou(t.controls)));const i=yield pt(Vu);null!==i&&(yield*_u(e,t,Mu(i,t.controls)))}function*Fu(e=10){(yield qe((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*Fu(e-1)))}function*ju(e){try{yield*Fu(10),yield ht(e.close)}catch(e){const t=Su.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield yt(t)}}function*$u(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&an.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"UPDATE_CART_ITEM_MESSAGE":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_ITEM_INSTANT_PURCHASE":case"DELIVERY_DETAILS_SENT":case"UPSELL_CREATIVE_SENT":case"INITIATE_INSTANT_PURCHASE_EVENT":case"INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT":case"INITIATE_CART_ITEM_EVENT":case"PREPARE_DEVICE_PAY_EVENT":case"INITIATE_DEVICE_PAY_EVENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"ABORT_DEVICE_PAY_EVENT":case"COMPLETE_DEVICE_PAY_EVENT":case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Zu=z("FAILED_TO_PARSE_CONFIG","code");function*Gu(e,t){var n;const i=yield ht(su,e.configService,e.themeService,t,e.attributesService);for(;;)try{const e=yield Ct(i);yield yt(e)}catch(e){const t=e;yield yt({type:pc,payload:{level:kd,code:Zu(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*Bu(e,t){yield dt([ft(Gu,e,t),vt(Vn,$u,e.partnerInteractionService)])}function*Uu(e,t,n){const i=function(e,t){if("ATTACHEDBOTTOMSHEET"===e)return Ou(t);if(!t)return{preset:Au(e)};switch(e){case"ATTACHED":return{autoresize:!0,applyHighestZIndex:!0,replaceTargetElement:"body",outerCss:xu(t,{position:"fixed",width:"100%",minWidth:"1px"}),innerCss:{width:"100%"}};case"EMBEDDED":return{autoresize:!0,css:xu(t,{width:"1px",minWidth:"100%"})};default:return{autoresize:!1,applyHighestZIndex:!0,replaceTargetElement:"body",css:xu(t,{position:"fixed",height:"100%",width:"100%"})}}}(t,n);yield ht(e.setDisplaySettings,i),"ATTACHEDBOTTOMSHEET"===t&&(yield ft(ku,e,n)),yield yt({type:Ic.ACTIVE_ADD,payload:{id:Dc}})}function*zu(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield Ue(e,{code:t.payload.code,level:_d,message:t.payload.message||"Plugin Generic Log",additionalInformation:Zd(i)})}catch(e){}}function*Ku(e){yield ze({type:Ic.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield ze({type:cc})}function*Wu(e){yield ze({type:Ic.QUEUE_SIGNAL,payload:e.payload}),yield ze({type:cc})}function*Yu(e,t){const n=yield qe((e=>e.signal.queue.filter((t=>Zc(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*qu(e.signal,i(t));break;case"SignalViewed":yield*Ju(e.signal,i(t));break;case"SignalRenderGeometry":yield*Xu(e.signal,i(t));break;case"SignalDismissal":yield*Qu(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*ep(e.signal,i(t));break;case"SignalLoadStart":yield*tp(e.signal,i(t));break;case"SignalGatedResponse":case"SignalOptInResponse":case"SignalOptOutResponse":case"SignalResponse":yield*np(e.signal,i(t,!0));break;case"SignalProductItemResponse":yield*ip(e.signal,i(t));break;case"SignalUserInteraction":yield*ap(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*op(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*rp(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*lp(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*sp(e.signal,i(t))}yield ze({type:Ic.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?Ue(e.prepareExternalSignal,t.key,i,a,o):Ue(n?e.issueSignalSync:e.issueSignal,i,a,o)}}}function*qu(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function*Ju(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.supportedByBrowser.toString()},metadata:[{name:"inferred",value:e.inferred.toString()}]})}catch(t){yield cp(e,t)}}function*Xu(e,t){try{yield t(e.name,e.parentGuid,{objectData:{widthPx:e.objectData.widthPx.toString(),heightPx:e.objectData.heightPx.toString()}})}catch(t){yield cp(e,t)}}function*Qu(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield cp(e,t)}}function*ep(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield cp(e,t)}}function*tp(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield cp(e,t)}}function*np(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return"SignalOptInResponse"===e.name&&(t.objectData={action:"opt-in"}),t}(e))}catch(t){yield cp(e,t)}}function*ip(e,t){try{yield t(e.name,e.parentGuid,{objectData:{catalogItemId:e.objectData.catalogItemId,productSku:e.objectData.productSku,catalogId:e.objectData.catalogId,accountId:e.objectData.accountId}})}catch(t){yield cp(e,t)}}function*ap(e,t){var n,i,a,o;const r=e.parentGuid?e.parentGuid:yield qe((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!r||"string"!=typeof r)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,r,{objectData:Object.assign(Object.assign(Object.assign(Object.assign({action:e.action,context:e.context},(null===(n=e.objectData)||void 0===n?void 0:n.startTimestamp)&&{startTimestamp:e.objectData.startTimestamp}),(null===(i=e.objectData)||void 0===i?void 0:i.endTimestamp)&&{endTimestamp:e.objectData.endTimestamp}),null!=(null===(a=e.objectData)||void 0===a?void 0:a.cardIndex)&&{cardIndex:e.objectData.cardIndex.toString()}),null!=(null===(o=e.objectData)||void 0===o?void 0:o.lastCardIndex)&&{lastCardIndex:e.objectData.lastCardIndex.toString()})})}catch(t){yield cp(e,t)}}function*op(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function*rp(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function*lp(e,t){const n={objectData:Object.assign({catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy},e.objectData.purchaseId&&{purchaseId:e.objectData.purchaseId})};try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function*sp(e,t){const n={objectData:Object.assign({catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId},e.objectData.purchaseId&&{purchaseId:e.objectData.purchaseId})};try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function cp(e,t){const n=Su.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return ze(n)}function*dp(e){yield ze({type:fc,payload:e.payload})}const up={[zn]:yc,[Kn]:Cc,[Wn]:mc,[Yn]:gc,[qn]:bc},pp=Object.keys(up);function*hp(e){yield ze({type:up[e.type],payload:e.payload})}function*fp(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield qe((e=>e.serializableCache.has(t))))||(yield Ue(e.notifyInteractive),yield ze({type:ac,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield ze({type:pc,payload:{level:_d,code:qd,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*vp(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield Ue(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield Ue(bu,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield ze(Eu(e,"Failed to open link",Wd,{url:t.payload.url,urlBehaviour:n}))}}function*yp(e){const t=yield qe((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));if(e.payload.dismissalMethod===dc&&t)return yield ze({type:Ic.SET_DOMAIN_STATE_REDUCER,payload:{key:Ut,value:1}}),void(yield ze({type:Dn,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}));yield ze({type:Ic.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield ze({type:tc}),t?yield ze({type:Dn,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield ze({type:pc,payload:{level:_d,code:Yd,message:"ParentGuid does not exist"}})}const Cp=C((function(e){return{isOpen:e.active.has(Gn)}})),mp="undefined"!=typeof window;function gp(e,t){o((()=>{if(!mp||t)return;const n=e.current;if(!n)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{n.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{n.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,t])}const bp="Minimized",Ip="Maximized",Ep=e=>{const t=r(null),n=r(null),i=r(null),a=r(null),l=r(null),c=r(0),d=r(0),u=r(!e),p=r(!1),h=e?Ip:bp,f=Oa(0,(e=>h?e.customStates[h]:0)),v=e?f?0:1:f,y=xa(),C=Bo(),m=r(0),g=r(!1),b=r(0),I=r([]),E=r(void 0),{isDisabled:L}=wt(C);gp(t,!!v);const D=e=>{if(u.current)(()=>{const e=t.current,o=n.current,r=i.current,l=a.current;e&&o&&r&&l&&0!==l.clientHeight&&(F(l.clientHeight),requestAnimationFrame((()=>{j(!0,800),F(0),u.current=!1})))})();else if(j(!!e),v){const e=(d.current||0)-(c.current||0);F(e);const n=t.current;if(n){const e=(c.current||0)+1;n.style.height=e+"px"}}else F(0),t.current&&(t.current.style.height="100000px")},w=({key:e,value:t})=>({type:xn,payload:{key:e,value:t}}),S=()=>{const e=P();return v?e<=-.2:e>=.2},A=s((()=>{G(),E.current=void 0,g.current=!1,j(!0);S()?M():F(0)}),[S]);o((()=>{if(!p.current)return Z(!v,i),Z(!!v,a),void requestAnimationFrame((()=>{$(),p.current=!0}));v?(H(),y(Dp(!0))):(k(),y(Dp(!1)))}),[v,y]),o((()=>{const e=function(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout((()=>{t(),n=void 0}),e)}}(100,(()=>{var e,t,n,o;c.current=null!==(t=null===(e=i.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,d.current=null!==(o=null===(n=a.current)||void 0===n?void 0:n.clientHeight)&&void 0!==o?o:0,D(u.current)})),t=new ResizeObserver(e),n=i.current,o=a.current;return n&&t.observe(n),o&&t.observe(o),()=>{t.disconnect()}}),[D]);const x=s((e=>{if(n.current){e.preventDefault();const t=O(e);F(t)}}),[n]),T=s((e=>{Date.now()-b.current<200||(b.current=Date.now(),v?V(!1):g.current||L||(g.current=!0,N(),E.current=Lp(e),j(!1),B()))}),[v,L]);o((()=>{const e=n.current;return e&&(e.addEventListener("mousedown",T),e.addEventListener("touchstart",T)),()=>{null==e||e.removeEventListener("mousedown",T),null==e||e.removeEventListener("touchstart",T)}}),[n,T]);const O=e=>{var t,n;return(null!==(t=Lp(e))&&void 0!==t?t:0)-(null!==(n=E.current)&&void 0!==n?n:0)},M=()=>{V(!v)},V=e=>{[w({key:bp,value:e?1:0}),w({key:Ip,value:e?0:1})].forEach((e=>{e&&y(e)}))},H=()=>{var e,t,n,o;if(u.current)return;const r=null!==(t=null===(e=i.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,l=(null!==(o=null===(n=a.current)||void 0===n?void 0:n.clientHeight)&&void 0!==o?o:0)-r;j(!0),$(!0,!0),F(l),Z(!1,i),Z(!0,a),U()},k=()=>{u.current||(j(!0),$(!0,!1),F(0),E.current=void 0,Z(!0,i),Z(!1,a),z())},_=s((()=>{g.current&&(R(),requestAnimationFrame(_))}),[]),R=()=>{I.current.push({yPosition:m.current,timestamp:Date.now()}),I.current.length>20&&I.current.shift()},N=s((()=>{I.current=[],_()}),[_]),P=()=>{const e=I.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},F=e=>{const t=Math.round(e);m.current=t,n.current&&(n.current.style.transform=`translateY(${t}px)`)},j=(e,t=200)=>{e?n.current&&(n.current.style.transition=`transform ${t}ms`):n.current&&(n.current.style.transition="")},$=(e,t=!1)=>{const n=t?a:i,o=t?i:a;o.current&&(o.current.style.transition="opacity .5s"),n.current&&(n.current.style.transition="opacity .2s")},Z=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},G=s((()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",A),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",A)}),[x,A]),B=s((()=>{At()?(document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("touchend",A)):(document.addEventListener("mousemove",x,{passive:!1}),document.addEventListener("mouseup",A))}),[x,A]),U=()=>{const e=t.current;e&&(l.current=setTimeout((()=>{var t;const n=((null===(t=i.current)||void 0===t?void 0:t.clientHeight)||0)+1;e.style.height=n+"px"}),200))},z=()=>{l.current&&clearTimeout(l.current),t.current&&(t.current.style.height="100000px")};return{wrapperRef:t,containerRef:n,minimizedChildRef:i,maximizedChildRef:a}};function Lp(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const Dp=e=>({type:Dn,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}});const wp={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Sp;function Ap({schema:t,testId:n}){var i;const a=ci(),l=y((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),s=y((e=>e.active.has(Dc))),c=r(null),d=v(),u=()=>{d({type:Ec.DISMISS_OVERLAY,payload:{id:Gn,dismissalMethod:uc}})},p=null!==(i=t.startMinimized)&&void 0!==i&&i,h=p?Ip:bp,f=Oa(0,(e=>h?e.customStates[h]:0)),C=p?f?0:1:f;o((()=>{m(!!C)}),[C]),gp(c,!!C);const m=e=>{const t=c.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{l&&d({type:Dn,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),o((()=>{s&&requestAnimationFrame((()=>{var e;return null===(e=a.current)||void 0===e?void 0:e.focus()}))}),[s]);const g=Bo(),{tabIndex:b,isDisabled:I,styles:E}=wt(g),L=t.styles?Me(wp,t.styles):wp;return e(nl,{styles:L,children:({classnames:i})=>{var a;return e("div",{className:null==i?void 0:i.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:p?"0":"1",transition:"opacity 0.2s ease-in-out"},E),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":I,role:"dialog","aria-modal":!0,tabIndex:b,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:c,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?u:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function xp(){return e("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Sp||(Sp={}));const Tp={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function Op(t){const n=y((e=>e.slots)),i=y((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e(Mp,Object.assign({},t,{slots:n,currentIndex:i}))}function Mp(t){var i;const a=null!==(i=t.schema.startMinimized)&&void 0!==i&&i,{wrapperRef:o,containerRef:r,minimizedChildRef:l,maximizedChildRef:s}=Ep(a);return t.isOpen?n("div",{ref:o,style:{height:"100000px"},children:[e(Ap,Object.assign({},t)),e(Hp,Object.assign({},t,{startMinimized:a,containerRef:r,minimizedChildRef:l,maximizedChildRef:s}))]}):null}const Vp=Ze`
118
+ `),[g,w,S]);!function(e){const t=s((()=>{const t=e.current;if(!t)return;const n=Array.from(t.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0),i=getComputedStyle(t),a="border-box"===i.boxSizing?(parseFloat(i.paddingTop)||0)+(parseFloat(i.paddingBottom)||0):0;t.style.height=`${n+a}px`}),[e]);o((()=>{const n=e.current;if(!n)return;const i=new ResizeObserver((()=>t())),a=()=>{i.disconnect(),Array.from(n.children).forEach((e=>i.observe(e))),t()};a();const o=new MutationObserver(a);return o.observe(n,{childList:!0}),()=>{i.disconnect(),o.disconnect()}}),[t,e])}(m);const x=r(null),T=r(!1),O=s((e=>{f&&v&&(T.current=!0,x.current=e.clientY)}),[f,v]),M=s((()=>{f&&v&&T.current&&(T.current=!1,v(!1))}),[f,v]),V=s((e=>{if(!f||!v)return;const t=x.current;null!==t&&t-e.clientY>=24&&(x.current=null,v(!1))}),[f,v]),H=s((e=>{x.current=null,"pointercancel"===e.type&&(T.current=!1)}),[]);return e(nl,{styles:L,children:({classnames:o})=>{var r;return e("div",{style:{width:"100%",position:"absolute",bottom:"-120vh",zIndex:9999,transform:"translateY(1000px)",visibility:"hidden"},ref:d,children:n("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:C,children:[e("div",{ref:a,className:null==o?void 0:o.own,style:{height:"100%",position:"relative",outline:"none",pointerEvents:f?"auto":void 0},tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:n("div",{"data-testid":i&&f?`${i}-expand`:void 0,style:f?{cursor:"pointer",touchAction:"none"}:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,"aria-label":f?"Expand":void 0,onClick:f?M:void 0,onPointerDown:f?O:void 0,onPointerMove:f?V:void 0,onPointerUp:f?H:void 0,onPointerCancel:f?H:void 0,onKeyDown:f&&v?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v(!1))}:void 0,children:[!1!==t.showDragHandle&&!1!==t.isMinimizable&&e(md,{className:null==o?void 0:o.dragHandle,style:{pointerEvents:f?"none":void 0}}),e("div",{className:f?void 0:E,children:n("div",{ref:m,className:b,"aria-label":f?void 0:null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,style:{pointerEvents:f?"auto":void 0},[nd]:"",children:[e("div",{ref:u,style:{width:"100%"},children:p}),e("div",{ref:l,className:`${A}${f?` ${I}`:""}`,style:{width:"100%",padding:"0px 16px 6px"},children:h})]})})]})}),e("div",{className:D,style:{marginTop:"-1px"}})]})})}})}));const Sd=Qc((function(t){var i;const r=y((e=>e.breakpoint.activeBreakpoint)),l=y((e=>e.settings.explicitCloseOnComplete)),s=v(),c=!1!==t.schema.isMinimizable;o((()=>{c&&!0===t.schema.minimizeOnComplete&&!l&&s({type:nc,payload:{minimizeOnComplete:!0}})}),[]),o((()=>{const e=document.documentElement,t=e.style.overscrollBehavior;return e.style.overscrollBehavior="none",()=>{e.style.overscrollBehavior=t}}),[]);const d=!!c&&(null!==(i=t.schema.startMinimized)&&void 0!==i&&i),{wrapperRef:u,containerRef:p,sheetRef:h,minimizedChildRef:f,maximizedChildRef:C,isMinimized:m,setMinimized:g}=fd(d,r,c);return e(sr.Provider,{value:c,children:e(Va,{children:i=>{var o,l;const d=a.Children.toArray(null===(o=t.schema.children)||void 0===o?void 0:o.map(((e,n)=>i(e,void 0,fn(n,t.testId))))),v=c?a.Children.toArray(null===(l=t.schema.minimizedChildren)||void 0===l?void 0:l.map(((e,n)=>i(e,void 0,fn(n,t.testId))))):[];return"default"===r?n("div",{ref:u,style:{height:"100000px"},children:[e(Cd,{schema:t.schema,testId:t.testId,minimized:m,onClose:t.schema.allowBackdropToClose?()=>s({type:Ec.DISMISS_OVERLAY,payload:{id:Gn,dismissalMethod:"rokt_backdrop"}}):void 0,onMinimize:c&&t.schema.allowBackdropToMinimize?()=>g(!0):void 0}),e(wd,Object.assign({},t,{containerRef:p,sheetRef:h,minimizedChildRef:f,maximizedChildRef:C,maximizedChildren:d,minimizedChildren:v,isMinimized:!!c&&m,setMinimized:c?g:void 0}))]}):e(Kc,Object.assign({},t,{children:(n,i)=>e(Jc,Object.assign({},t,{isAttached:!0,ref:i,children:d}))}))}})})}));const Ad=C((function(e){return{isOpen:e.active.has(Gn)}})),xd={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Td=h((function({schema:t,testId:n,children:i},a){Yc();const l=r(null),s=t.styles?Me(xd,t.styles):xd;return o((()=>{if(l.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(l.current)}),[]),e(nl,{styles:s,children:({classnames:t})=>e("div",{style:{width:"100%",height:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end",display:"flex",flexDirection:"column",justifyContent:"flex-end"},ref:l,children:e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",maxHeight:"100%",overflowY:"auto",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:a,tabIndex:-1,"data-testid":n&&`${n}-container`,"data-e2e":"BottomSheet-Container",children:i})})})}));const Od=Ad((function(t){const n=y((e=>e.breakpoint.activeBreakpoint));return e(Uc,Object.assign({},t,{children:(i,a)=>e("default"===n?Td:Jc,Object.assign({},t,{ref:a,children:i}))}))}));const Md="DisplayPreset.FULLSCREEN",Vd="DisplayPreset.EMBEDDED",Hd="DisplayPreset.ATTACHED",kd="ERROR",_d="INFO",Rd="WARNING",Nd="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*Pd(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(Xn).includes(e.type)})(n)&&!e.includes(n.type)&&(yield Ue(t.globalDispatch.bind(t),n))}function*Fd(e,t,n){var i;const{action:a,offer:o,offerPositionIndex:r}=n.payload,l=null==t?void 0:t[a.type];if(l)yield*l(a,{offer:o,offerPositionIndex:r},e);else switch(a.type){case"Close":yield Ue(e.globalDispatch.bind(e),{type:Zn,payload:{id:Gn,dismissalMethod:null!==(i=a.action.dismissalMethod)&&void 0!==i?i:void 0}});break;case"SetCustomState":yield Ue(e.globalDispatch.bind(e),{type:xn,payload:{key:a.action.key,value:a.action.value}});break;case"CreativeResponse":{if(!o)break;const e=o.creative.responseOptionsMap[a.action.responseKey];if(!e||Vt(e))break;const t=Ln(o,e,a.action.openLinks);yield ze({type:yn,payload:Object.assign(Object.assign({},t),{offerPositionIndex:r})});break}}}function jd(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function $d(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Zd(e){return F($d,e)}function*Gd(e,t){const n=yield Ke(e,ot.expanding(10));for(;n;){const e=yield We(n);yield Ue(t,e)}}function*Bd(e,t){const n=yield We(e);yield Ue(t,n)}function*Ud(e){for(;;){const t=yield We(e);yield ze(t)}}function*zd(e,t){const n=fe(Ve("moduleName"),He("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Zd(n):{}});try{yield Ue(e,i)}catch(e){}t.payload.level===kd&&(yield ze({type:Vn,payload:{name:"PLACEMENT_FAILURE"}}),yield ze({type:Ec.CLOSE_PLUGIN}))}const Kd="INVALID_RESPONSE_OBJECT",Wd="FAILED_TO_OPEN_LINK",Yd="NO_PARENT_GUID",qd="FAILED_TO_NOTIFY_INTERACTIVE",Jd="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var Xd=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function Qd(e,t){return n=>n&&n.replace(e,t)}const eu=Qd(/['""();{}@:[\]!/=]/g,""),tu=/^(normal|italic|oblique( \d+deg)*)$/i,nu=(e="")=>tu.test(e)?e:void 0,iu=Qd(/[;{}@[\]!]/g,"");function au(e){const{fontFamily:t,sources:n}=e,i=Xd(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function ou(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:eu(e.fontFamily)||"",style:nu(e.style),weight:eu(e.weight),sources:e.sources.map((e=>iu(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():au(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',au(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function ru(e){const t=v(),n=y((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=Nd.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return o((()=>{ou(JSON.parse(n)).catch((e=>{const n={type:pc,payload:{level:_d,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};t(n)}))}),[n]),o((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function*lu(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,rt((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield We(a);for(yield ze({type:Ic.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield ze({type:Ic.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield ze({type:pc,payload:{level:Rd,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield Ye())&&a.close()}}catch(e){const n=e;yield ze({type:pc,payload:{level:kd,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function su(e,t,n,i){return rt((a=>{const o=e.subscribe((e=>{const t=n(e);t&&a({type:ec,payload:t})}),(e=>{a(e)})),r=t.fonts.subscribe((e=>{a({type:Xs,payload:e})}),(e=>{a(e)})),l=null==i?void 0:i.subscribe((e=>{a({type:Js,payload:e})}),(e=>{a(e)}));return()=>{o.unsubscribe(),r.unsubscribe(),null==l||l.unsubscribe()}}),ot.sliding(3))}var cu=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),du=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),uu=Object.freeze({__proto__:null,V1:cu,V2:du}),pu=Object.freeze({__proto__:null,PartnerMessage:{UpsellItemInstantPurchaseResponse:"UPSELL_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{UpsellItemInstantPurchase:"UPSELL_ITEM_INSTANT_PURCHASE"}}),hu=Object.freeze({__proto__:null,V2:pu,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),fu=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const vu="LINK_NAVIGATION_REQUEST",yu="REALTIME_OFFER_FULFILLMENT_SUCCESS",Cu="REALTIME_OFFER_FULFILLMENT_FAILURE";var mu=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}s((i=i.apply(e,t||[])).next())}))};const gu={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function bu(e){return mu(this,arguments,void 0,(function*({url:e,urlBehavior:t,external:n},i=window){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(vu,{url:e}).then((()=>null));const a=gu[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var Iu=Object.freeze({__proto__:null,openLink:bu});function Eu(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:pc,payload:{level:Rd,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var Lu=Object.freeze({__proto__:null,makePluginWarningAction:Eu});function Du(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var wu=Object.freeze({__proto__:null,isWindow:Du}),Su=Object.assign(Object.assign(Object.assign({},Iu),Lu),wu);function Au(e){switch(e){case"ATTACHED":return Hd;case"EMBEDDED":return Vd;default:return Md}}function xu(e,t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e.offsetBottom&&{bottom:Qi(e.offsetBottom)}),e.offsetLeft&&{left:Qi(e.offsetLeft)}),e.offsetRight&&{right:Qi(e.offsetRight)}),e.offsetTop&&{top:Qi(e.offsetTop)}),(e.offsetAnchorX||e.offsetAnchorY)&&{transform:`translate(${"center"===e.offsetAnchorX?e.offsetLeft?"-50%":"50%":"0"}, ${"center"===e.offsetAnchorY?e.offsetTop?"-50%":"50%":"0"})`}),e.maxWidth?{maxWidth:Qi(e.maxWidth)}:void 0),e.zIndex?{zIndex:e.zIndex}:void 0),t)}const Tu={position:"fixed",top:"0",right:"0",left:"0",width:"100vw",minWidth:"1px",height:"100dvh"};function Ou(e){return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!0,outerCss:Object.assign(Object.assign({},Tu),e?xu(e,{}):{})}}function Mu(e,t){const n={position:"fixed",top:"auto",right:"0",bottom:"0",left:"0",width:"100vw",minWidth:"1px",height:`${e}px`};return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!1,outerCss:Object.assign(Object.assign({},n),t?xu(t,{}):{})}}const Vu=e=>e.settings.bottomsheetVisibleHeight,Hu=e=>e.breakpoint.activeBreakpoint;function*ku(e,t){const n={isMinimized:!1,lastSettings:null,controls:null!=t?t:null};yield dt([ut((e=>{var t;return e.type===vc&&(null===(t=e.payload)||void 0===t?void 0:t.key)===Ut}),Ru,e,n),ut(Ws,Pu,e,n),ut(ic,Nu,e,n)])}function*_u(e,t,n){P(t.lastSettings,n)||(t.lastSettings=n,yield ht(e.setDisplaySettings,n))}function*Ru(e,t,n){t.isMinimized=1===n.payload.value;if("default"!==(yield pt(Hu)))return;if(!t.isMinimized)return void(yield*_u(e,t,Ou(t.controls)));const i=yield pt(Vu);null!==i&&(yield*_u(e,t,Mu(i,t.controls)))}function*Nu(e,t,n){if(!t.isMinimized)return;"default"===(yield pt(Hu))&&(yield*_u(e,t,Mu(n.payload.height,t.controls)))}function*Pu(e,t,n){if(!("default"===n.payload.activeBreakpoint))return void(yield*_u(e,t,Ou(t.controls)));if(!t.isMinimized)return void(yield*_u(e,t,Ou(t.controls)));const i=yield pt(Vu);null!==i&&(yield*_u(e,t,Mu(i,t.controls)))}function*Fu(e=10){(yield qe((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*Fu(e-1)))}function*ju(e){try{yield*Fu(10),yield ht(e.close)}catch(e){const t=Su.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield yt(t)}}function*$u(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&an.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"UPDATE_CART_ITEM_MESSAGE":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_ITEM_INSTANT_PURCHASE":case"DELIVERY_DETAILS_SENT":case"UPSELL_CREATIVE_SENT":case"INITIATE_INSTANT_PURCHASE_EVENT":case"INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT":case"INITIATE_CART_ITEM_EVENT":case"PREPARE_DEVICE_PAY_EVENT":case"INITIATE_DEVICE_PAY_EVENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"ABORT_DEVICE_PAY_EVENT":case"COMPLETE_DEVICE_PAY_EVENT":case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Zu=z("FAILED_TO_PARSE_CONFIG","code");function*Gu(e,t){var n;const i=yield ht(su,e.configService,e.themeService,t,e.attributesService);for(;;)try{const e=yield Ct(i);yield yt(e)}catch(e){const t=e;yield yt({type:pc,payload:{level:kd,code:Zu(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*Bu(e,t){yield dt([ft(Gu,e,t),vt(Vn,$u,e.partnerInteractionService)])}function*Uu(e,t,n){const i=function(e,t){if("ATTACHEDBOTTOMSHEET"===e)return Ou(t);if(!t)return{preset:Au(e)};switch(e){case"ATTACHED":return{autoresize:!0,applyHighestZIndex:!0,replaceTargetElement:"body",outerCss:xu(t,{position:"fixed",width:"100%",minWidth:"1px"}),innerCss:{width:"100%"}};case"EMBEDDED":return{autoresize:!0,css:xu(t,{width:"1px",minWidth:"100%"})};default:return{autoresize:!1,applyHighestZIndex:!0,lockHostScroll:!0,replaceTargetElement:"body",css:xu(t,{position:"fixed",height:"100%",width:"100%"})}}}(t,n);yield ht(e.setDisplaySettings,i),"ATTACHEDBOTTOMSHEET"===t&&(yield ft(ku,e,n)),yield yt({type:Ic.ACTIVE_ADD,payload:{id:Dc}})}function*zu(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield Ue(e,{code:t.payload.code,level:_d,message:t.payload.message||"Plugin Generic Log",additionalInformation:Zd(i)})}catch(e){}}function*Ku(e){yield ze({type:Ic.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield ze({type:cc})}function*Wu(e){yield ze({type:Ic.QUEUE_SIGNAL,payload:e.payload}),yield ze({type:cc})}function*Yu(e,t){const n=yield qe((e=>e.signal.queue.filter((t=>Zc(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*qu(e.signal,i(t));break;case"SignalViewed":yield*Ju(e.signal,i(t));break;case"SignalRenderGeometry":yield*Xu(e.signal,i(t));break;case"SignalDismissal":yield*Qu(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*ep(e.signal,i(t));break;case"SignalLoadStart":yield*tp(e.signal,i(t));break;case"SignalGatedResponse":case"SignalOptInResponse":case"SignalOptOutResponse":case"SignalResponse":yield*np(e.signal,i(t,!0));break;case"SignalProductItemResponse":yield*ip(e.signal,i(t));break;case"SignalUserInteraction":yield*ap(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*op(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*rp(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*lp(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*sp(e.signal,i(t))}yield ze({type:Ic.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?Ue(e.prepareExternalSignal,t.key,i,a,o):Ue(n?e.issueSignalSync:e.issueSignal,i,a,o)}}}function*qu(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function*Ju(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.supportedByBrowser.toString()},metadata:[{name:"inferred",value:e.inferred.toString()}]})}catch(t){yield cp(e,t)}}function*Xu(e,t){try{yield t(e.name,e.parentGuid,{objectData:{widthPx:e.objectData.widthPx.toString(),heightPx:e.objectData.heightPx.toString()}})}catch(t){yield cp(e,t)}}function*Qu(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield cp(e,t)}}function*ep(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield cp(e,t)}}function*tp(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield cp(e,t)}}function*np(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return"SignalOptInResponse"===e.name&&(t.objectData={action:"opt-in"}),t}(e))}catch(t){yield cp(e,t)}}function*ip(e,t){try{yield t(e.name,e.parentGuid,{objectData:{catalogItemId:e.objectData.catalogItemId,productSku:e.objectData.productSku,catalogId:e.objectData.catalogId,accountId:e.objectData.accountId}})}catch(t){yield cp(e,t)}}function*ap(e,t){var n,i,a,o;const r=e.parentGuid?e.parentGuid:yield qe((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!r||"string"!=typeof r)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,r,{objectData:Object.assign(Object.assign(Object.assign(Object.assign({action:e.action,context:e.context},(null===(n=e.objectData)||void 0===n?void 0:n.startTimestamp)&&{startTimestamp:e.objectData.startTimestamp}),(null===(i=e.objectData)||void 0===i?void 0:i.endTimestamp)&&{endTimestamp:e.objectData.endTimestamp}),null!=(null===(a=e.objectData)||void 0===a?void 0:a.cardIndex)&&{cardIndex:e.objectData.cardIndex.toString()}),null!=(null===(o=e.objectData)||void 0===o?void 0:o.lastCardIndex)&&{lastCardIndex:e.objectData.lastCardIndex.toString()})})}catch(t){yield cp(e,t)}}function*op(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function*rp(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function*lp(e,t){const n={objectData:Object.assign({catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy},e.objectData.purchaseId&&{purchaseId:e.objectData.purchaseId})};try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function*sp(e,t){const n={objectData:Object.assign({catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId},e.objectData.purchaseId&&{purchaseId:e.objectData.purchaseId})};try{yield t(e.name,e.parentGuid,n)}catch(t){yield cp(e,t)}}function cp(e,t){const n=Su.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return ze(n)}function*dp(e){yield ze({type:fc,payload:e.payload})}const up={[zn]:yc,[Kn]:Cc,[Wn]:mc,[Yn]:gc,[qn]:bc},pp=Object.keys(up);function*hp(e){yield ze({type:up[e.type],payload:e.payload})}function*fp(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield qe((e=>e.serializableCache.has(t))))||(yield Ue(e.notifyInteractive),yield ze({type:ac,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield ze({type:pc,payload:{level:_d,code:qd,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*vp(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield Ue(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield Ue(bu,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield ze(Eu(e,"Failed to open link",Wd,{url:t.payload.url,urlBehaviour:n}))}}function*yp(e){const t=yield qe((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));if(e.payload.dismissalMethod===dc&&t)return yield ze({type:Ic.SET_DOMAIN_STATE_REDUCER,payload:{key:Ut,value:1}}),void(yield ze({type:Dn,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}));yield ze({type:Ic.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield ze({type:tc}),t?yield ze({type:Dn,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield ze({type:pc,payload:{level:_d,code:Yd,message:"ParentGuid does not exist"}})}const Cp=C((function(e){return{isOpen:e.active.has(Gn)}})),mp="undefined"!=typeof window;function gp(e,t){o((()=>{if(!mp||t)return;const n=e.current;if(!n)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{n.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{n.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,t])}const bp="Minimized",Ip="Maximized",Ep=e=>{const t=r(null),n=r(null),i=r(null),a=r(null),l=r(null),c=r(0),d=r(0),u=r(!e),p=r(!1),h=e?Ip:bp,f=Oa(0,(e=>h?e.customStates[h]:0)),v=e?f?0:1:f,y=xa(),C=Bo(),m=r(0),g=r(!1),b=r(0),I=r([]),E=r(void 0),{isDisabled:L}=wt(C);gp(t,!!v);const D=e=>{if(u.current)(()=>{const e=t.current,o=n.current,r=i.current,l=a.current;e&&o&&r&&l&&0!==l.clientHeight&&(F(l.clientHeight),requestAnimationFrame((()=>{j(!0,800),F(0),u.current=!1})))})();else if(j(!!e),v){const e=(d.current||0)-(c.current||0);F(e);const n=t.current;if(n){const e=(c.current||0)+1;n.style.height=e+"px"}}else F(0),t.current&&(t.current.style.height="100000px")},w=({key:e,value:t})=>({type:xn,payload:{key:e,value:t}}),S=()=>{const e=P();return v?e<=-.2:e>=.2},A=s((()=>{G(),E.current=void 0,g.current=!1,j(!0);S()?M():F(0)}),[S]);o((()=>{if(!p.current)return Z(!v,i),Z(!!v,a),void requestAnimationFrame((()=>{$(),p.current=!0}));v?(H(),y(Dp(!0))):(k(),y(Dp(!1)))}),[v,y]),o((()=>{const e=function(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout((()=>{t(),n=void 0}),e)}}(100,(()=>{var e,t,n,o;c.current=null!==(t=null===(e=i.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,d.current=null!==(o=null===(n=a.current)||void 0===n?void 0:n.clientHeight)&&void 0!==o?o:0,D(u.current)})),t=new ResizeObserver(e),n=i.current,o=a.current;return n&&t.observe(n),o&&t.observe(o),()=>{t.disconnect()}}),[D]);const x=s((e=>{if(n.current){e.preventDefault();const t=O(e);F(t)}}),[n]),T=s((e=>{Date.now()-b.current<200||(b.current=Date.now(),v?V(!1):g.current||L||(g.current=!0,N(),E.current=Lp(e),j(!1),B()))}),[v,L]);o((()=>{const e=n.current;return e&&(e.addEventListener("mousedown",T),e.addEventListener("touchstart",T)),()=>{null==e||e.removeEventListener("mousedown",T),null==e||e.removeEventListener("touchstart",T)}}),[n,T]);const O=e=>{var t,n;return(null!==(t=Lp(e))&&void 0!==t?t:0)-(null!==(n=E.current)&&void 0!==n?n:0)},M=()=>{V(!v)},V=e=>{[w({key:bp,value:e?1:0}),w({key:Ip,value:e?0:1})].forEach((e=>{e&&y(e)}))},H=()=>{var e,t,n,o;if(u.current)return;const r=null!==(t=null===(e=i.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,l=(null!==(o=null===(n=a.current)||void 0===n?void 0:n.clientHeight)&&void 0!==o?o:0)-r;j(!0),$(!0,!0),F(l),Z(!1,i),Z(!0,a),U()},k=()=>{u.current||(j(!0),$(!0,!1),F(0),E.current=void 0,Z(!0,i),Z(!1,a),z())},_=s((()=>{g.current&&(R(),requestAnimationFrame(_))}),[]),R=()=>{I.current.push({yPosition:m.current,timestamp:Date.now()}),I.current.length>20&&I.current.shift()},N=s((()=>{I.current=[],_()}),[_]),P=()=>{const e=I.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},F=e=>{const t=Math.round(e);m.current=t,n.current&&(n.current.style.transform=`translateY(${t}px)`)},j=(e,t=200)=>{e?n.current&&(n.current.style.transition=`transform ${t}ms`):n.current&&(n.current.style.transition="")},$=(e,t=!1)=>{const n=t?a:i,o=t?i:a;o.current&&(o.current.style.transition="opacity .5s"),n.current&&(n.current.style.transition="opacity .2s")},Z=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},G=s((()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",A),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",A)}),[x,A]),B=s((()=>{At()?(document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("touchend",A)):(document.addEventListener("mousemove",x,{passive:!1}),document.addEventListener("mouseup",A))}),[x,A]),U=()=>{const e=t.current;e&&(l.current=setTimeout((()=>{var t;const n=((null===(t=i.current)||void 0===t?void 0:t.clientHeight)||0)+1;e.style.height=n+"px"}),200))},z=()=>{l.current&&clearTimeout(l.current),t.current&&(t.current.style.height="100000px")};return{wrapperRef:t,containerRef:n,minimizedChildRef:i,maximizedChildRef:a}};function Lp(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const Dp=e=>({type:Dn,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}});const wp={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Sp;function Ap({schema:t,testId:n}){var i;const a=ci(),l=y((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),s=y((e=>e.active.has(Dc))),c=r(null),d=v(),u=()=>{d({type:Ec.DISMISS_OVERLAY,payload:{id:Gn,dismissalMethod:uc}})},p=null!==(i=t.startMinimized)&&void 0!==i&&i,h=p?Ip:bp,f=Oa(0,(e=>h?e.customStates[h]:0)),C=p?f?0:1:f;o((()=>{m(!!C)}),[C]),gp(c,!!C);const m=e=>{const t=c.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{l&&d({type:Dn,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),o((()=>{s&&requestAnimationFrame((()=>{var e;return null===(e=a.current)||void 0===e?void 0:e.focus()}))}),[s]);const g=Bo(),{tabIndex:b,isDisabled:I,styles:E}=wt(g),L=t.styles?Me(wp,t.styles):wp;return e(nl,{styles:L,children:({classnames:i})=>{var a;return e("div",{className:null==i?void 0:i.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:p?"0":"1",transition:"opacity 0.2s ease-in-out"},E),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":I,role:"dialog","aria-modal":!0,tabIndex:b,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:c,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?u:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function xp(){return e("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Sp||(Sp={}));const Tp={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function Op(t){const n=y((e=>e.slots)),i=y((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e(Mp,Object.assign({},t,{slots:n,currentIndex:i}))}function Mp(t){var i;const a=null!==(i=t.schema.startMinimized)&&void 0!==i&&i,{wrapperRef:o,containerRef:r,minimizedChildRef:l,maximizedChildRef:s}=Ep(a);return t.isOpen?n("div",{ref:o,style:{height:"100000px"},children:[e(Ap,Object.assign({},t)),e(Hp,Object.assign({},t,{startMinimized:a,containerRef:r,minimizedChildRef:l,maximizedChildRef:s}))]}):null}const Vp=Ze`
119
119
  display: flex;
120
120
  position: relative;
121
121
  overflow: hidden;
@@ -19,6 +19,7 @@ export declare function getDisplaySettings(preset?: LayoutDisplayPreset | null,
19
19
  width: string;
20
20
  };
21
21
  css?: undefined;
22
+ lockHostScroll?: undefined;
22
23
  } | {
23
24
  autoresize: boolean;
24
25
  css: {
@@ -34,9 +35,11 @@ export declare function getDisplaySettings(preset?: LayoutDisplayPreset | null,
34
35
  replaceTargetElement?: undefined;
35
36
  outerCss?: undefined;
36
37
  innerCss?: undefined;
38
+ lockHostScroll?: undefined;
37
39
  } | {
38
40
  autoresize: boolean;
39
41
  applyHighestZIndex: boolean;
42
+ lockHostScroll: boolean;
40
43
  replaceTargetElement: string;
41
44
  css: {
42
45
  zIndex?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokt/dcui-orchestrator",
3
- "version": "1.2.1-rc.10",
3
+ "version": "1.2.1-rc.11",
4
4
  "description": "Rokt's DCUI rendering process",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",