@iamproperty/components 5.6.1-beta4 → 5.6.1-beta5
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/fileupload.css +1 -1
- package/assets/css/components/fileupload.css.map +1 -1
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +3 -3
- package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/carousel/carousel.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js +6 -6
- package/assets/js/components/fileupload/fileupload.component.min.js.map +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/inline-edit/inline-edit.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- package/assets/js/components/multiselect/multiselect.component.js +2 -1
- package/assets/js/components/multiselect/multiselect.component.min.js +3 -3
- package/assets/js/components/multiselect/multiselect.component.min.js.map +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +2 -2
- package/assets/js/dynamic.min.js.map +1 -1
- package/assets/js/modules/dialogs.js +1 -1
- package/assets/js/modules/fileupload.js +2 -9
- package/assets/js/scripts.bundle.js +2 -2
- 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/sass/components/fileupload.scss +1 -0
- package/assets/ts/components/fileupload/fileupload.component.ts +1 -1
- package/assets/ts/components/multiselect/multiselect.component.ts +2 -1
- package/assets/ts/modules/dialogs.ts +1 -1
- package/assets/ts/modules/fileupload.ts +3 -14
- package/dist/components.es.js +508 -578
- package/dist/components.umd.js +54 -50
- package/package.json +1 -1
- package/src/components/FileUpload/FileUpload.vue +29 -6
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
|
-
*/function
|
|
4
|
+
*/function b(i,n){const r=n.querySelector(".files"),d=n.querySelector(".drop-area"),t=i.querySelector("input"),f=i.hasAttribute("data-maxsize")?i.getAttribute("data-maxsize"):0,a=t.cloneNode();if(d.append(a),n.addEventListener("click",e=>{e&&e.target instanceof HTMLElement&&e.target.closest(".btn-primary")&&(e.target.closest(".btn-primary"),(t.hasAttribute("multiple")?a:t).click())}),n.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest(".files button")){const s=new DataTransfer,{files:c}=t,p=e.target.closest(".files button");for(let o=0;o<c.length;o++){const l=c[o];l.name!=p.getAttribute("data-file")&&s.items.add(l)}if(t.files=s.files,t.files.length==0){const o=new Event("empty");i.dispatchEvent(o)}const m=new Event("change");t.dispatchEvent(m);const u=new Event("elementChange");i.dispatchEvent(u)}}),a.addEventListener("change",e=>{if(t.hasAttribute("multiple")){const p=[...t.files,...a.files];let m=[];const u=new DataTransfer;for(let o=0;o<p.length;o++){const l=p[o],h=l.size/1e3;!m.includes(l.name)&&(f==0||h<f)&&u.items.add(l),m.push(l.name)}t.files=u.files}else t.files=a.files;const s=new Event("change");t.dispatchEvent(s);const c=new Event("elementChange");i.dispatchEvent(c)}),a.addEventListener("dragenter",e=>{a.classList.add("focus")}),a.addEventListener("dragleave",e=>{a.classList.remove("focus")}),a.addEventListener("drop",e=>{a.classList.remove("focus")}),t.addEventListener("change",e=>{r.innerHTML="";for(const s of t.files)r.innerHTML+=`<span class="file">${s.name} <button data-file="${s.name}">Remove</button></span>`}),i.hasAttribute("data-filename")){let e=i.getAttribute("data-filename");e&&(r.innerHTML+=`<span class="file">${e} <button data-file="${e}">Remove</button></span>`)}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"fileupload"});class g extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,d=document.createElement("template");d.innerHTML=`
|
|
5
5
|
<style>
|
|
6
|
-
@import "${
|
|
7
|
-
.file-upload{max-width:25rem !important;padding-bottom:1rem}.file-upload .drop-area>input{display:none}.file-upload .file-upload__title{margin-top:0;margin-bottom:0;font-family:var(--font-heading);font-style:normal;font-weight:var(--heading-weight);line-height:2rem;color:var(--colour-heading);clear:both;display:block;padding-bottom:2rem;font-size:1.5rem;line-height:2rem;padding-bottom:2rem;max-width:var(--content-max-width)}.file-upload .helper-text{max-width:16.875rem}.files span{display:block;width:100%;padding:var(--input-padding-block, 0.75rem) var(--input-padding-inline, 1rem);font-size:var(--input-fs, 1rem);line-height:var(--input-lh, 1.25rem);border:2px solid var(--colour-primary-theme);appearance:none;border-radius:0.5rem;margin-bottom:1rem;color:var(--colour-primary);border-color:#d8d8d8;background:#d8d8d8;max-width:25rem !important;position:relative}@media screen and (prefers-color-scheme: dark){.files span{background:var(--colour-canvas-2);border-color:var(--colour-canvas-2);color:var(--colour-body)}}@media(forced-colors: active){.files span{padding-right:5rem}.files span button{padding:0;width:3.7rem !important;text-indent:0% !important}.files span button:after{display:none !important}}.files span button{position:absolute;top:calc(50% - 0.5625rem);right:0.875rem;z-index:var(--index-floating);text-indent:300%;overflow:hidden;border:none;height:1.125rem;width:1.125rem;background:rgba(0,0,0,0)}.files span button:after{content:"";top:0;left:0;position:absolute;display:block;height:1.125rem;width:1.125rem;z-index:var(--index-focus);background:currentColor;mask-image:var(--icon-close);mask-size:100%;mask-repeat:no-repeat;mask-position:50% 50%;-webkit-mask-image:var(--icon-close);-webkit-mask-size:100%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:50% 50%}:host(.fileupload--drag-drop) .file-upload{max-width:50rem !important}:host(.fileupload--drag-drop) .file-upload .helper-text{max-width:50rem !important}:host(.fileupload--drag-drop) .file-upload .drop-area>input{display:block;min-height:12.5rem;border:2px dashed var(--colour-primary-theme);color:rgba(0,0,0,0);position:relative;padding:1.5rem 2rem 1.5rem 2rem;user-select:none;max-width:100%;min-width:100
|
|
6
|
+
@import "${r}";
|
|
7
|
+
.file-upload{max-width:25rem !important;padding-bottom:1rem}.file-upload .drop-area>input{display:none}.file-upload .file-upload__title{margin-top:0;margin-bottom:0;font-family:var(--font-heading);font-style:normal;font-weight:var(--heading-weight);line-height:2rem;color:var(--colour-heading);clear:both;display:block;padding-bottom:2rem;font-size:1.5rem;line-height:2rem;padding-bottom:2rem;max-width:var(--content-max-width)}.file-upload .helper-text{max-width:16.875rem}.files span{display:block;width:100%;padding:var(--input-padding-block, 0.75rem) var(--input-padding-inline, 1rem);font-size:var(--input-fs, 1rem);line-height:var(--input-lh, 1.25rem);border:2px solid var(--colour-primary-theme);appearance:none;border-radius:0.5rem;margin-bottom:1rem;color:var(--colour-primary);border-color:#d8d8d8;background:#d8d8d8;max-width:25rem !important;position:relative}@media screen and (prefers-color-scheme: dark){.files span{background:var(--colour-canvas-2);border-color:var(--colour-canvas-2);color:var(--colour-body)}}@media(forced-colors: active){.files span{padding-right:5rem}.files span button{padding:0;width:3.7rem !important;text-indent:0% !important}.files span button:after{display:none !important}}.files span button{position:absolute;top:calc(50% - 0.5625rem);right:0.875rem;z-index:var(--index-floating);text-indent:300%;overflow:hidden;border:none;height:1.125rem;width:1.125rem;background:rgba(0,0,0,0)}.files span button:after{content:"";top:0;left:0;position:absolute;display:block;height:1.125rem;width:1.125rem;z-index:var(--index-focus);background:currentColor;mask-image:var(--icon-close);mask-size:100%;mask-repeat:no-repeat;mask-position:50% 50%;-webkit-mask-image:var(--icon-close);-webkit-mask-size:100%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:50% 50%}:host(.fileupload--drag-drop) .file-upload{max-width:50rem !important}:host(.fileupload--drag-drop) .file-upload .helper-text{max-width:50rem !important}:host(.fileupload--drag-drop) .file-upload .drop-area>input{display:block;min-height:12.5rem;border:2px dashed var(--colour-primary-theme);color:rgba(0,0,0,0);position:relative;padding:1.5rem 2rem 1.5rem 2rem;user-select:none;max-width:100%;min-width:100%;margin-bottom:1rem}:host(.fileupload--drag-drop) .file-upload .drop-area>input.focus{border:2px solid var(--colour-info)}:host(.fileupload--drag-drop) .file-upload .drop-area{position:relative}:host(.fileupload--drag-drop) .file-upload .drop-area::before{content:"Drag and drop files here or click to upload";position:absolute;inset:1.5rem 2rem 1.5rem 2rem;z-index:1;pointer-events:none}:host(.fileupload--drag-drop) .file-upload ::file-selector-button{position:absolute;inset:0;opacity:0}/*# sourceMappingURL=assets/css/components/fileupload.css.map */
|
|
8
8
|
|
|
9
9
|
${this.hasAttribute("css")?`@import "${this.getAttribute("css")}";`:""}
|
|
10
10
|
</style>
|
|
11
11
|
<div class="file-upload">
|
|
12
12
|
<span class="file-upload__title">Upload file</span>
|
|
13
13
|
<p class="helper-text"><slot name="helper"></slot></p>
|
|
14
|
-
<button class="btn btn-primary"><slot name="btn"></slot> Upload ${this.hasAttribute("data-filetype")?this.getAttribute("data-filetype"):"file"}</button>
|
|
14
|
+
<button class="btn btn-primary" type="button"><slot name="btn"></slot> Upload ${this.hasAttribute("data-filetype")?this.getAttribute("data-filetype"):"file"}</button>
|
|
15
15
|
<div class="drop-area"></div>
|
|
16
16
|
<hr/>
|
|
17
17
|
<slot></slot>
|
|
18
18
|
<div class="files"><slot name="files"></slot></div>
|
|
19
19
|
</div>
|
|
20
|
-
`,this.shadowRoot.appendChild(
|
|
20
|
+
`,this.shadowRoot.appendChild(d.content.cloneNode(!0))}connectedCallback(){this.innerHTML+='<i class="fa-regular fa-arrow-up-from-bracket me-2" aria-hidden="true" slot="btn"></i>';const n=this.shadowRoot.querySelector(".file-upload"),r=this.querySelector("input"),d=this.shadowRoot.querySelector(".helper-text");this.querySelector('[slot="helper"]')||(d.innerHTML=`${this.hasAttribute("data-maxsize")?`Max file size is ${this.getAttribute("data-maxsize")}kb. `:""}${r.hasAttribute("accept")?`Supported file types are ${r.getAttribute("accept")}`:""}`),b(this,n)}}export{g as default};
|
|
21
21
|
//# sourceMappingURL=fileupload.component.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileupload.component.min.js","sources":["../../modules/fileupload.js","fileupload.component.js"],"sourcesContent":["// @ts-nocheck\nfunction fileupload(fileupload, wrapper) {\n const filesWrapper = wrapper.querySelector('.files');\n const dropArea = wrapper.querySelector('.drop-area');\n const input = fileupload.querySelector('input');\n const maxSize = fileupload.hasAttribute('data-maxsize') ? fileupload.getAttribute('data-maxsize') : 0;\n // We clone the input field to work as a buffer input field, this allows us to add new files without losing the old ones\n const cloneInput = input.cloneNode();\n dropArea.append(cloneInput);\n wrapper.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.btn-primary')) {\n const button = event.target.closest('.btn-primary');\n // If the input allows multiples then use the buffer clone input\n const inputTrigger = input.hasAttribute('multiple') ? cloneInput : input;\n inputTrigger.click();\n }\n });\n wrapper.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.files button')) {\n const dt = new DataTransfer();\n const { files } = input;\n const button = event.target.closest('.files button');\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n if (file.name != button.getAttribute('data-file'))\n dt.items.add(file); // here you exclude the file. thus removing it.\n }\n input.files = dt.files; // Assign the updates list\n if (input.files.length == 0) {\n const emptyEvent = new Event('empty');\n fileupload.dispatchEvent(emptyEvent);\n }\n const changeEvent = new Event('change');\n input.dispatchEvent(changeEvent);\n }\n });\n // Buffer input change event\n cloneInput.addEventListener('change', (event) => {\n if (input.hasAttribute('multiple')) {\n const filesArray = [...input.files, ...cloneInput.files];\n let fileNames = [];\n const dt = new DataTransfer();\n for (let i = 0; i < filesArray.length; i++) {\n const file = filesArray[i];\n const size = file.size / 1000;\n if (!fileNames.includes(file.name) && (maxSize == 0 || size < maxSize))\n dt.items.add(file); // here you exclude the file. thus removing it.\n fileNames.push(file.name);\n }\n input.files = dt.files;\n }\n else {\n input.files = cloneInput.files;\n }\n const changeEvent = new Event('change');\n input.dispatchEvent(changeEvent);\n const elementChangeEvent = new Event('elementChange');\n fileupload.dispatchEvent(elementChangeEvent);\n });\n cloneInput.addEventListener('dragenter', (event) => {\n cloneInput.classList.add('focus');\n });\n cloneInput.addEventListener('dragleave', (event) => {\n cloneInput.classList.remove('focus');\n });\n cloneInput.addEventListener('drop', (event) => {\n cloneInput.classList.remove('focus');\n });\n input.addEventListener('change', (event) => {\n // Reset\n filesWrapper.innerHTML = '';\n for (const file of input.files)\n filesWrapper.innerHTML += `<span class=\"file\">${file.name} <button data-file=\"${file.name}\">Remove</button></span>`;\n });\n if (fileupload.hasAttribute('data-filename')) {\n let filename = fileupload.getAttribute('data-filename');\n if (filename)\n filesWrapper.innerHTML += `<span class=\"file\">${filename} <button data-file=\"${filename}\">Remove</button></span>`;\n }\n
|
|
1
|
+
{"version":3,"file":"fileupload.component.min.js","sources":["../../modules/fileupload.js","fileupload.component.js"],"sourcesContent":["// @ts-nocheck\nfunction fileupload(fileupload, wrapper) {\n const filesWrapper = wrapper.querySelector('.files');\n const dropArea = wrapper.querySelector('.drop-area');\n const input = fileupload.querySelector('input');\n const maxSize = fileupload.hasAttribute('data-maxsize') ? fileupload.getAttribute('data-maxsize') : 0;\n // We clone the input field to work as a buffer input field, this allows us to add new files without losing the old ones\n const cloneInput = input.cloneNode();\n dropArea.append(cloneInput);\n wrapper.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.btn-primary')) {\n const button = event.target.closest('.btn-primary');\n // If the input allows multiples then use the buffer clone input\n const inputTrigger = input.hasAttribute('multiple') ? cloneInput : input;\n inputTrigger.click();\n }\n });\n wrapper.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.files button')) {\n const dt = new DataTransfer();\n const { files } = input;\n const button = event.target.closest('.files button');\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n if (file.name != button.getAttribute('data-file'))\n dt.items.add(file); // here you exclude the file. thus removing it.\n }\n input.files = dt.files; // Assign the updates list\n if (input.files.length == 0) {\n const emptyEvent = new Event('empty');\n fileupload.dispatchEvent(emptyEvent);\n }\n const changeEvent = new Event('change');\n input.dispatchEvent(changeEvent);\n const elementChangeEvent = new Event('elementChange');\n fileupload.dispatchEvent(elementChangeEvent);\n }\n });\n // Buffer input change event\n cloneInput.addEventListener('change', (event) => {\n if (input.hasAttribute('multiple')) {\n const filesArray = [...input.files, ...cloneInput.files];\n let fileNames = [];\n const dt = new DataTransfer();\n for (let i = 0; i < filesArray.length; i++) {\n const file = filesArray[i];\n const size = file.size / 1000;\n if (!fileNames.includes(file.name) && (maxSize == 0 || size < maxSize))\n dt.items.add(file); // here you exclude the file. thus removing it.\n fileNames.push(file.name);\n }\n input.files = dt.files;\n }\n else {\n input.files = cloneInput.files;\n }\n const changeEvent = new Event('change');\n input.dispatchEvent(changeEvent);\n const elementChangeEvent = new Event('elementChange');\n fileupload.dispatchEvent(elementChangeEvent);\n });\n cloneInput.addEventListener('dragenter', (event) => {\n cloneInput.classList.add('focus');\n });\n cloneInput.addEventListener('dragleave', (event) => {\n cloneInput.classList.remove('focus');\n });\n cloneInput.addEventListener('drop', (event) => {\n cloneInput.classList.remove('focus');\n });\n input.addEventListener('change', (event) => {\n // Reset\n filesWrapper.innerHTML = '';\n for (const file of input.files)\n filesWrapper.innerHTML += `<span class=\"file\">${file.name} <button data-file=\"${file.name}\">Remove</button></span>`;\n });\n if (fileupload.hasAttribute('data-filename')) {\n let filename = fileupload.getAttribute('data-filename');\n if (filename)\n filesWrapper.innerHTML += `<span class=\"file\">${filename} <button data-file=\"${filename}\">Remove</button></span>`;\n }\n}\nexport default fileupload;\n","// @ts-nocheck\nimport fileupload from \"../../modules/fileupload.js\";\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"fileupload\"\n});\nclass iamFileupload extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/fileupload.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <div class=\"file-upload\">\n <span class=\"file-upload__title\">Upload file</span>\n <p class=\"helper-text\"><slot name=\"helper\"></slot></p>\n <button class=\"btn btn-primary\" type=\"button\"><slot name=\"btn\"></slot> Upload ${this.hasAttribute('data-filetype') ? this.getAttribute('data-filetype') : 'file'}</button>\n <div class=\"drop-area\"></div>\n <hr/>\n <slot></slot>\n <div class=\"files\"><slot name=\"files\"></slot></div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n this.innerHTML += '<i class=\"fa-regular fa-arrow-up-from-bracket me-2\" aria-hidden=\"true\" slot=\"btn\"></i>';\n const wrapper = this.shadowRoot.querySelector('.file-upload');\n const input = this.querySelector('input');\n const helperText = this.shadowRoot.querySelector('.helper-text');\n if (!this.querySelector('[slot=\"helper\"]'))\n helperText.innerHTML = `${this.hasAttribute('data-maxsize') ? `Max file size is ${this.getAttribute('data-maxsize')}kb. ` : ''}${input.hasAttribute('accept') ? `Supported file types are ${input.getAttribute('accept')}` : ''}`;\n fileupload(this, wrapper);\n }\n}\nexport default iamFileupload;\n"],"names":["fileupload","wrapper","filesWrapper","dropArea","input","maxSize","cloneInput","event","dt","files","button","i","file","emptyEvent","changeEvent","elementChangeEvent","filesArray","fileNames","size","filename","iamFileupload","assetLocation","coreCSS","template","helperText"],"mappings":";;;IACA,SAASA,EAAWA,EAAYC,EAAS,CACrC,MAAMC,EAAeD,EAAQ,cAAc,QAAQ,EAC7CE,EAAWF,EAAQ,cAAc,YAAY,EAC7CG,EAAQJ,EAAW,cAAc,OAAO,EACxCK,EAAUL,EAAW,aAAa,cAAc,EAAIA,EAAW,aAAa,cAAc,EAAI,EAE9FM,EAAaF,EAAM,YAqEzB,GApEAD,EAAS,OAAOG,CAAU,EAC1BL,EAAQ,iBAAiB,QAAUM,GAAU,CACrCA,GAASA,EAAM,kBAAkB,aAAeA,EAAM,OAAO,QAAQ,cAAc,IACpEA,EAAM,OAAO,QAAQ,cAAc,GAE7BH,EAAM,aAAa,UAAU,EAAIE,EAAaF,GACtD,MAAK,EAE9B,CAAK,EACDH,EAAQ,iBAAiB,QAAUM,GAAU,CACzC,GAAIA,GAASA,EAAM,kBAAkB,aAAeA,EAAM,OAAO,QAAQ,eAAe,EAAG,CACvF,MAAMC,EAAK,IAAI,aACT,CAAE,MAAAC,CAAO,EAAGL,EACZM,EAASH,EAAM,OAAO,QAAQ,eAAe,EACnD,QAASI,EAAI,EAAGA,EAAIF,EAAM,OAAQE,IAAK,CACnC,MAAMC,EAAOH,EAAME,CAAC,EAChBC,EAAK,MAAQF,EAAO,aAAa,WAAW,GAC5CF,EAAG,MAAM,IAAII,CAAI,EAGzB,GADAR,EAAM,MAAQI,EAAG,MACbJ,EAAM,MAAM,QAAU,EAAG,CACzB,MAAMS,EAAa,IAAI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beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function r(s,t){n(s,t)}function n(s,t){var e;t.addEventListener("keyup",a=>{clearTimeout(e),e=setTimeout(function(){o(s,t.value)},500)}),t.addEventListener("change",a=>{clearTimeout(e),o(s,t.value)})}const o=function(s,t){Array.from(s.querySelectorAll(":scope > li")).forEach((e,a)=>{let i=e.textContent.toLowerCase();e.classList.add("d-none"),i.includes(t.toLowerCase())&&e.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:t})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class l extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"inline edit"});class b extends HTMLElement{constructor(){super();const t=this.attachShadow({mode:"open"}),i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",d=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Marketing"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",i=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -111,7 +111,8 @@ class iamMultiselect extends HTMLElement {
|
|
|
111
111
|
Array.from(multiselect.querySelectorAll(`label:not([slot="checked"])`)).forEach((label, index) => {
|
|
112
112
|
let checkbox = label.querySelector('input');
|
|
113
113
|
let searchValue = checkbox.value;
|
|
114
|
-
|
|
114
|
+
let labelText = label.textContent;
|
|
115
|
+
if (searchValue.toLowerCase().includes(search.value.toLowerCase()) || labelText.toLowerCase().includes(search.value.toLowerCase())) {
|
|
115
116
|
label.removeAttribute('slot');
|
|
116
117
|
}
|
|
117
118
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
|
-
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"mutliselect"});class
|
|
4
|
+
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"mutliselect"});class b extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",s=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
|
|
5
5
|
<style>
|
|
6
6
|
@import "${s}";
|
|
7
7
|
.outer{position:relative;max-width:var(--input-max-width, 50rem);display:block}label{margin-bottom:0;padding-bottom:.5rem}.wrapper{margin-bottom:1.5rem;max-width:var(--input-max-width, 50rem)}.wrapper:after{content:"";display:block;position:absolute;top:100%;left:0;width:100%;height:1rem}.wrapper input{margin-bottom:0.5rem}.wrapper .feedback{position:absolute;right:0;bottom:100%;padding:.85rem;width:min-content;white-space:nowrap;margin-bottom:.5rem;display:none}.wrapper.was-validated .feedback{display:block}.wrapper.filled{display:flex;flex-direction:row;flex-wrap:wrap;align-items:flex-start;min-height:calc(2.75rem + 4px);padding:0.5rem 2rem 0rem 0.8125rem;font-size:var(--input-fs, 1rem);line-height:var(--input-lh, 1.25rem);color:var(--colour-body);background-color:var(--colour-canvas-2);border:2px solid var(--colour-primary);border-radius:0.5rem}.wrapper.filled:is(:focus-within,.focus-within):not(:disabled){border-color:var(--colour-info);outline:0;box-shadow:0 0 0 .1rem rgba(30,190,230,.25)}.wrapper.filled input{all:unset;font-size:1rem;line-height:1.625rem;display:inline-block;width:0;flex-grow:1;padding:0 0.5rem 0 0 !important;margin-inline:0.1875rem;order:999;margin-bottom:0.5rem}.wrapper.filled .feedback{display:none !important}.wrapper.filled:is(:focus,.focus):not(:disabled){border-color:var(--colour-info);outline:0;box-shadow:0 0 0 .1rem rgba(30,190,230,.25)}button{position:absolute;top:.75rem;right:.5rem;border:none;background:none;padding-inline:.5rem;display:var(--display-button, none)}button:after{content:"\u2715";font-weight:bold}.dropdown{position:absolute;top:calc(100% + .5rem);padding:0;left:0;width:100%;margin:0;z-index:99;display:none;max-height:15.25rem !important;overflow:auto}.dropdown:before{display:none}.wrapper:is(:focus-within) .dropdown{display:var(--display-panel, none)}:host-context(:focus-within) input{background-color:none !important}:host-context(iam-inline-edit){display:block;--display-btns: none}:host-context(iam-inline-edit) label:hover+.outer:not(:focus-within) .wrapper:not([data-mousedown]),:host-context(iam-inline-edit) .outer:not(:focus-within) .wrapper:not([data-mousedown]):hover{background-color:var(--colour-light)}:host-context(iam-inline-edit) label:hover+.outer:not(:focus-within) .wrapper:not([data-mousedown]) input,:host-context(iam-inline-edit) .outer:not(:focus-within) .wrapper:not([data-mousedown]):hover input{background-color:var(--colour-light)}:host-context(iam-inline-edit) label:hover+.outer:not(:focus-within) .wrapper:not([data-mousedown]) .dropdown,:host-context(iam-inline-edit) .outer:not(:focus-within) .wrapper:not([data-mousedown]):hover .dropdown{display:none}:host-context(iam-inline-edit) .wrapper{margin-bottom:0}:host-context(iam-inline-edit) .wrapper:not(.filled):not(:focus-within):not([data-mousedown]) input{border:none;background:none;margin-left:-1rem;width:calc(100% + 1rem);max-width:calc(100% + 1rem);box-shadow:none}:host-context(iam-inline-edit) .wrapper:not(.filled):not(:focus-within):not([data-mousedown]) .dropdown{display:none}:host-context(iam-inline-edit) .wrapper.filled:not(:focus-within):not([data-mousedown]){background:none;border:none;padding-left:0}/*# sourceMappingURL=assets/css/components/multiselect.css.map */
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
<button id="clear"><span class="visually-hidden">Clear</span></button>
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
24
|
-
`,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){let t=this,s=this.closest("form"),r=this.shadowRoot.querySelector(".wrapper"),a=t.shadowRoot.querySelector("#search"),p=t.shadowRoot.querySelector("#clear"),n=0,h=t.shadowRoot.querySelector("label");if(h.innerHTML=t.getAttribute("data-label"),t.hasAttribute("placeholder")&&a.setAttribute("placeholder",t.getAttribute("placeholder")),t.setAttribute("data-error","true"),s&&t.hasAttribute("data-is-required")){let e=new MutationObserver(function(o){o.forEach(function(i){const l=i.target;console.log(l),l.classList.contains("was-validated")?r.classList.add("was-validated"):r.classList.remove("was-validated")})});s.classList.contains("was-validated")?r.classList.add("was-validated"):r.classList.remove("was-validated"),e.observe(s,{attributes:!0,attributeFilter:["style","class"]})}function c(e){e.checked==!1?(e.closest("label").removeAttribute("slot"),e.closest("label").removeAttribute("style"),e.closest("label").removeAttribute("data-order")):(n++,e.closest("label").setAttribute("slot","checked"),e.closest("label").setAttribute("style",`--order:${n};`),e.closest("label").setAttribute("data-order",n)),t.querySelector('label[slot="checked"]')?(r.classList.add("filled"),t.removeAttribute("data-error"),a.removeAttribute("placeholder")):(r.classList.remove("filled"),t.setAttribute("data-error","true"),t.hasAttribute("placeholder")&&a.setAttribute("placeholder",t.getAttribute("placeholder")))}Array.from(t.querySelectorAll('label input[type="checkbox"]:checked')).forEach((e,o)=>{c(e)}),a.addEventListener("input",e=>{Array.from(t.querySelectorAll('label:not([slot="checked"])')).forEach((o,i)=>{o.querySelector("input").value.toLowerCase().includes(a.value.toLowerCase())?o.removeAttribute("slot"):o.setAttribute("slot","notmatched")})}),t.addEventListener("change",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest('input[type="checkbox"]')){let o=e.target.closest('input[type="checkbox"]');c(o),a.focus()}}),p.addEventListener("click",function(e){Array.from(t.querySelectorAll('label input[type="checkbox"]')).forEach((o,i)=>{o.checked=!1,c(o)}),a.focus()}),t.addEventListener("keydown",function(e){const o=document.activeElement;switch(e.key){case"ArrowUp":if(e.preventDefault(),o.hasAttribute("type")&&o.getAttribute("type")=="checkbox"){let i=t.querySelectorAll('label:not([slot="checked"]):not([slot="checked"])'),l=Array.from(i).indexOf(o.closest("label")),d=Array.from(i)[l-1];d?d.focus():a.focus()}break;case"ArrowDown":if(e.preventDefault(),o==t)t.querySelector('label:not([slot="checked"]):not([slot="checked"])').focus();else if(o.hasAttribute("type")&&o.getAttribute("type")=="checkbox"){let i=o.value,l=t.querySelector(`label:has(input[value="${i}"]) ~ label:not([slot="checked"]):not([slot="checked"])`);l&&l.focus()}break;case"Enter":e.stopPropagation(),e.preventDefault(),o.hasAttribute("type")&&o.getAttribute("type")=="checkbox"&&(o.checked==!1?o.checked=!0:o.checked=!1),c(o),a.focus();break}});function u(){if(n==0)return!1;let e=t.querySelector(`label[data-order="${n}"]`);return e||(e=u(n--)),e}a.addEventListener("keydown",function(e){switch(e.key){case"Enter":t.querySelector(`input[value="${a.value}"]:not(:checked)`)||(a.value=""),a.focus();break;case"Backspace":if(!a.value){let i=u();if(i){let l=i.querySelector("input");l.checked=!1,c(l)}a.focus()}break}}),t.addEventListener("mousedown",e=>{r.setAttribute("data-mousedown","true")}),t.addEventListener("mouseup",e=>{r.removeAttribute("data-mousedown")})}}export{
|
|
24
|
+
`,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){let t=this,s=this.closest("form"),r=this.shadowRoot.querySelector(".wrapper"),a=t.shadowRoot.querySelector("#search"),p=t.shadowRoot.querySelector("#clear"),n=0,h=t.shadowRoot.querySelector("label");if(h.innerHTML=t.getAttribute("data-label"),t.hasAttribute("placeholder")&&a.setAttribute("placeholder",t.getAttribute("placeholder")),t.setAttribute("data-error","true"),s&&t.hasAttribute("data-is-required")){let e=new MutationObserver(function(o){o.forEach(function(i){const l=i.target;console.log(l),l.classList.contains("was-validated")?r.classList.add("was-validated"):r.classList.remove("was-validated")})});s.classList.contains("was-validated")?r.classList.add("was-validated"):r.classList.remove("was-validated"),e.observe(s,{attributes:!0,attributeFilter:["style","class"]})}function c(e){e.checked==!1?(e.closest("label").removeAttribute("slot"),e.closest("label").removeAttribute("style"),e.closest("label").removeAttribute("data-order")):(n++,e.closest("label").setAttribute("slot","checked"),e.closest("label").setAttribute("style",`--order:${n};`),e.closest("label").setAttribute("data-order",n)),t.querySelector('label[slot="checked"]')?(r.classList.add("filled"),t.removeAttribute("data-error"),a.removeAttribute("placeholder")):(r.classList.remove("filled"),t.setAttribute("data-error","true"),t.hasAttribute("placeholder")&&a.setAttribute("placeholder",t.getAttribute("placeholder")))}Array.from(t.querySelectorAll('label input[type="checkbox"]:checked')).forEach((e,o)=>{c(e)}),a.addEventListener("input",e=>{Array.from(t.querySelectorAll('label:not([slot="checked"])')).forEach((o,i)=>{let d=o.querySelector("input").value,m=o.textContent;d.toLowerCase().includes(a.value.toLowerCase())||m.toLowerCase().includes(a.value.toLowerCase())?o.removeAttribute("slot"):o.setAttribute("slot","notmatched")})}),t.addEventListener("change",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest('input[type="checkbox"]')){let o=e.target.closest('input[type="checkbox"]');c(o),a.focus()}}),p.addEventListener("click",function(e){Array.from(t.querySelectorAll('label input[type="checkbox"]')).forEach((o,i)=>{o.checked=!1,c(o)}),a.focus()}),t.addEventListener("keydown",function(e){const o=document.activeElement;switch(e.key){case"ArrowUp":if(e.preventDefault(),o.hasAttribute("type")&&o.getAttribute("type")=="checkbox"){let i=t.querySelectorAll('label:not([slot="checked"]):not([slot="checked"])'),l=Array.from(i).indexOf(o.closest("label")),d=Array.from(i)[l-1];d?d.focus():a.focus()}break;case"ArrowDown":if(e.preventDefault(),o==t)t.querySelector('label:not([slot="checked"]):not([slot="checked"])').focus();else if(o.hasAttribute("type")&&o.getAttribute("type")=="checkbox"){let i=o.value,l=t.querySelector(`label:has(input[value="${i}"]) ~ label:not([slot="checked"]):not([slot="checked"])`);l&&l.focus()}break;case"Enter":e.stopPropagation(),e.preventDefault(),o.hasAttribute("type")&&o.getAttribute("type")=="checkbox"&&(o.checked==!1?o.checked=!0:o.checked=!1),c(o),a.focus();break}});function u(){if(n==0)return!1;let e=t.querySelector(`label[data-order="${n}"]`);return e||(e=u(n--)),e}a.addEventListener("keydown",function(e){switch(e.key){case"Enter":t.querySelector(`input[value="${a.value}"]:not(:checked)`)||(a.value=""),a.focus();break;case"Backspace":if(!a.value){let i=u();if(i){let l=i.querySelector("input");l.checked=!1,c(l)}a.focus()}break}}),t.addEventListener("mousedown",e=>{r.setAttribute("data-mousedown","true")}),t.addEventListener("mouseup",e=>{r.removeAttribute("data-mousedown")})}}export{b as default};
|
|
25
25
|
//# sourceMappingURL=multiselect.component.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiselect.component.min.js","sources":["multiselect.component.js"],"sourcesContent":["// @ts-nocheck\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"mutliselect\"\n});\nclass iamMultiselect extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/multiselect.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <label for=\"search\"> <slot name=\"feedback\"></slot></label>\n <div class=\"outer\">\n <div class=\"wrapper\">\n \n <slot name=\"checked\"></slot>\n <input name=\"search\" id=\"search\" autocomplete=\"off\" required />\n <span class=\"admin-panel feedback\">This field is required</span>\n <div class=\"admin-panel dropdown\">\n <slot></slot>\n </div>\n <button id=\"clear\"><span class=\"visually-hidden\">Clear</span></button>\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n let multiselect = this;\n let form = this.closest('form');\n let wrapper = this.shadowRoot.querySelector('.wrapper');\n let search = multiselect.shadowRoot.querySelector('#search');\n let button = multiselect.shadowRoot.querySelector('#clear');\n let order = 0;\n let label = multiselect.shadowRoot.querySelector('label');\n label.innerHTML = multiselect.getAttribute('data-label');\n if (multiselect.hasAttribute('placeholder')) {\n search.setAttribute('placeholder', multiselect.getAttribute('placeholder'));\n }\n multiselect.setAttribute('data-error', 'true');\n // If in form and is required lets watch for the form being submitted\n if (form && multiselect.hasAttribute('data-is-required')) {\n let observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutationRecord) {\n const targetElement = mutationRecord.target;\n console.log(targetElement);\n if (targetElement.classList.contains(\"was-validated\")) {\n wrapper.classList.add('was-validated');\n }\n else {\n wrapper.classList.remove('was-validated');\n }\n ;\n });\n });\n if (form.classList.contains(\"was-validated\")) {\n wrapper.classList.add('was-validated');\n }\n else {\n wrapper.classList.remove('was-validated');\n }\n ;\n observer.observe(form, {\n attributes: true,\n attributeFilter: ['style', 'class']\n });\n }\n // Set the correct attributes\n function setItem(inputToSet) {\n if (inputToSet.checked == false) {\n inputToSet.closest('label').removeAttribute('slot');\n inputToSet.closest('label').removeAttribute('style');\n inputToSet.closest('label').removeAttribute('data-order');\n }\n else {\n order++;\n inputToSet.closest('label').setAttribute('slot', 'checked');\n inputToSet.closest('label').setAttribute('style', `--order:${order};`);\n inputToSet.closest('label').setAttribute('data-order', order);\n }\n // check for errors\n if (multiselect.querySelector('label[slot=\"checked\"]')) {\n wrapper.classList.add('filled');\n multiselect.removeAttribute('data-error');\n search.removeAttribute('placeholder');\n }\n else {\n wrapper.classList.remove('filled');\n multiselect.setAttribute('data-error', 'true');\n if (multiselect.hasAttribute('placeholder')) {\n search.setAttribute('placeholder', multiselect.getAttribute('placeholder'));\n }\n }\n }\n // Set on load\n Array.from(multiselect.querySelectorAll(`label input[type=\"checkbox\"]:checked`)).forEach((checkbox, index) => {\n setItem(checkbox);\n });\n // Filter list\n search.addEventListener('input', (event) => {\n Array.from(multiselect.querySelectorAll(`label:not([slot=\"checked\"])`)).forEach((label, index) => {\n let checkbox = label.querySelector('input');\n let searchValue = checkbox.value;\n if (searchValue.toLowerCase().includes(search.value.toLowerCase())) {\n label.removeAttribute('slot');\n }\n else {\n label.setAttribute('slot', 'notmatched');\n }\n });\n });\n // Set items\n multiselect.addEventListener('change', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('input[type=\"checkbox\"]')) {\n let checkbox = event.target.closest('input[type=\"checkbox\"]');\n setItem(checkbox);\n search.focus();\n }\n });\n // Clear all\n button.addEventListener(\"click\", function (event) {\n Array.from(multiselect.querySelectorAll(`label input[type=\"checkbox\"]`)).forEach((checkbox, index) => {\n checkbox.checked = false;\n setItem(checkbox);\n });\n search.focus();\n });\n // Add some keyboard features to keep it accessible\n multiselect.addEventListener(\"keydown\", function (event) {\n const activeElement = document.activeElement;\n switch (event.key) { // change to event.key to key to use the above variable\n case \"ArrowUp\":\n // Up pressed\n event.preventDefault();\n if (activeElement.hasAttribute('type') && activeElement.getAttribute('type') == \"checkbox\") {\n let arrCheckboxes = multiselect.querySelectorAll(`label:not([slot=\"checked\"]):not([slot=\"checked\"])`);\n let activeIndex = Array.from(arrCheckboxes).indexOf(activeElement.closest('label'));\n let prevCheckbox = Array.from(arrCheckboxes)[activeIndex - 1];\n if (prevCheckbox)\n prevCheckbox.focus();\n else\n search.focus();\n }\n break;\n case \"ArrowDown\":\n // Down pressed\n event.preventDefault();\n if (activeElement == multiselect) {\n multiselect.querySelector('label:not([slot=\"checked\"]):not([slot=\"checked\"])').focus();\n }\n else if (activeElement.hasAttribute('type') && activeElement.getAttribute('type') == \"checkbox\") {\n let activeValue = activeElement.value;\n let nextCheckbox = multiselect.querySelector(`label:has(input[value=\"${activeValue}\"]) ~ label:not([slot=\"checked\"]):not([slot=\"checked\"])`);\n if (nextCheckbox)\n nextCheckbox.focus();\n }\n break;\n case \"Enter\":\n event.stopPropagation();\n event.preventDefault();\n if (activeElement.hasAttribute('type') && activeElement.getAttribute('type') == \"checkbox\") {\n if (activeElement.checked == false)\n activeElement.checked = true;\n else\n activeElement.checked = false;\n }\n setItem(activeElement);\n search.focus();\n break;\n }\n });\n function checkLastTag() {\n if (order == 0)\n return false;\n let lastTag = multiselect.querySelector(`label[data-order=\"${order}\"]`);\n if (!lastTag) {\n lastTag = checkLastTag(order--);\n }\n return lastTag;\n }\n search.addEventListener(\"keydown\", function (event) {\n switch (event.key) { // change to event.key to key to use the above variable\n case \"Enter\":\n let match = multiselect.querySelector(`input[value=\"${search.value}\"]:not(:checked)`);\n if (!match)\n search.value = \"\";\n search.focus();\n break;\n case \"Backspace\":\n if (!search.value) {\n let lastTag = checkLastTag(order);\n if (lastTag) {\n let lastTagInput = lastTag.querySelector('input');\n lastTagInput.checked = false;\n setItem(lastTagInput);\n }\n search.focus();\n }\n break;\n }\n });\n // Fix for the inline edit multiselect\n multiselect.addEventListener(\"mousedown\", (event) => {\n wrapper.setAttribute('data-mousedown', 'true');\n });\n multiselect.addEventListener(\"mouseup\", (event) => {\n wrapper.removeAttribute('data-mousedown');\n });\n }\n}\nexport default iamMultiselect;\n"],"names":["iamMultiselect","assetLocation","coreCSS","template","multiselect","form","wrapper","search","button","order","label","observer","mutations","mutationRecord","targetElement","setItem","inputToSet","checkbox","index","event","activeElement","arrCheckboxes","activeIndex","prevCheckbox","activeValue","nextCheckbox","checkLastTag","lastTag","lastTagInput"],"mappings":";;;IAEA,OAAO,UAAY,OAAO,WAAa,GACvC,OAAO,UAAU,KAAK,CAClB,MAAS,0BACT,QAAW,aACf,CAAC,EACD,MAAMA,UAAuB,WAAY,CACrC,aAAc,CACV,QACA,KAAK,aAAa,CAAE,KAAM,MAAQ,CAAA,EAClC,MAAMC,EAAgB,SAAS,KAAK,aAAa,sBAAsB,EAAI,SAAS,KAAK,aAAa,sBAAsB,EAAI,UAC1HC,EAAU,SAAS,KAAK,aAAa,eAAe,EAAI,SAAS,KAAK,aAAa,eAAe,EAAI,GAAGD,qBAEzGE,EAAW,SAAS,cAAc,UAAU,EAClDA,EAAS,UAAY;AAAA;AAAA,eAEdD;AAAA;AAAA;AAAA,MAET,KAAK,aAAa,KAAK,EAAI,YAAY,KAAK,aAAa,KAAK,MAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,M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AAeD,EAAQ,cAAc,OAAO,EAChDC,EAAa,QAAU,GACvBb,EAAQa,CAAY,EAExBrB,EAAO,MAAK,EAEhB,KACP,CACb,CAAS,EAEDH,EAAY,iBAAiB,YAAce,GAAU,CACjDb,EAAQ,aAAa,iBAAkB,MAAM,CACzD,CAAS,EACDF,EAAY,iBAAiB,UAAYe,GAAU,CAC/Cb,EAAQ,gBAAgB,gBAAgB,CACpD,CAAS,CACJ,CACL"}
|
|
1
|
+
{"version":3,"file":"multiselect.component.min.js","sources":["multiselect.component.js"],"sourcesContent":["// @ts-nocheck\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"mutliselect\"\n});\nclass iamMultiselect extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/multiselect.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <label for=\"search\"> <slot name=\"feedback\"></slot></label>\n <div class=\"outer\">\n <div class=\"wrapper\">\n \n <slot name=\"checked\"></slot>\n <input name=\"search\" id=\"search\" autocomplete=\"off\" required />\n <span class=\"admin-panel feedback\">This field is required</span>\n <div class=\"admin-panel dropdown\">\n <slot></slot>\n </div>\n <button id=\"clear\"><span class=\"visually-hidden\">Clear</span></button>\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n let multiselect = this;\n let form = this.closest('form');\n let wrapper = this.shadowRoot.querySelector('.wrapper');\n let search = multiselect.shadowRoot.querySelector('#search');\n let button = multiselect.shadowRoot.querySelector('#clear');\n let order = 0;\n let label = multiselect.shadowRoot.querySelector('label');\n label.innerHTML = multiselect.getAttribute('data-label');\n if (multiselect.hasAttribute('placeholder')) {\n search.setAttribute('placeholder', multiselect.getAttribute('placeholder'));\n }\n multiselect.setAttribute('data-error', 'true');\n // If in form and is required lets watch for the form being submitted\n if (form && multiselect.hasAttribute('data-is-required')) {\n let observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutationRecord) {\n const targetElement = mutationRecord.target;\n console.log(targetElement);\n if (targetElement.classList.contains(\"was-validated\")) {\n wrapper.classList.add('was-validated');\n }\n else {\n wrapper.classList.remove('was-validated');\n }\n ;\n });\n });\n if (form.classList.contains(\"was-validated\")) {\n wrapper.classList.add('was-validated');\n }\n else {\n wrapper.classList.remove('was-validated');\n }\n ;\n observer.observe(form, {\n attributes: true,\n attributeFilter: ['style', 'class']\n });\n }\n // Set the correct attributes\n function setItem(inputToSet) {\n if (inputToSet.checked == false) {\n inputToSet.closest('label').removeAttribute('slot');\n inputToSet.closest('label').removeAttribute('style');\n inputToSet.closest('label').removeAttribute('data-order');\n }\n else {\n order++;\n inputToSet.closest('label').setAttribute('slot', 'checked');\n inputToSet.closest('label').setAttribute('style', `--order:${order};`);\n inputToSet.closest('label').setAttribute('data-order', order);\n }\n // check for errors\n if (multiselect.querySelector('label[slot=\"checked\"]')) {\n wrapper.classList.add('filled');\n multiselect.removeAttribute('data-error');\n search.removeAttribute('placeholder');\n }\n else {\n wrapper.classList.remove('filled');\n multiselect.setAttribute('data-error', 'true');\n if (multiselect.hasAttribute('placeholder')) {\n search.setAttribute('placeholder', multiselect.getAttribute('placeholder'));\n }\n }\n }\n // Set on load\n Array.from(multiselect.querySelectorAll(`label input[type=\"checkbox\"]:checked`)).forEach((checkbox, index) => {\n setItem(checkbox);\n });\n // Filter list\n search.addEventListener('input', (event) => {\n Array.from(multiselect.querySelectorAll(`label:not([slot=\"checked\"])`)).forEach((label, index) => {\n let checkbox = label.querySelector('input');\n let searchValue = checkbox.value;\n let labelText = label.textContent;\n if (searchValue.toLowerCase().includes(search.value.toLowerCase()) || labelText.toLowerCase().includes(search.value.toLowerCase())) {\n label.removeAttribute('slot');\n }\n else {\n label.setAttribute('slot', 'notmatched');\n }\n });\n });\n // Set items\n multiselect.addEventListener('change', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('input[type=\"checkbox\"]')) {\n let checkbox = event.target.closest('input[type=\"checkbox\"]');\n setItem(checkbox);\n search.focus();\n }\n });\n // Clear all\n button.addEventListener(\"click\", function (event) {\n Array.from(multiselect.querySelectorAll(`label input[type=\"checkbox\"]`)).forEach((checkbox, index) => {\n checkbox.checked = false;\n setItem(checkbox);\n });\n search.focus();\n });\n // Add some keyboard features to keep it accessible\n multiselect.addEventListener(\"keydown\", function (event) {\n const activeElement = document.activeElement;\n switch (event.key) { // change to event.key to key to use the above variable\n case \"ArrowUp\":\n // Up pressed\n event.preventDefault();\n if (activeElement.hasAttribute('type') && activeElement.getAttribute('type') == \"checkbox\") {\n let arrCheckboxes = multiselect.querySelectorAll(`label:not([slot=\"checked\"]):not([slot=\"checked\"])`);\n let activeIndex = Array.from(arrCheckboxes).indexOf(activeElement.closest('label'));\n let prevCheckbox = Array.from(arrCheckboxes)[activeIndex - 1];\n if (prevCheckbox)\n prevCheckbox.focus();\n else\n search.focus();\n }\n break;\n case \"ArrowDown\":\n // Down pressed\n event.preventDefault();\n if (activeElement == multiselect) {\n multiselect.querySelector('label:not([slot=\"checked\"]):not([slot=\"checked\"])').focus();\n }\n else if (activeElement.hasAttribute('type') && activeElement.getAttribute('type') == \"checkbox\") {\n let activeValue = activeElement.value;\n let nextCheckbox = multiselect.querySelector(`label:has(input[value=\"${activeValue}\"]) ~ label:not([slot=\"checked\"]):not([slot=\"checked\"])`);\n if (nextCheckbox)\n nextCheckbox.focus();\n }\n break;\n case \"Enter\":\n event.stopPropagation();\n event.preventDefault();\n if (activeElement.hasAttribute('type') && activeElement.getAttribute('type') == \"checkbox\") {\n if (activeElement.checked == false)\n activeElement.checked = true;\n else\n activeElement.checked = false;\n }\n setItem(activeElement);\n search.focus();\n break;\n }\n });\n function checkLastTag() {\n if (order == 0)\n return false;\n let lastTag = multiselect.querySelector(`label[data-order=\"${order}\"]`);\n if (!lastTag) {\n lastTag = checkLastTag(order--);\n }\n return lastTag;\n }\n search.addEventListener(\"keydown\", function (event) {\n switch (event.key) { // change to event.key to key to use the above variable\n case \"Enter\":\n let match = multiselect.querySelector(`input[value=\"${search.value}\"]:not(:checked)`);\n if (!match)\n search.value = \"\";\n search.focus();\n break;\n case \"Backspace\":\n if (!search.value) {\n let lastTag = checkLastTag(order);\n if (lastTag) {\n let lastTagInput = lastTag.querySelector('input');\n lastTagInput.checked = false;\n setItem(lastTagInput);\n }\n search.focus();\n }\n break;\n }\n });\n // Fix for the inline edit multiselect\n multiselect.addEventListener(\"mousedown\", (event) => {\n wrapper.setAttribute('data-mousedown', 'true');\n });\n multiselect.addEventListener(\"mouseup\", (event) => {\n wrapper.removeAttribute('data-mousedown');\n });\n }\n}\nexport default iamMultiselect;\n"],"names":["iamMultiselect","assetLocation","coreCSS","template","multiselect","form","wrapper","search","button","order","label","observer","mutations","mutationRecord","targetElement","setItem","inputToSet","checkbox","index","event","searchValue","labelText","activeElement","arrCheckboxes","activeIndex","prevCheckbox","activeValue","nextCheckbox","checkLastTag","lastTag","lastTagInput"],"mappings":";;;IAEA,OAAO,UAAY,OAAO,WAAa,GACvC,OAAO,UAAU,KAAK,CAClB,MAAS,0BACT,QAAW,aACf,CAAC,EACD,MAAMA,UAAuB,WAAY,CACrC,aAAc,CACV,QACA,KAAK,aAAa,CAAE,KAAM,MAAQ,CAAA,EAClC,MAAMC,EAAgB,SAAS,KAAK,aAAa,sBAAsB,EAAI,SAAS,KAAK,aAAa,sBAAsB,EAAI,UAC1HC,EAAU,SAAS,KAAK,aAAa,eAAe,EAAI,SAAS,KAAK,aAAa,eAAe,EAAI,GAAGD,qBAEzGE,EAAW,SAAS,cA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E,OAAKoB,IACDA,EAAUD,EAAanB,GAAO,GAE3BoB,CACV,CACDtB,EAAO,iBAAiB,UAAW,SAAUY,EAAO,CAChD,OAAQA,EAAM,IAAG,CACb,IAAK,QACWf,EAAY,cAAc,gBAAgBG,EAAO,uBAAuB,IAEhFA,EAAO,MAAQ,IACnBA,EAAO,MAAK,EACZ,MACJ,IAAK,YACD,GAAI,CAACA,EAAO,MAAO,CACf,IAAIsB,EAAUD,EAAkB,EAChC,GAAIC,EAAS,CACT,IAAIC,EAAeD,EAAQ,cAAc,OAAO,EAChDC,EAAa,QAAU,GACvBf,EAAQe,CAAY,EAExBvB,EAAO,MAAK,EAEhB,KACP,CACb,CAAS,EAEDH,EAAY,iBAAiB,YAAce,GAAU,CACjDb,EAAQ,aAAa,iBAAkB,MAAM,CACzD,CAAS,EACDF,EAAY,iBAAiB,UAAYe,GAAU,CAC/Cb,EAAQ,gBAAgB,gBAAgB,CACpD,CAAS,CACJ,CACL"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"nav"});class v extends HTMLElement{constructor(){super();const s=this.attachShadow({mode:"open"}),n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function r(i){if(i.hasAttribute("data-type")&&i.getAttribute("data-type")=="toast"){let t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),i.closest(".notification__holder")||t.appendChild(i)}if(i.setAttribute("role","alert"),i.addEventListener("click",function(t){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(t.preventDefault(),a(i))},!1),i.hasAttribute("data-timeout")){let t=i.getAttribute("data-timeout");var n=new c(function(){a(i)},t);i.addEventListener("mouseenter",o=>{n.pause()}),i.addEventListener("mouseleave",o=>{n.resume()})}}function c(i,n){var t,o,e=n;this.pause=function(){window.clearTimeout(t),e-=new Date-o},this.resume=function(){o=new Date,window.clearTimeout(t),t=window.setTimeout(i,e)},this.resume()}const a=function(i){i.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class d extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,o=this.querySelectorAll("a,button");Array.from(o).forEach((s,l)=>{s.setAttribute("slot","btns"),s.classList.add("link")}),(o.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/class v extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/import k from"js-cookie";const q=e=>e.replace(/ /g,"_"),x=function(e){return e=e.toLowerCase(),e=q(e),e=e.replace(/\W/g,""),e},m=(e,s,a)=>s.split(/[\.\[\]\'\"]/).filter(o=>o).reduce((o,d)=>o?o[d]:a,e),S=e=>Array.isArray(e)||e!==null&&["function","object"].includes(typeof e);var L=function(e,s,a,o){function d(c){return c instanceof a?c:new a(function(n){n(c)})}return new(a||(a=Promise))(function(c,n){function v(r){try{u(o.next(r))}catch(i){n(i)}}function t(r){try{u(o.throw(r))}catch(i){n(i)}}function u(r){r.done?c(r.value):d(r.value).then(v,t)}u((o=o.apply(e,s||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Search"});class C extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const s=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${s}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Slider"});class f extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",p=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const B=function(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))},Q=(i,e)=>String(i).padStart(e,"0"),X=i=>i.charAt(0).toUpperCase()+i.slice(1),S=(i,e,n)=>e.split(/[\.\[\]\'\"]/).filter(a=>a).reduce((a,m)=>a?a[m]:n,i);var Y=function(i,e,n,a){function m(s){return s instanceof n?s:new n(function(r){r(s)})}return new(n||(n=Promise))(function(s,r){function l(c){try{t(a.next(c))}catch(o){r(o)}}function d(c){try{t(a.throw(c))}catch(o){r(o)}}function t(c){c.done?s(c.value):m(c.value).then(l,d)}t((a=a.apply(i,e||[])).next())})};const R=i=>{const e=Array.from(i.querySelectorAll("thead th"));Array.from(i.querySelectorAll("tbody tr")).forEach((a,m)=>{const s=Array.from(a.querySelectorAll("th, td")),r=["0","low","medium","high","unknown","n/a","pending","verified","due","overdue","incomplete","complete","completed","approval required","upcoming","requires approval","to do","on track","not started","warning","error"];s.forEach((l,d)=>{const t=e[d];if(typeof t<"u"){let c=document.createElement("div");c.innerHTML=t.innerHTML;let o=c.textContent||c.innerText||"";l.setAttribute("data-label",o),t.hasAttribute("data-td-class")&&l.setAttribute("class",t.getAttribute("data-td-class")),t.hasAttribute("data-format")&&(l.setAttribute("data-format",t.getAttribute("data-format")),l.innerHTML=D(t.getAttribute("data-format"),l.textContent.trim())),r.includes(l.textContent.trim().toLowerCase())&&l.setAttribute("data-content",l.textContent.trim().toLowerCase())}})})},J=i=>{let e=0;return Array.from(i.querySelectorAll("tbody tr")).forEach((n,a)=>{let m=window.getComputedStyle(document.querySelector("html")),s=n.querySelector(":scope > *:last-child > *:first-child");if(s){s.classList.add("text-nowrap");let r=s.offsetWidth/parseFloat(m.fontSize);r+=1.7,e=e>r?e:r}}),e},G=(i,e)=>{if(e.classList.contains("table--fullwidth")&&!e.hasAttribute("data-expandable")||i.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(i.querySelectorAll("thead tr")).forEach((n,a)=>{i.querySelectorAll("thead tr th.expand-button-heading").length||n.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(i.querySelectorAll("tbody tr")).forEach((n,a)=>{const m=n.getAttribute("data-view")==="full"?"aria-expanded":"";n.insertAdjacentHTML("afterbegin",`<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button ${m}>Expand</button></td>`)})},V=i=>{i.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let n=e.target.closest("[data-expand-button]"),a=n.closest("tr");n.toggleAttribute("aria-expanded"),a.getAttribute("data-view")=="full"?a.setAttribute("data-view","default"):a.setAttribute("data-view","full"),n.blur()}})},N=(i,e)=>{let n=e.querySelector("input[data-search]");if(!n)return!1;const a=n.getAttribute("id"),m=n.getAttribute("data-search").split(",");let s=n.parentNode,r={};m.forEach((l,d)=>{Array.from(i.querySelectorAll('td[data-label="'+l.trim()+'"]')).forEach((t,c)=>{t.querySelector(".td__content")?r[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:r[t.textContent]=t.textContent})}),n.setAttribute("list",`${a}_list`),n.setAttribute("autocomplete","off"),s.querySelector("datalist")||(s.innerHTML+=`<datalist id="${a}_list"></datalist>`),s.querySelector("datalist").innerHTML=`${Object.keys(r).map(l=>`<option value="${l}"></option>`).join("")}`},K=(i,e,n,a,m)=>{var s;let r=function(t,c=!1){if(console.log("submit"),e.classList.contains("processing"))return!1;if(Array.from(e.querySelectorAll("iam-applied-filters")).forEach((o,b)=>{var h=new Event("tags-set");o.dispatchEvent(h)}),t.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((o,b)=>{const h=o.getAttribute("data-duplicate"),u=document.getElementById(h),y=document.querySelector(`[for="${h}"] iam-card`);if(u.checked!=o.checked)if(y){let w=new Event("click");y.dispatchEvent(w)}else u.checked=o.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!c){let o=e.querySelector("[data-pagination]");o.value=1,a.setAttribute("data-page",1)}I(i,e,n,a)}else e.hasAttribute("data-submit")?e.submit():(C(i,e,a),$(i,e));if(e.hasAttribute("data-ajax-post")){let o=new FormData(e),b=new URLSearchParams(o).toString();const h=new XMLHttpRequest;h.open("GET",`${window.location.href}?ajax=true&${b}`),h.send()}};e.querySelector("iam-actionbar[data-search]")&&e.querySelector("iam-actionbar[data-search]").addEventListener("search-submit",t=>{e.querySelector("input[data-search]")?e.querySelector("input[data-search]").value=t.detail.search:e.insertAdjacentHTML("beforeend",`<input type="hidden" name="search" data-search="${e.querySelector("iam-actionbar[data-search]").getAttribute("data-search")}" value="${t.detail.search}"/>`),clearTimeout(s),r(t)}),e.addEventListener("keyup",t=>{clearTimeout(s),t&&t.target instanceof HTMLElement&&t.target.closest("input[data-search]")&&(s=setTimeout(function(){r(t)},500))}),e.addEventListener("change",t=>{if(clearTimeout(s),t&&t.target instanceof HTMLElement&&t.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||O(i,e,m),r(t)),t&&t.target instanceof HTMLElement&&t.target.closest("input[data-search]")&&r(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter][data-no-ajax]")?(C(i,e,a),$(i,e)):(t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&t.target.closest("form .dialog__wrapper > dialog")||t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&!t.target.closest("form dialog"))&&r(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-show]")&&r(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-mimic]")&&r(t),t&&t.target instanceof HTMLElement&&t.target.hasAttribute("id")){let c=t.target.getAttribute("id");document.querySelector(`[data-duplicate="${c}"]`)&&(document.querySelector(`[data-duplicate="${c}"]`).checked=t.target.checked)}}),e.addEventListener("click",t=>{if(clearTimeout(s),t&&t.target instanceof HTMLElement&&t.target.closest('dialog button:not([type="button"])')&&t.target.closest('dialog button:not([type="button"])').closest("dialog").close(),t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__close")&&(t.preventDefault(),t.stopPropagation()),t&&t.target instanceof HTMLElement&&t.target.closest("[data-clear]")){e.classList.add("processing"),Array.from(e.querySelectorAll(".applied-filters")).forEach((o,b)=>{o.innerHTML=""});let c=e.elements;for(let o=0;o<c.length;o++)switch(c[o].type.toLowerCase()?c[o].type.toLowerCase():"text"){case"text":case"password":case"textarea":c[o].value="";break;case"radio":case"checkbox":if(c[o].checked){let h=c[o],u=h.getAttribute("id"),y=document.querySelector(`[for="${u}"`);if(y.querySelector("iam-card")){let w=y.querySelector("iam-card"),k=new Event("click");w.dispatchEvent(k)}h.checked=!1}break;case"select-one":case"select-multi":c[o].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||O(i,e,m),r(t)}}),e.addEventListener("submit",t=>{clearTimeout(s),e.hasAttribute("data-submit")||t.preventDefault(),r(t)}),e.addEventListener("force",t=>{r(t)}),e.addEventListener("paginate",t=>{r(t,!0)});let l=[],d=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((t,c)=>{let o=t.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${o}"]`)).forEach((b,h)=>{let u=b.closest("form");l.includes(u)||l.push(u),d.includes(o)||d.push(o)})}),l.forEach((t,c)=>{const o=function(){let b=[],h=new FormData(t);for(const[u,y]of h)document.querySelector(`[data-mimic="${u}"]`)&&!b.includes(u)?(b.push(u),document.querySelector(`[data-mimic="${u}"]`).value=y):document.querySelector(`[data-mimic="${u}"]`)&&(document.querySelector(`[data-mimic="${u}"]`).value+=","+y);for(const u of b){const y=new Event("force");e.dispatchEvent(y)}for(const u of d)if(!h.has(u)&&t.querySelector(`[name="${u}"]`)){document.querySelector(`[data-mimic="${u}"]`).value="";const y=new Event("force");e.dispatchEvent(y)}};t.addEventListener("force",b=>{o()}),t.addEventListener("change",b=>{o()})})},O=(i,e,n)=>{if(e.getAttribute("data-ajax"))return!1;let a=i.querySelector("tbody"),m=e.querySelector('input[type="radio"][data-sort]:checked');if(e.querySelector("select[data-sort]")){let o=e.querySelector("select[data-sort]");m=e.querySelector(`select[data-sort] option:nth-child(${o.selectedIndex+1})`)}let s=m.getAttribute("data-sort"),r=m.getAttribute("data-order"),l=m.getAttribute("data-format");if(!s)return a.innerHTML=n.innerHTML,R(i),!1;let d=[];["asc","desc","descending"].includes(r)||(d=r.split(","));let t=[];Array.from(a.querySelectorAll("tr")).forEach((o,b)=>{let h=o.querySelector('td[data-label="'+s+'"], th[data-label="'+s+'"]').textContent.trim();o.querySelector('[data-label="'+s+'"] .td__content')&&(h=o.querySelector('[data-label="'+s+'"] .td__content').textContent.trim()),d.length&&d.includes(h)&&(h=d.indexOf(h)),B(h)&&(h=Q(h,10)),l&&l=="date"&&(h=new Date(h));const u={index:h,row:o};t.push(u)}),t.sort((o,b)=>o.index>b.index?1:-1),(r=="descending"||r=="desc")&&(t=t.reverse());let c="";t.forEach((o,b)=>{c+=o.row.outerHTML}),a.innerHTML=c},C=(i,e,n)=>{i.classList.remove("table--filtered");let a=z(e),m=[],s=0,r=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,l=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(i.querySelectorAll("tbody tr")).forEach((t,c)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")}),e.querySelector("input[data-search]")){let t=e.querySelector("input[data-search]");e.querySelector("input[data-search]").getAttribute("data-search").split(",").forEach((o,b)=>{m.push({column:`${o.trim()}`,value:`${t.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML="",t.parentNode.classList.remove("hover")});let d=0;Object.values(a).forEach((t,c)=>{typeof t=="object"&&Object.values(t).length?d+=Object.values(t).length:d++}),d&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML+=`(${d})`,t.parentNode.classList.add("hover")}),i.classList.add("table--filtered");for(const[t,c]of Object.entries(a))Array.from(i.querySelectorAll("tbody tr:not(.filtered)")).forEach((o,b)=>{let h=!1;c.forEach((u,y)=>{let w=o.querySelector(`[data-label="${t}"]`);if(u.includes("-date-from")){let f=new Date(u.replace("-date-from","")),g=new Date(w.textContent.toLowerCase());f.setHours(0,0,0,0),g.setHours(0,0,0,0),g<f?(o.classList.add("less-than-from-date"),h=!1):!o.classList.contains("less-than-from-date")&&!o.classList.contains("greater-than-to-date")&&(h=!0)}else if(u.includes("-date-to")){let f=new Date(u.replace("-date-to","")),g=new Date(w.textContent.toLowerCase());f.setHours(0,0,0,0),g.setHours(0,0,0,0),g>f?(o.classList.add("greater-than-to-date"),h=!1):!o.classList.contains("less-than-from-date")&&!o.classList.contains("greater-than-to-date")&&(h=!0)}if(u&&u=="$today")u=D("date",new Date);else if(u&&u=="$yesterday"){let f=new Date;f.setDate(f.getDate()-1),u=D("date",f)}else if(u&&(u=="$thisWeek"||u=="$lastWeek")){let f=new Date,g=new Date(f.setDate(f.getDate()-(f.getDay()-1))),p=new Date(f.setDate(f.getDate()-f.getDay()+7)),x=new Date(w.textContent.toLowerCase());if(f.setHours(0,0,0,0),g.setHours(0,0,0,0),p.setHours(0,0,0,0),x.setHours(0,0,0,0),u=="$thisWeek")h=x>=g&&x<=p;else{let A=new Date(g.setDate(g.getDate()-7)),L=new Date(p.setDate(p.getDate()-7));A.setHours(0,0,0,0),L.setHours(0,0,0,0),h=x>=A&&x<=L}}else if(u&&u=="$thisMonth"){let f=new Date,g=f.getFullYear(),p=f.getMonth();var k=new Date(g,p,1),q=new Date(g,p+1,0);let x=new Date(w.textContent.toLowerCase());k.setHours(0,0,0,0),q.setHours(0,0,0,0),x.setHours(0,0,0,0),h=x>=k&&x<=q}else if(u&&u=="$lastMonth"){let f=new Date,g=f.getFullYear(),p=f.getMonth();var E=new Date(g,p-1,1),v=new Date(g,p,0);let x=new Date(w.textContent.toLowerCase());E.setHours(0,0,0,0),v.setHours(0,0,0,0),x.setHours(0,0,0,0),h=x>=E&&x<=v}w&&w.textContent.toLowerCase().includes(u.replace("-"," ").toLowerCase())&&(h=!0)}),h||(o.classList.add("filtered"),o.setAttribute("data-filtered-by",t))});Array.from(i.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,c)=>{let o=!(m.length>0&&m[0].value.length>=3);m.forEach((b,h)=>{let u=t.querySelector(`[data-label="${b.column}"]`);u&&b.value.length>=3&&u.textContent.toLowerCase().includes(b.value.toLowerCase())&&(o=!0)}),o||t.classList.add("filtered")}),Array.from(i.querySelectorAll("tbody tr:not(.filtered")).forEach((t,c)=>{s++,t.classList.add("filtered--matched"),Math.ceil(s/l)==parseInt(r)&&t.classList.add("filtered--show")}),n&&(n.setAttribute("data-total",s),n.setAttribute("data-show",l),n.setAttribute("data-page",r))},$=(i,e,n)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((m,s)=>{let r=m.getAttribute("data-query"),l=0;if(r=="total")n.hasAttribute("data-total")?l=n.getAttribute("data-total"):l=(i.classList.contains("table--filtered"),i.querySelectorAll("tbody tr").length);else if(!r.includes(" == ")&&r.includes(" & ")){let d=r.split(" & "),t="";d.forEach(c=>{t+=`:not([data-filtered-by="${c}"])`}),l=Array.from(i.querySelectorAll(`tbody tr${t}`)).length}else if(!r.includes(" == "))l=Array.from(i.querySelectorAll(`tbody tr:not([data-filtered-by="${r}"])`)).length;else if(r.includes(" && ")){let d=r.split(" && ");l=Array.from(i.querySelectorAll("tbody tr:not(.filtered)")).filter(function(t){let c=!0;for(const[o,b]of Object.entries(d)){let h=b.split(" == ");(!t.querySelector(`td[data-label="${h[0]}"]`)||t.querySelector(`td[data-label="${h[0]}"]`).textContent!=`${h[1]}`)&&(c=!1)}return c}).length}else{let d=r.split(" == ");l=Array.from(i.querySelectorAll(`tbody tr.filtered--matched td[data-label="${d[0]}"], tbody tr[data-filtered-by="${d[0]}"] td[data-label="${d[0]}"]`)).filter(function(t){return t.textContent===d[1]}).length}m.hasAttribute("data-total")?m.setAttribute("data-total",l):m.innerHTML=l})},Z=function(i,e,n,a){n.addEventListener("update-page",m=>{let s=e.querySelector("[data-pagination]"),r=m.detail.page;if(s.value=r,e.dispatchEvent(new Event("paginate")),a.setAttribute("data-page",r),i.hasAttribute("data-show-history")){const l=new URL(location);l.searchParams.set("page",r),history.pushState({type:"pagination",form:e.getAttribute("id"),page:r},"",l)}if(!a.hasAttribute("data-no-scroll")){const d=i.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:d,behavior:"smooth"})}}),n.addEventListener("update-show",m=>{let s=e.querySelector("[data-show]"),r=m.detail.show;s.value=r,a.setAttribute("data-show",r),e.dispatchEvent(new Event("submit"))})},tt=(i,e)=>{if(!i)return!1;i.addEventListener("click",n=>{et(e)})},et=function(i){for(var e=[],n=i.getElementsByTagName("tr"),a=0;a<n.length;a++){for(var m=n[a].querySelectorAll("td,th"),s=[],r=0;r<m.length;r++)s.push(`"${m[r].textContent}"`);e.push(s.join(","))}e=e.join(`
|
|
5
5
|
`);let l=new Blob([e],{type:"text/csv"});var d=document.createElement("a");d.download="export.csv";var t=window.URL.createObjectURL(l);d.href=t,d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d)},P=function(i,e,n,a){if(R(i),G(i,a),$(i,e,a),a&&a.classList.contains("table--cta")){let s=function(){Array.from(i.querySelectorAll("tr")).forEach((r,l)=>{let d=r.offsetHeight;r.style.setProperty("--row-height",`${d}px`)})};const m=J(i);a.style.setProperty("--cta-width",`${m}rem`),new ResizeObserver(s).observe(i)}},z=function(i){let e=new Object;return Array.from(i.querySelectorAll("[data-filter]")).forEach((a,m)=>{if(!(a.type=="radio"&&!a.checked)&&!(a.type=="checkbox"&&!a.checked)&&a&&a.value){let s=a.getAttribute("data-filter"),r=a.value;a.hasAttribute("data-date-from")&&(r+="-date-from"),a.hasAttribute("data-date-to")&&(r+="-date-to"),e[s]||(e[s]=new Array),e[s].push(r)}}),e},I=function(i,e,n,a){return Y(this,void 0,void 0,function*(){let m=new FormData(e),s=new URLSearchParams(m).toString(),r=i.querySelectorAll("thead tr th:not(.expand-button-heading)"),l=i.querySelector("tbody"),d=e.getAttribute("data-ajax");a.classList.add("table--loading");let t=z(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((b,h)=>{b.innerHTML="",b.parentNode.classList.remove("hover")});let c=0;Object.values(t).forEach((b,h)=>{typeof b=="object"&&Object.values(b).length?c+=Object.values(b).length:c++}),c&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((b,h)=>{b.innerHTML+=`(${c})`,b.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[d]&&window.controller[d].abort(),window.controller[d]=new AbortController;const{signal:o}=controller[d];n.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(d+"?"+s,{signal:o,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(b=>b.json()).then(b=>{let h=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",u=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",y=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",w=S(b,u,15),k=S(b,y,1),q=S(b,h),E=a.hasAttribute("data-empty-msg")?a.getAttribute("data-empty-msg"):"No results found";q?(l.innerHTML="",q.forEach((v,f)=>{var g=document.createElement("tr");r.forEach((p,x)=>{let A="";var L=document.createElement("td");if(L.setAttribute("data-label",p.innerText),p.getAttribute("data-output")){var H=p.getAttribute("data-output");A=H.replace(new RegExp(/{(.*?)}/,"gm"),function(M){return S(v,M.replace("{","").replace("}",""))})}if(p.hasAttribute("data-output-array")){var H=p.getAttribute("data-output");let F=S(v,H.replace("{","").replace("}",""));A="",F.forEach((j,it)=>{let W=p.getAttribute("data-output-array"),T="";if(p.hasAttribute("data-output-array-property")&&p.hasAttribute("data-output-array-transform")){const _=S(j,p.getAttribute("data-output-array-property")),U=JSON.parse(p.getAttribute("data-output-array-transform"))[_];T=W.replace(`{${p.getAttribute("data-output-array-property")}}`,U)}T=T.replace(new RegExp(/{(.*?)}/,"gm"),function(_){return S(j,_.replace("{","").replace("}",""))}),A+=T})}p.hasAttribute("data-transform")&&(A=JSON.parse(p.getAttribute("data-transform"))[A],!A&&p.hasAttribute("data-default")&&(A=p.getAttribute("data-default"))),L.innerHTML=A,g.appendChild(L)}),l.appendChild(g)}),N(i,e),a.setAttribute("data-total",parseInt(w)),a.setAttribute("data-page",parseInt(k)),P(i,e,n,a),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((v,f)=>{let g=S(b,v.getAttribute("data-ajax-query"),"");v.hasAttribute("data-total")?v.setAttribute("data-total",g):v.innerHTML=g}),parseInt(w)==0&&(l.innerHTML=`<tr><td colspan="100%"><span>${E}</span></td></tr>`),a.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:d,formData:s})):l.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',n.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(b){console.log(b)}})},D=(i,e)=>{switch(i){case"datetime":return new Date(e).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(e).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(e).toLocaleDateString("en-gb",{day:"numeric",month:"long",year:"2-digit"});case"capitalise":return e=X(e)}};class at extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",n=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const d=function(t){t.querySelectorAll(":scope > details");const o=t.querySelectorAll(":scope > details, :scope > a");t.querySelectorAll(":scope > details > summary");let a=t.querySelector(":scope > .tabs__links");if(t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(a=t.shadowRoot.querySelector(".tabs__links")),!a){a=document.createElement("div"),a.classList.add("tabs__links");let e=document.createElement("div");e.classList.add("tabs__links__wrapper"),e.prepend(a),t.prepend(e)}let i=0;o.forEach((e,r)=>{let n=document.createElement("button");if(e.matches("details")){let s=e.querySelector(":scope > summary"),l=s.classList.contains("disabled");s.classList.add("visually-hidden"),e.hasAttribute("id")&&n.setAttribute("data-id",`${e.getAttribute("id")}`),e.hasAttribute("open")&&n.setAttribute("aria-pressed",!0),n.innerHTML=`${s.innerText}`,n.classList.add("link"),n.setAttribute("data-index",i),e.setAttribute("tabindex","-1"),l&&n.classList.add("disabled"),i++}else e.matches("a")&&(n=e);n.classList.add("link"),a.appendChild(n)})},c=function(t){let o=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > details > summary"),i=t.querySelectorAll(":scope .tabs__links > button");t.shadowRoot&&(i=t.shadowRoot.querySelectorAll(".tabs__links > button")),i.forEach(e=>{e.addEventListener("click",r=>{if(r.preventDefault(),e.classList.contains("disabled"))return!1;i.forEach(n=>{let s=n==e;n.setAttribute("aria-pressed",s)}),o.forEach((n,s)=>{let l=e.getAttribute("data-index")==s;l?n.setAttribute("open",l):n.removeAttribute("open")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:e.textContent})})}),a.forEach((e,r)=>{e.addEventListener("click",n=>{n.preventDefault(),i[r].click()})})},p=function(t){if(!t.querySelector(":scope > details"))return!1;let o=t.querySelectorAll(":scope > details"),a=t.shadowRoot.querySelectorAll(".tabs__links > button");location.hash&&t.shadowRoot.querySelector(`.tabs__links [data-id="${location.hash.replace("#","")}"]`)?(t.shadowRoot.querySelector(`[data-id="${location.hash.replace("#","")}"]`).setAttribute("aria-pressed",!0),t.querySelector(`details[id="${location.hash.replace("#","")}"]`).setAttribute("open",!0)):t.querySelector("details[open]")||(o[0].setAttribute("open",!0),a[0].setAttribute("aria-pressed",!0))},b=function(t){d(t),c(t),p(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class u extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|
package/assets/js/dynamic.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta5
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
|
-
*/(function(h){typeof define=="function"&&define.amd?define(h):h()})(function(){"use strict";const h=e=>(e.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&e.classList.add("ie"),null),L=e=>{const i=function(t){const a=document.querySelector(`label[for="${t.replace("#","")}"]`),o=document.querySelector(t+" summary"),r=document.querySelector(`dialog${t}`),s=document.querySelector(`detail${t}`);a instanceof HTMLElement?a.click():o instanceof HTMLElement?o.click():r instanceof HTMLElement?r.showModal():s instanceof HTMLElement&&s.addAttribute("open")};return location.hash&&i(location.hash),window.addEventListener("hashchange",function(){i(location.hash)},!1),addEventListener("popstate",t=>{if(t&&t.state&&t.state.type&&t.state.type=="pagination"){let a=document.querySelector(`#${t.state.form}`),o=document.querySelector(`#${t.state.form} [data-pagination]`);o?o.value=t.state.page:a.innerHTML+=`<input name="page" type="hidden" data-pagination="true" value="${t.state.page}" />`,a.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",t=>{if(t&&t.target instanceof HTMLElement&&t.target.matches("form")){let a=t.target;Array.from(a.querySelectorAll("[data-password-type]")).forEach((o,r)=>{o.setAttribute("type","password")}),(a.querySelector(":invalid")||a.querySelector('.pwd-checker[data-strength="1"]')||a.querySelector('.pwd-checker[data-strength="2"]'))&&(a.classList.add("was-validated"),t.preventDefault()),a.querySelector("iam-multiselect[data-is-required][data-error]")&&(a.classList.add("was-validated"),t.preventDefault())}}),document.addEventListener("keydown",t=>{t.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(t.preventDefault(),t.stopPropagation())}),null};class S{constructor(i){document.body.classList.contains("youtubeLoaded")?i.addEventListener("click",function(t){for(var a=t.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){t.preventDefault(),p(a);break}},!1):this.loadScripts(i,this.createEmbed)}loadScripts(i){return new Promise((t,a)=>{const o=new Image;o.onload=function(){var r=document.createElement("script");r.src="https://www.youtube.com/iframe_api";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(r,s),document.body.classList.add("youtubeLoaded"),t(!0),r.onload=()=>{i.addEventListener("click",function(n){console.log("click"),n&&n.target instanceof HTMLElement&&n.target.closest("a")&&(n.preventDefault(),p(n.target.closest("a")))},!1)}},o.onerror=function(){a(!1)},o.src="https://youtube.com/favicon.ico"})}}const p=function(e){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var i=e.getAttribute("data-id"),t=e.getAttribute("id");if(typeof t>"u"||t==null){var a=String.fromCharCode(65+Math.floor(Math.random()*26));t=a+Date.now(),e.setAttribute("id",t)}function o(){window.player=new YT.Player(t,{height:"100%",width:"100%",videoId:i,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:r,onStateChange:n}})}o();function r(l){l.target.playVideo()}var s=!1;function n(l){if(l.data==YT.PlayerState.PLAYING&&!s){var c=document.getElementById(t);c.classList.add("player-ready"),s=!0}}},E=e=>(Array.from(e.querySelectorAll("dialog[open]")).forEach((i,t)=>{i.closest(".dialog__wrapper")||(i.removeAttribute("open"),i.showModal(),i.focus(),w(i))}),e.addEventListener("click",i=>{if(i.target.tagName=="IAM-ACTIONBAR")return!1;if(i&&i.target instanceof HTMLElement&&i.target.closest("[data-modal]")){const o=i.target.closest("[data-modal]"),r=o.hasAttribute("data-modal")?o.getAttribute("data-modal"):o.getAttribute("data-filter"),s=document.querySelector(`dialog#${r}`);w(s),s.showModal(),s.focus();let n=s.offsetWidth;s.setAttribute("style",`max-width: ${n}px;`),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((l,c)=>{const d=l.getAttribute("data-duplicate"),u=document.getElementById(d);if(l.checked!=u.checked){l.checked=u.checked;let f=new Event("change");l.dispatchEvent(f)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(i&&i.target instanceof HTMLElement&&i.target.closest("button.dialog__close")){const o=i.target.closest("dialog[open]");i.preventDefault(),o.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(i&&i.target instanceof HTMLElement&&i.target.closest('button[formmethod="dialog"]')){const o=i.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(i&&i.target instanceof HTMLElement&&i.target.closest("dialog[open]")){let o=i.target.closest("dialog[open]");var t=window.getComputedStyle(o);if(t.display==="contents"&&(o=o.parentNode.closest("dialog[open]")),!o.classList.contains("dialog--transactional")&&!o.classList.contains("dialog--acknowledgement")){const r=o.getBoundingClientRect();(i.clientX<r.left||i.clientX>r.right||i.clientY<r.top||i.clientY>r.bottom)&&(i.target.closest('input[type="radio"]')||o.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")}))}}if(i&&i.target instanceof HTMLElement&&i.target.closest(".dialog__wrapper > button")){i.stopPropagation();let o=i.target.closest(".dialog__wrapper > button"),r=o.parentNode,s="openPopover",n=r.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=n&&o.closest("dialog[open]")!=document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,f)=>{u.removeAttribute("aria-expanded")}),n.hasAttribute("open"))n.close(),s="closePopover",n.removeAttribute("style"),o.removeAttribute("aria-expanded");else{n.show(),o.setAttribute("aria-expanded",!0);var a=o.getBoundingClientRect();let u=a.top,f=a.left;if(o.closest("iam-table")){let m=o.closest("iam-table").parentNode.getBoundingClientRect();u-=m.top,f-=m.left}n.classList.contains("dialog--fix")&&n.setAttribute("style",`position:fixed;top: ${u}px; left: ${f}px; margin: 3rem 0 0 0;`)}let l=n.getBoundingClientRect(),c=l.bottom-window.scrollY,d=window.innerHeight-window.scrollY;if(c>d){let u=n.hasAttribute("style")?n.getAttribute("style")+" ":"";n.setAttribute("style",u+"transform: translate(0, calc(-100% - 4rem))"),l=n.getBoundingClientRect(),l.top-window.scrollY<100&&n.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:s,id:o.textContent})}i&&i.target instanceof HTMLElement&&!i.target.closest("dialog[open]")&&!i.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((o,r)=>{o.removeAttribute("aria-expanded")}))}),null),w=e=>{let i=e.querySelector(".youtube-embed a");if(i&&p(i),e.classList.contains("dialog--multi")&&!e.querySelector(":scope > .steps")&&q(e),!e.querySelector(":scope .mh-lg")&&!e.classList.contains("dialog--multi")){e.innerHTML=`<div class="mh-lg">${e.innerHTML}</div>`;let t=e.querySelector(".mh-lg"),a=e.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){let o=a.previousSibling;t.before(a),o&&a.before(o)}}e.querySelector(":scope > button:first-child")||e.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},q=e=>{let i="",t=Array.from(e.querySelectorAll("fieldset[data-title]")),a=e.querySelector("form");t.forEach((s,n)=>{i+=`<button data-title="${s.getAttribute("data-title")}" type="button" class="${n==0?"active":""}" tabindex="-1">${s.getAttribute("data-title")}</button>`;const l=document.createElement("div");if(l.classList.add("btn--wrapper"),s.appendChild(l),n!=0&&(l.innerHTML+=`<button data-title="${t[n-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),n!=t.length-1&&(l.innerHTML+=`<button data-title="${t[n+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),n==t.length-1)if(a&&a.querySelector(':scope > button[type="submit"]')){let c=a.querySelector(':scope > button[type="submit"]');c.classList.add("mb-0"),l.insertAdjacentElement("beforeend",c)}else l.innerHTML+=`<button data-title="${t[n].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),e.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${i}</div>`);let o=Array.from(e.querySelectorAll("fieldset.was-validated"));for(let s=0;s<o.length;s++){let n=o[s],l=n.getAttribute("data-title");if(n.querySelector(".is-invalid")){Array.from(e.querySelectorAll(`[data-title="${l}"]`)).forEach((c,d)=>{c.classList.add("active")});break}else Array.from(e.querySelectorAll(`[data-title="${l}"]`)).forEach((c,d)=>{c.classList.add("valid")})}e.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function r(s){const n=e.querySelector("fieldset.active")?e.querySelector("fieldset.active"):e.querySelector("fieldset[data-title]"),l=n.getAttribute("data-title");let c=!0;if(n.classList.add("was-validated"),Array.from(n.querySelectorAll("input")).forEach((f,m)=>{f.checkValidity()||(c=!1)}),c?Array.from(e.querySelectorAll(`[data-title="${l}"]`)).forEach((f,m)=>{f.classList.add("valid")}):Array.from(e.querySelectorAll(`[data-title="${l}"]`)).forEach((f,m)=>{f.classList.remove("valid")}),c||!s.hasAttribute("data-next")){const f=e.querySelector(`fieldset[data-title="${s.getAttribute("data-title")}"]`),m=e.querySelector(`.steps button[data-title="${s.getAttribute("data-title")}"]`);Array.from(e.querySelectorAll("button")).forEach((A,Y)=>{A.classList.remove("active")}),Array.from(e.querySelectorAll("fieldset")).forEach((A,Y)=>{A.classList.remove("active")}),m.classList.add("active"),f.classList.add("active")}let d=Array.from(e.querySelectorAll("fieldset")).length,u=Array.from(e.querySelectorAll("fieldset.valid")).length;e.style.setProperty("--progress",`${u/(d-1)*100}%`)}e.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){const n=s.target.closest("button");s.keyCode==13&&n.getAttribute("type")!="submit"&&(s.preventDefault(),r(n))}s&&s.target instanceof HTMLElement&&s.target.closest("input")&&(s.target.closest("input").classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault())}),e.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]'))s.target.closest("form").classList.add("was-validated");else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){const n=s.target.closest("button[data-title]");r(n)}return null})};function x(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",e=>{const i=e.target.closest("[open] summary");if(i)window.dataLayer.push({event:"closeDetails",detailsTitle:i.textContent||""});else{const t=e.target.closest("summary"),a=e.target.closest("a"),o=e.target.closest("button");t&&window.dataLayer.push({event:"openDetails",detailsTitle:t.textContent||""}),a&&window.dataLayer.push({event:"linkClicked",linkText:a.hasAttribute("title")?a.getAttribute("title")||"":a.textContent||"",class:a.hasAttribute("class")&&a.getAttribute("class")||"",href:a.getAttribute("href")||""}),o&&window.dataLayer.push({event:"buttonClicked",buttonText:o.textContent||"",class:o.hasAttribute("class")&&o.getAttribute("class")||""})}})}function k(e){var i=new TextEncoder("utf-8").encode(e);return crypto.subtle.digest("SHA-1",i).then(function(t){for(var a=[],o=new DataView(t),r=0;r<o.byteLength;r+=4){var s=o.getUint32(r),n=s.toString(16),l="00000000",c=(l+n).slice(-l.length);a.push(c)}return a.join("")})}const T=(e,i)=>{k(e).then(function(t){const a=new XMLHttpRequest;a.addEventListener("load",function(){const o=this.responseText.split(`
|
|
4
|
+
*/(function(h){typeof define=="function"&&define.amd?define(h):h()})(function(){"use strict";const h=e=>(e.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&e.classList.add("ie"),null),L=e=>{const i=function(t){const a=document.querySelector(`label[for="${t.replace("#","")}"]`),o=document.querySelector(t+" summary"),r=document.querySelector(`dialog${t}`),s=document.querySelector(`detail${t}`);a instanceof HTMLElement?a.click():o instanceof HTMLElement?o.click():r instanceof HTMLElement?r.showModal():s instanceof HTMLElement&&s.addAttribute("open")};return location.hash&&i(location.hash),window.addEventListener("hashchange",function(){i(location.hash)},!1),addEventListener("popstate",t=>{if(t&&t.state&&t.state.type&&t.state.type=="pagination"){let a=document.querySelector(`#${t.state.form}`),o=document.querySelector(`#${t.state.form} [data-pagination]`);o?o.value=t.state.page:a.innerHTML+=`<input name="page" type="hidden" data-pagination="true" value="${t.state.page}" />`,a.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",t=>{if(t&&t.target instanceof HTMLElement&&t.target.matches("form")){let a=t.target;Array.from(a.querySelectorAll("[data-password-type]")).forEach((o,r)=>{o.setAttribute("type","password")}),(a.querySelector(":invalid")||a.querySelector('.pwd-checker[data-strength="1"]')||a.querySelector('.pwd-checker[data-strength="2"]'))&&(a.classList.add("was-validated"),t.preventDefault()),a.querySelector("iam-multiselect[data-is-required][data-error]")&&(a.classList.add("was-validated"),t.preventDefault())}}),document.addEventListener("keydown",t=>{t.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(t.preventDefault(),t.stopPropagation())}),null};class S{constructor(i){document.body.classList.contains("youtubeLoaded")?i.addEventListener("click",function(t){for(var a=t.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){t.preventDefault(),p(a);break}},!1):this.loadScripts(i,this.createEmbed)}loadScripts(i){return new Promise((t,a)=>{const o=new Image;o.onload=function(){var r=document.createElement("script");r.src="https://www.youtube.com/iframe_api";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(r,s),document.body.classList.add("youtubeLoaded"),t(!0),r.onload=()=>{i.addEventListener("click",function(n){console.log("click"),n&&n.target instanceof HTMLElement&&n.target.closest("a")&&(n.preventDefault(),p(n.target.closest("a")))},!1)}},o.onerror=function(){a(!1)},o.src="https://youtube.com/favicon.ico"})}}const p=function(e){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var i=e.getAttribute("data-id"),t=e.getAttribute("id");if(typeof t>"u"||t==null){var a=String.fromCharCode(65+Math.floor(Math.random()*26));t=a+Date.now(),e.setAttribute("id",t)}function o(){window.player=new YT.Player(t,{height:"100%",width:"100%",videoId:i,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:r,onStateChange:n}})}o();function r(l){l.target.playVideo()}var s=!1;function n(l){if(l.data==YT.PlayerState.PLAYING&&!s){var c=document.getElementById(t);c.classList.add("player-ready"),s=!0}}},E=e=>(Array.from(e.querySelectorAll("dialog[open]")).forEach((i,t)=>{i.closest(".dialog__wrapper")||(i.removeAttribute("open"),i.showModal(),i.focus(),w(i))}),e.addEventListener("click",i=>{if(i.target.tagName=="IAM-ACTIONBAR")return!1;if(i&&i.target instanceof HTMLElement&&i.target.closest("[data-modal]")){const o=i.target.closest("[data-modal]"),r=o.hasAttribute("data-modal")?o.getAttribute("data-modal"):o.getAttribute("data-filter"),s=document.querySelector(`dialog#${r}`);w(s),s.showModal(),s.focus();let n=s.offsetWidth;s.setAttribute("style",`max-width: ${n}px;`),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((l,c)=>{const d=l.getAttribute("data-duplicate"),u=document.getElementById(d);if(l.checked!=u.checked){l.checked=u.checked;let f=new Event("change");l.dispatchEvent(f)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(i&&i.target instanceof HTMLElement&&i.target.closest("button.dialog__close")){const o=i.target.closest("dialog[open]");i.preventDefault(),o.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(i&&i.target instanceof HTMLElement&&i.target.closest('button[formmethod="dialog"]')){const o=i.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(i&&i.target instanceof HTMLElement&&i.target.closest("dialog[open]")){let o=i.target.closest("dialog[open]");var t=window.getComputedStyle(o);if(t.display==="contents"&&(o=o.parentNode.closest("dialog[open]")),!o.classList.contains("dialog--transactional")&&!o.classList.contains("dialog--acknowledgement")){const r=o.getBoundingClientRect();(i.clientX<r.left||i.clientX>r.right||i.clientY<r.top||i.clientY>r.bottom)&&(!i.target.closest('input[type="radio"]')&&!i.target.closest('input[type="file"]')&&!i.target.closest("iam-fileupload")&&o.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")}))}}if(i&&i.target instanceof HTMLElement&&i.target.closest(".dialog__wrapper > button")){i.stopPropagation();let o=i.target.closest(".dialog__wrapper > button"),r=o.parentNode,s="openPopover",n=r.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=n&&o.closest("dialog[open]")!=document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,f)=>{u.removeAttribute("aria-expanded")}),n.hasAttribute("open"))n.close(),s="closePopover",n.removeAttribute("style"),o.removeAttribute("aria-expanded");else{n.show(),o.setAttribute("aria-expanded",!0);var a=o.getBoundingClientRect();let u=a.top,f=a.left;if(o.closest("iam-table")){let m=o.closest("iam-table").parentNode.getBoundingClientRect();u-=m.top,f-=m.left}n.classList.contains("dialog--fix")&&n.setAttribute("style",`position:fixed;top: ${u}px; left: ${f}px; margin: 3rem 0 0 0;`)}let l=n.getBoundingClientRect(),c=l.bottom-window.scrollY,d=window.innerHeight-window.scrollY;if(c>d){let u=n.hasAttribute("style")?n.getAttribute("style")+" ":"";n.setAttribute("style",u+"transform: translate(0, calc(-100% - 4rem))"),l=n.getBoundingClientRect(),l.top-window.scrollY<100&&n.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:s,id:o.textContent})}i&&i.target instanceof HTMLElement&&!i.target.closest("dialog[open]")&&!i.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((o,r)=>{o.removeAttribute("aria-expanded")}))}),null),w=e=>{let i=e.querySelector(".youtube-embed a");if(i&&p(i),e.classList.contains("dialog--multi")&&!e.querySelector(":scope > .steps")&&q(e),!e.querySelector(":scope .mh-lg")&&!e.classList.contains("dialog--multi")){e.innerHTML=`<div class="mh-lg">${e.innerHTML}</div>`;let t=e.querySelector(".mh-lg"),a=e.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){let o=a.previousSibling;t.before(a),o&&a.before(o)}}e.querySelector(":scope > button:first-child")||e.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},q=e=>{let i="",t=Array.from(e.querySelectorAll("fieldset[data-title]")),a=e.querySelector("form");t.forEach((s,n)=>{i+=`<button data-title="${s.getAttribute("data-title")}" type="button" class="${n==0?"active":""}" tabindex="-1">${s.getAttribute("data-title")}</button>`;const l=document.createElement("div");if(l.classList.add("btn--wrapper"),s.appendChild(l),n!=0&&(l.innerHTML+=`<button data-title="${t[n-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),n!=t.length-1&&(l.innerHTML+=`<button data-title="${t[n+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),n==t.length-1)if(a&&a.querySelector(':scope > button[type="submit"]')){let c=a.querySelector(':scope > button[type="submit"]');c.classList.add("mb-0"),l.insertAdjacentElement("beforeend",c)}else l.innerHTML+=`<button data-title="${t[n].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),e.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${i}</div>`);let o=Array.from(e.querySelectorAll("fieldset.was-validated"));for(let s=0;s<o.length;s++){let n=o[s],l=n.getAttribute("data-title");if(n.querySelector(".is-invalid")){Array.from(e.querySelectorAll(`[data-title="${l}"]`)).forEach((c,d)=>{c.classList.add("active")});break}else Array.from(e.querySelectorAll(`[data-title="${l}"]`)).forEach((c,d)=>{c.classList.add("valid")})}e.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function r(s){const n=e.querySelector("fieldset.active")?e.querySelector("fieldset.active"):e.querySelector("fieldset[data-title]"),l=n.getAttribute("data-title");let c=!0;if(n.classList.add("was-validated"),Array.from(n.querySelectorAll("input")).forEach((f,m)=>{f.checkValidity()||(c=!1)}),c?Array.from(e.querySelectorAll(`[data-title="${l}"]`)).forEach((f,m)=>{f.classList.add("valid")}):Array.from(e.querySelectorAll(`[data-title="${l}"]`)).forEach((f,m)=>{f.classList.remove("valid")}),c||!s.hasAttribute("data-next")){const f=e.querySelector(`fieldset[data-title="${s.getAttribute("data-title")}"]`),m=e.querySelector(`.steps button[data-title="${s.getAttribute("data-title")}"]`);Array.from(e.querySelectorAll("button")).forEach((A,Y)=>{A.classList.remove("active")}),Array.from(e.querySelectorAll("fieldset")).forEach((A,Y)=>{A.classList.remove("active")}),m.classList.add("active"),f.classList.add("active")}let d=Array.from(e.querySelectorAll("fieldset")).length,u=Array.from(e.querySelectorAll("fieldset.valid")).length;e.style.setProperty("--progress",`${u/(d-1)*100}%`)}e.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){const n=s.target.closest("button");s.keyCode==13&&n.getAttribute("type")!="submit"&&(s.preventDefault(),r(n))}s&&s.target instanceof HTMLElement&&s.target.closest("input")&&(s.target.closest("input").classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault())}),e.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]'))s.target.closest("form").classList.add("was-validated");else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){const n=s.target.closest("button[data-title]");r(n)}return null})};function x(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",e=>{const i=e.target.closest("[open] summary");if(i)window.dataLayer.push({event:"closeDetails",detailsTitle:i.textContent||""});else{const t=e.target.closest("summary"),a=e.target.closest("a"),o=e.target.closest("button");t&&window.dataLayer.push({event:"openDetails",detailsTitle:t.textContent||""}),a&&window.dataLayer.push({event:"linkClicked",linkText:a.hasAttribute("title")?a.getAttribute("title")||"":a.textContent||"",class:a.hasAttribute("class")&&a.getAttribute("class")||"",href:a.getAttribute("href")||""}),o&&window.dataLayer.push({event:"buttonClicked",buttonText:o.textContent||"",class:o.hasAttribute("class")&&o.getAttribute("class")||""})}})}function k(e){var i=new TextEncoder("utf-8").encode(e);return crypto.subtle.digest("SHA-1",i).then(function(t){for(var a=[],o=new DataView(t),r=0;r<o.byteLength;r+=4){var s=o.getUint32(r),n=s.toString(16),l="00000000",c=(l+n).slice(-l.length);a.push(c)}return a.join("")})}const T=(e,i)=>{k(e).then(function(t){const a=new XMLHttpRequest;a.addEventListener("load",function(){const o=this.responseText.split(`
|
|
5
5
|
`),r=t.slice(5).toUpperCase();var s=!1;for(let l in o)if(o[l].substring(0,35)==r){s=!0;break}const n=new CustomEvent("hibpCheck",{detail:s});i.dispatchEvent(n)}),a.open("GET","https://api.pwnedpasswords.com/range/"+t.substr(0,5)),a.send()})},M=e=>{function i(){if(Array.from(document.querySelectorAll("input[maxlength]")).forEach((t,a)=>{t.parentElement,$(t)}),Array.from(document.querySelectorAll("label input")).forEach((t,a)=>{!t.closest("label").querySelector(".optional-text")&&!t.hasAttribute("required")&&(t.parentNode.tagName.toLowerCase()=="span"?t.parentElement.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'):t.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'))}),document.querySelector('input[type="date"]')){let a=function(o){const r=o.getFullYear(),s=String(o.getMonth()+1).padStart(2,"0"),n=String(o.getDate()).padStart(2,"0");return`${r}-${s}-${n}`};const t=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((o,r)=>{let s=t;if(o.hasAttribute("data-start")&&(s.setDate(s.getDate()+parseInt(o.getAttribute("data-start"))),o.setAttribute("min",a(s))),o.hasAttribute("data-period")){let n=parseInt(o.getAttribute("data-period")),l=new Date;l.setDate(s.getDate()+n),o.setAttribute("max",a(l))}if(o.hasAttribute("data-allowed-days")){let n=JSON.parse(`[${o.getAttribute("data-allowed-days")}]`);o.addEventListener("input",function(l){var c=new Date(this.value).getUTCDay();n.includes(c)?o.setCustomValidity(""):o.setCustomValidity("That day of the week is not allowed")})}})}}document.readyState==="complete"&&i(),document.onreadystatechange=()=>{document.readyState==="complete"&&i()},e.addEventListener("input",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("input,textarea,select")){const a=t.target.closest("input,textarea,select");a.parentElement,a.hasAttribute("type")&&a.getAttribute("type")=="color"&&(a.nextElementSibling.value=a.value),a.hasAttribute("maxlength")&&a.nextElementSibling&&a.nextElementSibling.setAttribute("data-count",a.value.length),a.hasAttribute("data-strength-checker")&&y(a)}}),e.addEventListener("change",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("select")){const a=t.target.closest("select");if(a.hasAttribute("data-change-type")&&a.hasAttribute("data-input")){const o=document.getElementById(a.getAttribute("data-input")),r=a.value;v(o,r)}}if(t&&t.target instanceof HTMLElement&&t.target.closest('dialog [type="radio"]')){const a=t.target.closest("dialog");t.target.closest('dialog [type="radio"]'),Array.from(a.querySelectorAll('[type="radio"][autofocus]')).forEach((o,r)=>{o.removeAttribute("autofocus")}),Array.from(a.querySelectorAll('[type="radio"]:checked')).forEach((o,r)=>{o.setAttribute("autofocus",!0)})}}),e.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-change-type][data-input]:not(select)")){const a=t.target.closest("[data-change-type]"),o=document.getElementById(a.getAttribute("data-input")),r=a.getAttribute("data-change-type");if(a.setAttribute("data-change-type",o.getAttribute("type")),v(o,r),a.hasAttribute("data-alt-class")){const s=a.getAttribute("data-alt-class");a.setAttribute("data-alt-class",a.getAttribute("class")),a.setAttribute("class",s)}}})},$=e=>{let i=e.parentElement,t=e.getAttribute("maxlength");i.style.setProperty("--maxlength",t);let a=e.nextElementSibling;(!a||a&&a.classList.contains("invalid-feedback"))&&(a=document.createElement("span"),i.insertBefore(a,e.nextSibling)),a.setAttribute("data-count",e.value.length)},v=(e,i)=>{e.hasAttribute("type")&&e.getAttribute("type")=="password"&&e.setAttribute("data-password-type",!0),e.setAttribute("type",i)},y=(e,i="no")=>{const t=document.getElementById(e.getAttribute("data-strength-checker")),a=e.value,o=e.hasAttribute("minlength")?e.getAttribute("minlength"):12;let r=1,s=["Very weak","Weak","Average","Strong","Very strong"],n="";if(a.match(/(?=.*[0-9])/)&&(r+=1),a.match(/(?=.*[!,%,&,#,$,^,*,?,_,~,<,>,])/)&&(r+=1),a.match(/(?=.*[a-z])/)&&(r+=1),a.match(/(?=.*[A-Z])/)&&(r+=1),a.length<o&&(r=1,n=`(must be at least ${o} characters.)`),r>=3&&i=="no"){let l=function(c,d){c.detail?y(d,"danger"):y(d,"success"),d.removeEventListener("hibpCheck",l)};T(a,e),e.addEventListener("hibpCheck",function(c){l(c,e)})}else r>=3&&i=="danger"&&(r=3,n="(this password is very common)");t&&(r<=3?t.classList.add("invalid-feedback"):t.classList.remove("invalid-feedback"),t.setAttribute("data-strength",r),t.innerHTML=`Password strength: ${s[r-1]} ${n}`)},C=e=>{Array.from(e.querySelectorAll("details")).forEach((i,t)=>{i.addEventListener("mouseenter",function(a){window.matchMedia("(min-width: 62em)").matches&&i.setAttribute("open","true")},!1),i.addEventListener("mouseleave",function(a){window.matchMedia("(min-width: 62em)").matches&&i.removeAttribute("open")},!1)}),"IntersectionObserver"in window&&new IntersectionObserver(([t])=>t.target.classList.toggle("is-stuck",t.intersectionRatio<1),{threshold:[1]}).observe(e)};function _(e){var i;const t=e.querySelector(".testimonial__images"),a=t.querySelectorAll("img").length;if(a==1)return!1;e.classList.add("testimonial--multi");const o=function(r){const s=e.querySelector(".btn-next"),n=e.querySelector(".btn-prev");s.setAttribute("data-go",r+1),n.setAttribute("data-go",r-1),s.removeAttribute("disabled"),n.removeAttribute("disabled"),r==1?n.setAttribute("disabled",!0):r==a&&s.setAttribute("disabled",!0)};t.addEventListener("scroll",function(r){clearTimeout(i),i=setTimeout(function(){let s=t.scrollWidth,n=t.scrollHeight,l=t.scrollLeft,c=t.scrollTop,d=Math.round(l/s*a)+1;l==0&&c!=0&&(d=Math.round(c/n*a)+1),e.setAttribute("data-show",d),o(d)},300)},!1),e.addEventListener("click",function(r){for(var s=r.target;s&&s!=this;s=s.parentNode)if(s.matches("[data-go]")){let n=parseInt(s.getAttribute("data-go")),l=0,c=0,d=t.scrollWidth,u=t.scrollHeight;d>u?c=Math.floor(d*((n-1)/a)):l=Math.floor(u*((n-1)/a)),t.scroll({top:l,left:c,behavior:"smooth"});break}},!1)}function H(e,i){var t;let a=e.querySelector(".carousel__inner"),o=e.querySelector(".carousel__controls"),r=i.querySelectorAll(".col").length;a.addEventListener("scroll",function(s){clearTimeout(t),t=setTimeout(function(){let n=a.clientWidth,l=a.scrollWidth,c=a.scrollLeft,d=Math.round(c/l*r)+1,u=i.querySelector(".col:last-child").offsetLeft+50;a.scrollLeft+n>=u&&(d=r),Array.from(e.querySelectorAll(".carousel__controls button")).forEach((f,m)=>{f.removeAttribute("aria-current")}),e.querySelector(".control-"+d).setAttribute("aria-current",!0),d==1?e.querySelector(".btn-prev").setAttribute("disabled","disabled"):e.querySelector(".btn-prev").removeAttribute("disabled"),d==r?e.querySelector(".btn-next").setAttribute("disabled","disabled"):e.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),o.addEventListener("click",function(s){for(var n=s.target;n&&n!=this;n=n.parentNode)if(typeof n.matches=="function"&&n.matches("button")){s.preventDefault(),Array.from(o.querySelectorAll("button")).forEach((c,d)=>{c.removeAttribute("aria-current")}),n.setAttribute("aria-current",!0);const l=i.querySelector(`*:nth-child(${n.getAttribute("data-slide")})`);a.scroll({top:0,left:l.offsetLeft,behavior:"smooth"});break}},!1),e.addEventListener("click",function(s){for(var n=s.target;n&&n!=this;n=n.parentNode)if(typeof n.matches=="function"&&n.matches(".btn-next, .btn-prev")){s.preventDefault();let l=n.classList.contains("btn-prev")?a.scrollLeft-a.clientWidth:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:l,behavior:"smooth"});break}},!1)}function D(e){e.addEventListener("change",function(i){var t=parseInt(e.querySelector("[data-min] select,[data-min] input").value),a=parseInt(e.querySelector("[data-max] select,[data-max] input").value);Array.from(e.querySelectorAll("[data-min] input")).forEach((o,r)=>{o.setAttribute("max",a)}),Array.from(e.querySelectorAll("[data-max] input")).forEach((o,r)=>{o.setAttribute("min",t)}),Array.from(e.querySelectorAll("[data-min] select option")).forEach((o,r)=>{parseInt(o.getAttribute("value"))>a?o.classList.add("d-none"):o.classList.remove("d-none")}),Array.from(e.querySelectorAll("[data-max] select option")).forEach((o,r)=>{parseInt(o.getAttribute("value"))<t?o.classList.add("d-none"):o.classList.remove("d-none")})},!1)}function I(e){e.addEventListener("change",function(i){if(e.matches("[data-value-if]")){const t=e.getAttribute("data-redirect"),a=e.getAttribute("data-value-if");e.value==a&&(document.location.href=t)}else typeof e.value<"u"&&(document.location.href=e.value)},!1)}function B(e){const t=e.querySelector(".row").cloneNode(!0),a=e.querySelector("[data-add]");e.addEventListener("click",function(o){for(var r=o.target;r&&r!=this;r=r.parentNode){if(r.matches("[data-add]")){const s=t.cloneNode(!0);e.insertBefore(s,r),a.matches("[data-maxfiles]")&&Array.from(e.querySelectorAll(":scope > .row")).length>=a.dataset.maxfiles&&a.setAttribute("disabled","disabled");break}if(r.matches("[data-delete]")){r.closest(".row").remove(),a.matches("[data-maxfiles]")&&Array.from(e.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}},!1)}function N(e){Array.from(e.querySelectorAll("[data-input-range]")).forEach((i,t)=>{D(i)}),Array.from(e.querySelectorAll("[data-redirect]")).forEach((i,t)=>{I(i)}),Array.from(e.querySelectorAll(".multiple-file-uploads")).forEach((i,t)=>{B(i)}),e.addEventListener("change",function(i){for(var t=i.target;t&&t!=this;t=t.parentNode)if(t.matches('[type="file"][data-filesize]')&&t.files&&t.files[0]){const a=t.dataset.filesize;t.files[0].size>a&&(t.value="",alert("File too large"));break}},!1),e.addEventListener("change",function(i){Array.from(e.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((t,a)=>{let o=t.closest("[data-group]")?t.closest("[data-group]"):e,r=t.dataset.activeif,s=t.dataset.equals;o.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?t.removeAttribute("disabled"):(t.setAttribute("disabled","disabled"),t.value="")}),Array.from(e.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((t,a)=>{let o=t.closest("[data-group]")?t.closest("[data-group]"):e,r=t.dataset.activeif,s=t.dataset.equals;o.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?t.classList.remove("d-none"):t.classList.add("d-none")})},!1)}function P(e){if(e.hasAttribute("data-type")&&e.getAttribute("data-type")=="toast"){let t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),e.closest(".notification__holder")||t.appendChild(e)}if(e.setAttribute("role","alert"),e.addEventListener("click",function(t){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(t.preventDefault(),g(e))},!1),e.hasAttribute("data-timeout")){let t=e.getAttribute("data-timeout");var i=new R(function(){g(e)},t);e.addEventListener("mouseenter",a=>{i.pause()}),e.addEventListener("mouseleave",a=>{i.resume()})}}function R(e,i){var t,a,o=i;this.pause=function(){window.clearTimeout(t),o-=new Date-a},this.resume=function(){a=new Date,window.clearTimeout(t),t=window.setTimeout(e,o)},this.resume()}const g=function(e){e.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class V extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,a=`@import "${i}/css/components/notification.css";`,o=`@import "${i}/css/components/notification.global.css";`,r=this.querySelectorAll("a,button");Array.from(r).forEach((n,l)=>{n.setAttribute("slot","btns"),n.classList.add("link")}),(r.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const s=document.createElement("template");s.innerHTML=`
|
|
6
6
|
<style>
|
|
7
7
|
@import "${t}";
|