@appius-fr/apx 2.5.2 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/APX.prod.mjs CHANGED
@@ -1 +1 @@
1
- var t={613:(t,e,n)=>{n.d(e,{Z:()=>r});var o=n(81),i=n.n(o),s=n(645),a=n.n(s)()(i());a.push([t.id,'/* Dialog styling */\n.APX-dialog {\n display: none;\n position: fixed;\n z-index: 1002;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: rgba(0, 0, 0, 0.4);\n /* Dimmed background for focus on dialog */\n}\n\n.APX-dialog-content {\n background-color: #fefefe;\n padding: 40px;\n border: none;\n width: auto;\n min-width: 300px;\n max-width: 80%;\n margin: auto;\n border-radius: 8px;\n box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.1);\n font-family: \'Helvetica Neue\', Arial, sans-serif;\n}\n\nh2.APX-dialog-title{\n margin-top:0;\n}\n\n.APX-close-dialog {\n color: #aaa;\n float: right;\n font-size: 24px;\n margin-top: -10px;\n /* Adjust positioning */\n margin-right: -10px;\n}\n\n.APX-close-dialog:hover,\n.APX-close-dialog:focus {\n color: #333;\n /* Darker color on hover/focus */\n cursor: pointer;\n}\n\n/* Input fields styling */\n.APX-dialog-content input[type="text"],\n.APX-dialog-content input[type="number"],\n.APX-dialog-content input[type="date"],\n.APX-dialog-content input[type="datetime-local"] {\n width: 100%;\n padding: 10px;\n margin-bottom: 20px;\n border: 1px solid #ccc;\n border-radius: 4px;\n font-family: \'Helvetica Neue\', Arial, sans-serif;\n font-size: 16px;\n box-sizing: border-box;\n transition: border-color 0.3s;\n}\n\n.APX-dialog-content input[type="text"]:focus,\n.APX-dialog-content input[type="number"]:focus,\n.APX-dialog-content input[type="date"]:focus,\n.APX-dialog-content input[type="datetime-local"]:focus {\n border-color: #2C3E50;\n /* Deep Blue Color */\n outline: none;\n}\n\n/* Button in the dialog */\n.APX-dialog-button-container button {\n position: relative;\n background-color: #2C3E50;\n color: #ECF0F1;\n border: none;\n padding: 10px 20px;\n border-radius: 5px;\n font-size: 16px;\n cursor: pointer;\n transition: all 0.3s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.APX-dialog-button-container button:hover {\n background-color: #34495E;\n transform: translateY(-1px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);\n}\n\n.APX-dialog-button-container {\n display: flex;\n gap: 10px;\n margin-top:1em;\n /* spacing between buttons */\n}\n\n/* Loading indicator */\n.APX-dialog-loading-indicator {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n width: 100%;\n}\n\n.APX-dialog-loading-indicator::before {\n content: \'\';\n width: 40px;\n height: 40px;\n border: 4px solid #f3f3f3;\n border-top: 4px solid #2C3E50;\n border-radius: 50%;\n animation: APX-dialog-spin 1s linear infinite;\n}\n\n@keyframes APX-dialog-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n.APX-dialog-button-disabled {\n opacity: 0.5;\n cursor: not-allowed !important;\n background-color: #95a5a6 !important; /* Grayed out color */\n box-shadow: none !important;\n transition: all 0.2s ease;\n transform: none !important;\n}\n\n.APX-dialog-button-disabled:hover {\n background-color: #95a5a6 !important; /* Keep gray on hover */\n transform: none !important;\n}\n\n/* Add a subtle strikethrough effect */\n.APX-dialog-button-disabled::after {\n content: \'\';\n position: absolute;\n top: 50%;\n left: 0;\n width: 100%;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.2);\n transform: rotate(-5deg);\n}',""]);const r=a},152:(t,e,n)=>{n.d(e,{Z:()=>r});var o=n(81),i=n.n(o),s=n(645),a=n.n(s)()(i());a.push([t.id,".APX-toast-container {\n position: fixed;\n display: flex;\n flex-direction: column;\n gap: var(--apx-toast-gap, 8px);\n z-index: var(--apx-toast-z-index, 11000);\n pointer-events: none;\n}\n\n.APX-toast-container--bottom-right { right: 12px; bottom: 12px; align-items: flex-end; }\n.APX-toast-container--bottom-left { left: 12px; bottom: 12px; align-items: flex-start; }\n.APX-toast-container--top-right { right: 12px; top: 12px; align-items: flex-end; }\n.APX-toast-container--top-left { left: 12px; top: 12px; align-items: flex-start; }\n\n.APX-toast {\n min-width: var(--apx-toast-min-width, 260px);\n max-width: var(--apx-toast-max-width, 420px);\n font-size: var(--apx-toast-font-size, 14px);\n border-radius: var(--apx-toast-radius, 6px);\n box-shadow: var(--apx-toast-shadow, 0 6px 24px rgba(0,0,0,0.2));\n padding: var(--apx-toast-padding, 10px 42px 10px 14px);\n color: #111;\n background: #eee;\n pointer-events: auto;\n position: relative;\n transition: opacity 180ms ease, transform 180ms ease;\n}\n\n.APX-toast--info { background: var(--apx-toast-info-bg, #0dcaf0); color: var(--apx-toast-info-fg, #052c65); }\n.APX-toast--success { background: var(--apx-toast-success-bg, #198754); color: var(--apx-toast-success-fg, #ffffff); }\n.APX-toast--warning { background: var(--apx-toast-warning-bg, #ffc107); color: var(--apx-toast-warning-fg, #664d03); }\n.APX-toast--danger { background: var(--apx-toast-danger-bg, #dc3545); color: var(--apx-toast-danger-fg, #ffffff); }\n\n.APX-toast__content { line-height: 1.35; }\n\n.APX-toast__close {\n position: absolute;\n top: 50%; right: 10px;\n width: 24px; height: 24px;\n transform: translateY(-50%);\n display: inline-flex; align-items: center; justify-content: center;\n background: transparent; color: currentColor;\n border: 0; border-radius: 4px; padding: 0; margin: 0;\n cursor: pointer; appearance: none; -webkit-appearance: none;\n opacity: .75; transition: opacity 120ms ease;\n}\n.APX-toast__close:hover { opacity: 1; }\n.APX-toast__close:focus { outline: 2px solid rgba(0,0,0,.2); outline-offset: 2px; }\n.APX-toast__close::before {\n content: '×';\n font-size: 16px; line-height: 1; text-align: center;\n}\n\n/* Animations */\n.APX-toast--enter { opacity: 0; transform: translateY(8px); }\n.APX-toast--enter.APX-toast--enter-active { opacity: 1; transform: translateY(0); }\n.APX-toast--exit { opacity: 1; transform: translateY(0); }\n.APX-toast--exit.APX-toast--exit-active { opacity: 0; transform: translateY(8px); }\n\n\n",""]);const r=a},570:(t,e,n)=>{n.d(e,{Z:()=>m});var o=n(81),i=n.n(o),s=n(645),a=n.n(s),r=n(667),c=n.n(r),l=new URL(n(29),n.b),d=new URL(n(913),n.b),u=new URL(n(260),n.b),p=a()(i()),f=c()(l),h=c()(d),g=c()(u);p.push([t.id,`.apx-tristate {\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n cursor: pointer;\n position: relative;\n min-width:13px;\n min-height:13px;\n background-size: contain;\n background-color: white;\n border-radius:3px;\n}\n.apx-tristate.unchecked {\n background-image: url(${f});\n}\n.apx-tristate.checked {\n background-image: url(${h});\n background-repeat: no-repeat;\n background-position: center;\n}\n.apx-tristate.crossed {\n background-image: url(${g});\n background-repeat: no-repeat;\n background-position: center;\n}`,""]);const m=p},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(o)for(var r=0;r<this.length;r++){var c=this[r][0];null!=c&&(a[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&a[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},667:t=>{t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},81:t=>{t.exports=function(t){return t[1]}},379:t=>{var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var s={},a=[],r=0;r<t.length;r++){var c=t[r],l=o.base?c[0]+o.base:c[0],d=s[l]||0,u="".concat(l," ").concat(d);s[l]=d+1;var p=n(u),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)e[p].references++,e[p].updater(f);else{var h=i(f,o);o.byIndex=r,e.splice(r,0,{identifier:u,updater:h,references:1})}a.push(u)}return a}function i(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var s=o(t=t||[],i=i||{});return function(t){t=t||[];for(var a=0;a<s.length;a++){var r=n(s[a]);e[r].references--}for(var c=o(t,i),l=0;l<s.length;l++){var d=n(s[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}s=c}}},569:t=>{var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},260:t=>{t.exports="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20viewBox%3D%220%200%2032%2032%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m0.543%205.647c0-3.119%202.531-5.647%205.65-5.647h19.309c3.12%200%205.65%202.511%205.65%205.647v20.705c0%203.119-2.531%205.647-5.65%205.647h-19.309c-3.12%200-5.65-2.511-5.65-5.647v-20.705z%22%20fill%3D%22%23f00%22%2F%3E%3Cpath%20d%3D%22m8%208%2016%2016%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%2F%3E%3Cpath%20d%3D%22M24%208L8%2024%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E"},29:t=>{t.exports="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20%20fill%3D%22%23cccccc%22%20d%3D%22M25.107%2032.030h-18.214c-3.456%200-6.268-2.81-6.268-6.264v-19.529c0-3.456%202.812-6.268%206.268-6.268h18.214c3.456%200%206.268%202.812%206.268%206.268v19.529c0%203.452-2.812%206.264-6.268%206.264zM6.893%201.85c-2.419%200-4.386%201.967-4.386%204.386v19.529c0%202.417%201.967%204.382%204.386%204.382h18.214c2.419%200%204.386-1.965%204.386-4.382v-19.529c0-2.419-1.967-4.386-4.386-4.386h-18.214z%22%3E%3C/path%3E%3C/svg%3E"},913:t=>{t.exports="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20fill%3D%22%230654ba%22%20d%3D%22M0.543%205.647c0-3.119%202.531-5.647%205.65-5.647h19.309c3.12%200%205.65%202.511%205.65%205.647v20.705c0%203.119-2.531%205.647-5.65%205.647h-19.309c-3.12%200-5.65-2.511-5.65-5.647v-20.705zM5.313%2017.587l7.039%206.839%2013.831-13.439-2.636-2.561-10.929%2010.62-4.442-4.317-2.862%202.858z%22%3E%3C/path%3E%3C/svg%3E"}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,n),s.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.b=document.baseURI||self.location.href,n.nc=void 0;var o={};(()=>{n.d(o,{Z:()=>Z});let t=0;const e={},i={};function s(t,n,o,s="",a){const r=s?function(t,e){for(;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null}(t.target,s):a;function c(){e[n]&&e[n].reduce(((e,n)=>e.then((()=>new Promise(((e,o)=>{try{const i=n.bind(r)(t);i instanceof Promise?i.then(e).catch(o):e(i)}catch(t){o(t)}}))))),Promise.resolve()).catch((t=>{console.error("Error in callback chain:",t)}))}r&&(clearTimeout(i[n]),0===o?c():i[n]=setTimeout(c,o))}var a=n(379),r=n.n(a),c=n(795),l=n.n(c),d=n(569),u=n.n(d),p=n(565),f=n.n(p),h=n(216),g=n.n(h),m=n(589),y=n.n(m),b=n(570),v={};function x(t){t.tristate=function(e={}){t.elements.forEach((t=>{if("checkbox"===t.type){const[n,o,i]=function(t,e){const n=window.getComputedStyle(t);t.style.display="none";const o=document.createElement("div");o.classList.add("apx-tristate"),e.size&&(e.size.width&&(o.style.width=e.size.width+"px"),e.size.height&&(o.style.height=e.size.height+"px")),e.classes&&o.classList.add(...function(t){let e=[];return"string"==typeof t?e=(t=t.replace(/\s\s+/g," ")).indexOf(" ")>-1?t.split(" "):t.indexOf(",")>-1?t.split(","):[t]:Array.isArray(t)&&(e=t),e}(e.classes)),o.style.margin=n.margin,t.checked?o.classList.add("checked"):o.classList.add("unchecked");const i=document.createElement("input");return i.type="hidden",i.name=t.name,t.dataset.name=t.name,t.removeAttribute("name"),e.defaultState?function(t,e,n){"checked"===t.defaultState?(e.classList.remove("unchecked"),e.classList.add("checked"),n.value="true"):"unchecked"===t.defaultState?(e.classList.remove("checked"),e.classList.add("unchecked"),n.removeAttribute("name"),n.removeAttribute("value")):"crossed"===t.defaultState&&(e.classList.remove("checked"),e.classList.add("crossed"),n.value="false")}(e,o,i):t.checked?i.value="true":(i.name="",i.value=""),o.tabIndex=t.tabIndex,o.appendChild(i),t.parentNode.insertBefore(o,t.nextSibling),o.addEventListener("click",(function(n){!function(t,e,n){t.classList.contains("checked")?(t.classList.remove("checked"),t.classList.add("crossed"),e.checked=!1,n.value="false"):t.classList.contains("crossed")?(t.classList.remove("crossed"),t.classList.add("unchecked"),n.removeAttribute("name"),n.removeAttribute("value")):(t.classList.remove("unchecked"),t.classList.add("checked"),e.checked=!0,n.value="true",n.setAttribute("name",e.dataset.name))}(o,t,i),w(e,t,o,i,n)})),o.addEventListener("keyup",A.bind(null,t)),[t,o,i]}(t,e);e.callbacks&&e.callbacks.after&&"function"==typeof e.callbacks.after&&e.callbacks.after(n,o,i)}}))}}function w(t,e,n,o,i){t.callbacks&&t.callbacks.change&&"function"==typeof t.callbacks.change&&t.callbacks.change(e,n,o),t.bubbleEvents&&("click"===i.type?e.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0})):"keyup"===i.type?e.dispatchEvent(new KeyboardEvent("keyup",{key:" ",bubbles:!0,cancelable:!0})):"change"===i.type&&e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))}function A(t,e){32===e.keyCode&&(w(t,e),e.preventDefault(),e.target.click())}v.styleTagTransform=y(),v.setAttributes=f(),v.insert=u().bind(null,"head"),v.domAPI=l(),v.insertStyleElement=g(),r()(b.Z,v),b.Z&&b.Z.locals&&b.Z.locals;var P=n(613),k={};k.styleTagTransform=y(),k.setAttributes=f(),k.insert=u().bind(null,"head"),k.domAPI=l(),k.insertStyleElement=g(),r()(P.Z,k),P.Z&&P.Z.locals&&P.Z.locals;var E=n(152),C={};C.styleTagTransform=y(),C.setAttributes=f(),C.insert=u().bind(null,"head"),C.domAPI=l(),C.insertStyleElement=g(),r()(E.Z,C),E.Z&&E.Z.locals&&E.Z.locals;const X="undefined"!=typeof window&&"undefined"!=typeof document,L=new Map;let $=null,S=null;const T={position:"bottom-right",maxToasts:5,defaultDurationMs:5e3,zIndex:11e3,ariaLive:"polite",gap:8,dedupe:!1,containerClass:"",offset:0};function D(t,e){const n=document.createElement(t);return e&&e.split(" ").filter(Boolean).forEach((t=>n.classList.add(t))),n}function M(t){return{above:"top",below:"bottom",before:"left",after:"right"}[t]||t}function z(t){if("string"==typeof t)return t.includes("top")?"up":(t.includes("bottom"),"down");if("object"==typeof t&&null!==t){const e=t.type||(t.x||t.y?"sticky":null);if("sticky"===e||!e&&(t.x||t.y)){if(void 0!==t.y){if(t.y.startsWith("-"))return"down";const e=parseFloat(t.y);if(!isNaN(e))return t.y.includes("%")?e<50?"up":"down":e<400?"up":"down"}return"down"}if("anchored"===e&&t.placement){const e=M(t.placement);return"top"===e||"above"===e?"up":"down"}if("relative"===e){if(void 0!==t.y){const e=parseFloat(t.y);if(!isNaN(e))return e<0?"up":"down"}return"down"}}return"down"}function F(){X&&(document.querySelectorAll('.APX-toast-container:not([data-apx-toast-managed="true"])').forEach((t=>{if(0===t.children.length){const e=t.getAttribute("data-apx-toast-position");e&&L.delete(e),t.remove()}})),S&&0===S.children.length&&(S.remove(),S=null),$=null)}function N(t){if("string"==typeof t)return`s:${t}`;if("object"==typeof t&&null!==t){const e=[],n=t.type||(t.x||t.y?"sticky":null);if(n&&e.push(`t:${n}`),void 0!==t.x&&e.push(`x:${t.x}`),void 0!==t.y&&e.push(`y:${t.y}`),t.element){const n=t.element.id||t.element.dataset?.apxToastAnchorId||`el_${function(t){const e=t.getBoundingClientRect(),n=`${t.tagName}_${e.left}_${e.top}_${e.width}_${e.height}`;let o=0;for(let t=0;t<n.length;t++)o=(o<<5)-o+n.charCodeAt(t),o&=o;return Math.abs(o).toString(36)}(t.element)}`;e.push(`el:${n}`)}if(t.placement){const n=M(t.placement);e.push(`p:${n}`)}return void 0!==t.gap&&e.push(`g:${t.gap}`),t.useNativeCSS&&e.push("native:true"),`o:${e.join("|")}`}return"s:bottom-right"}class j{constructor(t){this.config={...T,...t||{}},this.container=null,this.idToRef=new Map,this.open=[]}configure(t){this.config={...this.config,...t||{}},this.container&&this.applyContainerConfig()}setAriaLive(t){this.configure({ariaLive:t})}getOpenToasts(){return this.open.slice()}show(t){if(!X)return null;const e=this.normalizeOptions(t);if(this.config.dedupe&&e.id&&this.idToRef.has(e.id)){const t=this.idToRef.get(e.id);return t.update(e),t}const n=e.position||this.config.position||"bottom-right",o=void 0!==e.flow?e.flow:void 0!==this.config.flow?this.config.flow:"auto",i="auto"===o?z(n):o;this.ensureContainer();const s=D("div",`APX-toast APX-toast--${e.type}`);s.setAttribute("role","status");const a=e.id||`t_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;s.dataset.toastId=a,e.className&&(s.className+=` ${e.className}`);const r=D("div","APX-toast__content");"string"==typeof e.message?r.textContent=e.message:e.message&&r.appendChild(e.message),s.appendChild(r);let c=null;!1!==e.dismissible&&(c=D("button","APX-toast__close"),c.setAttribute("aria-label","Close"),c.type="button",s.appendChild(c));let l=null,d=null,u=null,p=null;if(n&&"object"==typeof n&&null!==n){const t=n.type||(n.x||n.y?"sticky":null);if(n.useNativeCSS&&("relative"===t||"anchored"===t)&&n.element){const e=n.element;p=e.style.position,e.style.position="relative";const o=N(n);let s=e.querySelector(`[data-apx-toast-position="${o}"]`);if(s)s.style.flexDirection="up"===i?"column-reverse":"column";else{if(s=D("div","APX-toast-container APX-toast-container-native"),s.setAttribute("data-apx-toast-position",o),s.style.position="absolute",s.style.zIndex=String(this.config.zIndex),s.style.gap=`${this.config.gap}px`,s.setAttribute("aria-live",String(this.config.ariaLive)),s.style.flexDirection="up"===i?"column-reverse":"column","relative"===t)void 0!==n.x&&(n.x.startsWith("-")?s.style.right=n.x.substring(1):s.style.left=n.x),void 0!==n.y&&(n.y.startsWith("-")?s.style.bottom=n.y.substring(1):s.style.top=n.y);else if("anchored"===t){const t=M(n.placement),e=n.gap||"1em";switch(t){case"top":s.style.bottom=`calc(100% + ${e})`,s.style.left="0";break;case"bottom":s.style.top=`calc(100% + ${e})`,s.style.left="0";break;case"left":s.style.right=`calc(100% + ${e})`,s.style.top="0";break;case"right":s.style.left=`calc(100% + ${e})`,s.style.top="0"}}e.appendChild(s)}l=s,u=()=>{if(e&&e.parentElement&&(e.style.position=p||"",s&&0===s.children.length)){const t=s.getAttribute("data-apx-toast-position");t&&L.delete(t),s.remove()}}}else{l=this.getContainerForPosition(n,i);const e=()=>{const t=this.calculatePosition(n,l);Object.assign(l.style,t)};if(e(),("relative"===t||"anchored"===t)&&n.element){let t=null,o=0;const i=16,s=()=>{const n=Date.now();n-o<i?(t&&cancelAnimationFrame(t),t=requestAnimationFrame((()=>{e(),o=Date.now()}))):(e(),o=n)},a=function(t){const e=[];let n=t.parentElement;for(;n&&n!==document.body&&n!==document.documentElement;){const t=window.getComputedStyle(n),o=t.overflow+t.overflowY+t.overflowX;(o.includes("scroll")||o.includes("auto"))&&e.push(n),n=n.parentElement}return e}(n.element);window.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s,{passive:!0}),a.forEach((t=>{t.addEventListener("scroll",s,{passive:!0})}));const r=new MutationObserver((()=>{n.element.parentElement||v.close("api")}));r.observe(document.body,{childList:!0,subtree:!0}),d=e,u=()=>{window.removeEventListener("scroll",s),window.removeEventListener("resize",s),a.forEach((t=>{t.removeEventListener("scroll",s)})),r.disconnect(),t&&cancelAnimationFrame(t)}}}}else l=this.getContainerForPosition(n,i);l?l.appendChild(s):this.container.appendChild(s),s.classList.add("APX-toast--enter"),requestAnimationFrame((()=>{s.classList.add("APX-toast--enter-active")}));let f=e.durationMs,h=null,g=null;const m={click:new Set,close:new Set},y=()=>{!f||f<=0||(g=Date.now(),h=window.setTimeout((()=>v.close("timeout")),f))},b=()=>{null!=h&&(window.clearTimeout(h),h=null,null!=g&&(f-=Date.now()-g))},v={id:a,el:s,close:t=>{cleanup(t||"api")},update:t=>{const n=this.normalizeOptions({...e,...t});"string"==typeof n.message?r.textContent=n.message:n.message&&(r.innerHTML="",r.appendChild(n.message)),["info","success","warning","danger"].forEach((t=>s.classList.remove(`APX-toast--${t}`))),s.classList.add(`APX-toast--${n.type}`),e.className!==n.className&&(e.className&&s.classList.remove(...e.className.split(" ").filter(Boolean)),n.className&&s.classList.add(...n.className.split(" ").filter(Boolean))),e.durationMs=n.durationMs,f=n.durationMs,b(),y()},whenClosed:()=>w,on:(t,e)=>(m[t].add(e),()=>v.off(t,e)),off:(t,e)=>{m[t].delete(e)}},x=(t,e)=>m[t].forEach((t=>{try{t(e)}catch(t){}})),w=new Promise((t=>{const n=n=>{if(x("close",n),"function"==typeof e.onClose)try{e.onClose(v,n)}catch(t){}t()},o=t=>{if(!s)return;if(b(),u&&(u(),u=null),"overflow"===t){s.parentElement&&s.parentElement.removeChild(s);const e=this.open.indexOf(v);return e>=0&&this.open.splice(e,1),this.idToRef.delete(a),void n(t)}s.classList.add("APX-toast--exit"),requestAnimationFrame((()=>s.classList.add("APX-toast--exit-active")));const e=()=>{s.removeEventListener("transitionend",e),s.parentElement&&s.parentElement.removeChild(s);const o=this.open.indexOf(v);o>=0&&this.open.splice(o,1),this.idToRef.delete(a),$&&clearTimeout($),$=setTimeout(F,2e4),n(t)};s.addEventListener("transitionend",e)};v.close=t=>o(t||"api")}));return s.addEventListener("click",(t=>{if(x("click",t),"function"==typeof e.onClick)try{e.onClick(v,t)}catch(t){}})),s.addEventListener("mouseenter",b),s.addEventListener("mouseleave",(()=>y())),c&&c.addEventListener("click",(t=>{t.stopPropagation(),v.close("close")})),this.open.push(v),this.idToRef.set(a,v),this.open.length>this.config.maxToasts&&this.open[0].close("overflow"),y(),v}info(t,e){return this.show({...e||{},message:t,type:"info"})}success(t,e){return this.show({...e||{},message:t,type:"success"})}warning(t,e){return this.show({...e||{},message:t,type:"warning"})}danger(t,e){return this.show({...e||{},message:t,type:"danger"})}closeAll(t){this.open.slice().forEach((e=>e.close(t||"api")))}normalizeOptions(t){const e={...t};return e.type||(e.type="info"),"boolean"!=typeof e.dismissible&&(e.dismissible=!0),"number"!=typeof e.durationMs&&(e.durationMs=this.config.defaultDurationMs),!e.id&&this.config.id&&(e.id=this.config.id),e}getContainerForPosition(t,e,n=!1){if(!X)return null;const o=N(t),i=e&&"auto"!==e?e:z(t);let s=L.get(o);if(!s&&X&&(s=document.querySelector(`[data-apx-toast-position="${o}"]`),s&&L.set(o,s)),s)s.style.flexDirection="up"===i?"column-reverse":"column",n&&!s.hasAttribute("data-apx-toast-managed")&&s.setAttribute("data-apx-toast-managed","true");else{s=D("div","APX-toast-container"),s.setAttribute("data-apx-toast-position",o),n&&s.setAttribute("data-apx-toast-managed","true");const e="string"==typeof t?t:t.type||"bottom-right";if(s.classList.add(`APX-toast-container--${e}`),s.setAttribute("aria-live",String(this.config.ariaLive)),s.style.zIndex=String(this.config.zIndex),s.style.gap=`${this.config.gap}px`,s.style.flexDirection="up"===i?"column-reverse":"column","object"==typeof t&&null!==t){s.style.position="fixed";const e=this.calculatePosition(t,s);Object.assign(s.style,e)}const a=X?(S||(S=document.querySelector(".APX-toast-wrapper"),S||(S=D("div","APX-toast-wrapper"),S.style.position="fixed",S.style.top="0",S.style.left="0",S.style.width="0",S.style.height="0",S.style.pointerEvents="none",S.style.zIndex="10000",document.body.appendChild(S))),S):null;a?a.appendChild(s):document.body.appendChild(s),L.set(o,s)}return s}ensureContainer(){if(this.container||!X)return;const t=this.config.position||"bottom-right",e=void 0!==this.config.flow?this.config.flow:"auto";this.container=this.getContainerForPosition(t,e,!0),this.applyContainerConfig()}applyContainerConfig(){if(!this.container)return;const t=this.config.position||"bottom-right",e="string"==typeof t?t:t.type||"bottom-right";if(this.container.style.zIndex=String(this.config.zIndex),this.container.style.gap=`${this.config.gap}px`,this.container.setAttribute("aria-live",String(this.config.ariaLive)),"string"==typeof t){const t=["bottom-right","bottom-left","top-right","top-left"].map((t=>`APX-toast-container--${t}`));this.container.classList.remove(...t),this.container.classList.add(`APX-toast-container--${e}`)}if(this.config.containerClass&&this.config.containerClass.split(" ").filter(Boolean).forEach((t=>{this.container.classList.add(t)})),"string"==typeof t)if(this.config.offset){const t=`${this.config.offset}px`;e.includes("bottom")?this.container.style.bottom=t:this.container.style.top=t,e.includes("right")?this.container.style.right=t:this.container.style.left=t}else e.includes("bottom")?this.container.style.bottom="":this.container.style.top="",e.includes("right")?this.container.style.right="":this.container.style.left="";else"object"==typeof t&&null!==t&&(this.container.style.position="fixed")}calculatePosition(t,e){if("string"==typeof t)return{};if("object"==typeof t&&null!==t){const e=t.type||(t.x||t.y?"sticky":null);if("sticky"===e||!e&&(t.x||t.y)){const e={};return void 0!==t.x&&(t.x.startsWith("-")?e.right=t.x.substring(1):e.left=t.x),void 0!==t.y&&(t.y.startsWith("-")?e.bottom=t.y.substring(1):e.top=t.y),e}if("relative"===e&&t.element){const e=t.element.getBoundingClientRect(),n=t=>{if(!t)return 0;const e=parseFloat(t);return t.includes("em")?16*e:e},o=n(t.x||"0"),i=n(t.y||"0");return{left:`${e.left+o}px`,top:`${e.top+i}px`}}if("anchored"===e&&t.element){const e=t.element.getBoundingClientRect(),n=(t=>{const e=parseFloat(t);return t.includes("em")?16*e:e})(t.gap||"1em"),o={};switch(M(t.placement)){case"top":o.bottom=`${window.innerHeight-e.top+n}px`,o.left=`${e.left}px`;break;case"bottom":o.top=`${e.bottom+n}px`,o.left=`${e.left}px`;break;case"left":o.right=`${window.innerWidth-e.left+n}px`,o.top=`${e.top}px`;break;case"right":o.left=`${e.right+n}px`,o.top=`${e.top}px`}return o}}return{}}}let _=null;const I=()=>(_||(_=new j(undefined)),_);function O(t){return I().show(t)}Object.assign(O,{create:(t,e)=>{if("string"==typeof t){const n=t,o=new j({...e||{}});return O.custom||(O.custom={}),O.custom[n]=o,o}return new j({...t||{}})},custom:{},use:t=>O.custom&&O.custom[t]||null,Manager:j,show:t=>I().show(t),info:(t,e)=>I().info(t,e),success:(t,e)=>I().success(t,e),warning:(t,e)=>I().warning(t,e),danger:(t,e)=>I().danger(t,e),configure:t=>I().configure(t),setAriaLive:t=>I().setAriaLive(t),closeAll:t=>I().closeAll(t),getOpenToasts:()=>I().getOpenToasts()});const R=O,q=function(n,o=document){let i;if("string"==typeof o)o=document.querySelector(o);else if(q.isAPXObject(o))o=o.first();else if(!(o instanceof HTMLElement||o instanceof Document))throw new Error("Invalid context for APX");if("string"==typeof n&&n.startsWith("//")){i=document.evaluate(n,o,null,XPathResult.ANY_TYPE,null);let t=[],e=i.iterateNext();for(;e;)t.push(e),e=i.iterateNext();i=t}else if("string"==typeof n)i=o.querySelectorAll(n);else if(n instanceof HTMLElement)i=o.contains(n)?[n]:[];else if(n instanceof NodeList||n instanceof HTMLCollection)i=Array.from(n).filter((t=>o.contains(t)));else if(Array.isArray(n)&&n.every((t=>t instanceof HTMLElement)))i=n.filter((t=>o.contains(t)));else if("undefined"!=typeof jQuery&&n instanceof jQuery)i=Array.from(n.get()).filter((t=>o.contains(t)));else{if("function"!=typeof n)throw new Error("Invalid input type for APX");i=q(n(),o)}var a={elements:i,_isAPXObject:!0};return a.length=i.length,a.each=function(t){return this.elements instanceof Array&&this.elements.forEach(t),this.elements instanceof NodeList&&Array.from(this.elements).forEach(t),this},a.get=function(t){return this.elements[t]},a.all=function(){return this.elements instanceof Array?this.elements:this.elements instanceof NodeList?Array.from(this.elements):this},a.first=function(){return this.get(0)},function(n){let o=n.elements;n.listen=function(n,i,a){let r,c={};"string"==typeof i?(r=i,c=a||{}):c=i||{};const l=function(){const e=Math.random().toString(36).substr(2,9),n=`${Date.now()}_${e}_${t}`;return t=(t+1)%1e3,n}(),d=c.timeout||0;return Array.isArray(n)||(n=[n]),n.forEach((t=>{o.forEach((e=>{e.addEventListener(t,(t=>{s(t,l,d,r,e)}))}))})),{do:function(t){return e[l]||(e[l]=[]),e[l].push(t),this}}},n.trigger=function(t){let o;if("string"==typeof t)o=t,t=new Event(t,{bubbles:!0,cancelable:!0});else{if(!(t instanceof Event))return void console.error("Invalid event type provided to apx.trigger. It must be either a string or Event object.");o=t.type}n.elements.forEach((e=>{e.dispatchEvent(t)})),Object.keys(e).forEach((n=>{const i=e[n];if(i&&i.eventType===o){const{selector:e}=i;e&&!t.target.matches(e)||s(t,n,0,e,t.target)}}))}}(a),x(a),a};q.loadCss=function(t){return fetch(t).then((t=>t.text())).then((t=>{const e=document.createElement("style");e.type="text/css",e.textContent=t,document.head.appendChild(e)})).catch((t=>{console.error("Failed to load CSS:",t)}))},q.dialog=t=>{const{title:e,content:n,contentURI:o,buttons:i,size:s,showLoadingIndicator:a,contentMethod:r,contentData:c,contentHeaders:l}={title:"",content:"",contentURI:"",buttons:[],size:"medium",showLoadingIndicator:!1,contentMethod:"GET",contentData:null,contentHeaders:void 0,...t},d=document.createElement("div");d.innerHTML='<div class="APX-dialog"> <div class="APX-dialog-content"> <span class="APX-close-dialog">&times;</span> <h2 class="APX-dialog-title"></h2> <div class="APX-dialog-dynamic-content"></div> <div class="APX-dialog-button-container"></div> </div> </div>'.trim();const u=d.firstChild,p={},f={};["opening","opened","closing","closed","contentLoading","contentLoaded"].forEach((t=>{f[t]=new Promise((e=>{p[t]=e}))}));const h=t=>{p[t]?p[t]():console.warn(`No resolver found for lifecycle event: ${t}`)},g={element:u,buttons:{},isClosed:!1,lifecycle:f,disableButton:t=>{const e=u.querySelector(`.APX-dialog-button[data-key="${t}"]`);e&&(e.disabled=!0,e.classList.add("APX-dialog-button-disabled"))},enableButton:t=>{const e=u.querySelector(`.APX-dialog-button[data-key="${t}"]`);e&&(e.disabled=!1,e.classList.remove("APX-dialog-button-disabled"))},open:async()=>{try{h("opening"),await g.lifecycle.opening,a&&o?(document.body.appendChild(u),u.style.display="flex",u.querySelector(".APX-dialog-dynamic-content").innerHTML='<div class="APX-dialog-loading-indicator"></div>',await y()):(await y(),document.body.appendChild(u),u.style.display="flex"),h("opened"),await g.lifecycle.opened}catch(t){console.error("Error opening dialog:",t)}return g},close:async()=>{try{h("closing"),await g.lifecycle.closing,m(),h("closed"),await g.lifecycle.closed}catch(t){console.error("Error during dialog closing:",t)}return g}},m=()=>{g.isClosed||(g.isClosed=!0,u.style.display="none",document.body.contains(u)&&document.body.removeChild(u))},y=async()=>{const t=document.body.style.cursor;document.body.style.cursor="wait";const e=u.querySelector(".APX-dialog-dynamic-content");try{h("contentLoading"),await g.lifecycle.contentLoading;const t=o?await b(o):n;e.innerHTML=t,h("contentLoaded"),await g.lifecycle.contentLoaded}catch(t){console.error("Error loading content:",t)}finally{document.body.style.cursor=t}},b=async t=>{const e=(r||"GET").toUpperCase(),n={...l||{}},o=Object.keys(n).some((t=>"content-type"===t.toLowerCase())),i={method:e};if("POST"===e){let t;const e="undefined"!=typeof FormData&&c instanceof FormData,s="undefined"!=typeof URLSearchParams&&c instanceof URLSearchParams,a="undefined"!=typeof Blob&&c instanceof Blob,r="string"==typeof c,l=c&&"object"==typeof c&&!e&&!s&&!a;e?t=c:s?(t=c,o||(n["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8")):l?(t=JSON.stringify(c),o||(n["Content-Type"]="application/json")):(r||a||null!=c)&&(t=c),void 0!==t&&(i.body=t)}Object.keys(n).length>0&&(i.headers=n);const s=await fetch(t,i);if(!s.ok)throw new Error(`Failed to fetch content: ${s.statusText}`);return s.text()};return(()=>{const t=u.querySelector(".APX-dialog-content");if("auto"===s)return;const e={small:{width:"300px",height:"200px"},medium:{width:"500px",height:"400px"},large:{width:"800px",height:"600px"}}[s]||"object"==typeof s&&s;e&&(t.style.minWidth=e.width||"500px",t.style.minHeight=e.height||"400px")})(),(()=>{const t=u.querySelector(".APX-dialog-button-container");i.forEach((({key:e,label:n,order:o=0,align:i="flex-end",closeOnClick:s=!0})=>{const a=document.createElement("button");a.classList.add("APX-dialog-button"),a.textContent=n,a.style.order=o,a.setAttribute("data-key",e);const r={disable:()=>{a.disabled=!0,a.classList.add("APX-dialog-button-disabled")},enable:()=>{a.disabled=!1,a.classList.remove("APX-dialog-button-disabled")},key:e,element:a};if(s){let t=!1;const n=new Promise((e=>{a.onclick=()=>{t||a.disabled||(t=!0,e({dialog:g,button:r}),g.close())}}));g.buttons[e]=n}else{let t=[];const n={then:e=>("function"==typeof e&&t.push(e),n)};a.onclick=()=>{a.disabled||t.forEach((t=>t({dialog:g,button:r})))},g.buttons[e]=n}t.appendChild(a),t.style.justifyContent=i}))})(),u.querySelector(".APX-dialog-title").textContent=e,u.querySelector(".APX-close-dialog").onclick=g.close,g},q.toast=R,q.isAPXObject=function(t){return t&&!0===t._isAPXObject},q.is_numeric=t=>!isNaN(t-parseFloat(t));const Z=q})();var i=o.Z;export{i as default};
1
+ var e={613:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(81),i=n.n(o),a=n(645),s=n.n(a)()(i());s.push([e.id,'/* Dialog styling */\n.APX-dialog {\n display: none;\n position: fixed;\n z-index: 1002;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: rgba(0, 0, 0, 0.4);\n /* Dimmed background for focus on dialog */\n}\n\n.APX-dialog-content {\n background-color: #fefefe;\n padding: 40px;\n border: none;\n width: auto;\n min-width: 300px;\n max-width: 80%;\n margin: auto;\n border-radius: 8px;\n box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.1);\n font-family: \'Helvetica Neue\', Arial, sans-serif;\n}\n\nh2.APX-dialog-title{\n margin-top:0;\n}\n\n.APX-close-dialog {\n color: #aaa;\n float: right;\n font-size: 24px;\n margin-top: -10px;\n /* Adjust positioning */\n margin-right: -10px;\n}\n\n.APX-close-dialog:hover,\n.APX-close-dialog:focus {\n color: #333;\n /* Darker color on hover/focus */\n cursor: pointer;\n}\n\n/* Input fields styling */\n.APX-dialog-content input[type="text"],\n.APX-dialog-content input[type="number"],\n.APX-dialog-content input[type="date"],\n.APX-dialog-content input[type="datetime-local"] {\n width: 100%;\n padding: 10px;\n margin-bottom: 20px;\n border: 1px solid #ccc;\n border-radius: 4px;\n font-family: \'Helvetica Neue\', Arial, sans-serif;\n font-size: 16px;\n box-sizing: border-box;\n transition: border-color 0.3s;\n}\n\n.APX-dialog-content input[type="text"]:focus,\n.APX-dialog-content input[type="number"]:focus,\n.APX-dialog-content input[type="date"]:focus,\n.APX-dialog-content input[type="datetime-local"]:focus {\n border-color: #2C3E50;\n /* Deep Blue Color */\n outline: none;\n}\n\n/* Button in the dialog */\n.APX-dialog-button-container button {\n position: relative;\n background-color: #2C3E50;\n color: #ECF0F1;\n border: none;\n padding: 10px 20px;\n border-radius: 5px;\n font-size: 16px;\n cursor: pointer;\n transition: all 0.3s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.APX-dialog-button-container button:hover {\n background-color: #34495E;\n transform: translateY(-1px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);\n}\n\n.APX-dialog-button-container {\n display: flex;\n gap: 10px;\n margin-top:1em;\n /* spacing between buttons */\n}\n\n/* Loading indicator */\n.APX-dialog-loading-indicator {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n width: 100%;\n}\n\n.APX-dialog-loading-indicator::before {\n content: \'\';\n width: 40px;\n height: 40px;\n border: 4px solid #f3f3f3;\n border-top: 4px solid #2C3E50;\n border-radius: 50%;\n animation: APX-dialog-spin 1s linear infinite;\n}\n\n@keyframes APX-dialog-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n.APX-dialog-button-disabled {\n opacity: 0.5;\n cursor: not-allowed !important;\n background-color: #95a5a6 !important; /* Grayed out color */\n box-shadow: none !important;\n transition: all 0.2s ease;\n transform: none !important;\n}\n\n.APX-dialog-button-disabled:hover {\n background-color: #95a5a6 !important; /* Keep gray on hover */\n transform: none !important;\n}\n\n/* Add a subtle strikethrough effect */\n.APX-dialog-button-disabled::after {\n content: \'\';\n position: absolute;\n top: 50%;\n left: 0;\n width: 100%;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.2);\n transform: rotate(-5deg);\n}',""]);const r=s},152:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(81),i=n.n(o),a=n(645),s=n.n(a)()(i());s.push([e.id,".APX-toast-container {\n position: fixed;\n display: flex;\n flex-direction: column;\n gap: var(--apx-toast-gap, 8px);\n z-index: var(--apx-toast-z-index, 11000);\n pointer-events: none;\n}\n\n.APX-toast-container--bottom-right { right: 12px; bottom: 12px; align-items: flex-end; }\n.APX-toast-container--bottom-left { left: 12px; bottom: 12px; align-items: flex-start; }\n.APX-toast-container--top-right { right: 12px; top: 12px; align-items: flex-end; }\n.APX-toast-container--top-left { left: 12px; top: 12px; align-items: flex-start; }\n\n.APX-toast {\n min-width: var(--apx-toast-min-width, 260px);\n max-width: var(--apx-toast-max-width, 420px);\n font-size: var(--apx-toast-font-size, 14px);\n border-radius: var(--apx-toast-radius, 6px);\n box-shadow: var(--apx-toast-shadow, 0 6px 24px rgba(0,0,0,0.2));\n padding: var(--apx-toast-padding, 10px 42px 10px 14px);\n color: #111;\n background: #eee;\n pointer-events: auto;\n position: relative;\n transition: opacity 180ms ease, transform 180ms ease;\n}\n\n.APX-toast--info { background: var(--apx-toast-info-bg, #0dcaf0); color: var(--apx-toast-info-fg, #052c65); }\n.APX-toast--success { background: var(--apx-toast-success-bg, #198754); color: var(--apx-toast-success-fg, #ffffff); }\n.APX-toast--warning { background: var(--apx-toast-warning-bg, #ffc107); color: var(--apx-toast-warning-fg, #664d03); }\n.APX-toast--danger { background: var(--apx-toast-danger-bg, #dc3545); color: var(--apx-toast-danger-fg, #ffffff); }\n\n.APX-toast__content { line-height: 1.35; }\n\n.APX-toast__close {\n position: absolute;\n top: 50%; right: 10px;\n width: 24px; height: 24px;\n transform: translateY(-50%);\n display: inline-flex; align-items: center; justify-content: center;\n background: transparent; color: currentColor;\n border: 0; border-radius: 4px; padding: 0; margin: 0;\n cursor: pointer; appearance: none; -webkit-appearance: none;\n opacity: .75; transition: opacity 120ms ease;\n}\n.APX-toast__close:hover { opacity: 1; }\n.APX-toast__close:focus { outline: 2px solid rgba(0,0,0,.2); outline-offset: 2px; }\n.APX-toast__close::before {\n content: '×';\n font-size: 16px; line-height: 1; text-align: center;\n}\n\n/* Animations */\n.APX-toast--enter { opacity: 0; transform: translateY(8px); }\n.APX-toast--enter.APX-toast--enter-active { opacity: 1; transform: translateY(0); }\n.APX-toast--exit { opacity: 1; transform: translateY(0); }\n.APX-toast--exit.APX-toast--exit-active { opacity: 0; transform: translateY(8px); }\n\n\n",""]);const r=s},570:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(81),i=n.n(o),a=n(645),s=n.n(a),r=n(667),c=n.n(r),l=new URL(n(29),n.b),d=new URL(n(913),n.b),u=new URL(n(260),n.b),p=s()(i()),f=c()(l),h=c()(d),m=c()(u);p.push([e.id,`.apx-tristate {\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n cursor: pointer;\n position: relative;\n min-width:13px;\n min-height:13px;\n background-size: contain;\n background-color: white;\n border-radius:3px;\n}\n.apx-tristate.unchecked {\n background-image: url(${f});\n}\n.apx-tristate.checked {\n background-image: url(${h});\n background-repeat: no-repeat;\n background-position: center;\n}\n.apx-tristate.crossed {\n background-image: url(${m});\n background-repeat: no-repeat;\n background-position: center;\n}`,""]);const g=p},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,i,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(o)for(var r=0;r<this.length;r++){var c=this[r][0];null!=c&&(s[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&s[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},667:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},81:e=>{e.exports=function(e){return e[1]}},379:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var a={},s=[],r=0;r<e.length;r++){var c=e[r],l=o.base?c[0]+o.base:c[0],d=a[l]||0,u="".concat(l," ").concat(d);a[l]=d+1;var p=n(u),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(f);else{var h=i(f,o);o.byIndex=r,t.splice(r,0,{identifier:u,updater:h,references:1})}s.push(u)}return s}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var a=o(e=e||[],i=i||{});return function(e){e=e||[];for(var s=0;s<a.length;s++){var r=n(a[s]);t[r].references--}for(var c=o(e,i),l=0;l<a.length;l++){var d=n(a[l]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}a=c}}},569:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},260:e=>{e.exports="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20viewBox%3D%220%200%2032%2032%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m0.543%205.647c0-3.119%202.531-5.647%205.65-5.647h19.309c3.12%200%205.65%202.511%205.65%205.647v20.705c0%203.119-2.531%205.647-5.65%205.647h-19.309c-3.12%200-5.65-2.511-5.65-5.647v-20.705z%22%20fill%3D%22%23f00%22%2F%3E%3Cpath%20d%3D%22m8%208%2016%2016%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%2F%3E%3Cpath%20d%3D%22M24%208L8%2024%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E"},29:e=>{e.exports="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20%20fill%3D%22%23cccccc%22%20d%3D%22M25.107%2032.030h-18.214c-3.456%200-6.268-2.81-6.268-6.264v-19.529c0-3.456%202.812-6.268%206.268-6.268h18.214c3.456%200%206.268%202.812%206.268%206.268v19.529c0%203.452-2.812%206.264-6.268%206.264zM6.893%201.85c-2.419%200-4.386%201.967-4.386%204.386v19.529c0%202.417%201.967%204.382%204.386%204.382h18.214c2.419%200%204.386-1.965%204.386-4.382v-19.529c0-2.419-1.967-4.386-4.386-4.386h-18.214z%22%3E%3C/path%3E%3C/svg%3E"},913:e=>{e.exports="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20fill%3D%22%230654ba%22%20d%3D%22M0.543%205.647c0-3.119%202.531-5.647%205.65-5.647h19.309c3.12%200%205.65%202.511%205.65%205.647v20.705c0%203.119-2.531%205.647-5.65%205.647h-19.309c-3.12%200-5.65-2.511-5.65-5.647v-20.705zM5.313%2017.587l7.039%206.839%2013.831-13.439-2.636-2.561-10.929%2010.62-4.442-4.317-2.862%202.858z%22%3E%3C/path%3E%3C/svg%3E"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={id:o,exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.b=document.baseURI||self.location.href,n.nc=void 0;var o={};(()=>{n.d(o,{Z:()=>Y});let e=0;const t={},i={};function a(e,n,o,a="",s){const r=a?function(e,t){for(;e&&1===e.nodeType;){if(e.matches(t))return e;e=e.parentNode}return null}(e.target,a):s;function c(){t[n]&&t[n].reduce(((t,n)=>t.then((()=>new Promise(((t,o)=>{try{const i=n.bind(r)(e);i instanceof Promise?i.then(t).catch(o):t(i)}catch(e){o(e)}}))))),Promise.resolve()).catch((e=>{console.error("Error in callback chain:",e)}))}r&&(clearTimeout(i[n]),0===o?c():i[n]=setTimeout(c,o))}var s=n(379),r=n.n(s),c=n(795),l=n.n(c),d=n(569),u=n.n(d),p=n(565),f=n.n(p),h=n(216),m=n.n(h),g=n(589),y=n.n(g),b=n(570),v={};function x(e){e.tristate=function(t={}){e.elements.forEach((e=>{if("checkbox"===e.type){const[n,o,i]=function(e,t){const n=window.getComputedStyle(e);e.style.display="none";const o=document.createElement("div");o.classList.add("apx-tristate"),t.size&&(t.size.width&&(o.style.width=t.size.width+"px"),t.size.height&&(o.style.height=t.size.height+"px")),t.classes&&o.classList.add(...function(e){let t=[];return"string"==typeof e?t=(e=e.replace(/\s\s+/g," ")).indexOf(" ")>-1?e.split(" "):e.indexOf(",")>-1?e.split(","):[e]:Array.isArray(e)&&(t=e),t}(t.classes)),o.style.margin=n.margin,e.checked?o.classList.add("checked"):o.classList.add("unchecked");const i=document.createElement("input");return i.type="hidden",i.name=e.name,e.dataset.name=e.name,e.removeAttribute("name"),t.defaultState?function(e,t,n){"checked"===e.defaultState?(t.classList.remove("unchecked"),t.classList.add("checked"),n.value="true"):"unchecked"===e.defaultState?(t.classList.remove("checked"),t.classList.add("unchecked"),n.removeAttribute("name"),n.removeAttribute("value")):"crossed"===e.defaultState&&(t.classList.remove("checked"),t.classList.add("crossed"),n.value="false")}(t,o,i):e.checked?i.value="true":(i.name="",i.value=""),o.tabIndex=e.tabIndex,o.appendChild(i),e.parentNode.insertBefore(o,e.nextSibling),o.addEventListener("click",(function(n){!function(e,t,n){e.classList.contains("checked")?(e.classList.remove("checked"),e.classList.add("crossed"),t.checked=!1,n.value="false"):e.classList.contains("crossed")?(e.classList.remove("crossed"),e.classList.add("unchecked"),n.removeAttribute("name"),n.removeAttribute("value")):(e.classList.remove("unchecked"),e.classList.add("checked"),t.checked=!0,n.value="true",n.setAttribute("name",t.dataset.name))}(o,e,i),w(t,e,o,i,n)})),o.addEventListener("keyup",A.bind(null,e)),[e,o,i]}(e,t);t.callbacks&&t.callbacks.after&&"function"==typeof t.callbacks.after&&t.callbacks.after(n,o,i)}}))}}function w(e,t,n,o,i){e.callbacks&&e.callbacks.change&&"function"==typeof e.callbacks.change&&e.callbacks.change(t,n,o),e.bubbleEvents&&("click"===i.type?t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0})):"keyup"===i.type?t.dispatchEvent(new KeyboardEvent("keyup",{key:" ",bubbles:!0,cancelable:!0})):"change"===i.type&&t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))}function A(e,t){32===t.keyCode&&(w(e,t),t.preventDefault(),t.target.click())}v.styleTagTransform=y(),v.setAttributes=f(),v.insert=u().bind(null,"head"),v.domAPI=l(),v.insertStyleElement=m(),r()(b.Z,v),b.Z&&b.Z.locals&&b.Z.locals;var k=n(613),P={};P.styleTagTransform=y(),P.setAttributes=f(),P.insert=u().bind(null,"head"),P.domAPI=l(),P.insertStyleElement=m(),r()(k.Z,P),k.Z&&k.Z.locals&&k.Z.locals;var E=n(152),C={};C.styleTagTransform=y(),C.setAttributes=f(),C.insert=u().bind(null,"head"),C.domAPI=l(),C.insertStyleElement=m(),r()(E.Z,C),E.Z&&E.Z.locals&&E.Z.locals;const L="undefined"!=typeof window&&"undefined"!=typeof document,X=new Map;let $=null,S=null;const N={position:"bottom-right",maxToasts:5,defaultDurationMs:5e3,zIndex:11e3,ariaLive:"polite",gap:8,dedupe:!1,containerClass:"",offset:0};function T(e,t){const n=document.createElement(e);return t&&t.split(" ").filter(Boolean).forEach((e=>n.classList.add(e))),n}function D(e){return{above:"top",below:"bottom",before:"left",after:"right"}[e]||e}function M(e){if("string"==typeof e)return e.includes("top")?"up":(e.includes("bottom"),"down");if("object"==typeof e&&null!==e){const t=e.type||(e.x||e.y?"sticky":null);if("sticky"===t||!t&&(e.x||e.y)){if(void 0!==e.y){if(e.y.startsWith("-"))return"down";const t=parseFloat(e.y);if(!isNaN(t))return e.y.includes("%")?t<50?"up":"down":t<400?"up":"down"}return"down"}if("anchored"===t&&e.placement){const t=D(e.placement);return"top"===t||"above"===t?"up":"down"}if("relative"===t){if(void 0!==e.y){const t=parseFloat(e.y);if(!isNaN(t))return t<0?"up":"down"}return"down"}}return"down"}function j(){L&&(document.querySelectorAll('.APX-toast-container:not([data-apx-toast-managed="true"])').forEach((e=>{if(0===e.children.length){const t=e.getAttribute("data-apx-toast-position");t&&X.delete(t),e.remove()}})),S&&0===S.children.length&&(S.remove(),S=null),$=null)}function F(e){if("string"==typeof e)return`s:${e}`;if("object"==typeof e&&null!==e){const t=[],n=e.type||(e.x||e.y?"sticky":null);if(n&&t.push(`t:${n}`),void 0!==e.x&&t.push(`x:${e.x}`),void 0!==e.y&&t.push(`y:${e.y}`),e.element){const n=e.element.id||e.element.dataset?.apxToastAnchorId||`el_${function(e){const t=e.getBoundingClientRect(),n=`${e.tagName}_${t.left}_${t.top}_${t.width}_${t.height}`;let o=0;for(let e=0;e<n.length;e++)o=(o<<5)-o+n.charCodeAt(e),o&=o;return Math.abs(o).toString(36)}(e.element)}`;t.push(`el:${n}`)}if(e.placement){const n=D(e.placement);t.push(`p:${n}`)}return void 0!==e.gap&&t.push(`g:${e.gap}`),e.useNativeCSS&&t.push("native:true"),`o:${t.join("|")}`}return"s:bottom-right"}class O{constructor(e){this.config={...N,...e||{}},this.container=null,this.idToRef=new Map,this.open=[]}configure(e){this.config={...this.config,...e||{}},this.container&&this.applyContainerConfig()}setAriaLive(e){this.configure({ariaLive:e})}getOpenToasts(){return this.open.slice()}show(e){if(!L)return null;const t=this.normalizeOptions(e);if(this.config.dedupe&&t.id&&this.idToRef.has(t.id)){const e=this.idToRef.get(t.id);return e.update(t),e}const n=t.position||this.config.position||"bottom-right",o=void 0!==t.flow?t.flow:void 0!==this.config.flow?this.config.flow:"auto",i="auto"===o?M(n):o;this.ensureContainer();const a=T("div",`APX-toast APX-toast--${t.type}`);a.setAttribute("role","status");const s=t.id||`t_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;a.dataset.toastId=s,t.className&&(a.className+=` ${t.className}`);const r=T("div","APX-toast__content");"string"==typeof t.message?r.textContent=t.message:t.message&&r.appendChild(t.message),a.appendChild(r);let c=null;!1!==t.dismissible&&(c=T("button","APX-toast__close"),c.setAttribute("aria-label","Close"),c.type="button",a.appendChild(c));let l=null,d=null,u=null,p=null;if(n&&"object"==typeof n&&null!==n){const e=n.type||(n.x||n.y?"sticky":null);if(n.useNativeCSS&&("relative"===e||"anchored"===e)&&n.element){const t=n.element;p=t.style.position,t.style.position="relative";const o=F(n);let a=t.querySelector(`[data-apx-toast-position="${o}"]`);if(a)a.style.flexDirection="up"===i?"column-reverse":"column";else{if(a=T("div","APX-toast-container APX-toast-container-native"),a.setAttribute("data-apx-toast-position",o),a.style.position="absolute",a.style.zIndex=String(this.config.zIndex),a.style.gap=`${this.config.gap}px`,a.setAttribute("aria-live",String(this.config.ariaLive)),a.style.flexDirection="up"===i?"column-reverse":"column","relative"===e)void 0!==n.x&&(n.x.startsWith("-")?a.style.right=n.x.substring(1):a.style.left=n.x),void 0!==n.y&&(n.y.startsWith("-")?a.style.bottom=n.y.substring(1):a.style.top=n.y);else if("anchored"===e){const e=D(n.placement),t=n.gap||"1em";switch(e){case"top":a.style.bottom=`calc(100% + ${t})`,a.style.left="0";break;case"bottom":a.style.top=`calc(100% + ${t})`,a.style.left="0";break;case"left":a.style.right=`calc(100% + ${t})`,a.style.top="0";break;case"right":a.style.left=`calc(100% + ${t})`,a.style.top="0"}}t.appendChild(a)}l=a,u=()=>{if(t&&t.parentElement&&(t.style.position=p||"",a&&0===a.children.length)){const e=a.getAttribute("data-apx-toast-position");e&&X.delete(e),a.remove()}}}else{l=this.getContainerForPosition(n,i);const t=()=>{const e=this.calculatePosition(n,l);Object.assign(l.style,e)};if(t(),("relative"===e||"anchored"===e)&&n.element){let e=null,o=0;const i=16,a=()=>{const n=Date.now();n-o<i?(e&&cancelAnimationFrame(e),e=requestAnimationFrame((()=>{t(),o=Date.now()}))):(t(),o=n)},s=function(e){const t=[];let n=e.parentElement;for(;n&&n!==document.body&&n!==document.documentElement;){const e=window.getComputedStyle(n),o=e.overflow+e.overflowY+e.overflowX;(o.includes("scroll")||o.includes("auto"))&&t.push(n),n=n.parentElement}return t}(n.element);window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),s.forEach((e=>{e.addEventListener("scroll",a,{passive:!0})}));const r=new MutationObserver((()=>{n.element.parentElement||v.close("api")}));r.observe(document.body,{childList:!0,subtree:!0}),d=t,u=()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a),s.forEach((e=>{e.removeEventListener("scroll",a)})),r.disconnect(),e&&cancelAnimationFrame(e)}}}}else l=this.getContainerForPosition(n,i);l?l.appendChild(a):this.container.appendChild(a),a.classList.add("APX-toast--enter"),requestAnimationFrame((()=>{a.classList.add("APX-toast--enter-active")}));let f=t.durationMs,h=null,m=null;const g={click:new Set,close:new Set},y=()=>{!f||f<=0||(m=Date.now(),h=window.setTimeout((()=>v.close("timeout")),f))},b=()=>{null!=h&&(window.clearTimeout(h),h=null,null!=m&&(f-=Date.now()-m))},v={id:s,el:a,close:e=>{cleanup(e||"api")},update:e=>{const n=this.normalizeOptions({...t,...e});"string"==typeof n.message?r.textContent=n.message:n.message&&(r.innerHTML="",r.appendChild(n.message)),["info","success","warning","danger"].forEach((e=>a.classList.remove(`APX-toast--${e}`))),a.classList.add(`APX-toast--${n.type}`),t.className!==n.className&&(t.className&&a.classList.remove(...t.className.split(" ").filter(Boolean)),n.className&&a.classList.add(...n.className.split(" ").filter(Boolean))),t.durationMs=n.durationMs,f=n.durationMs,b(),y()},whenClosed:()=>w,on:(e,t)=>(g[e].add(t),()=>v.off(e,t)),off:(e,t)=>{g[e].delete(t)}},x=(e,t)=>g[e].forEach((e=>{try{e(t)}catch(e){}})),w=new Promise((e=>{const n=n=>{if(x("close",n),"function"==typeof t.onClose)try{t.onClose(v,n)}catch(e){}e()},o=e=>{if(!a)return;if(b(),u&&(u(),u=null),"overflow"===e){a.parentElement&&a.parentElement.removeChild(a);const t=this.open.indexOf(v);return t>=0&&this.open.splice(t,1),this.idToRef.delete(s),void n(e)}a.classList.add("APX-toast--exit"),requestAnimationFrame((()=>a.classList.add("APX-toast--exit-active")));const t=()=>{a.removeEventListener("transitionend",t),a.parentElement&&a.parentElement.removeChild(a);const o=this.open.indexOf(v);o>=0&&this.open.splice(o,1),this.idToRef.delete(s),$&&clearTimeout($),$=setTimeout(j,2e4),n(e)};a.addEventListener("transitionend",t)};v.close=e=>o(e||"api")}));return a.addEventListener("click",(e=>{if(x("click",e),"function"==typeof t.onClick)try{t.onClick(v,e)}catch(e){}})),a.addEventListener("mouseenter",b),a.addEventListener("mouseleave",(()=>y())),c&&c.addEventListener("click",(e=>{e.stopPropagation(),v.close("close")})),this.open.push(v),this.idToRef.set(s,v),this.open.length>this.config.maxToasts&&this.open[0].close("overflow"),y(),v}info(e,t){return this.show({...t||{},message:e,type:"info"})}success(e,t){return this.show({...t||{},message:e,type:"success"})}warning(e,t){return this.show({...t||{},message:e,type:"warning"})}danger(e,t){return this.show({...t||{},message:e,type:"danger"})}closeAll(e){this.open.slice().forEach((t=>t.close(e||"api")))}normalizeOptions(e){const t={...e};return t.type||(t.type="info"),"boolean"!=typeof t.dismissible&&(t.dismissible=!0),"number"!=typeof t.durationMs&&(t.durationMs=this.config.defaultDurationMs),!t.id&&this.config.id&&(t.id=this.config.id),t}getContainerForPosition(e,t,n=!1){if(!L)return null;const o=F(e),i=t&&"auto"!==t?t:M(e);let a=X.get(o);if(!a&&L&&(a=document.querySelector(`[data-apx-toast-position="${o}"]`),a&&X.set(o,a)),a)a.style.flexDirection="up"===i?"column-reverse":"column",n&&!a.hasAttribute("data-apx-toast-managed")&&a.setAttribute("data-apx-toast-managed","true");else{a=T("div","APX-toast-container"),a.setAttribute("data-apx-toast-position",o),n&&a.setAttribute("data-apx-toast-managed","true");const t="string"==typeof e?e:e.type||"bottom-right";if(a.classList.add(`APX-toast-container--${t}`),a.setAttribute("aria-live",String(this.config.ariaLive)),a.style.zIndex=String(this.config.zIndex),a.style.gap=`${this.config.gap}px`,a.style.flexDirection="up"===i?"column-reverse":"column","object"==typeof e&&null!==e){a.style.position="fixed";const t=this.calculatePosition(e,a);Object.assign(a.style,t)}const s=L?(S||(S=document.querySelector(".APX-toast-wrapper"),S||(S=T("div","APX-toast-wrapper"),S.style.position="fixed",S.style.top="0",S.style.left="0",S.style.width="0",S.style.height="0",S.style.pointerEvents="none",S.style.zIndex="10000",document.body.appendChild(S))),S):null;s?s.appendChild(a):document.body.appendChild(a),X.set(o,a)}return a}ensureContainer(){if(this.container||!L)return;const e=this.config.position||"bottom-right",t=void 0!==this.config.flow?this.config.flow:"auto";this.container=this.getContainerForPosition(e,t,!0),this.applyContainerConfig()}applyContainerConfig(){if(!this.container)return;const e=this.config.position||"bottom-right",t="string"==typeof e?e:e.type||"bottom-right";if(this.container.style.zIndex=String(this.config.zIndex),this.container.style.gap=`${this.config.gap}px`,this.container.setAttribute("aria-live",String(this.config.ariaLive)),"string"==typeof e){const e=["bottom-right","bottom-left","top-right","top-left"].map((e=>`APX-toast-container--${e}`));this.container.classList.remove(...e),this.container.classList.add(`APX-toast-container--${t}`)}if(this.config.containerClass&&this.config.containerClass.split(" ").filter(Boolean).forEach((e=>{this.container.classList.add(e)})),"string"==typeof e)if(this.config.offset){const e=`${this.config.offset}px`;t.includes("bottom")?this.container.style.bottom=e:this.container.style.top=e,t.includes("right")?this.container.style.right=e:this.container.style.left=e}else t.includes("bottom")?this.container.style.bottom="":this.container.style.top="",t.includes("right")?this.container.style.right="":this.container.style.left="";else"object"==typeof e&&null!==e&&(this.container.style.position="fixed")}calculatePosition(e,t){if("string"==typeof e)return{};if("object"==typeof e&&null!==e){const t=e.type||(e.x||e.y?"sticky":null);if("sticky"===t||!t&&(e.x||e.y)){const t={};return void 0!==e.x&&(e.x.startsWith("-")?t.right=e.x.substring(1):t.left=e.x),void 0!==e.y&&(e.y.startsWith("-")?t.bottom=e.y.substring(1):t.top=e.y),t}if("relative"===t&&e.element){const t=e.element.getBoundingClientRect(),n=e=>{if(!e)return 0;const t=parseFloat(e);return e.includes("em")?16*t:t},o=n(e.x||"0"),i=n(e.y||"0");return{left:`${t.left+o}px`,top:`${t.top+i}px`}}if("anchored"===t&&e.element){const t=e.element.getBoundingClientRect(),n=(e=>{const t=parseFloat(e);return e.includes("em")?16*t:t})(e.gap||"1em"),o={};switch(D(e.placement)){case"top":o.bottom=`${window.innerHeight-t.top+n}px`,o.left=`${t.left}px`;break;case"bottom":o.top=`${t.bottom+n}px`,o.left=`${t.left}px`;break;case"left":o.right=`${window.innerWidth-t.left+n}px`,o.top=`${t.top}px`;break;case"right":o.left=`${t.right+n}px`,o.top=`${t.top}px`}return o}}return{}}}let I=null;const z=()=>(I||(I=new O(undefined)),I);function _(e){return z().show(e)}Object.assign(_,{create:(e,t)=>{if("string"==typeof e){const n=e,o=new O({...t||{}});return _.custom||(_.custom={}),_.custom[n]=o,o}return new O({...e||{}})},custom:{},use:e=>_.custom&&_.custom[e]||null,Manager:O,show:e=>z().show(e),info:(e,t)=>z().info(e,t),success:(e,t)=>z().success(e,t),warning:(e,t)=>z().warning(e,t),danger:(e,t)=>z().danger(e,t),configure:e=>z().configure(e),setAriaLive:e=>z().setAriaLive(e),closeAll:e=>z().closeAll(e),getOpenToasts:()=>z().getOpenToasts()});const R=_,q=e=>{if(!(e&&e instanceof HTMLFormElement))throw new TypeError("packFormToJSON expects an HTMLFormElement");const t=new FormData(e),n={},o=e=>e.reduce(((e,t)=>"key"===t.type?e?`${e}[${t.name}]`:t.name:"numeric"===t.type?`${e}[${t.index}]`:"array"===t.type?`${e}[]`:e),""),i=new Map,a=new Map,s=[],r=(e,t,n,o)=>{const a=i.get(e)??{isFinal:!1,isIntermediate:!1,hasArraySuffix:!1,key:o};i.has(e)||i.set(e,a),t?(a.isFinal=!0,a.key=o,n&&(a.hasArraySuffix=!0)):(a.isIntermediate=!0,a.key??=o)};for(const[e,n]of t.entries()){if(!e)continue;s.push({key:e,value:n});const t=H(e);let o="";for(let n=0;n<t.length;n++){const i=t[n],a=n===t.length-1,s="array"===i.type;"key"===i.type?o=o?`${o}[${i.name}]`:i.name:"numeric"===i.type?o=`${o}[${i.index}]`:"array"===i.type&&(o=`${o}[]`),r(o,a,s&&a,e)}for(let e=0;e<t.length-1;e++){const n=t[e],o=t[e+1];if("key"===n.type){const e=n.name,t=a.get(e)??{hasNumeric:!1,hasString:!1};a.has(e)||a.set(e,t),o&&("numeric"===o.type?t.hasNumeric=!0:"key"!==o.type&&"array"!==o.type||(t.hasString=!0))}}}(()=>{const e=new Set,t=new Map;for(const[n,o]of i.entries())o.isFinal&&(e.add(n),t.set(n,o.key));for(const[n,o]of i.entries())if(o.isIntermediate)for(const i of e)if(n.startsWith(`${i}[`))throw new Error(`Path conflict: "${i}" is used as a final value (in field "${t.get(i)}"), but "${n}" tries to use it as an intermediate path (in field "${o.key}"). This creates incompatible data structures. You cannot use "${i}" as a primitive value and then access it as an object.`)})();const c=e=>{if(!e)return!1;const t=a.get(e);return t?.hasNumeric&&t?.hasString},l=e=>{const t={};for(let n=0;n<e.length;n++)t[n]=e[n];for(const[n,o]of Object.entries(e)){const e=Number.parseInt(n,10);(Number.isNaN(e)||n!==String(e))&&(t[n]=o)}return t},d=e=>{if(Array.isArray(e))return e;const t=[];if("object"==typeof e&&null!==e)for(const[n,o]of Object.entries(e)){const e=Number.parseInt(n,10);Number.isNaN(e)||(t[e]=o)}return t},u=(e,t,n,o=!1)=>{if(Array.isArray(e)){const o=l(e);return n&&null!==t&&(n[t]=o),o}if("object"!=typeof e||null===e){const e={};return n&&null!==t&&(n[t]=e),e}return e},p=(e,t,n)=>{if(!Array.isArray(e)){const o=d(e);return n&&null!==t&&(n[t]=o),o}return e},f=(e,t,n,o,i)=>{if("array"===t.type)e[t.name]??=[],Array.isArray(e[t.name])?e[t.name].push(n):e[t.name]=[e[t.name],n];else if("numeric"===t.type){const{index:i}=t;for(e=p(e,o.key,o.container);e.length<=i;)e.push(void 0);e[i]=n}else c(i)?(e=u(e,o.key,o.container,!0),Array.isArray(e[t.name])&&(e[t.name]=l(e[t.name])),void 0===e[t.name]||"object"==typeof e[t.name]&&null!==e[t.name]?void 0===e[t.name]?e[t.name]=n:Array.isArray(e[t.name])?e[t.name].push(n):e[t.name]=[e[t.name],n]:e[t.name]=n):void 0===e[t.name]?e[t.name]=n:Array.isArray(e[t.name])?e[t.name].push(n):e[t.name]=[e[t.name],n]},h=(e,t,n,i,a,s,r,f)=>{if("numeric"===t.type){const{index:n}=t;if(c(a)){if(e=u(e,i.key,i.container,!0),e[n]??={},"object"!=typeof e[n]||null===e[n]){const t=s.slice(0,r+1),i=o(t);throw new Error(`Cannot access property on primitive value. Key "${f}" tries to access "${i}" but it is already a ${typeof e[n]} value: ${JSON.stringify(e[n])}. This should have been detected during conflict detection phase.`)}}else{for(e=p(e,i.key,i.container);e.length<=n;)e.push(void 0);if(e[n]??={},"object"!=typeof e[n]||null===e[n]){const t=s.slice(0,r+1),i=o(t);throw new Error(`Cannot access property on primitive value. Key "${f}" tries to access "${i}" but it is already a ${typeof e[n]} value: ${JSON.stringify(e[n])}. This should have been detected during conflict detection phase.`)}}return e[n]}const h="numeric"===n?.type;if(c(a)){if(e=u(e,i.key,i.container,!0),e[t.name]??={},Array.isArray(e[t.name]))e[t.name]=l(e[t.name]);else if("object"!=typeof e[t.name]||null===e[t.name]){const n=s.slice(0,r+1),i=o(n);throw new Error(`Cannot access property on primitive value. Key "${f}" tries to access "${i}" but it is already a ${typeof e[t.name]} value: ${JSON.stringify(e[t.name])}. This should have been detected during conflict detection phase.`)}}else void 0===e[t.name]?e[t.name]=h?[]:{}:h&&!Array.isArray(e[t.name])?Object.keys(e[t.name]).some((e=>{const t=Number.parseInt(e,10);return Number.isNaN(t)||e!==String(t)}))||(e[t.name]=d(e[t.name])):h||Z(e[t.name])||(Array.isArray(e[t.name])?e[t.name]=l(e[t.name]):e[t.name]={});if(void 0!==e[t.name]&&("object"!=typeof e[t.name]||null===e[t.name])){const n=s.slice(0,r+1),i=o(n);throw new Error(`Cannot access property on primitive value. Key "${f}" tries to access "${i}" but it is already a ${typeof e[t.name]} value: ${JSON.stringify(e[t.name])}. This should have been detected during conflict detection phase.`)}return e[t.name]};for(const{value:e,key:t}of s){if(!t)continue;const o=H(t),i=[{container:n,key:null}];let a=n;const s="key"===o[0]?.type?o[0].name:"";for(let n=0;n<o.length;n++){const r=o[n],c=n===o.length-1,l=n+1<o.length?o[n+1]:null,d=i[i.length-1];if(c)f(a,r,e,d,s);else{const e=h(a,r,l,d,s,o,n,t);i.push({container:a,key:"numeric"===r.type?r.index:r.name}),a=e}}}return n},H=e=>{const t=[];let n="",o=0;const i=e.length;for(;o<i;){const a=e[o];if("["===a){n&&(t.push({name:n,type:"key"}),n=""),o++;let a="";for(;o<i&&"]"!==e[o];)a+=e[o],o++;if(""===a){const e=t[t.length-1];e?e.type="array":t.push({name:"",type:"array"})}else{const e=Number.parseInt(a,10);Number.isNaN(e)||a!==String(e)?t.push({name:a,type:"key"}):t.push({name:String(e),type:"numeric",index:e})}o++}else n+=a,o++}return n&&t.push({name:n,type:"key"}),t},Z=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),B={packFormToJSON:q},U=function(n,o=document){let i;if("string"==typeof o)o=document.querySelector(o);else if(U.isAPXObject(o))o=o.first();else if(!(o instanceof HTMLElement||o instanceof Document))throw new Error("Invalid context for APX");if("string"==typeof n&&n.startsWith("//")){i=document.evaluate(n,o,null,XPathResult.ANY_TYPE,null);let e=[],t=i.iterateNext();for(;t;)e.push(t),t=i.iterateNext();i=e}else if("string"==typeof n)i=o.querySelectorAll(n);else if(n instanceof HTMLElement)i=o.contains(n)?[n]:[];else if(n instanceof NodeList||n instanceof HTMLCollection)i=Array.from(n).filter((e=>o.contains(e)));else if(Array.isArray(n)&&n.every((e=>e instanceof HTMLElement)))i=n.filter((e=>o.contains(e)));else if("undefined"!=typeof jQuery&&n instanceof jQuery)i=Array.from(n.get()).filter((e=>o.contains(e)));else{if("function"!=typeof n)throw new Error("Invalid input type for APX");i=U(n(),o)}var s={elements:i,_isAPXObject:!0};return s.length=i.length,s.each=function(e){return this.elements instanceof Array&&this.elements.forEach(e),this.elements instanceof NodeList&&Array.from(this.elements).forEach(e),this},s.get=function(e){return this.elements[e]},s.all=function(){return this.elements instanceof Array?this.elements:this.elements instanceof NodeList?Array.from(this.elements):this},s.first=function(){return this.get(0)},function(n){let o=n.elements;n.listen=function(n,i,s){let r,c={};"string"==typeof i?(r=i,c=s||{}):c=i||{};const l=function(){const t=Math.random().toString(36).substr(2,9),n=`${Date.now()}_${t}_${e}`;return e=(e+1)%1e3,n}(),d=c.timeout||0;return Array.isArray(n)||(n=[n]),n.forEach((e=>{o.forEach((t=>{t.addEventListener(e,(e=>{a(e,l,d,r,t)}))}))})),{do:function(e){return t[l]||(t[l]=[]),t[l].push(e),this}}},n.trigger=function(e){let o;if("string"==typeof e)o=e,e=new Event(e,{bubbles:!0,cancelable:!0});else{if(!(e instanceof Event))return void console.error("Invalid event type provided to apx.trigger. It must be either a string or Event object.");o=e.type}n.elements.forEach((t=>{t.dispatchEvent(e)})),Object.keys(t).forEach((n=>{const i=t[n];if(i&&i.eventType===o){const{selector:t}=i;t&&!e.target.matches(t)||a(e,n,0,t,e.target)}}))}}(s),x(s),function(e){e.pack=function(){const e=this.first();if(!e)throw new Error("No element found");if("FORM"!==e.tagName)throw new Error("Element is not a form");return q(e)}}(s),s};U.loadCss=function(e){return fetch(e).then((e=>e.text())).then((e=>{const t=document.createElement("style");t.type="text/css",t.textContent=e,document.head.appendChild(t)})).catch((e=>{console.error("Failed to load CSS:",e)}))},U.dialog=e=>{const{title:t,content:n,contentURI:o,buttons:i,size:a,showLoadingIndicator:s,contentMethod:r,contentData:c,contentHeaders:l}={title:"",content:"",contentURI:"",buttons:[],size:"medium",showLoadingIndicator:!1,contentMethod:"GET",contentData:null,contentHeaders:void 0,...e},d=document.createElement("div");d.innerHTML='<div class="APX-dialog"> <div class="APX-dialog-content"> <span class="APX-close-dialog">&times;</span> <h2 class="APX-dialog-title"></h2> <div class="APX-dialog-dynamic-content"></div> <div class="APX-dialog-button-container"></div> </div> </div>'.trim();const u=d.firstChild,p={},f={};["opening","opened","closing","closed","contentLoading","contentLoaded"].forEach((e=>{f[e]=new Promise((t=>{p[e]=t}))}));const h=e=>{p[e]?p[e]():console.warn(`No resolver found for lifecycle event: ${e}`)},m={element:u,buttons:{},isClosed:!1,lifecycle:f,disableButton:e=>{const t=u.querySelector(`.APX-dialog-button[data-key="${e}"]`);t&&(t.disabled=!0,t.classList.add("APX-dialog-button-disabled"))},enableButton:e=>{const t=u.querySelector(`.APX-dialog-button[data-key="${e}"]`);t&&(t.disabled=!1,t.classList.remove("APX-dialog-button-disabled"))},open:async()=>{try{h("opening"),await m.lifecycle.opening,s&&o?(document.body.appendChild(u),u.style.display="flex",u.querySelector(".APX-dialog-dynamic-content").innerHTML='<div class="APX-dialog-loading-indicator"></div>',await y()):(await y(),document.body.appendChild(u),u.style.display="flex"),h("opened"),await m.lifecycle.opened}catch(e){console.error("Error opening dialog:",e)}return m},close:async()=>{try{h("closing"),await m.lifecycle.closing,g(),h("closed"),await m.lifecycle.closed}catch(e){console.error("Error during dialog closing:",e)}return m}},g=()=>{m.isClosed||(m.isClosed=!0,u.style.display="none",document.body.contains(u)&&document.body.removeChild(u))},y=async()=>{const e=document.body.style.cursor;document.body.style.cursor="wait";const t=u.querySelector(".APX-dialog-dynamic-content");try{h("contentLoading"),await m.lifecycle.contentLoading;const e=o?await b(o):n;t.innerHTML=e,h("contentLoaded"),await m.lifecycle.contentLoaded}catch(e){console.error("Error loading content:",e)}finally{document.body.style.cursor=e}},b=async e=>{const t=(r||"GET").toUpperCase(),n={...l||{}},o=Object.keys(n).some((e=>"content-type"===e.toLowerCase())),i={method:t};if("POST"===t){let e;const t="undefined"!=typeof FormData&&c instanceof FormData,a="undefined"!=typeof URLSearchParams&&c instanceof URLSearchParams,s="undefined"!=typeof Blob&&c instanceof Blob,r="string"==typeof c,l=c&&"object"==typeof c&&!t&&!a&&!s;t?e=c:a?(e=c,o||(n["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8")):l?(e=JSON.stringify(c),o||(n["Content-Type"]="application/json")):(r||s||null!=c)&&(e=c),void 0!==e&&(i.body=e)}Object.keys(n).length>0&&(i.headers=n);const a=await fetch(e,i);if(!a.ok)throw new Error(`Failed to fetch content: ${a.statusText}`);return a.text()};return(()=>{const e=u.querySelector(".APX-dialog-content");if("auto"===a)return;const t={small:{width:"300px",height:"200px"},medium:{width:"500px",height:"400px"},large:{width:"800px",height:"600px"}}[a]||"object"==typeof a&&a;t&&(e.style.minWidth=t.width||"500px",e.style.minHeight=t.height||"400px")})(),(()=>{const e=u.querySelector(".APX-dialog-button-container");i.forEach((({key:t,label:n,order:o=0,align:i="flex-end",closeOnClick:a=!0})=>{const s=document.createElement("button");s.classList.add("APX-dialog-button"),s.textContent=n,s.style.order=o,s.setAttribute("data-key",t);const r={disable:()=>{s.disabled=!0,s.classList.add("APX-dialog-button-disabled")},enable:()=>{s.disabled=!1,s.classList.remove("APX-dialog-button-disabled")},key:t,element:s};if(a){let e=!1;const n=new Promise((t=>{s.onclick=()=>{e||s.disabled||(e=!0,t({dialog:m,button:r}),m.close())}}));m.buttons[t]=n}else{let e=[];const n={then:t=>("function"==typeof t&&e.push(t),n)};s.onclick=()=>{s.disabled||e.forEach((e=>e({dialog:m,button:r})))},m.buttons[t]=n}e.appendChild(s),e.style.justifyContent=i}))})(),u.querySelector(".APX-dialog-title").textContent=t,u.querySelector(".APX-close-dialog").onclick=m.close,m},U.toast=R,U.tools=B,U.isAPXObject=function(e){return e&&!0===e._isAPXObject},U.is_numeric=e=>!isNaN(e-parseFloat(e));const Y=U})();var i=o.Z;export{i as default};