@claspo/components 1.1.15 → 1.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const t="validationStatusChanged",e="touchedStatusChanged",n="cl-";function o(t){return n+t}function r(t){return"cl-"+t}class i{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var l={transparent:"#0000"},s=function(t,e,n,o){return null!=o&&""!==o||(o=1),t=parseFloat(t),e=parseFloat(e),n=parseFloat(n),o=parseFloat(o),t<=255&&t>=0&&e<=255&&e>=0&&n<=255&&n>=0&&o<=1&&o>=0?[Math.round(t),Math.round(e),Math.round(n),o]:null},a=[];for(var c in l)a.push(c);var p="\\s*([.\\d%]+)\\s*",d="\\("+[p,p,p]+"(?:,\\s*([.\\d]+)\\s*)?\\)",h="(?:rgb)a?",u="("+a.join("|")+")",m=RegExp(h+d,"i"),g=function(t,e){if(null==t)return null;t=(t+"").replace(/\s+/,"");var n=l[t];return n?g(n,e):(n=t.match(m))&&(t=n.slice(1))&&(t=s.apply(null,t))?e?t:(1===t[3]&&t.splice(3,1),"rgb"+(4===t.length?"a":"")+"("+t+")"):null};RegExp([u,"(?:#([a-f0-9]{3,8}))",h+d,"(?:hsl)a?"+d].join("|"),"gi");const b=g;class f{ratio(t,e,n){return t=this.getRgbTriplet(t,n),e=this.getRgbTriplet(e,n),this.wcagRgb(t,e)}isNotTransparent(t,e){e=e||{};const n=(t=b(t)).match(/\((.*)\)/)[1].split(",");if(4!=n.length||"0"!=n[3]||e.ignoreAlpha)return t;throw new TypeError("get-contrast cannot contrast transparent colors")}getRgbTriplet(t,e){if("string"!=typeof t)throw new TypeError("get-contrast expects colors as strings");let n=t.toLowerCase();return n=this.isNotTransparent(n,e),n.match(/\((.*)\)/)[1].split(",").slice(0,3)}wcagRgb(t,e){return this.luminance(this.relativeLuminance(t),this.relativeLuminance(e))}luminance(t,e){return(Math.max(t,e)+.05)/(Math.min(t,e)+.05)}relativeLuminance(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=1/12.92;function i(t){return Math.pow((t+.055)/1.055,2.4)}return.2126*(e<=.03928?e*r:i(e))+.7152*(n<=.03928?n*r:i(n))+.0722*(o<=.03928?o*r:i(o))}}function y(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}var v=Array.prototype.concat,E=Array.prototype.slice,O=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var r=t[n];y(r)?e=v.call(e,E.call(r)):e.push(r)}return e};O.wrap=function(t){return function(){return t(O(arguments))}};const S=O;var T={},C=Object.hasOwnProperty,w=Object.create(null);for(var R in T)C.call(T,R)&&(w[T[R]]=R);var x={to:{},get:{}};function A(t,e,n){return Math.min(Math.max(e,t),n)}x.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=x.get.hsl(t),n="hsl"):(e=x.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},x.get.rgb=function(t){if(!t)return null;var e,n,o,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var i=2*n;r[n]=parseInt(e.slice(i,i+2),16)}o&&(r[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);o&&(r[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:C.call(T,e[1])?((r=T[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=A(r[n],0,255);return r[3]=A(r[3],0,1),r},x.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,A(parseFloat(e[2]),0,100),A(parseFloat(e[3]),0,100),A(isNaN(n)?1:n,0,1)]}return null},x.to.rgb=function(){var t=S(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},x.to.hsl=function(){var t=S(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const P=x,N={},L={};for(const t of Object.keys(N))L[N[t]]=t;const k={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(k)){if(!("channels"in k[t]))throw new Error("missing channels property: "+t);if(!("labels"in k[t]))throw new Error("missing channel labels property: "+t);if(k[t].labels.length!==k[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=k[t];delete k[t].channels,delete k[t].labels,Object.defineProperty(k[t],"channels",{value:e}),Object.defineProperty(k[t],"labels",{value:n})}k.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=Math.min(e,n,o),i=Math.max(e,n,o),l=i-r;let s,a;i===r?s=0:e===i?s=(n-o)/l:n===i?s=2+(o-e)/l:o===i&&(s=4+(e-n)/l),s=Math.min(60*s,360),s<0&&(s+=360);const c=(r+i)/2;return a=i===r?0:c<=.5?l/(i+r):l/(2-i-r),[s,100*a,100*c]},k.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let r,i,l;if(0===n)return l=255*o,[l,l,l];r=o<.5?o*(1+n):o+n-o*n;const s=2*o-r,a=[0,0,0];for(let t=0;t<3;t++)i=e+1/3*-(t-1),i<0&&i++,i>1&&i--,l=6*i<1?s+6*(r-s)*i:2*i<1?r:3*i<2?s+(r-s)*(2/3-i)*6:s,a[t]=255*l;return a};const I=k;function _(t,e){return function(n){return e(t(n))}}function j(t,e){const n=[e[t].parent,t];let o=I[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)n.unshift(e[r].parent),o=_(I[e[r].parent][r],o),r=e[r].parent;return o.conversion=n,o}const M={};Object.keys(I).forEach((t=>{M[t]={},Object.defineProperty(M[t],"channels",{value:I[t].channels}),Object.defineProperty(M[t],"labels",{value:I[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(I);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(I[t]);for(let r=o.length,i=0;i<r;i++){const r=o[i],l=e[r];-1===l.distance&&(l.distance=e[t].distance+1,l.parent=t,n.unshift(r))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,r=0;r<t;r++){const t=o[r];null!==e[t].parent&&(n[t]=j(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];M[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),M[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const D=M,U=["keyword","gray","hex"],B={};for(const t of Object.keys(D))B[[...D[t].labels].sort().join("")]=t;const F={};function W(t,e){if(!(this instanceof W))return new W(t,e);if(e&&e in U&&(e=null),e&&!(e in D))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof W)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=P.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=D[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=D[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=H(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in B))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=B[o];const{labels:r}=D[this.model],i=[];for(n=0;n<r.length;n++)i.push(t[r[n]]);this.color=H(i)}if(F[this.model])for(o=D[this.model].channels,n=0;n<o;n++){const t=F[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}W.prototype={toString(){return this.string()},string(t){let e=this.model in P.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return P.to[e.model](n)},round(t){return t=Math.max(t||0,0),new W([...this.color.map($(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new W([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(D)){if(U.includes(t))continue;const{channels:e}=D[t];W.prototype[t]=function(...e){return this.model===t?new W(this):e.length>0?new W(e,t):new W([...V(D[this.model][t].raw(this.color)),this.valpha],t)},W[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=H(n,e)),new W(o,t)}}function $(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function V(t){return Array.isArray(t)?t:[t]}function H(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const z=W,Q="rgb(255, 255, 255)",G="rgb(0, 0, 0)";function q(t,e){return z(t).alpha(e).string()}function K(t,e){try{return z(t).lighten(e).rgb().string()}catch(e){return console.warn("ColorUtils.lighten:",e),t}}function Z(t,e){try{return z(t).darken(e).rgb().string()}catch(e){return console.warn("ColorUtils.darken:",e),t}}function J(t,e){try{return(new f).ratio(t,e)}catch(n){return console.warn(`ColorUtils.getContrastRatio: transparent colors were used ${t}, ${e}`),0}}function X(t){const{element:e,html:n,appendHtml:o}=t,r=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);o?e.innerHTML+=r:e.innerHTML=r}function Y(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function tt(t,e){const n=window.getComputedStyle(t);return e.reduce(((t,e)=>(t[e]=n.getPropertyValue(e),t)),{})}function et(t,e){var n,o;let r;return t.styles&&(r=null===(n=t.styles.find((t=>"label"===t.element)))||void 0===n?void 0:n.params),t.adaptiveStyles&&!r&&(r=null===(o=t.adaptiveStyles[e].find((t=>"label"===t.element)))||void 0===o?void 0:o.params),r}function nt(t,e,n,o){const r=n.querySelector(o),i=et(t,e);if(!i)return;const l=n.querySelector(".label");X({element:l,html:t.content.label}),"TOP"===i.position?(r.style.flexDirection="column",r.style.alignItems="unset",Y(l,{marginRight:0,marginBottom:`${i.margin}px`})):(r.style.flexDirection="row",r.style.alignItems="center",Y(l,{marginRight:`${i.margin}px`,marginBottom:0})),i.enabled?l.style.display="":l.style.display="none"}function ot(t,e,n,o,r){const i=function(t,e){var n;let o;if(t.styles){const e=null===(n=t.styles.find((t=>"input"===t.element)))||void 0===n?void 0:n.styleAttributes;(null==e?void 0:e.width)&&(o=e)}if(t.adaptiveStyles&&!o){const n=t.adaptiveStyles[e].find((t=>"input"===t.element)).styleAttributes;(null==n?void 0:n.width)&&(o=n)}return o}(t,e);if(!i)return;const l=et(t,e),s=r&&l&&l.enabled&&"TOP"===l.position?r.getBoundingClientRect().height+l.margin:0;i.width&&(i.width.includes("100%")?(o.style.width="100%",n.style.width=i.width):n.style.width="auto"),i.height&&(i.height.includes("100%")?(o.style.height="100%",n.style.height=i.height):n.style.height=`${parseFloat(i.height)+s}px`)}function rt(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=q(o,.5);return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function it(){return o("overlay-menu-content")}function lt(t,e,n,o,r,l){const s=function(t,e,n,o,r){const l=function(t,e,n,o){const r=i.width(o),{right:l}=t.getBoundingClientRect(),s=r-n-l-i.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:st(e).width,availableSpaceToTheLeftSideOfTheTrigger:l-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,r),s=function(t,e,n,o){const r=i.height(o),{top:l,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:st(e).height,availableSpaceAboveTriggerElem:l-n,availableSpaceBelowTriggerElem:r-s-n}}(t,e,n,r);let a="undefined";const c={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:l.availableSpaceToTheRightSideOfTheTrigger>=l.contentWidth,left:l.availableSpaceToTheLeftSideOfTheTrigger>=l.contentWidth};if(c.top?a="top":c.bottom?a="bottom":c.right?a="right":c.left&&(a="left"),c[o]&&(a=o),"undefined"===a){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,l.availableSpaceToTheRightSideOfTheTrigger,l.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?a="bottom":t===s.availableSpaceAboveTriggerElem?a="top":t===l.availableSpaceToTheRightSideOfTheTrigger?a="right":t===l.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},s),l),{position:a})}(t,e,n,o,l=l||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)Y(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),Y(e,{"margin-bottom":"0px"});else if("bottom"===t.position)Y(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),Y(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";Y(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:at(s,t.getBoundingClientRect(),e.getBoundingClientRect(),r,l),position:s.position}}function st(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:r,marginLeft:i,marginRight:l}=window.getComputedStyle(t);return{width:e+parseInt(i,10)+parseInt(l,10),height:n+parseInt(r,10)+parseInt(o,10)}}function at(t,e,n,o,r){switch(t.position){case"top":return{left:`${ct(e,n,o,r)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${ct(e,n,o,r)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${pt(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${pt(0,t)}px`}}}function ct(t,e,n,o){let r=n?t.x+t.width/2-e.width/2:t.x;return r<0&&(r=0),r+e.width>i.width(o)&&(r-=r+e.width-i.width(o)),r}function pt(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function dt(t,e){return t.startsWith("transparent")||t.startsWith("none")||!t.startsWith("rgb")||1!==(n=t.slice(0,t.match(/\)/).index+1),z(n).alpha())?J(e,Q)>J(e,G)?Q:G:t;var n}function ht(t){const e=J(t,Q),n=J(t,G);let o,r;if(e>n)for(o=Q,r=e;r>5;)o=Z(o,.1),r=J(t,o);else for(o="rgb(10, 10, 10)",r=n;r>5;)o=K(o,.1),r=J(t,o);return q(o,.2)}const ut="cl-tooltip-text-styles",mt=`\n .cl-tooltip-text {\n z-index: ${Number.MAX_SAFE_INTEGER};\n width: max-content;\n height: fit-content;\n visibility: hidden;\n background-color: white;\n color: #000;\n border: 1px solid rgb(194, 194, 194);\n border-radius: 5px;\n padding: 5px 10px;\n position: fixed;\n max-width: 300px;\n max-height: 100vh;\n box-shadow: 0 1px 5px rgba(0,0,0,.28);\n font-size: 14px;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:before {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 13px);\n border-width: 12px;\n border-style: solid;\n border-color: rgb(194, 194, 194) transparent transparent transparent;\n }\n \n .cl-tooltip-text[cl-tooltip-position='top']:after {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:before {\n content: "";\n position: absolute;\n top: -24px;\n left: calc(50% - 9px);\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent rgb(194, 194, 194) transparent;\n }\n \n .cl-tooltip-text[cl-tooltip-position='bottom']:after {\n content: "";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n`;function gt(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function bt(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=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,t);return o||null}),null)}const ft="VIEW",yt="MODULE",vt="CONTAINER",Et="INPUT",Ot="BUTTON",St="CONSENT",Tt="COLUMN",Ct="SUBSCRIBE_CONTACT",wt="REQUEST",Rt="SHOW_WIDGET",xt="OPEN_LINK",At="CLOSE_WIDGET";class Pt{static sortActions(t){const e={[At]:-1,[xt]:-2,[Rt]:1,[Ct]:2,[wt]: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=Pt.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(r("type"))));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(Pt.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,l=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={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await l.next()).done);){o=r.value,i=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{i=!0}}}catch(t){e={error:t}}finally{try{i||t||!(n=l.return)||await n.call(l)}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=[])}}Pt.IGNORING_VIEW_ENTRY_TYPES=[Ot,St,Et];const Nt="CLICK",Lt="COMPONENT_EVENT";class kt{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){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 It{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 Nt:return new Pt(t,e);case Lt:return new kt(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class _t{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 jt{constructor(){this.listeners=jt.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=_t.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=jt.createDefaultListenersState()}}jt.createDefaultListenersState=()=>({"*":{}});const Mt=(t,e,n,o)=>{const{addEventListenerBase:r,addEventListener:i}=EventTarget.prototype;(r||i).call(t,e,n,o)};class Dt{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class Ut{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===yt?Object.assign(Object.assign({},t),Ut.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}Ut.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Bt extends jt{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(Bt.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(Bt.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Bt.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Bt.changeEventName="CHANGE";class Ft{static set(t,e){const n=t[Ft.accumulatorPropertyName]||{};t[Ft.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[Ft.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}Ft.accumulatorPropertyName="clStyleAttributes";const Wt="CONTENT_LOCKER";class $t{static applyHostStyles(t,e,n=null,o){var r,i,l;const s=null===(i=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find((t=>"CLICK"===t.type));s&&(null===(l=s.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==ft&&t!==vt&&t!==Tt||(e.style.display=o===Wt&&t===ft?"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 Vt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class Ht{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.subscription=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 o,r,i,l,s;const a=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},p=(null===(l=null==c?void 0:c.styleAttributes)||void 0===l?void 0:l.background)||(null===(s=null==a?void 0:a.styleAttributes)||void 0===s?void 0:s.background),d=this.parseBackground(p);d.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:d.url,inlineSvgString:null,positionOptions:d.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),Vt.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(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}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const zt=new class{execute(t,e,n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function Qt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class Gt{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 qt{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}}const Kt="COMPONENT_RESOURCES_LOADED",Zt="FAILED_TO_LOAD_COMPONENT_RESOURCE";class Jt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Kt,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Zt,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new qt(this.onCounterStateUpdate)}}}const Xt=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Xt(...t)}},Yt=Xt,te="props",ee="shared",ne="environment";function oe(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(l=null==i?void 0:i.getAttribute)||void 0===l?void 0:l.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var l};return r(t)}const re="SUBMIT";function ie(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}function le(t,e,n){var o;return null===(o=t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function se(t,e,o){let r="rgb(0, 0, 0)";const i=t.adaptiveStyles[e].find((t=>"input"===t.element));if(i.placeholderStyleAttributes&&i.placeholderStyleAttributes.color)return i.placeholderStyleAttributes.color;const l=(i.classes||"").split(" ").filter((t=>t.startsWith(n)));if(!l.length)return r;let s=o.textClasses[l[0]];return s&&s.placeholderStyleAttributes&&s.placeholderStyleAttributes.color?s.placeholderStyleAttributes.color:r}class ae extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class ce extends HTMLElement{constructor(){var t,e;super(),this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let l=new ae("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(l),t=l.detail.props,Object.assign(this,t),this.observers=Yt(te,ee,ne),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 Dt,this.componentEventEmitter=new jt,this.componentResourceManager=new Jt(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new It(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(te).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=r("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(ee).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new Ht(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),zt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Bt.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(ne).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},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.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(te).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(ee).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(ne).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter((t=>!t.hasAttribute(r("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;t=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 o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(ie(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(ie(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const o=r("type"),i="element-styles";let l=this.getRootElement().querySelector(`style[${o}="${i}"]`);l||(l=document.createElement("style"),l.setAttribute(o,i),this.getRootElement().appendChild(l)),X({element:l,html:""}),n.forEach((e=>{let n=e.getAttribute(r("element"));const o=this.getEnvironment();let i=le(t,o,n);if(i){if(this.resizeListener.isMobile()){const e=le(t,"desktop",n);e&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(i),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,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,n)=>{var o,i;const l=[];"host"===(e=ce._resolveTogglableStylesForElementModel(e)).element&&($t.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),l.push("background")));let s=e.styleAttributes.background,a=s&&s.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],Mt(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Mt(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:Qt(e.styleAttributes,l)});if(Ft.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=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(),r=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${r}`);i||(i=document.createElement("style"),i.id=r,t.appendChild(i)),X({element:i,html:`\n ${n}::before {\n content: '';\n background: ${o.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 `}),o=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,e.element,o,`:not(.${r("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._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),o="host",i=t.getAttribute(r("element"))===o;if(!n||!i)return;const l=this.getProps(),s=this.getEnvironment(),{styleAttributes:a}=le(l.adaptiveStyles,s,o)||{};if(!a)return;const c=a.marginLeft||a.marginRight,p="100%"===a.width;if(c&&p){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,e){let o=t;return(o.classes||"").split(" ").filter((t=>t.startsWith(n))).forEach((t=>{var n;let r=null===(n=e.textClasses)||void 0===n?void 0:n[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&e.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.headerFontFamily})})),!r.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.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const l=Object.keys(n).reduce(((t,e)=>t+` ${Gt.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");X({element:t,html:`[${r("element")}="${e}"]${o} { ${l} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{X({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&X({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)&&X({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&X({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!==o("hovered")&&t!==o("focused"))).forEach((e=>{e.startsWith(n)&&t.classList.remove(e)}));const r=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",r)},this.getParentComponent=()=>oe(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return t&&1===t.split(",").length?this.parentNode:oe(this.parentNode,r("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>gt(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>bt(t,this.getWidgetLanguages()),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.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.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=>{switch(t.control.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===re));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:wt}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().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.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ce._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const pe=Symbol("required");var de=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};function he(){}const ue="pending",me="valid",ge="invalid";class be extends ce{constructor(){super(...arguments),this._createControl=(t={},...e)=>{var{element:n}=t,o=de(t,["element"]);const r=this.getProps(),i=this.getModel(),l=Object.assign(Object.assign(Object.assign({},r.control),{componentId:i.id,viewIdx:i.path[0]}),o),s=this.services.form,a=[l,n,...e];return s.hasControl(r.control.name)?s.updateControl(...a):s.registerControl(...a)},this.createControlWithValidation=(t=[],e={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:r=he,invalidCallback:i=he,pendingCallback:l=he,elementToListen:s=n,validationMap:a={},listenStatusChange:c=!0}=e,p=de(e,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!t||!Array.isArray(t))throw new Error("Validators should be an array");const d=this.getProps().control.validation,h=a[null==d?void 0:d.validator],u=t.some((t=>t[pe])),m=!!(null==d?void 0:d.required),g=m||u,b=[...t];m&&!u&&b.unshift(function(t="REQUIRED"){const e=e=>{let n;switch(typeof e){case"string":n=e&&e.length>0;break;case"boolean":n=e;break;case"number":n=!isNaN(e);break;default:n=!!e}return{isValid:n,errorKey:n?null:t}};return e[pe]=!0,e}()),h&&b.push(h);const f=this._prepareAsyncValidators(b),y=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,f);return c&&this._handleControlStatusChange(Object.assign({control:y,element:s,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:r,invalidCallback:i,pendingCallback:l},p)),y},this._prepareAsyncValidators=(t=[])=>t.reduce(((t,e,n)=>"function"!=typeof e?(console.warn(`Validator ${n} should be a function, so it will be skipped`),t):(t[`custom_${n}`]=async(...t)=>{const n=await Promise.resolve(e(...t));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},t)),{}),this._handleControlStatusChange=n=>{n.control.on(t,(t=>{this._handleValidationStatus(n,t)})),n.control.on(e,(()=>{let t=ue;switch(!0){case n.control.pending:t=ue;break;case n.control.valid:t=me;break;default:t=ge}this._handleValidationStatus(n,t)}))},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:r,validCallback:i,invalidCallback:l,errorMessageMapper:s,pendingCallback:a}=t,c=this.services.config,p=this.manifest.i18n;switch(e){case me:(function(t,e){t.classList.remove("invalid"),e.style.visibility="hidden"})(o,r),i&&i();break;case ge:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let i=function(t,e,n){const o=bt(e,gt(t)).translations,r=Object.keys(o).find((t=>t.includes(n)));return r?o[r]:n}(c,p,e);s&&(i=s(e,i)),function(t,e,n,o){let r;o=o||document,t.classList.add("invalid"),e.style.visibility="visible",e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${ut}`))return;const e=document.createElement("style");e.setAttribute("id",ut),X({element:e,html:mt}),t.head.appendChild(e)})(o),r=function(t){const e="cl-overlay-tooltip-text",n=document.getElementById(e)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==t&&(n.textContent=t,n.style=null),n.id||(n.id=e),n}(n),o.body.append(r),r.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:r}=t,i=lt(e,n,o,"top",!0,r);n.setAttribute("cl-tooltip-position",i.position),Y(n,i.coordinates)}({triggerElement:e,tooltipElement:r,htmlDocumentObject:o})},e.onmouseleave=()=>{r&&(r.remove(),function(t){const e=(t=t||document).head.querySelector(`#${ut}`);e&&e.remove()}(o))}}(o,r,i,this.htmlDocumentObject),l&&l()}break;case ue:n.touched&&(function(t,e){e.style.visibility="hidden",t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,r),a&&a())}}}}const fe={name:"SysDropdownInputComponent",componentType:"INPUT",version:"1.0.0",mappingTypes:["SELECT"],contextMenuModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]}],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!0,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!0,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"CONTROL",name:"TEXT_INPUT",propPath:["content","placeholder"],params:{label:"DOCUMENT_INPUT_PLACEHOLDER"}},{type:"CONTROL",name:"INTEGRATION_FIELD_MAPPING",params:{integrationNamePropPath:["control","integrationName"],groupNamePropPath:["control","groupName"],fieldNamePropPath:["control","fieldName"],fieldTypePropPath:["control","fieldType"],validationPropPath:["control","validation"],placeholderPropPath:["content","placeholder"],labelPropPath:["content","label"],optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"]}},{type:"CONTROL",name:"COMPONENT_OPTIONS",params:{label:"DOCUMENT_EXPORT_ID",header:"DOCUMENT_OPTIONS_HEADER",tooltip:"DOCUMENT_OPTIONS_TOOLTIP_PART1,DOCUMENT_OPTIONS_TOOLTIP_PART2",origin:!0,optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"],integrationNamePropPath:["control","integrationName"]}},{type:"CONTROL",name:"INPUT_VALIDATION",params:{validationPropPath:["control","validation"],fieldTypePropPath:["control","fieldType"],required:!0}}]},autoContrast:[{slave:{element:"input",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"input",elementProp:"placeholderStyleAttributes",elementSubProp:"color",dimmed:!0},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","placeholderTextContrastEnabled"]}],i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"TEXT_INPUT",propPath:["content","placeholder"],params:{label:"DOCUMENT_INPUT_PLACEHOLDER"}},{type:"CONTROL",name:"COMPONENT_OPTIONS",params:{label:"DOCUMENT_EXPORT_ID",header:"DOCUMENT_OPTIONS_HEADER",tooltip:"DOCUMENT_OPTIONS_TOOLTIP_PART1,DOCUMENT_OPTIONS_TOOLTIP_PART2",origin:!1,optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"],integrationNamePropPath:["control","integrationName"]}}]},focusableElements:["input","label"],events:{dispatch:[],listen:[]},i18nPropPaths:["content,label","content,placeholder","control,options,[id],label"],i18n:{en:{"control,validation,validationErrors,REQUIRED":"Required field","content,label":"Title","content,placeholder":"Choose an option"},ru:{"control,validation,validationErrors,REQUIRED":"Обязательное поле","content,label":"Заголовок","content,placeholder":"Выберите опцию"},uk:{"control,validation,validationErrors,REQUIRED":"Обов'язкове поле","content,label":"Заголовок","content,placeholder":"Оберіть опцію"},es:{"control,validation,validationErrors,REQUIRED":"Campo obligatorio","content,label":"Título","content,placeholder":"Escoja una opción"},de:{"control,validation,validationErrors,REQUIRED":"Pflichtfeld","content,label":"Titel","content,placeholder":"Wählen Sie eine Option."},fr:{"control,validation,validationErrors,REQUIRED":"Champs requis","content,label":"Titre","content,placeholder":"Choisissez une option"},it:{"control,validation,validationErrors,REQUIRED":"Campo obbligatorio","content,label":"Titolo","content,placeholder":"Scegli un'opzione"},pt:{"control,validation,validationErrors,REQUIRED":"Campo obrigatório","content,label":"Título","content,placeholder":"Alege o opțiune"},ro:{"control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","content,label":"Titlu","content,placeholder":"Alege o opțiune"},bg:{"control,validation,validationErrors,REQUIRED":"Изисквано поле","content,label":"Заглавие","content,placeholder":"Изберете опция"},cs:{"control,validation,validationErrors,REQUIRED":"Vyžadované pole","content,label":"Titul","content,placeholder":"Vyberte si možnost"},el:{"control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","content,label":"Τίτλος","content,placeholder":"Διαλέξτε μια επιλογή"},nl:{"control,validation,validationErrors,REQUIRED":"Verplicht veld","content,label":"Titel","content,placeholder":"Kies een optie"},pl:{"control,validation,validationErrors,REQUIRED":"Wymagane pole","content,label":"Tytuł","content,placeholder":"Wybierz opcję"},sv:{"control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","content,label":"Tytuł","content,placeholder":"Välj ett alternativ"},tr:{"control,validation,validationErrors,REQUIRED":"Gerekli alan","content,label":"Başlık","content,placeholder":"Bir seçenek belirleyin"},ar:{"control,validation,validationErrors,REQUIRED":"الحقل المطلوب","content,label":"عنوان","content,placeholder":"اختر خيارًا"},zh:{"control,validation,validationErrors,REQUIRED":"必填字段","content,label":"Title","content,placeholder":"选择一项"},da:{"control,validation,validationErrors,REQUIRED":"Påkrævet felt","content,label":"Titel","content,placeholder":"Vælg en mulighed"},he:{"control,validation,validationErrors,REQUIRED":"שדה נדרש","content,label":"Title","content,placeholder":"בחרו חלופה"},fi:{"control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","content,label":"Title","content,placeholder":"Valitse vaihtoehto"},hi:{"control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","content,label":"Title","content,placeholder":"एक विकल्प चुनें"},hr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title","content,placeholder":"Odaberite opciju"},hu:{"control,validation,validationErrors,REQUIRED":"Kötelező mező","content,label":"Title","content,placeholder":"Válasszon egy opciót"},id:{"control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","content,label":"Title","content,placeholder":"Pilih satu opsi"},ja:{"control,validation,validationErrors,REQUIRED":"必須フィールド","content,label":"Title","content,placeholder":"オプションを選択"},ko:{"control,validation,validationErrors,REQUIRED":"필수 칸","content,label":"Title","content,placeholder":"옵션 선택"},no:{"control,validation,validationErrors,REQUIRED":"Obligatorisk felt","content,label":"Title","content,placeholder":"Velg et alternativ"},sk:{"control,validation,validationErrors,REQUIRED":"Povinné pole","content,label":"Title","content,placeholder":"Vyberte si možnosť"},sl:{"control,validation,validationErrors,REQUIRED":"Obvezno polje","content,label":"Title","content,placeholder":"Izberite možnost"},sr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title","content,placeholder":"Izaberite opciju"}},props:{content:{label:"Title",placeholder:"Choose an option",textContrastEnabled:!0,placeholderTextContrastEnabled:!0},control:{name:"dropdown",integrationName:"dropdown",defaultValue:null,hoverColor:"rgba(0, 0, 0, 0)",selectedColor:"rgba(0, 0, 0, 0)",options:{option_1:{exportId:"option_1",label:"Option 1",id:"option_1",sort:0},option_2:{exportId:"option_2",label:"Option 2",id:"option_2",sort:1},option_3:{exportId:"other",label:"Other",id:"option_3",sort:2}},optionsAlphabeticSort:{enabled:!1},validation:{required:!0}},styles:[{element:"input",styleAttributes:{background:"rgb(255, 255, 255)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"rgba(0, 0, 0, 0.1)",borderBottomWidth:"1px",borderBottomColor:"rgba(0, 0, 0, 0.1)",borderLeftWidth:"1px",borderLeftColor:"rgba(0, 0, 0, 0.1)",borderRightWidth:"1px",borderRightColor:"rgba(0, 0, 0, 0.1)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"}},{element:"label",params:{enabled:!1,position:"TOP",margin:5}}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"35px",minHeight:"35px",color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},placeholderStyleAttributes:{color:"rgb(81, 81, 81)"},classes:""},{element:"label",styleAttributes:{color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"35px",minHeight:"35px",color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},placeholderStyleAttributes:{color:"rgb(81, 81, 81)"},classes:""},{element:"label",styleAttributes:{color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},classes:""}]}},metaDescription:{icon:"/SysDropdownInputComponent/assets/img/dropdown-component-icon.svg",label:{en:"Dropdown",ru:"Выпадающий список",uk:"Випадаючий список",es:"Desplegable",fr:"Menu déroulant",de:"Dropdown",it:"A tendina",pt:"Suspenso",ro:"Derulantă",bg:"Падащо меню",cs:"Rozevírací seznam",el:"Αναπτυσσόμενη λίστα",nl:"Vervolgkeuzelijst",pl:"Lista rozwijana",sv:"Rullgardin",tr:"Açılır",ar:"القائمة المنسدلة",zh:"下拉菜单",da:"Dropdown",he:"רשימה נפתחת",fi:"Pudotus",hi:"ड्रॉपडाउन",hr:"Padajući izbornik",hu:"Legördülő menü",id:"tarik-turun",ja:"ドロップダウン",ko:"드롭다운",no:"Nedtrekk",sk:"Rozbaľovacia ponuka",sl:"Spustni meni",sr:"Padajući meni"}}};function ye(t){setTimeout(t,50)}function ve(t){return ve="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},ve(t)}function Ee(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Oe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ee(Object(n),!0).forEach((function(e){Pe(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Se(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,l,s=[],a=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);a=!0);}catch(t){c=!0,r=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Te(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)?Te(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function Ce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Ne(o.key),o)}}function we(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(we=function(){return!!t})()}function Re(){return Re="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=xe(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Re.apply(null,arguments)}function xe(t){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(t)}function Ae(t,e){return Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ae(t,e)}function Pe(t,e,n){return(e=Ne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ne(t){var e=function(t){if("object"!=ve(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ve(e)?e:e+""}var Le=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Pe(e=function(t,e,n){return e=xe(e),function(t,e){if(e&&("object"==ve(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,we()?Reflect.construct(e,n||[],xe(t).constructor):e.apply(t,n))}(this,t),"manifest",fe),Pe(e,"registeredControl",void 0),Pe(e,"overlayBackdrop",void 0),Pe(e,"enableSearchOptionsCount",5),Pe(e,"registerControl",(function(t){e.registeredControl=e.createControlWithValidation(),e.registeredControl.setValue(null,{silent:!0,skipValidation:!0})})),Pe(e,"getOptions",(function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=null!==(t=e.getProps().control.optionsAlphabeticSort)&&void 0!==t&&t.enabled?"label":"sort";return function(t,e,n=!1){return function(t){return[...t].reduce(((t,[e,n])=>(t[e]=n,t)),{})}(Object.entries(t).sort((([t,o],[r,i])=>function(t,e,n,o=!1){let r=t[n],i=e[n];return isNaN(r)||isNaN(i)?"string"!=typeof r||"string"!=typeof i?0:(r=r.toLowerCase(),i=i.toLowerCase(),o?i.localeCompare(r):r.localeCompare(i)):r<i?o?1:-1:r>i?o?-1:1:0}(o,i,e,n))))}(e.filterOptionsBySearchValue(e.getProps().control.options,n),o)})),Pe(e,"filterOptionsBySearchValue",(function(t,e){if(!e.trim())return t;var n=e.trim().toLowerCase(),o=[];return 1===n.length?(o=Object.entries(t).filter((function(t){var e=Se(t,2);return e[0],e[1].label[0].toLowerCase()===n}))).length||(o=Object.entries(t).filter((function(t){var e=Se(t,2);return e[0],e[1].label.toLowerCase().includes(n)}))):o=Object.entries(t).filter((function(t){var e=Se(t,2);return e[0],e[1].label.toLowerCase().includes(n)})),Object.fromEntries(o)})),Pe(e,"createDropdownButtonMenuButtonComponent",(function(t,e,n,o){var r=document.createElement("div");r.classList.add("option-wrapper");var i=document.createElement("span");return i.textContent=t.label,Y(i,n),e&&(r.style.backgroundColor=ht(o)),r.appendChild(i),r})),Pe(e,"setDropdownInputText",(function(t){var n,o,r=e.getElement("input"),i=JSON.parse((null===(n=e.registeredControl)||void 0===n?void 0:n.getValue())||null);t.hasOwnProperty(null==i?void 0:i.id)&&(o=t[i.id]),r.value=o?o.label:""})),Pe(e,"createOverlayContent",(function(n,o,r,i){var l,s=e.getElement("input"),a=tt(s,t.dropdownMenuOptionLabelStyles),c=tt(s,t.overlayContentStyles);c.background=dt(c.background,a.color),Y(o,Oe(Oe({},c),{},{"border-top-left-radius":"".concat(4,"px"),"border-top-right-radius":"".concat(4,"px"),"border-bottom-left-radius":"".concat(4,"px"),"border-bottom-right-radius":"".concat(4,"px")}));var p=JSON.parse((null===(l=e.registeredControl)||void 0===l?void 0:l.getValue())||null),d=document.createElement("div");Object.entries(r).forEach((function(t){var o=Se(t,1)[0],i=r[o],l=(null==p?void 0:p.id)===o,h=e.createDropdownButtonMenuButtonComponent(i,l,a,c.background);h.addEventListener("click",(function(){var t=JSON.stringify({id:o,exportId:r[o].exportId});e.registeredControl.setValue(t),s.value=i.label,n.click()})),d.appendChild(h)}));var h=Object.keys(r).length;if(!h){var u={exportId:null,id:null,sort:0,label:e.getTranslationsMap(t.NO_MATCHES_OPTION).translations},m=e.createDropdownButtonMenuButtonComponent(u,!1,a,c.background);d.appendChild(m)}if(o.appendChild(d),Object.keys(i).length>h){var g=Object.keys(i).filter((function(t){return!r.hasOwnProperty(t)})).reduce((function(t,n){var o=i[n],r=e.createDropdownButtonMenuButtonComponent(o,!1,a,c.background);r.style.visibility="hidden",d.appendChild(r);var l=parseFloat(r.getBoundingClientRect().height);return d.removeChild(r),t+l}),0);Y(o,{"margin-bottom":"".concat(g,"px")})}})),Pe(e,"getOverlayStyles",(function(){var n=it(),o=e.getElement("input"),r=dt(tt(o,t.overlayContentStyles).background,tt(o,t.dropdownMenuOptionLabelStyles).color);return"\n .".concat(n," {\n max-height: 380px;\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);\n border-radius: 4px;\n padding: 5px 0;\n overflow: auto;\n background-color: #fff;\n display: flex;\n flex-direction: column;\n }\n \n .").concat(n,"::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n background-color: transparent;\n }\n \n .").concat(n,"::-webkit-scrollbar-thumb {\n border-radius: 6px;\n background-color: #848484;\n }\n \n .option-wrapper {\n border: 0;\n align-items: center;\n font-size: 16px;\n padding: 10px 20px;\n outline: 0;\n cursor: pointer;\n text-align: left;\n }\n \n .option-wrapper:hover {\n background-color: ").concat(ht(r),";\n }\n ")})),Pe(e,"createOverlay",(function(t){e.overlayBackdrop&&e.overlayBackdrop.click();var n=function(t){const{triggerElement:e,overlayStyles:n,createOverlayContent:o,overlayWidth:r,overlayHeight:i,offset:l,onDestroy:s,positionByDefault:a,isHorizontallyCentered:c,isBackdropDisabledOnUI:p}=t,d=t.htmlDocumentObject||document,h=function(t){const e=document.createElement("div");return e.style.position="fixed",e.style.zIndex=String(Number.MAX_SAFE_INTEGER-1),e.style.top="0",e.style.left="0",e.style.width=t?"0px":"100%",e.style.height=t?"0px":"100%",e}(p),u=document.createElement("div");u.style.position="fixed",u.style.display="block",u.style.zIndex=String(Number.MAX_SAFE_INTEGER),r&&(u.style.width=`${r}px`),i&&(u.style.height=`${i}px`);const m=u.attachShadow({mode:"open"}),g=document.createElement("style");X({element:g,html:n}),m.append(g);const b=document.createElement("div");b.classList.add(it()),d.body.append(h),d.body.append(u),m.append(b),o(h,b),(()=>{const t=lt(e,b,function(t){return null!=t?t:5}(l),a,c,d);(function(t,e){t.setAttribute("cl-overlay-position",e)})(b,t.position),Y(u,t.coordinates)})(),u.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault()}));const f=t=>{h.remove(),u.remove(),s&&s(),window.removeEventListener("keyup",t,!0)},y=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),f(y))};return h.addEventListener("click",(()=>f(y))),window.addEventListener("keyup",y,!0),{backdrop:h,overlay:u}}({triggerElement:e.getElement("input"),overlayStyles:e.getOverlayStyles(),createOverlayContent:function(n,o){e.createOverlayContent(n,o,t,e.getProps().control.options)},overlayWidth:e.getElement("input").getBoundingClientRect().width,onDestroy:function(){e.overlayBackdrop=null},positionByDefault:"bottom",htmlDocumentObject:e.htmlDocumentObject});e.overlayBackdrop=n.backdrop,e.overlayBackdrop.addEventListener("click",(function(n){n.isTrusted&&e.setDropdownInputText(t)}))})),Pe(e,"setPlaceholder",(function(n,o){var r=e.getElement("input"),i=se(n,o,e.getShared());e.getRootElement().querySelector("#cl-dropdown-styles").textContent=t.componentStyle({placeholderColor:i});var l=n.content.placeholder||e.getTranslationsMap(t.DEFAULT_PLACEHOLDER_VALUE).translations;r.setAttribute("placeholder",l)})),Pe(e,"setArrowIconStyles",(function(t,n){var o=e.getRootElement(),r=se(t,n,e.getShared()),i=o.querySelector(".dropdown-input-select-button");i&&(i.style.color=r)})),Pe(e,"configInputEventListeners",(function(){var t=e.getElement("input");Object.values(e.getOptions()).length<e.enableSearchOptionsCount?t.setAttribute("readonly","readonly"):t.addEventListener("input",(function(t){var n=t.target;ye((function(){return e.createOverlay(e.getOptions(n.value))}))}))})),e.getRootElement().innerHTML='\n <style id="cl-dropdown-styles">'.concat(t.componentStyle(),"</style>\n ").concat(t.componentTemplate,"\n "),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&&Ae(t,e)}(t,be),e=t,n=[{key:"connectedCallback",value:function(){var e,n,o,r=this;(e=t,n=this,"function"==typeof(o=Re(xe(1&3?e.prototype:e),"connectedCallback",n))?function(t){return o.apply(n,t)}:o)([]);var i=this.getRootElement(),l=this.getProps();this.registerControl(i),this.setPlaceholder(l,this.getEnvironment()),this.setDropdownInputText(this.getOptions()),this.observeProps((function(t,e){var n=r.getEnvironment();r.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles),nt(e,n,i,".label-with-dropdown-input-container"),ot(e,n,r.getHostElement(),r.getElement("input"),r.getElement("label")),r.setPlaceholder(e,n),r.setDropdownInputText(r.getOptions()),r.setArrowIconStyles(e,n),function(t){let e;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=rt(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=rt(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=rt(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=rt(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(r.getElement("input"))})),this.observeShared((function(){r.setPlaceholder(r.getProps(),r.getEnvironment()),r.setArrowIconStyles(r.getProps(),r.getEnvironment())})),this.observeEnvironment((function(t,e){var n=r.getProps();nt(n,e,i,".label-with-dropdown-input-container"),ot(n,e,r.getHostElement(),r.getElement("input"),r.getElement("label")),r.setPlaceholder(n,e),r.setArrowIconStyles(n,e)})),i.querySelector(".dropdown-input-with-tooltip").addEventListener("click",(function(){ye((function(){return r.createOverlay(r.getOptions())}))})),this.configInputEventListeners()}}],n&&Ce(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();Pe(Le,"define",{name:"sys-dropdown-input",model:fe.name,manifest:fe}),Pe(Le,"DEFAULT_PLACEHOLDER_VALUE",{en:"Choose an option",ru:"Выберите опцию",uk:"Оберіть опцію",es:"Escoja una opción",de:"Wählen Sie eine Option",fr:"Choisissez une option",it:"Scegli un'opzione",pt:"Escolha uma opção",ro:"Alegeți o opțiune",bg:"Изберете опция",cs:"Vyberte si možnost",el:"Διαλέξτε μια επιλογή",nl:"Kies een optie",pl:"Wybierz opcję",sv:"Välj ett alternativ",tr:"Bir seçenek belirleyin",ar:"اختر خيارًا"}),Pe(Le,"NO_MATCHES_OPTION",{en:"No matches",ru:"Нет совпадений",uk:"Збігів немає",es:"No matches",de:"No matches",fr:"No matches",it:"No matches",pt:"No matches",ro:"No matches",bg:"No matches",cs:"No matches",el:"No matches",nl:"No matches",pl:"No matches",sv:"No matches",tr:"No matches",ar:"No matches"}),Pe(Le,"overlayContentStyles",["background","border-style","border-top-width","border-top-color","border-bottom-width","border-bottom-color","border-left-width","border-left-color","border-right-width","border-right-color","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"]),Pe(Le,"dropdownMenuOptionLabelStyles",["color","font-family","font-size","letter-spacing","text-shadow","font-weight","line-height","text-align"]),Pe(Le,"componentStyle",(function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).placeholderColor||"#808080";return"\n .main-container {\n height: 100%;\n }\n \n .label-with-dropdown-input-container {\n height: 100%;\n display: flex;\n }\n \n .label {\n min-height: 10px;\n }\n \n .label.cl-focused {\n min-height: auto;\n }\n \n .dropdown-input-with-tooltip {\n position: relative;\n display: flex;\n height: 100%;\n width: 100%;\n cursor: pointer;\n }\n \n .invalid {\n border: 1px solid #ff0000 !important;\n }\n \n .input-tooltip {\n visibility: hidden;\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1;\n border-radius: 100%;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Chrome/Safari/Opera */\n -khtml-user-select: none; /* Konqueror */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n }\n \n .dropdown-label {\n display: flex;\n align-items: center;\n height: 100%;\n width: 100%;\n padding: 0 35px 0 20px;\n cursor: pointer;\n }\n \n .dropdown-label::placeholder {\n color: ".concat(t,";\n }\n \n .dropdown-input-select-button {\n background: transparent;\n border: none;\n min-width: max-content;\n width: 24px;\n height: 100%;\n display: flex;\n align-items: center;\n margin-right: 5px;\n position: absolute;\n right: 0;\n z-index: 2;\n }\n \n button.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n }\n")})),Pe(Le,"componentTemplate",'\n <div class="main-container">\n <div class="label-with-dropdown-input-container">\n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label">\n </div>\n <div class="dropdown-input-with-tooltip">\n <div class="dropdown-input-select-button">\n <svg width="11" height="7" viewBox="0 0 11 7" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M10.5248 1.90196L9.57381 2.71322L6.05712 5.71322L5.24395 6.40691L4.4324 5.71132L0.949088 2.72576L0 1.91229L1.62694 0.0141139L2.57603 0.827583L5.24778 3.11756L7.9513 0.811257L8.90228 0L10.5248 1.90196Z"\n fill="currentColor"/>\n </svg>\n </div>\n \x3c!--"one-time-code" disables autofill in chromium--\x3e\n <input cl-element="input"\n class="dropdown-label"\n autocomplete="one-time-code"\n placeholder="placeholder"/>\n <div class="input-tooltip">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n </div>\n </div>\n </div>\n');export{Le as default};window.clComponentClass_SysDropdownInputComponent=Le;
1
+ const t="validationStatusChanged",e="touchedStatusChanged",n="cl-";function o(t){return n+t}function r(t){return"cl-"+t}class i{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const n=t||document;return Math.max(n.documentElement.clientWidth,(null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const n=t||document;return Math.max(n.documentElement.clientHeight,(null===(e=n.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const n=t||document;return((null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)-n.documentElement.clientWidth}}var l={transparent:"#0000"},s=function(t,e,n,o){return null!=o&&""!==o||(o=1),t=parseFloat(t),e=parseFloat(e),n=parseFloat(n),o=parseFloat(o),t<=255&&t>=0&&e<=255&&e>=0&&n<=255&&n>=0&&o<=1&&o>=0?[Math.round(t),Math.round(e),Math.round(n),o]:null},a=[];for(var c in l)a.push(c);var d="\\s*([.\\d%]+)\\s*",p="\\("+[d,d,d]+"(?:,\\s*([.\\d]+)\\s*)?\\)",h="(?:rgb)a?",u="("+a.join("|")+")",m=RegExp(h+p,"i"),g=function(t,e){if(null==t)return null;t=(t+"").replace(/\s+/,"");var n=l[t];return n?g(n,e):(n=t.match(m))&&(t=n.slice(1))&&(t=s.apply(null,t))?e?t:(1===t[3]&&t.splice(3,1),"rgb"+(4===t.length?"a":"")+"("+t+")"):null};RegExp([u,"(?:#([a-f0-9]{3,8}))",h+p,"(?:hsl)a?"+p].join("|"),"gi");const b=g;class f{ratio(t,e,n){return t=this.getRgbTriplet(t,n),e=this.getRgbTriplet(e,n),this.wcagRgb(t,e)}isNotTransparent(t,e){e=e||{};const n=(t=b(t)).match(/\((.*)\)/)[1].split(",");if(4!=n.length||"0"!=n[3]||e.ignoreAlpha)return t;throw new TypeError("get-contrast cannot contrast transparent colors")}getRgbTriplet(t,e){if("string"!=typeof t)throw new TypeError("get-contrast expects colors as strings");let n=t.toLowerCase();return n=this.isNotTransparent(n,e),n.match(/\((.*)\)/)[1].split(",").slice(0,3)}wcagRgb(t,e){return this.luminance(this.relativeLuminance(t),this.relativeLuminance(e))}luminance(t,e){return(Math.max(t,e)+.05)/(Math.min(t,e)+.05)}relativeLuminance(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=1/12.92;function i(t){return Math.pow((t+.055)/1.055,2.4)}return.2126*(e<=.03928?e*r:i(e))+.7152*(n<=.03928?n*r:i(n))+.0722*(o<=.03928?o*r:i(o))}}function v(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}var y=Array.prototype.concat,E=Array.prototype.slice,O=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var r=t[n];v(r)?e=y.call(e,E.call(r)):e.push(r)}return e};O.wrap=function(t){return function(){return t(O(arguments))}};const S=O;var T={},C=Object.hasOwnProperty,w=Object.create(null);for(var R in T)C.call(T,R)&&(w[T[R]]=R);var x={to:{},get:{}};function A(t,e,n){return Math.min(Math.max(e,t),n)}x.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=x.get.hsl(t),n="hsl"):(e=x.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},x.get.rgb=function(t){if(!t)return null;var e,n,o,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var i=2*n;r[n]=parseInt(e.slice(i,i+2),16)}o&&(r[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);o&&(r[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:C.call(T,e[1])?((r=T[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=A(r[n],0,255);return r[3]=A(r[3],0,1),r},x.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,A(parseFloat(e[2]),0,100),A(parseFloat(e[3]),0,100),A(isNaN(n)?1:n,0,1)]}return null},x.to.rgb=function(){var t=S(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},x.to.hsl=function(){var t=S(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const P=x,N={},L={};for(const t of Object.keys(N))L[N[t]]=t;const k={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(k)){if(!("channels"in k[t]))throw new Error("missing channels property: "+t);if(!("labels"in k[t]))throw new Error("missing channel labels property: "+t);if(k[t].labels.length!==k[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=k[t];delete k[t].channels,delete k[t].labels,Object.defineProperty(k[t],"channels",{value:e}),Object.defineProperty(k[t],"labels",{value:n})}k.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=Math.min(e,n,o),i=Math.max(e,n,o),l=i-r;let s,a;i===r?s=0:e===i?s=(n-o)/l:n===i?s=2+(o-e)/l:o===i&&(s=4+(e-n)/l),s=Math.min(60*s,360),s<0&&(s+=360);const c=(r+i)/2;return a=i===r?0:c<=.5?l/(i+r):l/(2-i-r),[s,100*a,100*c]},k.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let r,i,l;if(0===n)return l=255*o,[l,l,l];r=o<.5?o*(1+n):o+n-o*n;const s=2*o-r,a=[0,0,0];for(let t=0;t<3;t++)i=e+1/3*-(t-1),i<0&&i++,i>1&&i--,l=6*i<1?s+6*(r-s)*i:2*i<1?r:3*i<2?s+(r-s)*(2/3-i)*6:s,a[t]=255*l;return a};const I=k;function _(t,e){return function(n){return e(t(n))}}function j(t,e){const n=[e[t].parent,t];let o=I[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)n.unshift(e[r].parent),o=_(I[e[r].parent][r],o),r=e[r].parent;return o.conversion=n,o}const M={};Object.keys(I).forEach((t=>{M[t]={},Object.defineProperty(M[t],"channels",{value:I[t].channels}),Object.defineProperty(M[t],"labels",{value:I[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(I);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(I[t]);for(let r=o.length,i=0;i<r;i++){const r=o[i],l=e[r];-1===l.distance&&(l.distance=e[t].distance+1,l.parent=t,n.unshift(r))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,r=0;r<t;r++){const t=o[r];null!==e[t].parent&&(n[t]=j(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];M[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),M[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const D=M,U=["keyword","gray","hex"],B={};for(const t of Object.keys(D))B[[...D[t].labels].sort().join("")]=t;const F={};function W(t,e){if(!(this instanceof W))return new W(t,e);if(e&&e in U&&(e=null),e&&!(e in D))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof W)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=P.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=D[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=D[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=H(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in B))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=B[o];const{labels:r}=D[this.model],i=[];for(n=0;n<r.length;n++)i.push(t[r[n]]);this.color=H(i)}if(F[this.model])for(o=D[this.model].channels,n=0;n<o;n++){const t=F[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}W.prototype={toString(){return this.string()},string(t){let e=this.model in P.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return P.to[e.model](n)},round(t){return t=Math.max(t||0,0),new W([...this.color.map($(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new W([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(D)){if(U.includes(t))continue;const{channels:e}=D[t];W.prototype[t]=function(...e){return this.model===t?new W(this):e.length>0?new W(e,t):new W([...V(D[this.model][t].raw(this.color)),this.valpha],t)},W[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=H(n,e)),new W(o,t)}}function $(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function V(t){return Array.isArray(t)?t:[t]}function H(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const z=W,G="rgb(255, 255, 255)",Q="rgb(0, 0, 0)";function q(t,e){return z(t).alpha(e).string()}function K(t,e){try{return z(t).lighten(e).rgb().string()}catch(e){return console.warn("ColorUtils.lighten:",e),t}}function Z(t,e){try{return z(t).darken(e).rgb().string()}catch(e){return console.warn("ColorUtils.darken:",e),t}}function J(t,e){try{return(new f).ratio(t,e)}catch(n){return console.warn(`ColorUtils.getContrastRatio: transparent colors were used ${t}, ${e}`),0}}function X(t){const{element:e,html:n,appendHtml:o}=t,r=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);o?e.innerHTML+=r:e.innerHTML=r}function Y(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function tt(t,e){const n=window.getComputedStyle(t);return e.reduce(((t,e)=>(t[e]=n.getPropertyValue(e),t)),{})}function et(t,e){var n,o;let r;return t.styles&&(r=null===(n=t.styles.find((t=>"label"===t.element)))||void 0===n?void 0:n.params),t.adaptiveStyles&&!r&&(r=null===(o=t.adaptiveStyles[e].find((t=>"label"===t.element)))||void 0===o?void 0:o.params),r}function nt(t,e,n,o){var r;const i=n.querySelector(o),l=et(t,e);if(!l)return;const s=n.querySelector(".label");s&&(X({element:s,html:(null===(r=t.content)||void 0===r?void 0:r.label)||""}),"TOP"===l.position?(i.style.flexDirection="column",i.style.alignItems="unset",Y(s,{marginRight:"0",marginBottom:`${l.margin}px`})):(i.style.flexDirection="row",i.style.alignItems="center",Y(s,{marginRight:`${l.margin}px`,marginBottom:"0"})),l.enabled?s.style.display="":s.style.display="none")}function ot(t,e,n,o,r){const i=function(t,e){var n;let o;if(t.styles){const e=null===(n=t.styles.find((t=>"input"===t.element)))||void 0===n?void 0:n.styleAttributes;(null==e?void 0:e.width)&&(o=e)}if(t.adaptiveStyles&&!o){const n=t.adaptiveStyles[e].find((t=>"input"===t.element)),r=null==n?void 0:n.styleAttributes;(null==r?void 0:r.width)&&(o=r)}return o}(t,e);if(!i)return;const l=et(t,e),s=r&&l&&l.enabled&&"TOP"===l.position?r.getBoundingClientRect().height+(l.margin||0):0;i.width&&(i.width.includes("100%")?(o.style.width="100%",n.style.width=i.width):n.style.width="auto"),i.height&&(i.height.includes("100%")?(o.style.height="100%",n.style.height=i.height):n.style.height=`${parseFloat(i.height)+s}px`)}function rt(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=q(o,.5);return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function it(){return o("overlay-menu-content")}function lt(t,e,n,o,r,l){const s=function(t,e,n,o,r){const l=function(t,e,n,o){const r=i.width(o),{right:l}=t.getBoundingClientRect(),s=r-n-l-i.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:st(e).width,availableSpaceToTheLeftSideOfTheTrigger:l-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,r),s=function(t,e,n,o){const r=i.height(o),{top:l,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:st(e).height,availableSpaceAboveTriggerElem:l-n,availableSpaceBelowTriggerElem:r-s-n}}(t,e,n,r);let a="undefined";const c={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:l.availableSpaceToTheRightSideOfTheTrigger>=l.contentWidth,left:l.availableSpaceToTheLeftSideOfTheTrigger>=l.contentWidth};if(c.top?a="top":c.bottom?a="bottom":c.right?a="right":c.left&&(a="left"),o&&c[o]&&(a=o),"undefined"===a){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,l.availableSpaceToTheRightSideOfTheTrigger,l.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?a="bottom":t===s.availableSpaceAboveTriggerElem?a="top":t===l.availableSpaceToTheRightSideOfTheTrigger?a="right":t===l.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},s),l),{position:a})}(t,e,n,o,l=l||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)Y(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),Y(e,{"margin-bottom":"0px"});else if("bottom"===t.position)Y(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),Y(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";Y(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:at(s,t.getBoundingClientRect(),e.getBoundingClientRect(),r,l),position:s.position}}function st(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:r,marginLeft:i,marginRight:l}=window.getComputedStyle(t);return{width:e+parseInt(i,10)+parseInt(l,10),height:n+parseInt(r,10)+parseInt(o,10)}}function at(t,e,n,o,r){switch(t.position){case"top":return{left:`${ct(e,n,o,r)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${ct(e,n,o,r)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${dt(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${dt(0,t)}px`}}}function ct(t,e,n,o){let r=n?t.x+t.width/2-e.width/2:t.x;return r<0&&(r=0),r+e.width>i.width(o)&&(r-=r+e.width-i.width(o)),r}function dt(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function pt(t,e){return t.startsWith("transparent")||t.startsWith("none")||!t.startsWith("rgb")||1!==(n=t.slice(0,t.match(/\)/).index+1),z(n).alpha())?J(e,G)>J(e,Q)?G:Q:t;var n}function ht(t){const e=J(t,G),n=J(t,Q);let o,r;if(e>n)for(o=G,r=e;r>5;)o=Z(o,.1),r=J(t,o);else for(o="rgb(10, 10, 10)",r=n;r>5;)o=K(o,.1),r=J(t,o);return q(o,.2)}const ut="cl-tooltip-text-styles",mt=`\n .cl-tooltip-text {\n z-index: ${Number.MAX_SAFE_INTEGER};\n width: max-content;\n height: fit-content;\n visibility: hidden;\n background-color: white;\n color: #000;\n border: 1px solid rgb(194, 194, 194);\n border-radius: 5px;\n padding: 5px 10px;\n position: fixed;\n max-width: 300px;\n max-height: 100vh;\n box-shadow: 0 1px 5px rgba(0,0,0,.28);\n font-size: 14px;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:before {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 13px);\n border-width: 12px;\n border-style: solid;\n border-color: rgb(194, 194, 194) transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:after {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:before {\n content: "";\n position: absolute;\n top: -24px;\n left: calc(50% - 9px);\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent rgb(194, 194, 194) transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:after {\n content: "";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n`;function gt(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function bt(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=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,t);return o||null}),null)}const ft="VIEW",vt="MODULE",yt="CONTAINER",Et="INPUT",Ot="BUTTON",St="CONSENT",Tt="COLUMN",Ct="SUBSCRIBE_CONTACT",wt="REQUEST",Rt="SHOW_WIDGET",xt="OPEN_LINK",At="CLOSE_WIDGET";class Pt{static sortActions(t){const e={[At]:-1,[xt]:-2,[Rt]:1,[Ct]:2,[wt]: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=Pt.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(r("type"))));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(Pt.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,l=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={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await l.next()).done);){o=r.value,i=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{i=!0}}}catch(t){e={error:t}}finally{try{i||t||!(n=l.return)||await n.call(l)}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=[])}}Pt.IGNORING_VIEW_ENTRY_TYPES=[Ot,St,Et];const Nt="CLICK",Lt="COMPONENT_EVENT";class kt{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){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 It{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 Nt:return new Pt(t,e);case Lt:return new kt(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class _t{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 jt{constructor(){this.listeners=jt.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=_t.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=jt.createDefaultListenersState()}}jt.createDefaultListenersState=()=>({"*":{}});const Mt=(t,e,n,o)=>{const r=EventTarget.prototype,{addEventListenerBase:i,addEventListener:l}=r;(i||l).call(t,e,n,o)};class Dt{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class Ut{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===vt?Object.assign(Object.assign({},t),Ut.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}Ut.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Bt extends jt{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(Bt.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(Bt.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Bt.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Bt.changeEventName="CHANGE";class Ft{static set(t,e){const n=t[Ft.accumulatorPropertyName]||{};t[Ft.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[Ft.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}Ft.accumulatorPropertyName="clStyleAttributes";const Wt="CONTENT_LOCKER";class $t{static applyHostStyles(t,e,n=null,o){var r,i,l;const s=null===(i=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find((t=>"CLICK"===t.type));s&&(null===(l=s.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==ft&&t!==yt&&t!==Tt||(e.style.display=o===Wt&&t===ft?"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 Vt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class Ht{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.subscription=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 o,r,i,l,s;const a=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},d=(null===(l=null==c?void 0:c.styleAttributes)||void 0===l?void 0:l.background)||(null===(s=null==a?void 0:a.styleAttributes)||void 0===s?void 0:s.background),p=this.parseBackground(d);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(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),Vt.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(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}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const zt=new class{execute(t,e="GET",n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function Gt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class Qt{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 qt{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}}const Kt="COMPONENT_RESOURCES_LOADED",Zt="FAILED_TO_LOAD_COMPONENT_RESOURCE";class Jt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Kt,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Zt,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new qt(this.onCounterStateUpdate)}}}const Xt=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Xt(...t)}},Yt=Xt,te="props",ee="shared",ne="environment";function oe(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(l=null==i?void 0:i.getAttribute)||void 0===l?void 0:l.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var l};return r(t)}const re="SUBMIT";function ie(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}function le(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function se(t,e,o){var r;let i="rgb(0, 0, 0)";const l=t.adaptiveStyles[e].find((t=>"input"===t.element));if(!l)return i;if(l.placeholderStyleAttributes&&l.placeholderStyleAttributes.color)return l.placeholderStyleAttributes.color;const s=(l.classes||"").split(" ").filter((t=>t.startsWith(n)));if(!s.length)return i;let a=null===(r=o.textClasses)||void 0===r?void 0:r[s[0]];return a&&a.placeholderStyleAttributes&&a.placeholderStyleAttributes.color?a.placeholderStyleAttributes.color:i}class ae extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}const ce="STATIC",de="UPDATING";class pe extends HTMLElement{constructor(){var t,e;super(),this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let l=new ae("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(l),t=l.detail.props,Object.assign(this,t),this.observers=Yt(te,ee,ne),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 Dt({}),this.componentEventEmitter=new jt,this.componentResourceManager=new Jt(this.model.id,this.services.eventEmitter,this.isStaticRenderMode),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new It(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(te).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=r("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(ee).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new Ht(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),zt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Bt.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(ne).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},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.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(te).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(ee).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(ne).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter((t=>!t.hasAttribute(r("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;const o=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 o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(ie(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(ie(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e),i=r("type"),l="element-styles";let s=this.getRootElement().querySelector(`style[${i}="${l}"]`);s||(s=document.createElement("style"),s.setAttribute(i,l),this.getRootElement().appendChild(s)),X({element:s,html:""}),n.forEach((t=>{let e=t.getAttribute(r("element"));const n=this.getEnvironment();let i=le(o,n,e);if(i){if(this.resizeListener.isMobile()){const t=le(o,"desktop",e);t&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(i),s)}})),this._addLinkColor(s,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,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,n)=>{var o,i;const l=[];"host"===(e=pe._resolveTogglableStylesForElementModel(e)).element&&($t.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),l.push("background")));let s=e.styleAttributes.background,a=s&&s.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],Mt(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Mt(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:Gt(e.styleAttributes,l)});if(Ft.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=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(),r=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${r}`);i||(i=document.createElement("style"),i.id=r,t.appendChild(i)),X({element:i,html:`\n ${n}::before {\n content: '';\n background: ${o.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 `}),o=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,e.element,o,`:not(.${r("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){let o=t;return(o.classes||"").split(" ").filter((t=>t.startsWith(n))).forEach((t=>{var n;let r=null===(n=e.textClasses)||void 0===n?void 0:n[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&e.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.headerFontFamily})})),!r.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.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const l=Object.keys(n).reduce(((t,e)=>t+` ${Qt.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");X({element:t,html:`[${r("element")}="${e}"]${o} { ${l} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{X({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&X({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)&&X({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&X({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!==o("hovered")&&t!==o("focused"))).forEach((e=>{e.startsWith(n)&&t.classList.remove(e)}));const r=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",r)},this.getParentComponent=()=>oe(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return t&&1===t.split(",").length?this.parentNode:oe(this.parentNode,r("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>gt(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>bt(t,this.getWidgetLanguages()),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.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,o,r,i,l;const s=t.control.name;if(["email","first_name","last_name"].includes(s))return s.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(r=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===o?void 0:o.params)||void 0===r?void 0:r.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(i=t.content)||void 0===i?void 0:i.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(l=t.control)||void 0===l?void 0:l.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===re));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:wt}).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.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}get isStaticRenderMode(){return this.services.config.getConfig("renderMode")===ce}get isUpdatingRenderMode(){return this.services.config.getConfig("renderMode")===de}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=pe._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const he=Symbol("required");var ue=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};function me(){}const ge="pending",be="valid",fe="invalid";class ve extends pe{constructor(){super(...arguments),this._createControl=(t={},...e)=>{const{element:n}=t,o=ue(t,["element"]),r=this.getProps(),i=this.getModel(),l=Object.assign(Object.assign(Object.assign({},r.control),{componentId:i.id,viewIdx:i.path[0]}),o),s=this.services.form,a=[l,n,...e];return s.hasControl(r.control.name)?s.updateControl(...a):s.registerControl(...a)},this.createControlWithValidation=(t=[],e={})=>{const{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:r=me,invalidCallback:i=me,pendingCallback:l=me,elementToListen:s=n,validationMap:a={},listenStatusChange:c=!0}=e,d=ue(e,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!t||!Array.isArray(t))throw new Error("Validators should be an array");const p=this.getProps().control.validation,h=(null==p?void 0:p.validator)?a[p.validator]:void 0,u=t.some((t=>t[he])),m=!!(null==p?void 0:p.required),g=m||u,b=[...t];m&&!u&&b.unshift(function(t="REQUIRED"){const e=e=>{let n;switch(typeof e){case"string":n=e&&e.length>0;break;case"boolean":n=e;break;case"number":n=!isNaN(e);break;default:n=!!e}return{isValid:n,errorKey:n?null:t}};return e[he]=!0,e}()),h&&b.push(h);const f=this._prepareAsyncValidators(b),v=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,f);return c&&this._handleControlStatusChange(Object.assign({control:v,element:s,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:r,invalidCallback:i,pendingCallback:l},d)),v},this._prepareAsyncValidators=(t=[])=>t.reduce(((t,e,n)=>"function"!=typeof e?(console.warn(`Validator ${n} should be a function, so it will be skipped`),t):(t[`custom_${n}`]=async(...t)=>{const n=await Promise.resolve(e(...t));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},t)),{}),this._handleControlStatusChange=n=>{n.control.on(t,(t=>{this._handleValidationStatus(n,t)})),n.control.on(e,(()=>{let t=ge;switch(!0){case n.control.pending:t=ge;break;case n.control.valid:t=be;break;default:t=fe}this._handleValidationStatus(n,t)}))},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:r,validCallback:i,invalidCallback:l,errorMessageMapper:s,pendingCallback:a}=t,c=this.services.config,d=this.manifest.i18n;switch(e){case be:(function(t,e){t.classList.remove("invalid"),e&&(e.style.visibility="hidden")})(o,r),i&&i();break;case fe:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let i=function(t,e,n){const o=bt(e,gt(t));if(!o)return n;const r=o.translations,i=Object.keys(r).find((t=>t.includes(n)));return i?r[i]:n}(c,d,e);s&&(i=s(e,i)),function(t,e,n,o){o=o||document;let r=null;t.classList.add("invalid"),e&&(e.style.visibility="visible"),e&&(e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${ut}`))return;const e=document.createElement("style");e.setAttribute("id",ut),X({element:e,html:mt}),t.head.appendChild(e)})(o),r=function(t){const e="cl-overlay-tooltip-text",n=document.getElementById(e)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==t&&(n.textContent=t,n.style=null),n.id||(n.id=e),n}(n),o.body.append(r),r.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:r}=t,i=lt(e,n,o,"top",!0,r);n.setAttribute("cl-tooltip-position",i.position),Y(n,i.coordinates)}({triggerElement:e,tooltipElement:r,htmlDocumentObject:o})},e.onmouseleave=()=>{r&&(r.remove(),function(t){const e=(t=t||document).head.querySelector(`#${ut}`);e&&e.remove()}(o))})}(o,r,i,this.htmlDocumentObject),l&&l()}break;case ge:n.touched&&(function(t,e){e&&(e.style.visibility="hidden"),t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,r),a&&a())}}}}const ye={name:"SysDropdownInputComponent",componentType:"INPUT",version:"1.0.0",mappingTypes:["SELECT"],contextMenuModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]}],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!0,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!0,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"CONTROL",name:"TEXT_INPUT",propPath:["content","placeholder"],params:{label:"DOCUMENT_INPUT_PLACEHOLDER"}},{type:"CONTROL",name:"INTEGRATION_FIELD_MAPPING",params:{integrationNamePropPath:["control","integrationName"],groupNamePropPath:["control","groupName"],fieldNamePropPath:["control","fieldName"],fieldTypePropPath:["control","fieldType"],validationPropPath:["control","validation"],placeholderPropPath:["content","placeholder"],labelPropPath:["content","label"],optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"]}},{type:"CONTROL",name:"COMPONENT_OPTIONS",params:{label:"DOCUMENT_EXPORT_ID",header:"DOCUMENT_OPTIONS_HEADER",tooltip:"DOCUMENT_OPTIONS_TOOLTIP_PART1,DOCUMENT_OPTIONS_TOOLTIP_PART2",origin:!0,optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"],integrationNamePropPath:["control","integrationName"]}},{type:"CONTROL",name:"INPUT_VALIDATION",params:{validationPropPath:["control","validation"],fieldTypePropPath:["control","fieldType"],required:!0}}]},autoContrast:[{slave:{element:"input",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"input",elementProp:"placeholderStyleAttributes",elementSubProp:"color",dimmed:!0},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","placeholderTextContrastEnabled"]}],i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"TEXT_INPUT",propPath:["content","placeholder"],params:{label:"DOCUMENT_INPUT_PLACEHOLDER"}},{type:"CONTROL",name:"COMPONENT_OPTIONS",params:{label:"DOCUMENT_EXPORT_ID",header:"DOCUMENT_OPTIONS_HEADER",tooltip:"DOCUMENT_OPTIONS_TOOLTIP_PART1,DOCUMENT_OPTIONS_TOOLTIP_PART2",origin:!1,optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"],integrationNamePropPath:["control","integrationName"]}}]},focusableElements:["input","label"],events:{dispatch:[],listen:[]},i18nPropPaths:["content,label","content,placeholder","control,options,[id],label"],i18n:{en:{"control,validation,validationErrors,REQUIRED":"Required field","content,label":"Title","content,placeholder":"Choose an option"},ru:{"control,validation,validationErrors,REQUIRED":"Обязательное поле","content,label":"Заголовок","content,placeholder":"Выберите опцию"},uk:{"control,validation,validationErrors,REQUIRED":"Обов'язкове поле","content,label":"Заголовок","content,placeholder":"Оберіть опцію"},es:{"control,validation,validationErrors,REQUIRED":"Campo obligatorio","content,label":"Título","content,placeholder":"Escoja una opción"},de:{"control,validation,validationErrors,REQUIRED":"Pflichtfeld","content,label":"Titel","content,placeholder":"Wählen Sie eine Option."},fr:{"control,validation,validationErrors,REQUIRED":"Champs requis","content,label":"Titre","content,placeholder":"Choisissez une option"},it:{"control,validation,validationErrors,REQUIRED":"Campo obbligatorio","content,label":"Titolo","content,placeholder":"Scegli un'opzione"},pt:{"control,validation,validationErrors,REQUIRED":"Campo obrigatório","content,label":"Título","content,placeholder":"Alege o opțiune"},ro:{"control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","content,label":"Titlu","content,placeholder":"Alege o opțiune"},bg:{"control,validation,validationErrors,REQUIRED":"Изисквано поле","content,label":"Заглавие","content,placeholder":"Изберете опция"},cs:{"control,validation,validationErrors,REQUIRED":"Vyžadované pole","content,label":"Titul","content,placeholder":"Vyberte si možnost"},el:{"control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","content,label":"Τίτλος","content,placeholder":"Διαλέξτε μια επιλογή"},nl:{"control,validation,validationErrors,REQUIRED":"Verplicht veld","content,label":"Titel","content,placeholder":"Kies een optie"},pl:{"control,validation,validationErrors,REQUIRED":"Wymagane pole","content,label":"Tytuł","content,placeholder":"Wybierz opcję"},sv:{"control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","content,label":"Tytuł","content,placeholder":"Välj ett alternativ"},tr:{"control,validation,validationErrors,REQUIRED":"Gerekli alan","content,label":"Başlık","content,placeholder":"Bir seçenek belirleyin"},ar:{"control,validation,validationErrors,REQUIRED":"الحقل المطلوب","content,label":"عنوان","content,placeholder":"اختر خيارًا"},zh:{"control,validation,validationErrors,REQUIRED":"必填字段","content,label":"Title","content,placeholder":"选择一项"},da:{"control,validation,validationErrors,REQUIRED":"Påkrævet felt","content,label":"Titel","content,placeholder":"Vælg en mulighed"},he:{"control,validation,validationErrors,REQUIRED":"שדה נדרש","content,label":"Title","content,placeholder":"בחרו חלופה"},fi:{"control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","content,label":"Title","content,placeholder":"Valitse vaihtoehto"},hi:{"control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","content,label":"Title","content,placeholder":"एक विकल्प चुनें"},hr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title","content,placeholder":"Odaberite opciju"},hu:{"control,validation,validationErrors,REQUIRED":"Kötelező mező","content,label":"Title","content,placeholder":"Válasszon egy opciót"},id:{"control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","content,label":"Title","content,placeholder":"Pilih satu opsi"},ja:{"control,validation,validationErrors,REQUIRED":"必須フィールド","content,label":"Title","content,placeholder":"オプションを選択"},ko:{"control,validation,validationErrors,REQUIRED":"필수 칸","content,label":"Title","content,placeholder":"옵션 선택"},no:{"control,validation,validationErrors,REQUIRED":"Obligatorisk felt","content,label":"Title","content,placeholder":"Velg et alternativ"},sk:{"control,validation,validationErrors,REQUIRED":"Povinné pole","content,label":"Title","content,placeholder":"Vyberte si možnosť"},sl:{"control,validation,validationErrors,REQUIRED":"Obvezno polje","content,label":"Title","content,placeholder":"Izberite možnost"},sr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title","content,placeholder":"Izaberite opciju"}},props:{content:{label:"Title",placeholder:"Choose an option",textContrastEnabled:!0,placeholderTextContrastEnabled:!0},control:{name:"dropdown",integrationName:"dropdown",defaultValue:null,hoverColor:"rgba(0, 0, 0, 0)",selectedColor:"rgba(0, 0, 0, 0)",options:{option_1:{exportId:"option_1",label:"Option 1",id:"option_1",sort:0},option_2:{exportId:"option_2",label:"Option 2",id:"option_2",sort:1},option_3:{exportId:"other",label:"Other",id:"option_3",sort:2}},optionsAlphabeticSort:{enabled:!1},validation:{required:!0}},styles:[{element:"input",styleAttributes:{background:"rgb(255, 255, 255)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"rgba(0, 0, 0, 0.1)",borderBottomWidth:"1px",borderBottomColor:"rgba(0, 0, 0, 0.1)",borderLeftWidth:"1px",borderLeftColor:"rgba(0, 0, 0, 0.1)",borderRightWidth:"1px",borderRightColor:"rgba(0, 0, 0, 0.1)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"}},{element:"label",params:{enabled:!1,position:"TOP",margin:5}}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"35px",minHeight:"35px",color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},placeholderStyleAttributes:{color:"rgb(81, 81, 81)"},classes:""},{element:"label",styleAttributes:{color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"35px",minHeight:"35px",color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},placeholderStyleAttributes:{color:"rgb(81, 81, 81)"},classes:""},{element:"label",styleAttributes:{color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},classes:""}]}},metaDescription:{icon:"/SysDropdownInputComponent/assets/img/dropdown-component-icon.svg",label:{en:"Dropdown",ru:"Выпадающий список",uk:"Випадаючий список",es:"Desplegable",fr:"Menu déroulant",de:"Dropdown",it:"A tendina",pt:"Suspenso",ro:"Derulantă",bg:"Падащо меню",cs:"Rozevírací seznam",el:"Αναπτυσσόμενη λίστα",nl:"Vervolgkeuzelijst",pl:"Lista rozwijana",sv:"Rullgardin",tr:"Açılır",ar:"القائمة المنسدلة",zh:"下拉菜单",da:"Dropdown",he:"רשימה נפתחת",fi:"Pudotus",hi:"ड्रॉपडाउन",hr:"Padajući izbornik",hu:"Legördülő menü",id:"tarik-turun",ja:"ドロップダウン",ko:"드롭다운",no:"Nedtrekk",sk:"Rozbaľovacia ponuka",sl:"Spustni meni",sr:"Padajući meni"}}};function Ee(t){setTimeout(t,50)}function Oe(t){return Oe="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},Oe(t)}function Se(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Te(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Se(Object(n),!0).forEach((function(e){Le(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ce(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,l,s=[],a=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);a=!0);}catch(t){c=!0,r=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return we(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)?we(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function Re(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,ke(o.key),o)}}function xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xe=function(){return!!t})()}function Ae(){return Ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Pe(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ae.apply(null,arguments)}function Pe(t){return Pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pe(t)}function Ne(t,e){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ne(t,e)}function Le(t,e,n){return(e=ke(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ke(t){var e=function(t){if("object"!=Oe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oe(e)?e:e+""}var Ie=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Le(e=function(t,e,n){return e=Pe(e),function(t,e){if(e&&("object"==Oe(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,xe()?Reflect.construct(e,n||[],Pe(t).constructor):e.apply(t,n))}(this,t),"manifest",ye),Le(e,"registeredControl",void 0),Le(e,"overlayBackdrop",void 0),Le(e,"enableSearchOptionsCount",5),Le(e,"registerControl",(function(t){e.registeredControl=e.createControlWithValidation(),e.registeredControl.setValue(null,{silent:!0,skipValidation:!0})})),Le(e,"getOptions",(function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=null!==(t=e.getProps().control.optionsAlphabeticSort)&&void 0!==t&&t.enabled?"label":"sort";return function(t,e,n=!1){return function(t){return[...t].reduce(((t,[e,n])=>(t[e]=n,t)),{})}(Object.entries(t).sort((([t,o],[r,i])=>function(t,e,n,o=!1){let r=t[n],i=e[n];return isNaN(r)||isNaN(i)?"string"!=typeof r||"string"!=typeof i?0:(r=r.toLowerCase(),i=i.toLowerCase(),o?i.localeCompare(r):r.localeCompare(i)):r<i?o?1:-1:r>i?o?-1:1:0}(o,i,e,n))))}(e.filterOptionsBySearchValue(e.getProps().control.options,n),o)})),Le(e,"filterOptionsBySearchValue",(function(t,e){if(!e.trim())return t;var n=e.trim().toLowerCase(),o=[];return 1===n.length?(o=Object.entries(t).filter((function(t){var e=Ce(t,2);return e[0],e[1].label[0].toLowerCase()===n}))).length||(o=Object.entries(t).filter((function(t){var e=Ce(t,2);return e[0],e[1].label.toLowerCase().includes(n)}))):o=Object.entries(t).filter((function(t){var e=Ce(t,2);return e[0],e[1].label.toLowerCase().includes(n)})),Object.fromEntries(o)})),Le(e,"createDropdownButtonMenuButtonComponent",(function(t,e,n,o){var r=document.createElement("div");r.classList.add("option-wrapper");var i=document.createElement("span");return i.textContent=t.label,Y(i,n),e&&(r.style.backgroundColor=ht(o)),r.appendChild(i),r})),Le(e,"setDropdownInputText",(function(t){var n,o,r=e.getElement("input"),i=JSON.parse((null===(n=e.registeredControl)||void 0===n?void 0:n.getValue())||null);t.hasOwnProperty(null==i?void 0:i.id)&&(o=t[i.id]),r.value=o?o.label:""})),Le(e,"createOverlayContent",(function(n,o,r,i){var l,s=e.getElement("input"),a=tt(s,t.dropdownMenuOptionLabelStyles),c=tt(s,t.overlayContentStyles);c.background=pt(c.background,a.color),Y(o,Te(Te({},c),{},{"border-top-left-radius":"".concat(4,"px"),"border-top-right-radius":"".concat(4,"px"),"border-bottom-left-radius":"".concat(4,"px"),"border-bottom-right-radius":"".concat(4,"px")}));var d=JSON.parse((null===(l=e.registeredControl)||void 0===l?void 0:l.getValue())||null),p=document.createElement("div");Object.entries(r).forEach((function(t){var o=Ce(t,1)[0],i=r[o],l=(null==d?void 0:d.id)===o,h=e.createDropdownButtonMenuButtonComponent(i,l,a,c.background);h.addEventListener("click",(function(){var t=JSON.stringify({id:o,exportId:r[o].exportId});e.registeredControl.setValue(t),s.value=i.label,n.click()})),p.appendChild(h)}));var h=Object.keys(r).length;if(!h){var u={exportId:null,id:null,sort:0,label:e.getTranslationsMap(t.NO_MATCHES_OPTION).translations},m=e.createDropdownButtonMenuButtonComponent(u,!1,a,c.background);p.appendChild(m)}if(o.appendChild(p),Object.keys(i).length>h){var g=Object.keys(i).filter((function(t){return!r.hasOwnProperty(t)})).reduce((function(t,n){var o=i[n],r=e.createDropdownButtonMenuButtonComponent(o,!1,a,c.background);r.style.visibility="hidden",p.appendChild(r);var l=parseFloat(r.getBoundingClientRect().height);return p.removeChild(r),t+l}),0);Y(o,{"margin-bottom":"".concat(g,"px")})}})),Le(e,"getOverlayStyles",(function(){var n=it(),o=e.getElement("input"),r=pt(tt(o,t.overlayContentStyles).background,tt(o,t.dropdownMenuOptionLabelStyles).color);return"\n .".concat(n," {\n max-height: 380px;\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);\n border-radius: 4px;\n padding: 5px 0;\n overflow: auto;\n background-color: #fff;\n display: flex;\n flex-direction: column;\n }\n \n .").concat(n,"::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n background-color: transparent;\n }\n \n .").concat(n,"::-webkit-scrollbar-thumb {\n border-radius: 6px;\n background-color: #848484;\n }\n \n .option-wrapper {\n border: 0;\n align-items: center;\n font-size: 16px;\n padding: 10px 20px;\n outline: 0;\n cursor: pointer;\n text-align: left;\n }\n \n .option-wrapper:hover {\n background-color: ").concat(ht(r),";\n }\n ")})),Le(e,"createOverlay",(function(t){e.overlayBackdrop&&e.overlayBackdrop.click();var n=function(t){const{triggerElement:e,overlayStyles:n,createOverlayContent:o,overlayWidth:r,overlayHeight:i,offset:l,onDestroy:s,positionByDefault:a,isHorizontallyCentered:c,isBackdropDisabledOnUI:d}=t,p=t.htmlDocumentObject||document,h=function(t){const e=document.createElement("div");return e.style.position="fixed",e.style.zIndex=String(Number.MAX_SAFE_INTEGER-1),e.style.top="0",e.style.left="0",e.style.width=t?"0px":"100%",e.style.height=t?"0px":"100%",e}(d),u=document.createElement("div");u.style.position="fixed",u.style.display="block",u.style.zIndex=String(Number.MAX_SAFE_INTEGER),r&&(u.style.width=`${r}px`),i&&(u.style.height=`${i}px`);const m=u.attachShadow({mode:"open"}),g=document.createElement("style");X({element:g,html:n}),m.append(g);const b=document.createElement("div");b.classList.add(it()),p.body.append(h),p.body.append(u),m.append(b),o(h,b),(()=>{const t=lt(e,b,function(t){return null!=t?t:5}(l),a,c,p);(function(t,e){t.setAttribute("cl-overlay-position",e)})(b,t.position),Y(u,t.coordinates)})(),u.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault()}));const f=t=>{h.remove(),u.remove(),s&&s(),window.removeEventListener("keyup",t,!0)},v=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),f(v))};return h.addEventListener("click",(()=>f(v))),window.addEventListener("keyup",v,!0),{backdrop:h,overlay:u}}({triggerElement:e.getElement("input"),overlayStyles:e.getOverlayStyles(),createOverlayContent:function(n,o){e.createOverlayContent(n,o,t,e.getProps().control.options)},overlayWidth:e.getElement("input").getBoundingClientRect().width,onDestroy:function(){e.overlayBackdrop=null},positionByDefault:"bottom",htmlDocumentObject:e.htmlDocumentObject});e.overlayBackdrop=n.backdrop,e.overlayBackdrop.addEventListener("click",(function(n){n.isTrusted&&e.setDropdownInputText(t)}))})),Le(e,"setPlaceholder",(function(n,o){var r=e.getElement("input"),i=se(n,o,e.getShared());e.getRootElement().querySelector("#cl-dropdown-styles").textContent=t.componentStyle({placeholderColor:i});var l=n.content.placeholder||e.getTranslationsMap(t.DEFAULT_PLACEHOLDER_VALUE).translations;r.setAttribute("placeholder",l)})),Le(e,"setArrowIconStyles",(function(t,n){var o=e.getRootElement(),r=se(t,n,e.getShared()),i=o.querySelector(".dropdown-input-select-button");i&&(i.style.color=r)})),Le(e,"configInputEventListeners",(function(){var t=e.getElement("input");Object.values(e.getOptions()).length<e.enableSearchOptionsCount?t.setAttribute("readonly","readonly"):t.addEventListener("input",(function(t){var n=t.target;Ee((function(){return e.createOverlay(e.getOptions(n.value))}))}))})),e.getRootElement().innerHTML='\n <style id="cl-dropdown-styles">'.concat(t.componentStyle(),"</style>\n ").concat(t.componentTemplate,"\n "),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&&Ne(t,e)}(t,ve),e=t,n=[{key:"connectedCallback",value:function(){var e,n,o,r=this;(e=t,n=this,"function"==typeof(o=Ae(Pe(1&3?e.prototype:e),"connectedCallback",n))?function(t){return o.apply(n,t)}:o)([]);var i=this.getRootElement(),l=this.getProps();this.registerControl(i),this.setPlaceholder(l,this.getEnvironment()),this.setDropdownInputText(this.getOptions()),this.observeProps((function(t,e){var n=r.getEnvironment();r.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles),nt(e,n,i,".label-with-dropdown-input-container"),ot(e,n,r.getHostElement(),r.getElement("input"),r.getElement("label")),r.setPlaceholder(e,n),r.setDropdownInputText(r.getOptions()),r.setArrowIconStyles(e,n),function(t){let e=null;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=rt(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=rt(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=rt(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=rt(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(r.getElement("input"))})),this.observeShared((function(){r.setPlaceholder(r.getProps(),r.getEnvironment()),r.setArrowIconStyles(r.getProps(),r.getEnvironment())})),this.observeEnvironment((function(t,e){var n=r.getProps();nt(n,e,i,".label-with-dropdown-input-container"),ot(n,e,r.getHostElement(),r.getElement("input"),r.getElement("label")),r.setPlaceholder(n,e),r.setArrowIconStyles(n,e)})),i.querySelector(".dropdown-input-with-tooltip").addEventListener("click",(function(){Ee((function(){return r.createOverlay(r.getOptions())}))})),this.configInputEventListeners()}}],n&&Re(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();Le(Ie,"define",{name:"sys-dropdown-input",model:ye.name,manifest:ye}),Le(Ie,"DEFAULT_PLACEHOLDER_VALUE",{en:"Choose an option",ru:"Выберите опцию",uk:"Оберіть опцію",es:"Escoja una opción",de:"Wählen Sie eine Option",fr:"Choisissez une option",it:"Scegli un'opzione",pt:"Escolha uma opção",ro:"Alegeți o opțiune",bg:"Изберете опция",cs:"Vyberte si možnost",el:"Διαλέξτε μια επιλογή",nl:"Kies een optie",pl:"Wybierz opcję",sv:"Välj ett alternativ",tr:"Bir seçenek belirleyin",ar:"اختر خيارًا"}),Le(Ie,"NO_MATCHES_OPTION",{en:"No matches",ru:"Нет совпадений",uk:"Збігів немає",es:"No matches",de:"No matches",fr:"No matches",it:"No matches",pt:"No matches",ro:"No matches",bg:"No matches",cs:"No matches",el:"No matches",nl:"No matches",pl:"No matches",sv:"No matches",tr:"No matches",ar:"No matches"}),Le(Ie,"overlayContentStyles",["background","border-style","border-top-width","border-top-color","border-bottom-width","border-bottom-color","border-left-width","border-left-color","border-right-width","border-right-color","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"]),Le(Ie,"dropdownMenuOptionLabelStyles",["color","font-family","font-size","letter-spacing","text-shadow","font-weight","line-height","text-align"]),Le(Ie,"componentStyle",(function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).placeholderColor||"#808080";return"\n .main-container {\n height: 100%;\n }\n \n .label-with-dropdown-input-container {\n height: 100%;\n display: flex;\n }\n \n .label {\n min-height: 10px;\n }\n \n .label.cl-focused {\n min-height: auto;\n }\n \n .dropdown-input-with-tooltip {\n position: relative;\n display: flex;\n height: 100%;\n width: 100%;\n cursor: pointer;\n }\n \n .invalid {\n border: 1px solid #ff0000 !important;\n }\n \n .input-tooltip {\n visibility: hidden;\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1;\n border-radius: 100%;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Chrome/Safari/Opera */\n -khtml-user-select: none; /* Konqueror */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n }\n \n .dropdown-label {\n display: flex;\n align-items: center;\n height: 100%;\n width: 100%;\n padding: 0 35px 0 20px;\n cursor: pointer;\n }\n \n .dropdown-label::placeholder {\n color: ".concat(t,";\n }\n \n .dropdown-input-select-button {\n background: transparent;\n border: none;\n min-width: max-content;\n width: 24px;\n height: 100%;\n display: flex;\n align-items: center;\n margin-right: 5px;\n position: absolute;\n right: 0;\n z-index: 2;\n }\n \n button.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n }\n")})),Le(Ie,"componentTemplate",'\n <div class="main-container">\n <div class="label-with-dropdown-input-container">\n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label">\n </div>\n <div class="dropdown-input-with-tooltip">\n <div class="dropdown-input-select-button">\n <svg width="11" height="7" viewBox="0 0 11 7" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M10.5248 1.90196L9.57381 2.71322L6.05712 5.71322L5.24395 6.40691L4.4324 5.71132L0.949088 2.72576L0 1.91229L1.62694 0.0141139L2.57603 0.827583L5.24778 3.11756L7.9513 0.811257L8.90228 0L10.5248 1.90196Z"\n fill="currentColor"/>\n </svg>\n </div>\n \x3c!--"one-time-code" disables autofill in chromium--\x3e\n <input cl-element="input"\n class="dropdown-label"\n autocomplete="one-time-code"\n placeholder="placeholder"/>\n <div class="input-tooltip">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n </div>\n </div>\n </div>\n');export{Ie as default};window.clComponentClass_SysDropdownInputComponent=Ie;