@iamproperty/components 3.7.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/components/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 +103 -29
- package/assets/js/scripts.bundle.js +19 -19
- 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 +80 -53
- 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 +139 -34
- package/assets/ts/tests/table.spec.ts +6 -6
- package/dist/components.es.js +758 -724
- 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.1
|
|
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(M){typeof define=="function"&&define.amd?define(M):M()})(function(){"use strict";var M=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("#",""),'"]')),o=document.querySelector(r+" summary"),n=document.querySelector("dialog".concat(r));s instanceof HTMLElement?s.click():o instanceof HTMLElement?o.click():n instanceof HTMLElement&&n.showModal()};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",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(),_(r);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((a,r)=>{var s=new Image;s.onload=function(){var o=document.createElement("script");o.src="https://www.youtube.com/iframe_api";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(o,n),document.body.classList.add("youtubeLoaded"),a(!0),o.onload=()=>{t.addEventListener("click",function(i){console.log("click"),i&&i.target instanceof HTMLElement&&i.target.closest("a")&&(i.preventDefault(),_(i.target.closest("a")))},!1)}},s.onerror=function(){r(!1)},s.src="https://youtube.com/favicon.ico"})}}var _=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 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:c}})}o();function n(l){l.target.playVideo()}var i=!1;function c(l){if(l.data==YT.PlayerState.PLAYING&&!i){var u=document.getElementById(r);u.classList.add("player-ready"),i=!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",y=>{y.preventDefault()});var o=s.querySelector(".youtube-embed a");o&&_(o),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 n=t.target.closest("dialog[open]");t.preventDefault(),n.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((y,A)=>{y.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:n.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest('button[formmethod="dialog"]')){var i=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((y,A)=>{y.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var c=t.target.closest("dialog[open]");if(!c.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||c.classList.contains("dialog--multi")){var l=c.getBoundingClientRect();(t.clientX<l.left||t.clientX>l.right||t.clientY<l.top||t.clientY>l.bottom)&&(c.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:c.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){var u=t.target.closest(".dialog__wrapper > button"),f=t.target.closest(".dialog__wrapper > button").parentNode,h="openPopover",m=f.querySelector(":scope > dialog");if(document.querySelector("dialog[open]")&&document.querySelector("dialog[open]")!=m&&document.querySelector("dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((y,A)=>{y.classList.remove("active")}),m.hasAttribute("open"))m.close(),h="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 q=m.getBoundingClientRect(),L=q.bottom-window.scrollY,p=window.innerHeight-window.scrollY;if(L>p){var S=m.getAttribute("style");m.setAttribute("style",S+"transform: translate(0, calc(-100% - 4rem))")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:h,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,s)=>{t+='<button data-title="'.concat(r.getAttribute("data-title"),'" type="button" class="').concat(s==0?"active":"",'">').concat(r.getAttribute("data-title"),"</button>");var o=document.createElement("div");o.classList.add("btn--wrapper"),r.appendChild(o),s!=0&&(o.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&&(o.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&&(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 s=r.target.closest("button[data-title]"),o=e.querySelector('fieldset[data-title="'.concat(s.getAttribute("data-title"),'"]')),n=e.querySelector('.steps button[data-title="'.concat(s.getAttribute("data-title"),'"]'));Array.from(e.querySelectorAll("button")).forEach((i,c)=>{i.classList.remove("active")}),Array.from(e.querySelectorAll("fieldset")).forEach((i,c)=>{i.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(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(n){var i=e.querySelector(".btn-next"),c=e.querySelector(".btn-prev");i.setAttribute("data-go",n+1),c.setAttribute("data-go",n-1),i.removeAttribute("disabled"),c.removeAttribute("disabled"),n==1?c.setAttribute("disabled",!0):n==r&&i.setAttribute("disabled",!0)};a.addEventListener("scroll",function(o){clearTimeout(t),t=setTimeout(function(){var n=a.scrollWidth,i=a.scrollHeight,c=a.scrollLeft,l=a.scrollTop,u=Math.round(c/n*r)+1;c==0&&l!=0&&(u=Math.round(l/i*r)+1),e.setAttribute("data-show",u),s(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 i=parseInt(n.getAttribute("data-go")),c=0,l=0,u=a.scrollWidth,f=a.scrollHeight;u>f?l=Math.floor(u*((i-1)/r)):c=Math.floor(f*((i-1)/r)),a.scroll({top:c,left:l,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"),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 i=a.clientWidth,c=a.scrollWidth,l=a.scrollLeft,u=Math.round(l/c*r)+1,f=e.querySelector(".carousel__item:last-child").offsetLeft;Array.from(e.querySelectorAll(".carousel__controls a")).forEach((h,m)=>{h.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+i>f?e.querySelector(".btn-next").setAttribute("disabled","disabled"):e.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),e.addEventListener("click",function(n){for(var i=n.target;i&&i!=this;i=i.parentNode)if(i.matches(".carousel__controls a")){n.preventDefault(),Array.from(e.querySelectorAll(".carousel__controls a")).forEach((l,u)=>{l.classList.remove("active")}),i.classList.add("active");var c=document.querySelector(i.getAttribute("href"));a.scroll({top:0,left:c.offsetLeft,behavior:"smooth"});break}},!1),e.addEventListener("click",function(n){for(var i=n.target;i&&i!=this;i=i.parentNode)if(i.matches(".btn-next, .btn-prev")){n.preventDefault();var c=i.classList.contains("btn-prev")?a.scrollLeft-a.clientWidth:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:c,behavior:"smooth"});break}},!1),r==1&&e.classList.add("hide-btns"),s>=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((s,o)=>{s.setAttribute("max",r)}),Array.from(e.querySelectorAll("[data-max] input")).forEach((s,o)=>{s.setAttribute("min",a)}),Array.from(e.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(e.querySelectorAll("[data-max] select option")).forEach((s,o)=>{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 o=s.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 i=o.closest(".row");i.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,o=a.dataset.activeif,n=a.dataset.equals,i=s.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]'));i.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 s=a.closest("[data-group]")?a.closest("[data-group]"):e,o=a.dataset.activeif,n=a.dataset.equals,i=s.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]'));i.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=`
|
|
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(o=>{o!==s&&o.removeAttribute("open")})})})}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});var C=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(C,`/css/core.min.css";
|
|
31
|
+
@import "`).concat(C,`/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(C,'/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,o)=>{var n=s.querySelector(":scope > summary");n.classList.add("visually-hidden");var i=document.createElement("button");s.hasAttribute("id")&&(i=document.createElement("a"),i.setAttribute("href","#".concat(s.getAttribute("id")))),s.hasAttribute("open")&&i.setAttribute("aria-pressed",!0),i.innerHTML="".concat(n.innerText),i.classList.add("link"),i.setAttribute("data-index",o),i.setAttribute("tabindex","-1"),r.appendChild(i)})},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(o=>{o.addEventListener("click",n=>{n.preventDefault(),s.forEach(i=>{var c=i==o;i.setAttribute("aria-pressed",c)}),a.forEach((i,c)=>{var l=o.getAttribute("data-index")==c;l?i.setAttribute("open",l):i.removeAttribute("open")}),o.hasAttribute("href")&&history.pushState(void 0,void 0,o.getAttribute("href")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:o.textContent})})}),r.forEach((o,n)=>{o.addEventListener("focus",i=>{s.forEach(c=>{c.classList.remove("focus")}),s[n].classList.add("focus")}),o.addEventListener("click",i=>{i.preventDefault(),s[n].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 H=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"),o=t.getAttribute("data-total"),n=t.getAttribute("data-show"),i=t.getAttribute("data-increment");if(s<=1)return a.innerHTML="",!1;for(var c="",l=1;l<=s;l++)l==r?c+='<li class="page-item active" aria-current="page"><span class="page-link">'.concat(l,"</span></li>"):c+='<li class="page-item"><a href="?page='.concat(l,'" class="page-link" data-page="').concat(l,'">').concat(l,"</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(c,`
|
|
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
56
|
<span class="d-block pb-2">You've viewed `.concat(n," of ").concat(o,` results</span>
|
|
57
|
-
<a href="?show=`).concat(parseInt(n)+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
|
|
57
|
+
<a href="?show=`).concat(parseInt(n)+parseInt(i),'" class="btn btn-primary w-100 m-0" data-show="').concat(parseInt(n)+parseInt(i),`">Load more results</a>
|
|
58
|
+
</div>`),!0},B=e=>{var t=Array.from(e.querySelectorAll("thead th")),a=Array.from(e.querySelectorAll("tbody tr"));a.forEach((r,s)=>{var o=Array.from(r.querySelectorAll("th, td")),n=["0","low","medium","high","unknown","n/a","pending","verified","incomplete","completed","requires approval"];o.forEach((i,c)=>{var l=t[c];if(typeof l<"u"){var u=document.createElement("div");u.innerHTML=l.innerHTML;var f=u.textContent||u.innerText||"";i.setAttribute("data-label",f),l.hasAttribute("data-td-class")&&i.setAttribute("class",l.getAttribute("data-td-class")),l.hasAttribute("data-format")&&(i.setAttribute("data-format",l.getAttribute("data-format")),i.innerHTML=R(l.getAttribute("data-format"),i.textContent.trim())),n.includes(i.textContent.trim().toLowerCase())&&i.setAttribute("data-content",i.textContent.trim().toLowerCase())}})})},Et=e=>{var t=0;return Array.from(e.querySelectorAll("tr")).forEach((a,r)=>{var s=window.getComputedStyle(document.querySelector("html")),o=a.querySelector(":scope > *:last-child > *:first-child");if(o){var n=o.offsetWidth/parseFloat(s.fontSize);n+=1.5,t=t>n?t:n}var i=a.offsetHeight/parseFloat(s.fontSize);a.style.setProperty("--row-height","".concat(i,"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"),s=r.textContent;if(s!="")r.innerHTML='<span class="td__content">'.concat(s,'</span><button type="button" class="d-none">').concat(s,"</button>");else{var o=t.querySelector(":scope > :is(td,th):nth-child(2)"),n=o.textContent;o.innerHTML='<span class="td__content">'.concat(n,'</span><button type="button" class="d-none">').concat(n,"</button>")}})},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()}})},I=(e,t)=>{var a=t.querySelector("[data-search]");if(!a)return!1;var r=a.getAttribute("id"),s=a.getAttribute("data-search").split(","),o=a.parentNode,n={};s.forEach((i,c)=>{Array.from(e.querySelectorAll('td[data-label="'+i.trim()+'"]')).forEach((l,u)=>{l.querySelector(".td__content")?n[l.querySelector(".td__content").textContent]=l.querySelector(".td__content").textContent:n[l.textContent]=l.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(i=>'<option value="'.concat(i,'"></option>')).join(""))},Ht=(e,t,a,r,s)=>{var o,n=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(t.hasAttribute("data-ajax")){if(!l){var u=t.querySelector("[data-pagination]");u.value=1,r.setAttribute("data-page",1)}V(e,t,a,r)}else t.hasAttribute("data-submit")?t.submit():(j(e,t,r),H(r,a),k(e,t))};t.addEventListener("keyup",c=>{clearTimeout(o),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&(o=setTimeout(function(){n()},500))}),t.addEventListener("change",c=>{clearTimeout(o),c&&c.target instanceof HTMLElement&&c.target.closest("[data-sort]")&&(t.hasAttribute("data-submit")||P(e,t,s),n()),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&n(),c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&c.target.closest("form .dialog__wrapper > dialog")&&n(),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(o),c&&c.target instanceof HTMLElement&&c.target.closest('dialog button:not([type="button"])')){var l=c.target.closest('dialog button:not([type="button"])'),u=l.closest("dialog");u.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")||P(e,t,s),n())}),t.addEventListener("submit",c=>{clearTimeout(o),t.hasAttribute("data-submit")||c.preventDefault(),n()}),t.addEventListener("force",c=>{n()}),t.addEventListener("paginate",c=>{n(!0)});var i=[];Array.from(t.querySelectorAll("[data-mimic]")).forEach((c,l)=>{var u=c.getAttribute("data-mimic");Array.from(document.querySelectorAll('[name="'.concat(u,'"]'))).forEach((f,h)=>{var m=f.closest("form");i.includes(m)||i.push(m)})}),i.forEach((c,l)=>{var u=function(){var h=[],m=new FormData(c);for(var[d,b]of m)document.querySelector('[data-mimic="'.concat(d,'"]'))&&!h.includes(d)?(h.push(d),document.querySelector('[data-mimic="'.concat(d,'"]')).value=b):document.querySelector('[data-mimic="'.concat(d,'"]'))&&(document.querySelector('[data-mimic="'.concat(d,'"]')).value+=","+b);for(var v of h){var g=new Event("force");t.dispatchEvent(g)}};c.addEventListener("force",f=>{u()}),c.addEventListener("change",f=>{u()})})},P=(e,t,a)=>{if(t.getAttribute("data-ajax"))return!1;var r=e.querySelector("tbody"),s=t.querySelector("[data-sort]"),o=s.querySelector("option:nth-child(".concat(s.selectedIndex+1,")")),n=o.getAttribute("data-sort"),i=o.getAttribute("data-order"),c=o.getAttribute("data-format");if(!n)return r.innerHTML=a.innerHTML,B(e),!1;var l=[];["asc","desc","descending"].includes(i)||(l=i.split(","));var u=[];Array.from(r.querySelectorAll("tr")).forEach((h,m)=>{var d=h.querySelector('td[data-label="'+n+'"], th[data-label="'+n+'"]').textContent.trim();l.length&&l.includes(d)&&(d=l.indexOf(d)),rt(d)&&(d=st(d,10)),c&&c=="date"&&(d=new Date(d));var b={index:d,row:h};u.push(b)}),u.sort((h,m)=>h.index>m.index?1:-1),(i=="descending"||i=="desc")&&(u=u.reverse());var f="";u.forEach((h,m)=>{f+=h.row.outerHTML}),r.innerHTML=f},j=(e,t,a)=>{e.classList.remove("table--filtered");var r=[],s=[],o=0,n=t.querySelector("[data-pagination]")?parseInt(t.querySelector("[data-pagination]").value):1,i=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 c=Array.from(t.querySelectorAll("[data-filter]"));if(c.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 if(d&&d.value){var q=d.getAttribute("data-filter");r[q]||(r[q]=new Array),r[q].push(d.value)}}}),t.querySelector("[data-search]")){var l=t.querySelector("[data-search]"),u=t.querySelector("[data-search]").getAttribute("data-search").split(",");u.forEach((d,b)=>{s.push({column:"".concat(d.trim()),value:"".concat(l.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 f=function(b,v){Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).forEach((g,q)=>{var L=!1;v.forEach((p,S)=>{var y=g.querySelector('[data-label="'.concat(b,'"]'));if(p&&p=="$today")p=R("date",new Date);else if(p&&p=="$yesterday"){var A=new Date;A.setDate(A.getDate()-1),p=R("date",A)}else if(p&&(p=="$thisWeek"||p=="$lastWeek")){var w=new Date,E=new Date(w.setDate(w.getDate()-(w.getDay()-1))),T=new Date(w.setDate(w.getDate()-w.getDay()+7)),x=new Date(y.textContent.toLowerCase());if(w.setHours(0,0,0,0),E.setHours(0,0,0,0),T.setHours(0,0,0,0),x.setHours(0,0,0,0),p=="$thisWeek")L=x>=E&&x<=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),L=x>=Y&&x<=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),N=new Date(y.textContent.toLowerCase());Q.setHours(0,0,0,0),J.setHours(0,0,0,0),N.setHours(0,0,0,0),L=N>=Q&&N<=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),D=new Date(y.textContent.toLowerCase());tt.setHours(0,0,0,0),et.setHours(0,0,0,0),D.setHours(0,0,0,0),L=D>=tt&&D<=et}y&&y.textContent.toLowerCase().includes(p.toLowerCase())&&(L=!0)}),L||(g.classList.add("filtered"),g.setAttribute("data-filtered-by",b))})};for(var[h,m]of Object.entries(r))f(h,m);Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).forEach((d,b)=>{var v=!(s.length>0&&s[0].value.length>=3);s.forEach((g,q)=>{var L=d.querySelector('[data-label="'.concat(g.column,'"]'));L&&g.value.length>=3&&L.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/i);v==parseInt(n)&&d.classList.add("filtered--show")}),a&&(a.setAttribute("data-page",n),a.setAttribute("data-pages",Math.ceil(o/i)),a.setAttribute("data-total",o),a.setAttribute("data-show",i))},k=(e,t,a)=>{var r=Array.from(t.querySelectorAll("[data-query]"));r.forEach((s,o)=>{var n=s.getAttribute("data-query"),i;if(n=="total")a.hasAttribute("data-total")?i=a.getAttribute("data-total"):i=(e.classList.contains("table--filtered"),e.querySelectorAll("tbody tr").length);else if(!n.includes(" == ")&&n.includes(" & ")){var c=n.split(" & "),l="";c.forEach(h=>{l+=':not([data-filtered-by="'.concat(h,'"])')}),i=Array.from(e.querySelectorAll("tbody tr".concat(l))).length}else if(!n.includes(" == "))i=Array.from(e.querySelectorAll('tbody tr:not([data-filtered-by="'.concat(n,'"])'))).length;else if(n.includes(" && ")){var u=n.split(" && ");i=Array.from(e.querySelectorAll("tbody tr:not(.filtered)")).filter(function(h){var m=!0;for(var[d,b]of Object.entries(u)){var v=b.split(" == ");(!h.querySelector('td[data-label="'.concat(v[0],'"]'))||h.querySelector('td[data-label="'.concat(v[0],'"]')).textContent!="".concat(v[1]))&&(m=!1)}return m}).length}else{var f=n.split(" == ");i=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",i):s.innerHTML=i})},_t=function(t,a,r,s){r.addEventListener("click",o=>{if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-page]")){o.preventDefault();var n=a.querySelector("[data-pagination]"),i=o.target.closest("[data-page]").getAttribute("data-page");if(n.value=i,s.setAttribute("data-page",i),a.dispatchEvent(new Event("paginate")),t.hasAttribute("data-show-history")){var c=new URL(location);c.searchParams.set("page",i),history.pushState({type:"pagination",form:a.getAttribute("id"),page:i},"",c)}}if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-show]")){o.preventDefault();var l=a.querySelector("[data-show]"),u=o.target.closest("[data-show]").getAttribute("data-show");l.value=u,s.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"),s=0;s<r.length;s++){for(var o=r[s].querySelectorAll("td,th"),n=[],i=0;i<o.length;i++)n.push('"'.concat(o[i].textContent,'"'));a.push(n.join(","))}a=a.join(`
|
|
59
|
+
`);var c=new Blob([a],{type:"text/csv"}),l=document.createElement("a");l.download="export.csv";var u=window.URL.createObjectURL(c);l.href=u,l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},O=function(t,a,r,s){if(B(t),Tt(t),k(t,a,s),s&&s.classList.contains("table--cta")){var o=Et(t);s.style.setProperty("--cta-width","".concat(o,"rem"))}},V=function(t,a,r,s){var o=(f,h,m)=>h.split(/[\.\[\]\'\"]/).filter(d=>d).reduce((d,b)=>d?d[b]:m,f),n=new FormData(a),i=new URLSearchParams(n).toString(),c=t.querySelectorAll("thead tr th"),l=t.querySelector("tbody");if(s.classList.add("table--loading"),fetch(a.getAttribute("data-ajax")+"?"+i,{method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(f=>f.json()).then(f=>{var h=a.hasAttribute("data-schema")?a.getAttribute("data-schema"):"data",m=a.hasAttribute("data-schema-total")?a.getAttribute("data-schema-total"):"meta.total",d=a.hasAttribute("data-schema-page")?a.getAttribute("data-schema-page"):"meta.current_page",b=o(f,m,1),v=o(f,d,1),g=o(f,h);g?(l.innerHTML="",g.forEach((q,L)=>{var p=document.createElement("tr");c.forEach((S,y)=>{var A="",w=document.createElement("td");if(w.setAttribute("data-label",S.innerText),S.getAttribute("data-output")){var E=S.getAttribute("data-output");A=E.replace(new RegExp(/{(.*?)}/,"gm"),function(x){return o(q,x.replace("{","").replace("}",""))})}if(S.hasAttribute("data-transform")){var T=JSON.parse(S.getAttribute("data-transform"));A=T[A],!A&&S.hasAttribute("data-default")&&(A=S.getAttribute("data-default"))}w.innerHTML=A,p.appendChild(w)}),l.appendChild(p)}),I(t,a),s.setAttribute("data-total",parseInt(b)),s.setAttribute("data-page",parseInt(v)),s.setAttribute("data-pages",Math.ceil(s.getAttribute("data-total")/s.getAttribute("data-show"))),O(t,a,r,s),H(s,r),f.data.length==0&&(l.innerHTML='<tr><td colspan="100%"><span class="h4 m-0">No results found</span></td></tr>'),s.classList.remove("table--loading")):l.innerHTML='<tr><td colspan="100%"><span class="h6 m-0">Error loading table</span></td></tr>'}),a.hasAttribute("data-ajax-post")){var u=new XMLHttpRequest;u.open("GET","".concat(window.location.href,"?ajax=true&").concat(i)),u.send()}},R=(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 Rt 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 o=document.createElement("template");o.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(o.content.cloneNode(!0));var n=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",n.has("page")?n.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",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),
|
|
80
|
+
`),this.shadowRoot.appendChild(o.content.cloneNode(!0));var n=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",n.has("page")?n.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"),I(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" />')),Mt(this.table),Ht(this.table,this.form,this.pagination,this,this.savedTableBody),_t(this.table,this.form,this.pagination,this),Ct(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax")?V(this.table,this.form,this.pagination,this):(O(this.table,this.form,this.pagination,this),j(this.table,this.form,this),H(this,this.pagination),k(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 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='@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 o=document.getElementById(t.getAttribute("for")).checked;o?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 o=document.getElementById(t.getAttribute("for")).checked;o?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 Dt(e,t){function a(r,s){var o=!1,n=s.getAttribute("name");n.includes("[]")&&(n=n.replace("[]","[".concat(s.value,"]")));var i=r.querySelector('[data-name="'.concat(n,'"]'));i&&s.getAttribute("type")=="checkbox"&&(o=!0);var c=s.getAttribute("data-filter-text");if(i||(i=document.createElement("button"),r.appendChild(i)),i.setAttribute("type","button"),i.classList.add("filter"),i.setAttribute("data-name",n),i.innerHTML=c.replace("$value",s.value),(!s.value||o)&&i.remove(),s.parentNode.closest("[data-filter-text]")){var l=s.parentNode.closest("[data-filter-text]"),u=!0;if(n="",l.querySelectorAll("input").forEach((m,d)=>{var b=m.getAttribute("name");if(n+="".concat(d!=0?",":"").concat(b),r.querySelector('[data-name="'.concat(b,'"]'))&&r.querySelector('[data-name="'.concat(b,'"]')).remove(),m.value){var v=document.createElement("button");v.setAttribute("type","button"),v.classList.add("filter"),v.setAttribute("data-name",b),v.innerHTML=c.replace("$value",m.value),r.appendChild(v)}else u=!1}),r.querySelector('[data-name="'.concat(n,'"]'))&&r.querySelector('[data-name="'.concat(n,'"]')).remove(),u){var f=l.getAttribute("data-filter-text");l.querySelectorAll("input").forEach((m,d)=>{var b=m.getAttribute("name");r.querySelector('[data-name="'.concat(b,'"]'))&&r.querySelector('[data-name="'.concat(b,'"]')).remove(),f=f.replace("$".concat(d+1),m.value)});var h=document.createElement("button");h.setAttribute("type","button"),h.classList.add("filter"),h.setAttribute("data-name",n),h.innerHTML=f,r.appendChild(h)}}}Array.from(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"),o=s.getAttribute("data-name").split(","),n=0;n<o.length;n++){var i=o[n],c='[name="'.concat(i,'"]');if(i.match(/\[(.*)\]/)){i.replace(/\[(.*)\]/,"[]");var l=i.replace(/.*\[(.*)\]/,"$1");c='[value="'.concat(l,'"]')}for(var u=e.querySelectorAll(c),f=0;f<u.length;f++){var h=u[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 $=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",Bt='@import "'.concat($,'/css/components/applied-filters.css";');class It 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(
|
|
97
|
+
@import "`.concat($,`/css/core.min.css";
|
|
98
98
|
`).concat(Bt,`
|
|
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(){Dt(this,this.shadowRoot.querySelector(".applied-filters"))}}class
|
|
103
|
+
`),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){Dt(this,this.shadowRoot.querySelector(".applied-filters"))}}class Pt 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"))),H(this,this.shadowRoot.querySelector(".pagination__wrapper"))}connectedCallback(){this.shadowRoot.querySelector(".pagination__wrapper").classList.remove("d-none")}}function jt(e,t){Ot(e,t)}function Ot(e,t){var a;t.addEventListener("keyup",r=>{clearTimeout(a),a=setTimeout(function(){F(e,t.value)},500)}),t.addEventListener("change",r=>{clearTimeout(a),F(e,t.value)})}var F=function(t,a){Array.from(t.querySelectorAll(":scope > li")).forEach((r,s)=>{var o=r.textContent.toLowerCase();r.classList.add("d-none"),o.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 Vt 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>'),jt(this.querySelector("ul"),this.shadowRoot.querySelector("#search"))}}document.addEventListener("DOMContentLoaded",function(){dt(),
|
|
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>'),jt(this.querySelector("ul"),this.shadowRoot.querySelector("#search"))}}document.addEventListener("DOMContentLoaded",function(){dt(),M(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",Rt),window.customElements.get("iam-card")||window.customElements.define("iam-card",Nt),window.customElements.get("iam-filterlist")||window.customElements.define("iam-filterlist",Vt),window.customElements.get("iam-pagination")||window.customElements.define("iam-pagination",Pt),window.customElements.get("iam-applied-filters")||window.customElements.define("iam-applied-filters",It),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
|