@iamproperty/components 4.0.2 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * iamKey v4.0.2
2
+ * iamKey v4.0.4
3
3
  * Copyright 2022-2023 iamproperty
4
- */(function(N){typeof define=="function"&&define.amd?define(N):N()})(function(){"use strict";var N=a=>(a.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&a.classList.add("ie"),null),st=a=>{var t=function(r){var s=document.querySelector('label[for="'.concat(r.replace("#",""),'"]')),o=document.querySelector(r+" summary"),n=document.querySelector("dialog".concat(r));s instanceof HTMLElement?s.click():o instanceof HTMLElement?o.click():n instanceof HTMLElement&&n.showModal()};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state.type&&e.state.type=="pagination"){var r=document.querySelector("#".concat(e.state.form)),s=document.querySelector("#".concat(e.state.form," [data-pagination]"));s?s.value=e.state.page:r.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(e.state.page,'" />'),r.dispatchEvent(new Event("submit"))}}),null},it=function(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))},ot=(a,t)=>String(a).padStart(t,"0"),nt=a=>a.charAt(0).toUpperCase()+a.slice(1);class ct{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",function(e){for(var r=e.target;r&&r!=this;r=r.parentNode)if(r.matches("a")){e.preventDefault(),Y(r);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((e,r)=>{var s=new Image;s.onload=function(){var o=document.createElement("script");o.src="https://www.youtube.com/iframe_api";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(o,n),document.body.classList.add("youtubeLoaded"),e(!0),o.onload=()=>{t.addEventListener("click",function(c){console.log("click"),c&&c.target instanceof HTMLElement&&c.target.closest("a")&&(c.preventDefault(),Y(c.target.closest("a")))},!1)}},s.onerror=function(){r(!1)},s.src="https://youtube.com/favicon.ico"})}}var Y=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var e=t.getAttribute("data-id"),r=t.getAttribute("id");if(typeof r>"u"||r==null){var s=String.fromCharCode(65+Math.floor(Math.random()*26));r=s+Date.now(),t.setAttribute("id",r)}function o(){window.player=new YT.Player(r,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:n,onStateChange:u}})}o();function n(i){i.target.playVideo()}var c=!1;function u(i){if(i.data==YT.PlayerState.PLAYING&&!c){var l=document.getElementById(r);l.classList.add("player-ready"),c=!0}}},lt=a=>(Array.from(a.querySelectorAll("dialog[open]")).forEach((t,e)=>{var r=t.closest(".dialog__wrapper");r||(t.removeAttribute("open"),t.showModal(),t.focus(),Q(t))}),a.addEventListener("click",t=>{if(t.target.tagName=="IAM-ACTIONBAR")return!1;if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var e=t.target.closest("[data-modal]"),r=e.hasAttribute("data-modal")?e.getAttribute("data-modal"):e.getAttribute("data-filter"),s=document.querySelector("dialog#".concat(r));Q(s),s.showModal(),s.focus();var o=s.offsetWidth;s.setAttribute("style","max-width: ".concat(o,"px;")),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((y,A)=>{var T=y.getAttribute("data-duplicate"),S=document.getElementById(T);if(y.checked!=S.checked){y.checked=S.checked;var E=new Event("change");y.dispatchEvent(E)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var n=t.target.closest("dialog[open]");t.preventDefault(),n.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((y,A)=>{y.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('button[formmethod="dialog"]')){var c=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((y,A)=>{y.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:c.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var u=t.target.closest("dialog[open]"),i=window.getComputedStyle(u);if(i.display==="contents"&&(u=u.parentNode.closest("dialog[open]")),!u.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||u.classList.contains("dialog--multi")){var l=u.getBoundingClientRect();(t.clientX<l.left||t.clientX>l.right||t.clientY<l.top||t.clientY>l.bottom)&&(t.target.closest('input[type="radio"]')||u.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:u.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){t.stopPropagation();var f=t.target.closest(".dialog__wrapper > button"),h=t.target.closest(".dialog__wrapper > button").parentNode,b="openPopover",d=h.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=d&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((y,A)=>{y.classList.remove("active")}),d.hasAttribute("open"))d.close(),b="closePopover",d.removeAttribute("style"),f.classList.remove("active");else{d.show(),f.classList.add("active");var m=f.getBoundingClientRect(),v=m.top,p=m.left;if(f.closest("iam-table")){var L=f.closest("iam-table").parentNode.getBoundingClientRect();v-=L.top,p-=L.left}d.classList.contains("dialog--fix")&&d.setAttribute("style","position:fixed;top: ".concat(v,"px; left: ").concat(p,"px; margin: 3rem 0 0 0;"))}var w=d.getBoundingClientRect(),g=w.bottom-window.scrollY,k=window.innerHeight-window.scrollY;if(g>k){var q=d.hasAttribute("style")?d.getAttribute("style")+" ":"";d.setAttribute("style",q+"transform: translate(0, calc(-100% - 4rem))"),w=d.getBoundingClientRect();var x=w.top-window.scrollY;x<100&&d.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:b,id:f.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((y,A)=>{y.classList.remove("active")}))}),null),Q=a=>{a.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!a.classList.contains("dialog--multi")&&a.addEventListener("cancel",o=>{o.preventDefault()});var t=a.querySelector(".youtube-embed a");if(t&&Y(t),a.classList.contains("dialog--multi")&&!a.querySelector(":scope > .steps")&&dt(a),!a.querySelector(":scope > .mh-lg")&&!a.classList.contains("dialog--multi")){a.innerHTML='<div class="mh-lg">'.concat(a.innerHTML,"</div>");var e=a.querySelector(".mh-lg"),r=a.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(r){var s=r.previousSibling;e.before(r),s&&r.before(s)}}a.querySelector(":scope > button:first-child")||a.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},dt=a=>{var t="",e=Array.from(a.querySelectorAll("fieldset[data-title]")),r=a.querySelector("form");e.forEach((i,l)=>{t+='<button data-title="'.concat(i.getAttribute("data-title"),'" type="button" class="').concat(l==0?"active":"",'" tabindex="-1">').concat(i.getAttribute("data-title"),"</button>");var f=document.createElement("div");if(f.classList.add("btn--wrapper"),i.appendChild(f),l!=0&&(f.innerHTML+='<button data-title="'.concat(e[l-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>')),l!=e.length-1&&(f.innerHTML+='<button data-title="'.concat(e[l+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="button">Next</button>')),l==e.length-1)if(r&&r.querySelector(':scope > button[type="submit"]')){var h=r.querySelector(':scope > button[type="submit"]');h.classList.add("mb-0"),f.insertAdjacentElement("beforeend",h)}else f.innerHTML+='<button data-title="'.concat(e[l].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="submit">Submit</button>')}),a.insertAdjacentHTML("afterbegin",'<div class="steps bg-primary">'.concat(t,"</div>"));for(var s=Array.from(a.querySelectorAll("fieldset.was-validated")),o=0;o<s.length;o++){var n=s[o],c=n.getAttribute("data-title");if(n.querySelector(".is-invalid")){Array.from(a.querySelectorAll('[data-title="'.concat(c,'"]'))).forEach((i,l)=>{i.classList.add("active")});break}else Array.from(a.querySelectorAll('[data-title="'.concat(c,'"]'))).forEach((i,l)=>{i.classList.add("valid")})}a.addEventListener("invalid",function(){return function(i){i.preventDefault()}}(),!0);function u(i){var l=a.querySelector("fieldset.active")?a.querySelector("fieldset.active"):a.querySelector("fieldset[data-title]"),f=l.getAttribute("data-title"),h=!0;if(l.classList.add("was-validated"),Array.from(l.querySelectorAll("input")).forEach((p,L)=>{p.checkValidity()||(h=!1)}),h?Array.from(a.querySelectorAll('[data-title="'.concat(f,'"]'))).forEach((p,L)=>{p.classList.add("valid")}):Array.from(a.querySelectorAll('[data-title="'.concat(f,'"]'))).forEach((p,L)=>{p.classList.remove("valid")}),h||!i.hasAttribute("data-next")){var b=a.querySelector('fieldset[data-title="'.concat(i.getAttribute("data-title"),'"]')),d=a.querySelector('.steps button[data-title="'.concat(i.getAttribute("data-title"),'"]'));Array.from(a.querySelectorAll("button")).forEach((p,L)=>{p.classList.remove("active")}),Array.from(a.querySelectorAll("fieldset")).forEach((p,L)=>{p.classList.remove("active")}),d.classList.add("active"),b.classList.add("active")}var m=Array.from(a.querySelectorAll("fieldset")).length,v=Array.from(a.querySelectorAll("fieldset.valid")).length;a.style.setProperty("--progress","".concat(v/(m-1)*100,"%"))}a.addEventListener("keydown",i=>{if(i&&i.target instanceof HTMLElement&&i.target.closest("button")){var l=i.target.closest("button");i.keyCode==13&&l.getAttribute("type")!="submit"&&(i.preventDefault(),u(l))}if(i&&i.target instanceof HTMLElement&&i.target.closest("input")){var f=i.target.closest("input");f.classList.remove("is-invalid"),i.keyCode==13&&i.preventDefault()}}),a.addEventListener("click",i=>{if(i&&i.target instanceof HTMLElement&&i.target.closest('button[type="submit"]')){var l=i.target.closest("form");l.classList.add("was-validated")}else if(i&&i.target instanceof HTMLElement&&i.target.closest("button[data-title]")){var f=i.target.closest("button[data-title]");u(f)}return null})};function ut(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",a=>{var t=a.target.closest("[open] summary");if(t)window.dataLayer.push({event:"closeDetails",detailsTitle:t.textContent||""});else{var e=a.target.closest("summary"),r=a.target.closest("a"),s=a.target.closest("button");e&&window.dataLayer.push({event:"openDetails",detailsTitle:e.textContent||""}),r&&window.dataLayer.push({event:"linkClicked",linkText:r.hasAttribute("title")?r.getAttribute("title")||"":r.textContent||"",class:r.hasAttribute("class")&&r.getAttribute("class")||"",href:r.getAttribute("href")||""}),s&&window.dataLayer.push({event:"buttonClicked",buttonText:s.textContent||"",class:s.hasAttribute("class")&&s.getAttribute("class")||""})}})}var ht=a=>{document.addEventListener("load",function(){console.log(Array.from(document.querySelectorAll("input[maxlength]"))),Array.from(document.querySelectorAll("input")).forEach((t,e)=>{t.parentElement,ft(t)})}),a.addEventListener("input",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("input,textarea,select")){var e=t.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)}}),a.addEventListener("change",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("select")){var e=t.target.closest("select");if(console.log(e),e.hasAttribute("data-change-type")&&e.hasAttribute("data-input")){var r=document.getElementById(e.getAttribute("data-input")),s=e.value;J(r,s)}}if(t&&t.target instanceof HTMLElement&&t.target.closest('dialog [type="radio"]')){var o=t.target.closest("dialog");t.target.closest('dialog [type="radio"]'),Array.from(o.querySelectorAll('[type="radio"][autofocus]')).forEach((n,c)=>{n.removeAttribute("autofocus")}),Array.from(o.querySelectorAll('[type="radio"]:checked')).forEach((n,c)=>{n.setAttribute("autofocus",!0)})}}),a.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-change-type][data-input]:not(select)")){var e=t.target.closest("[data-change-type]"),r=document.getElementById(e.getAttribute("data-input")),s=e.getAttribute("data-change-type");if(e.setAttribute("data-change-type",r.getAttribute("type")),J(r,s),e.hasAttribute("data-alt-class")){var o=e.getAttribute("data-alt-class");e.setAttribute("data-alt-class",e.getAttribute("class")),e.setAttribute("class",o)}}})},ft=a=>{var t=a.parentElement,e=a.getAttribute("maxlength");t.style.setProperty("--maxlength",e);var r=a.nextElementSibling;(!r||r&&r.classList.contains("invalid-feedback"))&&(r=document.createElement("span"),t.insertBefore(r,a.nextSibling)),r.setAttribute("data-count",a.value.length)},J=(a,t)=>{a.setAttribute("type",t)},mt=a=>{if(Array.from(a.querySelectorAll("details")).forEach((e,r)=>{e.addEventListener("mouseenter",function(s){window.matchMedia("(min-width: 62em)").matches&&e.setAttribute("open","true")},!1),e.addEventListener("mouseleave",function(s){window.matchMedia("(min-width: 62em)").matches&&e.removeAttribute("open")},!1)}),"IntersectionObserver"in window){var t=new IntersectionObserver(e=>{var[r]=e;return r.target.classList.toggle("is-stuck",r.intersectionRatio<1)},{threshold:[1]});t.observe(a)}};function bt(a){var t,e=a.querySelector(".testimonial__images"),r=e.querySelectorAll("img").length;if(r==1)return!1;a.classList.add("testimonial--multi");var s=function(n){var c=a.querySelector(".btn-next"),u=a.querySelector(".btn-prev");c.setAttribute("data-go",n+1),u.setAttribute("data-go",n-1),c.removeAttribute("disabled"),u.removeAttribute("disabled"),n==1?u.setAttribute("disabled",!0):n==r&&c.setAttribute("disabled",!0)};e.addEventListener("scroll",function(o){clearTimeout(t),t=setTimeout(function(){var n=e.scrollWidth,c=e.scrollHeight,u=e.scrollLeft,i=e.scrollTop,l=Math.round(u/n*r)+1;u==0&&i!=0&&(l=Math.round(i/c*r)+1),a.setAttribute("data-show",l),s(l)},300)},!1),a.addEventListener("click",function(o){for(var n=o.target;n&&n!=this;n=n.parentNode)if(n.matches("[data-go]")){var c=parseInt(n.getAttribute("data-go")),u=0,i=0,l=e.scrollWidth,f=e.scrollHeight;l>f?i=Math.floor(l*((c-1)/r)):u=Math.floor(f*((c-1)/r)),e.scroll({top:u,left:i,behavior:"smooth"});break}},!1)}function vt(a){var t,e=a.querySelector(".carousel__inner"),r=a.querySelectorAll(".carousel__item").length;a.getAttribute("data-cols");var s=a.getAttribute("data-sm-cols"),o=a.getAttribute("data-md-cols");a.querySelector(".carousel__controls a").classList.add("active"),e.addEventListener("scroll",function(n){clearTimeout(t),t=setTimeout(function(){var c=e.clientWidth,u=e.scrollWidth,i=e.scrollLeft,l=Math.round(i/u*r)+1,f=a.querySelector(".carousel__item:last-child").offsetLeft;Array.from(a.querySelectorAll(".carousel__controls a")).forEach((h,b)=>{h.classList.remove("active")}),a.querySelector(".control-"+l).classList.add("active"),l==1?a.querySelector(".btn-prev").setAttribute("disabled","disabled"):a.querySelector(".btn-prev").removeAttribute("disabled"),e.scrollLeft+c>f?a.querySelector(".btn-next").setAttribute("disabled","disabled"):a.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),a.addEventListener("click",function(n){for(var c=n.target;c&&c!=this;c=c.parentNode)if(c.matches(".carousel__controls a")){n.preventDefault(),Array.from(a.querySelectorAll(".carousel__controls a")).forEach((i,l)=>{i.classList.remove("active")}),c.classList.add("active");var u=document.querySelector(c.getAttribute("href"));e.scroll({top:0,left:u.offsetLeft,behavior:"smooth"});break}},!1),a.addEventListener("click",function(n){for(var c=n.target;c&&c!=this;c=c.parentNode)if(c.matches(".btn-next, .btn-prev")){n.preventDefault();var u=c.classList.contains("btn-prev")?e.scrollLeft-e.clientWidth:e.scrollLeft+e.clientWidth;e.scroll({top:0,left:u,behavior:"smooth"});break}},!1),r==1&&a.classList.add("hide-btns"),s>=r&&a.classList.add("hide-sm-btns"),o>=r&&a.classList.add("hide-md-btns")}function pt(a){a.addEventListener("change",function(t){var e=parseInt(a.querySelector("[data-min] select,[data-min] input").value),r=parseInt(a.querySelector("[data-max] select,[data-max] input").value);Array.from(a.querySelectorAll("[data-min] input")).forEach((s,o)=>{s.setAttribute("max",r)}),Array.from(a.querySelectorAll("[data-max] input")).forEach((s,o)=>{s.setAttribute("min",e)}),Array.from(a.querySelectorAll("[data-min] select option")).forEach((s,o)=>{parseInt(s.getAttribute("value"))>r?s.classList.add("d-none"):s.classList.remove("d-none")}),Array.from(a.querySelectorAll("[data-max] select option")).forEach((s,o)=>{parseInt(s.getAttribute("value"))<e?s.classList.add("d-none"):s.classList.remove("d-none")})},!1)}function yt(a){a.addEventListener("change",function(t){if(a.matches("[data-value-if]")){var e=a.getAttribute("data-redirect"),r=a.getAttribute("data-value-if");a.value==r&&(document.location.href=e)}else typeof a.value<"u"&&(document.location.href=a.value)},!1)}function gt(a){var t=a.querySelector(".row"),e=t.cloneNode(!0),r=a.querySelector("[data-add]");a.addEventListener("click",function(s){for(var o=s.target;o&&o!=this;o=o.parentNode){if(o.matches("[data-add]")){var n=e.cloneNode(!0);a.insertBefore(n,o),r.matches("[data-maxfiles]")&&Array.from(a.querySelectorAll(":scope > .row")).length>=r.dataset.maxfiles&&r.setAttribute("disabled","disabled");break}if(o.matches("[data-delete]")){var c=o.closest(".row");c.remove(),r.matches("[data-maxfiles]")&&Array.from(a.querySelectorAll(":scope > .row")).length<r.dataset.maxfiles&&r.removeAttribute("disabled");break}}},!1)}function At(a){Array.from(a.querySelectorAll("[data-input-range]")).forEach((t,e)=>{pt(t)}),Array.from(a.querySelectorAll("[data-redirect]")).forEach((t,e)=>{yt(t)}),Array.from(a.querySelectorAll(".multiple-file-uploads")).forEach((t,e)=>{gt(t)}),a.addEventListener("change",function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){var r=e.dataset.filesize;e.files[0].size>r&&(e.value="",alert("File too large"));break}},!1),a.addEventListener("change",function(t){Array.from(a.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,r)=>{var s=e.closest("[data-group]")?e.closest("[data-group]"):a,o=e.dataset.activeif,n=e.dataset.equals,c=s.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]'));c.value==n?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(a.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,r)=>{var s=e.closest("[data-group]")?e.closest("[data-group]"):a,o=e.dataset.activeif,n=e.dataset.equals,c=s.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]'));c.value==n?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class wt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r='@import "'.concat(t,'/css/components/header.css";'),s=document.createElement("template");s.innerHTML=`
4
+ */(function(N){typeof define=="function"&&define.amd?define(N):N()})(function(){"use strict";var N=a=>(a.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&a.classList.add("ie"),null),st=a=>{var t=function(r){var s=document.querySelector('label[for="'.concat(r.replace("#",""),'"]')),o=document.querySelector(r+" summary"),c=document.querySelector("dialog".concat(r));s instanceof HTMLElement?s.click():o instanceof HTMLElement?o.click():c instanceof HTMLElement&&c.showModal()};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state.type&&e.state.type=="pagination"){var r=document.querySelector("#".concat(e.state.form)),s=document.querySelector("#".concat(e.state.form," [data-pagination]"));s?s.value=e.state.page:r.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(e.state.page,'" />'),r.dispatchEvent(new Event("submit"))}}),null},it=function(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))},ot=(a,t)=>String(a).padStart(t,"0"),ct=a=>a.charAt(0).toUpperCase()+a.slice(1);class nt{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",function(e){for(var r=e.target;r&&r!=this;r=r.parentNode)if(r.matches("a")){e.preventDefault(),Y(r);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((e,r)=>{var s=new Image;s.onload=function(){var o=document.createElement("script");o.src="https://www.youtube.com/iframe_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(o,c),document.body.classList.add("youtubeLoaded"),e(!0),o.onload=()=>{t.addEventListener("click",function(n){console.log("click"),n&&n.target instanceof HTMLElement&&n.target.closest("a")&&(n.preventDefault(),Y(n.target.closest("a")))},!1)}},s.onerror=function(){r(!1)},s.src="https://youtube.com/favicon.ico"})}}var Y=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var e=t.getAttribute("data-id"),r=t.getAttribute("id");if(typeof r>"u"||r==null){var s=String.fromCharCode(65+Math.floor(Math.random()*26));r=s+Date.now(),t.setAttribute("id",r)}function o(){window.player=new YT.Player(r,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:c,onStateChange:u}})}o();function c(i){i.target.playVideo()}var n=!1;function u(i){if(i.data==YT.PlayerState.PLAYING&&!n){var l=document.getElementById(r);l.classList.add("player-ready"),n=!0}}},lt=a=>(Array.from(a.querySelectorAll("dialog[open]")).forEach((t,e)=>{var r=t.closest(".dialog__wrapper");r||(t.removeAttribute("open"),t.showModal(),t.focus(),Q(t))}),a.addEventListener("click",t=>{if(t.target.tagName=="IAM-ACTIONBAR")return!1;if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var e=t.target.closest("[data-modal]"),r=e.hasAttribute("data-modal")?e.getAttribute("data-modal"):e.getAttribute("data-filter"),s=document.querySelector("dialog#".concat(r));Q(s),s.showModal(),s.focus();var o=s.offsetWidth;s.setAttribute("style","max-width: ".concat(o,"px;")),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((y,A)=>{var T=y.getAttribute("data-duplicate"),S=document.getElementById(T);if(y.checked!=S.checked){y.checked=S.checked;var E=new Event("change");y.dispatchEvent(E)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var c=t.target.closest("dialog[open]");t.preventDefault(),c.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((y,A)=>{y.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:c.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((y,A)=>{y.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 u=t.target.closest("dialog[open]"),i=window.getComputedStyle(u);if(i.display==="contents"&&(u=u.parentNode.closest("dialog[open]")),!u.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||u.classList.contains("dialog--multi")){var l=u.getBoundingClientRect();(t.clientX<l.left||t.clientX>l.right||t.clientY<l.top||t.clientY>l.bottom)&&(t.target.closest('input[type="radio"]')||u.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:u.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){t.stopPropagation();var f=t.target.closest(".dialog__wrapper > button"),h=t.target.closest(".dialog__wrapper > button").parentNode,b="openPopover",d=h.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=d&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((y,A)=>{y.classList.remove("active")}),d.hasAttribute("open"))d.close(),b="closePopover",d.removeAttribute("style"),f.classList.remove("active");else{d.show(),f.classList.add("active");var m=f.getBoundingClientRect(),v=m.top,p=m.left;if(f.closest("iam-table")){var L=f.closest("iam-table").parentNode.getBoundingClientRect();v-=L.top,p-=L.left}d.classList.contains("dialog--fix")&&d.setAttribute("style","position:fixed;top: ".concat(v,"px; left: ").concat(p,"px; margin: 3rem 0 0 0;"))}var w=d.getBoundingClientRect(),g=w.bottom-window.scrollY,k=window.innerHeight-window.scrollY;if(g>k){var q=d.hasAttribute("style")?d.getAttribute("style")+" ":"";d.setAttribute("style",q+"transform: translate(0, calc(-100% - 4rem))"),w=d.getBoundingClientRect();var x=w.top-window.scrollY;x<100&&d.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:b,id:f.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((y,A)=>{y.classList.remove("active")}))}),null),Q=a=>{a.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!a.classList.contains("dialog--multi")&&a.addEventListener("cancel",o=>{o.preventDefault()});var t=a.querySelector(".youtube-embed a");if(t&&Y(t),a.classList.contains("dialog--multi")&&!a.querySelector(":scope > .steps")&&dt(a),!a.querySelector(":scope > .mh-lg")&&!a.classList.contains("dialog--multi")){a.innerHTML='<div class="mh-lg">'.concat(a.innerHTML,"</div>");var e=a.querySelector(".mh-lg"),r=a.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(r){var s=r.previousSibling;e.before(r),s&&r.before(s)}}a.querySelector(":scope > button:first-child")||a.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},dt=a=>{var t="",e=Array.from(a.querySelectorAll("fieldset[data-title]")),r=a.querySelector("form");e.forEach((i,l)=>{t+='<button data-title="'.concat(i.getAttribute("data-title"),'" type="button" class="').concat(l==0?"active":"",'" tabindex="-1">').concat(i.getAttribute("data-title"),"</button>");var f=document.createElement("div");if(f.classList.add("btn--wrapper"),i.appendChild(f),l!=0&&(f.innerHTML+='<button data-title="'.concat(e[l-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>')),l!=e.length-1&&(f.innerHTML+='<button data-title="'.concat(e[l+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="button">Next</button>')),l==e.length-1)if(r&&r.querySelector(':scope > button[type="submit"]')){var h=r.querySelector(':scope > button[type="submit"]');h.classList.add("mb-0"),f.insertAdjacentElement("beforeend",h)}else f.innerHTML+='<button data-title="'.concat(e[l].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="submit">Submit</button>')}),a.insertAdjacentHTML("afterbegin",'<div class="steps bg-primary">'.concat(t,"</div>"));for(var s=Array.from(a.querySelectorAll("fieldset.was-validated")),o=0;o<s.length;o++){var c=s[o],n=c.getAttribute("data-title");if(c.querySelector(".is-invalid")){Array.from(a.querySelectorAll('[data-title="'.concat(n,'"]'))).forEach((i,l)=>{i.classList.add("active")});break}else Array.from(a.querySelectorAll('[data-title="'.concat(n,'"]'))).forEach((i,l)=>{i.classList.add("valid")})}a.addEventListener("invalid",function(){return function(i){i.preventDefault()}}(),!0);function u(i){var l=a.querySelector("fieldset.active")?a.querySelector("fieldset.active"):a.querySelector("fieldset[data-title]"),f=l.getAttribute("data-title"),h=!0;if(l.classList.add("was-validated"),Array.from(l.querySelectorAll("input")).forEach((p,L)=>{p.checkValidity()||(h=!1)}),h?Array.from(a.querySelectorAll('[data-title="'.concat(f,'"]'))).forEach((p,L)=>{p.classList.add("valid")}):Array.from(a.querySelectorAll('[data-title="'.concat(f,'"]'))).forEach((p,L)=>{p.classList.remove("valid")}),h||!i.hasAttribute("data-next")){var b=a.querySelector('fieldset[data-title="'.concat(i.getAttribute("data-title"),'"]')),d=a.querySelector('.steps button[data-title="'.concat(i.getAttribute("data-title"),'"]'));Array.from(a.querySelectorAll("button")).forEach((p,L)=>{p.classList.remove("active")}),Array.from(a.querySelectorAll("fieldset")).forEach((p,L)=>{p.classList.remove("active")}),d.classList.add("active"),b.classList.add("active")}var m=Array.from(a.querySelectorAll("fieldset")).length,v=Array.from(a.querySelectorAll("fieldset.valid")).length;a.style.setProperty("--progress","".concat(v/(m-1)*100,"%"))}a.addEventListener("keydown",i=>{if(i&&i.target instanceof HTMLElement&&i.target.closest("button")){var l=i.target.closest("button");i.keyCode==13&&l.getAttribute("type")!="submit"&&(i.preventDefault(),u(l))}if(i&&i.target instanceof HTMLElement&&i.target.closest("input")){var f=i.target.closest("input");f.classList.remove("is-invalid"),i.keyCode==13&&i.preventDefault()}}),a.addEventListener("click",i=>{if(i&&i.target instanceof HTMLElement&&i.target.closest('button[type="submit"]')){var l=i.target.closest("form");l.classList.add("was-validated")}else if(i&&i.target instanceof HTMLElement&&i.target.closest("button[data-title]")){var f=i.target.closest("button[data-title]");u(f)}return null})};function ut(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",a=>{var t=a.target.closest("[open] summary");if(t)window.dataLayer.push({event:"closeDetails",detailsTitle:t.textContent||""});else{var e=a.target.closest("summary"),r=a.target.closest("a"),s=a.target.closest("button");e&&window.dataLayer.push({event:"openDetails",detailsTitle:e.textContent||""}),r&&window.dataLayer.push({event:"linkClicked",linkText:r.hasAttribute("title")?r.getAttribute("title")||"":r.textContent||"",class:r.hasAttribute("class")&&r.getAttribute("class")||"",href:r.getAttribute("href")||""}),s&&window.dataLayer.push({event:"buttonClicked",buttonText:s.textContent||"",class:s.hasAttribute("class")&&s.getAttribute("class")||""})}})}var ht=a=>{document.addEventListener("load",function(){console.log(Array.from(document.querySelectorAll("input[maxlength]"))),Array.from(document.querySelectorAll("input")).forEach((t,e)=>{t.parentElement,ft(t)})}),a.addEventListener("input",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("input,textarea,select")){var e=t.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)}}),a.addEventListener("change",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("select")){var e=t.target.closest("select");if(console.log(e),e.hasAttribute("data-change-type")&&e.hasAttribute("data-input")){var r=document.getElementById(e.getAttribute("data-input")),s=e.value;J(r,s)}}if(t&&t.target instanceof HTMLElement&&t.target.closest('dialog [type="radio"]')){var o=t.target.closest("dialog");t.target.closest('dialog [type="radio"]'),Array.from(o.querySelectorAll('[type="radio"][autofocus]')).forEach((c,n)=>{c.removeAttribute("autofocus")}),Array.from(o.querySelectorAll('[type="radio"]:checked')).forEach((c,n)=>{c.setAttribute("autofocus",!0)})}}),a.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-change-type][data-input]:not(select)")){var e=t.target.closest("[data-change-type]"),r=document.getElementById(e.getAttribute("data-input")),s=e.getAttribute("data-change-type");if(e.setAttribute("data-change-type",r.getAttribute("type")),J(r,s),e.hasAttribute("data-alt-class")){var o=e.getAttribute("data-alt-class");e.setAttribute("data-alt-class",e.getAttribute("class")),e.setAttribute("class",o)}}})},ft=a=>{var t=a.parentElement,e=a.getAttribute("maxlength");t.style.setProperty("--maxlength",e);var r=a.nextElementSibling;(!r||r&&r.classList.contains("invalid-feedback"))&&(r=document.createElement("span"),t.insertBefore(r,a.nextSibling)),r.setAttribute("data-count",a.value.length)},J=(a,t)=>{a.setAttribute("type",t)},mt=a=>{if(Array.from(a.querySelectorAll("details")).forEach((e,r)=>{e.addEventListener("mouseenter",function(s){window.matchMedia("(min-width: 62em)").matches&&e.setAttribute("open","true")},!1),e.addEventListener("mouseleave",function(s){window.matchMedia("(min-width: 62em)").matches&&e.removeAttribute("open")},!1)}),"IntersectionObserver"in window){var t=new IntersectionObserver(e=>{var[r]=e;return r.target.classList.toggle("is-stuck",r.intersectionRatio<1)},{threshold:[1]});t.observe(a)}};function bt(a){var t,e=a.querySelector(".testimonial__images"),r=e.querySelectorAll("img").length;if(r==1)return!1;a.classList.add("testimonial--multi");var s=function(c){var n=a.querySelector(".btn-next"),u=a.querySelector(".btn-prev");n.setAttribute("data-go",c+1),u.setAttribute("data-go",c-1),n.removeAttribute("disabled"),u.removeAttribute("disabled"),c==1?u.setAttribute("disabled",!0):c==r&&n.setAttribute("disabled",!0)};e.addEventListener("scroll",function(o){clearTimeout(t),t=setTimeout(function(){var c=e.scrollWidth,n=e.scrollHeight,u=e.scrollLeft,i=e.scrollTop,l=Math.round(u/c*r)+1;u==0&&i!=0&&(l=Math.round(i/n*r)+1),a.setAttribute("data-show",l),s(l)},300)},!1),a.addEventListener("click",function(o){for(var c=o.target;c&&c!=this;c=c.parentNode)if(c.matches("[data-go]")){var n=parseInt(c.getAttribute("data-go")),u=0,i=0,l=e.scrollWidth,f=e.scrollHeight;l>f?i=Math.floor(l*((n-1)/r)):u=Math.floor(f*((n-1)/r)),e.scroll({top:u,left:i,behavior:"smooth"});break}},!1)}function vt(a){var t,e=a.querySelector(".carousel__inner"),r=a.querySelectorAll(".carousel__item").length;a.getAttribute("data-cols");var s=a.getAttribute("data-sm-cols"),o=a.getAttribute("data-md-cols");a.querySelector(".carousel__controls a").classList.add("active"),e.addEventListener("scroll",function(c){clearTimeout(t),t=setTimeout(function(){var n=e.clientWidth,u=e.scrollWidth,i=e.scrollLeft,l=Math.round(i/u*r)+1,f=a.querySelector(".carousel__item:last-child").offsetLeft;Array.from(a.querySelectorAll(".carousel__controls a")).forEach((h,b)=>{h.classList.remove("active")}),a.querySelector(".control-"+l).classList.add("active"),l==1?a.querySelector(".btn-prev").setAttribute("disabled","disabled"):a.querySelector(".btn-prev").removeAttribute("disabled"),e.scrollLeft+n>f?a.querySelector(".btn-next").setAttribute("disabled","disabled"):a.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),a.addEventListener("click",function(c){for(var n=c.target;n&&n!=this;n=n.parentNode)if(n.matches(".carousel__controls a")){c.preventDefault(),Array.from(a.querySelectorAll(".carousel__controls a")).forEach((i,l)=>{i.classList.remove("active")}),n.classList.add("active");var u=document.querySelector(n.getAttribute("href"));e.scroll({top:0,left:u.offsetLeft,behavior:"smooth"});break}},!1),a.addEventListener("click",function(c){for(var n=c.target;n&&n!=this;n=n.parentNode)if(n.matches(".btn-next, .btn-prev")){c.preventDefault();var u=n.classList.contains("btn-prev")?e.scrollLeft-e.clientWidth:e.scrollLeft+e.clientWidth;e.scroll({top:0,left:u,behavior:"smooth"});break}},!1),r==1&&a.classList.add("hide-btns"),s>=r&&a.classList.add("hide-sm-btns"),o>=r&&a.classList.add("hide-md-btns")}function pt(a){a.addEventListener("change",function(t){var e=parseInt(a.querySelector("[data-min] select,[data-min] input").value),r=parseInt(a.querySelector("[data-max] select,[data-max] input").value);Array.from(a.querySelectorAll("[data-min] input")).forEach((s,o)=>{s.setAttribute("max",r)}),Array.from(a.querySelectorAll("[data-max] input")).forEach((s,o)=>{s.setAttribute("min",e)}),Array.from(a.querySelectorAll("[data-min] select option")).forEach((s,o)=>{parseInt(s.getAttribute("value"))>r?s.classList.add("d-none"):s.classList.remove("d-none")}),Array.from(a.querySelectorAll("[data-max] select option")).forEach((s,o)=>{parseInt(s.getAttribute("value"))<e?s.classList.add("d-none"):s.classList.remove("d-none")})},!1)}function yt(a){a.addEventListener("change",function(t){if(a.matches("[data-value-if]")){var e=a.getAttribute("data-redirect"),r=a.getAttribute("data-value-if");a.value==r&&(document.location.href=e)}else typeof a.value<"u"&&(document.location.href=a.value)},!1)}function gt(a){var t=a.querySelector(".row"),e=t.cloneNode(!0),r=a.querySelector("[data-add]");a.addEventListener("click",function(s){for(var o=s.target;o&&o!=this;o=o.parentNode){if(o.matches("[data-add]")){var c=e.cloneNode(!0);a.insertBefore(c,o),r.matches("[data-maxfiles]")&&Array.from(a.querySelectorAll(":scope > .row")).length>=r.dataset.maxfiles&&r.setAttribute("disabled","disabled");break}if(o.matches("[data-delete]")){var n=o.closest(".row");n.remove(),r.matches("[data-maxfiles]")&&Array.from(a.querySelectorAll(":scope > .row")).length<r.dataset.maxfiles&&r.removeAttribute("disabled");break}}},!1)}function At(a){Array.from(a.querySelectorAll("[data-input-range]")).forEach((t,e)=>{pt(t)}),Array.from(a.querySelectorAll("[data-redirect]")).forEach((t,e)=>{yt(t)}),Array.from(a.querySelectorAll(".multiple-file-uploads")).forEach((t,e)=>{gt(t)}),a.addEventListener("change",function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){var r=e.dataset.filesize;e.files[0].size>r&&(e.value="",alert("File too large"));break}},!1),a.addEventListener("change",function(t){Array.from(a.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,r)=>{var s=e.closest("[data-group]")?e.closest("[data-group]"):a,o=e.dataset.activeif,c=e.dataset.equals,n=s.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]'));n.value==c?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(a.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,r)=>{var s=e.closest("[data-group]")?e.closest("[data-group]"):a,o=e.dataset.activeif,c=e.dataset.equals,n=s.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]'));n.value==c?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class wt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r='@import "'.concat(t,'/css/components/header.css";'),s=document.createElement("template");s.innerHTML=`
5
5
  <style>
6
6
  @import "`.concat(e,`";
7
7
  `).concat(r,`
@@ -30,7 +30,7 @@
30
30
  <div class="accordion">
31
31
  <slot></slot>
32
32
  </div>
33
- `),this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){Lt(this)}}var qt=function(t){var e=t.querySelectorAll(":scope > details");t.querySelectorAll(":scope > details > summary");var r=t.querySelector(":scope > .tabs__links");t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(r=t.shadowRoot.querySelector(".tabs__links")),r||(r=document.createElement("div"),r.classList.add("tabs__links"),t.prepend(r)),e.forEach((s,o)=>{var n=s.querySelector(":scope > summary");n.classList.add("visually-hidden");var c=document.createElement("button");s.hasAttribute("id")&&(c=document.createElement("a"),c.setAttribute("href","#".concat(s.getAttribute("id")))),s.hasAttribute("open")&&c.setAttribute("aria-pressed",!0),c.innerHTML="".concat(n.innerText),c.classList.add("link"),c.setAttribute("data-index",o),c.setAttribute("tabindex","-1"),r.appendChild(c)})},Et=function(t){var e=t.querySelectorAll(":scope > details"),r=t.querySelectorAll(":scope > details > summary"),s=t.querySelectorAll(":scope .tabs__links > .link");t.shadowRoot&&(s=t.shadowRoot.querySelectorAll(".tabs__links > .link")),s.forEach(o=>{o.addEventListener("click",n=>{n.preventDefault(),s.forEach(c=>{var u=c==o;c.setAttribute("aria-pressed",u)}),e.forEach((c,u)=>{var i=o.getAttribute("data-index")==u;i?c.setAttribute("open",i):c.removeAttribute("open")}),o.hasAttribute("href")&&history.pushState(void 0,void 0,o.getAttribute("href")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:o.textContent})})}),r.forEach((o,n)=>{o.addEventListener("focus",c=>{s.forEach(u=>{u.classList.remove("focus")}),s[n].classList.add("focus")}),o.addEventListener("click",c=>{c.preventDefault(),s[n].click()})})},xt=function(t){var e=t.querySelectorAll(":scope > details"),r=t.querySelectorAll(":scope > .tabs__links > button, .tabs__links > a");t.shadowRoot&&(r=t.shadowRoot.querySelectorAll(".tabs__links > button, .tabs__links > a")),location.hash&&t.querySelector('.tabs__links [href="'.concat(location.hash,'"]'))?(t.querySelector('[href="'.concat(location.hash,'"]')).setAttribute("open",!0),t.querySelector('details[id="'.concat(location.hash.replace("#",""),'"]')).setAttribute("open",!0)):t.querySelector("details[open]")||(e[0].setAttribute("open",!0),r[0].setAttribute("aria-pressed",!0))},Tt=function(t){qt(t),Et(t),xt(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class _t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r=document.createElement("template");r.innerHTML=`
33
+ `),this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){Lt(this)}}var qt=function(t){var e=t.querySelectorAll(":scope > details");t.querySelectorAll(":scope > details > summary");var r=t.querySelector(":scope > .tabs__links");t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(r=t.shadowRoot.querySelector(".tabs__links")),r||(r=document.createElement("div"),r.classList.add("tabs__links"),t.prepend(r)),e.forEach((s,o)=>{var c=s.querySelector(":scope > summary");c.classList.add("visually-hidden");var n=document.createElement("button");s.hasAttribute("id")&&(n=document.createElement("a"),n.setAttribute("href","#".concat(s.getAttribute("id")))),s.hasAttribute("open")&&n.setAttribute("aria-pressed",!0),n.innerHTML="".concat(c.innerText),n.classList.add("link"),n.setAttribute("data-index",o),n.setAttribute("tabindex","-1"),r.appendChild(n)})},Et=function(t){var e=t.querySelectorAll(":scope > details"),r=t.querySelectorAll(":scope > details > summary"),s=t.querySelectorAll(":scope .tabs__links > .link");t.shadowRoot&&(s=t.shadowRoot.querySelectorAll(".tabs__links > .link")),s.forEach(o=>{o.addEventListener("click",c=>{c.preventDefault(),s.forEach(n=>{var u=n==o;n.setAttribute("aria-pressed",u)}),e.forEach((n,u)=>{var i=o.getAttribute("data-index")==u;i?n.setAttribute("open",i):n.removeAttribute("open")}),o.hasAttribute("href")&&history.pushState(void 0,void 0,o.getAttribute("href")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:o.textContent})})}),r.forEach((o,c)=>{o.addEventListener("focus",n=>{s.forEach(u=>{u.classList.remove("focus")}),s[c].classList.add("focus")}),o.addEventListener("click",n=>{n.preventDefault(),s[c].click()})})},xt=function(t){var e=t.querySelectorAll(":scope > details"),r=t.querySelectorAll(":scope > .tabs__links > button, .tabs__links > a");t.shadowRoot&&(r=t.shadowRoot.querySelectorAll(".tabs__links > button, .tabs__links > a")),location.hash&&t.querySelector('.tabs__links [href="'.concat(location.hash,'"]'))?(t.querySelector('[href="'.concat(location.hash,'"]')).setAttribute("open",!0),t.querySelector('details[id="'.concat(location.hash.replace("#",""),'"]')).setAttribute("open",!0)):t.querySelector("details[open]")||(e[0].setAttribute("open",!0),r[0].setAttribute("aria-pressed",!0))},Tt=function(t){qt(t),Et(t),xt(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class _t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r=document.createElement("template");r.innerHTML=`
34
34
  <style>
35
35
  @import "`.concat(e,`";
36
36
 
@@ -44,15 +44,15 @@
44
44
  <div class="tabs__links"></div>
45
45
  <slot></slot>
46
46
  </div>
47
- `),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString().replace("container","");this.shadowRoot.querySelector(".tabs").setAttribute("class","tabs ".concat(t)),Tt(this)}}var C=function(t,e){if(!t.getAttribute("data-pages"))return!1;t.getAttribute("data-page")||t.setAttribute("data-page",1);var r=t.getAttribute("data-page"),s=t.getAttribute("data-pages"),o=t.getAttribute("data-total"),n=t.getAttribute("data-show"),c=t.getAttribute("data-increment");if(s<=1)return e.innerHTML="",!1;for(var u="",i=1;i<=s;i++)i==r?u+='<li class="page-item active" aria-current="page"><span class="page-link">'.concat(i,"</span></li>"):u+='<li class="page-item"><a href="?page='.concat(i,'" class="page-link" data-page="').concat(i,'">').concat(i,"</a></li>");return e.innerHTML=`<ul class="pagination mb-0 d-none d-sm-flex">
47
+ `),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString().replace("container","");this.shadowRoot.querySelector(".tabs").setAttribute("class","tabs ".concat(t)),Tt(this)}}var C=function(t,e){if(!t.getAttribute("data-pages"))return!1;t.getAttribute("data-page")||t.setAttribute("data-page",1);var r=t.getAttribute("data-page"),s=t.getAttribute("data-pages"),o=t.getAttribute("data-total"),c=t.getAttribute("data-show"),n=t.getAttribute("data-increment");if(s<=1)return e.innerHTML="",!1;for(var u="",i=1;i<=s;i++)i==r?u+='<li class="page-item active" aria-current="page"><span class="page-link">'.concat(i,"</span></li>"):u+='<li class="page-item"><a href="?page='.concat(i,'" class="page-link" data-page="').concat(i,'">').concat(i,"</a></li>");return e.innerHTML=`<ul class="pagination mb-0 d-none d-sm-flex">
48
48
  `.concat(r==1?'<li class="page-item disabled"><span class="page-link">Previous</span></li>':'<li class="page-item"><a href="?page='.concat(parseInt(r)-1,'" class="page-link" data-page="').concat(parseInt(r)-1,'">Previous</a></li>'),`
49
49
  `).concat(u,`
50
50
  `).concat(r==s?'<li class="page-item disabled"><span class="page-link">Next</span></li>':'<li class="page-item"><a href="?page='.concat(parseInt(r)+1,'" class="page-link" data-page="').concat(parseInt(r)+1,'">Next</a></li>'),`
51
51
  </ul>`),e.innerHTML+=`<div class="d-sm-none text-center">
52
- <span class="d-block pb-2">You've viewed `.concat(n," of ").concat(o,` results</span>
53
- <a href="?show=`).concat(parseInt(n)+parseInt(c),'" class="btn btn-primary w-100 m-0" data-show="').concat(parseInt(n)+parseInt(c),`">Load more results</a>
54
- </div>`),!0},kt=function(a,t,e,r){function s(o){return o instanceof e?o:new e(function(n){n(o)})}return new(e||(e=Promise))(function(o,n){function c(l){try{i(r.next(l))}catch(f){n(f)}}function u(l){try{i(r.throw(l))}catch(f){n(f)}}function i(l){l.done?o(l.value):s(l.value).then(c,u)}i((r=r.apply(a,t||[])).next())})},K=a=>{var t=Array.from(a.querySelectorAll("thead th")),e=Array.from(a.querySelectorAll("tbody tr"));e.forEach((r,s)=>{var o=Array.from(r.querySelectorAll("th, td")),n=["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"];o.forEach((c,u)=>{var i=t[u];if(typeof i<"u"){var l=document.createElement("div");l.innerHTML=i.innerHTML;var f=l.textContent||l.innerText||"";c.setAttribute("data-label",f),i.hasAttribute("data-td-class")&&c.setAttribute("class",i.getAttribute("data-td-class")),i.hasAttribute("data-format")&&(c.setAttribute("data-format",i.getAttribute("data-format")),c.innerHTML=z(i.getAttribute("data-format"),c.textContent.trim())),n.includes(c.textContent.trim().toLowerCase())&&c.setAttribute("data-content",c.textContent.trim().toLowerCase())}})})},Mt=a=>{var t=0;return Array.from(a.querySelectorAll("tbody tr")).forEach((e,r)=>{var s=window.getComputedStyle(document.querySelector("html")),o=e.querySelector(":scope > *:last-child > *:first-child");if(o){o.classList.add("text-nowrap");var n=o.offsetWidth/parseFloat(s.fontSize);n+=1.7,t=t>n?t:n}}),t},Ct=a=>{if(a.closest(".table--fullwidth")||a.querySelectorAll("thead tr th").length<4)return!1;Array.from(a.querySelectorAll("tbody tr")).forEach((t,e)=>{var r=t.querySelector(":scope > :is(td,th):first-child"),s=r.textContent;if(s!="")r.innerHTML='<span class="td__content">'.concat(s,'</span><button type="button" class="d-none">').concat(s,"</button>");else{var o=t.querySelector(":scope > :is(td,th):nth-child(2)"),n=o.textContent;o.innerHTML='<span class="td__content">'.concat(n,'</span><button type="button" class="d-none">').concat(n,"</button>")}})},Ht=a=>{a.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("tr > :is(td,th):first-child button")){var e=t.target.closest("tr > :is(td,th):first-child button"),r=e.parentNode.closest("tr");r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),e.blur()}})},Z=(a,t)=>{var e=t.querySelector("[data-search]");if(!e)return!1;var r=e.getAttribute("id"),s=e.getAttribute("data-search").split(","),o=e.parentNode,n={};s.forEach((c,u)=>{Array.from(a.querySelectorAll('td[data-label="'+c.trim()+'"]')).forEach((i,l)=>{i.querySelector(".td__content")?n[i.querySelector(".td__content").textContent]=i.querySelector(".td__content").textContent:n[i.textContent]=i.textContent})}),e.setAttribute("list","".concat(r,"_list")),e.setAttribute("autocomplete","off"),o.querySelector("datalist")||(o.innerHTML+='<datalist id="'.concat(r,'_list"></datalist>')),o.querySelector("datalist").innerHTML="".concat(Object.keys(n).map(c=>'<option value="'.concat(c,'"></option>')).join(""))},Rt=(a,t,e,r,s)=>{var o,n=function(l){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.classList.contains("processing"))return!1;if(l.type=="submit"&&(t.classList.add("processing"),Array.from(t.querySelectorAll("[data-duplicate]")).forEach((v,p)=>{var L=v.getAttribute("data-duplicate"),w=document.getElementById(L),g=document.querySelector('[for="'.concat(L,'"] iam-card'));if(w.checked!=v.checked)if(g){var k=new Event("click");g.dispatchEvent(k)}else w.checked=v.checked}),t.classList.remove("processing")),t.hasAttribute("data-ajax")){if(!f){var h=t.querySelector("[data-pagination]");h.value=1,r.setAttribute("data-page",1)}at(a,t,e,r)}else t.hasAttribute("data-submit")?t.submit():($(a,t,r),C(r,e),D(a,t));if(t.hasAttribute("data-ajax-post")){var b=new FormData(t),d=new URLSearchParams(b).toString(),m=new XMLHttpRequest;m.open("GET","".concat(window.location.href,"?ajax=true&").concat(d)),m.send()}};t.addEventListener("keyup",i=>{clearTimeout(o),i&&i.target instanceof HTMLElement&&i.target.closest("[data-search]")&&(o=setTimeout(function(){n(i)},500))}),t.addEventListener("change",i=>{clearTimeout(o),i&&i.target instanceof HTMLElement&&i.target.closest("[data-sort]")&&(t.hasAttribute("data-submit")||W(a,t,s),n(i)),i&&i.target instanceof HTMLElement&&i.target.closest("[data-search]")&&n(i),i&&i.target instanceof HTMLElement&&i.target.closest("[data-filter][data-no-ajax]")?($(a,t,r),C(r,e),D(a,t)):(i&&i.target instanceof HTMLElement&&i.target.closest("[data-filter]")&&i.target.closest("form .dialog__wrapper > dialog")||i&&i.target instanceof HTMLElement&&i.target.closest("[data-filter]")&&!i.target.closest("form dialog"))&&n(i),i&&i.target instanceof HTMLElement&&i.target.closest("[data-show]")&&n(i),i&&i.target instanceof HTMLElement&&i.target.closest("[data-mimic]")&&n(i)}),t.addEventListener("click",i=>{if(clearTimeout(o),i&&i.target instanceof HTMLElement&&i.target.closest('dialog button:not([type="button"])')){var l=i.target.closest('dialog button:not([type="button"])'),f=l.closest("dialog");f.close()}if(i&&i.target instanceof HTMLElement&&i.target.closest(".dialog__close")&&(i.preventDefault(),i.stopPropagation()),i&&i.target instanceof HTMLElement&&i.target.closest("[data-clear]")){t.classList.add("processing"),Array.from(t.querySelectorAll(".applied-filters")).forEach((m,v)=>{m.innerHTML=""});for(var h=t.elements,b=0;b<h.length;b++){var d=h[b].type.toLowerCase()?h[b].type.toLowerCase():"text";switch(d){case"text":case"password":case"textarea":h[b].value="";break;case"radio":case"checkbox":h[b].checked&&(h[b].checked=!1);break;case"select-one":case"select-multi":h[b].selectedIndex=-1;break}}Array.from(t.querySelectorAll("label iam-card")).forEach((m,v)=>{var p=new Event("click");m.dispatchEvent(p)}),t.classList.remove("processing"),t.hasAttribute("data-submit")||W(a,t,s),n(i)}}),t.addEventListener("submit",i=>{clearTimeout(o),t.hasAttribute("data-submit")||i.preventDefault(),n(i)}),t.addEventListener("force",i=>{n(i)}),t.addEventListener("paginate",i=>{n(i,!0)});var c=[],u=[];Array.from(t.querySelectorAll("[data-mimic]")).forEach((i,l)=>{var f=i.getAttribute("data-mimic");Array.from(document.querySelectorAll('[name="'.concat(f,'"]'))).forEach((h,b)=>{var d=h.closest("form");c.includes(d)||c.push(d),u.includes(f)||u.push(f)})}),c.forEach((i,l)=>{var f=function(){var b=[],d=new FormData(i);for(var[m,v]of d)document.querySelector('[data-mimic="'.concat(m,'"]'))&&!b.includes(m)?(b.push(m),document.querySelector('[data-mimic="'.concat(m,'"]')).value=v):document.querySelector('[data-mimic="'.concat(m,'"]'))&&(document.querySelector('[data-mimic="'.concat(m,'"]')).value+=","+v);for(var p of b){var L=new Event("force");t.dispatchEvent(L)}for(var w of u)if(!d.has(w)&&i.querySelector('[name="'.concat(w,'"]'))){document.querySelector('[data-mimic="'.concat(w,'"]')).value="";var g=new Event("force");t.dispatchEvent(g)}};i.addEventListener("force",h=>{f()}),i.addEventListener("change",h=>{f()})})},W=(a,t,e)=>{if(t.getAttribute("data-ajax"))return!1;var r=a.querySelector("tbody"),s=t.querySelector("[data-sort]"),o=s.querySelector("option:nth-child(".concat(s.selectedIndex+1,")")),n=o.getAttribute("data-sort"),c=o.getAttribute("data-order"),u=o.getAttribute("data-format");if(!n)return r.innerHTML=e.innerHTML,K(a),!1;var i=[];["asc","desc","descending"].includes(c)||(i=c.split(","));var l=[];Array.from(r.querySelectorAll("tr")).forEach((h,b)=>{var d=h.querySelector('td[data-label="'+n+'"], th[data-label="'+n+'"]').textContent.trim();h.querySelector('[data-label="'+n+'"] .td__content')&&(d=h.querySelector('[data-label="'+n+'"] .td__content').textContent.trim()),i.length&&i.includes(d)&&(d=i.indexOf(d)),it(d)&&(d=ot(d,10)),u&&u=="date"&&(d=new Date(d));var m={index:d,row:h};l.push(m)}),l.sort((h,b)=>h.index>b.index?1:-1),(c=="descending"||c=="desc")&&(l=l.reverse());var f="";l.forEach((h,b)=>{f+=h.row.outerHTML}),r.innerHTML=f},$=(a,t,e)=>{a.classList.remove("table--filtered");var r=et(t),s=[],o=0,n=t.querySelector("[data-pagination]")?parseInt(t.querySelector("[data-pagination]").value):1,c=t.querySelector("[data-show]")?parseInt(t.querySelector("[data-show]").value):15;if(Array.from(a.querySelectorAll("tbody tr")).forEach((d,m)=>{d.classList.remove("filtered"),d.classList.remove("filtered--matched"),d.classList.remove("filtered--show"),d.removeAttribute("data-filtered-by")}),t.querySelector("[data-search]")){var u=t.querySelector("[data-search]"),i=t.querySelector("[data-search]").getAttribute("data-search").split(",");i.forEach((d,m)=>{s.push({column:"".concat(d.trim()),value:"".concat(u.value)})})}Array.from(t.querySelectorAll("[data-filter-count]")).forEach((d,m)=>{d.innerHTML="",d.parentNode.classList.remove("hover")});var l=0;Object.values(r).forEach((d,m)=>{typeof d=="object"&&Object.values(d).length?l+=Object.values(d).length:l++}),l&&Array.from(t.querySelectorAll("[data-filter-count]")).forEach((d,m)=>{d.innerHTML+="(".concat(l,")"),d.parentNode.classList.add("hover")}),a.classList.add("table--filtered");var f=function(m,v){Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((p,L)=>{var w=!1;v.forEach((g,k)=>{var q=p.querySelector('[data-label="'.concat(m,'"]'));if(g&&g=="$today")g=z("date",new Date);else if(g&&g=="$yesterday"){var x=new Date;x.setDate(x.getDate()-1),g=z("date",x)}else if(g&&(g=="$thisWeek"||g=="$lastWeek")){var y=new Date,A=new Date(y.setDate(y.getDate()-(y.getDay()-1))),T=new Date(y.setDate(y.getDate()-y.getDay()+7)),S=new Date(q.textContent.toLowerCase());if(y.setHours(0,0,0,0),A.setHours(0,0,0,0),T.setHours(0,0,0,0),S.setHours(0,0,0,0),g=="$thisWeek")w=S>=A&&S<=T;else{var E=new Date(A.setDate(A.getDate()-7)),M=new Date(T.setDate(T.getDate()-7));E.setHours(0,0,0,0),M.setHours(0,0,0,0),w=S>=E&&S<=M}}else if(g&&g=="$thisMonth"){var I=new Date,B=I.getFullYear(),j=I.getMonth(),H=new Date(B,j,1),G=new Date(B,j+1,0),R=new Date(q.textContent.toLowerCase());H.setHours(0,0,0,0),G.setHours(0,0,0,0),R.setHours(0,0,0,0),w=R>=H&&R<=G}else if(g&&g=="$lastMonth"){var _=new Date,P=_.getFullYear(),O=_.getMonth(),F=new Date(P,O-1,1),V=new Date(P,O,0),X=new Date(q.textContent.toLowerCase());F.setHours(0,0,0,0),V.setHours(0,0,0,0),X.setHours(0,0,0,0),w=X>=F&&X<=V}q&&q.textContent.toLowerCase().includes(g.toLowerCase())&&(w=!0)}),w||(p.classList.add("filtered"),p.setAttribute("data-filtered-by",m))})};for(var[h,b]of Object.entries(r))f(h,b);Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((d,m)=>{var v=!(s.length>0&&s[0].value.length>=3);s.forEach((p,L)=>{var w=d.querySelector('[data-label="'.concat(p.column,'"]'));w&&p.value.length>=3&&w.textContent.toLowerCase().includes(p.value.toLowerCase())&&(v=!0)}),v||d.classList.add("filtered")}),Array.from(a.querySelectorAll("tbody tr:not(.filtered")).forEach((d,m)=>{o++,d.classList.add("filtered--matched");var v=Math.ceil(o/c);v==parseInt(n)&&d.classList.add("filtered--show")}),e&&(e.setAttribute("data-page",n),e.setAttribute("data-pages",Math.ceil(o/c)),e.setAttribute("data-total",o),e.setAttribute("data-show",c))},D=(a,t,e)=>{var r=Array.from(t.querySelectorAll("[data-query]"));r.forEach((s,o)=>{var n=s.getAttribute("data-query"),c;if(n=="total")e.hasAttribute("data-total")?c=e.getAttribute("data-total"):c=(a.classList.contains("table--filtered"),a.querySelectorAll("tbody tr").length);else if(!n.includes(" == ")&&n.includes(" & ")){var u=n.split(" & "),i="";u.forEach(h=>{i+=':not([data-filtered-by="'.concat(h,'"])')}),c=Array.from(a.querySelectorAll("tbody tr".concat(i))).length}else if(!n.includes(" == "))c=Array.from(a.querySelectorAll('tbody tr:not([data-filtered-by="'.concat(n,'"])'))).length;else if(n.includes(" && ")){var l=n.split(" && ");c=Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).filter(function(h){var b=!0;for(var[d,m]of Object.entries(l)){var v=m.split(" == ");(!h.querySelector('td[data-label="'.concat(v[0],'"]'))||h.querySelector('td[data-label="'.concat(v[0],'"]')).textContent!="".concat(v[1]))&&(b=!1)}return b}).length}else{var f=n.split(" == ");c=Array.from(a.querySelectorAll('tbody tr.filtered--matched td[data-label="'.concat(f[0],'"], tbody tr[data-filtered-by="').concat(f[0],'"] td[data-label="').concat(f[0],'"]'))).filter(function(h){return h.textContent===f[1]}).length}s.hasAttribute("data-total")?s.setAttribute("data-total",c):s.innerHTML=c})},Nt=function(t,e,r,s){r.addEventListener("click",o=>{if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-page]")){o.preventDefault();var n=e.querySelector("[data-pagination]"),c=o.target.closest("[data-page]").getAttribute("data-page");if(n.value=c,s.setAttribute("data-page",c),e.dispatchEvent(new Event("paginate")),t.hasAttribute("data-show-history")){var u=new URL(location);u.searchParams.set("page",c),history.pushState({type:"pagination",form:e.getAttribute("id"),page:c},"",u)}var i=-250,l=t.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:l,behavior:"smooth"})}if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-show]")){o.preventDefault();var f=e.querySelector("[data-show]"),h=o.target.closest("[data-show]").getAttribute("data-show");f.value=h,s.setAttribute("data-show",h),e.dispatchEvent(new Event("submit"))}})},Dt=(a,t)=>{if(!a)return!1;a.addEventListener("click",e=>{It(t)})},It=function(t){for(var e=[],r=t.getElementsByTagName("tr"),s=0;s<r.length;s++){for(var o=r[s].querySelectorAll("td,th"),n=[],c=0;c<o.length;c++)n.push('"'.concat(o[c].textContent,'"'));e.push(n.join(","))}e=e.join(`
55
- `);var u=new Blob([e],{type:"text/csv"}),i=document.createElement("a");i.download="export.csv";var l=window.URL.createObjectURL(u);i.href=l,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},tt=function(t,e,r,s){if(K(t),Ct(t),D(t,e,s),s&&s.classList.contains("table--cta")){let n=function(){Array.from(t.querySelectorAll("tr")).forEach((c,u)=>{var i=c.offsetHeight;c.style.setProperty("--row-height","".concat(i,"px"))})};var o=Mt(t);s.style.setProperty("--cta-width","".concat(o,"rem")),new ResizeObserver(n).observe(t)}},et=function(t){var e=new Object,r=Array.from(t.querySelectorAll("[data-filter]"));return r.forEach((s,o)=>{if(!(s.type=="radio"&&!s.checked)&&!(s.type=="checkbox"&&!s.checked)&&s&&s.value){var n=s.getAttribute("data-filter");e[n]||(e[n]=new Array),e[n].push(s.value)}}),e},at=function(t,e,r,s){return kt(this,void 0,void 0,function*(){var o=(d,m,v)=>m.split(/[\.\[\]\'\"]/).filter(p=>p).reduce((p,L)=>p?p[L]:v,d),n=new FormData(e),c=new URLSearchParams(n).toString(),u=t.querySelectorAll("thead tr th"),i=t.querySelector("tbody"),l=e.getAttribute("data-ajax");s.classList.add("table--loading");var f=et(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((d,m)=>{d.innerHTML="",d.parentNode.classList.remove("hover")});var h=0;Object.values(f).forEach((d,m)=>{typeof d=="object"&&Object.values(d).length?h+=Object.values(d).length:h++}),h&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((d,m)=>{d.innerHTML+="(".concat(h,")"),d.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[l]&&window.controller[l].abort(),window.controller[l]=new AbortController;var{signal:b}=controller[l];try{yield fetch(l+"?"+c,{signal:b,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(d=>d.json()).then(d=>{var m=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",v=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",p=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",L=o(d,v,1),w=o(d,p,1),g=o(d,m),k=s.hasAttribute("data-empty-msg")?s.getAttribute("data-empty-msg"):"No results found";g?(i.innerHTML="",g.forEach((q,x)=>{var y=document.createElement("tr");u.forEach((A,T)=>{var S="",E=document.createElement("td");if(E.setAttribute("data-label",A.innerText),A.getAttribute("data-output")){var M=A.getAttribute("data-output");S=M.replace(new RegExp(/{(.*?)}/,"gm"),function(j){return o(q,j.replace("{","").replace("}",""))})}if(A.hasAttribute("data-output-array")){var M=A.getAttribute("data-output"),I=o(q,M.replace("{","").replace("}",""));S="",I.forEach((H,G)=>{var R=A.getAttribute("data-output-array"),_="";if(A.hasAttribute("data-output-array-property")&&A.hasAttribute("data-output-array-transform")){var P=o(H,A.getAttribute("data-output-array-property")),O=JSON.parse(A.getAttribute("data-output-array-transform")),F=O[P];_=R.replace("{".concat(A.getAttribute("data-output-array-property"),"}"),F)}_=_.replace(new RegExp(/{(.*?)}/,"gm"),function(V){return o(H,V.replace("{","").replace("}",""))}),S+=_})}if(A.hasAttribute("data-transform")){var B=JSON.parse(A.getAttribute("data-transform"));S=B[S],!S&&A.hasAttribute("data-default")&&(S=A.getAttribute("data-default"))}E.innerHTML=S,y.appendChild(E)}),i.appendChild(y)}),Z(t,e),s.setAttribute("data-total",parseInt(L)),s.setAttribute("data-page",parseInt(w)),s.setAttribute("data-pages",Math.ceil(s.getAttribute("data-total")/s.getAttribute("data-show"))),tt(t,e,r,s),C(s,r),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((q,x)=>{var y=o(d,q.getAttribute("data-ajax-query"),"");q.hasAttribute("data-total")?q.setAttribute("data-total",y):q.innerHTML=y}),parseInt(L)==0&&(i.innerHTML='<tr><td colspan="100%"><span>'.concat(k,"</span></td></tr>")),s.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:l,formData:c})):i.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>'})}catch(d){console.log(d)}})},z=(a,t)=>{switch(a){case"datetime":return new Date(t).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(t).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(t).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return t=nt(t)}};class Bt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r=document.createElement("template");r.innerHTML=`
52
+ <span class="d-block pb-2">You've viewed `.concat(c," of ").concat(o,` results</span>
53
+ <a href="?show=`).concat(parseInt(c)+parseInt(n),'" class="btn btn-primary w-100 m-0" data-show="').concat(parseInt(c)+parseInt(n),`">Load more results</a>
54
+ </div>`),!0},kt=function(a,t,e,r){function s(o){return o instanceof e?o:new e(function(c){c(o)})}return new(e||(e=Promise))(function(o,c){function n(l){try{i(r.next(l))}catch(f){c(f)}}function u(l){try{i(r.throw(l))}catch(f){c(f)}}function i(l){l.done?o(l.value):s(l.value).then(n,u)}i((r=r.apply(a,t||[])).next())})},K=a=>{var t=Array.from(a.querySelectorAll("thead th")),e=Array.from(a.querySelectorAll("tbody tr"));e.forEach((r,s)=>{var o=Array.from(r.querySelectorAll("th, td")),c=["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"];o.forEach((n,u)=>{var i=t[u];if(typeof i<"u"){var l=document.createElement("div");l.innerHTML=i.innerHTML;var f=l.textContent||l.innerText||"";n.setAttribute("data-label",f),i.hasAttribute("data-td-class")&&n.setAttribute("class",i.getAttribute("data-td-class")),i.hasAttribute("data-format")&&(n.setAttribute("data-format",i.getAttribute("data-format")),n.innerHTML=z(i.getAttribute("data-format"),n.textContent.trim())),c.includes(n.textContent.trim().toLowerCase())&&n.setAttribute("data-content",n.textContent.trim().toLowerCase())}})})},Mt=a=>{var t=0;return Array.from(a.querySelectorAll("tbody tr")).forEach((e,r)=>{var s=window.getComputedStyle(document.querySelector("html")),o=e.querySelector(":scope > *:last-child > *:first-child");if(o){o.classList.add("text-nowrap");var c=o.offsetWidth/parseFloat(s.fontSize);c+=1.7,t=t>c?t:c}}),t},Ct=a=>{if(a.closest(".table--fullwidth")||a.querySelectorAll("thead tr th").length<4)return!1;Array.from(a.querySelectorAll("tbody tr")).forEach((t,e)=>{var r=t.querySelector(":scope > :is(td,th):first-child"),s=r.textContent;if(s!="")r.innerHTML='<span class="td__content">'.concat(s,'</span><button type="button" class="d-none">').concat(s,"</button>");else{var o=t.querySelector(":scope > :is(td,th):nth-child(2)"),c=o.textContent;o.innerHTML='<span class="td__content">'.concat(c,'</span><button type="button" class="d-none">').concat(c,"</button>")}})},Ht=a=>{a.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("tr > :is(td,th):first-child button")){var e=t.target.closest("tr > :is(td,th):first-child button"),r=e.parentNode.closest("tr");r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),e.blur()}})},Z=(a,t)=>{var e=t.querySelector("[data-search]");if(!e)return!1;var r=e.getAttribute("id"),s=e.getAttribute("data-search").split(","),o=e.parentNode,c={};s.forEach((n,u)=>{Array.from(a.querySelectorAll('td[data-label="'+n.trim()+'"]')).forEach((i,l)=>{i.querySelector(".td__content")?c[i.querySelector(".td__content").textContent]=i.querySelector(".td__content").textContent:c[i.textContent]=i.textContent})}),e.setAttribute("list","".concat(r,"_list")),e.setAttribute("autocomplete","off"),o.querySelector("datalist")||(o.innerHTML+='<datalist id="'.concat(r,'_list"></datalist>')),o.querySelector("datalist").innerHTML="".concat(Object.keys(c).map(n=>'<option value="'.concat(n,'"></option>')).join(""))},Rt=(a,t,e,r,s)=>{var o,c=function(l){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.classList.contains("processing"))return!1;if(l.type=="submit"&&(t.classList.add("processing"),Array.from(t.querySelectorAll("[data-duplicate]")).forEach((v,p)=>{var L=v.getAttribute("data-duplicate"),w=document.getElementById(L),g=document.querySelector('[for="'.concat(L,'"] iam-card'));if(w.checked!=v.checked)if(g){var k=new Event("click");g.dispatchEvent(k)}else w.checked=v.checked}),t.classList.remove("processing")),t.hasAttribute("data-ajax")){if(!f){var h=t.querySelector("[data-pagination]");h.value=1,r.setAttribute("data-page",1)}at(a,t,e,r)}else t.hasAttribute("data-submit")?t.submit():($(a,t,r),C(r,e),D(a,t));if(t.hasAttribute("data-ajax-post")){var b=new FormData(t),d=new URLSearchParams(b).toString(),m=new XMLHttpRequest;m.open("GET","".concat(window.location.href,"?ajax=true&").concat(d)),m.send()}};t.addEventListener("keyup",i=>{clearTimeout(o),i&&i.target instanceof HTMLElement&&i.target.closest("[data-search]")&&(o=setTimeout(function(){c(i)},500))}),t.addEventListener("change",i=>{clearTimeout(o),i&&i.target instanceof HTMLElement&&i.target.closest("[data-sort]")&&(t.hasAttribute("data-submit")||W(a,t,s),c(i)),i&&i.target instanceof HTMLElement&&i.target.closest("[data-search]")&&c(i),i&&i.target instanceof HTMLElement&&i.target.closest("[data-filter][data-no-ajax]")?($(a,t,r),C(r,e),D(a,t)):(i&&i.target instanceof HTMLElement&&i.target.closest("[data-filter]")&&i.target.closest("form .dialog__wrapper > dialog")||i&&i.target instanceof HTMLElement&&i.target.closest("[data-filter]")&&!i.target.closest("form dialog"))&&c(i),i&&i.target instanceof HTMLElement&&i.target.closest("[data-show]")&&c(i),i&&i.target instanceof HTMLElement&&i.target.closest("[data-mimic]")&&c(i)}),t.addEventListener("click",i=>{if(clearTimeout(o),i&&i.target instanceof HTMLElement&&i.target.closest('dialog button:not([type="button"])')){var l=i.target.closest('dialog button:not([type="button"])'),f=l.closest("dialog");f.close()}if(i&&i.target instanceof HTMLElement&&i.target.closest(".dialog__close")&&(i.preventDefault(),i.stopPropagation()),i&&i.target instanceof HTMLElement&&i.target.closest("[data-clear]")){t.classList.add("processing"),Array.from(t.querySelectorAll(".applied-filters")).forEach((m,v)=>{m.innerHTML=""});for(var h=t.elements,b=0;b<h.length;b++){var d=h[b].type.toLowerCase()?h[b].type.toLowerCase():"text";switch(d){case"text":case"password":case"textarea":h[b].value="";break;case"radio":case"checkbox":h[b].checked&&(h[b].checked=!1);break;case"select-one":case"select-multi":h[b].selectedIndex=-1;break}}Array.from(t.querySelectorAll("label iam-card")).forEach((m,v)=>{var p=new Event("click");m.dispatchEvent(p)}),t.classList.remove("processing"),t.hasAttribute("data-submit")||W(a,t,s),c(i)}}),t.addEventListener("submit",i=>{clearTimeout(o),t.hasAttribute("data-submit")||i.preventDefault(),c(i)}),t.addEventListener("force",i=>{c(i)}),t.addEventListener("paginate",i=>{c(i,!0)});var n=[],u=[];Array.from(t.querySelectorAll("[data-mimic]")).forEach((i,l)=>{var f=i.getAttribute("data-mimic");Array.from(document.querySelectorAll('[name="'.concat(f,'"]'))).forEach((h,b)=>{var d=h.closest("form");n.includes(d)||n.push(d),u.includes(f)||u.push(f)})}),n.forEach((i,l)=>{var f=function(){var b=[],d=new FormData(i);for(var[m,v]of d)document.querySelector('[data-mimic="'.concat(m,'"]'))&&!b.includes(m)?(b.push(m),document.querySelector('[data-mimic="'.concat(m,'"]')).value=v):document.querySelector('[data-mimic="'.concat(m,'"]'))&&(document.querySelector('[data-mimic="'.concat(m,'"]')).value+=","+v);for(var p of b){var L=new Event("force");t.dispatchEvent(L)}for(var w of u)if(!d.has(w)&&i.querySelector('[name="'.concat(w,'"]'))){document.querySelector('[data-mimic="'.concat(w,'"]')).value="";var g=new Event("force");t.dispatchEvent(g)}};i.addEventListener("force",h=>{f()}),i.addEventListener("change",h=>{f()})})},W=(a,t,e)=>{if(t.getAttribute("data-ajax"))return!1;var r=a.querySelector("tbody"),s=t.querySelector("[data-sort]"),o=s.querySelector("option:nth-child(".concat(s.selectedIndex+1,")")),c=o.getAttribute("data-sort"),n=o.getAttribute("data-order"),u=o.getAttribute("data-format");if(!c)return r.innerHTML=e.innerHTML,K(a),!1;var i=[];["asc","desc","descending"].includes(n)||(i=n.split(","));var l=[];Array.from(r.querySelectorAll("tr")).forEach((h,b)=>{var d=h.querySelector('td[data-label="'+c+'"], th[data-label="'+c+'"]').textContent.trim();h.querySelector('[data-label="'+c+'"] .td__content')&&(d=h.querySelector('[data-label="'+c+'"] .td__content').textContent.trim()),i.length&&i.includes(d)&&(d=i.indexOf(d)),it(d)&&(d=ot(d,10)),u&&u=="date"&&(d=new Date(d));var m={index:d,row:h};l.push(m)}),l.sort((h,b)=>h.index>b.index?1:-1),(n=="descending"||n=="desc")&&(l=l.reverse());var f="";l.forEach((h,b)=>{f+=h.row.outerHTML}),r.innerHTML=f},$=(a,t,e)=>{a.classList.remove("table--filtered");var r=et(t),s=[],o=0,c=t.querySelector("[data-pagination]")?parseInt(t.querySelector("[data-pagination]").value):1,n=t.querySelector("[data-show]")?parseInt(t.querySelector("[data-show]").value):15;if(Array.from(a.querySelectorAll("tbody tr")).forEach((d,m)=>{d.classList.remove("filtered"),d.classList.remove("filtered--matched"),d.classList.remove("filtered--show"),d.removeAttribute("data-filtered-by")}),t.querySelector("[data-search]")){var u=t.querySelector("[data-search]"),i=t.querySelector("[data-search]").getAttribute("data-search").split(",");i.forEach((d,m)=>{s.push({column:"".concat(d.trim()),value:"".concat(u.value)})})}Array.from(t.querySelectorAll("[data-filter-count]")).forEach((d,m)=>{d.innerHTML="",d.parentNode.classList.remove("hover")});var l=0;Object.values(r).forEach((d,m)=>{typeof d=="object"&&Object.values(d).length?l+=Object.values(d).length:l++}),l&&Array.from(t.querySelectorAll("[data-filter-count]")).forEach((d,m)=>{d.innerHTML+="(".concat(l,")"),d.parentNode.classList.add("hover")}),a.classList.add("table--filtered");var f=function(m,v){Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((p,L)=>{var w=!1;v.forEach((g,k)=>{var q=p.querySelector('[data-label="'.concat(m,'"]'));if(g&&g=="$today")g=z("date",new Date);else if(g&&g=="$yesterday"){var x=new Date;x.setDate(x.getDate()-1),g=z("date",x)}else if(g&&(g=="$thisWeek"||g=="$lastWeek")){var y=new Date,A=new Date(y.setDate(y.getDate()-(y.getDay()-1))),T=new Date(y.setDate(y.getDate()-y.getDay()+7)),S=new Date(q.textContent.toLowerCase());if(y.setHours(0,0,0,0),A.setHours(0,0,0,0),T.setHours(0,0,0,0),S.setHours(0,0,0,0),g=="$thisWeek")w=S>=A&&S<=T;else{var E=new Date(A.setDate(A.getDate()-7)),M=new Date(T.setDate(T.getDate()-7));E.setHours(0,0,0,0),M.setHours(0,0,0,0),w=S>=E&&S<=M}}else if(g&&g=="$thisMonth"){var I=new Date,B=I.getFullYear(),j=I.getMonth(),H=new Date(B,j,1),G=new Date(B,j+1,0),R=new Date(q.textContent.toLowerCase());H.setHours(0,0,0,0),G.setHours(0,0,0,0),R.setHours(0,0,0,0),w=R>=H&&R<=G}else if(g&&g=="$lastMonth"){var _=new Date,P=_.getFullYear(),O=_.getMonth(),F=new Date(P,O-1,1),V=new Date(P,O,0),X=new Date(q.textContent.toLowerCase());F.setHours(0,0,0,0),V.setHours(0,0,0,0),X.setHours(0,0,0,0),w=X>=F&&X<=V}q&&q.textContent.toLowerCase().includes(g.toLowerCase())&&(w=!0)}),w||(p.classList.add("filtered"),p.setAttribute("data-filtered-by",m))})};for(var[h,b]of Object.entries(r))f(h,b);Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((d,m)=>{var v=!(s.length>0&&s[0].value.length>=3);s.forEach((p,L)=>{var w=d.querySelector('[data-label="'.concat(p.column,'"]'));w&&p.value.length>=3&&w.textContent.toLowerCase().includes(p.value.toLowerCase())&&(v=!0)}),v||d.classList.add("filtered")}),Array.from(a.querySelectorAll("tbody tr:not(.filtered")).forEach((d,m)=>{o++,d.classList.add("filtered--matched");var v=Math.ceil(o/n);v==parseInt(c)&&d.classList.add("filtered--show")}),e&&(e.setAttribute("data-page",c),e.setAttribute("data-pages",Math.ceil(o/n)),e.setAttribute("data-total",o),e.setAttribute("data-show",n))},D=(a,t,e)=>{var r=Array.from(t.querySelectorAll("[data-query]"));r.forEach((s,o)=>{var c=s.getAttribute("data-query"),n;if(c=="total")e.hasAttribute("data-total")?n=e.getAttribute("data-total"):n=(a.classList.contains("table--filtered"),a.querySelectorAll("tbody tr").length);else if(!c.includes(" == ")&&c.includes(" & ")){var u=c.split(" & "),i="";u.forEach(h=>{i+=':not([data-filtered-by="'.concat(h,'"])')}),n=Array.from(a.querySelectorAll("tbody tr".concat(i))).length}else if(!c.includes(" == "))n=Array.from(a.querySelectorAll('tbody tr:not([data-filtered-by="'.concat(c,'"])'))).length;else if(c.includes(" && ")){var l=c.split(" && ");n=Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).filter(function(h){var b=!0;for(var[d,m]of Object.entries(l)){var v=m.split(" == ");(!h.querySelector('td[data-label="'.concat(v[0],'"]'))||h.querySelector('td[data-label="'.concat(v[0],'"]')).textContent!="".concat(v[1]))&&(b=!1)}return b}).length}else{var f=c.split(" == ");n=Array.from(a.querySelectorAll('tbody tr.filtered--matched td[data-label="'.concat(f[0],'"], tbody tr[data-filtered-by="').concat(f[0],'"] td[data-label="').concat(f[0],'"]'))).filter(function(h){return h.textContent===f[1]}).length}s.hasAttribute("data-total")?s.setAttribute("data-total",n):s.innerHTML=n})},Nt=function(t,e,r,s){r.addEventListener("click",o=>{if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-page]")){o.preventDefault();var c=e.querySelector("[data-pagination]"),n=o.target.closest("[data-page]").getAttribute("data-page");if(c.value=n,s.setAttribute("data-page",n),e.dispatchEvent(new Event("paginate")),t.hasAttribute("data-show-history")){var u=new URL(location);u.searchParams.set("page",n),history.pushState({type:"pagination",form:e.getAttribute("id"),page:n},"",u)}var i=-250,l=t.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:l,behavior:"smooth"})}if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-show]")){o.preventDefault();var f=e.querySelector("[data-show]"),h=o.target.closest("[data-show]").getAttribute("data-show");f.value=h,s.setAttribute("data-show",h),e.dispatchEvent(new Event("submit"))}})},Dt=(a,t)=>{if(!a)return!1;a.addEventListener("click",e=>{It(t)})},It=function(t){for(var e=[],r=t.getElementsByTagName("tr"),s=0;s<r.length;s++){for(var o=r[s].querySelectorAll("td,th"),c=[],n=0;n<o.length;n++)c.push('"'.concat(o[n].textContent,'"'));e.push(c.join(","))}e=e.join(`
55
+ `);var u=new Blob([e],{type:"text/csv"}),i=document.createElement("a");i.download="export.csv";var l=window.URL.createObjectURL(u);i.href=l,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},tt=function(t,e,r,s){if(K(t),Ct(t),D(t,e,s),s&&s.classList.contains("table--cta")){let c=function(){Array.from(t.querySelectorAll("tr")).forEach((n,u)=>{var i=n.offsetHeight;n.style.setProperty("--row-height","".concat(i,"px"))})};var o=Mt(t);s.style.setProperty("--cta-width","".concat(o,"rem")),new ResizeObserver(c).observe(t)}},et=function(t){var e=new Object,r=Array.from(t.querySelectorAll("[data-filter]"));return r.forEach((s,o)=>{if(!(s.type=="radio"&&!s.checked)&&!(s.type=="checkbox"&&!s.checked)&&s&&s.value){var c=s.getAttribute("data-filter");e[c]||(e[c]=new Array),e[c].push(s.value)}}),e},at=function(t,e,r,s){return kt(this,void 0,void 0,function*(){var o=(d,m,v)=>m.split(/[\.\[\]\'\"]/).filter(p=>p).reduce((p,L)=>p?p[L]:v,d),c=new FormData(e),n=new URLSearchParams(c).toString(),u=t.querySelectorAll("thead tr th"),i=t.querySelector("tbody"),l=e.getAttribute("data-ajax");s.classList.add("table--loading");var f=et(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((d,m)=>{d.innerHTML="",d.parentNode.classList.remove("hover")});var h=0;Object.values(f).forEach((d,m)=>{typeof d=="object"&&Object.values(d).length?h+=Object.values(d).length:h++}),h&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((d,m)=>{d.innerHTML+="(".concat(h,")"),d.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[l]&&window.controller[l].abort(),window.controller[l]=new AbortController;var{signal:b}=controller[l];try{yield fetch(l+"?"+n,{signal:b,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(d=>d.json()).then(d=>{var m=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",v=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",p=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",L=o(d,v,1),w=o(d,p,1),g=o(d,m),k=s.hasAttribute("data-empty-msg")?s.getAttribute("data-empty-msg"):"No results found";g?(i.innerHTML="",g.forEach((q,x)=>{var y=document.createElement("tr");u.forEach((A,T)=>{var S="",E=document.createElement("td");if(E.setAttribute("data-label",A.innerText),A.getAttribute("data-output")){var M=A.getAttribute("data-output");S=M.replace(new RegExp(/{(.*?)}/,"gm"),function(j){return o(q,j.replace("{","").replace("}",""))})}if(A.hasAttribute("data-output-array")){var M=A.getAttribute("data-output"),I=o(q,M.replace("{","").replace("}",""));S="",I.forEach((H,G)=>{var R=A.getAttribute("data-output-array"),_="";if(A.hasAttribute("data-output-array-property")&&A.hasAttribute("data-output-array-transform")){var P=o(H,A.getAttribute("data-output-array-property")),O=JSON.parse(A.getAttribute("data-output-array-transform")),F=O[P];_=R.replace("{".concat(A.getAttribute("data-output-array-property"),"}"),F)}_=_.replace(new RegExp(/{(.*?)}/,"gm"),function(V){return o(H,V.replace("{","").replace("}",""))}),S+=_})}if(A.hasAttribute("data-transform")){var B=JSON.parse(A.getAttribute("data-transform"));S=B[S],!S&&A.hasAttribute("data-default")&&(S=A.getAttribute("data-default"))}E.innerHTML=S,y.appendChild(E)}),i.appendChild(y)}),Z(t,e),s.setAttribute("data-total",parseInt(L)),s.setAttribute("data-page",parseInt(w)),s.setAttribute("data-pages",Math.ceil(s.getAttribute("data-total")/s.getAttribute("data-show"))),tt(t,e,r,s),C(s,r),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((q,x)=>{var y=o(d,q.getAttribute("data-ajax-query"),"");q.hasAttribute("data-total")?q.setAttribute("data-total",y):q.innerHTML=y}),parseInt(L)==0&&(i.innerHTML='<tr><td colspan="100%"><span>'.concat(k,"</span></td></tr>")),s.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:l,formData:n})):i.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>'})}catch(d){console.log(d)}})},z=(a,t)=>{switch(a){case"datetime":return new Date(t).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(t).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(t).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return t=ct(t)}};class Bt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r=document.createElement("template");r.innerHTML=`
56
56
  <style>
57
57
  @import "`.concat(e,`";
58
58
 
@@ -75,7 +75,7 @@
75
75
  </div>
76
76
  </div>
77
77
  <div class="table__pagination"></div>
78
- `),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){var t=new URLSearchParams(window.location.search);this.hasAttribute("data-total")||this.setAttribute("data-total",this.querySelectorAll("table tbody tr").length),this.hasAttribute("data-page")||this.setAttribute("data-page",t.has("page")?t.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",15),this.hasAttribute("data-increment")||this.setAttribute("data-increment",15),this.setAttribute("data-pages",Math.ceil(this.getAttribute("data-total")/this.getAttribute("data-show")));var e=this.classList.toString();e=e.replace("table--cta",""),e=e.replace("table--loading",""),this.shadowRoot.querySelector(".table__wrapper").className+=" ".concat(e),this.querySelector(".actionbar__sticky")&&this.shadowRoot.querySelector(".table__wrapper").classList.add("has-actionbar"),this.table=this.querySelector("table"),this.savedTableBody=this.table.querySelector("tbody").cloneNode(!0),this.pagination=this.shadowRoot.querySelector(".table__pagination");var r=this.classList.contains("table--cta");if(r||this.shadowRoot.querySelector(".table--cta").classList.remove("table--cta"),this.form=document.createElement("form"),this.hasAttribute("data-filterby")?this.form=document.querySelector("#".concat(this.getAttribute("data-filterby"))):this.table.parentNode.insertBefore(this.form,this.table.nextSibling),this.form.hasAttribute("data-ajax")&&this.table.classList.add("table--ajax"),Z(this.table,this.form),this.form.querySelector("[data-page]")||(this.form.innerHTML+='<input name="page" type="hidden" value="'.concat(this.getAttribute("data-page"),'" data-pagination="true" />')),this.form.querySelector("[data-show]")||(this.form.innerHTML+='<input name="show" type="hidden" value="'.concat(this.getAttribute("data-show"),'" data-show="true" />')),Ht(this.table),Rt(this.table,this.form,this.pagination,this,this.savedTableBody),Nt(this.table,this.form,this.pagination,this),Dt(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax")?at(this.table,this.form,this.pagination,this):(tt(this.table,this.form,this.pagination,this),$(this.table,this.form,this),C(this,this.pagination),D(this.table,this.form)),this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",o=>{this.table.querySelector("dialog[open]")&&(this.table.querySelector("dialog[open]").close(),this.table.querySelector(".dialog__wrapper > button.active").classList.remove("active"))}),this.querySelector("iam-actionbar[data-selectall]")){var s=this.querySelector("iam-actionbar[data-selectall]");Array.from(this.table.querySelectorAll("thead tr")).forEach((o,n)=>{o.insertAdjacentHTML("afterbegin","<th></th>")}),Array.from(this.table.querySelectorAll("tbody tr")).forEach((o,n)=>{o.insertAdjacentHTML("afterbegin",'<td class="selectrow"><input type="checkbox" name="row" id="row'.concat(n,'"/><label for="row').concat(n,'"><span class="visually-hidden">Select row</span></label></td>'))}),this.table.addEventListener("change",o=>{if(o&&o.target instanceof HTMLElement&&o.target.closest(".selectrow input")){var n=this.table.querySelectorAll('.selectrow input[type="checkbox"]').length,c=this.table.querySelectorAll('.selectrow input[type="checkbox"]:checked').length;s.setAttribute("data-selected",n==c?"all":c),console.log(c)}}),s.addEventListener("selected",o=>{console.log(o.detail.selected),o.detail.selected=="0"?Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((n,c)=>{n.checked=!1}):o.detail.selected=="all"&&Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((n,c)=>{n.checked=!0})})}}static get observedAttributes(){return["data-total","data-pages","data-page","data-show"]}attributeChangedCallback(t,e,r){}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class jt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");var t=this.classList.toString(),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"):"".concat(e,"/css/core.min.css"),s='@import "'.concat(e,'/css/components/card.css";'),o=document.createElement("template");o.innerHTML=`
78
+ `),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){var t=new URLSearchParams(window.location.search);this.hasAttribute("data-total")||this.setAttribute("data-total",this.querySelectorAll("table tbody tr").length),this.hasAttribute("data-page")||this.setAttribute("data-page",t.has("page")?t.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",15),this.hasAttribute("data-increment")||this.setAttribute("data-increment",15),this.setAttribute("data-pages",Math.ceil(this.getAttribute("data-total")/this.getAttribute("data-show")));var e=this.classList.toString();e=e.replace("table--cta",""),e=e.replace("table--loading",""),this.shadowRoot.querySelector(".table__wrapper").className+=" ".concat(e),this.querySelector(".actionbar__sticky")&&this.shadowRoot.querySelector(".table__wrapper").classList.add("has-actionbar"),this.table=this.querySelector("table"),this.savedTableBody=this.table.querySelector("tbody").cloneNode(!0),this.pagination=this.shadowRoot.querySelector(".table__pagination");var r=this.classList.contains("table--cta");if(r||this.shadowRoot.querySelector(".table--cta").classList.remove("table--cta"),this.form=document.createElement("form"),this.hasAttribute("data-filterby")?this.form=document.querySelector("#".concat(this.getAttribute("data-filterby"))):this.table.parentNode.insertBefore(this.form,this.table.nextSibling),this.form.hasAttribute("data-ajax")&&this.table.classList.add("table--ajax"),Z(this.table,this.form),this.form.querySelector("[data-page]")||(this.form.innerHTML+='<input name="page" type="hidden" value="'.concat(this.getAttribute("data-page"),'" data-pagination="true" />')),this.form.querySelector("[data-show]")||(this.form.innerHTML+='<input name="show" type="hidden" value="'.concat(this.getAttribute("data-show"),'" data-show="true" />')),Ht(this.table),Rt(this.table,this.form,this.pagination,this,this.savedTableBody),Nt(this.table,this.form,this.pagination,this),Dt(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax")?at(this.table,this.form,this.pagination,this):(tt(this.table,this.form,this.pagination,this),$(this.table,this.form,this),C(this,this.pagination),D(this.table,this.form)),this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",o=>{this.table.querySelector("dialog[open]")&&(this.table.querySelector("dialog[open]").close(),this.table.querySelector(".dialog__wrapper > button.active").classList.remove("active"))}),this.querySelector("iam-actionbar[data-selectall]")){var s=this.querySelector("iam-actionbar[data-selectall]");Array.from(this.table.querySelectorAll("thead tr")).forEach((o,c)=>{o.insertAdjacentHTML("afterbegin","<th></th>")}),Array.from(this.table.querySelectorAll("tbody tr")).forEach((o,c)=>{o.insertAdjacentHTML("afterbegin",'<td class="selectrow"><input type="checkbox" name="row" id="row'.concat(c,'"/><label for="row').concat(c,'"><span class="visually-hidden">Select row</span></label></td>'))}),this.table.addEventListener("change",o=>{if(o&&o.target instanceof HTMLElement&&o.target.closest(".selectrow input")){var c=this.table.querySelectorAll('.selectrow input[type="checkbox"]').length,n=this.table.querySelectorAll('.selectrow input[type="checkbox"]:checked').length;s.setAttribute("data-selected",c==n?"all":n),console.log(n)}}),s.addEventListener("selected",o=>{console.log(o.detail.selected),o.detail.selected=="0"?Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((c,n)=>{c.checked=!1}):o.detail.selected=="all"&&Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((c,n)=>{c.checked=!0})})}}static get observedAttributes(){return["data-total","data-pages","data-page","data-show"]}attributeChangedCallback(t,e,r){}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class jt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");var t=this.classList.toString(),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"):"".concat(e,"/css/core.min.css"),s='@import "'.concat(e,'/css/components/card.css";'),o=document.createElement("template");o.innerHTML=`
79
79
  <style>
80
80
  @import "`.concat(r,`";
81
81
  `).concat(s,`
@@ -92,7 +92,7 @@
92
92
  <slot name="checkbox"></slot>
93
93
  `).concat(this.hasAttribute("data-cta")?'<div class="card__footer"><span class="link">'.concat(this.getAttribute("data-cta"),"</span></div>"):"",`
94
94
  </div>
95
- `),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){this.classList.add("loaded");var t=this.parentNode.closest("a, button, label"),e=this.shadowRoot.querySelector(".card");if(t.setAttribute("tabindex","-1"),t.matches("label[for]")){var r=document.getElementById(t.getAttribute("for")).checked;r?e.classList.add("checked"):e.classList.remove("checked")}this.addEventListener("click",s=>{var o=new Event("click");e.dispatchEvent(o)}),e.addEventListener("click",s=>{if(t.matches("label[for]")){s.stopPropagation(),s.preventDefault();var o=document.getElementById(t.getAttribute("for")),n=o.getAttribute("name"),c=o.getAttribute("id"),u=Array.from(document.querySelectorAll('[name="'.concat(n,'"][type="radio"]:not([id="').concat(c,'"])')));u.forEach((l,f)=>{var h=document.querySelector('[for="'.concat(l.getAttribute("id"),'"] iam-card'));h.dispatchEvent(new Event("inactive"))}),t.click();var i=o.checked;i?e.classList.add("checked"):e.classList.remove("checked")}}),this.addEventListener("inactive",s=>{e.classList.remove("checked")}),e.addEventListener("keydown",s=>{switch(s.keyCode){case 32:case 13:if(t.matches("label[for]")){s.stopPropagation(),s.preventDefault();var o=document.getElementById(t.getAttribute("for")),n=o.getAttribute("name"),c=o.getAttribute("id"),u=Array.from(document.querySelectorAll('[name="'.concat(n,'"]:not([id="').concat(c,'"])')));u.forEach((l,f)=>{var h=document.querySelector('[for="'.concat(l.getAttribute("id"),'"] iam-card'));h.dispatchEvent(new Event("inactive"))}),t.click();var i=o.checked;i?e.classList.add("checked"):e.classList.remove("checked")}else t.click();break}})}static get observedAttributes(){return["data-total","class"]}attributeChangedCallback(t,e,r){switch(t){case"data-total":{this.shadowRoot.querySelector(".card__total")&&(this.shadowRoot.querySelector(".card__total").innerHTML=r);break}case"class":{var s=this.classList.toString();this.querySelector('[class*="fa-"]')&&(s+=" card--has-icon"),this.shadowRoot.querySelector(".card").setAttribute("class","card ".concat(s));break}}}}function Pt(a,t){function e(r,s){console.log("hey");var o=!1,n=s.getAttribute("name");n.includes("[]")&&(n=n.replace("[]","[".concat(s.value,"]")));var c=r.querySelector('[data-name="'.concat(n,'"]'));c&&s.getAttribute("type")=="checkbox"&&(o=!0);var u=s.getAttribute("data-filter-text");if(c||(c=document.createElement("button"),r.appendChild(c)),c.setAttribute("type","button"),c.classList.add("filter"),c.setAttribute("data-name",n),c.innerHTML=u.replace("$value",s.value),(!s.value||o)&&c.remove(),s.parentNode.closest("[data-filter-text]")){var i=s.parentNode.closest("[data-filter-text]"),l=!0;if(n="",i.querySelectorAll("input").forEach((b,d)=>{var m=b.getAttribute("name");if(n+="".concat(d!=0?",":"").concat(m),r.querySelector('[data-name="'.concat(m,'"]'))&&r.querySelector('[data-name="'.concat(m,'"]')).remove(),b.value){var v=document.createElement("button");v.setAttribute("type","button"),v.classList.add("filter"),v.setAttribute("data-name",m),v.innerHTML=u.replace("$value",b.value),r.appendChild(v)}else l=!1}),r.querySelector('[data-name="'.concat(n,'"]'))&&r.querySelector('[data-name="'.concat(n,'"]')).remove(),l){var f=i.getAttribute("data-filter-text");i.querySelectorAll("input").forEach((b,d)=>{var m=b.getAttribute("name");r.querySelector('[data-name="'.concat(m,'"]'))&&r.querySelector('[data-name="'.concat(m,'"]')).remove(),f=f.replace("$".concat(d+1),b.value)});var h=document.createElement("button");h.setAttribute("type","button"),h.classList.add("filter"),h.setAttribute("data-name",n),h.innerHTML=f,r.appendChild(h)}}}Array.from(a.querySelectorAll('input[type="checkbox"]:checked')).forEach((r,s)=>{e(t,r)}),a.addEventListener("change",function(r){if(r&&r.target instanceof HTMLElement&&r.target.closest("input[data-filter-text]")){var s=r.target.closest("input[data-filter-text]");e(t,s)}}),t.addEventListener("click",function(r){if(r&&r.target instanceof HTMLElement&&r.target.closest(".filter")){for(var s=r.target.closest(".filter"),o=s.getAttribute("data-name").split(","),n=0;n<o.length;n++){var c=o[n],u='[name="'.concat(c,'"]');if(c.match(/\[(.*)\]/)){c.replace(/\[(.*)\]/,"[]");var i=c.replace(/.*\[(.*)\]/,"$1");u='[value="'.concat(i,'"]')}for(var l=a.querySelectorAll(u),f=0;f<l.length;f++){var h=l[f];if(h.getAttribute("type")!="radio"&&h.getAttribute("type")!="checkbox")h.value="";else{h.checked=!1;var r=new Event("force");a.hasAttribute("data-nosubmit")||h.closest("form").dispatchEvent(r)}}}s.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class Ot extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r='@import "'.concat(t,'/css/components/applied-filters.css";'),s=this.classList.toString(),o=document.createElement("template");o.innerHTML=`
95
+ `),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){this.classList.add("loaded");var t=this.parentNode.closest("a, button, label"),e=this.shadowRoot.querySelector(".card");if(t.setAttribute("tabindex","-1"),t.matches("label[for]")){var r=document.getElementById(t.getAttribute("for")).checked;r?e.classList.add("checked"):e.classList.remove("checked")}this.addEventListener("click",s=>{var o=new Event("click");e.dispatchEvent(o)}),e.addEventListener("click",s=>{if(t.matches("label[for]")){s.stopPropagation(),s.preventDefault();var o=document.getElementById(t.getAttribute("for")),c=o.getAttribute("name"),n=o.getAttribute("id"),u=Array.from(document.querySelectorAll('[name="'.concat(c,'"][type="radio"]:not([id="').concat(n,'"])')));u.forEach((l,f)=>{var h=document.querySelector('[for="'.concat(l.getAttribute("id"),'"] iam-card'));h.dispatchEvent(new Event("inactive"))}),t.click();var i=o.checked;i?e.classList.add("checked"):e.classList.remove("checked")}}),this.addEventListener("inactive",s=>{e.classList.remove("checked")}),e.addEventListener("keydown",s=>{switch(s.keyCode){case 32:case 13:if(t.matches("label[for]")){s.stopPropagation(),s.preventDefault();var o=document.getElementById(t.getAttribute("for")),c=o.getAttribute("name"),n=o.getAttribute("id"),u=Array.from(document.querySelectorAll('[name="'.concat(c,'"]:not([id="').concat(n,'"])')));u.forEach((l,f)=>{var h=document.querySelector('[for="'.concat(l.getAttribute("id"),'"] iam-card'));h.dispatchEvent(new Event("inactive"))}),t.click();var i=o.checked;i?e.classList.add("checked"):e.classList.remove("checked")}else t.click();break}})}static get observedAttributes(){return["data-total","class"]}attributeChangedCallback(t,e,r){switch(t){case"data-total":{this.shadowRoot.querySelector(".card__total")&&(this.shadowRoot.querySelector(".card__total").innerHTML=r);break}case"class":{var s=this.classList.toString();this.querySelector('[class*="fa-"]')&&(s+=" card--has-icon"),this.shadowRoot.querySelector(".card").setAttribute("class","card ".concat(s));break}}}}function Pt(a,t){function e(r,s){var o=!1,c=s.getAttribute("name");c.includes("[]")&&(c=c.replace("[]","[".concat(s.value,"]")));var n=r.querySelector('[data-name="'.concat(c,'"]'));n&&s.getAttribute("type")=="checkbox"&&(o=!s.checked);var u=s.getAttribute("data-filter-text");if(n||(n=document.createElement("button"),r.appendChild(n)),n.setAttribute("type","button"),n.classList.add("filter"),n.setAttribute("data-name",c),n.innerHTML=u.replace("$value",s.value),(!s.value||o)&&n.remove(),s.parentNode.closest("[data-filter-text]")){var i=s.parentNode.closest("[data-filter-text]"),l=!0;if(c="",i.querySelectorAll("input").forEach((b,d)=>{var m=b.getAttribute("name");if(c+="".concat(d!=0?",":"").concat(m),r.querySelector('[data-name="'.concat(m,'"]'))&&r.querySelector('[data-name="'.concat(m,'"]')).remove(),b.value){var v=document.createElement("button");v.setAttribute("type","button"),v.classList.add("filter"),v.setAttribute("data-name",m),v.innerHTML=u.replace("$value",b.value),r.appendChild(v)}else l=!1}),r.querySelector('[data-name="'.concat(c,'"]'))&&r.querySelector('[data-name="'.concat(c,'"]')).remove(),l){var f=i.getAttribute("data-filter-text");i.querySelectorAll("input").forEach((b,d)=>{var m=b.getAttribute("name");r.querySelector('[data-name="'.concat(m,'"]'))&&r.querySelector('[data-name="'.concat(m,'"]')).remove(),f=f.replace("$".concat(d+1),b.value)});var h=document.createElement("button");h.setAttribute("type","button"),h.classList.add("filter"),h.setAttribute("data-name",c),h.innerHTML=f,r.appendChild(h)}}}Array.from(a.querySelectorAll('input[type="checkbox"]:checked')).forEach((r,s)=>{e(t,r)}),Array.from(a.querySelectorAll("input[data-filter-text]")).forEach((r,s)=>{r.addEventListener("change",function(o){e(t,r),o.stopPropagation()})}),a.addEventListener("change",function(r){if(r&&r.target instanceof HTMLElement&&r.target.closest("input[data-filter-text]")){var s=r.target.closest("input[data-filter-text]");e(t,s)}}),t.addEventListener("click",function(r){if(r&&r.target instanceof HTMLElement&&r.target.closest(".filter")){for(var s=r.target.closest(".filter"),o=s.getAttribute("data-name").split(","),c=0;c<o.length;c++){var n=o[c],u='[name="'.concat(n,'"]');if(n.match(/\[(.*)\]/)){n.replace(/\[(.*)\]/,"[]");var i=n.replace(/.*\[(.*)\]/,"$1");u='[value="'.concat(i,'"]')}for(var l=a.querySelectorAll(u),f=0;f<l.length;f++){var h=l[f];if(h.getAttribute("type")!="radio"&&h.getAttribute("type")!="checkbox")h.value="";else{h.checked=!1;var r=new Event("force");a.hasAttribute("data-nosubmit")||h.closest("form").dispatchEvent(r)}}}s.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class Ot extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r='@import "'.concat(t,'/css/components/applied-filters.css";'),s=this.classList.toString(),o=document.createElement("template");o.innerHTML=`
96
96
  <style>
97
97
  @import "`.concat(e,`";
98
98
  `).concat(r,`
@@ -135,7 +135,7 @@
135
135
  <div class="list__wrapper">
136
136
  <slot></slot>
137
137
  </div>
138
- `),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString();this.shadowRoot.querySelector(".list__wrapper").setAttribute("class","list__wrapper ".concat(t)),this.querySelector("i.fa-search")||(this.innerHTML+='<i class="fa fa-light fa-search" aria-hidden="true" slot="icon"></i>'),Vt(this.querySelector("ul"),this.shadowRoot.querySelector("#search"))}}function zt(a){if(a.hasAttribute("data-type")&&a.getAttribute("data-type")=="toast"){var t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),a.closest(".notification__holder")||t.appendChild(a)}if(a.setAttribute("role","alert"),a.addEventListener("click",function(s){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(s.preventDefault(),U(a))},!1),a.hasAttribute("data-timeout")){var e=a.getAttribute("data-timeout"),r=new Ut(function(){U(a)},e);a.addEventListener("mouseenter",s=>{r.pause()}),a.addEventListener("mouseleave",s=>{r.resume()})}}function Ut(a,t){var e,r,s=t;this.pause=function(){window.clearTimeout(e),s-=new Date-r},this.resume=function(){r=new Date,window.clearTimeout(e),e=window.setTimeout(a,s)},this.resume()}var U=function(t){t.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class Gt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r='@import "'.concat(t,'/css/components/notification.css";'),s=this.querySelectorAll("a,button");Array.from(s).forEach((n,c)=>{n.setAttribute("slot","btns"),n.classList.add("link")}),(s.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");var o=document.createElement("template");o.innerHTML=`
138
+ `),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString();this.shadowRoot.querySelector(".list__wrapper").setAttribute("class","list__wrapper ".concat(t)),this.querySelector("i.fa-search")||(this.innerHTML+='<i class="fa fa-light fa-search" aria-hidden="true" slot="icon"></i>'),Vt(this.querySelector("ul"),this.shadowRoot.querySelector("#search"))}}function zt(a){if(a.hasAttribute("data-type")&&a.getAttribute("data-type")=="toast"){var t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),a.closest(".notification__holder")||t.appendChild(a)}if(a.setAttribute("role","alert"),a.addEventListener("click",function(s){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(s.preventDefault(),U(a))},!1),a.hasAttribute("data-timeout")){var e=a.getAttribute("data-timeout"),r=new Ut(function(){U(a)},e);a.addEventListener("mouseenter",s=>{r.pause()}),a.addEventListener("mouseleave",s=>{r.resume()})}}function Ut(a,t){var e,r,s=t;this.pause=function(){window.clearTimeout(e),s-=new Date-r},this.resume=function(){r=new Date,window.clearTimeout(e),e=window.setTimeout(a,s)},this.resume()}var U=function(t){t.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class Gt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r='@import "'.concat(t,'/css/components/notification.css";'),s=this.querySelectorAll("a,button");Array.from(s).forEach((c,n)=>{c.setAttribute("slot","btns"),c.classList.add("link")}),(s.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");var o=document.createElement("template");o.innerHTML=`
139
139
  <style>
140
140
  @import "`.concat(e,`";
141
141
  `).concat(r,`
@@ -147,5 +147,5 @@
147
147
  <div class="notification__inner"><div class="notification__text"><slot></slot></div>`).concat(s.length?'<div class="notification__btns"><slot name="btns"></slot></div>':"",`</div>
148
148
  `).concat(this.hasAttribute("data-dismiss")?'<div class="notification__dismiss"><button data-dismiss-button>Dismiss</button></div>':"",`
149
149
  </div>
150
- `),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){var t=this.shadowRoot.querySelector("[data-dismiss-button]"),e=this.hasAttribute("data-status")?this.getAttribute("data-status"):"white";this.hasAttribute("data-type")?this.classList.add("bg-".concat(e)):this.classList.add("colour-".concat(e));var r=this;if(!this.querySelector("i"))switch(e){case"danger":this.innerHTML+='<i class="fa-solid fa-circle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"warning":this.innerHTML+='<i class="fa-solid fa-triangle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"success":this.innerHTML+='<i class="fa-solid fa-check-circle" aria-hidden="true" slot="icon"></i>';break;default:this.innerHTML+='<i class="fa-solid fa-circle-info" aria-hidden="true" slot="icon"></i>'}zt(r),t&&t.addEventListener("click",function(s){U(r)},!1)}}document.addEventListener("DOMContentLoaded",function(){ut(),N(document.body),st(),lt(document.body),ht(document.body),window.customElements.get("iam-header")||window.customElements.define("iam-header",wt),window.customElements.get("iam-accordion")||window.customElements.define("iam-accordion",St),window.customElements.get("iam-tabs")||window.customElements.define("iam-tabs",_t),window.customElements.get("iam-table")||window.customElements.define("iam-table",Bt),window.customElements.get("iam-card")||window.customElements.define("iam-card",jt),window.customElements.get("iam-filterlist")||window.customElements.define("iam-filterlist",$t),window.customElements.get("iam-pagination")||window.customElements.define("iam-pagination",Ft),window.customElements.get("iam-applied-filters")||window.customElements.define("iam-applied-filters",Ot),window.customElements.get("iam-notification")||window.customElements.define("iam-notification",Gt),Array.from(document.querySelectorAll(".nav")).forEach(a=>{mt(a)}),Array.from(document.querySelectorAll(".testimonial")).forEach(a=>{bt(a)}),Array.from(document.querySelectorAll(".carousel")).forEach(a=>{vt(a)}),Array.from(document.querySelectorAll("form")).forEach(a=>{At(a)}),Array.from(document.querySelectorAll(".youtube-embed")).forEach(a=>{new ct(a)}),window.addEventListener("hashchange",function(){var a=location.hash.replace("#",""),t=document.querySelector('label[for="'.concat(a,'"]'));t instanceof HTMLElement&&t.click()},!1)})});
150
+ `),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){var t=this.shadowRoot.querySelector("[data-dismiss-button]"),e=this.hasAttribute("data-status")?this.getAttribute("data-status"):"white";this.hasAttribute("data-type")?this.classList.add("bg-".concat(e)):this.classList.add("colour-".concat(e));var r=this;if(!this.querySelector("i"))switch(e){case"danger":this.innerHTML+='<i class="fa-solid fa-circle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"warning":this.innerHTML+='<i class="fa-solid fa-triangle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"success":this.innerHTML+='<i class="fa-solid fa-check-circle" aria-hidden="true" slot="icon"></i>';break;default:this.innerHTML+='<i class="fa-solid fa-circle-info" aria-hidden="true" slot="icon"></i>'}zt(r),t&&t.addEventListener("click",function(s){U(r)},!1)}}document.addEventListener("DOMContentLoaded",function(){ut(),N(document.body),st(),lt(document.body),ht(document.body),window.customElements.get("iam-header")||window.customElements.define("iam-header",wt),window.customElements.get("iam-accordion")||window.customElements.define("iam-accordion",St),window.customElements.get("iam-tabs")||window.customElements.define("iam-tabs",_t),window.customElements.get("iam-table")||window.customElements.define("iam-table",Bt),window.customElements.get("iam-card")||window.customElements.define("iam-card",jt),window.customElements.get("iam-filterlist")||window.customElements.define("iam-filterlist",$t),window.customElements.get("iam-pagination")||window.customElements.define("iam-pagination",Ft),window.customElements.get("iam-applied-filters")||window.customElements.define("iam-applied-filters",Ot),window.customElements.get("iam-notification")||window.customElements.define("iam-notification",Gt),Array.from(document.querySelectorAll(".nav")).forEach(a=>{mt(a)}),Array.from(document.querySelectorAll(".testimonial")).forEach(a=>{bt(a)}),Array.from(document.querySelectorAll(".carousel")).forEach(a=>{vt(a)}),Array.from(document.querySelectorAll("form")).forEach(a=>{At(a)}),Array.from(document.querySelectorAll(".youtube-embed")).forEach(a=>{new nt(a)}),window.addEventListener("hashchange",function(){var a=location.hash.replace("#",""),t=document.querySelector('label[for="'.concat(a,'"]'));t instanceof HTMLElement&&t.click()},!1)})});
151
151
  //# sourceMappingURL=scripts.bundle.js.map