@iamproperty/components 5.7.1-beta6 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/components/barchart.component.css +1 -1
- package/assets/css/components/barchart.component.css.map +1 -1
- package/assets/css/components/charts.module.css +1 -1
- package/assets/css/components/charts.module.css.map +1 -1
- package/assets/js/components/_global.js +32 -0
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/barchart/barchart.component.js +6 -7
- package/assets/js/components/barchart/barchart.component.min.js +4 -4
- package/assets/js/components/barchart/barchart.component.min.js.map +1 -1
- package/assets/js/components/card/card.component.js +1 -1
- package/assets/js/components/card/card.component.min.js +2 -2
- package/assets/js/components/card/card.component.min.js.map +1 -1
- package/assets/js/components/carousel/carousel.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- package/assets/js/components/multiselect/multiselect.component.min.js +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +1 -1
- package/assets/js/modules/chart.module.js +25 -60
- package/assets/js/scripts.bundle.js +2 -2
- package/assets/js/scripts.bundle.js.map +1 -1
- package/assets/js/scripts.bundle.min.js +2 -2
- package/assets/js/scripts.bundle.min.js.map +1 -1
- package/assets/js/tests/chart.spec.js +57 -0
- package/assets/sass/components/charts.module.scss +13 -4
- package/assets/ts/components/_global.ts +40 -0
- package/assets/ts/components/barchart/barchart.component.ts +7 -17
- package/assets/ts/components/card/card.component.ts +1 -1
- package/assets/ts/modules/chart.module.ts +25 -74
- package/assets/ts/tests/chart.spec.ts +77 -0
- package/dist/components.es.js +11 -11
- package/dist/components.umd.js +12 -12
- package/package.json +1 -1
package/assets/js/dynamic.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey
|
|
2
|
+
* iamKey v6.0.0
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/(function(p){typeof define=="function"&&define.amd?define(p):p()})(function(){"use strict";const p=e=>(e.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&e.classList.add("ie"),null),E=e=>{const i=function(t){const a=document.querySelector(`label[for="${t.replace("#","")}"]`),o=document.querySelector(t+" summary"),r=document.querySelector(`dialog${t}`),s=document.querySelector(`detail${t}`);a instanceof HTMLElement?a.click():o instanceof HTMLElement?o.click():r instanceof HTMLElement?r.showModal():s instanceof HTMLElement&&s.addAttribute("open")};return location.hash&&i(location.hash),window.addEventListener("hashchange",function(){i(location.hash)},!1),addEventListener("popstate",t=>{if(t&&t.state&&t.state.type&&t.state.type=="pagination"){let a=document.querySelector(`#${t.state.form}`),o=document.querySelector(`#${t.state.form} [data-pagination]`);o?o.value=t.state.page:a.innerHTML+=`<input name="page" type="hidden" data-pagination="true" value="${t.state.page}" />`,a.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",t=>{if(t&&t.target instanceof HTMLElement&&t.target.matches("form")){let a=t.target;Array.from(a.querySelectorAll("[data-password-type]")).forEach((o,r)=>{o.setAttribute("type","password")}),(a.querySelector(":invalid")||a.querySelector('.pwd-checker[data-strength="1"]')||a.querySelector('.pwd-checker[data-strength="2"]'))&&(a.classList.add("was-validated"),t.preventDefault()),a.querySelector("iam-multiselect[data-is-required][data-error]")&&(a.classList.add("was-validated"),t.preventDefault())}}),document.addEventListener("keydown",t=>{t.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(t.preventDefault(),t.stopPropagation())}),Array.from(document.querySelectorAll("label progress")).forEach((t,a)=>{t.closest("label").setAttribute("data-percent",t.getAttribute("value"))}),null};class q{constructor(i){document.body.classList.contains("youtubeLoaded")?i.addEventListener("click",function(t){for(var a=t.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){t.preventDefault(),g(a);break}},!1):this.loadScripts(i,this.createEmbed)}loadScripts(i){return new Promise((t,a)=>{const o=new Image;o.onload=function(){var r=document.createElement("script");r.src="https://www.youtube.com/iframe_api";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(r,s),document.body.classList.add("youtubeLoaded"),t(!0),r.onload=()=>{i.addEventListener("click",function(l){console.log("click"),l&&l.target instanceof HTMLElement&&l.target.closest("a")&&(l.preventDefault(),g(l.target.closest("a")))},!1)}},o.onerror=function(){a(!1)},o.src="https://youtube.com/favicon.ico"})}}const g=function(e){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var i=e.getAttribute("data-id"),t=e.getAttribute("id");if(typeof t>"u"||t==null){var a=String.fromCharCode(65+Math.floor(Math.random()*26));t=a+Date.now(),e.setAttribute("id",t)}function o(){window.player=new YT.Player(t,{height:"100%",width:"100%",videoId:i,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:r,onStateChange:l}})}o();function r(n){n.target.playVideo()}var s=!1;function l(n){if(n.data==YT.PlayerState.PLAYING&&!s){var c=document.getElementById(t);c.classList.add("player-ready"),s=!0}}},x=e=>(Array.from(e.querySelectorAll("dialog[open]")).forEach((i,t)=>{i.closest(".dialog__wrapper")||(i.removeAttribute("open"),i.showModal(),i.focus(),L(i))}),e.addEventListener("click",i=>{if(i.target.tagName=="IAM-ACTIONBAR")return!1;if(i&&i.target instanceof HTMLElement&&i.target.closest("[data-modal]")){const o=i.target.closest("[data-modal]"),r=o.hasAttribute("data-modal")?o.getAttribute("data-modal"):o.getAttribute("data-filter"),s=document.querySelector(`dialog#${r}`);L(s),s.showModal(),s.focus();let l=s.offsetWidth;s.setAttribute("style",`max-width: ${l}px;`),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((n,c)=>{const d=n.getAttribute("data-duplicate"),f=document.getElementById(d);if(n.checked!=f.checked){n.checked=f.checked;let u=new Event("change");n.dispatchEvent(u)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(i&&i.target instanceof HTMLElement&&i.target.closest("button.dialog__close")){const o=i.target.closest("dialog[open]");i.preventDefault(),o.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((s,l)=>{s.classList.remove("active")});let r=new CustomEvent("dialog-closed",{bubbles:!0,cancelable:!0,detail:{modalId:o.id}});i.target.dispatchEvent(r),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(i&&i.target instanceof HTMLElement&&i.target.closest('button[formmethod="dialog"]')){const o=i.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(i&&i.target instanceof HTMLElement&&i.target.closest("dialog[open]")){let o=i.target.closest("dialog[open]");var t=window.getComputedStyle(o);if(t.display==="contents"&&(o=o.parentNode.closest("dialog[open]")),!o.classList.contains("dialog--transactional")&&!o.classList.contains("dialog--acknowledgement")){const r=o.getBoundingClientRect();(i.clientX<r.left||i.clientX>r.right||i.clientY<r.top||i.clientY>r.bottom)&&(i.target.closest("dialog *")||o.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")}))}}if(i&&i.target instanceof HTMLElement&&i.target.closest(".dialog__wrapper > button")){i.stopPropagation();let o=i.target.closest(".dialog__wrapper > button"),r=o.parentNode,s="openPopover",l=r.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=l&&o.closest("dialog[open]")!=document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((f,u)=>{f.removeAttribute("aria-expanded")}),l.hasAttribute("open"))l.close(),s="closePopover",l.removeAttribute("style"),o.removeAttribute("aria-expanded");else{l.show(),o.setAttribute("aria-expanded",!0);var a=o.getBoundingClientRect();let f=a.top,u=a.left;if(o.closest("iam-table")){let m=o.closest("iam-table").parentNode.getBoundingClientRect();f-=m.top,u-=m.left}l.classList.contains("dialog--fix")&&l.setAttribute("style",`position:fixed;top: ${f}px; left: ${u}px; margin: 3rem 0 0 0;`)}let n=l.getBoundingClientRect(),c=n.bottom-window.scrollY,d=window.innerHeight-window.scrollY;if(c>d){let f=l.hasAttribute("style")?l.getAttribute("style")+" ":"";l.setAttribute("style",f+"transform: translate(0, calc(-100% - 4rem))"),n=l.getBoundingClientRect(),n.top-window.scrollY<100&&l.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:s,id:o.textContent})}i&&i.target instanceof HTMLElement&&!i.target.closest("dialog[open]")&&!i.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((o,r)=>{o.removeAttribute("aria-expanded")}))}),null),L=e=>{let i=e.querySelector(".youtube-embed a");if(i&&g(i),e.classList.contains("dialog--multi")&&!e.querySelector(":scope > .steps")&&k(e),!e.querySelector(":scope .mh-lg")&&!e.classList.contains("dialog--multi")){e.innerHTML=`<div class="mh-lg">${e.innerHTML}</div>`;let t=e.querySelector(".mh-lg"),a=e.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){let o=a.previousSibling;t.before(a),o&&a.before(o)}}e.querySelector(":scope > button:first-child")||e.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},k=e=>{let i="",t=Array.from(e.querySelectorAll("fieldset[data-title]")),a=e.querySelector("form");t.forEach((s,l)=>{i+=`<button data-title="${s.getAttribute("data-title")}" type="button" class="${l==0?"active":""}" tabindex="-1">${s.getAttribute("data-title")}</button>`;const n=document.createElement("div");if(n.classList.add("btn--wrapper"),s.appendChild(n),l!=0&&(n.innerHTML+=`<button data-title="${t[l-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),l!=t.length-1&&(n.innerHTML+=`<button data-title="${t[l+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),l==t.length-1)if(a&&a.querySelector(':scope > button[type="submit"]')){let c=a.querySelector(':scope > button[type="submit"]');c.classList.add("mb-0"),n.insertAdjacentElement("beforeend",c)}else n.innerHTML+=`<button data-title="${t[l].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),e.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${i}</div>`);let o=Array.from(e.querySelectorAll("fieldset.was-validated"));for(let s=0;s<o.length;s++){let l=o[s],n=l.getAttribute("data-title");if(l.querySelector(".is-invalid")){Array.from(e.querySelectorAll(`[data-title="${n}"]`)).forEach((c,d)=>{c.classList.add("active")});break}else Array.from(e.querySelectorAll(`[data-title="${n}"]`)).forEach((c,d)=>{c.classList.add("valid")})}e.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function r(s){const l=e.querySelector("fieldset.active")?e.querySelector("fieldset.active"):e.querySelector("fieldset[data-title]"),n=l.getAttribute("data-title");let c=!0;if(l.classList.add("was-validated"),Array.from(l.querySelectorAll("input")).forEach((u,m)=>{u.checkValidity()||(c=!1)}),c?Array.from(e.querySelectorAll(`[data-title="${n}"]`)).forEach((u,m)=>{u.classList.add("valid")}):Array.from(e.querySelectorAll(`[data-title="${n}"]`)).forEach((u,m)=>{u.classList.remove("valid")}),c||!s.hasAttribute("data-next")){const u=e.querySelector(`fieldset[data-title="${s.getAttribute("data-title")}"]`),m=e.querySelector(`.steps button[data-title="${s.getAttribute("data-title")}"]`);Array.from(e.querySelectorAll("button")).forEach((h,b)=>{h.classList.remove("active")}),Array.from(e.querySelectorAll("fieldset")).forEach((h,b)=>{h.classList.remove("active")}),m.classList.add("active"),u.classList.add("active")}let d=Array.from(e.querySelectorAll("fieldset")).length,f=Array.from(e.querySelectorAll("fieldset.valid")).length;e.style.setProperty("--progress",`${f/(d-1)*100}%`)}e.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){const l=s.target.closest("button");s.keyCode==13&&l.getAttribute("type")!="submit"&&(s.preventDefault(),r(l))}s&&s.target instanceof HTMLElement&&s.target.closest("input")&&(s.target.closest("input").classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault())}),e.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]'))s.target.closest("form").classList.add("was-validated");else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){const l=s.target.closest("button[data-title]");r(l)}return null})};function T(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",e=>{const i=e.target.closest("[open] summary");if(i)window.dataLayer.push({event:"closeDetails",detailsTitle:i.textContent||""});else{const t=e.target.closest("summary"),a=e.target.closest("a"),o=e.target.closest("button");t&&window.dataLayer.push({event:"openDetails",detailsTitle:t.textContent||""}),a&&window.dataLayer.push({event:"linkClicked",linkText:a.hasAttribute("title")?a.getAttribute("title")||"":a.textContent||"",class:a.hasAttribute("class")&&a.getAttribute("class")||"",href:a.getAttribute("href")||""}),o&&window.dataLayer.push({event:"buttonClicked",buttonText:o.textContent||"",class:o.hasAttribute("class")&&o.getAttribute("class")||""})}})}function M(e){var i=new TextEncoder("utf-8").encode(e);return crypto.subtle.digest("SHA-1",i).then(function(t){for(var a=[],o=new DataView(t),r=0;r<o.byteLength;r+=4){var s=o.getUint32(r),l=s.toString(16),n="00000000",c=(n+l).slice(-n.length);a.push(c)}return a.join("")})}const $=(e,i)=>{M(e).then(function(t){const a=new XMLHttpRequest;a.addEventListener("load",function(){const o=this.responseText.split(`
|
|
5
5
|
`),r=t.slice(5).toUpperCase();var s=!1;for(let n in o)if(o[n].substring(0,35)==r){s=!0;break}const l=new CustomEvent("hibpCheck",{detail:s});i.dispatchEvent(l)}),a.open("GET","https://api.pwnedpasswords.com/range/"+t.substr(0,5)),a.send()})},C=e=>{function i(){if(Array.from(document.querySelectorAll("input[maxlength],textarea[maxlength]")).forEach((t,a)=>{t.parentElement,_(t)}),Array.from(document.querySelectorAll("label input")).forEach((t,a)=>{!t.closest("label").querySelector(".optional-text")&&!t.hasAttribute("required")&&(t.parentNode.tagName.toLowerCase()=="span"?t.parentElement.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'):t.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'))}),document.querySelector('input[type="date"]')){let a=function(o){const r=o.getFullYear(),s=String(o.getMonth()+1).padStart(2,"0"),l=String(o.getDate()).padStart(2,"0");return`${r}-${s}-${l}`};const t=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((o,r)=>{let s=t;if(o.hasAttribute("data-start")&&(s.setDate(s.getDate()+parseInt(o.getAttribute("data-start"))),o.setAttribute("min",a(s))),o.hasAttribute("data-period")){let l=parseInt(o.getAttribute("data-period")),n=new Date;n.setDate(s.getDate()+l),o.setAttribute("max",a(n))}if(o.hasAttribute("data-allowed-days")){let l=JSON.parse(`[${o.getAttribute("data-allowed-days")}]`);o.addEventListener("input",function(n){var c=new Date(this.value).getUTCDay();l.includes(c)?o.setCustomValidity(""):o.setCustomValidity("That day of the week is not allowed")})}})}}document.readyState==="complete"&&i(),document.onreadystatechange=()=>{document.readyState==="complete"&&i()},e.addEventListener("input",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("input,textarea,select")){const a=t.target.closest("input,textarea,select");a.parentElement,a.hasAttribute("type")&&a.getAttribute("type")=="color"&&(a.nextElementSibling.value=a.value),a.hasAttribute("maxlength")&&a.nextElementSibling&&a.nextElementSibling.setAttribute("data-count",a.value.length),a.hasAttribute("data-strength-checker")&&A(a)}}),e.addEventListener("change",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("select")){const a=t.target.closest("select");if(a.hasAttribute("data-change-type")&&a.hasAttribute("data-input")){const o=document.getElementById(a.getAttribute("data-input")),r=a.value;S(o,r)}}if(t&&t.target instanceof HTMLElement&&t.target.closest('dialog [type="radio"]')){const a=t.target.closest("dialog");t.target.closest('dialog [type="radio"]'),Array.from(a.querySelectorAll('[type="radio"][autofocus]')).forEach((o,r)=>{o.removeAttribute("autofocus")}),Array.from(a.querySelectorAll('[type="radio"]:checked')).forEach((o,r)=>{o.setAttribute("autofocus",!0)})}}),e.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-change-type][data-input]:not(select)")){const a=t.target.closest("[data-change-type]"),o=document.getElementById(a.getAttribute("data-input")),r=a.getAttribute("data-change-type");if(a.setAttribute("data-change-type",o.getAttribute("type")),S(o,r),a.hasAttribute("data-alt-class")){const s=a.getAttribute("data-alt-class");a.setAttribute("data-alt-class",a.getAttribute("class")),a.setAttribute("class",s)}}})},_=e=>{let i=e.parentElement,t=e.getAttribute("maxlength");i.style.setProperty("--maxlength",t);let a=e.nextElementSibling;(!a||a&&a.classList.contains("invalid-feedback"))&&(a=document.createElement("span"),i.insertBefore(a,e.nextSibling)),a.setAttribute("data-count",e.value.length)},S=(e,i)=>{e.hasAttribute("type")&&e.getAttribute("type")=="password"&&e.setAttribute("data-password-type",!0),e.setAttribute("type",i)},A=(e,i="no")=>{const t=document.getElementById(e.getAttribute("data-strength-checker")),a=e.value,o=e.hasAttribute("minlength")?e.getAttribute("minlength"):12;let r=1,s=["Very weak","Weak","Average","Strong","Very strong"],l="";if(a.match(/(?=.*[0-9])/)&&(r+=1),a.match(/(?=.*[!,%,&,#,$,^,*,?,_,~,<,>,])/)&&(r+=1),a.match(/(?=.*[a-z])/)&&(r+=1),a.match(/(?=.*[A-Z])/)&&(r+=1),a.length<o&&(r=1,l=`(must be at least ${o} characters.)`),r>=3&&i=="no"){let n=function(c,d){c.detail?A(d,"danger"):A(d,"success"),d.removeEventListener("hibpCheck",n)};$(a,e),e.addEventListener("hibpCheck",function(c){n(c,e)})}else r>=3&&i=="danger"&&(r=3,l="(this password is very common)");t&&(r<=3?t.classList.add("invalid-feedback"):t.classList.remove("invalid-feedback"),t.setAttribute("data-strength",r),t.innerHTML=`Password strength: ${s[r-1]} ${l}`)},H=e=>{Array.from(e.querySelectorAll("details")).forEach((i,t)=>{i.addEventListener("mouseenter",function(a){window.matchMedia("(min-width: 62em)").matches&&i.setAttribute("open","true")},!1),i.addEventListener("mouseleave",function(a){window.matchMedia("(min-width: 62em)").matches&&i.removeAttribute("open")},!1)}),"IntersectionObserver"in window&&new IntersectionObserver(([t])=>t.target.classList.toggle("is-stuck",t.intersectionRatio<1),{threshold:[1]}).observe(e)};function D(e){var i;const t=e.querySelector(".testimonial__images"),a=t.querySelectorAll("img").length;if(a==1)return!1;e.classList.add("testimonial--multi");const o=function(r){const s=e.querySelector(".btn-next"),l=e.querySelector(".btn-prev");s.setAttribute("data-go",r+1),l.setAttribute("data-go",r-1),s.removeAttribute("disabled"),l.removeAttribute("disabled"),r==1?l.setAttribute("disabled",!0):r==a&&s.setAttribute("disabled",!0)};t.addEventListener("scroll",function(r){clearTimeout(i),i=setTimeout(function(){let s=t.scrollWidth,l=t.scrollHeight,n=t.scrollLeft,c=t.scrollTop,d=Math.round(n/s*a)+1;n==0&&c!=0&&(d=Math.round(c/l*a)+1),e.setAttribute("data-show",d),o(d)},300)},!1),e.addEventListener("click",function(r){for(var s=r.target;s&&s!=this;s=s.parentNode)if(s.matches("[data-go]")){let l=parseInt(s.getAttribute("data-go")),n=0,c=0,d=t.scrollWidth,f=t.scrollHeight;d>f?c=Math.floor(d*((l-1)/a)):n=Math.floor(f*((l-1)/a)),t.scroll({top:n,left:c,behavior:"smooth"});break}},!1)}function I(e,i){var t;let a=e.querySelector(".carousel__inner"),o=e.querySelector(".carousel__controls"),r=i.querySelectorAll(":scope > .col").length;a.addEventListener("scroll",function(s){clearTimeout(t),t=setTimeout(function(){let l=a.clientWidth,n=a.scrollWidth,c=a.scrollLeft,d=Math.round(c/n*r)+1,f=i.querySelector(":scope > .col").scrollWidth,u=i.querySelector(":scope > .col:last-child").offsetLeft,m=a.scrollLeft+l+a.getBoundingClientRect().left>=u+60,h=Math.round(l/f);Math.ceil(r/h)*h-r>0&&m&&(d=Math.floor(r/h)*h+1),Array.from(e.querySelectorAll(".carousel__controls button")).forEach((v,W)=>{v.removeAttribute("aria-current")}),e.querySelector(".control-"+d).setAttribute("aria-current",!0),d==1?e.querySelector(".btn-prev").setAttribute("disabled","disabled"):e.querySelector(".btn-prev").removeAttribute("disabled"),d>r-h?e.querySelector(".btn-next").setAttribute("disabled","disabled"):e.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),o.addEventListener("click",function(s){for(var l=s.target;l&&l!=this;l=l.parentNode)if(typeof l.matches=="function"&&l.matches("button")){s.preventDefault(),Array.from(o.querySelectorAll("button")).forEach((c,d)=>{c.removeAttribute("aria-current")}),l.setAttribute("aria-current",!0);const n=i.querySelector(`:scope > *:nth-child(${l.getAttribute("data-slide")})`);a.scroll({top:0,left:n.offsetLeft-a.getBoundingClientRect().left,behavior:"smooth"});break}},!1),e.addEventListener("click",function(s){let l=a.clientWidth;a.scrollWidth;let n=i.querySelector(":scope > .col").scrollWidth,c=Math.round(l/n),d=i.querySelector(":scope > .col:last-child").offsetLeft,f=a.scrollLeft+l+a.getBoundingClientRect().left>=d+60,u=Math.ceil(r/c)*c-r,m=c-u,h=f&&u>0?m*n:a.clientWidth;for(var b=s.target;b&&b!=this;b=b.parentNode)if(typeof b.matches=="function"&&b.matches(".btn-next, .btn-prev")){s.preventDefault();let v=b.classList.contains("btn-prev")?a.scrollLeft-h:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:v,behavior:"smooth"});break}},!1)}function B(e){e.addEventListener("change",function(i){var t=parseInt(e.querySelector("[data-min] select,[data-min] input").value),a=parseInt(e.querySelector("[data-max] select,[data-max] input").value);Array.from(e.querySelectorAll("[data-min] input")).forEach((o,r)=>{o.setAttribute("max",a)}),Array.from(e.querySelectorAll("[data-max] input")).forEach((o,r)=>{o.setAttribute("min",t)}),Array.from(e.querySelectorAll("[data-min] select option")).forEach((o,r)=>{parseInt(o.getAttribute("value"))>a?o.classList.add("d-none"):o.classList.remove("d-none")}),Array.from(e.querySelectorAll("[data-max] select option")).forEach((o,r)=>{parseInt(o.getAttribute("value"))<t?o.classList.add("d-none"):o.classList.remove("d-none")})},!1)}function N(e){e.addEventListener("change",function(i){if(e.matches("[data-value-if]")){const t=e.getAttribute("data-redirect"),a=e.getAttribute("data-value-if");e.value==a&&(document.location.href=t)}else typeof e.value<"u"&&(document.location.href=e.value)},!1)}function R(e){const t=e.querySelector(".row").cloneNode(!0),a=e.querySelector("[data-add]");e.addEventListener("click",function(o){for(var r=o.target;r&&r!=this;r=r.parentNode){if(r.matches("[data-add]")){const s=t.cloneNode(!0);e.insertBefore(s,r),a.matches("[data-maxfiles]")&&Array.from(e.querySelectorAll(":scope > .row")).length>=a.dataset.maxfiles&&a.setAttribute("disabled","disabled");break}if(r.matches("[data-delete]")){r.closest(".row").remove(),a.matches("[data-maxfiles]")&&Array.from(e.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}},!1)}function P(e){Array.from(e.querySelectorAll("[data-input-range]")).forEach((i,t)=>{B(i)}),Array.from(e.querySelectorAll("[data-redirect]")).forEach((i,t)=>{N(i)}),Array.from(e.querySelectorAll(".multiple-file-uploads")).forEach((i,t)=>{R(i)}),e.addEventListener("change",function(i){for(var t=i.target;t&&t!=this;t=t.parentNode)if(t.matches('[type="file"][data-filesize]')&&t.files&&t.files[0]){const a=t.dataset.filesize;t.files[0].size>a&&(t.value="",alert("File too large"));break}},!1),e.addEventListener("change",function(i){Array.from(e.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((t,a)=>{let o=t.closest("[data-group]")?t.closest("[data-group]"):e,r=t.dataset.activeif,s=t.dataset.equals;o.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?t.removeAttribute("disabled"):(t.setAttribute("disabled","disabled"),t.value="")}),Array.from(e.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((t,a)=>{let o=t.closest("[data-group]")?t.closest("[data-group]"):e,r=t.dataset.activeif,s=t.dataset.equals;o.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?t.classList.remove("d-none"):t.classList.add("d-none")})},!1)}function O(e){if(e.hasAttribute("data-type")&&e.getAttribute("data-type")=="toast"){let t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),e.closest(".notification__holder")||t.appendChild(e)}if(e.setAttribute("role","alert"),e.addEventListener("click",function(t){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(t.preventDefault(),w(e))},!1),e.hasAttribute("data-timeout")){let t=e.getAttribute("data-timeout");var i=new V(function(){w(e)},t);e.addEventListener("mouseenter",a=>{i.pause()}),e.addEventListener("mouseleave",a=>{i.resume()})}}function V(e,i){var t,a,o=i;this.pause=function(){window.clearTimeout(t),o-=new Date-a},this.resume=function(){a=new Date,window.clearTimeout(t),t=window.setTimeout(e,o)},this.resume()}const w=function(e){e.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class F extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,a=`@import "${i}/css/components/notification.css";`,o=`@import "${i}/css/components/notification.global.css";`,r=this.querySelectorAll("a,button");Array.from(r).forEach((l,n)=>{l.setAttribute("slot","btns"),l.classList.add("link")}),(r.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const s=document.createElement("template");s.innerHTML=`
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { numberOfDays } from './helpers.js';
|
|
2
1
|
// #region Functions that setup and trigger other functions
|
|
3
2
|
export const addClasses = (chartElement, chartOuter) => {
|
|
4
3
|
// add colour classes
|
|
@@ -28,13 +27,13 @@ export const setupChart = (chartElement, chartOuter, tableElement) => {
|
|
|
28
27
|
// Remove old input fields
|
|
29
28
|
Array.from(chartOuter.querySelectorAll(':scope > input[type="checkbox"],:scope > input[type="radio"]')).map((element) => { element.remove(); });
|
|
30
29
|
// #endregion
|
|
31
|
-
let { xaxis } = getChartData(chartElement
|
|
32
|
-
setCellData(chartElement,
|
|
30
|
+
let { xaxis } = getChartData(chartElement);
|
|
31
|
+
setCellData(chartElement, tableElement);
|
|
33
32
|
createChartKey(chartOuter, tableElement, chartKey);
|
|
34
|
-
createChartGuidelines(chartElement,
|
|
35
|
-
createChartYaxis(chartElement,
|
|
33
|
+
createChartGuidelines(chartElement, chartGuidelines);
|
|
34
|
+
createChartYaxis(chartElement, chartYaxis);
|
|
36
35
|
if (xaxis) {
|
|
37
|
-
createXaxis(
|
|
36
|
+
createXaxis(chartOuter);
|
|
38
37
|
}
|
|
39
38
|
return true;
|
|
40
39
|
};
|
|
@@ -78,7 +77,7 @@ export const setEventListener = function (chartElement, chartOuter) {
|
|
|
78
77
|
label.setAttribute('part', 'key-unchecked');
|
|
79
78
|
});
|
|
80
79
|
shadowTable.innerHTML = table.innerHTML;
|
|
81
|
-
setCellData(chartElement,
|
|
80
|
+
setCellData(chartElement, shadowTable);
|
|
82
81
|
});
|
|
83
82
|
};
|
|
84
83
|
export const setEventObservers = function (chartElement, chartOuter) {
|
|
@@ -88,7 +87,7 @@ export const setEventObservers = function (chartElement, chartOuter) {
|
|
|
88
87
|
observer.disconnect();
|
|
89
88
|
observer2.disconnect();
|
|
90
89
|
for (const mutation of mutationList) {
|
|
91
|
-
if (mutation.attributeName == 'class' || (mutation.type === 'attributes'
|
|
90
|
+
if (mutation.attributeName == 'class' || (mutation.type === 'attributes') || mutation.type === 'attributes') {
|
|
92
91
|
shadowTable.innerHTML = table.innerHTML;
|
|
93
92
|
setupChart(chartElement, chartOuter, shadowTable);
|
|
94
93
|
}
|
|
@@ -116,22 +115,22 @@ export const setEventObservers = function (chartElement, chartOuter) {
|
|
|
116
115
|
};
|
|
117
116
|
// #endregion
|
|
118
117
|
// #region GET functions
|
|
119
|
-
export const getChartData = function (chartElement
|
|
120
|
-
let table =
|
|
118
|
+
export const getChartData = function (chartElement) {
|
|
119
|
+
let table = chartElement.shadowRoot.querySelector('.chart__wrapper table');
|
|
121
120
|
let min = chartElement.hasAttribute('data-min') ? chartElement.getAttribute('data-min') : 0;
|
|
122
121
|
let max = chartElement.hasAttribute('data-max') ? chartElement.getAttribute('data-max') : getLargestValue(chartElement, table);
|
|
123
|
-
let type = chartElement.hasAttribute('data-type') ? chartElement.getAttribute('data-type') : 'column';
|
|
122
|
+
//let type:string = chartElement.hasAttribute('data-type') ? chartElement.getAttribute('data-type') : 'column';
|
|
124
123
|
let yaxis = chartElement.hasAttribute('data-yaxis') ? chartElement.getAttribute('data-yaxis').split(',') : [];
|
|
125
124
|
let guidelines = chartElement.hasAttribute('data-guidelines') ? chartElement.getAttribute('data-guidelines').split(',') : [];
|
|
126
|
-
let targets = chartElement.hasAttribute('data-targets') ? JSON.parse(chartElement.getAttribute('data-targets')) : null;
|
|
127
|
-
let events = chartElement.hasAttribute('data-events') ? JSON.parse(chartElement.getAttribute('data-events')) : null;
|
|
125
|
+
//let targets:any = chartElement.hasAttribute('data-targets') ? JSON.parse(chartElement.getAttribute('data-targets')) : null;
|
|
126
|
+
//let events:any = chartElement.hasAttribute('data-events') ? JSON.parse(chartElement.getAttribute('data-events')) : null;
|
|
128
127
|
let xaxis = chartElement.hasAttribute('data-xaxis') ? chartElement.getAttribute('data-xaxis').split(',') : null;
|
|
129
|
-
let increment = chartElement.hasAttribute('data-increment') ? chartElement.getAttribute('data-increment')
|
|
130
|
-
let start = chartElement.hasAttribute('data-start') ? chartElement.getAttribute('data-start') : 0;
|
|
131
|
-
let end = chartElement.hasAttribute('data-end') ? chartElement.getAttribute('data-end') : getLargestValue(chartElement,
|
|
132
|
-
let slope = chartElement.hasAttribute('data-slope') ? chartElement.getAttribute('data-slope') : null;
|
|
133
|
-
let yInt = chartElement.hasAttribute('data-yint') ? chartElement.getAttribute('data-yint') : null;
|
|
134
|
-
return { min, max,
|
|
128
|
+
//let increment = chartElement.hasAttribute('data-increment') ? chartElement.getAttribute('data-increment'): null;
|
|
129
|
+
//let start:any = chartElement.hasAttribute('data-start') ? chartElement.getAttribute('data-start') : 0;
|
|
130
|
+
//let end:any = chartElement.hasAttribute('data-end') ? chartElement.getAttribute('data-end') : getLargestValue(chartElement,table); // TODO - get largest value from the data-xaxis
|
|
131
|
+
//let slope:any = chartElement.hasAttribute('data-slope') ? chartElement.getAttribute('data-slope') : null;
|
|
132
|
+
//let yInt:any = chartElement.hasAttribute('data-yint') ? chartElement.getAttribute('data-yint') : null;
|
|
133
|
+
return { min, max, yaxis, xaxis, guidelines };
|
|
135
134
|
};
|
|
136
135
|
function getLargestValue(chartElement, table) {
|
|
137
136
|
const selector = chartElement.classList.contains('chart--stacked') ? 'tbody tr' : 'tbody td:not(:first-child)';
|
|
@@ -172,7 +171,7 @@ const getValues = function (value, min, max, start) {
|
|
|
172
171
|
};
|
|
173
172
|
// #endregion
|
|
174
173
|
// #region SET functions - set data attributes and classes
|
|
175
|
-
export const setCellData = function (chartElement,
|
|
174
|
+
export const setCellData = function (chartElement, table) {
|
|
176
175
|
Array.from(table.querySelectorAll('tbody tr')).forEach((tr) => {
|
|
177
176
|
let rowValue = 0;
|
|
178
177
|
// Set the data numeric value if not set
|
|
@@ -186,7 +185,7 @@ export const setCellData = function (chartElement, chartOuter, table) {
|
|
|
186
185
|
});
|
|
187
186
|
tr.setAttribute('data-numeric', rowValue);
|
|
188
187
|
});
|
|
189
|
-
let { min, max } = getChartData(chartElement
|
|
188
|
+
let { min, max } = getChartData(chartElement);
|
|
190
189
|
Array.from(table.querySelectorAll('tbody tr')).forEach((tr, index) => {
|
|
191
190
|
let group = tr.querySelector('td:first-child, th:first-child') ? tr.querySelector('td:first-child, th:first-child').textContent : '';
|
|
192
191
|
tr.setAttribute('part', 'group');
|
|
@@ -201,19 +200,6 @@ export const setCellData = function (chartElement, chartOuter, table) {
|
|
|
201
200
|
if (tr.querySelectorAll('td').length > 2)
|
|
202
201
|
td.setAttribute('data-label', table.querySelectorAll('thead th')[index].textContent);
|
|
203
202
|
});
|
|
204
|
-
/*
|
|
205
|
-
if(tr.querySelector('[data-label="Total"]')){
|
|
206
|
-
tr.setAttribute('data-total',tr.querySelector('[data-label="Total"][data-numeric]').getAttribute('data-numeric'));
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if(tr.querySelector('[data-label="Min"]')){
|
|
210
|
-
tr.setAttribute('data-min',tr.querySelector('[data-label="Min"][data-numeric]').getAttribute('data-numeric'));
|
|
211
|
-
}
|
|
212
|
-
if(tr.querySelector('[data-label="Max"]')){
|
|
213
|
-
tr.setAttribute('data-max',tr.querySelector('[data-label="Max"][data-numeric]').getAttribute('data-numeric'));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
*/
|
|
217
203
|
let rowMin = tr.hasAttribute('data-min') ? tr.getAttribute('data-min') : min;
|
|
218
204
|
let rowMax = tr.hasAttribute('data-max') ? tr.getAttribute('data-max') : max;
|
|
219
205
|
if (rowMin < 0) {
|
|
@@ -303,14 +289,10 @@ function createChartKeyItem(chartID, index, text, chartKey, chartOuter, previous
|
|
|
303
289
|
chartKey.append(label);
|
|
304
290
|
return previousInput;
|
|
305
291
|
}
|
|
306
|
-
export const createChartGuidelines = function (chartElement,
|
|
307
|
-
let { min, max, yaxis,
|
|
292
|
+
export const createChartGuidelines = function (chartElement, chartGuidelines) {
|
|
293
|
+
let { min, max, yaxis, guidelines } = getChartData(chartElement);
|
|
308
294
|
if (!guidelines.length)
|
|
309
295
|
guidelines = yaxis;
|
|
310
|
-
if (increment == "days") {
|
|
311
|
-
max = numberOfDays(min, max);
|
|
312
|
-
min = 0;
|
|
313
|
-
}
|
|
314
296
|
chartGuidelines.innerHTML = '';
|
|
315
297
|
for (var i = 0; i < guidelines.length; i++) {
|
|
316
298
|
let value = parseFloat(guidelines[i].replace('£', '').replace('%', '').replace(',', ''));
|
|
@@ -318,39 +300,22 @@ export const createChartGuidelines = function (chartElement, chartOuter, chartGu
|
|
|
318
300
|
chartGuidelines.innerHTML += `<div class="guideline" style="--percent:${axis}%;">${yaxis.indexOf(guidelines[i]) != -1 ? `<span>${guidelines[i]}</span>` : ''}</div>`;
|
|
319
301
|
}
|
|
320
302
|
};
|
|
321
|
-
export const createChartYaxis = function (chartElement,
|
|
322
|
-
let { min, max, yaxis
|
|
323
|
-
let startDay = min;
|
|
324
|
-
if (increment == "days") {
|
|
325
|
-
max = numberOfDays(min, max);
|
|
326
|
-
min = 0;
|
|
327
|
-
}
|
|
303
|
+
export const createChartYaxis = function (chartElement, chartYaxis) {
|
|
304
|
+
let { min, max, yaxis } = getChartData(chartElement);
|
|
328
305
|
chartYaxis.innerHTML = '';
|
|
329
306
|
for (var i = 0; i < yaxis.length; i++) {
|
|
330
307
|
let value = parseFloat(yaxis[i].replace('£', '').replace('%', ''));
|
|
331
|
-
if (increment == "days") {
|
|
332
|
-
value = numberOfDays(startDay, yaxis[i]);
|
|
333
|
-
}
|
|
334
308
|
let { axis } = getValues(value, min, max);
|
|
335
309
|
chartYaxis.innerHTML += `<div class="axis__point" style="--percent:${axis}%;"><span>${yaxis[i]}</span></div>`;
|
|
336
310
|
}
|
|
337
311
|
};
|
|
338
|
-
export const createXaxis = function (
|
|
312
|
+
export const createXaxis = function (chartOuter) {
|
|
339
313
|
const chart = chartOuter.querySelector('.chart');
|
|
340
314
|
let chartXaxis = chartOuter.querySelector('.chart__xaxis');
|
|
341
|
-
let { increment, start, end } = getChartData(chartElement, chartOuter);
|
|
342
315
|
if (!chartXaxis) {
|
|
343
316
|
chartXaxis = document.createElement('div');
|
|
344
317
|
chartXaxis.setAttribute('class', 'chart__xaxis');
|
|
345
318
|
}
|
|
346
|
-
if (increment && start && end) {
|
|
347
|
-
chartXaxis.innerHTML = '';
|
|
348
|
-
for (var i = 0; i < xaxis.length; i++) {
|
|
349
|
-
let value = parseFloat(xaxis[i].replace('£', '').replace('%', ''));
|
|
350
|
-
let position = ((value - start) / (end - start)) * 100;
|
|
351
|
-
chartXaxis.innerHTML += `<div class="axis__point" style="--percent:${position}%;"><span>${xaxis[i]}</span></div>`;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
319
|
chart.prepend(chartXaxis);
|
|
355
320
|
};
|
|
356
321
|
export const createTooltips = function (chartOuter) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey
|
|
2
|
+
* iamKey v6.0.0
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/(function(I){typeof define=="function"&&define.amd?define(I):I()})(function(){"use strict";var I=r=>(r.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&r.classList.add("ie"),null),ct=r=>{var t=function(a){var i=document.querySelector('label[for="'.concat(a.replace("#",""),'"]')),n=document.querySelector(a+" summary"),o=document.querySelector("dialog".concat(a)),c=document.querySelector("detail".concat(a));i instanceof HTMLElement?i.click():n instanceof HTMLElement?n.click():o instanceof HTMLElement?o.showModal():c instanceof HTMLElement&&c.addAttribute("open")};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state&&e.state.type&&e.state.type=="pagination"){var a=document.querySelector("#".concat(e.state.form)),i=document.querySelector("#".concat(e.state.form," [data-pagination]"));i?i.value=e.state.page:a.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(e.state.page,'" />'),a.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",e=>{if(e&&e.target instanceof HTMLElement&&e.target.matches("form")){var a=e.target;Array.from(a.querySelectorAll("[data-password-type]")).forEach((i,n)=>{i.setAttribute("type","password")}),(a.querySelector(":invalid")||a.querySelector('.pwd-checker[data-strength="1"]')||a.querySelector('.pwd-checker[data-strength="2"]'))&&(a.classList.add("was-validated"),e.preventDefault()),a.querySelector("iam-multiselect[data-is-required][data-error]")&&(a.classList.add("was-validated"),e.preventDefault())}}),document.addEventListener("keydown",e=>{e.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(e.preventDefault(),e.stopPropagation())}),Array.from(document.querySelectorAll("label progress")).forEach((e,a)=>{var i=e.closest("label");i.setAttribute("data-percent",e.getAttribute("value"))}),null},dt=function(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))},lt=(r,t)=>String(r).padStart(t,"0"),ut=r=>r.charAt(0).toUpperCase()+r.slice(1),C=(r,t,e)=>t.split(/[\.\[\]\'\"]/).filter(a=>a).reduce((a,i)=>a?a[i]:e,r),ht=(r,t,e,a)=>{var i=Math.tan(.375*Math.PI),n=window.innerWidth||document.body.clientWidth,o=Math.max(1,Math.floor(.01*n)),c=e-r,l=a-t,s=Math.abs(c/l),d=Math.abs(l/c);if(Math.abs(c)>o||Math.abs(l)>o){if(d<=i)return c<0?"left":"right";if(s<=i)return l<0?"top":"bottom"}else return"tap"};class ft{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",function(e){for(var a=e.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){e.preventDefault(),U(a);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((e,a)=>{var i=new Image;i.onload=function(){var n=document.createElement("script");n.src="https://www.youtube.com/iframe_api";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o),document.body.classList.add("youtubeLoaded"),e(!0),n.onload=()=>{t.addEventListener("click",function(c){console.log("click"),c&&c.target instanceof HTMLElement&&c.target.closest("a")&&(c.preventDefault(),U(c.target.closest("a")))},!1)}},i.onerror=function(){a(!1)},i.src="https://youtube.com/favicon.ico"})}}var U=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var e=t.getAttribute("data-id"),a=t.getAttribute("id");if(typeof a>"u"||a==null){var i=String.fromCharCode(65+Math.floor(Math.random()*26));a=i+Date.now(),t.setAttribute("id",a)}function n(){window.player=new YT.Player(a,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:o,onStateChange:l}})}n();function o(s){s.target.playVideo()}var c=!1;function l(s){if(s.data==YT.PlayerState.PLAYING&&!c){var d=document.getElementById(a);d.classList.add("player-ready"),c=!0}}},bt=r=>(Array.from(r.querySelectorAll("dialog[open]")).forEach((t,e)=>{var a=t.closest(".dialog__wrapper");a||(t.removeAttribute("open"),t.showModal(),t.focus(),X(t))}),r.addEventListener("click",t=>{if(t.target.tagName=="IAM-ACTIONBAR")return!1;if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var e=t.target.closest("[data-modal]"),a=e.hasAttribute("data-modal")?e.getAttribute("data-modal"):e.getAttribute("data-filter"),i=document.querySelector("dialog#".concat(a));X(i),i.showModal(),i.focus();var n=i.offsetWidth;i.setAttribute("style","max-width: ".concat(n,"px;")),Array.from(i.querySelectorAll("[data-duplicate]")).forEach((L,S)=>{var T=L.getAttribute("data-duplicate"),q=document.getElementById(T);if(L.checked!=q.checked){L.checked=q.checked;var M=new Event("change");L.dispatchEvent(M)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:a})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var o=t.target.closest("dialog[open]");t.preventDefault(),o.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((L,S)=>{L.classList.remove("active")});var c=new CustomEvent("dialog-closed",{bubbles:!0,cancelable:!0,detail:{modalId:o.id}});t.target.dispatchEvent(c),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest('button[formmethod="dialog"]')){var l=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((L,S)=>{L.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:l.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var s=t.target.closest("dialog[open]"),d=window.getComputedStyle(s);if(d.display==="contents"&&(s=s.parentNode.closest("dialog[open]")),!s.classList.contains("dialog--transactional")&&!s.classList.contains("dialog--acknowledgement")){var h=s.getBoundingClientRect();(t.clientX<h.left||t.clientX>h.right||t.clientY<h.top||t.clientY>h.bottom)&&(t.target.closest("dialog *")||s.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:s.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){t.stopPropagation();var b=t.target.closest(".dialog__wrapper > button"),v=b.parentNode,u="openPopover",f=v.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=f&&b.closest("dialog[open]")!=document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((L,S)=>{L.removeAttribute("aria-expanded")}),f.hasAttribute("open"))f.close(),u="closePopover",f.removeAttribute("style"),b.removeAttribute("aria-expanded");else{f.show(),b.setAttribute("aria-expanded",!0);var m=b.getBoundingClientRect(),p=m.top,g=m.left;if(b.closest("iam-table")){var y=b.closest("iam-table").parentNode.getBoundingClientRect();p-=y.top,g-=y.left}f.classList.contains("dialog--fix")&&f.setAttribute("style","position:fixed;top: ".concat(p,"px; left: ").concat(g,"px; margin: 3rem 0 0 0;"))}var A=f.getBoundingClientRect(),E=A.bottom-window.scrollY,x=window.innerHeight-window.scrollY;if(E>x){var k=f.hasAttribute("style")?f.getAttribute("style")+" ":"";f.setAttribute("style",k+"transform: translate(0, calc(-100% - 4rem))"),A=f.getBoundingClientRect();var w=A.top-window.scrollY;w<100&&f.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:u,id:b.textContent})}t&&t.target instanceof HTMLElement&&!t.target.closest("dialog[open]")&&!t.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((L,S)=>{L.removeAttribute("aria-expanded")}))}),null),X=r=>{var t=r.querySelector(".youtube-embed a");if(t&&U(t),r.classList.contains("dialog--multi")&&!r.querySelector(":scope > .steps")&&vt(r),!r.querySelector(":scope .mh-lg")&&!r.classList.contains("dialog--multi")){r.innerHTML='<div class="mh-lg">'.concat(r.innerHTML,"</div>");var e=r.querySelector(".mh-lg"),a=r.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){var i=a.previousSibling;e.before(a),i&&a.before(i)}}r.querySelector(":scope > button:first-child")||r.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},vt=r=>{var t="",e=Array.from(r.querySelectorAll("fieldset[data-title]")),a=r.querySelector("form");e.forEach((s,d)=>{t+='<button data-title="'.concat(s.getAttribute("data-title"),'" type="button" class="').concat(d==0?"active":"",'" tabindex="-1">').concat(s.getAttribute("data-title"),"</button>");var h=document.createElement("div");if(h.classList.add("btn--wrapper"),s.appendChild(h),d!=0&&(h.innerHTML+='<button data-title="'.concat(e[d-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>')),d!=e.length-1&&(h.innerHTML+='<button data-title="'.concat(e[d+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="button">Next</button>')),d==e.length-1)if(a&&a.querySelector(':scope > button[type="submit"]')){var b=a.querySelector(':scope > button[type="submit"]');b.classList.add("mb-0"),h.insertAdjacentElement("beforeend",b)}else h.innerHTML+='<button data-title="'.concat(e[d].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="submit">Submit</button>')}),r.insertAdjacentHTML("afterbegin",'<div class="steps bg-primary">'.concat(t,"</div>"));for(var i=Array.from(r.querySelectorAll("fieldset.was-validated")),n=0;n<i.length;n++){var o=i[n],c=o.getAttribute("data-title");if(o.querySelector(".is-invalid")){Array.from(r.querySelectorAll('[data-title="'.concat(c,'"]'))).forEach((s,d)=>{s.classList.add("active")});break}else Array.from(r.querySelectorAll('[data-title="'.concat(c,'"]'))).forEach((s,d)=>{s.classList.add("valid")})}r.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function l(s){var d=r.querySelector("fieldset.active")?r.querySelector("fieldset.active"):r.querySelector("fieldset[data-title]"),h=d.getAttribute("data-title"),b=!0;if(d.classList.add("was-validated"),Array.from(d.querySelectorAll("input")).forEach((p,g)=>{p.checkValidity()||(b=!1)}),b?Array.from(r.querySelectorAll('[data-title="'.concat(h,'"]'))).forEach((p,g)=>{p.classList.add("valid")}):Array.from(r.querySelectorAll('[data-title="'.concat(h,'"]'))).forEach((p,g)=>{p.classList.remove("valid")}),b||!s.hasAttribute("data-next")){var v=r.querySelector('fieldset[data-title="'.concat(s.getAttribute("data-title"),'"]')),u=r.querySelector('.steps button[data-title="'.concat(s.getAttribute("data-title"),'"]'));Array.from(r.querySelectorAll("button")).forEach((p,g)=>{p.classList.remove("active")}),Array.from(r.querySelectorAll("fieldset")).forEach((p,g)=>{p.classList.remove("active")}),u.classList.add("active"),v.classList.add("active")}var f=Array.from(r.querySelectorAll("fieldset")).length,m=Array.from(r.querySelectorAll("fieldset.valid")).length;r.style.setProperty("--progress","".concat(m/(f-1)*100,"%"))}r.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){var d=s.target.closest("button");s.keyCode==13&&d.getAttribute("type")!="submit"&&(s.preventDefault(),l(d))}if(s&&s.target instanceof HTMLElement&&s.target.closest("input")){var h=s.target.closest("input");h.classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault()}}),r.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]')){var d=s.target.closest("form");d.classList.add("was-validated")}else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){var h=s.target.closest("button[data-title]");l(h)}return null})};function mt(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",r=>{var t=r.target.closest("[open] summary");if(t)window.dataLayer.push({event:"closeDetails",detailsTitle:t.textContent||""});else{var e=r.target.closest("summary"),a=r.target.closest("a"),i=r.target.closest("button");e&&window.dataLayer.push({event:"openDetails",detailsTitle:e.textContent||""}),a&&window.dataLayer.push({event:"linkClicked",linkText:a.hasAttribute("title")?a.getAttribute("title")||"":a.textContent||"",class:a.hasAttribute("class")&&a.getAttribute("class")||"",href:a.getAttribute("href")||""}),i&&window.dataLayer.push({event:"buttonClicked",buttonText:i.textContent||"",class:i.hasAttribute("class")&&i.getAttribute("class")||""})}})}function pt(r){var t=new TextEncoder("utf-8").encode(r);return crypto.subtle.digest("SHA-1",t).then(function(e){for(var a=[],i=new DataView(e),n=0;n<i.byteLength;n+=4){var o=i.getUint32(n),c=o.toString(16),l="00000000",s=(l+c).slice(-l.length);a.push(s)}return a.join("")})}var gt=(r,t)=>{pt(r).then(function(e){var a=new XMLHttpRequest;a.addEventListener("load",function(){var i=this.responseText.split(`
|
|
5
5
|
`),n=e.slice(5).toUpperCase(),o=!1;for(var c in i)if(i[c].substring(0,35)==n){o=!0;break}var l=new CustomEvent("hibpCheck",{detail:o});t.dispatchEvent(l)}),a.open("GET","https://api.pwnedpasswords.com/range/"+e.substr(0,5)),a.send()})},yt=r=>{function t(){if(Array.from(document.querySelectorAll("input[maxlength],textarea[maxlength]")).forEach((a,i)=>{a.parentElement,At(a)}),Array.from(document.querySelectorAll("label input")).forEach((a,i)=>{!a.closest("label").querySelector(".optional-text")&&!a.hasAttribute("required")&&(a.parentNode.tagName.toLowerCase()=="span"?a.parentElement.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'):a.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'))}),document.querySelector('input[type="date"]')){let a=function(i){var n=i.getFullYear(),o=String(i.getMonth()+1).padStart(2,"0"),c=String(i.getDate()).padStart(2,"0");return"".concat(n,"-").concat(o,"-").concat(c)};var e=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((i,n)=>{var o=e;if(i.hasAttribute("data-start")&&(o.setDate(o.getDate()+parseInt(i.getAttribute("data-start"))),i.setAttribute("min",a(o))),i.hasAttribute("data-period")){var c=parseInt(i.getAttribute("data-period")),l=new Date;l.setDate(o.getDate()+c),i.setAttribute("max",a(l))}if(i.hasAttribute("data-allowed-days")){var s=JSON.parse("[".concat(i.getAttribute("data-allowed-days"),"]"));i.addEventListener("input",function(d){var h=new Date(this.value).getUTCDay();s.includes(h)?i.setCustomValidity(""):i.setCustomValidity("That day of the week is not allowed")})}})}}document.readyState==="complete"&&t(),document.onreadystatechange=()=>{document.readyState==="complete"&&t()},r.addEventListener("input",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("input,textarea,select")){var a=e.target.closest("input,textarea,select");a.parentElement,a.hasAttribute("type")&&a.getAttribute("type")=="color"&&(a.nextElementSibling.value=a.value),a.hasAttribute("maxlength")&&a.nextElementSibling&&a.nextElementSibling.setAttribute("data-count",a.value.length),a.hasAttribute("data-strength-checker")&&wt(a)}}),r.addEventListener("change",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("select")){var a=e.target.closest("select");if(a.hasAttribute("data-change-type")&&a.hasAttribute("data-input")){var i=document.getElementById(a.getAttribute("data-input")),n=a.value;J(i,n)}}if(e&&e.target instanceof HTMLElement&&e.target.closest('dialog [type="radio"]')){var o=e.target.closest("dialog");e.target.closest('dialog [type="radio"]'),Array.from(o.querySelectorAll('[type="radio"][autofocus]')).forEach((c,l)=>{c.removeAttribute("autofocus")}),Array.from(o.querySelectorAll('[type="radio"]:checked')).forEach((c,l)=>{c.setAttribute("autofocus",!0)})}}),r.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-change-type][data-input]:not(select)")){var a=e.target.closest("[data-change-type]"),i=document.getElementById(a.getAttribute("data-input")),n=a.getAttribute("data-change-type");if(a.setAttribute("data-change-type",i.getAttribute("type")),J(i,n),a.hasAttribute("data-alt-class")){var o=a.getAttribute("data-alt-class");a.setAttribute("data-alt-class",a.getAttribute("class")),a.setAttribute("class",o)}}})},At=r=>{var t=r.parentElement,e=r.getAttribute("maxlength");t.style.setProperty("--maxlength",e);var a=r.nextElementSibling;(!a||a&&a.classList.contains("invalid-feedback"))&&(a=document.createElement("span"),t.insertBefore(a,r.nextSibling)),a.setAttribute("data-count",r.value.length)},J=(r,t)=>{r.hasAttribute("type")&&r.getAttribute("type")=="password"&&r.setAttribute("data-password-type",!0),r.setAttribute("type",t)},wt=function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"no",a=document.getElementById(t.getAttribute("data-strength-checker")),i=t.value,n=t.hasAttribute("minlength")?t.getAttribute("minlength"):12,o=1,c=["Very weak","Weak","Average","Strong","Very strong"],l="";if(i.match(/(?=.*[0-9])/)&&(o+=1),i.match(/(?=.*[!,%,&,#,$,^,*,?,_,~,<,>,])/)&&(o+=1),i.match(/(?=.*[a-z])/)&&(o+=1),i.match(/(?=.*[A-Z])/)&&(o+=1),i.length<n&&(o=1,l="(must be at least ".concat(n," characters.)")),o>=3&&e=="no"){let s=function(d,h){d.detail?r(h,"danger"):r(h,"success"),h.removeEventListener("hibpCheck",s)};gt(i,t),t.addEventListener("hibpCheck",function(d){s(d,t)})}else o>=3&&e=="danger"&&(o=3,l="(this password is very common)");a&&(o<=3?a.classList.add("invalid-feedback"):a.classList.remove("invalid-feedback"),a.setAttribute("data-strength",o),a.innerHTML="Password strength: ".concat(c[o-1]," ").concat(l))},Lt=r=>{if(Array.from(r.querySelectorAll("details")).forEach((e,a)=>{e.addEventListener("mouseenter",function(i){window.matchMedia("(min-width: 62em)").matches&&e.setAttribute("open","true")},!1),e.addEventListener("mouseleave",function(i){window.matchMedia("(min-width: 62em)").matches&&e.removeAttribute("open")},!1)}),"IntersectionObserver"in window){var t=new IntersectionObserver(e=>{var[a]=e;return a.target.classList.toggle("is-stuck",a.intersectionRatio<1)},{threshold:[1]});t.observe(r)}};function St(r){var t,e=r.querySelector(".testimonial__images"),a=e.querySelectorAll("img").length;if(a==1)return!1;r.classList.add("testimonial--multi");var i=function(o){var c=r.querySelector(".btn-next"),l=r.querySelector(".btn-prev");c.setAttribute("data-go",o+1),l.setAttribute("data-go",o-1),c.removeAttribute("disabled"),l.removeAttribute("disabled"),o==1?l.setAttribute("disabled",!0):o==a&&c.setAttribute("disabled",!0)};e.addEventListener("scroll",function(n){clearTimeout(t),t=setTimeout(function(){var o=e.scrollWidth,c=e.scrollHeight,l=e.scrollLeft,s=e.scrollTop,d=Math.round(l/o*a)+1;l==0&&s!=0&&(d=Math.round(s/c*a)+1),r.setAttribute("data-show",d),i(d)},300)},!1),r.addEventListener("click",function(n){for(var o=n.target;o&&o!=this;o=o.parentNode)if(o.matches("[data-go]")){var c=parseInt(o.getAttribute("data-go")),l=0,s=0,d=e.scrollWidth,h=e.scrollHeight;d>h?s=Math.floor(d*((c-1)/a)):l=Math.floor(h*((c-1)/a)),e.scroll({top:l,left:s,behavior:"smooth"});break}},!1)}function qt(r,t){var e,a=r.querySelector(".carousel__inner"),i=r.querySelector(".carousel__controls"),n=t.querySelectorAll(":scope > .col").length;a.addEventListener("scroll",function(o){clearTimeout(e),e=setTimeout(function(){var c=a.clientWidth,l=a.scrollWidth,s=a.scrollLeft,d=Math.round(s/l*n)+1,h=t.querySelector(":scope > .col").scrollWidth,b=t.querySelector(":scope > .col:last-child").offsetLeft,v=a.scrollLeft+c+a.getBoundingClientRect().left>=b+60,u=Math.round(c/h),f=Math.ceil(n/u)*u-n;f>0&&v&&(d=Math.floor(n/u)*u+1),Array.from(r.querySelectorAll(".carousel__controls button")).forEach((m,p)=>{m.removeAttribute("aria-current")}),r.querySelector(".control-"+d).setAttribute("aria-current",!0),d==1?r.querySelector(".btn-prev").setAttribute("disabled","disabled"):r.querySelector(".btn-prev").removeAttribute("disabled"),d>n-u?r.querySelector(".btn-next").setAttribute("disabled","disabled"):r.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),i.addEventListener("click",function(o){for(var c=o.target;c&&c!=this;c=c.parentNode)if(typeof c.matches=="function"&&c.matches("button")){o.preventDefault(),Array.from(i.querySelectorAll("button")).forEach((s,d)=>{s.removeAttribute("aria-current")}),c.setAttribute("aria-current",!0);var l=t.querySelector(":scope > *:nth-child(".concat(c.getAttribute("data-slide"),")"));a.scroll({top:0,left:l.offsetLeft-a.getBoundingClientRect().left,behavior:"smooth"});break}},!1),r.addEventListener("click",function(o){var c=a.clientWidth;a.scrollWidth;for(var l=t.querySelector(":scope > .col").scrollWidth,s=Math.round(c/l),d=t.querySelector(":scope > .col:last-child").offsetLeft,h=a.scrollLeft+c+a.getBoundingClientRect().left>=d+60,b=Math.ceil(n/s)*s-n,v=s-b,u=h&&b>0?v*l:a.clientWidth,f=o.target;f&&f!=this;f=f.parentNode)if(typeof f.matches=="function"&&f.matches(".btn-next, .btn-prev")){o.preventDefault();var m=f.classList.contains("btn-prev")?a.scrollLeft-u:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:m,behavior:"smooth"});break}},!1)}function Et(r){r.addEventListener("change",function(t){var e=parseInt(r.querySelector("[data-min] select,[data-min] input").value),a=parseInt(r.querySelector("[data-max] select,[data-max] input").value);Array.from(r.querySelectorAll("[data-min] input")).forEach((i,n)=>{i.setAttribute("max",a)}),Array.from(r.querySelectorAll("[data-max] input")).forEach((i,n)=>{i.setAttribute("min",e)}),Array.from(r.querySelectorAll("[data-min] select option")).forEach((i,n)=>{parseInt(i.getAttribute("value"))>a?i.classList.add("d-none"):i.classList.remove("d-none")}),Array.from(r.querySelectorAll("[data-max] select option")).forEach((i,n)=>{parseInt(i.getAttribute("value"))<e?i.classList.add("d-none"):i.classList.remove("d-none")})},!1)}function xt(r){r.addEventListener("change",function(t){if(r.matches("[data-value-if]")){var e=r.getAttribute("data-redirect"),a=r.getAttribute("data-value-if");r.value==a&&(document.location.href=e)}else typeof r.value<"u"&&(document.location.href=r.value)},!1)}function kt(r){var t=r.querySelector(".row"),e=t.cloneNode(!0),a=r.querySelector("[data-add]");r.addEventListener("click",function(i){for(var n=i.target;n&&n!=this;n=n.parentNode){if(n.matches("[data-add]")){var o=e.cloneNode(!0);r.insertBefore(o,n),a.matches("[data-maxfiles]")&&Array.from(r.querySelectorAll(":scope > .row")).length>=a.dataset.maxfiles&&a.setAttribute("disabled","disabled");break}if(n.matches("[data-delete]")){var c=n.closest(".row");c.remove(),a.matches("[data-maxfiles]")&&Array.from(r.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}},!1)}function Tt(r){Array.from(r.querySelectorAll("[data-input-range]")).forEach((t,e)=>{Et(t)}),Array.from(r.querySelectorAll("[data-redirect]")).forEach((t,e)=>{xt(t)}),Array.from(r.querySelectorAll(".multiple-file-uploads")).forEach((t,e)=>{kt(t)}),r.addEventListener("change",function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){var a=e.dataset.filesize;e.files[0].size>a&&(e.value="",alert("File too large"));break}},!1),r.addEventListener("change",function(t){Array.from(r.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,a)=>{var i=e.closest("[data-group]")?e.closest("[data-group]"):r,n=e.dataset.activeif,o=e.dataset.equals,c=i.querySelector('select[data-id="'.concat(n,'"],input[data-id="').concat(n,'"]'));c.value==o?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(r.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,a)=>{var i=e.closest("[data-group]")?e.closest("[data-group]"):r,n=e.dataset.activeif,o=e.dataset.equals,c=i.querySelector('select[data-id="'.concat(n,'"],input[data-id="').concat(n,'"]'));c.value==o?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class Ct extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/header.css";'),i=document.createElement("template");i.innerHTML=`
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
<div class="card `).concat(t,`" tabindex="0" part="card">
|
|
86
86
|
`).concat(this.createCardConent(),`
|
|
87
87
|
</div>
|
|
88
|
-
`),this.shadowRoot.appendChild(o.content.cloneNode(!0)),document.getElementById("cardGlobal")||document.head.insertAdjacentHTML("beforeend",'<style id="cardGlobal">'.concat(n,"</style>"))}createCardConent(){return"".concat(this.hasAttribute("data-image")||this.hasAttribute("data-record")?'<div class="card__head">'.concat(this.hasAttribute("data-image")?'<img src="'.concat(this.getAttribute("data-image"),'" alt="" loading="lazy" />'):"",' <div class="card__badges"><slot name="badges"></slot></div></div>'):"",`
|
|
88
|
+
`),this.shadowRoot.appendChild(o.content.cloneNode(!0)),document.getElementById("cardGlobal")||document.head.insertAdjacentHTML("beforeend",'<style id="cardGlobal">'.concat(n,"</style>"))}createCardConent(){return"".concat(this.hasAttribute("data-image")||this.hasAttribute("data-record")?'<div class="card__head" part="head">'.concat(this.hasAttribute("data-image")?'<img src="'.concat(this.getAttribute("data-image"),'" alt="" loading="lazy" />'):"",' <div class="card__badges"><slot name="badges"></slot></div></div>'):"",`
|
|
89
89
|
<div class="card__body" part="body">
|
|
90
90
|
`).concat(!this.hasAttribute("data-image")&&this.querySelector('[slot="badges"]')&&this.querySelector('[slot="checkbox"]')?'<div class="card__badges card__badges--inline"><slot name="badges"></slot></div>':"",`
|
|
91
91
|
`).concat(!this.hasAttribute("data-image")&&!this.hasAttribute("data-record")&&this.querySelector('[slot="badges"]')?'<div class="card__badges"><slot name="badges"></slot></div>':"",`
|