@iamproperty/components 5.5.0 → 5.5.1-beta-1
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/header.css +1 -1
- package/assets/css/components/header.css.map +1 -1
- 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.js +7 -0
- package/assets/js/components/address-lookup/address-lookup.component.min.js +4 -4
- package/assets/js/components/address-lookup/address-lookup.component.min.js.map +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/card/card.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 +2 -2
- 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/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/scripts.bundle.js +1 -1
- package/assets/js/scripts.bundle.min.js +1 -1
- package/assets/sass/components/header.scss +8 -1
- package/assets/ts/components/address-lookup/address-lookup.component.ts +9 -0
- package/dist/components.es.js +187 -190
- package/dist/components.umd.js +33 -47
- package/package.json +1 -1
- package/src/components/Header/Header.vue +1 -1
- package/src/components/Table/Table.vue +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{padding-top:0 !important;margin-bottom:2rem;background-color:rgba(0,0,0,0) !important}.header-banner{padding-top:2.75rem;max-width:120rem;min-height:25rem;margin-inline:auto;display:block;position:relative;height:auto}@media screen and (min-width: 62em){.header-banner{padding-top:5.25rem}}.header-banner>picture{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none;overflow:hidden;min-height:25rem;max-height:25rem}.header-banner>picture:after{content:"";display:block;position:absolute;z-index:-1;inset:0;background:linear-gradient(300deg, rgb(30, 190, 230) 0%, rgb(0, 49, 60) 100%);opacity:.85}.header-banner>picture img{display:block;position:absolute;z-index:-2;inset:0;object-fit:cover;object-position:50% 50%;width:100%;height:100%}::slotted(.breadcrumb){margin-top:1.5rem !important;margin-bottom:-0.5rem !important}@media screen and (min-width: 62em){::slotted(.breadcrumb){position:absolute !important;top:0 !important;left:5.25rem !important}}::slotted(*:last-child){padding-bottom:0 !important;margin-bottom:0 !important}/*# sourceMappingURL=header.css.map */
|
|
1
|
+
:host{padding-top:0 !important;margin-bottom:2rem;background-color:rgba(0,0,0,0) !important}.header-banner{padding-top:2.75rem;max-width:120rem;min-height:25rem;margin-inline:auto;display:block;position:relative;height:auto}@media screen and (min-width: 62em){.header-banner{padding-top:5.25rem}}.header-banner>picture{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none;overflow:hidden;min-height:25rem;max-height:25rem}.header-banner>picture:after{content:"";display:block;position:absolute;z-index:-1;inset:0;background:linear-gradient(300deg, rgb(30, 190, 230) 0%, rgb(0, 49, 60) 100%);opacity:.85}.header-banner>picture img{display:block;position:absolute;z-index:-2;inset:0;object-fit:cover;object-position:50% 50%;width:100%;height:100%}:host(.header--contain) .header-banner{padding-bottom:2rem}:host(.header--contain) .header-banner>picture{max-height:100%}::slotted(.breadcrumb){margin-top:1.5rem !important;margin-bottom:-0.5rem !important}@media screen and (min-width: 62em){::slotted(.breadcrumb){position:absolute !important;top:0 !important;left:5.25rem !important}}::slotted(*:last-child){padding-bottom:0 !important;margin-bottom:0 !important}/*# sourceMappingURL=header.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../sass/components/header.scss","../../sass/_functions/mixins.scss"],"names":[],"mappings":"AAEA,MACE,yBACA,mBACA,0CAGF,eAEE,oBAEA,iBAEA,iBACA,mBACA,cAMA,kBACA,YCjBE,oCDEJ,eAWI,qBAMF,uBAEE,cACA,kBACA,MACA,OACA,YACA,WACA,oBACA,gBACA,iBACA,iBAEA,6BACE,WACA,cACA,kBACA,WACA,QACA,8EACA,YAGF,2BACI,cACA,kBACA,WACA,QACA,iBACA,wBACA,WACA,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../sass/components/header.scss","../../sass/_functions/mixins.scss"],"names":[],"mappings":"AAEA,MACE,yBACA,mBACA,0CAGF,eAEE,oBAEA,iBAEA,iBACA,mBACA,cAMA,kBACA,YCjBE,oCDEJ,eAWI,qBAMF,uBAEE,cACA,kBACA,MACA,OACA,YACA,WACA,oBACA,gBACA,iBACA,iBAEA,6BACE,WACA,cACA,kBACA,WACA,QACA,8EACA,YAGF,2BACI,cACA,kBACA,WACA,QACA,iBACA,wBACA,WACA,YASN,uCACE,oBAEF,+CACE,gBAaJ,uBACE,6BACA,iCC9EE,oCD4EJ,uBAKI,6BACA,iBACA,yBAIJ,wBACE,4BACA","file":"header.css"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});class s extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=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"):`${o}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const A=function(i){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var a=i.getAttribute("data-id"),d=i.getAttribute("id");if(typeof d>"u"||d==null){var n=String.fromCharCode(65+Math.floor(Math.random()*26));d=n+Date.now(),i.setAttribute("id",d)}function o(){window.player=new YT.Player(d,{height:"100%",width:"100%",videoId:a,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:u,onStateChange:e}})}o();function u(r){r.target.playVideo()}var t=!1;function e(r){if(r.data==YT.PlayerState.PLAYING&&!t){var s=document.getElementById(d);s.classList.add("player-ready"),t=!0}}},_=i=>(Array.from(i.querySelectorAll("dialog[open]")).forEach((a,d)=>{a.closest(".dialog__wrapper")||(a.removeAttribute("open"),a.showModal(),a.focus(),w(a))}),i.addEventListener("click",a=>{if(a.target.tagName=="IAM-ACTIONBAR")return!1;if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-modal]")){const o=a.target.closest("[data-modal]"),u=o.hasAttribute("data-modal")?o.getAttribute("data-modal"):o.getAttribute("data-filter"),t=document.querySelector(`dialog#${u}`);w(t),t.showModal(),t.focus();let e=t.offsetWidth;t.setAttribute("style",`max-width: ${e}px;`),Array.from(t.querySelectorAll("[data-duplicate]")).forEach((r,s)=>{const m=r.getAttribute("data-duplicate"),c=document.getElementById(m);if(r.checked!=c.checked){r.checked=c.checked;let l=new Event("change");r.dispatchEvent(l)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:u})}if(a&&a.target instanceof HTMLElement&&a.target.closest("button.dialog__close")){const o=a.target.closest("dialog[open]");a.preventDefault(),o.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,t)=>{u.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(a&&a.target instanceof HTMLElement&&a.target.closest('button[formmethod="dialog"]')){const o=a.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,t)=>{u.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(a&&a.target instanceof HTMLElement&&a.target.closest("dialog[open]")){let o=a.target.closest("dialog[open]");var d=window.getComputedStyle(o);if(d.display==="contents"&&(o=o.parentNode.closest("dialog[open]")),!o.classList.contains("dialog--transactional")&&!o.classList.contains("dialog--acknowledgement")){const u=o.getBoundingClientRect();(a.clientX<u.left||a.clientX>u.right||a.clientY<u.top||a.clientY>u.bottom)&&(a.target.closest('input[type="radio"]')||o.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")}))}}if(a&&a.target instanceof HTMLElement&&a.target.closest(".dialog__wrapper > button")){a.stopPropagation();let o=a.target.closest(".dialog__wrapper > button"),u=a.target.closest(".dialog__wrapper > button").parentNode,t="openPopover",e=u.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=e&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((c,l)=>{c.removeAttribute("aria-expanded")}),e.hasAttribute("open"))e.close(),t="closePopover",e.removeAttribute("style"),o.removeAttribute("aria-expanded");else{e.show(),o.setAttribute("aria-expanded",!0);var n=o.getBoundingClientRect();let c=n.top,l=n.left;if(o.closest("iam-table")){let h=o.closest("iam-table").parentNode.getBoundingClientRect();c-=h.top,l-=h.left}e.classList.contains("dialog--fix")&&e.setAttribute("style",`position:fixed;top: ${c}px; left: ${l}px; margin: 3rem 0 0 0;`)}let r=e.getBoundingClientRect(),s=r.bottom-window.scrollY,m=window.innerHeight-window.scrollY;if(s>m){let c=e.hasAttribute("style")?e.getAttribute("style")+" ":"";e.setAttribute("style",c+"transform: translate(0, calc(-100% - 4rem))"),r=e.getBoundingClientRect(),r.top-window.scrollY<100&&e.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:t,id:o.textContent})}a&&a.target instanceof HTMLElement&&!a.target.closest("dialog[open]")&&!a.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,u)=>{o.removeAttribute("aria-expanded")}))}),null),w=i=>{let a=i.querySelector(".youtube-embed a");if(a&&A(a),i.classList.contains("dialog--multi")&&!i.querySelector(":scope > .steps")&&L(i),!i.querySelector(":scope > .mh-lg")&&!i.classList.contains("dialog--multi")){i.innerHTML=`<div class="mh-lg">${i.innerHTML}</div>`;let d=i.querySelector(".mh-lg"),n=i.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(n){let o=n.previousSibling;d.before(n),o&&n.before(o)}}i.querySelector(":scope > button:first-child")||i.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},L=i=>{let a="",d=Array.from(i.querySelectorAll("fieldset[data-title]")),n=i.querySelector("form");d.forEach((t,e)=>{a+=`<button data-title="${t.getAttribute("data-title")}" type="button" class="${e==0?"active":""}" tabindex="-1">${t.getAttribute("data-title")}</button>`;const r=document.createElement("div");if(r.classList.add("btn--wrapper"),t.appendChild(r),e!=0&&(r.innerHTML+=`<button data-title="${d[e-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),e!=d.length-1&&(r.innerHTML+=`<button data-title="${d[e+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),e==d.length-1)if(n&&n.querySelector(':scope > button[type="submit"]')){let s=n.querySelector(':scope > button[type="submit"]');s.classList.add("mb-0"),r.insertAdjacentElement("beforeend",s)}else r.innerHTML+=`<button data-title="${d[e].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),i.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${a}</div>`);let o=Array.from(i.querySelectorAll("fieldset.was-validated"));for(let t=0;t<o.length;t++){let e=o[t],r=e.getAttribute("data-title");if(e.querySelector(".is-invalid")){Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((s,m)=>{s.classList.add("active")});break}else Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((s,m)=>{s.classList.add("valid")})}i.addEventListener("invalid",function(){return function(t){t.preventDefault()}}(),!0);function u(t){const e=i.querySelector("fieldset.active")?i.querySelector("fieldset.active"):i.querySelector("fieldset[data-title]"),r=e.getAttribute("data-title");let s=!0;if(e.classList.add("was-validated"),Array.from(e.querySelectorAll("input")).forEach((l,h)=>{l.checkValidity()||(s=!1)}),s?Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((l,h)=>{l.classList.add("valid")}):Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((l,h)=>{l.classList.remove("valid")}),s||!t.hasAttribute("data-next")){const l=i.querySelector(`fieldset[data-title="${t.getAttribute("data-title")}"]`),h=i.querySelector(`.steps button[data-title="${t.getAttribute("data-title")}"]`);Array.from(i.querySelectorAll("button")).forEach((g,b)=>{g.classList.remove("active")}),Array.from(i.querySelectorAll("fieldset")).forEach((g,b)=>{g.classList.remove("active")}),h.classList.add("active"),l.classList.add("active")}let m=Array.from(i.querySelectorAll("fieldset")).length,c=Array.from(i.querySelectorAll("fieldset.valid")).length;i.style.setProperty("--progress",`${c/(m-1)*100}%`)}i.addEventListener("keydown",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("button")){const e=t.target.closest("button");t.keyCode==13&&e.getAttribute("type")!="submit"&&(t.preventDefault(),u(e))}t&&t.target instanceof HTMLElement&&t.target.closest("input")&&(t.target.closest("input").classList.remove("is-invalid"),t.keyCode==13&&t.preventDefault())}),i.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest('button[type="submit"]'))t.target.closest("form").classList.add("was-validated");else if(t&&t.target instanceof HTMLElement&&t.target.closest("button[data-title]")){const e=t.target.closest("button[data-title]");u(e)}return null})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"action bar"});function v(i,a){i&&a=="all"?(i.querySelector("input").indeterminate=!1,i.querySelector("input").checked=!0,i.querySelector("label").textContent="Select all"):i&&a==0?(i.querySelector("input").indeterminate=!1,i.querySelector("input").checked=!1,i.querySelector("label").textContent="Select all"):i&&a?(i.querySelector("input").indeterminate=!0,i.querySelector("input").checked=!1,i.querySelector("label").textContent=`${a} item${a>1?"s":""} selected`):i&&(i.querySelector("input").checked=!1,i.querySelector("input").indeterminate=!1,i.querySelector("label").textContent="Select all")}class k extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const a=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",d=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${a}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -119,6 +119,13 @@ class iamAddressLookup extends HTMLElement {
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
+
if (this.hasAttribute('data-manual')) {
|
|
123
|
+
lookupWrapper.classList.add('js-hide');
|
|
124
|
+
manualWrapper.classList.remove('js-hide');
|
|
125
|
+
Array.from(manualWrapper.querySelectorAll('[data-required]')).forEach((input, index) => {
|
|
126
|
+
input.setAttribute('required', 'true');
|
|
127
|
+
});
|
|
128
|
+
}
|
|
122
129
|
function openManualWrapper() {
|
|
123
130
|
lookupWrapper.classList.add('js-hide');
|
|
124
131
|
manualWrapper.classList.remove('js-hide');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
|
-
*/import k from"js-cookie";var
|
|
4
|
+
*/import k from"js-cookie";var A=function(L,i,o,s){function m(c){return c instanceof o?c:new o(function(u){u(c)})}return new(o||(o=Promise))(function(c,u){function b(n){try{f(s.next(n))}catch(h){u(h)}}function v(n){try{f(s.throw(n))}catch(h){u(h)}}function f(n){n.done?c(n.value):m(n.value).then(b,v)}f((s=s.apply(L,i||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Address Lookup"});class $ extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,s=document.createElement("template");s.innerHTML=`
|
|
5
5
|
<style>
|
|
6
|
-
@import "${
|
|
6
|
+
@import "${o}";
|
|
7
7
|
:host{margin-bottom:1rem;display:block}input[name=postcode]{border-color:var(--error-border, var(--colour-primary)) !important}div:has(input[name=postcode]) .suffix{border-color:var(--error-border, var(--colour-primary)) !important}.invalid-feedback{display:var(--error-display, none) !important}.optional{display:var(--req-display, inline-block) !important}.pre-filled p{padding-bottom:1rem}.pre-filled button{border:none;background:none;cursor:pointer}/*# sourceMappingURL=assets/css/components/address-lookup.css.map */
|
|
8
8
|
|
|
9
9
|
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
<p><span class="pre-filled-address"></span><button class="text-primary text-decoration-none ms-1 cursor-pointer"><i class="fa-regular fa-pen-to-square"></i><span class="visually-hidden">Edit</span></button><slot name="prefilled"></slot></p>
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
|
-
`,this.shadowRoot.appendChild(
|
|
39
|
+
`,this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){return A(this,void 0,void 0,function*(){this.shadowRoot.querySelector(".wrapper");const i=this.shadowRoot.querySelector('[name="postcode"]'),o=this.shadowRoot.querySelector(".postcode-lookup"),s=this.shadowRoot.querySelector(".manual-address"),m=this.shadowRoot.querySelector(".pre-filled"),c=this.shadowRoot.querySelector("datalist"),u=this.shadowRoot.querySelector(".switch-to-manual-btn"),b=this.shadowRoot.querySelector(".switch-to-lookup-btn"),v=this.hasAttribute("data-title")?this.getAttribute("data-title"):"Property address",f=this.shadowRoot.querySelector(".pre-filled-address + button");Array.from(this.shadowRoot.querySelectorAll(".title")).forEach((e,t)=>{e.innerHTML=v});function n(e){let t=e.shadowRoot.querySelector(".pre-filled-address"),a=!0;t.innerHTML="",Array.from(e.querySelectorAll("input[required],input[data-required],select[required],select[data-required]")).forEach((l,d)=>{const r=l.value;r?t.innerHTML+=r+(/^-?\d+$/.test(r)?" ":", "):a=!1}),t.innerHTML=t.innerHTML.slice(0,-2),a&&(m.classList.remove("js-hide"),o.classList.add("js-hide"),s.classList.add("js-hide"))}if(n(this),this.addEventListener("filled",e=>{n(this)}),this.hasAttribute("data-use")){let t=`<div><input type="checkbox" name="use" id="use" value="yes"><label for="use">${this.hasAttribute("data-use-label")?this.getAttribute("data-use-label"):"Use saved address"}</label></div>`;o.insertAdjacentHTML("afterbegin",t),this.shadowRoot.addEventListener("change",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest('[name="use"]')&&a.target.closest('[name="use"]').checked){o.classList.add("js-hide"),s.classList.remove("js-hide");let d=JSON.parse(this.getAttribute("data-use"));Object.keys(d).forEach((r,g)=>{let p=d[r];this.querySelector(`[data-name="${r}"]`)?this.querySelector(`[data-name="${r}"]`).value=p:this.querySelector(`[name="${r}"]`)&&(this.querySelector(`[name="${r}"]`).value=p)})}})}this.hasAttribute("data-manual")&&(o.classList.add("js-hide"),s.classList.remove("js-hide"),Array.from(s.querySelectorAll("[data-required]")).forEach((e,t)=>{e.setAttribute("required","true")}));function h(){o.classList.add("js-hide"),s.classList.remove("js-hide"),Array.from(s.querySelectorAll("[data-required]")).forEach((e,t)=>{e.setAttribute("required","true")}),s.scrollIntoView()}f.addEventListener("click",e=>{m.classList.add("js-hide"),h()}),u.addEventListener("click",e=>{h()}),b.addEventListener("click",e=>{o.classList.remove("js-hide"),s.classList.add("js-hide"),o.scrollIntoView()}),i.addEventListener("keyup",e=>{i.value.length>=3&&S(i.value)}),i.addEventListener("change",e=>{if(i.value.length>=3&&(S(i.value),c.querySelector(`[value="${i.value}"]`))){o.classList.add("js-hide"),s.classList.remove("js-hide");let t=JSON.parse(c.querySelector(`[value="${i.value}"]`).getAttribute("data-values"));Object.keys(t).forEach((a,l)=>{let d=t[a];this.querySelector(`[data-name="${a}"]`)?this.querySelector(`[data-name="${a}"]`).value=d:this.querySelector(`[name="${a}"]`)&&(this.querySelector(`[name="${a}"]`).value=d)}),this.querySelector('[data-name="address_1"]').focus(),Array.from(this.querySelectorAll("[data-required]")).forEach((a,l)=>{a.setAttribute("required","true")}),i.removeAttribute("required"),this.shadowRoot.querySelector('[name="use"]')&&(this.shadowRoot.querySelector('[name="use"]').checked=!1)}});const S=e=>A(this,void 0,void 0,function*(){let t=this.getAttribute("data-url");t+=`${encodeURI(e)}`,window.controller||(window.controller=[]),window.controller[t]&&window.controller[t].abort(),window.controller[t]=new AbortController;const{signal:a}=controller[t];try{yield fetch(t,{signal:a,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-XSRF-TOKEN":k.get("XSRF-TOKEN")})}).then(l=>l.json()).then(l=>{let d="";return l.forEach((r,g)=>{if(typeof r.value=="object"){let p=JSON.stringify(r.value);d+=`<option value="${r.label}, ${e}" data-values='${p}'></option>`}else{let p=JSON.stringify(r),y="";for(const[w,q]of Object.entries(r))w=="address_number_name"?y+=`${q} `:w!="postcode"&&w!="address_title"&&(y+=`${q}${/^-?\d+$/.test(q)?"":","} `);d+=`<option value="${y}${e}" data-values='${p}'></option>`}}),c.innerHTML=d,l})}catch(l){console.log(l)}})})}}export{$ as default};
|
|
40
40
|
//# sourceMappingURL=address-lookup.component.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-lookup.component.min.js","sources":["address-lookup.component.js"],"sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n// @ts-nocheck\nimport Cookies from 'js-cookie';\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"Address Lookup\"\n});\nclass iamAddressLookup extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/address-lookup.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n \n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\" />\n <div class=\"wrapper\">\n\n <div class=\"postcode-lookup\">\n <div>\n <label class=\"mb-2\">Search <span class=\"title text-lowercase\"></span> <span class=\"optional\">(Optional)</span>\n <span>\n <input type=\"text\" name=\"postcode\" list=\"address-lookup__addressess\" autocomplete=\"off\" aria-autocomplete=\"none\" placeholder=\"Postcode\" />\n <span class=\"suffix fa-regular fa-search\"></span>\n </span>\n <span class=\"invalid-feedback\">Required Adddress fields missing</span>\n </label>\n\n </div>\n <button class=\"btn btn-tertiary switch-to-manual-btn\">Or enter address manually</button>\n </div>\n <datalist id=\"address-lookup__addressess\"></datalist>\n\n <div class=\"manual-address pb-2 js-hide\">\n <slot></slot>\n <button class=\"btn btn-tertiary switch-to-lookup-btn\">Use postcode lookup</button>\n </div>\n <div class=\"pre-filled pb-2 js-hide\">\n <strong class=\"title text-primary d-block\"></strong>\n <p><span class=\"pre-filled-address\"></span><button class=\"text-primary text-decoration-none ms-1 cursor-pointer\"><i class=\"fa-regular fa-pen-to-square\"></i><span class=\"visually-hidden\">Edit</span></button><slot name=\"prefilled\"></slot></p>\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n return __awaiter(this, void 0, void 0, function* () {\n const wrapper = this.shadowRoot.querySelector('.wrapper');\n const lookup = this.shadowRoot.querySelector('[name=\"postcode\"]');\n const lookupWrapper = this.shadowRoot.querySelector('.postcode-lookup');\n const manualWrapper = this.shadowRoot.querySelector('.manual-address');\n const preFilledWrapper = this.shadowRoot.querySelector('.pre-filled');\n const list = this.shadowRoot.querySelector('datalist');\n const switchManualBtn = this.shadowRoot.querySelector('.switch-to-manual-btn');\n const switchLookupBtn = this.shadowRoot.querySelector('.switch-to-lookup-btn');\n const title = this.hasAttribute('data-title') ? this.getAttribute('data-title') : \"Property address\";\n const preFilledAddressBtn = this.shadowRoot.querySelector('.pre-filled-address + button');\n Array.from(this.shadowRoot.querySelectorAll('.title')).forEach((titleElement, index) => {\n titleElement.innerHTML = title;\n });\n function checkFilled(component) {\n let preFilledAddress = component.shadowRoot.querySelector('.pre-filled-address');\n let preFilled = true;\n preFilledAddress.innerHTML = \"\";\n Array.from(component.querySelectorAll('input[required],input[data-required],select[required],select[data-required]')).forEach((input, index) => {\n const value = input.value;\n if (!value)\n preFilled = false;\n else\n preFilledAddress.innerHTML += value + (/^-?\\d+$/.test(value) ? ' ' : ', ');\n });\n preFilledAddress.innerHTML = preFilledAddress.innerHTML.slice(0, -2);\n if (preFilled) {\n preFilledWrapper.classList.remove('js-hide');\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.add('js-hide');\n }\n }\n checkFilled(this);\n this.addEventListener('filled', (event) => {\n checkFilled(this);\n });\n if (this.hasAttribute('data-use')) {\n let useLabel = this.hasAttribute('data-use-label') ? this.getAttribute('data-use-label') : 'Use saved address';\n let useCheckbox = `<div><input type=\"checkbox\" name=\"use\" id=\"use\" value=\"yes\"><label for=\"use\">${useLabel}</label></div>`;\n lookupWrapper.insertAdjacentHTML('afterbegin', useCheckbox);\n this.shadowRoot.addEventListener('change', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('[name=\"use\"]')) {\n let checkbox = event.target.closest('[name=\"use\"]');\n if (checkbox.checked) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n let values = JSON.parse(this.getAttribute('data-use'));\n Object.keys(values).forEach((key, index) => {\n let value = values[key];\n if (this.querySelector(`[data-name=\"${key}\"]`))\n this.querySelector(`[data-name=\"${key}\"]`).value = value;\n else if (this.querySelector(`[name=\"${key}\"]`))\n this.querySelector(`[name=\"${key}\"]`).value = value;\n });\n }\n }\n });\n }\n function openManualWrapper() {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n Array.from(manualWrapper.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n manualWrapper.scrollIntoView();\n }\n preFilledAddressBtn.addEventListener('click', (event) => {\n preFilledWrapper.classList.add('js-hide');\n openManualWrapper();\n });\n switchManualBtn.addEventListener('click', (event) => {\n openManualWrapper();\n });\n switchLookupBtn.addEventListener('click', (event) => {\n lookupWrapper.classList.remove('js-hide');\n manualWrapper.classList.add('js-hide');\n lookupWrapper.scrollIntoView();\n });\n lookup.addEventListener('keyup', (event) => {\n if (lookup.value.length >= 3)\n search(lookup.value);\n });\n lookup.addEventListener('change', (event) => {\n if (lookup.value.length >= 3) {\n search(lookup.value);\n if (list.querySelector(`[value=\"${lookup.value}\"]`)) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n let values = JSON.parse(list.querySelector(`[value=\"${lookup.value}\"]`).getAttribute('data-values'));\n Object.keys(values).forEach((key, index) => {\n let value = values[key];\n if (this.querySelector(`[data-name=\"${key}\"]`))\n this.querySelector(`[data-name=\"${key}\"]`).value = value;\n else if (this.querySelector(`[name=\"${key}\"]`))\n this.querySelector(`[name=\"${key}\"]`).value = value;\n });\n // Focus on first input\n this.querySelector('[data-name=\"address_1\"]').focus();\n Array.from(this.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n lookup.removeAttribute('required');\n if (this.shadowRoot.querySelector('[name=\"use\"]'))\n this.shadowRoot.querySelector('[name=\"use\"]').checked = false;\n }\n }\n });\n const search = (postcode) => __awaiter(this, void 0, void 0, function* () {\n let ajaxURL = this.getAttribute('data-url');\n ajaxURL += `${encodeURI(postcode)}`;\n // Setup controller vars if not already set\n if (!window.controller)\n window.controller = [];\n // Abort if controller already present for this url\n if (window.controller[ajaxURL])\n window.controller[ajaxURL].abort();\n // Create a new controller so it can be aborted if new fetch made\n window.controller[ajaxURL] = new AbortController();\n const { signal } = controller[ajaxURL];\n try {\n yield fetch(ajaxURL, {\n signal: signal,\n method: 'get',\n credentials: 'same-origin',\n headers: new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-XSRF-TOKEN': Cookies.get('XSRF-TOKEN')\n })\n })\n .then((response) => response.json()).then((response) => {\n // populate datalist\n let listString = '';\n response.forEach((address, index) => {\n // Deal with agent platform response\n if (typeof address.value == \"object\") {\n let values = JSON.stringify(address.value);\n listString += `<option value=\"${address['label']}, ${postcode}\" data-values='${values}'></option>`;\n }\n else {\n let values = JSON.stringify(address);\n let itemString = '';\n for (const [key, value] of Object.entries(address)) {\n if (key == \"address_number_name\")\n itemString += `${value} `;\n else if (key != \"postcode\" && key != \"address_title\")\n itemString += `${value}${(/^-?\\d+$/.test(value) ? '' : ',')} `;\n }\n listString += `<option value=\"${itemString}${postcode}\" data-values='${values}'></option>`;\n }\n });\n list.innerHTML = listString;\n return response;\n });\n }\n catch (error) {\n console.log(error);\n }\n });\n });\n }\n}\nexport default iamAddressLookup;\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","reject","fulfilled","step","e","rejected","result","iamAddressLookup","assetLocation","coreCSS","template","lookup","lookupWrapper","manualWrapper","preFilledWrapper","list","switchManualBtn","switchLookupBtn","title","preFilledAddressBtn","titleElement","index","checkFilled","component","preFilledAddress","preFilled","input","event","useCheckbox","values","key","openManualWrapper","search","postcode","ajaxURL","signal","Cookies","response","listString","address","itemString","error"],"mappings":";;;6BAAA,IAAIA,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,EAAW,CACrF,SAASC,EAAMC,EAAO,CAAE,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,EAAE,SAAUI,EAAS,CAAEA,EAAQD,CAAK,CAAE,CAAE,CAAI,CAC5G,OAAO,IAAKH,IAAMA,EAAI,UAAU,SAAUI,EAASC,EAAQ,CACvD,SAASC,EAAUH,EAAO,CAAE,GAAI,CAAEI,EAAKN,EAAU,KAAKE,CAAK,CAAC,CAAE,OAAUK,EAAP,CAAYH,EAAOG,CAAC,EAAM,CAC3F,SAASC,EAASN,EAAO,CAAE,GAAI,CAAEI,EAAKN,EAAU,MAASE,CAAK,CAAC,CAAI,OAAQK,EAAP,CAAYH,EAAOG,CAAC,EAAM,CAC9F,SAASD,EAAKG,EAAQ,CAAEA,EAAO,KAAON,EAAQM,EAAO,KAAK,EAAIR,EAAMQ,EAAO,KAAK,EAAE,KAAKJ,EAAWG,CAAQ,CAAI,CAC9GF,GAAMN,EAAYA,EAAU,MAAMH,EAASC,GAAc,CAAE,CAAA,GAAG,KAAI,CAAE,CAC5E,CAAK,CACL,EAIA,OAAO,UAAY,OAAO,WAAa,GACvC,OAAO,UAAU,KAAK,CAClB,MAAS,0BACT,QAAW,gBACf,CAAC,EACD,MAAMY,UAAyB,WAAY,CACvC,aAA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U,KAAKA,CAAK,EAAI,GAAK,QAE/DuC,GAAc,kBAAkBE,IAAaP,mBAA0BJ,eAEvG,CAAyB,EACDd,EAAK,UAAYuB,EACVD,CAC/B,CAAqB,CACJ,OACMI,EAAP,CACI,QAAQ,IAAIA,CAAK,CACpB,CACjB,CAAa,CACb,CAAS,CACJ,CACL"}
|
|
1
|
+
{"version":3,"file":"address-lookup.component.min.js","sources":["address-lookup.component.js"],"sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n// @ts-nocheck\nimport Cookies from 'js-cookie';\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"Address Lookup\"\n});\nclass iamAddressLookup extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/address-lookup.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n \n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\" />\n <div class=\"wrapper\">\n\n <div class=\"postcode-lookup\">\n <div>\n <label class=\"mb-2\">Search <span class=\"title text-lowercase\"></span> <span class=\"optional\">(Optional)</span>\n <span>\n <input type=\"text\" name=\"postcode\" list=\"address-lookup__addressess\" autocomplete=\"off\" aria-autocomplete=\"none\" placeholder=\"Postcode\" />\n <span class=\"suffix fa-regular fa-search\"></span>\n </span>\n <span class=\"invalid-feedback\">Required Adddress fields missing</span>\n </label>\n\n </div>\n <button class=\"btn btn-tertiary switch-to-manual-btn\">Or enter address manually</button>\n </div>\n <datalist id=\"address-lookup__addressess\"></datalist>\n\n <div class=\"manual-address pb-2 js-hide\">\n <slot></slot>\n <button class=\"btn btn-tertiary switch-to-lookup-btn\">Use postcode lookup</button>\n </div>\n <div class=\"pre-filled pb-2 js-hide\">\n <strong class=\"title text-primary d-block\"></strong>\n <p><span class=\"pre-filled-address\"></span><button class=\"text-primary text-decoration-none ms-1 cursor-pointer\"><i class=\"fa-regular fa-pen-to-square\"></i><span class=\"visually-hidden\">Edit</span></button><slot name=\"prefilled\"></slot></p>\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n return __awaiter(this, void 0, void 0, function* () {\n const wrapper = this.shadowRoot.querySelector('.wrapper');\n const lookup = this.shadowRoot.querySelector('[name=\"postcode\"]');\n const lookupWrapper = this.shadowRoot.querySelector('.postcode-lookup');\n const manualWrapper = this.shadowRoot.querySelector('.manual-address');\n const preFilledWrapper = this.shadowRoot.querySelector('.pre-filled');\n const list = this.shadowRoot.querySelector('datalist');\n const switchManualBtn = this.shadowRoot.querySelector('.switch-to-manual-btn');\n const switchLookupBtn = this.shadowRoot.querySelector('.switch-to-lookup-btn');\n const title = this.hasAttribute('data-title') ? this.getAttribute('data-title') : \"Property address\";\n const preFilledAddressBtn = this.shadowRoot.querySelector('.pre-filled-address + button');\n Array.from(this.shadowRoot.querySelectorAll('.title')).forEach((titleElement, index) => {\n titleElement.innerHTML = title;\n });\n function checkFilled(component) {\n let preFilledAddress = component.shadowRoot.querySelector('.pre-filled-address');\n let preFilled = true;\n preFilledAddress.innerHTML = \"\";\n Array.from(component.querySelectorAll('input[required],input[data-required],select[required],select[data-required]')).forEach((input, index) => {\n const value = input.value;\n if (!value)\n preFilled = false;\n else\n preFilledAddress.innerHTML += value + (/^-?\\d+$/.test(value) ? ' ' : ', ');\n });\n preFilledAddress.innerHTML = preFilledAddress.innerHTML.slice(0, -2);\n if (preFilled) {\n preFilledWrapper.classList.remove('js-hide');\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.add('js-hide');\n }\n }\n checkFilled(this);\n this.addEventListener('filled', (event) => {\n checkFilled(this);\n });\n if (this.hasAttribute('data-use')) {\n let useLabel = this.hasAttribute('data-use-label') ? this.getAttribute('data-use-label') : 'Use saved address';\n let useCheckbox = `<div><input type=\"checkbox\" name=\"use\" id=\"use\" value=\"yes\"><label for=\"use\">${useLabel}</label></div>`;\n lookupWrapper.insertAdjacentHTML('afterbegin', useCheckbox);\n this.shadowRoot.addEventListener('change', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('[name=\"use\"]')) {\n let checkbox = event.target.closest('[name=\"use\"]');\n if (checkbox.checked) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n let values = JSON.parse(this.getAttribute('data-use'));\n Object.keys(values).forEach((key, index) => {\n let value = values[key];\n if (this.querySelector(`[data-name=\"${key}\"]`))\n this.querySelector(`[data-name=\"${key}\"]`).value = value;\n else if (this.querySelector(`[name=\"${key}\"]`))\n this.querySelector(`[name=\"${key}\"]`).value = value;\n });\n }\n }\n });\n }\n if (this.hasAttribute('data-manual')) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n Array.from(manualWrapper.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n }\n function openManualWrapper() {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n Array.from(manualWrapper.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n manualWrapper.scrollIntoView();\n }\n preFilledAddressBtn.addEventListener('click', (event) => {\n preFilledWrapper.classList.add('js-hide');\n openManualWrapper();\n });\n switchManualBtn.addEventListener('click', (event) => {\n openManualWrapper();\n });\n switchLookupBtn.addEventListener('click', (event) => {\n lookupWrapper.classList.remove('js-hide');\n manualWrapper.classList.add('js-hide');\n lookupWrapper.scrollIntoView();\n });\n lookup.addEventListener('keyup', (event) => {\n if (lookup.value.length >= 3)\n search(lookup.value);\n });\n lookup.addEventListener('change', (event) => {\n if (lookup.value.length >= 3) {\n search(lookup.value);\n if (list.querySelector(`[value=\"${lookup.value}\"]`)) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n let values = JSON.parse(list.querySelector(`[value=\"${lookup.value}\"]`).getAttribute('data-values'));\n Object.keys(values).forEach((key, index) => {\n let value = values[key];\n if (this.querySelector(`[data-name=\"${key}\"]`))\n this.querySelector(`[data-name=\"${key}\"]`).value = value;\n else if (this.querySelector(`[name=\"${key}\"]`))\n this.querySelector(`[name=\"${key}\"]`).value = value;\n });\n // Focus on first input\n this.querySelector('[data-name=\"address_1\"]').focus();\n Array.from(this.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n lookup.removeAttribute('required');\n if (this.shadowRoot.querySelector('[name=\"use\"]'))\n this.shadowRoot.querySelector('[name=\"use\"]').checked = false;\n }\n }\n });\n const search = (postcode) => __awaiter(this, void 0, void 0, function* () {\n let ajaxURL = this.getAttribute('data-url');\n ajaxURL += `${encodeURI(postcode)}`;\n // Setup controller vars if not already set\n if (!window.controller)\n window.controller = [];\n // Abort if controller already present for this url\n if (window.controller[ajaxURL])\n window.controller[ajaxURL].abort();\n // Create a new controller so it can be aborted if new fetch made\n window.controller[ajaxURL] = new AbortController();\n const { signal } = controller[ajaxURL];\n try {\n yield fetch(ajaxURL, {\n signal: signal,\n method: 'get',\n credentials: 'same-origin',\n headers: new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-XSRF-TOKEN': Cookies.get('XSRF-TOKEN')\n })\n })\n .then((response) => response.json()).then((response) => {\n // populate datalist\n let listString = '';\n response.forEach((address, index) => {\n // Deal with agent platform response\n if (typeof address.value == \"object\") {\n let values = JSON.stringify(address.value);\n listString += `<option value=\"${address['label']}, ${postcode}\" data-values='${values}'></option>`;\n }\n else {\n let values = JSON.stringify(address);\n let itemString = '';\n for (const [key, value] of Object.entries(address)) {\n if (key == \"address_number_name\")\n itemString += `${value} `;\n else if (key != \"postcode\" && key != \"address_title\")\n itemString += `${value}${(/^-?\\d+$/.test(value) ? '' : ',')} `;\n }\n listString += `<option value=\"${itemString}${postcode}\" data-values='${values}'></option>`;\n }\n });\n list.innerHTML = listString;\n return response;\n });\n }\n catch (error) {\n console.log(error);\n }\n });\n });\n }\n}\nexport default iamAddressLookup;\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","reject","fulfilled","step","e","rejected","result","iamAddressLookup","assetLocation","coreCSS","template","lookup","lookupWrapper","manualWrapper","preFilledWrapper","list","switchManualBtn","switchLookupBtn","title","preFilledAddressBtn","titleElement","index","checkFilled","component","preFilledAddress","preFilled","input","event","useCheckbox","values","key","openManualWrapper","search","postcode","ajaxURL","signal","Cookies","response","listString","address","itemString","error"],"mappings":";;;6BAAA,IAAIA,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,EAAW,CACrF,SAASC,EAAMC,EAAO,CAAE,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,EAAE,SAAUI,EAAS,CAAEA,EAAQD,CAAK,CAAE,CAAE,CAAI,CAC5G,OAAO,IAAKH,IAAMA,EAAI,UAAU,SAAUI,EAASC,EAAQ,CACvD,SAASC,EAAUH,EAAO,CAAE,GAAI,CAAEI,EAAKN,EAAU,KAAKE,CAAK,CAAC,CAAE,OAAUK,EAAP,CAAYH,EAAOG,CAAC,EAAM,CAC3F,SAASC,EAASN,EAAO,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CACA,MAAM,MAAMA,EAAS,CACjB,OAAQC,EACR,OAAQ,MACR,YAAa,cACb,QAAS,IAAI,QAAQ,CACjB,eAAgB,mBAChB,OAAQ,mBACR,mBAAoB,iBACpB,eAAgBC,EAAQ,IAAI,YAAY,CACpE,CAAyB,CACzB,CAAqB,EACI,KAAMC,GAAaA,EAAS,KAAI,CAAE,EAAE,KAAMA,GAAa,CAExD,IAAIC,EAAa,GACjB,OAAAD,EAAS,QAAQ,CAACE,EAASlB,IAAU,CAEjC,GAAI,OAAOkB,EAAQ,OAAS,SAAU,CAClC,IAAIV,EAAS,KAAK,UAAUU,EAAQ,KAAK,EACzCD,GAAc,kBAAkBC,EAAQ,UAAaN,mBAA0BJ,mBAE9E,CACD,IAAIA,EAAS,KAAK,UAAUU,CAAO,EAC/BC,EAAa,GACjB,SAAW,CAACV,EAAK/B,CAAK,IAAK,OAAO,QAAQwC,CAAO,EACzCT,GAAO,sBACPU,GAAc,GAAGzC,KACZ+B,GAAO,YAAcA,GAAO,kBACjCU,GAAc,GAAGzC,IAAS,UAAU,KAAKA,CAAK,EAAI,GAAK,QAE/DuC,GAAc,kBAAkBE,IAAaP,mBAA0BJ,eAEvG,CAAyB,EACDd,EAAK,UAAYuB,EACVD,CAC/B,CAAqB,CACJ,OACMI,EAAP,CACI,QAAQ,IAAIA,CAAK,CACpB,CACjB,CAAa,CACb,CAAS,CACJ,CACL"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function h(d,m){function u(e,t){let l=!1,r=t.getAttribute("name");r.includes("[]")&&(r=r.replace("[]",`[${t.value}]`));let i=e.querySelector(`[data-name="${r}"]`);i&&t.getAttribute("type")=="checkbox"&&(l=!t.checked);let o=t.getAttribute("data-filter-text");if(i||(i=document.createElement("button"),e.appendChild(i)),i.setAttribute("type","button"),i.classList.add("filter"),i.setAttribute("data-name",r),i.innerHTML=o.replace("$value",t.value),(!t.value||l)&&i.remove(),t.parentNode.closest("[data-filter-text]")){let p=t.parentNode.closest("[data-filter-text]"),f=!0;if(r="",p.querySelectorAll("input").forEach((a,n)=>{let s=a.getAttribute("name");if(r+=`${n!=0?",":""}${s}`,e.querySelector(`[data-name="${s}"]`)&&e.querySelector(`[data-name="${s}"]`).remove(),a.value){let c=document.createElement("button");c.setAttribute("type","button"),c.classList.add("filter"),c.setAttribute("data-name",s),c.innerHTML=o.replace("$value",a.value),e.appendChild(c)}else f=!1}),e.querySelector(`[data-name="${r}"]`)&&e.querySelector(`[data-name="${r}"]`).remove(),f){let a=p.getAttribute("data-filter-text");p.querySelectorAll("input").forEach((s,c)=>{let b=s.getAttribute("name");e.querySelector(`[data-name="${b}"]`)&&e.querySelector(`[data-name="${b}"]`).remove(),a=a.replace(`$${c+1}`,s.value)});let n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("filter"),n.setAttribute("data-name",r),n.innerHTML=a,e.appendChild(n)}}}Array.from(d.querySelectorAll('input[type="checkbox"]:checked')).forEach((e,t)=>{u(m,e)}),Array.from(d.querySelectorAll("input[data-filter-text]")).forEach((e,t)=>{e.addEventListener("change",function(l){u(m,e),l.stopPropagation()})}),d.addEventListener("change",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest("input[data-filter-text]")){let t=e.target.closest("input[data-filter-text]");u(m,t)}}),m.addEventListener("click",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest(".filter")){let r=e.target.closest(".filter"),i=r.getAttribute("data-name").split(",");for(var t=0;t<i.length;t++){let o=i[t],p=`[name="${o}"]`;o.match(/\[(.*)\]/)&&(o.replace(/\[(.*)\]/,"[]"),p=`[value="${o.replace(/.*\[(.*)\]/,"$1")}"]`);let f=d.querySelectorAll(p);for(var l=0;l<f.length;l++){let a=f[l];if(a.getAttribute("type")!="radio"&&a.getAttribute("type")!="checkbox")a.value="";else{a.checked=!1;var e=new Event("force");d.hasAttribute("data-nosubmit")||a.closest("form").dispatchEvent(e)}}}r.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class g extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const m=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",u=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${m}/css/core.min.css`;let e=this.classList.toString();const t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class h extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");let e=this.classList.toString();const a=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${a}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"collapsible side menu"});class s extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=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"):`${e}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function h(c,o){const r=o.querySelector(".files"),l=o.querySelector(".drop-area"),t=c.querySelector("input"),u=c.hasAttribute("data-maxsize")?c.getAttribute("data-maxsize"):0,a=t.cloneNode();l.append(a),o.addEventListener("click",e=>{e&&e.target instanceof HTMLElement&&e.target.closest(".btn-primary")&&(e.target.closest(".btn-primary"),(t.hasAttribute("multiple")?a:t).click())}),o.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest(".files button")){const i=new DataTransfer,{files:d}=t,p=e.target.closest(".files button");for(let n=0;n<d.length;n++){const s=d[n];s.name!=p.getAttribute("data-file")&&i.items.add(s)}t.files=i.files;const m=new Event("change");t.dispatchEvent(m)}}),a.addEventListener("change",e=>{if(t.hasAttribute("multiple")){const d=[...t.files,...a.files];let p=[];const m=new DataTransfer;for(let n=0;n<d.length;n++){const s=d[n],f=s.size/1e3;!p.includes(s.name)&&(u==0||f<u)&&m.items.add(s),p.push(s.name)}t.files=m.files}else t.files=a.files;const i=new Event("change");t.dispatchEvent(i)}),a.addEventListener("dragenter",e=>{a.classList.add("focus")}),a.addEventListener("dragleave",e=>{a.classList.remove("focus")}),a.addEventListener("drop",e=>{a.classList.remove("focus")}),t.addEventListener("change",e=>{r.innerHTML="";for(const i of t.files)r.innerHTML+=`<span class="file">${i.name} <button data-file="${i.name}">Remove</button></span>`})}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"fileupload"});class b extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,l=document.createElement("template");l.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function r(s,t){n(s,t)}function n(s,t){var e;t.addEventListener("keyup",a=>{clearTimeout(e),e=setTimeout(function(){o(s,t.value)},500)}),t.addEventListener("change",a=>{clearTimeout(e),o(s,t.value)})}const o=function(s,t){Array.from(s.querySelectorAll(":scope > li")).forEach((e,a)=>{let i=e.textContent.toLowerCase();e.classList.add("d-none"),i.includes(t.toLowerCase())&&e.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:t})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class l extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const 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"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const 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"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
6
6
|
@import "${e}";
|
|
7
|
-
:host{padding-top:0 !important;margin-bottom:2rem;background-color:rgba(0,0,0,0) !important}.header-banner{padding-top:2.75rem;max-width:120rem;min-height:25rem;margin-inline:auto;display:block;position:relative;height:auto}@media screen and (min-width: 62em){.header-banner{padding-top:5.25rem}}.header-banner>picture{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none;overflow:hidden;min-height:25rem;max-height:25rem}.header-banner>picture:after{content:"";display:block;position:absolute;z-index:-1;inset:0;background:linear-gradient(300deg, rgb(30, 190, 230) 0%, rgb(0, 49, 60) 100%);opacity:.85}.header-banner>picture img{display:block;position:absolute;z-index:-2;inset:0;object-fit:cover;object-position:50% 50%;width:100%;height:100%}::slotted(.breadcrumb){margin-top:1.5rem !important;margin-bottom:-0.5rem !important}@media screen and (min-width: 62em){::slotted(.breadcrumb){position:absolute !important;top:0 !important;left:5.25rem !important}}::slotted(*:last-child){padding-bottom:0 !important;margin-bottom:0 !important}/*# sourceMappingURL=assets/css/components/header.css.map */
|
|
7
|
+
:host{padding-top:0 !important;margin-bottom:2rem;background-color:rgba(0,0,0,0) !important}.header-banner{padding-top:2.75rem;max-width:120rem;min-height:25rem;margin-inline:auto;display:block;position:relative;height:auto}@media screen and (min-width: 62em){.header-banner{padding-top:5.25rem}}.header-banner>picture{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none;overflow:hidden;min-height:25rem;max-height:25rem}.header-banner>picture:after{content:"";display:block;position:absolute;z-index:-1;inset:0;background:linear-gradient(300deg, rgb(30, 190, 230) 0%, rgb(0, 49, 60) 100%);opacity:.85}.header-banner>picture img{display:block;position:absolute;z-index:-2;inset:0;object-fit:cover;object-position:50% 50%;width:100%;height:100%}:host(.header--contain) .header-banner{padding-bottom:2rem}:host(.header--contain) .header-banner>picture{max-height:100%}::slotted(.breadcrumb){margin-top:1.5rem !important;margin-bottom:-0.5rem !important}@media screen and (min-width: 62em){::slotted(.breadcrumb){position:absolute !important;top:0 !important;left:5.25rem !important}}::slotted(*:last-child){padding-bottom:0 !important;margin-bottom:0 !important}/*# sourceMappingURL=assets/css/components/header.css.map */
|
|
8
8
|
|
|
9
9
|
${this.hasAttribute("css")?`@import "${this.getAttribute("css")}";`:""}
|
|
10
10
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"nav"});class v extends HTMLElement{constructor(){super();const s=this.attachShadow({mode:"open"}),n=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"):`${n}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function r(i){if(i.hasAttribute("data-type")&&i.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)),i.closest(".notification__holder")||t.appendChild(i)}if(i.setAttribute("role","alert"),i.addEventListener("click",function(t){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(t.preventDefault(),a(i))},!1),i.hasAttribute("data-timeout")){let t=i.getAttribute("data-timeout");var n=new c(function(){a(i)},t);i.addEventListener("mouseenter",o=>{n.pause()}),i.addEventListener("mouseleave",o=>{n.resume()})}}function c(i,n){var t,o,e=n;this.pause=function(){window.clearTimeout(t),e-=new Date-o},this.resume=function(){o=new Date,window.clearTimeout(t),t=window.setTimeout(i,e)},this.resume()}const a=function(i){i.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class d extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const n=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"):`${n}/css/core.min.css`,o=this.querySelectorAll("a,button");Array.from(o).forEach((s,l)=>{s.setAttribute("slot","btns"),s.classList.add("link")}),(o.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/class v 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`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/import k from"js-cookie";const q=e=>e.replace(/ /g,"_"),x=function(e){return e=e.toLowerCase(),e=q(e),e=e.replace(/\W/g,""),e},m=(e,s,a)=>s.split(/[\.\[\]\'\"]/).filter(o=>o).reduce((o,d)=>o?o[d]:a,e),S=e=>Array.isArray(e)||e!==null&&["function","object"].includes(typeof e);var L=function(e,s,a,o){function d(c){return c instanceof a?c:new a(function(n){n(c)})}return new(a||(a=Promise))(function(c,n){function v(r){try{u(o.next(r))}catch(i){n(i)}}function t(r){try{u(o.throw(r))}catch(i){n(i)}}function u(r){r.done?c(r.value):d(r.value).then(v,t)}u((o=o.apply(e,s||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Search"});class C extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const s=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${s}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const B=function(a){return typeof a!="string"?!1:!isNaN(a)&&!isNaN(parseFloat(a))},Q=(a,e)=>String(a).padStart(e,"0"),X=a=>a.charAt(0).toUpperCase()+a.slice(1),k=(a,e,r)=>e.split(/[\.\[\]\'\"]/).filter(i=>i).reduce((i,b)=>i?i[b]:r,a);var Y=function(a,e,r,i){function b(d){return d instanceof r?d:new r(function(o){o(d)})}return new(r||(r=Promise))(function(d,o){function n(c){try{t(i.next(c))}catch(h){o(h)}}function l(c){try{t(i.throw(c))}catch(h){o(h)}}function t(c){c.done?d(c.value):b(c.value).then(n,l)}t((i=i.apply(a,e||[])).next())})};const R=a=>{const e=Array.from(a.querySelectorAll("thead th"));Array.from(a.querySelectorAll("tbody tr")).forEach((i,b)=>{const d=Array.from(i.querySelectorAll("th, td")),o=["0","low","medium","high","unknown","n/a","pending","verified","due","overdue","incomplete","complete","completed","approval required","upcoming","requires approval","to do","on track","not started","warning","error"];d.forEach((n,l)=>{const t=e[l];if(typeof t<"u"){let c=document.createElement("div");c.innerHTML=t.innerHTML;let h=c.textContent||c.innerText||"";n.setAttribute("data-label",h),t.hasAttribute("data-td-class")&&n.setAttribute("class",t.getAttribute("data-td-class")),t.hasAttribute("data-format")&&(n.setAttribute("data-format",t.getAttribute("data-format")),n.innerHTML=M(t.getAttribute("data-format"),n.textContent.trim())),o.includes(n.textContent.trim().toLowerCase())&&n.setAttribute("data-content",n.textContent.trim().toLowerCase())}})})},J=a=>{let e=0;return Array.from(a.querySelectorAll("tbody tr")).forEach((r,i)=>{let b=window.getComputedStyle(document.querySelector("html")),d=r.querySelector(":scope > *:last-child > *:first-child");if(d){d.classList.add("text-nowrap");let o=d.offsetWidth/parseFloat(b.fontSize);o+=1.7,e=e>o?e:o}}),e},G=(a,e)=>{if(e.classList.contains("table--fullwidth")&&!e.hasAttribute("data-expandable")||a.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(a.querySelectorAll("thead tr")).forEach((r,i)=>{a.querySelectorAll("thead tr th.expand-button-heading").length||r.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(a.querySelectorAll("tbody tr")).forEach((r,i)=>{const b=r.getAttribute("data-view")==="full"?"aria-expanded":"";r.insertAdjacentHTML("afterbegin",`<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button ${b}>Expand</button></td>`)})},K=a=>{a.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let r=e.target.closest("[data-expand-button]"),i=r.closest("tr");r.toggleAttribute("aria-expanded"),i.getAttribute("data-view")=="full"?i.setAttribute("data-view","default"):i.setAttribute("data-view","full"),r.blur()}})},N=(a,e)=>{let r=e.querySelector("[data-search]");if(!r)return!1;const i=r.getAttribute("id"),b=r.getAttribute("data-search").split(",");let d=r.parentNode,o={};b.forEach((n,l)=>{Array.from(a.querySelectorAll('td[data-label="'+n.trim()+'"]')).forEach((t,c)=>{t.querySelector(".td__content")?o[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:o[t.textContent]=t.textContent})}),r.setAttribute("list",`${i}_list`),r.setAttribute("autocomplete","off"),d.querySelector("datalist")||(d.innerHTML+=`<datalist id="${i}_list"></datalist>`),d.querySelector("datalist").innerHTML=`${Object.keys(o).map(n=>`<option value="${n}"></option>`).join("")}`},V=(a,e,r,i,b)=>{var d;let o=function(t,c=!1){if(e.classList.contains("processing"))return!1;if(t.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((h,u)=>{const m=h.getAttribute("data-duplicate"),s=document.getElementById(m),g=document.querySelector(`[for="${m}"] iam-card`);if(s.checked!=h.checked)if(g){let x=new Event("click");g.dispatchEvent(x)}else s.checked=h.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!c){let h=e.querySelector("[data-pagination]");h.value=1,i.setAttribute("data-page",1)}z(a,e,r,i)}else e.hasAttribute("data-submit")?e.submit():(C(a,e,i),_(a,e));if(e.hasAttribute("data-ajax-post")){let h=new FormData(e),u=new URLSearchParams(h).toString();const m=new XMLHttpRequest;m.open("GET",`${window.location.href}?ajax=true&${u}`),m.send()}};e.addEventListener("keyup",t=>{clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&(d=setTimeout(function(){o(t)},500))}),e.addEventListener("change",t=>{clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||O(a,e,b),o(t)),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&o(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter][data-no-ajax]")?(C(a,e,i),_(a,e)):(t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&t.target.closest("form .dialog__wrapper > dialog")||t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&!t.target.closest("form dialog"))&&o(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-show]")&&o(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-mimic]")&&o(t)}),e.addEventListener("click",t=>{if(clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest('dialog button:not([type="button"])')&&t.target.closest('dialog button:not([type="button"])').closest("dialog").close(),t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__close")&&(t.preventDefault(),t.stopPropagation()),t&&t.target instanceof HTMLElement&&t.target.closest("[data-clear]")){e.classList.add("processing"),Array.from(e.querySelectorAll(".applied-filters")).forEach((h,u)=>{h.innerHTML=""});let c=e.elements;for(let h=0;h<c.length;h++)switch(c[h].type.toLowerCase()?c[h].type.toLowerCase():"text"){case"text":case"password":case"textarea":c[h].value="";break;case"radio":case"checkbox":if(c[h].checked){let m=c[h],s=m.getAttribute("id"),g=document.querySelector(`[for="${s}"`);if(g.querySelector("iam-card")){let x=g.querySelector("iam-card"),S=new Event("click");x.dispatchEvent(S)}m.checked=!1}break;case"select-one":case"select-multi":c[h].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||O(a,e,b),o(t)}}),e.addEventListener("submit",t=>{clearTimeout(d),e.hasAttribute("data-submit")||t.preventDefault(),o(t)}),e.addEventListener("force",t=>{o(t)}),e.addEventListener("paginate",t=>{o(t,!0)});let n=[],l=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((t,c)=>{let h=t.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${h}"]`)).forEach((u,m)=>{let s=u.closest("form");n.includes(s)||n.push(s),l.includes(h)||l.push(h)})}),n.forEach((t,c)=>{const h=function(){let u=[],m=new FormData(t);for(const[s,g]of m)document.querySelector(`[data-mimic="${s}"]`)&&!u.includes(s)?(u.push(s),document.querySelector(`[data-mimic="${s}"]`).value=g):document.querySelector(`[data-mimic="${s}"]`)&&(document.querySelector(`[data-mimic="${s}"]`).value+=","+g);for(const s of u){const g=new Event("force");e.dispatchEvent(g)}for(const s of l)if(!m.has(s)&&t.querySelector(`[name="${s}"]`)){document.querySelector(`[data-mimic="${s}"]`).value="";const g=new Event("force");e.dispatchEvent(g)}};t.addEventListener("force",u=>{h()}),t.addEventListener("change",u=>{h()})})},O=(a,e,r)=>{if(e.getAttribute("data-ajax"))return!1;let i=a.querySelector("tbody"),b=e.querySelector("[data-sort]"),d=b.querySelector(`option:nth-child(${b.selectedIndex+1})`),o=d.getAttribute("data-sort"),n=d.getAttribute("data-order"),l=d.getAttribute("data-format");if(!o)return i.innerHTML=r.innerHTML,R(a),!1;let t=[];["asc","desc","descending"].includes(n)||(t=n.split(","));let c=[];Array.from(i.querySelectorAll("tr")).forEach((u,m)=>{let s=u.querySelector('td[data-label="'+o+'"], th[data-label="'+o+'"]').textContent.trim();u.querySelector('[data-label="'+o+'"] .td__content')&&(s=u.querySelector('[data-label="'+o+'"] .td__content').textContent.trim()),t.length&&t.includes(s)&&(s=t.indexOf(s)),B(s)&&(s=Q(s,10)),l&&l=="date"&&(s=new Date(s));const g={index:s,row:u};c.push(g)}),c.sort((u,m)=>u.index>m.index?1:-1),(n=="descending"||n=="desc")&&(c=c.reverse());let h="";c.forEach((u,m)=>{h+=u.row.outerHTML}),i.innerHTML=h},C=(a,e,r)=>{a.classList.remove("table--filtered");let i=P(e),b=[],d=0,o=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,n=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(a.querySelectorAll("tbody tr")).forEach((t,c)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")}),e.querySelector("[data-search]")){let t=e.querySelector("[data-search]");e.querySelector("[data-search]").getAttribute("data-search").split(",").forEach((h,u)=>{b.push({column:`${h.trim()}`,value:`${t.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML="",t.parentNode.classList.remove("hover")});let l=0;Object.values(i).forEach((t,c)=>{typeof t=="object"&&Object.values(t).length?l+=Object.values(t).length:l++}),l&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML+=`(${l})`,t.parentNode.classList.add("hover")}),a.classList.add("table--filtered");for(const[t,c]of Object.entries(i))Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((h,u)=>{let m=!1;c.forEach((s,g)=>{let x=h.querySelector(`[data-label="${t}"]`);if(s&&s=="$today")s=M("date",new Date);else if(s&&s=="$yesterday"){let f=new Date;f.setDate(f.getDate()-1),s=M("date",f)}else if(s&&(s=="$thisWeek"||s=="$lastWeek")){let f=new Date,y=new Date(f.setDate(f.getDate()-(f.getDay()-1))),p=new Date(f.setDate(f.getDate()-f.getDay()+7)),w=new Date(x.textContent.toLowerCase());if(f.setHours(0,0,0,0),y.setHours(0,0,0,0),p.setHours(0,0,0,0),w.setHours(0,0,0,0),s=="$thisWeek")m=w>=y&&w<=p;else{let A=new Date(y.setDate(y.getDate()-7)),L=new Date(p.setDate(p.getDate()-7));A.setHours(0,0,0,0),L.setHours(0,0,0,0),m=w>=A&&w<=L}}else if(s&&s=="$thisMonth"){let f=new Date,y=f.getFullYear(),p=f.getMonth();var S=new Date(y,p,1),q=new Date(y,p+1,0);let w=new Date(x.textContent.toLowerCase());S.setHours(0,0,0,0),q.setHours(0,0,0,0),w.setHours(0,0,0,0),m=w>=S&&w<=q}else if(s&&s=="$lastMonth"){let f=new Date,y=f.getFullYear(),p=f.getMonth();var E=new Date(y,p-1,1),v=new Date(y,p,0);let w=new Date(x.textContent.toLowerCase());E.setHours(0,0,0,0),v.setHours(0,0,0,0),w.setHours(0,0,0,0),m=w>=E&&w<=v}x&&x.textContent.toLowerCase().includes(s.toLowerCase())&&(m=!0)}),m||(h.classList.add("filtered"),h.setAttribute("data-filtered-by",t))});Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,c)=>{let h=!(b.length>0&&b[0].value.length>=3);b.forEach((u,m)=>{let s=t.querySelector(`[data-label="${u.column}"]`);s&&u.value.length>=3&&s.textContent.toLowerCase().includes(u.value.toLowerCase())&&(h=!0)}),h||t.classList.add("filtered")}),Array.from(a.querySelectorAll("tbody tr:not(.filtered")).forEach((t,c)=>{d++,t.classList.add("filtered--matched"),Math.ceil(d/n)==parseInt(o)&&t.classList.add("filtered--show")}),r&&(r.setAttribute("data-total",d),r.setAttribute("data-show",n),r.setAttribute("data-page",o))},_=(a,e,r)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((b,d)=>{let o=b.getAttribute("data-query"),n=0;if(o=="total")r.hasAttribute("data-total")?n=r.getAttribute("data-total"):n=(a.classList.contains("table--filtered"),a.querySelectorAll("tbody tr").length);else if(!o.includes(" == ")&&o.includes(" & ")){let l=o.split(" & "),t="";l.forEach(c=>{t+=`:not([data-filtered-by="${c}"])`}),n=Array.from(a.querySelectorAll(`tbody tr${t}`)).length}else if(!o.includes(" == "))n=Array.from(a.querySelectorAll(`tbody tr:not([data-filtered-by="${o}"])`)).length;else if(o.includes(" && ")){let l=o.split(" && ");n=Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).filter(function(t){let c=!0;for(const[h,u]of Object.entries(l)){let m=u.split(" == ");(!t.querySelector(`td[data-label="${m[0]}"]`)||t.querySelector(`td[data-label="${m[0]}"]`).textContent!=`${m[1]}`)&&(c=!1)}return c}).length}else{let l=o.split(" == ");n=Array.from(a.querySelectorAll(`tbody tr.filtered--matched td[data-label="${l[0]}"], tbody tr[data-filtered-by="${l[0]}"] td[data-label="${l[0]}"]`)).filter(function(t){return t.textContent===l[1]}).length}b.hasAttribute("data-total")?b.setAttribute("data-total",n):b.innerHTML=n})},Z=function(a,e,r,i){r.addEventListener("update-page",b=>{let d=e.querySelector("[data-pagination]"),o=b.detail.page;if(d.value=o,e.dispatchEvent(new Event("paginate")),i.setAttribute("data-page",o),a.hasAttribute("data-show-history")){const n=new URL(location);n.searchParams.set("page",o),history.pushState({type:"pagination",form:e.getAttribute("id"),page:o},"",n)}if(!i.hasAttribute("data-no-scroll")){const l=a.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:l,behavior:"smooth"})}}),r.addEventListener("update-show",b=>{let d=e.querySelector("[data-show]"),o=b.detail.show;d.value=o,i.setAttribute("data-show",o),e.dispatchEvent(new Event("submit"))})},tt=(a,e)=>{if(!a)return!1;a.addEventListener("click",r=>{et(e)})},et=function(a){for(var e=[],r=a.getElementsByTagName("tr"),i=0;i<r.length;i++){for(var b=r[i].querySelectorAll("td,th"),d=[],o=0;o<b.length;o++)d.push(`"${b[o].textContent}"`);e.push(d.join(","))}e=e.join(`
|
|
5
5
|
`);let n=new Blob([e],{type:"text/csv"});var l=document.createElement("a");l.download="export.csv";var t=window.URL.createObjectURL(n);l.href=t,l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},I=function(a,e,r,i){if(R(a),G(a,i),_(a,e,i),i&&i.classList.contains("table--cta")){let d=function(){Array.from(a.querySelectorAll("tr")).forEach((o,n)=>{let l=o.offsetHeight;o.style.setProperty("--row-height",`${l}px`)})};const b=J(a);i.style.setProperty("--cta-width",`${b}rem`),new ResizeObserver(d).observe(a)}},P=function(a){let e=new Object;return Array.from(a.querySelectorAll("[data-filter]")).forEach((i,b)=>{if(!(i.type=="radio"&&!i.checked)&&!(i.type=="checkbox"&&!i.checked)&&i&&i.value){let d=i.getAttribute("data-filter");e[d]||(e[d]=new Array),e[d].push(i.value)}}),e},z=function(a,e,r,i){return Y(this,void 0,void 0,function*(){let b=new FormData(e),d=new URLSearchParams(b).toString(),o=a.querySelectorAll("thead tr th:not(.expand-button-heading)"),n=a.querySelector("tbody"),l=e.getAttribute("data-ajax");i.classList.add("table--loading");let t=P(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((u,m)=>{u.innerHTML="",u.parentNode.classList.remove("hover")});let c=0;Object.values(t).forEach((u,m)=>{typeof u=="object"&&Object.values(u).length?c+=Object.values(u).length:c++}),c&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((u,m)=>{u.innerHTML+=`(${c})`,u.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[l]&&window.controller[l].abort(),window.controller[l]=new AbortController;const{signal:h}=controller[l];r.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(l+"?"+d,{signal:h,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(u=>u.json()).then(u=>{let m=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",s=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",g=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",x=k(u,s,15),S=k(u,g,1),q=k(u,m),E=i.hasAttribute("data-empty-msg")?i.getAttribute("data-empty-msg"):"No results found";q?(n.innerHTML="",q.forEach((v,f)=>{var y=document.createElement("tr");o.forEach((p,w)=>{let A="";var L=document.createElement("td");if(L.setAttribute("data-label",p.innerText),p.getAttribute("data-output")){var $=p.getAttribute("data-output");A=$.replace(new RegExp(/{(.*?)}/,"gm"),function(D){return k(v,D.replace("{","").replace("}",""))})}if(p.hasAttribute("data-output-array")){var $=p.getAttribute("data-output");let F=k(v,$.replace("{","").replace("}",""));A="",F.forEach((j,it)=>{let W=p.getAttribute("data-output-array"),T="";if(p.hasAttribute("data-output-array-property")&&p.hasAttribute("data-output-array-transform")){const H=k(j,p.getAttribute("data-output-array-property")),U=JSON.parse(p.getAttribute("data-output-array-transform"))[H];T=W.replace(`{${p.getAttribute("data-output-array-property")}}`,U)}T=T.replace(new RegExp(/{(.*?)}/,"gm"),function(H){return k(j,H.replace("{","").replace("}",""))}),A+=T})}p.hasAttribute("data-transform")&&(A=JSON.parse(p.getAttribute("data-transform"))[A],!A&&p.hasAttribute("data-default")&&(A=p.getAttribute("data-default"))),L.innerHTML=A,y.appendChild(L)}),n.appendChild(y)}),N(a,e),i.setAttribute("data-total",parseInt(x)),i.setAttribute("data-page",parseInt(S)),I(a,e,r,i),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((v,f)=>{let y=k(u,v.getAttribute("data-ajax-query"),"");v.hasAttribute("data-total")?v.setAttribute("data-total",y):v.innerHTML=y}),parseInt(x)==0&&(n.innerHTML=`<tr><td colspan="100%"><span>${E}</span></td></tr>`),i.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:l,formData:d})):n.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',r.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(u){console.log(u)}})},M=(a,e)=>{switch(a){case"datetime":return new Date(e).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(e).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(e).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return e=X(e)}};class at extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const d=function(t){t.querySelectorAll(":scope > details");const o=t.querySelectorAll(":scope > details, :scope > a");t.querySelectorAll(":scope > details > summary");let a=t.querySelector(":scope > .tabs__links");if(t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(a=t.shadowRoot.querySelector(".tabs__links")),!a){a=document.createElement("div"),a.classList.add("tabs__links");let e=document.createElement("div");e.classList.add("tabs__links__wrapper"),e.prepend(a),t.prepend(e)}let i=0;o.forEach((e,r)=>{let n=document.createElement("button");if(e.matches("details")){let s=e.querySelector(":scope > summary"),l=s.classList.contains("disabled");s.classList.add("visually-hidden"),e.hasAttribute("id")&&n.setAttribute("data-id",`${e.getAttribute("id")}`),e.hasAttribute("open")&&n.setAttribute("aria-pressed",!0),n.innerHTML=`${s.innerText}`,n.classList.add("link"),n.setAttribute("data-index",i),e.setAttribute("tabindex","-1"),l&&n.classList.add("disabled"),i++}else e.matches("a")&&(n=e);n.classList.add("link"),a.appendChild(n)})},c=function(t){let o=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > details > summary"),i=t.querySelectorAll(":scope .tabs__links > button");t.shadowRoot&&(i=t.shadowRoot.querySelectorAll(".tabs__links > button")),i.forEach(e=>{e.addEventListener("click",r=>{if(r.preventDefault(),e.classList.contains("disabled"))return!1;i.forEach(n=>{let s=n==e;n.setAttribute("aria-pressed",s)}),o.forEach((n,s)=>{let l=e.getAttribute("data-index")==s;l?n.setAttribute("open",l):n.removeAttribute("open")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:e.textContent})})}),a.forEach((e,r)=>{e.addEventListener("click",n=>{n.preventDefault(),i[r].click()})})},p=function(t){if(!t.querySelector(":scope > details"))return!1;let o=t.querySelectorAll(":scope > details"),a=t.shadowRoot.querySelectorAll(".tabs__links > button");location.hash&&t.shadowRoot.querySelector(`.tabs__links [data-id="${location.hash.replace("#","")}"]`)?(t.shadowRoot.querySelector(`[data-id="${location.hash.replace("#","")}"]`).setAttribute("aria-pressed",!0),t.querySelector(`details[id="${location.hash.replace("#","")}"]`).setAttribute("open",!0)):t.querySelector("details[open]")||(o[0].setAttribute("open",!0),a[0].setAttribute("aria-pressed",!0))},b=function(t){d(t),c(t),p(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class u extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|
package/assets/js/dynamic.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/(function(h){typeof define=="function"&&define.amd?define(h):h()})(function(){"use strict";const h=t=>(t.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&t.classList.add("ie"),null),L=t=>{const i=function(e){const a=document.querySelector(`label[for="${e.replace("#","")}"]`),o=document.querySelector(e+" summary"),r=document.querySelector(`dialog${e}`),s=document.querySelector(`detail${e}`);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",e=>{if(e&&e.state&&e.state.type&&e.state.type=="pagination"){let a=document.querySelector(`#${e.state.form}`),o=document.querySelector(`#${e.state.form} [data-pagination]`);o?o.value=e.state.page:a.innerHTML+=`<input name="page" type="hidden" data-pagination="true" value="${e.state.page}" />`,a.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",e=>{if(e&&e.target instanceof HTMLElement&&e.target.matches("form")){let a=e.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"),e.preventDefault())}}),document.addEventListener("keydown",e=>{e.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(e.preventDefault(),e.stopPropagation())}),null};class S{constructor(i){document.body.classList.contains("youtubeLoaded")?i.addEventListener("click",function(e){for(var a=e.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){e.preventDefault(),y(a);break}},!1):this.loadScripts(i,this.createEmbed)}loadScripts(i){return new Promise((e,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"),e(!0),r.onload=()=>{i.addEventListener("click",function(n){console.log("click"),n&&n.target instanceof HTMLElement&&n.target.closest("a")&&(n.preventDefault(),y(n.target.closest("a")))},!1)}},o.onerror=function(){a(!1)},o.src="https://youtube.com/favicon.ico"})}}const y=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var i=t.getAttribute("data-id"),e=t.getAttribute("id");if(typeof e>"u"||e==null){var a=String.fromCharCode(65+Math.floor(Math.random()*26));e=a+Date.now(),t.setAttribute("id",e)}function o(){window.player=new YT.Player(e,{height:"100%",width:"100%",videoId:i,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:r,onStateChange:n}})}o();function r(l){l.target.playVideo()}var s=!1;function n(l){if(l.data==YT.PlayerState.PLAYING&&!s){var c=document.getElementById(e);c.classList.add("player-ready"),s=!0}}},E=t=>(Array.from(t.querySelectorAll("dialog[open]")).forEach((i,e)=>{i.closest(".dialog__wrapper")||(i.removeAttribute("open"),i.showModal(),i.focus(),w(i))}),t.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}`);w(s),s.showModal(),s.focus();let n=s.offsetWidth;s.setAttribute("style",`max-width: ${n}px;`),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((l,c)=>{const d=l.getAttribute("data-duplicate"),u=document.getElementById(d);if(l.checked!=u.checked){l.checked=u.checked;let f=new Event("change");l.dispatchEvent(f)}}),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((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('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 e=window.getComputedStyle(o);if(e.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('input[type="radio"]')||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=i.target.closest(".dialog__wrapper > button").parentNode,s="openPopover",n=r.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=n&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,f)=>{u.removeAttribute("aria-expanded")}),n.hasAttribute("open"))n.close(),s="closePopover",n.removeAttribute("style"),o.removeAttribute("aria-expanded");else{n.show(),o.setAttribute("aria-expanded",!0);var a=o.getBoundingClientRect();let u=a.top,f=a.left;if(o.closest("iam-table")){let m=o.closest("iam-table").parentNode.getBoundingClientRect();u-=m.top,f-=m.left}n.classList.contains("dialog--fix")&&n.setAttribute("style",`position:fixed;top: ${u}px; left: ${f}px; margin: 3rem 0 0 0;`)}let l=n.getBoundingClientRect(),c=l.bottom-window.scrollY,d=window.innerHeight-window.scrollY;if(c>d){let u=n.hasAttribute("style")?n.getAttribute("style")+" ":"";n.setAttribute("style",u+"transform: translate(0, calc(-100% - 4rem))"),l=n.getBoundingClientRect(),l.top-window.scrollY<100&&n.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),w=t=>{let i=t.querySelector(".youtube-embed a");if(i&&y(i),t.classList.contains("dialog--multi")&&!t.querySelector(":scope > .steps")&&q(t),!t.querySelector(":scope > .mh-lg")&&!t.classList.contains("dialog--multi")){t.innerHTML=`<div class="mh-lg">${t.innerHTML}</div>`;let e=t.querySelector(".mh-lg"),a=t.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){let o=a.previousSibling;e.before(a),o&&a.before(o)}}t.querySelector(":scope > button:first-child")||t.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},q=t=>{let i="",e=Array.from(t.querySelectorAll("fieldset[data-title]")),a=t.querySelector("form");e.forEach((s,n)=>{i+=`<button data-title="${s.getAttribute("data-title")}" type="button" class="${n==0?"active":""}" tabindex="-1">${s.getAttribute("data-title")}</button>`;const l=document.createElement("div");if(l.classList.add("btn--wrapper"),s.appendChild(l),n!=0&&(l.innerHTML+=`<button data-title="${e[n-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),n!=e.length-1&&(l.innerHTML+=`<button data-title="${e[n+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),n==e.length-1)if(a&&a.querySelector(':scope > button[type="submit"]')){let c=a.querySelector(':scope > button[type="submit"]');c.classList.add("mb-0"),l.insertAdjacentElement("beforeend",c)}else l.innerHTML+=`<button data-title="${e[n].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),t.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${i}</div>`);let o=Array.from(t.querySelectorAll("fieldset.was-validated"));for(let s=0;s<o.length;s++){let n=o[s],l=n.getAttribute("data-title");if(n.querySelector(".is-invalid")){Array.from(t.querySelectorAll(`[data-title="${l}"]`)).forEach((c,d)=>{c.classList.add("active")});break}else Array.from(t.querySelectorAll(`[data-title="${l}"]`)).forEach((c,d)=>{c.classList.add("valid")})}t.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function r(s){const n=t.querySelector("fieldset.active")?t.querySelector("fieldset.active"):t.querySelector("fieldset[data-title]"),l=n.getAttribute("data-title");let c=!0;if(n.classList.add("was-validated"),Array.from(n.querySelectorAll("input")).forEach((f,m)=>{f.checkValidity()||(c=!1)}),c?Array.from(t.querySelectorAll(`[data-title="${l}"]`)).forEach((f,m)=>{f.classList.add("valid")}):Array.from(t.querySelectorAll(`[data-title="${l}"]`)).forEach((f,m)=>{f.classList.remove("valid")}),c||!s.hasAttribute("data-next")){const f=t.querySelector(`fieldset[data-title="${s.getAttribute("data-title")}"]`),m=t.querySelector(`.steps button[data-title="${s.getAttribute("data-title")}"]`);Array.from(t.querySelectorAll("button")).forEach((A,Y)=>{A.classList.remove("active")}),Array.from(t.querySelectorAll("fieldset")).forEach((A,Y)=>{A.classList.remove("active")}),m.classList.add("active"),f.classList.add("active")}let d=Array.from(t.querySelectorAll("fieldset")).length,u=Array.from(t.querySelectorAll("fieldset.valid")).length;t.style.setProperty("--progress",`${u/(d-1)*100}%`)}t.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){const n=s.target.closest("button");s.keyCode==13&&n.getAttribute("type")!="submit"&&(s.preventDefault(),r(n))}s&&s.target instanceof HTMLElement&&s.target.closest("input")&&(s.target.closest("input").classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault())}),t.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 n=s.target.closest("button[data-title]");r(n)}return null})};function x(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",t=>{const i=t.target.closest("[open] summary");if(i)window.dataLayer.push({event:"closeDetails",detailsTitle:i.textContent||""});else{const e=t.target.closest("summary"),a=t.target.closest("a"),o=t.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")||""}),o&&window.dataLayer.push({event:"buttonClicked",buttonText:o.textContent||"",class:o.hasAttribute("class")&&o.getAttribute("class")||""})}})}function k(t){var i=new TextEncoder("utf-8").encode(t);return crypto.subtle.digest("SHA-1",i).then(function(e){for(var a=[],o=new DataView(e),r=0;r<o.byteLength;r+=4){var s=o.getUint32(r),n=s.toString(16),l="00000000",c=(l+n).slice(-l.length);a.push(c)}return a.join("")})}const T=(t,i)=>{k(t).then(function(e){const a=new XMLHttpRequest;a.addEventListener("load",function(){const o=this.responseText.split(`
|
|
5
5
|
`),r=e.slice(5).toUpperCase();var s=!1;for(let l in o)if(o[l].substring(0,35)==r){s=!0;break}const n=new CustomEvent("hibpCheck",{detail:s});i.dispatchEvent(n)}),a.open("GET","https://api.pwnedpasswords.com/range/"+e.substr(0,5)),a.send()})},M=t=>{function i(){if(Array.from(document.querySelectorAll("input[maxlength]")).forEach((e,a)=>{e.parentElement,$(e)}),Array.from(document.querySelectorAll("label input")).forEach((e,a)=>{!e.closest("label").querySelector(".optional-text")&&!e.hasAttribute("required")&&e.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"),n=String(o.getDate()).padStart(2,"0");return`${r}-${s}-${n}`};const e=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((o,r)=>{let s=e;if(o.hasAttribute("data-start")&&(s.setDate(s.getDate()+parseInt(o.getAttribute("data-start"))),o.setAttribute("min",a(s))),o.hasAttribute("data-period")){let n=parseInt(o.getAttribute("data-period")),l=new Date;l.setDate(s.getDate()+n),o.setAttribute("max",a(l))}if(o.hasAttribute("data-allowed-days")){let n=JSON.parse(`[${o.getAttribute("data-allowed-days")}]`);o.addEventListener("input",function(l){var c=new Date(this.value).getUTCDay();n.includes(c)?o.setCustomValidity(""):o.setCustomValidity("That day of the week is not allowed")})}})}}document.readyState==="complete"&&i(),document.onreadystatechange=()=>{document.readyState==="complete"&&i()},t.addEventListener("input",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("input,textarea,select")){const 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")&&p(a)}}),t.addEventListener("change",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("select")){const a=e.target.closest("select");if(a.hasAttribute("data-change-type")&&a.hasAttribute("data-input")){const o=document.getElementById(a.getAttribute("data-input")),r=a.value;v(o,r)}}if(e&&e.target instanceof HTMLElement&&e.target.closest('dialog [type="radio"]')){const a=e.target.closest("dialog");e.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)})}}),t.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-change-type][data-input]:not(select)")){const a=e.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")),v(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)}}})},$=t=>{let i=t.parentElement,e=t.getAttribute("maxlength");i.style.setProperty("--maxlength",e);let a=t.nextElementSibling;(!a||a&&a.classList.contains("invalid-feedback"))&&(a=document.createElement("span"),i.insertBefore(a,t.nextSibling)),a.setAttribute("data-count",t.value.length)},v=(t,i)=>{t.hasAttribute("type")&&t.getAttribute("type")=="password"&&t.setAttribute("data-password-type",!0),t.setAttribute("type",i)},p=(t,i="no")=>{const e=document.getElementById(t.getAttribute("data-strength-checker")),a=t.value,o=t.hasAttribute("minlength")?t.getAttribute("minlength"):12;let r=1,s=["Very weak","Weak","Average","Strong","Very strong"],n="";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,n=`(must be at least ${o} characters.)`),r>=3&&i=="no"){let l=function(c,d){c.detail?p(d,"danger"):p(d,"success"),d.removeEventListener("hibpCheck",l)};T(a,t),t.addEventListener("hibpCheck",function(c){l(c,t)})}else r>=3&&i=="danger"&&(r=3,n="(this password is very common)");e&&(r<=3?e.classList.add("invalid-feedback"):e.classList.remove("invalid-feedback"),e.setAttribute("data-strength",r),e.innerHTML=`Password strength: ${s[r-1]} ${n}`)},_=t=>{Array.from(t.querySelectorAll("details")).forEach((i,e)=>{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(([e])=>e.target.classList.toggle("is-stuck",e.intersectionRatio<1),{threshold:[1]}).observe(t)};function C(t){var i;const e=t.querySelector(".testimonial__images"),a=e.querySelectorAll("img").length;if(a==1)return!1;t.classList.add("testimonial--multi");const o=function(r){const s=t.querySelector(".btn-next"),n=t.querySelector(".btn-prev");s.setAttribute("data-go",r+1),n.setAttribute("data-go",r-1),s.removeAttribute("disabled"),n.removeAttribute("disabled"),r==1?n.setAttribute("disabled",!0):r==a&&s.setAttribute("disabled",!0)};e.addEventListener("scroll",function(r){clearTimeout(i),i=setTimeout(function(){let s=e.scrollWidth,n=e.scrollHeight,l=e.scrollLeft,c=e.scrollTop,d=Math.round(l/s*a)+1;l==0&&c!=0&&(d=Math.round(c/n*a)+1),t.setAttribute("data-show",d),o(d)},300)},!1),t.addEventListener("click",function(r){for(var s=r.target;s&&s!=this;s=s.parentNode)if(s.matches("[data-go]")){let n=parseInt(s.getAttribute("data-go")),l=0,c=0,d=e.scrollWidth,u=e.scrollHeight;d>u?c=Math.floor(d*((n-1)/a)):l=Math.floor(u*((n-1)/a)),e.scroll({top:l,left:c,behavior:"smooth"});break}},!1)}function H(t,i){var e;let a=t.querySelector(".carousel__inner"),o=t.querySelector(".carousel__controls"),r=i.querySelectorAll(".col").length;a.addEventListener("scroll",function(s){clearTimeout(e),e=setTimeout(function(){let n=a.clientWidth,l=a.scrollWidth,c=a.scrollLeft,d=Math.round(c/l*r)+1,u=i.querySelector(".col:last-child").offsetLeft+50;a.scrollLeft+n>=u&&(d=r),Array.from(t.querySelectorAll(".carousel__controls button")).forEach((f,m)=>{f.removeAttribute("aria-current")}),t.querySelector(".control-"+d).setAttribute("aria-current",!0),d==1?t.querySelector(".btn-prev").setAttribute("disabled","disabled"):t.querySelector(".btn-prev").removeAttribute("disabled"),d==r?t.querySelector(".btn-next").setAttribute("disabled","disabled"):t.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),o.addEventListener("click",function(s){for(var n=s.target;n&&n!=this;n=n.parentNode)if(typeof n.matches=="function"&&n.matches("button")){s.preventDefault(),Array.from(o.querySelectorAll("button")).forEach((c,d)=>{c.removeAttribute("aria-current")}),n.setAttribute("aria-current",!0);const l=i.querySelector(`*:nth-child(${n.getAttribute("data-slide")})`);a.scroll({top:0,left:l.offsetLeft,behavior:"smooth"});break}},!1),t.addEventListener("click",function(s){for(var n=s.target;n&&n!=this;n=n.parentNode)if(typeof n.matches=="function"&&n.matches(".btn-next, .btn-prev")){s.preventDefault();let l=n.classList.contains("btn-prev")?a.scrollLeft-a.clientWidth:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:l,behavior:"smooth"});break}},!1)}function D(t){t.addEventListener("change",function(i){var e=parseInt(t.querySelector("[data-min] select,[data-min] input").value),a=parseInt(t.querySelector("[data-max] select,[data-max] input").value);Array.from(t.querySelectorAll("[data-min] input")).forEach((o,r)=>{o.setAttribute("max",a)}),Array.from(t.querySelectorAll("[data-max] input")).forEach((o,r)=>{o.setAttribute("min",e)}),Array.from(t.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(t.querySelectorAll("[data-max] select option")).forEach((o,r)=>{parseInt(o.getAttribute("value"))<e?o.classList.add("d-none"):o.classList.remove("d-none")})},!1)}function I(t){t.addEventListener("change",function(i){if(t.matches("[data-value-if]")){const e=t.getAttribute("data-redirect"),a=t.getAttribute("data-value-if");t.value==a&&(document.location.href=e)}else typeof t.value<"u"&&(document.location.href=t.value)},!1)}function B(t){const e=t.querySelector(".row").cloneNode(!0),a=t.querySelector("[data-add]");t.addEventListener("click",function(o){for(var r=o.target;r&&r!=this;r=r.parentNode){if(r.matches("[data-add]")){const s=e.cloneNode(!0);t.insertBefore(s,r),a.matches("[data-maxfiles]")&&Array.from(t.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(t.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}},!1)}function N(t){Array.from(t.querySelectorAll("[data-input-range]")).forEach((i,e)=>{D(i)}),Array.from(t.querySelectorAll("[data-redirect]")).forEach((i,e)=>{I(i)}),Array.from(t.querySelectorAll(".multiple-file-uploads")).forEach((i,e)=>{B(i)}),t.addEventListener("change",function(i){for(var e=i.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){const a=e.dataset.filesize;e.files[0].size>a&&(e.value="",alert("File too large"));break}},!1),t.addEventListener("change",function(i){Array.from(t.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,a)=>{let o=e.closest("[data-group]")?e.closest("[data-group]"):t,r=e.dataset.activeif,s=e.dataset.equals;o.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(t.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,a)=>{let o=e.closest("[data-group]")?e.closest("[data-group]"):t,r=e.dataset.activeif,s=e.dataset.equals;o.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}function P(t){if(t.hasAttribute("data-type")&&t.getAttribute("data-type")=="toast"){let e=document.querySelector(".notification__holder");e||(e=document.createElement("div"),e.classList.add("notification__holder"),e.classList.add("container"),document.querySelector("body").appendChild(e)),t.closest(".notification__holder")||e.appendChild(t)}if(t.setAttribute("role","alert"),t.addEventListener("click",function(e){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(e.preventDefault(),g(t))},!1),t.hasAttribute("data-timeout")){let e=t.getAttribute("data-timeout");var i=new R(function(){g(t)},e);t.addEventListener("mouseenter",a=>{i.pause()}),t.addEventListener("mouseleave",a=>{i.resume()})}}function R(t,i){var e,a,o=i;this.pause=function(){window.clearTimeout(e),o-=new Date-a},this.resume=function(){a=new Date,window.clearTimeout(e),e=window.setTimeout(t,o)},this.resume()}const g=function(t){t.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class V extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=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"):`${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((n,l)=>{n.setAttribute("slot","btns"),n.classList.add("link")}),(r.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const s=document.createElement("template");s.innerHTML=`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.5.
|
|
2
|
+
* iamKey v5.5.1-beta-1
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/(function(_){typeof define=="function"&&define.amd?define(_):_()})(function(){"use strict";var _=r=>(r.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&r.classList.add("ie"),null),it=r=>{var t=function(e){var i=document.querySelector('label[for="'.concat(e.replace("#",""),'"]')),c=document.querySelector(e+" summary"),o=document.querySelector("dialog".concat(e)),n=document.querySelector("detail".concat(e));i instanceof HTMLElement?i.click():c instanceof HTMLElement?c.click():o instanceof HTMLElement?o.showModal():n instanceof HTMLElement&&n.addAttribute("open")};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",a=>{if(a&&a.state&&a.state.type&&a.state.type=="pagination"){var e=document.querySelector("#".concat(a.state.form)),i=document.querySelector("#".concat(a.state.form," [data-pagination]"));i?i.value=a.state.page:e.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(a.state.page,'" />'),e.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",a=>{if(a&&a.target instanceof HTMLElement&&a.target.matches("form")){var e=a.target;Array.from(e.querySelectorAll("[data-password-type]")).forEach((i,c)=>{i.setAttribute("type","password")}),(e.querySelector(":invalid")||e.querySelector('.pwd-checker[data-strength="1"]')||e.querySelector('.pwd-checker[data-strength="2"]'))&&(e.classList.add("was-validated"),a.preventDefault())}}),document.addEventListener("keydown",a=>{a.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(a.preventDefault(),a.stopPropagation())}),null},st=function(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))},ot=(r,t)=>String(r).padStart(t,"0"),nt=r=>r.charAt(0).toUpperCase()+r.slice(1),T=(r,t,a)=>t.split(/[\.\[\]\'\"]/).filter(e=>e).reduce((e,i)=>e?e[i]:a,r);class ct{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",function(a){for(var e=a.target;e&&e!=this;e=e.parentNode)if(e.matches("a")){a.preventDefault(),U(e);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((a,e)=>{var i=new Image;i.onload=function(){var c=document.createElement("script");c.src="https://www.youtube.com/iframe_api";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(c,o),document.body.classList.add("youtubeLoaded"),a(!0),c.onload=()=>{t.addEventListener("click",function(n){console.log("click"),n&&n.target instanceof HTMLElement&&n.target.closest("a")&&(n.preventDefault(),U(n.target.closest("a")))},!1)}},i.onerror=function(){e(!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 a=t.getAttribute("data-id"),e=t.getAttribute("id");if(typeof e>"u"||e==null){var i=String.fromCharCode(65+Math.floor(Math.random()*26));e=i+Date.now(),t.setAttribute("id",e)}function c(){window.player=new YT.Player(e,{height:"100%",width:"100%",videoId:a,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:o,onStateChange:d}})}c();function o(s){s.target.playVideo()}var n=!1;function d(s){if(s.data==YT.PlayerState.PLAYING&&!n){var l=document.getElementById(e);l.classList.add("player-ready"),n=!0}}},dt=r=>(Array.from(r.querySelectorAll("dialog[open]")).forEach((t,a)=>{var e=t.closest(".dialog__wrapper");e||(t.removeAttribute("open"),t.showModal(),t.focus(),J(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 a=t.target.closest("[data-modal]"),e=a.hasAttribute("data-modal")?a.getAttribute("data-modal"):a.getAttribute("data-filter"),i=document.querySelector("dialog#".concat(e));J(i),i.showModal(),i.focus();var c=i.offsetWidth;i.setAttribute("style","max-width: ".concat(c,"px;")),Array.from(i.querySelectorAll("[data-duplicate]")).forEach((v,x)=>{var L=v.getAttribute("data-duplicate"),E=document.getElementById(L);if(v.checked!=E.checked){v.checked=E.checked;var C=new Event("change");v.dispatchEvent(C)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:e})}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((v,x)=>{v.classList.remove("active")}),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 n=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((v,x)=>{v.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:n.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var d=t.target.closest("dialog[open]"),s=window.getComputedStyle(d);if(s.display==="contents"&&(d=d.parentNode.closest("dialog[open]")),!d.classList.contains("dialog--transactional")&&!d.classList.contains("dialog--acknowledgement")){var l=d.getBoundingClientRect();(t.clientX<l.left||t.clientX>l.right||t.clientY<l.top||t.clientY>l.bottom)&&(t.target.closest('input[type="radio"]')||d.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:d.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){t.stopPropagation();var u=t.target.closest(".dialog__wrapper > button"),f=t.target.closest(".dialog__wrapper > button").parentNode,m="openPopover",h=f.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=h&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((v,x)=>{v.removeAttribute("aria-expanded")}),h.hasAttribute("open"))h.close(),m="closePopover",h.removeAttribute("style"),u.removeAttribute("aria-expanded");else{h.show(),u.setAttribute("aria-expanded",!0);var b=u.getBoundingClientRect(),p=b.top,g=b.left;if(u.closest("iam-table")){var w=u.closest("iam-table").parentNode.getBoundingClientRect();p-=w.top,g-=w.left}h.classList.contains("dialog--fix")&&h.setAttribute("style","position:fixed;top: ".concat(p,"px; left: ").concat(g,"px; margin: 3rem 0 0 0;"))}var A=h.getBoundingClientRect(),y=A.bottom-window.scrollY,S=window.innerHeight-window.scrollY;if(y>S){var k=h.hasAttribute("style")?h.getAttribute("style")+" ":"";h.setAttribute("style",k+"transform: translate(0, calc(-100% - 4rem))"),A=h.getBoundingClientRect();var q=A.top-window.scrollY;q<100&&h.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:m,id:u.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((v,x)=>{v.removeAttribute("aria-expanded")}))}),null),J=r=>{var t=r.querySelector(".youtube-embed a");if(t&&U(t),r.classList.contains("dialog--multi")&&!r.querySelector(":scope > .steps")&<(r),!r.querySelector(":scope > .mh-lg")&&!r.classList.contains("dialog--multi")){r.innerHTML='<div class="mh-lg">'.concat(r.innerHTML,"</div>");var a=r.querySelector(".mh-lg"),e=r.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(e){var i=e.previousSibling;a.before(e),i&&e.before(i)}}r.querySelector(":scope > button:first-child")||r.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},lt=r=>{var t="",a=Array.from(r.querySelectorAll("fieldset[data-title]")),e=r.querySelector("form");a.forEach((s,l)=>{t+='<button data-title="'.concat(s.getAttribute("data-title"),'" type="button" class="').concat(l==0?"active":"",'" tabindex="-1">').concat(s.getAttribute("data-title"),"</button>");var u=document.createElement("div");if(u.classList.add("btn--wrapper"),s.appendChild(u),l!=0&&(u.innerHTML+='<button data-title="'.concat(a[l-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>')),l!=a.length-1&&(u.innerHTML+='<button data-title="'.concat(a[l+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="button">Next</button>')),l==a.length-1)if(e&&e.querySelector(':scope > button[type="submit"]')){var f=e.querySelector(':scope > button[type="submit"]');f.classList.add("mb-0"),u.insertAdjacentElement("beforeend",f)}else u.innerHTML+='<button data-title="'.concat(a[l].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")),c=0;c<i.length;c++){var o=i[c],n=o.getAttribute("data-title");if(o.querySelector(".is-invalid")){Array.from(r.querySelectorAll('[data-title="'.concat(n,'"]'))).forEach((s,l)=>{s.classList.add("active")});break}else Array.from(r.querySelectorAll('[data-title="'.concat(n,'"]'))).forEach((s,l)=>{s.classList.add("valid")})}r.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function d(s){var l=r.querySelector("fieldset.active")?r.querySelector("fieldset.active"):r.querySelector("fieldset[data-title]"),u=l.getAttribute("data-title"),f=!0;if(l.classList.add("was-validated"),Array.from(l.querySelectorAll("input")).forEach((g,w)=>{g.checkValidity()||(f=!1)}),f?Array.from(r.querySelectorAll('[data-title="'.concat(u,'"]'))).forEach((g,w)=>{g.classList.add("valid")}):Array.from(r.querySelectorAll('[data-title="'.concat(u,'"]'))).forEach((g,w)=>{g.classList.remove("valid")}),f||!s.hasAttribute("data-next")){var m=r.querySelector('fieldset[data-title="'.concat(s.getAttribute("data-title"),'"]')),h=r.querySelector('.steps button[data-title="'.concat(s.getAttribute("data-title"),'"]'));Array.from(r.querySelectorAll("button")).forEach((g,w)=>{g.classList.remove("active")}),Array.from(r.querySelectorAll("fieldset")).forEach((g,w)=>{g.classList.remove("active")}),h.classList.add("active"),m.classList.add("active")}var b=Array.from(r.querySelectorAll("fieldset")).length,p=Array.from(r.querySelectorAll("fieldset.valid")).length;r.style.setProperty("--progress","".concat(p/(b-1)*100,"%"))}r.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){var l=s.target.closest("button");s.keyCode==13&&l.getAttribute("type")!="submit"&&(s.preventDefault(),d(l))}if(s&&s.target instanceof HTMLElement&&s.target.closest("input")){var u=s.target.closest("input");u.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 l=s.target.closest("form");l.classList.add("was-validated")}else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){var u=s.target.closest("button[data-title]");d(u)}return null})};function ut(){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 a=r.target.closest("summary"),e=r.target.closest("a"),i=r.target.closest("button");a&&window.dataLayer.push({event:"openDetails",detailsTitle:a.textContent||""}),e&&window.dataLayer.push({event:"linkClicked",linkText:e.hasAttribute("title")?e.getAttribute("title")||"":e.textContent||"",class:e.hasAttribute("class")&&e.getAttribute("class")||"",href:e.getAttribute("href")||""}),i&&window.dataLayer.push({event:"buttonClicked",buttonText:i.textContent||"",class:i.hasAttribute("class")&&i.getAttribute("class")||""})}})}function ht(r){var t=new TextEncoder("utf-8").encode(r);return crypto.subtle.digest("SHA-1",t).then(function(a){for(var e=[],i=new DataView(a),c=0;c<i.byteLength;c+=4){var o=i.getUint32(c),n=o.toString(16),d="00000000",s=(d+n).slice(-d.length);e.push(s)}return e.join("")})}var ft=(r,t)=>{ht(r).then(function(a){var e=new XMLHttpRequest;e.addEventListener("load",function(){var i=this.responseText.split(`
|
|
5
5
|
`),c=a.slice(5).toUpperCase(),o=!1;for(var n in i)if(i[n].substring(0,35)==c){o=!0;break}var d=new CustomEvent("hibpCheck",{detail:o});t.dispatchEvent(d)}),e.open("GET","https://api.pwnedpasswords.com/range/"+a.substr(0,5)),e.send()})},mt=r=>{function t(){if(Array.from(document.querySelectorAll("input[maxlength]")).forEach((e,i)=>{e.parentElement,bt(e)}),Array.from(document.querySelectorAll("label input")).forEach((e,i)=>{!e.closest("label").querySelector(".optional-text")&&!e.hasAttribute("required")&&e.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>')}),document.querySelector('input[type="date"]')){let e=function(i){var c=i.getFullYear(),o=String(i.getMonth()+1).padStart(2,"0"),n=String(i.getDate()).padStart(2,"0");return"".concat(c,"-").concat(o,"-").concat(n)};var a=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((i,c)=>{var o=a;if(i.hasAttribute("data-start")&&(o.setDate(o.getDate()+parseInt(i.getAttribute("data-start"))),i.setAttribute("min",e(o))),i.hasAttribute("data-period")){var n=parseInt(i.getAttribute("data-period")),d=new Date;d.setDate(o.getDate()+n),i.setAttribute("max",e(d))}if(i.hasAttribute("data-allowed-days")){var s=JSON.parse("[".concat(i.getAttribute("data-allowed-days"),"]"));i.addEventListener("input",function(l){var u=new Date(this.value).getUTCDay();s.includes(u)?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",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("input,textarea,select")){var e=a.target.closest("input,textarea,select");e.parentElement,e.hasAttribute("type")&&e.getAttribute("type")=="color"&&(e.nextElementSibling.value=e.value),e.hasAttribute("maxlength")&&e.nextElementSibling&&e.nextElementSibling.setAttribute("data-count",e.value.length),e.hasAttribute("data-strength-checker")&&vt(e)}}),r.addEventListener("change",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("select")){var e=a.target.closest("select");if(e.hasAttribute("data-change-type")&&e.hasAttribute("data-input")){var i=document.getElementById(e.getAttribute("data-input")),c=e.value;Q(i,c)}}if(a&&a.target instanceof HTMLElement&&a.target.closest('dialog [type="radio"]')){var o=a.target.closest("dialog");a.target.closest('dialog [type="radio"]'),Array.from(o.querySelectorAll('[type="radio"][autofocus]')).forEach((n,d)=>{n.removeAttribute("autofocus")}),Array.from(o.querySelectorAll('[type="radio"]:checked')).forEach((n,d)=>{n.setAttribute("autofocus",!0)})}}),r.addEventListener("click",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-change-type][data-input]:not(select)")){var e=a.target.closest("[data-change-type]"),i=document.getElementById(e.getAttribute("data-input")),c=e.getAttribute("data-change-type");if(e.setAttribute("data-change-type",i.getAttribute("type")),Q(i,c),e.hasAttribute("data-alt-class")){var o=e.getAttribute("data-alt-class");e.setAttribute("data-alt-class",e.getAttribute("class")),e.setAttribute("class",o)}}})},bt=r=>{var t=r.parentElement,a=r.getAttribute("maxlength");t.style.setProperty("--maxlength",a);var e=r.nextElementSibling;(!e||e&&e.classList.contains("invalid-feedback"))&&(e=document.createElement("span"),t.insertBefore(e,r.nextSibling)),e.setAttribute("data-count",r.value.length)},Q=(r,t)=>{r.hasAttribute("type")&&r.getAttribute("type")=="password"&&r.setAttribute("data-password-type",!0),r.setAttribute("type",t)},vt=function r(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"no",e=document.getElementById(t.getAttribute("data-strength-checker")),i=t.value,c=t.hasAttribute("minlength")?t.getAttribute("minlength"):12,o=1,n=["Very weak","Weak","Average","Strong","Very strong"],d="";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<c&&(o=1,d="(must be at least ".concat(c," characters.)")),o>=3&&a=="no"){let s=function(l,u){l.detail?r(u,"danger"):r(u,"success"),u.removeEventListener("hibpCheck",s)};ft(i,t),t.addEventListener("hibpCheck",function(l){s(l,t)})}else o>=3&&a=="danger"&&(o=3,d="(this password is very common)");e&&(o<=3?e.classList.add("invalid-feedback"):e.classList.remove("invalid-feedback"),e.setAttribute("data-strength",o),e.innerHTML="Password strength: ".concat(n[o-1]," ").concat(d))},pt=r=>{if(Array.from(r.querySelectorAll("details")).forEach((a,e)=>{a.addEventListener("mouseenter",function(i){window.matchMedia("(min-width: 62em)").matches&&a.setAttribute("open","true")},!1),a.addEventListener("mouseleave",function(i){window.matchMedia("(min-width: 62em)").matches&&a.removeAttribute("open")},!1)}),"IntersectionObserver"in window){var t=new IntersectionObserver(a=>{var[e]=a;return e.target.classList.toggle("is-stuck",e.intersectionRatio<1)},{threshold:[1]});t.observe(r)}};function gt(r){var t,a=r.querySelector(".testimonial__images"),e=a.querySelectorAll("img").length;if(e==1)return!1;r.classList.add("testimonial--multi");var i=function(o){var n=r.querySelector(".btn-next"),d=r.querySelector(".btn-prev");n.setAttribute("data-go",o+1),d.setAttribute("data-go",o-1),n.removeAttribute("disabled"),d.removeAttribute("disabled"),o==1?d.setAttribute("disabled",!0):o==e&&n.setAttribute("disabled",!0)};a.addEventListener("scroll",function(c){clearTimeout(t),t=setTimeout(function(){var o=a.scrollWidth,n=a.scrollHeight,d=a.scrollLeft,s=a.scrollTop,l=Math.round(d/o*e)+1;d==0&&s!=0&&(l=Math.round(s/n*e)+1),r.setAttribute("data-show",l),i(l)},300)},!1),r.addEventListener("click",function(c){for(var o=c.target;o&&o!=this;o=o.parentNode)if(o.matches("[data-go]")){var n=parseInt(o.getAttribute("data-go")),d=0,s=0,l=a.scrollWidth,u=a.scrollHeight;l>u?s=Math.floor(l*((n-1)/e)):d=Math.floor(u*((n-1)/e)),a.scroll({top:d,left:s,behavior:"smooth"});break}},!1)}function yt(r,t){var a,e=r.querySelector(".carousel__inner"),i=r.querySelector(".carousel__controls"),c=t.querySelectorAll(".col").length;e.addEventListener("scroll",function(o){clearTimeout(a),a=setTimeout(function(){var n=e.clientWidth,d=e.scrollWidth,s=e.scrollLeft,l=Math.round(s/d*c)+1,u=t.querySelector(".col:last-child").offsetLeft+50;e.scrollLeft+n>=u&&(l=c),Array.from(r.querySelectorAll(".carousel__controls button")).forEach((f,m)=>{f.removeAttribute("aria-current")}),r.querySelector(".control-"+l).setAttribute("aria-current",!0),l==1?r.querySelector(".btn-prev").setAttribute("disabled","disabled"):r.querySelector(".btn-prev").removeAttribute("disabled"),l==c?r.querySelector(".btn-next").setAttribute("disabled","disabled"):r.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),i.addEventListener("click",function(o){for(var n=o.target;n&&n!=this;n=n.parentNode)if(typeof n.matches=="function"&&n.matches("button")){o.preventDefault(),Array.from(i.querySelectorAll("button")).forEach((s,l)=>{s.removeAttribute("aria-current")}),n.setAttribute("aria-current",!0);var d=t.querySelector("*:nth-child(".concat(n.getAttribute("data-slide"),")"));e.scroll({top:0,left:d.offsetLeft,behavior:"smooth"});break}},!1),r.addEventListener("click",function(o){for(var n=o.target;n&&n!=this;n=n.parentNode)if(typeof n.matches=="function"&&n.matches(".btn-next, .btn-prev")){o.preventDefault();var d=n.classList.contains("btn-prev")?e.scrollLeft-e.clientWidth:e.scrollLeft+e.clientWidth;e.scroll({top:0,left:d,behavior:"smooth"});break}},!1)}function At(r){r.addEventListener("change",function(t){var a=parseInt(r.querySelector("[data-min] select,[data-min] input").value),e=parseInt(r.querySelector("[data-max] select,[data-max] input").value);Array.from(r.querySelectorAll("[data-min] input")).forEach((i,c)=>{i.setAttribute("max",e)}),Array.from(r.querySelectorAll("[data-max] input")).forEach((i,c)=>{i.setAttribute("min",a)}),Array.from(r.querySelectorAll("[data-min] select option")).forEach((i,c)=>{parseInt(i.getAttribute("value"))>e?i.classList.add("d-none"):i.classList.remove("d-none")}),Array.from(r.querySelectorAll("[data-max] select option")).forEach((i,c)=>{parseInt(i.getAttribute("value"))<a?i.classList.add("d-none"):i.classList.remove("d-none")})},!1)}function wt(r){r.addEventListener("change",function(t){if(r.matches("[data-value-if]")){var a=r.getAttribute("data-redirect"),e=r.getAttribute("data-value-if");r.value==e&&(document.location.href=a)}else typeof r.value<"u"&&(document.location.href=r.value)},!1)}function Lt(r){var t=r.querySelector(".row"),a=t.cloneNode(!0),e=r.querySelector("[data-add]");r.addEventListener("click",function(i){for(var c=i.target;c&&c!=this;c=c.parentNode){if(c.matches("[data-add]")){var o=a.cloneNode(!0);r.insertBefore(o,c),e.matches("[data-maxfiles]")&&Array.from(r.querySelectorAll(":scope > .row")).length>=e.dataset.maxfiles&&e.setAttribute("disabled","disabled");break}if(c.matches("[data-delete]")){var n=c.closest(".row");n.remove(),e.matches("[data-maxfiles]")&&Array.from(r.querySelectorAll(":scope > .row")).length<e.dataset.maxfiles&&e.removeAttribute("disabled");break}}},!1)}function St(r){Array.from(r.querySelectorAll("[data-input-range]")).forEach((t,a)=>{At(t)}),Array.from(r.querySelectorAll("[data-redirect]")).forEach((t,a)=>{wt(t)}),Array.from(r.querySelectorAll(".multiple-file-uploads")).forEach((t,a)=>{Lt(t)}),r.addEventListener("change",function(t){for(var a=t.target;a&&a!=this;a=a.parentNode)if(a.matches('[type="file"][data-filesize]')&&a.files&&a.files[0]){var e=a.dataset.filesize;a.files[0].size>e&&(a.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((a,e)=>{var i=a.closest("[data-group]")?a.closest("[data-group]"):r,c=a.dataset.activeif,o=a.dataset.equals,n=i.querySelector('select[data-id="'.concat(c,'"],input[data-id="').concat(c,'"]'));n.value==o?a.removeAttribute("disabled"):(a.setAttribute("disabled","disabled"),a.value="")}),Array.from(r.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((a,e)=>{var i=a.closest("[data-group]")?a.closest("[data-group]"):r,c=a.dataset.activeif,o=a.dataset.equals,n=i.querySelector('select[data-id="'.concat(c,'"],input[data-id="').concat(c,'"]'));n.value==o?a.classList.remove("d-none"):a.classList.add("d-none")})},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class Et extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),e='@import "'.concat(t,'/css/components/header.css";'),i=document.createElement("template");i.innerHTML=`
|