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