@iamproperty/components 7.6.4--beta1 → 7.6.4--beta3

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.
Files changed (137) hide show
  1. package/assets/css/components/actionbar.component.css +1 -1
  2. package/assets/css/components/actionbar.component.css.map +1 -1
  3. package/assets/css/components/address-lookup.component.css +1 -1
  4. package/assets/css/components/address-lookup.component.css.map +1 -1
  5. package/assets/css/components/calendar.component.css +1 -1
  6. package/assets/css/components/calendar.component.css.map +1 -1
  7. package/assets/css/components/fileupload.css +1 -1
  8. package/assets/css/components/fileupload.css.map +1 -1
  9. package/assets/css/components/multiselect.css +1 -1
  10. package/assets/css/components/multiselect.css.map +1 -1
  11. package/assets/css/components/multiselect.preload.css +1 -1
  12. package/assets/css/components/multiselect.preload.css.map +1 -1
  13. package/assets/css/components/nav.component.css +1 -1
  14. package/assets/css/components/nav.component.css.map +1 -1
  15. package/assets/css/components/pagination.css +1 -1
  16. package/assets/css/components/pagination.css.map +1 -1
  17. package/assets/css/components/slider.css +1 -1
  18. package/assets/css/components/slider.css.map +1 -1
  19. package/assets/css/components/tag.component.css +1 -1
  20. package/assets/css/components/tag.component.css.map +1 -1
  21. package/assets/css/components/tag.preload.css +1 -1
  22. package/assets/css/components/tag.preload.css.map +1 -1
  23. package/assets/css/core.min.css +1 -1
  24. package/assets/css/core.min.css.map +1 -1
  25. package/assets/css/style.min.css +1 -1
  26. package/assets/css/style.min.css.map +1 -1
  27. package/assets/js/components/accordion/accordion.component.min.js +1 -1
  28. package/assets/js/components/actionbar/actionbar.component.min.js +2 -2
  29. package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
  30. package/assets/js/components/address-lookup/address-lookup.component.js +11 -5
  31. package/assets/js/components/address-lookup/address-lookup.component.min.js +4 -4
  32. package/assets/js/components/address-lookup/address-lookup.component.min.js.map +1 -1
  33. package/assets/js/components/advanced-select/advanced-select.component.min.js +1 -1
  34. package/assets/js/components/advanced-select/advanced-select.component.min.js.map +1 -1
  35. package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
  36. package/assets/js/components/barchart/barchart.component.min.js +1 -1
  37. package/assets/js/components/barchart/barchart.component.min.js.map +1 -1
  38. package/assets/js/components/bento-grid/bento-grid.component.min.js +1 -1
  39. package/assets/js/components/calendar/calendar.component.min.js +2 -2
  40. package/assets/js/components/calendar/calendar.component.min.js.map +1 -1
  41. package/assets/js/components/card/card.component.min.js +1 -1
  42. package/assets/js/components/carousel/carousel.component.min.js +1 -1
  43. package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
  44. package/assets/js/components/content/content.component.min.js +1 -1
  45. package/assets/js/components/darkmode/darkmode.component.min.js +1 -1
  46. package/assets/js/components/doughnutchart/doughnutchart.component.min.js +1 -1
  47. package/assets/js/components/doughnutchart/doughnutchart.component.min.js.map +1 -1
  48. package/assets/js/components/fileupload/fileupload.component.min.js +2 -2
  49. package/assets/js/components/filter-card/filter-card.component.min.js +1 -1
  50. package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
  51. package/assets/js/components/form/form.component.js +68 -0
  52. package/assets/js/components/form/form.component.min.js +9 -0
  53. package/assets/js/components/form/form.component.min.js.map +1 -0
  54. package/assets/js/components/header/header.component.min.js +1 -1
  55. package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
  56. package/assets/js/components/input/input.component.js +7 -5
  57. package/assets/js/components/input/input.component.min.js +2 -2
  58. package/assets/js/components/input/input.component.min.js.map +1 -1
  59. package/assets/js/components/input-range/input-range.component.min.js +1 -1
  60. package/assets/js/components/marketing/marketing.component.min.js +1 -1
  61. package/assets/js/components/menu/menu.component.min.js +1 -1
  62. package/assets/js/components/milestone/milestone.component.min.js +1 -1
  63. package/assets/js/components/milestone-group/milestone-group.component.min.js +1 -1
  64. package/assets/js/components/modal/modal.component.js +1 -1
  65. package/assets/js/components/modal/modal.component.min.js +2 -2
  66. package/assets/js/components/modal/modal.component.min.js.map +1 -1
  67. package/assets/js/components/multi-step/multi-step.component.min.js +1 -1
  68. package/assets/js/components/multi-step-modal/multi-step-modal.component.min.js +1 -1
  69. package/assets/js/components/multiselect/multiselect.component.js +9 -76
  70. package/assets/js/components/multiselect/multiselect.component.min.js +4 -4
  71. package/assets/js/components/multiselect/multiselect.component.min.js.map +1 -1
  72. package/assets/js/components/nav/nav.component.min.js +2 -2
  73. package/assets/js/components/notification/notification.component.min.js +1 -1
  74. package/assets/js/components/pagination/pagination.component.min.js +3 -3
  75. package/assets/js/components/password/password.component.min.js +1 -1
  76. package/assets/js/components/popover/popover.component.min.js +1 -1
  77. package/assets/js/components/rank/rank.component.min.js +1 -1
  78. package/assets/js/components/rankings/rankings.component.min.js +1 -1
  79. package/assets/js/components/rating/rating.component.min.js +1 -1
  80. package/assets/js/components/record-card/record-card.component.min.js +1 -1
  81. package/assets/js/components/search/search.component.min.js +1 -1
  82. package/assets/js/components/search/search.component.min.js.map +1 -1
  83. package/assets/js/components/slider/slider.component.min.js +2 -2
  84. package/assets/js/components/split-button/split-button.component.min.js +1 -1
  85. package/assets/js/components/std-address-lookup/std-address-lookup.component.js +59 -2
  86. package/assets/js/components/std-address-lookup/std-address-lookup.component.min.js +10 -9
  87. package/assets/js/components/std-address-lookup/std-address-lookup.component.min.js.map +1 -1
  88. package/assets/js/components/table/table.component.min.js +1 -1
  89. package/assets/js/components/table/table.component.min.js.map +1 -1
  90. package/assets/js/components/table-ajax/table-ajax.component.min.js +1 -1
  91. package/assets/js/components/table-ajax/table-ajax.component.min.js.map +1 -1
  92. package/assets/js/components/table-basic/table-basic.component.min.js +1 -1
  93. package/assets/js/components/table-basic/table-basic.component.min.js.map +1 -1
  94. package/assets/js/components/table-no-submit/table-no-submit.component.min.js +1 -1
  95. package/assets/js/components/table-no-submit/table-no-submit.component.min.js.map +1 -1
  96. package/assets/js/components/table-submit/table-submit.component.min.js +1 -1
  97. package/assets/js/components/table-submit/table-submit.component.min.js.map +1 -1
  98. package/assets/js/components/tabs/tabs.component.min.js +1 -1
  99. package/assets/js/components/tabs/tabs.component.min.js.map +1 -1
  100. package/assets/js/components/tag/tag.component.js +6 -1
  101. package/assets/js/components/tag/tag.component.min.js +4 -4
  102. package/assets/js/components/tag/tag.component.min.js.map +1 -1
  103. package/assets/js/components/tooltip/tooltip.component.min.js +1 -1
  104. package/assets/js/components/video-card/video-card.component.min.js +1 -1
  105. package/assets/js/components/video-modal/video-modal.component.min.js +1 -1
  106. package/assets/js/components/word-count/word-count.component.min.js +1 -1
  107. package/assets/js/modules/dropdown.js +97 -4
  108. package/assets/js/modules/helpers.js +26 -22
  109. package/assets/js/scripts.bundle.js +2 -2
  110. package/assets/js/scripts.bundle.js.map +1 -1
  111. package/assets/js/scripts.bundle.min.js +2 -2
  112. package/assets/js/scripts.bundle.min.js.map +1 -1
  113. package/assets/sass/_components.scss +0 -2
  114. package/assets/sass/_elements.scss +1 -0
  115. package/assets/sass/components/multiselect.preload.scss +0 -55
  116. package/assets/sass/components/multiselect.scss +172 -174
  117. package/assets/sass/components/tag.component.scss +38 -57
  118. package/assets/sass/components/tag.preload.scss +1 -26
  119. package/assets/sass/elements/dropdown.scss +87 -0
  120. package/assets/sass/elements/forms.scss +14 -14
  121. package/assets/sass/elements/icons.css +4 -4
  122. package/assets/sass/elements/input.scss +0 -14
  123. package/assets/sass/elements/textarea.scss +97 -0
  124. package/assets/sass/templates/form.scss +14 -5
  125. package/assets/ts/components/address-lookup/address-lookup.component.ts +12 -5
  126. package/assets/ts/components/form/form.component.ts +102 -0
  127. package/assets/ts/components/input/input.component.ts +8 -6
  128. package/assets/ts/components/modal/modal.component.ts +1 -1
  129. package/assets/ts/components/multiselect/multiselect.component.ts +10 -78
  130. package/assets/ts/components/std-address-lookup/std-address-lookup.component.ts +83 -2
  131. package/assets/ts/components/tag/tag.component.ts +8 -11
  132. package/assets/ts/modules/dropdown.ts +117 -5
  133. package/assets/ts/modules/helpers.ts +32 -27
  134. package/dist/components.es.js +28 -28
  135. package/dist/components.umd.js +225 -211
  136. package/package.json +2 -2
  137. package/src/components/Form/Form.vue +22 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */function r(s,t){i(s,t)}function i(s,t){let e;t.addEventListener("keyup",()=>{clearTimeout(e),e=setTimeout(function(){o(s,t.value)},500)}),t.addEventListener("change",()=>{clearTimeout(e),o(s,t.value)})}const o=function(s,t){Array.from(s.querySelectorAll(":scope > li")).forEach(e=>{const a=e.textContent.toLowerCase();e.classList.add("d-none"),a.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 n 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>
@@ -0,0 +1,68 @@
1
+ import { trackComponentRegistered } from '../_global.js';
2
+ trackComponentRegistered('iam-tag');
3
+ class iamTag extends HTMLElement {
4
+ constructor() {
5
+ super();
6
+ this.attachShadow({ mode: 'open' });
7
+ const template = document.createElement('template');
8
+ template.innerHTML = `
9
+ <div class="wrapper">
10
+ <slot></slot>
11
+ </div>
12
+ `;
13
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
14
+ }
15
+ isFormValid(form) {
16
+ if (form.querySelector(':invalid'))
17
+ return false;
18
+ if (form.querySelector('.pwd-checker[data-strength="1"]') || form.querySelector('.pwd-checker[data-strength="2"]'))
19
+ return false;
20
+ if (form.querySelector('iam-multiselect[data-is-required][data-error]'))
21
+ return false;
22
+ return true;
23
+ }
24
+ ;
25
+ connectedCallback() {
26
+ const form = this.querySelector('form');
27
+ if (!form)
28
+ return false;
29
+ form.setAttribute('novalidate', 'true');
30
+ // Form validation
31
+ form.addEventListener('submit', (e) => {
32
+ var _a;
33
+ form.classList.add('was-validated');
34
+ if (!this.isFormValid(form)) {
35
+ console.log('hey2');
36
+ e.preventDefault();
37
+ (_a = form === null || form === void 0 ? void 0 : form.querySelector('input:invalid')) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
38
+ }
39
+ });
40
+ // conditional reveal required fields
41
+ Array.from(form.querySelectorAll('.conditional [required]')).forEach((input) => {
42
+ input.setAttribute('data-conditional-required', 'true');
43
+ input.removeAttribute('required');
44
+ });
45
+ // conditional reveal required fields (for fields inside of components like the address lookup)
46
+ Array.from(form.querySelectorAll('.conditional [data-required]')).forEach((input) => {
47
+ input.setAttribute('data-conditional-data-required', 'true');
48
+ input.removeAttribute('data-required');
49
+ });
50
+ form.addEventListener('change', () => {
51
+ Array.from(form.querySelectorAll('.conditional [data-conditional-required], .conditional [data-conditional-data-required]')).forEach((input) => {
52
+ input.removeAttribute('required');
53
+ input.removeAttribute('data-required');
54
+ });
55
+ Array.from(form.querySelectorAll('.conditional [data-conditional-required]')).forEach((input) => {
56
+ const conditionalStyles = window.getComputedStyle(input.closest('.conditional'));
57
+ if (conditionalStyles.getPropertyValue("display") == 'block')
58
+ input.setAttribute('required', 'required');
59
+ });
60
+ Array.from(form.querySelectorAll('.conditional [data-conditional-data-required]')).forEach((input) => {
61
+ const conditionalStyles = window.getComputedStyle(input.closest('.conditional'));
62
+ if (conditionalStyles.getPropertyValue("display") == 'block')
63
+ input.setAttribute('data-required', 'true');
64
+ });
65
+ });
66
+ }
67
+ }
68
+ export default iamTag;
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * iamKey v7.6.4--beta3
3
+ * Copyright 2022-2026 iamproperty
4
+ */const o=a=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:a})};o("iam-tag");class i extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.createElement("template");e.innerHTML=`
5
+ <div class="wrapper">
6
+ <slot></slot>
7
+ </div>
8
+ `,this.shadowRoot.appendChild(e.content.cloneNode(!0))}isFormValid(e){return!(e.querySelector(":invalid")||e.querySelector('.pwd-checker[data-strength="1"]')||e.querySelector('.pwd-checker[data-strength="2"]')||e.querySelector("iam-multiselect[data-is-required][data-error]"))}connectedCallback(){const e=this.querySelector("form");if(!e)return!1;e.setAttribute("novalidate","true"),e.addEventListener("submit",t=>{var r;e.classList.add("was-validated"),this.isFormValid(e)||(console.log("hey2"),t.preventDefault(),(r=e?.querySelector("input:invalid"))===null||r===void 0||r.scrollIntoView())}),Array.from(e.querySelectorAll(".conditional [required]")).forEach(t=>{t.setAttribute("data-conditional-required","true"),t.removeAttribute("required")}),Array.from(e.querySelectorAll(".conditional [data-required]")).forEach(t=>{t.setAttribute("data-conditional-data-required","true"),t.removeAttribute("data-required")}),e.addEventListener("change",()=>{Array.from(e.querySelectorAll(".conditional [data-conditional-required], .conditional [data-conditional-data-required]")).forEach(t=>{t.removeAttribute("required"),t.removeAttribute("data-required")}),Array.from(e.querySelectorAll(".conditional [data-conditional-required]")).forEach(t=>{window.getComputedStyle(t.closest(".conditional")).getPropertyValue("display")=="block"&&t.setAttribute("required","required")}),Array.from(e.querySelectorAll(".conditional [data-conditional-data-required]")).forEach(t=>{window.getComputedStyle(t.closest(".conditional")).getPropertyValue("display")=="block"&&t.setAttribute("data-required","true")})})}}export{i as default};
9
+ //# sourceMappingURL=form.component.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.component.min.js","sources":["../_global.js","form.component.js"],"sourcesContent":["export const trackComponentRegistered = (componentName) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementRegistered',\n element: componentName,\n });\n};\nexport const trackComponent = (component, componentName, trackEvents) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementAdded',\n element: componentName,\n });\n trackEvents.forEach((eventName) => {\n component.addEventListener(eventName, function (event) {\n const eventDetails = {\n event: eventName,\n element: componentName,\n target: event.target,\n };\n Object.keys(event.detail).forEach((eventKey) => {\n const eventDetail = event.detail[eventKey];\n eventDetails[eventKey] = eventDetail;\n });\n window.dataLayer.push(eventDetails);\n });\n });\n return true;\n};\n","import { trackComponentRegistered } from '../_global.js';\ntrackComponentRegistered('iam-tag');\nclass iamTag extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const template = document.createElement('template');\n template.innerHTML = `\n <div class=\"wrapper\">\n <slot></slot>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n isFormValid(form) {\n if (form.querySelector(':invalid'))\n return false;\n if (form.querySelector('.pwd-checker[data-strength=\"1\"]') || form.querySelector('.pwd-checker[data-strength=\"2\"]'))\n return false;\n if (form.querySelector('iam-multiselect[data-is-required][data-error]'))\n return false;\n return true;\n }\n ;\n connectedCallback() {\n const form = this.querySelector('form');\n if (!form)\n return false;\n form.setAttribute('novalidate', 'true');\n // Form validation\n form.addEventListener('submit', (e) => {\n var _a;\n form.classList.add('was-validated');\n if (!this.isFormValid(form)) {\n console.log('hey2');\n e.preventDefault();\n (_a = form === null || form === void 0 ? void 0 : form.querySelector('input:invalid')) === null || _a === void 0 ? void 0 : _a.scrollIntoView();\n }\n });\n // conditional reveal required fields\n Array.from(form.querySelectorAll('.conditional [required]')).forEach((input) => {\n input.setAttribute('data-conditional-required', 'true');\n input.removeAttribute('required');\n });\n // conditional reveal required fields (for fields inside of components like the address lookup)\n Array.from(form.querySelectorAll('.conditional [data-required]')).forEach((input) => {\n input.setAttribute('data-conditional-data-required', 'true');\n input.removeAttribute('data-required');\n });\n form.addEventListener('change', () => {\n Array.from(form.querySelectorAll('.conditional [data-conditional-required], .conditional [data-conditional-data-required]')).forEach((input) => {\n input.removeAttribute('required');\n input.removeAttribute('data-required');\n });\n Array.from(form.querySelectorAll('.conditional [data-conditional-required]')).forEach((input) => {\n const conditionalStyles = window.getComputedStyle(input.closest('.conditional'));\n if (conditionalStyles.getPropertyValue(\"display\") == 'block')\n input.setAttribute('required', 'required');\n });\n Array.from(form.querySelectorAll('.conditional [data-conditional-data-required]')).forEach((input) => {\n const conditionalStyles = window.getComputedStyle(input.closest('.conditional'));\n if (conditionalStyles.getPropertyValue(\"display\") == 'block')\n input.setAttribute('data-required', 'true');\n });\n });\n }\n}\nexport default iamTag;\n"],"names":["trackComponentRegistered","componentName","iamTag","template","form","e","_a","input"],"mappings":";;;IAAO,MAAMA,EAA4BC,GAAkB,CAEvD,OAAO,UAAY,OAAO,WAAa,CAAA,EACvC,OAAO,UAAU,KAAK,CAClB,MAAO,0BACP,QAASA,CACjB,CAAK,CACL,ECNAD,EAAyB,SAAS,EAClC,MAAME,UAAe,WAAY,CAC7B,aAAc,CACV,MAAK,EACL,KAAK,aAAa,CAAE,KAAM,MAAM,CAAE,EAClC,MAAMC,EAAW,SAAS,cAAc,UAAU,EAClDA,EAAS,UAAY;AAAA;AAAA;AAAA;AAAA,MAKrB,KAAK,WAAW,YAAYA,EAAS,QAAQ,UAAU,EAAI,CAAC,CAChE,CACA,YAAYC,EAAM,CAKd,MAJI,EAAAA,EAAK,cAAc,UAAU,GAE7BA,EAAK,cAAc,iCAAiC,GAAKA,EAAK,cAAc,iCAAiC,GAE7GA,EAAK,cAAc,+CAA+C,EAG1E,CAEA,mBAAoB,CAChB,MAAMA,EAAO,KAAK,cAAc,MAAM,EACtC,GAAI,CAACA,EACD,MAAO,GACXA,EAAK,aAAa,aAAc,MAAM,EAEtCA,EAAK,iBAAiB,SAAWC,GAAM,CACnC,IAAIC,EACJF,EAAK,UAAU,IAAI,eAAe,EAC7B,KAAK,YAAYA,CAAI,IACtB,QAAQ,IAAI,MAAM,EAClBC,EAAE,eAAc,GACfC,EAAiDF,GAAK,cAAc,eAAe,KAAO,MAAQE,IAAO,QAAkBA,EAAG,eAAc,EAErJ,CAAC,EAED,MAAM,KAAKF,EAAK,iBAAiB,yBAAyB,CAAC,EAAE,QAASG,GAAU,CAC5EA,EAAM,aAAa,4BAA6B,MAAM,EACtDA,EAAM,gBAAgB,UAAU,CACpC,CAAC,EAED,MAAM,KAAKH,EAAK,iBAAiB,8BAA8B,CAAC,EAAE,QAASG,GAAU,CACjFA,EAAM,aAAa,iCAAkC,MAAM,EAC3DA,EAAM,gBAAgB,eAAe,CACzC,CAAC,EACDH,EAAK,iBAAiB,SAAU,IAAM,CAClC,MAAM,KAAKA,EAAK,iBAAiB,yFAAyF,CAAC,EAAE,QAASG,GAAU,CAC5IA,EAAM,gBAAgB,UAAU,EAChCA,EAAM,gBAAgB,eAAe,CACzC,CAAC,EACD,MAAM,KAAKH,EAAK,iBAAiB,0CAA0C,CAAC,EAAE,QAASG,GAAU,CACnE,OAAO,iBAAiBA,EAAM,QAAQ,cAAc,CAAC,EACzD,iBAAiB,SAAS,GAAK,SACjDA,EAAM,aAAa,WAAY,UAAU,CACjD,CAAC,EACD,MAAM,KAAKH,EAAK,iBAAiB,+CAA+C,CAAC,EAAE,QAASG,GAAU,CACxE,OAAO,iBAAiBA,EAAM,QAAQ,cAAc,CAAC,EACzD,iBAAiB,SAAS,GAAK,SACjDA,EAAM,aAAa,gBAAiB,MAAM,CAClD,CAAC,CACL,CAAC,CACL,CACJ"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class a extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const t=document.createElement("template");t.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"inline edit"});class v extends HTMLElement{constructor(){super();const e=this.attachShadow({mode:"open"});document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const n=document.createElement("template");n.innerHTML=`
5
5
  <style class="styles">
@@ -54,15 +54,17 @@ class iamInput extends HTMLElement {
54
54
  };
55
55
  setIcon(inputType);
56
56
  const setCurrencyRules = () => {
57
+ let originalValue = input.value.replace(',', '');
58
+ input === null || input === void 0 ? void 0 : input.setAttribute('data-value', originalValue);
57
59
  input.setAttribute('type', 'text');
58
- input === null || input === void 0 ? void 0 : input.setAttribute('data-value', input.value);
59
- input.value = new Intl.NumberFormat("en-GB", {
60
+ originalValue = new Intl.NumberFormat("en-GB", {
60
61
  style: "currency",
61
62
  currency: "GBP",
62
- minimumFractionDigits: Number.isInteger(input.value) ? 0 : 2,
63
- maximumFractionDigits: Number.isInteger(input.value) ? 0 : 2,
63
+ minimumFractionDigits: Number.isInteger(originalValue) ? 0 : 2,
64
+ maximumFractionDigits: Number.isInteger(originalValue) ? 0 : 2,
64
65
  trailingZeroDisplay: 'stripIfInteger' // Strip zeros if it's an integer
65
- }).format(input.value).replace("£", "");
66
+ }).format(originalValue).replace("£", "");
67
+ input.value = originalValue;
66
68
  };
67
69
  // Currency type
68
70
  if (component === null || component === void 0 ? void 0 : component.hasAttribute('data-currency')) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */const q=k=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:k})};q("iam-iamPrefix");class _ extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const s=document.createElement("template");s.innerHTML=`
5
5
  <style>
@@ -12,5 +12,5 @@
12
12
  <slot part="input-wrapper"></slot>
13
13
  <slot part="suffix"><slot name="suffix"></slot></slot>
14
14
  </div>
15
- `,this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){var s,u,c,p,f,h,m,v,x,b;const a=this,t=this.querySelector("input"),S=t?.hasAttribute("type")?t?.getAttribute("type"):"text",l=(s=this.shadowRoot)===null||s===void 0?void 0:s.querySelector('[part="prefix"]'),e=(u=this.shadowRoot)===null||u===void 0?void 0:u.querySelector('[part="suffix"]');this.closest("label")&&this.classList.add("mb-0");const A=i=>{switch(i){case"date":case"datetime-local":case"year":case"month":case"week":this.setAttribute("data-suffix-icon","calendar"),e?.setAttribute("role","button");break;case"time":this.setAttribute("data-suffix-icon","clock"),e?.setAttribute("role","button");break;default:this.removeAttribute("data-suffix-icon"),e?.removeAttribute("role");break}};A(S);const E=()=>{t.setAttribute("type","text"),t?.setAttribute("data-value",t.value),t.value=new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:Number.isInteger(t.value)?0:2,maximumFractionDigits:Number.isInteger(t.value)?0:2,trailingZeroDisplay:"stripIfInteger"}).format(t.value).replace("\xA3","")};if(a?.hasAttribute("data-currency")){switch(a?.hasAttribute("data-currency")){case"dollar":a.setAttribute("data-prefix-icon","dollar-sign");break;case"euro":a.setAttribute("data-prefix-icon","euro-sign");break;default:a.setAttribute("data-prefix-icon","sterling-sign");break}E(),t?.addEventListener("focus",i=>{t.setAttribute("type","number"),t.value=t.getAttribute("data-value"),t.setAttribute("value",t.getAttribute("data-value"))}),t?.addEventListener("input",i=>{t?.setAttribute("data-value",t.value)}),t?.addEventListener("blur",i=>{E()})}if(t?.matches('[type="color"]')&&(this.insertAdjacentHTML("beforeend","<output></output>"),t.addEventListener("input",()=>{t.nextElementSibling.value=t.value})),this.hasAttribute("data-prefix-icon")&&(l==null||(l.className=`prefix fa-${this.hasAttribute("data-prefix-weight")?this.getAttribute("data-prefix-weight"):"regular"} fa-${this.getAttribute("data-prefix-icon")}`),(c=this.querySelector("input"))===null||c===void 0||c.classList.add("has-prefix")),this.hasAttribute("data-suffix-icon")&&(e==null||(e.className=`suffix fa-${this.hasAttribute("data-suffix-weight")?this.getAttribute("data-suffix-weight"):"regular"} fa-${this.getAttribute("data-suffix-icon")}`),(p=this.querySelector("input"))===null||p===void 0||p.classList.add("has-suffix")),!((f=this.shadowRoot.querySelector('[name="prefix"]'))===null||f===void 0)&&f.assignedElements().length&&((h=this.shadowRoot.querySelector('[name="prefix"]'))===null||h===void 0||h.classList.add("prefix"),(m=this.querySelector("input"))===null||m===void 0||m.classList.add("has-prefix")),!((v=this.shadowRoot.querySelector('[name="suffix"]'))===null||v===void 0)&&v.assignedElements().length&&((x=this.shadowRoot.querySelector('[name="suffix"]'))===null||x===void 0||x.classList.add("suffix"),(b=this.querySelector("input"))===null||b===void 0||b.classList.add("has-suffix")),this.querySelector("[data-change-type]")){const i=this.querySelector("[data-change-type]");i.addEventListener("change",()=>{t.setAttribute("type",i.value),A(i.value),this.getAttribute("data-suffix-icon")?(e==null||(e.className=`suffix fa-${this.hasAttribute("data-suffix-weight")?this.getAttribute("data-suffix-weight"):"regular"} fa-${this.getAttribute("data-suffix-icon")}`),t?.classList.add("has-suffix")):(e?.removeAttribute("class"),t?.classList.remove("has-suffix"))})}const L=(i,g)=>{const o=new Date(i.value).getUTCDay();g.includes(o)?i.setCustomValidity(""):i.setCustomValidity("That day of the week is not allowed")};if(t?.matches('[type="date"], [type="datetime-local"]')&&this.hasAttribute("data-allowed-days")){const i=JSON.parse(`[${this.getAttribute("data-allowed-days")}]`);L(t,i),t.addEventListener("input",()=>{L(t,i)})}if(e.addEventListener("click",function(){a?.querySelector('select[data-change-type][slot="suffix"]')||t.showPicker()}),l.addEventListener("click",function(){a?.querySelector('select[data-change-type][slot="prefix"]')||t.showPicker()}),a.hasAttribute("data-duplicate")){const i=a.getAttribute("data-duplicate"),g=document.querySelectorAll(`[name="${i}"], [id="${i}"]`);t.addEventListener("change",o=>{var r;if(t.closest("iam-modal"))return!1;if(t?.matches('[type="checkbox"]')&&(watchedInput!=null&&watchedInput.matches('[type="checkbox"]'))&&(watchedInput.checked=o.target.checked,!o.detail&&!(!((r=o.detail)===null||r===void 0)&&r.triggered))){const n=new CustomEvent("change",{detail:{triggered:!0}});watchedInput==null||watchedInput.dispatchEvent(n)}}),Array.from(g).forEach(o=>{o?.addEventListener("change",r=>{var n,y;if(t?.matches('[type="checkbox"]')&&o?.matches('[type="checkbox"]')&&(t.checked=r.target.checked,!r.detail&&!(!((n=r.detail)===null||n===void 0)&&n.triggered))){const d=new CustomEvent("change",{detail:{triggered:!0}});t?.dispatchEvent(d)}if(!t?.matches('[type="checkbox"]')&&o?.matches('[type="checkbox"]')){let d="";if(Array.from(document.querySelectorAll(`[name="${i}"]:checked`)).forEach(w=>{d+=(d==""?"":",")+w.value}),t.value=d,!r.detail&&!(!((y=r.detail)===null||y===void 0)&&y.triggered)){const w=new CustomEvent("change",{detail:{triggered:!0}});t?.dispatchEvent(w)}}})})}}}export{_ as default};
15
+ `,this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){var s,c,u,p,f,h,m,v,x,b;const a=this,t=this.querySelector("input"),S=t?.hasAttribute("type")?t?.getAttribute("type"):"text",l=(s=this.shadowRoot)===null||s===void 0?void 0:s.querySelector('[part="prefix"]'),i=(c=this.shadowRoot)===null||c===void 0?void 0:c.querySelector('[part="suffix"]');this.closest("label")&&this.classList.add("mb-0");const A=e=>{switch(e){case"date":case"datetime-local":case"year":case"month":case"week":this.setAttribute("data-suffix-icon","calendar"),i?.setAttribute("role","button");break;case"time":this.setAttribute("data-suffix-icon","clock"),i?.setAttribute("role","button");break;default:this.removeAttribute("data-suffix-icon"),i?.removeAttribute("role");break}};A(S);const E=()=>{let e=t.value.replace(",","");t?.setAttribute("data-value",e),t.setAttribute("type","text"),e=new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:Number.isInteger(e)?0:2,maximumFractionDigits:Number.isInteger(e)?0:2,trailingZeroDisplay:"stripIfInteger"}).format(e).replace("\xA3",""),t.value=e};if(a?.hasAttribute("data-currency")){switch(a?.hasAttribute("data-currency")){case"dollar":a.setAttribute("data-prefix-icon","dollar-sign");break;case"euro":a.setAttribute("data-prefix-icon","euro-sign");break;default:a.setAttribute("data-prefix-icon","sterling-sign");break}E(),t?.addEventListener("focus",e=>{t.setAttribute("type","number"),t.value=t.getAttribute("data-value"),t.setAttribute("value",t.getAttribute("data-value"))}),t?.addEventListener("input",e=>{t?.setAttribute("data-value",t.value)}),t?.addEventListener("blur",e=>{E()})}if(t?.matches('[type="color"]')&&(this.insertAdjacentHTML("beforeend","<output></output>"),t.addEventListener("input",()=>{t.nextElementSibling.value=t.value})),this.hasAttribute("data-prefix-icon")&&(l==null||(l.className=`prefix fa-${this.hasAttribute("data-prefix-weight")?this.getAttribute("data-prefix-weight"):"regular"} fa-${this.getAttribute("data-prefix-icon")}`),(u=this.querySelector("input"))===null||u===void 0||u.classList.add("has-prefix")),this.hasAttribute("data-suffix-icon")&&(i==null||(i.className=`suffix fa-${this.hasAttribute("data-suffix-weight")?this.getAttribute("data-suffix-weight"):"regular"} fa-${this.getAttribute("data-suffix-icon")}`),(p=this.querySelector("input"))===null||p===void 0||p.classList.add("has-suffix")),!((f=this.shadowRoot.querySelector('[name="prefix"]'))===null||f===void 0)&&f.assignedElements().length&&((h=this.shadowRoot.querySelector('[name="prefix"]'))===null||h===void 0||h.classList.add("prefix"),(m=this.querySelector("input"))===null||m===void 0||m.classList.add("has-prefix")),!((v=this.shadowRoot.querySelector('[name="suffix"]'))===null||v===void 0)&&v.assignedElements().length&&((x=this.shadowRoot.querySelector('[name="suffix"]'))===null||x===void 0||x.classList.add("suffix"),(b=this.querySelector("input"))===null||b===void 0||b.classList.add("has-suffix")),this.querySelector("[data-change-type]")){const e=this.querySelector("[data-change-type]");e.addEventListener("change",()=>{t.setAttribute("type",e.value),A(e.value),this.getAttribute("data-suffix-icon")?(i==null||(i.className=`suffix fa-${this.hasAttribute("data-suffix-weight")?this.getAttribute("data-suffix-weight"):"regular"} fa-${this.getAttribute("data-suffix-icon")}`),t?.classList.add("has-suffix")):(i?.removeAttribute("class"),t?.classList.remove("has-suffix"))})}const L=(e,g)=>{const o=new Date(e.value).getUTCDay();g.includes(o)?e.setCustomValidity(""):e.setCustomValidity("That day of the week is not allowed")};if(t?.matches('[type="date"], [type="datetime-local"]')&&this.hasAttribute("data-allowed-days")){const e=JSON.parse(`[${this.getAttribute("data-allowed-days")}]`);L(t,e),t.addEventListener("input",()=>{L(t,e)})}if(i.addEventListener("click",function(){a?.querySelector('select[data-change-type][slot="suffix"]')||t.showPicker()}),l.addEventListener("click",function(){a?.querySelector('select[data-change-type][slot="prefix"]')||t.showPicker()}),a.hasAttribute("data-duplicate")){const e=a.getAttribute("data-duplicate"),g=document.querySelectorAll(`[name="${e}"], [id="${e}"]`);t.addEventListener("change",o=>{var r;if(t.closest("iam-modal"))return!1;if(t?.matches('[type="checkbox"]')&&(watchedInput!=null&&watchedInput.matches('[type="checkbox"]'))&&(watchedInput.checked=o.target.checked,!o.detail&&!(!((r=o.detail)===null||r===void 0)&&r.triggered))){const n=new CustomEvent("change",{detail:{triggered:!0}});watchedInput==null||watchedInput.dispatchEvent(n)}}),Array.from(g).forEach(o=>{o?.addEventListener("change",r=>{var n,y;if(t?.matches('[type="checkbox"]')&&o?.matches('[type="checkbox"]')&&(t.checked=r.target.checked,!r.detail&&!(!((n=r.detail)===null||n===void 0)&&n.triggered))){const d=new CustomEvent("change",{detail:{triggered:!0}});t?.dispatchEvent(d)}if(!t?.matches('[type="checkbox"]')&&o?.matches('[type="checkbox"]')){let d="";if(Array.from(document.querySelectorAll(`[name="${e}"]:checked`)).forEach(w=>{d+=(d==""?"":",")+w.value}),t.value=d,!r.detail&&!(!((y=r.detail)===null||y===void 0)&&y.triggered)){const w=new CustomEvent("change",{detail:{triggered:!0}});t?.dispatchEvent(w)}}})})}}}export{_ as default};
16
16
  //# sourceMappingURL=input.component.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.component.min.js","sources":["../_global.js","input.component.js"],"sourcesContent":["export const trackComponentRegistered = (componentName) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementRegistered',\n element: componentName,\n });\n};\nexport const trackComponent = (component, componentName, trackEvents) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementAdded',\n element: componentName,\n });\n trackEvents.forEach((eventName) => {\n component.addEventListener(eventName, function (event) {\n const eventDetails = {\n event: eventName,\n element: componentName,\n target: event.target,\n };\n Object.keys(event.detail).forEach((eventKey) => {\n const eventDetail = event.detail[eventKey];\n eventDetails[eventKey] = eventDetail;\n });\n window.dataLayer.push(eventDetails);\n });\n });\n return true;\n};\n","import { trackComponentRegistered } from '../_global.js';\ntrackComponentRegistered('iam-iamPrefix');\nclass iamInput extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location')\n ? document.body.getAttribute('data-assets-location')\n : '/assets';\n const loadCSS = `@import \"${assetLocation}/css/components/input.component.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n ${loadCSS}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\">\n <div class=\"wrapper\" part=\"wrapper\">\n <span part=\"prefix\"><slot name=\"prefix\"></slot></span>\n <slot part=\"input-wrapper\"></slot>\n <slot part=\"suffix\"><slot name=\"suffix\"></slot></slot>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n const component = this;\n const input = this.querySelector('input');\n const inputType = (input === null || input === void 0 ? void 0 : input.hasAttribute('type')) ? input === null || input === void 0 ? void 0 : input.getAttribute('type') : 'text';\n const prefixIcon = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('[part=\"prefix\"]');\n const suffixIcon = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[part=\"suffix\"]');\n if (this.closest('label'))\n this.classList.add('mb-0');\n const setIcon = (inputType) => {\n // Pre set the icons\n switch (inputType) {\n case \"date\":\n case \"datetime-local\":\n case \"year\":\n case \"month\":\n case \"week\":\n this.setAttribute('data-suffix-icon', 'calendar');\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.setAttribute('role', 'button');\n break;\n case \"time\":\n this.setAttribute('data-suffix-icon', 'clock');\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.setAttribute('role', 'button');\n break;\n default:\n this.removeAttribute('data-suffix-icon');\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.removeAttribute('role');\n break;\n }\n };\n setIcon(inputType);\n const setCurrencyRules = () => {\n input.setAttribute('type', 'text');\n input === null || input === void 0 ? void 0 : input.setAttribute('data-value', input.value);\n input.value = new Intl.NumberFormat(\"en-GB\", {\n style: \"currency\",\n currency: \"GBP\",\n minimumFractionDigits: Number.isInteger(input.value) ? 0 : 2,\n maximumFractionDigits: Number.isInteger(input.value) ? 0 : 2,\n trailingZeroDisplay: 'stripIfInteger' // Strip zeros if it's an integer\n }).format(input.value).replace(\"£\", \"\");\n };\n // Currency type\n if (component === null || component === void 0 ? void 0 : component.hasAttribute('data-currency')) {\n // Pre set the icons\n switch (component === null || component === void 0 ? void 0 : component.hasAttribute('data-currency')) {\n case \"dollar\":\n component.setAttribute('data-prefix-icon', 'dollar-sign');\n break;\n case \"euro\":\n component.setAttribute('data-prefix-icon', 'euro-sign');\n break;\n default:\n component.setAttribute('data-prefix-icon', 'sterling-sign');\n break;\n }\n setCurrencyRules();\n input === null || input === void 0 ? void 0 : input.addEventListener('focus', (event) => {\n input.setAttribute('type', 'number');\n input.value = input.getAttribute('data-value');\n input.setAttribute('value', input.getAttribute('data-value'));\n });\n input === null || input === void 0 ? void 0 : input.addEventListener('input', (event) => {\n input === null || input === void 0 ? void 0 : input.setAttribute('data-value', input.value);\n });\n input === null || input === void 0 ? void 0 : input.addEventListener('blur', (event) => {\n setCurrencyRules();\n });\n }\n // Colour input field\n if (input === null || input === void 0 ? void 0 : input.matches('[type=\"color\"]')) {\n this.insertAdjacentHTML('beforeend', `<output></output>`);\n input.addEventListener('input', () => {\n input.nextElementSibling.value = input.value;\n });\n }\n if (this.hasAttribute('data-prefix-icon')) {\n prefixIcon === null || prefixIcon === void 0 ? void 0 : prefixIcon.className = `prefix fa-${this.hasAttribute('data-prefix-weight') ? this.getAttribute('data-prefix-weight') : 'regular'} fa-${this.getAttribute('data-prefix-icon')}`;\n (_c = this.querySelector('input')) === null || _c === void 0 ? void 0 : _c.classList.add('has-prefix');\n }\n if (this.hasAttribute('data-suffix-icon')) {\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.className = `suffix fa-${this.hasAttribute('data-suffix-weight') ? this.getAttribute('data-suffix-weight') : 'regular'} fa-${this.getAttribute('data-suffix-icon')}`;\n (_d = this.querySelector('input')) === null || _d === void 0 ? void 0 : _d.classList.add('has-suffix');\n }\n if ((_e = this.shadowRoot.querySelector('[name=\"prefix\"]')) === null || _e === void 0 ? void 0 : _e.assignedElements().length) {\n (_f = this.shadowRoot.querySelector('[name=\"prefix\"]')) === null || _f === void 0 ? void 0 : _f.classList.add('prefix');\n (_g = this.querySelector('input')) === null || _g === void 0 ? void 0 : _g.classList.add('has-prefix');\n }\n if ((_h = this.shadowRoot.querySelector('[name=\"suffix\"]')) === null || _h === void 0 ? void 0 : _h.assignedElements().length) {\n (_j = this.shadowRoot.querySelector('[name=\"suffix\"]')) === null || _j === void 0 ? void 0 : _j.classList.add('suffix');\n (_k = this.querySelector('input')) === null || _k === void 0 ? void 0 : _k.classList.add('has-suffix');\n }\n // Change type\n if (this.querySelector('[data-change-type]')) {\n const select = this.querySelector('[data-change-type]');\n select.addEventListener('change', () => {\n input.setAttribute('type', select.value);\n setIcon(select.value);\n if (this.getAttribute('data-suffix-icon')) {\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.className = `suffix fa-${this.hasAttribute('data-suffix-weight') ? this.getAttribute('data-suffix-weight') : 'regular'} fa-${this.getAttribute('data-suffix-icon')}`;\n input === null || input === void 0 ? void 0 : input.classList.add('has-suffix');\n }\n else {\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.removeAttribute('class');\n input === null || input === void 0 ? void 0 : input.classList.remove('has-suffix');\n }\n });\n }\n // #region Date restrictions\n const today = new Date();\n function formatDate(date, type = \"date\") {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n if (type == \"datetime-local\")\n return `${year}-${month}-${day}T00:00:00`;\n return `${year}-${month}-${day}`;\n }\n const checkDayAllowed = (input, allowedDays) => {\n const day = new Date(input.value).getUTCDay();\n if (allowedDays.includes(day))\n input.setCustomValidity('');\n else\n input.setCustomValidity('That day of the week is not allowed');\n };\n if ((input === null || input === void 0 ? void 0 : input.matches('[type=\"date\"], [type=\"datetime-local\"]')) && this.hasAttribute('data-allowed-days')) {\n const allowedDays = JSON.parse(`[${this.getAttribute('data-allowed-days')}]`);\n checkDayAllowed(input, allowedDays);\n input.addEventListener('input', () => { checkDayAllowed(input, allowedDays); });\n }\n // #endregion\n suffixIcon.addEventListener('click', function () {\n if (!(component === null || component === void 0 ? void 0 : component.querySelector('select[data-change-type][slot=\"suffix\"]')))\n input.showPicker();\n });\n prefixIcon.addEventListener('click', function () {\n if (!(component === null || component === void 0 ? void 0 : component.querySelector('select[data-change-type][slot=\"prefix\"]')))\n input.showPicker();\n });\n // Duplicate input watches\n if (component.hasAttribute('data-duplicate')) {\n const id = component.getAttribute('data-duplicate');\n const watchedInputs = document.querySelectorAll(`[name=\"${id}\"], [id=\"${id}\"]`);\n input.addEventListener('change', (event) => {\n var _a;\n if (input.closest('iam-modal'))\n return false;\n if ((input === null || input === void 0 ? void 0 : input.matches('[type=\"checkbox\"]')) && (watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.matches('[type=\"checkbox\"]'))) {\n watchedInput.checked = event.target.checked;\n if (!event.detail && !((_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggered)) {\n const changeEvent = new CustomEvent('change', { detail: { triggered: true } });\n watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.dispatchEvent(changeEvent);\n }\n }\n });\n Array.from(watchedInputs).forEach((watchedInput) => {\n watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.addEventListener('change', (event) => {\n var _a, _b;\n // If both the duplicate input and the watched input are checkboxes\n if ((input === null || input === void 0 ? void 0 : input.matches('[type=\"checkbox\"]')) && (watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.matches('[type=\"checkbox\"]'))) {\n input.checked = event.target.checked;\n if (!event.detail && !((_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggered)) {\n const changeEvent = new CustomEvent('change', { detail: { triggered: true } });\n input === null || input === void 0 ? void 0 : input.dispatchEvent(changeEvent);\n }\n }\n // if input is not a checkbox BUT the watched input is\n // Then we need to create the input's value\n if (!(input === null || input === void 0 ? void 0 : input.matches('[type=\"checkbox\"]')) && (watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.matches('[type=\"checkbox\"]'))) {\n let computedValue = '';\n Array.from(document.querySelectorAll(`[name=\"${id}\"]:checked`)).forEach((loopInput) => {\n computedValue += (computedValue == '' ? '' : ',') + loopInput.value;\n });\n input.value = computedValue;\n if (!event.detail && !((_b = event.detail) === null || _b === void 0 ? void 0 : _b.triggered)) {\n const changeEvent = new CustomEvent('change', { detail: { triggered: true } });\n input === null || input === void 0 ? void 0 : input.dispatchEvent(changeEvent);\n }\n }\n });\n });\n }\n }\n}\nexport default iamInput;\n"],"names":["trackComponentRegistered","componentName","iamInput","template","_a","_b","_c","_d","_e","_f","_g","_h","_j","_k","component","input","inputType","prefixIcon","suffixIcon","setIcon","setCurrencyRules","event","select","checkDayAllowed","allowedDays","day","id","watchedInputs","change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,MAAMwB,EAAc,IAAI,YAAY,SAAU,CAAE,OAAQ,CAAE,UAAW,EAAI,EAAI,EAC7E,cAAiB,MAA2C,aAAa,cAAcA,CAAW,CACtG,CAER,CAAC,EACD,MAAM,KAAKD,CAAa,EAAE,QAASE,GAAiB,CACYA,GAAa,iBAAiB,SAAWR,GAAU,CAC3G,IAAIjB,EAAIC,EAER,GAAmDU,GAAM,QAAQ,mBAAmB,GAAmEc,GAAa,QAAQ,mBAAmB,IAC3Ld,EAAM,QAAUM,EAAM,OAAO,QACzB,CAACA,EAAM,QAAU,EAAG,GAAAjB,EAAKiB,EAAM,UAAY,MAAQjB,IAAO,SAAkBA,EAAG,YAAY,CAC3F,MAAMwB,EAAc,IAAI,YAAY,SAAU,CAAE,OAAQ,CAAE,UAAW,EAAI,EAAI,EAC/Bb,GAAM,cAAca,CAAW,CACjF,CAIJ,GAAI,CAAgDb,GAAM,QAAQ,mBAAmB,GAAmEc,GAAa,QAAQ,mBAAmB,EAAI,CAChM,IAAIC,EAAgB,GAKpB,GAJA,MAAM,KAAK,SAAS,iBAAiB,UAAUJ,CAAE,YAAY,CAAC,EAAE,QAASK,GAAc,CACnFD,IAAkBA,GAAiB,GAAK,GAAK,KAAOC,EAAU,KAClE,CAAC,EACDhB,EAAM,MAAQe,EACV,CAACT,EAAM,QAAU,EAAG,GAAAhB,EAAKgB,EAAM,UAAY,MAAQhB,IAAO,SAAkBA,EAAG,WAAY,CAC3F,MAAMuB,EAAc,IAAI,YAAY,SAAU,CAAE,OAAQ,CAAE,UAAW,EAAI,EAAI,EAC/Bb,GAAM,cAAca,CAAW,CACjF,CACJ,CACJ,CAAC,CACL,CAAC,CACL,CACJ,CACJ"}
1
+ {"version":3,"file":"input.component.min.js","sources":["../_global.js","input.component.js"],"sourcesContent":["export const trackComponentRegistered = (componentName) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementRegistered',\n element: componentName,\n });\n};\nexport const trackComponent = (component, componentName, trackEvents) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementAdded',\n element: componentName,\n });\n trackEvents.forEach((eventName) => {\n component.addEventListener(eventName, function (event) {\n const eventDetails = {\n event: eventName,\n element: componentName,\n target: event.target,\n };\n Object.keys(event.detail).forEach((eventKey) => {\n const eventDetail = event.detail[eventKey];\n eventDetails[eventKey] = eventDetail;\n });\n window.dataLayer.push(eventDetails);\n });\n });\n return true;\n};\n","import { trackComponentRegistered } from '../_global.js';\ntrackComponentRegistered('iam-iamPrefix');\nclass iamInput extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location')\n ? document.body.getAttribute('data-assets-location')\n : '/assets';\n const loadCSS = `@import \"${assetLocation}/css/components/input.component.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n ${loadCSS}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\">\n <div class=\"wrapper\" part=\"wrapper\">\n <span part=\"prefix\"><slot name=\"prefix\"></slot></span>\n <slot part=\"input-wrapper\"></slot>\n <slot part=\"suffix\"><slot name=\"suffix\"></slot></slot>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n const component = this;\n const input = this.querySelector('input');\n const inputType = (input === null || input === void 0 ? void 0 : input.hasAttribute('type')) ? input === null || input === void 0 ? void 0 : input.getAttribute('type') : 'text';\n const prefixIcon = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('[part=\"prefix\"]');\n const suffixIcon = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[part=\"suffix\"]');\n if (this.closest('label'))\n this.classList.add('mb-0');\n const setIcon = (inputType) => {\n // Pre set the icons\n switch (inputType) {\n case \"date\":\n case \"datetime-local\":\n case \"year\":\n case \"month\":\n case \"week\":\n this.setAttribute('data-suffix-icon', 'calendar');\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.setAttribute('role', 'button');\n break;\n case \"time\":\n this.setAttribute('data-suffix-icon', 'clock');\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.setAttribute('role', 'button');\n break;\n default:\n this.removeAttribute('data-suffix-icon');\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.removeAttribute('role');\n break;\n }\n };\n setIcon(inputType);\n const setCurrencyRules = () => {\n let originalValue = input.value.replace(',', '');\n input === null || input === void 0 ? void 0 : input.setAttribute('data-value', originalValue);\n input.setAttribute('type', 'text');\n originalValue = new Intl.NumberFormat(\"en-GB\", {\n style: \"currency\",\n currency: \"GBP\",\n minimumFractionDigits: Number.isInteger(originalValue) ? 0 : 2,\n maximumFractionDigits: Number.isInteger(originalValue) ? 0 : 2,\n trailingZeroDisplay: 'stripIfInteger' // Strip zeros if it's an integer\n }).format(originalValue).replace(\"£\", \"\");\n input.value = originalValue;\n };\n // Currency type\n if (component === null || component === void 0 ? void 0 : component.hasAttribute('data-currency')) {\n // Pre set the icons\n switch (component === null || component === void 0 ? void 0 : component.hasAttribute('data-currency')) {\n case \"dollar\":\n component.setAttribute('data-prefix-icon', 'dollar-sign');\n break;\n case \"euro\":\n component.setAttribute('data-prefix-icon', 'euro-sign');\n break;\n default:\n component.setAttribute('data-prefix-icon', 'sterling-sign');\n break;\n }\n setCurrencyRules();\n input === null || input === void 0 ? void 0 : input.addEventListener('focus', (event) => {\n input.setAttribute('type', 'number');\n input.value = input.getAttribute('data-value');\n input.setAttribute('value', input.getAttribute('data-value'));\n });\n input === null || input === void 0 ? void 0 : input.addEventListener('input', (event) => {\n input === null || input === void 0 ? void 0 : input.setAttribute('data-value', input.value);\n });\n input === null || input === void 0 ? void 0 : input.addEventListener('blur', (event) => {\n setCurrencyRules();\n });\n }\n // Colour input field\n if (input === null || input === void 0 ? void 0 : input.matches('[type=\"color\"]')) {\n this.insertAdjacentHTML('beforeend', `<output></output>`);\n input.addEventListener('input', () => {\n input.nextElementSibling.value = input.value;\n });\n }\n if (this.hasAttribute('data-prefix-icon')) {\n prefixIcon === null || prefixIcon === void 0 ? void 0 : prefixIcon.className = `prefix fa-${this.hasAttribute('data-prefix-weight') ? this.getAttribute('data-prefix-weight') : 'regular'} fa-${this.getAttribute('data-prefix-icon')}`;\n (_c = this.querySelector('input')) === null || _c === void 0 ? void 0 : _c.classList.add('has-prefix');\n }\n if (this.hasAttribute('data-suffix-icon')) {\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.className = `suffix fa-${this.hasAttribute('data-suffix-weight') ? this.getAttribute('data-suffix-weight') : 'regular'} fa-${this.getAttribute('data-suffix-icon')}`;\n (_d = this.querySelector('input')) === null || _d === void 0 ? void 0 : _d.classList.add('has-suffix');\n }\n if ((_e = this.shadowRoot.querySelector('[name=\"prefix\"]')) === null || _e === void 0 ? void 0 : _e.assignedElements().length) {\n (_f = this.shadowRoot.querySelector('[name=\"prefix\"]')) === null || _f === void 0 ? void 0 : _f.classList.add('prefix');\n (_g = this.querySelector('input')) === null || _g === void 0 ? void 0 : _g.classList.add('has-prefix');\n }\n if ((_h = this.shadowRoot.querySelector('[name=\"suffix\"]')) === null || _h === void 0 ? void 0 : _h.assignedElements().length) {\n (_j = this.shadowRoot.querySelector('[name=\"suffix\"]')) === null || _j === void 0 ? void 0 : _j.classList.add('suffix');\n (_k = this.querySelector('input')) === null || _k === void 0 ? void 0 : _k.classList.add('has-suffix');\n }\n // Change type\n if (this.querySelector('[data-change-type]')) {\n const select = this.querySelector('[data-change-type]');\n select.addEventListener('change', () => {\n input.setAttribute('type', select.value);\n setIcon(select.value);\n if (this.getAttribute('data-suffix-icon')) {\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.className = `suffix fa-${this.hasAttribute('data-suffix-weight') ? this.getAttribute('data-suffix-weight') : 'regular'} fa-${this.getAttribute('data-suffix-icon')}`;\n input === null || input === void 0 ? void 0 : input.classList.add('has-suffix');\n }\n else {\n suffixIcon === null || suffixIcon === void 0 ? void 0 : suffixIcon.removeAttribute('class');\n input === null || input === void 0 ? void 0 : input.classList.remove('has-suffix');\n }\n });\n }\n // #region Date restrictions\n const today = new Date();\n function formatDate(date, type = \"date\") {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n if (type == \"datetime-local\")\n return `${year}-${month}-${day}T00:00:00`;\n return `${year}-${month}-${day}`;\n }\n const checkDayAllowed = (input, allowedDays) => {\n const day = new Date(input.value).getUTCDay();\n if (allowedDays.includes(day))\n input.setCustomValidity('');\n else\n input.setCustomValidity('That day of the week is not allowed');\n };\n if ((input === null || input === void 0 ? void 0 : input.matches('[type=\"date\"], [type=\"datetime-local\"]')) && this.hasAttribute('data-allowed-days')) {\n const allowedDays = JSON.parse(`[${this.getAttribute('data-allowed-days')}]`);\n checkDayAllowed(input, allowedDays);\n input.addEventListener('input', () => { checkDayAllowed(input, allowedDays); });\n }\n // #endregion\n suffixIcon.addEventListener('click', function () {\n if (!(component === null || component === void 0 ? void 0 : component.querySelector('select[data-change-type][slot=\"suffix\"]')))\n input.showPicker();\n });\n prefixIcon.addEventListener('click', function () {\n if (!(component === null || component === void 0 ? void 0 : component.querySelector('select[data-change-type][slot=\"prefix\"]')))\n input.showPicker();\n });\n // Duplicate input watches\n if (component.hasAttribute('data-duplicate')) {\n const id = component.getAttribute('data-duplicate');\n const watchedInputs = document.querySelectorAll(`[name=\"${id}\"], [id=\"${id}\"]`);\n input.addEventListener('change', (event) => {\n var _a;\n if (input.closest('iam-modal'))\n return false;\n if ((input === null || input === void 0 ? void 0 : input.matches('[type=\"checkbox\"]')) && (watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.matches('[type=\"checkbox\"]'))) {\n watchedInput.checked = event.target.checked;\n if (!event.detail && !((_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggered)) {\n const changeEvent = new CustomEvent('change', { detail: { triggered: true } });\n watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.dispatchEvent(changeEvent);\n }\n }\n });\n Array.from(watchedInputs).forEach((watchedInput) => {\n watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.addEventListener('change', (event) => {\n var _a, _b;\n // If both the duplicate input and the watched input are checkboxes\n if ((input === null || input === void 0 ? void 0 : input.matches('[type=\"checkbox\"]')) && (watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.matches('[type=\"checkbox\"]'))) {\n input.checked = event.target.checked;\n if (!event.detail && !((_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggered)) {\n const changeEvent = new CustomEvent('change', { detail: { triggered: true } });\n input === null || input === void 0 ? void 0 : input.dispatchEvent(changeEvent);\n }\n }\n // if input is not a checkbox BUT the watched input is\n // Then we need to create the input's value\n if (!(input === null || input === void 0 ? void 0 : input.matches('[type=\"checkbox\"]')) && (watchedInput === null || watchedInput === void 0 ? void 0 : watchedInput.matches('[type=\"checkbox\"]'))) {\n let computedValue = '';\n Array.from(document.querySelectorAll(`[name=\"${id}\"]:checked`)).forEach((loopInput) => {\n computedValue += (computedValue == '' ? '' : ',') + loopInput.value;\n });\n input.value = computedValue;\n if (!event.detail && !((_b = event.detail) === null || _b === void 0 ? void 0 : _b.triggered)) {\n const changeEvent = new CustomEvent('change', { detail: { triggered: true } });\n input === null || input === void 0 ? void 0 : input.dispatchEvent(changeEvent);\n }\n }\n });\n });\n }\n }\n}\nexport default iamInput;\n"],"names":["trackComponentRegistered","componentName","iamInput","template","_a","_b","_c","_d","_e","_f","_g","_h","_j","_k","component","input","inputType","prefixIcon","suffixIcon","setIcon","setCurrencyRules","originalValue","event","select","checkDayAllowed","allowedDays","day","id","watchedInputs","changeEvent","watchedInput","computedValue","loopInput"],"mappings":";;;IAAO,MAAMA,EAA4BC,GAAkB,CAEvD,OAAO,UAAY,OAAO,WAAa,CAAA,EACvC,OAAO,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AC7E,cAAiB,MAA2C,aAAa,cAAcA,CAAW,CACtG,CAER,CAAC,EACD,MAAM,KAAKD,CAAa,EAAE,QAASE,GAAiB,CACYA,GAAa,iBAAiB,SAAWR,GAAU,CAC3G,IAAIlB,EAAIC,EAER,GAAmDU,GAAM,QAAQ,mBAAmB,GAAmEe,GAAa,QAAQ,mBAAmB,IAC3Lf,EAAM,QAAUO,EAAM,OAAO,QACzB,CAACA,EAAM,QAAU,EAAG,GAAAlB,EAAKkB,EAAM,UAAY,MAAQlB,IAAO,SAAkBA,EAAG,YAAY,CAC3F,MAAMyB,EAAc,IAAI,YAAY,SAAU,CAAE,OAAQ,CAAE,UAAW,EAAI,EAAI,EAC/Bd,GAAM,cAAcc,CAAW,CACjF,CAIJ,GAAI,CAAgDd,GAAM,QAAQ,mBAAmB,GAAmEe,GAAa,QAAQ,mBAAmB,EAAI,CAChM,IAAIC,EAAgB,GAKpB,GAJA,MAAM,KAAK,SAAS,iBAAiB,UAAUJ,CAAE,YAAY,CAAC,EAAE,QAASK,GAAc,CACnFD,IAAkBA,GAAiB,GAAK,GAAK,KAAOC,EAAU,KAClE,CAAC,EACDjB,EAAM,MAAQgB,EACV,CAACT,EAAM,QAAU,EAAG,GAAAjB,EAAKiB,EAAM,UAAY,MAAQjB,IAAO,SAAkBA,EAAG,WAAY,CAC3F,MAAMwB,EAAc,IAAI,YAAY,SAAU,CAAE,OAAQ,CAAE,UAAW,EAAI,EAAI,EAC/Bd,GAAM,cAAcc,CAAW,CACjF,CACJ,CACJ,CAAC,CACL,CAAC,CACL,CACJ,CACJ"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */const o=s=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:s})};o("iam-iamPrefix");class i extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const e=document.createElement("template");e.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Marketing"});class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const t=document.createElement("template");t.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */class u extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const n=document.createElement("template");n.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */const l=t=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:t})},m=(t,n,a)=>(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementAdded",element:n}),a.forEach(e=>{t.addEventListener(e,function(s){const d={event:e,element:n,target:s.target};Object.keys(s.detail).forEach(o=>{const i=s.detail[o];d[o]=i}),window.dataLayer.push(d)})}),!0),p=function(t){const n=t.dataset.status;if(!n)return;const a=t.shadowRoot.querySelector(".milestone-wrap"),e=document.createElement("span");e.setAttribute("part","status"),e.classList.add("milestone-status"),e.innerHTML=`${n} Step`,n==="Current"&&t.classList.add("current"),a.insertAdjacentElement("afterbegin",e)},u=function(t){const n=t.shadowRoot.querySelector(".task-wrap"),a=t.dataset.items?JSON.parse(t.dataset.items):[];a.length&&(a.forEach(e=>{const s=document.createElement("details"),d=document.createElement("summary"),o=document.createElement("div"),i=document.createElement("p");o.classList.add("task-details"),d.innerHTML=e.name,e.date_completed&&d.classList.add("complete"),s.appendChild(d),e.description&&(i.innerHTML=e.description,o.appendChild(i)),e.actions.length&&o.appendChild(h(e.actions,d)),s.appendChild(o),n.insertAdjacentElement("beforeend",s),s.addEventListener("click",()=>{s?.hasAttribute("open")?r("milestone-item-closed",e.name,t):r("milestone-item-opened",e.name,t)})}),t.appendChild(n))},r=function(t,n,a){const e=new CustomEvent(t,{detail:{title:n}});a.dispatchEvent(e)},h=function(t,n){const a=document.createElement("ul"),e=t.length,d=t.filter(o=>o.date_completed).length||0;if(!(e<1))return n.innerHTML+=` (${d}/${e})`,t.forEach(o=>{const i=document.createElement("li"),c=document.createElement("span");o.date_completed&&(i.classList.add("complete"),c.classList.add("action-date"),c.innerHTML=o.date_completed),i.innerHTML=o.action,i.appendChild(c),a.appendChild(i)}),a},w=function(t){p(t),u(t)};l("iam-milestone");class L extends HTMLElement{constructor(){var n;super(),this.attachShadow({mode:"open"});const a=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"):`${a}/css/core.min.css`,s=document.createElement("template");s.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */const r=t=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:t})},l=(t,s,e)=>(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementAdded",element:s}),e.forEach(n=>{t.addEventListener(n,function(o){const a={event:n,element:s,target:o.target};Object.keys(o.detail).forEach(i=>{const d=o.detail[i];a[i]=d}),window.dataLayer.push(a)})}),!0),u=function(t){if(!t.dataset.showAllToggle)return;const e=document.createElement("button");e.innerHTML="Show next steps",e.classList.add("btn","btn-tertiary","show-all-toggle"),t.appendChild(e),e.addEventListener("click",()=>{t.classList.contains("show-all")?(e.innerHTML="Show next steps",t.classList.remove("show-all"),c("hide-future-items",t)):(e.innerHTML="Hide next steps",t.classList.add("show-all"),c("show-future-items",t))})},c=function(t,s){const e=new CustomEvent(t,{});s.dispatchEvent(e)},h=function(t){u(t)};r("iam-milestone-group");class m extends HTMLElement{constructor(){var s;super();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`,o=document.createElement("template");o.innerHTML=`
5
5
  <style>
@@ -36,7 +36,7 @@ class iamModal extends HTMLElement {
36
36
  var _a, _b, _c, _d, _e, _f;
37
37
  const originalDialog = this.querySelector('dialog');
38
38
  const id = this.hasAttribute('id') ? this.getAttribute('id') : originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.getAttribute('id');
39
- const dialog = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');
39
+ let dialog = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');
40
40
  const closeButton = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[data-close]');
41
41
  const cancelButton = (_c = this.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('[data-cancel]');
42
42
  const agreedButton = this.querySelector('button[slot="agreed-button"]') ? this.querySelector('button[slot="agreed-button"]') : (_d = this.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector('[data-agreed]');
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */const w=d=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:d})},y=(d,a)=>{var i;const e=(i=a.shadowRoot)===null||i===void 0?void 0:i.querySelector("dialog");e?.showModal(),e?.focus();const c=new CustomEvent("modal-opened",{bubbles:!0,cancelable:!0,detail:{modalId:d}});a.dispatchEvent(c),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:d})},r=(d,a)=>{var i;const e=(i=a.shadowRoot)===null||i===void 0?void 0:i.querySelector("dialog");e?.close();const c=new CustomEvent("modal-closed",{bubbles:!0,cancelable:!0,detail:{modalId:d}});a.dispatchEvent(c),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:d})},k='<button class="btn btn-compact btn-secondary fa-xmark-large" data-close>Close</button>';w("iam-card");class x extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const a=document.createElement("template");a.innerHTML=`
5
5
  <style>
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  </div>
23
23
  </dialog>
24
- `,this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var a,i,e,c,m,b;const o=this.querySelector("dialog"),n=this.hasAttribute("id")?this.getAttribute("id"):o?.getAttribute("id"),l=(a=this.shadowRoot)===null||a===void 0?void 0:a.querySelector("dialog"),p=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelector("[data-close]"),g=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("[data-cancel]"),h=this.querySelector('button[slot="agreed-button"]')?this.querySelector('button[slot="agreed-button"]'):(c=this.shadowRoot)===null||c===void 0?void 0:c.querySelector("[data-agreed]"),v=this.hasAttribute("data-type")?this.getAttribute("data-type"):"passive",u=()=>{const t=new CustomEvent("agreed",{detail:{modalId:n}});this.dispatchEvent(t),r(n,this)};document.addEventListener("click",t=>{(t.target.matches(`[command="show-modal"][commandfor="${n}"]`)||t.target.matches(`[data-modal="${n}"]`))&&y(n,this)}),document.addEventListener("click",t=>{t.target.matches(`[command="close"][commandfor="${n}"]`)&&r(n,this)}),o?.addEventListener("command",t=>{event.command=="show-modal"&&t.preventDefault()}),o?.addEventListener("command",t=>{t.preventDefault(),event.command=="close"&&r(n,this)}),o?.addEventListener("close",t=>{t.preventDefault(),r(n,this)}),o&&Array.from(o?.querySelectorAll("[slot]")).forEach(t=>{this.moveBefore(t,o)}),p?.addEventListener("click",()=>{r(n,this)}),g?.addEventListener("click",()=>{r(n,this)}),h?.addEventListener("click",()=>{u()}),this.addEventListener("close-modal",()=>{r(n,this)}),o?.addEventListener("submit",t=>{t.submitter&&t.submitter.hasAttribute("formmethod")&&t.submitter.getAttribute("formmethod")=="dialog"?r(n,this):u()}),Array.from(this.querySelectorAll('button[type="submit"]')).forEach(t=>{t.addEventListener("click",f=>{!t.closest("form")&&!t.hasAttribute("formmethod")&&u()})}),this.addEventListener("click",t=>{if(window.getComputedStyle(l).display==="contents"&&(l=l.parentNode.closest("dialog[open]")),v!="transactional"&&v!="acknowledgement"){const s=l.getBoundingClientRect();(t.clientX<s.left||t.clientX>s.right||t.clientY<s.top||t.clientY>s.bottom)&&(t.target.closest("dialog *")||r(n,this))}}),v=="transactional"&&((b=(m=this.shadowRoot)===null||m===void 0?void 0:m.querySelector(".scroll"))===null||b===void 0||b.insertAdjacentHTML("afterbegin",`<i class="fa-light fa-circle" aria-hidden="true">
24
+ `,this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var a,i,e,c,m,b;const o=this.querySelector("dialog"),n=this.hasAttribute("id")?this.getAttribute("id"):o?.getAttribute("id");let l=(a=this.shadowRoot)===null||a===void 0?void 0:a.querySelector("dialog");const p=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelector("[data-close]"),g=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("[data-cancel]"),h=this.querySelector('button[slot="agreed-button"]')?this.querySelector('button[slot="agreed-button"]'):(c=this.shadowRoot)===null||c===void 0?void 0:c.querySelector("[data-agreed]"),v=this.hasAttribute("data-type")?this.getAttribute("data-type"):"passive",u=()=>{const t=new CustomEvent("agreed",{detail:{modalId:n}});this.dispatchEvent(t),r(n,this)};document.addEventListener("click",t=>{(t.target.matches(`[command="show-modal"][commandfor="${n}"]`)||t.target.matches(`[data-modal="${n}"]`))&&y(n,this)}),document.addEventListener("click",t=>{t.target.matches(`[command="close"][commandfor="${n}"]`)&&r(n,this)}),o?.addEventListener("command",t=>{event.command=="show-modal"&&t.preventDefault()}),o?.addEventListener("command",t=>{t.preventDefault(),event.command=="close"&&r(n,this)}),o?.addEventListener("close",t=>{t.preventDefault(),r(n,this)}),o&&Array.from(o?.querySelectorAll("[slot]")).forEach(t=>{this.moveBefore(t,o)}),p?.addEventListener("click",()=>{r(n,this)}),g?.addEventListener("click",()=>{r(n,this)}),h?.addEventListener("click",()=>{u()}),this.addEventListener("close-modal",()=>{r(n,this)}),o?.addEventListener("submit",t=>{t.submitter&&t.submitter.hasAttribute("formmethod")&&t.submitter.getAttribute("formmethod")=="dialog"?r(n,this):u()}),Array.from(this.querySelectorAll('button[type="submit"]')).forEach(t=>{t.addEventListener("click",f=>{!t.closest("form")&&!t.hasAttribute("formmethod")&&u()})}),this.addEventListener("click",t=>{if(window.getComputedStyle(l).display==="contents"&&(l=l.parentNode.closest("dialog[open]")),v!="transactional"&&v!="acknowledgement"){const s=l.getBoundingClientRect();(t.clientX<s.left||t.clientX>s.right||t.clientY<s.top||t.clientY>s.bottom)&&(t.target.closest("dialog *")||r(n,this))}}),v=="transactional"&&((b=(m=this.shadowRoot)===null||m===void 0?void 0:m.querySelector(".scroll"))===null||b===void 0||b.insertAdjacentHTML("afterbegin",`<i class="fa-light fa-circle" aria-hidden="true">
25
25
  <i class="fa-regular fa-${this.hasAttribute("data-icon")?this.getAttribute("data-icon"):"info"}" aria-hidden="true"></i>
26
26
  </i>`))}}export{x as default};
27
27
  //# sourceMappingURL=modal.component.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal.component.min.js","sources":["../_global.js","../../modules/modal.js","modal.component.js"],"sourcesContent":["export const trackComponentRegistered = (componentName) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementRegistered',\n element: componentName,\n });\n};\nexport const trackComponent = (component, componentName, trackEvents) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementAdded',\n element: componentName,\n });\n trackEvents.forEach((eventName) => {\n component.addEventListener(eventName, function (event) {\n const eventDetails = {\n event: eventName,\n element: componentName,\n target: event.target,\n };\n Object.keys(event.detail).forEach((eventKey) => {\n const eventDetail = event.detail[eventKey];\n eventDetails[eventKey] = eventDetail;\n });\n window.dataLayer.push(eventDetails);\n });\n });\n return true;\n};\n","export const openModal = (id, modal) => {\n var _a;\n const dialog = (_a = modal.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');\n dialog === null || dialog === void 0 ? void 0 : dialog.showModal();\n dialog === null || dialog === void 0 ? void 0 : dialog.focus();\n const closeEvent = new CustomEvent('modal-opened', {\n bubbles: true,\n cancelable: true,\n detail: { modalId: id },\n });\n modal.dispatchEvent(closeEvent);\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'openModal',\n id: id,\n });\n};\nexport const closeModal = (id, modal) => {\n var _a;\n const dialog = (_a = modal.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');\n dialog === null || dialog === void 0 ? void 0 : dialog.close();\n const closeEvent = new CustomEvent('modal-closed', {\n bubbles: true,\n cancelable: true,\n detail: { modalId: id },\n });\n modal.dispatchEvent(closeEvent);\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'closeModal',\n id: id,\n });\n};\nexport const closeButtonHtml = `<button class=\"btn btn-compact btn-secondary fa-xmark-large\" data-close>Close</button>`;\n","import { trackComponentRegistered } from '../_global.js';\nimport { openModal, closeModal, closeButtonHtml } from '../../modules/modal.js';\ntrackComponentRegistered('iam-card');\nclass iamModal extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location')\n ? document.body.getAttribute('data-assets-location')\n : '/assets';\n const loadCSS = `@import \"${assetLocation}/css/components/modal.component.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n \n ${loadCSS}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\" />\n <dialog>\n ${closeButtonHtml}\n <div class=\"scroll\">\n <slot></slot>\n <div class=\"btn__group\">\n <button class=\"btn btn-secondary\" data-cancel>${this.hasAttribute('data-cancel-text') ? this.getAttribute('data-cancel-text') : 'Cancel'}</button>\n <slot name=\"agreed-button\">\n <button class=\"btn btn-primary\" data-agreed>${this.hasAttribute('data-agreed-text') ? this.getAttribute('data-agreed-text') : 'Submit'}</button>\n </slot>\n </div>\n </div>\n </dialog>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n var _a, _b, _c, _d, _e, _f;\n const originalDialog = this.querySelector('dialog');\n const id = this.hasAttribute('id') ? this.getAttribute('id') : originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.getAttribute('id');\n const dialog = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');\n const closeButton = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[data-close]');\n const cancelButton = (_c = this.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('[data-cancel]');\n const agreedButton = this.querySelector('button[slot=\"agreed-button\"]') ? this.querySelector('button[slot=\"agreed-button\"]') : (_d = this.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector('[data-agreed]');\n const modalType = this.hasAttribute('data-type') ? this.getAttribute('data-type') : 'passive';\n const agreed = () => {\n const agreedEvent = new CustomEvent('agreed', {\n detail: { modalId: id },\n });\n this.dispatchEvent(agreedEvent);\n closeModal(id, this);\n };\n document.addEventListener('click', (e) => {\n if (e.target.matches(`[command=\"show-modal\"][commandfor=\"${id}\"]`) || e.target.matches(`[data-modal=\"${id}\"]`)) {\n openModal(id, this);\n }\n });\n document.addEventListener('click', (e) => {\n if (e.target.matches(`[command=\"close\"][commandfor=\"${id}\"]`)) {\n closeModal(id, this);\n }\n });\n // Disable the original event \n originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.addEventListener('command', (e) => {\n if (event.command == \"show-modal\") {\n e.preventDefault();\n }\n });\n originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.addEventListener('command', (e) => {\n e.preventDefault();\n if (event.command == \"close\") {\n closeModal(id, this);\n }\n });\n originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.addEventListener('close', (e) => {\n e.preventDefault();\n closeModal(id, this);\n });\n // Move the submit button so that the slot functionality works\n if (originalDialog) {\n Array.from(originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.querySelectorAll('[slot]')).forEach((element) => {\n this.moveBefore(element, originalDialog);\n });\n }\n closeButton === null || closeButton === void 0 ? void 0 : closeButton.addEventListener('click', () => {\n closeModal(id, this);\n });\n cancelButton === null || cancelButton === void 0 ? void 0 : cancelButton.addEventListener('click', () => {\n closeModal(id, this);\n });\n agreedButton === null || agreedButton === void 0 ? void 0 : agreedButton.addEventListener('click', () => {\n agreed();\n });\n this.addEventListener('close-modal', () => {\n closeModal(id, this);\n });\n // Hijack the default form submission \n originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.addEventListener('submit', (e) => {\n if (e.submitter && e.submitter.hasAttribute('formmethod') && e.submitter.getAttribute('formmethod') == \"dialog\") {\n closeModal(id, this);\n }\n else {\n agreed();\n }\n });\n Array.from(this.querySelectorAll('button[type=\"submit\"]')).forEach((button) => {\n button.addEventListener('click', (e) => {\n if (!button.closest('form') && !button.hasAttribute('formmethod')) {\n agreed();\n }\n });\n });\n // Add click event on backdrop\n this.addEventListener('click', (event) => {\n // Small fix to make sure the dialog isn't a dialog inside of a dialog.\n const style = window.getComputedStyle(dialog);\n if (style.display === 'contents')\n dialog = dialog.parentNode.closest('dialog[open]');\n // Dont allow the backdrop to be clicked when transactional\n if (modalType != 'transactional' && modalType != 'acknowledgement') {\n const dialogDimensions = dialog.getBoundingClientRect();\n if (event.clientX < dialogDimensions.left ||\n event.clientX > dialogDimensions.right ||\n event.clientY < dialogDimensions.top ||\n event.clientY > dialogDimensions.bottom) {\n if (!event.target.closest('dialog *'))\n closeModal(id, this); // Weird bug when interacting with radio input fields within dialogs cuases it to close\n }\n }\n });\n if (modalType == 'transactional') {\n (_f = (_e = this.shadowRoot) === null || _e === void 0 ? void 0 : _e.querySelector('.scroll')) === null || _f === void 0 ? void 0 : _f.insertAdjacentHTML('afterbegin', `<i class=\"fa-light fa-circle\" aria-hidden=\"true\">\n <i class=\"fa-regular fa-${this.hasAttribute('data-icon') ? this.getAttribute('data-icon') : 'info'}\" aria-hidden=\"true\"></i>\n </i>`);\n }\n }\n}\nexport default iamModal;\n"],"names":["trackComponentRegistered","componentName","openModal","id","modal","_a","dialog","closeEvent","closeModal","closeButtonHtml","iamModal","template","_b","_c","_d","_e","_f","originalDialog","closeButton","cancelButton","agreedButton","modalType","agreed","agreedEvent","e","element","button","event","dialogDimensions"],"mappings":";;;IAAO,MAAMA,EAA4BC,GAAkB,CAEvD,OAAO,UAAY,OAAO,WAAa,CAAA,EACvC,OAAO,UAAU,KAAK,CAClB,MAAO,0BACP,QAASA,CACjB,CAAK,CACL,ECPaC,EAAY,CAACC,EAAIC,IAAU,CACpC,IAAIC,EACJ,MAAMC,GAAUD,EAAKD,EAAM,cAAgB,MAAQC,IAAO,OAAS,OAASA,EAAG,cAAc,QAAQ,EACrDC,GAAO,UAAS,EAChBA,GAAO,MAAK,EAC5D,MAAMC,EAAa,IAAI,YAAY,eAAgB,CAC/C,QAAS,GACT,WAAY,GACZ,OAAQ,CAAE,QAASJ,CAAE,CAC7B,CAAK,EACDC,EAAM,cAAcG,CAAU,EAC9B,OAAO,UAAY,OAAO,WAAa,CAAA,EACvC,OAAO,UAAU,KAAK,CAClB,MAAO,YACP,GAAIJ,CACZ,CAAK,CACL,EACaK,EAAa,CAACL,EAA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AAA,oCAChJ,KAAK,aAAa,WAAW,EAAI,KAAK,aAAa,WAAW,EAAI,MAAM;AAAA,aAC/F,EAET,CACJ"}
1
+ {"version":3,"file":"modal.component.min.js","sources":["../_global.js","../../modules/modal.js","modal.component.js"],"sourcesContent":["export const trackComponentRegistered = (componentName) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementRegistered',\n element: componentName,\n });\n};\nexport const trackComponent = (component, componentName, trackEvents) => {\n // Data layer Web component created\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'customElementAdded',\n element: componentName,\n });\n trackEvents.forEach((eventName) => {\n component.addEventListener(eventName, function (event) {\n const eventDetails = {\n event: eventName,\n element: componentName,\n target: event.target,\n };\n Object.keys(event.detail).forEach((eventKey) => {\n const eventDetail = event.detail[eventKey];\n eventDetails[eventKey] = eventDetail;\n });\n window.dataLayer.push(eventDetails);\n });\n });\n return true;\n};\n","export const openModal = (id, modal) => {\n var _a;\n const dialog = (_a = modal.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');\n dialog === null || dialog === void 0 ? void 0 : dialog.showModal();\n dialog === null || dialog === void 0 ? void 0 : dialog.focus();\n const closeEvent = new CustomEvent('modal-opened', {\n bubbles: true,\n cancelable: true,\n detail: { modalId: id },\n });\n modal.dispatchEvent(closeEvent);\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'openModal',\n id: id,\n });\n};\nexport const closeModal = (id, modal) => {\n var _a;\n const dialog = (_a = modal.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');\n dialog === null || dialog === void 0 ? void 0 : dialog.close();\n const closeEvent = new CustomEvent('modal-closed', {\n bubbles: true,\n cancelable: true,\n detail: { modalId: id },\n });\n modal.dispatchEvent(closeEvent);\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'closeModal',\n id: id,\n });\n};\nexport const closeButtonHtml = `<button class=\"btn btn-compact btn-secondary fa-xmark-large\" data-close>Close</button>`;\n","import { trackComponentRegistered } from '../_global.js';\nimport { openModal, closeModal, closeButtonHtml } from '../../modules/modal.js';\ntrackComponentRegistered('iam-card');\nclass iamModal extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location')\n ? document.body.getAttribute('data-assets-location')\n : '/assets';\n const loadCSS = `@import \"${assetLocation}/css/components/modal.component.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n \n ${loadCSS}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\" />\n <dialog>\n ${closeButtonHtml}\n <div class=\"scroll\">\n <slot></slot>\n <div class=\"btn__group\">\n <button class=\"btn btn-secondary\" data-cancel>${this.hasAttribute('data-cancel-text') ? this.getAttribute('data-cancel-text') : 'Cancel'}</button>\n <slot name=\"agreed-button\">\n <button class=\"btn btn-primary\" data-agreed>${this.hasAttribute('data-agreed-text') ? this.getAttribute('data-agreed-text') : 'Submit'}</button>\n </slot>\n </div>\n </div>\n </dialog>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n var _a, _b, _c, _d, _e, _f;\n const originalDialog = this.querySelector('dialog');\n const id = this.hasAttribute('id') ? this.getAttribute('id') : originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.getAttribute('id');\n let dialog = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');\n const closeButton = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[data-close]');\n const cancelButton = (_c = this.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('[data-cancel]');\n const agreedButton = this.querySelector('button[slot=\"agreed-button\"]') ? this.querySelector('button[slot=\"agreed-button\"]') : (_d = this.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector('[data-agreed]');\n const modalType = this.hasAttribute('data-type') ? this.getAttribute('data-type') : 'passive';\n const agreed = () => {\n const agreedEvent = new CustomEvent('agreed', {\n detail: { modalId: id },\n });\n this.dispatchEvent(agreedEvent);\n closeModal(id, this);\n };\n document.addEventListener('click', (e) => {\n if (e.target.matches(`[command=\"show-modal\"][commandfor=\"${id}\"]`) || e.target.matches(`[data-modal=\"${id}\"]`)) {\n openModal(id, this);\n }\n });\n document.addEventListener('click', (e) => {\n if (e.target.matches(`[command=\"close\"][commandfor=\"${id}\"]`)) {\n closeModal(id, this);\n }\n });\n // Disable the original event \n originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.addEventListener('command', (e) => {\n if (event.command == \"show-modal\") {\n e.preventDefault();\n }\n });\n originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.addEventListener('command', (e) => {\n e.preventDefault();\n if (event.command == \"close\") {\n closeModal(id, this);\n }\n });\n originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.addEventListener('close', (e) => {\n e.preventDefault();\n closeModal(id, this);\n });\n // Move the submit button so that the slot functionality works\n if (originalDialog) {\n Array.from(originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.querySelectorAll('[slot]')).forEach((element) => {\n this.moveBefore(element, originalDialog);\n });\n }\n closeButton === null || closeButton === void 0 ? void 0 : closeButton.addEventListener('click', () => {\n closeModal(id, this);\n });\n cancelButton === null || cancelButton === void 0 ? void 0 : cancelButton.addEventListener('click', () => {\n closeModal(id, this);\n });\n agreedButton === null || agreedButton === void 0 ? void 0 : agreedButton.addEventListener('click', () => {\n agreed();\n });\n this.addEventListener('close-modal', () => {\n closeModal(id, this);\n });\n // Hijack the default form submission \n originalDialog === null || originalDialog === void 0 ? void 0 : originalDialog.addEventListener('submit', (e) => {\n if (e.submitter && e.submitter.hasAttribute('formmethod') && e.submitter.getAttribute('formmethod') == \"dialog\") {\n closeModal(id, this);\n }\n else {\n agreed();\n }\n });\n Array.from(this.querySelectorAll('button[type=\"submit\"]')).forEach((button) => {\n button.addEventListener('click', (e) => {\n if (!button.closest('form') && !button.hasAttribute('formmethod')) {\n agreed();\n }\n });\n });\n // Add click event on backdrop\n this.addEventListener('click', (event) => {\n // Small fix to make sure the dialog isn't a dialog inside of a dialog.\n const style = window.getComputedStyle(dialog);\n if (style.display === 'contents')\n dialog = dialog.parentNode.closest('dialog[open]');\n // Dont allow the backdrop to be clicked when transactional\n if (modalType != 'transactional' && modalType != 'acknowledgement') {\n const dialogDimensions = dialog.getBoundingClientRect();\n if (event.clientX < dialogDimensions.left ||\n event.clientX > dialogDimensions.right ||\n event.clientY < dialogDimensions.top ||\n event.clientY > dialogDimensions.bottom) {\n if (!event.target.closest('dialog *'))\n closeModal(id, this); // Weird bug when interacting with radio input fields within dialogs cuases it to close\n }\n }\n });\n if (modalType == 'transactional') {\n (_f = (_e = this.shadowRoot) === null || _e === void 0 ? void 0 : _e.querySelector('.scroll')) === null || _f === void 0 ? void 0 : _f.insertAdjacentHTML('afterbegin', `<i class=\"fa-light fa-circle\" aria-hidden=\"true\">\n <i class=\"fa-regular fa-${this.hasAttribute('data-icon') ? this.getAttribute('data-icon') : 'info'}\" aria-hidden=\"true\"></i>\n </i>`);\n }\n }\n}\nexport default iamModal;\n"],"names":["trackComponentRegistered","componentName","openModal","id","modal","_a","dialog","closeEvent","closeModal","closeButtonHtml","iamModal","template","_b","_c","_d","_e","_f","originalDialog","closeButton","cancelButton","agreedButton","modalType","agreed","agreedEvent","e","element","button","event","dialogDimensions"],"mappings":";;;IAAO,MAAMA,EAA4BC,GAAkB,CAEvD,OAAO,UAAY,OAAO,WAAa,CAAA,EACvC,OAAO,UAAU,KAAK,CAClB,MAAO,0BACP,QAASA,CACjB,CAAK,CACL,ECPaC,EAAY,CAACC,EAAIC,IAAU,CACpC,IAAIC,EACJ,MAAMC,GAAUD,EAAKD,EAAM,cAAgB,MAAQC,IAAO,OAAS,OAASA,EAAG,cAAc,QAAQ,EACrDC,GAAO,UAAS,EAChBA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,EAAiB,OACjCD,EAAM,QAAUC,EAAiB,KACjCD,EAAM,QAAUC,EAAiB,UAC5BD,EAAM,OAAO,QAAQ,UAAU,GAChCnB,EAAWL,EAAI,IAAI,EAE/B,CACJ,CAAC,EACGkB,GAAa,mBACZL,GAAMD,EAAK,KAAK,cAAgB,MAAQA,IAAO,OAAS,OAASA,EAAG,cAAc,SAAS,KAAO,MAAQC,IAAO,QAAkBA,EAAG,mBAAmB,aAAc;AAAA,oCAChJ,KAAK,aAAa,WAAW,EAAI,KAAK,aAAa,WAAW,EAAI,MAAM;AAAA,aAC/F,EAET,CACJ"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */const g=c=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:c})},y=(c,e,u)=>(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementAdded",element:e}),u.forEach(l=>{c.addEventListener(l,function(i){const n={event:l,element:e,target:i.target};Object.keys(i.detail).forEach(d=>{const t=i.detail[d];n[d]=t}),window.dataLayer.push(n)})}),!0);g("iam-multi-step");class h extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const e=document.createElement("template");e.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v7.6.4--beta1
2
+ * iamKey v7.6.4--beta3
3
3
  * Copyright 2022-2026 iamproperty
4
4
  */const A=p=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:p})},E=(p,i,c)=>(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementAdded",element:i}),c.forEach(l=>{p.addEventListener(l,function(e){const r={event:l,element:i,target:e.target};Object.keys(e.detail).forEach(a=>{const m=e.detail[a];r[a]=m}),window.dataLayer.push(r)})}),!0);A("iam-multi-step-modal");class S extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const i=document.createElement("template");i.innerHTML=`
5
5
  <style>