@iamproperty/components 3.7.0 → 3.7.2
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/table.css +1 -1
- package/assets/css/components/table.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/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/table/table.component.js +8 -1
- package/assets/js/components/table/table.component.min.js +13 -13
- package/assets/js/components/table/table.component.min.js.map +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +2 -2
- package/assets/js/dynamic.min.js.map +1 -1
- package/assets/js/modules/applied-filters.js +1 -1
- package/assets/js/modules/dialogs.js +12 -1
- package/assets/js/modules/table.js +202 -65
- package/assets/js/scripts.bundle.js +21 -21
- 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/table.spec.js +19 -13
- package/assets/sass/components/table.scss +125 -75
- package/assets/sass/foundations/reboot.scss +7 -3
- package/assets/ts/components/table/table.component.ts +12 -1
- package/assets/ts/modules/applied-filters.ts +1 -1
- package/assets/ts/modules/dialogs.ts +16 -5
- package/assets/ts/modules/table.ts +244 -69
- package/assets/ts/tests/table.spec.ts +6 -6
- package/dist/components.es.js +904 -839
- package/dist/components.umd.js +21 -21
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v3.7.
|
|
2
|
+
* iamKey v3.7.2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
|
-
*/(function(S){typeof define=="function"&&define.amd?define(S):S()})(function(){"use strict";var S=e=>(e.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&e.classList.add("ie"),null),at=e=>{var t=function(r){var i=document.querySelector('label[for="'.concat(r.replace("#",""),'"]')),o=document.querySelector(r+" summary"),n=document.querySelector("dialog".concat(r));i instanceof HTMLElement?i.click():o instanceof HTMLElement?o.click():n instanceof HTMLElement&&n.showModal()};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",a=>{if(a&&a.state.type&&a.state.type=="pagination"){var r=document.querySelector("#".concat(a.state.form)),i=document.querySelector("#".concat(a.state.form," [data-pagination]"));i?i.value=a.state.page:r.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(a.state.page,'" />'),r.dispatchEvent(new Event("submit"))}}),null},rt=function(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))},st=(e,t)=>String(e).padStart(t,"0"),it=e=>e.charAt(0).toUpperCase()+e.slice(1);class ot{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",function(a){for(var r=a.target;r&&r!=this;r=r.parentNode)if(r.matches("a")){a.preventDefault(),M(r);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((a,r)=>{var i=new Image;i.onload=function(){var o=document.createElement("script");o.src="https://www.youtube.com/iframe_api";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(o,n),document.body.classList.add("youtubeLoaded"),a(!0),o.onload=()=>{t.addEventListener("click",function(s){console.log("click"),s&&s.target instanceof HTMLElement&&s.target.closest("a")&&(s.preventDefault(),M(s.target.closest("a")))},!1)}},i.onerror=function(){r(!1)},i.src="https://youtube.com/favicon.ico"})}}var M=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var a=t.getAttribute("data-id"),r=t.getAttribute("id");if(typeof r>"u"||r==null){var i=String.fromCharCode(65+Math.floor(Math.random()*26));r=i+Date.now(),t.setAttribute("id",r)}function o(){window.player=new YT.Player(r,{height:"100%",width:"100%",videoId:a,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:n,onStateChange:l}})}o();function n(c){c.target.playVideo()}var s=!1;function l(c){if(c.data==YT.PlayerState.PLAYING&&!s){var u=document.getElementById(r);u.classList.add("player-ready"),s=!0}}},nt=e=>(e.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var a=t.target.closest("[data-modal]"),r=a.hasAttribute("data-modal")?a.getAttribute("data-modal"):a.getAttribute("data-filter"),i=document.querySelector("dialog#".concat(r));ct(i),i.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!i.classList.contains("dialog--multi")&&i.addEventListener("cancel",A=>{A.preventDefault()});var o=i.querySelector(".youtube-embed a");o&&M(o),i.showModal(),i.focus(),console.log(i.querySelector("button")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var n=t.target.closest("dialog[open]");t.preventDefault(),n.close(),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 s=t.target.closest("dialog[open]");window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:s.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)&&(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 u=t.target.closest(".dialog__wrapper > button"),h=t.target.closest(".dialog__wrapper > button").parentNode,f="openPopover",m=h.querySelector(":scope > dialog");if(document.querySelector("dialog[open]")&&document.querySelector("dialog[open]")!=m&&document.querySelector("dialog[open]").close(),m.hasAttribute("open"))m.close(),f="closePopover",m.removeAttribute("style"),u.classList.remove("active");else{m.show(),u.classList.add("active");var d=u.getBoundingClientRect(),b=d.top,v=d.left;if(u.closest("iam-table")){var g=u.closest("iam-table").parentNode.getBoundingClientRect();b-=g.top,v-=g.left}m.classList.contains("dialog--fix")&&m.setAttribute("style","position:fixed;top: ".concat(b,"px; left: ").concat(v,"px; margin: 3rem 0 0 0;"))}var C=m.getBoundingClientRect(),y=C.bottom-window.scrollY,p=window.innerHeight-window.scrollY;if(y>p){var $=m.getAttribute("style");m.setAttribute("style",$+"transform: translate(0, calc(-100% - 4rem))")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:f,id:u.textContent})}}),null),ct=e=>{if(e.classList.contains("dialog--multi")&&!e.querySelector(":scope > .steps")&<(e),!e.querySelector(":scope > .mh-lg")&&!e.classList.contains("dialog--multi")){e.innerHTML='<div class="mh-lg">'.concat(e.innerHTML,"</div>");var t=e.querySelector(".mh-lg"),a=e.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){var r=a.previousSibling;t.before(a),r&&a.before(r)}}e.querySelector(":scope > button:first-child")||(e.innerHTML='<button class="dialog__close">Close</button>'.concat(e.innerHTML))},lt=e=>{var t="",a=Array.from(e.querySelectorAll("fieldset[data-title]"));a.forEach((r,i)=>{t+='<button data-title="'.concat(r.getAttribute("data-title"),'" type="button" class="').concat(i==0?"active":"",'">').concat(r.getAttribute("data-title"),"</button>");var o=document.createElement("div");o.classList.add("btn--wrapper"),r.appendChild(o),i!=0&&(o.innerHTML+='<button data-title="'.concat(a[i-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" type="button">Previous</button>')),i!=a.length-1&&(o.innerHTML+='<button data-title="'.concat(a[i+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" type="button">Next</button>')),i==a.length-1&&(o.innerHTML+='<button class="btn btn-primary mb-0">Submit</button>')}),e.innerHTML='<div class="steps bg-primary">'.concat(t,"</div>").concat(e.innerHTML),e.addEventListener("click",r=>{if(r&&r.target instanceof HTMLElement&&r.target.closest("button[data-title]")){var i=r.target.closest("button[data-title]"),o=e.querySelector('fieldset[data-title="'.concat(i.getAttribute("data-title"),'"]')),n=e.querySelector('.steps button[data-title="'.concat(i.getAttribute("data-title"),'"]'));Array.from(e.querySelectorAll("button")).forEach((s,l)=>{s.classList.remove("active")}),Array.from(e.querySelectorAll("fieldset")).forEach((s,l)=>{s.classList.remove("active")}),n.classList.add("active"),o.classList.add("active")}return null})};function dt(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",e=>{e&&e.target instanceof HTMLElement&&e.target.closest("[open] summary")?window.dataLayer.push({event:"closeDetails",detailsTitle:e.target.closest("summary").textContent}):e&&e.target instanceof HTMLElement&&e.target.closest("summary")&&window.dataLayer.push({event:"openDetails",detailsTitle:e.target.closest("summary").textContent}),e&&e.target instanceof HTMLElement&&e.target.closest("a")&&window.dataLayer.push({event:"linkClicked",linkText:e.target.closest("a").hasAttribute("title")?e.target.closest("a").getAttribute("title"):e.target.closest("a").textContent,class:e.target.closest("a").hasAttribute("class")?e.target.closest("a").getAttribute("class"):"",href:e.target.closest("a").getAttribute("href")}),e&&e.target instanceof HTMLElement&&e.target.closest("button")&&window.dataLayer.push({event:"buttonClicked",buttonText:e.target.closest("button").textContent,class:e.target.closest("button").hasAttribute("class")?e.target.closest("button").getAttribute("class"):""})})}var ut=e=>{if(Array.from(e.querySelectorAll("details")).forEach((a,r)=>{a.addEventListener("mouseenter",function(i){window.matchMedia("(min-width: 62em)").matches&&a.setAttribute("open","true")},!1),a.addEventListener("mouseleave",function(i){window.matchMedia("(min-width: 62em)").matches&&a.removeAttribute("open")},!1)}),"IntersectionObserver"in window){var t=new IntersectionObserver(a=>{var[r]=a;return r.target.classList.toggle("is-stuck",r.intersectionRatio<1)},{threshold:[1]});t.observe(e)}};function ht(e){var t,a=e.querySelector(".testimonial__images"),r=a.querySelectorAll("img").length;if(r==1)return!1;e.classList.add("testimonial--multi");var i=function(n){var s=e.querySelector(".btn-next"),l=e.querySelector(".btn-prev");s.setAttribute("data-go",n+1),l.setAttribute("data-go",n-1),s.removeAttribute("disabled"),l.removeAttribute("disabled"),n==1?l.setAttribute("disabled",!0):n==r&&s.setAttribute("disabled",!0)};a.addEventListener("scroll",function(o){clearTimeout(t),t=setTimeout(function(){var n=a.scrollWidth,s=a.scrollHeight,l=a.scrollLeft,c=a.scrollTop,u=Math.round(l/n*r)+1;l==0&&c!=0&&(u=Math.round(c/s*r)+1),e.setAttribute("data-show",u),i(u)},300)},!1),e.addEventListener("click",function(o){for(var n=o.target;n&&n!=this;n=n.parentNode)if(n.matches("[data-go]")){var s=parseInt(n.getAttribute("data-go")),l=0,c=0,u=a.scrollWidth,h=a.scrollHeight;u>h?c=Math.floor(u*((s-1)/r)):l=Math.floor(h*((s-1)/r)),a.scroll({top:l,left:c,behavior:"smooth"});break}},!1)}function ft(e){var t,a=e.querySelector(".carousel__inner"),r=e.querySelectorAll(".carousel__item").length;e.getAttribute("data-cols");var i=e.getAttribute("data-sm-cols"),o=e.getAttribute("data-md-cols");e.querySelector(".carousel__controls a").classList.add("active"),a.addEventListener("scroll",function(n){clearTimeout(t),t=setTimeout(function(){var s=a.clientWidth,l=a.scrollWidth,c=a.scrollLeft,u=Math.round(c/l*r)+1,h=e.querySelector(".carousel__item:last-child").offsetLeft;Array.from(e.querySelectorAll(".carousel__controls a")).forEach((f,m)=>{f.classList.remove("active")}),e.querySelector(".control-"+u).classList.add("active"),u==1?e.querySelector(".btn-prev").setAttribute("disabled","disabled"):e.querySelector(".btn-prev").removeAttribute("disabled"),a.scrollLeft+s>h?e.querySelector(".btn-next").setAttribute("disabled","disabled"):e.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),e.addEventListener("click",function(n){for(var s=n.target;s&&s!=this;s=s.parentNode)if(s.matches(".carousel__controls a")){n.preventDefault(),Array.from(e.querySelectorAll(".carousel__controls a")).forEach((c,u)=>{c.classList.remove("active")}),s.classList.add("active");var l=document.querySelector(s.getAttribute("href"));a.scroll({top:0,left:l.offsetLeft,behavior:"smooth"});break}},!1),e.addEventListener("click",function(n){for(var s=n.target;s&&s!=this;s=s.parentNode)if(s.matches(".btn-next, .btn-prev")){n.preventDefault();var l=s.classList.contains("btn-prev")?a.scrollLeft-a.clientWidth:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:l,behavior:"smooth"});break}},!1),r==1&&e.classList.add("hide-btns"),i>=r&&e.classList.add("hide-sm-btns"),o>=r&&e.classList.add("hide-md-btns")}function mt(e){e.addEventListener("change",function(t){var a=parseInt(e.querySelector("[data-min] select,[data-min] input").value),r=parseInt(e.querySelector("[data-max] select,[data-max] input").value);Array.from(e.querySelectorAll("[data-min] input")).forEach((i,o)=>{i.setAttribute("max",r)}),Array.from(e.querySelectorAll("[data-max] input")).forEach((i,o)=>{i.setAttribute("min",a)}),Array.from(e.querySelectorAll("[data-min] select option")).forEach((i,o)=>{parseInt(i.getAttribute("value"))>r?i.classList.add("d-none"):i.classList.remove("d-none")}),Array.from(e.querySelectorAll("[data-max] select option")).forEach((i,o)=>{parseInt(i.getAttribute("value"))<a?i.classList.add("d-none"):i.classList.remove("d-none")})},!1)}function bt(e){e.addEventListener("change",function(t){if(e.matches("[data-value-if]")){var a=e.getAttribute("data-redirect"),r=e.getAttribute("data-value-if");e.value==r&&(document.location.href=a)}else typeof e.value<"u"&&(document.location.href=e.value)},!1)}function vt(e){var t=e.querySelector(".row"),a=t.cloneNode(!0),r=e.querySelector("[data-add]");e.addEventListener("click",function(i){for(var o=i.target;o&&o!=this;o=o.parentNode){if(o.matches("[data-add]")){var n=a.cloneNode(!0);e.insertBefore(n,o),r.matches("[data-maxfiles]")&&Array.from(e.querySelectorAll(":scope > .row")).length>=r.dataset.maxfiles&&r.setAttribute("disabled","disabled");break}if(o.matches("[data-delete]")){var s=o.closest(".row");s.remove(),r.matches("[data-maxfiles]")&&Array.from(e.querySelectorAll(":scope > .row")).length<r.dataset.maxfiles&&r.removeAttribute("disabled");break}}},!1)}function pt(e){Array.from(e.querySelectorAll("[data-input-range]")).forEach((t,a)=>{mt(t)}),Array.from(e.querySelectorAll("[data-redirect]")).forEach((t,a)=>{bt(t)}),Array.from(e.querySelectorAll(".multiple-file-uploads")).forEach((t,a)=>{vt(t)}),e.addEventListener("change",function(t){for(var a=t.target;a&&a!=this;a=a.parentNode)if(a.matches('[type="file"][data-filesize]')&&a.files&&a.files[0]){var r=a.dataset.filesize;a.files[0].size>r&&(a.value="",alert("File too large"));break}},!1),e.addEventListener("change",function(t){Array.from(e.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((a,r)=>{var i=a.closest("[data-group]")?a.closest("[data-group]"):e,o=a.dataset.activeif,n=a.dataset.equals,s=i.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]'));s.value==n?a.removeAttribute("disabled"):(a.setAttribute("disabled","disabled"),a.value="")}),Array.from(e.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((a,r)=>{var i=a.closest("[data-group]")?a.closest("[data-group]"):e,o=a.dataset.activeif,n=a.dataset.equals,s=i.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]'));s.value==n?a.classList.remove("d-none"):a.classList.add("d-none")})},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class gt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a='@import "'.concat(t,'/css/components/header.css";'),r=document.createElement("template");r.innerHTML=`
|
|
4
|
+
*/(function(C){typeof define=="function"&&define.amd?define(C):C()})(function(){"use strict";var C=e=>(e.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&e.classList.add("ie"),null),at=e=>{var t=function(r){var s=document.querySelector('label[for="'.concat(r.replace("#",""),'"]')),i=document.querySelector(r+" summary"),c=document.querySelector("dialog".concat(r));s instanceof HTMLElement?s.click():i instanceof HTMLElement?i.click():c instanceof HTMLElement&&c.showModal()};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",a=>{if(a&&a.state.type&&a.state.type=="pagination"){var r=document.querySelector("#".concat(a.state.form)),s=document.querySelector("#".concat(a.state.form," [data-pagination]"));s?s.value=a.state.page:r.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(a.state.page,'" />'),r.dispatchEvent(new Event("submit"))}}),null},rt=function(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))},st=(e,t)=>String(e).padStart(t,"0"),it=e=>e.charAt(0).toUpperCase()+e.slice(1);class ot{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",function(a){for(var r=a.target;r&&r!=this;r=r.parentNode)if(r.matches("a")){a.preventDefault(),V(r);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((a,r)=>{var s=new Image;s.onload=function(){var i=document.createElement("script");i.src="https://www.youtube.com/iframe_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(i,c),document.body.classList.add("youtubeLoaded"),a(!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(){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 a=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 i(){window.player=new YT.Player(r,{height:"100%",width:"100%",videoId:a,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:c,onStateChange:d}})}i();function c(n){n.target.playVideo()}var o=!1;function d(n){if(n.data==YT.PlayerState.PLAYING&&!o){var l=document.getElementById(r);l.classList.add("player-ready"),o=!0}}},nt=e=>(e.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var a=t.target.closest("[data-modal]"),r=a.hasAttribute("data-modal")?a.getAttribute("data-modal"):a.getAttribute("data-filter"),s=document.querySelector("dialog#".concat(r));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:r})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var c=t.target.closest("dialog[open]");t.preventDefault(),c.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((L,q)=>{L.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:c.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest('button[formmethod="dialog"]')){var o=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((L,q)=>{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 d=t.target.closest("dialog[open]");if(!d.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||d.classList.contains("dialog--multi")){var n=d.getBoundingClientRect();(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom)&&(d.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:d.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){var l=t.target.closest(".dialog__wrapper > button"),f=t.target.closest(".dialog__wrapper > button").parentNode,h="openPopover",b=f.querySelector(":scope > dialog");if(document.querySelector("dialog[open]")&&document.querySelector("dialog[open]")!=b&&document.querySelector("dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((L,q)=>{L.classList.remove("active")}),b.hasAttribute("open"))b.close(),h="closePopover",b.removeAttribute("style"),l.classList.remove("active");else{b.show(),l.classList.add("active");var u=l.getBoundingClientRect(),m=u.top,v=u.left;if(l.closest("iam-table")){var A=l.closest("iam-table").parentNode.getBoundingClientRect();m-=A.top,v-=A.left}b.classList.contains("dialog--fix")&&b.setAttribute("style","position:fixed;top: ".concat(m,"px; left: ").concat(v,"px; margin: 3rem 0 0 0;"))}var S=b.getBoundingClientRect(),y=S.bottom-window.scrollY,g=window.innerHeight-window.scrollY;if(y>g){var M=b.getAttribute("style");b.setAttribute("style",M+"transform: translate(0, calc(-100% - 4rem))")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:h,id:l.textContent})}}),null),ct=e=>{if(e.classList.contains("dialog--multi")&&!e.querySelector(":scope > .steps")&<(e),!e.querySelector(":scope > .mh-lg")&&!e.classList.contains("dialog--multi")){e.innerHTML='<div class="mh-lg">'.concat(e.innerHTML,"</div>");var t=e.querySelector(".mh-lg"),a=e.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){var r=a.previousSibling;t.before(a),r&&a.before(r)}}e.querySelector(":scope > button:first-child")||(e.innerHTML='<button class="dialog__close">Close</button>'.concat(e.innerHTML))},lt=e=>{var t="",a=Array.from(e.querySelectorAll("fieldset[data-title]"));a.forEach((r,s)=>{t+='<button data-title="'.concat(r.getAttribute("data-title"),'" type="button" class="').concat(s==0?"active":"",'">').concat(r.getAttribute("data-title"),"</button>");var i=document.createElement("div");i.classList.add("btn--wrapper"),r.appendChild(i),s!=0&&(i.innerHTML+='<button data-title="'.concat(a[s-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" type="button">Previous</button>')),s!=a.length-1&&(i.innerHTML+='<button data-title="'.concat(a[s+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" type="button">Next</button>')),s==a.length-1&&(i.innerHTML+='<button class="btn btn-primary mb-0">Submit</button>')}),e.innerHTML='<div class="steps bg-primary">'.concat(t,"</div>").concat(e.innerHTML),e.addEventListener("click",r=>{if(r&&r.target instanceof HTMLElement&&r.target.closest("button[data-title]")){var s=r.target.closest("button[data-title]"),i=e.querySelector('fieldset[data-title="'.concat(s.getAttribute("data-title"),'"]')),c=e.querySelector('.steps button[data-title="'.concat(s.getAttribute("data-title"),'"]'));Array.from(e.querySelectorAll("button")).forEach((o,d)=>{o.classList.remove("active")}),Array.from(e.querySelectorAll("fieldset")).forEach((o,d)=>{o.classList.remove("active")}),c.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",e=>{e&&e.target instanceof HTMLElement&&e.target.closest("[open] summary")?window.dataLayer.push({event:"closeDetails",detailsTitle:e.target.closest("summary").textContent}):e&&e.target instanceof HTMLElement&&e.target.closest("summary")&&window.dataLayer.push({event:"openDetails",detailsTitle:e.target.closest("summary").textContent}),e&&e.target instanceof HTMLElement&&e.target.closest("a")&&window.dataLayer.push({event:"linkClicked",linkText:e.target.closest("a").hasAttribute("title")?e.target.closest("a").getAttribute("title"):e.target.closest("a").textContent,class:e.target.closest("a").hasAttribute("class")?e.target.closest("a").getAttribute("class"):"",href:e.target.closest("a").getAttribute("href")}),e&&e.target instanceof HTMLElement&&e.target.closest("button")&&window.dataLayer.push({event:"buttonClicked",buttonText:e.target.closest("button").textContent,class:e.target.closest("button").hasAttribute("class")?e.target.closest("button").getAttribute("class"):""})})}var ut=e=>{if(Array.from(e.querySelectorAll("details")).forEach((a,r)=>{a.addEventListener("mouseenter",function(s){window.matchMedia("(min-width: 62em)").matches&&a.setAttribute("open","true")},!1),a.addEventListener("mouseleave",function(s){window.matchMedia("(min-width: 62em)").matches&&a.removeAttribute("open")},!1)}),"IntersectionObserver"in window){var t=new IntersectionObserver(a=>{var[r]=a;return r.target.classList.toggle("is-stuck",r.intersectionRatio<1)},{threshold:[1]});t.observe(e)}};function ht(e){var t,a=e.querySelector(".testimonial__images"),r=a.querySelectorAll("img").length;if(r==1)return!1;e.classList.add("testimonial--multi");var s=function(c){var o=e.querySelector(".btn-next"),d=e.querySelector(".btn-prev");o.setAttribute("data-go",c+1),d.setAttribute("data-go",c-1),o.removeAttribute("disabled"),d.removeAttribute("disabled"),c==1?d.setAttribute("disabled",!0):c==r&&o.setAttribute("disabled",!0)};a.addEventListener("scroll",function(i){clearTimeout(t),t=setTimeout(function(){var c=a.scrollWidth,o=a.scrollHeight,d=a.scrollLeft,n=a.scrollTop,l=Math.round(d/c*r)+1;d==0&&n!=0&&(l=Math.round(n/o*r)+1),e.setAttribute("data-show",l),s(l)},300)},!1),e.addEventListener("click",function(i){for(var c=i.target;c&&c!=this;c=c.parentNode)if(c.matches("[data-go]")){var o=parseInt(c.getAttribute("data-go")),d=0,n=0,l=a.scrollWidth,f=a.scrollHeight;l>f?n=Math.floor(l*((o-1)/r)):d=Math.floor(f*((o-1)/r)),a.scroll({top:d,left:n,behavior:"smooth"});break}},!1)}function ft(e){var t,a=e.querySelector(".carousel__inner"),r=e.querySelectorAll(".carousel__item").length;e.getAttribute("data-cols");var s=e.getAttribute("data-sm-cols"),i=e.getAttribute("data-md-cols");e.querySelector(".carousel__controls a").classList.add("active"),a.addEventListener("scroll",function(c){clearTimeout(t),t=setTimeout(function(){var o=a.clientWidth,d=a.scrollWidth,n=a.scrollLeft,l=Math.round(n/d*r)+1,f=e.querySelector(".carousel__item:last-child").offsetLeft;Array.from(e.querySelectorAll(".carousel__controls a")).forEach((h,b)=>{h.classList.remove("active")}),e.querySelector(".control-"+l).classList.add("active"),l==1?e.querySelector(".btn-prev").setAttribute("disabled","disabled"):e.querySelector(".btn-prev").removeAttribute("disabled"),a.scrollLeft+o>f?e.querySelector(".btn-next").setAttribute("disabled","disabled"):e.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),e.addEventListener("click",function(c){for(var o=c.target;o&&o!=this;o=o.parentNode)if(o.matches(".carousel__controls a")){c.preventDefault(),Array.from(e.querySelectorAll(".carousel__controls a")).forEach((n,l)=>{n.classList.remove("active")}),o.classList.add("active");var d=document.querySelector(o.getAttribute("href"));a.scroll({top:0,left:d.offsetLeft,behavior:"smooth"});break}},!1),e.addEventListener("click",function(c){for(var o=c.target;o&&o!=this;o=o.parentNode)if(o.matches(".btn-next, .btn-prev")){c.preventDefault();var d=o.classList.contains("btn-prev")?a.scrollLeft-a.clientWidth:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:d,behavior:"smooth"});break}},!1),r==1&&e.classList.add("hide-btns"),s>=r&&e.classList.add("hide-sm-btns"),i>=r&&e.classList.add("hide-md-btns")}function mt(e){e.addEventListener("change",function(t){var a=parseInt(e.querySelector("[data-min] select,[data-min] input").value),r=parseInt(e.querySelector("[data-max] select,[data-max] input").value);Array.from(e.querySelectorAll("[data-min] input")).forEach((s,i)=>{s.setAttribute("max",r)}),Array.from(e.querySelectorAll("[data-max] input")).forEach((s,i)=>{s.setAttribute("min",a)}),Array.from(e.querySelectorAll("[data-min] select option")).forEach((s,i)=>{parseInt(s.getAttribute("value"))>r?s.classList.add("d-none"):s.classList.remove("d-none")}),Array.from(e.querySelectorAll("[data-max] select option")).forEach((s,i)=>{parseInt(s.getAttribute("value"))<a?s.classList.add("d-none"):s.classList.remove("d-none")})},!1)}function bt(e){e.addEventListener("change",function(t){if(e.matches("[data-value-if]")){var a=e.getAttribute("data-redirect"),r=e.getAttribute("data-value-if");e.value==r&&(document.location.href=a)}else typeof e.value<"u"&&(document.location.href=e.value)},!1)}function vt(e){var t=e.querySelector(".row"),a=t.cloneNode(!0),r=e.querySelector("[data-add]");e.addEventListener("click",function(s){for(var i=s.target;i&&i!=this;i=i.parentNode){if(i.matches("[data-add]")){var c=a.cloneNode(!0);e.insertBefore(c,i),r.matches("[data-maxfiles]")&&Array.from(e.querySelectorAll(":scope > .row")).length>=r.dataset.maxfiles&&r.setAttribute("disabled","disabled");break}if(i.matches("[data-delete]")){var o=i.closest(".row");o.remove(),r.matches("[data-maxfiles]")&&Array.from(e.querySelectorAll(":scope > .row")).length<r.dataset.maxfiles&&r.removeAttribute("disabled");break}}},!1)}function pt(e){Array.from(e.querySelectorAll("[data-input-range]")).forEach((t,a)=>{mt(t)}),Array.from(e.querySelectorAll("[data-redirect]")).forEach((t,a)=>{bt(t)}),Array.from(e.querySelectorAll(".multiple-file-uploads")).forEach((t,a)=>{vt(t)}),e.addEventListener("change",function(t){for(var a=t.target;a&&a!=this;a=a.parentNode)if(a.matches('[type="file"][data-filesize]')&&a.files&&a.files[0]){var r=a.dataset.filesize;a.files[0].size>r&&(a.value="",alert("File too large"));break}},!1),e.addEventListener("change",function(t){Array.from(e.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((a,r)=>{var s=a.closest("[data-group]")?a.closest("[data-group]"):e,i=a.dataset.activeif,c=a.dataset.equals,o=s.querySelector('select[data-id="'.concat(i,'"],input[data-id="').concat(i,'"]'));o.value==c?a.removeAttribute("disabled"):(a.setAttribute("disabled","disabled"),a.value="")}),Array.from(e.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((a,r)=>{var s=a.closest("[data-group]")?a.closest("[data-group]"):e,i=a.dataset.activeif,c=a.dataset.equals,o=s.querySelector('select[data-id="'.concat(i,'"],input[data-id="').concat(i,'"]'));o.value==c?a.classList.remove("d-none"):a.classList.add("d-none")})},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class gt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a='@import "'.concat(t,'/css/components/header.css";'),r=document.createElement("template");r.innerHTML=`
|
|
5
5
|
<style>
|
|
6
6
|
@import "`.concat(t,`/css/core.min.css";
|
|
7
7
|
`).concat(a,`
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" lazy="" />
|
|
26
26
|
</picture>
|
|
27
27
|
</div>
|
|
28
|
-
`),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){var t=this.shadowRoot.querySelector("picture"),a=this.shadowRoot.querySelector("picture source");this.hasAttribute("image")?a.setAttribute("srcset",this.getAttribute("image")):t.remove()}}function yt(e){var t=e.querySelectorAll("details"),a=e.querySelectorAll("summary");if(t.forEach(
|
|
28
|
+
`),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){var t=this.shadowRoot.querySelector("picture"),a=this.shadowRoot.querySelector("picture source");this.hasAttribute("image")?a.setAttribute("srcset",this.getAttribute("image")):t.remove()}}function yt(e){var t=e.querySelectorAll("details"),a=e.querySelectorAll("summary");if(t.forEach(s=>{s.classList.add("accordion-item")}),a.forEach(s=>{s.classList.add("accordion-header"),s.classList.add("accordion-button"),s.classList.add("h4")}),!e.classList.contains("accordion--keep-open")){var r=e.querySelectorAll(":scope > details");r.forEach(s=>{s.addEventListener("click",()=>{r.forEach(i=>{i!==s&&i.removeAttribute("open")})})})}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});var $=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets";class At extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.createElement("template");t.innerHTML=`
|
|
29
29
|
<style>
|
|
30
|
-
@import "`.concat(
|
|
31
|
-
@import "`).concat(
|
|
30
|
+
@import "`.concat($,`/css/core.min.css";
|
|
31
|
+
@import "`).concat($,`/css/components/accordion.css";
|
|
32
32
|
`).concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",`
|
|
33
33
|
</style>
|
|
34
34
|
<div class="accordion">
|
|
35
35
|
<slot></slot>
|
|
36
36
|
</div>
|
|
37
|
-
`),this.shadowRoot.appendChild(t.content.cloneNode(!0))}connectedCallback(){yt(this),this.insertAdjacentHTML("beforebegin",'<link rel="stylesheet" href="'.concat(
|
|
37
|
+
`),this.shadowRoot.appendChild(t.content.cloneNode(!0))}connectedCallback(){yt(this),this.insertAdjacentHTML("beforebegin",'<link rel="stylesheet" href="'.concat($,'/css/components/accordion.css">'))}}var Lt=function(t){var a=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)),a.forEach((s,i)=>{var c=s.querySelector(":scope > summary");c.classList.add("visually-hidden");var o=document.createElement("button");s.hasAttribute("id")&&(o=document.createElement("a"),o.setAttribute("href","#".concat(s.getAttribute("id")))),s.hasAttribute("open")&&o.setAttribute("aria-pressed",!0),o.innerHTML="".concat(c.innerText),o.classList.add("link"),o.setAttribute("data-index",i),o.setAttribute("tabindex","-1"),r.appendChild(o)})},wt=function(t){var a=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(i=>{i.addEventListener("click",c=>{c.preventDefault(),s.forEach(o=>{var d=o==i;o.setAttribute("aria-pressed",d)}),a.forEach((o,d)=>{var n=i.getAttribute("data-index")==d;n?o.setAttribute("open",n):o.removeAttribute("open")}),i.hasAttribute("href")&&history.pushState(void 0,void 0,i.getAttribute("href")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:i.textContent})})}),r.forEach((i,c)=>{i.addEventListener("focus",o=>{s.forEach(d=>{d.classList.remove("focus")}),s[c].classList.add("focus")}),i.addEventListener("click",o=>{o.preventDefault(),s[c].click()})})},St=function(t){var a=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]")||(a[0].setAttribute("open",!0),r[0].setAttribute("aria-pressed",!0))},qt=function(t){Lt(t),wt(t),St(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class xt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.createElement("template");a.innerHTML=`
|
|
38
38
|
<style>
|
|
39
39
|
@import "`.concat(t,`/css/core.min.css";
|
|
40
40
|
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
<div class="tabs__links"></div>
|
|
49
49
|
<slot></slot>
|
|
50
50
|
</div>
|
|
51
|
-
`),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString().replace("container","");this.shadowRoot.querySelector(".tabs").setAttribute("class","tabs ".concat(t)),qt(this)}}var
|
|
51
|
+
`),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString().replace("container","");this.shadowRoot.querySelector(".tabs").setAttribute("class","tabs ".concat(t)),qt(this)}}var k=function(t,a){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"),i=t.getAttribute("data-total"),c=t.getAttribute("data-show"),o=t.getAttribute("data-increment");if(s<=1)return a.innerHTML="",!1;for(var d="",n=1;n<=s;n++)n==r?d+='<li class="page-item active" aria-current="page"><span class="page-link">'.concat(n,"</span></li>"):d+='<li class="page-item"><a href="?page='.concat(n,'" class="page-link" data-page="').concat(n,'">').concat(n,"</a></li>");return a.innerHTML=`<ul class="pagination mb-0 d-none d-sm-flex">
|
|
52
52
|
`.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>'),`
|
|
53
|
-
`).concat(
|
|
54
|
-
`).concat(r==
|
|
53
|
+
`).concat(d,`
|
|
54
|
+
`).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>'),`
|
|
55
55
|
</ul>`),a.innerHTML+=`<div class="d-sm-none text-center">
|
|
56
|
-
<span class="d-block pb-2">You've viewed `.concat(
|
|
57
|
-
<a href="?show=`).concat(parseInt(
|
|
58
|
-
</div>`),!0},D=e=>{var t=Array.from(e.querySelectorAll("thead th")),a=Array.from(e.querySelectorAll("tbody tr"));a.forEach((r,i)=>{var o=Array.from(r.querySelectorAll("th, td")),n=["Low","Medium","High","N/A","Pending","Verified","Incomplete","Completed","Requires approval"];o.forEach((s,l)=>{var c=t[l];if(typeof c<"u"){var u=document.createElement("div");u.innerHTML=c.innerHTML;var h=u.textContent||u.innerText||"";s.setAttribute("data-label",h),c.hasAttribute("data-td-class")&&s.setAttribute("class",c.getAttribute("data-td-class")),c.hasAttribute("data-format")&&(s.setAttribute("data-format",c.getAttribute("data-format")),s.innerHTML=x("date",s.textContent.trim())),n.includes(s.textContent.trim())&&s.setAttribute("data-content",s.textContent.trim())}})})},Et=e=>{var t=0;return Array.from(e.querySelectorAll("tr")).forEach((a,r)=>{var i=window.getComputedStyle(document.querySelector("html")),o=a.querySelector(":scope > *:last-child > *:first-child");if(o){var n=o.offsetWidth/parseFloat(i.fontSize);n+=1.5,t=t>n?t:n}var s=a.offsetHeight/parseFloat(i.fontSize);a.style.setProperty("--row-height","".concat(s,"rem"))}),t},Tt=e=>{if(e.closest(".table--fullwidth")||e.querySelectorAll("thead tr th").length<4)return!1;Array.from(e.querySelectorAll("tbody tr")).forEach((t,a)=>{var r=t.querySelector(":scope > :is(td,th):first-child"),i=r.textContent;if(i!="")r.innerHTML='<span class="td__content">'.concat(i,'</span><button type="button" class="d-none">').concat(i,"</button>");else{var o=t.querySelector(":scope > :is(td,th):nth-child(2)"),n=o.textContent;o.innerHTML='<span class="td__content">'.concat(n,'</span><button type="button" class="d-none">').concat(n,"</button>")}})},Mt=e=>{e.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("tr > :is(td,th):first-child button")){var a=t.target.closest("tr > :is(td,th):first-child button"),r=a.parentNode.closest("tr");r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),a.blur()}})},B=(e,t)=>{var a=t.querySelector("[data-search]");if(!a)return!1;var r=a.getAttribute("id"),i=a.getAttribute("data-search").split(","),o=a.parentNode,n={};i.forEach((s,l)=>{Array.from(e.querySelectorAll('td[data-label="'+s.trim()+'"]')).forEach((c,u)=>{c.querySelector(".td__content")?n[c.querySelector(".td__content").textContent]=c.querySelector(".td__content").textContent:n[c.textContent]=c.textContent})}),a.setAttribute("list","".concat(r,"_list")),a.setAttribute("autocomplete","off"),o.querySelector("datalist")||(o.innerHTML+='<datalist id="'.concat(r,'_list"></datalist>')),o.querySelector("datalist").innerHTML="".concat(Object.keys(n).map(s=>'<option value="'.concat(s,'"></option>')).join(""))},Ht=(e,t,a,r,i)=>{var o,n=function(){t.hasAttribute("data-ajax")?V(e,t,a,r):t.hasAttribute("data-submit")?t.submit():(I(e,t,r),q(r,a),_(e,t))};t.addEventListener("keyup",s=>{clearTimeout(o),s&&s.target instanceof HTMLElement&&s.target.closest("[data-search]")&&(o=setTimeout(function(){n()},500))}),t.addEventListener("change",s=>{clearTimeout(o),s&&s.target instanceof HTMLElement&&s.target.closest("[data-sort]")&&(t.hasAttribute("data-submit")||P(e,t,i),n()),s&&s.target instanceof HTMLElement&&s.target.closest("[data-search]")&&n(),s&&s.target instanceof HTMLElement&&s.target.closest("[data-filter]")&&s.target.closest("form .dialog__wrapper > dialog")&&n(),s&&s.target instanceof HTMLElement&&s.target.closest("[data-filter]")&&!s.target.closest("form dialog")&&n(),s&&s.target instanceof HTMLElement&&s.target.closest("[data-show]")&&n()}),t.addEventListener("click",s=>{if(clearTimeout(o),s&&s.target instanceof HTMLElement&&s.target.closest('dialog button:not([type="button"])')){var l=s.target.closest('dialog button:not([type="button"])'),c=l.closest("dialog");c.close()}s&&s.target instanceof HTMLElement&&s.target.closest(".dialog__close")&&(s.preventDefault(),s.stopPropagation()),s&&s.target instanceof HTMLElement&&s.target.closest("[data-clear]")&&(t.reset(),t.hasAttribute("data-submit")||P(e,t,i),n())}),t.addEventListener("submit",s=>{clearTimeout(o),t.hasAttribute("data-submit")||s.preventDefault(),n()}),t.addEventListener("force",s=>{n()})},P=(e,t,a)=>{if(t.getAttribute("data-ajax"))return!1;var r=e.querySelector("tbody"),i=t.querySelector("[data-sort]"),o=i.querySelector("option:nth-child(".concat(i.selectedIndex+1,")")),n=o.getAttribute("data-sort"),s=o.getAttribute("data-order"),l=o.getAttribute("data-format");if(!n)return r.innerHTML=a.innerHTML,D(e),!1;var c=[];["asc","desc","descending"].includes(s)||(c=s.split(","));var u=[];Array.from(r.querySelectorAll("tr")).forEach((f,m)=>{var d=f.querySelector('td[data-label="'+n+'"], th[data-label="'+n+'"]').textContent.trim();c.length&&c.includes(d)&&(d=c.indexOf(d)),rt(d)&&(d=st(d,10)),l&&l=="date"&&(d=new Date(d));var b={index:d,row:f};u.push(b)}),u.sort((f,m)=>f.index>m.index?1:-1),(s=="descending"||s=="desc")&&(u=u.reverse());var h="";u.forEach((f,m)=>{h+=f.row.outerHTML}),r.innerHTML=h},I=(e,t,a)=>{e.classList.remove("table--filtered");var r=[],i=[],o=0,n=t.querySelector("[data-pagination]")?parseInt(t.querySelector("[data-pagination]").value):1,s=t.querySelector("[data-show]")?parseInt(t.querySelector("[data-show]").value):15;Array.from(e.querySelectorAll("tbody tr")).forEach((d,b)=>{d.classList.remove("filtered"),d.classList.remove("filtered--matched"),d.classList.remove("filtered--show"),d.removeAttribute("data-filtered-by")});var l=Array.from(t.querySelectorAll("[data-filter]"));if(l.forEach((d,b)=>{if(!(d.type=="radio"&&!d.checked)&&!(d.type=="checkbox"&&!d.checked))if(d.getAttribute("data-filter")=="multi")for(var[v,g]of Object.entries(JSON.parse(d.value)))r[d.getAttribute("data-filter")].push(g);else d.value&&(r[d.getAttribute("data-filter")]||(r[d.getAttribute("data-filter")]=new Array),r[d.getAttribute("data-filter")].push(d.value))}),t.querySelector("[data-search]")){var c=t.querySelector("[data-search]"),u=t.querySelector("[data-search]").getAttribute("data-search").split(",");u.forEach((d,b)=>{i.push({column:"".concat(d.trim()),value:"".concat(c.value)})})}Array.from(t.querySelectorAll("[data-filter-count]")).forEach((d,b)=>{d.innerHTML=""}),r.length&&Array.from(t.querySelectorAll("[data-filter-count]")).forEach((d,b)=>{d.innerHTML+="(".concat(r.length,")")}),e.classList.add("table--filtered");var h=function(b,v){Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).forEach((g,C)=>{var y=!1;v.forEach((p,$)=>{var A=g.querySelector('[data-label="'.concat(b,'"]'));if(p&&p=="$today")p=x("date",new Date);else if(p&&p=="$yesterday"){var k=new Date;k.setDate(k.getDate()-1),p=x("date",k)}else if(p&&(p=="$thisWeek"||p=="$lastWeek")){var L=new Date,E=new Date(L.setDate(L.getDate()-(L.getDay()-1))),T=new Date(L.setDate(L.getDate()-L.getDay()+7)),w=new Date(A.textContent.toLowerCase());if(L.setHours(0,0,0,0),E.setHours(0,0,0,0),T.setHours(0,0,0,0),w.setHours(0,0,0,0),p=="$thisWeek")y=w>=E&&w<=T;else{var Y=new Date(E.setDate(E.getDate()-7)),z=new Date(T.setDate(T.getDate()-7));Y.setHours(0,0,0,0),z.setHours(0,0,0,0),y=w>=Y&&w<=z}}else if(p&&p=="$thisMonth"){var U=new Date,X=U.getFullYear(),G=U.getMonth(),Q=new Date(X,G,1),J=new Date(X,G+1,0),R=new Date(A.textContent.toLowerCase());Q.setHours(0,0,0,0),J.setHours(0,0,0,0),R.setHours(0,0,0,0),y=R>=Q&&R<=J}else if(p&&p=="$lastMonth"){var K=new Date,Z=K.getFullYear(),W=K.getMonth(),tt=new Date(Z,W-1,1),et=new Date(Z,W,0),N=new Date(A.textContent.toLowerCase());tt.setHours(0,0,0,0),et.setHours(0,0,0,0),N.setHours(0,0,0,0),y=N>=tt&&N<=et}A&&A.textContent.toLowerCase().includes(p.toLowerCase())&&(y=!0)}),y||(g.classList.add("filtered"),g.setAttribute("data-filtered-by",b))})};for(var[f,m]of Object.entries(r))h(f,m);Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).forEach((d,b)=>{var v=!(i.length>0&&i[0].value.length>=3);i.forEach((g,C)=>{var y=d.querySelector('[data-label="'.concat(g.column,'"]'));y&&g.value.length>=3&&y.textContent.toLowerCase().includes(g.value.toLowerCase())&&(v=!0)}),v||d.classList.add("filtered")}),Array.from(e.querySelectorAll("tbody tr:not(.filtered")).forEach((d,b)=>{o++,d.classList.add("filtered--matched");var v=Math.ceil(o/s);v==parseInt(n)&&d.classList.add("filtered--show")}),a&&(a.setAttribute("data-page",n),a.setAttribute("data-pages",Math.ceil(o/s)),a.setAttribute("data-total",o),a.setAttribute("data-show",s))},_=(e,t)=>{var a=Array.from(t.querySelectorAll("[data-query]"));a.forEach((r,i)=>{var o=r.getAttribute("data-query"),n;if(o=="total")n=(e.classList.contains("table--filtered"),e.querySelectorAll("tbody tr").length);else if(!o.includes(" == ")&&o.includes(" & ")){var s=o.split(" & "),l="";s.forEach(h=>{l+=':not([data-filtered-by="'.concat(h,'"])')}),n=Array.from(e.querySelectorAll("tbody tr".concat(l))).length}else if(!o.includes(" == "))n=Array.from(e.querySelectorAll('tbody tr:not([data-filtered-by="'.concat(o,'"])'))).length;else if(o.includes(" && ")){var c=o.split(" && ");n=Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).filter(function(h){var f=!0;for(var[m,d]of Object.entries(c)){var b=d.split(" == ");(!h.querySelector('td[data-label="'.concat(b[0],'"]'))||h.querySelector('td[data-label="'.concat(b[0],'"]')).textContent!="".concat(b[1]))&&(f=!1)}return f}).length}else{var u=o.split(" == ");n=Array.from(e.querySelectorAll('tbody tr.filtered--matched td[data-label="'.concat(u[0],'"], tbody tr[data-filtered-by="').concat(u[0],'"] td[data-label="').concat(u[0],'"]'))).filter(function(h){return h.textContent===u[1]}).length}r.hasAttribute("data-total")?r.setAttribute("data-total",n):r.innerHTML=n})},_t=function(t,a,r,i){r.addEventListener("click",o=>{if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-page]")){o.preventDefault();var n=a.querySelector("[data-pagination]"),s=o.target.closest("[data-page]").getAttribute("data-page");if(n.value=s,i.setAttribute("data-page",s),a.dispatchEvent(new Event("submit")),t.hasAttribute("data-show-history")){var l=new URL(location);l.searchParams.set("page",s),history.pushState({type:"pagination",form:a.getAttribute("id"),page:s},"",l)}}if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-show]")){o.preventDefault();var c=a.querySelector("[data-show]"),u=o.target.closest("[data-show]").getAttribute("data-show");c.value=u,i.setAttribute("data-show",u),a.dispatchEvent(new Event("submit"))}})},Ct=(e,t)=>{if(!e)return!1;e.addEventListener("click",a=>{kt(t)})},kt=function(t){for(var a=[],r=t.getElementsByTagName("tr"),i=0;i<r.length;i++){for(var o=r[i].querySelectorAll("td,th"),n=[],s=0;s<o.length;s++)n.push('"'.concat(o[s].textContent,'"'));a.push(n.join(","))}a=a.join(`
|
|
59
|
-
`);var
|
|
56
|
+
<span class="d-block pb-2">You've viewed `.concat(c," of ").concat(i,` results</span>
|
|
57
|
+
<a href="?show=`).concat(parseInt(c)+parseInt(o),'" class="btn btn-primary w-100 m-0" data-show="').concat(parseInt(c)+parseInt(o),`">Load more results</a>
|
|
58
|
+
</div>`),!0},Et=function(e,t,a,r){function s(i){return i instanceof a?i:new a(function(c){c(i)})}return new(a||(a=Promise))(function(i,c){function o(l){try{n(r.next(l))}catch(f){c(f)}}function d(l){try{n(r.throw(l))}catch(f){c(f)}}function n(l){l.done?i(l.value):s(l.value).then(o,d)}n((r=r.apply(e,t||[])).next())})},X=e=>{var t=Array.from(e.querySelectorAll("thead th")),a=Array.from(e.querySelectorAll("tbody tr"));a.forEach((r,s)=>{var i=Array.from(r.querySelectorAll("th, td")),c=["0","low","medium","high","unknown","n/a","pending","verified","incomplete","completed","requires approval"];i.forEach((o,d)=>{var n=t[d];if(typeof n<"u"){var l=document.createElement("div");l.innerHTML=n.innerHTML;var f=l.textContent||l.innerText||"";o.setAttribute("data-label",f),n.hasAttribute("data-td-class")&&o.setAttribute("class",n.getAttribute("data-td-class")),n.hasAttribute("data-format")&&(o.setAttribute("data-format",n.getAttribute("data-format")),o.innerHTML=F(n.getAttribute("data-format"),o.textContent.trim())),c.includes(o.textContent.trim().toLowerCase())&&o.setAttribute("data-content",o.textContent.trim().toLowerCase())}})})},Tt=e=>{var t=0;return Array.from(e.querySelectorAll("tr")).forEach((a,r)=>{var s=window.getComputedStyle(document.querySelector("html")),i=a.querySelector(":scope > *:last-child > *:first-child");if(i){var c=i.offsetWidth/parseFloat(s.fontSize);c+=1.5,t=t>c?t:c}var o=a.offsetHeight/parseFloat(s.fontSize);a.style.setProperty("--row-height","".concat(o,"rem"))}),t},Mt=e=>{if(e.closest(".table--fullwidth")||e.querySelectorAll("thead tr th").length<4)return!1;Array.from(e.querySelectorAll("tbody tr")).forEach((t,a)=>{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 i=t.querySelector(":scope > :is(td,th):nth-child(2)"),c=i.textContent;i.innerHTML='<span class="td__content">'.concat(c,'</span><button type="button" class="d-none">').concat(c,"</button>")}})},_t=e=>{e.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("tr > :is(td,th):first-child button")){var a=t.target.closest("tr > :is(td,th):first-child button"),r=a.parentNode.closest("tr");r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),a.blur()}})},G=(e,t)=>{var a=t.querySelector("[data-search]");if(!a)return!1;var r=a.getAttribute("id"),s=a.getAttribute("data-search").split(","),i=a.parentNode,c={};s.forEach((o,d)=>{Array.from(e.querySelectorAll('td[data-label="'+o.trim()+'"]')).forEach((n,l)=>{n.querySelector(".td__content")?c[n.querySelector(".td__content").textContent]=n.querySelector(".td__content").textContent:c[n.textContent]=n.textContent})}),a.setAttribute("list","".concat(r,"_list")),a.setAttribute("autocomplete","off"),i.querySelector("datalist")||(i.innerHTML+='<datalist id="'.concat(r,'_list"></datalist>')),i.querySelector("datalist").innerHTML="".concat(Object.keys(c).map(o=>'<option value="'.concat(o,'"></option>')).join(""))},Ht=(e,t,a,r,s)=>{var i,c=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(t.hasAttribute("data-ajax")){if(!l){var f=t.querySelector("[data-pagination]");f.value=1,r.setAttribute("data-page",1)}Z(e,t,a,r)}else t.hasAttribute("data-submit")?t.submit():(Q(e,t,r),k(r,a),Y(e,t))};t.addEventListener("keyup",n=>{clearTimeout(i),n&&n.target instanceof HTMLElement&&n.target.closest("[data-search]")&&(i=setTimeout(function(){c()},500))}),t.addEventListener("change",n=>{clearTimeout(i),n&&n.target instanceof HTMLElement&&n.target.closest("[data-sort]")&&(t.hasAttribute("data-submit")||J(e,t,s),c()),n&&n.target instanceof HTMLElement&&n.target.closest("[data-search]")&&c(),n&&n.target instanceof HTMLElement&&n.target.closest("[data-filter]")&&n.target.closest("form .dialog__wrapper > dialog")&&c(),n&&n.target instanceof HTMLElement&&n.target.closest("[data-filter]")&&!n.target.closest("form dialog")&&c(),n&&n.target instanceof HTMLElement&&n.target.closest("[data-show]")&&c(),n&&n.target instanceof HTMLElement&&n.target.closest("[data-mimic]")&&c()}),t.addEventListener("click",n=>{if(clearTimeout(i),n&&n.target instanceof HTMLElement&&n.target.closest('dialog button:not([type="button"])')){var l=n.target.closest('dialog button:not([type="button"])'),f=l.closest("dialog");f.close()}n&&n.target instanceof HTMLElement&&n.target.closest(".dialog__close")&&(n.preventDefault(),n.stopPropagation()),n&&n.target instanceof HTMLElement&&n.target.closest("[data-clear]")&&(t.reset(),t.hasAttribute("data-submit")||J(e,t,s),c())}),t.addEventListener("submit",n=>{clearTimeout(i),t.hasAttribute("data-submit")||n.preventDefault(),c()}),t.addEventListener("force",n=>{c()}),t.addEventListener("paginate",n=>{c(!0)});var o=[],d=[];Array.from(t.querySelectorAll("[data-mimic]")).forEach((n,l)=>{var f=n.getAttribute("data-mimic");Array.from(document.querySelectorAll('[name="'.concat(f,'"]'))).forEach((h,b)=>{var u=h.closest("form");o.includes(u)||o.push(u),d.includes(f)||d.push(f)})}),o.forEach((n,l)=>{var f=function(){var b=[],u=new FormData(n);for(var[m,v]of u)document.querySelector('[data-mimic="'.concat(m,'"]'))&&!b.includes(m)?(b.push(m),document.querySelector('[data-mimic="'.concat(m,'"]')).value=v):document.querySelector('[data-mimic="'.concat(m,'"]'))&&(document.querySelector('[data-mimic="'.concat(m,'"]')).value+=","+v);for(var A of b){var S=new Event("force");t.dispatchEvent(S)}for(var y of d)if(!u.has(y)&&n.querySelector('[name="'.concat(y,'"]'))){document.querySelector('[data-mimic="'.concat(y,'"]')).value="";var g=new Event("force");t.dispatchEvent(g)}};n.addEventListener("force",h=>{f()}),n.addEventListener("change",h=>{f()})})},J=(e,t,a)=>{if(t.getAttribute("data-ajax"))return!1;var r=e.querySelector("tbody"),s=t.querySelector("[data-sort]"),i=s.querySelector("option:nth-child(".concat(s.selectedIndex+1,")")),c=i.getAttribute("data-sort"),o=i.getAttribute("data-order"),d=i.getAttribute("data-format");if(!c)return r.innerHTML=a.innerHTML,X(e),!1;var n=[];["asc","desc","descending"].includes(o)||(n=o.split(","));var l=[];Array.from(r.querySelectorAll("tr")).forEach((h,b)=>{var u=h.querySelector('td[data-label="'+c+'"], th[data-label="'+c+'"]').textContent.trim();n.length&&n.includes(u)&&(u=n.indexOf(u)),rt(u)&&(u=st(u,10)),d&&d=="date"&&(u=new Date(u));var m={index:u,row:h};l.push(m)}),l.sort((h,b)=>h.index>b.index?1:-1),(o=="descending"||o=="desc")&&(l=l.reverse());var f="";l.forEach((h,b)=>{f+=h.row.outerHTML}),r.innerHTML=f},Q=(e,t,a)=>{e.classList.remove("table--filtered");var r=[],s=[],i=0,c=t.querySelector("[data-pagination]")?parseInt(t.querySelector("[data-pagination]").value):1,o=t.querySelector("[data-show]")?parseInt(t.querySelector("[data-show]").value):15;Array.from(e.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")});var d=Array.from(t.querySelectorAll("[data-filter]"));if(d.forEach((u,m)=>{if(!(u.type=="radio"&&!u.checked)&&!(u.type=="checkbox"&&!u.checked)){if(u.getAttribute("data-filter")=="multi")for(var[v,A]of Object.entries(JSON.parse(u.value)))r[u.getAttribute("data-filter")].push(A);else if(u&&u.value){var S=u.getAttribute("data-filter");r[S]||(r[S]=new Array),r[S].push(u.value)}}}),t.querySelector("[data-search]")){var n=t.querySelector("[data-search]"),l=t.querySelector("[data-search]").getAttribute("data-search").split(",");l.forEach((u,m)=>{s.push({column:"".concat(u.trim()),value:"".concat(n.value)})})}Array.from(t.querySelectorAll("[data-filter-count]")).forEach((u,m)=>{u.innerHTML=""}),r.length&&Array.from(t.querySelectorAll("[data-filter-count]")).forEach((u,m)=>{u.innerHTML+="(".concat(r.length,")")}),e.classList.add("table--filtered");var f=function(m,v){Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).forEach((A,S)=>{var y=!1;v.forEach((g,M)=>{var L=A.querySelector('[data-label="'.concat(m,'"]'));if(g&&g=="$today")g=F("date",new Date);else if(g&&g=="$yesterday"){var q=new Date;q.setDate(q.getDate()-1),g=F("date",q)}else if(g&&(g=="$thisWeek"||g=="$lastWeek")){var p=new Date,_=new Date(p.setDate(p.getDate()-(p.getDay()-1))),w=new Date(p.setDate(p.getDate()-p.getDay()+7)),x=new Date(L.textContent.toLowerCase());if(p.setHours(0,0,0,0),_.setHours(0,0,0,0),w.setHours(0,0,0,0),x.setHours(0,0,0,0),g=="$thisWeek")y=x>=_&&x<=w;else{var T=new Date(_.setDate(_.getDate()-7)),R=new Date(w.setDate(w.getDate()-7));T.setHours(0,0,0,0),R.setHours(0,0,0,0),y=x>=T&&x<=R}}else if(g&&g=="$thisMonth"){var N=new Date,D=N.getFullYear(),H=N.getMonth(),z=new Date(D,H,1),B=new Date(D,H+1,0),E=new Date(L.textContent.toLowerCase());z.setHours(0,0,0,0),B.setHours(0,0,0,0),E.setHours(0,0,0,0),y=E>=z&&E<=B}else if(g&&g=="$lastMonth"){var I=new Date,P=I.getFullYear(),j=I.getMonth(),O=new Date(P,j-1,1),et=new Date(P,j,0),U=new Date(L.textContent.toLowerCase());O.setHours(0,0,0,0),et.setHours(0,0,0,0),U.setHours(0,0,0,0),y=U>=O&&U<=et}L&&L.textContent.toLowerCase().includes(g.toLowerCase())&&(y=!0)}),y||(A.classList.add("filtered"),A.setAttribute("data-filtered-by",m))})};for(var[h,b]of Object.entries(r))f(h,b);Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).forEach((u,m)=>{var v=!(s.length>0&&s[0].value.length>=3);s.forEach((A,S)=>{var y=u.querySelector('[data-label="'.concat(A.column,'"]'));y&&A.value.length>=3&&y.textContent.toLowerCase().includes(A.value.toLowerCase())&&(v=!0)}),v||u.classList.add("filtered")}),Array.from(e.querySelectorAll("tbody tr:not(.filtered")).forEach((u,m)=>{i++,u.classList.add("filtered--matched");var v=Math.ceil(i/o);v==parseInt(c)&&u.classList.add("filtered--show")}),a&&(a.setAttribute("data-page",c),a.setAttribute("data-pages",Math.ceil(i/o)),a.setAttribute("data-total",i),a.setAttribute("data-show",o))},Y=(e,t,a)=>{var r=Array.from(t.querySelectorAll("[data-query]"));r.forEach((s,i)=>{var c=s.getAttribute("data-query"),o;if(c=="total")a.hasAttribute("data-total")?o=a.getAttribute("data-total"):o=(e.classList.contains("table--filtered"),e.querySelectorAll("tbody tr").length);else if(!c.includes(" == ")&&c.includes(" & ")){var d=c.split(" & "),n="";d.forEach(h=>{n+=':not([data-filtered-by="'.concat(h,'"])')}),o=Array.from(e.querySelectorAll("tbody tr".concat(n))).length}else if(!c.includes(" == "))o=Array.from(e.querySelectorAll('tbody tr:not([data-filtered-by="'.concat(c,'"])'))).length;else if(c.includes(" && ")){var l=c.split(" && ");o=Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).filter(function(h){var b=!0;for(var[u,m]of Object.entries(l)){var v=m.split(" == ");(!h.querySelector('td[data-label="'.concat(v[0],'"]'))||h.querySelector('td[data-label="'.concat(v[0],'"]')).textContent!="".concat(v[1]))&&(b=!1)}return b}).length}else{var f=c.split(" == ");o=Array.from(e.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})},Ct=function(t,a,r,s){r.addEventListener("click",i=>{if(i&&i.target instanceof HTMLElement&&i.target.closest("[data-page]")){i.preventDefault();var c=a.querySelector("[data-pagination]"),o=i.target.closest("[data-page]").getAttribute("data-page");if(c.value=o,s.setAttribute("data-page",o),a.dispatchEvent(new Event("paginate")),t.hasAttribute("data-show-history")){var d=new URL(location);d.searchParams.set("page",o),history.pushState({type:"pagination",form:a.getAttribute("id"),page:o},"",d)}}if(i&&i.target instanceof HTMLElement&&i.target.closest("[data-show]")){i.preventDefault();var n=a.querySelector("[data-show]"),l=i.target.closest("[data-show]").getAttribute("data-show");n.value=l,s.setAttribute("data-show",l),a.dispatchEvent(new Event("submit"))}})},kt=(e,t)=>{if(!e)return!1;e.addEventListener("click",a=>{Rt(t)})},Rt=function(t){for(var a=[],r=t.getElementsByTagName("tr"),s=0;s<r.length;s++){for(var i=r[s].querySelectorAll("td,th"),c=[],o=0;o<i.length;o++)c.push('"'.concat(i[o].textContent,'"'));a.push(c.join(","))}a=a.join(`
|
|
59
|
+
`);var d=new Blob([a],{type:"text/csv"}),n=document.createElement("a");n.download="export.csv";var l=window.URL.createObjectURL(d);n.href=l,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)},K=function(t,a,r,s){if(X(t),Mt(t),Y(t,a,s),s&&s.classList.contains("table--cta")){var i=Tt(t);s.style.setProperty("--cta-width","".concat(i,"rem"))}},Z=function(t,a,r,s){return Et(this,void 0,void 0,function*(){var i=(h,b,u)=>b.split(/[\.\[\]\'\"]/).filter(m=>m).reduce((m,v)=>m?m[v]:u,h),c=new FormData(a),o=new URLSearchParams(c).toString(),d=t.querySelectorAll("thead tr th"),n=t.querySelector("tbody"),l=a.getAttribute("data-ajax");s.classList.add("table--loading"),window.controller||(window.controller=[]),window.controller[l]&&window.controller[l].abort(),window.controller[l]=new AbortController;var{signal:f}=controller[l];try{yield fetch(l+"?"+o,{signal:f,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 b=a.hasAttribute("data-schema")?a.getAttribute("data-schema"):"data",u=a.hasAttribute("data-schema-total")?a.getAttribute("data-schema-total"):"meta.total",m=a.hasAttribute("data-schema-page")?a.getAttribute("data-schema-page"):"meta.current_page",v=i(h,u,1),A=i(h,m,1),S=i(h,b),y=s.hasAttribute("data-empty-msg")?s.getAttribute("data-empty-msg"):"No results found";if(S?(n.innerHTML="",S.forEach((M,L)=>{var q=document.createElement("tr");d.forEach((p,_)=>{var w="",x=document.createElement("td");if(x.setAttribute("data-label",p.innerText),p.getAttribute("data-output")){var T=p.getAttribute("data-output");w=T.replace(new RegExp(/{(.*?)}/,"gm"),function(D){return i(M,D.replace("{","").replace("}",""))})}if(p.hasAttribute("data-output-array")){var T=p.getAttribute("data-output"),R=i(M,T.replace("{","").replace("}",""));w="",R.forEach((H,z)=>{var B=p.getAttribute("data-output-array"),E="";if(p.hasAttribute("data-output-array-property")&&p.hasAttribute("data-output-array-transform")){var I=i(H,p.getAttribute("data-output-array-property")),P=JSON.parse(p.getAttribute("data-output-array-transform")),j=P[I];E=B.replace("{".concat(p.getAttribute("data-output-array-property"),"}"),j)}E=E.replace(new RegExp(/{(.*?)}/,"gm"),function(O){return i(H,O.replace("{","").replace("}",""))}),w+=E})}if(p.hasAttribute("data-transform")){var N=JSON.parse(p.getAttribute("data-transform"));w=N[w],!w&&p.hasAttribute("data-default")&&(w=p.getAttribute("data-default"))}x.innerHTML=w,q.appendChild(x)}),n.appendChild(q)}),G(t,a),s.setAttribute("data-total",parseInt(v)),s.setAttribute("data-page",parseInt(A)),s.setAttribute("data-pages",Math.ceil(s.getAttribute("data-total")/s.getAttribute("data-show"))),K(t,a,r,s),k(s,r),parseInt(v)==0&&(n.innerHTML='<tr><td colspan="100%"><span>'.concat(y,"</span></td></tr>")),s.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:l,formData:o})):n.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',a.hasAttribute("data-ajax-post")){var g=new XMLHttpRequest;g.open("GET","".concat(window.location.href,"?ajax=true&").concat(o)),g.send()}})}catch(h){console.log(h)}})},F=(e,t)=>{switch(e){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=it(t)}};class Nt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=this.classList.contains("table--cta"),r=this.classList.contains("table--export"),s=this.classList.toString();s=s.replace("table--cta","");var i=document.createElement("template");i.innerHTML=`
|
|
60
60
|
<style>
|
|
61
61
|
@import "`.concat(t,`/css/core.min.css";
|
|
62
62
|
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
}
|
|
72
72
|
</style>
|
|
73
73
|
`).concat(a?'<div class="table--cta">':"",`
|
|
74
|
-
<div class="table__wrapper `).concat(
|
|
74
|
+
<div class="table__wrapper `).concat(s,`">
|
|
75
75
|
<slot></slot>
|
|
76
76
|
</div>
|
|
77
77
|
`).concat(a?"</div>":"",`
|
|
78
78
|
`).concat(r?'<button class="link" type="button" data-export>Export table as CSV</button>':"",`
|
|
79
79
|
<div class="table__pagination"></div>
|
|
80
|
-
`),this.shadowRoot.appendChild(
|
|
80
|
+
`),this.shadowRoot.appendChild(i.content.cloneNode(!0));var c=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",c.has("page")?c.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")))}connectedCallback(){this.table=this.querySelector("table"),this.savedTableBody=this.table.querySelector("tbody").cloneNode(!0),this.pagination=this.shadowRoot.querySelector(".table__pagination"),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"),G(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" />')),_t(this.table),Ht(this.table,this.form,this.pagination,this,this.savedTableBody),Ct(this.table,this.form,this.pagination,this),kt(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax")?Z(this.table,this.form,this.pagination,this):(K(this.table,this.form,this.pagination,this),Q(this.table,this.form,this),k(this,this.pagination),Y(this.table,this.form)),this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",t=>{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,a,r){}}class Dt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a='@import "'.concat(t,'/css/components/card.css";');this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");var r=this.classList.toString(),s=document.createElement("template");s.innerHTML=`
|
|
81
81
|
<style>
|
|
82
82
|
@import "`.concat(t,`/css/core.min.css";
|
|
83
83
|
`).concat(a,`
|
|
@@ -92,21 +92,21 @@
|
|
|
92
92
|
</div>
|
|
93
93
|
`).concat(this.hasAttribute("data-cta")?'<div class="card__footer"><span class="link">'.concat(this.getAttribute("data-cta"),"</span></div>"):"",`
|
|
94
94
|
</div>
|
|
95
|
-
`),this.shadowRoot.appendChild(
|
|
95
|
+
`),this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){var t=this.parentNode.closest("a, button, label"),a=this.shadowRoot.querySelector(".card");if(t.setAttribute("tabindex","-1"),t.matches("label[for]")){var r=document.getElementById(t.getAttribute("for")).checked;r&&a.classList.add("active")}a.addEventListener("click",s=>{if(t.matches("label[for]")){var i=document.getElementById(t.getAttribute("for")).checked;i?a.classList.remove("active"):a.classList.add("active")}else t.click()}),a.addEventListener("keydown",s=>{switch(s.keyCode){case 32:case 13:if(t.matches("label[for]")){var i=document.getElementById(t.getAttribute("for")).checked;i?a.classList.remove("active"):a.classList.add("active")}else t.click();break}})}static get observedAttributes(){return["data-total","class"]}attributeChangedCallback(t,a,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 Bt(e,t){function a(r,s){var i=!1,c=s.getAttribute("name");c.includes("[]")&&(c=c.replace("[]","[".concat(s.value,"]")));var o=r.querySelector('[data-name="'.concat(c,'"]'));o&&s.getAttribute("type")=="checkbox"&&(i=!0);var d=s.getAttribute("data-filter-text");if(o||(o=document.createElement("button"),r.appendChild(o)),o.setAttribute("type","button"),o.classList.add("filter"),o.setAttribute("data-name",c),o.innerHTML=d.replace("$value",s.value),(!s.value||i)&&o.remove(),s.parentNode.closest("[data-filter-text]")){var n=s.parentNode.closest("[data-filter-text]"),l=!0;if(c="",n.querySelectorAll("input").forEach((b,u)=>{var m=b.getAttribute("name");if(c+="".concat(u!=0?",":"").concat(m),r.querySelector('[data-name="'.concat(m,'"]'))&&r.querySelector('[data-name="'.concat(m,'"]')).remove(),b.value){var v=document.createElement("button");v.setAttribute("type","button"),v.classList.add("filter"),v.setAttribute("data-name",m),v.innerHTML=d.replace("$value",b.value),r.appendChild(v)}else l=!1}),r.querySelector('[data-name="'.concat(c,'"]'))&&r.querySelector('[data-name="'.concat(c,'"]')).remove(),l){var f=n.getAttribute("data-filter-text");n.querySelectorAll("input").forEach((b,u)=>{var m=b.getAttribute("name");r.querySelector('[data-name="'.concat(m,'"]'))&&r.querySelector('[data-name="'.concat(m,'"]')).remove(),f=f.replace("$".concat(u+1),b.value)});var h=document.createElement("button");h.setAttribute("type","button"),h.classList.add("filter"),h.setAttribute("data-name",c),h.innerHTML=f,r.appendChild(h)}}}Array.from(e.querySelectorAll('input[type="checkbox"]:checked')).forEach((r,s)=>{a(t,r)}),e.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]");a(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"),i=s.getAttribute("data-name").split(","),c=0;c<i.length;c++){var o=i[c],d='[name="'.concat(o,'"]');if(o.match(/\[(.*)\]/)){o.replace(/\[(.*)\]/,"[]");var n=o.replace(/.*\[(.*)\]/,"$1");d='[value="'.concat(n,'"]')}for(var l=e.querySelectorAll(d),f=0;f<l.length;f++){var h=l[f];if(h.getAttribute("type")!="radio"&&h.getAttribute("type")!="checkbox")h.value="";else{h.checked=!1;var r=new Event("force");h.closest("form").dispatchEvent(r)}}}s.remove()}},!1)}var W=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",It='@import "'.concat(W,'/css/components/applied-filters.css";');class Pt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=this.classList.toString(),a=document.createElement("template");a.innerHTML=`
|
|
96
96
|
<style>
|
|
97
|
-
@import "`.concat(
|
|
98
|
-
`).concat(
|
|
97
|
+
@import "`.concat(W,`/css/core.min.css";
|
|
98
|
+
`).concat(It,`
|
|
99
99
|
`).concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",`
|
|
100
100
|
</style>
|
|
101
101
|
<div class="applied-filters `).concat(t,`"></div>
|
|
102
102
|
<slot></slot>
|
|
103
|
-
`),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){
|
|
103
|
+
`),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){Bt(this,this.shadowRoot.querySelector(".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",a=document.createElement("template");a.innerHTML=`
|
|
104
104
|
<style>
|
|
105
105
|
@import "`.concat(t,`/css/core.min.css";
|
|
106
106
|
</style>
|
|
107
107
|
<div class="pagination__wrapper d-none">
|
|
108
108
|
</div>
|
|
109
|
-
`),this.shadowRoot.appendChild(a.content.cloneNode(!0));var r=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",r.has("page")?r.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",r.has("show")?r.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"))),
|
|
109
|
+
`),this.shadowRoot.appendChild(a.content.cloneNode(!0));var r=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",r.has("page")?r.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",r.has("show")?r.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"))),k(this,this.shadowRoot.querySelector(".pagination__wrapper"))}connectedCallback(){this.shadowRoot.querySelector(".pagination__wrapper").classList.remove("d-none")}}function Ot(e,t){Vt(e,t)}function Vt(e,t){var a;t.addEventListener("keyup",r=>{clearTimeout(a),a=setTimeout(function(){tt(e,t.value)},500)}),t.addEventListener("change",r=>{clearTimeout(a),tt(e,t.value)})}var tt=function(t,a){Array.from(t.querySelectorAll(":scope > li")).forEach((r,s)=>{var i=r.textContent.toLowerCase();r.classList.add("d-none"),i.includes(a.toLowerCase())&&r.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:a})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class $t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.createElement("template");a.innerHTML=`
|
|
110
110
|
<style>
|
|
111
111
|
@import "`.concat(t,`/css/core.min.css";
|
|
112
112
|
`).concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",`
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
<div class="list__wrapper">
|
|
134
134
|
<slot></slot>
|
|
135
135
|
</div>
|
|
136
|
-
`),this.shadowRoot.appendChild(a.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>'),
|
|
136
|
+
`),this.shadowRoot.appendChild(a.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>'),Ot(this.querySelector("ul"),this.shadowRoot.querySelector("#search"))}}document.addEventListener("DOMContentLoaded",function(){dt(),C(document.body),at(),nt(document.body),window.customElements.get("iam-header")||window.customElements.define("iam-header",gt),window.customElements.get("iam-accordion")||window.customElements.define("iam-accordion",At),window.customElements.get("iam-tabs")||window.customElements.define("iam-tabs",xt),window.customElements.get("iam-table")||window.customElements.define("iam-table",Nt),window.customElements.get("iam-card")||window.customElements.define("iam-card",Dt),window.customElements.get("iam-filterlist")||window.customElements.define("iam-filterlist",$t),window.customElements.get("iam-pagination")||window.customElements.define("iam-pagination",jt),window.customElements.get("iam-applied-filters")||window.customElements.define("iam-applied-filters",Pt),Array.from(document.querySelectorAll(".nav")).forEach(e=>{ut(e)}),Array.from(document.querySelectorAll(".testimonial")).forEach(e=>{ht(e)}),Array.from(document.querySelectorAll(".carousel")).forEach(e=>{ft(e)}),Array.from(document.querySelectorAll("form")).forEach(e=>{pt(e)}),Array.from(document.querySelectorAll(".youtube-embed")).forEach(e=>{new ot(e)}),window.addEventListener("hashchange",function(){var e=location.hash.replace("#",""),t=document.querySelector('label[for="'.concat(e,'"]'));t instanceof HTMLElement&&t.click()},!1)})});
|
|
137
137
|
//# sourceMappingURL=scripts.bundle.js.map
|