@claspo/components 1.10.33 → 1.10.34
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/SysButtonComponent/SysButtonComponent.js +1 -1
- package/SysCalendarComponent/SysCalendarComponent.js +1 -1
- package/SysCheckboxListComponent/SysCheckboxListComponent.js +1 -1
- package/SysChoiceButtonsComponent/SysChoiceButtonsComponent.js +1 -1
- package/SysColumnComponent/SysColumnComponent.js +1 -1
- package/SysColumnsComponent/SysColumnsComponent.js +1 -1
- package/SysConsentComponent/SysConsentComponent.js +1 -1
- package/SysContainerComponent/SysContainerComponent.js +1 -1
- package/SysCountdownTimerComponent/SysCountdownTimerComponent.js +1 -1
- package/SysDateComponent/SysDateComponent.js +1 -1
- package/SysDropdownInputComponent/SysDropdownInputComponent.js +1 -1
- package/SysImageComponent/SysImageComponent.js +1 -1
- package/SysInAppColumnsComponent/SysInAppColumnsComponent.js +1 -1
- package/SysInputComponent/SysInputComponent.js +1 -1
- package/SysPhoneInputComponent/SysPhoneInputComponent.js +1 -1
- package/SysPromoCodeComponent/SysPromoCodeComponent.js +1 -1
- package/SysRadioGroupComponent/SysRadioGroupComponent.js +1 -1
- package/SysSlideComponent/SysSlideComponent.js +1 -1
- package/SysSliderComponent/SysSliderComponent.js +1 -1
- package/SysSocialComponent/SysSocialComponent.js +1 -1
- package/SysTextAreaComponent/SysTextAreaComponent.js +1 -1
- package/SysTextComponent/SysTextComponent.js +1 -1
- package/SysVideoComponent/SysVideoComponent.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={name:"SysContainerComponent",componentType:"CONTAINER",version:"1.0.0",contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT",params:{hideForEntryType:"VIEW"}}],floatingControlsModel:(e=[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"}],Object.values({DESKTOP:"desktop",MOBILE:"mobile"}).map(t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:e}))),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType},syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:function(t){var e;return"VIEW"!==t.component.type||null===(e=t.editorConfig.allowBackdropFilterOnView)||void 0===e||e},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:function(t){return"VIEW"!==t.component.type||"BUILT_IN"===t.layoutType},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType},syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:function(t){var e;return"VIEW"!==t.component.type||null===(e=t.editorConfig.allowBackdropFilterOnView)||void 0===e||e},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:function(t){return"VIEW"!==t.component.type||"BUILT_IN"===t.layoutType},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:function(t){return"TEASER"!==t.widgetType}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:function(t){return"TEASER"!==t.widgetType}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{styles:[{element:"host",styleAttributes:{overflow:"visible",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}]}},metaDescription:{icon:"/SysContainerComponent/assets/img/component-icon.svg",label:{en:"Container",ru:"Контейнер",uk:"Контейнер",es:"Envase",fr:"Récipient",de:"Container",it:"Contenitore",pt:"Embalagem",ro:"Container",bg:"Контейнер",cs:"Kontejner",el:"Περιέκτης",nl:"Container",pl:"Kontener",sv:"Behållare",tr:"Konteyner",ar:"الحاوية",zh:"容器",da:"Beholder",he:"קונטיינר",fi:"Säiliö",hi:"कंटेनर",hr:"Kontejner",hu:"Tárhely",id:"Kontainer",ja:"コンテナ",ko:"컨테이너",no:"Container",sk:"Krabica",sl:"Rezervoar",sr:"Kontejner"}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"]],syncEnabled:!0,stylesImitationEnabled:!0};var e;const n="cl-";function i(t){return n+t}function o(t){return"cl-"+t}const s="VIEW",r="CONTAINER",l="INPUT",a="BUTTON",c="CONSENT",u="COLUMN";var p,d;(d=p||(p={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",d.REQUEST="REQUEST",d.DISPATCH_EVENT="DISPATCH_EVENT",d.GO_TO_VIEW="GO_TO_VIEW",d.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",d.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",d.SHOW_WIDGET="SHOW_WIDGET",d.OPEN_LINK="OPEN_LINK",d.CLOSE_WIDGET="CLOSE_WIDGET",d.CLICK="CLICK";const h=p;var m;class y{static sortActions(t){const e={[h.CLOSE_WIDGET]:-1,[h.OPEN_LINK]:-2,[h.SHOW_WIDGET]:1,[h.SUBSCRIBE_CONTACT]:2,[h.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0)}constructor(t,e){this.config=t,this.actions=y.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const i=n(),s=i.getAttribute(o("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,s)}),this.listener=t=>{const e=t.composedPath().filter(t=>t instanceof HTMLElement&&t.getAttribute(o("type")));let n=0;for(;e[n]&&e[n].getAttribute(o("id"))!==s;){let t=e[n].getAttribute(o("type"));if(y.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((i.shadowRoot||i).querySelectorAll(this.config.relativeSelector)):[i],this.targetElements.forEach(t=>{t.addEventListener("click",this.listener)})}async execute(){var t,e,n,i;try{for(var o,s=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise(function(i,o){!function(t,e,n,i){Promise.resolve(i).then(function(e){t({value:e,done:n})},e)}(i,o,(e=t[n](e)).done,e.value)})}}}(this.eventsQueue);!(t=(o=await r.next()).done);s=!0){i=o.value,s=!1;const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{s||t||!(n=r.return)||await n.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach(t=>{t.removeEventListener("click",this.listener)}),this.targetElements=[])}}y.IGNORING_VIEW_ENTRY_TYPES=[a,c,l],function(t){t.CLICK="CLICK",t.COMPONENT_EVENT="COMPONENT_EVENT"}(m||(m={}));class g{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){var i;const s=null===(i=n())||void 0===i?void 0:i.getAttribute(o("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,s)}),this.componentEmitterListener=e.on(this.config.eventName,()=>{this.actions.forEach(e=>e.execute(t.getState(),this.config.params))})}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class f{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map(t=>this.actionFactory.get(t));switch(e.forEach(t=>this.actionRegister.register(t)),t.type){case m.CLICK:return new y(t,e);case m.COMPONENT_EVENT:return new g(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class b{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class v{constructor(){this.listeners=v.createDefaultListenersState()}emit(t,e,n=null){const i=this.listeners[t];i&&Object.values(i).forEach(i=>i(e,t,n)),Object.values(this.listeners["*"]).forEach(i=>i(e,t,n))}on(t,e){const n=b.generate(),i=this.listeners[t];return i?i[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=v.createDefaultListenersState()}}v.createDefaultListenersState=()=>({"*":{}});const E=v,O=(t,e,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||r).call(t,e,n,i)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T extends E{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",({isMobileEnv:t})=>{this._isMobile=t,this.emit(T.changeEventName,this._isMobile)})}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(T.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(T.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}T.changeEventName="CHANGE";const A=T;class C{static set(t,e){const n=t[C.accumulatorPropertyName]||{};t[C.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[C.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}C.accumulatorPropertyName="clStyleAttributes";const R=C;var _,N;(N=_||(_={})).BUILT_IN="BUILT_IN",N.DETACHED="DETACHED",N.FLOATING_BOX="FLOATING_BOX",N.FLOATING_BAR="FLOATING_BAR",N.LAUNCHER="LAUNCHER",N.CONTENT_LOCKER="CONTENT_LOCKER";class L{static applyHostStyles(t,e,n=null,i){var o,l,a;const c=null===(l=null===(o=null==n?void 0:n.props)||void 0===o?void 0:o.handlers)||void 0===l?void 0:l.find(t=>"CLICK"===t.type);c&&(null===(a=c.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==s&&t!==r&&t!==u||(e.style.display=i===_.CONTENT_LOCKER&&t===s?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class P{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class I{constructor(t,e,n,i,o,s){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=o,this.httpClient=s,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach(n=>{var i,o,s,r,l;const a=null===(o=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===o?void 0:o.find(t=>t.element===n),c=(null===(s=e.styles)||void 0===s?void 0:s.find(t=>t.element===n))||{},u=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),p=this.parseBackground(u);p.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})}),Promise.all([...this.envUrlMaps[t].entries()].map(([e,n])=>this.httpClient.execute({url:n.originalSVGResourceURL}).then(t=>t.text()).then(i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))).then(()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)}).catch(t=>{console.error(t),P.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)})}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)}),this.themeSubscription=this.documentModel.on("THEME_UPDATE",t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)}),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let i=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach(t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var o;i=i.replace(`var(--${o=n,`cl-schema-${o}`})`,e[n])}),`url('data:image/svg+xml,${encodeURIComponent(i)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const w=new class{execute({url:t,method:e="GET",body:n=null,headers:i,abortSignal:o}){const s={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:o};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,s)}};function M(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class D{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,t=>"_"+t).toUpperCase()}}class x{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var k;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(k||(k={}));const j=k;class U{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(j.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(j.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new x(this.onCounterStateUpdate)}}}const B=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>B(...t)}},F=B,W="props",V="shared",H="environment";function G(t,e,n,i){const o=t=>{let s=function(t){return t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host||null:t}(t);return s&&(i&&"function"==typeof i?i(s.getAttribute(e)):(null===(r=null==s?void 0:s.getAttribute)||void 0===r?void 0:r.call(s,e))===n)?s:s&&s.parentNode&&o(s.parentNode)||null;var r};return o(t)}const $="SUBMIT";function K(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach(n=>{if("element"===n||"classes"===n)return;const i=e[n];i&&"object"==typeof i&&!Array.isArray(i)?t[n]=Object.assign(Object.assign({},t[n]||{}),i):t[n]=i}),t):t}function z(t,e,n){var i;return null===(i=null==t?void 0:t[e])||void 0===i?void 0:i.find(t=>t.element===n)}function Q(t){const{element:e,html:n,appendHtml:i}=t,o=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach(e=>t.removeAttribute(e)),Array.from(t.attributes).forEach(e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)}),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}}),e.body.innerHTML}(n);i?e.innerHTML+=o:e.innerHTML=o}const Y=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class J extends Y{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var q,Z,X;function tt(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(q||(q={})),(X=Z||(Z={})).STATIC="STATIC",X.DATA_LAYER="DATA_LAYER",X.URL_QUERY_PARAMS="URL_QUERY_PARAMS",X.JS_API_VARIABLE="JS_API_VARIABLE",X.COOKIE="COOKIE",X.LOCAL_STORAGE="LOCAL_STORAGE";class et{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===q.UPDATING)return;const n=function(t,e,n,i){if(!e)return;if(e===Z.STATIC)return tt(null==n?void 0:n.value);const o=t.getSource(e);if(!o)return;const s=o.getValue(i);return tt("function"==typeof(null==s?void 0:s.processor)?s.processor(o,Object.assign({id:i},n)):null==s?void 0:s.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const i=n.trim();return""===i?void 0:i}}class nt extends HTMLElement{constructor(){var t;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 0,this.construct=()=>{let t;const e=this.getAttribute(o("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const i=n.closest(`[${o("widget-id")}]`);let s;i&&(s=i.getAttribute(o("widget-id")));let r=new J("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(o("path")),id:e,widgetId:s},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=F(W,V,H),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach(t=>null==t?void 0:t.off())}},this.state=new S({}),this.componentEventEmitter=new E,this.componentResourceManager=new U(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new f(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,t=>{this.model.props=t,this.observers.get(W).forEach(e=>e(this.prevProps,t)),this.prevProps=t;const e=this.getHostElement(),n=o("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)}),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,t=>{Object.assign(this.model,t)}),this.documentModel.on("SHARED_UPDATE_ALL",()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(V).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new I(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),w),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(A.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(H).forEach(e=>e(this.prevEnvironment,t)),this.prevEnvironment=t})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")}))},this.attachHandlers=()=>{this.getHandlers().map(t=>this._handlerFactory.get(t)).map(t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this))).forEach(t=>t())},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.postpone())},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.release())},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===q.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===q.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(W).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(V).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(H).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${o("element")}]`)).filter(t=>!t.hasAttribute(o("component")))],this.getElement=(t,e)=>this.getElements().find(n=>e?n.getAttribute(o("element"))===t&&n.id===e:n.getAttribute(o("element"))===t),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;const i=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach(t=>{const e=t.element;let i=!1,o=!1;n.desktop&&n.desktop.forEach(n=>{n.element===e&&(K(n,t),i=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(K(n,t),o=!0)}),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!o&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))}),n}(t,e),s=o("type"),r="element-styles";let l=this.getRootElement().querySelector(`style[${s}="${r}"]`);l||(l=document.createElement("style"),l.setAttribute(s,r),this.getRootElement().appendChild(l)),Q({element:l,html:""}),n.forEach(t=>{let e=t.getAttribute(o("element"));const n=this.getEnvironment();let s=z(i,n,e);if(s){if(this.resizeListener.isMobile()){const t=z(i,"desktop",e);t&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(s),l)}}),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,i]of Object.entries(e))t.style[n]=i;return!0},this.applyStylesToElement=(t,e,n)=>{var i,s;const r=[];"host"===(e=nt._resolveTogglableStylesForElementModel(e)).element&&(L.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.desktop)||"mobile"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],O(t,"load",()=>{this.componentResourceManager.getPending().decrement()}),O(t,"error",()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()})}const c=Object.assign(Object.assign({},e),{styleAttributes:M(e.styleAttributes,r)});if(R.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let i=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let s=this.getRootElement().querySelector(`#${o}`);s||(s=document.createElement("style"),s.id=o,t.appendChild(s)),Q({element:s,html:`\n ${n}::before {\n content: '';\n background: ${i.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(n,e.element,i,`:not(.${o("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this.applySharedClassesToElementModel=t=>function(t,e,i=!1){let o=t;return(o.classes||"").split(" ").filter(t=>t.startsWith(n)).forEach(t=>{var n;const s=null===(n=e.textClasses)||void 0===n?void 0:n[t];if(!s)return;let r=function(t,e){return{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),e?t.mobileStyleAttributes:{}),placeholderStyleAttributes:Object.assign(Object.assign({},t.placeholderStyleAttributes),e?t.mobilePlaceholderStyleAttributes:{})}}(s,i);r.styleAttributes.fontFamily||(s.isHeader&&e.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.headerFontFamily})})),!s.isHeader&&e.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)})}),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.textFontFamily})})),o}(t,this.documentModel.getShared(),this.resizeListener.isMobile()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,i="",s)=>{const r=Object.keys(n).reduce((t,e)=>t+` ${D.camelCaseToDashCase(e)}: ${n[e]}${s?" !important;":";"}`,"");Q({element:t,html:`[${o("element")}="${e}"]${i} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,o,s;e.linkColor&&Q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&Q({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}`,appendHtml:!0}),(null===(s=e.linkParams)||void 0===s?void 0:s.removeUnderline)&&Q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter(t=>t!==i("hovered")&&t!==i("focused")).forEach(e=>{e.startsWith(n)&&t.classList.remove(e)});const o=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",o)},this.getParentComponent=()=>G(this.parentNode,o("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(o("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:G(this.parentNode,o("path"),void 0,t=>1===(null==t?void 0:t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter(t=>!!t);var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>{return e=t,this.getWidgetLanguages().reduce((t,n)=>{if(t)return t;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,e);return i||null},null);var e},this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.getAutofillValue=()=>{var t;const e=this.getModel();return new et(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=t=>{var e,n,i,o,s,r;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(o=null===(i=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find(t=>"label"===t.element))||void 0===i?void 0:i.params)||void 0===o?void 0:o.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(s=t.content)||void 0===s?void 0:s.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(r=t.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find(t=>t.category===$);n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.constructor.define)||void 0===t?void 0:t.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then(()=>{this.attachHandlers()});const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}nt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=nt._resolveTogglableStyles(e[t]))}),e},nt._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,i)=>{n in e&&(t.forEach(t=>{t in e&&(e[t]=e[n]?e[t]:i)}),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const it=nt;function ot(t){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ot(t)}function st(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,dt(i.key),i)}}function rt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(rt=function(){return!!t})()}function lt(t,e,n,i){var o=at(ct(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function at(){return at="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ct(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},at.apply(null,arguments)}function ct(t){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ct(t)}function ut(t,e){return ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ut(t,e)}function pt(t,e,n){return(e=dt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dt(t){var e=function(t){if("object"!=ot(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ot(e)?e:e+""}var ht=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return pt(e=function(t,e,n){return e=ct(e),function(t,e){if(e&&("object"==ot(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,rt()?Reflect.construct(e,n||[],ct(t).constructor):e.apply(t,n))}(this,t,[].concat(i)),"manifest",{name:"SysContainerComponent"}),pt(e,"getComponentName",function(){return e.manifest.name}),pt(e,"processStyles",function(){e.innerHTML+='\n <style>\n [cl-component="'.concat(e.getComponentName(),'"] {\n position: relative;\n min-width: 50px;\n min-height: 50px;\n }\n </style>')}),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ut(t,e)}(t,it),function(t,e){return e&&st(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;lt(t,"connectedCallback",this,3)([]),this.processStyles(),this.observeProps(function(t,n){e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)})}},{key:"disconnectedCallback",value:function(){lt(t,"disconnectedCallback",this,3)([])}}])}();function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function yt(t,e){if(t){if("string"==typeof t)return gt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gt(t,e):void 0}}function gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function ft(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,At(i.key),i)}}function bt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bt=function(){return!!t})()}function vt(t,e,n,i){var o=Et(Ot(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Et(){return Et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ot(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Et.apply(null,arguments)}function Ot(t){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ot(t)}function St(t,e){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},St(t,e)}function Tt(t,e,n){return(e=At(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function At(t){var e=function(t){if("object"!=mt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mt(e)?e:e+""}var Ct=function(){function e(){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Tt(n=function(t,e,n){return e=Ot(e),function(t,e){if(e&&("object"==mt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bt()?Reflect.construct(e,n||[],Ot(t).constructor):e.apply(t,n))}(this,e,[].concat(o)),"connectResizeObserver",function(){n.resizeObserver=new ResizeObserver(function(t){var e,i=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=yt(t))){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,r=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){r=!0,o=t},f:function(){try{s||null==e.return||e.return()}finally{if(r)throw o}}}}(t);try{for(i.s();!(e=i.n()).done;)e.value.contentRect&&n.updateResponsiveRules(n.getResponsiveStyleElement())}catch(t){i.e(t)}finally{i.f()}}),n.resizeObserver.observe(n.getWidgetContainerNode())}),Tt(n,"updateResponsiveRules",function(t){if(n.getProps().isResponsive){var e=n.getWidgetContainerNode().getBoundingClientRect(),i=e.width,o=e.height;t.innerHTML='[cl-component="'.concat(n.getComponentName(),o/i>1.6?'"] {flex-direction: column !important;}':'"] {flex-direction: row !important;}')}else Q({element:t,html:""})}),Tt(n,"getResponsiveStyleElement",function(){return(t=n.children,function(t){if(Array.isArray(t))return gt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||yt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).find(function(t){return"responsive-styles"===t.getAttribute("name")});var t}),Tt(n,"appendResponsiveStyles",function(){n.innerHTML+='<style name="responsive-styles">\n [cl-component="'.concat(n.getComponentName(),'"] {}\n </style>')}),Tt(n,"manifest",t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&St(t,e)}(e,ht),function(t,e){return e&&ft(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"connectedCallback",value:function(){var t=this;vt(e,"connectedCallback",this,3)([]),this.appendResponsiveStyles(),this.observeProps(function(e,n){n.isResponsive&&t.updateResponsiveRules(t.getResponsiveStyleElement())}),this.getProps().isResponsive&&this.connectResizeObserver()}},{key:"disconnectedCallback",value:function(){var t;vt(e,"disconnectedCallback",this,3)([]),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}}])}();Tt(Ct,"define",{name:"sys-container",model:t.name,manifest:t});export{Ct as default};window.clComponentClass_SysContainerComponent=Ct;
|
|
1
|
+
const t={name:"SysContainerComponent",componentType:"CONTAINER",version:"1.0.0",contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT",params:{hideForEntryType:"VIEW"}}],floatingControlsModel:(e=[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"}],Object.values({DESKTOP:"desktop",MOBILE:"mobile"}).map(t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:e}))),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType},syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:function(t){var e;return"VIEW"!==t.component.type||null===(e=t.editorConfig.allowBackdropFilterOnView)||void 0===e||e},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:function(t){return"VIEW"!==t.component.type||"BUILT_IN"===t.layoutType},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType},syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:function(t){var e;return"VIEW"!==t.component.type||null===(e=t.editorConfig.allowBackdropFilterOnView)||void 0===e||e},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:function(t){return"VIEW"!==t.component.type||"BUILT_IN"===t.layoutType},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:function(t){return"TEASER"!==t.widgetType}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:function(t){return"TEASER"!==t.widgetType}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{styles:[{element:"host",styleAttributes:{overflow:"visible",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}]}},metaDescription:{icon:"/SysContainerComponent/assets/img/component-icon.svg",label:{en:"Container",ru:"Контейнер",uk:"Контейнер",es:"Envase",fr:"Récipient",de:"Container",it:"Contenitore",pt:"Embalagem",ro:"Container",bg:"Контейнер",cs:"Kontejner",el:"Περιέκτης",nl:"Container",pl:"Kontener",sv:"Behållare",tr:"Konteyner",ar:"الحاوية",zh:"容器",da:"Beholder",he:"קונטיינר",fi:"Säiliö",hi:"कंटेनर",hr:"Kontejner",hu:"Tárhely",id:"Kontainer",ja:"コンテナ",ko:"컨테이너",no:"Container",sk:"Krabica",sl:"Rezervoar",sr:"Kontejner"}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"]],syncEnabled:!0,stylesImitationEnabled:!0};var e;const n="cl-";function i(t){return n+t}function o(t){return"cl-"+t}const s="VIEW",r="CONTAINER",l="INPUT",a="BUTTON",c="CONSENT",u="COLUMN";var p,d;(d=p||(p={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",d.REQUEST="REQUEST",d.DISPATCH_EVENT="DISPATCH_EVENT",d.GO_TO_VIEW="GO_TO_VIEW",d.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",d.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",d.SHOW_WIDGET="SHOW_WIDGET",d.OPEN_LINK="OPEN_LINK",d.CLOSE_WIDGET="CLOSE_WIDGET",d.CLICK="CLICK";const h=p;var m;class y{static sortActions(t){const e={[h.CLOSE_WIDGET]:-1,[h.OPEN_LINK]:-2,[h.SHOW_WIDGET]:1,[h.SUBSCRIBE_CONTACT]:2,[h.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0)}constructor(t,e){this.config=t,this.actions=y.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const i=n(),s=i.getAttribute(o("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,s)}),this.listener=t=>{const e=t.composedPath().filter(t=>t instanceof HTMLElement&&t.getAttribute(o("type")));let n=0;for(;e[n]&&e[n].getAttribute(o("id"))!==s;){let t=e[n].getAttribute(o("type"));if(y.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((i.shadowRoot||i).querySelectorAll(this.config.relativeSelector)):[i],this.targetElements.forEach(t=>{t.addEventListener("click",this.listener)})}async execute(){var t,e,n,i;try{for(var o,s=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise(function(i,o){!function(t,e,n,i){Promise.resolve(i).then(function(e){t({value:e,done:n})},e)}(i,o,(e=t[n](e)).done,e.value)})}}}(this.eventsQueue);!(t=(o=await r.next()).done);s=!0){i=o.value,s=!1;const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{s||t||!(n=r.return)||await n.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach(t=>{t.removeEventListener("click",this.listener)}),this.targetElements=[])}}y.IGNORING_VIEW_ENTRY_TYPES=[a,c,l],function(t){t.CLICK="CLICK",t.COMPONENT_EVENT="COMPONENT_EVENT"}(m||(m={}));class g{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){var i;const s=null===(i=n())||void 0===i?void 0:i.getAttribute(o("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,s)}),this.componentEmitterListener=e.on(this.config.eventName,()=>{this.actions.forEach(e=>e.execute(t.getState(),this.config.params))})}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class f{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map(t=>this.actionFactory.get(t));switch(e.forEach(t=>this.actionRegister.register(t)),t.type){case m.CLICK:return new y(t,e);case m.COMPONENT_EVENT:return new g(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class b{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class v{constructor(){this.listeners=v.createDefaultListenersState()}emit(t,e,n=null){const i=this.listeners[t];i&&Object.values(i).forEach(i=>i(e,t,n)),Object.values(this.listeners["*"]).forEach(i=>i(e,t,n))}on(t,e){const n=b.generate(),i=this.listeners[t];return i?i[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=v.createDefaultListenersState()}}v.createDefaultListenersState=()=>({"*":{}});const E=v,O=(t,e,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||r).call(t,e,n,i)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T extends E{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",({isMobileEnv:t})=>{this._isMobile=t,this.emit(T.changeEventName,this._isMobile)})}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(T.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(T.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}T.changeEventName="CHANGE";const A=T;class C{static set(t,e){const n=t[C.accumulatorPropertyName]||{};t[C.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[C.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}C.accumulatorPropertyName="clStyleAttributes";const R=C;var _,N;(N=_||(_={})).BUILT_IN="BUILT_IN",N.DETACHED="DETACHED",N.FLOATING_BOX="FLOATING_BOX",N.FLOATING_BAR="FLOATING_BAR",N.LAUNCHER="LAUNCHER",N.CONTENT_LOCKER="CONTENT_LOCKER";class L{static applyHostStyles(t,e,n=null,i){var o,l,a;const c=null===(l=null===(o=null==n?void 0:n.props)||void 0===o?void 0:o.handlers)||void 0===l?void 0:l.find(t=>"CLICK"===t.type);c&&(null===(a=c.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==s&&t!==r&&t!==u||(e.style.display=i===_.CONTENT_LOCKER&&t===s?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class P{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class I{constructor(t,e,n,i,o,s){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=o,this.httpClient=s,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach(n=>{var i,o,s,r,l;const a=null===(o=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===o?void 0:o.find(t=>t.element===n),c=(null===(s=e.styles)||void 0===s?void 0:s.find(t=>t.element===n))||{},u=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),p=this.parseBackground(u);p.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})}),Promise.all([...this.envUrlMaps[t].entries()].map(([e,n])=>this.httpClient.execute({url:n.originalSVGResourceURL}).then(t=>t.text()).then(i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))).then(()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)}).catch(t=>{console.error(t),P.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)})}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)}),this.themeSubscription=this.documentModel.on("THEME_UPDATE",t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)}),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let i=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach(t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var o;i=i.replace(`var(--${o=n,`cl-schema-${o}`})`,e[n])}),`url('data:image/svg+xml,${encodeURIComponent(i)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const w=new class{execute({url:t,method:e="GET",body:n=null,headers:i,abortSignal:o}){const s={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:o};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,s)}};function M(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class D{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,t=>"_"+t).toUpperCase()}}class x{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var k;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(k||(k={}));const j=k;class U{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(j.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(j.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new x(this.onCounterStateUpdate)}}}const B=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>B(...t)}},F=B,W="props",V="shared",H="environment";function G(t,e,n,i){const o=t=>{let s=function(t){return t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host||null:t}(t);return s&&(i&&"function"==typeof i?i(s.getAttribute(e)):(null===(r=null==s?void 0:s.getAttribute)||void 0===r?void 0:r.call(s,e))===n)?s:s&&s.parentNode&&o(s.parentNode)||null;var r};return o(t)}const $="SUBMIT";function K(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach(n=>{if("element"===n||"classes"===n)return;const i=e[n];i&&"object"==typeof i&&!Array.isArray(i)?t[n]=Object.assign(Object.assign({},t[n]||{}),i):t[n]=i}),t):t}function z(t,e,n){var i;return null===(i=null==t?void 0:t[e])||void 0===i?void 0:i.find(t=>t.element===n)}function Q(t){return t.replace(/[\u0000- ]/g,"").toLowerCase()}function Y(t){const{element:e,html:n,appendHtml:i}=t,o=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv], object, embed, svg animate, svg set').forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop","srcdoc"].forEach(e=>t.removeAttribute(e)),Array.from(t.attributes).forEach(e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)});const e=t.tagName.toUpperCase();if("A"!==e&&"AREA"!==e||["href","xlink:href"].forEach(e=>{const n=Q(t.getAttribute(e)||"");(n.startsWith("javascript:")||n.startsWith("data:"))&&t.removeAttribute(e)}),"IMG"===e||"IFRAME"===e){const e=Q(t.getAttribute("src")||"");(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}["action","formaction"].forEach(e=>{Q(t.getAttribute(e)||"").startsWith("javascript:")&&t.removeAttribute(e)})}),e.body.innerHTML}(n);i?e.innerHTML+=o:e.innerHTML=o}const J=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class q extends J{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var Z,X,tt;function et(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(Z||(Z={})),(tt=X||(X={})).STATIC="STATIC",tt.DATA_LAYER="DATA_LAYER",tt.URL_QUERY_PARAMS="URL_QUERY_PARAMS",tt.JS_API_VARIABLE="JS_API_VARIABLE",tt.COOKIE="COOKIE",tt.LOCAL_STORAGE="LOCAL_STORAGE";class nt{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===Z.UPDATING)return;const n=function(t,e,n,i){if(!e)return;if(e===X.STATIC)return et(null==n?void 0:n.value);const o=t.getSource(e);if(!o)return;const s=o.getValue(i);return et("function"==typeof(null==s?void 0:s.processor)?s.processor(o,Object.assign({id:i},n)):null==s?void 0:s.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const i=n.trim();return""===i?void 0:i}}class it extends HTMLElement{constructor(){var t;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 0,this.construct=()=>{let t;const e=this.getAttribute(o("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const i=n.closest(`[${o("widget-id")}]`);let s;i&&(s=i.getAttribute(o("widget-id")));let r=new q("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(o("path")),id:e,widgetId:s},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=F(W,V,H),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach(t=>null==t?void 0:t.off())}},this.state=new S({}),this.componentEventEmitter=new E,this.componentResourceManager=new U(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new f(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,t=>{this.model.props=t,this.observers.get(W).forEach(e=>e(this.prevProps,t)),this.prevProps=t;const e=this.getHostElement(),n=o("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)}),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,t=>{Object.assign(this.model,t)}),this.documentModel.on("SHARED_UPDATE_ALL",()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(V).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new I(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),w),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(A.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(H).forEach(e=>e(this.prevEnvironment,t)),this.prevEnvironment=t})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")}))},this.attachHandlers=()=>{this.getHandlers().map(t=>this._handlerFactory.get(t)).map(t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this))).forEach(t=>t())},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.postpone())},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.release())},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===Z.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===Z.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(W).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(V).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(H).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${o("element")}]`)).filter(t=>!t.hasAttribute(o("component")))],this.getElement=(t,e)=>this.getElements().find(n=>e?n.getAttribute(o("element"))===t&&n.id===e:n.getAttribute(o("element"))===t),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;const i=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach(t=>{const e=t.element;let i=!1,o=!1;n.desktop&&n.desktop.forEach(n=>{n.element===e&&(K(n,t),i=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(K(n,t),o=!0)}),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!o&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))}),n}(t,e),s=o("type"),r="element-styles";let l=this.getRootElement().querySelector(`style[${s}="${r}"]`);l||(l=document.createElement("style"),l.setAttribute(s,r),this.getRootElement().appendChild(l)),Y({element:l,html:""}),n.forEach(t=>{let e=t.getAttribute(o("element"));const n=this.getEnvironment();let s=z(i,n,e);if(s){if(this.resizeListener.isMobile()){const t=z(i,"desktop",e);t&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(s),l)}}),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,i]of Object.entries(e))t.style[n]=i;return!0},this.applyStylesToElement=(t,e,n)=>{var i,s;const r=[];"host"===(e=it._resolveTogglableStylesForElementModel(e)).element&&(L.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.desktop)||"mobile"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],O(t,"load",()=>{this.componentResourceManager.getPending().decrement()}),O(t,"error",()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()})}const c=Object.assign(Object.assign({},e),{styleAttributes:M(e.styleAttributes,r)});if(R.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let i=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let s=this.getRootElement().querySelector(`#${o}`);s||(s=document.createElement("style"),s.id=o,t.appendChild(s)),Y({element:s,html:`\n ${n}::before {\n content: '';\n background: ${i.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(n,e.element,i,`:not(.${o("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this.applySharedClassesToElementModel=t=>function(t,e,i=!1){let o=t;return(o.classes||"").split(" ").filter(t=>t.startsWith(n)).forEach(t=>{var n;const s=null===(n=e.textClasses)||void 0===n?void 0:n[t];if(!s)return;let r=function(t,e){return{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),e?t.mobileStyleAttributes:{}),placeholderStyleAttributes:Object.assign(Object.assign({},t.placeholderStyleAttributes),e?t.mobilePlaceholderStyleAttributes:{})}}(s,i);r.styleAttributes.fontFamily||(s.isHeader&&e.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.headerFontFamily})})),!s.isHeader&&e.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)})}),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.textFontFamily})})),o}(t,this.documentModel.getShared(),this.resizeListener.isMobile()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,i="",s)=>{const r=Object.keys(n).reduce((t,e)=>t+` ${D.camelCaseToDashCase(e)}: ${n[e]}${s?" !important;":";"}`,"");Y({element:t,html:`[${o("element")}="${e}"]${i} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Y({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,o,s;e.linkColor&&Y({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&Y({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}`,appendHtml:!0}),(null===(s=e.linkParams)||void 0===s?void 0:s.removeUnderline)&&Y({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter(t=>t!==i("hovered")&&t!==i("focused")).forEach(e=>{e.startsWith(n)&&t.classList.remove(e)});const o=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",o)},this.getParentComponent=()=>G(this.parentNode,o("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(o("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:G(this.parentNode,o("path"),void 0,t=>1===(null==t?void 0:t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter(t=>!!t);var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>{return e=t,this.getWidgetLanguages().reduce((t,n)=>{if(t)return t;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,e);return i||null},null);var e},this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.getAutofillValue=()=>{var t;const e=this.getModel();return new nt(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=t=>{var e,n,i,o,s,r;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(o=null===(i=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find(t=>"label"===t.element))||void 0===i?void 0:i.params)||void 0===o?void 0:o.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(s=t.content)||void 0===s?void 0:s.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(r=t.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find(t=>t.category===$);n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.constructor.define)||void 0===t?void 0:t.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then(()=>{this.attachHandlers()});const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}it._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=it._resolveTogglableStyles(e[t]))}),e},it._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,i)=>{n in e&&(t.forEach(t=>{t in e&&(e[t]=e[n]?e[t]:i)}),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const ot=it;function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function rt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ht(i.key),i)}}function lt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(lt=function(){return!!t})()}function at(t,e,n,i){var o=ct(ut(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ct(){return ct="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ut(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ct.apply(null,arguments)}function ut(t){return ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ut(t)}function pt(t,e){return pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pt(t,e)}function dt(t,e,n){return(e=ht(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ht(t){var e=function(t){if("object"!=st(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==st(e)?e:e+""}var mt=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return dt(e=function(t,e,n){return e=ut(e),function(t,e){if(e&&("object"==st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,lt()?Reflect.construct(e,n||[],ut(t).constructor):e.apply(t,n))}(this,t,[].concat(i)),"manifest",{name:"SysContainerComponent"}),dt(e,"getComponentName",function(){return e.manifest.name}),dt(e,"processStyles",function(){e.innerHTML+='\n <style>\n [cl-component="'.concat(e.getComponentName(),'"] {\n position: relative;\n min-width: 50px;\n min-height: 50px;\n }\n </style>')}),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pt(t,e)}(t,ot),function(t,e){return e&&rt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;at(t,"connectedCallback",this,3)([]),this.processStyles(),this.observeProps(function(t,n){e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)})}},{key:"disconnectedCallback",value:function(){at(t,"disconnectedCallback",this,3)([])}}])}();function yt(t){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(t)}function gt(t,e){if(t){if("string"==typeof t)return ft(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(t,e):void 0}}function ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function bt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ct(i.key),i)}}function vt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(vt=function(){return!!t})()}function Et(t,e,n,i){var o=Ot(St(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Ot(){return Ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=St(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ot.apply(null,arguments)}function St(t){return St=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},St(t)}function Tt(t,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tt(t,e)}function At(t,e,n){return(e=Ct(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ct(t){var e=function(t){if("object"!=yt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yt(e)?e:e+""}var Rt=function(){function e(){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return At(n=function(t,e,n){return e=St(e),function(t,e){if(e&&("object"==yt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,vt()?Reflect.construct(e,n||[],St(t).constructor):e.apply(t,n))}(this,e,[].concat(o)),"connectResizeObserver",function(){n.resizeObserver=new ResizeObserver(function(t){var e,i=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=gt(t))){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,r=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){r=!0,o=t},f:function(){try{s||null==e.return||e.return()}finally{if(r)throw o}}}}(t);try{for(i.s();!(e=i.n()).done;)e.value.contentRect&&n.updateResponsiveRules(n.getResponsiveStyleElement())}catch(t){i.e(t)}finally{i.f()}}),n.resizeObserver.observe(n.getWidgetContainerNode())}),At(n,"updateResponsiveRules",function(t){if(n.getProps().isResponsive){var e=n.getWidgetContainerNode().getBoundingClientRect(),i=e.width,o=e.height;t.innerHTML='[cl-component="'.concat(n.getComponentName(),o/i>1.6?'"] {flex-direction: column !important;}':'"] {flex-direction: row !important;}')}else Y({element:t,html:""})}),At(n,"getResponsiveStyleElement",function(){return(t=n.children,function(t){if(Array.isArray(t))return ft(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||gt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).find(function(t){return"responsive-styles"===t.getAttribute("name")});var t}),At(n,"appendResponsiveStyles",function(){n.innerHTML+='<style name="responsive-styles">\n [cl-component="'.concat(n.getComponentName(),'"] {}\n </style>')}),At(n,"manifest",t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tt(t,e)}(e,mt),function(t,e){return e&&bt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"connectedCallback",value:function(){var t=this;Et(e,"connectedCallback",this,3)([]),this.appendResponsiveStyles(),this.observeProps(function(e,n){n.isResponsive&&t.updateResponsiveRules(t.getResponsiveStyleElement())}),this.getProps().isResponsive&&this.connectResizeObserver()}},{key:"disconnectedCallback",value:function(){var t;Et(e,"disconnectedCallback",this,3)([]),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}}])}();At(Rt,"define",{name:"sys-container",model:t.name,manifest:t});export{Rt as default};window.clComponentClass_SysContainerComponent=Rt;
|